diff --git a/TSRM/LICENSE b/TSRM/LICENSE deleted file mode 100644 index 84b8348ebfe1a..0000000000000 --- a/TSRM/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 1999-2006, Andi Gutmans, Sascha Schumann, Zeev Suraski. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -- Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -- Neither name of the copyright holders nor the names of their contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. - - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS -IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/TSRM/Makefile.am b/TSRM/Makefile.am deleted file mode 100644 index 91e585b65c89a..0000000000000 --- a/TSRM/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## process this file with automake to produce Makefile.am -AUTOMAKE_OPTIONS=foreign -noinst_LTLIBRARIES=libtsrm.la -libtsrm_la_SOURCES = TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c - -depend: diff --git a/TSRM/TODO b/TSRM/TODO deleted file mode 100644 index 82b4fedfde142..0000000000000 --- a/TSRM/TODO +++ /dev/null @@ -1,2 +0,0 @@ -- Improve the lock in ts_resource_ex() in order to cover less code. - This can probably be done by more careful hash table access diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c deleted file mode 100644 index f1182e6f456b5..0000000000000 --- a/TSRM/TSRM.c +++ /dev/null @@ -1,764 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Thread Safe Resource Manager | - +----------------------------------------------------------------------+ - | Copyright (c) 1999-2008, Andi Gutmans, Sascha Schumann, Zeev Suraski | - | This source file is subject to the TSRM license, that is bundled | - | with this package in the file LICENSE | - +----------------------------------------------------------------------+ - | Authors: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#include "TSRM.h" - -#ifdef ZTS - -#include - -#if HAVE_STDARG_H -#include -#endif - -typedef struct _tsrm_tls_entry tsrm_tls_entry; - -struct _tsrm_tls_entry { - void **storage; - int count; - THREAD_T thread_id; - tsrm_tls_entry *next; -}; - - -typedef struct { - size_t size; - ts_allocate_ctor ctor; - ts_allocate_dtor dtor; - int done; -} tsrm_resource_type; - - -/* The memory manager table */ -static tsrm_tls_entry **tsrm_tls_table=NULL; -static int tsrm_tls_table_size; -static ts_rsrc_id id_count; - -/* The resource sizes table */ -static tsrm_resource_type *resource_types_table=NULL; -static int resource_types_table_size; - - -static MUTEX_T tsmm_mutex; /* thread-safe memory manager mutex */ - -/* New thread handlers */ -static tsrm_thread_begin_func_t tsrm_new_thread_begin_handler; -static tsrm_thread_end_func_t tsrm_new_thread_end_handler; - -/* Debug support */ -int tsrm_error(int level, const char *format, ...); - -/* Read a resource from a thread's resource storage */ -static int tsrm_error_level; -static FILE *tsrm_error_file; - -#if TSRM_DEBUG -#define TSRM_ERROR(args) tsrm_error args -#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \ - { \ - int unshuffled_offset = TSRM_UNSHUFFLE_RSRC_ID(offset); \ - \ - if (offset==0) { \ - return &array; \ - } else if ((unshuffled_offset)>=0 && (unshuffled_offset)<(range)) { \ - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Successfully fetched resource id %d for thread id %ld - 0x%0.8X", \ - unshuffled_offset, (long) thread_resources->thread_id, array[unshuffled_offset])); \ - return array[unshuffled_offset]; \ - } else { \ - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Resource id %d is out of range (%d..%d)", \ - unshuffled_offset, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1))); \ - return NULL; \ - } \ - } -#else -#define TSRM_ERROR(args) -#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \ - if (offset==0) { \ - return &array; \ - } else { \ - return array[TSRM_UNSHUFFLE_RSRC_ID(offset)]; \ - } -#endif - -#if defined(PTHREADS) -/* Thread local storage */ -static pthread_key_t tls_key; -# define tsrm_tls_set(what) pthread_setspecific(tls_key, (void*)(what)) -# define tsrm_tls_get() pthread_getspecific(tls_key) - -#elif defined(TSRM_ST) -static int tls_key; -# define tsrm_tls_set(what) st_thread_setspecific(tls_key, (void*)(what)) -# define tsrm_tls_get() st_thread_getspecific(tls_key) - -#elif defined(TSRM_WIN32) -static DWORD tls_key; -# define tsrm_tls_set(what) TlsSetValue(tls_key, (void*)(what)) -# define tsrm_tls_get() TlsGetValue(tls_key) - -#elif defined(BETHREADS) -static int32 tls_key; -# define tsrm_tls_set(what) tls_set(tls_key, (void*)(what)) -# define tsrm_tls_get() (tsrm_tls_entry*)tls_get(tls_key) - -#else -# define tsrm_tls_set(what) -# define tsrm_tls_get() NULL -# warning tsrm_set_interpreter_context is probably broken on this platform -#endif - -/* Startup TSRM (call once for the entire process) */ -TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename) -{ -#if defined(GNUPTH) - pth_init(); -#elif defined(PTHREADS) - pthread_key_create( &tls_key, 0 ); -#elif defined(TSRM_ST) - st_init(); - st_key_create(&tls_key, 0); -#elif defined(TSRM_WIN32) - tls_key = TlsAlloc(); -#elif defined(BETHREADS) - tls_key = tls_allocate(); -#endif - - tsrm_error_file = stderr; - tsrm_error_set(debug_level, debug_filename); - tsrm_tls_table_size = expected_threads; - - tsrm_tls_table = (tsrm_tls_entry **) calloc(tsrm_tls_table_size, sizeof(tsrm_tls_entry *)); - if (!tsrm_tls_table) { - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate TLS table")); - return 0; - } - id_count=0; - - resource_types_table_size = expected_resources; - resource_types_table = (tsrm_resource_type *) calloc(resource_types_table_size, sizeof(tsrm_resource_type)); - if (!resource_types_table) { - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate resource types table")); - free(tsrm_tls_table); - tsrm_tls_table = NULL; - return 0; - } - - tsmm_mutex = tsrm_mutex_alloc(); - - tsrm_new_thread_begin_handler = tsrm_new_thread_end_handler = NULL; - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Started up TSRM, %d expected threads, %d expected resources", expected_threads, expected_resources)); - return 1; -} - - -/* Shutdown TSRM (call once for the entire process) */ -TSRM_API void tsrm_shutdown(void) -{ - int i; - - if (tsrm_tls_table) { - for (i=0; inext; - for (j=0; jcount; j++) { - if (p->storage[j]) { - if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) { - resource_types_table[j].dtor(p->storage[j], &p->storage); - } - free(p->storage[j]); - } - } - free(p->storage); - free(p); - p = next_p; - } - } - free(tsrm_tls_table); - tsrm_tls_table = NULL; - } - if (resource_types_table) { - free(resource_types_table); - resource_types_table=NULL; - } - tsrm_mutex_free(tsmm_mutex); - tsmm_mutex = NULL; - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Shutdown TSRM")); - if (tsrm_error_file!=stderr) { - fclose(tsrm_error_file); - } -#if defined(GNUPTH) - pth_kill(); -#elif defined(PTHREADS) - pthread_setspecific(tls_key, 0); - pthread_key_delete(tls_key); -#elif defined(TSRM_WIN32) - TlsFree(tls_key); -#endif -} - - -/* allocates a new thread-safe-resource id */ -TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor) -{ - int i; - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtaining a new resource id, %d bytes", size)); - - tsrm_mutex_lock(tsmm_mutex); - - /* obtain a resource id */ - *rsrc_id = TSRM_SHUFFLE_RSRC_ID(id_count++); - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtained resource id %d", *rsrc_id)); - - /* store the new resource type in the resource sizes table */ - if (resource_types_table_size < id_count) { - resource_types_table = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count); - if (!resource_types_table) { - tsrm_mutex_unlock(tsmm_mutex); - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate storage for resource")); - *rsrc_id = 0; - return 0; - } - resource_types_table_size = id_count; - } - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].size = size; - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].ctor = ctor; - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].dtor = dtor; - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].done = 0; - - /* enlarge the arrays for the already active threads */ - for (i=0; icount < id_count) { - int j; - - p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count); - for (j=p->count; jstorage[j] = (void *) malloc(resource_types_table[j].size); - if (resource_types_table[j].ctor) { - resource_types_table[j].ctor(p->storage[j], &p->storage); - } - } - p->count = id_count; - } - p = p->next; - } - } - tsrm_mutex_unlock(tsmm_mutex); - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d", *rsrc_id)); - return *rsrc_id; -} - - -static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_T thread_id) -{ - int i; - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Creating data structures for thread %x", thread_id)); - (*thread_resources_ptr) = (tsrm_tls_entry *) malloc(sizeof(tsrm_tls_entry)); - (*thread_resources_ptr)->storage = (void **) malloc(sizeof(void *)*id_count); - (*thread_resources_ptr)->count = id_count; - (*thread_resources_ptr)->thread_id = thread_id; - (*thread_resources_ptr)->next = NULL; - - /* Set thread local storage to this new thread resources structure */ - tsrm_tls_set(*thread_resources_ptr); - - if (tsrm_new_thread_begin_handler) { - tsrm_new_thread_begin_handler(thread_id, &((*thread_resources_ptr)->storage)); - } - for (i=0; istorage[i] = NULL; - } else - { - (*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size); - if (resource_types_table[i].ctor) { - resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage); - } - } - } - - if (tsrm_new_thread_end_handler) { - tsrm_new_thread_end_handler(thread_id, &((*thread_resources_ptr)->storage)); - } - - tsrm_mutex_unlock(tsmm_mutex); -} - - -/* fetches the requested resource for the current thread */ -TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id) -{ - THREAD_T thread_id; - int hash_value; - tsrm_tls_entry *thread_resources; - -#ifdef NETWARE - /* The below if loop is added for NetWare to fix an abend while unloading PHP - * when an Apache unload command is issued on the system console. - * While exiting from PHP, at the end for some reason, this function is called - * with tsrm_tls_table = NULL. When this happened, the server abends when - * tsrm_tls_table is accessed since it is NULL. - */ - if(tsrm_tls_table) { -#endif - if (!th_id) { - /* Fast path for looking up the resources for the current - * thread. Its used by just about every call to - * ts_resource_ex(). This avoids the need for a mutex lock - * and our hashtable lookup. - */ - thread_resources = tsrm_tls_get(); - - if (thread_resources) { - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id)); - /* Read a specific resource from the thread's resources. - * This is called outside of a mutex, so have to be aware about external - * changes to the structure as we read it. - */ - TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); - } - thread_id = tsrm_thread_id(); - } else { - thread_id = *th_id; - } - - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for thread %ld", id, (long) thread_id)); - tsrm_mutex_lock(tsmm_mutex); - - hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size); - thread_resources = tsrm_tls_table[hash_value]; - - if (!thread_resources) { - allocate_new_resource(&tsrm_tls_table[hash_value], thread_id); - return ts_resource_ex(id, &thread_id); - } else { - do { - if (thread_resources->thread_id == thread_id) { - break; - } - if (thread_resources->next) { - thread_resources = thread_resources->next; - } else { - allocate_new_resource(&thread_resources->next, thread_id); - return ts_resource_ex(id, &thread_id); - /* - * thread_resources = thread_resources->next; - * break; - */ - } - } while (thread_resources); - } - tsrm_mutex_unlock(tsmm_mutex); - /* Read a specific resource from the thread's resources. - * This is called outside of a mutex, so have to be aware about external - * changes to the structure as we read it. - */ - TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); -#ifdef NETWARE - } /* if(tsrm_tls_table) */ -#endif -} - -/* frees an interpreter context. You are responsible for making sure that - * it is not linked into the TSRM hash, and not marked as the current interpreter */ -void tsrm_free_interpreter_context(void *context) -{ - tsrm_tls_entry *next, *thread_resources = (tsrm_tls_entry*)context; - int i; - - while (thread_resources) { - next = thread_resources->next; - - for (i=0; icount; i++) { - if (resource_types_table[i].dtor) { - resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage); - } - } - for (i=0; icount; i++) { - free(thread_resources->storage[i]); - } - free(thread_resources->storage); - free(thread_resources); - thread_resources = next; - } -} - -void *tsrm_set_interpreter_context(void *new_ctx) -{ - tsrm_tls_entry *current; - - current = tsrm_tls_get(); - - /* TODO: unlink current from the global linked list, and replace it - * it with the new context, protected by mutex where/if appropriate */ - - /* Set thread local storage to this new thread resources structure */ - tsrm_tls_set(new_ctx); - - /* return old context, so caller can restore it when they're done */ - return current; -} - - -/* allocates a new interpreter context */ -void *tsrm_new_interpreter_context(void) -{ - tsrm_tls_entry *new_ctx, *current; - THREAD_T thread_id; - - thread_id = tsrm_thread_id(); - tsrm_mutex_lock(tsmm_mutex); - - current = tsrm_tls_get(); - - allocate_new_resource(&new_ctx, thread_id); - - /* switch back to the context that was in use prior to our creation - * of the new one */ - return tsrm_set_interpreter_context(current); -} - - -/* frees all resources allocated for the current thread */ -void ts_free_thread(void) -{ - tsrm_tls_entry *thread_resources; - int i; - THREAD_T thread_id = tsrm_thread_id(); - int hash_value; - tsrm_tls_entry *last=NULL; - - tsrm_mutex_lock(tsmm_mutex); - hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size); - thread_resources = tsrm_tls_table[hash_value]; - - while (thread_resources) { - if (thread_resources->thread_id == thread_id) { - for (i=0; icount; i++) { - if (resource_types_table[i].dtor) { - resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage); - } - } - for (i=0; icount; i++) { - free(thread_resources->storage[i]); - } - free(thread_resources->storage); - if (last) { - last->next = thread_resources->next; - } else { - tsrm_tls_table[hash_value] = thread_resources->next; - } - tsrm_tls_set(0); - free(thread_resources); - break; - } - if (thread_resources->next) { - last = thread_resources; - } - thread_resources = thread_resources->next; - } - tsrm_mutex_unlock(tsmm_mutex); -} - - -/* frees all resources allocated for all threads except current */ -void ts_free_worker_threads(void) -{ - tsrm_tls_entry *thread_resources; - int i; - THREAD_T thread_id = tsrm_thread_id(); - int hash_value; - tsrm_tls_entry *last=NULL; - - tsrm_mutex_lock(tsmm_mutex); - hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size); - thread_resources = tsrm_tls_table[hash_value]; - - while (thread_resources) { - if (thread_resources->thread_id != thread_id) { - for (i=0; icount; i++) { - if (resource_types_table[i].dtor) { - resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage); - } - } - for (i=0; icount; i++) { - free(thread_resources->storage[i]); - } - free(thread_resources->storage); - if (last) { - last->next = thread_resources->next; - } else { - tsrm_tls_table[hash_value] = thread_resources->next; - } - free(thread_resources); - if (last) { - thread_resources = last->next; - } else { - thread_resources = tsrm_tls_table[hash_value]; - } - } else { - if (thread_resources->next) { - last = thread_resources; - } - thread_resources = thread_resources->next; - } - } - tsrm_mutex_unlock(tsmm_mutex); -} - - -/* deallocates all occurrences of a given id */ -void ts_free_id(ts_rsrc_id id) -{ - int i; - int j = TSRM_UNSHUFFLE_RSRC_ID(id); - - tsrm_mutex_lock(tsmm_mutex); - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Freeing resource id %d", id)); - - if (tsrm_tls_table) { - for (i=0; icount > j && p->storage[j]) { - if (resource_types_table && resource_types_table[j].dtor) { - resource_types_table[j].dtor(p->storage[j], &p->storage); - } - free(p->storage[j]); - p->storage[j] = NULL; - } - p = p->next; - } - } - } - resource_types_table[j].done = 1; - - tsrm_mutex_unlock(tsmm_mutex); - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully freed resource id %d", id)); -} - - - - -/* - * Utility Functions - */ - -/* Obtain the current thread id */ -TSRM_API THREAD_T tsrm_thread_id(void) -{ -#ifdef TSRM_WIN32 - return GetCurrentThreadId(); -#elif defined(GNUPTH) - return pth_self(); -#elif defined(PTHREADS) - return pthread_self(); -#elif defined(NSAPI) - return systhread_current(); -#elif defined(PI3WEB) - return PIThread_getCurrent(); -#elif defined(TSRM_ST) - return st_thread_self(); -#elif defined(BETHREADS) - return find_thread(NULL); -#endif -} - - -/* Allocate a mutex */ -TSRM_API MUTEX_T tsrm_mutex_alloc(void) -{ - MUTEX_T mutexp; -#ifdef TSRM_WIN32 - mutexp = malloc(sizeof(CRITICAL_SECTION)); - InitializeCriticalSection(mutexp); -#elif defined(GNUPTH) - mutexp = (MUTEX_T) malloc(sizeof(*mutexp)); - pth_mutex_init(mutexp); -#elif defined(PTHREADS) - mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); - pthread_mutex_init(mutexp,NULL); -#elif defined(NSAPI) - mutexp = crit_init(); -#elif defined(PI3WEB) - mutexp = PIPlatform_allocLocalMutex(); -#elif defined(TSRM_ST) - mutexp = st_mutex_new(); -#elif defined(BETHREADS) - mutexp = (beos_ben*)malloc(sizeof(beos_ben)); - mutexp->ben = 0; - mutexp->sem = create_sem(1, "PHP sempahore"); -#endif -#ifdef THR_DEBUG - printf("Mutex created thread: %d\n",mythreadid()); -#endif - return( mutexp ); -} - - -/* Free a mutex */ -TSRM_API void tsrm_mutex_free(MUTEX_T mutexp) -{ - if (mutexp) { -#ifdef TSRM_WIN32 - DeleteCriticalSection(mutexp); - free(mutexp); -#elif defined(GNUPTH) - free(mutexp); -#elif defined(PTHREADS) - pthread_mutex_destroy(mutexp); - free(mutexp); -#elif defined(NSAPI) - crit_terminate(mutexp); -#elif defined(PI3WEB) - PISync_delete(mutexp); -#elif defined(TSRM_ST) - st_mutex_destroy(mutexp); -#elif defined(BETHREADS) - delete_sem(mutexp->sem); - free(mutexp); -#endif - } -#ifdef THR_DEBUG - printf("Mutex freed thread: %d\n",mythreadid()); -#endif -} - - -/* Lock a mutex */ -TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp) -{ - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Mutex locked thread: %ld", tsrm_thread_id())); -#ifdef TSRM_WIN32 - EnterCriticalSection(mutexp); - return 1; -#elif defined(GNUPTH) - return pth_mutex_acquire(mutexp, 0, NULL); -#elif defined(PTHREADS) - return pthread_mutex_lock(mutexp); -#elif defined(NSAPI) - return crit_enter(mutexp); -#elif defined(PI3WEB) - return PISync_lock(mutexp); -#elif defined(TSRM_ST) - return st_mutex_lock(mutexp); -#elif defined(BETHREADS) - if (atomic_add(&mutexp->ben, 1) != 0) - return acquire_sem(mutexp->sem); - return 0; -#endif -} - - -/* Unlock a mutex */ -TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp) -{ - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Mutex unlocked thread: %ld", tsrm_thread_id())); -#ifdef TSRM_WIN32 - LeaveCriticalSection(mutexp); - return 1; -#elif defined(GNUPTH) - return pth_mutex_release(mutexp); -#elif defined(PTHREADS) - return pthread_mutex_unlock(mutexp); -#elif defined(NSAPI) - return crit_exit(mutexp); -#elif defined(PI3WEB) - return PISync_unlock(mutexp); -#elif defined(TSRM_ST) - return st_mutex_unlock(mutexp); -#elif defined(BETHREADS) - if (atomic_add(&mutexp->ben, -1) != 1) - return release_sem(mutexp->sem); - return 0; -#endif -} - - -TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler) -{ - void *retval = (void *) tsrm_new_thread_begin_handler; - - tsrm_new_thread_begin_handler = new_thread_begin_handler; - return retval; -} - - -TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler) -{ - void *retval = (void *) tsrm_new_thread_end_handler; - - tsrm_new_thread_end_handler = new_thread_end_handler; - return retval; -} - - - -/* - * Debug support - */ - -#if TSRM_DEBUG -int tsrm_error(int level, const char *format, ...) -{ - if (level<=tsrm_error_level) { - va_list args; - int size; - - fprintf(tsrm_error_file, "TSRM: "); - va_start(args, format); - size = vfprintf(tsrm_error_file, format, args); - va_end(args); - fprintf(tsrm_error_file, "\n"); - fflush(tsrm_error_file); - return size; - } else { - return 0; - } -} -#endif - - -void tsrm_error_set(int level, char *debug_filename) -{ - tsrm_error_level = level; - -#if TSRM_DEBUG - if (tsrm_error_file!=stderr) { /* close files opened earlier */ - fclose(tsrm_error_file); - } - - if (debug_filename) { - tsrm_error_file = fopen(debug_filename, "w"); - if (!tsrm_error_file) { - tsrm_error_file = stderr; - } - } else { - tsrm_error_file = stderr; - } -#endif -} - -#endif /* ZTS */ diff --git a/TSRM/TSRM.dsp b/TSRM/TSRM.dsp deleted file mode 100644 index 1a5693f5a23c4..0000000000000 --- a/TSRM/TSRM.dsp +++ /dev/null @@ -1,186 +0,0 @@ -# Microsoft Developer Studio Project File - Name="TSRM" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=TSRM - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "TSRM.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "TSRM.mak" CFG="TSRM - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "TSRM - Win32 Debug_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "TSRM - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "TSRM___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "TSRM___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "C:\Projects\TSRM" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=1 /YX /FD /GZ /c -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TS" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TSDbg" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "TSRM - Win32 Debug_TS" -# Name "TSRM - Win32 Release_TS" -# Name "TSRM - Win32 Release_TS_inline" -# Name "TSRM - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\TSRM.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_strtok_r.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_virtual_cwd.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_win32.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\readdir.h -# End Source File -# Begin Source File - -SOURCE=.\TSRM.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_config.w32.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_config_common.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_strtok_r.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_virtual_cwd.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_win32.h -# End Source File -# End Group -# End Target -# End Project diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h deleted file mode 100644 index 4a73c3487bc04..0000000000000 --- a/TSRM/TSRM.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Thread Safe Resource Manager | - +----------------------------------------------------------------------+ - | Copyright (c) 1999-2008, Andi Gutmans, Sascha Schumann, Zeev Suraski | - | This source file is subject to the TSRM license, that is bundled | - | with this package in the file LICENSE | - +----------------------------------------------------------------------+ - | Authors: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#ifndef TSRM_H -#define TSRM_H - -#if !defined(__CYGWIN__) && defined(WIN32) -# define TSRM_WIN32 -# include "tsrm_config.w32.h" -#else -# include -#endif - -#ifdef TSRM_WIN32 -# ifdef TSRM_EXPORTS -# define TSRM_API __declspec(dllexport) -# else -# define TSRM_API __declspec(dllimport) -# endif -#else -# define TSRM_API -#endif - -#ifdef _WIN64 -typedef __int64 tsrm_intptr_t; -typedef unsigned __int64 tsrm_uintptr_t; -#else -typedef long tsrm_intptr_t; -typedef unsigned long tsrm_uintptr_t; -#endif - -/* Only compile multi-threading functions if we're in ZTS mode */ -#ifdef ZTS - -#ifdef TSRM_WIN32 -# ifndef TSRM_INCLUDE_FULL_WINDOWS_HEADERS -# define WIN32_LEAN_AND_MEAN -# endif -# include -# include -#elif defined(GNUPTH) -# include -#elif defined(PTHREADS) -# include -#elif defined(TSRM_ST) -# include -#elif defined(BETHREADS) -#include -#include -#endif - -typedef int ts_rsrc_id; - -/* Define THREAD_T and MUTEX_T */ -#ifdef TSRM_WIN32 -# define THREAD_T DWORD -# define MUTEX_T CRITICAL_SECTION * -#elif defined(GNUPTH) -# define THREAD_T pth_t -# define MUTEX_T pth_mutex_t * -#elif defined(PTHREADS) -# define THREAD_T pthread_t -# define MUTEX_T pthread_mutex_t * -#elif defined(NSAPI) -# define THREAD_T SYS_THREAD -# define MUTEX_T CRITICAL -#elif defined(PI3WEB) -# define THREAD_T PIThread * -# define MUTEX_T PISync * -#elif defined(TSRM_ST) -# define THREAD_T st_thread_t -# define MUTEX_T st_mutex_t -#elif defined(BETHREADS) -# define THREAD_T thread_id -typedef struct { - sem_id sem; - int32 ben; -} beos_ben; -# define MUTEX_T beos_ben * -#endif - -typedef void (*ts_allocate_ctor)(void *, void ***); -typedef void (*ts_allocate_dtor)(void *, void ***); - -#define THREAD_HASH_OF(thr,ts) (unsigned long)thr%(unsigned long)ts - -#ifdef __cplusplus -extern "C" { -#endif - -/* startup/shutdown */ -TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename); -TSRM_API void tsrm_shutdown(void); - -/* allocates a new thread-safe-resource id */ -TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor); - -/* fetches the requested resource for the current thread */ -TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id); -#define ts_resource(id) ts_resource_ex(id, NULL) - -/* frees all resources allocated for the current thread */ -TSRM_API void ts_free_thread(void); - -/* frees all resources allocated for all threads except current */ -void ts_free_worker_threads(void); - -/* deallocates all occurrences of a given id */ -TSRM_API void ts_free_id(ts_rsrc_id id); - - -/* Debug support */ -#define TSRM_ERROR_LEVEL_ERROR 1 -#define TSRM_ERROR_LEVEL_CORE 2 -#define TSRM_ERROR_LEVEL_INFO 3 - -typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id, void ***tsrm_ls); -typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id, void ***tsrm_ls); - - -TSRM_API int tsrm_error(int level, const char *format, ...); -TSRM_API void tsrm_error_set(int level, char *debug_filename); - -/* utility functions */ -TSRM_API THREAD_T tsrm_thread_id(void); -TSRM_API MUTEX_T tsrm_mutex_alloc(void); -TSRM_API void tsrm_mutex_free(MUTEX_T mutexp); -TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp); -TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp); - -TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler); -TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler); - -/* these 3 APIs should only be used by people that fully understand the threading model - * used by PHP/Zend and the selected SAPI. */ -TSRM_API void *tsrm_new_interpreter_context(void); -TSRM_API void *tsrm_set_interpreter_context(void *new_ctx); -TSRM_API void tsrm_free_interpreter_context(void *context); - -#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1) -#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1) - -#define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL) -#define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx -#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls -#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) -#define TSRMLS_D void ***tsrm_ls -#define TSRMLS_DC , TSRMLS_D -#define TSRMLS_C tsrm_ls -#define TSRMLS_CC , TSRMLS_C - -#ifdef __cplusplus -} -#endif - -#else /* non ZTS */ - -#define TSRMLS_FETCH() -#define TSRMLS_FETCH_FROM_CTX(ctx) -#define TSRMLS_SET_CTX(ctx) -#define TSRMLS_D void -#define TSRMLS_DC -#define TSRMLS_C -#define TSRMLS_CC - -#endif /* ZTS */ - -#endif /* TSRM_H */ diff --git a/TSRM/acconfig.h b/TSRM/acconfig.h deleted file mode 100644 index 2b94cf35e711d..0000000000000 --- a/TSRM/acconfig.h +++ /dev/null @@ -1 +0,0 @@ -#undef PTHREADS diff --git a/TSRM/acinclude.m4 b/TSRM/acinclude.m4 deleted file mode 100644 index fcf97fd352ee0..0000000000000 --- a/TSRM/acinclude.m4 +++ /dev/null @@ -1,5 +0,0 @@ - -AC_DEFUN([AM_SET_LIBTOOL_VARIABLE],[ - LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' -]) - diff --git a/TSRM/build.mk b/TSRM/build.mk deleted file mode 100644 index aac1a8b982ae5..0000000000000 --- a/TSRM/build.mk +++ /dev/null @@ -1,43 +0,0 @@ -# Makefile to generate build tools -# -# Standard usage: -# make -f build.mk -# -# Written by Sascha Schumann -# -# $Id$ - - -LT_TARGETS = ltmain.sh ltconfig - -config_h_in = tsrm_config.h.in - -makefile_am_files = Makefile.am -makefile_in_files = $(makefile_am_files:.am=.in) -makefile_files = $(makefile_am_files:e.am=e) - -targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in) - -all: $(targets) - -clean: - rm -f $(targets) - -$(LT_TARGETS): - rm -f $(LT_TARGETS) - libtoolize --automake $(AMFLAGS) -f - -$(makefile_in_files): $(makefile_am_files) - automake -a -i $(AMFLAGS) $(makefile_files) - -aclocal.m4: configure.in acinclude.m4 - aclocal - -$(config_h_in): configure.in acconfig.h -# explicitly remove target since autoheader does not seem to work -# correctly otherwise (timestamps are not updated) - @rm -f $@ - autoheader - -configure: aclocal.m4 configure.in - autoconf diff --git a/TSRM/buildconf b/TSRM/buildconf deleted file mode 100755 index fe8dee6f76780..0000000000000 --- a/TSRM/buildconf +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -case "$1" in ---copy) - automake_flags=--copy - shift -;; -esac - -libtoolize --force --automake $automake_flags - -mv aclocal.m4 aclocal.m4.old 2>/dev/null -aclocal -if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then - echo "buildconf: keeping ${1}aclocal.m4" - mv aclocal.m4.old aclocal.m4 -else - echo "buildconf: created or modified ${1}aclocal.m4" -fi - -autoheader - -automake --add-missing --include-deps $automake_flags - -mv configure configure.old 2>/dev/null -autoconf -if cmp configure.old configure > /dev/null 2>&1; then - echo "buildconf: keeping ${1}configure" - mv configure.old configure -else - echo "buildconf: created or modified ${1}configure" -fi - diff --git a/TSRM/config.w32 b/TSRM/config.w32 deleted file mode 100644 index 525f4390e55a7..0000000000000 --- a/TSRM/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// vim:ft=javascript -// $Id$ - -if (CHECK_HEADER_ADD_INCLUDE("NewAPIs.h", "CFLAGS_PHP", php_usual_include_suspects)) { - // Need to add the flag directly, since TSRM doesn't include the config - // header - ADD_FLAG("CFLAGS_PHP", "/DHAVE_NEWAPIS_H=1"); -} -ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c tsrm_win32.c"); - diff --git a/TSRM/configure.in b/TSRM/configure.in deleted file mode 100644 index acfdd00b3531f..0000000000000 --- a/TSRM/configure.in +++ /dev/null @@ -1,31 +0,0 @@ -dnl $Id$ -dnl -dnl Minimalistic configure.in for TSRM. -dnl - -AC_INIT(TSRM.c) -AM_INIT_AUTOMAKE(TSRM, 1.0, nodefine) -AM_CONFIG_HEADER(tsrm_config.h) - -sinclude(tsrm.m4) - -TSRM_BASIC_CHECKS -TSRM_THREADS_CHECKS - -AM_PROG_LIBTOOL -if test "$enable_debug" != "yes"; then - AM_SET_LIBTOOL_VARIABLE([--silent]) -fi - -dnl TSRM_PTHREAD - -AC_CHECK_HEADERS( -utime.h \ -dirent.h \ -stdarg.h \ -alloca.h \ -unistd.h \ -limits.h -) - -AC_OUTPUT(Makefile) diff --git a/TSRM/readdir.h b/TSRM/readdir.h deleted file mode 100644 index 139bc7bb70215..0000000000000 --- a/TSRM/readdir.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef READDIR_H -#define READDIR_H - - -/* - * Structures and types used to implement opendir/readdir/closedir - * on Windows 95/NT. - */ - -#define _WIN32_WINNT 0x0400 - -#include - -#include -#include -#include -#include -#include - -/* struct dirent - same as Unix */ - -struct dirent { - long d_ino; /* inode (always 1 in WIN32) */ - off_t d_off; /* offset to this dirent */ - unsigned short d_reclen; /* length of d_name */ - char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */ -}; - - -/* typedef DIR - not the same as Unix */ -typedef struct { - HANDLE handle; /* _findfirst/_findnext handle */ - short offset; /* offset into directory */ - short finished; /* 1 if there are not more files */ - WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */ - char *dir; /* the dir we are reading */ - struct dirent dent; /* the dirent to return */ -} DIR; - -/* Function prototypes */ -DIR *opendir(const char *); -struct dirent *readdir(DIR *); -int readdir_r(DIR *, struct dirent *, struct dirent **); -int closedir(DIR *); -int rewinddir(DIR *); - -#endif /* READDIR_H */ diff --git a/TSRM/threads.m4 b/TSRM/threads.m4 deleted file mode 100644 index 38494ce7cae9b..0000000000000 --- a/TSRM/threads.m4 +++ /dev/null @@ -1,173 +0,0 @@ -dnl Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved. -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that the following conditions -dnl are met: -dnl -dnl 1. Redistributions of source code must retain the above copyright -dnl notice, this list of conditions and the following disclaimer. -dnl -dnl 2. Redistributions in binary form must reproduce the above copyright -dnl notice, this list of conditions and the following disclaimer in -dnl the documentation and/or other materials provided with the -dnl distribution. -dnl -dnl THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY -dnl EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SASCHA SCHUMANN OR -dnl HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -dnl NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -dnl LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -dnl OF THE POSSIBILITY OF SUCH DAMAGE. - -dnl -dnl PTHREADS_FLAGS -dnl -dnl Set some magic defines to achieve POSIX threads conformance -dnl -AC_DEFUN([PTHREADS_FLAGS],[ - if test -z "$host_alias" && test -n "$host"; then - host_alias=$host - fi - if test -z "$host_alias"; then - AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess) - fi - case $host_alias in - *solaris*) - PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";; - *freebsd*) - PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";; - *linux*) - PTHREAD_FLAGS=-D_REENTRANT;; - *aix*) - PTHREAD_FLAGS=-D_THREAD_SAFE;; - *irix*) - PTHREAD_FLAGS=-D_POSIX_THREAD_SAFE_FUNCTIONS;; - *hpux*) - PTHREAD_FLAGS=-D_REENTRANT;; - *sco*) - PTHREAD_FLAGS=-D_REENTRANT;; -dnl Solves sigwait() problem, creates problems with u_long etc. -dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";; - esac - - if test -n "$PTHREAD_FLAGS"; then - CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS" - fi -])dnl -dnl -dnl PTHREADS_CHECK_COMPILE -dnl -dnl Check whether the current setup can use POSIX threads calls -dnl -AC_DEFUN([PTHREADS_CHECK_COMPILE], [ -AC_TRY_RUN( [ -#include -#include - -void *thread_routine(void *data) { - return data; -} - -int main() { - pthread_t thd; - pthread_mutexattr_t mattr; - int data = 1; - pthread_mutexattr_init(&mattr); - return pthread_create(&thd, NULL, thread_routine, &data); -} ], [ - pthreads_working=yes - ], [ - pthreads_working=no - ], [ - dnl For cross compiling running this test is of no use. NetWare supports pthreads - pthreads_working=no - case $host_alias in - *netware*) - pthreads_working=yes - esac -] -) ] )dnl -dnl -dnl PTHREADS_CHECK() -dnl -dnl Try to find a way to enable POSIX threads -dnl -dnl Magic flags -dnl -kthread gcc (FreeBSD) -dnl -Kthread UDK cc (UnixWare) -dnl -mt WorkShop cc (Solaris) -dnl -mthreads gcc (AIX) -dnl -pthread gcc (Linux, FreeBSD, NetBSD, OpenBSD) -dnl -pthreads gcc (Solaris) -dnl -qthreaded AIX cc V5 -dnl -threads gcc (HP-UX) -dnl -AC_DEFUN([PTHREADS_CHECK],[ - -if test "$beos_threads" = "1"; then - pthreads_working="yes" - ac_cv_pthreads_cflags="" -else - save_CFLAGS=$CFLAGS - save_LIBS=$LIBS - PTHREADS_ASSIGN_VARS - PTHREADS_CHECK_COMPILE - LIBS=$save_LIBS - CFLAGS=$save_CFLAGS - - AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ - ac_cv_pthreads_cflags= - if test "$pthreads_working" != "yes"; then - for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do - ac_save=$CFLAGS - CFLAGS="$CFLAGS $flag" - PTHREADS_CHECK_COMPILE - CFLAGS=$ac_save - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_cflags=$flag - break - fi - done - fi -fi -]) - -AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[ -ac_cv_pthreads_lib= -if test "$pthreads_working" != "yes"; then - for lib in pthread pthreads c_r; do - ac_save=$LIBS - LIBS="$LIBS -l$lib" - PTHREADS_CHECK_COMPILE - LIBS=$ac_save - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_lib=$lib - break - fi - done -fi -]) - -if test "$pthreads_working" = "yes"; then - threads_result="POSIX-Threads found" -else - threads_result="POSIX-Threads not found" -fi -])dnl -dnl -dnl -AC_DEFUN([PTHREADS_ASSIGN_VARS],[ -if test -n "$ac_cv_pthreads_lib"; then - LIBS="$LIBS -l$ac_cv_pthreads_lib" -fi - -if test -n "$ac_cv_pthreads_cflags"; then - CFLAGS="$CFLAGS $ac_cv_pthreads_cflags" -fi -])dnl diff --git a/TSRM/tsrm.m4 b/TSRM/tsrm.m4 deleted file mode 100644 index 85e6a83a83317..0000000000000 --- a/TSRM/tsrm.m4 +++ /dev/null @@ -1,128 +0,0 @@ - -dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND) -AC_DEFUN([TSRM_CHECK_GCC_ARG],[ - gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_) - AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [ - echo 'void somefunc() { };' > conftest.c - cmd='$CC $1 -c conftest.c' - if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then - ac_result=no - else - ac_result=yes - fi - eval $gcc_arg_name=$ac_result - rm -f conftest.* - ]) - if eval test "\$$gcc_arg_name" = "yes"; then - $2 - else - : - $3 - fi -]) - -AC_DEFUN([TSRM_BASIC_CHECKS],[ - -AC_REQUIRE([AC_PROG_CC])dnl -dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl -AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl - -AC_CHECK_HEADERS(stdarg.h) - -]) - - -AC_DEFUN([TSRM_CHECK_PTH],[ - -AC_MSG_CHECKING(for GNU Pth) -PTH_PREFIX="`$1 --prefix`" -if test -z "$PTH_PREFIX"; then - AC_MSG_RESULT(Please check your Pth installation) -fi - -CPPFLAGS="$CPPFLAGS `$1 --cflags`" -LDFLAGS="$LDFLAGS `$1 --ldflags`" -LIBS="$LIBS `$1 --libs`" - -AC_DEFINE(GNUPTH, 1, [Whether you use GNU Pth]) -AC_MSG_RESULT(yes - installed in $PTH_PREFIX) - -]) - -AC_DEFUN([TSRM_CHECK_ST],[ - if test -r "$1/include/st.h"; then - CPPFLAGS="$CPPFLAGS -I$1/include" - LDFLAGS="$LDFLAGS -L$1/lib" - elif test -r "$1/st.h"; then - CPPFLAGS="$CPPFLAGS -I$1" - LDFLAGS="$LDFLAGS -L$1" - fi - AC_CHECK_HEADERS(st.h,[],[ - AC_MSG_ERROR([Sorry[,] I was unable to locate the State Threads header file. Please specify the prefix using --with-tsrm-st=/prefix]) - ]) - LIBS="$LIBS -lst" - AC_MSG_CHECKING(for SGI's State Threads) - AC_MSG_RESULT(yes) - AC_DEFINE(TSRM_ST, 1, [ ]) -]) - -sinclude(threads.m4) - -AC_DEFUN([TSRM_CHECK_PTHREADS],[ - -PTHREADS_CHECK - -if test "$beos_threads" = "1"; then - AC_DEFINE(BETHREADS, 1, Whether to use native BeOS threads) -else - if test "$pthreads_working" != "yes"; then - AC_MSG_ERROR(Your system seems to lack POSIX threads.) - fi - - AC_DEFINE(PTHREADS, 1, Whether to use Pthreads) - - AC_MSG_CHECKING(for POSIX threads) - AC_MSG_RESULT(yes) -fi -]) - - -AC_DEFUN([TSRM_THREADS_CHECKS],[ - -dnl For the thread implementations, we always use --with-* -dnl to maintain consistency - -AC_ARG_WITH(tsrm-pth, -[ --with-tsrm-pth[=pth-config] - Use GNU Pth],[ - TSRM_PTH=$withval -],[ - TSRM_PTH=no -]) - -AC_ARG_WITH(tsrm-st, -[ --with-tsrm-st Use SGI's State Threads],[ - TSRM_ST=$withval -],[ - TSRM_ST=no -]) - -AC_ARG_WITH(tsrm-pthreads, -[ --with-tsrm-pthreads Use POSIX threads (default)],[ - TSRM_PTHREADS=$withval -],[ - TSRM_PTHREADS=yes -]) - -test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config - -if test "$TSRM_PTH" != "no"; then - TSRM_CHECK_PTH($TSRM_PTH) -elif test "$TSRM_ST" != "no"; then - TSRM_CHECK_ST($TSRM_ST) -elif test "$TSRM_PTHREADS" != "no"; then - TSRM_CHECK_PTHREADS -fi - -]) diff --git a/TSRM/tsrm_config.w32.h b/TSRM/tsrm_config.w32.h deleted file mode 100644 index 28a4e4242e014..0000000000000 --- a/TSRM/tsrm_config.w32.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef TSRM_CONFIG_W32_H -#define TSRM_CONFIG_W32_H - -#define HAVE_UTIME 1 -#define HAVE_ALLOCA 1 -#define HAVE_REALPATH 1 - -#include -#include -#include - -#undef inline -#ifdef ZEND_WIN32_FORCE_INLINE -# define inline __forceinline -#else -# define inline -#endif - - -#endif diff --git a/TSRM/tsrm_config_common.h b/TSRM/tsrm_config_common.h deleted file mode 100644 index 0c6a2a183fc0b..0000000000000 --- a/TSRM/tsrm_config_common.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef TSRM_CONFIG_COMMON_H -#define TSRM_CONFIG_COMMON_H - -#ifndef __CYGWIN__ -# if WINNT|WIN32 -# define TSRM_WIN32 -# endif -#endif - -#ifdef TSRM_WIN32 -# include "tsrm_config.w32.h" -#else -# include -# include -#endif - -#if HAVE_ALLOCA_H && !defined(_ALLOCA_H) -# include -#endif - -/* AIX requires this to be the first thing in the file. */ -#ifndef __GNUC__ -# ifndef HAVE_ALLOCA_H -# ifdef _AIX -#pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -# ifndef NETWARE -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -#if HAVE_UNISTD_H -#include -#endif - -#if HAVE_LIMITS_H -#include -#endif - -#ifndef MAXPATHLEN -# ifdef PATH_MAX -# define MAXPATHLEN PATH_MAX -# elif defined(MAX_PATH) -# define MAXPATHLEN MAX_PATH -# else -# define MAXPATHLEN 256 -# endif -#endif - -#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) -# define tsrm_do_alloca(p) alloca(p) -# define tsrm_free_alloca(p) -#else -# define tsrm_do_alloca(p) malloc(p) -# define tsrm_free_alloca(p) free(p) -#endif - -#endif /* TSRM_CONFIG_COMMON_H */ diff --git a/TSRM/tsrm_nw.c b/TSRM/tsrm_nw.c deleted file mode 100644 index c69465573a00d..0000000000000 --- a/TSRM/tsrm_nw.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Venkat Raghavan S | - | Anantha Kesari H Y | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include - -#include "TSRM.h" - -#ifdef NETWARE - -#ifdef USE_MKFIFO -#include -#elif !defined(USE_PIPE_OPEN) /* NXFifoOpen */ -#include -#endif - -#include -#include - -#include - -#include "mktemp.h" - -/* strtok() call in LibC is abending when used in a different address space - * -- hence using PHP's version itself for now - */ -#include "tsrm_strtok_r.h" -#define tsrm_strtok_r(a,b,c) strtok((a),(b)) - -#define WHITESPACE " \t" -#define MAX_ARGS 10 - - -TSRM_API FILE* popen(const char *commandline, const char *type) -{ - char *command = NULL, *argv[MAX_ARGS] = {'\0'}, **env = NULL; - char *tempName = "sys:/php/temp/phpXXXXXX.tmp"; - char *filePath = NULL; - char *ptr = NULL; - int ptrLen = 0, argc = 0, i = 0, envCount = 0, err = 0; - FILE *stream = NULL; -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - int pipe_handle; - int mode = O_RDONLY; -#else - NXHandle_t pipe_handle; - NXMode_t mode = NX_O_RDONLY; -#endif - NXExecEnvSpec_t envSpec; - NXNameSpec_t nameSpec; - NXVmId_t newVM = 0; - - /* Check for validity of input parameters */ - if (!commandline || !type) - return NULL; - - /* Get temporary file name */ - filePath = mktemp(tempName); - if (!filePath) - return NULL; - - /* Set pipe mode according to type -- for now allow only "r" or "w" */ - if (strcmp(type, "r") == 0) -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - mode = O_RDONLY; -#else - mode = NX_O_RDONLY; -#endif - else if (strcmp(type, "w") == 0) -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - mode = O_WRONLY; -#else - mode = NX_O_WRONLY; -#endif - else - return NULL; - -#ifdef USE_PIPE_OPEN - pipe_handle = pipe_open(filePath, mode); - if (pipe_handle == -1) - return NULL; -#elif defined(USE_MKFIFO) - pipe_handle = mkfifo(filePath, mode); - if (pipe_handle == -1) - return NULL; -#else - /* - NetWare doesn't require first parameter - * - Allowing LibC to choose the buffer size for now - */ - err = NXFifoOpen(0, filePath, mode, 0, &pipe_handle); - if (err) - return NULL; -#endif - - /* Copy the environment variables in preparation for the spawn call */ - envCount = NXGetEnvCount() + 1; /* add one for NULL */ - env = (char **) NXMemAlloc(sizeof(char *) * envCount, 0); - if (!env) - return NULL; - - err = NXCopyEnv(env, envCount); - if (err) { - NXMemFree (env); - return NULL; - } - - /* Separate commandline string into words */ - ptr = tsrm_strtok_r((char*)commandline, WHITESPACE, NULL); - ptrLen = strlen(ptr); - - command = (char*)malloc(ptrLen + 1); - if (!command) { - NXMemFree (env); - return NULL; - } - - strcpy (command, ptr); - - ptr = tsrm_strtok_r(NULL, WHITESPACE, NULL); - while (ptr && (argc < MAX_ARGS)) { - ptrLen = strlen(ptr); - - argv[argc] = (char*)malloc(ptrLen + 1); - if (!argv[argc]) { - NXMemFree (env); - if (command) - free (command); - - for (i = 0; i < argc; i++) { - if (argv[i]) - free (argv[i]); - } - - return NULL; - } - - strcpy (argv[argc], ptr); - argc++; - ptr = tsrm_strtok_r(NULL, WHITESPACE, NULL); - } - - /* Setup the execution environment and spawn new process */ - envSpec.esFlags = 0; /* Not used */ - envSpec.esArgc = argc; - envSpec.esArgv = (void **) argv; - envSpec.esEnv = (void **) env; - -/* envSpec.esStdin.ssType = */ - envSpec.esStdout.ssType = NX_OBJ_FIFO; - envSpec.esStderr.ssType = NX_OBJ_FILE; - - /* 'ssHandle' is not a struct/union/class member */ -/* - envSpec.esStdin.ssHandle = - envSpec.esStdout.ssHandle = - envSpec.esStderr.ssHandle = -1; -*/ - envSpec.esStdin.ssPathCtx = NULL; - envSpec.esStdout.ssPathCtx = NULL; - envSpec.esStderr.ssPathCtx = NULL; - -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - if (mode == O_RDONLY) { -#else - if (mode == NX_O_RDONLY) { -#endif - envSpec.esStdin.ssPath = filePath; - envSpec.esStdout.ssPath = stdout; - } else { /* Write Only */ - envSpec.esStdin.ssPath = stdin; - envSpec.esStdout.ssPath = filePath; - } - - envSpec.esStderr.ssPath = stdout; - - nameSpec.ssType = NX_OBJ_FIFO; -/* nameSpec.ssHandle = 0; */ /* 'ssHandle' is not a struct/union/class member */ - nameSpec.ssPathCtx = NULL; /* Not used */ - nameSpec.ssPath = argv[0]; - err = NXVmSpawn(&nameSpec, &envSpec, 0, &newVM); - if (!err) - /* Get file pointer corresponding to the pipe (file) opened */ - stream = fdopen(pipe_handle, type); - - /* Clean-up */ - if (env) - NXMemFree (env); - - if (pipe_handle) -#if defined(USE_PIPE_OPEN) || defined(USE_MKFIFO) - close(pipe_handle); -#else - NXClose(pipe_handle); -#endif - - if (command) - free (command); - - for (i = 0; i < argc; i++) { - if (argv[i]) - free (argv[i]); - } - - return stream; -} - -TSRM_API int pclose(FILE* stream) -{ - int err = 0; - NXHandle_t fd = 0; - - /* Get the process associated with this pipe (file) handle and terminate it */ - fd = fileno(stream); - NXClose (fd); - - err = fclose(stream); - - return err; -} - -#endif /* NETWARE */ diff --git a/TSRM/tsrm_nw.h b/TSRM/tsrm_nw.h deleted file mode 100644 index 968d8a34ae4c8..0000000000000 --- a/TSRM/tsrm_nw.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Venkat Raghavan S | - | Anantha Kesari H Y | - +----------------------------------------------------------------------+ -*/ - - -#ifndef TSRM_NW_H -#define TSRM_NW_H - -#include "TSRM.h" - -TSRM_API FILE* popen(const char *command, const char *type); -TSRM_API int pclose(FILE* stream); - -#endif diff --git a/TSRM/tsrm_strtok_r.c b/TSRM/tsrm_strtok_r.c deleted file mode 100644 index e9ad26a7ac297..0000000000000 --- a/TSRM/tsrm_strtok_r.c +++ /dev/null @@ -1,63 +0,0 @@ -#include - -#include "tsrm_config_common.h" -#include "tsrm_strtok_r.h" - -static inline int in_character_class(char ch, const char *delim) -{ - while (*delim) { - if (*delim == ch) { - return 1; - } - delim++; - } - return 0; -} - -char *tsrm_strtok_r(char *s, const char *delim, char **last) -{ - char *token; - - if (s == NULL) { - s = *last; - } - - while (*s && in_character_class(*s, delim)) { - s++; - } - if (!*s) { - return NULL; - } - - token = s; - - while (*s && !in_character_class(*s, delim)) { - s++; - } - if (!*s) { - *last = s; - } else { - *s = '\0'; - *last = s + 1; - } - return token; -} - -#if 0 - -main() -{ - char foo[] = "/foo/bar//\\barbara"; - char *last; - char *token; - - token = tsrm_strtok_r(foo, "/\\", &last); - while (token) { - printf ("Token = '%s'\n", token); - token = tsrm_strtok_r(NULL, "/\\", &last); - } - - return 0; -} - -#endif diff --git a/TSRM/tsrm_strtok_r.h b/TSRM/tsrm_strtok_r.h deleted file mode 100644 index 8c9e8198e780f..0000000000000 --- a/TSRM/tsrm_strtok_r.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef TSRM_STRTOK_R -#define TSRM_STRTOK_R - -char *tsrm_strtok_r(char *s, const char *delim, char **last); - -#endif diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c deleted file mode 100644 index 3f768054b81cd..0000000000000 --- a/TSRM/tsrm_virtual_cwd.c +++ /dev/null @@ -1,1317 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Andi Gutmans | - | Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tsrm_virtual_cwd.h" -#include "tsrm_strtok_r.h" - -#ifdef TSRM_WIN32 -#include -#include "tsrm_win32.h" -#endif - -#ifdef NETWARE -#include -#endif - -#ifndef HAVE_REALPATH -#define realpath(x,y) strcpy(y,x) -#endif - -#define VIRTUAL_CWD_DEBUG 0 - -#include "TSRM.h" - -/* Only need mutex for popen() in Windows and NetWare because it doesn't chdir() on UNIX */ -#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS) -MUTEX_T cwd_mutex; -#endif - -#ifdef ZTS -ts_rsrc_id cwd_globals_id; -#else -virtual_cwd_globals cwd_globals; -#endif - -cwd_state main_cwd_state; /* True global */ - -#ifndef TSRM_WIN32 -#include -#else -#include -#endif - -#ifndef S_ISDIR -#define S_ISDIR(mode) ((mode) & _S_IFDIR) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) ((mode) & _S_IFREG) -#endif - -#ifdef TSRM_WIN32 -#include -#define tsrm_strtok_r(a,b,c) _tcstok((a),(b)) -#define TOKENIZER_STRING "/\\" - -static int php_check_dots(const char *element, int n) -{ - while (n-- > 0) if (element[n] != '.') break; - - return (n != -1); -} - -#define IS_DIRECTORY_UP(element, len) \ - (len >= 2 && !php_check_dots(element, len)) - -#define IS_DIRECTORY_CURRENT(element, len) \ - (len == 1 && element[0] == '.') - -#elif defined(NETWARE) -/* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows -- - but rest of the stuff is like Unix */ -/* strtok() call in LibC is abending when used in a different address space -- hence using - PHP's version itself for now */ -/*#define tsrm_strtok_r(a,b,c) strtok((a),(b))*/ -#define TOKENIZER_STRING "/\\" - -#else -#define TOKENIZER_STRING "/" -#endif - - -/* default macros */ - -#ifndef IS_DIRECTORY_UP -#define IS_DIRECTORY_UP(element, len) \ - (len == 2 && element[0] == '.' && element[1] == '.') -#endif - -#ifndef IS_DIRECTORY_CURRENT -#define IS_DIRECTORY_CURRENT(element, len) \ - (len == 1 && element[0] == '.') -#endif - -/* define this to check semantics */ -#define IS_DIR_OK(s) (1) - -#ifndef IS_DIR_OK -#define IS_DIR_OK(state) (php_is_dir_ok(state) == 0) -#endif - - -#define CWD_STATE_COPY(d, s) \ - (d)->cwd_length = (s)->cwd_length; \ - (d)->cwd = (char *) malloc((s)->cwd_length+1); \ - memcpy((d)->cwd, (s)->cwd, (s)->cwd_length+1); - -#define CWD_STATE_FREE(s) \ - free((s)->cwd); - -#ifdef TSRM_WIN32 -CWD_API int php_sys_stat(const char *path, struct stat *buf) /* {{{ */ -{ - WIN32_FILE_ATTRIBUTE_DATA data; - __int64 t; - - if (!GetFileAttributesEx(path, GetFileExInfoStandard, &data)) { - return stat(path, buf); - } - - if (path[1] == ':') { - if (path[0] >= 'A' && path[0] <= 'Z') { - buf->st_dev = buf->st_rdev = path[0] - 'A'; - } else { - buf->st_dev = buf->st_rdev = path[0] - 'a'; - } - } else { - char cur_path[MAXPATHLEN+1]; - DWORD len = sizeof(cur_path); - char *tmp = cur_path; - - while(1) { - DWORD r = GetCurrentDirectory(len, tmp); - if (r < len) { - if (tmp[1] == ':') { - if (path[0] >= 'A' && path[0] <= 'Z') { - buf->st_dev = buf->st_rdev = path[0] - 'A'; - } else { - buf->st_dev = buf->st_rdev = path[0] - 'a'; - } - } else { - buf->st_dev = buf->st_rdev = -1; - } - break; - } else if (!r) { - buf->st_dev = buf->st_rdev = -1; - break; - } else { - len = r+1; - tmp = (char*)malloc(len); - } - } - if (tmp != cur_path) { - free(tmp); - } - } - buf->st_uid = buf->st_gid = buf->st_ino = 0; - buf->st_mode = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? (S_IFDIR|S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)) : S_IFREG; - buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6)); - if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { - int len = strlen(path); - - if (path[len-4] == '.') { - if (_memicmp(path+len-3, "exe", 3) == 0 || - _memicmp(path+len-3, "com", 3) == 0 || - _memicmp(path+len-3, "bat", 3) == 0 || - _memicmp(path+len-3, "cmd", 3) == 0) { - buf->st_mode |= (S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)); - } - } - } - buf->st_nlink = 1; - t = data.nFileSizeHigh; - t = t << 32; - t |= data.nFileSizeLow; - buf->st_size = t; - t = data.ftLastAccessTime.dwHighDateTime; - t = t << 32; - t |= data.ftLastAccessTime.dwLowDateTime; - buf->st_atime = (unsigned long)((t / 10000000) - 11644473600); - t = data.ftCreationTime.dwHighDateTime; - t = t << 32; - t |= data.ftCreationTime.dwLowDateTime; - buf->st_ctime = (unsigned long)((t / 10000000) - 11644473600); - t = data.ftLastWriteTime.dwHighDateTime; - t = t << 32; - t |= data.ftLastWriteTime.dwLowDateTime; - buf->st_mtime = (unsigned long)((t / 10000000) - 11644473600); - return 0; -} -/* }}} */ -#endif - -static int php_is_dir_ok(const cwd_state *state) /* {{{ */ -{ - struct stat buf; - - if (php_sys_stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode)) - return (0); - - return (1); -} -/* }}} */ - -static int php_is_file_ok(const cwd_state *state) /* {{{ */ -{ - struct stat buf; - - if (php_sys_stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode)) - return (0); - - return (1); -} -/* }}} */ - -static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC) /* {{{ */ -{ - CWD_STATE_COPY(&cwd_globals->cwd, &main_cwd_state); - cwd_globals->realpath_cache_size = 0; - cwd_globals->realpath_cache_size_limit = REALPATH_CACHE_SIZE; - cwd_globals->realpath_cache_ttl = REALPATH_CACHE_TTL; - memset(cwd_globals->realpath_cache, 0, sizeof(cwd_globals->realpath_cache)); -} -/* }}} */ - -static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC) /* {{{ */ -{ - CWD_STATE_FREE(&cwd_globals->cwd); - realpath_cache_clean(TSRMLS_C); -} -/* }}} */ - -static char *tsrm_strndup(const char *s, size_t length) /* {{{ */ -{ - char *p; - - p = (char *) malloc(length+1); - if (!p) { - return (char *)NULL; - } - if (length) { - memcpy(p,s,length); - } - p[length]=0; - return p; -} -/* }}} */ - -CWD_API void virtual_cwd_startup(void) /* {{{ */ -{ - char cwd[MAXPATHLEN]; - char *result; - -#ifdef NETWARE - result = getcwdpath(cwd, NULL, 1); - if(result) - { - char *c=cwd; - while(c = strchr(c, '\\')) - { - *c='/'; - ++c; - } - } -#else - result = getcwd(cwd, sizeof(cwd)); -#endif - if (!result) { - cwd[0] = '\0'; - } - main_cwd_state.cwd = strdup(cwd); - main_cwd_state.cwd_length = strlen(cwd); - -#ifdef ZTS - ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor); -#else - cwd_globals_ctor(&cwd_globals TSRMLS_CC); -#endif - -#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS) - cwd_mutex = tsrm_mutex_alloc(); -#endif -} -/* }}} */ - -CWD_API void virtual_cwd_shutdown(void) /* {{{ */ -{ -#ifndef ZTS - cwd_globals_dtor(&cwd_globals TSRMLS_CC); -#endif -#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS) - tsrm_mutex_free(cwd_mutex); -#endif - - free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably use emalloc()/efree() */ -} -/* }}} */ - -CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */ -{ - cwd_state *state; - - state = &CWDG(cwd); - - if (state->cwd_length == 0) { - char *retval; - - *length = 1; - retval = (char *) malloc(2); - retval[0] = DEFAULT_SLASH; - retval[1] = '\0'; - return retval; - } - -#ifdef TSRM_WIN32 - /* If we have something like C: */ - if (state->cwd_length == 2 && state->cwd[state->cwd_length-1] == ':') { - char *retval; - - *length = state->cwd_length+1; - retval = (char *) malloc(*length+1); - memcpy(retval, state->cwd, *length); - retval[*length-1] = DEFAULT_SLASH; - retval[*length] = '\0'; - return retval; - } -#endif - *length = state->cwd_length; - return strdup(state->cwd); -} -/* }}} */ - -/* Same semantics as UNIX getcwd() */ -CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */ -{ - size_t length; - char *cwd; - - cwd = virtual_getcwd_ex(&length TSRMLS_CC); - - if (buf == NULL) { - return cwd; - } - if (length > size-1) { - free(cwd); - errno = ERANGE; /* Is this OK? */ - return NULL; - } - memcpy(buf, cwd, length+1); - free(cwd); - return buf; -} -/* }}} */ - -static inline unsigned long realpath_cache_key(const char *path, int path_len) /* {{{ */ -{ - register unsigned long h; - const char *e = path + path_len; - - for (h = 2166136261U; path < e;) { - h *= 16777619; - h ^= *path++; - } - - return h; -} -/* }}} */ - -CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */ -{ - int i; - - for (i = 0; i < sizeof(CWDG(realpath_cache))/sizeof(CWDG(realpath_cache)[0]); i++) { - realpath_cache_bucket *p = CWDG(realpath_cache)[i]; - while (p != NULL) { - realpath_cache_bucket *r = p; - p = p->next; - free(r); - } - CWDG(realpath_cache)[i] = NULL; - } - CWDG(realpath_cache_size) = 0; -} -/* }}} */ - -CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */ -{ - unsigned long key = realpath_cache_key(path, path_len); - unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); - realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n]; - - while (*bucket != NULL) { - if (key == (*bucket)->key && path_len == (*bucket)->path_len && - memcmp(path, (*bucket)->path, path_len) == 0) { - realpath_cache_bucket *r = *bucket; - *bucket = (*bucket)->next; - CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1; - free(r); - return; - } else { - bucket = &(*bucket)->next; - } - } -} -/* }}} */ - -static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, time_t t TSRMLS_DC) /* {{{ */ -{ - long size = sizeof(realpath_cache_bucket) + path_len + 1 + realpath_len + 1; - if (CWDG(realpath_cache_size) + size <= CWDG(realpath_cache_size_limit)) { - realpath_cache_bucket *bucket = malloc(size); - unsigned long n; - - bucket->key = realpath_cache_key(path, path_len); - bucket->path = (char*)bucket + sizeof(realpath_cache_bucket); - memcpy(bucket->path, path, path_len+1); - bucket->path_len = path_len; - bucket->realpath = bucket->path + (path_len + 1); - memcpy(bucket->realpath, realpath, realpath_len+1); - bucket->realpath_len = realpath_len; - bucket->expires = t + CWDG(realpath_cache_ttl); - n = bucket->key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); - bucket->next = CWDG(realpath_cache)[n]; - CWDG(realpath_cache)[n] = bucket; - CWDG(realpath_cache_size) += size; - } -} -/* }}} */ - -static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */ -{ - unsigned long key = realpath_cache_key(path, path_len); - unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); - realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n]; - - while (*bucket != NULL) { - if (CWDG(realpath_cache_ttl) && (*bucket)->expires < t) { - realpath_cache_bucket *r = *bucket; - *bucket = (*bucket)->next; - CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1; - free(r); - } else if (key == (*bucket)->key && path_len == (*bucket)->path_len && - memcmp(path, (*bucket)->path, path_len) == 0) { - return *bucket; - } else { - bucket = &(*bucket)->next; - } - } - return NULL; -} -/* }}} */ - -/* Resolve path relatively to state and put the real path into state */ -/* returns 0 for ok, 1 for error */ -CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath) /* {{{ */ -{ - int path_length = strlen(path); - cwd_state old_state; - char orig_path[MAXPATHLEN]; - realpath_cache_bucket *bucket; - time_t t = 0; - int ret; - int use_cache; - int use_relative_path = 0; -#ifdef TSRM_WIN32 - int is_unc; - int exists; -#endif - TSRMLS_FETCH(); - - use_cache = ((use_realpath != CWD_EXPAND) && CWDG(realpath_cache_size_limit)); - - if (path_length == 0) - return (1); - if (path_length >= MAXPATHLEN) - return (1); - -#if VIRTUAL_CWD_DEBUG - fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path); -#endif - - /* cwd_length can be 0 when getcwd() fails. - * This can happen under solaris when a dir does not have read permissions - * but *does* have execute permissions */ - if (!IS_ABSOLUTE_PATH(path, path_length)) { - if (state->cwd_length == 0) { - use_cache = 0; - use_relative_path = 1; - } else { - int orig_path_len; - int state_cwd_length = state->cwd_length; - -#ifdef TSRM_WIN32 - if (IS_SLASH(path[0])) { - state_cwd_length = 2; - } -#endif - orig_path_len = path_length + state_cwd_length + 1; - if (orig_path_len >= MAXPATHLEN) { - return 1; - } - memcpy(orig_path, state->cwd, state_cwd_length); - orig_path[state_cwd_length] = DEFAULT_SLASH; - memcpy(orig_path + state_cwd_length + 1, path, path_length + 1); - path = orig_path; - path_length = orig_path_len; - } - } - - if (use_cache) { - t = CWDG(realpath_cache_ttl)?time(0):0; - if ((bucket = realpath_cache_find(path, path_length, t TSRMLS_CC)) != NULL) { - int len = bucket->realpath_len; - - CWD_STATE_COPY(&old_state, state); - state->cwd = (char *) realloc(state->cwd, len+1); - memcpy(state->cwd, bucket->realpath, len+1); - state->cwd_length = len; - if (verify_path && verify_path(state)) { - CWD_STATE_FREE(state); - *state = old_state; - return 1; - } else { - CWD_STATE_FREE(&old_state); - return 0; - } - } - } - - if (use_realpath != CWD_EXPAND) { -#if !defined(TSRM_WIN32) && !defined(NETWARE) - char resolved_path[MAXPATHLEN]; - - if (!realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */ - if (use_realpath == CWD_REALPATH) { - return 1; - } - goto no_realpath; - } - use_realpath = CWD_REALPATH; - CWD_STATE_COPY(&old_state, state); - - state->cwd_length = strlen(resolved_path); - state->cwd = (char *) realloc(state->cwd, state->cwd_length+1); - memcpy(state->cwd, resolved_path, state->cwd_length+1); -#else - goto no_realpath; -#endif - } else { - char *ptr, *path_copy, *free_path; - char *tok; - int ptr_length; -no_realpath: - -#ifdef TSRM_WIN32 - if (memchr(path, '*', path_length) || - memchr(path, '?', path_length)) { - return 1; - } -#endif - - free_path = path_copy = tsrm_strndup(path, path_length); - CWD_STATE_COPY(&old_state, state); - -#ifdef TSRM_WIN32 - exists = (use_realpath != CWD_EXPAND); - ret = 0; - is_unc = 0; - if (path_length >= 2 && path[1] == ':') { - state->cwd = (char *) realloc(state->cwd, 2 + 1); - state->cwd[0] = toupper(path[0]); - state->cwd[1] = ':'; - state->cwd[2] = '\0'; - state->cwd_length = 2; - path_copy += 2; - } else if (IS_UNC_PATH(path, path_length)) { - state->cwd = (char *) realloc(state->cwd, 1 + 1); - state->cwd[0] = DEFAULT_SLASH; - state->cwd[1] = '\0'; - state->cwd_length = 1; - path_copy += 2; - is_unc = 2; - } else { -#endif - state->cwd = (char *) realloc(state->cwd, 1); - state->cwd[0] = '\0'; - state->cwd_length = 0; -#ifdef TSRM_WIN32 - } -#endif - - tok = NULL; - ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok); - while (ptr) { - ptr_length = strlen(ptr); - - if (IS_DIRECTORY_UP(ptr, ptr_length)) { - char save; - - if (use_relative_path) { - CWD_STATE_FREE(state); - *state = old_state; - return 1; - } - - save = DEFAULT_SLASH; - -#define PREVIOUS state->cwd[state->cwd_length - 1] - - while (IS_ABSOLUTE_PATH(state->cwd, state->cwd_length) && - !IS_SLASH(PREVIOUS)) { - save = PREVIOUS; - PREVIOUS = '\0'; - state->cwd_length--; - } - - if (!IS_ABSOLUTE_PATH(state->cwd, state->cwd_length)) { - state->cwd[state->cwd_length++] = save; - state->cwd[state->cwd_length] = '\0'; - } else { - PREVIOUS = '\0'; - state->cwd_length--; - } - } else if (!IS_DIRECTORY_CURRENT(ptr, ptr_length)) { - if (use_relative_path) { - state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1); - use_relative_path = 0; - } else { - state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1); -#ifdef TSRM_WIN32 - /* Windows 9x will consider C:\\Foo as a network path. Avoid it. */ - if (state->cwd_length < 2 || - (state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') || - IsDBCSLeadByte(state->cwd[state->cwd_length-2])) { - state->cwd[state->cwd_length++] = DEFAULT_SLASH; - } -#elif defined(NETWARE) - /* - Below code keeps appending to state->cwd a File system seperator - cases where this appending should not happen is given below, - a) sys: should just be left as it is - b) sys:system should just be left as it is, - Colon is allowed only in the first token as volume names alone can have the : in their names. - Files and Directories cannot have : in their names - So the check goes like this, - For second token and above simply append the DEFAULT_SLASH to the state->cwd. - For first token check for the existence of : - if it exists don't append the DEFAULT_SLASH to the state->cwd. - */ - if(((state->cwd_length == 0) && (strchr(ptr, ':') == NULL)) || (state->cwd_length > 0)) { - state->cwd[state->cwd_length++] = DEFAULT_SLASH; - } -#else - state->cwd[state->cwd_length++] = DEFAULT_SLASH; -#endif - } - memcpy(&state->cwd[state->cwd_length], ptr, ptr_length+1); - -#ifdef TSRM_WIN32 - if (use_realpath != CWD_EXPAND) { - WIN32_FIND_DATA data; - HANDLE hFind; - - if ((hFind = FindFirstFile(state->cwd, &data)) != INVALID_HANDLE_VALUE) { - int length = strlen(data.cFileName); - - if (length != ptr_length) { - state->cwd = (char *) realloc(state->cwd, state->cwd_length+length+1); - } - memcpy(&state->cwd[state->cwd_length], data.cFileName, length+1); - ptr_length = length; - FindClose(hFind); - ret = 0; - } else { - if (is_unc) { - /* skip share name */ - is_unc--; - ret = 0; - } else { - exists = 0; - if (use_realpath == CWD_REALPATH) { - ret = 1; - } - } - } - } -#endif - - state->cwd_length += ptr_length; - } - ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok); - } - free(free_path); - - if (use_realpath == CWD_REALPATH) { - if (ret) { - CWD_STATE_FREE(state); - *state = old_state; - return 1; - } - } else { -#if defined(TSRM_WIN32) || defined(NETWARE) - if (path[path_length-1] == '\\' || path[path_length-1] == '/') { -#else - if (path[path_length-1] == '/') { -#endif - state->cwd = (char*)realloc(state->cwd, state->cwd_length + 2); - state->cwd[state->cwd_length++] = DEFAULT_SLASH; - state->cwd[state->cwd_length] = 0; - } - } - - if (state->cwd_length == COPY_WHEN_ABSOLUTE(state->cwd)) { - state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1); - state->cwd[state->cwd_length] = DEFAULT_SLASH; - state->cwd[state->cwd_length+1] = '\0'; - state->cwd_length++; - } - } - - /* Store existent file in realpath cache. */ -#ifdef TSRM_WIN32 - if (use_cache && !is_unc && exists) { -#else - if (use_cache && (use_realpath == CWD_REALPATH)) { -#endif - realpath_cache_add(path, path_length, state->cwd, state->cwd_length, t TSRMLS_CC); - } - - if (verify_path && verify_path(state)) { - CWD_STATE_FREE(state); - *state = old_state; - ret = 1; - } else { - CWD_STATE_FREE(&old_state); - ret = 0; - } - -#if VIRTUAL_CWD_DEBUG - fprintf (stderr, "virtual_file_ex() = %s\n",state->cwd); -#endif - return (ret); -} -/* }}} */ - -CWD_API int virtual_chdir(const char *path TSRMLS_DC) /* {{{ */ -{ - return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH)?-1:0; -} -/* }}} */ - -CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC) /* {{{ */ -{ - int length = strlen(path); - char *temp; - int retval; - - if (length == 0) { - return 1; /* Can't cd to empty string */ - } - while(--length >= 0 && !IS_SLASH(path[length])) { - } - - if (length == -1) { - /* No directory only file name */ - errno = ENOENT; - return -1; - } - - if (length == COPY_WHEN_ABSOLUTE(path) && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */ - length++; - } - temp = (char *) tsrm_do_alloca(length+1); - memcpy(temp, path, length); - temp[length] = 0; -#if VIRTUAL_CWD_DEBUG - fprintf (stderr, "Changing directory to %s\n", temp); -#endif - retval = p_chdir(temp TSRMLS_CC); - tsrm_free_alloca(temp); - return retval; -} -/* }}} */ - -CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - char *retval; - char cwd[MAXPATHLEN]; - - /* realpath("") returns CWD */ - if (!*path) { - new_state.cwd = (char*)malloc(1); - new_state.cwd[0] = '\0'; - new_state.cwd_length = 0; - if (VCWD_GETCWD(cwd, MAXPATHLEN)) { - path = cwd; - } - } else if (!IS_ABSOLUTE_PATH(path, strlen(path))) { - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - } else { - new_state.cwd = (char*)malloc(1); - new_state.cwd[0] = '\0'; - new_state.cwd_length = 0; - } - - if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) { - int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; - - memcpy(real_path, new_state.cwd, len); - real_path[len] = '\0'; - retval = real_path; - } else { - retval = NULL; - } - - CWD_STATE_FREE(&new_state); - - return retval; -} -/* }}} */ - -CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH); - - *filepath = new_state.cwd; - - return retval; - -} -/* }}} */ - -CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC) /* {{{ */ -{ - return virtual_filepath_ex(path, filepath, php_is_file_ok TSRMLS_CC); -} -/* }}} */ - -CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - FILE *f; - - if (path[0] == '\0') { /* Fail to open empty path */ - return NULL; - } - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) { - CWD_STATE_FREE(&new_state); - return NULL; - } - - f = fopen(new_state.cwd, mode); - - CWD_STATE_FREE(&new_state); - return f; -} -/* }}} */ - -CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) { - CWD_STATE_FREE(&new_state); - return -1; - } - -#if defined(TSRM_WIN32) - ret = tsrm_win32_access(new_state.cwd, mode); -#else - ret = access(new_state.cwd, mode); -#endif - - CWD_STATE_FREE(&new_state); - - return ret; -} -/* }}} */ - -#if HAVE_UTIME -CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) { - CWD_STATE_FREE(&new_state); - return -1; - } - - ret = utime(new_state.cwd, buf); - - CWD_STATE_FREE(&new_state); - return ret; -} -/* }}} */ -#endif - -CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) { - CWD_STATE_FREE(&new_state); - return -1; - } - - ret = chmod(new_state.cwd, mode); - - CWD_STATE_FREE(&new_state); - return ret; -} -/* }}} */ - -#if !defined(TSRM_WIN32) && !defined(NETWARE) -CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) { - CWD_STATE_FREE(&new_state); - return -1; - } - - if (link) { -#if HAVE_LCHOWN - ret = lchown(new_state.cwd, owner, group); -#else - ret = -1; -#endif - } else { - ret = chown(new_state.cwd, owner, group); - } - - CWD_STATE_FREE(&new_state); - return ret; -} -/* }}} */ -#endif - -CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */ -{ - cwd_state new_state; - int f; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) { - CWD_STATE_FREE(&new_state); - return -1; - } - - if (flags & O_CREAT) { - mode_t mode; - va_list arg; - - va_start(arg, flags); - mode = (mode_t) va_arg(arg, int); - va_end(arg); - - f = open(new_state.cwd, flags, mode); - } else { - f = open(new_state.cwd, flags); - } - CWD_STATE_FREE(&new_state); - return f; -} -/* }}} */ - -CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int f; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) { - CWD_STATE_FREE(&new_state); - return -1; - } - - f = creat(new_state.cwd, mode); - - CWD_STATE_FREE(&new_state); - return f; -} -/* }}} */ - -CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) /* {{{ */ -{ - cwd_state old_state; - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&old_state, &CWDG(cwd)); - if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND)) { - CWD_STATE_FREE(&old_state); - return -1; - } - oldname = old_state.cwd; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND)) { - CWD_STATE_FREE(&old_state); - CWD_STATE_FREE(&new_state); - return -1; - } - newname = new_state.cwd; - - retval = rename(oldname, newname); - - CWD_STATE_FREE(&old_state); - CWD_STATE_FREE(&new_state); - - return retval; -} -/* }}} */ - -CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) { - CWD_STATE_FREE(&new_state); - return -1; - } - - retval = php_sys_stat(new_state.cwd, buf); - - CWD_STATE_FREE(&new_state); - return retval; -} -/* }}} */ - -#if !defined(TSRM_WIN32) -CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) { - CWD_STATE_FREE(&new_state); - return -1; - } - - retval = lstat(new_state.cwd, buf); - - CWD_STATE_FREE(&new_state); - return retval; -} -/* }}} */ -#endif - -CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) { - CWD_STATE_FREE(&new_state); - return -1; - } - - retval = unlink(new_state.cwd); - - CWD_STATE_FREE(&new_state); - return retval; -} -/* }}} */ - -CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH)) { - CWD_STATE_FREE(&new_state); - return -1; - } - -#ifdef TSRM_WIN32 - retval = mkdir(new_state.cwd); -#else - retval = mkdir(new_state.cwd, mode); -#endif - CWD_STATE_FREE(&new_state); - return retval; -} -/* }}} */ - -CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND)) { - CWD_STATE_FREE(&new_state); - return -1; - } - - retval = rmdir(new_state.cwd); - - CWD_STATE_FREE(&new_state); - return retval; -} -/* }}} */ - -#ifdef TSRM_WIN32 -DIR *opendir(const char *name); -#endif - -CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - DIR *retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) { - CWD_STATE_FREE(&new_state); - return NULL; - } - - retval = opendir(new_state.cwd); - - CWD_STATE_FREE(&new_state); - return retval; -} -/* }}} */ - -#ifdef TSRM_WIN32 -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */ -{ - return popen_ex(command, type, CWDG(cwd).cwd, NULL); -} -/* }}} */ -#elif defined(NETWARE) -/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform - a VCWD_CHDIR() and mutex it - */ -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */ -{ - char prev_cwd[MAXPATHLEN]; - char *getcwd_result; - FILE *retval; - - getcwd_result = VCWD_GETCWD(prev_cwd, MAXPATHLEN); - if (!getcwd_result) { - return NULL; - } - -#ifdef ZTS - tsrm_mutex_lock(cwd_mutex); -#endif - - VCWD_CHDIR(CWDG(cwd).cwd); - retval = popen(command, type); - VCWD_CHDIR(prev_cwd); - -#ifdef ZTS - tsrm_mutex_unlock(cwd_mutex); -#endif - - return retval; -} -/* }}} */ -#else /* Unix */ -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */ -{ - int command_length; - int dir_length, extra = 0; - char *command_line; - char *ptr, *dir; - FILE *retval; - - command_length = strlen(command); - - dir_length = CWDG(cwd).cwd_length; - dir = CWDG(cwd).cwd; - while (dir_length > 0) { - if (*dir == '\'') extra+=3; - dir++; - dir_length--; - } - dir_length = CWDG(cwd).cwd_length; - dir = CWDG(cwd).cwd; - - ptr = command_line = (char *) malloc(command_length + sizeof("cd '' ; ") + dir_length + extra+1+1); - if (!command_line) { - return NULL; - } - memcpy(ptr, "cd ", sizeof("cd ")-1); - ptr += sizeof("cd ")-1; - - if (CWDG(cwd).cwd_length == 0) { - *ptr++ = DEFAULT_SLASH; - } else { - *ptr++ = '\''; - while (dir_length > 0) { - switch (*dir) { - case '\'': - *ptr++ = '\''; - *ptr++ = '\\'; - *ptr++ = '\''; - /* fall-through */ - default: - *ptr++ = *dir; - } - dir++; - dir_length--; - } - *ptr++ = '\''; - } - - *ptr++ = ' '; - *ptr++ = ';'; - *ptr++ = ' '; - - memcpy(ptr, command, command_length+1); - retval = popen(command_line, type); - - free(command_line); - return retval; -} -/* }}} */ -#endif - -CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */ -{ - cwd_state new_state; - char cwd[MAXPATHLEN]; - - /* realpath("") returns CWD */ - if (!*path) { - new_state.cwd = (char*)malloc(1); - new_state.cwd[0] = '\0'; - new_state.cwd_length = 0; - if (VCWD_GETCWD(cwd, MAXPATHLEN)) { - path = cwd; - } - } else if (!IS_ABSOLUTE_PATH(path, strlen(path)) && - VCWD_GETCWD(cwd, MAXPATHLEN)) { - new_state.cwd = strdup(cwd); - new_state.cwd_length = strlen(cwd); - } else { - new_state.cwd = (char*)malloc(1); - new_state.cwd[0] = '\0'; - new_state.cwd_length = 0; - } - - if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) { - free(new_state.cwd); - return NULL; - } - - if (real_path) { - int copy_len = new_state.cwd_length>MAXPATHLEN-1 ? MAXPATHLEN-1 : new_state.cwd_length; - memcpy(real_path, new_state.cwd, copy_len); - real_path[copy_len] = '\0'; - free(new_state.cwd); - return real_path; - } else { - return new_state.cwd; - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h deleted file mode 100644 index 238c08035cfc9..0000000000000 --- a/TSRM/tsrm_virtual_cwd.h +++ /dev/null @@ -1,310 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Andi Gutmans | - | Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef VIRTUAL_CWD_H -#define VIRTUAL_CWD_H - -#include "TSRM.h" -#include "tsrm_config_common.h" - -#include -#include -#include - -#ifdef HAVE_UTIME_H -#include -#endif - -#ifdef HAVE_STDARG_H -#include -#endif - -#ifdef ZTS -#define VIRTUAL_DIR -#endif - -#ifndef TSRM_WIN32 -#include -#else -#include -#endif - -#if defined(__osf__) || defined(_AIX) -#include -#endif - -#ifdef TSRM_WIN32 -#include "readdir.h" -#include -/* mode_t isn't defined on Windows */ -typedef unsigned short mode_t; - -#define DEFAULT_SLASH '\\' -#define DEFAULT_DIR_SEPARATOR ';' -#define IS_SLASH(c) ((c) == '/' || (c) == '\\') -#define IS_SLASH_P(c) (*(c) == '/' || \ - (*(c) == '\\' && !IsDBCSLeadByte(*(c-1)))) - -/* COPY_WHEN_ABSOLUTE is 2 under Win32 because by chance both regular absolute paths - in the file system and UNC paths need copying of two characters */ -#define COPY_WHEN_ABSOLUTE(path) 2 -#define IS_UNC_PATH(path, len) \ - (len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1])) -#define IS_ABSOLUTE_PATH(path, len) \ - (len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len))) - -#elif defined(NETWARE) -#ifdef HAVE_DIRENT_H -#include -#endif - -#define DEFAULT_SLASH '/' -#define DEFAULT_DIR_SEPARATOR ';' -#define IS_SLASH(c) ((c) == '/' || (c) == '\\') -#define IS_SLASH_P(c) IS_SLASH(*(c)) -/* Colon indicates volume name, either first character should be forward slash or backward slash */ -#define IS_ABSOLUTE_PATH(path, len) \ - ((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\')))) - -#else -#ifdef HAVE_DIRENT_H -#include -#endif - -#define DEFAULT_SLASH '/' - -#ifdef __riscos__ -#define DEFAULT_DIR_SEPARATOR ';' -#else -#define DEFAULT_DIR_SEPARATOR ':' -#endif - -#define IS_SLASH(c) ((c) == '/') -#define IS_SLASH_P(c) (*(c) == '/') - -#endif - - -#ifndef COPY_WHEN_ABSOLUTE -#define COPY_WHEN_ABSOLUTE(path) 0 -#endif - -#ifndef IS_ABSOLUTE_PATH -#define IS_ABSOLUTE_PATH(path, len) \ - (IS_SLASH(path[0])) -#endif - -#ifdef TSRM_EXPORTS -#define CWD_EXPORTS -#endif - -#ifdef TSRM_WIN32 -# ifdef CWD_EXPORTS -# define CWD_API __declspec(dllexport) -# else -# define CWD_API __declspec(dllimport) -# endif -#else -#define CWD_API -#endif - -#ifdef TSRM_WIN32 -CWD_API int php_sys_stat(const char *path, struct stat *buf); -#else -# define php_sys_stat stat -#endif - -typedef struct _cwd_state { - char *cwd; - int cwd_length; -} cwd_state; - -typedef int (*verify_path_func)(const cwd_state *); - -CWD_API void virtual_cwd_startup(void); -CWD_API void virtual_cwd_shutdown(void); -CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC); -CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC); -CWD_API int virtual_chdir(const char *path TSRMLS_DC); -CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC); -CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC); -CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC); -CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC); -CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC); -CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...); -CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC); -CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC); -CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC); -#if !defined(TSRM_WIN32) -CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC); -#endif -CWD_API int virtual_unlink(const char *path TSRMLS_DC); -CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC); -CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC); -CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC); -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC); -CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC); -#if defined(TSRM_WIN32) -/* these are not defined in win32 headers */ -#ifndef W_OK -#define W_OK 0x02 -#endif -#ifndef R_OK -#define R_OK 0x04 -#endif -#ifndef X_OK -#define X_OK 0x01 -#endif -#ifndef F_OK -#define F_OK 0x00 -#endif -#endif - -#if HAVE_UTIME -CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC); -#endif -CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC); -#if !defined(TSRM_WIN32) && !defined(NETWARE) -CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC); -#endif - -/* One of the following constants must be used as the last argument - in virtual_file_ex() call. */ - -#define CWD_EXPAND 0 /* expand "." and ".." but dont resolve symlinks */ -#define CWD_FILEPATH 1 /* resolve symlinks if file is exist otherwise expand */ -#define CWD_REALPATH 2 /* call realpath(), resolve symlinks. File must exist */ - -CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath); - -CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC); - -#define REALPATH_CACHE_TTL (2*60) /* 2 minutes */ -#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */ - -typedef struct _realpath_cache_bucket { - unsigned long key; - char *path; - int path_len; - char *realpath; - int realpath_len; - time_t expires; - struct _realpath_cache_bucket *next; -} realpath_cache_bucket; - -typedef struct _virtual_cwd_globals { - cwd_state cwd; - long realpath_cache_size; - long realpath_cache_size_limit; - long realpath_cache_ttl; - realpath_cache_bucket *realpath_cache[1024]; -} virtual_cwd_globals; - -#ifdef ZTS -extern ts_rsrc_id cwd_globals_id; -# define CWDG(v) TSRMG(cwd_globals_id, virtual_cwd_globals *, v) -#else -extern virtual_cwd_globals cwd_globals; -# define CWDG(v) (cwd_globals.v) -#endif - -CWD_API void realpath_cache_clean(TSRMLS_D); -CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC); - -/* The actual macros to be used in programs using TSRM - * If the program defines VIRTUAL_DIR it will use the - * virtual_* functions - */ - -#ifdef VIRTUAL_DIR - -#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size TSRMLS_CC) -#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode TSRMLS_CC) -/* Because open() has two modes, we have to macros to replace it */ -#define VCWD_OPEN(path, flags) virtual_open(path TSRMLS_CC, flags) -#define VCWD_OPEN_MODE(path, flags, mode) virtual_open(path TSRMLS_CC, flags, mode) -#define VCWD_CREAT(path, mode) virtual_creat(path, mode TSRMLS_CC) -#define VCWD_CHDIR(path) virtual_chdir(path TSRMLS_CC) -#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir TSRMLS_CC) -#define VCWD_GETWD(buf) -#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC) -#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC) -#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC) -#if !defined(TSRM_WIN32) -#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC) -#endif -#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC) -#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode TSRMLS_CC) -#define VCWD_RMDIR(pathname) virtual_rmdir(pathname TSRMLS_CC) -#define VCWD_OPENDIR(pathname) virtual_opendir(pathname TSRMLS_CC) -#define VCWD_POPEN(command, type) virtual_popen(command, type TSRMLS_CC) -#define VCWD_ACCESS(pathname, mode) virtual_access(pathname, mode TSRMLS_CC) -#if HAVE_UTIME -#define VCWD_UTIME(path, time) virtual_utime(path, time TSRMLS_CC) -#endif -#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC) -#if !defined(TSRM_WIN32) && !defined(NETWARE) -#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0 TSRMLS_CC) -#if HAVE_LCHOWN -#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1 TSRMLS_CC) -#endif -#endif - -#else - -#define VCWD_GETCWD(buff, size) getcwd(buff, size) -#define VCWD_FOPEN(path, mode) fopen(path, mode) -#define VCWD_OPEN(path, flags) open(path, flags) -#define VCWD_OPEN_MODE(path, flags, mode) open(path, flags, mode) -#define VCWD_CREAT(path, mode) creat(path, mode) -#define VCWD_RENAME(oldname, newname) rename(oldname, newname) -#define VCWD_CHDIR(path) chdir(path) -#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir) -#define VCWD_GETWD(buf) getwd(buf) -#define VCWD_STAT(path, buff) php_sys_stat(path, buff) -#define VCWD_LSTAT(path, buff) lstat(path, buff) -#define VCWD_UNLINK(path) unlink(path) -#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode) -#define VCWD_RMDIR(pathname) rmdir(pathname) -#define VCWD_OPENDIR(pathname) opendir(pathname) -#define VCWD_POPEN(command, type) popen(command, type) -#if defined(TSRM_WIN32) -#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode) -#else -#define VCWD_ACCESS(pathname, mode) access(pathname, mode) -#endif - -#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC) - -#if HAVE_UTIME -#define VCWD_UTIME(path, time) utime(path, time) -#endif -#define VCWD_CHMOD(path, mode) chmod(path, mode) -#if !defined(TSRM_WIN32) && !defined(NETWARE) -#define VCWD_CHOWN(path, owner, group) chown(path, owner, group) -#if HAVE_LCHOWN -#define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group) -#endif -#endif - -#endif - -#endif /* VIRTUAL_CWD_H */ diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c deleted file mode 100644 index 86a0e4ea8105c..0000000000000 --- a/TSRM/tsrm_win32.c +++ /dev/null @@ -1,397 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Daniel Beulshausen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include -#include -#include - -#define TSRM_INCLUDE_FULL_WINDOWS_HEADERS - -#include "TSRM.h" - -#ifdef TSRM_WIN32 - -#include "tsrm_win32.h" - -#ifdef ZTS -static ts_rsrc_id win32_globals_id; -#else -static tsrm_win32_globals win32_globals; -#endif - -static void tsrm_win32_ctor(tsrm_win32_globals *globals TSRMLS_DC) -{ - globals->process = NULL; - globals->shm = NULL; - globals->process_size = 0; - globals->shm_size = 0; - globals->comspec = _strdup((GetVersion()<0x80000000)?"cmd.exe":"command.com"); -} - -static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC) -{ - shm_pair *ptr; - - if (globals->process) { - free(globals->process); - } - - if (globals->shm) { - for (ptr = globals->shm; ptr < (globals->shm + globals->shm_size); ptr++) { - UnmapViewOfFile(ptr->addr); - CloseHandle(ptr->segment); - UnmapViewOfFile(ptr->descriptor); - CloseHandle(ptr->info); - } - free(globals->shm); - } - - free(globals->comspec); -} - -TSRM_API void tsrm_win32_startup(void) -{ -#ifdef ZTS - ts_allocate_id(&win32_globals_id, sizeof(tsrm_win32_globals), (ts_allocate_ctor)tsrm_win32_ctor, (ts_allocate_ctor)tsrm_win32_dtor); -#else - tsrm_win32_ctor(&win32_globals TSRMLS_CC); -#endif -} - -TSRM_API void tsrm_win32_shutdown(void) -{ -#ifndef ZTS - tsrm_win32_dtor(&win32_globals TSRMLS_CC); -#endif -} - -TSRM_API int tsrm_win32_access(const char *pathname, int mode) -{ - if (mode == 1 /*X_OK*/) { -#if 1 - /* This code is not supported by Windows 98, - * but we don't support it anymore */ - DWORD type; - - return GetBinaryType(pathname, &type)?0:-1; -#else - SHFILEINFO sfi; - - return access(pathname, 0) == 0 && - SHGetFileInfo(pathname, 0, &sfi, sizeof(SHFILEINFO), SHGFI_EXETYPE) != 0 ? 0 : -1; -#endif - } else { - return access(pathname, mode); - } -} - - -static process_pair *process_get(FILE *stream TSRMLS_DC) -{ - process_pair *ptr; - process_pair *newptr; - - for (ptr = TWG(process); ptr < (TWG(process) + TWG(process_size)); ptr++) { - if (ptr->stream == stream) { - break; - } - } - - if (ptr < (TWG(process) + TWG(process_size))) { - return ptr; - } - - newptr = (process_pair*)realloc((void*)TWG(process), (TWG(process_size)+1)*sizeof(process_pair)); - if (newptr == NULL) { - return NULL; - } - - TWG(process) = newptr; - ptr = newptr + TWG(process_size); - TWG(process_size)++; - return ptr; -} - -static shm_pair *shm_get(int key, void *addr) -{ - shm_pair *ptr; - shm_pair *newptr; - TSRMLS_FETCH(); - - for (ptr = TWG(shm); ptr < (TWG(shm) + TWG(shm_size)); ptr++) { - if (!ptr->descriptor) { - continue; - } - if (!addr && ptr->descriptor->shm_perm.key == key) { - break; - } else if (ptr->addr == addr) { - break; - } - } - - if (ptr < (TWG(shm) + TWG(shm_size))) { - return ptr; - } - - newptr = (shm_pair*)realloc((void*)TWG(shm), (TWG(shm_size)+1)*sizeof(shm_pair)); - if (newptr == NULL) { - return NULL; - } - - TWG(shm) = newptr; - ptr = newptr + TWG(shm_size); - TWG(shm_size)++; - return ptr; -} - -static HANDLE dupHandle(HANDLE fh, BOOL inherit) { - HANDLE copy, self = GetCurrentProcess(); - if (!DuplicateHandle(self, fh, self, ©, 0, inherit, DUPLICATE_SAME_ACCESS|DUPLICATE_CLOSE_SOURCE)) { - return NULL; - } - return copy; -} - -TSRM_API FILE *popen(const char *command, const char *type) -{ - return popen_ex(command, type, NULL, NULL); -} - -TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env) -{ - FILE *stream = NULL; - int fno, str_len = strlen(type), read, mode; - STARTUPINFO startup; - PROCESS_INFORMATION process; - SECURITY_ATTRIBUTES security; - HANDLE in, out; - char *cmd; - process_pair *proc; - TSRMLS_FETCH(); - - security.nLength = sizeof(SECURITY_ATTRIBUTES); - security.bInheritHandle = TRUE; - security.lpSecurityDescriptor = NULL; - - if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) { - return NULL; - } - - memset(&startup, 0, sizeof(STARTUPINFO)); - memset(&process, 0, sizeof(PROCESS_INFORMATION)); - - startup.cb = sizeof(STARTUPINFO); - startup.dwFlags = STARTF_USESTDHANDLES; - startup.hStdError = GetStdHandle(STD_ERROR_HANDLE); - - read = (type[0] == 'r') ? TRUE : FALSE; - mode = ((str_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT; - - - if (read) { - in = dupHandle(in, FALSE); - startup.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - startup.hStdOutput = out; - } else { - out = dupHandle(out, FALSE); - startup.hStdInput = in; - startup.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - } - - cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")); - sprintf(cmd, "%s /c %s", TWG(comspec), command); - if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env, cwd, &startup, &process)) { - return NULL; - } - free(cmd); - - CloseHandle(process.hThread); - proc = process_get(NULL TSRMLS_CC); - - if (read) { - fno = _open_osfhandle((tsrm_intptr_t)in, _O_RDONLY | mode); - CloseHandle(out); - } else { - fno = _open_osfhandle((tsrm_intptr_t)out, _O_WRONLY | mode); - CloseHandle(in); - } - - stream = _fdopen(fno, type); - proc->prochnd = process.hProcess; - proc->stream = stream; - return stream; -} - -TSRM_API int pclose(FILE *stream) -{ - DWORD termstat = 0; - process_pair *process; - TSRMLS_FETCH(); - - if ((process = process_get(stream TSRMLS_CC)) == NULL) { - return 0; - } - - fflush(process->stream); - fclose(process->stream); - - WaitForSingleObject(process->prochnd, INFINITE); - GetExitCodeProcess(process->prochnd, &termstat); - process->stream = NULL; - CloseHandle(process->prochnd); - - return termstat; -} - -TSRM_API int shmget(int key, int size, int flags) -{ - shm_pair *shm; - char shm_segment[26], shm_info[29]; - HANDLE shm_handle, info_handle; - BOOL created = FALSE; - - if (size < 0) { - return -1; - } - - sprintf(shm_segment, "TSRM_SHM_SEGMENT:%d", key); - sprintf(shm_info, "TSRM_SHM_DESCRIPTOR:%d", key); - - shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment); - info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info); - - if ((!shm_handle && !info_handle)) { - if (flags & IPC_CREAT) { - shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, shm_segment); - info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), shm_info); - created = TRUE; - } - if ((!shm_handle || !info_handle)) { - return -1; - } - } else { - if (flags & IPC_EXCL) { - return -1; - } - } - - shm = shm_get(key, NULL); - shm->segment = shm_handle; - shm->info = info_handle; - shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); - - if (created) { - shm->descriptor->shm_perm.key = key; - shm->descriptor->shm_segsz = size; - shm->descriptor->shm_ctime = time(NULL); - shm->descriptor->shm_cpid = getpid(); - shm->descriptor->shm_perm.mode = flags; - - shm->descriptor->shm_perm.cuid = shm->descriptor->shm_perm.cgid= 0; - shm->descriptor->shm_perm.gid = shm->descriptor->shm_perm.uid = 0; - shm->descriptor->shm_atime = shm->descriptor->shm_dtime = 0; - shm->descriptor->shm_lpid = shm->descriptor->shm_nattch = 0; - shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0; - } - - if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) { - CloseHandle(shm->segment); - UnmapViewOfFile(shm->descriptor); - CloseHandle(shm->info); - return -1; - } - - return key; -} - -TSRM_API void *shmat(int key, const void *shmaddr, int flags) -{ - shm_pair *shm = shm_get(key, NULL); - - if (!shm->segment) { - return (void*)-1; - } - - shm->descriptor->shm_atime = time(NULL); - shm->descriptor->shm_lpid = getpid(); - shm->descriptor->shm_nattch++; - - shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); - - return shm->addr; -} - -TSRM_API int shmdt(const void *shmaddr) -{ - shm_pair *shm = shm_get(0, (void*)shmaddr); - - if (!shm->segment) { - return -1; - } - - shm->descriptor->shm_dtime = time(NULL); - shm->descriptor->shm_lpid = getpid(); - shm->descriptor->shm_nattch--; - - return UnmapViewOfFile(shm->addr) ? 0 : -1; -} - -TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf) { - shm_pair *shm = shm_get(key, NULL); - - if (!shm->segment) { - return -1; - } - - switch (cmd) { - case IPC_STAT: - memcpy(buf, shm->descriptor, sizeof(struct shmid_ds)); - return 0; - - case IPC_SET: - shm->descriptor->shm_ctime = time(NULL); - shm->descriptor->shm_perm.uid = buf->shm_perm.uid; - shm->descriptor->shm_perm.gid = buf->shm_perm.gid; - shm->descriptor->shm_perm.mode = buf->shm_perm.mode; - return 0; - - case IPC_RMID: - if (shm->descriptor->shm_nattch < 1) { - shm->descriptor->shm_perm.key = -1; - } - return 0; - - default: - return -1; - } -} - -TSRM_API char *realpath(char *orig_path, char *buffer) -{ - int ret = GetFullPathName(orig_path, _MAX_PATH, buffer, NULL); - if(!ret || ret > _MAX_PATH) { - return NULL; - } - return buffer; -} - -#endif diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h deleted file mode 100644 index 3e2d5075efbd6..0000000000000 --- a/TSRM/tsrm_win32.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Daniel Beulshausen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef TSRM_WIN32_H -#define TSRM_WIN32_H - -#include "TSRM.h" -#include - -struct ipc_perm { - int key; - unsigned short uid; - unsigned short gid; - unsigned short cuid; - unsigned short cgid; - unsigned short mode; - unsigned short seq; -}; - -struct shmid_ds { - struct ipc_perm shm_perm; - int shm_segsz; - time_t shm_atime; - time_t shm_dtime; - time_t shm_ctime; - unsigned short shm_cpid; - unsigned short shm_lpid; - short shm_nattch; -}; - -typedef struct { - FILE *stream; - HANDLE prochnd; -} process_pair; - -typedef struct { - void *addr; - HANDLE info; - HANDLE segment; - struct shmid_ds *descriptor; -} shm_pair; - -typedef struct { - process_pair *process; - shm_pair *shm; - int process_size; - int shm_size; - char *comspec; -} tsrm_win32_globals; - -#ifdef ZTS -# define TWG(v) TSRMG(win32_globals_id, tsrm_win32_globals *, v) -#else -# define TWG(v) (win32_globals.v) -#endif - -#define IPC_PRIVATE 0 -#define IPC_CREAT 00001000 -#define IPC_EXCL 00002000 -#define IPC_NOWAIT 00004000 - -#define IPC_RMID 0 -#define IPC_SET 1 -#define IPC_STAT 2 -#define IPC_INFO 3 - -#define SHM_R PAGE_READONLY -#define SHM_W PAGE_READWRITE - -#define SHM_RDONLY FILE_MAP_READ -#define SHM_RND FILE_MAP_WRITE -#define SHM_REMAP FILE_MAP_COPY - - -TSRM_API void tsrm_win32_startup(void); -TSRM_API void tsrm_win32_shutdown(void); - -TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env); -TSRM_API FILE *popen(const char *command, const char *type); -TSRM_API int pclose(FILE *stream); -TSRM_API int tsrm_win32_access(const char *pathname, int mode); - -TSRM_API int shmget(int key, int size, int flags); -TSRM_API void *shmat(int key, const void *shmaddr, int flags); -TSRM_API int shmdt(const void *shmaddr); -TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf); - -TSRM_API char *realpath(char *orig_path, char *buffer); -#endif diff --git a/Zend/ChangeLog b/Zend/ChangeLog deleted file mode 100644 index ef4e71c87a0f3..0000000000000 --- a/Zend/ChangeLog +++ /dev/null @@ -1,22097 +0,0 @@ -2005-08-05 Dmitry Stogov - - * zend_execute.c - tests/array_type_hint_001.phpt - tests/bug33996.phpt: - Fixed bug #33996 (No information given for fatal error on passing invalid - value to typed argument) - - * zend_operators.c - tests/bug33999.phpt: - Fixed bug #33999 (object remains object when cast to int) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak in foreach() on undefined variable - (Zend/tests/foreach_undefined.php) - -2005-08-04 Antony Dovgal - - * tests/foreach_undefined.phpt: - add test for the last Dmitry's fix - -2005-08-04 Dmitry Stogov - - * zend_compile.c: - Fixed possible memory corryption during compilation of - - * (PHP_5_0) - zend_objects.c: - Fixed clone bug in ze1_compatibility mode - - * zend_objects.c: - Fixed clone bug in ze1_compatibilty mode - -2005-08-03 Jani Taskinen - - * LICENSE: - - Bumber up year - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_strtod.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h - zend_vm.h: - Bump up the year - - * README.ZEND_VM: - Nuked DOS EOLs - -2005-08-02 Dmitry Stogov - - * zend_execute_API.c - zend_execute_API.c: - Fixed bug #33942 (the patch to #33156 crash cygwin except cli) - -2005-08-02 Jani Taskinen - - * zend_exceptions.c: - - Fixed bug #33967 (misuse of Exception constructor doesn\'t display - errorfile) - -2005-08-02 Dmitry Stogov - - * bench.php: - Removed warnings - -2005-07-29 Ilia Alshanetsky - - * zend_vm_def.h - zend_vm_execute.h: - Fixed warning message generated when isset() or empty() are given invalid - offset type. - -2005-07-29 Anantha Kesari H Y - - * acconfig.h - acconfig.h: - In NetWare few of the programs like apache2 and ldap use winsock inclusinf - sys/socket.h is not desirable. - --Kamesh - -2005-07-29 Jani Taskinen - - * zend_vm_execute.h: - update generated file - -2005-07-28 Andi Gutmans - - * zend_vm_def.h: - - Tiny fixlet - -2005-07-28 Marcus Boerger - - * zend_API.c - zend_API.h: - - Add convenience function zend_is_callable_ex() and base zend_is_callable - and zend_make_callable on it. This functions allows to check if a php - variable is a callable function and returns its function pointer as well - as object if possible. - -2005-07-26 Jani Taskinen - - * zend_execute_API.c: - bug #33865 - -2005-07-25 Marcus Boerger - - * zend_API.c: - - Fix #33853 - -2005-07-22 Dmitry Stogov - - * zend.c - zend.c - tests/bug33802.phpt - tests/bug33802.phpt - tests/bug33802.phpt: - Fixed bug #33802 (throw Exception in error handler causes crash) - -2005-07-21 Marcus Boerger - - * zend_execute_API.c: - - Fix error generation logic (found by johannes) - -2005-07-21 Dmitry Stogov - - * zend_vm_def.h: - Fixed bug with returning from internal function by reference - -2005-07-19 Marcus Boerger - - * zend_interfaces.c: - - Dont't warn in case an exception is pending - in this case it'd - superflous - -2005-07-19 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #33710 (ArrayAccess objects doen't initialize $this) - -2005-07-18 Rasmus Lerdorf - - * zend_language_scanner.l: - Valgrind is unhappy that this is not initialized - -2005-07-18 Dmitry Stogov - - * zend_API.c - zend_API.h: - Fixed bug in new module statrup mechanism - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33558.phpt: - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * tests/bug33558.phpt - tests/bug33558.phpt: - - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed some compilation warnings. - -2005-07-18 Jani Taskinen - - * tests/bug33710.phpt: - typo - -2005-07-17 Marcus Boerger - - * tests/bug33710.phpt: - - Add new test - -2005-07-17 Ilia Alshanetsky - - * zend_compile.c: - Added missing init. - -2005-07-14 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Dmitry Stogov - - * (php_5_1_0b3) - zend_execute_API.c - zend_execute_API.c: - Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). - (Nuno) - -2005-07-11 Ilia Alshanetsky - - * zend_vm_def.h - zend_vm_execute.h: - Make references misuse emit E_NOTICE rather E_STRICT to be compatible with - PHP 4.4.0 - -2005-07-08 Jani Taskinen - - * tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix test when session.save_handler is "user" - -2005-07-07 Dmitry Stogov - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_objects.c - zend_reflection_api.c: - Fixed bug #33512 (Add missing support for isset()/unset() overloading to - complement the property get/set methods) - -2005-07-07 Anantha Kesari H Y - - * zend_stream.c - zend_stream.c: - zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which I - believe EOT) for EOF(^D) character. This happens when fread is asked to - read one and only character as is the case with cl interactive mode. - -- Kamesh - -2005-07-07 Dmitry Stogov - - * zend_execute_API.c - zend_hash.c - zend_hash.h - tests/bug28072.phpt: - Fixed bug #28072 (static array with some constant keys will be incorrectly - ordered). - -2005-07-04 Dmitry Stogov - - * zend_compile.h - zend_execute.c - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on 'global ${"{$blah}_ID"};' - - * zend_API.h - zend_execute_API.c: - Fixed bug #31158 (array_splice on $GLOBALS crashes) - -2005-07-03 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak - -2005-06-30 Dmitry Stogov - - * zend_API.c - zend_API.h: - Restored old behavior of zend_statup_module() - -2005-06-29 Stanislav Malyshev - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix conditions for freeing - - * zend_API.c - zend_API.c: - add comment - - * (PHP_5_0) - zend_execute.c: - fix conditions - -2005-06-28 Antony Dovgal - - * zend_execute.c: - fix leak: when dup was ful zend_std_object_get_class_name() - returns SUCCESS aka 0 - -2005-06-28 Stanislav Malyshev - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix previous patch - - * zend_vm_execute.h: - update - - * zend_execute.c - zend_vm_def.h: - fixes for non-php objects - - * (PHP_5_0) - zend_execute.c: - fixes fo rnon-php objects (John Coggeshall) - -2005-06-27 Jani Taskinen - - * zend.c: - - Fixed bug #31358 (Older GCC versions do not provide portable va_copy()). - -2005-06-27 Stanislav Malyshev - - * zend_API.c - zend_API.c - zend_API.h - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.c - zend_exceptions.c - zend_exceptions.c: - fix various "Class entry requested for an object without PHP class" - messages - when working with non-PHP objects. - -2005-06-27 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on assigment string offset by reference - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed wrong include/requre occurrences in debug backtrace. - -2005-06-24 Dmitry Stogov - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Export zend_do_fcall() helper from executor - - * zend_compile.c - zend_compile.c: - Partial fix for bug #26584 (Class member - array key overflow) - It doesn't fix integer overflow problem, but allows null, boolean and - double keys in array constants in the same way as in runtime. - - * tests/bug30519.phpt - tests/bug30519.phpt: - - Fixed bug #30519 (Interface not existing says Class not found) - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_API.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30519.phpt: - Fixed bug #30519 (Interface not existing says Class not found) - -2005-06-23 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug28377.phpt: - Fixed bug #28377 (debug_backtrace is intermittently passing args) - - * tests/bug28377.phpt - tests/bug28377.phpt: - - file bug28377.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32660.phpt: - Fixed bug #32660 (Assignment by reference causes crash when field access is - overloaded (__get)) - - * tests/bug32660.phpt - tests/bug32660.phpt: - - Fixed bug #32660 (Assignment by reference causes crash when field access - is overloaded (__get)) - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug30828.phpt: - Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden - methods) - - * tests/bug30828.phpt - tests/bug30828.phpt: - - file bug30828.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug27268.phpt: - Test for bug #27268. It is fixed in HEAD but not in PHP_5_0. - - * zend_execute.c - tests/bug27268.phpt - tests/bug27268.phpt: - Fixed bug #27268 (Bad references accentuated by clone). - -2005-06-23 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - zend_builtin_functions.c - zend_builtin_functions.c - zend_execute_API.c - zend_execute_API.c - tests/bug29896.phpt: - Fixed bug #29896 (Backtrace argument list out of sync) - - * tests/bug29896.phpt - tests/bug29896.phpt: - - file bug29896.phpt was initially added on branch PHP_5_0. - -2005-06-22 Stanislav Malyshev - - * (php_5_1_0b2) - zend_vm.h - zend_vm_execute.h - zend_vm_gen.php: - export zend_vm_set_opcode_handler - -2005-06-22 Antony Dovgal - - * (php_5_1_0b2) - zend_ini.c: - - allow to use "yes" and "true" with ini_set() and in commandline (through - -d flag) - - fix #15854 that was caused by wrong consideration that - zend_ini_boolean_displayer_cb() - always recieves converted to "0"/"1" values. - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33257.phpt: - Fixed bug #33257 (array_splice() inconsistent when passed function instead - of variable) - - * tests/bug33257.phpt - tests/bug33257.phpt: - - file bug33257.phpt was initially added on branch PHP_5_0. - -2005-06-22 Jani Taskinen - - * (php_5_1_0b2) - tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix tests - -2005-06-21 Dmitry Stogov - - * tests/unset_cv07.phpt: - Fixed test file - -2005-06-21 Andi Gutmans - - * zend.h: - - Back to -dev. Guys (n' Girls), give at least 1 hour before you start - - complaining about not going back to -dev. I like checking the tarball - - before I change it back. - - * (php_5_1_0b2) - zend.h: - - Take #3 :) - -2005-06-21 Ilia Alshanetsky - - * (php_5_1_0b2) - zend_reflection_api.c: - Fixed memory leak. - - -2005-06-21 Dmitry Stogov - - * (PHP_5_0) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS - in case of early binding - - * (php_5_1_0b2) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS in case of early binding - -2005-06-20 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-20 Dmitry Stogov - - * (php_5_1_0b2) - zend_object_handlers.c - zend_object_handlers.c: - Fixed possible crash on $x = $obj->$non_string - -2005-06-20 Marcus Boerger - - * (php_5_1_0b2) - zend_reflection_api.c: - - Fix bug #33389 by fixing copying - - * zend_reflection_api.c: - - Show true/flase - -2005-06-19 Derick Rethans - - * tests/bug32226.phpt: - - Fixed layout of test description. - -2005-06-17 Jani Taskinen - - * tests/bug29368.phpt - tests/bug30856.phpt - tests/bug30961.phpt - tests/bug31720.phpt - tests/bug32226.phpt - tests/bug33277.phpt: - No short-tags! - -2005-06-17 Dmitry Stogov - - * zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Removed EX(fbc_constructor) (it is no longer needed) - -2005-06-17 Antony Dovgal - - * (PHP_5_0) - zend_API.c - zend_list.c: - MFH: improve error messages in internal classes - - * zend_API.c - zend_list.c: - improve error messages when error raised from an internal class (do not - hide class name) - -2005-06-17 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c: - Fixed bug #33277 (private method accessed by child class) - -2005-06-17 Antony Dovgal - - * zend_hash.c: - fix bug #33382 (array_reverse() fails after *sort()) - no need to MFH - the bug existed only in HEAD - -2005-06-17 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_extensions.h - zend_modules.h: - Improved PHP extension loading mechanism with support for module - dependencies and conflicts. - -2005-06-16 Marcus Boerger - - * zend_reflection_api.c: - - Internal functions/methods can now return by reference - - * zend_execute.c: - - Fix TSRM build - -2005-06-16 Dmitry Stogov - - * bench.php: - typo - - * zend.h - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_modules.h - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Allowed return by refrence from internal functions - -2005-06-16 Stanislav Malyshev - - * zend_execute.c - zend_execute.h: - rename to zend_ - -2005-06-16 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33318.phpt: - Fixed bug #33318 (throw 1; results in Invalid opcode 108/1/8) - -2005-06-16 Zeev Suraski - - * zend_language_scanner.l: - Fixlet - -2005-06-16 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Compilation warnings - - * zend_compile.c - zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - ZEND_UNSET_DIM_OBJ is splitted to ZEND_UNSET_DIM and ZEND_UNSET_OBJ. - -2005-06-16 Stanislav Malyshev - - * zend_execute.c - zend_execute.h: - export zval getters - -2005-06-16 Dmitry Stogov - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - USER_OPCODE API is improvet. - Implemented ability to dispatch from user handler to internal handler of - another opcode. - -2005-06-15 Dmitry Stogov - - * zend.c - zend.h: - Fixed OS X compatibility - -2005-06-15 Jani Taskinen - - * tests/bug32428.phpt: - typofix - -2005-06-14 Ilia Alshanetsky - - * bench.php: - more accurate timing function. - -2005-06-14 Dmitry Stogov - - * zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed old executor - -2005-06-14 Jani Taskinen - - * Zend.m4: - reordered + added msg to configure output for PHP_ZEND_VM - - * Zend.m4: - typofix - - * Zend.m4 - acinclude.m4: - fix standalone build - -2005-06-13 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Specializer optimization - - * zend.c - zend.h - zend_execute.c: - Fixed bug #33212 ([GCC 4]: 'zend_error_noreturn' aliased to external symbol - 'zend_error'). - The fix is not tested on Solaris and DARWIN! - - * zend_reflection_api.c - tests/bug33312.phpt: - Fixed bug #33312 (ReflectionParameter methods do not work correctly) - -2005-06-11 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - b2 (will post it to internals@) - -2005-06-10 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b1) - zend.h: - - Go with 5.1.0b1 - -2005-06-10 Dmitry Stogov - - * (php_5_1_0b1) - tests/bug30162.phpt: - Added test for bug #30162 (it is already fixed but test file was forgotten) - - * (php_5_1_0b1) - tests/bug31177.phpt: - Added test file for bug #31177 (not fixed yet) - - * tests/bug31177.phpt - tests/bug31177.phpt: - - file bug31177.phpt was initially added on branch PHP_5_0. - - * (php_5_1_0b1) - tests/bug29689.phpt: - typos - - * (php_5_1_0b1) - zend_reflection_api.c - zend_reflection_api.c: - Fixed support for ZEND_ACC_SHADOW in ReflectionProperty constructor - - * (php_5_1_0b1) - zend_execute.c - zend_execute.h - zend_extensions.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Fix so that extensions like xdebug, can overload opcodes in all execution - modes including goto/switch - - * (php_5_1_0b1) - zend_compile.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Merge three opcodes (ZEND_NEW, ZEND_JMP_NO_CTOR, ZEND_INIT_CTOR) into one - (ZEND_NEW). There was no real reason for this anymore and API should be - changed before 5.1 - -2005-06-09 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - MF50: fix #29689 and more private property problems - - * tests/bug33277.phpt: - add test for this TBF bug - - * zend_compile.c: - disallow abstrace private methods - - * (PHP_5_0) - zend_compile.c: - Disallow abstract privae methods - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - fix #29689 and more private property problems - -2005-06-09 Dmitry Stogov - - * zend.c - zend.c - zend_execute_API.c - zend_execute_API.c: - Fixed double call to php_stream_close() on compiler errors - -2005-06-09 Stanislav Malyshev - - * tests/bug33277.phpt - tests/bug33277.phpt: - - file bug33277.phpt was initially added on branch PHP_5_0. - -2005-06-09 Dmitry Stogov - - * zend.c - zend.c: - Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may - result in seg fault) - - * zend_language_scanner.l - zend_language_scanner.l: - Fixed bug (Crash on Windows and ZTS) that was introduced with fix for bug - #26456 - -2005-06-08 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed exception handling in getIterator() callback (bugs #26229 & #30725) - - * zend_compile.c - zend_compile.c: - Fixed valgrind errors - - * zend_reflection_api.c: - Fixed ReflectionClass::setStaticPropertyValue() - -2005-06-08 Jani Taskinen - - * zend_config.w32.h: - Hopefully fixes win32 builds - -2005-06-08 Dmitry Stogov - - * zend_compile.c: - Fixed lookups for previos opcodes - - * zend_execute_API.c - zend_execute_API.c - tests/bug30140.phpt: - Fixed bug #30140 (Problem with array in static properties) - - * tests/bug30140.phpt - tests/bug30140.phpt: - - file bug30140.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug32322.phpt: - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * tests/bug32322.phpt - tests/bug32322.phpt: - - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30820.phpt: - Fixed bug #30820 (static member conflict with $this->member silently - ignored) - - * tests/bug30820.phpt - tests/bug30820.phpt: - - file bug30820.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_language_parser.y - zend_language_parser.y - tests/bug30961.phpt: - Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) - - * tests/bug30961.phpt - tests/bug30961.phpt: - - file bug30961.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-06 Derick Rethans - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Regenerate VM files and add warning about regeneration - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h: - - MH44: Problems with user defined error handler and wrong usage of - references - -2005-06-06 Dmitry Stogov - - * zend_compile.c - tests/bug32428.phpt: - Fixed bug #32428 (The @ warning error supression operator is broken) - - * zend_objects_API.c - zend_objects_API.c - tests/bug32799.phpt: - Fixed bug #32799 (crash: calling the corresponding global var during the - destruct) - - * tests/bug32799.phpt - tests/bug32799.phpt: - - file bug32799.phpt was initially added on branch PHP_5_0. - - * tests/bug32596.phpt: - Added test for bug #32596 (Segfault/Memory Leak by getClass (etc) in - __destruct) - - * tests/bug32596.phpt - tests/bug32596.phpt: - - file bug32596.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct) - - * (PHP_5_0) - tests/bug32993.phpt: - Added test for bug #32993 (implemented Iterator function current() don't - throw - exception) - - * tests/bug32993.phpt - tests/bug32993.phpt: - - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug33171.phpt: - Fixed bug #33171 (foreach enumerates private fields declared in base - classes) - - * tests/bug33171.phpt - tests/bug33171.phpt: - - file bug33171.phpt was initially added on branch PHP_5_0. - -2005-06-06 Wez Furlong - - * zend_language_scanner.l: - Avoid double-freeing streams. - This can happen because all streams are registered as resources; - the engine also tracks them in the open_files global. - - Avoid the potential for double-freeing by simply making streams exposed to - the - engine have no closer for the engine to call; they will already be in the - resource list, and thus will be shut down properly at request end. - -2005-06-04 Zeev Suraski - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_stream.c - zend_stream.h - tests/halt01.phpt - tests/halt02.phpt - tests/halt03.phpt: - Thought I committed it ages ago... Anyway, without further delays, the - final - __halt_compiler() patch - -2005-06-03 Dmitry Stogov - - * tests/bug30394.phpt: - Added test for 5.0 specific bug #30394 (Assignment operators yield wrong - result with __get/__set) - - * (PHP_5_0) - zend.c - zend_execute_API.c - tests/bug30394.phpt - tests/bug30394.phpt: - Fixed bug #30394 (Assignment operators yield wrong result with __get/__set) - - * zend_compile.c - zend_compile.c - tests/bug30080.phpt: - Fixed bug #30080 (Passing array or non array of objects) - - * tests/bug30080.phpt - tests/bug30080.phpt: - - file bug30080.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_execute.c - tests/bug27598.phpt: - Fixed bug #27598 (list() array key assignment causes HUGE memory leak) - - * tests/bug27598.phpt - tests/bug27598.phpt: - - file bug27598.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/object_handlers.phpt: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), - ...) - - * tests/object_handlers.phpt - tests/object_handlers.phpt: - - file object_handlers.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), ...) - -2005-06-01 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30791.phpt: - Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call - if object is overloaded) - - * tests/bug30791.phpt - tests/bug30791.phpt: - - file bug30791.phpt was initially added on branch PHP_5_0. - -2005-05-31 Magnus Määttä - - * tests/bug27304.phpt: - Fix test - -2005-05-31 Dmitry Stogov - - * zend_operators.c: - Reverted wrong fix for bug #30572. - Seems the bug was already fixed in other way. - But reverted patch produced a lot of valgrind errors, because IS_TMP_VAR - operands don't initialize refcount. - -2005-05-31 Marcus Boerger - - * zend_compile.c: - - Only allow changing return ref agnostic when a script method overrides an - internal method (found by dmitry) - -2005-05-29 Jani Taskinen - - * Zend.m4: - - Unify the "configure --help" texts - -2005-05-29 Hartmut Holzgraefe - - * acinclude.m4: - forgot to re-add 1.875 as a valid bison version after testing - - * acinclude.m4: - bison may be installed under a different executable name, e.g. - - YACC="bison-1.75" configure ... - - removing the check for "bison -y" allows for this - the check was redundant anyway as the following one filters - for "GNU Bison" in the --version output - - * Zend.m4 - acinclude.m4: - avoid code duplication in bison version test - -2005-05-28 Marcus Boerger - - * zend_compile.c - zend_compile.h: - - Make zend_do_inheritance ZEND_API - -2005-05-27 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug22836.phpt - tests/bug22836.phpt: - Fixed bug #22836 (returning reference to uninitialized variable) - -2005-05-26 Dmitry Stogov - - * (PHP_5_0) - zend_execute_API.c - tests/bug33116.phpt: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload) - - * tests/bug33116.phpt - tests/bug33116.phpt: - - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_execute_API.c: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_reflection_api.c - tests/array_type_hint_001.phpt: - Added array type hinting. (This patch requires full re-make) - -2005-05-26 Marcus Boerger - - * (PHP_5_0) - tests/bug27304.phpt - tests/bug32981.phpt: - - Add new tests - - * tests/bug27304.phpt - tests/bug27304.phpt - tests/bug32981.phpt - tests/bug32981.phpt: - - - Add new tests - -2005-05-22 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29338 (unencoded spaces get ignored after certain tags). - - * zend_highlight.c: - Fixed bug #29338 (unencoded spaces get ignored after certain tags). - -2005-05-22 Stanislav Malyshev - - * zend.c - zend.c: - fix leak - -2005-05-19 Dmitry Stogov - - * (PHP_5_0) - zend_object_handlers.c: - Backported fix for bug #30451 - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt: - Strict warnings - -2005-05-18 Stanislav Malyshev - - * zend.c - zend.c: - fix for #29890 - part 2 - - * (PHP_5_0) - tests/bug29890.phpt: - test - - * tests/bug29890.phpt - tests/bug29890.phpt: - - test - - * zend_execute_API.c - zend_execute_API.c: - fix #29890 - crash when function call fails - - * zend_object_handlers.c: - revert - seems to be fixed elsewhere - - * zend_object_handlers.c: - fix #30451 static properties don't work properly - - * tests/bug29689.phpt - tests/bug30451.phpt: - tests - - * tests/bug29689.phpt - tests/bug29689.phpt - tests/bug30451.phpt - tests/bug30451.phpt: - - file bug29689.phpt was initially added on branch PHP_5_0. - -2005-05-17 Magnus Määttä - - * tests/bug31828.phpt - tests/bug32080.phpt: - Fix tests. - -2005-05-13 Antony Dovgal - - * (PHP_5_0) - zend.c: - MFH: fix bug #29975 (memory leaks when set_error_handler() is used inside - error handler) - - * zend.c: - fix bug #29975 (memory leaks when set_error_handler() is used inside error - handler) - -2005-05-12 Marcus Boerger - - * zend_reflection_api.c: - - Make ReflectionObject::hasProperty() recognize dynamically added props - -2005-05-06 Jani Taskinen - - * zend_object_handlers.h: - typofix :) - -2005-05-05 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31525.phpt: - Fixed bug #31525 (object reference being dropped. $this getting lost) - - * tests/bug31525.phpt - tests/bug31525.phpt: - - file bug31525.phpt was initially added on branch PHP_5_0. - -2005-05-04 Stanislav Malyshev - - * zend.c: - fix bug #32924: prepend does not add file to included files - - * (PHP_5_0) - zend_execute.c: - clarify some magic - -2005-05-04 Dmitry Stogov - - * zend_execute.c: - Fixed bug #30641 (Compile error: error: symbol "zend_error" is used but not - defined) - - * tests/bug30707.phpt - tests/bug30707.phpt: - - file bug30707.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30707.phpt: - Fixed bug #30707 (Segmentation fault on exception in method) - - * (PHP_5_0) - zend_execute.c: - ws - - * tests/bug30162.phpt - tests/bug30162.phpt: - - file bug30162.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30161.phpt: - Fixed bug #30162 (Catching exception in constructor couses lose of $this) - -2005-05-03 Dmitry Stogov - - * tests/unset_cv07.phpt: - Fixed notice message - -2005-05-03 Marcus Boerger - - * (PHP_5_0) - tests/bug32252.phpt: - - Add test - -2005-05-03 Dmitry Stogov - - * zend_object_handlers.c: - Fixed destruction of zval after returning from __call() - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug32296.phpt: - Fixed bug #32296 (get_class_methods output has changed between 5.0.2 and - 5.0.3) - Now get_class_methods() shows accessible private and protected methods if - it is called from class scope. - - * tests/bug32296.phpt - tests/bug32296.phpt: - - file bug32296.phpt was initially added on branch PHP_5_0. - -2005-05-02 Marcus Boerger - - * zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h: - - Extend API to support real existance test without the need to add any new - functions or change any behavior - - * zend_execute_API.c: - - Part 2 of #30126: Enhancement for error message for abstract classes - - * zend_execute_API.c: - - Part 1 of #30126: Enhancement for error message for abstract classes - -2005-04-29 Jani Taskinen - - * zend_object_handlers.c: - compile fix - - * tests/bug30332.phpt - tests/bug32852.phpt: - Make sure E_STRICT is set always - -2005-04-29 Dmitry Stogov - - * zend_API.c - zend_API.c - tests/bug30332.phpt: - Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with - array_push()) - - * tests/bug30332.phpt - tests/bug30332.phpt: - - file bug30332.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_execute.c - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32852.phpt: - Fixed bug #32852 (Crash with singleton and __destruct when - zend.ze1_compatibility_mode = On) - Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On) - Fixed bug #32080 (segfault when assigning object to itself with - zend.ze1_compatibility_mode=On) - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt - tests/bug32852.phpt - tests/bug32852.phpt: - - file bug31828.phpt was initially added on branch PHP_5_0. - -2005-04-29 Jani Taskinen - - * tests/bug22836.phpt - tests/bug27641.phpt: - - Unify error_reporting setting + make sure E_STRICT is set when wanted - -2005-04-28 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug29015.phpt: - Fixed bug #29015 (Incorrect behavior of member vars(non string - ones)-numeric mem vars und others) - - * tests/bug29015.phpt - tests/bug29015.phpt: - - file bug29015.phpt was initially added on branch PHP_5_0. - -2005-04-27 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes) - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes). - - * zend_compile.c - zend_compile.c - tests/bug29104.phpt - tests/bug29104.phpt - tests/bug29104.phpt: - Fixed bug #29104 (Function declaration in method doesn't work) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32833.phpt: - Fixed bug #32833 (Invalid opcode) - - * tests/bug32674.phpt - tests/bug32674.phpt: - - file bug32674.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32674.phpt: - Fixed bug #32674 (exception in iterator causes crash) - -2005-04-26 Dmitry Stogov - - * tests/bug30889.phpt - tests/bug30889.phpt: - - file bug30889.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30889.phpt: - Fixed bug #30889 (Conflict between __get/__set and ++ operator) - - * tests/bug32429.phpt: - fix - - * zend_API.c - zend_API.c - tests/bug30702.phpt: - Fixed bug #30702 (cannot initialize class variable from class constant) - - * tests/bug30702.phpt - tests/bug30702.phpt: - - file bug30702.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - tests/bug32427.phpt: - Fixed bug #32427 (Interfaces are not allowed 'static' access modifier). - - * zend_builtin_functions.c - tests/bug32429.phpt: - Fixed bug #32429 (method_exists() always return TRUE if __call method - exists) - -2005-04-25 Andrei Zmievski - - * zend_object_handlers.c: - Reverting. Let's not introduce major BC breakage like this without a - good reason. - -2005-04-25 Dmitry Stogov - - * tests/bug29944.phpt - tests/bug29944.phpt: - - Fixed bug #29944 (Function defined in switch, crashes). - - * zend_compile.c - zend_compile.c - tests/bug29944.phpt: - Fixed bug #29944 (Function defined in switch, crashes). - -2005-04-25 Jani Taskinen - - * zend_hash.c: - ws - -2005-04-25 Dmitry Stogov - - * zend_hash.c: - Fixed call to estrndup() with invalid length - - * (PHP_5_0) - zend_hash.c: - Fixed call to estrndup() with invalid lengt - -2005-04-25 Sebastian Bergmann - - * zend_reflection_api.c: - Correct grammar. - -2005-04-24 Marcus Boerger - - * zend_compile.c: - - Need to copy doc comments correct for properties - -2005-04-23 Marcus Boerger - - * tests/bug29674.phpt - tests/bug30161.phpt - tests/bug30346.phpt: - - Add new tests - -2005-04-21 Jani Taskinen - - * tests/unset_cv05.phpt: - Fix test when register_long_arrays is off in your php.ini - -2005-04-19 Marcus Boerger - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_reflection_api.c: - - Add ReflectionProperty::getDocComment() - -2005-04-19 Jani Taskinen - - * zend_compile.c - zend_exceptions.c: - No c++ comments in C code - -2005-04-18 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c - zend_execute.c: - Fixed memory leak in debug_backtrace() - -2005-04-17 Marcus Boerger - - * zend_builtin_functions.c: - - Fix special cases of property_exists() - - * zend_object_handlers.c: - - Fix logic - -2005-04-16 Sara Golemon - - * tests/method_exists.phpt: - method_exists() regression test - - * zend_builtin_functions.c: - Fix method_exists(), pce is fetched, but ce is used - -2005-04-15 Marcus Boerger - - * zend_builtin_functions.c: - - Fix even though we already know that the function will be renamed - -2005-04-15 Andrei Zmievski - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fix certain operations to stop relying on presence of read_property and - write_property handlers. They may be NULL'ed out by certain objects - pretending to be pure arrays, for example. Do checks first. - -2005-04-12 Stanislav Malyshev - - * zend_ini.c: - fix memory corruption if one on the on_modify handlers errors out - - * (PHP_5_0) - zend_ini.c: - fi memory corruption if one on the on_modify handlers errors out - -2005-04-08 Marcus Boerger - - * zend_operators.c: - - Fix memory corruption found by rob - - * tests/bug22836.phpt: - - Ensure we see all errors. No need for () in return - - * zend_builtin_functions.c: - - Add property_exits() - - * zend_object_handlers.c: - - No E_ERROR when we just check (where did my 0->1 change go on first - commit?) - - * zend_object_handlers.c: - - No E_ERROR when we just check, here visibility simply means there is none - - * zend_object_handlers.c - zend_object_handlers.h: - - Simplify getting property info and make it an api function - -2005-04-07 Jani Taskinen - - * zend_alloc.c - zend_alloc.h: - - Nuke the code duplication - - * zend_alloc.h: - Fix build when USE_ZEND_ALLOC is 0 - -2005-04-07 Zeev Suraski - - * (PHP_5_0) - zend_alloc.c - zend_alloc.h: - MFH (Fix strdup() bug when USE_ZEND_ALLOC was disabled) - - * zend_alloc.c - zend_alloc.h: - Fix strdup() bug when USE_ZEND_ALLOC is disabled - -2005-04-05 Marcus Boerger - - * zend_interfaces.c: - - Just return FAILURE & allow NULL without emmidiate error - -2005-04-04 Stanislav Malyshev - - * zend_builtin_functions.c: - MF50: fix backtraces - non-Zend classes have names too - - * (PHP_5_0) - zend_builtin_functions.c: - fix backtraces - non-Zend classes have names too - -2005-04-03 Jani Taskinen - - * (PHP_5_0) - zend_execute_API.c: - MFH: - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)). - MFH: (kameshj at fastmail dot fm) - -2005-03-31 Derick Rethans - - * (PHP_5_0) - zend_API.c: - - MFH: internal_function->fn_flags is not initialized at this point - -2005-03-26 Jani Taskinen - - * zend_execute_API.c: - - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)) - (kameshj at fastmail dot fm) - -2005-03-24 Marcus Boerger - - * zend_vm_execute.h: - - Second part of removing temp solution - - * zend_vm_def.h: - - Remove potential bad solution for now - -2005-03-23 Andrei Zmievski - - * zend_execute.c: - Consolidate: call _get_zval_ptr_var() for IS_VAR case in - _get_zval_ptr(). - -2005-03-21 Andi Gutmans - - * (PHP_5_0) - zend_execute.c: - - Fix memset() bug (Joe Orton) - -2005-03-21 Andrei Zmievski - - * zend_API.c: - internal_function->fn_flags is not initialized at this point - -2005-03-20 Marcus Boerger - - * tests/bug31102.phpt: - - Added missing description (thanks jani) - - * tests/bug31102.phpt: - - Add new test - -2005-03-19 Marcus Boerger - - * zend_object_handlers.c: - - More fixes to gracefully act on exception thrown in overload methods - - * zend_object_handlers.c: - - Fix #31185 - - * zend_execute_API.c: - - Fix all incarnations of bug #30266 - -2005-03-19 Andi Gutmans - - * zend_interfaces.c - zend_interfaces.h: - - Fix typos - -2005-03-16 Wez Furlong - - * (PHP_5_0) - zend_API.c: - MFH: don't call rshutdown twice for dl()'d modules. - - * zend_API.c: - don't call rshutdown twice for dl()'d modules. - Spotted by Andrei. - -2005-03-15 Wez Furlong - - * zend.c - zend_API.c - zend_modules.h: - fix shutdown so that dl()'d modules are unloaded after all the dtors have - been called. - -2005-03-14 Zeev Suraski - - * zend_ini.c: - Clarify logic - -2005-03-14 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - ws - -2005-03-13 Stanislav Malyshev - - * zend_stream.c - zend_stream.c: - Do not convert ZEND_HANDLE_FP to ZEND_HANDLE_STREAM but allow using - reader/closer - on it - -2005-03-13 Marcus Boerger - - * zend_interfaces.c: - - More exact signatures (even though complete correct not possible atm) - -2005-03-13 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix get_extension_funcs() - extension names are now lowercased, so should - be function arguments. - -2005-03-13 Marcus Boerger - - * zend_execute_API.c: - - Actually this is a much better error decription - - * zend_execute_API.c - tests/bug32290.phpt - tests/bug32290.phpt: - - Bugfix #32290 - -2005-03-12 Marcus Boerger - - * zend_vm_def.h - zend_vm_execute.h: - - If an exception is pending we don't bail out but show the unhandled - exception - -2005-03-11 Anantha Kesari H Y - - * (PHP_5_0) - acconfig.h: - NetWare LibC's sys/types.h does not include sys/select.h implicitly as it - is the case with Linux LibC - -2005-03-11 Marcus Boerger - - * tests/bug32252.phpt: - - Add new test - - * tests/bug27145.phpt - tests/bug27145.phpt: - - Irrelevant - - * zend_object_handlers.c: - - Don't touch refcount/is_ref - -2005-03-10 Marcus Boerger - - * tests/bug28442.phpt - tests/bug28442.phpt: - - - Bugfix #28442 - - * zend_compile.c: - - Bugfix #28442 - -2005-03-10 Anantha Kesari H Y - - * (PHP_5_0) - acconfig.h: - Autoconf based build can be used for NetWare - - * (PHP_5_0) - zend.h: - NetWare can make use of ./configure generated zend_config.h - - * (PHP_5_0) - Zend.m4: - This patch is needed for cross compilation to go through - -2005-03-10 Marcus Boerger - - * zend_vm_execute.h: - - #31562 2nd part - - * zend_vm_def.h: - - Fix #31562 - -2005-03-07 Marcus Boerger - - * zend.h - zend_compile.c - zend_interfaces.c - zend_interfaces.h: - - New Interface Serializeable - - Change signature of unserialize() callback to ease inheritance and - support code reuse of handlers - - * tests/bug32226.phpt - tests/bug32226.phpt: - - - Add updated description - - * zend_builtin_functions.c - tests/bug32226.phpt: - - Fix #32226 - -2005-03-07 Zeev Suraski - - * zend_language_scanner.l - zend_language_scanner.l: - Revert // patch - -2005-03-06 Marcus Boerger - - * zend_reflection_api.c: - - Fix by Tim - -2005-03-06 Jani Taskinen - - * zend_compile.c - zend_compile.c: - Fixed compile warning (bug #32046) - - * zend_mm.c: - Fix compile warning (bug #32047) - -2005-03-01 Marcus Boerger - - * zend_interfaces.c: - - Support statuc methods/functions - -2005-03-01 Jani Taskinen - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31672 ( not considered closing tag if - MFH: preceded by one-line comment) - - * zend_language_scanner.l: - Fix the fix for one line comments with tags - -2005-02-28 Marcus Boerger - - * zend_builtin_functions.c: - - Add support for methods dynamically added through object handlers - -2005-02-27 Marcus Boerger - - * zend_object_handlers.c: - - If silence if wanted we do not error out - - * zend_reflection_api.c: - - Add two new methods - - Fix signature, no need to cast it - - * zend_API.h: - - These must be initailized - - * zend_builtin_functions.c: - - Update method_exists to new handlers and allow first parameter as string - -2005-02-27 Jani Taskinen - - * Zend.m4: - - Cache the version check results - -2005-02-24 Andi Gutmans - - * zend_language_scanner.l: - - Make one line comments work the same with as with - - other tags. This will break scripts that have whitespace at the end - - of the closing tag but this is barely used as it is - - and I doubt ppl used whitespace. (patch by Jani) - - * zend_objects_API.h: - - This part of the patch was right - -2005-02-24 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug in ZEND_POST_INC/ZEND_POST_DEC handlers. - These opcodes assume IS_TMP_VAR as result. - -2005-02-24 Andi Gutmans - - * zend_modules.h: - - Need zend_Compile.h for struct _zend_arg_info definiton (thanks to Joe - Orton) - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Revert following patch until we decide what is the right way to handle - - this: - - Fix signatures they are all meant to be able to deal with any type in - any - object storage (though we are still missing several parts) - -2005-02-23 Derick Rethans - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: fixed bug #32076 (ReflectionMethod :: isDestructor() always return - true). - - * zend_reflection_api.c: - - Fixed bug #32076 (ReflectionMethod :: isDestructor() always return true) - (Patch by Antony Dogval) - -2005-02-23 Stanislav Malyshev - - * zend.h - zend_compile.c: - Custom object serializer infrastructure - -2005-02-23 Jani Taskinen - - * Zend.m4: - Hack the planet - -2005-02-23 Marcus Boerger - - * zend_interfaces.c: - - Allow to convert Traversable into Aggregate - -2005-02-22 Marcus Boerger - - * zend_objects_API.c: - - We cannot provide this fallback becuase it requires zend_object ptr's. - -2005-02-22 Jani Taskinen - - * Zend.m4: - Fix cross-compile - - * acconfig.h: - Fix build (it was #ifNdef NETWARE..) - -2005-02-22 Marcus Boerger - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Fix signatures they are all meant to be able to deal with any type in any - object storage (though we are still missing several parts) - - * zend_objects_API.c: - - Force calling of dtors unless otherwise specified (fixes several - __destruct bugs) - -2005-02-22 Anantha Kesari H Y - - * zend.h: - NetWare can include autoconf generated config headers - - * acconfig.h: - NetWare can make use of the configure script generated header file. - -2005-02-21 Moriyoshi Koizumi - - * Makefile.am: - - Add missing entry. - -2005-02-20 Dmitry Stogov - - * zend_compile.c: - Fixed possible memory corruption - -2005-02-19 Rui Hirokawa - - * (PHP_5_0) - zend_language_scanner.l: - MFH: fixed #31987 zend-multibyte in ZTS. - - * zend_language_scanner.l: - fixed #31987 zend-multibyte in ZTS. - -2005-02-17 Marcus Boerger - - * zend_API.c: - - A little optimization to prevent problems when trying to reimplement an - interface inherited from an interfaces that was just implemented...... - - * zend_API.c: - - No C++ ruleZ here - - * zend_API.c: - - Actually we must do this in two steps: 1st resize the table and set all - interfaces, 2nd implement the interfaces - - * zend_API.c: - - Incrementation is done elsewhere - - * zend_API.c: - - Fix windows build (funny MS compiler) - -2005-02-17 Jani Taskinen - - * (PHP_5_0) - Zend.m4 - zend_strtod.c: - MFH: - Compile fix for systems without int32_t typedef - - * Zend.m4 - zend_strtod.c: - - Compile fix for systems without int32_t typedef - -2005-02-13 Marcus Boerger - - * zend_execute_API.c - zend_reflection_api.c: - - Be more gracious in reflection API - - * zend_language_scanner.l: - - Fix doc comment handling - -2005-02-12 Marcus Boerger - - * zend_execute_API.c: - - Bugfix #30682 (autoconversion from false/true to 0/1 missing in case of - static property default value) - -2005-02-11 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Cleanup foreach handling - -2005-02-10 Jani Taskinen - - * zend_strtod.c - zend_strtod.c: - - Fixed bug #31920 (zend_strtod.c error: conflicting types for 'int8_t') - -2005-02-10 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30407.phpt: - Fixed bug #30407 (Strange behaviour of default arguments) - -2005-02-07 Dmitry Stogov - - * zend_compile.c: - Fixed bug introduced with foreach() optimization patch - - * zend_compile.c: - Fixed FE_RESET/FE_FETCH bug. - Now FE_RESET instruction takes jump-address from itself, not from the - following FE_FETCH instruction. - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - foreash($a as $key => $val) optimization - Removed temorary array creation on each iteration. - -2005-02-07 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Remove part of the cleanup which causes a problem with unnormal code - like tests/lang/040.phpt - -2005-02-06 Zeev Suraski - - * (PHP_5_0) - zend_ini_scanner.l: - Correct fix for #28803 - - * zend_ini_scanner.l: - Correct fix for #28804 - -2005-02-05 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Cleanup foreach statement - -2005-02-04 Hartmut Holzgraefe - - * zend_API.c - zend_API.h: - added some missing zend_[declare|update]_property_...() convenience - functions for bool, double and binary safe string data - -2005-02-03 Jani Taskinen - - * (PHP_5_0) - zend_ini_scanner.l: - MFH: Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l: - - Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l - zend_ini_scanner.l: - ws fix - -2005-02-02 Stanislav Malyshev - - * zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - - * tests/bug31720.phpt: - test for Bug #31720 - - * tests/bug31720.phpt - tests/bug31720.phpt: - - file bug31720.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - -2005-02-02 Dmitry Stogov - - * zend.h - zend.h - zend_object_handlers.c - zend_object_handlers.c - tests/bug31683.phpt: - Fixed bugs #29767 and #31683 (__get and __set methods must not modify - property name). - - * tests/bug31683.phpt - tests/bug31683.phpt: - - file bug31683.phpt was initially added on branch PHP_5_0. - -2005-02-01 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix debug_trace with eval (patch from Antony Dovgal) - - * tests/bug_debug_backtrace.phpt: - test for eval debug_backtrace bug - - * tests/bug_debug_backtrace.phpt - tests/bug_debug_backtrace.phpt: - - file bug_debug_backtrace.phpt was initially added on branch PHP_5_0. - -2005-01-31 Marcus Boerger - - * zend_reflection_api.c: - - Add ReclectionClass:hasProperty(), ReflectionClass::hasConstant() - to complete api (johannes@php.net) - -2005-01-28 Marcus Boerger - - * zend_execute_API.c: - - Fix severity (found by johannes) - -2005-01-25 Jani Taskinen - - * zend.h: - New versions of glibc support a RTLD_DEEPBIND flag to dlopen. The - effect of this flag when loading a "foo.so" with undefined symbols is - that the search that symbol starts at foo.so and its dependencies - *before* the loading process' global symbol table. - - This is an effective workaround for symbol namespace collisions between - various modules and the libraries on which they depend (where fixing the - respective modules or libraries is not possible e.g. due to API - constraints). - - (By: Joe Orton) - -2005-01-25 Marcus Boerger - - * (PHP_5_0) - zend_execute.c - zend_interfaces.c - tests/bug26229.phpt: - - MFH #26229 (getIterator() segfaults when it returns arrays or scalars) - - * zend_interfaces.c - zend_vm_def.h - zend_vm_execute.h - tests/bug26229.phpt: - - Bugfix #26229 (getIterator() segfaults when it returns arrays or scalars) - - * Makefile.frag: - - Fix dependency - - * zend_vm_def.h - zend_vm_execute.h: - - Use correct freeing (thx Dmitry) - -2005-01-24 Marcus Boerger - - * zend_vm_def.h - zend_vm_execute.h - tests/bug30725.phpt: - - Second and last part of #30725 fix - - * zend_interfaces.c: - - Allow getIterator() to fail - - * tests/bug30725.phpt: - - - Add new test - -2005-01-22 Jani Taskinen - - * (PHP_5_0) - Zend.m4 - configure.in - zend_strtod.c: - MFH: Compile fix for systems without uint32_t typedef - - * Zend.m4 - configure.in - zend_strtod.c: - - Compile fix for systems without uint32_t typedef - -2005-01-22 Marcus Boerger - - * zend_API.c - zend_API.h - zend_reflection_api.c: - - Fix #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.) - -2005-01-22 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - - Two new API calls for Derick (retreive CV name and value) by Dmitry - -2005-01-20 Jani Taskinen - - * zend.h - zend_constants.c: - - Revert the weird change of ZEND_STRS() macro and use the correct - ZEND_STRL() macro. - -2005-01-19 Jani Taskinen - - * zend_object_handlers.c: - - Fixed bug #29183 (Undefined symbol zend_check_private with Solaris CC) - -2005-01-19 Marcus Boerger - - * zend_ini_parser.y: - - Fix memleak - -2005-01-18 Dmitry Stogov - - * zend_compile.c: - Fixed patch for bug #31478 (SegFault/Memory Leak with empty()) - - * zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). - - * (PHP_5_0) - zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). (Dmitry) - -2005-01-18 Ilia Alshanetsky - - * (PHP_5_0) - zend_operators.h: - MFH: Fixed bug #30726 (-.1 like numbers are not being handled correctly). - - * zend_operators.h: - Fixed bug #30726 (-.1 like numbers are not being handled correctly). - -2005-01-17 Jani Taskinen - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - - * zend_language_scanner.l: - - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - -2005-01-15 Andi Gutmans - - * (PHP_5_0) - zend_API.c: - - Fix WS - - * (PHP_5_0) - zend_API.c: - - Change to using DL_UNLOAD macro. - - * zend_API.c: - - Unload on MAC OS X (shouldn't be a reason not to) - -2005-01-14 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt: - Restore behavior of $str["str"]. (Now $str["str"] is equivalent to $str[0] - again) - - * (PHP_5_0) - tests/bug31098.phpt: - Path -> pattern - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - Revert to old behavior of $str["str"]. ($str["str"] is equivalent of - $str[0]) - -2005-01-13 Dmitry Stogov - - * zend_execute.c - zend_execute.c: - Additional fix for fix of bug #29883 - -2005-01-12 Dmitry Stogov - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt - tests/bug31098.phpt: - Fixed bug #31098 (isset false positive) - -2005-01-11 Moriyoshi Koizumi - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - - MFH: fix for bug #31098. - - * tests/bug31098.phpt - tests/bug31436.phpt: - - - Test renaming - - * zend_vm_execute.h - tests/bug31436.phpt: - - Fix bug #31436 (isset() incorrectly returns true in dereference of a - wrong type) - - * zend_compile.c: - - Fix bug #31478 (segfault with empty()) - -2005-01-10 Rasmus Lerdorf - - * zend.h - zend_API.c: - Fix OSX DL_UNLOAD macro and actually use it to make shared extensions - work on OSX. - -2005-01-10 Jani Taskinen - - * header - zend_arg_defs.c - zend_strtod.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - - Added missing header sections. - - * acinclude.m4 - configure.in: - - Added AC_ZEND_C_BIGENDIAN macro (as requested by Andi) - -2005-01-09 Jani Taskinen - - * (PHP_5_0) - zend.h: - MFH: - Fix outside-source-tree builds. Always include generated header - files - with #include to make sure the correct file is - used. - - * zend.h: - - Fix outside-source-tree builds. Always include generated header files - with #include to make sure the correct file is used. - - * zend.c: - MFB: - Rationalize code a bit - -2005-01-03 Stanislav Malyshev - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - - * zend_language_scanner.l: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - -2005-01-02 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #31371 (highlight_file() trims new line after heredoc). - - * zend_highlight.c: - Fixed bug #31371 (highlight_file() trims new line after heredoc). - -2004-12-30 Jani Taskinen - - * (PHP_5_0) - zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - MFH: - Fixed bug #28930 (PHP sources pick wrong header files generated by - bison). - - * zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - - Fixed bug #28930 (PHP sources pick wrong header files generated by bison) - - * Zend.m4 - acinclude.m4: - MFB_4_3: Quote macro names in AC_DEFUN() - -2004-12-27 Zeev Suraski - - * zend_builtin_functions.c: - MFB - - * (PHP_5_0) - zend_builtin_functions.c: - Fix desc - -2004-12-27 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: Need to unmangle the class name here - - * zend_reflection_api.c: - - Need to unmangle the class name here - -2004-12-27 Zeev Suraski - - * (PHP_5_0) - zend_exceptions.c: - Add descriptions - -2004-12-27 Dmitry Stogov - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug22836.phpt - tests/bug22836.phpt - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to use one space - -2004-12-27 Marcus Boerger - - * zend_reflection_api.c: - - More proto/error message fixes - - * zend_reflection_api.c: - - Small fixlet (by Tony) - -2004-12-24 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h: - New sarbage collector's bug was fixed (the behavior should be the same as - in PHP_5_0) - - * zend_execute.c - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to be compatible with PHP_5_0 - -2004-12-21 Jani Taskinen - - * (PHP_5_0) - zend_strtod.c: - MFH: - Use correct header files (in c99 compliant way). uint32_t is - preferred. - - * zend_strtod.c: - - Use correct header files (in c99 compliant way). uint32_t is preferred. - -2004-12-20 Jani Taskinen - - * zend_strtod.c: - Better fix for endian compile problems. - -2004-12-17 Andi Gutmans - - * zend_object_handlers.c: - - Fixed Bug #30562 Segmentation fault with __call() - -2004-12-17 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed strtod for Irix and some other strange platform - -2004-12-16 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MF43: Make it compile on HPUX on Itanium 2 - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed bug #31107 (strtod on solaris9/intel) - -2004-12-16 Jani Taskinen - - * (PHP_5_0) - ChangeLog: - - MFH: Fix typo (avaliable -> available). (bug #28725) - - * ChangeLog: - - Fix typo (avaliable -> available). (bug #28725) - -2004-12-16 Derick Rethans - - * zend_strtod.c: - - MF43: Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - - * (PHP_5_0) - zend_strtod.c: - - Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - -2004-12-15 Andi Gutmans - - * (PHP_5_0) - zend.h: - - 5.0.4-dev - - * (PHP_5_0) - zend.h: - - Redo 5.0.3 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - Roll PHP 5.0.3 - -2004-12-14 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MFH: Fixed compile error related to bug #28605. - -2004-12-13 Derick Rethans - - * zend_operators.c: - - Added "G" modifier to ini setting number format. - -2004-12-10 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.3RC2 - -2004-12-07 Dmitry Stogov - - * zend_exceptions.c - zend_exceptions.c: - Fixed bug #30904 (segfault when recording soapclient into session). - -2004-12-06 Stanislav Malyshev - - * tests/bug30998.phpt: - add test - - * zend.c - zend.c: - port fix for #30998: Crash when user error handler returns false on amd64 - -2004-12-06 Dmitry Stogov - - * zend_compile.c - zend_compile.c - tests/bug30922.phpt: - Fixed bug #30922 (reflective functions crash PHP when interfaces extend - themselves) - - * tests/bug30922.phpt - tests/bug30922.phpt: - - file bug30922.phpt was initially added on branch PHP_5_0. - -2004-12-06 Stanislav Malyshev - - * (PHP_5_0) - zend_builtin_functions.c: - if fetch called not from PHP function, ptr can be NULL - -2004-12-01 Ilia Alshanetsky - - * zend_strtod.c: - MFB: Removed extra space that causes problems for some compilers. - - * (PHP_5_0) - zend_strtod.c: - Removed extra space that causes problems for some compilers. - -2004-12-01 Derick Rethans - - * (PHP_5_0) - zend_strtod.c: - - revert unwanted change - - * zend_strtod.c - zend_strtod.c: - - Fixed MacOSX compilation (Patch by Christian) - - * (PHP_5_0) - zend.h: - - And in Zend/ too. - -2004-12-01 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug29883.phpt - tests/bug29883.phpt - tests/bug29883.phpt: - Fixed bug #29883 (isset gives invalid values on strings). - -2004-11-30 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Go with 5.0.3RC1 - -2004-11-29 Derick Rethans - - * (PHP_5_0) - zend_operators.c: - - MF43: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - - * zend_operators.c: - - MFH: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - -2004-11-25 Zeev Suraski - - * (PHP_5_0) - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_object_handlers.c - zend_object_handlers.h: - Reverting get_method() signature change - -2004-11-24 Marcus Boerger - - * zend_reflection_api.c: - - Fix Bug #30856 (ReflectionClass::getStaticProperties segfaults) - - * tests/bug30856.phpt: - - - Add new test - -2004-11-17 Stanislav Malyshev - - * (PHP_5_0) - zend_execute_API.c: - fix #30543 - - * zend_execute_API.c: - fix crash - -2004-11-16 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - Make this compile for the Mac again - -2004-11-15 Derick Rethans - - * (PHP_5_0) - zend_strtod.c: - - MFH: Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - - * zend_strtod.c: - - Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - -2004-11-14 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH #30783 Apache crash when using ReflectionFunction::getStaticVariables() - MFH proto fixes - - * zend_reflection_api.c: - - Bugix #30783: Apache crash when using - ReflectionFunction::getStaticVariables() - -2004-11-09 Andrei Zmievski - - * zend_ini_parser.y: - Revert inadvertent commit. - - * zend_ini_parser.y: - .dylib extension are Mach-O shared libraries that meant for linking - against. Loadable modules (aka bundles) can have any extension, so we - should probably stick with .so - - http://fink.sourceforge.net/doc/porting/shared.php?phpLang=en#lib-and-mod - -2004-11-05 Derick Rethans - - * (PHP_5_0) - zend_execute_API.c: - - Fix for bug #30367, #30490 and possibly #30011. - -2004-11-04 Edin Kadribasic - - * Zend.dsp - ZendTS.dsp: - Added zend_strtod.* to the build - - * zend_strtod.c - zend_strtod.h: - Make zend_strtod compile on windows - -2004-11-04 Moriyoshi Koizumi - - * (PHP_5_0) - Makefile.am: - - MFH: Add entry for zend_strtod.c in belief that this is still active. - - * Makefile.am: - - Add entry for zend_strtod.c in belief that this is still active. - -2004-11-03 Moriyoshi Koizumi - - * Zend.m4: - - Don't show grep outputs - -2004-11-03 Derick Rethans - - * (PHP_5_0) - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - MFH: Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - - * zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - -2004-11-03 Moriyoshi Koizumi - - * Zend.m4 - zend.h - zend_execute.c: - - Checks for Darwin'ish systems that uses Mach-O, which apparently doesn't - support weak symbol aliasing at this time. - -2004-11-03 Marcus Boerger - - * zend_reflection_api.c: - - Trying to invoke function not methot here - - * zend_reflection_api.c: - - Fix invokeargs() with static methods - -2004-11-03 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h: - Fixed "isset() and the new VM" bug. - -2004-11-02 Sebastian Bergmann - - * (PHP_5_0) - zend_API.c: - MFH: Patch by Joe Orton . - - * zend_API.c: - Patch by Joe Orton . - -2004-10-31 Marcus Boerger - - * zend_reflection_api.c: - - Add ReflectionFunction::invokeArgs(array) - - Add ReflectionMethod::invokeArgs(obj, array) - -2004-10-31 Sebastian Bergmann - - * zend_reflection_api.c: - Invokation -> Invocation - -2004-10-30 Marcus Boerger - - * zend.h: - Bump version (as discussed with Andi) - - * (PHP_5_0) - zend_execute.c: - - Fix (readd function name which got lost during earlier comit) - - * zend_reflection_api.c: - - Be consistent and use names as keys (found by johannes) - - * zend_extensions.h - zend_modules.h: - - Bump API version - - * (PHP_5_0) - zend_extensions.h - zend_modules.h: - Bump api after latest changes - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - MFH change zend_object_handlers->get_method() - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_vm_def.h - zend_vm_execute.h: - - Change zend_object_handlers->get_method() to allow aggregation for - internal classes - - * Makefile.frag: - - New architecture needs one more dependency - - * zend_exceptions.c - zend_reflection_api.c: - - Fix protos - -2004-10-29 Andi Gutmans - - * zend_operators.c: - - For Ilia: - - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - Hope this works well. I will MFH tomorrow if no one complains. - -2004-10-28 Dmitry Stogov - - * README.ZEND_VM - zend_vm_gen.php: - --without-lines changed to --with-lines - -2004-10-28 Andi Gutmans - - * zend_vm_execute.skl - zend_vm_gen.php: - - Fix typo - -2004-10-27 Andi Gutmans - - * zend_vm_opcodes.h: - - Oops missed this one - - * zend_operators.c: - - Revert Fixed bug #30228 (crash when comparing SimpleXML attribute to a - boolean). - - Need to discuss where the real problem is. - - * README.ZEND_VM: - - Tiny fixes - - * README.ZEND_VM - zend_compile.h - zend_vm_execute.h - zend_vm_gen.php: - - Improve comments, docs, code... - -2004-10-26 Andi Gutmans - - * zend_builtin_functions.c: - - Patch from Andrey Hristov: - I have cooked a small patch which allows is_subclass_of() the accept - not only an object as first parameter but a string as well. When string - is passed the function checks whether the class specified is subclass of - the second parameter - class a{} - class b{} extends a{} - is_subclass_of("a", "a") //false - is_subclass_of("b", "a") //true - currently only objects are allowed as first parameter - -2004-10-26 Ilia Alshanetsky - - * (PHP_5_0) - zend_operators.c: - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - * zend_operators.c: - Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean). - -2004-10-23 Andi Gutmans - - * zend_vm_execute.h: - - Add missing file - -2004-10-22 Andi Gutmans - - * zend_vm_handlers.h - zend_vm_spec.h: - - Nuke another two files - - * Makefile.frag - zend_execute.c - zend_vm.h - zend_vm_def.h - zend_vm_execute.skl - zend_vm_gen.php: - - Commit new VM - - Old one is tagged as PRE_NEW_VM_GEN_PATCH - - Still doing work so more commits to come. Don't complain (yet) :) - - * (PRE_NEW_VM_GEN_PATCH) - zend_execute.c: - - Fix crash (MFB PHP5_0) - -2004-10-21 Andi Gutmans - - * (PHP_5_0) - zend_execute.c: - - Fix bug #30395 (Apache Child Segmentation fault in specific PHP-Code) - -2004-10-20 Andi Gutmans - - * zend_operators.c: - - If object handles are equal then save the comparison of properties in - - the == operator. - -2004-10-18 Anantha Kesari H Y - - * zend_modules.h: - including zend_compile.h for NetWare as NetWare uses MetroWerks Code - warrior compiler which does not allow declarations of following kind - before defining the types. - extern struct _zend_arg_info first_arg_force_ref[2]; - -2004-10-16 Andi Gutmans - - * zend_compile.c: - - One more test (WS) - - * zend_compile.c: - - WS fix to test commit - -2004-10-16 Anantha Kesari H Y - - * zend_compile.c - zend_compile.c: - Fix for 30457 - -2004-10-14 Marcus Boerger - - * zend_builtin_functions.c: - - Allow to omit object/classname in get_parent_class() which makes it - compatible with the signature and behavior of get_class() - -2004-10-13 Andi Gutmans - - * zend_compile.c: - - Don't allow access modifiers in interfaces. Explicitly stating public - - should also be disallowed but we don't have a way to detect it today. - -2004-10-12 Marcus Boerger - - * zend_builtin_functions.c: - Bug #30381 Strange results with get_class_vars() - - * (PHP_5_0) - zend_builtin_functions.c: - MFH Fix visibility of get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix visibility in get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix set_exception_handler - -2004-10-10 Sebastian Bergmann - - * .cvsignore - tests/.cvsignore: - Add *.gcda and *.gcno (from gcc -fprofile-{use|generate}) to .cvsignore. - -2004-10-08 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Revert automatic pass arg_info - -2004-10-08 Andi Gutmans - - * zend_compile.c: - - Fix BC break with default in switch() having to be at the end. - -2004-10-08 Anantha Kesari H Y - - * acconfig.h - zend_config.nw.h: - explicitly including sys/select.h as NetWare LibC sys/types.h does not - include sys/select.h implicitly as other LibC - -2004-10-06 Marcus Boerger - - * zend_reflection_api.c: - - Fix Bug #30344 - -2004-10-05 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Add arginfo ZEND_ARG_SEND_AUTOMATIC which lets the compiler automatically - determine whether pass by ref is possible or pass by value is needed. - -2004-10-05 Dmitry Stogov - - * tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv07.phpt: - Test files are fixed. - - * zend_execute.c - zend_vm_handlers.h - tests/unset_cv11.phpt: - Fixed unset() bug that was introduced with CV optimization patch - - * zend_execute_API.c - zend_vm_handlers.h - tests/unset.inc - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv05.phpt - tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - Added test cases for CV optimization patch - -2004-10-04 Andi Gutmans - - * zend_API.h - zend_execute_API.c: - - Rename delete_global_variable() to zend_delete_global_variable() - - * Zend.m4 - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c - zend_vm.h - zend_vm_handlers.h - zend_vm_spec.h: - - Commit the variable fetch optimization. - - Extensions which delete global variables need to use new special - function - - delete_global_variable() (I'm about to rename it) to remove them. - - Will post to internals@ or via commit messages if there's anything else. - -2004-10-04 Marcus Boerger - - * zend_builtin_functions.c: - - Bugfix #27798 - - * tests/bug27798.phpt: - - - Add new test - -2004-10-02 Marcus Boerger - - * (PHP_5_0) - tests/bug28444.phpt - tests/bug29368.phpt: - - Add new tests - - * tests/bug28444.phpt - tests/bug29368.phpt: - - - Add new test - -2004-10-01 Marcus Boerger - - * Makefile.frag: - - Add makefile fragment which simplifies working on the executer - -2004-09-30 Andi Gutmans - - * zend_operators.c: - - Small improvement to DVAL_TO_ZVAL macro - -2004-09-29 Marcus Boerger - - * zend_API.c: - - MFB (synch correctly not only for one problem) - - * zend_API.c: - - Refix the fix - -2004-09-29 Andi Gutmans - - * bench.php - tests/bench.php: - - Move bench.php to Zend/ - -2004-09-28 Marcus Boerger - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_objects.c: - Simplify/Optmize magic method calls (__get/__set/__call/__clone/__destruct) - -2004-09-28 Andi Gutmans - - * zend_execute_API.c: - - Return the warning until we check if we can change the type of str.len - -2004-09-28 Marcus Boerger - - * zend_reflection_api.c - zend_reflection_api.h: - - publish reflection_class_factory() as zend_reflection_class_factory() - -2004-09-27 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH fix several property handling issues - - * zend_reflection_api.c: - - Make internally used properties read-only and fix default properties - - * zend_exceptions.c: - - Fix memeleak - - * zend_reflection_api.c: - - Declare properties - -2004-09-27 Andi Gutmans - - * README.ZEND_VM: - - Document zend_vm_use_old_executor() for Derick. - -2004-09-27 Marcus Boerger - - * zend_reflection_api.c: - Fix Reflection_Class to ReflectionClass in docu/messages - - * zend_execute_API.c: - - Fix warning - - * zend_compile.c - zend_stream.c: - - Fix warning - - * zend_builtin_functions.c - zend_reflection_api.c: - - Fix warnings - - * zend_interfaces.c: - Fix warnign - -2004-09-27 Andi Gutmans - - * zend_variables.c - zend_variables.h: - - Use zval_ctor_func() for wrapper and update the prototype to void - - * zend_variables.c - zend_variables.h: - - Make zval_copy_ctor() return void like dtor(). No one ever checks the - - return value which is SUCCESS always. - -2004-09-26 Marcus Boerger - - * zend.h - zend_variables.h: - - Fix build - -2004-09-26 Andi Gutmans - - * zend.h - zend_variables.c - zend_variables.h: - - Apply Thies and Sterling's patch which doesn't call ctor/dtor functions - - for types which don't require it (BOOL/NULL/LONG/DOUBLE) - - Breaks serialization!!! - -2004-09-24 Anantha Kesari H Y - - * zend_API.c: - selectively avoiding module cleanup code for apache 1 build and removing a - duplicate code - -2004-09-24 Dmitry Stogov - - * zend_vm_spec.h: - Fixed specializer bug. - -2004-09-23 Andi Gutmans - - * (PHP_5_0) - zend.h: - - PHP 5.0.3-dev - - * zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_opcode.c - zend_vm.h: - - Commit new VM architecture. This one allows people (aka Derick) to - - ask the engine to use function handler mode. Will update the README - - about that. - - * (PHP_5_0) - zend.h: - - Roll 5.0.2 - -2004-09-23 Ilia Alshanetsky - - * tests/bug20240.phpt: - Fixed test. - -2004-09-23 Marcus Boerger - - * zend_reflection_api.c: - Bugfix # 30209 - -2004-09-23 Andi Gutmans - - * tests/bench.php: - - Commit synthetic benchmark - -2004-09-23 Anantha Kesari H Y - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - Reverted the NetWare Specific Stack limit related patches as asked by Andi - -2004-09-22 Anantha Kesari H Y - - * zend_execute_API.c - zend_globals.h: - NetWare specific stack limit checks - - * zend_API.c: - Aligned the ifdef NETWARE blocks to first column. - - * zend_execute.c: - Stack limit will be checked while executing the script - - * zend_config.nw.h: - To avoid redefinition (of free, alloca etc.) compilation errors in Zend. - - * zend_API.c: - When Apache is unloaded, it calls dlclose on all the PHP extensions - that are loaded in memory. In the case of Apache 1.3, this call is - blocking indefinitely. As a work around, this call is bypassed for Apache - 1.3 build on NetWare only. This means that none of the loaded PHP - extensions are unloaded. They will have to be manually unloaded before - re-loading the Apache 1.3 again. - - * zend.h: - defined ZEND_PATHS_SEPERATOR to semicolon for NetWare - - * acconfig.h: - enabled macros to call the proper LibC functions - -2004-09-22 Dmitry Stogov - - * zend_vm_handlers.h - zend_vm_spec.h: - Specializer was updated with executor's fixes. - - * zend_execute.c - zend_execute.c: - Fixed bug #29566 (foreach/string handling strangeness (crash)). - - * zend_execute.c: - Fixed bug in fix for bug #29707 - -2004-09-21 Andi Gutmans - - * zend_execute.c - zend_execute.h: - - Fix for bug #29707 - -2004-09-19 Marcus Boerger - - * zend_reflection_api.c: - Bugfix #30146 (ReflectionProperty->getValue() requires instance for static - property) - - * zend_reflection_api.c: - Bugfix #30148 (ReflectionMethod->isConstructor() fails for inherited - classes) - -2004-09-17 Stanislav Malyshev - - * zend_execute_API.c - zend_objects_API.c - zend_objects_API.h: - fix crash when dtor is fialing on shutdown - -2004-09-16 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Go with PHP 5.0.2RC1 - - * tests/bug27669.phpt: - - Add test for bug #27669 - -2004-09-16 Sebastian Bergmann - - * zend_language_parser.y: - ZTS fix. - -2004-09-16 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix bug #27669 (Dmitry). - Fixes: - - -2004-09-15 Ilia Alshanetsky - - * zend_operators.h: - MFH: Fixed a bug causing ".123" * "90" and alike to return a 0. - - * (PHP_5_0) - zend_operators.h: - Fixed a bug causing ".123" * "90" and alike to return a 0. - -2004-09-15 Derick Rethans - - * zend_config.w32.h: - - Windows support strcoll too. - -2004-09-13 Stanislav Malyshev - - * zend_execute.c: - Antony Dovgal's error message improvement - #27290 - -2004-09-11 Derick Rethans - - * zend_operators.c - zend_operators.h: - - MFB: Added the sorting flag SORT_LOCALE_STRING to the sort() functions - which - makes them sort based on the current locale. (Derick) - - * (PHP_5_0) - zend_operators.c - zend_operators.h: - - Added the sorting flag SORT_LOCALE_STRING to the sort() functions which - makes - them sort based on the current locale. (Derick) - -2004-09-11 Andi Gutmans - - * zend_operators.c: - - Resolve undefined behavior (joe at redhat) - -2004-09-10 Andi Gutmans - - * zend_compile.c: - - This one fixes rather strange problem - ZE allows multiple declarations - of the same class constant. - - It could be a minor BC break, but I'm sure it's a bug. (Antony Dovgal - aka tony2001) - -2004-09-09 Andi Gutmans - - * zend_extensions.h: - - Revert API bump - - * README.ZEND_VM: - - Commit VM explanation. - - * zend.c: - - Recommit - - * zend_API.c - zend_API.h - zend_compile.c: - - Recommit: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - - * zend_extensions.h: - - Recommit: - - Bump the API number to work around this major breakage. - - * ChangeLog - zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_exceptions.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_opcode.c: - - Roll back VM commit - -2004-09-09 Marcus Boerger - - * zend.c: - - Drop namespace relict - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_compile.c: - MFH signature check/method registration - - * zend_API.c - zend_API.h - zend_compile.c: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - -2004-09-09 Derick Rethans - - * zend_extensions.h: - - Bump the API number to work around this major breakage. - -2004-09-09 Dmitry Stogov - - * zend_vm.h: - We will use CALL dispatch method for compilers other then GCC. It is more - safe. - -2004-09-09 Andi Gutmans - - * zend_API.c: - - Fix the fix. - -2004-09-06 Marcus Boerger - - * zend_objects.c: - - Fix handling of exceptions in dtors - -2004-09-05 Zeev Suraski - - * zend.c - zend.h - zend_ini_parser.y: - Fix reverse dependency - -2004-09-04 Andi Gutmans - - * zend_API.c: - - Don't destroy object when calling overloaded cast method in - - zend_parse_parameters() - -2004-09-02 Sebastian Bergmann - - * zend_compile.c: - Fugbix typo. - -2004-08-30 Marcus Boerger - - * (PHP_5_0) - ZEND_CHANGES: - MFH: Add some information about array overloading - - * ZEND_CHANGES: - Add some information about array overloading - -2004-08-30 Stanislav Malyshev - - * zend_execute.c: - fix crash #29893 - -2004-08-29 Marcus Boerger - - * zend_execute.c: - String offset starts with 0, fix isset($str[$len]) - - * (PHP_5_0) - zend_compile.c: - MFH: Bugfix #29882 isset crashes on arrays - - * zend_compile.c: - Bugfix #29882 isset crashes on arrays - -2004-08-27 Andi Gutmans - - * zend_alloc.c: - - Fix leak report for 0 byte allocations (Dmitry) - -2004-08-26 Marcus Boerger - - * (PHP_5_0) - zend_compile.c: - MFH: Enforce semantics: Classes cannot extend Interfaces - - * zend_compile.c: - Enforce semantics: Classes cannot extend Interfaces - - * tests/bug29828.phpt: - Fix test: Classes cannot extend Interfaces - - * zend_compile.c: - Drop doubled check - - * zend_compile.c: - - Bugfix #29828 Interfaces no longer work - - * tests/bug29828.phpt: - - Add new test - -2004-08-25 Andi Gutmans - - * zend_builtin_functions.c: - - Add interface_exists() and differentiate between classes and interfaces - (Andrey Hristov) - -2004-08-24 Marcus Boerger - - * zend_API.c: - - Add missing brackets - -2004-08-23 Marcus Boerger - - * zend_compile.c: - - Drop unused variable - - * zend_execute_API.c - zend_globals.h: - - Boost up __autoload() calls by caching the lookup - -2004-08-23 Andi Gutmans - - * zend_compile.c: - - Improve performance of switch() - -2004-08-23 Zeev Suraski - - * (PHP_5_0) - zend_reflection_api.c: - Fix names - -2004-08-21 Sara Golemon - - * zend_compile.c: - Bugfix#29777 Some compilers don't like // style comments - -2004-08-20 Sara Golemon - - * zend_ini_parser.y: - Fix compile - -2004-08-19 Andi Gutmans - - * zend_execute.c: - - Cleanup - - * zend.c - zend_execute_API.c - zend_globals.h: - - Second wave of garbage removal. - - * zend_compile.h - zend_execute.c: - - Stop using garbage. Please let me know if you find any bugs resulting - - of this patch (very likely). (Dmitry, Andi) - -2004-08-19 Marcus Boerger - - * zend_reflection_api.c: - - Implement #29728: Reflection API Feature: Default parameter value. - . ReflectionParameter::isDefaultValueAvailable() - . ReflectionParameter::getDefaultValue() - - * zend_reflection_api.c: - - Nedd to work on copy - -2004-08-18 Marcus Boerger - - * zend_reflection_api.c: - - Show default value of optional parameters of user defined functions. - -2004-08-18 Andrei Zmievski - - * zend_ini_parser.y: - Forgot to turn off debugging. - - * zend_ini_parser.y - zend_ini_scanner.l: - Re-add my patch for .ini variable access. - -2004-08-16 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH: Fix bug #29447: Reflection API issues - - * zend_reflection_api.c: - - Fix bug #29447: Reflection API issues - -2004-08-15 Marcus Boerger - - * zend_compile.c: - Remove unnecessary check - -2004-08-14 Marcus Boerger - - * zend_compile.c: - Add missing check - -2004-08-12 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to 5.0.2-dev - - * (PHP_5_0) - zend.h: - - Roll 5.0.1 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC2 - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Don't use magic numbers - - * zend_compile.c - zend_execute.c: - - Significantly improve performance of foreach($arr as $data). (Marcus) - -2004-08-11 Ilia Alshanetsky - - * zend_highlight.c: - MFH: Fixed bug #29607 (highlighting code with HEREDOC produces invalid - output). - - * (PHP_5_0) - zend_highlight.c: - Fixed bug #29607 (highlighting code with HEREDOC produces invalid output). - -2004-08-11 Marcus Boerger - - * zend_execute.c: - More meaningfull error message - -2004-08-11 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Patch to allow the Zend memory allocators to be disabled. - - * zend_alloc.h: - - Added missing defines. - -2004-08-10 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - - * zend_highlight.c: - Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - -2004-08-10 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC1 - -2004-08-10 Marcus Boerger - - * zend_execute.c: - - Fix warnings - -2004-08-07 Andi Gutmans - - * zend_alloc.h: - - Commit Derick's patch for allowing Zend to use regular libc memory - - allocation functions. Mainly useful in conjunction with tools such as - - valgrind which enables us to find bugs we might not find with the - - current memory managers boundary protection. - -2004-08-05 Ilia Alshanetsky - - * zend_builtin_functions.c: - Eliminate unneeded variable. - -2004-08-04 Marcus Boerger - - * zend_reflection_api.c - tests/bug29523.phpt: - - Fix bug #29523 (ReflectionParameter::isOptional() is incorrect) - -2004-08-03 Marcus Boerger - - * ZEND_CHANGES: - Update - - * (PHP_5_0) - zend_builtin_functions.c - tests/bug29505.phpt: - - MFH Bug #29505 get_class_vars() severely broken when used with arrays - - * tests/bug29505.phpt: - - Add new test - - * zend_builtin_functions.c: - - Fixed Bug #29505 get_class_vars() severely broken when used with arrays - -2004-08-02 Marcus Boerger - - * zend_reflection_api.c: - - Add methods to check parameter count - - * (PHP_5_0) - zend_compile.c: - MFH Change to use memcmp instead of strcmp - - * zend_compile.c: - - Change to use memcmp instead of strcmp - -2004-08-02 Andi Gutmans - - * zend_compile.c: - - Fix typo - -2004-08-02 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - - Remove all for now - - * zend_compile.c - zend_compile.h - zend_execute_API.c: - MFB: Enforce protocol on magic methods/functions - -2004-08-02 Ilia Alshanetsky - - * (PHP_5_0) - zend_execute.c: - MFH: A gentler (performance wise) allocation of buffer for temp variables. - - * zend_execute.c: - A gentler (performance wise) allocation of buffer for temp variables. - -2004-08-01 Marcus Boerger - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_execute_API.c: - - Enforce protocol on magic methods/functions - -2004-07-30 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_ptr_stack.c - zend_ptr_stack.h: - - More ptr_stack optimizations and cleanups - - * zend_alloc.c - zend_alloc.h - zend_execute.c - zend_fast_cache.h - zend_ptr_stack.h: - - Improve performance by inlining zend_ptr_stack_n_push(). var_args can - usually not be inlined by compilers. - -2004-07-29 Marcus Boerger - - * zend_hash.c: - - Increase performance of *sort() and some internal sort operations. - -2004-07-29 Sara Golemon - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Revert goto opcode - - * zend_execute.c: - &tmp and label are the same thing, don't free it till we're done with it. - - * zend_compile.c - zend_execute.c: - Plug some memory leaks and promote unknown label to E_ERROR. - If someone tries to jump to a non-existant label execution really - shouldn't try to carry on. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Add goto operator by popular request. - -2004-07-28 Wez Furlong - - * zend_ini.c: - Fix: ini entries for dl()'d modules now work under ZTS - Side-effect: avoid possible crashes when multiple threads load/unload - modules and mess with the global hash table. - -2004-07-28 Andi Gutmans - - * zend.h - zend.h: - - Fix MAC OSX to always use native DSO loading - -2004-07-27 Marcus Boerger - - * zend_exceptions.c: - - Be specific about visibility - -2004-07-27 Wez Furlong - - * zend_builtin_functions.c: - Fix two possible crashes. Latter is unlikely unless you are doing scary - things, but former looks nasty. - -2004-07-26 Stanislav Malyshev - - * zend_interfaces.c: - quick fix for #29382 - -2004-07-25 Marcus Boerger - - * zend_reflection_api.c: - - Show visibility errors (try to fix #29354) - - * (PHP_5_0) - zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - MFH: Fix bug #29368 : The destructor is called when an exception is - thrown from the constructor - - * zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - Fix bug #29368 : The destructor is called when an exception is thrown - from the constructor - - * zend.c - zend.h - zend_execute.h - zend_execute_API.c: - - Execute destructors earlier (Florian Schaper, fschaper at intux org) - - * zend_reflection_api.c: - - Add ReflectionParameter::isOptional() to test whether a parameter is - optional and also show this information in export. - - * zend_exceptions.c: - - Add optional parameters $filename and $lineno to ErrorException - constructor to allow overwriting automatically retrieved information. - -2004-07-23 Marcus Boerger - - * zend_execute.c: - Fix 0 Byte leak after alloca to emalloc change - -2004-07-22 Zeev Suraski - - * zend_object_handlers.c: - Fix bug in handling of protected properties - -2004-07-21 Edin Kadribasic - - * zend_builtin_functions.c: - Fixed build - -2004-07-21 Marcus Boerger - - * (PHP_5_0) - zend_builtin_functions.c: - MFH: Fixded #29291: get_class_vars() return names with NULLs - - * zend_builtin_functions.c: - - Fixded #29291: get_class_vars() return names with NULLs - -2004-07-20 Moriyoshi Koizumi - - * zend_alloc.c - zend_alloc.h: - - Add safe_pemalloc() - -2004-07-20 Marcus Boerger - - * zend_reflection_api.c: - - Fixed bug 28895 again (long live the dead) - -2004-07-20 Zeev Suraski - - * zend_exceptions.c: - Fix prototypes - - * zend_exceptions.c: - Add descriptions - -2004-07-20 Stanislav Malyshev - - * zend_compile.c: - add todo - - * (PHP_5_0) - zend_ini.h - zend_ini_parser.y: - export ini parser - -2004-07-19 Sebastian Bergmann - - * zend_reflection_api.c: - Fix prototypes: Reflection_* -> Reflection*. - - * zend_reflection_api.c: - Make ReflectionClass::getMethod() and ReflectionClass::getProperty() raise - an ReflectionException instead of returning NULL on failure. - - * zend_reflection_api.c: - Do not use contracted forms. - -2004-07-19 Stanislav Malyshev - - * zend_ini.h - zend_ini_parser.y: - export INI parser - - * zend_object_handlers.c: - __set and __get will be called not only when variable doesn't exist but - also when it's - invisible - -2004-07-19 Andi Gutmans - - * zend_extensions.h - zend_modules.h: - - Bump API number due to empty_string change - - * zend.c - zend.h - zend_API.h - zend_alloc.h - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_variables.c: - - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE() - used to return "" and not bool(false). It's not worth keeping it because - STR_FREE() and zval_dtor() always have to check for it and it slows down - the general case. In addition, it seems that empty_string has been - abused - quite a lot, and was used not only for setting zval's but generally in - PHP code instead of "", which wasn't the intention. Last but not least, - nuking empty_string should improve stability as I doubt every place - correctly checked if they are not mistakenly erealloc()'ing it or - calling efree() on it. - NOTE: Some code is probably broken. Each extension maintainer should - check and see that my changes are OK. Also, I haven't had time to touch - PECL yet. Will try and do it tomorrow. - -2004-07-18 Wez Furlong - - * zend_execute_API.c: - No point allocating 0 bytes - -2004-07-16 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - - Speed up by making null/false/true reserved word which allows to drop - an opcode (FETCH_CONSTANT) for every usage. - - * zend_execute.c: - Bugfix #28464 catch() does not catch exceptions by interfaces - -2004-07-16 Ilia Alshanetsky - - * zend_operators.h: - MFB: Fixed bug #28800 (strings beginning with "inf" improperly converted). - - * (PHP_5_0) - zend_operators.h: - Fixed bug #28800 (strings beginning with "inf" improperly converted). - -2004-07-15 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: - - Improve performance of zend_alloc by stopping the size from being a bit - - field. - -2004-07-15 Marcus Boerger - - * zend_exceptions.c - zend_exceptions.h: - - Add new class ErrorException to encapsulate errors in exceptions - - * zend_dynamic_array.h: - - Fix prototype - -2004-07-14 Stanislav Malyshev - - * zend_object_handlers.c: - be consistent with write_dimension - - * zend_object_handlers.c: - fix #28957 - -2004-07-13 Andi Gutmans - - * zend.h: - - 5.0.1-dev - -2004-07-13 Marcus Boerger - - * zend_constants.c: - Bugfix #29116 Zend constant warning uses memory after free (jdolecek at - NetBSD dot org) - -2004-07-13 Andi Gutmans - - * (php_5_0_0) - zend.h: - - Roll PHP 5.0.0 - -2004-07-12 Ilia Alshanetsky - - * (php_5_0_0RC4) - zend_execute.c: - Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts). - -2004-07-12 Andi Gutmans - - * (php_5_0_0RC4) - zend.c: - - Convert zend_class_entry -> zend_class_entry * - -2004-07-10 Jon Parise - - * zend.c: - DragonFly BSD is derived from FreeBSD and requires the same floating point - precision fix. - -2004-07-10 Andi Gutmans - - * zend_alloc.c - zend_hash.c - zend_variables.c: - - Better stability during premature shutdown of request startup - -2004-07-05 Andi Gutmans - - * zend_mm.h: - - Disable zend_mm for 5.0.0 - -2004-07-03 Andi Gutmans - - * zend_alloc.c: - - Should fix mem leak with ZEND_MM. I made this change a while ago and - - rolled it back but I don't remember why. Please test! - -2004-07-01 Ilia Alshanetsky - - * zend_constants.c: - Do not use alloca() where it can be easily abused by the users. - - -2004-06-25 Wez Furlong - - * zend_stream.c - zend_stream.h: - export zend stream functions for zend extensions under windows - -2004-06-24 Sara Golemon - - * zend_execute.c: - Ease off on severity of new error (Using Resources as array offsets) - -2004-06-23 Sara Golemon - - * zend_execute.c: - BugFix #28879 Inconsistent behavior between explicit and implicit array - creation. - - Changes: - - Throw E_WARNING "Illegal offset type" when explicitly creating - array elements with objects, arrays, or resorces as indexes. - This matches implicit creation w/ obj/arr indices. - - Throw E_WARNING "Resource ID#%ld used as offset, casting to integer (%ld)" - when implicitly creating array with resource as index. (BC) - -2004-06-19 Sebastian Bergmann - - * zend_reflection_api.c: - Reflection_* -> Reflection*. Patch by Timm Friebe. - -2004-06-18 Sara Golemon - - * zend_execute.c: - Another typo in converting array index doubles to long. - -2004-06-18 George Schlossnagle - - * zend_builtin_functions.c: - fix for 28213. - - class_name and call_type should be reinitialized on every loop iter. - -2004-06-17 Sara Golemon - - * zend_builtin_functions.c: - String length in parse_parameters should be int - -2004-06-15 Marcus Boerger - - * zend_reflection_api.c: - - -2004-06-14 Marcus Boerger - - * zend_language_scanner.l: - Need {} here - -2004-06-10 Marcus Boerger - - * zend_language_scanner.l: - - Require a single white-space char after /** to start a doc comment that - way we prevent /*** from becoming a doc comment (as requested Derick). - - * zend_API.h: - Add missing declaration - - * zend_reflection_api.c: - Small code layout change - - * zend_language_scanner.l: - Do not require NEWLINE at start of doccomment - - * zend_reflection_api.c: - Bugfix #28699: Reflection api bugs - -2004-06-09 Marcus Boerger - - * zend_reflection_api.c: - Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP - -2004-06-07 Andi Gutmans - - * zend.h: - - Go back to -dev (Shouldn't need another RC) - - * (php_5_0_0RC3) - zend.h: - - Roll RC3 - -2004-06-06 Stefan Esser - - * zend_compile.h - zend_opcode.c: - Fixed Zend Function Destructor to use correct TSRM handle. - -2004-06-05 Marcus Boerger - - * zend_API.c: - Fix #28641: Instance of Interface - -2004-06-03 Andi Gutmans - - * (php_5_0_0RC3RC2) - zend.h: - - Prepare for RC3RC2 - -2004-06-02 Andi Gutmans - - * zend_mm.h: - - Don't use ZEND_MM in Windows - -2004-06-02 Stanislav Malyshev - - * zend_execute.c: - fix incdec - make value's refcount non-zero when passing to - write_property - otherwise __set caller cleanup could kill it. - -2004-06-01 Andi Gutmans - - * zend.c: - - If user error handler returns "false" then we relay to the built in error - handler - -2004-05-31 Marcus Boerger - - * zend_reflection_api.c: - Refcount must not be set separatley again. - - * zend_reflection_api.c - zend_reflection_api.c: - Add missing initialization - - * zend_compile.c: - - -2004-05-28 Andrei Zmievski - - * zend.c: - Allow user-defined error handlers to indicate whether default error - handler should be re-invoked, by returning true or false. - -2004-05-28 Marcus Boerger - - * zend_execute.c: - Prevent possible problems with illegal properties - -2004-05-28 Derick Rethans - - * zend_builtin_functions.c: - - Make the default mask for user defined error handlers include ALL errors, - including E_STRICT. - -2004-05-27 Andi Gutmans - - * zend.h: - - Back to RC3-dev until we roll final - - * (php_5_0_0RC3RC1) - zend_execute.c: - - Fix problem with exceptions returning from include(). (Dmitry) - - * (php_5_0_0RC3RC1) - zend.h: - - RC3RC1 - -2004-05-26 Wez Furlong - - * zend_object_handlers.c: - Fix leak on systems where alloca isn't really alloca. - -2004-05-26 Andrei Zmievski - - * zend_constants.c: - Avoid unnecessary and silly copying of constant name when registering. - -2004-05-26 Andi Gutmans - - * zend_alloc.c: - - Fix memory manager problem - -2004-05-26 Sebastian Bergmann - - * ZEND_CHANGES: - Update Reflection API class names. Whitespace fixes. - -2004-05-25 Andi Gutmans - - * zend_objects_API.h: - - Nuke unused decleration - - * zend_alloc.c - zend_alloc.h: - - More fixes - - * zend_alloc.c - zend_alloc.h: - - Make fix compile. - - * zend_alloc.c - zend_alloc.h: - - Fix memory leak in mem cache in conjunction with Zend MM. How come no one - - noticed this? :) - -2004-05-23 Andi Gutmans - - * zend_objects_API.c: - - Fix problem with object being destroyed more than once - - * zend_builtin_functions.c: - - Fix the following script (it crashed): - - -2004-05-20 Wez Furlong - - * zend_exceptions.c - zend_exceptions.h: - Revert; obviously I missed the function at the bottom of the file... - - * zend_exceptions.c - zend_exceptions.h: - Export this, so extensions may throw their own exception objects that - they have already instantiated. - -2004-05-18 Marcus Boerger - - * zend_API.c: - - Need to operate on module pointer in hash table - -2004-05-18 Wez Furlong - - * zend_execute_API.c: - Fix bug #28438: win32 build fails in non-zts mode - -2004-05-18 Stanislav Malyshev - - * zend_API.c: - Z_TYPE_P is for zvals - -2004-05-18 Wez Furlong - - * zend_API.c: - Register according to the type specified by the module. - (Helps to fix dl() bug) - -2004-05-18 Sara Golemon - - * zend_execute.c: - Bugfix#28404 When type is double we need to access dval, not lval - -2004-05-17 Andrei Zmievski - - * zend_ini_parser.y - zend_ini_scanner.l: - Revert the .ini vars patch. Will have to try again next Christmas - apparently. - - * zend_ini_parser.y: - Fix the apparent bug (; at the end of parse rule block). - -2004-05-17 Wez Furlong - - * zend_objects_API.c - zend_objects_API.h: - As discussed with Andi, add this helper API for setting the object pointer - from - within the constructor. - - Please read the comment for notes about how to use it; in general, you - don't - need it, so don't use it. - -2004-05-14 Andrei Zmievski - - * zend_ini_parser.y - zend_ini_scanner.l: - Adding ability to refer to existing .ini variables from within .ini - files. Example: - - open_basedir = ${open_basedir} ":/new/dir" - -2004-05-12 Marcus Boerger - - * zend_API.c: - - Centralize register and hash operations for startup/register_module - in new zend_register_module_ex(). - - * zend_API.c: - - Revert to 1.249 - -2004-05-11 Andi Gutmans - - * zend_compile.c: - - Don't allow passing NULL to type hinted parameter. - -2004-05-10 Zeev Suraski - - * zend_operators.c: - - Fix comparison of objects - - Clarify convert_object_to_type() - -2004-05-10 Stefan Esser - - * zend_alloc.c: - Checking MEMORY_LIMIT before doing emalloc/erealloc solves several ugly - problems. - -2004-05-04 Wez Furlong - - * zend_iterators.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add count_elements handler for overloaded objects. - -2004-05-02 Andi Gutmans - - * zend_operators.c: - - Fix comparison of two objects in non-compatibility mode. - -2004-05-01 Marcus Boerger - - * zend_API.c: - Don't load modules twice - -2004-04-29 Stanislav Malyshev - - * zend_execute.c: - Fix bug #27876 - -2004-04-28 Marcus Boerger - - * zend_exceptions.h: - Fix c++ builds - -2004-04-27 Marcus Boerger - - * zend_builtin_functions.c: - - Optional parameter to class_exists() that can be used to bypass - __autoload() which can be helpfull in __autoload() itself. - - * zend_interfaces.c: - - Fix warnings - - * zend_interfaces.c - zend_interfaces.h - zend_iterators.h: - - no unneccessary retval initialization - - new c-level iterator handler invalidate_current that is optionally - used to clear internal caching like in implementation of Iterator - -2004-04-27 Andi Gutmans - - * zend_reflection_api.c: - - Fix prototypes - -2004-04-26 Marcus Boerger - - * zend_reflection_api.c: - Fix prototype - -2004-04-25 Marcus Boerger - - * zend_builtin_functions.c: - Skip correct amount of stack entries - - * zend_interfaces.c: - Capture potential problem by error message - - * zend_reflection_api.c: - Show number of classes - -2004-04-25 Andi Gutmans - - * zend.h: - - RC3-dev - - * (php_5_0_0RC2) - zend.h: - - RC2 - -2004-04-23 Andi Gutmans - - * zend_compile.c: - - Fixed bug #27923. foreach() without a key should not check if the key - - is a reference (Adam) - -2004-04-21 Andi Gutmans - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC2) - zend.h: - - Prepare for RC2RC2 (if everything is OK especially Zeev's interface - - patch I'll roll RC2 tomorrow). - -2004-04-21 Zeev Suraski - - * (php_5_0_0RC2RC2) - zend_compile.c: - Restore fatal error in case a method that's supposed to implement an - interface/abstract method, breaks its prototype - -2004-04-20 Andi Gutmans - - * zend_language_parser.y: - - Fix bug #27283 - Exceptions where the last catch() statement was - sometimes - - skipped. - -2004-04-19 Marcus Boerger - - * zend_reflection_api.c: - show ini entries and classes for extensions. - -2004-04-17 Marcus Boerger - - * zend.c: - Retval may not be set when zend_execute() is overloaded - -2004-04-15 Marcus Boerger - - * zend_execute.c: - Handle failure in get_current_data - -2004-04-14 Andi Gutmans - - * zend_extensions.h: - - Add comment - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC1) - zend.h: - - RC2RC1 - -2004-04-13 Marcus Boerger - - * zend_exceptions.c: - Classnames shall start with an uppercase character - -2004-04-13 Zeev Suraski - - * zend_builtin_functions.c: - Fix debug_backtrace to show arguments again - We need to merge code from debug_backtrace & debug_print_backtrace at - some point! - -2004-04-13 Andi Gutmans - - * zend_extensions.h: - - Fix API no of Engine 2. The first number is the engine version and the - - rest is the API_NO. This way engine2_api_no is always greater than - - engine1_api_no. - - * zend.c - zend_exceptions.c - zend_exceptions.h: - - Add hook for exception handler (Derick) - -2004-04-12 Marcus Boerger - - * zend_API.h: - Fix order of macro parameter (synch with other macros) - -2004-04-12 Andi Gutmans - - * OBJECTS2_HOWTO - zend_extensions.h - zend_ini.c - zend_ini.h - zend_modules.h: - - modifyable -> modifiable - -2004-04-09 Andi Gutmans - - * zend_object_handlers.c: - - Fix bug #26441 (When __set() returned a value it corrupted it) - -2004-04-08 Marcus Boerger - - * zend_reflection_api.c: - Bugfix #27519 Reflection_Function constructor crashes with non-existant - function's name - -2004-04-07 Andi Gutmans - - * zend_builtin_functions.c: - - Hopefully fix the debug_backtrace() code. - - * zend_builtin_functions.c: - - Fix crash bug in zend_debug_backtrace(). No idea how come this survived - - for so long.... - -2004-04-04 Ilia Alshanetsky - - * zend_objects_API.c: - Removed unused variable. - -2004-04-03 Andi Gutmans - - * zend_builtin_functions.c: - Patch by Timm Friebe: - It changes - set_exception_handler() to accept the pseudo-type "callable" (instead of - a string referring to a global function). - - - Examples: - set_exception_handler('function_name'); - set_exception_handler(array('class_name', 'static_method')); - set_exception_handler(array($instance, 'instance_method')); - - - This also makes set_exception_handler() more consistent with all the - other callback functionality, e.g. set_error_handler(). - - * zend_operators.c: - - Nuke more old junk - - * zend.h - zend_operators.c - zend_operators.h: - - Nuke code which hasn't been in use for ages. - -2004-04-01 Ilia Alshanetsky - - * zend_builtin_functions.c: - MFB: Revert patch for bug #27782. - - * zend_execute.c - tests/bug27731.phpt: - Fixed reversed condition for error reporting. - -2004-03-31 Dmitry Stogov - - * zend_execute.c: - Fixed BUG in zend_post_incdec_property - -2004-03-31 Andi Gutmans - - * zend_reflection_api.c: - - Fix typo - -2004-03-30 Marcus Boerger - - * tests/bug26695.phpt: - Fix test - -2004-03-30 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #27782 (Wrong behaviour of next(), prev() and each()). - -2004-03-30 Marcus Boerger - - * zend_reflection_api.c: - TSRM fix - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_globals.h - zend_reflection_api.c: - - Fix Reflection class names - - Add ability to get the extension an internal class was defined in - -2004-03-29 Marcus Boerger - - * acconfig.h: - NAN==NAN doest work (Ard) - - * zend_builtin_functions.c: - Allow mixed case search for extensions - -2004-03-29 Sebastian Bergmann - - * zend_execute.c: - -clonning+cloning - -2004-03-29 Dmitry Stogov - - * zend_execute.c: - Implicit clonning strict warning was added for ze1_compatibility_mode - -2004-03-29 Ilia Alshanetsky - - * zend_execute.c - tests/bug27731.phpt: - Fixed bug #27731 (error_reporting() inside @ block fails to set - error_reporting level). - -2004-03-28 Marcus Boerger - - * zend_API.c: - Use lowercasing here - - * zend.c: - Initialize the complete struct - -2004-03-28 Stanislav Malyshev - - * zend_language_parser.y: - check writability on =& too - - * zend_execute.c: - - call set handler if assigning to object having this handler - - cleanup: use macros to access object internal vars - - * zend_interfaces.c: - preserve ZEND_API in definition - - * zend_interfaces.h: - declare as extern - -2004-03-28 Marcus Boerger - - * zend_reflection_api.c: - Fix memleak found by Timm - -2004-03-28 Stanislav Malyshev - - * zend_operators.c: - centralize object-to-scalar conversion, make it work with get handler - - * zend.c: - try get handler on printable conversion - - * zend_object_handlers.h: - some more clear comments - - * zend_operators.c: - Use macros for object parts access - -2004-03-28 Dmitry Stogov - - * zend_execute_API.c: - fix of fix related to __autoload. (ext/standard/tests/network/bug20134.phpt - passes again) - -2004-03-27 Marcus Boerger - - * zend.c: - Even though it is uncommented it should be right - -2004-03-26 Marcus Boerger - - * zend_API.c - zend_compile.c: - Force destructors to have empty signatures - -2004-03-26 Andi Gutmans - - * zend_execute.c: - - Fix build (thanks to Timm) - -2004-03-25 Derick Rethans - - * zend_language_scanner.l: - - Remove old and deprecated scanner token. - -2004-03-25 Andi Gutmans - - * zend_compile.c: - - If __construct() is defined then it will always take precedence over - - old style constructors. - -2004-03-25 Stanislav Malyshev - - * zend_execute.c: - no need to use result for RECV's - as in PHP4 - - * zend_execute.c: - Use get/set handlers for increment.decrement ops on objects - -2004-03-25 Andi Gutmans - - * zend_execute_API.c: - /* The compiler is not-reentrant. Make sure we __autoload() only during - run-time - * (doesn't impact fuctionality of __autoload() - */ - -2004-03-25 Dmitry Stogov - - * zend_execute_API.c: - Using ALLOC_HASHTABLE/FREE_HASHTABLE instead of emalloc/free. - -2004-03-24 Dmitry Stogov - - * zend.c - zend_execute_API.c - zend_globals.h: - New autoload protection schema was implemented (Using HashTable instead of - boolean flag) - -2004-03-24 Derick Rethans - - * zend_operators.c: - - Revert bogus commit - - * zend_operators.c: - - Fixed NEWS - -2004-03-24 Dmitry Stogov - - * tests/bug27641.phpt: - Fixed bug #27641 (Object cloning in ze1_compatibility_mode was - reimplemented) - - * zend_execute.c - zend_variables.c: - Object cloning in ze1 compatibility mode (zend.ze1_compatibility_mode) was - reimplemented (Dmitry, Andi) - -2004-03-22 Andi Gutmans - - * zend_compile.c: - - Fix bug - - * zend_execute.c: - - Remove whitespace - -2004-03-21 Andi Gutmans - - * zend_execute.c: - - Improve consistency - -2004-03-21 Stanislav Malyshev - - * zend_objects_API.c - zend_objects_API.h: - return zval *, to make it useful for read_property - - * zend_objects_API.c: - update to new API - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - API change for read_property: - instead of bool silent it now gets fetch type - This can be used for creating proxy objects for write contexts - -2004-03-21 Andi Gutmans - - * zend_execute.c: - - Nuke unused code - -2004-03-18 Andi Gutmans - - * zend.h: - - Back to RC2-dev - -2004-03-18 Zeev Suraski - - * (php_5_0_0RC1) - zend.h: - Prepare to roll RC1 - - * (php_5_0_0RC1) - zend_execute.c: - Fix possible data corruption with __set() - -2004-03-18 Stanislav Malyshev - - * zend_execute.c: - Improve error message - on E_STRICT, method is actually called, - so the error shouldn't say it cannot be called. - -2004-03-18 Andi Gutmans - - * (php_5_0_0RC1) - zend_compile.c: - - Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT. - - * (php_5_0_0RC1) - ZEND_CHANGES: - - Update Changes - -2004-03-17 Sascha Schumann - - * zend_multiply.h: - Readd x86 implementation - -2004-03-17 Andi Gutmans - - * (php_5_0_0RC1RC2) - zend_multiply.h: - - Improved patch for support multiplication on 64bit machines - - * (php_5_0_0RC1RC2) - zend_execute.c: - - Fix tiny bug (one of the reasons we can't support __toString() for - - regular objects). - - * (php_5_0_0RC1RC2) - zend.c: - - Stop make_printable_zval() from calling __toString() - - * zend_execute.c: - - Fixed problem with __toString(). Due to the engine's architecture it is - - currently not possible to call __toString() anywhere besides print & - eval. - - Follow up will be on internals@ - -2004-03-17 Stanislav Malyshev - - * (php_5_0_0RC1RC2) - zend_compile.c: - fix typo - -2004-03-17 Andi Gutmans - - * zend_multiply.h - zend_operators.c: - - Apply Ard's patch to support multiplication & overflow on both 32bit - and 64bit machines - -2004-03-16 Derick Rethans - - * zend.c - zend.h - zend_API.h - zend_modules.h: - - Replaced the exec_finished hook by the zend_post_deactive hook for - extensions. The new hook will be run after the symbol table and - destructors - are run. (Derick) - - * zend_modules.h: - - Bump API number so that it actually differs from PHP 4. This is needed - because we don't want PHP 4 and PHP 5 extensions to be in the same - directory - when doing "make install" for shared, or phpize'd extensions. - -2004-03-16 Marcus Boerger - - * zend_execute_API.c: - Fix SEGV in certain conditions while calling static methods - -2004-03-16 Zeev Suraski - - * zend_compile.c - zend_compile.h: - Add ability to disable JIT for a particular auto global - -2004-03-16 Marcus Boerger - - * zend_execute_API.c: - TSRM fix - -2004-03-16 Sascha Schumann - - * zend.h: - Enable ptr format check for GCC 3.1 and higher - -2004-03-16 Ilia Alshanetsky - - * zend.h: - Do not allow 3.0.4 for __attribute__. - - * zend.h: - Fixed bug #27600 (GCC 3.0.4 does not like __attribute__ directive) - -2004-03-16 Andi Gutmans - - * zend_compile.c: - - Fix problem when using old-style constructors it wasn't being inherited - correctly. - -2004-03-16 Derick Rethans - - * zend_execute_API.c: - - Spaces to tabs - -2004-03-16 Andi Gutmans - - * zend_execute_API.c: - - If the called method is static then don't define $this - - * zend_execute.c - zend_execute_API.c: - - Error out if get_method() isn't defined. - - Use calling scope of internal function callee when calling a method - using static syntax (array("A", "func")); - -2004-03-16 Marcus Boerger - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Improve error message - -2004-03-15 Andi Gutmans - - * zend_operators.c: - - Restore E_NOTICE for longs and doubles. - -2004-03-15 Jani Taskinen - - * zend.h: - - Fixed bug #24582 (extensions can not be loaded dynamically in - Solaris/iPlanet) - -2004-03-15 Andi Gutmans - - * zend_operators.c: - - Nuke E_NOTICE. This caused a notice when doing if ($obj == NULL) - -2004-03-14 Marcus Boerger - - * zend_builtin_functions.c: - Make object parameter optional - -2004-03-14 Ilia Alshanetsky - - * zend.c: - Fixed bug #27590 (crash during shutdown when freeing persistent resources - in ZTS mode). - -2004-03-14 Andi Gutmans - - * zend_execute_API.c: - - Fix windows build - - * zend_execute_API.c: - - Fix for bug #27504 - - * zend_builtin_functions.c: - - Fixing bug #27123 - - * zend_operators.c: - - Improve compatibility mode and compare objects according to property - - comparison (sucky but this is how PHP 4 behaved). - - * zend.c: - - Fix flow of logic - - * zend_operators.c: - - Support old style of converting objects to long/double/bool. - - This is only enabled in compatibility mode, else it calls cast_object() - - and if that is not available we return 1 (true) so that the following - - code would work: - if ($obj) { - } - -2004-03-14 Marcus Boerger - - * zend_operators.c: - Fix: Add return type void - -2004-03-14 Andi Gutmans - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Support Cast operator in convert_to_* so that we support internal - - extensions such as SimpleXML. This is for Sterling. - - * zend_operators.c: - - Fix memory leak in the following code (Dmitry): - - - * zend_operators.c: - - Initial commit which allows comparing overloaded objects with native - - types (only for internal classes and not for user-land classes). - -2004-03-11 Andi Gutmans - - * zend_objects_API.c: - - Real fix for bug #27535 (Dmitry) - - * zend_objects_API.c: - - Attempt to fix bug #27535 - -2004-03-09 Marcus Boerger - - * ZEND_CHANGES: - Rename hasMore() to valid() as discussed. (Part VI) - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_interfaces.c - zend_language_parser.y - zend_reflection_api.c: - Clearify the different method/class flags (as discussed with Andi). - - * zend.h: - No longer needed - -2004-03-09 Andi Gutmans - - * zend_constants.c: - - Fix crash: - - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Nuke unused code. - -2004-03-08 Marcus Boerger - - * zend_execute.c - zend_interfaces.c - zend_iterators.h: - Rename hasMore() to valid() as discussed. (Part II) - - * zend_interfaces.c: - Rename hasMore() to valid() as discussed. (Part I) - - * zend_execute_API.c: - Check count. - - * zend_reflection_api.c: - Add another missing conversion - -2004-03-05 Andi Gutmans - - * zend_compile.c: - - Fix some small problems I introduce in last patch. - - * zend_compile.c: - - Finally fix the following: - $xml_mem = - simplexml_load_string('1'); - /* The following works fine */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter->page as $page) { - print $page; - } - } - /* The following segfaults */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter as $chapter) { // Difference here from previous - example - print $chapter; - } - } - -2004-03-04 Moriyoshi Koizumi - - * zend_language_scanner.l: - - Fix memleak when scanner is called from within tokenizer extension. - -2004-03-04 Stanislav Malyshev - - * zend_execute.h: - fix the fix - - * zend_execute.h: - oops, fix cut&paste gone bad - - * zend_execute.h: - Fix object true value: if we are in compat mode and it's Zend object - - use PHP4 rules. Otherwise, object is always true. - -2004-03-04 Derick Rethans - - * zend_constants.h - zend_operators.h: - - Fixed a 64bit issue (for zend_builtin_functions.c, module_number is an - int). - - Change the MAX_LENGTH_OF_LONG constant to 20, as LONG_MAX is 20 - characters. - (Patches by Ard Biesheuven) - - * tests/zend_operators.phpt: - - Added instance_of test (patch by Ard Biesheuvel) - -2004-03-04 Stanislav Malyshev - - * zend_compile.c: - Disallow redefining ctors and cleanup - - * zend_mm.c: - Handle out of memory/bad size situation gracefully, without getting into - loop - -2004-03-03 Andi Gutmans - - * zend_objects_API.c: - - Fix crash: - x as $x); - } - } - new foo(); - echo 'OK'; - ?> - -2004-03-02 Marcus Boerger - - * zend_API.c - zend_API.h: - Fix zend_parse_method_parameters_ex() and make it consistant with - zend_parse_method_parameters(). - -2004-03-02 Andi Gutmans - - * zend_compile.c: - - Fix leaks (although there might be still a problem here). - - * zend_execute.c: - - Fix leak (Dmitry) - - * zend_compile.c: - - Fix crash in: - attributes as $name => $attr) { - } - } - } - - $f= new Foo(); - $f->export(); - ?> - - * zend_objects.c: - - Improve fix for protecting destructor's from exceptions. - - I was killing the current exception completely which was wrong. - -2004-03-01 Andi Gutmans - - * zend_objects.c: - - Fix crash in destructors(). You can't throw an exception in destructors - as there is no guaranteed time when the destructor will be called. - - * zend_reflection_api.c: - - Fix leak - - * zend_reflection_api.c: - - Fix crash in reflection API (pierre) - - * zend.c - zend_exceptions.c - zend_execute_API.c: - - Fix crash in exception handling (zend_exception_error(...) and - zend_eval_string_ex() were buggy (Dmitry, Andi) - -2004-03-01 Derick Rethans - - * zend_compile.h: - - Typo fix (by Jan) - - * zend_builtin_functions.c: - - Fixed bug #27443 (defined() returns wrong type). - -2004-02-29 Andi Gutmans - - * zend_reflection_api.c: - - Apply fixes by Timm. - - * zend_compile.c: - - Change prototype isA check not to check the constructor. - - Only give an E_STRICT for non-isA compliant code as opposed to - E_COMPILE_ERROR. - -2004-02-29 Stanislav Malyshev - - * zend_compile.h: - add ZEND_API there too for opcode handlers - -2004-02-29 Derick Rethans - - * zend_execute.c: - - Initialize memory to \0 so that we can reliable detect whether a specific - opcode element is in use. - -2004-02-29 Stanislav Malyshev - - * zend_execute.c: - export opcode table - -2004-02-27 Marcus Boerger - - * zend_API.c - zend_compile.h: - Add some comments - - * zend_API.c - zend_compile.c - zend_execute.c: - Fixes for abstract classes/methods - -2004-02-26 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - Fix __METHOD__ (noticed by Davey Sahfik) - - * zend_reflection_api.c: - Fix problem with Reflection_Property (patch from Timm slightly modified). - -2004-02-25 Marcus Boerger - - * zend_objects_API.c: - As Andi found out the dtor may increase the refcount. - -2004-02-25 Jani Taskinen - - * zend_builtin_functions.c: - ws + cs - -2004-02-25 Zeev Suraski - - * zend_compile.c - zend_execute.c: - Fix leak in foreach ($o->mthd()->arr) - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - - Improve ARG_INFO() macros to support supplying required_num_args - - Initial fix for foreach($o->mthd()->arr) crash (now leaks) - -2004-02-25 Derick Rethans - - * zend_highlight.c: - - Use instead of in highlight_string(). (Patch by - mg@iceni.pl) - -2004-02-25 Jani Taskinen - - * zend_exceptions.c: - Improve error messages - -2004-02-25 Zeev Suraski - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: - - Rename compatiblity mode to zend.ze2_compatibility_mode (it doesn't - only affect auto-clone). - - Perform implementation checks even with simple inheritance (off when - compatibility mode is enabled). - - Restore default arguments in interfaces and handle it correctly. - - Move registration of internal classes later in the startup sequence - in order to have INI options available. - -2004-02-25 Derick Rethans - - * zend_exceptions.c: - - Fixed bug #27391 (typo in Fatal Error message). - -2004-02-25 Zeev Suraski - - * zend_API.c - zend_compile.c - zend_compile.h - zend_opcode.c: - - Abstract methods cannot have defaults for arguments - - Make function foo($a, $b=null) satisfy both foo($a) and foo($a, $b) - prototypes - -2004-02-25 Sebastian Bergmann - - * zend_reflection_api.c: - Proto fixes. - -2004-02-25 Marcus Boerger - - * zend_objects_API.c: - Fix object destruction/free in shutdown - - set destructor_called even when no dtor is given - - use free_storage even when no dtor hat to be called - - * zend_objects_API.c: - Checking once for dtor is enough - -2004-02-24 Marcus Boerger - - * zend_API.c: - Fix class flags when handling abstract methods - -2004-02-23 Andi Gutmans - - * zend_language_parser.y: - - Improve precendence: - - foo = "Blah"; - - if (!$obj instanceof StdClass) { - print "No"; - } else { - print "Yes"; - } - - * zend_language_parser.y: - - Decrease precedence of instanceof so that the following is true: - php -r 'var_export((object)1 instanceof stdClass);'; - Patch by Jan Lehnardt - -2004-02-22 Derick Rethans - - * zend_operators.c: - - Fixed bug #27354 (Modulus operator crashes PHP). - -2004-02-22 Marcus Boerger - - * ZEND_CHANGES: - Add some more obviously needed information - -2004-02-20 Hartmut Holzgraefe - - * zend.h - zend_API.h - zend_iterators.h - zend_operators.h - zend_variables.h: - more EXTERN_C wrapping of ZEND_API prototypes - -2004-02-20 Jani Taskinen - - * zend_opcode.c: - ws fix - -2004-02-18 Hartmut Holzgraefe - - * zend.h - zend_builtin_functions.h - zend_extensions.h - zend_indent.h - zend_interfaces.h - zend_object_handlers.h - zend_objects.h - zend_objects_API.h - zend_ptr_stack.h - zend_stack.h - zend_stream.h: - wrap ZEND_API prototypes into BEGIN_EXTERN_C/END_EXTERN_C - for C++ extension support - -2004-02-18 Zeev Suraski - - * zend.c: - Forward-port fixlet from PHP 4 (thanks to Michael Sisolak) - -2004-02-17 Jani Taskinen - - * zend_list.c: - MFB: - Fix bug #26753 (zend_fetch_list_dtor_id() does not check NULL - strings) - -2004-02-16 Derick Rethans - - * ZEND_CHANGES: - - Clearify clone behavior, fixed clone example (Patch by Jan Lehnardt) - -2004-02-16 Marcus Boerger - - * zend_compile.c: - Bugfix #27227 Mixed case class names causes Fatal Error in Constructor call - -2004-02-14 Marcus Boerger - - * zend_iterators.c: - dtor's may not be called from free_storage handlers - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_execute.c: - - Remove old code - -2004-02-12 Hartmut Holzgraefe - - * (php_5_0_0b4) - ZEND_CHANGES: - making sure that the provided examples actualy work (or at least do not - generate no parse errors) unless they are really expected to fail - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_object_handlers.c: - - This was too strict. - -2004-02-12 Zeev Suraski - - * (php_5_0_0b4) - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_interfaces.c - zend_object_handlers.c: - - Check return-by-reference bit when implementing interface prototypes - - Add infrastructure for built-in functions to hint whether they - return by reference or not. It is NOT currently used for anything, - except for interface prototypes (you can use it to request that the - function that implements your prototype returns by reference or - doesn't return by reference). - For downwards compatibility - by default, interface prototypes are - agnostic as to whether the function that implements them returns - by reference or not. Use ZEND_BEGIN_ARG_INFO_EX() with - ZEND_RETURN_VALUE/ZEND_RETURN_REFERENCE to change that. - - Fix ArrayAccess::getOffset() to conduct additional checks. - If your getOffset() should work with multidimensional arrays - it - must return by reference. - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_object_handlers.h: - - Add comments to read/write property/dimension for extension authors - -2004-02-12 Zeev Suraski - - * zend_default_classes.h: - zend_default_classes.h -> zend_exceptions.h - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - Makefile.am: - - Add zend_exceptions.c - -2004-02-12 Zeev Suraski - - * (php_5_0_0b4) - ZendTS.dsp - zend.c - zend_default_classes.c - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_reflection_api.c: - Centralize exceptions code in zend_exceptions.[ch]. - Remove zend_default_classes.h (use zend_exceptions.h instead) - - NOTE: This currently breaks the build, fixes to php-src and pecl coming - soon - -2004-02-12 Andi Gutmans - - * zend_execute.c: - - Use zend_throw_exception_object() in throw_handler to make sure it - - does all the checks - -2004-02-12 Zeev Suraski - - * zend_default_classes.c - zend_default_classes.h - zend_exceptions.c - zend_exceptions.h - zend_execute.h - zend_execute_API.c: - Exceptions updates: - - - Enforce exceptions to be derived from class Exception. This allows - users to perform catch-all. It's not yet complete, so don't get - comfortable with it just yet :) Updates are coming soon. - - Implement zend_throw_exception() using zend_throw_exception_ex() - -2004-02-12 Andi Gutmans - - * zend_execute.h - zend_execute_API.c: - - Add API function to throw exception by using an object - -2004-02-11 Marcus Boerger - - * zend.c: - Must be initialized in ZTS mode - - * ZEND_CHANGES - ZEND_CHANGES: - Update - - * zend_compile.c - zend_language_parser.y: - Fix: [extends [, ]* ] - -2004-02-11 Zeev Suraski - - * zend_execute.c: - Fix leaks in assignments to overloaded objects - - * zend_execute.c: - Fix leak with overloaded objects, when they're used just "for the hell - of it" :) - - * zend_execute.c: - Fixed a bug the caused overloaded array indices to be converted to strings - - * zend_execute.c: - Turn off bogus warnings with overloaded dimensions and += (and friends) - - * zend_execute.c: - Improve the implementation of unset() on array dimensions to be more - consistent with that of regular variables and string offsets - - * zend_execute_API.c: - Fix bug #25038 - - * zend_reflection_api.c: - Fix crash (patch by Rob Richards) - - * zend.c - zend_execute_API.c: - Fix exceptions thrown without a stack frame - Always enable set_exception_handler() - - * zend_list.h: - Change FETCH_RESOURCE to return false on error instead of null, for - consistency with other error situations - - * zend_compile.c: - Fix bug #26802 (the right aspects of it found by Marcus, anyway :) - - * tests/bug26802.phpt: - Fix and clarify the test case - - * zend_execute_API.c: - Complete the fix for handling of exceptions happening during the - argument passing phase of function calls (fixes bug #26866) - - * zend_execute_API.c: - whitespace - -2004-02-10 Zeev Suraski - - * tests/bug26698.phpt: - Ignore the memleak in this test - - * zend_execute.c: - Fix bug #26698 (exceptions handled properly during argument passing to - functions) - - * zend_default_classes.c: - Fix bug #27186 - - * zend_execute_API.c: - Fix bug #26869 - - * zend_execute.c: - Fix refcounting of ++/+= overloading (fix leak in __get()/__set() - based classes) - -2004-02-10 Andi Gutmans - - * zend_compile.c: - - Nuke more unused code - -2004-02-10 Zeev Suraski - - * zend_execute.c: - Fix handling in assignment using multidimensional array syntax to string - offset ($s = "FUBAR"; $s[0][0] = 1;) - -2004-02-10 Andi Gutmans - - * ZEND_CHANGES: - - We will go with PHP 4 behavior. With the new object model assigning by - reference has lost a lot of its importance. - - * zend_compile.c: - - Remove junk - -2004-02-10 Zeev Suraski - - * zend_execute.c: - Fix exception handling in opcodes spanned across multiple oplines (fixes - the crash in __set()) - - * zend_execute.c: - - Fix pre/post increment for overloaded objects - - Fix binary-assign-op for overloaded objects - - NOTE: This requires the implementation of the 'get' callback! - -2004-02-10 Moriyoshi Koizumi - - * tests/bug22836.phpt: - - Correcting test. - -2004-02-08 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fix write-mode of overloaded objects when using array dimensions - -2004-02-08 Andi Gutmans - - * zend_objects_API.c: - - Check if free_storage exists - -2004-02-05 Sebastian Bergmann - - * ZEND_CHANGES: - Committing for Jan. - -2004-02-05 Ilia Alshanetsky - - * zend_compile.c - tests/bug27145.phpt: - Fixed bug #27145 (Unmangle private/protected property names before printing - then inside error messages). - -2004-02-04 Zeev Suraski - - * zend_execute_API.c: - Fix exceptions happening inside internal functions called through - zend_user_function() - - * zend_execute_API.c: - Remove double initialization - -2004-02-04 Marcus Boerger - - * zend_objects.h: - Add new prototype - - * zend_reflection_api.c: - Fix reflection - - * zend_iterators.c: - Fix warnings - -2004-02-04 Zeev Suraski - - * zend_compile.c: - Fixlet - - * zend_compile.c: - Fix handling of $this in some cases - - * zend_compile.c: - Handle additional cases - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_language_parser.y: - Reinstate early-binding for classes. - - Note that this is available for downwards compatibility only - and it - doesn't - work if you use new features (namely, interfaces). Generally, people - should - declare their classes before using them, but we just didn't want hell to - break - loose (c) - - * zend_opcode.c: - Optimize - - * zend_compile.c: - - Improve $this assignment detection and generalize some code in - zend_compile.c - - * zend_compile.c: - -Error out when trying to re-assign $this - - * zend_objects_API.c - zend_objects_API.h: - The valid bit was necessary after all - restored - - * zend_objects_API.c: - Fixlets - - * zend_compile.c - zend_objects.c: - - Small fixes - - * zend_execute.c: - - Improve wording - - * zend_execute_API.c - zend_iterators.c - zend_objects.c - zend_objects_API.c - zend_objects_API.h - zend_reflection_api.c: - Change destructor implementation (details will follow on internals@) - -2004-02-03 Marcus Boerger - - * tests/bug24884.phpt: - Update tests - - * zend_objects.c: - Nuke unused variable - - * zend_compile.c: - Fix Warning - -2004-02-03 Sebastian Bergmann - - * ZEND_CHANGES: - clone/__clone() related changes. - -2004-02-03 Zeev Suraski - - * zend_compile.c: - Remove unused variable - - * zend_objects_API.c - zend_objects_API.h: - Remove more garbage - valid bit was not really necessary - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c - zend_objects_API.h: - - Clean garbage (delete was nuked a long time ago) - -2004-02-03 Ilia Alshanetsky - - * zend_execute.c: - More unneeded code removed. - -2004-02-03 Zeev Suraski - - * zend_execute.c - zend_language_scanner.l: - Abort on parse error in an include file (patch by Ilia) - - * zend_compile.c: - Remove redundant code - - * zend_execute.c: - Fix try/catch block logic - - * zend_compile.c - zend_objects.c: - Perform a bitwise copy of the object even when __clone() is defined. - __clone() is back to not requiring any arguments, as $that is no longer - needed ($this already contains a copy of the original object, by the time - we __clone() is executed). - Calling the parent clone is done using parent::__clone() - - * zend_compile.c - zend_compile.h - zend_default_classes.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Rewrote exception support. Fixes a few limitations and bugs in the old - implementation, and allows exceptions to 'fire' much earlier than before. - - Instructions on how to use the new mechanism will follow on internals@ - shortly... - - Note - this (most probably) breaks the current implementation of - set_exception_handler() - -2004-02-02 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_objects.c: - Redesign the clone() feature to fix some fundamental flaws in the previous - implementation. - - Using clone directly is now done using - $replica = clone $src; - - Clone methods must now be declared as follows: - function __clone($that) - { - } - - Clone methods in derived classes can call the __clone method of their - parent - classes using parent::__clone($that) - -2004-01-31 Marcus Boerger - - * zend_reflection_api.c: - Throw an exception in case a reflection object cannot be found and do not - override the exception from constructors in static method calls. - -2004-01-30 Ilia Alshanetsky - - * zend_execute.c: - Apply the same parse error handling to (include|require)_once as the one - for - their non-once counterparts. - -2004-01-28 Zeev Suraski - - * zend_compile.c: - Tweak checks to detect some additional cases. - Reorder checks to make more sense. - - * zend_compile.c: - - Error message fix - - Prevent inheritance of the same constant from two interfaces - - * zend_compile.c: - Fixlets - - * zend_compile.c - zend_compile.h: - Prevent classes from implementing interfaces that have the same function - - * zend_execute.c: - Whitespace - - * zend_compile.c: - Code relayout - - * zend_execute_API.c: - Forward-port fix for timeouts under Windows - -2004-01-26 Marcus Boerger - - * zend_interfaces.c - zend_interfaces.h: - - Export struct zend_user_iterator - - Ad 'it' to function prefix to prevent naming clashes - - Export zend_user_it_free_current - -2004-01-25 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #26814 (On parse error include included file, terminate - execution script). - -2004-01-25 Marcus Boerger - - * zend_execute.c - zend_iterators.c - zend_iterators.h: - Respect proeprty visibility in foreach - - * tests/bug26696.phpt: - Update test - -2004-01-24 Marcus Boerger - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Switch from ZEND_ACC_DYNAMIC to ZEND_ACC_ALLOW_STATIC and disallow calling - internal non-static methods statically. - -2004-01-24 Sebastian Bergmann - - * zend_execute.c - zend_execute_API.c: - Change message as proposed by Jon. - -2004-01-23 Marcus Boerger - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Simplify detection of methods that must be called dynamic (with object) - - * zend_execute.c - zend_execute_API.c: - Disallow calling __clone/__construct/__destruct static - Send an E_STRICT when calling a non static method static - - * zend_API.c - zend_compile.c - zend_compile.h: - Disallow static declaration of clone - -2004-01-23 Jani Taskinen - - * zend_constants.h - zend_ini.h: - Silence some compile warnings - -2004-01-22 Marcus Boerger - - * zend_default_classes.c: - Fix internal access to exception properties - -2004-01-19 Andi Gutmans - - * zend_execute.c - zend_execute.h: - - Hopefully fix bug #26696. - - Please let me know if hell-breaks loose - -2004-01-19 Marcus Boerger - - * zend_API.c - zend_API.h: - Add zend_get_module_started() to quickly check whether a module is present - and its MINIT function has been called. - -2004-01-18 Marcus Boerger - - * zend_execute.h - zend_execute_API.c: - Improove debug capabilities - - * zend_reflection_api.c: - Fix some casing issues - -2004-01-17 Marcus Boerger - - * zend_interfaces.c: - - - * zend_interfaces.c: - Fix inheritance rule for interface Traversable - -2004-01-17 Jani Taskinen - - * tests/bug26802.phpt: - - Renamed all *php4* files to *php5*, changed all php4/PHP4 to php5/PHP5 - -2004-01-17 Ilia Alshanetsky - - * zend_object_handlers.c - zend_object_handlers.h: - Expose zend_std_call_user_call(), needed for implementation of things like - __call handlers. - -2004-01-17 Jani Taskinen - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - Nuke compile warning by using the LANG_SCNG macro instead - -2004-01-16 Jani Taskinen - - * zend_reflection_api.c: - - Fixed bug #26640 (__autoload() not invoked by Reflection classes) - - -2004-01-15 Zeev Suraski - - * zend.c: - Nice patch Christian, but it wasn't at all enabled? :) - - Fix bug #26883 - -2004-01-14 Zeev Suraski - - * zend_compile.c: - Don't allow interfaces to implement anything - -2004-01-14 Andi Gutmans - - * zend_operators.h: - - Remove bogus macros - -2004-01-13 Wez Furlong - - * zend_ini_parser.y: - Don't treat strings containing : as potential constant names in - the .ini parser. - This fixes Bug #26893 - -2004-01-12 Andi Gutmans - - * zend_compile.c: - - Return the PHP 4 behavior of not allowing class declerations within - - class declerations. This happened when declaring a class within a - - method. - class A { - function foo() { - class B { - } - } - } - -2004-01-12 Marcus Boerger - - * zend_API.h: - Add missing macro - -2004-01-11 Wez Furlong - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - TSRMLS fix - -2004-01-11 Andi Gutmans - - * zend_language_parser.y: - - Re-allow conditional class declerations. Needless to say that I also - - think it's not great coding.. Use polymorphism instead :) - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - - This should fix the problem of conditional function decleration on the - - same line of code not to work. You should re-evaluate your coding style - - if you really code this way :) - -2004-01-10 Zeev Suraski - - * zend_operators.c: - Remove conflict - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_operators.c: - Added error mask to set_error_handler() - Patch by Christian Schneider - -2004-01-09 Wez Furlong - - * acconfig.h: - support for building asm in the unix buildsys. - Also, when ZEND_ACCONFIG_H_NO_C_PROTOS is defined, - omit the C prototypes from the configuration header - so that it can be included into asm files. - -2004-01-09 Marcus Boerger - - * RFCs/002.txt: - this one is declined - -2004-01-09 Wez Furlong - - * zend_object_handlers.h: - must be extern to avoid problems with some compilers - -2004-01-09 Stanislav Malyshev - - * tests/bug26077.phpt: - fix expect - - * zend_compile.c: - Bug #25816 - disallow arrays in class constants - - * tests/bug26077.phpt: - add test - - * zend_compile.c - zend_execute.c: - Fix Bug #26077 - memory leak when new() result is not assigned - and no constructor defined - -2004-01-08 Jani Taskinen - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_scanner.h - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Happy new year and PHP 5 for rest of the files too.. - -2004-01-08 Andi Gutmans - - * zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l: - - - A belated happy holidays (by two years) - -2004-01-07 Marcus Boerger - - * zend_execute.c: - Reimplement part of Bug #24608 that was reverted too - - * zend_execute.c: - Revert patch that allowed to call sttaic methods via $method() - -2004-01-06 Ilia Alshanetsky - - * zend_mm.c: - Check if realloc() succeeds or not. (Noticed by Andrey) - -2004-01-06 Marcus Boerger - - * tests/bug26802.phpt: - Update - -2004-01-05 Marcus Boerger - - * zend_execute.c - tests/bug26802.phpt: - Fixed bug #26802 - - * tests/bug26802.phpt: - Fix test - - * tests/bug26801.phpt - tests/bug26802.phpt: - Add new test - - * tests/bug26696.phpt: - Update test - -2004-01-05 Stanislav Malyshev - - * zend_API.c: - Fix bug #26543 - check parent:: and self:: in class names - - * zend_execute.c - zend_object_handlers.c: - Bug #24608 - fix interaction between __accessors and get_property_ptr - -2004-01-03 Derick Rethans - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_reflection_api.c: - - Fixed var_export() to show public, protected and private modifiers - properly. - - Exported (un)mangle_property_name. - -2004-01-02 Andrei Zmievski - - * zend_default_classes.c: - Do not show exception message if it's empty. - - -2003-12-31 Andrei Zmievski - - * zend_default_classes.c: - Make default message look better. - -2003-12-30 Andi Gutmans - - * ZEND_CHANGES: - - Fix typos - -2003-12-30 Marcus Boerger - - * ZEND_CHANGES: - Update - -2003-12-30 Ilia Alshanetsky - - * tests/bug26696.phpt: - Added test case for bug #26696. - -2003-12-29 Marcus Boerger - - * zend_execute.c: - Fix (string) conversion - - * zend.c: - Add missing notice - - * zend_execute_API.c: - Fix __autoload() with derived classes - -2003-12-28 Marcus Boerger - - * zend_API.c: - WS - - * zend_API.h - zend_compile.c: - Fix order of class_entry member initialization (needed for example for DOM) - -2003-12-27 Marcus Boerger - - * zend_language_parser.y: - Fixed bug #26065 (Crash when nesting classes) - - * tests/bug26698.phpt: - Add new test - - * zend_objects.c: - Simplify - - * zend_object_handlers.c: - Fix __tostring() and concatenation - -2003-12-25 Marcus Boerger - - * zend_execute.c - zend_execute.c: - Fix warning - -2003-12-25 Ilia Alshanetsky - - * zend_highlight.c: - Fixed Bug #26703 (Certain characters inside strings incorrectly treated as - keywords). Original patch by vrana@php.net. - -2003-12-23 Marcus Boerger - - * zend.c - zend_execute_API.c - zend_globals.h - tests/bug26697.phpt: - Fixed bug #26697 (calling class_exists on a nonexistent class in __autoload - results in segfault). - -2003-12-22 Marcus Boerger - - * tests/bug26229.phpt - tests/bug26695.phpt: - Add more tests - - * tests/bug24884.phpt - tests/bug26166.phpt: - Fix tests now that class names are shown in correct casing - - * zend_compile.c: - Preserve class name casing. - - * zend_reflection_api.c: - Fixed bug #26695 (Reflection API does not recognize mixed-case class hints) - - * zend_object_handlers.c: - Fixed bug #26675 (Segfault on ArrayAccess use) - Update NEWS - -2003-12-22 Wez Furlong - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h: - export these symbols for use by SPL as a shared extension - -2003-12-19 Andi Gutmans - - * (php_5_0_0b3RC2) - zend_language_parser.y: - - Nuke another rule (thanks to Jan for noticing this) - -2003-12-19 Dmitry Stogov - - * (php_5_0_0b3RC2) - zend.c: - Bug #25547 (error_handler and array index with function call) was fixed - tests/lang/bug25547.phpt - -2003-12-19 Andi Gutmans - - * zend_language_parser.y: - - Nuke unused code - -2003-12-19 Dmitry Stogov - - * (php_5_0_0b3RC2) - zend_execute.c: - Error reporting on unset string offset was added (Bug #24773 - Zend/tests/bug24773.phpt) - - * zend_execute.c: - Assign_op operators (+=) were fixed for elements of overloaded objects - -2003-12-18 Andi Gutmans - - * zend_execute.c: - - Nuke C++ comment - - * zend_execute.c: - - Revert patch 1.566 - -2003-12-18 Marcus Boerger - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fixed bug #24837 Incorrect behaviour of PPP using foreach. - -2003-12-17 Zeev Suraski - - * (php_5_0_0b3RC1) - zend_execute.c: - This part of the if was necessary after all. - Refix bug #22510 - -2003-12-17 Dmitry Stogov - - * (php_5_0_0b3RC1) - zend_execute_API.c: - -** empty log message *** - - * (php_5_0_0b3RC1) - zend_compile.c: - Dynamic function call from object's property was fixed - (See "tests/lang/bug24926.phpt" and "tests/lang/bug25652.phpt") - - * zend_execute_API.c: - Access to globals/autoglobals from class __destructor was fixed. - (see "tests/lang/bug24908.phpt" and - "tests/classes/destructor_and_globals.phpt") - -2003-12-16 Sebastian Bergmann - - * zend_compile.h - zend_object_handlers.h - zend_stream.h: - Sync: Export externally used functions. - -2003-12-16 Stanislav Malyshev - - * zend_compile.c: - export class initialization function - - * zend_object_handlers.c: - export externally used functions - - * zend_stream.c: - export function - -2003-12-15 Marcus Boerger - - * zend.c - zend_object_handlers.c - zend_object_handlers.h: - Reenable __tostring() magic for print,echo,concatenation,function naming... - but not for other internal things. - -2003-12-15 Jani Taskinen - - * zend_execute.c: - ws + cs (no c++ comments in c code) - -2003-12-15 Dmitry Stogov - - * zend_execute.c: - Bug #24773 was fixed (Zend/tests/bug24773.phpt) - Assign_op operators (+=) were fixed for elements of overloaded objects - Memory leaks during accessing ptoperies/elements of overloaded objects - were fixed - - * zend_execute_API.c - zend_reflection_api.c: - Memory corruptions were fixed in zend_str_tolower_copy() - -2003-12-14 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - Fix behavior of return-by-reference functions. Remove erroneous warnings, - add E_STRICT warnings in case you return something by reference that - you're - not supposed to (anything that's not a variable, or a return-value of a - function that returned by reference). - - * zend.h - zend_execute.c - zend_execute.h: - Some cleanup - -2003-12-13 Moriyoshi Koizumi - - * zend_operators.c: - Fixes for POSIX compliancy. - -2003-12-12 Marcus Boerger - - * zend.c: - Free is needed in non ZTS too - - * zend.c: - Fix memleaks in ZTS mode - - * zend.c: - Fix memleaks - -2003-12-12 Ilia Alshanetsky - - * zend_constants.c: - Do not copy extra byte. - -2003-12-11 Ilia Alshanetsky - - * zend.h: - Fixed extra byte allocation for TRUE/FALSE/ZEND_THREAD_SAFE/NULL constants. - -2003-12-11 Marcus Boerger - - * zend_execute_API.c: - Bugfix: #26591 [NEW]: "__autoload threw an exception" during an uncaught - Exception - -2003-12-11 Andi Gutmans - - * zend_execute.c: - - Refix bug #24773 - -2003-12-11 Marcus Boerger - - * zend_object_handlers.c: - Handle getter failure and allow to bypass thrown exceptions. - - * zend_execute.c: - read_dimension() handler might return 0, handle this. - -2003-12-10 Marcus Boerger - - * zend_execute_API.c: - Do not double copy the string - -2003-12-09 Jani Taskinen - - * zend_operators.c - zend_operators.h: - - Brought ext/bcmath to the new millennium - -2003-12-09 Andi Gutmans - - * zend_constants.c: - - Fix overallocation (thanks to Ilia) - -2003-12-08 Derick Rethans - - * zend_builtin_functions.c: - - Make it compile again - -2003-12-07 Stanislav Malyshev - - * zend_builtin_functions.c: - Apply Andrey Hristov's patch adding get_declared_interfaces() - -2003-12-06 Marcus Boerger - - * zend_compile.c: - This test is against interfaces not abstract classes. - - * zend_default_classes.c: - Show the exception message again after __toString() magic has been dropped. - -2003-12-05 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Remove two unneeded convert_to_string() (found by Marcus) - - Change illegal use of string offset to E_ERROR - -2003-12-05 Ilia Alshanetsky - - * zend_default_classes.c: - Fixed crash demonstrated with ext/dom/tests/dom003.phpt test case. - -2003-12-04 Moriyoshi Koizumi - - * zend_execute.c: - Revert crap. - - * zend_execute.c: - Raise error in case dereference is performed on a scalar value. - -2003-12-03 Ilia Alshanetsky - - * tests/bug24773.phpt: - Test case for bug #24773. - -2003-12-03 Moriyoshi Koizumi - - * zend_execute.c: - This kind of error should be caught. (suggested by Andi, thanks) - - * zend_execute.c: - Fix bug #24773 (unset()ing string offsets crashes PHP) - -2003-12-03 Derick Rethans - - * zend_execute.c: - - Remove newline from error message - -2003-12-02 Marcus Boerger - - * zend_object_handlers.c: - Remove automatic call to __toString() since it is supposed to cause too - much trouble. See discussion on the mailing list. - -2003-12-02 Andi Gutmans - - * zend_API.c - zend_operators.c: - - Revert the revert of these patches. This overloading can only be used - - by C extensions such as SimpleXML and *NOT* PHP code. Reasons given - - on the mailing list and problem with reentrancy inside the opcodes. - - * zend_compile.c: - - Fix for bug #26182 - - * zend_errors.h: - - Don't include E_STRICT in E_ALL. - -2003-12-02 Marcus Boerger - - * zend_API.h: - Free the zval container only if it should be freed and was not copied. - -2003-12-01 Andi Gutmans - - * zend_execute.c: - - Change to E_STRICT so as not to break existing scripts. - - Thanks Edin - - * zend_builtin_functions.c: - - Nuke property_exists(). We need to fix isset() and this is already - - supported in reflection API. In any case, it's best not to add new - - functions in the general namespace except for keeping engine consistency - (which would have been true in this case) - - * zend_API.c: - - Revert auto-conversion in parameter API - - * zend_operators.c: - - Don't automatically call __toString() in convert_to_string_ex(). - - use __toString() in your code. - - Keep the auto-case in make_printable_zval. - -2003-11-30 Marcus Boerger - - * zend_default_classes.c: - Check return value of exception::__tostring() - - * tests/bug20240.phpt: - Fix test - -2003-11-29 Marcus Boerger - - * zend_compile.c - zend_iterators.c: - Fix memleak - -2003-11-29 Ilia Alshanetsky - - * zend_highlight.c - zend_language_scanner.l: - Fixed bug #26463 (Incorrect handling of semicolons after heredoc) - -2003-11-29 Marcus Boerger - - * zend_API.h: - This takes the address of a zval ptr - - * zend_API.h: - Add macros to return values of other zvals. - This is needed because one cannot use REPLACE_ZVAL_VALUE with - return_value. - -2003-11-29 Ilia Alshanetsky - - * zend_execute.c: - Restore original patch for bug #26281. - - -2003-11-29 Marcus Boerger - - * zend_compile.c: - Revert accidential commit until decision - - * zend_compile.c - zend_default_classes.c: - Make exception code more robust: - - Fix error in calculation of trace-string length - - Allow to overload __strostring() and make it work for uncaught - exceptions - - Show exception thrown while displaying exceptions - -2003-11-28 Ilia Alshanetsky - - * zend_API.c: - Add removed lcname, it is still needed. - -2003-11-27 Marcus Boerger - - * zend_API.c: - Convert objects to string if string is required by newer parameter parsing - since we do this for older parameter parsing does so too. - - * zend_object_handlers.c: - The macro REPLACE_ZVAL_VALUE cannot be used since we only have zval * - writeobj. to allow it the api needs to be changed to zval **writeobj. - - * zend_builtin_functions.c: - Add a support function to check for property existance which is different - from checking a property from being empty/set. - Update test #26182. - -2003-11-24 Marcus Boerger - - * zend_execute.c - zend_interfaces.c - zend_interfaces.h - zend_object_handlers.c - zend_operators.c - zend_operators.h: - Add new interface ArrayAccess to use objects as Arrays - -2003-11-24 Andi Gutmans - - * zend_constants.c: - - Fix newly introduced bug which stopped class constants from working. - - Thanks to Jan Lehnardt for reporting it. - -2003-11-24 Sebastian Bergmann - - * RFCs/004.txt: - No longer needed. - -2003-11-24 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_reflection_api.c: - - Fix __autoload() to preserve class case. - - Heads up, this patch might break stuff so please let me know if you - - bump into any problems. - -2003-11-23 Andi Gutmans - - * zend_reflection_api.c: - - Allocation optimizations by Timm Friebe - -2003-11-21 Ilia Alshanetsky - - * zend_execute.c: - Cleaner patch for bug #26281. - -2003-11-19 Ilia Alshanetsky - - * zend_execute.c - tests/bug26281.phpt: - Possible fix for bug #26281 & test case. - -2003-11-18 Marcus Boerger - - * zend_API.h: - Add method alias macro - -2003-11-18 Andi Gutmans - - * zend.c - zend_builtin_functions.c - zend_constants.c - zend_errors.h - zend_language_parser.y: - - Add E_STRICT, to be used to warn purists (like Jani :) - -2003-11-18 Marcus Boerger - - * zend_compile.c: - Backpatch the correct opcode for list(), property overloading needs more - opcodes (Bugfix #26257). - - * zend_interfaces.c: - Use correct order - - * zend_interfaces.c: - Use correct macro/function - -2003-11-17 Marcus Boerger - - * zend_interfaces.c: - Correct destruction - -2003-11-13 Moriyoshi Koizumi - - * zend_operators.c: - Bugfix #26156 (REPLACE_ZVAL_VALUE works on uninit stack-based zvals) - -2003-11-13 Marcus Boerger - - * ZEND_CHANGES - zend_interfaces.c: - IteratorAggregate::getIterator() cannot return anythingy else than objects - -2003-11-13 Andi Gutmans - - * zend_compile.c: - - Make sure internal clasess are malloced - -2003-11-10 Marcus Boerger - - * zend_iterators.c: - Don't use zend_class_entry indirection - - * zend_builtin_functions.c: - Bugfix #26010 (Bug on get_object_vars() function) - - * zend_object_handlers.c: - Correct default handlers - - * zend_iterators.c: - Need to update iterators handler table too. - - * zend_execute.c - zend_object_handlers.c: - Fix those warnings - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Split isset/isempty for object property and object dimension hooking. - - * zend_interfaces.c: - Little iterator improvement: ability to store index in iterator - -2003-11-08 Marcus Boerger - - * zend_reflection_api.c: - Add method reflection_class::implementsInterface() - Allow string & reflection_class in isSubclassOf() - - * zend_reflection_api.c: - Fix reflection_class::isSubclassOf() - - * zend.c - zend_object_handlers.c - zend_operators.c - tests/bug26166.phpt: - Handle exceptions in casting more gracefully. - This fixes bug #26166 - -2003-11-07 Marcus Boerger - - * zend_execute_API.c: - Make __autoload() faster - - * zend_execute.c - zend_iterators.h: - Update Iterators: Call next at the correct point in time. - - * zend_compile.c: - Add missing initialization. - - * zend_interfaces.h: - Make these class entries available for inheriting classes - -2003-11-06 Ilia Alshanetsky - - * zend_operators.c: - Fixed bug #26148 (Print the notice before modifying variable on type - mismatch). - - - Patch by: morten-bugs dot php dot net at afdelingp dot dk - -2003-11-04 Marcus Boerger - - * zend_execute.c - zend_interfaces.c: - Prevent some SEGV's when Exceptions are thorown inside iterators. - - * zend_builtin_functions.c: - Removedouble efree call - -2003-11-04 Moriyoshi Koizumi - - * zend_object_handlers.c: - __tostring() handler should be binary-safe - - * tests/bug26010.phpt: - Fix one more test - -2003-11-04 Stanislav Malyshev - - * Makefile.am: - add zend_iterators.c zend_interfaces.c to make - -2003-10-31 Moriyoshi Koizumi - - * tests/bug26010.phpt: - Add test case for bug #26010 - -2003-10-30 Stanislav Malyshev - - * zend_compile.c: - make CATCH opcode use "class" T like other opcodes do - via IS_CONST - -2003-10-30 Andi Gutmans - - * (php_5_0_0b2) - ZEND_CHANGES: - - Beta 2 - -2003-10-29 Moriyoshi Koizumi - - * zend_operators.h: - Use pretty macro instead. - -2003-10-28 Andi Gutmans - - * zend_language_parser.y: - - Head up! I'm reverting the patch which allows for expressions in constant - - declerations. Allowing the access of other constants in this code is - - flawed. We are reverting back to PHP 4's static scalars. - - Don't worry if you get the following msg when compiling: - - "zend_language_parser.y contains 3 useless nonterminals and 22 useless - rules" - - I didn't nuke the code in case we have some brilliant ideas after beta 2 - -2003-10-28 Marcus Boerger - - * zend_interfaces.c: - Give some freedon to c iterators but not in userspace. - -2003-10-28 Shane Caraveo - - * zend_compile.c: - fix crash in do_implement_interface when compiling - pear/PHPUnit/Framework/TestCase.php line 63 - while only interface_gets_implemented is the issue in this instance, both - these vars were unitialized, causing potential other issues - -2003-10-25 Marcus Boerger - - * zend_API.c - zend_API.h: - Add zend_make_callable() which allows to make zval's callable zval's. - At the moment this function only converts strings of the form - class::method - to an array(class,method). - - * zend_default_classes.c - zend_reflection_api.c: - This forces a better error message for non working clone calls. - - * zend_default_classes.c: - And use things to throw an exception here - - * zend_default_classes.c: - You shall not clone Exception instances - - * zend_reflection_api.c: - You shall not clone reflection_xx instances - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-25 Sebastian Bergmann - - * ZEND_CHANGES: - Fugbix typo. - - * ZEND_CHANGES: - s/Throwable/Printable: Exception has become an internal class since I - initially documented interfaces. - -2003-10-24 Andi Gutmans - - * ZEND_CHANGES: - - Fix typo - -2003-10-24 Marcus Boerger - - * zend_API.c - zend_execute_API.c: - Revert accidental commit - - * ZEND_CHANGES - zend_API.c - zend_execute_API.c: - Zend/ZEND_CHANGES - -2003-10-23 Sebastian Bergmann - - * Zend.dsp - ZendTS.dsp: - Add zend_interfaces.{c|h}. - -2003-10-22 Ilia Alshanetsky - - * zend.c: - Fixed bug #25922 (Crash in error handler when 5th argument is modified). - -2003-10-22 Marcus Boerger - - * zend_default_classes.c - zend_interfaces.c - zend_interfaces.h: - Impement userspace iterator interfaces and tests. See tests for details - on the names. - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Expand Interface C API. - In short: zend_class_entry->interface_gets_implemented() allows to modify - the class entry of a class when an interface gets implemented. - - * zend_default_classes.c: - The string conversion method should be named __toString() - -2003-10-21 Marcus Boerger - - * ZEND_CHANGES: - Make this clear - -2003-10-20 Andi Gutmans - - * ZEND_CHANGES: - - Add comment from Timm - -2003-10-20 Marcus Boerger - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-19 Andi Gutmans - - * zend_language_parser.y: - - Nuke const in function parameters. I just can't remember why this exists - - and it seems no one else remembers either. It has no semantic meaning. - -2003-10-18 Marcus Boerger - - * zend.h - zend_API.h - zend_compile.c - zend_iterators.h: - Fix class/iterator relationship & handling - - * zend_iterators.c: - Fallback to old behavior until we have a default iterator that respects - visibility we do the array trick. - - * zend_iterators.h: - Change order: Optional rewind() to end of structure - -2003-10-17 Marcus Boerger - - * ZendTS.dsp: - WS - - * zend_reflection_api.c: - Show if a class/object is iterateable - - * ZendTS.dsp - zend.h - zend_API.h - zend_default_classes.c - zend_execute.c - zend_iterators.c - zend_iterators.h: - Added c-api for iterators - - * zend_reflection_api.c: - Fix showing final/abstract for classes - -2003-10-17 Ilia Alshanetsky - - * zend_ini_parser.y: - Fixed formatting issue. - - * zend_alloc.c: - Fixed if() condition. - -2003-10-15 Marcus Boerger - - * zend_API.c - zend_API.h: - Add oo support function zend_class_implements() - - * zend_default_classes.c: - Fix cast function - -2003-10-14 Andi Gutmans - - * zend_mm.c: - - Argh, the suffering copy&paste can cause - - * zend_alloc.c: - - Fix compile problem. - - * zend_mm.c: - - Fix the fix by making sure the new block is in the right free list. - -2003-10-14 Stanislav Malyshev - - * zend_execute_API.c: - The freed one is a hashtable - may matter if Hashtables are allocated - differently - -2003-10-14 Andi Gutmans - - * zend_mm.c: - - Support merging free block which was created by reallocing to smaller - - size. This should fix some performance issues. This code is still not - - thoroughly tested. - -2003-10-09 Zeev Suraski - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Allow foo::$bar() - -2003-10-07 Rasmus Lerdorf - - * Zend.m4: - MFB bison configure test fix - -2003-10-07 Zeev Suraski - - * zend_execute.c: - Fix bug #17997 (Warning when switch & reference are combined) - - * zend_ini_parser.y: - Fix the fix :) - Not thoroughly tested, but appears to work fine - -2003-10-07 Marcus Boerger - - * zend_ini_parser.y: - Bugfix #25770 Segfault with PHP and bison 1.875 - -2003-10-05 Zeev Suraski - - * zend_object_handlers.c: - Remove unused callback - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Remove redundant callback, simplify API - -2003-10-05 Shane Caraveo - - * (BEFORE_HANDLERS_RESHUFFLE) - zend_API.h: - this little piggy broke lots of things...eg. _function_check_flag in - reflection api. - -2003-10-03 Moriyoshi Koizumi - - * zend_API.c: - Fixed bug #24766 (strange result array from unpack()) - - * zend.h: - Bug #25738 (alloca() related problems on the Darwin platform) - - * zend_API.h: - Ensure lval to have a *boolean* value. - -2003-10-03 Jani Taskinen - - * Zend.m4: - Aligned configure help texts. - -2003-09-30 Moriyoshi Koizumi - - * zend_compile.c: - Remove redundant '\n' - -2003-09-26 Hartmut Holzgraefe - - * zend_alloc.c: - signed/unsigned compiler warning fixes - -2003-09-25 Georg Richter - - * zend_alloc.c: - fixed compiler warning - removed dead code - - * zend_hash.h: - changed ulong to long to avoid compiler warnings (comparison between signed - and unsigned) - -2003-09-22 Ilia Alshanetsky - - * zend.c - zend_language_scanner.l: - Added missing format. - -2003-09-20 Marcus Boerger - - * zend_reflection_api.c: - Add public array Reflection_Class::getDefaultProperties() - -2003-09-18 Marcus Boerger - - * zend_builtin_functions.c: - Nuke vars no longer needed - - * zend_builtin_functions.c - zend_reflection_api.c: - Go with studlyCaps - - * zend_reflection_api.c: - Change tostring() into __toString() to match method name used in casting. - - * zend.c - zend_operators.c: - Fallback to default behaviour for unsupported object type conversions - - * zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Allow partial type conversion support for objects. - - Add support for object to string conversion from userspace by method - __toString() and add a test. - - * zend_API.c: - Add missing check - -2003-09-17 Marcus Boerger - - * zend_compile.c - zend_execute.c: - Show name of missing function as typed - - * zend_default_classes.c: - Use studlyCaps in exception class - - * zend_compile.c: - Go with studlyCaps in error messages/backtrace/reflection output - -2003-09-16 Marcus Boerger - - * zend_reflection_api.c: - - Make it clear whether it is an interface or a class - - Fix static properties - -2003-09-15 Marcus Boerger - - * zend_execute.c: - Revert - need to look for a better solution - - * zend_execute.c: - Bugfix #25547 - -2003-09-15 Zeev Suraski - - * zend_operators.c: - Simplify / fix - -2003-09-14 Marcus Boerger - - * zend.c: - Bugfix #25335 - -2003-09-14 Zeev Suraski - - * zend_operators.c: - Commit 64-bit fixes to the standard operators - by Ard Biesheuvel (abies@php.net) - -2003-09-14 Marcus Boerger - - * zend.h: - Bugfix #25528 (by Ard Biesheuvel) - -2003-09-13 Marcus Boerger - - * zend_alloc.c: - Fix warnings - -2003-09-11 Stanislav Malyshev - - * tests/dtor_scope.phpt: - add test - - * zend_execute_API.c: - ws - - * zend_execute_API.c: - Use scope from method, not from object - -2003-09-11 Marcus Boerger - - * zend_default_classes.c: - Use type instead of constant - -2003-09-08 Marcus Boerger - - * zend_compile.c: - Fix property inheritance where a derived class inherits a public property - and owns it as an implicit public property already (noticed by Brad). - - * zend.c: - Fix registering/derigistering of stdClass in ZTS and NON ZTS mode - -2003-09-07 Marcus Boerger - - * zend_execute.c: - Fix foreach() called with non array - -2003-09-07 Stanislav Malyshev - - * Zend.m4: - check for mach-o/dyld.h - needed for non-PHP ZE build - -2003-09-06 Marcus Boerger - - * zend_default_classes.c: - Disallow to changing the backtrace - - * zend_reflection_api.c: - Add missing newline if no static methods are available - - * zend_reflection_api.c: - - Internal functions shall be static - - Fix more nesting - - * zend_reflection_api.c: - Fix logic - - * zend_reflection_api.c: - - Fix CS: {{{ / }}} - - Fix static reflection_*::export() - - Add class reflection_object which allows to show dynamic properties - - * zend_reflection_api.c: - Use %s where it makes more sense - -2003-09-05 Marcus Boerger - - * zend_reflection_api.c: - Simplify reflection_property::__constructor() and fix property factory - - * zend_reflection_api.c: - - Don't use resorved words as variable names. - - Improve several exception messages. - - Fix Reflection_Property::_construct() / getDeclaringClass() - - * zend_reflection_api.c: - Fix reflection_api::__construct() (noticed by Andrey) - - * zend_default_classes.c: - Provide string casting for exceptions by calling toString() - -2003-09-04 Marcus Boerger - - * zend_API.c - zend_execute.c - zend_object_handlers.c: - Tests show updating consts must happen once at runtime (revert - optimization). - Add tests for static properties. - - * zend_reflection_api.c: - Add reflection_class::getstaticproerties() - -2003-09-03 Marcus Boerger - - * zend_compile.c: - Partly revert and reintroduce hash table entries for the ctor. - - * zend_compile.c: - Nuke unused variable, too - - * zend_compile.c: - - Inheritance applies to __clone() too. - - No need to add additional functions for the constructor. - The handler uses the pointer as intended and doesn't look the the name. - - * zend_compile.c: - Cannot turn a static property into a non static one and vice versa - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c: - Fix handling of static properties initialized to arrays - - * zend_compile.c: - Add missing error messages when violating static property inheritance - rules. - - * zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c: - Fix static properties. - - * zend_compile.c: - Allow redeclareing a protected property as public. - -2003-09-03 Zeev Suraski - - * zend_compile.c: - Revert bogus patch - One must *never* use E_CORE_* error levels! - -2003-09-03 Marcus Boerger - - * zend_reflection_api.c: - Clearly distinguish between Const, Static and Other members. - -2003-09-02 Marcus Boerger - - * zend_compile.c: - Fix error messages - - * zend_API.c: - Allow redeclaring of protected properties as public (for internal classes). - - * zend_reflection_api.c: - Use appropriate function for property name unmangling. - - * zend_reflection_api.c: - Make these static as noticed by Andrey - - * zend_execute.c - zend_object_handlers.c - zend_objects.c: - Synch/Unify error messages related to function/method calls - - * zend_compile.c: - Fix error level - - * zend_API.c - zend_compile.c: - Currently we cannot support static ctor/dtor - - * zend_reflection_api.c: - These are implicit properties as denoted by the flag. Dynamic properties - only - exist in one single object and currently reflection api is not capable of - showing those. - -2003-08-31 Marcus Boerger - - * zend_reflection_api.c: - Don't repeat first const count(consts) time - - * zend_reflection_api.c: - Beautify output - - * zend_reflection_api.c: - Add reflection_parameters, patch by Timm Friebe - - * zend_default_classes.c: - Excluded chars < 32 when displaying string parameters that would obliterate - output. - -2003-08-31 Zeev Suraski - - * zend_arg_defs.c - zend_builtin_functions.c - zend_modules.h: - Attempt at fixing the linkage problem in Win32 - -2003-08-31 Marcus Boerger - - * zend_execute.c: - Synch error message with other one to fix tests - - * zend_reflection_api.c: - Check whether we may access tat union - - * zend.c: - Revisited: Replace the non portable code by spprintf - - * zend_reflection_api.c: - Using zend_spprintf should be faster here - - * zend.c - zend.h - zend_default_classes.c: - Make vspprintf available as zend utility function. Use it in exception - output. - -2003-08-30 Marcus Boerger - - * zend_default_classes.c: - Actually fetch the parameter - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c - zend_reflection_api.c: - - Calling abstract methods should be a error for consistency reason. - - So in reflection_api we use the reflection_exception again. - -2003-08-30 Andi Gutmans - - * zend_default_classes.c: - - PLEASE stop commiting ^M's - -2003-08-30 Marcus Boerger - - * zend_default_classes.c: - Even though it is ignored this should be correct - - * zend_default_classes.c: - Add frame numer and finally display stack trace in the message. - - * zend_default_classes.c: - Add exception::traceAsString() and exception::toString() - - * zend_reflection_api.c: - fci.function_table & fci.function_name are not needed since we use - zend_fcall_info_cache - - * zend_reflection_api.c: - Be precise - - * zend_reflection_api.c: - Actually using fcc would be a good idea - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c: - - The compiler can't detect all abstract function calls so we need to - check. - - * zend_default_classes.c: - Make those final (see comment) - -2003-08-29 Marcus Boerger - - * zend_API.c - zend_API.h: - - Add zend_merge_properties() which is designed to serve *_fetch_object(). - - Explain drawbacks of object_and_properties_init and - zend_merge_properties. - - * zend_reflection_api.c: - - Use zend_fcall_info_cache in invoke() to improve speed. - -2003-08-29 Zeev Suraski - - * zend_compile.c: - Fix a problem in implicit public properties and inheritance - -2003-08-29 Sascha Schumann - - * zend_hash.c: - improve a number of zend_debug format strings - -2003-08-29 Marcus Boerger - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - Need to tell zend_fetch_debug_backtrace() whether to skip top function or - not. - -2003-08-28 Marcus Boerger - - * zend_default_classes.c: - Add public read access to protected - - * zend_default_classes.c - zend_default_classes.h: - Add zend_throw_exception_ex() which allows to format exception messages. - - * zend.c: - Classe tables work this way - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - - Split debug_backtrace() into lowlevel c function and php function wrapper - - Add trace property to default method based on new - zend_fetch_debug_backtrace - -2003-08-28 Sascha Schumann - - * zend.h: - older gccs don't understand attribute((format)) on function pointers - - * zend.h: - ZEND_GCC_VERSION should always be defined to a number so we can use - simple comparisons all the time. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - Add format attribute to a number of functions - - Kill a few warnings - - * zend.h - zend_alloc.h: - cleanup & centralize ZEND_GCC_VERSION and ZEND_ATTRIBUTE_MALLOC so that - they can be used by downstream applications - - * zend_alloc.h: - Enable attribute((malloc)) for GCC 2.96 - - * zend_alloc.h: - GCC 2 does not know about malloc yet. - - * zend_alloc.h: - provide attribute((malloc)) where appropiate - -2003-08-27 Marcus Boerger - - * zend_reflection_api.c: - Nuke unused variable - - * zend_reflection_api.c: - Fix reflection_class::newInstance() - -2003-08-25 Jani Taskinen - - * zend.h: - - Fixed bug #25240 (spaces before pre-processor directives) - -2003-08-24 Marcus Boerger - - * zend_API.c: - Add missing check - - * zend_API.c: - Fix memory source of string duplication for non internal properties - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c - zend_execute_API.c - zend_variables.c - zend_variables.h: - - Provide appropriate way to destroy internal zval's. - - Allow internal zval's of type string and disallow complex types. - - Define the default string for extensions at class level instead of ctor. - - * zend_API.h - zend_compile.h - zend_reflection_api.c: - Don't identify alias'ed functions - -2003-08-24 Zeev Suraski - - * zend_API.c: - Use ""'s if you want empty strings. We want to crash on errors. - - * zend_compile.c: - Use pemalloc() - -2003-08-24 Marcus Boerger - - * zend_API.c: - Allow NULL, too - -2003-08-24 Zeev Suraski - - * zend_API.c: - Get rid of more ^M's - Marcus, please check your CVS client! - - * zend_default_classes.c: - Get rid of more ^M's - - * zend_compile.c: - line endings fix - - * zend_execute.c: - Never, ever, overwrite the refcount element of a connected zval! - -2003-08-24 Marcus Boerger - - * zend_reflection_api.c: - Add dedicated reflection_exception - - * zend_default_classes.c - zend_default_classes.h: - Allow to throw instances of classes derived from exception - - * zend.c - zend_default_classes.c - zend_default_classes.h - zend_execute.h - zend_execute_API.c: - - Provide a unified way to display uncaught exceptions, which shows - file/line/message info if possible. - - Add zend_eval_string_ex() to be able to handle exceptions in eval'd - code. - - Use above function to fix memleaks in CLI. - - * zend_reflection_api.c: - Make invoke() work - - * zend_reflection_api.c: - zend_parse_parameters 'O' works the way we need here - - * zend_reflection_api.c: - Not needed - - * zend_default_classes.c: - Make use method macros - - * zend_API.h: - One of PPP is needed, too - - * zend_reflection_api.c: - - Add Reflection_Function::isAlias - - Use ZEND_ME/ZEND_METHOD - - Fix static entries - - * zend_API.h - zend_compile.h: - - Add fn_flag ZEND_ACC_ALIAS - - Unify way of function_entry generation by new macro ZEND_FENTRY - - * zend_API.c: - Fix fn_flags handling - - * zend_API.c - zend_API.h - zend_default_classes.c: - Add property read code and use that in default exception class - -2003-08-23 Marcus Boerger - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Allow zend_throw_exception() to also set the exception code - - * zend_default_classes.c: - Exception has 4 protected default properties (message,code,file,line). - They are all initialized at c-level constructor correctly. - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Internal classes can now have default properties. - - * zend_reflection_api.c: - Show ctor/dtor information and those don't return anything - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c: - - Flag ctor/dtor methods - - Use this to prevent memleaks when an exception gets thrown in ctors. - - * zend_default_classes.c: - Make exception code more robust - -2003-08-22 Ilia Alshanetsky - - * zend_builtin_functions.c - zend_constants.h: - Replace *magic number* with a much nicer define. - - * zend_builtin_functions.c: - Set 2147483647 as the module number of user defined constants - Fixed a few bugs and cleaned up get_defined_constants(). - -2003-08-21 Marcus Boerger - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Add function 'zend_throw_exception(char *message, int duplicate - TSRMLS_DC);' - to provide an easy way to throw exceptions for extension developers. - - * zend_API.c: - If ce not given than any object would do - - * zend_API.c: - Paramspec 'O' / zend_parse_method_params(): only if given check the class - type - -2003-08-20 Zeev Suraski - - * zend_alloc.c: - adhere to silence - -2003-08-20 Marcus Boerger - - * zend_alloc.c: - Fix counting number of leaks - -2003-08-19 Wez Furlong - - * zend_execute.c: - fix build - -2003-08-18 Wez Furlong - - * zend_ini.h: - linkage for C++ - -2003-08-18 Zeev Suraski - - * ZendTS.dsp - zend_execute.c - zend_execute_locks.h: - Prevent access to internal engine functionality - - * zend.h - zend_alloc.c - zend_compile.h - zend_execute.c: - - Improve tracking - - Fix several overloading issues - - * zend_API.c - zend_alloc.h - zend_hash.c - zend_hash.h - zend_ts_hash.c - zend_ts_hash.c - zend_ts_hash.h - zend_ts_hash.h: - Improve tracking - - * zend_compile.c: - ws - -2003-08-17 Marcus Boerger - - * zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_reflection_api.c: - Fix warnings - -2003-08-17 Sascha Schumann - - * zend.h: - One bit fields need to be unsigned, otherwise there is no storage for - the sign bit - - "A signed bit field has a length of 1 bit." - - * zend_API.h: - explicitly cast size_t to zend_uint to avoid warnings on 64 bit platforms. - -2003-08-17 Marcus Boerger - - * zend_execute.c: - Remove unnecessary if - - * zend_execute.c: - Put the code where it belongs - fixes a warning and confusion - - * zend_compile.c - zend_execute.c: - Implement a TBD: JMP to the end of foreach - - * zend_compile.c: - WS - - * zend_API.c: - - Show class names in error messages when dealing with methods - - Mark class as abstract if it gets an abstract method - -2003-08-16 Marcus Boerger - - * zend_API.c - zend_API.h - zend_reflection_api.c: - Simplify abstract method declaration - - * zend_object_handlers.h: - WS - -2003-08-15 Sascha Schumann - - * zend_execute.c - zend_object_handlers.c: - Restrict scope of inline functions to compile unit - - Submitted by: Jason Greene - -2003-08-13 Marcus Boerger - - * zend_objects_API.c: - Add missing entry - - * zend_API.c: - - Show classes in case of methods - - Using sprintf here was a bad idea - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-11 Marcus Boerger - - * zend_hash.c - zend_hash.h: - Bugfix 21918 - -2003-08-11 Masaki Fujimoto - - * Zend.m4 - flex.skl - zend_compile.c - zend_globals.h - zend_highlight.c - zend_language_scanner.h - zend_language_scanner.l - zend_multibyte.c - zend_multibyte.h: - - added script encoding support to Zend Engine 2. - this enables ZE2 to gracefully parse scripts written in UTF-8 (with - BOM), - UTF-16, UTF-32, Shift_JIS, ISO-2022-JP etc... (when configured with - '--enable-zend-multibyte' and '--enable-mbstring') - -2003-08-10 Marcus Boerger - - * zend_compile.c: - Bugfix #24637 __destruct not called - -2003-08-09 Moriyoshi Koizumi - - * zend_compile.c: - Fix segfault when a referenced parameter is specified with typehint. - Result of the node will never be used because verify_instanceof handler - has - been eliminated. - -2003-08-09 Marcus Boerger - - * zend_objects.c: - Precise destructor errors - -2003-08-07 Moriyoshi Koizumi - - * tests/bug21478.phpt: - Add missing right parensis - -2003-08-07 Zeev Suraski - - * zend_execute_API.c: - Clarify use of original_function_state_ptr - -2003-08-07 Marcus Boerger - - * zend_execute_API.c: - - Fix warnings - - Fix code - -2003-08-06 Zeev Suraski - - * zend_execute_API.c: - clarify :) - -2003-08-05 Jani Taskinen - - * zend_execute_API.c: - Fix the build - -2003-08-05 Zeev Suraski - - * zend_API.h - zend_execute_API.c - zend_reflection_api.c: - Try to put an end to the endless number of call_user_function variants. - zend_call_function() now takes a structure that should contain all of the - necessary information. If further information is necessary in the future, - then we'll be able to add it without having to introduce a new function. - - As for caching - the 2nd, optional argument is a struct that can hold all - of the information that's necessary to invoke the function, including its - handler, scope and object it operates on (if any). Note that you may only - use a cache if the arguments you provide to zend_call_function() are - identical to the ones of the last call, except for the argument and return - value information. - - - The recently introduced fast_call_user_function() was removed - - I fixed most of the places that used fast_call_user_function() to use - caching - but there are still some that need to be fixed (XML and reflection) - -2003-08-05 Stanislav Malyshev - - * tests/bug24699.phpt: - fix syntax - - * zend_execute_API.c: - remove stack clean - it makes trouble - -2003-08-04 Marcus Boerger - - * zend_execute.c: - Fix ZTS - - * zend_execute_API.c: - Nuke unused variables - - * zend_reflection_api.c: - Add function/method parameter reflection - -2003-08-04 Ilia Alshanetsky - - * zend_execute_API.c - tests/bug23104.phpt: - Fixed bug #23104 (hash position of static arrays not being reset) - -2003-08-04 Stanislav Malyshev - - * zend_execute_API.c: - oops. forgot function - - * zend_execute_API.c: - fix crash #24842 - - * zend_compile.c: - fix leaks: bug #24831 - - * zend_execute.c: - use get_obj_zval_ptr - - * tests/bug24884.phpt: - add test - - * zend_execute.c: - Fix #24884 - clone $this - -2003-08-04 Zeev Suraski - - * zend_compile.c: - Simplify code using XOR - - * zend.h: - Add logical XOR, proves to be quite useful lately - - * zend_opcode.c: - This check shouldn't be necessary - -2003-08-03 Marcus Boerger - - * zend_opcode.c: - Fix crash - - * zend_compile.c: - Fix test and add missing initialization - -2003-08-03 Zeev Suraski - - * zend_API.c: - Ensure functions have a valid access level - - * zend_API.c: - Default to public - -2003-08-03 Marcus Boerger - - * zend_API.c: - Not needed, will be copied from ptr->flags later - - * zend_builtin_functions.c: - Add missing arg info - -2003-08-03 Moriyoshi Koizumi - - * tests/bug24635.phpt - tests/bug24699.phpt: - Style & WS fixes - -2003-08-03 Zeev Suraski - - * (BEFORE_ARG_INFO) - zend_API.c: - No need for this initialization - this function initializes all of the - elements of zend_internal_function - - * (BEFORE_ARG_INFO) - zend_execute.c: - Clean up. extended_value can only contain either ZEND_UNSET_DIM or - ZEND_UNSET_OBJ. - - * (BEFORE_ARG_INFO) - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c: - Generalize fetch_class - -2003-08-02 Marcus Boerger - - * zend_API.c: - Initialize all struct members: Necessary for reflection - - * zend_reflection_api.c: - Show interfaces - -2003-08-02 Wez Furlong - - * zend_API.c: - fix usage of instanceof here too - -2003-08-02 Marcus Boerger - - * zend_execute.c: - Fix warning - -2003-08-01 Wez Furlong - - * zend_API.c: - better fix... - - * zend_API.c: - Fix "O" format for zend_parse_parameters - -2003-07-31 Zeev Suraski - - * zend_API.c: - Use instanceof_function() - - * zend_compile.c - zend_execute.c: - Finish the array overloading patch - - * zend_execute.c: - Cleanup - -2003-07-31 Andi Gutmans - - * zend_hash.c: - - Fix logic. It was the wrong way around. - -2003-07-30 Andi Gutmans - - * zend_execute.c - zend_hash.c: - - Fix problem with hash when updating same bucket with data of different - sizes one after another. - - Fix number of arguments to read_dimension. - -2003-07-30 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of an opcode - - * zend_compile.c - zend_execute.c: - Support overloading of $foo["bar"] += "baz" - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve array overloading - support unset($foo["bar"]) - - * zend_compile.h: - Remove garbage - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_modules.h: - Add exec_finished() callback for modules - this is the last place where the - modules may touch the symbol table reliably - -2003-07-29 Ilia Alshanetsky - - * tests/bug22836.phpt: - Test case for bug #22836. - -2003-07-29 Jani Taskinen - - * zend.c: - Remove the obfuscation caused by the double "#ifdef ZTS" - -2003-07-27 Stanislav Malyshev - - * zend_compile.c: - fix compare - - * zend_compile.c: - use zend_binary_strncasecmp - - * zend_execute_API.c: - change shutdown order so that dtors would coexist with object error - handlers - - * zend_execute.c: - clean the right one - - * zend_execute_API.c: - make shutdown more granular so in case some dtor goes ape we still - can shut down cleanly - - * zend_compile.c - zend_execute.c - zend_objects.c: - make clone and throw coexist peacefully - - * tests/bug24635.phpt - tests/bug24699.phpt: - add test - - * zend_execute.c: - fix #24635: clean hash before putting into cache - - * zend_language_scanner.l: - fix crash #24550 - - * zend_compile.c - zend_constants.c: - fix leaks with class constants (bug #24699) - - * zend_compile.c: - make __clone call case insensitive, just as other calls are - -2003-07-24 Jani Taskinen - - * tests/bug19859.phpt - tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt - tests/bug24436.phpt: - cleanup (CS+ws) - -2003-07-24 Zeev Suraski - - * tests/bug24436.phpt: - Fix expectations :) - - * zend_execute.c: - Fix logic and comments in ASSIGN_DIM - - * zend_compile.c: - Fix another HANDLE_NUMERIC bug. Looks like you opened Pandora's box, - Sterling ;) - - * zend_builtin_functions.c: - Fix each() binary safety for keys - - * zend_execute.c: - Fix assignments to numeric array indices - - * zend_compile.c: - Remove useless code - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Support references in foreach() - Syntax: - foreach ($arr as &$val) - foreach ($arr as $key => &$val) - - * zend_execute.c: - Fix binary safety in foreach() keys (fixes bug #24783) - - * zend.c: - Make print_r() binary safe with keys - -2003-07-23 Stanislav Malyshev - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_opcode.c: - Remove namespace leftovers - -2003-07-23 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Go back to ZE1-like code - -2003-07-23 Sebastian Bergmann - - * zend_reflection_api.c: - Fix segfault. Patch by Timm Friebe . - -2003-07-22 Marcus Boerger - - * zend_hash.h: - Fix for the moment - -2003-07-22 Zeev Suraski - - * zend_execute.c - zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Improve infrastructure of numeric handling of elements in symbol tables. - - When you want to work with a symbol table, and you don't know whether you - have a numeric ("string that looks like a number") or a string element in - your hands, use zend_symtable_*() functions, in place of zend_hash_*() - functions. - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Fix isset()/empty() for non-trivial object elements - (API change - read_property now accepts an extra element) - Fixes bug #24436 - -2003-07-21 Zeev Suraski - - * zend_object_handlers.c: - Fix bug #24499 - - * zend_execute.c: - Revert fix for #24729, and refix - -2003-07-21 Marcus Boerger - - * zend_execute.c: - Go with a better fix for #24729 - -2003-07-21 George Schlossnagle - - * zend_API.h: - reverted at Andi's request. replaced with more generic wrapper. - -2003-07-20 Marcus Boerger - - * zend_execute.c: - Bugfix #24729 = new ; causes crash when is not set - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - should nt here - -2003-07-20 Marcus Boerger - - * zend_reflection_api.c: - Fix warnings and whitespace in output - - * zend_reflection_api.c: - Add support for instances in Reflection_Class. - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - removed references to smart_str, replaced with private string management - function. When snprintf is integrated into the engine, string_printf - should be altered to use that. - -2003-07-20 Marcus Boerger - - * zend_objects_API.c: - More informative errors here and these are real core errors - - * zend_execute.c: - Fix uncloneable objetcs - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - more of Timm's implementation. - -2003-07-20 Marcus Boerger - - * zend_hash.c - zend_hash.h: - Make it a macro - -2003-07-19 Marcus Boerger - - * zend_hash.c: - This is meant to be used in for(;has_more;next) - - * zend_hash.c - zend_hash.h: - Add missing function to ease implementations - -2003-07-19 Jani Taskinen - - * zend.h: - Fix the HPUX alloca fix as suggested by Sascha - -2003-07-19 Marcus Boerger - - * zend_objects.c - zend_objects.h: - Shuffle code to ease writing clone handlers - -2003-07-19 Andi Gutmans - - * zend.h: - - Don't use alloca on HP-UX (Moriyoshi Koizumi ) - -2003-07-16 Zeev Suraski - - * zend_compile.c: - Fix bug in the verification of interface-function implementation - - * zend_compile.c - zend_compile.h - zend_execute.c: - More cleanup for assign-op handling of objects - - * zend_alloc.c: - Fix warning - -2003-07-12 Andi Gutmans - - * zend_API.c: - - WS - -2003-07-11 Andi Gutmans - - * zend_API.c: - - Add support for Z in zend_parse_parameters(). It will allow the extension - - to retreive the zval **, thus allowing it to use the convert_to_*_ex() - - family of functions to do type conversions without effecting the value - in - - the engine itself. (Josh Fuhs ) - -2003-07-08 Zeev Suraski - - * zend_execute.c: - initial refactoring for assign-op handling of objects - -2003-07-07 Zeev Suraski - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Rework zend_do_declare_property and related code into one code base - - * zend_API.c: - Fix bug - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add get_dim callback - - * zend_execute.c: - Fix naming convention - -2003-07-07 Derick Rethans - - * zend_execute.c: - - Help Zeev fixing ghosts :) - -2003-07-07 Zeev Suraski - - * zend_object_handlers.c - zend_object_handlers.h: - whitespace - - * zend_objects_API.c: - Fix & whitespace - - * zend_object_handlers.c: - fixlet - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Initial support for overloading of array syntax for objects (very initial) - -2003-07-06 George Schlossnagle - - * zend_API.c - zend_API.h: - add convenience functions or adding class properties. Ok'd for commit by - Andi. - -2003-07-04 Andi Gutmans - - * zend_alloc.c - zend_mm.c - zend_mm.h: - - Add heap to memory manager. This should improve performance. - - Enabling it by default so that it gets tested. We should decide before - beta 2 if we want to revert back to malloc or not. - - Thanks to Sebastian for benchmarking it - -2003-07-04 Sebastian Bergmann - - * zend_reflection_api.c: - 2 * TSRMLS_FETCH() -> 1 * TSRMLS_DC - -2003-07-04 George Schlossnagle - - * zend_reflection_api.c: - ws fix - -2003-07-03 Marcus Boerger - - * zend_compile.c: - Allow final private methods - -2003-07-03 George Schlossnagle - - * zend_reflection_api.c: - win build fixes (Rob Richards) - - * zend_reflection_api.c: - can't forget Andrei - -2003-07-03 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: - enable Classname() constructor to be called via parent::__constructor() - - * tests/bug19859.phpt: - add test for Bug #19859 - - * zend_API.c - zend_execute_API.c: - Fix bug #19859 - allow fast_call_user_function to support __call - - * zend_builtin_functions.c: - fix the get_parent_class fix - -2003-07-03 George Schlossnagle - - * zend_reflection_api.c: - more of Timm's patches, and mod authors line to give credit where credit is - due. - -2003-07-02 Marcus Boerger - - * zend_objects.c: - Temporairy solution to overcome shutdown propbelms with objects that have - hidden destructors. - - * zend_objects.c: - Reorganize this a bit to ensure the object memory is destructed before - showing the error. - - * zend_builtin_functions.c: - Bug #24399: is_subclass_of(): fix memleak, too - -2003-07-02 Zeev Suraski - - * zend_execute.c: - Throughly fix scoping change. Fixes, among other things, bug #24403 - -2003-07-02 Andi Gutmans - - * zend_compile.c - zend_globals.h: - - Nuke CG(in_clone_method) - -2003-07-02 Zeev Suraski - - * zend_execute.c: - Fix for bug #22367. - Heads up - this will break syntactical compatiblity, return($foo) will - not work with functions that return references - return $foo should be - used - instead. It never worked well before, and caused all sorts of odd bugs. - It *might* be possible to support this specifically, albeit unlikely - -2003-07-02 Sterling Hughes - - * zend_execute_API.c: - optimize the case where the object is really a class name, as we don't need - to set EX(object) here. - - * zend_execute_API.c: - Timm Friebe points out that object detection should be done regardless of - the function pointer - -2003-07-02 Marcus Boerger - - * zend_objects.c: - Finally fix property cloning and fix the tests accordingly. - - -2003-07-02 Sterling Hughes - - * zend_builtin_functions.c: - Fix bug #24445 - -2003-07-01 Marcus Boerger - - * zend_objects.c: - Fix __clone(). - - - * tests/bug20240.phpt: - Use both destructor and shutdown - - * zend_execute_API.c: - small bugfix - - * tests/bug24436.php - tests/bug24436.phpt: - Rename test to correct extension - - * zend_execute.c: - __clone might not be defined - - * zend_execute.c: - Fix __clone visibility - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.c: - Fix destructor visibility - -2003-07-01 Derick Rethans - - * tests/bug24436.php: - - Added test for bug #24436 - -2003-07-01 George Schlossnagle - - * zend_reflection_api.c: - Timm Friebe's patches for code celanup and additional functions. - -2003-07-01 Jani Taskinen - - * tests/.cvsignore - tests/bug21478.phpt - tests/zend2.php - tests/zend2.php.txt: - Missing .cvsignore, broken test, renamed zend2.php -> zend2.php.txt - -2003-07-01 Sebastian Bergmann - - * zend_reflection_api.c: - ZTS fixes. - -2003-07-01 George Schlossnagle - - * zend_reflection_api.c: - more incremental changes. add anything that needs a class factory. - - * zend_reflection_api.c: - all the easy parts of Reflection_Class - -2003-06-30 Shane Caraveo - - * zend_operators.h: - this fixes including this header in a c++ file (vs6) - -2003-06-30 Sterling Hughes - - * zend_compile.c: - nuke "main" as a reserved keyword - -2003-06-30 Andi Gutmans - - * zend.c - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_mm.c - zend_opcode.c - zend_reflection_api.c: - - ZE coding style requires if ( instead of if( - -2003-06-30 Sebastian Bergmann - - * zend_reflection_api.c: - ZTS fixes. Remove unused local variables. - -2003-06-30 George Schlossnagle - - * Makefile.am - Zend.dsp - ZendTS.dsp - zend_default_classes.c - zend_reflection_api.c - zend_reflection_api.h: - added support for Reflection_Function, the first part of - the reflection api - -2003-06-30 Sterling Hughes - - * zend_builtin_functions.c: - move the check down a little so it catches all cases - - * zend_builtin_functions.c: - Fix bug #24399 from an excellent test case by edin - -2003-06-30 Zeev Suraski - - * zend_execute.c: - Semantically it's a refcount increase, not a lock... - - * zend_execute.c: - Fix 'global' implementation (fixes, at least, bug #24396 - -2003-06-30 Sterling Hughes - - * zend_operators.c: - revert back the optimization for now. - -2003-06-29 Ilia Alshanetsky - - * zend_object_handlers.c: - Fixed bug #24279 (__get() crash when no value is returned) - -2003-06-29 Sebastian Bergmann - - * ZEND_CHANGES: - Remove namespace references. - -2003-06-29 Sterling Hughes - - * zend_operators.c: - Very simple, but very effective optimization. Provides a signifigant speed - improvement to matches done via '=='. This checks that the lengths of two - strings are equal before performing a memcmp() on them. - -2003-06-23 Zeev Suraski - - * zend_execute.c: - Fix crash :) - -2003-06-23 Stanislav Malyshev - - * zend_execute.c: - FIx leak - -2003-06-22 Zeev Suraski - - * zend_execute.c - zend_language_parser.y: - Fix complex expressions for class names in NEW - - * zend_language_parser.y: - Simplify - -2003-06-21 Marcus Boerger - - * zend_language_parser.y: - WS - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Add final classes - -2003-06-16 Stanislav Malyshev - - * zend_execute.c: - no need to init zval - assignment will init - - * zend_execute.c: - Fix bug #22592 - cascading assignments to string offsets - - * zend_constants.c: - support for self:: and parent:: constants - - * zend_builtin_functions.c: - fix lambda function static vars (related to #17115) - -2003-06-15 Sebastian Bergmann - - * zend_constants.c: - Fix ZTS build. - -2003-06-15 Stanislav Malyshev - - * zend.c: - Fix bug #23279 - exception handler exits after first function call - - * zend_execute_API.c: - No need to duplicate code - zend_get_constant() knows to - handle class constants now - - * zend_execute_API.c: - Fix bug #18872 - Improper handling of class constants used as default - function argument values - - * zend_constants.c: - set ending \0 for string - - * zend_compile.c - zend_constants.c - zend_language_parser.y: - Fix bug #23384 - static class::constant constants should now - work in static & array expressions. - - * zend_execute_API.c: - Fix bug #21800 - initialize opcode handlers in interactive mode - -2003-06-14 Marcus Boerger - - * zend_hash.c: - ecalloc doesn't return NULL - - * zend.c: - Bugfix #24182: va_arg macro error in Zend/zend.c - -2003-06-10 Jani Taskinen - - * zend_multiply.h: - - Missing $Id$ tag - -2003-06-10 James Cox - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - updating license information in the headers. - -2003-06-09 Wez Furlong - - * zend_execute_API.c: - Fix for Bug #23951 - -2003-06-09 Stanislav Malyshev - - * zend_execute.c: - remove NS leftover - -2003-06-09 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix bogus implicit declarations of properties (squash bug #23671) - -2003-06-09 Stanislav Malyshev - - * zend_API.c - zend_execute_API.c: - Support 'self' and 'parent' in call_user_func() - -2003-06-09 Zeev Suraski - - * zend_execute.c: - Fix indirect reference calls to bogus function names - -2003-06-09 Jani Taskinen - - * zend_builtin_functions.c: - ws - -2003-06-08 Zeev Suraski - - * zend_object_handlers.c: - Fix casing issues in access level checks - - * zend.c - zend_compile.c - zend_compile.h: - Nicer handling of protected/private members in print_r() - - * zend_execute.c: - Fix handling of object property assignments in switch expressions - (bug #23925) - - * zend_builtin_functions.c: - Fix set_error_handler() - -2003-06-06 Sascha Schumann - - * zend_multiply.h: - mfb #24025 fix - -2003-06-04 Stanislav Malyshev - - * zend.c: - fix non-ZTS build - -2003-06-04 Sebastian Bergmann - - * zend.c: - Fix segfault. Again. - -2003-06-04 Stanislav Malyshev - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - rm namespace leftovers - -2003-06-04 Sebastian Bergmann - - * zend.c: - Fix segfault. #Hopefully not a Voodoo Fix[TM]. - -2003-06-02 Sebastian Bergmann - - * zend.c - zend_execute.h: - Leftover. - -2003-06-02 Stanislav Malyshev - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_object_handlers.c - zend_opcode.c: - MEGA-patch: namespaces are R.I.P. - -2003-06-01 Marcus Boerger - - * tests/zend2.php: - No nested classes - - * tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt: - Add some ZE2 bug tests - - * zend_opcode.c: - Bugfix #23670: implements and extends cause Apache 2 crash - - * zend_constants.c: - Do it correct always - - * zend_compile.h: - Defining it once is enough - -2003-05-31 Marcus Boerger - - * zend.c: - Fix init shutdown - -2003-05-31 Sterling Hughes - - * zend_compile.c - zend_execute.c: - revert the function call caching patch until a new solution is decided - upon. - -2003-05-31 Marcus Boerger - - * zend_constants.c: - Fix constants (noticed by David Brown ) - - * zend_constants.c: - c->name_len already contains the '\0' - -2003-05-30 Stanislav Malyshev - - * zend_execute.c: - fix crash on exceptions when return value of the inside function is used - -2003-05-29 Marcus Boerger - - * zend_compile.c - zend_language_parser.y: - Fix ~ operator in class constants. - - * zend_compile.c - zend_compile.h - zend_operators.c: - Faster interface inheritance & faster inheritance checks - - * zend_language_scanner.l: - CS - -2003-05-29 Wez Furlong - - * zend_compile.c: - Fix Bug #23285 (Potential Stack Overflow in zendlex). - -2003-05-28 Sterling Hughes - - * zend_alloc.c: - no reason to do this at runtime - - * zend_compile.c - zend_execute.c: - Cache function call lookups with loops (store in a temporary variable on - the - result opline). - Assuming lazy concensus on message that GeorgeS sent to the list last week - -2003-05-27 Sterling Hughes - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - Assume lazy consensus regarding the cast_object() patch. *Only* - implemented - from a internals perspective. This callback has been very useful for both - ext/mono and ext/simplexml - -2003-05-26 Marcus Boerger - - * zend_language_scanner.l: - Add pseudo constant __METHOD__ to easily report namespace::class::method. - - -2003-05-23 Marcus Boerger - - * zend_API.h: - Revert to sizeof() - -2003-05-23 Sterling Hughes - - * zend_execute.c - zend_hash.c - zend_operators.c - zend_operators.h: - move HANDLE_NUMERIC() from the hash table implementation upstream to the - places that actually need to use it. - -2003-05-22 Marcus Boerger - - * zend_execute.c: - No need to copy here unless implicit_clone is active (noticed by rob) - -2003-05-21 Marcus Boerger - - * zend_API.c - zend_builtin_functions.c - zend_constants.c - zend_object_handlers.c: - Make use optimized string lowering - - * zend_operators.c - zend_operators.h: - Use same parameter order as strcpy() - - * zend_API.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h: - Make zend_str_tolower_copy() a copy function (like stccpy). - Supply a dup version (like estrdup). - Fix tolower() handling. - -2003-05-21 Jani Taskinen - - * zend_builtin_functions.c: - Fixed bug #23619 (set_error_handler() registered handler not called for - object instances). (Jani, waboring@qualys.com) - -2003-05-21 Sterling Hughes - - * zend_operators.c: - optimize loops. The check only exists for integers because that's the more - common optimization, and you actually lose performance if you check for - a double too (wierd but true). - - * zend_mm.h: - add some logic to detect zend_mm, which is really only useful when thread - safety support is enabled. - - * zend_mm.h: - leave this off until its more ready/stable - php5 actually beats php4.3.* in my benchmarks now - - - * zend_API.c: - use zend_str_tolower_copy() - - * zend_execute.c: - Bottom drawer optimization to avoid this comparison, but this OP is - executed - quite often (all of the fetch_* ops) - -2003-05-20 Sterling Hughes - - * zend_operators.c: - bah humbug, use the pointer based version, which turns out to be an - instruction - faster - - * zend_operators.c: - use pointer arithmetic for the normal zend_str_tolower() - -2003-05-20 Marcus Boerger - - * zend_execute.c: - No need to copy the zval unless __clone() is called - -2003-05-20 Sterling Hughes - - * zend_operators.c: - make this faster and sexier - - * zend_execute.c: - use the new zend_str_tolower_copy() function - - * zend_operators.c: - doesn't need to be register - - * zend_execute_API.c - zend_operators.c - zend_operators.h: - optimize the lookups by avoiding a copy and then another pass - - Naked Dancing Girls should be given to: Myself, Zeev, Marcus, - and George Schlossnagle (in no particular order) - - * zend_API.h - zend_execute_API.c: - add fast_call_user_function() - -2003-05-20 Hartmut Holzgraefe - - * zend_API.h - zend_constants.h - zend_operators.h: - C++ compile fixes - -2003-05-19 Marcus Boerger - - * zend_execute.c: - Fix exception memleak - -2003-05-19 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: - fix __clone - -2003-05-12 Marcus Boerger - - * zend_execute_API.c: - One function call is enough - -2003-05-08 Marcus Boerger - - * zend_compile.c: - Inheritance fix - -2003-05-07 Edin Kadribasic - - * zend_compile.c: - Reverting Marcus' incomplete patch which broke the build. - -2003-05-07 Marcus Boerger - - * zend_compile.c: - Inheritance fixes - -2003-05-04 Marcus Boerger - - * zend_API.c: - Fix namespace issue: Only CG is needed here - - * zend_API.c - zend_API.h: - Allow functions in internal namespaces (for example factories) - - * zend_execute.c: - Modify the abstract error message so that it shows up to three methods not - implemented. - - * zend_execute.c: - Fix warnings - - * zend_compile.c: - Don't inherit twice what is needed only once - - * zend.c: - Fix bug #23162 user_error() crashs if > 1024 bytes (Marcus, Moriyoshi) - -2003-05-04 Sterling Hughes - - * zend_default_classes.h: - semicolon - -2003-05-03 Sterling Hughes - - * zend_default_classes.h: - proto - - * zend_default_classes.c: - add an accessor for the default exception - -2003-04-29 Sascha Schumann - - * zend_multiply.h: - Fix the *= operator - - Slightly modified patch by Wez Furlong - -2003-04-25 Jani Taskinen - - * zend_language_scanner.l: - Fixed bug #21820 ("$arr[foo]" generates bogus E_NOTICE, should be E_PARSE) - -2003-04-24 Sascha Schumann - - * zend_alloc.c - zend_alloc.h - zend_multiply.h: - add safe_emalloc - -2003-04-21 Stanislav Malyshev - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - Change get_class() so that it returns qualified names for namespaced - classes. - - *HEADS UP*: get_class_name() handler interface is changed, now it should - allocate the space it returns with emalloc, and the users free it. If - anyone has problems with it or has suggestions how to do it without this - - please tell. - - Also: make function_exists() understand namespaces. - - * zend_execute.c: - make import * fail if such classes or functions already there - -2003-04-20 Sterling Hughes - - * zend_compile.c: - Add check for final properties - -2003-04-20 Stanislav Malyshev - - * zend_execute_API.c: - Check name before '::' so that it would be a namespace in - zend_lookup_ns_class - - * zend_builtin_functions.c: - refine the set_error_handler fix - - * zend_builtin_functions.c: - Fix for bug #21094 (set_error_handler can not accept methods), - by Timm Friebe - -2003-04-19 Sebastian Bergmann - - * zend.c: - Corrected patch by Marcus Börger . - -2003-04-18 Sterling Hughes - - * zend.c - zend_opcode.c: - Patch by Marcus Börger to fix some memleaks - -2003-04-18 Derick Rethans - - * zend.h - zend_extensions.c: - - Revert my symbol fix patch, and merge in Stas' fixes to Zend Engine 1. - - * zend.h: - - MacOSX also prepends the _ before symbols in bundles - -2003-04-17 Sebastian Bergmann - - * zend.c: - Patch by Marcus Börger . - -2003-04-11 Sebastian Bergmann - - * zend_compile.c - zend_compile.h: - Fix warnings. - -2003-04-10 Sterling Hughes - - * zend_compile.c: - satisfy andi's switch fetish ;-) - -2003-04-10 Sebastian Bergmann - - * zend_compile.c: - Fix ZTS build. Fix warning. - - * ZEND_CHANGES: - Document 'const' keyword. - -2003-04-10 Sterling Hughes - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - allow expressions within constants, so the following is possible - - class foo { - const a = 1<<0; - const b = 1<<1; - const c = a | b; - } - - this makes const a compile-time expression. all other operators are - unaffected. - -2003-04-10 Zeev Suraski - - * zend_language_parser.y - zend_language_scanner.l: - Revert Harald's commit - -2003-04-10 George Schlossnagle - - * zend_language_parser.y: - One line fix so that it will compile - -2003-04-09 Harald Radi - - * zend_language_parser.y - zend_language_scanner.l: - removing the *syntactical sugar* again - - -2003-04-08 Andrei Zmievski - - * zend_builtin_functions.c: - Switch some functions to use new zend_lookup_ns_class() methods. This - means that they will accept both simple and fully qualified class names. - - * zend_API.c - zend_API.h: - Rename zend_register_internal_class_in_ns() to a better, less filling, - but with the same great taste zend_register_internal_ns_class(). - - * zend_execute.h - zend_execute_API.c: - Add zend_lookup_ns_class() function. - - * zend_operators.h: - Move memnstr into Zend and make an alias for BC in PHP. - -2003-04-07 Jani Taskinen - - * zend_language_scanner.l: - Fixed bug #23093 (highlight_string() crashed with __FUNCTION__) - -2003-04-07 Sterling Hughes - - * zend_compile.h: - add markers that make this file easy to parse for external sources - -2003-04-04 Andrei Zmievski - - * zend_API.h: - Introduce ZEND_ME() and ZEND_METHOD() macros. Use these for declaring - class methods to avoid name collisions. - -2003-04-04 Stanislav Malyshev - - * zend_API.c - zend_API.h: - Fix namespace issues - -2003-04-03 Andrei Zmievski - - * zend_API.c: - Patch from Timm Friede for when EG(active_namespace) is NULL initially. - - * zend.c - zend_API.c - zend_compile.c: - Initialize all relevant zend_class_entry fields to avoid accidental - crashes. - -2003-04-03 Sebastian Bergmann - - * zend_list.c: - Leftover. - -2003-04-03 Sterling Hughes - - * zend_list.c - zend_list.h: - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - -2003-04-02 Andrei Zmievski - - * zend_API.c - zend_API.h: - - Add zend_register_internal_namespace() API function. - - Add zend_register_internal_class_in_ns() API function. - - * zend_compile.h: - Simplify. - -2003-04-02 Derick Rethans - - * zend_list.c: - - Fix whitespace - -2003-04-02 Sterling Hughes - - * zend_list.c - zend_list.h: - add the ability for curl_multi_info to introspect the handles. - - -2003-04-02 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Implement a different way to catch documentation comments. - - * zend_compile.c - zend_compile.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - Revert portions of the doc comment patch. There should be no parser - errors now. - -2003-04-02 Stanislav Malyshev - - * zend_builtin_functions.c - zend_compile.h - zend_execute.c: - allow class_exists() to work with namespaces too. - add CLASS_IS_NAMESPACE macro - - * zend_builtin_functions.c: - fix typo - - * zend_builtin_functions.c: - fix parameterless get_declared_classes call - -2003-04-01 Andrei Zmievski - - * zend_execute.c: - Stas's patch on zend_execute.c (1.448 -> 1.449) resulted in a bug where - the namespaced member accesses didn't work. This should hopefully - correct it. - - * zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_opcode.c: - Split ZEND_NAMESPACE into user and internal namespaces. Hope this is - okay with engine folks. - -2003-04-01 Stanislav Malyshev - - * zend_builtin_functions.c: - improve namespace name hanfling - - * zend_builtin_functions.c: - fix get_declared_classes() - - * zend_language_parser.y - zend_language_scanner.l: - Add __NAMESPACE__ auto-constant. - - * zend_builtin_functions.c: - make get_declared_classes() work with namespaces (based on Tal Peer's - patch) - -2003-03-31 Andrei Zmievski - - * zend.h - zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Multi-purpose patch: - - The fields of zend_namespace were not completely initialized which - led to a variety of problems. - - The occurrence of class/interface/namespace definition is now - captured. - - Functions/classes/interfaces/namespaces can be preceded by doc - comments which are stored for use by extensions. - -2003-03-31 Stanislav Malyshev - - * zend.c: - Use strncpy instead of sprintf - -2003-03-30 Andrei Zmievski - - * zend_language_parser.y: - Since zend_do_begin_class_member_function_call assumes the previous - opcode is FETCH_CONSTANT, swap the calls around. - -2003-03-30 Sebastian Bergmann - - * zend_execute.c: - ZTS fix. - -2003-03-30 Stanislav Malyshev - - * zend.c: - Try to report class name of the exception - - * zend_execute.c: - Fix namespace switch - -2003-03-29 Zeev Suraski - - * zend_compile.c: - Add missing initialization - - * zend_compile.c: - Fix crash - - * zend_API.c - zend_compile.c - zend_compile.h: - Initial support for enforcing prototype of abstract/interface method - implementations - -2003-03-29 Sterling Hughes - - * zend.c: - remove unused variable - -2003-03-27 Stanislav Malyshev - - * zend_execute.c: - fix fetch_class buglet - -2003-03-26 Stanislav Malyshev - - * zend_execute.c - zend_language_parser.y: - Un-nest namespaces - now namespace X { namespace Y {} } is a parse error - Also refine namespaced includes - -2003-03-26 Ilia Alshanetsky - - * zend_compile.c: - Fixed bug #22900 (declaration of namespaces with same name results in - leaks). - -2003-03-26 Sebastian Bergmann - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - Eliminate TSRMLS_FETCH() calls in destroy_op_array() and - zend_get_class_entry(). - - * zend_API.c - zend_object_handlers.c - zend_objects.c - zend_objects.h: - Eliminate TSRMLS_FETCH() calls in zend_objects_new() and - zend_objects_get_address(). - -2003-03-25 Andi Gutmans - - * zend_compile.c: - - Temporarily fix problem with inheriting from an internal class. This - might - - need some rework in the future (thanks to Marcus) - -2003-03-24 Stanislav Malyshev - - * zend_execute.c: - Fix {include|require}_once error message - if open - fails, don't use tream, use original name. - -2003-03-23 Andi Gutmans - - * zend.c: - - Fix win32 build - -2003-03-23 Stanislav Malyshev - - * zend.c: - resore namespace on shutdown - since some functions use - EG() and CG() pointers - -2003-03-23 Sebastian Bergmann - - * zend_default_classes.c: - ZTS fix. - -2003-03-23 Zeev Suraski - - * zend_compile.c: - Another fix for implicit public, perhaps it was not such a good idea :I - -2003-03-23 Sebastian Bergmann - - * Zend.dsp - ZendTS.dsp - zend_default_classes.c: - Add new files to ZendTS.dsp. Sync list of files in Zend.dsp with - ZendTS.dsp. ZTS fixes. - -2003-03-23 Sterling Hughes - - * zend_default_classes.h: - DEFAULT_CLASSES_H not DEFAULT_INTERFACES_H - - * Makefile.am - zend.c - zend_default_classes.c - zend_default_classes.h: - add a standard Exception class. - -2003-03-22 Shane Caraveo - - * zend_compile.h: - export functions needed by cli - - * zend_language_scanner.l: - fix crash in win32 debug build - -2003-03-20 Stanislav Malyshev - - * Zend.m4: - Add stdlib.h too - it is needed fot strto{ld} - -2003-03-19 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - - Keep track of starting/ending line numbers for user functions. - - Store last parsed doc comment in a compiler global for future use. - - * zend_API.c: - Lowercase the function name when used as key in the function name. The - original case is still preserved in zend_function structure. - -2003-03-18 Zeev Suraski - - * zend_compile.c - zend_object_handlers.c: - - Fix situation where a derived class declares a public (or implicit - public) - with the same name as a private in the parent - - Optimize 'static binding' of private properties a bit - -2003-03-18 Stig Bakken - - * RFCs/002.txt: - - email address change - -2003-03-17 Stanislav Malyshev - - * zend_extensions.c: - MFZE1 - -2003-03-17 Jani Taskinen - - * Makefile.am: - Added missing zend_mm.c file and renamed zend_object_API.c -> - zend_objects_API.c - -2003-03-13 Andrei Zmievski - - * zend_API.c: - Fix warning in va_start(). - -2003-03-12 Andrei Zmievski - - * zend_API.c: - Initialize the namespace when registering functions. - -2003-03-12 Zeev Suraski - - * zend_compile.c: - Fix a crash bug in the implicit public declaration - -2003-03-11 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Fix handling of ::func() - -2003-03-10 Zeev Suraski - - * zend_compile.c: - Clean redundant code - -2003-03-10 Jani Taskinen - - * zend_compile.c: - Fixed some leaks. Patch by Moriyoshi - -2003-03-10 Shane Caraveo - - * zend_config.w32.h: - fix isinf for win32 - -2003-03-09 Zeev Suraski - - * zend_language_parser.y: - Optimize - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix handling of ::foo - - * zend_compile.c: - Cleanup - -2003-03-09 Andi Gutmans - - * zend_language_scanner.l: - - Nuke junk - -2003-03-09 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix parsing rules of namespaces/classes - - * zend_language_parser.y: - Add ability to use ::interface_name in implements - - * zend_compile.c: - Fix :: handling - -2003-03-07 Sebastian Bergmann - - * ZEND_CHANGES: - Dedicated to Greg Beaver . - - * ZEND_CHANGES: - Document 'final'. - - * ZEND_CHANGES: - Fix class type hints example. - - * ZEND_CHANGES: - Update 'abstract' section. - -2003-03-07 Jani Taskinen - - * zend_ini.c - zend_ini.h: - Renamed OnUpdateInt -> OnUpdateLong to prevent further misunderstandings. - - * zend_execute.c: - Better fix for the memleaks (bug 19943) by Moriyoshi - -2003-03-06 Zeev Suraski - - * zend_compile.c - zend_execute.c: - Fix warnings - - * zend_execute.c: - Fix error message - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Require abstract classes to be explicitly declared 'abstract', in order to - avoid making developers traverse the entire class/interface hierarchy - before they can figure out whether a class is instantiable - (ok, so it makes sense :) - -2003-03-06 Sebastian Bergmann - - * ZEND_CHANGES: - -german+english+. - - * ZEND_CHANGES: - D some TBDs - -2003-03-06 Jani Taskinen - - * zend_execute.c: - Fixed bug #19943 (the memleaks) - -2003-03-06 Ilia Alshanetsky - - * zend_highlight.c: - More cleanup of the zend_strip() function. - No longer strip __LINE__, since while it may become useless it could break - code where __LINE__ is passed as a function parameter. - - * zend_highlight.c: - Fixed in zend_strip() that corrupted heredoc. - Optimized the writing routine by moving from putchar() to fwrite(). - Changed hardcoded opcode # to it's defined name. - -2003-03-06 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Change opcode name - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Add class type hints - -2003-03-05 Zeev Suraski - - * zend_compile.c: - Fix auto globals - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Implement $obj::static_func() - - * zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c - zend_operators.c - zend_operators.h: - Add support for interfaces - -2003-03-04 Zeev Suraski - - * zend_compile.c - zend_language_parser.y: - Remove legacy code - - * zend_compile.c: - Remove redundant code - -2003-03-03 Harald Radi - - * zend_API.c: - add missing strtolower - - * zend_API.c - zend_API.h: - commiting zend_disable_class patch for George: - disabled classes will be replaced by dummy classes - that print a warning upon instanciation - -2003-03-02 Zeev Suraski - - * zend_execute_API.c: - Fix destructors some more - - * zend_compile.c - zend_compile.h: - Improve infrastructure - - * zend.c - zend_compile.c - zend_compile.h: - Add infrastructure for JIT initialization of auto globals - -2003-03-01 Zeev Suraski - - * zend_compile.c: - Fix mem leak - -2003-03-01 Andi Gutmans - - * zend_compile.c: - - Make __construct() have higher priority than class name functions - - for constructors. - - Fix problem with the engine allowing final/abstract for the same method. - - Both patches are by Marcus Börger. - -2003-02-27 Rasmus Lerdorf - - * zend_ini_scanner.l: - MFB: We know ini file scanning will never be interactive, so speed it up a - bit. Need a dynamic check for the language scanner. - -2003-02-26 Sebastian Bergmann - - * ZEND_CHANGES: - Syntactic sugar is sweet. - -2003-02-25 Zeev Suraski - - * zend_compile.c: - Get the bits right - final/private fix - -2003-02-25 Jani Taskinen - - * acconfig.h: - Do not redefine zend_isnan if it is already defined. - - * Zend.m4: - - Fixed bug #14245 ('make install' fails on AIX when using --with-apxs). - -2003-02-24 Stanislav Malyshev - - * zend_compile.c: - fix exception handling - -2003-02-24 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l: - Add 'final' - -2003-02-24 Sebastian Bergmann - - * ZEND_CHANGES: - Remove obsolete not on redeclaring protected members. - - * ZEND_CHANGES: - Leftover. - - * ZEND_CHANGES: - Initial documentation of namespace {}. - -2003-02-23 Zeev Suraski - - * zend_compile.c: - Move abstract inheritance logic to the right spot - - * zend_compile.c: - Fixed abstract handling in inheritence - -2003-02-20 Wez Furlong - - * zend_stream.c: - -cough* - Fix another stupid mistake. - -2003-02-20 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Allow namespaces to have a number of parts. I.e., now you can do: - namespace foo { - function abc() {} - } - ... - namespace foo { - functio def() {} - } - -2003-02-19 Wez Furlong - - * zend_stream.c: - Fix stupid mistake that only affected interactive mode. - -2003-02-18 Rasmus Lerdorf - - * zend_stream.c: - fileno() needs a FILE * here, and at least on FreeBSD with gcc-2.95.3 - it is unable to figure out that this is indeed a FILE * and hence it - won't compile without this cast. - -2003-02-18 Zeev Suraski - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_scanner.l - zend_opcode.c: - Avoid using a C++ reserved word - -2003-02-18 Wez Furlong - - * ZendTS.dsp - flex.skl: - Fixup build for win32 - - * Makefile.am - flex.skl - zend.c - zend.h - zend_compile.h - zend_execute.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l - zend_stream.c - zend_stream.h: - Implement simple stream support in the ZE scanners. - -2003-02-17 Zeev Suraski - - * zend_language_parser.y: - Whitespace & minor renames - - * zend_language_parser.y: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve handling of static member variables - - * zend_config.w32.h - zend_ini_parser.y: - Improve Win32 build performance - -2003-02-16 Zeev Suraski - - * zend_execute.c: - Fix complex cases of self-assignments (bugs #21600, #22231) - - * zend_execute.c: - Make EG(This) and EG(scope) available to internal methods - - * zend_execute.c: - Revert patches - they weren't ready yet! - - * zend.c: - Fix initialization - -2003-02-16 Georg Richter - - * zend_execute.c: - fixed compiler warning - - * zend_execute.c: - tested patch from Zeev (fixes oo-bug in ext/mysqli) - -2003-02-16 Stanislav Malyshev - - * zend_compile.c - zend_language_parser.y: - add support for ::foo syntax meaning "global one" - - * zend_compile.c: - remove debug prints - -2003-02-16 Sebastian Bergmann - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - ZTS fixes - -2003-02-16 Stanislav Malyshev - - * zend_object_handlers.c: - namespace patch - static variable access - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Namespace patch. Big changes: - 1. Nested classes are gone. - 2. New syntax for namespaces: - namespace foo { - class X { ... } - function bar { ... } - var x = 1; - const ZZ = 2; - } - 3. Namespaced symbol access: $x = new foo::X; - etc. - For now, namespaces are case insensitive, just like classes. - Also, there can be no global class and namespace with the same name - (to avoid ambiguities in :: resolution). - -2003-02-15 Ilia Alshanetsky - - * zend_ini_scanner.l: - Added feature #19645 (ini parser can now handle quoted multi-line values). - -2003-02-14 Thies C. Arntzen - - * zend_execute_API.c: - init current_execute_data befor we start executing - - * Makefile.am: - ups - - * Makefile.am: - add really nice dump_bt function for debugging in gdb - -2003-02-13 Zeev Suraski - - * zend_object_handlers.c: - Fix error handling in illegal property access - -2003-02-13 Harald Radi - - * zend_language_scanner.l: - MFB PHP_4_3 - -2003-02-12 Ilia Alshanetsky - - * zend_API.c - zend_API.h: - Removed zend_get_module(), this function is not used by anything and more - importantly. it does not work. It tries to find data based on numeric keys - in hash table using string keys. - -2003-02-12 Zeev Suraski - - * zend_compile.c: - Fix declaration of class members that don't have an explicit access - modifier - -2003-02-11 Zeev Suraski - - * zend_compile.c: - Fix require() handling - that's an old bug! - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Improve parser handling of 'abstract' - -2003-02-10 Zeev Suraski - - * zend_compile.c: - Fix zend_initialize_class_data() - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h: - Centralize class initialization - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Treat $this->foo inside class X as an implicit 'public $foo' if X::$foo - is not explicitly declared - - Forbid multiple declaration of the same variable - - * zend_execute.c: - whitespace - - * zend_API.c - zend_compile.c: - Add missing destructors - -2003-02-10 Stanislav Malyshev - - * zend_object_handlers.c: - update static constants too - -2003-02-10 Zeev Suraski - - * zend_builtin_functions.c: - Fix get_parent_class() - - * zend_object_handlers.c: - Restore missing check - - * zend_execute.c - zend_execute_API.c: - Add ability to reference self:: and parent:: in constant initializers - (bug #21849) - - * zend_execute.c: - Remove redundant code - -2003-02-09 Zeev Suraski - - * zend_execute.c: - Fix the array() problem (and probably some other problems too) - -2003-02-08 Georg Richter - - * zend_API.c - zend_API.h: - fixed zend_parse_method_param - -2003-02-08 Sebastian Bergmann - - * zend_builtin_functions.c: - zend_config.h (and its Win32 version) is already included by zend.h - -2003-02-08 Ilia Alshanetsky - - * zend_builtin_functions.c: - The string.h is already available through zend.h, so the manual inclusion - is not necessary. - -2003-02-07 Ilia Alshanetsky - - * zend_builtin_functions.c: - Added a check to ensure that string.h is available before trying to use it. - - Thanks Andi. - - * zend_builtin_functions.c: - Added missing header. - -2003-02-07 Zeev Suraski - - * zend_globals.h - zend_object_handlers.c: - Improve PPP handling of properties - - * zend_config.w32.h: - Better fix - - * zend_config.w32.h: - Fix Windows build - -2003-02-07 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #15734 (Added an optional parameter to get_defined_constants(), - which if passed, will include information regarding who created the - constant). - -2003-02-06 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #19506 (get_extension_funcs() can now retrieve a list of built-in - Zend Engine functions, if "zend" is specified as the module name). - Made get_extension_funcs() on failure. - -2003-02-06 Zeev Suraski - - * zend_compile.c: - Fix the 2nd buglet in the error message :) - - * zend_object_handlers.c: - Fix check - - * zend_hash.c - zend_hash.h: - Fix prototype (may have caused stack corruption) - -2003-02-05 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - - read_property cleanup - - Implement unset/isset/empty for PPP - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_opcode.c: - Rework static class properties - now supports access restrictions - - * zend_hash.c - zend_hash.h: - Add quick_exists() - - * zend_object_handlers.c: - Add PPP support for arrays - - * zend_compile.c: - Fix buglet in error message - -2003-02-04 Zeev Suraski - - * zend_object_handlers.c: - Missing update - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_object_handlers.c - zend_opcode.c - zend_ts_hash.c - zend_ts_hash.h: - Reimplement PPP properties - -2003-02-03 Sebastian Bergmann - - * zend_API.h: - Build fix. - -2003-02-02 Harald Radi - - * zend_API.c - zend_API.h: - extend the parameter parsing API by two functions - for parsing method parameters with automatic - detection if the function was called as such or as - a class method (with a valid this ptr). - if called as a function the first parameter has to be - the object it is operating on, if called as a method - this is used. - - -2003-02-02 Zeev Suraski - - * zend.h - zend_operators.h: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Core rearrangements - move Zend Objects specific code to their - specific implementation file - -2003-02-02 Andi Gutmans - - * zend_compile.c: - - Fix warning - -2003-02-01 Sebastian Bergmann - - * zend_ini_scanner.l - zend_language_scanner.l: - Fix build. - -2003-02-01 Jani Taskinen - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Added some missing CVS $Id$ tags, headers and footers. - -2003-01-30 Ilia Alshanetsky - - * zend_operators.c: - Fixed compiler warning regarding signed/unsigned int comparisons. - -2003-01-30 Harald Radi - - * zend_ts_hash.c - zend_ts_hash.h: - fix non-zts build for wez - -2003-01-30 Ilia Alshanetsky - - * zend_execute_API.c: - Fix ZTS build. - -2003-01-29 Stanislav Malyshev - - * zend_compile.h - zend_execute_API.c - zend_opcode.c: - Add additional stage to post-session cleanup. - We need separate cleanup stage because of the following problem: - Suppose we destroy class X, which destroys function table, - and in function table we have function foo() that has static $bar. Now if - object of class X was assigned to $bar, its destructor will be called and - will - fail since X's function table is in mid-destruction. - So we want first of all to clean up all data and then move to tables - destruction. - Note that only run-time accessed data need to be cleaned up, pre-defined - data can not contain objects and thus are not probelmatic. - -2003-01-29 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Code rearrangements - -2003-01-29 Stanislav Malyshev - - * zend_execute_API.c: - Fix object destructors: - zend_objects_store_call_destructors is not used anymore, we rely on - symbol tables cleaners to destroy all objects. - - * zend_objects_API.c: - extra safety - - * zend_compile.c: - fix memory leak - -2003-01-29 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Fix assignments to $this. - Fixes the 'make install' problem reported on php-dev - -2003-01-28 Zeev Suraski - - * zend_compile.c: - Fix a ticks related crash - - * (PHP_5_0_dev_before_13561_fix) - zend_execute.c: - Allow methods in parent classes to call protected methods in derived - classes - -2003-01-27 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c: - Replace MAKE_VAR opcode with special 'data' opcode - This opcode is not executeable but only holds data for opcodes - that need more than two arguments (presently only ASSIGN_OBJ and the ilk - but - in the future also ASSIGN_DIM) - -2003-01-26 Sascha Schumann - - * zend_API.c: - Replace snprintf() call using zend_error's capabilities - -2003-01-23 Zeev Suraski - - * zend_execute.c: - Let the scope propagate to internal functions - -2003-01-23 Jani Taskinen - - * zend_execute_API.c: - Fixed bug: #14542, register_shutdown_function() timeout problem - -2003-01-22 Stanislav Malyshev - - * OBJECTS2_HOWTO: - some small refinements for get_class_* - -2003-01-22 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #21814 (Allow booleans to be used as array keys). - -2003-01-21 Sterling Hughes - - * zend_objects_API.c: - fix by phanto to the cloning - -2003-01-19 Zeev Suraski - - * Zend.m4: - relabel - -2003-01-19 Stanislav Malyshev - - * zend_compile.c: - Restore for now old statics behaviour (so that indirect $$var references - would work again). Comprehensive fix will follow later. - -2003-01-19 Harald Radi - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: - ini patch to allow 'entry[] = value' entries - -2003-01-17 Harald Radi - - * zend_objects.c - zend_objects.h: - export zend_objects_destroy_object() - static inline was meaningless anyways as the function - was only used as a callback handler and was never - called directly - - * zend_objects_API.c - zend_objects_API.h: - make std_object_handlers struct available for shared modules - -2003-01-16 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #20933 (isset/empty didn't work when used on string offsets). - -2003-01-15 Andi Gutmans - - * zend_compile.c: - - Revert int -> unsigned int change for str.len - -2003-01-15 Sascha Schumann - - * zend.h: - Revert commit which turned the lengths of strings into zend_uint. - -2003-01-14 Andi Gutmans - - * ZEND_CHANGES - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Change "is" to "instanceof" as it explains better what the operator - means. - - "is_a" was also appropriate but ugly. - -2003-01-14 Stanislav Malyshev - - * zend_API.c: - fix memory leaks and key size - -2003-01-14 Ilia Alshanetsky - - * zend_ini_parser.y: - MFZE2 - -2003-01-14 Stanislav Malyshev - - * zend_compile.c: - fix warning - - * zend_API.c - zend_API.h: - Make add_property_ functions work via write_property handler - - * zend.c - zend_object_handlers.c: - ws - -2003-01-14 Ilia Alshanetsky - - * zend_ini_parser.y: - Reverting previous patch. - -2003-01-13 Ilia Alshanetsky - - * zend_ini_parser.y: - MFZE2 - -2003-01-13 Andi Gutmans - - * zend_objects_API.c: - - Don't check if the handle is bogus. We should crash. - -2003-01-12 Harald Radi - - * zend_modules.h: - fix wrong dereferenciation - -2003-01-12 Stanislav Malyshev - - * zend_compile.c: - fix inheritance - - * zend_API.h: - Remove handle_property from here too - - * zend.c - zend.h - zend_compile.c: - RIP handle_* functions. ZE2 will use __ handlers instead. - - * zend_object_handlers.c: - Move Z_OBJ_P here. - - * zend_operators.h: - Remove Z_OBJ - it's internal to Zend objects, no generic function except - those in zend_object_handlers.c should use it. - Add Z_OBJ_HANDLER macro for easy access to handlers - -2003-01-12 Sebastian Bergmann - - * zend.c - zend.h - zend_builtin_functions.c: - ZTS fixes. - -2003-01-12 Stanislav Malyshev - - * zend_object_handlers.c: - add get_class_name handler - - * zend.c: - Use generic handlers instead of Z_OBJ - -2003-01-12 Harald Radi - - * zend_modules.h: - - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - partially revert previous commit and - change zend_modules.h to include - a forward declaration to zend_ini_entry - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - added zend_ini_entry to zend_modules_entry as - discussed with zeev - - * zend_builtin_functions.c: - fix 'use of uninitialized variable' warning - -2003-01-12 Stanislav Malyshev - - * zend_objects_API.c: - validate handle - -2003-01-12 Zeev Suraski - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_ini.h - zend_variables.c: - Implemented compatibility mode - To enable - zend2.implicit_clone = on in php.ini or using ini_set() - -2003-01-11 Andi Gutmans - - * zend_execute.c: - - Fix typo and whitespace - -2003-01-11 Derick Rethans - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c: - - Ported the zend_execute_internal hook to ZendEngine2. - -2003-01-11 Harald Radi - - * zend_ts_hash.c: - freed reader twice instead of writer and reader - -2003-01-10 Ilia Alshanetsky - - * zend_alloc.c: - MFZE2 - -2003-01-10 Andrei Zmievski - - * zend_API.c: - Automatically register constructor, destructor, and clone function when - class methods are registered. - -2003-01-09 Zeev Suraski - - * zend_compile.c: - Found some more occurences of that elusive bug... - - * zend_compile.c: - Fix one lousy, annoying lurking bug (memory corruption) - Sebastian - try coWiki again please... - - * zend_API.h: - Unify and make it easy to add code into the broken-string error handler - - * zend_language_parser.y: - Fix writability checks - - * zend.c: - Fix leak - -2003-01-08 James Cox - - * zend.h: - cvs is dev not alpha. - -2003-01-08 Ilia Alshanetsky - - * zend_builtin_functions.c: - MFZE2 - -2003-01-05 Zeev Suraski - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - MFZE1 - lineno fix - -2003-01-02 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix incorrect linkage of access-levels, when using private methods - -2003-01-01 Zeev Suraski - - * zend_API.c - zend_operators.h: - Win32 build fix - -2003-01-01 Stanislav Malyshev - - * zend_operators.h: - use handler for Z_OBJPROP - -2003-01-01 Zeev Suraski - - * zend_API.c: - Fix Wez's problem - -2002-12-31 Sebastian Bergmann - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - Bump year. - -2002-12-31 Stanislav Malyshev - - * zend_object_handlers.h: - fix level of indirection - -2002-12-30 Andrei Zmievski - - * zend_execute_API.c: - Adjust the error message. - -2002-12-30 Stanislav Malyshev - - * zend_object_handlers.h: - Oops, fix it indeed - - * zend_object_handlers.h: - Better check - -2002-12-26 Andrei Zmievski - - * zend_compile.c: - do_inherit_method_check() is supposed to return 0 or 1, not SUCCESS or - FAILURE. - -2002-12-14 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE2 - -2002-12-10 Zeev Suraski - - * zend_compile.c: - Fix check to allow for static+access level modifiers - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Allow variables to have both 'static' modifier and an access level. - NOTE: This only works at the syntax level right now (parser). It - doesn't actually work as of yet - all statics are considered - public for now - - Prevent users from putting more restrictions on methods in derived - classes - (i.e., you cannot make a public method private in a derived class, etc.) - -2002-12-09 Andi Gutmans - - * zend_mm.c: - - Fix a bug which I just introduced. - - * zend_mm.c: - - Fix typo - - * zend_mm.c: - - Improvements - - * zend_mm.c - zend_mm.h: - - First attempt to improve memory manager during realloc()'s - -2002-12-08 Zeev Suraski - - * zend_compile.c: - Remove comment - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Treat the absence of an access type just as if 'public' was supplied - - * zend_compile.c: - Simplify/fix inheritance checks - - * zend_execute.c: - Support private/protected constructors - -2002-12-07 Sebastian Bergmann - - * ZEND_CHANGES: - Update. - -2002-12-07 Zeev Suraski - - * zend_execute.c: - Fix error messages - - * zend_language_parser.y - zend_language_scanner.l: - Remove unintentional code - -2002-12-07 Andi Gutmans - - * zend_compile.c: - - Dissallow using parent, self and main as class names - -2002-12-06 Zeev Suraski - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_hash.h - zend_language_parser.y - zend_language_scanner.l: - - Implement public/protected/private methods. - - Prevent instantiation of classes with abstract methods. - Based in part on Marcus's patch. - -2002-12-01 Andi Gutmans - - * zend_alloc.c: - - Allow enabling of memory cache with zend_mm - - * zend.c - zend.c - zend.h - zend.h - zend_builtin_functions.c - zend_builtin_functions.c: - - MFZE1 - - * zend.c - zend.h - zend_builtin_functions.c: - - Revert as the patch doesn't compile - - * zend.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_indent.c - zend_object_handlers.c - zend_opcode.c - zend_operators.c - zend_operators.h - zend_variables.c: - h WHitespace - - * zend.c: - - Initialize constants_updated (by Marcus) - - * zend_builtin_functions.c: - - Nuke use of deprecated macro - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - FN_IS_STATIC -> FN_STATIC - - * zend.c: - - Fix crash - - * zend_compile.c - zend_compile.h: - - My personal cleanups - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_language_parser.y - zend_object_handlers.c: - - Commit Marcus' cleanup of abstract and static inheritance and improve - - error messages - -2002-11-22 Derick Rethans - - * zend_API.c: - - Initialize all functions to non-static (patch by Marcus Börger - . - -2002-11-22 Sebastian Bergmann - - * zend_execute.c: - Show class name as well. Patch by Marcus Börger. - - * zend_execute.c: - Show the name of the abstract method in the error. - - * zend_compile.h: - Fix prototype. - -2002-11-20 Derick Rethans - - * zend_builtin_functions.c: - - MFZE1: Disable leak() and crash() when not using debug mode - -2002-11-20 Andi Gutmans - - * ZEND_CHANGES: - - Add abstract methods - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l: - - Fix build (thanks Marcus) - - Implement abstract methods, syntax: - - abstract function foo($vars); - - I don't see any reason why modifiers such as static/public need to be - - used with abstract. PHP is weakly typed and there would be no meaning to - - this anyway. People who want a strictly typed compiled language are - - looking in the wrong place. - -2002-11-19 Zeev Suraski - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: - MFZE1 - error_reporting fix - -2002-11-18 Andi Gutmans - - * zend_language_scanner.l: - - MFZE1 - -2002-11-17 Stanislav Malyshev - - * zend_execute.c: - fix the leak - -2002-11-16 Andi Gutmans - - * zend_language_scanner.l - zend_language_scanner.l: - - MFZE1 - - * Zend.m4 - configure.in: - - MFZE1 - - * zend_hash.c: - - Commit fix for bug #19566 (I think it's by Marcus :) - -2002-11-14 Andrei Zmievski - - * zend_llist.h: - MFZE1 - -2002-11-13 Stanislav Malyshev - - * zend_execute.c: - semi-fix string offsets crash - now it doesn't crash, but still leaks - - * zend_object_handlers.c: - fix static - -2002-11-11 Andi Gutmans - - * ZEND_CHANGES: - - Update with statics - -2002-11-11 Sebastian Bergmann - - * zend_execute.c: - Fugbix typo. - -2002-11-11 Ilia Alshanetsky - - * zend.h: - MFZE1 - -2002-11-10 Andi Gutmans - - * zend_compile.c: - - MFZE1 - -2002-11-10 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - fix statics - make it behave like $this (fetch type "static") - Side effect: indirect references to statics won't work. - -2002-11-06 Sebastian Bergmann - - * zend_execute.c: - Fix ZTS build. - -2002-11-06 Stanislav Malyshev - - * zend_execute.c: - fix zend_assign_to_object_op - -2002-11-05 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE1 - -2002-11-05 Andi Gutmans - - * zend_compile.h: - - Shift around zend_op members - - * ZEND_CHANGES: - - A couple of updates - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Add support for static methods. Basically methods which are defined as - - static don't have $this. That's the whole difference. - - * tests/zend2.php: - - $clone -> $that - - * zend_execute_API.c: - - Fix bug introduced with type change of free_op1/2 - - * zend_language_parser.y - zend_language_scanner.l: - - ATTENTION: Finally nuke old_function and cfunction. I think it is time - - to get rid of these BC notations. This is from the days of the move from - - PHP/FI 2 -> PHP 3 - -2002-11-05 Ilia Alshanetsky - - * zend_hash.c: - Revert of previous patch. - -2002-11-05 Andi Gutmans - - * zend_compile.c - zend_objects.c: - - Change the automatically created variable $clone in __clone() to - - $that as discussed at the PHP Conference. If there are any objections - - alternative names please let me know. The reason for changing it from - - $clone is because $clone sounds as if it's the newly cloned object and - - not the old one. - -2002-11-05 Stanislav Malyshev - - * zend_compile.c - zend_compile.h: - avoid using 'class' in exported functions - it annoys c++ - -2002-11-05 Stig Bakken - - * zend.c: - Fixed some special cases that were crashing for the exception default - handler. - -2002-11-04 Ilia Alshanetsky - - * zend_compile.c: - Silence compiler warnings. - - * zend_hash.c: - If ordered is not set a random compiler assigned value of *p2 would be - used, - this patch fixes the problem by initializing *p2 to NULL. - - * zend_operators.c: - Silence compile warning, ctype.h is needed for tolower() function. - - * zend_language_scanner.l: - MFZE1 - -2002-11-02 Derick Rethans - - * zend_language_scanner.l: - - Fix segfault when __CLASS__ was used outside a class definition - - * zend.c: - - MFZE1 - -2002-11-02 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE1 (20214). - -2002-11-01 Andi Gutmans - - * zend_execute.c: - Fix unset($this->foo) - -2002-10-24 Andi Gutmans - - * zend_execute.c - zend_opcode.c: - Also tune jmpz_ex - - * zend_execute.c - zend_opcode.c - zend_compile.h: - - Improve performance of part of the jmps. More to follow. - -2002-10-23 Andi Gutmans - - * zend_execute.c - zend_compile.c: - - This might improve performance. Commiting it so that I can check it on - - Linux - - * zend_execute.c: - - Make Ts access a macro. I need this for my next patch which should - - improve performance but not sure yet if it will. - -2002-10-22 Andi Gutmans - - * zend_execute.c: - Nuke unused get_incdec_op() - - Nuke old comment - - * zend_compile.h - zend_execute.c - zend_globals.h: - Improve overall engine performance - - * zend_execute.c: - Fix bug reported by Daniel T. Gorski - -2002-10-21 Thies C. Arntzen - - * zend_builtin_functions.c: MFZE1 - -2002-10-20 Stanislav Malyshev - - * zend_object_handlers.c: looks like this message should go - - * zend_compile.c: Fix private handling - -2002-10-20 Sebastian Bergmann - - * zend_highlight.c - zend_highlight.h: Sync zend_html_puts parameter list with Zend Engine 1. - -2002-10-19 Andi Gutmans - - * zend_compile.h: - Fix compile warning. - - * zend_opcode.c - zend_compile.h - zend_execute.c: - Improve opcode dispatching - -2002-10-18 Andi Gutmans - - * zend.c - zend_compile.c - zend_execute.c: - - Change opcode dispatch mechanism to use a function per opcode and use - - a lookup table using the opcode # to call the correct function. - - Still have lots of tuning to do. - - * zend_execute.c: - Cleanup - -2002-10-16 Sebastian Bergmann - - * zend_execute.c: Fix ZTS build. - -2002-10-16 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: Fix class static members: now the following code works: - - and returns "Hello" (class statics are not copied anymore, but looked up in - runtime) - - * zend_compile.c - zend_compile.h - zend_execute.c: Fix and generalize $this handling. - ZEND_FETCH_FROM_THIS is removed, IS_UNUSED type on class variables will be - used instead as the sign that it's a fetch from $this - -2002-10-14 Ilia Alshanetsky - - * zend_ini_parser.y - zend_ini_scanner.l - zend_globals.h: MFZE1 - -2002-10-14 Andi Gutmans - - * zend_execute.c - zend_language_parser.y: - Support new classname::$class_name, e.g.: - hello; - ?> - -2002-10-13 Ilia Alshanetsky - - * zend_extensions.h: Increased the API number. (re: floats patch) - -2002-10-12 Ilia Alshanetsky - - * zend_operators.c - zend_operators.h - zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (floats & locale issue) - -2002-10-10 Sebastian Bergmann - - * ZEND_CHANGES: Fugbix typo. - -2002-10-10 Stanislav Malyshev - - * zend_object_handlers.c: add comment - - * zend_object_handlers.c: fix memory leaks - -2002-10-09 Stanislav Malyshev - - * zend_object_handlers.c: Fix object write handler behaviour: - * If this value is already set to given value, don't try to set it again. - * If we have reference, we should not move it. - * If we are assigning referenced variable, we should separate it. - -2002-10-09 Ilia Alshanetsky - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 zend_str_tolower issue. - -2002-10-07 Andi Gutmans - - * tests/zend2.php: - Fix test - - * zend_execute.c: - - Require $this-> when calling a methods. This whole automatic lookup - - first in the class and then in the global scope is confusing, slow and - - not quite BC compatible. - - * zend.c - zend_compile.c - zend_globals.h: - - Allow access to private/protected variables of $clone inside the __clone() - - method - -2002-10-06 Andi Gutmans - - * zend_execute.c: - Fix problem with unsetting object members. - -2002-10-01 Andi Gutmans - - * zend_language_parser.y: - - Fix problem when crashing on illegal tokens in class name during class - - definition. - -2002-09-30 Derick Rethans - - * ZEND_CHANGES: - No tabs :) - -2002-09-28 Derick Rethans - - * zend_builtin_functions.c: - Fix for defines... - - * zend_builtin_functions.c: - Fix build in non-ZTS mode - -2002-09-26 Ilia Alshanetsky - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 - -2002-09-25 Stanislav Malyshev - - * zend_extensions.h: - Propmote API NO year, so that it will never be the same as ZE1 API NO - -2002-09-24 Andi Gutmans - - * zend_compile.c: - Fix leak - - * zend_language_parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Megapatch to try and support inheritance from sub-classes. Things might - - be *very* buggy now so don't get too upset if that happens. - - I still need to improve some stuff but it's a good step (hopefully). - -2002-09-23 Andi Gutmans - - * zend_globals.h - zend_ini.c - zend_language_parser.y: - MFZE1. - -2002-09-21 Andi Gutmans - - * zend_extensions.h: - Someone screwed this up. - -2002-09-19 Derick Rethans - - * zend_ini.c: - Make Colin happy - -2002-09-19 Zeev Suraski - - * zend.c - zend.h - zend_execute_API.c: MFZE1 - connection_status() fix - - * zend.c: Fix non ZTS build - - * zend.c: Fix that obscure crash in Debug_TS mode - -2002-09-18 Zeev Suraski - - * zend.c: - Fix the thread-safe initialization of the ZE2. This should solve some - sporadic crashes, as well as the problem with the built-in constants. - - * zend_constants.c: Remove dead code - - * zend_builtin_functions.c: Add useful debugging function - -2002-09-17 Zeev Suraski - - * zend_hash.c - zend_hash.h: Add tracking for hashtable allocation - - * zend.c: ZE2 fix - - * zend_compile.c: whitespace - - * zend.c - zend.h: MFZE1 - threading fix - -2002-09-16 Andrei Zmievski - - * zend_API.h - zend_builtin_functions.c - zend_API.c - zend_execute_API.c: MFZE1 - -2002-09-15 Ilia Alshanetsky - - * zend_highlight.c: Make zend actually strip comments. Bug #18151 - - * zend.c: - Make zend return a proper exit error code when it encounters a parse error. - -2002-09-15 Andi Gutmans - - * zend_compile.c: - - Hopefully fix problem with __autoload not working well with inherited classes. - - There might still be some weird situations I haven't thought of. - - * zend_list.c - zend_execute.c: - WS fix - "while (" instead of "while(" - - * zend_execute_API.c - zend_ini.c - zend_list.c - zend_object_handlers.c - zend_objects_API.c - zend_operators.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - WS - Always use "if (" and not "if(" - - * zend_execute_API.c: - WS - -2002-09-10 Stanislav Malyshev - - * zend_execute_API.c - zend_variables.c: MFZE1 - -2002-09-09 Stanislav Malyshev - - * zend_object_handlers.c: remove comment - -2002-09-08 Andi Gutmans - - * zend.h: - Prepare for alpha 3 - -2002-09-05 Stanislav Malyshev - - * zend_compile.c: quick-n-dirty inheritance support for __handlers - -2002-09-04 Sebastian Bergmann - - * ZEND_CHANGES: Whitespace fixes. - -2002-09-04 Stanislav Malyshev - - * zend_object_handlers.c: remove dead code - - * ZEND_CHANGES - zend_object_handlers.c: Fix __call and add some docs - -2002-09-04 Sebastian Bergmann - - * zend_object_handlers.c: Fix ZTS build. - - * ZEND_CHANGES: TBD: __call(), __get(), __set(). - -2002-09-04 Stanislav Malyshev - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_extensions.h - zend_object_handlers.c - zend_objects.c: Support for __get, __set and __call in classes. - This should work as follows: if class hasn't member with given name, - __get/__set is called. If class has no method with given name, __call is called. - __get/__set are not recursive, __call can be. - -2002-09-04 Sebastian Bergmann - - * ZEND_CHANGES: Workaround for superfluous comma in var_export() result. - - * ZEND_CHANGES: - Let debug_backtrace() example print out the class name, if applicable, and the function/method arguments. - -2002-09-03 Thies C. Arntzen - - * zend_builtin_functions.c: nuke warning - - * zend_builtin_functions.c: nuke unneeded stuff - -2002-09-03 Zeev Suraski - - * zend.c - zend.h - zend_ini.c: MFZE1 - -2002-09-03 Derick Rethans - - * zend_ini.c: - Revert - - * zend_ini.c: - - MFH for: Apply rest of html errors fix (Patch by Jan Lehnardt ) - -2002-09-03 Sebastian Bergmann - - * zend.h: - Add html_errors to zend_utility_values. Patch by Jan Lehnardt . - -2002-09-03 Andi Gutmans - - * zend_builtin_functions.c: - Fix typo - -2002-09-02 Thies C. Arntzen - - * zend_builtin_functions.c: - refine last patch. if the argument-stack is not consistent don't try to show - arguments. no call to zend_error is made as we might end up in an infinite - recursion if called from an error_handler. - so: if the arguments to functions aren't shown in debug_backtrace this is 'cause - the arument stack was not consistent when debug_backtrace was called. - - * zend_builtin_functions.c: - debug_backtrace() now checks the complete argument-stack for consistency. - -2002-09-02 Stanislav Malyshev - - * zend_execute.c: MFZE1 - -2002-09-01 Andi Gutmans - - * zend_llist.c: - Fix leak reported by "l0t3k" - -2002-09-01 Stanislav Malyshev - - * zend_operators.c: MFZE1 - -2002-08-28 Thies Arntzen - - * zend_builtin_functions.c - zend_execute_API.c: debug_backtrace() - - make args passed to functions called vy call_user_function available again. - - * zend_builtin_functions.c: debug_backtrace(): - - make args work if called from the error_handler - - fix refcount for args - - * zend.c: - clear current_execute_data on bailout as it would point into some freed area - on the stack. - -2002-08-28 derick - - * zend.c: - MFZE1 - -2002-08-26 Thies Arntzen - - * zend_builtin_functions.c: - debug_backtrace(): show name of included file for include and require calls - plus some small fixes suggested by andi. - -2002-08-24 Andi Gutmans - - * zend_builtin_functions.c: - Whitespace - - * zend_builtin_functions.c: - Whitespace and better variable name - -2002-08-24 Thies Arntzen - - * zend_builtin_functions.c: fix warning - -2002-08-23 Andi Gutmans - - * Zend.m4: - Add \n to configure fprintf - - * zend_extensions.c: - dlerror -> DL_ERROR - -2002-08-23 Thies Arntzen - - * zend_builtin_functions.c: - debug_backtrace: show include/require/eval as normal functions on the stack - -2002-08-23 derick - - * zend_builtin_functions.c: - No spaces :) - -2002-08-23 Thies Arntzen - - * zend_builtin_functions.c: - - debug_backtrace now also returns an array containing the arguments of the - called function. - - zeev, andi - is knowing the structure of the stack considered a bad thing in - zend_builtin_function? if yes i would have to create a new function in - zend_ptr_stack.c (but i think we are save this way) - - * zend_builtin_functions.c - zend_execute_API.c: - debug_backtrace: - added "type" ('->' or '::') for object calls. - made calls done thru call_user_func show-up correct in backtraces. - - andi, - does this look correct to you? - - * zend_execute.c: those are set by RETURN_FROM_EXECUTE - -2002-08-21 Thies Arntzen - - * zend_execute.c: - zend_execute: make sure that current_execute_data points to the right thing - after coming back from recursion. - -2002-08-19 Zeev Suraski - - * zend_operators.c: MFZE1 - -2002-08-17 Andi Gutmans - - * zend_execute.c: MFZE1 - -2002-08-17 Zeev Suraski - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-08-16 Stig Bakken - - * zend.c: * append emacs footer - - * zend.c: * remove builtin exception class - -2002-08-16 Andi Gutmans - - * zend.c: - Fix whitespace - -2002-08-16 Stig Bakken - - * zend_execute_API.c - zend_globals.h - zend.c - zend_builtin_functions.c: - - Added set_exception_handler() function for registering a global, - catch-all exception handling function - - Added set_exception_handler() function for registering a global, - catch-all exception handling function (Stig) - -2002-08-15 Zeev Suraski - - * flex.skl - zend.c - zend_globals.h - zend_language_scanner.l: MFZE1 - -2002-08-14 jason - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y: - MFZE1 (use token instead of global for opcode counting) - -2002-08-13 Andi Gutmans - - * zend_execute_API.c: - - Fix crash when exception is raised in __autoload function - -2002-08-13 Zeev Suraski - - * zend.h: MFZE1 - -2002-08-08 sebastian - - * zend_objects.c: Fix warning. - -2002-08-08 stas - - * zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Add ZEND_API to functions - -2002-08-08 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Make new 'is' operator work with classes only and return false when - - the object isn't of the said class or the value isn't an object. - - * zend_static_allocator.c: - Bad Harald! :) - -2002-08-08 Zeev Suraski - - * zend_alloc.c: MFZE1 - -2002-08-07 phanto - - * zend_static_allocator.c - zend_alloc.c - zend_config.w32.h - zend_hash.c - zend_ini.c - zend_llist.h - zend_mm.c - zend_operators.c: make win32 debug output more verbose - -2002-08-03 Andi Gutmans - - * tests/zend2.php: - Small fix - -2002-08-03 Zeev Suraski - - * zend_execute.c: MFZE1 - -2002-08-01 stas - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-07-30 jason - - * zend_compile.c - zend_execute.c - zend_globals.h: MFZE1 global declare - - * zend_compile.c: Fix segfault - -2002-07-30 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Adding 'is' operator that can be used to check the type of a variable, - or its class. - -2002-07-28 phanto - - * OBJECTS2_HOWTO: update the handlers struct - -2002-07-27 Andi Gutmans - - * zend_compile.c - zend_execute_API.c: - - Make sure classes are first looked for in the current scope. - - Make sure that during inheritance the global scope is searched if the - - current one doesn't work. - -2002-07-26 Andi Gutmans - - * zend_execute.c - zend.c - zend_builtin_functions.c - zend_compile.h: - - Fix problem with debug_backtrace() reported by Stig. We weren't reporting - - global function information because it wasn't available. We have to do - - an additional assignment per-function call so that it'll be available. - - Also don't define the global scope as function name _main_ but leave it - - empty so that frameworks like Pear can decide what they want to do. - -2002-07-25 sniper - - * Zend.m4: Fixed 3 major failures in this test: - - 1. Tests work better when they are actually run.. - 2. When file is opened, it should be closed sometime too. - 3. AC_TRY_RUN cleans after itself (rm -f conftest.*), so it's - good idea to read the values while the file still exists. - - -2002-07-24 Andi Gutmans - - * zend_mm.c: - Fix some compile problems with the new configure checks. - -2002-07-24 James Cox - - * Zend.m4 - zend_mm.c: move testing for the alignment values into configure. - - * Zend.m4: ws fixes. - -2002-07-23 Andi Gutmans - - * zend_hash.c: - Fix WS. - -2002-07-21 Andi Gutmans - - * zend_compile.c: - - Fix bug reported by Sebastian where old constructors didn't work in - - nested classes. - -2002-07-18 derick - - * zend.h - zend_extensions.c: - MFZE1 - MacOSX fixes by Marko Karppinen - -2002-07-17 Andi Gutmans - - * zend_compile.c: - - Remove code which wasn't supposed to go into the patch. - - * zend_compile.c - zend_language_parser.y: - Rejuggle some code. - -2002-07-17 sniper - - * ZEND_CHANGES: This was mentioned already above (with an example too :) - -2002-07-16 Andi Gutmans - - * ZEND_CHANGES: - Before I forget to list it, this was also added. - - * zend_language_scanner.l: - - Syntactic sugar - Add "public" as a synonym for "var". - - Now we have the three P's. - You can do: - - - -2002-07-15 derick - - * zend_operators.c: - MFH of the crap removal - -2002-07-15 Andi Gutmans - - * ZEND_CHANGES - zend.c - zend.h - zend_API.c - zend_compile.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - - Commit patch to support protected member variables (by Timm Friebe w/ - - some fixes by me). - - You can't access protected variables from outside the object. If you want - - to see a protected member from your ancestors you need to declare the - - member as protected in the class you want to use it in. You can't - - redeclare a protected variable as private nor the other way around. - - * zend_operators.c: - - Really implement bool increment/decrement as flip-flop. - -2002-07-14 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - ZEND_CHANGES: - - Nuke delete(). It was a big mistake to introduce it and I finally - - understand why Java didn't do so. - - If you still want to control destruction of your object then either make - - sure you kill all references or create a destruction method which you - - call yourself. - - * zend_execute.c: - Nuke some unused code - -2002-07-14 derick - - * zend_operators.c: MFZE1 - - * zend_operators.c: - MFZE1 - -2002-07-07 Andi Gutmans - - * zend_objects_API.c: - Path which should improve previous fix. - - * zend_objects_API.c: - - First try at solving problem with different objects being allocated the - - same id. - -2002-07-07 Stanislav Malyshev - - * zend_object_handlers.c: name length should be strlen+1 - -2002-07-07 Sebastian Bergmann - - * zend_language_parser.y: - Allow for 'class Namespace::Bar extends Foo' syntax. Patch by Timm Friebe . - -2002-07-06 Andi Gutmans - - * zend_execute.c: - - Fix problem where scope was lost in nested function calls. - - Thanks to Timm Friebe for diving into this one. - -2002-07-06 Zeev Suraski - - * zend_language_parser.y: spelling fix - -2002-07-05 Stig Bakken - - * zend_builtin_functions.c: * folding fixes - -2002-07-01 Andi Gutmans - - * zend_compile.c: - Fix bug when acccessing $this not in class scope. - - * zend_objects.h - zend_objects.c: - Export zend_object_get_address() - -2002-06-30 Andi Gutmans - - * ZEND_CHANGES: - Remember to document autoload when I have time. - -2002-06-30 Derick Rethans - - * zend_modules.h: - MFZE1 - -2002-06-29 Andi Gutmans - - * zend.h: - Get ready for alpha2 - - * zend_execute_API.c: - Invalid -> Undefined - - * zend_language_parser.y: - Add missing semi-colon. - - * zend_execute_API.c - zend_execute.c: - Improve some error messages. - - * zend_compile.c: - Revert previous fix. - - * zend_compile.c: - Change E_ERROR -> E_COMPILE_ERROR where needed. - - * zend_compile.c: - - Fix for bug #17882. We complain if the same method is declared twice. - - * zend.h - zend_operators.c: - Fix bug 15037 - - Bump version to alpha2-dev - -2002-06-28 Andi Gutmans - - * zend_operators.c: - WS fix - -2002-06-26 Andi Gutmans - - * zend_execute_API.c: - - Autoloading support based on patch from Ivan Ristic. - - Again I hope this feature ends up working well because if it doesn't we - - might need to nuke it. This only works for global scoped classes and it - - will never work for sub-classes so don't even ask!!!!! - - Just define an __autoload() function in the global scope and it will be - - called with the class name as the parameter if it doesn't manage to find - - the class. - - * zend_API.c - zend_builtin_functions.c - zend_mm.h: - Centralize global class fetch - - * zend_alloc.c - zend_execute.c: - - Fix problem with scope's not changing correctly during method calls. - - Reapply a tiny optimization to the allocator so that in non-debug mode - - we clean memory without detecting leaks. - -2002-06-24 Andi Gutmans - - * zend_fast_cache.h: - - MFZE1 (Turn off fast cache until we make sure it performs well.) - - * zend_alloc.c: - More fixes (warnings, bug fixes etc.) - - * zend_execute.c: - - Revert patch which checks at run-time if you're allowed to assign - - certain values by reference. - - We still need to find a solution for cases when this shouldn't be allowed - - as it might cause leaks. - - * zend_alloc.c: - Fix crash bug and clean up a bit. - -2002-06-24 Sebastian Bergmann - - * Zend.m4: IMHO, ZTS should no longer be labeled experimental. - -2002-06-24 Andi Gutmans - - * zend_alloc.c: - MFZE1 - - * zend_alloc.c: - Don't use cache if we're using ZEND_MM - - * zend_mm.c: - - Hardcode alignment to 8. We might need a configure check for this. - - * zend_mm.c - zend_mm.h: - Improve memory manager to allocate small blocks quickly. - - * zend_alloc.h - zend_mm.h - zend_alloc.c: - - Don't keep allocated blocks in a linked list if we're in non-debug mode - - as now the memory manager takes care to nuke all leaking blocks. - - * zend.h - zend_types.h: - MFZE1 - -2002-06-23 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Fix problem with constructor not being inherited and called correctly. - - * zend_mm.c: - Fix small bug - - * zend_mm.c: - - Almost completely implement realloc(). It now resizes in place when - - possible. - -2002-06-22 Andi Gutmans - - * zend_alloc.c - zend_mm.c: - Fix crash when zend_mm_shutdown is called more than once. - - * zend_alloc.c - zend_alloc.h - zend_globals.h - zend_language_parser.y: - MFZE1 - - * zend_constants.h - zend_objects.c - zend_variables.c - zend_variables.h - zend_constants.c - zend_alloc.c - zend_alloc.h: - Nuke persist_alloc(). - -2002-06-19 Andi Gutmans - - * zend_globals.h: - - This was also supposed to be part of the previous ZEND_MM commit :) - - * zend_alloc.c: - - Oops, this was supposed to be part of the previous #ifdef ZEND_MM change - - * zend_mm.h: - Use #ifdef for ZEND_MM - - * zend_mm.c: - Make sure MAX is defined - - * zend_constants.c: - - Fix problem where you couldn't define constants with different cases but - - the same name. - -2002-06-18 Derick Rethans - - * zend.c: - MFZE1 - -2002-06-17 Andi Gutmans - - * zend_mm.c: - Improve speed of alignment calculation - - * zend_mm.c - zend_mm.h - zend_alloc.c: - - Fix a bug and add code which frees actual allocated segments at the end - - of execution (this still doesn't work because some blocks remain - - referenced after the memory manager is killed. - - * zend_mm.c - zend_mm.h: - Save space per-allocated block. - -2002-06-16 Andi Gutmans - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Fix bug in class constants - - Start centralizing main class lookups. This will help implement - - __autload() - - * zend_mm.c - zend_mm.h: - - Remove debug code which doesn't work anymore and add headers. - - * zend_globals.h - zend_mm.c - zend_mm.h - zend_alloc.c - ZendTS.dsp: - Commit an initial version of a home made memory manager. - - It's just for seeing if this would be an advantage to PHP in MT - - environments. If this is to become production material there is still - - a long way to go. - -2002-06-15 Andi Gutmans - - * zend_objects.h - zend_objects_API.c: - - Fix copy&paste problem where we allocated according to an old structure - - decleration and not the new one. - -2002-06-11 Andi Gutmans - - * zend_builtin_functions.c: - - Don't show debug_backtrace() in the trace itself. - - This patch is a bit ugly because the whole code itself is pretty complex - - and hard to re-order. - - * zend_execute.c - zend_language_parser.y: - - Fix problem with assigning functions by reference. - -2002-06-11 Sebastian Bergmann - - * RFCs/004.txt: Add __delegate(). - -2002-06-10 Harald Radi - - * zend_ts_hash.h - zend_ts_hash.c: added TS_HASH macro - -2002-06-10 Stanislav Malyshev - - * zend_execute.c: Fix leak - -2002-06-09 Harald Radi - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.h: - only check for an available class entry instead of - the std_object_handlers on some places - - -2002-06-08 Andi Gutmans - - * zend_hash.h - zend.h: - This should improve performance on Windows - - * zend_hash.h: - - Add a loop unrolled version of the hash function and a bit of an - - explanation about our hash function (Ralf S. Engelschall) - -2002-06-06 Sebastian Bergmann - - * RFCs/004.txt: Add RFC on delegation. - -2002-06-05 Sebastian Bergmann - - * zend_execute.c: Remove unused local variable. - -2002-06-05 Andi Gutmans - - * zend_compile.c - zend_execute.c - zend_object_handlers.c: - - Allow overloaded objects to receive the method name in its original - - case. - -2002-06-05 Derick Rethans - - * zend_llist.c: - Fix memleak (patch by Stefan Sesser) - -2002-06-04 Derick Rethans - - * zend_ini_scanner.l: - Fix for bug #17462 (Patch by Edin Kadribasic) - -2002-05-31 Andi Gutmans - - * ZendTS.dsp: - Add zend_objects_API.* to dsp - - * zend_objects_API.c: - Fix build (one more coming up) - - * zend_objects.c: - Fix build - -2002-05-31 Sebastian Bergmann - - * Zend.dsp: Add zend_objects_API.c to project. - -2002-05-31 Stanislav Malyshev - - * Makefile.am - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Generalize object storage and reference bookkeeping - -2002-05-30 Venkat Raghavan S - - * zend.h - zend_config.nw.h - acconfig.h: NetWare changes - -2002-05-26 Andi Gutmans - - * zend_multibyte.c: - - Add empty zend_multibyte.c to allow build with 4.3.0-dev. - -2002-05-24 Sebastian Bergmann - - * ZEND_CHANGES: Fugbix typo. - -2002-05-24 Andi Gutmans - - * ZEND_CHANGES: - Add a bit of information. - -2002-05-20 Zeev Suraski - - * zend_API.h - zend_execute.h - zend_list.h: MFZE1 (Expose more C++ APIs) - -2002-05-14 Andi Gutmans - - * zend_objects.c - zend_objects.h: - constructor_called is supposed to be destructor_called - -2002-05-13 Sterling Hughes - - * zend_qsort.c: MFZE1 - -2002-05-13 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-05-12 Zeev Suraski - - * zend_highlight.c: MFZE1 - -2002-05-12 Sebastian Bergmann - - * ZEND_CHANGES: Rephrase. - - * ZEND_CHANGES: Beautify. - - * ZEND_CHANGES: Start documenting the debug backtracing. - - * ZEND_CHANGES: Whitespace fixes. - -2002-05-11 Zeev Suraski - - * zend_highlight.c - zend_highlight.h: MFZE1 - -2002-05-10 Andi Gutmans - - * zend_builtin_functions.c: - Nuke C++ comment - - * zend_builtin_functions.c: - - Make debug_backtrace() return an array. Still not finished because I - might want to differentiate between method calls and static methods. - - Example: - $bt = debug_backtrace(); - foreach ($bt as $frame) { - if (isset($frame['class'])) { - print $frame['class']; - print "::"; - } - print $frame['function']; - print " ["; - print $frame['file']; - print ":"; - print $frame['line']; - print "]\n"; - } - -2002-05-08 Andi Gutmans - - * zend_execute.c - zend_builtin_functions.c: - - Hopefully fix problems with debug_backtrace() - -2002-05-08 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-05-07 Andi Gutmans - - * zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c: - - More debug backtrace work. It still doesn't work very well... - -2002-05-02 Andi Gutmans - - * zend.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: Initial support for built-in backtracing. - There are still a few problems such as includes and calling other functions - from internal functions which aren't seen (will have to think if and how to - fix this). - Also the main scripts filename isn't available. Need to think about that. - -2002-04-30 Stanislav Malyshev - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.h - zend_API.c: Make OBJCE return zend_class_entry*, also some cleanups - -2002-04-28 Sebastian Bergmann - - * zend_alloc.c - zend_alloc.h: Revert. - -2002-04-27 Sebastian Bergmann - - * zend_alloc.c - zend_alloc.h: - MFZE1: If the size-operands of memset are constants, the compiler can turn them into fast inline code. So, instead of using ecalloc, we use emalloc + memset in macro form now. emalloc will not return NULL, so the chosen macro form is safe. This is not true for malloc(3). An inline function accomodates our needs here. Suggested by: http://www.mail-archive.com/dev%40httpd.apache.org/msg02492.html (Sascha) - -2002-04-25 Harald Radi - - * zend_config.w32.h: unbreak the win32 build - -2002-04-24 Harald Radi - - * zend_API.c: MFZE1 saschas 'Avoid exceeding buffer limits' patch - -2002-04-23 Harald Radi - - * zend_hash.c - zend_hash.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ts_hash.c - zend_ts_hash.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_API.c - zend_API.h - zend.h: some type cleanup work - -2002-04-22 Harald Radi - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.h - zend_operators.h - zend_API.c - zend_API.h - zend_builtin_functions.c: added get_class_entry callback handler to the - object handlers structure - -2002-04-22 Sebastian Bergmann - - * Zend.m4: MFZE1: Change default value of inline-opt to yes (Sascha). - -2002-04-22 Harald Radi - - * zend_config.w32.h - acconfig.h - flex.skl: fixed linkage warning under win32 - -2002-04-20 Zeev Suraski - - * zend_execute_API.c: MFZE1 - -2002-04-19 Sebastian Bergmann - - * zend_list.c - zend_hash.c - zend_hash.h: - MFZE1: make sure the resource-list is always consistent during shutdown (Thies). - - * zend_hash.c: MFZE1: Fix imbalance bug (Zeev). - -2002-04-10 Jani Taskinen - - * zend_language_scanner.l - zend_language_parser.y: MFZE1 - -2002-04-07 Stanislav Malyshev - - * zend.h: make compatible with current PHP - - * zend_compile.c: sync - -2002-03-29 Derick Rethans - - * zend_compile.c: - revert patch - -2002-03-25 Derick Rethans - - * zend_compile.c: - MFZE1 - -2002-03-23 Andi Gutmans - - * zend_ts_hash.c - zend_ts_hash.h: - - Fix build without ZTS. If someone has a nicer fix let me know. - -2002-03-21 Andi Gutmans - - * zend_language_parser.y: - - No idea how this slipped in. Fix delete $obj statement. - -2002-03-20 Harald Radi - - * ZendTS.dsp - zend.h - zend_ts_hash.c - zend_ts_hash.h: added thread safe hashtable which allows concurrent - reads but only exclusive writes - -2002-03-19 Andi Gutmans - - * zend_language_parser.y - zend.h: - - Finish covering all parsed methods to check for validity in parser. - - Change zval's refcount to zend_uint (If it doesn't slow down the Engine - - too much it should probably stay this way). If anyone has time to test - - the difference in speed between zend_ushort & zend_uint in zend.h of - - the struct _zval_struct (one line change) I'd be glad to get some - - figures. - -2002-03-18 Andi Gutmans - - * zend_compile.c - zend_language_parser.y: - - More fixes to check for member/function call legality. - -2002-03-17 Andi Gutmans - - * zend_language_parser.y - zend_compile.c: - - Start putting error handling where method calls are being used in a - - context where only writable variables should be used. - -2002-03-15 Andi Gutmans - - * zend_execute.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_variables.c: - Pass TSRMLS to callbacks. - - * zend_execute.c: - - Scope fix. When calling an imported function the scope will change - - correctly to the scope of the functions class. - - - * zend_opcode.c - zend_execute.c - zend_compile.h - zend_compile.c: - - Fix issues with $this when using it by itself without indirection such as - - $this->foo. - -2002-03-14 Stanislav Malyshev - - * OBJECTS2_HOWTO: more cleanup - - * OBJECTS2_HOWTO: Update howto - - * zend_execute.c: fix for delete $this and unset $this - - * zend_execute_API.c: Fix call_user_function - -2002-03-12 Andi Gutmans - - * zend.h: - Forgot to close comment. - - * zend.h: - Macro for duality between Engine 1 and 2 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_opcode.c - zend_operators.c: - Another couple of indirection fixes. - - Make class_entry->refcount be part of the structure and not allocated. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - Fix bug introduced with latest class hash table change. - -2002-03-12 Stanislav Malyshev - - * zend_API.c: Fix standard object creation - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend.c - zend.h: - make class tables contain class_entry *, not class_entry - - fix isset($this) - -2002-03-10 Andi Gutmans - - * zend_execute.c: - Fix build in ZTS mode. - -2002-03-10 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: New stuff for objects API: - - Better assignment handling - - More flexible operations with zval-containing objects - -2002-03-09 Andi Gutmans - - * tests/zend2.php: - - Add the original example script to the CVS so that it's always available. - -2002-03-08 Sebastian Bergmann - - * ZEND_CHANGES: Add 'import const' example. - -2002-03-08 Andi Gutmans - - * zend_execute.c: - Support importing constants. e.g.: - - - * ZEND_CHANGES: - Add another 'import' example and merge 'import' section into 'Namespaces' section. - -2002-03-06 Andi Gutmans - - * zend_execute.c: - - Add function * and class * functionality. Only constants are left. - - - * ZEND_CHANGES: Consistency. - - * ZEND_CHANGES: Add 'import statement' section. - -2002-03-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Initial patch to support importing from class scopes (for Stig). - - It isn't complete yet but I want to work on it from another machine. It - - shouldn't break anything else so just don't try and use it. - - The following is a teaser of something that already works: - - -2002-03-02 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-03-01 Andrei Zmievski - - * zend_API.c: MFZE1 - -2002-03-01 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Remove use of C++ reserved words namespace/this - - * zend_opcode.c - zend_language_parser.y - zend_compile.h - zend_compile.c - zend_API.c: - Fix bug in nested try/catch's - - Infrastructure for implementing imports of methods. - - * zend_objects.c: - - Fix crash reported by Sebastian when destructor function causes a fatal - - error. I hope this does it and we don't find any other problems. - -2002-02-26 Andi Gutmans - - * zend_alloc.h - zend_alloc.c - zend.c: - MFZE1 - -2002-02-21 Sebastian Bergmann - - * ZEND_CHANGES: - Maintain ZEND_CHANGES to account for the addition of private member variables. - -2002-02-21 Andi Gutmans - - * zend_object_handlers.c - zend_opcode.c - zend_language_parser.y - zend_language_scanner.l - zend_compile.c - zend.c - zend.h - zend_API.c: - Experimental support for private members. - Hello; - } - } - - class MyClass2 extends MyClass { - function printHello() - { - MyClass::printHello(); /* Should print */ - print $this->Hello; /* Shouldn't print out anything */ - } - } - - $obj = new MyClass(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); /* Should print */ - - $obj = new MyClass2(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); - ?> - -2002-02-14 Stanislav Malyshev - - * zend.h - zend_API.c: Pass TSRM to create_object - -2002-02-14 Andrei Zmievski - - * zend_compile.c: - Fix the bug where the declared properties without init values were not - entered into the table. - -2002-02-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - * zend_compile.h: - Export lex_scan(). Both the PHPDoc and tokenizer extension need this. I hope this is okay with Z&A. - -2002-02-08 Andi Gutmans - - * zend_objects.c: - Remove object debug messages. - -2002-02-07 Stanislav Malyshev - - * Makefile.am - OBJECTS2_HOWTO - ZendTS.dsp - configure.in - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: Mega-commit: Enter the new object model - Note: only standard Zend objects are working now. This is definitely going to - break custom objects like COM, Java, etc. - this will be fixed later. - Also, this may break other things that access objects' internals directly. - -2002-02-04 Andi Gutmans - - * zend_execute.c: - - This small patch should also take care of allowing unseting of $this->foo - - and static members. The unset() opcode was luckily already suitable for - - object overloading. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_objects.c: - - Fix problem with the objects_destructor called during shutdown. It was - - freeing objects from id 0 instead of id 1. id 0 is not used. - - Change isset/empty opcodes to support static members and the new way of - - doing $this->foobar. Also the opcodes operate now on the hash table - - combined with the variable names so that they can be overloaded by the - - soon to be added overloading patch. - -2002-02-03 Adam Dickmeiss - - * Makefile.am - configure.in: - Zend config sets ZEND_EXTRA_LIBS. Bugs 14452, 14602, 14616, 14824 - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Revert per Andi's request. Sorry :-( - - * zend_builtin_functions.c: Fix warning. Again :-) - -2002-02-02 Andi Gutmans - - * zend_builtin_functions.c: - - Please don't use strcmp() and friends in Zend but only the mem* - - functions. I didn't check this patch so please check that it works. - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Fix a warning. - -2002-02-02 Andi Gutmans - - * zend_modules.h: - Nice catch by Derick. GINIT is dead. - -2002-02-01 Sebastian Bergmann - - * zend_builtin_functions.c: MFZE1: is_a() - -2002-01-27 Sebastian Bergmann - - * zend_config.w32.h: - MFZE1: define a couple of macros under win32. (Patch By: Jon Parise ) - -2002-01-25 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_objects.c - zend_objects.h - zend_opcode.c: - - First destructor hell fix. There was a situation where an object's - - destructor could be run after its class was already dead. Right now - - object destructors is the first thing whic happens during shutdown in - - order to prevent this problem. It's very likely that destructors will - - cause more grief and we'll have to outline exactly when you should use - - them and what kind of logic you're allowed to do inside of them. - - This bug was reported by sebastian. - -2002-01-22 Andi Gutmans - - * zend_execute.c: - - Fix a bug reported by Sebastian with indirect class names not working. - -2002-01-20 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - Improve performance of functions that use $GLOBALS[] - - Please check this and make sure it doesn't break anything. - -2002-01-19 Thies C. Arntzen - - * zend_language_parser.y: MFZE1 - -2002-01-14 Andi Gutmans - - * zend_execute_API.c: - - Fix crash bug in call_user_function_ex(). Thanks to Sebastian for the - - very nice and short reproducing script. - - -2002-01-14 Sebastian Bergmann - - * ZEND_CHANGES: Update Exceptions example. - -2002-01-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Change exception handling to use the Java-like catch(MyException $exception) - - semantics. Example: - exception = $exception; - } - - function Display() - { - print "MyException: $this->exception\n"; - } - - } - class MyExceptionFoo extends MyException { - function __construct($exception) - { - $this->exception = $exception; - } - function Display() - { - print "MyException: $this->exception\n"; - } - } - - try { - throw new MyExceptionFoo("Hello"); - } catch (MyException $exception) { - $exception->Display(); - } - ?> - - * zend_ini_scanner.l: - MFZE1 - -2002-01-06 Andi Gutmans - - * zend.c: - - Output error when there's an uncaught exception (by Timm Friebe) - - * zend_execute.c: - Make sure $this is passed on to methods - -2002-01-06 Sebastian Bergmann - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c: Happy New Year. - -2002-01-05 Andi Gutmans - - * zend_compile.c: - Small fix - - * zend_compile.c - zend_compile.h - zend_execute.c: - Allow passing of $this as function arguments. - - Fix a bug which I introduced a couple of months ago - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Significantly improve the performance of method calls and $this->member - - lookups. - -2002-01-04 Andi Gutmans - - * zend_execute.c: - - Improve performance of indirect-referenced function calls - - * zend_compile.c: - Nuke C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c: - Separate other kinds of function calls too. - - Significantly improve performance of function calls by moving lowercasing - - the function name to compile-time when possible. - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Start splitting up different kinds of function calls into different - - opcodes. - -2002-01-03 Derick Rethans - - * zend_API.c - zend_API.h - zend_execute.c - zend_list.c: - - MFZE1 for exit fix, exposing current function name in error messages and - exposing zend_zval_type_name(). - -2001-12-31 Sebastian Bergmann - - * ZEND_CHANGES: Consistency. - -2001-12-31 Andi Gutmans - - * ZEND_CHANGES: - - Add example of default argument for argument passed by-ref - -2001-12-30 Sebastian Bergmann - - * ZEND_CHANGES: Typo. - -2001-12-29 Andi Gutmans - - * zend.h: - - #define to help #ifdef stuff in PHP sources to make them work w/ ZE1 and - - 2 - - * ZEND_CHANGES: - A few clarifications - -2001-12-29 Sebastian Bergmann - - * ZEND_CHANGES: Integrate Andi's examples and some notes by Stig. - - * ZEND_CHANGES: Update Exceptions example. - -2001-12-28 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix some case insensitivity stuff in respect to classes - - * zend_execute.c - zend_language_parser.y: - - Support default arguments for reference parameters - - Fix two compile warnings - - * zend_compile.c: - - Wasn't adding the lower case version of the class name to the hash - -2001-12-27 Andi Gutmans - - * zend_compile.c - zend_objects.c: - - Use two underscores for __construct(), __clone and friends... - - * zend_objects.c: - - Only check refcount of object if the destructor was called. - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c - zend_objects.h: - - Experimental support for destructors. We need to see if destructors - - will actually work well in the context of PHP so we should consider this - - as experimental. Possible problems might be that when the constructor is - - run PHP might not be in a stable state. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Support parent:: again - - * zend_compile.c: - Support unified constructor name _construct() - -2001-12-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c: - Fix scoping issue. The following works now: - id = self::$id++; - } - - function _clone() - { - $this->name = $clone->name; - $this->address = "New York"; - $this->id = self::$id++; - } - } - - - - $obj = new MyClass(); - - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; - - print $obj->id; - print "\n"; - - $obj = $obj->_clone(); - - print $obj->id; - print "\n"; - print $obj->name; - print "\n"; - print $obj->address; - print "\n"; - - * zend.c: - Print out object id for easier debugging - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c: - Pretty much finish _clone() support - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Initial support for _clone() - - * zend_compile.c - zend_language_parser.y: - - Start fixing the parsing rules so that function and method calls - - can't be used in a write context. - - * zend.c: - Fix crash correctly. - -2001-12-25 Andi Gutmans - - * zend_language_parser.y: - Revert delete syntax patch - - * zend.c - zend_execute.c: - Fix a crash (not a thorough fix). - - Commented old code - -2001-12-24 Andi Gutmans - - * zend_execute.c: - - Fixed bug where global functions weren't called if they didn't exist - - in the class scope - -2001-12-23 Andi Gutmans - - * zend.c: - - Fix a bug where function's didn't work anymore in multi-threaded - - servers after the latest startup changes. - -2001-12-22 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_language_parser.y: - - Add initial capability of defining nested classes as class foo::bar - -2001-12-18 Zeev Suraski - - * zend_language_scanner.h - zend_language_scanner.l: MFZE1 - -2001-12-16 Sebastian Bergmann - - * ZEND_CHANGES: I'm too trigger-happy. - - * ZEND_CHANGES: delete is now function - -2001-12-16 Andi Gutmans - - * zend_language_parser.y: - - Seems like most people prefer delete($obj) over delete $obj. - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Start adding parsed variable checks. - - * zend_compile.h - zend_language_parser.y: - - Framework for knowing what kind of variable we just parsed. - - This will be used in compile-time error checking which couldn't be done - - at the level of the grammar. - -2001-12-13 Andi Gutmans - - * zend_language_parser.y: - - Rearrange grammar to allow dereferencing of objects returned from - - functions. It still crashes though. - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Fix crash bug in startup code. - - Start work on being able to reference global and local scope - -2001-12-12 Andi Gutmans - - * Zend.dsp - zend.c - zend_constants.c - zend_globals.h: - - Infrastructure changes for allowing to access the global scope from - - within a class scope. - - Fix the Zend.dsp project a bit. It seems someone pretty much killed it - - when commiting their own personal configuration. Please be careful in - - future. - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Make classes have scope and function/constant lookups default to the class - -2001-12-11 Andi Gutmans - - * zend.c: - Merge from ZE1 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: - - Rename zend_class_entry.constants -> zend_class_entry.constants_table - - * zend_execute.c: - - Start making scope change correctly when calling namespace functions. - - When inside a namespace fallback to global namespace when function - - or constant is not found. - -2001-12-11 Sebastian Bergmann - - * LICENSE: Forgot to update the LICENSE. - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h: Update headers. - - * Zend.m4 - zend.h: MFZE1 (AIX fixes) - - * zend_highlight.h - zend_highlight.c: MFZE1 (added zend_strip mode in the highliter) - -2001-12-10 Andi Gutmans - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - More namespaces work. - - Nuke memory leak. - -2001-12-08 Andi Gutmans - - * zend.c: - Fix crash with unhandled exceptions - -2001-12-06 Andi Gutmans - - * zend_execute.c: - Support constants. The following works now: - - - * zend_language_parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Initial work on changing namespace scope. Only methods & variables - - right now. - - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y: - - Nuke the namespace work I did. It'll be redone differently. - -2001-12-05 Sebastian Bergmann - - * ZEND_CHANGES: Document recent changes. - -2001-12-04 Andi Gutmans - - * zend_builtin_functions.c: - Damn Zeev :) - -2001-12-01 Andi Gutmans - - * zend_API.c: - - Revert one of the changes because it might be before the memory - - manager has started. - - * zend_API.c - zend_constants.c: - Use alloca() when possible. - -2001-11-30 Andi Gutmans - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - - Initial support for class constants. There are still a few semantic - - issues which need to be looked into but basically it seems to work. - - Example: - - - * Zend.m4: - Fix typo - -2001-11-27 Andi Gutmans - - * zend_language_parser.y: - - Support syntax for class constants (doesn't do anything yet but - - required some reworking of the grammar). - -2001-11-26 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Support static $var = 0; style initialization of static class - - members. For example: - - class foo { - - static $my_static = 5; - - - - } - - - - print foo::$my_static; - -2001-11-25 Andi Gutmans - - * zend.c - zend_compile.c: - Fix crash and leak - - * zend_compile.c: - Whitespace - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Support static members. The following script works: - - -2001-11-24 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - MFZE1 - -2001-11-15 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-11-05 stig - - * zend_objects.h: add newline at end of file to avoid warnings - - * zend_language_parser.y: non-zts compile fix - -2001-11-04 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Support instantiation of nested class. The following script now should - - work: - -bar(); - - - - $obj = new foo::barbara(); - - $obj->bar(); - - - -2001-11-03 Andi Gutmans - - * zend.h: - RISC OS patch by Alex Waugh - - * zend.c - zend_API.h - zend_compile.c: - Add some initializations - - * zend_compile.c - zend_execute.c - zend.h: - - Add constructor to the zend_class_entry instead of looking it up each - - time by name. - - This will allow the next patch of being able to instantiate nested - - classes such as new foo::bar::barbara(); - -2001-10-29 Andi Gutmans - - * zend_API.c - zend_opcode.c: - Fix internal classes - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_globals.h - zend_language_parser.y - zend_opcode.c: - Initial support for nested class definitions - -2001-10-27 Zeev Suraski - - * zend_execute.c: MFTGZE1 - -2001-10-26 Andi Gutmans - - * zend_execute_API.c: - Fix Zeev's MFZE1 - -2001-10-23 Zeev Suraski - - * zend_constants.c - zend_execute_API.c - zend_globals.h: MFZE1 - -2001-10-20 Andrei Zmievski - - * zend_API.c: MFHZ1 - -2001-10-12 Sebastian Bergmann - - * zend_API.c - zend_API.h - zend_modules.h: MFZE1: Introduced extension version numbers (Stig) - -2001-10-04 Sebastian Bergmann - - * zend_hash.c: MFZE1 - -2001-09-30 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Merge the NAMESPACES_BRANCH. It wasn't a good idea to have a branch when - - the whole CVS tree is work in progress - - * zend_compile.h - zend_execute.c: - - At last I've had some time to move all execute() locals into one struct. - - No immediate gain but it makes it more clear what variables are temps - - and which ones are execute() locals. - -2001-09-27 Andi Gutmans - - * zend_modules.h: - Bump it up in the right place - - * zend_modules.h: - Increase API number - -2001-09-26 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c: - Good catch by Sterling - -2001-09-24 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - More namespaces work - -2001-09-22 Sebastian Bergmann - - * ZEND_CHANGES: Keep ZEND_CHANGES up-to-date. - -2001-09-22 Zeev Suraski - - * zend_globals.h - flex.skl - zend.c - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-20 Andi Gutmans - - * zend.c - zend_compile.c: - Fix build on Win32 - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend.c: - - Create a branch for namespaces. This isn't even remotely close to - - working. - - * zend_list.h: - Nuke unused enum - -2001-09-19 Zeev Suraski - - * flex.skl - zend.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-19 Andi Gutmans - - * Makefile.am: - MFZE1 - -2001-09-19 Sebastian Bergmann - - * Makefile.am - zend_hash.c - zend_hash.h - zend_ini.c - zend_llist.c - zend_llist.h - zend_qsort.c - zend_qsort.h - Zend.dsp - ZendTS.dsp: MFZE1 - -2001-09-17 Brian L. Moon - - * RFCs/003.txt: adding RFC for loose type requirements for functions - -2001-09-16 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-09-10 Zeev Suraski - - * zend_compile.h - zend_globals.h - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: MFZE1 (nuke cplusplus code) - - * zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (support return value in execute_scripts) - -2001-09-08 stig - - * RFCs/002.txt: remove bogus comment :) - - * RFCs/002.txt: RFC document for namespaces - - * RFCs/001.txt: wrapped to 80 columns :) - -2001-09-07 Andi Gutmans - - * zend_compile.c - zend_language_parser.y: - - Shift around the variable parsing code to make it simpler. - - * zend_llist.c: - - Fix warning (was fixed in ZE1 and not merged at some point). Please make - sure you merge patches! - -2001-09-05 Stanislav Malyshev - - * zend_operators.c: MFZE1 - -2001-09-03 Andi Gutmans - - * zend_language_parser.y: - CLS_CC -> TSRMLS_CC - -2001-08-31 Sterling Hughes - - * zend_llist.h: spaces->tabs - - * zend_llist.c - zend_llist.h - zend_execute_locks.h: MFZE1 - -2001-08-31 Zeev Suraski - - * zend.c - zend_compile.h: MFZE1 - -2001-08-30 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Make it compile in thread-safe mode. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of warning and C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Initial support for exceptions. - -2001-08-30 Zeev Suraski - - * zend_execute.c: MFZE1 - -2001-08-28 Zeev Suraski - - * zend_language_scanner.l: MFZE1 - -2001-08-27 Andi Gutmans - - * RFCs/001.txt: - Add sample RFC - -2001-08-26 Stanislav Malyshev - - * Zend.m4 - zend.h: Add dlsym underscore detection, by Jani Taskinen - -2001-08-26 Andi Gutmans - - * zend_operators.c: - MFZE1 - - * zend_API.c: - - Merge Andrei's fix from Engine 1. Please commit patches to both trees! - -2001-08-21 Zeev Suraski - - * zend.c - zend_execute_API.c: MFZE1 - -2001-08-20 Zeev Suraski - - * zend_hash.c - zend_hash.h: MFZE1 - -2001-08-19 Andi Gutmans - - * zend.h: - Fix compile problem - -2001-08-19 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-08-18 Andi Gutmans - - * zend_execute.c - zend_llist.c - zend_llist.h: - Merge Sterling's patches from ZE1 - -2001-08-17 Andrei Zmievski - - * zend_execute.c: MFZE1 - -2001-08-17 Zeev Suraski - - * zend_alloc.c: MFZE1 - -2001-08-16 Zeev Suraski - - * flex.skl - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-08-16 Andi Gutmans - - * zend_execute.c: - Try and nuke get_object_zval_ptr() - - * zend_objects.c: - Remove bogus notice - - * zend_variables.c: - Sync with ZE1 - - * zend.h - zend_execute.c - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: - Fix a bug in method calls. - - Try to get the old copying behavior of objects to work (doesn't work yet). - -2001-08-15 Zeev Suraski - - * zend_extensions.c: MFZE1 - -2001-08-14 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend_variables.c - zend_variables.h: MFZE1 - -2001-08-13 Andi Gutmans - - * zend_execute.c: - MFZE1 - - * zend_execute.c: - Merge from Engine 1 - -2001-08-13 Zeev Suraski - - * zend_API.c - zend_operators.c - zend_operators.h: MFZE1 - -2001-08-12 Stanislav Malyshev - - * zend_API.h: _FUNCTION is used in definition, so use _D - -2001-08-11 Andi Gutmans - - * zend_API.c - zend_API.h - zend_objects.c - zend_operators.c: - More work on making objects work - - * zend_API.c - zend_objects.c - zend_objects.h - zend_operators.c: - - Fix some places which create objects. The fixes are ugly and will be - revised when things start working well - -2001-08-11 Zeev Suraski - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_ini.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_operators.c: Whitespace - -2001-08-11 Andi Gutmans - - * Makefile.am - zend_objects.c: - Fix UNIX build. - - * zend_compile.c: - - Need to do some rewriting in the parser instead of this. - - * zend.h: - - For Sebastian. Will allow to see you're using the Engine 2 CVS via - phpinfo() - -2001-08-10 Andi Gutmans - - * zend_API.h: - Merge from Engine 1 - - * zend_compile.c: - A couple of fixes - - * zend_API.h: - Merge from Engine 1 CVS - -2001-08-09 Andi Gutmans - - * zend.c: - Merge from Engine 1 tree - -2001-08-08 Andi Gutmans - - * zend.c - zend_compile.c - zend_compile.h - zend_globals.h: - Merge new $_GET, $_POST etc. patch from Engine 1 tree - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Preliminary patch for method() dereferencing - - * zend.c - zend.h: - Merge zend_try fix from Engine 1 - -2001-08-07 Zeev Suraski - - * ZendTS.dsp: Migrate .dsp patches - -2001-08-07 Andi Gutmans - - * ZendTS.dsp: - Forgot to commit the updated dsp - - * ZendTS.dsp: - More sync with latest CVS - - * zend_objects.c - zend_objects.h - zend_operators.h - zend_variables.c - ZendTS.dsp - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Sync Engine2 CVS with latest Engine CVS - -2001-08-06 Zeev Suraski - - * zend_indent.c: Commit uncommitted build fix - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - Fix an off by one lineno issue, in case of an implicit ; - - * flex.skl - zend_highlight.c: Better shared code - - * Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Merge from branch - move to standard C scanners in thread safe mode - - * Makefile.am - Zend.m4 - flex.skl - zend_ini_scanner.l - zend_language_scanner.l: Make the C++less scanner compile under UNIX - -2001-08-06 Andi Gutmans - - * zend_execute.c: - Move to using Z_ macros - - * zend_API.h: - Use Z_ macros - -2001-08-05 Zeev Suraski - - * zend_globals_macros.h: More nulled-out macros - - * zend.c - zend_API.c - zend_API.h: TSRMLS_FETCH work - -2001-08-04 stig - - * .cvsignore: added some more stuff to .cvsignore - -2001-08-03 Zeev Suraski - - * zend_alloc.c: Fix buglet - - * zend_alloc.c: Fix macro - - * zend.c - zend_alloc.c - zend_globals.h: - Implement fast memory allocation and reduced fragmentation under Windows. - - * zend_globals_macros.h: Some compat macros - -2001-08-02 Zeev Suraski - - * zend_execute.c: - require_once()/include_once will return true in case a file was not included - because it was already included earlier. - Changed the default return value type of the include() family from long to - boolean - - * zend_constants.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Avoid going over huge lists of functions, classes and constants. - Special thanks to the guys from the MS lab for the profiling tools :) - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: Some cleanup - - * zend_builtin_functions.c - zend_hash.c - zend_hash.h: TSRMLS fixes - - * zend_ini_parser.y: non ZTS build fix - - * Zend.dsp - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Implement a standard C thread safe scanner within flex - -2001-08-01 Zeev Suraski - - * flex.skl - zend_language_scanner.l: - Implement fast scanning in the multithreaded environment - -2001-07-31 Zeev Suraski - - * zend_language_scanner.l: the make Sebastian happy part of the day :) - - * zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: More TSRMLS_FETCH work - - * zend_list.c - zend_list.h: More TSRMLS_FETCH annihilation - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_hash.c - zend_hash.h - zend_ini.c - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c: More TSRMLS_FETCH work - -2001-07-30 Zeev Suraski - - * zend_language_scanner.l: Compile fix - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.c - zend_highlight.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_language_scanner.l - zend_modules.h: More TSRMLS_FETCH work - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_modules.h: - More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef - -2001-07-30 Andrei Zmievski - - * zend_API.c - zend_API.h: - Let's be consisten and keep TSRMLS_DC declaration after num_args. - -2001-07-30 Zeev Suraski - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_operators.c - zend_operators.h - zend_variables.c: More TSRMLS_FETCH annihilation - - * zend_API.c - zend_API.h: Get rid of more TSRMLS_FETCH's - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: Avoid TSRMLS_FETCH()'s (still lots of work left) - -2001-07-29 Andi Gutmans - - * zend_execute.h: - More object junk - - * zend.c: - Object macros... - -2001-07-28 Andi Gutmans - - * zend_operators.c: - Fix build - - * zend_operators.c: - More object macros. - - * zend_builtin_functions.c: - Use the Z_OBJ* macros for accessing objects - - * zend.h - zend_operators.h: - - Small patch to allow fixing the PHP tree to be compatible w/ the initial - - Zend 2 objects patch. Hopefully I can commit that this week. - -2001-07-28 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend.c - zend.h - zend_API.c - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_fast_cache.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_opcode.c: Redesigned thread safety mechanism - nua nua - -2001-07-28 sascha - - * zend.h: Fix build - -2001-07-27 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_globals_macros.h - zend_ini.c - zend_ini.h - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_modules.h - zend_operators.c - zend_variables.c - zend.c: Get rid of ELS_*(), and use TSRMLS_*() instead. - This patch is *bound* to break some files, as I must have had typos somewhere. - If you use any uncommon extension, please try to build it... - -2001-07-23 sascha - - * zend_alloc.c: tsrm_error is only available, if TSRM_DEBUG is defined. - -2001-07-21 Zeev Suraski - - * zend.c - zend.h: Always track bailout file/lineno - - * zend.c: Fix Release builds - - * zend.c - zend.h - zend_execute_API.c - zend_globals.h - zend_list.c: - Improve bailout mechanism, supports nesting of bailouts a-la try..catch - - * zend_hash.c: Fix compile warning - -2001-07-21 Andrei Zmievski - - * zend_compile.c: - Fix certain cases where inheritance of base class's overloaded handlers wasn't - being done. - -2001-07-20 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_list.c: - Implement a more granular shutdown mechanism for the executor - - prevent corruption of constants and missing destructions of resources - -2001-07-19 Zeev Suraski - - * zend_compile.c: Unfix, it has too strong effects - - * zend_compile.c: Catch all cases - - * zend_compile.c: Fix bug #11970, strike 2 - - * zend_execute.c: Revert bogus patch - -2001-07-18 Stanislav Malyshev - - * zend_operators.c: fix double->long conversion - -2001-07-17 Andi Gutmans - - * zend_hash.c: - Remove unused code - -2001-07-16 Zeev Suraski - - * zend_API.h - zend_compile.c - zend_globals.h - zend_variables.c: - Fix bug #10287 - avoid crashing under a bogus usage of list() - - * zend.h - zend_compile.c - zend_execute_API.c: Fix bug #10467 - -2001-07-15 Zeev Suraski - - * zend_hash.h: Minor cleaning - - * zend_language_parser.y: Optimize the parser a bit - - * zend_language_scanner.h - zend_language_scanner.l: Fix an inline - - * zend_variables.c - zend_variables.h: - Time to bid this old timer goodbye - get rid of var_uninit() - - * zend_hash.c: Fix bug #6239 - - * zend_language_parser.y: - Allow indirect reference to method names in class::method() construct - - * zend_execute_API.c: Fix bug #10257 - - * zend_execute.c: Fix bug #11970 - - * zend_compile.c: Fix bug #9884 - - * zend.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_scanner.l - zend_opcode.c: - Improved interactive mode - it is now available in all builds, without any significant slowdown - - * zend.c: Early initialization - -2001-07-13 Zeev Suraski - - * zend_hash.c: layout - -2001-07-13 Thies C. Arntzen - - * zend_hash.c - zend_hash.h - zend_list.c: - the resource-lists are now destroyed backwards. this will make sure that - resources get destroyed in the opposite order they were created and thereby - db-cursors will always be released before their corresponding connection etc. - this sould not break anything! - -2001-07-11 Zeev Suraski - - * zend_API.c - zend_ptr_stack.c - zend_ptr_stack.h: Remove the last couple of bogus inlines - -2001-07-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Move inline_zend_hash_func() to header file - -2001-07-11 Thies C. Arntzen - - * zend_API.h: fixed ZVAL_FALSE and ZVAL_TRUE - -2001-07-11 Stanislav Malyshev - - * zend_hash.h: No hashpjw anymore, but we have zend_hash_func - -2001-07-11 Zeev Suraski - - * zend_operators.c - zend_variables.h: Get rid of ZVAL_RESET... - - * zend_API.c - zend_operators.c - zend_variables.c - zend_variables.h: Get rid of some inlines - -2001-07-10 Andi Gutmans - - * zend_extensions.h - zend_hash.c - zend_hash.h: - Merge faster hash implementation. - - The hash function parameter in hash_init(...) is not used anymore. - - It should be removed but it is "to be decided" if we want to do that now - - or in a major version as it means changing MANY places and third party - - modules might stop working. - -2001-07-10 Thies C. Arntzen - - * zend_API.h - zend_variables.c: cleaned up the RETVAL_ RETURN_ and ZVAL_ macros - - added check for \0 at end-of-string at some places. all strings in PHP - have to be terminated with \0 because 3th party libraries might not be - binary-safe. - -2001-07-10 Andi Gutmans - - * zend_compile.c: - Commit Thies' patch. str.len was too long. - -2001-07-09 Andrei Zmievski - - * zend_API.c - zend_API.h: Adding new parameter parsing API. - -2001-07-09 Andi Gutmans - - * zend_hash.c - zend_hash.h: - - Significantly improve hash table performance by using djb's hash function - instead of hashpjw() and by using power of two sizes of hash tables (this - saves the % and isn't necessary with a good hash function). - Please try this patch. - -2001-07-03 Rasmus Lerdorf - - * zend_API.c: Trivial fix - but the period looks odd in error messages - -2001-06-30 Andi Gutmans - - * zend_alloc.c: - Fix the memory limit fix. - -2001-06-29 Andi Gutmans - - * zend_operators.c: - Remove bogus comment. - -2001-06-29 Zeev Suraski - - * zend_alloc.c: Fix memory_limit, kill warning - -2001-06-28 Zeev Suraski - - * zend_execute_locks.h: Fix warnings - -2001-06-27 Zeev Suraski - - * zend_execute.c: - Fix leak in the patch, and revert a couple of lines I didn't mean to commit - - * zend_execute.c: - Warn about illegal offsets - - Allow assignments to uninitialized string offsets (automatically pads the - string with spaces) - -2001-06-26 Zeev Suraski - - * zend_operators.c: - Fixed autoconversion of negative values to double (Fix bug #11685) - -2001-06-26 Andi Gutmans - - * zend_builtin_functions.c: - Fix crash bug (fix by Jani). - -2001-06-24 Andi Gutmans - - * zend.h: - Bump Zend version - -2001-06-21 Andi Gutmans - - * zend_execute.c - zend_execute_locks.h - zend_globals.h: - - Hopefully fix bug #11476 and improve garbage to be freed very quickly. - Tree tagged as PRE_GRANULAR_GARBAGE_FIX before commiting. - - * zend_execute_locks.h: - - Use inline instead of macro for PZVAL_LOCK()/PZVAL_UNLOCK() so that it - can be debugged. - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - Nuke dependency of all of PHP on zend_execute_locks.h. - -2001-06-21 Zeev Suraski - - * zend_execute.c: - Eliminate the leak that the original bogus code tried to solve - - * zend_compile.c - zend_execute.c - zend_globals.h: - parent::methodname() now works better with runtime classes (fix bug #11589) - - * zend_execute.c: - Fix bug #11590 (I want Andi to also review this patch before it goes into 4.0.6) - -2001-06-20 Andi Gutmans - - * zend_execute.c: - MFH - - * zend_execute.c: - Fix string offsets crash. - -2001-06-19 Andi Gutmans - - * zend_alloc.c: - Real MFH of memory fragmentation patch - - * zend_alloc.c: - Bad merge. Revert the previous patch (damn CVS). - - * zend_alloc.c: - MFH - - * zend_alloc.c: - - Fix memory fragmention problem which could lead to web server processes - growing much more than they should. (bug #11344?) - - * zend_execute.c - zend_execute.h: - MFH - -2001-06-19 Zeev Suraski - - * zend_execute.c - zend_execute.h: Add missing exports - - * zend_execute.c: Fix warning - -2001-06-13 Zeev Suraski - - * zend.c: MFH - - * zend.c: - Avoid crashing if the error reporting function is called after a bailout during shutdown - -2001-06-12 Zeev Suraski - - * zend_highlight.c: - Improve XHTML compliance (suggested by Anil Madhavapeddy) - -2001-06-10 Zeev Suraski - - * zend.c: Fix ZTS build problem - -2001-06-07 Andi Gutmans - - * zend_compile.h: - Avoid breaking op_array compatibility for 4.0.6 - -2001-05-30 Zeev Suraski - - * Zend.m4 - zend_execute_API.c: Add missing check - -2001-05-25 Andi Gutmans - - * zend_compile.c: - - Change if() to while() to make sure we skip enough opcodes - - * zend_compile.c: - MFH - - * zend_compile.c: - Fix memory leak - -2001-05-23 Andrei Zmievski - - * zend_builtin_functions.c: - Fix segfault -- need to copy-construct constant value. - -2001-05-21 Andrei Zmievski - - * zend_builtin_functions.c: Moving some functions into Zend. - -2001-05-20 sascha - - * .cvsignore: ignore ylwrap - -2001-05-20 Andi Gutmans - - * zend_list.h: - The previous name could be confused with resource # - - * zend_list.c - zend_list.h: - - Whitespace and change the name of the macro to something more verbose - ZEND_GET_RESOURCE_ID(...) - -2001-05-20 James Moore - - * zend_list.c - zend_list.h: - Add new ZEND_GET_LE macro for retrieving destructor - id's from remote extensions. (Jmoore, Zend Engine) - -2001-05-20 Andi Gutmans - - * zend_list.c: - Don't allow resource types of 0 - -2001-05-19 sascha - - * zend_hash.c: Fix segfault when using zend_hash_add_empty_element - -2001-05-18 Thies C. Arntzen - - * zend_alloc.c: reset allocated_memory_peak after each request. - -2001-05-17 Zeev Suraski - - * zend_language_scanner.l: That's slightly clearer that way :) - - * zend_alloc.c: Fix build - - * zend.c: MFH - - * zend.c: Fix corruption issue - -2001-05-16 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Implement zend_hash_add_empty_element() using the existing infrastructure - - * zend_globals.h: Commit missing fix - - * Zend.m4 - zend_alloc.c - zend_globals.h: Merge memory usage into memory limit - -2001-05-14 sascha - - * zend_hash.c: - Initialize empty pDataPtr to a pseudo value to prevent a pefree on - pData. - -2001-05-12 Andi Gutmans - - * zend_variables.c: - Remove check for ht == NULL in copy_ctor. - If ht is NULL at this point then we are better off crashing and fixing - the bug that caused it. - -2001-05-11 sascha - - * zend.h: add missing closing paranthesis - - * zend_hash.c: Some extensions don't associate any data with hash entries, - except the key. Prior to this change, a separate chunk of memory - was allocated in that case to store exactly zero bytes (plus - memory manager overhead). We treat that case similar to the - pointer case, but don't copy any data at all (because the pointer - is usually the NULL pointer). - - * zend_constants.c: - Fix a memory leak which occured upon registering an already existing - constant. - -2001-05-11 Thies C. Arntzen - - * Zend.m4 - zend_alloc.c - zend_globals.h: added --enable-memory-usage-info - -2001-05-11 Andi Gutmans - - * zend_opcode.c: - MFH - - * zend_opcode.c: - - Fix crash bug when opcodes array is erealloc()'ed to a different memory - area before it reaches the loop. - - Some whitespace stuff - -2001-05-10 Zeev Suraski - - * zend_operators.c: - Treat numeric strings as numbers in the increment operator - -2001-05-09 Andrei Zmievski - - * zend_API.c: Nuke unused variable. - - * zend_API.c: Fix a few bugs in zend_is_callable() and make it stricter. - -2001-05-08 Andi Gutmans - - * zend_language_scanner.l: - Fix line numbers when some lines end with \r - - * zend_opcode.c: - Fix crash bug reported by DBG author Dmitri Dmitrienko. - -2001-05-07 Zeev Suraski - - * zend.c: Make zend_execute_scripts() reentrant - -2001-05-06 Zeev Suraski - - * zend.c - zend_compile.c - zend_compile.h: - Recover from a parse error in include files (before, it could result in a crash under certain circumstances). Fix bug #8663 - -2001-05-06 Andi Gutmans - - * .cvsignore: - .cc files were renamed. Update .cvsignore. - -2001-05-06 Zeev Suraski - - * zend_operators.h: Yikes, that would have been a very bad bug :) - - * zend_execute.c: - Floating point keys didn't work in array() (fix bug #6662) - - * zend_compile.c - zend_execute_API.c: - Hear hear, interactive mode is finally showing some progress: - - Support function calls - - Fix crash bug - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l: Support interactive mode in thread-safe builds - - * zend_operators.h: Fix autoconversion of hexadecimal strings - It's time to close bug #5404 :) - - * zend_highlight.c: Retain single spaces as spaces to condense HTML - -2001-05-02 Andi Gutmans - - * zend_ini_scanner.l: - Support \r as newline in the ini scanner - - * zend_language_scanner.l: - Handle MAC OS X \r line endings - - * zend_execute.c: - - Patch by Andrei to prevent crash in error situation when not all - object overloading handles are defined. - -2001-05-01 Andi Gutmans - - * zend.h: - Bump up Zend version - -2001-04-30 Andi Gutmans - - * zend_builtin_functions.c: - Add mistakenly removen closing bracket - - * zend_builtin_functions.c: - Get rid of warning - - * zend_alloc.c: - - Try to solve crash on OS400. There is actually no reason I can see for - why his fix should solve a crash but it doesn't harm. - - * zend_execute_API.c: - Fix crash bug in interactive mode - -2001-04-29 Andi Gutmans - - * zend_alloc.h: - Whitespace - - * zend_alloc.c - zend_alloc.h: - Improve overwrite detection in debug mode. - - * zend_operators.c: - - Previous patch for too early freeing of resources seemed to have worked. - - Clean it up a bit. - - * zend_operators.c: - - Try and solve the too early resource destruction problem. - -2001-04-28 Zeev Suraski - - * zend.h - zend_hash.c - zend_language_scanner.l - zend_operators.c: include limits.h if available - - * zend.h: Fix bug 5661 - -2001-04-28 Andi Gutmans - - * zend_operators.c: - Move all cases into switch(). - - * zend_alloc.c: - Just some little whitespace stuff. - - * zend_alloc.c: - - Don't add/remove cached memory blocks from blocks list as this will slow - - down performance a bit. - -2001-04-28 Zeev Suraski - - * zend_operators.c: - Resources weren't being properly destroyed by the convert_to_*() functions - -2001-04-27 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_hash.c - zend_language_scanner.l - zend_operators.c - zend_operators.h: - More whitespace fixes while I'm at it. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_execute_API.c - zend_extensions.c - zend_language_scanner.l: - - Whitespace changes to be standard like the rest of Zend - -2001-04-24 Andi Gutmans - - * zend_execute.c: - Due to popular demand merge the foreach() crash fix. - -2001-04-24 Andrei Zmievski - - * zend_builtin_functions.c: MFH. - -2001-04-21 Andi Gutmans - - * zend_llist.c - zend_llist.h: - Add typedef for function pointer of llist dtor - -2001-04-20 Andi Gutmans - - * zend_execute.c: - - Fix for crash bug when using invalid arguments in the foreach() loop. - - Reported by Yasuo Ohgaki - -2001-04-19 Andi Gutmans - - * zend_API.h: - Patch from Jason Greene. - - Make it easier to write PHP function definitions in more than just one .c - file while accessing the same module globals. - -2001-04-17 Zeev Suraski - - * zend_alloc.c: small beautification - -2001-03-28 Zeev Suraski - - * zend_list.c: Fix warning - - * zend_list.c: Make Windows happy - - * zend_list.c: Get rid of more redundant code - - * zend_list.c: - Cleaner way of making sure resources start at 1 and not 0... - - * zend_list.c - zend_list.h: Remove redundant code - -2001-03-27 Zeev Suraski - - * zend_list.c - zend_list.h: God knows what this code was doing... - -2001-03-26 Andrei Zmievski - - * zend_builtin_functions.c: - Updated get_class_methods() to take class instance as well as class name. - - * zend_builtin_functions.c: - Making it possible to pass a class name to get_parent_class() as well - as a class instance. - -2001-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Fixing function name length. - -2001-03-19 Andi Gutmans - - * zend_language_parser.y: - - Add support for isset($var1, $var2, $var3); - Will be true only if all - - variables are set. - -2001-03-15 Andi Gutmans - - * zend_language_parser.y: - Nuke commented code - -2001-03-12 Andrei Zmievski - - * zend_API.c: Name length is already known. - -2001-03-12 Andi Gutmans - - * zend_API.c: - Missed second place. - - * zend_API.c: - Nuke snprintf() - - * zend_language_scanner.l: - White space - - * zend_language_scanner.l: - - Fix by Jani Taskinen for whole path also to work - with include_once()/require_once(). - -2001-03-12 Andrei Zmievski - - * zend_API.c - zend_API.h: - Improve zend_is_callable() to the point where it's actually useful. - Now it just needs to be invoked everywhere in PHP where a callback is - expected. - -2001-03-11 Andi Gutmans - - * Zend.m4 - acconfig.h: - Fix for Solaris. - -2001-03-10 Andi Gutmans - - * zend_execute.c: - Whitespace - -2001-03-07 Zeev Suraski - - * zend_ini.h: Add missing #define's - - * zend_compile.c - zend_execute.c: Make parent:: work in runtime bindings as well - -2001-03-06 sascha - - * Zend.m4: We actually only need AC_PROG_LEX here. - -2001-03-04 Zeev Suraski - - * zend_execute.c: Fix bug #8899 (thanks Jani) - -2001-03-03 sascha - - * Zend.m4: -Os is a valid GCC optimization level. - -2001-03-02 Zeev Suraski - - * zend_compile.c: Whitespace fix - -2001-02-28 Andrei Zmievski - - * zend_execute_API.c: Do case-insensitive class name matching when parsing - array('Class', 'method') structure. - You guys can clean it up, if there is a better way. - -2001-02-27 Andi Gutmans - - * zend_variables.c - zend_variables.h: - Nuke zval_del_ref() - -2001-02-27 Andrei Zmievski - - * zend_compile.c: Don't overwrite existing handlers with parent ones. - -2001-02-26 Andi Gutmans - - * Zend.dsp - ZendCore.dep - ZendTS.dsp - zend.c - zend_API.c - zend_API.h: - Rename modules.h to zend_modules.h - - * LICENSE: - One more copyright year update - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_modules.h: - Update copyright year - -2001-02-25 Andi Gutmans - - * zend_modules.h: - Fix dll linkage warnings - -2001-02-24 Andi Gutmans - - * zend_builtin_functions.c - zend_modules.h: - Add exports from Daniel Beulshausen - -2001-02-14 Stanislav Malyshev - - * zend.h: allow more extensions with resources - -2001-02-13 Zeev Suraski - - * zend_extensions.c: Move version registration to a more correct place - -2001-02-12 Andi Gutmans - - * zend_operators.c - zend_operators.h: - Remove two unused functions - - * zend_execute_API.c: - Fix whitespace. - -2001-02-12 Zeev Suraski - - * zend_execute_API.c: - Fix a bug that could cause corruption in case of an error during - get_zval_ptr() - -2001-02-09 Andi Gutmans - - * zend_execute.c: - - Remove duplicate code and do a tiny optimization in DO_FCALL - -2001-02-05 Zeev Suraski - - * zend_execute.c: Fix string offset data corruption - -2001-02-04 Andrei Zmievski - - * zend_execute_API.c: - Allow passing class name as well as an object instance to call methods. - -2001-02-03 Andrei Zmievski - - * zend_execute_API.c: - Set the correct function state during execution. This is mainly to have - get_active_function_name() to return proper value. - - * zend_compile.c: Inherit overloaded handlers. - -2001-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: - Added zend_is_callable() function that checks whether passed zval - represents a valid and exiting callable construct. - -2001-01-31 Andi Gutmans - - * zend_API.h - zend_API.c: - Change unset() functions to null(). unset() is legacy - - * zend_API.h: - - Quick fix. I'm for changing these to add_property_null() as we've nuked - - unset. - -2001-01-27 Andi Gutmans - - * zend_execute.c: - That doesn't seem like a smart thing to do :) - - I wonder if gcc optimized it out. - -2001-01-23 Thies C. Arntzen - - * zend_extensions.h - zend_ini_scanner.h - zend_list.c - zend_list.h: fix a couple of warnings - - * zend_API.c: fixed crash in add_index_bool. - -2001-01-22 Andrei Zmievski - - * zend_API.h: Make add_index_zval() available to the outside world. - -2001-01-21 Andi Gutmans - - * zend.h: - - Make people happy who like the Zend version number bumped up in parallel - with PHP. - -2001-01-20 Andi Gutmans - - * zend_API.c - zend_API.h: - - Patch from Sterling. Add API calls to add zval's as array indeces/ - object properties. Add _ex functions which take the string length as an - argument for better performance. - -2001-01-19 Andi Gutmans - - * zend_API.h - zend_API.c: - - For Sterling. I wonder if not all of the API functions should take the - - key_length as a parameter in order to save that strlen(). - -2001-01-17 Andi Gutmans - - * zend_execute.c: - - Fix leak in fetch_dim_address() which was already fixed in - - fetch_dim_object(). Take the oppertunity to make both use the same - - function and not duplicate the code. - -2001-01-16 Zeev Suraski - - * zend_list.c: Fix persistent resources, once and for all... - -2001-01-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: Add free_estring() - -2001-01-12 Zeev Suraski - - * zend_istdiostream.h: Add newline - -2001-01-12 Rasmus Lerdorf - - * zend_highlight.c: Fix for bug number 8666 - -2001-01-07 Zeev Suraski - - * zend_ini.c: Fix mismatch in return values - - * zend.c - zend.h - zend_alloc.c - zend_ini.c - zend_ini.h: - Remove backward dependency from PHP -> Zend - - Rename get_ini_entry() as get_configuration_directive() for clarity - (it doesn't use the INI subsystem, but the module-supplied function for - retrieving configuration directives) - - * Zend.dsp - ZendTS.dsp: Remove -S option on all bison calls - - * zend.c: - Fix possibility of a crash during startup (very unlikely, but possible) - -2001-01-06 Zeev Suraski - - * ZendTS.dsp: Remove -S - -2001-01-06 Andi Gutmans - - * zend_ini.c: - This slipped in by mistake. - -2001-01-05 Zeev Suraski - - * zend_ini.c - zend_ini.h: - Merge in some ZEND_API additions from Daniel Beulshausen (needed for the - Win32 Apache module) - -2001-01-04 Andi Gutmans - - * zend_list.c: - - Make plist_destructor work like list_destructor to allow it to call - extended destructors. - -2001-01-03 Zeev Suraski - - * zend.h: Fix Zend version while we're at it - - * zend_execute_API.c: Merge call_user_function_ex() fixes - - * zend_language_scanner.l: Merge line number corruption bug fix - - * zend_language_scanner.l: - Fix another case of possible line number corruption - - * zend.h: Commit missing declaration - -2001-01-01 Andi Gutmans - - * zend_execute.c: - Remove unreachable code - -2000-12-30 Zeev Suraski - - * zend_language_scanner.l - zend_opcode.c: Fix possible corruption in line number information - -2000-12-27 Zeev Suraski - - * zend.c - zend_globals.h - zend_ini.c - zend_ini.h - ZendTS.dsp: - Make the INI mechanism thread safe (or at least thread safer :) - -2000-12-26 Zeev Suraski - - * zend_compile.h: - Use iostream.h instead of istream.h (IBM's compiler doesn't come with istream.h, - and iostream.h should include it) - - * ZendTS.dsp - zend_ini_scanner.l - zend_istdiostream.h - zend_language_scanner.l: - - Use supplied istdiostream definition for the INI scanner too - - Add Release_TSDbg configuration - -2000-12-24 Zeev Suraski - - * zend_extensions.h: This needs updating as well - - * zend_execute_API.c: - More aggressive protection in call_user_function_ex() - -2000-12-23 Zeev Suraski - - * zend_execute_API.c: - Fix a possible crash bug in call_user_function_ex(), if the function is - in fact not a user function - -2000-12-22 sascha - - * zend.c - zend_modules.h: - Set the floating-point exception mask on FreeBSD to 0 (as do other - FreeBSD system applications). Also bump up the module API number - as the zend_hash_get_current_key change affects source and binary - compatibility. - -2000-12-22 Zeev Suraski - - * zend.c - zend_builtin_functions.c - zend_execute.c - zend_hash.c - zend_hash.h: - Allow get_current_key() not to return the key itself, instead of a duplicate - - * zend_hash.c: * Fixed a possible crash in get_class_methods() - -2000-12-19 Stanislav Malyshev - - * zend_language_scanner.l: Add support for ASP tags in one-line comment - -2000-12-18 Andi Gutmans - - * flex.skl: - Success! Yay! - - * flex.skl: - Yet another one. - - * flex.skl: - Testing - - * flex.skl: - No luck - - * flex.skl: - Make this damn commit stuff work. - - * flex.skl: - Testing - -2000-12-18 Stanislav Malyshev - - * zend.c: - Use HashPosition iterator instead of saving/restoring internal pointer - - * zend.c: Preserve internal pointer over print_r (fix #8289) - -2000-12-18 Andi Gutmans - - * zend_compile.c: - Fix leak with useless statements such as "foo"; - - * flex.skl: - - Testing Sascha's CVS commit script which should work with branches. - - * flex.skl: - Testing - - * flex.skl: - Testin - -2000-12-18 Zeev Suraski - - * flex.skl: Test, ignore - -2000-12-18 Stanislav Malyshev - - * zend_operators.c: Add notice when auto-converting array to string - -2000-12-17 Andi Gutmans - - * zend_language_scanner.l: - - Clean up the scanner a tiny bit while messing with it. - - * zend_language_scanner.l: - - %> without asp_tags should not be treated as inline_html but as regular - tokens. Of course the parser will die with a parse error which is the - correct behavior. - - * zend_language_scanner.l: - - Fix problem in one line comments with line endings such as ??> - -2000-12-17 Stanislav Malyshev - - * zend_operators.c: Fix #8279 (-2147483647 > 2147483647). - -2000-12-14 Zeev Suraski - - * zend_modules.h: Update module_api_no - -2000-12-13 Zeev Suraski - - * zend_API.h - zend_execute_API.c: - Fix call_user_function() with objects - it could leak under certain circumstances - -2000-12-12 Stanislav Malyshev - - * zend_operators.c: Fix #8195: strncasecmp returns incorrect value - -2000-12-07 sascha - - * zend_builtin_functions.c: - Hardcode strlen due to problems on SCO OpenServer 5.0.4 which defines - strlen to __std_hdr_strlen. - -2000-12-07 Stanislav Malyshev - - * zend_compile.c: Whitespace fix - - * zend_compile.c: Allow var $foo = array(ABC => 1) constructs - - * zend_builtin_functions.c: - Fix memory leak - get_current_key mallocs it's result, no need to - copy it. - -2000-12-06 sascha - - * zend_hash.c: - INIT_DATA/UPDATE_DATA assumed that pData elements of the size of a void - pointer would actually be aligned like a void pointer. This lead - to bus errors on architectures which don't allow unaligned 32-bit accesses. - -2000-12-05 Andi Gutmans - - * zend_language_parser.y: - - Support for $var =& new foo() syntax. This allows you to use objects - which create extra references to themselves in the constructor. - -2000-12-05 Zeev Suraski - - * zend_execute.h: Expose all timeout functions - -2000-12-02 sascha - - * acconfig.h - configure.in: - Use the hardly-documented third parameter of AM_INIT_AUTOMAKE to suppress - defining PACKAGE/VERSION. - -2000-11-27 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Allow passing references which are returned from functions and new - - statements to be passed by reference. - -2000-11-27 Andrei Zmievski - - * zend_builtin_functions.c: - Update class constants before trying to get default properties. - -2000-11-22 Andi Gutmans - - * zend_compile.c: - Remove code which has been commented out for ages. - -2000-11-22 sascha - - * zend_execute.c - zend_globals.h: Pass on the exit status - -2000-11-21 Zeev Suraski - - * zend_operators.c - zend_operators.h: Fix build - -2000-11-21 Andi Gutmans - - * zend_execute.c: - The baby patch wasn't that innocent :) - -2000-11-21 Andrei Zmievski - - * zend_builtin_functions.c: - Sterling's patch to make get_defined_vars() simpler and better. - -2000-11-20 Andi Gutmans - - * zend_execute.c: - NEVER copy and paste :) - - * zend_compile.c - zend_execute.c: - Baby patch towards making the damn pass-by-ref work. - -2000-11-20 Zeev Suraski - - * zend_extensions.h: Update API number - -2000-11-20 Stanislav Malyshev - - * zend.h: - Add macro to replace value of zval with another value while preserving - referencing structure - -2000-11-20 Andi Gutmans - - * zend_execute.c: - This patch is broken and needs more thorough fixing. - -2000-11-19 Andi Gutmans - - * zend_execute.c: - - Try and fix the problem when sending references returned from a function by reference. - -2000-11-19 Zeev Suraski - - * zend_alloc.h: Fix Zend build for non ZTS - -2000-11-18 Zeev Suraski - - * zend_alloc.c: Forgot to commit the non-debug build fix yesterday... - - * zend_alloc.c - zend_alloc.h: - Add thread-safety debugging information (idea - Dmitri Dmitrienko) - -2000-11-14 Stanislav Malyshev - - * zend_language_scanner.l: Restore compatibility with old broken way - - * zend_language_scanner.l: - Better 0x handling - not change non-0x number behaviour - - * zend_language_scanner.l: - Attempt at better handling long 0x-numbers, like 0xffffffff - -2000-11-13 Andi Gutmans - - * zend_extensions.c - zend_extensions.h: - Remove unused function - - * zend_extensions.h: - - Use typedef's for function pointers so that we can easily define arrays - - of these function pointers. - -2000-11-13 Stanislav Malyshev - - * zend_llist.c: - Fix zend_llist_apply_with_del - it should remove from list, - not only call dtor - -2000-11-12 Zeev Suraski - - * ZEND_CHANGES: Test, ignore - -2000-11-11 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Move SET_UNUSED() to header - - * zend_opcode.c: - Beautify by using the standard #define. - -2000-11-10 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Remove this damn thing once again. - - * .cvsignore: - Add files to .cvsignore thanks to Jon Parise - -2000-11-09 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Maybe it's OK now? :) - - * zend_compile.c - zend_compile.h: - Undo the previous commit for fixing $obj = new foo(). - - * zend_compile.c - zend_compile.h: - - Commit experimental patch to fix the problem when doing $a = new foo() - and the constructor assigns $this by reference to other symbol table - elements. Thanks to Daniel J. Rodriguez on this one. - -2000-11-08 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: Add ability to find extensions by name - -2000-11-06 sascha - - * zend_ini.c: Kill a misleading warning which is intended for old code - which assumes sizeof(int) == sizeof(void *). - -2000-11-03 Andi Gutmans - - * zend_ini_scanner.h: - Add trailing \n? - -2000-11-03 Zeev Suraski - - * zend_ini_scanner.l: Fix for bug #5571 (by mookid@sigent.ru) - -2000-11-03 Andi Gutmans - - * Makefile.am: - Fix dependency. - -2000-11-03 Zeev Suraski - - * zend_operators.h: Fix build - - * zend_operators.h: Add RESVAL macros - -2000-11-02 Zeev Suraski - - * zend.c: Fix bug #7599 - - * zend_language_parser.y - zend_language_scanner.l: Missed those - - * zend_API.c - zend_compile.c - zend_compile.h: Maintain consistency - -2000-11-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Replace do_exit() with zend_do_exit(). - - Problem reported by David Hedbor - -2000-11-02 Zeev Suraski - - * zend_ini_parser.y: Remove unnecessary variables - - * zend_ini.c: - explicit declaration here too - sigh, way too early in the morning - - * zend_ini.h: oops - - * zend_ini.h: explicit declaration - -2000-10-31 Zeev Suraski - - * zend_highlight.h: Fix Apache build - - * zend_ini.c - zend_ini.h: Remove unnecessary code, fix phpinfo() - - * Zend.m4: Require bison 1.28 - -2000-10-30 Zeev Suraski - - * Zend.dsp: Fix non-thread-safe Windows build - - * zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Final touches on the INI parser - -2000-10-30 Stanislav Malyshev - - * Makefile.am: Another attempt to make it build - - * Makefile.am - zend_ini_scanner.l: Fix build - -2000-10-29 Zeev Suraski - - * zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Fix leaks - - * zend_alloc.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: The new INI parser is showing some signs of life - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a corruption bug, when erroneously allowing to send non-variables by reference (several - bug-db reports seem to originate in this bug) - - * zend_extensions.c - zend_ini_parser.y: Fix build - - * zend_ini_scanner.h: Forgot this one - - * Makefile.am - ZendTS.dsp - zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: Generalization work - -2000-10-29 Stanislav Malyshev - - * zend_extensions.c - zend_extensions.h: - Allow module to proclaim compatibility with any Zend version - -2000-10-29 Zeev Suraski - - * Makefile.am - ZendTS.dsp - zend_ini_parser.y - zend_ini_scanner.l - zend_language_scanner.l: Some more work on the INI parser/scanner - - * Makefile.am - zend_ini_parser.y - zend_ini_scanner.l: Initial step in rewriting the INI parsing mechanism - - * .cvsignore - Makefile.am - Zend.dsp - ZendCore.dep - ZendTS.dsp - zend-parser.y - zend-scanner.h - zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l: Unify the names of these last 3 files... - - * Zend.dsp - ZendTS.dsp: Fix Windows build - - * Makefile.am - zend_ini.c - zend_ini.h - zend_operators.c - zend_operators.h: - Initial steps to move the INI mechanism to the Zend engine - -2000-10-27 Andrei Zmievski - - * zend_operators.h: Added macros for object properties and class entry. - -2000-10-26 Andi Gutmans - - * zend_API.c - zend_modules.h: - Fix new -m on Windows - -2000-10-25 Andrei Zmievski - - * zend_list.h: Remove the patch to register_list_destructors(). - -2000-10-20 Andrei Zmievski - - * zend_list.c - zend_list.h: - Fixed a bug in zend_rsrc_list_get_rsrc_type() - - Switched register_list_destructors() to use - zend_register_list_destructors_ex() instead - -2000-10-19 Andi Gutmans - - * zend_compile.c: - - Constant expressions which are used multiple times need to be copy_ctored - -2000-10-18 Andi Gutmans - - * zend_llist.c: - Fix whitespace - - * zend_extensions.c - zend_llist.c - zend_llist.h: - - Try #2. Wasn't allowed to delete in the previous manner because we were - in the middle of an llist_apply() - -2000-10-18 sascha - - * zend_fast_cache.h: - Add explicit conversion from 'void *', otherwise ANSI C++ compilers - will break out. - -2000-10-18 Andi Gutmans - - * zend_extensions.c: - Fix crash - -2000-10-17 Andi Gutmans - - * zend_builtin_functions.c: - Fix copy&paste bug - -2000-10-15 Andi Gutmans - - * zend_opcode.c: - - Increase op_array size faster and make eralloc() it in the end to save - memory. - -2000-10-14 Andi Gutmans - - * zend_builtin_functions.c: - Add another patch from Sterling. - - * zend_builtin_functions.c: - - Preliminary commit of Sterlings get_defined_functions()/get_defined_vars - functions - - * zend_extensions.c: - - Only run startup() if ZEND_EXTENSIONS is defined to 1. - This fixes a link error on platforms which don't support libdl - -2000-10-13 Andi Gutmans - - * zend_operators.c: - Make increment of "" become "1" - -2000-10-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: Don't use 'new' symbol - -2000-10-11 Zeev Suraski - - * zend_execute.c - zend_execute_API.c: - Fix -a interactive mode (no idea how the previous commit got committed) - - * zend_execute.c: *** empty log message *** - - * zend.h: Update version - - * zend_hash.c - zend_hash.h: Add zend_hash_merge_ex(), for selective merging - -2000-10-06 Andi Gutmans - - * zend_execute.h: - Fix Bug #7061 - -2000-10-05 Andi Gutmans - - * zend-scanner.l: - - Updated included_files() also for plain include()/require(). - -2000-10-04 Andi Gutmans - - * zend_alloc.c: - Fix fprintf - -2000-10-02 Andi Gutmans - - * zend_extensions.h: - Change zend_extension_api_no - -2000-09-30 Andi Gutmans - - * zend_builtin_functions.c: - Cleanup error output - -2000-09-28 Andi Gutmans - - * zend_hash.c: - - Another has optimization/fix like the hash_copy one from earlier on - -2000-09-28 Stanislav Malyshev - - * zend_hash.c: - Make hash_copy call copy constructor on a real copy, not on a temp - -2000-09-28 Andi Gutmans - - * ZendTS.dsp: - Remove zend_gcc_inline.c - -2000-09-26 sascha - - * Makefile.am - Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Remove --enable-c9x-inline option. We now use a syntax which is compatible - with all compilers by providing the function with static linkage in every - compilation unit. - -2000-09-25 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: - Fix previous update - move extension startup further down the startup sequence - - * zend.c: Move extension startup further down the startup sequence - -2000-09-19 Andi Gutmans - - * zend_operators.h: - Add Z_BVAL* macros - -2000-09-19 Stanislav Malyshev - - * zend_execute_locks.h: - Fix crash on Solaris with function parameter destruction - -2000-09-18 Stanislav Malyshev - - * zend_builtin_functions.c: - Made get_included_files() work again, in somewhat different way - -2000-09-17 Stanislav Malyshev - - * zend_compile.c: Set filename even on recursive include - -2000-09-14 Andi Gutmans - - * zend_execute.c: - - Fix NULL handling in ARRAY opcode and resolve memory leak - -2000-09-12 Zeev Suraski - - * zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.h: Make compile_string() accept a description of the code - -2000-09-11 Andi Gutmans - - * zend_compile.c: - - Forgot to create extended info in include()/require() call - -2000-09-10 Stanislav Malyshev - - * zend-parser.y: Allow require_once to take expressions, just like require - - * ZEND_CHANGES: Try once more to remove dups - - * ZEND_CHANGES: Test commit - weed out duplicate messages - -2000-09-09 Zeev Suraski - - * zend.c: Don't use unsafe sprintf() - -2000-09-08 Stanislav Malyshev - - * zend.c: Don't trust snprintf return - -2000-09-06 Andi Gutmans - - * zend_config.w32.h: - Save two lines - - * zend_config.w32.h: - Fix header - -2000-09-06 sascha - - * Zend.m4: Unless overwritten, default to no optimization in debug mode. - -2000-09-05 Andi Gutmans - - * zend_operators.h - zend_operators.c: - Commiting Sterling's new multi_convert* functions - -2000-09-05 Andrei Zmievski - - * zend_builtin_functions.c: Fix memory overrun. - -2000-09-05 Stanislav Malyshev - - * zend_builtin_functions.c: - Fix crash with trigger_error having no args (#6549) - -2000-09-04 Andi Gutmans - - * Makefile.am: - Remove two tabs - -2000-09-02 Andi Gutmans - - * ZendTS.dsp: - - Defining TSRM_WIN32 in each and every dsp sucked. Revert this change - - * ZendTS.dsp: - Fix windows build - -2000-08-31 Andi Gutmans - - * ZendTS.dsp: - - This should fix the performance problem with Release builds - - * zend-scanner.l - zend.c - zend_execute.c: - - Use emalloc() for opened_path now. This was a potential leak before. - - This patch has potential to break stuff but I tested it as much as I - - could. Fixes should be easy. - - * zend.c: - Remove support for __string_value() in print $obj - -2000-08-31 Zeev Suraski - - * zend.c: Safer shutdown process - -2000-08-29 Andi Gutmans - - * zend.h: - Update Zend version. - -2000-08-26 Andi Gutmans - - * zend_builtin_functions.c: - Don't define this function in non-debug mode - -2000-08-24 Andi Gutmans - - * zend_execute.c: - - Revert patch from 9/7/2000 which seems to have broken unset(). - - I hope what made me do this patch doesn't appear again. - -2000-08-22 Andi Gutmans - - * zend_execute_API.c: - - Fix bug report by Andrei when using a method as a sort user function - - parameter in usort() like functions - -2000-08-20 Zeev Suraski - - * zend_config.w32.h: Fix Win32 build - -2000-08-20 sascha - - * zend_config.w32.h: - _isnan seems to be supported on Win32, add an appropiate macro. - - * acconfig.h: If available, use fpclassify for substituting zend_finite. - - * acconfig.h: - Including math.h before using macros defined there will work better :) - - * acconfig.h: Add zend_isinf and zend_isnan. - -2000-08-19 Andrei Zmievski - - * zend-scanner.l: One more fix to C compile. - -2000-08-19 Zeev Suraski - - * zend-scanner.l: Fix C build - - * zend-scanner.l: Fix eval() leakage in ZTS mode - - * zend_compile.c - zend_globals.h: Eliminate run-time leak with eval()'s - - * zend_alloc.c: Fix build with no memory_limit - - * zend_alloc.c: Fix memory_limit - -2000-08-19 Andi Gutmans - - * zend_execute.c: - Beautify - -2000-08-17 Stanislav Malyshev - - * zend_API.h: Fix EMPTY_STRING macros - -2000-08-15 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: - Fix warning issue (compile errors inside require()'d files were incorrectly supressed) - -2000-08-14 Zeev Suraski - - * zend_execute.c: - Fix leak and some logic - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - This patch should hopefully fix situations where a constructor uses - - the $this pointer as a reference. - -2000-08-14 Stanislav Malyshev - - * zend_execute.c: Fix crash - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.h: - - Unused results should be marked with EXT_TYPE_UNUSED and not IS_UNUSED - -2000-08-13 Stanislav Malyshev - - * zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: Fix zend_fiel_handle handling. Should fix URL include - and various opened_path inconsistencies. - -2000-08-13 Andi Gutmans - - * zend-parser.y: - - Revert foreach() change which only allowed variables and array(...) - -2000-08-11 Andi Gutmans - - * zend-parser.y: - Only support variables and array(...) in foreach loops - -2000-08-10 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Fix problem with nested foreach()'s (Andi, Zend Engine) - - * zend_compile.c: - Fix switch which only has a default rule (Andi, Zend Engine) - Change require_once() to use the same file list as include_once(). - Patch includes making require() & include() to behave the same when it - comes to scoping. require() is now an include() which isn't allowed to fail. - require() caused too many memory reallocations which ended up being quite - slow for sites that required lots of files. (Andi & Zeev, Zend Engine) - - Fix switch() which only has default rule (bug #5879, - -2000-08-09 Zeev Suraski - - * zend_modules.h: that too - - * zend_extensions.h: Update API number - - * zend-parser.y - zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - The patch we promised - redesigned the compilation/execution API: - Advantages: - - Smaller memory footprint for the op arrays - - Slightly faster compilation times (due to saved erealloc() calls and faster zend_op - initialization) - - include_once() & require_once() share the same file list - - Consistency between include() and require() - this mostly means that return() - works inside require()'d files just as it does in include() files (it used to - be meaningless in require()'d files, most of the time (see below)) - - Made require() consistent with itself. Before, if the argument was not a constant - string, require() took the include() behavior (with return()). - - Removed lots of duplicate code. - Bottom line - require() and include() are very similar now; require() is simply an include() - which isn't allowed to fail. Due to the erealloc() calls for large op arrays, require() - didn't end up being any faster than include() in the Zend engine. - -2000-08-05 Andi Gutmans - - * zend_execute.c: - - Use some more SEPARATE_ZVAL macros instead of replicated code. - -2000-08-05 Stanislav Malyshev - - * zend_execute.c: Fix memory leak - -2000-08-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Beautify code. Try and use more macros for splitting instead of - - replicating the code everywhere. - -2000-08-02 Andi Gutmans - - * zend_execute.c: - Remove commented code - -2000-07-29 Zeev Suraski - - * zend-scanner.l - zend_execute.c: Fix filename issues - -2000-07-28 Stanislav Malyshev - - * zend_builtin_functions.c - zend_constants.c - zend_constants.h: - Make define return false and issue E_NOTICE when trying to redefine constant - -2000-07-27 Andi Gutmans - - * zend-scanner.l - zend_execute.c: Always store full filename as compiled file name - -2000-07-26 Zeev Suraski - - * zend_compile.c: - Fix a possible issue with runtime inheritence under fairly rare circumstance - and optimize a tiny bit - -2000-07-26 Stanislav Malyshev - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Add strncasecmp function - -2000-07-18 Zeev Suraski - - * zend_builtin_functions.c: Forgot to link this function... - - * zend_hash.c: This is probably the oldest bug in PHP :) - Luckily it's unlikely we're ever actually bitten by this bug. - -2000-07-16 Andi Gutmans - - * zend_compile.c: - Beautify Zeev's patch a bit. - -2000-07-16 Zeev Suraski - - * zend_compile.c: Implement parent::foo() - -2000-07-15 Zeev Suraski - - * zend-parser.y - zend_compile.c: Add more extended_info calls - -2000-07-14 Zeev Suraski - - * zend_builtin_functions.c - zend_list.c - zend_list.h: Improve register_resource_ex() infrastructure - -2000-07-12 Thies C. Arntzen - - * zend.c: fix ZTS startup without filename (thanx purify!) - - * zend.c: unset active_symbol_table on zend-shutdown. - -2000-07-11 Zeev Suraski - - * zend_list.c: Another persistent hash - disable apply protection - - * zend.c - zend_hash.c - zend_hash.h: - Disable the hash_apply() protection on hashes that persist across requests - it's unsafe - because we may be aborted at any point - -2000-07-11 Stanislav Malyshev - - * zend_execute.c: - Fix a bug in passing second parameter of RECV_INIT with is_ref set - -2000-07-11 Andi Gutmans - - * zend_compile.h: - Oops. Too early in the morning - - * zend_compile.h: - Include iostream.h in C++. - -2000-07-09 Andi Gutmans - - * zend_execute.c: - Fix memory leak. - - * zend_execute.c: - Need to seperate if the hash isn't a reference - -2000-07-08 Andi Gutmans - - * zend.h: - Add zend_ulong - -2000-07-07 Stanislav Malyshev - - * zend_execute.c: Remove C++ commennts. - -2000-07-06 Andi Gutmans - - * zend-scanner.l: - - Remove code which has never been used (neither in PHP 3) - - * zend_compile.c: - - Make is_method_call() static and remove a couple of old lines - - * zend_execute.c - zend_extensions.h: - Yet another fix... - - * zend_execute.c: - One more... - - * zend_compile.c: - One more fix for the latest patch - - * zend_compile.c: - One dumb bug in my latest patch - - * zend-parser.y - zend_compile.c - zend_execute.c: - - Complex fix for solving a problem with objects & method calls. - - Previous version is tagged PRE_METHOD_CALL_SEPERATE_FIX_PATCH. - - I need to check this fix on a server so if it doesn't work I will revert - - it. - - * zend-scanner.l: - - Fix problem with newlines not being recognized under certain conditions - -2000-07-03 Andi Gutmans - - * zend_compile.c: - Fix bug #4120 - -2000-07-03 Stanislav Malyshev - - * zend_execute_API.c: Unblock SIGPROF signal when starting timer. - On Linux, this signal is blocked by default after first signal is run - -2000-07-03 sascha - - * FlexLexer.h - zend-scanner.h - zend_alloc.h - zend_compile.h - zend_constants.h - zend_dynamic_array.h - zend_execute.h - zend_globals.h - zend_hash.h - zend_highlight.h - zend_list.h - zend_operators.h - zend_static_allocator.h - zend_variables.h: - Replace macros which begin with an underscore through an appropiately - named macro. - -2000-07-02 sascha - - * zend.h - zend_API.h - zend_builtin_functions.h - zend_config.w32.h - zend_dynamic_array.h - zend_errors.h - zend_execute_locks.h - zend_extensions.h - zend_fast_cache.h - zend_globals_macros.h - zend_indent.h - zend_llist.h - zend_modules.h - zend_ptr_stack.h - zend_stack.h: Change header protection macros to conform to standard. - - Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment" - - All identifiers that begin with an underscore and either an uppercase - letter or another underscore are always reserved for any use by the - implementation. - -2000-07-02 Andi Gutmans - - * zend-parser.y: - Take #2 with tab size 4 - - * zend-parser.y: - - Beautify parser a bit. It still could do with some more at some point - - * zend_execute.h - zend_execute_API.c: - Forgot ZEND_API - -2000-06-30 Zeev Suraski - - * zend_config.w32.h: - Add a messagebox style that's safe to use from an ISAPI filter - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: error_reporting fix - -2000-06-29 Zeev Suraski - - * zend.c - zend.h: Add $context argument to error handler - -2000-06-28 Zeev Suraski - - * zend.c: Improve error handling code - - * zend-scanner.l: Be HTML friendly - -2000-06-28 Andi Gutmans - - * zend.h: version update - -2000-06-26 Zeev Suraski - - * zend.h - zend_constants.c - zend_extensions.h: - Make it possible to detect whether we're thread safe or not from PHP scripts and the php.ini - file - -2000-06-26 Andi Gutmans - - * zend_extensions.c: - Add another "\n" at the end of error messages. - -2000-06-26 Zeev Suraski - - * zend_execute_API.c: - Make max_execution_time work properly when set to 0 under Win32 (disable) - -2000-06-25 Andi Gutmans - - * zend.c: - I wrote a long msg but the commit didn't go through. - - So here is the short version: - - a) Start moving to binary opens in Windows - - b) Give checkuid_mode() a small face lift including the fopen-wrappers.c - - The mode to this function should at least be a #define but that is for - - another day. Anyway this whole stuff should be given more face lifts in - - the future. - -2000-06-24 Zeev Suraski - - * zend_alloc.c: Nuke a warning - -2000-06-23 Andi Gutmans - - * zend_static_allocator.c - zend_static_allocator.h: - Not returning a value anymore - - * zend_static_allocator.h: - Don't need SUCCESS/FAILURE anymore - - * zend_static_allocator.c - zend_static_allocator.h: - Add license - - * zend_static_allocator.c - zend_static_allocator.h: - - Commit static allocator structure which we might use in an upcoming Zend - - change - -2000-06-22 Andi Gutmans - - * zend-scanner.l: - Fix asp_tags. - - * zend_extensions.c: - Oops I miss-wrote that field - - * zend_extensions.c - zend_extensions.h: - - Change API version and make the error messages more meaningful. - - * zend_alloc.c - zend_alloc.h: - Change cache size and only initialize part of it. - -2000-06-22 Stanislav Malyshev - - * zend_alloc.c: - Cached-freed memory blocks should not be in "occupied" list - - * zend_alloc.c - zend_globals.h: Make cache counters to be unsigned int - Start collecting statistics after cache pre-fill - -2000-06-18 sascha - - * Zend.m4 - acinclude.m4 - zend.c: fp_except check for FreeBSD 1.0-2.2.5 - - * Zend.m4 - acconfig.h - zend_config.w32.h - zend_operators.h: Welcome zend_finite(n). - - This chooses the best combination of what is available: - - finite, isfinite, isinf, isnan - -2000-06-18 Stanislav Malyshev - - * zend.h - zend.c: Make error callback be publicly accessible - -2000-06-18 Andi Gutmans - - * zend.c: - Better FreeBSD fix. Does fp_except_t exist on 3.4? - - * zend.c: - - I don't know how this happened. I tested the bloody thing and I remember - - copy&pasting from code which used ~. - -2000-06-17 Zeev Suraski - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c - zend_ptr_stack.h: - Add restore_error_handler() - error_handler's are now stored in a stack - - * zend-scanner.l - zend.c - zend_API.h - zend_execute_API.c: - Allow the symbol_table to be passed to call_user_function_ex() - - * zend-scanner.h - zend-scanner.l: Fix filenames and line numbers in ZTS mode - - * zend_hash.c - zend_hash.h: - Avoid crashing with recursive applies - limit apply nest level to 3 (I'm not aware of a place - in which applying recursively on the same hash makes sense with more than one nest level, but - 3 should be enough) - -2000-06-16 Zeev Suraski - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Ok, this time here's some real Win32 system programming :) - Redesigned the timeout system using a single timeout thread and a single window, - and used a much quicker check. - -2000-06-16 Andi Gutmans - - * zend_execute_API.c: Fix UNIX build - -2000-06-16 Zeev Suraski - - * zend_execute.c: Macro it up the right way - - * zend_execute.c: Macro this up, so it can be moved to other places - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Move timeout code to Zend - - Implement timeouts in Win32 - -2000-06-15 Zeev Suraski - - * Zend.dsp - zend.c: - Fix non thread-safe mode - asp_tags/short_tags etc weren't getting initialized properly - -2000-06-15 Andi Gutmans - - * zend_list.c: *** empty log message *** - - * zend-parser.y: - Support multiple arguments to unset() - -2000-06-15 Thies C. Arntzen - - * zend_list.h: ups. - - * zend_list.h: - changed return type of ZEND_VERIFY_RESOURCE from FALSE to NULL - -2000-06-14 sascha - - * zend_operators.h - zend_operators.c: - Move some stuff to zend_operators.h which is required by the - moved inline functions. - -2000-06-14 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: - More correct way of doing bit mask - -2000-06-14 sascha - - * Zend.m4: Only replaced C0X and C0x, but not c0x.. - - * Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Rename C0x-inline to C9x-inline, and frame preprocessor directives in - zend_gcc_inline.c with #ifndef C9X_INLINE_SEMANTICS..#endif. - -2000-06-14 Andi Gutmans - - * ZendTS.dsp: - Make Win32 build - -2000-06-13 Andi Gutmans - - * zend_compile.c - zend_compile.h: Add to the API - -2000-06-13 sascha - - * Makefile.am - Zend.m4 - zend_API.h - zend_compile.h - zend_execute.h - zend_execute_API.c - zend_gcc_inline.c - zend_globals.h - zend_operators.c - zend_operators.h: Add optional support for C0x inline semantics. - - These are enabled by specifying `--enable-c0x-inline' on the command - line. We might add an autoconf check for this particular feature - later. - - * zend_llist.h: - Add llist_apply_func_t and make prototypes use the typedefs. - -2000-06-12 Zeev Suraski - - * zend_builtin_functions.c: Make Egon happy :) - - * zend_builtin_functions.c: - Return the previous error handler from set_error_handler() - - * zend_API.c - zend_API.h - zend_builtin_functions.c: - Avoid using E_CORE_* errorlevels in any place which is not in the global startup sequence - - * zend-parser.y - zend-scanner.l - zend.h - zend_compile.c: Get rid of - -2000-06-11 Andi Gutmans - - * zend.c: - Solve floating point precision crash on FreeBSD. - - * zend.c: - - Fixes crash problem on FreeBSD when losing precision. Need to still see - - how to detect we're on FreeBSD - -2000-06-11 Zeev Suraski - - * zend_API.c: Fix zend_get_parameters() - -2000-06-10 Andi Gutmans - - * zend_operators.c: - - Fixed problem when using uninitialized values in comparisons with strings. - - They behave as empty strings again just like in PHP 3. - -2000-06-10 Zeev Suraski - - * zend_execute.c: - I can't think of a reason of why it should just be a notice... Make it a warning, like it was in PHP 3. - - * zend_API.c - zend_builtin_functions.c: Fix bug #4768 - -2000-06-09 Andrei Zmievski - - * zend_builtin_functions.c - zend_hash.h: Made an alias for hash apply with arguments. - -2000-06-09 Andi Gutmans - - * zend_alloc.c: - Forgot to remove the FIXME - - * zend_alloc.c: - Make the memory limit accurate - - * zend_alloc.c: - Fix cache initialization - - * zend_alloc.c - zend_alloc.h: - - Allocate and cache in 8 byte blocks. Most allocators anyway use 8 byte - - blocks. This should help fragmentation and cache hits. - - The old tree is tagged as PRE_EIGHT_BYTE_ALLOC_PATCH - -2000-06-09 Zeev Suraski - - * zend_execute.c: Fix bug #4933 - - * zend_builtin_functions.c: Fixed bug #4819 - -2000-06-09 Andi Gutmans - - * zend_modules.h: - - Time to change it. We changed register_internal_class() -> - - zend_register_internal_class() - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Andrei, this is for you! - - Add zend_register_internal_class_ex() which allows you to specify a - - parent to inherit from. You can either specify the parent directly or via - - its name. - - * zend-parser.y - zend-scanner.l: - Typo - - * zend_execute.c: - Remove old obsolete code. - - * zend_execute.c: - Make unset consistent with the way array offsets work - -2000-06-09 Stanislav Malyshev - - * zend_execute.c: Handle unset with empty key - -2000-06-09 Andi Gutmans - - * zend_API.c - zend_API.h: - - Change register_internal_class to zend_register_internal_class for - - consistency. - - Andrei: I'm still thinking about the _ex you want me to implement - -2000-06-08 sascha - - * Zend.m4 - acconfig.h: Clean up acconfig.h - - * zend_execute_API.c - zend_operators.c: Add a couple of casts - -2000-06-06 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: - Enable asp_tags/short_tags/allow_call_time_pass_by_reference to work on a per-directory - basis as well - -2000-06-06 sascha - - * zend_API.c: - Add newline at the end of the file (breaks at least SCO and Tru64 C compiler). - -2000-06-05 Andi Gutmans - - * zend-scanner.l: - Revert internazionalization fix. - - * zend_builtin_functions.c: - Complete change to create_function() - -2000-06-04 Zeev Suraski - - * zend_compile.c - zend_execute_API.c: - Change shutdown order to sort out a crash when assigning a resource id to a static. - - * zend_hash.c - zend_hash.h - zend_operators.c: - Support unordered hash comparisons - - Make == perform an unordered comparison with arrays/objects, and === perform an ordered comparison - - * zend_builtin_functions.c: Rename lambda() - -2000-06-03 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Support comparisons of arrays (with arrays) and objects (with objects) - -2000-06-03 Andi Gutmans - - * zend.c: - Change #if to #ifdef. - -2000-06-03 Zeev Suraski - - * ZendTS.dsp - zend.c: Don't take chances with new include files - - * zend_execute_API.c: - Improve call_user_function() to support array($obj, $method) - - * zend-parser.y - zend.h - zend_operators.c: - Export normalize_bool - - This global/static syntax fix brought us back to the 4 documented conflicts - - * zend_builtin_functions.c: Fix a lambda() bug - - * zend_builtin_functions.c: Add missing { - - * zend_globals.h - zend_hash.c - ZendTS.dsp - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h: - Fix Win32 compilation (Use winsock2.h from now on) - - Add lambda() support - -2000-06-02 Andi Gutmans - - * zend-parser.y: - global/static require a trailing ';' - -2000-06-02 Zeev Suraski - - * zend_builtin_functions.c: Update error code - - * zend.c - zend.h - zend_config.w32.h: Nuke the old error code, use the new one - -2000-05-31 Zeev Suraski - - * zend.h: IS_BC isn't really being used, but still... - - * zend-parser.y - zend.h - zend_API.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_variables.c: - Fix a bug in static initializers/default values/class member variables that contained - array values - -2000-05-29 Zeev Suraski - - * zend_API.c - zend_API.h: Allow disabling of functions for security reasons - -2000-05-28 Andi Gutmans - - * zend_operators.c: - - Use pointer arithmetic to speed up the function a bit - - * Zend.m4: - This should have been done for 4.0.0. - - Default build is without debug now. Use --enable-debug if you want a - - debug build which includes leak/memory overwrite etc. detection - -2000-05-26 Andi Gutmans - - * zend-scanner.l - zend_operators.c - zend_operators.h: - - Fixed scanning decimal numbers in internationalized environments. They should - - always be in standard US format e.g. 23.3 - -2000-05-25 Zeev Suraski - - * zend_compile.c: - Fix a crash bug in certain situations of class redeclarations - -2000-05-24 Thies C. Arntzen - - * zend_hash.h: rename hastable -> _hashtable to avoid clashes - - * zend-scanner.l: - add rdbuf() to our own istdiostream implementation, allowing C++ compile - using SUN and SGI native compilers. (by Jayakumar Muthukumarasamy ) - -2000-05-22 Zeev Suraski - - * zend.c: - Remove ugly Ltd. - -2000-05-21 Sam Ruby - - * zend.c: Windows build failure - -2000-05-21 Andi Gutmans - - * zend.c - zend_compile.h: - - Fix Apache php source highlighting mode. It was crashing due to the - - module shutdown functions being called when the startup functions weren't - - being called. - - * zend.h - zend_extensions.h: - Get ready for release - -2000-05-19 Zeev Suraski - - * zend_highlight.c - zend_highlight.h: Open these up for the API - -2000-05-18 Zeev Suraski - - * zend_alloc.c: Do it in thread unsafe mode for now. - -2000-05-18 sascha - - * zend_alloc.c: Kill warnings - -2000-05-18 Andi Gutmans - - * zend_alloc.c: - Do this someplace else. - - * zend_execute.c - zend_operators.c: - - Fix include() when used on resources (shouldn't work but shouldn't crash - either). - -2000-05-18 Andrei Zmievski - - * zend_operators.c: - Update for sort functions - user can now specify sort type. - -2000-05-17 Andi Gutmans - - * zend_operators.h - zend_operators.c: - - Add support for string_compare_function() and number_compare_function(). - UNTESTED! - -2000-05-17 Zeev Suraski - - * zend_operators.c: Normalize results of compare_function() - - * zend-scanner.l: - Fix crash if %> is encountered in HTML while ASP-tags are disabled - -2000-05-17 Andi Gutmans - - * zend_opcode.c: Fix order - -2000-05-17 sascha - - * zend_operators.h: Add missing prototype - -2000-05-16 Zeev Suraski - - * zend_alloc.c: - - Small optimization. Filling up the Cache helps performance. - -2000-05-12 sascha - - * Makefile.am: Fix parallel makes on BSD - -2000-05-11 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.h - zend_operators.c: - Get rid of chval - it's really not necessary and seems to be confusing people - - * zend_compile.c: Refined fix - - * zend_compile.c: - Fix a memory corruption bug with by-ref function arguments - -2000-05-10 Andi Gutmans - - * zend_extensions.h: - Bump up Zend extension version number - -2000-05-10 Thies C. Arntzen - - * zend_compile.c: make waning readable - -2000-05-08 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_opcode.c: Thoroughly initialize IS_UNUSED for proper cleanup - - * zend.h: - Change Zend Engine version number - - * zend_alloc.c: - Return real size allocated - -2000-05-08 Zeev Suraski - - * zend_operators.c: Make zend_binary_strcasecmp compile again - -2000-05-08 sascha - - * zend_operators.c: Make strcasecmp() act correctly WRT SUS II. - - Patch by: hholzgra@php.net - PR: #3556 - -2000-05-06 Andi Gutmans - - * zend_execute.h - zend_execute_API.c: - Make zend_eval_string() return SUCCESS/FAILURE - - * zend_execute.c: - - Make $obj->test = 5; work again (assigning to uninitialized objects) - -2000-05-05 sascha - - * Zend.m4: - Linking directly against libc might result in unexpected behaviour. - We check for dlopen in libdl first, and check then whether dlopen exists. - -2000-05-03 Andi Gutmans - - * zend_compile.h: - Change fetch_type to be zend_uint - - * zend_compile.c - zend_execute.c: - Change the place CAST uses for the op_type - -2000-05-02 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Change zend_hash_get_current_key_ex() to also return the string length - -2000-05-02 sascha - - * zend_API.c: - Fix segfault occuring when a temporary module was unloaded and if this - module did not have a request shutdown function. - - * zend_API.h: - Add ZEND_GET_MODULE(name). This is a short-cut for the common - get_module function. - -2000-05-01 sascha - - * zend.c: - Source file does not end with a newline. Some old compilers don't like that. - -2000-05-01 Andrei Zmievski - - * zend_builtin_functions.c: Added a way to get all declared classes. - -2000-05-01 sascha - - * Makefile.am: Fix dependency - -2000-04-29 Zeev Suraski - - * zend_extensions.h - zend_opcode.c: - Pass the op_array to the ctor/dtor, instead of just the resource - - * zend_extensions.c: crash fix - - * zend_extensions.c - zend_extensions.h - zend_llist.c - zend_llist.h: - Add zend_llist_apply_with_arguments() - - Add a message handler to the extensions - - * zend_compile.h - zend_opcode.c: - Fix possible bug with extension dtors being called without the ctors being called first - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_opcode.c: Beautify - -2000-04-28 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: Fix a bug in the resource dispencer - - * zend_operators.c - zend_operators.h: Make convert_to_string() allocations traceable - -2000-04-27 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: *** empty log message *** - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: Change to using the #define's - - * zend.c - zend.h: More error handling work (still completely disabled) - -2000-04-26 Zeev Suraski - - * zend_execute_API.c - zend_variables.c: Fix - forgot to split away if refcount>1 - -2000-04-25 Zeev Suraski - - * zend_extensions.c: Fix bug - - * zend.h: We'll need two... - - * zend_hash.h: Add useful macros - -2000-04-25 Andi Gutmans - - * zend_llist.c: - Fix persistence of llist - -2000-04-24 Zeev Suraski - - * zend_compile.c: - Forgot to keep the ':' in the class_name - - * zend_API.c: Correct fix - -2000-04-24 Thies C. Arntzen - - * zend_API.c: MODULE_TEMPORARY should get a call to RSHUTDOWN as well! - - * zend.c: - fixed shutdown crash if MSHUTDOWN tries to php_error() something. - -2000-04-21 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: export zval_add-ref and zvale_del_ref - -2000-04-20 Zeev Suraski - - * zend_operators.h: - Change macro names from Z to Z_ - - * zend_operators.h: Add some macros for nicer zval handling - -2000-04-20 Andrei Zmievski - - * zend_operators.c: Do proper ieeefp.h check. - -2000-04-20 Thies C. Arntzen - - * zend_operators.c: - compile before commit! compile before commit! compile before commit! - - * zend_operators.c: - revert andrei's path (i can't compile anymore on linux) - we're always using #ifndef HAVE_BLA instead of if !HAVE_BLA and if we need ieeefp.h for some weird platform (which one is that?) we need an autoconf check for it. - -2000-04-19 Andrei Zmievski - - * zend_operators.c: Include proper files for finite. - -2000-04-19 Zeev Suraski - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: - Initial support for trapping errors (not complete and disabled; will be enabled only - post-PHP 4.0.0) - - * zend_builtin_functions.c - zend_constants.c - zend_errors.h: - - Renamed get_used_files() to get_required_files() for consistency - - Documented some functions - - Added user-level warning messages - - Added user_error() - -2000-04-19 Andi Gutmans - - * zend_opcode.c - zend_compile.h: - Export pass_include() for Windows - -2000-04-18 Zeev Suraski - - * zend_operators.h: - Add convert_to_writable_*_ex() macros (unused at this time) - -2000-04-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix order of JMPZNZ arguments - -2000-04-17 Thies C. Arntzen - - * zend_operators.c: ups, finite is already a macro on Win32 - - * Zend.m4 - zend_operators.c: HPUX11 only has isfinite() - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - Fix leak in require_once() - -2000-04-15 Thies C. Arntzen - - * zend_extensions.c: fixes compile on platforms without dl() support. - -2000-04-15 Zeev Suraski - - * zend.c: Fix ZTS - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - "use" is not yet supported; instead use include_once() or require_once() - for the time being (Andi, Zend library) - -2000-04-15 Zeev Suraski - - * zend.c - zend_API.c - zend_compile.c - zend_execute_API.c - zend_list.c - zend_list.h: - Clean up resource lists namespace - - Prepare extended resource list destructor APIs (currently unused) - -2000-04-13 Zeev Suraski - - * zend_operators.c: - Fix a memory leak when using assign-op bitwise operators on strings - -2000-04-12 Zeev Suraski - - * zend_execute.c: *** empty log message *** - -2000-04-11 Andi Gutmans - - * zend_execute_API.c: - Fix memory leak - -2000-04-11 Zeev Suraski - - * zend_execute.c: Fix warnings - - * zend_execute.c: Fix fd leak in include_once() - -2000-04-10 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - -2000-04-10 Zeev Suraski - - * zend.h - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_operators.c: Fix object overloading support - -2000-04-10 Andi Gutmans - - * zend_execute.c: - Add warnings - - * zend_compile.c: - Two more places needed changing - -2000-04-10 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.h: Clean up last/size definitions - -2000-04-09 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -2000-04-07 Zeev Suraski - - * zend_execute.c: Thoroughly fix include_once() - - * zend_execute.c: Fix include_once() - -2000-04-06 Andi Gutmans - - * zend-parser.y: *** empty log message *** - - * zend_execute.c - zend_execute.h: Initial preparation for OO overloading patch - -2000-04-05 Andi Gutmans - - * zend_extensions.h: - Bump up version number - - * zend_compile.c - zend_execute.c: - FIx JMPZNZ - -2000-04-03 Zeev Suraski - - * zend_list.c: - Fix the problem with dl()'d modules not freeing their resources properly - -2000-04-01 Zeev Suraski - - * zend_API.h - zend_config.w32.h: *** empty log message *** - - * acconfig.h: Have a standard way of exporting symbols - - * zend_modules.h: Use int - - * zend_API.h: Generalize some common thread-safety stuff - - * zend_modules.h: Have a standard entry for the globals id - -2000-03-31 Zeev Suraski - - * zend_compile.c: - The previous fix ended up being broken, this one should do it - -2000-03-31 Andi Gutmans - - * zend_compile.c: - Fix bug - -2000-03-30 Zeev Suraski - - * zend_extensions.c: Fix zend_register_extension() - -2000-03-30 Andi Gutmans - - * zend_extensions.h: - Bump up API number after Lars' change - -2000-03-30 sascha - - * Makefile.am: Give another hint to BSD makes - - * Makefile.am: - Specifically mention $(srcdir), so that OpenBSD's make gets it - -2000-03-29 Zeev Suraski - - * zend_stack.c - zend_stack.h - zend_compile.c: - - Make the argument order for the stack applies more consistent with other Zend - data structures - - Fix a possible corruption problem due to switch() C-level optimization - -2000-03-29 Torben Wilson - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Added !== (is not identical) operator. - -2000-03-29 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: *** empty log message *** - -2000-03-29 Andi Gutmans - - * zend_API.h: - - Make sure zend_API.h has Zend'ish versions of the ZEND macros so that - Zend'ish modules don't need to mix PHP & Zend notation. - -2000-03-28 Zeev Suraski - - * zend_builtin_functions.c: - The checks for func_num_args() and friends were broken - fixed - -2000-03-27 Sam Ruby - - * Zend.dsp: Remove debug libraries from debug build - -2000-03-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_API.c - zend_builtin_functions.c: - Stop zend_func_args() and co. from crashing - - * zend.h: - - Didn't see Thies' commit message although I can't really see how it would - make a difference - - * zend.h - zend_opcode.c: - Include Andrea's fix for alloca.h - -2000-03-26 Thies C. Arntzen - - * zend.h - zend_execute.c: - needs to be included before we define macros calling alloca() - atleast using SGI's cc - should not harm other platforms (i hope) - - * zend_opcode.c: fix cast - -2000-03-25 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: *** empty log message *** - -2000-03-25 Zeev Suraski - - * zend-parser.y - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: - Some header dependencies cleanup - - Generalize zval_print() and zval_print_r() - -2000-03-25 Sam Ruby - - * zend.h: RTLD_NOW => RTLD_LAZY|RTLD_GLOBAL - -2000-03-25 Zeev Suraski - - * Zend.dsp: Update dsp's - -2000-03-24 Zeev Suraski - - * zend_execute.c: - - Fixed a crash when sending a non-variable expression to a runtime-bound function - that expected a reference. - -2000-03-24 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Nuke hash_*_ptr functions - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Use WRONG_PARAM_COUNT. - -2000-03-23 Zeev Suraski - - * zend_builtin_functions.c: - Make it compile - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Added get_class_methods(). - -2000-03-22 Andi Gutmans - - * zend.h: - Change Zend version as API has changed - -2000-03-22 Zeev Suraski - - * zend_operators.c: - Wrong fix - - * zend_operators.c: - Only free when result != op1 - -2000-03-21 Andi Gutmans - - * zend.c - zend.h: - - Change zend_startup to accept a flag for starting builtin functions - - * zend.h - zend_API.h: - Move #defines - -2000-03-19 Thies C. Arntzen - - * zend_compile.h: kill warning - -2000-03-18 Andi Gutmans - - * zend.h: - Fix compile problem on FreeBSD - - * zend.h: - - No reason for refcount to be signed and move to zend_* typedefs - -2000-03-18 Thies C. Arntzen - - * zend.c: renamed _string_value_() to __string_value(). - -2000-03-18 Zeev Suraski - - * zend_builtin_functions.c: - The third argument to define() wasn't working right, fixed - - * zend_execute.c: - false wouldn't automaticaly switch to an array type, which resulted in an - incompatibility with PHP 3. Fixed. - -2000-03-16 Thies C. Arntzen - - * zend.c: renamed "to_string" -> "_string_value_" - -2000-03-15 Zeev Suraski - - * zend-scanner.l - zend.h - zend_execute.c: - Fix newly introduced problem reported by Sam Ruby - -2000-03-15 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Make zend_hash_move_forward()/zenv_hash_move_backwards() a little smarter. - -2000-03-15 Zeev Suraski - - * zend_opcode.c: - Fix warning (I thought I fixed this one before) - -2000-03-14 Andrei Zmievski - - * zend_llist.c - zend_llist.h: Implemented external list traversing. - -2000-03-14 Andi Gutmans - - * zend-parser.y: - - Allow array(1,2,3,) i.e. with trailing comma. You can only have one - trailing comma. - -2000-03-13 Zeev Suraski - - * zend_compile.c: - - - * zend_compile.c: - Spare a byte :) - -2000-03-13 Andi Gutmans - - * zend_compile.h - zend_modules.h: - Another zend_uchar - - * zend_compile.c: *** empty log message *** - - * zend.h - zend_compile.h: - - define zend_uint and zend_uchar and use them in a few places - -2000-03-13 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Introduced a way to traverse hashes through external pointers. - -2000-03-13 Andi Gutmans - - * zend_compile.h: - Change type from int -> char - -2000-03-13 Zeev Suraski - - * zend-scanner.l: - Fix filename/lineno initialization for do_return - -2000-03-12 Zeev Suraski - - * zend_builtin_functions.c - zend_modules.h: - - -2000-03-11 Andi Gutmans - - * zend_execute.c: - - Remove inline from functions which are pretty large and besides eating up - memory in compile time probably doesn't boost performance. - -2000-03-10 Andi Gutmans - - * zend_operators.c: - - Seems to be a problem here with the return value not being set - - * zend-parser.y - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - Quick way of supporting include_once(). - Good enough for RC1. - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h: - Support require_once(). - - * zend_compile.h - zend_execute.c: - Cleanup old IMPORT stuff - - * zend-parser.y - zend-scanner.l: - - Nuke import, add include_once and include_require scanner/parser rules. - Hope to nuke use too :) - - * zend_modules.h: - That broke the Win32 build - - * zend_modules.h: - Fix a bug and define an API_NO for the ZEND_MODULE_API - - * zend_modules.h: - zend_config.h is enough - - * zend_modules.h: - Save ZEND_DEBUG, ZTS, ZEND_API information - -2000-03-09 Andi Gutmans - - * zend_highlight.c: - Fix bug in syntax highlighter - -2000-03-06 stig - - * zend_modules.h: added GINIT_FUNC_ARGS and GINIT_FUNC_ARGS_PASSTHRU - -2000-03-06 Zeev Suraski - - * zend_extensions.h: - Bump up Zend's API version - -2000-03-06 stig - - * zend_modules.h: Added ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU. - -2000-03-06 Andi Gutmans - - * zend-scanner.l: - Fix memory leak - - * zend.c: - Missed one - -2000-03-06 Sam Ruby - - * zend.c - zend.h: Unresolved externs - -2000-03-06 Zeev Suraski - - * zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h - LICENSE - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_modules.h: It's official now... - -2000-03-05 Zeev Suraski - - * ZendTS.dsp - zend.c - zend.h: Wrap some commonly unused callbacks - -2000-03-04 Zeev Suraski - - * zend-scanner.l: - The default return value from include() and eval() changed from 1 to 0 - unintentionally after the old return-reference patches - fixed - -2000-03-02 Sam Ruby - - * zend_config.w32.h: Fix Win32 build breakage - -2000-03-01 Andi Gutmans - - * zend.c: - Upgrade to year 2000 - - * ZEND_CHANGES - zend_compile.c - zend_execute.c: - Fix typos - -2000-03-01 Thies C. Arntzen - - * zend_operators.c: now - -2000-02-27 Egon Schmid - - * zend_builtin_functions.c: Fixed some protos. - -2000-02-26 Sam Ruby - - * zend_builtin_functions.c: compilation error - Win32 - -2000-02-26 Andrei Zmievski - - * zend_builtin_functions.c: - Added get_class_vars() and get_object_vars() functions. - - * zend_execute.c: Fix typo. - -2000-02-26 Zeev Suraski - - * zend_operators.c: Fix comparisons of "inf"=="inf" and "-inf"=="-inf" - -2000-02-25 Zeev Suraski - - * zend_fast_cache.h - zend_variables.c: Use the fast cache here too - -2000-02-19 Zeev Suraski - - * zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: (c) patch - - * zend_API.c - zend_API.h - zend_fast_cache.h - zend_hash.c: - - Fix a nasty bug in the hash, introduced in the recent migration to macros - - Make array_init() and friends trackable - - * zend_API.c - zend_API.h - zend_execute.c - zend_operators.c - zend_operators.h: Generalize macros - -2000-02-18 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -2000-02-18 sascha - - * zend_llist.c - zend_llist.h: - Get rid of second declaration of compare_func_t. Either put in a common - header file or prefix it with i.e. zend_llist_ - -2000-02-18 Andi Gutmans - - * zend_llist.c - zend_llist.h: - - Quick and dirty hack for supporting sorts. Improve later on when I wake up. - - * ZendTS.dsp - zend_dynamic_array.c: - Didn't compile on Win32 - - * zend_dynamic_array.c: - - Tiny change (I know I don't have to cast malloc() to void * but I like - casting my malloc()'s) - - * Makefile.am - zend_dynamic_array.c - zend_dynamic_array.h: - - Preliminary support for dynamic arrays. I need it on order to try out a - new hash implementation. It isn't used anywhere. - -2000-02-17 Andi Gutmans - - * zend.c - zend.h: - Add ZEND_API - -2000-02-16 Andi Gutmans - - * zend_execute.c: -Fix bug 3504 concerning leaks with unset() - - * zend_execute.c - zend.h - zend_compile.h: - Hopefully fix Thies' bug report. - -2000-02-16 Zeev Suraski - - * zend_builtin_functions.c: - ZEND_TEST_EXCEPTIONS should be defined/undefined before it's checked - -2000-02-16 Andi Gutmans - - * zend_execute.c: - Fix bug #3309 - -2000-02-14 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Put in the infrastructure for the unset() fix. Right now it has the old - behavior but I just need time tomorrow to add the correct behavior. - - * zend_builtin_functions.c: - Fix bug in func_get_arg() - - Get rid of compiler warnings for unused function crash() - -2000-02-13 Zeev Suraski - - * zend_constants.c: Fix a memory leak - -2000-02-13 Andi Gutmans - - * zend_hash.c: - Save a function call one very hash_add - - * zend_hash.c - zend_hash.h: - - Make startup a bit faster by changing some hash_update()'s and hash_add()'s - to hash_update_ptr()/hash_add_ptr() - - * zend_hash.c: - - Fix a couple of potential bugs where we were using emalloc/efree instead - of pemalloc/pefree. - - Fix a bug were we potentially would be freeing the key by mistake - -2000-02-13 Zeev Suraski - - * zend_builtin_functions.c: *** empty log message *** - - * zend_operators.c: Make (array) false == array() and not array(false) - -2000-02-11 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made a couple of typedefs for zend_hash_apply_*() calls. - -2000-02-11 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: Update .dsp's - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_config.w32.h - zend_constants.c - zend_execute.c - zend_extensions.c: Fine tune Andi's patch - -2000-02-10 Andi Gutmans - - * zend.h: - #define ZEND_WIN32 differently - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_constants.c - zend_execute.c - zend_extensions.c: - Finally beautify those WIN32|WINNT checks - - * zend_execute.c: - Shouldn't be there - - * zend_execute.c: - Cleanup the code - -2000-02-09 Zeev Suraski - - * zend-parser.y - zend_execute.c: - Fix last known nasty bugs in Zend. It'll be cool if there are no new ones :) - -2000-02-09 Thies C. Arntzen - - * zend_execute.c: foreach() works now for objects as well. - -2000-02-08 Zeev Suraski - - * zend_operators.c: Fix declaration - - * zend_execute.c: Fix an elusive bug - -2000-02-08 Andrei Zmievski - - * zend_operators.c: Fix up the patch. - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Patches from Walter for strncmp() stuff. - -2000-02-07 Zeev Suraski - - * zend_highlight.c: Remove old unnecessary check - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_highlight.c: - Syntax highlighting was erronously emitting more than one semicolon and/or garbage with heredocs - -2000-02-06 Andi Gutmans - - * zend_compile.c: - - Support the string offset syntax $a{2} with the regular array opcodes. - Will need to write new opcodes sometime but right now it's good enough - to announce the change to this string offset syntax for beta 4. - -2000-02-05 Andi Gutmans - - * zend-parser.y - zend_compile.c: - - This hopefully fixes the list($a, $a) = array(1,2) crash, i.e. when list - by mistake contains the same variable twice. - - BTW, there is no defined order of assignment. The value of $a after the - previous example is undefined, and should not be assumed to be either 1 - nor 2. - -2000-02-05 Zeev Suraski - - * zend_execute.c: More cleanup - - * zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: Pass the executor globals to internal functions - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_modules.h - zend_variables.c: - Stop passing list/plist to internal functions - - Add a typedef for the pCopyConstructor function pointer - - Minor hacks - - * zend-scanner.l: - That was the broken downcasting that prevented the interactive C++ mode from working properly under UNIX - -2000-02-04 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Maintain a state of whether we're compiling and/or executing - -2000-02-03 Andrei Zmievski - - * zend_API.c - zend_API.h: *** empty log message *** - -2000-02-02 Zeev Suraski - - * zend_API.c: - Fix built-in classes with more than 5 methods - - * zend_compile.c: - - Fix the annoying problem with list(), that surfaced up after our recent cleaning - patches - -2000-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: Added add_property_unset() and add_property_bool(). - -2000-02-01 Zeev Suraski - - * ZendTS.dsp - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_locks.h: Improve dependencies - - * zend_execute.c: Sort out a gdb problem - - * zend_execute.c: Fix warning - -2000-02-01 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_globals.h: - Get rid of remains of garbage. - - This should fix Thies' UMR - -2000-02-01 Thies C. Arntzen - - * zend_execute_API.c: - moved destroying of garbage before resource-list gets destroyed - (see my previous mail) - zeev, andi - please comment! - - * zend.c: added missing break. - - * zend_hash.c - zend_hash.h: - took out zend_hash_pointer_update() & zend_hash_pointer_index_update_or_next_insert() - i really prefer link-errors instead of runtime-errors, don't you? - -2000-01-31 Andi Gutmans - - * zend_compile.h: - This has to always be done. - -2000-01-31 Zeev Suraski - - * zend-parser.y - zend_compile.h - zend_execute.c - zend_execute_API.c: - Optimized garbage mechanism - - Fixed another buglet in the parser - - * zend-parser.y - zend_alloc.c - zend_execute.c - zend_fast_cache.h: - Fix foreach() - - Fix indirect reference with object properties - -2000-01-30 Andi Gutmans - - * zend_execute.c: - - Fix the bug Thies found where I forgot to change a break; to NEXT_OPCODE(); - - If you find anymore let me know - - * zend_alloc.h: - Run it on align_test - -2000-01-29 Zeev Suraski - - * zend_compile.c: Fix ``'s - - * zend-parser.y - zend-scanner.l - zend_compile.h: Fix require() - -2000-01-29 Andi Gutmans - - * zend-parser.y: - Get rid of another rule which isn't needed. - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Add parser support for string offsets. This added three shift/reduce - conflicts but they all seem to be fine. - - Cleaned up the parsing rules a bit and made them much more compact and - elegant. - - Please CVS update and see that I didn't break anything. - - * zend_alloc.h: - - This will save some memory w/ GCC compilers on some platforms - - * zend_execute.c: - Yet another tiny optimization. - -2000-01-28 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c: - Make loop a bit faster. - - * zend.h: - Make sure its use is understood. - - * zend.h - zend_execute.c: - Double the speed of some key switch() tests for Win32. - - * zend_execute.c: - - This makes the switch() statement twice as quick. Moving to enum - might make this a general speed up for other platforms too - -2000-01-26 Andi Gutmans - - * zend_execute_API.c: - Keep objects as references. - - * zend_execute_API.c - zend_opcode.c: - - Allow is_ref to become 0 in case the refcount is back to 1. - -2000-01-24 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Make foreach() now copy the array but use the original array. It can - still be optimized A LOT but it's only a performance issue and not - a feature issue. - -2000-01-24 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_operators.c - zend_operators.h: - Implement declare() with declarables framework - - Implement ticks - Germany&Norway - 5 points! - - * zend_execute.c - zend_execute_API.c: Fixes - -2000-01-22 Zeev Suraski - - * zend_execute_API.c: Fix an elusive bug - -2000-01-20 Zeev Suraski - - * zend_hash.c: Add some order... - - * zend_hash.c: Indentation fixes - -2000-01-19 Andi Gutmans - - * zend_hash.c: - Optimize zend_hash_del a tiny bit. - - * zend_hash.c - zend_hash.h: - Hopefully fix the hash problem. - - * zend_hash.c: - Hrm I'm not concentrating - - * zend_hash.c: - - Actually the destructor should run after the data is already detached - from the hash but before the bucket is freed. - - * zend_hash.c: - - Rollback hash_apply and friends. They assume now that hash_del is reentrant - as it first applies the destructor and only later nukes the bucket - - * zend_hash.c: - - Run destructor before the hash structure is modified, thus, making - hash_del, reentrant (BLOCK_INTERRUPTIONS needs to be made a counter now). - - * zend_hash.c: - Undo a bug we introduced. (Another one out there). - -2000-01-19 Thies C. Arntzen - - * zend_API.h: - RETURN_NULL -> RETURN_NULL() // we don't want macros without an argumnet - -2000-01-18 Zeev Suraski - - * zend_execute.c: Leak fix - -2000-01-18 Thies C. Arntzen - - * zend_API.h: RETURN_NULL & RETVAL_NULL don't need (). - -2000-01-17 Thies C. Arntzen - - * zend_hash.c: use defines - -2000-01-17 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_variables.c: Get rid of the IsPointer functionality in the hash. - - * zend_hash.c: - Fixes a newly introduced bug in the hash - - * zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: - Destructors no longer return ints, the low level problem it was intended to solve is long gone now... - -2000-01-16 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: - - Make zend_hash_apply() (and friends) reentrant and much, much quicker - - Introduce zend_hash_graceful_destroy(), which allows the destructor functions to - use zend_hash_apply() and/or zend_hash_graceful_destroy() - - Switch to zend_hash_graceful_destroy() in the resource list shutdowns - - * zend.c - zend_compile.c - zend_compile.h: - Allow module startup to be separate from the compiler/executor startup - -2000-01-16 Thies C. Arntzen - - * zend_hash.c: make the ht->inconsistent stuff less ugly:) - -2000-01-15 Zeev Suraski - - * zend_execute_API.c - zend_list.c: Fix a bug in call_user_function_ex() - - * zend-parser.y: - Added support for $foo->{$bar}["foobar"] notation (was supported in PHP 3) - -2000-01-15 Thies C. Arntzen - - * zend_hash.c - zend_hash.h: - if ZEND_DEBUG mode is on we'll now see warnings when a HashTable is accessed - while it's inconsistent. - - Zeev, Andi - you welcome to revert this patch if you don't like it - i find it - useful! accesssing inconsistent hashtables is one of the hardest things to track! - -2000-01-14 Andrei Zmievski - - * zend_highlight.c: - Since we're highlighting code, put and around the code. - -2000-01-13 Zeev Suraski - - * zend.h - zend_config.w32.h: Make Win32 compile again - -2000-01-12 sascha - - * acconfig.h - zend.h: - Move dl stuff from acconfig.h into zend.h. That allows us finer control - when it comes to suppressing dlfcn.h. - -2000-01-09 Zeev Suraski - - * zend_execute.c: Functionality & crash fixes - -2000-01-04 Andi Gutmans - - * zend.h - zend_operators.c: - - Rename IS_BC to FLAG_IS_BC. We will probably nuke it. - -2000-01-04 Thies C. Arntzen - - * zend_API.h: added ZVAL_*() macros. - -2000-01-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Separate the overloaded objects' types from Zend's data types. - There is no reason for them to be the same, and IS_METHOD just cluttered - there data types. - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend-parser.y - zend.c: - Change IS_UNSET -> IS_NULL - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix a bug when using [] on a string - -2000-01-03 Joey Smith - - * zend_operators.c: number.h comes from ext/bcmath, not functions/ - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-03 Andi Gutmans - - * zend_operators.c: - Fix compare_function() for IS_UNSET - -2000-01-02 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-02 Thies C. Arntzen - - * zend_API.h: renamed RET???_UNSET -> RET???_NULL - -2000-01-01 sascha - - * Zend.m4 - acconfig.h - acinclude.m4: Some cleanup - -2000-01-01 Andi Gutmans - - * zend_operators.c: - - IS_NULL should be 0 when converted to a long although I don't think it - really should be documented. - -2000-01-01 Zeev Suraski - - * zend_operators.c: Fix buglet - -1999-12-31 Zeev Suraski - - * Zend.dsp - ZendTS.dsp: .dsp updates - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: - Add Release_inline builds - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h - zend_variables.c: - Nuke undefined_variable_string - - Introduce IS_UNSET - -1999-12-31 Andi Gutmans - - * ZendTS.dsp - zend-parser.y - zend_compile.c - zend_compile.h: - - Fix bug #3073. continue in do..while() loops should work now - -1999-12-30 Zeev Suraski - - * zend.c - zend_alloc.c - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h: - This should enable people to use ALLOC_ZVAL() in code outside the php4.dll - -1999-12-30 sascha - - * Zend.m4: - Solaris' sed does not like this expression. Since -O0 is the default, - we can also omit it. - -1999-12-29 Zeev Suraski - - * zend_variables.c: - - Change var_reset() to set bool(0) instead of string("") - - Authors should go over their code and change it to use var_reset() instead of manually - setting it to string(""), in case they're interested in the false value. - - * zend_alloc.c: time_t is an int under Linux... this should always work. - -1999-12-28 sascha - - * zend_alloc.c: Fix warnings - -1999-12-28 Thies C. Arntzen - - * zend_API.h - zend_constants.c: new constant: SQL_NULL - new macros: RETURN_SQLNULL,RETVAL_SQLNULL,IS_SQLNULL - -1999-12-27 Zeev Suraski - - * zend_fast_cache.h: Fix - -1999-12-27 Andi Gutmans - - * zend_API.c: - Get rid of warning - -1999-12-27 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_fast_cache.h - zend_globals.h - zend_opcode.c - zend_operators.c - zend_variables.c - zend_zval_alloc.h: - Generalize the fast cache mechanism - - Add the HashTable struct to the fast cache mechanism - -1999-12-27 Andi Gutmans - - * zend_API.c: - - Make zend_internal_function allocate a full zend_function structure so - that we don't get memory overruns and Thies doesn't get angry :) - -1999-12-27 Zeev Suraski - - * zend_alloc.c: *** empty log message *** - - * zend_globals.h - zend_zval_alloc.h - zend_alloc.c: Add cache statistics support - -1999-12-27 Thies C. Arntzen - - * zend.c: fix UMR in ZTS mode - -1999-12-26 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_alloc.c - zend_globals.h - zend_zval_alloc.h: - - Enable the new zval cache on debug too. No real reason not to, and it keeps - the code cleaner. - - ZTS compile fixes - - * zend_alloc.c: Fix buglet - - * zend_zval_alloc.h: Add missing file - - * zend.h - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_globals.h - zend_operators.c: - Introduce a zval-specific cache - 5-15% speed improvement - -1999-12-26 sascha - - * Makefile.am - acinclude.m4: Makefile.am: Add dummy target for dependencies - acinclude.m4: Cache result of broken sprintf check - -1999-12-26 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c: Change ALLOC_ZVAL() semantics - - * zend_alloc.c - zend_alloc.h - zend_globals.h: namespace protection - -1999-12-25 Zeev Suraski - - * zend_ptr_stack.c - zend_ptr_stack.h: inline functions cannot accept varargs - -1999-12-25 Andi Gutmans - - * zend-parser.y: - Prepare Zend for the new $a{2} string offset syntax. - -1999-12-24 Zeev Suraski - - * zend_config.w32.h: - Use __forceinline under Win32 (inlining under Win32 gives roughly 30% performance - increase) - - * zend-scanner.l: Shut gcc up - - * zend_compile.c: Optimize - -1999-12-24 Andi Gutmans - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c: - - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend use - them. - -1999-12-24 Zeev Suraski - - * zend_compile.c: - Use function_add_ref() here too - -1999-12-23 Zeev Suraski - - * zend_compile.c - zend_opcode.c: - Fix a class inheritence leak, when using static varibles in a parent class member function - - * zend_compile.c: This one slipped away - -1999-12-23 sascha - - * Zend.m4: Rename option to match description string - -1999-12-23 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: - - require() of a dynamic expression now has the standard require() semantics - - Fixed a memory leak in require() of a dynamic expression - -1999-12-23 sascha - - * Makefile.am - Zend.m4: - Compile zend_execute.c with special CFLAGS. For GCC, INLINE_CFLAGS - contains -O0 to disable optimizations. This can be disabled by using - the appropiate parameter. - -1999-12-22 sascha - - * zend_builtin_functions.c: Kill compiler warning - - * Zend.m4: Don't set DEBUG_CFLAGS to -g, if -g is already in CFLAGS - -1999-12-22 Zeev Suraski - - * zend.c - zend.h: export - - * zend_extensions.h: Those void's don't belong in there - - * zend_API.h - zend_builtin_functions.c: - Fix function_exists() - - * zend_execute.c: - - Fix a very old legacy memory leak in break(n) statements - - * zend_execute.c: Fix for the array() initialization bug Stas found - -1999-12-22 Andi Gutmans - - * zend_compile.c: - Remove unused variable. - -1999-12-21 Zeev Suraski - - * zend-scanner.l - zend.h - zend_compile.c - zend_execute.c: - Fix the highlighting problem. STR_REALLOC() should be used instead of plain erealloc() - whenever you're dealing with strings that might be coming back from the engine - there seem - to be a few other places like this in PHP. - -1999-12-21 Andrei Zmievski - - * zend.c - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend_variables.h: We're using ZVAL's now. - -1999-12-21 Zeev Suraski - - * zend_execute.c: - Fix Sascha's leak. Good report! - - * zend_alloc.c: No need to block for interruptions so early - -1999-12-21 sascha - - * Zend.m4: - Explicitly check for C++ preprocessor, otherwise autoconf forces it onto - us at the wrong place (subsequent autoconf checks failed). - -1999-12-20 Zeev Suraski - - * zend_compile.c: - Fix @expr - - * zend.h - zend_compile.c - zend_execute.c: - - Fix the crash Thies was experiencing (returning a function call could cause a crash) - - Fix the leak Thies was experiencing (@fcall() leaked) - -1999-12-19 Zeev Suraski - - * Zend.dsp: Some updates - - * Zend.dsp - ZendTS.dsp: Make these work again - - * FlexLexer.h - Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - configure.in - flex.skl - libzend.dsp - libzend.m4 - libzendts.dsp: libzend -> Zend - - * zend.h - zend_API.h - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - - Made things work again (Thies, everybody - please check the latest CVS and see if you're - still getting any problems) - - Changed the interface of call_user_function_ex() to support returning of references - -1999-12-19 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - More fixes related to the return references patch - - eval_string() and call_user_function_ex() still don't work. - - The libzend tree is untested and might not be stabl yet. - -1999-12-19 sascha - - * Makefile.am: Add zend_sprintf.c - - * acconfig.h - zend_sprintf.c: configure sets ZEND_BROKEN_SPRINTF - - * acinclude.m4: Variables are not interpolated unless we use _UNQUOTED - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.h: - The tree compiles again - -1999-12-18 sascha - - * libzend.m4: Let autoconf check for the proper inline keyword - - * Makefile.am - libzend.m4: - automake created illegal target names due to the ZEND_SCANNER definition. - We now substitute @ZEND_SCANNER@ directly - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c: - - Introduce ZEND_NUM_ARGS(), to replace ARG_COUNT(ht) - - Rename getParameters() and friends for consistency and namespace cleanliness - -1999-12-17 Zeev Suraski - - * zend_constants.c: - Made PHP_VERSION and PHP_OS work again - - More php3_ cleanup - - Restored the PHP_VERSION and PHP_OS constants - -1999-12-17 sascha - - * libzend.m4: Define inline to inline explicitly - - * Makefile.am - acinclude.m4 - configure.in - libzend.m4: Move config code into separate file - -1999-12-17 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - By mistake commited this to the branch. It fixes a bug we introduced with - the return reference patch. - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: Doh! I'm an idiot. - - * zend_builtin_functions.c - zend_compile.c: - s/inheritence/inheritance/g - - Added is_subclass_of() function - -1999-12-15 Zeev Suraski - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Implement return by reference: - - In function declaration instead of the return statement - - In the assignment phase - - Implement ability to turn off support for call-time pass by reference - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: val->len - - * zend_builtin_functions.c: Faster, must go faster. - -1999-12-15 Andi Gutmans - - * zend_execute.c - zend_opcode.c - zend-parser.y - zend_compile.c - zend_compile.h: - - Preliminary return ref patch. It breaks libzend so don't use this branch - right now. - -1999-12-14 Andrei Zmievski - - * zend_builtin_functions.c: - Added class_exists() - - Moved function_exists() here from from the basic_functions.c - - Modified method_exists() to convert method name to lowercase - when checking - -1999-12-13 Andi Gutmans - - * zend_execute.c: - - Fix problem when return_value's is_ref/refcount is overwritten by the - internal function. - -1999-12-11 Andi Gutmans - - * zend_execute.c: - Another small fix. - - * zend_execute.c: - Support returning references - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - This is supposed to be commited to the RETURN_REF_PATCH branch which is - the beginning of work on allowing returning of references from functions. - -1999-12-07 Andi Gutmans - - * zend-scanner.l: - - opened_path should not be freed here as the zend_file_dtor() takes care - of it. This doesn't fix the bug report for the crash of highlight_file() - though. - -1999-12-07 Zeev Suraski - - * zend-parser.y: Support ZTS definition in zend_config.h - -1999-12-06 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c: Move the #include of zend-parser.h out of zend_compile.h - - * zend-parser.y - zend_globals_macros.h: More localization - - * zend-parser.y - zend_compile.h - zend_globals_macros.h: Localize a couple of macros - -1999-12-05 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -1999-12-05 sascha - - * .cvsignore - zend-parser.y - zend.c - zend_API.c - zend_compile.c - zend_execute_API.c: Fix some warnings - -1999-12-04 Andrei Zmievski - - * zend_API.c: *** empty log message *** - - * zend_API.c - zend_API.h - zend_hash.h: Added zend_set_hash_symbol() function. - -1999-12-04 Thies C. Arntzen - - * zend_API.h: - backed out last change after andi decided on a different approach. - -1999-12-04 Andi Gutmans - - * zend_API.h: - - Call ZEND_SET_SYMBOL_WITH_LENGTH() with refcount 1 from the standard - ZEND_SET_SYMBOL() - -1999-12-04 Zeev Suraski - - * zend-scanner.l - zend_builtin_functions.c - zend_compile.c: - Implement get_used_files() and get_imported_files() - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h: - - Break the zend->PHP dependency introduced by the .php extension for use(), - by providing an API - - Enable Stig's patch for use() extensions (it wasn't refered to by the parser) - - Fix a memory leak in that code - -1999-12-04 Thies C. Arntzen - - * zend_API.h: the new SET_VAR_* macros forgot to set the refcount! - -1999-12-04 Sam Ruby - - * zend-scanner.l: build error - windows - -1999-12-04 stig - - * zend-scanner.l - zend_compile.h: Fix typo, add prototype for use_filename(). - - * zend-scanner.l: "use" should use arg+".php" as parameter to require - -1999-12-04 Zeev Suraski - - * zend-scanner.l: This should fix the fd leak with include()/require() - -1999-12-03 Andrei Zmievski - - * zend_API.h: *** empty log message *** - - * zend_API.h: Added ZEND_SET_GLOBAL_VAR_WITH_LENGTH_EX() macro. - -1999-12-03 Thies C. Arntzen - - * zend-scanner.l: revert my last patch - WARNING: we leak fd's again. - add initialzation of opened_path highlight_file() - -1999-12-03 Andi Gutmans - - * zend_API.h: - Remove _EX and make it the old _LENGTH - -1999-12-02 Andi Gutmans - - * zend_API.h: - Add _EX macro for Andrei - -1999-12-02 Zeev Suraski - - * zend-scanner.h - zend_compile.h: Solve a couple of compile issues - -1999-12-02 Thies C. Arntzen - - * zend-scanner.l: - php_fopen_wrapper_for_zend() does *NOT* insert the opened files into any list - the caller needs to fclose() the file. (not sure if this is desired) - fixed "Uninitialized memory read" when including URLs - -1999-12-01 stig - - * zend-scanner.h - zend.c - zend.h - zend_alloc.h - zend_builtin_functions.h - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_extensions.h - zend_globals_macros.h - zend_hash.h - zend_indent.h: Fix warnings surfacing in maintainer-mode. - -1999-12-01 Zeev Suraski - - * zend_API.h: - Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_LENGTH(), part 2 - - * libzendts.dsp - zend_API.h: - Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_LENGTH() - -1999-12-01 Andi Gutmans - - * zend_execute.c: - - Forgot to check for BP_VAR_IS in the fix made for Thies' string offset - problem. - -1999-11-30 Andi Gutmans - - * zend_API.c: - Applied Thies' bug fix. Great work! - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Add use support (behaves like require, but will not use the same file twice) - - Add import support (behaves like include, but requires parentheses; will not - use the same file twice; Currently, it is not yet properly implemented, and - only behaves like include) - - * zend_execute.c: - - Fix problem Thies reported. We by mistake separated variables which were - being fetched for read only. - -1999-11-27 Zeev Suraski - - * zend_alloc.c: Add ability to disable the memory cache - -1999-11-26 Zeev Suraski - - * zend-scanner.l: - Fix fd leak in ZTS mode - - * zend-scanner.l - zend_compile.c: UNIX/non ZTS compile fixes - - * zend-scanner.l - zend_compile.c - zend_compile.h: - Improve the file handle closing code - - * zend_llist.c - zend_llist.h: - Modify zend_llist_del() to receive a comparison function - - * zend_API.c: - This request_shutdown() is no longer needed (never was needed really) - - * zend-scanner.l: This should get the file to close properly - -1999-11-26 sascha - - * Makefile.am: Rebuild libzend.la, if the scanner was rebuilt - -1999-11-26 Zeev Suraski - - * zend_API.c - zend_modules.h: Remove request_started, increase thread safety - -1999-11-25 Zeev Suraski - - * zend_execute.c: That's a more thorough fix... - - * zend_execute.c: - Fix bug #2817 - assignments to string offsets could erronously modify unrelated strings - -1999-11-22 Zeev Suraski - - * zend_alloc.c: Fix compile problem with enable-memory-limit - - * zend-scanner.l: Fix inconsistencies with here-docs implementation - - * zend-scanner.l - zend_globals.h: Fix #2744 - -1999-11-21 Andi Gutmans - - * zend_execute.c: That slipped away - -1999-11-21 Zeev Suraski - - * zend.h - zend_API.c - zend_compile.c - zend_execute.h - zend_execute_API.c: - Optimize class instanciation - - Fix constant instanciation for array elements inside objects - -1999-11-19 Andi Gutmans - - * zend_execute.c: - - Moved var_uninit() for return_value to the beginning of DO_FCALL. - We forgot to do it for overloaded methods - - * zend.h - zend_execute.c: - - Functions whose return values aren't used have them freed in DO_FCALL - and don't need a special ZEND_FREE opcode following them anymore - -1999-11-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - If a function's return value is unused then don't create a ZEND_FREE - opcode but free it after the function call in zend_execute. - - * zend_execute.c: - Forgot this - -1999-11-16 Andi Gutmans - - * zend_execute_API.c: - Weird that this compiled for me. - - * zend.h: - CHange used_return_value -> return_value_used - - * zend_compile.c: - - In any case create the free opcode. Need to allow the functions to - create a hint. - - * zend.h - zend_compile.c - zend_execute.c: - - Add support for used_return_value passed to internal functions. - -1999-11-14 Andi Gutmans - - * zend_compile.h: - Fix comment as to Joey's findings - -1999-11-13 Andi Gutmans - - * zend_execute.c: - Fix crash with string offset assignments. - -1999-11-04 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made zend_hash_rehash() callable from outside. - -1999-11-03 Andi Gutmans - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Add support for BYREF_FORCE_REST - -1999-10-28 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix for Thies' leak and Andrei's crash - -1999-10-25 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -1999-10-23 Sam Ruby - - * libzend.dsp - libzendts.dsp: - Allow CYGWIN directory to be specified as via environment variable - -1999-10-22 Andi Gutmans - - * zend_execute.c: - Fix isset() with string offsets. - -1999-10-19 Thies C. Arntzen - - * zend_operators.c: fixed is_identicat_function() - -1999-10-19 Andi Gutmans - - * zend_compile.h: - Move IS_IDENTICAL next to IS_EQUAL - - * zend_operators.c: - Fix is_identical function - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Preliminary submit of Thie's patch. Will fix the rest on Windows - as this was added on UNIX with patch. Changed IS_SAME -> IS_IDENTICAL - -1999-10-18 Andrei Zmievski - - * zend_API.h: Be safe, use (). - -1999-10-15 Andrei Zmievski - - * zend_operators.c - zend_operators.h: unstatic'fy is_numeric_string() - - * zend_hash.c - zend_hash.h - zend_compile.c: *** empty log message *** - -1999-10-15 Andi Gutmans - - * zend_operators.h: - Add convert_to_number_ex() - -1999-10-14 sascha - - * configure.in: - Add "--disable-inline" for low-memory machines (be it limited - RAM or virtual memory). It's also useful for Digital C where - the C++ compiler thinks "inline" is an invalid specifier. - - * Makefile.am: Use sources from $(srcdir) - -1999-10-13 sascha - - * Makefile.am: Do not use $< for anything but implicit rules. - -1999-10-13 Thies C. Arntzen - - * zend_list.c: - (zend_fetch_resource) added warinig if resource is of wrong type - -1999-10-13 sascha - - * acconfig.h: Disable ZEND_EXTENSIONS_SUPPORT, if RTLD_NOW is not defined. - - Note that this part could be made platform independent by using - libltdl (for Solaris, Linux, *BSD, HP-UX, Win16/32, BeOS). - -1999-10-12 Thies C. Arntzen - - * zend_list.c - zend_list.h: new improved resource-API - -1999-10-12 sascha - - * acconfig.h: - Use DL_LAZY for OpenBSD. This seems to be a compatibility flag which - should be used for the 2nd parameter to dlopen. - - http://www.openbsd.org/cgi-bin/cvsweb/src/share/man/man3/dlfcn.3?rev=1.8 - -1999-10-12 Andi Gutmans - - * zend_execute.c: - - object.ptr was made NULL in DO_FCALL but wasn't restored. Right now I - push it in DO_FCALL and at the end of do_fcall_common it always gets - popped. We might be able to optimize it out. - -1999-10-11 Andrei Zmievski - - * .cvsignore: *** empty log message *** - - * zend_hash.c - zend_hash.h: Modified zend_hash() to accept a pointer to sort function. - -1999-10-11 Andi Gutmans - - * zend_execute.c: - - No idea why this bug didn't exist before. But I'm too tired to think of it. - During a regular do_fcall we need to set object.ptr to NULL and, thus, - push it in the beginning and pop it in the end. - I hope this fix more or less cuts it. I just want to sleep :) - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Didn't lower refcount when doing an internal function call linked to a regular object. - -1999-10-10 Thies C. Arntzen - - * .cvsignore: added some more autoconf/libtool stuff to be ignored - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Clean up a bit. Separate before the locking so that we can use SEPARATE_ZVAL - macro. - -1999-10-10 sascha - - * build.mk: Add clean target which removes standard targets - - * build.mk: build.mk can be used to generate build tools. It is usually - faster than buildconf, since it rebuilds only components, if - it is necessary. To use it, run - - $ make -f build.mk - -1999-10-09 Andi Gutmans - - * zend_execute.c: - Shouldn't be needed - - * zend_execute.c: - - God damn this sucked. I hopefully fixed the problems with classes although - we might need to clean stuff up a bit. - -1999-10-09 sascha - - * acconfig.h: - Define RTLD_NOW to DL_NOW, if RTLD_NOW is not defined (for OpenBSD). - -1999-10-07 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: added zval_del_ref() function - -1999-10-07 Andi Gutmans - - * zend_execute.c: - Reverse my patch - -1999-10-06 Andi Gutmans - - * zend_execute.c: - - Fixed memory leak with this pointer. It was somtimes initialized with refcount - of 2 instead of 1. - - Also fixed a place where object.ptr_ptr is set to pointing to a zval* instead - of zval**. I don't think this is ever used so we might be able to remove it - altogether. - -1999-10-06 Thies C. Arntzen - - * zend_execute.c: fix for using resources as array indices - -1999-10-05 sascha - - * configure.in - zend.h - zend_globals.h: More portability stuff - - * configure.in: OSF/1 V4.0 wants -lcxx - - * zend_compile.h: - This causes link problems with anything higher than -O0. - -1999-10-04 sascha - - * Makefile.am: Add necessary rule. - - * Makefile.am - acconfig.h - acinclude.m4 - buildconf - configure.in - zend_config.in: Use libtool to build. - -1999-10-04 Thies C. Arntzen - - * zend_builtin_functions.c: use getParametersEx for all builtin functions - - * zend_API.c - zend_API.h: added add_*_resource() and add_*_bool() functions - -1999-10-03 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - Hooray. This might actually work. (I hope) - -1999-10-03 sascha - - * configure.in: Make it executable. - -1999-10-02 Andi Gutmans - - * zend_execute.c: - Another locking fix. - - * zend_execute.c: - Fixed locking problem when fetching string offsets - -1999-10-02 Zeev Suraski - - * zend_execute.c: - Fix the leak reported on the PHP 3 list (isset() on string offsets) - -1999-10-01 Andi Gutmans - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - - Move is_ref back to being an unsigned char and not a bit field. - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Remove locking support completely - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - For Andrei. Implement references in array() initializations - -1999-09-29 Zeev Suraski - - * zend_config.w32.h: *** empty log message *** - -1999-09-29 Andi Gutmans - - * zend_operators.c: Fix leak in += with arrays - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Fix SEND_VAR problem after fetch'ing a variable and not knowing the fetch type - -1999-09-29 Thies C. Arntzen - - * zend_API.c - zend_API.h: added add_property_resource - -1999-09-28 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c: - - Stop using the locking mechanism and start using refcount. - Now we know when we need to free but we still need to support it - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - First part of the patch which makes reads use ptr and not ptr_ptr. - -1999-09-28 sascha - - * acconfig.h - configure.in - zend-scanner.l: Provide alternative istdiostream. - - This has been tested with Sun WorkShop 4.2 C++ which does not - contain class istdiostream. - -1999-09-26 sascha - - * Makefile.am - configure.in: Actually allow to set CXXFLAGS - - * configure.in - zend_config.in: - Build communication channel and add checks for C++ library - -1999-09-26 Andi Gutmans - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Changed Ts{}.var to Ts{}.var.ptr_ptr. - -1999-09-24 sascha - - * zend_operators.h: Add _ex API implementation for booleans. - -1999-09-24 Zeev Suraski - - * zend_list.c - zend_list.h: Exify the standardized resource stuff - -1999-09-23 Andi Gutmans - - * zend_operators.c: - Fix bug #2364. - I haven't checked all of the conversion macros yet but there's a change - there are more such bugs there. - -1999-09-23 sascha - - * configure.in: Fix vpath build w/ thread-safe enabled on Unix. - -1999-09-22 Thies C. Arntzen - - * zend_builtin_functions.c: - preliminary fix for each until andi & zeev clean up! - - * zend_list.c: - if you pass NULL as the resource_type_name to zend_fetch_resource*&friends the functions will not print any warnings if the resource is not found! - -1999-09-21 Andi Gutmans - - * zend_compile.c: - - Fix problem where function parameter fetches were created too late. - -1999-09-21 Zeev Suraski - - * zend_builtin_functions.c: Add get_func_args() - - * zend_builtin_functions.c: *** empty log message *** - -1999-09-20 Andi Gutmans - - * zend_builtin_functions.c: - - Move some more Zend internal functions from PHP - - * zend-parser.y: - Next part of locking fix. - $var = expr; and $var += expr; first create code for expr and later on - for the fetch_w of $var. - - * zend_builtin_functions.c: - Newline for Sun's compiler - - * zend_API.h - zend_builtin_functions.c: - Add some internal functions to Zend - - * zend_compile.c - zend_compile.h - zend_opcode.c: - - First step in fixing locking problem. Array fetches are now always done last. - Later on we will want to delay the write fetches even longer until after their - resulting expression is parsed. The way it is now, will make it very easy - to delay as long as we need. - - * zend_compile.c - zend_compile.h: - - Indirect references had all of the fetches by mistakenly backpatched. - Actually all of the fetches are supposed to be read, except for the last - one. - -1999-09-20 Zeev Suraski - - * libzend.dsp - libzendts.dsp - zend_builtin_functions.c: Added zend_num_args() and zend_get_arg() - - * Makefile.am - zend.c - zend_builtin_functions.c - zend_builtin_functions.h: - Add a file in which we can put Zend builtin functions - -1999-09-18 Andi Gutmans - - * zend_execute.c: - - Try to fix the leak Rasmus reported. It's pretty sucky code so I'm really - not sure this fix is OK.I can't remember all of what we did there. - -1999-09-18 Zeev Suraski - - * zend_list.c: Safer behavior - -1999-09-17 Thies C. Arntzen - - * zend_execute.c: make SUNs c89 happy - - * zend_execute_API.c: no // in the sources please - - * zend_globals_macros.h: added newline at end of file - -1999-09-17 Zeev Suraski - - * zend_execute.c: - Fix bug #2318 - -1999-09-16 Zeev Suraski - - * zend_operators.h: Introduce convert_to_*_ex() - -1999-09-16 sascha - - * configure.in: this helps compiling on non-ANSI C compliant platforms - -1999-09-13 stig - - * acconfig.h - configure.in: Make sure HAVE_LIBDL gets defined. - Disable more C++ tests when not configured for thread safety. - -1999-09-12 Zeev Suraski - - * zend.c: Make this class instanciatable - -1999-09-12 sascha - - * configure.in: check for c++ only, if thread safety is enabled - -1999-09-10 Zeev Suraski - - * zend_compile.c: Shut up a warning - -1999-09-09 Andi Gutmans - - * zend_compile.c - zend_globals.h - zend_stack.c - zend_stack.h: - Add foreach() freeing code. - - Fix switch() freeing code to only free current function's switch expressions. - - I have a feeling break expr; in a switch where expr > 1 leaks because it - won't free all of the expressions. Fix is probably not trivial. - - * zend_operators.c: - - Fix leak when decrementing strings which actually are longs. - -1999-09-08 Andi Gutmans - - * zend_execute.c: - - Fix for floating point array offsets. Same behaviour as in PHP 3.0. We - casted to (long). - - * Makefile.am - libzendts.dsp: - Add -b option to flex++ - -1999-09-07 stig - - * acconfig.h: define tests first, use after. - -1999-09-06 Andi Gutmans - - * zend_config.w32.h: - Fix win32 compile - - * zend_config.w32.h: - Make zend compile again in Win32. - -1999-09-06 stig - - * .cvsignore: ignore zend-scanner.cc - - * ZendCore.dep - libzend.dsp - libzendts.dsp: hand-patched some MSVC files - - * Makefile.am - acconfig.h - acinclude.m4 - config.unix.h - config.w32.h - configure.in - zend-scanner.l - zend.h - zend_API.c - zend_alloc.c - zend_compile.h - zend_config.w32.h - zend_execute.c - zend_hash.c - zend_list.c - zend_ptr_stack.c - zend_sprintf.c: * header file cleanup - * fixed --enable-thread-safety build for UNIX - - I don't have a Win32 environment available, could someone please try - compiling on Win32 to see if I got all the header file stuff right there? - -1999-09-05 Andi Gutmans - - * zend_globals_macros.h: - Oops - - * libzendts.dsp - zend.c - zend.h - zend_alloc.c - zend_alloc.h - zend_globals.h: - Shift around header files. - -1999-09-04 Zeev Suraski - - * zend_list.c: Fix a stupid bug (from stefan@roehri.ch) - -1999-09-03 Zeev Suraski - - * zend_list.h: Damn, forgot to commit that - - * zend_list.c - zend_list.h - zend_modules.h: Add new API for resources - -1999-09-03 sascha - - * zend_modules.h: Add global startup/shutdown functions - -1999-09-03 Zeev Suraski - - * zend_operators.c: - Revert the IS_RESOURCE patch. It had some unintended behavior. - - * zend_variables.c: Let $GLOBALS actually work... - - * zend_operators.c: - Release resources when converting to other types (fix Thies's reported problem) - -1999-09-02 Zeev Suraski - - * zend_compile.c: - Use \0NameFilenameLineno as key instead of numeric index for runtime defined functions - -1999-08-28 Zeev Suraski - - * zend_extensions.c - zend.h - zend_alloc.c - zend_extensions.h - zend_variables.c - zend_variables.h: *** empty log message *** - - * zend.h - zend_alloc.c - zend_alloc.h - zend_variables.c: Beef up debug macros - -1999-08-27 Zeev Suraski - - * zend_execute_API.c: Fix a crash bug in case of aborted execution - - * zend.h - zend_alloc.c - zend_alloc.h - zend_execute_API.c - zend_variables.c - zend_variables.h: Better debug macros - -1999-08-26 Andi Gutmans - - * zend_execute_API.c: - Damn. It wasn't a correct fix. This should do it. - When the zval ** are equal we don't want to assign_ref, in any other case - I can think of we do want to assign_ref. - - * zend_execute_API.c: - Fix leak when global is used in the global scope. - - * zend_compile.c: - Fix when redefining classes at run-time. - -1999-08-25 sascha - - * zend.h: make it compile with gcc again - -1999-08-25 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Add hash_apply_with_arguments() - - * zend-scanner.l: - More elegant fix for Win32 include_path - - * zend-scanner.l: - - Temporary fix to allow Win32 MT safe version to use zend_fopen(). - -1999-08-23 Andi Gutmans - - * zend_execute.c: - Fixed a specific memory leak linked to locking. - -1999-08-22 sascha - - * zend.h - zend_globals.h: This changes makes it work on egcs 1.1.2/Alpha - - * configure.in - zend.h: remove checks - -1999-08-20 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend.c: Fix for Thies's UMR - -1999-08-19 Andi Gutmans - - * zend-parser.y - zend_opcode.c: - - Make sure expr_list and echo_list are either empty or comma seperated - expressions - -1999-08-18 Thies C. Arntzen - - * zend-scanner.l: on unix ZTS gets defined in zend_config.h - -1999-08-17 Zeev Suraski - - * zend_execute_API.c: Fix #2012 - - * zend_execute.c: Fix #2070 - -1999-08-17 Andi Gutmans - - * zend.c - zend.h: - Add some ZENDAPI's - -1999-08-15 Andi Gutmans - - * zend_execute.c: - Oopsie - - * zend.h - zend_compile.h - zend_execute.c - zend_globals.h: - Optimize the execute stack a bit. - -1999-08-14 Zeev Suraski - - * zend_compile.c: Fix several class issues - - * zend_compile.c - zend_compile.h: - Generate better warnings for class/function redefinitions - -1999-08-10 Andi Gutmans - - * zend_compile.c - zend_constants.c: - Got rid of the C++ comments. - -1999-08-09 Andi Gutmans - - * zend_execute.c: - Thies's crash fix. - -1999-08-07 Zeev Suraski - - * zend_compile.h - zend_execute.c - zend_execute_API.c: Fix a few leaks - -1999-08-06 Zeev Suraski - - * zend_execute_API.c: Fix a bug in call_user_func_ex() - - * zend_API.h: Now that's an annoying bug. - - * zend_API.h - zend_execute_API.c: Introduce call_user_func_ex() - - * zend_execute.c: *** empty log message *** - -1999-08-03 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - - Initialize extended value's and put the fetch_type in it's own variable - name. - -1999-08-02 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Make set_compiled_filename() return a pointer to the allocated file name - -1999-07-31 Zeev Suraski - - * zend_API.h: These aren't necessary - -1999-07-30 Zeev Suraski - - * zend_API.h: Support symbols in any symbol table, not just the active one - -1999-07-30 Andi Gutmans - - * zend_ptr_stack.c: - Damn that's more like it. - - * zend_ptr_stack.c: - Cut&paste crap - - * zend_execute.c - zend_ptr_stack.c - zend_ptr_stack.h: - - Add ptr_stack_n_{push,pop} in order to speed up function calls a bit. - There seems to be no reason for stack->top in the ptr_stack except for - when realloc()'in the stack. I think I'll remove it. - -1999-07-30 Zeev Suraski - - * zend_API.h: - * Setting variables in the global scope wasn't handling is_ref's properly - -1999-07-29 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Fixed a leak when doing inheritance. The parent class name wasn't being freed. - - Fixed a stack leak. Functions that had late argument binding were set up as - INIT_FCALL_BY_NAME but were using DO_FCALL and not the corresponding - DO_FCALL_BY_NAME. - -1999-07-28 Andi Gutmans - - * zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c: - Fixed various inheritance problems & Andrey's leak - -1999-07-27 Zeev Suraski - - * zend_compile.c: Inherit parent's constructor - - * zend_compile.c: - Fix runtime inheritence (child functions/members should have higher precedence) - -1999-07-27 Andi Gutmans - - * zend_execute.c: - Add missing lock - - * zend_execute.c: - Fix up the new operator a bit more. - -1999-07-27 Zeev Suraski - - * zend_execute.c: Set reference count and is_ref values for new objects - -1999-07-26 Zeev Suraski - - * zend_operators.c: - - Fixed a memory leak when using assignment-op operators with lvalue of type - string (or array/object) - - * zend_compile.c: *** empty log message *** - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a bug in inheritence from classes defined in include files, that are - inherited from require()'d files - -1999-07-26 Andi Gutmans - - * zend_execute.c: - Oops I erased this by mistake - - * zend_execute.c: - - Should be a complete fix now. This break away code should maybe be made - somewhat generic - - * zend_execute.c: - Temporary fix for "this". Have to fix it tomorrow. - - * zend_execute.c: - - Fix compile error. Weird that Visual didn't catch this one. - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c: - Fix the new operator incompatibility. - - I commented PHP_FUNCTION(strtotime) in datetime.c because it stopped - win32 from compiling. This needs to be fixed!!! - - Check out libzend to compile the tree now. - - * zend.h - zend_execute.c: - new operator fixes - -1999-07-25 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Commiting to branch newoperator. - - To check it out do cvs checkout -rnewoperator libzend - -1999-07-24 Zeev Suraski - - * zend_compile.c: Fix that memory leak... nested function issue remains - - * zend_compile.c - zend_stack.c - zend_stack.h: Fix RETURN & SWITCH memory leak issue - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Thoroughly fix the SWITCH problem. No RETURN handling yet. - -1999-07-23 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: Fix bug #1812 - - * zend.h - zend_operators.c: - * Add an API macro users can use to ensure an array member can be modifed - before they modify it. - * Fix a bug and remove redundant code in convert_to_long() (booleans and - resources weren't changing their types - -1999-07-22 Zeev Suraski - - * zend_constants.c: New constants - -1999-07-22 stig - - * buildconf: identify ourselves - -1999-07-20 Andi Gutmans - - * zend_execute.c: - Include alloca.h when need and available. - - * zend_compile.c - zend_execute_API.c - zend_list.c - zend_operators.c: - Get rid of C++ comments - -1999-07-19 Zeev Suraski - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: 0.91 update - -1999-07-19 Andi Gutmans - - * zend.h - zend_execute.c - zend_extensions.h: * Fix Zend version - * Fix a method call bug - - * LICENSE - libzendts.dsp: License update - - * zend_errors.h: Make error codes PHP 3.0 compatible - -1999-07-18 Andi Gutmans - - * zend_execute_API.c: - - Should fix the memory leak when returning from the main scope. - -1999-07-17 Zeev Suraski - - * configure.in: Debug on by default - -1999-07-16 Zeev Suraski - - * zend_compile.c: - Ignore T_PHP_TRACK_VARS in the parser (handled in the scanner) - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: License update - -1999-07-15 Andi Gutmans - - * zend.c: Change true/false back to 1/"" - - * zend_execute.c: Fix a lock issue - -1999-07-15 sascha - - * zend_execute_API.c: disable zend_handle_sigsegv - -1999-07-14 Andi Gutmans - - * libzendts.dsp - zend.c: Fix thread unsafe constants startup - - * LICENSE - zend.c - zend_constants.c - zend_constants.h: - License update - - Fix multithreaded constants startup - - * zend_operators.c: - Fix for boolean convert to number - -1999-07-12 Andi Gutmans - - * zend_execute.c: - Fixed a purify warning - -1999-07-10 Zeev Suraski - - * zend_alloc.c: Oh, that dumb bug. - -1999-07-10 Andi Gutmans - - * zend_execute.c - zend_hash.c: Ok, so we do have to lock in there - - * zend.c - zend_execute.c: Fix assignments of reference variables - -1999-07-10 Zeev Suraski - - * zend_execute_API.c: Woops, fix. - - * zend_execute.c - zend_execute_API.c - zend_globals.h: Put the garbage in the garbage bin - - * zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: Get rid of AiCount completely - - * zend_execute.c: Final tweaks - - * zend_execute.c - zend_hash.c: More locking work - -1999-07-09 Zeev Suraski - - * zend_execute.c: *** empty log message *** - - * zend_execute.c: More stuff - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c - zend_variables.c: Step 4: - Move to a 7-bit counter (not fully implemented yet) - - * zend_API.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: Phase 3: - Use a single bit to mark IS_REF variables - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c: Step 2: - Rename is_ref to EA - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: Step 1 in nuking the garbage collector: - - Change the hash destructor to return int - - Don't kill the bucket on hash_destroy if the destructor returns 0 - - * config.w32.h - configure.in - zend_alloc.c: *** empty log message *** - - * zend_alloc.c: Send a SIGSEGV instead of exiting, to trigger a core dump - - * zend_alloc.c - zend_alloc.h - zend_hash.c: * Support recoverable failure from erealloc() - * Fix the shutdown code on an unrecoverable erealloc() failure - - * zend_execute_API.c: Fix the mess in SIGSEGV handling, hopefully - -1999-07-08 Zeev Suraski - - * zend_compile.h - zend_compile.c: - Support definition of classes that are derived from classes that are defined in runtime - -1999-07-06 sascha - - * zend.h: enable it, until we find a better way - -1999-07-05 sascha - - * zend.h: make Solaris gcc happy - - * configure.in - zend.h: use void * instead of long for 64-bit test - -1999-07-05 Thies C. Arntzen - - * zend_API.h: added RETVAL_RESOURCE and RETURN_RESOURCE - -1999-07-04 Zeev Suraski - - * zend_operators.c: - Make convert_to_string() regard false as "" instead of "0" - -1999-07-03 sascha - - * Makefile.am: don't wipe files for distributions - - * configure.in - zend.h: - checking for ints won't work, since they are 32 bit on both platforms - -1999-07-03 Zeev Suraski - - * zend_execute.c: Support isset()/empty() for string offsets - - * zend-scanner.l: Fix a crash - -1999-07-03 sascha - - * configure.in: add usual rhapsody hack - - * config.unix.h: missing DL_HANDLE broke build - - * zend_extensions.c: typo - -1999-07-02 sascha - - * acconfig.h - configure.in - zend.h: workaround for 64-bit platforms - -1999-07-02 Zeev Suraski - - * acconfig.h - configure.in - zend_globals.h: define zend_bool - -1999-06-30 Zeev Suraski - - * zend-parser.y: Make require accept any parameter - -1999-06-26 Zeev Suraski - - * zend_alloc.h - zend_operators.c - zend_alloc.c: - * Make the memory leak reporting code much better with repeats - * Remove useless variables - -1999-06-22 Zeev Suraski - - * zend_compile.c: Fix Thies's bug report - - * zend_alloc.c - zend_compile.c - zend_operators.c: - * Fix concatenation of arrays (it was PHP 3.0 style, copying zval's instead - of zval *, and it wasn't using reference counting) - * Fix a memory leak in static array()'s with textual indices - -1999-06-19 Zeev Suraski - - * zend.c: *** empty log message *** - - * zend.h - zend_extensions.h: - Add a standard get_ini_entry() to interface between Zend and the outside world - - * configure.in: *** empty log message *** - -1999-06-16 stig - - * zend_modules.h: - added INIT_FUNC_ARGS_PASSTHRU and SHUTDOWN_FUNC_ARGS_PASSTHRU - -1999-06-15 stig - - * zend_operators.c - zend_operators.h: * added zend_binary_strcasecmp() - -1999-06-12 Zeev Suraski - - * zend-parser.y: - We can't quite go with expr there (shift/reduce conflict), go with scalar. - - * zend-parser.y: require() improvement as per Andi's suggestion - -1999-06-11 Zeev Suraski - - * zend_operators.c: - Make the concatenation operator use make_printable as well - - * zend-scanner.l: Don't take failing on an include file so badly - - * zend-scanner.l: Support E_COMPILE_ERROR in the compiler - - * zend_compile.c: Two fixes: - * The error generated by a failed class inheritence wasn't properly - displaying the file in which he error occured. - * Inheritence didn't work if the parent class had uppercase letters in it. - - * zend-parser.y - zend-scanner.l - zend_execute.c: * Use to_string() instead of __print() - * Support boolean casts ((bool) and (boolean)) - - * zend.c: Change __print into to_string() - - * zend.c - zend.h - zend_execute.c - zend_execute_API.c: - * Make the output handling of variables much, much cooler. - Uses zend_make_printable_zval() instead of convert_to_string() now: - - $foo = true; - print "\$foo is $foo"; - will now print - $foo is true - (instead of "$foo is 1", earlier). - - Also, with objects, it automatically tries to call __print() and use it as a printing - function. - - For example: - - class foo { - function __print() { return "Foo Object"; } - }; - - $foo = new foo; - print $foo; - - will print "Foo Object". - -1999-06-10 Zeev Suraski - - * zend_operators.c: Now THAT's an annoying bug. - -1999-06-09 Zeev Suraski - - * zend_extensions.c: Fix - - * zend_API.c - zend_execute.c: - * Fix cases where you assign an array element to the parent array (the array was - being erased before the assignment, so the element was being smashed). - - * zend_execute.c - zend_execute_API.c: * Fix foreach() that receives a non array argument - * Clean up some C++ comments - -1999-06-09 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_operators.c: - Fix the static array() initializing - -1999-06-08 Zeev Suraski - - * zend_extensions.c: Replace error messages - -1999-06-08 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: * Fix a by-name call/method call bug - * Clean and optimize the whole function call process - -1999-06-07 Zeev Suraski - - * zend_hash.c - zend_hash.h: Add zend_hash_get_current_key_type() - -1999-06-06 Andi Gutmans - - * zend_compile.c: - Work around a compiler bug - mark variables that are sent to functions that aren't yet - defined as FETCH_W (because they might end up being sent by reference) - -1999-06-05 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h: * Centralized shutdown - * Change shutdown order again - - * zend_compile.c: - Call the request_shutdown on modules before destroying symbol tables, so that - the session module can be implemented - - * zend-scanner.l - zend_compile.c - zend_execute.c: - - Fixed Karl's bug report. It's not really a thorough fix, we really need to rethink the INIT_FCALL/DO_FCALL issue. - - Fixed numerous AiCount problems - -1999-06-04 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: New $GLOBALS init - - * zend_execute_API.c: - Fix that GLOBALS leak. We were explicitly adding GLOBALS to the main symbol table, - but there's no reason to do it (INIT_GLOBALS takes care of it if necessary.) - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_list.c - zend_list.h - zend_opcode.c - zend_operators.c: Minor updates (mostly __declspec() stuff) - -1999-06-04 Thies C. Arntzen - - * zend_API.h: added is_ref=0 and refcount=1 to SET_VAR_* macros - -1999-06-03 Zeev Suraski - - * zend-parser.y: T_BAD_CHARACTER is actually a string. - -1999-06-03 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - We weren't counting newlines in heredocs. The only place which is still questionable - is when there's a \ followed by a newline but it seems we have a parse error in this - case anyways. - - Fixed the alloca() macros so that the alloca() #define in win32 mode won't clash - with the real win32 alloca(). - -1999-06-01 Andi Gutmans - - * zend_execute.c: - - Make execute() use less stack in thread-safe win32 due to Microsoft's shitty 256kb stack. - -1999-05-31 Zeev Suraski - - * zend.h - zend_alloc.c: *** empty log message *** - -1999-05-31 Andi Gutmans - - * zend-scanner.l - zend_compile.c - zend_execute.c - zend_execute_API.c: Fixes - -1999-05-30 sascha - - * zend_alloc.c - zend_compile.h - zend_execute_API.c - zend_indent.c - zend_opcode.c: * fix some casts - * introduce unary_op_type - cleaner than casting data voids to function ptrs - -1999-05-29 Zeev Suraski - - * zend_execute_API.c: - That got fucked up when we went back to using uninitialized_zval - -1999-05-29 sascha - - * Makefile.am: another VPATH related change - -1999-05-29 Zeev Suraski - - * zend-parser.y: Fix a bug - - * zend_hash.c - zend_hash.h - zend_operators.c: Support overwrite mode in zend_hash_merge() - -1999-05-29 sascha - - * Makefile.am: - clean is not called from automake. use CLEANFILES instead - - allow VPATH compilation - -1999-05-29 Zeev Suraski - - * zend_execute.c: Correct fix - - * zend_execute_API.c: *** empty log message *** - - * zend_execute.c: Fix a leak - -1999-05-28 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: * Support getThis() for internal functions. - * Fix 'new object or die' and AiCount issue thoroughly (earlier fix didn't - work with the optimizer). - * Add new macros for standardized definition of classes. - * Only report AiCount problems if shutdown was not silent. - -1999-05-27 Zeev Suraski - - * zend_execute.c: Fix the AiCount issue with objects - - * zend_API.h: Moved all #define's for SET_ and RETURN_ to zend_API.h - -1999-05-25 Zeev Suraski - - * zend_execute_API.c: - Avoid crashing if an error occurs before we open the first file. - -1999-05-24 Zeev Suraski - - * zend_operators.c: The last fix was wrong - - * zend_operators.c: Another operators fix - -1999-05-23 Zeev Suraski - - * zend_operators.c: - boolean comparison didn't work with smaller-than and greater-than, something that - fucked up berber's site a bit. fixed. - -1999-05-22 Zeev Suraski - - * zend_execute.c: - Sigh, another leak bites the dust. FREE_OP missing in case of a SEND_VAR. - - * zend-parser.y: I'm on a roll. Fix a nasty yet stupid AiCount bug - - * zend_alloc.c: Warn about AiCount not zeroing out - - * zend-parser.y - zend-scanner.h - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_highlight.h - zend_list.h - zend_llist.h - zend_ptr_stack.h - zend_stack.h: - * Add struct name to all typedef's so that they can be debugged with MSVC - * Fix an AiCount bug - list(...) = $var was using $var multiple times, and thus - causing AiCount to be decreased multiple times even though it was increased only - once for $var. Mark all FETCH_DIM's so that they won't decrease AiCount, and only - decrease AiCount on the last FETCH_DIM. - * Fix a stupid bug - forgot to pass CLS_C to some compiler function. For some reason - MSVC doesn't report these :I - - * zend.h - zend_alloc.c - zend_execute_API.c: - Give more information and save log lines in memory leak reports - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_globals.h - zend_llist.c - zend_llist.h: Avoid leaking fd's in case of failures - - * zend-scanner.l: more fixes - -1999-05-21 Zeev Suraski - - * zend-scanner.l: That wasn't supposed to slip in - - * zend-scanner.l: * Properly handle failed file opens in C++ - * Properly handle failed require()'s within libzend - - * zend-scanner.l: * Fix the comments issue. yymore() worked like a charm. - * Change all flex states to be prefixed with ST_ - -1999-05-20 Zeev Suraski - - * zend_compile.h - zend_execute.c: Optimize allocations into uninitialized_zval assignments - -1999-05-20 Andi Gutmans - - * config.w32.h - libzend.dsp - libzendts.dsp - zend_compile.c - zend_compile.h: - Updates we did today - - * zend_compile.c: - Fix a small problem with class decelerations. - - * zend-scanner.l: -Open curly braces fix? - -1999-05-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_hash.c - zend-parser.y: - * Fix all hash checks that checked Bucket.arKey for NULL, when it was changed - to char[1], these checks should have been changed to Bucket.nKeyLength==0 - * Support runtime declaration of functions. I ended up changing the grammar - to catch top level functions vs. nested functions. The reason is simple - - if we don't have functions properly declared at compile-time, function calls - cannot be resolved at compile time, and have to be resolved at runtime, which - ends up being much much slower (without the optimizer, that is). - It's no biggy though, the grammar change isn't that bad. - -1999-05-14 Zeev Suraski - - * configure.in - zend-scanner.l: - If a require() dies, we must bail out (since it corrupts an existing op_array - - * zend-scanner.l: Fix a bug - -1999-05-14 stig - - * Makefile.am: don't install Zend on the system - -1999-05-14 Zeev Suraski - - * zend-scanner.l: - Add \012 and \xff missing support to constant quoted string - -1999-05-12 Zeev Suraski - - * zend.h: *** empty log message *** - -1999-05-12 stig - - * Makefile.am: install libzend.a and header files on "make install" - - * acconfig.h - configure.in: add --enable-thread-safety option - -1999-05-12 Zeev Suraski - - * zend_llist.c - zend_llist.h: Added prepend to llist - -1999-05-11 Zeev Suraski - - * zend-scanner.l - zend.c: Fixes: - * Avoid closing stdin (I could have sworn I've committed that already) - * unclean_shutdown patches - - * zend_alloc.c: Easier Win32 debug code - - * zend-scanner.l - zend_compile.c - zend_globals.h - zend_highlight.c: - * Fix a bug that occured in case of parse errors. We need to restore the lexical state - even if the compilation failed. - -1999-05-10 Zeev Suraski - - * zend-scanner.h - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h: - Weed out all BoundsChecker-found bugs (including a serious file descriptor leak - in the C++ scanner) - -1999-05-09 Zeev Suraski - - * zend_modules.h: Change argument name - - * zend.c - zend_API.c - zend_API.h - zend_modules.h: Almost forgot to commit those - -1999-05-06 Zeev Suraski - - * zend-scanner.l: Ok, I tested it now. It works very nicely! - -1999-05-05 Andi Gutmans - - * zend_llist.c - zend_llist.h: llist improvements - -1999-05-02 Andi Gutmans - - * zend.c - zend_compile.h: - Don't support interactive mode when thread safe. - -1999-05-01 Zeev Suraski - - * zend_operators.c: Several operator fixes. Should fix the MySQL problem. - -1999-04-30 Andi Gutmans - - * zend_opcode.c: - Free refcount when destroying the last class reference. - - * zend-parser.y: - Missed one place - - * zend-parser.y: - First try at fixing $a->foo[] syntax. - - * zend-scanner.l: - - Move back to yyless(). I haven't tested it yet because it's taking too long - to compile and I have to disconnect - -1999-04-30 Zeev Suraski - - * zend-parser.y - zend-scanner.l: - Fix Boris's problem (in my never ending struggle to show I never mean what I say - when I say something's not gonna happen :) - - * zend-scanner.l - zend_compile.c: - * Fix a problem with constant quoted strings, that was causing Thies's problem - * Remove a development-time printf - -1999-04-29 Andi Gutmans - - * zend-scanner.l: - No reason to handle newlines here. - -1999-04-28 Zeev Suraski - - * zend-scanner.l: Make the C++ scanner support interactive input - -1999-04-27 Zeev Suraski - - * zend-scanner.l - zend_compile.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_opcode.c: * Fix debugger+interactive mode bug - * Recognize whether an extension is with debug information or not - -1999-04-26 Zeev Suraski - - * libzendts.dsp: fix - - * config.w32.h - libzend.dsp - libzendts.dsp - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_opcode.c - zend_sprintf.c: Various thread safety fixes and DLL updates - -1999-04-26 Andi Gutmans - - * zend-scanner.l - zend.c - zend_alloc.c - zend_globals.h: -More commits - -1999-04-24 Zeev Suraski - - * zend_compile.c: Another small fix - - * libzendts.dsp: dsp update - - * zend.c - zend_globals.h: Thread safety fixes - - * zend_list.c: Remove redundant includes - -1999-04-24 zeevread - - * zend-scanner.l: g++ compile fix - -1999-04-24 Zeev Suraski - - * Makefile.am - zend-scanner.l: *** empty log message *** - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c - zend-parser.y - zend-scanner.l: Cleanups, remove old ts code - -1999-04-23 Zeev Suraski - - * zend_operators.c: Arithmetics bug fix - - * zend-scanner.h - zend-scanner.l: Support eval() and highlight_string() in the C++ scanner - -1999-04-23 Andi Gutmans - - * zend-scanner.l: - - Use yyless() instead of unput() where possible. I'll erase the commented - out code in a day or so. - -1999-04-23 Zeev Suraski - - * FlexLexer.h - flex.skl - zend-scanner.h - zend-scanner.l - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_operators.h - zend_variables.h: Ok, call me crazy, because I probably am. - Thread safe version now uses a C++ scanner object. Works fully. - -1999-04-22 Zeev Suraski - - * acconfig.h - zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_highlight.c - zend_indent.c - zend_opcode.c: Make token names uniform, they all begin with T_ now. - -1999-04-21 stig - - * buildconf: state which aclocal.m4 and configure files are created - - * Makefile.am: - zend-parser.o and zend-scanner.o were included twice in libzend.a - -1999-04-21 Zeev Suraski - - * FlexLexer.h - flex.skl - libzendts.dsp - zend_API.c - zend_API.h - zend_globals.h: - * Change the thread safe project to create a C++ scanner. - * Add in a slightly modified skeleton file (only a couple of #if's for #include's - that we dont have in Windows) - - It does NOT compile or work yet :) - - * zend_list.h: Fix - - * zend.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_list.c - zend_list.h: - Thread safety patch. It works now with 'just in time' resource initialization! - - * libzend.dsp - libzendts.dsp - zend_globals.h: Thread-safe project - -1999-04-21 stig - - * buildconf: move automake back to before autoconf - - * buildconf: - autoheader must be called after autoconf, automake after autoheader - - * zend_config.h.in: think before one commits - - * zend_config.h.in: doh. cvs appears to ignore .in files by default - -1999-04-21 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Thread safety patch. We're still not quite there but it compiles again, and - more logic has been implemented. - -1999-04-20 stig - - * .cvsignore - Makefile.am - Makefile.in - aclocal.m4 - buildconf: Makefile.in and aclocal.m4 are generated - added buildconf script - -1999-04-19 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: - Return a success value from the startup function, so we can unload immediately - if it fails. - -1999-04-19 stig - - * .cvsignore - Makefile.am - Makefile.in - acconfig.h - acinclude.m4 - aclocal.m4 - config.h.in - configure.in - zend.h: convert to automake - -1999-04-19 Andi Gutmans - - * zend_API.c - zend_API.h: Add a couple of ZEND_API's - - * config.w32.h - zend-parser.y - zend_compile.c - zend_execute.c: Support =unset as arguments - -1999-04-19 stig - - * acconfig.h - config.h.in - configure.in: removed -lnsl and -lsocket checks from zend - -1999-04-18 Zeev Suraski - - * zend_execute.c: AiCount needs to be decreased here - - * configure.in - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_llist.c - zend_modules.h - zend_opcode.c: Whatnot: - * updated alloc_persist to use critical sections - * changed extension shutdown to two-phase - * updated dependencies - * PR support (don't remember if there was any really) - -1999-04-15 Andi Gutmans - - * zend_execute.c: - - one more place which seems to have needed fixing. I don't have time to look - more into it. I hope we don't have anymore places which need fixing. - - * zend_compile.c: - - Should fix the pass by reference problem. This happened because we moved - start from arg 1 now and not arg 0. There might be more places which need fixing - like in the executor but the bug seems OK now. - -1999-04-14 Zeev Suraski - - * zend_compile.h: Compile fix - -1999-04-14 Andi Gutmans - - * config.w32.h - libzend.dsp - zend-scanner.l - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_opcode.c: -Tiny patches - -1999-04-13 Zeev Suraski - - * zend_execute.c: Better detection - - * zend_execute.c: - Move Ai stuff before get_zval_*(), like Andi suggested. Fixes Sascha's huge - memory leak - -1999-04-13 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c: - Fix various memory leaks. - - * zend_execute.c: Refcount bugfix - - * libzend.dsp - zend_API.c - zend_execute_API.c - zend_ptr_stack.c: * Optimize argument_stack top lookup - * Fix a nasty bug in zend_ptr_stack_clean() - -1999-04-12 Zeev Suraski - - * zend_execute_API.c - zend_globals.h: Remove unnecessary stack - - * zend_API.c: off by one - - * zend_execute.c: Minor optimization - - * zend_API.c: Make functions that don't take arguments somewhat happier:) - - * zend_execute.c: - This should take care of "this" for user-defined functions. It wasn't yet working - for built-in functions anyway, this one is coming soon. - - * zend_compile.c - zend_execute_API.c: - Destroy the resource list after destroying the symbol table, otherwise the - auto-destructor for resources are run when the resource list is no longer valid - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c: - This patch is a go. Not fully optimized yet, but working properly. - Prepatch tagged as BEFORE_STACK_PATCH. - - * zend_compile.c - zend_execute.c: Minor fixes: - missing zval_copy_ctor() - messed up AiCount fix - -1999-04-10 Zeev Suraski - - * zend_alloc.c - zend_alloc.h: Allow runtime setting of the memory limit - - * zend_alloc.c - zend_alloc.h - zend_globals.h: Get rid of php3_ini in Zend - - * zend.c - zend.h: - We need to initialize the utility values after we initialize the INI file, which in - turn, is after we initialize Zend. Set the utility values separately from Zend's - initialization - -1999-04-09 Andi Gutmans - - * zend-scanner.l: - Changed here-docs to <<< followed by whitespace. - -1999-04-09 stig - - * .cvsignore: ignore file - -1999-04-09 Andi Gutmans - - * zend-parser.y - zend_compile.h: - - I guess print $GLOBALS and print "$GLOBALS" should yield the same result - so I returned the one in encaps_var. - - Made INITAL_OP_ARRAY_SIZE smaller (64? can't remeber). I don't think the - erealloc()'s during compile time are such a biggy, we might make it even - smaller. We can have a configure time option as to it's size. - - * zend-parser.y: - - Support $GLOBALS in cvar's. Now list(..) = each($GLOBALS) will work. - - Remove support of $GLOBALS in enacapsed strings. print "$GLOBALS" isn't - supposed to work in any case. - -1999-04-09 Zeev Suraski - - * zend-scanner.l: - Honor a semicolon on the same line as an ending token of a heredoc - - * zend_compile.c: Prevent class redeclarations - -1999-04-08 Zeev Suraski - - * zend_API.c - zend_modules.h: * Add arguments to shutdown functions - * Remove traces of php_ini stuff - - * zend-parser.y: "Our favourite mistake" - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: $GLOBALS support - -1999-04-08 Andi Gutmans - - * ZEND_CHANGES: foreach() syntax has changed - -1999-04-08 Zeev Suraski - - * zend_compile.c - zend_execute.c: Fix static assignment - -1999-04-07 Zeev Suraski - - * zend_execute_API.c: Remove an unused variable - - * libzend.dsp: That's better. - - * libzend.dsp: We didn't save the .dsp back then... - - * ZendCore.dsp - ZendCore.dsw - ZendCore.mak - diffs - libzend.dsp: Cleanups: ZendCore->libzend - -1999-04-07 Rasmus Lerdorf - - * zend.c: *** empty log message *** - -1999-04-07 Andi Gutmans - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: New file. - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: Zend Library - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: New file. - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: Zend Library - diff --git a/Zend/FlexLexer.h b/Zend/FlexLexer.h deleted file mode 100644 index fd6525857024c..0000000000000 --- a/Zend/FlexLexer.h +++ /dev/null @@ -1,186 +0,0 @@ -// $Header$ - -// FlexLexer.h -- define interfaces for lexical analyzer classes generated -// by flex - -// Copyright (c) 1993 The Regents of the University of California. -// All rights reserved. -// -// This code is derived from software contributed to Berkeley by -// Kent Williams and Tom Epperly. -// -// Redistribution and use in source and binary forms with or without -// modification are permitted provided that: (1) source distributions retain -// this entire copyright notice and comment, and (2) distributions including -// binaries display the following acknowledgement: ``This product includes -// software developed by the University of California, Berkeley and its -// contributors'' in the documentation or other materials provided with the -// distribution and in all advertising materials mentioning features or use -// of this software. Neither the name of the University nor the names of -// its contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. - -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -// This file defines FlexLexer, an abstract class which specifies the -// external interface provided to flex C++ lexer objects, and yyFlexLexer, -// which defines a particular lexer class. -// -// If you want to create multiple lexer classes, you use the -P flag -// to rename each yyFlexLexer to some other xxFlexLexer. You then -// include in your other sources once per lexer class: -// -// #undef yyFlexLexer -// #define yyFlexLexer xxFlexLexer -// #include -// -// #undef yyFlexLexer -// #define yyFlexLexer zzFlexLexer -// #include -// ... - -#ifndef FLEXLEXER_H -// Never included before - need to define base class. -#define FLEXLEXER_H -#include - -extern "C++" { - -struct yy_buffer_state; -typedef int yy_state_type; - -class FlexLexer { -public: - virtual ~FlexLexer() { } - - const char* YYText() { return yytext; } - int YYLeng() { return yyleng; } - - virtual void - yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; - virtual struct yy_buffer_state* - yy_create_buffer( istream* s, int size ) = 0; - virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; - virtual void yyrestart( istream* s ) = 0; - - virtual int yylex() = 0; - - // Call yylex with new input/output sources. - int yylex( istream* new_in, ostream* new_out = 0 ) - { - switch_streams( new_in, new_out ); - return yylex(); - } - - // Switch to new input/output streams. A nil stream pointer - // indicates "keep the current one". - virtual void switch_streams( istream* new_in = 0, - ostream* new_out = 0 ) = 0; - - int lineno() const { return yylineno; } - - int debug() const { return yy_flex_debug; } - void set_debug( int flag ) { yy_flex_debug = flag; } - -protected: - char* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" -}; - -} -#endif - -#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) -// Either this is the first time through (yyFlexLexerOnce not defined), -// or this is a repeated include to define a different flavor of -// yyFlexLexer, as discussed in the flex man page. -#define yyFlexLexerOnce - -class yyFlexLexer : public FlexLexer { -public: - // arg_yyin and arg_yyout default to the cin and cout, but we - // only make that assignment when initializing in yylex(). - yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 ); - - virtual ~yyFlexLexer(); - - void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( istream* s, int size ); - void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( istream* s ); - - virtual int yylex(); - virtual void switch_streams( istream* new_in, ostream* new_out ); - -protected: - virtual int LexerInput( char* buf, int max_size ); - virtual void LexerOutput( const char* buf, int size ); - virtual void LexerError( const char* msg ); - - void yyunput( int c, char* buf_ptr ); - int yyinput(); - - void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, istream* s ); - void yy_flush_buffer( struct yy_buffer_state* b ); - - int yy_start_stack_ptr; - int yy_start_stack_depth; - int* yy_start_stack; - - void yy_push_state( int new_state ); - void yy_pop_state(); - int yy_top_state(); - - yy_state_type yy_get_previous_state(); - yy_state_type yy_try_NUL_trans( yy_state_type current_state ); - int yy_get_next_buffer(); - - istream* yyin; // input source for default LexerInput - ostream* yyout; // output sink for default LexerOutput - - struct yy_buffer_state* yy_current_buffer; - - // yy_hold_char holds the character lost when yytext is formed. - char yy_hold_char; - - // Number of characters read into yy_ch_buf. - int yy_n_chars; - - // Points to current character in buffer. - char* yy_c_buf_p; - - int yy_init; // whether we need to initialize - int yy_start; // start state number - - // Flag which is used to allow yywrap()'s to do buffer switches - // instead of setting up a fresh yyin. A bit of a hack ... - int yy_did_buffer_switch_on_eof; - - // The following are not always needed, but may be depending - // on use of certain flex features (like REJECT or yymore()). - - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - yy_state_type* yy_state_buf; - yy_state_type* yy_state_ptr; - - char* yy_full_match; - int* yy_full_state; - int yy_full_lp; - - int yy_lp; - int yy_looking_for_trail_begin; - - int yy_more_flag; - int yy_more_len; - int yy_more_offset; - int yy_prev_more_offset; -}; - -#endif diff --git a/Zend/LICENSE b/Zend/LICENSE deleted file mode 100644 index 8acb9af4f8a58..0000000000000 --- a/Zend/LICENSE +++ /dev/null @@ -1,56 +0,0 @@ --------------------------------------------------------------------- - The Zend Engine License, Version 2.00 -Copyright (c) 1999-2006 Zend Technologies Ltd. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - 3. The names "Zend" and "Zend Engine" must not be used to endorse - or promote products derived from this software without prior - permission from Zend Technologies Ltd. For written permission, - please contact license@zend.com. - - 4. Zend Technologies Ltd. may publish revised and/or new versions - of the license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the - terms of that version. You may also choose to use such covered - code under the terms of any subsequent version of the license - published by Zend Technologies Ltd. No one other than Zend - Technologies Ltd. has the right to modify the terms applicable - to covered code created under this License. - - 5. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes the Zend Engine, freely available at - http://www.zend.com" - - 6. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "The Zend Engine is freely available at http://www.zend.com" - -THIS SOFTWARE IS PROVIDED BY ZEND TECHNOLOGIES LTD. ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZEND -TECHNOLOGIES LTD. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - --------------------------------------------------------------------- diff --git a/Zend/Makefile.am b/Zend/Makefile.am deleted file mode 100644 index 3ad54a9d10740..0000000000000 --- a/Zend/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -## Process this file with automake to produce Makefile.in -*- makefile -*- - -#CLEANFILES = zend_language_parser.c zend_language_parser.h zend_language_scanner.c zend_language_parser.output zend_ini_parser.c zend_ini_parser.h zend_ini_scanner.c zend_ini_parser.output - -AUTOMAKE_OPTIONS=foreign -noinst_LTLIBRARIES=libZend.la - -libZend_la_SOURCES=\ - zend_language_parser.y zend_language_scanner.l \ - zend_ini_parser.y zend_ini_scanner.l \ - zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \ - zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \ - zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ - zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \ - zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \ - zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c \ - zend_objects_API.c zend_ts_hash.c zend_stream.c \ - zend_default_classes.c \ - zend_iterators.c zend_interfaces.c zend_exceptions.c \ - zend_strtod.c zend_multibyte.c - -libZend_la_LDFLAGS = -libZend_la_LIBADD = @ZEND_EXTRA_LIBS@ - -# automake isn't too clever about "non-standard" use of lex and yacc - -$(libZend_la_OBJECTS): zend_language_parser.h - -zend_ini_scanner.lo: zend_ini_parser.h - -# Language parser/scanner rules - -zend_language_scanner.c: $(srcdir)/zend_language_scanner.l - $(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_language_scanner.l - -zend_language_parser.h: zend_language_parser.c -zend_language_parser.c: $(srcdir)/zend_language_parser.y - $(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o zend_language_parser.c - -# INI parser/scanner rules - -zend_ini_parser.c: $(srcdir)/zend_ini_parser.y - $(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c - -zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l - $(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l - -zend_ini_parser.h: zend_ini_parser.c - -depend: - -zend_execute.lo: $(srcdir)/zend_execute.c - $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c - diff --git a/Zend/Makefile.frag b/Zend/Makefile.frag deleted file mode 100755 index 3ab617d715534..0000000000000 --- a/Zend/Makefile.frag +++ /dev/null @@ -1 +0,0 @@ -Zend/zend_execute.lo: $(srcdir)/zend_vm_execute.h $(srcdir)/zend_vm_opcodes.h diff --git a/Zend/OBJECTS2_HOWTO b/Zend/OBJECTS2_HOWTO deleted file mode 100644 index 302d1e9087b53..0000000000000 --- a/Zend/OBJECTS2_HOWTO +++ /dev/null @@ -1,195 +0,0 @@ -Creating an object ------------------- - -Object can be created in the following ways: - -1. As a result of a function call. E.g.: - -$foo = create_new_foo("parameter"); -$foo->run(); - -The function should create a new zval, create new object and get the -handle for it, set handle and handler table as needed. Note that the -handle is the only ID of the object, so it should be enough to -identify it. - -2. Overriding create_object handler for class. E.g.: - -$foo = new Java("some.Class.here", "parameter"); -$foo->run(); - -The create_object handler function should create a new zval, create -new object and get the handle for it, set handle and handler table as -needed, and also provide constructor method that would handle -constructor call. The get_constructor handler table entry should be -used for that. Do not rely class entry's constructor, unless you refer -to it from get_constructor handler. - -Object maintenance ------------------- - -The handlers add_ref and del_ref are called when a new zval referring -to the object is created. This does not create a new object - both -zvals still refer to the same object. - -clone_obj handler should create a new object, identical to an old one, -but being a separate entity. - -delete_obj should destroy an object, all references to it become -invalid. - -Object access - read --------------------- - -read_property is used to read object's property. This value is not -meant to be changed. The handler returns zval * with the value. - -Object access - write ---------------------- - -write_property is used to directly write object's property by -name. This handler is used to assign property variables or to change them -in operations like += or ++ (unless get_property_zval_ptr is also set). - -get_property_zval_ptr is used to obtain pointer to modifiable zval for -operations like += or ++. This should be used only if your object model -stores properties as real zval's that can be modified from outside. -Otherwise this handler should be NULL and the engine will use -read_property and write_property instead. - -get_property_ptr is used to obtain zval ** for future writing to -it. If your object properties are stored as zval*, return real place -where the property is stored. If the aren't, the best way is to create -proxy object and handle it via get and set methods (see below). -This method is meant to be used for send-by-reference and assign-by-reference -use of object properties. If you don;t want to implement property -referencing for your objects, you can set this handler to NULL. - -get and set handlers are used when engine needs to access the object -as a value. E.g., in the following situation: - -$foo =& $obj->bar; -$foo = 1; - -if $foo is an object (e.g., proxy object from get_property_ptr) it -would be accessed using write handler. - -Object access - method call ---------------------------- - -get_method handler is used to find method description by name. It -should set right type, function name and parameter mask for the -method. If the type is ZEND_OVERLOADED_FUNCTION, the method would be -called via call_method handler, otherwise it would be called with -standard Zend means. - -get_constructor performs the same function as get_method, but for the -object constructor. - -call_method handler is used to perform method call. Parameters are -passed like to any other Zend internal function. - -Object - comparison -------------------- - -Objects can be compared via compare_objects handler. This is used with -== operation, === compares objects by handles, i.e., return true if -and only if it's really the same object. Note that objects from -different object types (i.e., having different handlers) can not be -compared. - -Objects - reflection --------------------- - -get_class_name is used to retrieve class name of the object. -get_class_entry returns class entry (zend_class_entry) for the object, -in case there exists PHP class for it. -No other reflection functions are currently implemented. - -Objects - data structures and handlers ---------------------------------------- - -The object is represented by the following structure: - -struct _zend_object_value { - zend_object_handle handle; - zend_object_handlers *handlers; -}; - -handle is an ID of the object among the objects of the same type (not -class!). The type of the object and how it behaves is determined by -the handler table. - -typedef struct _zend_object_handlers { - zend_object_add_ref_t add_ref; - zend_object_del_ref_t del_ref; - zend_object_delete_obj_t delete_obj; - zend_object_clone_obj_t clone_obj; - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_get_property_ptr_t get_property_ptr; - zend_object_get_property_zval_ptr_t get_property_zval_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_get_properties_t get_properties; - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_entry_t get_class_entry; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; -} zend_object_handlers; - -See zend_object_handlers.h for prototypes. All objects are passed as zval's. - -Handlers explained: - -add_ref - called when a copy of the object handle is created. - -del_ref - called when a copy of the object handle is destroyed. - -delete_obj - called when an object needs to be destroyed. - -clone_obj - called when a new object identical to an old one should be -created (unlike Zend Engine 1, this never happens unless explicitly -asked for). - -read_property - returns zval *, containing the value of the -property. Is used when value of the property should be retrieved for -reading. - -write_property - assigns value to certain property of the object. - -get_property_zval_ptr - retrieves zval** for being directly modified by -the engine. If your properties are not zval's, don't define it. - -get_property_ptr - retrieves zval** for the property of the value, to -be used for read and write. If object properties are not zval's -natively, this method should create and return proxy object for use -with get and set methods. - -get - retrieves zval* for object contents. To be used mainly with -proxy objects from get_property_ptr, but also may be used for -convert_to_* functions. - -set - sets value for object contents. To be used mainly with -proxy objects from get_property_ptr. - -has_property - checks if the object has certain property set. - -unset_property - removes value for the property of the object - -get_method - retrieves description of the method - -call_method - calls the method (parameters should be put on stack like -for any other PHP internal function). - -get_constructor - get description for the object constructor method - -get_class_entry - should return the class entry for the object - -get_class_name - get the name of the class the object belongs to - -compare_objects - compares if two objects are equal diff --git a/Zend/README.ZEND_MM b/Zend/README.ZEND_MM deleted file mode 100644 index cf9a9b7e832af..0000000000000 --- a/Zend/README.ZEND_MM +++ /dev/null @@ -1,34 +0,0 @@ -Zend Memory Manager -=================== - -General: --------- - -The goal of the new memory manager (available since PHP 5.2) is to reduce memory -allocation overhead and speedup memory management. - -The new manager's "configure" has no "--disable-zend-memory-manager" option, -but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG -build and disabled by default in RELEASE build. when enabled it allows selecting -between malloc and emalloc at runtime so you can use internal and external memory -debuggers without recompilation. - -Debugging: ----------- - -Normal: - - $ sapi/cli/php -r 'leak();' - -Zend MM disabled: - - $ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();' - -Tweaking: ---------- - -The Zend MM can be tweaked using ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment -variables. Default values are "malloc" and "256K". Dependent on target system you -can also use "mmap_anon", "mmap_zero" and "win32" storage managers. - - $ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php ..etc. diff --git a/Zend/README.ZEND_VM b/Zend/README.ZEND_VM deleted file mode 100644 index 15ff6fd86f4bd..0000000000000 --- a/Zend/README.ZEND_VM +++ /dev/null @@ -1,108 +0,0 @@ -ZEND_VM -======= - -ZEND_VM architecture allows specializing opcode handlers according to op_type -fields and using different execution methods (call threading, switch threading -and direct threading). As a result ZE2 got more than 20% speedup on raw PHP -code execution (with specialized executor and direct threading execution -method). As in most PHP applications raw execution speed isn't the limiting -factor but system calls and database callls are, your mileage with this patch -will vary. - -Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can -find opcode handlers and helpers. The typical opcode handler template looks -like this: - -ZEND_VM_HANDLER(, , , ) -{ - -} - - is a opcode number (0, 1, ...) - is an opcode name (ZEN_NOP, ZEND_ADD, :) - & are masks for allowed operand op_types. Specializer -will generate code only for defined combination of types. You can use any -combination of the following op_types UNUSED, CONST, VAR, TMP and CV also -you can use ANY mask to disable specialization according operand's op_type. - is a handler's code itself. For most handlers it stills the -same as in old zend_execute.c, but now it uses macros to access opcode operands -and some internal executor data. - -You can see the conformity of new macros to old code in the following list: - -EXECUTE_DATA - execute_data -ZEND_VM_DISPATCH_TO_HANDLER() - return _helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) -ZEND_VM_DISPATCH_TO_HELPER() - return (ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) -ZEND_VM_DISPATCH_TO_HELPER_EX(,,) - return (, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) -ZEND_VM_CONTINUE() - return 0 -ZEND_VM_NEXT_OPCODE() - NEXT_OPCODE() -ZEND_VM_SET_OPCODE( - SET_OPCODE( -ZEND_VM_INC_OPCODE() - INC_OPCOD() -ZEND_VM_RETURN_FROM_EXECUTE_LOOP() - RETURN_FROM_EXECUTE_LOOP() -ZEND_VM_C_LABEL(\n"); - zend_printf(""); -} - -ZEND_API void zend_strip(TSRMLS_D) -{ - zval token; - int token_type; - int prev_space = 0; - - token.type = 0; - while ((token_type=lex_scan(&token TSRMLS_CC))) { - switch (token_type) { - case T_WHITESPACE: - if (!prev_space) { - zend_write(" ", sizeof(" ") - 1); - prev_space = 1; - } - /* lack of break; is intentional */ - case T_COMMENT: - case T_DOC_COMMENT: - token.type = 0; - continue; - - case EOF: - return; - - case T_END_HEREDOC: - zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); - efree(token.value.str.val); - /* read the following character, either newline or ; */ - if (lex_scan(&token TSRMLS_CC) != T_WHITESPACE) { - zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); - } - zend_write("\n", sizeof("\n") - 1); - prev_space = 1; - token.type = 0; - continue; - - default: - zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); - break; - } - - if (token.type == IS_STRING) { - switch (token_type) { - case T_OPEN_TAG: - case T_OPEN_TAG_WITH_ECHO: - case T_CLOSE_TAG: - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - break; - - default: - efree(token.value.str.val); - break; - } - } - prev_space = token.type = 0; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ - diff --git a/Zend/zend_highlight.h b/Zend/zend_highlight.h deleted file mode 100644 index 5e14c2475e52d..0000000000000 --- a/Zend/zend_highlight.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_HIGHLIGHT_H -#define ZEND_HIGHLIGHT_H - -#define HL_COMMENT_COLOR "#FF8000" /* orange */ -#define HL_DEFAULT_COLOR "#0000BB" /* blue */ -#define HL_HTML_COLOR "#000000" /* black */ -#define HL_STRING_COLOR "#DD0000" /* red */ -#define HL_BG_COLOR "#FFFFFF" /* white */ -#define HL_KEYWORD_COLOR "#007700" /* green */ - - -typedef struct _zend_syntax_highlighter_ini { - char *highlight_html; - char *highlight_comment; - char *highlight_default; - char *highlight_string; - char *highlight_keyword; -} zend_syntax_highlighter_ini; - - -BEGIN_EXTERN_C() -ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC); -ZEND_API void zend_strip(TSRMLS_D); -ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC); -ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC); -ZEND_API void zend_html_putc(char c); -ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC); -END_EXTERN_C() - -extern zend_syntax_highlighter_ini syntax_highlighter_ini; - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c deleted file mode 100644 index 9503a5503107c..0000000000000 --- a/Zend/zend_indent.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This indenter doesn't really work, it's here for no particular reason. */ - - -#include "zend.h" -#include -#include "zend_compile.h" -#include "zend_indent.h" - -#define zendtext LANG_SCNG(yy_text) -#define zendleng LANG_SCNG(yy_leng) - - -static void handle_whitespace(int *emit_whitespace) -{ - unsigned char c; - int i; - - for (c=0; c<128; c++) { - if (emit_whitespace[c]>0) { - for (i=0; i0) { - ZEND_PUTS(" {\n"); - memset(emit_whitespace, 0, sizeof(int)*256); - } else { - ZEND_PUTS("{"); - } - break; - case '}': - nest_level--; - if (emit_whitespace['\n']==0) { - ZEND_PUTS("\n"); - } - for (i=0; i0) { - for (i=0; i | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_INDENT_H -#define ZEND_INDENT_H - -BEGIN_EXTERN_C() -ZEND_API void zend_indent(void); -END_EXTERN_C() - -#endif /* ZEND_INDENT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c deleted file mode 100644 index ef526c7467d98..0000000000000 --- a/Zend/zend_ini.c +++ /dev/null @@ -1,651 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_qsort.h" -#include "zend_API.h" -#include "zend_ini.h" -#include "zend_alloc.h" -#include "zend_operators.h" -#include "zend_strtod.h" - -static HashTable *registered_zend_ini_directives; - -#define NO_VALUE_PLAINTEXT "no value" -#define NO_VALUE_HTML "no value" - -/* - * hash_apply functions - */ -static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number TSRMLS_DC) /* {{{ */ -{ - if (ini_entry->module_number == *module_number) { - return 1; - } else { - return 0; - } -} -/* }}} */ - -static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC) /* {{{ */ -{ - if (ini_entry->modified) { - if (ini_entry->on_modify) { - zend_try { - /* even if on_modify bails out, we have to continue on with restoring, - since there can be allocated variables that would be freed on MM shutdown - and would lead to memory corruption later ini entry is modified again */ - ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC); - } zend_end_try(); - } - if (ini_entry->value != ini_entry->orig_value) { - efree(ini_entry->value); - } - ini_entry->value = ini_entry->orig_value; - ini_entry->value_length = ini_entry->orig_value_length; - ini_entry->modified = 0; - ini_entry->orig_value = NULL; - ini_entry->orig_value_length = 0; - if (ini_entry->modifiable >= (1 << 3)) { - ini_entry->modifiable >>= 3; - } - } - return 0; -} -/* }}} */ - -static int zend_restore_ini_entry_wrapper(zend_ini_entry **ini_entry TSRMLS_DC) /* {{{ */ -{ - zend_restore_ini_entry_cb(*ini_entry, ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC); - return 1; -} -/* }}} */ - -/* - * Startup / shutdown - */ -ZEND_API int zend_ini_startup(TSRMLS_D) /* {{{ */ -{ - registered_zend_ini_directives = (HashTable *) malloc(sizeof(HashTable)); - - EG(ini_directives) = registered_zend_ini_directives; - EG(modified_ini_directives) = NULL; - if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0) == FAILURE) { - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - -ZEND_API int zend_ini_shutdown(TSRMLS_D) /* {{{ */ -{ - zend_hash_destroy(EG(ini_directives)); - free(EG(ini_directives)); - return SUCCESS; -} -/* }}} */ - -ZEND_API int zend_ini_global_shutdown(TSRMLS_D) /* {{{ */ -{ - zend_hash_destroy(registered_zend_ini_directives); - free(registered_zend_ini_directives); - return SUCCESS; -} -/* }}} */ - -ZEND_API int zend_ini_deactivate(TSRMLS_D) /* {{{ */ -{ - if (EG(modified_ini_directives)) { - zend_hash_apply(EG(modified_ini_directives), (apply_func_t) zend_restore_ini_entry_wrapper TSRMLS_CC); - zend_hash_destroy(EG(modified_ini_directives)); - FREE_HASHTABLE(EG(modified_ini_directives)); - EG(modified_ini_directives) = NULL; - } - return SUCCESS; -} -/* }}} */ - -#ifdef ZTS -ZEND_API int zend_copy_ini_directives(TSRMLS_D) /* {{{ */ -{ - zend_ini_entry ini_entry; - - EG(modified_ini_directives) = NULL; - EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable)); - if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0) == FAILURE) { - return FAILURE; - } - zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry)); - return SUCCESS; -} -/* }}} */ -#endif - -static int ini_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */ -{ - Bucket *f; - Bucket *s; - - f = *((Bucket **) a); - s = *((Bucket **) b); - - if (f->nKeyLength == 0 && s->nKeyLength == 0) { /* both numeric */ - return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength); - } else if (f->nKeyLength == 0) { /* f is numeric, s is not */ - return -1; - } else if (s->nKeyLength == 0) { /* s is numeric, f is not */ - return 1; - } else { /* both strings */ - return zend_binary_strcasecmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength); - } -} -/* }}} */ - -ZEND_API void zend_ini_sort_entries(TSRMLS_D) /* {{{ */ -{ - zend_hash_sort(EG(ini_directives), zend_qsort, ini_key_compare, 0 TSRMLS_CC); -} -/* }}} */ - -/* - * Registration / unregistration - */ -ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC) /* {{{ */ -{ - zend_ini_entry *p = ini_entry; - zend_ini_entry *hashed_ini_entry; - zval default_value; - HashTable *directives = registered_zend_ini_directives; - zend_bool config_directive_success = 0; - -#ifdef ZTS - /* if we are called during the request, eg: from dl(), - * then we should not touch the global directives table, - * and should update the per-(request|thread) version instead. - * This solves two problems: one is that ini entries for dl()'d - * extensions will now work, and the second is that updating the - * global hash here from dl() is not mutex protected and can - * lead to death. - */ - if (directives != EG(ini_directives)) { - directives = EG(ini_directives); - } -#endif - - while (p->name) { - p->module_number = module_number; - config_directive_success = 0; - if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry) == FAILURE) { - zend_unregister_ini_entries(module_number TSRMLS_CC); - return FAILURE; - } - if ((zend_get_configuration_directive(p->name, p->name_length, &default_value)) == SUCCESS) { - if (!hashed_ini_entry->on_modify - || hashed_ini_entry->on_modify(hashed_ini_entry, Z_STRVAL(default_value), Z_STRLEN(default_value), hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS) { - hashed_ini_entry->value = Z_STRVAL(default_value); - hashed_ini_entry->value_length = Z_STRLEN(default_value); - config_directive_success = 1; - } - } - - if (!config_directive_success && hashed_ini_entry->on_modify) { - hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC); - } - p++; - } - return SUCCESS; -} -/* }}} */ - -ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC) /* {{{ */ -{ - zend_hash_apply_with_argument(registered_zend_ini_directives, (apply_func_arg_t) zend_remove_ini_entries, (void *) &module_number TSRMLS_CC); -} -/* }}} */ - -#ifdef ZTS -static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC) /* {{{ */ -{ - if (p->on_modify) { - p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC); - } - return 0; -} -/* }}} */ - -ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) /* {{{ */ -{ - zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(zend_intptr_t) stage TSRMLS_CC); -} -/* }}} */ -#endif - -ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage) /* {{{ */ -{ - return zend_alter_ini_entry_ex(name, name_length, new_value, new_value_length, modify_type, stage, 0); -} -/* }}} */ - -ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change) /* {{{ */ -{ - zend_ini_entry *ini_entry; - char *duplicate; - zend_bool modifiable; - zend_bool modified; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE) { - return FAILURE; - } - - modifiable = ini_entry->modifiable; - modified = ini_entry->modified; - - if (stage == ZEND_INI_STAGE_ACTIVATE && modify_type == ZEND_INI_SYSTEM) { - /* only touch lower bits */ - ini_entry->modifiable = (ini_entry->modifiable & (ZEND_INI_ALL << 3)) | ZEND_INI_SYSTEM; - } - - if (!force_change) { - if (!(ini_entry->modifiable & modify_type)) { - return FAILURE; - } - } - - if (!EG(modified_ini_directives)) { - ALLOC_HASHTABLE(EG(modified_ini_directives)); - zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0); - } - if (!modified) { - ini_entry->orig_value = ini_entry->value; - ini_entry->orig_value_length = ini_entry->value_length; - /* store orginial value in the upper bits */ - ini_entry->modifiable = (modifiable << 3) | ini_entry->modifiable; - ini_entry->modified = 1; - zend_hash_add(EG(modified_ini_directives), name, name_length, &ini_entry, sizeof(zend_ini_entry*), NULL); - } - - duplicate = estrndup(new_value, new_value_length); - - if (!ini_entry->on_modify - || ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) { - if (modified && ini_entry->orig_value != ini_entry->value) { /* we already changed the value, free the changed value */ - efree(ini_entry->value); - } - ini_entry->value = duplicate; - ini_entry->value_length = new_value_length; - } else { - efree(duplicate); - } - - return SUCCESS; -} -/* }}} */ - -ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) /* {{{ */ -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE || - (stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) { - return FAILURE; - } - - if (EG(modified_ini_directives)) { - zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC); - zend_hash_del(EG(modified_ini_directives), name, name_length); - } - - return SUCCESS; -} -/* }}} */ - -ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)) /* {{{ */ -{ - zend_ini_entry *ini_entry; - - if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry) == FAILURE) { - return FAILURE; - } - - ini_entry->displayer = displayer; - return SUCCESS; -} -/* }}} */ - -/* - * Data retrieval - */ - -ZEND_API long zend_ini_long(char *name, uint name_length, int orig) /* {{{ */ -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) { - if (orig && ini_entry->modified) { - return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0); - } else if (ini_entry->value) { - return strtol(ini_entry->value, NULL, 0); - } - } - - return 0; -} -/* }}} */ - -ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ */ -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) { - if (orig && ini_entry->modified) { - return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0); - } else if (ini_entry->value) { - return (double) zend_strtod(ini_entry->value, NULL); - } - } - - return 0.0; -} -/* }}} */ - -ZEND_API char *zend_ini_string(char *name, uint name_length, int orig) /* {{{ */ -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) { - if (orig && ini_entry->modified) { - return ini_entry->orig_value; - } else { - return ini_entry->value; - } - } - - return ""; -} -/* }}} */ - -#if TONY_20070307 -static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type) /* {{{ */ -{ - if (ini_entry->displayer) { - ini_entry->displayer(ini_entry, type); - } else { - char *display_string; - uint display_string_length; - - if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - if (ini_entry->orig_value) { - display_string = ini_entry->orig_value; - display_string_length = ini_entry->orig_value_length; - } else { - if (zend_uv.html_errors) { - display_string = NO_VALUE_HTML; - display_string_length = sizeof(NO_VALUE_HTML) - 1; - } else { - display_string = NO_VALUE_PLAINTEXT; - display_string_length = sizeof(NO_VALUE_PLAINTEXT) - 1; - } - } - } else if (ini_entry->value && ini_entry->value[0]) { - display_string = ini_entry->value; - display_string_length = ini_entry->value_length; - } else { - if (zend_uv.html_errors) { - display_string = NO_VALUE_HTML; - display_string_length = sizeof(NO_VALUE_HTML) - 1; - } else { - display_string = NO_VALUE_PLAINTEXT; - display_string_length = sizeof(NO_VALUE_PLAINTEXT) - 1; - } - } - ZEND_WRITE(display_string, display_string_length); - } -} -/* }}} */ -#endif - -ZEND_INI_DISP(zend_ini_boolean_displayer_cb) /* {{{ */ -{ - int value, tmp_value_len; - char *tmp_value; - - if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL ); - tmp_value_len = ini_entry->orig_value_length; - } else if (ini_entry->value) { - tmp_value = ini_entry->value; - tmp_value_len = ini_entry->value_length; - } else { - tmp_value = NULL; - tmp_value_len = 0; - } - - if (tmp_value) { - if (tmp_value_len == 4 && strcasecmp(tmp_value, "true") == 0) { - value = 1; - } else if (tmp_value_len == 3 && strcasecmp(tmp_value, "yes") == 0) { - value = 1; - } else if (tmp_value_len == 2 && strcasecmp(tmp_value, "on") == 0) { - value = 1; - } else { - value = atoi(tmp_value); - } - } else { - value = 0; - } - - if (value) { - ZEND_PUTS("On"); - } else { - ZEND_PUTS("Off"); - } -} -/* }}} */ - -ZEND_INI_DISP(zend_ini_color_displayer_cb) /* {{{ */ -{ - char *value; - - if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - if (value) { - if (zend_uv.html_errors) { - zend_printf("%s", value, value); - } else { - ZEND_PUTS(value); - } - } else { - if (zend_uv.html_errors) { - ZEND_PUTS(NO_VALUE_HTML); - } else { - ZEND_PUTS(NO_VALUE_PLAINTEXT); - } - } -} -/* }}} */ - -ZEND_INI_DISP(display_link_numbers) /* {{{ */ -{ - char *value; - - if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - - if (value) { - if (atoi(value) == -1) { - ZEND_PUTS("Unlimited"); - } else { - zend_printf("%s", value); - } - } -} -/* }}} */ - -/* Standard message handlers */ -ZEND_API ZEND_INI_MH(OnUpdateBool) /* {{{ */ -{ - zend_bool *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (zend_bool *) (base+(size_t) mh_arg1); - - if (new_value_length == 2 && strcasecmp("on", new_value) == 0) { - *p = (zend_bool) 1; - } - else if (new_value_length == 3 && strcasecmp("yes", new_value) == 0) { - *p = (zend_bool) 1; - } - else if (new_value_length == 4 && strcasecmp("true", new_value) == 0) { - *p = (zend_bool) 1; - } - else { - *p = (zend_bool) atoi(new_value); - } - return SUCCESS; -} -/* }}} */ - -ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */ -{ - long *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (long *) (base+(size_t) mh_arg1); - - *p = zend_atoi(new_value, new_value_length); - return SUCCESS; -} -/* }}} */ - -ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) -{ - long *p, tmp; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - tmp = zend_atoi(new_value, new_value_length); - if (tmp < 0) { - return FAILURE; - } - - p = (long *) (base+(size_t) mh_arg1); - *p = tmp; - - return SUCCESS; -} -/* }}} */ - -ZEND_API ZEND_INI_MH(OnUpdateReal) /* {{{ */ -{ - double *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (double *) (base+(size_t) mh_arg1); - - *p = zend_strtod(new_value, NULL); - return SUCCESS; -} -/* }}} */ - -ZEND_API ZEND_INI_MH(OnUpdateString) /* {{{ */ -{ - char **p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (char **) (base+(size_t) mh_arg1); - - *p = new_value; - return SUCCESS; -} -/* }}} */ - -ZEND_API ZEND_INI_MH(OnUpdateStringUnempty) /* {{{ */ -{ - char **p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - if (new_value && !new_value[0]) { - return FAILURE; - } - - p = (char **) (base+(size_t) mh_arg1); - - *p = new_value; - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h deleted file mode 100644 index db9df19bdc182..0000000000000 --- a/Zend/zend_ini.h +++ /dev/null @@ -1,219 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_INI_H -#define ZEND_INI_H - -#define ZEND_INI_USER (1<<0) -#define ZEND_INI_PERDIR (1<<1) -#define ZEND_INI_SYSTEM (1<<2) - -#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM) - -#ifndef XtOffsetOf -# if defined(CRAY) || (defined(__arm) && !defined(LINUX)) -# ifdef __STDC__ -# define XtOffset(p_type, field) _Offsetof(p_type, field) -# else -# ifdef CRAY2 -# define XtOffset(p_type, field) \ - (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) - -# else /* !CRAY2 */ - -# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field)) - -# endif /* !CRAY2 */ -# endif /* __STDC__ */ -# else /* ! (CRAY || __arm) */ - -# define XtOffset(p_type, field) \ - ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) - -# endif /* !CRAY */ - -# ifdef offsetof -# define XtOffsetOf(s_type, field) offsetof(s_type, field) -# else -# define XtOffsetOf(s_type, field) XtOffset(s_type*, field) -# endif - -#endif - -typedef struct _zend_ini_entry zend_ini_entry; - -#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC) -#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type) - -struct _zend_ini_entry { - int module_number; - int modifiable; - char *name; - uint name_length; - ZEND_INI_MH((*on_modify)); - void *mh_arg1; - void *mh_arg2; - void *mh_arg3; - - char *value; - uint value_length; - - char *orig_value; - uint orig_value_length; - int modified; - - void (*displayer)(zend_ini_entry *ini_entry, int type); -}; - -BEGIN_EXTERN_C() -ZEND_API int zend_ini_startup(TSRMLS_D); -ZEND_API int zend_ini_shutdown(TSRMLS_D); -ZEND_API int zend_ini_global_shutdown(TSRMLS_D); -ZEND_API int zend_ini_deactivate(TSRMLS_D); - -ZEND_API int zend_copy_ini_directives(TSRMLS_D); - -ZEND_API void zend_ini_sort_entries(TSRMLS_D); - -ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC); -ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC); -ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC); -ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage); -ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change); -ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage); -ZEND_API void display_ini_entries(zend_module_entry *module); - -ZEND_API long zend_ini_long(char *name, uint name_length, int orig); -ZEND_API double zend_ini_double(char *name, uint name_length, int orig); -ZEND_API char *zend_ini_string(char *name, uint name_length, int orig); - -ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)); - -ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb); -ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb); -ZEND_API ZEND_INI_DISP(display_link_numbers); -END_EXTERN_C() - -#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = { -#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } }; - -#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer) \ - { 0, modifiable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer }, - -#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL) - -#define ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL, displayer) - -#define ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, arg1, arg2) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL) - -#define ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, NULL, NULL, displayer) - -#define ZEND_INI_ENTRY1(name, default_value, modifiable, on_modify, arg1) \ - ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL) - -#define ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer) - -#define ZEND_INI_ENTRY(name, default_value, modifiable, on_modify) \ - ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, NULL) - -#ifdef ZTS -#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id) -#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer) -#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb) -#else -#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr) -#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer) -#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb) -#endif - -#define INI_INT(name) zend_ini_long((name), sizeof(name), 0) -#define INI_FLT(name) zend_ini_double((name), sizeof(name), 0) -#define INI_STR(name) zend_ini_string((name), sizeof(name), 0) -#define INI_BOOL(name) ((zend_bool) INI_INT(name)) - -#define INI_ORIG_INT(name) zend_ini_long((name), sizeof(name), 1) -#define INI_ORIG_FLT(name) zend_ini_double((name), sizeof(name), 1) -#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name), 1) -#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name)) - - -#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number TSRMLS_CC) -#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number TSRMLS_CC) -#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module) - -#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name), displayer) -#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb) - -/* Standard message handlers */ -BEGIN_EXTERN_C() -ZEND_API ZEND_INI_MH(OnUpdateBool); -ZEND_API ZEND_INI_MH(OnUpdateLong); -ZEND_API ZEND_INI_MH(OnUpdateLongGEZero); -ZEND_API ZEND_INI_MH(OnUpdateReal); -ZEND_API ZEND_INI_MH(OnUpdateString); -ZEND_API ZEND_INI_MH(OnUpdateStringUnempty); -END_EXTERN_C() - -#define ZEND_INI_DISPLAY_ORIG 1 -#define ZEND_INI_DISPLAY_ACTIVE 2 - -#define ZEND_INI_STAGE_STARTUP (1<<0) -#define ZEND_INI_STAGE_SHUTDOWN (1<<1) -#define ZEND_INI_STAGE_ACTIVATE (1<<2) -#define ZEND_INI_STAGE_DEACTIVATE (1<<3) -#define ZEND_INI_STAGE_RUNTIME (1<<4) -#define ZEND_INI_STAGE_HTACCESS (1<<5) - -/* INI parsing engine */ -typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg); -BEGIN_EXTERN_C() -ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg); -ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg); -END_EXTERN_C() - -#define ZEND_INI_PARSER_ENTRY 1 -#define ZEND_INI_PARSER_SECTION 2 -#define ZEND_INI_PARSER_POP_ENTRY 3 - -typedef struct _zend_ini_parser_param { - zend_ini_parser_cb_t ini_parser_cb; - void *arg; -} zend_ini_parser_param; - -#endif /* ZEND_INI_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y deleted file mode 100644 index 60b9258c7b731..0000000000000 --- a/Zend/zend_ini_parser.y +++ /dev/null @@ -1,316 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define DEBUG_CFG_PARSER 0 -#include "zend.h" -#include "zend_API.h" -#include "zend_ini.h" -#include "zend_constants.h" -#include "zend_ini_scanner.h" -#include "zend_extensions.h" - -#define YYSTYPE zval - -#ifdef ZTS -#define YYPARSE_PARAM tsrm_ls -#define YYLEX_PARAM tsrm_ls -#endif - -#define ZEND_INI_PARSER_CB (CG(ini_parser_param))->ini_parser_cb -#define ZEND_INI_PARSER_ARG (CG(ini_parser_param))->arg - -int ini_lex(zval *ini_lval TSRMLS_DC); -#ifdef ZTS -int ini_parse(void *arg); -#else -int ini_parse(void); -#endif - -zval yylval; - -#ifndef ZTS -extern int ini_lex(zval *ini_lval TSRMLS_DC); -extern FILE *ini_in; -extern void init_cfg_scanner(void); -#endif - -void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2) -{ - int i_result; - int i_op1, i_op2; - char str_result[MAX_LENGTH_OF_LONG]; - - i_op1 = atoi(Z_STRVAL_P(op1)); - free(Z_STRVAL_P(op1)); - if (op2) { - i_op2 = atoi(Z_STRVAL_P(op2)); - free(Z_STRVAL_P(op2)); - } else { - i_op2 = 0; - } - - switch (type) { - case '|': - i_result = i_op1 | i_op2; - break; - case '&': - i_result = i_op1 & i_op2; - break; - case '~': - i_result = ~i_op1; - break; - case '!': - i_result = !i_op1; - break; - default: - i_result = 0; - break; - } - - Z_STRLEN_P(result) = zend_sprintf(str_result, "%d", i_result); - Z_STRVAL_P(result) = (char *) malloc(Z_STRLEN_P(result)+1); - memcpy(Z_STRVAL_P(result), str_result, Z_STRLEN_P(result)); - Z_STRVAL_P(result)[Z_STRLEN_P(result)] = 0; - Z_TYPE_P(result) = IS_STRING; -} - -void zend_ini_init_string(zval *result) -{ - Z_STRVAL_P(result) = malloc(1); - Z_STRVAL_P(result)[0] = 0; - Z_STRLEN_P(result) = 0; - Z_TYPE_P(result) = IS_STRING; -} - -void zend_ini_add_string(zval *result, zval *op1, zval *op2) -{ - int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); - - Z_STRVAL_P(result) = (char *) realloc(Z_STRVAL_P(op1), length+1); - memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - Z_STRVAL_P(result)[length] = 0; - Z_STRLEN_P(result) = length; - Z_TYPE_P(result) = IS_STRING; -} - -void zend_ini_get_constant(zval *result, zval *name) -{ - zval z_constant; - TSRMLS_FETCH(); - - if (!memchr(Z_STRVAL_P(name), ':', Z_STRLEN_P(name)) - && zend_get_constant(Z_STRVAL_P(name), Z_STRLEN_P(name), &z_constant TSRMLS_CC)) { - /* z_constant is emalloc()'d */ - convert_to_string(&z_constant); - Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(z_constant), Z_STRLEN(z_constant)); - Z_STRLEN_P(result) = Z_STRLEN(z_constant); - Z_TYPE_P(result) = Z_TYPE(z_constant); - zval_dtor(&z_constant); - free(Z_STRVAL_P(name)); - } else { - *result = *name; - } -} - -void zend_ini_get_var(zval *result, zval *name) -{ - zval curval; - char *envvar; - TSRMLS_FETCH(); - - if (zend_get_configuration_directive(Z_STRVAL_P(name), Z_STRLEN_P(name)+1, &curval) == SUCCESS) { - Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(curval), Z_STRLEN(curval)); - Z_STRLEN_P(result) = Z_STRLEN(curval); - } else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name) TSRMLS_CC)) != NULL || - (envvar = getenv(Z_STRVAL_P(name))) != NULL) { - Z_STRVAL_P(result) = strdup(envvar); - Z_STRLEN_P(result) = strlen(envvar); - } else { - zend_ini_init_string(result); - } -} - - -static void ini_error(char *str) -{ - char *error_buf; - int error_buf_len; - char *currently_parsed_filename; - TSRMLS_FETCH(); - - currently_parsed_filename = zend_ini_scanner_get_filename(TSRMLS_C); - if (currently_parsed_filename) { - error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */ - error_buf = (char *) emalloc(error_buf_len); - - sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C)); - } else { - error_buf = estrdup("Invalid configuration directive\n"); - } - - if (CG(ini_parser_unbuffered_errors)) { -#ifdef PHP_WIN32 - MessageBox(NULL, error_buf, "PHP Error", MB_OK|MB_TOPMOST|0x00200000L); -#else - fprintf(stderr, "PHP: %s", error_buf); -#endif - } else { - zend_error(E_WARNING, "%s", error_buf); - } - efree(error_buf); -} - - -ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg) -{ - int retval; - zend_ini_parser_param ini_parser_param; - TSRMLS_FETCH(); - - ini_parser_param.ini_parser_cb = ini_parser_cb; - ini_parser_param.arg = arg; - - CG(ini_parser_param) = &ini_parser_param; - if (zend_ini_open_file_for_scanning(fh TSRMLS_CC)==FAILURE) { - return FAILURE; - } - - CG(ini_parser_unbuffered_errors) = unbuffered_errors; - retval = ini_parse(TSRMLS_C); - - zend_ini_close_file(fh TSRMLS_CC); - - if (retval==0) { - return SUCCESS; - } else { - return FAILURE; - } -} - - -ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg) -{ - zend_ini_parser_param ini_parser_param; - TSRMLS_FETCH(); - - ini_parser_param.ini_parser_cb = ini_parser_cb; - ini_parser_param.arg = arg; - - CG(ini_parser_param) = &ini_parser_param; - if (zend_ini_prepare_string_for_scanning(str TSRMLS_CC)==FAILURE) { - return FAILURE; - } - - CG(ini_parser_unbuffered_errors) = unbuffered_errors; - - if (ini_parse(TSRMLS_C)) { - return SUCCESS; - } else { - return FAILURE; - } -} - - -%} - -%pure_parser -%token TC_STRING -%token TC_ENCAPSULATED_STRING -%token BRACK -%token SECTION -%token CFG_TRUE -%token CFG_FALSE -%token TC_DOLLAR_CURLY -%left '|' '&' -%right '~' '!' - -%% - -statement_list: - statement_list statement - | /* empty */ -; - -statement: - TC_STRING '=' string_or_value { -#if DEBUG_CFG_PARSER - printf("'%s' = '%s'\n", Z_STRVAL($1), Z_STRVAL($3)); -#endif - ZEND_INI_PARSER_CB(&$1, &$3, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); - free(Z_STRVAL($1)); - free(Z_STRVAL($3)); - } - | TC_STRING BRACK '=' string_or_value { -#if DEBUG_CFG_PARSER - printf("'%s'[ ] = '%s'\n", Z_STRVAL($1), Z_STRVAL($4)); -#endif - ZEND_INI_PARSER_CB(&$1, &$4, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG); - free(Z_STRVAL($1)); - free(Z_STRVAL($4)); - } - | TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free(Z_STRVAL($1)); } - | SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free(Z_STRVAL($1)); } - | '\n' -; - - -string_or_value: - expr { $$ = $1; } - | CFG_TRUE { $$ = $1; } - | CFG_FALSE { $$ = $1; } - | '\n' { zend_ini_init_string(&$$); } - | /* empty */ { zend_ini_init_string(&$$); } -; - - -var_string_list: - cfg_var_ref { $$ = $1; } - | TC_ENCAPSULATED_STRING { $$ = $1; } - | constant_string { $$ = $1; } - | var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } - | var_string_list TC_ENCAPSULATED_STRING { zend_ini_add_string(&$$, &$1, &$2); free(Z_STRVAL($2)); } - | var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } -; - -cfg_var_ref: - TC_DOLLAR_CURLY TC_STRING '}' { zend_ini_get_var(&$$, &$2); free($2.value.str.val); } -; - -expr: - var_string_list { $$ = $1; } - | expr '|' expr { zend_ini_do_op('|', &$$, &$1, &$3); } - | expr '&' expr { zend_ini_do_op('&', &$$, &$1, &$3); } - | '~' expr { zend_ini_do_op('~', &$$, &$2, NULL); } - | '!' expr { zend_ini_do_op('!', &$$, &$2, NULL); } - | '(' expr ')' { $$ = $2; } -; - -constant_string: - TC_STRING { zend_ini_get_constant(&$$, &$1); } -; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h deleted file mode 100644 index 92d08137333e2..0000000000000 --- a/Zend/zend_ini_scanner.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _ZEND_INI_SCANNER_H -#define _ZEND_INI_SCANNER_H - -BEGIN_EXTERN_C() -int zend_ini_scanner_get_lineno(TSRMLS_D); -char *zend_ini_scanner_get_filename(TSRMLS_D); -int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC); -int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC); -void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC); -int ini_lex(zval *ini_lval TSRMLS_DC); -END_EXTERN_C() - -#endif /* _ZEND_INI_SCANNER_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l deleted file mode 100644 index 3f91bb64a7407..0000000000000 --- a/Zend/zend_ini_scanner.l +++ /dev/null @@ -1,251 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define yyleng SCNG(yy_leng) -#define yytext SCNG(yy_text) -#define yytext_ptr SCNG(yy_text) -#define yyin SCNG(yy_in) -#define yyout SCNG(yy_out) -#define yy_last_accepting_state SCNG(_yy_last_accepting_state) -#define yy_last_accepting_cpos SCNG(_yy_last_accepting_cpos) -#define yy_more_flag SCNG(_yy_more_flag) -#define yy_more_len SCNG(_yy_more_len) - -#include -#include "zend.h" -#include "zend_globals.h" -#include -#include "zend_ini_scanner.h" - -#undef YYSTYPE -#define YYSTYPE zval - -#define YY_DECL int ini_lex(zval *ini_lval TSRMLS_DC) - -/* Globals Macros */ -#define SCNG INI_SCNG -#ifdef ZTS -ZEND_API ts_rsrc_id ini_scanner_globals_id; -#else -ZEND_API zend_scanner_globals ini_scanner_globals; -#endif - -# define YY_INPUT(buf, result, max_size) \ - if ( ((result = zend_stream_read(yyin, buf, max_size TSRMLS_CC)) == 0) \ - && zend_stream_ferror( yyin TSRMLS_CC) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); - -static char *ini_filename; - -void init_ini_scanner(TSRMLS_D) -{ - SCNG(lineno)=1; -} - -int zend_ini_scanner_get_lineno(TSRMLS_D) -{ - return SCNG(lineno); -} - -char *zend_ini_scanner_get_filename(TSRMLS_D) -{ - return ini_filename; -} - -int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC) -{ - if (FAILURE == zend_stream_fixup(fh TSRMLS_CC)) { - return FAILURE; - } - - init_ini_scanner(TSRMLS_C); - yyin = fh; - yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); - ini_filename = fh->filename; - return SUCCESS; -} - -int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC) -{ - int len = strlen(str); - - yyin = NULL; - yy_scan_buffer(str, len + 2 TSRMLS_CC); - ini_filename = NULL; - return SUCCESS; -} - -void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC) -{ - zend_stream_close(fh); -} - -%} - -NEWLINE ("\r"|"\n"|"\r\n") - -%option noyywrap -%option never-interactive - -%% - -[ ]*[\[][ ]*[\]][ ]* { - return BRACK; -} - -[ ]*("true"|"on"|"yes")[ ]* { - Z_STRVAL_P(ini_lval) = zend_strndup("1", 1); - Z_STRLEN_P(ini_lval) = 1; - Z_TYPE_P(ini_lval) = IS_STRING; - return CFG_TRUE; -} - - -[ ]*("false"|"off"|"no"|"none"|"null")[ ]* { - Z_STRVAL_P(ini_lval) = zend_strndup("", 0); - Z_STRLEN_P(ini_lval) = 0; - Z_TYPE_P(ini_lval) = IS_STRING; - return CFG_FALSE; -} - -[[][^\]\n]+[\]][ ]*{NEWLINE}? { - /* SECTION */ - - /* eat trailing ] and spaces */ - while (yyleng>0 && (yytext[yyleng-1]=='\n' || yytext[yyleng-1]=='\r' || yytext[yyleng-1]==']' || yytext[yyleng-1]==' ')) { - yyleng--; - yytext[yyleng]=0; - } - - SCNG(lineno)++; - - /* eat leading [ */ - yytext++; - yyleng--; - - Z_STRVAL_P(ini_lval) = zend_strndup(yytext, yyleng); - Z_STRLEN_P(ini_lval) = yyleng; - Z_TYPE_P(ini_lval) = IS_STRING; - return SECTION; -} - -["][^"]*["] { - char *p = yytext; - - /* ENCAPSULATED TC_STRING */ - - while ((p = strpbrk(p, "\r\n"))) { - if (*p == '\r' && *(p + 1) == '\n') { - p++; - } - SCNG(lineno)++; - p++; - } - - /* eat trailing " */ - yytext[yyleng-1]=0; - - /* eat leading " */ - yytext++; - - Z_STRVAL_P(ini_lval) = zend_strndup(yytext, yyleng - 2); - Z_STRLEN_P(ini_lval) = yyleng - 2; - Z_TYPE_P(ini_lval) = IS_STRING; - return TC_ENCAPSULATED_STRING; -} - -"${" { - return TC_DOLLAR_CURLY; -} - -"}" { - Z_LVAL_P(ini_lval) = (long) yytext[0]; - return yytext[0]; -} - -[&|~$(){}!] { - return yytext[0]; -} - -[^=\n\r\t;|&$~(){}!"\[]+ { - /* STRING */ - register int i; - - /* eat trailing whitespace */ - for (i=yyleng-1; i>=0; i--) { - if (yytext[i]==' ' || yytext[i]=='\t') { - yytext[i]=0; - yyleng--; - } else { - break; - } - } - /* eat leading whitespace */ - while (yytext[0]) { - if (yytext[0]==' ' || yytext[0]=='\t') { - yytext++; - yyleng--; - } else { - break; - } - } - if (yyleng!=0) { - Z_STRVAL_P(ini_lval) = zend_strndup(yytext, yyleng); - Z_STRLEN_P(ini_lval) = yyleng; - Z_TYPE_P(ini_lval) = IS_STRING; - return TC_STRING; - } else { - /* whitespace */ - } -} - -[=\n] { - if (yytext[0] == '\n') { - SCNG(lineno)++; - } - return yytext[0]; -} - -{NEWLINE} { - SCNG(lineno)++; - return '\n'; -} - -[;][^\r\n]*{NEWLINE}? { - /* comment */ - SCNG(lineno)++; - return '\n'; -} - -[ \t] { - /* eat whitespace */ -} - -. { -#if DEBUG - php_error(E_NOTICE,"Unexpected character on line %d: '%s' (ASCII %d)\n", yylineno, yytext, yytext[0]); -#endif -} - -<> { - yy_delete_buffer(YY_CURRENT_BUFFER TSRMLS_CC); - yyterminate(); -} diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c deleted file mode 100755 index 84e28c8bf98b0..0000000000000 --- a/Zend/zend_interfaces.c +++ /dev/null @@ -1,566 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_API.h" -#include "zend_interfaces.h" -#include "zend_exceptions.h" - -ZEND_API zend_class_entry *zend_ce_traversable; -ZEND_API zend_class_entry *zend_ce_aggregate; -ZEND_API zend_class_entry *zend_ce_iterator; -ZEND_API zend_class_entry *zend_ce_arrayaccess; -ZEND_API zend_class_entry *zend_ce_serializable; - -/* {{{ zend_call_method - Only returns the returned zval if retval_ptr != NULL */ -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC) -{ - int result; - zend_fcall_info fci; - zval z_fname; - zval *retval; - HashTable *function_table; - - zval **params[2]; - - params[0] = &arg1; - params[1] = &arg2; - - fci.size = sizeof(fci); - /*fci.function_table = NULL; will be read form zend_class_entry of object if needed */ - fci.object_pp = object_pp; - fci.function_name = &z_fname; - fci.retval_ptr_ptr = retval_ptr_ptr ? retval_ptr_ptr : &retval; - fci.param_count = param_count; - fci.params = params; - fci.no_separation = 1; - fci.symbol_table = NULL; - - if (!fn_proxy && !obj_ce) { - /* no interest in caching and no information already present that is - * needed later inside zend_call_function. */ - ZVAL_STRINGL(&z_fname, function_name, function_name_len, 0); - fci.function_table = !object_pp ? EG(function_table) : NULL; - result = zend_call_function(&fci, NULL TSRMLS_CC); - } else { - zend_fcall_info_cache fcic; - - fcic.initialized = 1; - if (!obj_ce) { - obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; - } - if (obj_ce) { - function_table = &obj_ce->function_table; - } else { - function_table = EG(function_table); - } - if (!fn_proxy || !*fn_proxy) { - if (zend_hash_find(function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) { - /* error at c-level */ - zend_error(E_CORE_ERROR, "Couldn't find implementation for method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name); - } - if (fn_proxy) { - *fn_proxy = fcic.function_handler; - } - } else { - fcic.function_handler = *fn_proxy; - } - fcic.calling_scope = obj_ce; - fcic.object_pp = object_pp; - result = zend_call_function(&fci, &fcic TSRMLS_CC); - } - if (result == FAILURE) { - /* error at c-level */ - if (!obj_ce) { - obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; - } - if (!EG(exception)) { - zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name); - } - } - if (!retval_ptr_ptr) { - if (retval) { - zval_ptr_dtor(&retval); - } - return NULL; - } - return *retval_ptr_ptr; -} -/* }}} */ - -/* iterator interface, c-level functions used by engine */ - -/* {{{ zend_user_it_new_iterator */ -ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - zval *retval; - - return zend_call_method_with_0_params(&object, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval); - -} -/* }}} */ - -/* {{{ zend_user_it_dtor */ -ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - - if (iter->value) { - zval_ptr_dtor(&iter->value); - iter->value = NULL; - } -} -/* }}} */ - -/* {{{ zend_user_it_dtor */ -static void zend_user_it_dtor(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zval_ptr_dtor(&object); - efree(iter); -} -/* }}} */ - -/* {{{ zend_user_it_valid */ -ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC) -{ - if (_iter) { - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - zval *more; - int result; - - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more); - if (more) { - result = i_zend_is_true(more); - zval_ptr_dtor(&more); - return result ? SUCCESS : FAILURE; - } - } - return FAILURE; -} -/* }}} */ - -/* {{{ zend_user_it_get_current_data */ -ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - if (!iter->value) { - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_current, "current", &iter->value); - } - *data = &iter->value; -} -/* }}} */ - -/* {{{ zend_user_it_get_current_key_default */ -#if 0 -static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - *int_key = _iter->index; - return HASH_KEY_IS_LONG; -} -#endif -/* }}} */ - -/* {{{ zend_user_it_get_current_key */ -ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - zval *retval; - - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval); - - if (!retval) { - *int_key = 0; - if (!EG(exception)) - { - zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name); - } - return HASH_KEY_IS_LONG; - } - switch (Z_TYPE_P(retval)) { - default: - zend_error(E_WARNING, "Illegal type returned from %s::key()", iter->ce->name); - case IS_NULL: - *int_key = 0; - zval_ptr_dtor(&retval); - return HASH_KEY_IS_LONG; - - case IS_STRING: - *str_key = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - *str_key_len = Z_STRLEN_P(retval)+1; - zval_ptr_dtor(&retval); - return HASH_KEY_IS_STRING; - - case IS_DOUBLE: - *int_key = (long)Z_DVAL_P(retval); - zval_ptr_dtor(&retval); - return HASH_KEY_IS_LONG; - - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - *int_key = (long)Z_LVAL_P(retval); - zval_ptr_dtor(&retval); - return HASH_KEY_IS_LONG; - } -} -/* }}} */ - -/* {{{ zend_user_it_move_forward */ -ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL); -} -/* }}} */ - -/* {{{ zend_user_it_rewind */ -ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL); -} -/* }}} */ - -zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = { - zend_user_it_dtor, - zend_user_it_valid, - zend_user_it_get_current_data, - zend_user_it_get_current_key, - zend_user_it_move_forward, - zend_user_it_rewind, - zend_user_it_invalidate_current -}; - -/* {{{ zend_user_it_get_iterator */ -static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) -{ - zend_user_iterator *iterator; - - if (by_ref) { - zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); - } - - iterator = emalloc(sizeof(zend_user_iterator)); - - object->refcount++; - iterator->it.data = (void*)object; - iterator->it.funcs = ce->iterator_funcs.funcs; - iterator->ce = Z_OBJCE_P(object); - iterator->value = NULL; - return (zend_object_iterator*)iterator; -} -/* }}} */ - -/* {{{ zend_user_it_get_new_iterator */ -ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) -{ - zval *iterator = zend_user_it_new_iterator(ce, object TSRMLS_CC); - zend_object_iterator *new_iterator; - - zend_class_entry *ce_it = iterator && Z_TYPE_P(iterator) == IS_OBJECT ? Z_OBJCE_P(iterator) : NULL; - - if (!ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && iterator == object)) { - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name : Z_OBJCE_P(object)->name); - } - if (iterator) { - zval_ptr_dtor(&iterator); - } - return NULL; - } - - new_iterator = ce_it->get_iterator(ce_it, iterator, by_ref TSRMLS_CC); - zval_ptr_dtor(&iterator); - return new_iterator; -} -/* }}} */ - -/* {{{ zend_implement_traversable */ -static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - /* check that class_type is traversable at c-level or implements at least one of 'aggregate' and 'Iterator' */ - zend_uint i; - - if (class_type->get_iterator || (class_type->parent && class_type->parent->get_iterator)) { - return SUCCESS; - } - for (i = 0; i < class_type->num_interfaces; i++) { - if (class_type->interfaces[i] == zend_ce_aggregate || class_type->interfaces[i] == zend_ce_iterator) { - return SUCCESS; - } - } - zend_error(E_CORE_ERROR, "Class %s must implement interface %s as part of either %s or %s", - class_type->name, - zend_ce_traversable->name, - zend_ce_iterator->name, - zend_ce_aggregate->name); - return FAILURE; -} -/* }}} */ - -/* {{{ zend_implement_aggregate */ -static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - int i, t = -1; - - if (class_type->get_iterator) { - if (class_type->type == ZEND_INTERNAL_CLASS) { - /* inheritance ensures the class has necessary userland methods */ - return SUCCESS; - } else if (class_type->get_iterator != zend_user_it_get_new_iterator) { - /* c-level get_iterator cannot be changed (exception being only Traversable is implmented) */ - if (class_type->num_interfaces) { - for (i = 0; i < class_type->num_interfaces; i++) { - if (class_type->interfaces[i] == zend_ce_iterator) { - return FAILURE; - } - if (class_type->interfaces[i] == zend_ce_traversable) { - t = i; - } - } - } - if (t == -1) { - return FAILURE; - } - } - } - class_type->iterator_funcs.zf_new_iterator = NULL; - class_type->get_iterator = zend_user_it_get_new_iterator; - return SUCCESS; -} -/* }}} */ - -/* {{{ zend_implement_iterator */ -static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - if (class_type->get_iterator && class_type->get_iterator != zend_user_it_get_iterator) { - if (class_type->type == ZEND_INTERNAL_CLASS) { - /* inheritance ensures the class has the necessary userland methods */ - return SUCCESS; - } else if (class_type->get_iterator != zend_user_it_get_new_iterator) { - /* c-level get_iterator cannot be changed */ - return FAILURE; - } - } - class_type->get_iterator = zend_user_it_get_iterator; - class_type->iterator_funcs.zf_valid = NULL; - class_type->iterator_funcs.zf_current = NULL; - class_type->iterator_funcs.zf_key = NULL; - class_type->iterator_funcs.zf_next = NULL; - class_type->iterator_funcs.zf_rewind = NULL; - if (!class_type->iterator_funcs.funcs) { - class_type->iterator_funcs.funcs = &zend_interface_iterator_funcs_iterator; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ zend_implement_arrayaccess */ -static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ -#if 0 - /* get ht from ce */ - if (ht->read_dimension != zend_std_read_dimension - || ht->write_dimension != zend_std_write_dimension - || ht->has_dimension != zend_std_has_dimension - || ht->unset_dimension != zend_std_unset_dimension) { - return FAILURE; - } -#endif - return SUCCESS; -} -/* }}}*/ - -/* {{{ zend_user_serialize */ -int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) -{ - zend_class_entry * ce = Z_OBJCE_P(object); - zval *retval; - int result; - - zend_call_method_with_0_params(&object, ce, &ce->serialize_func, "serialize", &retval); - - - if (!retval || EG(exception)) { - result = FAILURE; - } else { - switch(Z_TYPE_P(retval)) { - case IS_NULL: - /* we could also make this '*buf_len = 0' but this allows to skip variables */ - zval_ptr_dtor(&retval); - return FAILURE; - case IS_STRING: - *buffer = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - *buf_len = Z_STRLEN_P(retval); - result = SUCCESS; - break; - default: /* failure */ - result = FAILURE; - break; - } - zval_ptr_dtor(&retval); - } - - if (result == FAILURE) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%s::serialize() must return a string or NULL", ce->name); - } - return result; -} -/* }}} */ - -/* {{{ zend_user_unserialize */ -int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) -{ - zval * zdata; - - object_init_ex(*object, ce); - - MAKE_STD_ZVAL(zdata); - ZVAL_STRINGL(zdata, (char*)buf, buf_len, 1); - - zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, zdata); - - zval_ptr_dtor(&zdata); - - if (EG(exception)) { - return FAILURE; - } else { - return SUCCESS; - } -} -/* }}} */ - -/* {{{ zend_implement_serializable */ -static int zend_implement_serializable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - if ((class_type->serialize && class_type->serialize != zend_user_serialize) - || (class_type->unserialize && class_type->unserialize != zend_user_unserialize) - ) { - return FAILURE; - } - class_type->serialize = zend_user_serialize; - class_type->unserialize = zend_user_unserialize; - return SUCCESS; -} -/* }}}*/ - -/* {{{ function tables */ -zend_function_entry zend_funcs_aggregate[] = { - ZEND_ABSTRACT_ME(iterator, getIterator, NULL) - {NULL, NULL, NULL} -}; - -zend_function_entry zend_funcs_iterator[] = { - ZEND_ABSTRACT_ME(iterator, current, NULL) - ZEND_ABSTRACT_ME(iterator, next, NULL) - ZEND_ABSTRACT_ME(iterator, key, NULL) - ZEND_ABSTRACT_ME(iterator, valid, NULL) - ZEND_ABSTRACT_ME(iterator, rewind, NULL) - {NULL, NULL, NULL} -}; - -zend_function_entry *zend_funcs_traversable = NULL; - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset, 0, 0, 1) - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_get, 0, 0, 1) /* actually this should be return by ref but atm cannot be */ - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -zend_function_entry zend_funcs_arrayaccess[] = { - ZEND_ABSTRACT_ME(arrayaccess, offsetExists, arginfo_arrayaccess_offset) - ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset_get) - ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value) - ZEND_ABSTRACT_ME(arrayaccess, offsetUnset, arginfo_arrayaccess_offset) - {NULL, NULL, NULL} -}; - -static -ZEND_BEGIN_ARG_INFO(arginfo_serializable_serialize, 0) - ZEND_ARG_INFO(0, serialized) -ZEND_END_ARG_INFO() - -zend_function_entry zend_funcs_serializable[] = { - ZEND_ABSTRACT_ME(serializable, serialize, NULL) - ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR) - {NULL, NULL, NULL} -}; -/* }}} */ - -#define REGISTER_ITERATOR_INTERFACE(class_name, class_name_str) \ - {\ - zend_class_entry ce;\ - INIT_CLASS_ENTRY(ce, # class_name_str, zend_funcs_ ## class_name) \ - zend_ce_ ## class_name = zend_register_internal_interface(&ce TSRMLS_CC);\ - zend_ce_ ## class_name->interface_gets_implemented = zend_implement_ ## class_name;\ - } - -#define REGISTER_ITERATOR_IMPLEMENT(class_name, interface_name) \ - zend_class_implements(zend_ce_ ## class_name TSRMLS_CC, 1, zend_ce_ ## interface_name) - -/* {{{ zend_register_interfaces */ -ZEND_API void zend_register_interfaces(TSRMLS_D) -{ - REGISTER_ITERATOR_INTERFACE(traversable, Traversable); - - REGISTER_ITERATOR_INTERFACE(aggregate, IteratorAggregate); - REGISTER_ITERATOR_IMPLEMENT(aggregate, traversable); - - REGISTER_ITERATOR_INTERFACE(iterator, Iterator); - REGISTER_ITERATOR_IMPLEMENT(iterator, traversable); - - REGISTER_ITERATOR_INTERFACE(arrayaccess, ArrayAccess); - - REGISTER_ITERATOR_INTERFACE(serializable, Serializable) -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h deleted file mode 100755 index c498666d7a041..0000000000000 --- a/Zend/zend_interfaces.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_INTERFACES_H -#define ZEND_INTERFACES_H - -#include "zend.h" -#include "zend_API.h" - -BEGIN_EXTERN_C() - -extern ZEND_API zend_class_entry *zend_ce_traversable; -extern ZEND_API zend_class_entry *zend_ce_aggregate; -extern ZEND_API zend_class_entry *zend_ce_iterator; -extern ZEND_API zend_class_entry *zend_ce_arrayaccess; -extern ZEND_API zend_class_entry *zend_ce_serializable; - -typedef struct _zend_user_iterator { - zend_object_iterator it; - zend_class_entry *ce; - zval *value; -} zend_user_iterator; - -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC); - -#define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \ - zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL TSRMLS_CC) - -#define zend_call_method_with_1_params(obj, obj_ce, fn_proxy, function_name, retval, arg1) \ - zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 1, arg1, NULL TSRMLS_CC) - -#define zend_call_method_with_2_params(obj, obj_ce, fn_proxy, function_name, retval, arg1, arg2) \ - zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 2, arg1, arg2 TSRMLS_CC) - -ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC); -ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC); -ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC); -ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC); -ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC); -ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC); - -ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC); -ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); - -ZEND_API void zend_register_interfaces(TSRMLS_D); - -END_EXTERN_C() - -#endif /* ZEND_INTERFACES_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_istdiostream.h b/Zend/zend_istdiostream.h deleted file mode 100644 index f371e758587f1..0000000000000 --- a/Zend/zend_istdiostream.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _ZEND_STDIOSTREAM -#define _ZEND_STDIOSTREAM - -#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM) -class istdiostream : public istream -{ -private: - stdiobuf _file; -public: - istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); } - stdiobuf* rdbuf()/* const */ { return &_file; } -}; -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c deleted file mode 100755 index 0bea1f075843c..0000000000000 --- a/Zend/zend_iterators.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_API.h" - -static zend_class_entry zend_iterator_class_entry; - -static zend_object_handlers iterator_object_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - NULL, /* prop read */ - NULL, /* prop write */ - NULL, /* read dim */ - NULL, /* write dim */ - NULL, - NULL, /* get */ - NULL, /* set */ - NULL, /* has prop */ - NULL, /* unset prop */ - NULL, /* has dim */ - NULL, /* unset dim */ - NULL, /* props get */ - NULL, /* method get */ - NULL, /* call */ - NULL, /* get ctor */ - NULL, /* get_ce */ - NULL, /* get class name */ - NULL, /* compare */ - NULL, /* cast */ - NULL /* count */ -}; - -ZEND_API void zend_register_iterator_wrapper(TSRMLS_D) -{ - INIT_CLASS_ENTRY(zend_iterator_class_entry, "__iterator_wrapper", NULL); - free(zend_iterator_class_entry.name); - zend_iterator_class_entry.name = "__iterator_wrapper"; -} - -static void iter_wrapper_dtor(void *object, zend_object_handle handle TSRMLS_DC) -{ - zend_object_iterator *iter = (zend_object_iterator*)object; - iter->funcs->dtor(iter TSRMLS_CC); -} - -ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC) -{ - zval *wrapped; - - MAKE_STD_ZVAL(wrapped); - Z_TYPE_P(wrapped) = IS_OBJECT; - Z_OBJ_HANDLE_P(wrapped) = zend_objects_store_put(iter, iter_wrapper_dtor, NULL, NULL TSRMLS_CC); - Z_OBJ_HT_P(wrapped) = &iterator_object_handlers; - - return wrapped; -} - -ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap( - zval *array_ptr, zend_object_iterator **iter TSRMLS_DC) -{ - switch (Z_TYPE_P(array_ptr)) { - case IS_OBJECT: - if (Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) { - *iter = (zend_object_iterator *)zend_object_store_get_object(array_ptr TSRMLS_CC); - return ZEND_ITER_OBJECT; - } - if (HASH_OF(array_ptr)) { - return ZEND_ITER_PLAIN_OBJECT; - } - return ZEND_ITER_INVALID; - - case IS_ARRAY: - if (HASH_OF(array_ptr)) { - return ZEND_ITER_PLAIN_ARRAY; - } - return ZEND_ITER_INVALID; - - default: - return ZEND_ITER_INVALID; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h deleted file mode 100755 index 6db8d095df1e9..0000000000000 --- a/Zend/zend_iterators.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* These iterators were designed to operate within the foreach() - * structures provided by the engine, but could be extended for use - * with other iterative engine opcodes. - * These methods have similar semantics to the zend_hash API functions - * with similar names. - * */ - -typedef struct _zend_object_iterator zend_object_iterator; - -typedef struct _zend_object_iterator_funcs { - /* release all resources associated with this iterator instance */ - void (*dtor)(zend_object_iterator *iter TSRMLS_DC); - - /* check for end of iteration (FAILURE or SUCCESS if data is valid) */ - int (*valid)(zend_object_iterator *iter TSRMLS_DC); - - /* fetch the item data for the current element */ - void (*get_current_data)(zend_object_iterator *iter, zval ***data TSRMLS_DC); - - /* fetch the key for the current element (return HASH_KEY_IS_STRING or HASH_KEY_IS_LONG) (optional, may be NULL) */ - int (*get_current_key)(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC); - - /* step forwards to next element */ - void (*move_forward)(zend_object_iterator *iter TSRMLS_DC); - - /* rewind to start of data (optional, may be NULL) */ - void (*rewind)(zend_object_iterator *iter TSRMLS_DC); - - /* invalidate current value/key (optional, may be NULL) */ - void (*invalidate_current)(zend_object_iterator *iter TSRMLS_DC); -} zend_object_iterator_funcs; - -struct _zend_object_iterator { - void *data; - zend_object_iterator_funcs *funcs; - ulong index; /* private to fe_reset/fe_fetch opcodes */ -}; - -typedef struct _zend_class_iterator_funcs { - zend_object_iterator_funcs *funcs; - union _zend_function *zf_new_iterator; - union _zend_function *zf_valid; - union _zend_function *zf_current; - union _zend_function *zf_key; - union _zend_function *zf_next; - union _zend_function *zf_rewind; -} zend_class_iterator_funcs; - -enum zend_object_iterator_kind { - ZEND_ITER_INVALID, - ZEND_ITER_PLAIN_ARRAY, - ZEND_ITER_PLAIN_OBJECT, - ZEND_ITER_OBJECT -}; - -BEGIN_EXTERN_C() -/* given a zval, returns stuff that can be used to iterate it. */ -ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(zval *array_ptr, zend_object_iterator **iter TSRMLS_DC); - -/* given an iterator, wrap it up as a zval for use by the engine opcodes */ -ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC); - -ZEND_API void zend_register_iterator_wrapper(TSRMLS_D); -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y deleted file mode 100644 index 6e26796e44537..0000000000000 --- a/Zend/zend_language_parser.y +++ /dev/null @@ -1,920 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - * LALR shift/reduce conflicts and how they are resolved: - * - * - 2 shift/reduce conflicts due to the dangeling elseif/else ambiguity. Solved by shift. - * - */ - - -#include "zend_compile.h" -#include "zend.h" -#include "zend_list.h" -#include "zend_globals.h" -#include "zend_API.h" -#include "zend_constants.h" - - -#define YYERROR_VERBOSE -#define YYSTYPE znode -#ifdef ZTS -# define YYPARSE_PARAM tsrm_ls -# define YYLEX_PARAM tsrm_ls -#endif - - -%} - -%pure_parser -%expect 2 - -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL -%left '?' ':' -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left '&' -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' -%nonassoc T_INSTANCEOF -%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right '[' -%nonassoc T_NEW T_CLONE -%token T_EXIT -%token T_IF -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_CHARACTER -%token T_BAD_CHARACTER -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_FUNCTION -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_THROW -%token T_USE -%token T_GLOBAL -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_HALT_COMPILER -%token T_CLASS -%token T_INTERFACE -%token T_EXTENDS -%token T_IMPLEMENTS -%token T_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_CLASS_C -%token T_METHOD_C -%token T_FUNC_C -%token T_LINE -%token T_FILE -%token T_COMMENT -%token T_DOC_COMMENT -%token T_OPEN_TAG -%token T_OPEN_TAG_WITH_ECHO -%token T_CLOSE_TAG -%token T_WHITESPACE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM - -%% /* Rules */ - -start: - top_statement_list -; - -top_statement_list: - top_statement_list { zend_do_extended_info(TSRMLS_C); } top_statement { HANDLE_INTERACTIVE(); } - | /* empty */ -; - - -top_statement: - statement - | function_declaration_statement { zend_do_early_binding(TSRMLS_C); } - | class_declaration_statement { zend_do_early_binding(TSRMLS_C); } - | T_HALT_COMPILER '(' ')' ';' { zend_do_halt_compiler_register(TSRMLS_C); YYACCEPT; } -; - - -inner_statement_list: - inner_statement_list { zend_do_extended_info(TSRMLS_C); } inner_statement { HANDLE_INTERACTIVE(); } - | /* empty */ -; - - -inner_statement: - statement - | function_declaration_statement - | class_declaration_statement - | T_HALT_COMPILER '(' ')' ';' { zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); } -; - - -statement: - unticked_statement { zend_do_ticks(TSRMLS_C); } -; - -unticked_statement: - '{' inner_statement_list '}' - | T_IF '(' expr ')' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } statement { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } elseif_list else_single { zend_do_if_end(TSRMLS_C); } - | T_IF '(' expr ')' ':' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } inner_statement_list { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { zend_do_if_end(TSRMLS_C); } - | T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { zend_do_while_cond(&$4, &$5 TSRMLS_CC); } while_statement { zend_do_while_end(&$1, &$5 TSRMLS_CC); } - | T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_do_while_begin(TSRMLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { zend_do_do_while_end(&$1, &$5, &$7 TSRMLS_CC); } - | T_FOR - '(' - for_expr - ';' { zend_do_free(&$3 TSRMLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); } - for_expr - ';' { zend_do_extended_info(TSRMLS_C); zend_do_for_cond(&$6, &$7 TSRMLS_CC); } - for_expr - ')' { zend_do_free(&$9 TSRMLS_CC); zend_do_for_before_statement(&$4, &$7 TSRMLS_CC); } - for_statement { zend_do_for_end(&$7 TSRMLS_CC); } - | T_SWITCH '(' expr ')' { zend_do_switch_cond(&$3 TSRMLS_CC); } switch_case_list { zend_do_switch_end(&$6 TSRMLS_CC); } - | T_BREAK ';' { zend_do_brk_cont(ZEND_BRK, NULL TSRMLS_CC); } - | T_BREAK expr ';' { zend_do_brk_cont(ZEND_BRK, &$2 TSRMLS_CC); } - | T_CONTINUE ';' { zend_do_brk_cont(ZEND_CONT, NULL TSRMLS_CC); } - | T_CONTINUE expr ';' { zend_do_brk_cont(ZEND_CONT, &$2 TSRMLS_CC); } - | T_RETURN ';' { zend_do_return(NULL, 0 TSRMLS_CC); } - | T_RETURN expr_without_variable ';' { zend_do_return(&$2, 0 TSRMLS_CC); } - | T_RETURN variable ';' { zend_do_return(&$2, 1 TSRMLS_CC); } - | T_GLOBAL global_var_list ';' - | T_STATIC static_var_list ';' - | T_ECHO echo_expr_list ';' - | T_INLINE_HTML { zend_do_echo(&$1 TSRMLS_CC); } - | expr ';' { zend_do_free(&$1 TSRMLS_CC); } - | T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); } - | T_UNSET '(' unset_variables ')' ';' - | T_FOREACH '(' variable T_AS - { zend_do_foreach_begin(&$1, &$2, &$3, &$4, 1 TSRMLS_CC); } - foreach_variable foreach_optional_arg ')' { zend_do_foreach_cont(&$1, &$2, &$4, &$6, &$7 TSRMLS_CC); } - foreach_statement { zend_do_foreach_end(&$1, &$4 TSRMLS_CC); } - | T_FOREACH '(' expr_without_variable T_AS - { zend_do_foreach_begin(&$1, &$2, &$3, &$4, 0 TSRMLS_CC); } - variable foreach_optional_arg ')' { zend_check_writable_variable(&$6); zend_do_foreach_cont(&$1, &$2, &$4, &$6, &$7 TSRMLS_CC); } - foreach_statement { zend_do_foreach_end(&$1, &$4 TSRMLS_CC); } - | T_DECLARE { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(&$1 TSRMLS_CC); } - | ';' /* empty statement */ - | T_TRY { zend_do_try(&$1 TSRMLS_CC); } '{' inner_statement_list '}' - T_CATCH '(' { zend_initialize_try_catch_element(&$1 TSRMLS_CC); } - fully_qualified_class_name { zend_do_first_catch(&$7 TSRMLS_CC); } - T_VARIABLE ')' { zend_do_begin_catch(&$1, &$9, &$11, 1 TSRMLS_CC); } - '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } - additional_catches { zend_do_mark_last_catch(&$7, &$18 TSRMLS_CC); } - | T_THROW expr ';' { zend_do_throw(&$2 TSRMLS_CC); } -; - - -additional_catches: - non_empty_additional_catches { $$ = $1; } - | /* empty */ { $$.u.opline_num = -1; } -; - -non_empty_additional_catches: - additional_catch { $$ = $1; } - | non_empty_additional_catches additional_catch { $$ = $2; } -; - - -additional_catch: - T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } -; - - -unset_variables: - unset_variable - | unset_variables ',' unset_variable -; - -unset_variable: - variable { zend_do_end_variable_parse(BP_VAR_UNSET, 0 TSRMLS_CC); zend_do_unset(&$1 TSRMLS_CC); } -; - -use_filename: - T_CONSTANT_ENCAPSED_STRING { $$ = $1; } - | '(' T_CONSTANT_ENCAPSED_STRING ')' { $$ = $2; } -; - - -function_declaration_statement: - unticked_function_declaration_statement { zend_do_ticks(TSRMLS_C); } -; - -class_declaration_statement: - unticked_class_declaration_statement { zend_do_ticks(TSRMLS_C); } -; - - -is_reference: - /* empty */ { $$.op_type = ZEND_RETURN_VAL; } - | '&' { $$.op_type = ZEND_RETURN_REF; } -; - - -unticked_function_declaration_statement: - T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 0, $3.op_type, NULL TSRMLS_CC); } - '(' parameter_list ')' '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 TSRMLS_CC); } -; - -unticked_class_declaration_statement: - class_entry_type T_STRING extends_from - { zend_do_begin_class_declaration(&$1, &$2, &$3 TSRMLS_CC); } - implements_list - '{' - class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } - | interface_entry T_STRING - { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); } - interface_extends_list - '{' - class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } -; - - -class_entry_type: - T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = 0; } - | T_ABSTRACT T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; } - | T_FINAL T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_FINAL_CLASS; } -; - -extends_from: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_EXTENDS fully_qualified_class_name { $$ = $2; } -; - -interface_entry: - T_INTERFACE { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_INTERFACE; } -; - -interface_extends_list: - /* empty */ - | T_EXTENDS interface_list -; - -implements_list: - /* empty */ - | T_IMPLEMENTS interface_list -; - -interface_list: - fully_qualified_class_name { zend_do_implements_interface(&$1 TSRMLS_CC); } - | interface_list ',' fully_qualified_class_name { zend_do_implements_interface(&$3 TSRMLS_CC); } -; - -foreach_optional_arg: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_DOUBLE_ARROW foreach_variable { $$ = $2; } -; - - -foreach_variable: - variable { zend_check_writable_variable(&$1); $$ = $1; } - | '&' variable { zend_check_writable_variable(&$2); $$ = $2; $$.u.EA.type |= ZEND_PARSED_REFERENCE_VARIABLE; } -; - -for_statement: - statement - | ':' inner_statement_list T_ENDFOR ';' -; - - -foreach_statement: - statement - | ':' inner_statement_list T_ENDFOREACH ';' -; - - -declare_statement: - statement - | ':' inner_statement_list T_ENDDECLARE ';' -; - - -declare_list: - T_STRING '=' static_scalar { zend_do_declare_stmt(&$1, &$3 TSRMLS_CC); } - | declare_list ',' T_STRING '=' static_scalar { zend_do_declare_stmt(&$3, &$5 TSRMLS_CC); } -; - - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - - -case_list: - /* empty */ { $$.op_type = IS_UNUSED; } - | case_list T_CASE expr case_separator { zend_do_extended_info(TSRMLS_C); zend_do_case_before_statement(&$1, &$2, &$3 TSRMLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 TSRMLS_CC); $$.op_type = IS_CONST; } - | case_list T_DEFAULT case_separator { zend_do_extended_info(TSRMLS_C); zend_do_default_before_statement(&$1, &$2 TSRMLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 TSRMLS_CC); $$.op_type = IS_CONST; } -; - - -case_separator: - ':' - | ';' -; - - -while_statement: - statement - | ':' inner_statement_list T_ENDWHILE ';' -; - - - -elseif_list: - /* empty */ - | elseif_list T_ELSEIF '(' expr ')' { zend_do_if_cond(&$4, &$5 TSRMLS_CC); } statement { zend_do_if_after_statement(&$5, 0 TSRMLS_CC); } -; - - -new_elseif_list: - /* empty */ - | new_elseif_list T_ELSEIF '(' expr ')' ':' { zend_do_if_cond(&$4, &$5 TSRMLS_CC); } inner_statement_list { zend_do_if_after_statement(&$5, 0 TSRMLS_CC); } -; - - -else_single: - /* empty */ - | T_ELSE statement -; - - -new_else_single: - /* empty */ - | T_ELSE ':' inner_statement_list -; - - -parameter_list: - non_empty_parameter_list - | /* empty */ -; - - -non_empty_parameter_list: - optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$2, 0 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$3, 1 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, &$1, &$3, 1 TSRMLS_CC); } - | optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$4, &$1, &$2, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$4, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$5, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$7, &$3, &$5, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$6, &$3, &$4, 0 TSRMLS_CC); } -; - - -optional_class_type: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_STRING { $$ = $1; } - | T_ARRAY { $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_NULL;} -; - - -function_call_parameter_list: - non_empty_function_call_parameter_list { $$ = $1; } - | /* empty */ { Z_LVAL($$.u.constant) = 0; } -; - - -non_empty_function_call_parameter_list: - expr_without_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); } - | variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); } - | '&' w_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' expr_without_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' '&' w_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$4, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); } -; - -global_var_list: - global_var_list ',' global_var { zend_do_fetch_global_variable(&$3, NULL, ZEND_FETCH_GLOBAL_LOCK TSRMLS_CC); } - | global_var { zend_do_fetch_global_variable(&$1, NULL, ZEND_FETCH_GLOBAL_LOCK TSRMLS_CC); } -; - - -global_var: - T_VARIABLE { $$ = $1; } - | '$' r_variable { $$ = $2; } - | '$' '{' expr '}' { $$ = $3; } -; - - -static_var_list: - static_var_list ',' T_VARIABLE { zend_do_fetch_static_variable(&$3, NULL, ZEND_FETCH_STATIC TSRMLS_CC); } - | static_var_list ',' T_VARIABLE '=' static_scalar { zend_do_fetch_static_variable(&$3, &$5, ZEND_FETCH_STATIC TSRMLS_CC); } - | T_VARIABLE { zend_do_fetch_static_variable(&$1, NULL, ZEND_FETCH_STATIC TSRMLS_CC); } - | T_VARIABLE '=' static_scalar { zend_do_fetch_static_variable(&$1, &$3, ZEND_FETCH_STATIC TSRMLS_CC); } - -; - - -class_statement_list: - class_statement_list class_statement - | /* empty */ -; - - -class_statement: - variable_modifiers { CG(access_type) = Z_LVAL($1.u.constant); } class_variable_declaration ';' - | class_constant_declaration ';' - | method_modifiers T_FUNCTION { $2.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$5, 1, $4.op_type, &$1 TSRMLS_CC); } '(' - parameter_list ')' method_body { zend_do_abstract_method(&$5, &$1, &$10 TSRMLS_CC); zend_do_end_function_declaration(&$2 TSRMLS_CC); } -; - - -method_body: - ';' /* abstract method */ { Z_LVAL($$.u.constant) = ZEND_ACC_ABSTRACT; } - | '{' inner_statement_list '}' { Z_LVAL($$.u.constant) = 0; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; } -; - -method_modifiers: - /* empty */ { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; } - | non_empty_member_modifiers { $$ = $1; if (!(Z_LVAL($$.u.constant) & ZEND_ACC_PPP_MASK)) { Z_LVAL($$.u.constant) |= ZEND_ACC_PUBLIC; } } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { Z_LVAL($$.u.constant) = zend_do_verify_access_types(&$1, &$2); } -; - -member_modifier: - T_PUBLIC { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; } - | T_PROTECTED { Z_LVAL($$.u.constant) = ZEND_ACC_PROTECTED; } - | T_PRIVATE { Z_LVAL($$.u.constant) = ZEND_ACC_PRIVATE; } - | T_STATIC { Z_LVAL($$.u.constant) = ZEND_ACC_STATIC; } - | T_ABSTRACT { Z_LVAL($$.u.constant) = ZEND_ACC_ABSTRACT; } - | T_FINAL { Z_LVAL($$.u.constant) = ZEND_ACC_FINAL; } -; - -class_variable_declaration: - class_variable_declaration ',' T_VARIABLE { zend_do_declare_property(&$3, NULL, CG(access_type) TSRMLS_CC); } - | class_variable_declaration ',' T_VARIABLE '=' static_scalar { zend_do_declare_property(&$3, &$5, CG(access_type) TSRMLS_CC); } - | T_VARIABLE { zend_do_declare_property(&$1, NULL, CG(access_type) TSRMLS_CC); } - | T_VARIABLE '=' static_scalar { zend_do_declare_property(&$1, &$3, CG(access_type) TSRMLS_CC); } -; - -class_constant_declaration: - class_constant_declaration ',' T_STRING '=' static_scalar { zend_do_declare_class_constant(&$3, &$5 TSRMLS_CC); } - | T_CONST T_STRING '=' static_scalar { zend_do_declare_class_constant(&$2, &$4 TSRMLS_CC); } -; - -echo_expr_list: - echo_expr_list ',' expr { zend_do_echo(&$3 TSRMLS_CC); } - | expr { zend_do_echo(&$1 TSRMLS_CC); } -; - - -for_expr: - /* empty */ { $$.op_type = IS_CONST; Z_TYPE($$.u.constant) = IS_BOOL; Z_LVAL($$.u.constant) = 1; } - | non_empty_for_expr { $$ = $1; } -; - -non_empty_for_expr: - non_empty_for_expr ',' { zend_do_free(&$1 TSRMLS_CC); } expr { $$ = $4; } - | expr { $$ = $1; } -; - -expr_without_variable: - T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); } - | variable '=' expr { zend_check_writable_variable(&$1); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); } - | variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); } - | variable '=' '&' T_NEW class_name_reference { zend_error(E_STRICT, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); $3.u.EA.type = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); } - | T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); } - | variable T_PLUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_MINUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_MUL_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_DIV_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_CONCAT_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_MOD_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_AND_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_OR_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_XOR_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_SL_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_SR_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 TSRMLS_CC); } - | rw_variable T_INC { zend_do_post_incdec(&$$, &$1, ZEND_POST_INC TSRMLS_CC); } - | T_INC rw_variable { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_INC TSRMLS_CC); } - | rw_variable T_DEC { zend_do_post_incdec(&$$, &$1, ZEND_POST_DEC TSRMLS_CC); } - | T_DEC rw_variable { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_DEC TSRMLS_CC); } - | expr T_BOOLEAN_OR { zend_do_boolean_or_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_BOOLEAN_AND { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_OR { zend_do_boolean_or_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_AND { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_XOR expr { zend_do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '|' expr { zend_do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '&' expr { zend_do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 TSRMLS_CC); } - | expr '^' expr { zend_do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '.' expr { zend_do_binary_op(ZEND_CONCAT, &$$, &$1, &$3 TSRMLS_CC); } - | expr '+' expr { zend_do_binary_op(ZEND_ADD, &$$, &$1, &$3 TSRMLS_CC); } - | expr '-' expr { zend_do_binary_op(ZEND_SUB, &$$, &$1, &$3 TSRMLS_CC); } - | expr '*' expr { zend_do_binary_op(ZEND_MUL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '/' expr { zend_do_binary_op(ZEND_DIV, &$$, &$1, &$3 TSRMLS_CC); } - | expr '%' expr { zend_do_binary_op(ZEND_MOD, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_SR expr { zend_do_binary_op(ZEND_SR, &$$, &$1, &$3 TSRMLS_CC); } - | '+' expr %prec T_INC { Z_LVAL($1.u.constant)=0; Z_TYPE($1.u.constant)=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); } - | '-' expr %prec T_INC { Z_LVAL($1.u.constant)=0; Z_TYPE($1.u.constant)=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 TSRMLS_CC); } - | '!' expr { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$2 TSRMLS_CC); } - | '~' expr { zend_do_unary_op(ZEND_BW_NOT, &$$, &$2 TSRMLS_CC); } - | expr T_IS_IDENTICAL expr { zend_do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_NOT_IDENTICAL expr { zend_do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_EQUAL expr { zend_do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_NOT_EQUAL expr { zend_do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '<' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_SMALLER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '>' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 TSRMLS_CC); } - | expr T_IS_GREATER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 TSRMLS_CC); } - | expr T_INSTANCEOF class_name_reference { zend_do_instanceof(&$$, &$1, &$3, 0 TSRMLS_CC); } - | '(' expr ')' { $$ = $2; } - | expr '?' { zend_do_begin_qm_op(&$1, &$2 TSRMLS_CC); } - expr ':' { zend_do_qm_true(&$4, &$2, &$5 TSRMLS_CC); } - expr { zend_do_qm_false(&$$, &$7, &$2, &$5 TSRMLS_CC); } - | internal_functions_in_yacc { $$ = $1; } - | T_INT_CAST expr { zend_do_cast(&$$, &$2, IS_LONG TSRMLS_CC); } - | T_DOUBLE_CAST expr { zend_do_cast(&$$, &$2, IS_DOUBLE TSRMLS_CC); } - | T_STRING_CAST expr { zend_do_cast(&$$, &$2, IS_STRING TSRMLS_CC); } - | T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY TSRMLS_CC); } - | T_OBJECT_CAST expr { zend_do_cast(&$$, &$2, IS_OBJECT TSRMLS_CC); } - | T_BOOL_CAST expr { zend_do_cast(&$$, &$2, IS_BOOL TSRMLS_CC); } - | T_UNSET_CAST expr { zend_do_cast(&$$, &$2, IS_NULL TSRMLS_CC); } - | T_EXIT exit_expr { zend_do_exit(&$$, &$2 TSRMLS_CC); } - | '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; } - | scalar { $$ = $1; } - | T_ARRAY '(' array_pair_list ')' { $$ = $3; } - | '`' encaps_list '`' { zend_do_shell_exec(&$$, &$2 TSRMLS_CC); } - | T_PRINT expr { zend_do_print(&$$, &$2 TSRMLS_CC); } -; - -function_call: - T_STRING '(' { $2.u.opline_num = zend_do_begin_function_call(&$1 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); } - | fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(NULL, &$$, &$6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(NULL, &$$, &$6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_dynamic_function_call(&$1 TSRMLS_CC); } - function_call_parameter_list ')' - { zend_do_end_function_call(&$1, &$$, &$4, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} -; - -fully_qualified_class_name: - T_STRING { zend_do_fetch_class(&$$, &$1 TSRMLS_CC); } -; - -class_name_reference: - T_STRING { zend_do_fetch_class(&$$, &$1 TSRMLS_CC); } - | dynamic_class_name_reference { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_fetch_class(&$$, &$1 TSRMLS_CC); } -; - - -dynamic_class_name_reference: - base_variable T_OBJECT_OPERATOR { zend_do_push_object(&$1 TSRMLS_CC); } - object_property { zend_do_push_object(&$4 TSRMLS_CC); zend_do_declare_implicit_property(TSRMLS_C); } dynamic_class_name_variable_properties - { zend_do_pop_object(&$$ TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_MEMBER; } - | base_variable { $$ = $1; } -; - - -dynamic_class_name_variable_properties: - dynamic_class_name_variable_properties dynamic_class_name_variable_property - | /* empty */ -; - - -dynamic_class_name_variable_property: - T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); zend_do_declare_implicit_property(TSRMLS_C); } -; - -exit_expr: - /* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; } - | '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; } - | '(' expr ')' { $$ = $2; } -; - - -ctor_arguments: - /* empty */ { Z_LVAL($$.u.constant)=0; } - | '(' function_call_parameter_list ')' { $$ = $2; } -; - - -common_scalar: - T_LNUMBER { $$ = $1; } - | T_DNUMBER { $$ = $1; } - | T_CONSTANT_ENCAPSED_STRING { $$ = $1; } - | T_LINE { $$ = $1; } - | T_FILE { $$ = $1; } - | T_CLASS_C { $$ = $1; } - | T_METHOD_C { $$ = $1; } - | T_FUNC_C { $$ = $1; } -; - - -static_scalar: /* compile-time evaluated scalars */ - common_scalar { $$ = $1; } - | T_STRING { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT TSRMLS_CC); } - | '+' static_scalar { $$ = $2; } - | '-' static_scalar { zval minus_one; Z_TYPE(minus_one) = IS_LONG; Z_LVAL(minus_one) = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; } - | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; } - | static_class_constant { $$ = $1; } -; - -static_class_constant: - T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant(&$$, &$1, &$3, ZEND_CT TSRMLS_CC); } -; - -scalar: - T_STRING { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT TSRMLS_CC); } - | T_STRING_VARNAME { $$ = $1; } - | class_constant { $$ = $1; } - | common_scalar { $$ = $1; } - | '"' encaps_list '"' { $$ = $2; } - | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; } -; - - -static_array_pair_list: - /* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); } - | non_empty_static_array_pair_list possible_comma { $$ = $1; } -; - -possible_comma: - /* empty */ - | ',' -; - -non_empty_static_array_pair_list: - non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); } - | non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); } - | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); } - | static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); } -; - -expr: - r_variable { $$ = $1; } - | expr_without_variable { $$ = $1; } -; - - -r_variable: - variable { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); $$ = $1; } -; - - -w_variable: - variable { zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); $$ = $1; - zend_check_writable_variable(&$1); } -; - -rw_variable: - variable { zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); $$ = $1; - zend_check_writable_variable(&$1); } -; - -variable: - base_variable_with_function_calls T_OBJECT_OPERATOR { zend_do_push_object(&$1 TSRMLS_CC); } - object_property { zend_do_push_object(&$4 TSRMLS_CC); } method_or_not variable_properties - { zend_do_pop_object(&$$ TSRMLS_CC); $$.u.EA.type = $1.u.EA.type | ($7.u.EA.type ? $7.u.EA.type : $6.u.EA.type); } - | base_variable_with_function_calls { $$ = $1; } -; - -variable_properties: - variable_properties variable_property { $$.u.EA.type = $2.u.EA.type; } - | /* empty */ { $$.u.EA.type = 0; } -; - - -variable_property: - T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); } method_or_not { $$.u.EA.type = $4.u.EA.type; } -; - -method_or_not: - '(' { zend_do_pop_object(&$1 TSRMLS_CC); zend_do_begin_method_call(&$1 TSRMLS_CC); } - function_call_parameter_list ')' - { zend_do_end_function_call(&$1, &$$, &$3, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); - zend_do_push_object(&$$ TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_METHOD_CALL; } - | /* empty */ { zend_do_declare_implicit_property(TSRMLS_C); $$.u.EA.type = ZEND_PARSED_MEMBER; } -; - -variable_without_objects: - reference_variable { $$ = $1; } - | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); } -; - -static_member: - fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = $3; zend_do_fetch_static_member(&$$, &$1 TSRMLS_CC); } -; - - -base_variable_with_function_calls: - base_variable { $$ = $1; } - | function_call { zend_do_begin_variable_parse(TSRMLS_C); $$ = $1; $$.u.EA.type = ZEND_PARSED_FUNCTION_CALL; } -; - - -base_variable: - reference_variable { $$ = $1; $$.u.EA.type = ZEND_PARSED_VARIABLE; } - | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_VARIABLE; } - | static_member { $$ = $1; $$.u.EA.type = ZEND_PARSED_STATIC_MEMBER; } -; - -reference_variable: - reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); } - | reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 TSRMLS_CC); } - | compound_variable { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } -; - - -compound_variable: - T_VARIABLE { $$ = $1; } - | '$' '{' expr '}' { $$ = $3; } -; - -dim_offset: - /* empty */ { $$.op_type = IS_UNUSED; } - | expr { $$ = $1; } -; - - -object_property: - object_dim_list { $$ = $1; } - | variable_without_objects { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); } { znode tmp_znode; zend_do_pop_object(&tmp_znode TSRMLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 TSRMLS_CC);} -; - -object_dim_list: - object_dim_list '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); } - | object_dim_list '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 TSRMLS_CC); } - | variable_name { znode tmp_znode; zend_do_pop_object(&tmp_znode TSRMLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 TSRMLS_CC);} -; - -variable_name: - T_STRING { $$ = $1; } - | '{' expr '}' { $$ = $2; } -; - -simple_indirect_reference: - '$' { Z_LVAL($$.u.constant) = 1; } - | simple_indirect_reference '$' { Z_LVAL($$.u.constant)++; } -; - -assignment_list: - assignment_list ',' assignment_list_element - | assignment_list_element -; - - -assignment_list_element: - variable { zend_do_add_list_element(&$1 TSRMLS_CC); } - | T_LIST '(' { zend_do_new_list_begin(TSRMLS_C); } assignment_list ')' { zend_do_new_list_end(TSRMLS_C); } - | /* empty */ { zend_do_add_list_element(NULL TSRMLS_CC); } -; - - -array_pair_list: - /* empty */ { zend_do_init_array(&$$, NULL, NULL, 0 TSRMLS_CC); } - | non_empty_array_pair_list possible_comma { $$ = $1; } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { zend_do_add_array_element(&$$, &$5, &$3, 0 TSRMLS_CC); } - | non_empty_array_pair_list ',' expr { zend_do_add_array_element(&$$, &$3, NULL, 0 TSRMLS_CC); } - | expr T_DOUBLE_ARROW expr { zend_do_init_array(&$$, &$3, &$1, 0 TSRMLS_CC); } - | expr { zend_do_init_array(&$$, &$1, NULL, 0 TSRMLS_CC); } - | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { zend_do_add_array_element(&$$, &$6, &$3, 1 TSRMLS_CC); } - | non_empty_array_pair_list ',' '&' w_variable { zend_do_add_array_element(&$$, &$4, NULL, 1 TSRMLS_CC); } - | expr T_DOUBLE_ARROW '&' w_variable { zend_do_init_array(&$$, &$4, &$1, 1 TSRMLS_CC); } - | '&' w_variable { zend_do_init_array(&$$, &$2, NULL, 1 TSRMLS_CC); } -; - -encaps_list: - encaps_list encaps_var { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_add_variable(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_ENCAPSED_AND_WHITESPACE { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | /* empty */ { zend_do_init_string(&$$ TSRMLS_CC); } - -; - - - -encaps_var: - T_VARIABLE { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } - | T_VARIABLE '[' { zend_do_begin_variable_parse(TSRMLS_C); } encaps_var_offset ']' { fetch_array_begin(&$$, &$1, &$4 TSRMLS_CC); } - | T_VARIABLE T_OBJECT_OPERATOR T_STRING { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$2, &$1, 1 TSRMLS_CC); zend_do_fetch_property(&$$, &$2, &$3 TSRMLS_CC); } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$2, 1 TSRMLS_CC); } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_begin(&$$, &$2, &$4 TSRMLS_CC); } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - - -encaps_var_offset: - T_STRING { $$ = $1; } - | T_NUM_STRING { $$ = $1; } - | T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } -; - - -internal_functions_in_yacc: - T_ISSET '(' isset_variables ')' { $$ = $3; } - | T_EMPTY '(' variable ')' { zend_do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 TSRMLS_CC); } - | T_INCLUDE expr { zend_do_include_or_eval(ZEND_INCLUDE, &$$, &$2 TSRMLS_CC); } - | T_INCLUDE_ONCE expr { zend_do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 TSRMLS_CC); } - | T_EVAL '(' expr ')' { zend_do_include_or_eval(ZEND_EVAL, &$$, &$3 TSRMLS_CC); } - | T_REQUIRE expr { zend_do_include_or_eval(ZEND_REQUIRE, &$$, &$2 TSRMLS_CC); } - | T_REQUIRE_ONCE expr { zend_do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 TSRMLS_CC); } -; - -isset_variables: - variable { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); } - | isset_variables ',' { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } variable { znode tmp; zend_do_isset_or_isempty(ZEND_ISSET, &tmp, &$4 TSRMLS_CC); zend_do_boolean_and_end(&$$, &$1, &tmp, &$2 TSRMLS_CC); } -; - -class_constant: - fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant(&$$, &$1, &$3, ZEND_RT TSRMLS_CC); } -; - -%% - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h deleted file mode 100644 index 87d0c2a055e83..0000000000000 --- a/Zend/zend_language_scanner.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_SCANNER_H -#define ZEND_SCANNER_H - -typedef struct _zend_lex_state { - YY_BUFFER_STATE buffer_state; - int state; - zend_file_handle *in; - uint lineno; - char *filename; - -#ifdef ZEND_MULTIBYTE - /* original (unfiltered) script */ - char *script_org; - int script_org_size; - - /* filtered script */ - char *script_filtered; - int script_filtered_size; - - /* input/ouput filters */ - zend_encoding_filter input_filter; - zend_encoding_filter output_filter; - zend_encoding *script_encoding; - zend_encoding *internal_encoding; -#endif /* ZEND_MULTIBYTE */ -} zend_lex_state; - - -void zend_fatal_scanner_error(char *); -BEGIN_EXTERN_C() -int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2); -ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC); -ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC); -ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC); - -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l deleted file mode 100644 index 47d1165b813a2..0000000000000 --- a/Zend/zend_language_scanner.l +++ /dev/null @@ -1,2043 +0,0 @@ -%{ - -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define yyleng SCNG(yy_leng) -#define yytext SCNG(yy_text) -#define yytext_ptr SCNG(yy_text) -#define yyin SCNG(yy_in) -#define yyout SCNG(yy_out) -#define yy_last_accepting_state SCNG(_yy_last_accepting_state) -#define yy_last_accepting_cpos SCNG(_yy_last_accepting_cpos) -#define yy_more_flag SCNG(_yy_more_flag) -#define yy_more_len SCNG(_yy_more_len) - -%} - -%x ST_IN_SCRIPTING -%x ST_DOUBLE_QUOTES -%x ST_BACKQUOTE -%x ST_HEREDOC -%x ST_START_HEREDOC -%x ST_END_HEREDOC -%x ST_LOOKING_FOR_PROPERTY -%x ST_LOOKING_FOR_VARNAME -%x ST_VAR_OFFSET -%x ST_COMMENT -%x ST_DOC_COMMENT -%x ST_ONE_LINE_COMMENT -%option stack - -%{ - -#include -#include "zend.h" -#include "zend_alloc.h" -#include -#include "zend_compile.h" -#include "zend_language_scanner.h" -#include "zend_highlight.h" -#include "zend_constants.h" -#include "zend_variables.h" -#include "zend_operators.h" -#include "zend_API.h" -#include "zend_strtod.h" -#include "zend_exceptions.h" - -#ifdef HAVE_STDARG_H -# include -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif - -#define YY_DECL int lex_scan(zval *zendlval TSRMLS_DC) - -#define ECHO { ZEND_WRITE( yytext, yyleng ); } - -#ifdef ZTS -# define MY_INPUT yyinput -#else -# define MY_INPUT input -#endif - - -/* Globals Macros */ -#define SCNG LANG_SCNG -#ifdef ZTS -ZEND_API ts_rsrc_id language_scanner_globals_id; -#else -ZEND_API zend_scanner_globals language_scanner_globals; -#endif - - -#define YY_FATAL_ERROR zend_fatal_scanner_error - -#define HANDLE_NEWLINES(s, l) \ -do { \ - char *p = (s), *boundary = p+(l); \ - \ - while (p='0' && (c)<='7') -#define ZEND_IS_HEX(c) (((c)>='0' && (c)<='9') || ((c)>='a' && (c)<='f') || ((c)>='A' && (c)<='F')) - - -void zend_fatal_scanner_error(char *message) -{ - zend_error(E_COMPILE_ERROR, "%s", message); -} - -BEGIN_EXTERN_C() -void startup_scanner(TSRMLS_D) -{ - CG(heredoc) = NULL; - CG(heredoc_len) = 0; - CG(doc_comment) = NULL; - CG(doc_comment_len) = 0; - SCNG(yy_start_stack_ptr) = 0; - SCNG(yy_start_stack_depth) = 0; - SCNG(current_buffer) = NULL; -#ifdef ZEND_MULTIBYTE - SCNG(script_org) = NULL; - SCNG(script_org_size) = 0; - SCNG(script_filtered) = NULL; - SCNG(script_filtered_size) = 0; - SCNG(input_filter) = NULL; - SCNG(output_filter) = NULL; - SCNG(script_encoding) = NULL; - SCNG(internal_encoding) = NULL; -#endif /* ZEND_MULTIBYTE */ -} - - -void shutdown_scanner(TSRMLS_D) -{ - if (CG(heredoc)) { - efree(CG(heredoc)); - CG(heredoc_len)=0; - } - if (SCNG(yy_start_stack)) { - yy_flex_free(SCNG(yy_start_stack)); - SCNG(yy_start_stack) = NULL; - } - RESET_DOC_COMMENT(); - -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } - SCNG(script_org_size) = 0; - SCNG(script_filtered_size) = 0; - SCNG(input_filter) = NULL; - SCNG(output_filter) = NULL; - SCNG(script_encoding) = NULL; - SCNG(internal_encoding) = NULL; -#endif /* ZEND_MULTIBYTE */ -} -END_EXTERN_C() - - -ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC) -{ - memcpy(&lex_state->buffer_state, &YY_CURRENT_BUFFER, sizeof(YY_BUFFER_STATE)); - lex_state->in = SCNG(yy_in); - lex_state->state = YYSTATE; - lex_state->filename = zend_get_compiled_filename(TSRMLS_C); - lex_state->lineno = CG(zend_lineno); - -#ifdef ZEND_MULTIBYTE - lex_state->script_org = SCNG(script_org); - lex_state->script_org_size = SCNG(script_org_size); - lex_state->script_filtered = SCNG(script_filtered); - lex_state->script_filtered_size = SCNG(script_filtered_size); - lex_state->input_filter = SCNG(input_filter); - lex_state->output_filter = SCNG(output_filter); - lex_state->script_encoding = SCNG(script_encoding); - lex_state->internal_encoding = SCNG(internal_encoding); -#endif /* ZEND_MULTIBYTE */ -} - -ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC) -{ - YY_BUFFER_STATE original_buffer_state = YY_CURRENT_BUFFER; - - if (lex_state->buffer_state) { - yy_switch_to_buffer(lex_state->buffer_state TSRMLS_CC); - } else { - YY_CURRENT_BUFFER = NULL; - } - - yy_delete_buffer(original_buffer_state TSRMLS_CC); - SCNG(yy_in) = lex_state->in; - BEGIN(lex_state->state); - CG(zend_lineno) = lex_state->lineno; - zend_restore_compiled_filename(lex_state->filename TSRMLS_CC); - -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } - SCNG(script_org) = lex_state->script_org; - SCNG(script_org_size) = lex_state->script_org_size; - SCNG(script_filtered) = lex_state->script_filtered; - SCNG(script_filtered_size) = lex_state->script_filtered_size; - SCNG(input_filter) = lex_state->input_filter; - SCNG(output_filter) = lex_state->output_filter; - SCNG(script_encoding) = lex_state->script_encoding; - SCNG(internal_encoding) = lex_state->internal_encoding; -#endif /* ZEND_MULTIBYTE */ -} - - -BEGIN_EXTERN_C() - - -ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) -{ - TSRMLS_FETCH(); - - switch (fh->type) { - case ZEND_HANDLE_FP: - fclose(fh->handle.fp); - break; - case ZEND_HANDLE_STREAM: - if (fh->handle.stream.closer) { - fh->handle.stream.closer(fh->handle.stream.handle TSRMLS_CC); - } - break; - case ZEND_HANDLE_FILENAME: - /* We're only supposed to get here when destructing the used_files hash, - * which doesn't really contain open files, but references to their names/paths - */ - break; - } - if (fh->opened_path) { - efree(fh->opened_path); - fh->opened_path = NULL; - } - if (fh->free_filename && fh->filename) { - efree(fh->filename); - fh->filename = NULL; - } -} - - -int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2) -{ - if (fh1->type != fh2->type) { - return 0; - } - switch (fh1->type) { - case ZEND_HANDLE_FP: - return fh1->handle.fp==fh2->handle.fp; - break; - case ZEND_HANDLE_STREAM: - return fh1->handle.stream.handle == fh2->handle.stream.handle; - break; - } - return 0; -} - - -ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC) -{ - zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles); - /* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */ - file_handle->opened_path = NULL; - if (file_handle->free_filename) { - file_handle->filename = NULL; - } -} - - -ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC) -{ - char *file_path=NULL; - - if (FAILURE == zend_stream_fixup(file_handle TSRMLS_CC)) { - return FAILURE; - } - - zend_llist_add_element(&CG(open_files), file_handle); - - /* Reset the scanner for scanning the new file */ - SCNG(yy_in) = file_handle; - -#ifdef ZEND_MULTIBYTE - if (file_handle->handle.stream.interactive == 0) { - if (zend_multibyte_read_script(TSRMLS_C) != 0) { - return FAILURE; - } - - /* force flex to use buffer only */ - SCNG(yy_in) = NULL; - SCNG(init) = 0; - SCNG(start) = 1; - - zend_multibyte_set_filter(NULL TSRMLS_CC); - - if (!SCNG(input_filter)) { - SCNG(script_filtered) = (char*)emalloc(SCNG(script_org_size)+1); - memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1); - SCNG(script_filtered_size) = SCNG(script_org_size); - } else { - SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC); - } - - /* flex requires doubled null */ - SCNG(script_filtered) = (char*)erealloc(SCNG(script_filtered), SCNG(script_filtered_size)+2); - *(SCNG(script_filtered)+SCNG(script_filtered_size)) = (char)NULL; - *(SCNG(script_filtered)+SCNG(script_filtered_size)+1) = (char)NULL; - yy_scan_buffer(SCNG(script_filtered), SCNG(script_filtered_size)+2 TSRMLS_CC); - } else { - yy_switch_to_buffer(yy_create_buffer(SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); - } -#else /* !ZEND_MULTIBYTE */ - yy_switch_to_buffer(yy_create_buffer(SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); -#endif /* ZEND_MULTIBYTE */ - - BEGIN(INITIAL); - - if (file_handle->opened_path) { - file_path = file_handle->opened_path; - } else { - file_path = file_handle->filename; - } - - zend_set_compiled_filename(file_path TSRMLS_CC); - - if (CG(start_lineno)) { - CG(zend_lineno) = CG(start_lineno); - CG(start_lineno) = 0; - } else { - CG(zend_lineno) = 1; - } - - CG(increment_lineno) = 0; - return SUCCESS; -} -END_EXTERN_C() - - -ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); - zend_op_array *original_active_op_array = CG(active_op_array); - zend_op_array *retval=NULL; - int compiler_result; - zend_bool compilation_successful=0; - znode retval_znode; - zend_bool original_in_compilation = CG(in_compilation); - - retval_znode.op_type = IS_CONST; - retval_znode.u.constant.type = IS_LONG; - retval_znode.u.constant.value.lval = 1; - retval_znode.u.constant.is_ref = 0; - retval_znode.u.constant.refcount = 1; - - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - - retval = op_array; /* success oriented */ - - if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) { - if (type==ZEND_REQUIRE) { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename); - zend_bailout(); - } else { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename); - } - compilation_successful=0; - } else { - init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); - CG(in_compilation) = 1; - CG(active_op_array) = op_array; - compiler_result = zendparse(TSRMLS_C); - zend_do_return(&retval_znode, 0 TSRMLS_CC); - zend_do_handle_exception(TSRMLS_C); - CG(in_compilation) = original_in_compilation; - if (compiler_result==1) { /* parser error */ - zend_bailout(); - } - compilation_successful=1; - } - - if (retval) { - CG(active_op_array) = original_active_op_array; - if (compilation_successful) { - pass_two(op_array TSRMLS_CC); - } else { - efree(op_array); - retval = NULL; - } - } - if (compilation_successful) { - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - } - return retval; -} - - -zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) -{ - zend_file_handle file_handle; - zval tmp; - zend_op_array *retval; - char *opened_path = NULL; - - if (filename->type != IS_STRING) { - tmp = *filename; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - filename = &tmp; - } - file_handle.filename = filename->value.str.val; - file_handle.free_filename = 0; - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.opened_path = NULL; - file_handle.handle.fp = NULL; - - retval = zend_compile_file(&file_handle, type TSRMLS_CC); - if (retval && file_handle.handle.stream.handle) { - int dummy = 1; - - if (!file_handle.opened_path) { - file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len); - } - - zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL); - - if (opened_path) { - efree(opened_path); - } - } - zend_destroy_file_handle(&file_handle TSRMLS_CC); - - if (filename==&tmp) { - zval_dtor(&tmp); - } - return retval; -} - -ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC) -{ - /* enforce two trailing NULLs for flex... */ - STR_REALLOC(str->value.str.val, str->value.str.len+2); - - str->value.str.val[str->value.str.len+1]=0; - - SCNG(yy_in)=NULL; - -#ifdef ZEND_MULTIBYTE - SCNG(script_org) = estrdup(str->value.str.val); - SCNG(script_org_size) = str->value.str.len; - - zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC); - - if (!SCNG(input_filter)) { - SCNG(script_filtered) = (char*)emalloc(SCNG(script_org_size)+1); - memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1); - SCNG(script_filtered_size) = SCNG(script_org_size); - } else { - SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC); - } - - /* flex requires doubled null */ - SCNG(script_filtered) = (char*)erealloc(SCNG(script_filtered), SCNG(script_filtered_size)+2); - *(SCNG(script_filtered)+SCNG(script_filtered_size)) = (char)NULL; - *(SCNG(script_filtered)+SCNG(script_filtered_size)+1) = (char)NULL; - yy_scan_buffer(SCNG(script_filtered), SCNG(script_filtered_size)+2 TSRMLS_CC); -#else /* !ZEND_MULTIBYTE */ - yy_scan_buffer(str->value.str.val, str->value.str.len+2 TSRMLS_CC); -#endif /* ZEND_MULTIBYTE */ - - zend_set_compiled_filename(filename TSRMLS_CC); - CG(zend_lineno) = 1; - CG(increment_lineno) = 0; - return SUCCESS; -} - - -ZEND_API int zend_get_scanned_file_offset(TSRMLS_D) -{ - if (yyin) { - int offset_in_buffer = (yy_c_buf_p - (YY_CURRENT_BUFFER)->yy_ch_buf); - int read_bytes = SCNG(yy_n_chars); - int offset_from_the_end = read_bytes - offset_in_buffer; - - return zend_stream_ftell(yyin TSRMLS_CC) - offset_from_the_end; - } else { - /* The entire file is in the buffer; probably zend multibyte - is enabled */ - return (yy_c_buf_p - (YY_CURRENT_BUFFER)->yy_ch_buf); - } -} - - -zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); - zend_op_array *original_active_op_array = CG(active_op_array); - zend_op_array *retval; - zval tmp; - int compiler_result; - zend_bool original_in_compilation = CG(in_compilation); - - if (source_string->value.str.len==0) { - efree(op_array); - return NULL; - } - - CG(in_compilation) = 1; - - tmp = *source_string; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - source_string = &tmp; - - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC)==FAILURE) { - efree(op_array); - retval = NULL; - } else { - zend_bool orig_interactive = CG(interactive); - - CG(interactive) = 0; - init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); - CG(interactive) = orig_interactive; - CG(active_op_array) = op_array; - BEGIN(ST_IN_SCRIPTING); - compiler_result = zendparse(TSRMLS_C); - -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } -#endif /* ZEND_MULTIBYTE */ - - if (compiler_result==1) { - CG(active_op_array) = original_active_op_array; - CG(unclean_shutdown)=1; - retval = NULL; - } else { - zend_do_return(NULL, 0 TSRMLS_CC); - zend_do_handle_exception(TSRMLS_C); - CG(active_op_array) = original_active_op_array; - pass_two(op_array TSRMLS_CC); - retval = op_array; - } - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - } - zval_dtor(&tmp); - CG(in_compilation) = original_in_compilation; - return retval; -} - - -BEGIN_EXTERN_C() -int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_file_handle file_handle; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) { - zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename); - return FAILURE; - } - zend_highlight(syntax_highlighter_ini TSRMLS_CC); -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } -#endif /* ZEND_MULTIBYTE */ - zend_destroy_file_handle(&file_handle TSRMLS_CC); - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - return SUCCESS; -} - -int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zval tmp = *str; - - str = &tmp; - zval_copy_ctor(str); - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) { - return FAILURE; - } - BEGIN(INITIAL); - zend_highlight(syntax_highlighter_ini TSRMLS_CC); -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } -#endif /* ZEND_MULTIBYTE */ - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - zval_dtor(str); - return SUCCESS; -} -END_EXTERN_C() - -#ifdef ZEND_MULTIBYTE -BEGIN_EXTERN_C() -ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC) -{ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - int offset, original_offset, length, free_flag; - char *p; - zend_encoding *new_encoding; - - /* calculate current position */ - offset = original_offset = yy_c_buf_p - b->yy_ch_buf; - if (old_input_filter && original_offset > 0) { - new_encoding = SCNG(script_encoding); - SCNG(script_encoding) = old_encoding; - do { - (old_input_filter)(&p, &length, SCNG(script_org), offset TSRMLS_CC); - if (!p) { - SCNG(script_encoding) = new_encoding; - return; - } - efree(p); - if (length > original_offset) { - offset--; - } else if (length < original_offset) { - offset++; - } - } while (original_offset != length); - SCNG(script_encoding) = new_encoding; - } - - /* convert and set */ - if (!SCNG(input_filter)) { - length = SCNG(script_org_size)-offset-1; - p = SCNG(script_org)+offset+1; - free_flag = 0; - } else { - SCNG(input_filter)(&p, &length, SCNG(script_org)+offset+1, SCNG(script_org_size)-offset-1 TSRMLS_CC); - free_flag = 1; - } - if (original_offset+length+1 > (int)b->yy_buf_size) { - b->yy_buf_size = original_offset+length+1; - b->yy_ch_buf = (char*)erealloc(b->yy_ch_buf, b->yy_buf_size+2); - SCNG(script_filtered) = b->yy_ch_buf; - SCNG(script_filtered_size) = b->yy_buf_size; - } - yy_c_buf_p = b->yy_ch_buf + original_offset; - strncpy(yy_c_buf_p+1, p, length); - b->yy_n_chars = original_offset + length + 1; - SCNG(yy_n_chars) = b->yy_n_chars; - b->yy_ch_buf[SCNG(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[SCNG(yy_n_chars)+1] = YY_END_OF_BUFFER_CHAR; - - if (free_flag) { - efree(p); - } -} - - -ZEND_API int zend_multibyte_yyinput(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC) -{ - int c = '*', n; - - if (file_handle->handle.stream.interactive == 0) { - return zend_stream_read(file_handle, buf, len TSRMLS_CC); - } - - /* interactive */ - if (SCNG(script_org)) { - efree(SCNG(script_org)); - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - } - SCNG(script_org) = NULL; - SCNG(script_org_size) = 0; - - /* TODO: support widechars */ - - for (n = 0; n < len && (c = zend_stream_getc(yyin TSRMLS_CC)) != EOF && c != '\n'; ++n) { - buf[n] = (char)c; - } - if (c == '\n') { - buf[n++] = (char) c; - } - - SCNG(script_org_size) = n; - SCNG(script_org) = (char*)emalloc(SCNG(script_org_size) + 1); - memcpy(SCNG(script_org), buf, n); - - return n; -} - - -ZEND_API int zend_multibyte_read_script(TSRMLS_D) -{ - char buf[8192]; - int n; - - if (SCNG(script_org)) { - efree(SCNG(script_org)); - } - SCNG(script_org) = NULL; - SCNG(script_org_size) = 0; - - for (; (n = zend_stream_read(yyin, buf, sizeof(buf) TSRMLS_CC)) > 0; ) { - SCNG(script_org_size) += n; - SCNG(script_org) = (char*)erealloc(SCNG(script_org), SCNG(script_org_size)); - memcpy(SCNG(script_org) + SCNG(script_org_size) - n, buf, n); - } - - if (n < 0) { - return -1; - } - - SCNG(script_org) = (char*)erealloc(SCNG(script_org), SCNG(script_org_size) + 1); - *(SCNG(script_org)+SCNG(script_org_size)) = '\0'; - - return 0; -} - - -# define zend_copy_value(zendlval, yytext, yyleng) \ - if (SCNG(output_filter)) { \ - SCNG(output_filter)(&(zendlval->value.str.val), &(zendlval->value.str.len), yytext, yyleng TSRMLS_CC); \ - } else { \ - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); \ - zendlval->value.str.len = yyleng; \ - } -#else /* ZEND_MULTIBYTE */ -# define zend_copy_value(zendlval, yytext, yyleng) \ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); \ - zendlval->value.str.len = yyleng; -#endif /* ZEND_MULTIBYTE */ - -static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC) -{ - register char *s, *t; - char *end; - - ZVAL_STRINGL(zendlval, str, len, 1); - - /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; - while (s= end) { - *t++ = '\\'; - break; - } - - switch(*s) { - case 'n': - *t++ = '\n'; - zendlval->value.str.len--; - break; - case 'r': - *t++ = '\r'; - zendlval->value.str.len--; - break; - case 't': - *t++ = '\t'; - zendlval->value.str.len--; - break; - case 'f': - *t++ = '\f'; - zendlval->value.str.len--; - break; - case 'v': - *t++ = '\v'; - zendlval->value.str.len--; - break; - case '"': - case '`': - if (*s != quote_type) { - *t++ = '\\'; - *t++ = *s; - break; - } - case '\\': - case '$': - *t++ = *s; - zendlval->value.str.len--; - break; - case 'x': - case 'X': - if (ZEND_IS_HEX(*(s+1))) { - char hex_buf[3] = { 0, 0, 0 }; - - zendlval->value.str.len--; /* for the 'x' */ - - hex_buf[0] = *(++s); - zendlval->value.str.len--; - if (ZEND_IS_HEX(*(s+1))) { - hex_buf[1] = *(++s); - zendlval->value.str.len--; - } - *t++ = (char) strtol(hex_buf, NULL, 16); - } else { - *t++ = '\\'; - *t++ = *s; - } - break; - default: - /* check for an octal */ - if (ZEND_IS_OCT(*s)) { - char octal_buf[4] = { 0, 0, 0, 0 }; - - octal_buf[0] = *s; - zendlval->value.str.len--; - if (ZEND_IS_OCT(*(s+1))) { - octal_buf[1] = *(++s); - zendlval->value.str.len--; - if (ZEND_IS_OCT(*(s+1))) { - octal_buf[2] = *(++s); - zendlval->value.str.len--; - } - } - *t++ = (char) strtol(octal_buf, NULL, 8); - } else { - *t++ = '\\'; - *t++ = *s; - } - break; - } - } else { - *t++ = *s; - } - - if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) { - CG(zend_lineno)++; - } - s++; - } - *t = 0; - -#ifdef ZEND_MULTIBYTE - if (SCNG(output_filter)) { - s = zendlval->value.str.val; - SCNG(output_filter)(&(zendlval->value.str.val), &(zendlval->value.str.len), s, zendlval->value.str.len TSRMLS_CC); - efree(s); - } -#endif /* ZEND_MULTIBYTE */ -} - -%} - -LNUM [0-9]+ -DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*) -EXPONENT_DNUM (({LNUM}|{DNUM})[eE][+-]?{LNUM}) -HNUM "0x"[0-9a-fA-F]+ -LABEL [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* -WHITESPACE [ \n\r\t]+ -TABS_AND_SPACES [ \t]* -TOKENS [;:,.\[\]()|^&+-/*=%!~$<>?@] -ANY_CHAR (.|[\n]) -NEWLINE ("\r"|"\n"|"\r\n") - -/* - * LITERAL_DOLLAR matches unescaped $ that aren't followed by a label character - * or a { and therefore will be taken literally. The case of literal $ before - * a variable or "${" is handled in a rule for each string type - */ -DOUBLE_QUOTES_LITERAL_DOLLAR ("$"+([^a-zA-Z_\x7f-\xff$"\\{]|("\\"{ANY_CHAR}))) -BACKQUOTE_LITERAL_DOLLAR ("$"+([^a-zA-Z_\x7f-\xff$`\\{]|("\\"{ANY_CHAR}))) -HEREDOC_LITERAL_DOLLAR ("$"+([^a-zA-Z_\x7f-\xff$\n\r\\{]|("\\"[^\n\r]))) - -/* - * Usually, HEREDOC_NEWLINE will just function like a simple NEWLINE, but some - * special cases need to be handled. HEREDOC_CHARS doesn't allow a line to - * match when { or $, and/or \ is at the end. (("{"*|"$"*)"\\"?) handles that, - * along with cases where { or $, and/or \ is the ONLY thing on a line - * - * The other case is when a line contains a label, followed by ONLY - * { or $, and/or \ Handled by ({LABEL}";"?((("{"+|"$"+)"\\"?)|"\\")) - */ -HEREDOC_NEWLINE ((({LABEL}";"?((("{"+|"$"+)"\\"?)|"\\"))|(("{"*|"$"*)"\\"?)){NEWLINE}) - -/* - * This pattern is just used in the next 2 for matching { or literal $, and/or - * \ escape sequence immediately at the beginning of a line or after a label - */ -HEREDOC_CURLY_OR_ESCAPE_OR_DOLLAR (("{"+[^$\n\r\\{])|("{"*"\\"[^\n\r])|{HEREDOC_LITERAL_DOLLAR}) - -/* - * These 2 label-related patterns allow HEREDOC_CHARS to continue "regular" - * matching after a newline that starts with either a non-label character or a - * label that isn't followed by a newline. Like HEREDOC_CHARS, they won't match - * a variable or "{$" Matching a newline, and possibly label, up TO a variable - * or "{$", is handled in the heredoc rules - * - * The HEREDOC_LABEL_NO_NEWLINE pattern (";"[^$\n\r\\{]) handles cases where ; - * follows a label. [^a-zA-Z0-9_\x7f-\xff;$\n\r\\{] is needed to prevent a label - * character or ; from matching on a possible (real) ending label - */ -HEREDOC_NON_LABEL ([^a-zA-Z_\x7f-\xff$\n\r\\{]|{HEREDOC_CURLY_OR_ESCAPE_OR_DOLLAR}) -HEREDOC_LABEL_NO_NEWLINE ({LABEL}([^a-zA-Z0-9_\x7f-\xff;$\n\r\\{]|(";"[^$\n\r\\{])|(";"?{HEREDOC_CURLY_OR_ESCAPE_OR_DOLLAR}))) - -/* - * CHARS matches everything up to a variable or "{$" - * {'s are matched as long as they aren't followed by a $ - * The case of { before "{$" is handled in a rule for each string type - * - * For heredocs, matching continues across/after newlines if/when it's known - * that the next line doesn't contain a possible ending label - */ -DOUBLE_QUOTES_CHARS ("{"*([^$"\\{]|("\\"{ANY_CHAR}))|{DOUBLE_QUOTES_LITERAL_DOLLAR}) -BACKQUOTE_CHARS ("{"*([^$`\\{]|("\\"{ANY_CHAR}))|{BACKQUOTE_LITERAL_DOLLAR}) -HEREDOC_CHARS ("{"*([^$\n\r\\{]|("\\"[^\n\r]))|{HEREDOC_LITERAL_DOLLAR}|({HEREDOC_NEWLINE}+({HEREDOC_NON_LABEL}|{HEREDOC_LABEL_NO_NEWLINE}))) - -%option noyylineno -%option noyywrap -%% - -"exit" { - return T_EXIT; -} - -"die" { - return T_EXIT; -} - -"function" { - return T_FUNCTION; -} - -"const" { - return T_CONST; -} - -"return" { - return T_RETURN; -} - -"try" { - return T_TRY; -} - -"catch" { - return T_CATCH; -} - -"throw" { - return T_THROW; -} - -"if" { - return T_IF; -} - -"elseif" { - return T_ELSEIF; -} - -"endif" { - return T_ENDIF; -} - -"else" { - return T_ELSE; -} - -"while" { - return T_WHILE; -} - -"endwhile" { - return T_ENDWHILE; -} - -"do" { - return T_DO; -} - -"for" { - return T_FOR; -} - -"endfor" { - return T_ENDFOR; -} - -"foreach" { - return T_FOREACH; -} - -"endforeach" { - return T_ENDFOREACH; -} - -"declare" { - return T_DECLARE; -} - -"enddeclare" { - return T_ENDDECLARE; -} - -"instanceof" { - return T_INSTANCEOF; -} - -"as" { - return T_AS; -} - -"switch" { - return T_SWITCH; -} - -"endswitch" { - return T_ENDSWITCH; -} - -"case" { - return T_CASE; -} - -"default" { - return T_DEFAULT; -} - -"break" { - return T_BREAK; -} - -"continue" { - return T_CONTINUE; -} - -"echo" { - return T_ECHO; -} - -"print" { - return T_PRINT; -} - -"class" { - return T_CLASS; -} - -"interface" { - return T_INTERFACE; -} - -"extends" { - return T_EXTENDS; -} - -"implements" { - return T_IMPLEMENTS; -} - -"->" { - yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); - return T_OBJECT_OPERATOR; -} - -"->" { - return T_OBJECT_OPERATOR; -} - -{LABEL} { - yy_pop_state(TSRMLS_C); - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - return T_STRING; -} - -{ANY_CHAR} { - yyless(0); - yy_pop_state(TSRMLS_C); -} - -"::" { - return T_PAAMAYIM_NEKUDOTAYIM; -} - -"new" { - return T_NEW; -} - -"clone" { - return T_CLONE; -} - -"var" { - return T_VAR; -} - -"("{TABS_AND_SPACES}("int"|"integer"){TABS_AND_SPACES}")" { - return T_INT_CAST; -} - -"("{TABS_AND_SPACES}("real"|"double"|"float"){TABS_AND_SPACES}")" { - return T_DOUBLE_CAST; -} - -"("{TABS_AND_SPACES}"string"{TABS_AND_SPACES}")" { - return T_STRING_CAST; -} - -"("{TABS_AND_SPACES}"binary"{TABS_AND_SPACES}")" { - return T_STRING_CAST; -} - -"("{TABS_AND_SPACES}"array"{TABS_AND_SPACES}")" { - return T_ARRAY_CAST; -} - -"("{TABS_AND_SPACES}"object"{TABS_AND_SPACES}")" { - return T_OBJECT_CAST; -} - -"("{TABS_AND_SPACES}("bool"|"boolean"){TABS_AND_SPACES}")" { - return T_BOOL_CAST; -} - -"("{TABS_AND_SPACES}("unset"){TABS_AND_SPACES}")" { - return T_UNSET_CAST; -} - -"eval" { - return T_EVAL; -} - -"include" { - return T_INCLUDE; -} - -"include_once" { - return T_INCLUDE_ONCE; -} - -"require" { - return T_REQUIRE; -} - -"require_once" { - return T_REQUIRE_ONCE; -} - -"use" { - return T_USE; -} - -"global" { - return T_GLOBAL; -} - -"isset" { - return T_ISSET; -} - -"empty" { - return T_EMPTY; -} - -"__halt_compiler" { - return T_HALT_COMPILER; -} - -"static" { - return T_STATIC; -} - -"abstract" { - return T_ABSTRACT; -} - -"final" { - return T_FINAL; -} - -"private" { - return T_PRIVATE; -} - -"protected" { - return T_PROTECTED; -} - -"public" { - return T_PUBLIC; -} - -"unset" { - return T_UNSET; -} - -"=>" { - return T_DOUBLE_ARROW; -} - -"list" { - return T_LIST; -} - -"array" { - return T_ARRAY; -} - -"++" { - return T_INC; -} - -"--" { - return T_DEC; -} - -"===" { - return T_IS_IDENTICAL; -} - -"!==" { - return T_IS_NOT_IDENTICAL; -} - -"==" { - return T_IS_EQUAL; -} - -"!="|"<>" { - return T_IS_NOT_EQUAL; -} - -"<=" { - return T_IS_SMALLER_OR_EQUAL; -} - -">=" { - return T_IS_GREATER_OR_EQUAL; -} - -"+=" { - return T_PLUS_EQUAL; -} - -"-=" { - return T_MINUS_EQUAL; -} - -"*=" { - return T_MUL_EQUAL; -} - -"/=" { - return T_DIV_EQUAL; -} - -".=" { - return T_CONCAT_EQUAL; -} - -"%=" { - return T_MOD_EQUAL; -} - -"<<=" { - return T_SL_EQUAL; -} - -">>=" { - return T_SR_EQUAL; -} - -"&=" { - return T_AND_EQUAL; -} - -"|=" { - return T_OR_EQUAL; -} - -"^=" { - return T_XOR_EQUAL; -} - -"||" { - return T_BOOLEAN_OR; -} - -"&&" { - return T_BOOLEAN_AND; -} - -"OR" { - return T_LOGICAL_OR; -} - -"AND" { - return T_LOGICAL_AND; -} - -"XOR" { - return T_LOGICAL_XOR; -} - -"<<" { - return T_SL; -} - -">>" { - return T_SR; -} - -{TOKENS} { - return yytext[0]; -} - - -"{" { - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - return '{'; -} - - -"${" { - yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); - return T_DOLLAR_OPEN_CURLY_BRACES; -} - - -"}" { - RESET_DOC_COMMENT(); - /* This is a temporary fix which is dependant on flex and it's implementation */ - if (yy_start_stack_ptr) { - yy_pop_state(TSRMLS_C); - } - return '}'; -} - - -{LABEL} { - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - yy_pop_state(TSRMLS_C); - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - return T_STRING_VARNAME; -} - - -{ANY_CHAR} { - yyless(0); - yy_pop_state(TSRMLS_C); - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); -} - - -{LNUM} { - if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */ - zendlval->value.lval = strtol(yytext, NULL, 0); - } else { - errno = 0; - zendlval->value.lval = strtol(yytext, NULL, 0); - if (errno == ERANGE) { /* Overflow */ - if (yytext[0] == '0') { /* octal overflow */ - zendlval->value.dval = zend_oct_strtod(yytext, NULL); - } else { - zendlval->value.dval = zend_strtod(yytext, NULL); - } - zendlval->type = IS_DOUBLE; - return T_DNUMBER; - } - } - - zendlval->type = IS_LONG; - return T_LNUMBER; -} - -{HNUM} { - char *hex = yytext + 2; /* Skip "0x" */ - int len = yyleng - 2; - - /* Skip any leading 0s */ - while (*hex == '0') { - hex++; - len--; - } - - if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) { - zendlval->value.lval = strtol(hex, NULL, 16); - zendlval->type = IS_LONG; - return T_LNUMBER; - } else { - zendlval->value.dval = zend_hex_strtod(hex, NULL); - zendlval->type = IS_DOUBLE; - return T_DNUMBER; - } -} - -0|([1-9][0-9]*) { /* Offset could be treated as a long */ - if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) { - zendlval->value.lval = strtol(yytext, NULL, 10); - zendlval->type = IS_LONG; - } else { - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - } - return T_NUM_STRING; -} - -{LNUM}|{HNUM} { /* Offset must be treated as a string */ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_NUM_STRING; -} - -{DNUM}|{EXPONENT_DNUM} { - zendlval->value.dval = zend_strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; - return T_DNUMBER; -} - -"__CLASS__" { - char *class_name = NULL; - - if (CG(active_class_entry)) { - class_name = CG(active_class_entry)->name; - } - - if (!class_name) { - class_name = ""; - } - zendlval->value.str.len = strlen(class_name); - zendlval->value.str.val = estrndup(class_name, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_CLASS_C; -} - -"__FUNCTION__" { - char *func_name = NULL; - - if (CG(active_op_array)) { - func_name = CG(active_op_array)->function_name; - } - - if (!func_name) { - func_name = ""; - } - zendlval->value.str.len = strlen(func_name); - zendlval->value.str.val = estrndup(func_name, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_FUNC_C; -} - -"__METHOD__" { - char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL; - char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL; - size_t len = 0; - - if (class_name) { - len += strlen(class_name) + 2; - } - if (func_name) { - len += strlen(func_name); - } - - zendlval->value.str.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s", - class_name ? class_name : "", - class_name && func_name ? "::" : "", - func_name ? func_name : "" - ); - zendlval->type = IS_STRING; - return T_METHOD_C; -} - -"__LINE__" { - zendlval->value.lval = CG(zend_lineno); - zendlval->type = IS_LONG; - return T_LINE; -} - -"__FILE__" { - char *filename = zend_get_compiled_filename(TSRMLS_C); - - if (!filename) { - filename = ""; - } - zendlval->value.str.len = strlen(filename); - zendlval->value.str.val = estrndup(filename, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_FILE; -} - -(([^<]|"<"[^?%s<]){1,400})|"value.str.val), &(zendlval->value.str.len), yytext, yyleng TSRMLS_CC); - if (readsize < yyleng) { - yyless(readsize); - } - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - } -#else /* !ZEND_MULTIBYTE */ - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; -#endif /* ZEND_MULTIBYTE */ - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - return T_INLINE_HTML; -} - -"" { - HANDLE_NEWLINES(yytext, yyleng); - if (CG(short_tags) || yyleng>2) { /* yyleng>2 means it's not */ - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - - -"<%="|"value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG_WITH_ECHO; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - - -"<%" { - if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - - -"value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - HANDLE_NEWLINE(yytext[yyleng-1]); - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; -} - -"$"{LABEL} { - zend_copy_value(zendlval, (yytext+1), (yyleng-1)); - zendlval->type = IS_STRING; - return T_VARIABLE; -} - -%{ -/* Make sure a label character follows "->", otherwise there is no property - * and "->" will be taken literally - */ %} -"$"{LABEL}"->"[a-zA-Z_\x7f-\xff] { - yyless(yyleng - 3); - yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); - zend_copy_value(zendlval, (yytext+1), (yyleng-1)); - zendlval->type = IS_STRING; - return T_VARIABLE; -} - -%{ -/* A [ always designates a variable offset, regardless of what follows - */ %} -"$"{LABEL}"[" { - yyless(yyleng - 1); - yy_push_state(ST_VAR_OFFSET TSRMLS_CC); - zend_copy_value(zendlval, (yytext+1), (yyleng-1)); - zendlval->type = IS_STRING; - return T_VARIABLE; -} - -"]" { - yy_pop_state(TSRMLS_C); - return ']'; -} - -{TOKENS}|[{}"`] { - /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */ - return yytext[0]; -} - -[ \n\r\t\\'#] { - /* Invalid rule to return a more explicit parse error with proper line number */ - yyless(0); - yy_pop_state(TSRMLS_C); - ZVAL_EMPTY_STRING(zendlval); /* Empty since it won't be used */ - return T_ENCAPSED_AND_WHITESPACE; -} - -{LABEL} { - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - return T_STRING; -} - - -{WHITESPACE} { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - return T_WHITESPACE; -} - - -"#"|"//" { - BEGIN(ST_ONE_LINE_COMMENT); - yymore(); -} - -"?"|"%"|">" { - yymore(); -} - -[^\n\r?%>]*{ANY_CHAR} { - switch (yytext[yyleng-1]) { - case '?': case '%': case '>': - yyless(yyleng-1); - yymore(); - break; - case '\n': - CG(zend_lineno)++; - /* intentional fall through */ - default: - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; - } -} - -{NEWLINE} { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - CG(zend_lineno)++; - return T_COMMENT; -} - -"?>"|"%>" { - if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */ - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng-2; - zendlval->type = IS_STRING; - yyless(yyleng-2); - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; - } else { - yymore(); - } -} - -"/**"{WHITESPACE} { - CG(comment_start_line) = CG(zend_lineno); - RESET_DOC_COMMENT(); - BEGIN(ST_DOC_COMMENT); - yymore(); -} - -"/*" { - CG(comment_start_line) = CG(zend_lineno); - BEGIN(ST_COMMENT); - yymore(); -} - - -[^*]+ { - yymore(); -} - -"*/" { - CG(doc_comment) = estrndup(yytext, yyleng); - CG(doc_comment_len) = yyleng; - HANDLE_NEWLINES(yytext, yyleng); - BEGIN(ST_IN_SCRIPTING); - return T_DOC_COMMENT; -} - -"*/" { - HANDLE_NEWLINES(yytext, yyleng); - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; -} - -"*" { - yymore(); -} - -("?>"|""){NEWLINE}? { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(INITIAL); - return T_CLOSE_TAG; /* implicit ';' at php-end tag */ -} - - -"%>"{NEWLINE}? { - if (CG(asp_tags)) { - BEGIN(INITIAL); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - zendlval->value.str.val = yytext; /* no copying - intentional */ - return T_CLOSE_TAG; /* implicit ';' at php-end tag */ - } else { - yyless(1); - return yytext[0]; - } -} - - -%{ -/* ("{"*|"$"*) handles { or $ at the end of a string (or the entire contents) - */ %} -(b?["]{DOUBLE_QUOTES_CHARS}*("{"*|"$"*)["]) { - int bprefix = (yytext[0] != '"') ? 1 : 0; - - zend_scan_escape_string(zendlval, yytext+bprefix+1, yyleng-bprefix-2, '"' TSRMLS_CC); - return T_CONSTANT_ENCAPSED_STRING; -} - - -(b?[']([^'\\]|("\\"{ANY_CHAR}))*[']) { - register char *s, *t; - char *end; - int bprefix = (yytext[0] != '\'') ? 1 : 0; - - zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2); - zendlval->value.str.len = yyleng-bprefix-2; - zendlval->type = IS_STRING; - - /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; - while (svalue.str.len--; - break; - default: - *t++ = '\\'; - *t++ = *s; - break; - } - } else { - *t++ = *s; - } - - if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) { - CG(zend_lineno)++; - } - s++; - } - *t = 0; - -#ifdef ZEND_MULTIBYTE - if (SCNG(output_filter)) { - s = zendlval->value.str.val; - SCNG(output_filter)(&(zendlval->value.str.val), &(zendlval->value.str.len), s, zendlval->value.str.len TSRMLS_CC); - efree(s); - } -#endif /* ZEND_MULTIBYTE */ - - return T_CONSTANT_ENCAPSED_STRING; -} - - -b?["] { - BEGIN(ST_DOUBLE_QUOTES); - return '"'; -} - - -b?"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} { - char *s; - int bprefix = (yytext[0] != '<') ? 1 : 0; - - CG(zend_lineno)++; - CG(heredoc_len) = yyleng-bprefix-3-1-(yytext[yyleng-2]=='\r'?1:0); - s = yytext+bprefix+3; - while ((*s == ' ') || (*s == '\t')) { - s++; - CG(heredoc_len)--; - } - CG(heredoc) = estrndup(s, CG(heredoc_len)); - BEGIN(ST_START_HEREDOC); - return T_START_HEREDOC; -} - - -[`] { - BEGIN(ST_BACKQUOTE); - return '`'; -} - - -{ANY_CHAR} { - yyless(0); - BEGIN(ST_HEREDOC); -} - -{LABEL}";"?[\n\r] { - int label_len = yyleng - 1; - - if (yytext[label_len-1]==';') { - label_len--; - } - - yyless(label_len); - - if (label_len==CG(heredoc_len) && !memcmp(yytext, CG(heredoc), label_len)) { - zendlval->value.str.val = CG(heredoc); - zendlval->value.str.len = label_len; - CG(heredoc)=NULL; - CG(heredoc_len)=0; - BEGIN(ST_IN_SCRIPTING); - return T_END_HEREDOC; - } else { - yymore(); - BEGIN(ST_HEREDOC); - } -} - -%{ -/* Match everything up to and including a possible ending label, so if the label - * doesn't match, it's kept with the rest of the string - * - * {HEREDOC_NEWLINE}+ handles the case of more than one newline sequence that - * couldn't be matched with HEREDOC_CHARS, because of the following label - */ %} -{HEREDOC_CHARS}*{HEREDOC_NEWLINE}+{LABEL}";"?[\n\r] { - char *end = yytext + yyleng - 1; - - if (end[-1] == ';') { - end--; - yyleng--; - } - - if (yyleng > CG(heredoc_len) && !memcmp(end - CG(heredoc_len), CG(heredoc), CG(heredoc_len))) { - int len = yyleng - CG(heredoc_len) - 2; /* 2 for newline before and after label */ - - /* May have matched fooLABEL; make sure there's a newline before it */ - if (yytext[len] != '\n') { - if (yytext[len] != '\r') { - goto wrong_label; - } - } else if (len > 0 && yytext[len - 1] == '\r') { - len--; /* Windows newline */ - } - - /* Go back before last label char, to match in ST_END_HEREDOC state */ - yyless(yyleng - 2); - - /* Subtract the remaining label length. yyleng must include newline - * before label, for zend_highlight/strip, tokenizer, etc. */ - yyleng -= CG(heredoc_len) - 1; - - CG(increment_lineno) = 1; /* For newline before label */ - BEGIN(ST_END_HEREDOC); - zend_scan_escape_string(zendlval, yytext, len, 0 TSRMLS_CC); - return T_ENCAPSED_AND_WHITESPACE; - } else { - /* Go back to end of label, so the next match works correctly in case of - * a variable or another label at the beginning of the next line */ -wrong_label: - yyless(yyleng - 1); - yymore(); - } -} - -{ANY_CHAR} { - zendlval->value.str.val = CG(heredoc); - zendlval->value.str.len = CG(heredoc_len); - yytext = zendlval->value.str.val; - yyleng = zendlval->value.str.len; - CG(heredoc) = NULL; - CG(heredoc_len) = 0; - BEGIN(ST_IN_SCRIPTING); - return T_END_HEREDOC; -} - - -"{$" { - zendlval->value.lval = (long) '{'; - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - yyless(1); - return T_CURLY_OPEN; -} - - -{DOUBLE_QUOTES_CHARS}+ { - zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC); - return T_ENCAPSED_AND_WHITESPACE; -} - -%{ -/* "{"{2,}|"$"{2,} handles { before "{$" or literal $ before a variable or "${" - * (("{"+|"$"+)["]) handles { or $ at the end of a string - * - * Same for backquotes and heredocs, except the second case doesn't apply to - * heredocs. yyless(yyleng - 1) is used to correct taking one character too many - */ %} -{DOUBLE_QUOTES_CHARS}*("{"{2,}|"$"{2,}|(("{"+|"$"+)["])) { - yyless(yyleng - 1); - zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC); - return T_ENCAPSED_AND_WHITESPACE; -} - - -{BACKQUOTE_CHARS}+ { - zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC); - return T_ENCAPSED_AND_WHITESPACE; -} - -{BACKQUOTE_CHARS}*("{"{2,}|"$"{2,}|(("{"+|"$"+)[`])) { - yyless(yyleng - 1); - zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC); - return T_ENCAPSED_AND_WHITESPACE; -} - - -%{ -/* ({HEREDOC_NEWLINE}+({LABEL}";"?)?)? handles the possible case of newline - * sequences, possibly followed by a label, that couldn't be matched with - * HEREDOC_CHARS because of a following variable or "{$" - * - * This doesn't affect real ending labels, as they are followed by a newline, - * which will result in a longer match for the correct rule if present - */ %} -{HEREDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)? { - zend_scan_escape_string(zendlval, yytext, yyleng, 0 TSRMLS_CC); - return T_ENCAPSED_AND_WHITESPACE; -} - -{HEREDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)?("{"{2,}|"$"{2,}) { - yyless(yyleng - 1); - zend_scan_escape_string(zendlval, yytext, yyleng, 0 TSRMLS_CC); - return T_ENCAPSED_AND_WHITESPACE; -} - - -["] { - BEGIN(ST_IN_SCRIPTING); - return '"'; -} - - -[`] { - BEGIN(ST_IN_SCRIPTING); - return '`'; -} - - -<> { - zend_error(E_COMPILE_WARNING,"Unterminated comment starting line %d", CG(comment_start_line)); - return 0; -} - - - -{ANY_CHAR} { - zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); -} diff --git a/Zend/zend_list.c b/Zend/zend_list.c deleted file mode 100644 index 2fdb60028558a..0000000000000 --- a/Zend/zend_list.c +++ /dev/null @@ -1,373 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* resource lists */ - -#include "zend.h" -#include "zend_list.h" -#include "zend_API.h" -#include "zend_globals.h" - -ZEND_API int le_index_ptr; - -/* true global */ -static HashTable list_destructors; - - -ZEND_API int zend_list_insert(void *ptr, int type) -{ - int index; - zend_rsrc_list_entry le; - TSRMLS_FETCH(); - - le.ptr=ptr; - le.type=type; - le.refcount=1; - - index = zend_hash_next_free_element(&EG(regular_list)); - - zend_hash_index_update(&EG(regular_list), index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL); - return index; -} - -ZEND_API int _zend_list_delete(int id TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { -/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */ - if (--le->refcount<=0) { - return zend_hash_index_del(&EG(regular_list), id); - } else { - return SUCCESS; - } - } else { - return FAILURE; - } -} - - -ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { - *type = le->type; - return le->ptr; - } else { - *type = -1; - return NULL; - } -} - -ZEND_API int _zend_list_addref(int id TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { -/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */ - le->refcount++; - return SUCCESS; - } else { - return FAILURE; - } -} - - -ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type) -{ - int rsrc_id; - - rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type); - - if (rsrc_result) { - rsrc_result->value.lval = rsrc_id; - rsrc_result->type = IS_RESOURCE; - } - - return rsrc_id; -} - - -ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...) -{ - int id; - int actual_resource_type; - void *resource; - va_list resource_types; - int i; - char *space; - char *class_name; - - if (default_id==-1) { /* use id */ - if (!passed_id) { - if (resource_type_name) { - class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%s%s%s(): no %s resource supplied", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name); - } - return NULL; - } else if ((*passed_id)->type != IS_RESOURCE) { - if (resource_type_name) { - class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%s%s%s(): supplied argument is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name); - } - return NULL; - } - id = (*passed_id)->value.lval; - } else { - id = default_id; - } - - resource = zend_list_find(id, &actual_resource_type); - if (!resource) { - if (resource_type_name) { - class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), id, resource_type_name); - } - return NULL; - } - - va_start(resource_types, num_resource_types); - for (i=0; itype, (void **) &ld)==SUCCESS) { - switch (ld->type) { - case ZEND_RESOURCE_LIST_TYPE_STD: - if (ld->list_dtor) { - (ld->list_dtor)(le->ptr); - } - break; - case ZEND_RESOURCE_LIST_TYPE_EX: - if (ld->list_dtor_ex) { - ld->list_dtor_ex(le TSRMLS_CC); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } else { - zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)", le->type); - } -} - - -void plist_entry_destructor(void *ptr) -{ - zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr; - zend_rsrc_list_dtors_entry *ld; - TSRMLS_FETCH(); - - if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) { - switch (ld->type) { - case ZEND_RESOURCE_LIST_TYPE_STD: - if (ld->plist_dtor) { - (ld->plist_dtor)(le->ptr); - } - break; - case ZEND_RESOURCE_LIST_TYPE_EX: - if (ld->plist_dtor_ex) { - ld->plist_dtor_ex(le TSRMLS_CC); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } else { - zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)", le->type); - } -} - - -int zend_init_rsrc_list(TSRMLS_D) -{ - if (zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor, 0)==SUCCESS) { - EG(regular_list).nNextFreeElement=1; /* we don't want resource id 0 */ - return SUCCESS; - } else { - return FAILURE; - } -} - - -int zend_init_rsrc_plist(TSRMLS_D) -{ - return zend_hash_init_ex(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1, 0); -} - - -void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC) -{ - zend_hash_graceful_reverse_destroy(ht); -} - -static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id TSRMLS_DC) -{ - if (le->type == *resource_id) { - return 1; - } else { - return 0; - } -} - - -static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number TSRMLS_DC) -{ - if (ld->module_number == *module_number) { - zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC); - return 1; - } else { - return 0; - } -} - - -void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC) -{ - zend_hash_apply_with_argument(&list_destructors, (apply_func_arg_t) zend_clean_module_rsrc_dtors_cb, (void *) &module_number TSRMLS_CC); -} - - -ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number) -{ - zend_rsrc_list_dtors_entry lde; - -#if 0 - printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number); -#endif - - lde.list_dtor=(void (*)(void *)) ld; - lde.plist_dtor=(void (*)(void *)) pld; - lde.list_dtor_ex = lde.plist_dtor_ex = NULL; - lde.module_number = module_number; - lde.resource_id = list_destructors.nNextFreeElement; - lde.type = ZEND_RESOURCE_LIST_TYPE_STD; - lde.type_name = NULL; - - if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) { - return FAILURE; - } - return list_destructors.nNextFreeElement-1; -} - - -ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number) -{ - zend_rsrc_list_dtors_entry lde; - -#if 0 - printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number); -#endif - - lde.list_dtor = NULL; - lde.plist_dtor = NULL; - lde.list_dtor_ex = ld; - lde.plist_dtor_ex = pld; - lde.module_number = module_number; - lde.resource_id = list_destructors.nNextFreeElement; - lde.type = ZEND_RESOURCE_LIST_TYPE_EX; - lde.type_name = type_name; - - if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) { - return FAILURE; - } - return list_destructors.nNextFreeElement-1; -} - -ZEND_API int zend_fetch_list_dtor_id(char *type_name) -{ - zend_rsrc_list_dtors_entry *lde; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(&list_destructors, &pos); - while (zend_hash_get_current_data_ex(&list_destructors, (void **)&lde, &pos) == SUCCESS) { - if (lde->type_name && (strcmp(type_name, lde->type_name) == 0)) { -#if 0 - printf("Found resource id %d for resource type %s\n", (*lde).resource_id, type_name); -#endif - return lde->resource_id; - } - zend_hash_move_forward_ex(&list_destructors, &pos); - } - - return 0; -} - -int zend_init_rsrc_list_dtors(void) -{ - int retval; - - retval = zend_hash_init(&list_destructors, 50, NULL, NULL, 1); - list_destructors.nNextFreeElement=1; /* we don't want resource type 0 */ - - return retval; -} - - -void zend_destroy_rsrc_list_dtors(void) -{ - zend_hash_destroy(&list_destructors); -} - - -char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC) -{ - zend_rsrc_list_dtors_entry *lde; - int rsrc_type; - - if (!zend_list_find(resource, &rsrc_type)) - return NULL; - - if (zend_hash_index_find(&list_destructors, rsrc_type, (void **) &lde)==SUCCESS) { - return lde->type_name; - } else { - return NULL; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_list.h b/Zend/zend_list.h deleted file mode 100644 index 4472b1a4e43f1..0000000000000 --- a/Zend/zend_list.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_LIST_H -#define ZEND_LIST_H - -#include "zend_hash.h" -#include "zend_globals.h" - -BEGIN_EXTERN_C() - -#define ZEND_RESOURCE_LIST_TYPE_STD 1 -#define ZEND_RESOURCE_LIST_TYPE_EX 2 - -typedef struct _zend_rsrc_list_entry { - void *ptr; - int type; - int refcount; -} zend_rsrc_list_entry; - -typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *rsrc TSRMLS_DC); -#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_rsrc_list_entry *rsrc TSRMLS_DC) - -typedef struct _zend_rsrc_list_dtors_entry { - /* old style destructors */ - void (*list_dtor)(void *); - void (*plist_dtor)(void *); - - /* new style destructors */ - rsrc_dtor_func_t list_dtor_ex; - rsrc_dtor_func_t plist_dtor_ex; - - char *type_name; - - int module_number; - int resource_id; - unsigned char type; -} zend_rsrc_list_dtors_entry; - - -#define register_list_destructors(ld, pld) zend_register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number); -ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number); -ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number); - -void list_entry_destructor(void *ptr); -void plist_entry_destructor(void *ptr); - -void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC); -int zend_init_rsrc_list(TSRMLS_D); -int zend_init_rsrc_plist(TSRMLS_D); -void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC); -int zend_init_rsrc_list_dtors(void); -void zend_destroy_rsrc_list_dtors(void); - -ZEND_API int zend_list_insert(void *ptr, int type); -ZEND_API int _zend_list_addref(int id TSRMLS_DC); -ZEND_API int _zend_list_delete(int id TSRMLS_DC); -ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC); - -#define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC) -#define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC) -#define zend_list_find(id, type) _zend_list_find(id, type TSRMLS_CC) - -ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type); -ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...); - -ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC); -ZEND_API int zend_fetch_list_dtor_id(char *type_name); - -extern ZEND_API int le_index_ptr; /* list entry type for index pointers */ - -#define ZEND_VERIFY_RESOURCE(rsrc) \ - if (!rsrc) { \ - RETURN_FALSE; \ - } - -#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \ - rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type); \ - ZEND_VERIFY_RESOURCE(rsrc); - -#define ZEND_FETCH_RESOURCE_NO_RETURN(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \ - (rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type)) - -#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2) \ - rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \ - ZEND_VERIFY_RESOURCE(rsrc); - -#define ZEND_FETCH_RESOURCE2_NO_RETURN(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2) \ - (rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2)) - -#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \ - zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type); - -#define ZEND_GET_RESOURCE_TYPE_ID(le_id, le_type_name) \ - if (le_id == 0) { \ - le_id = zend_fetch_list_dtor_id(le_type_name); \ - } -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c deleted file mode 100644 index d1df5f82afb33..0000000000000 --- a/Zend/zend_llist.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_llist.h" -#include "zend_qsort.h" - -ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent) -{ - l->head = NULL; - l->tail = NULL; - l->count = 0; - l->size = size; - l->dtor = dtor; - l->persistent = persistent; -} - - -ZEND_API void zend_llist_add_element(zend_llist *l, void *element) -{ - zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent); - - tmp->prev = l->tail; - tmp->next = NULL; - if (l->tail) { - l->tail->next = tmp; - } else { - l->head = tmp; - } - l->tail = tmp; - memcpy(tmp->data, element, l->size); - - ++l->count; -} - - -ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element) -{ - zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent); - - tmp->next = l->head; - tmp->prev = NULL; - if (l->head) { - l->head->prev = tmp; - } else { - l->tail = tmp; - } - l->head = tmp; - memcpy(tmp->data, element, l->size); - - ++l->count; -} - - -#define DEL_LLIST_ELEMENT(current, l) \ - if ((current)->prev) {\ - (current)->prev->next = (current)->next;\ - } else {\ - (l)->head = (current)->next;\ - }\ - if ((current)->next) {\ - (current)->next->prev = (current)->prev;\ - } else {\ - (l)->tail = (current)->prev;\ - }\ - if ((l)->dtor) {\ - (l)->dtor((current)->data);\ - }\ - pefree((current), (l)->persistent);\ - --l->count; - - -ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)) -{ - zend_llist_element *current=l->head; - zend_llist_element *next; - - while (current) { - next = current->next; - if (compare(current->data, element)) { - DEL_LLIST_ELEMENT(current, l); - break; - } - current = next; - } -} - - -ZEND_API void zend_llist_destroy(zend_llist *l) -{ - zend_llist_element *current=l->head, *next; - - while (current) { - next = current->next; - if (l->dtor) { - l->dtor(current->data); - } - pefree(current, l->persistent); - current = next; - } - - l->count = 0; -} - - -ZEND_API void zend_llist_clean(zend_llist *l) -{ - zend_llist_destroy(l); - l->head = l->tail = NULL; -} - - -ZEND_API void *zend_llist_remove_tail(zend_llist *l) -{ - zend_llist_element *old_tail; - void *data; - - if ((old_tail = l->tail)) { - if (old_tail->prev) { - old_tail->prev->next = NULL; - } else { - l->head = NULL; - } - - data = old_tail->data; - - l->tail = old_tail->prev; - if (l->dtor) { - l->dtor(data); - } - pefree(old_tail, l->persistent); - - --l->count; - - return data; - } - - return NULL; -} - - -ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src) -{ - zend_llist_element *ptr; - - zend_llist_init(dst, src->size, src->dtor, src->persistent); - ptr = src->head; - while (ptr) { - zend_llist_add_element(dst, ptr->data); - ptr = ptr->next; - } -} - - -ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)) -{ - zend_llist_element *element, *next; - - element=l->head; - while (element) { - next = element->next; - if (func(element->data)) { - DEL_LLIST_ELEMENT(element, l); - } - element = next; - } -} - - -ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC) -{ - zend_llist_element *element; - - for (element=l->head; element; element=element->next) { - func(element->data TSRMLS_CC); - } -} - -ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC) -{ - size_t i; - - zend_llist_element **elements; - zend_llist_element *element, **ptr; - - if (l->count <= 0) { - return; - } - - elements = (zend_llist_element **) emalloc(l->count * sizeof(zend_llist_element *)); - - ptr = &elements[0]; - - for (element=l->head; element; element=element->next) { - *ptr++ = element; - } - - zend_qsort(elements, l->count, sizeof(zend_llist_element *), (compare_func_t) comp_func TSRMLS_CC); - - l->head = elements[0]; - elements[0]->prev = NULL; - - for (i = 1; i < l->count; i++) { - elements[i]->prev = elements[i-1]; - elements[i-1]->next = elements[i]; - } - elements[i-1]->next = NULL; - l->tail = elements[i-1]; - efree(elements); -} - - -ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC) -{ - zend_llist_element *element; - - for (element=l->head; element; element=element->next) { - func(element->data, arg TSRMLS_CC); - } -} - - -ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...) -{ - zend_llist_element *element; - va_list args; - - va_start(args, num_args); - for (element=l->head; element; element=element->next) { - func(element->data, num_args, args TSRMLS_CC); - } - va_end(args); -} - - -ZEND_API int zend_llist_count(zend_llist *l) -{ - return l->count; -} - - -ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - *current = l->head; - if (*current) { - return (*current)->data; - } else { - return NULL; - } -} - - -ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - *current = l->tail; - if (*current) { - return (*current)->data; - } else { - return NULL; - } -} - - -ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - if (*current) { - *current = (*current)->next; - if (*current) { - return (*current)->data; - } - } - return NULL; -} - - -ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - if (*current) { - *current = (*current)->prev; - if (*current) { - return (*current)->data; - } - } - return NULL; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h deleted file mode 100644 index ee4627051cfb7..0000000000000 --- a/Zend/zend_llist.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_LLIST_H -#define ZEND_LLIST_H - -typedef struct _zend_llist_element { - struct _zend_llist_element *next; - struct _zend_llist_element *prev; - char data[1]; /* Needs to always be last in the struct */ -} zend_llist_element; - -typedef void (*llist_dtor_func_t)(void *); -typedef int (*llist_compare_func_t)(const zend_llist_element **, const zend_llist_element ** TSRMLS_DC); -typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args TSRMLS_DC); -typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg TSRMLS_DC); -typedef void (*llist_apply_func_t)(void * TSRMLS_DC); - -typedef struct _zend_llist { - zend_llist_element *head; - zend_llist_element *tail; - size_t count; - size_t size; - llist_dtor_func_t dtor; - unsigned char persistent; - zend_llist_element *traverse_ptr; -} zend_llist; - -typedef zend_llist_element* zend_llist_position; - -BEGIN_EXTERN_C() -ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent); -ZEND_API void zend_llist_add_element(zend_llist *l, void *element); -ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element); -ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)); -ZEND_API void zend_llist_destroy(zend_llist *l); -ZEND_API void zend_llist_clean(zend_llist *l); -ZEND_API void *zend_llist_remove_tail(zend_llist *l); -ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src); -ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC); -ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)); -ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC); -ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...); -ZEND_API int zend_llist_count(zend_llist *l); -ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC); - -/* traversal */ -ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos); - -#define zend_llist_get_first(l) zend_llist_get_first_ex(l, NULL) -#define zend_llist_get_last(l) zend_llist_get_last_ex(l, NULL) -#define zend_llist_get_next(l) zend_llist_get_next_ex(l, NULL) -#define zend_llist_get_prev(l) zend_llist_get_prev_ex(l, NULL) - -END_EXTERN_C() - -#endif /* ZEND_LLIST_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h deleted file mode 100644 index fb6e00e83ae13..0000000000000 --- a/Zend/zend_modules.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef MODULES_H -#define MODULES_H - -#include "zend.h" -#include "zend_compile.h" - -#define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC -#define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC -#define SHUTDOWN_FUNC_ARGS int type, int module_number TSRMLS_DC -#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC -#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC -#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC - -extern struct _zend_arg_info first_arg_force_ref[2]; -extern struct _zend_arg_info second_arg_force_ref[3]; -extern struct _zend_arg_info third_arg_force_ref[4]; -extern struct _zend_arg_info fourth_arg_force_ref[5]; -extern struct _zend_arg_info fifth_arg_force_ref[6]; -extern struct _zend_arg_info all_args_by_ref[1]; - -#define ZEND_MODULE_API_NO 20060613 -#ifdef ZTS -#define USING_ZTS 1 -#else -#define USING_ZTS 0 -#endif - -#define STANDARD_MODULE_HEADER_EX sizeof(zend_module_entry), ZEND_MODULE_API_NO, ZEND_DEBUG, USING_ZTS -#define STANDARD_MODULE_HEADER \ - STANDARD_MODULE_HEADER_EX, NULL, NULL -#define ZE2_STANDARD_MODULE_HEADER \ - STANDARD_MODULE_HEADER_EX, ini_entries, NULL - -#define STANDARD_MODULE_PROPERTIES_EX 0, 0, NULL, 0 - -#define NO_MODULE_GLOBALS 0, NULL, NULL, NULL - -#ifdef ZTS -# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals_id -#else -# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals -#endif - -#define STANDARD_MODULE_PROPERTIES \ - NO_MODULE_GLOBALS, NULL, STANDARD_MODULE_PROPERTIES_EX - -#define NO_VERSION_YET NULL - -#define MODULE_PERSISTENT 1 -#define MODULE_TEMPORARY 2 - -struct _zend_ini_entry; -typedef struct _zend_module_entry zend_module_entry; -typedef struct _zend_module_dep zend_module_dep; - -struct _zend_module_entry { - unsigned short size; - unsigned int zend_api; - unsigned char zend_debug; - unsigned char zts; - struct _zend_ini_entry *ini_entry; - struct _zend_module_dep *deps; - char *name; - struct _zend_function_entry *functions; - int (*module_startup_func)(INIT_FUNC_ARGS); - int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS); - int (*request_startup_func)(INIT_FUNC_ARGS); - int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS); - void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS); - char *version; - size_t globals_size; -#ifdef ZTS - ts_rsrc_id* globals_id_ptr; -#else - void* globals_ptr; -#endif - void (*globals_ctor)(void *global TSRMLS_DC); - void (*globals_dtor)(void *global TSRMLS_DC); - int (*post_deactivate_func)(void); - int module_started; - unsigned char type; - void *handle; - int module_number; -}; - -#define MODULE_DEP_REQUIRED 1 -#define MODULE_DEP_CONFLICTS 2 -#define MODULE_DEP_OPTIONAL 3 - -#define ZEND_MOD_REQUIRED_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_REQUIRED }, -#define ZEND_MOD_CONFLICTS_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_CONFLICTS }, -#define ZEND_MOD_OPTIONAL_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_OPTIONAL }, - -#define ZEND_MOD_REQUIRED(name) ZEND_MOD_REQUIRED_EX(name, NULL, NULL) -#define ZEND_MOD_CONFLICTS(name) ZEND_MOD_CONFLICTS_EX(name, NULL, NULL) -#define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL) - -struct _zend_module_dep { - char *name; /* module name */ - char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */ - char *version; /* version */ - unsigned char type; /* dependency type */ -}; - -extern ZEND_API HashTable module_registry; - -void module_destructor(zend_module_entry *module); -int module_registry_cleanup(zend_module_entry *module TSRMLS_DC); -int module_registry_request_startup(zend_module_entry *module TSRMLS_DC); -int module_registry_unload_temp(zend_module_entry *module TSRMLS_DC); - -#define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c deleted file mode 100644 index 6f4e86b65a2cc..0000000000000 --- a/Zend/zend_multibyte.c +++ /dev/null @@ -1,1135 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Masaki Fujimoto | - | Rui Hirokawa | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_compile.h" -#include "zend_operators.h" -#include "zend_multibyte.h" - -#ifdef ZEND_MULTIBYTE -static int zend_multibyte_encoding_filter(char **to, int *to_length, const char *to_encoding, const char *from, int from_length, const char *from_encoding TSRMLS_DC); -int sjis_input_filter(char **buf, int *length, const char *sjis, int sjis_length TSRMLS_DC); -int sjis_output_filter(char **buf, int *length, const char *sjis, int sjis_length TSRMLS_DC); -static char* zend_multibyte_assemble_encoding_list(zend_encoding **encoding_list, int encoding_list_size); -static int zend_multibyte_parse_encoding_list(const char *encoding_list, int encoding_list_size, zend_encoding ***result, int *result_size); -static zend_encoding* zend_multibyte_find_script_encoding(zend_encoding *onetime_encoding TSRMLS_DC); -static zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D); -static zend_encoding* zend_multibyte_detect_utf_encoding(char *script, int script_size TSRMLS_DC); - -/* - * encodings - */ -const char *ucs2_aliases[] = {"ISO-10646-UCS-2", "UCS2" , "UNICODE", NULL}; -zend_encoding encoding_ucs2 = { - NULL, - NULL, - "UCS-2", - (const char *(*)[])&ucs2_aliases, - 0 -}; - -zend_encoding encoding_ucs2be = { - NULL, - NULL, - "UCS-2BE", - NULL, - 0 -}; - -zend_encoding encoding_ucs2le = { - NULL, - NULL, - "UCS-2LE", - NULL, - 0 -}; - -const char *ucs4_aliases[] = {"ISO-10646-UCS-4", "UCS4", NULL}; -zend_encoding encoding_ucs4 = { - NULL, - NULL, - "UCS-4", - (const char *(*)[])&ucs4_aliases, - 0 -}; - -zend_encoding encoding_ucs4be = { - NULL, - NULL, - "UCS-4BE", - NULL, - 0 -}; - -zend_encoding encoding_ucs4le = { - NULL, - NULL, - "UCS-4LE", - NULL, - 0 -}; - -const char *utf32_aliases[] = {"utf32", NULL}; -zend_encoding encoding_utf32 = { - NULL, - NULL, - "UTF-32", - (const char *(*)[])&utf32_aliases, - 0 -}; - -zend_encoding encoding_utf32be = { - NULL, - NULL, - "UTF-32BE", - NULL, - 0 -}; - -zend_encoding encoding_utf32le = { - NULL, - NULL, - "UTF-32LE", - NULL, - 0 -}; - -const char *utf16_aliases[] = {"utf16", NULL}; -zend_encoding encoding_utf16 = { - NULL, - NULL, - "UTF-16", - (const char *(*)[])&utf16_aliases, - 0 -}; - -zend_encoding encoding_utf16be = { - NULL, - NULL, - "UTF-16BE", - NULL, - 0 -}; - -zend_encoding encoding_utf16le = { - NULL, - NULL, - "UTF-16LE", - NULL, - 0 -}; - -const char *utf8_aliases[] = {"utf8", NULL}; -zend_encoding encoding_utf8 = { - NULL, - NULL, - "UTF-8", - (const char *(*)[])&utf8_aliases, - 1 -}; - -const char *ascii_aliases[] = {"ANSI_X3.4-1968", "iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991", "US-ASCII", "ISO646-US", "us", "IBM367", "cp367", "csASCII", NULL}; -zend_encoding encoding_ascii = { - NULL, - NULL, - "ASCII", - (const char *(*)[])&ascii_aliases, - 1 -}; - -const char *euc_jp_aliases[] = {"EUC", "EUC_JP", "eucJP", "x-euc-jp", NULL}; -zend_encoding encoding_euc_jp = { - NULL, - NULL, - "EUC-JP", - (const char *(*)[])&euc_jp_aliases, - 1 -}; - -const char *sjis_aliases[] = {"x-sjis", "SJIS", "SHIFT-JIS", NULL}; -zend_encoding encoding_sjis = { - sjis_input_filter, - sjis_output_filter, - "Shift_JIS", - (const char *(*)[])&sjis_aliases, - 0 -}; - -const char *eucjp_win_aliases[] = {"eucJP-open", NULL}; -zend_encoding encoding_eucjp_win = { - NULL, - NULL, - "eucJP-win", - (const char *(*)[])&eucjp_win_aliases, - 1 -}; - -const char *sjis_win_aliases[] = {"SJIS-open", "MS_Kanji", "Windows-31J", "CP932", NULL}; -zend_encoding encoding_sjis_win = { - /* sjis-filters does not care about diffs of Shift_JIS and CP932 */ - sjis_input_filter, - sjis_output_filter, - "SJIS-win", - (const char *(*)[])&sjis_win_aliases, - 0 -}; - -const char *jis_aliases[] = {"ISO-2022-JP", NULL}; -zend_encoding encoding_jis = { - NULL, - NULL, - "JIS", - (const char *(*)[])&jis_aliases, - 0 -}; - -const char *euc_cn_aliases[] = {"CN-GB", "EUC_CN", "eucCN", "x-euc-cn", "gb2312", NULL}; -zend_encoding encoding_euc_cn = { - NULL, - NULL, - "EUC-CN", - (const char *(*)[])&euc_cn_aliases, - 1 -}; - -const char *cp936_aliases[] = {"CP-936", NULL}; -zend_encoding encoding_cp936 = { - NULL, - NULL, - "CP936", - (const char *(*)[])&cp936_aliases, - 0 -}; - -const char *hz_aliases[] = {"HZ-GB-2312", NULL}; -zend_encoding encoding_hz = { - NULL, - NULL, - "HZ", - (const char *(*)[])&hz_aliases, - 0 -}; - -const char *euc_tw_aliases[] = {"EUC_TW", "eucTW", "x-euc-tw", NULL}; -zend_encoding encoding_euc_tw = { - NULL, - NULL, - "EUC-TW", - (const char *(*)[])&euc_tw_aliases, - 1 -}; - -const char *big5_aliases[] = {"BIG5", "CN-BIG5", "BIG-FIVE", "BIGFIVE", "CP950", NULL}; -zend_encoding encoding_big5 = { - NULL, - NULL, - "BIG-5", - (const char *(*)[])&big5_aliases, - 0 -}; - -const char *euc_kr_aliases[] = {"EUC_KR", "eucKR", "x-euc-kr", NULL}; -zend_encoding encoding_euc_kr = { - NULL, - NULL, - "EUC-KR", - (const char *(*)[])&euc_kr_aliases, - 1 -}; - -const char *uhc_aliases[] = {"CP949", NULL}; -zend_encoding encoding_uhc = { - NULL, - NULL, - "UHC", - (const char *(*)[])&uhc_aliases, - 1 -}; - -zend_encoding encoding_2022kr = { - NULL, - NULL, - "ISO-2022-KR", - NULL, - 0 -}; - -const char *cp1252_aliases[] = {"cp1252", NULL}; -zend_encoding encoding_cp1252 = { - NULL, - NULL, - "Windows-1252", - (const char *(*)[])&cp1252_aliases, - 1 -}; - -const char *iso_8859_1_aliases[] = {"ISO_8859-1", "latin1", NULL}; -zend_encoding encoding_8859_1 = { - NULL, - NULL, - "ISO-8859-1", - (const char *(*)[])&iso_8859_1_aliases, - 1 -}; - -const char *iso_8859_2_aliases[] = {"ISO_8859-2", "latin2", NULL}; -zend_encoding encoding_8859_2 = { - NULL, - NULL, - "ISO-8859-2", - (const char *(*)[])&iso_8859_2_aliases, - 1 -}; - -const char *iso_8859_3_aliases[] = {"ISO_8859-3", "latin3", NULL}; -zend_encoding encoding_8859_3 = { - NULL, - NULL, - "ISO-8859-3", - (const char *(*)[])&iso_8859_3_aliases, - 1 -}; - -const char *iso_8859_4_aliases[] = {"ISO_8859-4", "latin4", NULL}; -zend_encoding encoding_8859_4 = { - NULL, - NULL, - "ISO-8859-4", - (const char *(*)[])&iso_8859_4_aliases, - 1 -}; - -const char *iso_8859_5_aliases[] = {"ISO_8859-5", "cyrillic", NULL}; -zend_encoding encoding_8859_5 = { - NULL, - NULL, - "ISO-8859-5", - (const char *(*)[])&iso_8859_5_aliases, - 1 -}; - -const char *iso_8859_6_aliases[] = {"ISO_8859-6", "arabic", NULL}; -zend_encoding encoding_8859_6 = { - NULL, - NULL, - "ISO-8859-6", - (const char *(*)[])&iso_8859_6_aliases, - 1 -}; - -const char *iso_8859_7_aliases[] = {"ISO_8859-7", "greek", NULL}; -zend_encoding encoding_8859_7 = { - NULL, - NULL, - "ISO-8859-7", - (const char *(*)[])&iso_8859_7_aliases, - 1 -}; - -const char *iso_8859_8_aliases[] = {"ISO_8859-8", "hebrew", NULL}; -zend_encoding encoding_8859_8 = { - NULL, - NULL, - "ISO-8859-8", - (const char *(*)[])&iso_8859_8_aliases, - 1 -}; - -const char *iso_8859_9_aliases[] = {"ISO_8859-9", "latin5", NULL}; -zend_encoding encoding_8859_9 = { - NULL, - NULL, - "ISO-8859-9", - (const char *(*)[])&iso_8859_9_aliases, - 1 -}; - -const char *iso_8859_10_aliases[] = {"ISO_8859-10", "latin6", NULL}; -zend_encoding encoding_8859_10 = { - NULL, - NULL, - "ISO-8859-10", - (const char *(*)[])&iso_8859_10_aliases, - 1 -}; - -const char *iso_8859_13_aliases[] = {"ISO_8859-13", NULL}; -zend_encoding encoding_8859_13 = { - NULL, - NULL, - "ISO-8859-13", - (const char *(*)[])&iso_8859_13_aliases, - 1 -}; - -const char *iso_8859_14_aliases[] = {"ISO_8859-14", "latin8", NULL}; -zend_encoding encoding_8859_14 = { - NULL, - NULL, - "ISO-8859-14", - (const char *(*)[])&iso_8859_14_aliases, - 1 -}; - -const char *iso_8859_15_aliases[] = {"ISO_8859-15", NULL}; -zend_encoding encoding_8859_15 = { - NULL, - NULL, - "ISO-8859-15", - (const char *(*)[])&iso_8859_15_aliases, - 1 -}; - -const char *cp1251_aliases[] = {"CP1251", "CP-1251", "WINDOWS-1251", NULL}; -zend_encoding encoding_cp1251 = { - NULL, - NULL, - "Windows-1251", - (const char *(*)[])&cp1251_aliases, - 1 -}; - -const char *cp866_aliases[] = {"CP866", "CP-866", "IBM-866", NULL}; -zend_encoding encoding_cp866 = { - NULL, - NULL, - "CP866", - (const char *(*)[])&cp866_aliases, - 1 -}; - -const char *koi8r_aliases[] = {"KOI8-R", "KOI8R", NULL}; -zend_encoding encoding_koi8r = { - NULL, - NULL, - "KOI8-R", - (const char *(*)[])&koi8r_aliases, - 1 -}; - -zend_encoding *zend_encoding_table[] = { - &encoding_ucs4, - &encoding_ucs4be, - &encoding_ucs4le, - &encoding_ucs2, - &encoding_ucs2be, - &encoding_ucs2le, - &encoding_utf32, - &encoding_utf32be, - &encoding_utf32le, - &encoding_utf16, - &encoding_utf16be, - &encoding_utf16le, - &encoding_utf8, - &encoding_ascii, - &encoding_euc_jp, - &encoding_sjis, - &encoding_eucjp_win, - &encoding_sjis_win, - &encoding_jis, - &encoding_cp1252, - &encoding_8859_1, - &encoding_8859_2, - &encoding_8859_3, - &encoding_8859_4, - &encoding_8859_5, - &encoding_8859_6, - &encoding_8859_7, - &encoding_8859_8, - &encoding_8859_9, - &encoding_8859_10, - &encoding_8859_13, - &encoding_8859_14, - &encoding_8859_15, - &encoding_euc_cn, - &encoding_cp936, - &encoding_hz, - &encoding_euc_tw, - &encoding_big5, - &encoding_euc_kr, - &encoding_uhc, - &encoding_2022kr, - &encoding_cp1251, - &encoding_cp866, - &encoding_koi8r, - NULL -}; - - - -ZEND_API int zend_multibyte_set_script_encoding(char *encoding_list, int encoding_list_size TSRMLS_DC) -{ - if (CG(script_encoding_list)) { - efree(CG(script_encoding_list)); - CG(script_encoding_list) = NULL; - } - CG(script_encoding_list_size) = 0; - - if (!encoding_list) { - return 0; - } - - zend_multibyte_parse_encoding_list(encoding_list, encoding_list_size, &(CG(script_encoding_list)), &(CG(script_encoding_list_size))); - - return 0; -} - - -ZEND_API int zend_multibyte_set_internal_encoding(char *encoding_name, int encoding_name_size TSRMLS_DC) -{ - CG(internal_encoding) = zend_multibyte_fetch_encoding(encoding_name); - return 0; -} - -ZEND_API int zend_multibyte_set_functions(zend_encoding_detector encoding_detector, zend_encoding_converter encoding_converter, zend_encoding_oddlen encoding_oddlen TSRMLS_DC) -{ - CG(encoding_detector) = encoding_detector; - CG(encoding_converter) = encoding_converter; - CG(encoding_oddlen) = encoding_oddlen; - return 0; -} - - -ZEND_API int zend_multibyte_set_filter(zend_encoding *onetime_encoding TSRMLS_DC) -{ - LANG_SCNG(script_encoding) = zend_multibyte_find_script_encoding(onetime_encoding TSRMLS_CC); - LANG_SCNG(internal_encoding) = CG(internal_encoding); - - /* judge input/output filter */ - LANG_SCNG(input_filter) = NULL; - LANG_SCNG(output_filter) = NULL; - - if (!LANG_SCNG(script_encoding)) { - return 0; - } - - if (!LANG_SCNG(internal_encoding) || LANG_SCNG(script_encoding) == LANG_SCNG(internal_encoding)) { - /* if encoding specfic filters exist, use them */ - if (LANG_SCNG(script_encoding)->input_filter && LANG_SCNG(script_encoding)->output_filter) { - LANG_SCNG(input_filter) = LANG_SCNG(script_encoding)->input_filter; - LANG_SCNG(output_filter) = LANG_SCNG(script_encoding)->output_filter; - return 0; - } - - if (!LANG_SCNG(script_encoding)->compatible) { - /* and if not, work around w/ script_encoding -> utf-8 -> script_encoding conversion */ - LANG_SCNG(internal_encoding) = LANG_SCNG(script_encoding); - LANG_SCNG(input_filter) = zend_multibyte_script_encoding_filter; - LANG_SCNG(output_filter) = zend_multibyte_internal_encoding_filter; - return 0; - } else { - /* nothing to do in this case */ - return 0; - } - } - - /* LANG_SCNG(internal_encoding) cannot be NULL here */ - if (LANG_SCNG(internal_encoding)->compatible) { - LANG_SCNG(input_filter) = zend_multibyte_script_encoding_filter; - return 0; - } else if (LANG_SCNG(script_encoding)->compatible) { - LANG_SCNG(output_filter) = zend_multibyte_internal_encoding_filter; - return 0; - } - - /* both script and internal encodings are incompatible w/ flex */ - LANG_SCNG(input_filter) = zend_multibyte_script_encoding_filter; - LANG_SCNG(output_filter) = zend_multibyte_internal_encoding_filter; - - return 0; -} - - -ZEND_API zend_encoding* zend_multibyte_fetch_encoding(char *encoding_name) -{ - int i, j; - zend_encoding *encoding; - - if (!encoding_name) { - return NULL; - } - - for (i = 0; (encoding = zend_encoding_table[i]) != NULL; i++) { - if (zend_binary_strcasecmp((char*)encoding->name, strlen(encoding->name), encoding_name, strlen(encoding_name)) == 0) { - return encoding; - } - } - - for (i = 0; (encoding = zend_encoding_table[i]) != NULL; i++) { - if (encoding->aliases != NULL) { - for (j = 0; (*encoding->aliases)[j] != NULL; j++) { - if (zend_binary_strcasecmp((char*)(*encoding->aliases)[j], strlen((*encoding->aliases)[j]), encoding_name, strlen(encoding_name)) == 0) { - return encoding; - } - } - } - } - - return NULL; -} - - -ZEND_API int zend_multibyte_script_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC) -{ - const char *name; - - if (LANG_SCNG(internal_encoding) == NULL || LANG_SCNG(internal_encoding)->compatible == 0) { - name = "UTF-8"; - } else { - name = LANG_SCNG(internal_encoding)->name; - } - - return zend_multibyte_encoding_filter(to, to_length, name, from, from_length, LANG_SCNG(script_encoding)->name TSRMLS_CC); -} - -ZEND_API int zend_multibyte_internal_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC) -{ - const char *name; - - if (LANG_SCNG(script_encoding)->compatible == 0) { - name = "UTF-8"; - } else { - name = LANG_SCNG(script_encoding)->name; - } - - return zend_multibyte_encoding_filter(to, to_length, LANG_SCNG(internal_encoding)->name, from, from_length, name TSRMLS_CC); -} - -static int zend_multibyte_encoding_filter(char **to, int *to_length, const char *to_encoding, const char *from, int from_length, const char *from_encoding TSRMLS_DC) -{ - int oddlen; - - if (!CG(encoding_converter)) { - return 0; - } - - if (CG(encoding_oddlen)) { - oddlen = CG(encoding_oddlen)(from, from_length, from_encoding TSRMLS_CC); - if (oddlen > 0) { - from_length -= oddlen; - } - } - - if (CG(encoding_converter)(to, to_length, from, from_length, to_encoding, from_encoding TSRMLS_CC) != 0) { - return 0; - } - - return from_length; -} - - -/* - * Shift_JIS Input/Output Filter - */ -static const unsigned char table_sjis[] = { /* 0x80-0x9f,0xE0-0xEF */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 0, 0, 0 -}; - -int sjis_input_filter(char **buf, int *length, const char *sjis, int sjis_length TSRMLS_DC) -{ - unsigned char *p, *q; - unsigned char c1, c2; - - *buf = (char*)emalloc(sjis_length*3/2+1); - if (!*buf) - return 0; - *length = 0; - - p = (unsigned char*)sjis; - q = (unsigned char*)*buf; - - /* convert [SJIS -> EUC-JP] (for lex scan) -- some other better ways? */ - while (*p && (p-(unsigned char*)sjis) < sjis_length) { - if (!(*p & 0x80)) { - *q++ = *p++; - continue; - } - - /* handling 8 bit code */ - if (table_sjis[*p] == 1) { - /* 1 byte kana */ - *q++ = 0x8e; - *q++ = *p++; - continue; - } - - if (!*(p+1)) { - *q++ = *p++; - break; - } - - if (table_sjis[*p] == 2) { - /* 2 byte kanji code */ - c1 = *p++; - if (!*p || (p-(unsigned char*)sjis) >= sjis_length) { - break; - } - c2 = *p++; - c1 -= (c1 <= 0x9f) ? 0x71 : 0xb1; - c1 = (c1 << 1) + 1; - if (c2 >= 0x9e) { - c2 -= 0x7e; - c1++; - } else if (c2 > 0x7f) { - c2 -= 0x20; - } else { - c2 -= 0x1f; - } - - c1 |= 0x80; - c2 |= 0x80; - - *q++ = c1; - *q++ = c2; - } else { - /* - * for user defined chars (ATTENTION) - * - * THESE ARE NOT CODE FOR CONVERSION! :-P - * (using *ILLEGALLY* 3byte EUC-JP space) - * - * we cannot perfectly (== 1 to 1) convert these chars to EUC-JP. - * so, these code are for perfect RESTORING in sjis_output_filter() - */ - c1 = *p++; - if (!*p || (p-(unsigned char*)sjis) >= sjis_length) { - break; - } - c2 = *p++; - *q++ = (char)0x8f; - /* - * MAP TO (EUC-JP): - * type A: 0xeba1 - 0xf4fe - * type B: 0xf5a1 - 0xfefe - * type C: 0xa1a1 - 0xa6fe - */ - c1 -= (c1 > 0xf9) ? (0x79+0x71) : (0x0a+0xb1); - c1 = (c1 << 1) + 1; - if (c2 >= 0x9e) { - c2 -= 0x7e; - c1++; - } else if (c2 > 0x7f) { - c2 -= 0x20; - } else { - c2 -= 0x1f; - } - - c1 |= 0x80; - c2 |= 0x80; - - *q++ = c1; - *q++ = c2; - } - } - *q = (char)NULL; - *length = (char*)q - *buf; - - return *length; -} - -static const unsigned char table_eucjp[] = { /* 0xA1-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -int sjis_output_filter(char **sjis, int *sjis_length, const char *buf, int length TSRMLS_DC) -{ - unsigned char c1, c2; - char *p; - const char *q; - - if (!sjis || !sjis_length) { - return 0; - } - - /* always Shift_JIS <= EUC-JP */ - *sjis = (char*)emalloc(length+1); - if (!sjis) { - return 0; - } - p = *sjis; - q = buf; - - /* restore converted strings [EUC-JP -> Shift_JIS] */ - while (*q) { - if (!(*q & 0x80)) { - *p++ = *q++; - continue; - } - - /* hankaku kana */ - if (*q == (char)0x8e) { - q++; - if (*q) { - *p++ = *q++; - } - continue; - } - - /* 2 byte kanji code */ - if (table_eucjp[(unsigned char)*q] == 2) { - c1 = (*q++ & ~0x80) & 0xff; - if (*q) { - c2 = (*q++ & ~0x80) & 0xff; - } else { - q--; - break; - } - - c2 += (c1 & 0x01) ? 0x1f : 0x7d; - if (c2 >= 0x7f) { - c2++; - } - c1 = ((c1 - 0x21) >> 1) + 0x81; - if (c1 > 0x9f) { - c1 += 0x40; - } - - *p++ = c1; - *p++ = c2; - continue; - } - - if (*q == (char)0x8f) { - q++; - if (*q) { - c1 = (*q++ & ~0x80) & 0xff; - } else { - q--; - break; - } - if (*q) { - c2 = (*q++ & ~0x80) & 0xff; - } else { - q -= 2; - break; - } - - c2 += (c1 & 0x01) ? 0x1f : 0x7d; - if (c2 >= 0x7f) { - c2++; - } - c1 = ((c1 - 0x21) >> 1) + 0x81; - if (c1 > 0x9f) { - c1 += 0x40; - } - - if (c1 >= 0x81 && c1 <= 0x9f) { - c1 += 0x79; - } else { - c1 += 0x0a; - } - - *p++ = c1; - *p++ = c2; - continue; - } - - /* some other chars (may not happen) */ - *p++ = *q++; - } - *p = '\0'; - *sjis_length = p - *sjis; - - return q-buf; /* return length we actually read */ -} - - -static char* zend_multibyte_assemble_encoding_list(zend_encoding **encoding_list, int encoding_list_size) -{ - int i, list_size = 0; - const char *name; - char *list = NULL; - - if (!encoding_list || !encoding_list_size) { - return NULL; - } - - for (i = 0; i < encoding_list_size; i++) { - name = (*(encoding_list+i))->name; - if (name) { - list_size += strlen(name) + 1; - if (!list) { - list = (char*)emalloc(list_size); - if (!list) { - return NULL; - } - *list = (char)NULL; - } else { - list = (char*)erealloc(list, list_size); - if (!list) { - return NULL; - } - strcat(list, ","); - } - strcat(list, name); - } - } - return list; -} - - -static int zend_multibyte_parse_encoding_list(const char *encoding_list, int encoding_list_size, zend_encoding ***result, int *result_size) -{ - int n, size; - char *p, *p1, *p2, *endp, *tmpstr; - zend_encoding **list, **entry, *encoding; - - list = NULL; - if (encoding_list == NULL || encoding_list_size <= 0) { - return -1; - } else { - /* copy the encoding_list string for work */ - tmpstr = (char *)estrndup(encoding_list, encoding_list_size); - if (tmpstr == NULL) { - return -1; - } - /* count the number of listed encoding names */ - endp = tmpstr + encoding_list_size; - n = 1; - p1 = tmpstr; - while ((p2 = zend_memnstr(p1, ",", 1, endp)) != NULL) { - p1 = p2 + 1; - n++; - } - size = n; - /* make list */ - list = (zend_encoding**)ecalloc(size, sizeof(zend_encoding*)); - if (list != NULL) { - entry = list; - n = 0; - p1 = tmpstr; - do { - p2 = p = zend_memnstr(p1, ",", 1, endp); - if (p == NULL) { - p = endp; - } - *p = '\0'; - /* trim spaces */ - while (p1 < p && (*p1 == ' ' || *p1 == '\t')) { - p1++; - } - p--; - while (p > p1 && (*p == ' ' || *p == '\t')) { - *p = '\0'; - p--; - } - /* convert to the encoding number and check encoding */ - encoding = zend_multibyte_fetch_encoding(p1); - if (encoding) - { - *entry++ = encoding; - n++; - } - p1 = p2 + 1; - } while (n < size && p2 != NULL); - *result = list; - *result_size = n; - } - efree(tmpstr); - } - - if (list == NULL) { - return -1; - } - - return 0; -} - - -static zend_encoding* zend_multibyte_find_script_encoding(zend_encoding *onetime_encoding TSRMLS_DC) -{ - zend_encoding *script_encoding; - char *name, *list; - - /* onetime_encoding is prior to everything */ - if (onetime_encoding != NULL) { - return onetime_encoding; - } - - if (CG(detect_unicode)) { - /* check out bom(byte order mark) and see if containing wchars */ - script_encoding = zend_multibyte_detect_unicode(TSRMLS_C); - if (script_encoding != NULL) { - /* bom or wchar detection is prior to 'script_encoding' option */ - return script_encoding; - } - } - - /* if no script_encoding specified, just leave alone */ - if (!CG(script_encoding_list) || !CG(script_encoding_list_size)) { - return NULL; - } - - /* if multiple encodings specified, detect automagically */ - if (CG(script_encoding_list_size) > 1 && CG(encoding_detector)) { - list = zend_multibyte_assemble_encoding_list(CG(script_encoding_list), - CG(script_encoding_list_size)); - name = CG(encoding_detector)(LANG_SCNG(script_org), - LANG_SCNG(script_org_size), list TSRMLS_CC); - if (list) { - efree(list); - } - if (name) { - script_encoding = zend_multibyte_fetch_encoding(name); - efree(name); - } else { - script_encoding = NULL; - } - return script_encoding; - } - - return *(CG(script_encoding_list)); -} - - -static zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D) -{ - zend_encoding *script_encoding = NULL; - int bom_size; - char *script; - - if (LANG_SCNG(script_org_size) < sizeof(BOM_UTF32_LE)-1) { - return NULL; - } - - /* check out BOM */ - if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_BE, sizeof(BOM_UTF32_BE)-1)) { - script_encoding = &encoding_utf32be; - bom_size = sizeof(BOM_UTF32_BE)-1; - } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_LE, sizeof(BOM_UTF32_LE)-1)) { - script_encoding = &encoding_utf32le; - bom_size = sizeof(BOM_UTF32_LE)-1; - } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_BE, sizeof(BOM_UTF16_BE)-1)) { - script_encoding = &encoding_utf16be; - bom_size = sizeof(BOM_UTF16_BE)-1; - } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_LE, sizeof(BOM_UTF16_LE)-1)) { - script_encoding = &encoding_utf16le; - bom_size = sizeof(BOM_UTF16_LE)-1; - } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF8, sizeof(BOM_UTF8)-1)) { - script_encoding = &encoding_utf8; - bom_size = sizeof(BOM_UTF8)-1; - } - - if (script_encoding) { - /* remove BOM */ - script = (char*)emalloc(LANG_SCNG(script_org_size)+1-bom_size); - memcpy(script, LANG_SCNG(script_org)+bom_size, LANG_SCNG(script_org_size)+1-bom_size); - efree(LANG_SCNG(script_org)); - LANG_SCNG(script_org) = script; - LANG_SCNG(script_org_size) -= bom_size; - - return script_encoding; - } - - /* script contains NULL bytes -> auto-detection */ - if (memchr(LANG_SCNG(script_org), 0, LANG_SCNG(script_org_size))) { - /* make best effort if BOM is missing */ - return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size) TSRMLS_CC); - } - - return NULL; -} - -static zend_encoding* zend_multibyte_detect_utf_encoding(char *script, int script_size TSRMLS_DC) -{ - char *p; - int wchar_size = 2; - int le = 0; - - /* utf-16 or utf-32? */ - p = script; - while ((p-script) < script_size) { - p = memchr(p, 0, script_size-(p-script)-2); - if (!p) { - break; - } - if (*(p+1) == (char)NULL && *(p+2) == (char)NULL) { - wchar_size = 4; - break; - } - - /* searching for UTF-32 specific byte orders, so this will do */ - p += 4; - } - - /* BE or LE? */ - p = script; - while ((p-script) < script_size) { - if (*p == (char)NULL && *(p+wchar_size-1) != (char)NULL) { - /* BE */ - le = 0; - break; - } else if (*p != (char)NULL && *(p+wchar_size-1) == (char)NULL) { - /* LE* */ - le = 1; - break; - } - p += wchar_size; - } - - if (wchar_size == 2) { - return le ? &encoding_utf16le : &encoding_utf16be; - } else { - return le ? &encoding_utf32le : &encoding_utf32be; - } - - return NULL; -} -#endif /* ZEND_MULTIBYTE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 tw=78 - * vim<600: sw=4 ts=4 tw=78 - */ diff --git a/Zend/zend_multibyte.h b/Zend/zend_multibyte.h deleted file mode 100644 index df10965d97ed7..0000000000000 --- a/Zend/zend_multibyte.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Masaki Fujimoto | - | Rui Hirokawa | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_MULTIBYTE_H -#define ZEND_MULTIBYTE_H - -#ifdef ZEND_MULTIBYTE - -#define BOM_UTF32_BE "\x00\x00\xfe\xff" -#define BOM_UTF32_LE "\xff\xfe\x00\x00" -#define BOM_UTF16_BE "\xfe\xff" -#define BOM_UTF16_LE "\xff\xfe" -#define BOM_UTF8 "\xef\xbb\xbf" - -typedef int (*zend_encoding_filter)(char **str, int *str_length, const char *buf, int length TSRMLS_DC); - -typedef char* (*zend_encoding_detector)(const char *string, int length, char *list TSRMLS_DC); - -typedef int (*zend_encoding_converter)(char **to, int *to_length, const char *from, int from_length, const char *encoding_to, const char *encoding_from TSRMLS_DC); - -typedef int (*zend_encoding_oddlen)(const char *string, int length, const char *encoding TSRMLS_DC); - -typedef struct _zend_encoding { - zend_encoding_filter input_filter; /* escape input filter */ - zend_encoding_filter output_filter; /* escape output filter */ - const char *name; /* encoding name */ - const char *(*aliases)[]; /* encoding name aliases */ - int compatible; /* flex compatible or not */ -} zend_encoding; - - -/* - * zend multibyte APIs - */ -BEGIN_EXTERN_C() -ZEND_API int zend_multibyte_set_script_encoding(char *encoding_list, int encoding_list_size TSRMLS_DC); -ZEND_API int zend_multibyte_set_internal_encoding(char *encoding_name, int encoding_name_size TSRMLS_DC); -ZEND_API int zend_multibyte_set_functions(zend_encoding_detector encoding_detector, zend_encoding_converter encoding_converter, zend_encoding_oddlen encoding_oddlen TSRMLS_DC); -ZEND_API int zend_multibyte_set_filter(zend_encoding *onetime_encoding TSRMLS_DC); -ZEND_API zend_encoding* zend_multibyte_fetch_encoding(char *encoding_name); -ZEND_API int zend_multibyte_script_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC); -ZEND_API int zend_multibyte_internal_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC); - -/* in zend_language_scanner.l */ -ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC); -ZEND_API int zend_multibyte_yyinput(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC); -ZEND_API int zend_multibyte_read_script(TSRMLS_D); -END_EXTERN_C() - -#endif /* ZEND_MULTIBYTE */ - -#endif /* ZEND_MULTIBYTE_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 tw=78 - * vim<600: sw=4 ts=4 tw=78 - */ diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h deleted file mode 100644 index 0fe9eeba20476..0000000000000 --- a/Zend/zend_multiply.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sascha Schumann | - | Ard Biesheuvel | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#if defined(__i386__) && defined(__GNUC__) - -#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ - long __tmpvar; \ - __asm__ ("imul %3,%0\n" \ - "adc $0,%1" \ - : "=r"(__tmpvar),"=r"(usedval) \ - : "0"(a), "r"(b), "1"(0)); \ - if (usedval) (dval) = (double) (a) * (double) (b); \ - else (lval) = __tmpvar; \ -} while (0) - -#else - -#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ - long __lres = (a) * (b); \ - long double __dres = (long double)(a) * (long double)(b); \ - long double __delta = (long double) __lres - __dres; \ - if ( ((usedval) = (( __dres + __delta ) != __dres))) { \ - (dval) = __dres; \ - } else { \ - (lval) = __lres; \ - } \ -} while (0) - -#endif diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c deleted file mode 100644 index 044f21b92fe8d..0000000000000 --- a/Zend/zend_object_handlers.c +++ /dev/null @@ -1,1201 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_objects.h" -#include "zend_objects_API.h" -#include "zend_object_handlers.h" -#include "zend_interfaces.h" - -#define DEBUG_OBJECT_HANDLERS 0 - -#define Z_OBJ_P(zval_p) zend_objects_get_address(zval_p TSRMLS_CC) - -/* - __X accessors explanation: - - if we have __get and property that is not part of the properties array is - requested, we call __get handler. If it fails, we return uninitialized. - - if we have __set and property that is not part of the properties array is - set, we call __set handler. If it fails, we do not change the array. - - for both handlers above, when we are inside __get/__set, no further calls for - __get/__set for this property of this object will be made, to prevent endless - recursion and enable accessors to change properties array. - - if we have __call and method which is not part of the class function table is - called, we cal __call handler. -*/ - -static HashTable *zend_std_get_properties(zval *object TSRMLS_DC) -{ - zend_object *zobj; - zobj = Z_OBJ_P(object); - return zobj->properties; -} - -static zval *zend_std_call_getter(zval *object, zval *member TSRMLS_DC) -{ - zval *retval = NULL; - zend_class_entry *ce = Z_OBJCE_P(object); - - /* __get handler is called with one argument: - property name - - it should return whether the call was successfull or not - */ - - SEPARATE_ARG_IF_REF(member); - - zend_call_method_with_1_params(&object, ce, &ce->__get, ZEND_GET_FUNC_NAME, &retval, member); - - zval_ptr_dtor(&member); - - if (retval) { - retval->refcount--; - } - - return retval; -} - -static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_DC) -{ - zval *retval = NULL; - int result; - zend_class_entry *ce = Z_OBJCE_P(object); - - SEPARATE_ARG_IF_REF(member); - value->refcount++; - - /* __set handler is called with two arguments: - property name - value to be set - - it should return whether the call was successfull or not - */ - zend_call_method_with_2_params(&object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value); - - zval_ptr_dtor(&member); - zval_ptr_dtor(&value); - - if (retval) { - result = i_zend_is_true(retval) ? SUCCESS : FAILURE; - zval_ptr_dtor(&retval); - return result; - } else { - return FAILURE; - } -} - -static void zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - - /* __unset handler is called with one argument: - property name - */ - - SEPARATE_ARG_IF_REF(member); - - zend_call_method_with_1_params(&object, ce, &ce->__unset, ZEND_UNSET_FUNC_NAME, NULL, member); - - zval_ptr_dtor(&member); -} - -static zval *zend_std_call_issetter(zval *object, zval *member TSRMLS_DC) -{ - zval *retval = NULL; - zend_class_entry *ce = Z_OBJCE_P(object); - - /* __isset handler is called with one argument: - property name - - it should return whether the property is set or not - */ - - SEPARATE_ARG_IF_REF(member); - - zend_call_method_with_1_params(&object, ce, &ce->__isset, ZEND_ISSET_FUNC_NAME, &retval, member); - - zval_ptr_dtor(&member); - - return retval; -} - -static int zend_verify_property_access(zend_property_info *property_info, zend_class_entry *ce TSRMLS_DC) -{ - switch (property_info->flags & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - return 1; - case ZEND_ACC_PROTECTED: - return zend_check_protected(property_info->ce, EG(scope)); - case ZEND_ACC_PRIVATE: - if ((ce==EG(scope) || property_info->ce == EG(scope)) && EG(scope)) { - return 1; - } else { - return 0; - } - break; - } - return 0; -} - -static inline zend_bool is_derived_class(zend_class_entry *child_class, zend_class_entry *parent_class) -{ - child_class = child_class->parent; - while (child_class) { - if (child_class == parent_class) { - return 1; - } - child_class = child_class->parent; - } - - return 0; -} - -ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC) -{ - zend_property_info *property_info = NULL; - zend_property_info *scope_property_info; - zend_bool denied_access = 0; - ulong h; - - if (Z_STRVAL_P(member)[0] == '\0') { - if (!silent) { - if (Z_STRLEN_P(member) == 0) { - zend_error(E_ERROR, "Cannot access empty property"); - } else { - zend_error(E_ERROR, "Cannot access property started with '\\0'"); - } - } - return NULL; - } - h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1); - if (zend_hash_quick_find(&ce->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &property_info)==SUCCESS) { - if(property_info->flags & ZEND_ACC_SHADOW) { - /* if it's a shadow - go to access it's private */ - property_info = NULL; - } else { - if (zend_verify_property_access(property_info, ce TSRMLS_CC)) { - if (property_info->flags & ZEND_ACC_CHANGED - && !(property_info->flags & ZEND_ACC_PRIVATE)) { - /* We still need to make sure that we're not in a context - * where the right property is a different 'statically linked' private - * continue checking below... - */ - } else { - if (!silent && (property_info->flags & ZEND_ACC_STATIC)) { - zend_error(E_STRICT, "Accessing static property %s::$%s as non static", ce->name, Z_STRVAL_P(member)); - } - return property_info; - } - } else { - /* Try to look in the scope instead */ - denied_access = 1; - } - } - } - if (EG(scope) != ce - && is_derived_class(ce, EG(scope)) - && EG(scope) - && zend_hash_quick_find(&EG(scope)->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &scope_property_info)==SUCCESS - && scope_property_info->flags & ZEND_ACC_PRIVATE) { - return scope_property_info; - } else if (property_info) { - if (denied_access) { - /* Information was available, but we were denied access. Error out. */ - if (silent) { - return NULL; - } - zend_error(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ce->name, Z_STRVAL_P(member)); - } else { - /* fall through, return property_info... */ - } - } else { - EG(std_property_info).flags = ZEND_ACC_PUBLIC; - EG(std_property_info).name = Z_STRVAL_P(member); - EG(std_property_info).name_length = Z_STRLEN_P(member); - EG(std_property_info).h = h; - EG(std_property_info).ce = ce; - property_info = &EG(std_property_info); - } - return property_info; -} - - -ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC) -{ - zend_property_info *property_info; - char *class_name, *prop_name; - zval member; - - zend_unmangle_property_name(prop_info_name, prop_info_name_len, &class_name, &prop_name); - ZVAL_STRING(&member, prop_name, 0); - property_info = zend_get_property_info(zobj->ce, &member, 1 TSRMLS_CC); - if (!property_info) { - return FAILURE; - } - if (prop_info_name[0] == '\0' && prop_info_name[1] != '*') { - if (!(property_info->flags & ZEND_ACC_PRIVATE)) { - /* we we're looking for a private prop but found a non private one of the same name */ - return FAILURE; - } else if (strcmp(prop_info_name+1, property_info->name+1)) { - /* we we're looking for a private prop but found a private one of the same name but another class */ - return FAILURE; - } - } - return zend_verify_property_access(property_info, zobj->ce TSRMLS_CC) ? SUCCESS : FAILURE; -} - -static int zend_get_property_guard(zend_object *zobj, zend_property_info *property_info, zval *member, zend_guard **pguard) -{ - zend_property_info info; - zend_guard stub; - - if (!property_info) { - property_info = &info; - info.name = Z_STRVAL_P(member); - info.name_length = Z_STRLEN_P(member); - info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1); - } - if (!zobj->guards) { - ALLOC_HASHTABLE(zobj->guards); - zend_hash_init(zobj->guards, 0, NULL, NULL, 0); - } else if (zend_hash_quick_find(zobj->guards, property_info->name, property_info->name_length+1, property_info->h, (void **) pguard) == SUCCESS) { - return SUCCESS; - } - stub.in_get = 0; - stub.in_set = 0; - stub.in_unset = 0; - stub.in_isset = 0; - return zend_hash_quick_add(zobj->guards, property_info->name, property_info->name_length+1, property_info->h, (void**)&stub, sizeof(stub), (void**) pguard); -} - -zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) -{ - zend_object *zobj; - zval *tmp_member = NULL; - zval **retval; - zval *rv = NULL; - zend_property_info *property_info; - int silent; - - silent = (type == BP_VAR_IS); - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_string(tmp_member); - member = tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Read object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member)); -#endif - - /* make zend_get_property_info silent if we have getter - we may want to use it */ - property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC); - - if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) { - zend_guard *guard; - - if (zobj->ce->__get && - zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS && - !guard->in_get) { - /* have getter - try with it! */ - ZVAL_ADDREF(object); - guard->in_get = 1; /* prevent circular getting */ - rv = zend_std_call_getter(object, member TSRMLS_CC); - guard->in_get = 0; - - if (rv) { - retval = &rv; - if (!rv->is_ref && - (type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET)) { - if (rv->refcount > 0) { - zval *tmp = rv; - - ALLOC_ZVAL(rv); - *rv = *tmp; - zval_copy_ctor(rv); - rv->is_ref = 0; - rv->refcount = 0; - } - if (Z_TYPE_P(rv) != IS_OBJECT) { - zend_error(E_NOTICE, "Indirect modification of overloaded property %s::$%s has no effect", zobj->ce->name, Z_STRVAL_P(member)); - } - } - } else { - retval = &EG(uninitialized_zval_ptr); - } - zval_ptr_dtor(&object); - } else { - if (!silent) { - zend_error(E_NOTICE,"Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member)); - } - retval = &EG(uninitialized_zval_ptr); - } - } - if (tmp_member) { - (*retval)->refcount++; - zval_ptr_dtor(&tmp_member); - (*retval)->refcount--; - } - return *retval; -} - - -static void zend_std_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - zend_object *zobj; - zval *tmp_member = NULL; - zval **variable_ptr; - zend_property_info *property_info; - - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_string(tmp_member); - member = tmp_member; - } - - property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__set != NULL) TSRMLS_CC); - - if (property_info && zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &variable_ptr) == SUCCESS) { - /* if we already have this value there, we don't actually need to do anything */ - if (*variable_ptr != value) { - /* if we are assigning reference, we shouldn't move it, but instead assign variable - to the same pointer */ - if (PZVAL_IS_REF(*variable_ptr)) { - zval garbage = **variable_ptr; /* old value should be destroyed */ - - /* To check: can't *variable_ptr be some system variable like error_zval here? */ - (*variable_ptr)->type = value->type; - (*variable_ptr)->value = value->value; - if (value->refcount>0) { - zval_copy_ctor(*variable_ptr); - } - zval_dtor(&garbage); - } else { - zval *garbage = *variable_ptr; - - /* if we assign referenced variable, we should separate it */ - value->refcount++; - if (PZVAL_IS_REF(value)) { - SEPARATE_ZVAL(&value); - } - *variable_ptr = value; - zval_ptr_dtor(&garbage); - } - } - } else { - int setter_done = 0; - zend_guard *guard; - - if (zobj->ce->__set && - zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS && - !guard->in_set) { - ZVAL_ADDREF(object); - guard->in_set = 1; /* prevent circular setting */ - if (zend_std_call_setter(object, member, value TSRMLS_CC) != SUCCESS) { - /* for now, just ignore it - __set should take care of warnings, etc. */ - } - setter_done = 1; - guard->in_set = 0; - zval_ptr_dtor(&object); - } - if (!setter_done && property_info) { - zval **foo; - - /* if we assign referenced variable, we should separate it */ - value->refcount++; - if (PZVAL_IS_REF(value)) { - SEPARATE_ZVAL(&value); - } - zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &value, sizeof(zval *), (void **) &foo); - } - } - - if (tmp_member) { - zval_ptr_dtor(&tmp_member); - } -} - -zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - zval *retval; - - if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) { - if(offset == NULL) { - /* [] construct */ - ALLOC_INIT_ZVAL(offset); - } else { - SEPARATE_ARG_IF_REF(offset); - } - zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); - - zval_ptr_dtor(&offset); - - if (!retval) { - if (!EG(exception)) { - zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name); - } - return 0; - } - - /* Undo PZVAL_LOCK() */ - retval->refcount--; - - return retval; - } else { - zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name); - return 0; - } -} - - -static void zend_std_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - - if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) { - if (!offset) { - ALLOC_INIT_ZVAL(offset); - } else { - SEPARATE_ARG_IF_REF(offset); - } - zend_call_method_with_2_params(&object, ce, NULL, "offsetset", NULL, offset, value); - zval_ptr_dtor(&offset); - } else { - zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name); - } -} - - -static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - zval *retval; - int result; - - if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) { - SEPARATE_ARG_IF_REF(offset); - zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset); - if (retval) { - result = i_zend_is_true(retval); - zval_ptr_dtor(&retval); - if (check_empty && result && !EG(exception)) { - zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); - if (retval) { - result = i_zend_is_true(retval); - zval_ptr_dtor(&retval); - } - } - } else { - result = 0; - } - zval_ptr_dtor(&offset); - } else { - zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name); - return 0; - } - return result; -} - - -static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) -{ - zend_object *zobj; - zval tmp_member; - zval **retval; - zend_property_info *property_info; - - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Ptr object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member)); -#endif - - property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC); - - if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) { - zval *new_zval; - zend_guard *guard; - - if (!zobj->ce->__get || - zend_get_property_guard(zobj, property_info, member, &guard) != SUCCESS || - guard->in_get) { - /* we don't have access controls - will just add it */ - new_zval = &EG(uninitialized_zval); - -/* zend_error(E_NOTICE, "Undefined property: %s", Z_STRVAL_P(member)); */ - new_zval->refcount++; - zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval); - } else { - /* we do have getter - fail and let it try again with usual get/set */ - retval = NULL; - } - } - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} - - -static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC) -{ - zend_object *zobj; - zval *tmp_member = NULL; - zend_property_info *property_info; - - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_string(tmp_member); - member = tmp_member; - } - - property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__unset != NULL) TSRMLS_CC); - - if (!property_info || zend_hash_del(zobj->properties, property_info->name, property_info->name_length+1) == FAILURE) { - zend_guard *guard; - - if (zobj->ce->__unset && - zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS && - !guard->in_unset) { - /* have unseter - try with it! */ - ZVAL_ADDREF(object); - guard->in_unset = 1; /* prevent circular unsetting */ - zend_std_call_unsetter(object, member TSRMLS_CC); - guard->in_unset = 0; - zval_ptr_dtor(&object); - } - } - - if (tmp_member) { - zval_ptr_dtor(&tmp_member); - } -} - - -static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - - if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) { - SEPARATE_ARG_IF_REF(offset); - zend_call_method_with_1_params(&object, ce, NULL, "offsetunset", NULL, offset); - zval_ptr_dtor(&offset); - } else { - zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name); - } -} - - -ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) -{ - zend_internal_function *func = (zend_internal_function *)EG(function_state_ptr)->function; - zval *method_name_ptr, *method_args_ptr; - zval *method_result_ptr = NULL; - zend_class_entry *ce = Z_OBJCE_P(this_ptr); - - ALLOC_ZVAL(method_args_ptr); - INIT_PZVAL(method_args_ptr); - array_init(method_args_ptr); - - if (zend_copy_parameters_array(ZEND_NUM_ARGS(), method_args_ptr TSRMLS_CC) == FAILURE) { - zval_dtor(method_args_ptr); - zend_error(E_ERROR, "Cannot get arguments for __call"); - RETURN_FALSE; - } - - ALLOC_ZVAL(method_name_ptr); - INIT_PZVAL(method_name_ptr); - ZVAL_STRING(method_name_ptr, func->function_name, 0); /* no dup - it's a copy */ - - /* __call handler is called with two arguments: - method name - array of method parameters - - */ - zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); - - if (method_result_ptr) { - if (method_result_ptr->is_ref || method_result_ptr->refcount > 1) { - RETVAL_ZVAL(method_result_ptr, 1, 1); - } else { - RETVAL_ZVAL(method_result_ptr, 0, 1); - } - } - - /* now destruct all auxiliaries */ - zval_ptr_dtor(&method_args_ptr); - zval_ptr_dtor(&method_name_ptr); - - /* destruct the function also, then - we have allocated it in get_method */ - efree(func); -} - -/* Ensures that we're allowed to call a private method. - * Returns the function address that should be called, or NULL - * if no such function exists. - */ -static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) -{ - if (!ce) { - return 0; - } - - /* We may call a private function if: - * 1. The class of our object is the same as the scope, and the private - * function (EX(fbc)) has the same scope. - * 2. One of our parent classes are the same as the scope, and it contains - * a private function with the same name that has the same scope. - */ - if (fbc->common.scope == ce && EG(scope) == ce) { - /* rule #1 checks out ok, allow the function call */ - return fbc; - } - - - /* Check rule #2 */ - ce = ce->parent; - while (ce) { - if (ce == EG(scope)) { - if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen+1, (void **) &fbc)==SUCCESS - && fbc->op_array.fn_flags & ZEND_ACC_PRIVATE - && fbc->common.scope == EG(scope)) { - return fbc; - } - break; - } - ce = ce->parent; - } - return NULL; -} - - -ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) -{ - return zend_check_private_int(fbc, ce, function_name_strval, function_name_strlen TSRMLS_CC) != NULL; -} - - -/* Ensures that we're allowed to call a protected method. - */ -ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope) -{ - zend_class_entry *fbc_scope = ce; - - /* Is the context that's calling the function, the same as one of - * the function's parents? - */ - while (fbc_scope) { - if (fbc_scope==scope) { - return 1; - } - fbc_scope = fbc_scope->parent; - } - - /* Is the function's scope the same as our current object context, - * or any of the parents of our context? - */ - while (scope) { - if (scope==ce) { - return 1; - } - scope = scope->parent; - } - return 0; -} - - -static inline zend_class_entry * zend_get_function_root_class(zend_function *fbc) -{ - return fbc->common.prototype ? fbc->common.prototype->common.scope : fbc->common.scope; -} - - -static union _zend_function *zend_std_get_method(zval **object_ptr, char *method_name, int method_len TSRMLS_DC) -{ - zend_object *zobj; - zend_function *fbc; - char *lc_method_name; - zval *object = *object_ptr; - ALLOCA_FLAG(use_heap) - - lc_method_name = do_alloca_with_limit(method_len+1, use_heap); - /* Create a zend_copy_str_tolower(dest, src, src_length); */ - zend_str_tolower_copy(lc_method_name, method_name, method_len); - - zobj = Z_OBJ_P(object); - if (zend_hash_find(&zobj->ce->function_table, lc_method_name, method_len+1, (void **)&fbc) == FAILURE) { - free_alloca_with_limit(lc_method_name, use_heap); - if (zobj->ce->__call) { - zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function)); - call_user_call->type = ZEND_INTERNAL_FUNCTION; - call_user_call->module = zobj->ce->module; - call_user_call->handler = zend_std_call_user_call; - call_user_call->arg_info = NULL; - call_user_call->num_args = 0; - call_user_call->scope = zobj->ce; - call_user_call->fn_flags = 0; - call_user_call->function_name = estrndup(method_name, method_len); - call_user_call->pass_rest_by_reference = 0; - call_user_call->return_reference = ZEND_RETURN_VALUE; - - return (union _zend_function *)call_user_call; - } else { - return NULL; - } - } - - /* Check access level */ - if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) { - zend_function *updated_fbc; - - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - updated_fbc = zend_check_private_int(fbc, Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC), lc_method_name, method_len TSRMLS_CC); - if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : ""); - } - fbc = updated_fbc; - } else { - /* Ensure that we haven't overridden a private function and end up calling - * the overriding public function... - */ - if (EG(scope) && - is_derived_class(fbc->common.scope, EG(scope)) && - fbc->op_array.fn_flags & ZEND_ACC_CHANGED) { - zend_function *priv_fbc; - - if (zend_hash_find(&EG(scope)->function_table, lc_method_name, method_len+1, (void **) &priv_fbc)==SUCCESS - && priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE - && priv_fbc->common.scope == EG(scope)) { - fbc = priv_fbc; - } - } - if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(zend_get_function_root_class(fbc), EG(scope))) { - zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - free_alloca_with_limit(lc_method_name, use_heap); - return fbc; -} - - -/* This is not (yet?) in the API, but it belongs in the built-in objects callbacks */ -ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) -{ - zend_function *fbc; - - if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen+1, (void **) &fbc)==FAILURE) { - if (ce->__call && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function)); - - call_user_call->type = ZEND_INTERNAL_FUNCTION; - call_user_call->module = ce->module; - call_user_call->handler = zend_std_call_user_call; - call_user_call->arg_info = NULL; - call_user_call->num_args = 0; - call_user_call->scope = ce; - call_user_call->fn_flags = 0; - call_user_call->function_name = estrndup(function_name_strval, function_name_strlen); - call_user_call->pass_rest_by_reference = 0; - call_user_call->return_reference = ZEND_RETURN_VALUE; - - return (union _zend_function *)call_user_call; - } else { - char *class_name = ce->name; - - if (!class_name) { - class_name = ""; - } - zend_error(E_ERROR, "Call to undefined method %s::%s()", class_name, function_name_strval); - } - } - if (fbc->op_array.fn_flags & ZEND_ACC_PUBLIC) { - /* No further checks necessary, most common case */ - } else if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) { - zend_function *updated_fbc; - - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC); - if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : ""); - } - fbc = updated_fbc; - } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(zend_get_function_root_class(fbc), EG(scope))) { - zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : ""); - } - } - - return fbc; -} - - -ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC) -{ - zval **retval = NULL; - zend_class_entry *tmp_ce = ce; - zend_property_info *property_info; - zend_property_info std_property_info; - - if (zend_hash_find(&ce->properties_info, property_name, property_name_len+1, (void **) &property_info)==FAILURE || (property_info->flags & ZEND_ACC_SHADOW)) { - std_property_info.flags = ZEND_ACC_PUBLIC; - std_property_info.name = property_name; - std_property_info.name_length = property_name_len; - std_property_info.h = zend_get_hash_value(std_property_info.name, std_property_info.name_length+1); - std_property_info.ce = ce; - property_info = &std_property_info; - } - -#if DEBUG_OBJECT_HANDLERS - zend_printf("Access type for %s::%s is %s\n", ce->name, property_name, zend_visibility_string(property_info->flags)); -#endif - - if (!zend_verify_property_access(property_info, ce TSRMLS_CC)) { - if (!silent) { - zend_error(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ce->name, property_name); - } - return NULL; - } - - zend_update_class_constants(tmp_ce TSRMLS_CC); - - zend_hash_quick_find(CE_STATIC_MEMBERS(tmp_ce), property_info->name, property_info->name_length+1, property_info->h, (void **) &retval); - - if (!retval) { - if (silent) { - return NULL; - } else { - zend_error(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name); - } - } - - return retval; -} - - -ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC) -{ - zend_error(E_ERROR, "Attempt to unset static property %s::$%s", ce->name, property_name); - return 0; -} - - -ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC) -{ - zend_object *zobj = Z_OBJ_P(object); - zend_function *constructor = zobj->ce->constructor; - - if (constructor) { - if (constructor->op_array.fn_flags & ZEND_ACC_PUBLIC) { - /* No further checks necessary */ - } else if (constructor->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (constructor->common.scope != EG(scope)) { - if (EG(scope)) { - zend_error(E_ERROR, "Call to private %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope)->name); - } else { - zend_error(E_ERROR, "Call to private %s::%s() from invalid context", constructor->common.scope->name, constructor->common.function_name); - } - } - } else if ((constructor->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(zend_get_function_root_class(constructor), EG(scope))) { - if (EG(scope)) { - zend_error(E_ERROR, "Call to protected %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope)->name); - } else { - zend_error(E_ERROR, "Call to protected %s::%s() from invalid context", constructor->common.scope->name, constructor->common.function_name); - } - } - } - } - - return constructor; -} - - -int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC); - - -static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) -{ - zend_object *zobj1, *zobj2; - - zobj1 = Z_OBJ_P(o1); - zobj2 = Z_OBJ_P(o2); - - if (zobj1->ce != zobj2->ce) { - return 1; /* different classes */ - } - return zend_compare_symbol_tables_i(zobj1->properties, zobj2->properties TSRMLS_CC); -} - -static int zend_std_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) -{ - zend_object *zobj; - int result; - zval **value; - zval *tmp_member = NULL; - zend_property_info *property_info; - - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_string(tmp_member); - member = tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Read object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member)); -#endif - - property_info = zend_get_property_info(zobj->ce, member, 1 TSRMLS_CC); - - if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &value) == FAILURE) { - zend_guard *guard; - - result = 0; - if ((has_set_exists != 2) && - zobj->ce->__isset && - zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS && - !guard->in_isset) { - zval *rv; - - /* have issetter - try with it! */ - ZVAL_ADDREF(object); - guard->in_isset = 1; /* prevent circular getting */ - rv = zend_std_call_issetter(object, member TSRMLS_CC); - if (rv) { - result = zend_is_true(rv); - zval_ptr_dtor(&rv); - if (has_set_exists && result && !EG(exception) && zobj->ce->__get && !guard->in_get) { - guard->in_get = 1; - rv = zend_std_call_getter(object, member TSRMLS_CC); - guard->in_get = 0; - if (rv) { - rv->refcount++; - result = i_zend_is_true(rv); - zval_ptr_dtor(&rv); - } - } - } - guard->in_isset = 0; - zval_ptr_dtor(&object); - } - } else { - switch (has_set_exists) { - case 0: - result = (Z_TYPE_PP(value) != IS_NULL); - break; - default: - result = zend_is_true(*value); - break; - case 2: - result = 1; - break; - } - } - - if (tmp_member) { - zval_ptr_dtor(&tmp_member); - } - return result; -} - - -zend_class_entry *zend_std_object_get_class(zval *object TSRMLS_DC) -{ - zend_object *zobj; - zobj = Z_OBJ_P(object); - - return zobj->ce; -} - -int zend_std_object_get_class_name(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) -{ - zend_object *zobj; - zend_class_entry *ce; - zobj = Z_OBJ_P(object); - - if (parent) { - if (!zobj->ce->parent) { - return FAILURE; - } - ce = zobj->ce->parent; - } else { - ce = zobj->ce; - } - - *class_name_len = ce->name_length; - *class_name = estrndup(ce->name, ce->name_length); - return SUCCESS; -} - -ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC) -{ - zval *retval; - zend_class_entry *ce; - - switch (type) { - case IS_STRING: - ce = Z_OBJCE_P(readobj); - if (ce->__tostring && - (zend_call_method_with_0_params(&readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) { - if (EG(exception)) { - if (retval) { - zval_ptr_dtor(&retval); - } - zend_error(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name); - return FAILURE; - } - if (Z_TYPE_P(retval) == IS_STRING) { - INIT_PZVAL(writeobj); - if (readobj == writeobj) { - zval_dtor(readobj); - } - ZVAL_ZVAL(writeobj, retval, 1, 1); - if (Z_TYPE_P(writeobj) != type) { - convert_to_explicit_type(writeobj, type); - } - return SUCCESS; - } else { - zval_ptr_dtor(&retval); - INIT_PZVAL(writeobj); - if (readobj == writeobj) { - zval_dtor(readobj); - } - ZVAL_EMPTY_STRING(writeobj); - zend_error(E_RECOVERABLE_ERROR, "Method %s::__toString() must return a string value", ce->name); - return SUCCESS; - } - } - return FAILURE; - case IS_BOOL: - INIT_PZVAL(writeobj); - ZVAL_BOOL(writeobj, 1); - return SUCCESS; - case IS_LONG: - ce = Z_OBJCE_P(readobj); - zend_error(E_NOTICE, "Object of class %s could not be converted to int", ce->name); - INIT_PZVAL(writeobj); - if (readobj == writeobj) { - zval_dtor(readobj); - } - ZVAL_LONG(writeobj, 1); - return SUCCESS; - case IS_DOUBLE: - ce = Z_OBJCE_P(readobj); - zend_error(E_NOTICE, "Object of class %s could not be converted to double", ce->name); - INIT_PZVAL(writeobj); - if (readobj == writeobj) { - zval_dtor(readobj); - } - ZVAL_DOUBLE(writeobj, 1); - return SUCCESS; - default: - INIT_PZVAL(writeobj); - Z_TYPE_P(writeobj) = IS_NULL; - break; - } - return FAILURE; -} - - -ZEND_API zend_object_handlers std_object_handlers = { - zend_objects_store_add_ref, /* add_ref */ - zend_objects_store_del_ref, /* del_ref */ - zend_objects_clone_obj, /* clone_obj */ - - zend_std_read_property, /* read_property */ - zend_std_write_property, /* write_property */ - zend_std_read_dimension, /* read_dimension */ - zend_std_write_dimension, /* write_dimension */ - zend_std_get_property_ptr_ptr, /* get_property_ptr_ptr */ - NULL, /* get */ - NULL, /* set */ - zend_std_has_property, /* has_property */ - zend_std_unset_property, /* unset_property */ - zend_std_has_dimension, /* has_dimension */ - zend_std_unset_dimension, /* unset_dimension */ - zend_std_get_properties, /* get_properties */ - zend_std_get_method, /* get_method */ - NULL, /* call_method */ - zend_std_get_constructor, /* get_constructor */ - zend_std_object_get_class, /* get_class_entry */ - zend_std_object_get_class_name, /* get_class_name */ - zend_std_compare_objects, /* compare_objects */ - zend_std_cast_object_tostring, /* cast_object */ - NULL, /* count_elements */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h deleted file mode 100644 index b475cc504a65a..0000000000000 --- a/Zend/zend_object_handlers.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OBJECT_HANDLERS_H -#define ZEND_OBJECT_HANDLERS_H - -union _zend_function; -struct _zend_property_info; - -/* The following rule applies to read_property() and read_dimension() implementations: - If you return a zval which is not otherwise referenced by the extension or the engine's - symbol table, its reference count should be 0. -*/ -/* Used to fetch property from the object, read-only */ -typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type TSRMLS_DC); - -/* Used to fetch dimension from the object, read-only */ -typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC); - - -/* The following rule applies to write_property() and write_dimension() implementations: - If you receive a value zval in write_property/write_dimension, you may only modify it if - its reference count is 1. Otherwise, you must create a copy of that zval before making - any changes. You should NOT modify the reference count of the value passed to you. -*/ -/* Used to set property of the object */ -typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC); - -/* Used to set dimension of the object */ -typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC); - - -/* Used to create pointer to the property of the object, for future direct r/w access */ -typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member TSRMLS_DC); - -/* Used to set object value. Can be used to override assignments and scalar - write ops (like ++, +=) on the object */ -typedef void (*zend_object_set_t)(zval **object, zval *value TSRMLS_DC); - -/* Used to get object value. Can be used when converting object value to - * one of the basic types and when using scalar ops (like ++, +=) on the object - */ -typedef zval* (*zend_object_get_t)(zval *object TSRMLS_DC); - -/* Used to check if a property of the object exists */ -/* param has_set_exists: - * 0 (has) whether property exists and is not NULL - * 1 (set) whether property exists and is true - * 2 (exists) whether property exists - */ -typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists TSRMLS_DC); - -/* Used to check if a dimension of the object exists */ -typedef int (*zend_object_has_dimension_t)(zval *object, zval *member, int check_empty TSRMLS_DC); - -/* Used to remove a property of the object */ -typedef void (*zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC); - -/* Used to remove a dimension of the object */ -typedef void (*zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC); - -/* Used to get hash of the properties of the object, as hash of zval's */ -typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC); - -/* Used to call methods */ -/* args on stack! */ -/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this. - */ -typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS); -typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, int method_len TSRMLS_DC); -typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC); - -/* Object maintenance/destruction */ -typedef void (*zend_object_add_ref_t)(zval *object TSRMLS_DC); -typedef void (*zend_object_del_ref_t)(zval *object TSRMLS_DC); -typedef void (*zend_object_delete_obj_t)(zval *object TSRMLS_DC); -typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC); - -typedef zend_class_entry *(*zend_object_get_class_entry_t)(zval *object TSRMLS_DC); -typedef int (*zend_object_get_class_name_t)(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC); -typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC); - -/* Cast an object to some other type - */ -typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC); - -/* updates *count to hold the number of elements present and returns SUCCESS. - * Returns FAILURE if the object does not have any sense of overloaded dimensions */ -typedef int (*zend_object_count_elements_t)(zval *object, long *count TSRMLS_DC); - -struct _zend_object_handlers { - /* general object functions */ - zend_object_add_ref_t add_ref; - zend_object_del_ref_t del_ref; - zend_object_clone_obj_t clone_obj; - /* individual object functions */ - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_read_dimension_t read_dimension; - zend_object_write_dimension_t write_dimension; - zend_object_get_property_ptr_ptr_t get_property_ptr_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_has_dimension_t has_dimension; - zend_object_unset_dimension_t unset_dimension; - zend_object_get_properties_t get_properties; - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_entry_t get_class_entry; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; - zend_object_cast_t cast_object; - zend_object_count_elements_t count_elements; -}; - -extern ZEND_API zend_object_handlers std_object_handlers; - -BEGIN_EXTERN_C() -ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC); -ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC); -ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC); -ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC); -ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC); - -ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC); - - -#define IS_ZEND_STD_OBJECT(z) (Z_TYPE(z) == IS_OBJECT && (Z_OBJ_HT((z))->get_class_entry != NULL)) -#define HAS_CLASS_ENTRY(z) (Z_OBJ_HT(z)->get_class_entry != NULL) - -ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC); - -ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope); - -ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC); - -ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS); -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c deleted file mode 100644 index d3313b6c22b38..0000000000000 --- a/Zend/zend_objects.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_interfaces.h" -#include "zend_exceptions.h" - -ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC) -{ - ALLOC_HASHTABLE(object->properties); - zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - - object->ce = ce; - object->guards = NULL; -} - -ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC) -{ - if (object->guards) { - zend_hash_destroy(object->guards); - FREE_HASHTABLE(object->guards); - } - if (object->properties) { - zend_hash_destroy(object->properties); - FREE_HASHTABLE(object->properties); - } -} - -ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC) -{ - zend_function *destructor = object->ce->destructor; - - if (destructor) { - zval *obj; - zval *old_exception; - - if (destructor->op_array.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) { - if (destructor->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (object->ce != EG(scope)) { - zend_class_entry *ce = object->ce; - - zend_error(EG(in_execution) ? E_ERROR : E_WARNING, - "Call to private %s::__destruct() from context '%s'%s", - ce->name, - EG(scope) ? EG(scope)->name : "", - EG(in_execution) ? "" : " during shutdown ignored"); - return; - } - } else { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(destructor->common.scope, EG(scope))) { - zend_class_entry *ce = object->ce; - - zend_error(EG(in_execution) ? E_ERROR : E_WARNING, - "Call to protected %s::__destruct() from context '%s'%s", - ce->name, - EG(scope) ? EG(scope)->name : "", - EG(in_execution) ? "" : " during shutdown ignored"); - return; - } - } - } - - MAKE_STD_ZVAL(obj); - Z_TYPE_P(obj) = IS_OBJECT; - Z_OBJ_HANDLE_P(obj) = handle; - /* TODO: We cannot set proper handlers. */ - Z_OBJ_HT_P(obj) = &std_object_handlers; - zval_copy_ctor(obj); - - /* Make sure that destructors are protected from previously thrown exceptions. - * For example, if an exception was thrown in a function and when the function's - * local variable destruction results in a destructor being called. - */ - old_exception = EG(exception); - EG(exception) = NULL; - zend_call_method_with_0_params(&obj, object->ce, &destructor, ZEND_DESTRUCTOR_FUNC_NAME, NULL); - if (old_exception) { - if (EG(exception)) { - zend_class_entry *default_exception_ce = zend_exception_get_default(TSRMLS_C); - zval *file = zend_read_property(default_exception_ce, old_exception, "file", sizeof("file")-1, 1 TSRMLS_CC); - zval *line = zend_read_property(default_exception_ce, old_exception, "line", sizeof("line")-1, 1 TSRMLS_CC); - - zval_ptr_dtor(&obj); - zval_ptr_dtor(&EG(exception)); - EG(exception) = old_exception; - zend_error(E_ERROR, "Ignoring exception from %s::__destruct() while an exception is already active (Uncaught %s in %s on line %ld)", - object->ce->name, Z_OBJCE_P(old_exception)->name, Z_STRVAL_P(file), Z_LVAL_P(line)); - } - EG(exception) = old_exception; - } - zval_ptr_dtor(&obj); - } -} - -ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC) -{ - zend_object_std_dtor(object TSRMLS_CC); - efree(object); -} - -ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - - *object = emalloc(sizeof(zend_object)); - (*object)->ce = class_type; - retval.handle = zend_objects_store_put(*object, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) zend_objects_free_object_storage, NULL TSRMLS_CC); - retval.handlers = &std_object_handlers; - (*object)->guards = NULL; - return retval; -} - -ZEND_API zend_object *zend_objects_get_address(zval *zobject TSRMLS_DC) -{ - return (zend_object *)zend_object_store_get_object(zobject TSRMLS_CC); -} - -static void zval_add_ref_or_clone(zval **p) -{ - if (Z_TYPE_PP(p) == IS_OBJECT && !PZVAL_IS_REF(*p)) { - TSRMLS_FETCH(); - - if (Z_OBJ_HANDLER_PP(p, clone_obj) == NULL) { - zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_PP(p)->name); - } else { - zval *orig = *p; - - ALLOC_ZVAL(*p); - **p = *orig; - INIT_PZVAL(*p); - (*p)->value.obj = Z_OBJ_HT_PP(p)->clone_obj(orig TSRMLS_CC); - } - } else { - (*p)->refcount++; - } -} - -ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC) -{ - if (EG(ze1_compatibility_mode)) { - zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref_or_clone, (void *) NULL /* Not used anymore */, sizeof(zval *)); - } else { - zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *)); - } - if (old_object->ce->clone) { - zval *new_obj; - - MAKE_STD_ZVAL(new_obj); - new_obj->type = IS_OBJECT; - new_obj->value.obj = new_obj_val; - zval_copy_ctor(new_obj); - - zend_call_method_with_0_params(&new_obj, old_object->ce, &old_object->ce->clone, ZEND_CLONE_FUNC_NAME, NULL); - - zval_ptr_dtor(&new_obj); - } -} - -ZEND_API zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC) -{ - zend_object_value new_obj_val; - zend_object *old_object; - zend_object *new_object; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - /* assume that create isn't overwritten, so when clone depends on the - * overwritten one then it must itself be overwritten */ - old_object = zend_objects_get_address(zobject TSRMLS_CC); - new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC); - - ALLOC_HASHTABLE(new_object->properties); - zend_hash_init(new_object->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - - zend_objects_clone_members(new_object, new_obj_val, old_object, handle TSRMLS_CC); - - return new_obj_val; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects.h b/Zend/zend_objects.h deleted file mode 100644 index 74081731435de..0000000000000 --- a/Zend/zend_objects.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OBJECTS_H -#define ZEND_OBJECTS_H - -#include "zend.h" - -BEGIN_EXTERN_C() -ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC); -ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC); -ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC); -ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC); -ZEND_API zend_object *zend_objects_get_address(zval *object TSRMLS_DC); -ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC); -ZEND_API zend_object_value zend_objects_clone_obj(zval *object TSRMLS_DC); -ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC); -END_EXTERN_C() - -#endif /* ZEND_OBJECTS_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c deleted file mode 100644 index 4983d6af97837..0000000000000 --- a/Zend/zend_objects_API.c +++ /dev/null @@ -1,393 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_objects_API.h" - -#define ZEND_DEBUG_OBJECTS 0 - -ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size) -{ - objects->object_buckets = (zend_object_store_bucket *) emalloc(init_size * sizeof(zend_object_store_bucket)); - objects->top = 1; /* Skip 0 so that handles are true */ - objects->size = init_size; - objects->free_list_head = -1; - memset(&objects->object_buckets[0], 0, sizeof(zend_object_store_bucket)); -} - -ZEND_API void zend_objects_store_destroy(zend_objects_store *objects) -{ - efree(objects->object_buckets); - objects->object_buckets = NULL; -} - -ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC) -{ - zend_uint i = 1; - - for (i = 1; i < objects->top ; i++) { - if (objects->object_buckets[i].valid) { - struct _store_object *obj = &objects->object_buckets[i].bucket.obj; - - if (!objects->object_buckets[i].destructor_called) { - objects->object_buckets[i].destructor_called = 1; - if (obj->dtor && obj->object) { - obj->refcount++; - obj->dtor(obj->object, i TSRMLS_CC); - obj->refcount--; - } - } - } - } -} - -ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC) -{ - zend_uint i; - - if (!objects->object_buckets) { - return; - } - for (i = 1; i < objects->top ; i++) { - if (objects->object_buckets[i].valid) { - objects->object_buckets[i].destructor_called = 1; - } - } -} - -ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC) -{ - zend_uint i = 1; - - for (i = 1; i < objects->top ; i++) { - if (objects->object_buckets[i].valid) { - struct _store_object *obj = &objects->object_buckets[i].bucket.obj; - - objects->object_buckets[i].valid = 0; - if (obj->free_storage) { - obj->free_storage(obj->object TSRMLS_CC); - } - /* Not adding to free list as we are shutting down anyway */ - } - } -} - - -/* Store objects API */ - -ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_store_dtor_t dtor, zend_objects_free_object_storage_t free_storage, zend_objects_store_clone_t clone TSRMLS_DC) -{ - zend_object_handle handle; - struct _store_object *obj; - - if (EG(objects_store).free_list_head != -1) { - handle = EG(objects_store).free_list_head; - EG(objects_store).free_list_head = EG(objects_store).object_buckets[handle].bucket.free_list.next; - } else { - if (EG(objects_store).top == EG(objects_store).size) { - EG(objects_store).size <<= 1; - EG(objects_store).object_buckets = (zend_object_store_bucket *) erealloc(EG(objects_store).object_buckets, EG(objects_store).size * sizeof(zend_object_store_bucket)); - } - handle = EG(objects_store).top++; - } - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - EG(objects_store).object_buckets[handle].destructor_called = 0; - EG(objects_store).object_buckets[handle].valid = 1; - - obj->refcount = 1; - obj->object = object; - obj->dtor = dtor?dtor:(zend_objects_store_dtor_t)zend_objects_destroy_object; - obj->free_storage = free_storage; - - obj->clone = clone; - -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Allocated object id #%d\n", handle); -#endif - return handle; -} - -ZEND_API zend_uint zend_objects_store_get_refcount(zval *object TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(object); - - return EG(objects_store).object_buckets[handle].bucket.obj.refcount; -} - -ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(object); - - EG(objects_store).object_buckets[handle].bucket.obj.refcount++; -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Increased refcount of object id #%d\n", handle); -#endif -} - -/* - * Add a reference to an objects store entry given the object handle. - */ -ZEND_API void zend_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC) -{ - EG(objects_store).object_buckets[handle].bucket.obj.refcount++; -} - -#define ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST() \ - EG(objects_store).object_buckets[handle].bucket.free_list.next = EG(objects_store).free_list_head; \ - EG(objects_store).free_list_head = handle; \ - EG(objects_store).object_buckets[handle].valid = 0; - -ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle; - - handle = Z_OBJ_HANDLE_P(zobject); - - zobject->refcount++; - zend_objects_store_del_ref_by_handle(handle TSRMLS_CC); - zobject->refcount--; -} - -/* - * Delete a reference to an objects store entry given the object handle. - */ -ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSRMLS_DC) -{ - struct _store_object *obj; - int failure = 0; - - if (!EG(objects_store).object_buckets) { - return; - } - - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - - /* Make sure we hold a reference count during the destructor call - otherwise, when the destructor ends the storage might be freed - when the refcount reaches 0 a second time - */ - if (EG(objects_store).object_buckets[handle].valid) { - if (obj->refcount == 1) { - if (!EG(objects_store).object_buckets[handle].destructor_called) { - EG(objects_store).object_buckets[handle].destructor_called = 1; - - if (obj->dtor) { - zend_try { - obj->dtor(obj->object, handle TSRMLS_CC); - } zend_catch { - failure = 1; - } zend_end_try(); - } - } - if (obj->refcount == 1) { - if (obj->free_storage) { - zend_try { - obj->free_storage(obj->object TSRMLS_CC); - } zend_catch { - failure = 1; - } zend_end_try(); - } - ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(); - } - } - } - - obj->refcount--; - -#if ZEND_DEBUG_OBJECTS - if (obj->refcount == 0) { - fprintf(stderr, "Deallocated object id #%d\n", handle); - } else { - fprintf(stderr, "Decreased refcount of object id #%d\n", handle); - } -#endif - if (failure) { - zend_bailout(); - } -} - -ZEND_API zend_object_value zend_objects_store_clone_obj(zval *zobject TSRMLS_DC) -{ - zend_object_value retval; - void *new_object; - struct _store_object *obj; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - - if (obj->clone == NULL) { - zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %s", Z_OBJCE_P(zobject)->name); - } - - obj->clone(obj->object, &new_object TSRMLS_CC); - - retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC); - retval.handlers = Z_OBJ_HT_P(zobject); - - return retval; -} - -ZEND_API void *zend_object_store_get_object(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - return EG(objects_store).object_buckets[handle].bucket.obj.object; -} - -/* - * Retrieve an entry from the objects store given the object handle. - */ -ZEND_API void *zend_object_store_get_object_by_handle(zend_object_handle handle TSRMLS_DC) -{ - return EG(objects_store).object_buckets[handle].bucket.obj.object; -} - -/* zend_object_store_set_object: - * It is ONLY valid to call this function from within the constructor of an - * overloaded object. Its purpose is to set the object pointer for the object - * when you can't possibly know its value until you have parsed the arguments - * from the constructor function. You MUST NOT use this function for any other - * weird games, or call it at any other time after the object is constructed. - * */ -ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - EG(objects_store).object_buckets[handle].bucket.obj.object = object; -} - - -/* Called when the ctor was terminated by an exception */ -ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - EG(objects_store).object_buckets[handle].destructor_called = 1; -} - - -/* Proxy objects workings */ -typedef struct _zend_proxy_object { - zval *object; - zval *property; -} zend_proxy_object; - -static zend_object_handlers zend_object_proxy_handlers; - -ZEND_API void zend_objects_proxy_free_storage(zend_proxy_object *object TSRMLS_DC) -{ - zval_ptr_dtor(&object->object); - zval_ptr_dtor(&object->property); - efree(object); -} - -ZEND_API void zend_objects_proxy_clone(zend_proxy_object *object, zend_proxy_object **object_clone TSRMLS_DC) -{ - *object_clone = emalloc(sizeof(zend_proxy_object)); - (*object_clone)->object = object->object; - (*object_clone)->property = object->property; - zval_add_ref(&(*object_clone)->property); - zval_add_ref(&(*object_clone)->object); -} - -ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC) -{ - zend_proxy_object *pobj = emalloc(sizeof(zend_proxy_object)); - zval *retval; - - pobj->object = object; - pobj->property = member; - zval_add_ref(&pobj->property); - zval_add_ref(&pobj->object); - - MAKE_STD_ZVAL(retval); - Z_TYPE_P(retval) = IS_OBJECT; - Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(pobj, NULL, (zend_objects_free_object_storage_t) zend_objects_proxy_free_storage, (zend_objects_store_clone_t) zend_objects_proxy_clone TSRMLS_CC); - Z_OBJ_HT_P(retval) = &zend_object_proxy_handlers; - - return retval; -} - -ZEND_API void zend_object_proxy_set(zval **property, zval *value TSRMLS_DC) -{ - zend_proxy_object *probj = zend_object_store_get_object(*property TSRMLS_CC); - - if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->write_property) { - Z_OBJ_HT_P(probj->object)->write_property(probj->object, probj->property, value TSRMLS_CC); - } else { - zend_error(E_WARNING, "Cannot write property of object - no write handler defined"); - } -} - -ZEND_API zval* zend_object_proxy_get(zval *property TSRMLS_DC) -{ - zend_proxy_object *probj = zend_object_store_get_object(property TSRMLS_CC); - - if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->read_property) { - return Z_OBJ_HT_P(probj->object)->read_property(probj->object, probj->property, BP_VAR_R TSRMLS_CC); - } else { - zend_error(E_WARNING, "Cannot read property of object - no read handler defined"); - } - - return NULL; -} - -ZEND_API zend_object_handlers *zend_get_std_object_handlers(void) -{ - return &std_object_handlers; -} - -static zend_object_handlers zend_object_proxy_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - - NULL, /* read_property */ - NULL, /* write_property */ - NULL, /* read dimension */ - NULL, /* write_dimension */ - NULL, /* get_property_ptr_ptr */ - zend_object_proxy_get, /* get */ - zend_object_proxy_set, /* set */ - NULL, /* has_property */ - NULL, /* unset_property */ - NULL, /* has_dimension */ - NULL, /* unset_dimension */ - NULL, /* get_properties */ - NULL, /* get_method */ - NULL, /* call_method */ - NULL, /* get_constructor */ - NULL, /* get_class_entry */ - NULL, /* get_class_name */ - NULL, /* compare_objects */ - NULL, /* cast_object */ - NULL, /* count_elements */ -}; - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h deleted file mode 100644 index 4062ebdb2e920..0000000000000 --- a/Zend/zend_objects_API.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OBJECTS_API_H -#define ZEND_OBJECTS_API_H - -#include "zend.h" - -typedef void (*zend_objects_store_dtor_t)(void *object, zend_object_handle handle TSRMLS_DC); -typedef void (*zend_objects_free_object_storage_t)(void *object TSRMLS_DC); -typedef void (*zend_objects_store_clone_t)(void *object, void **object_clone TSRMLS_DC); - -typedef struct _zend_object_store_bucket { - zend_bool destructor_called; - zend_bool valid; - union _store_bucket { - struct _store_object { - void *object; - zend_objects_store_dtor_t dtor; - zend_objects_free_object_storage_t free_storage; - zend_objects_store_clone_t clone; - zend_uint refcount; - } obj; - struct { - int next; - } free_list; - } bucket; -} zend_object_store_bucket; - -typedef struct _zend_objects_store { - zend_object_store_bucket *object_buckets; - zend_uint top; - zend_uint size; - int free_list_head; -} zend_objects_store; - -/* Global store handling functions */ -BEGIN_EXTERN_C() -ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size); -ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC); -ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC); -ZEND_API void zend_objects_store_destroy(zend_objects_store *objects); - -/* Store API functions */ -ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_store_dtor_t dtor, zend_objects_free_object_storage_t storage, zend_objects_store_clone_t clone TSRMLS_DC); - -ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC); -ZEND_API void zend_objects_store_del_ref(zval *object TSRMLS_DC); -ZEND_API void zend_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC); -ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSRMLS_DC); -ZEND_API zend_uint zend_objects_store_get_refcount(zval *object TSRMLS_DC); -ZEND_API zend_object_value zend_objects_store_clone_obj(zval *object TSRMLS_DC); -ZEND_API void *zend_object_store_get_object(zval *object TSRMLS_DC); -ZEND_API void *zend_object_store_get_object_by_handle(zend_object_handle handle TSRMLS_DC); -/* See comment in zend_objects_API.c before you use this */ -ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC); -ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC); - -ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC); - -#define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_clone_obj - -ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC); - -ZEND_API zend_object_handlers *zend_get_std_object_handlers(void); -END_EXTERN_C() - -#endif /* ZEND_OBJECTS_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c deleted file mode 100644 index 32289435b604e..0000000000000 --- a/Zend/zend_opcode.c +++ /dev/null @@ -1,509 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include - -#include "zend.h" -#include "zend_alloc.h" -#include "zend_compile.h" -#include "zend_extensions.h" -#include "zend_API.h" - -#include "zend_vm.h" - -static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_ctor) { - extension->op_array_ctor(op_array); - } -} - -static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_dtor) { - extension->op_array_dtor(op_array); - } -} - -static void op_array_alloc_ops(zend_op_array *op_array) -{ - op_array->opcodes = erealloc(op_array->opcodes, (op_array->size)*sizeof(zend_op)); -} - -void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size TSRMLS_DC) -{ - op_array->type = type; - - op_array->backpatch_count = 0; - if (CG(interactive)) { - /* We must avoid a realloc() on the op_array in interactive mode, since pointers to constants - * will become invalid - */ - initial_ops_size = 8192; - } - - op_array->refcount = (zend_uint *) emalloc(sizeof(zend_uint)); - *op_array->refcount = 1; - op_array->size = initial_ops_size; - op_array->last = 0; - op_array->opcodes = NULL; - op_array_alloc_ops(op_array); - - op_array->size_var = 0; /* FIXME:??? */ - op_array->last_var = 0; - op_array->vars = NULL; - - op_array->T = 0; - - op_array->function_name = NULL; - op_array->filename = zend_get_compiled_filename(TSRMLS_C); - op_array->doc_comment = NULL; - op_array->doc_comment_len = 0; - - op_array->arg_info = NULL; - op_array->num_args = 0; - op_array->required_num_args = 0; - - op_array->scope = NULL; - - op_array->brk_cont_array = NULL; - op_array->try_catch_array = NULL; - op_array->last_brk_cont = 0; - op_array->current_brk_cont = -1; - - op_array->static_variables = NULL; - op_array->last_try_catch = 0; - - op_array->return_reference = 0; - op_array->done_pass_two = 0; - - op_array->uses_this = 0; - - op_array->start_op = NULL; - - op_array->fn_flags = CG(interactive)?ZEND_ACC_INTERACTIVE:0; - - memset(op_array->reserved, 0, ZEND_MAX_RESERVED_RESOURCES * sizeof(void*)); - - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array TSRMLS_CC); -} - -ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC) -{ - switch (function->type) { - case ZEND_USER_FUNCTION: - destroy_op_array((zend_op_array *) function TSRMLS_CC); - break; - case ZEND_INTERNAL_FUNCTION: - /* do nothing */ - break; - } -} - -ZEND_API void zend_function_dtor(zend_function *function) -{ - TSRMLS_FETCH(); - - destroy_zend_function(function TSRMLS_CC); -} - -static void zend_cleanup_op_array_data(zend_op_array *op_array) -{ - if (op_array->static_variables) { - zend_hash_clean(op_array->static_variables); - } -} - -ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC) -{ - if (function->type == ZEND_USER_FUNCTION) { - zend_cleanup_op_array_data((zend_op_array *) function); - return ZEND_HASH_APPLY_KEEP; - } else { - return ZEND_HASH_APPLY_STOP; - } -} - -ZEND_API int zend_cleanup_function_data_full(zend_function *function TSRMLS_DC) -{ - if (function->type == ZEND_USER_FUNCTION) { - zend_cleanup_op_array_data((zend_op_array *) function); - } - return 0; -} - -ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC) -{ - if ((*pce)->type == ZEND_USER_CLASS) { - /* Clean all parts that can contain run-time data */ - /* Note that only run-time accessed data need to be cleaned up, pre-defined data can - not contain objects and thus are not probelmatic */ - zend_hash_apply(&(*pce)->function_table, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC); - (*pce)->static_members = NULL; - } else if (CE_STATIC_MEMBERS(*pce)) { - zend_hash_destroy(CE_STATIC_MEMBERS(*pce)); - FREE_HASHTABLE(CE_STATIC_MEMBERS(*pce)); -#ifdef ZTS - CG(static_members)[(zend_intptr_t)((*pce)->static_members)] = NULL; -#else - (*pce)->static_members = NULL; -#endif - } - return 0; -} - -ZEND_API void destroy_zend_class(zend_class_entry **pce) -{ - zend_class_entry *ce = *pce; - - if (--ce->refcount > 0) { - return; - } - switch (ce->type) { - case ZEND_USER_CLASS: - zend_hash_destroy(&ce->default_properties); - zend_hash_destroy(&ce->properties_info); - zend_hash_destroy(&ce->default_static_members); - efree(ce->name); - zend_hash_destroy(&ce->function_table); - zend_hash_destroy(&ce->constants_table); - if (ce->num_interfaces > 0 && ce->interfaces) { - efree(ce->interfaces); - } - if (ce->doc_comment) { - efree(ce->doc_comment); - } - efree(ce); - break; - case ZEND_INTERNAL_CLASS: - zend_hash_destroy(&ce->default_properties); - zend_hash_destroy(&ce->properties_info); - zend_hash_destroy(&ce->default_static_members); - free(ce->name); - zend_hash_destroy(&ce->function_table); - zend_hash_destroy(&ce->constants_table); - if (ce->num_interfaces > 0) { - free(ce->interfaces); - } - if (ce->doc_comment) { - free(ce->doc_comment); - } - free(ce); - break; - } -} - -void zend_class_add_ref(zend_class_entry **ce) -{ - (*ce)->refcount++; -} - -ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline = op_array->opcodes; - zend_op *end = op_array->opcodes+op_array->last; - zend_uint i; - - if (op_array->static_variables) { - zend_hash_destroy(op_array->static_variables); - FREE_HASHTABLE(op_array->static_variables); - } - - if (--(*op_array->refcount)>0) { - return; - } - - efree(op_array->refcount); - - if (op_array->vars) { - i = op_array->last_var; - while (i > 0) { - i--; - efree(op_array->vars[i].name); - } - efree(op_array->vars); - } - - while (oplineop1.op_type==IS_CONST) { -#if DEBUG_ZEND>2 - printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op1.u.constant); -#endif - zval_dtor(&opline->op1.u.constant); - } - if (opline->op2.op_type==IS_CONST) { -#if DEBUG_ZEND>2 - printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op2.u.constant); -#endif - zval_dtor(&opline->op2.u.constant); - } - opline++; - } - efree(op_array->opcodes); - - if (op_array->function_name) { - efree(op_array->function_name); - } - if (op_array->doc_comment) { - efree(op_array->doc_comment); - } - if (op_array->brk_cont_array) { - efree(op_array->brk_cont_array); - } - if (op_array->try_catch_array) { - efree(op_array->try_catch_array); - } - if (op_array->done_pass_two) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array TSRMLS_CC); - } - if (op_array->arg_info) { - for (i=0; inum_args; i++) { - efree(op_array->arg_info[i].name); - if (op_array->arg_info[i].class_name) { - efree(op_array->arg_info[i].class_name); - } - } - efree(op_array->arg_info); - } -} - -void init_op(zend_op *op TSRMLS_DC) -{ - memset(op, 0, sizeof(zend_op)); - op->lineno = CG(zend_lineno); - SET_UNUSED(op->result); -} - -zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC) -{ - zend_uint next_op_num = op_array->last++; - zend_op *next_op; - - if (next_op_num >= op_array->size) { - if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { - /* we messed up */ - zend_printf("Ran out of opcode space!\n" - "You should probably consider writing this huge script into a file!\n"); - zend_bailout(); - } - op_array->size *= 4; - op_array_alloc_ops(op_array); - } - - next_op = &(op_array->opcodes[next_op_num]); - - init_op(next_op TSRMLS_CC); - - return next_op; -} - -int get_next_op_number(zend_op_array *op_array) -{ - return op_array->last; -} - -zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array) -{ - op_array->last_brk_cont++; - op_array->brk_cont_array = erealloc(op_array->brk_cont_array, sizeof(zend_brk_cont_element)*op_array->last_brk_cont); - return &op_array->brk_cont_array[op_array->last_brk_cont-1]; -} - -static void zend_update_extended_info(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline = op_array->opcodes, *end=opline+op_array->last; - - while (oplineopcode == ZEND_EXT_STMT) { - if (opline+1opcode == ZEND_EXT_STMT) { - opline->opcode = ZEND_NOP; - opline++; - continue; - } - if (opline+1lineno = (opline+1)->lineno; - } - } else { - opline->opcode = ZEND_NOP; - } - } - opline++; - } -} - -static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_handler) { - extension->op_array_handler(op_array); - } -} - -int pass_two(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline, *end; - - if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) { - return 0; - } - if (CG(extended_info)) { - zend_update_extended_info(op_array TSRMLS_CC); - } - if (CG(handle_op_arrays)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array TSRMLS_CC); - } - - if (!(op_array->fn_flags & ZEND_ACC_INTERACTIVE) && op_array->size != op_array->last) { - op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last); - op_array->size = op_array->last; - } - - opline = op_array->opcodes; - end = opline + op_array->last; - while (opline < end) { - if (opline->op1.op_type == IS_CONST) { - opline->op1.u.constant.is_ref = 1; - opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */ - } - if (opline->op2.op_type == IS_CONST) { - opline->op2.u.constant.is_ref = 1; - opline->op2.u.constant.refcount = 2; - } - switch (opline->opcode) { - case ZEND_JMP: - opline->op1.u.jmp_addr = &op_array->opcodes[opline->op1.u.opline_num]; - break; - case ZEND_JMPZ: - case ZEND_JMPNZ: - case ZEND_JMPZ_EX: - case ZEND_JMPNZ_EX: - opline->op2.u.jmp_addr = &op_array->opcodes[opline->op2.u.opline_num]; - break; - } - ZEND_VM_SET_OPCODE_HANDLER(opline); - opline++; - } - - op_array->done_pass_two = 1; - return 0; -} - -int print_class(zend_class_entry *class_entry TSRMLS_DC) -{ - printf("Class %s:\n", class_entry->name); - zend_hash_apply(&class_entry->function_table, (apply_func_t) pass_two TSRMLS_CC); - printf("End of class %s.\n\n", class_entry->name); - return 0; -} - -ZEND_API unary_op_type get_unary_op(int opcode) -{ - switch (opcode) { - case ZEND_BW_NOT: - return (unary_op_type) bitwise_not_function; - break; - case ZEND_BOOL_NOT: - return (unary_op_type) boolean_not_function; - break; - default: - return (unary_op_type) NULL; - break; - } -} - -ZEND_API void *get_binary_op(int opcode) -{ - switch (opcode) { - case ZEND_ADD: - case ZEND_ASSIGN_ADD: - return (void *) add_function; - break; - case ZEND_SUB: - case ZEND_ASSIGN_SUB: - return (void *) sub_function; - break; - case ZEND_MUL: - case ZEND_ASSIGN_MUL: - return (void *) mul_function; - break; - case ZEND_DIV: - case ZEND_ASSIGN_DIV: - return (void *) div_function; - break; - case ZEND_MOD: - case ZEND_ASSIGN_MOD: - return (void *) mod_function; - break; - case ZEND_SL: - case ZEND_ASSIGN_SL: - return (void *) shift_left_function; - break; - case ZEND_SR: - case ZEND_ASSIGN_SR: - return (void *) shift_right_function; - break; - case ZEND_CONCAT: - case ZEND_ASSIGN_CONCAT: - return (void *) concat_function; - break; - case ZEND_IS_IDENTICAL: - return (void *) is_identical_function; - break; - case ZEND_IS_NOT_IDENTICAL: - return (void *) is_not_identical_function; - break; - case ZEND_IS_EQUAL: - return (void *) is_equal_function; - break; - case ZEND_IS_NOT_EQUAL: - return (void *) is_not_equal_function; - break; - case ZEND_IS_SMALLER: - return (void *) is_smaller_function; - break; - case ZEND_IS_SMALLER_OR_EQUAL: - return (void *) is_smaller_or_equal_function; - break; - case ZEND_BW_OR: - case ZEND_ASSIGN_BW_OR: - return (void *) bitwise_or_function; - break; - case ZEND_BW_AND: - case ZEND_ASSIGN_BW_AND: - return (void *) bitwise_and_function; - break; - case ZEND_BW_XOR: - case ZEND_ASSIGN_BW_XOR: - return (void *) bitwise_xor_function; - break; - default: - return (void *) NULL; - break; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c deleted file mode 100644 index a2eeef6a2e45e..0000000000000 --- a/Zend/zend_operators.c +++ /dev/null @@ -1,2061 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include - -#include "zend.h" -#include "zend_operators.h" -#include "zend_variables.h" -#include "zend_globals.h" -#include "zend_list.h" -#include "zend_API.h" -#include "zend_multiply.h" -#include "zend_strtod.h" -#include "zend_exceptions.h" - -#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1)) - -#if ZEND_USE_TOLOWER_L -#include -static _locale_t current_locale = NULL; -/* this is true global! may lead to strange effects on ZTS, but so is setlocale() */ -#define zend_tolower(c) _tolower_l(c, current_locale) -#else -#define zend_tolower(c) tolower(c) -#endif - -ZEND_API int zend_atoi(const char *str, int str_len) -{ - int retval; - - if (!str_len) { - str_len = strlen(str); - } - retval = strtol(str, NULL, 0); - if (str_len>0) { - switch (str[str_len-1]) { - case 'g': - case 'G': - retval *= 1024; - /* break intentionally missing */ - case 'm': - case 'M': - retval *= 1024; - /* break intentionally missing */ - case 'k': - case 'K': - retval *= 1024; - break; - } - } - return retval; -} - - -ZEND_API double zend_string_to_double(const char *number, zend_uint length) -{ - double divisor = 10.0; - double result = 0.0; - double exponent; - const char *end = number+length; - const char *digit = number; - - if (!length) { - return result; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result *= 10; - result += *digit - '0'; - } else if (*digit == '.') { - digit++; - break; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result += (*digit - '0') / divisor; - divisor *= 10; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - return result; -} - - -ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) -{ - switch (op->type) { - case IS_STRING: - { - char *strval; - - strval = op->value.str.val; - if ((op->type=is_numeric_string(strval, op->value.str.len, &op->value.lval, &op->value.dval, 1)) == 0) { - op->value.lval = 0; - op->type = IS_LONG; - } - STR_FREE(strval); - break; - } - case IS_BOOL: - op->type = IS_LONG; - break; - case IS_RESOURCE: - zend_list_delete(op->value.lval); - op->type = IS_LONG; - break; - case IS_OBJECT: - convert_to_long_base(op, 10); - break; - case IS_NULL: - op->type = IS_LONG; - op->value.lval = 0; - break; - } -} - -#define zendi_convert_scalar_to_number(op, holder, result) \ - if (op==result) { \ - if (op->type != IS_LONG) { \ - convert_scalar_to_number(op TSRMLS_CC); \ - } \ - } else { \ - switch ((op)->type) { \ - case IS_STRING: \ - { \ - if (((holder).type=is_numeric_string((op)->value.str.val, (op)->value.str.len, &(holder).value.lval, &(holder).value.dval, 1)) == 0) { \ - (holder).value.lval = 0; \ - (holder).type = IS_LONG; \ - } \ - (op) = &(holder); \ - break; \ - } \ - case IS_BOOL: \ - case IS_RESOURCE: \ - (holder).value.lval = (op)->value.lval; \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - break; \ - case IS_NULL: \ - (holder).value.lval = 0; \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - break; \ - case IS_OBJECT: \ - (holder) = (*(op)); \ - zval_copy_ctor(&(holder)); \ - convert_to_long_base(&(holder), 10); \ - if ((holder).type == IS_LONG) { \ - (op) = &(holder); \ - } \ - break; \ - } \ - } - -#ifdef _WIN64 -# define DVAL_TO_LVAL(d, l) \ - if ((d) > LONG_MAX) { \ - (l) = (long)(unsigned long)(__int64) (d); \ - } else { \ - (l) = (long) (d); \ - } -#else -# define DVAL_TO_LVAL(d, l) \ - if ((d) > LONG_MAX) { \ - (l) = (unsigned long) (d); \ - } else { \ - (l) = (long) (d); \ - } -#endif - -#define zendi_convert_to_long(op, holder, result) \ - if (op == result) { \ - convert_to_long(op); \ - } else if ((op)->type != IS_LONG) { \ - switch ((op)->type) { \ - case IS_NULL: \ - (holder).value.lval = 0; \ - break; \ - case IS_DOUBLE: \ - DVAL_TO_LVAL((op)->value.dval, (holder).value.lval); \ - break; \ - case IS_STRING: \ - (holder).value.lval = strtol((op)->value.str.val, NULL, 10); \ - break; \ - case IS_ARRAY: \ - (holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \ - break; \ - case IS_OBJECT: \ - (holder) = (*(op)); \ - zval_copy_ctor(&(holder)); \ - convert_to_long_base(&(holder), 10); \ - break; \ - case IS_BOOL: \ - case IS_RESOURCE: \ - (holder).value.lval = (op)->value.lval; \ - break; \ - default: \ - zend_error(E_WARNING, "Cannot convert to ordinal value"); \ - (holder).value.lval = 0; \ - break; \ - } \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - } - - -#define zendi_convert_to_boolean(op, holder, result) \ - if (op==result) { \ - convert_to_boolean(op); \ - } else if ((op)->type != IS_BOOL) { \ - switch ((op)->type) { \ - case IS_NULL: \ - (holder).value.lval = 0; \ - break; \ - case IS_RESOURCE: \ - case IS_LONG: \ - (holder).value.lval = ((op)->value.lval ? 1 : 0); \ - break; \ - case IS_DOUBLE: \ - (holder).value.lval = ((op)->value.dval ? 1 : 0); \ - break; \ - case IS_STRING: \ - if ((op)->value.str.len == 0 \ - || ((op)->value.str.len==1 && (op)->value.str.val[0]=='0')) { \ - (holder).value.lval = 0; \ - } else { \ - (holder).value.lval = 1; \ - } \ - break; \ - case IS_ARRAY: \ - (holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \ - break; \ - case IS_OBJECT: \ - (holder) = (*(op)); \ - zval_copy_ctor(&(holder)); \ - convert_to_boolean(&(holder)); \ - break; \ - default: \ - (holder).value.lval = 0; \ - break; \ - } \ - (holder).type = IS_BOOL; \ - (op) = &(holder); \ - } - - -#define convert_object_to_type(op, ctype, conv_func) \ - if (Z_OBJ_HT_P(op)->cast_object) { \ - zval dst; \ - if (Z_OBJ_HT_P(op)->cast_object(op, &dst, ctype TSRMLS_CC) == FAILURE) { \ - zend_error(E_RECOVERABLE_ERROR, \ - "Object of class %s could not be converted to %s", Z_OBJCE_P(op)->name, \ - zend_get_type_by_const(ctype)); \ - } else { \ - zval_dtor(op); \ - Z_TYPE_P(op) = ctype; \ - op->value = dst.value; \ - } \ - } else { \ - if(Z_OBJ_HT_P(op)->get) { \ - zval *newop = Z_OBJ_HT_P(op)->get(op TSRMLS_CC); \ - if(Z_TYPE_P(newop) != IS_OBJECT) { \ - /* for safety - avoid loop */ \ - zval_dtor(op); \ - *op = *newop; \ - FREE_ZVAL(newop); \ - conv_func(op); \ - } \ - } \ - } - -ZEND_API void convert_to_long(zval *op) -{ - if ((op)->type != IS_LONG) { - convert_to_long_base(op, 10); - } -} - -ZEND_API void convert_to_long_base(zval *op, int base) -{ - char *strval; - long tmp; - - switch (op->type) { - case IS_NULL: - op->value.lval = 0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_BOOL: - case IS_LONG: - break; - case IS_DOUBLE: - DVAL_TO_LVAL(op->value.dval, op->value.lval); - break; - case IS_STRING: - strval = op->value.str.val; - op->value.lval = strtol(strval, NULL, base); - STR_FREE(strval); - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.lval = tmp; - break; - case IS_OBJECT: - { - int retval = 1; - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_LONG, convert_to_long); - - if (op->type == IS_LONG) { - return; - } - - if (EG(ze1_compatibility_mode)) { - HashTable *ht = Z_OBJPROP_P(op); - if (ht) { - retval = (zend_hash_num_elements(ht)?1:0); - } - } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to int", Z_OBJCE_P(op)->name); - } - zval_dtor(op); - ZVAL_LONG(op, retval); - return; - } - default: - zend_error(E_WARNING, "Cannot convert to ordinal value"); - zval_dtor(op); - op->value.lval = 0; - break; - } - - op->type = IS_LONG; -} - - -ZEND_API void convert_to_double(zval *op) -{ - char *strval; - double tmp; - - switch (op->type) { - case IS_NULL: - op->value.dval = 0.0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_BOOL: - case IS_LONG: - op->value.dval = (double) op->value.lval; - break; - case IS_DOUBLE: - break; - case IS_STRING: - strval = op->value.str.val; - - op->value.dval = zend_strtod(strval, NULL); - STR_FREE(strval); - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.dval = tmp; - break; - case IS_OBJECT: - { - double retval = 1.0; - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_DOUBLE, convert_to_double); - - if (op->type == IS_DOUBLE) { - return; - } - - if (EG(ze1_compatibility_mode)) { - HashTable *ht = Z_OBJPROP_P(op); - if (ht) { - retval = (zend_hash_num_elements(ht)?1.0:0.0); - } - } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to double", Z_OBJCE_P(op)->name); - } - - zval_dtor(op); - ZVAL_DOUBLE(op, retval); - break; - } - default: - zend_error(E_WARNING, "Cannot convert to real value (type=%d)", op->type); - zval_dtor(op); - op->value.dval = 0; - break; - } - op->type = IS_DOUBLE; -} - - -ZEND_API void convert_to_null(zval *op) -{ - if (Z_TYPE_P(op) == IS_OBJECT) { - if (Z_OBJ_HT_P(op)->cast_object) { - zval *org; - TSRMLS_FETCH(); - - ALLOC_ZVAL(org); - *org = *op; - if (Z_OBJ_HT_P(op)->cast_object(org, op, IS_NULL TSRMLS_CC) == SUCCESS) { - zval_dtor(org); - return; - } - *op = *org; - FREE_ZVAL(org); - } - } - - zval_dtor(op); - Z_TYPE_P(op) = IS_NULL; -} - - -ZEND_API void convert_to_boolean(zval *op) -{ - char *strval; - int tmp; - - switch (op->type) { - case IS_BOOL: - break; - case IS_NULL: - op->value.lval = 0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_LONG: - op->value.lval = (op->value.lval ? 1 : 0); - break; - case IS_DOUBLE: - op->value.lval = (op->value.dval ? 1 : 0); - break; - case IS_STRING: - strval = op->value.str.val; - - if (op->value.str.len == 0 - || (op->value.str.len==1 && op->value.str.val[0]=='0')) { - op->value.lval = 0; - } else { - op->value.lval = 1; - } - STR_FREE(strval); - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.lval = tmp; - break; - case IS_OBJECT: - { - zend_bool retval = 1; - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_BOOL, convert_to_boolean); - - if (op->type == IS_BOOL) { - return; - } - - if (EG(ze1_compatibility_mode)) { - HashTable *ht = Z_OBJPROP_P(op); - if (ht) { - retval = (zend_hash_num_elements(ht)?1:0); - } - } - - zval_dtor(op); - ZVAL_BOOL(op, retval); - break; - } - default: - zval_dtor(op); - op->value.lval = 0; - break; - } - op->type = IS_BOOL; -} - -ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) -{ - long lval; - double dval; - - switch (op->type) { - case IS_NULL: - op->value.str.val = STR_EMPTY_ALLOC(); - op->value.str.len = 0; - break; - case IS_STRING: - break; - case IS_BOOL: - if (op->value.lval) { - op->value.str.val = estrndup_rel("1", 1); - op->value.str.len = 1; - } else { - op->value.str.val = STR_EMPTY_ALLOC(); - op->value.str.len = 0; - } - break; - case IS_RESOURCE: { - long tmp = op->value.lval; - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - op->value.str.len = zend_spprintf(&op->value.str.val, 0, "Resource id #%ld", tmp); - break; - } - case IS_LONG: - lval = op->value.lval; - - op->value.str.len = zend_spprintf(&op->value.str.val, 0, "%ld", lval); /* SAFE */ - break; - case IS_DOUBLE: { - TSRMLS_FETCH(); - dval = op->value.dval; - op->value.str.len = zend_spprintf(&op->value.str.val, 0, "%.*G", (int) EG(precision), dval); /* SAFE */ - /* %G already handles removing trailing zeros from the fractional part, yay */ - break; - } - case IS_ARRAY: - zend_error(E_NOTICE, "Array to string conversion"); - zval_dtor(op); - op->value.str.val = estrndup_rel("Array", sizeof("Array")-1); - op->value.str.len = sizeof("Array")-1; - break; - case IS_OBJECT: { - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_STRING, convert_to_string); - - if (op->type == IS_STRING) { - return; - } - - zend_error(E_NOTICE, "Object of class %s to string conversion", Z_OBJCE_P(op)->name); - zval_dtor(op); - op->value.str.val = estrndup_rel("Object", sizeof("Object")-1); - op->value.str.len = sizeof("Object")-1; - break; - } - default: - zval_dtor(op); - ZVAL_BOOL(op, 0); - break; - } - op->type = IS_STRING; -} - - -static void convert_scalar_to_array(zval *op, int type) -{ - zval *entry; - - ALLOC_ZVAL(entry); - *entry = *op; - INIT_PZVAL(entry); - - switch (type) { - case IS_ARRAY: - ALLOC_HASHTABLE(op->value.ht); - zend_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_index_update(op->value.ht, 0, (void *) &entry, sizeof(zval *), NULL); - op->type = IS_ARRAY; - break; - case IS_OBJECT: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_init(op); - zend_hash_update(Z_OBJPROP_P(op), "scalar", sizeof("scalar"), (void *) &entry, sizeof(zval *), NULL); - } - break; - } -} - - -ZEND_API void convert_to_array(zval *op) -{ - TSRMLS_FETCH(); - - switch (op->type) { - case IS_ARRAY: - return; - break; -/* OBJECTS_OPTIMIZE */ - case IS_OBJECT: - { - zval *tmp; - HashTable *ht; - - ALLOC_HASHTABLE(ht); - zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0); - if (Z_OBJ_HT_P(op)->get_properties) { - HashTable *obj_ht = Z_OBJ_HT_P(op)->get_properties(op TSRMLS_CC); - if(obj_ht) { - zend_hash_copy(ht, obj_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - } - } else { - convert_object_to_type(op, IS_ARRAY, convert_to_array); - - if (op->type == IS_ARRAY) { - zend_hash_destroy(ht); - FREE_HASHTABLE(ht); - return; - } - } - zval_dtor(op); - op->type = IS_ARRAY; - op->value.ht = ht; - } - return; - case IS_NULL: - ALLOC_HASHTABLE(op->value.ht); - zend_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0); - op->type = IS_ARRAY; - break; - default: - convert_scalar_to_array(op, IS_ARRAY); - break; - } -} - - -ZEND_API void convert_to_object(zval *op) -{ - switch (op->type) { - case IS_ARRAY: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_and_properties_init(op, zend_standard_class_def, op->value.ht); - return; - break; - } - case IS_OBJECT: - return; - case IS_NULL: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_init(op); - break; - } - default: - convert_scalar_to_array(op, IS_OBJECT); - break; - } -} - -ZEND_API void multi_convert_to_long_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_long_ex(arg); - } - - va_end(ap); -} - -ZEND_API void multi_convert_to_double_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_double_ex(arg); - } - - va_end(ap); -} - -ZEND_API void multi_convert_to_string_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_string_ex(arg); - } - - va_end(ap); -} - -ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_ARRAY && op2->type == IS_ARRAY) { - zval *tmp; - - if ((result == op1) && (result == op2)) { - /* $a += $a */ - return SUCCESS; - } - if (result != op1) { - *result = *op1; - zval_copy_ctor(result); - } - zend_hash_merge(result->value.ht, op2->value.ht, (void (*)(void *pData)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); - return SUCCESS; - } - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - long lval = op1->value.lval + op2->value.lval; - - /* check for overflow by comparing sign bits */ - if ( (op1->value.lval & LONG_SIGN_MASK) == (op2->value.lval & LONG_SIGN_MASK) - && (op1->value.lval & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) { - - result->value.dval = (double) op1->value.lval + (double) op2->value.lval; - result->type = IS_DOUBLE; - } else { - result->value.lval = lval; - result->type = IS_LONG; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) + op2->value.dval) : - (op1->value.dval + ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval + op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - long lval = op1->value.lval - op2->value.lval; - - /* check for overflow by comparing sign bits */ - if ( (op1->value.lval & LONG_SIGN_MASK) != (op2->value.lval & LONG_SIGN_MASK) - && (op1->value.lval & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) { - - result->value.dval = (double) op1->value.lval - (double) op2->value.lval; - result->type = IS_DOUBLE; - } else { - result->value.lval = lval; - result->type = IS_LONG; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) - op2->value.dval) : - (op1->value.dval - ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval - op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - long overflow; - - ZEND_SIGNED_MULTIPLY_LONG(op1->value.lval,op2->value.lval, result->value.lval,result->value.dval,overflow); - result->type = overflow ? IS_DOUBLE : IS_LONG; - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) * op2->value.dval) : - (op1->value.dval * ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval * op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - -ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if ((op2->type == IS_LONG && op2->value.lval == 0) || (op2->type == IS_DOUBLE && op2->value.dval == 0.0)) { - zend_error(E_WARNING, "Division by zero"); - ZVAL_BOOL(result, 0); - return FAILURE; /* division by zero */ - } - if (op1->type == IS_LONG && op2->type == IS_LONG) { - if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == LONG_MIN) { - /* Prevent overflow error/crash */ - ZVAL_DOUBLE(result, (double) LONG_MIN / -1); - return SUCCESS; - } - if (op1->value.lval % op2->value.lval == 0) { /* integer */ - result->type = IS_LONG; - result->value.lval = op1->value.lval / op2->value.lval; - } else { - result->type = IS_DOUBLE; - result->value.dval = ((double) op1->value.lval) / op2->value.lval; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) / op2->value.dval) : - (op1->value.dval / ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval / op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - if (op2->value.lval == 0) { - zend_error(E_WARNING, "Division by zero"); - ZVAL_BOOL(result, 0); - return FAILURE; /* modulus by zero */ - } - - if (abs(op2->value.lval) == 1) { - ZVAL_LONG(result, 0); - return SUCCESS; - } - - result->type = IS_LONG; - result->value.lval = op1->value.lval % op2->value.lval; - return SUCCESS; -} - - - -ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - result->type = IS_BOOL; - - zendi_convert_to_boolean(op1, op1_copy, result); - zendi_convert_to_boolean(op2, op2_copy, result); - result->value.lval = op1->value.lval ^ op2->value.lval; - return SUCCESS; -} - - -ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) -{ - zval op1_copy; - - zendi_convert_to_boolean(op1, op1_copy, result); - - result->type = IS_BOOL; - result->value.lval = !op1->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC) -{ - zval op1_copy = *op1; - - op1 = &op1_copy; - - if (op1->type == IS_DOUBLE) { - op1->value.lval = (long) op1->value.dval; - op1->type = IS_LONG; - } - if (op1->type == IS_LONG) { - result->value.lval = ~op1->value.lval; - result->type = IS_LONG; - return SUCCESS; - } - if (op1->type == IS_STRING) { - int i; - - result->type = IS_STRING; - result->value.str.val = estrndup(op1->value.str.val, op1->value.str.len); - result->value.str.len = op1->value.str.len; - for (i = 0; i < op1->value.str.len; i++) { - result->value.str.val[i] = ~op1->value.str.val[i]; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = IS_STRING; - result_len = longer->value.str.len; - result_str = estrndup(longer->value.str.val, longer->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] |= shorter->value.str.val[i]; - } - if (result==op1) { - STR_FREE(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval | op2->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = IS_STRING; - result_len = shorter->value.str.len; - result_str = estrndup(shorter->value.str.val, shorter->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] &= longer->value.str.val[i]; - } - if (result==op1) { - STR_FREE(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval & op2->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = IS_STRING; - result_len = shorter->value.str.len; - result_str = estrndup(shorter->value.str.val, shorter->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] ^= longer->value.str.val[i]; - } - if (result==op1) { - STR_FREE(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval ^ op2->value.lval; - return SUCCESS; -} - - -ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - result->value.lval = op1->value.lval << op2->value.lval; - result->type = IS_LONG; - return SUCCESS; -} - - -ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - result->value.lval = op1->value.lval >> op2->value.lval; - result->type = IS_LONG; - return SUCCESS; -} - - - -/* must support result==op1 */ -ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2) -{ - result->value.str.len = op1->value.str.len + 1; - result->value.str.val = (char *) erealloc(op1->value.str.val, result->value.str.len+1); - result->value.str.val[result->value.str.len - 1] = (char) op2->value.lval; - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; - return SUCCESS; -} - - -/* must support result==op1 */ -ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2) -{ - int length = op1->value.str.len + op2->value.str.len; - - result->value.str.val = (char *) erealloc(op1->value.str.val, length+1); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[length] = 0; - result->value.str.len = length; - result->type = IS_STRING; - return SUCCESS; -} - - -ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1 = 0, use_copy2 = 0; - - if (op1->type != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - } - if (op2->type != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - } - - if (use_copy1) { - /* We have created a converted copy of op1. Therefore, op1 won't become the result so - * we have to free it. - */ - if (result == op1) { - zval_dtor(op1); - } - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - if (result==op1) { /* special case, perform operations on result */ - uint res_len = op1->value.str.len + op2->value.str.len; - - result->value.str.val = erealloc(result->value.str.val, res_len+1); - - memcpy(result->value.str.val+result->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[res_len]=0; - result->value.str.len = res_len; - } else { - result->value.str.len = op1->value.str.len + op2->value.str.len; - result->value.str.val = (char *) emalloc(result->value.str.len + 1); - memcpy(result->value.str.val, op1->value.str.val, op1->value.str.len); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; - } - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} - - -ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1 = 0, use_copy2 = 0; - - if (op1->type != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - } - if (op2->type != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - } - - if (use_copy1) { - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - - result->value.lval = zend_binary_zval_strcmp(op1, op2); - result->type = IS_LONG; - - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} - -#if HAVE_STRCOLL -ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1 = 0, use_copy2 = 0; - - if (op1->type != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - } - if (op2->type != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - } - - if (use_copy1) { - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - - result->value.lval = strcoll(op1->value.str.val, op2->value.str.val); - result->type = IS_LONG; - - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} -#endif - -ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - op1_copy = *op1; - zval_copy_ctor(&op1_copy); - - op2_copy = *op2; - zval_copy_ctor(&op2_copy); - - convert_to_double(&op1_copy); - convert_to_double(&op2_copy); - - ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL(op1_copy)-Z_DVAL(op2_copy))); - - return SUCCESS; -} - - -static inline void zend_free_obj_get_result(zval *op) -{ - if (op) { - if (op->refcount == 0) { - zval_dtor(op); - FREE_ZVAL(op); - } else { - zval_ptr_dtor(&op); - } - } -} - -#define COMPARE_RETURN_AND_FREE(retval) \ - zend_free_obj_get_result(op1_free); \ - zend_free_obj_get_result(op2_free); \ - return retval; - -ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - zval *op1_free, *op2_free; - int op1_obj = Z_TYPE_P(op1) == IS_OBJECT; - int op2_obj = Z_TYPE_P(op2) == IS_OBJECT; - int eq_comp = op1_obj && op2_obj && (Z_OBJ_HANDLER_P(op1,compare_objects) - == Z_OBJ_HANDLER_P(op2,compare_objects)); - - if (op1_obj && !eq_comp) { - if (Z_TYPE_P(op2) == IS_NULL) { - ZVAL_LONG(result, 1); - return SUCCESS; - } else if (Z_OBJ_HT_P(op1)->get) { - op1 = op1_free = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC); - } else if (!op2_obj && Z_OBJ_HT_P(op1)->cast_object) { - ALLOC_INIT_ZVAL(op1_free); - if (Z_OBJ_HT_P(op1)->cast_object(op1, op1_free, Z_TYPE_P(op2) TSRMLS_CC) == FAILURE) { - op2_free = NULL; - ZVAL_LONG(result, 1); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - op1 = op1_free; - } else { - op1_free = NULL; - } - op1_obj = Z_TYPE_P(op1) == IS_OBJECT; - eq_comp = op1_obj && op2_obj && (Z_OBJ_HANDLER_P(op1,compare_objects) - == Z_OBJ_HANDLER_P(op2,compare_objects)); - } else { - op1_free = NULL; - } - if (op2_obj && !eq_comp) { - if (Z_TYPE_P(op1) == IS_NULL) { - op2_free = NULL; - ZVAL_LONG(result, -1); - COMPARE_RETURN_AND_FREE(SUCCESS); - } else if (Z_OBJ_HT_P(op2)->get) { - op2 = op2_free = Z_OBJ_HT_P(op2)->get(op2 TSRMLS_CC); - } else if (!op1_obj && Z_OBJ_HT_P(op2)->cast_object) { - ALLOC_INIT_ZVAL(op2_free); - if (Z_OBJ_HT_P(op2)->cast_object(op2, op2_free, Z_TYPE_P(op1) TSRMLS_CC) == FAILURE) { - ZVAL_LONG(result, -1); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - op2 = op2_free; - } else { - op2_free = NULL; - } - op2_obj = Z_TYPE_P(op2) == IS_OBJECT; - eq_comp = op1_obj && op2_obj && (Z_OBJ_HANDLER_P(op1,compare_objects) - == Z_OBJ_HANDLER_P(op2,compare_objects)); - } else { - op2_free = NULL; - } - - if ((Z_TYPE_P(op1) == IS_NULL && Z_TYPE_P(op2) == IS_STRING) - || (Z_TYPE_P(op2) == IS_NULL && Z_TYPE_P(op1) == IS_STRING)) { - if (Z_TYPE_P(op1) == IS_NULL) { - ZVAL_LONG(result, zend_binary_strcmp("", 0, Z_STRVAL_P(op2), Z_STRLEN_P(op2))); - COMPARE_RETURN_AND_FREE(SUCCESS); - } else { - ZVAL_LONG(result, zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), "", 0)); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - } - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zendi_smart_strcmp(result, op1, op2); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - if (Z_TYPE_P(op1) == IS_BOOL || Z_TYPE_P(op2) == IS_BOOL - || Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op2) == IS_NULL) { - zendi_convert_to_boolean(op1, op1_copy, result); - zendi_convert_to_boolean(op2, op2_copy, result); - ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - /* If both are objects sharing the same comparision handler then use is */ - if (eq_comp) { - if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { - /* object handles are identical, apprently this is the same object */ - ZVAL_LONG(result, 0); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (Z_TYPE_P(op1) == IS_LONG && Z_TYPE_P(op2) == IS_LONG) { - ZVAL_LONG(result, Z_LVAL_P(op1)>Z_LVAL_P(op2)?1:(Z_LVAL_P(op1)type = IS_BOOL; - if (op1->type != op2->type) { - result->value.lval = 0; - return SUCCESS; - } - switch (op1->type) { - case IS_NULL: - result->value.lval = (op2->type==IS_NULL); - break; - case IS_BOOL: - case IS_LONG: - case IS_RESOURCE: - result->value.lval = (op1->value.lval == op2->value.lval); - break; - case IS_DOUBLE: - result->value.lval = (op1->value.dval == op2->value.dval); - break; - case IS_STRING: - if ((op1->value.str.len == op2->value.str.len) - && (!memcmp(op1->value.str.val, op2->value.str.val, op1->value.str.len))) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - case IS_ARRAY: - if (zend_hash_compare(op1->value.ht, op2->value.ht, (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - case IS_OBJECT: - if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { - if (EG(ze1_compatibility_mode)) { - zend_compare_objects(result, op1, op2 TSRMLS_CC); - /* comparison returns 0 in case of equality and - * 1 in case of ineqaulity, we need to reverse it - */ - result->value.lval = !result->value.lval; - } else { - result->value.lval = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)); - } - } else { - result->value.lval = 0; - } - break; - default: - ZVAL_BOOL(result, 0); - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - result->type = IS_BOOL; - if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - result->value.lval = !result->value.lval; - return SUCCESS; -} - - -ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - convert_to_boolean(result); - if (result->value.lval == 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; -} - - -ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - convert_to_boolean(result); - if (result->value.lval) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; -} - - -ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - if (result->type == IS_LONG) { - result->type = IS_BOOL; - if (result->value.lval < 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - if (result->type == IS_DOUBLE) { - result->type = IS_BOOL; - if (result->value.dval < 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; -} - - -ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - if (result->type == IS_LONG) { - result->type = IS_BOOL; - if (result->value.lval <= 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - if (result->type == IS_DOUBLE) { - result->type = IS_BOOL; - if (result->value.dval <= 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; -} - - -ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC) -{ - zend_uint i; - - for (i=0; inum_interfaces; i++) { - if (instanceof_function(instance_ce->interfaces[i], ce TSRMLS_CC)) { - return 1; - } - } - if (!interfaces_only) { - while (instance_ce) { - if (instance_ce == ce) { - return 1; - } - instance_ce = instance_ce->parent; - } - } - - return 0; -} - -ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC) -{ - return instanceof_function_ex(instance_ce, ce, 0 TSRMLS_CC); -} - -#define LOWER_CASE 1 -#define UPPER_CASE 2 -#define NUMERIC 3 - - -static void increment_string(zval *str) -{ - int carry=0; - int pos=str->value.str.len-1; - char *s=str->value.str.val; - char *t; - int last=0; /* Shut up the compiler warning */ - int ch; - - if (str->value.str.len == 0) { - STR_FREE(str->value.str.val); - str->value.str.val = estrndup("1", sizeof("1")-1); - str->value.str.len = 1; - return; - } - - while (pos >= 0) { - ch = s[pos]; - if (ch >= 'a' && ch <= 'z') { - if (ch == 'z') { - s[pos] = 'a'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last=LOWER_CASE; - } else if (ch >= 'A' && ch <= 'Z') { - if (ch == 'Z') { - s[pos] = 'A'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last=UPPER_CASE; - } else if (ch >= '0' && ch <= '9') { - if (ch == '9') { - s[pos] = '0'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last = NUMERIC; - } else { - carry=0; - break; - } - if (carry == 0) { - break; - } - pos--; - } - - if (carry) { - t = (char *) emalloc(str->value.str.len+1+1); - memcpy(t+1, str->value.str.val, str->value.str.len); - str->value.str.len++; - t[str->value.str.len] = '\0'; - switch (last) { - case NUMERIC: - t[0] = '1'; - break; - case UPPER_CASE: - t[0] = 'A'; - break; - case LOWER_CASE: - t[0] = 'a'; - break; - } - STR_FREE(str->value.str.val); - str->value.str.val = t; - } -} - - -ZEND_API int increment_function(zval *op1) -{ - switch (op1->type) { - case IS_LONG: - if (op1->value.lval == LONG_MAX) { - /* switch to double */ - double d = (double)op1->value.lval; - ZVAL_DOUBLE(op1, d+1); - } else { - op1->value.lval++; - } - break; - case IS_DOUBLE: - op1->value.dval = op1->value.dval + 1; - break; - case IS_NULL: - op1->value.lval = 1; - op1->type = IS_LONG; - break; - case IS_STRING: { - long lval; - double dval; - char *strval = op1->value.str.val; - - switch (is_numeric_string(strval, op1->value.str.len, &lval, &dval, 0)) { - case IS_LONG: - if (lval == LONG_MAX) { - /* switch to double */ - double d = (double)lval; - ZVAL_DOUBLE(op1, d+1); - } else { - op1->value.lval = lval+1; - op1->type = IS_LONG; - } - efree(strval); /* should never be empty_string */ - break; - case IS_DOUBLE: - op1->value.dval = dval+1; - op1->type = IS_DOUBLE; - efree(strval); /* should never be empty_string */ - break; - default: - /* Perl style string increment */ - increment_string(op1); - break; - } - } - break; - default: - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int decrement_function(zval *op1) -{ - long lval; - double dval; - - switch (op1->type) { - case IS_LONG: - if (op1->value.lval == LONG_MIN) { - double d = (double)op1->value.lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval--; - } - break; - case IS_DOUBLE: - op1->value.dval = op1->value.dval - 1; - break; - case IS_STRING: /* Like perl we only support string increment */ - if (op1->value.str.len == 0) { /* consider as 0 */ - STR_FREE(op1->value.str.val); - op1->value.lval = -1; - op1->type = IS_LONG; - break; - } - switch (is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, &dval, 0)) { - case IS_LONG: - STR_FREE(op1->value.str.val); - if (lval == LONG_MIN) { - double d = (double)lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval = lval-1; - op1->type = IS_LONG; - } - break; - case IS_DOUBLE: - STR_FREE(op1->value.str.val); - op1->value.dval = dval - 1; - op1->type = IS_DOUBLE; - break; - } - break; - default: - return FAILURE; - } - - return SUCCESS; -} - - -ZEND_API int zval_is_true(zval *op) -{ - convert_to_boolean(op); - return (op->value.lval ? 1 : 0); -} - -#ifdef ZEND_USE_TOLOWER_L -ZEND_API void zend_update_current_locale(void) -{ - current_locale = _get_current_locale(); -} -#endif - -ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length) -{ - register unsigned char *str = (unsigned char*)source; - register unsigned char *result = (unsigned char*)dest; - register unsigned char *end = str + length; - - while (str < end) { - *result++ = zend_tolower((int)*str++); - } - *result = '\0'; - - return dest; -} - -ZEND_API void zend_str_tolower(char *str, unsigned int length) -{ - register unsigned char *p = (unsigned char*)str; - register unsigned char *end = p + length; - - while (p < end) { - *p = zend_tolower((int)*p); - p++; - } -} - -ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2) -{ - int retval; - - retval = memcmp(s1, s2, MIN(len1, len2)); - if (!retval) { - return (len1 - len2); - } else { - return retval; - } -} - -ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length) -{ - int retval; - - retval = memcmp(s1, s2, MIN(length, MIN(len1, len2))); - if (!retval) { - return (MIN(length, len1) - MIN(length, len2)); - } else { - return retval; - } -} - - -ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2) -{ - int len; - int c1, c2; - - len = MIN(len1, len2); - - while (len--) { - c1 = zend_tolower((int)*(unsigned char *)s1++); - c2 = zend_tolower((int)*(unsigned char *)s2++); - if (c1 != c2) { - return c1 - c2; - } - } - - return len1 - len2; -} - - -ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length) -{ - int len; - int c1, c2; - - len = MIN(length, MIN(len1, len2)); - - while (len--) { - c1 = zend_tolower((int)*(unsigned char *)s1++); - c2 = zend_tolower((int)*(unsigned char *)s2++); - if (c1 != c2) { - return c1 - c2; - } - } - - return MIN(length, len1) - MIN(length, len2); -} - - -ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2) -{ - return zend_binary_strcmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len); -} - -ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3) -{ - return zend_binary_strncmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval); -} - - -ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2) -{ - return zend_binary_strcasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len); -} - - -ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3) -{ - return zend_binary_strncasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval); -} - - -ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) -{ - int ret1, ret2; - long lval1, lval2; - double dval1, dval2; - - if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1, 0)) && - (ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2, 0))) { - if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) { - if (ret1!=IS_DOUBLE) { - dval1 = (double) lval1; - } else if (ret2!=IS_DOUBLE) { - dval2 = (double) lval2; - } else if (dval1 == dval2 && !zend_finite(dval1)) { - /* Both values overflowed and have the same sign, - * so a numeric comparison would be inaccurate */ - goto string_cmp; - } - result->value.dval = dval1 - dval2; - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval); - result->type = IS_LONG; - } else { /* they both have to be long's */ - result->value.lval = lval1 > lval2 ? 1 : (lval1 < lval2 ? -1 : 0); - result->type = IS_LONG; - } - } else { -string_cmp: - result->value.lval = zend_binary_zval_strcmp(s1, s2); - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - return; -} - - -static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC) -{ - zval result; - - if (compare_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) { - return 1; - } - return result.value.lval; -} - -ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) -{ - return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); -} - - - -ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) -{ - result->type = IS_LONG; - result->value.lval = zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); -} - - -ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC) -{ - zend_compare_symbol_tables(result, a1->value.ht, a2->value.ht TSRMLS_CC); -} - - -ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) -{ - result->type = IS_LONG; - - if (Z_OBJ_HANDLE_P(o1) == Z_OBJ_HANDLE_P(o2)) { - result->value.lval = 0; - return; - } - - if (Z_OBJ_HT_P(o1)->compare_objects == NULL) { - result->value.lval = 1; - } else { - result->value.lval = Z_OBJ_HT_P(o1)->compare_objects(o1, o2 TSRMLS_CC); - } -} - -ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC) -{ - TSRMLS_FETCH(); - - op->value.str.len = zend_spprintf(&op->value.str.val, 0, "%.*G", (int) EG(precision), (double)op->value.dval); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h deleted file mode 100644 index 03a4ed35d46c9..0000000000000 --- a/Zend/zend_operators.h +++ /dev/null @@ -1,447 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OPERATORS_H -#define ZEND_OPERATORS_H - -#include -#include -#include - -#ifdef HAVE_IEEEFP_H -#include -#endif - -#include "zend_strtod.h" - -#if 0&&HAVE_BCMATH -#include "ext/bcmath/libbcmath/src/bcmath.h" -#endif - -#if SIZEOF_LONG == 4 -#define MAX_LENGTH_OF_LONG 11 -static const char long_min_digits[] = "2147483648"; -#elif SIZEOF_LONG == 8 -#define MAX_LENGTH_OF_LONG 20 -static const char long_min_digits[] = "9223372036854775808"; -#else -#error "Unknown SIZEOF_LONG" -#endif - -#define MAX_LENGTH_OF_DOUBLE 32 - -BEGIN_EXTERN_C() -ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC); -ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC); -ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC); -ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC); -END_EXTERN_C() - -#define ZEND_IS_DIGIT(c) ((c) >= '0' && (c) <= '9') -#define ZEND_IS_XDIGIT(c) (((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f')) - -/** - * Checks whether the string "str" with length "length" is numeric. The value - * of allow_errors determines whether it's required to be entirely numeric, or - * just its prefix. Leading whitespace is allowed. - * - * The function returns 0 if the string did not contain a valid number; IS_LONG - * if it contained a number that fits within the range of a long; or IS_DOUBLE - * if the number was out of long range or contained a decimal point/exponent. - * The number's value is returned into the respective pointer, *lval or *dval, - * if that pointer is not NULL. - */ - -static inline zend_uchar is_numeric_string(const char *str, int length, long *lval, double *dval, int allow_errors) -{ - const char *ptr; - int base = 10, digits = 0, dp_or_e = 0; - double local_dval; - zend_uchar type; - - if (!length) { - return 0; - } - - /* Skip any whitespace - * This is much faster than the isspace() function */ - while (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r' || *str == '\v' || *str == '\f') { - str++; - length--; - } - ptr = str; - - if (*ptr == '-' || *ptr == '+') { - ptr++; - } - - if (ZEND_IS_DIGIT(*ptr)) { - /* Handle hex numbers - * str is used instead of ptr to disallow signs and keep old behavior */ - if (length > 2 && *str == '0' && (str[1] == 'x' || str[1] == 'X')) { - base = 16; - ptr += 2; - } - - /* Skip any leading 0s */ - while (*ptr == '0') { - ptr++; - } - - /* Count the number of digits. If a decimal point/exponent is found, - * it's a double. Otherwise, if there's a dval or no need to check for - * a full match, stop when there are too many digits for a long */ - for (type = IS_LONG; !(digits >= MAX_LENGTH_OF_LONG && (dval || allow_errors == 1)); digits++, ptr++) { -check_digits: - if (ZEND_IS_DIGIT(*ptr) || (base == 16 && ZEND_IS_XDIGIT(*ptr))) { - continue; - } else if (base == 10) { - if (*ptr == '.' && dp_or_e < 1) { - goto process_double; - } else if ((*ptr == 'e' || *ptr == 'E') && dp_or_e < 2) { - const char *e = ptr + 1; - - if (*e == '-' || *e == '+') { - ptr = e++; - } - if (ZEND_IS_DIGIT(*e)) { - goto process_double; - } - } - } - - break; - } - - if (base == 10) { - if (digits >= MAX_LENGTH_OF_LONG) { - dp_or_e = -1; - goto process_double; - } - } else if (!(digits < SIZEOF_LONG * 2 || (digits == SIZEOF_LONG * 2 && ptr[-digits] <= '7'))) { - if (dval) { - local_dval = zend_hex_strtod(str, (char **)&ptr); - } - type = IS_DOUBLE; - } - } else if (*ptr == '.' && ZEND_IS_DIGIT(ptr[1])) { -process_double: - type = IS_DOUBLE; - - /* If there's a dval, do the conversion; else continue checking - * the digits if we need to check for a full match */ - if (dval) { - local_dval = zend_strtod(str, (char **)&ptr); - } else if (allow_errors != 1 && dp_or_e != -1) { - dp_or_e = (*ptr++ == '.') ? 1 : 2; - goto check_digits; - } - } else { - return 0; - } - - if (ptr != str + length) { - if (!allow_errors) { - return 0; - } - if (allow_errors == -1) { - zend_error(E_NOTICE, "A non well formed numeric value encountered"); - } - } - - if (type == IS_LONG) { - if (digits == MAX_LENGTH_OF_LONG - 1) { - int cmp = strcmp(&ptr[-digits], long_min_digits); - - if (!(cmp < 0 || (cmp == 0 && *str == '-'))) { - if (dval) { - *dval = zend_strtod(str, NULL); - } - - return IS_DOUBLE; - } - } - - if (lval) { - *lval = strtol(str, NULL, base); - } - - return IS_LONG; - } else { - if (dval) { - *dval = local_dval; - } - - return IS_DOUBLE; - } -} - -static inline char * -zend_memnstr(char *haystack, char *needle, int needle_len, char *end) -{ - char *p = haystack; - char ne = needle[needle_len-1]; - - if(needle_len > end-haystack) { - return NULL; - } - end -= needle_len; - - while (p <= end) { - if ((p = (char *)memchr(p, *needle, (end-p+1))) && ne == p[needle_len-1]) { - if (!memcmp(needle, p, needle_len-1)) { - return p; - } - } - - if (p == NULL) { - return NULL; - } - - p++; - } - - return NULL; -} - -static inline void *zend_memrchr(const void *s, int c, size_t n) -{ - register unsigned char *e; - - if (n <= 0) { - return NULL; - } - - for (e = (unsigned char *)s + n - 1; e >= (unsigned char *)s; e--) { - if (*e == (unsigned char)c) { - return (void *)e; - } - } - - return NULL; -} - -BEGIN_EXTERN_C() -ZEND_API int increment_function(zval *op1); -ZEND_API int decrement_function(zval *op2); - -ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC); -ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC); -ZEND_API void convert_to_long(zval *op); -ZEND_API void convert_to_double(zval *op); -ZEND_API void convert_to_long_base(zval *op, int base); -ZEND_API void convert_to_null(zval *op); -ZEND_API void convert_to_boolean(zval *op); -ZEND_API void convert_to_array(zval *op); -ZEND_API void convert_to_object(zval *op); -ZEND_API void multi_convert_to_long_ex(int argc, ...); -ZEND_API void multi_convert_to_double_ex(int argc, ...); -ZEND_API void multi_convert_to_string_ex(int argc, ...); -ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2); -ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2); -#define convert_to_string(op) if ((op)->type != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); } - -ZEND_API double zend_string_to_double(const char *number, zend_uint length); - -ZEND_API int zval_is_true(zval *op); -ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -#if HAVE_STRCOLL -ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -#endif - -ZEND_API void zend_str_tolower(char *str, unsigned int length); -ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length); -END_EXTERN_C() - -static inline char * -zend_str_tolower_dup(const char *source, unsigned int length) -{ - return zend_str_tolower_copy((char *)emalloc(length+1), source, length); -} - -BEGIN_EXTERN_C() -ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2); -ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3); -ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2); -ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3); -ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2); -ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length); -ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2); -ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length); - -ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2); -ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC); -ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC); -ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC); - -ZEND_API int zend_atoi(const char *str, int str_len); - -ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC); -END_EXTERN_C() -#define convert_to_ex_master(ppzv, lower_type, upper_type) \ - if ((*ppzv)->type!=IS_##upper_type) { \ - SEPARATE_ZVAL_IF_NOT_REF(ppzv); \ - convert_to_##lower_type(*ppzv); \ - } - -#define convert_to_explicit_type(pzv, type) \ - do { \ - switch (type) { \ - case IS_NULL: \ - convert_to_null(pzv); \ - break; \ - case IS_LONG: \ - convert_to_long(pzv); \ - break; \ - case IS_DOUBLE: \ - convert_to_double(pzv); \ - break; \ - case IS_BOOL: \ - convert_to_boolean(pzv); \ - break; \ - case IS_ARRAY: \ - convert_to_array(pzv); \ - break; \ - case IS_OBJECT: \ - convert_to_object(pzv); \ - break; \ - case IS_STRING: \ - convert_to_string(pzv); \ - break; \ - default: \ - assert(0); \ - break; \ - } \ - } while (0); \ - -#define convert_to_explicit_type_ex(ppzv, str_type) \ - if (Z_TYPE_PP(ppzv) != str_type) { \ - SEPARATE_ZVAL_IF_NOT_REF(ppzv); \ - convert_to_explicit_type(*ppzv, str_type); \ - } - -#define convert_to_boolean_ex(ppzv) convert_to_ex_master(ppzv, boolean, BOOL) -#define convert_to_long_ex(ppzv) convert_to_ex_master(ppzv, long, LONG) -#define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE) -#define convert_to_string_ex(ppzv) convert_to_ex_master(ppzv, string, STRING) -#define convert_to_array_ex(ppzv) convert_to_ex_master(ppzv, array, ARRAY) -#define convert_to_object_ex(ppzv) convert_to_ex_master(ppzv, object, OBJECT) -#define convert_to_null_ex(ppzv) convert_to_ex_master(ppzv, null, NULL) - -#define convert_scalar_to_number_ex(ppzv) \ - if (Z_TYPE_PP(ppzv)!=IS_LONG && Z_TYPE_PP(ppzv)!=IS_DOUBLE) { \ - if (!(*ppzv)->is_ref) { \ - SEPARATE_ZVAL(ppzv); \ - } \ - convert_scalar_to_number(*ppzv TSRMLS_CC); \ - } - - -#define Z_LVAL(zval) (zval).value.lval -#define Z_BVAL(zval) ((zend_bool)(zval).value.lval) -#define Z_DVAL(zval) (zval).value.dval -#define Z_STRVAL(zval) (zval).value.str.val -#define Z_STRLEN(zval) (zval).value.str.len -#define Z_ARRVAL(zval) (zval).value.ht -#define Z_OBJVAL(zval) (zval).value.obj -#define Z_OBJ_HANDLE(zval) Z_OBJVAL(zval).handle -#define Z_OBJ_HT(zval) Z_OBJVAL(zval).handlers -#define Z_OBJCE(zval) zend_get_class_entry(&(zval) TSRMLS_CC) -#define Z_OBJPROP(zval) Z_OBJ_HT((zval))->get_properties(&(zval) TSRMLS_CC) -#define Z_OBJ_HANDLER(zval, hf) Z_OBJ_HT((zval))->hf -#define Z_RESVAL(zval) (zval).value.lval - -#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p) -#define Z_BVAL_P(zval_p) Z_BVAL(*zval_p) -#define Z_DVAL_P(zval_p) Z_DVAL(*zval_p) -#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p) -#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p) -#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p) -#define Z_OBJPROP_P(zval_p) Z_OBJPROP(*zval_p) -#define Z_OBJCE_P(zval_p) Z_OBJCE(*zval_p) -#define Z_RESVAL_P(zval_p) Z_RESVAL(*zval_p) -#define Z_OBJVAL_P(zval_p) Z_OBJVAL(*zval_p) -#define Z_OBJ_HANDLE_P(zval_p) Z_OBJ_HANDLE(*zval_p) -#define Z_OBJ_HT_P(zval_p) Z_OBJ_HT(*zval_p) -#define Z_OBJ_HANDLER_P(zval_p, h) Z_OBJ_HANDLER(*zval_p, h) - -#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp) -#define Z_BVAL_PP(zval_pp) Z_BVAL(**zval_pp) -#define Z_DVAL_PP(zval_pp) Z_DVAL(**zval_pp) -#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp) -#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp) -#define Z_ARRVAL_PP(zval_pp) Z_ARRVAL(**zval_pp) -#define Z_OBJPROP_PP(zval_pp) Z_OBJPROP(**zval_pp) -#define Z_OBJCE_PP(zval_pp) Z_OBJCE(**zval_pp) -#define Z_RESVAL_PP(zval_pp) Z_RESVAL(**zval_pp) -#define Z_OBJVAL_PP(zval_pp) Z_OBJVAL(**zval_pp) -#define Z_OBJ_HANDLE_PP(zval_p) Z_OBJ_HANDLE(**zval_p) -#define Z_OBJ_HT_PP(zval_p) Z_OBJ_HT(**zval_p) -#define Z_OBJ_HANDLER_PP(zval_p, h) Z_OBJ_HANDLER(**zval_p, h) - -#define Z_TYPE(zval) (zval).type -#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p) -#define Z_TYPE_PP(zval_pp) Z_TYPE(**zval_pp) - -#if HAVE_SETLOCALE && defined(ZEND_WIN32) && !defined(ZTS) && defined(_MSC_VER) && (_MSC_VER >= 1400) -/* This is performance improvement of tolower() on Windows and VC2005 - * GIves 10-18% on bench.php - */ -#define ZEND_USE_TOLOWER_L 1 -#endif - -#ifdef ZEND_USE_TOLOWER_L -ZEND_API void zend_update_current_locale(void); -#else -#define zend_update_current_locale() -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c deleted file mode 100644 index c8402a70c781b..0000000000000 --- a/Zend/zend_ptr_stack.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_ptr_stack.h" -#ifdef HAVE_STDARG_H -# include -#endif - -ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack) -{ - stack->top_element = stack->elements = (void **) emalloc(sizeof(void *)*PTR_STACK_BLOCK_SIZE); - stack->max = PTR_STACK_BLOCK_SIZE; - stack->top = 0; -} - - -ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...) -{ - va_list ptr; - void *elem; - - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) - - va_start(ptr, count); - while (count>0) { - elem = va_arg(ptr, void *); - stack->top++; - *(stack->top_element++) = elem; - count--; - } - va_end(ptr); -} - - -ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...) -{ - va_list ptr; - void **elem; - - va_start(ptr, count); - while (count>0) { - elem = va_arg(ptr, void **); - *elem = *(--stack->top_element); - stack->top--; - count--; - } - va_end(ptr); -} - - - -ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack) -{ - if (stack->elements) { - efree(stack->elements); - } -} - - -ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)) -{ - int i = stack->top; - - while (--i >= 0) { - func(stack->elements[i]); - } -} - - -ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements) -{ - zend_ptr_stack_apply(stack, func); - if (free_elements) { - int i = stack->top; - - while (--i >= 0) { - efree(stack->elements[i]); - } - } - stack->top = 0; - stack->top_element = stack->elements; -} - - -ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack) -{ - return stack->top; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h deleted file mode 100644 index 3392442a4ee21..0000000000000 --- a/Zend/zend_ptr_stack.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_PTR_STACK_H -#define ZEND_PTR_STACK_H - -typedef struct _zend_ptr_stack { - int top, max; - void **elements; - void **top_element; -} zend_ptr_stack; - - -#define PTR_STACK_BLOCK_SIZE 64 - -BEGIN_EXTERN_C() -ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack); -ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...); -ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...); -ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack); -ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)); -ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements); -ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack); -END_EXTERN_C() - -#define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) \ - if (stack->top+count > stack->max) { \ - /* we need to allocate more memory */ \ - stack->max *= 2; \ - stack->max += count; \ - stack->elements = (void **) erealloc(stack->elements, (sizeof(void *) * (stack->max))); \ - stack->top_element = stack->elements+stack->top; \ - } - -/* Not doing this with a macro because of the loop unrolling in the element assignment. - Just using a macro for 3 in the body for readability sake. */ -static inline void zend_ptr_stack_3_push(zend_ptr_stack *stack, void *a, void *b, void *c) -{ -#define ZEND_PTR_STACK_NUM_ARGS 3 - - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) - - stack->top += ZEND_PTR_STACK_NUM_ARGS; - *(stack->top_element++) = a; - *(stack->top_element++) = b; - *(stack->top_element++) = c; - -#undef ZEND_PTR_STACK_NUM_ARGS -} - -static inline void zend_ptr_stack_2_push(zend_ptr_stack *stack, void *a, void *b) -{ -#define ZEND_PTR_STACK_NUM_ARGS 2 - - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) - - stack->top += ZEND_PTR_STACK_NUM_ARGS; - *(stack->top_element++) = a; - *(stack->top_element++) = b; - -#undef ZEND_PTR_STACK_NUM_ARGS -} - -static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void **c) -{ - *a = *(--stack->top_element); - *b = *(--stack->top_element); - *c = *(--stack->top_element); - stack->top -= 3; -} - -static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b) -{ - *a = *(--stack->top_element); - *b = *(--stack->top_element); - stack->top -= 2; -} - -static inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr) -{ - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, 1) - - stack->top++; - *(stack->top_element++) = ptr; -} - -static inline void *zend_ptr_stack_pop(zend_ptr_stack *stack) -{ - stack->top--; - return *(--stack->top_element); -} - -#endif /* ZEND_PTR_STACK_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_qsort.c b/Zend/zend_qsort.c deleted file mode 100644 index 57bf5e540e2b4..0000000000000 --- a/Zend/zend_qsort.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" - -#include - -#define QSORT_STACK_SIZE (sizeof(size_t) * CHAR_BIT) - -static void _zend_qsort_swap(void *a, void *b, size_t siz) -{ - register char *tmp_a_char; - register char *tmp_b_char; - register int *tmp_a_int; - register int *tmp_b_int; - register size_t i; - int t_i; - char t_c; - - tmp_a_int = (int *) a; - tmp_b_int = (int *) b; - - for (i = sizeof(int); i <= siz; i += sizeof(int)) { - t_i = *tmp_a_int; - *tmp_a_int++ = *tmp_b_int; - *tmp_b_int++ = t_i; - } - - tmp_a_char = (char *) tmp_a_int; - tmp_b_char = (char *) tmp_b_int; - - for (i = i - sizeof(int) + 1; i <= siz; ++i) { - t_c = *tmp_a_char; - *tmp_a_char++ = *tmp_b_char; - *tmp_b_char++ = t_c; - } -} - -ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC) -{ - void *begin_stack[QSORT_STACK_SIZE]; - void *end_stack[QSORT_STACK_SIZE]; - register char *begin; - register char *end; - register char *seg1; - register char *seg2; - register char *seg2p; - register int loop; - uint offset; - - begin_stack[0] = (char *) base; - end_stack[0] = (char *) base + ((nmemb - 1) * siz); - - for (loop = 0; loop >= 0; --loop) { - begin = begin_stack[loop]; - end = end_stack[loop]; - - while (begin < end) { - offset = (end - begin) >> 1; - _zend_qsort_swap(begin, begin + (offset - (offset % siz)), siz); - - seg1 = begin + siz; - seg2 = end; - - while (1) { - for (; seg1 < seg2 && compare(begin, seg1 TSRMLS_CC) > 0; - seg1 += siz); - - for (; seg2 >= seg1 && compare(seg2, begin TSRMLS_CC) > 0; - seg2 -= siz); - - if (seg1 >= seg2) - break; - - _zend_qsort_swap(seg1, seg2, siz); - - seg1 += siz; - seg2 -= siz; - } - - _zend_qsort_swap(begin, seg2, siz); - - seg2p = seg2; - - if ((seg2p - begin) <= (end - seg2p)) { - if ((seg2p + siz) < end) { - begin_stack[loop] = seg2p + siz; - end_stack[loop++] = end; - } - end = seg2p - siz; - } - else { - if ((seg2p - siz) > begin) { - begin_stack[loop] = begin; - end_stack[loop++] = seg2p - siz; - } - begin = seg2p + siz; - } - } - } -} - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/Zend/zend_qsort.h b/Zend/zend_qsort.h deleted file mode 100644 index e5faf8a3fc266..0000000000000 --- a/Zend/zend_qsort.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_QSORT_H -#define ZEND_QSORT_H - -BEGIN_EXTERN_C() -ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC); -END_EXTERN_C() - -#endif /* ZEND_QSORT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_sprintf.c b/Zend/zend_sprintf.c deleted file mode 100644 index 53fcafbace723..0000000000000 --- a/Zend/zend_sprintf.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include - -#include "zend.h" - -#ifdef HAVE_STDARG_H -# include -#endif - -#if ZEND_BROKEN_SPRINTF -int zend_sprintf(char *buffer, const char *format, ...) -{ - va_list args; - - va_start(args, format); - vsprintf(buffer, format, args); - va_end(args); - - return strlen(buffer); -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c deleted file mode 100644 index bb07e8e17719a..0000000000000 --- a/Zend/zend_stack.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_stack.h" - -ZEND_API int zend_stack_init(zend_stack *stack) -{ - stack->top = 0; - stack->elements = (void **) emalloc(sizeof(void **) * STACK_BLOCK_SIZE); - if (!stack->elements) { - return FAILURE; - } else { - stack->max = STACK_BLOCK_SIZE; - return SUCCESS; - } -} - -ZEND_API int zend_stack_push(zend_stack *stack, void *element, int size) -{ - if (stack->top >= stack->max) { /* we need to allocate more memory */ - stack->elements = (void **) erealloc(stack->elements, - (sizeof(void **) * (stack->max += STACK_BLOCK_SIZE))); - if (!stack->elements) { - return FAILURE; - } - } - stack->elements[stack->top] = (void *) emalloc(size); - memcpy(stack->elements[stack->top], element, size); - return stack->top++; -} - - -ZEND_API int zend_stack_top(zend_stack *stack, void **element) -{ - if (stack->top > 0) { - *element = stack->elements[stack->top - 1]; - return SUCCESS; - } else { - *element = NULL; - return FAILURE; - } -} - - -ZEND_API int zend_stack_del_top(zend_stack *stack) -{ - if (stack->top > 0) { - efree(stack->elements[--stack->top]); - } - return SUCCESS; -} - - -ZEND_API int zend_stack_int_top(zend_stack *stack) -{ - int *e; - - if (zend_stack_top(stack, (void **) &e) == FAILURE) { - return FAILURE; /* this must be a negative number, since negative numbers can't be address numbers */ - } else { - return *e; - } -} - - -ZEND_API int zend_stack_is_empty(zend_stack *stack) -{ - if (stack->top == 0) { - return 1; - } else { - return 0; - } -} - - -ZEND_API int zend_stack_destroy(zend_stack *stack) -{ - register int i; - - for (i = 0; i < stack->top; i++) { - efree(stack->elements[i]); - } - - if (stack->elements) { - efree(stack->elements); - } - return SUCCESS; -} - - -ZEND_API void **zend_stack_base(zend_stack *stack) -{ - return stack->elements; -} - - -ZEND_API int zend_stack_count(zend_stack *stack) -{ - return stack->top; -} - - -ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)) -{ - int i; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if (apply_function(stack->elements[i])) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if (apply_function(stack->elements[i])) { - break; - } - } - break; - } -} - - -ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg) -{ - int i; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if (apply_function(stack->elements[i], arg)) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if (apply_function(stack->elements[i], arg)) { - break; - } - } - break; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stack.h b/Zend/zend_stack.h deleted file mode 100644 index 791025da08fda..0000000000000 --- a/Zend/zend_stack.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STACK_H -#define ZEND_STACK_H - -typedef struct _zend_stack { - int top, max; - void **elements; -} zend_stack; - - -#define STACK_BLOCK_SIZE 64 - -BEGIN_EXTERN_C() -ZEND_API int zend_stack_init(zend_stack *stack); -ZEND_API int zend_stack_push(zend_stack *stack, void *element, int size); -ZEND_API int zend_stack_top(zend_stack *stack, void **element); -ZEND_API int zend_stack_del_top(zend_stack *stack); -ZEND_API int zend_stack_int_top(zend_stack *stack); -ZEND_API int zend_stack_is_empty(zend_stack *stack); -ZEND_API int zend_stack_destroy(zend_stack *stack); -ZEND_API void **zend_stack_base(zend_stack *stack); -ZEND_API int zend_stack_count(zend_stack *stack); -ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)); -ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg); -END_EXTERN_C() - -#define ZEND_STACK_APPLY_TOPDOWN 1 -#define ZEND_STACK_APPLY_BOTTOMUP 2 - -#endif /* ZEND_STACK_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_static_allocator.c b/Zend/zend_static_allocator.c deleted file mode 100644 index 1f3520a6b4b4b..0000000000000 --- a/Zend/zend_static_allocator.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend_static_allocator.h" - -/* Not checking emalloc() and erealloc() return values as they are supposed to bailout */ - -inline static void block_init(Block *block, zend_uint block_size) -{ - block->pos = block->bp = (char *) emalloc(block_size); - block->end = block->bp + block_size; -} - -inline static char *block_allocate(Block *block, zend_uint size) -{ - char *retval = block->pos; - if ((block->pos += size) >= block->end) { - return (char *)NULL; - } - return retval; -} - -inline static void block_destroy(Block *block) -{ - efree(block->bp); -} - -void static_allocator_init(StaticAllocator *sa) -{ - sa->Blocks = (Block *) emalloc(sizeof(Block)); - block_init(sa->Blocks, ALLOCATOR_BLOCK_SIZE); - sa->num_blocks = 1; - sa->current_block = 0; -} - -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size) -{ - char *retval; - - retval = block_allocate(&sa->Blocks[sa->current_block], size); - if (retval) { - return retval; - } - sa->Blocks = (Block *) erealloc(sa->Blocks, ++sa->num_blocks); - sa->current_block++; - block_init(&sa->Blocks[sa->current_block], (size > ALLOCATOR_BLOCK_SIZE) ? size : ALLOCATOR_BLOCK_SIZE); - retval = block_allocate(&sa->Blocks[sa->current_block], size); - return retval; -} - -void static_allocator_destroy(StaticAllocator *sa) -{ - zend_uint i; - - for (i=0; inum_blocks; i++) { - block_free(&sa->Blocks[i]); - } - efree(sa->Blocks); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_static_allocator.h b/Zend/zend_static_allocator.h deleted file mode 100644 index b54aba3f1df9a..0000000000000 --- a/Zend/zend_static_allocator.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STATIC_ALLOCATOR_H -#define ZEND_STATIC_ALLOCATOR_H - -#define ALLOCATOR_BLOCK_SIZE 400000 - -/* Temporary */ -typedef unsigned int zend_uint; -#define emalloc(s) malloc(s) -#define efree(p) free(p) - -typedef struct _Block { - char *bp; - char *pos; - char *end; -} Block; - -typedef struct _StaticAllocator { - Block *Blocks; - zend_uint num_blocks; - zend_uint current_block; -} StaticAllocator; - -void static_allocator_init(StaticAllocator *sa); -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size); -void static_allocator_destroy(StaticAllocator *sa); - -#endif /* ZEND_STATIC_ALLOCATOR_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c deleted file mode 100644 index 3922837ceffdc..0000000000000 --- a/Zend/zend_stream.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#include "zend.h" -#include "zend_compile.h" - -ZEND_DLIMPORT int isatty(int fd); - -static size_t zend_stream_stdio_reader(void *handle, char *buf, size_t len TSRMLS_DC) -{ - return fread(buf, 1, len, (FILE*)handle); -} - -static void zend_stream_stdio_closer(void *handle TSRMLS_DC) -{ - if ((FILE*)handle != stdin) - fclose((FILE*)handle); -} - -static long zend_stream_stdio_fteller(void *handle TSRMLS_DC) -{ - return ftell((FILE*) handle); -} - - -ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC) -{ - if (zend_stream_open_function) { - return zend_stream_open_function(filename, handle TSRMLS_CC); - } - handle->type = ZEND_HANDLE_FP; - handle->opened_path = NULL; - handle->handle.fp = zend_fopen(filename, &handle->opened_path); - handle->filename = (char *)filename; - handle->free_filename = 0; - - return (handle->handle.fp) ? SUCCESS : FAILURE; -} - -ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC) -{ - switch (file_handle->type) { - case ZEND_HANDLE_FILENAME: - if (FAILURE == zend_stream_open(file_handle->filename, file_handle TSRMLS_CC)) { - return FAILURE; - } - break; - - case ZEND_HANDLE_FD: - file_handle->handle.fp = fdopen(file_handle->handle.fd, "rb"); - file_handle->type = ZEND_HANDLE_FP; - break; - - case ZEND_HANDLE_FP: - file_handle->handle.fp = file_handle->handle.fp; - break; - - case ZEND_HANDLE_STREAM: - /* nothing to do */ - return SUCCESS; - - default: - return FAILURE; - } - if (file_handle->type == ZEND_HANDLE_FP) { - if (!file_handle->handle.fp) { - return FAILURE; - } - - /* make compatible with stream */ - file_handle->handle.stream.handle = file_handle->handle.fp; - file_handle->handle.stream.reader = zend_stream_stdio_reader; - file_handle->handle.stream.closer = zend_stream_stdio_closer; - file_handle->handle.stream.fteller = zend_stream_stdio_fteller; - - file_handle->handle.stream.interactive = isatty(fileno((FILE *)file_handle->handle.stream.handle)); - } - return SUCCESS; -} - -ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC) -{ - if (file_handle->handle.stream.interactive) { - int c = '*'; - size_t n; - -#ifdef NETWARE - /* - c != 4 check is there as fread of a character in NetWare LibC gives 4 upon ^D character. - Ascii value 4 is actually EOT character which is not defined anywhere in the LibC - or else we can use instead of hardcoded 4. - */ - for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != 4 && c != '\n'; ++n ) -#else - for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != '\n'; ++n ) -#endif - buf[n] = (char) c; - if ( c == '\n' ) - buf[n++] = (char) c; - - return n; - } - return file_handle->handle.stream.reader(file_handle->handle.stream.handle, buf, len TSRMLS_CC); -} - -ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC) -{ - char buf; - - if (file_handle->handle.stream.reader(file_handle->handle.stream.handle, &buf, sizeof(buf) TSRMLS_CC)) { - return (int)buf; - } - return EOF; -} - -ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC) -{ - return 0; -} - -ZEND_API long zend_stream_ftell(zend_file_handle *file_handle TSRMLS_DC) -{ - return file_handle->handle.stream.fteller(file_handle->handle.stream.handle TSRMLS_CC); -} diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h deleted file mode 100644 index 3b65b1517557c..0000000000000 --- a/Zend/zend_stream.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STREAM_H -#define ZEND_STREAM_H - -/* Lightweight stream implementation for the ZE scanners. - * These functions are private to the engine. - * */ - -typedef size_t (*zend_stream_reader_t)(void *handle, char *buf, size_t len TSRMLS_DC); -typedef void (*zend_stream_closer_t)(void *handle TSRMLS_DC); -typedef long (*zend_stream_fteller_t)(void *handle TSRMLS_DC); - -typedef struct _zend_stream { - void *handle; - zend_stream_reader_t reader; - zend_stream_closer_t closer; - zend_stream_fteller_t fteller; - int interactive; -} zend_stream; - -typedef struct _zend_file_handle { - zend_uchar type; - char *filename; - char *opened_path; - union { - int fd; - FILE *fp; - zend_stream stream; - } handle; - zend_bool free_filename; -} zend_file_handle; - -BEGIN_EXTERN_C() -ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC); -ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC); -ZEND_API long zend_stream_ftell(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC); -END_EXTERN_C() - -#define zend_stream_close(handle) zend_file_handle_dtor((handle)) - -#endif - diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c deleted file mode 100644 index bb93d7b6b12e5..0000000000000 --- a/Zend/zend_strtod.c +++ /dev/null @@ -1,2648 +0,0 @@ -/**************************************************************** - * - * The author of this software is David M. Gay. - * - * Copyright (c) 1991 by AT&T. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - ***************************************************************/ - -/* Please send bug reports to - David M. Gay - AT&T Bell Laboratories, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-2070 - U.S.A. - dmg@research.att.com or research!dmg - */ - -/* strtod for IEEE-, VAX-, and IBM-arithmetic machines. - * - * This strtod returns a nearest machine number to the input decimal - * string (or sets errno to ERANGE). With IEEE arithmetic, ties are - * broken by the IEEE round-even rule. Otherwise ties are broken by - * biased rounding (add half and chop). - * - * Inspired loosely by William D. Clinger's paper "How to Read Floating - * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101]. - * - * Modifications: - * - * 1. We only require IEEE, IBM, or VAX double-precision - * arithmetic (not IEEE double-extended). - * 2. We get by with floating-point arithmetic in a case that - * Clinger missed -- when we're computing d * 10^n - * for a small integer d and the integer n is not too - * much larger than 22 (the maximum integer k for which - * we can represent 10^k exactly), we may be able to - * compute (d*10^k) * 10^(e-k) with just one roundoff. - * 3. Rather than a bit-at-a-time adjustment of the binary - * result in the hard case, we use floating-point - * arithmetic to determine the adjustment to within - * one bit; only in really hard cases do we need to - * compute a second residual. - * 4. Because of 3., we don't need a large table of powers of 10 - * for ten-to-e (just some small tables, e.g. of 10^k - * for 0 <= k <= 22). - */ - -/* - * #define IEEE_LITTLE_ENDIAN for IEEE-arithmetic machines where the least - * significant byte has the lowest address. - * #define IEEE_BIG_ENDIAN for IEEE-arithmetic machines where the most - * significant byte has the lowest address. - * #define Long int on machines with 32-bit ints and 64-bit longs. - * #define Sudden_Underflow for IEEE-format machines without gradual - * underflow (i.e., that flush to zero on underflow). - * #define IBM for IBM mainframe-style floating-point arithmetic. - * #define VAX for VAX-style floating-point arithmetic. - * #define Unsigned_Shifts if >> does treats its left operand as unsigned. - * #define No_leftright to omit left-right logic in fast floating-point - * computation of dtoa. - * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3. - * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines - * that use extended-precision instructions to compute rounded - * products and quotients) with IBM. - * #define ROUND_BIASED for IEEE-format with biased rounding. - * #define Inaccurate_Divide for IEEE-format with correctly rounded - * products but inaccurate quotients, e.g., for Intel i860. - * #define Just_16 to store 16 bits per 32-bit Long when doing high-precision - * integer arithmetic. Whether this speeds things up or slows things - * down depends on the machine and the number being converted. - * #define KR_headers for old-style C function headers. - * #define Bad_float_h if your system lacks a float.h or if it does not - * define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP, - * FLT_RADIX, FLT_ROUNDS, and DBL_MAX. - * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n) - * if memory is available and otherwise does something you deem - * appropriate. If MALLOC is undefined, malloc will be invoked - * directly -- and assumed always to succeed. - */ - -/* $Id$ */ - -#include -#include - -#ifdef ZTS -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_LOCALE_H -#include -#endif - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#if defined(HAVE_INTTYPES_H) -#include -#elif defined(HAVE_STDINT_H) -#include -#endif - -#ifndef HAVE_INT32_T -# if SIZEOF_INT == 4 -typedef int int32_t; -# elif SIZEOF_LONG == 4 -typedef long int int32_t; -# endif -#endif - -#ifndef HAVE_UINT32_T -# if SIZEOF_INT == 4 -typedef unsigned int uint32_t; -# elif SIZEOF_LONG == 4 -typedef unsigned long int uint32_t; -# endif -#endif - -#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) -# if defined(__LITTLE_ENDIAN__) -# undef WORDS_BIGENDIAN -# else -# if defined(__BIG_ENDIAN__) -# define WORDS_BIGENDIAN -# endif -# endif -#endif - -#ifdef WORDS_BIGENDIAN -#define IEEE_BIG_ENDIAN -#else -#define IEEE_LITTLE_ENDIAN -#endif - -#if defined(__arm__) && !defined(__VFP_FP__) -/* - * * Although the CPU is little endian the FP has different - * * byte and word endianness. The byte order is still little endian - * * but the word order is big endian. - * */ -#define IEEE_BIG_ENDIAN -#undef IEEE_LITTLE_ENDIAN -#endif - -#ifdef __vax__ -#define VAX -#endif - -#if defined(_MSC_VER) -#define int32_t __int32 -#define uint32_t unsigned __int32 -#define IEEE_LITTLE_ENDIAN -#endif - -#define Long int32_t -#define ULong uint32_t - -#ifdef __cplusplus -#include "malloc.h" -#include "memory.h" -#else -#ifndef KR_headers -#include "stdlib.h" -#include "string.h" -#include "locale.h" -#else -#include "malloc.h" -#include "memory.h" -#endif -#endif - -#ifdef MALLOC -#ifdef KR_headers -extern char *MALLOC(); -#else -extern void *MALLOC(size_t); -#endif -#else -#define MALLOC malloc -#endif - -#include "ctype.h" -#include "errno.h" - -#ifdef Bad_float_h -#ifdef IEEE_BIG_ENDIAN -#define IEEE_ARITHMETIC -#endif -#ifdef IEEE_LITTLE_ENDIAN -#define IEEE_ARITHMETIC -#endif - -#ifdef IEEE_ARITHMETIC -#define DBL_DIG 15 -#define DBL_MAX_10_EXP 308 -#define DBL_MAX_EXP 1024 -#define FLT_RADIX 2 -#define FLT_ROUNDS 1 -#define DBL_MAX 1.7976931348623157e+308 -#endif - -#ifdef IBM -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 75 -#define DBL_MAX_EXP 63 -#define FLT_RADIX 16 -#define FLT_ROUNDS 0 -#define DBL_MAX 7.2370055773322621e+75 -#endif - -#ifdef VAX -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 38 -#define DBL_MAX_EXP 127 -#define FLT_RADIX 2 -#define FLT_ROUNDS 1 -#define DBL_MAX 1.7014118346046923e+38 -#endif - - -#ifndef LONG_MAX -#define LONG_MAX 2147483647 -#endif -#else -#include "float.h" -#endif -#ifndef __MATH_H__ -#include "math.h" -#endif - -BEGIN_EXTERN_C() - -#ifndef CONST -#ifdef KR_headers -#define CONST /* blank */ -#else -#define CONST const -#endif -#endif - -#ifdef Unsigned_Shifts -#define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000; -#else -#define Sign_Extend(a,b) /*no-op*/ -#endif - -#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \ - defined(IBM) != 1 - Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or - IBM should be defined. -#endif - - typedef union { - double d; - ULong ul[2]; - } _double; -#define value(x) ((x).d) -#ifdef IEEE_LITTLE_ENDIAN -#define word0(x) ((x).ul[1]) -#define word1(x) ((x).ul[0]) -#else -#define word0(x) ((x).ul[0]) -#define word1(x) ((x).ul[1]) -#endif - -/* The following definition of Storeinc is appropriate for MIPS processors. - * An alternative that might be better on some machines is - * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) - */ -#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(__arm__) -#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ - ((unsigned short *)a)[0] = (unsigned short)c, a++) -#else -#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ - ((unsigned short *)a)[1] = (unsigned short)c, a++) -#endif - -/* #define P DBL_MANT_DIG */ -/* Ten_pmax = floor(P*log(2)/log(5)) */ -/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ -/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ -/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ - -#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) -#define Exp_shift 20 -#define Exp_shift1 20 -#define Exp_msk1 0x100000 -#define Exp_msk11 0x100000 -#define Exp_mask 0x7ff00000 -#define P 53 -#define Bias 1023 -#define IEEE_Arith -#define Emin (-1022) -#define Exp_1 0x3ff00000 -#define Exp_11 0x3ff00000 -#define Ebits 11 -#define Frac_mask 0xfffff -#define Frac_mask1 0xfffff -#define Ten_pmax 22 -#define Bletch 0x10 -#define Bndry_mask 0xfffff -#define Bndry_mask1 0xfffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 1 -#define Tiny0 0 -#define Tiny1 1 -#define Quick_max 14 -#define Int_max 14 -#define Infinite(x) (word0(x) == 0x7ff00000) /* sufficient test for here */ -#else -#undef Sudden_Underflow -#define Sudden_Underflow -#ifdef IBM -#define Exp_shift 24 -#define Exp_shift1 24 -#define Exp_msk1 0x1000000 -#define Exp_msk11 0x1000000 -#define Exp_mask 0x7f000000 -#define P 14 -#define Bias 65 -#define Exp_1 0x41000000 -#define Exp_11 0x41000000 -#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ -#define Frac_mask 0xffffff -#define Frac_mask1 0xffffff -#define Bletch 4 -#define Ten_pmax 22 -#define Bndry_mask 0xefffff -#define Bndry_mask1 0xffffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 4 -#define Tiny0 0x100000 -#define Tiny1 0 -#define Quick_max 14 -#define Int_max 15 -#else /* VAX */ -#define Exp_shift 23 -#define Exp_shift1 7 -#define Exp_msk1 0x80 -#define Exp_msk11 0x800000 -#define Exp_mask 0x7f80 -#define P 56 -#define Bias 129 -#define Exp_1 0x40800000 -#define Exp_11 0x4080 -#define Ebits 8 -#define Frac_mask 0x7fffff -#define Frac_mask1 0xffff007f -#define Ten_pmax 24 -#define Bletch 2 -#define Bndry_mask 0xffff007f -#define Bndry_mask1 0xffff007f -#define LSB 0x10000 -#define Sign_bit 0x8000 -#define Log2P 1 -#define Tiny0 0x80 -#define Tiny1 0 -#define Quick_max 15 -#define Int_max 15 -#endif -#endif - -#ifndef IEEE_Arith -#define ROUND_BIASED -#endif - -#ifdef RND_PRODQUOT -#define rounded_product(a,b) a = rnd_prod(a, b) -#define rounded_quotient(a,b) a = rnd_quot(a, b) -#ifdef KR_headers -extern double rnd_prod(), rnd_quot(); -#else -extern double rnd_prod(double, double), rnd_quot(double, double); -#endif -#else -#define rounded_product(a,b) a *= b -#define rounded_quotient(a,b) a /= b -#endif - -#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) -#define Big1 0xffffffff - -#ifndef Just_16 -/* When Pack_32 is not defined, we store 16 bits per 32-bit Long. - * * This makes some inner loops simpler and sometimes saves work - * * during multiplications, but it often seems to make things slightly - * * slower. Hence the default is now to store 32 bits per Long. - * */ -#ifndef Pack_32 -#define Pack_32 -#endif -#endif - -#define Kmax 15 - -struct Bigint { - struct Bigint *next; - int k, maxwds, sign, wds; - ULong x[1]; -}; - -typedef struct Bigint Bigint; - -/* static variables, multithreading fun! */ -static Bigint *freelist[Kmax+1]; -static Bigint *p5s; - -static void destroy_freelist(void); - -#ifdef ZTS - -static MUTEX_T dtoa_mutex; -static MUTEX_T pow5mult_mutex; - -#define _THREAD_PRIVATE_MUTEX_LOCK(x) tsrm_mutex_lock(x); -#define _THREAD_PRIVATE_MUTEX_UNLOCK(x) tsrm_mutex_unlock(x); - -#else - -#define _THREAD_PRIVATE_MUTEX_LOCK(x) -#define _THREAD_PRIVATE_MUTEX_UNLOCK(x) - -#endif /* ZTS */ - -ZEND_API int zend_startup_strtod(void) /* {{{ */ -{ -#ifdef ZTS - dtoa_mutex = tsrm_mutex_alloc(); - pow5mult_mutex = tsrm_mutex_alloc(); -#endif - return 1; -} -/* }}} */ -ZEND_API int zend_shutdown_strtod(void) /* {{{ */ -{ - destroy_freelist(); -#ifdef ZTS - tsrm_mutex_free(dtoa_mutex); - dtoa_mutex = NULL; - - tsrm_mutex_free(pow5mult_mutex); - pow5mult_mutex = NULL; -#endif - return 1; -} -/* }}} */ - -static Bigint * Balloc(int k) -{ - int x; - Bigint *rv; - - if (k > Kmax) { - zend_error(E_ERROR, "Balloc() allocation exceeds list boundary"); - } - - _THREAD_PRIVATE_MUTEX_LOCK(dtoa_mutex); - if ((rv = freelist[k])) { - freelist[k] = rv->next; - } else { - x = 1 << k; - rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long)); - if (!rv) { - _THREAD_PRIVATE_MUTEX_UNLOCK(dtoa_mutex); - zend_error(E_ERROR, "Balloc() failed to allocate memory"); - } - rv->k = k; - rv->maxwds = x; - } - _THREAD_PRIVATE_MUTEX_UNLOCK(dtoa_mutex); - rv->sign = rv->wds = 0; - return rv; -} - -static void Bfree(Bigint *v) -{ - if (v) { - _THREAD_PRIVATE_MUTEX_LOCK(dtoa_mutex); - v->next = freelist[v->k]; - freelist[v->k] = v; - _THREAD_PRIVATE_MUTEX_UNLOCK(dtoa_mutex); - } -} - -#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \ - y->wds*sizeof(Long) + 2*sizeof(int)) - -/* return value is only used as a simple string, so mis-aligned parts - * inside the Bigint are not at risk on strict align architectures - */ -static char * rv_alloc(int i) { - int j, k, *r; - - j = sizeof(ULong); - for(k = 0; - sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= i; - j <<= 1) { - k++; - } - r = (int*)Balloc(k); - *r = k; - return (char *)(r+1); -} - - -static char * nrv_alloc(char *s, char **rve, int n) -{ - char *rv, *t; - - t = rv = rv_alloc(n); - while((*t = *s++) !=0) { - t++; - } - if (rve) { - *rve = t; - } - return rv; -} - -static Bigint * multadd(Bigint *b, int m, int a) /* multiply by m and add a */ -{ - int i, wds; - ULong *x, y; -#ifdef Pack_32 - ULong xi, z; -#endif - Bigint *b1; - - wds = b->wds; - x = b->x; - i = 0; - do { -#ifdef Pack_32 - xi = *x; - y = (xi & 0xffff) * m + a; - z = (xi >> 16) * m + (y >> 16); - a = (int)(z >> 16); - *x++ = (z << 16) + (y & 0xffff); -#else - y = *x * m + a; - a = (int)(y >> 16); - *x++ = y & 0xffff; -#endif - } - while(++i < wds); - if (a) { - if (wds >= b->maxwds) { - b1 = Balloc(b->k+1); - Bcopy(b1, b); - Bfree(b); - b = b1; - } - b->x[wds++] = a; - b->wds = wds; - } - return b; -} - -static int hi0bits(ULong x) -{ - int k = 0; - - if (!(x & 0xffff0000)) { - k = 16; - x <<= 16; - } - if (!(x & 0xff000000)) { - k += 8; - x <<= 8; - } - if (!(x & 0xf0000000)) { - k += 4; - x <<= 4; - } - if (!(x & 0xc0000000)) { - k += 2; - x <<= 2; - } - if (!(x & 0x80000000)) { - k++; - if (!(x & 0x40000000)) { - return 32; - } - } - return k; -} - -static int lo0bits(ULong *y) -{ - int k; - ULong x = *y; - - if (x & 7) { - if (x & 1) { - return 0; - } - if (x & 2) { - *y = x >> 1; - return 1; - } - *y = x >> 2; - return 2; - } - k = 0; - if (!(x & 0xffff)) { - k = 16; - x >>= 16; - } - if (!(x & 0xff)) { - k += 8; - x >>= 8; - } - if (!(x & 0xf)) { - k += 4; - x >>= 4; - } - if (!(x & 0x3)) { - k += 2; - x >>= 2; - } - if (!(x & 1)) { - k++; - x >>= 1; - if (!(x & 1)) { - return 32; - } - } - *y = x; - return k; -} - -static Bigint * i2b(int i) -{ - Bigint *b; - - b = Balloc(1); - b->x[0] = i; - b->wds = 1; - return b; -} - -static Bigint * mult(Bigint *a, Bigint *b) -{ - Bigint *c; - int k, wa, wb, wc; - ULong carry, y, z; - ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; -#ifdef Pack_32 - ULong z2; -#endif - - if (a->wds < b->wds) { - c = a; - a = b; - b = c; - } - k = a->k; - wa = a->wds; - wb = b->wds; - wc = wa + wb; - if (wc > a->maxwds) { - k++; - } - c = Balloc(k); - for(x = c->x, xa = x + wc; x < xa; x++) { - *x = 0; - } - xa = a->x; - xae = xa + wa; - xb = b->x; - xbe = xb + wb; - xc0 = c->x; -#ifdef Pack_32 - for(; xb < xbe; xb++, xc0++) { - if ((y = *xb & 0xffff)) { - x = xa; - xc = xc0; - carry = 0; - do { - z = (*x & 0xffff) * y + (*xc & 0xffff) + carry; - carry = z >> 16; - z2 = (*x++ >> 16) * y + (*xc >> 16) + carry; - carry = z2 >> 16; - Storeinc(xc, z2, z); - } - while(x < xae); - *xc = carry; - } - if ((y = *xb >> 16)) { - x = xa; - xc = xc0; - carry = 0; - z2 = *xc; - do { - z = (*x & 0xffff) * y + (*xc >> 16) + carry; - carry = z >> 16; - Storeinc(xc, z, z2); - z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry; - carry = z2 >> 16; - } - while(x < xae); - *xc = z2; - } - } -#else - for(; xb < xbe; xc0++) { - if (y = *xb++) { - x = xa; - xc = xc0; - carry = 0; - do { - z = *x++ * y + *xc + carry; - carry = z >> 16; - *xc++ = z & 0xffff; - } - while(x < xae); - *xc = carry; - } - } -#endif - for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ; - c->wds = wc; - return c; -} - -static Bigint * s2b (CONST char *s, int nd0, int nd, ULong y9) -{ - Bigint *b; - int i, k; - Long x, y; - - x = (nd + 8) / 9; - for(k = 0, y = 1; x > y; y <<= 1, k++) ; -#ifdef Pack_32 - b = Balloc(k); - b->x[0] = y9; - b->wds = 1; -#else - b = Balloc(k+1); - b->x[0] = y9 & 0xffff; - b->wds = (b->x[1] = y9 >> 16) ? 2 : 1; -#endif - - i = 9; - if (9 < nd0) { - s += 9; - do b = multadd(b, 10, *s++ - '0'); - while(++i < nd0); - s++; - } else { - s += 10; - } - for(; i < nd; i++) { - b = multadd(b, 10, *s++ - '0'); - } - return b; -} - -static Bigint * pow5mult(Bigint *b, int k) -{ - Bigint *b1, *p5, *p51; - int i; - static int p05[3] = { 5, 25, 125 }; - - _THREAD_PRIVATE_MUTEX_LOCK(pow5mult_mutex); - if ((i = k & 3)) { - b = multadd(b, p05[i-1], 0); - } - - if (!(k >>= 2)) { - _THREAD_PRIVATE_MUTEX_UNLOCK(pow5mult_mutex); - return b; - } - if (!(p5 = p5s)) { - /* first time */ - p5 = p5s = i2b(625); - p5->next = 0; - } - for(;;) { - if (k & 1) { - b1 = mult(b, p5); - Bfree(b); - b = b1; - } - if (!(k >>= 1)) { - break; - } - if (!(p51 = p5->next)) { - if (!(p51 = p5->next)) { - p51 = p5->next = mult(p5,p5); - p51->next = 0; - } - } - p5 = p51; - } - _THREAD_PRIVATE_MUTEX_UNLOCK(pow5mult_mutex); - return b; -} - - -static Bigint *lshift(Bigint *b, int k) -{ - int i, k1, n, n1; - Bigint *b1; - ULong *x, *x1, *xe, z; - -#ifdef Pack_32 - n = k >> 5; -#else - n = k >> 4; -#endif - k1 = b->k; - n1 = n + b->wds + 1; - for(i = b->maxwds; n1 > i; i <<= 1) { - k1++; - } - b1 = Balloc(k1); - x1 = b1->x; - for(i = 0; i < n; i++) { - *x1++ = 0; - } - x = b->x; - xe = x + b->wds; -#ifdef Pack_32 - if (k &= 0x1f) { - k1 = 32 - k; - z = 0; - do { - *x1++ = *x << k | z; - z = *x++ >> k1; - } - while(x < xe); - if ((*x1 = z)) { - ++n1; - } - } -#else - if (k &= 0xf) { - k1 = 16 - k; - z = 0; - do { - *x1++ = *x << k & 0xffff | z; - z = *x++ >> k1; - } - while(x < xe); - if (*x1 = z) { - ++n1; - } - } -#endif - else do - *x1++ = *x++; - while(x < xe); - b1->wds = n1 - 1; - Bfree(b); - return b1; -} - -static int cmp(Bigint *a, Bigint *b) -{ - ULong *xa, *xa0, *xb, *xb0; - int i, j; - - i = a->wds; - j = b->wds; -#ifdef DEBUG - if (i > 1 && !a->x[i-1]) - Bug("cmp called with a->x[a->wds-1] == 0"); - if (j > 1 && !b->x[j-1]) - Bug("cmp called with b->x[b->wds-1] == 0"); -#endif - if (i -= j) - return i; - xa0 = a->x; - xa = xa0 + j; - xb0 = b->x; - xb = xb0 + j; - for(;;) { - if (*--xa != *--xb) - return *xa < *xb ? -1 : 1; - if (xa <= xa0) - break; - } - return 0; -} - - -static Bigint * diff(Bigint *a, Bigint *b) -{ - Bigint *c; - int i, wa, wb; - Long borrow, y; /* We need signed shifts here. */ - ULong *xa, *xae, *xb, *xbe, *xc; -#ifdef Pack_32 - Long z; -#endif - - i = cmp(a,b); - if (!i) { - c = Balloc(0); - c->wds = 1; - c->x[0] = 0; - return c; - } - if (i < 0) { - c = a; - a = b; - b = c; - i = 1; - } else { - i = 0; - } - c = Balloc(a->k); - c->sign = i; - wa = a->wds; - xa = a->x; - xae = xa + wa; - wb = b->wds; - xb = b->x; - xbe = xb + wb; - xc = c->x; - borrow = 0; -#ifdef Pack_32 - do { - y = (*xa & 0xffff) - (*xb & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - z = (*xa++ >> 16) - (*xb++ >> 16) + borrow; - borrow = z >> 16; - Sign_Extend(borrow, z); - Storeinc(xc, z, y); - } while(xb < xbe); - while(xa < xae) { - y = (*xa & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - z = (*xa++ >> 16) + borrow; - borrow = z >> 16; - Sign_Extend(borrow, z); - Storeinc(xc, z, y); - } -#else - do { - y = *xa++ - *xb++ + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - *xc++ = y & 0xffff; - } while(xb < xbe); - while(xa < xae) { - y = *xa++ + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - *xc++ = y & 0xffff; - } -#endif - while(!*--xc) { - wa--; - } - c->wds = wa; - return c; -} - -static double ulp (double _x) -{ - volatile _double x; - register Long L; - volatile _double a; - - value(x) = _x; - L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; -#ifndef Sudden_Underflow - if (L > 0) { -#endif -#ifdef IBM - L |= Exp_msk1 >> 4; -#endif - word0(a) = L; - word1(a) = 0; -#ifndef Sudden_Underflow - } - else { - L = -L >> Exp_shift; - if (L < Exp_shift) { - word0(a) = 0x80000 >> L; - word1(a) = 0; - } - else { - word0(a) = 0; - L -= Exp_shift; - word1(a) = L >= 31 ? 1 : 1 << (31 - L); - } - } -#endif - return value(a); -} - -static double -b2d -#ifdef KR_headers -(a, e) Bigint *a; int *e; -#else -(Bigint *a, int *e) -#endif -{ - ULong *xa, *xa0, w, y, z; - int k; - volatile _double d; -#ifdef VAX - ULong d0, d1; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - - xa0 = a->x; - xa = xa0 + a->wds; - y = *--xa; -#ifdef DEBUG - if (!y) Bug("zero y in b2d"); -#endif - k = hi0bits(y); - *e = 32 - k; -#ifdef Pack_32 - if (k < Ebits) { - d0 = Exp_1 | y >> (Ebits - k); - w = xa > xa0 ? *--xa : 0; - d1 = y << ((32-Ebits) + k) | w >> (Ebits - k); - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - if (k -= Ebits) { - d0 = Exp_1 | y << k | z >> (32 - k); - y = xa > xa0 ? *--xa : 0; - d1 = z << k | y >> (32 - k); - } - else { - d0 = Exp_1 | y; - d1 = z; - } -#else - if (k < Ebits + 16) { - z = xa > xa0 ? *--xa : 0; - d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k; - w = xa > xa0 ? *--xa : 0; - y = xa > xa0 ? *--xa : 0; - d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k; - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - w = xa > xa0 ? *--xa : 0; - k -= Ebits + 16; - d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k; - y = xa > xa0 ? *--xa : 0; - d1 = w << k + 16 | y << k; -#endif -ret_d: -#ifdef VAX - word0(d) = d0 >> 16 | d0 << 16; - word1(d) = d1 >> 16 | d1 << 16; -#else -#undef d0 -#undef d1 -#endif - return value(d); -} - - -static Bigint * d2b(double _d, int *e, int *bits) -{ - Bigint *b; - int de, i, k; - ULong *x, y, z; - volatile _double d; -#ifdef VAX - ULong d0, d1; -#endif - - value(d) = _d; -#ifdef VAX - d0 = word0(d) >> 16 | word0(d) << 16; - d1 = word1(d) >> 16 | word1(d) << 16; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - -#ifdef Pack_32 - b = Balloc(1); -#else - b = Balloc(2); -#endif - x = b->x; - - z = d0 & Frac_mask; - d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ -#ifdef Sudden_Underflow - de = (int)(d0 >> Exp_shift); -#ifndef IBM - z |= Exp_msk11; -#endif -#else - if ((de = (int)(d0 >> Exp_shift))) - z |= Exp_msk1; -#endif -#ifdef Pack_32 - if ((y = d1)) { - if ((k = lo0bits(&y))) { - x[0] = y | (z << (32 - k)); - z >>= k; - } else { - x[0] = y; - } - i = b->wds = (x[1] = z) ? 2 : 1; - } else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - x[0] = z; - i = b->wds = 1; - k += 32; - } -#else - if (y = d1) { - if (k = lo0bits(&y)) { - if (k >= 16) { - x[0] = y | z << 32 - k & 0xffff; - x[1] = z >> k - 16 & 0xffff; - x[2] = z >> k; - i = 2; - } else { - x[0] = y & 0xffff; - x[1] = y >> 16 | z << 16 - k & 0xffff; - x[2] = z >> k & 0xffff; - x[3] = z >> k+16; - i = 3; - } - } else { - x[0] = y & 0xffff; - x[1] = y >> 16; - x[2] = z & 0xffff; - x[3] = z >> 16; - i = 3; - } - } else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - if (k >= 16) { - x[0] = z; - i = 0; - } else { - x[0] = z & 0xffff; - x[1] = z >> 16; - i = 1; - } - k += 32; - } - while(!x[i]) - --i; - b->wds = i + 1; -#endif -#ifndef Sudden_Underflow - if (de) { -#endif -#ifdef IBM - *e = (de - Bias - (P-1) << 2) + k; - *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask); -#else - *e = de - Bias - (P-1) + k; - *bits = P - k; -#endif -#ifndef Sudden_Underflow - } else { - *e = de - Bias - (P-1) + 1 + k; -#ifdef Pack_32 - *bits = 32*i - hi0bits(x[i-1]); -#else - *bits = (i+2)*16 - hi0bits(x[i]); -#endif - } -#endif - return b; -} -#undef d0 -#undef d1 - - -static double ratio (Bigint *a, Bigint *b) -{ - volatile _double da, db; - int k, ka, kb; - - value(da) = b2d(a, &ka); - value(db) = b2d(b, &kb); -#ifdef Pack_32 - k = ka - kb + 32*(a->wds - b->wds); -#else - k = ka - kb + 16*(a->wds - b->wds); -#endif -#ifdef IBM - if (k > 0) { - word0(da) += (k >> 2)*Exp_msk1; - if (k &= 3) { - da *= 1 << k; - } - } else { - k = -k; - word0(db) += (k >> 2)*Exp_msk1; - if (k &= 3) - db *= 1 << k; - } -#else - if (k > 0) { - word0(da) += k*Exp_msk1; - } else { - k = -k; - word0(db) += k*Exp_msk1; - } -#endif - return value(da) / value(db); -} - -static CONST double -tens[] = { - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - 1e20, 1e21, 1e22 -#ifdef VAX - , 1e23, 1e24 -#endif -}; - -#ifdef IEEE_Arith -static CONST double bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 }; -static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 }; -#define n_bigtens 5 -#else -#ifdef IBM -static CONST double bigtens[] = { 1e16, 1e32, 1e64 }; -static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 }; -#define n_bigtens 3 -#else -static CONST double bigtens[] = { 1e16, 1e32 }; -static CONST double tinytens[] = { 1e-16, 1e-32 }; -#define n_bigtens 2 -#endif -#endif - - -static int quorem(Bigint *b, Bigint *S) -{ - int n; - Long borrow, y; - ULong carry, q, ys; - ULong *bx, *bxe, *sx, *sxe; -#ifdef Pack_32 - Long z; - ULong si, zs; -#endif - - n = S->wds; -#ifdef DEBUG - /*debug*/ if (b->wds > n) - /*debug*/ Bug("oversize b in quorem"); -#endif - if (b->wds < n) - return 0; - sx = S->x; - sxe = sx + --n; - bx = b->x; - bxe = bx + n; - q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ -#ifdef DEBUG - /*debug*/ if (q > 9) - /*debug*/ Bug("oversized quotient in quorem"); -#endif - if (q) { - borrow = 0; - carry = 0; - do { -#ifdef Pack_32 - si = *sx++; - ys = (si & 0xffff) * q + carry; - zs = (si >> 16) * q + (ys >> 16); - carry = zs >> 16; - y = (*bx & 0xffff) - (ys & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - z = (*bx >> 16) - (zs & 0xffff) + borrow; - borrow = z >> 16; - Sign_Extend(borrow, z); - Storeinc(bx, z, y); -#else - ys = *sx++ * q + carry; - carry = ys >> 16; - y = *bx - (ys & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - *bx++ = y & 0xffff; -#endif - } - while(sx <= sxe); - if (!*bxe) { - bx = b->x; - while(--bxe > bx && !*bxe) - --n; - b->wds = n; - } - } - if (cmp(b, S) >= 0) { - q++; - borrow = 0; - carry = 0; - bx = b->x; - sx = S->x; - do { -#ifdef Pack_32 - si = *sx++; - ys = (si & 0xffff) + carry; - zs = (si >> 16) + (ys >> 16); - carry = zs >> 16; - y = (*bx & 0xffff) - (ys & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - z = (*bx >> 16) - (zs & 0xffff) + borrow; - borrow = z >> 16; - Sign_Extend(borrow, z); - Storeinc(bx, z, y); -#else - ys = *sx++ + carry; - carry = ys >> 16; - y = *bx - (ys & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - *bx++ = y & 0xffff; -#endif - } - while(sx <= sxe); - bx = b->x; - bxe = bx + n; - if (!*bxe) { - while(--bxe > bx && !*bxe) - --n; - b->wds = n; - } - } - return q; -} - -static void destroy_freelist(void) -{ - int i; - Bigint *tmp; - - _THREAD_PRIVATE_MUTEX_LOCK(dtoa_mutex); - for (i = 0; i <= Kmax; i++) { - Bigint **listp = &freelist[i]; - while ((tmp = *listp) != NULL) { - *listp = tmp->next; - free(tmp); - } - freelist[i] = NULL; - } - _THREAD_PRIVATE_MUTEX_UNLOCK(dtoa_mutex); - -} - - -ZEND_API void zend_freedtoa(char *s) -{ - Bigint *b = (Bigint *)((int *)s - 1); - b->maxwds = 1 << (b->k = *(int*)b); - Bfree(b); -} - -/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. - * - * Inspired by "How to Print Floating-Point Numbers Accurately" by - * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 92-101]. - * - * Modifications: - * 1. Rather than iterating, we use a simple numeric overestimate - * to determine k = floor(log10(d)). We scale relevant - * quantities using O(log2(k)) rather than O(k) multiplications. - * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't - * try to generate digits strictly left to right. Instead, we - * compute with fewer bits and propagate the carry if necessary - * when rounding the final digit up. This is often faster. - * 3. Under the assumption that input will be rounded nearest, - * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. - * That is, we allow equality in stopping tests when the - * round-nearest rule will give the same floating-point value - * as would satisfaction of the stopping test with strict - * inequality. - * 4. We remove common factors of powers of 2 from relevant - * quantities. - * 5. When converting floating-point integers less than 1e16, - * we use floating-point arithmetic rather than resorting - * to multiple-precision integers. - * 6. When asked to produce fewer than 15 digits, we first try - * to get by with floating-point arithmetic; we resort to - * multiple-precision integer arithmetic only if we cannot - * guarantee that the floating-point calculation has given - * the correctly rounded result. For k requested digits and - * "uniformly" distributed input, the probability is - * something like 10^(k-15) that we must resort to the Long - * calculation. - */ - -ZEND_API char * zend_dtoa(double _d, int mode, int ndigits, int *decpt, int *sign, char **rve) -{ - /* Arguments ndigits, decpt, sign are similar to those - of ecvt and fcvt; trailing zeros are suppressed from - the returned string. If not null, *rve is set to point - to the end of the return value. If d is +-Infinity or NaN, - then *decpt is set to 9999. - - mode: - 0 ==> shortest string that yields d when read in - and rounded to nearest. - 1 ==> like 0, but with Steele & White stopping rule; - e.g. with IEEE P754 arithmetic , mode 0 gives - 1e23 whereas mode 1 gives 9.999999999999999e22. - 2 ==> max(1,ndigits) significant digits. This gives a - return value similar to that of ecvt, except - that trailing zeros are suppressed. - 3 ==> through ndigits past the decimal point. This - gives a return value similar to that from fcvt, - except that trailing zeros are suppressed, and - ndigits can be negative. - 4-9 should give the same return values as 2-3, i.e., - 4 <= mode <= 9 ==> same return as mode - 2 + (mode & 1). These modes are mainly for - debugging; often they run slower but sometimes - faster than modes 2-3. - 4,5,8,9 ==> left-to-right digit generation. - 6-9 ==> don't try fast floating-point estimate - (if applicable). - - Values of mode other than 0-9 are treated as mode 0. - - Sufficient space is allocated to the return value - to hold the suppressed trailing zeros. - */ - - int bbits, b2, b5, be, dig, i, ieps, ilim = 0, ilim0, ilim1, - j, j1, k, k0, k_check, leftright, m2, m5, s2, s5, - spec_case = 0, try_quick; - Long L; -#ifndef Sudden_Underflow - int denorm; - ULong x; -#endif - Bigint *b, *b1, *delta, *mlo, *mhi, *S, *tmp; - double ds; - char *s, *s0; - volatile _double d, d2, eps; - - value(d) = _d; - - if (word0(d) & Sign_bit) { - /* set sign for everything, including 0's and NaNs */ - *sign = 1; - word0(d) &= ~Sign_bit; /* clear sign bit */ - } - else - *sign = 0; - -#if defined(IEEE_Arith) + defined(VAX) -#ifdef IEEE_Arith - if ((word0(d) & Exp_mask) == Exp_mask) -#else - if (word0(d) == 0x8000) -#endif - { - /* Infinity or NaN */ - *decpt = 9999; -#ifdef IEEE_Arith - if (!word1(d) && !(word0(d) & 0xfffff)) - return nrv_alloc("Infinity", rve, 8); -#endif - return nrv_alloc("NaN", rve, 3); - } -#endif -#ifdef IBM - value(d) += 0; /* normalize */ -#endif - if (!value(d)) { - *decpt = 1; - return nrv_alloc("0", rve, 1); - } - - b = d2b(value(d), &be, &bbits); -#ifdef Sudden_Underflow - i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)); -#else - if ((i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)))) { -#endif - value(d2) = value(d); - word0(d2) &= Frac_mask1; - word0(d2) |= Exp_11; -#ifdef IBM - if (j = 11 - hi0bits(word0(d2) & Frac_mask)) - value(d2) /= 1 << j; -#endif - - /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 - * log10(x) = log(x) / log(10) - * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) - * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2) - * - * This suggests computing an approximation k to log10(d) by - * - * k = (i - Bias)*0.301029995663981 - * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); - * - * We want k to be too large rather than too small. - * The error in the first-order Taylor series approximation - * is in our favor, so we just round up the constant enough - * to compensate for any error in the multiplication of - * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, - * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, - * adding 1e-13 to the constant term more than suffices. - * Hence we adjust the constant term to 0.1760912590558. - * (We could get a more accurate k by invoking log10, - * but this is probably not worthwhile.) - */ - - i -= Bias; -#ifdef IBM - i <<= 2; - i += j; -#endif -#ifndef Sudden_Underflow - denorm = 0; - } - else { - /* d is denormalized */ - - i = bbits + be + (Bias + (P-1) - 1); - x = i > 32 ? (word0(d) << (64 - i)) | (word1(d) >> (i - 32)) - : (word1(d) << (32 - i)); - value(d2) = x; - word0(d2) -= 31*Exp_msk1; /* adjust exponent */ - i -= (Bias + (P-1) - 1) + 1; - denorm = 1; - } -#endif - ds = (value(d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; - k = (int)ds; - if (ds < 0. && ds != k) - k--; /* want k = floor(ds) */ - k_check = 1; - if (k >= 0 && k <= Ten_pmax) { - if (value(d) < tens[k]) - k--; - k_check = 0; - } - j = bbits - i - 1; - if (j >= 0) { - b2 = 0; - s2 = j; - } - else { - b2 = -j; - s2 = 0; - } - if (k >= 0) { - b5 = 0; - s5 = k; - s2 += k; - } - else { - b2 -= k; - b5 = -k; - s5 = 0; - } - if (mode < 0 || mode > 9) - mode = 0; - try_quick = 1; - if (mode > 5) { - mode -= 4; - try_quick = 0; - } - leftright = 1; - switch(mode) { - case 0: - case 1: - ilim = ilim1 = -1; - i = 18; - ndigits = 0; - break; - case 2: - leftright = 0; - /* no break */ - case 4: - if (ndigits <= 0) - ndigits = 1; - ilim = ilim1 = i = ndigits; - break; - case 3: - leftright = 0; - /* no break */ - case 5: - i = ndigits + k + 1; - ilim = i; - ilim1 = i - 1; - if (i <= 0) - i = 1; - } - s = s0 = rv_alloc(i); - - if (ilim >= 0 && ilim <= Quick_max && try_quick) { - - /* Try to get by with floating-point arithmetic. */ - - i = 0; - value(d2) = value(d); - k0 = k; - ilim0 = ilim; - ieps = 2; /* conservative */ - if (k > 0) { - ds = tens[k&0xf]; - j = k >> 4; - if (j & Bletch) { - /* prevent overflows */ - j &= Bletch - 1; - value(d) /= bigtens[n_bigtens-1]; - ieps++; - } - for(; j; j >>= 1, i++) - if (j & 1) { - ieps++; - ds *= bigtens[i]; - } - value(d) /= ds; - } - else if ((j1 = -k)) { - value(d) *= tens[j1 & 0xf]; - for(j = j1 >> 4; j; j >>= 1, i++) - if (j & 1) { - ieps++; - value(d) *= bigtens[i]; - } - } - if (k_check && value(d) < 1. && ilim > 0) { - if (ilim1 <= 0) - goto fast_failed; - ilim = ilim1; - k--; - value(d) *= 10.; - ieps++; - } - value(eps) = ieps*value(d) + 7.; - word0(eps) -= (P-1)*Exp_msk1; - if (ilim == 0) { - S = mhi = 0; - value(d) -= 5.; - if (value(d) > value(eps)) - goto one_digit; - if (value(d) < -value(eps)) - goto no_digits; - goto fast_failed; - } -#ifndef No_leftright - if (leftright) { - /* Use Steele & White method of only - * generating digits needed. - */ - value(eps) = 0.5/tens[ilim-1] - value(eps); - for(i = 0;;) { - L = value(d); - value(d) -= L; - *s++ = '0' + (int)L; - if (value(d) < value(eps)) - goto ret1; - if (1. - value(d) < value(eps)) - goto bump_up; - if (++i >= ilim) - break; - value(eps) *= 10.; - value(d) *= 10.; - } - } - else { -#endif - /* Generate ilim digits, then fix them up. */ - value(eps) *= tens[ilim-1]; - for(i = 1;; i++, value(d) *= 10.) { - L = value(d); - value(d) -= L; - *s++ = '0' + (int)L; - if (i == ilim) { - if (value(d) > 0.5 + value(eps)) - goto bump_up; - else if (value(d) < 0.5 - value(eps)) { - while(*--s == '0'); - s++; - goto ret1; - } - break; - } - } -#ifndef No_leftright - } -#endif -fast_failed: - s = s0; - value(d) = value(d2); - k = k0; - ilim = ilim0; - } - - /* Do we have a "small" integer? */ - - if (be >= 0 && k <= Int_max) { - /* Yes. */ - ds = tens[k]; - if (ndigits < 0 && ilim <= 0) { - S = mhi = 0; - if (ilim < 0 || value(d) <= 5*ds) - goto no_digits; - goto one_digit; - } - for(i = 1;; i++) { - L = value(d) / ds; - value(d) -= L*ds; -#ifdef Check_FLT_ROUNDS - /* If FLT_ROUNDS == 2, L will usually be high by 1 */ - if (value(d) < 0) { - L--; - value(d) += ds; - } -#endif - *s++ = '0' + (int)L; - if (i == ilim) { - value(d) += value(d); - if (value(d) > ds || (value(d) == ds && (L & 1))) { -bump_up: - while(*--s == '9') - if (s == s0) { - k++; - *s = '0'; - break; - } - ++*s++; - } - break; - } - if (!(value(d) *= 10.)) - break; - } - goto ret1; - } - - m2 = b2; - m5 = b5; - mhi = mlo = 0; - if (leftright) { - if (mode < 2) { - i = -#ifndef Sudden_Underflow - denorm ? be + (Bias + (P-1) - 1 + 1) : -#endif -#ifdef IBM - 1 + 4*P - 3 - bbits + ((bbits + be - 1) & 3); -#else - 1 + P - bbits; -#endif - } - else { - j = ilim - 1; - if (m5 >= j) - m5 -= j; - else { - s5 += j -= m5; - b5 += j; - m5 = 0; - } - if ((i = ilim) < 0) { - m2 -= i; - i = 0; - } - } - b2 += i; - s2 += i; - mhi = i2b(1); - } - if (m2 > 0 && s2 > 0) { - i = m2 < s2 ? m2 : s2; - b2 -= i; - m2 -= i; - s2 -= i; - } - if (b5 > 0) { - if (leftright) { - if (m5 > 0) { - mhi = pow5mult(mhi, m5); - b1 = mult(mhi, b); - Bfree(b); - b = b1; - } - if ((j = b5 - m5)) { - b = pow5mult(b, j); - } - } else { - b = pow5mult(b, b5); - } - } - S = i2b(1); - if (s5 > 0) - S = pow5mult(S, s5); - /* Check for special case that d is a normalized power of 2. */ - - if (mode < 2) { - if (!word1(d) && !(word0(d) & Bndry_mask) -#ifndef Sudden_Underflow - && word0(d) & Exp_mask -#endif - ) { - /* The special case */ - b2 += Log2P; - s2 += Log2P; - spec_case = 1; - } else { - spec_case = 0; - } - } - - /* Arrange for convenient computation of quotients: - * shift left if necessary so divisor has 4 leading 0 bits. - * - * Perhaps we should just compute leading 28 bits of S once - * and for all and pass them and a shift to quorem, so it - * can do shifts and ors to compute the numerator for q. - */ -#ifdef Pack_32 - if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f)) - i = 32 - i; -#else - if ((i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf)) - i = 16 - i; -#endif - if (i > 4) { - i -= 4; - b2 += i; - m2 += i; - s2 += i; - } - else if (i < 4) { - i += 28; - b2 += i; - m2 += i; - s2 += i; - } - if (b2 > 0) - b = lshift(b, b2); - if (s2 > 0) - S = lshift(S, s2); - if (k_check) { - if (cmp(b,S) < 0) { - k--; - b = multadd(b, 10, 0); /* we botched the k estimate */ - if (leftright) - mhi = multadd(mhi, 10, 0); - ilim = ilim1; - } - } - if (ilim <= 0 && mode > 2) { - if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) { - /* no digits, fcvt style */ -no_digits: - k = -1 - ndigits; - goto ret; - } -one_digit: - *s++ = '1'; - k++; - goto ret; - } - if (leftright) { - if (m2 > 0) - mhi = lshift(mhi, m2); - - /* Compute mlo -- check for special case - * that d is a normalized power of 2. - */ - - mlo = mhi; - if (spec_case) { - mhi = Balloc(mhi->k); - Bcopy(mhi, mlo); - mhi = lshift(mhi, Log2P); - } - - for(i = 1;;i++) { - dig = quorem(b,S) + '0'; - /* Do we yet have the shortest decimal string - * that will round to d? - */ - j = cmp(b, mlo); - delta = diff(S, mhi); - j1 = delta->sign ? 1 : cmp(b, delta); - Bfree(delta); -#ifndef ROUND_BIASED - if (j1 == 0 && !mode && !(word1(d) & 1)) { - if (dig == '9') - goto round_9_up; - if (j > 0) - dig++; - *s++ = dig; - goto ret; - } -#endif - if (j < 0 || (j == 0 && !mode -#ifndef ROUND_BIASED - && !(word1(d) & 1) -#endif - )) { - if (j1 > 0) { - b = lshift(b, 1); - j1 = cmp(b, S); - if ((j1 > 0 || (j1 == 0 && (dig & 1))) - && dig++ == '9') - goto round_9_up; - } - *s++ = dig; - goto ret; - } - if (j1 > 0) { - if (dig == '9') { /* possible if i == 1 */ -round_9_up: - *s++ = '9'; - goto roundoff; - } - *s++ = dig + 1; - goto ret; - } - *s++ = dig; - if (i == ilim) - break; - b = multadd(b, 10, 0); - if (mlo == mhi) - mlo = mhi = multadd(mhi, 10, 0); - else { - mlo = multadd(mlo, 10, 0); - mhi = multadd(mhi, 10, 0); - } - } - } - else - for(i = 1;; i++) { - *s++ = dig = quorem(b,S) + '0'; - if (i >= ilim) - break; - b = multadd(b, 10, 0); - } - - /* Round off last digit */ - - b = lshift(b, 1); - j = cmp(b, S); - if (j > 0 || (j == 0 && (dig & 1))) { -roundoff: - while(*--s == '9') - if (s == s0) { - k++; - *s++ = '1'; - goto ret; - } - ++*s++; - } - else { - while(*--s == '0'); - s++; - } -ret: - Bfree(S); - if (mhi) { - if (mlo && mlo != mhi) - Bfree(mlo); - Bfree(mhi); - } -ret1: - - _THREAD_PRIVATE_MUTEX_LOCK(pow5mult_mutex); - while (p5s) { - tmp = p5s; - p5s = p5s->next; - free(tmp); - } - _THREAD_PRIVATE_MUTEX_UNLOCK(pow5mult_mutex); - - Bfree(b); - - if (s == s0) { /* don't return empty string */ - *s++ = '0'; - k = 0; - } - *s = 0; - *decpt = k + 1; - if (rve) - *rve = s; - return s0; -} - -ZEND_API double zend_strtod (CONST char *s00, char **se) -{ - int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, - e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; - CONST char *s, *s0, *s1; - double aadj, aadj1, adj; - volatile _double rv, rv0; - Long L; - ULong y, z; - Bigint *bb, *bb1, *bd, *bd0, *bs, *delta, *tmp; - double result; - - CONST char decimal_point = '.'; - - sign = nz0 = nz = 0; - value(rv) = 0.; - - - for(s = s00; isspace((unsigned char) *s); s++) - ; - - if (*s == '-') { - sign = 1; - s++; - } else if (*s == '+') { - s++; - } - - if (*s == '\0') { - s = s00; - goto ret; - } - - if (*s == '0') { - nz0 = 1; - while(*++s == '0') ; - if (!*s) - goto ret; - } - s0 = s; - y = z = 0; - for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) - if (nd < 9) - y = 10*y + c - '0'; - else if (nd < 16) - z = 10*z + c - '0'; - nd0 = nd; - if (c == decimal_point) { - c = *++s; - if (!nd) { - for(; c == '0'; c = *++s) - nz++; - if (c > '0' && c <= '9') { - s0 = s; - nf += nz; - nz = 0; - goto have_dig; - } - goto dig_done; - } - for(; c >= '0' && c <= '9'; c = *++s) { -have_dig: - nz++; - if (c -= '0') { - nf += nz; - for(i = 1; i < nz; i++) - if (nd++ < 9) - y *= 10; - else if (nd <= DBL_DIG + 1) - z *= 10; - if (nd++ < 9) - y = 10*y + c; - else if (nd <= DBL_DIG + 1) - z = 10*z + c; - nz = 0; - } - } - } -dig_done: - e = 0; - if (c == 'e' || c == 'E') { - if (!nd && !nz && !nz0) { - s = s00; - goto ret; - } - s00 = s; - esign = 0; - switch(c = *++s) { - case '-': - esign = 1; - case '+': - c = *++s; - } - if (c >= '0' && c <= '9') { - while(c == '0') - c = *++s; - if (c > '0' && c <= '9') { - L = c - '0'; - s1 = s; - while((c = *++s) >= '0' && c <= '9') - L = 10*L + c - '0'; - if (s - s1 > 8 || L > 19999) - /* Avoid confusion from exponents - * so large that e might overflow. - */ - e = 19999; /* safe for 16 bit ints */ - else - e = (int)L; - if (esign) - e = -e; - } - else - e = 0; - } - else - s = s00; - } - if (!nd) { - if (!nz && !nz0) - s = s00; - goto ret; - } - e1 = e -= nf; - - /* Now we have nd0 digits, starting at s0, followed by a - * decimal point, followed by nd-nd0 digits. The number we're - * after is the integer represented by those digits times - * 10**e */ - - if (!nd0) - nd0 = nd; - k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; - value(rv) = y; - if (k > 9) - value(rv) = tens[k - 9] * value(rv) + z; - bd0 = 0; - if (nd <= DBL_DIG -#ifndef RND_PRODQUOT - && FLT_ROUNDS == 1 -#endif - ) { - if (!e) - goto ret; - if (e > 0) { - if (e <= Ten_pmax) { -#ifdef VAX - goto vax_ovfl_check; -#else - /* value(rv) = */ rounded_product(value(rv), - tens[e]); - goto ret; -#endif - } - i = DBL_DIG - nd; - if (e <= Ten_pmax + i) { - /* A fancier test would sometimes let us do - * this for larger i values. - */ - e -= i; - value(rv) *= tens[i]; -#ifdef VAX - /* VAX exponent range is so narrow we must - * worry about overflow here... - */ -vax_ovfl_check: - word0(rv) -= P*Exp_msk1; - /* value(rv) = */ rounded_product(value(rv), - tens[e]); - if ((word0(rv) & Exp_mask) - > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) - goto ovfl; - word0(rv) += P*Exp_msk1; -#else - /* value(rv) = */ rounded_product(value(rv), - tens[e]); -#endif - goto ret; - } - } -#ifndef Inaccurate_Divide - else if (e >= -Ten_pmax) { - /* value(rv) = */ rounded_quotient(value(rv), - tens[-e]); - goto ret; - } -#endif - } - e1 += nd - k; - - /* Get starting approximation = rv * 10**e1 */ - - if (e1 > 0) { - if ((i = e1 & 15)) - value(rv) *= tens[i]; - if (e1 &= ~15) { - if (e1 > DBL_MAX_10_EXP) { -ovfl: - errno = ERANGE; -#ifndef Bad_float_h - value(rv) = HUGE_VAL; -#else - /* Can't trust HUGE_VAL */ -#ifdef IEEE_Arith - word0(rv) = Exp_mask; - word1(rv) = 0; -#else - word0(rv) = Big0; - word1(rv) = Big1; -#endif -#endif - if (bd0) - goto retfree; - goto ret; - } - if (e1 >>= 4) { - for(j = 0; e1 > 1; j++, e1 >>= 1) - if (e1 & 1) - value(rv) *= bigtens[j]; - /* The last multiplication could overflow. */ - word0(rv) -= P*Exp_msk1; - value(rv) *= bigtens[j]; - if ((z = word0(rv) & Exp_mask) - > Exp_msk1*(DBL_MAX_EXP+Bias-P)) - goto ovfl; - if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) { - /* set to largest number */ - /* (Can't trust DBL_MAX) */ - word0(rv) = Big0; - word1(rv) = Big1; - } - else - word0(rv) += P*Exp_msk1; - } - - } - } - else if (e1 < 0) { - e1 = -e1; - if ((i = e1 & 15)) - value(rv) /= tens[i]; - if (e1 &= ~15) { - e1 >>= 4; - if (e1 >= 1 << n_bigtens) - goto undfl; - for(j = 0; e1 > 1; j++, e1 >>= 1) - if (e1 & 1) - value(rv) *= tinytens[j]; - /* The last multiplication could underflow. */ - value(rv0) = value(rv); - value(rv) *= tinytens[j]; - if (!value(rv)) { - value(rv) = 2.*value(rv0); - value(rv) *= tinytens[j]; - if (!value(rv)) { -undfl: - value(rv) = 0.; - errno = ERANGE; - if (bd0) - goto retfree; - goto ret; - } - word0(rv) = Tiny0; - word1(rv) = Tiny1; - /* The refinement below will clean - * this approximation up. - */ - } - } - } - - /* Now the hard part -- adjusting rv to the correct value.*/ - - /* Put digits into bd: true value = bd * 10^e */ - - bd0 = s2b(s0, nd0, nd, y); - - for(;;) { - bd = Balloc(bd0->k); - Bcopy(bd, bd0); - bb = d2b(value(rv), &bbe, &bbbits); /* rv = bb * 2^bbe */ - bs = i2b(1); - - if (e >= 0) { - bb2 = bb5 = 0; - bd2 = bd5 = e; - } - else { - bb2 = bb5 = -e; - bd2 = bd5 = 0; - } - if (bbe >= 0) - bb2 += bbe; - else - bd2 -= bbe; - bs2 = bb2; -#ifdef Sudden_Underflow -#ifdef IBM - j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3); -#else - j = P + 1 - bbbits; -#endif -#else - i = bbe + bbbits - 1; /* logb(rv) */ - if (i < Emin) /* denormal */ - j = bbe + (P-Emin); - else - j = P + 1 - bbbits; -#endif - bb2 += j; - bd2 += j; - i = bb2 < bd2 ? bb2 : bd2; - if (i > bs2) - i = bs2; - if (i > 0) { - bb2 -= i; - bd2 -= i; - bs2 -= i; - } - if (bb5 > 0) { - bs = pow5mult(bs, bb5); - bb1 = mult(bs, bb); - Bfree(bb); - bb = bb1; - } - if (bb2 > 0) - bb = lshift(bb, bb2); - if (bd5 > 0) - bd = pow5mult(bd, bd5); - if (bd2 > 0) - bd = lshift(bd, bd2); - if (bs2 > 0) - bs = lshift(bs, bs2); - delta = diff(bb, bd); - dsign = delta->sign; - delta->sign = 0; - i = cmp(delta, bs); - if (i < 0) { - /* Error is less than half an ulp -- check for - * special case of mantissa a power of two. - */ - if (dsign || word1(rv) || word0(rv) & Bndry_mask) - break; - delta = lshift(delta,Log2P); - if (cmp(delta, bs) > 0) - goto drop_down; - break; - } - if (i == 0) { - /* exactly half-way between */ - if (dsign) { - if ((word0(rv) & Bndry_mask1) == Bndry_mask1 - && word1(rv) == 0xffffffff) { - /*boundary case -- increment exponent*/ - word0(rv) = (word0(rv) & Exp_mask) - + Exp_msk1 -#ifdef IBM - | Exp_msk1 >> 4 -#endif - ; - word1(rv) = 0; - break; - } - } - else if (!(word0(rv) & Bndry_mask) && !word1(rv)) { -drop_down: - /* boundary case -- decrement exponent */ -#ifdef Sudden_Underflow - L = word0(rv) & Exp_mask; -#ifdef IBM - if (L < Exp_msk1) -#else - if (L <= Exp_msk1) -#endif - goto undfl; - L -= Exp_msk1; -#else - L = (word0(rv) & Exp_mask) - Exp_msk1; -#endif - word0(rv) = L | Bndry_mask1; - word1(rv) = 0xffffffff; -#ifdef IBM - goto cont; -#else - break; -#endif - } -#ifndef ROUND_BIASED - if (!(word1(rv) & LSB)) - break; -#endif - if (dsign) - value(rv) += ulp(value(rv)); -#ifndef ROUND_BIASED - else { - value(rv) -= ulp(value(rv)); -#ifndef Sudden_Underflow - if (!value(rv)) - goto undfl; -#endif - } -#endif - break; - } - if ((aadj = ratio(delta, bs)) <= 2.) { - if (dsign) - aadj = aadj1 = 1.; - else if (word1(rv) || word0(rv) & Bndry_mask) { -#ifndef Sudden_Underflow - if (word1(rv) == Tiny1 && !word0(rv)) - goto undfl; -#endif - aadj = 1.; - aadj1 = -1.; - } - else { - /* special case -- power of FLT_RADIX to be */ - /* rounded down... */ - - if (aadj < 2./FLT_RADIX) - aadj = 1./FLT_RADIX; - else - aadj *= 0.5; - aadj1 = -aadj; - } - } - else { - aadj *= 0.5; - aadj1 = dsign ? aadj : -aadj; -#ifdef Check_FLT_ROUNDS - switch(FLT_ROUNDS) { - case 2: /* towards +infinity */ - aadj1 -= 0.5; - break; - case 0: /* towards 0 */ - case 3: /* towards -infinity */ - aadj1 += 0.5; - } -#else - if (FLT_ROUNDS == 0) - aadj1 += 0.5; -#endif - } - y = word0(rv) & Exp_mask; - - /* Check for overflow */ - - if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) { - value(rv0) = value(rv); - word0(rv) -= P*Exp_msk1; - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; - if ((word0(rv) & Exp_mask) >= - Exp_msk1*(DBL_MAX_EXP+Bias-P)) { - if (word0(rv0) == Big0 && word1(rv0) == Big1) - goto ovfl; - word0(rv) = Big0; - word1(rv) = Big1; - goto cont; - } - else - word0(rv) += P*Exp_msk1; - } - else { -#ifdef Sudden_Underflow - if ((word0(rv) & Exp_mask) <= P*Exp_msk1) { - value(rv0) = value(rv); - word0(rv) += P*Exp_msk1; - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; -#ifdef IBM - if ((word0(rv) & Exp_mask) < P*Exp_msk1) -#else - if ((word0(rv) & Exp_mask) <= P*Exp_msk1) -#endif - { - if (word0(rv0) == Tiny0 - && word1(rv0) == Tiny1) - goto undfl; - word0(rv) = Tiny0; - word1(rv) = Tiny1; - goto cont; - } - else - word0(rv) -= P*Exp_msk1; - } - else { - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; - } -#else - /* Compute adj so that the IEEE rounding rules will - * correctly round rv + adj in some half-way cases. - * If rv * ulp(rv) is denormalized (i.e., - * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid - * trouble from bits lost to denormalization; - * example: 1.2e-307 . - */ - if (y <= (P-1)*Exp_msk1 && aadj >= 1.) { - aadj1 = (double)(int)(aadj + 0.5); - if (!dsign) - aadj1 = -aadj1; - } - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; -#endif - } - z = word0(rv) & Exp_mask; - if (y == z) { - /* Can we stop now? */ - L = aadj; - aadj -= L; - /* The tolerances below are conservative. */ - if (dsign || word1(rv) || word0(rv) & Bndry_mask) { - if (aadj < .4999999 || aadj > .5000001) - break; - } - else if (aadj < .4999999/FLT_RADIX) - break; - } -cont: - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(delta); - } -retfree: - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(bd0); - Bfree(delta); -ret: - if (se) - *se = (char *)s; - result = sign ? -value(rv) : value(rv); - - _THREAD_PRIVATE_MUTEX_LOCK(pow5mult_mutex); - while (p5s) { - tmp = p5s; - p5s = p5s->next; - free(tmp); - } - _THREAD_PRIVATE_MUTEX_UNLOCK(pow5mult_mutex); - - return result; -} - -ZEND_API double zend_hex_strtod(const char *str, char **endptr) -{ - const char *s = str; - char c; - int any = 0; - double value = 0; - - if (*s == '0' && (s[1] == 'x' || s[1] == 'X')) { - s += 2; - } - - while ((c = *s++)) { - if (c >= '0' && c <= '9') { - c -= '0'; - } else if (c >= 'A' && c <= 'F') { - c -= 'A' - 10; - } else if (c >= 'a' && c <= 'f') { - c -= 'a' - 10; - } else { - break; - } - - any = 1; - value = value * 16 + c; - } - - if (endptr != NULL) { - *endptr = (char *)(any ? s - 1 : str); - } - - return value; -} - -ZEND_API double zend_oct_strtod(const char *str, char **endptr) -{ - const char *s = str; - char c; - double value = 0; - int any = 0; - - /* skip leading zero */ - s++; - - while ((c = *s++)) { - if (c > '7') { - /* break and return the current value if the number is not well-formed - * that's what Linux strtol() does - */ - break; - } - value = value * 8 + c - '0'; - any = 1; - } - - if (endptr != NULL) { - *endptr = (char *)(any ? s - 1 : str); - } - - return value; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/Zend/zend_strtod.h b/Zend/zend_strtod.h deleted file mode 100644 index d9d6abead454b..0000000000000 --- a/Zend/zend_strtod.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Derick Rethans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This is a header file for the strtod implementation by David M. Gay which - * can be found in zend_strtod.c */ -#ifndef ZEND_STRTOD_H -#define ZEND_STRTOD_H -#include - -BEGIN_EXTERN_C() -ZEND_API void zend_freedtoa(char *s); -ZEND_API char * zend_dtoa(double _d, int mode, int ndigits, int *decpt, int *sign, char **rve); -ZEND_API double zend_strtod(const char *s00, char **se); -ZEND_API double zend_hex_strtod(const char *str, char **endptr); -ZEND_API double zend_oct_strtod(const char *str, char **endptr); -ZEND_API int zend_startup_strtod(void); -ZEND_API int zend_shutdown_strtod(void); -END_EXTERN_C() - -#endif diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c deleted file mode 100644 index 79feea56bd85b..0000000000000 --- a/Zend/zend_ts_hash.c +++ /dev/null @@ -1,373 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Harald Radi | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_ts_hash.h" - -/* ts management functions */ -static void begin_read(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_lock(ht->mx_reader); - if ((++(ht->reader)) == 1) { - tsrm_mutex_lock(ht->mx_writer); - } - tsrm_mutex_unlock(ht->mx_reader); -#endif -} - -static void end_read(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_lock(ht->mx_reader); - if ((--(ht->reader)) == 0) { - tsrm_mutex_unlock(ht->mx_writer); - } - tsrm_mutex_unlock(ht->mx_reader); -#endif -} - -static void begin_write(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_lock(ht->mx_writer); -#endif -} - -static void end_write(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_unlock(ht->mx_writer); -#endif -} - -/* delegates */ -ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC) -{ -#ifdef ZTS - ht->mx_reader = tsrm_mutex_alloc(); - ht->mx_writer = tsrm_mutex_alloc(); - ht->reader = 0; -#endif - return _zend_hash_init(TS_HASH(ht), nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_RELAY_CC); -} - -ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC) -{ -#ifdef ZTS - ht->mx_reader = tsrm_mutex_alloc(); - ht->mx_writer = tsrm_mutex_alloc(); - ht->reader = 0; -#endif - return _zend_hash_init_ex(TS_HASH(ht), nSize, pHashFunction, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_RELAY_CC); -} - -ZEND_API void zend_ts_hash_destroy(TsHashTable *ht) -{ - begin_write(ht); - zend_hash_destroy(TS_HASH(ht)); - end_write(ht); - -#ifdef ZTS - tsrm_mutex_free(ht->mx_reader); - tsrm_mutex_free(ht->mx_writer); -#endif -} - -ZEND_API void zend_ts_hash_clean(TsHashTable *ht) -{ - ht->reader = 0; - begin_write(ht); - zend_hash_clean(TS_HASH(ht)); - end_write(ht); -} - -ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) -{ - int retval; - - begin_write(ht); - retval = _zend_hash_add_or_update(TS_HASH(ht), arKey, nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC); - end_write(ht); - - return retval; -} - -ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) -{ - int retval; - - begin_write(ht); - retval = _zend_hash_quick_add_or_update(TS_HASH(ht), arKey, nKeyLength, h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC); - end_write(ht); - - return retval; -} - -ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) -{ - int retval; - - begin_write(ht); - retval = _zend_hash_index_update_or_next_insert(TS_HASH(ht), h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC); - end_write(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, uint nKeyLength) -{ - int retval; - - begin_write(ht); - retval = zend_hash_add_empty_element(TS_HASH(ht), arKey, nKeyLength); - end_write(ht); - - return retval; -} - -ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht) -{ - begin_write(ht); - zend_hash_graceful_destroy(TS_HASH(ht)); - end_write(ht); - -#ifdef ZTS - tsrm_mutex_free(ht->mx_reader); - tsrm_mutex_free(ht->mx_reader); -#endif -} - -ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC) -{ - begin_write(ht); - zend_hash_apply(TS_HASH(ht), apply_func TSRMLS_CC); - end_write(ht); -} - -ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC) -{ - begin_write(ht); - zend_hash_apply_with_argument(TS_HASH(ht), apply_func, argument TSRMLS_CC); - end_write(ht); -} - -ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int num_args, ...) -{ - va_list args; - - va_start(args, num_args); - begin_write(ht); - zend_hash_apply_with_arguments(TS_HASH(ht), apply_func, num_args, args); - end_write(ht); - va_end(args); -} - -ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC) -{ - begin_write(ht); - zend_hash_reverse_apply(TS_HASH(ht), apply_func TSRMLS_CC); - end_write(ht); -} - -ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag) -{ - int retval; - - begin_write(ht); - retval = zend_hash_del_key_or_index(TS_HASH(ht), arKey, nKeyLength, h, flag); - end_write(ht); - - return retval; -} - -ZEND_API ulong zend_ts_get_hash_value(TsHashTable *ht, char *arKey, uint nKeyLength) -{ - ulong retval; - - begin_read(ht); - retval = zend_get_hash_value(arKey, nKeyLength); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData) -{ - int retval; - - begin_read(ht); - retval = zend_hash_find(TS_HASH(ht), arKey, nKeyLength, pData); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData) -{ - int retval; - - begin_read(ht); - retval = zend_hash_quick_find(TS_HASH(ht), arKey, nKeyLength, h, pData); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, ulong h, void **pData) -{ - int retval; - - begin_read(ht); - retval = zend_hash_index_find(TS_HASH(ht), h, pData); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, uint nKeyLength) -{ - int retval; - - begin_read(ht); - retval = zend_hash_exists(TS_HASH(ht), arKey, nKeyLength); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, ulong h) -{ - int retval; - - begin_read(ht); - retval = zend_hash_index_exists(TS_HASH(ht), h); - end_read(ht); - - return retval; -} - -ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size) -{ - begin_read(source); - begin_write(target); - zend_hash_copy(TS_HASH(target), TS_HASH(source), pCopyConstructor, tmp, size); - end_write(target); - end_read(source); -} - -ZEND_API void zend_ts_hash_merge(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite) -{ - begin_read(source); - begin_write(target); - zend_hash_merge(TS_HASH(target), TS_HASH(source), pCopyConstructor, tmp, size, overwrite); - end_write(target); - end_read(source); -} - -ZEND_API void zend_ts_hash_merge_ex(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, uint size, merge_checker_func_t pMergeSource, void *pParam) -{ - begin_read(source); - begin_write(target); - zend_hash_merge_ex(TS_HASH(target), TS_HASH(source), pCopyConstructor, size, pMergeSource, pParam); - end_write(target); - end_read(source); -} - -ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC) -{ - int retval; - - begin_write(ht); - retval = zend_hash_sort(TS_HASH(ht), sort_func, compare_func, renumber TSRMLS_CC); - end_write(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) -{ - int retval; - - begin_read(ht1); - begin_read(ht2); - retval = zend_hash_compare(TS_HASH(ht1), TS_HASH(ht2), compar, ordered TSRMLS_CC); - end_read(ht2); - end_read(ht1); - - return retval; -} - -ZEND_API int zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC) -{ - int retval; - - begin_read(ht); - retval = zend_hash_minmax(TS_HASH(ht), compar, flag, pData TSRMLS_CC); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_num_elements(TsHashTable *ht) -{ - int retval; - - begin_read(ht); - retval = zend_hash_num_elements(TS_HASH(ht)); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_rehash(TsHashTable *ht) -{ - int retval; - - begin_write(ht); - retval = zend_hash_rehash(TS_HASH(ht)); - end_write(ht); - - return retval; -} - -#if ZEND_DEBUG -void zend_ts_hash_display_pListTail(TsHashTable *ht) -{ - begin_read(ht); - zend_hash_display_pListTail(TS_HASH(ht)); - end_read(ht); -} - -void zend_ts_hash_display(TsHashTable *ht) -{ - begin_read(ht); - zend_hash_display(TS_HASH(ht)); - end_read(ht); -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h deleted file mode 100644 index 4543fb8b09af8..0000000000000 --- a/Zend/zend_ts_hash.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Harald Radi | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_TS_HASH_H -#define ZEND_TS_HASH_H - -#include "zend.h" - -typedef struct _zend_ts_hashtable { - HashTable hash; - zend_uint reader; -#ifdef ZTS - MUTEX_T mx_reader; - MUTEX_T mx_writer; -#endif -} TsHashTable; - -BEGIN_EXTERN_C() - -#define TS_HASH(table) (&(table->hash)) - -/* startup/shutdown */ -ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC); -ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC); -ZEND_API void zend_ts_hash_destroy(TsHashTable *ht); -ZEND_API void zend_ts_hash_clean(TsHashTable *ht); - -#define zend_ts_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \ - _zend_ts_hash_init(ht, nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_CC) -#define zend_ts_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) \ - _zend_ts_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_CC) - - -/* additions/updates/changes */ -ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); -#define zend_ts_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ - _zend_ts_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) -#define zend_ts_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ - _zend_ts_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) - -ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); -#define zend_ts_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ - _zend_ts_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) -#define zend_ts_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ - _zend_ts_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) - -ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); -#define zend_ts_hash_index_update(ht, h, pData, nDataSize, pDest) \ - _zend_ts_hash_index_update_or_next_insert(ht, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) -#define zend_ts_hash_next_index_insert(ht, pData, nDataSize, pDest) \ - _zend_ts_hash_index_update_or_next_insert(ht, 0, pData, nDataSize, pDest, HASH_NEXT_INSERT ZEND_FILE_LINE_CC) - -ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, uint nKeyLength); - -ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht); -ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC); -ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC); -ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int, ...); - -ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC); - - -/* Deletes */ -ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag); -#define zend_ts_hash_del(ht, arKey, nKeyLength) \ - zend_ts_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY) -#define zend_ts_hash_index_del(ht, h) \ - zend_ts_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX) - -ZEND_API ulong zend_ts_get_hash_value(TsHashTable *ht, char *arKey, uint nKeyLength); - -/* Data retreival */ -ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData); -ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData); -ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, ulong h, void **pData); - -/* Misc */ -ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, uint nKeyLength); -ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, ulong h); - -/* Copying, merging and sorting */ -ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size); -ZEND_API void zend_ts_hash_merge(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite); -ZEND_API void zend_ts_hash_merge_ex(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, uint size, merge_checker_func_t pMergeSource, void *pParam); -ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC); -ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC); -ZEND_API int zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC); - -ZEND_API int zend_ts_hash_num_elements(TsHashTable *ht); - -ZEND_API int zend_ts_hash_rehash(TsHashTable *ht); - -ZEND_API ulong zend_ts_hash_func(char *arKey, uint nKeyLength); - -#if ZEND_DEBUG -/* debug */ -void zend_ts_hash_display_pListTail(TsHashTable *ht); -void zend_ts_hash_display(TsHashTable *ht); -#endif - -END_EXTERN_C() - -#define ZEND_TS_INIT_SYMTABLE(ht) \ - ZEND_TS_INIT_SYMTABLE_EX(ht, 2, 0) - -#define ZEND_TS_INIT_SYMTABLE_EX(ht, n, persistent) \ - zend_ts_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent) - -#endif /* ZEND_HASH_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_types.h b/Zend/zend_types.h deleted file mode 100644 index 66b328547b06b..0000000000000 --- a/Zend/zend_types.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_TYPES_H -#define ZEND_TYPES_H - -typedef unsigned char zend_bool; -typedef unsigned char zend_uchar; -typedef unsigned int zend_uint; -typedef unsigned long zend_ulong; -typedef unsigned short zend_ushort; - -#ifdef _WIN64 -typedef __int64 zend_intptr_t; -typedef unsigned __int64 zend_uintptr_t; -#else -typedef long zend_intptr_t; -typedef unsigned long zend_uintptr_t; -#endif - -typedef unsigned int zend_object_handle; -typedef struct _zend_object_handlers zend_object_handlers; - -typedef struct _zend_object_value { - zend_object_handle handle; - zend_object_handlers *handlers; -} zend_object_value; - -#endif /* ZEND_TYPES_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c deleted file mode 100644 index 0f5d771931922..0000000000000 --- a/Zend/zend_variables.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include "zend.h" -#include "zend_API.h" -#include "zend_globals.h" -#include "zend_constants.h" -#include "zend_list.h" - - -ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type & ~IS_CONSTANT_INDEX) { - case IS_STRING: - case IS_CONSTANT: - CHECK_ZVAL_STRING_REL(zvalue); - STR_FREE_REL(zvalue->value.str.val); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { - TSRMLS_FETCH(); - - if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) { - zend_hash_destroy(zvalue->value.ht); - FREE_HASHTABLE(zvalue->value.ht); - } - } - break; - case IS_OBJECT: - { - TSRMLS_FETCH(); - - Z_OBJ_HT_P(zvalue)->del_ref(zvalue TSRMLS_CC); - } - break; - case IS_RESOURCE: - { - TSRMLS_FETCH(); - - /* destroy resource */ - zend_list_delete(zvalue->value.lval); - } - break; - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - case IS_NULL: - default: - return; - break; - } -} - - -ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type & ~IS_CONSTANT_INDEX) { - case IS_STRING: - case IS_CONSTANT: - CHECK_ZVAL_STRING_REL(zvalue); - free(zvalue->value.str.val); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources"); - break; - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - case IS_NULL: - default: - break; - } -} - - -ZEND_API void zval_add_ref(zval **p) -{ - (*p)->refcount++; -} - - -ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type) { - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_addref(zvalue->value.lval); - } - break; - case IS_BOOL: - case IS_LONG: - case IS_NULL: - break; - case IS_CONSTANT: - case IS_STRING: - CHECK_ZVAL_STRING_REL(zvalue); - zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { - zval *tmp; - HashTable *original_ht = zvalue->value.ht; - HashTable *tmp_ht = NULL; - TSRMLS_FETCH(); - - if (zvalue->value.ht == &EG(symbol_table)) { - return; /* do nothing */ - } - ALLOC_HASHTABLE_REL(tmp_ht); - zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - zvalue->value.ht = tmp_ht; - } - break; - case IS_OBJECT: - { - TSRMLS_FETCH(); - Z_OBJ_HT_P(zvalue)->add_ref(zvalue TSRMLS_CC); - } - break; - } -} - - -ZEND_API int zend_print_variable(zval *var) -{ - return zend_print_zval(var, 0); -} - - -#if ZEND_DEBUG -ZEND_API void _zval_copy_ctor_wrapper(zval *zvalue) -{ - zval_copy_ctor(zvalue); -} - - -ZEND_API void _zval_dtor_wrapper(zval *zvalue) -{ - zval_dtor(zvalue); -} - - -ZEND_API void _zval_internal_dtor_wrapper(zval *zvalue) -{ - zval_internal_dtor(zvalue); -} - - -ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr) -{ - zval_ptr_dtor(zval_ptr); -} - - -ZEND_API void _zval_internal_ptr_dtor_wrapper(zval **zval_ptr) -{ - zval_internal_ptr_dtor(zval_ptr); -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h deleted file mode 100644 index da7eee4344743..0000000000000 --- a/Zend/zend_variables.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_VARIABLES_H -#define ZEND_VARIABLES_H - - -BEGIN_EXTERN_C() - -ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC); - -static inline void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC) -{ - if (zvalue->type <= IS_BOOL) { - return; - } - _zval_dtor_func(zvalue ZEND_FILE_LINE_CC); -} - -ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC); - -static inline void _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC) -{ - if (zvalue->type <= IS_BOOL) { - return; - } - _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_CC); -} - - -ZEND_API int zend_print_variable(zval *var); -ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC); -ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC); -ZEND_API void _zval_internal_ptr_dtor(zval **zvalue ZEND_FILE_LINE_DC); -#define zval_copy_ctor(zvalue) _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC) -#define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC) -#define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC) -#define zval_internal_dtor(zvalue) _zval_internal_dtor((zvalue) ZEND_FILE_LINE_CC) -#define zval_internal_ptr_dtor(zvalue) _zval_internal_ptr_dtor((zvalue) ZEND_FILE_LINE_CC) - -#if ZEND_DEBUG -ZEND_API void _zval_copy_ctor_wrapper(zval *zvalue); -ZEND_API void _zval_dtor_wrapper(zval *zvalue); -ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr); -ZEND_API void _zval_internal_dtor_wrapper(zval *zvalue); -ZEND_API void _zval_internal_ptr_dtor_wrapper(zval **zvalue); -#define zval_copy_ctor_wrapper _zval_copy_ctor_wrapper -#define zval_dtor_wrapper _zval_dtor_wrapper -#define zval_ptr_dtor_wrapper _zval_ptr_dtor_wrapper -#define zval_internal_dtor_wrapper _zval_internal_dtor_wrapper -#define zval_internal_ptr_dtor_wrapper _zval_internal_ptr_dtor_wrapper -#else -#define zval_copy_ctor_wrapper _zval_copy_ctor_func -#define zval_dtor_wrapper _zval_dtor_func -#define zval_ptr_dtor_wrapper _zval_ptr_dtor -#define zval_internal_dtor_wrapper _zval_internal_dtor -#define zval_internal_ptr_dtor_wrapper _zval_internal_ptr_dtor -#endif - -ZEND_API void zval_add_ref(zval **p); - -END_EXTERN_C() - -#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper -#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper -#define ZVAL_INTERNAL_DTOR (void (*)(void *)) zval_internal_dtor_wrapper -#define ZVAL_INTERNAL_PTR_DTOR (void (*)(void *)) zval_internal_ptr_dtor_wrapper -#define ZVAL_COPY_CTOR (void (*)(void *)) zval_copy_ctor_wrapper - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h deleted file mode 100644 index 945fd2dbe0271..0000000000000 --- a/Zend/zend_vm.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_VM_H -#define ZEND_VM_H - -ZEND_API void zend_vm_use_old_executor(void); -ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode); - -#define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline) - -#endif diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h deleted file mode 100644 index f5abbca325b18..0000000000000 --- a/Zend/zend_vm_def.h +++ /dev/null @@ -1,3908 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* If you change this file, please regenerate the zend_vm_execute.h and - * zend_vm_opcodes.h files by running: - * php zend_vm_gen.php - */ - -ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(2, ZEND_SUB, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(3, ZEND_MUL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(4, ZEND_DIV, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(6, ZEND_SL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(7, ZEND_SR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(8, ZEND_CONCAT, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(18, ZEND_IS_NOT_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(19, ZEND_IS_SMALLER, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(20, ZEND_IS_SMALLER_OR_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(9, ZEND_BW_OR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(10, ZEND_BW_AND, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(11, ZEND_BW_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(14, ZEND_BOOL_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(12, ZEND_BW_NOT, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(13, ZEND_BOOL_NOT, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC)) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - zval *object; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - FREE_OP2(); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP(free_op_data1); - } - - FREE_OP1_VAR_PTR(); - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC)) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_obj_helper, binary_op, binary_op); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - - if (object_ptr && OP1_TYPE != IS_CV && !OP1_FREE) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_obj_helper, binary_op, binary_op); - } else { - zend_op *op_data = opline+1; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW), dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = GET_OP2_ZVAL_PTR(BP_VAR_R); - var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP2(); - FREE_OP1_VAR_PTR(); - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP2(); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(23, ZEND_ASSIGN_ADD, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, add_function); -} - -ZEND_VM_HANDLER(24, ZEND_ASSIGN_SUB, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, sub_function); -} - -ZEND_VM_HANDLER(25, ZEND_ASSIGN_MUL, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, mul_function); -} - -ZEND_VM_HANDLER(26, ZEND_ASSIGN_DIV, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, div_function); -} - -ZEND_VM_HANDLER(27, ZEND_ASSIGN_MOD, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, mod_function); -} - -ZEND_VM_HANDLER(28, ZEND_ASSIGN_SL, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, shift_left_function); -} - -ZEND_VM_HANDLER(29, ZEND_ASSIGN_SR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, shift_right_function); -} - -ZEND_VM_HANDLER(30, ZEND_ASSIGN_CONCAT, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, concat_function); -} - -ZEND_VM_HANDLER(31, ZEND_ASSIGN_BW_OR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_or_function); -} - -ZEND_VM_HANDLER(32, ZEND_ASSIGN_BW_AND, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_and_function); -} - -ZEND_VM_HANDLER(33, ZEND_ASSIGN_BW_XOR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_xor_function); -} - -ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, incdec_t incdec_op) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - zval *object; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - FREE_OP2(); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(132, ZEND_PRE_INC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_pre_incdec_property_helper, incdec_op, increment_function); -} - -ZEND_VM_HANDLER(133, ZEND_PRE_DEC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_pre_incdec_property_helper, incdec_op, decrement_function); -} - -ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, incdec_t incdec_op) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - zval *object; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - FREE_OP2(); - *retval = *EG(uninitialized_zval_ptr); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(134, ZEND_POST_INC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_post_incdec_property_helper, incdec_op, increment_function); -} - -ZEND_VM_HANDLER(135, ZEND_POST_DEC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_post_incdec_property_helper, incdec_op, decrement_function); -} - -ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval z_copy; - zval *z = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(41, ZEND_PRINT, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ECHO); -} - -ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (OP1_TYPE != IS_TMP_VAR) { - FREE_OP1(); - } - break; - case ZEND_FETCH_LOCAL: - FREE_OP1(); - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (OP1_TYPE == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(80, ZEND_FETCH_R, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_R); -} - -ZEND_VM_HANDLER(83, ZEND_FETCH_W, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_W); -} - -ZEND_VM_HANDLER(86, ZEND_FETCH_RW, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_RW); -} - -ZEND_VM_HANDLER(92, ZEND_FETCH_FUNC_ARG, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, - ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R); -} - -ZEND_VM_HANDLER(95, ZEND_FETCH_UNSET, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_UNSET); -} - -ZEND_VM_HANDLER(89, ZEND_FETCH_IS, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_IS); -} - -ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && - OP1_TYPE != IS_CV && - EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_R), dim, IS_OP2_TMP_FREE(), BP_VAR_R TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_W), dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC); - FREE_OP2(); - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW), dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC); - FREE_OP2(); - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(90, ZEND_FETCH_DIM_IS, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_IS), dim, IS_OP2_TMP_FREE(), BP_VAR_IS TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (OP2_TYPE == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(type), dim, IS_OP2_TMP_FREE(), type TSRMLS_CC); - FREE_OP2(); - if (OP1_TYPE == IS_VAR && type == BP_VAR_W && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_UNSET); - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (OP1_TYPE == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_UNSET TSRMLS_CC); - FREE_OP2(); - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - FREE_OP1_VAR_PTR(); - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, int type) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = GET_OP1_OBJ_ZVAL_PTR(type); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - } - - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_R); -} - -ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && OP1_TYPE != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W), property, BP_VAR_W TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW), property, BP_VAR_RW TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_IS); -} - -ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W), property, BP_VAR_W TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } else { - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_R); - } -} - -ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_R); - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (OP1_TYPE == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - FREE_OP1_VAR_PTR(); - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(98, ZEND_FETCH_DIM_TMP_VAR, CONST|TMP, CONST) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *container = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(container) != IS_ARRAY) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - zend_free_op free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result); - FREE_OP2(); - } - AI_USE_PTR(EX_T(opline->result.u.var).var); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - FREE_OP1_VAR_PTR(); - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (OP1_TYPE == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC); - FREE_OP2(); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - FREE_OP1_VAR_PTR(); - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (IS_OP2_TMP_FREE()?IS_TMP_VAR:OP2_TYPE), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - FREE_OP2_IF_VAR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = GET_OP2_ZVAL_PTR_PTR(BP_VAR_W); - - if (OP2_TYPE == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - if (EG(exception)) { - FREE_OP2_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ASSIGN); - } else if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - PZVAL_LOCK(*value_ptr_ptr); - } - if (OP1_TYPE == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - (*variable_ptr_ptr)->refcount--; - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - FREE_OP1_VAR_PTR(); - FREE_OP2_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(42, ZEND_JMP, ANY, ANY) -{ -#if DEBUG_ZEND>=2 - printf("Jumping to %d\n", EX(opline)->op1.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(EX(opline)->op1.u.jmp_addr); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(44, ZEND_JMPNZ, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(70, ZEND_FREE, TMP, ANY) -{ - zendi_zval_dtor(EX_T(EX(opline)->op1.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(53, ZEND_INIT_STRING, ANY, ANY) -{ - zval *tmp = &EX_T(EX(opline)->result.u.var).tmp_var; - - tmp->value.str.val = emalloc(1); - tmp->value.str.val[0] = 0; - tmp->value.str.len = 0; - tmp->refcount = 1; - tmp->type = IS_STRING; - tmp->is_ref = 0; - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(54, ZEND_ADD_CHAR, TMP, CONST) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_char_to_string(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_NA), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(55, ZEND_ADD_STRING, TMP, CONST) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_NA), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP, TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *var = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval var_copy; - int use_copy = 0; - - if (Z_TYPE_P(var) != IS_STRING) { - zend_make_printable_zval(var, &var_copy, &use_copy); - - if (use_copy) { - var = &var_copy; - } - } - add_string_to_string( &EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_NA), - var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - FREE_OP2(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(109, ZEND_FETCH_CLASS, ANY, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zval *class_name; - zend_free_op free_op2; - - - if (OP2_TYPE == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - FREE_OP2(); - FREE_OP1_IF_VAR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, ANY, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(OP2_TYPE != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (OP2_TYPE == IS_CONST); - zend_free_op free_op2; - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - FREE_OP2(); - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (OP2_TYPE != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - int severity; - char *verb; - if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - verb = "should not"; - } else { - /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ - severity = E_ERROR; - verb = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name, verb); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (OP2_TYPE == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (OP2_TYPE != IS_CONST) { - FREE_OP2(); - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) -{ - zend_op *opline = EX(opline); - zval **original_return_value; - zend_class_entry *current_scope = NULL; - zval *current_this = NULL; - int return_value_used = RETURN_VALUE_USED(opline); - zend_bool should_change_scope; - zend_op *ctor_opline; - - if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ - } - if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { - zend_error(E_STRICT, "Function %s%s%s() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", - EX(function_state).function->common.scope ? "::" : "", - EX(function_state).function->common.function_name); - } - } - - zend_ptr_stack_2_push(&EG(argument_stack), (void *)(zend_uintptr_t)opline->extended_value, NULL); - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (EX(function_state).function->type == ZEND_USER_FUNCTION - || EX(function_state).function->common.scope) { - should_change_scope = 1; - current_this = EG(This); - EG(This) = EX(object); - current_scope = EG(scope); - EG(scope) = (EX(function_state).function->type == ZEND_USER_FUNCTION || !EX(object)) ? EX(function_state).function->common.scope : NULL; - } else { - should_change_scope = 0; - } - - EX_T(opline->result.u.var).var.fcall_returned_reference = 0; - - if (EX(function_state).function->common.scope) { - if (!EG(This) && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) { - int severity; - char *severity_word; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - severity_word = "should not"; - } else { - severity = E_ERROR; - severity_word = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name, severity_word); - } - } - if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { - unsigned char return_reference = EX(function_state).function->common.return_reference; - - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - if (EX(function_state).function->common.arg_info) { - zend_uint i=0; - zval **p; - ulong arg_count; - - p = (zval **) EG(argument_stack).top_element-2; - arg_count = (ulong)(zend_uintptr_t) *p; - - while (arg_count>0) { - zend_verify_arg_type(EX(function_state).function, ++i, *(p-arg_count) TSRMLS_CC); - arg_count--; - } - } - if (!zend_execute_internal) { - /* saves one function call if zend_execute_internal is not used */ - ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), return_value_used TSRMLS_CC); - } else { - zend_execute_internal(EXECUTE_DATA, return_value_used TSRMLS_CC); - } - - EG(current_execute_data) = EXECUTE_DATA; - -/* We shouldn't fix bad extensions here, - because it can break proper ones (Bug #34045) - if (!EX(function_state).function->common.return_reference) { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } -*/ - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.fcall_returned_reference = return_reference; - } - } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) { - EX_T(opline->result.u.var).var.ptr = NULL; - if (EG(symtable_cache_ptr)>=EG(symtable_cache)) { - /*printf("Cache hit! Reusing %x\n", symtable_cache[symtable_cache_ptr]);*/ - EX(function_state).function_symbol_table = *(EG(symtable_cache_ptr)--); - } else { - ALLOC_HASHTABLE(EX(function_state).function_symbol_table); - zend_hash_init(EX(function_state).function_symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0); - /*printf("Cache miss! Initialized %x\n", function_state.function_symbol_table);*/ - } - EG(active_symbol_table) = EX(function_state).function_symbol_table; - original_return_value = EG(return_value_ptr_ptr); - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = (zend_op_array *) EX(function_state).function; - - zend_execute(EG(active_op_array) TSRMLS_CC); - EX_T(opline->result.u.var).var.fcall_returned_reference = EG(active_op_array)->return_reference; - - if (return_value_used && !EX_T(opline->result.u.var).var.ptr) { - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - } - } else if (!return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(return_value_ptr_ptr)=original_return_value; - if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) { - zend_hash_destroy(EX(function_state).function_symbol_table); - FREE_HASHTABLE(EX(function_state).function_symbol_table); - } else { - /* clean before putting into the cache, since clean - could call dtors, which could use cached hash */ - zend_hash_clean(EX(function_state).function_symbol_table); - *(++EG(symtable_cache_ptr)) = EX(function_state).function_symbol_table; - } - EG(active_symbol_table) = EX(symbol_table); - } else { /* ZEND_OVERLOADED_FUNCTION */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - /* Not sure what should be done here if it's a static method */ - if (EX(object)) { - Z_OBJ_HT_P(EX(object))->call_method(EX(fbc)->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), return_value_used TSRMLS_CC); - } else { - zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); - } - - if (EX(function_state).function->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - efree(EX(function_state).function->common.function_name); - } - efree(EX(fbc)); - - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } - } - - EX(function_state).function = (zend_function *) EX(op_array); - EG(function_state_ptr) = &EX(function_state); - ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EG(This)) { - if (EG(exception) && ctor_opline) { - if (RETURN_VALUE_USED(ctor_opline)) { - EG(This)->refcount--; - } - if (EG(This)->refcount == 1) { - zend_object_store_ctor_failed(EG(This) TSRMLS_CC); - } - } - if (should_change_scope) { - zval_ptr_dtor(&EG(This)); - } - } - - if (should_change_scope) { - EG(This) = current_this; - EG(scope) = current_scope; - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - - zend_ptr_stack_clear_multiple(TSRMLS_C); - - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - if (return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(61, ZEND_DO_FCALL_BY_NAME, ANY, ANY) -{ - EX(function_state).function = EX(fbc); - ZEND_VM_DISPATCH_TO_HELPER(zend_do_fcall_common_helper); -} - -ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *fname = GET_OP1_ZVAL_PTR(BP_VAR_R); - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (zend_hash_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function)==FAILURE) { - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val); - } - EX(object) = NULL; - - FREE_OP1(); - - ZEND_VM_DISPATCH_TO_HELPER(zend_do_fcall_common_helper); -} - -ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - zend_free_op free_op1; - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - ZEND_VM_C_GOTO(return_by_value); - } - - retval_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (OP1_TYPE == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (OP1_TYPE == IS_VAR && !OP1_FREE) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - ZEND_VM_C_GOTO(return_by_value); - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -ZEND_VM_C_LABEL(return_by_value): - - retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!IS_OP1_TMP_FREE()) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - FREE_OP1_IF_VAR(); - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -ZEND_VM_HANDLER(108, ZEND_THROW, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - zend_free_op free_op1; - - value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(107, ZEND_CATCH, ANY, ANY) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce; - - /* Check whether an exception has been thrown, if not, jump over code */ - if (EG(exception) == NULL) { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - ce = Z_OBJCE_P(EG(exception)); - if (ce != EX_T(opline->op1.u.var).class_entry) { - if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) { - if (opline->op1.u.EA.type) { - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - } - - zend_hash_update(EG(active_symbol_table), opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.len+1, &EG(exception), sizeof(zval *), (void **) NULL); - EG(exception) = NULL; - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - zend_free_op free_op1; - - value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER(zend_send_by_var_helper, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval *varptr; - zend_free_op free_op1; - varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - FREE_OP1(); /* for string offsets */ - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varptr; - - if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); - } - - if (OP1_TYPE == IS_VAR && - (opline->extended_value & ZEND_ARG_SEND_FUNCTION) && - EX_T(opline->op1.u.var).var.fcall_returned_reference && - EX_T(opline->op1.u.var).var.ptr) { - varptr = EX_T(opline->op1.u.var).var.ptr; - PZVAL_UNLOCK_EX(varptr, &free_op1, 0); - } else { - varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - } - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - EX_T(opline->op1.u.var).var.fcall_returned_reference) && - varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || - (varptr->refcount == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } else { - zval *valptr; - - zend_error(E_STRICT, "Only variables should be passed by reference"); - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, varptr); - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **varptr_ptr; - zval *varptr; - varptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - - if (!varptr_ptr) { - zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - - if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF); - } - ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); -} - -ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY) -{ - zend_op *opline = EX(opline); - zval **param; - zend_uint arg_num = Z_LVAL(opline->op1.u.constant); - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - char *space; - char *class_name = get_active_class_name(&space TSRMLS_CC); - zend_execute_data *ptr = EX(prev_execute_data); - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL TSRMLS_CC); - if(ptr && ptr->op_array) { - zend_error(E_WARNING, "Missing argument %ld for %s%s%s(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno); - } else { - zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C)); - } - if (opline->result.op_type == IS_VAR) { - PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - zend_free_op free_res; - zval **var_ptr; - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param TSRMLS_CC); - var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - if (PZVAL_IS_REF(*param)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, *param TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST) -{ - zend_op *opline = EX(opline); - zval **param, *assignment_value; - zend_uint arg_num = Z_LVAL(opline->op1.u.constant); - zend_free_op free_res; - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - if (Z_TYPE(opline->op2.u.constant) == IS_CONSTANT || Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) { - zval *default_value; - - ALLOC_ZVAL(default_value); - *default_value = opline->op2.u.constant; - default_value->refcount=1; - zval_update_constant(&default_value, 0 TSRMLS_CC); - default_value->refcount=0; - default_value->is_ref=0; - param = &default_value; - assignment_value = default_value; - } else { - param = NULL; - assignment_value = &opline->op2.u.constant; - } - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC); - } else { - zval **var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - - assignment_value = *param; - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - if (PZVAL_IS_REF(assignment_value)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, assignment_value TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - FREE_OP1(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - FREE_OP2(); - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - FREE_OP2(); - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (OP1_TYPE==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - - FREE_OP2(); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - FREE_OP1(); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(49, ZEND_SWITCH_FREE, TMP|VAR, ANY) -{ - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY) -{ - zend_op *opline = EX(opline); - zval *object_zval; - zend_function *constructor; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - char *class_type; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) { - class_type = "interface"; - } else { - class_type = "abstract class"; - } - zend_error_noreturn(E_ERROR, "Cannot instantiate %s %s", class_type, EX_T(opline->op1.u.var).class_entry->name); - } - ALLOC_ZVAL(object_zval); - object_init_ex(object_zval, EX_T(opline->op1.u.var).class_entry); - INIT_PZVAL(object_zval); - - constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC); - - if (constructor == NULL) { - if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - } else { - zval_ptr_dtor(&object_zval); - } - ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.u.opline_num); - } else { - SELECTIVE_PZVAL_LOCK(object_zval, &opline->result); - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), opline); - - /* We are not handling overloaded classes right now */ - EX(object) = object_zval; - EX(fbc) = constructor; - - ZEND_VM_NEXT_OPCODE(); - } -} - -ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *obj = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, CONST|UNUSED, CONST) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = NULL; - zval **value; - - if (OP1_TYPE == IS_UNUSED) { -/* This seems to be a reminant of namespaces - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); - } - } -*/ - if (!zend_get_constant(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len, &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", - opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.val); - EX_T(opline->result.u.var).tmp_var = opline->op2.u.constant; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - ZEND_VM_NEXT_OPCODE(); - } - - ce = EX_T(opline->op1.u.var).class_entry; - - if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zend_class_entry *old_scope = EG(scope); - - EG(scope) = ce; - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EG(scope) = old_scope; - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } else { - zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", opline->op2.u.constant.value.str.val); - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=GET_OP2_ZVAL_PTR(BP_VAR_R); - -#if !defined(ZEND_VM_SPEC) || OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=GET_OP1_ZVAL_PTR(BP_VAR_R); - } -#else - expr_ptr=GET_OP1_ZVAL_PTR(BP_VAR_R); -#endif - - if (IS_OP1_TMP_FREE()) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if !defined(ZEND_VM_SPEC) || OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - FREE_OP2(); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (OP1_TYPE == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if !defined(ZEND_VM_SPEC) || OP1_TYPE != IS_UNUSED - } else { - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ADD_ARRAY_ELEMENT); -#endif - } -} - -ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - if (opline->extended_value != IS_STRING) { - *result = *expr; - if (!IS_OP1_TMP_FREE()) { - zendi_zval_copy_ctor(*result); - } - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(expr, &var_copy, &use_copy); - if (use_copy) { - *result = var_copy; - if (IS_OP1_TMP_FREE()) { - FREE_OP1(); - } - } else { - *result = *expr; - if (!IS_OP1_TMP_FREE()) { - zendi_zval_copy_ctor(*result); - } - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zend_free_op free_op1; - zval *inc_filename = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd_state state; - - state.cwd_length = 0; - state.cwd = malloc(1); - state.cwd[0] = 0; - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - } - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - FREE_OP1(); - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - zend_free_op free_op1; - - varname = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = EXECUTE_DATA; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) { - zval_ptr_dtor(&varname); - } - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET); - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - long index; - - if (container) { - if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = EXECUTE_DATA; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - FREE_OP2(); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - FREE_OP2(); - break; - } - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET); - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (container) { - if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - } else { - FREE_OP2(); - } - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - (*array_ptr_ptr)->is_ref = 1; - } - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - if (IS_OP1_TMP_FREE()) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (OP1_TYPE != IS_TMP_VAR && ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos); - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval **value; - char *str_key; - uint str_key_len; - ulong int_key; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - int key_type = 0; - zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY); - - PZVAL_LOCK(array); - - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { - default: - case ZEND_ITER_INVALID: - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - - case ZEND_ITER_PLAIN_OBJECT: { - char *class_name, *prop_name; - zend_object *zobj = zend_objects_get_address(array TSRMLS_CC); - - fe_ht = HASH_OF(array); - zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos); - do { - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - - zend_hash_move_forward(fe_ht); - } while (key_type == HASH_KEY_NON_EXISTANT || - (key_type != HASH_KEY_IS_LONG && - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS)); - zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos); - if (use_key && key_type != HASH_KEY_IS_LONG) { - zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name); - str_key_len = strlen(prop_name); - str_key = estrndup(prop_name, str_key_len); - str_key_len++; - } - break; - } - - case ZEND_ITER_PLAIN_ARRAY: - fe_ht = HASH_OF(array); - zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos); - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - if (use_key) { - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL); - } - zend_hash_move_forward(fe_ht); - zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos); - break; - - case ZEND_ITER_OBJECT: - /* !iter happens from exception */ - if (iter && ++iter->index > 0) { - /* This could cause an endless loop if index becomes zero again. - * In case that ever happens we need an additional flag. */ - iter->funcs->move_forward(iter TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } - /* If index is zero we come from FE_RESET and checked valid() already. */ - if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) { - /* reached end of iteration */ - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - iter->funcs->get_current_data(iter, &value TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - if (!value) { - /* failure in get_current_data */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - if (use_key) { - if (iter->funcs->get_current_key) { - key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } else { - key_type = HASH_KEY_IS_LONG; - int_key = iter->index; - } - } - break; - } - - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - SEPARATE_ZVAL_IF_NOT_REF(value); - (*value)->is_ref = 1; - EX_T(opline->result.u.var).var.ptr_ptr = value; - (*value)->refcount++; - } else { - EX_T(opline->result.u.var).var.ptr_ptr = value; - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (use_key) { - zend_op *op_data = opline+1; - zval *key = &EX_T(op_data->result.u.var).tmp_var; - - switch (key_type) { - case HASH_KEY_IS_STRING: - Z_STRVAL_P(key) = str_key; - Z_STRLEN_P(key) = str_key_len-1; - Z_TYPE_P(key) = IS_STRING; - break; - case HASH_KEY_IS_LONG: - Z_LVAL_P(key) = int_key; - Z_TYPE_P(key) = IS_LONG; - break; - default: - case HASH_KEY_NON_EXISTANT: - ZVAL_NULL(key); - break; - } - } - - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval tmp, *varname = GET_OP1_ZVAL_PTR(BP_VAR_IS); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - FREE_OP1(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|TMP|VAR|CV, int prop_dim) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_IS); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - FREE_OP2(); - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - FREE_OP2(); - } else { - FREE_OP2(); - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - FREE_OP1_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, prop_dim, 0); -} - -ZEND_VM_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, prop_dim, 1); -} - -ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY) -{ -#if !defined(ZEND_VM_SPEC) || (OP1_TYPE != IS_UNUSED) - zend_op *opline = EX(opline); - if (OP1_TYPE != IS_UNUSED) { - zend_free_op free_op1; - zval *ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - FREE_OP1(); - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; /* shouldn't be necessary */ - if (EX(old_error_reporting) == NULL) { - EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var; - } - - if (EG(error_reporting)) { - zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(142, ZEND_RAISE_ABSTRACT_ERROR, ANY, ANY) -{ - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EG(scope)->name, EX(op_array)->function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ -} - -ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY) -{ - zend_op *opline = EX(opline); - zval restored_error_reporting; - - if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.u.var).tmp_var) != 0) { - Z_TYPE(restored_error_reporting) = IS_LONG; - Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var); - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1); - zendi_zval_dtor(restored_error_reporting); - } - if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) { - EX(old_error_reporting) = NULL; - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(101, ZEND_EXT_STMT, ANY, ANY) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(102, ZEND_EXT_FCALL_BEGIN, ANY, ANY) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(103, ZEND_EXT_FCALL_END, ANY, ANY) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(139, ZEND_DECLARE_CLASS, ANY, ANY) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_class(opline, EG(class_table), 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(140, ZEND_DECLARE_INHERITED_CLASS, ANY, ANY) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(141, ZEND_DECLARE_FUNCTION, ANY, ANY) -{ - do_bind_function(EX(opline), EG(function_table), 0); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(105, ZEND_TICKS, CONST, ANY) -{ - zend_op *opline = EX(opline); - - if (++EG(ticks_count)>=Z_LVAL(opline->op1.u.constant)) { - EG(ticks_count)=0; - if (zend_ticks_function) { - zend_ticks_function(Z_LVAL(opline->op1.u.constant)); - } - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(138, ZEND_INSTANCEOF, TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = GET_OP1_ZVAL_PTR(BP_VAR_R); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(104, ZEND_EXT_NOP, ANY, ANY) -{ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(0, ZEND_NOP, ANY, ANY) -{ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, ANY) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry; - zend_class_entry *iface = EX_T(opline->op2.u.var).class_entry; - - if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name); - } - - zend_do_implement_interface(ce, iface TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) -{ - zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes; - int i; - zend_uint catch_op_num; - int catched = 0; - zval **stack_zval_pp; - zval restored_error_reporting; - - stack_zval_pp = (zval **) EG(argument_stack).top_element - 1; - while (*stack_zval_pp != NULL) { - zval_ptr_dtor(stack_zval_pp); - EG(argument_stack).top_element--; - EG(argument_stack).top--; - stack_zval_pp--; - } - - for (i=0; ilast_try_catch; i++) { - if (EG(active_op_array)->try_catch_array[i].try_op > op_num) { - /* further blocks will not be relevant... */ - break; - } - if (op_num >= EG(active_op_array)->try_catch_array[i].try_op - && op_num < EG(active_op_array)->try_catch_array[i].catch_op) { - catch_op_num = EX(op_array)->try_catch_array[i].catch_op; - catched = 1; - } - } - - while (EX(fbc)) { - zend_op *ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EX(object)) { - if (ctor_opline && RETURN_VALUE_USED(ctor_opline)) { - EX(object)->refcount--; - } - zval_ptr_dtor(&EX(object)); - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - } - - for (i=0; ilast_brk_cont; i++) { - if (EX(op_array)->brk_cont_array[i].start < 0) { - continue; - } else if (EX(op_array)->brk_cont_array[i].start > op_num) { - /* further blocks will not be relevant... */ - break; - } else if (op_num < EX(op_array)->brk_cont_array[i].brk) { - if (!catched || - catch_op_num >= EX(op_array)->brk_cont_array[i].brk) { - zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk]; - - switch (brk_opline->opcode) { - case ZEND_SWITCH_FREE: - zend_switch_free(brk_opline, EX(Ts) TSRMLS_CC); - break; - case ZEND_FREE: - zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var); - break; - } - } - } - } - - /* restore previous error_reporting value */ - if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_LVAL_P(EX(old_error_reporting)) != 0) { - Z_TYPE(restored_error_reporting) = IS_LONG; - Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting)); - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1); - zendi_zval_dtor(restored_error_reporting); - } - EX(old_error_reporting) = NULL; - - if (!catched) { - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); - } else { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - ZEND_VM_CONTINUE(); - } -} - -ZEND_VM_HANDLER(146, ZEND_VERIFY_ABSTRACT_CLASS, ANY, ANY) -{ - zend_verify_abstract_class(EX_T(EX(opline)->op1.u.var).class_entry TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY) -{ - int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL); - - switch (ret) { - case ZEND_USER_OPCODE_CONTINUE: - ZEND_VM_CONTINUE(); - case ZEND_USER_OPCODE_RETURN: - ZEND_VM_RETURN(); - case ZEND_USER_OPCODE_DISPATCH: - ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline)); - default: - ZEND_VM_DISPATCH(ret & 0xff, EX(opline)); - } -} - -ZEND_VM_EXPORT_HELPER(zend_do_fcall, zend_do_fcall_common_helper) diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h deleted file mode 100644 index fe5f3d3df733b..0000000000000 --- a/Zend/zend_vm_execute.h +++ /dev/null @@ -1,30855 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -static opcode_handler_t zend_user_opcode_handlers[256] = {(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL}; - -static zend_uchar zend_user_opcodes[256] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255}; - -static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op); - - -#define ZEND_VM_CONTINUE() return 0 -#define ZEND_VM_RETURN() return 1 -#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - -#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC - -ZEND_API void execute(zend_op_array *op_array TSRMLS_DC) -{ - zend_execute_data execute_data; - - - if (EG(exception)) { - return; - } - - /* Initialize execute_data */ - EX(fbc) = NULL; - EX(object) = NULL; - EX(old_error_reporting) = NULL; - if (op_array->T < TEMP_VAR_STACK_LIMIT) { - EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable) * op_array->T); - } else { - EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0); - } - EX(CVs) = (zval***)do_alloca(sizeof(zval**) * op_array->last_var); - memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var); - EX(op_array) = op_array; - EX(original_in_execution) = EG(in_execution); - EX(symbol_table) = EG(active_symbol_table); - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = &execute_data; - - EG(in_execution) = 1; - if (op_array->start_op) { - ZEND_VM_SET_OPCODE(op_array->start_op); - } else { - ZEND_VM_SET_OPCODE(op_array->opcodes); - } - - if (op_array->uses_this && EG(This)) { - EG(This)->refcount++; /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { - EG(This)->refcount--; - } - } - - EG(opline_ptr) = &EX(opline); - - EX(function_state).function = (zend_function *) op_array; - EG(function_state_ptr) = &EX(function_state); -#if ZEND_DEBUG - /* function_state.function_symbol_table is saved as-is to a stack, - * which is an intentional UMR. Shut it up if we're in DEBUG. - */ - EX(function_state).function_symbol_table = NULL; -#endif - - while (1) { -#ifdef ZEND_WIN32 - if (EG(timed_out)) { - zend_timeout(0); - } -#endif - - if (EX(opline)->handler(&execute_data TSRMLS_CC) > 0) { - return; - } - - } - zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen"); -} - -#undef EX -#define EX(element) execute_data->element - -static int ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if DEBUG_ZEND>=2 - printf("Jumping to %d\n", EX(opline)->op1.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(EX(opline)->op1.u.jmp_addr); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_INIT_STRING_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zval *tmp = &EX_T(EX(opline)->result.u.var).tmp_var; - - tmp->value.str.val = emalloc(1); - tmp->value.str.val[0] = 0; - tmp->value.str.len = 0; - tmp->refcount = 1; - tmp->type = IS_STRING; - tmp->is_ref = 0; - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval **original_return_value; - zend_class_entry *current_scope = NULL; - zval *current_this = NULL; - int return_value_used = RETURN_VALUE_USED(opline); - zend_bool should_change_scope; - zend_op *ctor_opline; - - if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ - } - if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { - zend_error(E_STRICT, "Function %s%s%s() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", - EX(function_state).function->common.scope ? "::" : "", - EX(function_state).function->common.function_name); - } - } - - zend_ptr_stack_2_push(&EG(argument_stack), (void *)(zend_uintptr_t)opline->extended_value, NULL); - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (EX(function_state).function->type == ZEND_USER_FUNCTION - || EX(function_state).function->common.scope) { - should_change_scope = 1; - current_this = EG(This); - EG(This) = EX(object); - current_scope = EG(scope); - EG(scope) = (EX(function_state).function->type == ZEND_USER_FUNCTION || !EX(object)) ? EX(function_state).function->common.scope : NULL; - } else { - should_change_scope = 0; - } - - EX_T(opline->result.u.var).var.fcall_returned_reference = 0; - - if (EX(function_state).function->common.scope) { - if (!EG(This) && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) { - int severity; - char *severity_word; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - severity_word = "should not"; - } else { - severity = E_ERROR; - severity_word = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name, severity_word); - } - } - if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { - unsigned char return_reference = EX(function_state).function->common.return_reference; - - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - if (EX(function_state).function->common.arg_info) { - zend_uint i=0; - zval **p; - ulong arg_count; - - p = (zval **) EG(argument_stack).top_element-2; - arg_count = (ulong)(zend_uintptr_t) *p; - - while (arg_count>0) { - zend_verify_arg_type(EX(function_state).function, ++i, *(p-arg_count) TSRMLS_CC); - arg_count--; - } - } - if (!zend_execute_internal) { - /* saves one function call if zend_execute_internal is not used */ - ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), return_value_used TSRMLS_CC); - } else { - zend_execute_internal(execute_data, return_value_used TSRMLS_CC); - } - - EG(current_execute_data) = execute_data; - -/* We shouldn't fix bad extensions here, - because it can break proper ones (Bug #34045) - if (!EX(function_state).function->common.return_reference) { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } -*/ - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.fcall_returned_reference = return_reference; - } - } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) { - EX_T(opline->result.u.var).var.ptr = NULL; - if (EG(symtable_cache_ptr)>=EG(symtable_cache)) { - /*printf("Cache hit! Reusing %x\n", symtable_cache[symtable_cache_ptr]);*/ - EX(function_state).function_symbol_table = *(EG(symtable_cache_ptr)--); - } else { - ALLOC_HASHTABLE(EX(function_state).function_symbol_table); - zend_hash_init(EX(function_state).function_symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0); - /*printf("Cache miss! Initialized %x\n", function_state.function_symbol_table);*/ - } - EG(active_symbol_table) = EX(function_state).function_symbol_table; - original_return_value = EG(return_value_ptr_ptr); - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = (zend_op_array *) EX(function_state).function; - - zend_execute(EG(active_op_array) TSRMLS_CC); - EX_T(opline->result.u.var).var.fcall_returned_reference = EG(active_op_array)->return_reference; - - if (return_value_used && !EX_T(opline->result.u.var).var.ptr) { - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - } - } else if (!return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(return_value_ptr_ptr)=original_return_value; - if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) { - zend_hash_destroy(EX(function_state).function_symbol_table); - FREE_HASHTABLE(EX(function_state).function_symbol_table); - } else { - /* clean before putting into the cache, since clean - could call dtors, which could use cached hash */ - zend_hash_clean(EX(function_state).function_symbol_table); - *(++EG(symtable_cache_ptr)) = EX(function_state).function_symbol_table; - } - EG(active_symbol_table) = EX(symbol_table); - } else { /* ZEND_OVERLOADED_FUNCTION */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - /* Not sure what should be done here if it's a static method */ - if (EX(object)) { - Z_OBJ_HT_P(EX(object))->call_method(EX(fbc)->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), return_value_used TSRMLS_CC); - } else { - zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); - } - - if (EX(function_state).function->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - efree(EX(function_state).function->common.function_name); - } - efree(EX(fbc)); - - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } - } - - EX(function_state).function = (zend_function *) EX(op_array); - EG(function_state_ptr) = &EX(function_state); - ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EG(This)) { - if (EG(exception) && ctor_opline) { - if (RETURN_VALUE_USED(ctor_opline)) { - EG(This)->refcount--; - } - if (EG(This)->refcount == 1) { - zend_object_store_ctor_failed(EG(This) TSRMLS_CC); - } - } - if (should_change_scope) { - zval_ptr_dtor(&EG(This)); - } - } - - if (should_change_scope) { - EG(This) = current_this; - EG(scope) = current_scope; - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - - zend_ptr_stack_clear_multiple(TSRMLS_C); - - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - if (return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - EX(function_state).function = EX(fbc); - return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_CATCH_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce; - - /* Check whether an exception has been thrown, if not, jump over code */ - if (EG(exception) == NULL) { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - ce = Z_OBJCE_P(EG(exception)); - if (ce != EX_T(opline->op1.u.var).class_entry) { - if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) { - if (opline->op1.u.EA.type) { - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - } - - zend_hash_update(EG(active_symbol_table), opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.len+1, &EG(exception), sizeof(zval *), (void **) NULL); - EG(exception) = NULL; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval **param; - zend_uint arg_num = Z_LVAL(opline->op1.u.constant); - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - char *space; - char *class_name = get_active_class_name(&space TSRMLS_CC); - zend_execute_data *ptr = EX(prev_execute_data); - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL TSRMLS_CC); - if(ptr && ptr->op_array) { - zend_error(E_WARNING, "Missing argument %ld for %s%s%s(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno); - } else { - zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C)); - } - if (opline->result.op_type == IS_VAR) { - PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - zend_free_op free_res; - zval **var_ptr; - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param TSRMLS_CC); - var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - if (PZVAL_IS_REF(*param)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, *param TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *object_zval; - zend_function *constructor; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - char *class_type; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) { - class_type = "interface"; - } else { - class_type = "abstract class"; - } - zend_error_noreturn(E_ERROR, "Cannot instantiate %s %s", class_type, EX_T(opline->op1.u.var).class_entry->name); - } - ALLOC_ZVAL(object_zval); - object_init_ex(object_zval, EX_T(opline->op1.u.var).class_entry); - INIT_PZVAL(object_zval); - - constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC); - - if (constructor == NULL) { - if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - } else { - zval_ptr_dtor(&object_zval); - } - ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.u.opline_num); - } else { - SELECTIVE_PZVAL_LOCK(object_zval, &opline->result); - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), opline); - - /* We are not handling overloaded classes right now */ - EX(object) = object_zval; - EX(fbc) = constructor; - - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; /* shouldn't be necessary */ - if (EX(old_error_reporting) == NULL) { - EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var; - } - - if (EG(error_reporting)) { - zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EG(scope)->name, EX(op_array)->function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ -} - -static int ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXT_FCALL_END_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DECLARE_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_class(opline, EG(class_table), 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DECLARE_FUNCTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - do_bind_function(EX(opline), EG(function_table), 0); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXT_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_INTERFACE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry; - zend_class_entry *iface = EX_T(opline->op2.u.var).class_entry; - - if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name); - } - - zend_do_implement_interface(ce, iface TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes; - int i; - zend_uint catch_op_num; - int catched = 0; - zval **stack_zval_pp; - zval restored_error_reporting; - - stack_zval_pp = (zval **) EG(argument_stack).top_element - 1; - while (*stack_zval_pp != NULL) { - zval_ptr_dtor(stack_zval_pp); - EG(argument_stack).top_element--; - EG(argument_stack).top--; - stack_zval_pp--; - } - - for (i=0; ilast_try_catch; i++) { - if (EG(active_op_array)->try_catch_array[i].try_op > op_num) { - /* further blocks will not be relevant... */ - break; - } - if (op_num >= EG(active_op_array)->try_catch_array[i].try_op - && op_num < EG(active_op_array)->try_catch_array[i].catch_op) { - catch_op_num = EX(op_array)->try_catch_array[i].catch_op; - catched = 1; - } - } - - while (EX(fbc)) { - zend_op *ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EX(object)) { - if (ctor_opline && RETURN_VALUE_USED(ctor_opline)) { - EX(object)->refcount--; - } - zval_ptr_dtor(&EX(object)); - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - } - - for (i=0; ilast_brk_cont; i++) { - if (EX(op_array)->brk_cont_array[i].start < 0) { - continue; - } else if (EX(op_array)->brk_cont_array[i].start > op_num) { - /* further blocks will not be relevant... */ - break; - } else if (op_num < EX(op_array)->brk_cont_array[i].brk) { - if (!catched || - catch_op_num >= EX(op_array)->brk_cont_array[i].brk) { - zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk]; - - switch (brk_opline->opcode) { - case ZEND_SWITCH_FREE: - zend_switch_free(brk_opline, EX(Ts) TSRMLS_CC); - break; - case ZEND_FREE: - zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var); - break; - } - } - } - } - - /* restore previous error_reporting value */ - if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_LVAL_P(EX(old_error_reporting)) != 0) { - Z_TYPE(restored_error_reporting) = IS_LONG; - Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting)); - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1); - zendi_zval_dtor(restored_error_reporting); - } - EX(old_error_reporting) = NULL; - - if (!catched) { - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); - } else { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - ZEND_VM_CONTINUE(); - } -} - -static int ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_verify_abstract_class(EX_T(EX(opline)->op1.u.var).class_entry TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL); - - switch (ret) { - case ZEND_USER_OPCODE_CONTINUE: - ZEND_VM_CONTINUE(); - case ZEND_USER_OPCODE_RETURN: - ZEND_VM_RETURN(); - case ZEND_USER_OPCODE_DISPATCH: - ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline)); - default: - ZEND_VM_DISPATCH(ret & 0xff, EX(opline)); - } -} - -static int ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - - - - if (IS_CONST == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = &opline->op2.u.constant; - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_CONST != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_CONST == IS_CONST); - - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_CONST != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - int severity; - char *verb; - if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - verb = "should not"; - } else { - /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ - severity = E_ERROR; - verb = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name, verb); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_CONST == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (IS_CONST != IS_CONST) { - - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval **param, *assignment_value; - zend_uint arg_num = Z_LVAL(opline->op1.u.constant); - zend_free_op free_res; - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - if (Z_TYPE(opline->op2.u.constant) == IS_CONSTANT || Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) { - zval *default_value; - - ALLOC_ZVAL(default_value); - *default_value = opline->op2.u.constant; - default_value->refcount=1; - zval_update_constant(&default_value, 0 TSRMLS_CC); - default_value->refcount=0; - default_value->is_ref=0; - param = &default_value; - assignment_value = default_value; - } else { - param = NULL; - assignment_value = &opline->op2.u.constant; - } - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC); - } else { - zval **var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - - assignment_value = *param; - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - if (PZVAL_IS_REF(assignment_value)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, assignment_value TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zend_brk_cont_element *el; - - el = zend_brk_cont(&opline->op2.u.constant, opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -static int ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zend_brk_cont_element *el; - - el = zend_brk_cont(&opline->op2.u.constant, opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -static int ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - zend_free_op free_op2; - - - if (IS_TMP_VAR == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_TMP_VAR != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_TMP_VAR == IS_CONST); - zend_free_op free_op2; - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - zval_dtor(free_op2.var); - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_TMP_VAR != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - int severity; - char *verb; - if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - verb = "should not"; - } else { - /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ - severity = E_ERROR; - verb = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name, verb); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_TMP_VAR == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (IS_TMP_VAR != IS_CONST) { - zval_dtor(free_op2.var); - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_BRK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - zval_dtor(free_op2.var); - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -static int ZEND_CONT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - zval_dtor(free_op2.var); - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -static int ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - zend_free_op free_op2; - - - if (IS_VAR == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_VAR != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_VAR == IS_CONST); - zend_free_op free_op2; - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_VAR != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - int severity; - char *verb; - if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - verb = "should not"; - } else { - /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ - severity = E_ERROR; - verb = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name, verb); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_VAR == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (IS_VAR != IS_CONST) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_BRK_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -static int ZEND_CONT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -static int ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - - - - if (IS_UNUSED == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = NULL; - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_UNUSED != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_UNUSED == IS_CONST); - - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = NULL; - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_UNUSED != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - int severity; - char *verb; - if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - verb = "should not"; - } else { - /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ - severity = E_ERROR; - verb = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name, verb); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_CLASS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - - - - if (IS_CV == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_CV != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_CV == IS_CONST); - - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_CV != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - int severity; - char *verb; - if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - verb = "should not"; - } else { - /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ - severity = E_ERROR; - verb = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name, verb); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_CV == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (IS_CV != IS_CONST) { - - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_BRK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -static int ZEND_CONT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -static int ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval z_copy; - zval *z = &opline->op1.u.constant; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - return ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = &opline->op1.u.constant; - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_CONST != IS_TMP_VAR) { - - } - break; - case ZEND_FETCH_LOCAL: - - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (IS_CONST == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(&opline->op1.u.constant); - - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(&opline->op1.u.constant); - - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(&opline->op1.u.constant); - - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -static int ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(&opline->op1.u.constant); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(&opline->op1.u.constant); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *fname = &opline->op1.u.constant; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (zend_hash_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function)==FAILURE) { - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val); - } - EX(object) = NULL; - - return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = NULL; - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_CONST == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_CONST == IS_VAR && !0) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = &opline->op1.u.constant; - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!0) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - - - value = &opline->op1.u.constant; - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!0) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - - - value = &opline->op1.u.constant; - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(&opline->op1.u.constant); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *obj = &opline->op1.u.constant; - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *expr = &opline->op1.u.constant; - zval *result = &EX_T(opline->result.u.var).tmp_var; - - if (opline->extended_value != IS_STRING) { - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(expr, &var_copy, &use_copy); - if (use_copy) { - *result = var_copy; - if (0) { - - } - } else { - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - - zval *inc_filename = &opline->op1.u.constant; - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd_state state; - - state.cwd_length = 0; - state.cwd = malloc(1); - state.cwd[0] = 0; - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - } - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - - - varname = &opline->op1.u.constant; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(&varname); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = NULL; - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - (*array_ptr_ptr)->is_ref = 1; - } - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = &opline->op1.u.constant; - if (0) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (IS_CONST != IS_TMP_VAR && ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos); - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval tmp, *varname = &opline->op1.u.constant; - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_CONST != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_CONST != IS_UNUSED) { - - zval *ptr = &opline->op1.u.constant; - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = &opline->op1.u.constant; - - EX_T(opline->result.u.var).tmp_var = *value; - if (!0) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_TICKS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (++EG(ticks_count)>=Z_LVAL(opline->op1.u.constant)) { - EG(ticks_count)=0; - if (zend_ticks_function) { - zend_ticks_function(Z_LVAL(opline->op1.u.constant)); - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_TMP_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *container = &opline->op1.u.constant; - - if (Z_TYPE_P(container) != IS_ARRAY) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - - zval *dim = &opline->op2.u.constant; - - EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result); - - } - AI_USE_PTR(EX_T(opline->result.u.var).var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = NULL; - zval **value; - - if (IS_CONST == IS_UNUSED) { -/* This seems to be a reminant of namespaces - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); - } - } -*/ - if (!zend_get_constant(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len, &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", - opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.val); - EX_T(opline->result.u.var).tmp_var = opline->op2.u.constant; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - ZEND_VM_NEXT_OPCODE(); - } - - ce = EX_T(opline->op1.u.var).class_entry; - - if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zend_class_entry *old_scope = EG(scope); - - EG(scope) = ce; - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EG(scope) = old_scope; - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } else { - zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", opline->op2.u.constant.value.str.val); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=&opline->op2.u.constant; - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=NULL; - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_BW_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval z_copy; - zval *z = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - return ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_TMP_VAR != IS_TMP_VAR) { - zval_dtor(free_op1.var); - } - break; - case ZEND_FETCH_LOCAL: - zval_dtor(free_op1.var); - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (IS_TMP_VAR == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -static int ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FREE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zendi_zval_dtor(EX_T(EX(opline)->op1.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - zend_free_op free_op1; - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = NULL; - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_TMP_VAR == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_TMP_VAR == IS_VAR && !1) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!1) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - zend_free_op free_op1; - - value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!1) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - zend_free_op free_op1; - - value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!1) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SWITCH_FREE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *obj = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - if (opline->extended_value != IS_STRING) { - *result = *expr; - if (!1) { - zendi_zval_copy_ctor(*result); - } - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(expr, &var_copy, &use_copy); - if (use_copy) { - *result = var_copy; - if (1) { - zval_dtor(free_op1.var); - } - } else { - *result = *expr; - if (!1) { - zendi_zval_copy_ctor(*result); - } - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zend_free_op free_op1; - zval *inc_filename = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd_state state; - - state.cwd_length = 0; - state.cwd = malloc(1); - state.cwd[0] = 0; - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - } - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - zval_dtor(free_op1.var); - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - zend_free_op free_op1; - - varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(&varname); - } - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = NULL; - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - (*array_ptr_ptr)->is_ref = 1; - } - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (1) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (IS_TMP_VAR != IS_TMP_VAR && ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos); - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_TMP_VAR != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_TMP_VAR != IS_UNUSED) { - zend_free_op free_op1; - zval *ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - zval_dtor(free_op1.var); - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval restored_error_reporting; - - if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.u.var).tmp_var) != 0) { - Z_TYPE(restored_error_reporting) = IS_LONG; - Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var); - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1); - zendi_zval_dtor(restored_error_reporting); - } - if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) { - EX(old_error_reporting) = NULL; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!1) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INSTANCEOF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *container = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(container) != IS_ARRAY) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - - zval *dim = &opline->op2.u.constant; - - EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result); - - } - AI_USE_PTR(EX_T(opline->result.u.var).var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_char_to_string(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=&opline->op2.u.constant; - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *var = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval var_copy; - int use_copy = 0; - - if (Z_TYPE_P(var) != IS_STRING) { - zend_make_printable_zval(var, &var_copy, &use_copy); - - if (use_copy) { - var = &var_copy; - } - } - add_string_to_string( &EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *var = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval var_copy; - int use_copy = 0; - - if (Z_TYPE_P(var) != IS_STRING) { - zend_make_printable_zval(var, &var_copy, &use_copy); - - if (use_copy) { - var = &var_copy; - } - } - add_string_to_string( &EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=NULL; - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *var = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval var_copy; - int use_copy = 0; - - if (Z_TYPE_P(var) != IS_STRING) { - zend_make_printable_zval(var, &var_copy, &use_copy); - - if (use_copy) { - var = &var_copy; - } - } - add_string_to_string( &EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval z_copy; - zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - return ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_VAR != IS_TMP_VAR) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - break; - case ZEND_FETCH_LOCAL: - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (IS_VAR == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -static int ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - zend_free_op free_op1; - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_VAR == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!0) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - zend_free_op free_op1; - - value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!0) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - zend_free_op free_op1; - - value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *varptr; - zend_free_op free_op1; - varptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; /* for string offsets */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varptr; - - if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { - return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - - if (IS_VAR == IS_VAR && - (opline->extended_value & ZEND_ARG_SEND_FUNCTION) && - EX_T(opline->op1.u.var).var.fcall_returned_reference && - EX_T(opline->op1.u.var).var.ptr) { - varptr = EX_T(opline->op1.u.var).var.ptr; - PZVAL_UNLOCK_EX(varptr, &free_op1, 0); - } else { - varptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - EX_T(opline->op1.u.var).var.fcall_returned_reference) && - varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || - (varptr->refcount == 1 && (IS_VAR == IS_CV || free_op1.var)))) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } else { - zval *valptr; - - zend_error(E_STRICT, "Only variables should be passed by reference"); - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, varptr); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **varptr_ptr; - zval *varptr; - varptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!varptr_ptr) { - zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SWITCH_FREE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *obj = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - if (opline->extended_value != IS_STRING) { - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(expr, &var_copy, &use_copy); - if (use_copy) { - *result = var_copy; - if (0) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - } else { - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zend_free_op free_op1; - zval *inc_filename = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd_state state; - - state.cwd_length = 0; - state.cwd = malloc(1); - state.cwd[0] = 0; - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - } - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - zend_free_op free_op1; - - varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(&varname); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - (*array_ptr_ptr)->is_ref = 1; - } - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (0) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (IS_VAR != IS_TMP_VAR && ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos); - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value; - char *str_key; - uint str_key_len; - ulong int_key; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - int key_type = 0; - zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY); - - PZVAL_LOCK(array); - - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { - default: - case ZEND_ITER_INVALID: - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - - case ZEND_ITER_PLAIN_OBJECT: { - char *class_name, *prop_name; - zend_object *zobj = zend_objects_get_address(array TSRMLS_CC); - - fe_ht = HASH_OF(array); - zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos); - do { - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - - zend_hash_move_forward(fe_ht); - } while (key_type == HASH_KEY_NON_EXISTANT || - (key_type != HASH_KEY_IS_LONG && - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS)); - zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos); - if (use_key && key_type != HASH_KEY_IS_LONG) { - zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name); - str_key_len = strlen(prop_name); - str_key = estrndup(prop_name, str_key_len); - str_key_len++; - } - break; - } - - case ZEND_ITER_PLAIN_ARRAY: - fe_ht = HASH_OF(array); - zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos); - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - if (use_key) { - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL); - } - zend_hash_move_forward(fe_ht); - zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos); - break; - - case ZEND_ITER_OBJECT: - /* !iter happens from exception */ - if (iter && ++iter->index > 0) { - /* This could cause an endless loop if index becomes zero again. - * In case that ever happens we need an additional flag. */ - iter->funcs->move_forward(iter TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } - /* If index is zero we come from FE_RESET and checked valid() already. */ - if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) { - /* reached end of iteration */ - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - iter->funcs->get_current_data(iter, &value TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - if (!value) { - /* failure in get_current_data */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - if (use_key) { - if (iter->funcs->get_current_key) { - key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } else { - key_type = HASH_KEY_IS_LONG; - int_key = iter->index; - } - } - break; - } - - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - SEPARATE_ZVAL_IF_NOT_REF(value); - (*value)->is_ref = 1; - EX_T(opline->result.u.var).var.ptr_ptr = value; - (*value)->refcount++; - } else { - EX_T(opline->result.u.var).var.ptr_ptr = value; - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (use_key) { - zend_op *op_data = opline+1; - zval *key = &EX_T(op_data->result.u.var).tmp_var; - - switch (key_type) { - case HASH_KEY_IS_STRING: - Z_STRVAL_P(key) = str_key; - Z_STRLEN_P(key) = str_key_len-1; - Z_TYPE_P(key) = IS_STRING; - break; - case HASH_KEY_IS_LONG: - Z_LVAL_P(key) = int_key; - Z_TYPE_P(key) = IS_LONG; - break; - default: - case HASH_KEY_NON_EXISTANT: - ZVAL_NULL(key); - break; - } - } - - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_VAR != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_VAR != IS_UNUSED) { - zend_free_op free_op1; - zval *ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!0) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (object_ptr && IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = &opline->op2.u.constant; - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && - IS_VAR != IS_CV && - EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CONST == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = &opline->op2.u.constant; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = &opline->op2.u.constant; - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = &opline->op2.u.constant; - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = &opline->op2.u.constant; - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CONST), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=&opline->op2.u.constant; - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = &opline->op2.u.constant; - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (object_ptr && IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && - IS_VAR != IS_CV && - EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_IS TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_TMP_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, type TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 1, BP_VAR_UNSET TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (1?IS_TMP_VAR:IS_TMP_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - zval_dtor(free_op2.var); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - zval_dtor(free_op2.var); - break; - } - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - zval_dtor(free_op2.var); - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - zval_dtor(free_op2.var); - } else { - zval_dtor(free_op2.var); - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (object_ptr && IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && - IS_VAR != IS_CV && - EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - if (EG(exception)) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); - } - return ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - PZVAL_LOCK(*value_ptr_ptr); - } - if (IS_VAR == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - (*variable_ptr_ptr)->refcount--; - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = NULL; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (object_ptr && IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = NULL; - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_UNUSED == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = NULL; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=NULL; - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (object_ptr && IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && - IS_VAR != IS_CV && - EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CV == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CV), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - if (EG(exception)) { - - ZEND_VM_NEXT_OPCODE(); - } - return ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - PZVAL_LOCK(*value_ptr_ptr); - } - if (IS_VAR == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - (*variable_ptr_ptr)->refcount--; - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *obj = _get_obj_zval_ptr_unused(TSRMLS_C); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_UNUSED != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_UNUSED != IS_UNUSED) { - - zval *ptr = NULL; - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = &opline->op2.u.constant; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (object_ptr && IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = &opline->op2.u.constant; - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = &opline->op2.u.constant; - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = &opline->op2.u.constant; - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = &opline->op2.u.constant; - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = NULL; - zval **value; - - if (IS_UNUSED == IS_UNUSED) { -/* This seems to be a reminant of namespaces - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); - } - } -*/ - if (!zend_get_constant(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len, &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", - opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.val); - EX_T(opline->result.u.var).tmp_var = opline->op2.u.constant; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - ZEND_VM_NEXT_OPCODE(); - } - - ce = EX_T(opline->op1.u.var).class_entry; - - if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zend_class_entry *old_scope = EG(scope); - - EG(scope) = ce; - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EG(scope) = old_scope; - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } else { - zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", opline->op2.u.constant.value.str.val); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = &opline->op2.u.constant; - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = &opline->op2.u.constant; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = &opline->op2.u.constant; - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (object_ptr && IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 1, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - zval_dtor(free_op2.var); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - zval_dtor(free_op2.var); - break; - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - zval_dtor(free_op2.var); - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - zval_dtor(free_op2.var); - } else { - zval_dtor(free_op2.var); - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (object_ptr && IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = NULL; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (object_ptr && IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = NULL; - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (object_ptr && IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BW_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval z_copy; - zval *z = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - return ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_CV != IS_TMP_VAR) { - - } - break; - case ZEND_FETCH_LOCAL: - - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (IS_CV == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -static int ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_CV == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_CV == IS_VAR && !0) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!0) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - - - value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!0) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - - - value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *varptr; - - varptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - ; /* for string offsets */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varptr; - - if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { - return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - - if (IS_CV == IS_VAR && - (opline->extended_value & ZEND_ARG_SEND_FUNCTION) && - EX_T(opline->op1.u.var).var.fcall_returned_reference && - EX_T(opline->op1.u.var).var.ptr) { - varptr = EX_T(opline->op1.u.var).var.ptr; - PZVAL_UNLOCK_EX(varptr, &free_op1, 0); - } else { - varptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - EX_T(opline->op1.u.var).var.fcall_returned_reference) && - varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || - (varptr->refcount == 1 && (IS_CV == IS_CV || free_op1.var)))) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } else { - zval *valptr; - - zend_error(E_STRICT, "Only variables should be passed by reference"); - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, varptr); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **varptr_ptr; - zval *varptr; - varptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (!varptr_ptr) { - zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *obj = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *expr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - if (opline->extended_value != IS_STRING) { - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(expr, &var_copy, &use_copy); - if (use_copy) { - *result = var_copy; - if (0) { - - } - } else { - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - - zval *inc_filename = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd_state state; - - state.cwd_length = 0; - state.cwd = malloc(1); - state.cwd[0] = 0; - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - } - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - - - varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (IS_CV == IS_CV || IS_CV == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(&varname); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - (*array_ptr_ptr)->is_ref = 1; - } - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if (0) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if ((IS_CV == IS_CV || IS_CV == IS_VAR) && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (IS_CV != IS_TMP_VAR && ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - (key_type == HASH_KEY_IS_LONG || - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos); - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval tmp, *varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_CV != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_CV != IS_UNUSED) { - - zval *ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!0) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INSTANCEOF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *expr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (object_ptr && IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = &opline->op2.u.constant; - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && - IS_CV != IS_CV && - EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CONST == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = &opline->op2.u.constant; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = &opline->op2.u.constant; - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = &opline->op2.u.constant; - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = &opline->op2.u.constant; - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CONST), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=&opline->op2.u.constant; - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = &opline->op2.u.constant; - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (object_ptr && IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && - IS_CV != IS_CV && - EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 1, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 1, BP_VAR_IS TSRMLS_CC); - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_TMP_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 1, type TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 1, BP_VAR_UNSET TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (1?IS_TMP_VAR:IS_TMP_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - zval_dtor(free_op2.var); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - zval_dtor(free_op2.var); - break; - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - zval_dtor(free_op2.var); - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - zval_dtor(free_op2.var); - } else { - zval_dtor(free_op2.var); - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (object_ptr && IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && - IS_CV != IS_CV && - EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - if (EG(exception)) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); - } - return ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - PZVAL_LOCK(*value_ptr_ptr); - } - if (IS_CV == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - (*variable_ptr_ptr)->refcount--; - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = NULL; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (object_ptr && IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = NULL; - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_UNUSED == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = NULL; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=NULL; - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (object_ptr && IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && - IS_CV != IS_CV && - EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CV == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) && - ZVAL_REFCOUNT(*EX_T(opline->result.u.var).var.ptr_ptr) > 2) { - SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr); - } - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CV), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - if (EG(exception)) { - - ZEND_VM_NEXT_OPCODE(); - } - return ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - PZVAL_LOCK(*value_ptr_ptr); - } - if (IS_CV == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - (*variable_ptr_ptr)->refcount--; - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_error_noreturn(E_ERROR, "Invalid opcode %d/%d/%d.", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type); - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - - -void zend_init_opcodes_handlers(void) -{ - static const opcode_handler_t labels[] = { - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_ADD_SPEC_CONST_CONST_HANDLER, - ZEND_ADD_SPEC_CONST_TMP_HANDLER, - ZEND_ADD_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_CONST_CV_HANDLER, - ZEND_ADD_SPEC_TMP_CONST_HANDLER, - ZEND_ADD_SPEC_TMP_TMP_HANDLER, - ZEND_ADD_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_TMP_CV_HANDLER, - ZEND_ADD_SPEC_VAR_CONST_HANDLER, - ZEND_ADD_SPEC_VAR_TMP_HANDLER, - ZEND_ADD_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_CV_CONST_HANDLER, - ZEND_ADD_SPEC_CV_TMP_HANDLER, - ZEND_ADD_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_CV_CV_HANDLER, - ZEND_SUB_SPEC_CONST_CONST_HANDLER, - ZEND_SUB_SPEC_CONST_TMP_HANDLER, - ZEND_SUB_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_CONST_CV_HANDLER, - ZEND_SUB_SPEC_TMP_CONST_HANDLER, - ZEND_SUB_SPEC_TMP_TMP_HANDLER, - ZEND_SUB_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_TMP_CV_HANDLER, - ZEND_SUB_SPEC_VAR_CONST_HANDLER, - ZEND_SUB_SPEC_VAR_TMP_HANDLER, - ZEND_SUB_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_CV_CONST_HANDLER, - ZEND_SUB_SPEC_CV_TMP_HANDLER, - ZEND_SUB_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_CV_CV_HANDLER, - ZEND_MUL_SPEC_CONST_CONST_HANDLER, - ZEND_MUL_SPEC_CONST_TMP_HANDLER, - ZEND_MUL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_CONST_CV_HANDLER, - ZEND_MUL_SPEC_TMP_CONST_HANDLER, - ZEND_MUL_SPEC_TMP_TMP_HANDLER, - ZEND_MUL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_TMP_CV_HANDLER, - ZEND_MUL_SPEC_VAR_CONST_HANDLER, - ZEND_MUL_SPEC_VAR_TMP_HANDLER, - ZEND_MUL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_CV_CONST_HANDLER, - ZEND_MUL_SPEC_CV_TMP_HANDLER, - ZEND_MUL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_CV_CV_HANDLER, - ZEND_DIV_SPEC_CONST_CONST_HANDLER, - ZEND_DIV_SPEC_CONST_TMP_HANDLER, - ZEND_DIV_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_CONST_CV_HANDLER, - ZEND_DIV_SPEC_TMP_CONST_HANDLER, - ZEND_DIV_SPEC_TMP_TMP_HANDLER, - ZEND_DIV_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_TMP_CV_HANDLER, - ZEND_DIV_SPEC_VAR_CONST_HANDLER, - ZEND_DIV_SPEC_VAR_TMP_HANDLER, - ZEND_DIV_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_CV_CONST_HANDLER, - ZEND_DIV_SPEC_CV_TMP_HANDLER, - ZEND_DIV_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_CV_CV_HANDLER, - ZEND_MOD_SPEC_CONST_CONST_HANDLER, - ZEND_MOD_SPEC_CONST_TMP_HANDLER, - ZEND_MOD_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_CONST_CV_HANDLER, - ZEND_MOD_SPEC_TMP_CONST_HANDLER, - ZEND_MOD_SPEC_TMP_TMP_HANDLER, - ZEND_MOD_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_TMP_CV_HANDLER, - ZEND_MOD_SPEC_VAR_CONST_HANDLER, - ZEND_MOD_SPEC_VAR_TMP_HANDLER, - ZEND_MOD_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_CV_CONST_HANDLER, - ZEND_MOD_SPEC_CV_TMP_HANDLER, - ZEND_MOD_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_CV_CV_HANDLER, - ZEND_SL_SPEC_CONST_CONST_HANDLER, - ZEND_SL_SPEC_CONST_TMP_HANDLER, - ZEND_SL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_CONST_CV_HANDLER, - ZEND_SL_SPEC_TMP_CONST_HANDLER, - ZEND_SL_SPEC_TMP_TMP_HANDLER, - ZEND_SL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_TMP_CV_HANDLER, - ZEND_SL_SPEC_VAR_CONST_HANDLER, - ZEND_SL_SPEC_VAR_TMP_HANDLER, - ZEND_SL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_CV_CONST_HANDLER, - ZEND_SL_SPEC_CV_TMP_HANDLER, - ZEND_SL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_CV_CV_HANDLER, - ZEND_SR_SPEC_CONST_CONST_HANDLER, - ZEND_SR_SPEC_CONST_TMP_HANDLER, - ZEND_SR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_CONST_CV_HANDLER, - ZEND_SR_SPEC_TMP_CONST_HANDLER, - ZEND_SR_SPEC_TMP_TMP_HANDLER, - ZEND_SR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_TMP_CV_HANDLER, - ZEND_SR_SPEC_VAR_CONST_HANDLER, - ZEND_SR_SPEC_VAR_TMP_HANDLER, - ZEND_SR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_CV_CONST_HANDLER, - ZEND_SR_SPEC_CV_TMP_HANDLER, - ZEND_SR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_CV_CV_HANDLER, - ZEND_CONCAT_SPEC_CONST_CONST_HANDLER, - ZEND_CONCAT_SPEC_CONST_TMP_HANDLER, - ZEND_CONCAT_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_CONST_CV_HANDLER, - ZEND_CONCAT_SPEC_TMP_CONST_HANDLER, - ZEND_CONCAT_SPEC_TMP_TMP_HANDLER, - ZEND_CONCAT_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_TMP_CV_HANDLER, - ZEND_CONCAT_SPEC_VAR_CONST_HANDLER, - ZEND_CONCAT_SPEC_VAR_TMP_HANDLER, - ZEND_CONCAT_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_CV_CONST_HANDLER, - ZEND_CONCAT_SPEC_CV_TMP_HANDLER, - ZEND_CONCAT_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_CV_CV_HANDLER, - ZEND_BW_OR_SPEC_CONST_CONST_HANDLER, - ZEND_BW_OR_SPEC_CONST_TMP_HANDLER, - ZEND_BW_OR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_CONST_CV_HANDLER, - ZEND_BW_OR_SPEC_TMP_CONST_HANDLER, - ZEND_BW_OR_SPEC_TMP_TMP_HANDLER, - ZEND_BW_OR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_TMP_CV_HANDLER, - ZEND_BW_OR_SPEC_VAR_CONST_HANDLER, - ZEND_BW_OR_SPEC_VAR_TMP_HANDLER, - ZEND_BW_OR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_CV_CONST_HANDLER, - ZEND_BW_OR_SPEC_CV_TMP_HANDLER, - ZEND_BW_OR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_CV_CV_HANDLER, - ZEND_BW_AND_SPEC_CONST_CONST_HANDLER, - ZEND_BW_AND_SPEC_CONST_TMP_HANDLER, - ZEND_BW_AND_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_CONST_CV_HANDLER, - ZEND_BW_AND_SPEC_TMP_CONST_HANDLER, - ZEND_BW_AND_SPEC_TMP_TMP_HANDLER, - ZEND_BW_AND_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_TMP_CV_HANDLER, - ZEND_BW_AND_SPEC_VAR_CONST_HANDLER, - ZEND_BW_AND_SPEC_VAR_TMP_HANDLER, - ZEND_BW_AND_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_CV_CONST_HANDLER, - ZEND_BW_AND_SPEC_CV_TMP_HANDLER, - ZEND_BW_AND_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_CV_CV_HANDLER, - ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER, - ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER, - ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_CONST_CV_HANDLER, - ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER, - ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER, - ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_TMP_CV_HANDLER, - ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER, - ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER, - ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_CV_CONST_HANDLER, - ZEND_BW_XOR_SPEC_CV_TMP_HANDLER, - ZEND_BW_XOR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_CV_CV_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_CASE_SPEC_CONST_CONST_HANDLER, - ZEND_CASE_SPEC_CONST_TMP_HANDLER, - ZEND_CASE_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_CONST_CV_HANDLER, - ZEND_CASE_SPEC_TMP_CONST_HANDLER, - ZEND_CASE_SPEC_TMP_TMP_HANDLER, - ZEND_CASE_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_TMP_CV_HANDLER, - ZEND_CASE_SPEC_VAR_CONST_HANDLER, - ZEND_CASE_SPEC_VAR_TMP_HANDLER, - ZEND_CASE_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_CV_CONST_HANDLER, - ZEND_CASE_SPEC_CV_TMP_HANDLER, - ZEND_CASE_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER, - ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER, - ZEND_FETCH_DIM_TMP_VAR_SPEC_CONST_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_NULL_HANDLER - }; - zend_opcode_handlers = (opcode_handler_t*)labels; -} -static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op) -{ - static const int zend_vm_decode[] = { - _UNUSED_CODE, /* 0 */ - _CONST_CODE, /* 1 = IS_CONST */ - _TMP_CODE, /* 2 = IS_TMP_VAR */ - _UNUSED_CODE, /* 3 */ - _VAR_CODE, /* 4 = IS_VAR */ - _UNUSED_CODE, /* 5 */ - _UNUSED_CODE, /* 6 */ - _UNUSED_CODE, /* 7 */ - _UNUSED_CODE, /* 8 = IS_UNUSED */ - _UNUSED_CODE, /* 9 */ - _UNUSED_CODE, /* 10 */ - _UNUSED_CODE, /* 11 */ - _UNUSED_CODE, /* 12 */ - _UNUSED_CODE, /* 13 */ - _UNUSED_CODE, /* 14 */ - _UNUSED_CODE, /* 15 */ - _CV_CODE /* 16 = IS_CV */ - }; - return zend_opcode_handlers[opcode * 25 + zend_vm_decode[op->op1.op_type] * 5 + zend_vm_decode[op->op2.op_type]]; -} - -ZEND_API void zend_vm_set_opcode_handler(zend_op* op) -{ - op->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op); -} - -ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl deleted file mode 100644 index e1924a90c7b4f..0000000000000 --- a/Zend/zend_vm_execute.skl +++ /dev/null @@ -1,77 +0,0 @@ -{%DEFINES%} - -ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) -{ - zend_execute_data execute_data; - {%HELPER_VARS%} - - {%INTERNAL_LABELS%} - - if (EG(exception)) { - return; - } - - /* Initialize execute_data */ - EX(fbc) = NULL; - EX(object) = NULL; - EX(old_error_reporting) = NULL; - if (op_array->T < TEMP_VAR_STACK_LIMIT) { - EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable) * op_array->T); - } else { - EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0); - } - EX(CVs) = (zval***)do_alloca(sizeof(zval**) * op_array->last_var); - memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var); - EX(op_array) = op_array; - EX(original_in_execution) = EG(in_execution); - EX(symbol_table) = EG(active_symbol_table); - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = &execute_data; - - EG(in_execution) = 1; - if (op_array->start_op) { - ZEND_VM_SET_OPCODE(op_array->start_op); - } else { - ZEND_VM_SET_OPCODE(op_array->opcodes); - } - - if (op_array->uses_this && EG(This)) { - EG(This)->refcount++; /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { - EG(This)->refcount--; - } - } - - EG(opline_ptr) = &EX(opline); - - EX(function_state).function = (zend_function *) op_array; - EG(function_state_ptr) = &EX(function_state); -#if ZEND_DEBUG - /* function_state.function_symbol_table is saved as-is to a stack, - * which is an intentional UMR. Shut it up if we're in DEBUG. - */ - EX(function_state).function_symbol_table = NULL; -#endif - - while (1) { - {%ZEND_VM_CONTINUE_LABEL%} -#ifdef ZEND_WIN32 - if (EG(timed_out)) { - zend_timeout(0); - } -#endif - - {%ZEND_VM_DISPATCH%} { - {%INTERNAL_EXECUTOR%} - } - - } - zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen"); -} - -{%EXTERNAL_EXECUTOR%} - -void {%INITIALIZER_NAME%}(void) -{ - {%EXTERNAL_LABELS%} -} diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php deleted file mode 100644 index 14a0c4624adbf..0000000000000 --- a/Zend/zend_vm_gen.php +++ /dev/null @@ -1,1302 +0,0 @@ - | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -$header_text = <<< DATA -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - - -DATA; - -/* - This script creates zend_vm_execute.h and zend_vm_opcodes.h - from existing zend_vm_def.h and zend_vm_execute.skl -*/ - -error_reporting(E_ALL); - -define("ZEND_VM_KIND_CALL", 1); -define("ZEND_VM_KIND_SWITCH", 2); -define("ZEND_VM_KIND_GOTO", 3); - -$op_types = array( - "ANY", - "CONST", - "TMP", - "VAR", - "UNUSED", - "CV" -); - -$prefix = array( - "ANY" => "", - "TMP" => "_TMP", - "VAR" => "_VAR", - "CONST" => "_CONST", - "UNUSED" => "_UNUSED", - "CV" => "_CV", -); - -$typecode = array( - "ANY" => 0, - "TMP" => 1, - "VAR" => 2, - "CONST" => 0, - "UNUSED" => 3, - "CV" => 4, -); - -$op1_type = array( - "ANY" => "opline->op1.op_type", - "TMP" => "IS_TMP_VAR", - "VAR" => "IS_VAR", - "CONST" => "IS_CONST", - "UNUSED" => "IS_UNUSED", - "CV" => "IS_CV", -); - -$op2_type = array( - "ANY" => "opline->op2.op_type", - "TMP" => "IS_TMP_VAR", - "VAR" => "IS_VAR", - "CONST" => "IS_CONST", - "UNUSED" => "IS_UNUSED", - "CV" => "IS_CV", -); - -$op1_free = array( - "ANY" => "(free_op1.var != NULL)", - "TMP" => "1", - "VAR" => "(free_op1.var != NULL)", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op2_free = array( - "ANY" => "(free_op2.var != NULL)", - "TMP" => "1", - "VAR" => "(free_op2.var != NULL)", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op1_get_zval_ptr = array( - "ANY" => "get_zval_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "&opline->op1.u.constant", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_zval_ptr = array( - "ANY" => "get_zval_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "&opline->op2.u.constant", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_get_zval_ptr_ptr = array( - "ANY" => "get_zval_ptr_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_zval_ptr_ptr = array( - "ANY" => "get_zval_ptr_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_get_obj_zval_ptr = array( - "ANY" => "get_obj_zval_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "&opline->op1.u.constant", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_obj_zval_ptr = array( - "ANY" => "get_obj_zval_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "&opline->op2.u.constant", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_get_obj_zval_ptr_ptr = array( - "ANY" => "get_obj_zval_ptr_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_obj_zval_ptr_ptr = array( - "ANY" => "get_obj_zval_ptr_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_is_tmp_free = array( - "ANY" => "IS_TMP_FREE(free_op1)", - "TMP" => "1", - "VAR" => "0", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op2_is_tmp_free = array( - "ANY" => "IS_TMP_FREE(free_op2)", - "TMP" => "1", - "VAR" => "0", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op1_free_op = array( - "ANY" => "FREE_OP(free_op1)", - "TMP" => "zval_dtor(free_op1.var)", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op2_free_op = array( - "ANY" => "FREE_OP(free_op2)", - "TMP" => "zval_dtor(free_op2.var)", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op1_free_op_if_var = array( - "ANY" => "FREE_OP_IF_VAR(free_op1)", - "TMP" => "", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op2_free_op_if_var = array( - "ANY" => "FREE_OP_IF_VAR(free_op2)", - "TMP" => "", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op1_free_op_var_ptr = array( - "ANY" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "TMP" => "", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op2_free_op_var_ptr = array( - "ANY" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "TMP" => "", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$list = array(); // list of opcode handlers and helpers in original order -$opcodes = array(); // opcode handlers by code -$helpers = array(); // opcode helpers by name -$params = array(); // parameters of helpers -$opnames = array(); // opcode name to code mapping -$line_no = 1; - -// Writes $s into resulting executor -function out($f, $s) { - global $line_no; - - fputs($f,$s); - $line_no += substr_count($s, "\n"); -} - -// Resets #line directives in resulting executor -function out_line($f) { - global $line_no, $executor_file; - - fputs($f,"#line ".($line_no+1)." \"".$executor_file."\"\n"); - ++$line_no; -} - -// Returns name of specialized helper -function helper_name($name, $spec, $op1, $op2) { - global $prefix, $helpers; - - if (isset($helpers[$name])) { - // If we haven't helper with specified spicialized operands then - // using unspecialized helper - if (!isset($helpers[$name]["op1"][$op1]) && - isset($helpers[$name]["op1"]["ANY"])) { - $op1 = "ANY"; - } - if (!isset($helpers[$name]["op2"][$op2]) && - isset($helpers[$name]["op2"]["ANY"])) { - $op2 = "ANY"; - } - } - return $name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]; -} - -// Generates code for opcode handler or helper -function gen_code($f, $spec, $kind, $code, $op1, $op2) { - global $op1_type, $op2_type, $op1_get_zval_ptr, $op2_get_zval_ptr, - $op1_get_zval_ptr_ptr, $op2_get_zval_ptr_ptr, - $op1_get_obj_zval_ptr, $op2_get_obj_zval_ptr, - $op1_get_obj_zval_ptr_ptr, $op2_get_obj_zval_ptr_ptr, - $op1_is_tmp_free, $op2_is_tmp_free, $op1_free, $op2_free, - $op1_free_op, $op2_free_op, $op1_free_op_if_var, $op2_free_op_if_var, - $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix; - - // Specializing - $code = preg_replace( - array( - "/OP1_TYPE/", - "/OP2_TYPE/", - "/OP1_FREE/", - "/OP2_FREE/", - "/GET_OP1_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP2_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP1_ZVAL_PTR_PTR\(([^)]*)\)/", - "/GET_OP2_ZVAL_PTR_PTR\(([^)]*)\)/", - "/GET_OP1_OBJ_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP2_OBJ_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP1_OBJ_ZVAL_PTR_PTR\(([^)]*)\)/", - "/GET_OP2_OBJ_ZVAL_PTR_PTR\(([^)]*)\)/", - "/IS_OP1_TMP_FREE\(\)/", - "/IS_OP2_TMP_FREE\(\)/", - "/FREE_OP1\(\)/", - "/FREE_OP2\(\)/", - "/FREE_OP1_IF_VAR\(\)/", - "/FREE_OP2_IF_VAR\(\)/", - "/FREE_OP1_VAR_PTR\(\)/", - "/FREE_OP2_VAR_PTR\(\)/", - "/^#ifdef\s+ZEND_VM_SPEC\s*\n/m", - "/^#ifndef\s+ZEND_VM_SPEC\s*\n/m", - "/\!defined\(ZEND_VM_SPEC\)/m", - "/defined\(ZEND_VM_SPEC\)/m", - "/ZEND_VM_C_LABEL\(\s*([A-Za-z_]*)\s*\)/m", - "/ZEND_VM_C_GOTO\(\s*([A-Za-z_]*)\s*\)/m", - "/^#if\s+1\s*\\|\\|.*[^\\\\]$/m", - "/^#if\s+0\s*&&.*[^\\\\]$/m" - ), - array( - $op1_type[$op1], - $op2_type[$op2], - $op1_free[$op1], - $op2_free[$op2], - $op1_get_zval_ptr[$op1], - $op2_get_zval_ptr[$op2], - $op1_get_zval_ptr_ptr[$op1], - $op2_get_zval_ptr_ptr[$op2], - $op1_get_obj_zval_ptr[$op1], - $op2_get_obj_zval_ptr[$op2], - $op1_get_obj_zval_ptr_ptr[$op1], - $op2_get_obj_zval_ptr_ptr[$op2], - $op1_is_tmp_free[$op1], - $op2_is_tmp_free[$op2], - $op1_free_op[$op1], - $op2_free_op[$op2], - $op1_free_op_if_var[$op1], - $op2_free_op_if_var[$op2], - $op1_free_op_var_ptr[$op1], - $op2_free_op_var_ptr[$op2], - ($op1!="ANY"||$op2!="ANY")?"#if 1\n":"#if 0\n", - ($op1!="ANY"||$op2!="ANY")?"#if 0\n":"#if 1\n", - ($op1!="ANY"||$op2!="ANY")?"0":"1", - ($op1!="ANY"||$op2!="ANY")?"1":"0", - "\\1".(($spec && $kind != ZEND_VM_KIND_CALL)?("_SPEC".$prefix[$op1].$prefix[$op2]):""), - "goto \\1".(($spec && $kind != ZEND_VM_KIND_CALL)?("_SPEC".$prefix[$op1].$prefix[$op2]):""), - "#if 1", - "#if 0", - ), - $code); - - // Updating code according to selected threading model - switch($kind) { - case ZEND_VM_KIND_CALL: - $code = preg_replace( - array( - "/EXECUTE_DATA/m", - "/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", - "/ZEND_VM_DISPATCH_TO_HELPER\(\s*([A-Za-z_]*)\s*\)/me", - "/ZEND_VM_DISPATCH_TO_HELPER_EX\(\s*([A-Za-z_]*)\s*,\s*[A-Za-z_]*\s*,\s*(.*)\s*\);/me", - ), - array( - "execute_data", - "return \\1".($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)", - "'return '.helper_name('\\1',$spec,'$op1','$op2').'(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)'", - "'return '.helper_name('\\1',$spec,'$op1','$op2').'(\\2, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);'", - ), - $code); - break; - case ZEND_VM_KIND_SWITCH: - $code = preg_replace( - array( - "/EXECUTE_DATA/m", - "/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", - "/ZEND_VM_DISPATCH_TO_HELPER\(\s*([A-Za-z_]*)\s*\)/me", - "/ZEND_VM_DISPATCH_TO_HELPER_EX\(\s*([A-Za-z_]*)\s*,\s*([A-Za-z_]*)\s*,\s*(.*)\s*\);/me", - ), - array( - "&execute_data", - "goto \\1".($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_LABEL", - "'goto '.helper_name('\\1',$spec,'$op1','$op2')", - "'\\2 = \\3; goto '.helper_name('\\1',$spec,'$op1','$op2').';'", - ), - $code); - break; - case ZEND_VM_KIND_GOTO: - $code = preg_replace( - array( - "/EXECUTE_DATA/m", - "/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", - "/ZEND_VM_DISPATCH_TO_HELPER\(\s*([A-Za-z_]*)\s*\)/me", - "/ZEND_VM_DISPATCH_TO_HELPER_EX\(\s*([A-Za-z_]*)\s*,\s*([A-Za-z_]*)\s*,\s*(.*)\s*\);/me", - ), - array( - "&execute_data", - "goto \\1".($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER", - "'goto '.helper_name('\\1',$spec,'$op1','$op2')", - "'\\2 = \\3; goto '.helper_name('\\1',$spec,'$op1','$op2').';'", - ), - $code); - break; - } - - /* Remove unused free_op1 and free_op2 declarations */ - if ($spec && preg_match_all('/^\s*zend_free_op\s+[^;]+;\s*$/me', $code, $matches, PREG_SET_ORDER)) { - $n = 0; - foreach ($matches as $match) { - $code = preg_replace('/'.preg_quote($match[0],'/').'/', "\$D$n", $code); - ++$n; - } - $del_free_op1 = (strpos($code, "free_op1") === false); - $del_free_op2 = (strpos($code, "free_op2") === false); - $n = 0; - foreach ($matches as $match) { - $dcl = $match[0]; - $changed = 0; - if ($del_free_op1 && strpos($dcl, "free_op1") !== false) { - $dcl = preg_replace("/free_op1\s*,\s*/", "", $dcl); - $dcl = preg_replace("/free_op1\s*;/", ";", $dcl); - $changed = 1; - } - if ($del_free_op2 && strpos($dcl, "free_op2") !== false) { - $dcl = preg_replace("/free_op2\s*,\s*/", "", $dcl); - $dcl = preg_replace("/free_op2\s*;/", ";", $dcl); - $changed = 1; - } - if ($changed) { - $dcl = preg_replace("/,\s*;/", ";", $dcl); - $dcl = preg_replace("/zend_free_op\s*;/", "", $dcl); - } - $code = preg_replace("/\\\$D$n/", $dcl, $code); - ++$n; - } - } - - /* Remove unnecessary ';' */ - $code = preg_replace('/^\s*;\s*$/m', '', $code); - - /* Remove WS */ - $code = preg_replace('/[ \t]+\n/m', "\n", $code); - - out($f, $code); -} - -// Generates opcode handler -function gen_handler($f, $spec, $kind, $name, $op1, $op2, $use, $code, $lineno) { - global $definition_file, $prefix, $typecode, $opnames; - - if (ZEND_VM_LINES) { - out($f, "#line $lineno \"$definition_file\"\n"); - } - - // Generate opcode handler's entry point according to selected threading model - switch($kind) { - case ZEND_VM_KIND_CALL: - out($f,"static int ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n"); - break; - case ZEND_VM_KIND_SWITCH: - if ($spec) { - out($f,"case ".((string)($opnames[$name]*25+($typecode[$op1]*5)+$typecode[$op2])).": /*".$name."_SPEC".$prefix[$op1].$prefix[$op2]."_HANDLER*/"); - } else { - out($f,"case ".$name.":"); - } - if ($use) { - // This handler is used by other handlers. We will add label to call it. - out($f," ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_LABEL:\n"); - } else { - out($f,"\n"); - } - break; - case ZEND_VM_KIND_GOTO: - out($f,$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER:\n"); - break; - } - - // Generate opcode handler's code - gen_code($f, $spec, $kind, $code, $op1, $op2); -} - -// Generates helper -function gen_helper($f, $spec, $kind, $name, $op1, $op2, $param, $code, $lineno) { - global $definition_file, $prefix; - - if (ZEND_VM_LINES) { - out($f, "#line $lineno \"$definition_file\"\n"); - } - - // Generate helper's entry point according to selected threading model - switch($kind) { - case ZEND_VM_KIND_CALL: - if ($param == null) { - // Helper without parameters - out($f, "static int ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."(ZEND_OPCODE_HANDLER_ARGS)\n"); - } else { - // Helper with parameter - out($f, "static int ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."(".$param.", ZEND_OPCODE_HANDLER_ARGS)\n"); - } - break; - case ZEND_VM_KIND_SWITCH: - out($f, $name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2].":\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f, $name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2].":\n"); - break; - } - - // Generate helper's code - gen_code($f, $spec, $kind, $code, $op1, $op2); -} - -// Generates array of opcode handlers (specialized or unspecialized) -function gen_labels($f, $spec, $kind, $prolog) { - global $opcodes, $op_types, $prefix, $typecode; - - $next = 0; - if ($spec) { - // Emit labels for specialized executor - - // For each opcode in opcode number order - foreach($opcodes as $num => $dsc) { - while ($next != $num) { - // If some opcode numbers are not used then fill hole with pointers - // to handler of undefined opcode - $op1t = $op_types; - // For each op1.op_type except ANY - foreach($op1t as $op1) { - if ($op1 != "ANY") { - $op2t = $op_types; - // For each op2.op_type except ANY - foreach($op2t as $op2) { - if ($op2 != "ANY") { - // Emit pointer to handler of undefined opcode - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1,\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER,\n"); - break; - } - } - } - } - } - $next++; - } - $next = $num + 1; - $op1t = $op_types; - // For each op1.op_type except ANY - foreach($op1t as $op1) { - if ($op1 != "ANY") { - if (!isset($dsc["op1"][$op1])) { - // Try to use unspecialized handler - $op1 = "ANY"; - } - $op2t = $op_types; - // For each op2.op_type except ANY - foreach($op2t as $op2) { - if ($op2 != "ANY") { - if (!isset($dsc["op2"][$op2])) { - // Try to use unspecialized handler - $op2 = "ANY"; - } - // Check if specialized handler is defined - if (isset($dsc["op1"][$op1]) && - isset($dsc["op2"][$op2])) { - // Emit pointer to specialized handler - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog.$dsc["op"]."_SPEC".$prefix[$op1].$prefix[$op2]."_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)".((string)($num*25+$typecode[$op1]*5+$typecode[$op2])).",\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&".$dsc["op"]."_SPEC".$prefix[$op1].$prefix[$op2]."_HANDLER,\n"); - break; - } - } else { - // Emit pinter to handler of undefined opcode - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1,\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER,\n"); - break; - } - } - } - } - } - } - } - } else { - // Emit labels for unspecialized executor - - // For each opcode in opcode number order - foreach($opcodes as $num => $dsc) { - while ($next != $num) { - // If some opcode numbers are not used then fill hole with pointers - // to handler of undefined opcode - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1,\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER,\n"); - break; - } - $next++; - } - $next = $num+1; - // Emit pointer to unspecialized handler - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog.$dsc["op"]."_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)".((string)$num).",\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&".$dsc["op"]."_HANDLER,\n"); - break; - } - } - } - - // Emit last handler's label (undefined opcode) - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER\n"); - break; - } -} - -// Generates handler for undefined opcodes (CALL threading model) -function gen_null_handler($f) { - static $done = 0; - - // New and all executors with CALL threading model can use the same handler - // for undefined opcodes, do we emit code for it only once - if (!$done) { - $done = 1; - out($f,"static int ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n"); - out($f,"{\n"); - out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type);\n"); - out($f,"\tZEND_VM_RETURN_FROM_EXECUTE_LOOP();\n"); - out($f,"}\n\n"); - } -} - -// Generates all opcode handlers and helpers (specialized or unspecilaized) -function gen_executor_code($f, $spec, $kind, $prolog) { - global $list, $opcodes, $helpers, $op_types; - - if ($spec) { - // Produce specialized executor - $op1t = $op_types; - // for each op1.op_type - foreach($op1t as $op1) { - $op2t = $op_types; - // for each op2.op_type - foreach($op2t as $op2) { - // for each handlers in helpers in original order - foreach ($list as $lineno => $dsc) { - if (isset($dsc["handler"])) { - $num = $dsc["handler"]; - // Check if handler accepts such types of operands (op1 and op2) - if (isset($opcodes[$num]["op1"][$op1]) && - isset($opcodes[$num]["op2"][$op2])) { - // Generate handler code - gen_handler($f, 1, $kind, $opcodes[$num]["op"], $op1, $op2, isset($opcodes[$num]["use"]), $opcodes[$num]["code"], $lineno); - } - } else if (isset($dsc["helper"])) { - $num = $dsc["helper"]; - // Check if handler accepts such types of operands (op1 and op2) - if (isset($helpers[$num]["op1"][$op1]) && - isset($helpers[$num]["op2"][$op2])) { - // Generate helper code - gen_helper($f, 1, $kind, $num, $op1, $op2, $helpers[$num]["param"], $helpers[$num]["code"], $lineno); - } - } else { - var_dump($dsc); - die("??? $kind:$num\n"); - } - } - } - } - } else { - // Produce unspecialized executor - - // for each handlers in helpers in original order - foreach ($list as $lineno => $dsc) { - if (isset($dsc["handler"])) { - $num = $dsc["handler"]; - // Generate handler code - gen_handler($f, 0, $kind, $opcodes[$num]["op"], "ANY", "ANY", isset($opcodes[$num]["use"]), $opcodes[$num]["code"], $lineno); - } else if (isset($dsc["helper"])) { - $num = $dsc["helper"]; - // Generate helper code - gen_helper($f, 0, $kind, $num, "ANY", "ANY", $helpers[$num]["param"], $helpers[$num]["code"], $lineno); - } else { - var_dump($dsc); - die("??? $kind:$num\n"); - } - } - } - - if (ZEND_VM_LINES) { - // Reset #line directives - out_line($f); - } - - // Generate handler for undefined opcodes - switch ($kind) { - case ZEND_VM_KIND_CALL: - gen_null_handler($f); - break; - case ZEND_VM_KIND_SWITCH: - out($f,"default:\n"); - out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type);\n"); - out($f,"\tZEND_VM_RETURN_FROM_EXECUTE_LOOP();\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,"ZEND_NULL_HANDLER:\n"); - out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type);\n"); - out($f,"\tZEND_VM_RETURN_FROM_EXECUTE_LOOP();\n"); - break; - } -} - -function skip_blanks($f, $prolog, $epilog) { - if (trim($prolog) != "" || trim($epilog) != "") { - out($f, $prolog.$epilog); - } -} - -// Generates executor from skeleton file and definition (specialized or unspecialized) -function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, $old) { - global $params, $skeleton_file, $line_no; - - $lineno = 0; - foreach ($skl as $line) { - // Skeleton file contains special markers in form %NAME% those are - // substituted by custom code - if (preg_match("/(.*)[{][%]([A-Z_]*)[%][}](.*)/", $line, $m)) { - switch ($m[2]) { - case "DEFINES": - if (ZEND_VM_OLD_EXECUTOR) { - out($f,"static int zend_vm_old_executor = 0;\n\n"); - } - out($f,"static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op);\n\n"); - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,"\n"); - out($f,"#define ZEND_VM_CONTINUE() return 0\n"); - out($f,"#define ZEND_VM_RETURN() return 1\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,"\n"); - out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n"); - out($f,"#define ZEND_VM_RETURN() return\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opcode, opline); goto zend_vm_dispatch;\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL &execute_data TSRMLS_CC\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,"\n"); - out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(EX(opline)->handler)\n"); - out($f,"#define ZEND_VM_RETURN() return\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode, opline));\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL &execute_data TSRMLS_CC\n"); - break; - } - break; - case "EXECUTOR_NAME": - out($f, $m[1].$executor_name.$m[3]."\n"); - break; - case "HELPER_VARS": - if ($kind != ZEND_VM_KIND_CALL) { - if ($kind == ZEND_VM_KIND_SWITCH) { - out($f,$m[1]."opcode_handler_t dispatch_handler;\n"); - } - // Emit local variables those are used for helpers' parameters - foreach ($params as $param => $x) { - out($f,$m[1].$param.";\n"); - } - } else { - skip_blanks($f, $m[1], $m[3]."\n"); - } - break; - case "INTERNAL_LABELS": - if ($kind == ZEND_VM_KIND_GOTO) { - // Emit array of labels of opcode handlers and code for - // zend_opcode_handlers initialization - $prolog = $m[1]; - out($f,$prolog."if (op_array == NULL) {\n"); - out($f,$prolog."\tstatic const opcode_handler_t labels[] = {\n"); - gen_labels($f, $spec, $kind, $prolog."\t\t"); - out($f,$prolog."\t};\n"); - out($f,$prolog."\tzend_opcode_handlers = (opcode_handler_t*)labels;\n"); - out($f,$prolog."\treturn;\n"); - out($f,$prolog."}\n"); - } else { - skip_blanks($f, $m[1], $m[3]); - } - break; - case "ZEND_VM_CONTINUE_LABEL": - if ($kind == ZEND_VM_KIND_SWITCH) { - // Only SWITCH dispatch method use it - out($f,"zend_vm_continue:".$m[3]."\n"); - } else { - skip_blanks($f, $m[1], $m[3]); - } - break; - case "ZEND_VM_DISPATCH": - // Emit code that dispatches to opcode handler - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f, $m[1]."if (EX(opline)->handler(&execute_data TSRMLS_CC) > 0)".$m[3]."\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f, $m[1]."dispatch_handler = EX(opline)->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)dispatch_handler)".$m[3]."\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f, $m[1]."goto *(void**)(EX(opline)->handler);".$m[3]."\n"); - break; - } - break; - case "INTERNAL_EXECUTOR": - if ($kind == ZEND_VM_KIND_CALL) { - // Executor is defined as a set of functions - out($f, $m[1]."return;".$m[3]."\n"); - } else { - // Emit executor code - gen_executor_code($f, $spec, $kind, $m[1]); - } - break; - case "EXTERNAL_EXECUTOR": - if ($kind == ZEND_VM_KIND_CALL) { - // Unspecialized executor with CALL threading is the same as the - // old one, so we don't need to produce code twitch - if (!$old || ZEND_VM_SPEC || (ZEND_VM_KIND != ZEND_VM_KIND_CALL)) { - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - // Emit executor code - gen_executor_code($f, $spec, $kind, $m[1]); - } - } - break; - case "INITIALIZER_NAME": - out($f, $m[1].$initializer_name.$m[3]."\n"); - break; - case "EXTERNAL_LABELS": - // Emit code that initializes zend_opcode_handlers array - $prolog = $m[1]; - if ($kind == ZEND_VM_KIND_GOTO) { - // Labels are defined in the executor itself, so we call it - // with op_array NULL and it sets zend_opcode_handlers array - out($f,$prolog."TSRMLS_FETCH();\n"); - out($f,$prolog."zend_execute(NULL TSRMLS_CC);\n"); - } else { - if ($old) { - // Reserving space for user-defined opcodes - out($f,$prolog."static opcode_handler_t labels[512] = {\n"); - } else { - out($f,$prolog."static const opcode_handler_t labels[] = {\n"); - } - gen_labels($f, $spec, $kind, $prolog."\t"); - out($f,$prolog."};\n"); - out($f,$prolog."zend_opcode_handlers = (opcode_handler_t*)labels;\n"); - if ($old) { - // Setup old executor - out($f,$prolog."zend_vm_old_executor = 1;\n"); - out($f,$prolog."zend_execute = old_execute;\n"); - } - } - break; - default: - die("ERROR: Unknown keyword ".$m[2]." in skeleton file.\n"); - } - } else { - // Copy the line as is - out($f, $line); - } - } -} - -function gen_vm($def, $skel) { - global $definition_file, $skeleton_file, $executor_file, - $op_types, $list, $opcodes, $helpers, $params, $opnames; - - // Load definition file - $in = @file($def); - if (!$in) { - die("ERROR: Can not open definition file '$def'\n"); - } - // We need absolute path to definition file to use it in #line directives - $definition_file = realpath($def); - - // Load skeleton file - $skl = @file($skel); - if (!$skl) { - die("ERROR: Can not open skeleton file '$skel'\n"); - } - // We need absolute path to skeleton file to use it in #line directives - $skeleton_file = realpath($skel); - - // Parse definition file into tree - $lineno = 0; - $handler = null; - $helper = null; - $max_opcode_len = 0; - $max_opcode = 0; - $export = array(); - foreach ($in as $line) { - ++$lineno; - if (strpos($line,"ZEND_VM_HANDLER(") === 0) { - // Parsing opcode handler's definition - if (preg_match( - "/^ZEND_VM_HANDLER\(\s*([0-9]+)\s*,\s*([A-Z_]+)\s*,\s*([A-Z|]+)\s*,\s*([A-Z|]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_HANDLER definition.\n"); - } - $code = (int)$m[1]; - $op = $m[2]; - $len = strlen($op); - $op1 = array_flip(explode("|",$m[3])); - $op2 = array_flip(explode("|",$m[4])); - - if ($len > $max_opcode_len) { - $max_opcode_len = $len; - } - if ($code > $max_opcode) { - $max_opcode = $code; - } - if (isset($opcodes[$code])) { - die("ERROR ($def:$lineno): Opcode with code '$code' is already defined.\n"); - } - if (isset($opnames[$op])) { - die("ERROR ($def:$lineno): Opcode with name '$op' is already defined.\n"); - } - $opcodes[$code] = array("op"=>$op,"op1"=>$op1,"op2"=>$op2,"code"=>""); - $opnames[$op] = $code; - $handler = $code; - $helper = null; - $list[$lineno] = array("handler"=>$handler); - } else if (strpos($line,"ZEND_VM_HELPER(") === 0) { - // Parsing helper's definition - if (preg_match( - "/^ZEND_VM_HELPER\(\s*([A-Za-z_]+)\s*,\s*([A-Z|]+)\s*,\s*([A-Z|]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_HELPER definition.\n"); - } - $helper = $m[1]; - $op1 = array_flip(explode("|",$m[2])); - $op2 = array_flip(explode("|",$m[3])); - if (isset($helpers[$helper])) { - die("ERROR ($def:$lineno): Helper with name '$helper' is already defined.\n"); - } - $helpers[$helper] = array("op1"=>$op1,"op2"=>$op2,"param"=>null,"code"=>""); - $handler = null; - $list[$lineno] = array("helper"=>$helper); - } else if (strpos($line,"ZEND_VM_HELPER_EX(") === 0) { - // Parsing helper with parameter definition - if (preg_match( - "/^ZEND_VM_HELPER_EX\(\s*([A-Za-z_]+)\s*,\s*([A-Z|]+)\s*,\s*([A-Z|]+)\s*,\s*(.*)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_HELPER definition.\n"); - } - $helper = $m[1]; - $op1 = array_flip(explode("|",$m[2])); - $op2 = array_flip(explode("|",$m[3])); - $param = $m[4]; - if (isset($helpers[$helper])) { - die("ERROR ($def:$lineno): Helper with name '$helper' is already defined.\n"); - } - - // Store parameter - $params[$param] = 1; - - $helpers[$helper] = array("op1"=>$op1,"op2"=>$op2,"param"=>$param,"code"=>""); - $handler = null; - $list[$lineno] = array("helper"=>$helper); - } else if (strpos($line,"ZEND_VM_EXPORT_HANDLER(") === 0) { - if (preg_match( - "/^ZEND_VM_EXPORT_HANDLER\(\s*([A-Za-z_]+)\s*,\s*([A-Z_]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_EXPORT_HANDLER definition.\n"); - } - if (!isset($opnames[$m[2]])) { - die("ERROR ($def:$lineno): opcode '{$m[2]}' is not defined.\n"); - } - $export[] = array("handler",$m[1],$m[2]); - } else if (strpos($line,"ZEND_VM_EXPORT_HELPER(") === 0) { - if (preg_match( - "/^ZEND_VM_EXPORT_HELPER\(\s*([A-Za-z_]+)\s*,\s*([A-Za-z_]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_EXPORT_HELPER definition.\n"); - } - if (!isset($helpers[$m[2]])) { - die("ERROR ($def:$lineno): helper '{$m[2]}' is not defined.\n"); - } - $export[] = array("helper",$m[1],$m[2]); - } else if ($handler !== null) { - // Add line of code to current opcode handler - $opcodes[$handler]["code"] .= $line; - } else if ($helper !== null) { - // Add line of code to current helper - $helpers[$helper]["code"] .= $line; - } - } - - ksort($opcodes); - - // Search for opcode handlers those are used by other opcode handlers - foreach ($opcodes as $dsc) { - if (preg_match("/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", $dsc["code"], $m)) { - $op = $m[1]; - if (!isset($opnames[$op])) { - die("ERROR ($def:$lineno): Opcode with name '$op' is not defined.\n"); - } - $code = $opnames[$op]; - $opcodes[$code]['use'] = 1; - } - } - - // Generate opcode #defines (zend_vm_opcodes.h) - $code_len = strlen((string)$max_opcode); - $f = fopen("zend_vm_opcodes.h", "w+") or die("ERROR: Cannot create zend_vm_opcodes.h\n"); - - // Insert header - out($f, $GLOBALS['header_text']); - - foreach ($opcodes as $code => $dsc) { - $code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT); - $op = str_pad($dsc["op"],$max_opcode_len); - fputs($f,"#define $op $code\n"); - } - fclose($f); - echo "zend_vm_opcodes.h generated successfully.\n"; - - // Generate zend_vm_execute.h - $f = fopen("zend_vm_execute.h", "w+") or die("ERROR: Cannot create zend_vm_execute.h\n"); - $executor_file = realpath("zend_vm_execute.h"); - - // Insert header - out($f, $GLOBALS['header_text']); - - // Support for ZEND_USER_OPCODE - out($f, "static opcode_handler_t zend_user_opcode_handlers[256] = {"); - for ($i = 0; $i < 255; ++$i) { - out($f, "(opcode_handler_t)NULL,"); - } - out($f, "(opcode_handler_t)NULL};\n\n"); - - out($f, "static zend_uchar zend_user_opcodes[256] = {"); - for ($i = 0; $i < 255; ++$i) { - out($f, "$i,"); - } - out($f, "255};\n\n"); - - // Generate specialized executor - gen_executor($f, $skl, ZEND_VM_SPEC, ZEND_VM_KIND, "execute", "zend_init_opcodes_handlers", 0); - - // Generate un-specialized executor - if (ZEND_VM_OLD_EXECUTOR) { - out($f,"\n/* Old executor */\n\n"); - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data.element\n\n"); - out($f,"#undef ZEND_VM_CONTINUE\n\n"); - out($f,"#undef ZEND_VM_RETURN\n\n"); - out($f,"#undef ZEND_VM_DISPATCH\n\n"); - out($f,"#undef ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL\n\n"); - gen_executor($f, $skl, 0, ZEND_VM_KIND_CALL, "old_execute", "zend_vm_use_old_executor", 1); - } - - // Generate zend_vm_get_opcode_handler() function - out($f, "static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op)\n"); - out($f, "{\n"); - if (!ZEND_VM_SPEC) { - out($f, "\treturn zend_opcode_handlers[opcode];\n"); - } else { - if (ZEND_VM_OLD_EXECUTOR) { - out($f, "\tif (zend_vm_old_executor) {\n"); - out($f, "\t\treturn zend_opcode_handlers[opcode];\n"); - out($f, "\t} else {\n"); - } - out($f, "\t\tstatic const int zend_vm_decode[] = {\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 0 */\n"); - out($f, "\t\t\t_CONST_CODE, /* 1 = IS_CONST */\n"); - out($f, "\t\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 3 */\n"); - out($f, "\t\t\t_VAR_CODE, /* 4 = IS_VAR */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 5 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 6 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 7 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 8 = IS_UNUSED */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 9 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 10 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 11 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 12 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 13 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 14 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 15 */\n"); - out($f, "\t\t\t_CV_CODE /* 16 = IS_CV */\n"); - out($f, "\t\t};\n"); - out($f, "\t\treturn zend_opcode_handlers[opcode * 25 + zend_vm_decode[op->op1.op_type] * 5 + zend_vm_decode[op->op2.op_type]];\n"); - if (ZEND_VM_OLD_EXECUTOR) { - out($f, "\t}\n"); - } - } - out($f, "}\n\n"); - - // Generate zend_vm_get_opcode_handler() function - out($f, "ZEND_API void zend_vm_set_opcode_handler(zend_op* op)\n"); - out($f, "{\n"); - out($f, "\top->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op);\n"); - out($f, "}\n\n"); - - // Export handlers and helpers - if (count($export) > 0 && - !ZEND_VM_OLD_EXECUTOR && - ZEND_VM_KIND != ZEND_VM_KIND_CALL) { - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - out($f,"#undef ZEND_VM_CONTINUE\n"); - out($f,"#undef ZEND_VM_RETURN\n"); - out($f,"#undef ZEND_VM_DISPATCH\n"); - out($f,"#undef ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL\n\n"); - out($f,"#define ZEND_VM_CONTINUE() return 0\n"); - out($f,"#define ZEND_VM_RETURN() return 1\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n\n"); - } - foreach ($export as $dsk) { - list($kind, $func, $name) = $dsk; - out($f, "ZEND_API int $func("); - if ($kind == "handler") { - out($f, "ZEND_OPCODE_HANDLER_ARGS)\n"); - $code = $opcodes[$opnames[$name]]['code']; - } else { - $h = $helpers[$name]; - if ($h['param'] == null) { - out($f, "ZEND_OPCODE_HANDLER_ARGS)\n"); - } else { - out($f, $h['param']. ", ZEND_OPCODE_HANDLER_ARGS)\n"); - } - $code = $h['code']; - } - $done = 0; - if (ZEND_VM_OLD_EXECUTOR) { - if ($kind == "handler") { - out($f, "{\n\treturn ".$name."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } else if ($helpers[$name]["param"] == null) { - out($f, "{\n\treturn ".$name."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } - } else if (ZEND_VM_KIND == ZEND_VM_KIND_CALL) { - if ($kind == "handler") { - $op = $opcodes[$opnames[$name]]; - if (isset($op['op1']["ANY"]) && isset($op['op2']["ANY"])) { - out($f, "{\n\treturn ".$name.(ZEND_VM_SPEC?"_SPEC":"")."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } - } else if ($helpers[$name]["param"] == null) { - $h = $helpers[$name]; - if (isset($h['op1']["ANY"]) && isset($h['op2']["ANY"])) { - out($f, "{\n\treturn ".$name.(ZEND_VM_SPEC?"_SPEC":"")."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } - } - } - if (!$done) { - gen_code($f, 0, ZEND_VM_KIND_CALL, $code, 'ANY', 'ANY'); - } - } - - fclose($f); - echo "zend_vm_execute.h generated successfully.\n"; -} - -function usage() { - echo("\nUsage: php zend_vm_gen.php [options]\n". - "\nOptions:". - "\n --with-vm-kind=CALL|SWITCH|GOTO - select threading model (default is CALL)". - "\n --without-specializer - disable executor specialization". - "\n --with-old-executor - enable old executor". - "\n --with-lines - enable #line directives". - "\n\n"); -} - -// Parse arguments -for ($i = 1; $i < $argc; $i++) { - if (strpos($argv[$i],"--with-vm-kind=") === 0) { - $kind = substr($argv[$i], strlen("--with-vm-kind=")); - switch ($kind) { - case "CALL": - define("ZEND_VM_KIND", ZEND_VM_KIND_CALL); - break; - case "SWITCH": - define("ZEND_VM_KIND", ZEND_VM_KIND_SWITCH); - break; - case "GOTO": - define("ZEND_VM_KIND", ZEND_VM_KIND_GOTO); - break; - default: - echo("ERROR: Invalid vm kind '$kind'\n"); - usage(); - die(); - } - } else if ($argv[$i] == "--without-specializer") { - // Disabling specialization - define("ZEND_VM_SPEC", 0); - } else if ($argv[$i] == "--with-old-executor") { - // Disabling code for old-style executor - define("ZEND_VM_OLD_EXECUTOR", 1); - } else if ($argv[$i] == "--with-lines") { - // Enabling debuging using original zend_vm_def.h - define("ZEND_VM_LINES", 1); - } else if ($argv[$i] == "--help") { - usage(); - exit(); - } else { - echo("ERROR: Invalid option '".$argv[$i]."'\n"); - usage(); - die(); - } -} - -// Using defaults -if (!defined("ZEND_VM_KIND")) { - // Using CALL threading by default - define("ZEND_VM_KIND", ZEND_VM_KIND_CALL); -} -if (!defined("ZEND_VM_SPEC")) { - // Using specialized executor by default - define("ZEND_VM_SPEC", 1); -} -if (!defined("ZEND_VM_OLD_EXECUTOR")) { - // Include old-style executor by default - define("ZEND_VM_OLD_EXECUTOR", 0); -} -if (!defined("ZEND_VM_LINES")) { - // Disabling #line directives - define("ZEND_VM_LINES", 0); -} - -gen_vm("zend_vm_def.h", "zend_vm_execute.skl"); - -?> diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h deleted file mode 100644 index e8fbd535a6260..0000000000000 --- a/Zend/zend_vm_opcodes.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -#define ZEND_NOP 0 -#define ZEND_ADD 1 -#define ZEND_SUB 2 -#define ZEND_MUL 3 -#define ZEND_DIV 4 -#define ZEND_MOD 5 -#define ZEND_SL 6 -#define ZEND_SR 7 -#define ZEND_CONCAT 8 -#define ZEND_BW_OR 9 -#define ZEND_BW_AND 10 -#define ZEND_BW_XOR 11 -#define ZEND_BW_NOT 12 -#define ZEND_BOOL_NOT 13 -#define ZEND_BOOL_XOR 14 -#define ZEND_IS_IDENTICAL 15 -#define ZEND_IS_NOT_IDENTICAL 16 -#define ZEND_IS_EQUAL 17 -#define ZEND_IS_NOT_EQUAL 18 -#define ZEND_IS_SMALLER 19 -#define ZEND_IS_SMALLER_OR_EQUAL 20 -#define ZEND_CAST 21 -#define ZEND_QM_ASSIGN 22 -#define ZEND_ASSIGN_ADD 23 -#define ZEND_ASSIGN_SUB 24 -#define ZEND_ASSIGN_MUL 25 -#define ZEND_ASSIGN_DIV 26 -#define ZEND_ASSIGN_MOD 27 -#define ZEND_ASSIGN_SL 28 -#define ZEND_ASSIGN_SR 29 -#define ZEND_ASSIGN_CONCAT 30 -#define ZEND_ASSIGN_BW_OR 31 -#define ZEND_ASSIGN_BW_AND 32 -#define ZEND_ASSIGN_BW_XOR 33 -#define ZEND_PRE_INC 34 -#define ZEND_PRE_DEC 35 -#define ZEND_POST_INC 36 -#define ZEND_POST_DEC 37 -#define ZEND_ASSIGN 38 -#define ZEND_ASSIGN_REF 39 -#define ZEND_ECHO 40 -#define ZEND_PRINT 41 -#define ZEND_JMP 42 -#define ZEND_JMPZ 43 -#define ZEND_JMPNZ 44 -#define ZEND_JMPZNZ 45 -#define ZEND_JMPZ_EX 46 -#define ZEND_JMPNZ_EX 47 -#define ZEND_CASE 48 -#define ZEND_SWITCH_FREE 49 -#define ZEND_BRK 50 -#define ZEND_CONT 51 -#define ZEND_BOOL 52 -#define ZEND_INIT_STRING 53 -#define ZEND_ADD_CHAR 54 -#define ZEND_ADD_STRING 55 -#define ZEND_ADD_VAR 56 -#define ZEND_BEGIN_SILENCE 57 -#define ZEND_END_SILENCE 58 -#define ZEND_INIT_FCALL_BY_NAME 59 -#define ZEND_DO_FCALL 60 -#define ZEND_DO_FCALL_BY_NAME 61 -#define ZEND_RETURN 62 -#define ZEND_RECV 63 -#define ZEND_RECV_INIT 64 -#define ZEND_SEND_VAL 65 -#define ZEND_SEND_VAR 66 -#define ZEND_SEND_REF 67 -#define ZEND_NEW 68 -#define ZEND_FREE 70 -#define ZEND_INIT_ARRAY 71 -#define ZEND_ADD_ARRAY_ELEMENT 72 -#define ZEND_INCLUDE_OR_EVAL 73 -#define ZEND_UNSET_VAR 74 -#define ZEND_UNSET_DIM 75 -#define ZEND_UNSET_OBJ 76 -#define ZEND_FE_RESET 77 -#define ZEND_FE_FETCH 78 -#define ZEND_EXIT 79 -#define ZEND_FETCH_R 80 -#define ZEND_FETCH_DIM_R 81 -#define ZEND_FETCH_OBJ_R 82 -#define ZEND_FETCH_W 83 -#define ZEND_FETCH_DIM_W 84 -#define ZEND_FETCH_OBJ_W 85 -#define ZEND_FETCH_RW 86 -#define ZEND_FETCH_DIM_RW 87 -#define ZEND_FETCH_OBJ_RW 88 -#define ZEND_FETCH_IS 89 -#define ZEND_FETCH_DIM_IS 90 -#define ZEND_FETCH_OBJ_IS 91 -#define ZEND_FETCH_FUNC_ARG 92 -#define ZEND_FETCH_DIM_FUNC_ARG 93 -#define ZEND_FETCH_OBJ_FUNC_ARG 94 -#define ZEND_FETCH_UNSET 95 -#define ZEND_FETCH_DIM_UNSET 96 -#define ZEND_FETCH_OBJ_UNSET 97 -#define ZEND_FETCH_DIM_TMP_VAR 98 -#define ZEND_FETCH_CONSTANT 99 -#define ZEND_EXT_STMT 101 -#define ZEND_EXT_FCALL_BEGIN 102 -#define ZEND_EXT_FCALL_END 103 -#define ZEND_EXT_NOP 104 -#define ZEND_TICKS 105 -#define ZEND_SEND_VAR_NO_REF 106 -#define ZEND_CATCH 107 -#define ZEND_THROW 108 -#define ZEND_FETCH_CLASS 109 -#define ZEND_CLONE 110 -#define ZEND_INIT_METHOD_CALL 112 -#define ZEND_INIT_STATIC_METHOD_CALL 113 -#define ZEND_ISSET_ISEMPTY_VAR 114 -#define ZEND_ISSET_ISEMPTY_DIM_OBJ 115 -#define ZEND_PRE_INC_OBJ 132 -#define ZEND_PRE_DEC_OBJ 133 -#define ZEND_POST_INC_OBJ 134 -#define ZEND_POST_DEC_OBJ 135 -#define ZEND_ASSIGN_OBJ 136 -#define ZEND_INSTANCEOF 138 -#define ZEND_DECLARE_CLASS 139 -#define ZEND_DECLARE_INHERITED_CLASS 140 -#define ZEND_DECLARE_FUNCTION 141 -#define ZEND_RAISE_ABSTRACT_ERROR 142 -#define ZEND_ADD_INTERFACE 144 -#define ZEND_VERIFY_ABSTRACT_CLASS 146 -#define ZEND_ASSIGN_DIM 147 -#define ZEND_ISSET_ISEMPTY_PROP_OBJ 148 -#define ZEND_HANDLE_EXCEPTION 149 -#define ZEND_USER_OPCODE 150 diff --git a/build/build.mk b/build/build.mk deleted file mode 100644 index 3e4bad0582e30..0000000000000 --- a/build/build.mk +++ /dev/null @@ -1,73 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2007 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 3.01 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | http://www.php.net/license/3_01.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. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# -# -# Makefile to generate build tools -# - -ZENDDIR = Zend - -SUBDIRS = $(ZENDDIR) TSRM - -STAMP = buildmk.stamp - -ALWAYS = generated_lists - - -all: $(STAMP) $(ALWAYS) - @$(MAKE) -s -f build/build2.mk - -generated_lists: - @echo makefile_am_files = $(ZENDDIR)/Makefile.am \ - TSRM/Makefile.am > $@ - @echo config_h_files = $(ZENDDIR)/acconfig.h TSRM/acconfig.h >> $@ - @echo config_m4_files = $(ZENDDIR)/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \ - $(ZENDDIR)/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@ - -$(STAMP): build/buildcheck.sh - @build/buildcheck.sh $(STAMP) - -snapshot: - distname='$(DISTNAME)'; \ - if test -z "$$distname"; then \ - distname='php5-snapshot'; \ - fi; \ - myname=`basename \`pwd\`` ; \ - cd .. && cp -rp $$myname $$distname; \ - cd $$distname; \ - rm -f $(SUBDIRS) 2>/dev/null || true; \ - for i in $(SUBDIRS); do \ - test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \ - done; \ - find . -type l -exec rm {} \; ; \ - $(MAKE) -f build/build.mk; \ - cd ..; \ - tar cf $$distname.tar $$distname; \ - rm -rf $$distname $$distname.tar.*; \ - bzip2 -9 $$distname.tar; \ - md5sum $$distname.tar.bz2; \ - sync; sleep 2; \ - md5sum $$distname.tar.bz2; \ - bzip2 -t $$distname.tar.bz2 - -cvsclean-work: - @for i in `find . -name .cvsignore`; do \ - (cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice | sed 's/[\r\n]/ /g'` *.o *.a .libs || true); \ - done - -.PHONY: $(ALWAYS) snapshot diff --git a/build/build2.mk b/build/build2.mk deleted file mode 100644 index 30ee6b1a8042d..0000000000000 --- a/build/build2.mk +++ /dev/null @@ -1,60 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2007 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 3.01 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | http://www.php.net/license/3_01.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. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -include generated_lists - -TOUCH_FILES = mkinstalldirs install-sh missing - -LT_TARGETS = ltmain.sh config.guess config.sub - -config_h_in = main/php_config.h.in - -acconfig_h_SOURCES = acconfig.h.in $(config_h_files) - -targets = $(TOUCH_FILES) configure $(config_h_in) - -PHP_AUTOCONF ?= 'autoconf' -PHP_AUTOHEADER ?= 'autoheader' - -SUPPRESS_WARNINGS ?= 2>&1 | (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_DECL_YYTEXT is expanded from...|the top level)'||true) - -all: $(targets) - -acconfig.h: $(acconfig_h_SOURCES) - @echo rebuilding $@ - cat $(acconfig_h_SOURCES) > $@ - -$(config_h_in): configure acconfig.h -# explicitly remove target since autoheader does not seem to work -# correctly otherwise (timestamps are not updated) - @echo rebuilding $@ - @rm -f $@ - $(PHP_AUTOHEADER) $(SUPPRESS_WARNINGS) - -$(TOUCH_FILES): - touch $(TOUCH_FILES) - -aclocal.m4: configure.in acinclude.m4 - @echo rebuilding $@ - cat acinclude.m4 ./build/libtool.m4 > $@ - -configure: aclocal.m4 configure.in $(config_m4_files) - @echo rebuilding $@ - $(PHP_AUTOCONF) $(SUPPRESS_WARNINGS) - diff --git a/build/buildcheck.sh b/build/buildcheck.sh deleted file mode 100755 index 9af2984f539d0..0000000000000 --- a/build/buildcheck.sh +++ /dev/null @@ -1,59 +0,0 @@ -#! /bin/sh -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2007 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 3.01 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | http://www.php.net/license/3_01.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: Stig Bakken | -# | Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id: buildcheck.sh,v 1.37.2.2.2.1 2007-01-01 19:32:10 iliaa Exp $ -# - -echo "buildconf: checking installation..." - -stamp=$1 - -# Allow the autoconf executable to be overridden by $PHP_AUTOCONF. -if test -z "$PHP_AUTOCONF"; then - PHP_AUTOCONF='autoconf' -fi - -# autoconf 2.13 or newer -ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$ac_version"; then -echo "buildconf: autoconf not found." -echo " You need autoconf version 2.13 or newer installed" -echo " to build PHP from CVS." -exit 1 -fi -IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then -echo "buildconf: autoconf version $ac_version found." -echo " You need autoconf version 2.13 or newer installed" -echo " to build PHP from CVS." -exit 1 -else -echo "buildconf: autoconf version $ac_version (ok)" -fi - -if test "$1" = "2" && test "$2" -ge "50"; then - echo "buildconf: Your version of autoconf likely contains buggy cache code." - echo " Running cvsclean for you." - echo " To avoid this, install autoconf-2.13." - ./cvsclean - stamp= -fi - -test -n "$stamp" && touch $stamp - -exit 0 diff --git a/build/config-stubs b/build/config-stubs deleted file mode 100755 index 28208085a7513..0000000000000 --- a/build/config-stubs +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# $Id$ - -dir=$1; shift -for stubfile in $dir/*/config0.m4 $dir/*/config.m4 $dir/*/config9.m4; do - echo "sinclude($stubfile)" -done diff --git a/build/genif.sh b/build/genif.sh deleted file mode 100644 index 61d1f00454889..0000000000000 --- a/build/genif.sh +++ /dev/null @@ -1,41 +0,0 @@ -#! /bin/sh - -# $Id: genif.sh,v 1.6 2005-06-21 13:47:38 sniper Exp $ -# replacement for genif.pl - -infile=$1 -shift -srcdir=$1 -shift -extra_module_ptrs=$1 -shift -awk=$1 -shift - -if test -z "$infile" || test -z "$srcdir"; then - echo "please supply infile and srcdir" - exit 1 -fi - -header_list= -olddir=`pwd` -cd $srcdir - -module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`" - -for ext in ${1+"$@"} ; do - header_list="$header_list ext/$ext/*.h" -done - -includes=`$awk -f ./build/print_include.awk $header_list` - -cd $olddir - -cat $infile | \ - sed \ - -e "s'@EXT_INCLUDE_CODE@'$includes'" \ - -e "s'@EXT_MODULE_PTRS@'$module_ptrs'" \ - -e 's/@NEWLINE@/\ -/g' - - diff --git a/build/libtool.m4 b/build/libtool.m4 deleted file mode 100644 index a4ccb3c7bc6c5..0000000000000 --- a/build/libtool.m4 +++ /dev/null @@ -1,6246 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit , 1996 -## -## This file is free software; the Free Software Foundation gives -## unlimited permission to copy and/or distribute it, with or without -## modifications, as long as this notice is preserved. - -# serial 47 AC_PROG_LIBTOOL - -ifdef([AC_ACVERSION],[ -# autoconf 2.13 compatibility -# Set PATH_SEPARATOR variable -# --------------------------------- -# Find the correct PATH separator. Usually this is :', but -# DJGPP uses ;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac - PATH_SEPARATOR=$lt_cv_sys_path_separator -fi -]) - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -ifdef([AC_PROVIDE_IFELSE], - [], - [define([AC_PROVIDE_IFELSE], - [ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) - -dnl dnl And a similar setup for Fortran 77 support -dnl AC_PROVIDE_IFELSE([AC_PROG_F77], -dnl [AC_LIBTOOL_F77], -dnl [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -dnl ])]) - -dnl dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. -dnl AC_PROVIDE_IFELSE([AC_PROG_GCJ], -dnl [AC_LIBTOOL_GCJ], -dnl [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], -dnl [AC_LIBTOOL_GCJ], -dnl [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], -dnl [AC_LIBTOOL_GCJ], -dnl [ifdef([AC_PROG_GCJ], -dnl [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) -dnl ifdef([A][M_PROG_GCJ], -dnl [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) -dnl ifdef([LT_AC_PROG_GCJ], -dnl [define([LT_AC_PROG_GCJ], -dnl defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -dnl ]) -])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], -[ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], -[ --with-pic try to use only PIC/non-PIC objects [default=use both]], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_LINKER_BOILERPLATE - - -dnl autoconf 2.13 compatibility -dnl _LT_AC_TRY_LINK() -AC_DEFUN(_LT_AC_TRY_LINK, [ -cat > conftest.$ac_ext <&5 - cat conftest.$ac_ext >&6 -ifelse([$2], , , [$2 - rm -rf conftest* -])dnl -fi -rm -f conftest*]) - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[_LT_AC_TRY_LINK([ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[dnl -#AC_ARG_ENABLE([libtool-lock], -#[ --disable-libtool-lock avoid locking (might break parallel builds)]) -#test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_SAVE - AC_LANG_C - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_RESTORE]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "configure:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"configure:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "configure:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp - $SED '/^$/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # find out which ABI we are using - libsuff= - case $host_cpu in - x86_64*|s390x*|powerpc64*) - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], -[ --with-tags[=TAGS] include additional configurations [automatic] -], -[tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file \`$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file \`$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using \`LTCC=$LTCC', extracted from \`$ofile']) - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - -# F77) -# if test -n "$F77" && test "X$F77" != "Xno"; then -# AC_LIBTOOL_LANG_F77_CONFIG -# else -# tagname="" -# fi -# ;; -# -# GCJ) -# if test -n "$GCJ" && test "X$GCJ" != "Xno"; then -# AC_LIBTOOL_LANG_GCJ_CONFIG -# else -# tagname="" -# fi -# ;; -# -# RC) -# AC_LIBTOOL_LANG_RC_CONFIG -# ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -#- set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -ifdef([AC_PROG_EGREP], [], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# --------------- -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -#AC_DEFUN([AC_LIBTOOL_F77], -#[AC_REQUIRE([_LT_AC_LANG_F77]) -#])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -#AC_DEFUN([_LT_AC_LANG_F77], -#[AC_REQUIRE([AC_PROG_F77]) -#_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -#])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -#AC_DEFUN([AC_LIBTOOL_GCJ], -#[AC_REQUIRE([_LT_AC_LANG_GCJ]) -#])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -#AC_DEFUN([_LT_AC_LANG_GCJ], -#[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], -# [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], -# [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], -# [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], -# [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], -# [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -#_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -#])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# -------------- -# enable support for Windows resource files -#AC_DEFUN([AC_LIBTOOL_RC], -#[AC_REQUIRE([LT_AC_PROG_RC]) -#_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -#])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_SAVE -AC_LANG_C - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([\`$CC' requires \`$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add \`$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -# Report which librarie types wil actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_RESTORE -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_RESTORE -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDRT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -#AC_DEFUN([LT_AC_PROG_GCJ], -#[AC_CHECK_TOOL(GCJ, gcj, no) -# test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" -# AC_SUBST(GCJFLAGS) -#]) - -#AC_DEFUN([LT_AC_PROG_RC], -#[AC_CHECK_TOOL(RC, windres, no) -#]) - -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if test -f "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) diff --git a/build/mkdep.awk b/build/mkdep.awk deleted file mode 100644 index 06547c79c19ab..0000000000000 --- a/build/mkdep.awk +++ /dev/null @@ -1,75 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 2000-2006 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 3.01 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | http://www.php.net/license/3_01.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. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# -# Usage: -# -# echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \ -# awk -f mkdep.awk > dependencies - - -{ - top_srcdir=$1 - top_builddir=$2 - srcdir=$3 - cmd=$4 - - for (i = 5; i <= NF; i++) { - if (match($i, "^-[A-Z]") == 0) - break; - cmd=cmd " " $i - } - - dif=i-1 - - for (; i <= NF; i++) - filenames[i-dif]=$i - - no_files=NF-dif - - for(i = 1; i <= no_files; i++) { - if (system("test -r " filenames[i]) != 0) - continue - - target=filenames[i] - sub(srcdir "/", "", target) - target2=target - sub("\.(c|cpp)$", ".lo", target); - sub("\.(c|cpp)$", ".slo", target2); - - for (e in used) - delete used[e] - - cmdx=cmd " " filenames[i] - done=0 - while ((cmdx | getline) > 0) { - if (match($0, "^# [0-9]* \".*\.h\"") != 0) { - if (sub(top_srcdir, "$(top_srcdir)", $3) == 0) - sub(top_builddir, "$(top_builddir)", $3) - if (substr($3,2,1) != "/" && used[$3] != 1) { - if (done == 0) - printf(target " " target2 ":") - done=1 - printf(" \\\n\t" substr($3,2,length($3)-2)) - used[$3] = 1; - } - } - } - if (done == 1) - print "\n" - } -} diff --git a/build/order_by_dep.awk b/build/order_by_dep.awk deleted file mode 100644 index 38128b2e1b56a..0000000000000 --- a/build/order_by_dep.awk +++ /dev/null @@ -1,89 +0,0 @@ -BEGIN { - orig_rs = RS; - orig_fs = FS; - RS=" "; - mod_count = 0; - SUBSEP=":"; -} - -function get_deps(module_name, depline, cmd) -{ - # this could probably be made *much* better - RS=orig_rs; - FS="[(,) \t]+" - cmd = "grep PHP_ADD_EXTENSION_DEP ext/" module_name "/config*.m4" - while (cmd | getline) { -# printf("GOT: %s,%s,%s,%s,%s\n", $1, $2, $3, $4, $5); - if (!length($5)) { - $5 = 0; - } - mod_deps[module_name, $4] = $5; - } - close(cmd) - RS=" "; - FS=orig_fs; -} - -function get_module_index(name, i) -{ - for (i in mods) { - if (mods[i] == name) { - return i; - } - } - return -1; -} - -function do_deps(mod_idx, module_name, mod_name_len, dep, ext, val, depidx) -{ - module_name = mods[mod_idx]; - mod_name_len = length(module_name); - - for (ext in mod_deps) { - if (substr(ext, 0, mod_name_len+1) != module_name SUBSEP) { - continue; - } - val = mod_deps[ext]; - ext = substr(ext, mod_name_len+2, length(ext)-mod_name_len); - - depidx = get_module_index(ext); - if (depidx >= 0) { - do_deps(depidx); - } - } - - #printf(" phpext_%s_ptr,\n", module_name); - printf(" phpext_%s_ptr,@NEWLINE@", module_name); - delete mods[mod_idx]; -} - -function count(arr, n, i) -{ - n = 0; - for (i in arr) - n++; - return n; -} - -/^[a-zA-Z0-9_-]+/ { - # mini hack for pedantic awk - gsub("[^a-zA-Z0-9_-]", "", $1) - # add each item to array - mods[mod_count++] = $1 - - # see if it has any module deps - get_deps($1); -} -END { - # order it correctly - out_count = 0; - - while (count(mods)) { - # count down, since we need to assemble it in reverse order - for (i = mod_count-1; i >= 0; --i) { - if (i in mods) { - do_deps(i); - } - } - } -} diff --git a/build/print_include.awk b/build/print_include.awk deleted file mode 100644 index a4919fae87343..0000000000000 --- a/build/print_include.awk +++ /dev/null @@ -1,6 +0,0 @@ -/phpext_/ { - if (old_filename != FILENAME) { - printf "#include \"" FILENAME "\"@NEWLINE@" - old_filename = FILENAME - } -} diff --git a/build/scan_makefile_in.awk b/build/scan_makefile_in.awk deleted file mode 100644 index 0c6d20398fee9..0000000000000 --- a/build/scan_makefile_in.awk +++ /dev/null @@ -1,32 +0,0 @@ -BEGIN { - mode=0 - sources="" -} - -mode == 0 && /^LTLIBRARY_SOURCES.*\\$/ { - if (match($0, "[^=]*$")) { - sources=substr($0, RSTART, RLENGTH-1) - } - mode=1 - next -} - -mode == 0 && /^LTLIBRARY_SOURCES.*/ { - if (match($0, "[^=]*$")) { - sources=substr($0, RSTART, RLENGTH) - } -} - -mode == 1 && /.*\\$/ { - sources=sources substr($0, 0, length - 1) - next -} - -mode == 1 { - sources=sources $0 - mode=0 -} - -END { - print sources -} diff --git a/build/shtool b/build/shtool deleted file mode 100755 index 8d95db5b60895..0000000000000 --- a/build/shtool +++ /dev/null @@ -1,1719 +0,0 @@ -#!/bin/sh -## -## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2006 Ralf S. Engelschall -## -## See http://www.gnu.org/software/shtool/ for more information. -## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. -## -## Version: 2.0.6 (19-Apr-2006) -## Contents: 5/19 available modules -## - -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -## USA, or contact Ralf S. Engelschall . -## -## NOTICE: Given that you include this file verbatim into your own -## source tree, you are justified in saying that it remains separate -## from your package, and that this way you are simply just using GNU -## shtool. So, in this situation, there is no requirement that your -## package itself is licensed under the GNU General Public License in -## order to take advantage of GNU shtool. -## - -## -## Usage: shtool [] [ [] []] -## -## Available commands: -## echo Print string with optional construct expansion -## install Install a program, script or datafile -## mkdir Make one or more directories -## platform Platform Identification Utility -## path Deal with program paths -## -## Not available commands (because module was not built-in): -## mdate Pretty-print modification time of a file or dir -## table Pretty-print a field-separated list as a table -## prop Display progress with a running propeller -## move Move files with simultaneous substitution -## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree through symbolic links -## fixperm Fix file permissions inside a source tree -## rotate Logfile rotation -## tarball Roll distribution tarballs -## subst Apply sed(1) substitution operations -## arx Extended archive command -## slo Separate linker options by library class -## scpp Sharing C Pre-Processor -## version Maintain a version information file -## - -# maximum Bourne-Shell compatibility -if [ ".$ZSH_VERSION" != . ] && (emulate sh) >/dev/null 2>&1; then - # reconfigure zsh(1) - emulate sh - NULLCMD=: - alias -g '${1+"$@"}'='"$@"' -elif [ ".$BASH_VERSION" != . ] && (set -o posix) >/dev/null 2>&1; then - # reconfigure bash(1) - set -o posix -fi - -# maximum independence of NLS nuisances -for var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $var=C; export $var) 2>&1`"); then - eval $var=C; export $var - else - unset $var - fi -done - -# initial command line handling -if [ $# -eq 0 ]; then - echo "$0:Error: invalid command line" 1>&2 - echo "$0:Hint: run \`$0 -h' for usage" 1>&2 - exit 1 -fi -if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 2.0.6 (19-Apr-2006)" - echo 'Copyright (c) 1994-2006 Ralf S. Engelschall ' - echo 'Report bugs to ' - echo '' - echo 'Usage: shtool [] [ [] []]' - echo '' - echo 'Available global :' - echo ' -v, --version display shtool version information' - echo ' -h, --help display shtool usage help page (this one)' - echo ' -d, --debug display shell trace information' - echo ' -r, --recreate recreate this shtool script via shtoolize' - echo '' - echo 'Available [] []:' - echo ' echo [-n|--newline] [-e|--expand] [ ...]' - echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]' - echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode ]' - echo ' [-o|--owner ] [-g|--group ] [-e|--exec' - echo ' ] [ ...] ' - echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode' - echo ' ] [-o|--owner ] [-g|--group ] ' - echo ' [ ...]' - echo ' platform [-F|--format ] [-S|--sep ] [-C|--conc' - echo ' ] [-L|--lower] [-U|--upper] [-v|--verbose]' - echo ' [-c|--concise] [-n|--no-newline] [-t|--type ]' - echo ' [-V|--version] [-h|--help]' - echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]' - echo ' [-m|--magic] [-p|--path ] [ ...]' - echo '' - echo 'Not available (because module was not built-in):' - echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]' - echo ' [-f|--field-sep ] [-o|--order ] ' - echo ' table [-F|--field-sep ] [-w|--width ] [-c|--columns' - echo ' ] [-s|--strip ] ...' - echo ' prop [-p|--prefix ]' - echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]' - echo ' ' - echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] ' - echo ' [ ...] ' - echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] ' - echo ' fixperm [-v|--verbose] [-t|--trace] [ ...]' - echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files' - echo ' ] [-s|--size ] [-c|--copy] [-r|--remove]' - echo ' [-a|--archive-dir ] [-z|--compress [:]]' - echo ' [-b|--background] [-d|--delay] [-p|--pad ] [-m|--mode' - echo ' ] [-o|--owner ] [-g|--group ] [-M|--migrate' - echo ' ] [-P|--prolog ] [-E|--epilog ] [...]' - echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output ]' - echo ' [-c|--compress ] [-d|--directory ] [-u|--user' - echo ' ] [-g|--group ] [-e|--exclude ]' - echo ' [ ...]' - echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]' - echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup' - echo ' ] [-e|--exec ] [-f|--file ] []' - echo ' [...]' - echo ' arx [-t|--trace] [-C|--command ] [' - echo ' ...]' - echo ' slo [-p|--prefix ] -- -L -l [-L -l' - echo ' ...]' - echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter ]' - echo ' [-o|--output ] [-t|--template ] [-M|--mark' - echo ' ] [-D|--define ] [-C|--class ]' - echo ' [ ...]' - echo ' version [-l|--language ] [-n|--name ] [-p|--prefix' - echo ' ] [-s|--set ] [-e|--edit] [-i|--increase' - echo ' ] [-d|--display ] ' - echo '' - exit 0 -fi -if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then - echo "GNU shtool 2.0.6 (19-Apr-2006)" - exit 0 -fi -if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then - shtoolize -oshtool echo install mkdir platform path - exit 0 -fi -if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then - shift - set -x -fi -name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` -case "$name" in - echo|install|mkdir|platform|path ) - # implicit tool command selection - tool="$name" - ;; - * ) - # explicit tool command selection - tool="$1" - shift - ;; -esac -arg_spec="" -opt_spec="" -gen_tmpfile=no - -## -## DISPATCH INTO SCRIPT PROLOG -## - -case $tool in - echo ) - str_tool="echo" - str_usage="[-n|--newline] [-e|--expand] [ ...]" - arg_spec="0+" - opt_spec="n.e." - opt_alias="n:newline,e:expand" - opt_n=no - opt_e=no - ;; - install ) - str_tool="install" - str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode ] [-o|--owner ] [-g|--group ] [-e|--exec ] [ ...] " - arg_spec="1+" - opt_spec="v.t.d.c.C.s.m:o:g:e+" - opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec" - opt_v=no - opt_t=no - opt_d=no - opt_c=no - opt_C=no - opt_s=no - opt_m="0755" - opt_o="" - opt_g="" - opt_e="" - ;; - mkdir ) - str_tool="mkdir" - str_usage="[-t|--trace] [-f|--force] [-p|--parents] [-m|--mode ] [-o|--owner ] [-g|--group ] [ ...]" - arg_spec="1+" - opt_spec="t.f.p.m:o:g:" - opt_alias="t:trace,f:force,p:parents,m:mode,o:owner,g:group" - opt_t=no - opt_f=no - opt_p=no - opt_m="" - opt_o="" - opt_g="" - ;; - platform ) - str_tool="platform" - str_usage="[-F|--format ] [-S|--sep ] [-C|--conc ] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type ] [-V|--version] [-h|--help]" - arg_spec="0=" - opt_spec="F:S:C:L.U.v.c.n.t:d.V.h." - opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help" - opt_F="%{sp} (%{ap})" - opt_S=" " - opt_C="/" - opt_L=no - opt_U=no - opt_t="" - opt_v=no - opt_c=no - opt_n=no - opt_V=no - opt_h=no - ;; - path ) - str_tool="path" - str_usage="[-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename] [-m|--magic] [-p|--path ] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="s.r.d.b.m.p:" - opt_alias="s:suppress,r:reverse,d:dirname,b:basename,m:magic,p:path" - opt_s=no - opt_r=no - opt_d=no - opt_b=no - opt_m=no - opt_p="$PATH" - ;; - -* ) - echo "$0:Error: unknown option \`$tool'" 2>&1 - echo "$0:Hint: run \`$0 -h' for usage" 2>&1 - exit 1 - ;; - * ) - echo "$0:Error: unknown command \`$tool'" 2>&1 - echo "$0:Hint: run \`$0 -h' for usage" 2>&1 - exit 1 - ;; -esac - -## -## COMMON UTILITY CODE -## - -# commonly used ASCII values -ASC_TAB=" " -ASC_NL=" -" - -# determine name of tool -if [ ".$tool" != . ]; then - # used inside shtool script - toolcmd="$0 $tool" - toolcmdhelp="shtool $tool" - msgprefix="shtool:$tool" -else - # used as standalone script - toolcmd="$0" - toolcmdhelp="sh $0" - msgprefix="$str_tool" -fi - -# parse argument specification string -eval `echo $arg_spec |\ - sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` - -# parse option specification string -eval `echo h.$opt_spec |\ - sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` - -# parse option alias string -eval `echo h:help,$opt_alias |\ - sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'` - -# interate over argument line -opt_PREV='' -while [ $# -gt 0 ]; do - # special option stops processing - if [ ".$1" = ".--" ]; then - shift - break - fi - - # determine option and argument - opt_ARG_OK=no - if [ ".$opt_PREV" != . ]; then - # merge previous seen option with argument - opt_OPT="$opt_PREV" - opt_ARG="$1" - opt_ARG_OK=yes - opt_PREV='' - else - # split argument into option and argument - case "$1" in - --[a-zA-Z0-9]*=*) - eval `echo "x$1" |\ - sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'` - opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` - eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" - ;; - --[a-zA-Z0-9]*) - opt_OPT=`echo "x$1" | cut -c4-` - opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` - eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" - opt_ARG='' - ;; - -[a-zA-Z0-9]*) - eval `echo "x$1" |\ - sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ - -e 's/";\(.*\)$/"; opt_ARG="\1"/'` - ;; - -[a-zA-Z0-9]) - opt_OPT=`echo "x$1" | cut -c3-` - opt_ARG='' - ;; - *) - break - ;; - esac - fi - - # eat up option - shift - - # determine whether option needs an argument - eval "opt_MODE=\$opt_MODE_${opt_OPT}" - if [ ".$opt_ARG" = . ] && [ ".$opt_ARG_OK" != .yes ]; then - if [ ".$opt_MODE" = ".:" ] || [ ".$opt_MODE" = ".+" ]; then - opt_PREV="$opt_OPT" - continue - fi - fi - - # process option - case $opt_MODE in - '.' ) - # boolean option - eval "opt_${opt_OPT}=yes" - ;; - ':' ) - # option with argument (multiple occurances override) - eval "opt_${opt_OPT}=\"\$opt_ARG\"" - ;; - '+' ) - # option with argument (multiple occurances append) - eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\"" - ;; - * ) - echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 - exit 1 - ;; - esac -done -if [ ".$opt_PREV" != . ]; then - echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 - exit 1 -fi - -# process help option -if [ ".$opt_h" = .yes ]; then - echo "Usage: $toolcmdhelp $str_usage" - exit 0 -fi - -# complain about incorrect number of arguments -case $arg_MODE in - '=' ) - if [ $# -ne $arg_NUMS ]; then - echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 - exit 1 - fi - ;; - '+' ) - if [ $# -lt $arg_NUMS ]; then - echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 - exit 1 - fi - ;; -esac - -# establish a temporary file on request -if [ ".$gen_tmpfile" = .yes ]; then - # create (explicitly) secure temporary directory - if [ ".$TMPDIR" != . ]; then - tmpdir="$TMPDIR" - elif [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - else - tmpdir="/tmp" - fi - tmpdir="$tmpdir/.shtool.$$" - ( umask 077 - rm -rf "$tmpdir" >/dev/null 2>&1 || true - mkdir "$tmpdir" >/dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2 - exit 1 - fi - ) - - # create (implicitly) secure temporary file - tmpfile="$tmpdir/shtool.tmp" - touch "$tmpfile" -fi - -# utility function: map string to lower case -util_lower () { - echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' -} - -# utility function: map string to upper case -util_upper () { - echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -} - -# cleanup procedure -shtool_exit () { - rc="$1" - if [ ".$gen_tmpfile" = .yes ]; then - rm -rf "$tmpdir" >/dev/null 2>&1 || true - fi - exit $rc -} - -## -## DISPATCH INTO SCRIPT BODY -## - -case $tool in - -echo ) - ## - ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2006 Ralf S. Engelschall - ## - - text="$*" - - # check for broken escape sequence expansion - seo='' - bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" != .3 ]; then - bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - seo='-E' - fi - fi - - # check for existing -n option (to suppress newline) - minusn='' - bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - minusn='-n' - fi - - # determine terminal bold sequence - term_bold='' - term_norm='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[Bb]'`" != . ]; then - case $TERM in - # for the most important terminal types we directly know the sequences - xterm|xterm*|vt220|vt220*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` - ;; - vt100|vt100*|cygwin) - term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` - ;; - # for all others, we try to use a possibly existing `tput' or `tcout' utility - * ) - paths=`echo $PATH | sed -e 's/:/ /g'` - for tool in tput tcout; do - for dir in $paths; do - if [ -r "$dir/$tool" ]; then - for seq in bold md smso; do # 'smso' is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" - break - fi - done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso init reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done - fi - break - fi - done - if [ ".$term_bold" != . ] && [ ".$term_norm" != . ]; then - break; - fi - done - ;; - esac - if [ ".$term_bold" = . ] || [ ".$term_norm" = . ]; then - echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 - term_bold='' - term_norm='' - fi - fi - - # determine user name - username='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[uUgG]'`" != . ]; then - username="`(id -un) 2>/dev/null`" - if [ ".$username" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - username=`echo $str | sed -e 's/^uid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'` - fi - if [ ".$username" = . ]; then - username="$LOGNAME" - if [ ".$username" = . ]; then - username="$USER" - if [ ".$username" = . ]; then - username="`(whoami) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username="`(who am i) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username='unknown' - fi - fi - fi - fi - fi - fi - fi - - # determine user id - userid='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%U'`" != . ]; then - userid="`(id -u) 2>/dev/null`" - if [ ".$userid" = . ]; then - userid="`(id -u ${username}) 2>/dev/null`" - if [ ".$userid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*$//'` - fi - if [ ".$userid" = . ]; then - userid=`(getent passwd ${username}) 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`grep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`(ypcat passwd) 2>/dev/null | - grep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid='?' - fi - fi - fi - fi - fi - fi - fi - - # determine (primary) group id - groupid='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[gG]'`" != . ]; then - groupid="`(id -g ${username}) 2>/dev/null`" - if [ ".$groupid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then - groupid=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*//' -e 's/(.*$//'` - fi - if [ ".$groupid" = . ]; then - groupid=`(getent passwd ${username}) 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$groupid" = . ]; then - groupid=`grep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$groupid" = . ]; then - groupid=`(ypcat passwd) 2>/dev/null | grep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$groupid" = . ]; then - groupid='?' - fi - fi - fi - fi - fi - fi - - # determine (primary) group name - groupname='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%g'`" != . ]; then - groupname="`(id -gn ${username}) 2>/dev/null`" - if [ ".$groupname" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then - groupname=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'` - fi - if [ ".$groupname" = . ]; then - groupname=`(getent group) 2>/dev/null | \ - grep "^[^:]*:[^:]*:${groupid}:" | \ - sed -e 's/:.*$//'` - if [ ".$groupname" = . ]; then - groupname=`grep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \ - sed -e 's/:.*$//'` - if [ ".$groupname" = . ]; then - groupname=`(ypcat group) 2>/dev/null | \ - grep "^[^:]*:[^:]*:${groupid}:" | \ - sed -e 's/:.*$//'` - if [ ".$groupname" = . ]; then - groupname='?' - fi - fi - fi - fi - fi - fi - - # determine host and domain name - hostname='' - domainname='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%h'`" != . ]; then - hostname="`(uname -n) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname="`(hostname) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname='unknown' - fi - fi - case $hostname in - *.* ) - domainname=".`echo $hostname | cut -d. -f2-`" - hostname="`echo $hostname | cut -d. -f1`" - ;; - esac - fi - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%d'`" != . ]; then - if [ ".$domainname" = . ]; then - if [ -f /etc/resolv.conf ]; then - domainname="`grep '^[ ]*domain' /etc/resolv.conf | sed -e 'q' |\ - sed -e 's/.*domain//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - if [ ".$domainname" = . ]; then - domainname="`grep '^[ ]*search' /etc/resolv.conf | sed -e 'q' |\ - sed -e 's/.*search//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/ .*//' -e 's/ .*//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - fi - fi - fi - fi - - # determine current time - time_day='' - time_month='' - time_year='' - time_monthname='' - if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[DMYm]'`" != . ]; then - time_day=`date '+%d'` - time_month=`date '+%m'` - time_year=`date '+%Y' 2>/dev/null` - if [ ".$time_year" = . ]; then - time_year=`date '+%y'` - case $time_year in - [5-9][0-9]) time_year="19$time_year" ;; - [0-4][0-9]) time_year="20$time_year" ;; - esac - fi - case $time_month in - 1|01) time_monthname='Jan' ;; - 2|02) time_monthname='Feb' ;; - 3|03) time_monthname='Mar' ;; - 4|04) time_monthname='Apr' ;; - 5|05) time_monthname='May' ;; - 6|06) time_monthname='Jun' ;; - 7|07) time_monthname='Jul' ;; - 8|08) time_monthname='Aug' ;; - 9|09) time_monthname='Sep' ;; - 10) time_monthname='Oct' ;; - 11) time_monthname='Nov' ;; - 12) time_monthname='Dec' ;; - esac - fi - - # expand special ``%x'' constructs - if [ ".$opt_e" = .yes ]; then - text=`echo $seo "$text" |\ - sed -e "s/%B/${term_bold}/g" \ - -e "s/%b/${term_norm}/g" \ - -e "s/%u/${username}/g" \ - -e "s/%U/${userid}/g" \ - -e "s/%g/${groupname}/g" \ - -e "s/%G/${groupid}/g" \ - -e "s/%h/${hostname}/g" \ - -e "s/%d/${domainname}/g" \ - -e "s/%D/${time_day}/g" \ - -e "s/%M/${time_month}/g" \ - -e "s/%Y/${time_year}/g" \ - -e "s/%m/${time_monthname}/g" 2>/dev/null` - fi - - # create output - if [ .$opt_n = .no ]; then - echo $seo "$text" - else - # the harder part: echo -n is best, because - # awk may complain about some \xx sequences. - if [ ".$minusn" != . ]; then - echo $seo $minusn "$text" - else - echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" - fi - fi - - shtool_exit 0 - ;; - -install ) - ## - ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2006 Ralf S. Engelschall - ## - - # special case: "shtool install -d [...]" internally - # maps to "shtool mkdir -f -p -m 755 [...]" - if [ "$opt_d" = yes ]; then - cmd="$0 mkdir -f -p -m 755" - if [ ".$opt_o" != . ]; then - cmd="$cmd -o '$opt_o'" - fi - if [ ".$opt_g" != . ]; then - cmd="$cmd -g '$opt_g'" - fi - if [ ".$opt_v" = .yes ]; then - cmd="$cmd -v" - fi - if [ ".$opt_t" = .yes ]; then - cmd="$cmd -t" - fi - for dir in "$@"; do - eval "$cmd $dir" || shtool_exit $? - done - shtool_exit 0 - fi - - # determine source(s) and destination - argc=$# - srcs="" - while [ $# -gt 1 ]; do - srcs="$srcs $1" - shift - done - dstpath="$1" - - # type check for destination - dstisdir=0 - if [ -d $dstpath ]; then - dstpath=`echo "$dstpath" | sed -e 's:/$::'` - dstisdir=1 - fi - - # consistency check for destination - if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then - echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 - shtool_exit 1 - fi - - # iterate over all source(s) - for src in $srcs; do - dst=$dstpath - - # if destination is a directory, append the input filename - if [ $dstisdir = 1 ]; then - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi - - # check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 - continue - fi - if [ -d "$src" ]; then - echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 - continue - fi - - # make a temp file name in the destination directory - dsttmp=`echo $dst |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ - -e "s;\$;/#INST@$$#;"` - - # verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi - - # copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 - fi - cp $src $dsttmp || shtool_exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 - fi - mv $src $dsttmp || shtool_exit $? - fi - - # adjust the target file - if [ ".$opt_e" != . ]; then - sed='sed' - OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS" - for e - do - sed="$sed -e '$e'" - done - cp $dsttmp $dsttmp.old - chmod u+w $dsttmp - eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $? - rm -f $dsttmp.old - fi - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 - fi - strip $dsttmp || shtool_exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 - fi - chown $opt_o $dsttmp || shtool_exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 - fi - chgrp $opt_g $dsttmp || shtool_exit $? - fi - if [ ".$opt_m" != ".-" ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 - fi - chmod $opt_m $dsttmp || shtool_exit $? - fi - - # determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes - fi - fi - fi - - # finally, install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 - fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 - fi - rm -f $dst && mv $dsttmp $dst - fi - done - - shtool_exit 0 - ;; - -mkdir ) - ## - ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2006 Ralf S. Engelschall - ## - - errstatus=0 - for p in ${1+"$@"}; do - # if the directory already exists... - if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then - echo "$msgprefix:Error: directory already exists: $p" 1>&2 - errstatus=1 - break - else - continue - fi - fi - # if the directory has to be created... - if [ ".$opt_p" = .no ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $p" 1>&2 - fi - mkdir $p || errstatus=$? - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $p" 1>&2 - fi - chown $opt_o $p || errstatus=$? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $p" 1>&2 - fi - chgrp $opt_g $p || errstatus=$? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $p" 1>&2 - fi - chmod $opt_m $p || errstatus=$? - fi - else - # the smart situation - set fnord `echo ":$p" |\ - sed -e 's/^:\//%/' \ - -e 's/^://' \ - -e 's/\// /g' \ - -e 's/^%/\//'` - shift - pathcomp='' - for d in ${1+"$@"}; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp="./$pathcomp" ;; - esac - if [ ! -d "$pathcomp" ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $pathcomp" 1>&2 - fi - mkdir $pathcomp || errstatus=$? - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $pathcomp" 1>&2 - fi - chown $opt_o $pathcomp || errstatus=$? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $pathcomp" 1>&2 - fi - chgrp $opt_g $pathcomp || errstatus=$? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $pathcomp" 1>&2 - fi - chmod $opt_m $pathcomp || errstatus=$? - fi - fi - pathcomp="$pathcomp/" - done - fi - done - - shtool_exit $errstatus - ;; - -platform ) - ## - ## platform -- Platform Identification Utility - ## Copyright (c) 2003-2006 Ralf S. Engelschall - ## - - # option post-processing - if [ ".$opt_t" != . ]; then - case "$opt_t" in - binary ) - # binary package id (OpenPKG RPM) - opt_F="%-%" - opt_L=yes - opt_S="" - opt_C="+" - ;; - build ) - # build time checking (OpenPKG RPM) - opt_F="%-%" - opt_L=yes - opt_S="" - opt_C="+" - ;; - gnu ) - # GNU config.guess style -- - opt_F="%-unknown-%" - opt_L=yes - opt_S="" - opt_C="+" - ;; - web ) - # non-whitespace HTTP Server-header id - opt_F="%-%" - opt_S="/" - opt_C="+" - ;; - summary) - # human readable verbose summary information - opt_F="Class: %[sc] (%[ac])\\nProduct: %[sp] (%[ap])\\nTechnology: %[st] (%[at])" - opt_S=" " - opt_C="/" - ;; - all-in-one ) - # full-table all-in-one information - opt_F="" - opt_F="${opt_F}concise architecture class: %\\n" - opt_F="${opt_F}regular architecture class: %{ac}\\n" - opt_F="${opt_F}verbose architecture class: %[ac]\\n" - opt_F="${opt_F}concise architecture product: %\\n" - opt_F="${opt_F}regular architecture product: %{ap}\\n" - opt_F="${opt_F}verbose architecture product: %[ap]\\n" - opt_F="${opt_F}concise architecture technology: %\\n" - opt_F="${opt_F}regular architecture technology: %{at}\\n" - opt_F="${opt_F}verbose architecture technology: %[at]\\n" - opt_F="${opt_F}concise system class: %\\n" - opt_F="${opt_F}regular system class: %{sc}\\n" - opt_F="${opt_F}verbose system class: %[sc]\\n" - opt_F="${opt_F}concise system product: %\\n" - opt_F="${opt_F}regular system product: %{sp}\\n" - opt_F="${opt_F}verbose system product: %[sp]\\n" - opt_F="${opt_F}concise system technology: %\\n" - opt_F="${opt_F}regular system technology: %{st}\\n" - opt_F="${opt_F}verbose system technology: %[st]" - ;; - * ) - echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2 - exit 1 - ;; - esac - fi - - # assemble initial platform information - UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\ - UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\ - UNAME_MACHINE='unknown' - UNAME_SYSTEM=`(uname -s) 2>/dev/null` ||\ - UNAME_SYSTEM='unknown' - UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\ - UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\ - UNAME_RELEASE='unknown' - - UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}" - - AC=""; AP=""; AT="" - SC=""; SP=""; ST="" - - # dispatch into platform specific sections - case "${UNAME}" in - - # FreeBSD - *:FreeBSD:* ) - # determine architecture - AC="${UNAME_MACHINE}" - case "${AC}" in - i386 ) AC="iX86" ;; - esac - AP="${AC}" - AT="${AP}" - if [ ".${AT}" = ".iX86" ]; then - case "`(/sbin/sysctl -n hw.model) 2>&1`" in - *"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;; - *"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;; - *"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;; - esac - fi - # determine system - r=`echo "${UNAME_RELEASE}" |\ - sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'` - ST="FreeBSD ${r}" - SP="${ST}" - case "${r}" in - 1.* ) SC="4.3BSD" ;; - * ) SC="4.4BSD" ;; - esac - ;; - - # NetBSD - *:NetBSD:* ) - # determine architecture - AT="${UNAME_MACHINE}" - AP="${AT}" - case "${AP}" in - i[3-6]86 ) AP="iX86" ;; - esac - AC="${AP}" - # determine system - r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` - ST="NetBSD ${r}" - SP="${ST}" - case "${r}" in - 0.* ) SC="4.3BSD" ;; - * ) SC="4.4BSD" ;; - esac - ;; - - # OpenBSD - *:OpenBSD:* ) - # determine architecture - AT="${UNAME_MACHINE}" - AP="${AT}" - case "${AP}" in - i[3-6]86 ) AP="iX86" ;; - esac - AC="${AP}" - # determine system - r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` - ST="OpenBSD ${r}" - SP="${ST}" - SC="4.4BSD" - ;; - - # GNU/Linux - *:Linux:* ) - # determine architecture - AT="${UNAME_MACHINE}" - case "${AT}" in - ia64 ) AT="IA64" ;; - x86_64 ) AT='AMD64' ;; - parisc ) AT="HPPA32" ;; - parisc64 ) AT="HPPA64" ;; - esac - AP="${AT}" - case "${AP}" in - i[3-6]86 ) AP='iX86' ;; - esac - AC="${AP}" - # determine system - v_kern=`echo "${UNAME_RELEASE}" |\ - sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` - v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\ - env -i sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null` - ST="GNU/${v_libc}/<${v_kern}>" - if [ -f /etc/lsb-release ]; then - eval `( . /etc/lsb-release - echo "SC=\"LSB${LSB_VERSION}\"" - if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then - echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\"" - fi - ) 2>/dev/null` - fi - if [ ".$SP" = . ]; then - for tagfile in x \ - `cd /etc && \ - /bin/ls *[_-]release *[_-]version 2>/dev/null | env -i sort | \ - sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \ - echo redhat-release lsb-release` - do - [ ".${tagfile}" = .x ] && continue - [ ! -f "/etc/${tagfile}" ] && continue - n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'` - v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\ - sed -e 's/^/#/' \ - -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ - -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ - -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ - -e 's/^#.*$//'` - case "`util_lower ${n}`" in - redhat ) - if [ ".`grep 'Red Hat Enterprise Linux' /etc/${tagfile}`" != . ]; then - n="ed at nterprise inux" - else - n="ed at inux" - fi - ;; - debian ) n="Debian[ GNU/Linux]" ;; - ubuntu ) n="Ubuntu[ GNU/Linux]" ;; - fedora ) n=" Core[ GNU/Linux]" ;; - suse ) n="SuSE[ Linux]" ;; - mandrake*|mandriva ) n="Mandriva[ Linux]" ;; - gentoo ) n="Gentoo[ GNU/Linux]" ;; - slackware ) n="Slackware[ Linux]" ;; - turbolinux ) n="TurboLinux" ;; - unitedlinux ) n="UnitedLinux" ;; - * ) n="${n}[ GNU/Linux]" ;; - esac - case "$n" in - *"<"*">"* ) SP="$n <$v>" ;; - * ) SP="$n $v" ;; - esac - break - done - fi - [ ".$SP" = . ] && SP="${ST}" - [ ".$SC" = . ] && SC="LSB" - ;; - - # Sun Solaris - *:SunOS:* ) - # determine architecture - AT="${UNAME_MACHINE}" - case "${AT}" in - i86pc ) - AT="iX86" - case "`(/bin/isainfo -k) 2>&1`" in - amd64 ) AT="AMD64" ;; - esac - ;; - esac - AP="${AT}" - case "${AP}" in - sun4[cdm] ) AP="SPARC32" ;; - sun4[uv] ) AP="SPARC64" ;; - sun4* ) AP="SPARC" ;; - esac - AC="${AP}" - case "${AC}" in - SPARC* ) AC="SPARC" ;; - esac - # determine system - ST="[Sun ]SunOS ${UNAME_RELEASE}" - v=`echo "${UNAME_RELEASE}" |\ - sed -e 's;^4\.;1.;' \ - -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \ - -e 's;^5\.\([0-9][0-9]*\).*;\1;'` - SP="[Sun ]Solaris $v" - case "${UNAME_RELEASE}" in - 4.* ) SC="4.3BSD" ;; - 5.* ) SC="SVR4" ;; - esac - ;; - - # SCO UnixWare - *:UnixWare:* ) - # determine architecture - AT="${UNAME_MACHINE}" - case "${AT}" in - i[3-6]86 | ix86at ) AT="iX86" ;; - esac - AP="${AT}" - # determine system - v=`/sbin/uname -v` - ST="[SCO ]UnixWare ${v}" - SP="${ST}" - SC="SVR${UNAME_RELEASE}" - ;; - - # QNX - *:QNX:* ) - # determine architecture - AT="${UNAME_MACHINE}" - case "${AT}" in - x86pc ) AT="iX86" ;; - esac - AP="${AT}" - # determine system - v="${UNAME_RELEASE}" - ST="QNX[ Neutrino RTOS] ${v}" - v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'` - SP="QNX[ Neutrino RTOS] ${v}" - SC="QNX" - ;; - - # SGI IRIX - *:IRIX*:* ) - # determine architecture - AT="${UNAME_MACHINE}" - AP="${AT}" - case "${AP}:${UNAME_SYSTEM}" in - IP*:IRIX64 ) AP="MIPS64" ;; - IP*:* ) AP="MIPS" ;; - esac - AC="${AP}" - # determine system - v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'` - ST="[SGI ]IRIX ${v}" - v="${UNAME_RELEASE}" - SP="[SGI ]IRIX ${v}" - SC="4.2BSD/SVR3" - ;; - - # HP HP-UX - *:HP-UX:* ) - # determine architecture - AT="${UNAME_MACHINE}" - case "${AT}" in - ia64 ) AT="IA64" ;; - 9000/[34]?? ) AT=M68K ;; - 9000/[678][0-9][0-9]) - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523 ) AT="HPPA1.0" ;; - 528 ) AT="HPPA1.1" ;; - 532 ) AT="HPPA2.0" - case "${sc_kernel_bits}" in - 32 ) AT="${AT}n" ;; - 64 ) AT="${AT}w" ;; - esac - ;; - esac - ;; - esac - AP="${AT}" - case "${AP}" in - HPPA* ) AP="HPPA" ;; - esac - AC="${AP}" - # determine system - v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'` - ST="[HP ]-" - SP="${ST}" - case "${v}" in - 10.* ) SC="SVR4.2" ;; - [7-9]* ) SC="SVR4" ;; - esac - ;; - - # HP Tru64 (OSF1) - *:OSF1:* ) - # determine architecture - AP="${UNAME_MACHINE}" - case "${AP}" in - alpha ) AP="Alpha" ;; - esac - alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\ - sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'` - AT="${AP}${alpha_type}" - AC="${AP}" - # determine system - v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'` - ST="[HP ]Tru64 ${v}" - SP="${ST}" - SC="OSF1" - ;; - - # IBM AIX - *:AIX:* ) - cpu_arch=rs6000 - if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then - cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then - cpu_arch=powerpc - fi - elif [ -d /QOpenSys ]; then - # IBM i5/OS (aka OS/400) with PASE (Portable Application Solutions Environment) - cpu_arch=powerpc - fi - if [ -x /usr/bin/oslevel ]; then - os_level=`/usr/bin/oslevel` - else - os_level="`uname -v`.`uname -r`" - fi - os_level=`echo "${os_level}" |\ - sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \ - -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'` - AT="${cpu_arch}" - AP="${AT}" - AC="${AP}" - ST="[IBM ]${os_level}" - SP="${ST}" - case "${os_level}" in - [12]* ) SC="SVR2" ;; - * ) SC="SVR4" ;; - esac - ;; - - # Apple MacOS X Darwin - *:Darwin:* ) - AT=`uname -p` - case "${AT}" in - powerpc ) AT="PPC" ;; - esac - AP="${AT}" - AC="${AP}" - case "${AC}" in - i?86 ) AC="iX86" ;; - esac - ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}" - SP="${ST}" - SC="4.4BSD/Mach3" - ;; - - # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO - # *:XXX:* ) - # ... - # ;; - - # ...A STILL UNKNOWN PLATFORM... - * ) - AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"` - AP="${AT}" - AC="${AP}" - v=`echo "${UNAME_RELEASE}" |\ - sed -e 's/^/#/' \ - -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ - -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ - -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ - -e 's/^#.*$/?/'` - ST="${UNAME_SYSTEM} ${v}" - SP="${ST}" - SC="${SP}" - ;; - - esac - - # provide fallback values - [ ".$AT" = . ] && AT="${AP:-${AC}}" - [ ".$AP" = . ] && AP="${AT:-${AC}}" - [ ".$AC" = . ] && AC="${AP:-${AT}}" - [ ".$ST" = . ] && ST="${SP:-${SC}}" - [ ".$SP" = . ] && SP="${ST:-${SC}}" - [ ".$SC" = . ] && SC="${SP:-${ST}}" - - # support explicit enforced verbose/concise output - if [ ".$opt_v" = .yes ]; then - opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'` - elif [ ".$opt_c" = .yes ]; then - opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'` - fi - - # provide verbose and concise variants - AC_V=""; AC_N=""; AC_C="" - AP_V=""; AP_N=""; AP_C="" - AT_V=""; AT_N=""; AT_C="" - SC_V=""; SC_N=""; SC_C="" - SP_V=""; SP_N=""; SP_C="" - ST_V=""; ST_N=""; ST_C="" - for var_lc in at ap ac st sp sc; do - case "$opt_F" in - *"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* ) - var_uc=`util_upper "$var_lc"` - eval "val=\"\$${var_uc}\"" - val_V=""; val_N=""; val_C="" - case "$opt_F" in - *"%[${var_lc}]"* ) - val_V=`echo ":$val" | \ - sed -e 's/^://' \ - -e 's;\[\([^]]*\)\];\1;g' \ - -e 's;<\([^>]*\)>;\1;g' \ - -e "s; ;§§;g" \ - -e "s;/;%%;g" \ - -e "s;§§;${opt_S};g" \ - -e "s;%%;${opt_C};g"` - eval "${var_uc}_V=\"\${val_V}\"" - ;; - esac - case "$opt_F" in - *"%{${var_lc}}"* | *"%${var_lc}"* ) - val_N=`echo ":$val" | \ - sed -e 's/^://' \ - -e 's;\[\([^]]*\)\];;g' \ - -e 's;<\([^>]*\)>;\1;g' \ - -e "s; ;§§;g" \ - -e "s;/;%%;g" \ - -e "s;§§;${opt_S};g" \ - -e "s;%%;${opt_C};g"` - eval "${var_uc}_N=\"\${val_N}\"" - ;; - esac - case "$opt_F" in - *"%<${var_lc}>"* ) - val_C=`echo ":$val" | \ - sed -e 's/^://' \ - -e 's;\[\([^]]*\)\];;g' \ - -e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \ - -e "s; ;§§;g" \ - -e "s;/;%%;g" \ - -e "s;§§;${opt_S};g" \ - -e "s;%%;${opt_C};g"` - eval "${var_uc}_C=\"\${val_C}\"" - ;; - esac - ;; - esac - done - - # create output string - output=`echo ":$opt_F" |\ - sed -e "s/^://" \ - -e "s;%\\[ac\\];${AC_V};g" \ - -e "s;%{ac};${AC_N};g" \ - -e "s;%ac;${AC_N};g" \ - -e "s;%;${AC_C};g" \ - -e "s;%\\[ap\\];${AP_V};g" \ - -e "s;%{ap};${AP_N};g" \ - -e "s;%ap;${AP_N};g" \ - -e "s;%;${AP_C};g" \ - -e "s;%\\[at\\];${AT_V};g" \ - -e "s;%{at};${AT_N};g" \ - -e "s;%at;${AT_N};g" \ - -e "s;%;${AT_C};g" \ - -e "s;%\\[sc\\];${SC_V};g" \ - -e "s;%{sc};${SC_N};g" \ - -e "s;%sc;${SC_N};g" \ - -e "s;%;${SC_C};g" \ - -e "s;%\\[sp\\];${SP_V};g" \ - -e "s;%{sp};${SP_N};g" \ - -e "s;%sp;${SP_N};g" \ - -e "s;%;${SP_C};g" \ - -e "s;%\\[st\\];${ST_V};g" \ - -e "s;%{st};${ST_N};g" \ - -e "s;%st;${ST_N};g" \ - -e "s;%;${ST_C};g" \ - -e 's/\\\\n/^/g' |\ - tr '^' '\012'` - - # support lower/upper-case mapping - if [ ".$opt_L" = .yes ]; then - output=`util_lower "$output"` - elif [ ".$opt_U" = .yes ]; then - output=`util_upper "$output"` - fi - - # display output string - if [ ".$opt_n" = .yes ]; then - echo . | awk '{ printf("%s", output); }' output="$output" - else - echo "$output" - fi - - shtool_exit 0 - ;; - -path ) - ## - ## path -- Deal with program paths - ## Copyright (c) 1998-2006 Ralf S. Engelschall - ## - - namelist="$*" - - # check whether the test command supports the -x option - if [ -x /bin/sh ] 2>/dev/null; then - minusx="-x" - else - minusx="-r" - fi - - # split path string - paths="`echo $opt_p |\ - sed -e 's/^:/.:/' \ - -e 's/::/:.:/g' \ - -e 's/:$/:./' \ - -e 's/:/ /g'`" - - # SPECIAL REQUEST - # translate forward to reverse path - if [ ".$opt_r" = .yes ]; then - if [ "x$namelist" = "x." ]; then - rp='.' - else - rp='' - for pe in `IFS="$IFS/"; echo $namelist`; do - rp="../$rp" - done - fi - echo $rp | sed -e 's:/$::' - shtool_exit 0 - fi - - # SPECIAL REQUEST - # strip out directory or base name - if [ ".$opt_d" = .yes ]; then - echo "$namelist" |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' - shtool_exit 0 - fi - if [ ".$opt_b" = .yes ]; then - echo "$namelist" |\ - sed -e 's;.*/\([^/]*\)$;\1;' - shtool_exit 0 - fi - - # MAGIC SITUATION - # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then - rm -f $tmpfile >/dev/null 2>&1 - touch $tmpfile - found=0 - pc=99 - for dir in $paths; do - dir=`echo $dir | sed -e 's;/*$;;'` - nc=99 - for name in perl perl5 miniperl; do - if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then - perl="$dir/$name" - pv=`$perl -e 'printf("%.3f", $]);'` - echo "$pv:$pc:$nc:$perl" >>$tmpfile - found=1 - fi - nc=`expr $nc - 1` - done - pc=`expr $pc - 1` - done - if [ $found = 1 ]; then - perl="`cat $tmpfile | sort -r -u | sed -e 'q' | cut -d: -f4`" - rm -f $tmpfile >/dev/null 2>&1 - echo "$perl" - shtool_exit 0 - fi - rm -f $tmpfile >/dev/null 2>&1 - shtool_exit 1 - fi - - # MAGIC SITUATION - # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then - echo >$tmpfile.c "#include " - echo >>$tmpfile.c "Syntax Error" - # 1. try the standard cc -E approach - cpp="${CC-cc} -E" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 2. try the cc -E approach and GCC's -traditional-ccp option - cpp="${CC-cc} -E -traditional-cpp" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 3. try a standalone cpp command in path and lib dirs - for path in $paths /lib /usr/lib /usr/local/lib; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then - cpp="$path/cpp" - break - fi - done - if [ ".$cpp" != . ]; then - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # ok, we gave up... - cpp='' - fi - fi - fi - fi - rm -f $tmpfile >/dev/null 2>&1 - rm -f $tmpfile.c $tmpfile.out >/dev/null 2>&1 - if [ ".$cpp" != . ]; then - echo "$cpp" - shtool_exit 0 - fi - shtool_exit 1 - fi - - # STANDARD SITUATION - # iterate over names - for name in $namelist; do - # iterate over paths - for path in $paths; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then - if [ ".$opt_s" != .yes ]; then - echo "$path/$name" - fi - shtool_exit 0 - fi - done - done - - shtool_exit 1 - ;; - -esac - -shtool_exit 0 - diff --git a/ext/bcmath/CREDITS b/ext/bcmath/CREDITS deleted file mode 100644 index 7b4083ea13812..0000000000000 --- a/ext/bcmath/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -BC Math -Andi Gutmans diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c deleted file mode 100644 index 9426285c27730..0000000000000 --- a/ext/bcmath/bcmath.c +++ /dev/null @@ -1,645 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_BCMATH - -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_bcmath.h" -#include "libbcmath/src/bcmath.h" - -ZEND_DECLARE_MODULE_GLOBALS(bcmath) -static PHP_GINIT_FUNCTION(bcmath); -static PHP_GSHUTDOWN_FUNCTION(bcmath); - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bcadd, 0, 0, 2) - ZEND_ARG_INFO(0, left_operand) - ZEND_ARG_INFO(0, right_operand) - ZEND_ARG_INFO(0, scale) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bcsub, 0, 0, 2) - ZEND_ARG_INFO(0, left_operand) - ZEND_ARG_INFO(0, right_operand) - ZEND_ARG_INFO(0, scale) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bcmul, 0, 0, 2) - ZEND_ARG_INFO(0, left_operand) - ZEND_ARG_INFO(0, right_operand) - ZEND_ARG_INFO(0, scale) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bcdiv, 0, 0, 2) - ZEND_ARG_INFO(0, left_operand) - ZEND_ARG_INFO(0, right_operand) - ZEND_ARG_INFO(0, scale) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_bcmod, 0) - ZEND_ARG_INFO(0, left_operand) - ZEND_ARG_INFO(0, right_operand) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bcpowmod, 0, 0, 3) - ZEND_ARG_INFO(0, x) - ZEND_ARG_INFO(0, y) - ZEND_ARG_INFO(0, mod) - ZEND_ARG_INFO(0, scale) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bcpow, 0, 0, 2) - ZEND_ARG_INFO(0, x) - ZEND_ARG_INFO(0, y) - ZEND_ARG_INFO(0, scale) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bcsqrt, 0, 0, 1) - ZEND_ARG_INFO(0, operand) - ZEND_ARG_INFO(0, scale) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bccomp, 0, 0, 2) - ZEND_ARG_INFO(0, left_operand) - ZEND_ARG_INFO(0, right_operand) - ZEND_ARG_INFO(0, scale) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_bcscale, 0) - ZEND_ARG_INFO(0, scale) -ZEND_END_ARG_INFO() - -/* }}} */ - -zend_function_entry bcmath_functions[] = { - PHP_FE(bcadd, arginfo_bcadd) - PHP_FE(bcsub, arginfo_bcsub) - PHP_FE(bcmul, arginfo_bcmul) - PHP_FE(bcdiv, arginfo_bcdiv) - PHP_FE(bcmod, arginfo_bcmod) - PHP_FE(bcpow, arginfo_bcpow) - PHP_FE(bcsqrt, arginfo_bcsqrt) - PHP_FE(bcscale, arginfo_bcscale) - PHP_FE(bccomp, arginfo_bccomp) - PHP_FE(bcpowmod, arginfo_bcpowmod) - {NULL, NULL, NULL} -}; - -zend_module_entry bcmath_module_entry = { - STANDARD_MODULE_HEADER, - "bcmath", - bcmath_functions, - PHP_MINIT(bcmath), - PHP_MSHUTDOWN(bcmath), - NULL, - NULL, - PHP_MINFO(bcmath), - NO_VERSION_YET, - PHP_MODULE_GLOBALS(bcmath), - PHP_GINIT(bcmath), - PHP_GSHUTDOWN(bcmath), - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; - -#ifdef COMPILE_DL_BCMATH -ZEND_GET_MODULE(bcmath) -#endif - -/* {{{ PHP_INI */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("bcmath.scale", "0", PHP_INI_ALL, OnUpdateLongGEZero, bc_precision, zend_bcmath_globals, bcmath_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ PHP_GINIT_FUNCTION - */ -static PHP_GINIT_FUNCTION(bcmath) -{ - bcmath_globals->bc_precision = 0; - bc_init_numbers(TSRMLS_C); -} -/* }}} */ - -/* {{{ PHP_GSHUTDOWN_FUNCTION - */ -static PHP_GSHUTDOWN_FUNCTION(bcmath) -{ - _bc_free_num_ex(&bcmath_globals->_zero_, 1); - _bc_free_num_ex(&bcmath_globals->_one_, 1); - _bc_free_num_ex(&bcmath_globals->_two_, 1); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(bcmath) -{ - REGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(bcmath) -{ - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(bcmath) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "BCMath support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ php_str2num - Convert to bc_num detecting scale */ -static void php_str2num(bc_num *num, char *str TSRMLS_DC) -{ - char *p; - - if (!(p = strchr(str, '.'))) { - bc_str2num(num, str, 0 TSRMLS_CC); - return; - } - - bc_str2num(num, str, strlen(p+1) TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale]) - Returns the sum of two arbitrary precision numbers */ -PHP_FUNCTION(bcadd) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) ((int)Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - bc_add (first, second, &result, scale); - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcsub(string left_operand, string right_operand [, int scale]) - Returns the difference between two arbitrary precision numbers */ -PHP_FUNCTION(bcsub) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) ((int)Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - bc_sub (first, second, &result, scale); - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcmul(string left_operand, string right_operand [, int scale]) - Returns the multiplication of two arbitrary precision numbers */ -PHP_FUNCTION(bcmul) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) ((int)Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - bc_multiply (first, second, &result, scale TSRMLS_CC); - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcdiv(string left_operand, string right_operand [, int scale]) - Returns the quotient of two arbitrary precision numbers (division) */ -PHP_FUNCTION(bcdiv) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) ((int)Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - switch (bc_divide(first, second, &result, scale TSRMLS_CC)) { - case 0: /* OK */ - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case -1: /* division by zero */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero"); - break; - } - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcmod(string left_operand, string right_operand) - Returns the modulus of the two arbitrary precision operands */ -PHP_FUNCTION(bcmod) -{ - zval **left, **right; - bc_num first, second, result; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - bc_str2num(&first, Z_STRVAL_PP(left), 0 TSRMLS_CC); - bc_str2num(&second, Z_STRVAL_PP(right), 0 TSRMLS_CC); - switch (bc_modulo(first, second, &result, 0 TSRMLS_CC)) { - case 0: - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case -1: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero"); - break; - } - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcpowmod(string x, string y, string mod [, int scale]) - Returns the value of an arbitrary precision number raised to the power of another reduced by a modulous */ -PHP_FUNCTION(bcpowmod) -{ - char *left, *right, *modulous; - int left_len, right_len, modulous_len; - bc_num first, second, mod, result; - long scale = BCG(bc_precision); - int scale_int; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) { - return; - } - - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&mod TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, left TSRMLS_CC); - php_str2num(&second, right TSRMLS_CC); - php_str2num(&mod, modulous TSRMLS_CC); - - scale_int = (int) ((int)scale < 0) ? 0 : scale; - - if (bc_raisemod(first, second, mod, &result, scale_int TSRMLS_CC) != -1) { - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - } else { - RETVAL_FALSE; - } - - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&mod); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcpow(string x, string y [, int scale]) - Returns the value of an arbitrary precision number raised to the power of another */ -PHP_FUNCTION(bcpow) -{ - zval **left, **right, **scale_param; - bc_num first, second, result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) ((int)Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - bc_init_num(&result TSRMLS_CC); - php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC); - php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC); - bc_raise (first, second, &result, scale TSRMLS_CC); - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcsqrt(string operand [, int scale]) - Returns the square root of an arbitray precision number */ -PHP_FUNCTION(bcsqrt) -{ - zval **left, **scale_param; - bc_num result; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &left) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 2: - if (zend_get_parameters_ex(2, &left, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) ((int)Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - bc_init_num(&result TSRMLS_CC); - php_str2num(&result, Z_STRVAL_PP(left) TSRMLS_CC); - if (bc_sqrt (&result, scale TSRMLS_CC) != 0) { - if (result->n_scale > scale) { - result->n_scale = scale; - } - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Square root of negative number"); - } - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto int bccomp(string left_operand, string right_operand [, int scale]) - Compares two arbitrary precision numbers */ -PHP_FUNCTION(bccomp) -{ - zval **left, **right, **scale_param; - bc_num first, second; - int scale = BCG(bc_precision); - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) ((int)Z_LVAL_PP(scale_param) < 0) ? 0 : Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first TSRMLS_CC); - bc_init_num(&second TSRMLS_CC); - - bc_str2num(&first, Z_STRVAL_PP(left), scale TSRMLS_CC); - bc_str2num(&second, Z_STRVAL_PP(right), scale TSRMLS_CC); - Z_LVAL_P(return_value) = bc_compare(first, second); - Z_TYPE_P(return_value) = IS_LONG; - - bc_free_num(&first); - bc_free_num(&second); - return; -} -/* }}} */ - -/* {{{ proto bool bcscale(int scale) - Sets default scale parameter for all bc math functions */ -PHP_FUNCTION(bcscale) -{ - zval **new_scale; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &new_scale) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(new_scale); - BCG(bc_precision) = (Z_LVAL_PP(new_scale) < 0) ? 0 : Z_LVAL_PP(new_scale); - - RETURN_TRUE; -} -/* }}} */ - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4 deleted file mode 100644 index 3a4ad8c3b3dc0..0000000000000 --- a/ext/bcmath/config.m4 +++ /dev/null @@ -1,17 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions, -[ --enable-bcmath Enable bc style precision math functions]) - -if test "$PHP_BCMATH" != "no"; then - PHP_NEW_EXTENSION(bcmath, bcmath.c \ -libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \ -libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ -libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ -libbcmath/src/rmzero.c libbcmath/src/str2num.c, - $ext_shared,,-I@ext_srcdir@/libbcmath/src) - PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src) - AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath]) -fi diff --git a/ext/bcmath/config.w32 b/ext/bcmath/config.w32 deleted file mode 100644 index 3579eadfae798..0000000000000 --- a/ext/bcmath/config.w32 +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("bcmath", "bc style precision math functions", "yes"); - -if (PHP_BCMATH == "yes") { - EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src"); - ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \ - outofmem.c raisemod.c rt.c sub.c compare.c divmod.c int2num.c \ - num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \ - nearzero.c num2str.c raise.c rmzero.c str2num.c", "bcmath"); - - AC_DEFINE('HAVE_BCMATH', 1, 'Have BCMATH library'); -} diff --git a/ext/bcmath/libbcmath/AUTHORS b/ext/bcmath/libbcmath/AUTHORS deleted file mode 100644 index 982db9dc405e3..0000000000000 --- a/ext/bcmath/libbcmath/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -Phil Nelson wrote bcmath library. - - diff --git a/ext/bcmath/libbcmath/COPYING.LIB b/ext/bcmath/libbcmath/COPYING.LIB deleted file mode 100644 index c4792dd27a32d..0000000000000 --- a/ext/bcmath/libbcmath/COPYING.LIB +++ /dev/null @@ -1,515 +0,0 @@ - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. -^L - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. -^L - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control -compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. -^L - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. -^L - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. -^L - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. -^L - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply, and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License -may add an explicit geographical distribution limitation excluding those -countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. -^L - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS -^L - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms -of the ordinary General Public License). - - To apply these terms, attach the following notices to the library. -It is safest to attach them to the start of each source file to most -effectively convey the exclusion of warranty; and each file should -have at least the "copyright" line and a pointer to where the full -notice is found. - - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper -mail. - -You should also get your employer (if you work as a programmer) or -your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James -Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/ext/bcmath/libbcmath/ChangeLog b/ext/bcmath/libbcmath/ChangeLog deleted file mode 100644 index b8d459a2bbfe0..0000000000000 --- a/ext/bcmath/libbcmath/ChangeLog +++ /dev/null @@ -1,10 +0,0 @@ -Wed Jun 7 09:39:02 2000 Phil Nelson - - * configure.in and many others: version number now at 0.2. - Many other changes/additions for getting a distribution - to work. - -2000-05-21 Phil Nelson - - * Initial setup of bcmath library., calling it version 0.1. - diff --git a/ext/bcmath/libbcmath/FAQ b/ext/bcmath/libbcmath/FAQ deleted file mode 100644 index 6499b1cffb53e..0000000000000 --- a/ext/bcmath/libbcmath/FAQ +++ /dev/null @@ -1,21 +0,0 @@ -BCMATH FAQ: - -1) Why BCMATH? - -The math routines of GNU bc become more generally useful in a -library form. By separating the BCMATH library from GNU bc, -GNU bc can be under the GPL and BCMATH can be under the LGPL. - -2) Why BCMATH when GMP exists? - -GMP has "integers" (no digits after a decimal), "rational numbers" -(stored as 2 integers) and "floats". None of these will correctly -represent a POSIX BC number. Floats are the closest, but will not -behave correctly for many computations. For example, BC numbers have -a "scale" that represent the number of digits to represent after the -decimal point. The multiplying two of these numbers requires one to -calculate an exact number of digits after the decimal point regardless -of the number of digits in the integer part. GMP floats have a -"fixed, but arbitrary" mantissa and so multiplying two floats will end -up dropping digits BC must calculate. - diff --git a/ext/bcmath/libbcmath/INSTALL b/ext/bcmath/libbcmath/INSTALL deleted file mode 100644 index 8893a0782735e..0000000000000 --- a/ext/bcmath/libbcmath/INSTALL +++ /dev/null @@ -1,9 +0,0 @@ -Currently, only libbcmath.a is built. To build and install it, do - - configure - make - make install - -Typical configure parameters are available. (e.g. PREFIX) - -Bugs and comments to philnelson@acm.org. diff --git a/ext/bcmath/libbcmath/Makefile.am b/ext/bcmath/libbcmath/Makefile.am deleted file mode 100644 index e5be8201b3110..0000000000000 --- a/ext/bcmath/libbcmath/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS= src doc - -MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \ - stamp-h.in *~ - -dist-hook: - cp $(srcdir)/doc/bcmath.1 $(distdir)/doc - cp $(srcdir)/src/private.h $(distdir)/src - cp $(srcdir)/FAQ $(distdir) - diff --git a/ext/bcmath/libbcmath/NEWS b/ext/bcmath/libbcmath/NEWS deleted file mode 100644 index 431d7b315d17f..0000000000000 --- a/ext/bcmath/libbcmath/NEWS +++ /dev/null @@ -1,3 +0,0 @@ -NEWS for bcmath library: - - May 2000: The library is created. diff --git a/ext/bcmath/libbcmath/README b/ext/bcmath/libbcmath/README deleted file mode 100644 index cae5e5dc431d7..0000000000000 --- a/ext/bcmath/libbcmath/README +++ /dev/null @@ -1,9 +0,0 @@ -This is bcmath, a library of arbitrary precision math routines. -These routines, in a different form, are the routines that to -the arbitrary precision calculations for GNU bc and GNU dc. - -This library is provided to make these routines useful in a -larger context with less restrictions on the use of them. - -These routines do not duplicate functionality of the GNU gmp -library. gmp is similar, but the actual computation is different. diff --git a/ext/bcmath/libbcmath/acconfig.h b/ext/bcmath/libbcmath/acconfig.h deleted file mode 100644 index 4d301dcacf2a0..0000000000000 --- a/ext/bcmath/libbcmath/acconfig.h +++ /dev/null @@ -1,9 +0,0 @@ -/* PACKAGE name */ -#undef PACKAGE - -/* Package VERSION number */ -#undef VERSION - -/* Define to `size_t' if and don't define. */ -#undef ptrdiff_t - diff --git a/ext/bcmath/libbcmath/aclocal.m4 b/ext/bcmath/libbcmath/aclocal.m4 deleted file mode 100644 index e60c9eb55c786..0000000000000 --- a/ext/bcmath/libbcmath/aclocal.m4 +++ /dev/null @@ -1,127 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4 - -dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "[$]2" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - diff --git a/ext/bcmath/libbcmath/config.h.in b/ext/bcmath/libbcmath/config.h.in deleted file mode 100644 index 21cfb9255f9fb..0000000000000 --- a/ext/bcmath/libbcmath/config.h.in +++ /dev/null @@ -1,41 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to `size_t' if and don't define. */ -#undef ptrdiff_t - -/* Define if you have the header file. */ -#undef HAVE_LIB_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Name of package */ -#undef PACKAGE - -/* Version number of package */ -#undef VERSION - diff --git a/ext/bcmath/libbcmath/configure b/ext/bcmath/libbcmath/configure deleted file mode 100644 index 026fd039c78d5..0000000000000 --- a/ext/bcmath/libbcmath/configure +++ /dev/null @@ -1,1859 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=doc/bcmath.1 - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:556: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:609: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:666: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE="bcmath" - -VERSION="0.2" - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:712: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:725: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:738: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:751: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:764: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - - - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:784: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:814: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:865: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:897: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 908 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:939: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:944: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:972: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1016: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1071: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1099: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1127: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -for ac_hdr in stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1210: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1247: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if { (eval echo configure:1301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1322: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:1402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1426: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_size_t=yes -else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF - -fi - -echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 -echo "configure:1459: checking for ptrdiff_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_ptrdiff_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])ptrdiff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_ptrdiff_t=yes -else - rm -rf conftest* - ac_cv_type_ptrdiff_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_ptrdiff_t" 1>&6 -if test $ac_cv_type_ptrdiff_t = no; then - cat >> confdefs.h <<\EOF -#define ptrdiff_t size_t -EOF - -fi - - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile src/Makefile doc/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@RANLIB@%$RANLIB%g -s%@CPP@%$CPP%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - - diff --git a/ext/bcmath/libbcmath/configure.in b/ext/bcmath/libbcmath/configure.in deleted file mode 100644 index 3da89e949f252..0000000000000 --- a/ext/bcmath/libbcmath/configure.in +++ /dev/null @@ -1,18 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(doc/bcmath.1) -AM_INIT_AUTOMAKE("bcmath", "0.2") -AM_CONFIG_HEADER(config.h) - -AC_PROG_CC - -AC_PROG_INSTALL -AC_PROG_RANLIB -AC_PROG_MAKE_SET - -AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h) -AC_C_CONST -AC_TYPE_SIZE_T -AC_CHECK_TYPE(ptrdiff_t, size_t) - -AC_OUTPUT(Makefile src/Makefile doc/Makefile) - diff --git a/ext/bcmath/libbcmath/install-sh b/ext/bcmath/libbcmath/install-sh deleted file mode 100644 index ab74c882e9233..0000000000000 --- a/ext/bcmath/libbcmath/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/ext/bcmath/libbcmath/missing b/ext/bcmath/libbcmath/missing deleted file mode 100644 index e4b838ca924dc..0000000000000 --- a/ext/bcmath/libbcmath/missing +++ /dev/null @@ -1,134 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. -# Franc,ois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison touch file \`y.tab.c' - makeinfo touch the output file - yacc touch file \`y.tab.c'" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`acinclude.m4' or \`configure.in'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`configure.in'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`acconfig.h' or \`configure.in'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - touch config.h.in - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print \ - | sed 's/^\(.*\).am$/touch \1.in/' \ - | sh - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - your modified any \`.y' file. For being effective, your - modifications might require the \`Bison' package. Grab it from - any GNU archive site." - touch y.tab.c - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/ext/bcmath/libbcmath/mkinstalldirs b/ext/bcmath/libbcmath/mkinstalldirs deleted file mode 100644 index cc8783edce301..0000000000000 --- a/ext/bcmath/libbcmath/mkinstalldirs +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Last modified: 1994-03-25 -# Public domain - -errstatus=0 - -for file in ${1+"$@"} ; do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d in ${1+"$@"} ; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? - fi - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/ext/bcmath/libbcmath/src/Makefile.am b/ext/bcmath/libbcmath/src/Makefile.am deleted file mode 100644 index fab37d785e23b..0000000000000 --- a/ext/bcmath/libbcmath/src/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# Makefile for bcmath library - -lib_LIBRARIES = libbcmath.a - -include_HEADERS = bcmath.h - -libbcmath_a_SOURCES= add.c compare.c debug.c div.c divmod.c doaddsub.c \ - init.c int2num.c nearzero.c neg.c num2long.c num2str.c output.c \ - raise.c raisemod.c recmul.c rmzero.c sqrt.c str2num.c sub.c zero.c \ - outofmem.c rt.c - -INCLUDES = -I$(srcdir) -I.. - -CFLAGS = @CFLAGS@ -CPPFLAGS = $(INCLUDES) -Wall - -MAINTAINERCLEANFILES= Makefile.in $(libbcmath_a_SOURCES) private.h bcmath.h - -all: $(bin_LIBRARIES) - -clean: - rm -f $(OBJS) $(LIB) *~ diff --git a/ext/bcmath/libbcmath/src/add.c b/ext/bcmath/libbcmath/src/add.c deleted file mode 100644 index 3b09af22b257d..0000000000000 --- a/ext/bcmath/libbcmath/src/add.c +++ /dev/null @@ -1,88 +0,0 @@ -/* add.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Here is the full add routine that takes care of negative numbers. - N1 is added to N2 and the result placed into RESULT. SCALE_MIN - is the minimum scale for the result. */ - -void -bc_add (n1, n2, result, scale_min) - bc_num n1, n2, *result; - int scale_min; -{ - bc_num sum = NULL; - int cmp_res; - int res_scale; - - if (n1->n_sign == n2->n_sign) - { - sum = _bc_do_add (n1, n2, scale_min); - sum->n_sign = n1->n_sign; - } - else - { - /* subtraction must be done. */ - cmp_res = _bc_do_compare (n1, n2, FALSE, FALSE); /* Compare magnitudes. */ - switch (cmp_res) - { - case -1: - /* n1 is less than n2, subtract n1 from n2. */ - sum = _bc_do_sub (n2, n1, scale_min); - sum->n_sign = n2->n_sign; - break; - case 0: - /* They are equal! return zero with the correct scale! */ - res_scale = MAX (scale_min, MAX(n1->n_scale, n2->n_scale)); - sum = bc_new_num (1, res_scale); - memset (sum->n_value, 0, res_scale+1); - break; - case 1: - /* n2 is less than n1, subtract n2 from n1. */ - sum = _bc_do_sub (n1, n2, scale_min); - sum->n_sign = n1->n_sign; - } - } - - /* Clean up and return. */ - bc_free_num (result); - *result = sum; -} - diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h deleted file mode 100644 index ce68f0da4e8ca..0000000000000 --- a/ext/bcmath/libbcmath/src/bcmath.h +++ /dev/null @@ -1,162 +0,0 @@ -/* bcmath.h: bcmath library header. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#ifndef _BCMATH_H_ -#define _BCMATH_H_ - -typedef enum {PLUS, MINUS} sign; - -typedef struct bc_struct *bc_num; - -typedef struct bc_struct - { - sign n_sign; - int n_len; /* The number of digits before the decimal point. */ - int n_scale; /* The number of digits after the decimal point. */ - int n_refs; /* The number of pointers to this number. */ - bc_num n_next; /* Linked list for available list. */ - char *n_ptr; /* The pointer to the actual storage. - If NULL, n_value points to the inside of - another number (bc_multiply...) and should - not be "freed." */ - char *n_value; /* The number. Not zero char terminated. - May not point to the same place as n_ptr as - in the case of leading zeros generated. */ - } bc_struct; - -#ifdef HAVE_CONFIG_H -#include "../../config.h" -#endif - -#include "php.h" -#include "../../php_bcmath.h" - -/* The base used in storing the numbers in n_value above. - Currently this MUST be 10. */ - -#define BASE 10 - -/* Some useful macros and constants. */ - -#define CH_VAL(c) (c - '0') -#define BCD_CHAR(d) (d + '0') - -#ifdef MIN -#undef MIN -#undef MAX -#endif -#define MAX(a, b) ((a)>(b)?(a):(b)) -#define MIN(a, b) ((a)>(b)?(b):(a)) -#define ODD(a) ((a)&1) - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -#ifndef LONG_MAX -#define LONG_MAX 0x7ffffff -#endif - - -/* Function Prototypes */ - -/* Define the _PROTOTYPE macro if it is needed. */ - -#ifndef _PROTOTYPE -#ifdef __STDC__ -#define _PROTOTYPE(func, args) func args -#else -#define _PROTOTYPE(func, args) func() -#endif -#endif - -_PROTOTYPE(void bc_init_numbers, (TSRMLS_D)); - -_PROTOTYPE(bc_num _bc_new_num_ex, (int length, int scale, int persistent)); - -_PROTOTYPE(void _bc_free_num_ex, (bc_num *num, int persistent)); - -_PROTOTYPE(bc_num bc_copy_num, (bc_num num)); - -_PROTOTYPE(void bc_init_num, (bc_num *num TSRMLS_DC)); - -_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale TSRMLS_DC)); - -_PROTOTYPE(char *bc_num2str, (bc_num num)); - -_PROTOTYPE(void bc_int2num, (bc_num *num, int val)); - -_PROTOTYPE(long bc_num2long, (bc_num num)); - -_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2)); - -_PROTOTYPE(char bc_is_zero, (bc_num num TSRMLS_DC)); - -_PROTOTYPE(char bc_is_near_zero, (bc_num num, int scale)); - -_PROTOTYPE(char bc_is_neg, (bc_num num)); - -_PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result, int scale_min)); - -_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result, int scale_min)); - -_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result, - int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_divmod, (bc_num num1, bc_num num2, bc_num *quot, - bc_num *rem, int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_raisemod, (bc_num base, bc_num expo, bc_num mod, - bc_num *result, int scale TSRMLS_DC)); - -_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result, - int scale TSRMLS_DC)); - -_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale TSRMLS_DC)); - -_PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int), - int leading_zero TSRMLS_DC)); - -/* Prototypes needed for external utility routines. */ - -_PROTOTYPE(void bc_rt_warn, (char *mesg ,...)); -_PROTOTYPE(void bc_rt_error, (char *mesg ,...)); -_PROTOTYPE(void bc_out_of_memory, (void)); - -#define bc_new_num(length, scale) _bc_new_num_ex((length), (scale), 0) -#define bc_free_num(num) _bc_free_num_ex((num), 0) - -#endif diff --git a/ext/bcmath/libbcmath/src/compare.c b/ext/bcmath/libbcmath/src/compare.c deleted file mode 100644 index 2f094a6917b72..0000000000000 --- a/ext/bcmath/libbcmath/src/compare.c +++ /dev/null @@ -1,161 +0,0 @@ -/* compare.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Compare two bc numbers. Return value is 0 if equal, -1 if N1 is less - than N2 and +1 if N1 is greater than N2. If USE_SIGN is false, just - compare the magnitudes. */ - - int -_bc_do_compare (n1, n2, use_sign, ignore_last) - bc_num n1, n2; - int use_sign; - int ignore_last; -{ - char *n1ptr, *n2ptr; - int count; - - /* First, compare signs. */ - if (use_sign && n1->n_sign != n2->n_sign) - { - if (n1->n_sign == PLUS) - return (1); /* Positive N1 > Negative N2 */ - else - return (-1); /* Negative N1 < Positive N1 */ - } - - /* Now compare the magnitude. */ - if (n1->n_len != n2->n_len) - { - if (n1->n_len > n2->n_len) - { - /* Magnitude of n1 > n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (1); - else - return (-1); - } - else - { - /* Magnitude of n1 < n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (-1); - else - return (1); - } - } - - /* If we get here, they have the same number of integer digits. - check the integer part and the equal length part of the fraction. */ - count = n1->n_len + MIN (n1->n_scale, n2->n_scale); - n1ptr = n1->n_value; - n2ptr = n2->n_value; - - while ((count > 0) && (*n1ptr == *n2ptr)) - { - n1ptr++; - n2ptr++; - count--; - } - if (ignore_last && count == 1 && n1->n_scale == n2->n_scale) - return (0); - if (count != 0) - { - if (*n1ptr > *n2ptr) - { - /* Magnitude of n1 > n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (1); - else - return (-1); - } - else - { - /* Magnitude of n1 < n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (-1); - else - return (1); - } - } - - /* They are equal up to the last part of the equal part of the fraction. */ - if (n1->n_scale != n2->n_scale) - { - if (n1->n_scale > n2->n_scale) - { - for (count = n1->n_scale-n2->n_scale; count>0; count--) - if (*n1ptr++ != 0) - { - /* Magnitude of n1 > n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (1); - else - return (-1); - } - } - else - { - for (count = n2->n_scale-n1->n_scale; count>0; count--) - if (*n2ptr++ != 0) - { - /* Magnitude of n1 < n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (-1); - else - return (1); - } - } - } - - /* They must be equal! */ - return (0); -} - - -/* This is the "user callable" routine to compare numbers N1 and N2. */ - -int -bc_compare (n1, n2) - bc_num n1, n2; -{ - return _bc_do_compare (n1, n2, TRUE, FALSE); -} - diff --git a/ext/bcmath/libbcmath/src/config.h b/ext/bcmath/libbcmath/src/config.h deleted file mode 100644 index cc29a15f9594e..0000000000000 --- a/ext/bcmath/libbcmath/src/config.h +++ /dev/null @@ -1,10 +0,0 @@ -#if PHP_WIN32 -#include "../../../../main/config.w32.h" -#else -#include -#endif - -#include "php.h" -#include -#include "zend.h" -#include "zend_alloc.h" diff --git a/ext/bcmath/libbcmath/src/debug.c b/ext/bcmath/libbcmath/src/debug.c deleted file mode 100644 index 52e4e044d5da8..0000000000000 --- a/ext/bcmath/libbcmath/src/debug.c +++ /dev/null @@ -1,69 +0,0 @@ -/* debug.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* pn prints the number NUM in base 10. */ - -static void -out_char (int c) -{ - putchar(c); -} - - -void -pn (bc_num num TSRMLS_DC) -{ - bc_out_num (num, 10, out_char, 0 TSRMLS_CC); - out_char ('\n'); -} - - -/* pv prints a character array as if it was a string of bcd digits. */ -void -pv (name, num, len) - char *name; - unsigned char *num; - int len; -{ - int i; - printf ("%s=", name); - for (i=0; i -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Some utility routines for the divide: First a one digit multiply. - NUM (with SIZE digits) is multiplied by DIGIT and the result is - placed into RESULT. It is written so that NUM and RESULT can be - the same pointers. */ - -static void -_one_mult (num, size, digit, result) - unsigned char *num; - int size, digit; - unsigned char *result; -{ - int carry, value; - unsigned char *nptr, *rptr; - - if (digit == 0) - memset (result, 0, size); - else - { - if (digit == 1) - memcpy (result, num, size); - else - { - /* Initialize */ - nptr = (unsigned char *) (num+size-1); - rptr = (unsigned char *) (result+size-1); - carry = 0; - - while (size-- > 0) - { - value = *nptr-- * digit + carry; - *rptr-- = value % BASE; - carry = value / BASE; - } - - if (carry != 0) *rptr = carry; - } - } -} - - -/* The full division routine. This computes N1 / N2. It returns - 0 if the division is ok and the result is in QUOT. The number of - digits after the decimal point is SCALE. It returns -1 if division - by zero is tried. The algorithm is found in Knuth Vol 2. p237. */ - -int -bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC) -{ - bc_num qval; - unsigned char *num1, *num2; - unsigned char *ptr1, *ptr2, *n2ptr, *qptr; - int scale1, val; - unsigned int len1, len2, scale2, qdigits, extra, count; - unsigned int qdig, qguess, borrow, carry; - unsigned char *mval; - char zero; - unsigned int norm; - - /* Test for divide by zero. */ - if (bc_is_zero (n2 TSRMLS_CC)) return -1; - - /* Test for divide by 1. If it is we must truncate. */ - if (n2->n_scale == 0) - { - if (n2->n_len == 1 && *n2->n_value == 1) - { - qval = bc_new_num (n1->n_len, scale); - qval->n_sign = (n1->n_sign == n2->n_sign ? PLUS : MINUS); - memset (&qval->n_value[n1->n_len],0,scale); - memcpy (qval->n_value, n1->n_value, - n1->n_len + MIN(n1->n_scale,scale)); - bc_free_num (quot); - *quot = qval; - } - } - - /* Set up the divide. Move the decimal point on n1 by n2's scale. - Remember, zeros on the end of num2 are wasted effort for dividing. */ - scale2 = n2->n_scale; - n2ptr = (unsigned char *) n2->n_value+n2->n_len+scale2-1; - while ((scale2 > 0) && (*n2ptr-- == 0)) scale2--; - - len1 = n1->n_len + scale2; - scale1 = n1->n_scale - scale2; - if (scale1 < scale) - extra = scale - scale1; - else - extra = 0; - num1 = (unsigned char *) safe_emalloc (1, n1->n_len+n1->n_scale, extra+2); - if (num1 == NULL) bc_out_of_memory(); - memset (num1, 0, n1->n_len+n1->n_scale+extra+2); - memcpy (num1+1, n1->n_value, n1->n_len+n1->n_scale); - - len2 = n2->n_len + scale2; - num2 = (unsigned char *) safe_emalloc (1, len2, 1); - if (num2 == NULL) bc_out_of_memory(); - memcpy (num2, n2->n_value, len2); - *(num2+len2) = 0; - n2ptr = num2; - while (*n2ptr == 0) - { - n2ptr++; - len2--; - } - - /* Calculate the number of quotient digits. */ - if (len2 > len1+scale) - { - qdigits = scale+1; - zero = TRUE; - } - else - { - zero = FALSE; - if (len2>len1) - qdigits = scale+1; /* One for the zero integer part. */ - else - qdigits = len1-len2+scale+1; - } - - /* Allocate and zero the storage for the quotient. */ - qval = bc_new_num (qdigits-scale,scale); - memset (qval->n_value, 0, qdigits); - - /* Allocate storage for the temporary storage mval. */ - mval = (unsigned char *) safe_emalloc (1, len2, 1); - if (mval == NULL) bc_out_of_memory (); - - /* Now for the full divide algorithm. */ - if (!zero) - { - /* Normalize */ - norm = 10 / ((int)*n2ptr + 1); - if (norm != 1) - { - _one_mult (num1, len1+scale1+extra+1, norm, num1); - _one_mult (n2ptr, len2, norm, n2ptr); - } - - /* Initialize divide loop. */ - qdig = 0; - if (len2 > len1) - qptr = (unsigned char *) qval->n_value+len2-len1; - else - qptr = (unsigned char *) qval->n_value; - - /* Loop */ - while (qdig <= len1+scale-len2) - { - /* Calculate the quotient digit guess. */ - if (*n2ptr == num1[qdig]) - qguess = 9; - else - qguess = (num1[qdig]*10 + num1[qdig+1]) / *n2ptr; - - /* Test qguess. */ - if (n2ptr[1]*qguess > - (num1[qdig]*10 + num1[qdig+1] - *n2ptr*qguess)*10 - + num1[qdig+2]) - { - qguess--; - /* And again. */ - if (n2ptr[1]*qguess > - (num1[qdig]*10 + num1[qdig+1] - *n2ptr*qguess)*10 - + num1[qdig+2]) - qguess--; - } - - /* Multiply and subtract. */ - borrow = 0; - if (qguess != 0) - { - *mval = 0; - _one_mult (n2ptr, len2, qguess, mval+1); - ptr1 = (unsigned char *) num1+qdig+len2; - ptr2 = (unsigned char *) mval+len2; - for (count = 0; count < len2+1; count++) - { - val = (int) *ptr1 - (int) *ptr2-- - borrow; - if (val < 0) - { - val += 10; - borrow = 1; - } - else - borrow = 0; - *ptr1-- = val; - } - } - - /* Test for negative result. */ - if (borrow == 1) - { - qguess--; - ptr1 = (unsigned char *) num1+qdig+len2; - ptr2 = (unsigned char *) n2ptr+len2-1; - carry = 0; - for (count = 0; count < len2; count++) - { - val = (int) *ptr1 + (int) *ptr2-- + carry; - if (val > 9) - { - val -= 10; - carry = 1; - } - else - carry = 0; - *ptr1-- = val; - } - if (carry == 1) *ptr1 = (*ptr1 + 1) % 10; - } - - /* We now know the quotient digit. */ - *qptr++ = qguess; - qdig++; - } - } - - /* Clean up and return the number. */ - qval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS ); - if (bc_is_zero (qval TSRMLS_CC)) qval->n_sign = PLUS; - _bc_rm_leading_zeros (qval); - bc_free_num (quot); - *quot = qval; - - /* Clean up temporary storage. */ - efree (mval); - efree (num1); - efree (num2); - - return 0; /* Everything is OK. */ -} - diff --git a/ext/bcmath/libbcmath/src/divmod.c b/ext/bcmath/libbcmath/src/divmod.c deleted file mode 100644 index 2949bd10d4ae8..0000000000000 --- a/ext/bcmath/libbcmath/src/divmod.c +++ /dev/null @@ -1,87 +0,0 @@ -/* divmod.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Division *and* modulo for numbers. This computes both NUM1 / NUM2 and - NUM1 % NUM2 and puts the results in QUOT and REM, except that if QUOT - is NULL then that store will be omitted. - */ - -int -bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale TSRMLS_DC) -{ - bc_num quotient = NULL; - bc_num temp; - int rscale; - - /* Check for correct numbers. */ - if (bc_is_zero (num2 TSRMLS_CC)) return -1; - - /* Calculate final scale. */ - rscale = MAX (num1->n_scale, num2->n_scale+scale); - bc_init_num(&temp TSRMLS_CC); - - /* Calculate it. */ - bc_divide (num1, num2, &temp, scale TSRMLS_CC); - if (quot) - quotient = bc_copy_num (temp); - bc_multiply (temp, num2, &temp, rscale TSRMLS_CC); - bc_sub (num1, temp, rem, rscale); - bc_free_num (&temp); - - if (quot) - { - bc_free_num (quot); - *quot = quotient; - } - - return 0; /* Everything is OK. */ -} - - -/* Modulo for numbers. This computes NUM1 % NUM2 and puts the - result in RESULT. */ - -int -bc_modulo (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC) -{ - return bc_divmod (num1, num2, NULL, result, scale TSRMLS_CC); -} - diff --git a/ext/bcmath/libbcmath/src/doaddsub.c b/ext/bcmath/libbcmath/src/doaddsub.c deleted file mode 100644 index 5458fc5dfc4b5..0000000000000 --- a/ext/bcmath/libbcmath/src/doaddsub.c +++ /dev/null @@ -1,232 +0,0 @@ -/* doaddsub.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Perform addition: N1 is added to N2 and the value is - returned. The signs of N1 and N2 are ignored. - SCALE_MIN is to set the minimum scale of the result. */ - - bc_num -_bc_do_add (n1, n2, scale_min) - bc_num n1, n2; - int scale_min; -{ - bc_num sum; - int sum_scale, sum_digits; - char *n1ptr, *n2ptr, *sumptr; - int carry, n1bytes, n2bytes; - int count; - - /* Prepare sum. */ - sum_scale = MAX (n1->n_scale, n2->n_scale); - sum_digits = MAX (n1->n_len, n2->n_len) + 1; - sum = bc_new_num (sum_digits, MAX(sum_scale, scale_min)); - - /* Zero extra digits made by scale_min. */ - if (scale_min > sum_scale) - { - sumptr = (char *) (sum->n_value + sum_scale + sum_digits); - for (count = scale_min - sum_scale; count > 0; count--) - *sumptr++ = 0; - } - - /* Start with the fraction part. Initialize the pointers. */ - n1bytes = n1->n_scale; - n2bytes = n2->n_scale; - n1ptr = (char *) (n1->n_value + n1->n_len + n1bytes - 1); - n2ptr = (char *) (n2->n_value + n2->n_len + n2bytes - 1); - sumptr = (char *) (sum->n_value + sum_scale + sum_digits - 1); - - /* Add the fraction part. First copy the longer fraction.*/ - if (n1bytes != n2bytes) - { - if (n1bytes > n2bytes) - while (n1bytes>n2bytes) - { *sumptr-- = *n1ptr--; n1bytes--;} - else - while (n2bytes>n1bytes) - { *sumptr-- = *n2ptr--; n2bytes--;} - } - - /* Now add the remaining fraction part and equal size integer parts. */ - n1bytes += n1->n_len; - n2bytes += n2->n_len; - carry = 0; - while ((n1bytes > 0) && (n2bytes > 0)) - { - *sumptr = *n1ptr-- + *n2ptr-- + carry; - if (*sumptr > (BASE-1)) - { - carry = 1; - *sumptr -= BASE; - } - else - carry = 0; - sumptr--; - n1bytes--; - n2bytes--; - } - - /* Now add carry the longer integer part. */ - if (n1bytes == 0) - { n1bytes = n2bytes; n1ptr = n2ptr; } - while (n1bytes-- > 0) - { - *sumptr = *n1ptr-- + carry; - if (*sumptr > (BASE-1)) - { - carry = 1; - *sumptr -= BASE; - } - else - carry = 0; - sumptr--; - } - - /* Set final carry. */ - if (carry == 1) - *sumptr += 1; - - /* Adjust sum and return. */ - _bc_rm_leading_zeros (sum); - return sum; -} - - -/* Perform subtraction: N2 is subtracted from N1 and the value is - returned. The signs of N1 and N2 are ignored. Also, N1 is - assumed to be larger than N2. SCALE_MIN is the minimum scale - of the result. */ - - bc_num -_bc_do_sub (n1, n2, scale_min) - bc_num n1, n2; - int scale_min; -{ - bc_num diff; - int diff_scale, diff_len; - int min_scale, min_len; - char *n1ptr, *n2ptr, *diffptr; - int borrow, count, val; - - /* Allocate temporary storage. */ - diff_len = MAX (n1->n_len, n2->n_len); - diff_scale = MAX (n1->n_scale, n2->n_scale); - min_len = MIN (n1->n_len, n2->n_len); - min_scale = MIN (n1->n_scale, n2->n_scale); - diff = bc_new_num (diff_len, MAX(diff_scale, scale_min)); - - /* Zero extra digits made by scale_min. */ - if (scale_min > diff_scale) - { - diffptr = (char *) (diff->n_value + diff_len + diff_scale); - for (count = scale_min - diff_scale; count > 0; count--) - *diffptr++ = 0; - } - - /* Initialize the subtract. */ - n1ptr = (char *) (n1->n_value + n1->n_len + n1->n_scale -1); - n2ptr = (char *) (n2->n_value + n2->n_len + n2->n_scale -1); - diffptr = (char *) (diff->n_value + diff_len + diff_scale -1); - - /* Subtract the numbers. */ - borrow = 0; - - /* Take care of the longer scaled number. */ - if (n1->n_scale != min_scale) - { - /* n1 has the longer scale */ - for (count = n1->n_scale - min_scale; count > 0; count--) - *diffptr-- = *n1ptr--; - } - else - { - /* n2 has the longer scale */ - for (count = n2->n_scale - min_scale; count > 0; count--) - { - val = - *n2ptr-- - borrow; - if (val < 0) - { - val += BASE; - borrow = 1; - } - else - borrow = 0; - *diffptr-- = val; - } - } - - /* Now do the equal length scale and integer parts. */ - - for (count = 0; count < min_len + min_scale; count++) - { - val = *n1ptr-- - *n2ptr-- - borrow; - if (val < 0) - { - val += BASE; - borrow = 1; - } - else - borrow = 0; - *diffptr-- = val; - } - - /* If n1 has more digits then n2, we now do that subtract. */ - if (diff_len != min_len) - { - for (count = diff_len - min_len; count > 0; count--) - { - val = *n1ptr-- - borrow; - if (val < 0) - { - val += BASE; - borrow = 1; - } - else - borrow = 0; - *diffptr-- = val; - } - } - - /* Clean up and return. */ - _bc_rm_leading_zeros (diff); - return diff; -} - diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c deleted file mode 100644 index 986ad1df2416a..0000000000000 --- a/ext/bcmath/libbcmath/src/init.c +++ /dev/null @@ -1,131 +0,0 @@ -/* init.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -#if SANDER_0 - bc_num _bc_Free_list = NULL; -#endif - -/* new_num allocates a number and sets fields to known values. */ - -bc_num -_bc_new_num_ex (length, scale, persistent) - int length, scale, persistent; -{ - bc_num temp; - - /* PHP Change: malloc() -> pemalloc(), removed free_list code */ - temp = (bc_num) safe_pemalloc (1, sizeof(bc_struct)+length, scale, persistent); -#if 0 - if (_bc_Free_list != NULL) { - temp = _bc_Free_list; - _bc_Free_list = temp->n_next; - } else { - temp = (bc_num) pemalloc (sizeof(bc_struct), persistent); - if (temp == NULL) bc_out_of_memory (); - } -#endif - temp->n_sign = PLUS; - temp->n_len = length; - temp->n_scale = scale; - temp->n_refs = 1; - /* PHP Change: malloc() -> pemalloc() */ - temp->n_ptr = (char *) safe_pemalloc (1, length, scale, persistent); - if (temp->n_ptr == NULL) bc_out_of_memory(); - temp->n_value = temp->n_ptr; - memset (temp->n_ptr, 0, length+scale); - return temp; -} - - -/* "Frees" a bc_num NUM. Actually decreases reference count and only - frees the storage if reference count is zero. */ - -void -_bc_free_num_ex (num, persistent) - bc_num *num; - int persistent; -{ - if (*num == NULL) return; - (*num)->n_refs--; - if ((*num)->n_refs == 0) { - if ((*num)->n_ptr) - /* PHP Change: free() -> pefree(), removed free_list code */ - pefree ((*num)->n_ptr, persistent); - pefree(*num, persistent); -#if 0 - (*num)->n_next = _bc_Free_list; - _bc_Free_list = *num; -#endif - } - *num = NULL; -} - - -/* Intitialize the number package! */ - -void -bc_init_numbers (TSRMLS_D) -{ - BCG(_zero_) = _bc_new_num_ex (1,0,1); - BCG(_one_) = _bc_new_num_ex (1,0,1); - BCG(_one_)->n_value[0] = 1; - BCG(_two_) = _bc_new_num_ex (1,0,1); - BCG(_two_)->n_value[0] = 2; -} - - -/* Make a copy of a number! Just increments the reference count! */ - -bc_num -bc_copy_num (bc_num num) -{ - num->n_refs++; - return num; -} - - -/* Initialize a number NUM by making it a copy of zero. */ - -void -bc_init_num (bc_num *num TSRMLS_DC) -{ - *num = bc_copy_num (BCG(_zero_)); -} - diff --git a/ext/bcmath/libbcmath/src/int2num.c b/ext/bcmath/libbcmath/src/int2num.c deleted file mode 100644 index 34419c138f06f..0000000000000 --- a/ext/bcmath/libbcmath/src/int2num.c +++ /dev/null @@ -1,84 +0,0 @@ -/* int2num.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Convert an integer VAL to a bc number NUM. */ - -void -bc_int2num (num, val) - bc_num *num; - int val; -{ - char buffer[30]; - char *bptr, *vptr; - int ix = 1; - char neg = 0; - - /* Sign. */ - if (val < 0) - { - neg = 1; - val = -val; - } - - /* Get things going. */ - bptr = buffer; - *bptr++ = val % BASE; - val = val / BASE; - - /* Extract remaining digits. */ - while (val != 0) - { - *bptr++ = val % BASE; - val = val / BASE; - ix++; /* Count the digits. */ - } - - /* Make the number. */ - bc_free_num (num); - *num = bc_new_num (ix, 0); - if (neg) (*num)->n_sign = MINUS; - - /* Assign the digits. */ - vptr = (*num)->n_value; - while (ix-- > 0) - *vptr++ = *--bptr; -} - diff --git a/ext/bcmath/libbcmath/src/nearzero.c b/ext/bcmath/libbcmath/src/nearzero.c deleted file mode 100644 index ae16b65d8a605..0000000000000 --- a/ext/bcmath/libbcmath/src/nearzero.c +++ /dev/null @@ -1,69 +0,0 @@ -/* nearzero.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* In some places we need to check if the number NUM is almost zero. - Specifically, all but the last digit is 0 and the last digit is 1. - Last digit is defined by scale. */ - -char -bc_is_near_zero (num, scale) - bc_num num; - int scale; -{ - int count; - char *nptr; - - /* Error checking */ - if (scale > num->n_scale) - scale = num->n_scale; - - /* Initialize */ - count = num->n_len + scale; - nptr = num->n_value; - - /* The check */ - while ((count > 0) && (*nptr++ == 0)) count--; - - if (count != 0 && (count != 1 || *--nptr != 1)) - return FALSE; - else - return TRUE; -} - diff --git a/ext/bcmath/libbcmath/src/neg.c b/ext/bcmath/libbcmath/src/neg.c deleted file mode 100644 index c864d77f1d9aa..0000000000000 --- a/ext/bcmath/libbcmath/src/neg.c +++ /dev/null @@ -1,49 +0,0 @@ -/* neg.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* In some places we need to check if the number is negative. */ - -char -bc_is_neg (num) - bc_num num; -{ - return num->n_sign == MINUS; -} - diff --git a/ext/bcmath/libbcmath/src/num2long.c b/ext/bcmath/libbcmath/src/num2long.c deleted file mode 100644 index 0a6e0836ad43f..0000000000000 --- a/ext/bcmath/libbcmath/src/num2long.c +++ /dev/null @@ -1,70 +0,0 @@ -/* num2long.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Convert a number NUM to a long. The function returns only the integer - part of the number. For numbers that are too large to represent as - a long, this function returns a zero. This can be detected by checking - the NUM for zero after having a zero returned. */ - -long -bc_num2long (num) - bc_num num; -{ - long val; - char *nptr; - int index; - - /* Extract the int value, ignore the fraction. */ - val = 0; - nptr = num->n_value; - for (index=num->n_len; (index>0) && (val<=(LONG_MAX/BASE)); index--) - val = val*BASE + *nptr++; - - /* Check for overflow. If overflow, return zero. */ - if (index>0) val = 0; - if (val < 0) val = 0; - - /* Return the value. */ - if (num->n_sign == PLUS) - return (val); - else - return (-val); -} - diff --git a/ext/bcmath/libbcmath/src/num2str.c b/ext/bcmath/libbcmath/src/num2str.c deleted file mode 100644 index 14c57726fe6d8..0000000000000 --- a/ext/bcmath/libbcmath/src/num2str.c +++ /dev/null @@ -1,79 +0,0 @@ -/* num2str.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Convert a numbers to a string. Base 10 only.*/ - -char -*bc_num2str (num) - bc_num num; -{ - char *str, *sptr; - char *nptr; - int index, signch; - - /* Allocate the string memory. */ - signch = ( num->n_sign == PLUS ? 0 : 1 ); /* Number of sign chars. */ - if (num->n_scale > 0) - str = (char *) safe_emalloc (1, num->n_len + num->n_scale, 2 + signch); - else - str = (char *) safe_emalloc (1, num->n_len, 1 + signch); - if (str == NULL) bc_out_of_memory(); - - /* The negative sign if needed. */ - sptr = str; - if (signch) *sptr++ = '-'; - - /* Load the whole number. */ - nptr = num->n_value; - for (index=num->n_len; index>0; index--) - *sptr++ = BCD_CHAR(*nptr++); - - /* Now the fraction. */ - if (num->n_scale > 0) - { - *sptr++ = '.'; - for (index=0; indexn_scale; index++) - *sptr++ = BCD_CHAR(*nptr++); - } - - /* Terminate the string and return it! */ - *sptr = '\0'; - return (str); -} diff --git a/ext/bcmath/libbcmath/src/outofmem.c b/ext/bcmath/libbcmath/src/outofmem.c deleted file mode 100644 index 799a32d2ae6c5..0000000000000 --- a/ext/bcmath/libbcmath/src/outofmem.c +++ /dev/null @@ -1,46 +0,0 @@ -/* outofmem.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -void bc_out_of_memory (void) -{ - (void) fprintf (stderr, "bcmath: out of memory!\n"); - exit (1); -} diff --git a/ext/bcmath/libbcmath/src/output.c b/ext/bcmath/libbcmath/src/output.c deleted file mode 100644 index ad4e3754677b5..0000000000000 --- a/ext/bcmath/libbcmath/src/output.c +++ /dev/null @@ -1,208 +0,0 @@ -/* output.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* The following routines provide output for bcd numbers package - using the rules of POSIX bc for output. */ - -/* This structure is used for saving digits in the conversion process. */ -typedef struct stk_rec { - long digit; - struct stk_rec *next; -} stk_rec; - -/* The reference string for digits. */ -static char ref_str[] = "0123456789ABCDEF"; - - -/* A special output routine for "multi-character digits." Exactly - SIZE characters must be output for the value VAL. If SPACE is - non-zero, we must output one space before the number. OUT_CHAR - is the actual routine for writing the characters. */ - -void -bc_out_long (val, size, space, out_char) - long val; - int size, space; -#ifdef __STDC__ - void (*out_char)(int); -#else - void (*out_char)(); -#endif -{ - char digits[40]; - int len, ix; - - if (space) (*out_char) (' '); - snprintf(digits, sizeof(digits), "%ld", val); - len = strlen (digits); - while (size > len) - { - (*out_char) ('0'); - size--; - } - for (ix=0; ix < len; ix++) - (*out_char) (digits[ix]); -} - -/* Output of a bcd number. NUM is written in base O_BASE using OUT_CHAR - as the routine to do the actual output of the characters. */ - -void -#ifdef __STDC__ -bc_out_num (bc_num num, int o_base, void (*out_char)(int), int leading_zero TSRMLS_DC) -#else -bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_DC) -#endif -{ - char *nptr; - int index, fdigit, pre_space; - stk_rec *digits, *temp; - bc_num int_part, frac_part, base, cur_dig, t_num, max_o_digit; - - /* The negative sign if needed. */ - if (num->n_sign == MINUS) (*out_char) ('-'); - - /* Output the number. */ - if (bc_is_zero (num TSRMLS_CC)) - (*out_char) ('0'); - else - if (o_base == 10) - { - /* The number is in base 10, do it the fast way. */ - nptr = num->n_value; - if (num->n_len > 1 || *nptr != 0) - for (index=num->n_len; index>0; index--) - (*out_char) (BCD_CHAR(*nptr++)); - else - nptr++; - - if (leading_zero && bc_is_zero (num TSRMLS_CC)) - (*out_char) ('0'); - - /* Now the fraction. */ - if (num->n_scale > 0) - { - (*out_char) ('.'); - for (index=0; indexn_scale; index++) - (*out_char) (BCD_CHAR(*nptr++)); - } - } - else - { - /* special case ... */ - if (leading_zero && bc_is_zero (num TSRMLS_CC)) - (*out_char) ('0'); - - /* The number is some other base. */ - digits = NULL; - bc_init_num (&int_part TSRMLS_CC); - bc_divide (num, BCG(_one_), &int_part, 0 TSRMLS_CC); - bc_init_num (&frac_part TSRMLS_CC); - bc_init_num (&cur_dig TSRMLS_CC); - bc_init_num (&base TSRMLS_CC); - bc_sub (num, int_part, &frac_part, 0); - /* Make the INT_PART and FRAC_PART positive. */ - int_part->n_sign = PLUS; - frac_part->n_sign = PLUS; - bc_int2num (&base, o_base); - bc_init_num (&max_o_digit TSRMLS_CC); - bc_int2num (&max_o_digit, o_base-1); - - - /* Get the digits of the integer part and push them on a stack. */ - while (!bc_is_zero (int_part TSRMLS_CC)) - { - bc_modulo (int_part, base, &cur_dig, 0 TSRMLS_CC); - /* PHP Change: malloc() -> emalloc() */ - temp = (stk_rec *) emalloc (sizeof(stk_rec)); - if (temp == NULL) bc_out_of_memory(); - temp->digit = bc_num2long (cur_dig); - temp->next = digits; - digits = temp; - bc_divide (int_part, base, &int_part, 0 TSRMLS_CC); - } - - /* Print the digits on the stack. */ - if (digits != NULL) - { - /* Output the digits. */ - while (digits != NULL) - { - temp = digits; - digits = digits->next; - if (o_base <= 16) - (*out_char) (ref_str[ (int) temp->digit]); - else - bc_out_long (temp->digit, max_o_digit->n_len, 1, out_char); - efree (temp); - } - } - - /* Get and print the digits of the fraction part. */ - if (num->n_scale > 0) - { - (*out_char) ('.'); - pre_space = 0; - t_num = bc_copy_num (BCG(_one_)); - while (t_num->n_len <= num->n_scale) { - bc_multiply (frac_part, base, &frac_part, num->n_scale TSRMLS_CC); - fdigit = bc_num2long (frac_part); - bc_int2num (&int_part, fdigit); - bc_sub (frac_part, int_part, &frac_part, 0); - if (o_base <= 16) - (*out_char) (ref_str[fdigit]); - else { - bc_out_long (fdigit, max_o_digit->n_len, pre_space, out_char); - pre_space = 1; - } - bc_multiply (t_num, base, &t_num, 0 TSRMLS_CC); - } - bc_free_num (&t_num); - } - - /* Clean up. */ - bc_free_num (&int_part); - bc_free_num (&frac_part); - bc_free_num (&base); - bc_free_num (&cur_dig); - bc_free_num (&max_o_digit); - } -} diff --git a/ext/bcmath/libbcmath/src/private.h b/ext/bcmath/libbcmath/src/private.h deleted file mode 100644 index f8f1048ab7831..0000000000000 --- a/ext/bcmath/libbcmath/src/private.h +++ /dev/null @@ -1,43 +0,0 @@ -/* private.h: bcmath library header. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -/* "Private" routines to bcmath. */ - -/* variables */ -#if SANDER_0 -extern bc_num _bc_Free_list; -#endif - -/* routines */ -int _bc_do_compare (bc_num n1, bc_num n2, int use_sign, int ignore_last); -bc_num _bc_do_add (bc_num n1, bc_num n2, int scale_min); -bc_num _bc_do_sub (bc_num n1, bc_num n2, int scale_min); -void _bc_rm_leading_zeros (bc_num num); diff --git a/ext/bcmath/libbcmath/src/raise.c b/ext/bcmath/libbcmath/src/raise.c deleted file mode 100644 index f2f4f4a1d7770..0000000000000 --- a/ext/bcmath/libbcmath/src/raise.c +++ /dev/null @@ -1,124 +0,0 @@ -/* raise.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Raise NUM1 to the NUM2 power. The result is placed in RESULT. - Maximum exponent is LONG_MAX. If a NUM2 is not an integer, - only the integer part is used. */ - -void -bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC) -{ - bc_num temp, power; - long exponent; - int rscale; - int pwrscale; - int calcscale; - char neg; - - /* Check the exponent for scale digits and convert to a long. */ - if (num2->n_scale != 0) - bc_rt_warn ("non-zero scale in exponent"); - exponent = bc_num2long (num2); - if (exponent == 0 && (num2->n_len > 1 || num2->n_value[0] != 0)) - bc_rt_error ("exponent too large in raise"); - - /* Special case if exponent is a zero. */ - if (exponent == 0) - { - bc_free_num (result); - *result = bc_copy_num (BCG(_one_)); - return; - } - - /* Other initializations. */ - if (exponent < 0) - { - neg = TRUE; - exponent = -exponent; - rscale = scale; - } - else - { - neg = FALSE; - rscale = MIN (num1->n_scale*exponent, MAX(scale, num1->n_scale)); - } - - /* Set initial value of temp. */ - power = bc_copy_num (num1); - pwrscale = num1->n_scale; - while ((exponent & 1) == 0) - { - pwrscale = 2*pwrscale; - bc_multiply (power, power, &power, pwrscale TSRMLS_CC); - exponent = exponent >> 1; - } - temp = bc_copy_num (power); - calcscale = pwrscale; - exponent = exponent >> 1; - - /* Do the calculation. */ - while (exponent > 0) - { - pwrscale = 2*pwrscale; - bc_multiply (power, power, &power, pwrscale TSRMLS_CC); - if ((exponent & 1) == 1) { - calcscale = pwrscale + calcscale; - bc_multiply (temp, power, &temp, calcscale TSRMLS_CC); - } - exponent = exponent >> 1; - } - - /* Assign the value. */ - if (neg) - { - bc_divide (BCG(_one_), temp, result, rscale TSRMLS_CC); - bc_free_num (&temp); - } - else - { - bc_free_num (result); - *result = temp; - if ((*result)->n_scale > rscale) - (*result)->n_scale = rscale; - } - bc_free_num (&power); -} - diff --git a/ext/bcmath/libbcmath/src/raisemod.c b/ext/bcmath/libbcmath/src/raisemod.c deleted file mode 100644 index 58964bec58df0..0000000000000 --- a/ext/bcmath/libbcmath/src/raisemod.c +++ /dev/null @@ -1,98 +0,0 @@ -/* raisemod.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Raise BASE to the EXPO power, reduced modulo MOD. The result is - placed in RESULT. If a EXPO is not an integer, - only the integer part is used. */ - -int -bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSRMLS_DC) -{ - bc_num power, exponent, parity, temp; - int rscale; - - /* Check for correct numbers. */ - if (bc_is_zero(mod TSRMLS_CC)) return -1; - if (bc_is_neg(expo)) return -1; - - /* Set initial values. */ - power = bc_copy_num (base); - exponent = bc_copy_num (expo); - temp = bc_copy_num (BCG(_one_)); - bc_init_num(&parity TSRMLS_CC); - - /* Check the base for scale digits. */ - if (base->n_scale != 0) - bc_rt_warn ("non-zero scale in base"); - - /* Check the exponent for scale digits. */ - if (exponent->n_scale != 0) - { - bc_rt_warn ("non-zero scale in exponent"); - bc_divide (exponent, BCG(_one_), &exponent, 0 TSRMLS_CC); /*truncate */ - } - - /* Check the modulus for scale digits. */ - if (mod->n_scale != 0) - bc_rt_warn ("non-zero scale in modulus"); - - /* Do the calculation. */ - rscale = MAX(scale, base->n_scale); - while ( !bc_is_zero(exponent TSRMLS_CC) ) - { - (void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0 TSRMLS_CC); - if ( !bc_is_zero(parity TSRMLS_CC) ) - { - bc_multiply (temp, power, &temp, rscale TSRMLS_CC); - (void) bc_modulo (temp, mod, &temp, scale TSRMLS_CC); - } - - bc_multiply (power, power, &power, rscale TSRMLS_CC); - (void) bc_modulo (power, mod, &power, scale TSRMLS_CC); - } - - /* Assign the value. */ - bc_free_num (&power); - bc_free_num (&exponent); - bc_free_num (result); - bc_free_num (&parity); - *result = temp; - return 0; /* Everything is OK. */ -} diff --git a/ext/bcmath/libbcmath/src/recmul.c b/ext/bcmath/libbcmath/src/recmul.c deleted file mode 100644 index c31d09dc72db5..0000000000000 --- a/ext/bcmath/libbcmath/src/recmul.c +++ /dev/null @@ -1,306 +0,0 @@ -/* recmul.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Recursive vs non-recursive multiply crossover ranges. */ -#if defined(MULDIGITS) -#include "muldigits.h" -#else -#define MUL_BASE_DIGITS 80 -#endif - -int mul_base_digits = MUL_BASE_DIGITS; -#define MUL_SMALL_DIGITS mul_base_digits/4 - -/* Multiply utility routines */ - -static bc_num -new_sub_num (length, scale, value) - int length, scale; - char *value; -{ - bc_num temp; - -#ifdef SANDER_0 - if (_bc_Free_list != NULL) { - temp = _bc_Free_list; - _bc_Free_list = temp->n_next; - } else { -#endif - temp = (bc_num) emalloc (sizeof(bc_struct)); -#ifdef SANDER_0 - if (temp == NULL) bc_out_of_memory (); - } -#endif - temp->n_sign = PLUS; - temp->n_len = length; - temp->n_scale = scale; - temp->n_refs = 1; - temp->n_ptr = NULL; - temp->n_value = value; - return temp; -} - -static void -_bc_simp_mul (bc_num n1, int n1len, bc_num n2, int n2len, bc_num *prod, - int full_scale) -{ - char *n1ptr, *n2ptr, *pvptr; - char *n1end, *n2end; /* To the end of n1 and n2. */ - int indx, sum, prodlen; - - prodlen = n1len+n2len+1; - - *prod = bc_new_num (prodlen, 0); - - n1end = (char *) (n1->n_value + n1len - 1); - n2end = (char *) (n2->n_value + n2len - 1); - pvptr = (char *) ((*prod)->n_value + prodlen - 1); - sum = 0; - - /* Here is the loop... */ - for (indx = 0; indx < prodlen-1; indx++) - { - n1ptr = (char *) (n1end - MAX(0, indx-n2len+1)); - n2ptr = (char *) (n2end - MIN(indx, n2len-1)); - while ((n1ptr >= n1->n_value) && (n2ptr <= n2end)) - sum += *n1ptr-- * *n2ptr++; - *pvptr-- = sum % BASE; - sum = sum / BASE; - } - *pvptr = sum; -} - - -/* A special adder/subtractor for the recursive divide and conquer - multiply algorithm. Note: if sub is called, accum must - be larger that what is being subtracted. Also, accum and val - must have n_scale = 0. (e.g. they must look like integers. *) */ -static void -_bc_shift_addsub (bc_num accum, bc_num val, int shift, int sub) -{ - signed char *accp, *valp; - int count, carry; - - count = val->n_len; - if (val->n_value[0] == 0) - count--; - assert (accum->n_len+accum->n_scale >= shift+count); - - /* Set up pointers and others */ - accp = (signed char *)(accum->n_value + - accum->n_len + accum->n_scale - shift - 1); - valp = (signed char *)(val->n_value + val->n_len - 1); - carry = 0; - - if (sub) { - /* Subtraction, carry is really borrow. */ - while (count--) { - *accp -= *valp-- + carry; - if (*accp < 0) { - carry = 1; - *accp-- += BASE; - } else { - carry = 0; - accp--; - } - } - while (carry) { - *accp -= carry; - if (*accp < 0) - *accp-- += BASE; - else - carry = 0; - } - } else { - /* Addition */ - while (count--) { - *accp += *valp-- + carry; - if (*accp > (BASE-1)) { - carry = 1; - *accp-- -= BASE; - } else { - carry = 0; - accp--; - } - } - while (carry) { - *accp += carry; - if (*accp > (BASE-1)) - *accp-- -= BASE; - else - carry = 0; - } - } -} - -/* Recursive divide and conquer multiply algorithm. - Based on - Let u = u0 + u1*(b^n) - Let v = v0 + v1*(b^n) - Then uv = (B^2n+B^n)*u1*v1 + B^n*(u1-u0)*(v0-v1) + (B^n+1)*u0*v0 - - B is the base of storage, number of digits in u1,u0 close to equal. -*/ -static void -_bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod, - int full_scale TSRMLS_DC) -{ - bc_num u0, u1, v0, v1; - int u0len, v0len; - bc_num m1, m2, m3, d1, d2; - int n, prodlen, m1zero; - int d1len, d2len; - - /* Base case? */ - if ((ulen+vlen) < mul_base_digits - || ulen < MUL_SMALL_DIGITS - || vlen < MUL_SMALL_DIGITS ) { - _bc_simp_mul (u, ulen, v, vlen, prod, full_scale); - return; - } - - /* Calculate n -- the u and v split point in digits. */ - n = (MAX(ulen, vlen)+1) / 2; - - /* Split u and v. */ - if (ulen < n) { - u1 = bc_copy_num (BCG(_zero_)); - u0 = new_sub_num (ulen,0, u->n_value); - } else { - u1 = new_sub_num (ulen-n, 0, u->n_value); - u0 = new_sub_num (n, 0, u->n_value+ulen-n); - } - if (vlen < n) { - v1 = bc_copy_num (BCG(_zero_)); - v0 = new_sub_num (vlen,0, v->n_value); - } else { - v1 = new_sub_num (vlen-n, 0, v->n_value); - v0 = new_sub_num (n, 0, v->n_value+vlen-n); - } - _bc_rm_leading_zeros (u1); - _bc_rm_leading_zeros (u0); - u0len = u0->n_len; - _bc_rm_leading_zeros (v1); - _bc_rm_leading_zeros (v0); - v0len = v0->n_len; - - m1zero = bc_is_zero(u1 TSRMLS_CC) || bc_is_zero(v1 TSRMLS_CC); - - /* Calculate sub results ... */ - - bc_init_num(&d1 TSRMLS_CC); - bc_init_num(&d2 TSRMLS_CC); - bc_sub (u1, u0, &d1, 0); - d1len = d1->n_len; - bc_sub (v0, v1, &d2, 0); - d2len = d2->n_len; - - - /* Do recursive multiplies and shifted adds. */ - if (m1zero) - m1 = bc_copy_num (BCG(_zero_)); - else - _bc_rec_mul (u1, u1->n_len, v1, v1->n_len, &m1, 0 TSRMLS_CC); - - if (bc_is_zero(d1 TSRMLS_CC) || bc_is_zero(d2 TSRMLS_CC)) - m2 = bc_copy_num (BCG(_zero_)); - else - _bc_rec_mul (d1, d1len, d2, d2len, &m2, 0 TSRMLS_CC); - - if (bc_is_zero(u0 TSRMLS_CC) || bc_is_zero(v0 TSRMLS_CC)) - m3 = bc_copy_num (BCG(_zero_)); - else - _bc_rec_mul (u0, u0->n_len, v0, v0->n_len, &m3, 0 TSRMLS_CC); - - /* Initialize product */ - prodlen = ulen+vlen+1; - *prod = bc_new_num(prodlen, 0); - - if (!m1zero) { - _bc_shift_addsub (*prod, m1, 2*n, 0); - _bc_shift_addsub (*prod, m1, n, 0); - } - _bc_shift_addsub (*prod, m3, n, 0); - _bc_shift_addsub (*prod, m3, 0, 0); - _bc_shift_addsub (*prod, m2, n, d1->n_sign != d2->n_sign); - - /* Now clean up! */ - bc_free_num (&u1); - bc_free_num (&u0); - bc_free_num (&v1); - bc_free_num (&m1); - bc_free_num (&v0); - bc_free_num (&m2); - bc_free_num (&m3); - bc_free_num (&d1); - bc_free_num (&d2); -} - -/* The multiply routine. N2 times N1 is put int PROD with the scale of - the result being MIN(N2 scale+N1 scale, MAX (SCALE, N2 scale, N1 scale)). - */ - -void -bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC) -{ - bc_num pval; - int len1, len2; - int full_scale, prod_scale; - - /* Initialize things. */ - len1 = n1->n_len + n1->n_scale; - len2 = n2->n_len + n2->n_scale; - full_scale = n1->n_scale + n2->n_scale; - prod_scale = MIN(full_scale,MAX(scale,MAX(n1->n_scale,n2->n_scale))); - - /* Do the multiply */ - _bc_rec_mul (n1, len1, n2, len2, &pval, full_scale TSRMLS_CC); - - /* Assign to prod and clean up the number. */ - pval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS ); - pval->n_value = pval->n_ptr; - pval->n_len = len2 + len1 + 1 - full_scale; - pval->n_scale = prod_scale; - _bc_rm_leading_zeros (pval); - if (bc_is_zero (pval TSRMLS_CC)) - pval->n_sign = PLUS; - bc_free_num (prod); - *prod = pval; -} diff --git a/ext/bcmath/libbcmath/src/rmzero.c b/ext/bcmath/libbcmath/src/rmzero.c deleted file mode 100644 index 63f7a0cb79da0..0000000000000 --- a/ext/bcmath/libbcmath/src/rmzero.c +++ /dev/null @@ -1,55 +0,0 @@ -/* rmzero.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* For many things, we may have leading zeros in a number NUM. - _bc_rm_leading_zeros just moves the data "value" pointer to the - correct place and adjusts the length. */ - - void -_bc_rm_leading_zeros (num) - bc_num num; -{ - /* We can move n_value to point to the first non zero digit! */ - while (*num->n_value == 0 && num->n_len > 1) { - num->n_value++; - num->n_len--; - } -} - diff --git a/ext/bcmath/libbcmath/src/rt.c b/ext/bcmath/libbcmath/src/rt.c deleted file mode 100644 index 5a98b68f7ecdf..0000000000000 --- a/ext/bcmath/libbcmath/src/rt.c +++ /dev/null @@ -1,65 +0,0 @@ -/* rt.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -void bc_rt_warn (char *mesg ,...) -{ - va_list args; - char error_mesg [255]; - - va_start (args, mesg); - vsnprintf (error_mesg, sizeof(error_mesg), mesg, args); - va_end (args); - - fprintf (stderr, "bc math warning: %s\n", error_mesg); -} - - -void bc_rt_error (char *mesg ,...) -{ - va_list args; - char error_mesg [255]; - - va_start (args, mesg); - vsnprintf (error_mesg, sizeof(error_mesg), mesg, args); - va_end (args); - - fprintf (stderr, "bc math error: %s\n", error_mesg); -} diff --git a/ext/bcmath/libbcmath/src/sqrt.c b/ext/bcmath/libbcmath/src/sqrt.c deleted file mode 100644 index 5db5113eb5775..0000000000000 --- a/ext/bcmath/libbcmath/src/sqrt.c +++ /dev/null @@ -1,129 +0,0 @@ -/* sqrt.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Take the square root NUM and return it in NUM with SCALE digits - after the decimal place. */ - -int -bc_sqrt (bc_num *num, int scale TSRMLS_DC) -{ - int rscale, cmp_res, done; - int cscale; - bc_num guess, guess1, point5, diff; - - /* Initial checks. */ - cmp_res = bc_compare (*num, BCG(_zero_)); - if (cmp_res < 0) - return 0; /* error */ - else - { - if (cmp_res == 0) - { - bc_free_num (num); - *num = bc_copy_num (BCG(_zero_)); - return 1; - } - } - cmp_res = bc_compare (*num, BCG(_one_)); - if (cmp_res == 0) - { - bc_free_num (num); - *num = bc_copy_num (BCG(_one_)); - return 1; - } - - /* Initialize the variables. */ - rscale = MAX (scale, (*num)->n_scale); - bc_init_num(&guess TSRMLS_CC); - bc_init_num(&guess1 TSRMLS_CC); - bc_init_num(&diff TSRMLS_CC); - point5 = bc_new_num (1,1); - point5->n_value[1] = 5; - - - /* Calculate the initial guess. */ - if (cmp_res < 0) - { - /* The number is between 0 and 1. Guess should start at 1. */ - guess = bc_copy_num (BCG(_one_)); - cscale = (*num)->n_scale; - } - else - { - /* The number is greater than 1. Guess should start at 10^(exp/2). */ - bc_int2num (&guess,10); - - bc_int2num (&guess1,(*num)->n_len); - bc_multiply (guess1, point5, &guess1, 0 TSRMLS_CC); - guess1->n_scale = 0; - bc_raise (guess, guess1, &guess, 0 TSRMLS_CC); - bc_free_num (&guess1); - cscale = 3; - } - - /* Find the square root using Newton's algorithm. */ - done = FALSE; - while (!done) - { - bc_free_num (&guess1); - guess1 = bc_copy_num (guess); - bc_divide (*num, guess, &guess, cscale TSRMLS_CC); - bc_add (guess, guess1, &guess, 0); - bc_multiply (guess, point5, &guess, cscale TSRMLS_CC); - bc_sub (guess, guess1, &diff, cscale+1); - if (bc_is_near_zero (diff, cscale)) - { - if (cscale < rscale+1) - cscale = MIN (cscale*3, rscale+1); - else - done = TRUE; - } - } - - /* Assign the number and clean up. */ - bc_free_num (num); - bc_divide (guess,BCG(_one_),num,rscale TSRMLS_CC); - bc_free_num (&guess); - bc_free_num (&guess1); - bc_free_num (&point5); - bc_free_num (&diff); - return 1; -} - diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c deleted file mode 100644 index c484c158e5946..0000000000000 --- a/ext/bcmath/libbcmath/src/str2num.c +++ /dev/null @@ -1,109 +0,0 @@ -/* str2num.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Convert strings to bc numbers. Base 10 only.*/ - -void -bc_str2num (bc_num *num, char *str, int scale TSRMLS_DC) -{ - int digits, strscale; - char *ptr, *nptr; - char zero_int; - - /* Prepare num. */ - bc_free_num (num); - - /* Check for valid number and count digits. */ - ptr = str; - digits = 0; - strscale = 0; - zero_int = FALSE; - if ( (*ptr == '+') || (*ptr == '-')) ptr++; /* Sign */ - while (*ptr == '0') ptr++; /* Skip leading zeros. */ - while (isdigit((int)*ptr)) ptr++, digits++; /* digits */ - if (*ptr == '.') ptr++; /* decimal point */ - while (isdigit((int)*ptr)) ptr++, strscale++; /* digits */ - if ((*ptr != '\0') || (digits+strscale == 0)) - { - *num = bc_copy_num (BCG(_zero_)); - return; - } - - /* Adjust numbers and allocate storage and initialize fields. */ - strscale = MIN(strscale, scale); - if (digits == 0) - { - zero_int = TRUE; - digits = 1; - } - *num = bc_new_num (digits, strscale); - - /* Build the whole number. */ - ptr = str; - if (*ptr == '-') - { - (*num)->n_sign = MINUS; - ptr++; - } - else - { - (*num)->n_sign = PLUS; - if (*ptr == '+') ptr++; - } - while (*ptr == '0') ptr++; /* Skip leading zeros. */ - nptr = (*num)->n_value; - if (zero_int) - { - *nptr++ = 0; - digits = 0; - } - for (;digits > 0; digits--) - *nptr++ = CH_VAL(*ptr++); - - - /* Build the fractional part. */ - if (strscale > 0) - { - ptr++; /* skip the decimal point! */ - for (;strscale > 0; strscale--) - *nptr++ = CH_VAL(*ptr++); - } -} - diff --git a/ext/bcmath/libbcmath/src/sub.c b/ext/bcmath/libbcmath/src/sub.c deleted file mode 100644 index 2dd8eb5ecc144..0000000000000 --- a/ext/bcmath/libbcmath/src/sub.c +++ /dev/null @@ -1,90 +0,0 @@ -/* sub.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Here is the full subtract routine that takes care of negative numbers. - N2 is subtracted from N1 and the result placed in RESULT. SCALE_MIN - is the minimum scale for the result. */ - -void -bc_sub (n1, n2, result, scale_min) - bc_num n1, n2, *result; - int scale_min; -{ - bc_num diff = NULL; - int cmp_res; - int res_scale; - - if (n1->n_sign != n2->n_sign) - { - diff = _bc_do_add (n1, n2, scale_min); - diff->n_sign = n1->n_sign; - } - else - { - /* subtraction must be done. */ - /* Compare magnitudes. */ - cmp_res = _bc_do_compare (n1, n2, FALSE, FALSE); - switch (cmp_res) - { - case -1: - /* n1 is less than n2, subtract n1 from n2. */ - diff = _bc_do_sub (n2, n1, scale_min); - diff->n_sign = (n2->n_sign == PLUS ? MINUS : PLUS); - break; - case 0: - /* They are equal! return zero! */ - res_scale = MAX (scale_min, MAX(n1->n_scale, n2->n_scale)); - diff = bc_new_num (1, res_scale); - memset (diff->n_value, 0, res_scale+1); - break; - case 1: - /* n2 is less than n1, subtract n2 from n1. */ - diff = _bc_do_sub (n1, n2, scale_min); - diff->n_sign = n1->n_sign; - break; - } - } - - /* Clean up and return. */ - bc_free_num (result); - *result = diff; -} - diff --git a/ext/bcmath/libbcmath/src/zero.c b/ext/bcmath/libbcmath/src/zero.c deleted file mode 100644 index 4ee249ee710b5..0000000000000 --- a/ext/bcmath/libbcmath/src/zero.c +++ /dev/null @@ -1,64 +0,0 @@ -/* zero.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* In some places we need to check if the number NUM is zero. */ - -char -bc_is_zero (bc_num num TSRMLS_DC) -{ - int count; - char *nptr; - - /* Quick check. */ - if (num == BCG(_zero_)) return TRUE; - - /* Initialize */ - count = num->n_len + num->n_scale; - nptr = num->n_value; - - /* The check */ - while ((count > 0) && (*nptr++ == 0)) count--; - - if (count != 0) - return FALSE; - else - return TRUE; -} - diff --git a/ext/bcmath/package.xml b/ext/bcmath/package.xml deleted file mode 100644 index 3ef9773fe7fa6..0000000000000 --- a/ext/bcmath/package.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - bcmath - Arbitrary Precision Mathematics Functions - - - andi - Andi Gutmans - andi@php.net - lead - - - -For arbitrary precision mathematics PHP offers the Binary Calculator -which supports numbers of any size and precision, represented as strings. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h deleted file mode 100644 index ad532c9ff7236..0000000000000 --- a/ext/bcmath/php_bcmath.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_BCMATH_H -#define PHP_BCMATH_H - -#if HAVE_BCMATH - -#include "libbcmath/src/bcmath.h" - -extern zend_module_entry bcmath_module_entry; -#define phpext_bcmath_ptr &bcmath_module_entry - -PHP_MINIT_FUNCTION(bcmath); -PHP_MSHUTDOWN_FUNCTION(bcmath); -PHP_MINFO_FUNCTION(bcmath); - -PHP_FUNCTION(bcadd); -PHP_FUNCTION(bcsub); -PHP_FUNCTION(bcmul); -PHP_FUNCTION(bcdiv); -PHP_FUNCTION(bcmod); -PHP_FUNCTION(bcpow); -PHP_FUNCTION(bcsqrt); -PHP_FUNCTION(bccomp); -PHP_FUNCTION(bcscale); -PHP_FUNCTION(bcpowmod); - -ZEND_BEGIN_MODULE_GLOBALS(bcmath) - bc_num _zero_; - bc_num _one_; - bc_num _two_; - long bc_precision; -ZEND_END_MODULE_GLOBALS(bcmath) - -#if ZTS -#define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v) -#else -#define BCG(v) (bcmath_globals.v) -#endif - -ZEND_EXTERN_MODULE_GLOBALS(bcmath) - -#else - -#define phpext_bcmath_ptr NULL - -#endif - -#endif /* PHP_BCMATH_H */ diff --git a/ext/bcmath/tests/bcadd.phpt b/ext/bcmath/tests/bcadd.phpt deleted file mode 100644 index 61552eecded0e..0000000000000 --- a/ext/bcmath/tests/bcadd.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -bcadd() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -3 -4.0000 -8728932003911564969352217864684.00 diff --git a/ext/bcmath/tests/bccomp.phpt b/ext/bcmath/tests/bccomp.phpt deleted file mode 100644 index b2bf9f4ac2b9b..0000000000000 --- a/ext/bcmath/tests/bccomp.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -bccomp() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- --1 --1 -0 -1 diff --git a/ext/bcmath/tests/bcdiv.phpt b/ext/bcmath/tests/bcdiv.phpt deleted file mode 100644 index cda19496d5569..0000000000000 --- a/ext/bcmath/tests/bcdiv.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -bcdiv() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -0 -0.50 --0.2000 -4526580661.75 diff --git a/ext/bcmath/tests/bcmod.phpt b/ext/bcmath/tests/bcmod.phpt deleted file mode 100644 index 1d7be48a754b2..0000000000000 --- a/ext/bcmath/tests/bcmod.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -bcmod() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -1 --1 -1459434331351930289678 diff --git a/ext/bcmath/tests/bcmul.phpt b/ext/bcmath/tests/bcmul.phpt deleted file mode 100644 index 0ff322fe327bc..0000000000000 --- a/ext/bcmath/tests/bcmul.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -bcmul() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -2 --15 -12193263111263526900 -3.75 diff --git a/ext/bcmath/tests/bcpow.phpt b/ext/bcmath/tests/bcpow.phpt deleted file mode 100644 index bdd4e08cab9ed..0000000000000 --- a/ext/bcmath/tests/bcpow.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -bcpow() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -1 --32 -18446744073709551616 diff --git a/ext/bcmath/tests/bcscale.phpt b/ext/bcmath/tests/bcscale.phpt deleted file mode 100644 index 4fc2f85eb92c1..0000000000000 --- a/ext/bcmath/tests/bcscale.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -bcscale() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -3 -3.00 -3.0000000000 -3 diff --git a/ext/bcmath/tests/bcsqrt.phpt b/ext/bcmath/tests/bcsqrt.phpt deleted file mode 100644 index 46d92fd5edc1f..0000000000000 --- a/ext/bcmath/tests/bcsqrt.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -bcsqrt() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- -3 -43913234134.28826 diff --git a/ext/bcmath/tests/bcsub.phpt b/ext/bcmath/tests/bcsub.phpt deleted file mode 100644 index 71726492f7788..0000000000000 --- a/ext/bcmath/tests/bcsub.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -bcsub() function ---SKIPIF-- - ---INI-- -bcmath.scale=0 ---FILE-- - ---EXPECT-- --1 --6.0000 -8728932000054820705086578390258.00 diff --git a/ext/bz2/CREDITS b/ext/bz2/CREDITS deleted file mode 100644 index 67dff9f41d7b1..0000000000000 --- a/ext/bz2/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Bzip2 -Sterling Hughes diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c deleted file mode 100644 index b83d0b8f54754..0000000000000 --- a/ext/bz2/bz2.c +++ /dev/null @@ -1,640 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_bz2.h" - -#if HAVE_BZ2 - -/* PHP Includes */ -#include "ext/standard/file.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" - -/* for fileno() */ -#include - -/* Internal error constants */ -#define PHP_BZ_ERRNO 0 -#define PHP_BZ_ERRSTR 1 -#define PHP_BZ_ERRBOTH 2 - -static PHP_MINIT_FUNCTION(bz2); -static PHP_MSHUTDOWN_FUNCTION(bz2); -static PHP_MINFO_FUNCTION(bz2); -static PHP_FUNCTION(bzopen); -static PHP_FUNCTION(bzread); -static PHP_FUNCTION(bzerrno); -static PHP_FUNCTION(bzerrstr); -static PHP_FUNCTION(bzerror); -static PHP_FUNCTION(bzcompress); -static PHP_FUNCTION(bzdecompress); - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bzread, 0, 0, 1) - ZEND_ARG_INFO(0, bz) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_bzopen, 0) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_bzerrno, 0) - ZEND_ARG_INFO(0, bz) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_bzerrstr, 0) - ZEND_ARG_INFO(0, bz) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_bzerror, 0) - ZEND_ARG_INFO(0, bz) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bzcompress, 0, 0, 2) - ZEND_ARG_INFO(0, source) - ZEND_ARG_INFO(0, blocksize) - ZEND_ARG_INFO(0, workfactor) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_bzdecompress, 0, 0, 1) - ZEND_ARG_INFO(0, source) - ZEND_ARG_INFO(0, small) -ZEND_END_ARG_INFO() - -/* }}} */ - -static zend_function_entry bz2_functions[] = { - PHP_FE(bzopen, arginfo_bzopen) - PHP_FE(bzread, arginfo_bzread) - PHP_FALIAS(bzwrite, fwrite, NULL) - PHP_FALIAS(bzflush, fflush, NULL) - PHP_FALIAS(bzclose, fclose, NULL) - PHP_FE(bzerrno, arginfo_bzerrno) - PHP_FE(bzerrstr, arginfo_bzerrstr) - PHP_FE(bzerror, arginfo_bzerror) - PHP_FE(bzcompress, arginfo_bzcompress) - PHP_FE(bzdecompress, arginfo_bzdecompress) - {NULL, NULL, NULL} -}; - -zend_module_entry bz2_module_entry = { - STANDARD_MODULE_HEADER, - "bz2", - bz2_functions, - PHP_MINIT(bz2), - PHP_MSHUTDOWN(bz2), - NULL, - NULL, - PHP_MINFO(bz2), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_BZ2 -ZEND_GET_MODULE(bz2) -#endif - -struct php_bz2_stream_data_t { - BZFILE *bz_file; - php_stream *stream; -}; - -/* {{{ BZip2 stream implementation */ - -static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract; - size_t ret; - - ret = BZ2_bzread(self->bz_file, buf, count); - - if (ret == 0) { - stream->eof = 1; - } - - return ret; -} - -static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract; - - return BZ2_bzwrite(self->bz_file, (char*)buf, count); -} - -static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; - int ret = EOF; - - if (close_handle) { - BZ2_bzclose(self->bz_file); - } - - if (self->stream) { - php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | (close_handle == 0 ? PHP_STREAM_FREE_PRESERVE_HANDLE : 0)); - } - - efree(self); - - return ret; -} - -static int php_bz2iop_flush(php_stream *stream TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; - return BZ2_bzflush(self->bz_file); -} -/* }}} */ - -php_stream_ops php_stream_bz2io_ops = { - php_bz2iop_write, php_bz2iop_read, - php_bz2iop_close, php_bz2iop_flush, - "BZip2", - NULL, /* seek */ - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -/* {{{ Bzip2 stream openers */ -PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, - char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC) -{ - struct php_bz2_stream_data_t *self; - - self = emalloc(sizeof(*self)); - - self->stream = innerstream; - self->bz_file = bz; - - return php_stream_alloc_rel(&php_stream_bz2io_ops, self, 0, mode); -} - -PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, - char *path, - char *mode, - int options, - char **opened_path, - php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *retstream = NULL, *stream = NULL; - char *path_copy = NULL; - BZFILE *bz_file = NULL; - - if (strncasecmp("compress.bzip2://", path, 17) == 0) { - path += 17; - } - if (mode[0] == '\0' || (mode[0] != 'w' && mode[0] != 'r' && mode[1] != '\0')) { - return NULL; - } - -#ifdef VIRTUAL_DIR - virtual_filepath_ex(path, &path_copy, NULL TSRMLS_CC); -#else - path_copy = path; -#endif - - if ((PG(safe_mode) && (!php_checkuid(path_copy, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(path_copy TSRMLS_CC)) { - return NULL; - } - - /* try and open it directly first */ - bz_file = BZ2_bzopen(path_copy, mode); - - if (opened_path && bz_file) { - *opened_path = estrdup(path_copy); - } - path_copy = NULL; - - if (bz_file == NULL) { - /* that didn't work, so try and get something from the network/wrapper */ - stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST | ENFORCE_SAFE_MODE, opened_path); - - if (stream) { - int fd; - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) { - bz_file = BZ2_bzdopen(fd, mode); - } - } - - /* remove the file created by php_stream_open_wrapper(), it is not needed since BZ2 functions - * failed. - */ - if (opened_path && !bz_file && mode[0] == 'w') { - VCWD_UNLINK(*opened_path); - } - } - - if (bz_file) { - retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC); - if (retstream) { - return retstream; - } - - BZ2_bzclose(bz_file); - } - - if (stream) { - php_stream_close(stream); - } - - return NULL; -} - -/* }}} */ - -static php_stream_wrapper_ops bzip2_stream_wops = { - _php_stream_bz2open, - NULL, /* close */ - NULL, /* fstat */ - NULL, /* stat */ - NULL, /* opendir */ - "BZip2", - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -static php_stream_wrapper php_stream_bzip2_wrapper = { - &bzip2_stream_wops, - NULL, - 0 /* is_url */ -}; - -static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int); - -static PHP_MINIT_FUNCTION(bz2) -{ - php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC); - php_stream_filter_register_factory("bzip2.*", &php_bz2_filter_factory TSRMLS_CC); - return SUCCESS; -} - -static PHP_MSHUTDOWN_FUNCTION(bz2) -{ - php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC); - php_stream_filter_unregister_factory("bzip2.*" TSRMLS_CC); - - return SUCCESS; -} - -static PHP_MINFO_FUNCTION(bz2) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "BZip2 Support", "Enabled"); - php_info_print_table_row(2, "Stream Wrapper support", "compress.bz2://"); - php_info_print_table_row(2, "Stream Filter support", "bzip2.decompress, bzip2.compress"); - php_info_print_table_row(2, "BZip2 Version", (char *) BZ2_bzlibVersion()); - php_info_print_table_end(); -} - -/* {{{ proto string bzread(resource bz[, int length]) - Reads up to length bytes from a BZip2 stream, or 1024 bytes if length is not specified */ -static PHP_FUNCTION(bzread) -{ - zval *bz; - long len = 1024; - php_stream *stream; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &bz); - - if ((len + 1) < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative"); - RETURN_FALSE; - } - - Z_STRVAL_P(return_value) = emalloc(len + 1); - Z_STRLEN_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), len); - - if (Z_STRLEN_P(return_value) < 0) { - efree(Z_STRVAL_P(return_value)); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream"); - RETURN_FALSE; - } - - Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0; - - if (PG(magic_quotes_runtime)) { - Z_STRVAL_P(return_value) = php_addslashes( Z_STRVAL_P(return_value), - Z_STRLEN_P(return_value), - &Z_STRLEN_P(return_value), 1 TSRMLS_CC); - } - - Z_TYPE_P(return_value) = IS_STRING; -} -/* }}} */ - -/* {{{ proto resource bzopen(string|int file|fp, string mode) - Opens a new BZip2 stream */ -static PHP_FUNCTION(bzopen) -{ - zval **file, /* The file to open */ - **mode; /* The mode to open the stream with */ - BZFILE *bz; /* The compressed file stream */ - php_stream *stream = NULL; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &file, &mode) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(mode); - - if (Z_STRLEN_PP(mode) != 1 || (Z_STRVAL_PP(mode)[0] != 'r' && Z_STRVAL_PP(mode)[0] != 'w')) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", Z_STRVAL_PP(mode)); - RETURN_FALSE; - } - - /* If it's not a resource its a string containing the filename to open */ - if (Z_TYPE_PP(file) != IS_RESOURCE) { - convert_to_string_ex(file); - - if (Z_STRLEN_PP(file) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty"); - RETURN_FALSE; - } - - stream = php_stream_bz2open(NULL, - Z_STRVAL_PP(file), - Z_STRVAL_PP(mode), - ENFORCE_SAFE_MODE | REPORT_ERRORS, - NULL); - } else { - /* If it is a resource, than its a stream resource */ - int fd; - int stream_mode_len; - - php_stream_from_zval(stream, file); - stream_mode_len = strlen(stream->mode); - - if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); - RETURN_FALSE; - } else if (stream_mode_len == 1 && stream->mode[0] != 'r' && stream->mode[0] != 'w' && stream->mode[0] != 'a' && stream->mode[0] != 'x') { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); - RETURN_FALSE; - } - - switch(Z_STRVAL_PP(mode)[0]) { - case 'r': - /* only "r" and "rb" are supported */ - if (stream->mode[0] != Z_STRVAL_PP(mode)[0] && !(stream_mode_len == 2 && stream->mode[1] != Z_STRVAL_PP(mode)[0])) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot read from a stream opened in write only mode"); - RETURN_FALSE; - } - break; - case 'w': - /* support only "w"(b), "a"(b), "x"(b) */ - if (stream->mode[0] != Z_STRVAL_PP(mode)[0] && !(stream_mode_len == 2 && stream->mode[1] != Z_STRVAL_PP(mode)[0]) - && stream->mode[0] != 'a' && !(stream_mode_len == 2 && stream->mode[1] != 'a') - && stream->mode[0] != 'x' && !(stream_mode_len == 2 && stream->mode[1] != 'x')) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write to a stream opened in read only mode"); - RETURN_FALSE; - } - break; - default: - /* not reachable */ - break; - } - - if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) { - RETURN_FALSE; - } - - bz = BZ2_bzdopen(fd, Z_STRVAL_PP(mode)); - - stream = php_stream_bz2open_from_BZFILE(bz, Z_STRVAL_PP(mode), stream); - } - - if (stream) { - php_stream_to_zval(stream, return_value); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int bzerrno(resource bz) - Returns the error number */ -static PHP_FUNCTION(bzerrno) -{ - php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRNO); -} -/* }}} */ - -/* {{{ proto string bzerrstr(resource bz) - Returns the error string */ -static PHP_FUNCTION(bzerrstr) -{ - php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRSTR); -} -/* }}} */ - -/* {{{ proto array bzerror(resource bz) - Returns the error number and error string in an associative array */ -static PHP_FUNCTION(bzerror) -{ - php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRBOTH); -} -/* }}} */ - -/* {{{ proto string bzcompress(string source [, int blocksize100k [, int workfactor]]) - Compresses a string into BZip2 encoded data */ -static PHP_FUNCTION(bzcompress) -{ - zval **source, /* Source data to compress */ - **zblock_size, /* Optional block size to use */ - **zwork_factor; /* Optional work factor to use */ - char *dest = NULL; /* Destination to place the compressed data into */ - int error, /* Error Container */ - block_size = 4, /* Block size for compression algorithm */ - work_factor = 0, /* Work factor for compression algorithm */ - argc; /* Argument count */ - unsigned int source_len, /* Length of the source data */ - dest_len; /* Length of the destination buffer */ - - argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &source, &zblock_size, &zwork_factor) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(source); - - /* Assign them to easy to use variables, dest_len is initially the length of the data - + .01 x length of data + 600 which is the largest size the results of the compression - could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net - for pointing this out). */ - source_len = Z_STRLEN_PP(source); - dest_len = Z_STRLEN_PP(source) + (0.01 * Z_STRLEN_PP(source)) + 600; - - /* Allocate the destination buffer */ - dest = emalloc(dest_len + 1); - - /* Handle the optional arguments */ - if (argc > 1) { - convert_to_long_ex(zblock_size); - block_size = Z_LVAL_PP(zblock_size); - } - - if (argc > 2) { - convert_to_long_ex(zwork_factor); - work_factor = Z_LVAL_PP(zwork_factor); - } - - error = BZ2_bzBuffToBuffCompress(dest, &dest_len, Z_STRVAL_PP(source), source_len, block_size, 0, work_factor); - if (error != BZ_OK) { - efree(dest); - RETURN_LONG(error); - } else { - /* Copy the buffer, we have perhaps allocate alot more than we need, - so we erealloc() the buffer to the proper size */ - dest = erealloc(dest, dest_len + 1); - dest[dest_len] = 0; - RETURN_STRINGL(dest, dest_len, 0); - } -} -/* }}} */ - -/* {{{ proto string bzdecompress(string source [, int small]) - Decompresses BZip2 compressed data */ -static PHP_FUNCTION(bzdecompress) -{ - char *source, *dest; - int source_len, error; - long small = 0; -#if defined(PHP_WIN32) - unsigned __int64 size = 0; -#else - unsigned long long size = 0; -#endif - bz_stream bzs; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &small)) { - RETURN_FALSE; - } - - bzs.bzalloc = NULL; - bzs.bzfree = NULL; - - if (BZ2_bzDecompressInit(&bzs, 0, small) != BZ_OK) { - RETURN_FALSE; - } - - bzs.next_in = source; - bzs.avail_in = source_len; - - /* in most cases bz2 offers at least 2:1 compression, so we use that as our base */ - bzs.avail_out = source_len * 2; - bzs.next_out = dest = emalloc(bzs.avail_out + 1); - - while ((error = BZ2_bzDecompress(&bzs)) == BZ_OK && bzs.avail_in > 0) { - /* compression is better then 2:1, need to allocate more memory */ - bzs.avail_out = source_len; - size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32; - dest = safe_erealloc(dest, 1, bzs.avail_out+1, size ); - bzs.next_out = dest + size; - } - - if (error == BZ_STREAM_END || error == BZ_OK) { - size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32; - dest = safe_erealloc(dest, 1, size, 1); - dest[size] = '\0'; - RETVAL_STRINGL(dest, size, 0); - } else { /* real error */ - efree(dest); - RETVAL_LONG(error); - } - - BZ2_bzDecompressEnd(&bzs); -} -/* }}} */ - -/* {{{ php_bz2_error() - The central error handling interface, does the work for bzerrno, bzerrstr and bzerror */ -static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt) -{ - zval **bzp; /* BZip2 Resource Pointer */ - php_stream *stream; - const char *errstr; /* Error string */ - int errnum; /* Error number */ - struct php_bz2_stream_data_t *self; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &bzp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - php_stream_from_zval(stream, bzp); - - if (!php_stream_is(stream, PHP_STREAM_IS_BZIP2)) { - RETURN_FALSE; - } - - self = (struct php_bz2_stream_data_t *) stream->abstract; - - /* Fetch the error information */ - errstr = BZ2_bzerror(self->bz_file, &errnum); - - /* Determine what to return */ - switch (opt) { - case PHP_BZ_ERRNO: - RETURN_LONG(errnum); - break; - case PHP_BZ_ERRSTR: - RETURN_STRING((char*)errstr, 1); - break; - case PHP_BZ_ERRBOTH: - array_init(return_value); - - add_assoc_long (return_value, "errno", errnum); - add_assoc_string(return_value, "errstr", (char*)errstr, 1); - break; - } -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/bz2/bz2.dsp b/ext/bz2/bz2.dsp deleted file mode 100644 index a054c522a79b9..0000000000000 --- a/ext/bz2/bz2.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="bz2" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=bz2 - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "bz2.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "bz2.mak" CFG="bz2 - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "bz2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "bz2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "bz2 - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_bz2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release" - -!ELSEIF "$(CFG)" == "bz2 - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_bz2.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release" - -!ENDIF - -# Begin Target - -# Name "bz2 - Win32 Release_TS" -# Name "bz2 - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\bz2.c -# End Source File -# Begin Source File - -SOURCE=.\bz2_filter.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_bz2.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c deleted file mode 100644 index 07597e5b18dac..0000000000000 --- a/ext/bz2/bz2_filter.c +++ /dev/null @@ -1,408 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Sara Golemon (pollita@php.net) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_bz2.h" - -/* {{{ data structure */ - -typedef struct _php_bz2_filter_data { - int persistent; - bz_stream strm; - char *inbuf; - size_t inbuf_len; - char *outbuf; - size_t outbuf_len; - zend_bool finished; -} php_bz2_filter_data; - -/* }}} */ - -/* {{{ Memory management wrappers */ - -static void *php_bz2_alloc(void *opaque, int items, int size) -{ - return (void *)safe_pemalloc(items, size, 0, ((php_bz2_filter_data*)opaque)->persistent); -} - -static void php_bz2_free(void *opaque, void *address) -{ - pefree((void *)address, ((php_bz2_filter_data*)opaque)->persistent); -} -/* }}} */ - -/* {{{ bzip2.decompress filter implementation */ - -static php_stream_filter_status_t php_bz2_decompress_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_bz2_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - bz_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_bz2_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); - while (bin < bucket->buflen) { - if (data->finished) { - consumed += bucket->buflen; - break; - } - - desired = bucket->buflen - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf + bin, desired); - data->strm.avail_in = desired; - - status = BZ2_bzDecompress(&(data->strm)); - - if (status == BZ_STREAM_END) { - BZ2_bzDecompressEnd(&(data->strm)); - data->finished = '\1'; - } else if (status != BZ_OK) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - consumed += desired; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } else if (status == BZ_STREAM_END && data->strm.avail_out >= data->outbuf_len) { - /* no more data to decompress, and nothing was spat out */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_PASS_ON; - } - } - - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (!data->finished && (flags & PSFS_FLAG_FLUSH_CLOSE)) { - /* Spit it out! */ - status = BZ_OK; - while (status == BZ_OK) { - status = BZ2_bzDecompress(&(data->strm)); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } else if (status == BZ_OK) { - break; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - - return exit_status; -} - -static void php_bz2_decompress_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_bz2_filter_data *data = thisfilter->abstract; - if (!data->finished) { - BZ2_bzDecompressEnd(&(data->strm)); - } - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_bz2_decompress_ops = { - php_bz2_decompress_filter, - php_bz2_decompress_dtor, - "bzip2.decompress" -}; -/* }}} */ - -/* {{{ bzip2.compress filter implementation */ - -static php_stream_filter_status_t php_bz2_compress_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_bz2_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - bz_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_bz2_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); - - while (bin < bucket->buflen) { - desired = bucket->buflen - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf + bin, desired); - data->strm.avail_in = desired; - - status = BZ2_bzCompress(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? BZ_FINISH : (flags & PSFS_FLAG_FLUSH_INC ? BZ_FLUSH : BZ_RUN)); - if (status != BZ_RUN_OK && status != BZ_FLUSH_OK && status != BZ_FINISH_OK) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - consumed += desired; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - /* Spit it out! */ - status = BZ_FINISH_OK; - while (status == BZ_FINISH_OK) { - status = BZ2_bzCompress(&(data->strm), BZ_FINISH); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - return exit_status; -} - -static void php_bz2_compress_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_bz2_filter_data *data = thisfilter->abstract; - BZ2_bzCompressEnd(&(data->strm)); - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_bz2_compress_ops = { - php_bz2_compress_filter, - php_bz2_compress_dtor, - "bzip2.compress" -}; - -/* }}} */ - -/* {{{ bzip2.* common factory */ - -static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) -{ - php_stream_filter_ops *fops = NULL; - php_bz2_filter_data *data; - int status; - - /* Create this filter */ - data = pecalloc(1, sizeof(php_bz2_filter_data), persistent); - if (!data) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes.", sizeof(php_bz2_filter_data)); - return NULL; - } - - /* Circular reference */ - data->strm.opaque = (void *) data; - - data->strm.bzalloc = php_bz2_alloc; - data->strm.bzfree = php_bz2_free; - data->persistent = persistent; - data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048; - data->strm.next_in = data->inbuf = (char *) pemalloc(data->inbuf_len, persistent); - if (!data->inbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes.", data->inbuf_len); - pefree(data, persistent); - return NULL; - } - data->strm.avail_in = 0; - data->strm.next_out = data->outbuf = (char *) pemalloc(data->outbuf_len, persistent); - if (!data->outbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes.", data->outbuf_len); - pefree(data->inbuf, persistent); - pefree(data, persistent); - return NULL; - } - - if (strcasecmp(filtername, "bzip2.decompress") == 0) { - int smallFootprint = 0; - - if (filterparams) { - zval **tmpzval = NULL; - - if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) { - zend_hash_find(HASH_OF(filterparams), "small", sizeof("small"), (void **) &tmpzval); - } else { - tmpzval = &filterparams; - } - - if (tmpzval) { - SEPARATE_ZVAL(tmpzval); - convert_to_boolean_ex(tmpzval); - smallFootprint = Z_LVAL_PP(tmpzval); - zval_ptr_dtor(tmpzval); - } - } - - status = BZ2_bzDecompressInit(&(data->strm), 0, smallFootprint); - data->finished = '\0'; - fops = &php_bz2_decompress_ops; - } else if (strcasecmp(filtername, "bzip2.compress") == 0) { - int blockSize100k = PHP_BZ2_FILTER_DEFAULT_BLOCKSIZE; - int workFactor = PHP_BZ2_FILTER_DEFAULT_WORKFACTOR; - - if (filterparams) { - zval **tmpzval; - - if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) { - if (zend_hash_find(HASH_OF(filterparams), "blocks", sizeof("blocks"), (void**) &tmpzval) == SUCCESS) { - /* How much memory to allocate (1 - 9) x 100kb */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < 1 || Z_LVAL_PP(tmpzval) > 9) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - blockSize100k = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - - if (zend_hash_find(HASH_OF(filterparams), "work", sizeof("work"), (void**) &tmpzval) == SUCCESS) { - /* Work Factor (0 - 250) */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < 0 || Z_LVAL_PP(tmpzval) > 250) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - workFactor = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - } - } - - status = BZ2_bzCompressInit(&(data->strm), blockSize100k, 0, workFactor); - fops = &php_bz2_compress_ops; - } else { - status = BZ_DATA_ERROR; - } - - if (status != BZ_OK) { - /* Unspecified (probably strm) error, let stream-filter error do its own whining */ - pefree(data->strm.next_in, persistent); - pefree(data->strm.next_out, persistent); - pefree(data, persistent); - return NULL; - } - - return php_stream_filter_alloc(fops, data, persistent); -} - -php_stream_filter_factory php_bz2_filter_factory = { - php_bz2_filter_create -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/bz2/config.m4 b/ext/bz2/config.m4 deleted file mode 100644 index 3e6aa78d053a6..0000000000000 --- a/ext/bz2/config.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(bz2, for BZip2 support, -[ --with-bz2[=DIR] Include BZip2 support]) - -if test "$PHP_BZ2" != "no"; then - if test -r $PHP_BZ2/include/bzlib.h; then - BZIP_DIR=$PHP_BZ2 - else - AC_MSG_CHECKING(for BZip2 in default path) - for i in /usr/local /usr; do - if test -r $i/include/bzlib.h; then - BZIP_DIR=$i - AC_MSG_RESULT(found in $i) - break - fi - done - fi - - if test -z "$BZIP_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the BZip2 distribution) - fi - - PHP_CHECK_LIBRARY(bz2, BZ2_bzerror, - [ - PHP_ADD_INCLUDE($BZIP_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/$PHP_LIBDIR, BZ2_SHARED_LIBADD) - AC_DEFINE(HAVE_BZ2,1,[ ]) - ], [ - AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0) - ], [ - -L$BZIP_DIR/$PHP_LIBDIR - ]) - - PHP_NEW_EXTENSION(bz2, bz2.c bz2_filter.c, $ext_shared) - PHP_SUBST(BZ2_SHARED_LIBADD) -fi diff --git a/ext/bz2/config.w32 b/ext/bz2/config.w32 deleted file mode 100644 index af57f8bc30a4c..0000000000000 --- a/ext/bz2/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("bz2", "BZip2", "no"); - -if (PHP_BZ2 != "no") { - if (CHECK_LIB("libbz2.lib", "bz2", PHP_BZ2) && - CHECK_HEADER_ADD_INCLUDE("bzlib.h", "CFLAGS_BZ2")) { - EXTENSION("bz2", "bz2.c bz2_filter.c"); - AC_DEFINE('HAVE_BZ2', 1, 'Have BZ2 library'); - // BZ2 extension does this slightly differently from others - if (PHP_BZ2_SHARED) { - ADD_FLAG("CFLAGS_BZ2", "/D PHP_BZ2_EXPORTS "); - } - } else { - WARNING("bz2 not enabled; libraries and headers not found"); - } -} diff --git a/ext/bz2/package.xml b/ext/bz2/package.xml deleted file mode 100644 index 107f2188668f8..0000000000000 --- a/ext/bz2/package.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - bz2 - A Bzip2 management extension - -Bz2 is an extension to create and parse bzip2 compressed data. - - PHP License - - - sterling - Sterling Hughes - sterling@php.net - - - - 1.0 - 2003-05-17 - stable - - Initial Release in PECL - - - - - - - - CREDITS - config.m4 - php_bz2.h - bz2.c - bz2.dsp - - - diff --git a/ext/bz2/php_bz2.def b/ext/bz2/php_bz2.def deleted file mode 100644 index 831355344a2de..0000000000000 --- a/ext/bz2/php_bz2.def +++ /dev/null @@ -1,7 +0,0 @@ -EXPORTS - BZ2_bzCompressInit - BZ2_bzCompress - BZ2_bzCompressEnd - BZ2_bzDecompressInit - BZ2_bzDecompress - BZ2_bzDecompressEnd diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h deleted file mode 100644 index 5d453a545745a..0000000000000 --- a/ext/bz2/php_bz2.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_BZ2_H -#define PHP_BZ2_H - -#if HAVE_BZ2 - -extern zend_module_entry bz2_module_entry; -#define phpext_bz2_ptr &bz2_module_entry - -/* Bzip2 includes */ -#include - -#else -#define phpext_bz2_ptr NULL -#endif - -#ifdef PHP_WIN32 -# ifdef PHP_BZ2_EXPORTS -# define PHP_BZ2_API __declspec(dllexport) -# elif defined(COMPILE_DL_BZ2) -# define PHP_BZ2_API __declspec(dllimport) -# else -# define PHP_BZ2_API /* nothing special */ -# endif -#else -# define PHP_BZ2_API -#endif - -PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC); - -#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC) -#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC) - -extern php_stream_filter_factory php_bz2_filter_factory; -extern php_stream_ops php_stream_bz2io_ops; -#define PHP_STREAM_IS_BZIP2 &php_stream_bz2io_ops - -/* 400kb */ -#define PHP_BZ2_FILTER_DEFAULT_BLOCKSIZE 4 - -/* BZ2 Internal Default */ -#define PHP_BZ2_FILTER_DEFAULT_WORKFACTOR 0 - -#endif - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/bz2/tests/001.phpt b/ext/bz2/tests/001.phpt deleted file mode 100644 index a4ef1a2af761c..0000000000000 --- a/ext/bz2/tests/001.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -bzopen() and invalid parameters ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: Wrong parameter count for bzopen() in %s on line %d -NULL - -Warning: bzopen(): '' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d -bool(false) - -Warning: bzopen(): filename cannot be empty in %s on line %d -bool(false) - -Warning: bzopen(): filename cannot be empty in %s on line %d -bool(false) - -Warning: bzopen(): 'x' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d -bool(false) - -Warning: bzopen(): 'rw' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d -bool(false) - -Warning: bzopen(no_such_file): failed to open stream: No such file or directory in %s on line %d -bool(false) -resource(%d) of type (stream) -Done diff --git a/ext/bz2/tests/002.phpt b/ext/bz2/tests/002.phpt deleted file mode 100644 index 7b9673275c4ba..0000000000000 --- a/ext/bz2/tests/002.phpt +++ /dev/null @@ -1,129 +0,0 @@ ---TEST-- -bzopen() using fd opened in wrong mode ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (stream) -resource(%d) of type (stream) -resource(%d) of type (stream) - -Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d -bool(false) -resource(%d) of type (stream) -resource(%d) of type (stream) - -Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d - -Warning: bzopen(): filename cannot be empty in %s on line %d -bool(false) - -Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d - -Warning: bzopen(): filename cannot be empty in %s on line %d -bool(false) - -Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d -bool(false) - -Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d -bool(false) - -Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d -bool(false) - -Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d -bool(false) - -Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d -bool(false) - -Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d -bool(false) - -Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d -bool(false) - -Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d -bool(false) - -Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d -bool(false) - -Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d -bool(false) - -Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d -bool(false) -resource(%d) of type (stream) -Done diff --git a/ext/bz2/tests/003.phpt b/ext/bz2/tests/003.phpt deleted file mode 100644 index 1432600087a51..0000000000000 --- a/ext/bz2/tests/003.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -bzread() tests ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: bzread() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: bzread() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -string(0) "" - -Warning: bzread(): length may not be negative in %s on line %d -bool(false) -string(1) "R" -string(2) "is" -string(251) "ing up from the heart of the desert -Rising up for Jerusalem -Rising up from the heat of the desert -Building up Old Jerusalem -Rising up from the heart of the desert -Rising up for Jerusalem -Rising up from the heat of the desert -Heading out for Jerusalem -" -Done diff --git a/ext/bz2/tests/003.txt.bz2 b/ext/bz2/tests/003.txt.bz2 deleted file mode 100644 index 034cd4d8b7c51..0000000000000 Binary files a/ext/bz2/tests/003.txt.bz2 and /dev/null differ diff --git a/ext/bz2/tests/004.phpt b/ext/bz2/tests/004.phpt deleted file mode 100644 index a638188bcb477..0000000000000 --- a/ext/bz2/tests/004.phpt +++ /dev/null @@ -1,111 +0,0 @@ ---TEST-- -bzread() tests with invalid files ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(2) { - ["errno"]=> - int(0) - ["errstr"]=> - string(2) "OK" -} -string(2) "OK" -int(0) -array(2) { - ["errno"]=> - int(0) - ["errstr"]=> - string(2) "OK" -} -string(2) "OK" -int(0) -string(0) "" -array(2) { - ["errno"]=> - int(-5) - ["errstr"]=> - string(16) "DATA_ERROR_MAGIC" -} -string(16) "DATA_ERROR_MAGIC" -int(-5) -string(0) "" -array(2) { - ["errno"]=> - int(-4) - ["errstr"]=> - string(10) "DATA_ERROR" -} -string(10) "DATA_ERROR" -int(-4) -string(0) "" -array(2) { - ["errno"]=> - int(-5) - ["errstr"]=> - string(16) "DATA_ERROR_MAGIC" -} -string(16) "DATA_ERROR_MAGIC" -int(-5) -string(0) "" -array(2) { - ["errno"]=> - int(-4) - ["errstr"]=> - string(10) "DATA_ERROR" -} -string(10) "DATA_ERROR" -int(-4) - -Warning: bzread(): %d is not a valid stream resource in %s on line %d -bool(false) - -Warning: bzerror(): %d is not a valid stream resource in %s on line %d -bool(false) - -Warning: bzerrstr(): %d is not a valid stream resource in %s on line %d -bool(false) - -Warning: bzerrno(): %d is not a valid stream resource in %s on line %d -bool(false) -Done diff --git a/ext/bz2/tests/004_1.txt.bz2 b/ext/bz2/tests/004_1.txt.bz2 deleted file mode 100644 index 6a5067b277354..0000000000000 Binary files a/ext/bz2/tests/004_1.txt.bz2 and /dev/null differ diff --git a/ext/bz2/tests/004_2.txt.bz2 b/ext/bz2/tests/004_2.txt.bz2 deleted file mode 100644 index 9c19f043a4d9a..0000000000000 Binary files a/ext/bz2/tests/004_2.txt.bz2 and /dev/null differ diff --git a/ext/bz2/tests/005.phpt b/ext/bz2/tests/005.phpt deleted file mode 100644 index fc2235d62786f..0000000000000 --- a/ext/bz2/tests/005.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -bzcompress()/bzdecompress() tests ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: Wrong parameter count for bzcompress() in %s on line %d -NULL -string(%d) "BZ%a" -int(-2) -int(-2) -int(-2) -int(-2) - -Warning: bzdecompress() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: bzdecompress() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -int(-5) -int(-5) -int(-5) -bool(false) -string(110) "Life it seems, will fade away -Drifting further everyday -Getting lost within myself -Nothing matters no one else" -bool(false) -string(110) "Life it seems, will fade away -Drifting further everyday -Getting lost within myself -Nothing matters no one else" -string(110) "Life it seems, will fade away -Drifting further everyday -Getting lost within myself -Nothing matters no one else" -Done diff --git a/ext/bz2/tests/bz2_filter_compress.phpt b/ext/bz2/tests/bz2_filter_compress.phpt deleted file mode 100644 index 3de9a9d3ecb43..0000000000000 --- a/ext/bz2/tests/bz2_filter_compress.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -bzip2.compress (with convert.base64-encode) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -QlpoNDFBWSZTWRN6QG0AAAoVgECFACA395UgIABIintI1N6mpowIQ0E1MTTAQGYTNcRyMZm5kgW3ib7hVboE7Tmqj3ToGZ5G3q1ZauD2G58hibSck8KS95EEAbx1Cn+LuSKcKEgJvSA2gA== diff --git a/ext/bz2/tests/bz2_filter_decompress.phpt b/ext/bz2/tests/bz2_filter_decompress.phpt deleted file mode 100644 index 951d572cb2d8f..0000000000000 --- a/ext/bz2/tests/bz2_filter_decompress.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -bzip2.decompress (with convert.base64-decode) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -I am the very model of a modern major general, I've information vegetable, animal, and mineral. diff --git a/ext/bz2/tests/with_files.phpt b/ext/bz2/tests/with_files.phpt deleted file mode 100644 index 569144593928e..0000000000000 --- a/ext/bz2/tests/with_files.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -BZ2 with files ---SKIPIF-- - ---FILE-- - ---FILE-- - | - | Colin Viebrock | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id: */ - -#include "php.h" -#include "php_calendar.h" -#include "sdncal.h" -#include - -/* {{{ proto int unixtojd([int timestamp]) - Convert UNIX timestamp to Julian Day */ -PHP_FUNCTION(unixtojd) -{ - zval *timestamp; - long jdate; - time_t t; - struct tm *ta, tmbuf; - int myargc=ZEND_NUM_ARGS(); - - if ((myargc > 1) || (zend_get_parameters(ht, myargc, ×tamp) != SUCCESS)) { - WRONG_PARAM_COUNT; - } - - if(myargc==1) { - convert_to_long(timestamp); - t = Z_LVAL_P(timestamp); - } else { - t = time(NULL); - } - - if(t < 0) { - RETURN_FALSE; - } - - ta = php_localtime_r(&t, &tmbuf); - if (!ta) { - RETURN_FALSE; - } - - jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1, ta->tm_mday); - - RETURN_LONG(jdate); -} -/* }}} */ - -/* {{{ proto int jdtounix(int jday) - Convert Julian Day to UNIX timestamp */ -PHP_FUNCTION(jdtounix) -{ - zval *jday; - long uday; - - if ((ZEND_NUM_ARGS()!= 1) || (zend_get_parameters(ht, 1, &jday) != SUCCESS)) { - WRONG_PARAM_COUNT; - } - - convert_to_long(jday); - - uday = Z_LVAL_P(jday) - 2440588 /* J.D. of 1.1.1970 */; - - if(uday<0) RETURN_FALSE; /* before beginning of unix epoch */ - if(uday>24755) RETURN_FALSE; /* behind end of unix epoch */ - - RETURN_LONG(uday*24*3600); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c deleted file mode 100644 index 7be566da12f63..0000000000000 --- a/ext/calendar/calendar.c +++ /dev/null @@ -1,766 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Shane Caraveo | - | Colin Viebrock | - | Hartmut Holzgraefe | - | Wez Furlong | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef PHP_WIN32 -#define _WINNLS_ -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_calendar.h" -#include "sdncal.h" - -#include - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_unixtojd, 0, 0, 0) - ZEND_ARG_INFO(0, timestamp) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_jdtounix, 0) - ZEND_ARG_INFO(0, jday) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_cal_info, 0, 0, 0) - ZEND_ARG_INFO(0, calendar) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_cal_days_in_month, 0) - ZEND_ARG_INFO(0, calendar) - ZEND_ARG_INFO(0, month) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_cal_to_jd, 0) - ZEND_ARG_INFO(0, calendar) - ZEND_ARG_INFO(0, month) - ZEND_ARG_INFO(0, day) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_cal_from_jd, 0) - ZEND_ARG_INFO(0, jd) - ZEND_ARG_INFO(0, calendar) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_jdtogregorian, 0) - ZEND_ARG_INFO(0, juliandaycount) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_gregoriantojd, 0) - ZEND_ARG_INFO(0, month) - ZEND_ARG_INFO(0, day) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_jdtojulian, 0) - ZEND_ARG_INFO(0, juliandaycount) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_juliantojd, 0) - ZEND_ARG_INFO(0, month) - ZEND_ARG_INFO(0, day) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_jdtojewish, 0, 0, 1) - ZEND_ARG_INFO(0, juliandaycount) - ZEND_ARG_INFO(0, hebrew) - ZEND_ARG_INFO(0, fl) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_jewishtojd, 0) - ZEND_ARG_INFO(0, month) - ZEND_ARG_INFO(0, day) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_jdtofrench, 0) - ZEND_ARG_INFO(0, juliandaycount) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_frenchtojd, 0) - ZEND_ARG_INFO(0, month) - ZEND_ARG_INFO(0, day) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_jddayofweek, 0, 0, 1) - ZEND_ARG_INFO(0, juliandaycount) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_jdmonthname, 0) - ZEND_ARG_INFO(0, juliandaycount) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_easter_date, 0, 0, 0) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_easter_days, 0, 0, 0) - ZEND_ARG_INFO(0, year) - ZEND_ARG_INFO(0, method) -ZEND_END_ARG_INFO() - -/* }}} */ - -zend_function_entry calendar_functions[] = { - PHP_FE(jdtogregorian, arginfo_jdtogregorian) - PHP_FE(gregoriantojd, arginfo_gregoriantojd) - PHP_FE(jdtojulian, arginfo_jdtojulian) - PHP_FE(juliantojd, arginfo_juliantojd) - PHP_FE(jdtojewish, arginfo_jdtojewish) - PHP_FE(jewishtojd, arginfo_jewishtojd) - PHP_FE(jdtofrench, arginfo_jdtofrench) - PHP_FE(frenchtojd, arginfo_frenchtojd) - PHP_FE(jddayofweek, arginfo_jddayofweek) - PHP_FE(jdmonthname, arginfo_jdmonthname) - PHP_FE(easter_date, arginfo_easter_date) - PHP_FE(easter_days, arginfo_easter_days) - PHP_FE(unixtojd, arginfo_unixtojd) - PHP_FE(jdtounix, arginfo_jdtounix) - PHP_FE(cal_to_jd, arginfo_cal_to_jd) - PHP_FE(cal_from_jd, arginfo_cal_from_jd) - PHP_FE(cal_days_in_month, arginfo_cal_days_in_month) - PHP_FE(cal_info, arginfo_cal_info) - {NULL, NULL, NULL} -}; - - -zend_module_entry calendar_module_entry = { - STANDARD_MODULE_HEADER, - "calendar", - calendar_functions, - PHP_MINIT(calendar), - NULL, - NULL, - NULL, - PHP_MINFO(calendar), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES, -}; - -#ifdef COMPILE_DL_CALENDAR -ZEND_GET_MODULE(calendar) -#endif - -/* this order must match the conversion table below */ -enum cal_name_type_t { - CAL_GREGORIAN = 0, - CAL_JULIAN, - CAL_JEWISH, - CAL_FRENCH, - CAL_NUM_CALS -}; - -typedef long int (*cal_to_jd_func_t) (int month, int day, int year); -typedef void (*cal_from_jd_func_t) (long int jd, int *year, int *month, int *day); -typedef char *(*cal_as_string_func_t) (int year, int month, int day); - -struct cal_entry_t { - char *name; - char *symbol; - cal_to_jd_func_t to_jd; - cal_from_jd_func_t from_jd; - int num_months; - int max_days_in_month; - char **month_name_short; - char **month_name_long; -}; - -static struct cal_entry_t cal_conversion_table[CAL_NUM_CALS] = { - {"Gregorian", "CAL_GREGORIAN", GregorianToSdn, SdnToGregorian, 12, 31, - MonthNameShort, MonthNameLong}, - {"Julian", "CAL_JULIAN", JulianToSdn, SdnToJulian, 12, 31, - MonthNameShort, MonthNameLong}, - {"Jewish", "CAL_JEWISH", JewishToSdn, SdnToJewish, 13, 30, - JewishMonthName, JewishMonthName}, - {"French", "CAL_FRENCH", FrenchToSdn, SdnToFrench, 13, 30, - FrenchMonthName, FrenchMonthName} -}; - -/* For jddayofweek */ -enum { CAL_DOW_DAYNO, CAL_DOW_SHORT, CAL_DOW_LONG }; - -/* For jdmonthname */ -enum { CAL_MONTH_GREGORIAN_SHORT, CAL_MONTH_GREGORIAN_LONG, - CAL_MONTH_JULIAN_SHORT, CAL_MONTH_JULIAN_LONG, CAL_MONTH_JEWISH, - CAL_MONTH_FRENCH -}; - -/* for heb_number_to_chars */ -static char alef_bet[25] = "0àáâãäåæçèéëìîðñòôö÷øùú"; - -#define CAL_JEWISH_ADD_ALAFIM_GERESH 0x2 -#define CAL_JEWISH_ADD_ALAFIM 0x4 -#define CAL_JEWISH_ADD_GERESHAYIM 0x8 - -PHP_MINIT_FUNCTION(calendar) -{ - REGISTER_LONG_CONSTANT("CAL_GREGORIAN", CAL_GREGORIAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JULIAN", CAL_JULIAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JEWISH", CAL_JEWISH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_FRENCH", CAL_FRENCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_NUM_CALS", CAL_NUM_CALS, CONST_CS | CONST_PERSISTENT); -/* constants for jddayofweek */ - REGISTER_LONG_CONSTANT("CAL_DOW_DAYNO", CAL_DOW_DAYNO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_DOW_SHORT", CAL_DOW_SHORT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_DOW_LONG", CAL_DOW_LONG, CONST_CS | CONST_PERSISTENT); -/* constants for jdmonthname */ - REGISTER_LONG_CONSTANT("CAL_MONTH_GREGORIAN_SHORT", CAL_MONTH_GREGORIAN_SHORT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_GREGORIAN_LONG", CAL_MONTH_GREGORIAN_LONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_JULIAN_SHORT", CAL_MONTH_JULIAN_SHORT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_JULIAN_LONG", CAL_MONTH_JULIAN_LONG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_JEWISH", CAL_MONTH_JEWISH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_FRENCH", CAL_MONTH_FRENCH, CONST_CS | CONST_PERSISTENT); -/* constants for easter calculation */ - REGISTER_LONG_CONSTANT("CAL_EASTER_DEFAULT", CAL_EASTER_DEFAULT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_EASTER_ROMAN", CAL_EASTER_ROMAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_EASTER_ALWAYS_GREGORIAN", CAL_EASTER_ALWAYS_GREGORIAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_EASTER_ALWAYS_JULIAN", CAL_EASTER_ALWAYS_JULIAN, CONST_CS | CONST_PERSISTENT); -/* constants for Jewish date formatting */ - REGISTER_LONG_CONSTANT("CAL_JEWISH_ADD_ALAFIM_GERESH", CAL_JEWISH_ADD_ALAFIM_GERESH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JEWISH_ADD_ALAFIM", CAL_JEWISH_ADD_ALAFIM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JEWISH_ADD_GERESHAYIM", CAL_JEWISH_ADD_GERESHAYIM, CONST_CS | CONST_PERSISTENT); - return SUCCESS; -} - -PHP_MINFO_FUNCTION(calendar) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Calendar support", "enabled"); - php_info_print_table_end(); -} - -static void _php_cal_info(int cal, zval **ret) -{ - zval *months, *smonths; - int i; - struct cal_entry_t *calendar; - - calendar = &cal_conversion_table[cal]; - array_init(*ret); - - MAKE_STD_ZVAL(months); - MAKE_STD_ZVAL(smonths); - array_init(months); - array_init(smonths); - - for (i = 1; i <= calendar->num_months; i++) { - add_index_string(months, i, calendar->month_name_long[i], 1); - add_index_string(smonths, i, calendar->month_name_short[i], 1); - } - add_assoc_zval(*ret, "months", months); - add_assoc_zval(*ret, "abbrevmonths", smonths); - add_assoc_long(*ret, "maxdaysinmonth", calendar->max_days_in_month); - add_assoc_string(*ret, "calname", calendar->name, 1); - add_assoc_string(*ret, "calsymbol", calendar->symbol, 1); - -} - -/* {{{ proto array cal_info([int calendar]) - Returns information about a particular calendar */ -PHP_FUNCTION(cal_info) -{ - long cal = -1; - - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &cal) == FAILURE) { - RETURN_FALSE; - } - - if (cal == -1) { - int i; - zval *val; - - array_init(return_value); - - for (i = 0; i < CAL_NUM_CALS; i++) { - MAKE_STD_ZVAL(val); - _php_cal_info(i, &val); - add_index_zval(return_value, i, val); - } - return; - } - - - if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal); - RETURN_FALSE; - } - - _php_cal_info(cal, &return_value); - -} -/* }}} */ - -/* {{{ proto int cal_days_in_month(int calendar, int month, int year) - Returns the number of days in a month for a given year and calendar */ -PHP_FUNCTION(cal_days_in_month) -{ - long cal, month, year; - struct cal_entry_t *calendar; - long sdn_start, sdn_next; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &cal, &month, &year) == FAILURE) { - RETURN_FALSE; - } - - if (cal < 0 || cal >= CAL_NUM_CALS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal); - RETURN_FALSE; - } - - calendar = &cal_conversion_table[cal]; - - sdn_start = calendar->to_jd(year, month, 1); - - if (sdn_start == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid date."); - RETURN_FALSE; - } - - sdn_next = calendar->to_jd(year, 1 + month, 1); - - if (sdn_next == 0) { -/* if invalid, try first month of the next year... */ - sdn_next = calendar->to_jd(year + 1, 1, 1); - } - - RETURN_LONG(sdn_next - sdn_start); -} -/* }}} */ - -/* {{{ proto int cal_to_jd(int calendar, int month, int day, int year) - Converts from a supported calendar to Julian Day Count */ -PHP_FUNCTION(cal_to_jd) -{ - long cal, month, day, year; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &cal, &month, &day, &year) != SUCCESS) { - RETURN_FALSE; - } - - if (cal < 0 || cal >= CAL_NUM_CALS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal); - RETURN_FALSE; - } - - RETURN_LONG(cal_conversion_table[cal].to_jd(year, month, day)); -} -/* }}} */ - -/* {{{ proto array cal_from_jd(int jd, int calendar) - Converts from Julian Day Count to a supported calendar and return extended information */ -PHP_FUNCTION(cal_from_jd) -{ - long jd, cal; - int month, day, year, dow; - char date[16]; - struct cal_entry_t *calendar; - - if (zend_parse_parameters(ZEND_NUM_ARGS()TSRMLS_CC, "ll", &jd, &cal) == FAILURE) { - RETURN_FALSE; - } - - if (cal < 0 || cal >= CAL_NUM_CALS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld", cal); - RETURN_FALSE; - } - calendar = &cal_conversion_table[cal]; - - array_init(return_value); - - calendar->from_jd(jd, &year, &month, &day); - - snprintf(date, sizeof(date), "%i/%i/%i", month, day, year); - add_assoc_string(return_value, "date", date, 1); - - add_assoc_long(return_value, "month", month); - add_assoc_long(return_value, "day", day); - add_assoc_long(return_value, "year", year); - -/* day of week */ - dow = DayOfWeek(jd); - add_assoc_long(return_value, "dow", dow); - add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow], 1); - add_assoc_string(return_value, "dayname", DayNameLong[dow], 1); -/* month name */ - add_assoc_string(return_value, "abbrevmonth", calendar->month_name_short[month], 1); - add_assoc_string(return_value, "monthname", calendar->month_name_long[month], 1); -} -/* }}} */ - -/* {{{ proto string jdtogregorian(int juliandaycount) - Converts a julian day count to a gregorian calendar date */ -PHP_FUNCTION(jdtogregorian) -{ - long julday; - int year, month, day; - char date[16]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) { - RETURN_FALSE; - } - - SdnToGregorian(julday, &year, &month, &day); - snprintf(date, sizeof(date), "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int gregoriantojd(int month, int day, int year) - Converts a gregorian calendar date to julian day count */ -PHP_FUNCTION(gregoriantojd) -{ - long year, month, day; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(GregorianToSdn(year, month, day)); -} -/* }}} */ - -/* {{{ proto string jdtojulian(int juliandaycount) - Convert a julian day count to a julian calendar date */ -PHP_FUNCTION(jdtojulian) -{ - long julday; - int year, month, day; - char date[16]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) { - RETURN_FALSE; - } - - SdnToJulian(julday, &year, &month, &day); - snprintf(date, sizeof(date), "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int juliantojd(int month, int day, int year) - Converts a julian calendar date to julian day count */ -PHP_FUNCTION(juliantojd) -{ - long year, month, day; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(JulianToSdn(year, month, day)); -} -/* }}} */ - -/* {{{ heb_number_to_chars*/ -/* -caution: the Hebrew format produces non unique result. -for example both: year '5' and year '5000' produce 'ä'. -use the numeric one for calculations. - */ -static char *heb_number_to_chars(int n, int fl, char **ret) -{ - char *p, old[18], *endofalafim; - - p = endofalafim = old; -/* - prevents the option breaking the jewish beliefs, and some other - critical resources ;) - */ - if (n > 9999 || n < 1) { - *ret = NULL; - return NULL; - } - -/* alafim (thousands) case */ - if (n / 1000) { - *p = alef_bet[n / 1000]; - p++; - - if (CAL_JEWISH_ADD_ALAFIM_GERESH & fl) { - *p = '\''; - p++; - } - if (CAL_JEWISH_ADD_ALAFIM & fl) { - strcpy(p, " àìôéí "); - p += 7; - } - - endofalafim = p; - n = n % 1000; - } - -/* tav-tav (tav=400) case */ - while (n >= 400) { - *p = alef_bet[22]; - p++; - n -= 400; - } - -/* meot (hundreads) case */ - if (n >= 100) { - *p = alef_bet[18 + n / 100]; - p++; - n = n % 100; - } - -/* tet-vav & tet-zain case (special case for 15 and 16) */ - if (n == 15 || n == 16) { - *p = alef_bet[9]; - p++; - *p = alef_bet[n - 9]; - p++; - } else { -/* asarot (tens) case */ - if (n >= 10) { - *p = alef_bet[9 + n / 10]; - p++; - n = n % 10; - } - -/* yehidot (ones) case */ - if (n > 0) { - *p = alef_bet[n]; - p++; - } - } - - if (CAL_JEWISH_ADD_GERESHAYIM & fl) { - switch (p - endofalafim) { - case 0: - break; - case 1: - *p = '\''; - p++; - break; - default: - *(p) = *(p - 1); - *(p - 1) = '"'; - p++; - } - } - - *p = '\0'; - *ret = estrndup(old, (p - old) + 1); - p = *ret; - return p; -} -/* }}} */ - -/* {{{ proto string jdtojewish(int juliandaycount [, bool hebrew [, int fl]]) - Converts a julian day count to a jewish calendar date */ -PHP_FUNCTION(jdtojewish) -{ - long julday, fl = 0; - zend_bool heb = 0; - int year, month, day; - char date[16], hebdate[32]; - char *dayp, *yearp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|bl", &julday, &heb, &fl) == FAILURE) { - RETURN_FALSE; - } - - SdnToJewish(julday, &year, &month, &day); - if (!heb) { - snprintf(date, sizeof(date), "%i/%i/%i", month, day, year); - RETURN_STRING(date, 1); - } else { - if (year <= 0 || year > 9999) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Year out of range (0-9999)."); - RETURN_FALSE; - } - - snprintf(hebdate, sizeof(hebdate), "%s %s %s", heb_number_to_chars(day, fl, &dayp), JewishMonthHebName[month], heb_number_to_chars(year, fl, &yearp)); - - if (dayp) { - efree(dayp); - } - if (yearp) { - efree(yearp); - } - - RETURN_STRING(hebdate, 1); - - } -} -/* }}} */ - -/* {{{ proto int jewishtojd(int month, int day, int year) - Converts a jewish calendar date to a julian day count */ -PHP_FUNCTION(jewishtojd) -{ - long year, month, day; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(JewishToSdn(year, month, day)); -} -/* }}} */ - -/* {{{ proto string jdtofrench(int juliandaycount) - Converts a julian day count to a french republic calendar date */ -PHP_FUNCTION(jdtofrench) -{ - long julday; - int year, month, day; - char date[16]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) { - RETURN_FALSE; - } - - SdnToFrench(julday, &year, &month, &day); - snprintf(date, sizeof(date), "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int frenchtojd(int month, int day, int year) - Converts a french republic calendar date to julian day count */ -PHP_FUNCTION(frenchtojd) -{ - long year, month, day; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(FrenchToSdn(year, month, day)); -} -/* }}} */ - -/* {{{ proto mixed jddayofweek(int juliandaycount [, int mode]) - Returns name or number of day of week from julian day count */ -PHP_FUNCTION(jddayofweek) -{ - long julday, mode = CAL_DOW_DAYNO; - int day; - char *daynamel, *daynames; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &julday, &mode) == FAILURE) { - RETURN_FALSE; - } - - day = DayOfWeek(julday); - daynamel = DayNameLong[day]; - daynames = DayNameShort[day]; - - switch (mode) { - case CAL_DOW_SHORT: - RETURN_STRING(daynamel, 1); - break; - case CAL_DOW_LONG: - RETURN_STRING(daynames, 1); - break; - case CAL_DOW_DAYNO: - default: - RETURN_LONG(day); - break; - } -} -/* }}} */ - -/* {{{ proto string jdmonthname(int juliandaycount, int mode) - Returns name of month for julian day count */ -PHP_FUNCTION(jdmonthname) -{ - long julday, mode; - char *monthname = NULL; - int month, day, year; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &julday, &mode) == FAILURE) { - RETURN_FALSE; - } - - switch (mode) { - case CAL_MONTH_GREGORIAN_LONG: /* gregorian or julian month */ - SdnToGregorian(julday, &year, &month, &day); - monthname = MonthNameLong[month]; - break; - case CAL_MONTH_JULIAN_SHORT: /* gregorian or julian month */ - SdnToJulian(julday, &year, &month, &day); - monthname = MonthNameShort[month]; - break; - case CAL_MONTH_JULIAN_LONG: /* gregorian or julian month */ - SdnToJulian(julday, &year, &month, &day); - monthname = MonthNameLong[month]; - break; - case CAL_MONTH_JEWISH: /* jewish month */ - SdnToJewish(julday, &year, &month, &day); - monthname = JewishMonthName[month]; - break; - case CAL_MONTH_FRENCH: /* french month */ - SdnToFrench(julday, &year, &month, &day); - monthname = FrenchMonthName[month]; - break; - default: /* default gregorian */ - case CAL_MONTH_GREGORIAN_SHORT: /* gregorian or julian month */ - SdnToGregorian(julday, &year, &month, &day); - monthname = MonthNameShort[month]; - break; - } - - RETURN_STRING(monthname, 1); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/config.m4 b/ext/calendar/config.m4 deleted file mode 100644 index a80101adbb0f9..0000000000000 --- a/ext/calendar/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(calendar,whether to enable calendar conversion support, -[ --enable-calendar Enable support for calendar conversion]) - -if test "$PHP_CALENDAR" = "yes"; then - AC_DEFINE(HAVE_CALENDAR,1,[ ]) - PHP_NEW_EXTENSION(calendar, calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c, $ext_shared) -fi diff --git a/ext/calendar/config.w32 b/ext/calendar/config.w32 deleted file mode 100644 index bd9faba46a08c..0000000000000 --- a/ext/calendar/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("calendar", "calendar conversion support", "yes"); - -if (PHP_CALENDAR == "yes") { - EXTENSION("calendar", "calendar.c dow.c french.c gregor.c jewish.c \ - julian.c easter.c cal_unix.c"); - AC_DEFINE('HAVE_CALENDAR', 1, 'Have calendar'); -} diff --git a/ext/calendar/dow.c b/ext/calendar/dow.c deleted file mode 100644 index 64ae008f77716..0000000000000 --- a/ext/calendar/dow.c +++ /dev/null @@ -1,76 +0,0 @@ - -/* $selId: dow.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * int - * DayOfWeek( - * long int sdn); - * - * Convert a SDN to a day-of-week number (0 to 6). Where 0 stands for - * Sunday, 1 for Monday, etc. and 6 stands for Saturday. - * - * char *DayNameShort[7]; - * - * Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to - * the abbreviated (three character) name of the day. - * - * char *DayNameLong[7]; - * - * Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to - * the name of the day. - * - **************************************************************************/ - -#include "sdncal.h" - -int DayOfWeek( - long int sdn) -{ - int dow; - - dow = (sdn + 1) % 7; - if (dow >= 0) { - return (dow); - } else { - return (dow + 7); - } -} - -char *DayNameShort[7] = -{ - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat" -}; - -char *DayNameLong[7] = -{ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c deleted file mode 100644 index bd787de424271..0000000000000 --- a/ext/calendar/easter.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Shane Caraveo | - | Colin Viebrock | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id: */ - -#include "php.h" -#include "php_calendar.h" -#include "sdncal.h" -#include - -static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm) -{ - - /* based on code by Simon Kershaw, */ - - struct tm te; - long year, golden, solar, lunar, pfm, dom, tmp, easter; - long method = CAL_EASTER_DEFAULT; - - /* Default to the current year if year parameter is not given */ - { - time_t a; - struct tm b, *res; - time(&a); - res = php_localtime_r(&a, &b); - if (!res) { - year = 1900; - } else { - year = 1900 + b.tm_year; - } - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "|ll", &year, &method) == FAILURE) { - return; - } - - if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is only valid for years between 1970 and 2037 inclusive"); - RETURN_FALSE; - } - - golden = (year % 19) + 1; /* the Golden number */ - - if ((year <= 1582 && method != CAL_EASTER_ALWAYS_GREGORIAN) || - (year >= 1583 && year <= 1752 && method != CAL_EASTER_ROMAN && method != CAL_EASTER_ALWAYS_GREGORIAN) || - method == CAL_EASTER_ALWAYS_JULIAN) { /* JULIAN CALENDAR */ - - dom = (year + (year/4) + 5) % 7; /* the "Dominical number" - finding a Sunday */ - if (dom < 0) { - dom += 7; - } - - pfm = (3 - (11*golden) - 7) % 30; /* uncorrected date of the Paschal full moon */ - if (pfm < 0) { - pfm += 30; - } - } else { /* GREGORIAN CALENDAR */ - dom = (year + (year/4) - (year/100) + (year/400)) % 7; /* the "Domincal number" */ - if (dom < 0) { - dom += 7; - } - - solar = (year-1600)/100 - (year-1600)/400; /* the solar and lunar corrections */ - lunar = (((year-1400) / 100) * 8) / 25; - - pfm = (3 - (11*golden) + solar - lunar) % 30; /* uncorrected date of the Paschal full moon */ - if (pfm < 0) { - pfm += 30; - } - } - - if ((pfm == 29) || (pfm == 28 && golden > 11)) { /* corrected date of the Paschal full moon */ - pfm--; /* - days after 21st March */ - } - - tmp = (4-pfm-dom) % 7; - if (tmp < 0) { - tmp += 7; - } - - easter = pfm + tmp + 1; /* Easter as the number of days after 21st March */ - - if (gm) { /* return a timestamp */ - te.tm_isdst = -1; - te.tm_year = year-1900; - te.tm_sec = 0; - te.tm_min = 0; - te.tm_hour = 0; - - if (easter < 11) { - te.tm_mon = 2; /* March */ - te.tm_mday = easter+21; - } else { - te.tm_mon = 3; /* April */ - te.tm_mday = easter-10; - } - - Z_LVAL_P(return_value) = mktime(&te); - } else { /* return the days after March 21 */ - Z_LVAL_P(return_value) = easter; - } - - Z_TYPE_P(return_value) = IS_LONG; - -} - -/* {{{ proto int easter_date([int year]) - Return the timestamp of midnight on Easter of a given year (defaults to current year) */ -PHP_FUNCTION(easter_date) -{ - _cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int easter_days([int year, [int method]]) - Return the number of days after March 21 that Easter falls on for a given year (defaults to current year) */ -PHP_FUNCTION(easter_days) -{ - _cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/calendar/french.c b/ext/calendar/french.c deleted file mode 100644 index 5b4dd53750659..0000000000000 --- a/ext/calendar/french.c +++ /dev/null @@ -1,160 +0,0 @@ -/* $selId: french.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToFrench( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a French republican calendar date. If the input SDN is - * before the first day of year 1 or after the last day of year 14, the - * three output values will all be set to zero, otherwise *pYear will be in - * the range 1 to 14 inclusive; *pMonth will be in the range 1 to 13 - * inclusive; *pDay will be in the range 1 to 30 inclusive. If *pMonth is - * 13, the SDN represents one of the holidays at the end of the year and - * *pDay will be in the range 1 to 6 inclusive. - * - * long int - * FrenchToSdn( - * int year, - * int month, - * int day); - * - * Convert a French republican calendar date to a SDN. Zero is returned - * when the input date is detected as invalid or out of the supported - * range. The return value will be > 0 for all valid, supported dates, but - * there are some invalid dates that will return a positive value. To - * verify that a date is valid, convert it to SDN and then back and compare - * with the original. - * - * char *FrenchMonthName[14]; - * - * Convert a French republican month number (1 to 13) to the name of the - * French republican month (null terminated). An index of 13 (for the - * "extra" days at the end of the year) will return the string "Extra". An - * index of zero will return a zero length string. - * - * VALID RANGE - * - * These routines only convert dates in years 1 through 14 (Gregorian - * dates 22 September 1792 through 22 September 1806). This more than - * covers the period when the calendar was in use. - * - * I would support a wider range of dates, but I have not been able to - * find an authoritative definition of when leap years were to have - * occurred. There are suggestions that it was to skip a leap year ever - * 100 years like the Gregorian calendar. - * - * CALENDAR OVERVIEW - * - * The French republican calendar was adopted in October 1793 during - * the French Revolution and was abandoned in January 1806. The intent - * was to create a new calendar system that was based on scientific - * principals, not religious traditions. - * - * The year is divided into 12 months of 30 days each. The remaining 5 - * to 6 days in the year are grouped at the end and are holidays. Each - * month is divided into three decades (instead of weeks) of 10 days - * each. - * - * The epoch (first day of the first year) is 22 September 1792 in the - * Gregorian calendar. Leap years are every fourth year (year 3, 7, - * 11, etc.) - * - * TESTING - * - * This algorithm has been tested from the year 1 to 14. The source - * code of the verification program is included in this package. - * - * REFERENCES - * - * I have found no detailed, authoritative reference on this calendar. - * The algorithms are based on a preponderance of less authoritative - * sources. - * - **************************************************************************/ - -#include "sdncal.h" - -#define FRENCH_SDN_OFFSET 2375474 -#define DAYS_PER_4_YEARS 1461 -#define DAYS_PER_MONTH 30 -#define FIRST_VALID 2375840 -#define LAST_VALID 2380952 - -void SdnToFrench( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - long int temp; - int dayOfYear; - - if (sdn < FIRST_VALID || sdn > LAST_VALID) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - temp = (sdn - FRENCH_SDN_OFFSET) * 4 - 1; - *pYear = temp / DAYS_PER_4_YEARS; - dayOfYear = (temp % DAYS_PER_4_YEARS) / 4; - *pMonth = dayOfYear / DAYS_PER_MONTH + 1; - *pDay = dayOfYear % DAYS_PER_MONTH + 1; -} - -long int FrenchToSdn( - int year, - int month, - int day) -{ - /* check for invalid dates */ - if (year < 1 || year > 14 || - month < 1 || month > 13 || - day < 1 || day > 30) { - return (0); - } - return ((year * DAYS_PER_4_YEARS) / 4 - + (month - 1) * DAYS_PER_MONTH - + day - + FRENCH_SDN_OFFSET); -} - -char *FrenchMonthName[14] = -{ - "", - "Vendemiaire", - "Brumaire", - "Frimaire", - "Nivose", - "Pluviose", - "Ventose", - "Germinal", - "Floreal", - "Prairial", - "Messidor", - "Thermidor", - "Fructidor", - "Extra" -}; - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/gregor.c b/ext/calendar/gregor.c deleted file mode 100644 index c9c0bf761b438..0000000000000 --- a/ext/calendar/gregor.c +++ /dev/null @@ -1,272 +0,0 @@ -/* $selId: gregor.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToGregorian( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a Gregorian calendar date. If the input SDN is less - * than 1, the three output values will all be set to zero, otherwise - * *pYear will be >= -4714 and != 0; *pMonth will be in the range 1 to 12 - * inclusive; *pDay will be in the range 1 to 31 inclusive. - * - * long int - * GregorianToSdn( - * int inputYear, - * int inputMonth, - * int inputDay); - * - * Convert a Gregorian calendar date to a SDN. Zero is returned when the - * input date is detected as invalid or out of the supported range. The - * return value will be > 0 for all valid, supported dates, but there are - * some invalid dates that will return a positive value. To verify that a - * date is valid, convert it to SDN and then back and compare with the - * original. - * - * char *MonthNameShort[13]; - * - * Convert a Gregorian month number (1 to 12) to the abbreviated (three - * character) name of the Gregorian month (null terminated). An index of - * zero will return a zero length string. - * - * char *MonthNameLong[13]; - * - * Convert a Gregorian month number (1 to 12) to the name of the Gregorian - * month (null terminated). An index of zero will return a zero length - * string. - * - * VALID RANGE - * - * 4714 B.C. to at least 10000 A.D. - * - * Although this software can handle dates all the way back to 4714 - * B.C., such use may not be meaningful. The Gregorian calendar was - * not instituted until October 15, 1582 (or October 5, 1582 in the - * Julian calendar). Some countries did not accept it until much - * later. For example, Britain converted in 1752, The USSR in 1918 and - * Greece in 1923. Most European countries used the Julian calendar - * prior to the Gregorian. - * - * CALENDAR OVERVIEW - * - * The Gregorian calendar is a modified version of the Julian calendar. - * The only difference being the specification of leap years. The - * Julian calendar specifies that every year that is a multiple of 4 - * will be a leap year. This leads to a year that is 365.25 days long, - * but the current accepted value for the tropical year is 365.242199 - * days. - * - * To correct this error in the length of the year and to bring the - * vernal equinox back to March 21, Pope Gregory XIII issued a papal - * bull declaring that Thursday October 4, 1582 would be followed by - * Friday October 15, 1582 and that centennial years would only be a - * leap year if they were a multiple of 400. This shortened the year - * by 3 days per 400 years, giving a year of 365.2425 days. - * - * Another recently proposed change in the leap year rule is to make - * years that are multiples of 4000 not a leap year, but this has never - * been officially accepted and this rule is not implemented in these - * algorithms. - * - * ALGORITHMS - * - * The calculations are based on three different cycles: a 400 year - * cycle of leap years, a 4 year cycle of leap years and a 5 month - * cycle of month lengths. - * - * The 5 month cycle is used to account for the varying lengths of - * months. You will notice that the lengths alternate between 30 - * and 31 days, except for three anomalies: both July and August - * have 31 days, both December and January have 31, and February - * is less than 30. Starting with March, the lengths are in a - * cycle of 5 months (31, 30, 31, 30, 31): - * - * Mar 31 days \ - * Apr 30 days | - * May 31 days > First cycle - * Jun 30 days | - * Jul 31 days / - * - * Aug 31 days \ - * Sep 30 days | - * Oct 31 days > Second cycle - * Nov 30 days | - * Dec 31 days / - * - * Jan 31 days \ - * Feb 28/9 days | - * > Third cycle (incomplete) - * - * For this reason the calculations (internally) assume that the - * year starts with March 1. - * - * TESTING - * - * This algorithm has been tested from the year 4714 B.C. to 10000 - * A.D. The source code of the verification program is included in - * this package. - * - * REFERENCES - * - * Conversions Between Calendar Date and Julian Day Number by Robert J. - * Tantzen, Communications of the Association for Computing Machinery - * August 1963. (Also published in Collected Algorithms from CACM, - * algorithm number 199). - * - **************************************************************************/ - -#include "sdncal.h" - -#define GREGOR_SDN_OFFSET 32045 -#define DAYS_PER_5_MONTHS 153 -#define DAYS_PER_4_YEARS 1461 -#define DAYS_PER_400_YEARS 146097 - -void SdnToGregorian( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - int century; - int year; - int month; - int day; - long int temp; - int dayOfYear; - - if (sdn <= 0) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - temp = (sdn + GREGOR_SDN_OFFSET) * 4 - 1; - - if (temp < 0) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - - /* Calculate the century (year/100). */ - century = temp / DAYS_PER_400_YEARS; - - /* Calculate the year and day of year (1 <= dayOfYear <= 366). */ - temp = ((temp % DAYS_PER_400_YEARS) / 4) * 4 + 3; - year = (century * 100) + (temp / DAYS_PER_4_YEARS); - dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1; - - /* Calculate the month and day of month. */ - temp = dayOfYear * 5 - 3; - month = temp / DAYS_PER_5_MONTHS; - day = (temp % DAYS_PER_5_MONTHS) / 5 + 1; - - /* Convert to the normal beginning of the year. */ - if (month < 10) { - month += 3; - } else { - year += 1; - month -= 9; - } - - /* Adjust to the B.C./A.D. type numbering. */ - year -= 4800; - if (year <= 0) - year--; - - *pYear = year; - *pMonth = month; - *pDay = day; -} - -long int GregorianToSdn( - int inputYear, - int inputMonth, - int inputDay) -{ - int year; - int month; - - /* check for invalid dates */ - if (inputYear == 0 || inputYear < -4714 || - inputMonth <= 0 || inputMonth > 12 || - inputDay <= 0 || inputDay > 31) { - return (0); - } - /* check for dates before SDN 1 (Nov 25, 4714 B.C.) */ - if (inputYear == -4714) { - if (inputMonth < 11) { - return (0); - } - if (inputMonth == 11 && inputDay < 25) { - return (0); - } - } - /* Make year always a positive number. */ - if (inputYear < 0) { - year = inputYear + 4801; - } else { - year = inputYear + 4800; - } - - /* Adjust the start of the year. */ - if (inputMonth > 2) { - month = inputMonth - 3; - } else { - month = inputMonth + 9; - year--; - } - - return (((year / 100) * DAYS_PER_400_YEARS) / 4 - + ((year % 100) * DAYS_PER_4_YEARS) / 4 - + (month * DAYS_PER_5_MONTHS + 2) / 5 - + inputDay - - GREGOR_SDN_OFFSET); -} - -char *MonthNameShort[13] = -{ - "", - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" -}; - -char *MonthNameLong[13] = -{ - "", - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" -}; diff --git a/ext/calendar/jewish.c b/ext/calendar/jewish.c deleted file mode 100644 index f4dc7c35ae57c..0000000000000 --- a/ext/calendar/jewish.c +++ /dev/null @@ -1,763 +0,0 @@ -/* $selId: jewish.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToJewish( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a Jewish calendar date. If the input SDN is before the - * first day of year 1, the three output values will all be set to zero, - * otherwise *pYear will be > 0; *pMonth will be in the range 1 to 13 - * inclusive; *pDay will be in the range 1 to 30 inclusive. Note that Adar - * II is assigned the month number 7 and Elul is always 13. - * - * long int - * JewishToSdn( - * int year, - * int month, - * int day); - * - * Convert a Jewish calendar date to a SDN. Zero is returned when the - * input date is detected as invalid or out of the supported range. The - * return value will be > 0 for all valid, supported dates, but there are - * some invalid dates that will return a positive value. To verify that a - * date is valid, convert it to SDN and then back and compare with the - * original. - * - * char *JewishMonthName[14]; - * - * Convert a Jewish month number (1 to 13) to the name of the Jewish month - * (null terminated). An index of zero will return a zero length string. - * - * VALID RANGE - * - * Although this software can handle dates all the way back to the year - * 1 (3761 B.C.), such use may not be meaningful. - * - * The Jewish calendar has been in use for several thousand years, but - * in the early days there was no formula to determine the start of a - * month. A new month was started when the new moon was first - * observed. - * - * It is not clear when the current rule based calendar replaced the - * observation based calendar. According to the book "Jewish Calendar - * Mystery Dispelled" by George Zinberg, the patriarch Hillel II - * published these rules in 358 A.D. But, according to The - * Encyclopedia Judaica, Hillel II may have only published the 19 year - * rule for determining the occurrence of leap years. - * - * I have yet to find a specific date when the current set of rules - * were known to be in use. - * - * CALENDAR OVERVIEW - * - * The Jewish calendar is based on lunar as well as solar cycles. A - * month always starts on or near a new moon and has either 29 or 30 - * days (a lunar cycle is about 29 1/2 days). Twelve of these - * alternating 29-30 day months gives a year of 354 days, which is - * about 11 1/4 days short of a solar year. - * - * Since a month is defined to be a lunar cycle (new moon to new moon), - * this 11 1/4 day difference cannot be overcome by adding days to a - * month as with the Gregorian calendar, so an entire month is - * periodically added to the year, making some years 13 months long. - * - * For astronomical as well as ceremonial reasons, the start of a new - * year may be delayed until a day or two after the new moon causing - * years to vary in length. Leap years can be from 383 to 385 days and - * common years can be from 353 to 355 days. These are the months of - * the year and their possible lengths: - * - * COMMON YEAR LEAP YEAR - * 1 Tishri 30 30 30 30 30 30 - * 2 Heshvan 29 29 30 29 29 30 (variable) - * 3 Kislev 29 30 30 29 30 30 (variable) - * 4 Tevet 29 29 29 29 29 29 - * 5 Shevat 30 30 30 30 30 30 - * 6 Adar I 29 29 29 30 30 30 (variable) - * 7 Adar II -- -- -- 29 29 29 (optional) - * 8 Nisan 30 30 30 30 30 30 - * 9 Iyyar 29 29 29 29 29 29 - * 10 Sivan 30 30 30 30 30 30 - * 11 Tammuz 29 29 29 29 29 29 - * 12 Av 30 30 30 30 30 30 - * 13 Elul 29 29 29 29 29 29 - * --- --- --- --- --- --- - * 353 354 355 383 384 385 - * - * Note that the month names and other words that appear in this file - * have multiple possible spellings in the Roman character set. I have - * chosen to use the spellings found in the Encyclopedia Judaica. - * - * Adar II, the month added for leap years, is sometimes referred to as - * the 13th month, but I have chosen to assign it the number 7 to keep - * the months in chronological order. This may not be consistent with - * other numbering schemes. - * - * Leap years occur in a fixed pattern of 19 years called the metonic - * cycle. The 3rd, 6th, 8th, 11th, 14th, 17th and 19th years of this - * cycle are leap years. The first metonic cycle starts with Jewish - * year 1, or 3761/60 B.C. This is believed to be the year of - * creation. - * - * To construct the calendar for a year, you must first find the length - * of the year by determining the first day of the year (Tishri 1, or - * Rosh Ha-Shanah) and the first day of the following year. This - * selects one of the six possible month length configurations listed - * above. - * - * Finding the first day of the year is the most difficult part. - * Finding the date and time of the new moon (or molad) is the first - * step. For this purpose, the lunar cycle is assumed to be 29 days 12 - * hours and 793 halakim. A halakim is 1/1080th of an hour or 3 1/3 - * seconds. (This assumed value is only about 1/2 second less than the - * value used by modern astronomers -- not bad for a number that was - * determined so long ago.) The first molad of year 1 occurred on - * Sunday at 11:20:11 P.M. This would actually be Monday, because the - * Jewish day is considered to begin at sunset. - * - * Since sunset varies, the day is assumed to begin at 6:00 P.M. for - * calendar calculation purposes. So, the first molad was 5 hours 793 - * halakim after the start of Tishri 1, 0001 (which was Monday - * September 7, 4761 B.C. by the Gregorian calendar). All subsequent - * molads can be calculated from this starting point by adding the - * length of a lunar cycle. - * - * Once the molad that starts a year is determined the actual start of - * the year (Tishri 1) can be determined. Tishri 1 will be the day of - * the molad unless it is delayed by one of the following four rules - * (called dehiyyot). Each rule can delay the start of the year by one - * day, and since rule #1 can combine with one of the other rules, it - * can be delayed as much as two days. - * - * 1. Tishri 1 must never be Sunday, Wednesday or Friday. (This - * is largely to prevent certain holidays from occurring on the - * day before or after the Sabbath.) - * - * 2. If the molad occurs on or after noon, Tishri 1 must be - * delayed. - * - * 3. If it is a common (not leap) year and the molad occurs on - * Tuesday at or after 3:11:20 A.M., Tishri 1 must be delayed. - * - * 4. If it is the year following a leap year and the molad occurs - * on Monday at or after 9:32:43 and 1/3 sec, Tishri 1 must be - * delayed. - * - * GLOSSARY - * - * dehiyyot The set of 4 rules that determine when the new year - * starts relative to the molad. - * - * halakim 1/1080th of an hour or 3 1/3 seconds. - * - * lunar cycle The period of time between mean conjunctions of the - * sun and moon (new moon to new moon). This is - * assumed to be 29 days 12 hours and 793 halakim for - * calendar purposes. - * - * metonic cycle A 19 year cycle which determines which years are - * leap years and which are common years. The 3rd, - * 6th, 8th, 11th, 14th, 17th and 19th years of this - * cycle are leap years. - * - * molad The date and time of the mean conjunction of the - * sun and moon (new moon). This is the approximate - * beginning of a month. - * - * Rosh Ha-Shanah The first day of the Jewish year (Tishri 1). - * - * Tishri The first month of the Jewish year. - * - * ALGORITHMS - * - * SERIAL DAY NUMBER TO JEWISH DATE - * - * The simplest approach would be to use the rules stated above to find - * the molad of Tishri before and after the given day number. Then use - * the molads to find Tishri 1 of the current and following years. - * From this the length of the year can be determined and thus the - * length of each month. But this method is used as a last resort. - * - * The first 59 days of the year are the same regardless of the length - * of the year. As a result, only the day number of the start of the - * year is required. - * - * Similarly, the last 6 months do not change from year to year. And - * since it can be determined whether the year is a leap year by simple - * division, the lengths of Adar I and II can be easily calculated. In - * fact, all dates after the 3rd month are consistent from year to year - * (once it is known whether it is a leap year). - * - * This means that if the given day number falls in the 3rd month or on - * the 30th day of the 2nd month the length of the year must be found, - * but in no other case. - * - * So, the approach used is to take the given day number and round it - * to the closest molad of Tishri (first new moon of the year). The - * rounding is not really to the *closest* molad, but is such that if - * the day number is before the middle of the 3rd month the molad at - * the start of the year is found, otherwise the molad at the end of - * the year is found. - * - * Only if the day number is actually found to be in the ambiguous - * period of 29 to 31 days is the other molad calculated. - * - * JEWISH DATE TO SERIAL DAY NUMBER - * - * The year number is used to find which 19 year metonic cycle contains - * the date and which year within the cycle (this is a division and - * modulus). This also determines whether it is a leap year. - * - * If the month is 1 or 2, the calculation is simple addition to the - * first of the year. - * - * If the month is 8 (Nisan) or greater, the calculation is simple - * subtraction from beginning of the following year. - * - * If the month is 4 to 7, it is considered whether it is a leap year - * and then simple subtraction from the beginning of the following year - * is used. - * - * Only if it is the 3rd month is both the start and end of the year - * required. - * - * TESTING - * - * This algorithm has been tested in two ways. First, 510 dates from a - * table in "Jewish Calendar Mystery Dispelled" were calculated and - * compared to the table. Second, the calculation algorithm described - * in "Jewish Calendar Mystery Dispelled" was coded and used to verify - * all dates from the year 1 (3761 B.C.) to the year 13760 (10000 - * A.D.). - * - * The source code of the verification program is included in this - * package. - * - * REFERENCES - * - * The Encyclopedia Judaica, the entry for "Calendar" - * - * The Jewish Encyclopedia - * - * Jewish Calendar Mystery Dispelled by George Zinberg, Vantage Press, - * 1963 - * - * The Comprehensive Hebrew Calendar by Arthur Spier, Behrman House - * - * The Book of Calendars [note that this work contains many typos] - * - **************************************************************************/ - -#if defined(PHP_WIN32) && _MSC_VER >= 1200 -#pragma setlocale("english") -#endif - -#include "sdncal.h" - -#define HALAKIM_PER_HOUR 1080 -#define HALAKIM_PER_DAY 25920 -#define HALAKIM_PER_LUNAR_CYCLE ((29 * HALAKIM_PER_DAY) + 13753) -#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7)) - -#define JEWISH_SDN_OFFSET 347997 -#define NEW_MOON_OF_CREATION 31524 - -#define SUNDAY 0 -#define MONDAY 1 -#define TUESDAY 2 -#define WEDNESDAY 3 -#define THURSDAY 4 -#define FRIDAY 5 -#define SATURDAY 6 - -#define NOON (18 * HALAKIM_PER_HOUR) -#define AM3_11_20 ((9 * HALAKIM_PER_HOUR) + 204) -#define AM9_32_43 ((15 * HALAKIM_PER_HOUR) + 589) - -static int monthsPerYear[19] = -{ -12, 12, 13, 12, 12, 13, 12, 13, 12, 12, 13, 12, 12, 13, 12, 12, 13, 12, 13 -}; - -static int yearOffset[19] = -{ - 0, 12, 24, 37, 49, 61, 74, 86, 99, 111, 123, - 136, 148, 160, 173, 185, 197, 210, 222 -}; - -char *JewishMonthName[14] = -{ - "", - "Tishri", - "Heshvan", - "Kislev", - "Tevet", - "Shevat", - "AdarI", - "AdarII", - "Nisan", - "Iyyar", - "Sivan", - "Tammuz", - "Av", - "Elul" -}; - -char *JewishMonthHebName[14] = -{ - "", - "úùøé", - "çùåï", - "ëñìå", - "èáú", - "ùáè", - "àãø", - "'àãø á", - "ðéñï", - "àééø", - "ñéåï", - "úîåæ", - "àá", - "àìåì" -}; - -/************************************************************************ - * Given the year within the 19 year metonic cycle and the time of a molad - * (new moon) which starts that year, this routine will calculate what day - * will be the actual start of the year (Tishri 1 or Rosh Ha-Shanah). This - * first day of the year will be the day of the molad unless one of 4 rules - * (called dehiyyot) delays it. These 4 rules can delay the start of the - * year by as much as 2 days. - */ -static long int Tishri1( - int metonicYear, - long int moladDay, - long int moladHalakim) -{ - long int tishri1; - int dow; - int leapYear; - int lastWasLeapYear; - - tishri1 = moladDay; - dow = tishri1 % 7; - leapYear = metonicYear == 2 || metonicYear == 5 || metonicYear == 7 - || metonicYear == 10 || metonicYear == 13 || metonicYear == 16 - || metonicYear == 18; - lastWasLeapYear = metonicYear == 3 || metonicYear == 6 - || metonicYear == 8 || metonicYear == 11 || metonicYear == 14 - || metonicYear == 17 || metonicYear == 0; - - /* Apply rules 2, 3 and 4. */ - if ((moladHalakim >= NOON) || - ((!leapYear) && dow == TUESDAY && moladHalakim >= AM3_11_20) || - (lastWasLeapYear && dow == MONDAY && moladHalakim >= AM9_32_43)) { - tishri1++; - dow++; - if (dow == 7) { - dow = 0; - } - } - /* Apply rule 1 after the others because it can cause an additional - * delay of one day. */ - if (dow == WEDNESDAY || dow == FRIDAY || dow == SUNDAY) { - tishri1++; - } - return (tishri1); -} - -/************************************************************************ - * Given a metonic cycle number, calculate the date and time of the molad - * (new moon) that starts that cycle. Since the length of a metonic cycle - * is a constant, this is a simple calculation, except that it requires an - * intermediate value which is bigger that 32 bits. Because this - * intermediate value only needs 36 to 37 bits and the other numbers are - * constants, the process has been reduced to just a few steps. - */ -static void MoladOfMetonicCycle( - int metonicCycle, - long int *pMoladDay, - long int *pMoladHalakim) -{ - register unsigned long int r1, r2, d1, d2; - - /* Start with the time of the first molad after creation. */ - r1 = NEW_MOON_OF_CREATION; - - /* Calculate metonicCycle * HALAKIM_PER_METONIC_CYCLE. The upper 32 - * bits of the result will be in r2 and the lower 16 bits will be - * in r1. */ - r1 += metonicCycle * (HALAKIM_PER_METONIC_CYCLE & 0xFFFF); - r2 = r1 >> 16; - r2 += metonicCycle * ((HALAKIM_PER_METONIC_CYCLE >> 16) & 0xFFFF); - - /* Calculate r2r1 / HALAKIM_PER_DAY. The remainder will be in r1, the - * upper 16 bits of the quotient will be in d2 and the lower 16 bits - * will be in d1. */ - d2 = r2 / HALAKIM_PER_DAY; - r2 -= d2 * HALAKIM_PER_DAY; - r1 = (r2 << 16) | (r1 & 0xFFFF); - d1 = r1 / HALAKIM_PER_DAY; - r1 -= d1 * HALAKIM_PER_DAY; - - *pMoladDay = (d2 << 16) | d1; - *pMoladHalakim = r1; -} - -/************************************************************************ - * Given a day number, find the molad of Tishri (the new moon at the start - * of a year) which is closest to that day number. It's not really the - * *closest* molad that we want here. If the input day is in the first two - * months, we want the molad at the start of the year. If the input day is - * in the fourth to last months, we want the molad at the end of the year. - * If the input day is in the third month, it doesn't matter which molad is - * returned, because both will be required. This type of "rounding" allows - * us to avoid calculating the length of the year in most cases. - */ -static void FindTishriMolad( - long int inputDay, - int *pMetonicCycle, - int *pMetonicYear, - long int *pMoladDay, - long int *pMoladHalakim) -{ - long int moladDay; - long int moladHalakim; - int metonicCycle; - int metonicYear; - - /* Estimate the metonic cycle number. Note that this may be an under - * estimate because there are 6939.6896 days in a metonic cycle not - * 6940, but it will never be an over estimate. The loop below will - * correct for any error in this estimate. */ - metonicCycle = (inputDay + 310) / 6940; - - /* Calculate the time of the starting molad for this metonic cycle. */ - MoladOfMetonicCycle(metonicCycle, &moladDay, &moladHalakim); - - /* If the above was an under estimate, increment the cycle number until - * the correct one is found. For modern dates this loop is about 98.6% - * likely to not execute, even once, because the above estimate is - * really quite close. */ - while (moladDay < inputDay - 6940 + 310) { - metonicCycle++; - moladHalakim += HALAKIM_PER_METONIC_CYCLE; - moladDay += moladHalakim / HALAKIM_PER_DAY; - moladHalakim = moladHalakim % HALAKIM_PER_DAY; - } - - /* Find the molad of Tishri closest to this date. */ - for (metonicYear = 0; metonicYear < 18; metonicYear++) { - if (moladDay > inputDay - 74) { - break; - } - moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear]; - moladDay += moladHalakim / HALAKIM_PER_DAY; - moladHalakim = moladHalakim % HALAKIM_PER_DAY; - } - - *pMetonicCycle = metonicCycle; - *pMetonicYear = metonicYear; - *pMoladDay = moladDay; - *pMoladHalakim = moladHalakim; -} - -/************************************************************************ - * Given a year, find the number of the first day of that year and the date - * and time of the starting molad. - */ -static void FindStartOfYear( - int year, - int *pMetonicCycle, - int *pMetonicYear, - long int *pMoladDay, - long int *pMoladHalakim, - int *pTishri1) -{ - *pMetonicCycle = (year - 1) / 19; - *pMetonicYear = (year - 1) % 19; - MoladOfMetonicCycle(*pMetonicCycle, pMoladDay, pMoladHalakim); - - *pMoladHalakim += HALAKIM_PER_LUNAR_CYCLE * yearOffset[*pMetonicYear]; - *pMoladDay += *pMoladHalakim / HALAKIM_PER_DAY; - *pMoladHalakim = *pMoladHalakim % HALAKIM_PER_DAY; - - *pTishri1 = Tishri1(*pMetonicYear, *pMoladDay, *pMoladHalakim); -} - -/************************************************************************ - * Given a serial day number (SDN), find the corresponding year, month and - * day in the Jewish calendar. The three output values will always be - * modified. If the input SDN is before the first day of year 1, they will - * all be set to zero, otherwise *pYear will be > 0; *pMonth will be in the - * range 1 to 13 inclusive; *pDay will be in the range 1 to 30 inclusive. - */ -void SdnToJewish( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - long int inputDay; - long int day; - long int halakim; - int metonicCycle; - int metonicYear; - int tishri1; - int tishri1After; - int yearLength; - - if (sdn <= JEWISH_SDN_OFFSET) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - inputDay = sdn - JEWISH_SDN_OFFSET; - - FindTishriMolad(inputDay, &metonicCycle, &metonicYear, &day, &halakim); - tishri1 = Tishri1(metonicYear, day, halakim); - - if (inputDay >= tishri1) { - /* It found Tishri 1 at the start of the year. */ - *pYear = metonicCycle * 19 + metonicYear + 1; - if (inputDay < tishri1 + 59) { - if (inputDay < tishri1 + 30) { - *pMonth = 1; - *pDay = inputDay - tishri1 + 1; - } else { - *pMonth = 2; - *pDay = inputDay - tishri1 - 29; - } - return; - } - /* We need the length of the year to figure this out, so find - * Tishri 1 of the next year. */ - halakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear]; - day += halakim / HALAKIM_PER_DAY; - halakim = halakim % HALAKIM_PER_DAY; - tishri1After = Tishri1((metonicYear + 1) % 19, day, halakim); - } else { - /* It found Tishri 1 at the end of the year. */ - *pYear = metonicCycle * 19 + metonicYear; - if (inputDay >= tishri1 - 177) { - /* It is one of the last 6 months of the year. */ - if (inputDay > tishri1 - 30) { - *pMonth = 13; - *pDay = inputDay - tishri1 + 30; - } else if (inputDay > tishri1 - 60) { - *pMonth = 12; - *pDay = inputDay - tishri1 + 60; - } else if (inputDay > tishri1 - 89) { - *pMonth = 11; - *pDay = inputDay - tishri1 + 89; - } else if (inputDay > tishri1 - 119) { - *pMonth = 10; - *pDay = inputDay - tishri1 + 119; - } else if (inputDay > tishri1 - 148) { - *pMonth = 9; - *pDay = inputDay - tishri1 + 148; - } else { - *pMonth = 8; - *pDay = inputDay - tishri1 + 178; - } - return; - } else { - if (monthsPerYear[(*pYear - 1) % 19] == 13) { - *pMonth = 7; - *pDay = inputDay - tishri1 + 207; - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 30; - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 30; - } else { - *pMonth = 6; - *pDay = inputDay - tishri1 + 207; - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 30; - } - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 29; - if (*pDay > 0) - return; - - /* We need the length of the year to figure this out, so find - * Tishri 1 of this year. */ - tishri1After = tishri1; - FindTishriMolad(day - 365, - &metonicCycle, &metonicYear, &day, &halakim); - tishri1 = Tishri1(metonicYear, day, halakim); - } - } - - yearLength = tishri1After - tishri1; - day = inputDay - tishri1 - 29; - if (yearLength == 355 || yearLength == 385) { - /* Heshvan has 30 days */ - if (day <= 30) { - *pMonth = 2; - *pDay = day; - return; - } - day -= 30; - } else { - /* Heshvan has 29 days */ - if (day <= 29) { - *pMonth = 2; - *pDay = day; - return; - } - day -= 29; - } - - /* It has to be Kislev. */ - *pMonth = 3; - *pDay = day; -} - -/************************************************************************ - * Given a year, month and day in the Jewish calendar, find the - * corresponding serial day number (SDN). Zero is returned when the input - * date is detected as invalid. The return value will be > 0 for all valid - * dates, but there are some invalid dates that will return a positive - * value. To verify that a date is valid, convert it to SDN and then back - * and compare with the original. - */ -long int JewishToSdn( - int year, - int month, - int day) -{ - long int sdn; - int metonicCycle; - int metonicYear; - int tishri1; - int tishri1After; - long int moladDay; - long int moladHalakim; - int yearLength; - int lengthOfAdarIAndII; - - if (year <= 0 || day <= 0 || day > 30) { - return (0); - } - switch (month) { - case 1: - case 2: - /* It is Tishri or Heshvan - don't need the year length. */ - FindStartOfYear(year, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1); - if (month == 1) { - sdn = tishri1 + day - 1; - } else { - sdn = tishri1 + day + 29; - } - break; - - case 3: - /* It is Kislev - must find the year length. */ - - /* Find the start of the year. */ - FindStartOfYear(year, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1); - - /* Find the end of the year. */ - moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear]; - moladDay += moladHalakim / HALAKIM_PER_DAY; - moladHalakim = moladHalakim % HALAKIM_PER_DAY; - tishri1After = Tishri1((metonicYear + 1) % 19, moladDay, moladHalakim); - - yearLength = tishri1After - tishri1; - - if (yearLength == 355 || yearLength == 385) { - sdn = tishri1 + day + 59; - } else { - sdn = tishri1 + day + 58; - } - break; - - case 4: - case 5: - case 6: - /* It is Tevet, Shevat or Adar I - don't need the year length. */ - - FindStartOfYear(year + 1, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1After); - - if (monthsPerYear[(year - 1) % 19] == 12) { - lengthOfAdarIAndII = 29; - } else { - lengthOfAdarIAndII = 59; - } - - if (month == 4) { - sdn = tishri1After + day - lengthOfAdarIAndII - 237; - } else if (month == 5) { - sdn = tishri1After + day - lengthOfAdarIAndII - 208; - } else { - sdn = tishri1After + day - lengthOfAdarIAndII - 178; - } - break; - - default: - /* It is Adar II or later - don't need the year length. */ - FindStartOfYear(year + 1, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1After); - - switch (month) { - case 7: - sdn = tishri1After + day - 207; - break; - case 8: - sdn = tishri1After + day - 178; - break; - case 9: - sdn = tishri1After + day - 148; - break; - case 10: - sdn = tishri1After + day - 119; - break; - case 11: - sdn = tishri1After + day - 89; - break; - case 12: - sdn = tishri1After + day - 60; - break; - case 13: - sdn = tishri1After + day - 30; - break; - default: - return (0); - } - } - return (sdn + JEWISH_SDN_OFFSET); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/julian.c b/ext/calendar/julian.c deleted file mode 100644 index 39bcbc7e655d4..0000000000000 --- a/ext/calendar/julian.c +++ /dev/null @@ -1,249 +0,0 @@ -/* $selId: julian.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToJulian( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a Julian calendar date. If the input SDN is less than - * 1, the three output values will all be set to zero, otherwise *pYear - * will be >= -4713 and != 0; *pMonth will be in the range 1 to 12 - * inclusive; *pDay will be in the range 1 to 31 inclusive. - * - * long int - * JulianToSdn( - * int inputYear, - * int inputMonth, - * int inputDay); - * - * Convert a Julian calendar date to a SDN. Zero is returned when the - * input date is detected as invalid or out of the supported range. The - * return value will be > 0 for all valid, supported dates, but there are - * some invalid dates that will return a positive value. To verify that a - * date is valid, convert it to SDN and then back and compare with the - * original. - * - * VALID RANGE - * - * 4713 B.C. to at least 10000 A.D. - * - * Although this software can handle dates all the way back to 4713 - * B.C., such use may not be meaningful. The calendar was created in - * 46 B.C., but the details did not stabilize until at least 8 A.D., - * and perhaps as late at the 4th century. Also, the beginning of a - * year varied from one culture to another - not all accepted January - * as the first month. - * - * CALENDAR OVERVIEW - * - * Julias Ceasar created the calendar in 46 B.C. as a modified form of - * the old Roman republican calendar which was based on lunar cycles. - * The new Julian calendar set fixed lengths for the months, abandoning - * the lunar cycle. It also specified that there would be exactly 12 - * months per year and 365.25 days per year with every 4th year being a - * leap year. - * - * Note that the current accepted value for the tropical year is - * 365.242199 days, not 365.25. This lead to an 11 day shift in the - * calendar with respect to the seasons by the 16th century when the - * Gregorian calendar was created to replace the Julian calendar. - * - * The difference between the Julian and today's Gregorian calendar is - * that the Gregorian does not make centennial years leap years unless - * they are a multiple of 400, which leads to a year of 365.2425 days. - * In other words, in the Gregorian calendar, 1700, 1800 and 1900 are - * not leap years, but 2000 is. All centennial years are leap years in - * the Julian calendar. - * - * The details are unknown, but the lengths of the months were adjusted - * until they finally stablized in 8 A.D. with their current lengths: - * - * January 31 - * February 28/29 - * March 31 - * April 30 - * May 31 - * June 30 - * Quintilis/July 31 - * Sextilis/August 31 - * September 30 - * October 31 - * November 30 - * December 31 - * - * In the early days of the calendar, the days of the month were not - * numbered as we do today. The numbers ran backwards (decreasing) and - * were counted from the Ides (15th of the month - which in the old - * Roman republican lunar calendar would have been the full moon) or - * from the Nonae (9th day before the Ides) or from the beginning of - * the next month. - * - * In the early years, the beginning of the year varied, sometimes - * based on the ascension of rulers. It was not always the first of - * January. - * - * Also, today's epoch, 1 A.D. or the birth of Jesus Christ, did not - * come into use until several centuries later when Christianity became - * a dominant religion. - * - * ALGORITHMS - * - * The calculations are based on two different cycles: a 4 year cycle - * of leap years and a 5 month cycle of month lengths. - * - * The 5 month cycle is used to account for the varying lengths of - * months. You will notice that the lengths alternate between 30 and - * 31 days, except for three anomalies: both July and August have 31 - * days, both December and January have 31, and February is less than - * 30. Starting with March, the lengths are in a cycle of 5 months - * (31, 30, 31, 30, 31): - * - * Mar 31 days \ - * Apr 30 days | - * May 31 days > First cycle - * Jun 30 days | - * Jul 31 days / - * - * Aug 31 days \ - * Sep 30 days | - * Oct 31 days > Second cycle - * Nov 30 days | - * Dec 31 days / - * - * Jan 31 days \ - * Feb 28/9 days | - * > Third cycle (incomplete) - * - * For this reason the calculations (internally) assume that the year - * starts with March 1. - * - * TESTING - * - * This algorithm has been tested from the year 4713 B.C. to 10000 A.D. - * The source code of the verification program is included in this - * package. - * - * REFERENCES - * - * Conversions Between Calendar Date and Julian Day Number by Robert J. - * Tantzen, Communications of the Association for Computing Machinery - * August 1963. (Also published in Collected Algorithms from CACM, - * algorithm number 199). [Note: the published algorithm is for the - * Gregorian calendar, but was adjusted to use the Julian calendar's - * simpler leap year rule.] - * - **************************************************************************/ - -#include "sdncal.h" - -#define JULIAN_SDN_OFFSET 32083 -#define DAYS_PER_5_MONTHS 153 -#define DAYS_PER_4_YEARS 1461 - -void SdnToJulian( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - int year; - int month; - int day; - long int temp; - int dayOfYear; - - if (sdn <= 0) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - temp = (sdn + JULIAN_SDN_OFFSET) * 4 - 1; - - /* Calculate the year and day of year (1 <= dayOfYear <= 366). */ - year = temp / DAYS_PER_4_YEARS; - dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1; - - /* Calculate the month and day of month. */ - temp = dayOfYear * 5 - 3; - month = temp / DAYS_PER_5_MONTHS; - day = (temp % DAYS_PER_5_MONTHS) / 5 + 1; - - /* Convert to the normal beginning of the year. */ - if (month < 10) { - month += 3; - } else { - year += 1; - month -= 9; - } - - /* Adjust to the B.C./A.D. type numbering. */ - year -= 4800; - if (year <= 0) - year--; - - *pYear = year; - *pMonth = month; - *pDay = day; -} - -long int JulianToSdn( - int inputYear, - int inputMonth, - int inputDay) -{ - int year; - int month; - - /* check for invalid dates */ - if (inputYear == 0 || inputYear < -4713 || - inputMonth <= 0 || inputMonth > 12 || - inputDay <= 0 || inputDay > 31) { - return (0); - } - /* check for dates before SDN 1 (Jan 2, 4713 B.C.) */ - if (inputYear == -4713) { - if (inputMonth == 1 && inputDay == 1) { - return (0); - } - } - /* Make year always a positive number. */ - if (inputYear < 0) { - year = inputYear + 4801; - } else { - year = inputYear + 4800; - } - - /* Adjust the start of the year. */ - if (inputMonth > 2) { - month = inputMonth - 3; - } else { - month = inputMonth + 9; - year--; - } - - return ((year * DAYS_PER_4_YEARS) / 4 - + (month * DAYS_PER_5_MONTHS + 2) / 5 - + inputDay - - JULIAN_SDN_OFFSET); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/package.xml b/ext/calendar/package.xml deleted file mode 100644 index 82d0675290c5e..0000000000000 --- a/ext/calendar/package.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - calendar - Date conversion between different calendar formats - - - hholzgra - Hartmut Holzgraefe - hartmut@php.net - lead - - - shane - Shane Caraveo - developer - shane@caraveo.com - - - colin - Colin Viebrock - developer - colin@easydns.com - - - wez - Wez Furlong - developer - wez@php.net - - - -The calendar extension presents a series of functions to simplify -converting between different calendar formats. The intermediary or -standard it is based on is the Julian Day Count. The Julian Day Count -is a count of days starting from January 1st, 4713 B.C. To convert -between calendar systems, you must first convert to Julian Day Count, -then to the calendar system of your choice. Julian Day Count is very -different from the Julian Calendar! - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/calendar/php_calendar.h b/ext/calendar/php_calendar.h deleted file mode 100644 index e353fab89367c..0000000000000 --- a/ext/calendar/php_calendar.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef PHP_CALENDAR_H -#define PHP_CALENDAR_H - -extern zend_module_entry calendar_module_entry; -#define calendar_module_ptr &calendar_module_entry - -/* Functions */ - -PHP_MINIT_FUNCTION(calendar); -PHP_MINFO_FUNCTION(calendar); - -PHP_FUNCTION(jdtogregorian); -PHP_FUNCTION(gregoriantojd); -PHP_FUNCTION(jdtojulian); -PHP_FUNCTION(juliantojd); -PHP_FUNCTION(jdtojewish); -PHP_FUNCTION(jewishtojd); -PHP_FUNCTION(jdtofrench); -PHP_FUNCTION(frenchtojd); -PHP_FUNCTION(jddayofweek); -PHP_FUNCTION(jdmonthname); -PHP_FUNCTION(easter_days); -PHP_FUNCTION(easter_date); -PHP_FUNCTION(unixtojd); -PHP_FUNCTION(jdtounix); -PHP_FUNCTION(cal_from_jd); -PHP_FUNCTION(cal_to_jd); -PHP_FUNCTION(cal_days_in_month); -PHP_FUNCTION(cal_info); - -#define phpext_calendar_ptr calendar_module_ptr - -/* - * Specifying the easter calculation method - * - * DEFAULT is Anglican, ie. use Julian calendar before 1753 - * and Gregorian after that. With ROMAN, the cutoff year is 1582. - * ALWAYS_GREGORIAN and ALWAYS_JULIAN force the calendar - * regardless of date. - * - */ - -#define CAL_EASTER_DEFAULT 0 -#define CAL_EASTER_ROMAN 1 -#define CAL_EASTER_ALWAYS_GREGORIAN 2 -#define CAL_EASTER_ALWAYS_JULIAN 3 - -#endif diff --git a/ext/calendar/sdncal.h b/ext/calendar/sdncal.h deleted file mode 100644 index 81328d1369cf5..0000000000000 --- a/ext/calendar/sdncal.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef SDNCAL_H -#define SDNCAL_H -/* - * This code has been modified for use with PHP - * by Shane Caraveo shane@caraveo.com - * see below for more details - * - */ - -/* $selId: sdncal.h,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * This package defines a set of routines that convert calendar dates to - * and from a serial day number (SDN). The SDN is a serial numbering of - * days where SDN 1 is November 25, 4714 BC in the Gregorian calendar and - * SDN 2447893 is January 1, 1990. This system of day numbering is - * sometimes referred to as Julian days, but to avoid confusion with the - * Julian calendar, it is referred to as serial day numbers here. The term - * Julian days is also used to mean the number of days since the beginning - * of the current year. - * - * The SDN can be used as an intermediate step in converting from one - * calendar system to another (such as Gregorian to Jewish). It can also - * be used for date computations such as easily comparing two dates, - * determining the day of the week, finding the date of yesterday or - * calculating the number of days between two dates. - * - * When using this software on 16 bit systems, be careful to store SDNs in - * a long int, because it will not fit in the 16 bits that some systems - * allocate to an int. - * - * For each calendar, there are two routines provided. One converts dates - * in that calendar to SDN and the other converts SDN to calendar dates. - * The routines are named SdnTo() and ToSdn(), where - * is the name of the calendar system. - * - * SDN values less than one are not supported. If a conversion routine - * returns an SDN of zero, this means that the date given is either invalid - * or is outside the supported range for that calendar. - * - * At least some validity checks are performed on input dates. For - * example, a negative month number will result in the return of zero for - * the SDN. A returned SDN greater than one does not necessarily mean that - * the input date was valid. To determine if the date is valid, convert it - * to SDN, and if the SDN is greater than zero, convert it back to a date - * and compare to the original. For example: - * - * int y1, m1, d1; - * int y2, m2, d2; - * long int sdn; - * ... - * sdn = GregorianToSdn(y1, m1, d1); - * if (sdn > 0) { - * SdnToGregorian(sdn, &y2, &m2, &d2); - * if (y1 == y2 && m1 == m2 && d1 == d2) { - * ... date is valid ... - * } - * } - * - **************************************************************************/ - -/* Gregorian calendar conversions. */ -void SdnToGregorian(long int sdn, int *pYear, int *pMonth, int *pDay); -long int GregorianToSdn(int year, int month, int day); -extern char *MonthNameShort[13]; -extern char *MonthNameLong[13]; - -/* Julian calendar conversions. */ -void SdnToJulian(long int sdn, int *pYear, int *pMonth, int *pDay); -long int JulianToSdn(int year, int month, int day); - -/* Jewish calendar conversions. */ -void SdnToJewish(long int sdn, int *pYear, int *pMonth, int *pDay); -long int JewishToSdn(int year, int month, int day); -extern char *JewishMonthName[14]; -extern char *JewishMonthHebName[14]; - -/* French republic calendar conversions. */ -void SdnToFrench(long int sdn, int *pYear, int *pMonth, int *pDay); -long int FrenchToSdn(int inputYear, int inputMonth, int inputDay); -extern char *FrenchMonthName[14]; - -/* Islamic calendar conversions. */ -/* Not implemented yet. */ - -/* Day of week conversion. 0=Sunday, 6=Saturday */ -int DayOfWeek(long int sdn); -extern char *DayNameShort[7]; -extern char *DayNameLong[7]; - -#endif /* SDNCAL_H */ diff --git a/ext/calendar/tests/cal_days_in_month.phpt b/ext/calendar/tests/cal_days_in_month.phpt deleted file mode 100644 index 9aaf3efdd0c24..0000000000000 --- a/ext/calendar/tests/cal_days_in_month.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -cal_days_in_month() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -There are 31 days in August 2003 -There are 28 days in February 2003 -There are 29 days in February 2004 -There are 31 days in December 2034 diff --git a/ext/calendar/tests/cal_from_jd.phpt b/ext/calendar/tests/cal_from_jd.phpt deleted file mode 100644 index 9614522a05de5..0000000000000 --- a/ext/calendar/tests/cal_from_jd.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -cal_from_jd() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Array -( - [date] => 8/26/74 - [month] => 8 - [day] => 26 - [year] => 74 - [dow] => 0 - [abbrevdayname] => Sun - [dayname] => Sunday - [abbrevmonth] => Aug - [monthname] => August -) -Array -( - [date] => 8/26/74 - [month] => 8 - [day] => 26 - [year] => 74 - [dow] => 5 - [abbrevdayname] => Fri - [dayname] => Friday - [abbrevmonth] => Aug - [monthname] => August -) -Array -( - [date] => 8/26/74 - [month] => 8 - [day] => 26 - [year] => 74 - [dow] => 4 - [abbrevdayname] => Thu - [dayname] => Thursday - [abbrevmonth] => Nisan - [monthname] => Nisan -) -Array -( - [date] => 0/0/0 - [month] => 0 - [day] => 0 - [year] => 0 - [dow] => 1 - [abbrevdayname] => Mon - [dayname] => Monday - [abbrevmonth] => - [monthname] => -) diff --git a/ext/calendar/tests/cal_info.phpt b/ext/calendar/tests/cal_info.phpt deleted file mode 100644 index 2e3e612925c07..0000000000000 --- a/ext/calendar/tests/cal_info.phpt +++ /dev/null @@ -1,216 +0,0 @@ ---TEST-- -cal_info() ---INI-- -date.timezone=UTC ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Array -( - [0] => Array - ( - [months] => Array - ( - [1] => January - [2] => February - [3] => March - [4] => April - [5] => May - [6] => June - [7] => July - [8] => August - [9] => September - [10] => October - [11] => November - [12] => December - ) - - [abbrevmonths] => Array - ( - [1] => Jan - [2] => Feb - [3] => Mar - [4] => Apr - [5] => May - [6] => Jun - [7] => Jul - [8] => Aug - [9] => Sep - [10] => Oct - [11] => Nov - [12] => Dec - ) - - [maxdaysinmonth] => 31 - [calname] => Gregorian - [calsymbol] => CAL_GREGORIAN - ) - - [1] => Array - ( - [months] => Array - ( - [1] => January - [2] => February - [3] => March - [4] => April - [5] => May - [6] => June - [7] => July - [8] => August - [9] => September - [10] => October - [11] => November - [12] => December - ) - - [abbrevmonths] => Array - ( - [1] => Jan - [2] => Feb - [3] => Mar - [4] => Apr - [5] => May - [6] => Jun - [7] => Jul - [8] => Aug - [9] => Sep - [10] => Oct - [11] => Nov - [12] => Dec - ) - - [maxdaysinmonth] => 31 - [calname] => Julian - [calsymbol] => CAL_JULIAN - ) - - [2] => Array - ( - [months] => Array - ( - [1] => Tishri - [2] => Heshvan - [3] => Kislev - [4] => Tevet - [5] => Shevat - [6] => AdarI - [7] => AdarII - [8] => Nisan - [9] => Iyyar - [10] => Sivan - [11] => Tammuz - [12] => Av - [13] => Elul - ) - - [abbrevmonths] => Array - ( - [1] => Tishri - [2] => Heshvan - [3] => Kislev - [4] => Tevet - [5] => Shevat - [6] => AdarI - [7] => AdarII - [8] => Nisan - [9] => Iyyar - [10] => Sivan - [11] => Tammuz - [12] => Av - [13] => Elul - ) - - [maxdaysinmonth] => 30 - [calname] => Jewish - [calsymbol] => CAL_JEWISH - ) - - [3] => Array - ( - [months] => Array - ( - [1] => Vendemiaire - [2] => Brumaire - [3] => Frimaire - [4] => Nivose - [5] => Pluviose - [6] => Ventose - [7] => Germinal - [8] => Floreal - [9] => Prairial - [10] => Messidor - [11] => Thermidor - [12] => Fructidor - [13] => Extra - ) - - [abbrevmonths] => Array - ( - [1] => Vendemiaire - [2] => Brumaire - [3] => Frimaire - [4] => Nivose - [5] => Pluviose - [6] => Ventose - [7] => Germinal - [8] => Floreal - [9] => Prairial - [10] => Messidor - [11] => Thermidor - [12] => Fructidor - [13] => Extra - ) - - [maxdaysinmonth] => 30 - [calname] => French - [calsymbol] => CAL_FRENCH - ) - -) -Array -( - [months] => Array - ( - [1] => January - [2] => February - [3] => March - [4] => April - [5] => May - [6] => June - [7] => July - [8] => August - [9] => September - [10] => October - [11] => November - [12] => December - ) - - [abbrevmonths] => Array - ( - [1] => Jan - [2] => Feb - [3] => Mar - [4] => Apr - [5] => May - [6] => Jun - [7] => Jul - [8] => Aug - [9] => Sep - [10] => Oct - [11] => Nov - [12] => Dec - ) - - [maxdaysinmonth] => 31 - [calname] => Julian - [calsymbol] => CAL_JULIAN -) - -Warning: cal_info(): invalid calendar ID 99999. in %s on line %d diff --git a/ext/calendar/tests/cal_to_jd.phpt b/ext/calendar/tests/cal_to_jd.phpt deleted file mode 100644 index fde1e0b455604..0000000000000 --- a/ext/calendar/tests/cal_to_jd.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -cal_to_jd() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -1748326 -1748324 -374867 -0 diff --git a/ext/calendar/tests/easter_date.phpt b/ext/calendar/tests/easter_date.phpt deleted file mode 100644 index 1adff69293aa1..0000000000000 --- a/ext/calendar/tests/easter_date.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -easter_date() ---INI-- -date.timezone=UTC ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -2000-04-23 -2001-04-15 -2002-03-31 - -Warning: easter_date(): This function is only valid for years between 1970 and 2037 inclusive in %s on line %d -1970-01-01 diff --git a/ext/calendar/tests/easter_days.phpt b/ext/calendar/tests/easter_days.phpt deleted file mode 100644 index 04aa7ae11bed6..0000000000000 --- a/ext/calendar/tests/easter_days.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -easter_days() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -14 -32 -2 diff --git a/ext/calendar/tests/frenchtojd.phpt b/ext/calendar/tests/frenchtojd.phpt deleted file mode 100644 index 73addb6b80050..0000000000000 --- a/ext/calendar/tests/frenchtojd.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -frenchtojd() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -0 -0 -2375840 -0 diff --git a/ext/calendar/tests/gregoriantojd.phpt b/ext/calendar/tests/gregoriantojd.phpt deleted file mode 100644 index ec3628e899631..0000000000000 --- a/ext/calendar/tests/gregoriantojd.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -gregoriantojd() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -0 -2298874 -2299151 -2440588 -2816423 \ No newline at end of file diff --git a/ext/calendar/tests/jddayofweek.phpt b/ext/calendar/tests/jddayofweek.phpt deleted file mode 100644 index c33d59892d1dd..0000000000000 --- a/ext/calendar/tests/jddayofweek.phpt +++ /dev/null @@ -1,130 +0,0 @@ ---TEST-- -jddayofweek() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -### JD 2440588 ### ---- mode 0 --- -4 -5 -6 -0 -1 -2 -3 -4 ---- mode 1 --- -Thursday -Friday -Saturday -Sunday -Monday -Tuesday -Wednesday -Thursday ---- mode 2 --- -Thu -Fri -Sat -Sun -Mon -Tue -Wed -Thu -### JD 2452162 ### ---- mode 0 --- -0 -1 -2 -3 -4 -5 -6 -0 ---- mode 1 --- -Sunday -Monday -Tuesday -Wednesday -Thursday -Friday -Saturday -Sunday ---- mode 2 --- -Sun -Mon -Tue -Wed -Thu -Fri -Sat -Sun -### JD 2453926 ### ---- mode 0 --- -0 -1 -2 -3 -4 -5 -6 -0 ---- mode 1 --- -Sunday -Monday -Tuesday -Wednesday -Thursday -Friday -Saturday -Sunday ---- mode 2 --- -Sun -Mon -Tue -Wed -Thu -Fri -Sat -Sun -### JD -1000 ### ---- mode 0 --- -2 -3 -4 -5 -6 -0 -1 -2 ---- mode 1 --- -Tuesday -Wednesday -Thursday -Friday -Saturday -Sunday -Monday -Tuesday ---- mode 2 --- -Tue -Wed -Thu -Fri -Sat -Sun -Mon -Tue - diff --git a/ext/calendar/tests/jdmonthname.phpt b/ext/calendar/tests/jdmonthname.phpt deleted file mode 100644 index d05d3c595efca..0000000000000 --- a/ext/calendar/tests/jdmonthname.phpt +++ /dev/null @@ -1,314 +0,0 @@ ---TEST-- -jdmonthname() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -### JD 2440588 ### ---- mode 0 --- -Jan -Jan -Mar -Apr -May -May -Jun -Jul -Aug -Sep -Oct -Nov -Dec ---- mode 1 --- -January -January -March -April -May -May -June -July -August -September -October -November -December ---- mode 2 --- -Dec -Jan -Feb -Mar -Apr -May -Jun -Jul -Aug -Sep -Oct -Nov -Dec ---- mode 3 --- -December -January -February -March -April -May -June -July -August -September -October -November -December ---- mode 4 --- -Tevet -Shevat -AdarI -AdarII -Nisan -Iyyar -Sivan -Tammuz -Av -Elul -Tishri -Heshvan -Kislev ---- mode 5 --- - - - - - - - - - - - - - ---- mode 6 --- -Jan -Jan -Mar -Apr -May -May -Jun -Jul -Aug -Sep -Oct -Nov -Dec -### JD 2452162 ### ---- mode 0 --- -Sep -Oct -Nov -Dec -Jan -Feb -Mar -Apr -May -Jun -Jul -Aug -Sep ---- mode 1 --- -September -October -November -December -January -February -March -April -May -June -July -August -September ---- mode 2 --- -Aug -Sep -Oct -Nov -Dec -Jan -Feb -Mar -Apr -May -Jun -Jul -Aug ---- mode 3 --- -August -September -October -November -December -January -February -March -April -May -June -July -August ---- mode 4 --- -Elul -Tishri -Heshvan -Kislev -Tevet -Shevat -AdarI -Nisan -Iyyar -Sivan -Tammuz -Av -Elul ---- mode 5 --- - - - - - - - - - - - - - ---- mode 6 --- -Sep -Oct -Nov -Dec -Jan -Feb -Mar -Apr -May -Jun -Jul -Aug -Sep -### JD 2453926 ### ---- mode 0 --- -Jul -Aug -Sep -Oct -Nov -Dec -Jan -Feb -Mar -Apr -May -Jun -Jul ---- mode 1 --- -July -August -September -October -November -December -January -February -March -April -May -June -July ---- mode 2 --- -Jun -Jul -Aug -Sep -Oct -Nov -Dec -Jan -Feb -Mar -Apr -May -Jun ---- mode 3 --- -June -July -August -September -October -November -December -January -February -March -April -May -June ---- mode 4 --- -Tammuz -Av -Elul -Tishri -Heshvan -Kislev -Tevet -Shevat -AdarI -Nisan -Iyyar -Sivan -Tammuz ---- mode 5 --- - - - - - - - - - - - - - ---- mode 6 --- -Jul -Aug -Sep -Oct -Nov -Dec -Jan -Feb -Mar -Apr -May -Jun -Jul diff --git a/ext/calendar/tests/jdtofrench.phpt b/ext/calendar/tests/jdtofrench.phpt deleted file mode 100644 index 27944091e3071..0000000000000 --- a/ext/calendar/tests/jdtofrench.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -jdtofrench() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -0/0/0 -1/1/1 -1/11/1 -4/11/1 -5/21/2 -0/0/0 \ No newline at end of file diff --git a/ext/calendar/tests/jdtogregorian.phpt b/ext/calendar/tests/jdtogregorian.phpt deleted file mode 100644 index 6b1956f477a67..0000000000000 --- a/ext/calendar/tests/jdtogregorian.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -jdtogregorian() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -0/0/0 -1/1/1582 -10/5/1582 -1/1/1970 -1/1/2999 \ No newline at end of file diff --git a/ext/calendar/tests/jdtojewish.phpt b/ext/calendar/tests/jdtojewish.phpt deleted file mode 100644 index 484b95749cca9..0000000000000 --- a/ext/calendar/tests/jdtojewish.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -jdtojewish() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(184) "2/22/5763 -ëá çùåï äúùñâ -ëá çùåï ä'úùñâ -ëá çùåï ä àìôéí úùñâ -ëá çùåï ä' àìôéí úùñâ -ë"á çùåï äúùñ"â -á' çùåï äúùñ"â -á' çùåï ä'úùñ"â -á' çùåï ä àìôéí úùñ"â -á' çùåï ä' àìôéí úùñ"â -" diff --git a/ext/calendar/tests/jdtojulian.phpt b/ext/calendar/tests/jdtojulian.phpt deleted file mode 100644 index 6c87aa7e54a5e..0000000000000 --- a/ext/calendar/tests/jdtojulian.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -jdtojulian() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -0/0/0 -12/22/1581 -9/25/1582 -12/19/1969 -12/12/2998 \ No newline at end of file diff --git a/ext/calendar/tests/jdtomonthname.phpt b/ext/calendar/tests/jdtomonthname.phpt deleted file mode 100644 index 76d127d6be57f..0000000000000 --- a/ext/calendar/tests/jdtomonthname.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -jdtomonthname() test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(3) "Jan" -string(7) "January" -string(3) "Jan" -string(7) "January" -string(6) "Shevat" -string(0) "" -string(3) "Jan" -string(7) "January" -string(3) "Dec" -string(8) "December" -string(5) "Tevet" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" - -Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d -bool(false) -string(3) "Dec" -string(8) "December" -string(3) "Jul" -string(4) "July" -string(6) "Tishri" -string(0) "" -Done diff --git a/ext/calendar/tests/jdtounix.phpt b/ext/calendar/tests/jdtounix.phpt deleted file mode 100644 index 8d855433003d5..0000000000000 --- a/ext/calendar/tests/jdtounix.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -jdtounix() ---INI-- -date.timezone=UTC ---SKIPIF-- - ---FILE-- - ---EXPECT-- -1970-01-01 -2001-09-09 -2006-07-09 diff --git a/ext/calendar/tests/jewishtojd.phpt b/ext/calendar/tests/jewishtojd.phpt deleted file mode 100644 index a9a2ff0e3dc92..0000000000000 --- a/ext/calendar/tests/jewishtojd.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -jewishtojd() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -0 -0 -347998 -2452576 \ No newline at end of file diff --git a/ext/calendar/tests/juliantojd.phpt b/ext/calendar/tests/juliantojd.phpt deleted file mode 100644 index 9563e041a16e2..0000000000000 --- a/ext/calendar/tests/juliantojd.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -juliantojd() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -0 -2298884 -2299161 -2440601 -2816443 \ No newline at end of file diff --git a/ext/calendar/tests/skipif.inc b/ext/calendar/tests/skipif.inc deleted file mode 100644 index de8e4ae9307e3..0000000000000 --- a/ext/calendar/tests/skipif.inc +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/ext/calendar/tests/unixtojd.phpt b/ext/calendar/tests/unixtojd.phpt deleted file mode 100644 index e8e953c3747c7..0000000000000 --- a/ext/calendar/tests/unixtojd.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -unixtojd() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -2440588 -2452161 -2453926 diff --git a/ext/com_dotnet/CREDITS b/ext/com_dotnet/CREDITS deleted file mode 100644 index 8dd06fa662b4f..0000000000000 --- a/ext/com_dotnet/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -COM and .Net -Wez Furlong diff --git a/ext/com_dotnet/README b/ext/com_dotnet/README deleted file mode 100644 index 0d9db40d981d4..0000000000000 --- a/ext/com_dotnet/README +++ /dev/null @@ -1,71 +0,0 @@ -This is the new php5 COM module. - -It is not 100% backwards compatible with PHP 4 ext/com, but you should not miss -the "features" that have not been retained. - -This module exposes 3 classes: variant, com and dotnet(*). -com and dotnet classes are descendants of the variant class; the only -difference between the three are their constructors. Once instantiated, the -module doesn't make a distinction between them. - -COM errrors are mapped to exceptions; you should protect your COM code using -the try..catch construct if you want to be able to handle error conditions. - -Be warned that due to the way the ZE2 currently works, exceptions are only -"armed" at the time they are detected, but do not "detonate" until the end of -the statement. So, code like this: - - $obj->foo[43]->bar(); - -Where the foo[43] access triggers an exception will continue to call the bar() -method on a null object and cause a fatal php error. - -Default properties and array access: - -$obj = new COM("..."); -$obj[1]->foo(); - -The code above will use the type information for the object to determine its -default property and then access it. In PHP 4, it was hard-coded to use the -"Items" member, which was wrong. - -The default property will also be used by the casting support to determine the -value for the object. - -Variants: - -This implementation of COM takes a simpler approach than the PHP 4 version; -we only map a few native types to COM and vice-versa, leaving the more complex -things as variants. This allows greater consistency of data when passing -parameters to and from COM objects (no data will be lost). In addition, a -large number of the variant API has been mapped to PHP space so that you can -use it for working with the special variant decimal, currency and date time -types. This could be used as a replacement for the bcmath extension, for -example. - -You can use the new object casting hook to for a php-native representation of -a variant object: - -$a = new variant(4); -$b = new variant(6); -$c = variant_add($a, $b); -echo $c; // outputs 10 as a string, instead of Object - -Sample Script: - -Version}\n"; -$word->Visible = 1; -$word->Documents->Add(); -$word->Selection->TypeText("This is a test..."); -$word->Documents[1]->SaveAs("Useless test.doc"); -$word->Quit(); -?> - -TODO: - -- documentation - -* dotnet support requires that you have the mscoree.h header from the .net sdk - when you build the module. diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c deleted file mode 100644 index 5c9f610222652..0000000000000 --- a/ext/com_dotnet/com_com.c +++ /dev/null @@ -1,844 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -/* {{{ com_create_instance - ctor for COM class */ -PHP_FUNCTION(com_create_instance) -{ - zval *object = getThis(); - zval *server_params = NULL; - php_com_dotnet_object *obj; - char *module_name, *typelib_name = NULL, *server_name = NULL; - char *user_name = NULL, *domain_name = NULL, *password = NULL; - int module_name_len, typelib_name_len, server_name_len, - user_name_len, domain_name_len, password_len; - OLECHAR *moniker; - CLSID clsid; - CLSCTX ctx = CLSCTX_SERVER; - HRESULT res = E_FAIL; - int mode = COMG(autoreg_case_sensitive) ? CONST_CS : 0; - ITypeLib *TL = NULL; - COSERVERINFO info; - COAUTHIDENTITY authid = {0}; - COAUTHINFO authinfo = { - RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL, - RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, - &authid, EOAC_NONE - }; - - php_com_initialize(TSRMLS_C); - obj = CDNO_FETCH(object); - - if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "s|s!ls", - &module_name, &module_name_len, &server_name, &server_name_len, - &obj->code_page, &typelib_name, &typelib_name_len) && - FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "sa|ls", - &module_name, &module_name_len, &server_params, &obj->code_page, - &typelib_name, &typelib_name_len)) { - - php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid arguments!" TSRMLS_CC); - ZVAL_NULL(object); - return; - } - - if (server_name) { - ctx = CLSCTX_REMOTE_SERVER; - } else if (server_params) { - zval **tmp; - - /* decode the data from the array */ - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Server", sizeof("Server"), (void**)&tmp)) { - convert_to_string_ex(tmp); - server_name = Z_STRVAL_PP(tmp); - server_name_len = Z_STRLEN_PP(tmp); - ctx = CLSCTX_REMOTE_SERVER; - } - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Username", sizeof("Username"), (void**)&tmp)) { - convert_to_string_ex(tmp); - user_name = Z_STRVAL_PP(tmp); - user_name_len = Z_STRLEN_PP(tmp); - } - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Password", sizeof("Password"), (void**)&tmp)) { - convert_to_string_ex(tmp); - password = Z_STRVAL_PP(tmp); - password_len = Z_STRLEN_PP(tmp); - } - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Domain", sizeof("Domain"), (void**)&tmp)) { - convert_to_string_ex(tmp); - domain_name = Z_STRVAL_PP(tmp); - domain_name_len = Z_STRLEN_PP(tmp); - } - - if (SUCCESS == zend_hash_find(HASH_OF(server_params), - "Flags", sizeof("Flags"), (void**)&tmp)) { - convert_to_long_ex(tmp); - ctx = (CLSCTX)Z_LVAL_PP(tmp); - } - } - - if (server_name && !COMG(allow_dcom)) { - php_com_throw_exception(E_ERROR, "DCOM has been disabled by your administrator [com.allow_dcom=0]" TSRMLS_CC); - return; - } - - moniker = php_com_string_to_olestring(module_name, module_name_len, obj->code_page TSRMLS_CC); - - /* if instantiating a remote object, either directly, or via - * a moniker, fill in the relevant info */ - if (server_name) { - info.dwReserved1 = 0; - info.dwReserved2 = 0; - info.pwszName = php_com_string_to_olestring(server_name, server_name_len, obj->code_page TSRMLS_CC); - - if (user_name) { - authid.User = php_com_string_to_olestring(user_name, -1, obj->code_page TSRMLS_CC); - authid.UserLength = user_name_len; - - if (password) { - authid.Password = (OLECHAR*)password; - authid.PasswordLength = password_len; - } else { - authid.Password = (OLECHAR*)""; - authid.PasswordLength = 0; - } - - if (domain_name) { - authid.Domain = (OLECHAR*)domain_name; - authid.DomainLength = domain_name_len; - } else { - authid.Domain = (OLECHAR*)""; - authid.DomainLength = 0; - } - authid.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; - info.pAuthInfo = &authinfo; - } else { - info.pAuthInfo = NULL; - } - } - - if (FAILED(CLSIDFromString(moniker, &clsid))) { - /* try to use it as a moniker */ - IBindCtx *pBindCtx = NULL; - IMoniker *pMoniker = NULL; - ULONG ulEaten; - BIND_OPTS2 bopt = {0}; - - if (SUCCEEDED(res = CreateBindCtx(0, &pBindCtx))) { - if (server_name) { - /* fill in the remote server info. - * MSDN docs indicate that this might be ignored in - * current win32 implementations, but at least we are - * doing the right thing in readiness for the day that - * it does work */ - bopt.cbStruct = sizeof(bopt); - IBindCtx_GetBindOptions(pBindCtx, (BIND_OPTS*)&bopt); - bopt.pServerInfo = &info; - /* apparently, GetBindOptions will only ever return - * a regular BIND_OPTS structure. My gut feeling is - * that it will modify the size field to reflect that - * so lets be safe and set it to the BIND_OPTS2 size - * again */ - bopt.cbStruct = sizeof(bopt); - IBindCtx_SetBindOptions(pBindCtx, (BIND_OPTS*)&bopt); - } - - if (SUCCEEDED(res = MkParseDisplayName(pBindCtx, moniker, &ulEaten, &pMoniker))) { - res = IMoniker_BindToObject(pMoniker, pBindCtx, - NULL, &IID_IDispatch, (LPVOID*)&V_DISPATCH(&obj->v)); - - if (SUCCEEDED(res)) { - V_VT(&obj->v) = VT_DISPATCH; - } - - IMoniker_Release(pMoniker); - } - } - if (pBindCtx) { - IBindCtx_Release(pBindCtx); - } - } else if (server_name) { - MULTI_QI qi; - - qi.pIID = &IID_IDispatch; - qi.pItf = NULL; - qi.hr = S_OK; - - res = CoCreateInstanceEx(&clsid, NULL, ctx, &info, 1, &qi); - - if (SUCCEEDED(res)) { - res = qi.hr; - V_DISPATCH(&obj->v) = (IDispatch*)qi.pItf; - V_VT(&obj->v) = VT_DISPATCH; - } - } else { - res = CoCreateInstance(&clsid, NULL, CLSCTX_SERVER, &IID_IDispatch, (LPVOID*)&V_DISPATCH(&obj->v)); - if (SUCCEEDED(res)) { - V_VT(&obj->v) = VT_DISPATCH; - } - } - - if (server_name) { - STR_FREE((char*)info.pwszName); - STR_FREE((char*)authid.User); - } - - efree(moniker); - - if (FAILED(res)) { - char *werr, *msg; - - werr = php_win_err(res); - spprintf(&msg, 0, "Failed to create COM object `%s': %s", module_name, werr); - LocalFree(werr); - - php_com_throw_exception(res, msg TSRMLS_CC); - efree(msg); - ZVAL_NULL(object); - return; - } - - /* we got the object and it lives ! */ - - /* see if it has TypeInfo available */ - if (FAILED(IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo)) && typelib_name) { - /* load up the library from the named file */ - int cached; - - TL = php_com_load_typelib_via_cache(typelib_name, obj->code_page, &cached TSRMLS_CC); - - if (TL) { - if (COMG(autoreg_on) && !cached) { - php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC); - } - - /* cross your fingers... there is no guarantee that this ITypeInfo - * instance has any relation to this IDispatch instance... */ - ITypeLib_GetTypeInfo(TL, 0, &obj->typeinfo); - ITypeLib_Release(TL); - } - } else if (obj->typeinfo && COMG(autoreg_on)) { - int idx; - - if (SUCCEEDED(ITypeInfo_GetContainingTypeLib(obj->typeinfo, &TL, &idx))) { - /* check if the library is already in the cache by getting its name */ - BSTR name; - - if (SUCCEEDED(ITypeLib_GetDocumentation(TL, -1, &name, NULL, NULL, NULL))) { - typelib_name = php_com_olestring_to_string(name, &typelib_name_len, obj->code_page TSRMLS_CC); - - if (SUCCESS == zend_ts_hash_add(&php_com_typelibraries, typelib_name, typelib_name_len+1, (void*)&TL, sizeof(ITypeLib*), NULL)) { - php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC); - - /* add a reference for the hash */ - ITypeLib_AddRef(TL); - } - - } else { - /* try it anyway */ - php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC); - } - - ITypeLib_Release(TL); - } - } - -} -/* }}} */ - -/* {{{ proto object com_get_active_object(string progid [, int code_page ]) - Returns a handle to an already running instance of a COM object */ -PHP_FUNCTION(com_get_active_object) -{ - CLSID clsid; - char *module_name; - int module_name_len; - long code_page = COMG(code_page); - IUnknown *unk = NULL; - IDispatch *obj = NULL; - HRESULT res; - OLECHAR *module = NULL; - - php_com_initialize(TSRMLS_C); - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", - &module_name, &module_name_len, &code_page)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments!" TSRMLS_CC); - return; - } - - module = php_com_string_to_olestring(module_name, module_name_len, code_page TSRMLS_CC); - - res = CLSIDFromString(module, &clsid); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - res = GetActiveObject(&clsid, NULL, &unk); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - res = IUnknown_QueryInterface(unk, &IID_IDispatch, &obj); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else if (obj) { - /* we got our dispatchable object */ - php_com_wrap_dispatch(return_value, obj, code_page TSRMLS_CC); - } - } - } - - if (obj) { - IDispatch_Release(obj); - } - if (unk) { - IUnknown_Release(obj); - } - efree(module); -} -/* }}} */ - -/* Performs an Invoke on the given com object. - * returns a failure code and creates an exception if there was an error */ -HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member, - WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg TSRMLS_DC) -{ - HRESULT hr; - unsigned int arg_err; - EXCEPINFO e = {0}; - - hr = IDispatch_Invoke(V_DISPATCH(&obj->v), id_member, - &IID_NULL, LOCALE_SYSTEM_DEFAULT, flags, disp_params, v, &e, &arg_err); - - if (silent == 0 && FAILED(hr)) { - char *source = NULL, *desc = NULL, *msg = NULL; - int source_len, desc_len; - - switch (hr) { - case DISP_E_EXCEPTION: - if (e.bstrSource) { - source = php_com_olestring_to_string(e.bstrSource, &source_len, obj->code_page TSRMLS_CC); - SysFreeString(e.bstrSource); - } - if (e.bstrDescription) { - desc = php_com_olestring_to_string(e.bstrDescription, &desc_len, obj->code_page TSRMLS_CC); - SysFreeString(e.bstrDescription); - } - if (PG(html_errors)) { - spprintf(&msg, 0, "Source: %s
Description: %s", - source ? source : "Unknown", - desc ? desc : "Unknown"); - } else { - spprintf(&msg, 0, "Source: %s\nDescription: %s", - source ? source : "Unknown", - desc ? desc : "Unknown"); - } - if (desc) { - efree(desc); - } - if (source) { - efree(source); - } - if (e.bstrHelpFile) { - SysFreeString(e.bstrHelpFile); - } - break; - - case DISP_E_PARAMNOTFOUND: - case DISP_E_TYPEMISMATCH: - desc = php_win_err(hr); - spprintf(&msg, 0, "Parameter %d: %s", arg_err, desc); - LocalFree(desc); - break; - - case DISP_E_BADPARAMCOUNT: - if ((disp_params->cArgs + disp_params->cNamedArgs == 0) && (allow_noarg == 1)) { - /* if getting a property and they are missing all parameters, - * we want to create a proxy object for them; so lets not create an - * exception here */ - msg = NULL; - break; - } - /* else fall through */ - - default: - desc = php_win_err(hr); - spprintf(&msg, 0, "Error [0x%08x] %s", hr, desc); - LocalFree(desc); - break; - } - - if (msg) { - php_com_throw_exception(hr, msg TSRMLS_CC); - efree(msg); - } - } - - return hr; -} - -/* map an ID to a name */ -HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name, - int namelen, DISPID *dispid TSRMLS_DC) -{ - OLECHAR *olename; - HRESULT hr; - DISPID *dispid_ptr; - - if (namelen == -1) { - namelen = strlen(name); - } - - if (obj->id_of_name_cache && SUCCESS == zend_hash_find(obj->id_of_name_cache, name, namelen, (void**)&dispid_ptr)) { - *dispid = *dispid_ptr; - return S_OK; - } - - olename = php_com_string_to_olestring(name, namelen, obj->code_page TSRMLS_CC); - - if (obj->typeinfo) { - hr = ITypeInfo_GetIDsOfNames(obj->typeinfo, &olename, 1, dispid); - if (FAILED(hr)) { - hr = IDispatch_GetIDsOfNames(V_DISPATCH(&obj->v), &IID_NULL, &olename, 1, LOCALE_SYSTEM_DEFAULT, dispid); - if (SUCCEEDED(hr)) { - /* fall back on IDispatch direct */ - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } - } - } else { - hr = IDispatch_GetIDsOfNames(V_DISPATCH(&obj->v), &IID_NULL, &olename, 1, LOCALE_SYSTEM_DEFAULT, dispid); - } - efree(olename); - - if (SUCCEEDED(hr)) { - /* cache the mapping */ - if (!obj->id_of_name_cache) { - ALLOC_HASHTABLE(obj->id_of_name_cache); - zend_hash_init(obj->id_of_name_cache, 2, NULL, NULL, 0); - } - zend_hash_update(obj->id_of_name_cache, name, namelen, dispid, sizeof(*dispid), NULL); - } - - return hr; -} - -/* the core of COM */ -int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, - WORD flags, VARIANT *v, int nargs, zval ***args TSRMLS_DC) -{ - DISPID dispid, altdispid; - DISPPARAMS disp_params; - HRESULT hr; - VARIANT *vargs = NULL, *byref_vals = NULL; - int i, byref_count = 0, j; - zend_internal_function *f = (zend_internal_function*)EG(function_state_ptr)->function; - - /* assumption: that the active function (f) is the function we generated for the engine */ - if (!f || f->arg_info == NULL) { - f = NULL; - } - - hr = php_com_get_id_of_name(obj, name, namelen, &dispid TSRMLS_CC); - - if (FAILED(hr)) { - char *winerr = NULL; - char *msg = NULL; - winerr = php_win_err(hr); - spprintf(&msg, 0, "Unable to lookup `%s': %s", name, winerr); - LocalFree(winerr); - php_com_throw_exception(hr, msg TSRMLS_CC); - efree(msg); - return FAILURE; - } - - - if (nargs) { - vargs = (VARIANT*)safe_emalloc(sizeof(VARIANT), nargs, 0); - } - - if (f) { - for (i = 0; i < nargs; i++) { - if (f->arg_info[nargs - i - 1].pass_by_reference) { - byref_count++; - } - } - } - - if (byref_count) { - byref_vals = (VARIANT*)safe_emalloc(sizeof(VARIANT), byref_count, 0); - for (j = 0, i = 0; i < nargs; i++) { - if (f->arg_info[nargs - i - 1].pass_by_reference) { - /* put the value into byref_vals instead */ - php_com_variant_from_zval(&byref_vals[j], *args[nargs - i - 1], obj->code_page TSRMLS_CC); - - /* if it is already byref, "move" it into the vargs array, otherwise - * make vargs a reference to this value */ - if (V_VT(&byref_vals[j]) & VT_BYREF) { - memcpy(&vargs[i], &byref_vals[j], sizeof(vargs[i])); - VariantInit(&byref_vals[j]); /* leave the variant slot empty to simplify cleanup */ - } else { - VariantInit(&vargs[i]); - V_VT(&vargs[i]) = V_VT(&byref_vals[j]) | VT_BYREF; - /* union magic ensures that this works out */ - vargs[i].byref = &V_UINT(&byref_vals[j]); - } - j++; - } else { - php_com_variant_from_zval(&vargs[i], *args[nargs - i - 1], obj->code_page TSRMLS_CC); - } - } - - } else { - /* Invoke'd args are in reverse order */ - for (i = 0; i < nargs; i++) { - php_com_variant_from_zval(&vargs[i], *args[nargs - i - 1], obj->code_page TSRMLS_CC); - } - } - - disp_params.cArgs = nargs; - disp_params.cNamedArgs = 0; - disp_params.rgvarg = vargs; - disp_params.rgdispidNamedArgs = NULL; - - if (flags & DISPATCH_PROPERTYPUT) { - altdispid = DISPID_PROPERTYPUT; - disp_params.rgdispidNamedArgs = &altdispid; - disp_params.cNamedArgs = 1; - } - - /* this will create an exception if needed */ - hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, 0, 0 TSRMLS_CC); - - /* release variants */ - if (vargs) { - for (i = 0, j = 0; i < nargs; i++) { - /* if this was byref, update the zval */ - if (f && f->arg_info[nargs - i - 1].pass_by_reference) { - SEPARATE_ZVAL_IF_NOT_REF(args[nargs - i - 1]); - - /* if the variant is pointing at the byref_vals, we need to map - * the pointee value as a zval; otherwise, the value is pointing - * into an existing PHP variant record */ - if (V_VT(&vargs[i]) & VT_BYREF) { - if (vargs[i].byref == &V_UINT(&byref_vals[j])) { - /* copy that value */ - php_com_zval_from_variant(*args[nargs - i - 1], &byref_vals[j], - obj->code_page TSRMLS_CC); - } - } else { - /* not sure if this can ever happen; the variant we marked as BYREF - * is no longer BYREF - copy its value */ - php_com_zval_from_variant(*args[nargs - i - 1], &vargs[i], - obj->code_page TSRMLS_CC); - } - VariantClear(&byref_vals[j]); - j++; - } - VariantClear(&vargs[i]); - } - efree(vargs); - } - - return SUCCEEDED(hr) ? SUCCESS : FAILURE; -} - - - -int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid, - WORD flags, VARIANT *v, int nargs, zval **args, int silent, int allow_noarg TSRMLS_DC) -{ - DISPID altdispid; - DISPPARAMS disp_params; - HRESULT hr; - VARIANT *vargs = NULL; - int i; - - if (nargs) { - vargs = (VARIANT*)safe_emalloc(sizeof(VARIANT), nargs, 0); - } - - /* Invoke'd args are in reverse order */ - for (i = 0; i < nargs; i++) { - php_com_variant_from_zval(&vargs[i], args[nargs - i - 1], obj->code_page TSRMLS_CC); - } - - disp_params.cArgs = nargs; - disp_params.cNamedArgs = 0; - disp_params.rgvarg = vargs; - disp_params.rgdispidNamedArgs = NULL; - - if (flags & DISPATCH_PROPERTYPUT) { - altdispid = DISPID_PROPERTYPUT; - disp_params.rgdispidNamedArgs = &altdispid; - disp_params.cNamedArgs = 1; - } - - /* this will create an exception if needed */ - hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, silent, allow_noarg TSRMLS_CC); - - /* release variants */ - if (vargs) { - for (i = 0; i < nargs; i++) { - VariantClear(&vargs[i]); - } - efree(vargs); - } - - /* a bit of a hack this, but it's needed for COM array access. */ - if (hr == DISP_E_BADPARAMCOUNT) - return hr; - - return SUCCEEDED(hr) ? SUCCESS : FAILURE; -} - -int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen, - WORD flags, VARIANT *v, int nargs, zval **args, int allow_noarg TSRMLS_DC) -{ - DISPID dispid; - HRESULT hr; - char *winerr = NULL; - char *msg = NULL; - - hr = php_com_get_id_of_name(obj, name, namelen, &dispid TSRMLS_CC); - - if (FAILED(hr)) { - winerr = php_win_err(hr); - spprintf(&msg, 0, "Unable to lookup `%s': %s", name, winerr); - LocalFree(winerr); - php_com_throw_exception(hr, msg TSRMLS_CC); - efree(msg); - return FAILURE; - } - - return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args, 0, allow_noarg TSRMLS_CC); -} - -/* {{{ proto string com_create_guid() - Generate a globally unique identifier (GUID) */ -PHP_FUNCTION(com_create_guid) -{ - GUID retval; - OLECHAR *guid_string; - - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - php_com_initialize(TSRMLS_C); - if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) { - Z_TYPE_P(return_value) = IS_STRING; - Z_STRVAL_P(return_value) = php_com_olestring_to_string(guid_string, &Z_STRLEN_P(return_value), CP_ACP TSRMLS_CC); - - CoTaskMemFree(guid_string); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool com_event_sink(object comobject, object sinkobject [, mixed sinkinterface]) - Connect events from a COM object to a PHP object */ -PHP_FUNCTION(com_event_sink) -{ - zval *object, *sinkobject, *sink=NULL; - char *dispname = NULL, *typelibname = NULL; - zend_bool gotguid = 0; - php_com_dotnet_object *obj; - ITypeInfo *typeinfo = NULL; - - RETVAL_FALSE; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oo|z/", - &object, php_com_variant_class_entry, &sinkobject, &sink)) { - RETURN_FALSE; - } - - php_com_initialize(TSRMLS_C); - obj = CDNO_FETCH(object); - - if (sink && Z_TYPE_P(sink) == IS_ARRAY) { - /* 0 => typelibname, 1 => dispname */ - zval **tmp; - - if (zend_hash_index_find(Z_ARRVAL_P(sink), 0, (void**)&tmp) == SUCCESS) - typelibname = Z_STRVAL_PP(tmp); - if (zend_hash_index_find(Z_ARRVAL_P(sink), 1, (void**)&tmp) == SUCCESS) - dispname = Z_STRVAL_PP(tmp); - } else if (sink != NULL) { - convert_to_string(sink); - dispname = Z_STRVAL_P(sink); - } - - typeinfo = php_com_locate_typeinfo(typelibname, obj, dispname, 1 TSRMLS_CC); - - if (typeinfo) { - HashTable *id_to_name; - - ALLOC_HASHTABLE(id_to_name); - - if (php_com_process_typeinfo(typeinfo, id_to_name, 0, &obj->sink_id, obj->code_page TSRMLS_CC)) { - - /* Create the COM wrapper for this sink */ - obj->sink_dispatch = php_com_wrapper_export_as_sink(sinkobject, &obj->sink_id, id_to_name TSRMLS_CC); - - /* Now hook it up to the source */ - php_com_object_enable_event_sink(obj, TRUE TSRMLS_CC); - RETVAL_TRUE; - - } else { - FREE_HASHTABLE(id_to_name); - } - } - - if (typeinfo) { - ITypeInfo_Release(typeinfo); - } - -} -/* }}} */ - -/* {{{ proto bool com_print_typeinfo(object comobject | string typelib, string dispinterface, bool wantsink) - Print out a PHP class definition for a dispatchable interface */ -PHP_FUNCTION(com_print_typeinfo) -{ - zval *arg1; - char *ifacename = NULL; - char *typelibname = NULL; - int ifacelen; - zend_bool wantsink = 0; - php_com_dotnet_object *obj = NULL; - ITypeInfo *typeinfo; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|s!b", &arg1, &ifacename, - &ifacelen, &wantsink)) { - RETURN_FALSE; - } - - php_com_initialize(TSRMLS_C); - if (Z_TYPE_P(arg1) == IS_OBJECT) { - CDNO_FETCH_VERIFY(obj, arg1); - } else { - convert_to_string(arg1); - typelibname = Z_STRVAL_P(arg1); - } - - typeinfo = php_com_locate_typeinfo(typelibname, obj, ifacename, wantsink ? 1 : 0 TSRMLS_CC); - if (typeinfo) { - php_com_process_typeinfo(typeinfo, NULL, 1, NULL, obj ? obj->code_page : COMG(code_page) TSRMLS_CC); - ITypeInfo_Release(typeinfo); - RETURN_TRUE; - } else { - zend_error(E_WARNING, "Unable to find typeinfo using the parameters supplied"); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool com_message_pump([int timeoutms]) - Process COM messages, sleeping for up to timeoutms milliseconds */ -PHP_FUNCTION(com_message_pump) -{ - long timeoutms = 0; - MSG msg; - DWORD result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &timeoutms) == FAILURE) - RETURN_FALSE; - - php_com_initialize(TSRMLS_C); - result = MsgWaitForMultipleObjects(0, NULL, FALSE, timeoutms, QS_ALLINPUT); - - if (result == WAIT_OBJECT_0) { - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - /* we processed messages */ - RETVAL_TRUE; - } else { - /* we did not process messages (timed out) */ - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool com_load_typelib(string typelib_name [, int case_insensitive]) - Loads a Typelibrary and registers its constants */ -PHP_FUNCTION(com_load_typelib) -{ - char *name; - int namelen; - ITypeLib *pTL = NULL; - zend_bool cs = TRUE; - int codepage = COMG(code_page); - int cached = 0; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &name, &namelen, &cs)) { - return; - } - - RETVAL_FALSE; - - php_com_initialize(TSRMLS_C); - pTL = php_com_load_typelib_via_cache(name, codepage, &cached TSRMLS_CC); - if (pTL) { - if (cached) { - RETVAL_TRUE; - } else if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage TSRMLS_CC) == SUCCESS) { - RETVAL_TRUE; - } - - ITypeLib_Release(pTL); - pTL = NULL; - } -} -/* }}} */ - - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c deleted file mode 100644 index 843f888fb5bca..0000000000000 --- a/ext/com_dotnet/com_dotnet.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_MSCOREE_H -# include "php_ini.h" -# include "ext/standard/info.h" -# include "php_com_dotnet.h" -# include "php_com_dotnet_internal.h" -# include "Zend/zend_exceptions.h" -# include - -/* Since there is no official public mscorlib.h header file, and since - * generating your own version from the elusive binary .tlb file takes a lot of - * hacking and results in a 3MB header file (!), we opt for this slightly - * voodoo approach. The following is just enough definition to be able to - * reach the _AppDomain::CreateInstance method that we need to use to be able - * to fire up .Net objects. We used to use IDispatch for this, but it would - * not always work. - * - * The following info was obtained using OleView to export the IDL from - * mscorlib.tlb. Note that OleView is unable to generate C headers for this - * particular tlb... hence this mess. - */ - -const GUID IID_mscorlib_System_AppDomain = { -0x05F696DC, 0x2B29, 0x3663, {0xAD, 0x8B, 0xC4, 0x38, 0x9C, 0xF2, 0xA7, 0x13 }}; - -typedef struct _Imscorlib_System_AppDomain IAppDomain; - -struct _Imscorlib_System_AppDomainVtbl { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IAppDomain * This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IAppDomain * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IAppDomain * This); - - /* this is padding to get CreateInstance into the correct position */ -#define DUMMY_METHOD(x) HRESULT ( STDMETHODCALLTYPE *dummy_##x )(IAppDomain *This) - - DUMMY_METHOD(GetTypeInfoCount); - DUMMY_METHOD(GetTypeInfo); - DUMMY_METHOD(GetIDsOfNames); - DUMMY_METHOD(Invoke); - DUMMY_METHOD(ToString); - DUMMY_METHOD(Equals); - DUMMY_METHOD(GetHashCode); - DUMMY_METHOD(GetType); - DUMMY_METHOD(InitializeLifetimeService); - DUMMY_METHOD(GetLifetimeService); - DUMMY_METHOD(Evidence); - DUMMY_METHOD(add_DomainUnload); - DUMMY_METHOD(remove_DomainUnload); - DUMMY_METHOD(add_AssemblyLoad); - DUMMY_METHOD(remove_AssemblyLoad); - DUMMY_METHOD(add_ProcessExit); - DUMMY_METHOD(remove_ProcessExit); - DUMMY_METHOD(add_TypeResolve); - DUMMY_METHOD(remove_TypeResolve); - DUMMY_METHOD(add_ResourceResolve); - DUMMY_METHOD(remove_ResourceResolve); - DUMMY_METHOD(add_AssemblyResolve); - DUMMY_METHOD(remove_AssemblyResolve); - DUMMY_METHOD(add_UnhandledException); - DUMMY_METHOD(remove_UnhandledException); - DUMMY_METHOD(DefineDynamicAssembly); - DUMMY_METHOD(DefineDynamicAssembly_2); - DUMMY_METHOD(DefineDynamicAssembly_3); - DUMMY_METHOD(DefineDynamicAssembly_4); - DUMMY_METHOD(DefineDynamicAssembly_5); - DUMMY_METHOD(DefineDynamicAssembly_6); - DUMMY_METHOD(DefineDynamicAssembly_7); - DUMMY_METHOD(DefineDynamicAssembly_8); - DUMMY_METHOD(DefineDynamicAssembly_9); - - HRESULT ( STDMETHODCALLTYPE *CreateInstance )(IAppDomain * This, BSTR AssemblyName, BSTR typeName, IUnknown **pRetVal); - HRESULT ( STDMETHODCALLTYPE *CreateInstanceFrom )(IAppDomain * This, BSTR AssemblyFile, BSTR typeName, IUnknown **pRetVal); - - /* more methods live here */ - - END_INTERFACE -}; - -struct _Imscorlib_System_AppDomain { - struct _Imscorlib_System_AppDomainVtbl *lpVtbl; -}; - - -struct dotnet_runtime_stuff { - ICorRuntimeHost *dotnet_host; - IAppDomain *dotnet_domain; - DISPID create_instance; -}; - -static HRESULT dotnet_init(char **p_where TSRMLS_DC) -{ - HRESULT hr; - struct dotnet_runtime_stuff *stuff; - IUnknown *unk = NULL; - char *where = ""; - - stuff = malloc(sizeof(*stuff)); - memset(stuff, 0, sizeof(*stuff)); - - where = "CoCreateInstance"; - hr = CoCreateInstance(&CLSID_CorRuntimeHost, NULL, CLSCTX_ALL, - &IID_ICorRuntimeHost, (LPVOID*)&stuff->dotnet_host); - - if (FAILED(hr)) - goto out; - - /* fire up the host and get the domain object */ - where = "ICorRuntimeHost_Start\n"; - hr = ICorRuntimeHost_Start(stuff->dotnet_host); - if (FAILED(hr)) - goto out; - - where = "ICorRuntimeHost_GetDefaultDomain"; - hr = ICorRuntimeHost_GetDefaultDomain(stuff->dotnet_host, &unk); - if (FAILED(hr)) - goto out; - - where = "QI: System._AppDomain"; - hr = IUnknown_QueryInterface(unk, &IID_mscorlib_System_AppDomain, (LPVOID*)&stuff->dotnet_domain); - if (FAILED(hr)) - goto out; - - COMG(dotnet_runtime_stuff) = stuff; - -out: - if (unk) { - IUnknown_Release(unk); - } - if (COMG(dotnet_runtime_stuff) == NULL) { - /* clean up */ - if (stuff->dotnet_domain) { - IUnknown_Release(stuff->dotnet_domain); - } - if (stuff->dotnet_host) { - ICorRuntimeHost_Stop(stuff->dotnet_host); - ICorRuntimeHost_Release(stuff->dotnet_host); - } - free(stuff); - - *p_where = where; - - return hr; - } - - return S_OK; -} - -/* {{{ com_dotnet_create_instance - ctor for DOTNET class */ -PHP_FUNCTION(com_dotnet_create_instance) -{ - zval *object = getThis(); - php_com_dotnet_object *obj; - char *assembly_name, *datatype_name; - int assembly_name_len, datatype_name_len; - struct dotnet_runtime_stuff *stuff; - OLECHAR *oleassembly, *oletype; - BSTR oleassembly_sys, oletype_sys; - HRESULT hr; - int ret = FAILURE; - char *where = ""; - IUnknown *unk = NULL; - - php_com_initialize(TSRMLS_C); - if (COMG(dotnet_runtime_stuff) == NULL) { - hr = dotnet_init(&where TSRMLS_CC); - if (FAILED(hr)) { - char buf[1024]; - char *err = php_win_err(hr); - snprintf(buf, sizeof(buf), "Failed to init .Net runtime [%s] %s", where, err); - if (err) - LocalFree(err); - php_com_throw_exception(hr, buf TSRMLS_CC); - ZVAL_NULL(object); - return; - } - } - - stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff); - - obj = CDNO_FETCH(object); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", - &assembly_name, &assembly_name_len, - &datatype_name, &datatype_name_len, - &obj->code_page)) { - php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid arguments!" TSRMLS_CC); - ZVAL_NULL(object); - return; - } - - oletype = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page TSRMLS_CC); - oleassembly = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page TSRMLS_CC); - oletype_sys = SysAllocString(oletype); - oleassembly_sys = SysAllocString(oleassembly); - where = "CreateInstance"; - hr = stuff->dotnet_domain->lpVtbl->CreateInstance(stuff->dotnet_domain, oleassembly_sys, oletype_sys, &unk); - efree(oletype); - efree(oleassembly); - SysFreeString(oletype_sys); - SysFreeString(oleassembly_sys); - - if (SUCCEEDED(hr)) { - VARIANT unwrapped; - IObjectHandle *handle = NULL; - - where = "QI: IObjectHandle"; - hr = IUnknown_QueryInterface(unk, &IID_IObjectHandle, &handle); - - if (SUCCEEDED(hr)) { - where = "IObjectHandle_Unwrap"; - hr = IObjectHandle_Unwrap(handle, &unwrapped); - if (SUCCEEDED(hr)) { - - if (V_VT(&unwrapped) == VT_UNKNOWN) { - where = "Unwrapped, QI for IDispatch"; - hr = IUnknown_QueryInterface(V_UNKNOWN(&unwrapped), &IID_IDispatch, &V_DISPATCH(&obj->v)); - - if (SUCCEEDED(hr)) { - V_VT(&obj->v) = VT_DISPATCH; - - /* get its type-info */ - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo); - ret = SUCCESS; - } - } else if (V_VT(&unwrapped) == VT_DISPATCH) { - /* unwrapped is now the dispatch pointer we want */ - V_DISPATCH(&obj->v) = V_DISPATCH(&unwrapped); - V_VT(&obj->v) = VT_DISPATCH; - - /* get its type-info */ - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo); - - ret = SUCCESS; - } else { - /* shouldn't happen, but let's be ready for it */ - VariantClear(&unwrapped); - hr = E_INVALIDARG; - } - } - IObjectHandle_Release(handle); - } - IUnknown_Release(unk); - } - - if (ret == FAILURE) { - char buf[1024]; - char *err = php_win_err(hr); - snprintf(buf, sizeof(buf), "Failed to instantiate .Net object [%s] [0x%08x] %s", where, hr, err); - if (err && err[0]) { - LocalFree(err); - } - php_com_throw_exception(hr, buf TSRMLS_CC); - ZVAL_NULL(object); - return; - } -} -/* }}} */ - -void php_com_dotnet_mshutdown(TSRMLS_D) -{ - struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff); - - if (stuff->dotnet_domain) { - IDispatch_Release(stuff->dotnet_domain); - } - if (stuff->dotnet_host) { - ICorRuntimeHost_Stop(stuff->dotnet_host); - ICorRuntimeHost_Release(stuff->dotnet_host); - stuff->dotnet_host = NULL; - } - free(stuff); - COMG(dotnet_runtime_stuff) = NULL; -} - -void php_com_dotnet_rshutdown(TSRMLS_D) -{ - struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff); - - if (stuff->dotnet_domain) { - IDispatch_Release(stuff->dotnet_domain); - stuff->dotnet_domain = NULL; - } -} - -#endif /* HAVE_MSCOREE_H */ diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c deleted file mode 100644 index f2639ce5a6376..0000000000000 --- a/ext/com_dotnet/com_extension.c +++ /dev/null @@ -1,365 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -ZEND_DECLARE_MODULE_GLOBALS(com_dotnet) -static PHP_GINIT_FUNCTION(com_dotnet); - -TsHashTable php_com_typelibraries; - -zend_class_entry - *php_com_variant_class_entry, - *php_com_exception_class_entry, - *php_com_saproxy_class_entry; - -zend_function_entry com_dotnet_functions[] = { - PHP_FE(variant_set, NULL) - PHP_FE(variant_add, NULL) - PHP_FE(variant_cat, NULL) - PHP_FE(variant_sub, NULL) - PHP_FE(variant_mul, NULL) - PHP_FE(variant_and, NULL) - PHP_FE(variant_div, NULL) - PHP_FE(variant_eqv, NULL) - PHP_FE(variant_idiv, NULL) - PHP_FE(variant_imp, NULL) - PHP_FE(variant_mod, NULL) - PHP_FE(variant_or, NULL) - PHP_FE(variant_pow, NULL) - PHP_FE(variant_xor, NULL) - PHP_FE(variant_abs, NULL) - PHP_FE(variant_fix, NULL) - PHP_FE(variant_int, NULL) - PHP_FE(variant_neg, NULL) - PHP_FE(variant_not, NULL) - PHP_FE(variant_round, NULL) - PHP_FE(variant_cmp, NULL) - PHP_FE(variant_date_to_timestamp, NULL) - PHP_FE(variant_date_from_timestamp, NULL) - PHP_FE(variant_get_type, NULL) - PHP_FE(variant_set_type, NULL) - PHP_FE(variant_cast, NULL) - /* com_com.c */ - PHP_FE(com_create_guid, NULL) - PHP_FE(com_event_sink, NULL) - PHP_FE(com_print_typeinfo, NULL) - PHP_FE(com_message_pump, NULL) - PHP_FE(com_load_typelib, NULL) - PHP_FE(com_get_active_object, NULL) - { NULL, NULL, NULL } -}; - -/* {{{ com_dotnet_module_entry - */ -zend_module_entry com_dotnet_module_entry = { - STANDARD_MODULE_HEADER, - "com_dotnet", - com_dotnet_functions, - PHP_MINIT(com_dotnet), - PHP_MSHUTDOWN(com_dotnet), - PHP_RINIT(com_dotnet), - PHP_RSHUTDOWN(com_dotnet), - PHP_MINFO(com_dotnet), - "0.1", - PHP_MODULE_GLOBALS(com_dotnet), - PHP_GINIT(com_dotnet), - NULL, - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; -/* }}} */ - -#ifdef COMPILE_DL_COM_DOTNET -ZEND_GET_MODULE(com_dotnet) -#endif - -/* {{{ PHP_INI - */ - -/* com.typelib_file is the path to a file containing a - * list of typelibraries to register *persistently*. - * lines starting with ; are comments - * append #cis to end of typelib name to cause its constants - * to be loaded case insensitively */ -static PHP_INI_MH(OnTypeLibFileUpdate) -{ - FILE *typelib_file; - char *typelib_name_buffer; - char *strtok_buf = NULL; - int cached; - - if (!new_value || !new_value[0] || (typelib_file = VCWD_FOPEN(new_value, "r"))==NULL) { - return FAILURE; - } - - typelib_name_buffer = (char *) emalloc(sizeof(char)*1024); - - while (fgets(typelib_name_buffer, 1024, typelib_file)) { - ITypeLib *pTL; - char *typelib_name; - char *modifier, *ptr; - int mode = CONST_CS | CONST_PERSISTENT; /* CONST_PERSISTENT is ok here */ - - if (typelib_name_buffer[0]==';') { - continue; - } - typelib_name = php_strtok_r(typelib_name_buffer, "\r\n", &strtok_buf); /* get rid of newlines */ - if (typelib_name == NULL) { - continue; - } - typelib_name = php_strtok_r(typelib_name, "#", &strtok_buf); - modifier = php_strtok_r(NULL, "#", &strtok_buf); - if (modifier != NULL) { - if (!strcmp(modifier, "cis") || !strcmp(modifier, "case_insensitive")) { - mode &= ~CONST_CS; - } - } - - /* Remove leading/training white spaces on search_string */ - while (isspace(*typelib_name)) {/* Ends on '\0' in worst case */ - typelib_name ++; - } - ptr = typelib_name + strlen(typelib_name) - 1; - while ((ptr != typelib_name) && isspace(*ptr)) { - *ptr = '\0'; - ptr--; - } - - if ((pTL = php_com_load_typelib_via_cache(typelib_name, COMG(code_page), &cached TSRMLS_CC)) != NULL) { - if (!cached) { - php_com_import_typelib(pTL, mode, COMG(code_page) TSRMLS_CC); - } - ITypeLib_Release(pTL); - } - } - - efree(typelib_name_buffer); - fclose(typelib_file); - - return SUCCESS; -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("com.allow_dcom", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_dcom, zend_com_dotnet_globals, com_dotnet_globals) - STD_PHP_INI_ENTRY("com.autoregister_verbose", "0", PHP_INI_ALL, OnUpdateBool, autoreg_verbose, zend_com_dotnet_globals, com_dotnet_globals) - STD_PHP_INI_ENTRY("com.autoregister_typelib", "0", PHP_INI_ALL, OnUpdateBool, autoreg_on, zend_com_dotnet_globals, com_dotnet_globals) - STD_PHP_INI_ENTRY("com.autoregister_casesensitive", "1", PHP_INI_ALL, OnUpdateBool, autoreg_case_sensitive, zend_com_dotnet_globals, com_dotnet_globals) - STD_PHP_INI_ENTRY("com.code_page", "", PHP_INI_ALL, OnUpdateLong, code_page, zend_com_dotnet_globals, com_dotnet_globals) - PHP_INI_ENTRY("com.typelib_file", "", PHP_INI_SYSTEM, OnTypeLibFileUpdate) -PHP_INI_END() -/* }}} */ - -/* {{{ PHP_GINIT_FUNCTION - */ -static PHP_GINIT_FUNCTION(com_dotnet) -{ - memset(com_dotnet_globals, 0, sizeof(*com_dotnet_globals)); - com_dotnet_globals->code_page = CP_ACP; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(com_dotnet) -{ - zend_class_entry ce, *tmp; - - php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU); - php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU); - - INIT_CLASS_ENTRY(ce, "com_exception", NULL); - php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); - php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL; -/* php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */ - - INIT_CLASS_ENTRY(ce, "com_safearray_proxy", NULL); - php_com_saproxy_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - php_com_saproxy_class_entry->ce_flags |= ZEND_ACC_FINAL; -/* php_com_saproxy_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */ - php_com_saproxy_class_entry->get_iterator = php_com_saproxy_iter_get; - - INIT_CLASS_ENTRY(ce, "variant", NULL); - ce.create_object = php_com_object_new; - php_com_variant_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - php_com_variant_class_entry->get_iterator = php_com_iter_get; - - INIT_CLASS_ENTRY(ce, "com", NULL); - ce.create_object = php_com_object_new; - tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry, "variant" TSRMLS_CC); - tmp->get_iterator = php_com_iter_get; - - zend_ts_hash_init(&php_com_typelibraries, 0, NULL, php_com_typelibrary_dtor, 1); - -#if HAVE_MSCOREE_H - INIT_CLASS_ENTRY(ce, "dotnet", NULL); - ce.create_object = php_com_object_new; - tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry, "variant" TSRMLS_CC); - tmp->get_iterator = php_com_iter_get; -#endif - - REGISTER_INI_ENTRIES(); - -#define COM_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS|CONST_PERSISTENT) - - COM_CONST(CLSCTX_INPROC_SERVER); - COM_CONST(CLSCTX_INPROC_HANDLER); - COM_CONST(CLSCTX_LOCAL_SERVER); - COM_CONST(CLSCTX_REMOTE_SERVER); - COM_CONST(CLSCTX_SERVER); - COM_CONST(CLSCTX_ALL); - -#if 0 - COM_CONST(DISPATCH_METHOD); - COM_CONST(DISPATCH_PROPERTYGET); - COM_CONST(DISPATCH_PROPERTYPUT); -#endif - - COM_CONST(VT_NULL); - COM_CONST(VT_EMPTY); - COM_CONST(VT_UI1); - COM_CONST(VT_I1); - COM_CONST(VT_UI2); - COM_CONST(VT_I2); - COM_CONST(VT_UI4); - COM_CONST(VT_I4); - COM_CONST(VT_R4); - COM_CONST(VT_R8); - COM_CONST(VT_BOOL); - COM_CONST(VT_ERROR); - COM_CONST(VT_CY); - COM_CONST(VT_DATE); - COM_CONST(VT_BSTR); - COM_CONST(VT_DECIMAL); - COM_CONST(VT_UNKNOWN); - COM_CONST(VT_DISPATCH); - COM_CONST(VT_VARIANT); - COM_CONST(VT_INT); - COM_CONST(VT_UINT); - COM_CONST(VT_ARRAY); - COM_CONST(VT_BYREF); - - COM_CONST(CP_ACP); - COM_CONST(CP_MACCP); - COM_CONST(CP_OEMCP); - COM_CONST(CP_UTF7); - COM_CONST(CP_UTF8); - COM_CONST(CP_SYMBOL); - COM_CONST(CP_THREAD_ACP); - - COM_CONST(VARCMP_LT); - COM_CONST(VARCMP_EQ); - COM_CONST(VARCMP_GT); - COM_CONST(VARCMP_NULL); - - COM_CONST(NORM_IGNORECASE); - COM_CONST(NORM_IGNORENONSPACE); - COM_CONST(NORM_IGNORESYMBOLS); - COM_CONST(NORM_IGNOREWIDTH); - COM_CONST(NORM_IGNOREKANATYPE); -#ifdef NORM_IGNOREKASHIDA - COM_CONST(NORM_IGNOREKASHIDA); -#endif - COM_CONST(DISP_E_DIVBYZERO); - COM_CONST(DISP_E_OVERFLOW); - COM_CONST(DISP_E_BADINDEX); - COM_CONST(MK_E_UNAVAILABLE); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(com_dotnet) -{ - UNREGISTER_INI_ENTRIES(); -#if HAVE_MSCOREE_H - if (COMG(dotnet_runtime_stuff)) { - php_com_dotnet_mshutdown(TSRMLS_C); - } -#endif - - zend_ts_hash_destroy(&php_com_typelibraries); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(com_dotnet) -{ - COMG(rshutdown_started) = 0; - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(com_dotnet) -{ -#if HAVE_MSCOREE_H - if (COMG(dotnet_runtime_stuff)) { - php_com_dotnet_rshutdown(TSRMLS_C); - } -#endif - COMG(rshutdown_started) = 1; - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(com_dotnet) -{ - php_info_print_table_start(); - - php_info_print_table_header(2, "COM support", "enabled"); - php_info_print_table_header(2, "DCOM support", COMG(allow_dcom) ? "enabled" : "disabled"); - -#if HAVE_MSCOREE_H - php_info_print_table_header(2, ".Net support", "enabled"); -#else - php_info_print_table_header(2, ".Net support", "not present in this build"); -#endif - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c deleted file mode 100644 index 3f7ad04154daa..0000000000000 --- a/ext/com_dotnet/com_handlers.c +++ /dev/null @@ -1,680 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC) -{ - zval *return_value; - php_com_dotnet_object *obj; - VARIANT v; - HRESULT res; - - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); - return_value->refcount = 0; - return_value->is_ref = 0; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - VariantInit(&v); - - convert_to_string_ex(&member); - - res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), - DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1 TSRMLS_CC); - - if (res == SUCCESS) { - php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); - VariantClear(&v); - } else if (res == DISP_E_BADPARAMCOUNT) { - php_com_saproxy_create(object, return_value, member TSRMLS_CC); - } - } else { - php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC); - } - - return return_value; -} - -static void com_property_write(zval *object, zval *member, zval *value TSRMLS_DC) -{ - php_com_dotnet_object *obj; - VARIANT v; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - VariantInit(&v); - - convert_to_string_ex(&member); - if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), - DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &v, 1, &value, 0 TSRMLS_CC)) { - VariantClear(&v); - } - } else { - php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC); - } -} - -static zval *com_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) -{ - zval *return_value; - php_com_dotnet_object *obj; - VARIANT v; - - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); - return_value->refcount = 0; - return_value->is_ref = 0; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - VariantInit(&v); - - if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE, - DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 1, &offset, 0, 0 TSRMLS_CC)) { - php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); - VariantClear(&v); - } - } else if (V_ISARRAY(&obj->v)) { - convert_to_long(offset); - - if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) { - if (php_com_safearray_get_elem(&obj->v, &v, Z_LVAL_P(offset) TSRMLS_CC)) { - php_com_wrap_variant(return_value, &v, obj->code_page TSRMLS_CC); - VariantClear(&v); - } - } else { - php_com_saproxy_create(object, return_value, offset TSRMLS_CC); - } - - } else { - php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC); - } - - return return_value; -} - -static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - php_com_dotnet_object *obj; - zval *args[2]; - VARIANT v; - HRESULT res; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - args[0] = offset; - args[1] = value; - - VariantInit(&v); - - if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE, - DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, args, 0, 0 TSRMLS_CC)) { - VariantClear(&v); - } - } else if (V_ISARRAY(&obj->v)) { - LONG indices = 0; - VARTYPE vt; - - if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) { - if (FAILED(SafeArrayGetVartype(V_ARRAY(&obj->v), &vt)) || vt == VT_EMPTY) { - vt = V_VT(&obj->v) & ~VT_ARRAY; - } - - convert_to_long(offset); - indices = Z_LVAL_P(offset); - - VariantInit(&v); - php_com_variant_from_zval(&v, value, obj->code_page TSRMLS_CC); - - if (V_VT(&v) != vt) { - VariantChangeType(&v, &v, 0, vt); - } - - if (vt == VT_VARIANT) { - res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v); - } else { - res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v.lVal); - } - - VariantClear(&v); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - - } else { - php_com_throw_exception(DISP_E_BADINDEX, "this variant has multiple dimensions; you can't set a new value without specifying *all* dimensions" TSRMLS_CC); - } - - } else { - php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC); - } -} - -#if 0 -static void com_object_set(zval **property, zval *value TSRMLS_DC) -{ - /* Not yet implemented in the engine */ -} - -static zval *com_object_get(zval *property TSRMLS_DC) -{ - /* Not yet implemented in the engine */ - return NULL; -} -#endif - -static int com_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - DISPID dispid; - php_com_dotnet_object *obj; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) == VT_DISPATCH) { - convert_to_string_ex(&member); - if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), &dispid TSRMLS_CC))) { - /* TODO: distinguish between property and method! */ - return 1; - } - } else { - /* TODO: check for safearray */ - } - - return 0; -} - -static int com_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation not yet supported on a COM object"); - return 0; -} - -static void com_property_delete(zval *object, zval *member TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); -} - -static void com_dimension_delete(zval *object, zval *offset TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); -} - -static HashTable *com_properties_get(zval *object TSRMLS_DC) -{ - /* TODO: use type-info to get all the names and values ? - * DANGER: if we do that, there is a strong possibility for - * infinite recursion when the hash is displayed via var_dump(). - * Perhaps it is best to leave it un-implemented. - */ - return NULL; -} - -static void function_dtor(void *pDest) -{ - zend_internal_function *f = (zend_internal_function*)pDest; - - efree(f->function_name); - if (f->arg_info) { - efree(f->arg_info); - } -} - -static PHP_FUNCTION(com_method_handler) -{ - Z_OBJ_HANDLER_P(getThis(), call_method)( - ((zend_internal_function*)EG(function_state_ptr)->function)->function_name, - INTERNAL_FUNCTION_PARAM_PASSTHRU); -} - -static union _zend_function *com_method_get(zval **object_ptr, char *name, int len TSRMLS_DC) -{ - zend_internal_function f, *fptr = NULL; - php_com_dotnet_object *obj; - union _zend_function *func; - DISPID dummy; - zval *object = *object_ptr; - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) != VT_DISPATCH) { - return NULL; - } - - if (FAILED(php_com_get_id_of_name(obj, name, len, &dummy TSRMLS_CC))) { - return NULL; - } - - /* check cache */ - if (obj->method_cache == NULL || FAILURE == zend_hash_find(obj->method_cache, name, len, (void**)&fptr)) { - f.type = ZEND_OVERLOADED_FUNCTION; - f.num_args = 0; - f.arg_info = NULL; - f.scope = obj->ce; - f.fn_flags = 0; - f.function_name = estrndup(name, len); - f.handler = PHP_FN(com_method_handler); - - fptr = &f; - - if (obj->typeinfo) { - /* look for byref params */ - ITypeComp *comp; - ITypeInfo *TI = NULL; - DESCKIND kind; - BINDPTR bindptr; - OLECHAR *olename; - ULONG lhash; - int i; - - if (SUCCEEDED(ITypeInfo_GetTypeComp(obj->typeinfo, &comp))) { - olename = php_com_string_to_olestring(name, len, obj->code_page TSRMLS_CC); - lhash = LHashValOfNameSys(SYS_WIN32, LOCALE_SYSTEM_DEFAULT, olename); - - if (SUCCEEDED(ITypeComp_Bind(comp, olename, lhash, INVOKE_FUNC, &TI, &kind, &bindptr))) { - switch (kind) { - case DESCKIND_FUNCDESC: - f.arg_info = ecalloc(bindptr.lpfuncdesc->cParams, sizeof(zend_arg_info)); - - for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) { - f.arg_info[i].allow_null = 1; - if (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) { - f.arg_info[i].pass_by_reference = 1; - } - } - - f.num_args = bindptr.lpfuncdesc->cParams; - - ITypeInfo_ReleaseFuncDesc(TI, bindptr.lpfuncdesc); - break; - - /* these should not happen, but *might* happen if the user - * screws up; lets avoid a leak in that case */ - case DESCKIND_VARDESC: - ITypeInfo_ReleaseVarDesc(TI, bindptr.lpvardesc); - break; - case DESCKIND_TYPECOMP: - ITypeComp_Release(bindptr.lptcomp); - break; - - case DESCKIND_NONE: - break; - } - if (TI) { - ITypeInfo_Release(TI); - } - } - ITypeComp_Release(comp); - efree(olename); - } - } - - if (fptr) { - /* save this method in the cache */ - if (!obj->method_cache) { - ALLOC_HASHTABLE(obj->method_cache); - zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0); - } - - zend_hash_update(obj->method_cache, name, len, &f, sizeof(f), (void**)&fptr); - } - } - - if (fptr) { - /* duplicate this into a new chunk of emalloc'd memory, - * since the engine will efree it */ - func = emalloc(sizeof(*fptr)); - memcpy(func, fptr, sizeof(*fptr)); - - return func; - } - - return NULL; -} - -static int com_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) -{ - zval ***args = NULL; - php_com_dotnet_object *obj; - int nargs; - VARIANT v; - int ret = FAILURE; - - obj = CDNO_FETCH(getThis()); - - if (V_VT(&obj->v) != VT_DISPATCH) { - return FAILURE; - } - - nargs = ZEND_NUM_ARGS(); - - if (nargs) { - args = (zval ***)safe_emalloc(sizeof(zval *), nargs, 0); - zend_get_parameters_array_ex(nargs, args); - } - - VariantInit(&v); - - if (SUCCESS == php_com_do_invoke_byref(obj, method, -1, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { - php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); - ret = SUCCESS; - VariantClear(&v); - } - - if (args) { - efree(args); - } - - return ret; -} - -static union _zend_function *com_constructor_get(zval *object TSRMLS_DC) -{ - php_com_dotnet_object *obj; - static zend_internal_function c, d, v; - - obj = CDNO_FETCH(object); - -#define POPULATE_CTOR(f, fn) \ - f.type = ZEND_INTERNAL_FUNCTION; \ - f.function_name = obj->ce->name; \ - f.scope = obj->ce; \ - f.arg_info = NULL; \ - f.num_args = 0; \ - f.fn_flags = 0; \ - f.handler = ZEND_FN(fn); \ - return (union _zend_function*)&f; - - switch (obj->ce->name[0]) { -#if HAVE_MSCOREE_H - case 'd': - POPULATE_CTOR(d, com_dotnet_create_instance); -#endif - - case 'c': - POPULATE_CTOR(c, com_create_instance); - - case 'v': - POPULATE_CTOR(v, com_variant_create_instance); - - default: - return NULL; - } -} - -static zend_class_entry *com_class_entry_get(zval *object TSRMLS_DC) -{ - php_com_dotnet_object *obj; - obj = CDNO_FETCH(object); - - return obj->ce; -} - -static int com_class_name_get(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) -{ - php_com_dotnet_object *obj; - obj = CDNO_FETCH(object); - - *class_name = estrndup(obj->ce->name, obj->ce->name_length); - *class_name_len = obj->ce->name_length; - - return 0; -} - -/* This compares two variants for equality */ -static int com_objects_compare(zval *object1, zval *object2 TSRMLS_DC) -{ - php_com_dotnet_object *obja, *objb; - int ret; - /* strange header bug problem here... the headers define the proto without the - * flags parameter. However, the MSDN docs state that there is a flags parameter, - * and my VC6 won't link unless the code uses the version with 4 parameters. - * So, we have this declaration here to fix it */ - STDAPI VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid, DWORD flags); - - obja = CDNO_FETCH(object1); - objb = CDNO_FETCH(object2); - - switch (VarCmp(&obja->v, &objb->v, LOCALE_SYSTEM_DEFAULT, 0)) { - case VARCMP_LT: - ret = -1; - break; - case VARCMP_GT: - ret = 1; - break; - case VARCMP_EQ: - ret = 0; - break; - default: - /* either or both operands are NULL... - * not 100% sure how to handle this */ - ret = -2; - } - - return ret; -} - -static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC) -{ - php_com_dotnet_object *obj; - VARIANT v; - VARTYPE vt = VT_EMPTY; - HRESULT res = S_OK; - - obj = CDNO_FETCH(readobj); - ZVAL_NULL(writeobj); - VariantInit(&v); - - if (V_VT(&obj->v) == VT_DISPATCH) { - if (SUCCESS != php_com_do_invoke_by_id(obj, DISPID_VALUE, - DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1, 0 TSRMLS_CC)) { - VariantCopy(&v, &obj->v); - } - } else { - VariantCopy(&v, &obj->v); - } - - switch(type) { - case IS_LONG: - vt = VT_INT; - break; - case IS_DOUBLE: - vt = VT_R8; - break; - case IS_BOOL: - vt = VT_BOOL; - break; - case IS_STRING: - vt = VT_BSTR; - break; - default: - ; - } - - if (vt != VT_EMPTY && vt != V_VT(&v)) { - res = VariantChangeType(&v, &v, 0, vt); - } - - if (SUCCEEDED(res)) { - php_com_zval_from_variant(writeobj, &v, obj->code_page TSRMLS_CC); - } - - VariantClear(&v); - - if (SUCCEEDED(res)) { - return SUCCESS; - } - - return zend_std_cast_object_tostring(readobj, writeobj, type TSRMLS_CC); -} - -static int com_object_count(zval *object, long *count TSRMLS_DC) -{ - php_com_dotnet_object *obj; - LONG ubound = 0, lbound = 0; - - obj = CDNO_FETCH(object); - - if (!V_ISARRAY(&obj->v)) { - return FAILURE; - } - - SafeArrayGetLBound(V_ARRAY(&obj->v), 1, &lbound); - SafeArrayGetUBound(V_ARRAY(&obj->v), 1, &ubound); - - *count = ubound - lbound + 1; - - return SUCCESS; -} - -zend_object_handlers php_com_object_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - com_property_read, - com_property_write, - com_read_dimension, - com_write_dimension, - NULL, - NULL, //com_object_get, - NULL, //com_object_set, - com_property_exists, - com_property_delete, - com_dimension_exists, - com_dimension_delete, - com_properties_get, - com_method_get, - com_call_method, - com_constructor_get, - com_class_entry_get, - com_class_name_get, - com_objects_compare, - com_object_cast, - com_object_count -}; - -void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC) -{ - if (obj->sink_dispatch) { - IConnectionPointContainer *cont; - IConnectionPoint *point; - - if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), - &IID_IConnectionPointContainer, (void**)&cont))) { - - if (SUCCEEDED(IConnectionPointContainer_FindConnectionPoint(cont, - &obj->sink_id, &point))) { - - if (enable) { - IConnectionPoint_Advise(point, (IUnknown*)obj->sink_dispatch, &obj->sink_cookie); - } else { - IConnectionPoint_Unadvise(point, obj->sink_cookie); - } - IConnectionPoint_Release(point); - } - IConnectionPointContainer_Release(cont); - } - } -} - -void php_com_object_free_storage(void *object TSRMLS_DC) -{ - php_com_dotnet_object *obj = (php_com_dotnet_object*)object; - - if (obj->typeinfo) { - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } - - if (obj->sink_dispatch) { - php_com_object_enable_event_sink(obj, FALSE TSRMLS_CC); - IDispatch_Release(obj->sink_dispatch); - obj->sink_dispatch = NULL; - } - - VariantClear(&obj->v); - - if (obj->method_cache) { - zend_hash_destroy(obj->method_cache); - FREE_HASHTABLE(obj->method_cache); - } - if (obj->id_of_name_cache) { - zend_hash_destroy(obj->id_of_name_cache); - FREE_HASHTABLE(obj->id_of_name_cache); - } - efree(obj); -} - -void php_com_object_clone(void *object, void **clone_ptr TSRMLS_DC) -{ - php_com_dotnet_object *cloneobj, *origobject; - - origobject = (php_com_dotnet_object*)object; - cloneobj = (php_com_dotnet_object*)emalloc(sizeof(php_com_dotnet_object)); - - memcpy(cloneobj, origobject, sizeof(*cloneobj)); - - /* VariantCopy will perform VariantClear; we don't want to clobber - * the IDispatch that we memcpy'd, so we init a new variant in the - * clone structure */ - VariantInit(&cloneobj->v); - /* We use the Indirection-following version of the API since we - * want to clone as much as possible */ - VariantCopyInd(&cloneobj->v, &origobject->v); - - if (cloneobj->typeinfo) { - ITypeInfo_AddRef(cloneobj->typeinfo); - } - - *clone_ptr = cloneobj; -} - -zend_object_value php_com_object_new(zend_class_entry *ce TSRMLS_DC) -{ - php_com_dotnet_object *obj; - zend_object_value retval; - - php_com_initialize(TSRMLS_C); - obj = emalloc(sizeof(*obj)); - memset(obj, 0, sizeof(*obj)); - - VariantInit(&obj->v); - obj->code_page = CP_ACP; - obj->ce = ce; - obj->zo.ce = ce; - - retval.handle = zend_objects_store_put(obj, NULL, php_com_object_free_storage, php_com_object_clone TSRMLS_CC); - retval.handlers = &php_com_object_handlers; - - return retval; -} diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c deleted file mode 100644 index f4c0fc48510d7..0000000000000 --- a/ext/com_dotnet/com_iterator.c +++ /dev/null @@ -1,250 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -struct php_com_iterator { - zend_object_iterator iter; - IEnumVARIANT *ev; - ulong key; - VARIANT v; /* cached element */ - int code_page; - VARIANT safe_array; - VARTYPE sa_type; - LONG sa_max; - zval *zdata; -}; - -static void com_iter_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - - if (I->ev) { - IEnumVARIANT_Release(I->ev); - } - VariantClear(&I->v); - VariantClear(&I->safe_array); - if (I->zdata) { - zval_ptr_dtor((zval**)&I->zdata); - } - efree(I); -} - -static int com_iter_valid(zend_object_iterator *iter TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - - if (I->zdata) { - return SUCCESS; - } - - return FAILURE; -} - -static void com_iter_get_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - - *data = &I->zdata; -} - -static int com_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, - ulong *int_key TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - - if (I->key == (ulong)-1) { - return HASH_KEY_NON_EXISTANT; - } - *int_key = I->key; - return HASH_KEY_IS_LONG; -} - -static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC) -{ - struct php_com_iterator *I = (struct php_com_iterator*)iter->data; - unsigned long n_fetched; - zval *ptr; - - /* release current cached element */ - VariantClear(&I->v); - - if (I->zdata) { - zval_ptr_dtor((zval**)&I->zdata); - I->zdata = NULL; - } - - if (I->ev) { - /* Get the next element */ - if (SUCCEEDED(IEnumVARIANT_Next(I->ev, 1, &I->v, &n_fetched)) && n_fetched > 0) { - I->key++; - } else { - /* indicate that there are no more items */ - I->key = (ulong)-1; - return FAILURE; - } - } else { - /* safe array */ - if (I->key >= I->sa_max) { - I->key = (ulong)-1; - return FAILURE; - } - I->key++; - if (php_com_safearray_get_elem(&I->safe_array, &I->v, (LONG)I->key TSRMLS_CC) == 0) { - I->key = (ulong)-1; - return FAILURE; - } - } - - MAKE_STD_ZVAL(ptr); - php_com_zval_from_variant(ptr, &I->v, I->code_page TSRMLS_CC); - /* php_com_wrap_variant(ptr, &I->v, I->code_page TSRMLS_CC); */ - I->zdata = ptr; - return SUCCESS; -} - - -static zend_object_iterator_funcs com_iter_funcs = { - com_iter_dtor, - com_iter_valid, - com_iter_get_data, - com_iter_get_key, - com_iter_move_forwards, - NULL -}; - -zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) -{ - php_com_dotnet_object *obj; - struct php_com_iterator *I; - IEnumVARIANT *iev = NULL; - DISPPARAMS dp; - VARIANT v; - unsigned long n_fetched; - zval *ptr; - - if (by_ref) { - zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); - } - - obj = CDNO_FETCH(object); - - if (V_VT(&obj->v) != VT_DISPATCH && !V_ISARRAY(&obj->v)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant is not an object or array VT=%d", V_VT(&obj->v)); - return NULL; - } - - memset(&dp, 0, sizeof(dp)); - VariantInit(&v); - - I = (struct php_com_iterator*)ecalloc(1, sizeof(*I)); - I->iter.funcs = &com_iter_funcs; - I->iter.data = I; - I->code_page = obj->code_page; - I->zdata = NULL; - VariantInit(&I->safe_array); - VariantInit(&I->v); - - if (V_ISARRAY(&obj->v)) { - LONG bound; - UINT dims; - - dims = SafeArrayGetDim(V_ARRAY(&obj->v)); - - if (dims != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Can only handle single dimension variant arrays (this array has %d)", dims); - goto fail; - } - - /* same semantics as foreach on a PHP array; - * make a copy and enumerate that copy */ - VariantCopy(&I->safe_array, &obj->v); - - /* determine the key value for the array */ - SafeArrayGetLBound(V_ARRAY(&I->safe_array), 1, &bound); - SafeArrayGetUBound(V_ARRAY(&I->safe_array), 1, &I->sa_max); - - /* pre-fetch the element */ - if (php_com_safearray_get_elem(&I->safe_array, &I->v, bound TSRMLS_CC)) { - I->key = bound; - MAKE_STD_ZVAL(ptr); - php_com_zval_from_variant(ptr, &I->v, I->code_page TSRMLS_CC); - I->zdata = ptr; - } else { - I->key = (ulong)-1; - } - - } else { - /* can we enumerate it? */ - if (FAILED(IDispatch_Invoke(V_DISPATCH(&obj->v), DISPID_NEWENUM, - &IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD|DISPATCH_PROPERTYGET, - &dp, &v, NULL, NULL))) { - goto fail; - } - - /* get something useful out of it */ - if (V_VT(&v) == VT_UNKNOWN) { - IUnknown_QueryInterface(V_UNKNOWN(&v), &IID_IEnumVARIANT, (void**)&iev); - } else if (V_VT(&v) == VT_DISPATCH) { - IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IEnumVARIANT, (void**)&iev); - } - - VariantClear(&v); - - if (iev == NULL) { - goto fail; - } - - I->ev = iev; - - /* Get the first element now */ - if (SUCCEEDED(IEnumVARIANT_Next(I->ev, 1, &I->v, &n_fetched)) && n_fetched > 0) { - /* indicate that we have element 0 */ - I->key = 0; - MAKE_STD_ZVAL(ptr); - php_com_zval_from_variant(ptr, &I->v, I->code_page TSRMLS_CC); - I->zdata = ptr; - } else { - /* indicate that there are no more items */ - I->key = (ulong)-1; - } - } - - return &I->iter; - -fail: - if (I) { - VariantClear(&I->safe_array); - VariantClear(&I->v); - efree(I); - } - return NULL; -} - diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c deleted file mode 100644 index 28e5781966297..0000000000000 --- a/ext/com_dotnet/com_misc.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC) -{ - int free_msg = 0; - if (message == NULL) { - message = php_win_err(code); - free_msg = 1; - } - zend_throw_exception(php_com_exception_class_entry, message, (long)code TSRMLS_CC); - if (free_msg) { - LocalFree(message); - } -} - -PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp, - int codepage TSRMLS_DC) -{ - php_com_dotnet_object *obj; - - obj = emalloc(sizeof(*obj)); - memset(obj, 0, sizeof(*obj)); - obj->code_page = codepage; - obj->ce = php_com_variant_class_entry; - obj->zo.ce = php_com_variant_class_entry; - - VariantInit(&obj->v); - V_VT(&obj->v) = VT_DISPATCH; - V_DISPATCH(&obj->v) = disp; - - IDispatch_AddRef(V_DISPATCH(&obj->v)); - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo); - - Z_TYPE_P(z) = IS_OBJECT; - z->value.obj.handle = zend_objects_store_put(obj, NULL, php_com_object_free_storage, php_com_object_clone TSRMLS_CC); - z->value.obj.handlers = &php_com_object_handlers; -} - -PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v, - int codepage TSRMLS_DC) -{ - php_com_dotnet_object *obj; - - obj = emalloc(sizeof(*obj)); - memset(obj, 0, sizeof(*obj)); - obj->code_page = codepage; - obj->ce = php_com_variant_class_entry; - obj->zo.ce = php_com_variant_class_entry; - - VariantInit(&obj->v); - VariantCopyInd(&obj->v, v); - obj->modified = 0; - - if ((V_VT(&obj->v) == VT_DISPATCH) && (V_DISPATCH(&obj->v) != NULL)) { - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo); - } - - Z_TYPE_P(z) = IS_OBJECT; - - z->value.obj.handle = zend_objects_store_put(obj, NULL, php_com_object_free_storage, php_com_object_clone TSRMLS_CC); - z->value.obj.handlers = &php_com_object_handlers; -} - -/* this is a convenience function for fetching a particular - * element from a (possibly multi-dimensional) safe array */ -PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC) -{ - UINT dims; - LONG lbound, ubound; - LONG indices[1]; - VARTYPE vt; - - if (!V_ISARRAY(array)) { - return 0; - } - - dims = SafeArrayGetDim(V_ARRAY(array)); - - if (dims != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Can only handle single dimension variant arrays (this array has %d)", dims); - return 0; - } - - if (FAILED(SafeArrayGetVartype(V_ARRAY(array), &vt)) || vt == VT_EMPTY) { - vt = V_VT(array) & ~VT_ARRAY; - } - - /* determine the bounds */ - SafeArrayGetLBound(V_ARRAY(array), 1, &lbound); - SafeArrayGetUBound(V_ARRAY(array), 1, &ubound); - - /* check bounds */ - if (dim1 < lbound || dim1 > ubound) { - php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC); - return 0; - } - - /* now fetch that element */ - VariantInit(dest); - - indices[0] = dim1; - - if (vt == VT_VARIANT) { - SafeArrayGetElement(V_ARRAY(array), indices, dest); - } else { - V_VT(dest) = vt; - /* store the value into "lVal" member of the variant. - * This works because it is a union; since we know the variant - * type, we end up with a working variant */ - SafeArrayGetElement(V_ARRAY(array), indices, &dest->lVal); - } - - return 1; -} diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c deleted file mode 100644 index 57c9528a87282..0000000000000 --- a/ext/com_dotnet/com_olechar.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - | Harald Radi | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" - - -PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC) -{ - OLECHAR *olestring = NULL; - DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS; - BOOL ok; - - if (string_len == -1) { - /* determine required length for the buffer (includes NUL terminator) */ - string_len = MultiByteToWideChar(codepage, flags, string, -1, NULL, 0); - } else { - /* allow room for NUL terminator */ - string_len++; - } - - if (string_len > 0) { - olestring = (OLECHAR*)safe_emalloc(string_len, sizeof(OLECHAR), 0); - ok = MultiByteToWideChar(codepage, flags, string, string_len, olestring, string_len); - } else { - ok = FALSE; - olestring = (OLECHAR*)emalloc(sizeof(OLECHAR)); - *olestring = 0; - } - - if (!ok) { - char *msg = php_win_err(GetLastError()); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Could not convert string to unicode: `%s'", msg); - - LocalFree(msg); - } - - return olestring; -} - -PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC) -{ - char *string; - uint length = 0; - BOOL ok; - LONG err; - - length = WideCharToMultiByte(codepage, 0, olestring, -1, NULL, 0, NULL, NULL); - - if (length) { - string = (char*)safe_emalloc(length, sizeof(char), 0); - length = WideCharToMultiByte(codepage, 0, olestring, -1, string, length, NULL, NULL); - ok = length > 0; - } else { - err = GetLastError(); - string = (char*)emalloc(sizeof(char)); - *string = '\0'; - ok = FALSE; - length = 0; - } - - if (!ok) { - char *msg = php_win_err(err); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Could not convert string from unicode: `%s'", msg); - - LocalFree(msg); - } - - if (string_len) { - *string_len = length-1; - } - - return string; -} diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c deleted file mode 100755 index f95baf6a845db..0000000000000 --- a/ext/com_dotnet/com_persist.c +++ /dev/null @@ -1,782 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* Infrastructure for working with persistent COM objects. - * Implements: IStream* wrapper for PHP streams. - * TODO: Magic __wakeup and __sleep handlers for serialization - * (can wait till 5.1) */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -/* {{{ expose php_stream as a COM IStream */ - -typedef struct { - CONST_VTBL struct IStreamVtbl *lpVtbl; - DWORD engine_thread; - LONG refcount; - php_stream *stream; - int id; -} php_istream; - -static int le_istream; -static void istream_destructor(php_istream *stm); - -static void istream_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_istream *stm = (php_istream *)rsrc->ptr; - istream_destructor(stm); -} - -#ifdef ZTS -# define TSRMLS_FIXED() TSRMLS_FETCH(); -#else -# define TSRMLS_FIXED() -#endif - -#define FETCH_STM() \ - TSRMLS_FIXED() \ - php_istream *stm = (php_istream*)This; \ - if (GetCurrentThreadId() != stm->engine_thread) \ - return RPC_E_WRONG_THREAD; - -static HRESULT STDMETHODCALLTYPE stm_queryinterface( - IStream *This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject) -{ - FETCH_STM(); - - if (IsEqualGUID(&IID_IUnknown, riid) || - IsEqualGUID(&IID_IStream, riid)) { - *ppvObject = This; - InterlockedIncrement(&stm->refcount); - return S_OK; - } - - *ppvObject = NULL; - return E_NOINTERFACE; -} - -static ULONG STDMETHODCALLTYPE stm_addref(IStream *This) -{ - FETCH_STM(); - - return InterlockedIncrement(&stm->refcount); -} - -static ULONG STDMETHODCALLTYPE stm_release(IStream *This) -{ - ULONG ret; - FETCH_STM(); - - ret = InterlockedDecrement(&stm->refcount); - if (ret == 0) { - /* destroy it */ - if (stm->id) - zend_list_delete(stm->id); - } - return ret; -} - -static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULONG *pcbRead) -{ - int nread; - FETCH_STM(); - - nread = php_stream_read(stm->stream, pv, cb); - - if (pcbRead) { - *pcbRead = nread > 0 ? nread : 0; - } - if (nread > 0) { - return S_OK; - } - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE stm_write(IStream *This, void const *pv, ULONG cb, ULONG *pcbWritten) -{ - int nwrote; - FETCH_STM(); - - nwrote = php_stream_write(stm->stream, pv, cb); - - if (pcbWritten) { - *pcbWritten = nwrote > 0 ? nwrote : 0; - } - if (nwrote > 0) { - return S_OK; - } - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE stm_seek(IStream *This, LARGE_INTEGER dlibMove, - DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) -{ - off_t offset; - int whence; - int ret; - FETCH_STM(); - - switch (dwOrigin) { - case STREAM_SEEK_SET: whence = SEEK_SET; break; - case STREAM_SEEK_CUR: whence = SEEK_CUR; break; - case STREAM_SEEK_END: whence = SEEK_END; break; - default: - return STG_E_INVALIDFUNCTION; - } - - if (dlibMove.HighPart) { - /* we don't support 64-bit offsets */ - return STG_E_INVALIDFUNCTION; - } - - offset = dlibMove.QuadPart; - - ret = php_stream_seek(stm->stream, offset, whence); - - if (plibNewPosition) { - plibNewPosition->QuadPart = (ULONGLONG)(ret >= 0 ? ret : 0); - } - - return ret >= 0 ? S_OK : STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_set_size(IStream *This, ULARGE_INTEGER libNewSize) -{ - FETCH_STM(); - - if (libNewSize.HighPart) { - return STG_E_INVALIDFUNCTION; - } - - if (php_stream_truncate_supported(stm->stream)) { - int ret = php_stream_truncate_set_size(stm->stream, (size_t)libNewSize.QuadPart); - - if (ret == 0) { - return S_OK; - } - } - - return STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_copy_to(IStream *This, IStream *pstm, ULARGE_INTEGER cb, - ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten) -{ - FETCH_STM(); - - return E_NOTIMPL; -} - -static HRESULT STDMETHODCALLTYPE stm_commit(IStream *This, DWORD grfCommitFlags) -{ - FETCH_STM(); - - php_stream_flush(stm->stream); - - return S_OK; -} - -static HRESULT STDMETHODCALLTYPE stm_revert(IStream *This) -{ - /* NOP */ - return S_OK; -} - -static HRESULT STDMETHODCALLTYPE stm_lock_region(IStream *This, - ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD lockType) -{ - return STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_unlock_region(IStream *This, - ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD lockType) -{ - return STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_stat(IStream *This, - STATSTG *pstatstg, DWORD grfStatFlag) -{ - return STG_E_INVALIDFUNCTION; -} - -static HRESULT STDMETHODCALLTYPE stm_clone(IStream *This, IStream **ppstm) -{ - return STG_E_INVALIDFUNCTION; -} - -static struct IStreamVtbl php_istream_vtbl = { - stm_queryinterface, - stm_addref, - stm_release, - stm_read, - stm_write, - stm_seek, - stm_set_size, - stm_copy_to, - stm_commit, - stm_revert, - stm_lock_region, - stm_unlock_region, - stm_stat, - stm_clone -}; - -static void istream_destructor(php_istream *stm) -{ - TSRMLS_FETCH(); - - if (stm->id) { - int id = stm->id; - stm->id = 0; - zend_list_delete(id); - return; - } - - if (stm->refcount > 0) { - CoDisconnectObject((IUnknown*)stm, 0); - } - - zend_list_delete(stm->stream->rsrc_id); - - CoTaskMemFree(stm); -} -/* }}} */ - -PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC) -{ - php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm)); - - if (stm == NULL) - return NULL; - - memset(stm, 0, sizeof(*stm)); - stm->engine_thread = GetCurrentThreadId(); - stm->lpVtbl = &php_istream_vtbl; - stm->refcount = 1; - stm->stream = stream; - - zend_list_addref(stream->rsrc_id); - stm->id = zend_list_insert(stm, le_istream); - - return (IStream*)stm; -} - -#define CPH_ME(fname, arginfo) PHP_ME(com_persist, fname, arginfo, ZEND_ACC_PUBLIC) -#define CPH_SME(fname, arginfo) PHP_ME(com_persist, fname, arginfo, ZEND_ACC_ALLOW_STATIC|ZEND_ACC_PUBLIC) -#define CPH_METHOD(fname) static PHP_METHOD(com_persist, fname) - -#define CPH_FETCH() php_com_persist_helper *helper = (php_com_persist_helper*)zend_object_store_get_object(getThis() TSRMLS_CC); - -#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance" TSRMLS_CC); return; } - -typedef struct { - zend_object std; - long codepage; - IUnknown *unk; - IPersistStream *ips; - IPersistStreamInit *ipsi; - IPersistFile *ipf; -} php_com_persist_helper; - -static zend_object_handlers helper_handlers; -static zend_class_entry *helper_ce; - -static inline HRESULT get_persist_stream(php_com_persist_helper *helper) -{ - if (!helper->ips && helper->unk) { - return IUnknown_QueryInterface(helper->unk, &IID_IPersistStream, &helper->ips); - } - return helper->ips ? S_OK : E_NOTIMPL; -} - -static inline HRESULT get_persist_stream_init(php_com_persist_helper *helper) -{ - if (!helper->ipsi && helper->unk) { - return IUnknown_QueryInterface(helper->unk, &IID_IPersistStreamInit, &helper->ipsi); - } - return helper->ipsi ? S_OK : E_NOTIMPL; -} - -static inline HRESULT get_persist_file(php_com_persist_helper *helper) -{ - if (!helper->ipf && helper->unk) { - return IUnknown_QueryInterface(helper->unk, &IID_IPersistFile, &helper->ipf); - } - return helper->ipf ? S_OK : E_NOTIMPL; -} - - -/* {{{ proto string COMPersistHelper::GetCurFile() - Determines the filename into which an object will be saved, or false if none is set, via IPersistFile::GetCurFile */ -CPH_METHOD(GetCurFileName) -{ - HRESULT res; - OLECHAR *olename = NULL; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_file(helper); - if (helper->ipf) { - res = IPersistFile_GetCurFile(helper->ipf, &olename); - - if (res == S_OK) { - Z_TYPE_P(return_value) = IS_STRING; - Z_STRVAL_P(return_value) = php_com_olestring_to_string(olename, - &Z_STRLEN_P(return_value), helper->codepage TSRMLS_CC); - CoTaskMemFree(olename); - return; - } else if (res == S_FALSE) { - CoTaskMemFree(olename); - RETURN_FALSE; - } - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } -} -/* }}} */ - - -/* {{{ proto bool COMPersistHelper::SaveToFile(string filename [, bool remember]) - Persist object data to file, via IPersistFile::Save */ -CPH_METHOD(SaveToFile) -{ - HRESULT res; - char *filename, *fullpath = NULL; - int filename_len; - zend_bool remember = TRUE; - OLECHAR *olefilename = NULL; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_file(helper); - if (helper->ipf) { - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!|b", - &filename, &filename_len, &remember)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC); - return; - } - - if (filename) { - fullpath = expand_filepath(filename, NULL TSRMLS_CC); - if (!fullpath) { - RETURN_FALSE; - } - - if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || - php_check_open_basedir(fullpath TSRMLS_CC)) { - efree(fullpath); - RETURN_FALSE; - } - - olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage TSRMLS_CC); - efree(fullpath); - } - res = IPersistFile_Save(helper->ipf, olefilename, remember); - if (SUCCEEDED(res)) { - if (!olefilename) { - res = IPersistFile_GetCurFile(helper->ipf, &olefilename); - if (S_OK == res) { - IPersistFile_SaveCompleted(helper->ipf, olefilename); - CoTaskMemFree(olefilename); - olefilename = NULL; - } - } else if (remember) { - IPersistFile_SaveCompleted(helper->ipf, olefilename); - } - } - - if (olefilename) { - efree(olefilename); - } - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto bool COMPersistHelper::LoadFromFile(string filename [, int flags]) - Load object data from file, via IPersistFile::Load */ -CPH_METHOD(LoadFromFile) -{ - HRESULT res; - char *filename, *fullpath; - int filename_len; - long flags = 0; - OLECHAR *olefilename; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_file(helper); - if (helper->ipf) { - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", - &filename, &filename_len, &flags)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC); - return; - } - - if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { - RETURN_FALSE; - } - - if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || - php_check_open_basedir(fullpath TSRMLS_CC)) { - efree(fullpath); - RETURN_FALSE; - } - - olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage TSRMLS_CC); - efree(fullpath); - - res = IPersistFile_Load(helper->ipf, olefilename, flags); - efree(olefilename); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto int COMPersistHelper::GetMaxStreamSize() - Gets maximum stream size required to store the object data, via IPersistStream::GetSizeMax (or IPersistStreamInit::GetSizeMax) */ -CPH_METHOD(GetMaxStreamSize) -{ - HRESULT res; - ULARGE_INTEGER size; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_stream_init(helper); - if (helper->ipsi) { - res = IPersistStreamInit_GetSizeMax(helper->ipsi, &size); - } else { - res = get_persist_stream(helper); - if (helper->ips) { - res = IPersistStream_GetSizeMax(helper->ips, &size); - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - return; - } - } - - if (res != S_OK) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - /* TODO: handle 64 bit properly */ - RETURN_LONG((LONG)size.QuadPart); - } -} -/* }}} */ - -/* {{{ proto int COMPersistHelper::InitNew() - Initializes the object to a default state, via IPersistStreamInit::InitNew */ -CPH_METHOD(InitNew) -{ - HRESULT res; - CPH_FETCH(); - - CPH_NO_OBJ(); - - res = get_persist_stream_init(helper); - if (helper->ipsi) { - res = IPersistStreamInit_InitNew(helper->ipsi); - - if (res != S_OK) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } else { - RETURN_TRUE; - } - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto mixed COMPersistHelper::LoadFromStream(resource stream) - Initializes an object from the stream where it was previously saved, via IPersistStream::Load or OleLoadFromStream */ -CPH_METHOD(LoadFromStream) -{ - zval *zstm; - php_stream *stream; - IStream *stm = NULL; - HRESULT res; - CPH_FETCH(); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) { - php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC); - return; - } - - php_stream_from_zval_no_verify(stream, &zstm); - - if (stream == NULL) { - php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC); - return; - } - - stm = php_com_wrapper_export_stream(stream TSRMLS_CC); - if (stm == NULL) { - php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC); - return; - } - - res = S_OK; - RETVAL_TRUE; - - if (helper->unk == NULL) { - IDispatch *disp = NULL; - - /* we need to create an object and load using OleLoadFromStream */ - res = OleLoadFromStream(stm, &IID_IDispatch, &disp); - - if (SUCCEEDED(res)) { - php_com_wrap_dispatch(return_value, disp, COMG(code_page) TSRMLS_CC); - } - } else { - res = get_persist_stream_init(helper); - if (helper->ipsi) { - res = IPersistStreamInit_Load(helper->ipsi, stm); - } else { - res = get_persist_stream(helper); - if (helper->ips) { - res = IPersistStreamInit_Load(helper->ipsi, stm); - } - } - } - IStream_Release(stm); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - RETURN_NULL(); - } -} -/* }}} */ - -/* {{{ proto int COMPersistHelper::SaveToStream(resource stream) - Saves the object to a stream, via IPersistStream::Save */ -CPH_METHOD(SaveToStream) -{ - zval *zstm; - php_stream *stream; - IStream *stm = NULL; - HRESULT res; - CPH_FETCH(); - - CPH_NO_OBJ(); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) { - php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC); - return; - } - - php_stream_from_zval_no_verify(stream, &zstm); - - if (stream == NULL) { - php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC); - return; - } - - stm = php_com_wrapper_export_stream(stream TSRMLS_CC); - if (stm == NULL) { - php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC); - return; - } - - res = get_persist_stream_init(helper); - if (helper->ipsi) { - res = IPersistStreamInit_Save(helper->ipsi, stm, TRUE); - } else { - res = get_persist_stream(helper); - if (helper->ips) { - res = IPersistStream_Save(helper->ips, stm, TRUE); - } - } - - IStream_Release(stm); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int COMPersistHelper::__construct([object com_object]) - Creates a persistence helper object, usually associated with a com_object */ -CPH_METHOD(__construct) -{ - php_com_dotnet_object *obj = NULL; - zval *zobj = NULL; - CPH_FETCH(); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|O!", - &zobj, php_com_variant_class_entry)) { - php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC); - return; - } - - if (!zobj) { - return; - } - - obj = CDNO_FETCH(zobj); - - if (V_VT(&obj->v) != VT_DISPATCH || V_DISPATCH(&obj->v) == NULL) { - php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object" TSRMLS_CC); - return; - } - - /* it is always safe to cast an interface to IUnknown */ - helper->unk = (IUnknown*)V_DISPATCH(&obj->v); - IUnknown_AddRef(helper->unk); - helper->codepage = obj->code_page; -} -/* }}} */ - - - - -static zend_function_entry com_persist_helper_methods[] = { - CPH_ME(__construct, NULL) - CPH_ME(GetCurFileName, NULL) - CPH_ME(SaveToFile, NULL) - CPH_ME(LoadFromFile, NULL) - CPH_ME(GetMaxStreamSize, NULL) - CPH_ME(InitNew, NULL) - CPH_ME(LoadFromStream, NULL) - CPH_ME(SaveToStream, NULL) - {NULL, NULL, NULL} -}; - -static void helper_free_storage(void *obj TSRMLS_DC) -{ - php_com_persist_helper *object = (php_com_persist_helper*)obj; - - if (object->ipf) { - IPersistFile_Release(object->ipf); - } - if (object->ips) { - IPersistStream_Release(object->ips); - } - if (object->ipsi) { - IPersistStreamInit_Release(object->ipsi); - } - if (object->unk) { - IUnknown_Release(object->unk); - } - zend_object_std_dtor(&object->std TSRMLS_CC); - efree(object); -} - - -static void helper_clone(void *obj, void **clone_ptr TSRMLS_DC) -{ - php_com_persist_helper *clone, *object = (php_com_persist_helper*)obj; - - clone = emalloc(sizeof(*object)); - memcpy(clone, object, sizeof(*object)); - *clone_ptr = clone; - - zend_object_std_init(&clone->std, object->std.ce TSRMLS_CC); - - if (clone->ipf) { - IPersistFile_AddRef(clone->ipf); - } - if (clone->ips) { - IPersistStream_AddRef(clone->ips); - } - if (clone->ipsi) { - IPersistStreamInit_AddRef(clone->ipsi); - } - if (clone->unk) { - IUnknown_AddRef(clone->unk); - } -} - -static zend_object_value helper_new(zend_class_entry *ce TSRMLS_DC) -{ - php_com_persist_helper *helper; - zend_object_value retval; - - helper = emalloc(sizeof(*helper)); - memset(helper, 0, sizeof(*helper)); - - zend_object_std_init(&helper->std, helper_ce TSRMLS_CC); - - retval.handle = zend_objects_store_put(helper, NULL, helper_free_storage, helper_clone TSRMLS_CC); - retval.handlers = &helper_handlers; - - return retval; -} - -int php_com_persist_minit(INIT_FUNC_ARGS) -{ - zend_class_entry ce; - - memcpy(&helper_handlers, zend_get_std_object_handlers(), sizeof(helper_handlers)); - helper_handlers.clone_obj = NULL; - - INIT_CLASS_ENTRY(ce, "COMPersistHelper", com_persist_helper_methods); - ce.create_object = helper_new; - helper_ce = zend_register_internal_class(&ce TSRMLS_CC); - helper_ce->ce_flags |= ZEND_ACC_FINAL; - - le_istream = zend_register_list_destructors_ex(istream_dtor, - NULL, "com_dotnet_istream_wrapper", module_number); - - return SUCCESS; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c deleted file mode 100644 index f30a7d0fe0380..0000000000000 --- a/ext/com_dotnet/com_saproxy.c +++ /dev/null @@ -1,588 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* This module implements a SafeArray proxy which is used internally - * by the engine when resolving multi-dimensional array accesses on - * SafeArray types. - * In addition, the proxy is now able to handle properties of COM objects - * that smell like PHP arrays. - * */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" -#include "Zend/zend_exceptions.h" - -typedef struct { - /* the object we a proxying for; we hold a refcount to it */ - zval *zobj; - php_com_dotnet_object *obj; - - /* how many dimensions we are indirecting to get into this element */ - LONG dimensions; - - /* this is an array whose size_is(dimensions) */ - zval **indices; - -} php_com_saproxy; - -typedef struct { - zend_object_iterator iter; - zval *proxy_obj; - php_com_saproxy *proxy; - LONG key; - LONG imin, imax; - LONG *indices; -} php_com_saproxy_iter; - -#define SA_FETCH(zv) (php_com_saproxy*)zend_object_store_get_object(zv TSRMLS_CC) - -static inline void clone_indices(php_com_saproxy *dest, php_com_saproxy *src, int ndims) -{ - int i; - - for (i = 0; i < ndims; i++) { - MAKE_STD_ZVAL(dest->indices[i]); - *dest->indices[i] = *src->indices[i]; - zval_copy_ctor(dest->indices[i]); - } -} - -static zval *saproxy_property_read(zval *object, zval *member, int type TSRMLS_DC) -{ - zval *return_value; - - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); - - php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC); - - return return_value; -} - -static void saproxy_property_write(zval *object, zval *member, zval *value TSRMLS_DC) -{ - php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC); -} - -static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) -{ - php_com_saproxy *proxy = SA_FETCH(object); - zval *return_value; - UINT dims; - SAFEARRAY *sa; - LONG ubound, lbound; - int i; - HRESULT res; - - MAKE_STD_ZVAL(return_value); - ZVAL_NULL(return_value); - - if (V_VT(&proxy->obj->v) == VT_DISPATCH) { - VARIANT v; - zval **args; - - /* prop-get using first dimension as the property name, - * all subsequent dimensions and the offset as parameters */ - - args = safe_emalloc(proxy->dimensions + 1, sizeof(zval *), 0); - - for (i = 1; i < proxy->dimensions; i++) { - args[i-1] = proxy->indices[i]; - } - args[i-1] = offset; - - convert_to_string(proxy->indices[0]); - VariantInit(&v); - - res = php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]), - Z_STRLEN_P(proxy->indices[0]), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, - proxy->dimensions, args, 0 TSRMLS_CC); - - if (res == SUCCESS) { - php_com_zval_from_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC); - VariantClear(&v); - } else if (res == DISP_E_BADPARAMCOUNT) { - /* return another proxy */ - php_com_saproxy_create(object, return_value, offset TSRMLS_CC); - } - - return return_value; - - } else if (!V_ISARRAY(&proxy->obj->v)) { - php_com_throw_exception(E_INVALIDARG, "invalid read from com proxy object" TSRMLS_CC); - return return_value; - } - - /* the SafeArray case */ - - /* offset/index must be an integer */ - convert_to_long(offset); - - sa = V_ARRAY(&proxy->obj->v); - dims = SafeArrayGetDim(sa); - - if (proxy->dimensions >= dims) { - /* too many dimensions */ - php_com_throw_exception(E_INVALIDARG, "too many dimensions!" TSRMLS_CC); - return return_value; - } - - /* bounds check */ - SafeArrayGetLBound(sa, proxy->dimensions, &lbound); - SafeArrayGetUBound(sa, proxy->dimensions, &ubound); - - if (Z_LVAL_P(offset) < lbound || Z_LVAL_P(offset) > ubound) { - php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC); - return return_value; - } - - if (dims - 1 == proxy->dimensions) { - LONG *indices; - VARTYPE vt; - VARIANT v; - - VariantInit(&v); - - /* we can return a real value */ - indices = safe_emalloc(dims, sizeof(LONG), 0); - - /* copy indices from proxy */ - for (i = 0; i < dims; i++) { - convert_to_long(proxy->indices[i]); - indices[i] = Z_LVAL_P(proxy->indices[i]); - } - - /* add user-supplied index */ - indices[dims-1] = Z_LVAL_P(offset); - - /* now fetch the value */ - if (FAILED(SafeArrayGetVartype(sa, &vt)) || vt == VT_EMPTY) { - vt = V_VT(&proxy->obj->v) & ~VT_ARRAY; - } - - if (vt == VT_VARIANT) { - res = SafeArrayGetElement(sa, indices, &v); - } else { - V_VT(&v) = vt; - res = SafeArrayGetElement(sa, indices, &v.lVal); - } - - efree(indices); - - if (SUCCEEDED(res)) { - php_com_wrap_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC); - } else { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - - VariantClear(&v); - - } else { - /* return another proxy */ - php_com_saproxy_create(object, return_value, offset TSRMLS_CC); - } - - return return_value; -} - -static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - php_com_saproxy *proxy = SA_FETCH(object); - UINT dims; - int i; - HRESULT res; - VARIANT v; - - if (V_VT(&proxy->obj->v) == VT_DISPATCH) { - /* We do a prop-set using the first dimension as the property name, - * all subsequent dimensions and offset as parameters, with value as - * the final value */ - zval **args = safe_emalloc(proxy->dimensions + 2, sizeof(zval *), 0); - - for (i = 1; i < proxy->dimensions; i++) { - args[i-1] = proxy->indices[i]; - } - args[i-1] = offset; - args[i] = value; - - convert_to_string(proxy->indices[0]); - VariantInit(&v); - if (SUCCESS == php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]), - Z_STRLEN_P(proxy->indices[0]), DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1, - args, 0 TSRMLS_CC)) { - VariantClear(&v); - } - - efree(args); - - } else if (V_ISARRAY(&proxy->obj->v)) { - LONG *indices; - VARTYPE vt; - - dims = SafeArrayGetDim(V_ARRAY(&proxy->obj->v)); - indices = safe_emalloc(dims, sizeof(LONG), 0); - /* copy indices from proxy */ - for (i = 0; i < dims; i++) { - convert_to_long(proxy->indices[i]); - indices[i] = Z_LVAL_P(proxy->indices[i]); - } - - /* add user-supplied index */ - convert_to_long(offset); - indices[dims-1] = Z_LVAL_P(offset); - - if (FAILED(SafeArrayGetVartype(V_ARRAY(&proxy->obj->v), &vt)) || vt == VT_EMPTY) { - vt = V_VT(&proxy->obj->v) & ~VT_ARRAY; - } - - VariantInit(&v); - php_com_variant_from_zval(&v, value, proxy->obj->code_page TSRMLS_CC); - - if (V_VT(&v) != vt) { - VariantChangeType(&v, &v, 0, vt); - } - - if (vt == VT_VARIANT) { - res = SafeArrayPutElement(V_ARRAY(&proxy->obj->v), indices, &v); - } else { - res = SafeArrayPutElement(V_ARRAY(&proxy->obj->v), indices, &v.lVal); - } - - efree(indices); - VariantClear(&v); - - if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); - } - } else { - php_com_throw_exception(E_NOTIMPL, "invalid write to com proxy object" TSRMLS_CC); - } -} - -#if 0 -static void saproxy_object_set(zval **property, zval *value TSRMLS_DC) -{ -} - -static zval *saproxy_object_get(zval *property TSRMLS_DC) -{ - /* Not yet implemented in the engine */ - return NULL; -} -#endif - -static int saproxy_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - /* no properties */ - return 0; -} - -static int saproxy_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation not yet supported on a COM object"); - return 0; -} - -static void saproxy_property_delete(zval *object, zval *member TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); -} - -static void saproxy_dimension_delete(zval *object, zval *offset TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object"); -} - -static HashTable *saproxy_properties_get(zval *object TSRMLS_DC) -{ - /* no properties */ - return NULL; -} - -static union _zend_function *saproxy_method_get(zval **object, char *name, int len TSRMLS_DC) -{ - /* no methods */ - return NULL; -} - -static int saproxy_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) -{ - return FAILURE; -} - -static union _zend_function *saproxy_constructor_get(zval *object TSRMLS_DC) -{ - /* user cannot instantiate */ - return NULL; -} - -static zend_class_entry *saproxy_class_entry_get(zval *object TSRMLS_DC) -{ - return php_com_saproxy_class_entry; -} - -static int saproxy_class_name_get(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) -{ - *class_name = estrndup(php_com_saproxy_class_entry->name, php_com_saproxy_class_entry->name_length); - *class_name_len = php_com_saproxy_class_entry->name_length; - return 0; -} - -static int saproxy_objects_compare(zval *object1, zval *object2 TSRMLS_DC) -{ - return -1; -} - -static int saproxy_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC) -{ - return FAILURE; -} - -static int saproxy_count_elements(zval *object, long *count TSRMLS_DC) -{ - php_com_saproxy *proxy = SA_FETCH(object); - LONG ubound, lbound; - - if (!V_ISARRAY(&proxy->obj->v)) { - return FAILURE; - } - - SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &lbound); - SafeArrayGetUBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &ubound); - - *count = ubound - lbound + 1; - - return SUCCESS; -} - -zend_object_handlers php_com_saproxy_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - saproxy_property_read, - saproxy_property_write, - saproxy_read_dimension, - saproxy_write_dimension, - NULL, - NULL, //saproxy_object_get, - NULL, //saproxy_object_set, - saproxy_property_exists, - saproxy_property_delete, - saproxy_dimension_exists, - saproxy_dimension_delete, - saproxy_properties_get, - saproxy_method_get, - saproxy_call_method, - saproxy_constructor_get, - saproxy_class_entry_get, - saproxy_class_name_get, - saproxy_objects_compare, - saproxy_object_cast, - saproxy_count_elements -}; - -static void saproxy_free_storage(void *object TSRMLS_DC) -{ - php_com_saproxy *proxy = (php_com_saproxy *)object; - int i; - - for (i = 0; i < proxy->dimensions; i++) { - if (proxy->indices) { - FREE_ZVAL(proxy->indices[i]); - } - } - - zval_ptr_dtor(&proxy->zobj); - efree(proxy->indices); - efree(proxy); -} - -static void saproxy_clone(void *object, void **clone_ptr TSRMLS_DC) -{ - php_com_saproxy *proxy = (php_com_saproxy *)object; - php_com_saproxy *cloneproxy; - - cloneproxy = emalloc(sizeof(*cloneproxy)); - memcpy(cloneproxy, proxy, sizeof(*cloneproxy)); - - ZVAL_ADDREF(cloneproxy->zobj); - cloneproxy->indices = safe_emalloc(cloneproxy->dimensions, sizeof(zval *), 0); - clone_indices(cloneproxy, proxy, proxy->dimensions); - - *clone_ptr = cloneproxy; -} - -int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC) -{ - php_com_saproxy *proxy, *rel = NULL; - - proxy = ecalloc(1, sizeof(*proxy)); - proxy->dimensions = 1; - - if (Z_OBJCE_P(com_object) == php_com_saproxy_class_entry) { - rel = SA_FETCH(com_object); - proxy->obj = rel->obj; - proxy->zobj = rel->zobj; - proxy->dimensions += rel->dimensions; - } else { - proxy->obj = CDNO_FETCH(com_object); - proxy->zobj = com_object; - } - - ZVAL_ADDREF(proxy->zobj); - proxy->indices = safe_emalloc(proxy->dimensions, sizeof(zval *), 0); - - if (rel) { - clone_indices(proxy, rel, rel->dimensions); - } - - MAKE_STD_ZVAL(proxy->indices[proxy->dimensions-1]); - *proxy->indices[proxy->dimensions-1] = *index; - zval_copy_ctor(proxy->indices[proxy->dimensions-1]); - - Z_TYPE_P(proxy_out) = IS_OBJECT; - Z_OBJ_HANDLE_P(proxy_out) = zend_objects_store_put(proxy, NULL, saproxy_free_storage, saproxy_clone TSRMLS_CC); - Z_OBJ_HT_P(proxy_out) = &php_com_saproxy_handlers; - - return 1; -} - -/* iterator */ - -static void saproxy_iter_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - - zval_ptr_dtor(&I->proxy_obj); - - efree(I->indices); - efree(I); -} - -static int saproxy_iter_valid(zend_object_iterator *iter TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - - return (I->key < I->imax) ? SUCCESS : FAILURE; -} - -static void saproxy_iter_get_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - VARIANT v; - VARTYPE vt; - zval *return_value, **ptr_ptr; - SAFEARRAY *sa; - - I->indices[I->proxy->dimensions-1] = I->key; - - sa = V_ARRAY(&I->proxy->obj->v); - - if (FAILED(SafeArrayGetVartype(sa, &vt)) || vt == VT_EMPTY) { - vt = V_VT(&I->proxy->obj->v) & ~VT_ARRAY; - } - - VariantInit(&v); - if (vt == VT_VARIANT) { - SafeArrayGetElement(sa, I->indices, &v); - } else { - V_VT(&v) = vt; - SafeArrayGetElement(sa, I->indices, &v.lVal); - } - - MAKE_STD_ZVAL(return_value); - php_com_wrap_variant(return_value, &v, I->proxy->obj->code_page TSRMLS_CC); - VariantClear(&v); - - ptr_ptr = emalloc(sizeof(*ptr_ptr)); - *ptr_ptr = return_value; - *data = ptr_ptr; -} - -static int saproxy_iter_get_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, - ulong *int_key TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - - if (I->key == -1) { - return HASH_KEY_NON_EXISTANT; - } - *int_key = (ulong)I->key; - return HASH_KEY_IS_LONG; -} - -static int saproxy_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC) -{ - php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data; - - if (++I->key >= I->imax) { - I->key = -1; - return FAILURE; - } - return SUCCESS; -} - -static zend_object_iterator_funcs saproxy_iter_funcs = { - saproxy_iter_dtor, - saproxy_iter_valid, - saproxy_iter_get_data, - saproxy_iter_get_key, - saproxy_iter_move_forwards, - NULL -}; - - -zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) -{ - php_com_saproxy *proxy = SA_FETCH(object); - php_com_saproxy_iter *I; - int i; - - if (by_ref) { - zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); - } - - I = ecalloc(1, sizeof(*I)); - I->iter.funcs = &saproxy_iter_funcs; - I->iter.data = I; - - I->proxy = proxy; - I->proxy_obj = object; - ZVAL_ADDREF(I->proxy_obj); - - I->indices = safe_emalloc(proxy->dimensions + 1, sizeof(LONG), 0); - for (i = 0; i < proxy->dimensions; i++) { - convert_to_long(proxy->indices[i]); - I->indices[i] = Z_LVAL_P(proxy->indices[i]); - } - - SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imin); - SafeArrayGetUBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imax); - - I->key = I->imin; - - return &I->iter; -} - diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c deleted file mode 100644 index ffb6e7c24b5fd..0000000000000 --- a/ext/com_dotnet/com_typeinfo.c +++ /dev/null @@ -1,603 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - | Harald Radi | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" - - -/* The search string can be either: - * a) a file name - * b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0" - * c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library" - */ -PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC) -{ - ITypeLib *TL = NULL; - char *strtok_buf, *major, *minor; - CLSID clsid; - OLECHAR *p; - HRESULT hr; - - search_string = php_strtok_r(search_string, ",", &strtok_buf); - - if (search_string == NULL) { - return NULL; - } - - major = php_strtok_r(NULL, ",", &strtok_buf); - minor = php_strtok_r(NULL, ",", &strtok_buf); - - p = php_com_string_to_olestring(search_string, strlen(search_string), codepage TSRMLS_CC); - - if (SUCCEEDED(CLSIDFromString(p, &clsid))) { - WORD major_i = 1, minor_i = 0; - - /* pick up the major/minor numbers; if none specified, default to 1,0 */ - if (major && minor) { - major_i = (WORD)atoi(major); - minor_i = (WORD)atoi(minor); - } - - /* Load the TypeLib by GUID */ - hr = LoadRegTypeLib((REFGUID)&clsid, major_i, minor_i, LANG_NEUTRAL, &TL); - - /* if that failed, assumed that the GUID is actually a CLSID and - * attemp to get the library via an instance of that class */ - if (FAILED(hr) && (major == NULL || minor == NULL)) { - IDispatch *disp = NULL; - ITypeInfo *info = NULL; - int idx; - - if (SUCCEEDED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_SERVER, &IID_IDispatch, (LPVOID*)&disp)) && - SUCCEEDED(hr = IDispatch_GetTypeInfo(disp, 0, LANG_NEUTRAL, &info))) { - hr = ITypeInfo_GetContainingTypeLib(info, &TL, &idx); - } - - if (info) { - ITypeInfo_Release(info); - } - if (disp) { - IDispatch_Release(disp); - } - } - } else { - /* Try to load it from a file; if it fails, do a really painful search of - * the registry */ - if (FAILED(LoadTypeLib(p, &TL))) { - HKEY hkey, hsubkey; - DWORD SubKeys, MaxSubKeyLength; - char *keyname; - unsigned int i, j; - DWORD VersionCount; - char version[20]; - char *libname; - DWORD libnamelen; - - if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, "TypeLib", 0, KEY_READ, &hkey) && - ERROR_SUCCESS == RegQueryInfoKey(hkey, NULL, NULL, NULL, &SubKeys, - &MaxSubKeyLength, NULL, NULL, NULL, NULL, NULL, NULL)) { - - MaxSubKeyLength++; /* make room for NUL */ - keyname = emalloc(MaxSubKeyLength); - libname = emalloc(strlen(search_string) + 1); - - for (i = 0; i < SubKeys && TL == NULL; i++) { - if (ERROR_SUCCESS == RegEnumKey(hkey, i, keyname, MaxSubKeyLength) && - ERROR_SUCCESS == RegOpenKeyEx(hkey, keyname, 0, KEY_READ, &hsubkey)) { - if (ERROR_SUCCESS == RegQueryInfoKey(hsubkey, NULL, NULL, NULL, &VersionCount, - NULL, NULL, NULL, NULL, NULL, NULL, NULL)) { - for (j = 0; j < VersionCount; j++) { - if (ERROR_SUCCESS != RegEnumKey(hsubkey, j, version, sizeof(version))) { - continue; - } - /* get the default value for this key and compare */ - libnamelen = strlen(search_string)+1; - if (ERROR_SUCCESS == RegQueryValue(hsubkey, version, libname, &libnamelen)) { - if (0 == stricmp(libname, search_string)) { - char *str = NULL; - int major, minor; - - /* fetch the GUID and add the version numbers */ - if (2 != sscanf(version, "%d.%d", &major, &minor)) { - major = 1; - minor = 0; - } - spprintf(&str, 0, "%s,%d,%d", keyname, major, minor); - /* recurse */ - TL = php_com_load_typelib(str, codepage TSRMLS_CC); - - efree(str); - break; - } - } - } - } - RegCloseKey(hsubkey); - } - } - RegCloseKey(hkey); - efree(keyname); - efree(libname); - } - } - } - - efree(p); - - return TL; -} - -/* Given a type-library, merge it into the current engine state */ -PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC) -{ - int i, j, interfaces; - TYPEKIND pTKind; - ITypeInfo *TypeInfo; - VARDESC *pVarDesc; - UINT NameCount; - BSTR bstr_ids; - zend_constant c; - zval exists, results, value; - char *const_name; - - if (TL == NULL) { - return FAILURE; - } - - interfaces = ITypeLib_GetTypeInfoCount(TL); - for (i = 0; i < interfaces; i++) { - ITypeLib_GetTypeInfoType(TL, i, &pTKind); - if (pTKind == TKIND_ENUM) { - ITypeLib_GetTypeInfo(TL, i, &TypeInfo); - for (j = 0; ; j++) { - if (FAILED(ITypeInfo_GetVarDesc(TypeInfo, j, &pVarDesc))) { - break; - } - ITypeInfo_GetNames(TypeInfo, pVarDesc->memid, &bstr_ids, 1, &NameCount); - if (NameCount != 1) { - ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); - continue; - } - - const_name = php_com_olestring_to_string(bstr_ids, &c.name_len, codepage TSRMLS_CC); - c.name = zend_strndup(const_name, c.name_len); - efree(const_name); - c.name_len++; /* include NUL */ - SysFreeString(bstr_ids); - - /* sanity check for the case where the constant is already defined */ - if (zend_get_constant(c.name, c.name_len - 1, &exists TSRMLS_CC)) { - if (COMG(autoreg_verbose) && !compare_function(&results, &c.value, &exists TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type library constant %s is already defined", c.name); - } - free(c.name); - ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); - continue; - } - - /* register the constant */ - php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage TSRMLS_CC); - if (Z_TYPE(value) == IS_LONG) { - c.flags = mode; - c.value.type = IS_LONG; - c.value.value.lval = Z_LVAL(value); - c.module_number = 0; - zend_register_constant(&c TSRMLS_CC); - } - ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); - } - ITypeInfo_Release(TypeInfo); - } - } - return SUCCESS; -} - -/* Type-library stuff */ -void php_com_typelibrary_dtor(void *pDest) -{ - ITypeLib **Lib = (ITypeLib**)pDest; - ITypeLib_Release(*Lib); -} - -PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string, - int codepage, int *cached TSRMLS_DC) -{ - ITypeLib **TLp; - ITypeLib *TL; - char *name_dup; - int l; - - l = strlen(search_string); - - if (zend_ts_hash_find(&php_com_typelibraries, search_string, l+1, - (void**)&TLp) == SUCCESS) { - *cached = 1; - /* add a reference for the caller */ - ITypeLib_AddRef(*TLp); - return *TLp; - } - - *cached = 0; - name_dup = estrndup(search_string, l); - TL = php_com_load_typelib(name_dup, codepage TSRMLS_CC); - efree(name_dup); - - if (TL) { - if (SUCCESS == zend_ts_hash_update(&php_com_typelibraries, - search_string, l+1, (void*)&TL, sizeof(ITypeLib*), NULL)) { - /* add a reference for the hash table */ - ITypeLib_AddRef(TL); - } - } - - return TL; -} - -ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC) -{ - ITypeInfo *typeinfo = NULL; - ITypeLib *typelib = NULL; - int gotguid = 0; - GUID iid; - - if (obj) { - if (dispname == NULL && sink) { - IProvideClassInfo2 *pci2; - IProvideClassInfo *pci; - - if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo2, (void**)&pci2))) { - gotguid = SUCCEEDED(IProvideClassInfo2_GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid)); - IProvideClassInfo2_Release(pci2); - } - if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) { - /* examine the available interfaces */ - /* TODO: write some code here */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "IProvideClassInfo: this code not yet written!"); - IProvideClassInfo_Release(pci); - } - } else if (dispname == NULL) { - if (obj->typeinfo) { - ITypeInfo_AddRef(obj->typeinfo); - return obj->typeinfo; - } else { - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo); - if (typeinfo) { - return typeinfo; - } - } - } else if (dispname && obj->typeinfo) { - unsigned int idx; - /* get the library from the object; the rest will be dealt with later */ - ITypeInfo_GetContainingTypeLib(obj->typeinfo, &typelib, &idx); - } else if (typelibname == NULL) { - IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo); - if (dispname) { - unsigned int idx; - /* get the library from the object; the rest will be dealt with later */ - ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, &idx); - - if (typelib) { - ITypeInfo_Release(typeinfo); - typeinfo = NULL; - } - } - } - } else if (typelibname) { - /* Fetch the typelibrary and use that to look things up */ - typelib = php_com_load_typelib(typelibname, obj->code_page TSRMLS_CC); - } - - if (!gotguid && dispname && typelib) { - unsigned short cfound; - MEMBERID memid; - OLECHAR *olename = php_com_string_to_olestring(dispname, strlen(dispname), CP_ACP TSRMLS_CC); - - cfound = 1; - if (FAILED(ITypeLib_FindName(typelib, olename, 0, &typeinfo, &memid, &cfound)) || cfound == 0) { - CLSID coclass; - ITypeInfo *coinfo; - - /* assume that it might be a progid instead */ - if (SUCCEEDED(CLSIDFromProgID(olename, &coclass)) && - SUCCEEDED(ITypeLib_GetTypeInfoOfGuid(typelib, &coclass, &coinfo))) { - - /* enumerate implemented interfaces and pick the one as indicated by sink */ - TYPEATTR *attr; - int i; - - ITypeInfo_GetTypeAttr(coinfo, &attr); - - for (i = 0; i < attr->cImplTypes; i++) { - HREFTYPE rt; - int tf; - - if (FAILED(ITypeInfo_GetImplTypeFlags(coinfo, i, &tf))) { - continue; - } - - if ((sink && tf == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) || - (!sink && (tf & IMPLTYPEFLAG_FSOURCE) == 0)) { - - /* flags match what we are looking for */ - - if (SUCCEEDED(ITypeInfo_GetRefTypeOfImplType(coinfo, i, &rt))) - if (SUCCEEDED(ITypeInfo_GetRefTypeInfo(coinfo, rt, &typeinfo))) - break; - - } - } - - ITypeInfo_ReleaseTypeAttr(coinfo, attr); - ITypeInfo_Release(coinfo); - } - } - - - efree(olename); - } else if (gotguid) { - ITypeLib_GetTypeInfoOfGuid(typelib, &iid, &typeinfo); - } - - if (typelib) { - ITypeLib_Release(typelib); - } - - return typeinfo; -} - -static const struct { - VARTYPE vt; - const char *name; -} vt_names[] = { - { VT_NULL, "VT_NULL" }, - { VT_EMPTY, "VT_EMPTY" }, - { VT_UI1, "VT_UI1" }, - { VT_I2, "VT_I2" }, - { VT_I4, "VT_I4" }, - { VT_R4, "VT_R4" }, - { VT_R8, "VT_R8" }, - { VT_BOOL, "VT_BOOL" }, - { VT_ERROR, "VT_ERROR" }, - { VT_CY, "VT_CY" }, - { VT_DATE, "VT_DATE" }, - { VT_BSTR, "VT_BSTR" }, - { VT_DECIMAL, "VT_DECIMAL" }, - { VT_UNKNOWN, "VT_UNKNOWN" }, - { VT_DISPATCH, "VT_DISPATCH" }, - { VT_VARIANT, "VT_VARIANT" }, - { VT_I1, "VT_I1" }, - { VT_UI2, "VT_UI2" }, - { VT_UI4, "VT_UI4" }, - { VT_INT, "VT_INT" }, - { VT_UINT, "VT_UINT" }, - { VT_ARRAY, "VT_ARRAY" }, - { VT_BYREF, "VT_BYREF" }, - { VT_VOID, "VT_VOID" }, - { VT_PTR, "VT_PTR" }, - { VT_HRESULT, "VT_HRESULT" }, - { VT_SAFEARRAY, "VT_SAFEARRAY" }, - { 0, NULL } -}; - -static inline const char *vt_to_string(VARTYPE vt) -{ - int i; - for (i = 0; vt_names[i].name != NULL; i++) { - if (vt_names[i].vt == vt) - return vt_names[i].name; - } - return "?"; -} - -static char *php_com_string_from_clsid(const CLSID *clsid, int codepage TSRMLS_DC) -{ - LPOLESTR ole_clsid; - char *clsid_str; - - StringFromCLSID(clsid, &ole_clsid); - clsid_str = php_com_olestring_to_string(ole_clsid, NULL, codepage TSRMLS_CC); - LocalFree(ole_clsid); - - return clsid_str; -} - - -int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC) -{ - TYPEATTR *attr; - FUNCDESC *func; - int i; - OLECHAR *olename; - char *ansiname = NULL; - unsigned int ansinamelen; - int ret = 0; - - if (FAILED(ITypeInfo_GetTypeAttr(typeinfo, &attr))) { - return 0; - } - - /* verify that it is suitable */ - if (id_to_name == NULL || attr->typekind == TKIND_DISPATCH) { - - if (guid) { - memcpy(guid, &attr->guid, sizeof(GUID)); - } - - if (printdef) { - char *guidstring; - - ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &olename, NULL, NULL, NULL); - ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage TSRMLS_CC); - SysFreeString(olename); - - guidstring = php_com_string_from_clsid(&attr->guid, codepage TSRMLS_CC); - php_printf("class %s { /* GUID=%s */\n", ansiname, guidstring); - efree(guidstring); - - efree(ansiname); - } - - if (id_to_name) { - zend_hash_init(id_to_name, 0, NULL, ZVAL_PTR_DTOR, 0); - } - - /* So we've got the dispatch interface; lets list the event methods */ - for (i = 0; i < attr->cFuncs; i++) { - zval *tmp; - DISPID lastid = 0; /* for props */ - int isprop; - - if (FAILED(ITypeInfo_GetFuncDesc(typeinfo, i, &func))) - break; - - isprop = (func->invkind & DISPATCH_PROPERTYGET || func->invkind & DISPATCH_PROPERTYPUT); - - if (!isprop || lastid != func->memid) { - - lastid = func->memid; - - ITypeInfo_GetDocumentation(typeinfo, func->memid, &olename, NULL, NULL, NULL); - ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage TSRMLS_CC); - SysFreeString(olename); - - if (printdef) { - int j; - char *funcdesc; - unsigned int funcdesclen, cnames = 0; - BSTR *names; - - names = (BSTR*)safe_emalloc((func->cParams + 1), sizeof(BSTR), 0); - - ITypeInfo_GetNames(typeinfo, func->memid, names, func->cParams + 1, &cnames); - /* first element is the function name */ - SysFreeString(names[0]); - - php_printf("\t/* DISPID=%d */\n", func->memid); - - if (func->elemdescFunc.tdesc.vt != VT_VOID) { - php_printf("\t/* %s [%d] */\n", - vt_to_string(func->elemdescFunc.tdesc.vt), - func->elemdescFunc.tdesc.vt - ); - } - - if (isprop) { - - ITypeInfo_GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL); - if (olename) { - funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage TSRMLS_CC); - SysFreeString(olename); - php_printf("\t/* %s */\n", funcdesc); - efree(funcdesc); - } - - php_printf("\tvar $%s;\n\n", ansiname); - - } else { - /* a function */ - - php_printf("\tfunction %s(\n", ansiname); - - for (j = 0; j < func->cParams; j++) { - ELEMDESC *elem = &func->lprgelemdescParam[j]; - - php_printf("\t\t/* %s [%d] ", vt_to_string(elem->tdesc.vt), elem->tdesc.vt); - - if (elem->paramdesc.wParamFlags & PARAMFLAG_FIN) - php_printf("[in]"); - if (elem->paramdesc.wParamFlags & PARAMFLAG_FOUT) - php_printf("[out]"); - - if (elem->tdesc.vt == VT_PTR) { - /* what does it point to ? */ - php_printf(" --> %s [%d] ", - vt_to_string(elem->tdesc.lptdesc->vt), - elem->tdesc.lptdesc->vt - ); - } - - /* when we handle prop put and get, this will look nicer */ - if (j+1 < (int)cnames) { - funcdesc = php_com_olestring_to_string(names[j+1], &funcdesclen, codepage TSRMLS_CC); - SysFreeString(names[j+1]); - } else { - funcdesc = "???"; - } - - php_printf(" */ %s%s%c\n", - elem->tdesc.vt == VT_PTR ? "&$" : "$", - funcdesc, - j == func->cParams - 1 ? ' ' : ',' - ); - - if (j+1 < (int)cnames) { - efree(funcdesc); - } - } - - php_printf("\t\t)\n\t{\n"); - - ITypeInfo_GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL); - if (olename) { - funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage TSRMLS_CC); - SysFreeString(olename); - php_printf("\t\t/* %s */\n", funcdesc); - efree(funcdesc); - } - - php_printf("\t}\n"); - } - - efree(names); - } - - if (id_to_name) { - zend_str_tolower(ansiname, ansinamelen); - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, ansiname, ansinamelen, 0); - zend_hash_index_update(id_to_name, func->memid, (void*)&tmp, sizeof(zval *), NULL); - } - } - ITypeInfo_ReleaseFuncDesc(typeinfo, func); - } - - if (printdef) { - php_printf("}\n"); - } - - ret = 1; - } else { - zend_error(E_WARNING, "That's not a dispatchable interface!! type kind = %08x", attr->typekind); - } - - ITypeInfo_ReleaseTypeAttr(typeinfo, attr); - - return ret; -} - - diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c deleted file mode 100644 index 0962e1fb01ea7..0000000000000 --- a/ext/com_dotnet/com_variant.c +++ /dev/null @@ -1,1070 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" - -/* create an automation SafeArray from a PHP array. - * Only creates a single-dimensional array of variants. - * The keys of the PHP hash MUST be numeric. If the array - * is sparse, then the gaps will be filled with NULL variants */ -static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC) -{ - SAFEARRAY *sa = NULL; - SAFEARRAYBOUND bound; - HashPosition pos; - int keytype; - char *strindex; - int strindexlen; - long intindex = -1; - long max_index = 0; - VARIANT *va; - zval **item; - - /* find the largest array index, and assert that all keys are integers */ - zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos); - for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) { - - keytype = zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &strindexlen, &intindex, 0, &pos); - - if (HASH_KEY_IS_STRING == keytype) { - goto bogus; - } else if (HASH_KEY_NON_EXISTANT == keytype) { - break; - } - if (intindex > max_index) { - max_index = intindex; - } - } - - /* allocate the structure */ - bound.lLbound = 0; - bound.cElements = intindex + 1; - sa = SafeArrayCreate(VT_VARIANT, 1, &bound); - - /* get a lock on the array itself */ - SafeArrayAccessData(sa, &va); - va = (VARIANT*)sa->pvData; - - /* now fill it in */ - zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos); - for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) { - if (FAILURE == zend_hash_get_current_data_ex(HASH_OF(z), (void**)&item, &pos)) { - break; - } - zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &strindexlen, &intindex, 0, &pos); - php_com_variant_from_zval(&va[intindex], *item, codepage TSRMLS_CC); - } - - /* Unlock it and stuff it into our variant */ - SafeArrayUnaccessData(sa); - V_VT(v) = VT_ARRAY|VT_VARIANT; - V_ARRAY(v) = sa; - - return; - -bogus: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: converting from PHP array to VARIANT array; only arrays with numeric keys are allowed"); - - V_VT(v) = VT_NULL; - - if (sa) { - SafeArrayUnlock(sa); - SafeArrayDestroy(sa); - } -} - -PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC) -{ - OLECHAR *olestring; - php_com_dotnet_object *obj; - - switch (Z_TYPE_P(z)) { - case IS_NULL: - V_VT(v) = VT_NULL; - break; - - case IS_BOOL: - V_VT(v) = VT_BOOL; - V_BOOL(v) = Z_BVAL_P(z) ? VARIANT_TRUE : VARIANT_FALSE; - break; - - case IS_OBJECT: - if (php_com_is_valid_object(z TSRMLS_CC)) { - obj = CDNO_FETCH(z); - if (V_VT(&obj->v) == VT_DISPATCH) { - /* pass the underlying object */ - V_VT(v) = VT_DISPATCH; - if (V_DISPATCH(&obj->v)) { - IDispatch_AddRef(V_DISPATCH(&obj->v)); - } - V_DISPATCH(v) = V_DISPATCH(&obj->v); - } else { - /* pass the variant by reference */ - V_VT(v) = VT_VARIANT | VT_BYREF; - V_VARIANTREF(v) = &obj->v; - } - } else { - /* export the PHP object using our COM wrapper */ - V_VT(v) = VT_DISPATCH; - V_DISPATCH(v) = php_com_wrapper_export(z TSRMLS_CC); - } - break; - - case IS_ARRAY: - /* map as safe array */ - safe_array_from_zval(v, z, codepage TSRMLS_CC); - break; - - case IS_LONG: - V_VT(v) = VT_I4; - V_I4(v) = Z_LVAL_P(z); - break; - - case IS_DOUBLE: - V_VT(v) = VT_R8; - V_R8(v) = Z_DVAL_P(z); - break; - - case IS_STRING: - V_VT(v) = VT_BSTR; - olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC); - V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR)); - efree(olestring); - break; - - case IS_RESOURCE: - case IS_CONSTANT: - case IS_CONSTANT_ARRAY: - default: - V_VT(v) = VT_NULL; - break; - } -} - -PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC) -{ - OLECHAR *olestring = NULL; - int ret = SUCCESS; - - switch (V_VT(v)) { - case VT_EMPTY: - case VT_NULL: - case VT_VOID: - ZVAL_NULL(z); - break; - case VT_UI1: - ZVAL_LONG(z, (long)V_UI1(v)); - break; - case VT_I1: - ZVAL_LONG(z, (long)V_I1(v)); - break; - case VT_UI2: - ZVAL_LONG(z, (long)V_UI2(v)); - break; - case VT_I2: - ZVAL_LONG(z, (long)V_I2(v)); - break; - case VT_UI4: /* TODO: promote to double if large? */ - ZVAL_LONG(z, (long)V_UI4(v)); - break; - case VT_I4: - ZVAL_LONG(z, (long)V_I4(v)); - break; - case VT_INT: - ZVAL_LONG(z, V_INT(v)); - break; - case VT_UINT: /* TODO: promote to double if large? */ - ZVAL_LONG(z, (long)V_UINT(v)); - break; - case VT_R4: - ZVAL_DOUBLE(z, (double)V_R4(v)); - break; - case VT_R8: - ZVAL_DOUBLE(z, V_R8(v)); - break; - case VT_BOOL: - ZVAL_BOOL(z, V_BOOL(v) ? 1 : 0); - break; - case VT_BSTR: - olestring = V_BSTR(v); - if (olestring) { - Z_TYPE_P(z) = IS_STRING; - Z_STRVAL_P(z) = php_com_olestring_to_string(olestring, - &Z_STRLEN_P(z), codepage TSRMLS_CC); - olestring = NULL; - } - break; - case VT_UNKNOWN: - if (V_UNKNOWN(v) != NULL) { - IDispatch *disp; - - if (SUCCEEDED(IUnknown_QueryInterface(V_UNKNOWN(v), &IID_IDispatch, &disp))) { - php_com_wrap_dispatch(z, disp, codepage TSRMLS_CC); - IDispatch_Release(disp); - } else { - ret = FAILURE; - } - } - break; - - case VT_DISPATCH: - if (V_DISPATCH(v) != NULL) { - php_com_wrap_dispatch(z, V_DISPATCH(v), codepage TSRMLS_CC); - } - break; - - case VT_VARIANT: - /* points to another variant */ - return php_com_zval_from_variant(z, V_VARIANTREF(v), codepage TSRMLS_CC); - - default: - php_com_wrap_variant(z, v, codepage TSRMLS_CC); - } - - if (olestring) { - efree(olestring); - } - - if (ret == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant->zval: conversion from 0x%x ret=%d", V_VT(v), ret); - } - - return ret; -} - - -PHPAPI int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC) -{ - int ret = SUCCESS; - - switch (V_VT(dstvar) & ~VT_BYREF) { - case VT_EMPTY: - case VT_NULL: - case VT_VOID: - /* should not be possible */ - break; - - case VT_UI1: - if (V_VT(dstvar) & VT_BYREF) { - *V_UI1REF(dstvar) = V_UI1(srcvar); - } else { - V_UI1(dstvar) = V_UI1(srcvar); - } - break; - - case VT_I1: - if (V_VT(dstvar) & VT_BYREF) { - *V_I1REF(dstvar) = V_I1(srcvar); - } else { - V_I1(dstvar) = V_I1(srcvar); - } - break; - - case VT_UI2: - if (V_VT(dstvar) & VT_BYREF) { - *V_UI2REF(dstvar) = V_UI2(srcvar); - } else { - V_UI2(dstvar) = V_UI2(srcvar); - } - break; - - case VT_I2: - if (V_VT(dstvar) & VT_BYREF) { - *V_I2REF(dstvar) = V_I2(srcvar); - } else { - V_I2(dstvar) = V_I2(srcvar); - } - break; - - case VT_UI4: - if (V_VT(dstvar) & VT_BYREF) { - *V_UI4REF(dstvar) = V_UI4(srcvar); - } else { - V_UI4(dstvar) = V_UI4(srcvar); - } - break; - - case VT_I4: - if (V_VT(dstvar) & VT_BYREF) { - *V_I4REF(dstvar) = V_I4(srcvar); - } else { - V_I4(dstvar) = V_I4(srcvar); - } - break; - - case VT_INT: - if (V_VT(dstvar) & VT_BYREF) { - *V_INTREF(dstvar) = V_INT(srcvar); - } else { - V_INT(dstvar) = V_INT(srcvar); - } - break; - - case VT_UINT: - if (V_VT(dstvar) & VT_BYREF) { - *V_UINTREF(dstvar) = V_UINT(srcvar); - } else { - V_UINT(dstvar) = V_UINT(srcvar); - } - break; - - case VT_R4: - if (V_VT(dstvar) & VT_BYREF) { - *V_R4REF(dstvar) = V_R4(srcvar); - } else { - V_R4(dstvar) = V_R4(srcvar); - } - break; - - case VT_R8: - if (V_VT(dstvar) & VT_BYREF) { - *V_R8REF(dstvar) = V_R8(srcvar); - } else { - V_R8(dstvar) = V_R8(srcvar); - } - break; - - case VT_BOOL: - if (V_VT(dstvar) & VT_BYREF) { - *V_BOOLREF(dstvar) = V_BOOL(srcvar); - } else { - V_BOOL(dstvar) = V_BOOL(srcvar); - } - break; - - case VT_BSTR: - if (V_VT(dstvar) & VT_BYREF) { - *V_BSTRREF(dstvar) = V_BSTR(srcvar); - } else { - V_BSTR(dstvar) = V_BSTR(srcvar); - } - break; - - case VT_UNKNOWN: - if (V_VT(dstvar) & VT_BYREF) { - *V_UNKNOWNREF(dstvar) = V_UNKNOWN(srcvar); - } else { - V_UNKNOWN(dstvar) = V_UNKNOWN(srcvar); - } - break; - - case VT_DISPATCH: - if (V_VT(dstvar) & VT_BYREF) { - *V_DISPATCHREF(dstvar) = V_DISPATCH(srcvar); - } else { - V_DISPATCH(dstvar) = V_DISPATCH(srcvar); - } - break; - - case VT_VARIANT: - return php_com_copy_variant(V_VARIANTREF(dstvar), srcvar TSRMLS_CC); - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant->variant: failed to copy from 0x%x to 0x%x", V_VT(dstvar), V_VT(srcvar)); - ret = FAILURE; - } - return ret; -} - -/* {{{ com_variant_create_instance - ctor for new VARIANT() */ -PHP_FUNCTION(com_variant_create_instance) -{ - /* VARTYPE == unsigned short */ long vt = VT_EMPTY; - long codepage = CP_ACP; - zval *object = getThis(); - php_com_dotnet_object *obj; - zval *zvalue = NULL; - HRESULT res; - - if (ZEND_NUM_ARGS() == 0) { - /* just leave things as-is - an empty variant */ - return; - } - - obj = CDNO_FETCH(object); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!|ll", &zvalue, &vt, &codepage)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC); - return; - } - - php_com_initialize(TSRMLS_C); - if (ZEND_NUM_ARGS() == 3) { - obj->code_page = codepage; - } - - if (zvalue) { - php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC); - } - - /* Only perform conversion if variant not already of type passed */ - if ((ZEND_NUM_ARGS() >= 2) && (vt != V_VT(&obj->v))) { - - /* If already an array and VT_ARRAY is passed then: - - if only VT_ARRAY passed then do not perform a conversion - - if VT_ARRAY plus other type passed then perform conversion - but will probably fail (origional behavior) - */ - if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) { - long orig_vt = vt; - - vt &= ~VT_ARRAY; - if (vt) { - vt = orig_vt; - } - } - - if (vt) { - res = VariantChangeType(&obj->v, &obj->v, 0, (VARTYPE)vt); - - if (FAILED(res)) { - char *werr, *msg; - - werr = php_win_err(res); - spprintf(&msg, 0, "Variant type conversion failed: %s", werr); - LocalFree(werr); - - php_com_throw_exception(res, msg TSRMLS_CC); - efree(msg); - } - } - } - - if (V_VT(&obj->v) != VT_DISPATCH && obj->typeinfo) { - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } -} -/* }}} */ - -/* {{{ proto void variant_set(object variant, mixed value) - Assigns a new value for a variant object */ -PHP_FUNCTION(variant_set) -{ - zval *zobj, *zvalue = NULL; - php_com_dotnet_object *obj; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "Oz!", &zobj, php_com_variant_class_entry, &zvalue)) { - return; - } - - obj = CDNO_FETCH(zobj); - - /* dtor the old value */ - if (obj->typeinfo) { - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } - if (obj->sink_dispatch) { - php_com_object_enable_event_sink(obj, FALSE TSRMLS_CC); - IDispatch_Release(obj->sink_dispatch); - obj->sink_dispatch = NULL; - } - - VariantClear(&obj->v); - - php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC); - /* remember we modified this variant */ - obj->modified = 1; -} -/* }}} */ - -enum variant_binary_opcode { - VOP_ADD, VOP_CAT, VOP_SUB, VOP_MUL, VOP_AND, VOP_DIV, - VOP_EQV, VOP_IDIV, VOP_IMP, VOP_MOD, VOP_OR, VOP_POW, - VOP_XOR -}; - -enum variant_unary_opcode { - VOP_ABS, VOP_FIX, VOP_INT, VOP_NEG, VOP_NOT -}; - -static void variant_binary_operation(enum variant_binary_opcode op, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ -{ - VARIANT vres; - VARIANT left_val, right_val; - VARIANT *vleft = NULL, *vright = NULL; - zval *zleft = NULL, *zright = NULL; - php_com_dotnet_object *obj; - HRESULT result; - int codepage = CP_ACP; - - VariantInit(&left_val); - VariantInit(&right_val); - VariantInit(&vres); - - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "OO", &zleft, php_com_variant_class_entry, - &zright, php_com_variant_class_entry)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - obj = CDNO_FETCH(zright); - vright = &obj->v; - } else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "Oz!", &zleft, php_com_variant_class_entry, - &zright)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - vright = &right_val; - php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC); - } else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "z!O", &zleft, &zright, php_com_variant_class_entry)) { - obj = CDNO_FETCH(zright); - vright = &obj->v; - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!z!", &zleft, &zright)) { - - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - - vright = &right_val; - php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC); - - } else { - return; - } - - switch (op) { - case VOP_ADD: - result = VarAdd(vleft, vright, &vres); - break; - case VOP_CAT: - result = VarCat(vleft, vright, &vres); - break; - case VOP_SUB: - result = VarSub(vleft, vright, &vres); - break; - case VOP_MUL: - result = VarMul(vleft, vright, &vres); - break; - case VOP_AND: - result = VarAnd(vleft, vright, &vres); - break; - case VOP_DIV: - result = VarDiv(vleft, vright, &vres); - break; - case VOP_EQV: - result = VarEqv(vleft, vright, &vres); - break; - case VOP_IDIV: - result = VarIdiv(vleft, vright, &vres); - break; - case VOP_IMP: - result = VarImp(vleft, vright, &vres); - break; - case VOP_MOD: - result = VarMod(vleft, vright, &vres); - break; - case VOP_OR: - result = VarOr(vleft, vright, &vres); - break; - case VOP_POW: - result = VarPow(vleft, vright, &vres); - break; - case VOP_XOR: - result = VarXor(vleft, vright, &vres); - break; - } - - if (SUCCEEDED(result)) { - php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC); - } else { - php_com_throw_exception(result, NULL TSRMLS_CC); - } - - VariantClear(&vres); - VariantClear(&left_val); - VariantClear(&right_val); -} -/* }}} */ - -/* {{{ proto mixed variant_add(mixed left, mixed right) - "Adds" two variant values together and returns the result */ -PHP_FUNCTION(variant_add) -{ - variant_binary_operation(VOP_ADD, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_cat(mixed left, mixed right) - concatenates two variant values together and returns the result */ -PHP_FUNCTION(variant_cat) -{ - variant_binary_operation(VOP_CAT, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_sub(mixed left, mixed right) - subtracts the value of the right variant from the left variant value and returns the result */ -PHP_FUNCTION(variant_sub) -{ - variant_binary_operation(VOP_SUB, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_mul(mixed left, mixed right) - multiplies the values of the two variants and returns the result */ -PHP_FUNCTION(variant_mul) -{ - variant_binary_operation(VOP_MUL, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_and(mixed left, mixed right) - performs a bitwise AND operation between two variants and returns the result */ -PHP_FUNCTION(variant_and) -{ - variant_binary_operation(VOP_AND, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_div(mixed left, mixed right) - Returns the result from dividing two variants */ -PHP_FUNCTION(variant_div) -{ - variant_binary_operation(VOP_DIV, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_eqv(mixed left, mixed right) - Performs a bitwise equivalence on two variants */ -PHP_FUNCTION(variant_eqv) -{ - variant_binary_operation(VOP_EQV, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_idiv(mixed left, mixed right) - Converts variants to integers and then returns the result from dividing them */ -PHP_FUNCTION(variant_idiv) -{ - variant_binary_operation(VOP_IDIV, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_imp(mixed left, mixed right) - Performs a bitwise implication on two variants */ -PHP_FUNCTION(variant_imp) -{ - variant_binary_operation(VOP_IMP, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_mod(mixed left, mixed right) - Divides two variants and returns only the remainder */ -PHP_FUNCTION(variant_mod) -{ - variant_binary_operation(VOP_MOD, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_or(mixed left, mixed right) - Performs a logical disjunction on two variants */ -PHP_FUNCTION(variant_or) -{ - variant_binary_operation(VOP_OR, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_pow(mixed left, mixed right) - Returns the result of performing the power function with two variants */ -PHP_FUNCTION(variant_pow) -{ - variant_binary_operation(VOP_POW, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_xor(mixed left, mixed right) - Performs a logical exclusion on two variants */ -PHP_FUNCTION(variant_xor) -{ - variant_binary_operation(VOP_XOR, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -static void variant_unary_operation(enum variant_unary_opcode op, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ -{ - VARIANT vres; - VARIANT left_val; - VARIANT *vleft = NULL; - zval *zleft = NULL; - php_com_dotnet_object *obj; - HRESULT result; - int codepage = CP_ACP; - - VariantInit(&left_val); - VariantInit(&vres); - - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "O", &zleft, php_com_variant_class_entry)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!", &zleft)) { - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - } else { - return; - } - - switch (op) { - case VOP_ABS: - result = VarAbs(vleft, &vres); - break; - case VOP_FIX: - result = VarFix(vleft, &vres); - break; - case VOP_INT: - result = VarInt(vleft, &vres); - break; - case VOP_NEG: - result = VarNeg(vleft, &vres); - break; - case VOP_NOT: - result = VarNot(vleft, &vres); - break; - } - - if (SUCCEEDED(result)) { - php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC); - } else { - php_com_throw_exception(result, NULL TSRMLS_CC); - } - - VariantClear(&vres); - VariantClear(&left_val); -} -/* }}} */ - -/* {{{ proto mixed variant_abs(mixed left) - Returns the absolute value of a variant */ -PHP_FUNCTION(variant_abs) -{ - variant_unary_operation(VOP_ABS, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_fix(mixed left) - Returns the integer part ? of a variant */ -PHP_FUNCTION(variant_fix) -{ - variant_unary_operation(VOP_FIX, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_int(mixed left) - Returns the integer portion of a variant */ -PHP_FUNCTION(variant_int) -{ - variant_unary_operation(VOP_INT, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_neg(mixed left) - Performs logical negation on a variant */ -PHP_FUNCTION(variant_neg) -{ - variant_unary_operation(VOP_NEG, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_not(mixed left) - Performs bitwise not negation on a variant */ -PHP_FUNCTION(variant_not) -{ - variant_unary_operation(VOP_NOT, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto mixed variant_round(mixed left, int decimals) - Rounds a variant to the specified number of decimal places */ -PHP_FUNCTION(variant_round) -{ - VARIANT vres; - VARIANT left_val; - VARIANT *vleft = NULL; - zval *zleft = NULL; - php_com_dotnet_object *obj; - int codepage = CP_ACP; - long decimals = 0; - - VariantInit(&left_val); - VariantInit(&vres); - - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &zleft, php_com_variant_class_entry, &decimals)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!l", &zleft, &decimals)) { - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - } else { - return; - } - - if (SUCCEEDED(VarRound(vleft, decimals, &vres))) { - php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC); - } - - VariantClear(&vres); - VariantClear(&left_val); -} -/* }}} */ - -/* {{{ proto int variant_cmp(mixed left, mixed right [, int lcid [, int flags]]) - Compares two variants */ -PHP_FUNCTION(variant_cmp) -{ - VARIANT left_val, right_val; - VARIANT *vleft = NULL, *vright = NULL; - zval *zleft = NULL, *zright = NULL; - php_com_dotnet_object *obj; - int codepage = CP_ACP; - long lcid = LOCALE_SYSTEM_DEFAULT; - long flags = 0; - /* it is safe to ignore the warning for this line; see the comments in com_handlers.c */ - STDAPI VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid, DWORD flags); - - VariantInit(&left_val); - VariantInit(&right_val); - - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "OO|ll", &zleft, php_com_variant_class_entry, - &zright, php_com_variant_class_entry, &lcid, &flags)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - obj = CDNO_FETCH(zright); - vright = &obj->v; - } else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "Oz!|ll", &zleft, php_com_variant_class_entry, - &zright, &lcid, &flags)) { - obj = CDNO_FETCH(zleft); - vleft = &obj->v; - vright = &right_val; - php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC); - } else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, - ZEND_NUM_ARGS() TSRMLS_CC, "z!O|ll", &zleft, &zright, php_com_variant_class_entry, - &lcid, &flags)) { - obj = CDNO_FETCH(zright); - vright = &obj->v; - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "z!z!|ll", &zleft, &zright, &lcid, &flags)) { - - vleft = &left_val; - php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC); - - vright = &right_val; - php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC); - - } else { - return; - } - - ZVAL_LONG(return_value, VarCmp(vleft, vright, lcid, flags)); - - VariantClear(&left_val); - VariantClear(&right_val); -} -/* }}} */ - -/* {{{ proto int variant_date_to_timestamp(object variant) - Converts a variant date/time value to unix timestamp */ -PHP_FUNCTION(variant_date_to_timestamp) -{ - VARIANT vres; - zval *zleft = NULL; - php_com_dotnet_object *obj; - - VariantInit(&vres); - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "O", &zleft, php_com_variant_class_entry)) { - return; - } - obj = CDNO_FETCH(zleft); - - if (SUCCEEDED(VariantChangeType(&vres, &obj->v, 0, VT_DATE))) { - SYSTEMTIME systime; - struct tm tmv; - - VariantTimeToSystemTime(V_DATE(&vres), &systime); - - memset(&tmv, 0, sizeof(tmv)); - tmv.tm_year = systime.wYear - 1900; - tmv.tm_mon = systime.wMonth - 1; - tmv.tm_mday = systime.wDay; - tmv.tm_hour = systime.wHour; - tmv.tm_min = systime.wMinute; - tmv.tm_sec = systime.wSecond; - tmv.tm_isdst = -1; - - tzset(); - RETVAL_LONG(mktime(&tmv)); - } - - VariantClear(&vres); -} -/* }}} */ - -/* {{{ proto object variant_date_from_timestamp(int timestamp) - Returns a variant date representation of a unix timestamp */ -PHP_FUNCTION(variant_date_from_timestamp) -{ - long timestamp; - time_t ttstamp; - SYSTEMTIME systime; - struct tm *tmv; - VARIANT res; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", - ×tamp)) { - return; - } - - if (timestamp < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timestamp value must be a positive value."); - RETURN_FALSE; - } - - VariantInit(&res); - tzset(); - ttstamp = timestamp; - tmv = localtime(&ttstamp); - memset(&systime, 0, sizeof(systime)); - - systime.wDay = tmv->tm_mday; - systime.wHour = tmv->tm_hour; - systime.wMinute = tmv->tm_min; - systime.wMonth = tmv->tm_mon + 1; - systime.wSecond = tmv->tm_sec; - systime.wYear = tmv->tm_year + 1900; - - V_VT(&res) = VT_DATE; - SystemTimeToVariantTime(&systime, &V_DATE(&res)); - - php_com_wrap_variant(return_value, &res, CP_ACP TSRMLS_CC); - - VariantClear(&res); -} -/* }}} */ - -/* {{{ proto int variant_get_type(object variant) - Returns the VT_XXX type code for a variant */ -PHP_FUNCTION(variant_get_type) -{ - zval *zobj; - php_com_dotnet_object *obj; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "O", &zobj, php_com_variant_class_entry)) { - return; - } - obj = CDNO_FETCH(zobj); - - RETURN_LONG(V_VT(&obj->v)); -} -/* }}} */ - -/* {{{ proto void variant_set_type(object variant, int type) - Convert a variant into another type. Variant is modified "in-place" */ -PHP_FUNCTION(variant_set_type) -{ - zval *zobj; - php_com_dotnet_object *obj; - /* VARTYPE == unsigned short */ long vt; - HRESULT res; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "Ol", &zobj, php_com_variant_class_entry, &vt)) { - return; - } - obj = CDNO_FETCH(zobj); - - res = VariantChangeType(&obj->v, &obj->v, 0, (VARTYPE)vt); - - if (SUCCEEDED(res)) { - if (vt != VT_DISPATCH && obj->typeinfo) { - ITypeInfo_Release(obj->typeinfo); - obj->typeinfo = NULL; - } - } else { - char *werr, *msg; - - werr = php_win_err(res); - spprintf(&msg, 0, "Variant type conversion failed: %s", werr); - LocalFree(werr); - - php_com_throw_exception(res, msg TSRMLS_CC); - efree(msg); - } -} -/* }}} */ - -/* {{{ proto object variant_cast(object variant, int type) - Convert a variant into a new variant object of another type */ -PHP_FUNCTION(variant_cast) -{ - zval *zobj; - php_com_dotnet_object *obj; - /* VARTYPE == unsigned short */ long vt; - VARIANT vres; - HRESULT res; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "Ol", &zobj, php_com_variant_class_entry, &vt)) { - return; - } - obj = CDNO_FETCH(zobj); - - VariantInit(&vres); - res = VariantChangeType(&vres, &obj->v, 0, (VARTYPE)vt); - - if (SUCCEEDED(res)) { - php_com_wrap_variant(return_value, &vres, obj->code_page TSRMLS_CC); - } else { - char *werr, *msg; - - werr = php_win_err(res); - spprintf(&msg, 0, "Variant type conversion failed: %s", werr); - LocalFree(werr); - - php_com_throw_exception(res, msg TSRMLS_CC); - efree(msg); - } - - VariantClear(&vres); -} -/* }}} */ - diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c deleted file mode 100644 index de5e1ef14a4e9..0000000000000 --- a/ext/com_dotnet/com_wrapper.c +++ /dev/null @@ -1,657 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* This module exports a PHP object as a COM object by wrapping it - * using IDispatchEx */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_com_dotnet.h" -#include "php_com_dotnet_internal.h" - -typedef struct { - /* This first part MUST match the declaration - * of interface IDispatchEx */ - CONST_VTBL struct IDispatchExVtbl *lpVtbl; - - /* now the PHP stuff */ - - DWORD engine_thread; /* for sanity checking */ - zval *object; /* the object exported */ - LONG refcount; /* COM reference count */ - - HashTable *dispid_to_name; /* keep track of dispid -> name mappings */ - HashTable *name_to_dispid; /* keep track of name -> dispid mappings */ - - GUID sinkid; /* iid that we "implement" for event sinking */ - - int id; -} php_dispatchex; - -static int le_dispatch; - -static void disp_destructor(php_dispatchex *disp); - -static void dispatch_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_dispatchex *disp = (php_dispatchex *)rsrc->ptr; - disp_destructor(disp); -} - -int php_com_wrapper_minit(INIT_FUNC_ARGS) -{ - le_dispatch = zend_register_list_destructors_ex(dispatch_dtor, - NULL, "com_dotnet_dispatch_wrapper", module_number); - return le_dispatch; -} - - -/* {{{ trace */ -static inline void trace(char *fmt, ...) -{ - va_list ap; - char buf[4096]; - - snprintf(buf, sizeof(buf), "T=%08x ", GetCurrentThreadId()); - OutputDebugString(buf); - - va_start(ap, fmt); - vsnprintf(buf, sizeof(buf), fmt, ap); - - OutputDebugString(buf); - - va_end(ap); -} -/* }}} */ - -#ifdef ZTS -# define TSRMLS_FIXED() TSRMLS_FETCH(); -#else -# define TSRMLS_FIXED() -#endif - -#define FETCH_DISP(methname) \ - TSRMLS_FIXED() \ - php_dispatchex *disp = (php_dispatchex*)This; \ - if (COMG(rshutdown_started)) { \ - trace(" PHP Object:%p (name:unknown) %s\n", disp->object, methname); \ - } else { \ - trace(" PHP Object:%p (name:%s) %s\n", disp->object, Z_OBJCE_P(disp->object)->name, methname); \ - } \ - if (GetCurrentThreadId() != disp->engine_thread) { \ - return RPC_E_WRONG_THREAD; \ - } - -static HRESULT STDMETHODCALLTYPE disp_queryinterface( - IDispatchEx *This, - /* [in] */ REFIID riid, - /* [iid_is][out] */ void **ppvObject) -{ - FETCH_DISP("QueryInterface"); - - if (IsEqualGUID(&IID_IUnknown, riid) || - IsEqualGUID(&IID_IDispatch, riid) || - IsEqualGUID(&IID_IDispatchEx, riid) || - IsEqualGUID(&disp->sinkid, riid)) { - *ppvObject = This; - InterlockedIncrement(&disp->refcount); - return S_OK; - } - - *ppvObject = NULL; - return E_NOINTERFACE; -} - -static ULONG STDMETHODCALLTYPE disp_addref(IDispatchEx *This) -{ - FETCH_DISP("AddRef"); - - return InterlockedIncrement(&disp->refcount); -} - -static ULONG STDMETHODCALLTYPE disp_release(IDispatchEx *This) -{ - ULONG ret; - FETCH_DISP("Release"); - - ret = InterlockedDecrement(&disp->refcount); - trace("-- refcount now %d\n", ret); - if (ret == 0) { - /* destroy it */ - if (disp->id) - zend_list_delete(disp->id); - } - return ret; -} - -static HRESULT STDMETHODCALLTYPE disp_gettypeinfocount( - IDispatchEx *This, - /* [out] */ UINT *pctinfo) -{ - FETCH_DISP("GetTypeInfoCount"); - - *pctinfo = 0; - return S_OK; -} - -static HRESULT STDMETHODCALLTYPE disp_gettypeinfo( - IDispatchEx *This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ ITypeInfo **ppTInfo) -{ - FETCH_DISP("GetTypeInfo"); - - *ppTInfo = NULL; - return DISP_E_BADINDEX; -} - -static HRESULT STDMETHODCALLTYPE disp_getidsofnames( - IDispatchEx *This, - /* [in] */ REFIID riid, - /* [size_is][in] */ LPOLESTR *rgszNames, - /* [in] */ UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ DISPID *rgDispId) -{ - UINT i; - HRESULT ret = S_OK; - FETCH_DISP("GetIDsOfNames"); - - for (i = 0; i < cNames; i++) { - char *name; - unsigned int namelen; - zval **tmp; - - name = php_com_olestring_to_string(rgszNames[i], &namelen, COMG(code_page) TSRMLS_CC); - - /* Lookup the name in the hash */ - if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == FAILURE) { - ret = DISP_E_UNKNOWNNAME; - rgDispId[i] = 0; - } else { - rgDispId[i] = Z_LVAL_PP(tmp); - } - - efree(name); - - } - - return ret; -} - -static HRESULT STDMETHODCALLTYPE disp_invoke( - IDispatchEx *This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr) -{ - return This->lpVtbl->InvokeEx(This, dispIdMember, - lcid, wFlags, pDispParams, - pVarResult, pExcepInfo, NULL); -} - -static HRESULT STDMETHODCALLTYPE disp_getdispid( - IDispatchEx *This, - /* [in] */ BSTR bstrName, - /* [in] */ DWORD grfdex, - /* [out] */ DISPID *pid) -{ - HRESULT ret = DISP_E_UNKNOWNNAME; - char *name; - unsigned int namelen; - zval **tmp; - FETCH_DISP("GetDispID"); - - name = php_com_olestring_to_string(bstrName, &namelen, COMG(code_page) TSRMLS_CC); - - trace("Looking for %s, namelen=%d in %p\n", name, namelen, disp->name_to_dispid); - - /* Lookup the name in the hash */ - if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS) { - trace("found it\n"); - *pid = Z_LVAL_PP(tmp); - ret = S_OK; - } - - efree(name); - - return ret; -} - -static HRESULT STDMETHODCALLTYPE disp_invokeex( - IDispatchEx *This, - /* [in] */ DISPID id, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [in] */ DISPPARAMS *pdp, - /* [out] */ VARIANT *pvarRes, - /* [out] */ EXCEPINFO *pei, - /* [unique][in] */ IServiceProvider *pspCaller) -{ - zval **name; - UINT i; - zval *retval = NULL; - zval ***params = NULL; - HRESULT ret = DISP_E_MEMBERNOTFOUND; - FETCH_DISP("InvokeEx"); - - if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) { - /* TODO: add support for overloaded objects */ - - trace("-- Invoke: %d %20s [%d] flags=%08x args=%d\n", id, Z_STRVAL_PP(name), Z_STRLEN_PP(name), wFlags, pdp->cArgs); - - /* convert args into zvals. - * Args are in reverse order */ - if (pdp->cArgs) { - params = (zval ***)safe_emalloc(sizeof(zval **), pdp->cArgs, 0); - for (i = 0; i < pdp->cArgs; i++) { - VARIANT *arg; - zval *zarg; - - arg = &pdp->rgvarg[ pdp->cArgs - 1 - i]; - - trace("alloc zval for arg %d VT=%08x\n", i, V_VT(arg)); - - ALLOC_INIT_ZVAL(zarg); - php_com_wrap_variant(zarg, arg, COMG(code_page) TSRMLS_CC); - params[i] = (zval**)emalloc(sizeof(zval**)); - *params[i] = zarg; - } - } - - trace("arguments processed, prepare to do some work\n"); - - /* TODO: if PHP raises an exception here, we should catch it - * and expose it as a COM exception */ - - if (wFlags & DISPATCH_PROPERTYGET) { - retval = zend_read_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, 1 TSRMLS_CC); - } else if (wFlags & DISPATCH_PROPERTYPUT) { - zend_update_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, *params[0] TSRMLS_CC); - } else if (wFlags & DISPATCH_METHOD) { - zend_try { - if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name, - &retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) { - ret = S_OK; - trace("function called ok\n"); - - /* Copy any modified values to callers copy of variant*/ - for (i = 0; i < pdp->cArgs; i++) { - php_com_dotnet_object *obj = CDNO_FETCH(*params[i]); - VARIANT *srcvar = &obj->v; - VARIANT *dstvar = &pdp->rgvarg[ pdp->cArgs - 1 - i]; - if ((V_VT(dstvar) & VT_BYREF) && obj->modified ) { - trace("percolate modified value for arg %d VT=%08x\n", i, V_VT(dstvar)); - php_com_copy_variant(dstvar, srcvar TSRMLS_CC); - } - } - } else { - trace("failed to call func\n"); - ret = DISP_E_EXCEPTION; - } - } zend_catch { - trace("something blew up\n"); - ret = DISP_E_EXCEPTION; - } zend_end_try(); - } else { - trace("Don't know how to handle this invocation %08x\n", wFlags); - } - - /* release arguments */ - if (params) { - for (i = 0; i < pdp->cArgs; i++) { - zval_ptr_dtor(params[i]); - efree(params[i]); - } - efree(params); - } - - /* return value */ - if (retval) { - if (pvarRes) { - VariantInit(pvarRes); - php_com_variant_from_zval(pvarRes, retval, COMG(code_page) TSRMLS_CC); - } - zval_ptr_dtor(&retval); - } else if (pvarRes) { - VariantInit(pvarRes); - } - - } else { - trace("InvokeEx: I don't support DISPID=%d\n", id); - } - - return ret; -} - -static HRESULT STDMETHODCALLTYPE disp_deletememberbyname( - IDispatchEx *This, - /* [in] */ BSTR bstrName, - /* [in] */ DWORD grfdex) -{ - FETCH_DISP("DeleteMemberByName"); - - /* TODO: unset */ - - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE disp_deletememberbydispid( - IDispatchEx *This, - /* [in] */ DISPID id) -{ - FETCH_DISP("DeleteMemberByDispID"); - - /* TODO: unset */ - - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE disp_getmemberproperties( - IDispatchEx *This, - /* [in] */ DISPID id, - /* [in] */ DWORD grfdexFetch, - /* [out] */ DWORD *pgrfdex) -{ - FETCH_DISP("GetMemberProperties"); - - return DISP_E_UNKNOWNNAME; -} - -static HRESULT STDMETHODCALLTYPE disp_getmembername( - IDispatchEx *This, - /* [in] */ DISPID id, - /* [out] */ BSTR *pbstrName) -{ - zval *name; - FETCH_DISP("GetMemberName"); - - if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) { - OLECHAR *olestr = php_com_string_to_olestring(Z_STRVAL_P(name), Z_STRLEN_P(name), COMG(code_page) TSRMLS_CC); - *pbstrName = SysAllocString(olestr); - efree(olestr); - return S_OK; - } else { - return DISP_E_UNKNOWNNAME; - } -} - -static HRESULT STDMETHODCALLTYPE disp_getnextdispid( - IDispatchEx *This, - /* [in] */ DWORD grfdex, - /* [in] */ DISPID id, - /* [out] */ DISPID *pid) -{ - ulong next = id+1; - FETCH_DISP("GetNextDispID"); - - while(!zend_hash_index_exists(disp->dispid_to_name, next)) - next++; - - if (zend_hash_index_exists(disp->dispid_to_name, next)) { - *pid = next; - return S_OK; - } - return S_FALSE; -} - -static HRESULT STDMETHODCALLTYPE disp_getnamespaceparent( - IDispatchEx *This, - /* [out] */ IUnknown **ppunk) -{ - FETCH_DISP("GetNameSpaceParent"); - - *ppunk = NULL; - return E_NOTIMPL; -} - -static struct IDispatchExVtbl php_dispatch_vtbl = { - disp_queryinterface, - disp_addref, - disp_release, - disp_gettypeinfocount, - disp_gettypeinfo, - disp_getidsofnames, - disp_invoke, - disp_getdispid, - disp_invokeex, - disp_deletememberbyname, - disp_deletememberbydispid, - disp_getmemberproperties, - disp_getmembername, - disp_getnextdispid, - disp_getnamespaceparent -}; - - -/* enumerate functions and properties of the object and assign - * dispatch ids */ -static void generate_dispids(php_dispatchex *disp TSRMLS_DC) -{ - HashPosition pos; - char *name = NULL; - zval *tmp; - int namelen; - int keytype; - ulong pid; - - if (disp->dispid_to_name == NULL) { - ALLOC_HASHTABLE(disp->dispid_to_name); - ALLOC_HASHTABLE(disp->name_to_dispid); - zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_init(disp->dispid_to_name, 0, NULL, ZVAL_PTR_DTOR, 0); - } - - /* properties */ - if (Z_OBJPROP_P(disp->object)) { - zend_hash_internal_pointer_reset_ex(Z_OBJPROP_P(disp->object), &pos); - while (HASH_KEY_NON_EXISTANT != (keytype = - zend_hash_get_current_key_ex(Z_OBJPROP_P(disp->object), &name, - &namelen, &pid, 0, &pos))) { - char namebuf[32]; - if (keytype == HASH_KEY_IS_LONG) { - snprintf(namebuf, sizeof(namebuf), "%d", pid); - name = namebuf; - namelen = strlen(namebuf)+1; - } - - zend_hash_move_forward_ex(Z_OBJPROP_P(disp->object), &pos); - - /* Find the existing id */ - if (zend_hash_find(disp->name_to_dispid, name, namelen, (void**)&tmp) == SUCCESS) - continue; - - /* add the mappings */ - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, name, namelen-1, 1); - pid = zend_hash_next_free_element(disp->dispid_to_name); - zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL); - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, pid); - zend_hash_update(disp->name_to_dispid, name, namelen, (void*)&tmp, sizeof(zval *), NULL); - } - } - - /* functions */ - if (Z_OBJCE_P(disp->object)) { - zend_hash_internal_pointer_reset_ex(&Z_OBJCE_P(disp->object)->function_table, &pos); - while (HASH_KEY_NON_EXISTANT != (keytype = - zend_hash_get_current_key_ex(&Z_OBJCE_P(disp->object)->function_table, - &name, &namelen, &pid, 0, &pos))) { - - char namebuf[32]; - if (keytype == HASH_KEY_IS_LONG) { - snprintf(namebuf, sizeof(namebuf), "%d", pid); - name = namebuf; - namelen = strlen(namebuf) + 1; - } - - zend_hash_move_forward_ex(Z_OBJPROP_P(disp->object), &pos); - - /* Find the existing id */ - if (zend_hash_find(disp->name_to_dispid, name, namelen, (void**)&tmp) == SUCCESS) - continue; - - /* add the mappings */ - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, name, namelen-1, 1); - pid = zend_hash_next_free_element(disp->dispid_to_name); - zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL); - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, pid); - zend_hash_update(disp->name_to_dispid, name, namelen, (void*)&tmp, sizeof(zval *), NULL); - } - } -} - -static php_dispatchex *disp_constructor(zval *object TSRMLS_DC) -{ - php_dispatchex *disp = (php_dispatchex*)CoTaskMemAlloc(sizeof(php_dispatchex)); - - trace("constructing a COM wrapper for PHP object %p (%s)\n", object, Z_OBJCE_P(object)->name); - - if (disp == NULL) - return NULL; - - memset(disp, 0, sizeof(php_dispatchex)); - - disp->engine_thread = GetCurrentThreadId(); - disp->lpVtbl = &php_dispatch_vtbl; - disp->refcount = 1; - - - if (object) - ZVAL_ADDREF(object); - disp->object = object; - - disp->id = zend_list_insert(disp, le_dispatch); - - return disp; -} - -static void disp_destructor(php_dispatchex *disp) -{ - TSRMLS_FETCH(); - - /* Object store not available during request shutdown */ - if (COMG(rshutdown_started)) { - trace("destroying COM wrapper for PHP object %p (name:unknown)\n", disp->object); - } else { - trace("destroying COM wrapper for PHP object %p (name:%s)\n", disp->object, Z_OBJCE_P(disp->object)->name); - } - - disp->id = 0; - - if (disp->refcount > 0) - CoDisconnectObject((IUnknown*)disp, 0); - - zend_hash_destroy(disp->dispid_to_name); - zend_hash_destroy(disp->name_to_dispid); - FREE_HASHTABLE(disp->dispid_to_name); - FREE_HASHTABLE(disp->name_to_dispid); - - if (disp->object) - zval_ptr_dtor(&disp->object); - - CoTaskMemFree(disp); -} - -PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, - HashTable *id_to_name TSRMLS_DC) -{ - php_dispatchex *disp = disp_constructor(val TSRMLS_CC); - HashPosition pos; - char *name = NULL; - zval *tmp, **ntmp; - int namelen; - int keytype; - ulong pid; - - disp->dispid_to_name = id_to_name; - - memcpy(&disp->sinkid, sinkid, sizeof(disp->sinkid)); - - /* build up the reverse mapping */ - ALLOC_HASHTABLE(disp->name_to_dispid); - zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0); - - zend_hash_internal_pointer_reset_ex(id_to_name, &pos); - while (HASH_KEY_NON_EXISTANT != (keytype = - zend_hash_get_current_key_ex(id_to_name, &name, &namelen, &pid, 0, &pos))) { - - if (keytype == HASH_KEY_IS_LONG) { - - zend_hash_get_current_data_ex(id_to_name, (void**)&ntmp, &pos); - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, pid); - zend_hash_update(disp->name_to_dispid, Z_STRVAL_PP(ntmp), - Z_STRLEN_PP(ntmp)+1, (void*)&tmp, sizeof(zval *), NULL); - } - - zend_hash_move_forward_ex(id_to_name, &pos); - } - - return (IDispatch*)disp; -} - -PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC) -{ - php_dispatchex *disp = NULL; - - if (Z_TYPE_P(val) != IS_OBJECT) { - return NULL; - } - - if (php_com_is_valid_object(val TSRMLS_CC)) { - /* pass back its IDispatch directly */ - php_com_dotnet_object *obj = CDNO_FETCH(val); - - if (obj == NULL) - return NULL; - - if (V_VT(&obj->v) == VT_DISPATCH && V_DISPATCH(&obj->v)) { - IDispatch_AddRef(V_DISPATCH(&obj->v)); - return V_DISPATCH(&obj->v); - } - - return NULL; - } - - disp = disp_constructor(val TSRMLS_CC); - generate_dispids(disp TSRMLS_CC); - - return (IDispatch*)disp; -} - - diff --git a/ext/com_dotnet/config.w32 b/ext/com_dotnet/config.w32 deleted file mode 100644 index 1526392c24bef..0000000000000 --- a/ext/com_dotnet/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("com-dotnet", "COM and .Net support", "yes"); - -if (PHP_COM_DOTNET == "yes") { - CHECK_LIB('oleaut32.lib', 'com_dotnet'); - EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \ - com_handlers.c com_iterator.c com_misc.c com_olechar.c \ - com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c"); - AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support'); - CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET'); -} diff --git a/ext/com_dotnet/package.xml b/ext/com_dotnet/package.xml deleted file mode 100644 index 2839447bbddd4..0000000000000 --- a/ext/com_dotnet/package.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - com_dotnet - Com and .NET support functions for Windows - - - wez - Wez Furlong - wez@php.net - lead - - - -... - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h deleted file mode 100644 index b476f67e673cd..0000000000000 --- a/ext/com_dotnet/php_com_dotnet.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_COM_DOTNET_H -#define PHP_COM_DOTNET_H - -extern zend_module_entry com_dotnet_module_entry; -#define phpext_com_dotnet_ptr &com_dotnet_module_entry - -#ifdef PHP_WIN32 -# define PHP_COM_DOTNET_API __declspec(dllexport) -#else -# define PHP_COM_DOTNET_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(com_dotnet); -PHP_MSHUTDOWN_FUNCTION(com_dotnet); -PHP_RINIT_FUNCTION(com_dotnet); -PHP_RSHUTDOWN_FUNCTION(com_dotnet); -PHP_MINFO_FUNCTION(com_dotnet); - -ZEND_BEGIN_MODULE_GLOBALS(com_dotnet) - zend_bool allow_dcom; - zend_bool autoreg_verbose; - zend_bool autoreg_on; - zend_bool autoreg_case_sensitive; - void *dotnet_runtime_stuff; /* opaque to avoid cluttering up other modules */ - int code_page; /* default code_page if left unspecified */ - zend_bool rshutdown_started; -ZEND_END_MODULE_GLOBALS(com_dotnet) - -#ifdef ZTS -# define COMG(v) TSRMG(com_dotnet_globals_id, zend_com_dotnet_globals *, v) -#else -# define COMG(v) (com_dotnet_globals.v) -#endif - -extern ZEND_DECLARE_MODULE_GLOBALS(com_dotnet); - -#endif /* PHP_COM_DOTNET_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h deleted file mode 100644 index f0ac884e57e40..0000000000000 --- a/ext/com_dotnet/php_com_dotnet_internal.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_COM_DOTNET_INTERNAL_H -#define PHP_COM_DOTNET_INTERNAL_H - -#define _WIN32_DCOM -#define COBJMACROS -#include -#include -#include -#include -#include "win32/winutil.h" - -/* brain-death in winutil.h defines the macro to hide the useful function... */ -#undef php_win_err - -typedef struct _php_com_dotnet_object { - zend_object zo; - - VARIANT v; - int modified; - - ITypeInfo *typeinfo; - long code_page; - - zend_class_entry *ce; - - /* associated event sink */ - IDispatch *sink_dispatch; - GUID sink_id; - DWORD sink_cookie; - - /* cache for method signatures */ - HashTable *method_cache; - /* cache for name -> DISPID */ - HashTable *id_of_name_cache; -} php_com_dotnet_object; - -static inline int php_com_is_valid_object(zval *zv TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(zv); - return strcmp("com", ce->name) == 0 || - strcmp("dotnet", ce->name) == 0 || - strcmp("variant", ce->name) == 0; -} - -#define CDNO_FETCH(zv) (php_com_dotnet_object*)zend_object_store_get_object(zv TSRMLS_CC) -#define CDNO_FETCH_VERIFY(obj, zv) do { \ - if (!php_com_is_valid_object(zv TSRMLS_CC)) { \ - php_com_throw_exception(E_UNEXPECTED, "expected a variant object" TSRMLS_CC); \ - return; \ - } \ - obj = (php_com_dotnet_object*)zend_object_store_get_object(zv TSRMLS_CC); \ -} while(0) - -/* com_extension.c */ -TsHashTable php_com_typelibraries; -zend_class_entry *php_com_variant_class_entry, *php_com_exception_class_entry, *php_com_saproxy_class_entry; - -/* com_handlers.c */ -zend_object_value php_com_object_new(zend_class_entry *ce TSRMLS_DC); -void php_com_object_clone(void *object, void **clone_ptr TSRMLS_DC); -void php_com_object_free_storage(void *object TSRMLS_DC); -zend_object_handlers php_com_object_handlers; -void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC); - -/* com_saproxy.c */ -zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); -int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC); - -/* com_olechar.c */ -PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, - uint *string_len, int codepage TSRMLS_DC); -PHPAPI OLECHAR *php_com_string_to_olestring(char *string, - uint string_len, int codepage TSRMLS_DC); - - -/* com_com.c */ -PHP_FUNCTION(com_create_instance); -PHP_FUNCTION(com_event_sink); -PHP_FUNCTION(com_create_guid); -PHP_FUNCTION(com_print_typeinfo); -PHP_FUNCTION(com_message_pump); -PHP_FUNCTION(com_load_typelib); -PHP_FUNCTION(com_get_active_object); - -HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member, - WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg TSRMLS_DC); -HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name, - int namelen, DISPID *dispid TSRMLS_DC); -int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid, - WORD flags, VARIANT *v, int nargs, zval **args, int silent, int allow_noarg TSRMLS_DC); -int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen, - WORD flags, VARIANT *v, int nargs, zval **args, int allow_noarg TSRMLS_DC); -int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, - WORD flags, VARIANT *v, int nargs, zval ***args TSRMLS_DC); - -/* com_wrapper.c */ -int php_com_wrapper_minit(INIT_FUNC_ARGS); -PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC); -PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC); - -/* com_persist.c */ -int php_com_persist_minit(INIT_FUNC_ARGS); - -/* com_variant.c */ -PHP_FUNCTION(com_variant_create_instance); -PHP_FUNCTION(variant_set); -PHP_FUNCTION(variant_add); -PHP_FUNCTION(variant_cat); -PHP_FUNCTION(variant_sub); -PHP_FUNCTION(variant_mul); -PHP_FUNCTION(variant_and); -PHP_FUNCTION(variant_div); -PHP_FUNCTION(variant_eqv); -PHP_FUNCTION(variant_idiv); -PHP_FUNCTION(variant_imp); -PHP_FUNCTION(variant_mod); -PHP_FUNCTION(variant_or); -PHP_FUNCTION(variant_pow); -PHP_FUNCTION(variant_xor); -PHP_FUNCTION(variant_abs); -PHP_FUNCTION(variant_fix); -PHP_FUNCTION(variant_int); -PHP_FUNCTION(variant_neg); -PHP_FUNCTION(variant_not); -PHP_FUNCTION(variant_round); -PHP_FUNCTION(variant_cmp); -PHP_FUNCTION(variant_date_to_timestamp); -PHP_FUNCTION(variant_date_from_timestamp); -PHP_FUNCTION(variant_get_type); -PHP_FUNCTION(variant_set_type); -PHP_FUNCTION(variant_cast); - -PHPAPI void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC); -PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC); -PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC); -PHPAPI int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC); - -/* com_dotnet.c */ -PHP_FUNCTION(com_dotnet_create_instance); -void php_com_dotnet_rshutdown(TSRMLS_D); -void php_com_dotnet_mshutdown(TSRMLS_D); - -/* com_misc.c */ -void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC); -PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp, - int codepage TSRMLS_DC); -PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v, - int codepage TSRMLS_DC); -PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC); - -/* com_typeinfo.c */ -PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string, - int codepage, int *cached TSRMLS_DC); -PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC); -PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, - int codepage TSRMLS_DC); -void php_com_typelibrary_dtor(void *pDest); -ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC); -int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC); - -/* com_iterator.c */ -zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); - - -#endif diff --git a/ext/com_dotnet/tests/27974.phpt b/ext/com_dotnet/tests/27974.phpt deleted file mode 100755 index 30c42b6cf6d4b..0000000000000 --- a/ext/com_dotnet/tests/27974.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -COM: mapping a safearray ---SKIPIF-- - ---FILE-- -getCode() != DISP_E_BADINDEX) { - throw $e; - } - echo "Got BADINDEX exception OK!\n"; - } - echo "OK!"; -} catch (Exception $e) { - print $e; -} -?> ---EXPECT-- -object(variant)#1 (0) { -} -123 -456 -789 -string(3) "123" -string(5) "hello" -string(3) "789" -Got BADINDEX exception OK! -OK! diff --git a/ext/com_dotnet/tests/bug33386.phpt b/ext/com_dotnet/tests/bug33386.phpt deleted file mode 100644 index e57f1274c161a..0000000000000 --- a/ext/com_dotnet/tests/bug33386.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #33386 (ScriptControl only sees last function of class) ---SKIPIF-- - ---FILE-- -Language = "VBScript"; - - $oScript->AddObject ("tfA", $ciTF, true); - foreach (array(1,2) as $i) { - $oScript->ExecuteStatement ("tfA.func$i"); - $oScript->ExecuteStatement ("func$i"); - } - $oScript->AddObject ("tfB", $ciTF); - foreach (array(1,2) as $i) { - $oScript->ExecuteStatement ("tfB.func$i"); - } -} catch (Exception $e) { - print $e; -} -?> ---EXPECT-- - func one - func one - func two - func two - func one - func two diff --git a/ext/com_dotnet/tests/bug34272.phpt b/ext/com_dotnet/tests/bug34272.phpt deleted file mode 100644 index 3a65e2ce2861d..0000000000000 --- a/ext/com_dotnet/tests/bug34272.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #34272 (empty array onto COM object blows up) ---SKIPIF-- - ---FILE-- -add('foo', array()); - print sizeof($dict['foo'])."\n"; - $dict->add('bar', array(23)); - print sizeof($dict['bar'])." \n"; -} catch (Exception $e) { - print $e; -} -?> ---EXPECT-- -0 -1 diff --git a/ext/com_dotnet/tests/bug39596.phpt b/ext/com_dotnet/tests/bug39596.phpt deleted file mode 100644 index dc8d1ef066106..0000000000000 --- a/ext/com_dotnet/tests/bug39596.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #39596 (Creating Variant of type VT_ARRAY) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -aaa -bbb -ccc diff --git a/ext/com_dotnet/tests/bug39606.phpt b/ext/com_dotnet/tests/bug39606.phpt deleted file mode 100644 index 4487c1d8cba97..0000000000000 --- a/ext/com_dotnet/tests/bug39606.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -COM: Loading typelib corrupts memory ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -bool(true) -bool(true) -===DONE=== \ No newline at end of file diff --git a/ext/com_dotnet/tests/variants.phpt b/ext/com_dotnet/tests/variants.phpt deleted file mode 100644 index 0fd27bee5ef63..0000000000000 --- a/ext/com_dotnet/tests/variants.phpt +++ /dev/null @@ -1,637 +0,0 @@ ---TEST-- -COM: General variant tests ---SKIPIF-- - ---FILE-- - 42, VT_R8 => 3.5, VT_BSTR => "hello", VT_BOOL => false); -$binary_ops = array('add', 'cat', 'sub', 'mul', 'and', 'div', - 'eqv', 'idiv', 'imp', 'mod', 'or', 'pow', 'xor'); - -foreach ($values as $t => $val) { - $v = new VARIANT($val); - if ($t != variant_get_type($v)) { - printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val); - print $v . "\n"; - } - $results = array(); - - foreach ($values as $op2) { - echo "--\n"; - foreach ($binary_ops as $op) { - try { - echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n"; - } catch (com_exception $e) { - echo "$op:\n"; - echo "\tvariant_$op($v, $op2)\n"; - echo "\texception " . $e->getMessage(); - printf("\tcode %08x\n\n", $e->getCode()); - } - } - } -} - -echo "OK!"; -?> ---EXPECT-- --- -add: 84 -cat: 4242 -sub: 0 -mul: 1764 -and: 42 -div: 1 -eqv: -1 -idiv: 1 -imp: -1 -mod: 0 -or: 42 -pow: 1.50130937545297E+68 -xor: 0 --- -add: 45.5 -cat: 423.5 -sub: 38.5 -mul: 147 -and: 0 -div: 12 -eqv: -47 -idiv: 10 -imp: -43 -mod: 2 -or: 46 -pow: 480145.116863642 -xor: 46 --- -add: - variant_add(42, hello) - exception Type mismatch. - code 80020005 - -cat: 42hello -sub: - variant_sub(42, hello) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(42, hello) - exception Type mismatch. - code 80020005 - -and: - variant_and(42, hello) - exception Type mismatch. - code 80020005 - -div: - variant_div(42, hello) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(42, hello) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(42, hello) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(42, hello) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(42, hello) - exception Type mismatch. - code 80020005 - -or: - variant_or(42, hello) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(42, hello) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(42, hello) - exception Type mismatch. - code 80020005 - --- -add: 42 -cat: 42False -sub: 42 -mul: 0 -and: 0 -div: - variant_div(42, ) - exception Division by zero. - code 80020012 - -eqv: -43 -idiv: - variant_idiv(42, ) - exception Division by zero. - code 80020012 - -imp: -43 -mod: - variant_mod(42, ) - exception Division by zero. - code 80020012 - -or: 42 -pow: 1 -xor: 42 --- -add: 45.5 -cat: 3.542 -sub: -38.5 -mul: 147 -and: 0 -div: 8.33333333333333E-02 -eqv: -47 -idiv: 0 -imp: -5 -mod: 4 -or: 46 -pow: 7.09345573078604E+22 -xor: 46 --- -add: 7 -cat: 3.53.5 -sub: 0 -mul: 12.25 -and: 4 -div: 1 -eqv: -1 -idiv: 1 -imp: -1 -mod: 0 -or: 4 -pow: 80.2117802289664 -xor: 0 --- -add: - variant_add(3.5, hello) - exception Type mismatch. - code 80020005 - -cat: 3.5hello -sub: - variant_sub(3.5, hello) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(3.5, hello) - exception Type mismatch. - code 80020005 - -and: - variant_and(3.5, hello) - exception Type mismatch. - code 80020005 - -div: - variant_div(3.5, hello) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(3.5, hello) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(3.5, hello) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(3.5, hello) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(3.5, hello) - exception Type mismatch. - code 80020005 - -or: - variant_or(3.5, hello) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(3.5, hello) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(3.5, hello) - exception Type mismatch. - code 80020005 - --- -add: 3.5 -cat: 3.5False -sub: 3.5 -mul: 0 -and: 0 -div: - variant_div(3.5, ) - exception Division by zero. - code 80020012 - -eqv: -5 -idiv: - variant_idiv(3.5, ) - exception Division by zero. - code 80020012 - -imp: -5 -mod: - variant_mod(3.5, ) - exception Division by zero. - code 80020012 - -or: 4 -pow: 1 -xor: 4 --- -add: - variant_add(hello, 42) - exception Type mismatch. - code 80020005 - -cat: hello42 -sub: - variant_sub(hello, 42) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(hello, 42) - exception Type mismatch. - code 80020005 - -and: - variant_and(hello, 42) - exception Type mismatch. - code 80020005 - -div: - variant_div(hello, 42) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(hello, 42) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(hello, 42) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(hello, 42) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(hello, 42) - exception Type mismatch. - code 80020005 - -or: - variant_or(hello, 42) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(hello, 42) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(hello, 42) - exception Type mismatch. - code 80020005 - --- -add: - variant_add(hello, 3.5) - exception Type mismatch. - code 80020005 - -cat: hello3.5 -sub: - variant_sub(hello, 3.5) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(hello, 3.5) - exception Type mismatch. - code 80020005 - -and: - variant_and(hello, 3.5) - exception Type mismatch. - code 80020005 - -div: - variant_div(hello, 3.5) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(hello, 3.5) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(hello, 3.5) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(hello, 3.5) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(hello, 3.5) - exception Type mismatch. - code 80020005 - -or: - variant_or(hello, 3.5) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(hello, 3.5) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(hello, 3.5) - exception Type mismatch. - code 80020005 - --- -add: hellohello -cat: hellohello -sub: - variant_sub(hello, hello) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(hello, hello) - exception Type mismatch. - code 80020005 - -and: - variant_and(hello, hello) - exception Type mismatch. - code 80020005 - -div: - variant_div(hello, hello) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(hello, hello) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(hello, hello) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(hello, hello) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(hello, hello) - exception Type mismatch. - code 80020005 - -or: - variant_or(hello, hello) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(hello, hello) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(hello, hello) - exception Type mismatch. - code 80020005 - --- -add: - variant_add(hello, ) - exception Type mismatch. - code 80020005 - -cat: helloFalse -sub: - variant_sub(hello, ) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(hello, ) - exception Type mismatch. - code 80020005 - -and: - variant_and(hello, ) - exception Type mismatch. - code 80020005 - -div: - variant_div(hello, ) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(hello, ) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(hello, ) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(hello, ) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(hello, ) - exception Type mismatch. - code 80020005 - -or: - variant_or(hello, ) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(hello, ) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(hello, ) - exception Type mismatch. - code 80020005 - --- -add: 42 -cat: False42 -sub: -42 -mul: 0 -and: 0 -div: 0 -eqv: -43 -idiv: 0 -imp: -1 -mod: 0 -or: 42 -pow: 0 -xor: 42 --- -add: 3.5 -cat: False3.5 -sub: -3.5 -mul: 0 -and: 0 -div: 0 -eqv: -5 -idiv: 0 -imp: -1 -mod: 0 -or: 4 -pow: 0 -xor: 4 --- -add: - variant_add(0, hello) - exception Type mismatch. - code 80020005 - -cat: Falsehello -sub: - variant_sub(0, hello) - exception Type mismatch. - code 80020005 - -mul: - variant_mul(0, hello) - exception Type mismatch. - code 80020005 - -and: - variant_and(0, hello) - exception Type mismatch. - code 80020005 - -div: - variant_div(0, hello) - exception Type mismatch. - code 80020005 - -eqv: - variant_eqv(0, hello) - exception Type mismatch. - code 80020005 - -idiv: - variant_idiv(0, hello) - exception Type mismatch. - code 80020005 - -imp: - variant_imp(0, hello) - exception Type mismatch. - code 80020005 - -mod: - variant_mod(0, hello) - exception Type mismatch. - code 80020005 - -or: - variant_or(0, hello) - exception Type mismatch. - code 80020005 - -pow: - variant_pow(0, hello) - exception Type mismatch. - code 80020005 - -xor: - variant_xor(0, hello) - exception Type mismatch. - code 80020005 - --- -add: 0 -cat: FalseFalse -sub: 0 -mul: 0 -and: 0 -div: - variant_div(0, ) - exception Out of present range. - code 8002000a - -eqv: -1 -idiv: - variant_idiv(0, ) - exception Division by zero. - code 80020012 - -imp: -1 -mod: - variant_mod(0, ) - exception Division by zero. - code 80020012 - -or: 0 -pow: 1 -xor: 0 -OK! diff --git a/ext/ctype/CREDITS b/ext/ctype/CREDITS deleted file mode 100644 index 22de90270994a..0000000000000 --- a/ext/ctype/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ctype -Hartmut Holzgraefe diff --git a/ext/ctype/config.m4 b/ext/ctype/config.m4 deleted file mode 100644 index 7d575a3adcd9d..0000000000000 --- a/ext/ctype/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(ctype, whether to enable ctype functions, -[ --disable-ctype Disable ctype functions], yes) - -if test "$PHP_CTYPE" != "no"; then - AC_DEFINE(HAVE_CTYPE, 1, [ ]) - PHP_NEW_EXTENSION(ctype, ctype.c, $ext_shared) -fi diff --git a/ext/ctype/config.w32 b/ext/ctype/config.w32 deleted file mode 100644 index 1ade89cdff2d7..0000000000000 --- a/ext/ctype/config.w32 +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("ctype", "ctype", "yes"); - -if (PHP_CTYPE == "yes") { - EXTENSION("ctype", "ctype.c"); - AC_DEFINE('HAVE_CTYPE', 1, 'Have ctype'); -} diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c deleted file mode 100644 index 82313639731c6..0000000000000 --- a/ext/ctype/ctype.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_ctype.h" -#include "SAPI.h" -#include "ext/standard/info.h" - -#include - -#if HAVE_CTYPE - -static PHP_MINFO_FUNCTION(ctype); - -static PHP_FUNCTION(ctype_alnum); -static PHP_FUNCTION(ctype_alpha); -static PHP_FUNCTION(ctype_cntrl); -static PHP_FUNCTION(ctype_digit); -static PHP_FUNCTION(ctype_lower); -static PHP_FUNCTION(ctype_graph); -static PHP_FUNCTION(ctype_print); -static PHP_FUNCTION(ctype_punct); -static PHP_FUNCTION(ctype_space); -static PHP_FUNCTION(ctype_upper); -static PHP_FUNCTION(ctype_xdigit); - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_alnum, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_alpha, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_cntrl, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_digit, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_lower, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_graph, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_print, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_punct, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_space, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_upper, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ctype_xdigit, 0) - ZEND_ARG_INFO(0, text) -ZEND_END_ARG_INFO() - -/* }}} */ - -/* {{{ ctype_functions[] - * Every user visible function must have an entry in ctype_functions[]. - */ -static zend_function_entry ctype_functions[] = { - PHP_FE(ctype_alnum, arginfo_ctype_alnum) - PHP_FE(ctype_alpha, arginfo_ctype_alpha) - PHP_FE(ctype_cntrl, arginfo_ctype_cntrl) - PHP_FE(ctype_digit, arginfo_ctype_digit) - PHP_FE(ctype_lower, arginfo_ctype_lower) - PHP_FE(ctype_graph, arginfo_ctype_graph) - PHP_FE(ctype_print, arginfo_ctype_print) - PHP_FE(ctype_punct, arginfo_ctype_punct) - PHP_FE(ctype_space, arginfo_ctype_space) - PHP_FE(ctype_upper, arginfo_ctype_upper) - PHP_FE(ctype_xdigit, arginfo_ctype_xdigit) - {NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */ -}; -/* }}} */ - -/* {{{ ctype_module_entry - */ -zend_module_entry ctype_module_entry = { - STANDARD_MODULE_HEADER, - "ctype", - ctype_functions, - NULL, - NULL, - NULL, - NULL, - PHP_MINFO(ctype), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_CTYPE -ZEND_GET_MODULE(ctype) -#endif - -/* {{{ PHP_MINFO_FUNCTION - */ -static PHP_MINFO_FUNCTION(ctype) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "ctype functions", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ ctype - */ -#define CTYPE(iswhat) \ - zval *c, tmp; \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE) \ - return; \ - if (Z_TYPE_P(c) == IS_LONG) { \ - if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \ - RETURN_BOOL(iswhat(Z_LVAL_P(c))); \ - } else if (Z_LVAL_P(c) >= -128 && Z_LVAL_P(c) < 0) { \ - RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \ - } \ - tmp = *c; \ - zval_copy_ctor(&tmp); \ - convert_to_string(&tmp); \ - } else { \ - tmp = *c; \ - } \ - if (Z_TYPE(tmp) == IS_STRING) { \ - char *p = Z_STRVAL(tmp), *e = Z_STRVAL(tmp) + Z_STRLEN(tmp); \ - if (e == p) { \ - if (Z_TYPE_P(c) == IS_LONG) zval_dtor(&tmp); \ - RETURN_FALSE; \ - } \ - while (p < e) { \ - if(!iswhat((int)*(unsigned char *)(p++))) { \ - if (Z_TYPE_P(c) == IS_LONG) zval_dtor(&tmp); \ - RETURN_FALSE; \ - } \ - } \ - if (Z_TYPE_P(c) == IS_LONG) zval_dtor(&tmp); \ - RETURN_TRUE; \ - } else { \ - RETURN_FALSE; \ - } \ - -/* }}} */ - -/* {{{ proto bool ctype_alnum(mixed c) - Checks for alphanumeric character(s) */ -static PHP_FUNCTION(ctype_alnum) -{ - CTYPE(isalnum); -} -/* }}} */ - -/* {{{ proto bool ctype_alpha(mixed c) - Checks for alphabetic character(s) */ -static PHP_FUNCTION(ctype_alpha) -{ - CTYPE(isalpha); -} -/* }}} */ - -/* {{{ proto bool ctype_cntrl(mixed c) - Checks for control character(s) */ -static PHP_FUNCTION(ctype_cntrl) -{ - CTYPE(iscntrl); -} -/* }}} */ - -/* {{{ proto bool ctype_digit(mixed c) - Checks for numeric character(s) */ -static PHP_FUNCTION(ctype_digit) -{ - CTYPE(isdigit); -} -/* }}} */ - -/* {{{ proto bool ctype_lower(mixed c) - Checks for lowercase character(s) */ -static PHP_FUNCTION(ctype_lower) -{ - CTYPE(islower); -} -/* }}} */ - -/* {{{ proto bool ctype_graph(mixed c) - Checks for any printable character(s) except space */ -static PHP_FUNCTION(ctype_graph) -{ - CTYPE(isgraph); -} -/* }}} */ - -/* {{{ proto bool ctype_print(mixed c) - Checks for printable character(s) */ -static PHP_FUNCTION(ctype_print) -{ - CTYPE(isprint); -} -/* }}} */ - -/* {{{ proto bool ctype_punct(mixed c) - Checks for any printable character which is not whitespace or an alphanumeric character */ -static PHP_FUNCTION(ctype_punct) -{ - CTYPE(ispunct); -} -/* }}} */ - -/* {{{ proto bool ctype_space(mixed c) - Checks for whitespace character(s)*/ -static PHP_FUNCTION(ctype_space) -{ - CTYPE(isspace); -} -/* }}} */ - -/* {{{ proto bool ctype_upper(mixed c) - Checks for uppercase character(s) */ -static PHP_FUNCTION(ctype_upper) -{ - CTYPE(isupper); -} -/* }}} */ - -/* {{{ proto bool ctype_xdigit(mixed c) - Checks for character(s) representing a hexadecimal digit */ -static PHP_FUNCTION(ctype_xdigit) -{ - CTYPE(isxdigit); -} -/* }}} */ - -#endif /* HAVE_CTYPE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ctype/ctype.dsp b/ext/ctype/ctype.dsp deleted file mode 100644 index 1305c72f6a8f2..0000000000000 --- a/ext/ctype/ctype.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ctype" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=ctype - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ctype.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ctype.mak" CFG="ctype - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ctype - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ctype - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ctype - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D HAVE_CTYPE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ctype.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "ctype - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CTYPE=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ctype.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "ctype - Win32 Release_TS" -# Name "ctype - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\ctype.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_ctype.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/ctype/ctype.xml b/ext/ctype/ctype.xml deleted file mode 100644 index 5837b9b5d0008..0000000000000 --- a/ext/ctype/ctype.xml +++ /dev/null @@ -1,245 +0,0 @@ - - Character type functions - ctype - - - - These functions check whether a character or string - falls into a certain character class according to the i - current locale. - - - When called with an integer argument theese functions - behave exactly like their C counterparts. - - - When called with a string argument they will check - every character in the string and will only return - true if every character in the string matches the - requested criteria. - - - Passing anything else but a string or integer will - return false immediately. - - - - - - - isalnum - Check for alphanumeric character(s) - - - Description - - - bool isalnum - string c - - - - See also setlocale. - - - - - - - isalpha - - - - Description - - - bool isalpha - string c - - - - - - - - - - iscntrl - - - - Description - - - bool iscntrl - string c - - - - - - - - - - isdigit - - - - Description - - - bool isdigit - string c - - - - - - - - - - islower - - - - Description - - - bool islower - string c - - - - - - - - - - isgraph - - - - Description - - - bool isgraph - string c - - - - - - - - - - isprint - - - - Description - - - bool isprint - string c - - - - - - - - - - ispunct - - - - Description - - - bool ispunct - string c - - - - - - - - - - isspace - - - - Description - - - bool isspace - string c - - - - - - - - - - isupper - - - - Description - - - bool isupper - string c - - - - - - - - - - isxdigit - - - - Description - - - bool isxdigit - string c - - - - - - - - - - - diff --git a/ext/ctype/package.xml b/ext/ctype/package.xml deleted file mode 100644 index 71c9cd9903e38..0000000000000 --- a/ext/ctype/package.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - ctype - Character type detection - - - hholzgra - Hartmut Holzgraefe - hartmut@php.net - lead - - - -The functions provided by this extension check whether a -character or string falls into a certain character class -according to the current locale. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - diff --git a/ext/ctype/php_ctype.h b/ext/ctype/php_ctype.h deleted file mode 100644 index c13c119353282..0000000000000 --- a/ext/ctype/php_ctype.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_CTYPE_H -#define PHP_CTYPE_H - -#if HAVE_CTYPE - -extern zend_module_entry ctype_module_entry; -#define phpext_ctype_ptr &ctype_module_entry - -#ifdef PHP_WIN32 -#define PHP_CTYPE_API __declspec(dllexport) -#else -#define PHP_CTYPE_API -#endif - -#else - -#define phpext_ctype_ptr NULL - -#endif - -#endif /* PHP_CTYPE_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/ctype/tests/001.phpt b/ext/ctype/tests/001.phpt deleted file mode 100644 index b7beea786134f..0000000000000 --- a/ext/ctype/tests/001.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -ctype on integers ---SKIPIF-- - ---FILE-- - ---EXPECT-- -ctype_lower 26 -ctype_upper 26 -ctype_alpha 52 -ctype_digit 10 -ctype_alnum 62 -ctype_cntrl 33 -ctype_graph 94 -ctype_print 95 -ctype_punct 32 -ctype_space 6 -ctype_xdigit 22 diff --git a/ext/ctype/tests/002.phpt b/ext/ctype/tests/002.phpt deleted file mode 100644 index 598ff9be963e0..0000000000000 --- a/ext/ctype/tests/002.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -ctype on strings ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -LOCALE is '%s' -ctype_lower 26 26 0 -ctype_upper 26 26 0 -ctype_alpha 52 52 0 -ctype_digit 10 10 0 -ctype_alnum 62 62 0 -ctype_cntrl 33 33 0 -ctype_graph 94 94 94 -ctype_print 95 95 95 -ctype_punct 32 32 0 -ctype_space 6 6 0 -ctype_xdigit 22 22 0 diff --git a/ext/ctype/tests/bug25745.phpt b/ext/ctype/tests/bug25745.phpt deleted file mode 100644 index 74320a865c41a..0000000000000 --- a/ext/ctype/tests/bug25745.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #25745 (ctype functions fail with non-ascii characters) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -ok diff --git a/ext/ctype/tests/bug34645.phpt b/ext/ctype/tests/bug34645.phpt deleted file mode 100644 index 8c8e260c2815c..0000000000000 --- a/ext/ctype/tests/bug34645.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #34645 (ctype corrupts memory when validating large numbers) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -int(394829384) diff --git a/ext/ctype/tests/ctype_alnum_basic.phpt b/ext/ctype/tests/ctype_alnum_basic.phpt deleted file mode 100644 index 32da928c2590f..0000000000000 --- a/ext/ctype/tests/ctype_alnum_basic.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ctype_alnum() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alnum() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_alnum_error.phpt b/ext/ctype/tests/ctype_alnum_error.phpt deleted file mode 100644 index 9ced2d7c78879..0000000000000 --- a/ext/ctype/tests/ctype_alnum_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test ctype_alnum() function : error conditions - Incorrect number of args ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alnum() : error conditions *** - --- Testing ctype_alnum() function with Zero arguments -- - -Warning: ctype_alnum() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_alnum() function with more than expected no. of arguments -- - -Warning: ctype_alnum() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_alnum_variation1.phpt b/ext/ctype/tests/ctype_alnum_variation1.phpt deleted file mode 100644 index 3f6730748331d..0000000000000 --- a/ext/ctype/tests/ctype_alnum_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test ctype_alnum() function : usage variations - Different data types as $c arg ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alnum() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(true) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_alnum_variation2.phpt b/ext/ctype/tests/ctype_alnum_variation2.phpt deleted file mode 100644 index c360e676cf3e6..0000000000000 --- a/ext/ctype/tests/ctype_alnum_variation2.phpt +++ /dev/null @@ -1,92 +0,0 @@ ---TEST-- -Test ctype_alnum() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alnum() : usage variations *** -character code 48 is alpha numeric -character code 49 is alpha numeric -character code 50 is alpha numeric -character code 51 is alpha numeric -character code 52 is alpha numeric -character code 53 is alpha numeric -character code 54 is alpha numeric -character code 55 is alpha numeric -character code 56 is alpha numeric -character code 57 is alpha numeric -character code 65 is alpha numeric -character code 66 is alpha numeric -character code 67 is alpha numeric -character code 68 is alpha numeric -character code 69 is alpha numeric -character code 70 is alpha numeric -character code 71 is alpha numeric -character code 72 is alpha numeric -character code 73 is alpha numeric -character code 74 is alpha numeric -character code 75 is alpha numeric -character code 76 is alpha numeric -character code 77 is alpha numeric -character code 78 is alpha numeric -character code 79 is alpha numeric -character code 80 is alpha numeric -character code 81 is alpha numeric -character code 82 is alpha numeric -character code 83 is alpha numeric -character code 84 is alpha numeric -character code 85 is alpha numeric -character code 86 is alpha numeric -character code 87 is alpha numeric -character code 88 is alpha numeric -character code 89 is alpha numeric -character code 90 is alpha numeric -character code 97 is alpha numeric -character code 98 is alpha numeric -character code 99 is alpha numeric -character code 100 is alpha numeric -character code 101 is alpha numeric -character code 102 is alpha numeric -character code 103 is alpha numeric -character code 104 is alpha numeric -character code 105 is alpha numeric -character code 106 is alpha numeric -character code 107 is alpha numeric -character code 108 is alpha numeric -character code 109 is alpha numeric -character code 110 is alpha numeric -character code 111 is alpha numeric -character code 112 is alpha numeric -character code 113 is alpha numeric -character code 114 is alpha numeric -character code 115 is alpha numeric -character code 116 is alpha numeric -character code 117 is alpha numeric -character code 118 is alpha numeric -character code 119 is alpha numeric -character code 120 is alpha numeric -character code 121 is alpha numeric -character code 122 is alpha numeric -===DONE=== diff --git a/ext/ctype/tests/ctype_alnum_variation3.phpt b/ext/ctype/tests/ctype_alnum_variation3.phpt deleted file mode 100644 index ee0a74836d6e6..0000000000000 --- a/ext/ctype/tests/ctype_alnum_variation3.phpt +++ /dev/null @@ -1,127 +0,0 @@ ---TEST-- -Test ctype_alnum() function : usage variations - different string values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alnum() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(true) - --- Iteration 6 -- -bool(true) - --- Iteration 7 -- -bool(true) - --- Iteration 8 -- -bool(true) - --- Iteration 9 -- -bool(true) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(true) - --- Iteration 12 -- -bool(true) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(true) - --- Iteration 16 -- -bool(true) - --- Iteration 17 -- -bool(true) - --- Iteration 18 -- -bool(true) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_alnum_variation4.phpt b/ext/ctype/tests/ctype_alnum_variation4.phpt deleted file mode 100644 index d56c925c7551c..0000000000000 --- a/ext/ctype/tests/ctype_alnum_variation4.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Test ctype_alnum() function : usage variations - octal and hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alnum() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_alpha_basic.phpt b/ext/ctype/tests/ctype_alpha_basic.phpt deleted file mode 100644 index c467bf8f6691a..0000000000000 --- a/ext/ctype/tests/ctype_alpha_basic.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ctype_alpha() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alpha() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_alpha_error.phpt b/ext/ctype/tests/ctype_alpha_error.phpt deleted file mode 100644 index 18c2edb5259b1..0000000000000 --- a/ext/ctype/tests/ctype_alpha_error.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test ctype_alpha() function : error conditions - Incorrect number of arguments ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alpha() : error conditions *** - --- Testing ctype_alpha() function with Zero arguments -- - -Warning: ctype_alpha() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_alpha() function with more than expected no. of arguments -- - -Warning: ctype_alpha() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_alpha_variation1.phpt b/ext/ctype/tests/ctype_alpha_variation1.phpt deleted file mode 100644 index 98c64a16e38dd..0000000000000 --- a/ext/ctype/tests/ctype_alpha_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test ctype_alpha() function : usage variations - different data types as $c arg ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alpha() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_alpha_variation2.phpt b/ext/ctype/tests/ctype_alpha_variation2.phpt deleted file mode 100644 index ea3afc2be1b8c..0000000000000 --- a/ext/ctype/tests/ctype_alpha_variation2.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Test ctype_alpha() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alpha() : usage variations *** -character code 65 is alphabetic -character code 66 is alphabetic -character code 67 is alphabetic -character code 68 is alphabetic -character code 69 is alphabetic -character code 70 is alphabetic -character code 71 is alphabetic -character code 72 is alphabetic -character code 73 is alphabetic -character code 74 is alphabetic -character code 75 is alphabetic -character code 76 is alphabetic -character code 77 is alphabetic -character code 78 is alphabetic -character code 79 is alphabetic -character code 80 is alphabetic -character code 81 is alphabetic -character code 82 is alphabetic -character code 83 is alphabetic -character code 84 is alphabetic -character code 85 is alphabetic -character code 86 is alphabetic -character code 87 is alphabetic -character code 88 is alphabetic -character code 89 is alphabetic -character code 90 is alphabetic -character code 97 is alphabetic -character code 98 is alphabetic -character code 99 is alphabetic -character code 100 is alphabetic -character code 101 is alphabetic -character code 102 is alphabetic -character code 103 is alphabetic -character code 104 is alphabetic -character code 105 is alphabetic -character code 106 is alphabetic -character code 107 is alphabetic -character code 108 is alphabetic -character code 109 is alphabetic -character code 110 is alphabetic -character code 111 is alphabetic -character code 112 is alphabetic -character code 113 is alphabetic -character code 114 is alphabetic -character code 115 is alphabetic -character code 116 is alphabetic -character code 117 is alphabetic -character code 118 is alphabetic -character code 119 is alphabetic -character code 120 is alphabetic -character code 121 is alphabetic -character code 122 is alphabetic -===DONE=== diff --git a/ext/ctype/tests/ctype_alpha_variation3.phpt b/ext/ctype/tests/ctype_alpha_variation3.phpt deleted file mode 100644 index 3eed897954360..0000000000000 --- a/ext/ctype/tests/ctype_alpha_variation3.phpt +++ /dev/null @@ -1,128 +0,0 @@ ---TEST-- -Test ctype_alpha() function : usage variations - different strings ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alpha() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(true) - --- Iteration 6 -- -bool(true) - --- Iteration 7 -- -bool(true) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(true) - --- Iteration 16 -- -bool(true) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_alpha_variation4.phpt b/ext/ctype/tests/ctype_alpha_variation4.phpt deleted file mode 100644 index cf091a7b1b687..0000000000000 --- a/ext/ctype/tests/ctype_alpha_variation4.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Test ctype_alpha() function : usage variations - Octal and hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_alpha() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_cntrl_basic.phpt b/ext/ctype/tests/ctype_cntrl_basic.phpt deleted file mode 100644 index 5bd977b0602b8..0000000000000 --- a/ext/ctype/tests/ctype_cntrl_basic.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ctype_cntrl() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_cntrl() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_cntrl_error.phpt b/ext/ctype/tests/ctype_cntrl_error.phpt deleted file mode 100644 index d089e6edf50c0..0000000000000 --- a/ext/ctype/tests/ctype_cntrl_error.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test ctype_cntrl() function : error conditions - Incorrect number of args ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_cntrl() : error conditions *** - --- Testing ctype_cntrl() function with Zero arguments -- - -Warning: ctype_cntrl() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_cntrl() function with more than expected no. of arguments -- - -Warning: ctype_cntrl() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_cntrl_variation1.phpt b/ext/ctype/tests/ctype_cntrl_variation1.phpt deleted file mode 100644 index 0740d0def7c38..0000000000000 --- a/ext/ctype/tests/ctype_cntrl_variation1.phpt +++ /dev/null @@ -1,178 +0,0 @@ ---TEST-- -Test ctype_cntrl() function : usage variations - Different data types as $c arg ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_cntrl() : usage variations *** - --- Iteration 1 -- -bool(true) - --- Iteration 2 -- -bool(true) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_cntrl_variation2.phpt b/ext/ctype/tests/ctype_cntrl_variation2.phpt deleted file mode 100644 index a9deaab587ac1..0000000000000 --- a/ext/ctype/tests/ctype_cntrl_variation2.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Test ctype_cntrl() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_cntrl() : usage variations *** -character code 0 is control character -character code 1 is control character -character code 2 is control character -character code 3 is control character -character code 4 is control character -character code 5 is control character -character code 6 is control character -character code 7 is control character -character code 8 is control character -character code 9 is control character -character code 10 is control character -character code 11 is control character -character code 12 is control character -character code 13 is control character -character code 14 is control character -character code 15 is control character -character code 16 is control character -character code 17 is control character -character code 18 is control character -character code 19 is control character -character code 20 is control character -character code 21 is control character -character code 22 is control character -character code 23 is control character -character code 24 is control character -character code 25 is control character -character code 26 is control character -character code 27 is control character -character code 28 is control character -character code 29 is control character -character code 30 is control character -character code 31 is control character -character code 127 is control character -===DONE=== diff --git a/ext/ctype/tests/ctype_cntrl_variation3.phpt b/ext/ctype/tests/ctype_cntrl_variation3.phpt deleted file mode 100644 index 6528c1c0a6b98..0000000000000 --- a/ext/ctype/tests/ctype_cntrl_variation3.phpt +++ /dev/null @@ -1,156 +0,0 @@ ---TEST-- -Test ctype_cntrl() function : usage variations - Different strings ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_cntrl() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(true) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(true) - --- Iteration 25 -- -bool(true) - --- Iteration 26 -- -bool(true) - --- Iteration 27 -- -bool(false) - --- Iteration 28 -- -bool(false) - --- Iteration 29 -- -bool(false) - --- Iteration 30 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_cntrl_variation4.phpt b/ext/ctype/tests/ctype_cntrl_variation4.phpt deleted file mode 100644 index 38f622d465014..0000000000000 --- a/ext/ctype/tests/ctype_cntrl_variation4.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test ctype_cntrl() function : usage variations - Octal and hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_cntrl() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_digit_basic.phpt b/ext/ctype/tests/ctype_digit_basic.phpt deleted file mode 100644 index e39208cca401e..0000000000000 --- a/ext/ctype/tests/ctype_digit_basic.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ctype_digit() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_digit() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_digit_error.phpt b/ext/ctype/tests/ctype_digit_error.phpt deleted file mode 100644 index 7f911eba6e8b1..0000000000000 --- a/ext/ctype/tests/ctype_digit_error.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test ctype_digit() function : error conditions - incorrect number of arguments ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_digit() : error conditions *** - --- Testing ctype_digit() function with Zero arguments -- - -Warning: ctype_digit() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_digit() function with more than expected no. of arguments -- - -Warning: ctype_digit() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_digit_variation1.phpt b/ext/ctype/tests/ctype_digit_variation1.phpt deleted file mode 100644 index 626dcee6c0630..0000000000000 --- a/ext/ctype/tests/ctype_digit_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test ctype_digit() function : usage variations - different data types as $c arg ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_digit() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(true) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_digit_variation2.phpt b/ext/ctype/tests/ctype_digit_variation2.phpt deleted file mode 100644 index e7b9115711fbe..0000000000000 --- a/ext/ctype/tests/ctype_digit_variation2.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test ctype_digit() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_digit() : usage variations *** -character code 48 is a numeric digit -character code 49 is a numeric digit -character code 50 is a numeric digit -character code 51 is a numeric digit -character code 52 is a numeric digit -character code 53 is a numeric digit -character code 54 is a numeric digit -character code 55 is a numeric digit -character code 56 is a numeric digit -character code 57 is a numeric digit -===DONE=== diff --git a/ext/ctype/tests/ctype_digit_variation3.phpt b/ext/ctype/tests/ctype_digit_variation3.phpt deleted file mode 100644 index 4746166a76802..0000000000000 --- a/ext/ctype/tests/ctype_digit_variation3.phpt +++ /dev/null @@ -1,158 +0,0 @@ ---TEST-- -Test ctype_digit() function : usage variations - different strings ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_digit() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(true) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(true) - --- Iteration 15 -- -bool(true) - --- Iteration 16 -- -bool(true) - --- Iteration 17 -- -bool(true) - --- Iteration 18 -- -bool(true) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(true) - --- Iteration 23 -- -bool(true) - --- Iteration 24 -- -bool(true) - --- Iteration 25 -- -bool(false) - --- Iteration 26 -- -bool(false) - --- Iteration 27 -- -bool(false) - --- Iteration 28 -- -bool(false) - --- Iteration 29 -- -bool(false) - --- Iteration 30 -- -bool(false) - --- Iteration 31 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_digit_variation4.phpt b/ext/ctype/tests/ctype_digit_variation4.phpt deleted file mode 100644 index 852bba32e88eb..0000000000000 --- a/ext/ctype/tests/ctype_digit_variation4.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Test ctype_digit() function : usage variations - octal and hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_digit() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_graph_basic.phpt b/ext/ctype/tests/ctype_graph_basic.phpt deleted file mode 100644 index bf789fbeadff6..0000000000000 --- a/ext/ctype/tests/ctype_graph_basic.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ctype_graph() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_graph() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_graph_error.phpt b/ext/ctype/tests/ctype_graph_error.phpt deleted file mode 100644 index 7cd94fc26b6fd..0000000000000 --- a/ext/ctype/tests/ctype_graph_error.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test ctype_graph() function : error conditions - incorrect number of arguments ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_graph() : error conditions *** - --- Testing ctype_graph() function with Zero arguments -- - -Warning: ctype_graph() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_graph() function with more than expected no. of arguments -- - -Warning: ctype_graph() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_graph_variation1.phpt b/ext/ctype/tests/ctype_graph_variation1.phpt deleted file mode 100644 index ee6e95bd30f23..0000000000000 --- a/ext/ctype/tests/ctype_graph_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test ctype_graph() function : usage variations - different data types as $c arg ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_graph() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(true) - --- Iteration 4 -- -bool(true) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_graph_variation2.phpt b/ext/ctype/tests/ctype_graph_variation2.phpt deleted file mode 100644 index 6ab56c75e481e..0000000000000 --- a/ext/ctype/tests/ctype_graph_variation2.phpt +++ /dev/null @@ -1,124 +0,0 @@ ---TEST-- -Test ctype_graph() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_graph() : usage variations *** -character code 33 is a printable character -character code 34 is a printable character -character code 35 is a printable character -character code 36 is a printable character -character code 37 is a printable character -character code 38 is a printable character -character code 39 is a printable character -character code 40 is a printable character -character code 41 is a printable character -character code 42 is a printable character -character code 43 is a printable character -character code 44 is a printable character -character code 45 is a printable character -character code 46 is a printable character -character code 47 is a printable character -character code 48 is a printable character -character code 49 is a printable character -character code 50 is a printable character -character code 51 is a printable character -character code 52 is a printable character -character code 53 is a printable character -character code 54 is a printable character -character code 55 is a printable character -character code 56 is a printable character -character code 57 is a printable character -character code 58 is a printable character -character code 59 is a printable character -character code 60 is a printable character -character code 61 is a printable character -character code 62 is a printable character -character code 63 is a printable character -character code 64 is a printable character -character code 65 is a printable character -character code 66 is a printable character -character code 67 is a printable character -character code 68 is a printable character -character code 69 is a printable character -character code 70 is a printable character -character code 71 is a printable character -character code 72 is a printable character -character code 73 is a printable character -character code 74 is a printable character -character code 75 is a printable character -character code 76 is a printable character -character code 77 is a printable character -character code 78 is a printable character -character code 79 is a printable character -character code 80 is a printable character -character code 81 is a printable character -character code 82 is a printable character -character code 83 is a printable character -character code 84 is a printable character -character code 85 is a printable character -character code 86 is a printable character -character code 87 is a printable character -character code 88 is a printable character -character code 89 is a printable character -character code 90 is a printable character -character code 91 is a printable character -character code 92 is a printable character -character code 93 is a printable character -character code 94 is a printable character -character code 95 is a printable character -character code 96 is a printable character -character code 97 is a printable character -character code 98 is a printable character -character code 99 is a printable character -character code 100 is a printable character -character code 101 is a printable character -character code 102 is a printable character -character code 103 is a printable character -character code 104 is a printable character -character code 105 is a printable character -character code 106 is a printable character -character code 107 is a printable character -character code 108 is a printable character -character code 109 is a printable character -character code 110 is a printable character -character code 111 is a printable character -character code 112 is a printable character -character code 113 is a printable character -character code 114 is a printable character -character code 115 is a printable character -character code 116 is a printable character -character code 117 is a printable character -character code 118 is a printable character -character code 119 is a printable character -character code 120 is a printable character -character code 121 is a printable character -character code 122 is a printable character -character code 123 is a printable character -character code 124 is a printable character -character code 125 is a printable character -character code 126 is a printable character -===DONE=== diff --git a/ext/ctype/tests/ctype_graph_variation3.phpt b/ext/ctype/tests/ctype_graph_variation3.phpt deleted file mode 100644 index 7843a058f5ec1..0000000000000 --- a/ext/ctype/tests/ctype_graph_variation3.phpt +++ /dev/null @@ -1,146 +0,0 @@ ---TEST-- -Test ctype_graph() function : usage variations - different strings ---FILE-- -.?/", -/*25*/ "\"ABC\"", - "String\twith\ttabs", - "Sample string with newline\n", -/*28*/ "123 ABC XYZ", -); - -$iterator = 1; -foreach($values as $value) { - echo "\n-- Iteration $iterator --\n"; - var_dump( ctype_graph($value) ); - $iterator++; -}; - -setlocale(LC_CTYPE, $orig); -?> -===DONE=== ---EXPECTF-- -*** Testing ctype_graph() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(true) - --- Iteration 6 -- -bool(true) - --- Iteration 7 -- -bool(true) - --- Iteration 8 -- -bool(true) - --- Iteration 9 -- -bool(true) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(true) - --- Iteration 12 -- -bool(true) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(true) - --- Iteration 15 -- -bool(true) - --- Iteration 16 -- -bool(true) - --- Iteration 17 -- -bool(true) - --- Iteration 18 -- -bool(true) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(true) - --- Iteration 25 -- -bool(true) - --- Iteration 26 -- -bool(false) - --- Iteration 27 -- -bool(false) - --- Iteration 28 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_graph_variation4.phpt b/ext/ctype/tests/ctype_graph_variation4.phpt deleted file mode 100644 index 0a504324c7e0b..0000000000000 --- a/ext/ctype/tests/ctype_graph_variation4.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Test ctype_graph() function : usage variations - octal and hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_graph() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_lower_basic.phpt b/ext/ctype/tests/ctype_lower_basic.phpt deleted file mode 100644 index f9c8540481ea9..0000000000000 --- a/ext/ctype/tests/ctype_lower_basic.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ctype_lower() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_lower() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_lower_error.phpt b/ext/ctype/tests/ctype_lower_error.phpt deleted file mode 100644 index 141d02c6e2aaa..0000000000000 --- a/ext/ctype/tests/ctype_lower_error.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test ctype_lower() function : error conditions - incorrect number of args ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_lower() : error conditions *** - --- Testing ctype_lower() function with Zero arguments -- - -Warning: ctype_lower() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_lower() function with more than expected no. of arguments -- - -Warning: ctype_lower() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_lower_variation1.phpt b/ext/ctype/tests/ctype_lower_variation1.phpt deleted file mode 100644 index 60288c3d99aae..0000000000000 --- a/ext/ctype/tests/ctype_lower_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test ctype_lower() function : usage variations - different data types as $c arg ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_lower() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_lower_variation2.phpt b/ext/ctype/tests/ctype_lower_variation2.phpt deleted file mode 100644 index 99a3ad775e04a..0000000000000 --- a/ext/ctype/tests/ctype_lower_variation2.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Test ctype_lower() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_lower() : usage variations *** -character code 97 is a lower case character -character code 98 is a lower case character -character code 99 is a lower case character -character code 100 is a lower case character -character code 101 is a lower case character -character code 102 is a lower case character -character code 103 is a lower case character -character code 104 is a lower case character -character code 105 is a lower case character -character code 106 is a lower case character -character code 107 is a lower case character -character code 108 is a lower case character -character code 109 is a lower case character -character code 110 is a lower case character -character code 111 is a lower case character -character code 112 is a lower case character -character code 113 is a lower case character -character code 114 is a lower case character -character code 115 is a lower case character -character code 116 is a lower case character -character code 117 is a lower case character -character code 118 is a lower case character -character code 119 is a lower case character -character code 120 is a lower case character -character code 121 is a lower case character -character code 122 is a lower case character -===DONE=== diff --git a/ext/ctype/tests/ctype_lower_variation3.phpt b/ext/ctype/tests/ctype_lower_variation3.phpt deleted file mode 100644 index 73d6fcd60d93c..0000000000000 --- a/ext/ctype/tests/ctype_lower_variation3.phpt +++ /dev/null @@ -1,138 +0,0 @@ ---TEST-- -Test ctype_lower() function : usage variations - different strings ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_lower() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(true) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(true) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(true) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) - --- Iteration 26 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_lower_variation4.phpt b/ext/ctype/tests/ctype_lower_variation4.phpt deleted file mode 100644 index 30a68a3af2b2c..0000000000000 --- a/ext/ctype/tests/ctype_lower_variation4.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Test ctype_lower() function : usage variations - octal and hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_lower() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_print_basic.phpt b/ext/ctype/tests/ctype_print_basic.phpt deleted file mode 100644 index 5d01f5abd66d9..0000000000000 --- a/ext/ctype/tests/ctype_print_basic.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ctype_print() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_print() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_print_error.phpt b/ext/ctype/tests/ctype_print_error.phpt deleted file mode 100644 index 243d2f8022692..0000000000000 --- a/ext/ctype/tests/ctype_print_error.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test ctype_print() function : error conditions - incorrect number of args ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_print() : error conditions *** - --- Testing ctype_print() function with Zero arguments -- - -Warning: ctype_print() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_print() function with more than expected no. of arguments -- - -Warning: ctype_print() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_print_variation1.phpt b/ext/ctype/tests/ctype_print_variation1.phpt deleted file mode 100644 index c121dd723e334..0000000000000 --- a/ext/ctype/tests/ctype_print_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test ctype_print() function : usage variations - different data types as $c arg ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_print() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(true) - --- Iteration 4 -- -bool(true) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_print_variation2.phpt b/ext/ctype/tests/ctype_print_variation2.phpt deleted file mode 100644 index ac492b8825778..0000000000000 --- a/ext/ctype/tests/ctype_print_variation2.phpt +++ /dev/null @@ -1,125 +0,0 @@ ---TEST-- -Test ctype_print() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_print() : usage variations *** -character code 32 is a printable character -character code 33 is a printable character -character code 34 is a printable character -character code 35 is a printable character -character code 36 is a printable character -character code 37 is a printable character -character code 38 is a printable character -character code 39 is a printable character -character code 40 is a printable character -character code 41 is a printable character -character code 42 is a printable character -character code 43 is a printable character -character code 44 is a printable character -character code 45 is a printable character -character code 46 is a printable character -character code 47 is a printable character -character code 48 is a printable character -character code 49 is a printable character -character code 50 is a printable character -character code 51 is a printable character -character code 52 is a printable character -character code 53 is a printable character -character code 54 is a printable character -character code 55 is a printable character -character code 56 is a printable character -character code 57 is a printable character -character code 58 is a printable character -character code 59 is a printable character -character code 60 is a printable character -character code 61 is a printable character -character code 62 is a printable character -character code 63 is a printable character -character code 64 is a printable character -character code 65 is a printable character -character code 66 is a printable character -character code 67 is a printable character -character code 68 is a printable character -character code 69 is a printable character -character code 70 is a printable character -character code 71 is a printable character -character code 72 is a printable character -character code 73 is a printable character -character code 74 is a printable character -character code 75 is a printable character -character code 76 is a printable character -character code 77 is a printable character -character code 78 is a printable character -character code 79 is a printable character -character code 80 is a printable character -character code 81 is a printable character -character code 82 is a printable character -character code 83 is a printable character -character code 84 is a printable character -character code 85 is a printable character -character code 86 is a printable character -character code 87 is a printable character -character code 88 is a printable character -character code 89 is a printable character -character code 90 is a printable character -character code 91 is a printable character -character code 92 is a printable character -character code 93 is a printable character -character code 94 is a printable character -character code 95 is a printable character -character code 96 is a printable character -character code 97 is a printable character -character code 98 is a printable character -character code 99 is a printable character -character code 100 is a printable character -character code 101 is a printable character -character code 102 is a printable character -character code 103 is a printable character -character code 104 is a printable character -character code 105 is a printable character -character code 106 is a printable character -character code 107 is a printable character -character code 108 is a printable character -character code 109 is a printable character -character code 110 is a printable character -character code 111 is a printable character -character code 112 is a printable character -character code 113 is a printable character -character code 114 is a printable character -character code 115 is a printable character -character code 116 is a printable character -character code 117 is a printable character -character code 118 is a printable character -character code 119 is a printable character -character code 120 is a printable character -character code 121 is a printable character -character code 122 is a printable character -character code 123 is a printable character -character code 124 is a printable character -character code 125 is a printable character -character code 126 is a printable character -===DONE=== diff --git a/ext/ctype/tests/ctype_print_variation3.phpt b/ext/ctype/tests/ctype_print_variation3.phpt deleted file mode 100644 index 0231a3db2a9ba..0000000000000 --- a/ext/ctype/tests/ctype_print_variation3.phpt +++ /dev/null @@ -1,126 +0,0 @@ ---TEST-- -Test ctype_print() function : usage variations - different strings ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_print() : usage variations *** - --- Iteration 1 -- -bool(true) - --- Iteration 2 -- -bool(true) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(true) - --- Iteration 5 -- -bool(true) - --- Iteration 6 -- -bool(true) - --- Iteration 7 -- -bool(true) - --- Iteration 8 -- -bool(true) - --- Iteration 9 -- -bool(true) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(true) - --- Iteration 12 -- -bool(true) - --- Iteration 13 -- -bool(true) - --- Iteration 14 -- -bool(true) - --- Iteration 15 -- -bool(true) - --- Iteration 16 -- -bool(true) - --- Iteration 17 -- -bool(true) - --- Iteration 18 -- -bool(true) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(true) - --- Iteration 23 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_print_variation4.phpt b/ext/ctype/tests/ctype_print_variation4.phpt deleted file mode 100644 index b8e643582b560..0000000000000 --- a/ext/ctype/tests/ctype_print_variation4.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test ctype_print() function : usage variations - octal and hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_print() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_punct_basic.phpt b/ext/ctype/tests/ctype_punct_basic.phpt deleted file mode 100644 index d1f6f4601a9d0..0000000000000 --- a/ext/ctype/tests/ctype_punct_basic.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Test ctype_punct() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_punct() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_punct_error.phpt b/ext/ctype/tests/ctype_punct_error.phpt deleted file mode 100644 index ec4aff71dfeb1..0000000000000 --- a/ext/ctype/tests/ctype_punct_error.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Test ctype_punct() function : error conditions - incorrect number of args ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_punct() : error conditions *** - --- Testing ctype_punct() function with Zero arguments -- - -Warning: ctype_punct() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_punct() function with more than expected no. of arguments -- - -Warning: ctype_punct() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_punct_variation1.phpt b/ext/ctype/tests/ctype_punct_variation1.phpt deleted file mode 100644 index 2bdfd709c0aa0..0000000000000 --- a/ext/ctype/tests/ctype_punct_variation1.phpt +++ /dev/null @@ -1,178 +0,0 @@ ---TEST-- -Test ctype_punct() function : usage variations - different data types as $c argument ---FILE-- -"; - } -} - -// heredoc string -$heredoc = << -===DONE=== ---EXPECTF-- -*** Testing ctype_punct() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_punct_variation2.phpt b/ext/ctype/tests/ctype_punct_variation2.phpt deleted file mode 100644 index cc04753e648d5..0000000000000 --- a/ext/ctype/tests/ctype_punct_variation2.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Test ctype_punct() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_punct() : usage variations *** -character code 33 is punctuation -character code 34 is punctuation -character code 35 is punctuation -character code 36 is punctuation -character code 37 is punctuation -character code 38 is punctuation -character code 39 is punctuation -character code 40 is punctuation -character code 41 is punctuation -character code 42 is punctuation -character code 43 is punctuation -character code 44 is punctuation -character code 45 is punctuation -character code 46 is punctuation -character code 47 is punctuation -character code 58 is punctuation -character code 59 is punctuation -character code 60 is punctuation -character code 61 is punctuation -character code 62 is punctuation -character code 63 is punctuation -character code 64 is punctuation -character code 91 is punctuation -character code 92 is punctuation -character code 93 is punctuation -character code 94 is punctuation -character code 95 is punctuation -character code 96 is punctuation -character code 123 is punctuation -character code 124 is punctuation -character code 125 is punctuation -character code 126 is punctuation -===DONE=== diff --git a/ext/ctype/tests/ctype_punct_variation3.phpt b/ext/ctype/tests/ctype_punct_variation3.phpt deleted file mode 100644 index 5282a291b7c38..0000000000000 --- a/ext/ctype/tests/ctype_punct_variation3.phpt +++ /dev/null @@ -1,138 +0,0 @@ ---TEST-- -Test ctype_punct() function : usage variations - different punctuation ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_punct() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(true) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(true) - --- Iteration 26 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_punct_variation4.phpt b/ext/ctype/tests/ctype_punct_variation4.phpt deleted file mode 100644 index 40ef656cb1c5f..0000000000000 --- a/ext/ctype/tests/ctype_punct_variation4.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Test ctype_punct() function : usage variations - Octal and Hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_punct() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_space_basic.phpt b/ext/ctype/tests/ctype_space_basic.phpt deleted file mode 100644 index 8f2cbe91b4438..0000000000000 --- a/ext/ctype/tests/ctype_space_basic.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ctype_space() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_space() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_space_error.phpt b/ext/ctype/tests/ctype_space_error.phpt deleted file mode 100644 index e4cd4f4f46388..0000000000000 --- a/ext/ctype/tests/ctype_space_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test ctype_space() function : error conditions - Incorrect number of args ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_space() : error conditions *** - --- Testing ctype_space() function with Zero arguments -- - -Warning: ctype_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_space() function with more than expected no. of arguments -- - -Warning: ctype_space() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_space_variation1.phpt b/ext/ctype/tests/ctype_space_variation1.phpt deleted file mode 100644 index be1cb2406ba27..0000000000000 --- a/ext/ctype/tests/ctype_space_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test ctype_space() function : usage variations - different data types as $c argument ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_space() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_space_variation2.phpt b/ext/ctype/tests/ctype_space_variation2.phpt deleted file mode 100644 index 8eadc23594c32..0000000000000 --- a/ext/ctype/tests/ctype_space_variation2.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test ctype_space() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_space() : usage variations *** -character code 9 is a space character -character code 10 is a space character -character code 11 is a space character -character code 12 is a space character -character code 13 is a space character -character code 32 is a space character -===DONE=== diff --git a/ext/ctype/tests/ctype_space_variation3.phpt b/ext/ctype/tests/ctype_space_variation3.phpt deleted file mode 100644 index 21aa866c9c259..0000000000000 --- a/ext/ctype/tests/ctype_space_variation3.phpt +++ /dev/null @@ -1,138 +0,0 @@ ---TEST-- -Test ctype_space() function : usage variations - different strings ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_space() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(true) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(true) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(true) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(true) - --- Iteration 26 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_space_variation4.phpt b/ext/ctype/tests/ctype_space_variation4.phpt deleted file mode 100644 index 3eed45a456bf0..0000000000000 --- a/ext/ctype/tests/ctype_space_variation4.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -Test ctype_space() function : usage variations - octal and hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_space() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) --- Iteration 5 -- -bool(true) --- Iteration 6 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) --- Iteration 5 -- -bool(true) --- Iteration 6 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_upper_basic.phpt b/ext/ctype/tests/ctype_upper_basic.phpt deleted file mode 100644 index 55f91151a8e7f..0000000000000 --- a/ext/ctype/tests/ctype_upper_basic.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ctype_upper() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_upper() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_upper_error.phpt b/ext/ctype/tests/ctype_upper_error.phpt deleted file mode 100644 index 185e63d9ed200..0000000000000 --- a/ext/ctype/tests/ctype_upper_error.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test ctype_upper() function : error conditions - incorrect number of args ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_upper() : error conditions *** - --- Testing ctype_upper() function with Zero arguments -- - -Warning: ctype_upper() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_upper() function with more than expected no. of arguments -- - -Warning: ctype_upper() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_upper_variation1.phpt b/ext/ctype/tests/ctype_upper_variation1.phpt deleted file mode 100644 index f7dd079217df9..0000000000000 --- a/ext/ctype/tests/ctype_upper_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test ctype_upper() function : usage variations - different data types ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_upper() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_upper_variation2.phpt b/ext/ctype/tests/ctype_upper_variation2.phpt deleted file mode 100644 index 03ec85806a102..0000000000000 --- a/ext/ctype/tests/ctype_upper_variation2.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test ctype_upper() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_upper() : usage variations *** -character code 65 is a uppercase character -character code 66 is a uppercase character -character code 67 is a uppercase character -character code 68 is a uppercase character -character code 69 is a uppercase character -character code 70 is a uppercase character -character code 71 is a uppercase character -character code 72 is a uppercase character -character code 73 is a uppercase character -character code 74 is a uppercase character -character code 75 is a uppercase character -character code 76 is a uppercase character -character code 77 is a uppercase character -character code 78 is a uppercase character -character code 79 is a uppercase character -character code 80 is a uppercase character -character code 81 is a uppercase character -character code 82 is a uppercase character -character code 83 is a uppercase character -character code 84 is a uppercase character -character code 85 is a uppercase character -character code 86 is a uppercase character -character code 87 is a uppercase character -character code 88 is a uppercase character -character code 89 is a uppercase character -character code 90 is a uppercase character -===DONE=== diff --git a/ext/ctype/tests/ctype_upper_variation3.phpt b/ext/ctype/tests/ctype_upper_variation3.phpt deleted file mode 100644 index db57ed5f9b8ad..0000000000000 --- a/ext/ctype/tests/ctype_upper_variation3.phpt +++ /dev/null @@ -1,137 +0,0 @@ ---TEST-- -Test ctype_upper() function : usage variations - different strings ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_upper() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(true) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(true) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) - --- Iteration 26 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_upper_variation4.phpt b/ext/ctype/tests/ctype_upper_variation4.phpt deleted file mode 100644 index 723c4d0a81ac8..0000000000000 --- a/ext/ctype/tests/ctype_upper_variation4.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test ctype_upper() function : usage variations - octal and hexadecimal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_upper() : usage variations *** - --- Octal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) - --- Hexadecimal Values -- --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) -===DONE=== diff --git a/ext/ctype/tests/ctype_xdigit_basic.phpt b/ext/ctype/tests/ctype_xdigit_basic.phpt deleted file mode 100644 index 58cc5b2e0a558..0000000000000 --- a/ext/ctype/tests/ctype_xdigit_basic.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Test ctype_xdigit() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_xdigit() : basic functionality *** -bool(true) -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_xdigit_error.phpt b/ext/ctype/tests/ctype_xdigit_error.phpt deleted file mode 100644 index 06ee733415587..0000000000000 --- a/ext/ctype/tests/ctype_xdigit_error.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test ctype_xdigit() function : error conditions - Incorrect number of args ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_xdigit() : error conditions *** - --- Testing ctype_xdigit() function with Zero arguments -- - -Warning: ctype_xdigit() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing ctype_xdigit() function with more than expected no. of arguments -- - -Warning: ctype_xdigit() expects exactly 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/ctype/tests/ctype_xdigit_variation1.phpt b/ext/ctype/tests/ctype_xdigit_variation1.phpt deleted file mode 100644 index adde77bbd71a7..0000000000000 --- a/ext/ctype/tests/ctype_xdigit_variation1.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test ctype_xdigit() function : usage variations - different data typse as $c arg ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_xdigit() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(true) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(false) - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(true) - --- Iteration 20 -- -bool(true) - --- Iteration 21 -- -bool(true) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(false) - --- Iteration 25 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_xdigit_variation2.phpt b/ext/ctype/tests/ctype_xdigit_variation2.phpt deleted file mode 100644 index 92f9aba0c08b3..0000000000000 --- a/ext/ctype/tests/ctype_xdigit_variation2.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test ctype_xdigit() function : usage variations - different integers ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_xdigit() : usage variations *** -character code 48 is a hexadecimal 'digit' -character code 49 is a hexadecimal 'digit' -character code 50 is a hexadecimal 'digit' -character code 51 is a hexadecimal 'digit' -character code 52 is a hexadecimal 'digit' -character code 53 is a hexadecimal 'digit' -character code 54 is a hexadecimal 'digit' -character code 55 is a hexadecimal 'digit' -character code 56 is a hexadecimal 'digit' -character code 57 is a hexadecimal 'digit' -character code 65 is a hexadecimal 'digit' -character code 66 is a hexadecimal 'digit' -character code 67 is a hexadecimal 'digit' -character code 68 is a hexadecimal 'digit' -character code 69 is a hexadecimal 'digit' -character code 70 is a hexadecimal 'digit' -character code 97 is a hexadecimal 'digit' -character code 98 is a hexadecimal 'digit' -character code 99 is a hexadecimal 'digit' -character code 100 is a hexadecimal 'digit' -character code 101 is a hexadecimal 'digit' -character code 102 is a hexadecimal 'digit' -===DONE=== diff --git a/ext/ctype/tests/ctype_xdigit_variation3.phpt b/ext/ctype/tests/ctype_xdigit_variation3.phpt deleted file mode 100644 index 35e8407fccec8..0000000000000 --- a/ext/ctype/tests/ctype_xdigit_variation3.phpt +++ /dev/null @@ -1,138 +0,0 @@ ---TEST-- -Test ctype_xdigit() function : usage variations - Different strings ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_xdigit() : usage variations *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(true) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -bool(true) - --- Iteration 12 -- -bool(true) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(true) - --- Iteration 16 -- -bool(true) - --- Iteration 17 -- -bool(true) - --- Iteration 18 -- -bool(true) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- -bool(true) - --- Iteration 25 -- -bool(false) - --- Iteration 26 -- -bool(false) -===DONE=== diff --git a/ext/ctype/tests/ctype_xdigit_variation4.phpt b/ext/ctype/tests/ctype_xdigit_variation4.phpt deleted file mode 100644 index 68e03cb8892ef..0000000000000 --- a/ext/ctype/tests/ctype_xdigit_variation4.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -Test ctype_xdigit() function : usage variations - heaxadecimal and octal values ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing ctype_xdigit() : usage variations *** - --- Octal values -- -'Incorrect' Integers: -bool(false) -bool(false) -bool(false) -bool(false) -'Correct' Integers: -bool(true) -bool(true) -bool(true) -bool(true) - --- Hexadecimal values -- -'Incorrect' Integers: -bool(false) -bool(false) -bool(false) -bool(false) -'Correct' Integers: -bool(true) -bool(true) -bool(true) -bool(true) -===DONE=== diff --git a/ext/curl/CREDITS b/ext/curl/CREDITS deleted file mode 100644 index 610e036787aa3..0000000000000 --- a/ext/curl/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -cURL -Sterling Hughes diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 deleted file mode 100644 index 9452b9cd55d49..0000000000000 --- a/ext/curl/config.m4 +++ /dev/null @@ -1,156 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(curl, for cURL support, -[ --with-curl[=DIR] Include cURL support]) - -dnl Temporary option while we develop this aspect of the extension -PHP_ARG_WITH(curlwrappers, if we should use cURL for url streams, -[ --with-curlwrappers Use cURL for url streams], no, no) - -if test "$PHP_CURL" != "no"; then - if test -r $PHP_CURL/include/curl/easy.h; then - CURL_DIR=$PHP_CURL - else - AC_MSG_CHECKING(for cURL in default path) - for i in /usr/local /usr; do - if test -r $i/include/curl/easy.h; then - CURL_DIR=$i - AC_MSG_RESULT(found in $i) - break - fi - done - fi - - if test -z "$CURL_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the libcurl distribution - - easy.h should be in /include/curl/) - fi - - CURL_CONFIG="curl-config" - AC_MSG_CHECKING(for cURL 7.10.5 or greater) - - if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then - CURL_CONFIG=${CURL_DIR}/bin/curl-config - else - if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then - CURL_CONFIG=${CURL_DIR}/curl-config - fi - fi - - curl_version_full=`$CURL_CONFIG --version` - curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$curl_version" -ge 7010005; then - AC_MSG_RESULT($curl_version_full) - CURL_LIBS=`$CURL_CONFIG --libs` - else - AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support) - fi - - AC_MSG_CHECKING([for SSL support in libcurl]) - CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL` - if test "$CURL_SSL" = "SSL"; then - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_CURL_SSL], [1], [Have cURL with SSL support]) - - save_CFLAGS="$CFLAGS" - CFLAGS="`$CURL_CONFIG --cflags`" - save_LDFLAGS="$LDFLAGS" - LDFLAGS="`$CURL_CONFIG --libs` $ld_runpath_switch$CURL_DIR/$PHP_LIBDIR" - - AC_PROG_CPP - AC_MSG_CHECKING([for openssl support in libcurl]) - AC_TRY_RUN([ - #include - int main(int argc, char *argv[]) { - curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); - if (data && data->ssl_version && *data->ssl_version) { - const char *ptr = data->ssl_version; - while(*ptr == ' ') ++ptr; - return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1); - } - return 1; - } - ],[ - AC_MSG_RESULT([yes]) - AC_CHECK_HEADERS([openssl/crypto.h], [ - AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support]) - ]) - ], [ - AC_MSG_RESULT([no]) - ], [ - AC_MSG_RESULT([no]) - ]) - - AC_MSG_CHECKING([for gnutls support in libcurl]) - AC_TRY_RUN([ - #include - int main(int argc, char *argv[]) { - curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); - if (data && data->ssl_version && *data->ssl_version) { - const char *ptr = data->ssl_version; - while(*ptr == ' ') ++ptr; - return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1); - } - return 1; - } - ], [ - AC_MSG_RESULT([yes]) - AC_CHECK_HEADER([gcrypt.h], [ - AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support]) - ]) - ], [ - AC_MSG_RESULT([no]) - ], [ - AC_MSG_RESULT([no]) - ]) - - CFLAGS="$save_CFLAGS" - LDFLAGS="$save_LDFLAGS" - else - AC_MSG_RESULT([no]) - fi - - PHP_ADD_INCLUDE($CURL_DIR/include) - PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD) - - PHP_CHECK_LIBRARY(curl,curl_easy_perform, - [ - AC_DEFINE(HAVE_CURL,1,[ ]) - ],[ - AC_MSG_ERROR(There is something wrong. Please check config.log for more information.) - ],[ - $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR - ]) - - PHP_CHECK_LIBRARY(curl,curl_version_info, - [ - AC_DEFINE(HAVE_CURL_VERSION_INFO,1,[ ]) - ],[],[ - $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR - ]) - - PHP_CHECK_LIBRARY(curl,curl_easy_strerror, - [ - AC_DEFINE(HAVE_CURL_EASY_STRERROR,1,[ ]) - ],[],[ - $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR - ]) - - PHP_CHECK_LIBRARY(curl,curl_multi_strerror, - [ - AC_DEFINE(HAVE_CURL_MULTI_STRERROR,1,[ ]) - ],[],[ - $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR - ]) - - if test "$PHP_CURLWRAPPERS" != "no" ; then - AC_DEFINE(PHP_CURL_URL_WRAPPERS,1,[ ]) - fi - - PHP_NEW_EXTENSION(curl, interface.c multi.c streams.c, $ext_shared) - PHP_SUBST(CURL_SHARED_LIBADD) -fi diff --git a/ext/curl/config.w32 b/ext/curl/config.w32 deleted file mode 100644 index de10e16b82223..0000000000000 --- a/ext/curl/config.w32 +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("curl", "cURL support", "no"); - -if (PHP_CURL != "no") { - if (CHECK_LIB("libcurl.lib", "curl", PHP_CURL) && - CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") && - CHECK_LIB("ssleay32.lib", "curl", PHP_CURL) && - CHECK_LIB("libeay32.lib", "curl", PHP_CURL) && - CHECK_LIB("zlib.lib", "curl", PHP_CURL) && - CHECK_LIB("winmm.lib", "curl", PHP_CURL)) { - EXTENSION("curl", "interface.c multi.c streams.c"); - AC_DEFINE('HAVE_CURL', 1, 'Have cURL library'); - AC_DEFINE('HAVE_CURL_SSL', 1, 'Have SSL suppurt in cURL'); - ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB"); - // TODO: check for curl_version_info - // AC_DEFINE('PHP_CURL_URL_WRAPPERS', 0, 'Use curl for URL wrappers [experimental]'); - } else { - WARNING("curl not enabled; libraries and headers not found"); - } -} diff --git a/ext/curl/curl.dsp b/ext/curl/curl.dsp deleted file mode 100644 index 81d823183d28a..0000000000000 --- a/ext/curl/curl.dsp +++ /dev/null @@ -1,186 +0,0 @@ -# Microsoft Developer Studio Project File - Name="curl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=curl - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "curl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "curl.mak" CFG="curl - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "curl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curl - Win32 Debug_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curl - Win32 Release_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "curl - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS_SSL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "curl___Win32_Debug_TS_SSL" -# PROP BASE Intermediate_Dir "curl___Win32_Debug_TS_SSL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS_SSL" -# PROP Intermediate_Dir "Debug_TS_SSL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php5ts_debug.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none /nodefaultlib - -!ELSEIF "$(CFG)" == "curl - Win32 Release_TS_SSL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "curl___Win32_Release_TS_SSL" -# PROP BASE Intermediate_Dir "curl___Win32_Release_TS_SSL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS_SSL" -# PROP Intermediate_Dir "Release_TS_SSL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php5ts.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "curl - Win32 Release_TS" -# Name "curl - Win32 Debug_TS" -# Name "curl - Win32 Debug_TS_SSL" -# Name "curl - Win32 Release_TS_SSL" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\interface.c -# End Source File - -# Begin Source File -SOURCE=.\multi.c -# End Source File - -# Begin Source File -SOURCE=.\streams.c -# End Source File - -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_curl.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/curl/interface.c b/ext/curl/interface.c deleted file mode 100644 index 182f6f08ccdf3..0000000000000 --- a/ext/curl/interface.c +++ /dev/null @@ -1,2036 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_CURL - -#include -#include - -#ifdef PHP_WIN32 -#include -#include -#endif - -#include -#include - -/* As of curl 7.11.1 this is no longer defined inside curl.h */ -#ifndef HttpPost -#define HttpPost curl_httppost -#endif - -/* {{{ cruft for thread safe SSL crypto locks */ -#if defined(ZTS) && defined(HAVE_CURL_SSL) -# ifdef PHP_WIN32 -# define PHP_CURL_NEED_OPENSSL_TSL -# include -# else /* !PHP_WIN32 */ -# if defined(HAVE_CURL_OPENSSL) -# if defined(HAVE_OPENSSL_CRYPTO_H) -# define PHP_CURL_NEED_OPENSSL_TSL -# include -# else -# warning \ - "libcurl was compiled with OpenSSL support, but configure could not find " \ - "openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \ - "cause random crashes on SSL requests" -# endif -# elif defined(HAVE_CURL_GNUTLS) -# if defined(HAVE_GCRYPT_H) -# define PHP_CURL_NEED_GNUTLS_TSL -# include -# else -# warning \ - "libcurl was compiled with GnuTLS support, but configure could not find " \ - "gcrypt.h; thus no SSL crypto locking callbacks will be set, which may " \ - "cause random crashes on SSL requests" -# endif -# else -# warning \ - "libcurl was compiled with SSL support, but configure could not determine which" \ - "library was used; thus no SSL crypto locking callbacks will be set, which may " \ - "cause random crashes on SSL requests" -# endif /* HAVE_CURL_OPENSSL || HAVE_CURL_GNUTLS */ -# endif /* PHP_WIN32 */ -#endif /* ZTS && HAVE_CURL_SSL */ -/* }}} */ - -#define SMART_STR_PREALLOC 4096 - -#include "ext/standard/php_smart_str.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "ext/standard/url.h" -#include "php_curl.h" - -int le_curl; -int le_curl_multi_handle; - -#ifdef PHP_CURL_NEED_OPENSSL_TSL /* {{{ */ -static MUTEX_T *php_curl_openssl_tsl = NULL; - -static void php_curl_ssl_lock(int mode, int n, const char * file, int line) -{ - if (mode & CRYPTO_LOCK) { - tsrm_mutex_lock(php_curl_openssl_tsl[n]); - } else { - tsrm_mutex_unlock(php_curl_openssl_tsl[n]); - } -} - -static unsigned long php_curl_ssl_id(void) -{ - return (unsigned long) tsrm_thread_id(); -} -#endif -/* }}} */ - -#ifdef PHP_CURL_NEED_GNUTLS_TSL /* {{{ */ -static int php_curl_ssl_mutex_create(void **m) -{ - if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) { - return SUCCESS; - } else { - return FAILURE; - } -} - -static int php_curl_ssl_mutex_destroy(void **m) -{ - tsrm_mutex_free(*((MUTEX_T *) m)); - return SUCCESS; -} - -static int php_curl_ssl_mutex_lock(void **m) -{ - return tsrm_mutex_lock(*((MUTEX_T *) m)); -} - -static int php_curl_ssl_mutex_unlock(void **m) -{ - return tsrm_mutex_unlock(*((MUTEX_T *) m)); -} - -static struct gcry_thread_cbs php_curl_gnutls_tsl = { - GCRY_THREAD_OPTION_USER, - NULL, - php_curl_ssl_mutex_create, - php_curl_ssl_mutex_destroy, - php_curl_ssl_mutex_lock, - php_curl_ssl_mutex_unlock -}; -#endif -/* }}} */ - -static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err; - -#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s), (long) v); -#define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s), (double) v); -#define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s), (char *) (v ? v : ""), 1); -#define CAAZ(s, v) add_assoc_zval_ex(return_value, s, sizeof(s), (zval *) v); - -#if defined(PHP_WIN32) || defined(__GNUC__) - #define php_curl_ret(__ret) RETVAL_FALSE; return __ret; -#else - #define php_curl_ret(__ret) RETVAL_FALSE; return; -#endif - -#define PHP_CURL_CHECK_OPEN_BASEDIR(str, len, __ret) \ - if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && \ - strncasecmp(str, "file:", sizeof("file:") - 1) == 0) \ - { \ - php_url *tmp_url; \ - \ - if (!(tmp_url = php_url_parse_ex(str, len))) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", str); \ - php_curl_ret(__ret); \ - } \ - \ - if (tmp_url->host || !php_memnstr(str, tmp_url->path, strlen(tmp_url->path), str + len)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL '%s' contains unencoded control characters", str); \ - php_url_free(tmp_url); \ - php_curl_ret(__ret); \ - } \ - \ - if (tmp_url->query || tmp_url->fragment || php_check_open_basedir(tmp_url->path TSRMLS_CC) || \ - (PG(safe_mode) && !php_checkuid(tmp_url->path, "rb+", CHECKUID_CHECK_MODE_PARAM)) \ - ) { \ - php_url_free(tmp_url); \ - php_curl_ret(__ret); \ - } \ - php_url_free(tmp_url); \ - } - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_version, 0, 0, 0) - ZEND_ARG_INFO(0, version) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_init, 0, 0, 0) - ZEND_ARG_INFO(0, url) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_copy_handle, 0) - ZEND_ARG_INFO(0, ch) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_setopt, 0) - ZEND_ARG_INFO(0, ch) - ZEND_ARG_INFO(0, option) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_setopt_array, 0) - ZEND_ARG_INFO(0, ch) - ZEND_ARG_INFO(0, options)/* ARRAY_INFO(0, options, 0) */ -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_exec, 0) - ZEND_ARG_INFO(0, ch) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_getinfo, 0, 0, 1) - ZEND_ARG_INFO(0, ch) - ZEND_ARG_INFO(0, option) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_error, 0) - ZEND_ARG_INFO(0, ch) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_errno, 0) - ZEND_ARG_INFO(0, ch) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_close, 0) - ZEND_ARG_INFO(0, ch) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_init, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_add_handle, 0) - ZEND_ARG_INFO(0, mh) - ZEND_ARG_INFO(0, ch) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_remove_handle, 0) - ZEND_ARG_INFO(0, mh) - ZEND_ARG_INFO(0, ch) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_multi_select, 0, 0, 1) - ZEND_ARG_INFO(0, mh) - ZEND_ARG_INFO(0, timeout) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_multi_exec, 0, 0, 1) - ZEND_ARG_INFO(0, mh) - ZEND_ARG_INFO(1, still_running) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_getcontent, 0) - ZEND_ARG_INFO(0, ch) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_multi_info_read, 0, 0, 1) - ZEND_ARG_INFO(0, mh) - ZEND_ARG_INFO(0, msgs_in_queue) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_close, 0) - ZEND_ARG_INFO(0, mh) -ZEND_END_ARG_INFO() - -/* }}} */ - -/* {{{ curl_functions[] - */ -zend_function_entry curl_functions[] = { - PHP_FE(curl_init, arginfo_curl_init) - PHP_FE(curl_copy_handle, arginfo_curl_copy_handle) - PHP_FE(curl_version, arginfo_curl_version) - PHP_FE(curl_setopt, arginfo_curl_setopt) - PHP_FE(curl_setopt_array, arginfo_curl_setopt_array) - PHP_FE(curl_exec, arginfo_curl_exec) - PHP_FE(curl_getinfo, arginfo_curl_getinfo) - PHP_FE(curl_error, arginfo_curl_error) - PHP_FE(curl_errno, arginfo_curl_errno) - PHP_FE(curl_close, arginfo_curl_close) - PHP_FE(curl_multi_init, arginfo_curl_multi_init) - PHP_FE(curl_multi_add_handle, arginfo_curl_multi_add_handle) - PHP_FE(curl_multi_remove_handle, arginfo_curl_multi_remove_handle) - PHP_FE(curl_multi_select, arginfo_curl_multi_select) - PHP_FE(curl_multi_exec, arginfo_curl_multi_exec) - PHP_FE(curl_multi_getcontent, arginfo_curl_multi_getcontent) - PHP_FE(curl_multi_info_read, arginfo_curl_multi_info_read) - PHP_FE(curl_multi_close, arginfo_curl_multi_close) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ curl_module_entry - */ -zend_module_entry curl_module_entry = { - STANDARD_MODULE_HEADER, - "curl", - curl_functions, - PHP_MINIT(curl), - PHP_MSHUTDOWN(curl), - NULL, - NULL, - PHP_MINFO(curl), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_CURL -ZEND_GET_MODULE (curl) -#endif - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(curl) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "cURL support", "enabled"); - php_info_print_table_row(2, "cURL Information", curl_version()); - php_info_print_table_end(); -} -/* }}} */ - -#define REGISTER_CURL_CONSTANT(__c) REGISTER_LONG_CONSTANT(#__c, __c, CONST_CS | CONST_PERSISTENT) - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(curl) -{ - le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number); - le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, "curl", module_number); - - /* Constants for curl_setopt() */ - REGISTER_CURL_CONSTANT(CURLOPT_DNS_USE_GLOBAL_CACHE); - REGISTER_CURL_CONSTANT(CURLOPT_DNS_CACHE_TIMEOUT); - REGISTER_CURL_CONSTANT(CURLOPT_PORT); - REGISTER_CURL_CONSTANT(CURLOPT_FILE); - REGISTER_CURL_CONSTANT(CURLOPT_READDATA); - REGISTER_CURL_CONSTANT(CURLOPT_INFILE); - REGISTER_CURL_CONSTANT(CURLOPT_INFILESIZE); - REGISTER_CURL_CONSTANT(CURLOPT_URL); - REGISTER_CURL_CONSTANT(CURLOPT_PROXY); - REGISTER_CURL_CONSTANT(CURLOPT_VERBOSE); - REGISTER_CURL_CONSTANT(CURLOPT_HEADER); - REGISTER_CURL_CONSTANT(CURLOPT_HTTPHEADER); - REGISTER_CURL_CONSTANT(CURLOPT_NOPROGRESS); - REGISTER_CURL_CONSTANT(CURLOPT_NOBODY); - REGISTER_CURL_CONSTANT(CURLOPT_FAILONERROR); - REGISTER_CURL_CONSTANT(CURLOPT_UPLOAD); - REGISTER_CURL_CONSTANT(CURLOPT_POST); - REGISTER_CURL_CONSTANT(CURLOPT_FTPLISTONLY); - REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND); - REGISTER_CURL_CONSTANT(CURLOPT_NETRC); - REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION); -#if CURLOPT_FTPASCII != 0 - REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII); -#endif - REGISTER_CURL_CONSTANT(CURLOPT_PUT); -#if CURLOPT_MUTE != 0 - REGISTER_CURL_CONSTANT(CURLOPT_MUTE); -#endif - REGISTER_CURL_CONSTANT(CURLOPT_USERPWD); - REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERPWD); - REGISTER_CURL_CONSTANT(CURLOPT_RANGE); - REGISTER_CURL_CONSTANT(CURLOPT_TIMEOUT); -#if LIBCURL_VERSION_NUM > 0x071002 - REGISTER_CURL_CONSTANT(CURLOPT_TIMEOUT_MS); -#endif - REGISTER_CURL_CONSTANT(CURLOPT_POSTFIELDS); - REGISTER_CURL_CONSTANT(CURLOPT_REFERER); - REGISTER_CURL_CONSTANT(CURLOPT_USERAGENT); - REGISTER_CURL_CONSTANT(CURLOPT_FTPPORT); - REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_EPSV); - REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_LIMIT); - REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_TIME); - REGISTER_CURL_CONSTANT(CURLOPT_RESUME_FROM); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIE); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIESESSION); - REGISTER_CURL_CONSTANT(CURLOPT_AUTOREFERER); - REGISTER_CURL_CONSTANT(CURLOPT_SSLCERT); - REGISTER_CURL_CONSTANT(CURLOPT_SSLCERTPASSWD); - REGISTER_CURL_CONSTANT(CURLOPT_WRITEHEADER); - REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYHOST); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIEFILE); - REGISTER_CURL_CONSTANT(CURLOPT_SSLVERSION); - REGISTER_CURL_CONSTANT(CURLOPT_TIMECONDITION); - REGISTER_CURL_CONSTANT(CURLOPT_TIMEVALUE); - REGISTER_CURL_CONSTANT(CURLOPT_CUSTOMREQUEST); - REGISTER_CURL_CONSTANT(CURLOPT_STDERR); - REGISTER_CURL_CONSTANT(CURLOPT_TRANSFERTEXT); - REGISTER_CURL_CONSTANT(CURLOPT_RETURNTRANSFER); - REGISTER_CURL_CONSTANT(CURLOPT_QUOTE); - REGISTER_CURL_CONSTANT(CURLOPT_POSTQUOTE); - REGISTER_CURL_CONSTANT(CURLOPT_INTERFACE); - REGISTER_CURL_CONSTANT(CURLOPT_KRB4LEVEL); - REGISTER_CURL_CONSTANT(CURLOPT_HTTPPROXYTUNNEL); - REGISTER_CURL_CONSTANT(CURLOPT_FILETIME); - REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_READFUNCTION); -#if CURLOPT_PASSWDFUNCTION != 0 - REGISTER_CURL_CONSTANT(CURLOPT_PASSWDFUNCTION); -#endif - REGISTER_CURL_CONSTANT(CURLOPT_HEADERFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_MAXREDIRS); - REGISTER_CURL_CONSTANT(CURLOPT_MAXCONNECTS); - REGISTER_CURL_CONSTANT(CURLOPT_CLOSEPOLICY); - REGISTER_CURL_CONSTANT(CURLOPT_FRESH_CONNECT); - REGISTER_CURL_CONSTANT(CURLOPT_FORBID_REUSE); - REGISTER_CURL_CONSTANT(CURLOPT_RANDOM_FILE); - REGISTER_CURL_CONSTANT(CURLOPT_EGDSOCKET); - REGISTER_CURL_CONSTANT(CURLOPT_CONNECTTIMEOUT); -#if LIBCURL_VERSION_NUM > 0x071002 - REGISTER_CURL_CONSTANT(CURLOPT_CONNECTTIMEOUT_MS); -#endif - REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYPEER); - REGISTER_CURL_CONSTANT(CURLOPT_CAINFO); - REGISTER_CURL_CONSTANT(CURLOPT_CAPATH); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIEJAR); - REGISTER_CURL_CONSTANT(CURLOPT_SSL_CIPHER_LIST); - REGISTER_CURL_CONSTANT(CURLOPT_BINARYTRANSFER); - REGISTER_CURL_CONSTANT(CURLOPT_NOSIGNAL); - REGISTER_CURL_CONSTANT(CURLOPT_PROXYTYPE); - REGISTER_CURL_CONSTANT(CURLOPT_BUFFERSIZE); - REGISTER_CURL_CONSTANT(CURLOPT_HTTPGET); - REGISTER_CURL_CONSTANT(CURLOPT_HTTP_VERSION); - REGISTER_CURL_CONSTANT(CURLOPT_SSLKEY); - REGISTER_CURL_CONSTANT(CURLOPT_SSLKEYTYPE); - REGISTER_CURL_CONSTANT(CURLOPT_SSLKEYPASSWD); - REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE); - REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE_DEFAULT); - REGISTER_CURL_CONSTANT(CURLOPT_SSLCERTTYPE); - REGISTER_CURL_CONSTANT(CURLOPT_CRLF); - REGISTER_CURL_CONSTANT(CURLOPT_ENCODING); - REGISTER_CURL_CONSTANT(CURLOPT_PROXYPORT); - REGISTER_CURL_CONSTANT(CURLOPT_UNRESTRICTED_AUTH); - REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_EPRT); -#if LIBCURL_VERSION_NUM > 0x070b01 /* CURLOPT_TCP_NODELAY is available since curl 7.11.2 */ - REGISTER_CURL_CONSTANT(CURLOPT_TCP_NODELAY); -#endif - REGISTER_CURL_CONSTANT(CURLOPT_HTTP200ALIASES); - REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFMODSINCE); - REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFUNMODSINCE); - REGISTER_CURL_CONSTANT(CURL_TIMECOND_LASTMOD); - -#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */ - REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH); - /* http authentication options */ - REGISTER_CURL_CONSTANT(CURLAUTH_BASIC); - REGISTER_CURL_CONSTANT(CURLAUTH_DIGEST); - REGISTER_CURL_CONSTANT(CURLAUTH_GSSNEGOTIATE); - REGISTER_CURL_CONSTANT(CURLAUTH_NTLM); - REGISTER_CURL_CONSTANT(CURLAUTH_ANY); - REGISTER_CURL_CONSTANT(CURLAUTH_ANYSAFE); -#endif - -#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH & CURLOPT_FTP_CREATE_MISSING_DIRS are available since curl 7.10.7 */ - REGISTER_CURL_CONSTANT(CURLOPT_PROXYAUTH); - REGISTER_CURL_CONSTANT(CURLOPT_FTP_CREATE_MISSING_DIRS); -#endif - - REGISTER_CURL_CONSTANT(CURLOPT_PRIVATE); - - /* Constants effecting the way CURLOPT_CLOSEPOLICY works */ - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_SLOWEST); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_CALLBACK); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_OLDEST); - - /* Info constants */ - REGISTER_CURL_CONSTANT(CURLINFO_EFFECTIVE_URL); - REGISTER_CURL_CONSTANT(CURLINFO_HTTP_CODE); - REGISTER_CURL_CONSTANT(CURLINFO_HEADER_SIZE); - REGISTER_CURL_CONSTANT(CURLINFO_REQUEST_SIZE); - REGISTER_CURL_CONSTANT(CURLINFO_TOTAL_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_NAMELOOKUP_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_CONNECT_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_PRETRANSFER_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_SIZE_UPLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_SIZE_DOWNLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_SPEED_DOWNLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_SPEED_UPLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_FILETIME); - REGISTER_CURL_CONSTANT(CURLINFO_SSL_VERIFYRESULT); - REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_LENGTH_DOWNLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_LENGTH_UPLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_STARTTRANSFER_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_TYPE); - REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_COUNT); - REGISTER_CURL_CONSTANT(CURLINFO_HEADER_OUT); - REGISTER_CURL_CONSTANT(CURLINFO_PRIVATE); - - /* cURL protocol constants (curl_version) */ - REGISTER_CURL_CONSTANT(CURL_VERSION_IPV6); - REGISTER_CURL_CONSTANT(CURL_VERSION_KERBEROS4); - REGISTER_CURL_CONSTANT(CURL_VERSION_SSL); - REGISTER_CURL_CONSTANT(CURL_VERSION_LIBZ); - - /* version constants */ - REGISTER_CURL_CONSTANT(CURLVERSION_NOW); - - /* Error Constants */ - REGISTER_CURL_CONSTANT(CURLE_OK); - REGISTER_CURL_CONSTANT(CURLE_UNSUPPORTED_PROTOCOL); - REGISTER_CURL_CONSTANT(CURLE_FAILED_INIT); - REGISTER_CURL_CONSTANT(CURLE_URL_MALFORMAT); - REGISTER_CURL_CONSTANT(CURLE_URL_MALFORMAT_USER); - REGISTER_CURL_CONSTANT(CURLE_COULDNT_RESOLVE_PROXY); - REGISTER_CURL_CONSTANT(CURLE_COULDNT_RESOLVE_HOST); - REGISTER_CURL_CONSTANT(CURLE_COULDNT_CONNECT); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_SERVER_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_ACCESS_DENIED); - REGISTER_CURL_CONSTANT(CURLE_FTP_USER_PASSWORD_INCORRECT); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_PASS_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_USER_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_PASV_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_227_FORMAT); - REGISTER_CURL_CONSTANT(CURLE_FTP_CANT_GET_HOST); - REGISTER_CURL_CONSTANT(CURLE_FTP_CANT_RECONNECT); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_SET_BINARY); - REGISTER_CURL_CONSTANT(CURLE_PARTIAL_FILE); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_RETR_FILE); - REGISTER_CURL_CONSTANT(CURLE_FTP_WRITE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_FTP_QUOTE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_HTTP_NOT_FOUND); - REGISTER_CURL_CONSTANT(CURLE_WRITE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_MALFORMAT_USER); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_STOR_FILE); - REGISTER_CURL_CONSTANT(CURLE_READ_ERROR); - REGISTER_CURL_CONSTANT(CURLE_OUT_OF_MEMORY); - REGISTER_CURL_CONSTANT(CURLE_OPERATION_TIMEOUTED); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_SET_ASCII); - REGISTER_CURL_CONSTANT(CURLE_FTP_PORT_FAILED); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_USE_REST); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_GET_SIZE); - REGISTER_CURL_CONSTANT(CURLE_HTTP_RANGE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_HTTP_POST_ERROR); - REGISTER_CURL_CONSTANT(CURLE_SSL_CONNECT_ERROR); - REGISTER_CURL_CONSTANT(CURLE_FTP_BAD_DOWNLOAD_RESUME); - REGISTER_CURL_CONSTANT(CURLE_FILE_COULDNT_READ_FILE); - REGISTER_CURL_CONSTANT(CURLE_LDAP_CANNOT_BIND); - REGISTER_CURL_CONSTANT(CURLE_LDAP_SEARCH_FAILED); - REGISTER_CURL_CONSTANT(CURLE_LIBRARY_NOT_FOUND); - REGISTER_CURL_CONSTANT(CURLE_FUNCTION_NOT_FOUND); - REGISTER_CURL_CONSTANT(CURLE_ABORTED_BY_CALLBACK); - REGISTER_CURL_CONSTANT(CURLE_BAD_FUNCTION_ARGUMENT); - REGISTER_CURL_CONSTANT(CURLE_BAD_CALLING_ORDER); - REGISTER_CURL_CONSTANT(CURLE_HTTP_PORT_FAILED); - REGISTER_CURL_CONSTANT(CURLE_BAD_PASSWORD_ENTERED); - REGISTER_CURL_CONSTANT(CURLE_TOO_MANY_REDIRECTS); - REGISTER_CURL_CONSTANT(CURLE_UNKNOWN_TELNET_OPTION); - REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX); - REGISTER_CURL_CONSTANT(CURLE_OBSOLETE); - REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE); - REGISTER_CURL_CONSTANT(CURLE_GOT_NOTHING); - REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_NOTFOUND); - REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_SETFAILED); - REGISTER_CURL_CONSTANT(CURLE_SEND_ERROR); - REGISTER_CURL_CONSTANT(CURLE_RECV_ERROR); - REGISTER_CURL_CONSTANT(CURLE_SHARE_IN_USE); - REGISTER_CURL_CONSTANT(CURLE_SSL_CERTPROBLEM); - REGISTER_CURL_CONSTANT(CURLE_SSL_CIPHER); - REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT); - REGISTER_CURL_CONSTANT(CURLE_BAD_CONTENT_ENCODING); -#if LIBCURL_VERSION_NUM >= 0x070a08 - REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL); - REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED); -#endif -#if LIBCURL_VERSION_NUM >= 0x070b00 - REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED); -#endif - - REGISTER_CURL_CONSTANT(CURLPROXY_HTTP); - REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5); - - REGISTER_CURL_CONSTANT(CURL_NETRC_OPTIONAL); - REGISTER_CURL_CONSTANT(CURL_NETRC_IGNORED); - REGISTER_CURL_CONSTANT(CURL_NETRC_REQUIRED); - - REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_NONE); - REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_0); - REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_1); - - REGISTER_CURL_CONSTANT(CURLM_CALL_MULTI_PERFORM); - REGISTER_CURL_CONSTANT(CURLM_OK); - REGISTER_CURL_CONSTANT(CURLM_BAD_HANDLE); - REGISTER_CURL_CONSTANT(CURLM_BAD_EASY_HANDLE); - REGISTER_CURL_CONSTANT(CURLM_OUT_OF_MEMORY); - REGISTER_CURL_CONSTANT(CURLM_INTERNAL_ERROR); - - REGISTER_CURL_CONSTANT(CURLMSG_DONE); - -#if LIBCURL_VERSION_NUM >= 0x070c02 - REGISTER_CURL_CONSTANT(CURLOPT_FTPSSLAUTH); - REGISTER_CURL_CONSTANT(CURLFTPAUTH_DEFAULT); - REGISTER_CURL_CONSTANT(CURLFTPAUTH_SSL); - REGISTER_CURL_CONSTANT(CURLFTPAUTH_TLS); -#endif - -#if LIBCURL_VERSION_NUM > 0x070b00 - REGISTER_CURL_CONSTANT(CURLOPT_FTP_SSL); - REGISTER_CURL_CONSTANT(CURLFTPSSL_NONE); - REGISTER_CURL_CONSTANT(CURLFTPSSL_TRY); - REGISTER_CURL_CONSTANT(CURLFTPSSL_CONTROL); - REGISTER_CURL_CONSTANT(CURLFTPSSL_ALL); -#endif - -#ifdef PHP_CURL_NEED_OPENSSL_TSL - if (!CRYPTO_get_id_callback()) { - int i, c = CRYPTO_num_locks(); - - php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T)); - - for (i = 0; i < c; ++i) { - php_curl_openssl_tsl[i] = tsrm_mutex_alloc(); - } - - CRYPTO_set_id_callback(php_curl_ssl_id); - CRYPTO_set_locking_callback(php_curl_ssl_lock); - } -#endif -#ifdef PHP_CURL_NEED_GNUTLS_TSL - gcry_control(GCRYCTL_SET_THREAD_CBS, &php_curl_gnutls_tsl); -#endif - - if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) { - return FAILURE; - } - -#ifdef PHP_CURL_URL_WRAPPERS -# if HAVE_CURL_VERSION_INFO - { - curl_version_info_data *info = curl_version_info(CURLVERSION_NOW); - char **p = (char **)info->protocols; - - while (*p != NULL) { - php_register_url_stream_wrapper(*p++, &php_curl_wrapper TSRMLS_CC); - } - } -# else - php_register_url_stream_wrapper("http", &php_curl_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("https", &php_curl_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("ftp", &php_curl_wrapper TSRMLS_CC); - php_register_url_stream_wrapper("ldap", &php_curl_wrapper TSRMLS_CC); -# endif -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(curl) -{ -#ifdef PHP_CURL_URL_WRAPPERS - php_unregister_url_stream_wrapper("http" TSRMLS_CC); - php_unregister_url_stream_wrapper("https" TSRMLS_CC); - php_unregister_url_stream_wrapper("ftp" TSRMLS_CC); - php_unregister_url_stream_wrapper("ldap" TSRMLS_CC); -#endif - curl_global_cleanup(); -#ifdef PHP_CURL_NEED_OPENSSL_TSL - if (php_curl_openssl_tsl) { - int i, c = CRYPTO_num_locks(); - - CRYPTO_set_id_callback(NULL); - CRYPTO_set_locking_callback(NULL); - - for (i = 0; i < c; ++i) { - tsrm_mutex_free(php_curl_openssl_tsl[i]); - } - - free(php_curl_openssl_tsl); - php_curl_openssl_tsl = NULL; - } -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ curl_write - */ -static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - php_curl_write *t = ch->handlers->write; - size_t length = size * nmemb; - TSRMLS_FETCH_FROM_CTX(ch->thread_ctx); - -#if PHP_CURL_DEBUG - fprintf(stderr, "curl_write() called\n"); - fprintf(stderr, "data = %s, size = %d, nmemb = %d, ctx = %x\n", data, size, nmemb, ctx); -#endif - - switch (t->method) { - case PHP_CURL_STDOUT: - PHPWRITE(data, length); - break; - case PHP_CURL_FILE: - return fwrite(data, size, nmemb, t->fp); - case PHP_CURL_RETURN: - if (length > 0) { - smart_str_appendl(&t->buf, data, (int) length); - } - break; - case PHP_CURL_USER: { - zval **argv[2]; - zval *retval_ptr = NULL; - zval *handle = NULL; - zval *zdata = NULL; - int error; - zend_fcall_info fci; - - MAKE_STD_ZVAL(handle); - ZVAL_RESOURCE(handle, ch->id); - zend_list_addref(ch->id); - argv[0] = &handle; - - MAKE_STD_ZVAL(zdata); - ZVAL_STRINGL(zdata, data, length, 1); - argv[1] = &zdata; - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.object_pp = NULL; - fci.function_name = t->func_name; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 2; - fci.params = argv; - fci.no_separation = 0; - fci.symbol_table = NULL; - - ch->in_callback = 1; - error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC); - ch->in_callback = 0; - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION"); - length = -1; - } else if (retval_ptr) { - if (Z_TYPE_P(retval_ptr) != IS_LONG) { - convert_to_long_ex(&retval_ptr); - } - length = Z_LVAL_P(retval_ptr); - zval_ptr_dtor(&retval_ptr); - } - - zval_ptr_dtor(argv[0]); - zval_ptr_dtor(argv[1]); - break; - } - } - - return length; -} -/* }}} */ - -/* {{{ curl_read - */ -static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - php_curl_read *t = ch->handlers->read; - int length = 0; - - switch (t->method) { - case PHP_CURL_DIRECT: - if (t->fp) { - length = fread(data, size, nmemb, t->fp); - } - break; - case PHP_CURL_USER: { - zval **argv[3]; - zval *handle = NULL; - zval *zfd = NULL; - zval *zlength = NULL; - zval *retval_ptr; - int error; - zend_fcall_info fci; - TSRMLS_FETCH_FROM_CTX(ch->thread_ctx); - - MAKE_STD_ZVAL(handle); - MAKE_STD_ZVAL(zfd); - MAKE_STD_ZVAL(zlength); - - ZVAL_RESOURCE(handle, ch->id); - zend_list_addref(ch->id); - ZVAL_RESOURCE(zfd, t->fd); - zend_list_addref(t->fd); - ZVAL_LONG(zlength, (int) size * nmemb); - - argv[0] = &handle; - argv[1] = &zfd; - argv[2] = &zlength; - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = t->func_name; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 3; - fci.params = argv; - fci.no_separation = 0; - fci.symbol_table = NULL; - - ch->in_callback = 1; - error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC); - ch->in_callback = 0; - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION"); -#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */ - length = CURL_READFUNC_ABORT; -#endif - } else if (retval_ptr) { - if (Z_TYPE_P(retval_ptr) == IS_STRING) { - length = MIN(size * nmemb, Z_STRLEN_P(retval_ptr)); - memcpy(data, Z_STRVAL_P(retval_ptr), length); - } - zval_ptr_dtor(&retval_ptr); - } - - zval_ptr_dtor(argv[0]); - zval_ptr_dtor(argv[1]); - zval_ptr_dtor(argv[2]); - break; - } - } - - return length; -} -/* }}} */ - -/* {{{ curl_write_header - */ -static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - php_curl_write *t = ch->handlers->write_header; - size_t length = size * nmemb; - TSRMLS_FETCH_FROM_CTX(ch->thread_ctx); - - switch (t->method) { - case PHP_CURL_STDOUT: - /* Handle special case write when we're returning the entire transfer - */ - if (ch->handlers->write->method == PHP_CURL_RETURN && length > 0) { - smart_str_appendl(&ch->handlers->write->buf, data, (int) length); - } else { - PHPWRITE(data, length); - } - break; - case PHP_CURL_FILE: - return fwrite(data, size, nmemb, t->fp); - case PHP_CURL_USER: { - zval **argv[2]; - zval *handle = NULL; - zval *zdata = NULL; - zval *retval_ptr; - int error; - zend_fcall_info fci; - - MAKE_STD_ZVAL(handle); - MAKE_STD_ZVAL(zdata); - - ZVAL_RESOURCE(handle, ch->id); - zend_list_addref(ch->id); - ZVAL_STRINGL(zdata, data, length, 1); - - argv[0] = &handle; - argv[1] = &zdata; - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = t->func_name; - fci.symbol_table = NULL; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 2; - fci.params = argv; - fci.no_separation = 0; - - ch->in_callback = 1; - error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC); - ch->in_callback = 0; - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION"); - length = -1; - } else if (retval_ptr) { - if (Z_TYPE_P(retval_ptr) != IS_LONG) { - convert_to_long_ex(&retval_ptr); - } - length = Z_LVAL_P(retval_ptr); - zval_ptr_dtor(&retval_ptr); - } - zval_ptr_dtor(argv[0]); - zval_ptr_dtor(argv[1]); - break; - } - - case PHP_CURL_IGNORE: - return length; - - default: - return -1; - } - - return length; -} -/* }}} */ - -static int curl_debug(CURL *cp, curl_infotype type, char *buf, size_t buf_len, void *ctx) /* {{{ */ -{ - php_curl *ch = (php_curl *) ctx; - - if (type == CURLINFO_HEADER_OUT) { - if (ch->header.str_len) { - efree(ch->header.str); - } - if (buf_len > 0) { - ch->header.str = estrndup(buf, buf_len); - ch->header.str_len = buf_len; - } - } - - return 0; -} -/* }}} */ - -#if CURLOPT_PASSWDFUNCTION != 0 -/* {{{ curl_passwd - */ -static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen) -{ - php_curl *ch = (php_curl *) ctx; - zval *func = ch->handlers->passwd; - zval *argv[3]; - zval *retval = NULL; - int error; - int ret = -1; - TSRMLS_FETCH_FROM_CTX(ch->thread_ctx); - - MAKE_STD_ZVAL(argv[0]); - MAKE_STD_ZVAL(argv[1]); - MAKE_STD_ZVAL(argv[2]); - - ZVAL_RESOURCE(argv[0], ch->id); - zend_list_addref(ch->id); - ZVAL_STRING(argv[1], prompt, 1); - ZVAL_LONG(argv[2], buflen); - - error = call_user_function(EG(function_table), NULL, func, retval, 2, argv TSRMLS_CC); - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_PASSWDFUNCTION"); - } else if (Z_TYPE_P(retval) == IS_STRING) { - if (Z_STRLEN_P(retval) > buflen) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Returned password is too long for libcurl to handle"); - } else { - strlcpy(buf, Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "User handler '%s' did not return a string", Z_STRVAL_P(func)); - } - - zval_ptr_dtor(&argv[0]); - zval_ptr_dtor(&argv[1]); - zval_ptr_dtor(&argv[2]); - zval_ptr_dtor(&retval); - - return ret; -} -/* }}} */ -#endif - -#if LIBCURL_VERSION_NUM < 0x071101 -/* {{{ curl_free_string - */ -static void curl_free_string(void **string) -{ - efree(*string); -} -/* }}} */ -#endif - -/* {{{ curl_free_post - */ -static void curl_free_post(void **post) -{ - curl_formfree((struct HttpPost *) *post); -} -/* }}} */ - -/* {{{ curl_free_slist - */ -static void curl_free_slist(void **slist) -{ - curl_slist_free_all((struct curl_slist *) *slist); -} -/* }}} */ - -/* {{{ proto array curl_version([int version]) - Return cURL version information. */ -PHP_FUNCTION(curl_version) -{ - curl_version_info_data *d; - long uversion = CURLVERSION_NOW; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &uversion) == FAILURE) { - return; - } - - d = curl_version_info(uversion); - if (d == NULL) { - RETURN_FALSE; - } - - array_init(return_value); - - CAAL("version_number", d->version_num); - CAAL("age", d->age); - CAAL("features", d->features); - CAAL("ssl_version_number", d->ssl_version_num); - CAAS("version", d->version); - CAAS("host", d->host); - CAAS("ssl_version", d->ssl_version); - CAAS("libz_version", d->libz_version); - /* Add an array of protocols */ - { - char **p = (char **) d->protocols; - zval *protocol_list = NULL; - - MAKE_STD_ZVAL(protocol_list); - array_init(protocol_list); - - while (*p != NULL) { - add_next_index_string(protocol_list, *p++, 1); - } - CAAZ("protocols", protocol_list); - } -} -/* }}} */ - -/* {{{ alloc_curl_handle - */ -static void alloc_curl_handle(php_curl **ch) -{ - *ch = emalloc(sizeof(php_curl)); - (*ch)->handlers = ecalloc(1, sizeof(php_curl_handlers)); - (*ch)->handlers->write = ecalloc(1, sizeof(php_curl_write)); - (*ch)->handlers->write_header = ecalloc(1, sizeof(php_curl_write)); - (*ch)->handlers->read = ecalloc(1, sizeof(php_curl_read)); - - (*ch)->in_callback = 0; - (*ch)->header.str_len = 0; - - memset(&(*ch)->err, 0, sizeof((*ch)->err)); - -#if LIBCURL_VERSION_NUM < 0x071101 - zend_llist_init(&(*ch)->to_free.str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0); -#endif - zend_llist_init(&(*ch)->to_free.slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0); - zend_llist_init(&(*ch)->to_free.post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0); -} -/* }}} */ - -/* {{{ proto resource curl_init([string url]) - Initialize a cURL session */ -PHP_FUNCTION(curl_init) -{ - zval **url; - php_curl *ch; - CURL *cp; - int argc = ZEND_NUM_ARGS(); - - if (argc < 0 || argc > 1 || zend_get_parameters_ex(argc, &url) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (argc > 0) { - convert_to_string_ex(url); - PHP_CURL_CHECK_OPEN_BASEDIR(Z_STRVAL_PP(url), Z_STRLEN_PP(url), (void) NULL); - } - - cp = curl_easy_init(); - if (!cp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not initialize a new cURL handle"); - RETURN_FALSE; - } - - alloc_curl_handle(&ch); - TSRMLS_SET_CTX(ch->thread_ctx); - - ch->cp = cp; - - ch->handlers->write->method = PHP_CURL_STDOUT; - ch->handlers->write->type = PHP_CURL_ASCII; - ch->handlers->read->method = PHP_CURL_DIRECT; - ch->handlers->write_header->method = PHP_CURL_IGNORE; - - ch->uses = 0; - - curl_easy_setopt(ch->cp, CURLOPT_NOPROGRESS, 1); - curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0); - curl_easy_setopt(ch->cp, CURLOPT_ERRORBUFFER, ch->err.str); - curl_easy_setopt(ch->cp, CURLOPT_WRITEFUNCTION, curl_write); - curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch); - curl_easy_setopt(ch->cp, CURLOPT_READFUNCTION, curl_read); - curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch); - curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_header); - curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch); - curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1); - curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120); - curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */ -#if defined(ZTS) - curl_easy_setopt(ch->cp, CURLOPT_NOSIGNAL, 1); -#endif - - if (argc > 0) { -#if LIBCURL_VERSION_NUM >= 0x071100 - curl_easy_setopt(ch->cp, CURLOPT_URL, Z_STRVAL_PP(url)); -#else - char *urlcopy; - - urlcopy = estrndup(Z_STRVAL_PP(url), Z_STRLEN_PP(url)); - curl_easy_setopt(ch->cp, CURLOPT_URL, urlcopy); - zend_llist_add_element(&ch->to_free.str, &urlcopy); -#endif - } - - ZEND_REGISTER_RESOURCE(return_value, ch, le_curl); - ch->id = Z_LVAL_P(return_value); -} -/* }}} */ - -/* {{{ proto resource curl_copy_handle(resource ch) - Copy a cURL handle along with all of it's preferences */ -PHP_FUNCTION(curl_copy_handle) -{ - zval **zid; - CURL *cp; - php_curl *ch; - php_curl *dupch; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - cp = curl_easy_duphandle(ch->cp); - if (!cp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot duplicate cURL handle"); - RETURN_FALSE; - } - - alloc_curl_handle(&dupch); - TSRMLS_SET_CTX(dupch->thread_ctx); - - dupch->cp = cp; - dupch->handlers->write->method = ch->handlers->write->method; - dupch->handlers->write->type = ch->handlers->write->type; - dupch->handlers->read->method = ch->handlers->read->method; - dupch->handlers->write_header->method = ch->handlers->write_header->method; - - dupch->handlers->write->fp = ch->handlers->write->fp; - dupch->handlers->write_header->fp = ch->handlers->write_header->fp; - dupch->handlers->read->fp = ch->handlers->read->fp; - dupch->handlers->read->fd = ch->handlers->read->fd; -#if CURLOPT_PASSWDDATA != 0 - if (ch->handlers->passwd) { - zval_add_ref(&ch->handlers->passwd); - dupch->handlers->passwd = ch->handlers->passwd; - curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) dupch); - } -#endif - if (ch->handlers->write->func_name) { - zval_add_ref(&ch->handlers->write->func_name); - dupch->handlers->write->func_name = ch->handlers->write->func_name; - } - if (ch->handlers->read->func_name) { - zval_add_ref(&ch->handlers->read->func_name); - dupch->handlers->read->func_name = ch->handlers->read->func_name; - } - if (ch->handlers->write_header->func_name) { - zval_add_ref(&ch->handlers->write_header->func_name); - dupch->handlers->write_header->func_name = ch->handlers->write_header->func_name; - } - - curl_easy_setopt(dupch->cp, CURLOPT_ERRORBUFFER, dupch->err.str); - curl_easy_setopt(dupch->cp, CURLOPT_FILE, (void *) dupch); - curl_easy_setopt(dupch->cp, CURLOPT_INFILE, (void *) dupch); - curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch); - -#if LIBCURL_VERSION_NUM < 0x071101 - zend_llist_copy(&dupch->to_free.str, &ch->to_free.str); - /* Don't try to free copied strings, they're free'd when the original handle is destroyed */ - dupch->to_free.str.dtor = NULL; -#endif - zend_llist_copy(&dupch->to_free.slist, &ch->to_free.slist); - zend_llist_copy(&dupch->to_free.post, &ch->to_free.post); - - ZEND_REGISTER_RESOURCE(return_value, dupch, le_curl); - dupch->id = Z_LVAL_P(return_value); -} -/* }}} */ - -static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *return_value TSRMLS_DC) /* {{{ */ -{ - CURLcode error=CURLE_OK; - - switch (option) { - case CURLOPT_INFILESIZE: - case CURLOPT_VERBOSE: - case CURLOPT_HEADER: - case CURLOPT_NOPROGRESS: - case CURLOPT_NOBODY: - case CURLOPT_FAILONERROR: - case CURLOPT_UPLOAD: - case CURLOPT_POST: - case CURLOPT_FTPLISTONLY: - case CURLOPT_FTPAPPEND: - case CURLOPT_NETRC: - case CURLOPT_PUT: -#if CURLOPT_MUTE != 0 - case CURLOPT_MUTE: -#endif - case CURLOPT_TIMEOUT: -#if LIBCURL_VERSION_NUM > 0x071002 - case CURLOPT_TIMEOUT_MS: -#endif - case CURLOPT_FTP_USE_EPSV: - case CURLOPT_LOW_SPEED_LIMIT: - case CURLOPT_SSLVERSION: - case CURLOPT_LOW_SPEED_TIME: - case CURLOPT_RESUME_FROM: - case CURLOPT_TIMEVALUE: - case CURLOPT_TIMECONDITION: - case CURLOPT_TRANSFERTEXT: - case CURLOPT_HTTPPROXYTUNNEL: - case CURLOPT_FILETIME: - case CURLOPT_MAXREDIRS: - case CURLOPT_MAXCONNECTS: - case CURLOPT_CLOSEPOLICY: - case CURLOPT_FRESH_CONNECT: - case CURLOPT_FORBID_REUSE: - case CURLOPT_CONNECTTIMEOUT: -#if LIBCURL_VERSION_NUM > 0x071002 - case CURLOPT_CONNECTTIMEOUT_MS: -#endif - case CURLOPT_SSL_VERIFYHOST: - case CURLOPT_SSL_VERIFYPEER: - case CURLOPT_DNS_USE_GLOBAL_CACHE: - case CURLOPT_NOSIGNAL: - case CURLOPT_PROXYTYPE: - case CURLOPT_BUFFERSIZE: - case CURLOPT_HTTPGET: - case CURLOPT_HTTP_VERSION: - case CURLOPT_CRLF: - case CURLOPT_DNS_CACHE_TIMEOUT: - case CURLOPT_PROXYPORT: - case CURLOPT_FTP_USE_EPRT: -#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */ - case CURLOPT_HTTPAUTH: -#endif -#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH & CURLOPT_FTP_CREATE_MISSING_DIRS are available since curl 7.10.7 */ - case CURLOPT_PROXYAUTH: - case CURLOPT_FTP_CREATE_MISSING_DIRS: -#endif - -#if LIBCURL_VERSION_NUM >= 0x070c02 - case CURLOPT_FTPSSLAUTH: -#endif -#if LIBCURL_VERSION_NUM > 0x070b00 - case CURLOPT_FTP_SSL: -#endif - case CURLOPT_UNRESTRICTED_AUTH: - case CURLOPT_PORT: - case CURLOPT_AUTOREFERER: - case CURLOPT_COOKIESESSION: -#if LIBCURL_VERSION_NUM > 0x070b01 /* CURLOPT_TCP_NODELAY is available since curl 7.11.2 */ - case CURLOPT_TCP_NODELAY: -#endif - convert_to_long_ex(zvalue); - error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); - break; - case CURLOPT_FOLLOWLOCATION: - convert_to_long_ex(zvalue); - if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) { - if (Z_LVAL_PP(zvalue) != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set"); - RETVAL_FALSE; - return 1; - } - } - error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); - break; - case CURLOPT_PRIVATE: - case CURLOPT_URL: - case CURLOPT_PROXY: - case CURLOPT_USERPWD: - case CURLOPT_PROXYUSERPWD: - case CURLOPT_RANGE: - case CURLOPT_CUSTOMREQUEST: - case CURLOPT_USERAGENT: - case CURLOPT_FTPPORT: - case CURLOPT_COOKIE: - case CURLOPT_REFERER: - case CURLOPT_INTERFACE: - case CURLOPT_KRB4LEVEL: - case CURLOPT_EGDSOCKET: - case CURLOPT_CAINFO: - case CURLOPT_CAPATH: - case CURLOPT_SSL_CIPHER_LIST: - case CURLOPT_SSLKEY: - case CURLOPT_SSLKEYTYPE: - case CURLOPT_SSLKEYPASSWD: - case CURLOPT_SSLENGINE: - case CURLOPT_SSLENGINE_DEFAULT: - case CURLOPT_SSLCERTTYPE: - case CURLOPT_ENCODING: { -#if LIBCURL_VERSION_NUM < 0x071100 - char *copystr = NULL; -#endif - - convert_to_string_ex(zvalue); - - if (option == CURLOPT_URL) { - PHP_CURL_CHECK_OPEN_BASEDIR(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 1); - } - -#if LIBCURL_VERSION_NUM >= 0x071100 - /* Strings passed to libcurl as ’char *’ arguments, are copied by the library... NOTE: before 7.17.0 strings were not copied. */ - error = curl_easy_setopt(ch->cp, option, Z_STRVAL_PP(zvalue)); -#else - copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue)); - error = curl_easy_setopt(ch->cp, option, copystr); - zend_llist_add_element(&ch->to_free.str, ©str); -#endif - - break; - } - case CURLOPT_FILE: - case CURLOPT_INFILE: - case CURLOPT_WRITEHEADER: - case CURLOPT_STDERR: { - FILE *fp = NULL; - int type; - void * what; - - what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream()); - if (!what) { - RETVAL_FALSE; - return 1; - } - - if (FAILURE == php_stream_cast((php_stream *) what, PHP_STREAM_AS_STDIO, (void *) &fp, REPORT_ERRORS)) { - RETVAL_FALSE; - return 1; - } - - if (!fp) { - RETVAL_FALSE; - return 1; - } - - error = CURLE_OK; - switch (option) { - case CURLOPT_FILE: - ch->handlers->write->fp = fp; - ch->handlers->write->method = PHP_CURL_FILE; - break; - case CURLOPT_WRITEHEADER: - ch->handlers->write_header->fp = fp; - ch->handlers->write_header->method = PHP_CURL_FILE; - break; - case CURLOPT_INFILE: - zend_list_addref(Z_LVAL_PP(zvalue)); - ch->handlers->read->fp = fp; - ch->handlers->read->fd = Z_LVAL_PP(zvalue); - break; - default: - error = curl_easy_setopt(ch->cp, option, fp); - break; - } - - break; - } - case CURLOPT_RETURNTRANSFER: - convert_to_long_ex(zvalue); - - if (Z_LVAL_PP(zvalue)) { - ch->handlers->write->method = PHP_CURL_RETURN; - } else { - ch->handlers->write->method = PHP_CURL_STDOUT; - } - break; - case CURLOPT_BINARYTRANSFER: - convert_to_long_ex(zvalue); - - if (Z_LVAL_PP(zvalue)) { - ch->handlers->write->type = PHP_CURL_BINARY; - } else { - ch->handlers->write->type = PHP_CURL_ASCII; - } - break; - case CURLOPT_WRITEFUNCTION: - if (ch->handlers->write->func_name) { - zval_ptr_dtor(&ch->handlers->write->func_name); - ch->handlers->write->fci_cache = empty_fcall_info_cache; - } - zval_add_ref(zvalue); - ch->handlers->write->func_name = *zvalue; - ch->handlers->write->method = PHP_CURL_USER; - break; - case CURLOPT_READFUNCTION: - if (ch->handlers->read->func_name) { - zval_ptr_dtor(&ch->handlers->read->func_name); - ch->handlers->read->fci_cache = empty_fcall_info_cache; - } - zval_add_ref(zvalue); - ch->handlers->read->func_name = *zvalue; - ch->handlers->read->method = PHP_CURL_USER; - break; - case CURLOPT_HEADERFUNCTION: - if (ch->handlers->write_header->func_name) { - zval_ptr_dtor(&ch->handlers->write_header->func_name); - ch->handlers->write_header->fci_cache = empty_fcall_info_cache; - } - zval_add_ref(zvalue); - ch->handlers->write_header->func_name = *zvalue; - ch->handlers->write_header->method = PHP_CURL_USER; - break; -#if CURLOPT_PASSWDFUNCTION != 0 - case CURLOPT_PASSWDFUNCTION: - if (ch->handlers->passwd) { - zval_ptr_dtor(&ch->handlers->passwd); - } - zval_add_ref(zvalue); - ch->handlers->passwd = *zvalue; - error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDFUNCTION, curl_passwd); - error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) ch); - break; -#endif - case CURLOPT_POSTFIELDS: - if (Z_TYPE_PP(zvalue) == IS_ARRAY || Z_TYPE_PP(zvalue) == IS_OBJECT) { - zval **current; - HashTable *postfields; - struct HttpPost *first = NULL; - struct HttpPost *last = NULL; - char *postval; - char *string_key = NULL; - ulong num_key; - uint string_key_len; - - postfields = HASH_OF(*zvalue); - if (! postfields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS"); - RETVAL_FALSE; - return 1; - } - - for (zend_hash_internal_pointer_reset(postfields); - zend_hash_get_current_data(postfields, (void **) ¤t) == SUCCESS; - zend_hash_move_forward(postfields) - ) { - - SEPARATE_ZVAL(current); - convert_to_string_ex(current); - - zend_hash_get_current_key_ex(postfields, &string_key, &string_key_len, &num_key, 0, NULL); - - postval = Z_STRVAL_PP(current); - - /* The arguments after _NAMELENGTH and _CONTENTSLENGTH - * must be explicitly cast to long in curl_formadd - * use since curl needs a long not an int. */ - if (*postval == '@') { - char *type; - ++postval; - - if ((type = php_memnstr(postval, ";type=", sizeof(";type=") - 1, postval + strlen(postval)))) { - *type = '\0'; - } - /* safe_mode / open_basedir check */ - if (php_check_open_basedir(postval TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(postval, "rb+", CHECKUID_CHECK_MODE_PARAM))) { - if (type) { - *type = ';'; - } - RETVAL_FALSE; - return 1; - } - if (type) { - type++; - error = curl_formadd(&first, &last, - CURLFORM_COPYNAME, string_key, - CURLFORM_NAMELENGTH, (long)string_key_len - 1, - CURLFORM_FILE, postval, - CURLFORM_CONTENTTYPE, type, - CURLFORM_END); - *(type - 1) = ';'; - } else { - error = curl_formadd(&first, &last, - CURLFORM_COPYNAME, string_key, - CURLFORM_NAMELENGTH, (long)string_key_len - 1, - CURLFORM_FILE, postval, - CURLFORM_END); - - } - } else { - error = curl_formadd(&first, &last, - CURLFORM_COPYNAME, string_key, - CURLFORM_NAMELENGTH, (long)string_key_len - 1, - CURLFORM_COPYCONTENTS, postval, - CURLFORM_CONTENTSLENGTH, (long)Z_STRLEN_PP(current), - CURLFORM_END); - } - } - - SAVE_CURL_ERROR(ch, error); - if (error != CURLE_OK) { - RETVAL_FALSE - return 1; - } - - zend_llist_add_element(&ch->to_free.post, &first); - error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first); - - } else { -#if LIBCURL_VERSION_NUM >= 0x071101 - /* with curl 7.17.0 and later, we can use COPYPOSTFIELDS, but we have to provide size before */ - error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, Z_STRLEN_PP(zvalue)); - error = curl_easy_setopt(ch->cp, CURLOPT_COPYPOSTFIELDS, Z_STRVAL_PP(zvalue)); -#else - char *post = NULL; - - convert_to_string_ex(zvalue); - post = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue)); - zend_llist_add_element(&ch->to_free.str, &post); - - error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, post); - error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, Z_STRLEN_PP(zvalue)); -#endif - } - break; - case CURLOPT_HTTPHEADER: - case CURLOPT_QUOTE: - case CURLOPT_HTTP200ALIASES: - case CURLOPT_POSTQUOTE: { - zval **current; - HashTable *ph; - struct curl_slist *slist = NULL; - - ph = HASH_OF(*zvalue); - if (!ph) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments"); - RETVAL_FALSE; - return 1; - } - - for (zend_hash_internal_pointer_reset(ph); - zend_hash_get_current_data(ph, (void **) ¤t) == SUCCESS; - zend_hash_move_forward(ph) - ) { - SEPARATE_ZVAL(current); - convert_to_string_ex(current); - - slist = curl_slist_append(slist, Z_STRVAL_PP(current)); - if (!slist) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not build curl_slist"); - RETVAL_FALSE; - return 1; - } - } - zend_llist_add_element(&ch->to_free.slist, &slist); - - error = curl_easy_setopt(ch->cp, option, slist); - - break; - } - /* the following options deal with files, therefor safe_mode & open_basedir checks - * are required. - */ - case CURLOPT_COOKIEJAR: - case CURLOPT_SSLCERT: - case CURLOPT_RANDOM_FILE: - case CURLOPT_COOKIEFILE: { -#if LIBCURL_VERSION_NUM < 0x071100 - char *copystr = NULL; -#endif - - convert_to_string_ex(zvalue); - - if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) { - RETVAL_FALSE; - return 1; - } - -#if LIBCURL_VERSION_NUM >= 0x071100 - error = curl_easy_setopt(ch->cp, option, Z_STRVAL_PP(zvalue)); -#else - copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue)); - - error = curl_easy_setopt(ch->cp, option, copystr); - zend_llist_add_element(&ch->to_free.str, ©str); -#endif - break; - } - case CURLINFO_HEADER_OUT: - convert_to_long_ex(zvalue); - if (Z_LVAL_PP(zvalue) == 1) { - curl_easy_setopt(ch->cp, CURLOPT_DEBUGFUNCTION, curl_debug); - curl_easy_setopt(ch->cp, CURLOPT_DEBUGDATA, (void *)ch); - curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 1); - } else { - curl_easy_setopt(ch->cp, CURLOPT_DEBUGFUNCTION, NULL); - curl_easy_setopt(ch->cp, CURLOPT_DEBUGDATA, NULL); - curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0); - } - break; - } - - SAVE_CURL_ERROR(ch, error); - if (error != CURLE_OK) { - return 1; - } else { - return 0; - } -} -/* }}} */ - -/* {{{ proto bool curl_setopt(resource ch, int option, mixed value) - Set an option for a cURL transfer */ -PHP_FUNCTION(curl_setopt) -{ - zval **zid, **zoption, **zvalue; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &zid, &zoption, &zvalue) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - convert_to_long_ex(zoption); - - if (!_php_curl_setopt(ch, Z_LVAL_PP(zoption), zvalue, return_value TSRMLS_CC)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool curl_setopt_array(resource ch, array options) - Set an array of option for a cURL transfer */ -PHP_FUNCTION(curl_setopt_array) -{ - zval *zid, *arr, **entry; - php_curl *ch; - long option; - HashPosition pos; - char *string_key; - int str_key_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za", &zid, &arr) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **)&entry, &pos) == SUCCESS) { - if (zend_hash_get_current_key_ex(Z_ARRVAL_P(arr), &string_key, &str_key_len, &option, 0, &pos) == HASH_KEY_IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array keys must be CURLOPT constants or equivalent integer values"); - RETURN_FALSE; - } - if (_php_curl_setopt(ch, option, entry, return_value TSRMLS_CC)) { - RETURN_FALSE; - } - zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ _php_curl_cleanup_handle(ch) - Cleanup an execution phase */ -void _php_curl_cleanup_handle(php_curl *ch) -{ - if (ch->handlers->write->buf.len > 0) { - smart_str_free(&ch->handlers->write->buf); - } - if (ch->header.str_len) { - efree(ch->header.str); - ch->header.str_len = 0; - } - - memset(ch->err.str, 0, CURL_ERROR_SIZE + 1); - ch->err.no = 0; -} -/* }}} */ - -/* {{{ proto bool curl_exec(resource ch) - Perform a cURL session */ -PHP_FUNCTION(curl_exec) -{ - zval **zid; - php_curl *ch; - CURLcode error; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - _php_curl_cleanup_handle(ch); - - error = curl_easy_perform(ch->cp); - SAVE_CURL_ERROR(ch, error); - /* CURLE_PARTIAL_FILE is returned by HEAD requests */ - if (error != CURLE_OK && error != CURLE_PARTIAL_FILE) { - if (ch->handlers->write->buf.len > 0) { - smart_str_free(&ch->handlers->write->buf); - } - RETURN_FALSE; - } - - ch->uses++; - - if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) { - --ch->uses; - smart_str_0(&ch->handlers->write->buf); - RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1); - } - --ch->uses; - if (ch->handlers->write->method == PHP_CURL_RETURN) { - RETURN_EMPTY_STRING(); - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto mixed curl_getinfo(resource ch [, int option]) - Get information regarding a specific transfer */ -PHP_FUNCTION(curl_getinfo) -{ - zval **zid, - **zoption; - php_curl *ch; - int option, argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &zid, &zoption) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - if (argc < 2) { - char *s_code; - long l_code; - double d_code; - - array_init(return_value); - - if (curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_URL, &s_code) == CURLE_OK) { - CAAS("url", s_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_TYPE, &s_code) == CURLE_OK) { - if (s_code != NULL) { - CAAS("content_type", s_code); - } else { - zval *retnull; - MAKE_STD_ZVAL(retnull); - ZVAL_NULL(retnull); - CAAZ("content_type", retnull); - } - } - if (curl_easy_getinfo(ch->cp, CURLINFO_HTTP_CODE, &l_code) == CURLE_OK) { - CAAL("http_code", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_HEADER_SIZE, &l_code) == CURLE_OK) { - CAAL("header_size", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_REQUEST_SIZE, &l_code) == CURLE_OK) { - CAAL("request_size", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_FILETIME, &l_code) == CURLE_OK) { - CAAL("filetime", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SSL_VERIFYRESULT, &l_code) == CURLE_OK) { - CAAL("ssl_verify_result", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_COUNT, &l_code) == CURLE_OK) { - CAAL("redirect_count", l_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME, &d_code) == CURLE_OK) { - CAAD("total_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME, &d_code) == CURLE_OK) { - CAAD("namelookup_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME, &d_code) == CURLE_OK) { - CAAD("connect_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME, &d_code) == CURLE_OK) { - CAAD("pretransfer_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_UPLOAD, &d_code) == CURLE_OK) { - CAAD("size_upload", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_DOWNLOAD, &d_code) == CURLE_OK) { - CAAD("size_download", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_DOWNLOAD, &d_code) == CURLE_OK) { - CAAD("speed_download", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_UPLOAD, &d_code) == CURLE_OK) { - CAAD("speed_upload", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d_code) == CURLE_OK) { - CAAD("download_content_length", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_UPLOAD, &d_code) == CURLE_OK) { - CAAD("upload_content_length", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_STARTTRANSFER_TIME, &d_code) == CURLE_OK) { - CAAD("starttransfer_time", d_code); - } - if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_TIME, &d_code) == CURLE_OK) { - CAAD("redirect_time", d_code); - } - if (ch->header.str_len > 0) { - CAAS("request_header", ch->header.str); - } - } else { - option = Z_LVAL_PP(zoption); - switch (option) { - case CURLINFO_PRIVATE: - case CURLINFO_EFFECTIVE_URL: - case CURLINFO_CONTENT_TYPE: { - char *s_code = NULL; - - if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) { - RETURN_STRING(s_code, 1); - } else { - RETURN_FALSE; - } - break; - } - case CURLINFO_HTTP_CODE: - case CURLINFO_HEADER_SIZE: - case CURLINFO_REQUEST_SIZE: - case CURLINFO_FILETIME: - case CURLINFO_SSL_VERIFYRESULT: - case CURLINFO_REDIRECT_COUNT: { - long code = 0; - - if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) { - RETURN_LONG(code); - } else { - RETURN_FALSE; - } - break; - } - case CURLINFO_TOTAL_TIME: - case CURLINFO_NAMELOOKUP_TIME: - case CURLINFO_CONNECT_TIME: - case CURLINFO_PRETRANSFER_TIME: - case CURLINFO_SIZE_UPLOAD: - case CURLINFO_SIZE_DOWNLOAD: - case CURLINFO_SPEED_DOWNLOAD: - case CURLINFO_SPEED_UPLOAD: - case CURLINFO_CONTENT_LENGTH_DOWNLOAD: - case CURLINFO_CONTENT_LENGTH_UPLOAD: - case CURLINFO_STARTTRANSFER_TIME: - case CURLINFO_REDIRECT_TIME: { - double code = 0.0; - - if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) { - RETURN_DOUBLE(code); - } else { - RETURN_FALSE; - } - break; - } - case CURLINFO_HEADER_OUT: - if (ch->header.str_len > 0) { - RETURN_STRINGL(ch->header.str, ch->header.str_len, 1); - } else { - RETURN_FALSE; - } - } - } -} -/* }}} */ - -/* {{{ proto string curl_error(resource ch) - Return a string contain the last error for the current session */ -PHP_FUNCTION(curl_error) -{ - zval **zid; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - ch->err.str[CURL_ERROR_SIZE] = 0; - RETURN_STRING(ch->err.str, 1); -} -/* }}} */ - -/* {{{ proto int curl_errno(resource ch) - Return an integer containing the last error number */ -PHP_FUNCTION(curl_errno) -{ - zval **zid; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - RETURN_LONG(ch->err.no); -} -/* }}} */ - -/* {{{ proto void curl_close(resource ch) - Close a cURL session */ -PHP_FUNCTION(curl_close) -{ - zval **zid; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - if (ch->in_callback) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to close cURL handle from a callback"); - return; - } - - if (ch->uses) { - ch->uses--; - } else { - zend_list_delete(Z_LVAL_PP(zid)); - } -} -/* }}} */ - -/* {{{ _php_curl_close() - List destructor for curl handles */ -static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_curl *ch = (php_curl *) rsrc->ptr; - -#if PHP_CURL_DEBUG - fprintf(stderr, "DTOR CALLED, ch = %x\n", ch); -#endif - - curl_easy_cleanup(ch->cp); -#if LIBCURL_VERSION_NUM < 0x071101 - zend_llist_clean(&ch->to_free.str); -#endif - zend_llist_clean(&ch->to_free.slist); - zend_llist_clean(&ch->to_free.post); - - if (ch->handlers->write->buf.len > 0) { - smart_str_free(&ch->handlers->write->buf); - } - if (ch->handlers->write->func_name) { - zval_ptr_dtor(&ch->handlers->write->func_name); - } - if (ch->handlers->read->func_name) { - zval_ptr_dtor(&ch->handlers->read->func_name); - } - if (ch->handlers->write_header->func_name) { - zval_ptr_dtor(&ch->handlers->write_header->func_name); - } - if (ch->handlers->passwd) { - zval_ptr_dtor(&ch->handlers->passwd); - } - if (ch->header.str_len > 0) { - efree(ch->header.str); - } - - efree(ch->handlers->write); - efree(ch->handlers->write_header); - efree(ch->handlers->read); - efree(ch->handlers); - efree(ch); -} -/* }}} */ - -#endif /* HAVE_CURL */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/curl/multi.c b/ext/curl/multi.c deleted file mode 100644 index a931658cb8298..0000000000000 --- a/ext/curl/multi.c +++ /dev/null @@ -1,344 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_CURL - -#include "php_curl.h" - -#include -#include - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -/* {{{ proto resource curl_multi_init(void) - Returns a new cURL multi handle */ -PHP_FUNCTION(curl_multi_init) -{ - php_curlm *mh; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - mh = ecalloc(1, sizeof(php_curlm)); - mh->multi = curl_multi_init(); - - zend_llist_init(&mh->easyh, sizeof(zval), _php_curl_multi_cleanup_list, 0); - - ZEND_REGISTER_RESOURCE(return_value, mh, le_curl_multi_handle); -} -/* }}} */ - -/* {{{ proto int curl_multi_add_handle(resource mh, resource ch) - Add a normal cURL handle to a cURL multi handle */ -PHP_FUNCTION(curl_multi_add_handle) -{ - zval *z_mh; - zval *z_ch; - php_curlm *mh; - php_curl *ch; - zval tmp_val; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &z_mh, &z_ch) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl); - - _php_curl_cleanup_handle(ch); - ch->uses++; - - /* we want to create a copy of this zval that we store in the multihandle structure element "easyh" */ - tmp_val = *z_ch; - zval_copy_ctor(&tmp_val); - - zend_llist_add_element(&mh->easyh, &tmp_val); - - RETURN_LONG((long) curl_multi_add_handle(mh->multi, ch->cp)); -} -/* }}} */ - -void _php_curl_multi_cleanup_list(void *data) /* {{{ */ -{ - zval *z_ch = (zval *)data; - php_curl *ch; - TSRMLS_FETCH(); - - if (!z_ch) { - return; - } - - ch = (php_curl *) zend_fetch_resource(&z_ch TSRMLS_CC, -1, le_curl_name, NULL, 1, le_curl); - if (!ch) { - return; - } - - if (ch->uses) { - ch->uses--; - } else { - zend_list_delete(Z_LVAL_P(z_ch)); - } -} -/* }}} */ - -/* Used internally as comparison routine passed to zend_list_del_element */ -static int curl_compare_resources( zval *z1, zval **z2 ) /* {{{ */ -{ - return (Z_TYPE_P( z1 ) == Z_TYPE_PP( z2 ) && - Z_TYPE_P( z1 ) == IS_RESOURCE && - Z_LVAL_P( z1 ) == Z_LVAL_PP( z2 ) ); -} -/* }}} */ - -/* {{{ proto int curl_multi_remove_handle(resource mh, resource ch) - Remove a multi handle from a set of cURL handles */ -PHP_FUNCTION(curl_multi_remove_handle) -{ - zval *z_mh; - zval *z_ch; - php_curlm *mh; - php_curl *ch; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &z_mh, &z_ch) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl); - - --ch->uses; - - zend_llist_del_element( &mh->easyh, &z_ch, - (int (*)(void *, void *)) curl_compare_resources ); - - RETURN_LONG((long) curl_multi_remove_handle(mh->multi, ch->cp)); -} -/* }}} */ - -static void _make_timeval_struct(struct timeval *to, double timeout) /* {{{ */ -{ - unsigned long conv; - - conv = (unsigned long) (timeout * 1000000.0); - to->tv_sec = conv / 1000000; - to->tv_usec = conv % 1000000; -} -/* }}} */ - -/* {{{ proto int curl_multi_select(resource mh[, double timeout]) - Get all the sockets associated with the cURL extension, which can then be "selected" */ -PHP_FUNCTION(curl_multi_select) -{ - zval *z_mh; - php_curlm *mh; - fd_set readfds; - fd_set writefds; - fd_set exceptfds; - int maxfd; - double timeout = 1.0; - struct timeval to; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|d", &z_mh, &timeout) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - - _make_timeval_struct(&to, timeout); - - FD_ZERO(&readfds); - FD_ZERO(&writefds); - FD_ZERO(&exceptfds); - - curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd); - RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to)); -} -/* }}} */ - -/* {{{ proto int curl_multi_exec(resource mh, int &still_running) - Run the sub-connections of the current cURL handle */ -PHP_FUNCTION(curl_multi_exec) -{ - zval *z_mh; - zval *z_still_running; - php_curlm *mh; - int still_running; - int result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &z_mh, &z_still_running) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - - convert_to_long_ex(&z_still_running); - still_running = Z_LVAL_P(z_still_running); - result = curl_multi_perform(mh->multi, &still_running); - ZVAL_LONG(z_still_running, still_running); - - RETURN_LONG(result); -} -/* }}} */ - -/* {{{ proto string curl_multi_getcontent(resource ch) - Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set */ -PHP_FUNCTION(curl_multi_getcontent) -{ - zval *z_ch; - php_curl *ch; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ch) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl); - - if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) { - smart_str_0(&ch->handlers->write->buf); - RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1); - } -} -/* }}} */ - -/* {{{ proto array curl_multi_info_read(resource mh [, long msgs_in_queue]) - Get information about the current transfers */ -PHP_FUNCTION(curl_multi_info_read) -{ - zval *z_mh; - php_curlm *mh; - CURLMsg *tmp_msg; - int queued_msgs; - zval *zmsgs_in_queue = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z", &z_mh, &zmsgs_in_queue) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - - tmp_msg = curl_multi_info_read(mh->multi, &queued_msgs); - if (tmp_msg == NULL) { - RETURN_FALSE; - } - if (zmsgs_in_queue) { - zval_dtor(zmsgs_in_queue); - ZVAL_LONG(zmsgs_in_queue, queued_msgs); - } - - array_init(return_value); - add_assoc_long(return_value, "msg", tmp_msg->msg); - add_assoc_long(return_value, "result", tmp_msg->data.result); - - /* find the original easy curl handle */ - { - zend_llist_position pos; - php_curl *ch; - zval *pz_ch; - - /* search the list of easy handles hanging off the multi-handle */ - for(pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch; - pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) { - ZEND_FETCH_RESOURCE(ch, php_curl *, &pz_ch, -1, le_curl_name, le_curl); - if (ch->cp == tmp_msg->easy_handle) { - - /* we are adding a reference to the underlying php_curl - resource, so we need to add one to the resource's refcount - in order to ensure it doesn't get destroyed when the - underlying curl easy handle goes out of scope. - Normally you would call zval_copy_ctor( pz_ch ), or - SEPARATE_ZVAL, but those create new zvals, which is already - being done in add_assoc_resource */ - - zend_list_addref( Z_RESVAL_P( pz_ch ) ); - - /* add_assoc_resource automatically creates a new zval to - wrap the "resource" represented by the current pz_ch */ - - add_assoc_resource(return_value, "handle", Z_RESVAL_P(pz_ch)); - - break; - } - } - } -} -/* }}} */ - -/* {{{ proto void curl_multi_close(resource mh) - Close a set of cURL handles */ -PHP_FUNCTION(curl_multi_close) -{ - zval *z_mh; - php_curlm *mh; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_mh) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle); - - zend_list_delete(Z_LVAL_P(z_mh)); -} -/* }}} */ - -void _php_curl_multi_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ -{ - php_curlm *mh = (php_curlm *) rsrc->ptr; - if (mh) { - curl_multi_cleanup(mh->multi); - zend_llist_clean(&mh->easyh); - efree(mh); - rsrc->ptr = NULL; - } -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/curl/package.xml b/ext/curl/package.xml deleted file mode 100644 index 85cb634c63133..0000000000000 --- a/ext/curl/package.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - curl - Clib PDF functions - - - sterling - Sterling Hughes - sterling@php.net - lead - - - -PHP supports libcurl, a library created by Daniel Stenberg, -that allows you to connect and communicate to many different -types of servers with many different types of protocols. -libcurl currently supports the http, https, ftp, gopher, -telnet, dict, file, and ldap protocols. libcurl also supports -HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this -can also be done with PHP's ftp extension), HTTP form based -upload, proxies, cookies, and user+password authentication. - - PHP - - beta - 5.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - - diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h deleted file mode 100644 index 25ee0801110ab..0000000000000 --- a/ext/curl/php_curl.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - | Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _PHP_CURL_H -#define _PHP_CURL_H - -#include "php.h" -#include "ext/standard/php_smart_str.h" - -#ifdef COMPILE_DL_CURL -#undef HAVE_CURL -#define HAVE_CURL 1 -#endif - -#if HAVE_CURL - -#define PHP_CURL_DEBUG 0 - -#include -#include - -extern zend_module_entry curl_module_entry; -#define curl_module_ptr &curl_module_entry - -#define CURLOPT_RETURNTRANSFER 19913 -#define CURLOPT_BINARYTRANSFER 19914 -#define PHP_CURL_STDOUT 0 -#define PHP_CURL_FILE 1 -#define PHP_CURL_USER 2 -#define PHP_CURL_DIRECT 3 -#define PHP_CURL_RETURN 4 -#define PHP_CURL_ASCII 5 -#define PHP_CURL_BINARY 6 -#define PHP_CURL_IGNORE 7 - -extern int le_curl; -#define le_curl_name "cURL handle" -extern int le_curl_multi_handle; -#define le_curl_multi_handle_name "cURL Multi Handle" - -PHP_MINIT_FUNCTION(curl); -PHP_MSHUTDOWN_FUNCTION(curl); -PHP_MINFO_FUNCTION(curl); -PHP_FUNCTION(curl_version); -PHP_FUNCTION(curl_init); -PHP_FUNCTION(curl_copy_handle); -PHP_FUNCTION(curl_setopt); -PHP_FUNCTION(curl_setopt_array); -PHP_FUNCTION(curl_exec); -PHP_FUNCTION(curl_getinfo); -PHP_FUNCTION(curl_error); -PHP_FUNCTION(curl_errno); -PHP_FUNCTION(curl_close); -PHP_FUNCTION(curl_multi_init); -PHP_FUNCTION(curl_multi_add_handle); -PHP_FUNCTION(curl_multi_remove_handle); -PHP_FUNCTION(curl_multi_select); -PHP_FUNCTION(curl_multi_exec); -PHP_FUNCTION(curl_multi_getcontent); -PHP_FUNCTION(curl_multi_info_read); -PHP_FUNCTION(curl_multi_close); -void _php_curl_multi_close(zend_rsrc_list_entry * TSRMLS_DC); - -typedef struct { - zval *func_name; - zend_fcall_info_cache fci_cache; - FILE *fp; - smart_str buf; - int method; - int type; -} php_curl_write; - -typedef struct { - zval *func_name; - zend_fcall_info_cache fci_cache; - FILE *fp; - long fd; - int method; -} php_curl_read; - -typedef struct { - php_curl_write *write; - php_curl_write *write_header; - php_curl_read *read; - zval *passwd; -} php_curl_handlers; - -struct _php_curl_error { - char str[CURL_ERROR_SIZE + 1]; - int no; -}; - -struct _php_curl_send_headers { - char *str; - size_t str_len; -}; - -struct _php_curl_free { -#if LIBCURL_VERSION_NUM < 0x071100 - zend_llist str; -#endif - zend_llist post; - zend_llist slist; -}; - -typedef struct { - struct _php_curl_error err; - struct _php_curl_free to_free; - struct _php_curl_send_headers header; - void ***thread_ctx; - CURL *cp; - php_curl_handlers *handlers; - long id; - unsigned int uses; - zend_bool in_callback; -} php_curl; - -typedef struct { - int still_running; - CURLM *multi; - zend_llist easyh; -} php_curlm; - -void _php_curl_cleanup_handle(php_curl *); -void _php_curl_multi_cleanup_list(void *data); - -/* streams support */ - -extern php_stream_ops php_curl_stream_ops; -#define PHP_STREAM_IS_CURL &php_curl_stream_ops - -php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); - -extern php_stream_wrapper php_curl_wrapper; - -struct php_curl_buffer { - off_t readpos, writepos; - php_stream *buf; -}; - -typedef struct { - CURL *curl; - CURLM *multi; - char *url; - struct php_curl_buffer readbuffer; /* holds downloaded data */ - struct php_curl_buffer writebuffer; /* holds data to upload */ - - fd_set readfds, writefds, excfds; - int maxfd; - - char errstr[CURL_ERROR_SIZE + 1]; - CURLMcode mcode; - int pending; - zval *headers; -} php_curl_stream; - - -#else -#define curl_module_ptr NULL -#endif /* HAVE_CURL */ -#define phpext_curl_ptr curl_module_ptr -#endif /* _PHP_CURL_H */ diff --git a/ext/curl/streams.c b/ext/curl/streams.c deleted file mode 100644 index 7b3423e821757..0000000000000 --- a/ext/curl/streams.c +++ /dev/null @@ -1,502 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This file implements cURL based wrappers. - * NOTE: If you are implementing your own streams that are intended to - * work independently of wrappers, this is not a good example to follow! - **/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_memory_streams.h" - -#if HAVE_CURL - -#include -#include - -#ifdef PHP_WIN32 -#include -#include -#endif - -#include -#include - -#define SMART_STR_PREALLOC 4096 - -#include "ext/standard/php_smart_str.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "php_curl.h" - -static size_t on_data_available(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_stream *stream = (php_stream *) ctx; - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - size_t wrote; - TSRMLS_FETCH(); - - /* TODO: I'd like to deprecate this. - * This code is here because until we start getting real data, we don't know - * if we have had all of the headers - * */ - if (curlstream->readbuffer.writepos == 0) { - zval *sym; - - MAKE_STD_ZVAL(sym); - *sym = *curlstream->headers; - zval_copy_ctor(sym); - ZEND_SET_SYMBOL(EG(active_symbol_table), "http_response_header", sym); - } - - php_stream_seek(curlstream->readbuffer.buf, curlstream->readbuffer.writepos, SEEK_SET); - wrote = php_stream_write(curlstream->readbuffer.buf, data, size * nmemb); - curlstream->readbuffer.writepos = php_stream_tell(curlstream->readbuffer.buf); - - return wrote; -} - -/* cURL guarantees that headers are written as complete lines, with this function - * called once for each header */ -static size_t on_header_available(char *data, size_t size, size_t nmemb, void *ctx) -{ - size_t length = size * nmemb; - zval *header; - php_stream *stream = (php_stream *) ctx; - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - TSRMLS_FETCH(); - - if (length < 2) { - /* invalid header ? */ - return length; - } - - if (!(length == 2 && data[0] == '\r' && data[1] == '\n')) { - MAKE_STD_ZVAL(header); - Z_STRLEN_P(header) = length; - Z_STRVAL_P(header) = estrndup(data, length); - if (Z_STRVAL_P(header)[length-1] == '\n') { - Z_STRVAL_P(header)[length-1] = '\0'; - Z_STRLEN_P(header)--; - - if (Z_STRVAL_P(header)[length-2] == '\r') { - Z_STRVAL_P(header)[length-2] = '\0'; - Z_STRLEN_P(header)--; - } - } - Z_TYPE_P(header) = IS_STRING; - zend_hash_next_index_insert(Z_ARRVAL_P(curlstream->headers), &header, sizeof(zval *), NULL); - - /* based on the header, we might need to trigger a notification */ - if (!strncasecmp(data, "Location: ", 10)) { - php_stream_notify_info(stream->context, PHP_STREAM_NOTIFY_REDIRECTED, data + 10, 0); - } else if (!strncasecmp(data, "Content-Type: ", 14)) { - php_stream_notify_info(stream->context, PHP_STREAM_NOTIFY_MIME_TYPE_IS, data + 14, 0); - } else if (!strncasecmp(data, "Context-Length: ", 16)) { - php_stream_notify_file_size(stream->context, atoi(data + 16), data, 0); - php_stream_notify_progress_init(stream->context, 0, 0); - } - } - return length; - -} - -static int on_progress_avail(php_stream *stream, double dltotal, double dlnow, double ultotal, double ulnow) -{ - TSRMLS_FETCH(); - - /* our notification system only works in a single direction; we should detect which - * direction is important and use the correct values in this call */ - php_stream_notify_progress(stream->context, dlnow, dltotal); - return 0; -} - -static size_t php_curl_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - - if (curlstream->writebuffer.buf) { - return php_stream_write(curlstream->writebuffer.buf, buf, count); - } - - return 0; -} - -static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - size_t didread = 0; - - if (curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending) { - /* we need to read some more data */ - struct timeval tv; - - /* fire up the connection */ - if (curlstream->readbuffer.writepos == 0) { - while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(curlstream->multi, &curlstream->pending)); - } - - do { - /* get the descriptors from curl */ - curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd); - - /* if we are in blocking mode, set a timeout */ - tv.tv_usec = 0; - tv.tv_sec = 15; /* TODO: allow this to be configured from the script */ - - /* wait for data */ - switch (select(curlstream->maxfd + 1, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &tv)) { - case -1: - /* error */ - return 0; - case 0: - /* no data yet: timed-out */ - return 0; - default: - /* fetch the data */ - do { - curlstream->mcode = curl_multi_perform(curlstream->multi, &curlstream->pending); - } while (curlstream->mcode == CURLM_CALL_MULTI_PERFORM); - } - } while (curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending > 0); - - } - - /* if there is data in the buffer, try and read it */ - if (curlstream->readbuffer.writepos > 0 && curlstream->readbuffer.readpos < curlstream->readbuffer.writepos) { - php_stream_seek(curlstream->readbuffer.buf, curlstream->readbuffer.readpos, SEEK_SET); - didread = php_stream_read(curlstream->readbuffer.buf, buf, count); - curlstream->readbuffer.readpos = php_stream_tell(curlstream->readbuffer.buf); - } - - if (didread == 0) { - stream->eof = 1; - } - - return didread; -} - -static int php_curl_stream_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - - /* TODO: respect the close_handle flag here, so that casting to a FILE* on - * systems without fopencookie will work properly */ - - curl_multi_remove_handle(curlstream->multi, curlstream->curl); - curl_easy_cleanup(curlstream->curl); - curl_multi_cleanup(curlstream->multi); - - /* we are not closing curlstream->readbuf here, because we export - * it as a zval with the wrapperdata - the engine will garbage collect it */ - - efree(curlstream->url); - efree(curlstream); - - return 0; -} - -static int php_curl_stream_flush(php_stream *stream TSRMLS_DC) -{ -#ifdef ilia_0 - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; -#endif - return 0; -} - -static int php_curl_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - /* TODO: fill in details based on Data: and Content-Length: headers, and/or data - * from curl_easy_getinfo(). - * For now, return -1 to indicate that it doesn't make sense to stat this stream */ - return -1; -} - -static int php_curl_stream_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - php_curl_stream *curlstream = (php_curl_stream *) stream->abstract; - /* delegate to the readbuffer stream */ - return php_stream_cast(curlstream->readbuffer.buf, castas, ret, 0); -} - -php_stream_ops php_curl_stream_ops = { - php_curl_stream_write, - php_curl_stream_read, - php_curl_stream_close, - php_curl_stream_flush, - "cURL", - NULL, /* seek */ - php_curl_stream_cast, /* cast */ - php_curl_stream_stat /* stat */ -}; - - -php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *stream; - php_curl_stream *curlstream; - zval *tmp, **ctx_opt = NULL; - - curlstream = emalloc(sizeof(php_curl_stream)); - memset(curlstream, 0, sizeof(php_curl_stream)); - - stream = php_stream_alloc(&php_curl_stream_ops, curlstream, 0, mode); - php_stream_context_set(stream, context); - - curlstream->curl = curl_easy_init(); - curlstream->multi = curl_multi_init(); - curlstream->pending = 1; - - /* if opening for an include statement, ensure that the local storage will - * have a FILE* associated with it. - * Otherwise, use the "smart" memory stream that will turn itself into a file - * when it gets large */ -#if !HAVE_FOPENCOOKIE - if (options & STREAM_WILL_CAST) { - curlstream->readbuffer.buf = php_stream_fopen_tmpfile(); - } else -#endif - { - curlstream->readbuffer.buf = php_stream_temp_new(); - } - - /* curl requires the URL to be valid throughout it's operation, so dup it */ - curlstream->url = estrdup(filename); - curl_easy_setopt(curlstream->curl, CURLOPT_URL, curlstream->url); - - /* feed curl data into our read buffer */ - curl_easy_setopt(curlstream->curl, CURLOPT_WRITEFUNCTION, on_data_available); - curl_easy_setopt(curlstream->curl, CURLOPT_FILE, stream); - - /* feed headers */ - curl_easy_setopt(curlstream->curl, CURLOPT_HEADERFUNCTION, on_header_available); - curl_easy_setopt(curlstream->curl, CURLOPT_WRITEHEADER, stream); - - curl_easy_setopt(curlstream->curl, CURLOPT_ERRORBUFFER, curlstream->errstr); - curl_easy_setopt(curlstream->curl, CURLOPT_VERBOSE, 0); - - /* enable progress notification */ - curl_easy_setopt(curlstream->curl, CURLOPT_PROGRESSFUNCTION, on_progress_avail); - curl_easy_setopt(curlstream->curl, CURLOPT_PROGRESSDATA, stream); - curl_easy_setopt(curlstream->curl, CURLOPT_NOPROGRESS, 0); - - curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, FG(user_agent) ? FG(user_agent) : "PHP/" PHP_VERSION); - - /* TODO: read cookies and options from context */ - if (context && !strncasecmp(filename, "http", sizeof("http")-1)) { - if (SUCCESS == php_stream_context_get_option(context, "http", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) { - curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 1); - } else { - curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0); - } - if (SUCCESS == php_stream_context_get_option(context, "http", "curl_verify_ssl_peer", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) { - curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 1); - } else { - curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 0); - } - - /* HTTP(S) */ - if (SUCCESS == php_stream_context_get_option(context, "http", "user_agent", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) { - curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, Z_STRVAL_PP(ctx_opt)); - } - if (SUCCESS == php_stream_context_get_option(context, "http", "header", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_ARRAY) { - HashPosition pos; - zval **header = NULL; - struct curl_slist *hl = NULL; - - for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(ctx_opt), &pos); - SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(ctx_opt), (void *)&header, &pos); - zend_hash_move_forward_ex(Z_ARRVAL_PP(ctx_opt), &pos)) { - if (Z_TYPE_PP(header) == IS_STRING) { - hl = curl_slist_append(hl, Z_STRVAL_PP(header)); - } - } - if (hl) { - curl_easy_setopt(curlstream->curl, CURLOPT_HTTPHEADER, hl); - } - } - if (SUCCESS == php_stream_context_get_option(context, "http", "method", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) { - if (strcasecmp(Z_STRVAL_PP(ctx_opt), "get")) { - if (!strcasecmp(Z_STRVAL_PP(ctx_opt), "head")) { - curl_easy_setopt(curlstream->curl, CURLOPT_NOBODY, 1); - } else { - if (!strcasecmp(Z_STRVAL_PP(ctx_opt), "post")) { - curl_easy_setopt(curlstream->curl, CURLOPT_POST, 1); - } else { - curl_easy_setopt(curlstream->curl, CURLOPT_CUSTOMREQUEST, Z_STRVAL_PP(ctx_opt)); - } - if (SUCCESS == php_stream_context_get_option(context, "http", "content", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) { - curl_easy_setopt(curlstream->curl, CURLOPT_POSTFIELDS, Z_STRVAL_PP(ctx_opt)); - curl_easy_setopt(curlstream->curl, CURLOPT_POSTFIELDSIZE, (long)Z_STRLEN_PP(ctx_opt)); - } - } - } - } - if (SUCCESS == php_stream_context_get_option(context, "http", "proxy", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) { - curl_easy_setopt(curlstream->curl, CURLOPT_PROXY, Z_STRVAL_PP(ctx_opt)); - } - if (SUCCESS == php_stream_context_get_option(context, "http", "max_redirects", &ctx_opt)) { - long mr = 20; - if (Z_TYPE_PP(ctx_opt) != IS_STRING || !is_numeric_string(Z_STRVAL_PP(ctx_opt), Z_STRLEN_PP(ctx_opt), &mr, NULL, 1)) { - if (Z_TYPE_PP(ctx_opt) == IS_LONG) { - mr = Z_LVAL_PP(ctx_opt); - } - } - if (mr > 1) { - if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) { - curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 0); - } else { - curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1); - } - curl_easy_setopt(curlstream->curl, CURLOPT_MAXREDIRS, mr); - } - } else { - if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) { - curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 0); - } else { - curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1); - } - curl_easy_setopt(curlstream->curl, CURLOPT_MAXREDIRS, 20L); - } - } else if (context && !strncasecmp(filename, "ftps", sizeof("ftps")-1)) { - if (SUCCESS == php_stream_context_get_option(context, "ftp", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) { - curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 1); - } else { - curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0); - } - if (SUCCESS == php_stream_context_get_option(context, "ftp", "curl_verify_ssl_peer", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) { - curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 1); - } else { - curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 0); - } - } - - /* prepare for "pull" mode */ - curl_multi_add_handle(curlstream->multi, curlstream->curl); - - /* Prepare stuff for file_get_wrapper_data: the data is an array: - * - * data = array( - * "headers" => array("Content-Type: text/html", "Xxx: Yyy"), - * "readbuf" => resource (equivalent to curlstream->readbuffer) - * ); - * */ - MAKE_STD_ZVAL(stream->wrapperdata); - array_init(stream->wrapperdata); - - MAKE_STD_ZVAL(curlstream->headers); - array_init(curlstream->headers); - - add_assoc_zval(stream->wrapperdata, "headers", curlstream->headers); - - MAKE_STD_ZVAL(tmp); - php_stream_to_zval(curlstream->readbuffer.buf, tmp); - add_assoc_zval(stream->wrapperdata, "readbuf", tmp); - -#if !HAVE_FOPENCOOKIE - if (options & STREAM_WILL_CAST) { - /* we will need to download the whole resource now, - * since we cannot get the actual FD for the download, - * so we won't be able to drive curl via stdio. */ - -/* TODO: this needs finishing */ - - curl_easy_perform(curlstream->curl); - } - else -#endif - { - /* fire up the connection; we need to detect a connection error here, - * otherwise the curlstream we return ends up doing nothing useful. */ - CURLMcode m; - CURLMsg *msg; - int msgs_left, msg_found = 0; - - while (CURLM_CALL_MULTI_PERFORM == (m = curl_multi_perform(curlstream->multi, &curlstream->pending))) { - ; /* spin */ - } - - if (m != CURLM_OK) { -#if HAVE_CURL_MULTI_STRERROR - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", curl_multi_strerror(m)); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error mcode=%d", m); -#endif - php_stream_close(stream); - return NULL; - } - - /* we have only one curl handle here, even though we use multi syntax, - * so it's ok to fail on any error */ - while ((msg = curl_multi_info_read(curlstream->multi, &msgs_left))) { - if (msg->data.result == CURLE_OK) { - continue; - } else { -#if HAVE_CURL_EASY_STRERROR - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", curl_easy_strerror(msg->data.result)); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error mcode=%d", msg->data.result); -#endif - msg_found++; - } - } - if (msg_found) { - php_stream_close(stream); - return NULL; - } - } - - return stream; -} - -static php_stream_wrapper_ops php_curl_wrapper_ops = { - php_curl_stream_opener, - NULL, /* stream_close: curl streams know how to clean themselves up */ - NULL, /* stream_stat: curl streams know how to stat themselves */ - NULL, /* stat url */ - NULL, /* opendir */ - "cURL", /* label */ - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -php_stream_wrapper php_curl_wrapper = { - &php_curl_wrapper_ops, - NULL, - 1 /* is_url */ -}; - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/curl/tests/bug45161.phpt b/ext/curl/tests/bug45161.phpt deleted file mode 100644 index eab1fd46e310e..0000000000000 --- a/ext/curl/tests/bug45161.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #45161 (Reusing a curl handle leaks memory) ---FILE-- - ---EXPECT-- -PASS diff --git a/ext/curl/tests/bug46739.phpt b/ext/curl/tests/bug46739.phpt deleted file mode 100644 index 06a84ea8ed8ee..0000000000000 --- a/ext/curl/tests/bug46739.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #46739 (array returned by curl_getinfo should contain content_type key) ---FILE-- - ---EXPECT-- -set diff --git a/ext/date/CREDITS b/ext/date/CREDITS deleted file mode 100644 index bfcacbe989ef2..0000000000000 --- a/ext/date/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Date/Time Support -Derick Rethans diff --git a/ext/date/TODO b/ext/date/TODO deleted file mode 100644 index 4b1237c4a918a..0000000000000 --- a/ext/date/TODO +++ /dev/null @@ -1,6 +0,0 @@ -- Port over my 200 test cases to .phpt format. -- Write an error handler for unexpected characters while parsing dates. -- Cache lookups for timezone information. -- Optimize parsing @ with a negative timestamp. -- Make sure that date_default_timezone_set() validates the passed timezone - identifier. diff --git a/ext/date/config.m4 b/ext/date/config.m4 deleted file mode 100644 index cbd732f4edfbc..0000000000000 --- a/ext/date/config.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl $Id$ -dnl config.m4 for date extension - -sinclude(ext/date/lib/timelib.m4) -sinclude(lib/timelib.m4) - -PHP_DATE_CFLAGS="-I@ext_builddir@/lib" -timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c - lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c" - -PHP_NEW_EXTENSION(date, php_date.c $timelib_sources, no,, $PHP_DATE_CFLAGS) - -PHP_ADD_BUILD_DIR([$ext_builddir/lib], 1) -PHP_ADD_INCLUDE([$ext_builddir/lib]) -PHP_ADD_INCLUDE([$ext_srcdir/lib]) - -PHP_INSTALL_HEADERS([ext/date], [php_date.h lib/timelib.h lib/timelib_structs.h lib/timelib_config.h]) - -cat > $ext_builddir/lib/timelib_config.h < -#endif -EOF diff --git a/ext/date/config.w32 b/ext/date/config.w32 deleted file mode 100755 index 25f5e750cd730..0000000000000 --- a/ext/date/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ -// vim:ft=javascript - -EXTENSION("date", "php_date.c", false, "-Iext/date/lib"); -ADD_SOURCES("ext/date/lib", "astro.c timelib.c dow.c parse_date.c parse_tz.c tm2unixtime.c unixtime2tm.c", "date"); -AC_DEFINE('HAVE_DATE', 1, 'Have date/time support'); - -var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true); -tl_config.WriteLine("#include \"config.w32.h\""); -tl_config.Close(); diff --git a/ext/date/lib/README b/ext/date/lib/README deleted file mode 100644 index 12f09bc5e2828..0000000000000 --- a/ext/date/lib/README +++ /dev/null @@ -1,6 +0,0 @@ -Regenerating Parser -=================== - -Make sure you use re2c 0.9.10 or higher: - -/dat/dev/sf/re2c/re2c -d -b -o ext/date/lib/parse_date.c ext/date/lib/parse_date.re diff --git a/ext/date/lib/astro.c b/ext/date/lib/astro.c deleted file mode 100644 index bedc245200171..0000000000000 --- a/ext/date/lib/astro.c +++ /dev/null @@ -1,303 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Algorithms are taken from a public domain source by Paul | - | Schlyter, who wrote this in December 1992 | - +----------------------------------------------------------------------+ - | Authors: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include -#include "timelib.h" - -#define days_since_2000_Jan_0(y,m,d) \ - (367L*(y)-((7*((y)+(((m)+9)/12)))/4)+((275*(m))/9)+(d)-730530L) - -#ifndef PI - #define PI 3.1415926535897932384 -#endif - -#define RADEG ( 180.0 / PI ) -#define DEGRAD ( PI / 180.0 ) - -/* The trigonometric functions in degrees */ - -#define sind(x) sin((x)*DEGRAD) -#define cosd(x) cos((x)*DEGRAD) -#define tand(x) tan((x)*DEGRAD) - -#define atand(x) (RADEG*atan(x)) -#define asind(x) (RADEG*asin(x)) -#define acosd(x) (RADEG*acos(x)) -#define atan2d(y,x) (RADEG*atan2(y,x)) - - -/* Following are some macros around the "workhorse" function __daylen__ */ -/* They mainly fill in the desired values for the reference altitude */ -/* below the horizon, and also selects whether this altitude should */ -/* refer to the Sun's center or its upper limb. */ - - -#include "astro.h" - -/******************************************************************/ -/* This function reduces any angle to within the first revolution */ -/* by subtracting or adding even multiples of 360.0 until the */ -/* result is >= 0.0 and < 360.0 */ -/******************************************************************/ - -#define INV360 (1.0 / 360.0) - -/*****************************************/ -/* Reduce angle to within 0..360 degrees */ -/*****************************************/ -static double astro_revolution(double x) -{ - return (x - 360.0 * floor(x * INV360)); -} - -/*********************************************/ -/* Reduce angle to within +180..+180 degrees */ -/*********************************************/ -static double astro_rev180( double x ) -{ - return (x - 360.0 * floor(x * INV360 + 0.5)); -} - -/*******************************************************************/ -/* This function computes GMST0, the Greenwich Mean Sidereal Time */ -/* at 0h UT (i.e. the sidereal time at the Greenwhich meridian at */ -/* 0h UT). GMST is then the sidereal time at Greenwich at any */ -/* time of the day. I've generalized GMST0 as well, and define it */ -/* as: GMST0 = GMST - UT -- this allows GMST0 to be computed at */ -/* other times than 0h UT as well. While this sounds somewhat */ -/* contradictory, it is very practical: instead of computing */ -/* GMST like: */ -/* */ -/* GMST = (GMST0) + UT * (366.2422/365.2422) */ -/* */ -/* where (GMST0) is the GMST last time UT was 0 hours, one simply */ -/* computes: */ -/* */ -/* GMST = GMST0 + UT */ -/* */ -/* where GMST0 is the GMST "at 0h UT" but at the current moment! */ -/* Defined in this way, GMST0 will increase with about 4 min a */ -/* day. It also happens that GMST0 (in degrees, 1 hr = 15 degr) */ -/* is equal to the Sun's mean longitude plus/minus 180 degrees! */ -/* (if we neglect aberration, which amounts to 20 seconds of arc */ -/* or 1.33 seconds of time) */ -/* */ -/*******************************************************************/ - -static double astro_GMST0(double d) -{ - double sidtim0; - /* Sidtime at 0h UT = L (Sun's mean longitude) + 180.0 degr */ - /* L = M + w, as defined in sunpos(). Since I'm too lazy to */ - /* add these numbers, I'll let the C compiler do it for me. */ - /* Any decent C compiler will add the constants at compile */ - /* time, imposing no runtime or code overhead. */ - sidtim0 = astro_revolution((180.0 + 356.0470 + 282.9404) + (0.9856002585 + 4.70935E-5) * d); - return sidtim0; -} - -/* This function computes the Sun's position at any instant */ - -/******************************************************/ -/* Computes the Sun's ecliptic longitude and distance */ -/* at an instant given in d, number of days since */ -/* 2000 Jan 0.0. The Sun's ecliptic latitude is not */ -/* computed, since it's always very near 0. */ -/******************************************************/ -static void astro_sunpos(double d, double *lon, double *r) -{ - double M, /* Mean anomaly of the Sun */ - w, /* Mean longitude of perihelion */ - /* Note: Sun's mean longitude = M + w */ - e, /* Eccentricity of Earth's orbit */ - E, /* Eccentric anomaly */ - x, y, /* x, y coordinates in orbit */ - v; /* True anomaly */ - - /* Compute mean elements */ - M = astro_revolution(356.0470 + 0.9856002585 * d); - w = 282.9404 + 4.70935E-5 * d; - e = 0.016709 - 1.151E-9 * d; - - /* Compute true longitude and radius vector */ - E = M + e * RADEG * sind(M) * (1.0 + e * cosd(M)); - x = cosd(E) - e; - y = sqrt(1.0 - e*e) * sind(E); - *r = sqrt(x*x + y*y); /* Solar distance */ - v = atan2d(y, x); /* True anomaly */ - *lon = v + w; /* True solar longitude */ - if (*lon >= 360.0) { - *lon -= 360.0; /* Make it 0..360 degrees */ - } -} - -static void astro_sun_RA_dec(double d, double *RA, double *dec, double *r) -{ - double lon, obl_ecl, x, y, z; - - /* Compute Sun's ecliptical coordinates */ - astro_sunpos(d, &lon, r); - - /* Compute ecliptic rectangular coordinates (z=0) */ - x = *r * cosd(lon); - y = *r * sind(lon); - - /* Compute obliquity of ecliptic (inclination of Earth's axis) */ - obl_ecl = 23.4393 - 3.563E-7 * d; - - /* Convert to equatorial rectangular coordinates - x is unchanged */ - z = y * sind(obl_ecl); - y = y * cosd(obl_ecl); - - /* Convert to spherical coordinates */ - *RA = atan2d(y, x); - *dec = atan2d(z, sqrt(x*x + y*y)); -} - -/** - * Note: timestamp = unixtimestamp (NEEDS to be 00:00:00 UT) - * Eastern longitude positive, Western longitude negative - * Northern latitude positive, Southern latitude negative - * The longitude value IS critical in this function! - * altit = the altitude which the Sun should cross - * Set to -35/60 degrees for rise/set, -6 degrees - * for civil, -12 degrees for nautical and -18 - * degrees for astronomical twilight. - * upper_limb: non-zero -> upper limb, zero -> center - * Set to non-zero (e.g. 1) when computing rise/set - * times, and to zero when computing start/end of - * twilight. - * *rise = where to store the rise time - * *set = where to store the set time - * Both times are relative to the specified altitude, - * and thus this function can be used to compute - * various twilight times, as well as rise/set times - * Return value: 0 = sun rises/sets this day, times stored at - * *trise and *tset. - * +1 = sun above the specified "horizon" 24 hours. - * *trise set to time when the sun is at south, - * minus 12 hours while *tset is set to the south - * time plus 12 hours. "Day" length = 24 hours - * -1 = sun is below the specified "horizon" 24 hours - * "Day" length = 0 hours, *trise and *tset are - * both set to the time when the sun is at south. - * - */ -int timelib_astro_rise_set_altitude(timelib_time *t_loc, double lon, double lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll *ts_rise, timelib_sll *ts_set, timelib_sll *ts_transit) -{ - double d, /* Days since 2000 Jan 0.0 (negative before) */ - sr, /* Solar distance, astronomical units */ - sRA, /* Sun's Right Ascension */ - sdec, /* Sun's declination */ - sradius, /* Sun's apparent radius */ - t, /* Diurnal arc */ - tsouth, /* Time when Sun is at south */ - sidtime; /* Local sidereal time */ - timelib_time *t_utc; - timelib_sll timestamp, old_sse; - - int rc = 0; /* Return cde from function - usually 0 */ - - /* Normalize time */ - old_sse = t_loc->sse; - t_loc->h = 12; - t_loc->i = t_loc->s = 0; - timelib_update_ts(t_loc, NULL); - - /* Calculate TS belonging to UTC 00:00 of the current day */ - t_utc = timelib_time_ctor(); - t_utc->y = t_loc->y; - t_utc->m = t_loc->m; - t_utc->d = t_loc->d; - t_utc->h = t_utc->i = t_utc->s = 0; - timelib_update_ts(t_utc, NULL); - - /* Compute d of 12h local mean solar time */ - timestamp = t_loc->sse; - d = timelib_ts_to_juliandate(timestamp) - lon/360.0; - - /* Compute local sidereal time of this moment */ - sidtime = astro_revolution(astro_GMST0(d) + 180.0 + lon); - - /* Compute Sun's RA + Decl at this moment */ - astro_sun_RA_dec( d, &sRA, &sdec, &sr ); - - /* Compute time when Sun is at south - in hours UT */ - tsouth = 12.0 - astro_rev180(sidtime - sRA) / 15.0; - - /* Compute the Sun's apparent radius, degrees */ - sradius = 0.2666 / sr; - - /* Do correction to upper limb, if necessary */ - if (upper_limb) { - altit -= sradius; - } - - /* Compute the diurnal arc that the Sun traverses to reach */ - /* the specified altitude altit: */ - { - double cost; - cost = (sind(altit) - sind(lat) * sind(sdec)) / (cosd(lat) * cosd(sdec)); - *ts_transit = t_utc->sse + (tsouth * 3600); - if (cost >= 1.0) { - rc = -1; - t = 0.0; /* Sun always below altit */ - - *ts_rise = *ts_set = t_utc->sse + (tsouth * 3600); - } else if (cost <= -1.0) { - rc = +1; - t = 12.0; /* Sun always above altit */ - - *ts_rise = t_loc->sse - (12 * 3600); - *ts_set = t_loc->sse + (12 * 3600); - } else { - t = acosd(cost) / 15.0; /* The diurnal arc, hours */ - - /* Store rise and set times - as Unix Timestamp */ - *ts_rise = ((tsouth - t) * 3600) + t_utc->sse; - *ts_set = ((tsouth + t) * 3600) + t_utc->sse; - - *h_rise = (tsouth - t); - *h_set = (tsouth + t); - } - } - - /* Kill temporary time and restore original sse */ - timelib_time_dtor(t_utc); - t_loc->sse = old_sse; - - return rc; -} - -double timelib_ts_to_juliandate(timelib_sll ts) -{ - double tmp; - - tmp = ts; - tmp /= 86400; - tmp += 2440587.5; - tmp -= 2451543; - - return tmp; -} diff --git a/ext/date/lib/astro.h b/ext/date/lib/astro.h deleted file mode 100644 index 7b85c76b74306..0000000000000 --- a/ext/date/lib/astro.h +++ /dev/null @@ -1,51 +0,0 @@ -/* This macro computes the length of the day, from sunrise to sunset. */ -/* Sunrise/set is considered to occur when the Sun's upper limb is */ -/* 35 arc minutes below the horizon (this accounts for the refraction */ -/* of the Earth's atmosphere). */ -#define day_length(year,month,day,lon,lat) \ - __daylen__( year, month, day, lon, lat, -35.0/60.0, 1 ) - -/* This macro computes the length of the day, including civil twilight. */ -/* Civil twilight starts/ends when the Sun's center is 6 degrees below */ -/* the horizon. */ -#define day_civil_twilight_length(year,month,day,lon,lat) \ - __daylen__( year, month, day, lon, lat, -6.0, 0 ) - -/* This macro computes the length of the day, incl. nautical twilight. */ -/* Nautical twilight starts/ends when the Sun's center is 12 degrees */ -/* below the horizon. */ -#define day_nautical_twilight_length(year,month,day,lon,lat) \ - __daylen__( year, month, day, lon, lat, -12.0, 0 ) - -/* This macro computes the length of the day, incl. astronomical twilight. */ -/* Astronomical twilight starts/ends when the Sun's center is 18 degrees */ -/* below the horizon. */ -#define day_astronomical_twilight_length(year,month,day,lon,lat) \ - __daylen__( year, month, day, lon, lat, -18.0, 0 ) - - -/* This macro computes times for sunrise/sunset. */ -/* Sunrise/set is considered to occur when the Sun's upper limb is */ -/* 35 arc minutes below the horizon (this accounts for the refraction */ -/* of the Earth's atmosphere). */ -#define timelib_astro_sun_rise_set(ts,lon,lat,hrise,hset,rise,set) \ - timelib_astro_rise_set_altitude( ts, lon, lat, -35.0/60.0, 1, hrise, hset, rise, set ) - -/* This macro computes the start and end times of civil twilight. */ -/* Civil twilight starts/ends when the Sun's center is 6 degrees below */ -/* the horizon. */ -#define civil_twilight(ts,lon,lat,start,end) \ - timelib_astro_rise_set_altitude( ts, lon, lat, -6.0, 0, start, end ) - -/* This macro computes the start and end times of nautical twilight. */ -/* Nautical twilight starts/ends when the Sun's center is 12 degrees */ -/* below the horizon. */ -#define nautical_twilight(ts,lon,lat,start,end) \ - timelib_astro_rise_set_altitude( ts, lon, lat, -12.0, 0, start, end ) - -/* This macro computes the start and end times of astronomical twilight. */ -/* Astronomical twilight starts/ends when the Sun's center is 18 degrees */ -/* below the horizon. */ -#define astronomical_twilight(ts,lon,lat,start,end) \ - timelib_astro_rise_set_altitude( ts, lon, lat, -18.0, 0, start, end ) - diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c deleted file mode 100644 index def1b3e59e4ec..0000000000000 --- a/ext/date/lib/dow.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ -static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ - -static timelib_sll century_value(timelib_sll j) -{ - timelib_sll i = j - 17; - timelib_sll c = (4 - i * 2 + (i + 1) / 4) % 7; - - return c < 0 ? c + 7 : c; -} - -static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso) -{ - timelib_sll c1, y1, m1, dow; - - /* Only valid for Gregorian calendar, commented out as we don't handle - * julian calendar. We just return the 'wrong' day of week to be - * consistent. - if (y < 1753) { - return -1; - } */ - c1 = century_value(y / 100); - y1 = (y % 100); - m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m]; - dow = (c1 + y1 + m1 + (y1 / 4) + d) % 7; - if (iso) { - if (dow == 0) { - dow = 7; - } - } - return dow; -} - -timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d) -{ - return timelib_day_of_week_ex(y, m, d, 0); -} - -timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d) -{ - return timelib_day_of_week_ex(y, m, d, 1); -} - - /* jan feb mar apr may jun jul aug sep oct nov dec */ -static int d_table_common[13] = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; -static int d_table_leap[13] = { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }; -static int ml_table_common[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -static int ml_table_leap[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - -timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d) -{ - return (timelib_is_leap(y) ? d_table_leap[m] : d_table_common[m]) + d - 1; -} - -timelib_sll timelib_days_in_month(timelib_sll y, timelib_sll m) -{ - return timelib_is_leap(y) ? ml_table_leap[m] : ml_table_common[m]; -} - -void timelib_isoweek_from_date(timelib_sll y, timelib_sll m, timelib_sll d, timelib_sll *iw, timelib_sll *iy) -{ - int y_leap, prev_y_leap, doy, jan1weekday, weekday; - - y_leap = timelib_is_leap(y); - prev_y_leap = timelib_is_leap(y-1); - doy = timelib_day_of_year(y, m, d) + 1; - if (y_leap && m > 2) { - doy++; - } - jan1weekday = timelib_day_of_week(y, 1, 1); - weekday = timelib_day_of_week(y, m, d); - if (weekday == 0) weekday = 7; - if (jan1weekday == 0) jan1weekday = 7; - /* Find if Y M D falls in YearNumber Y-1, WeekNumber 52 or 53 */ - if (doy <= (8 - jan1weekday) && jan1weekday > 4) { - *iy = y - 1; - if (jan1weekday == 5 || (jan1weekday == 6 && prev_y_leap)) { - *iw = 53; - } else { - *iw = 52; - } - } else { - *iy = y; - } - /* 8. Find if Y M D falls in YearNumber Y+1, WeekNumber 1 */ - if (*iy == y) { - int i; - - i = y_leap ? 366 : 365; - if ((i - (doy - y_leap)) < (4 - weekday)) { - *iy = y + 1; - *iw = 1; - return; - } - } - /* 9. Find if Y M D falls in YearNumber Y, WeekNumber 1 through 53 */ - if (*iy == y) { - int j; - - j = doy + (7 - weekday) + (jan1weekday - 1); - *iw = j / 7; - if (jan1weekday > 4) { - *iw -= 1; - } - } -} - -timelib_sll timelib_daynr_from_weeknr(timelib_sll y, timelib_sll w, timelib_sll d) -{ - timelib_sll dow, day; - - /* Figure out the dayofweek for y-1-1 */ - dow = timelib_day_of_week(y, 1, 1); - /* then use that to figure out the offset for day 1 of week 1 */ - day = 0 - (dow > 4 ? dow - 7 : dow); - - /* Add weeks and days */ - return day + ((w - 1) * 7) + d; -} - -#if 0 -int main(void) -{ - printf("dow = %d\n", timelib_day_of_week(1978, 12, 22)); /* 5 */ - printf("dow = %d\n", timelib_day_of_week(2005, 2, 19)); /* 6 */ -} -#endif diff --git a/ext/date/lib/fallbackmap.h b/ext/date/lib/fallbackmap.h deleted file mode 100644 index 7189eb88e3045..0000000000000 --- a/ext/date/lib/fallbackmap.h +++ /dev/null @@ -1,40 +0,0 @@ - { "sst", 0, -11, "Pacific/Apia" }, - { "hst", 0, -10, "Pacific/Honolulu" }, - { "akst", 0, -9, "America/Anchorage" }, - { "akdt", 1, -8, "America/Anchorage" }, - { "pst", 0, -8, "America/Los_Angeles" }, - { "pdt", 1, -7, "America/Los_Angeles" }, - { "mst", 0, -7, "America/Denver" }, - { "mdt", 1, -6, "America/Denver" }, - { "cst", 0, -6, "America/Chicago" }, - { "cdt", 1, -5, "America/Chicago" }, - { "est", 0, -5, "America/New_York" }, - { "edt", 1, -4, "America/New_York" }, - { "ast", 0, -4, "America/Halifax" }, - { "adt", 1, -3, "America/Halifax" }, - { "brt", 0, -3, "America/Sao_Paulo" }, - { "brst", 1, -2, "America/Sao_Paulo" }, - { "azost", 0, -1, "Atlantic/Azores" }, - { "azodt", 1, 0, "Atlantic/Azores" }, - { "gmt", 0, 0, "Europe/London" }, - { "bst", 1, 1, "Europe/London" }, - { "cet", 0, 1, "Europe/Paris" }, - { "cest", 1, 2, "Europe/Paris" }, - { "eet", 0, 2, "Europe/Helsinki" }, - { "eest", 1, 3, "Europe/Helsinki" }, - { "msk", 0, 3, "Europe/Moscow" }, - { "msd", 1, 4, "Europe/Moscow" }, - { "gst", 0, 4, "Asia/Dubai" }, - { "pkt", 0, 5, "Asia/Karachi" }, - { "ist", 0, 5.5, "Asia/Calcutta" }, - { "npt", 0, 5.75, "Asia/Katmandu" }, - { "yekt", 1, 6, "Asia/Yekaterinburg" }, - { "novst", 1, 7, "Asia/Novosibirsk" }, - { "krat", 0, 7, "Asia/Krasnoyarsk" }, - { "krast", 1, 8, "Asia/Krasnoyarsk" }, - { "jst", 0, 9, "Asia/Tokyo" }, - { "est", 0, 10, "Australia/Melbourne" }, - { "cst", 1, 10.5, "Australia/Adelaide" }, - { "est", 1, 11, "Australia/Melbourne" }, - { "nzst", 0, 12, "Pacific/Auckland" }, - { "nzdt", 1, 13, "Pacific/Auckland" }, diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c deleted file mode 100644 index 5e384458fcf75..0000000000000 --- a/ext/date/lib/parse_date.c +++ /dev/null @@ -1,22559 +0,0 @@ -/* Generated by re2c 0.13.5 on Thu Dec 18 15:52:22 2008 */ -#line 1 "ext/date/lib/parse_date.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -#include -#include - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#else -#include -#endif - -#if defined(_MSC_VER) -# define strtoll(s, f, b) _atoi64(s) -#elif !defined(HAVE_STRTOLL) -# if defined(HAVE_ATOLL) -# define strtoll(s, f, b) atoll(s) -# else -# define strtoll(s, f, b) strtol(s, f, b) -# endif -#endif - -#define TIMELIB_UNSET -99999 - -#define TIMELIB_SECOND 1 -#define TIMELIB_MINUTE 2 -#define TIMELIB_HOUR 3 -#define TIMELIB_DAY 4 -#define TIMELIB_MONTH 5 -#define TIMELIB_YEAR 6 -#define TIMELIB_WEEKDAY 7 -#define TIMELIB_SPECIAL 8 - -#define EOI 257 -#define TIME 258 -#define DATE 259 - -#define TIMELIB_XMLRPC_SOAP 260 -#define TIMELIB_TIME12 261 -#define TIMELIB_TIME24 262 -#define TIMELIB_GNU_NOCOLON 263 -#define TIMELIB_GNU_NOCOLON_TZ 264 -#define TIMELIB_ISO_NOCOLON 265 - -#define TIMELIB_AMERICAN 266 -#define TIMELIB_ISO_DATE 267 -#define TIMELIB_DATE_FULL 268 -#define TIMELIB_DATE_TEXT 269 -#define TIMELIB_DATE_NOCOLON 270 -#define TIMELIB_PG_YEARDAY 271 -#define TIMELIB_PG_TEXT 272 -#define TIMELIB_PG_REVERSE 273 -#define TIMELIB_CLF 274 -#define TIMELIB_DATE_NO_DAY 275 -#define TIMELIB_SHORTDATE_WITH_TIME 276 -#define TIMELIB_DATE_FULL_POINTED 277 -#define TIMELIB_TIME24_WITH_ZONE 278 -#define TIMELIB_ISO_WEEK 279 - -#define TIMELIB_TIMEZONE 300 -#define TIMELIB_AGO 301 - -#define TIMELIB_RELATIVE 310 - -#define TIMELIB_ERROR 999 - -typedef unsigned char uchar; - -#define BSIZE 8192 - -#define YYCTYPE uchar -#define YYCURSOR cursor -#define YYLIMIT s->lim -#define YYMARKER s->ptr -#define YYFILL(n) return EOI; - -#define RET(i) {s->cur = cursor; return i;} - -#define timelib_string_free free - -#define TIMELIB_HAVE_TIME() { if (s->time->have_time) { add_error(s, "Double time specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_time = 1; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } } -#define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } -#define TIMELIB_HAVE_DATE() { if (s->time->have_date) { add_error(s, "Double date specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_date = 1; } } -#define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y = 0; } -#define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 1; } -#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; } -#define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_special_relative = 1; } -#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { add_warning(s, "Double timezone specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_zone = 1; } } - -#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str -#define TIMELIB_DEINIT timelib_string_free(str) -#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; } - -#define TIMELIB_PROCESS_YEAR(x) { \ - if ((x) == TIMELIB_UNSET) { \ - /* (x) = 0; */ \ - } else if ((x) < 100) { \ - if ((x) < 70) { \ - (x) += 2000; \ - } else { \ - (x) += 1900; \ - } \ - } \ -} - -#ifdef DEBUG_PARSER -#define DEBUG_OUTPUT(s) printf("%s\n", s); -#define YYDEBUG(s,c) { if (s != -1) { printf("state: %d ", s); printf("[%c]\n", c); } } -#else -#define DEBUG_OUTPUT(s) -#define YYDEBUG(s,c) -#endif - -#include "timelib_structs.h" - -typedef struct timelib_elems { - unsigned int c; /* Number of elements */ - char **v; /* Values */ -} timelib_elems; - -typedef struct Scanner { - int fd; - uchar *lim, *str, *ptr, *cur, *tok, *pos; - unsigned int line, len; - struct timelib_error_container *errors; - - struct timelib_time *time; - const timelib_tzdb *tzdb; -} Scanner; - -typedef struct _timelib_lookup_table { - const char *name; - int type; - int value; -} timelib_lookup_table; - -typedef struct _timelib_relunit { - const char *name; - int unit; - int multiplier; -} timelib_relunit; - -#define HOUR(a) (int)(a * 60) - -/* The timezone table. */ -const static timelib_tz_lookup_table timelib_timezone_lookup[] = { -#include "timezonemap.h" - { NULL, 0, 0, NULL }, -}; - -const static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = { -#include "fallbackmap.h" - { NULL, 0, 0, NULL }, -}; - -const static timelib_tz_lookup_table timelib_timezone_utc[] = { - { "utc", 0, 0, "UTC" }, -}; - -static timelib_relunit const timelib_relunit_lookup[] = { - { "sec", TIMELIB_SECOND, 1 }, - { "secs", TIMELIB_SECOND, 1 }, - { "second", TIMELIB_SECOND, 1 }, - { "seconds", TIMELIB_SECOND, 1 }, - { "min", TIMELIB_MINUTE, 1 }, - { "mins", TIMELIB_MINUTE, 1 }, - { "minute", TIMELIB_MINUTE, 1 }, - { "minutes", TIMELIB_MINUTE, 1 }, - { "hour", TIMELIB_HOUR, 1 }, - { "hours", TIMELIB_HOUR, 1 }, - { "day", TIMELIB_DAY, 1 }, - { "days", TIMELIB_DAY, 1 }, - { "week", TIMELIB_DAY, 7 }, - { "weeks", TIMELIB_DAY, 7 }, - { "fortnight", TIMELIB_DAY, 14 }, - { "fortnights", TIMELIB_DAY, 14 }, - { "forthnight", TIMELIB_DAY, 14 }, - { "forthnights", TIMELIB_DAY, 14 }, - { "month", TIMELIB_MONTH, 1 }, - { "months", TIMELIB_MONTH, 1 }, - { "year", TIMELIB_YEAR, 1 }, - { "years", TIMELIB_YEAR, 1 }, - - { "monday", TIMELIB_WEEKDAY, 1 }, - { "mon", TIMELIB_WEEKDAY, 1 }, - { "tuesday", TIMELIB_WEEKDAY, 2 }, - { "tue", TIMELIB_WEEKDAY, 2 }, - { "wednesday", TIMELIB_WEEKDAY, 3 }, - { "wed", TIMELIB_WEEKDAY, 3 }, - { "thursday", TIMELIB_WEEKDAY, 4 }, - { "thu", TIMELIB_WEEKDAY, 4 }, - { "friday", TIMELIB_WEEKDAY, 5 }, - { "fri", TIMELIB_WEEKDAY, 5 }, - { "saturday", TIMELIB_WEEKDAY, 6 }, - { "sat", TIMELIB_WEEKDAY, 6 }, - { "sunday", TIMELIB_WEEKDAY, 0 }, - { "sun", TIMELIB_WEEKDAY, 0 }, - - { "weekday", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY }, - { "weekdays", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY }, - { NULL, 0, 0 } -}; - -/* The relative text table. */ -static timelib_lookup_table const timelib_reltext_lookup[] = { - { "first", 0, 1 }, - { "next", 0, 1 }, - { "second", 0, 2 }, - { "third", 0, 3 }, - { "fourth", 0, 4 }, - { "fifth", 0, 5 }, - { "sixth", 0, 6 }, - { "seventh", 0, 7 }, - { "eight", 0, 8 }, - { "ninth", 0, 9 }, - { "tenth", 0, 10 }, - { "eleventh", 0, 11 }, - { "twelfth", 0, 12 }, - { "last", 0, -1 }, - { "previous", 0, -1 }, - { "this", 1, 0 }, - { NULL, 1, 0 } -}; - -/* The month table. */ -static timelib_lookup_table const timelib_month_lookup[] = { - { "jan", 0, 1 }, - { "feb", 0, 2 }, - { "mar", 0, 3 }, - { "apr", 0, 4 }, - { "may", 0, 5 }, - { "jun", 0, 6 }, - { "jul", 0, 7 }, - { "aug", 0, 8 }, - { "sep", 0, 9 }, - { "sept", 0, 9 }, - { "oct", 0, 10 }, - { "nov", 0, 11 }, - { "dec", 0, 12 }, - { "i", 0, 1 }, - { "ii", 0, 2 }, - { "iii", 0, 3 }, - { "iv", 0, 4 }, - { "v", 0, 5 }, - { "vi", 0, 6 }, - { "vii", 0, 7 }, - { "viii", 0, 8 }, - { "ix", 0, 9 }, - { "x", 0, 10 }, - { "xi", 0, 11 }, - { "xii", 0, 12 }, - - { "january", 0, 1 }, - { "february", 0, 2 }, - { "march", 0, 3 }, - { "april", 0, 4 }, - { "may", 0, 5 }, - { "june", 0, 6 }, - { "july", 0, 7 }, - { "august", 0, 8 }, - { "september", 0, 9 }, - { "october", 0, 10 }, - { "november", 0, 11 }, - { "december", 0, 12 }, - { NULL, 0, 0 } -}; - -#if 0 -static char* timelib_ltrim(char *s) -{ - char *ptr = s; - while (ptr[0] == ' ' || ptr[0] == '\t') { - ptr++; - } - return ptr; -} -#endif - -#if 0 -uchar *fill(Scanner *s, uchar *cursor){ - if(!s->eof){ - unsigned int cnt = s->tok - s->bot; - if(cnt){ - memcpy(s->bot, s->tok, s->lim - s->tok); - s->tok = s->bot; - s->ptr -= cnt; - cursor -= cnt; - s->pos -= cnt; - s->lim -= cnt; - } - if((s->top - s->lim) < BSIZE){ - uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); - memcpy(buf, s->tok, s->lim - s->tok); - s->tok = buf; - s->ptr = &buf[s->ptr - s->bot]; - cursor = &buf[cursor - s->bot]; - s->pos = &buf[s->pos - s->bot]; - s->lim = &buf[s->lim - s->bot]; - s->top = &s->lim[BSIZE]; - free(s->bot); - s->bot = buf; - } - if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){ - s->eof = &s->lim[cnt]; *(s->eof)++ = '\n'; - } - s->lim += cnt; - } - return cursor; -} -#endif - -static void add_warning(Scanner *s, char *error) -{ - s->errors->warning_count++; - s->errors->warning_messages = realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message)); - s->errors->warning_messages[s->errors->warning_count - 1].position = s->tok ? s->tok - s->str : 0; - s->errors->warning_messages[s->errors->warning_count - 1].character = s->tok ? *s->tok : 0; - s->errors->warning_messages[s->errors->warning_count - 1].message = strdup(error); -} - -static void add_error(Scanner *s, char *error) -{ - s->errors->error_count++; - s->errors->error_messages = realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message)); - s->errors->error_messages[s->errors->error_count - 1].position = s->tok ? s->tok - s->str : 0; - s->errors->error_messages[s->errors->error_count - 1].character = s->tok ? *s->tok : 0; - s->errors->error_messages[s->errors->error_count - 1].message = strdup(error); -} - -static timelib_sll timelib_meridian(char **ptr, timelib_sll h) -{ - timelib_sll retval = 0; - - while (!strchr("AaPp", **ptr)) { - ++*ptr; - } - if (**ptr == 'a' || **ptr == 'A') { - if (h == 12) { - retval = -12; - } - } else if (h != 12) { - retval = 12; - } - ++*ptr; - if (**ptr == '.') { - *ptr += 3; - } else { - ++*ptr; - } - return retval; -} - -static char *timelib_string(Scanner *s) -{ - char *tmp = calloc(1, s->cur - s->tok + 1); - memcpy(tmp, s->tok, s->cur - s->tok); - - return tmp; -} - -static timelib_sll timelib_get_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - timelib_sll tmp_nr = TIMELIB_UNSET; - int len = 0; - - while ((**ptr < '0') || (**ptr > '9')) { - if (**ptr == '\0') { - return TIMELIB_UNSET; - } - ++*ptr; - } - begin = *ptr; - while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtoll(str, NULL, 10); - free(str); - return tmp_nr; -} - -static void timelib_skip_day_suffix(char **ptr) -{ - if (isspace(**ptr)) { - return; - } - if (!strncasecmp(*ptr, "nd", 2) || !strncasecmp(*ptr, "rd", 2) ||!strncasecmp(*ptr, "st", 2) || !strncasecmp(*ptr, "th", 2)) { - *ptr += 2; - } -} - -static double timelib_get_frac_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - double tmp_nr = TIMELIB_UNSET; - int len = 0; - - while ((**ptr != '.') && ((**ptr < '0') || (**ptr > '9'))) { - if (**ptr == '\0') { - return TIMELIB_UNSET; - } - ++*ptr; - } - begin = *ptr; - while (((**ptr == '.') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtod(str, NULL); - free(str); - return tmp_nr; -} - -static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length) -{ - timelib_ull dir = 1; - - while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) { - if (**ptr == '\0') { - return TIMELIB_UNSET; - } - ++*ptr; - } - - while (**ptr == '+' || **ptr == '-') - { - if (**ptr == '-') { - dir *= -1; - } - ++*ptr; - } - return dir * timelib_get_nr(ptr, max_length); -} - -static long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (**ptr != '\0') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - if (begin[1] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10); - return tmp; - } else if (begin[2] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } else { - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - } - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - -static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior) -{ - char *word; - char *begin = *ptr, *end; - timelib_sll value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_reltext_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - *behavior = tp->type; - } - } - - free(word); - return value; -} - -static timelib_sll timelib_get_relative_text(char **ptr, int *behavior) -{ - while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_relative_text(ptr, behavior); -} - -static long timelib_lookup_month(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_month_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - } - } - - free(word); - return value; -} - -static long timelib_get_month(char **ptr) -{ - while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_month(ptr); -} - -static void timelib_eat_spaces(char **ptr) -{ - while (**ptr == ' ' || **ptr == '\t') { - ++*ptr; - } -} - -static const timelib_relunit* timelib_lookup_relunit(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - const timelib_relunit *tp, *value = NULL; - - while (**ptr != '\0' && **ptr != ' ' && **ptr != '\t') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_relunit_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp; - break; - } - } - - free(word); - return value; -} - -static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s) -{ - const timelib_relunit* relunit; - - if (!(relunit = timelib_lookup_relunit(ptr))) { - return; - } - - switch (relunit->unit) { - case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break; - case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break; - case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break; - case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break; - case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break; - case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break; - - case TIMELIB_WEEKDAY: - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7; - s->time->relative.weekday = relunit->multiplier; - s->time->relative.weekday_behavior = behavior; - break; - - case TIMELIB_SPECIAL: - TIMELIB_HAVE_SPECIAL_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - s->time->special.type = relunit->multiplier; - s->time->special.amount = amount; - } -} - -const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst) -{ - int first_found = 0; - const timelib_tz_lookup_table *tp, *first_found_elem = NULL; - const timelib_tz_lookup_table *fmp; - - if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) { - return timelib_timezone_utc; - } - - for (tp = timelib_timezone_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - if (!first_found) { - first_found = 1; - first_found_elem = tp; - if (gmtoffset == -1) { - return tp; - } - } - if (tp->gmtoffset == gmtoffset) { - return tp; - } - } - } - if (first_found) { - return first_found_elem; - } - - /* Still didn't find anything, let's find the zone solely based on - * offset/isdst then */ - for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) { - if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) { - return fmp; - } - } - return NULL; -} - -static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - const timelib_tz_lookup_table *tp; - - while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - if ((tp = zone_search(word, -1, 0))) { - value = -tp->gmtoffset / 60; - *dst = tp->type; - value += tp->type * 60; - *found = 1; - } else { - *found = 0; - } - - *tz_abbr = word; - return value; -} - -static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb) -{ - timelib_tzinfo *res; - long retval = 0; - - *tz_not_found = 0; - - while (**ptr == ' ' || **ptr == '\t' || **ptr == '(') { - ++*ptr; - } - if (**ptr == '+') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - retval = -1 * timelib_parse_tz_cor(ptr); - } else if (**ptr == '-') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - retval = timelib_parse_tz_cor(ptr); - } else { - int found = 0; - long offset; - char *tz_abbr; - - t->is_localtime = 1; - - offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found); - if (found) { - t->zone_type = TIMELIB_ZONETYPE_ABBR; - } -#if 0 - /* If we found a TimeZone identifier, use it */ - if (tz_name) { - t->tz_info = timelib_parse_tzfile(tz_name); - t->zone_type = TIMELIB_ZONETYPE_ID; - } -#endif - /* If we have a TimeZone identifier to start with, use it */ - if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) { - if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) { - t->tz_info = res; - t->zone_type = TIMELIB_ZONETYPE_ID; - found++; - } - } - if (found && t->zone_type != TIMELIB_ZONETYPE_ID) { - timelib_time_tz_abbr_update(t, tz_abbr); - } - free(tz_abbr); - *tz_not_found = (found == 0); - retval = offset; - } - while (**ptr == ')') { - ++*ptr; - } - return retval; -} - -#define timelib_split_free(arg) { \ - int i; \ - for (i = 0; i < arg.c; i++) { \ - free(arg.v[i]); \ - } \ - if (arg.v) { \ - free(arg.v); \ - } \ -} - -static int scan(Scanner *s) -{ - uchar *cursor = s->cur; - char *str, *ptr = NULL; - -std: - s->tok = cursor; - s->len = 0; -#line 889 "ext/date/lib/parse_date.re" - - - -#line 780 "ext/date/lib/parse_date.c" -{ - YYCTYPE yych; - unsigned int yyaccept = 0; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 104, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 104, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 128, 64, 160, 96, 0, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 16, 16, 16, 80, 16, 16, 16, - 80, 16, 16, 16, 16, 16, 80, 16, - 16, 16, 80, 80, 80, 16, 16, 16, - 16, 16, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - - YYDEBUG(0, *YYCURSOR); - if ((YYLIMIT - YYCURSOR) < 29) YYFILL(29); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case 0x00: - case '\n': goto yy48; - case '\t': - case ' ': goto yy45; - case '(': goto yy42; - case '+': - case '-': goto yy18; - case ',': - case '.': goto yy47; - case '0': goto yy13; - case '1': goto yy14; - case '2': goto yy15; - case '3': goto yy16; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy17; - case '@': goto yy11; - case 'A': goto yy26; - case 'B': - case 'C': - case 'G': - case 'H': - case 'K': - case 'Q': - case 'R': - case 'U': - case 'Z': goto yy43; - case 'D': goto yy32; - case 'E': goto yy36; - case 'F': goto yy24; - case 'I': goto yy19; - case 'J': goto yy22; - case 'L': goto yy38; - case 'M': goto yy7; - case 'N': goto yy5; - case 'O': goto yy30; - case 'P': goto yy40; - case 'S': goto yy28; - case 'T': goto yy9; - case 'V': goto yy20; - case 'W': goto yy34; - case 'X': goto yy21; - case 'Y': goto yy2; - case 'a': goto yy27; - case 'b': - case 'c': - case 'g': - case 'h': - case 'i': - case 'k': - case 'q': - case 'r': - case 'u': - case 'v': - case 'x': - case 'z': goto yy44; - case 'd': goto yy33; - case 'e': goto yy37; - case 'f': goto yy25; - case 'j': goto yy23; - case 'l': goto yy39; - case 'm': goto yy8; - case 'n': goto yy6; - case 'o': goto yy31; - case 'p': goto yy41; - case 's': goto yy29; - case 't': goto yy10; - case 'w': goto yy35; - case 'y': goto yy4; - default: goto yy50; - } -yy2: - YYDEBUG(2, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= 'E') { - if (yych <= ')') { - if (yych >= ')') goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy137; - goto yy1415; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy137; - if (yych >= 'a') goto yy142; - } else { - if (yych <= 'e') goto yy1424; - if (yych <= 'z') goto yy142; - } - } -yy3: - YYDEBUG(3, *YYCURSOR); -#line 1446 "ext/date/lib/parse_date.re" - { - int tz_not_found; - DEBUG_OUTPUT("tzcorrection | tz"); - TIMELIB_INIT; - TIMELIB_HAVE_TZ(); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - TIMELIB_DEINIT; - return TIMELIB_TIMEZONE; - } -#line 933 "ext/date/lib/parse_date.c" -yy4: - YYDEBUG(4, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy137; - goto yy1415; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy137; - } else { - if (yych <= 'e') goto yy1415; - if (yych <= 'z') goto yy137; - goto yy3; - } - } -yy5: - YYDEBUG(5, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= 'D') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy137; - } else { - if (yych <= 'H') { - if (yych <= 'E') goto yy1386; - goto yy137; - } else { - if (yych <= 'I') goto yy1387; - if (yych <= 'N') goto yy137; - goto yy1385; - } - } - } else { - if (yych <= 'h') { - if (yych <= '`') { - if (yych <= 'Z') goto yy137; - goto yy3; - } else { - if (yych == 'e') goto yy1402; - goto yy142; - } - } else { - if (yych <= 'n') { - if (yych <= 'i') goto yy1403; - goto yy142; - } else { - if (yych <= 'o') goto yy1401; - if (yych <= 'z') goto yy142; - goto yy3; - } - } - } -yy6: - YYDEBUG(6, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= 'D') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy137; - } else { - if (yych <= 'H') { - if (yych <= 'E') goto yy1386; - goto yy137; - } else { - if (yych <= 'I') goto yy1387; - if (yych <= 'N') goto yy137; - goto yy1385; - } - } - } else { - if (yych <= 'h') { - if (yych <= '`') { - if (yych <= 'Z') goto yy137; - goto yy3; - } else { - if (yych == 'e') goto yy1386; - goto yy137; - } - } else { - if (yych <= 'n') { - if (yych <= 'i') goto yy1387; - goto yy137; - } else { - if (yych <= 'o') goto yy1385; - if (yych <= 'z') goto yy137; - goto yy3; - } - } - } -yy7: - YYDEBUG(7, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy1355; - } else { - if (yych == 'I') goto yy1356; - if (yych <= 'N') goto yy137; - goto yy1357; - } - } else { - if (yych <= 'h') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy1370; - goto yy142; - } else { - if (yych <= 'n') { - if (yych <= 'i') goto yy1371; - goto yy142; - } else { - if (yych <= 'o') goto yy1372; - if (yych <= 'z') goto yy142; - goto yy3; - } - } - } -yy8: - YYDEBUG(8, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy1355; - } else { - if (yych == 'I') goto yy1356; - if (yych <= 'N') goto yy137; - goto yy1357; - } - } else { - if (yych <= 'h') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy1355; - goto yy137; - } else { - if (yych <= 'n') { - if (yych <= 'i') goto yy1356; - goto yy137; - } else { - if (yych <= 'o') goto yy1357; - if (yych <= 'z') goto yy137; - goto yy3; - } - } - } -yy9: - YYDEBUG(9, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case ')': goto yy136; - case '0': - case '1': goto yy1287; - case '2': goto yy1288; - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1289; - case 'A': - case 'B': - case 'C': - case 'D': - case 'F': - case 'G': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'V': - case 'X': - case 'Y': - case 'Z': goto yy137; - case 'E': goto yy1282; - case 'H': goto yy1283; - case 'O': goto yy1284; - case 'U': goto yy1285; - case 'W': goto yy1286; - case 'a': - case 'b': - case 'c': - case 'd': - case 'f': - case 'g': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'v': - case 'x': - case 'y': - case 'z': goto yy142; - case 'e': goto yy1324; - case 'h': goto yy1325; - case 'o': goto yy1326; - case 'u': goto yy1327; - case 'w': goto yy1328; - default: goto yy3; - } -yy10: - YYDEBUG(10, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case ')': goto yy136; - case '0': - case '1': goto yy1287; - case '2': goto yy1288; - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1289; - case 'A': - case 'B': - case 'C': - case 'D': - case 'F': - case 'G': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'V': - case 'X': - case 'Y': - case 'Z': - case 'a': - case 'b': - case 'c': - case 'd': - case 'f': - case 'g': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'v': - case 'x': - case 'y': - case 'z': goto yy137; - case 'E': - case 'e': goto yy1282; - case 'H': - case 'h': goto yy1283; - case 'O': - case 'o': goto yy1284; - case 'U': - case 'u': goto yy1285; - case 'W': - case 'w': goto yy1286; - default: goto yy3; - } -yy11: - YYDEBUG(11, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '-') goto yy1278; - if (yych <= '/') goto yy12; - if (yych <= '9') goto yy1279; -yy12: - YYDEBUG(12, *YYCURSOR); -#line 1541 "ext/date/lib/parse_date.re" - { - add_error(s, "Unexpected character"); - goto std; - } -#line 1249 "ext/date/lib/parse_date.c" -yy13: - YYDEBUG(13, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': goto yy1232; - case ' ': - case 'A': - case 'D': - case 'F': - case 'H': - case 'I': - case 'J': - case 'M': - case 'N': - case 'O': - case 'S': - case 'T': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'a': - case 'd': - case 'f': - case 'h': - case 'j': - case 'm': - case 'o': - case 'w': - case 'y': goto yy1234; - case '-': goto yy676; - case '.': goto yy1244; - case '/': goto yy675; - case '0': goto yy1277; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1276; - case ':': goto yy1245; - case 'n': goto yy673; - case 'r': goto yy674; - case 's': goto yy667; - case 't': goto yy671; - default: goto yy12; - } -yy14: - YYDEBUG(14, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': goto yy663; - case ' ': - case 'A': - case 'D': - case 'F': - case 'H': - case 'I': - case 'J': - case 'M': - case 'N': - case 'O': - case 'P': - case 'S': - case 'T': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'a': - case 'd': - case 'f': - case 'h': - case 'j': - case 'm': - case 'o': - case 'p': - case 'w': - case 'y': goto yy665; - case '-': goto yy676; - case '.': goto yy677; - case '/': goto yy675; - case '0': - case '1': - case '2': goto yy1276; - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1243; - case ':': goto yy686; - case 'n': goto yy673; - case 'r': goto yy674; - case 's': goto yy667; - case 't': goto yy671; - default: goto yy12; - } -yy15: - YYDEBUG(15, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': goto yy663; - case ' ': - case 'A': - case 'D': - case 'F': - case 'H': - case 'I': - case 'J': - case 'M': - case 'N': - case 'O': - case 'P': - case 'S': - case 'T': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'a': - case 'd': - case 'f': - case 'h': - case 'j': - case 'm': - case 'o': - case 'p': - case 'w': - case 'y': goto yy665; - case '-': goto yy676; - case '.': goto yy677; - case '/': goto yy675; - case '0': - case '1': - case '2': - case '3': goto yy1243; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1230; - case ':': goto yy686; - case 'n': goto yy673; - case 'r': goto yy674; - case 's': goto yy667; - case 't': goto yy671; - default: goto yy12; - } -yy16: - YYDEBUG(16, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': goto yy663; - case ' ': - case 'A': - case 'D': - case 'F': - case 'H': - case 'I': - case 'J': - case 'M': - case 'N': - case 'O': - case 'P': - case 'S': - case 'T': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'a': - case 'd': - case 'f': - case 'h': - case 'j': - case 'm': - case 'o': - case 'p': - case 'w': - case 'y': goto yy665; - case '-': goto yy676; - case '.': goto yy677; - case '/': goto yy675; - case '0': - case '1': goto yy1230; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy672; - case ':': goto yy686; - case 'n': goto yy673; - case 'r': goto yy674; - case 's': goto yy667; - case 't': goto yy671; - default: goto yy12; - } -yy17: - YYDEBUG(17, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': goto yy663; - case ' ': - case 'A': - case 'D': - case 'F': - case 'H': - case 'I': - case 'J': - case 'M': - case 'N': - case 'O': - case 'P': - case 'S': - case 'T': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'a': - case 'd': - case 'f': - case 'h': - case 'j': - case 'm': - case 'o': - case 'p': - case 'w': - case 'y': goto yy665; - case '-': goto yy676; - case '.': goto yy677; - case '/': goto yy675; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy672; - case ':': goto yy686; - case 'n': goto yy673; - case 'r': goto yy674; - case 's': goto yy667; - case 't': goto yy671; - default: goto yy12; - } -yy18: - YYDEBUG(18, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy54; - } - YYDEBUG(-1, yych); - switch (yych) { - case '+': - case '-': goto yy641; - case '0': - case '1': goto yy638; - case '2': goto yy639; - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy640; - default: goto yy12; - } -yy19: - YYDEBUG(19, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy3; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy3; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy3; - } else { - if (yych == '/') goto yy3; - goto yy305; - } - } - } else { - if (yych <= 'V') { - if (yych <= 'H') { - if (yych <= '@') goto yy3; - goto yy137; - } else { - if (yych <= 'I') goto yy637; - if (yych <= 'U') goto yy137; - goto yy636; - } - } else { - if (yych <= 'Z') { - if (yych == 'X') goto yy636; - goto yy137; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy142; - goto yy3; - } - } - } -yy20: - YYDEBUG(20, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy3; - goto yy305; - } else { - if (yych == ')') goto yy136; - if (yych <= ',') goto yy3; - goto yy305; - } - } else { - if (yych <= 'H') { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy305; - if (yych <= '@') goto yy3; - goto yy137; - } else { - if (yych <= 'Z') { - if (yych <= 'I') goto yy633; - goto yy137; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy142; - goto yy3; - } - } - } -yy21: - YYDEBUG(21, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy3; - goto yy305; - } else { - if (yych == ')') goto yy136; - if (yych <= ',') goto yy3; - goto yy305; - } - } else { - if (yych <= 'H') { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy305; - if (yych <= '@') goto yy3; - goto yy137; - } else { - if (yych <= 'Z') { - if (yych <= 'I') goto yy631; - goto yy137; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy142; - goto yy3; - } - } - } -yy22: - YYDEBUG(22, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'A') goto yy614; - if (yych <= 'T') goto yy137; - goto yy613; - } - } else { - if (yych <= 'a') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy623; - } else { - if (yych == 'u') goto yy622; - if (yych <= 'z') goto yy142; - goto yy3; - } - } -yy23: - YYDEBUG(23, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'A') goto yy614; - if (yych <= 'T') goto yy137; - goto yy613; - } - } else { - if (yych <= 'a') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy614; - } else { - if (yych == 'u') goto yy613; - if (yych <= 'z') goto yy137; - goto yy3; - } - } -yy24: - YYDEBUG(24, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy137; - goto yy575; - } - } else { - if (yych <= 'N') { - if (yych == 'I') goto yy576; - goto yy137; - } else { - if (yych <= 'O') goto yy577; - if (yych <= 'Q') goto yy137; - goto yy578; - } - } - } else { - if (yych <= 'i') { - if (yych <= 'd') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy142; - } else { - if (yych <= 'e') goto yy594; - if (yych <= 'h') goto yy142; - goto yy595; - } - } else { - if (yych <= 'q') { - if (yych == 'o') goto yy596; - goto yy142; - } else { - if (yych <= 'r') goto yy597; - if (yych <= 'z') goto yy142; - goto yy3; - } - } - } -yy25: - YYDEBUG(25, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy137; - goto yy575; - } - } else { - if (yych <= 'N') { - if (yych == 'I') goto yy576; - goto yy137; - } else { - if (yych <= 'O') goto yy577; - if (yych <= 'Q') goto yy137; - goto yy578; - } - } - } else { - if (yych <= 'i') { - if (yych <= 'd') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy137; - } else { - if (yych <= 'e') goto yy575; - if (yych <= 'h') goto yy137; - goto yy576; - } - } else { - if (yych <= 'q') { - if (yych == 'o') goto yy577; - goto yy137; - } else { - if (yych <= 'r') goto yy578; - if (yych <= 'z') goto yy137; - goto yy3; - } - } - } -yy26: - YYDEBUG(26, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= 'F') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy137; - } else { - if (yych <= 'O') { - if (yych <= 'G') goto yy554; - goto yy137; - } else { - if (yych <= 'P') goto yy553; - if (yych <= 'T') goto yy137; - goto yy552; - } - } - } else { - if (yych <= 'o') { - if (yych <= '`') { - if (yych <= 'Z') goto yy137; - goto yy3; - } else { - if (yych == 'g') goto yy566; - goto yy142; - } - } else { - if (yych <= 't') { - if (yych <= 'p') goto yy565; - goto yy142; - } else { - if (yych <= 'u') goto yy564; - if (yych <= 'z') goto yy142; - goto yy3; - } - } - } -yy27: - YYDEBUG(27, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= 'F') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy137; - } else { - if (yych <= 'O') { - if (yych <= 'G') goto yy554; - goto yy137; - } else { - if (yych <= 'P') goto yy553; - if (yych <= 'T') goto yy137; - goto yy552; - } - } - } else { - if (yych <= 'o') { - if (yych <= '`') { - if (yych <= 'Z') goto yy137; - goto yy3; - } else { - if (yych == 'g') goto yy554; - goto yy137; - } - } else { - if (yych <= 't') { - if (yych <= 'p') goto yy553; - goto yy137; - } else { - if (yych <= 'u') goto yy552; - if (yych <= 'z') goto yy137; - goto yy3; - } - } - } -yy28: - YYDEBUG(28, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy495; - goto yy137; - } - } else { - if (yych <= 'H') { - if (yych <= 'E') goto yy494; - goto yy137; - } else { - if (yych <= 'I') goto yy496; - if (yych <= 'T') goto yy137; - goto yy497; - } - } - } else { - if (yych <= 'e') { - if (yych <= '`') { - if (yych <= 'Z') goto yy137; - goto yy3; - } else { - if (yych <= 'a') goto yy524; - if (yych <= 'd') goto yy142; - goto yy523; - } - } else { - if (yych <= 't') { - if (yych == 'i') goto yy525; - goto yy142; - } else { - if (yych <= 'u') goto yy526; - if (yych <= 'z') goto yy142; - goto yy3; - } - } - } -yy29: - YYDEBUG(29, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy495; - goto yy137; - } - } else { - if (yych <= 'H') { - if (yych <= 'E') goto yy494; - goto yy137; - } else { - if (yych <= 'I') goto yy496; - if (yych <= 'T') goto yy137; - goto yy497; - } - } - } else { - if (yych <= 'e') { - if (yych <= '`') { - if (yych <= 'Z') goto yy137; - goto yy3; - } else { - if (yych <= 'a') goto yy495; - if (yych <= 'd') goto yy137; - goto yy494; - } - } else { - if (yych <= 't') { - if (yych == 'i') goto yy496; - goto yy137; - } else { - if (yych <= 'u') goto yy497; - if (yych <= 'z') goto yy137; - goto yy3; - } - } - } -yy30: - YYDEBUG(30, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'C') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'B') goto yy137; - goto yy484; - } - } else { - if (yych <= 'b') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy142; - } else { - if (yych <= 'c') goto yy489; - if (yych <= 'z') goto yy142; - goto yy3; - } - } -yy31: - YYDEBUG(31, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'C') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'B') goto yy137; - goto yy484; - } - } else { - if (yych <= 'b') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy137; - } else { - if (yych <= 'c') goto yy484; - if (yych <= 'z') goto yy137; - goto yy3; - } - } -yy32: - YYDEBUG(32, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy137; - goto yy301; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy142; - } else { - if (yych <= 'e') goto yy477; - if (yych <= 'z') goto yy142; - goto yy3; - } - } -yy33: - YYDEBUG(33, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy137; - goto yy301; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy137; - } else { - if (yych <= 'e') goto yy301; - if (yych <= 'z') goto yy137; - goto yy3; - } - } -yy34: - YYDEBUG(34, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy137; - goto yy274; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy142; - } else { - if (yych <= 'e') goto yy288; - if (yych <= 'z') goto yy142; - goto yy3; - } - } -yy35: - YYDEBUG(35, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy137; - goto yy274; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy137; - } else { - if (yych <= 'e') goto yy274; - if (yych <= 'z') goto yy137; - goto yy3; - } - } -yy36: - YYDEBUG(36, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'L') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych == 'I') goto yy254; - if (yych <= 'K') goto yy137; - goto yy255; - } - } else { - if (yych <= 'i') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - if (yych <= 'h') goto yy142; - goto yy264; - } else { - if (yych == 'l') goto yy265; - if (yych <= 'z') goto yy142; - goto yy3; - } - } -yy37: - YYDEBUG(37, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'L') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych == 'I') goto yy254; - if (yych <= 'K') goto yy137; - goto yy255; - } - } else { - if (yych <= 'i') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - if (yych <= 'h') goto yy137; - goto yy254; - } else { - if (yych == 'l') goto yy255; - if (yych <= 'z') goto yy137; - goto yy3; - } - } -yy38: - YYDEBUG(38, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy248; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy137; - goto yy3; - } else { - if (yych <= 'a') goto yy251; - if (yych <= 'z') goto yy142; - goto yy3; - } - } -yy39: - YYDEBUG(39, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy248; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy137; - goto yy3; - } else { - if (yych <= 'a') goto yy248; - if (yych <= 'z') goto yy137; - goto yy3; - } - } -yy40: - YYDEBUG(40, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy137; - goto yy154; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy142; - } else { - if (yych <= 'r') goto yy241; - if (yych <= 'z') goto yy142; - goto yy3; - } - } -yy41: - YYDEBUG(41, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy137; - goto yy154; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - goto yy137; - } else { - if (yych <= 'r') goto yy154; - if (yych <= 'z') goto yy137; - goto yy3; - } - } -yy42: - YYDEBUG(42, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') goto yy12; - if (yych <= 'Z') goto yy153; - if (yych <= '`') goto yy12; - if (yych <= 'z') goto yy153; - goto yy12; -yy43: - YYDEBUG(43, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy142; - goto yy3; - } -yy44: - YYDEBUG(44, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy137; - goto yy3; - } -yy45: - YYDEBUG(45, *YYCURSOR); - yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy54; - } - if (yych <= '/') goto yy46; - if (yych <= '9') goto yy51; -yy46: - YYDEBUG(46, *YYCURSOR); -#line 1530 "ext/date/lib/parse_date.re" - { - goto std; - } -#line 2259 "ext/date/lib/parse_date.c" -yy47: - YYDEBUG(47, *YYCURSOR); - yych = *++YYCURSOR; - goto yy46; -yy48: - YYDEBUG(48, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(49, *YYCURSOR); -#line 1535 "ext/date/lib/parse_date.re" - { - s->pos = cursor; s->line++; - goto std; - } -#line 2273 "ext/date/lib/parse_date.c" -yy50: - YYDEBUG(50, *YYCURSOR); - yych = *++YYCURSOR; - goto yy12; -yy51: - YYDEBUG(51, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11); - yych = *YYCURSOR; - YYDEBUG(52, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy51; - } - if (yych <= 'W') { - if (yych <= 'F') { - if (yych <= ' ') { - if (yych == '\t') goto yy56; - if (yych >= ' ') goto yy56; - } else { - if (yych == 'D') goto yy61; - if (yych >= 'F') goto yy63; - } - } else { - if (yych <= 'M') { - if (yych == 'H') goto yy60; - if (yych >= 'M') goto yy59; - } else { - if (yych <= 'S') { - if (yych >= 'S') goto yy58; - } else { - if (yych <= 'T') goto yy65; - if (yych >= 'W') goto yy62; - } - } - } - } else { - if (yych <= 'l') { - if (yych <= 'd') { - if (yych == 'Y') goto yy64; - if (yych >= 'd') goto yy61; - } else { - if (yych <= 'f') { - if (yych >= 'f') goto yy63; - } else { - if (yych == 'h') goto yy60; - } - } - } else { - if (yych <= 't') { - if (yych <= 'm') goto yy59; - if (yych <= 'r') goto yy53; - if (yych <= 's') goto yy58; - goto yy65; - } else { - if (yych <= 'w') { - if (yych >= 'w') goto yy62; - } else { - if (yych == 'y') goto yy64; - } - } - } - } -yy53: - YYDEBUG(53, *YYCURSOR); - YYCURSOR = YYMARKER; - if (yyaccept <= 15) { - if (yyaccept <= 7) { - if (yyaccept <= 3) { - if (yyaccept <= 1) { - if (yyaccept <= 0) { - goto yy3; - } else { - goto yy12; - } - } else { - if (yyaccept <= 2) { - goto yy46; - } else { - goto yy69; - } - } - } else { - if (yyaccept <= 5) { - if (yyaccept <= 4) { - goto yy174; - } else { - goto yy276; - } - } else { - if (yyaccept <= 6) { - goto yy303; - } else { - goto yy308; - } - } - } - } else { - if (yyaccept <= 11) { - if (yyaccept <= 9) { - if (yyaccept <= 8) { - goto yy332; - } else { - goto yy402; - } - } else { - if (yyaccept <= 10) { - goto yy556; - } else { - goto yy679; - } - } - } else { - if (yyaccept <= 13) { - if (yyaccept <= 12) { - goto yy694; - } else { - goto yy799; - } - } else { - if (yyaccept <= 14) { - goto yy843; - } else { - goto yy853; - } - } - } - } - } else { - if (yyaccept <= 23) { - if (yyaccept <= 19) { - if (yyaccept <= 17) { - if (yyaccept <= 16) { - goto yy947; - } else { - goto yy967; - } - } else { - if (yyaccept <= 18) { - goto yy998; - } else { - goto yy1005; - } - } - } else { - if (yyaccept <= 21) { - if (yyaccept <= 20) { - goto yy1032; - } else { - goto yy977; - } - } else { - if (yyaccept <= 22) { - goto yy658; - } else { - goto yy1157; - } - } - } - } else { - if (yyaccept <= 27) { - if (yyaccept <= 25) { - if (yyaccept <= 24) { - goto yy1026; - } else { - goto yy1248; - } - } else { - if (yyaccept <= 26) { - goto yy1256; - } else { - goto yy1311; - } - } - } else { - if (yyaccept <= 29) { - if (yyaccept <= 28) { - goto yy1314; - } else { - goto yy1392; - } - } else { - if (yyaccept <= 30) { - goto yy1400; - } else { - goto yy1423; - } - } - } - } - } -yy54: - YYDEBUG(54, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(55, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy54; - } - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy51; - goto yy53; -yy56: - YYDEBUG(56, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11); - yych = *YYCURSOR; -yy57: - YYDEBUG(57, *YYCURSOR); - if (yych <= 'W') { - if (yych <= 'F') { - if (yych <= ' ') { - if (yych == '\t') goto yy56; - if (yych <= 0x1F) goto yy53; - goto yy56; - } else { - if (yych == 'D') goto yy61; - if (yych <= 'E') goto yy53; - goto yy63; - } - } else { - if (yych <= 'M') { - if (yych == 'H') goto yy60; - if (yych <= 'L') goto yy53; - goto yy59; - } else { - if (yych <= 'S') { - if (yych <= 'R') goto yy53; - } else { - if (yych <= 'T') goto yy65; - if (yych <= 'V') goto yy53; - goto yy62; - } - } - } - } else { - if (yych <= 'l') { - if (yych <= 'd') { - if (yych == 'Y') goto yy64; - if (yych <= 'c') goto yy53; - goto yy61; - } else { - if (yych <= 'f') { - if (yych <= 'e') goto yy53; - goto yy63; - } else { - if (yych == 'h') goto yy60; - goto yy53; - } - } - } else { - if (yych <= 't') { - if (yych <= 'm') goto yy59; - if (yych <= 'r') goto yy53; - if (yych >= 't') goto yy65; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy53; - goto yy62; - } else { - if (yych == 'y') goto yy64; - goto yy53; - } - } - } - } -yy58: - YYDEBUG(58, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= 'D') { - if (yych == 'A') goto yy123; - goto yy53; - } else { - if (yych <= 'E') goto yy124; - if (yych <= 'T') goto yy53; - goto yy122; - } - } else { - if (yych <= 'd') { - if (yych == 'a') goto yy123; - goto yy53; - } else { - if (yych <= 'e') goto yy124; - if (yych == 'u') goto yy122; - goto yy53; - } - } -yy59: - YYDEBUG(59, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych == 'I') goto yy114; - if (yych <= 'N') goto yy53; - goto yy113; - } else { - if (yych <= 'i') { - if (yych <= 'h') goto yy53; - goto yy114; - } else { - if (yych == 'o') goto yy113; - goto yy53; - } - } -yy60: - YYDEBUG(60, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy111; - if (yych == 'o') goto yy111; - goto yy53; -yy61: - YYDEBUG(61, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy110; - if (yych == 'a') goto yy110; - goto yy53; -yy62: - YYDEBUG(62, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy98; - if (yych == 'e') goto yy98; - goto yy53; -yy63: - YYDEBUG(63, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych == 'O') goto yy83; - if (yych <= 'Q') goto yy53; - goto yy82; - } else { - if (yych <= 'o') { - if (yych <= 'n') goto yy53; - goto yy83; - } else { - if (yych == 'r') goto yy82; - goto yy53; - } - } -yy64: - YYDEBUG(64, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy79; - if (yych == 'e') goto yy79; - goto yy53; -yy65: - YYDEBUG(65, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'H') goto yy66; - if (yych <= 'T') goto yy53; - goto yy67; - } else { - if (yych <= 'h') { - if (yych <= 'g') goto yy53; - } else { - if (yych == 'u') goto yy67; - goto yy53; - } - } -yy66: - YYDEBUG(66, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy74; - if (yych == 'u') goto yy74; - goto yy53; -yy67: - YYDEBUG(67, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy68; - if (yych != 'e') goto yy53; -yy68: - YYDEBUG(68, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'S') goto yy70; - if (yych == 's') goto yy70; -yy69: - YYDEBUG(69, *YYCURSOR); -#line 1514 "ext/date/lib/parse_date.re" - { - timelib_ull i; - DEBUG_OUTPUT("relative"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_unsigned_nr((char **) &ptr, 24); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, 1, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 2667 "ext/date/lib/parse_date.c" -yy70: - YYDEBUG(70, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy71; - if (yych != 'd') goto yy53; -yy71: - YYDEBUG(71, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy72; - if (yych != 'a') goto yy53; -yy72: - YYDEBUG(72, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy73; - if (yych != 'y') goto yy53; -yy73: - YYDEBUG(73, *YYCURSOR); - yych = *++YYCURSOR; - goto yy69; -yy74: - YYDEBUG(74, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'R') goto yy75; - if (yych != 'r') goto yy69; -yy75: - YYDEBUG(75, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy76; - if (yych != 's') goto yy53; -yy76: - YYDEBUG(76, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy77; - if (yych != 'd') goto yy53; -yy77: - YYDEBUG(77, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy78; - if (yych != 'a') goto yy53; -yy78: - YYDEBUG(78, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy73; - if (yych == 'y') goto yy73; - goto yy53; -yy79: - YYDEBUG(79, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy80; - if (yych != 'a') goto yy53; -yy80: - YYDEBUG(80, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy81; - if (yych != 'r') goto yy53; -yy81: - YYDEBUG(81, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy73; - if (yych == 's') goto yy73; - goto yy69; -yy82: - YYDEBUG(82, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy95; - if (yych == 'i') goto yy95; - goto yy53; -yy83: - YYDEBUG(83, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy84; - if (yych != 'r') goto yy53; -yy84: - YYDEBUG(84, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy85; - if (yych != 't') goto yy53; -yy85: - YYDEBUG(85, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych == 'H') goto yy87; - if (yych <= 'M') goto yy53; - } else { - if (yych <= 'h') { - if (yych <= 'g') goto yy53; - goto yy87; - } else { - if (yych != 'n') goto yy53; - } - } - YYDEBUG(86, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy92; - if (yych == 'i') goto yy92; - goto yy53; -yy87: - YYDEBUG(87, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy88; - if (yych != 'n') goto yy53; -yy88: - YYDEBUG(88, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy89; - if (yych != 'i') goto yy53; -yy89: - YYDEBUG(89, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy90; - if (yych != 'g') goto yy53; -yy90: - YYDEBUG(90, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy91; - if (yych != 'h') goto yy53; -yy91: - YYDEBUG(91, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy81; - if (yych == 't') goto yy81; - goto yy53; -yy92: - YYDEBUG(92, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy93; - if (yych != 'g') goto yy53; -yy93: - YYDEBUG(93, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy94; - if (yych != 'h') goto yy53; -yy94: - YYDEBUG(94, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy81; - if (yych == 't') goto yy81; - goto yy53; -yy95: - YYDEBUG(95, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'D') goto yy96; - if (yych != 'd') goto yy69; -yy96: - YYDEBUG(96, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy97; - if (yych != 'a') goto yy53; -yy97: - YYDEBUG(97, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy73; - if (yych == 'y') goto yy73; - goto yy53; -yy98: - YYDEBUG(98, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= 'C') goto yy53; - if (yych <= 'D') goto yy100; - } else { - if (yych <= 'c') goto yy53; - if (yych <= 'd') goto yy100; - if (yych >= 'f') goto yy53; - } - YYDEBUG(99, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'K') goto yy106; - if (yych == 'k') goto yy106; - goto yy53; -yy100: - YYDEBUG(100, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'N') goto yy101; - if (yych != 'n') goto yy69; -yy101: - YYDEBUG(101, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy102; - if (yych != 'e') goto yy53; -yy102: - YYDEBUG(102, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy103; - if (yych != 's') goto yy53; -yy103: - YYDEBUG(103, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy104; - if (yych != 'd') goto yy53; -yy104: - YYDEBUG(104, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy105; - if (yych != 'a') goto yy53; -yy105: - YYDEBUG(105, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy73; - if (yych == 'y') goto yy73; - goto yy53; -yy106: - YYDEBUG(106, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych == 'D') goto yy107; - if (yych <= 'R') goto yy69; - goto yy73; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy69; - } else { - if (yych == 's') goto yy73; - goto yy69; - } - } -yy107: - YYDEBUG(107, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy108; - if (yych != 'a') goto yy53; -yy108: - YYDEBUG(108, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy109; - if (yych != 'y') goto yy53; -yy109: - YYDEBUG(109, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy73; - if (yych == 's') goto yy73; - goto yy69; -yy110: - YYDEBUG(110, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy81; - if (yych == 'y') goto yy81; - goto yy53; -yy111: - YYDEBUG(111, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy112; - if (yych != 'u') goto yy53; -yy112: - YYDEBUG(112, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy81; - if (yych == 'r') goto yy81; - goto yy53; -yy113: - YYDEBUG(113, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy118; - if (yych == 'n') goto yy118; - goto yy53; -yy114: - YYDEBUG(114, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy115; - if (yych != 'n') goto yy53; -yy115: - YYDEBUG(115, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'U') { - if (yych == 'S') goto yy73; - if (yych <= 'T') goto yy69; - } else { - if (yych <= 's') { - if (yych <= 'r') goto yy69; - goto yy73; - } else { - if (yych != 'u') goto yy69; - } - } - YYDEBUG(116, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy117; - if (yych != 't') goto yy53; -yy117: - YYDEBUG(117, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy81; - if (yych == 'e') goto yy81; - goto yy53; -yy118: - YYDEBUG(118, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych == 'D') goto yy119; - if (yych <= 'S') goto yy69; - goto yy120; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy69; - } else { - if (yych == 't') goto yy120; - goto yy69; - } - } -yy119: - YYDEBUG(119, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy121; - if (yych == 'a') goto yy121; - goto yy53; -yy120: - YYDEBUG(120, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy81; - if (yych == 'h') goto yy81; - goto yy53; -yy121: - YYDEBUG(121, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy73; - if (yych == 'y') goto yy73; - goto yy53; -yy122: - YYDEBUG(122, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy133; - if (yych == 'n') goto yy133; - goto yy53; -yy123: - YYDEBUG(123, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy128; - if (yych == 't') goto yy128; - goto yy53; -yy124: - YYDEBUG(124, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy125; - if (yych != 'c') goto yy53; -yy125: - YYDEBUG(125, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych == 'O') goto yy126; - if (yych <= 'R') goto yy69; - goto yy73; - } else { - if (yych <= 'o') { - if (yych <= 'n') goto yy69; - } else { - if (yych == 's') goto yy73; - goto yy69; - } - } -yy126: - YYDEBUG(126, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy127; - if (yych != 'n') goto yy53; -yy127: - YYDEBUG(127, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy81; - if (yych == 'd') goto yy81; - goto yy53; -yy128: - YYDEBUG(128, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'U') goto yy129; - if (yych != 'u') goto yy69; -yy129: - YYDEBUG(129, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy130; - if (yych != 'r') goto yy53; -yy130: - YYDEBUG(130, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy131; - if (yych != 'd') goto yy53; -yy131: - YYDEBUG(131, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy132; - if (yych != 'a') goto yy53; -yy132: - YYDEBUG(132, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy73; - if (yych == 'y') goto yy73; - goto yy53; -yy133: - YYDEBUG(133, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'D') goto yy134; - if (yych != 'd') goto yy69; -yy134: - YYDEBUG(134, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy135; - if (yych != 'a') goto yy53; -yy135: - YYDEBUG(135, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy73; - if (yych == 'y') goto yy73; - goto yy53; -yy136: - YYDEBUG(136, *YYCURSOR); - yych = *++YYCURSOR; - goto yy3; -yy137: - YYDEBUG(137, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - if (yych >= '{') goto yy3; - } -yy138: - YYDEBUG(138, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - if (yych >= '{') goto yy3; - } -yy139: - YYDEBUG(139, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - if (yych >= '{') goto yy3; - } -yy140: - YYDEBUG(140, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - if (yych >= '{') goto yy3; - } -yy141: - YYDEBUG(141, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == ')') goto yy136; - goto yy3; -yy142: - YYDEBUG(142, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych == '/') goto yy144; - goto yy3; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy138; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych >= '{') goto yy3; - } - } -yy143: - YYDEBUG(143, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych != '/') goto yy3; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy139; - if (yych <= '^') goto yy3; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy144: - YYDEBUG(144, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '@') goto yy53; - if (yych >= '[') goto yy53; - YYDEBUG(145, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 16) { - goto yy146; - } - goto yy53; -yy146: - YYDEBUG(146, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(147, *YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy146; - } - if (yych == '/') goto yy144; - if (yych == '_') goto yy144; - goto yy3; -yy148: - YYDEBUG(148, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych == '/') goto yy144; - goto yy3; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy140; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych >= '{') goto yy3; - } - } -yy149: - YYDEBUG(149, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych == '/') goto yy144; - goto yy3; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy141; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych >= '{') goto yy3; - } - } -yy150: - YYDEBUG(150, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == ')') goto yy136; - if (yych <= '.') goto yy3; - goto yy144; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych >= '{') goto yy3; - } - } -yy151: - YYDEBUG(151, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy152: - YYDEBUG(152, *YYCURSOR); - if (yych <= '^') { - if (yych == '/') goto yy144; - goto yy53; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy53; - if (yych <= 'z') goto yy151; - goto yy53; - } -yy153: - YYDEBUG(153, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Z') goto yy137; - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy137; - goto yy3; - } -yy154: - YYDEBUG(154, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy138; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'e') goto yy155; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy155: - YYDEBUG(155, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'V') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'U') goto yy139; - } - } else { - if (yych <= 'u') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'v') goto yy156; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy156: - YYDEBUG(156, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'I') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'H') goto yy140; - } - } else { - if (yych <= 'h') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'i') goto yy157; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy157: - YYDEBUG(157, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'N') goto yy141; - } - } else { - if (yych <= 'n') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'o') goto yy158; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy158: - YYDEBUG(158, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'U') goto yy159; - if (yych != 'u') goto yy3; - } -yy159: - YYDEBUG(159, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy160; - if (yych != 's') goto yy53; -yy160: - YYDEBUG(160, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\t') goto yy161; - if (yych != ' ') goto yy53; -yy161: - YYDEBUG(161, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11); - yych = *YYCURSOR; - YYDEBUG(162, *YYCURSOR); - if (yych <= 'W') { - if (yych <= 'F') { - if (yych <= ' ') { - if (yych == '\t') goto yy161; - if (yych <= 0x1F) goto yy53; - goto yy161; - } else { - if (yych == 'D') goto yy166; - if (yych <= 'E') goto yy53; - goto yy168; - } - } else { - if (yych <= 'M') { - if (yych == 'H') goto yy165; - if (yych <= 'L') goto yy53; - goto yy164; - } else { - if (yych <= 'S') { - if (yych <= 'R') goto yy53; - } else { - if (yych <= 'T') goto yy170; - if (yych <= 'V') goto yy53; - goto yy167; - } - } - } - } else { - if (yych <= 'l') { - if (yych <= 'd') { - if (yych == 'Y') goto yy169; - if (yych <= 'c') goto yy53; - goto yy166; - } else { - if (yych <= 'f') { - if (yych <= 'e') goto yy53; - goto yy168; - } else { - if (yych == 'h') goto yy165; - goto yy53; - } - } - } else { - if (yych <= 't') { - if (yych <= 'm') goto yy164; - if (yych <= 'r') goto yy53; - if (yych >= 't') goto yy170; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy53; - goto yy167; - } else { - if (yych == 'y') goto yy169; - goto yy53; - } - } - } - } - YYDEBUG(163, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= 'D') { - if (yych == 'A') goto yy228; - goto yy53; - } else { - if (yych <= 'E') goto yy229; - if (yych <= 'T') goto yy53; - goto yy227; - } - } else { - if (yych <= 'd') { - if (yych == 'a') goto yy228; - goto yy53; - } else { - if (yych <= 'e') goto yy229; - if (yych == 'u') goto yy227; - goto yy53; - } - } -yy164: - YYDEBUG(164, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych == 'I') goto yy219; - if (yych <= 'N') goto yy53; - goto yy218; - } else { - if (yych <= 'i') { - if (yych <= 'h') goto yy53; - goto yy219; - } else { - if (yych == 'o') goto yy218; - goto yy53; - } - } -yy165: - YYDEBUG(165, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy216; - if (yych == 'o') goto yy216; - goto yy53; -yy166: - YYDEBUG(166, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy215; - if (yych == 'a') goto yy215; - goto yy53; -yy167: - YYDEBUG(167, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy203; - if (yych == 'e') goto yy203; - goto yy53; -yy168: - YYDEBUG(168, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych == 'O') goto yy188; - if (yych <= 'Q') goto yy53; - goto yy187; - } else { - if (yych <= 'o') { - if (yych <= 'n') goto yy53; - goto yy188; - } else { - if (yych == 'r') goto yy187; - goto yy53; - } - } -yy169: - YYDEBUG(169, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy184; - if (yych == 'e') goto yy184; - goto yy53; -yy170: - YYDEBUG(170, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'H') goto yy171; - if (yych <= 'T') goto yy53; - goto yy172; - } else { - if (yych <= 'h') { - if (yych <= 'g') goto yy53; - } else { - if (yych == 'u') goto yy172; - goto yy53; - } - } -yy171: - YYDEBUG(171, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy179; - if (yych == 'u') goto yy179; - goto yy53; -yy172: - YYDEBUG(172, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy173; - if (yych != 'e') goto yy53; -yy173: - YYDEBUG(173, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'S') goto yy175; - if (yych == 's') goto yy175; -yy174: - YYDEBUG(174, *YYCURSOR); -#line 1419 "ext/date/lib/parse_date.re" - { - timelib_sll i; - int behavior = 0; - DEBUG_OUTPUT("relativetext"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_relative_text((char **) &ptr, &behavior); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, behavior, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 3591 "ext/date/lib/parse_date.c" -yy175: - YYDEBUG(175, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy176; - if (yych != 'd') goto yy53; -yy176: - YYDEBUG(176, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy177; - if (yych != 'a') goto yy53; -yy177: - YYDEBUG(177, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy178; - if (yych != 'y') goto yy53; -yy178: - YYDEBUG(178, *YYCURSOR); - yych = *++YYCURSOR; - goto yy174; -yy179: - YYDEBUG(179, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'R') goto yy180; - if (yych != 'r') goto yy174; -yy180: - YYDEBUG(180, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy181; - if (yych != 's') goto yy53; -yy181: - YYDEBUG(181, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy182; - if (yych != 'd') goto yy53; -yy182: - YYDEBUG(182, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy183; - if (yych != 'a') goto yy53; -yy183: - YYDEBUG(183, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy178; - if (yych == 'y') goto yy178; - goto yy53; -yy184: - YYDEBUG(184, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy185; - if (yych != 'a') goto yy53; -yy185: - YYDEBUG(185, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy186; - if (yych != 'r') goto yy53; -yy186: - YYDEBUG(186, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy178; - if (yych == 's') goto yy178; - goto yy174; -yy187: - YYDEBUG(187, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy200; - if (yych == 'i') goto yy200; - goto yy53; -yy188: - YYDEBUG(188, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy189; - if (yych != 'r') goto yy53; -yy189: - YYDEBUG(189, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy190; - if (yych != 't') goto yy53; -yy190: - YYDEBUG(190, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych == 'H') goto yy192; - if (yych <= 'M') goto yy53; - } else { - if (yych <= 'h') { - if (yych <= 'g') goto yy53; - goto yy192; - } else { - if (yych != 'n') goto yy53; - } - } - YYDEBUG(191, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy197; - if (yych == 'i') goto yy197; - goto yy53; -yy192: - YYDEBUG(192, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy193; - if (yych != 'n') goto yy53; -yy193: - YYDEBUG(193, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy194; - if (yych != 'i') goto yy53; -yy194: - YYDEBUG(194, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy195; - if (yych != 'g') goto yy53; -yy195: - YYDEBUG(195, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy196; - if (yych != 'h') goto yy53; -yy196: - YYDEBUG(196, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy186; - if (yych == 't') goto yy186; - goto yy53; -yy197: - YYDEBUG(197, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy198; - if (yych != 'g') goto yy53; -yy198: - YYDEBUG(198, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy199; - if (yych != 'h') goto yy53; -yy199: - YYDEBUG(199, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy186; - if (yych == 't') goto yy186; - goto yy53; -yy200: - YYDEBUG(200, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'D') goto yy201; - if (yych != 'd') goto yy174; -yy201: - YYDEBUG(201, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy202; - if (yych != 'a') goto yy53; -yy202: - YYDEBUG(202, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy178; - if (yych == 'y') goto yy178; - goto yy53; -yy203: - YYDEBUG(203, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= 'C') goto yy53; - if (yych <= 'D') goto yy205; - } else { - if (yych <= 'c') goto yy53; - if (yych <= 'd') goto yy205; - if (yych >= 'f') goto yy53; - } - YYDEBUG(204, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'K') goto yy211; - if (yych == 'k') goto yy211; - goto yy53; -yy205: - YYDEBUG(205, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'N') goto yy206; - if (yych != 'n') goto yy174; -yy206: - YYDEBUG(206, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy207; - if (yych != 'e') goto yy53; -yy207: - YYDEBUG(207, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy208; - if (yych != 's') goto yy53; -yy208: - YYDEBUG(208, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy209; - if (yych != 'd') goto yy53; -yy209: - YYDEBUG(209, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy210; - if (yych != 'a') goto yy53; -yy210: - YYDEBUG(210, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy178; - if (yych == 'y') goto yy178; - goto yy53; -yy211: - YYDEBUG(211, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych == 'D') goto yy212; - if (yych <= 'R') goto yy174; - goto yy178; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy174; - } else { - if (yych == 's') goto yy178; - goto yy174; - } - } -yy212: - YYDEBUG(212, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy213; - if (yych != 'a') goto yy53; -yy213: - YYDEBUG(213, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy214; - if (yych != 'y') goto yy53; -yy214: - YYDEBUG(214, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy178; - if (yych == 's') goto yy178; - goto yy174; -yy215: - YYDEBUG(215, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy186; - if (yych == 'y') goto yy186; - goto yy53; -yy216: - YYDEBUG(216, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy217; - if (yych != 'u') goto yy53; -yy217: - YYDEBUG(217, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy186; - if (yych == 'r') goto yy186; - goto yy53; -yy218: - YYDEBUG(218, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy223; - if (yych == 'n') goto yy223; - goto yy53; -yy219: - YYDEBUG(219, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy220; - if (yych != 'n') goto yy53; -yy220: - YYDEBUG(220, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'U') { - if (yych == 'S') goto yy178; - if (yych <= 'T') goto yy174; - } else { - if (yych <= 's') { - if (yych <= 'r') goto yy174; - goto yy178; - } else { - if (yych != 'u') goto yy174; - } - } - YYDEBUG(221, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy222; - if (yych != 't') goto yy53; -yy222: - YYDEBUG(222, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy186; - if (yych == 'e') goto yy186; - goto yy53; -yy223: - YYDEBUG(223, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych == 'D') goto yy224; - if (yych <= 'S') goto yy174; - goto yy225; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy174; - } else { - if (yych == 't') goto yy225; - goto yy174; - } - } -yy224: - YYDEBUG(224, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy226; - if (yych == 'a') goto yy226; - goto yy53; -yy225: - YYDEBUG(225, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy186; - if (yych == 'h') goto yy186; - goto yy53; -yy226: - YYDEBUG(226, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy178; - if (yych == 'y') goto yy178; - goto yy53; -yy227: - YYDEBUG(227, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy238; - if (yych == 'n') goto yy238; - goto yy53; -yy228: - YYDEBUG(228, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy233; - if (yych == 't') goto yy233; - goto yy53; -yy229: - YYDEBUG(229, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy230; - if (yych != 'c') goto yy53; -yy230: - YYDEBUG(230, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych == 'O') goto yy231; - if (yych <= 'R') goto yy174; - goto yy178; - } else { - if (yych <= 'o') { - if (yych <= 'n') goto yy174; - } else { - if (yych == 's') goto yy178; - goto yy174; - } - } -yy231: - YYDEBUG(231, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy232; - if (yych != 'n') goto yy53; -yy232: - YYDEBUG(232, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy186; - if (yych == 'd') goto yy186; - goto yy53; -yy233: - YYDEBUG(233, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'U') goto yy234; - if (yych != 'u') goto yy174; -yy234: - YYDEBUG(234, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy235; - if (yych != 'r') goto yy53; -yy235: - YYDEBUG(235, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'D') goto yy236; - if (yych != 'd') goto yy53; -yy236: - YYDEBUG(236, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy237; - if (yych != 'a') goto yy53; -yy237: - YYDEBUG(237, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy178; - if (yych == 'y') goto yy178; - goto yy53; -yy238: - YYDEBUG(238, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'D') goto yy239; - if (yych != 'd') goto yy174; -yy239: - YYDEBUG(239, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy240; - if (yych != 'a') goto yy53; -yy240: - YYDEBUG(240, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy178; - if (yych == 'y') goto yy178; - goto yy53; -yy241: - YYDEBUG(241, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy138; - goto yy155; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy242; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy242: - YYDEBUG(242, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'U') goto yy139; - goto yy156; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'v') goto yy243; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy243: - YYDEBUG(243, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'I') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'H') goto yy140; - goto yy157; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'i') goto yy244; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy244: - YYDEBUG(244, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'O') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'N') goto yy141; - goto yy158; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'o') goto yy245; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy245: - YYDEBUG(245, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'U') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'T') goto yy3; - goto yy159; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'u') goto yy246; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy246: - YYDEBUG(246, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy160; - if (yych != 's') goto yy152; -yy247: - YYDEBUG(247, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy53; - goto yy161; - } else { - if (yych == ' ') goto yy161; - goto yy53; - } - } else { - if (yych <= '_') { - if (yych <= '/') goto yy144; - if (yych <= '^') goto yy53; - goto yy144; - } else { - if (yych <= '`') goto yy53; - if (yych <= 'z') goto yy151; - goto yy53; - } - } -yy248: - YYDEBUG(248, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy138; - } - } else { - if (yych <= 'r') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 's') goto yy249; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy249: - YYDEBUG(249, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 't') goto yy250; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy250: - YYDEBUG(250, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy3; - goto yy161; - } else { - if (yych == ' ') goto yy161; - goto yy3; - } - } else { - if (yych <= 'Z') { - if (yych <= ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy140; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy251: - YYDEBUG(251, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy138; - goto yy249; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 's') goto yy252; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy252: - YYDEBUG(252, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - goto yy250; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy253; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy253: - YYDEBUG(253, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy161; - goto yy3; - } else { - if (yych <= ' ') goto yy161; - if (yych == ')') goto yy136; - goto yy3; - } - } else { - if (yych <= '^') { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'Z') goto yy140; - goto yy3; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy254: - YYDEBUG(254, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'G') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'F') goto yy138; - goto yy261; - } - } else { - if (yych <= 'f') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'g') goto yy261; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy255: - YYDEBUG(255, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy138; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'e') goto yy256; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy256: - YYDEBUG(256, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'V') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'U') goto yy139; - } - } else { - if (yych <= 'u') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'v') goto yy257; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy257: - YYDEBUG(257, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy140; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'e') goto yy258; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy258: - YYDEBUG(258, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy141; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'n') goto yy259; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy259: - YYDEBUG(259, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'T') goto yy260; - if (yych != 't') goto yy3; - } -yy260: - YYDEBUG(260, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy160; - if (yych == 'h') goto yy160; - goto yy53; -yy261: - YYDEBUG(261, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'H') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy139; - } - } else { - if (yych <= 'g') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'h') goto yy262; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy262: - YYDEBUG(262, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy140; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 't') goto yy263; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy263: - YYDEBUG(263, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy3; - goto yy161; - } else { - if (yych == ' ') goto yy161; - goto yy3; - } - } else { - if (yych <= 'Z') { - if (yych <= ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy141; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy264: - YYDEBUG(264, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'G') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'F') goto yy138; - goto yy261; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'g') goto yy271; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy265: - YYDEBUG(265, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy138; - goto yy256; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy266; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy266: - YYDEBUG(266, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'U') goto yy139; - goto yy257; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'v') goto yy267; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy267: - YYDEBUG(267, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy140; - goto yy258; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy268; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy268: - YYDEBUG(268, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy141; - goto yy259; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy269; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy269: - YYDEBUG(269, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'S') goto yy3; - goto yy260; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy270; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy270: - YYDEBUG(270, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy160; - if (yych == 'h') goto yy247; - goto yy152; -yy271: - YYDEBUG(271, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy139; - goto yy262; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy272; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy272: - YYDEBUG(272, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy140; - goto yy263; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy273; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy273: - YYDEBUG(273, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy161; - goto yy3; - } else { - if (yych <= ' ') goto yy161; - if (yych == ')') goto yy136; - goto yy3; - } - } else { - if (yych <= '^') { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'Z') goto yy141; - goto yy3; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy274: - YYDEBUG(274, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'C') goto yy138; - if (yych >= 'E') goto yy277; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'd') goto yy275; - if (yych <= 'e') goto yy277; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy275: - YYDEBUG(275, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= 'N') { - if (yych <= ')') { - if (yych >= ')') goto yy136; - } else { - if (yych <= '@') goto yy276; - if (yych <= 'M') goto yy139; - goto yy283; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy139; - if (yych >= 'a') goto yy139; - } else { - if (yych <= 'n') goto yy283; - if (yych <= 'z') goto yy139; - } - } -yy276: - YYDEBUG(276, *YYCURSOR); -#line 1401 "ext/date/lib/parse_date.re" - { - const timelib_relunit* relunit; - DEBUG_OUTPUT("daytext"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - relunit = timelib_lookup_relunit((char**) &ptr); - s->time->relative.weekday = relunit->multiplier; - if (s->time->relative.weekday_behavior != 2) { - s->time->relative.weekday_behavior = 1; - } - - TIMELIB_DEINIT; - return TIMELIB_WEEKDAY; - } -#line 4783 "ext/date/lib/parse_date.c" -yy277: - YYDEBUG(277, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'K') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'J') goto yy139; - } - } else { - if (yych <= 'j') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'k') goto yy278; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy278: - YYDEBUG(278, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy140; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'd') goto yy279; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy279: - YYDEBUG(279, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - goto yy3; - } else { - if (yych <= 'a') goto yy280; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy280: - YYDEBUG(280, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'X') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Y') goto yy281; - if (yych != 'y') goto yy3; - } -yy281: - YYDEBUG(281, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy282; - if (yych != 's') goto yy276; -yy282: - YYDEBUG(282, *YYCURSOR); - yych = *++YYCURSOR; - goto yy276; -yy283: - YYDEBUG(283, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy140; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'e') goto yy284; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy284: - YYDEBUG(284, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy141; - } - } else { - if (yych <= 'r') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 's') goto yy285; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy285: - YYDEBUG(285, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'C') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'D') goto yy286; - if (yych != 'd') goto yy3; - } -yy286: - YYDEBUG(286, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy287; - if (yych != 'a') goto yy53; -yy287: - YYDEBUG(287, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy282; - if (yych == 'y') goto yy282; - goto yy53; -yy288: - YYDEBUG(288, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '/') { - if (yych == ')') goto yy136; - if (yych <= '.') goto yy3; - goto yy144; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy138; - if (yych <= 'D') goto yy275; - goto yy277; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy143; - } else { - if (yych <= 'e') goto yy290; - if (yych <= 'z') goto yy143; - goto yy3; - } - } - } - YYDEBUG(289, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy276; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy276; - if (yych <= 'M') goto yy139; - goto yy283; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy276; - } else { - if (yych == 'n') goto yy296; - if (yych <= 'z') goto yy148; - goto yy276; - } - } -yy290: - YYDEBUG(290, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'K') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'J') goto yy139; - goto yy278; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'k') goto yy291; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy291: - YYDEBUG(291, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy140; - goto yy279; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'd') goto yy292; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy292: - YYDEBUG(292, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy280; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy141; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy293; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy293: - YYDEBUG(293, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Y') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'X') goto yy3; - goto yy281; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'y') goto yy294; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy294: - YYDEBUG(294, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '^') { - if (yych <= '/') { - if (yych <= '.') goto yy276; - goto yy144; - } else { - if (yych == 'S') goto yy282; - goto yy276; - } - } else { - if (yych <= 'r') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy276; - goto yy151; - } else { - if (yych <= 's') goto yy295; - if (yych <= 'z') goto yy151; - goto yy276; - } - } -yy295: - YYDEBUG(295, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '^') { - if (yych == '/') goto yy144; - goto yy276; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy276; - if (yych <= 'z') goto yy151; - goto yy276; - } -yy296: - YYDEBUG(296, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy140; - goto yy284; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy297; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy297: - YYDEBUG(297, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy141; - goto yy285; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 's') goto yy298; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy298: - YYDEBUG(298, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'C') goto yy3; - goto yy286; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'd') goto yy299; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy299: - YYDEBUG(299, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy287; - if (yych != 'a') goto yy152; - YYDEBUG(300, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy282; - if (yych == 'y') goto yy295; - goto yy152; -yy301: - YYDEBUG(301, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'C') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'B') goto yy138; - } - } else { - if (yych <= 'b') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'c') goto yy302; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy302: - YYDEBUG(302, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych >= '\t') goto yy305; - } else { - if (yych == ' ') goto yy305; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - } else { - if (yych == 'E') goto yy311; - goto yy139; - } - } else { - if (yych <= 'd') { - if (yych >= 'a') goto yy139; - } else { - if (yych <= 'e') goto yy311; - if (yych <= 'z') goto yy139; - } - } - } -yy303: - YYDEBUG(303, *YYCURSOR); -#line 1436 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("monthtext"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_lookup_month((char **) &ptr); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } -#line 5269 "ext/date/lib/parse_date.c" -yy304: - YYDEBUG(304, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 20) YYFILL(20); - yych = *YYCURSOR; -yy305: - YYDEBUG(305, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy304; - } - if (yych <= '/') goto yy53; - if (yych <= '2') goto yy307; - if (yych <= '3') goto yy309; - if (yych <= '9') goto yy310; - goto yy53; -yy306: - YYDEBUG(306, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy305; - if (yych <= '0') goto yy464; - if (yych <= '2') goto yy465; - if (yych <= '3') goto yy466; - goto yy305; -yy307: - YYDEBUG(307, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '1') { - if (yych <= '/') goto yy325; - if (yych <= '0') goto yy405; - goto yy406; - } else { - if (yych <= '2') goto yy462; - if (yych <= '9') goto yy463; - goto yy325; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy321; - if (yych <= 'q') goto yy325; - goto yy322; - } else { - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy308: - YYDEBUG(308, *YYCURSOR); -#line 1213 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("datetextual | datenoyear"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } -#line 5332 "ext/date/lib/parse_date.c" -yy309: - YYDEBUG(309, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '1') { - if (yych <= '/') goto yy325; - if (yych <= '0') goto yy405; - goto yy406; - } else { - if (yych <= '2') goto yy318; - if (yych <= '9') goto yy319; - goto yy325; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy321; - if (yych <= 'q') goto yy325; - goto yy322; - } else { - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy310: - YYDEBUG(310, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '1') { - if (yych <= '/') goto yy325; - if (yych <= '0') goto yy316; - goto yy317; - } else { - if (yych <= '2') goto yy318; - if (yych <= '9') goto yy319; - goto yy325; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy321; - if (yych <= 'q') goto yy325; - goto yy322; - } else { - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy311: - YYDEBUG(311, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'M') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'L') goto yy140; - } - } else { - if (yych <= 'l') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'm') goto yy312; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy312: - YYDEBUG(312, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'B') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy141; - } - } else { - if (yych <= 'a') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'b') goto yy313; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy313: - YYDEBUG(313, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'E') goto yy314; - if (yych != 'e') goto yy3; - } -yy314: - YYDEBUG(314, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy315; - if (yych != 'r') goto yy53; -yy315: - YYDEBUG(315, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy303; - goto yy305; - } else { - if (yych <= '.') { - if (yych <= ',') goto yy303; - goto yy305; - } else { - if (yych <= '/') goto yy303; - if (yych <= '9') goto yy305; - goto yy303; - } - } -yy316: - YYDEBUG(316, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy330; - goto yy53; - } else { - if (yych <= '0') goto yy403; - if (yych <= '9') goto yy404; - if (yych <= ':') goto yy330; - goto yy53; - } -yy317: - YYDEBUG(317, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy53; - } else { - if (yych <= '2') goto yy404; - if (yych <= '9') goto yy403; - if (yych <= ':') goto yy371; - goto yy53; - } -yy318: - YYDEBUG(318, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy53; - } else { - if (yych <= '3') goto yy403; - if (yych <= '9') goto yy400; - if (yych <= ':') goto yy371; - goto yy53; - } -yy319: - YYDEBUG(319, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy53; - } else { - if (yych <= '9') goto yy400; - if (yych <= ':') goto yy371; - goto yy53; - } -yy320: - YYDEBUG(320, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - goto yy325; -yy321: - YYDEBUG(321, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - goto yy325; -yy322: - YYDEBUG(322, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - goto yy325; -yy323: - YYDEBUG(323, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - goto yy325; -yy324: - YYDEBUG(324, *YYCURSOR); - yyaccept = 7; - YYMARKER = ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 17) YYFILL(17); - yych = *YYCURSOR; -yy325: - YYDEBUG(325, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy324; - } - if (yych <= '2') { - if (yych <= '/') goto yy308; - if (yych <= '0') goto yy366; - if (yych <= '1') goto yy367; - goto yy368; - } else { - if (yych <= '9') goto yy369; - if (yych != 'T') goto yy308; - } - YYDEBUG(326, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '1') goto yy327; - if (yych <= '2') goto yy328; - if (yych <= '9') goto yy329; - goto yy53; -yy327: - YYDEBUG(327, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy330; - goto yy53; - } else { - if (yych <= '9') goto yy329; - if (yych <= ':') goto yy330; - goto yy53; - } -yy328: - YYDEBUG(328, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy330; - goto yy53; - } else { - if (yych <= '3') goto yy329; - if (yych == ':') goto yy330; - goto yy53; - } -yy329: - YYDEBUG(329, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '.') goto yy330; - if (yych != ':') goto yy53; -yy330: - YYDEBUG(330, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy331; - if (yych <= '9') goto yy333; - goto yy53; -yy331: - YYDEBUG(331, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy334; - } else { - if (yych <= '9') goto yy333; - if (yych <= ':') goto yy334; - } -yy332: - YYDEBUG(332, *YYCURSOR); -#line 1484 "ext/date/lib/parse_date.re" - { - int tz_not_found; - DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - } - TIMELIB_DEINIT; - return TIMELIB_SHORTDATE_WITH_TIME; - } -#line 5630 "ext/date/lib/parse_date.c" -yy333: - YYDEBUG(333, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy334; - if (yych != ':') goto yy332; -yy334: - YYDEBUG(334, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy335; - if (yych <= '6') goto yy336; - if (yych <= '9') goto yy337; - goto yy53; -yy335: - YYDEBUG(335, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy332; - if (yych <= '9') goto yy338; - goto yy332; -yy336: - YYDEBUG(336, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '0') goto yy338; - goto yy332; -yy337: - YYDEBUG(337, *YYCURSOR); - yych = *++YYCURSOR; - goto yy332; -yy338: - YYDEBUG(338, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '*') { - if (yych <= 0x1F) { - if (yych != '\t') goto yy332; - } else { - if (yych <= ' ') goto yy339; - if (yych == '(') goto yy342; - goto yy332; - } - } else { - if (yych <= '@') { - if (yych == ',') goto yy332; - if (yych <= '-') goto yy341; - goto yy332; - } else { - if (yych <= 'Z') goto yy343; - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy344; - goto yy332; - } - } -yy339: - YYDEBUG(339, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 8) YYFILL(8); - yych = *YYCURSOR; - YYDEBUG(340, *YYCURSOR); - if (yych <= '*') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy339; - goto yy53; - } else { - if (yych <= ' ') goto yy339; - if (yych == '(') goto yy342; - goto yy53; - } - } else { - if (yych <= '@') { - if (yych == ',') goto yy53; - if (yych >= '.') goto yy53; - } else { - if (yych <= 'Z') goto yy343; - if (yych <= '`') goto yy53; - if (yych <= 'z') goto yy344; - goto yy53; - } - } -yy341: - YYDEBUG(341, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '1') goto yy361; - if (yych <= '2') goto yy362; - if (yych <= '9') goto yy363; - goto yy53; -yy342: - YYDEBUG(342, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') goto yy53; - if (yych <= 'Z') goto yy344; - if (yych <= '`') goto yy53; - if (yych <= 'z') goto yy344; - goto yy53; -yy343: - YYDEBUG(343, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= 'Z') goto yy345; - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy350; - goto yy332; - } -yy344: - YYDEBUG(344, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= 'Z') goto yy345; - if (yych <= '`') goto yy332; - if (yych >= '{') goto yy332; - } -yy345: - YYDEBUG(345, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= 'Z') goto yy346; - if (yych <= '`') goto yy332; - if (yych >= '{') goto yy332; - } -yy346: - YYDEBUG(346, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= 'Z') goto yy347; - if (yych <= '`') goto yy332; - if (yych >= '{') goto yy332; - } -yy347: - YYDEBUG(347, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= 'Z') goto yy348; - if (yych <= '`') goto yy332; - if (yych >= '{') goto yy332; - } -yy348: - YYDEBUG(348, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= 'Z') goto yy349; - if (yych <= '`') goto yy332; - if (yych >= '{') goto yy332; - } -yy349: - YYDEBUG(349, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == ')') goto yy337; - goto yy332; -yy350: - YYDEBUG(350, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy332; - goto yy337; - } else { - if (yych == '/') goto yy352; - goto yy332; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy346; - if (yych <= '^') goto yy332; - goto yy352; - } else { - if (yych <= '`') goto yy332; - if (yych >= '{') goto yy332; - } - } -yy351: - YYDEBUG(351, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy332; - goto yy337; - } else { - if (yych != '/') goto yy332; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy347; - if (yych <= '^') goto yy332; - } else { - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy356; - goto yy332; - } - } -yy352: - YYDEBUG(352, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '@') goto yy53; - if (yych >= '[') goto yy53; - YYDEBUG(353, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '`') goto yy53; - if (yych >= '{') goto yy53; -yy354: - YYDEBUG(354, *YYCURSOR); - yyaccept = 8; - YYMARKER = ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(355, *YYCURSOR); - if (yych <= '^') { - if (yych == '/') goto yy352; - goto yy332; - } else { - if (yych <= '_') goto yy352; - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy354; - goto yy332; - } -yy356: - YYDEBUG(356, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy332; - goto yy337; - } else { - if (yych == '/') goto yy352; - goto yy332; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy348; - if (yych <= '^') goto yy332; - goto yy352; - } else { - if (yych <= '`') goto yy332; - if (yych >= '{') goto yy332; - } - } - YYDEBUG(357, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy332; - goto yy337; - } else { - if (yych == '/') goto yy352; - goto yy332; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy349; - if (yych <= '^') goto yy332; - goto yy352; - } else { - if (yych <= '`') goto yy332; - if (yych >= '{') goto yy332; - } - } - YYDEBUG(358, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == ')') goto yy337; - if (yych <= '.') goto yy332; - goto yy352; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy332; - goto yy352; - } else { - if (yych <= '`') goto yy332; - if (yych >= '{') goto yy332; - } - } -yy359: - YYDEBUG(359, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(360, *YYCURSOR); - if (yych <= '^') { - if (yych == '/') goto yy352; - goto yy53; - } else { - if (yych <= '_') goto yy352; - if (yych <= '`') goto yy53; - if (yych <= 'z') goto yy359; - goto yy53; - } -yy361: - YYDEBUG(361, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy332; - if (yych <= '9') goto yy363; - if (yych <= ':') goto yy364; - goto yy332; -yy362: - YYDEBUG(362, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '5') { - if (yych <= '/') goto yy332; - if (yych >= '4') goto yy365; - } else { - if (yych <= '9') goto yy337; - if (yych <= ':') goto yy364; - goto yy332; - } -yy363: - YYDEBUG(363, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy332; - if (yych <= '5') goto yy365; - if (yych <= '9') goto yy337; - if (yych >= ';') goto yy332; -yy364: - YYDEBUG(364, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy332; - if (yych <= '5') goto yy365; - if (yych <= '9') goto yy337; - goto yy332; -yy365: - YYDEBUG(365, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy332; - if (yych <= '9') goto yy337; - goto yy332; -yy366: - YYDEBUG(366, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy330; - goto yy308; - } else { - if (yych <= '0') goto yy398; - if (yych <= '9') goto yy399; - if (yych <= ':') goto yy330; - goto yy308; - } -yy367: - YYDEBUG(367, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy308; - } else { - if (yych <= '2') goto yy399; - if (yych <= '9') goto yy398; - if (yych <= ':') goto yy371; - goto yy308; - } -yy368: - YYDEBUG(368, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy308; - } else { - if (yych <= '3') goto yy398; - if (yych <= '9') goto yy370; - if (yych <= ':') goto yy371; - goto yy308; - } -yy369: - YYDEBUG(369, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy308; - } else { - if (yych <= '9') goto yy370; - if (yych <= ':') goto yy371; - goto yy308; - } -yy370: - YYDEBUG(370, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy308; - if (yych <= '9') goto yy396; - goto yy308; -yy371: - YYDEBUG(371, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy372; - if (yych <= '9') goto yy373; - goto yy53; -yy372: - YYDEBUG(372, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy374; - goto yy332; - } else { - if (yych <= '9') goto yy389; - if (yych <= ':') goto yy374; - goto yy332; - } -yy373: - YYDEBUG(373, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy374; - if (yych != ':') goto yy332; -yy374: - YYDEBUG(374, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy375; - if (yych <= '6') goto yy376; - if (yych <= '9') goto yy337; - goto yy53; -yy375: - YYDEBUG(375, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy332; - if (yych <= '9') goto yy377; - goto yy332; -yy376: - YYDEBUG(376, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '0') goto yy332; -yy377: - YYDEBUG(377, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '*') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy379; - goto yy332; - } else { - if (yych <= ' ') goto yy379; - if (yych == '(') goto yy379; - goto yy332; - } - } else { - if (yych <= '@') { - if (yych == ',') goto yy332; - if (yych <= '-') goto yy379; - goto yy332; - } else { - if (yych <= 'Z') goto yy379; - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy379; - goto yy332; - } - } -yy378: - YYDEBUG(378, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 8) YYFILL(8); - yych = *YYCURSOR; -yy379: - YYDEBUG(379, *YYCURSOR); - if (yych <= '-') { - if (yych <= '\'') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy53; - goto yy378; - } else { - if (yych == ' ') goto yy378; - goto yy53; - } - } else { - if (yych <= '*') { - if (yych <= '(') goto yy342; - goto yy53; - } else { - if (yych == ',') goto yy53; - goto yy341; - } - } - } else { - if (yych <= 'Z') { - if (yych <= 'A') { - if (yych <= '@') goto yy53; - } else { - if (yych != 'P') goto yy343; - } - } else { - if (yych <= 'o') { - if (yych <= '`') goto yy53; - if (yych <= 'a') goto yy381; - goto yy344; - } else { - if (yych <= 'p') goto yy381; - if (yych <= 'z') goto yy344; - goto yy53; - } - } - } - YYDEBUG(380, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'L') { - if (yych <= '-') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= '.') goto yy382; - if (yych <= '@') goto yy332; - goto yy345; - } - } else { - if (yych <= '`') { - if (yych <= 'M') goto yy383; - if (yych <= 'Z') goto yy345; - goto yy332; - } else { - if (yych == 'm') goto yy388; - if (yych <= 'z') goto yy350; - goto yy332; - } - } -yy381: - YYDEBUG(381, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'L') { - if (yych <= '-') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= '.') goto yy382; - if (yych <= '@') goto yy332; - goto yy345; - } - } else { - if (yych <= '`') { - if (yych <= 'M') goto yy383; - if (yych <= 'Z') goto yy345; - goto yy332; - } else { - if (yych == 'm') goto yy383; - if (yych <= 'z') goto yy345; - goto yy332; - } - } -yy382: - YYDEBUG(382, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy387; - if (yych == 'm') goto yy387; - goto yy53; -yy383: - YYDEBUG(383, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ')') { - if (yych <= '\t') { - if (yych <= 0x00) goto yy385; - if (yych <= 0x08) goto yy332; - goto yy385; - } else { - if (yych == ' ') goto yy385; - if (yych <= '(') goto yy332; - goto yy337; - } - } else { - if (yych <= '@') { - if (yych != '.') goto yy332; - } else { - if (yych <= 'Z') goto yy346; - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy346; - goto yy332; - } - } -yy384: - YYDEBUG(384, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\t') { - if (yych <= 0x00) goto yy385; - if (yych <= 0x08) goto yy53; - } else { - if (yych != ' ') goto yy53; - } -yy385: - YYDEBUG(385, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(386, *YYCURSOR); -#line 1460 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - s->time->h += timelib_meridian((char **) &ptr, s->time->h); - TIMELIB_DEINIT; - return TIMELIB_SHORTDATE_WITH_TIME; - } -#line 6264 "ext/date/lib/parse_date.c" -yy387: - YYDEBUG(387, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 0x1F) { - if (yych <= 0x00) goto yy385; - if (yych == '\t') goto yy385; - goto yy53; - } else { - if (yych <= ' ') goto yy385; - if (yych == '.') goto yy384; - goto yy53; - } -yy388: - YYDEBUG(388, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '-') { - if (yych <= 0x1F) { - if (yych <= 0x00) goto yy385; - if (yych == '\t') goto yy385; - goto yy332; - } else { - if (yych <= ' ') goto yy385; - if (yych == ')') goto yy337; - goto yy332; - } - } else { - if (yych <= 'Z') { - if (yych <= '.') goto yy384; - if (yych <= '/') goto yy352; - if (yych <= '@') goto yy332; - goto yy346; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy332; - goto yy352; - } else { - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy351; - goto yy332; - } - } - } -yy389: - YYDEBUG(389, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ':') { - if (yych <= ' ') { - if (yych == '\t') goto yy390; - if (yych <= 0x1F) goto yy332; - } else { - if (yych == '.') goto yy374; - if (yych <= '9') goto yy332; - goto yy374; - } - } else { - if (yych <= 'P') { - if (yych == 'A') goto yy392; - if (yych <= 'O') goto yy332; - goto yy392; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy332; - goto yy392; - } else { - if (yych == 'p') goto yy392; - goto yy332; - } - } - } -yy390: - YYDEBUG(390, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); - yych = *YYCURSOR; - YYDEBUG(391, *YYCURSOR); - if (yych <= 'A') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy390; - goto yy53; - } else { - if (yych <= ' ') goto yy390; - if (yych <= '@') goto yy53; - } - } else { - if (yych <= '`') { - if (yych != 'P') goto yy53; - } else { - if (yych <= 'a') goto yy392; - if (yych != 'p') goto yy53; - } - } -yy392: - YYDEBUG(392, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'L') { - if (yych != '.') goto yy53; - } else { - if (yych <= 'M') goto yy394; - if (yych == 'm') goto yy394; - goto yy53; - } -yy393: - YYDEBUG(393, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy394; - if (yych != 'm') goto yy53; -yy394: - YYDEBUG(394, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 0x1F) { - if (yych <= 0x00) goto yy385; - if (yych == '\t') goto yy385; - goto yy53; - } else { - if (yych <= ' ') goto yy385; - if (yych != '.') goto yy53; - } -yy395: - YYDEBUG(395, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\t') { - if (yych <= 0x00) goto yy385; - if (yych <= 0x08) goto yy53; - goto yy385; - } else { - if (yych == ' ') goto yy385; - goto yy53; - } -yy396: - YYDEBUG(396, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy308; - if (yych >= ':') goto yy308; - YYDEBUG(397, *YYCURSOR); - yych = *++YYCURSOR; - goto yy308; -yy398: - YYDEBUG(398, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy330; - goto yy308; - } else { - if (yych <= '9') goto yy396; - if (yych <= ':') goto yy330; - goto yy308; - } -yy399: - YYDEBUG(399, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy308; - } else { - if (yych <= '9') goto yy396; - if (yych <= ':') goto yy371; - goto yy308; - } -yy400: - YYDEBUG(400, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; -yy401: - YYDEBUG(401, *YYCURSOR); - ++YYCURSOR; -yy402: - YYDEBUG(402, *YYCURSOR); -#line 1187 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("datenoday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } -#line 6449 "ext/date/lib/parse_date.c" -yy403: - YYDEBUG(403, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy330; - goto yy53; - } else { - if (yych <= '9') goto yy401; - if (yych <= ':') goto yy330; - goto yy53; - } -yy404: - YYDEBUG(404, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy53; - } else { - if (yych <= '9') goto yy401; - if (yych <= ':') goto yy371; - goto yy53; - } -yy405: - YYDEBUG(405, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '/') { - if (yych == '.') goto yy438; - goto yy325; - } else { - if (yych <= '0') goto yy439; - if (yych <= '1') goto yy409; - if (yych <= '2') goto yy410; - goto yy404; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy330; - if (yych == 'n') goto yy321; - goto yy325; - } else { - if (yych <= 'r') goto yy322; - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy406: - YYDEBUG(406, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '/') { - if (yych != '.') goto yy325; - } else { - if (yych <= '0') goto yy408; - if (yych <= '1') goto yy409; - if (yych <= '2') goto yy410; - goto yy404; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy371; - if (yych == 'n') goto yy321; - goto yy325; - } else { - if (yych <= 'r') goto yy322; - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy407: - YYDEBUG(407, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '1') { - if (yych <= '/') goto yy325; - if (yych <= '0') goto yy413; - goto yy414; - } else { - if (yych <= '2') goto yy415; - if (yych <= '5') goto yy416; - if (yych <= '9') goto yy417; - goto yy325; - } -yy408: - YYDEBUG(408, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy53; - } else { - if (yych <= '0') goto yy411; - if (yych <= '9') goto yy412; - if (yych <= ':') goto yy371; - goto yy53; - } -yy409: - YYDEBUG(409, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy53; - } else { - if (yych <= '2') goto yy412; - if (yych <= '9') goto yy411; - if (yych <= ':') goto yy371; - goto yy53; - } -yy410: - YYDEBUG(410, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy371; - goto yy53; - } else { - if (yych <= '3') goto yy411; - if (yych <= '9') goto yy401; - if (yych <= ':') goto yy371; - goto yy53; - } -yy411: - YYDEBUG(411, *YYCURSOR); - yyaccept = 9; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy330; - if (yych == ':') goto yy330; - goto yy402; -yy412: - YYDEBUG(412, *YYCURSOR); - yyaccept = 9; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy371; - if (yych == ':') goto yy371; - goto yy402; -yy413: - YYDEBUG(413, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy433; - goto yy308; - } else { - if (yych <= '0') goto yy432; - if (yych <= '9') goto yy437; - if (yych <= ':') goto yy433; - goto yy308; - } -yy414: - YYDEBUG(414, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy418; - goto yy308; - } else { - if (yych <= '2') goto yy437; - if (yych <= '9') goto yy432; - if (yych <= ':') goto yy418; - goto yy308; - } -yy415: - YYDEBUG(415, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy418; - goto yy308; - } else { - if (yych <= '3') goto yy432; - if (yych <= '9') goto yy431; - if (yych <= ':') goto yy418; - goto yy308; - } -yy416: - YYDEBUG(416, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy418; - goto yy308; - } else { - if (yych <= '9') goto yy431; - if (yych <= ':') goto yy418; - goto yy308; - } -yy417: - YYDEBUG(417, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych != '.') goto yy308; - } else { - if (yych <= '9') goto yy370; - if (yych >= ';') goto yy308; - } -yy418: - YYDEBUG(418, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy419; - if (yych <= '6') goto yy420; - if (yych <= '9') goto yy373; - goto yy53; -yy419: - YYDEBUG(419, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy374; - goto yy332; - } else { - if (yych <= '9') goto yy421; - if (yych <= ':') goto yy374; - goto yy332; - } -yy420: - YYDEBUG(420, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy374; - goto yy332; - } else { - if (yych <= '0') goto yy377; - if (yych == ':') goto yy374; - goto yy332; - } -yy421: - YYDEBUG(421, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= ' ') { - if (yych == '\t') goto yy423; - if (yych <= 0x1F) goto yy332; - goto yy423; - } else { - if (yych <= '(') { - if (yych <= '\'') goto yy332; - goto yy423; - } else { - if (yych == '+') goto yy423; - goto yy332; - } - } - } else { - if (yych <= ':') { - if (yych <= '-') goto yy423; - if (yych <= '.') goto yy374; - if (yych <= '9') goto yy332; - goto yy374; - } else { - if (yych <= 'Z') { - if (yych <= '@') goto yy332; - goto yy423; - } else { - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy423; - goto yy332; - } - } - } -yy422: - YYDEBUG(422, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 8) YYFILL(8); - yych = *YYCURSOR; -yy423: - YYDEBUG(423, *YYCURSOR); - if (yych <= '-') { - if (yych <= '\'') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy53; - goto yy422; - } else { - if (yych == ' ') goto yy422; - goto yy53; - } - } else { - if (yych <= '*') { - if (yych <= '(') goto yy342; - goto yy53; - } else { - if (yych == ',') goto yy53; - goto yy341; - } - } - } else { - if (yych <= 'Z') { - if (yych <= 'A') { - if (yych <= '@') goto yy53; - } else { - if (yych != 'P') goto yy343; - } - } else { - if (yych <= 'o') { - if (yych <= '`') goto yy53; - if (yych <= 'a') goto yy425; - goto yy344; - } else { - if (yych <= 'p') goto yy425; - if (yych <= 'z') goto yy344; - goto yy53; - } - } - } - YYDEBUG(424, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'L') { - if (yych <= '-') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= '.') goto yy427; - if (yych <= '@') goto yy332; - goto yy345; - } - } else { - if (yych <= '`') { - if (yych <= 'M') goto yy426; - if (yych <= 'Z') goto yy345; - goto yy332; - } else { - if (yych == 'm') goto yy430; - if (yych <= 'z') goto yy350; - goto yy332; - } - } -yy425: - YYDEBUG(425, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'L') { - if (yych <= '-') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= '.') goto yy427; - if (yych <= '@') goto yy332; - goto yy345; - } - } else { - if (yych <= '`') { - if (yych <= 'M') goto yy426; - if (yych <= 'Z') goto yy345; - goto yy332; - } else { - if (yych == 'm') goto yy426; - if (yych <= 'z') goto yy345; - goto yy332; - } - } -yy426: - YYDEBUG(426, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ')') { - if (yych <= '\t') { - if (yych <= 0x00) goto yy385; - if (yych <= 0x08) goto yy332; - goto yy385; - } else { - if (yych == ' ') goto yy385; - if (yych <= '(') goto yy332; - goto yy337; - } - } else { - if (yych <= '@') { - if (yych == '.') goto yy429; - goto yy332; - } else { - if (yych <= 'Z') goto yy346; - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy346; - goto yy332; - } - } -yy427: - YYDEBUG(427, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy428; - if (yych != 'm') goto yy53; -yy428: - YYDEBUG(428, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 0x1F) { - if (yych <= 0x00) goto yy385; - if (yych == '\t') goto yy385; - goto yy53; - } else { - if (yych <= ' ') goto yy385; - if (yych != '.') goto yy53; - } -yy429: - YYDEBUG(429, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\t') { - if (yych <= 0x00) goto yy385; - if (yych <= 0x08) goto yy53; - goto yy385; - } else { - if (yych == ' ') goto yy385; - goto yy53; - } -yy430: - YYDEBUG(430, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '-') { - if (yych <= 0x1F) { - if (yych <= 0x00) goto yy385; - if (yych == '\t') goto yy385; - goto yy332; - } else { - if (yych <= ' ') goto yy385; - if (yych == ')') goto yy337; - goto yy332; - } - } else { - if (yych <= 'Z') { - if (yych <= '.') goto yy429; - if (yych <= '/') goto yy352; - if (yych <= '@') goto yy332; - goto yy346; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy332; - goto yy352; - } else { - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy351; - goto yy332; - } - } - } -yy431: - YYDEBUG(431, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ':') { - if (yych <= ' ') { - if (yych == '\t') goto yy390; - if (yych <= 0x1F) goto yy308; - goto yy390; - } else { - if (yych <= '.') { - if (yych <= '-') goto yy308; - goto yy374; - } else { - if (yych <= '/') goto yy308; - if (yych <= '9') goto yy396; - goto yy374; - } - } - } else { - if (yych <= 'P') { - if (yych == 'A') goto yy392; - if (yych <= 'O') goto yy308; - goto yy392; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy308; - goto yy392; - } else { - if (yych == 'p') goto yy392; - goto yy308; - } - } - } -yy432: - YYDEBUG(432, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ':') { - if (yych <= ' ') { - if (yych == '\t') goto yy390; - if (yych <= 0x1F) goto yy308; - goto yy390; - } else { - if (yych <= '.') { - if (yych <= '-') goto yy308; - } else { - if (yych <= '/') goto yy308; - if (yych <= '9') goto yy396; - } - } - } else { - if (yych <= 'P') { - if (yych == 'A') goto yy392; - if (yych <= 'O') goto yy308; - goto yy392; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy308; - goto yy392; - } else { - if (yych == 'p') goto yy392; - goto yy308; - } - } - } -yy433: - YYDEBUG(433, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy434; - if (yych <= '6') goto yy435; - if (yych <= '9') goto yy333; - goto yy53; -yy434: - YYDEBUG(434, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy334; - goto yy332; - } else { - if (yych <= '9') goto yy436; - if (yych <= ':') goto yy334; - goto yy332; - } -yy435: - YYDEBUG(435, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy334; - goto yy332; - } else { - if (yych <= '0') goto yy377; - if (yych == ':') goto yy334; - goto yy332; - } -yy436: - YYDEBUG(436, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= ' ') { - if (yych == '\t') goto yy379; - if (yych <= 0x1F) goto yy332; - goto yy379; - } else { - if (yych <= '(') { - if (yych <= '\'') goto yy332; - goto yy379; - } else { - if (yych == '+') goto yy379; - goto yy332; - } - } - } else { - if (yych <= ':') { - if (yych <= '-') goto yy379; - if (yych <= '.') goto yy334; - if (yych <= '9') goto yy332; - goto yy334; - } else { - if (yych <= 'Z') { - if (yych <= '@') goto yy332; - goto yy379; - } else { - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy379; - goto yy332; - } - } - } -yy437: - YYDEBUG(437, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ':') { - if (yych <= ' ') { - if (yych == '\t') goto yy390; - if (yych <= 0x1F) goto yy308; - goto yy390; - } else { - if (yych <= '.') { - if (yych <= '-') goto yy308; - goto yy418; - } else { - if (yych <= '/') goto yy308; - if (yych <= '9') goto yy396; - goto yy418; - } - } - } else { - if (yych <= 'P') { - if (yych == 'A') goto yy392; - if (yych <= 'O') goto yy308; - goto yy392; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy308; - goto yy392; - } else { - if (yych == 'p') goto yy392; - goto yy308; - } - } - } -yy438: - YYDEBUG(438, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '1') { - if (yych <= '/') goto yy325; - if (yych <= '0') goto yy440; - goto yy441; - } else { - if (yych <= '2') goto yy442; - if (yych <= '5') goto yy443; - if (yych <= '9') goto yy444; - goto yy325; - } -yy439: - YYDEBUG(439, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy330; - goto yy53; - } else { - if (yych <= '0') goto yy411; - if (yych <= '9') goto yy412; - if (yych <= ':') goto yy330; - goto yy53; - } -yy440: - YYDEBUG(440, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy457; - goto yy308; - } else { - if (yych <= '0') goto yy456; - if (yych <= '9') goto yy461; - if (yych <= ':') goto yy457; - goto yy308; - } -yy441: - YYDEBUG(441, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy445; - goto yy308; - } else { - if (yych <= '2') goto yy461; - if (yych <= '9') goto yy456; - if (yych <= ':') goto yy445; - goto yy308; - } -yy442: - YYDEBUG(442, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy445; - goto yy308; - } else { - if (yych <= '3') goto yy456; - if (yych <= '9') goto yy455; - if (yych <= ':') goto yy445; - goto yy308; - } -yy443: - YYDEBUG(443, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy445; - goto yy308; - } else { - if (yych <= '9') goto yy455; - if (yych <= ':') goto yy445; - goto yy308; - } -yy444: - YYDEBUG(444, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych != '.') goto yy308; - } else { - if (yych <= '9') goto yy370; - if (yych >= ';') goto yy308; - } -yy445: - YYDEBUG(445, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy446; - if (yych <= '6') goto yy447; - if (yych <= '9') goto yy373; - goto yy53; -yy446: - YYDEBUG(446, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy374; - goto yy332; - } else { - if (yych <= '9') goto yy448; - if (yych <= ':') goto yy374; - goto yy332; - } -yy447: - YYDEBUG(447, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy374; - goto yy332; - } else { - if (yych <= '0') goto yy338; - if (yych == ':') goto yy374; - goto yy332; - } -yy448: - YYDEBUG(448, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= ' ') { - if (yych == '\t') goto yy450; - if (yych <= 0x1F) goto yy332; - goto yy450; - } else { - if (yych <= '(') { - if (yych <= '\'') goto yy332; - goto yy450; - } else { - if (yych == '+') goto yy450; - goto yy332; - } - } - } else { - if (yych <= ':') { - if (yych <= '-') goto yy450; - if (yych <= '.') goto yy374; - if (yych <= '9') goto yy332; - goto yy374; - } else { - if (yych <= 'Z') { - if (yych <= '@') goto yy332; - goto yy450; - } else { - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy450; - goto yy332; - } - } - } -yy449: - YYDEBUG(449, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 8) YYFILL(8); - yych = *YYCURSOR; -yy450: - YYDEBUG(450, *YYCURSOR); - if (yych <= '-') { - if (yych <= '\'') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy53; - goto yy449; - } else { - if (yych == ' ') goto yy449; - goto yy53; - } - } else { - if (yych <= '*') { - if (yych <= '(') goto yy342; - goto yy53; - } else { - if (yych == ',') goto yy53; - goto yy341; - } - } - } else { - if (yych <= 'Z') { - if (yych <= 'A') { - if (yych <= '@') goto yy53; - } else { - if (yych != 'P') goto yy343; - } - } else { - if (yych <= 'o') { - if (yych <= '`') goto yy53; - if (yych <= 'a') goto yy452; - goto yy344; - } else { - if (yych <= 'p') goto yy452; - if (yych <= 'z') goto yy344; - goto yy53; - } - } - } - YYDEBUG(451, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'L') { - if (yych <= '-') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= '.') goto yy393; - if (yych <= '@') goto yy332; - goto yy345; - } - } else { - if (yych <= '`') { - if (yych <= 'M') goto yy453; - if (yych <= 'Z') goto yy345; - goto yy332; - } else { - if (yych == 'm') goto yy454; - if (yych <= 'z') goto yy350; - goto yy332; - } - } -yy452: - YYDEBUG(452, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'L') { - if (yych <= '-') { - if (yych == ')') goto yy337; - goto yy332; - } else { - if (yych <= '.') goto yy393; - if (yych <= '@') goto yy332; - goto yy345; - } - } else { - if (yych <= '`') { - if (yych <= 'M') goto yy453; - if (yych <= 'Z') goto yy345; - goto yy332; - } else { - if (yych == 'm') goto yy453; - if (yych <= 'z') goto yy345; - goto yy332; - } - } -yy453: - YYDEBUG(453, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ')') { - if (yych <= '\t') { - if (yych <= 0x00) goto yy385; - if (yych <= 0x08) goto yy332; - goto yy385; - } else { - if (yych == ' ') goto yy385; - if (yych <= '(') goto yy332; - goto yy337; - } - } else { - if (yych <= '@') { - if (yych == '.') goto yy395; - goto yy332; - } else { - if (yych <= 'Z') goto yy346; - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy346; - goto yy332; - } - } -yy454: - YYDEBUG(454, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '-') { - if (yych <= 0x1F) { - if (yych <= 0x00) goto yy385; - if (yych == '\t') goto yy385; - goto yy332; - } else { - if (yych <= ' ') goto yy385; - if (yych == ')') goto yy337; - goto yy332; - } - } else { - if (yych <= 'Z') { - if (yych <= '.') goto yy395; - if (yych <= '/') goto yy352; - if (yych <= '@') goto yy332; - goto yy346; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy332; - goto yy352; - } else { - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy351; - goto yy332; - } - } - } -yy455: - YYDEBUG(455, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy334; - goto yy308; - } else { - if (yych <= '9') goto yy396; - if (yych <= ':') goto yy334; - goto yy308; - } -yy456: - YYDEBUG(456, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych != '.') goto yy308; - } else { - if (yych <= '9') goto yy396; - if (yych >= ';') goto yy308; - } -yy457: - YYDEBUG(457, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy458; - if (yych <= '6') goto yy459; - if (yych <= '9') goto yy333; - goto yy53; -yy458: - YYDEBUG(458, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy334; - goto yy332; - } else { - if (yych <= '9') goto yy460; - if (yych <= ':') goto yy334; - goto yy332; - } -yy459: - YYDEBUG(459, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy334; - goto yy332; - } else { - if (yych <= '0') goto yy338; - if (yych == ':') goto yy334; - goto yy332; - } -yy460: - YYDEBUG(460, *YYCURSOR); - yyaccept = 8; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= ' ') { - if (yych == '\t') goto yy339; - if (yych <= 0x1F) goto yy332; - goto yy339; - } else { - if (yych <= '(') { - if (yych <= '\'') goto yy332; - goto yy342; - } else { - if (yych == '+') goto yy341; - goto yy332; - } - } - } else { - if (yych <= ':') { - if (yych <= '-') goto yy341; - if (yych <= '.') goto yy334; - if (yych <= '9') goto yy332; - goto yy334; - } else { - if (yych <= 'Z') { - if (yych <= '@') goto yy332; - goto yy343; - } else { - if (yych <= '`') goto yy332; - if (yych <= 'z') goto yy344; - goto yy332; - } - } - } -yy461: - YYDEBUG(461, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy445; - goto yy308; - } else { - if (yych <= '9') goto yy396; - if (yych <= ':') goto yy445; - goto yy308; - } -yy462: - YYDEBUG(462, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '/') { - if (yych == '.') goto yy407; - goto yy325; - } else { - if (yych <= '0') goto yy439; - if (yych <= '1') goto yy409; - if (yych <= '2') goto yy410; - goto yy404; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy371; - if (yych == 'n') goto yy321; - goto yy325; - } else { - if (yych <= 'r') goto yy322; - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy463: - YYDEBUG(463, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '/') { - if (yych == '.') goto yy407; - goto yy325; - } else { - if (yych <= '0') goto yy439; - if (yych <= '1') goto yy409; - if (yych <= '2') goto yy410; - goto yy404; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy371; - if (yych == 'n') goto yy321; - goto yy325; - } else { - if (yych <= 'r') goto yy322; - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy464: - YYDEBUG(464, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '1') { - if (yych <= '/') goto yy325; - if (yych <= '0') goto yy467; - goto yy468; - } else { - if (yych <= '2') goto yy475; - if (yych <= '9') goto yy476; - goto yy325; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy321; - if (yych <= 'q') goto yy325; - goto yy322; - } else { - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy465: - YYDEBUG(465, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '1') { - if (yych <= '/') goto yy325; - if (yych <= '0') goto yy467; - goto yy468; - } else { - if (yych <= '2') goto yy475; - if (yych <= '9') goto yy476; - goto yy325; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy321; - if (yych <= 'q') goto yy325; - goto yy322; - } else { - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy466: - YYDEBUG(466, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '1') { - if (yych <= '/') goto yy325; - if (yych >= '1') goto yy468; - } else { - if (yych <= '2') goto yy318; - if (yych <= '9') goto yy319; - goto yy325; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy321; - if (yych <= 'q') goto yy325; - goto yy322; - } else { - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy467: - YYDEBUG(467, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '/') { - if (yych <= ',') goto yy325; - if (yych <= '-') goto yy469; - if (yych <= '.') goto yy438; - goto yy325; - } else { - if (yych <= '0') goto yy439; - if (yych <= '1') goto yy409; - if (yych <= '2') goto yy410; - goto yy404; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy330; - if (yych == 'n') goto yy321; - goto yy325; - } else { - if (yych <= 'r') goto yy322; - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy468: - YYDEBUG(468, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '/') { - if (yych <= ',') goto yy325; - if (yych <= '-') goto yy469; - if (yych <= '.') goto yy407; - goto yy325; - } else { - if (yych <= '0') goto yy408; - if (yych <= '1') goto yy409; - if (yych <= '2') goto yy410; - goto yy404; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy371; - if (yych == 'n') goto yy321; - goto yy325; - } else { - if (yych <= 'r') goto yy322; - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy469: - YYDEBUG(469, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(470, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= '/') goto yy471; - if (yych <= '9') goto yy472; -yy471: - YYDEBUG(471, *YYCURSOR); -#line 1327 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("pgtextshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } -#line 7663 "ext/date/lib/parse_date.c" -yy472: - YYDEBUG(472, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy471; - if (yych >= ':') goto yy471; - YYDEBUG(473, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy471; - if (yych >= ':') goto yy471; - YYDEBUG(474, *YYCURSOR); - yych = *++YYCURSOR; - goto yy471; -yy475: - YYDEBUG(475, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '/') { - if (yych <= ',') goto yy325; - if (yych <= '-') goto yy469; - if (yych <= '.') goto yy407; - goto yy325; - } else { - if (yych <= '0') goto yy439; - if (yych <= '1') goto yy409; - if (yych <= '2') goto yy410; - goto yy404; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy371; - if (yych == 'n') goto yy321; - goto yy325; - } else { - if (yych <= 'r') goto yy322; - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy476: - YYDEBUG(476, *YYCURSOR); - yyaccept = 7; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '/') { - if (yych <= ',') goto yy325; - if (yych <= '-') goto yy469; - if (yych <= '.') goto yy407; - goto yy325; - } else { - if (yych <= '0') goto yy439; - if (yych <= '1') goto yy409; - if (yych <= '2') goto yy410; - goto yy404; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy371; - if (yych == 'n') goto yy321; - goto yy325; - } else { - if (yych <= 'r') goto yy322; - if (yych <= 's') goto yy320; - if (yych <= 't') goto yy323; - goto yy325; - } - } -yy477: - YYDEBUG(477, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'C') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'B') goto yy138; - goto yy302; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'c') goto yy478; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy478: - YYDEBUG(478, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'D') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'E') goto yy311; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 'd') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'e') goto yy479; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy479: - YYDEBUG(479, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'M') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'L') goto yy140; - goto yy312; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'm') goto yy480; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy480: - YYDEBUG(480, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'B') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy141; - goto yy313; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'b') goto yy481; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy481: - YYDEBUG(481, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'D') goto yy3; - goto yy314; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy482; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy482: - YYDEBUG(482, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy315; - if (yych != 'r') goto yy152; -yy483: - YYDEBUG(483, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy305; - goto yy303; - } else { - if (yych <= ' ') goto yy305; - if (yych <= ',') goto yy303; - goto yy305; - } - } else { - if (yych <= '^') { - if (yych <= '/') goto yy144; - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - if (yych <= 'z') goto yy151; - goto yy303; - } - } -yy484: - YYDEBUG(484, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy138; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 't') goto yy485; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy485: - YYDEBUG(485, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych != 'O') goto yy139; - } - } else { - if (yych <= 'n') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 'o') goto yy486; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy486: - YYDEBUG(486, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'B') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy140; - } - } else { - if (yych <= 'a') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'b') goto yy487; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy487: - YYDEBUG(487, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy141; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'e') goto yy488; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy488: - YYDEBUG(488, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Q') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'R') goto yy315; - if (yych == 'r') goto yy315; - goto yy3; - } -yy489: - YYDEBUG(489, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy138; - goto yy485; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy490; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy490: - YYDEBUG(490, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'N') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'O') goto yy486; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 'n') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'o') goto yy491; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy491: - YYDEBUG(491, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'B') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy140; - goto yy487; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'b') goto yy492; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy492: - YYDEBUG(492, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy141; - goto yy488; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy493; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy493: - YYDEBUG(493, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'Q') goto yy3; - goto yy315; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'r') goto yy483; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy494: - YYDEBUG(494, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'V') { - if (yych <= 'B') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'O') { - if (yych <= 'C') goto yy510; - goto yy138; - } else { - if (yych <= 'P') goto yy509; - if (yych <= 'U') goto yy138; - goto yy511; - } - } - } else { - if (yych <= 'o') { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - goto yy3; - } else { - if (yych == 'c') goto yy510; - goto yy138; - } - } else { - if (yych <= 'u') { - if (yych <= 'p') goto yy509; - goto yy138; - } else { - if (yych <= 'v') goto yy511; - if (yych <= 'z') goto yy138; - goto yy3; - } - } - } -yy495: - YYDEBUG(495, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy138; - goto yy504; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 't') goto yy504; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy496: - YYDEBUG(496, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'X') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'W') goto yy138; - goto yy502; - } - } else { - if (yych <= 'w') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'x') goto yy502; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy497: - YYDEBUG(497, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'n') goto yy498; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy498: - YYDEBUG(498, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy276; - goto yy136; - } else { - if (yych <= '@') goto yy276; - if (yych <= 'C') goto yy139; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy276; - goto yy139; - } else { - if (yych <= 'd') goto yy499; - if (yych <= 'z') goto yy139; - goto yy276; - } - } -yy499: - YYDEBUG(499, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - goto yy3; - } else { - if (yych <= 'a') goto yy500; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy500: - YYDEBUG(500, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'X') goto yy141; - } - } else { - if (yych <= 'x') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'y') goto yy501; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy501: - YYDEBUG(501, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == ')') goto yy136; - goto yy276; -yy502: - YYDEBUG(502, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 't') goto yy503; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy503: - YYDEBUG(503, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'H') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy263; - } - } else { - if (yych <= 'g') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'h') goto yy263; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy504: - YYDEBUG(504, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= ')') { - if (yych <= '(') goto yy276; - goto yy136; - } else { - if (yych <= '@') goto yy276; - if (yych <= 'T') goto yy139; - } - } else { - if (yych <= 't') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy276; - goto yy139; - } else { - if (yych <= 'u') goto yy505; - if (yych <= 'z') goto yy139; - goto yy276; - } - } -yy505: - YYDEBUG(505, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy140; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'r') goto yy506; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy506: - YYDEBUG(506, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy141; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'd') goto yy507; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy507: - YYDEBUG(507, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'A') goto yy508; - if (yych != 'a') goto yy3; - } -yy508: - YYDEBUG(508, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy282; - if (yych == 'y') goto yy282; - goto yy53; -yy509: - YYDEBUG(509, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych == 'T') goto yy518; - goto yy139; - } - } else { - if (yych <= 's') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 't') goto yy518; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy510: - YYDEBUG(510, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'N') goto yy139; - goto yy515; - } - } else { - if (yych <= 'n') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'o') goto yy515; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy511: - YYDEBUG(511, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy139; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'e') goto yy512; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy512: - YYDEBUG(512, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy140; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'n') goto yy513; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy513: - YYDEBUG(513, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy141; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 't') goto yy514; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy514: - YYDEBUG(514, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'G') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'H') goto yy160; - if (yych == 'h') goto yy160; - goto yy3; - } -yy515: - YYDEBUG(515, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy140; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'n') goto yy516; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy516: - YYDEBUG(516, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy141; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'd') goto yy517; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy517: - YYDEBUG(517, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x1F) { - if (yych == '\t') goto yy161; - goto yy3; - } else { - if (yych <= ' ') goto yy161; - if (yych == ')') goto yy136; - goto yy3; - } -yy518: - YYDEBUG(518, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych != 'E') goto yy140; - } - } else { - if (yych <= 'd') { - if (yych <= '`') goto yy303; - goto yy140; - } else { - if (yych <= 'e') goto yy519; - if (yych <= 'z') goto yy140; - goto yy303; - } - } - } -yy519: - YYDEBUG(519, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'M') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'L') goto yy141; - } - } else { - if (yych <= 'l') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'm') goto yy520; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy520: - YYDEBUG(520, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'B') goto yy521; - if (yych != 'b') goto yy3; - } -yy521: - YYDEBUG(521, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy522; - if (yych != 'e') goto yy53; -yy522: - YYDEBUG(522, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy315; - if (yych == 'r') goto yy315; - goto yy53; -yy523: - YYDEBUG(523, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych == '/') goto yy144; - goto yy3; - } - } else { - if (yych <= 'O') { - if (yych == 'C') goto yy510; - goto yy138; - } else { - if (yych <= 'P') goto yy509; - if (yych <= 'U') goto yy138; - goto yy511; - } - } - } else { - if (yych <= 'c') { - if (yych <= '_') { - if (yych <= 'Z') goto yy138; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'b') goto yy143; - goto yy539; - } - } else { - if (yych <= 'u') { - if (yych == 'p') goto yy538; - goto yy143; - } else { - if (yych <= 'v') goto yy540; - if (yych <= 'z') goto yy143; - goto yy3; - } - } - } -yy524: - YYDEBUG(524, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy138; - goto yy504; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy533; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy525: - YYDEBUG(525, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'X') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'W') goto yy138; - goto yy502; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'x') goto yy531; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy526: - YYDEBUG(526, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - goto yy498; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy527; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy527: - YYDEBUG(527, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy276; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy276; - if (yych <= 'C') goto yy139; - goto yy499; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy276; - } else { - if (yych == 'd') goto yy528; - if (yych <= 'z') goto yy148; - goto yy276; - } - } -yy528: - YYDEBUG(528, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy500; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy140; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy529; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy529: - YYDEBUG(529, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Y') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'X') goto yy141; - goto yy501; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'y') goto yy530; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy530: - YYDEBUG(530, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == ')') goto yy136; - if (yych <= '.') goto yy276; - goto yy144; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy276; - goto yy144; - } else { - if (yych <= '`') goto yy276; - if (yych <= 'z') goto yy151; - goto yy276; - } - } -yy531: - YYDEBUG(531, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - goto yy503; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy532; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy532: - YYDEBUG(532, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy263; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy273; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy533: - YYDEBUG(533, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'U') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy276; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy276; - if (yych <= 'T') goto yy139; - goto yy505; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy276; - } else { - if (yych == 'u') goto yy534; - if (yych <= 'z') goto yy148; - goto yy276; - } - } -yy534: - YYDEBUG(534, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy140; - goto yy506; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'r') goto yy535; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy535: - YYDEBUG(535, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy141; - goto yy507; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'd') goto yy536; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy536: - YYDEBUG(536, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy508; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych <= 'a') goto yy537; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy537: - YYDEBUG(537, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy282; - if (yych == 'y') goto yy295; - goto yy152; -yy538: - YYDEBUG(538, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'S') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'T') goto yy518; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 's') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 't') goto yy547; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy539: - YYDEBUG(539, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'O') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'N') goto yy139; - goto yy515; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'o') goto yy544; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy540: - YYDEBUG(540, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy139; - goto yy512; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy541; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy541: - YYDEBUG(541, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy140; - goto yy513; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy542; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy542: - YYDEBUG(542, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy141; - goto yy514; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy543; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy543: - YYDEBUG(543, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'G') goto yy3; - goto yy160; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy247; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy544: - YYDEBUG(544, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy140; - goto yy516; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy545; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy545: - YYDEBUG(545, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy141; - goto yy517; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'd') goto yy546; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy546: - YYDEBUG(546, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ')') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy161; - goto yy3; - } else { - if (yych <= ' ') goto yy161; - if (yych <= '(') goto yy3; - goto yy136; - } - } else { - if (yych <= '^') { - if (yych == '/') goto yy144; - goto yy3; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy547: - YYDEBUG(547, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'D') { - if (yych <= '@') goto yy303; - goto yy140; - } else { - if (yych <= 'E') goto yy519; - if (yych <= 'Z') goto yy140; - goto yy303; - } - } else { - if (yych <= 'd') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy149; - } else { - if (yych <= 'e') goto yy548; - if (yych <= 'z') goto yy149; - goto yy303; - } - } - } -yy548: - YYDEBUG(548, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'M') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'L') goto yy141; - goto yy520; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'm') goto yy549; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy549: - YYDEBUG(549, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'B') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'A') goto yy3; - goto yy521; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'b') goto yy550; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy550: - YYDEBUG(550, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy522; - if (yych != 'e') goto yy152; - YYDEBUG(551, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy315; - if (yych == 'r') goto yy483; - goto yy152; -yy552: - YYDEBUG(552, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'G') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'F') goto yy138; - goto yy560; - } - } else { - if (yych <= 'f') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'g') goto yy560; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy553: - YYDEBUG(553, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy138; - goto yy557; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'r') goto yy557; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy554: - YYDEBUG(554, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'N') goto yy138; - } - } else { - if (yych <= 'n') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'o') goto yy555; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy555: - YYDEBUG(555, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= '@') { - if (yych == ')') goto yy136; - } else { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy556; - if (yych <= 'z') goto yy139; - } -yy556: - YYDEBUG(556, *YYCURSOR); -#line 1383 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("ago"); - TIMELIB_INIT; - s->time->relative.y = 0 - s->time->relative.y; - s->time->relative.m = 0 - s->time->relative.m; - s->time->relative.d = 0 - s->time->relative.d; - s->time->relative.h = 0 - s->time->relative.h; - s->time->relative.i = 0 - s->time->relative.i; - s->time->relative.s = 0 - s->time->relative.s; - s->time->relative.weekday = 0 - s->time->relative.weekday; - if (s->time->have_special_relative && s->time->special.type == TIMELIB_SPECIAL_WEEKDAY) { - s->time->special.amount = 0 - s->time->special.amount; - } - TIMELIB_DEINIT; - return TIMELIB_AGO; - } -#line 9561 "ext/date/lib/parse_date.c" -yy557: - YYDEBUG(557, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych != 'I') goto yy139; - } - } else { - if (yych <= 'h') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 'i') goto yy558; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy558: - YYDEBUG(558, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'L') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'K') goto yy140; - } - } else { - if (yych <= 'k') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'l') goto yy559; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy559: - YYDEBUG(559, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy305; - goto yy303; - } else { - if (yych <= ' ') goto yy305; - if (yych == ')') goto yy136; - goto yy303; - } - } else { - if (yych <= '@') { - if (yych == '/') goto yy303; - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy303; - if (yych <= 'z') goto yy141; - goto yy303; - } - } -yy560: - YYDEBUG(560, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych != 'U') goto yy139; - } - } else { - if (yych <= 't') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 'u') goto yy561; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy561: - YYDEBUG(561, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy140; - } - } else { - if (yych <= 'r') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 's') goto yy562; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy562: - YYDEBUG(562, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy141; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 't') goto yy563; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy563: - YYDEBUG(563, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '.') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy305; - } else { - if (yych <= '/') goto yy303; - if (yych <= '9') goto yy305; - goto yy303; - } - } -yy564: - YYDEBUG(564, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'G') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'F') goto yy138; - goto yy560; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'g') goto yy571; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy565: - YYDEBUG(565, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy138; - goto yy557; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'r') goto yy568; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy566: - YYDEBUG(566, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'O') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'N') goto yy138; - goto yy555; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'o') goto yy567; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy567: - YYDEBUG(567, *YYCURSOR); - yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy556; - goto yy136; - } else { - if (yych == '/') goto yy144; - goto yy556; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy139; - if (yych <= '^') goto yy556; - goto yy144; - } else { - if (yych <= '`') goto yy556; - if (yych <= 'z') goto yy148; - goto yy556; - } - } -yy568: - YYDEBUG(568, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'H') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'I') goto yy558; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 'h') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'i') goto yy569; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy569: - YYDEBUG(569, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'L') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'K') goto yy140; - goto yy559; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'l') goto yy570; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy570: - YYDEBUG(570, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy303; - goto yy305; - } else { - if (yych == ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy305; - } - } else { - if (yych <= 'Z') { - if (yych <= '/') goto yy144; - if (yych <= '9') goto yy305; - if (yych <= '@') goto yy303; - goto yy141; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy303; - goto yy144; - } else { - if (yych <= '`') goto yy303; - if (yych <= 'z') goto yy150; - goto yy303; - } - } - } -yy571: - YYDEBUG(571, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'T') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'U') goto yy561; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 't') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'u') goto yy572; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy572: - YYDEBUG(572, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy140; - goto yy562; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 's') goto yy573; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy573: - YYDEBUG(573, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy141; - goto yy563; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy574; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy574: - YYDEBUG(574, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy305; - goto yy303; - } else { - if (yych <= ' ') goto yy305; - if (yych == ')') goto yy136; - goto yy303; - } - } else { - if (yych <= '^') { - if (yych == '/') goto yy144; - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - if (yych <= 'z') goto yy151; - goto yy303; - } - } -yy575: - YYDEBUG(575, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'B') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy138; - goto yy589; - } - } else { - if (yych <= 'a') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'b') goto yy589; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy576: - YYDEBUG(576, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych == 'F') goto yy586; - if (yych <= 'Q') goto yy138; - goto yy585; - } - } else { - if (yych <= 'f') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - if (yych <= 'e') goto yy138; - goto yy586; - } else { - if (yych == 'r') goto yy585; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy577: - YYDEBUG(577, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'T') goto yy138; - goto yy582; - } - } else { - if (yych <= 't') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'u') goto yy582; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy578: - YYDEBUG(578, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'I') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'H') goto yy138; - } - } else { - if (yych <= 'h') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'i') goto yy579; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy579: - YYDEBUG(579, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy276; - goto yy136; - } else { - if (yych <= '@') goto yy276; - if (yych <= 'C') goto yy139; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy276; - goto yy139; - } else { - if (yych <= 'd') goto yy580; - if (yych <= 'z') goto yy139; - goto yy276; - } - } -yy580: - YYDEBUG(580, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - goto yy3; - } else { - if (yych <= 'a') goto yy581; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy581: - YYDEBUG(581, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'X') goto yy141; - goto yy501; - } - } else { - if (yych <= 'x') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'y') goto yy501; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy582: - YYDEBUG(582, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy139; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'r') goto yy583; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy583: - YYDEBUG(583, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy140; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 't') goto yy584; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy584: - YYDEBUG(584, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'H') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy141; - goto yy517; - } - } else { - if (yych <= 'g') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'h') goto yy517; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy585: - YYDEBUG(585, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy139; - goto yy588; - } - } else { - if (yych <= 'r') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 's') goto yy588; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy586: - YYDEBUG(586, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 't') goto yy587; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy587: - YYDEBUG(587, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'H') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy263; - } - } else { - if (yych <= 'g') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'h') goto yy263; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy588: - YYDEBUG(588, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy140; - goto yy263; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 't') goto yy263; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy589: - YYDEBUG(589, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych != 'R') goto yy139; - } - } else { - if (yych <= 'q') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 'r') goto yy590; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy590: - YYDEBUG(590, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'T') goto yy140; - } - } else { - if (yych <= 't') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'u') goto yy591; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy591: - YYDEBUG(591, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - goto yy3; - } else { - if (yych <= 'a') goto yy592; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy592: - YYDEBUG(592, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Q') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'R') goto yy593; - if (yych != 'r') goto yy3; - } -yy593: - YYDEBUG(593, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy315; - if (yych == 'y') goto yy315; - goto yy53; -yy594: - YYDEBUG(594, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'B') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy138; - goto yy589; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'b') goto yy608; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy595: - YYDEBUG(595, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '/') { - if (yych == ')') goto yy136; - if (yych <= '.') goto yy3; - goto yy144; - } else { - if (yych <= 'E') { - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'F') goto yy586; - if (yych <= 'Q') goto yy138; - goto yy585; - } - } - } else { - if (yych <= 'e') { - if (yych <= '^') { - if (yych <= 'Z') goto yy138; - goto yy3; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy3; - goto yy143; - } - } else { - if (yych <= 'q') { - if (yych <= 'f') goto yy605; - goto yy143; - } else { - if (yych <= 'r') goto yy604; - if (yych <= 'z') goto yy143; - goto yy3; - } - } - } -yy596: - YYDEBUG(596, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'U') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'T') goto yy138; - goto yy582; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'u') goto yy601; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy597: - YYDEBUG(597, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'I') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'H') goto yy138; - goto yy579; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'i') goto yy598; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy598: - YYDEBUG(598, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy276; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy276; - if (yych <= 'C') goto yy139; - goto yy580; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy276; - } else { - if (yych == 'd') goto yy599; - if (yych <= 'z') goto yy148; - goto yy276; - } - } -yy599: - YYDEBUG(599, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy581; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy140; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy600; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy600: - YYDEBUG(600, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Y') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'X') goto yy141; - goto yy501; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'y') goto yy530; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy601: - YYDEBUG(601, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy139; - goto yy583; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'r') goto yy602; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy602: - YYDEBUG(602, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy140; - goto yy584; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy603; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy603: - YYDEBUG(603, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy141; - goto yy517; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy546; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy604: - YYDEBUG(604, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy139; - goto yy588; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 's') goto yy607; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy605: - YYDEBUG(605, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - goto yy587; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy606; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy606: - YYDEBUG(606, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy263; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy273; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy607: - YYDEBUG(607, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy140; - goto yy263; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy273; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy608: - YYDEBUG(608, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'Q') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'R') goto yy590; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 'q') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'r') goto yy609; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy609: - YYDEBUG(609, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'U') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'T') goto yy140; - goto yy591; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'u') goto yy610; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy610: - YYDEBUG(610, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy592; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy141; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy611; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy611: - YYDEBUG(611, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'Q') goto yy3; - goto yy593; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'r') goto yy612; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy612: - YYDEBUG(612, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy315; - if (yych == 'y') goto yy483; - goto yy152; -yy613: - YYDEBUG(613, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych == 'L') goto yy620; - if (yych <= 'M') goto yy138; - goto yy619; - } - } else { - if (yych <= 'l') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - if (yych <= 'k') goto yy138; - goto yy620; - } else { - if (yych == 'n') goto yy619; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy614: - YYDEBUG(614, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'n') goto yy615; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy615: - YYDEBUG(615, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych != 'U') goto yy139; - } - } else { - if (yych <= 't') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 'u') goto yy616; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy616: - YYDEBUG(616, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - goto yy3; - } else { - if (yych <= 'a') goto yy617; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy617: - YYDEBUG(617, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy141; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'r') goto yy618; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy618: - YYDEBUG(618, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'X') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Y') goto yy315; - if (yych == 'y') goto yy315; - goto yy3; - } -yy619: - YYDEBUG(619, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych == 'E') goto yy621; - goto yy139; - } - } else { - if (yych <= 'd') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 'e') goto yy621; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy620: - YYDEBUG(620, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych != 'Y') goto yy139; - } - } else { - if (yych <= 'x') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 'y') goto yy621; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy621: - YYDEBUG(621, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy305; - goto yy303; - } else { - if (yych <= ' ') goto yy305; - if (yych == ')') goto yy136; - goto yy303; - } - } else { - if (yych <= '@') { - if (yych == '/') goto yy303; - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy303; - if (yych <= 'z') goto yy140; - goto yy303; - } - } -yy622: - YYDEBUG(622, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '/') { - if (yych == ')') goto yy136; - if (yych <= '.') goto yy3; - goto yy144; - } else { - if (yych <= 'K') { - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'L') goto yy620; - if (yych <= 'M') goto yy138; - goto yy619; - } - } - } else { - if (yych <= 'k') { - if (yych <= '^') { - if (yych <= 'Z') goto yy138; - goto yy3; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy3; - goto yy143; - } - } else { - if (yych <= 'm') { - if (yych <= 'l') goto yy629; - goto yy143; - } else { - if (yych <= 'n') goto yy628; - if (yych <= 'z') goto yy143; - goto yy3; - } - } - } -yy623: - YYDEBUG(623, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - goto yy615; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy624; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy624: - YYDEBUG(624, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'T') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'U') goto yy616; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 't') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'u') goto yy625; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy625: - YYDEBUG(625, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy617; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy140; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy626; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy626: - YYDEBUG(626, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy141; - goto yy618; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'r') goto yy627; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy627: - YYDEBUG(627, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Y') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'X') goto yy3; - goto yy315; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'y') goto yy483; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy628: - YYDEBUG(628, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'D') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'E') goto yy621; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 'd') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'e') goto yy630; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy629: - YYDEBUG(629, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'X') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'Y') goto yy621; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 'x') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'y') goto yy630; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy630: - YYDEBUG(630, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy303; - goto yy305; - } else { - if (yych == ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy305; - } - } else { - if (yych <= 'Z') { - if (yych <= '/') goto yy144; - if (yych <= '9') goto yy305; - if (yych <= '@') goto yy303; - goto yy140; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy303; - goto yy144; - } else { - if (yych <= '`') goto yy303; - if (yych <= 'z') goto yy149; - goto yy303; - } - } - } -yy631: - YYDEBUG(631, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy3; - goto yy305; - } else { - if (yych == ')') goto yy136; - if (yych <= ',') goto yy3; - goto yy305; - } - } else { - if (yych <= 'H') { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy305; - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'Z') { - if (yych >= 'J') goto yy138; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy138; - goto yy3; - } - } - } -yy632: - YYDEBUG(632, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy305; - goto yy3; - } else { - if (yych <= ' ') goto yy305; - if (yych == ')') goto yy136; - goto yy3; - } - } else { - if (yych <= '@') { - if (yych == '/') goto yy3; - if (yych <= '9') goto yy305; - goto yy3; - } else { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy633: - YYDEBUG(633, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy3; - goto yy305; - } else { - if (yych == ')') goto yy136; - if (yych <= ',') goto yy3; - goto yy305; - } - } else { - if (yych <= 'H') { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy305; - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'Z') { - if (yych >= 'J') goto yy138; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy138; - goto yy3; - } - } - } - YYDEBUG(634, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy3; - goto yy305; - } else { - if (yych == ')') goto yy136; - if (yych <= ',') goto yy3; - goto yy305; - } - } else { - if (yych <= 'H') { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy305; - if (yych <= '@') goto yy3; - goto yy139; - } else { - if (yych <= 'Z') { - if (yych >= 'J') goto yy139; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy139; - goto yy3; - } - } - } - YYDEBUG(635, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy305; - goto yy3; - } else { - if (yych <= ' ') goto yy305; - if (yych == ')') goto yy136; - goto yy3; - } - } else { - if (yych <= '@') { - if (yych == '/') goto yy3; - if (yych <= '9') goto yy305; - goto yy3; - } else { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy636: - YYDEBUG(636, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy305; - goto yy3; - } else { - if (yych <= ' ') goto yy305; - if (yych == ')') goto yy136; - goto yy3; - } - } else { - if (yych <= '@') { - if (yych == '/') goto yy3; - if (yych <= '9') goto yy305; - goto yy3; - } else { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy637: - YYDEBUG(637, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy3; - goto yy305; - } else { - if (yych == ')') goto yy136; - if (yych <= ',') goto yy3; - goto yy305; - } - } else { - if (yych <= 'H') { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy305; - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'Z') { - if (yych <= 'I') goto yy632; - goto yy138; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'z') goto yy138; - goto yy3; - } - } - } -yy638: - YYDEBUG(638, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy3; - goto yy57; - } else { - if (yych <= '9') { - if (yych <= '/') goto yy3; - goto yy660; - } else { - if (yych <= ':') goto yy645; - if (yych <= 'C') goto yy3; - goto yy57; - } - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy3; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy3; - goto yy57; - } else { - if (yych <= 'R') goto yy3; - if (yych <= 'T') goto yy57; - goto yy3; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy3; - if (yych <= 'Y') goto yy57; - goto yy3; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy3; - } else { - if (yych == 'g') goto yy3; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy3; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy3; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy3; - } - } - } - } -yy639: - YYDEBUG(639, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= ':') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy3; - goto yy57; - } else { - if (yych <= '3') { - if (yych <= '/') goto yy3; - goto yy660; - } else { - if (yych <= '5') goto yy643; - if (yych <= '9') goto yy644; - goto yy645; - } - } - } else { - if (yych <= 'G') { - if (yych <= 'D') { - if (yych <= 'C') goto yy3; - goto yy57; - } else { - if (yych == 'F') goto yy57; - goto yy3; - } - } else { - if (yych <= 'L') { - if (yych <= 'H') goto yy57; - goto yy3; - } else { - if (yych <= 'M') goto yy57; - if (yych <= 'R') goto yy3; - goto yy57; - } - } - } - } else { - if (yych <= 'g') { - if (yych <= 'Y') { - if (yych == 'W') goto yy57; - if (yych <= 'X') goto yy3; - goto yy57; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy3; - goto yy57; - } else { - if (yych == 'f') goto yy57; - goto yy3; - } - } - } else { - if (yych <= 't') { - if (yych <= 'l') { - if (yych <= 'h') goto yy57; - goto yy3; - } else { - if (yych <= 'm') goto yy57; - if (yych <= 'r') goto yy3; - goto yy57; - } - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy3; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy3; - } - } - } - } -yy640: - YYDEBUG(640, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= 'C') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy3; - goto yy57; - } else { - if (yych <= '5') { - if (yych <= '/') goto yy3; - goto yy643; - } else { - if (yych <= '9') goto yy644; - if (yych <= ':') goto yy645; - goto yy3; - } - } - } else { - if (yych <= 'G') { - if (yych == 'E') goto yy3; - if (yych <= 'F') goto yy57; - goto yy3; - } else { - if (yych <= 'L') { - if (yych <= 'H') goto yy57; - goto yy3; - } else { - if (yych <= 'M') goto yy57; - if (yych <= 'R') goto yy3; - goto yy57; - } - } - } - } else { - if (yych <= 'g') { - if (yych <= 'Y') { - if (yych == 'W') goto yy57; - if (yych <= 'X') goto yy3; - goto yy57; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy3; - goto yy57; - } else { - if (yych == 'f') goto yy57; - goto yy3; - } - } - } else { - if (yych <= 't') { - if (yych <= 'l') { - if (yych <= 'h') goto yy57; - goto yy3; - } else { - if (yych <= 'm') goto yy57; - if (yych <= 'r') goto yy3; - goto yy57; - } - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy3; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy3; - } - } - } - } -yy641: - YYDEBUG(641, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(642, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy54; - } - if (yych <= ',') { - if (yych == '+') goto yy641; - goto yy53; - } else { - if (yych <= '-') goto yy641; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy51; - goto yy53; - } -yy643: - YYDEBUG(643, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy3; - goto yy57; - } else { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy659; - if (yych <= 'C') goto yy3; - goto yy57; - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy3; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy3; - goto yy57; - } else { - if (yych <= 'R') goto yy3; - if (yych <= 'T') goto yy57; - goto yy3; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy3; - if (yych <= 'Y') goto yy57; - goto yy3; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy3; - } else { - if (yych == 'g') goto yy3; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy3; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy3; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy3; - } - } - } - } -yy644: - YYDEBUG(644, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy3; - goto yy57; - } else { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy647; - if (yych <= 'C') goto yy3; - goto yy57; - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy3; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy3; - goto yy57; - } else { - if (yych <= 'R') goto yy3; - if (yych <= 'T') goto yy57; - goto yy3; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy3; - if (yych <= 'Y') goto yy57; - goto yy3; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy3; - } else { - if (yych == 'g') goto yy3; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy3; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy3; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy3; - } - } - } - } -yy645: - YYDEBUG(645, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy3; - if (yych <= '5') goto yy646; - if (yych <= '9') goto yy136; - goto yy3; -yy646: - YYDEBUG(646, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy136; - goto yy3; -yy647: - YYDEBUG(647, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych >= ':') goto yy57; -yy648: - YYDEBUG(648, *YYCURSOR); - yych = *++YYCURSOR; - if (yybm[0+yych] & 4) { - goto yy51; - } - if (yych != '-') goto yy57; -yy649: - YYDEBUG(649, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy650; - if (yych <= '1') goto yy651; - goto yy53; -yy650: - YYDEBUG(650, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy652; - goto yy53; -yy651: - YYDEBUG(651, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '3') goto yy53; -yy652: - YYDEBUG(652, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '-') goto yy53; - YYDEBUG(653, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy654; - if (yych <= '2') goto yy655; - if (yych <= '3') goto yy656; - goto yy53; -yy654: - YYDEBUG(654, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy657; - goto yy53; -yy655: - YYDEBUG(655, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy657; - goto yy53; -yy656: - YYDEBUG(656, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '2') goto yy53; -yy657: - YYDEBUG(657, *YYCURSOR); - ++YYCURSOR; -yy658: - YYDEBUG(658, *YYCURSOR); -#line 1097 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } -#line 12167 "ext/date/lib/parse_date.c" -yy659: - YYDEBUG(659, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy3; - goto yy57; - } else { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy648; - if (yych <= 'C') goto yy3; - goto yy57; - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy3; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy3; - goto yy57; - } else { - if (yych <= 'R') goto yy3; - if (yych <= 'T') goto yy57; - goto yy3; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy3; - if (yych <= 'Y') goto yy57; - goto yy3; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy3; - } else { - if (yych == 'g') goto yy3; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy3; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy3; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy3; - } - } - } - } -yy660: - YYDEBUG(660, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= 'C') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy3; - goto yy57; - } else { - if (yych <= '5') { - if (yych <= '/') goto yy3; - } else { - if (yych <= '9') goto yy659; - if (yych <= ':') goto yy645; - goto yy3; - } - } - } else { - if (yych <= 'G') { - if (yych == 'E') goto yy3; - if (yych <= 'F') goto yy57; - goto yy3; - } else { - if (yych <= 'L') { - if (yych <= 'H') goto yy57; - goto yy3; - } else { - if (yych <= 'M') goto yy57; - if (yych <= 'R') goto yy3; - goto yy57; - } - } - } - } else { - if (yych <= 'g') { - if (yych <= 'Y') { - if (yych == 'W') goto yy57; - if (yych <= 'X') goto yy3; - goto yy57; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy3; - goto yy57; - } else { - if (yych == 'f') goto yy57; - goto yy3; - } - } - } else { - if (yych <= 't') { - if (yych <= 'l') { - if (yych <= 'h') goto yy57; - goto yy3; - } else { - if (yych <= 'm') goto yy57; - if (yych <= 'r') goto yy3; - goto yy57; - } - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy3; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy3; - } - } - } - } - YYDEBUG(661, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy3; - goto yy57; - } else { - if (yych <= '/') goto yy3; - if (yych <= '9') goto yy662; - if (yych <= 'C') goto yy3; - goto yy57; - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy3; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy3; - goto yy57; - } else { - if (yych <= 'R') goto yy3; - if (yych <= 'T') goto yy57; - goto yy3; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy3; - if (yych <= 'Y') goto yy57; - goto yy3; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy3; - } else { - if (yych == 'g') goto yy3; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy3; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy3; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy3; - } - } - } - } -yy662: - YYDEBUG(662, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy51; - } - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy3; - goto yy57; - } else { - if (yych == '-') goto yy649; - if (yych <= 'C') goto yy3; - goto yy57; - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy3; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy3; - goto yy57; - } else { - if (yych <= 'R') goto yy3; - if (yych <= 'T') goto yy57; - goto yy3; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy3; - if (yych <= 'Y') goto yy57; - goto yy3; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy3; - } else { - if (yych == 'g') goto yy3; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy3; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy3; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy3; - } - } - } - } -yy663: - YYDEBUG(663, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy665; - if (yych <= '0') goto yy919; - if (yych <= '1') goto yy920; - if (yych <= '9') goto yy921; - goto yy665; -yy664: - YYDEBUG(664, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 13) YYFILL(13); - yych = *YYCURSOR; -yy665: - YYDEBUG(665, *YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': - case ' ': goto yy664; - case '-': - case '.': goto yy764; - case 'A': - case 'a': goto yy683; - case 'D': - case 'd': goto yy669; - case 'F': - case 'f': goto yy670; - case 'H': - case 'h': goto yy60; - case 'I': goto yy678; - case 'J': - case 'j': goto yy682; - case 'M': - case 'm': goto yy668; - case 'N': - case 'n': goto yy685; - case 'O': - case 'o': goto yy684; - case 'P': - case 'p': goto yy687; - case 'S': - case 's': goto yy666; - case 'T': - case 't': goto yy65; - case 'V': goto yy680; - case 'W': - case 'w': goto yy62; - case 'X': goto yy681; - case 'Y': - case 'y': goto yy64; - default: goto yy53; - } -yy666: - YYDEBUG(666, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= 'D') { - if (yych == 'A') goto yy123; - goto yy53; - } else { - if (yych <= 'E') goto yy1229; - if (yych <= 'T') goto yy53; - goto yy122; - } - } else { - if (yych <= 'd') { - if (yych == 'a') goto yy123; - goto yy53; - } else { - if (yych <= 'e') goto yy1229; - if (yych == 'u') goto yy122; - goto yy53; - } - } -yy667: - YYDEBUG(667, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '`') { - if (yych <= 'D') { - if (yych == 'A') goto yy123; - goto yy53; - } else { - if (yych <= 'E') goto yy1229; - if (yych == 'U') goto yy122; - goto yy53; - } - } else { - if (yych <= 'e') { - if (yych <= 'a') goto yy123; - if (yych <= 'd') goto yy53; - goto yy1229; - } else { - if (yych <= 's') goto yy53; - if (yych <= 't') goto yy912; - if (yych <= 'u') goto yy122; - goto yy53; - } - } -yy668: - YYDEBUG(668, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= 'H') { - if (yych == 'A') goto yy779; - goto yy53; - } else { - if (yych <= 'I') goto yy114; - if (yych <= 'N') goto yy53; - goto yy113; - } - } else { - if (yych <= 'h') { - if (yych == 'a') goto yy779; - goto yy53; - } else { - if (yych <= 'i') goto yy114; - if (yych == 'o') goto yy113; - goto yy53; - } - } -yy669: - YYDEBUG(669, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych == 'A') goto yy110; - if (yych <= 'D') goto yy53; - goto yy766; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy53; - goto yy110; - } else { - if (yych == 'e') goto yy766; - goto yy53; - } - } -yy670: - YYDEBUG(670, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= 'N') { - if (yych == 'E') goto yy782; - goto yy53; - } else { - if (yych <= 'O') goto yy83; - if (yych <= 'Q') goto yy53; - goto yy82; - } - } else { - if (yych <= 'n') { - if (yych == 'e') goto yy782; - goto yy53; - } else { - if (yych <= 'o') goto yy83; - if (yych == 'r') goto yy82; - goto yy53; - } - } -yy671: - YYDEBUG(671, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'H') goto yy66; - if (yych <= 'T') goto yy53; - goto yy67; - } else { - if (yych <= 'h') { - if (yych <= 'g') goto yy53; - goto yy1228; - } else { - if (yych == 'u') goto yy67; - goto yy53; - } - } -yy672: - YYDEBUG(672, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '-') goto yy925; - if (yych <= '/') goto yy57; - if (yych <= '9') goto yy924; - goto yy57; -yy673: - YYDEBUG(673, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'c') { - if (yych == 'O') goto yy717; - goto yy53; - } else { - if (yych <= 'd') goto yy912; - if (yych == 'o') goto yy717; - goto yy53; - } -yy674: - YYDEBUG(674, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'd') goto yy912; - goto yy53; -yy675: - YYDEBUG(675, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case '0': - case '1': - case '2': goto yy852; - case '3': goto yy854; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy855; - case 'A': - case 'a': goto yy859; - case 'D': - case 'd': goto yy863; - case 'F': - case 'f': goto yy857; - case 'J': - case 'j': goto yy856; - case 'M': - case 'm': goto yy858; - case 'N': - case 'n': goto yy862; - case 'O': - case 'o': goto yy861; - case 'S': - case 's': goto yy860; - default: goto yy53; - } -yy676: - YYDEBUG(676, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case '0': goto yy802; - case '1': goto yy803; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy804; - case 'A': - case 'a': goto yy808; - case 'D': - case 'd': goto yy812; - case 'F': - case 'f': goto yy806; - case 'J': - case 'j': goto yy805; - case 'M': - case 'm': goto yy807; - case 'N': - case 'n': goto yy811; - case 'O': - case 'o': goto yy810; - case 'S': - case 's': goto yy809; - default: goto yy765; - } -yy677: - YYDEBUG(677, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '1') { - if (yych <= '/') goto yy765; - if (yych <= '0') goto yy755; - goto yy756; - } else { - if (yych <= '5') goto yy757; - if (yych <= '9') goto yy758; - goto yy765; - } -yy678: - YYDEBUG(678, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '.') goto yy719; - } - } else { - if (yych <= 'U') { - if (yych <= '9') goto yy721; - if (yych == 'I') goto yy754; - } else { - if (yych == 'W') goto yy679; - if (yych <= 'X') goto yy727; - } - } -yy679: - YYDEBUG(679, *YYCURSOR); -#line 1226 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("datenoyearrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - timelib_skip_day_suffix((char **) &ptr); - s->time->m = timelib_get_month((char **) &ptr); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } -#line 12738 "ext/date/lib/parse_date.c" -yy680: - YYDEBUG(680, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy679; - goto yy719; - } else { - if (yych == ' ') goto yy719; - goto yy679; - } - } else { - if (yych <= '9') { - if (yych <= '.') goto yy719; - if (yych <= '/') goto yy679; - goto yy721; - } else { - if (yych == 'I') goto yy752; - goto yy679; - } - } -yy681: - YYDEBUG(681, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy679; - goto yy719; - } else { - if (yych == ' ') goto yy719; - goto yy679; - } - } else { - if (yych <= '9') { - if (yych <= '.') goto yy719; - if (yych <= '/') goto yy679; - goto yy721; - } else { - if (yych == 'I') goto yy751; - goto yy679; - } - } -yy682: - YYDEBUG(682, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'A') goto yy744; - if (yych <= 'T') goto yy53; - goto yy743; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy53; - goto yy744; - } else { - if (yych == 'u') goto yy743; - goto yy53; - } - } -yy683: - YYDEBUG(683, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= 'L') { - if (yych == '.') goto yy688; - goto yy53; - } else { - if (yych <= 'M') goto yy689; - if (yych == 'P') goto yy737; - goto yy53; - } - } else { - if (yych <= 'o') { - if (yych <= 'U') goto yy736; - if (yych == 'm') goto yy689; - goto yy53; - } else { - if (yych <= 'p') goto yy737; - if (yych == 'u') goto yy736; - goto yy53; - } - } -yy684: - YYDEBUG(684, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy731; - if (yych == 'c') goto yy731; - goto yy53; -yy685: - YYDEBUG(685, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy717; - if (yych == 'o') goto yy717; - goto yy53; -yy686: - YYDEBUG(686, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy693; - if (yych <= '9') goto yy695; - goto yy53; -yy687: - YYDEBUG(687, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'L') { - if (yych != '.') goto yy53; - } else { - if (yych <= 'M') goto yy689; - if (yych == 'm') goto yy689; - goto yy53; - } -yy688: - YYDEBUG(688, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy689; - if (yych != 'm') goto yy53; -yy689: - YYDEBUG(689, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 0x1F) { - if (yych <= 0x00) goto yy691; - if (yych == '\t') goto yy691; - goto yy53; - } else { - if (yych <= ' ') goto yy691; - if (yych != '.') goto yy53; - } - YYDEBUG(690, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\t') { - if (yych <= 0x00) goto yy691; - if (yych <= 0x08) goto yy53; - } else { - if (yych != ' ') goto yy53; - } -yy691: - YYDEBUG(691, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(692, *YYCURSOR); -#line 973 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - } - } - s->time->h += timelib_meridian((char **) &ptr, s->time->h); - TIMELIB_DEINIT; - return TIMELIB_TIME12; - } -#line 12895 "ext/date/lib/parse_date.c" -yy693: - YYDEBUG(693, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy696; - } else { - if (yych <= '9') goto yy710; - if (yych <= ':') goto yy696; - } -yy694: - YYDEBUG(694, *YYCURSOR); -#line 990 "ext/date/lib/parse_date.re" - { - int tz_not_found; - DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - } - TIMELIB_DEINIT; - return TIMELIB_TIME24_WITH_ZONE; - } -#line 12933 "ext/date/lib/parse_date.c" -yy695: - YYDEBUG(695, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy696; - if (yych != ':') goto yy694; -yy696: - YYDEBUG(696, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy697; - if (yych <= '6') goto yy698; - if (yych <= '9') goto yy699; - goto yy53; -yy697: - YYDEBUG(697, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy700; - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy703; - goto yy694; -yy698: - YYDEBUG(698, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy700; - if (yych == '0') goto yy703; - goto yy694; -yy699: - YYDEBUG(699, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych != '.') goto yy694; -yy700: - YYDEBUG(700, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; -yy701: - YYDEBUG(701, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(702, *YYCURSOR); - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy701; - goto yy694; -yy703: - YYDEBUG(703, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= 0x1F) { - if (yych != '\t') goto yy694; - } else { - if (yych <= ' ') goto yy704; - if (yych == '.') goto yy700; - goto yy694; - } - } else { - if (yych <= '`') { - if (yych <= 'A') goto yy706; - if (yych == 'P') goto yy706; - goto yy694; - } else { - if (yych <= 'a') goto yy706; - if (yych == 'p') goto yy706; - goto yy694; - } - } -yy704: - YYDEBUG(704, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); - yych = *YYCURSOR; - YYDEBUG(705, *YYCURSOR); - if (yych <= 'A') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy704; - goto yy53; - } else { - if (yych <= ' ') goto yy704; - if (yych <= '@') goto yy53; - } - } else { - if (yych <= '`') { - if (yych != 'P') goto yy53; - } else { - if (yych <= 'a') goto yy706; - if (yych != 'p') goto yy53; - } - } -yy706: - YYDEBUG(706, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'L') { - if (yych != '.') goto yy53; - } else { - if (yych <= 'M') goto yy708; - if (yych == 'm') goto yy708; - goto yy53; - } - YYDEBUG(707, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy708; - if (yych != 'm') goto yy53; -yy708: - YYDEBUG(708, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 0x1F) { - if (yych <= 0x00) goto yy691; - if (yych == '\t') goto yy691; - goto yy53; - } else { - if (yych <= ' ') goto yy691; - if (yych != '.') goto yy53; - } - YYDEBUG(709, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\t') { - if (yych <= 0x00) goto yy691; - if (yych <= 0x08) goto yy53; - goto yy691; - } else { - if (yych == ' ') goto yy691; - goto yy53; - } -yy710: - YYDEBUG(710, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ':') { - if (yych <= ' ') { - if (yych == '\t') goto yy711; - if (yych <= 0x1F) goto yy694; - } else { - if (yych == '.') goto yy696; - if (yych <= '9') goto yy694; - goto yy696; - } - } else { - if (yych <= 'P') { - if (yych == 'A') goto yy713; - if (yych <= 'O') goto yy694; - goto yy713; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy694; - goto yy713; - } else { - if (yych == 'p') goto yy713; - goto yy694; - } - } - } -yy711: - YYDEBUG(711, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); - yych = *YYCURSOR; - YYDEBUG(712, *YYCURSOR); - if (yych <= 'A') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy711; - goto yy53; - } else { - if (yych <= ' ') goto yy711; - if (yych <= '@') goto yy53; - } - } else { - if (yych <= '`') { - if (yych != 'P') goto yy53; - } else { - if (yych <= 'a') goto yy713; - if (yych != 'p') goto yy53; - } - } -yy713: - YYDEBUG(713, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'L') { - if (yych != '.') goto yy53; - } else { - if (yych <= 'M') goto yy715; - if (yych == 'm') goto yy715; - goto yy53; - } - YYDEBUG(714, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy715; - if (yych != 'm') goto yy53; -yy715: - YYDEBUG(715, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 0x1F) { - if (yych <= 0x00) goto yy691; - if (yych == '\t') goto yy691; - goto yy53; - } else { - if (yych <= ' ') goto yy691; - if (yych != '.') goto yy53; - } - YYDEBUG(716, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\t') { - if (yych <= 0x00) goto yy691; - if (yych <= 0x08) goto yy53; - goto yy691; - } else { - if (yych == ' ') goto yy691; - goto yy53; - } -yy717: - YYDEBUG(717, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'V') goto yy718; - if (yych != 'v') goto yy53; -yy718: - YYDEBUG(718, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych != '\t') goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - } - } else { - if (yych <= 'D') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'E') goto yy723; - if (yych == 'e') goto yy723; - goto yy679; - } - } -yy719: - YYDEBUG(719, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; -yy720: - YYDEBUG(720, *YYCURSOR); - if (yych <= ' ') { - if (yych == '\t') goto yy719; - if (yych <= 0x1F) goto yy53; - goto yy719; - } else { - if (yych <= '.') { - if (yych <= ',') goto yy53; - goto yy719; - } else { - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - } - } -yy721: - YYDEBUG(721, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= '/') goto yy722; - if (yych <= '9') goto yy728; -yy722: - YYDEBUG(722, *YYCURSOR); -#line 1148 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("datefull"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - timelib_skip_day_suffix((char **) &ptr); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL; - } -#line 13214 "ext/date/lib/parse_date.c" -yy723: - YYDEBUG(723, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy724; - if (yych != 'm') goto yy53; -yy724: - YYDEBUG(724, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy725; - if (yych != 'b') goto yy53; -yy725: - YYDEBUG(725, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy726; - if (yych != 'e') goto yy53; -yy726: - YYDEBUG(726, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy727; - if (yych != 'r') goto yy53; -yy727: - YYDEBUG(727, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ' ') { - if (yych == '\t') goto yy719; - if (yych <= 0x1F) goto yy679; - goto yy719; - } else { - if (yych <= '.') { - if (yych <= ',') goto yy679; - goto yy719; - } else { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } - } -yy728: - YYDEBUG(728, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy722; - if (yych >= ':') goto yy722; -yy729: - YYDEBUG(729, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy722; - if (yych >= ':') goto yy722; - YYDEBUG(730, *YYCURSOR); - yych = *++YYCURSOR; - goto yy722; -yy731: - YYDEBUG(731, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy732; - if (yych != 't') goto yy53; -yy732: - YYDEBUG(732, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'N') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'O') goto yy733; - if (yych != 'o') goto yy679; - } - } -yy733: - YYDEBUG(733, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy734; - if (yych != 'b') goto yy53; -yy734: - YYDEBUG(734, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy735; - if (yych != 'e') goto yy53; -yy735: - YYDEBUG(735, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy727; - if (yych == 'r') goto yy727; - goto yy53; -yy736: - YYDEBUG(736, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy740; - if (yych == 'g') goto yy740; - goto yy53; -yy737: - YYDEBUG(737, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy738; - if (yych != 'r') goto yy53; -yy738: - YYDEBUG(738, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'H') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'I') goto yy739; - if (yych != 'i') goto yy679; - } - } -yy739: - YYDEBUG(739, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy727; - if (yych == 'l') goto yy727; - goto yy53; -yy740: - YYDEBUG(740, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'T') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'U') goto yy741; - if (yych != 'u') goto yy679; - } - } -yy741: - YYDEBUG(741, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy742; - if (yych != 's') goto yy53; -yy742: - YYDEBUG(742, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy727; - if (yych == 't') goto yy727; - goto yy53; -yy743: - YYDEBUG(743, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych == 'L') goto yy750; - if (yych <= 'M') goto yy53; - goto yy749; - } else { - if (yych <= 'l') { - if (yych <= 'k') goto yy53; - goto yy750; - } else { - if (yych == 'n') goto yy749; - goto yy53; - } - } -yy744: - YYDEBUG(744, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy745; - if (yych != 'n') goto yy53; -yy745: - YYDEBUG(745, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'T') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'U') goto yy746; - if (yych != 'u') goto yy679; - } - } -yy746: - YYDEBUG(746, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy747; - if (yych != 'a') goto yy53; -yy747: - YYDEBUG(747, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy748; - if (yych != 'r') goto yy53; -yy748: - YYDEBUG(748, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy727; - if (yych == 'y') goto yy727; - goto yy53; -yy749: - YYDEBUG(749, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'D') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'E') goto yy727; - if (yych == 'e') goto yy727; - goto yy679; - } - } -yy750: - YYDEBUG(750, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'X') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'Y') goto yy727; - if (yych == 'y') goto yy727; - goto yy679; - } - } -yy751: - YYDEBUG(751, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy679; - goto yy719; - } else { - if (yych == ' ') goto yy719; - goto yy679; - } - } else { - if (yych <= '9') { - if (yych <= '.') goto yy719; - if (yych <= '/') goto yy679; - goto yy721; - } else { - if (yych == 'I') goto yy727; - goto yy679; - } - } -yy752: - YYDEBUG(752, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy679; - goto yy719; - } else { - if (yych == ' ') goto yy719; - goto yy679; - } - } else { - if (yych <= '9') { - if (yych <= '.') goto yy719; - if (yych <= '/') goto yy679; - goto yy721; - } else { - if (yych != 'I') goto yy679; - } - } - YYDEBUG(753, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy679; - goto yy719; - } else { - if (yych == ' ') goto yy719; - goto yy679; - } - } else { - if (yych <= '9') { - if (yych <= '.') goto yy719; - if (yych <= '/') goto yy679; - goto yy721; - } else { - if (yych == 'I') goto yy727; - goto yy679; - } - } -yy754: - YYDEBUG(754, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy679; - goto yy719; - } else { - if (yych == ' ') goto yy719; - goto yy679; - } - } else { - if (yych <= '9') { - if (yych <= '.') goto yy719; - if (yych <= '/') goto yy679; - goto yy721; - } else { - if (yych == 'I') goto yy727; - goto yy679; - } - } -yy755: - YYDEBUG(755, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ',') goto yy694; - if (yych <= '-') goto yy789; - goto yy788; - } else { - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy801; - if (yych <= ':') goto yy696; - goto yy694; - } -yy756: - YYDEBUG(756, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= ',') goto yy694; - if (yych <= '-') goto yy789; - if (yych <= '.') goto yy788; - goto yy694; - } else { - if (yych <= '2') goto yy801; - if (yych <= '9') goto yy710; - if (yych <= ':') goto yy696; - goto yy694; - } -yy757: - YYDEBUG(757, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ',') goto yy694; - if (yych <= '-') goto yy789; - goto yy788; - } else { - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy710; - if (yych <= ':') goto yy696; - goto yy694; - } -yy758: - YYDEBUG(758, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ',') goto yy694; - if (yych <= '-') goto yy789; - goto yy788; - } else { - if (yych == ':') goto yy696; - goto yy694; - } -yy759: - YYDEBUG(759, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy782; - if (yych == 'e') goto yy782; - goto yy53; -yy760: - YYDEBUG(760, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy779; - if (yych == 'a') goto yy779; - goto yy53; -yy761: - YYDEBUG(761, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'P') goto yy737; - if (yych <= 'T') goto yy53; - goto yy736; - } else { - if (yych <= 'p') { - if (yych <= 'o') goto yy53; - goto yy737; - } else { - if (yych == 'u') goto yy736; - goto yy53; - } - } -yy762: - YYDEBUG(762, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy772; - if (yych == 'e') goto yy772; - goto yy53; -yy763: - YYDEBUG(763, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy766; - if (yych == 'e') goto yy766; - goto yy53; -yy764: - YYDEBUG(764, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 13) YYFILL(13); - yych = *YYCURSOR; -yy765: - YYDEBUG(765, *YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': - case ' ': - case '-': - case '.': goto yy764; - case 'A': - case 'a': goto yy761; - case 'D': - case 'd': goto yy763; - case 'F': - case 'f': goto yy759; - case 'I': goto yy678; - case 'J': - case 'j': goto yy682; - case 'M': - case 'm': goto yy760; - case 'N': - case 'n': goto yy685; - case 'O': - case 'o': goto yy684; - case 'S': - case 's': goto yy762; - case 'V': goto yy680; - case 'X': goto yy681; - default: goto yy53; - } -yy766: - YYDEBUG(766, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy767; - if (yych != 'c') goto yy53; -yy767: - YYDEBUG(767, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'D') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'E') goto yy768; - if (yych != 'e') goto yy679; - } - } -yy768: - YYDEBUG(768, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy769; - if (yych != 'm') goto yy53; -yy769: - YYDEBUG(769, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy770; - if (yych != 'b') goto yy53; -yy770: - YYDEBUG(770, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy771; - if (yych != 'e') goto yy53; -yy771: - YYDEBUG(771, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy727; - if (yych == 'r') goto yy727; - goto yy53; -yy772: - YYDEBUG(772, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy773; - if (yych != 'p') goto yy53; -yy773: - YYDEBUG(773, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'S') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'T') goto yy774; - if (yych != 't') goto yy679; - } - } -yy774: - YYDEBUG(774, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'D') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'E') goto yy775; - if (yych != 'e') goto yy679; - } - } -yy775: - YYDEBUG(775, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy776; - if (yych != 'm') goto yy53; -yy776: - YYDEBUG(776, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy777; - if (yych != 'b') goto yy53; -yy777: - YYDEBUG(777, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy778; - if (yych != 'e') goto yy53; -yy778: - YYDEBUG(778, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy727; - if (yych == 'r') goto yy727; - goto yy53; -yy779: - YYDEBUG(779, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych == 'R') goto yy780; - if (yych <= 'X') goto yy53; - goto yy727; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy53; - } else { - if (yych == 'y') goto yy727; - goto yy53; - } - } -yy780: - YYDEBUG(780, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'B') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'C') goto yy781; - if (yych != 'c') goto yy679; - } - } -yy781: - YYDEBUG(781, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy727; - if (yych == 'h') goto yy727; - goto yy53; -yy782: - YYDEBUG(782, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy783; - if (yych != 'b') goto yy53; -yy783: - YYDEBUG(783, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - goto yy719; - } - } else { - if (yych <= 'Q') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'R') goto yy784; - if (yych != 'r') goto yy679; - } - } -yy784: - YYDEBUG(784, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy785; - if (yych != 'u') goto yy53; -yy785: - YYDEBUG(785, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy786; - if (yych != 'a') goto yy53; -yy786: - YYDEBUG(786, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy787; - if (yych != 'r') goto yy53; -yy787: - YYDEBUG(787, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy727; - if (yych == 'y') goto yy727; - goto yy53; -yy788: - YYDEBUG(788, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy795; - if (yych <= '6') goto yy796; - if (yych <= '9') goto yy797; - goto yy53; -yy789: - YYDEBUG(789, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(790, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; -yy791: - YYDEBUG(791, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; -yy792: - YYDEBUG(792, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(793, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(794, *YYCURSOR); -#line 1162 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("pointed date YYYY"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL_POINTED; - } -#line 13962 "ext/date/lib/parse_date.c" -yy795: - YYDEBUG(795, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy700; - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy800; - goto yy694; -yy796: - YYDEBUG(796, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy700; - goto yy694; - } else { - if (yych <= '0') goto yy800; - if (yych <= '9') goto yy798; - goto yy694; - } -yy797: - YYDEBUG(797, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy700; - if (yych <= '/') goto yy694; - if (yych >= ':') goto yy694; -yy798: - YYDEBUG(798, *YYCURSOR); - yyaccept = 13; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy799; - if (yych <= '9') goto yy792; -yy799: - YYDEBUG(799, *YYCURSOR); -#line 1174 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("pointed date YY"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL_POINTED; - } -#line 14010 "ext/date/lib/parse_date.c" -yy800: - YYDEBUG(800, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= ' ') { - if (yych == '\t') goto yy704; - if (yych <= 0x1F) goto yy694; - goto yy704; - } else { - if (yych == '.') goto yy700; - if (yych <= '/') goto yy694; - goto yy792; - } - } else { - if (yych <= 'P') { - if (yych == 'A') goto yy706; - if (yych <= 'O') goto yy694; - goto yy706; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy694; - goto yy706; - } else { - if (yych == 'p') goto yy706; - goto yy694; - } - } - } -yy801: - YYDEBUG(801, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ':') { - if (yych <= ' ') { - if (yych == '\t') goto yy711; - if (yych <= 0x1F) goto yy694; - goto yy711; - } else { - if (yych <= '-') { - if (yych <= ',') goto yy694; - goto yy789; - } else { - if (yych <= '.') goto yy788; - if (yych <= '9') goto yy694; - goto yy696; - } - } - } else { - if (yych <= 'P') { - if (yych == 'A') goto yy713; - if (yych <= 'O') goto yy694; - goto yy713; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy694; - goto yy713; - } else { - if (yych == 'p') goto yy713; - goto yy694; - } - } - } -yy802: - YYDEBUG(802, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') { - if (yych <= ',') goto yy53; - if (yych <= '-') goto yy841; - goto yy789; - } else { - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy804; - goto yy53; - } -yy803: - YYDEBUG(803, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') { - if (yych <= ',') goto yy53; - if (yych <= '-') goto yy841; - goto yy789; - } else { - if (yych <= '/') goto yy53; - if (yych >= '3') goto yy53; - } -yy804: - YYDEBUG(804, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= ',') goto yy53; - if (yych <= '-') goto yy841; - if (yych <= '.') goto yy789; - goto yy53; -yy805: - YYDEBUG(805, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'A') goto yy837; - if (yych <= 'T') goto yy53; - goto yy836; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy53; - goto yy837; - } else { - if (yych == 'u') goto yy836; - goto yy53; - } - } -yy806: - YYDEBUG(806, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy834; - if (yych == 'e') goto yy834; - goto yy53; -yy807: - YYDEBUG(807, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy831; - if (yych == 'a') goto yy831; - goto yy53; -yy808: - YYDEBUG(808, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'P') goto yy828; - if (yych <= 'T') goto yy53; - goto yy827; - } else { - if (yych <= 'p') { - if (yych <= 'o') goto yy53; - goto yy828; - } else { - if (yych == 'u') goto yy827; - goto yy53; - } - } -yy809: - YYDEBUG(809, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy824; - if (yych == 'e') goto yy824; - goto yy53; -yy810: - YYDEBUG(810, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy822; - if (yych == 'c') goto yy822; - goto yy53; -yy811: - YYDEBUG(811, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy820; - if (yych == 'o') goto yy820; - goto yy53; -yy812: - YYDEBUG(812, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy813; - if (yych != 'e') goto yy53; -yy813: - YYDEBUG(813, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy814; - if (yych != 'c') goto yy53; -yy814: - YYDEBUG(814, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych >= '.') goto yy719; - } - } else { - if (yych <= 'D') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'E') goto yy768; - if (yych == 'e') goto yy768; - goto yy679; - } - } -yy815: - YYDEBUG(815, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy720; - if (yych <= '0') goto yy816; - if (yych <= '2') goto yy817; - if (yych <= '3') goto yy818; - goto yy720; -yy816: - YYDEBUG(816, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy722; - if (yych <= '9') goto yy819; - goto yy722; -yy817: - YYDEBUG(817, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy722; - if (yych <= '9') goto yy819; - goto yy722; -yy818: - YYDEBUG(818, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy722; - if (yych <= '1') goto yy819; - if (yych <= '9') goto yy728; - goto yy722; -yy819: - YYDEBUG(819, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy722; - if (yych <= '9') goto yy729; - goto yy722; -yy820: - YYDEBUG(820, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'V') goto yy821; - if (yych != 'v') goto yy53; -yy821: - YYDEBUG(821, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'D') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'E') goto yy723; - if (yych == 'e') goto yy723; - goto yy679; - } - } -yy822: - YYDEBUG(822, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy823; - if (yych != 't') goto yy53; -yy823: - YYDEBUG(823, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'N') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'O') goto yy733; - if (yych == 'o') goto yy733; - goto yy679; - } - } -yy824: - YYDEBUG(824, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy825; - if (yych != 'p') goto yy53; -yy825: - YYDEBUG(825, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'S') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'T') goto yy826; - if (yych != 't') goto yy679; - } - } -yy826: - YYDEBUG(826, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'D') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'E') goto yy775; - if (yych == 'e') goto yy775; - goto yy679; - } - } -yy827: - YYDEBUG(827, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy830; - if (yych == 'g') goto yy830; - goto yy53; -yy828: - YYDEBUG(828, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy829; - if (yych != 'r') goto yy53; -yy829: - YYDEBUG(829, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'H') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'I') goto yy739; - if (yych == 'i') goto yy739; - goto yy679; - } - } -yy830: - YYDEBUG(830, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'T') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'U') goto yy741; - if (yych == 'u') goto yy741; - goto yy679; - } - } -yy831: - YYDEBUG(831, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych == 'R') goto yy832; - if (yych <= 'X') goto yy53; - goto yy833; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy53; - } else { - if (yych == 'y') goto yy833; - goto yy53; - } - } -yy832: - YYDEBUG(832, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'B') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'C') goto yy781; - if (yych == 'c') goto yy781; - goto yy679; - } - } -yy833: - YYDEBUG(833, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ',') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy679; - goto yy719; - } else { - if (yych == ' ') goto yy719; - goto yy679; - } - } else { - if (yych <= '.') { - if (yych <= '-') goto yy815; - goto yy719; - } else { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } - } -yy834: - YYDEBUG(834, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy835; - if (yych != 'b') goto yy53; -yy835: - YYDEBUG(835, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'Q') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'R') goto yy784; - if (yych == 'r') goto yy784; - goto yy679; - } - } -yy836: - YYDEBUG(836, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych == 'L') goto yy840; - if (yych <= 'M') goto yy53; - goto yy839; - } else { - if (yych <= 'l') { - if (yych <= 'k') goto yy53; - goto yy840; - } else { - if (yych == 'n') goto yy839; - goto yy53; - } - } -yy837: - YYDEBUG(837, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy838; - if (yych != 'n') goto yy53; -yy838: - YYDEBUG(838, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'T') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'U') goto yy746; - if (yych == 'u') goto yy746; - goto yy679; - } - } -yy839: - YYDEBUG(839, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'D') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'E') goto yy727; - if (yych == 'e') goto yy727; - goto yy679; - } - } -yy840: - YYDEBUG(840, *YYCURSOR); - yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych == '\t') goto yy719; - goto yy679; - } else { - if (yych <= ' ') goto yy719; - if (yych <= ',') goto yy679; - if (yych <= '-') goto yy815; - goto yy719; - } - } else { - if (yych <= 'X') { - if (yych <= '/') goto yy679; - if (yych <= '9') goto yy721; - goto yy679; - } else { - if (yych <= 'Y') goto yy727; - if (yych == 'y') goto yy727; - goto yy679; - } - } -yy841: - YYDEBUG(841, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '2') goto yy842; - if (yych <= '3') goto yy844; - if (yych <= '9') goto yy845; - goto yy53; -yy842: - YYDEBUG(842, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '9') goto yy851; - if (yych >= 'n') goto yy847; - } else { - if (yych <= 'r') { - if (yych >= 'r') goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - } - } -yy843: - YYDEBUG(843, *YYCURSOR); -#line 1135 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("gnudateshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } -#line 14634 "ext/date/lib/parse_date.c" -yy844: - YYDEBUG(844, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '1') { - if (yych <= '/') goto yy843; - goto yy851; - } else { - if (yych <= '9') goto yy791; - if (yych <= 'm') goto yy843; - goto yy847; - } - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy845: - YYDEBUG(845, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '9') goto yy791; - if (yych <= 'm') goto yy843; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy846: - YYDEBUG(846, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 't') goto yy850; - goto yy53; -yy847: - YYDEBUG(847, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'd') goto yy850; - goto yy53; -yy848: - YYDEBUG(848, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'd') goto yy850; - goto yy53; -yy849: - YYDEBUG(849, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != 'h') goto yy53; -yy850: - YYDEBUG(850, *YYCURSOR); - yych = *++YYCURSOR; - goto yy843; -yy851: - YYDEBUG(851, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '9') goto yy792; - if (yych <= 'm') goto yy843; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy852: - YYDEBUG(852, *YYCURSOR); - yyaccept = 15; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') { - if (yych >= '/') goto yy906; - } else { - if (yych <= '9') goto yy855; - if (yych >= 'n') goto yy903; - } - } else { - if (yych <= 'r') { - if (yych >= 'r') goto yy904; - } else { - if (yych <= 's') goto yy902; - if (yych <= 't') goto yy905; - } - } -yy853: - YYDEBUG(853, *YYCURSOR); -#line 1082 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("americanshort | american"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '/') { - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - } - TIMELIB_DEINIT; - return TIMELIB_AMERICAN; - } -#line 14754 "ext/date/lib/parse_date.c" -yy854: - YYDEBUG(854, *YYCURSOR); - yyaccept = 15; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') { - if (yych <= '.') goto yy853; - goto yy906; - } else { - if (yych <= '1') goto yy855; - if (yych <= 'm') goto yy853; - goto yy903; - } - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy853; - goto yy904; - } else { - if (yych <= 's') goto yy902; - if (yych <= 't') goto yy905; - goto yy853; - } - } -yy855: - YYDEBUG(855, *YYCURSOR); - yyaccept = 15; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych == '/') goto yy906; - if (yych <= 'm') goto yy853; - goto yy903; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy853; - goto yy904; - } else { - if (yych <= 's') goto yy902; - if (yych <= 't') goto yy905; - goto yy853; - } - } -yy856: - YYDEBUG(856, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'A') goto yy901; - if (yych <= 'T') goto yy53; - goto yy900; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy53; - goto yy901; - } else { - if (yych == 'u') goto yy900; - goto yy53; - } - } -yy857: - YYDEBUG(857, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy899; - if (yych == 'e') goto yy899; - goto yy53; -yy858: - YYDEBUG(858, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy898; - if (yych == 'a') goto yy898; - goto yy53; -yy859: - YYDEBUG(859, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'P') goto yy897; - if (yych <= 'T') goto yy53; - goto yy896; - } else { - if (yych <= 'p') { - if (yych <= 'o') goto yy53; - goto yy897; - } else { - if (yych == 'u') goto yy896; - goto yy53; - } - } -yy860: - YYDEBUG(860, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy894; - if (yych == 'e') goto yy894; - goto yy53; -yy861: - YYDEBUG(861, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy893; - if (yych == 'c') goto yy893; - goto yy53; -yy862: - YYDEBUG(862, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy892; - if (yych == 'o') goto yy892; - goto yy53; -yy863: - YYDEBUG(863, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy864; - if (yych != 'e') goto yy53; -yy864: - YYDEBUG(864, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy865; - if (yych != 'c') goto yy53; -yy865: - YYDEBUG(865, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '/') goto yy53; -yy866: - YYDEBUG(866, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(867, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(868, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(869, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(870, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; - YYDEBUG(871, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '1') goto yy872; - if (yych <= '2') goto yy873; - goto yy53; -yy872: - YYDEBUG(872, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy874; - goto yy53; -yy873: - YYDEBUG(873, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '4') goto yy53; -yy874: - YYDEBUG(874, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; - YYDEBUG(875, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '6') goto yy53; - YYDEBUG(876, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(877, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; - YYDEBUG(878, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy879; - if (yych <= '6') goto yy880; - goto yy53; -yy879: - YYDEBUG(879, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy881; - goto yy53; -yy880: - YYDEBUG(880, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '0') goto yy53; -yy881: - YYDEBUG(881, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\t') goto yy882; - if (yych != ' ') goto yy53; -yy882: - YYDEBUG(882, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6); - yych = *YYCURSOR; - YYDEBUG(883, *YYCURSOR); - if (yych <= ' ') { - if (yych == '\t') goto yy882; - if (yych <= 0x1F) goto yy53; - goto yy882; - } else { - if (yych <= '+') { - if (yych <= '*') goto yy53; - } else { - if (yych != '-') goto yy53; - } - } - YYDEBUG(884, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '1') goto yy885; - if (yych <= '2') goto yy887; - if (yych <= '9') goto yy888; - goto yy53; -yy885: - YYDEBUG(885, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= '/') goto yy886; - if (yych <= '9') goto yy888; - if (yych <= ':') goto yy889; -yy886: - YYDEBUG(886, *YYCURSOR); -#line 1353 "ext/date/lib/parse_date.re" - { - int tz_not_found; - DEBUG_OUTPUT("clf"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - TIMELIB_DEINIT; - return TIMELIB_CLF; - } -#line 14997 "ext/date/lib/parse_date.c" -yy887: - YYDEBUG(887, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '5') { - if (yych <= '/') goto yy886; - if (yych >= '4') goto yy890; - } else { - if (yych <= '9') goto yy891; - if (yych <= ':') goto yy889; - goto yy886; - } -yy888: - YYDEBUG(888, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy886; - if (yych <= '5') goto yy890; - if (yych <= '9') goto yy891; - if (yych >= ';') goto yy886; -yy889: - YYDEBUG(889, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy886; - if (yych <= '5') goto yy890; - if (yych <= '9') goto yy891; - goto yy886; -yy890: - YYDEBUG(890, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy886; - if (yych >= ':') goto yy886; -yy891: - YYDEBUG(891, *YYCURSOR); - yych = *++YYCURSOR; - goto yy886; -yy892: - YYDEBUG(892, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'V') goto yy865; - if (yych == 'v') goto yy865; - goto yy53; -yy893: - YYDEBUG(893, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy865; - if (yych == 't') goto yy865; - goto yy53; -yy894: - YYDEBUG(894, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy895; - if (yych != 'p') goto yy53; -yy895: - YYDEBUG(895, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych == '/') goto yy866; - goto yy53; - } else { - if (yych <= 'T') goto yy865; - if (yych == 't') goto yy865; - goto yy53; - } -yy896: - YYDEBUG(896, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy865; - if (yych == 'g') goto yy865; - goto yy53; -yy897: - YYDEBUG(897, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy865; - if (yych == 'r') goto yy865; - goto yy53; -yy898: - YYDEBUG(898, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych == 'R') goto yy865; - if (yych <= 'X') goto yy53; - goto yy865; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy53; - goto yy865; - } else { - if (yych == 'y') goto yy865; - goto yy53; - } - } -yy899: - YYDEBUG(899, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy865; - if (yych == 'b') goto yy865; - goto yy53; -yy900: - YYDEBUG(900, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych == 'L') goto yy865; - if (yych <= 'M') goto yy53; - goto yy865; - } else { - if (yych <= 'l') { - if (yych <= 'k') goto yy53; - goto yy865; - } else { - if (yych == 'n') goto yy865; - goto yy53; - } - } -yy901: - YYDEBUG(901, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy865; - if (yych == 'n') goto yy865; - goto yy53; -yy902: - YYDEBUG(902, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 't') goto yy911; - goto yy53; -yy903: - YYDEBUG(903, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'd') goto yy911; - goto yy53; -yy904: - YYDEBUG(904, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'd') goto yy911; - goto yy53; -yy905: - YYDEBUG(905, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'h') goto yy911; - goto yy53; -yy906: - YYDEBUG(906, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(907, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy853; - if (yych >= ':') goto yy853; - YYDEBUG(908, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy853; - if (yych >= ':') goto yy853; - YYDEBUG(909, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy853; - if (yych >= ':') goto yy853; - YYDEBUG(910, *YYCURSOR); - yych = *++YYCURSOR; - goto yy853; -yy911: - YYDEBUG(911, *YYCURSOR); - yyaccept = 15; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '/') goto yy906; - goto yy853; -yy912: - YYDEBUG(912, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych == '\t') goto yy914; - goto yy765; - } else { - if (yych <= '-') goto yy915; - if (yych <= '.') goto yy914; - if (yych >= '0') goto yy765; - } -yy913: - YYDEBUG(913, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case 'A': - case 'a': goto yy859; - case 'D': - case 'd': goto yy863; - case 'F': - case 'f': goto yy857; - case 'J': - case 'j': goto yy856; - case 'M': - case 'm': goto yy858; - case 'N': - case 'n': goto yy862; - case 'O': - case 'o': goto yy861; - case 'S': - case 's': goto yy860; - default: goto yy53; - } -yy914: - YYDEBUG(914, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy765; - if (yych <= '0') goto yy919; - if (yych <= '1') goto yy920; - if (yych <= '9') goto yy921; - goto yy765; -yy915: - YYDEBUG(915, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy765; - if (yych <= '0') goto yy916; - if (yych <= '1') goto yy917; - if (yych <= '9') goto yy918; - goto yy765; -yy916: - YYDEBUG(916, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= ',') goto yy53; - if (yych <= '.') goto yy789; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy918; - goto yy53; -yy917: - YYDEBUG(917, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= ',') goto yy53; - if (yych <= '.') goto yy789; - if (yych <= '/') goto yy53; - if (yych >= '3') goto yy53; -yy918: - YYDEBUG(918, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= ',') goto yy53; - if (yych <= '.') goto yy789; - goto yy53; -yy919: - YYDEBUG(919, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') { - if (yych <= ',') goto yy53; - if (yych <= '-') goto yy789; - goto yy922; - } else { - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy921; - goto yy53; - } -yy920: - YYDEBUG(920, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') { - if (yych <= ',') goto yy53; - if (yych <= '-') goto yy789; - goto yy922; - } else { - if (yych <= '/') goto yy53; - if (yych >= '3') goto yy53; - } -yy921: - YYDEBUG(921, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= ',') goto yy53; - if (yych <= '-') goto yy789; - if (yych >= '/') goto yy53; -yy922: - YYDEBUG(922, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(923, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy798; - goto yy53; -yy924: - YYDEBUG(924, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '-') goto yy968; - if (yych <= '/') goto yy57; - if (yych <= '9') goto yy966; - goto yy57; -yy925: - YYDEBUG(925, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case '0': goto yy934; - case '1': goto yy935; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy936; - case 'A': - case 'a': goto yy929; - case 'D': - case 'd': goto yy933; - case 'F': - case 'f': goto yy927; - case 'J': - case 'j': goto yy926; - case 'M': - case 'm': goto yy928; - case 'N': - case 'n': goto yy932; - case 'O': - case 'o': goto yy931; - case 'S': - case 's': goto yy930; - default: goto yy53; - } -yy926: - YYDEBUG(926, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'A') goto yy965; - if (yych <= 'T') goto yy53; - goto yy964; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy53; - goto yy965; - } else { - if (yych == 'u') goto yy964; - goto yy53; - } - } -yy927: - YYDEBUG(927, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy963; - if (yych == 'e') goto yy963; - goto yy53; -yy928: - YYDEBUG(928, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy962; - if (yych == 'a') goto yy962; - goto yy53; -yy929: - YYDEBUG(929, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'P') goto yy961; - if (yych <= 'T') goto yy53; - goto yy960; - } else { - if (yych <= 'p') { - if (yych <= 'o') goto yy53; - goto yy961; - } else { - if (yych == 'u') goto yy960; - goto yy53; - } - } -yy930: - YYDEBUG(930, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy958; - if (yych == 'e') goto yy958; - goto yy53; -yy931: - YYDEBUG(931, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy957; - if (yych == 'c') goto yy957; - goto yy53; -yy932: - YYDEBUG(932, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy956; - if (yych == 'o') goto yy956; - goto yy53; -yy933: - YYDEBUG(933, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy948; - if (yych == 'e') goto yy948; - goto yy53; -yy934: - YYDEBUG(934, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '-') goto yy937; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy941; - goto yy53; -yy935: - YYDEBUG(935, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '-') goto yy937; - if (yych <= '/') goto yy53; - if (yych <= '2') goto yy941; - goto yy53; -yy936: - YYDEBUG(936, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '-') goto yy53; -yy937: - YYDEBUG(937, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '2') goto yy938; - if (yych <= '3') goto yy939; - if (yych <= '9') goto yy940; - goto yy53; -yy938: - YYDEBUG(938, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '9') goto yy940; - if (yych <= 'm') goto yy843; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy939: - YYDEBUG(939, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '1') goto yy940; - if (yych <= 'm') goto yy843; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy940: - YYDEBUG(940, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'q') { - if (yych == 'n') goto yy847; - goto yy843; - } else { - if (yych <= 'r') goto yy848; - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } -yy941: - YYDEBUG(941, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '-') goto yy53; - YYDEBUG(942, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '2') { - if (yych <= '/') goto yy53; - if (yych >= '1') goto yy944; - } else { - if (yych <= '3') goto yy945; - if (yych <= '9') goto yy940; - goto yy53; - } - YYDEBUG(943, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '9') goto yy946; - if (yych <= 'm') goto yy843; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy944: - YYDEBUG(944, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '9') goto yy946; - if (yych <= 'm') goto yy843; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy945: - YYDEBUG(945, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '1') goto yy946; - if (yych <= 'm') goto yy843; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy946: - YYDEBUG(946, *YYCURSOR); - yyaccept = 16; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'q') { - if (yych == 'n') goto yy847; - } else { - if (yych <= 'r') goto yy848; - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - } -yy947: - YYDEBUG(947, *YYCURSOR); -#line 1109 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("iso8601date2"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } -#line 15552 "ext/date/lib/parse_date.c" -yy948: - YYDEBUG(948, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy949; - if (yych != 'c') goto yy53; -yy949: - YYDEBUG(949, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '-') goto yy53; -yy950: - YYDEBUG(950, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy951; - if (yych <= '2') goto yy952; - if (yych <= '3') goto yy953; - goto yy53; -yy951: - YYDEBUG(951, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy954; - goto yy53; -yy952: - YYDEBUG(952, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy954; - goto yy53; -yy953: - YYDEBUG(953, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '2') goto yy53; -yy954: - YYDEBUG(954, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(955, *YYCURSOR); -#line 1340 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("pgtextreverse"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } -#line 15603 "ext/date/lib/parse_date.c" -yy956: - YYDEBUG(956, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'V') goto yy949; - if (yych == 'v') goto yy949; - goto yy53; -yy957: - YYDEBUG(957, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy949; - if (yych == 't') goto yy949; - goto yy53; -yy958: - YYDEBUG(958, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy959; - if (yych != 'p') goto yy53; -yy959: - YYDEBUG(959, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych == '-') goto yy950; - goto yy53; - } else { - if (yych <= 'T') goto yy949; - if (yych == 't') goto yy949; - goto yy53; - } -yy960: - YYDEBUG(960, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy949; - if (yych == 'g') goto yy949; - goto yy53; -yy961: - YYDEBUG(961, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy949; - if (yych == 'r') goto yy949; - goto yy53; -yy962: - YYDEBUG(962, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych == 'R') goto yy949; - if (yych <= 'X') goto yy53; - goto yy949; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy53; - goto yy949; - } else { - if (yych == 'y') goto yy949; - goto yy53; - } - } -yy963: - YYDEBUG(963, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy949; - if (yych == 'b') goto yy949; - goto yy53; -yy964: - YYDEBUG(964, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych == 'L') goto yy949; - if (yych <= 'M') goto yy53; - goto yy949; - } else { - if (yych <= 'l') { - if (yych <= 'k') goto yy53; - goto yy949; - } else { - if (yych == 'n') goto yy949; - goto yy53; - } - } -yy965: - YYDEBUG(965, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy949; - if (yych == 'n') goto yy949; - goto yy53; -yy966: - YYDEBUG(966, *YYCURSOR); - yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': - case ' ': - case 'A': - case 'D': - case 'F': - case 'H': - case 'I': - case 'J': - case 'M': - case 'N': - case 'O': - case 'S': - case 'T': - case 'V': - case 'X': - case 'Y': - case 'a': - case 'd': - case 'f': - case 'h': - case 'j': - case 'm': - case 'n': - case 'o': - case 's': - case 't': - case 'w': - case 'y': goto yy974; - case '-': goto yy971; - case '.': goto yy975; - case '/': goto yy972; - case '0': goto yy988; - case '1': goto yy989; - case '2': goto yy991; - case '3': goto yy992; - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy51; - case ':': goto yy990; - case 'W': goto yy993; - default: goto yy967; - } -yy967: - YYDEBUG(967, *YYCURSOR); -#line 1374 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("year4"); - TIMELIB_INIT; - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_DEINIT; - return TIMELIB_CLF; - } -#line 15749 "ext/date/lib/parse_date.c" -yy968: - YYDEBUG(968, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case '0': goto yy969; - case '1': goto yy970; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy936; - case 'A': - case 'a': goto yy929; - case 'D': - case 'd': goto yy933; - case 'F': - case 'f': goto yy927; - case 'J': - case 'j': goto yy926; - case 'M': - case 'm': goto yy928; - case 'N': - case 'n': goto yy932; - case 'O': - case 'o': goto yy931; - case 'S': - case 's': goto yy930; - default: goto yy53; - } -yy969: - YYDEBUG(969, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '-') goto yy937; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy936; - goto yy53; -yy970: - YYDEBUG(970, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '-') goto yy937; - if (yych <= '/') goto yy53; - if (yych <= '2') goto yy936; - goto yy53; -yy971: - YYDEBUG(971, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case '0': goto yy1156; - case '1': goto yy1158; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy1159; - case 'A': - case 'a': goto yy1150; - case 'D': - case 'd': goto yy1154; - case 'F': - case 'f': goto yy1148; - case 'J': - case 'j': goto yy1147; - case 'M': - case 'm': goto yy1149; - case 'N': - case 'n': goto yy1153; - case 'O': - case 'o': goto yy1152; - case 'S': - case 's': goto yy1151; - case 'W': goto yy1155; - default: goto yy1122; - } -yy972: - YYDEBUG(972, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy1130; - if (yych <= '1') goto yy1131; - if (yych <= '9') goto yy1132; - goto yy53; -yy973: - YYDEBUG(973, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11); - yych = *YYCURSOR; -yy974: - YYDEBUG(974, *YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': - case ' ': goto yy973; - case '-': - case '.': goto yy1121; - case 'A': - case 'a': goto yy983; - case 'D': - case 'd': goto yy987; - case 'F': - case 'f': goto yy981; - case 'H': - case 'h': goto yy60; - case 'I': goto yy976; - case 'J': - case 'j': goto yy980; - case 'M': - case 'm': goto yy982; - case 'N': - case 'n': goto yy986; - case 'O': - case 'o': goto yy985; - case 'S': - case 's': goto yy984; - case 'T': - case 't': goto yy65; - case 'V': goto yy978; - case 'W': - case 'w': goto yy62; - case 'X': goto yy979; - case 'Y': - case 'y': goto yy64; - default: goto yy53; - } -yy975: - YYDEBUG(975, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy1122; - if (yych <= '0') goto yy1114; - if (yych <= '2') goto yy1115; - if (yych <= '3') goto yy1116; - goto yy1122; -yy976: - YYDEBUG(976, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= 'U') { - if (yych == 'I') goto yy1113; - } else { - if (yych == 'W') goto yy977; - if (yych <= 'X') goto yy1067; - } -yy977: - YYDEBUG(977, *YYCURSOR); -#line 1200 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("datenodayrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } -#line 15912 "ext/date/lib/parse_date.c" -yy978: - YYDEBUG(978, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy1111; - goto yy977; -yy979: - YYDEBUG(979, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy1110; - goto yy977; -yy980: - YYDEBUG(980, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'A') goto yy1103; - if (yych <= 'T') goto yy53; - goto yy1102; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy53; - goto yy1103; - } else { - if (yych == 'u') goto yy1102; - goto yy53; - } - } -yy981: - YYDEBUG(981, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= 'N') { - if (yych == 'E') goto yy1096; - goto yy53; - } else { - if (yych <= 'O') goto yy83; - if (yych <= 'Q') goto yy53; - goto yy82; - } - } else { - if (yych <= 'n') { - if (yych == 'e') goto yy1096; - goto yy53; - } else { - if (yych <= 'o') goto yy83; - if (yych == 'r') goto yy82; - goto yy53; - } - } -yy982: - YYDEBUG(982, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= 'H') { - if (yych == 'A') goto yy1093; - goto yy53; - } else { - if (yych <= 'I') goto yy114; - if (yych <= 'N') goto yy53; - goto yy113; - } - } else { - if (yych <= 'h') { - if (yych == 'a') goto yy1093; - goto yy53; - } else { - if (yych <= 'i') goto yy114; - if (yych == 'o') goto yy113; - goto yy53; - } - } -yy983: - YYDEBUG(983, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'P') goto yy1087; - if (yych <= 'T') goto yy53; - goto yy1086; - } else { - if (yych <= 'p') { - if (yych <= 'o') goto yy53; - goto yy1087; - } else { - if (yych == 'u') goto yy1086; - goto yy53; - } - } -yy984: - YYDEBUG(984, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= 'D') { - if (yych == 'A') goto yy123; - goto yy53; - } else { - if (yych <= 'E') goto yy1079; - if (yych <= 'T') goto yy53; - goto yy122; - } - } else { - if (yych <= 'd') { - if (yych == 'a') goto yy123; - goto yy53; - } else { - if (yych <= 'e') goto yy1079; - if (yych == 'u') goto yy122; - goto yy53; - } - } -yy985: - YYDEBUG(985, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy1074; - if (yych == 'c') goto yy1074; - goto yy53; -yy986: - YYDEBUG(986, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy1068; - if (yych == 'o') goto yy1068; - goto yy53; -yy987: - YYDEBUG(987, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych == 'A') goto yy110; - if (yych <= 'D') goto yy53; - goto yy1061; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy53; - goto yy110; - } else { - if (yych == 'e') goto yy1061; - goto yy53; - } - } -yy988: - YYDEBUG(988, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '0') goto yy1058; - if (yych <= '9') goto yy1059; - goto yy57; -yy989: - YYDEBUG(989, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '2') goto yy1027; - if (yych <= '9') goto yy1006; - goto yy57; -yy990: - YYDEBUG(990, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy1007; - if (yych <= '1') goto yy1008; - goto yy53; -yy991: - YYDEBUG(991, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '9') goto yy1006; - goto yy57; -yy992: - YYDEBUG(992, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '5') goto yy1002; - if (yych <= '6') goto yy1003; - if (yych <= '9') goto yy51; - goto yy57; -yy993: - YYDEBUG(993, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '5') { - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy994; - if (yych <= '4') goto yy995; - goto yy996; - } else { - if (yych <= 'E') { - if (yych <= 'D') goto yy53; - goto yy98; - } else { - if (yych == 'e') goto yy98; - goto yy53; - } - } -yy994: - YYDEBUG(994, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '0') goto yy53; - if (yych <= '9') goto yy997; - goto yy53; -yy995: - YYDEBUG(995, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy997; - goto yy53; -yy996: - YYDEBUG(996, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '4') goto yy53; -yy997: - YYDEBUG(997, *YYCURSOR); - yyaccept = 18; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '-') goto yy999; - if (yych <= '/') goto yy998; - if (yych <= '7') goto yy1000; -yy998: - YYDEBUG(998, *YYCURSOR); -#line 1308 "ext/date/lib/parse_date.re" - { - timelib_sll w, d; - DEBUG_OUTPUT("isoweek"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = 1; - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } -#line 16145 "ext/date/lib/parse_date.c" -yy999: - YYDEBUG(999, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '8') goto yy53; -yy1000: - YYDEBUG(1000, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(1001, *YYCURSOR); -#line 1289 "ext/date/lib/parse_date.re" - { - timelib_sll w, d; - DEBUG_OUTPUT("isoweekday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = timelib_get_nr((char **) &ptr, 1); - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } -#line 16173 "ext/date/lib/parse_date.c" -yy1002: - YYDEBUG(1002, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '9') goto yy1004; - goto yy57; -yy1003: - YYDEBUG(1003, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '6') goto yy1004; - if (yych <= '9') goto yy51; - goto yy57; -yy1004: - YYDEBUG(1004, *YYCURSOR); - yyaccept = 19; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy51; - } - if (yych <= 'W') { - if (yych <= 'F') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych >= ' ') goto yy57; - } else { - if (yych == 'D') goto yy57; - if (yych >= 'F') goto yy57; - } - } else { - if (yych <= 'M') { - if (yych == 'H') goto yy57; - if (yych >= 'M') goto yy57; - } else { - if (yych <= 'R') goto yy1005; - if (yych <= 'T') goto yy57; - if (yych >= 'W') goto yy57; - } - } - } else { - if (yych <= 'h') { - if (yych <= 'd') { - if (yych == 'Y') goto yy57; - if (yych >= 'd') goto yy57; - } else { - if (yych == 'f') goto yy57; - if (yych >= 'h') goto yy57; - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych >= 's') goto yy57; - } else { - if (yych <= 'w') { - if (yych >= 'w') goto yy57; - } else { - if (yych == 'y') goto yy57; - } - } - } - } -yy1005: - YYDEBUG(1005, *YYCURSOR); -#line 1276 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("pgydotd"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = timelib_get_nr((char **) &ptr, 3); - s->time->m = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_YEARDAY; - } -#line 16249 "ext/date/lib/parse_date.c" -yy1006: - YYDEBUG(1006, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '9') goto yy1004; - goto yy57; -yy1007: - YYDEBUG(1007, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1009; - goto yy53; -yy1008: - YYDEBUG(1008, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '3') goto yy53; -yy1009: - YYDEBUG(1009, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; - YYDEBUG(1010, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy1011; - if (yych <= '2') goto yy1012; - if (yych <= '3') goto yy1013; - goto yy53; -yy1011: - YYDEBUG(1011, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1014; - goto yy53; -yy1012: - YYDEBUG(1012, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1014; - goto yy53; -yy1013: - YYDEBUG(1013, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '2') goto yy53; -yy1014: - YYDEBUG(1014, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ' ') goto yy53; - YYDEBUG(1015, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '1') goto yy1016; - if (yych <= '2') goto yy1017; - goto yy53; -yy1016: - YYDEBUG(1016, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1018; - goto yy53; -yy1017: - YYDEBUG(1017, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '4') goto yy53; -yy1018: - YYDEBUG(1018, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; - YYDEBUG(1019, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '6') goto yy53; - YYDEBUG(1020, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(1021, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; - YYDEBUG(1022, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1023; - if (yych <= '6') goto yy1024; - goto yy53; -yy1023: - YYDEBUG(1023, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1025; - goto yy53; -yy1024: - YYDEBUG(1024, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '0') goto yy53; -yy1025: - YYDEBUG(1025, *YYCURSOR); - ++YYCURSOR; -yy1026: - YYDEBUG(1026, *YYCURSOR); -#line 1250 "ext/date/lib/parse_date.re" - { - int tz_not_found; - DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 9); - if (*ptr) { /* timezone is optional */ - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - } - } - TIMELIB_DEINIT; - return TIMELIB_XMLRPC_SOAP; - } -#line 16377 "ext/date/lib/parse_date.c" -yy1027: - YYDEBUG(1027, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '2') { - if (yych <= '/') goto yy57; - if (yych >= '1') goto yy1029; - } else { - if (yych <= '3') goto yy1030; - if (yych <= '9') goto yy1004; - goto yy57; - } -yy1028: - YYDEBUG(1028, *YYCURSOR); - yyaccept = 19; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy1005; - goto yy57; - } else { - if (yych <= '/') goto yy1005; - if (yych <= '9') goto yy1031; - if (yych <= 'C') goto yy1005; - goto yy57; - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy1005; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy1005; - goto yy57; - } else { - if (yych <= 'R') goto yy1005; - if (yych <= 'T') goto yy57; - goto yy1005; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy1005; - if (yych <= 'Y') goto yy57; - goto yy1005; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy1005; - } else { - if (yych == 'g') goto yy1005; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy1005; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy1005; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy1005; - } - } - } - } -yy1029: - YYDEBUG(1029, *YYCURSOR); - yyaccept = 19; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy1005; - goto yy57; - } else { - if (yych <= '/') goto yy1005; - if (yych <= '9') goto yy1031; - if (yych <= 'C') goto yy1005; - goto yy57; - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy1005; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy1005; - goto yy57; - } else { - if (yych <= 'R') goto yy1005; - if (yych <= 'T') goto yy57; - goto yy1005; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy1005; - if (yych <= 'Y') goto yy57; - goto yy1005; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy1005; - } else { - if (yych == 'g') goto yy1005; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy1005; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy1005; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy1005; - } - } - } - } -yy1030: - YYDEBUG(1030, *YYCURSOR); - yyaccept = 19; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy1005; - goto yy57; - } else { - if (yych <= '1') { - if (yych <= '/') goto yy1005; - } else { - if (yych <= '9') goto yy51; - if (yych <= 'C') goto yy1005; - goto yy57; - } - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy1005; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy1005; - goto yy57; - } else { - if (yych <= 'R') goto yy1005; - if (yych <= 'T') goto yy57; - goto yy1005; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy1005; - if (yych <= 'Y') goto yy57; - goto yy1005; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy1005; - } else { - if (yych == 'g') goto yy1005; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy1005; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy1005; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy1005; - } - } - } - } -yy1031: - YYDEBUG(1031, *YYCURSOR); - yyaccept = 20; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy51; - } - if (yych <= 'W') { - if (yych <= 'F') { - if (yych <= ' ') { - if (yych == '\t') goto yy56; - if (yych >= ' ') goto yy56; - } else { - if (yych == 'D') goto yy61; - if (yych >= 'F') goto yy63; - } - } else { - if (yych <= 'M') { - if (yych == 'H') goto yy60; - if (yych >= 'M') goto yy59; - } else { - if (yych <= 'S') { - if (yych >= 'S') goto yy58; - } else { - if (yych <= 'T') goto yy1033; - if (yych >= 'W') goto yy62; - } - } - } - } else { - if (yych <= 'l') { - if (yych <= 'd') { - if (yych == 'Y') goto yy64; - if (yych >= 'd') goto yy61; - } else { - if (yych <= 'f') { - if (yych >= 'f') goto yy63; - } else { - if (yych == 'h') goto yy60; - } - } - } else { - if (yych <= 't') { - if (yych <= 'm') goto yy59; - if (yych <= 'r') goto yy1032; - if (yych <= 's') goto yy58; - goto yy1034; - } else { - if (yych <= 'w') { - if (yych >= 'w') goto yy62; - } else { - if (yych == 'y') goto yy64; - } - } - } - } -yy1032: - YYDEBUG(1032, *YYCURSOR); -#line 1238 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("datenocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_DATE_NOCOLON; - } -#line 16650 "ext/date/lib/parse_date.c" -yy1033: - YYDEBUG(1033, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'H') { - if (yych <= '2') { - if (yych <= '/') goto yy53; - if (yych <= '1') goto yy1048; - goto yy1049; - } else { - if (yych <= '9') goto yy1050; - if (yych <= 'G') goto yy53; - goto yy66; - } - } else { - if (yych <= 'g') { - if (yych == 'U') goto yy67; - goto yy53; - } else { - if (yych <= 'h') goto yy66; - if (yych == 'u') goto yy67; - goto yy53; - } - } -yy1034: - YYDEBUG(1034, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'H') { - if (yych <= '2') { - if (yych <= '/') goto yy53; - if (yych >= '2') goto yy1036; - } else { - if (yych <= '9') goto yy1037; - if (yych <= 'G') goto yy53; - goto yy66; - } - } else { - if (yych <= 'g') { - if (yych == 'U') goto yy67; - goto yy53; - } else { - if (yych <= 'h') goto yy66; - if (yych == 'u') goto yy67; - goto yy53; - } - } - YYDEBUG(1035, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1042; - if (yych <= '9') goto yy1037; - goto yy53; -yy1036: - YYDEBUG(1036, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '3') goto yy1042; - if (yych <= '5') goto yy1038; - goto yy53; -yy1037: - YYDEBUG(1037, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '6') goto yy53; -yy1038: - YYDEBUG(1038, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; -yy1039: - YYDEBUG(1039, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1040; - if (yych <= '6') goto yy1041; - goto yy53; -yy1040: - YYDEBUG(1040, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1025; - goto yy53; -yy1041: - YYDEBUG(1041, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '0') goto yy1025; - goto yy53; -yy1042: - YYDEBUG(1042, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1043; - if (yych <= '9') goto yy1039; - goto yy53; -yy1043: - YYDEBUG(1043, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1044; - if (yych <= '6') goto yy1045; - if (yych <= '9') goto yy1039; - goto yy53; -yy1044: - YYDEBUG(1044, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1046; - if (yych <= '6') goto yy1047; - if (yych <= '9') goto yy1025; - goto yy53; -yy1045: - YYDEBUG(1045, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy1046; - if (yych <= '5') goto yy1040; - if (yych <= '6') goto yy1041; - goto yy53; -yy1046: - YYDEBUG(1046, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy1026; - if (yych <= '9') goto yy1025; - goto yy1026; -yy1047: - YYDEBUG(1047, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '0') goto yy1025; - goto yy1026; -yy1048: - YYDEBUG(1048, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1057; - if (yych <= '9') goto yy1050; - if (yych <= ':') goto yy1051; - goto yy53; -yy1049: - YYDEBUG(1049, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '5') { - if (yych <= '/') goto yy53; - if (yych <= '3') goto yy1057; - goto yy1038; - } else { - if (yych == ':') goto yy1051; - goto yy53; - } -yy1050: - YYDEBUG(1050, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1038; - if (yych != ':') goto yy53; -yy1051: - YYDEBUG(1051, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= '6') goto yy53; - YYDEBUG(1052, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(1053, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; - YYDEBUG(1054, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1055; - if (yych <= '6') goto yy1056; - goto yy53; -yy1055: - YYDEBUG(1055, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1025; - goto yy53; -yy1056: - YYDEBUG(1056, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '0') goto yy1025; - goto yy53; -yy1057: - YYDEBUG(1057, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1043; - if (yych <= '9') goto yy1039; - if (yych <= ':') goto yy1051; - goto yy53; -yy1058: - YYDEBUG(1058, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '2') { - if (yych <= '/') goto yy57; - if (yych <= '0') goto yy1060; - goto yy1029; - } else { - if (yych <= '3') goto yy1030; - if (yych <= '9') goto yy1004; - goto yy57; - } -yy1059: - YYDEBUG(1059, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '2') { - if (yych <= '/') goto yy57; - if (yych <= '0') goto yy1028; - goto yy1029; - } else { - if (yych <= '3') goto yy1030; - if (yych <= '9') goto yy1004; - goto yy57; - } -yy1060: - YYDEBUG(1060, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '9') goto yy1031; - goto yy57; -yy1061: - YYDEBUG(1061, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy1062; - if (yych != 'c') goto yy53; -yy1062: - YYDEBUG(1062, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'E') goto yy1063; - if (yych != 'e') goto yy977; -yy1063: - YYDEBUG(1063, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy1064; - if (yych != 'm') goto yy53; -yy1064: - YYDEBUG(1064, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy1065; - if (yych != 'b') goto yy53; -yy1065: - YYDEBUG(1065, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1066; - if (yych != 'e') goto yy53; -yy1066: - YYDEBUG(1066, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy1067; - if (yych != 'r') goto yy53; -yy1067: - YYDEBUG(1067, *YYCURSOR); - yych = *++YYCURSOR; - goto yy977; -yy1068: - YYDEBUG(1068, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'V') goto yy1069; - if (yych != 'v') goto yy53; -yy1069: - YYDEBUG(1069, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'E') goto yy1070; - if (yych != 'e') goto yy977; -yy1070: - YYDEBUG(1070, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy1071; - if (yych != 'm') goto yy53; -yy1071: - YYDEBUG(1071, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy1072; - if (yych != 'b') goto yy53; -yy1072: - YYDEBUG(1072, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1073; - if (yych != 'e') goto yy53; -yy1073: - YYDEBUG(1073, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy1067; - if (yych == 'r') goto yy1067; - goto yy53; -yy1074: - YYDEBUG(1074, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy1075; - if (yych != 't') goto yy53; -yy1075: - YYDEBUG(1075, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'O') goto yy1076; - if (yych != 'o') goto yy977; -yy1076: - YYDEBUG(1076, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy1077; - if (yych != 'b') goto yy53; -yy1077: - YYDEBUG(1077, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1078; - if (yych != 'e') goto yy53; -yy1078: - YYDEBUG(1078, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy1067; - if (yych == 'r') goto yy1067; - goto yy53; -yy1079: - YYDEBUG(1079, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'P') { - if (yych == 'C') goto yy125; - if (yych <= 'O') goto yy53; - } else { - if (yych <= 'c') { - if (yych <= 'b') goto yy53; - goto yy125; - } else { - if (yych != 'p') goto yy53; - } - } -yy1080: - YYDEBUG(1080, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy1081; - if (yych != 't') goto yy977; -yy1081: - YYDEBUG(1081, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'E') goto yy1082; - if (yych != 'e') goto yy977; -yy1082: - YYDEBUG(1082, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy1083; - if (yych != 'm') goto yy53; -yy1083: - YYDEBUG(1083, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy1084; - if (yych != 'b') goto yy53; -yy1084: - YYDEBUG(1084, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1085; - if (yych != 'e') goto yy53; -yy1085: - YYDEBUG(1085, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy1067; - if (yych == 'r') goto yy1067; - goto yy53; -yy1086: - YYDEBUG(1086, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy1090; - if (yych == 'g') goto yy1090; - goto yy53; -yy1087: - YYDEBUG(1087, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy1088; - if (yych != 'r') goto yy53; -yy1088: - YYDEBUG(1088, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'I') goto yy1089; - if (yych != 'i') goto yy977; -yy1089: - YYDEBUG(1089, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy1067; - if (yych == 'l') goto yy1067; - goto yy53; -yy1090: - YYDEBUG(1090, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'U') goto yy1091; - if (yych != 'u') goto yy977; -yy1091: - YYDEBUG(1091, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy1092; - if (yych != 's') goto yy53; -yy1092: - YYDEBUG(1092, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy1067; - if (yych == 't') goto yy1067; - goto yy53; -yy1093: - YYDEBUG(1093, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych == 'R') goto yy1094; - if (yych <= 'X') goto yy53; - goto yy1067; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy53; - } else { - if (yych == 'y') goto yy1067; - goto yy53; - } - } -yy1094: - YYDEBUG(1094, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'C') goto yy1095; - if (yych != 'c') goto yy977; -yy1095: - YYDEBUG(1095, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy1067; - if (yych == 'h') goto yy1067; - goto yy53; -yy1096: - YYDEBUG(1096, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy1097; - if (yych != 'b') goto yy53; -yy1097: - YYDEBUG(1097, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'R') goto yy1098; - if (yych != 'r') goto yy977; -yy1098: - YYDEBUG(1098, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy1099; - if (yych != 'u') goto yy53; -yy1099: - YYDEBUG(1099, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy1100; - if (yych != 'a') goto yy53; -yy1100: - YYDEBUG(1100, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy1101; - if (yych != 'r') goto yy53; -yy1101: - YYDEBUG(1101, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy1067; - if (yych == 'y') goto yy1067; - goto yy53; -yy1102: - YYDEBUG(1102, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych == 'L') goto yy1109; - if (yych <= 'M') goto yy53; - goto yy1108; - } else { - if (yych <= 'l') { - if (yych <= 'k') goto yy53; - goto yy1109; - } else { - if (yych == 'n') goto yy1108; - goto yy53; - } - } -yy1103: - YYDEBUG(1103, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy1104; - if (yych != 'n') goto yy53; -yy1104: - YYDEBUG(1104, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'U') goto yy1105; - if (yych != 'u') goto yy977; -yy1105: - YYDEBUG(1105, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy1106; - if (yych != 'a') goto yy53; -yy1106: - YYDEBUG(1106, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy1107; - if (yych != 'r') goto yy53; -yy1107: - YYDEBUG(1107, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy1067; - if (yych == 'y') goto yy1067; - goto yy53; -yy1108: - YYDEBUG(1108, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1067; - if (yych == 'e') goto yy1067; - goto yy977; -yy1109: - YYDEBUG(1109, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy1067; - if (yych == 'y') goto yy1067; - goto yy977; -yy1110: - YYDEBUG(1110, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy1067; - goto yy977; -yy1111: - YYDEBUG(1111, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != 'I') goto yy977; - YYDEBUG(1112, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy1067; - goto yy977; -yy1113: - YYDEBUG(1113, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy1067; - goto yy977; -yy1114: - YYDEBUG(1114, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy1129; - if (yych <= '9') goto yy1128; - goto yy53; -yy1115: - YYDEBUG(1115, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1127; - goto yy53; -yy1116: - YYDEBUG(1116, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1125; - if (yych <= '6') goto yy1124; - goto yy53; -yy1117: - YYDEBUG(1117, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1096; - if (yych == 'e') goto yy1096; - goto yy53; -yy1118: - YYDEBUG(1118, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy1093; - if (yych == 'a') goto yy1093; - goto yy53; -yy1119: - YYDEBUG(1119, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1123; - if (yych == 'e') goto yy1123; - goto yy53; -yy1120: - YYDEBUG(1120, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1061; - if (yych == 'e') goto yy1061; - goto yy53; -yy1121: - YYDEBUG(1121, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); - yych = *YYCURSOR; -yy1122: - YYDEBUG(1122, *YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': - case ' ': - case '-': - case '.': goto yy1121; - case 'A': - case 'a': goto yy983; - case 'D': - case 'd': goto yy1120; - case 'F': - case 'f': goto yy1117; - case 'I': goto yy976; - case 'J': - case 'j': goto yy980; - case 'M': - case 'm': goto yy1118; - case 'N': - case 'n': goto yy986; - case 'O': - case 'o': goto yy985; - case 'S': - case 's': goto yy1119; - case 'V': goto yy978; - case 'X': goto yy979; - default: goto yy53; - } -yy1123: - YYDEBUG(1123, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy1080; - if (yych == 'p') goto yy1080; - goto yy53; -yy1124: - YYDEBUG(1124, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '6') goto yy1126; - goto yy53; -yy1125: - YYDEBUG(1125, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; -yy1126: - YYDEBUG(1126, *YYCURSOR); - yych = *++YYCURSOR; - goto yy1005; -yy1127: - YYDEBUG(1127, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1126; - goto yy53; -yy1128: - YYDEBUG(1128, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1126; - goto yy53; -yy1129: - YYDEBUG(1129, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '0') goto yy53; - if (yych <= '9') goto yy1126; - goto yy53; -yy1130: - YYDEBUG(1130, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') goto yy53; - if (yych <= '/') goto yy1133; - if (yych <= '9') goto yy1141; - goto yy53; -yy1131: - YYDEBUG(1131, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') goto yy53; - if (yych <= '/') goto yy1133; - if (yych <= '2') goto yy1141; - goto yy53; -yy1132: - YYDEBUG(1132, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '/') goto yy53; -yy1133: - YYDEBUG(1133, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '2') goto yy1134; - if (yych <= '3') goto yy1135; - if (yych <= '9') goto yy1136; - goto yy53; -yy1134: - YYDEBUG(1134, *YYCURSOR); - yyaccept = 22; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy658; - if (yych <= '9') goto yy1136; - if (yych <= 'm') goto yy658; - goto yy1138; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy658; - goto yy1139; - } else { - if (yych <= 's') goto yy1137; - if (yych <= 't') goto yy1140; - goto yy658; - } - } -yy1135: - YYDEBUG(1135, *YYCURSOR); - yyaccept = 22; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy658; - if (yych <= '1') goto yy1136; - if (yych <= 'm') goto yy658; - goto yy1138; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy658; - goto yy1139; - } else { - if (yych <= 's') goto yy1137; - if (yych <= 't') goto yy1140; - goto yy658; - } - } -yy1136: - YYDEBUG(1136, *YYCURSOR); - yyaccept = 22; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'q') { - if (yych == 'n') goto yy1138; - goto yy658; - } else { - if (yych <= 'r') goto yy1139; - if (yych <= 's') goto yy1137; - if (yych <= 't') goto yy1140; - goto yy658; - } -yy1137: - YYDEBUG(1137, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 't') goto yy657; - goto yy53; -yy1138: - YYDEBUG(1138, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'd') goto yy657; - goto yy53; -yy1139: - YYDEBUG(1139, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'd') goto yy657; - goto yy53; -yy1140: - YYDEBUG(1140, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'h') goto yy657; - goto yy53; -yy1141: - YYDEBUG(1141, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '/') goto yy53; - YYDEBUG(1142, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '2') { - if (yych <= '/') goto yy53; - if (yych >= '1') goto yy1144; - } else { - if (yych <= '3') goto yy1145; - if (yych <= '9') goto yy1136; - goto yy53; - } - YYDEBUG(1143, *YYCURSOR); - yyaccept = 22; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy658; - if (yych <= '9') goto yy1146; - if (yych <= 'm') goto yy658; - goto yy1138; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy658; - goto yy1139; - } else { - if (yych <= 's') goto yy1137; - if (yych <= 't') goto yy1140; - goto yy658; - } - } -yy1144: - YYDEBUG(1144, *YYCURSOR); - yyaccept = 22; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy658; - if (yych <= '9') goto yy1146; - if (yych <= 'm') goto yy658; - goto yy1138; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy658; - goto yy1139; - } else { - if (yych <= 's') goto yy1137; - if (yych <= 't') goto yy1140; - goto yy658; - } - } -yy1145: - YYDEBUG(1145, *YYCURSOR); - yyaccept = 22; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy658; - if (yych <= '1') goto yy1146; - if (yych <= 'm') goto yy658; - goto yy1138; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy658; - goto yy1139; - } else { - if (yych <= 's') goto yy1137; - if (yych <= 't') goto yy1140; - goto yy658; - } - } -yy1146: - YYDEBUG(1146, *YYCURSOR); - yyaccept = 22; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych == '/') goto yy657; - if (yych <= 'm') goto yy658; - goto yy1138; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy658; - goto yy1139; - } else { - if (yych <= 's') goto yy1137; - if (yych <= 't') goto yy1140; - goto yy658; - } - } -yy1147: - YYDEBUG(1147, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'A') goto yy1224; - if (yych <= 'T') goto yy53; - goto yy1223; - } else { - if (yych <= 'a') { - if (yych <= '`') goto yy53; - goto yy1224; - } else { - if (yych == 'u') goto yy1223; - goto yy53; - } - } -yy1148: - YYDEBUG(1148, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1221; - if (yych == 'e') goto yy1221; - goto yy53; -yy1149: - YYDEBUG(1149, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy1218; - if (yych == 'a') goto yy1218; - goto yy53; -yy1150: - YYDEBUG(1150, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'P') goto yy1215; - if (yych <= 'T') goto yy53; - goto yy1214; - } else { - if (yych <= 'p') { - if (yych <= 'o') goto yy53; - goto yy1215; - } else { - if (yych == 'u') goto yy1214; - goto yy53; - } - } -yy1151: - YYDEBUG(1151, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1211; - if (yych == 'e') goto yy1211; - goto yy53; -yy1152: - YYDEBUG(1152, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy1209; - if (yych == 'c') goto yy1209; - goto yy53; -yy1153: - YYDEBUG(1153, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy1207; - if (yych == 'o') goto yy1207; - goto yy53; -yy1154: - YYDEBUG(1154, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy1205; - if (yych == 'e') goto yy1205; - goto yy53; -yy1155: - YYDEBUG(1155, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '0') goto yy994; - if (yych <= '4') goto yy995; - if (yych <= '5') goto yy996; - goto yy53; -yy1156: - YYDEBUG(1156, *YYCURSOR); - yyaccept = 23; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '-') goto yy1160; - if (yych <= '/') goto yy1157; - if (yych <= '9') goto yy1179; -yy1157: - YYDEBUG(1157, *YYCURSOR); -#line 1122 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("gnudateshorter"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } -#line 17582 "ext/date/lib/parse_date.c" -yy1158: - YYDEBUG(1158, *YYCURSOR); - yyaccept = 23; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '-') goto yy1160; - if (yych <= '/') goto yy1157; - if (yych <= '2') goto yy1179; - goto yy1157; -yy1159: - YYDEBUG(1159, *YYCURSOR); - yyaccept = 23; - yych = *(YYMARKER = ++YYCURSOR); - if (yych != '-') goto yy1157; -yy1160: - YYDEBUG(1160, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '2') goto yy1161; - if (yych <= '3') goto yy1162; - if (yych <= '9') goto yy1163; - goto yy53; -yy1161: - YYDEBUG(1161, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '9') { - if (yych <= '/') goto yy843; - goto yy1163; - } else { - if (yych == 'T') goto yy1168; - goto yy843; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy1165; - if (yych <= 'q') goto yy843; - goto yy1166; - } else { - if (yych <= 's') goto yy1164; - if (yych <= 't') goto yy1167; - goto yy843; - } - } -yy1162: - YYDEBUG(1162, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '1') { - if (yych <= '/') goto yy843; - } else { - if (yych == 'T') goto yy1168; - goto yy843; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy1165; - if (yych <= 'q') goto yy843; - goto yy1166; - } else { - if (yych <= 's') goto yy1164; - if (yych <= 't') goto yy1167; - goto yy843; - } - } -yy1163: - YYDEBUG(1163, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych == 'T') goto yy1168; - if (yych <= 'm') goto yy843; - goto yy1165; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy1166; - } else { - if (yych <= 's') goto yy1164; - if (yych <= 't') goto yy1167; - goto yy843; - } - } -yy1164: - YYDEBUG(1164, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 't') goto yy1178; - goto yy53; -yy1165: - YYDEBUG(1165, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'd') goto yy1178; - goto yy53; -yy1166: - YYDEBUG(1166, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'd') goto yy1178; - goto yy53; -yy1167: - YYDEBUG(1167, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'h') goto yy1178; - goto yy53; -yy1168: - YYDEBUG(1168, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '1') goto yy1169; - if (yych <= '2') goto yy1170; - if (yych <= '9') goto yy1171; - goto yy53; -yy1169: - YYDEBUG(1169, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1171; - if (yych <= ':') goto yy1172; - goto yy53; -yy1170: - YYDEBUG(1170, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '3') goto yy1171; - if (yych == ':') goto yy1172; - goto yy53; -yy1171: - YYDEBUG(1171, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; -yy1172: - YYDEBUG(1172, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1173; - if (yych <= '9') goto yy1174; - goto yy53; -yy1173: - YYDEBUG(1173, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1174; - if (yych <= ':') goto yy1175; - goto yy53; -yy1174: - YYDEBUG(1174, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; -yy1175: - YYDEBUG(1175, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1176; - if (yych <= '6') goto yy1177; - if (yych <= '9') goto yy1025; - goto yy53; -yy1176: - YYDEBUG(1176, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy1026; - if (yych <= '9') goto yy1025; - goto yy1026; -yy1177: - YYDEBUG(1177, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '0') goto yy1025; - goto yy1026; -yy1178: - YYDEBUG(1178, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'T') goto yy1168; - goto yy843; -yy1179: - YYDEBUG(1179, *YYCURSOR); - yyaccept = 23; - yych = *(YYMARKER = ++YYCURSOR); - if (yych != '-') goto yy1157; - YYDEBUG(1180, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '2') { - if (yych <= '/') goto yy53; - if (yych >= '1') goto yy1182; - } else { - if (yych <= '3') goto yy1183; - if (yych <= '9') goto yy1163; - goto yy53; - } - YYDEBUG(1181, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '9') { - if (yych <= '/') goto yy843; - goto yy1184; - } else { - if (yych == 'T') goto yy1168; - goto yy843; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy1165; - if (yych <= 'q') goto yy843; - goto yy1166; - } else { - if (yych <= 's') goto yy1164; - if (yych <= 't') goto yy1167; - goto yy843; - } - } -yy1182: - YYDEBUG(1182, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '9') { - if (yych <= '/') goto yy843; - goto yy1184; - } else { - if (yych == 'T') goto yy1168; - goto yy843; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy1165; - if (yych <= 'q') goto yy843; - goto yy1166; - } else { - if (yych <= 's') goto yy1164; - if (yych <= 't') goto yy1167; - goto yy843; - } - } -yy1183: - YYDEBUG(1183, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'm') { - if (yych <= '1') { - if (yych <= '/') goto yy843; - } else { - if (yych == 'T') goto yy1168; - goto yy843; - } - } else { - if (yych <= 'r') { - if (yych <= 'n') goto yy1165; - if (yych <= 'q') goto yy843; - goto yy1166; - } else { - if (yych <= 's') goto yy1164; - if (yych <= 't') goto yy1167; - goto yy843; - } - } -yy1184: - YYDEBUG(1184, *YYCURSOR); - yyaccept = 22; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych == 'T') goto yy1185; - if (yych <= 'm') goto yy658; - goto yy1165; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy658; - goto yy1166; - } else { - if (yych <= 's') goto yy1164; - if (yych <= 't') goto yy1167; - goto yy658; - } - } -yy1185: - YYDEBUG(1185, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '1') goto yy1186; - if (yych <= '2') goto yy1187; - if (yych <= '9') goto yy1171; - goto yy53; -yy1186: - YYDEBUG(1186, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1188; - if (yych <= ':') goto yy1172; - goto yy53; -yy1187: - YYDEBUG(1187, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '3') goto yy1188; - if (yych == ':') goto yy1172; - goto yy53; -yy1188: - YYDEBUG(1188, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; - YYDEBUG(1189, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1190; - if (yych <= '9') goto yy1174; - goto yy53; -yy1190: - YYDEBUG(1190, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1191; - if (yych <= ':') goto yy1175; - goto yy53; -yy1191: - YYDEBUG(1191, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != ':') goto yy53; - YYDEBUG(1192, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1193; - if (yych <= '6') goto yy1194; - if (yych <= '9') goto yy1025; - goto yy53; -yy1193: - YYDEBUG(1193, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy1026; - if (yych <= '9') goto yy1195; - goto yy1026; -yy1194: - YYDEBUG(1194, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '0') goto yy1026; -yy1195: - YYDEBUG(1195, *YYCURSOR); - yyaccept = 24; - yych = *(YYMARKER = ++YYCURSOR); - if (yych != '.') goto yy1026; - YYDEBUG(1196, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; -yy1197: - YYDEBUG(1197, *YYCURSOR); - yyaccept = 24; - YYMARKER = ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6); - yych = *YYCURSOR; - YYDEBUG(1198, *YYCURSOR); - if (yych <= ',') { - if (yych != '+') goto yy1026; - } else { - if (yych <= '-') goto yy1199; - if (yych <= '/') goto yy1026; - if (yych <= '9') goto yy1197; - goto yy1026; - } -yy1199: - YYDEBUG(1199, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '1') goto yy1200; - if (yych <= '2') goto yy1201; - if (yych <= '9') goto yy1202; - goto yy53; -yy1200: - YYDEBUG(1200, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy1026; - if (yych <= '9') goto yy1202; - if (yych <= ':') goto yy1203; - goto yy1026; -yy1201: - YYDEBUG(1201, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '5') { - if (yych <= '/') goto yy1026; - if (yych >= '4') goto yy1204; - } else { - if (yych <= '9') goto yy1025; - if (yych <= ':') goto yy1203; - goto yy1026; - } -yy1202: - YYDEBUG(1202, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy1026; - if (yych <= '5') goto yy1204; - if (yych <= '9') goto yy1025; - if (yych >= ';') goto yy1026; -yy1203: - YYDEBUG(1203, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy1026; - if (yych <= '5') goto yy1204; - if (yych <= '9') goto yy1025; - goto yy1026; -yy1204: - YYDEBUG(1204, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy1026; - if (yych <= '9') goto yy1025; - goto yy1026; -yy1205: - YYDEBUG(1205, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy1206; - if (yych != 'c') goto yy53; -yy1206: - YYDEBUG(1206, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'E') goto yy1063; - if (yych == 'e') goto yy1063; - goto yy977; - } -yy1207: - YYDEBUG(1207, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'V') goto yy1208; - if (yych != 'v') goto yy53; -yy1208: - YYDEBUG(1208, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'E') goto yy1070; - if (yych == 'e') goto yy1070; - goto yy977; - } -yy1209: - YYDEBUG(1209, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy1210; - if (yych != 't') goto yy53; -yy1210: - YYDEBUG(1210, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'O') goto yy1076; - if (yych == 'o') goto yy1076; - goto yy977; - } -yy1211: - YYDEBUG(1211, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy1212; - if (yych != 'p') goto yy53; -yy1212: - YYDEBUG(1212, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'T') goto yy1213; - if (yych != 't') goto yy977; - } -yy1213: - YYDEBUG(1213, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'E') goto yy1082; - if (yych == 'e') goto yy1082; - goto yy977; - } -yy1214: - YYDEBUG(1214, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy1217; - if (yych == 'g') goto yy1217; - goto yy53; -yy1215: - YYDEBUG(1215, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy1216; - if (yych != 'r') goto yy53; -yy1216: - YYDEBUG(1216, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'I') goto yy1089; - if (yych == 'i') goto yy1089; - goto yy977; - } -yy1217: - YYDEBUG(1217, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'U') goto yy1091; - if (yych == 'u') goto yy1091; - goto yy977; - } -yy1218: - YYDEBUG(1218, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych == 'R') goto yy1219; - if (yych <= 'X') goto yy53; - goto yy1220; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy53; - } else { - if (yych == 'y') goto yy1220; - goto yy53; - } - } -yy1219: - YYDEBUG(1219, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'B') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'C') goto yy1095; - if (yych == 'c') goto yy1095; - goto yy977; - } -yy1220: - YYDEBUG(1220, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '-') goto yy950; - goto yy977; -yy1221: - YYDEBUG(1221, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'B') goto yy1222; - if (yych != 'b') goto yy53; -yy1222: - YYDEBUG(1222, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Q') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'R') goto yy1098; - if (yych == 'r') goto yy1098; - goto yy977; - } -yy1223: - YYDEBUG(1223, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych == 'L') goto yy1227; - if (yych <= 'M') goto yy53; - goto yy1226; - } else { - if (yych <= 'l') { - if (yych <= 'k') goto yy53; - goto yy1227; - } else { - if (yych == 'n') goto yy1226; - goto yy53; - } - } -yy1224: - YYDEBUG(1224, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy1225; - if (yych != 'n') goto yy53; -yy1225: - YYDEBUG(1225, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'U') goto yy1105; - if (yych == 'u') goto yy1105; - goto yy977; - } -yy1226: - YYDEBUG(1226, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'E') goto yy1067; - if (yych == 'e') goto yy1067; - goto yy977; - } -yy1227: - YYDEBUG(1227, *YYCURSOR); - yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'X') { - if (yych == '-') goto yy950; - goto yy977; - } else { - if (yych <= 'Y') goto yy1067; - if (yych == 'y') goto yy1067; - goto yy977; - } -yy1228: - YYDEBUG(1228, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy765; - goto yy914; - } else { - if (yych <= ',') goto yy765; - if (yych <= '-') goto yy915; - goto yy914; - } - } else { - if (yych <= 'U') { - if (yych <= '/') goto yy913; - if (yych <= 'T') goto yy765; - goto yy74; - } else { - if (yych == 'u') goto yy74; - goto yy765; - } - } -yy1229: - YYDEBUG(1229, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'P') { - if (yych == 'C') goto yy125; - if (yych <= 'O') goto yy53; - goto yy773; - } else { - if (yych <= 'c') { - if (yych <= 'b') goto yy53; - goto yy125; - } else { - if (yych == 'p') goto yy773; - goto yy53; - } - } -yy1230: - YYDEBUG(1230, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '9') { - if (yych <= ',') { - if (yych == '\t') goto yy1232; - goto yy1234; - } else { - if (yych <= '-') goto yy1231; - if (yych <= '.') goto yy914; - if (yych <= '/') goto yy913; - goto yy924; - } - } else { - if (yych <= 'q') { - if (yych == 'n') goto yy673; - goto yy1234; - } else { - if (yych <= 'r') goto yy674; - if (yych <= 's') goto yy667; - if (yych <= 't') goto yy671; - goto yy1234; - } - } -yy1231: - YYDEBUG(1231, *YYCURSOR); - yych = *++YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case '0': goto yy1235; - case '1': goto yy1236; - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy804; - case 'A': - case 'a': goto yy808; - case 'D': - case 'd': goto yy812; - case 'F': - case 'f': goto yy806; - case 'J': - case 'j': goto yy805; - case 'M': - case 'm': goto yy807; - case 'N': - case 'n': goto yy811; - case 'O': - case 'o': goto yy810; - case 'S': - case 's': goto yy809; - default: goto yy765; - } -yy1232: - YYDEBUG(1232, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy1234; - if (yych <= '0') goto yy919; - if (yych <= '1') goto yy920; - if (yych <= '9') goto yy921; - goto yy1234; -yy1233: - YYDEBUG(1233, *YYCURSOR); - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 13) YYFILL(13); - yych = *YYCURSOR; -yy1234: - YYDEBUG(1234, *YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': - case ' ': goto yy1233; - case '-': - case '.': goto yy764; - case 'A': - case 'a': goto yy761; - case 'D': - case 'd': goto yy669; - case 'F': - case 'f': goto yy670; - case 'H': - case 'h': goto yy60; - case 'I': goto yy678; - case 'J': - case 'j': goto yy682; - case 'M': - case 'm': goto yy668; - case 'N': - case 'n': goto yy685; - case 'O': - case 'o': goto yy684; - case 'S': - case 's': goto yy666; - case 'T': - case 't': goto yy65; - case 'V': goto yy680; - case 'W': - case 'w': goto yy62; - case 'X': goto yy681; - case 'Y': - case 'y': goto yy64; - default: goto yy53; - } -yy1235: - YYDEBUG(1235, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') { - if (yych <= ',') goto yy53; - if (yych <= '-') goto yy841; - goto yy789; - } else { - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1237; - goto yy53; - } -yy1236: - YYDEBUG(1236, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '.') { - if (yych <= ',') goto yy53; - if (yych <= '-') goto yy841; - goto yy789; - } else { - if (yych <= '/') goto yy53; - if (yych >= '3') goto yy53; - } -yy1237: - YYDEBUG(1237, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= ',') goto yy53; - if (yych <= '-') goto yy1238; - if (yych <= '.') goto yy789; - goto yy53; -yy1238: - YYDEBUG(1238, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '2') { - if (yych <= '/') goto yy53; - if (yych >= '1') goto yy1240; - } else { - if (yych <= '3') goto yy1241; - if (yych <= '9') goto yy845; - goto yy53; - } - YYDEBUG(1239, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '9') goto yy1242; - if (yych <= 'm') goto yy843; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy1240: - YYDEBUG(1240, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy843; - if (yych <= '9') goto yy1242; - if (yych <= 'm') goto yy843; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy1241: - YYDEBUG(1241, *YYCURSOR); - yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '1') { - if (yych <= '/') goto yy843; - } else { - if (yych <= '9') goto yy791; - if (yych <= 'm') goto yy843; - goto yy847; - } - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy843; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy843; - } - } -yy1242: - YYDEBUG(1242, *YYCURSOR); - yyaccept = 16; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'n') { - if (yych <= '/') goto yy947; - if (yych <= '9') goto yy792; - if (yych <= 'm') goto yy947; - goto yy847; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy947; - goto yy848; - } else { - if (yych <= 's') goto yy846; - if (yych <= 't') goto yy849; - goto yy947; - } - } -yy1243: - YYDEBUG(1243, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '9') { - if (yych <= '-') { - if (yych == '\t') goto yy1232; - if (yych <= ',') goto yy1234; - goto yy1231; - } else { - if (yych <= '.') goto yy1244; - if (yych <= '/') goto yy913; - if (yych <= '5') goto yy1246; - goto yy924; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy1245; - if (yych == 'n') goto yy673; - goto yy1234; - } else { - if (yych <= 'r') goto yy674; - if (yych <= 's') goto yy667; - if (yych <= 't') goto yy671; - goto yy1234; - } - } -yy1244: - YYDEBUG(1244, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '1') { - if (yych <= '/') goto yy765; - if (yych <= '0') goto yy1268; - goto yy1269; - } else { - if (yych <= '5') goto yy1270; - if (yych <= '9') goto yy1271; - goto yy765; - } -yy1245: - YYDEBUG(1245, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1263; - if (yych <= '9') goto yy1264; - goto yy53; -yy1246: - YYDEBUG(1246, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '-') goto yy968; - if (yych <= '/') goto yy57; - if (yych >= ':') goto yy57; - YYDEBUG(1247, *YYCURSOR); - yyaccept = 25; - yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); - switch (yych) { - case '\t': - case ' ': - case 'A': - case 'D': - case 'F': - case 'H': - case 'I': - case 'J': - case 'M': - case 'N': - case 'O': - case 'S': - case 'T': - case 'V': - case 'X': - case 'Y': - case 'a': - case 'd': - case 'f': - case 'h': - case 'j': - case 'm': - case 'n': - case 'o': - case 's': - case 't': - case 'w': - case 'y': goto yy974; - case '-': goto yy971; - case '.': goto yy975; - case '/': goto yy972; - case '0': goto yy1249; - case '1': goto yy1250; - case '2': goto yy1251; - case '3': goto yy1252; - case '4': - case '5': goto yy1253; - case '6': goto yy1254; - case '7': - case '8': - case '9': goto yy51; - case ':': goto yy990; - case 'W': goto yy993; - default: goto yy1248; - } -yy1248: - YYDEBUG(1248, *YYCURSOR); -#line 1016 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("gnunocolon"); - TIMELIB_INIT; - switch (s->time->have_time) { - case 0: - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = 0; - break; - case 1: - s->time->y = timelib_get_nr((char **) &ptr, 4); - break; - default: - TIMELIB_DEINIT; - add_error(s, "Double time specification"); - return TIMELIB_ERROR; - } - s->time->have_time++; - TIMELIB_DEINIT; - return TIMELIB_GNU_NOCOLON; - } -#line 18596 "ext/date/lib/parse_date.c" -yy1249: - YYDEBUG(1249, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '0') goto yy1261; - if (yych <= '9') goto yy1262; - goto yy57; -yy1250: - YYDEBUG(1250, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '2') goto yy1260; - if (yych <= '9') goto yy1259; - goto yy57; -yy1251: - YYDEBUG(1251, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '9') goto yy1259; - goto yy57; -yy1252: - YYDEBUG(1252, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '5') goto yy1257; - if (yych <= '6') goto yy1258; - if (yych <= '9') goto yy1255; - goto yy57; -yy1253: - YYDEBUG(1253, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '9') goto yy1255; - goto yy57; -yy1254: - YYDEBUG(1254, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy57; - if (yych <= '0') goto yy1255; - if (yych <= '9') goto yy51; - goto yy57; -yy1255: - YYDEBUG(1255, *YYCURSOR); - yyaccept = 26; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy51; - } - if (yych <= 'W') { - if (yych <= 'F') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych >= ' ') goto yy57; - } else { - if (yych == 'D') goto yy57; - if (yych >= 'F') goto yy57; - } - } else { - if (yych <= 'M') { - if (yych == 'H') goto yy57; - if (yych >= 'M') goto yy57; - } else { - if (yych <= 'R') goto yy1256; - if (yych <= 'T') goto yy57; - if (yych >= 'W') goto yy57; - } - } - } else { - if (yych <= 'h') { - if (yych <= 'd') { - if (yych == 'Y') goto yy57; - if (yych >= 'd') goto yy57; - } else { - if (yych == 'f') goto yy57; - if (yych >= 'h') goto yy57; - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych >= 's') goto yy57; - } else { - if (yych <= 'w') { - if (yych >= 'w') goto yy57; - } else { - if (yych == 'y') goto yy57; - } - } - } - } -yy1256: - YYDEBUG(1256, *YYCURSOR); -#line 1062 "ext/date/lib/parse_date.re" - { - int tz_not_found; - DEBUG_OUTPUT("iso8601nocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - } - TIMELIB_DEINIT; - return TIMELIB_ISO_NOCOLON; - } -#line 18707 "ext/date/lib/parse_date.c" -yy1257: - YYDEBUG(1257, *YYCURSOR); - yyaccept = 26; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy1256; - goto yy57; - } else { - if (yych <= '/') goto yy1256; - if (yych <= '9') goto yy1004; - if (yych <= 'C') goto yy1256; - goto yy57; - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy1256; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy1256; - goto yy57; - } else { - if (yych <= 'R') goto yy1256; - if (yych <= 'T') goto yy57; - goto yy1256; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy1256; - if (yych <= 'Y') goto yy57; - goto yy1256; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy1256; - } else { - if (yych == 'g') goto yy1256; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy1256; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy1256; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy1256; - } - } - } - } -yy1258: - YYDEBUG(1258, *YYCURSOR); - yyaccept = 26; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy1256; - goto yy57; - } else { - if (yych <= '6') { - if (yych <= '/') goto yy1256; - goto yy1004; - } else { - if (yych <= '9') goto yy51; - if (yych <= 'C') goto yy1256; - goto yy57; - } - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy1256; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy1256; - goto yy57; - } else { - if (yych <= 'R') goto yy1256; - if (yych <= 'T') goto yy57; - goto yy1256; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy1256; - if (yych <= 'Y') goto yy57; - goto yy1256; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy1256; - } else { - if (yych == 'g') goto yy1256; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy1256; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy1256; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy1256; - } - } - } - } -yy1259: - YYDEBUG(1259, *YYCURSOR); - yyaccept = 26; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'V') { - if (yych <= 'D') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy1256; - goto yy57; - } else { - if (yych <= '/') goto yy1256; - if (yych <= '9') goto yy1004; - if (yych <= 'C') goto yy1256; - goto yy57; - } - } else { - if (yych <= 'H') { - if (yych == 'F') goto yy57; - if (yych <= 'G') goto yy1256; - goto yy57; - } else { - if (yych <= 'M') { - if (yych <= 'L') goto yy1256; - goto yy57; - } else { - if (yych <= 'R') goto yy1256; - if (yych <= 'T') goto yy57; - goto yy1256; - } - } - } - } else { - if (yych <= 'h') { - if (yych <= 'c') { - if (yych == 'X') goto yy1256; - if (yych <= 'Y') goto yy57; - goto yy1256; - } else { - if (yych <= 'e') { - if (yych <= 'd') goto yy57; - goto yy1256; - } else { - if (yych == 'g') goto yy1256; - goto yy57; - } - } - } else { - if (yych <= 't') { - if (yych == 'm') goto yy57; - if (yych <= 'r') goto yy1256; - goto yy57; - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy1256; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy1256; - } - } - } - } -yy1260: - YYDEBUG(1260, *YYCURSOR); - yyaccept = 26; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '9') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy1256; - goto yy57; - } else { - if (yych <= '0') { - if (yych <= '/') goto yy1256; - goto yy1028; - } else { - if (yych <= '2') goto yy1029; - if (yych <= '3') goto yy1030; - goto yy1004; - } - } - } else { - if (yych <= 'G') { - if (yych <= 'D') { - if (yych <= 'C') goto yy1256; - goto yy57; - } else { - if (yych == 'F') goto yy57; - goto yy1256; - } - } else { - if (yych <= 'L') { - if (yych <= 'H') goto yy57; - goto yy1256; - } else { - if (yych <= 'M') goto yy57; - if (yych <= 'R') goto yy1256; - goto yy57; - } - } - } - } else { - if (yych <= 'g') { - if (yych <= 'Y') { - if (yych == 'W') goto yy57; - if (yych <= 'X') goto yy1256; - goto yy57; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy1256; - goto yy57; - } else { - if (yych == 'f') goto yy57; - goto yy1256; - } - } - } else { - if (yych <= 't') { - if (yych <= 'l') { - if (yych <= 'h') goto yy57; - goto yy1256; - } else { - if (yych <= 'm') goto yy57; - if (yych <= 'r') goto yy1256; - goto yy57; - } - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy1256; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy1256; - } - } - } - } -yy1261: - YYDEBUG(1261, *YYCURSOR); - yyaccept = 26; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '9') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy1256; - goto yy57; - } else { - if (yych <= '0') { - if (yych <= '/') goto yy1256; - goto yy1060; - } else { - if (yych <= '2') goto yy1029; - if (yych <= '3') goto yy1030; - goto yy1004; - } - } - } else { - if (yych <= 'G') { - if (yych <= 'D') { - if (yych <= 'C') goto yy1256; - goto yy57; - } else { - if (yych == 'F') goto yy57; - goto yy1256; - } - } else { - if (yych <= 'L') { - if (yych <= 'H') goto yy57; - goto yy1256; - } else { - if (yych <= 'M') goto yy57; - if (yych <= 'R') goto yy1256; - goto yy57; - } - } - } - } else { - if (yych <= 'g') { - if (yych <= 'Y') { - if (yych == 'W') goto yy57; - if (yych <= 'X') goto yy1256; - goto yy57; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy1256; - goto yy57; - } else { - if (yych == 'f') goto yy57; - goto yy1256; - } - } - } else { - if (yych <= 't') { - if (yych <= 'l') { - if (yych <= 'h') goto yy57; - goto yy1256; - } else { - if (yych <= 'm') goto yy57; - if (yych <= 'r') goto yy1256; - goto yy57; - } - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy1256; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy1256; - } - } - } - } -yy1262: - YYDEBUG(1262, *YYCURSOR); - yyaccept = 26; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '9') { - if (yych <= ' ') { - if (yych == '\t') goto yy57; - if (yych <= 0x1F) goto yy1256; - goto yy57; - } else { - if (yych <= '0') { - if (yych <= '/') goto yy1256; - goto yy1028; - } else { - if (yych <= '2') goto yy1029; - if (yych <= '3') goto yy1030; - goto yy1004; - } - } - } else { - if (yych <= 'G') { - if (yych <= 'D') { - if (yych <= 'C') goto yy1256; - goto yy57; - } else { - if (yych == 'F') goto yy57; - goto yy1256; - } - } else { - if (yych <= 'L') { - if (yych <= 'H') goto yy57; - goto yy1256; - } else { - if (yych <= 'M') goto yy57; - if (yych <= 'R') goto yy1256; - goto yy57; - } - } - } - } else { - if (yych <= 'g') { - if (yych <= 'Y') { - if (yych == 'W') goto yy57; - if (yych <= 'X') goto yy1256; - goto yy57; - } else { - if (yych <= 'd') { - if (yych <= 'c') goto yy1256; - goto yy57; - } else { - if (yych == 'f') goto yy57; - goto yy1256; - } - } - } else { - if (yych <= 't') { - if (yych <= 'l') { - if (yych <= 'h') goto yy57; - goto yy1256; - } else { - if (yych <= 'm') goto yy57; - if (yych <= 'r') goto yy1256; - goto yy57; - } - } else { - if (yych <= 'w') { - if (yych <= 'v') goto yy1256; - goto yy57; - } else { - if (yych == 'y') goto yy57; - goto yy1256; - } - } - } - } -yy1263: - YYDEBUG(1263, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy1265; - goto yy694; - } else { - if (yych <= '9') goto yy1264; - if (yych <= ':') goto yy1265; - goto yy694; - } -yy1264: - YYDEBUG(1264, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy1265; - if (yych != ':') goto yy694; -yy1265: - YYDEBUG(1265, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1266; - if (yych <= '6') goto yy1267; - if (yych <= '9') goto yy699; - goto yy53; -yy1266: - YYDEBUG(1266, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy700; - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy699; - goto yy694; -yy1267: - YYDEBUG(1267, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy700; - if (yych == '0') goto yy699; - goto yy694; -yy1268: - YYDEBUG(1268, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ',') goto yy694; - if (yych <= '-') goto yy789; - goto yy1272; - } else { - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy1271; - if (yych <= ':') goto yy1265; - goto yy694; - } -yy1269: - YYDEBUG(1269, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= ',') goto yy694; - if (yych <= '-') goto yy789; - if (yych <= '.') goto yy1272; - goto yy694; - } else { - if (yych <= '2') goto yy1271; - if (yych <= '9') goto yy1264; - if (yych <= ':') goto yy1265; - goto yy694; - } -yy1270: - YYDEBUG(1270, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ',') goto yy694; - if (yych <= '-') goto yy789; - goto yy1272; - } else { - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy1264; - if (yych <= ':') goto yy1265; - goto yy694; - } -yy1271: - YYDEBUG(1271, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ',') goto yy694; - if (yych <= '-') goto yy789; - } else { - if (yych == ':') goto yy1265; - goto yy694; - } -yy1272: - YYDEBUG(1272, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '5') goto yy1273; - if (yych <= '6') goto yy1274; - if (yych <= '9') goto yy797; - goto yy53; -yy1273: - YYDEBUG(1273, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy700; - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy1275; - goto yy694; -yy1274: - YYDEBUG(1274, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych == '.') goto yy700; - goto yy694; - } else { - if (yych <= '0') goto yy1275; - if (yych <= '9') goto yy798; - goto yy694; - } -yy1275: - YYDEBUG(1275, *YYCURSOR); - yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == '.') goto yy700; - if (yych <= '/') goto yy694; - if (yych <= '9') goto yy792; - goto yy694; -yy1276: - YYDEBUG(1276, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '9') { - if (yych <= '-') { - if (yych == '\t') goto yy663; - if (yych <= ',') goto yy665; - goto yy1231; - } else { - if (yych <= '.') goto yy677; - if (yych <= '/') goto yy675; - if (yych <= '5') goto yy1246; - goto yy924; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy686; - if (yych == 'n') goto yy673; - goto yy665; - } else { - if (yych <= 'r') goto yy674; - if (yych <= 's') goto yy667; - if (yych <= 't') goto yy671; - goto yy665; - } - } -yy1277: - YYDEBUG(1277, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '9') { - if (yych <= '-') { - if (yych == '\t') goto yy1232; - if (yych <= ',') goto yy1234; - goto yy1231; - } else { - if (yych <= '.') goto yy1244; - if (yych <= '/') goto yy675; - if (yych <= '5') goto yy1246; - goto yy924; - } - } else { - if (yych <= 'q') { - if (yych <= ':') goto yy1245; - if (yych == 'n') goto yy673; - goto yy1234; - } else { - if (yych <= 'r') goto yy674; - if (yych <= 's') goto yy667; - if (yych <= 't') goto yy671; - goto yy1234; - } - } -yy1278: - YYDEBUG(1278, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; -yy1279: - YYDEBUG(1279, *YYCURSOR); - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(1280, *YYCURSOR); - if (yych <= '/') goto yy1281; - if (yych <= '9') goto yy1279; -yy1281: - YYDEBUG(1281, *YYCURSOR); -#line 949 "ext/date/lib/parse_date.re" - { - timelib_ull i; - - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_DATE(); - TIMELIB_UNHAVE_TIME(); - - i = timelib_get_unsigned_nr((char **) &ptr, 24); - s->time->y = 1970; - s->time->m = 1; - s->time->d = 1; - s->time->h = s->time->i = s->time->s = 0; - s->time->f = 0.0; - s->time->relative.s += i; - s->time->is_localtime = 1; - s->time->zone_type = TIMELIB_ZONETYPE_OFFSET; - s->time->z = 0; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 19350 "ext/date/lib/parse_date.c" -yy1282: - YYDEBUG(1282, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - goto yy1322; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'n') goto yy1322; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1283: - YYDEBUG(1283, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych == 'I') goto yy1316; - if (yych <= 'T') goto yy138; - goto yy1315; - } - } else { - if (yych <= 'i') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - if (yych <= 'h') goto yy138; - goto yy1316; - } else { - if (yych == 'u') goto yy1315; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1284: - YYDEBUG(1284, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'M') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych == 'D') goto yy1304; - if (yych <= 'L') goto yy138; - goto yy1305; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - if (yych <= 'c') goto yy138; - goto yy1304; - } else { - if (yych == 'm') goto yy1305; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1285: - YYDEBUG(1285, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy138; - goto yy1300; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'e') goto yy1300; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1286: - YYDEBUG(1286, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy138; - goto yy1296; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'e') goto yy1296; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1287: - YYDEBUG(1287, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy1245; - goto yy53; - } else { - if (yych <= '9') goto yy1290; - if (yych <= ':') goto yy1245; - goto yy53; - } -yy1288: - YYDEBUG(1288, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy1245; - goto yy53; - } else { - if (yych <= '3') goto yy1290; - if (yych == ':') goto yy1245; - goto yy53; - } -yy1289: - YYDEBUG(1289, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '.') goto yy1245; - if (yych == ':') goto yy1245; - goto yy53; -yy1290: - YYDEBUG(1290, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy1245; - goto yy53; - } else { - if (yych <= '5') goto yy1291; - if (yych == ':') goto yy1245; - goto yy53; - } -yy1291: - YYDEBUG(1291, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych >= ':') goto yy53; - YYDEBUG(1292, *YYCURSOR); - yyaccept = 25; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy1248; - if (yych <= '5') goto yy1293; - if (yych <= '6') goto yy1294; - goto yy1248; -yy1293: - YYDEBUG(1293, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy53; - if (yych <= '9') goto yy1295; - goto yy53; -yy1294: - YYDEBUG(1294, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '0') goto yy53; -yy1295: - YYDEBUG(1295, *YYCURSOR); - yych = *++YYCURSOR; - goto yy1256; -yy1296: - YYDEBUG(1296, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'L') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'K') goto yy139; - } - } else { - if (yych <= 'k') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'l') goto yy1297; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1297: - YYDEBUG(1297, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'F') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'E') goto yy140; - } - } else { - if (yych <= 'e') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'f') goto yy1298; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1298: - YYDEBUG(1298, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy141; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 't') goto yy1299; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy1299: - YYDEBUG(1299, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'G') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'H') goto yy160; - if (yych == 'h') goto yy160; - goto yy3; - } -yy1300: - YYDEBUG(1300, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych <= ')') { - if (yych <= '(') goto yy276; - goto yy136; - } else { - if (yych <= '@') goto yy276; - if (yych <= 'R') goto yy139; - } - } else { - if (yych <= 'r') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy276; - goto yy139; - } else { - if (yych <= 's') goto yy1301; - if (yych <= 'z') goto yy139; - goto yy276; - } - } -yy1301: - YYDEBUG(1301, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy140; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'd') goto yy1302; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1302: - YYDEBUG(1302, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - goto yy3; - } else { - if (yych <= 'a') goto yy1303; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy1303: - YYDEBUG(1303, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'X') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Y') goto yy282; - if (yych == 'y') goto yy282; - goto yy3; - } -yy1304: - YYDEBUG(1304, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy1312; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - goto yy3; - } else { - if (yych <= 'a') goto yy1312; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1305: - YYDEBUG(1305, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'O') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'N') goto yy139; - } - } else { - if (yych <= 'n') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'o') goto yy1306; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1306: - YYDEBUG(1306, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy140; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'r') goto yy1307; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1307: - YYDEBUG(1307, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy141; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'r') goto yy1308; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy1308: - YYDEBUG(1308, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'O') goto yy1309; - if (yych != 'o') goto yy3; - } -yy1309: - YYDEBUG(1309, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'W') goto yy1310; - if (yych != 'w') goto yy53; -yy1310: - YYDEBUG(1310, *YYCURSOR); - ++YYCURSOR; -yy1311: - YYDEBUG(1311, *YYCURSOR); -#line 937 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("tomorrow"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = 1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 19797 "ext/date/lib/parse_date.c" -yy1312: - YYDEBUG(1312, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'X') goto yy140; - } - } else { - if (yych <= 'x') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'y') goto yy1313; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1313: - YYDEBUG(1313, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= '@') { - if (yych == ')') goto yy136; - } else { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy1314; - if (yych <= 'z') goto yy141; - } -yy1314: - YYDEBUG(1314, *YYCURSOR); -#line 927 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("midnight | today"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 19841 "ext/date/lib/parse_date.c" -yy1315: - YYDEBUG(1315, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy276; - goto yy136; - } else { - if (yych <= '@') goto yy276; - if (yych <= 'Q') goto yy139; - goto yy1318; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy276; - goto yy139; - } else { - if (yych <= 'r') goto yy1318; - if (yych <= 'z') goto yy139; - goto yy276; - } - } -yy1316: - YYDEBUG(1316, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'Q') goto yy139; - if (yych >= 'S') goto yy250; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'r') goto yy1317; - if (yych <= 's') goto yy250; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1317: - YYDEBUG(1317, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy140; - goto yy263; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'd') goto yy263; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1318: - YYDEBUG(1318, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy140; - } - } else { - if (yych <= 'r') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 's') goto yy1319; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1319: - YYDEBUG(1319, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy141; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'd') goto yy1320; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy1320: - YYDEBUG(1320, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'A') goto yy1321; - if (yych != 'a') goto yy3; - } -yy1321: - YYDEBUG(1321, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy282; - if (yych == 'y') goto yy282; - goto yy53; -yy1322: - YYDEBUG(1322, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 't') goto yy1323; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1323: - YYDEBUG(1323, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'H') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy263; - } - } else { - if (yych <= 'g') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'h') goto yy263; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1324: - YYDEBUG(1324, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - goto yy1322; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy1353; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy1325: - YYDEBUG(1325, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'U') { - if (yych <= '/') { - if (yych == ')') goto yy136; - if (yych <= '.') goto yy3; - goto yy144; - } else { - if (yych <= 'H') { - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'I') goto yy1316; - if (yych <= 'T') goto yy138; - goto yy1315; - } - } - } else { - if (yych <= 'h') { - if (yych <= '^') { - if (yych <= 'Z') goto yy138; - goto yy3; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy3; - goto yy143; - } - } else { - if (yych <= 't') { - if (yych <= 'i') goto yy1347; - goto yy143; - } else { - if (yych <= 'u') goto yy1346; - if (yych <= 'z') goto yy143; - goto yy3; - } - } - } -yy1326: - YYDEBUG(1326, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'M') { - if (yych <= '/') { - if (yych == ')') goto yy136; - if (yych <= '.') goto yy3; - goto yy144; - } else { - if (yych <= 'C') { - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'D') goto yy1304; - if (yych <= 'L') goto yy138; - goto yy1305; - } - } - } else { - if (yych <= 'c') { - if (yych <= '^') { - if (yych <= 'Z') goto yy138; - goto yy3; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy3; - goto yy143; - } - } else { - if (yych <= 'l') { - if (yych <= 'd') goto yy1337; - goto yy143; - } else { - if (yych <= 'm') goto yy1338; - if (yych <= 'z') goto yy143; - goto yy3; - } - } - } -yy1327: - YYDEBUG(1327, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy138; - goto yy1300; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy1333; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy1328: - YYDEBUG(1328, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy138; - goto yy1296; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy1329; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy1329: - YYDEBUG(1329, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'L') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'K') goto yy139; - goto yy1297; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'l') goto yy1330; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy1330: - YYDEBUG(1330, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'F') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'E') goto yy140; - goto yy1298; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'f') goto yy1331; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1331: - YYDEBUG(1331, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy141; - goto yy1299; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy1332; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy1332: - YYDEBUG(1332, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'G') goto yy3; - goto yy160; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy247; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy1333: - YYDEBUG(1333, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy276; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy276; - if (yych <= 'R') goto yy139; - goto yy1301; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy276; - } else { - if (yych == 's') goto yy1334; - if (yych <= 'z') goto yy148; - goto yy276; - } - } -yy1334: - YYDEBUG(1334, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy140; - goto yy1302; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'd') goto yy1335; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1335: - YYDEBUG(1335, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy1303; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy141; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy1336; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy1336: - YYDEBUG(1336, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Y') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'X') goto yy3; - goto yy282; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'y') goto yy295; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy1337: - YYDEBUG(1337, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy1312; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy139; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy1344; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy1338: - YYDEBUG(1338, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'O') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'N') goto yy139; - goto yy1306; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'o') goto yy1339; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy1339: - YYDEBUG(1339, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy140; - goto yy1307; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'r') goto yy1340; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1340: - YYDEBUG(1340, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy141; - goto yy1308; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'r') goto yy1341; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy1341: - YYDEBUG(1341, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'O') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'N') goto yy3; - goto yy1309; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'o') goto yy1342; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy1342: - YYDEBUG(1342, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'W') goto yy1310; - if (yych != 'w') goto yy152; - YYDEBUG(1343, *YYCURSOR); - yyaccept = 27; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '^') { - if (yych == '/') goto yy144; - goto yy1311; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy1311; - if (yych <= 'z') goto yy151; - goto yy1311; - } -yy1344: - YYDEBUG(1344, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Y') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'X') goto yy140; - goto yy1313; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'y') goto yy1345; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1345: - YYDEBUG(1345, *YYCURSOR); - yyaccept = 28; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy1314; - goto yy136; - } else { - if (yych == '/') goto yy144; - goto yy1314; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy141; - if (yych <= '^') goto yy1314; - goto yy144; - } else { - if (yych <= '`') goto yy1314; - if (yych <= 'z') goto yy150; - goto yy1314; - } - } -yy1346: - YYDEBUG(1346, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy276; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy276; - if (yych <= 'Q') goto yy139; - goto yy1318; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy276; - } else { - if (yych == 'r') goto yy1349; - if (yych <= 'z') goto yy148; - goto yy276; - } - } -yy1347: - YYDEBUG(1347, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych <= '/') { - if (yych == ')') goto yy136; - if (yych <= '.') goto yy3; - goto yy144; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy139; - if (yych <= 'R') goto yy1317; - goto yy250; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych <= 'r') { - if (yych <= 'q') goto yy148; - } else { - if (yych <= 's') goto yy253; - if (yych <= 'z') goto yy148; - goto yy3; - } - } - } - YYDEBUG(1348, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy140; - goto yy263; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'd') goto yy273; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1349: - YYDEBUG(1349, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy140; - goto yy1319; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 's') goto yy1350; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1350: - YYDEBUG(1350, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy141; - goto yy1320; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'd') goto yy1351; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy1351: - YYDEBUG(1351, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy1321; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych <= 'a') goto yy1352; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy1352: - YYDEBUG(1352, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy282; - if (yych == 'y') goto yy295; - goto yy152; -yy1353: - YYDEBUG(1353, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - goto yy1323; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy1354; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy1354: - YYDEBUG(1354, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy263; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy273; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1355: - YYDEBUG(1355, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych <= '@') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych == 'R') goto yy1367; - if (yych <= 'X') goto yy138; - goto yy1368; - } - } else { - if (yych <= 'r') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - if (yych <= 'q') goto yy138; - goto yy1367; - } else { - if (yych == 'y') goto yy1368; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1356: - YYDEBUG(1356, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy138; - goto yy1361; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'd') goto yy1361; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1357: - YYDEBUG(1357, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'n') goto yy1358; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1358: - YYDEBUG(1358, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'D') { - if (yych <= ')') { - if (yych <= '(') goto yy276; - goto yy136; - } else { - if (yych <= '@') goto yy276; - if (yych <= 'C') goto yy139; - } - } else { - if (yych <= 'c') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy276; - goto yy139; - } else { - if (yych <= 'd') goto yy1359; - if (yych <= 'z') goto yy139; - goto yy276; - } - } -yy1359: - YYDEBUG(1359, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'A') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - goto yy3; - } else { - if (yych <= 'a') goto yy1360; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1360: - YYDEBUG(1360, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'Y') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'X') goto yy141; - goto yy501; - } - } else { - if (yych <= 'x') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'y') goto yy501; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy1361: - YYDEBUG(1361, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy139; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'n') goto yy1362; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1362: - YYDEBUG(1362, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'I') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'H') goto yy140; - } - } else { - if (yych <= 'h') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'i') goto yy1363; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1363: - YYDEBUG(1363, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'G') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'F') goto yy141; - } - } else { - if (yych <= 'f') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'g') goto yy1364; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy1364: - YYDEBUG(1364, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'G') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'H') goto yy1365; - if (yych != 'h') goto yy3; - } -yy1365: - YYDEBUG(1365, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy1366; - if (yych != 't') goto yy53; -yy1366: - YYDEBUG(1366, *YYCURSOR); - yych = *++YYCURSOR; - goto yy1314; -yy1367: - YYDEBUG(1367, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych == 'C') goto yy1369; - goto yy139; - } - } else { - if (yych <= 'b') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 'c') goto yy1369; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy1368: - YYDEBUG(1368, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '-') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy303; - goto yy305; - } else { - if (yych == ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } - } else { - if (yych <= '@') { - if (yych == '/') goto yy303; - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy303; - if (yych <= 'z') goto yy139; - goto yy303; - } - } -yy1369: - YYDEBUG(1369, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'H') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy559; - } - } else { - if (yych <= 'g') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'h') goto yy559; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1370: - YYDEBUG(1370, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Y') { - if (yych <= '/') { - if (yych == ')') goto yy136; - if (yych <= '.') goto yy3; - goto yy144; - } else { - if (yych <= 'Q') { - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'R') goto yy1367; - if (yych <= 'X') goto yy138; - goto yy1368; - } - } - } else { - if (yych <= 'q') { - if (yych <= '^') { - if (yych <= 'Z') goto yy138; - goto yy3; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy3; - goto yy143; - } - } else { - if (yych <= 'x') { - if (yych <= 'r') goto yy1382; - goto yy143; - } else { - if (yych <= 'y') goto yy1383; - if (yych <= 'z') goto yy143; - goto yy3; - } - } - } -yy1371: - YYDEBUG(1371, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'C') goto yy138; - goto yy1361; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'd') goto yy1376; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy1372: - YYDEBUG(1372, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - goto yy1358; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy1373; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy1373: - YYDEBUG(1373, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy276; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy276; - if (yych <= 'C') goto yy139; - goto yy1359; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy276; - } else { - if (yych == 'd') goto yy1374; - if (yych <= 'z') goto yy148; - goto yy276; - } - } -yy1374: - YYDEBUG(1374, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'A') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - goto yy1360; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy140; - if (yych <= '^') goto yy3; - goto yy144; - } else { - if (yych <= '`') goto yy3; - if (yych <= 'a') goto yy1375; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1375: - YYDEBUG(1375, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'Y') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'X') goto yy141; - goto yy501; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'y') goto yy530; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy1376: - YYDEBUG(1376, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy139; - goto yy1362; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy1377; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy1377: - YYDEBUG(1377, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'I') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'H') goto yy140; - goto yy1363; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'i') goto yy1378; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1378: - YYDEBUG(1378, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'G') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'F') goto yy141; - goto yy1364; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'g') goto yy1379; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy1379: - YYDEBUG(1379, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'G') goto yy3; - goto yy1365; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy1380; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy1380: - YYDEBUG(1380, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy1366; - if (yych != 't') goto yy152; - YYDEBUG(1381, *YYCURSOR); - yyaccept = 28; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '^') { - if (yych == '/') goto yy144; - goto yy1314; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy1314; - if (yych <= 'z') goto yy151; - goto yy1314; - } -yy1382: - YYDEBUG(1382, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'B') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'C') goto yy1369; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 'b') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'c') goto yy1384; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy1383: - YYDEBUG(1383, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '.') { - if (yych <= ' ') { - if (yych == '\t') goto yy305; - if (yych <= 0x1F) goto yy303; - goto yy305; - } else { - if (yych <= ')') { - if (yych <= '(') goto yy303; - goto yy136; - } else { - if (yych <= ',') goto yy303; - if (yych <= '-') goto yy306; - goto yy305; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '/') goto yy144; - if (yych <= '9') goto yy305; - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy303; - goto yy144; - } else { - if (yych <= '`') goto yy303; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy1384: - YYDEBUG(1384, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy559; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy570; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1385: - YYDEBUG(1385, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'W') { - if (yych <= 'N') { - if (yych == ')') goto yy136; - if (yych <= '@') goto yy3; - goto yy138; - } else { - if (yych <= 'O') goto yy1393; - if (yych <= 'U') goto yy138; - if (yych <= 'V') goto yy1394; - goto yy1391; - } - } else { - if (yych <= 'o') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - if (yych <= 'n') goto yy138; - goto yy1393; - } else { - if (yych <= 'v') { - if (yych <= 'u') goto yy138; - goto yy1394; - } else { - if (yych <= 'w') goto yy1391; - if (yych <= 'z') goto yy138; - goto yy3; - } - } - } -yy1386: - YYDEBUG(1386, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'X') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'W') goto yy138; - goto yy1390; - } - } else { - if (yych <= 'w') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'x') goto yy1390; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1387: - YYDEBUG(1387, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 'n') goto yy1388; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1388: - YYDEBUG(1388, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 't') goto yy1389; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1389: - YYDEBUG(1389, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'H') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy263; - } - } else { - if (yych <= 'g') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'h') goto yy263; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1390: - YYDEBUG(1390, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - goto yy250; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 't') goto yy250; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1391: - YYDEBUG(1391, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= '@') { - if (yych == ')') goto yy136; - } else { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy1392; - if (yych <= 'z') goto yy139; - } -yy1392: - YYDEBUG(1392, *YYCURSOR); -#line 906 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("now"); - TIMELIB_INIT; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 21622 "ext/date/lib/parse_date.c" -yy1393: - YYDEBUG(1393, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy139; - goto yy1399; - } - } else { - if (yych <= 'm') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 'n') goto yy1399; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1394: - YYDEBUG(1394, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= ',') { - if (yych <= ')') goto yy136; - goto yy303; - } else { - if (yych <= '-') goto yy306; - if (yych <= '.') goto yy305; - goto yy303; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '@') { - if (yych <= '9') goto yy305; - goto yy303; - } else { - if (yych != 'E') goto yy139; - } - } else { - if (yych <= 'd') { - if (yych <= '`') goto yy303; - goto yy139; - } else { - if (yych <= 'e') goto yy1395; - if (yych <= 'z') goto yy139; - goto yy303; - } - } - } -yy1395: - YYDEBUG(1395, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'M') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'L') goto yy140; - } - } else { - if (yych <= 'l') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'm') goto yy1396; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1396: - YYDEBUG(1396, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'B') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy141; - } - } else { - if (yych <= 'a') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'b') goto yy1397; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy1397: - YYDEBUG(1397, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'E') goto yy1398; - if (yych != 'e') goto yy3; - } -yy1398: - YYDEBUG(1398, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy315; - if (yych == 'r') goto yy315; - goto yy53; -yy1399: - YYDEBUG(1399, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) <= '@') { - if (yych == ')') goto yy136; - } else { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy1400; - if (yych <= 'z') goto yy140; - } -yy1400: - YYDEBUG(1400, *YYCURSOR); -#line 915 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("noon"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - TIMELIB_HAVE_TIME(); - s->time->h = 12; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 21772 "ext/date/lib/parse_date.c" -yy1401: - YYDEBUG(1401, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'W') { - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych == '/') goto yy144; - goto yy3; - } - } else { - if (yych <= 'O') { - if (yych <= 'N') goto yy138; - goto yy1393; - } else { - if (yych <= 'U') goto yy138; - if (yych <= 'V') goto yy1394; - goto yy1391; - } - } - } else { - if (yych <= 'n') { - if (yych <= '^') { - if (yych <= 'Z') goto yy138; - goto yy3; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy3; - goto yy143; - } - } else { - if (yych <= 'v') { - if (yych <= 'o') goto yy1408; - if (yych <= 'u') goto yy143; - goto yy1409; - } else { - if (yych <= 'w') goto yy1407; - if (yych <= 'z') goto yy143; - goto yy3; - } - } - } -yy1402: - YYDEBUG(1402, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'X') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'W') goto yy138; - goto yy1390; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'x') goto yy1406; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy1403: - YYDEBUG(1403, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy138; - goto yy1388; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy1404; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy1404: - YYDEBUG(1404, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - goto yy1389; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy1405; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy1405: - YYDEBUG(1405, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'H') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'G') goto yy140; - goto yy263; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'h') goto yy273; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1406: - YYDEBUG(1406, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - goto yy250; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy253; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy1407: - YYDEBUG(1407, *YYCURSOR); - yyaccept = 29; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy1392; - goto yy136; - } else { - if (yych == '/') goto yy144; - goto yy1392; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy139; - if (yych <= '^') goto yy1392; - goto yy144; - } else { - if (yych <= '`') goto yy1392; - if (yych <= 'z') goto yy148; - goto yy1392; - } - } -yy1408: - YYDEBUG(1408, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'M') goto yy139; - goto yy1399; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'n') goto yy1414; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy1409: - YYDEBUG(1409, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '9') { - if (yych <= '(') { - if (yych <= '\t') { - if (yych <= 0x08) goto yy303; - goto yy305; - } else { - if (yych == ' ') goto yy305; - goto yy303; - } - } else { - if (yych <= '-') { - if (yych <= ')') goto yy136; - if (yych <= ',') goto yy303; - goto yy306; - } else { - if (yych == '/') goto yy144; - goto yy305; - } - } - } else { - if (yych <= '^') { - if (yych <= 'D') { - if (yych <= '@') goto yy303; - goto yy139; - } else { - if (yych <= 'E') goto yy1395; - if (yych <= 'Z') goto yy139; - goto yy303; - } - } else { - if (yych <= 'd') { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy303; - goto yy148; - } else { - if (yych <= 'e') goto yy1410; - if (yych <= 'z') goto yy148; - goto yy303; - } - } - } -yy1410: - YYDEBUG(1410, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'M') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'L') goto yy140; - goto yy1396; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'm') goto yy1411; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1411: - YYDEBUG(1411, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'B') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'A') goto yy141; - goto yy1397; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'b') goto yy1412; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy1412: - YYDEBUG(1412, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'D') goto yy3; - goto yy1398; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy1413; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy1413: - YYDEBUG(1413, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy315; - if (yych == 'r') goto yy483; - goto yy152; -yy1414: - YYDEBUG(1414, *YYCURSOR); - yyaccept = 30; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '@') { - if (yych <= ')') { - if (yych <= '(') goto yy1400; - goto yy136; - } else { - if (yych == '/') goto yy144; - goto yy1400; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy140; - if (yych <= '^') goto yy1400; - goto yy144; - } else { - if (yych <= '`') goto yy1400; - if (yych <= 'z') goto yy149; - goto yy1400; - } - } -yy1415: - YYDEBUG(1415, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'S') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy138; - } - } else { - if (yych <= 'r') { - if (yych <= 'Z') goto yy138; - if (yych <= '`') goto yy3; - goto yy138; - } else { - if (yych <= 's') goto yy1416; - if (yych <= 'z') goto yy138; - goto yy3; - } - } -yy1416: - YYDEBUG(1416, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'T') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - } - } else { - if (yych <= 's') { - if (yych <= 'Z') goto yy139; - if (yych <= '`') goto yy3; - goto yy139; - } else { - if (yych <= 't') goto yy1417; - if (yych <= 'z') goto yy139; - goto yy3; - } - } -yy1417: - YYDEBUG(1417, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'E') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy140; - } - } else { - if (yych <= 'd') { - if (yych <= 'Z') goto yy140; - if (yych <= '`') goto yy3; - goto yy140; - } else { - if (yych <= 'e') goto yy1418; - if (yych <= 'z') goto yy140; - goto yy3; - } - } -yy1418: - YYDEBUG(1418, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'R') { - if (yych <= ')') { - if (yych <= '(') goto yy3; - goto yy136; - } else { - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy141; - } - } else { - if (yych <= 'q') { - if (yych <= 'Z') goto yy141; - if (yych <= '`') goto yy3; - goto yy141; - } else { - if (yych <= 'r') goto yy1419; - if (yych <= 'z') goto yy141; - goto yy3; - } - } -yy1419: - YYDEBUG(1419, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'C') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= 'D') goto yy1420; - if (yych != 'd') goto yy3; - } -yy1420: - YYDEBUG(1420, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy1421; - if (yych != 'a') goto yy53; -yy1421: - YYDEBUG(1421, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy1422; - if (yych != 'y') goto yy53; -yy1422: - YYDEBUG(1422, *YYCURSOR); - ++YYCURSOR; -yy1423: - YYDEBUG(1423, *YYCURSOR); -#line 894 "ext/date/lib/parse_date.re" - { - DEBUG_OUTPUT("yesterday"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = -1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } -#line 22263 "ext/date/lib/parse_date.c" -yy1424: - YYDEBUG(1424, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'S') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'R') goto yy138; - goto yy1416; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy138; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 's') goto yy1425; - if (yych <= 'z') goto yy143; - goto yy3; - } - } -yy1425: - YYDEBUG(1425, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'T') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'S') goto yy139; - goto yy1417; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy139; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 't') goto yy1426; - if (yych <= 'z') goto yy148; - goto yy3; - } - } -yy1426: - YYDEBUG(1426, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'D') goto yy140; - goto yy1418; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy140; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'e') goto yy1427; - if (yych <= 'z') goto yy149; - goto yy3; - } - } -yy1427: - YYDEBUG(1427, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'R') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= '@') goto yy3; - if (yych <= 'Q') goto yy141; - goto yy1419; - } - } else { - if (yych <= '`') { - if (yych <= 'Z') goto yy141; - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'r') goto yy1428; - if (yych <= 'z') goto yy150; - goto yy3; - } - } -yy1428: - YYDEBUG(1428, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'D') { - if (yych <= '.') { - if (yych == ')') goto yy136; - goto yy3; - } else { - if (yych <= '/') goto yy144; - if (yych <= 'C') goto yy3; - goto yy1420; - } - } else { - if (yych <= '`') { - if (yych == '_') goto yy144; - goto yy3; - } else { - if (yych == 'd') goto yy1429; - if (yych <= 'z') goto yy151; - goto yy3; - } - } -yy1429: - YYDEBUG(1429, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy1421; - if (yych != 'a') goto yy152; - YYDEBUG(1430, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'Y') goto yy1422; - if (yych != 'y') goto yy152; - YYDEBUG(1431, *YYCURSOR); - yyaccept = 31; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '^') { - if (yych == '/') goto yy144; - goto yy1423; - } else { - if (yych <= '_') goto yy144; - if (yych <= '`') goto yy1423; - if (yych <= 'z') goto yy151; - goto yy1423; - } -} -#line 1545 "ext/date/lib/parse_date.re" - -} - -#define YYMAXFILL 29 - -timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb) -{ - Scanner in; - int t; - char *e = s + len - 1; - - memset(&in, 0, sizeof(in)); - in.errors = malloc(sizeof(struct timelib_error_container)); - in.errors->warning_count = 0; - in.errors->warning_messages = NULL; - in.errors->error_count = 0; - in.errors->error_messages = NULL; - - if (len > 0) { - while (isspace(*s) && s < e) { - s++; - } - while (isspace(*e) && e > s) { - e--; - } - } - if (e - s < 0) { - in.time = timelib_time_ctor(); - add_error(&in, "Empty string"); - if (errors) { - *errors = in.errors; - } else { - timelib_error_container_dtor(in.errors); - } - in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->dst = in.time->z = TIMELIB_UNSET; - in.time->is_localtime = in.time->zone_type = 0; - return in.time; - } - e++; - - in.str = malloc((e - s) + YYMAXFILL); - memset(in.str, 0, (e - s) + YYMAXFILL); - memcpy(in.str, s, (e - s)); - in.lim = in.str + (e - s) + YYMAXFILL; - in.cur = in.str; - in.time = timelib_time_ctor(); - in.time->y = TIMELIB_UNSET; - in.time->d = TIMELIB_UNSET; - in.time->m = TIMELIB_UNSET; - in.time->h = TIMELIB_UNSET; - in.time->i = TIMELIB_UNSET; - in.time->s = TIMELIB_UNSET; - in.time->f = TIMELIB_UNSET; - in.time->z = TIMELIB_UNSET; - in.time->dst = TIMELIB_UNSET; - in.tzdb = tzdb; - in.time->is_localtime = 0; - in.time->zone_type = 0; - - do { - t = scan(&in); -#ifdef DEBUG_PARSER - printf("%d\n", t); -#endif - } while(t != EOI); - - free(in.str); - if (errors) { - *errors = in.errors; - } else { - timelib_error_container_dtor(in.errors); - } - return in.time; -} - -void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options) -{ - if (!(options & TIMELIB_OVERRIDE_TIME) && parsed->have_date && !parsed->have_time) { - parsed->h = 0; - parsed->i = 0; - parsed->s = 0; - parsed->f = 0; - } - if (parsed->y == TIMELIB_UNSET) parsed->y = now->y != TIMELIB_UNSET ? now->y : 0; - if (parsed->d == TIMELIB_UNSET) parsed->d = now->d != TIMELIB_UNSET ? now->d : 0; - if (parsed->m == TIMELIB_UNSET) parsed->m = now->m != TIMELIB_UNSET ? now->m : 0; - if (parsed->h == TIMELIB_UNSET) parsed->h = now->h != TIMELIB_UNSET ? now->h : 0; - if (parsed->i == TIMELIB_UNSET) parsed->i = now->i != TIMELIB_UNSET ? now->i : 0; - if (parsed->s == TIMELIB_UNSET) parsed->s = now->s != TIMELIB_UNSET ? now->s : 0; - if (parsed->f == TIMELIB_UNSET) parsed->f = now->f != TIMELIB_UNSET ? now->f : 0; - if (parsed->z == TIMELIB_UNSET) parsed->z = now->z != TIMELIB_UNSET ? now->z : 0; - if (parsed->dst == TIMELIB_UNSET) parsed->dst = now->dst != TIMELIB_UNSET ? now->dst : 0; - - if (!parsed->tz_abbr) { - parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - } - if (!parsed->tz_info) { - parsed->tz_info = now->tz_info ? (!(options & TIMELIB_NO_CLONE) ? timelib_tzinfo_clone(now->tz_info) : now->tz_info) : NULL; - } - if (parsed->zone_type == 0 && now->zone_type != 0) { - parsed->zone_type = now->zone_type; -/* parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL; -*/ parsed->is_localtime = 1; - } -/* timelib_dump_date(parsed, 2); - timelib_dump_date(now, 2); -*/ -} - -char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst) -{ - const timelib_tz_lookup_table *tp; - - tp = zone_search(abbr, gmtoffset, isdst); - if (tp) { - return (tp->full_tz_name); - } else { - return NULL; - } -} - -const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void) -{ - return timelib_timezone_lookup; -} - -#ifdef DEBUG_PARSER_STUB -int main(void) -{ - timelib_time time = timelib_strtotime("May 12"); - - printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d", - time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst); - if (time.have_relative) { - printf ("%3dY %3dM %3dD / %3dH %3dM %3dS", - time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s); - } - if (time.have_weekday_relative) { - printf (" / %d", time.relative.weekday); - } - if (time.have_weeknr_day) { - printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek); - } - return 0; -} -#endif - -/* - * vim: syntax=c - */ diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re deleted file mode 100644 index ec23013941fea..0000000000000 --- a/ext/date/lib/parse_date.re +++ /dev/null @@ -1,1695 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -#include -#include - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#else -#include -#endif - -#if defined(_MSC_VER) -# define strtoll(s, f, b) _atoi64(s) -#elif !defined(HAVE_STRTOLL) -# if defined(HAVE_ATOLL) -# define strtoll(s, f, b) atoll(s) -# else -# define strtoll(s, f, b) strtol(s, f, b) -# endif -#endif - -#define TIMELIB_UNSET -99999 - -#define TIMELIB_SECOND 1 -#define TIMELIB_MINUTE 2 -#define TIMELIB_HOUR 3 -#define TIMELIB_DAY 4 -#define TIMELIB_MONTH 5 -#define TIMELIB_YEAR 6 -#define TIMELIB_WEEKDAY 7 -#define TIMELIB_SPECIAL 8 - -#define EOI 257 -#define TIME 258 -#define DATE 259 - -#define TIMELIB_XMLRPC_SOAP 260 -#define TIMELIB_TIME12 261 -#define TIMELIB_TIME24 262 -#define TIMELIB_GNU_NOCOLON 263 -#define TIMELIB_GNU_NOCOLON_TZ 264 -#define TIMELIB_ISO_NOCOLON 265 - -#define TIMELIB_AMERICAN 266 -#define TIMELIB_ISO_DATE 267 -#define TIMELIB_DATE_FULL 268 -#define TIMELIB_DATE_TEXT 269 -#define TIMELIB_DATE_NOCOLON 270 -#define TIMELIB_PG_YEARDAY 271 -#define TIMELIB_PG_TEXT 272 -#define TIMELIB_PG_REVERSE 273 -#define TIMELIB_CLF 274 -#define TIMELIB_DATE_NO_DAY 275 -#define TIMELIB_SHORTDATE_WITH_TIME 276 -#define TIMELIB_DATE_FULL_POINTED 277 -#define TIMELIB_TIME24_WITH_ZONE 278 -#define TIMELIB_ISO_WEEK 279 - -#define TIMELIB_TIMEZONE 300 -#define TIMELIB_AGO 301 - -#define TIMELIB_RELATIVE 310 - -#define TIMELIB_ERROR 999 - -typedef unsigned char uchar; - -#define BSIZE 8192 - -#define YYCTYPE uchar -#define YYCURSOR cursor -#define YYLIMIT s->lim -#define YYMARKER s->ptr -#define YYFILL(n) return EOI; - -#define RET(i) {s->cur = cursor; return i;} - -#define timelib_string_free free - -#define TIMELIB_HAVE_TIME() { if (s->time->have_time) { add_error(s, "Double time specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_time = 1; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } } -#define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s = 0; s->time->f = 0; } -#define TIMELIB_HAVE_DATE() { if (s->time->have_date) { add_error(s, "Double date specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_date = 1; } } -#define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y = 0; } -#define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 1; } -#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; } -#define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_special_relative = 1; } -#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { add_warning(s, "Double timezone specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_zone = 1; } } - -#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str -#define TIMELIB_DEINIT timelib_string_free(str) -#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; } - -#define TIMELIB_PROCESS_YEAR(x) { \ - if ((x) == TIMELIB_UNSET) { \ - /* (x) = 0; */ \ - } else if ((x) < 100) { \ - if ((x) < 70) { \ - (x) += 2000; \ - } else { \ - (x) += 1900; \ - } \ - } \ -} - -#ifdef DEBUG_PARSER -#define DEBUG_OUTPUT(s) printf("%s\n", s); -#define YYDEBUG(s,c) { if (s != -1) { printf("state: %d ", s); printf("[%c]\n", c); } } -#else -#define DEBUG_OUTPUT(s) -#define YYDEBUG(s,c) -#endif - -#include "timelib_structs.h" - -typedef struct timelib_elems { - unsigned int c; /* Number of elements */ - char **v; /* Values */ -} timelib_elems; - -typedef struct Scanner { - int fd; - uchar *lim, *str, *ptr, *cur, *tok, *pos; - unsigned int line, len; - struct timelib_error_container *errors; - - struct timelib_time *time; - const timelib_tzdb *tzdb; -} Scanner; - -typedef struct _timelib_lookup_table { - const char *name; - int type; - int value; -} timelib_lookup_table; - -typedef struct _timelib_relunit { - const char *name; - int unit; - int multiplier; -} timelib_relunit; - -#define HOUR(a) (int)(a * 60) - -/* The timezone table. */ -const static timelib_tz_lookup_table timelib_timezone_lookup[] = { -#include "timezonemap.h" - { NULL, 0, 0, NULL }, -}; - -const static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = { -#include "fallbackmap.h" - { NULL, 0, 0, NULL }, -}; - -const static timelib_tz_lookup_table timelib_timezone_utc[] = { - { "utc", 0, 0, "UTC" }, -}; - -static timelib_relunit const timelib_relunit_lookup[] = { - { "sec", TIMELIB_SECOND, 1 }, - { "secs", TIMELIB_SECOND, 1 }, - { "second", TIMELIB_SECOND, 1 }, - { "seconds", TIMELIB_SECOND, 1 }, - { "min", TIMELIB_MINUTE, 1 }, - { "mins", TIMELIB_MINUTE, 1 }, - { "minute", TIMELIB_MINUTE, 1 }, - { "minutes", TIMELIB_MINUTE, 1 }, - { "hour", TIMELIB_HOUR, 1 }, - { "hours", TIMELIB_HOUR, 1 }, - { "day", TIMELIB_DAY, 1 }, - { "days", TIMELIB_DAY, 1 }, - { "week", TIMELIB_DAY, 7 }, - { "weeks", TIMELIB_DAY, 7 }, - { "fortnight", TIMELIB_DAY, 14 }, - { "fortnights", TIMELIB_DAY, 14 }, - { "forthnight", TIMELIB_DAY, 14 }, - { "forthnights", TIMELIB_DAY, 14 }, - { "month", TIMELIB_MONTH, 1 }, - { "months", TIMELIB_MONTH, 1 }, - { "year", TIMELIB_YEAR, 1 }, - { "years", TIMELIB_YEAR, 1 }, - - { "monday", TIMELIB_WEEKDAY, 1 }, - { "mon", TIMELIB_WEEKDAY, 1 }, - { "tuesday", TIMELIB_WEEKDAY, 2 }, - { "tue", TIMELIB_WEEKDAY, 2 }, - { "wednesday", TIMELIB_WEEKDAY, 3 }, - { "wed", TIMELIB_WEEKDAY, 3 }, - { "thursday", TIMELIB_WEEKDAY, 4 }, - { "thu", TIMELIB_WEEKDAY, 4 }, - { "friday", TIMELIB_WEEKDAY, 5 }, - { "fri", TIMELIB_WEEKDAY, 5 }, - { "saturday", TIMELIB_WEEKDAY, 6 }, - { "sat", TIMELIB_WEEKDAY, 6 }, - { "sunday", TIMELIB_WEEKDAY, 0 }, - { "sun", TIMELIB_WEEKDAY, 0 }, - - { "weekday", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY }, - { "weekdays", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY }, - { NULL, 0, 0 } -}; - -/* The relative text table. */ -static timelib_lookup_table const timelib_reltext_lookup[] = { - { "first", 0, 1 }, - { "next", 0, 1 }, - { "second", 0, 2 }, - { "third", 0, 3 }, - { "fourth", 0, 4 }, - { "fifth", 0, 5 }, - { "sixth", 0, 6 }, - { "seventh", 0, 7 }, - { "eight", 0, 8 }, - { "ninth", 0, 9 }, - { "tenth", 0, 10 }, - { "eleventh", 0, 11 }, - { "twelfth", 0, 12 }, - { "last", 0, -1 }, - { "previous", 0, -1 }, - { "this", 1, 0 }, - { NULL, 1, 0 } -}; - -/* The month table. */ -static timelib_lookup_table const timelib_month_lookup[] = { - { "jan", 0, 1 }, - { "feb", 0, 2 }, - { "mar", 0, 3 }, - { "apr", 0, 4 }, - { "may", 0, 5 }, - { "jun", 0, 6 }, - { "jul", 0, 7 }, - { "aug", 0, 8 }, - { "sep", 0, 9 }, - { "sept", 0, 9 }, - { "oct", 0, 10 }, - { "nov", 0, 11 }, - { "dec", 0, 12 }, - { "i", 0, 1 }, - { "ii", 0, 2 }, - { "iii", 0, 3 }, - { "iv", 0, 4 }, - { "v", 0, 5 }, - { "vi", 0, 6 }, - { "vii", 0, 7 }, - { "viii", 0, 8 }, - { "ix", 0, 9 }, - { "x", 0, 10 }, - { "xi", 0, 11 }, - { "xii", 0, 12 }, - - { "january", 0, 1 }, - { "february", 0, 2 }, - { "march", 0, 3 }, - { "april", 0, 4 }, - { "may", 0, 5 }, - { "june", 0, 6 }, - { "july", 0, 7 }, - { "august", 0, 8 }, - { "september", 0, 9 }, - { "october", 0, 10 }, - { "november", 0, 11 }, - { "december", 0, 12 }, - { NULL, 0, 0 } -}; - -#if 0 -static char* timelib_ltrim(char *s) -{ - char *ptr = s; - while (ptr[0] == ' ' || ptr[0] == '\t') { - ptr++; - } - return ptr; -} -#endif - -#if 0 -uchar *fill(Scanner *s, uchar *cursor){ - if(!s->eof){ - unsigned int cnt = s->tok - s->bot; - if(cnt){ - memcpy(s->bot, s->tok, s->lim - s->tok); - s->tok = s->bot; - s->ptr -= cnt; - cursor -= cnt; - s->pos -= cnt; - s->lim -= cnt; - } - if((s->top - s->lim) < BSIZE){ - uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); - memcpy(buf, s->tok, s->lim - s->tok); - s->tok = buf; - s->ptr = &buf[s->ptr - s->bot]; - cursor = &buf[cursor - s->bot]; - s->pos = &buf[s->pos - s->bot]; - s->lim = &buf[s->lim - s->bot]; - s->top = &s->lim[BSIZE]; - free(s->bot); - s->bot = buf; - } - if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){ - s->eof = &s->lim[cnt]; *(s->eof)++ = '\n'; - } - s->lim += cnt; - } - return cursor; -} -#endif - -static void add_warning(Scanner *s, char *error) -{ - s->errors->warning_count++; - s->errors->warning_messages = realloc(s->errors->warning_messages, s->errors->warning_count * sizeof(timelib_error_message)); - s->errors->warning_messages[s->errors->warning_count - 1].position = s->tok ? s->tok - s->str : 0; - s->errors->warning_messages[s->errors->warning_count - 1].character = s->tok ? *s->tok : 0; - s->errors->warning_messages[s->errors->warning_count - 1].message = strdup(error); -} - -static void add_error(Scanner *s, char *error) -{ - s->errors->error_count++; - s->errors->error_messages = realloc(s->errors->error_messages, s->errors->error_count * sizeof(timelib_error_message)); - s->errors->error_messages[s->errors->error_count - 1].position = s->tok ? s->tok - s->str : 0; - s->errors->error_messages[s->errors->error_count - 1].character = s->tok ? *s->tok : 0; - s->errors->error_messages[s->errors->error_count - 1].message = strdup(error); -} - -static timelib_sll timelib_meridian(char **ptr, timelib_sll h) -{ - timelib_sll retval = 0; - - while (!strchr("AaPp", **ptr)) { - ++*ptr; - } - if (**ptr == 'a' || **ptr == 'A') { - if (h == 12) { - retval = -12; - } - } else if (h != 12) { - retval = 12; - } - ++*ptr; - if (**ptr == '.') { - *ptr += 3; - } else { - ++*ptr; - } - return retval; -} - -static char *timelib_string(Scanner *s) -{ - char *tmp = calloc(1, s->cur - s->tok + 1); - memcpy(tmp, s->tok, s->cur - s->tok); - - return tmp; -} - -static timelib_sll timelib_get_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - timelib_sll tmp_nr = TIMELIB_UNSET; - int len = 0; - - while ((**ptr < '0') || (**ptr > '9')) { - if (**ptr == '\0') { - return TIMELIB_UNSET; - } - ++*ptr; - } - begin = *ptr; - while ((**ptr >= '0') && (**ptr <= '9') && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtoll(str, NULL, 10); - free(str); - return tmp_nr; -} - -static void timelib_skip_day_suffix(char **ptr) -{ - if (isspace(**ptr)) { - return; - } - if (!strncasecmp(*ptr, "nd", 2) || !strncasecmp(*ptr, "rd", 2) ||!strncasecmp(*ptr, "st", 2) || !strncasecmp(*ptr, "th", 2)) { - *ptr += 2; - } -} - -static double timelib_get_frac_nr(char **ptr, int max_length) -{ - char *begin, *end, *str; - double tmp_nr = TIMELIB_UNSET; - int len = 0; - - while ((**ptr != '.') && ((**ptr < '0') || (**ptr > '9'))) { - if (**ptr == '\0') { - return TIMELIB_UNSET; - } - ++*ptr; - } - begin = *ptr; - while (((**ptr == '.') || ((**ptr >= '0') && (**ptr <= '9'))) && len < max_length) { - ++*ptr; - ++len; - } - end = *ptr; - str = calloc(1, end - begin + 1); - memcpy(str, begin, end - begin); - tmp_nr = strtod(str, NULL); - free(str); - return tmp_nr; -} - -static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length) -{ - timelib_ull dir = 1; - - while (((**ptr < '0') || (**ptr > '9')) && (**ptr != '+') && (**ptr != '-')) { - if (**ptr == '\0') { - return TIMELIB_UNSET; - } - ++*ptr; - } - - while (**ptr == '+' || **ptr == '-') - { - if (**ptr == '-') { - dir *= -1; - } - ++*ptr; - } - return dir * timelib_get_nr(ptr, max_length); -} - -static long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (**ptr != '\0') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - if (begin[1] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10); - return tmp; - } else if (begin[2] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } else { - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - } - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - -static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior) -{ - char *word; - char *begin = *ptr, *end; - timelib_sll value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_reltext_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - *behavior = tp->type; - } - } - - free(word); - return value; -} - -static timelib_sll timelib_get_relative_text(char **ptr, int *behavior) -{ - while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_relative_text(ptr, behavior); -} - -static long timelib_lookup_month(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - const timelib_lookup_table *tp; - - while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_month_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp->value; - } - } - - free(word); - return value; -} - -static long timelib_get_month(char **ptr) -{ - while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') { - ++*ptr; - } - return timelib_lookup_month(ptr); -} - -static void timelib_eat_spaces(char **ptr) -{ - while (**ptr == ' ' || **ptr == '\t') { - ++*ptr; - } -} - -static const timelib_relunit* timelib_lookup_relunit(char **ptr) -{ - char *word; - char *begin = *ptr, *end; - const timelib_relunit *tp, *value = NULL; - - while (**ptr != '\0' && **ptr != ' ' && **ptr != '\t') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - for (tp = timelib_relunit_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - value = tp; - break; - } - } - - free(word); - return value; -} - -static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, Scanner *s) -{ - const timelib_relunit* relunit; - - if (!(relunit = timelib_lookup_relunit(ptr))) { - return; - } - - switch (relunit->unit) { - case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break; - case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break; - case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break; - case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break; - case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break; - case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break; - - case TIMELIB_WEEKDAY: - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7; - s->time->relative.weekday = relunit->multiplier; - s->time->relative.weekday_behavior = behavior; - break; - - case TIMELIB_SPECIAL: - TIMELIB_HAVE_SPECIAL_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - s->time->special.type = relunit->multiplier; - s->time->special.amount = amount; - } -} - -const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst) -{ - int first_found = 0; - const timelib_tz_lookup_table *tp, *first_found_elem = NULL; - const timelib_tz_lookup_table *fmp; - - if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) { - return timelib_timezone_utc; - } - - for (tp = timelib_timezone_lookup; tp->name; tp++) { - if (strcasecmp(word, tp->name) == 0) { - if (!first_found) { - first_found = 1; - first_found_elem = tp; - if (gmtoffset == -1) { - return tp; - } - } - if (tp->gmtoffset == gmtoffset) { - return tp; - } - } - } - if (first_found) { - return first_found_elem; - } - - /* Still didn't find anything, let's find the zone solely based on - * offset/isdst then */ - for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) { - if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) { - return fmp; - } - } - return NULL; -} - -static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found) -{ - char *word; - char *begin = *ptr, *end; - long value = 0; - const timelib_tz_lookup_table *tp; - - while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') { - ++*ptr; - } - end = *ptr; - word = calloc(1, end - begin + 1); - memcpy(word, begin, end - begin); - - if ((tp = zone_search(word, -1, 0))) { - value = -tp->gmtoffset / 60; - *dst = tp->type; - value += tp->type * 60; - *found = 1; - } else { - *found = 0; - } - - *tz_abbr = word; - return value; -} - -static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb) -{ - timelib_tzinfo *res; - long retval = 0; - - *tz_not_found = 0; - - while (**ptr == ' ' || **ptr == '\t' || **ptr == '(') { - ++*ptr; - } - if (**ptr == '+') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - retval = -1 * timelib_parse_tz_cor(ptr); - } else if (**ptr == '-') { - ++*ptr; - t->is_localtime = 1; - t->zone_type = TIMELIB_ZONETYPE_OFFSET; - *tz_not_found = 0; - t->dst = 0; - - retval = timelib_parse_tz_cor(ptr); - } else { - int found = 0; - long offset; - char *tz_abbr; - - t->is_localtime = 1; - - offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found); - if (found) { - t->zone_type = TIMELIB_ZONETYPE_ABBR; - } -#if 0 - /* If we found a TimeZone identifier, use it */ - if (tz_name) { - t->tz_info = timelib_parse_tzfile(tz_name); - t->zone_type = TIMELIB_ZONETYPE_ID; - } -#endif - /* If we have a TimeZone identifier to start with, use it */ - if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) { - if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) { - t->tz_info = res; - t->zone_type = TIMELIB_ZONETYPE_ID; - found++; - } - } - if (found && t->zone_type != TIMELIB_ZONETYPE_ID) { - timelib_time_tz_abbr_update(t, tz_abbr); - } - free(tz_abbr); - *tz_not_found = (found == 0); - retval = offset; - } - while (**ptr == ')') { - ++*ptr; - } - return retval; -} - -#define timelib_split_free(arg) { \ - int i; \ - for (i = 0; i < arg.c; i++) { \ - free(arg.v[i]); \ - } \ - if (arg.v) { \ - free(arg.v); \ - } \ -} - -static int scan(Scanner *s) -{ - uchar *cursor = s->cur; - char *str, *ptr = NULL; - -std: - s->tok = cursor; - s->len = 0; -/*!re2c -any = [\000-\377]; - -space = [ \t]+; -frac = "."[0-9]+; - -ago = 'ago'; - -hour24 = [01]?[0-9] | "2"[0-3]; -hour24lz = [01][0-9] | "2"[0-3]; -hour12 = "0"?[1-9] | "1"[0-2]; -minute = [0-5]?[0-9]; -minutelz = [0-5][0-9]; -second = minute | "60"; -secondlz = minutelz | "60"; -meridian = ([AaPp] "."? [Mm] "."?) [\000\t ]; -tz = "("? [A-Za-z]{1,6} ")"? | [A-Z][a-z]+([_/][A-Z][a-z]+)+; -tzcorrection = [+-] hour24 ":"? minute?; - -daysuf = "st" | "nd" | "rd" | "th"; - -month = "0"? [0-9] | "1"[0-2]; -day = (([0-2]?[0-9]) | ("3"[01])) daysuf?; -year = [0-9]{1,4}; -year2 = [0-9]{2}; -year4 = [0-9]{4}; -year4withsign = [+-]? [0-9]{4}; - -dayofyear = "00"[1-9] | "0"[1-9][0-9] | [1-2][0-9][0-9] | "3"[0-5][0-9] | "36"[0-6]; -weekofyear = "0"[1-9] | [1-4][0-9] | "5"[0-3]; - -monthlz = "0" [0-9] | "1" [0-2]; -daylz = "0" [0-9] | [1-2][0-9] | "3" [01]; - -dayfull = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday'; -dayabbr = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun'; -dayspecial = 'weekday' | 'weekdays'; -daytext = dayfull | dayabbr | dayspecial; - -monthfull = 'january' | 'february' | 'march' | 'april' | 'may' | 'june' | 'july' | 'august' | 'september' | 'october' | 'november' | 'december'; -monthabbr = 'jan' | 'feb' | 'mar' | 'apr' | 'may' | 'jun' | 'jul' | 'aug' | 'sep' | 'sept' | 'oct' | 'nov' | 'dec'; -monthroman = "I" | "II" | "III" | "IV" | "V" | "VI" | "VII" | "VIII" | "IX" | "X" | "XI" | "XII"; -monthtext = monthfull | monthabbr | monthroman; - -/* Time formats */ -timetiny12 = hour12 space? meridian; -timeshort12 = hour12[:.]minutelz space? meridian; -timelong12 = hour12[:.]minute[:.]secondlz space? meridian; - -timeshort24 = 't'? hour24[:.]minute; -timelong24 = 't'? hour24[:.]minute[:.]second; -iso8601long = 't'? hour24 [:.] minute [:.] second frac; - -/* iso8601shorttz = hour24 [:] minutelz space? (tzcorrection | tz); */ -iso8601normtz = 't'? hour24 [:.] minute [:.] secondlz space? (tzcorrection | tz); -/* iso8601longtz = hour24 [:] minute [:] secondlz frac space? (tzcorrection | tz); */ - -gnunocolon = 't'? hour24lz minutelz; -/* gnunocolontz = hour24lz minutelz space? (tzcorrection | tz); */ -iso8601nocolon = 't'? hour24lz minutelz secondlz; -/* iso8601nocolontz = hour24lz minutelz secondlz space? (tzcorrection | tz); */ - -/* Date formats */ -americanshort = month "/" day; -american = month "/" day "/" year; -iso8601dateslash = year4 "/" monthlz "/" daylz "/"?; -dateslash = year4 "/" month "/" day; -iso8601date4 = year4withsign "-" monthlz "-" daylz; -iso8601date2 = year2 "-" monthlz "-" daylz; -gnudateshorter = year4 "-" month; -gnudateshort = year "-" month "-" day; -pointeddate4 = day [.\t-] month [.-] year4; -pointeddate2 = day [.\t] month "." year2; -datefull = day ([ \t.-])* monthtext ([ \t.-])* year; -datenoday = monthtext ([ .\t-])* year4; -datenodayrev = year4 ([ .\t-])* monthtext; -datetextual = monthtext ([ .\t-])* day [,.stndrh\t ]+ year; -datenoyear = monthtext ([ .\t-])* day [,.stndrh\t ]*; -datenoyearrev = day ([ .\t-])* monthtext; -datenocolon = year4 monthlz daylz; - -/* Special formats */ -soap = year4 "-" monthlz "-" daylz "T" hour24lz ":" minutelz ":" secondlz frac tzcorrection?; -xmlrpc = year4 monthlz daylz "T" hour24 ":" minutelz ":" secondlz; -xmlrpcnocolon = year4 monthlz daylz 't' hour24 minutelz secondlz; -wddx = year4 "-" month "-" day "T" hour24 ":" minute ":" second; -pgydotd = year4 "."? dayofyear; -pgtextshort = monthabbr "-" daylz "-" year; -pgtextreverse = year "-" monthabbr "-" daylz; -isoweekday = year4 "-"? "W" weekofyear "-"? [0-7]; -isoweek = year4 "-"? "W" weekofyear; -exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" secondlz; - -/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */ -clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection; - -/* Timestamp format: @1126396800 */ -timestamp = "@" "-"? [0-9]+; - -/* To fix some ambiguities */ -dateshortwithtimeshort12 = datenoyear timeshort12; -dateshortwithtimelong12 = datenoyear timelong12; -dateshortwithtimeshort = datenoyear timeshort24; -dateshortwithtimelong = datenoyear timelong24; -dateshortwithtimelongtz = datenoyear iso8601normtz; - -/* - * Relative regexps - */ -reltextnumber = 'first'|'next'|'second'|'third'|'fourth'|'fifth'|'sixth'|'seventh'|'eight'|'ninth'|'tenth'|'eleventh'|'twelfth'|'last'|'previous'|'this'; -reltextunit = (('sec'|'second'|'min'|'minute'|'hour'|'day'|'week'|'fortnight'|'forthnight'|'month'|'year') 's'?) | daytext; - -relnumber = ([+-]*[ \t]*[0-9]+); -relative = relnumber space? reltextunit; -relativetext = reltextnumber space reltextunit; - -*/ - -/*!re2c - /* so that vim highlights correctly */ - 'yesterday' - { - DEBUG_OUTPUT("yesterday"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = -1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - 'now' - { - DEBUG_OUTPUT("now"); - TIMELIB_INIT; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - 'noon' - { - DEBUG_OUTPUT("noon"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - TIMELIB_HAVE_TIME(); - s->time->h = 12; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - 'midnight' | 'today' - { - DEBUG_OUTPUT("midnight | today"); - TIMELIB_INIT; - TIMELIB_UNHAVE_TIME(); - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - 'tomorrow' - { - DEBUG_OUTPUT("tomorrow"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - - s->time->relative.d = 1; - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - timestamp - { - timelib_ull i; - - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_UNHAVE_DATE(); - TIMELIB_UNHAVE_TIME(); - - i = timelib_get_unsigned_nr((char **) &ptr, 24); - s->time->y = 1970; - s->time->m = 1; - s->time->d = 1; - s->time->h = s->time->i = s->time->s = 0; - s->time->f = 0.0; - s->time->relative.s += i; - s->time->is_localtime = 1; - s->time->zone_type = TIMELIB_ZONETYPE_OFFSET; - s->time->z = 0; - - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - timetiny12 | timeshort12 | timelong12 - { - DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - } - } - s->time->h += timelib_meridian((char **) &ptr, s->time->h); - TIMELIB_DEINIT; - return TIMELIB_TIME12; - } - - timeshort24 | timelong24 /* | iso8601short | iso8601norm */ | iso8601long /*| iso8601shorttz | iso8601normtz | iso8601longtz*/ - { - int tz_not_found; - DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - } - TIMELIB_DEINIT; - return TIMELIB_TIME24_WITH_ZONE; - } - - gnunocolon - { - DEBUG_OUTPUT("gnunocolon"); - TIMELIB_INIT; - switch (s->time->have_time) { - case 0: - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = 0; - break; - case 1: - s->time->y = timelib_get_nr((char **) &ptr, 4); - break; - default: - TIMELIB_DEINIT; - add_error(s, "Double time specification"); - return TIMELIB_ERROR; - } - s->time->have_time++; - TIMELIB_DEINIT; - return TIMELIB_GNU_NOCOLON; - } -/* - gnunocolontz - { - DEBUG_OUTPUT("gnunocolontz"); - TIMELIB_INIT; - switch (s->time->have_time) { - case 0: - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = 0; - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb); - break; - case 1: - s->time->y = timelib_get_nr((char **) &ptr, 4); - break; - default: - TIMELIB_DEINIT; - return TIMELIB_ERROR; - } - s->time->have_time++; - TIMELIB_DEINIT; - return TIMELIB_GNU_NOCOLON_TZ; - } -*/ - iso8601nocolon /*| iso8601nocolontz*/ - { - int tz_not_found; - DEBUG_OUTPUT("iso8601nocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - } - TIMELIB_DEINIT; - return TIMELIB_ISO_NOCOLON; - } - - americanshort | american - { - DEBUG_OUTPUT("americanshort | american"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '/') { - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - } - TIMELIB_DEINIT; - return TIMELIB_AMERICAN; - } - - iso8601date4 | iso8601dateslash | dateslash - { - DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_unsigned_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } - - iso8601date2 - { - DEBUG_OUTPUT("iso8601date2"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } - - gnudateshorter - { - DEBUG_OUTPUT("gnudateshorter"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } - - gnudateshort - { - DEBUG_OUTPUT("gnudateshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_ISO_DATE; - } - - datefull - { - DEBUG_OUTPUT("datefull"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - timelib_skip_day_suffix((char **) &ptr); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL; - } - - pointeddate4 - { - DEBUG_OUTPUT("pointed date YYYY"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL_POINTED; - } - - pointeddate2 - { - DEBUG_OUTPUT("pointed date YY"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_FULL_POINTED; - } - - datenoday - { - DEBUG_OUTPUT("datenoday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } - - datenodayrev - { - DEBUG_OUTPUT("datenodayrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_NO_DAY; - } - - datetextual | datenoyear - { - DEBUG_OUTPUT("datetextual | datenoyear"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } - - datenoyearrev - { - DEBUG_OUTPUT("datenoyearrev"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - timelib_skip_day_suffix((char **) &ptr); - s->time->m = timelib_get_month((char **) &ptr); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } - - datenocolon - { - DEBUG_OUTPUT("datenocolon"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_DEINIT; - return TIMELIB_DATE_NOCOLON; - } - - xmlrpc | xmlrpcnocolon | soap | wddx | exif - { - int tz_not_found; - DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_nr((char **) &ptr, 2); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 9); - if (*ptr) { /* timezone is optional */ - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - } - } - TIMELIB_DEINIT; - return TIMELIB_XMLRPC_SOAP; - } - - pgydotd - { - DEBUG_OUTPUT("pgydotd"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->d = timelib_get_nr((char **) &ptr, 3); - s->time->m = 1; - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_YEARDAY; - } - - isoweekday - { - timelib_sll w, d; - DEBUG_OUTPUT("isoweekday"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = timelib_get_nr((char **) &ptr, 1); - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } - - isoweek - { - timelib_sll w, d; - DEBUG_OUTPUT("isoweek"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - TIMELIB_HAVE_RELATIVE(); - - s->time->y = timelib_get_nr((char **) &ptr, 4); - w = timelib_get_nr((char **) &ptr, 2); - d = 1; - s->time->m = 1; - s->time->d = 1; - s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d); - - TIMELIB_DEINIT; - return TIMELIB_ISO_WEEK; - } - - pgtextshort - { - DEBUG_OUTPUT("pgtextshort"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } - - pgtextreverse - { - DEBUG_OUTPUT("pgtextreverse"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - TIMELIB_PROCESS_YEAR(s->time->y); - TIMELIB_DEINIT; - return TIMELIB_PG_TEXT; - } - - clf - { - int tz_not_found; - DEBUG_OUTPUT("clf"); - TIMELIB_INIT; - TIMELIB_HAVE_TIME(); - TIMELIB_HAVE_DATE(); - s->time->d = timelib_get_nr((char **) &ptr, 2); - s->time->m = timelib_get_month((char **) &ptr); - s->time->y = timelib_get_nr((char **) &ptr, 4); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - s->time->s = timelib_get_nr((char **) &ptr, 2); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - TIMELIB_DEINIT; - return TIMELIB_CLF; - } - - year4 - { - DEBUG_OUTPUT("year4"); - TIMELIB_INIT; - s->time->y = timelib_get_nr((char **) &ptr, 4); - TIMELIB_DEINIT; - return TIMELIB_CLF; - } - - ago - { - DEBUG_OUTPUT("ago"); - TIMELIB_INIT; - s->time->relative.y = 0 - s->time->relative.y; - s->time->relative.m = 0 - s->time->relative.m; - s->time->relative.d = 0 - s->time->relative.d; - s->time->relative.h = 0 - s->time->relative.h; - s->time->relative.i = 0 - s->time->relative.i; - s->time->relative.s = 0 - s->time->relative.s; - s->time->relative.weekday = 0 - s->time->relative.weekday; - if (s->time->have_special_relative && s->time->special.type == TIMELIB_SPECIAL_WEEKDAY) { - s->time->special.amount = 0 - s->time->special.amount; - } - TIMELIB_DEINIT; - return TIMELIB_AGO; - } - - daytext - { - const timelib_relunit* relunit; - DEBUG_OUTPUT("daytext"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - TIMELIB_HAVE_WEEKDAY_RELATIVE(); - TIMELIB_UNHAVE_TIME(); - relunit = timelib_lookup_relunit((char**) &ptr); - s->time->relative.weekday = relunit->multiplier; - if (s->time->relative.weekday_behavior != 2) { - s->time->relative.weekday_behavior = 1; - } - - TIMELIB_DEINIT; - return TIMELIB_WEEKDAY; - } - - relativetext - { - timelib_sll i; - int behavior = 0; - DEBUG_OUTPUT("relativetext"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_relative_text((char **) &ptr, &behavior); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, behavior, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - monthfull | monthabbr - { - DEBUG_OUTPUT("monthtext"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_lookup_month((char **) &ptr); - TIMELIB_DEINIT; - return TIMELIB_DATE_TEXT; - } - - tzcorrection | tz - { - int tz_not_found; - DEBUG_OUTPUT("tzcorrection | tz"); - TIMELIB_INIT; - TIMELIB_HAVE_TZ(); - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - TIMELIB_DEINIT; - return TIMELIB_TIMEZONE; - } - - dateshortwithtimeshort12 | dateshortwithtimelong12 - { - DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':' || *ptr == '.') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - s->time->h += timelib_meridian((char **) &ptr, s->time->h); - TIMELIB_DEINIT; - return TIMELIB_SHORTDATE_WITH_TIME; - } - - dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz - { - int tz_not_found; - DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); - TIMELIB_INIT; - TIMELIB_HAVE_DATE(); - s->time->m = timelib_get_month((char **) &ptr); - s->time->d = timelib_get_nr((char **) &ptr, 2); - - TIMELIB_HAVE_TIME(); - s->time->h = timelib_get_nr((char **) &ptr, 2); - s->time->i = timelib_get_nr((char **) &ptr, 2); - if (*ptr == ':') { - s->time->s = timelib_get_nr((char **) &ptr, 2); - - if (*ptr == '.') { - s->time->f = timelib_get_frac_nr((char **) &ptr, 8); - } - } - - if (*ptr != '\0') { - s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb); - if (tz_not_found) { - add_error(s, "The timezone could not be found in the database"); - } - } - TIMELIB_DEINIT; - return TIMELIB_SHORTDATE_WITH_TIME; - } - - relative - { - timelib_ull i; - DEBUG_OUTPUT("relative"); - TIMELIB_INIT; - TIMELIB_HAVE_RELATIVE(); - - while(*ptr) { - i = timelib_get_unsigned_nr((char **) &ptr, 24); - timelib_eat_spaces((char **) &ptr); - timelib_set_relative((char **) &ptr, i, 1, s); - } - TIMELIB_DEINIT; - return TIMELIB_RELATIVE; - } - - [ .,\t] - { - goto std; - } - - "\000"|"\n" - { - s->pos = cursor; s->line++; - goto std; - } - - any - { - add_error(s, "Unexpected character"); - goto std; - } -*/ -} - -/*!max:re2c */ - -timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb) -{ - Scanner in; - int t; - char *e = s + len - 1; - - memset(&in, 0, sizeof(in)); - in.errors = malloc(sizeof(struct timelib_error_container)); - in.errors->warning_count = 0; - in.errors->warning_messages = NULL; - in.errors->error_count = 0; - in.errors->error_messages = NULL; - - if (len > 0) { - while (isspace(*s) && s < e) { - s++; - } - while (isspace(*e) && e > s) { - e--; - } - } - if (e - s < 0) { - in.time = timelib_time_ctor(); - add_error(&in, "Empty string"); - if (errors) { - *errors = in.errors; - } else { - timelib_error_container_dtor(in.errors); - } - in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->f = in.time->dst = in.time->z = TIMELIB_UNSET; - in.time->is_localtime = in.time->zone_type = 0; - return in.time; - } - e++; - - in.str = malloc((e - s) + YYMAXFILL); - memset(in.str, 0, (e - s) + YYMAXFILL); - memcpy(in.str, s, (e - s)); - in.lim = in.str + (e - s) + YYMAXFILL; - in.cur = in.str; - in.time = timelib_time_ctor(); - in.time->y = TIMELIB_UNSET; - in.time->d = TIMELIB_UNSET; - in.time->m = TIMELIB_UNSET; - in.time->h = TIMELIB_UNSET; - in.time->i = TIMELIB_UNSET; - in.time->s = TIMELIB_UNSET; - in.time->f = TIMELIB_UNSET; - in.time->z = TIMELIB_UNSET; - in.time->dst = TIMELIB_UNSET; - in.tzdb = tzdb; - in.time->is_localtime = 0; - in.time->zone_type = 0; - - do { - t = scan(&in); -#ifdef DEBUG_PARSER - printf("%d\n", t); -#endif - } while(t != EOI); - - free(in.str); - if (errors) { - *errors = in.errors; - } else { - timelib_error_container_dtor(in.errors); - } - return in.time; -} - -void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options) -{ - if (!(options & TIMELIB_OVERRIDE_TIME) && parsed->have_date && !parsed->have_time) { - parsed->h = 0; - parsed->i = 0; - parsed->s = 0; - parsed->f = 0; - } - if (parsed->y == TIMELIB_UNSET) parsed->y = now->y != TIMELIB_UNSET ? now->y : 0; - if (parsed->d == TIMELIB_UNSET) parsed->d = now->d != TIMELIB_UNSET ? now->d : 0; - if (parsed->m == TIMELIB_UNSET) parsed->m = now->m != TIMELIB_UNSET ? now->m : 0; - if (parsed->h == TIMELIB_UNSET) parsed->h = now->h != TIMELIB_UNSET ? now->h : 0; - if (parsed->i == TIMELIB_UNSET) parsed->i = now->i != TIMELIB_UNSET ? now->i : 0; - if (parsed->s == TIMELIB_UNSET) parsed->s = now->s != TIMELIB_UNSET ? now->s : 0; - if (parsed->f == TIMELIB_UNSET) parsed->f = now->f != TIMELIB_UNSET ? now->f : 0; - if (parsed->z == TIMELIB_UNSET) parsed->z = now->z != TIMELIB_UNSET ? now->z : 0; - if (parsed->dst == TIMELIB_UNSET) parsed->dst = now->dst != TIMELIB_UNSET ? now->dst : 0; - - if (!parsed->tz_abbr) { - parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - } - if (!parsed->tz_info) { - parsed->tz_info = now->tz_info ? (!(options & TIMELIB_NO_CLONE) ? timelib_tzinfo_clone(now->tz_info) : now->tz_info) : NULL; - } - if (parsed->zone_type == 0 && now->zone_type != 0) { - parsed->zone_type = now->zone_type; -/* parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL; - parsed->tz_info = now->tz_info ? timelib_tzinfo_clone(now->tz_info) : NULL; -*/ parsed->is_localtime = 1; - } -/* timelib_dump_date(parsed, 2); - timelib_dump_date(now, 2); -*/ -} - -char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst) -{ - const timelib_tz_lookup_table *tp; - - tp = zone_search(abbr, gmtoffset, isdst); - if (tp) { - return (tp->full_tz_name); - } else { - return NULL; - } -} - -const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void) -{ - return timelib_timezone_lookup; -} - -#ifdef DEBUG_PARSER_STUB -int main(void) -{ - timelib_time time = timelib_strtotime("May 12"); - - printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d", - time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst); - if (time.have_relative) { - printf ("%3dY %3dM %3dD / %3dH %3dM %3dS", - time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s); - } - if (time.have_weekday_relative) { - printf (" / %d", time.relative.weekday); - } - if (time.have_weeknr_day) { - printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek); - } - return 0; -} -#endif - -/* - * vim: syntax=c - */ diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c deleted file mode 100644 index 2a8a4719705ab..0000000000000 --- a/ext/date/lib/parse_tz.c +++ /dev/null @@ -1,411 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -#include - -#ifdef HAVE_LOCALE_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#else -#include -#endif -#include "timezonedb.h" - -#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) -# if defined(__LITTLE_ENDIAN__) -# undef WORDS_BIGENDIAN -# else -# if defined(__BIG_ENDIAN__) -# define WORDS_BIGENDIAN -# endif -# endif -#endif - -#ifdef WORDS_BIGENDIAN -#define timelib_conv_int(l) (l) -#else -#define timelib_conv_int(l) ((l & 0x000000ff) << 24) + ((l & 0x0000ff00) << 8) + ((l & 0x00ff0000) >> 8) + ((l & 0xff000000) >> 24) -#endif - -static void read_header(char **tzf, timelib_tzinfo *tz) -{ - uint32_t buffer[6]; - - memcpy(&buffer, *tzf, sizeof(buffer)); - tz->ttisgmtcnt = timelib_conv_int(buffer[0]); - tz->ttisstdcnt = timelib_conv_int(buffer[1]); - tz->leapcnt = timelib_conv_int(buffer[2]); - tz->timecnt = timelib_conv_int(buffer[3]); - tz->typecnt = timelib_conv_int(buffer[4]); - tz->charcnt = timelib_conv_int(buffer[5]); - *tzf += sizeof(buffer); -} - -static void read_transistions(char **tzf, timelib_tzinfo *tz) -{ - int32_t *buffer = NULL; - uint32_t i; - unsigned char *cbuffer = NULL; - - if (tz->timecnt) { - buffer = (int32_t*) malloc(tz->timecnt * sizeof(int32_t)); - if (!buffer) { - return; - } - memcpy(buffer, *tzf, sizeof(int32_t) * tz->timecnt); - *tzf += (sizeof(int32_t) * tz->timecnt); - for (i = 0; i < tz->timecnt; i++) { - buffer[i] = timelib_conv_int(buffer[i]); - } - - cbuffer = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char)); - if (!cbuffer) { - return; - } - memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt); - *tzf += sizeof(unsigned char) * tz->timecnt; - } - - tz->trans = buffer; - tz->trans_idx = cbuffer; -} - -static void read_types(char **tzf, timelib_tzinfo *tz) -{ - unsigned char *buffer; - int32_t *leap_buffer; - unsigned int i, j; - - buffer = (unsigned char*) malloc(tz->typecnt * sizeof(unsigned char) * 6); - if (!buffer) { - return; - } - memcpy(buffer, *tzf, sizeof(unsigned char) * 6 * tz->typecnt); - *tzf += sizeof(unsigned char) * 6 * tz->typecnt; - - tz->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo)); - if (!tz->type) { - return; - } - - for (i = 0; i < tz->typecnt; i++) { - j = i * 6; - tz->type[i].offset = (buffer[j] * 16777216) + (buffer[j + 1] * 65536) + (buffer[j + 2] * 256) + buffer[j + 3]; - tz->type[i].isdst = buffer[j + 4]; - tz->type[i].abbr_idx = buffer[j + 5]; - } - free(buffer); - - tz->timezone_abbr = (char*) malloc(tz->charcnt); - if (!tz->timezone_abbr) { - return; - } - memcpy(tz->timezone_abbr, *tzf, sizeof(char) * tz->charcnt); - *tzf += sizeof(char) * tz->charcnt; - - if (tz->leapcnt) { - leap_buffer = (int32_t *) malloc(tz->leapcnt * 2 * sizeof(int32_t)); - if (!leap_buffer) { - return; - } - memcpy(leap_buffer, *tzf, sizeof(int32_t) * tz->leapcnt * 2); - *tzf += sizeof(int32_t) * tz->leapcnt * 2; - - tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo)); - if (!tz->leap_times) { - return; - } - for (i = 0; i < tz->leapcnt; i++) { - tz->leap_times[i].trans = timelib_conv_int(leap_buffer[i * 2]); - tz->leap_times[i].offset = timelib_conv_int(leap_buffer[i * 2 + 1]); - } - free(leap_buffer); - } - - if (tz->ttisstdcnt) { - buffer = (unsigned char*) malloc(tz->ttisstdcnt * sizeof(unsigned char)); - if (!buffer) { - return; - } - memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisstdcnt); - *tzf += sizeof(unsigned char) * tz->ttisstdcnt; - - for (i = 0; i < tz->ttisstdcnt; i++) { - tz->type[i].isstdcnt = buffer[i]; - } - free(buffer); - } - - if (tz->ttisgmtcnt) { - buffer = (unsigned char*) malloc(tz->ttisgmtcnt * sizeof(unsigned char)); - if (!buffer) { - return; - } - memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisgmtcnt); - *tzf += sizeof(unsigned char) * tz->ttisgmtcnt; - - for (i = 0; i < tz->ttisgmtcnt; i++) { - tz->type[i].isgmtcnt = buffer[i]; - } - free(buffer); - } -} - -void timelib_dump_tzinfo(timelib_tzinfo *tz) -{ - uint32_t i; - - printf("UTC/Local count: %lu\n", (unsigned long) tz->ttisgmtcnt); - printf("Std/Wall count: %lu\n", (unsigned long) tz->ttisstdcnt); - printf("Leap.sec. count: %lu\n", (unsigned long) tz->leapcnt); - printf("Trans. count: %lu\n", (unsigned long) tz->timecnt); - printf("Local types count: %lu\n", (unsigned long) tz->typecnt); - printf("Zone Abbr. count: %lu\n", (unsigned long) tz->charcnt); - - printf ("%8s (%12s) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n", - "", "", 0, - (long int) tz->type[0].offset, - tz->type[0].isdst, - tz->type[0].abbr_idx, - &tz->timezone_abbr[tz->type[0].abbr_idx], - tz->type[0].isstdcnt, - tz->type[0].isgmtcnt - ); - for (i = 0; i < tz->timecnt; i++) { - printf ("%08X (%12d) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n", - tz->trans[i], tz->trans[i], tz->trans_idx[i], - (long int) tz->type[tz->trans_idx[i]].offset, - tz->type[tz->trans_idx[i]].isdst, - tz->type[tz->trans_idx[i]].abbr_idx, - &tz->timezone_abbr[tz->type[tz->trans_idx[i]].abbr_idx], - tz->type[tz->trans_idx[i]].isstdcnt, - tz->type[tz->trans_idx[i]].isgmtcnt - ); - } - for (i = 0; i < tz->leapcnt; i++) { - printf ("%08X (%12ld) = %d\n", - tz->leap_times[i].trans, - (long) tz->leap_times[i].trans, - tz->leap_times[i].offset); - } -} - -static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb) -{ - int left = 0, right = tzdb->index_size - 1; -#ifdef HAVE_SETLOCALE - char *cur_locale = NULL, *tmp; - - tmp = setlocale(LC_CTYPE, NULL); - if (tmp) { - cur_locale = strdup(tmp); - } - setlocale(LC_CTYPE, "C"); -#endif - - do { - int mid = ((unsigned)left + right) >> 1; - int cmp = strcasecmp(timezone, tzdb->index[mid].id); - - if (cmp < 0) { - right = mid - 1; - } else if (cmp > 0) { - left = mid + 1; - } else { /* (cmp == 0) */ - (*tzf) = &(tzdb->data[tzdb->index[mid].pos + 20]); -#ifdef HAVE_SETLOCALE - setlocale(LC_CTYPE, cur_locale); - if (cur_locale) free(cur_locale); -#endif - return 1; - } - - } while (left <= right); - -#ifdef HAVE_SETLOCALE - setlocale(LC_CTYPE, cur_locale); - if (cur_locale) free(cur_locale); -#endif - return 0; -} - -const timelib_tzdb *timelib_builtin_db(void) -{ - return &timezonedb_builtin; -} - -const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count) -{ - *count = sizeof(timezonedb_idx_builtin) / sizeof(*timezonedb_idx_builtin); - return timezonedb_idx_builtin; -} - -int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb) -{ - const unsigned char *tzf; - return (seek_to_tz_position(&tzf, timezone, tzdb)); -} - -timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb) -{ - const unsigned char *tzf; - timelib_tzinfo *tmp; - - if (seek_to_tz_position(&tzf, timezone, tzdb)) { - tmp = timelib_tzinfo_ctor(timezone); - - read_header((char**) &tzf, tmp); - read_transistions((char**) &tzf, tmp); - read_types((char**) &tzf, tmp); - } else { - tmp = NULL; - } - - return tmp; -} - -static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib_sll *transition_time) -{ - uint32_t i; - - /* If there is no transistion time, we pick the first one, if that doesn't - * exist we return NULL */ - if (!tz->timecnt || !tz->trans) { - *transition_time = 0; - if (tz->typecnt == 1) { - return &(tz->type[0]); - } - return NULL; - } - - /* If the TS is lower than the first transistion time, then we scan over - * all the transistion times to find the first non-DST one, or the first - * one in case there are only DST entries. Not sure which smartass came up - * with this idea in the first though :) */ - if (ts < tz->trans[0]) { - uint32_t j; - - *transition_time = 0; - j = 0; - while (j < tz->timecnt && tz->type[j].isdst) { - ++j; - } - if (j == tz->timecnt) { - j = 0; - } - return &(tz->type[j]); - } - - /* In all other cases we loop through the available transtion times to find - * the correct entry */ - for (i = 0; i < tz->timecnt; i++) { - if (ts < tz->trans[i]) { - *transition_time = tz->trans[i - 1]; - return &(tz->type[tz->trans_idx[i - 1]]); - } - } - *transition_time = tz->trans[tz->timecnt - 1]; - return &(tz->type[tz->trans_idx[tz->timecnt - 1]]); -} - -static tlinfo* fetch_leaptime_offset(timelib_tzinfo *tz, timelib_sll ts) -{ - int i; - - if (!tz->leapcnt || !tz->leap_times) { - return NULL; - } - - for (i = tz->leapcnt - 1; i > 0; i--) { - if (ts > tz->leap_times[i].trans) { - return &(tz->leap_times[i]); - } - } - return NULL; -} - -int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz) -{ - ttinfo *to; - timelib_sll dummy; - - if ((to = fetch_timezone_offset(tz, ts, &dummy))) { - return to->isdst; - } - return -1; -} - -timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo *tz) -{ - ttinfo *to; - tlinfo *tl; - int32_t offset = 0, leap_secs = 0; - char *abbr; - timelib_time_offset *tmp = timelib_time_offset_ctor(); - timelib_sll transistion_time; - - if ((to = fetch_timezone_offset(tz, ts, &transistion_time))) { - offset = to->offset; - abbr = &(tz->timezone_abbr[to->abbr_idx]); - tmp->is_dst = to->isdst; - tmp->transistion_time = transistion_time; - } else { - offset = 0; - abbr = tz->timezone_abbr; - tmp->is_dst = 0; - tmp->transistion_time = 0; - } - - if ((tl = fetch_leaptime_offset(tz, ts))) { - leap_secs = -tl->offset; - } - - tmp->offset = offset; - tmp->leap_secs = leap_secs; - tmp->abbr = abbr ? strdup(abbr) : strdup("GMT"); - - return tmp; -} - -timelib_sll timelib_get_current_offset(timelib_time *t) -{ - timelib_time_offset *gmt_offset; - timelib_sll retval; - - switch (t->zone_type) { - case TIMELIB_ZONETYPE_ABBR: - case TIMELIB_ZONETYPE_OFFSET: - return (t->z + t->dst) * -60; - - case TIMELIB_ZONETYPE_ID: - gmt_offset = timelib_get_time_zone_info(t->sse, t->tz_info); - retval = gmt_offset->offset; - timelib_time_offset_dtor(gmt_offset); - return retval; - - default: - return 0; - } -} diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c deleted file mode 100644 index 257a24a5ee6fd..0000000000000 --- a/ext/date/lib/timelib.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" -#include -#include - -#define TIMELIB_TIME_FREE(m) \ - if (m) { \ - free(m); \ - m = NULL; \ - } \ - -#define TIMELIB_LLABS(y) (y < 0 ? (y * -1) : y) - -timelib_time* timelib_time_ctor(void) -{ - timelib_time *t; - t = calloc(1, sizeof(timelib_time)); - - return t; -} - -void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr) -{ - unsigned int i; - - TIMELIB_TIME_FREE(tm->tz_abbr); - tm->tz_abbr = strdup(tz_abbr); - for (i = 0; i < strlen(tz_abbr); i++) { - tm->tz_abbr[i] = toupper(tz_abbr[i]); - } -} - -void timelib_time_dtor(timelib_time* t) -{ - TIMELIB_TIME_FREE(t->tz_abbr); - TIMELIB_TIME_FREE(t); -} - -timelib_time_offset* timelib_time_offset_ctor(void) -{ - timelib_time_offset *t; - t = calloc(1, sizeof(timelib_time_offset)); - - return t; -} - -void timelib_time_offset_dtor(timelib_time_offset* t) -{ - TIMELIB_TIME_FREE(t->abbr); - TIMELIB_TIME_FREE(t); -} - -timelib_tzinfo* timelib_tzinfo_ctor(char *name) -{ - timelib_tzinfo *t; - t = calloc(1, sizeof(timelib_tzinfo)); - t->name = strdup(name); - - return t; -} - -timelib_tzinfo *timelib_tzinfo_clone(timelib_tzinfo *tz) -{ - timelib_tzinfo *tmp = timelib_tzinfo_ctor(tz->name); - tmp->ttisgmtcnt = tz->ttisgmtcnt; - tmp->ttisstdcnt = tz->ttisstdcnt; - tmp->leapcnt = tz->leapcnt; - tmp->timecnt = tz->timecnt; - tmp->typecnt = tz->typecnt; - tmp->charcnt = tz->charcnt; - - tmp->trans = (int32_t *) malloc(tz->timecnt * sizeof(int32_t)); - tmp->trans_idx = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char)); - memcpy(tmp->trans, tz->trans, tz->timecnt * sizeof(int32_t)); - memcpy(tmp->trans_idx, tz->trans_idx, tz->timecnt * sizeof(unsigned char)); - - tmp->type = (ttinfo*) malloc(tz->typecnt * sizeof(struct ttinfo)); - memcpy(tmp->type, tz->type, tz->typecnt * sizeof(struct ttinfo)); - - tmp->timezone_abbr = (char*) malloc(tz->charcnt); - memcpy(tmp->timezone_abbr, tz->timezone_abbr, tz->charcnt); - - tmp->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo)); - memcpy(tmp->leap_times, tz->leap_times, tz->leapcnt * sizeof(tlinfo)); - - return tmp; -} - -void timelib_tzinfo_dtor(timelib_tzinfo *tz) -{ - TIMELIB_TIME_FREE(tz->name); - TIMELIB_TIME_FREE(tz->trans); - TIMELIB_TIME_FREE(tz->trans_idx); - TIMELIB_TIME_FREE(tz->type); - TIMELIB_TIME_FREE(tz->timezone_abbr); - TIMELIB_TIME_FREE(tz->leap_times); - TIMELIB_TIME_FREE(tz); -} - -char *timelib_get_tz_abbr_ptr(timelib_time *t) -{ - if (!t->sse_uptodate) { - timelib_update_ts(t, NULL); - }; - return t->tz_abbr; -} - -void timelib_error_container_dtor(timelib_error_container *errors) -{ - int i; - - for (i = 0; i < errors->warning_count; i++) { - free(errors->warning_messages[i].message); - } - free(errors->warning_messages); - for (i = 0; i < errors->error_count; i++) { - free(errors->error_messages[i].message); - } - free(errors->error_messages); - free(errors); -} - -signed long timelib_date_to_int(timelib_time *d, int *error) -{ - timelib_sll ts; - - ts = d->sse; - - if (ts < LONG_MIN || ts > LONG_MAX) { - if (error) { - *error = 1; - } - return 0; - } - if (error) { - *error = 0; - } - return (signed long) d->sse; -} - -void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec) -{ - *hour = floor(h); - *min = floor((h - *hour) * 60); - *sec = (h - *hour - ((float) *min / 60)) * 3600; -} - -void timelib_dump_date(timelib_time *d, int options) -{ - if ((options & 2) == 2) { - printf("TYPE: %d ", d->zone_type); - } - printf("TS: %lld | %s%04lld-%02lld-%02lld %02lld:%02lld:%02lld", - d->sse, d->y < 0 ? "-" : "", TIMELIB_LLABS(d->y), d->m, d->d, d->h, d->i, d->s); - if (d->f > +0.0) { - printf(" %.5f", d->f); - } - - if (d->is_localtime) { - switch (d->zone_type) { - case TIMELIB_ZONETYPE_OFFSET: /* Only offset */ - printf(" GMT %05d%s", d->z, d->dst == 1 ? " (DST)" : ""); - break; - case TIMELIB_ZONETYPE_ID: /* Timezone struct */ - /* Show abbreviation if wanted */ - if (d->tz_abbr) { - printf(" %s", d->tz_abbr); - } - /* Do we have a TimeZone struct? */ - if (d->tz_info) { - printf(" %s", d->tz_info->name); - } - break; - case TIMELIB_ZONETYPE_ABBR: - printf(" %s", d->tz_abbr); - printf(" %05d%s", d->z, d->dst == 1 ? " (DST)" : ""); - break; - } - } else { - printf(" GMT 00000"); - } - - if ((options & 1) == 1) { - if (d->have_relative) { - printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS", - d->relative.y, d->relative.m, d->relative.d, d->relative.h, d->relative.i, d->relative.s); - } - if (d->have_weekday_relative) { - printf(" / %d.%d", d->relative.weekday, d->relative.weekday_behavior); - } - if (d->have_special_relative) { - switch (d->special.type) { - case TIMELIB_SPECIAL_WEEKDAY: - printf(" / %lld weekday", d->special.amount); - break; - } - } - } - printf("\n"); -} - diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h deleted file mode 100644 index d54c2b6ecc820..0000000000000 --- a/ext/date/lib/timelib.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef __TIMELIB_H__ -#define __TIMELIB_H__ - -#include "timelib_structs.h" -#if HAVE_LIMITS_H -#include -#endif - -#define TIMELIB_NONE 0x00 -#define TIMELIB_OVERRIDE_TIME 0x01 -#define TIMELIB_NO_CLONE 0x02 - -#define TIMELIB_SPECIAL_WEEKDAY 0x01 - -#ifndef LONG_MAX -#define LONG_MAX 2147483647L -#endif - -#ifndef LONG_MIN -#define LONG_MIN (- LONG_MAX - 1) -#endif - -#if defined(_MSC_VER) && !defined(strcasecmp) -#define strcasecmp stricmp -#endif - -#if defined(_MSC_VER) && !defined(strncasecmp) -#define strncasecmp strnicmp -#endif - -/* From dow.c */ -timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d); -timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d); -timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d); -timelib_sll timelib_daynr_from_weeknr(timelib_sll y, timelib_sll w, timelib_sll d); -timelib_sll timelib_days_in_month(timelib_sll y, timelib_sll m); -void timelib_isoweek_from_date(timelib_sll y, timelib_sll m, timelib_sll d, timelib_sll *iw, timelib_sll *iy); - -/* From parse_date.re */ -timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb); -void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options); -char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst); -const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void); - -/* From tm2unixtime.c */ -void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi); - -/* From unixtime2tm.c */ -int timelib_apply_localtime(timelib_time *t, unsigned int localtime); -void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts); -void timelib_unixtime2local(timelib_time *tm, timelib_sll ts); -void timelib_update_from_sse(timelib_time *tm); -void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz); - -/* From parse_tz.c */ -int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb); -timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb); -int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz); -timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo *tz); -timelib_sll timelib_get_current_offset(timelib_time *t); -void timelib_dump_tzinfo(timelib_tzinfo *tz); -const timelib_tzdb *timelib_builtin_db(void); -const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count); - -/* From timelib.c */ -timelib_tzinfo* timelib_tzinfo_ctor(char *name); -void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr); -void timelib_time_tz_name_update(timelib_time* tm, char* tz_name); -void timelib_tzinfo_dtor(timelib_tzinfo *tz); -timelib_tzinfo* timelib_tzinfo_clone(timelib_tzinfo *tz); - -timelib_time* timelib_time_ctor(void); -void timelib_time_set_option(timelib_time* tm, int option, void* option_value); -void timelib_time_dtor(timelib_time* t); - -timelib_time_offset* timelib_time_offset_ctor(void); -void timelib_time_offset_dtor(timelib_time_offset* t); - -void timelib_error_container_dtor(timelib_error_container *errors); - -signed long timelib_date_to_int(timelib_time *d, int *error); -void timelib_dump_date(timelib_time *d, int options); - -void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec); - -/* from astro.c */ -double timelib_ts_to_juliandate(timelib_sll ts); -int timelib_astro_rise_set_altitude(timelib_time *time, double lon, double lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll *ts_rise, timelib_sll *ts_set, timelib_sll *ts_transit); - -#endif diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4 deleted file mode 100644 index c7255727f24e6..0000000000000 --- a/ext/date/lib/timelib.m4 +++ /dev/null @@ -1,80 +0,0 @@ -dnl -dnl $Id$ -dnl -dnl -dnl TL_DEF_HAVE(what [, why]) -dnl -dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [WHY])' -dnl -AC_DEFUN([TL_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___),1,[ $2 ])])dnl - -dnl -dnl TL_CHECK_INT_TYPE(type) -dnl -AC_DEFUN([TL_CHECK_INT_TYPE],[ -AC_CACHE_CHECK([for $1], ac_cv_int_type_$1, [ -AC_TRY_COMPILE([ -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#elif HAVE_STDINT_H -# include -#endif], -[if (($1 *) 0) - return 0; -if (sizeof ($1)) - return 0; -], [ac_cv_int_type_$1=yes], [ac_cv_int_type_$1=no]) -]) -if test "$ac_cv_int_type_$1" = "yes"; then - TL_DEF_HAVE($1, [Define if $1 type is present.]) -fi -])dnl - -dnl -dnl AC_TIMELIB_C_BIGENDIAN -dnl Replacement macro for AC_C_BIGENDIAN -dnl -AC_DEFUN([AC_TIMELIB_C_BIGENDIAN], -[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php, - [ - ac_cv_c_bigendian_php=unknown - AC_TRY_RUN( - [ -int main(void) -{ - short one = 1; - char *cp = (char *)&one; - - if (*cp == 0) { - return(0); - } else { - return(1); - } -} - ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown]) - ]) - if test $ac_cv_c_bigendian_php = yes; then - AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word]) - fi -])dnl - -dnl Check for types, sizes, etc. needed by timelib -AC_CHECK_SIZEOF(long, 8) -AC_CHECK_SIZEOF(int, 4) -TL_CHECK_INT_TYPE(int32_t) -TL_CHECK_INT_TYPE(uint32_t) - -dnl Check for headers needed by timelib -AC_CHECK_HEADERS([ \ -sys/types.h \ -inttypes.h \ -stdint.h \ -string.h \ -stdlib.h -]) - -dnl Check for strtoll, atoll -AC_CHECK_FUNCS(strtoll atoll strftime) diff --git a/ext/date/lib/timelib_config.h.win32 b/ext/date/lib/timelib_config.h.win32 deleted file mode 100755 index 379b3902fc6e6..0000000000000 --- a/ext/date/lib/timelib_config.h.win32 +++ /dev/null @@ -1 +0,0 @@ -# include "config.w32.h" diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h deleted file mode 100644 index 1a9374573a75b..0000000000000 --- a/ext/date/lib/timelib_structs.h +++ /dev/null @@ -1,208 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef __TIMELIB_STRUCTS_H__ -#define __TIMELIB_STRUCTS_H__ - -#include "timelib_config.h" - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#if defined(HAVE_INTTYPES_H) -#include -#elif defined(HAVE_STDINT_H) -#include -#endif - -#ifndef HAVE_INT32_T -# if SIZEOF_INT == 4 -typedef int int32_t; -# elif SIZEOF_LONG == 4 -typedef long int int32_t; -# endif -#endif - -#ifndef HAVE_UINT32_T -# if SIZEOF_INT == 4 -typedef unsigned int uint32_t; -# elif SIZEOF_LONG == 4 -typedef unsigned long int uint32_t; -# endif -#endif - -#include - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#else -#include -#endif - -#if defined(_MSC_VER) -typedef unsigned __int64 timelib_ull; -typedef __int64 timelib_sll; -#else -typedef unsigned long long timelib_ull; -typedef signed long long timelib_sll; -#endif - -#if defined(_MSC_VER) -#define int32_t __int32 -#define uint32_t unsigned __int32 -#endif - -#if defined(_MSC_VER) -#define TIMELIB_LL_CONST(n) n ## i64 -#else -#define TIMELIB_LL_CONST(n) n ## ll -#endif - - -typedef struct ttinfo -{ - int32_t offset; - int isdst; - unsigned int abbr_idx; - - unsigned int isstdcnt; - unsigned int isgmtcnt; -} ttinfo; - -typedef struct tlinfo -{ - int32_t trans; - int32_t offset; -} tlinfo; - -typedef struct timelib_tzinfo -{ - char *name; - uint32_t ttisgmtcnt; - uint32_t ttisstdcnt; - uint32_t leapcnt; - uint32_t timecnt; - uint32_t typecnt; - uint32_t charcnt; - - int32_t *trans; - unsigned char *trans_idx; - - ttinfo *type; - char *timezone_abbr; - - tlinfo *leap_times; -} timelib_tzinfo; - -typedef struct timelib_rel_time { - timelib_sll y, m, d; /* Years, Months and Days */ - timelib_sll h, i, s; /* Hours, mInutes and Seconds */ - - int weekday; /* Stores the day in 'next monday' */ - int weekday_behavior; /* 0: the current day should *not* be counted when advancing forwards; 1: the current day *should* be counted */ -} timelib_rel_time; - -typedef struct timelib_time_offset { - int32_t offset; - unsigned int leap_secs; - unsigned int is_dst; - char *abbr; - timelib_sll transistion_time; -} timelib_time_offset; - -typedef struct timelib_special { - unsigned int type; - timelib_sll amount; -} timelib_special; - -typedef struct timelib_time { - timelib_sll y, m, d; /* Year, Month, Day */ - timelib_sll h, i, s; /* Hour, mInute, Second */ - double f; /* Fraction */ - int z; /* GMT offset in minutes */ - char *tz_abbr; /* Timezone abbreviation (display only) */ - timelib_tzinfo *tz_info; /* Timezone structure */ - signed int dst; /* Flag if we were parsing a DST zone */ - timelib_rel_time relative; - timelib_special special; - - timelib_sll sse; /* Seconds since epoch */ - - unsigned int have_time, have_date, have_zone, have_relative, have_weekday_relative, have_special_relative, have_weeknr_day; - - unsigned int sse_uptodate; /* !0 if the sse member is up to date with the date/time members */ - unsigned int tim_uptodate; /* !0 if the date/time members are up to date with the sse member */ - unsigned int is_localtime; /* 1 if the current struct represents localtime, 0 if it is in GMT */ - unsigned int zone_type; /* 1 time offset, - * 3 TimeZone identifier, - * 2 TimeZone abbreviation */ -} timelib_time; - -typedef struct timelib_error_message { - int position; - char character; - char *message; -} timelib_error_message; - -typedef struct timelib_error_container { - int warning_count; - struct timelib_error_message *warning_messages; - int error_count; - struct timelib_error_message *error_messages; -} timelib_error_container; - -typedef struct _timelib_tz_lookup_table { - char *name; - int type; - int gmtoffset; - char *full_tz_name; -} timelib_tz_lookup_table; - -typedef struct _timelib_tzdb_index_entry { - char *id; - unsigned int pos; -} timelib_tzdb_index_entry; - -typedef struct _timelib_tzdb { - char *version; - int index_size; - const timelib_tzdb_index_entry *index; - const unsigned char *data; -} timelib_tzdb; - -#define TIMELIB_ZONETYPE_OFFSET 1 -#define TIMELIB_ZONETYPE_ABBR 2 -#define TIMELIB_ZONETYPE_ID 3 - -#define SECS_PER_ERA TIMELIB_LL_CONST(12622780800) -#define SECS_PER_DAY 86400 -#define DAYS_PER_YEAR 365 -#define DAYS_PER_LYEAR 366 - -#define timelib_is_leap(y) ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0)) - -#define DEBUG(s) if (0) { s } - -#endif diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h deleted file mode 100644 index f05cc925049b2..0000000000000 --- a/ext/date/lib/timezonedb.h +++ /dev/null @@ -1,18065 +0,0 @@ -const timelib_tzdb_index_entry timezonedb_idx_builtin[559] = { - { "Africa/Abidjan" , 0x000000 }, - { "Africa/Accra" , 0x000055 }, - { "Africa/Addis_Ababa" , 0x0000FD }, - { "Africa/Algiers" , 0x000153 }, - { "Africa/Asmara" , 0x00027E }, - { "Africa/Asmera" , 0x0002D4 }, - { "Africa/Bamako" , 0x00032A }, - { "Africa/Bangui" , 0x000395 }, - { "Africa/Banjul" , 0x0003EA }, - { "Africa/Bissau" , 0x000461 }, - { "Africa/Blantyre" , 0x0004C7 }, - { "Africa/Brazzaville" , 0x00051C }, - { "Africa/Bujumbura" , 0x000571 }, - { "Africa/Cairo" , 0x0005B5 }, - { "Africa/Casablanca" , 0x00097C }, - { "Africa/Ceuta" , 0x000A4E }, - { "Africa/Conakry" , 0x000D55 }, - { "Africa/Dakar" , 0x000DC0 }, - { "Africa/Dar_es_Salaam" , 0x000E26 }, - { "Africa/Djibouti" , 0x000E93 }, - { "Africa/Douala" , 0x000EE8 }, - { "Africa/El_Aaiun" , 0x000F3D }, - { "Africa/Freetown" , 0x000FA3 }, - { "Africa/Gaborone" , 0x0010B2 }, - { "Africa/Harare" , 0x00110D }, - { "Africa/Johannesburg" , 0x001162 }, - { "Africa/Kampala" , 0x0011D0 }, - { "Africa/Khartoum" , 0x00124F }, - { "Africa/Kigali" , 0x001362 }, - { "Africa/Kinshasa" , 0x0013B7 }, - { "Africa/Lagos" , 0x001412 }, - { "Africa/Libreville" , 0x001467 }, - { "Africa/Lome" , 0x0014BC }, - { "Africa/Luanda" , 0x001500 }, - { "Africa/Lubumbashi" , 0x001555 }, - { "Africa/Lusaka" , 0x0015B0 }, - { "Africa/Malabo" , 0x001605 }, - { "Africa/Maputo" , 0x00166B }, - { "Africa/Maseru" , 0x0016C0 }, - { "Africa/Mbabane" , 0x001728 }, - { "Africa/Mogadishu" , 0x00177E }, - { "Africa/Monrovia" , 0x0017D9 }, - { "Africa/Nairobi" , 0x00183F }, - { "Africa/Ndjamena" , 0x0018BE }, - { "Africa/Niamey" , 0x00192A }, - { "Africa/Nouakchott" , 0x00199D }, - { "Africa/Ouagadougou" , 0x001A08 }, - { "Africa/Porto-Novo" , 0x001A5D }, - { "Africa/Sao_Tome" , 0x001AC3 }, - { "Africa/Timbuktu" , 0x001B18 }, - { "Africa/Tripoli" , 0x001B83 }, - { "Africa/Tunis" , 0x001C7D }, - { "Africa/Windhoek" , 0x001EB1 }, - { "America/Adak" , 0x0020F8 }, - { "America/Anchorage" , 0x00246E }, - { "America/Anguilla" , 0x0027E2 }, - { "America/Antigua" , 0x002837 }, - { "America/Araguaina" , 0x00289D }, - { "America/Argentina/Buenos_Aires" , 0x0029F8 }, - { "America/Argentina/Catamarca" , 0x002CC3 }, - { "America/Argentina/ComodRivadavia" , 0x002E84 }, - { "America/Argentina/Cordoba" , 0x00302A }, - { "America/Argentina/Jujuy" , 0x00331C }, - { "America/Argentina/La_Rioja" , 0x0034D0 }, - { "America/Argentina/Mendoza" , 0x003688 }, - { "America/Argentina/Rio_Gallegos" , 0x003848 }, - { "America/Argentina/Salta" , 0x0039FD }, - { "America/Argentina/San_Juan" , 0x003BA9 }, - { "America/Argentina/San_Luis" , 0x003D61 }, - { "America/Argentina/Tucuman" , 0x003F13 }, - { "America/Argentina/Ushuaia" , 0x0041EC }, - { "America/Aruba" , 0x0043A7 }, - { "America/Asuncion" , 0x00440D }, - { "America/Atikokan" , 0x0046F2 }, - { "America/Atka" , 0x0047C8 }, - { "America/Bahia" , 0x004B2E }, - { "America/Barbados" , 0x004CB7 }, - { "America/Belem" , 0x004D51 }, - { "America/Belize" , 0x004E4C }, - { "America/Blanc-Sablon" , 0x004FC8 }, - { "America/Boa_Vista" , 0x00507C }, - { "America/Bogota" , 0x005185 }, - { "America/Boise" , 0x0051F1 }, - { "America/Buenos_Aires" , 0x005588 }, - { "America/Cambridge_Bay" , 0x00583E }, - { "America/Campo_Grande" , 0x005B66 }, - { "America/Cancun" , 0x005E55 }, - { "America/Caracas" , 0x006097 }, - { "America/Catamarca" , 0x0060FE }, - { "America/Cayenne" , 0x0062A4 }, - { "America/Cayman" , 0x006306 }, - { "America/Chicago" , 0x00635B }, - { "America/Chihuahua" , 0x006872 }, - { "America/Coral_Harbour" , 0x006AC1 }, - { "America/Cordoba" , 0x006B53 }, - { "America/Costa_Rica" , 0x006E16 }, - { "America/Cuiaba" , 0x006EA0 }, - { "America/Curacao" , 0x00717E }, - { "America/Danmarkshavn" , 0x0071E4 }, - { "America/Dawson" , 0x007328 }, - { "America/Dawson_Creek" , 0x007645 }, - { "America/Denver" , 0x00781F }, - { "America/Detroit" , 0x007BA5 }, - { "America/Dominica" , 0x007F04 }, - { "America/Edmonton" , 0x007F59 }, - { "America/Eirunepe" , 0x008311 }, - { "America/El_Salvador" , 0x008424 }, - { "America/Ensenada" , 0x008499 }, - { "America/Fort_Wayne" , 0x008940 }, - { "America/Fortaleza" , 0x008802 }, - { "America/Glace_Bay" , 0x008BAA }, - { "America/Godthab" , 0x008F21 }, - { "America/Goose_Bay" , 0x0091E5 }, - { "America/Grand_Turk" , 0x0096A2 }, - { "America/Grenada" , 0x009951 }, - { "America/Guadeloupe" , 0x0099A6 }, - { "America/Guatemala" , 0x0099FB }, - { "America/Guayaquil" , 0x009A84 }, - { "America/Guyana" , 0x009AE1 }, - { "America/Halifax" , 0x009B62 }, - { "America/Havana" , 0x00A078 }, - { "America/Hermosillo" , 0x00A3EB }, - { "America/Indiana/Indianapolis" , 0x00A4C9 }, - { "America/Indiana/Knox" , 0x00A75A }, - { "America/Indiana/Marengo" , 0x00AAF1 }, - { "America/Indiana/Petersburg" , 0x00AD97 }, - { "America/Indiana/Tell_City" , 0x00B2E4 }, - { "America/Indiana/Vevay" , 0x00B57D }, - { "America/Indiana/Vincennes" , 0x00B7B8 }, - { "America/Indiana/Winamac" , 0x00BA6C }, - { "America/Indianapolis" , 0x00B07A }, - { "America/Inuvik" , 0x00BD25 }, - { "America/Iqaluit" , 0x00C01C }, - { "America/Jamaica" , 0x00C33E }, - { "America/Jujuy" , 0x00C403 }, - { "America/Juneau" , 0x00C5AD }, - { "America/Kentucky/Louisville" , 0x00C92B }, - { "America/Kentucky/Monticello" , 0x00CD49 }, - { "America/Knox_IN" , 0x00D0CE }, - { "America/La_Paz" , 0x00D43F }, - { "America/Lima" , 0x00D4A6 }, - { "America/Los_Angeles" , 0x00D54E }, - { "America/Louisville" , 0x00D95F }, - { "America/Maceio" , 0x00DD54 }, - { "America/Managua" , 0x00DE8E }, - { "America/Manaus" , 0x00DF41 }, - { "America/Marigot" , 0x00E043 }, - { "America/Martinique" , 0x00E098 }, - { "America/Mazatlan" , 0x00E104 }, - { "America/Mendoza" , 0x00E371 }, - { "America/Menominee" , 0x00E525 }, - { "America/Merida" , 0x00E8A6 }, - { "America/Mexico_City" , 0x00EAE1 }, - { "America/Miquelon" , 0x00ED5C }, - { "America/Moncton" , 0x00EFCE }, - { "America/Monterrey" , 0x00F465 }, - { "America/Montevideo" , 0x00F6AC }, - { "America/Montreal" , 0x00F9BE }, - { "America/Montserrat" , 0x00FED4 }, - { "America/Nassau" , 0x00FF29 }, - { "America/New_York" , 0x01026E }, - { "America/Nipigon" , 0x010779 }, - { "America/Nome" , 0x010ACA }, - { "America/Noronha" , 0x010E48 }, - { "America/North_Dakota/Center" , 0x010F78 }, - { "America/North_Dakota/New_Salem" , 0x01130C }, - { "America/Panama" , 0x0116B5 }, - { "America/Pangnirtung" , 0x01170A }, - { "America/Paramaribo" , 0x011A40 }, - { "America/Phoenix" , 0x011AD2 }, - { "America/Port-au-Prince" , 0x011B80 }, - { "America/Port_of_Spain" , 0x011D9B }, - { "America/Porto_Acre" , 0x011C9C }, - { "America/Porto_Velho" , 0x011DF0 }, - { "America/Puerto_Rico" , 0x011EE6 }, - { "America/Rainy_River" , 0x011F51 }, - { "America/Rankin_Inlet" , 0x012289 }, - { "America/Recife" , 0x01256F }, - { "America/Regina" , 0x012699 }, - { "America/Resolute" , 0x012857 }, - { "America/Rio_Branco" , 0x012A09 }, - { "America/Rosario" , 0x012B0C }, - { "America/Santarem" , 0x012DCF }, - { "America/Santiago" , 0x012ED4 }, - { "America/Santo_Domingo" , 0x01327D }, - { "America/Sao_Paulo" , 0x013343 }, - { "America/Scoresbysund" , 0x013652 }, - { "America/Shiprock" , 0x013940 }, - { "America/St_Barthelemy" , 0x013CCF }, - { "America/St_Johns" , 0x013D24 }, - { "America/St_Kitts" , 0x014277 }, - { "America/St_Lucia" , 0x0142CC }, - { "America/St_Thomas" , 0x014321 }, - { "America/St_Vincent" , 0x014376 }, - { "America/Swift_Current" , 0x0143CB }, - { "America/Tegucigalpa" , 0x0144EC }, - { "America/Thule" , 0x01456B }, - { "America/Thunder_Bay" , 0x0147B2 }, - { "America/Tijuana" , 0x014AFB }, - { "America/Toronto" , 0x014E70 }, - { "America/Tortola" , 0x015387 }, - { "America/Vancouver" , 0x0153DC }, - { "America/Virgin" , 0x015819 }, - { "America/Whitehorse" , 0x01586E }, - { "America/Winnipeg" , 0x015B8B }, - { "America/Yakutat" , 0x015FCB }, - { "America/Yellowknife" , 0x016336 }, - { "Antarctica/Casey" , 0x016646 }, - { "Antarctica/Davis" , 0x0166BA }, - { "Antarctica/DumontDUrville" , 0x016737 }, - { "Antarctica/Mawson" , 0x0167C9 }, - { "Antarctica/McMurdo" , 0x016838 }, - { "Antarctica/Palmer" , 0x016B3A }, - { "Antarctica/Rothera" , 0x016E56 }, - { "Antarctica/South_Pole" , 0x016ECC }, - { "Antarctica/Syowa" , 0x0171D4 }, - { "Antarctica/Vostok" , 0x017242 }, - { "Arctic/Longyearbyen" , 0x0172B7 }, - { "Asia/Aden" , 0x0175E9 }, - { "Asia/Almaty" , 0x01763E }, - { "Asia/Amman" , 0x0177BD }, - { "Asia/Anadyr" , 0x017A7D }, - { "Asia/Aqtau" , 0x017D6B }, - { "Asia/Aqtobe" , 0x017F6A }, - { "Asia/Ashgabat" , 0x018122 }, - { "Asia/Ashkhabad" , 0x01823F }, - { "Asia/Baghdad" , 0x01835C }, - { "Asia/Bahrain" , 0x0184D1 }, - { "Asia/Baku" , 0x018537 }, - { "Asia/Bangkok" , 0x01881F }, - { "Asia/Beirut" , 0x018874 }, - { "Asia/Bishkek" , 0x018B81 }, - { "Asia/Brunei" , 0x018D2D }, - { "Asia/Calcutta" , 0x018D8F }, - { "Asia/Choibalsan" , 0x018E08 }, - { "Asia/Chongqing" , 0x018F81 }, - { "Asia/Chungking" , 0x019070 }, - { "Asia/Colombo" , 0x01911F }, - { "Asia/Dacca" , 0x0191BB }, - { "Asia/Damascus" , 0x01924A }, - { "Asia/Dhaka" , 0x01959A }, - { "Asia/Dili" , 0x019629 }, - { "Asia/Dubai" , 0x0196B2 }, - { "Asia/Dushanbe" , 0x019707 }, - { "Asia/Gaza" , 0x01980A }, - { "Asia/Harbin" , 0x019B53 }, - { "Asia/Ho_Chi_Minh" , 0x019C3A }, - { "Asia/Hong_Kong" , 0x019CB2 }, - { "Asia/Hovd" , 0x019E68 }, - { "Asia/Irkutsk" , 0x019FE0 }, - { "Asia/Istanbul" , 0x01A2C7 }, - { "Asia/Jakarta" , 0x01A6B4 }, - { "Asia/Jayapura" , 0x01A75E }, - { "Asia/Jerusalem" , 0x01A7E2 }, - { "Asia/Kabul" , 0x01AB11 }, - { "Asia/Kamchatka" , 0x01AB62 }, - { "Asia/Karachi" , 0x01AE47 }, - { "Asia/Kashgar" , 0x01AEF2 }, - { "Asia/Katmandu" , 0x01AFC3 }, - { "Asia/Kolkata" , 0x01B029 }, - { "Asia/Krasnoyarsk" , 0x01B0A2 }, - { "Asia/Kuala_Lumpur" , 0x01B38B }, - { "Asia/Kuching" , 0x01B448 }, - { "Asia/Kuwait" , 0x01B536 }, - { "Asia/Macao" , 0x01B58B }, - { "Asia/Macau" , 0x01B6C6 }, - { "Asia/Magadan" , 0x01B801 }, - { "Asia/Makassar" , 0x01BAE4 }, - { "Asia/Manila" , 0x01BB9D }, - { "Asia/Muscat" , 0x01BC22 }, - { "Asia/Nicosia" , 0x01BC77 }, - { "Asia/Novosibirsk" , 0x01BF5F }, - { "Asia/Omsk" , 0x01C253 }, - { "Asia/Oral" , 0x01C53B }, - { "Asia/Phnom_Penh" , 0x01C70B }, - { "Asia/Pontianak" , 0x01C783 }, - { "Asia/Pyongyang" , 0x01C844 }, - { "Asia/Qatar" , 0x01C8B1 }, - { "Asia/Qyzylorda" , 0x01C917 }, - { "Asia/Rangoon" , 0x01CAED }, - { "Asia/Riyadh" , 0x01CB65 }, - { "Asia/Saigon" , 0x01CBBA }, - { "Asia/Sakhalin" , 0x01CC32 }, - { "Asia/Samarkand" , 0x01CF32 }, - { "Asia/Seoul" , 0x01D068 }, - { "Asia/Shanghai" , 0x01D10C }, - { "Asia/Singapore" , 0x01D1EC }, - { "Asia/Taipei" , 0x01D2A3 }, - { "Asia/Tashkent" , 0x01D3BB }, - { "Asia/Tbilisi" , 0x01D4EC }, - { "Asia/Tehran" , 0x01D6A6 }, - { "Asia/Tel_Aviv" , 0x01D914 }, - { "Asia/Thimbu" , 0x01DC43 }, - { "Asia/Thimphu" , 0x01DCA9 }, - { "Asia/Tokyo" , 0x01DD0F }, - { "Asia/Ujung_Pandang" , 0x01DD98 }, - { "Asia/Ulaanbaatar" , 0x01DE14 }, - { "Asia/Ulan_Bator" , 0x01DF6F }, - { "Asia/Urumqi" , 0x01E0BC }, - { "Asia/Vientiane" , 0x01E183 }, - { "Asia/Vladivostok" , 0x01E1FB }, - { "Asia/Yakutsk" , 0x01E4E8 }, - { "Asia/Yekaterinburg" , 0x01E7CE }, - { "Asia/Yerevan" , 0x01EADA }, - { "Atlantic/Azores" , 0x01EDDE }, - { "Atlantic/Bermuda" , 0x01F2E1 }, - { "Atlantic/Canary" , 0x01F5C2 }, - { "Atlantic/Cape_Verde" , 0x01F898 }, - { "Atlantic/Faeroe" , 0x01F911 }, - { "Atlantic/Faroe" , 0x01FBB5 }, - { "Atlantic/Jan_Mayen" , 0x01FE59 }, - { "Atlantic/Madeira" , 0x02018B }, - { "Atlantic/Reykjavik" , 0x020694 }, - { "Atlantic/South_Georgia" , 0x02084D }, - { "Atlantic/St_Helena" , 0x020B65 }, - { "Atlantic/Stanley" , 0x020891 }, - { "Australia/ACT" , 0x020BBA }, - { "Australia/Adelaide" , 0x020ED7 }, - { "Australia/Brisbane" , 0x021203 }, - { "Australia/Broken_Hill" , 0x0212CA }, - { "Australia/Canberra" , 0x021608 }, - { "Australia/Currie" , 0x021925 }, - { "Australia/Darwin" , 0x021C58 }, - { "Australia/Eucla" , 0x021CDE }, - { "Australia/Hobart" , 0x021DB3 }, - { "Australia/LHI" , 0x022111 }, - { "Australia/Lindeman" , 0x0223AC }, - { "Australia/Lord_Howe" , 0x02248D }, - { "Australia/Melbourne" , 0x022738 }, - { "Australia/North" , 0x022A5D }, - { "Australia/NSW" , 0x022AD1 }, - { "Australia/Perth" , 0x022DEE }, - { "Australia/Queensland" , 0x022EC6 }, - { "Australia/South" , 0x022F72 }, - { "Australia/Sydney" , 0x02328F }, - { "Australia/Tasmania" , 0x0235CC }, - { "Australia/Victoria" , 0x023911 }, - { "Australia/West" , 0x023C2E }, - { "Australia/Yancowinna" , 0x023CE4 }, - { "Brazil/Acre" , 0x024006 }, - { "Brazil/DeNoronha" , 0x024105 }, - { "Brazil/East" , 0x024225 }, - { "Brazil/West" , 0x024502 }, - { "Canada/Atlantic" , 0x0245FA }, - { "Canada/Central" , 0x024AE2 }, - { "Canada/East-Saskatchewan" , 0x0253EC }, - { "Canada/Eastern" , 0x024EFC }, - { "Canada/Mountain" , 0x025575 }, - { "Canada/Newfoundland" , 0x0258EB }, - { "Canada/Pacific" , 0x025E16 }, - { "Canada/Saskatchewan" , 0x02622F }, - { "Canada/Yukon" , 0x0263B8 }, - { "CET" , 0x0266BB }, - { "Chile/Continental" , 0x0269C4 }, - { "Chile/EasterIsland" , 0x026D5F }, - { "CST6CDT" , 0x0270A1 }, - { "Cuba" , 0x0273F2 }, - { "EET" , 0x027765 }, - { "Egypt" , 0x027A18 }, - { "Eire" , 0x027DDF }, - { "EST" , 0x0282F0 }, - { "EST5EDT" , 0x028334 }, - { "Etc/GMT" , 0x028685 }, - { "Etc/GMT+0" , 0x028751 }, - { "Etc/GMT+1" , 0x0287DB }, - { "Etc/GMT+10" , 0x028868 }, - { "Etc/GMT+11" , 0x0288F6 }, - { "Etc/GMT+12" , 0x028984 }, - { "Etc/GMT+2" , 0x028A9F }, - { "Etc/GMT+3" , 0x028B2B }, - { "Etc/GMT+4" , 0x028BB7 }, - { "Etc/GMT+5" , 0x028C43 }, - { "Etc/GMT+6" , 0x028CCF }, - { "Etc/GMT+7" , 0x028D5B }, - { "Etc/GMT+8" , 0x028DE7 }, - { "Etc/GMT+9" , 0x028E73 }, - { "Etc/GMT-0" , 0x02870D }, - { "Etc/GMT-1" , 0x028795 }, - { "Etc/GMT-10" , 0x028821 }, - { "Etc/GMT-11" , 0x0288AF }, - { "Etc/GMT-12" , 0x02893D }, - { "Etc/GMT-13" , 0x0289CB }, - { "Etc/GMT-14" , 0x028A12 }, - { "Etc/GMT-2" , 0x028A59 }, - { "Etc/GMT-3" , 0x028AE5 }, - { "Etc/GMT-4" , 0x028B71 }, - { "Etc/GMT-5" , 0x028BFD }, - { "Etc/GMT-6" , 0x028C89 }, - { "Etc/GMT-7" , 0x028D15 }, - { "Etc/GMT-8" , 0x028DA1 }, - { "Etc/GMT-9" , 0x028E2D }, - { "Etc/GMT0" , 0x0286C9 }, - { "Etc/Greenwich" , 0x028EB9 }, - { "Etc/UCT" , 0x028EFD }, - { "Etc/Universal" , 0x028F41 }, - { "Etc/UTC" , 0x028F85 }, - { "Etc/Zulu" , 0x028FC9 }, - { "Europe/Amsterdam" , 0x02900D }, - { "Europe/Andorra" , 0x02944B }, - { "Europe/Athens" , 0x0296C7 }, - { "Europe/Belfast" , 0x029A0A }, - { "Europe/Belgrade" , 0x029F41 }, - { "Europe/Berlin" , 0x02A20A }, - { "Europe/Bratislava" , 0x02A560 }, - { "Europe/Brussels" , 0x02A892 }, - { "Europe/Bucharest" , 0x02ACC9 }, - { "Europe/Budapest" , 0x02AFF3 }, - { "Europe/Chisinau" , 0x02B366 }, - { "Europe/Copenhagen" , 0x02B6F4 }, - { "Europe/Dublin" , 0x02B9FE }, - { "Europe/Gibraltar" , 0x02BF0F }, - { "Europe/Guernsey" , 0x02C366 }, - { "Europe/Helsinki" , 0x02C89D }, - { "Europe/Isle_of_Man" , 0x02CB53 }, - { "Europe/Istanbul" , 0x02D08A }, - { "Europe/Jersey" , 0x02D477 }, - { "Europe/Kaliningrad" , 0x02D9AE }, - { "Europe/Kiev" , 0x02DD11 }, - { "Europe/Lisbon" , 0x02E028 }, - { "Europe/Ljubljana" , 0x02E52C }, - { "Europe/London" , 0x02E7F5 }, - { "Europe/Luxembourg" , 0x02ED2C }, - { "Europe/Madrid" , 0x02F182 }, - { "Europe/Malta" , 0x02F548 }, - { "Europe/Mariehamn" , 0x02F901 }, - { "Europe/Minsk" , 0x02FBB7 }, - { "Europe/Monaco" , 0x02FEC2 }, - { "Europe/Moscow" , 0x0302FD }, - { "Europe/Nicosia" , 0x03064F }, - { "Europe/Oslo" , 0x030937 }, - { "Europe/Paris" , 0x030C69 }, - { "Europe/Podgorica" , 0x0310AF }, - { "Europe/Prague" , 0x031378 }, - { "Europe/Riga" , 0x0316AA }, - { "Europe/Rome" , 0x0319EF }, - { "Europe/Samara" , 0x031DB2 }, - { "Europe/San_Marino" , 0x0320DE }, - { "Europe/Sarajevo" , 0x0324A1 }, - { "Europe/Simferopol" , 0x03276A }, - { "Europe/Skopje" , 0x032A95 }, - { "Europe/Sofia" , 0x032D5E }, - { "Europe/Stockholm" , 0x033066 }, - { "Europe/Tallinn" , 0x033315 }, - { "Europe/Tirane" , 0x03364F }, - { "Europe/Tiraspol" , 0x033955 }, - { "Europe/Uzhgorod" , 0x033CE3 }, - { "Europe/Vaduz" , 0x033FFA }, - { "Europe/Vatican" , 0x03428D }, - { "Europe/Vienna" , 0x034650 }, - { "Europe/Vilnius" , 0x03497D }, - { "Europe/Volgograd" , 0x034CBC }, - { "Europe/Warsaw" , 0x034FC5 }, - { "Europe/Zagreb" , 0x0353A6 }, - { "Europe/Zaporozhye" , 0x03566F }, - { "Europe/Zurich" , 0x0359B0 }, - { "Factory" , 0x035C69 }, - { "GB" , 0x035CDA }, - { "GB-Eire" , 0x036211 }, - { "GMT" , 0x036748 }, - { "GMT+0" , 0x036814 }, - { "GMT-0" , 0x0367D0 }, - { "GMT0" , 0x03678C }, - { "Greenwich" , 0x036858 }, - { "Hongkong" , 0x03689C }, - { "HST" , 0x036A52 }, - { "Iceland" , 0x036A96 }, - { "Indian/Antananarivo" , 0x036C4F }, - { "Indian/Chagos" , 0x036CC3 }, - { "Indian/Christmas" , 0x036D25 }, - { "Indian/Cocos" , 0x036D69 }, - { "Indian/Comoro" , 0x036DAD }, - { "Indian/Kerguelen" , 0x036E02 }, - { "Indian/Mahe" , 0x036E57 }, - { "Indian/Maldives" , 0x036EAC }, - { "Indian/Mauritius" , 0x036F01 }, - { "Indian/Mayotte" , 0x0370A4 }, - { "Indian/Reunion" , 0x0370F9 }, - { "Iran" , 0x03714E }, - { "Israel" , 0x0373BC }, - { "Jamaica" , 0x0376EB }, - { "Japan" , 0x0377B0 }, - { "Kwajalein" , 0x037839 }, - { "Libya" , 0x03789C }, - { "MET" , 0x037996 }, - { "Mexico/BajaNorte" , 0x037C9F }, - { "Mexico/BajaSur" , 0x038008 }, - { "Mexico/General" , 0x03824D }, - { "MST" , 0x0384AB }, - { "MST7MDT" , 0x0384EF }, - { "Navajo" , 0x038840 }, - { "NZ" , 0x038BB9 }, - { "NZ-CHAT" , 0x038F37 }, - { "Pacific/Apia" , 0x03921F }, - { "Pacific/Auckland" , 0x039286 }, - { "Pacific/Chatham" , 0x039612 }, - { "Pacific/Easter" , 0x039909 }, - { "Pacific/Efate" , 0x039C67 }, - { "Pacific/Enderbury" , 0x039D2D }, - { "Pacific/Fakaofo" , 0x039D9B }, - { "Pacific/Fiji" , 0x039DDF }, - { "Pacific/Funafuti" , 0x039E55 }, - { "Pacific/Galapagos" , 0x039E99 }, - { "Pacific/Gambier" , 0x039F11 }, - { "Pacific/Guadalcanal" , 0x039F76 }, - { "Pacific/Guam" , 0x039FCB }, - { "Pacific/Honolulu" , 0x03A021 }, - { "Pacific/Johnston" , 0x03A0B5 }, - { "Pacific/Kiritimati" , 0x03A107 }, - { "Pacific/Kosrae" , 0x03A172 }, - { "Pacific/Kwajalein" , 0x03A1CF }, - { "Pacific/Majuro" , 0x03A23B }, - { "Pacific/Marquesas" , 0x03A29A }, - { "Pacific/Midway" , 0x03A301 }, - { "Pacific/Nauru" , 0x03A38B }, - { "Pacific/Niue" , 0x03A403 }, - { "Pacific/Norfolk" , 0x03A461 }, - { "Pacific/Noumea" , 0x03A4B6 }, - { "Pacific/Pago_Pago" , 0x03A546 }, - { "Pacific/Palau" , 0x03A5CF }, - { "Pacific/Pitcairn" , 0x03A613 }, - { "Pacific/Ponape" , 0x03A668 }, - { "Pacific/Port_Moresby" , 0x03A6BD }, - { "Pacific/Rarotonga" , 0x03A701 }, - { "Pacific/Saipan" , 0x03A7DD }, - { "Pacific/Samoa" , 0x03A840 }, - { "Pacific/Tahiti" , 0x03A8C9 }, - { "Pacific/Tarawa" , 0x03A92E }, - { "Pacific/Tongatapu" , 0x03A982 }, - { "Pacific/Truk" , 0x03AA0E }, - { "Pacific/Wake" , 0x03AA67 }, - { "Pacific/Wallis" , 0x03AAB7 }, - { "Pacific/Yap" , 0x03AAFB }, - { "Poland" , 0x03AB40 }, - { "Portugal" , 0x03AF21 }, - { "PRC" , 0x03B41D }, - { "PST8PDT" , 0x03B4CE }, - { "ROC" , 0x03B81F }, - { "ROK" , 0x03B937 }, - { "Singapore" , 0x03B9DB }, - { "Turkey" , 0x03BA92 }, - { "UCT" , 0x03BE7F }, - { "Universal" , 0x03BEC3 }, - { "US/Alaska" , 0x03BF07 }, - { "US/Aleutian" , 0x03C270 }, - { "US/Arizona" , 0x03C5D6 }, - { "US/Central" , 0x03C664 }, - { "US/East-Indiana" , 0x03D06E }, - { "US/Eastern" , 0x03CB6F }, - { "US/Hawaii" , 0x03D2D8 }, - { "US/Indiana-Starke" , 0x03D366 }, - { "US/Michigan" , 0x03D6D7 }, - { "US/Mountain" , 0x03DA0E }, - { "US/Pacific" , 0x03DD87 }, - { "US/Pacific-New" , 0x03E18C }, - { "US/Samoa" , 0x03E591 }, - { "UTC" , 0x03E61A }, - { "W-SU" , 0x03E911 }, - { "WET" , 0x03E65E }, - { "Zulu" , 0x03EC4C }, -}; -/* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[257168] = { - - -/* Africa/Abidjan */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x92, 0x48, -0x01, 0xFF, 0xFF, 0xFC, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x71, 0x12, 0x01, 0x0C, 0x9B, -0x05, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Accra */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x9E, 0x30, 0x66, 0xB4, -0xC1, 0x4C, 0xF9, 0x80, 0xC1, 0xEC, 0x7A, 0x50, 0xC3, 0x2E, 0x2D, 0x00, 0xC3, 0xCD, 0xAD, 0xD0, -0xC5, 0x0F, 0x60, 0x80, 0xC5, 0xAE, 0xE1, 0x50, 0xC6, 0xF0, 0x94, 0x00, 0xC7, 0x90, 0x14, 0xD0, -0xC8, 0xD3, 0x19, 0x00, 0xC9, 0x72, 0x99, 0xD0, 0xCA, 0xB4, 0x4C, 0x80, 0xCB, 0x53, 0xCD, 0x50, -0xCC, 0x95, 0x80, 0x00, 0xCD, 0x35, 0x00, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xFF, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x04, -0xB0, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x48, 0x53, -0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0xCC, 0x38, -0x01, 0x12, 0xFD, 0x22, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Addis_Ababa */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x1C, 0xE5, 0x01, 0x4D, -0xB5, 0xB0, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Algiers */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x91, 0x60, 0x50, 0x4F, -0x9B, 0x47, 0x78, 0xF0, 0x9B, 0xD7, 0x2C, 0x70, 0x9C, 0xBC, 0x91, 0x70, 0x9D, 0xC0, 0x48, 0xF0, -0x9E, 0x89, 0xFE, 0x70, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x80, 0x0C, 0xF0, -0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, 0xA4, 0xB8, 0x06, 0x70, -0xC6, 0xFF, 0x06, 0x70, 0xC7, 0x58, 0xBA, 0x80, 0xC7, 0xDA, 0x09, 0xA0, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x8A, 0x00, 0x00, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x24, 0x70, 0xD4, 0x4B, 0x07, 0x70, -0xE5, 0xCE, 0xD3, 0x00, 0xF3, 0x5C, 0xB0, 0xF0, 0x02, 0x78, 0xC1, 0xF0, 0x03, 0x43, 0xC8, 0xF0, -0x0D, 0xCF, 0xD7, 0x00, 0x0E, 0xAD, 0x44, 0xF0, 0x0F, 0x78, 0x5A, 0x00, 0x10, 0x68, 0x59, 0x10, -0x12, 0x76, 0x43, 0x70, 0x13, 0x66, 0x42, 0x80, 0x14, 0x5F, 0x7C, 0x10, 0x15, 0x4F, 0x5F, 0x00, -0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x05, -0x04, 0x05, 0x04, 0x05, 0x03, 0x05, 0x03, 0x01, 0x02, 0x06, 0x05, 0x04, 0x05, 0x03, 0x06, 0x03, -0x05, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, -0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x50, 0x4D, 0x54, 0x00, 0x57, -0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xC1, 0x74, 0xBD, 0x01, 0x17, 0x4F, 0xE8, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Asmara */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xB9, 0xD5, 0x01, 0x4D, -0xFD, 0x4D, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Asmera */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Bamako */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x96, 0x00, -0xBC, 0x92, 0xB8, 0x80, 0xEE, 0x11, 0x87, 0x10, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF8, 0x80, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x9C, 0xA1, 0xA8, 0x01, 0x06, 0x73, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Bangui */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x7D, 0x14, -0x01, 0x00, 0x00, 0x11, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0xFD, 0xFA, 0x01, 0x2F, 0x03, -0x9D, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Banjul */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x92, 0xE6, 0x9E, 0x1C, -0xBE, 0x2A, 0x27, 0x9C, 0xF4, 0xB6, 0x36, 0x10, 0x01, 0x02, 0x03, 0xFF, 0xFF, 0xF0, 0x64, 0x00, -0x00, 0xFF, 0xFF, 0xF0, 0x64, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x00, 0x00, 0x00, -0x00, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x47, -0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0xE0, 0xAA, 0x00, -0xFB, 0x3C, 0x68, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Bissau */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x91, 0xC4, 0x93, 0x1C, -0x09, 0x67, 0x61, 0x10, 0x01, 0x02, 0xFF, 0xFF, 0xF1, 0x64, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, -0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0x69, 0x28, 0x00, 0xFC, -0xA8, 0xFD, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Blantyre */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC3, 0xB0, -0x01, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0xA2, 0xDD, 0x01, 0x48, 0x10, -0x60, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Brazzaville */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x80, 0x2C, -0x01, 0x00, 0x00, 0x0E, 0x54, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0xA1, 0xEA, 0x01, 0x29, 0xFA, -0x8D, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Bujumbura */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x85, 0x56, 0x1D, 0x01, 0x3F, 0x77, 0xDA, -0x00, 0x00, 0x00, 0x00, - -/* Africa/Cairo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xC8, 0x93, 0xB4, 0xE0, -0xC8, 0xFA, 0x7B, 0xD0, 0xC9, 0xFC, 0xEF, 0xE0, 0xCA, 0xC7, 0xE8, 0xD0, 0xCB, 0xCB, 0xAE, 0x60, -0xCC, 0xDF, 0x29, 0xD0, 0xCD, 0xAC, 0xE1, 0xE0, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0, -0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xAD, 0x50, 0xE8, 0x36, 0x63, 0x60, -0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, 0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xFA, 0xF0, -0xEC, 0xB5, 0x6D, 0x00, 0xED, 0xCF, 0x7F, 0xF0, 0xEE, 0x97, 0xF2, 0x00, 0xEF, 0xB0, 0xB3, 0x70, -0xF0, 0x79, 0x25, 0x80, 0xF1, 0x91, 0xE6, 0xF0, 0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x73, 0x1A, 0x70, -0xF4, 0x3B, 0x8C, 0x80, 0xF5, 0x55, 0x9F, 0x70, 0xF6, 0x1E, 0x11, 0x80, 0xF7, 0x36, 0xD2, 0xF0, -0xF7, 0xFF, 0x45, 0x00, 0xF9, 0x18, 0x06, 0x70, 0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0, -0xFB, 0xC2, 0xFD, 0x80, 0xFC, 0xDB, 0xBE, 0xF0, 0xFD, 0xA5, 0x82, 0x80, 0xFE, 0xBC, 0xF2, 0x70, -0xFF, 0x86, 0xB6, 0x00, 0x00, 0x9E, 0x25, 0xF0, 0x01, 0x67, 0xE9, 0x80, 0x02, 0x7F, 0x59, 0x70, -0x03, 0x49, 0x1D, 0x00, 0x04, 0x61, 0xDE, 0x70, 0x05, 0x2B, 0xA2, 0x00, 0x06, 0x43, 0x11, 0xF0, -0x07, 0x0C, 0xD5, 0x80, 0x08, 0x24, 0x45, 0x70, 0x08, 0xEE, 0x09, 0x00, 0x0A, 0x05, 0x78, 0xF0, -0x0A, 0xCF, 0x3C, 0x80, 0x0B, 0xE7, 0xFD, 0xF0, 0x0C, 0xB1, 0xC1, 0x80, 0x0D, 0xC9, 0x31, 0x70, -0x0E, 0x92, 0xF5, 0x00, 0x0F, 0xAA, 0x64, 0xF0, 0x10, 0x74, 0x28, 0x80, 0x11, 0x8B, 0x98, 0x70, -0x12, 0x55, 0x5C, 0x00, 0x13, 0x6E, 0x1D, 0x70, 0x14, 0x37, 0xE1, 0x00, 0x15, 0x4F, 0x50, 0xF0, -0x16, 0x19, 0x14, 0x80, 0x17, 0xA0, 0x93, 0xF0, 0x17, 0xFA, 0x48, 0x00, 0x19, 0x70, 0xA3, 0xF0, -0x19, 0xDB, 0x7B, 0x80, 0x1A, 0xF4, 0x3C, 0xF0, 0x1B, 0xBE, 0x00, 0x80, 0x1C, 0xD5, 0x70, 0x70, -0x1D, 0x9F, 0x34, 0x00, 0x1E, 0xB6, 0xA3, 0xF0, 0x1F, 0x80, 0x67, 0x80, 0x20, 0x97, 0xD7, 0x70, -0x21, 0x61, 0x9B, 0x00, 0x22, 0x7A, 0x5C, 0x70, 0x23, 0x44, 0x20, 0x00, 0x24, 0x62, 0x27, 0x70, -0x25, 0x25, 0x53, 0x80, 0x26, 0x3C, 0xC3, 0x70, 0x27, 0x06, 0x87, 0x00, 0x28, 0x1D, 0xF6, 0xF0, -0x28, 0xE7, 0xBA, 0x80, 0x2A, 0x00, 0x7B, 0xF0, 0x2A, 0xCA, 0x3F, 0x80, 0x2B, 0xE1, 0xAF, 0x70, -0x2C, 0xAB, 0x73, 0x00, 0x2D, 0xC2, 0xE2, 0xF0, 0x2E, 0x8C, 0xA6, 0x80, 0x2F, 0xA0, 0x13, 0xE0, -0x30, 0x6B, 0x0C, 0xD0, 0x31, 0x7F, 0xF5, 0xE0, 0x32, 0x4A, 0xEE, 0xD0, 0x33, 0x5F, 0xD7, 0xE0, -0x34, 0x2A, 0xD0, 0xD0, 0x35, 0x3F, 0xB9, 0xE0, 0x36, 0x0A, 0xB2, 0xD0, 0x37, 0x28, 0xD6, 0x60, -0x37, 0xF3, 0xCF, 0x50, 0x39, 0x08, 0xB8, 0x60, 0x39, 0xD3, 0xB1, 0x50, 0x3A, 0xE8, 0x9A, 0x60, -0x3B, 0xB3, 0x93, 0x50, 0x3C, 0xC8, 0x7C, 0x60, 0x3D, 0x93, 0x75, 0x50, 0x3E, 0xA8, 0x5E, 0x60, -0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0, -0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 0x46, 0x31, 0x20, 0xE0, -0x46, 0xE0, 0x6A, 0x50, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xF0, 0xE4, 0xE0, -0x4A, 0x96, 0xF3, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0x76, 0xD5, 0xD0, 0x4D, 0xB9, 0xE3, 0x60, -0x4E, 0x56, 0xB7, 0xD0, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x3F, 0xD4, 0x50, 0x51, 0x79, 0xA7, 0x60, -0x52, 0x1F, 0xB6, 0x50, 0x53, 0x59, 0x89, 0x60, 0x53, 0xFF, 0x98, 0x50, 0x55, 0x39, 0x6B, 0x60, -0x55, 0xDF, 0x7A, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xBF, 0x5C, 0x50, 0x59, 0x02, 0x69, 0xE0, -0x59, 0xA8, 0x78, 0xD0, 0x5A, 0xE2, 0x4B, 0xE0, 0x5B, 0x88, 0x5A, 0xD0, 0x5C, 0xC2, 0x2D, 0xE0, -0x5D, 0x68, 0x3C, 0xD0, 0x5E, 0xA2, 0x0F, 0xE0, 0x5F, 0x48, 0x1E, 0xD0, 0x60, 0x8B, 0x2C, 0x60, -0x61, 0x28, 0x00, 0xD0, 0x62, 0x6B, 0x0E, 0x60, 0x63, 0x07, 0xE2, 0xD0, 0x64, 0x4A, 0xF0, 0x60, -0x64, 0xF0, 0xFF, 0x50, 0x66, 0x2A, 0xD2, 0x60, 0x66, 0xD0, 0xE1, 0x50, 0x68, 0x0A, 0xB4, 0x60, -0x68, 0xB0, 0xC3, 0x50, 0x69, 0xEA, 0x96, 0x60, 0x6A, 0x90, 0xA5, 0x50, 0x6B, 0xD3, 0xB2, 0xE0, -0x6C, 0x70, 0x87, 0x50, 0x6D, 0xB3, 0x94, 0xE0, 0x6E, 0x59, 0xA3, 0xD0, 0x6F, 0x93, 0x76, 0xE0, -0x70, 0x39, 0x85, 0xD0, 0x71, 0x73, 0x58, 0xE0, 0x72, 0x19, 0x67, 0xD0, 0x73, 0x53, 0x3A, 0xE0, -0x73, 0xF9, 0x49, 0xD0, 0x75, 0x3C, 0x57, 0x60, 0x75, 0xD9, 0x2B, 0xD0, 0x77, 0x1C, 0x39, 0x60, -0x77, 0xB9, 0x0D, 0xD0, 0x78, 0xFC, 0x1B, 0x60, 0x79, 0xA2, 0x2A, 0x50, 0x7A, 0xDB, 0xFD, 0x60, -0x7B, 0x82, 0x0C, 0x50, 0x7C, 0xBB, 0xDF, 0x60, 0x7D, 0x61, 0xEE, 0x50, 0x7E, 0x9B, 0xC1, 0x60, -0x7F, 0x41, 0xD0, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x2E, 0x88, 0x01, -0x42, 0x57, 0x88, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Casablanca */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0x51, 0xF9, 0x9C, -0xC6, 0xFF, 0x14, 0x80, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xED, 0x80, 0xD2, 0xA1, 0x32, 0xF0, -0xDB, 0x35, 0xA4, 0x00, 0xDB, 0xEE, 0x27, 0xF0, 0xFB, 0x25, 0x72, 0x40, 0xFB, 0xC2, 0xEF, 0x70, -0x08, 0x6B, 0x84, 0x80, 0x08, 0xC6, 0x6D, 0xF0, 0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0x61, 0x47, 0xF0, -0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x8E, 0xF2, 0x70, 0x0F, 0xD3, 0x51, 0x80, 0x10, 0x27, 0xA3, 0x70, -0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x18, 0x6F, 0xF0, 0x48, 0x41, 0xE6, 0x80, 0x48, 0xBB, 0x22, 0x70, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xF8, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, -0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBC, 0xAC, 0xC8, 0x01, 0x08, 0xDD, 0xFD, 0x00, 0x00, -0x00, 0x00, - -/* Africa/Ceuta */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x12, 0x9E, 0xD6, 0x75, 0x70, -0x9F, 0xA1, 0x6E, 0x60, 0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, -0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, -0xB2, 0x70, 0x22, 0x70, 0xB2, 0xE1, 0x91, 0x80, 0xFB, 0x25, 0x72, 0x40, 0xFB, 0xC2, 0xEF, 0x70, -0x08, 0x6B, 0x84, 0x80, 0x08, 0xC6, 0x6D, 0xF0, 0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0x61, 0x47, 0xF0, -0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x8E, 0xF2, 0x70, 0x0F, 0xD3, 0x51, 0x80, 0x10, 0x27, 0xA3, 0x70, -0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x57, 0x45, 0x54, 0x00, -0x57, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xC0, 0x15, 0x2D, -0x01, 0x0B, 0x83, 0x12, 0x00, 0x00, 0x00, 0x0F, 0x43, 0x65, 0x75, 0x74, 0x61, 0x20, 0x26, 0x20, -0x4D, 0x65, 0x6C, 0x69, 0x6C, 0x6C, 0x61, - -/* Africa/Conakry */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9B, 0x5C, -0xBC, 0x92, 0xB8, 0x80, 0xED, 0x30, 0x16, 0x90, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF3, 0x24, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x97, 0xD9, 0xB2, 0x00, 0xFF, 0xEA, 0x52, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Dakar */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9E, 0xD8, -0xCA, 0x3B, 0x10, 0x90, 0x01, 0x02, 0xFF, 0xFF, 0xEF, 0xA8, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, -0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0xB5, 0x6A, 0x00, 0xF9, -0x61, 0x25, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Dar_es_Salaam */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0E, 0xB6, 0xA3, 0xD3, 0xAC, -0xD6, 0x9D, 0x7F, 0xD0, 0xEF, 0x12, 0x66, 0xE3, 0x01, 0x02, 0x01, 0x00, 0x00, 0x24, 0xD4, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x26, 0x9D, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x81, 0x65, 0x00, 0x01, 0x4E, 0x99, 0x8D, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Djibouti */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD2, 0x0C, -0x01, 0x00, 0x00, 0x28, 0x74, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0x07, 0x80, 0x01, 0x54, 0x7F, -0xF8, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Douala */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x85, 0x68, -0x01, 0x00, 0x00, 0x09, 0x18, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0x82, 0x48, 0x01, 0x21, 0x75, -0x90, 0x00, 0x00, 0x00, 0x00, - -/* Africa/El_Aaiun */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xBC, 0x48, 0xF0, 0xE0, -0x0B, 0xD1, 0xB0, 0x90, 0x01, 0x02, 0xFF, 0xFF, 0xF3, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, -0x57, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB2, 0xC1, 0xB8, 0x00, 0xFF, -0x20, 0x7F, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Freetown */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x95, 0x90, 0x32, 0x6C, -0xBE, 0xF1, 0x38, 0x90, 0xBF, 0x92, 0x06, 0x30, 0xC0, 0xD3, 0xBD, 0x90, 0xC1, 0x74, 0x8B, 0x30, -0xC2, 0xB4, 0xF1, 0x10, 0xC3, 0x55, 0xBE, 0xB0, 0xC4, 0x96, 0x24, 0x90, 0xC5, 0x36, 0xF2, 0x30, -0xC6, 0x77, 0x58, 0x10, 0xC7, 0x18, 0x25, 0xB0, 0xC8, 0x59, 0xDD, 0x10, 0xC8, 0xFA, 0xAA, 0xB0, -0xCA, 0x3B, 0x10, 0x90, 0xCA, 0xDB, 0xDE, 0x30, 0xCC, 0x1C, 0x44, 0x10, 0xCC, 0xBD, 0x11, 0xB0, -0xE7, 0x8C, 0x7C, 0x10, 0xE8, 0x53, 0x80, 0x80, 0xE8, 0xCC, 0xBC, 0x70, 0xEA, 0x34, 0xB4, 0x00, -0xEA, 0xAD, 0xEF, 0xF0, 0xEC, 0x15, 0xE7, 0x80, 0xEC, 0x8F, 0x23, 0x70, 0xED, 0xF8, 0x6C, 0x80, -0xEE, 0x71, 0xA8, 0x70, 0xEF, 0xD9, 0xA0, 0x00, 0xF0, 0x52, 0xDB, 0xF0, 0xF1, 0xBA, 0xD3, 0x80, -0xF2, 0x34, 0x0F, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0xFF, 0xFF, 0xF3, 0x94, 0x00, 0x00, 0xFF, 0xFF, 0xFB, 0x50, 0x01, 0x04, 0xFF, 0xFF, -0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, -0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x46, 0x4D, 0x54, 0x00, 0x53, 0x4C, 0x53, 0x54, 0x00, 0x57, -0x41, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x96, 0x4C, 0x90, 0x00, 0xFF, 0x34, 0x08, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Gaborone */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xCE, 0x8E, 0x6E, 0x80, -0xCF, 0x7E, 0x51, 0x70, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, -0x01, 0x04, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x64, 0x53, 0x98, 0x01, 0x3A, 0x34, 0x32, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Harare */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC7, 0x64, -0x01, 0x00, 0x00, 0x1D, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xA9, 0x25, 0x01, 0x42, 0x09, -0x68, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Johannesburg */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68, -0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x09, 0xA8, 0x01, 0x3D, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Kampala */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDF, 0x1C, -0xB4, 0xC2, 0x9A, 0xD0, 0xD6, 0x9D, 0x86, 0xD8, 0xE7, 0x8C, 0x47, 0x63, 0x01, 0x02, 0x03, 0x01, -0x00, 0x00, 0x1E, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, -0x00, 0x08, 0x00, 0x00, 0x26, 0x9D, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, -0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x89, 0xCF, 0xF2, 0x01, 0x44, 0x1F, 0x42, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Khartoum */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xDA, 0x00, -0x00, 0x9E, 0x17, 0xE0, 0x01, 0x7A, 0x34, 0x50, 0x02, 0x7D, 0xF9, 0xE0, 0x03, 0x5B, 0x67, 0xD0, -0x04, 0x60, 0x7E, 0xE0, 0x05, 0x3D, 0xEC, 0xD0, 0x06, 0x40, 0x60, 0xE0, 0x07, 0x1F, 0x20, 0x50, -0x08, 0x20, 0x42, 0xE0, 0x09, 0x00, 0x53, 0xD0, 0x0A, 0x00, 0x24, 0xE0, 0x0A, 0xE1, 0x87, 0x50, -0x0B, 0xE0, 0x06, 0xE0, 0x0C, 0xC4, 0x0C, 0x50, 0x0D, 0xBF, 0xE8, 0xE0, 0x0E, 0xA5, 0x3F, 0xD0, -0x0F, 0xA9, 0x05, 0x60, 0x10, 0x86, 0x73, 0x50, 0x11, 0x88, 0xE7, 0x60, 0x12, 0x67, 0xA6, 0xD0, -0x13, 0x68, 0xC9, 0x60, 0x14, 0x4A, 0x2B, 0xD0, 0x15, 0x48, 0xAB, 0x60, 0x16, 0x2B, 0x5F, 0x50, -0x17, 0x28, 0x8D, 0x60, 0x18, 0x0C, 0x92, 0xD0, 0x19, 0x08, 0x6F, 0x60, 0x19, 0xED, 0xC6, 0x50, -0x1A, 0xF1, 0x8B, 0xE0, 0x1B, 0xD0, 0x4B, 0x50, 0x1C, 0xD1, 0x6D, 0xE0, 0x1D, 0xB1, 0x7E, 0xD0, -0x38, 0x80, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, 0x1E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, -0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D, -0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0x22, 0x00, 0x01, 0x44, 0x4C, 0xD5, 0x00, -0x00, 0x00, 0x00, - -/* Africa/Kigali */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xBE, 0xF1, 0x0E, 0x50, -0x01, 0x00, 0x00, 0x1C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x40, 0xB8, 0x01, 0x40, 0x89, -0x4A, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Kinshasa */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x83, 0xAE, 0xF0, 0x01, 0x2A, 0x01, 0x10, -0x00, 0x00, 0x00, 0x17, 0x77, 0x65, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, 0x65, -0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F, - -/* Africa/Lagos */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0x51, 0xF3, 0x50, -0x01, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x93, 0x2B, 0xC8, 0x01, 0x17, 0xD8, -0xA0, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Libreville */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x85, 0xA4, -0x01, 0x00, 0x00, 0x08, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0xE9, 0xFD, 0x01, 0x21, 0x13, -0xE8, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Lome */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x92, 0xB0, 0x15, 0x01, 0x14, 0x83, 0xC2, -0x00, 0x00, 0x00, 0x00, - -/* Africa/Luanda */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xC4, 0x78, 0x4C, -0x01, 0x00, 0x00, 0x0C, 0x34, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x41, 0x4F, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x57, 0xC0, 0x01, 0x26, 0xD9, -0xC5, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Lubumbashi */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x79, 0x8F, 0xCA, 0x01, 0x3C, 0x91, 0xAA, -0x00, 0x00, 0x00, 0x17, 0x65, 0x61, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, 0x65, -0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F, - -/* Africa/Lusaka */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC9, 0xFC, -0x01, 0x00, 0x00, 0x1A, 0x84, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x13, 0xA2, 0x01, 0x3D, 0xD0, -0xAD, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Malabo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x86, 0x44, -0xF4, 0x9F, 0xBE, 0x80, 0x01, 0x02, 0x00, 0x00, 0x08, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, -0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0x0D, 0x18, 0x01, 0x20, -0x0F, 0x7D, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Maputo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, -0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0xA8, 0x3A, 0x01, 0x44, 0x60, -0x5D, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Maseru */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xCA, 0xB8, -0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x19, 0xC8, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5D, 0xCA, 0x6A, -0x01, 0x3C, 0x9E, 0xB0, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Mbabane */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xC7, 0x58, -0x01, 0x00, 0x00, 0x1D, 0x28, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x1D, 0x30, 0x01, 0x42, -0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Mogadishu */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xB6, 0xA3, 0xCE, 0x50, -0xE7, 0x8C, 0x4A, 0xD8, 0x01, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x00, 0x00, 0x00, 0x23, 0x28, -0x00, 0x04, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x8C, 0x7B, 0x8A, 0x01, 0x57, 0xE1, 0xDA, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Monrovia */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA0, 0x5F, 0x6C, 0x9C, -0x04, 0x61, 0xF6, 0xEE, 0x01, 0x02, 0xFF, 0xFF, 0xF5, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xF5, 0x92, -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x4D, 0x4D, 0x54, 0x00, 0x4C, 0x52, 0x54, 0x00, -0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0xF1, 0x30, 0x01, 0x04, -0x98, 0x3D, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Nairobi */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, -0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xE3, 0x01, 0x02, 0x03, 0x01, -0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, -0x00, 0x08, 0x00, 0x00, 0x26, 0x9D, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, -0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x88, 0x3C, 0x4D, 0x01, 0x4A, 0xD6, 0x02, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Ndjamena */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x92, 0xE6, 0x80, 0x64, -0x12, 0x66, 0x71, 0x70, 0x13, 0x26, 0xDE, 0x60, 0x01, 0x02, 0x01, 0x00, 0x00, 0x0E, 0x1C, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x57, 0x41, 0x54, 0x00, 0x57, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x9B, 0xD1, 0x52, 0x01, 0x29, 0x9F, 0x68, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Niamey */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x8C, 0x84, -0xBC, 0x92, 0xC6, 0x90, 0xED, 0x30, 0x08, 0x80, 0x01, 0x02, 0x03, 0x00, 0x00, 0x01, 0xFC, 0x00, -0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0xF4, 0x32, 0x01, 0x15, 0xE3, 0x52, 0x00, -0x00, 0x00, 0x00, - -/* Africa/Nouakchott */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x9D, 0x74, -0xBC, 0x92, 0xB8, 0x80, 0xEE, 0xE5, 0xC8, 0x90, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF1, 0x0C, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xA4, 0xF2, 0x90, 0x00, 0xFD, 0x38, 0x37, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Ouagadougou */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x8F, 0xEC, -0x01, 0xFF, 0xFF, 0xFE, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x32, 0xFA, 0x01, 0x11, 0xEB, -0xB2, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Porto-Novo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x8C, 0x0C, -0xBC, 0x92, 0xB8, 0x80, 0x01, 0x02, 0x00, 0x00, 0x02, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, -0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x93, 0x38, 0xCD, 0x01, 0x16, -0xA6, 0xA2, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Sao_Tome */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0x97, 0x10, -0x01, 0xFF, 0xFF, 0xF7, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0xD6, 0x75, 0x01, 0x1C, 0xEE, -0xB5, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Timbuktu */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x92, 0xE6, 0x96, 0x00, -0xBC, 0x92, 0xB8, 0x80, 0xEE, 0x11, 0x87, 0x10, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xF8, 0x80, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x57, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Tripoli */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0xC1, 0x24, -0xDD, 0xBB, 0xB1, 0x10, 0xDE, 0x23, 0xAD, 0x60, 0xE1, 0x78, 0xD2, 0x10, 0xE1, 0xE7, 0x65, 0xE0, -0xE5, 0x2F, 0x3F, 0x70, 0xE5, 0xA9, 0xCC, 0xE0, 0xEB, 0x4E, 0xC6, 0xF0, 0x16, 0x92, 0x42, 0x60, -0x17, 0x08, 0xF7, 0x70, 0x17, 0xFA, 0x2B, 0xE0, 0x18, 0xEA, 0x2A, 0xF0, 0x19, 0xDB, 0x5F, 0x60, -0x1A, 0xCC, 0xAF, 0xF0, 0x1B, 0xBD, 0xE4, 0x60, 0x1C, 0xB4, 0x7A, 0xF0, 0x1D, 0x9F, 0x17, 0xE0, -0x1E, 0x93, 0x0B, 0x70, 0x1F, 0x82, 0xEE, 0x60, 0x20, 0x70, 0x4A, 0x70, 0x21, 0x61, 0x7E, 0xE0, -0x22, 0x52, 0xCF, 0x70, 0x23, 0x44, 0x03, 0xE0, 0x24, 0x34, 0x02, 0xF0, 0x25, 0x25, 0x37, 0x60, -0x26, 0x40, 0xB7, 0xF0, 0x32, 0x4E, 0xF1, 0x60, 0x33, 0x44, 0x36, 0x70, 0x34, 0x35, 0x6A, 0xE0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x03, 0x00, 0x00, 0x0C, -0x5C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBB, -0x87, 0xD0, 0x01, 0x26, 0xC6, 0x3D, 0x00, 0x00, 0x00, 0x00, - -/* Africa/Tunis */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x91, 0x60, 0x50, 0x4F, -0xC6, 0x3A, 0x88, 0xE0, 0xC7, 0x58, 0x9E, 0x60, 0xC7, 0xDB, 0x22, 0xE0, 0xCA, 0xE2, 0x54, 0xE0, -0xCB, 0xAD, 0x69, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCD, 0xC2, 0x16, 0x00, -0xCD, 0xCC, 0xB0, 0x10, 0xCE, 0xA2, 0x35, 0x00, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x89, 0xE3, 0xE0, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x16, 0x60, 0x0D, 0xC7, 0xDF, 0xF0, 0x0E, 0x89, 0xAC, 0x70, -0x0F, 0xAA, 0x64, 0xF0, 0x10, 0x74, 0x1A, 0x70, 0x22, 0xA3, 0x3A, 0xF0, 0x23, 0x3C, 0x28, 0xF0, -0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x3C, 0xC3, 0x70, 0x27, 0x05, 0x27, 0x70, -0x42, 0x74, 0x0D, 0xF0, 0x43, 0x3C, 0x80, 0x00, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x04, 0x50, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x7B, 0x40, 0x01, 0x22, 0x32, 0x5D, -0x00, 0x00, 0x00, 0x00, - -/* Africa/Windhoek */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x13, 0x82, 0x46, 0xCF, 0x68, -0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0x26, 0x06, 0xA7, 0xE0, 0x2D, 0x9D, 0xEA, 0xE0, -0x2E, 0x69, 0x1C, 0x10, 0x2F, 0x7D, 0xE9, 0x00, 0x30, 0x48, 0xFE, 0x10, 0x31, 0x67, 0x05, 0x80, -0x32, 0x28, 0xE0, 0x10, 0x33, 0x46, 0xE7, 0x80, 0x34, 0x11, 0xFC, 0x90, 0x35, 0x26, 0xC9, 0x80, -0x35, 0xF1, 0xDE, 0x90, 0x37, 0x06, 0xAB, 0x80, 0x37, 0xD1, 0xC0, 0x90, 0x38, 0xE6, 0x8D, 0x80, -0x39, 0xB1, 0xA2, 0x90, 0x3A, 0xC6, 0x6F, 0x80, 0x3B, 0x91, 0x84, 0x90, 0x3C, 0xAF, 0x8C, 0x00, -0x3D, 0x71, 0x66, 0x90, 0x3E, 0x8F, 0x6E, 0x00, 0x3F, 0x5A, 0x83, 0x10, 0x40, 0x6F, 0x50, 0x00, -0x41, 0x3A, 0x65, 0x10, 0x42, 0x4F, 0x32, 0x00, 0x43, 0x1A, 0x47, 0x10, 0x44, 0x2F, 0x14, 0x00, -0x44, 0xFA, 0x29, 0x10, 0x46, 0x0E, 0xF6, 0x00, 0x46, 0xDA, 0x0B, 0x10, 0x47, 0xF8, 0x12, 0x80, -0x48, 0xC3, 0x27, 0x90, 0x49, 0xD7, 0xF4, 0x80, 0x4A, 0xA3, 0x09, 0x90, 0x4B, 0xB7, 0xD6, 0x80, -0x4C, 0x82, 0xEB, 0x90, 0x4D, 0x97, 0xB8, 0x80, 0x4E, 0x62, 0xCD, 0x90, 0x4F, 0x77, 0x9A, 0x80, -0x50, 0x42, 0xAF, 0x90, 0x51, 0x60, 0xB7, 0x00, 0x52, 0x22, 0x91, 0x90, 0x53, 0x40, 0x99, 0x00, -0x54, 0x0B, 0xAE, 0x10, 0x55, 0x20, 0x7B, 0x00, 0x55, 0xEB, 0x90, 0x10, 0x57, 0x00, 0x5D, 0x00, -0x57, 0xCB, 0x72, 0x10, 0x58, 0xE0, 0x3F, 0x00, 0x59, 0xAB, 0x54, 0x10, 0x5A, 0xC0, 0x21, 0x00, -0x5B, 0x8B, 0x36, 0x10, 0x5C, 0xA9, 0x3D, 0x80, 0x5D, 0x6B, 0x18, 0x10, 0x5E, 0x89, 0x1F, 0x80, -0x5F, 0x54, 0x34, 0x90, 0x60, 0x69, 0x01, 0x80, 0x61, 0x34, 0x16, 0x90, 0x62, 0x48, 0xE3, 0x80, -0x63, 0x13, 0xF8, 0x90, 0x64, 0x28, 0xC5, 0x80, 0x64, 0xF3, 0xDA, 0x90, 0x66, 0x11, 0xE2, 0x00, -0x66, 0xD3, 0xBC, 0x90, 0x67, 0xF1, 0xC4, 0x00, 0x68, 0xBC, 0xD9, 0x10, 0x69, 0xD1, 0xA6, 0x00, -0x6A, 0x9C, 0xBB, 0x10, 0x6B, 0xB1, 0x88, 0x00, 0x6C, 0x7C, 0x9D, 0x10, 0x6D, 0x91, 0x6A, 0x00, -0x6E, 0x5C, 0x7F, 0x10, 0x6F, 0x71, 0x4C, 0x00, 0x70, 0x3C, 0x61, 0x10, 0x71, 0x5A, 0x68, 0x80, -0x72, 0x1C, 0x43, 0x10, 0x73, 0x3A, 0x4A, 0x80, 0x74, 0x05, 0x5F, 0x90, 0x75, 0x1A, 0x2C, 0x80, -0x75, 0xE5, 0x41, 0x90, 0x76, 0xFA, 0x0E, 0x80, 0x77, 0xC5, 0x23, 0x90, 0x78, 0xD9, 0xF0, 0x80, -0x79, 0xA5, 0x05, 0x90, 0x7A, 0xB9, 0xD2, 0x80, 0x7B, 0x84, 0xE7, 0x90, 0x7C, 0xA2, 0xEF, 0x00, -0x7D, 0x6E, 0x04, 0x10, 0x7E, 0x82, 0xD1, 0x00, 0x7F, 0x4D, 0xE6, 0x10, 0x01, 0x02, 0x01, 0x03, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0A, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x0E, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x01, 0x53, 0x57, 0x41, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x57, 0x41, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x9F, 0xDA, 0x01, -0x2C, 0xC0, 0x30, 0x00, 0x00, 0x00, 0x00, - -/* America/Adak */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0xCB, 0x89, 0x44, 0xD0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50, -0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50, -0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0, -0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50, -0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0, -0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50, -0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50, -0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50, -0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x22, 0x20, 0x1A, 0xF2, 0x50, 0xC0, 0x1B, 0xE2, 0x33, 0xB0, -0x1C, 0xD2, 0x32, 0xC0, 0x1D, 0xC2, 0x15, 0xB0, 0x1E, 0xB2, 0x14, 0xC0, 0x1F, 0xA1, 0xF7, 0xB0, -0x20, 0x76, 0x47, 0x40, 0x21, 0x81, 0xD9, 0xB0, 0x22, 0x56, 0x29, 0x40, 0x23, 0x6A, 0xF6, 0x30, -0x24, 0x36, 0x0B, 0x40, 0x25, 0x4A, 0xD8, 0x30, 0x26, 0x15, 0xED, 0x40, 0x27, 0x2A, 0xBA, 0x30, -0x27, 0xFF, 0x09, 0xC0, 0x29, 0x0A, 0x9C, 0x30, 0x29, 0xDE, 0xEB, 0xC0, 0x2A, 0xEA, 0x7E, 0x30, -0x2B, 0xBE, 0xCD, 0xC0, 0x2C, 0xD3, 0x9A, 0xB0, 0x2D, 0x9E, 0xAF, 0xC0, 0x2E, 0xB3, 0x7C, 0xB0, -0x2F, 0x7E, 0x91, 0xC0, 0x30, 0x93, 0x5E, 0xB0, 0x31, 0x67, 0xAE, 0x40, 0x32, 0x73, 0x40, 0xB0, -0x33, 0x47, 0x90, 0x40, 0x34, 0x53, 0x22, 0xB0, 0x35, 0x27, 0x72, 0x40, 0x36, 0x33, 0x04, 0xB0, -0x37, 0x07, 0x54, 0x40, 0x38, 0x1C, 0x21, 0x30, 0x38, 0xE7, 0x36, 0x40, 0x39, 0xFC, 0x03, 0x30, -0x3A, 0xC7, 0x18, 0x40, 0x3B, 0xDB, 0xE5, 0x30, 0x3C, 0xB0, 0x34, 0xC0, 0x3D, 0xBB, 0xC7, 0x30, -0x3E, 0x90, 0x16, 0xC0, 0x3F, 0x9B, 0xA9, 0x30, 0x40, 0x6F, 0xF8, 0xC0, 0x41, 0x84, 0xC5, 0xB0, -0x42, 0x4F, 0xDA, 0xC0, 0x43, 0x64, 0xA7, 0xB0, 0x44, 0x2F, 0xBC, 0xC0, 0x45, 0x44, 0x89, 0xB0, -0x45, 0xF3, 0xEF, 0x40, 0x47, 0x2D, 0xA6, 0x30, 0x47, 0xD3, 0xD1, 0x40, 0x49, 0x0D, 0x88, 0x30, -0x49, 0xB3, 0xB3, 0x40, 0x4A, 0xED, 0x6A, 0x30, 0x4B, 0x9C, 0xCF, 0xC0, 0x4C, 0xD6, 0x86, 0xB0, -0x4D, 0x7C, 0xB1, 0xC0, 0x4E, 0xB6, 0x68, 0xB0, 0x4F, 0x5C, 0x93, 0xC0, 0x50, 0x96, 0x4A, 0xB0, -0x51, 0x3C, 0x75, 0xC0, 0x52, 0x76, 0x2C, 0xB0, 0x53, 0x1C, 0x57, 0xC0, 0x54, 0x56, 0x0E, 0xB0, -0x54, 0xFC, 0x39, 0xC0, 0x56, 0x35, 0xF0, 0xB0, 0x56, 0xE5, 0x56, 0x40, 0x58, 0x1F, 0x0D, 0x30, -0x58, 0xC5, 0x38, 0x40, 0x59, 0xFE, 0xEF, 0x30, 0x5A, 0xA5, 0x1A, 0x40, 0x5B, 0xDE, 0xD1, 0x30, -0x5C, 0x84, 0xFC, 0x40, 0x5D, 0xBE, 0xB3, 0x30, 0x5E, 0x64, 0xDE, 0x40, 0x5F, 0x9E, 0x95, 0x30, -0x60, 0x4D, 0xFA, 0xC0, 0x61, 0x87, 0xB1, 0xB0, 0x62, 0x2D, 0xDC, 0xC0, 0x63, 0x67, 0x93, 0xB0, -0x64, 0x0D, 0xBE, 0xC0, 0x65, 0x47, 0x75, 0xB0, 0x65, 0xED, 0xA0, 0xC0, 0x67, 0x27, 0x57, 0xB0, -0x67, 0xCD, 0x82, 0xC0, 0x69, 0x07, 0x39, 0xB0, 0x69, 0xAD, 0x64, 0xC0, 0x6A, 0xE7, 0x1B, 0xB0, -0x6B, 0x96, 0x81, 0x40, 0x6C, 0xD0, 0x38, 0x30, 0x6D, 0x76, 0x63, 0x40, 0x6E, 0xB0, 0x1A, 0x30, -0x6F, 0x56, 0x45, 0x40, 0x70, 0x8F, 0xFC, 0x30, 0x71, 0x36, 0x27, 0x40, 0x72, 0x6F, 0xDE, 0x30, -0x73, 0x16, 0x09, 0x40, 0x74, 0x4F, 0xC0, 0x30, 0x74, 0xFF, 0x25, 0xC0, 0x76, 0x38, 0xDC, 0xB0, -0x76, 0xDF, 0x07, 0xC0, 0x78, 0x18, 0xBE, 0xB0, 0x78, 0xBE, 0xE9, 0xC0, 0x79, 0xF8, 0xA0, 0xB0, -0x7A, 0x9E, 0xCB, 0xC0, 0x7B, 0xD8, 0x82, 0xB0, 0x7C, 0x7E, 0xAD, 0xC0, 0x7D, 0xB8, 0x64, 0xB0, -0x7E, 0x5E, 0x8F, 0xC0, 0x7F, 0x98, 0x46, 0xB0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, -0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF, -0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x14, 0xFF, 0xFF, 0x81, 0x70, 0x01, -0x19, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x1E, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, -0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00, -0x48, 0x41, 0x44, 0x54, 0x00, 0x48, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x7D, 0xE0, 0x00, 0x07, -0x1B, 0x8D, 0x00, 0x00, 0x00, 0x10, 0x41, 0x6C, 0x65, 0x75, 0x74, 0x69, 0x61, 0x6E, 0x20, 0x49, -0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* America/Anchorage */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x26, 0xCB, 0x89, 0x36, 0xC0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x42, 0x30, 0xFA, 0xD2, 0x47, 0xA0, 0xFE, 0xB8, 0x63, 0x40, -0xFF, 0xA8, 0x46, 0x30, 0x00, 0x98, 0x45, 0x40, 0x01, 0x88, 0x28, 0x30, 0x02, 0x78, 0x27, 0x40, -0x03, 0x71, 0x44, 0xB0, 0x04, 0x61, 0x43, 0xC0, 0x05, 0x51, 0x26, 0xB0, 0x06, 0x41, 0x25, 0xC0, -0x07, 0x31, 0x08, 0xB0, 0x07, 0x8D, 0x5F, 0xC0, 0x09, 0x10, 0xEA, 0xB0, 0x09, 0xAD, 0xDB, 0x40, -0x0A, 0xF0, 0xCC, 0xB0, 0x0B, 0xE0, 0xCB, 0xC0, 0x0C, 0xD9, 0xE9, 0x30, 0x0D, 0xC0, 0xAD, 0xC0, -0x0E, 0xB9, 0xCB, 0x30, 0x0F, 0xA9, 0xCA, 0x40, 0x10, 0x99, 0xAD, 0x30, 0x11, 0x89, 0xAC, 0x40, -0x12, 0x79, 0x8F, 0x30, 0x13, 0x69, 0x8E, 0x40, 0x14, 0x59, 0x71, 0x30, 0x15, 0x49, 0x70, 0x40, -0x16, 0x39, 0x53, 0x30, 0x17, 0x29, 0x52, 0x40, 0x18, 0x22, 0x6F, 0xB0, 0x19, 0x09, 0x34, 0x40, -0x1A, 0x02, 0x51, 0xB0, 0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, -0x1C, 0xD2, 0x24, 0xB0, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, -0x20, 0x76, 0x39, 0x30, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, -0x24, 0x35, 0xFD, 0x30, 0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, -0x27, 0xFE, 0xFB, 0xB0, 0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, -0x2B, 0xBE, 0xBF, 0xB0, 0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, -0x2F, 0x7E, 0x83, 0xB0, 0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, -0x33, 0x47, 0x82, 0x30, 0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, -0x37, 0x07, 0x46, 0x30, 0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, -0x3A, 0xC7, 0x0A, 0x30, 0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, -0x3E, 0x90, 0x08, 0xB0, 0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, -0x42, 0x4F, 0xCC, 0xB0, 0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, -0x45, 0xF3, 0xE1, 0x30, 0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, -0x49, 0xB3, 0xA5, 0x30, 0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, -0x4D, 0x7C, 0xA3, 0xB0, 0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, -0x51, 0x3C, 0x67, 0xB0, 0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, -0x54, 0xFC, 0x2B, 0xB0, 0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, -0x58, 0xC5, 0x2A, 0x30, 0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, -0x5C, 0x84, 0xEE, 0x30, 0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, -0x60, 0x4D, 0xEC, 0xB0, 0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, -0x64, 0x0D, 0xB0, 0xB0, 0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, -0x67, 0xCD, 0x74, 0xB0, 0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, -0x6B, 0x96, 0x73, 0x30, 0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, -0x6F, 0x56, 0x37, 0x30, 0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, -0x73, 0x15, 0xFB, 0x30, 0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, -0x76, 0xDE, 0xF9, 0xB0, 0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, -0x7A, 0x9E, 0xBD, 0xB0, 0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, -0x7E, 0x5E, 0x81, 0xB0, 0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0x81, -0x70, 0x01, 0x04, 0xFF, 0xFF, 0x81, 0x70, 0x01, 0x09, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x0E, 0xFF, -0xFF, 0x81, 0x70, 0x01, 0x13, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x18, 0xFF, 0xFF, 0x8F, 0x80, 0x01, -0x1C, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x21, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x57, 0x54, 0x00, -0x43, 0x41, 0x50, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00, 0x41, 0x48, 0x44, 0x54, 0x00, 0x59, -0x53, 0x54, 0x00, 0x41, 0x4B, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xBD, -0x8D, 0x00, 0x30, 0xAD, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x41, 0x6C, 0x61, 0x73, 0x6B, 0x61, 0x20, -0x54, 0x69, 0x6D, 0x65, - -/* America/Anguilla */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x35, 0x20, -0x01, 0xFF, 0xFF, 0xC4, 0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x19, 0xA0, 0x00, 0xB2, 0xA1, -0x2A, 0x00, 0x00, 0x00, 0x00, - -/* America/Antigua */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x37, 0x33, 0xF0, -0xDC, 0x42, 0xDC, 0x50, 0x01, 0x02, 0xFF, 0xFF, 0xC6, 0x10, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA3, 0x58, 0x68, 0x00, 0xB6, -0xCC, 0xE0, 0x00, 0x00, 0x00, 0x00, - -/* America/Araguaina */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x30, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, 0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, -0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, 0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, -0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, -0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0xFF, 0xFF, 0xD2, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, -0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xF4, 0x00, 0x00, 0xC9, 0xB8, 0x9F, 0x00, 0x00, -0x00, 0x09, 0x54, 0x6F, 0x63, 0x61, 0x6E, 0x74, 0x69, 0x6E, 0x73, - -/* America/Argentina/Buenos_Aires */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x47, 0x77, 0x09, 0xB0, -0x47, 0xDC, 0x7F, 0x20, 0x48, 0xFA, 0xA2, 0xB0, 0x49, 0xBC, 0x61, 0x20, 0x4A, 0xDA, 0x84, 0xB0, -0x4B, 0xA5, 0x7D, 0xA0, 0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x85, 0x5F, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, -0x4F, 0x65, 0x41, 0xA0, 0x50, 0x83, 0x65, 0x30, 0x51, 0x45, 0x23, 0xA0, 0x52, 0x63, 0x47, 0x30, -0x53, 0x25, 0x05, 0xA0, 0x54, 0x43, 0x29, 0x30, 0x55, 0x04, 0xE7, 0xA0, 0x56, 0x23, 0x0B, 0x30, -0x56, 0xEE, 0x04, 0x20, 0x58, 0x02, 0xED, 0x30, 0x58, 0xCD, 0xE6, 0x20, 0x59, 0xE2, 0xCF, 0x30, -0x5A, 0xAD, 0xC8, 0x20, 0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x8D, 0xAA, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, -0x5E, 0x6D, 0x8C, 0x20, 0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x56, 0xA8, 0xA0, 0x61, 0x6B, 0x91, 0xB0, -0x62, 0x36, 0x8A, 0xA0, 0x63, 0x4B, 0x73, 0xB0, 0x64, 0x16, 0x6C, 0xA0, 0x65, 0x2B, 0x55, 0xB0, -0x65, 0xF6, 0x4E, 0xA0, 0x67, 0x14, 0x72, 0x30, 0x67, 0xD6, 0x30, 0xA0, 0x68, 0xF4, 0x54, 0x30, -0x69, 0xB6, 0x12, 0xA0, 0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x9F, 0x2F, 0x20, 0x6C, 0xB4, 0x18, 0x30, -0x6D, 0x7F, 0x11, 0x20, 0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x5E, 0xF3, 0x20, 0x70, 0x7D, 0x16, 0xB0, -0x71, 0x3E, 0xD5, 0x20, 0x72, 0x5C, 0xF8, 0xB0, 0x73, 0x1E, 0xB7, 0x20, 0x74, 0x3C, 0xDA, 0xB0, -0x75, 0x07, 0xD3, 0xA0, 0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xE7, 0xB5, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, -0x78, 0xC7, 0x97, 0xA0, 0x79, 0xDC, 0x80, 0xB0, 0x7A, 0xA7, 0x79, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, -0x7C, 0x87, 0x5B, 0xA0, 0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x67, 0x3D, 0xA0, 0x7F, 0x85, 0x61, 0x30, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, -0xD0, 0x00, 0x04, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x5D, 0x60, 0x00, 0xBA, -0xD8, 0x08, 0x00, 0x00, 0x00, 0x15, 0x42, 0x75, 0x65, 0x6E, 0x6F, 0x73, 0x20, 0x41, 0x69, 0x72, -0x65, 0x73, 0x20, 0x28, 0x42, 0x41, 0x2C, 0x20, 0x43, 0x46, 0x29, - -/* America/Argentina/Catamarca */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, -0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, -0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x51, 0x0A, 0x00, 0xB0, -0xAB, 0xDD, 0x00, 0x00, 0x00, 0x1B, 0x43, 0x61, 0x74, 0x61, 0x6D, 0x61, 0x72, 0x63, 0x61, 0x20, -0x28, 0x43, 0x54, 0x29, 0x2C, 0x20, 0x43, 0x68, 0x75, 0x62, 0x75, 0x74, 0x20, 0x28, 0x43, 0x48, -0x29, - -/* America/Argentina/ComodRivadavia */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, -0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, -0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Argentina/Cordoba */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x47, 0x77, 0x09, 0xB0, -0x47, 0xDC, 0x7F, 0x20, 0x48, 0xFA, 0xA2, 0xB0, 0x49, 0xBC, 0x61, 0x20, 0x4A, 0xDA, 0x84, 0xB0, -0x4B, 0xA5, 0x7D, 0xA0, 0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x85, 0x5F, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, -0x4F, 0x65, 0x41, 0xA0, 0x50, 0x83, 0x65, 0x30, 0x51, 0x45, 0x23, 0xA0, 0x52, 0x63, 0x47, 0x30, -0x53, 0x25, 0x05, 0xA0, 0x54, 0x43, 0x29, 0x30, 0x55, 0x04, 0xE7, 0xA0, 0x56, 0x23, 0x0B, 0x30, -0x56, 0xEE, 0x04, 0x20, 0x58, 0x02, 0xED, 0x30, 0x58, 0xCD, 0xE6, 0x20, 0x59, 0xE2, 0xCF, 0x30, -0x5A, 0xAD, 0xC8, 0x20, 0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x8D, 0xAA, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, -0x5E, 0x6D, 0x8C, 0x20, 0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x56, 0xA8, 0xA0, 0x61, 0x6B, 0x91, 0xB0, -0x62, 0x36, 0x8A, 0xA0, 0x63, 0x4B, 0x73, 0xB0, 0x64, 0x16, 0x6C, 0xA0, 0x65, 0x2B, 0x55, 0xB0, -0x65, 0xF6, 0x4E, 0xA0, 0x67, 0x14, 0x72, 0x30, 0x67, 0xD6, 0x30, 0xA0, 0x68, 0xF4, 0x54, 0x30, -0x69, 0xB6, 0x12, 0xA0, 0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x9F, 0x2F, 0x20, 0x6C, 0xB4, 0x18, 0x30, -0x6D, 0x7F, 0x11, 0x20, 0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x5E, 0xF3, 0x20, 0x70, 0x7D, 0x16, 0xB0, -0x71, 0x3E, 0xD5, 0x20, 0x72, 0x5C, 0xF8, 0xB0, 0x73, 0x1E, 0xB7, 0x20, 0x74, 0x3C, 0xDA, 0xB0, -0x75, 0x07, 0xD3, 0xA0, 0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xE7, 0xB5, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, -0x78, 0xC7, 0x97, 0xA0, 0x79, 0xDC, 0x80, 0xB0, 0x7A, 0xA7, 0x79, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, -0x7C, 0x87, 0x5B, 0xA0, 0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x67, 0x3D, 0xA0, 0x7F, 0x85, 0x61, 0x30, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, -0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, -0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0xA3, 0x20, 0x00, 0xB1, 0x48, 0x1D, 0x00, -0x00, 0x00, 0x2F, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, -0x73, 0x20, 0x28, 0x43, 0x42, 0x2C, 0x20, 0x43, 0x43, 0x2C, 0x20, 0x43, 0x4E, 0x2C, 0x20, 0x45, -0x52, 0x2C, 0x20, 0x46, 0x4D, 0x2C, 0x20, 0x4D, 0x4E, 0x2C, 0x20, 0x53, 0x45, 0x2C, 0x20, 0x53, -0x46, 0x29, - -/* America/Argentina/Jujuy */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x2A, 0x57, 0xC0, -0x27, 0xE2, 0xDB, 0xB0, 0x28, 0xEE, 0x8A, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x47, 0x77, 0x09, 0xB0, -0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, -0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x57, 0x41, 0x52, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, -0xFC, 0xDD, 0x00, 0xAF, 0xEF, 0x10, 0x00, 0x00, 0x00, 0x0A, 0x4A, 0x75, 0x6A, 0x75, 0x79, 0x20, -0x28, 0x4A, 0x59, 0x29, - -/* America/Argentina/La_Rioja */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xCD, 0xB5, 0xA0, 0x28, 0x26, 0x26, 0x40, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, -0x2A, 0xE0, 0xD3, 0x30, 0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, -0x40, 0xBB, 0xF1, 0x30, 0x40, 0xD5, 0x0B, 0xC0, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x05, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, -0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, -0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, -0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x5D, 0xBD, 0x65, 0x00, 0xAF, 0x3F, 0x48, 0x00, 0x00, 0x00, 0x0D, 0x4C, 0x61, 0x20, 0x52, 0x69, -0x6F, 0x6A, 0x61, 0x20, 0x28, 0x4C, 0x52, 0x29, - -/* America/Argentina/Mendoza */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x19, 0x34, 0x40, -0x27, 0xCD, 0xC3, 0xB0, 0x28, 0xFA, 0x67, 0xC0, 0x29, 0xB0, 0x48, 0xB0, 0x2A, 0xE0, 0xE1, 0x40, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xB0, 0x13, 0xB0, -0x41, 0x56, 0x3E, 0xC0, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x06, 0x05, -0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, -0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, -0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, -0x41, 0x52, 0x54, 0x00, 0x57, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0xD9, 0x4D, 0x00, 0xAC, 0x25, 0x02, -0x00, 0x00, 0x00, 0x0C, 0x4D, 0x65, 0x6E, 0x64, 0x6F, 0x7A, 0x61, 0x20, 0x28, 0x4D, 0x5A, 0x29, - - -/* America/Argentina/Rio_Gallegos */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, -0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, -0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x79, 0xC5, 0x00, 0xA9, -0xB4, 0x02, 0x00, 0x00, 0x00, 0x0F, 0x53, 0x61, 0x6E, 0x74, 0x61, 0x20, 0x43, 0x72, 0x75, 0x7A, -0x20, 0x28, 0x53, 0x43, 0x29, - -/* America/Argentina/Salta */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x47, 0x77, 0x09, 0xB0, -0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, -0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x65, 0xE7, 0x3D, 0x00, 0xB0, 0x1C, 0xA2, 0x00, 0x00, 0x00, 0x10, 0x28, 0x53, 0x41, 0x2C, -0x20, 0x4C, 0x50, 0x2C, 0x20, 0x4E, 0x51, 0x2C, 0x20, 0x52, 0x4E, 0x29, - -/* America/Argentina/San_Juan */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xCD, 0xB5, 0xA0, 0x28, 0x26, 0x26, 0x40, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, -0x2A, 0xE0, 0xD3, 0x30, 0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, -0x40, 0xBA, 0x9F, 0xB0, 0x41, 0x03, 0x30, 0x40, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x05, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, -0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, -0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, -0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x5A, 0xD7, 0x35, 0x00, 0xAB, 0xAF, 0xD2, 0x00, 0x00, 0x00, 0x0D, 0x53, 0x61, 0x6E, 0x20, 0x4A, -0x75, 0x61, 0x6E, 0x20, 0x28, 0x53, 0x4A, 0x29, - -/* America/Argentina/San_Luis */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xFD, 0xA5, 0xA0, 0x27, 0x19, 0x34, 0x40, -0x27, 0xCD, 0xC3, 0xB0, 0x28, 0x47, 0x1B, 0xC0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, -0x40, 0xBA, 0x9F, 0xB0, 0x41, 0x03, 0x30, 0x40, 0x47, 0x77, 0x09, 0xB0, 0x47, 0x93, 0xFC, 0xA0, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, -0x06, 0x05, 0x04, 0x06, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, -0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, -0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, -0x57, 0x41, 0x52, 0x54, 0x00, 0x57, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x75, 0x52, 0x00, 0xAE, 0x7B, -0xF8, 0x00, 0x00, 0x00, 0x0D, 0x53, 0x61, 0x6E, 0x20, 0x4C, 0x75, 0x69, 0x73, 0x20, 0x28, 0x53, -0x4C, 0x29, - -/* America/Argentina/Tucuman */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xCB, 0xD1, 0x40, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, 0x48, 0xFA, 0xA2, 0xB0, -0x49, 0xBC, 0x61, 0x20, 0x4A, 0xDA, 0x84, 0xB0, 0x4B, 0xA5, 0x7D, 0xA0, 0x4C, 0xBA, 0x66, 0xB0, -0x4D, 0x85, 0x5F, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, 0x4F, 0x65, 0x41, 0xA0, 0x50, 0x83, 0x65, 0x30, -0x51, 0x45, 0x23, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x25, 0x05, 0xA0, 0x54, 0x43, 0x29, 0x30, -0x55, 0x04, 0xE7, 0xA0, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xEE, 0x04, 0x20, 0x58, 0x02, 0xED, 0x30, -0x58, 0xCD, 0xE6, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0xAD, 0xC8, 0x20, 0x5B, 0xCB, 0xEB, 0xB0, -0x5C, 0x8D, 0xAA, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x6D, 0x8C, 0x20, 0x5F, 0x8B, 0xAF, 0xB0, -0x60, 0x56, 0xA8, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x36, 0x8A, 0xA0, 0x63, 0x4B, 0x73, 0xB0, -0x64, 0x16, 0x6C, 0xA0, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xF6, 0x4E, 0xA0, 0x67, 0x14, 0x72, 0x30, -0x67, 0xD6, 0x30, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0xB6, 0x12, 0xA0, 0x6A, 0xD4, 0x36, 0x30, -0x6B, 0x9F, 0x2F, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x7F, 0x11, 0x20, 0x6E, 0x93, 0xFA, 0x30, -0x6F, 0x5E, 0xF3, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x3E, 0xD5, 0x20, 0x72, 0x5C, 0xF8, 0xB0, -0x73, 0x1E, 0xB7, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x75, 0x07, 0xD3, 0xA0, 0x76, 0x1C, 0xBC, 0xB0, -0x76, 0xE7, 0xB5, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xC7, 0x97, 0xA0, 0x79, 0xDC, 0x80, 0xB0, -0x7A, 0xA7, 0x79, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x87, 0x5B, 0xA0, 0x7D, 0xA5, 0x7F, 0x30, -0x7E, 0x67, 0x3D, 0xA0, 0x7F, 0x85, 0x61, 0x30, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, -0x05, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, -0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, -0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, -0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, -0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x62, 0xE7, 0x02, 0x00, 0xAF, 0xCE, 0x82, 0x00, 0x00, 0x00, 0x0C, 0x54, 0x75, 0x63, -0x75, 0x6D, 0x61, 0x6E, 0x20, 0x28, 0x54, 0x4D, 0x29, - -/* America/Argentina/Ushuaia */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xB9, 0x4E, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, -0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, -0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x26, 0xFF, 0x00, 0xAB, -0x5B, 0x30, 0x00, 0x00, 0x00, 0x15, 0x54, 0x69, 0x65, 0x72, 0x72, 0x61, 0x20, 0x64, 0x65, 0x6C, -0x20, 0x46, 0x75, 0x65, 0x67, 0x6F, 0x20, 0x28, 0x54, 0x46, 0x29, - -/* America/Aruba */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2F, 0x38, -0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBE, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4E, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x67, 0x10, 0x00, 0xAA, -0xD8, 0xFA, 0x00, 0x00, 0x00, 0x00, - -/* America/Asuncion */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xB8, 0x17, 0xF5, 0x90, -0x05, 0x2B, 0xDA, 0x40, 0x07, 0xFC, 0xF0, 0xB0, 0x0A, 0xCF, 0x74, 0xC0, 0x0B, 0x97, 0xCA, 0xB0, -0x0C, 0xB1, 0xF9, 0xC0, 0x0D, 0x78, 0xFE, 0x30, 0x0E, 0x93, 0x2D, 0x40, 0x0F, 0x5A, 0x31, 0xB0, -0x10, 0x74, 0x60, 0xC0, 0x11, 0x64, 0x43, 0xB0, 0x12, 0x55, 0x94, 0x40, 0x13, 0x46, 0xC8, 0xB0, -0x14, 0x38, 0x19, 0x40, 0x15, 0x27, 0xFC, 0x30, 0x16, 0x19, 0x4C, 0xC0, 0x17, 0x09, 0x2F, 0xB0, -0x17, 0xFA, 0x80, 0x40, 0x18, 0xEA, 0x63, 0x30, 0x19, 0xDB, 0xB3, 0xC0, 0x1A, 0xCC, 0xE8, 0x30, -0x1B, 0xBE, 0x38, 0xC0, 0x1C, 0xAE, 0x1B, 0xB0, 0x1D, 0x9F, 0x6C, 0x40, 0x1E, 0x8F, 0x4F, 0x30, -0x1F, 0x80, 0x9F, 0xC0, 0x20, 0x70, 0x82, 0xB0, 0x21, 0x61, 0xD3, 0x40, 0x22, 0x53, 0x07, 0xB0, -0x23, 0x44, 0x58, 0x40, 0x24, 0x34, 0x3B, 0x30, 0x25, 0x41, 0x3B, 0x40, 0x26, 0x15, 0x6E, 0xB0, -0x27, 0x06, 0xBF, 0x40, 0x27, 0xF6, 0xA2, 0x30, 0x28, 0xEE, 0x8A, 0x40, 0x29, 0xB0, 0x48, 0xB0, -0x2A, 0xCF, 0xBD, 0xC0, 0x2B, 0xB9, 0x09, 0x30, 0x2C, 0xAB, 0xAB, 0x40, 0x2D, 0x70, 0x0C, 0xB0, -0x2E, 0x8C, 0xDE, 0xC0, 0x2F, 0x4F, 0xEE, 0xB0, 0x30, 0x6E, 0x12, 0x40, 0x31, 0x36, 0x68, 0x30, -0x32, 0x57, 0x2E, 0xC0, 0x33, 0x0F, 0xB2, 0xB0, 0x34, 0x37, 0x10, 0xC0, 0x34, 0xF8, 0xCF, 0x30, -0x36, 0x16, 0xF2, 0xC0, 0x36, 0xE1, 0xEB, 0xB0, 0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xC1, 0xCD, 0xB0, -0x39, 0xD6, 0xB6, 0xC0, 0x3A, 0xA1, 0xAF, 0xB0, 0x3B, 0xBF, 0xD3, 0x40, 0x3C, 0xAF, 0xB6, 0x30, -0x3D, 0x71, 0x90, 0xC0, 0x3E, 0x8F, 0x98, 0x30, 0x3F, 0x5A, 0xAD, 0x40, 0x40, 0x6F, 0x7A, 0x30, -0x41, 0x71, 0xEE, 0x40, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x51, 0xD0, 0x40, 0x44, 0x13, 0x8E, 0xB0, -0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x1A, 0xCE, 0xC0, 0x47, 0xD3, 0x52, 0xB0, -0x48, 0xFA, 0xB0, 0xC0, 0x49, 0xB3, 0x34, 0xB0, 0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0x9C, 0x51, 0x30, -0x4C, 0xBA, 0x74, 0xC0, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x9A, 0x56, 0xC0, 0x4F, 0x5C, 0x15, 0x30, -0x50, 0x83, 0x73, 0x40, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x63, 0x55, 0x40, 0x53, 0x1B, 0xD9, 0x30, -0x54, 0x43, 0x37, 0x40, 0x54, 0xFB, 0xBB, 0x30, 0x56, 0x23, 0x19, 0x40, 0x56, 0xE4, 0xD7, 0xB0, -0x58, 0x02, 0xFB, 0x40, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0xA4, 0x9B, 0xB0, -0x5B, 0xCB, 0xF9, 0xC0, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xAB, 0xDB, 0xC0, 0x5E, 0x64, 0x5F, 0xB0, -0x5F, 0x8B, 0xBD, 0xC0, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x6B, 0x9F, 0xC0, 0x62, 0x2D, 0x5E, 0x30, -0x63, 0x4B, 0x81, 0xC0, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xED, 0x22, 0x30, -0x67, 0x14, 0x80, 0x40, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xF4, 0x62, 0x40, 0x69, 0xAC, 0xE6, 0x30, -0x6A, 0xD4, 0x44, 0x40, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xB4, 0x26, 0x40, 0x6D, 0x75, 0xE4, 0xB0, -0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x7D, 0x24, 0xC0, 0x71, 0x35, 0xA8, 0xB0, -0x72, 0x5D, 0x06, 0xC0, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x3C, 0xE8, 0xC0, 0x74, 0xFE, 0xA7, 0x30, -0x76, 0x1C, 0xCA, 0xC0, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xFC, 0xAC, 0xC0, 0x78, 0xBE, 0x6B, 0x30, -0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xC5, 0xAB, 0x40, 0x7C, 0x7E, 0x2F, 0x30, -0x7D, 0xA5, 0x8D, 0x40, 0x7E, 0x5E, 0x11, 0x30, 0x7F, 0x85, 0x6F, 0x40, 0x01, 0x02, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0xFF, 0xFF, 0xC9, 0xF0, -0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, -0xD5, 0xD0, 0x01, 0x08, 0x41, 0x4D, 0x54, 0x00, 0x50, 0x59, 0x54, 0x00, 0x50, 0x59, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x96, 0xCA, 0x00, 0xBC, 0xB3, -0x4A, 0x00, 0x00, 0x00, 0x00, - -/* America/Atikokan */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xB8, 0xA1, 0x80, -0x9F, 0xC0, 0x3F, 0x70, 0xC8, 0xF8, 0x57, 0x60, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x09, 0xF0, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, -0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, -0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xD3, 0xBA, 0x95, 0x00, 0x88, 0xC0, 0x76, 0x00, 0x00, -0x00, 0x44, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, -0x72, 0x64, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x41, 0x74, 0x69, 0x6B, 0x6F, 0x6B, -0x61, 0x6E, 0x2C, 0x20, 0x4F, 0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, 0x20, 0x61, 0x6E, 0x64, 0x20, -0x53, 0x6F, 0x75, 0x74, 0x68, 0x61, 0x6D, 0x70, 0x74, 0x6F, 0x6E, 0x20, 0x49, 0x2C, 0x20, 0x4E, -0x75, 0x6E, 0x61, 0x76, 0x75, 0x74, - -/* America/Atka */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0xCB, 0x89, 0x44, 0xD0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50, -0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50, -0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0, -0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50, -0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0, -0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50, -0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50, -0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50, -0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x22, 0x20, 0x1A, 0xF2, 0x50, 0xC0, 0x1B, 0xE2, 0x33, 0xB0, -0x1C, 0xD2, 0x32, 0xC0, 0x1D, 0xC2, 0x15, 0xB0, 0x1E, 0xB2, 0x14, 0xC0, 0x1F, 0xA1, 0xF7, 0xB0, -0x20, 0x76, 0x47, 0x40, 0x21, 0x81, 0xD9, 0xB0, 0x22, 0x56, 0x29, 0x40, 0x23, 0x6A, 0xF6, 0x30, -0x24, 0x36, 0x0B, 0x40, 0x25, 0x4A, 0xD8, 0x30, 0x26, 0x15, 0xED, 0x40, 0x27, 0x2A, 0xBA, 0x30, -0x27, 0xFF, 0x09, 0xC0, 0x29, 0x0A, 0x9C, 0x30, 0x29, 0xDE, 0xEB, 0xC0, 0x2A, 0xEA, 0x7E, 0x30, -0x2B, 0xBE, 0xCD, 0xC0, 0x2C, 0xD3, 0x9A, 0xB0, 0x2D, 0x9E, 0xAF, 0xC0, 0x2E, 0xB3, 0x7C, 0xB0, -0x2F, 0x7E, 0x91, 0xC0, 0x30, 0x93, 0x5E, 0xB0, 0x31, 0x67, 0xAE, 0x40, 0x32, 0x73, 0x40, 0xB0, -0x33, 0x47, 0x90, 0x40, 0x34, 0x53, 0x22, 0xB0, 0x35, 0x27, 0x72, 0x40, 0x36, 0x33, 0x04, 0xB0, -0x37, 0x07, 0x54, 0x40, 0x38, 0x1C, 0x21, 0x30, 0x38, 0xE7, 0x36, 0x40, 0x39, 0xFC, 0x03, 0x30, -0x3A, 0xC7, 0x18, 0x40, 0x3B, 0xDB, 0xE5, 0x30, 0x3C, 0xB0, 0x34, 0xC0, 0x3D, 0xBB, 0xC7, 0x30, -0x3E, 0x90, 0x16, 0xC0, 0x3F, 0x9B, 0xA9, 0x30, 0x40, 0x6F, 0xF8, 0xC0, 0x41, 0x84, 0xC5, 0xB0, -0x42, 0x4F, 0xDA, 0xC0, 0x43, 0x64, 0xA7, 0xB0, 0x44, 0x2F, 0xBC, 0xC0, 0x45, 0x44, 0x89, 0xB0, -0x45, 0xF3, 0xEF, 0x40, 0x47, 0x2D, 0xA6, 0x30, 0x47, 0xD3, 0xD1, 0x40, 0x49, 0x0D, 0x88, 0x30, -0x49, 0xB3, 0xB3, 0x40, 0x4A, 0xED, 0x6A, 0x30, 0x4B, 0x9C, 0xCF, 0xC0, 0x4C, 0xD6, 0x86, 0xB0, -0x4D, 0x7C, 0xB1, 0xC0, 0x4E, 0xB6, 0x68, 0xB0, 0x4F, 0x5C, 0x93, 0xC0, 0x50, 0x96, 0x4A, 0xB0, -0x51, 0x3C, 0x75, 0xC0, 0x52, 0x76, 0x2C, 0xB0, 0x53, 0x1C, 0x57, 0xC0, 0x54, 0x56, 0x0E, 0xB0, -0x54, 0xFC, 0x39, 0xC0, 0x56, 0x35, 0xF0, 0xB0, 0x56, 0xE5, 0x56, 0x40, 0x58, 0x1F, 0x0D, 0x30, -0x58, 0xC5, 0x38, 0x40, 0x59, 0xFE, 0xEF, 0x30, 0x5A, 0xA5, 0x1A, 0x40, 0x5B, 0xDE, 0xD1, 0x30, -0x5C, 0x84, 0xFC, 0x40, 0x5D, 0xBE, 0xB3, 0x30, 0x5E, 0x64, 0xDE, 0x40, 0x5F, 0x9E, 0x95, 0x30, -0x60, 0x4D, 0xFA, 0xC0, 0x61, 0x87, 0xB1, 0xB0, 0x62, 0x2D, 0xDC, 0xC0, 0x63, 0x67, 0x93, 0xB0, -0x64, 0x0D, 0xBE, 0xC0, 0x65, 0x47, 0x75, 0xB0, 0x65, 0xED, 0xA0, 0xC0, 0x67, 0x27, 0x57, 0xB0, -0x67, 0xCD, 0x82, 0xC0, 0x69, 0x07, 0x39, 0xB0, 0x69, 0xAD, 0x64, 0xC0, 0x6A, 0xE7, 0x1B, 0xB0, -0x6B, 0x96, 0x81, 0x40, 0x6C, 0xD0, 0x38, 0x30, 0x6D, 0x76, 0x63, 0x40, 0x6E, 0xB0, 0x1A, 0x30, -0x6F, 0x56, 0x45, 0x40, 0x70, 0x8F, 0xFC, 0x30, 0x71, 0x36, 0x27, 0x40, 0x72, 0x6F, 0xDE, 0x30, -0x73, 0x16, 0x09, 0x40, 0x74, 0x4F, 0xC0, 0x30, 0x74, 0xFF, 0x25, 0xC0, 0x76, 0x38, 0xDC, 0xB0, -0x76, 0xDF, 0x07, 0xC0, 0x78, 0x18, 0xBE, 0xB0, 0x78, 0xBE, 0xE9, 0xC0, 0x79, 0xF8, 0xA0, 0xB0, -0x7A, 0x9E, 0xCB, 0xC0, 0x7B, 0xD8, 0x82, 0xB0, 0x7C, 0x7E, 0xAD, 0xC0, 0x7D, 0xB8, 0x64, 0xB0, -0x7E, 0x5E, 0x8F, 0xC0, 0x7F, 0x98, 0x46, 0xB0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, -0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF, -0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x14, 0xFF, 0xFF, 0x81, 0x70, 0x01, -0x19, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x1E, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, -0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00, -0x48, 0x41, 0x44, 0x54, 0x00, 0x48, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Bahia */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x6B, 0x1C, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x27, 0x21, 0x0F, 0x30, 0x27, 0xBD, 0xE3, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0x94, 0x8B, 0x20, -0x2A, 0xEA, 0x0D, 0xB0, 0x2B, 0x6B, 0x32, 0xA0, 0x2C, 0xC0, 0xB5, 0x30, 0x2D, 0x66, 0xC4, 0x20, -0x2E, 0xA0, 0x97, 0x30, 0x2F, 0x46, 0xA6, 0x20, 0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, -0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, -0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, -0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, -0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0xFF, 0xFF, 0xDB, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, -0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x84, 0xDD, 0x00, 0xD9, 0x76, 0x92, -0x00, 0x00, 0x00, 0x05, 0x42, 0x61, 0x68, 0x69, 0x61, - -/* America/Barbados */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA9, 0x79, 0x24, 0xE4, -0xB8, 0x85, 0x63, 0xE4, 0x0E, 0x00, 0xF2, 0xE0, 0x0E, 0x94, 0x8C, 0xD0, 0x0F, 0x97, 0x00, 0xE0, -0x10, 0x74, 0x6E, 0xD0, 0x11, 0x76, 0xE2, 0xE0, 0x12, 0x54, 0x50, 0xD0, 0x13, 0x5F, 0xFF, 0x60, -0x14, 0x30, 0x3E, 0x50, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0xFF, 0xFF, -0xC8, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xC8, 0x1C, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x41, 0x44, -0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, -0x51, 0x70, 0x00, 0xB9, 0x92, 0x82, 0x00, 0x00, 0x00, 0x00, - -/* America/Belem */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x74, 0x74, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xD2, -0x8C, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x88, 0x7D, 0x68, 0x00, 0xCA, 0x27, 0x4D, 0x00, 0x00, 0x00, 0x0D, 0x41, 0x6D, -0x61, 0x70, 0x61, 0x2C, 0x20, 0x45, 0x20, 0x50, 0x61, 0x72, 0x61, - -/* America/Belize */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x93, 0x5E, 0xD9, 0xB0, -0x9F, 0x9F, 0x3B, 0xE0, 0xA0, 0x45, 0x51, 0xD8, 0xA1, 0x7F, 0x1D, 0xE0, 0xA2, 0x2E, 0x6E, 0x58, -0xA3, 0x5E, 0xFF, 0xE0, 0xA4, 0x0E, 0x50, 0x58, 0xA5, 0x3E, 0xE1, 0xE0, 0xA5, 0xEE, 0x32, 0x58, -0xA7, 0x27, 0xFE, 0x60, 0xA7, 0xCE, 0x14, 0x58, 0xA9, 0x07, 0xE0, 0x60, 0xA9, 0xAD, 0xF6, 0x58, -0xAA, 0xE7, 0xC2, 0x60, 0xAB, 0x97, 0x12, 0xD8, 0xAC, 0xC7, 0xA4, 0x60, 0xAD, 0x76, 0xF4, 0xD8, -0xAE, 0xA7, 0x86, 0x60, 0xAF, 0x56, 0xD6, 0xD8, 0xB0, 0x87, 0x68, 0x60, 0xB1, 0x36, 0xB8, 0xD8, -0xB2, 0x70, 0x84, 0xE0, 0xB3, 0x16, 0x9A, 0xD8, 0xB4, 0x50, 0x66, 0xE0, 0xB4, 0xF6, 0x7C, 0xD8, -0xB6, 0x30, 0x48, 0xE0, 0xB6, 0xDF, 0x99, 0x58, 0xB8, 0x10, 0x2A, 0xE0, 0xB8, 0xBF, 0x7B, 0x58, -0xB9, 0xF0, 0x0C, 0xE0, 0xBA, 0x9F, 0x5D, 0x58, 0xBB, 0xD9, 0x29, 0x60, 0xBC, 0x7F, 0x3F, 0x58, -0xBD, 0xB9, 0x0B, 0x60, 0xBE, 0x5F, 0x21, 0x58, 0xBF, 0x98, 0xED, 0x60, 0xC0, 0x3F, 0x03, 0x58, -0xC1, 0x78, 0xCF, 0x60, 0xC2, 0x28, 0x1F, 0xD8, 0xC3, 0x58, 0xB1, 0x60, 0xC4, 0x08, 0x01, 0xD8, -0xC5, 0x38, 0x93, 0x60, 0xC5, 0xE7, 0xE3, 0xD8, 0xC7, 0x21, 0xAF, 0xE0, 0xC7, 0xC7, 0xC5, 0xD8, -0xC9, 0x01, 0x91, 0xE0, 0xC9, 0xA7, 0xA7, 0xD8, 0xCA, 0xE1, 0x73, 0xE0, 0xCB, 0x90, 0xC4, 0x58, -0xCC, 0xC1, 0x55, 0xE0, 0xCD, 0x70, 0xA6, 0x58, 0x07, 0x62, 0xDB, 0x60, 0x07, 0xB9, 0xD0, 0x50, -0x18, 0x61, 0x71, 0x60, 0x18, 0xAB, 0x37, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, -0xFF, 0xAD, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xB2, 0xA8, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, -0x09, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x48, 0x44, 0x54, 0x00, -0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xA4, 0x08, 0x30, 0x00, 0x8C, 0xAF, 0xA0, 0x00, 0x00, 0x00, 0x00, - -/* America/Blanc-Sablon */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x85, 0x60, -0x9F, 0xC0, 0x23, 0x50, 0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, -0x00, 0x01, 0x02, 0x03, 0x01, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0x41, 0x44, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xD7, 0xC8, 0xE2, 0x00, 0xBB, 0xDC, 0x72, 0x00, 0x00, 0x00, -0x33, 0x41, 0x74, 0x6C, 0x61, 0x6E, 0x74, 0x69, 0x63, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, -0x72, 0x64, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x51, 0x75, 0x65, 0x62, 0x65, 0x63, -0x20, 0x2D, 0x20, 0x4C, 0x6F, 0x77, 0x65, 0x72, 0x20, 0x4E, 0x6F, 0x72, 0x74, 0x68, 0x20, 0x53, -0x68, 0x6F, 0x72, 0x65, - -/* America/Boa_Vista */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7F, 0xE0, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xB8, 0x93, 0x30, 0x39, 0xDF, 0xF1, 0x40, 0x39, 0xE9, 0x1D, 0xB0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0xFF, 0xFF, 0xC7, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, -0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8D, 0xA0, 0x82, 0x00, 0xB8, 0x1F, 0x6A, 0x00, 0x00, -0x00, 0x07, 0x52, 0x6F, 0x72, 0x61, 0x69, 0x6D, 0x61, - -/* America/Bogota */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x98, 0x58, 0x55, 0x74, -0x2A, 0x03, 0x73, 0x50, 0x2B, 0xBE, 0x5D, 0x40, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBA, 0x8C, 0x00, -0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x42, 0x4D, 0x54, -0x00, 0x43, 0x4F, 0x53, 0x54, 0x00, 0x43, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x90, 0x59, 0x20, 0x00, 0xA1, 0xDE, 0xCD, 0x00, 0x00, 0x00, 0x00, - -/* America/Boise */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xA8, 0x46, 0x4C, 0x20, -0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xFA, 0xF8, 0x75, 0x10, -0xFB, 0xE8, 0x58, 0x00, 0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, -0xFF, 0xA8, 0x1C, 0x00, 0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, -0x03, 0x71, 0x1A, 0x80, 0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, -0x07, 0x30, 0xDE, 0x80, 0x07, 0xB2, 0x1F, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, -0x0A, 0xF0, 0xA2, 0x80, 0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, -0x0E, 0xB9, 0xA1, 0x00, 0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, -0x12, 0x79, 0x65, 0x00, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, -0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, -0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, -0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, -0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, -0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, -0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, -0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, -0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, -0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, -0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, -0x47, 0x2D, 0x7C, 0x00, 0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, -0x4A, 0xED, 0x40, 0x00, 0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, -0x4E, 0xB6, 0x3E, 0x80, 0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, -0x52, 0x76, 0x02, 0x80, 0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, -0x56, 0x35, 0xC6, 0x80, 0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, -0x59, 0xFE, 0xC5, 0x00, 0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, -0x5D, 0xBE, 0x89, 0x00, 0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, -0x61, 0x87, 0x87, 0x80, 0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, -0x65, 0x47, 0x4B, 0x80, 0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, -0x69, 0x07, 0x0F, 0x80, 0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, -0x6C, 0xD0, 0x0E, 0x00, 0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, -0x70, 0x8F, 0xD2, 0x00, 0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, -0x74, 0x4F, 0x96, 0x00, 0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, -0x78, 0x18, 0x94, 0x80, 0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, -0x7B, 0xD8, 0x58, 0x80, 0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, -0x7F, 0x98, 0x1C, 0x80, 0x00, 0x01, 0x00, 0x01, 0x04, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, -0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, -0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x14, 0x50, 0x44, -0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x4D, 0x53, -0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0xCB, 0xE0, 0xD1, 0x00, 0x61, 0xF7, 0x1A, 0x00, 0x00, 0x00, 0x29, 0x4D, 0x6F, -0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x73, 0x6F, -0x75, 0x74, 0x68, 0x20, 0x49, 0x64, 0x61, 0x68, 0x6F, 0x20, 0x26, 0x20, 0x65, 0x61, 0x73, 0x74, -0x20, 0x4F, 0x72, 0x65, 0x67, 0x6F, 0x6E, - -/* America/Buenos_Aires */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x47, 0x77, 0x09, 0xB0, -0x47, 0xDC, 0x7F, 0x20, 0x48, 0xFA, 0xA2, 0xB0, 0x49, 0xBC, 0x61, 0x20, 0x4A, 0xDA, 0x84, 0xB0, -0x4B, 0xA5, 0x7D, 0xA0, 0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x85, 0x5F, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, -0x4F, 0x65, 0x41, 0xA0, 0x50, 0x83, 0x65, 0x30, 0x51, 0x45, 0x23, 0xA0, 0x52, 0x63, 0x47, 0x30, -0x53, 0x25, 0x05, 0xA0, 0x54, 0x43, 0x29, 0x30, 0x55, 0x04, 0xE7, 0xA0, 0x56, 0x23, 0x0B, 0x30, -0x56, 0xEE, 0x04, 0x20, 0x58, 0x02, 0xED, 0x30, 0x58, 0xCD, 0xE6, 0x20, 0x59, 0xE2, 0xCF, 0x30, -0x5A, 0xAD, 0xC8, 0x20, 0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x8D, 0xAA, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, -0x5E, 0x6D, 0x8C, 0x20, 0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x56, 0xA8, 0xA0, 0x61, 0x6B, 0x91, 0xB0, -0x62, 0x36, 0x8A, 0xA0, 0x63, 0x4B, 0x73, 0xB0, 0x64, 0x16, 0x6C, 0xA0, 0x65, 0x2B, 0x55, 0xB0, -0x65, 0xF6, 0x4E, 0xA0, 0x67, 0x14, 0x72, 0x30, 0x67, 0xD6, 0x30, 0xA0, 0x68, 0xF4, 0x54, 0x30, -0x69, 0xB6, 0x12, 0xA0, 0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x9F, 0x2F, 0x20, 0x6C, 0xB4, 0x18, 0x30, -0x6D, 0x7F, 0x11, 0x20, 0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x5E, 0xF3, 0x20, 0x70, 0x7D, 0x16, 0xB0, -0x71, 0x3E, 0xD5, 0x20, 0x72, 0x5C, 0xF8, 0xB0, 0x73, 0x1E, 0xB7, 0x20, 0x74, 0x3C, 0xDA, 0xB0, -0x75, 0x07, 0xD3, 0xA0, 0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xE7, 0xB5, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, -0x78, 0xC7, 0x97, 0xA0, 0x79, 0xDC, 0x80, 0xB0, 0x7A, 0xA7, 0x79, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, -0x7C, 0x87, 0x5B, 0xA0, 0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x67, 0x3D, 0xA0, 0x7F, 0x85, 0x61, 0x30, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, -0xD0, 0x00, 0x04, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Cambridge_Bay */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x25, 0xA1, 0xF2, 0xCD, 0x80, -0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x5A, 0x70, -0xF8, 0x28, 0x85, 0xF0, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, -0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, -0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, -0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, -0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, -0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, -0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, -0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, -0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, -0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0x04, 0xE9, 0x50, -0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, -0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, -0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, -0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, 0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, -0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, 0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, -0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, 0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, -0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, 0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, -0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, 0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, -0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, 0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, -0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, 0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, -0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, 0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, -0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, 0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, -0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, 0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, -0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, 0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, -0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, 0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, -0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, 0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, -0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, 0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, -0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, 0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, -0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, 0x03, 0x01, 0x02, 0x03, 0x04, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x07, 0x06, 0x08, 0x07, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, -0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, -0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, -0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, -0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, -0x03, 0x05, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x15, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x19, 0xFF, 0xFF, 0xAB, -0xA0, 0x00, 0x1D, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x21, 0x7A, 0x7A, 0x7A, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x44, 0x54, 0x00, 0x4D, 0x44, -0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xF2, 0xC9, 0xDC, 0x00, 0x72, 0x85, 0x7D, 0x00, 0x00, 0x00, 0x1C, 0x4D, 0x6F, 0x75, 0x6E, -0x74, 0x61, 0x69, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x77, 0x65, 0x73, 0x74, -0x20, 0x4E, 0x75, 0x6E, 0x61, 0x76, 0x75, 0x74, - -/* America/Campo_Grande */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7A, 0x34, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x23, 0x58, 0x1E, 0xC0, 0x23, 0xE2, 0x7E, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x25, 0xD4, 0xD5, 0x30, -0x27, 0x21, 0x1D, 0x40, 0x27, 0xBD, 0xF1, 0xB0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0x94, 0x99, 0x30, -0x2A, 0xEA, 0x1B, 0xC0, 0x2B, 0x6B, 0x40, 0xB0, 0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, -0x2E, 0xA0, 0xA5, 0x40, 0x2F, 0x46, 0xB4, 0x30, 0x30, 0x80, 0x87, 0x40, 0x31, 0x1D, 0x5B, 0xB0, -0x32, 0x57, 0x2E, 0xC0, 0x33, 0x06, 0x78, 0x30, 0x34, 0x38, 0x62, 0x40, 0x34, 0xF8, 0xCF, 0x30, -0x36, 0x20, 0x2D, 0x40, 0x36, 0xCF, 0x76, 0xB0, 0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xB8, 0x93, 0x30, -0x39, 0xDF, 0xF1, 0x40, 0x3A, 0x8F, 0x3A, 0xB0, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x6F, 0x1C, 0xB0, -0x3D, 0xC4, 0x9F, 0x40, 0x3E, 0x4E, 0xFE, 0xB0, 0x3F, 0x92, 0x0C, 0x40, 0x40, 0x2E, 0xE0, 0xB0, -0x41, 0x87, 0x06, 0x40, 0x42, 0x17, 0xFD, 0x30, 0x43, 0x51, 0xD0, 0x40, 0x43, 0xF7, 0xDF, 0x30, -0x45, 0x4D, 0x61, 0xC0, 0x45, 0xE0, 0xFB, 0xB0, 0x47, 0x11, 0x94, 0x40, 0x47, 0xB7, 0xA3, 0x30, -0x48, 0xFA, 0xB0, 0xC0, 0x49, 0x97, 0x85, 0x30, 0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0x80, 0xA1, 0xB0, -0x4C, 0xBA, 0x74, 0xC0, 0x4D, 0x60, 0x83, 0xB0, 0x4E, 0x9A, 0x56, 0xC0, 0x4F, 0x49, 0xA0, 0x30, -0x50, 0x83, 0x73, 0x40, 0x51, 0x20, 0x47, 0xB0, 0x52, 0x63, 0x55, 0x40, 0x53, 0x00, 0x29, 0xB0, -0x54, 0x43, 0x37, 0x40, 0x54, 0xE9, 0x46, 0x30, 0x56, 0x23, 0x19, 0x40, 0x56, 0xC9, 0x28, 0x30, -0x58, 0x02, 0xFB, 0x40, 0x58, 0xA9, 0x0A, 0x30, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0x88, 0xEC, 0x30, -0x5B, 0xCB, 0xF9, 0xC0, 0x5C, 0x68, 0xCE, 0x30, 0x5D, 0xAB, 0xDB, 0xC0, 0x5E, 0x48, 0xB0, 0x30, -0x5F, 0x8B, 0xBD, 0xC0, 0x60, 0x31, 0xCC, 0xB0, 0x61, 0x6B, 0x9F, 0xC0, 0x62, 0x11, 0xAE, 0xB0, -0x63, 0x4B, 0x81, 0xC0, 0x63, 0xFA, 0xCB, 0x30, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xD1, 0x72, 0xB0, -0x67, 0x14, 0x80, 0x40, 0x67, 0xB1, 0x54, 0xB0, 0x68, 0xF4, 0x62, 0x40, 0x69, 0x9A, 0x71, 0x30, -0x6A, 0xD4, 0x44, 0x40, 0x6B, 0x7A, 0x53, 0x30, 0x6C, 0xB4, 0x26, 0x40, 0x6D, 0x5A, 0x35, 0x30, -0x6E, 0x94, 0x08, 0x40, 0x6F, 0x3A, 0x17, 0x30, 0x70, 0x7D, 0x24, 0xC0, 0x71, 0x19, 0xF9, 0x30, -0x72, 0x5D, 0x06, 0xC0, 0x72, 0xF9, 0xDB, 0x30, 0x74, 0x3C, 0xE8, 0xC0, 0x74, 0xD9, 0xBD, 0x30, -0x76, 0x1C, 0xCA, 0xC0, 0x76, 0xC2, 0xD9, 0xB0, 0x77, 0xFC, 0xAC, 0xC0, 0x78, 0xAB, 0xF6, 0x30, -0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x82, 0x9D, 0xB0, 0x7B, 0xC5, 0xAB, 0x40, 0x7C, 0x62, 0x7F, 0xB0, -0x7D, 0xA5, 0x8D, 0x40, 0x7E, 0x4B, 0x9C, 0x30, 0x7F, 0x85, 0x6F, 0x40, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xCC, 0xCC, -0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, -0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x6B, 0x7F, 0x88, 0x00, 0xC1, 0x33, 0xA2, 0x00, 0x00, 0x00, 0x12, 0x4D, 0x61, 0x74, -0x6F, 0x20, 0x47, 0x72, 0x6F, 0x73, 0x73, 0x6F, 0x20, 0x64, 0x6F, 0x20, 0x53, 0x75, 0x6C, - -/* America/Cancun */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xDA, 0x60, -0x16, 0x86, 0xD5, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, -0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x35, 0xC4, 0x00, 0x60, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xF5, 0x04, 0x80, 0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, -0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, -0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, -0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, -0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, -0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, -0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, -0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, -0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, -0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, -0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, -0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, -0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, -0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, -0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, -0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, -0xFF, 0xAE, 0xA8, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x10, 0x4C, 0x4D, 0x54, -0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA9, 0x7F, 0xED, 0x00, -0x90, 0x9A, 0x3A, 0x00, 0x00, 0x00, 0x1B, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x54, -0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x51, 0x75, 0x69, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x20, 0x52, -0x6F, 0x6F, - -/* America/Caracas */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x93, 0x1E, 0x2C, 0x3C, -0xF6, 0x98, 0xEC, 0x48, 0x47, 0x5B, 0x92, 0x70, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xC1, 0x44, 0x00, -0x00, 0xFF, 0xFF, 0xC0, 0xB8, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x43, 0x4D, 0x54, -0x00, 0x56, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x59, 0xD0, 0x00, -0xAF, 0x5F, 0xD5, 0x00, 0x00, 0x00, 0x00, - -/* America/Catamarca */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xBB, 0xF1, 0x30, -0x40, 0xD5, 0x0B, 0xC0, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, -0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, -0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, -0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Cayenne */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x2B, 0x90, -0xFB, 0xC3, 0x35, 0xC0, 0x01, 0x02, 0xFF, 0xFF, 0xCE, 0xF0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x46, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0xDB, 0x55, 0x00, 0xC3, 0xD2, 0x35, 0x00, 0x00, -0x00, 0x00, - -/* America/Cayman */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x0F, 0xB5, 0x00, -0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x4B, 0x4D, 0x54, -0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA6, 0xC7, 0x50, 0x00, 0x97, 0xA5, -0x9D, 0x00, 0x00, 0x00, 0x00, - -/* America/Chicago */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA2, 0xCB, 0x74, 0x00, -0xA3, 0x83, 0xF7, 0xF0, 0xA4, 0x45, 0xD2, 0x80, 0xA5, 0x63, 0xD9, 0xF0, 0xA6, 0x53, 0xD9, 0x00, -0xA7, 0x15, 0x97, 0x70, 0xA8, 0x33, 0xBB, 0x00, 0xA8, 0xFE, 0xB3, 0xF0, 0xAA, 0x13, 0x9D, 0x00, -0xAA, 0xDE, 0x95, 0xF0, 0xAB, 0xF3, 0x7F, 0x00, 0xAC, 0xBE, 0x77, 0xF0, 0xAD, 0xD3, 0x61, 0x00, -0xAE, 0x9E, 0x59, 0xF0, 0xAF, 0xB3, 0x43, 0x00, 0xB0, 0x7E, 0x3B, 0xF0, 0xB1, 0x9C, 0x5F, 0x80, -0xB2, 0x67, 0x58, 0x70, 0xB3, 0x7C, 0x41, 0x80, 0xB4, 0x47, 0x3A, 0x70, 0xB5, 0x5C, 0x23, 0x80, -0xB6, 0x27, 0x1C, 0x70, 0xB7, 0x3C, 0x05, 0x80, 0xB8, 0x06, 0xFE, 0x70, 0xB9, 0x1B, 0xE7, 0x80, -0xB9, 0xE6, 0xE0, 0x70, 0xBB, 0x05, 0x04, 0x00, 0xBB, 0xC6, 0xC2, 0x70, 0xBC, 0xE4, 0xE6, 0x00, -0xBD, 0xAF, 0xDE, 0xF0, 0xBE, 0xC4, 0xC8, 0x00, 0xBF, 0x8F, 0xC0, 0xF0, 0xC0, 0x5A, 0xD6, 0x00, -0xC1, 0xB0, 0x3C, 0x70, 0xC2, 0x84, 0x8C, 0x00, 0xC3, 0x4F, 0x84, 0xF0, 0xC4, 0x64, 0x6E, 0x00, -0xC5, 0x2F, 0x66, 0xF0, 0xC6, 0x4D, 0x8A, 0x80, 0xC7, 0x0F, 0x48, 0xF0, 0xC8, 0x2D, 0x6C, 0x80, -0xC8, 0xF8, 0x65, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, 0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, -0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, 0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, -0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, 0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, -0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, -0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, -0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, -0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, -0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70, -0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xF6, 0x3F, 0x69, 0x70, -0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x85, 0xF0, 0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, -0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, -0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, -0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, -0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, -0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, -0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, -0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, -0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, -0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, -0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, -0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, -0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, -0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, -0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, -0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, -0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, -0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, -0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, -0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, -0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, -0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, -0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, -0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, -0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, -0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, -0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, -0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, -0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, -0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, -0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, -0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0xC9, 0x2F, 0xE8, 0x00, 0x8E, 0xE6, 0x08, 0x00, 0x00, 0x00, 0x0C, 0x43, 0x65, 0x6E, 0x74, 0x72, -0x61, 0x6C, 0x20, 0x54, 0x69, 0x6D, 0x65, - -/* America/Chihuahua */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xF5, 0x12, 0x90, -0x3B, 0xB6, 0xD1, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, -0x47, 0x24, 0x41, 0x80, 0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, -0x4A, 0xE4, 0x05, 0x80, 0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, -0x4E, 0xAD, 0x04, 0x00, 0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, -0x52, 0x6C, 0xC8, 0x00, 0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, -0x56, 0x2C, 0x8C, 0x00, 0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, -0x59, 0xF5, 0x8A, 0x80, 0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, -0x5D, 0xB5, 0x4E, 0x80, 0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, -0x61, 0x7E, 0x4D, 0x00, 0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, -0x65, 0x3E, 0x11, 0x00, 0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, -0x68, 0xFD, 0xD5, 0x00, 0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, -0x6C, 0xC6, 0xD3, 0x80, 0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, -0x70, 0x86, 0x97, 0x80, 0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, -0x74, 0x46, 0x5B, 0x80, 0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, -0x78, 0x0F, 0x5A, 0x00, 0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, -0x7B, 0xCF, 0x1E, 0x00, 0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, -0x7F, 0x8E, 0xE2, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, -0x9C, 0x8C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, -0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, -0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0x05, 0x25, 0x00, 0x71, -0x0A, 0xCD, 0x00, 0x00, 0x00, 0x19, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x54, -0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x43, 0x68, 0x69, 0x68, 0x75, 0x61, 0x68, 0x75, 0x61, - -/* America/Coral_Harbour */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xB8, 0xA1, 0x80, -0x9F, 0xC0, 0x3F, 0x70, 0xC8, 0xF8, 0x57, 0x60, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x09, 0xF0, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, -0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, -0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, -0x00, 0x00, - -/* America/Cordoba */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x47, 0x77, 0x09, 0xB0, -0x47, 0xDC, 0x7F, 0x20, 0x48, 0xFA, 0xA2, 0xB0, 0x49, 0xBC, 0x61, 0x20, 0x4A, 0xDA, 0x84, 0xB0, -0x4B, 0xA5, 0x7D, 0xA0, 0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x85, 0x5F, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, -0x4F, 0x65, 0x41, 0xA0, 0x50, 0x83, 0x65, 0x30, 0x51, 0x45, 0x23, 0xA0, 0x52, 0x63, 0x47, 0x30, -0x53, 0x25, 0x05, 0xA0, 0x54, 0x43, 0x29, 0x30, 0x55, 0x04, 0xE7, 0xA0, 0x56, 0x23, 0x0B, 0x30, -0x56, 0xEE, 0x04, 0x20, 0x58, 0x02, 0xED, 0x30, 0x58, 0xCD, 0xE6, 0x20, 0x59, 0xE2, 0xCF, 0x30, -0x5A, 0xAD, 0xC8, 0x20, 0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x8D, 0xAA, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, -0x5E, 0x6D, 0x8C, 0x20, 0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x56, 0xA8, 0xA0, 0x61, 0x6B, 0x91, 0xB0, -0x62, 0x36, 0x8A, 0xA0, 0x63, 0x4B, 0x73, 0xB0, 0x64, 0x16, 0x6C, 0xA0, 0x65, 0x2B, 0x55, 0xB0, -0x65, 0xF6, 0x4E, 0xA0, 0x67, 0x14, 0x72, 0x30, 0x67, 0xD6, 0x30, 0xA0, 0x68, 0xF4, 0x54, 0x30, -0x69, 0xB6, 0x12, 0xA0, 0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x9F, 0x2F, 0x20, 0x6C, 0xB4, 0x18, 0x30, -0x6D, 0x7F, 0x11, 0x20, 0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x5E, 0xF3, 0x20, 0x70, 0x7D, 0x16, 0xB0, -0x71, 0x3E, 0xD5, 0x20, 0x72, 0x5C, 0xF8, 0xB0, 0x73, 0x1E, 0xB7, 0x20, 0x74, 0x3C, 0xDA, 0xB0, -0x75, 0x07, 0xD3, 0xA0, 0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xE7, 0xB5, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, -0x78, 0xC7, 0x97, 0xA0, 0x79, 0xDC, 0x80, 0xB0, 0x7A, 0xA7, 0x79, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, -0x7C, 0x87, 0x5B, 0xA0, 0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x67, 0x3D, 0xA0, 0x7F, 0x85, 0x61, 0x30, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, -0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, -0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, -0x00, 0x00, 0x00, - -/* America/Costa_Rica */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xA3, 0xE8, 0x16, 0x54, -0x11, 0x36, 0x49, 0x60, 0x11, 0xB7, 0x6E, 0x50, 0x13, 0x16, 0x2B, 0x60, 0x13, 0x97, 0x50, 0x50, -0x27, 0x97, 0xE0, 0x60, 0x28, 0x6E, 0xB6, 0xD0, 0x29, 0x77, 0xC2, 0x60, 0x29, 0xC2, 0xD9, 0xD0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xB1, 0x2C, 0x00, 0x00, 0xFF, -0xFF, 0xB9, 0xB0, 0x01, 0x05, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x09, 0x53, 0x4A, 0x4D, 0x54, 0x00, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, -0x7C, 0x75, 0x00, 0x92, 0x9C, 0x8D, 0x00, 0x00, 0x00, 0x00, - -/* America/Cuiaba */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7B, 0x94, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x23, 0x58, 0x1E, 0xC0, 0x23, 0xE2, 0x7E, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x25, 0xD4, 0xD5, 0x30, -0x27, 0x21, 0x1D, 0x40, 0x27, 0xBD, 0xF1, 0xB0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0x94, 0x99, 0x30, -0x2A, 0xEA, 0x1B, 0xC0, 0x2B, 0x6B, 0x40, 0xB0, 0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, -0x2E, 0xA0, 0xA5, 0x40, 0x2F, 0x46, 0xB4, 0x30, 0x30, 0x80, 0x87, 0x40, 0x31, 0x1D, 0x5B, 0xB0, -0x32, 0x57, 0x2E, 0xC0, 0x33, 0x06, 0x78, 0x30, 0x34, 0x38, 0x62, 0x40, 0x34, 0xF8, 0xCF, 0x30, -0x36, 0x20, 0x2D, 0x40, 0x36, 0xCF, 0x76, 0xB0, 0x37, 0xF6, 0xD4, 0xC0, 0x38, 0xB8, 0x93, 0x30, -0x39, 0xDF, 0xF1, 0x40, 0x3A, 0x8F, 0x3A, 0xB0, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x6F, 0x1C, 0xB0, -0x3D, 0xC4, 0x9F, 0x40, 0x3E, 0x4E, 0xFE, 0xB0, 0x41, 0x87, 0x06, 0x40, 0x42, 0x17, 0xFD, 0x30, -0x43, 0x51, 0xD0, 0x40, 0x43, 0xF7, 0xDF, 0x30, 0x45, 0x4D, 0x61, 0xC0, 0x45, 0xE0, 0xFB, 0xB0, -0x47, 0x11, 0x94, 0x40, 0x47, 0xB7, 0xA3, 0x30, 0x48, 0xFA, 0xB0, 0xC0, 0x49, 0x97, 0x85, 0x30, -0x4A, 0xDA, 0x92, 0xC0, 0x4B, 0x80, 0xA1, 0xB0, 0x4C, 0xBA, 0x74, 0xC0, 0x4D, 0x60, 0x83, 0xB0, -0x4E, 0x9A, 0x56, 0xC0, 0x4F, 0x49, 0xA0, 0x30, 0x50, 0x83, 0x73, 0x40, 0x51, 0x20, 0x47, 0xB0, -0x52, 0x63, 0x55, 0x40, 0x53, 0x00, 0x29, 0xB0, 0x54, 0x43, 0x37, 0x40, 0x54, 0xE9, 0x46, 0x30, -0x56, 0x23, 0x19, 0x40, 0x56, 0xC9, 0x28, 0x30, 0x58, 0x02, 0xFB, 0x40, 0x58, 0xA9, 0x0A, 0x30, -0x59, 0xE2, 0xDD, 0x40, 0x5A, 0x88, 0xEC, 0x30, 0x5B, 0xCB, 0xF9, 0xC0, 0x5C, 0x68, 0xCE, 0x30, -0x5D, 0xAB, 0xDB, 0xC0, 0x5E, 0x48, 0xB0, 0x30, 0x5F, 0x8B, 0xBD, 0xC0, 0x60, 0x31, 0xCC, 0xB0, -0x61, 0x6B, 0x9F, 0xC0, 0x62, 0x11, 0xAE, 0xB0, 0x63, 0x4B, 0x81, 0xC0, 0x63, 0xFA, 0xCB, 0x30, -0x65, 0x2B, 0x63, 0xC0, 0x65, 0xD1, 0x72, 0xB0, 0x67, 0x14, 0x80, 0x40, 0x67, 0xB1, 0x54, 0xB0, -0x68, 0xF4, 0x62, 0x40, 0x69, 0x9A, 0x71, 0x30, 0x6A, 0xD4, 0x44, 0x40, 0x6B, 0x7A, 0x53, 0x30, -0x6C, 0xB4, 0x26, 0x40, 0x6D, 0x5A, 0x35, 0x30, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x3A, 0x17, 0x30, -0x70, 0x7D, 0x24, 0xC0, 0x71, 0x19, 0xF9, 0x30, 0x72, 0x5D, 0x06, 0xC0, 0x72, 0xF9, 0xDB, 0x30, -0x74, 0x3C, 0xE8, 0xC0, 0x74, 0xD9, 0xBD, 0x30, 0x76, 0x1C, 0xCA, 0xC0, 0x76, 0xC2, 0xD9, 0xB0, -0x77, 0xFC, 0xAC, 0xC0, 0x78, 0xAB, 0xF6, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x82, 0x9D, 0xB0, -0x7B, 0xC5, 0xAB, 0x40, 0x7C, 0x62, 0x7F, 0xB0, 0x7D, 0xA5, 0x8D, 0x40, 0x7E, 0x4B, 0x9C, 0x30, -0x7F, 0x85, 0x6F, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0xFF, 0xFF, 0xCB, 0x6C, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x54, 0xBD, 0x00, 0xBD, 0x56, 0x0D, 0x00, -0x00, 0x00, 0x0B, 0x4D, 0x61, 0x74, 0x6F, 0x20, 0x47, 0x72, 0x6F, 0x73, 0x73, 0x6F, - -/* America/Curacao */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x1E, 0x2E, 0x20, -0xF6, 0x98, 0xEC, 0x48, 0x01, 0x02, 0xFF, 0xFF, 0xBF, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0xB8, -0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4E, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0xEB, 0x5D, 0x00, 0xA9, -0x5F, 0x60, 0x00, 0x00, 0x00, 0x00, - -/* America/Danmarkshavn */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x9B, 0x80, 0x49, 0x00, -0x13, 0x4D, 0x7C, 0x50, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x30, 0xE7, 0x4E, 0x30, 0x01, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x05, 0xFF, 0xFF, 0xEE, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, -0xE3, 0xE0, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x47, -0x54, 0x00, 0x57, 0x47, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0xFE, 0x77, 0x3A, 0x00, 0xF8, 0x35, 0xAA, 0x00, -0x00, 0x00, 0x21, 0x65, 0x61, 0x73, 0x74, 0x20, 0x63, 0x6F, 0x61, 0x73, 0x74, 0x2C, 0x20, 0x6E, -0x6F, 0x72, 0x74, 0x68, 0x20, 0x6F, 0x66, 0x20, 0x53, 0x63, 0x6F, 0x72, 0x65, 0x73, 0x62, 0x79, -0x73, 0x75, 0x6E, 0x64, - -/* America/Dawson */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xCB, 0xB0, -0x9F, 0xBB, 0x23, 0xA0, 0xA0, 0xD0, 0x0C, 0xB0, 0xA1, 0xA2, 0xD2, 0x80, 0xCB, 0x89, 0x28, 0xB0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0xA2, 0x10, -0x07, 0x30, 0xEC, 0x90, 0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, -0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, -0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, -0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, -0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, -0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, -0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, -0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, -0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, -0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, -0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, -0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, -0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, -0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, -0x47, 0x2D, 0x8A, 0x10, 0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, -0x4A, 0xED, 0x4E, 0x10, 0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, -0x4E, 0xB6, 0x4C, 0x90, 0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, -0x52, 0x76, 0x10, 0x90, 0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, -0x56, 0x35, 0xD4, 0x90, 0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, -0x59, 0xFE, 0xD3, 0x10, 0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, -0x5D, 0xBE, 0x97, 0x10, 0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, -0x61, 0x87, 0x95, 0x90, 0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, -0x65, 0x47, 0x59, 0x90, 0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, -0x69, 0x07, 0x1D, 0x90, 0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, -0x6C, 0xD0, 0x1C, 0x10, 0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, -0x70, 0x8F, 0xE0, 0x10, 0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, -0x74, 0x4F, 0xA4, 0x10, 0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, -0x78, 0x18, 0xA2, 0x90, 0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, -0x7B, 0xD8, 0x66, 0x90, 0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, -0x7F, 0x98, 0x2A, 0x90, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0xFF, 0xFF, -0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, -0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x15, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x19, 0x59, 0x44, 0x54, 0x00, -0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, 0x54, 0x00, 0x59, 0x44, 0x44, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xEB, 0x16, 0x4A, 0x00, 0x3F, 0x32, 0x62, 0x00, -0x00, 0x00, 0x1A, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, -0x2D, 0x20, 0x6E, 0x6F, 0x72, 0x74, 0x68, 0x20, 0x59, 0x75, 0x6B, 0x6F, 0x6E, - -/* America/Dawson_Creek */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xB8, 0xBD, 0xA0, -0x9F, 0xC0, 0x5B, 0x90, 0xCB, 0x89, 0x1A, 0xA0, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, -0xD5, 0x55, 0xF1, 0x20, 0xD6, 0x20, 0xEA, 0x10, 0xD7, 0x35, 0xD3, 0x20, 0xD8, 0x00, 0xCC, 0x10, -0xD9, 0x15, 0xB5, 0x20, 0xD9, 0xE0, 0xAE, 0x10, 0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, -0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, 0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, -0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, -0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, -0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, -0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, -0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, 0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, -0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, 0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, -0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, 0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, -0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, 0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, -0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, 0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, -0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, 0x04, 0x61, 0x27, 0xA0, 0x05, 0x01, 0xF0, 0x90, -0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, -0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x10, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, -0x57, 0x54, 0x00, 0x50, 0x50, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xE4, 0x86, 0x9A, 0x00, 0x5B, 0xE8, 0xA5, 0x00, 0x00, 0x00, -0x49, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, -0x72, 0x64, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x44, 0x61, 0x77, 0x73, 0x6F, 0x6E, -0x20, 0x43, 0x72, 0x65, 0x65, 0x6B, 0x20, 0x26, 0x20, 0x46, 0x6F, 0x72, 0x74, 0x20, 0x53, 0x61, -0x69, 0x6E, 0x74, 0x20, 0x4A, 0x6F, 0x68, 0x6E, 0x2C, 0x20, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, -0x68, 0x20, 0x43, 0x6F, 0x6C, 0x75, 0x6D, 0x62, 0x69, 0x61, - -/* America/Denver */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, -0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00, -0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xC5, 0xF7, -0x5C, 0x00, 0x75, 0x77, 0xF0, 0x00, 0x00, 0x00, 0x0D, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, -0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, - -/* America/Detroit */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x85, 0xBD, 0x22, 0x5B, -0x99, 0x3C, 0x94, 0x00, 0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, -0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, 0xFB, 0x33, 0xAC, 0x70, 0xFB, 0xE8, 0x3B, 0xE0, -0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, -0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, -0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x01, 0x02, 0x03, 0x04, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0xFF, 0xFF, 0xB2, 0x25, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xC9, 0xEB, 0xF2, 0x00, -0x94, 0x14, 0x87, 0x00, 0x00, 0x00, 0x28, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, -0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4D, 0x69, 0x63, 0x68, 0x69, 0x67, 0x61, 0x6E, 0x20, 0x2D, -0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* America/Dominica */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x4C, -0x01, 0xFF, 0xFF, 0xC6, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xAC, 0xD0, 0x00, 0xB6, 0x30, -0xA0, 0x00, 0x00, 0x00, 0x00, - -/* America/Edmonton */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x88, 0xDE, 0xCE, 0xE0, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xA0, 0x98, 0x91, 0x90, 0xA0, 0xD2, 0x85, 0x80, -0xA2, 0x8A, 0xE8, 0x90, 0xA3, 0x84, 0x06, 0x00, 0xA4, 0x6A, 0xCA, 0x90, 0xA5, 0x35, 0xC3, 0x80, -0xA6, 0x53, 0xE7, 0x10, 0xA7, 0x15, 0xA5, 0x80, 0xA8, 0x33, 0xC9, 0x10, 0xA8, 0xFE, 0xC2, 0x00, -0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, 0xFE, 0xB8, 0x39, 0x10, -0xFF, 0xA8, 0x1C, 0x00, 0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, -0x07, 0x30, 0xDE, 0x80, 0x08, 0x20, 0xDD, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xBF, 0x90, -0x0A, 0xF0, 0xA2, 0x80, 0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, -0x0E, 0xB9, 0xA1, 0x00, 0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, -0x12, 0x79, 0x65, 0x00, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, -0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, -0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, -0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, -0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, -0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, -0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, -0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, -0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, -0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, -0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, -0x47, 0x2D, 0x7C, 0x00, 0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, -0x4A, 0xED, 0x40, 0x00, 0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, -0x4E, 0xB6, 0x3E, 0x80, 0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, -0x52, 0x76, 0x02, 0x80, 0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, -0x56, 0x35, 0xC6, 0x80, 0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, -0x59, 0xFE, 0xC5, 0x00, 0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, -0x5D, 0xBE, 0x89, 0x00, 0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, -0x61, 0x87, 0x87, 0x80, 0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, -0x65, 0x47, 0x4B, 0x80, 0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, -0x69, 0x07, 0x0F, 0x80, 0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, -0x6C, 0xD0, 0x0E, 0x00, 0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, -0x70, 0x8F, 0xD2, 0x00, 0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, -0x74, 0x4F, 0x96, 0x00, 0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, -0x78, 0x18, 0x94, 0x80, 0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, -0x7B, 0xD8, 0x58, 0x80, 0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, -0x7F, 0x98, 0x1C, 0x80, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, -0x95, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, -0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, -0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xDB, 0x0A, 0x38, 0x00, 0x66, -0xF2, 0x2A, 0x00, 0x00, 0x00, 0x42, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x54, -0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x41, 0x6C, 0x62, 0x65, 0x72, 0x74, 0x61, 0x2C, 0x20, 0x65, -0x61, 0x73, 0x74, 0x20, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x43, 0x6F, 0x6C, 0x75, -0x6D, 0x62, 0x69, 0x61, 0x20, 0x26, 0x20, 0x77, 0x65, 0x73, 0x74, 0x20, 0x53, 0x61, 0x73, 0x6B, -0x61, 0x74, 0x63, 0x68, 0x65, 0x77, 0x61, 0x6E, - -/* America/Eirunepe */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0xAA, 0x88, 0x80, -0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40, -0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40, -0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40, -0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0, -0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0, -0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0, -0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0, -0x2C, 0xC0, 0xD1, 0x50, 0x2D, 0x66, 0xE0, 0x40, 0x48, 0x60, 0x7F, 0x50, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0xFF, 0xFF, 0xBE, 0x80, -0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x43, 0x53, 0x54, 0x00, 0x41, 0x43, 0x54, -0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x30, -0xEA, 0x00, 0xAA, 0xB1, 0xEA, 0x00, 0x00, 0x00, 0x0A, 0x57, 0x20, 0x41, 0x6D, 0x61, 0x7A, 0x6F, -0x6E, 0x61, 0x73, - -/* America/El_Salvador */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA3, 0xD5, 0xA6, 0x20, -0x20, 0x9A, 0xDC, 0xE0, 0x21, 0x5C, 0x9B, 0x50, 0x22, 0x7A, 0xBE, 0xE0, 0x23, 0x3C, 0x7D, 0x50, -0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xAC, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, 0x3B, 0xD0, 0x00, 0x8B, 0x29, -0x00, 0x00, 0x00, 0x00, 0x00, - -/* America/Ensenada */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0xA5, 0xB6, 0xF6, 0x80, -0xA9, 0x79, 0x4F, 0x70, 0xAF, 0xF2, 0x7C, 0xF0, 0xB6, 0x66, 0x64, 0x70, 0xB7, 0x1B, 0x10, 0x00, -0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x99, 0xBA, 0x70, -0xD7, 0x1B, 0x59, 0x00, 0xD8, 0x91, 0xB4, 0xF0, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, -0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, -0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, -0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, -0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, -0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, -0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, -0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, -0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, -0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, -0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, -0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, -0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, -0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, -0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, -0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, -0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, -0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, -0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, -0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x04, 0x05, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0x92, 0x4C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, -0x04, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, -0x90, 0x01, 0x10, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Fortaleza */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x6B, 0x18, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x39, 0xF2, 0x4A, 0x20, -0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xDB, 0xE8, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0xD8, 0x52, 0x00, 0xD9, 0x70, 0x10, 0x00, 0x00, 0x00, 0x1E, -0x4E, 0x45, 0x20, 0x42, 0x72, 0x61, 0x7A, 0x69, 0x6C, 0x20, 0x28, 0x4D, 0x41, 0x2C, 0x20, 0x50, -0x49, 0x2C, 0x20, 0x43, 0x45, 0x2C, 0x20, 0x52, 0x4E, 0x2C, 0x20, 0x50, 0x42, 0x29, - -/* America/Fort_Wayne */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80, -0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, -0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x89, -0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Glace_Bay */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xA8, 0x34, -0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50, 0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xED, 0xD0, 0xE0, 0x9E, 0x3F, 0x60, 0xE1, 0x69, 0x38, 0x50, 0x04, 0x60, 0xEF, 0x60, -0x05, 0x50, 0xD2, 0x50, 0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60, -0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, -0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, -0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, -0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, -0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, -0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, -0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0, -0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0, -0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60, -0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, -0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0, -0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0, -0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0, -0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60, -0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60, -0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60, -0x45, 0x44, 0x35, 0x50, 0x45, 0xF3, 0x9A, 0xE0, 0x47, 0x2D, 0x51, 0xD0, 0x47, 0xD3, 0x7C, 0xE0, -0x49, 0x0D, 0x33, 0xD0, 0x49, 0xB3, 0x5E, 0xE0, 0x4A, 0xED, 0x15, 0xD0, 0x4B, 0x9C, 0x7B, 0x60, -0x4C, 0xD6, 0x32, 0x50, 0x4D, 0x7C, 0x5D, 0x60, 0x4E, 0xB6, 0x14, 0x50, 0x4F, 0x5C, 0x3F, 0x60, -0x50, 0x95, 0xF6, 0x50, 0x51, 0x3C, 0x21, 0x60, 0x52, 0x75, 0xD8, 0x50, 0x53, 0x1C, 0x03, 0x60, -0x54, 0x55, 0xBA, 0x50, 0x54, 0xFB, 0xE5, 0x60, 0x56, 0x35, 0x9C, 0x50, 0x56, 0xE5, 0x01, 0xE0, -0x58, 0x1E, 0xB8, 0xD0, 0x58, 0xC4, 0xE3, 0xE0, 0x59, 0xFE, 0x9A, 0xD0, 0x5A, 0xA4, 0xC5, 0xE0, -0x5B, 0xDE, 0x7C, 0xD0, 0x5C, 0x84, 0xA7, 0xE0, 0x5D, 0xBE, 0x5E, 0xD0, 0x5E, 0x64, 0x89, 0xE0, -0x5F, 0x9E, 0x40, 0xD0, 0x60, 0x4D, 0xA6, 0x60, 0x61, 0x87, 0x5D, 0x50, 0x62, 0x2D, 0x88, 0x60, -0x63, 0x67, 0x3F, 0x50, 0x64, 0x0D, 0x6A, 0x60, 0x65, 0x47, 0x21, 0x50, 0x65, 0xED, 0x4C, 0x60, -0x67, 0x27, 0x03, 0x50, 0x67, 0xCD, 0x2E, 0x60, 0x69, 0x06, 0xE5, 0x50, 0x69, 0xAD, 0x10, 0x60, -0x6A, 0xE6, 0xC7, 0x50, 0x6B, 0x96, 0x2C, 0xE0, 0x6C, 0xCF, 0xE3, 0xD0, 0x6D, 0x76, 0x0E, 0xE0, -0x6E, 0xAF, 0xC5, 0xD0, 0x6F, 0x55, 0xF0, 0xE0, 0x70, 0x8F, 0xA7, 0xD0, 0x71, 0x35, 0xD2, 0xE0, -0x72, 0x6F, 0x89, 0xD0, 0x73, 0x15, 0xB4, 0xE0, 0x74, 0x4F, 0x6B, 0xD0, 0x74, 0xFE, 0xD1, 0x60, -0x76, 0x38, 0x88, 0x50, 0x76, 0xDE, 0xB3, 0x60, 0x78, 0x18, 0x6A, 0x50, 0x78, 0xBE, 0x95, 0x60, -0x79, 0xF8, 0x4C, 0x50, 0x7A, 0x9E, 0x77, 0x60, 0x7B, 0xD8, 0x2E, 0x50, 0x7C, 0x7E, 0x59, 0x60, -0x7D, 0xB8, 0x10, 0x50, 0x7E, 0x5E, 0x3B, 0x60, 0x7F, 0x97, 0xF2, 0x50, 0x02, 0x01, 0x02, 0x03, -0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC7, 0xCC, 0x00, 0x00, 0xFF, 0xFF, -0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, -0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, -0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0xCF, 0xD3, 0x1F, 0x00, 0xBA, 0x14, 0xB8, 0x00, 0x00, 0x00, 0x47, -0x41, 0x74, 0x6C, 0x61, 0x6E, 0x74, 0x69, 0x63, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, -0x4E, 0x6F, 0x76, 0x61, 0x20, 0x53, 0x63, 0x6F, 0x74, 0x69, 0x61, 0x20, 0x2D, 0x20, 0x70, 0x6C, -0x61, 0x63, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x64, 0x69, 0x64, 0x20, 0x6E, 0x6F, -0x74, 0x20, 0x6F, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x44, 0x53, 0x54, 0x20, 0x31, 0x39, -0x36, 0x36, 0x2D, 0x31, 0x39, 0x37, 0x31, - -/* America/Godthab */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x80, 0x68, 0x00, -0x13, 0x4D, 0x7C, 0x50, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xCF, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, -0xE0, 0x01, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x47, 0x54, 0x00, 0x57, 0x47, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0xEB, 0x43, 0xDD, 0x00, 0xC5, -0xF5, 0x15, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, -0x69, 0x6F, 0x6E, 0x73, - -/* America/Goose_Bay */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xCB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0x7E, 0x8C, -0x9F, 0xC0, 0x1C, 0x7C, 0xBE, 0x9E, 0x4D, 0x6C, 0xC0, 0xB8, 0x31, 0x38, 0xC1, 0x79, 0xEF, 0xA8, -0xC2, 0x98, 0x13, 0x38, 0xC3, 0x59, 0xD1, 0xA8, 0xC4, 0x77, 0xF5, 0x38, 0xC5, 0x39, 0xB3, 0xA8, -0xC6, 0x61, 0x11, 0xB8, 0xC7, 0x19, 0x95, 0xA8, 0xC8, 0x40, 0xF3, 0xB8, 0xC9, 0x02, 0xB2, 0x28, -0xCA, 0x20, 0xD5, 0xB8, 0xCA, 0xE2, 0x94, 0x28, 0xCC, 0x00, 0xB7, 0xB8, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xE6, 0xC8, 0xD3, 0x88, 0x44, 0xD8, 0xD4, 0x4A, 0x03, 0x48, 0xD5, 0x68, 0x26, 0xD8, -0xD6, 0x29, 0xE5, 0x48, 0xD7, 0x48, 0x08, 0xD8, 0xD8, 0x09, 0xC7, 0x48, 0xD9, 0x27, 0xEA, 0xD8, -0xD9, 0xE9, 0xA9, 0x48, 0xDB, 0x11, 0x07, 0x58, 0xDB, 0xD2, 0xC5, 0xC8, 0xDC, 0xDE, 0x74, 0x58, -0xDD, 0xA9, 0x6D, 0x48, 0xDE, 0xBE, 0x56, 0x58, 0xDF, 0x89, 0x4F, 0x48, 0xE0, 0x9E, 0x38, 0x58, -0xE1, 0x69, 0x31, 0x48, 0xE2, 0x7E, 0x1A, 0x58, 0xE3, 0x49, 0x13, 0x48, 0xE4, 0x5D, 0xFC, 0x58, -0xE5, 0x28, 0xF5, 0x48, 0xE6, 0x47, 0x18, 0xD8, 0xE7, 0x12, 0x11, 0xC8, 0xE8, 0x26, 0xFA, 0xD8, -0xE8, 0xF1, 0xF3, 0xC8, 0xEA, 0x06, 0xDC, 0xD8, 0xEA, 0xD1, 0xD5, 0xC8, 0xEB, 0xE6, 0xBE, 0xD8, -0xEC, 0xB1, 0xB7, 0xC8, 0xED, 0xC6, 0xA0, 0xD8, 0xEE, 0xBF, 0xBE, 0x48, 0xEF, 0xAF, 0xBD, 0x58, -0xF0, 0x9F, 0xA0, 0x48, 0xF1, 0x8F, 0x9F, 0x58, 0xF2, 0x7F, 0x82, 0x48, 0xF3, 0x6F, 0x81, 0x58, -0xF4, 0x5F, 0x64, 0x48, 0xF5, 0x4F, 0x63, 0x58, 0xF6, 0x3F, 0x46, 0x48, 0xF7, 0x2F, 0x45, 0x58, -0xF8, 0x28, 0x62, 0xC8, 0xF8, 0xDA, 0x6B, 0x58, 0xF9, 0x0F, 0x2E, 0x60, 0xFA, 0x08, 0x4B, 0xD0, -0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0, 0xFD, 0xC8, 0x0F, 0xD0, -0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0, 0x01, 0x87, 0xD3, 0xD0, -0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60, 0x05, 0x50, 0xD2, 0x50, -0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60, 0x09, 0x10, 0x96, 0x50, -0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, 0x0C, 0xD9, 0x94, 0xD0, -0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, 0x10, 0x99, 0x58, 0xD0, -0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0, -0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50, -0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50, -0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50, -0x20, 0x75, 0xD6, 0xFC, 0x21, 0x81, 0x69, 0x6C, 0x22, 0x55, 0xB8, 0xFC, 0x23, 0x6A, 0x77, 0xDC, -0x24, 0x35, 0x9A, 0xFC, 0x25, 0x4A, 0x67, 0xEC, 0x26, 0x15, 0x7C, 0xFC, 0x27, 0x2A, 0x49, 0xEC, -0x27, 0xFE, 0x99, 0x7C, 0x29, 0x0A, 0x2B, 0xEC, 0x29, 0xDE, 0x7B, 0x7C, 0x2A, 0xEA, 0x0D, 0xEC, -0x2B, 0xBE, 0x5D, 0x7C, 0x2C, 0xD3, 0x2A, 0x6C, 0x2D, 0x9E, 0x3F, 0x7C, 0x2E, 0xB3, 0x0C, 0x6C, -0x2F, 0x7E, 0x21, 0x7C, 0x30, 0x92, 0xEE, 0x6C, 0x31, 0x67, 0x3D, 0xFC, 0x32, 0x72, 0xD0, 0x6C, -0x33, 0x47, 0x1F, 0xFC, 0x34, 0x52, 0xB2, 0x6C, 0x35, 0x27, 0x01, 0xFC, 0x36, 0x32, 0x94, 0x6C, -0x37, 0x06, 0xE3, 0xFC, 0x38, 0x1B, 0xB0, 0xEC, 0x38, 0xE6, 0xC5, 0xFC, 0x39, 0xFB, 0x92, 0xEC, -0x3A, 0xC6, 0xA7, 0xFC, 0x3B, 0xDB, 0x74, 0xEC, 0x3C, 0xAF, 0xC4, 0x7C, 0x3D, 0xBB, 0x56, 0xEC, -0x3E, 0x8F, 0xA6, 0x7C, 0x3F, 0x9B, 0x38, 0xEC, 0x40, 0x6F, 0x88, 0x7C, 0x41, 0x84, 0x55, 0x6C, -0x42, 0x4F, 0x6A, 0x7C, 0x43, 0x64, 0x37, 0x6C, 0x44, 0x2F, 0x4C, 0x7C, 0x45, 0x44, 0x19, 0x6C, -0x45, 0xF3, 0x7E, 0xFC, 0x47, 0x2D, 0x35, 0xEC, 0x47, 0xD3, 0x60, 0xFC, 0x49, 0x0D, 0x17, 0xEC, -0x49, 0xB3, 0x42, 0xFC, 0x4A, 0xEC, 0xF9, 0xEC, 0x4B, 0x9C, 0x5F, 0x7C, 0x4C, 0xD6, 0x16, 0x6C, -0x4D, 0x7C, 0x41, 0x7C, 0x4E, 0xB5, 0xF8, 0x6C, 0x4F, 0x5C, 0x23, 0x7C, 0x50, 0x95, 0xDA, 0x6C, -0x51, 0x3C, 0x05, 0x7C, 0x52, 0x75, 0xBC, 0x6C, 0x53, 0x1B, 0xE7, 0x7C, 0x54, 0x55, 0x9E, 0x6C, -0x54, 0xFB, 0xC9, 0x7C, 0x56, 0x35, 0x80, 0x6C, 0x56, 0xE4, 0xE5, 0xFC, 0x58, 0x1E, 0x9C, 0xEC, -0x58, 0xC4, 0xC7, 0xFC, 0x59, 0xFE, 0x7E, 0xEC, 0x5A, 0xA4, 0xA9, 0xFC, 0x5B, 0xDE, 0x60, 0xEC, -0x5C, 0x84, 0x8B, 0xFC, 0x5D, 0xBE, 0x42, 0xEC, 0x5E, 0x64, 0x6D, 0xFC, 0x5F, 0x9E, 0x24, 0xEC, -0x60, 0x4D, 0x8A, 0x7C, 0x61, 0x87, 0x41, 0x6C, 0x62, 0x2D, 0x6C, 0x7C, 0x63, 0x67, 0x23, 0x6C, -0x64, 0x0D, 0x4E, 0x7C, 0x65, 0x47, 0x05, 0x6C, 0x65, 0xED, 0x30, 0x7C, 0x67, 0x26, 0xE7, 0x6C, -0x67, 0xCD, 0x12, 0x7C, 0x69, 0x06, 0xC9, 0x6C, 0x69, 0xAC, 0xF4, 0x7C, 0x6A, 0xE6, 0xAB, 0x6C, -0x6B, 0x96, 0x10, 0xFC, 0x6C, 0xCF, 0xC7, 0xEC, 0x6D, 0x75, 0xF2, 0xFC, 0x6E, 0xAF, 0xA9, 0xEC, -0x6F, 0x55, 0xD4, 0xFC, 0x70, 0x8F, 0x8B, 0xEC, 0x71, 0x35, 0xB6, 0xFC, 0x72, 0x6F, 0x6D, 0xEC, -0x73, 0x15, 0x98, 0xFC, 0x74, 0x4F, 0x4F, 0xEC, 0x74, 0xFE, 0xB5, 0x7C, 0x76, 0x38, 0x6C, 0x6C, -0x76, 0xDE, 0x97, 0x7C, 0x78, 0x18, 0x4E, 0x6C, 0x78, 0xBE, 0x79, 0x7C, 0x79, 0xF8, 0x30, 0x6C, -0x7A, 0x9E, 0x5B, 0x7C, 0x7B, 0xD8, 0x12, 0x6C, 0x7C, 0x7E, 0x3D, 0x7C, 0x7D, 0xB7, 0xF4, 0x6C, -0x7E, 0x5E, 0x1F, 0x7C, 0x7F, 0x97, 0xD6, 0x6C, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x05, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x08, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0xFF, 0xFF, 0xCE, 0x94, 0x00, 0x00, 0xFF, 0xFF, 0xDC, 0xA4, 0x01, 0x04, 0xFF, -0xFF, 0xCE, 0xC8, 0x00, 0x00, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x04, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, -0x08, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0xFF, 0xFF, 0xC7, -0xC0, 0x00, 0x14, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x18, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x44, 0x54, -0x00, 0x4E, 0x50, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, -0x00, 0x41, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDA, 0xB5, 0x95, 0x00, 0xB7, 0xBD, 0xC2, -0x00, 0x00, 0x00, 0x29, 0x41, 0x74, 0x6C, 0x61, 0x6E, 0x74, 0x69, 0x63, 0x20, 0x54, 0x69, 0x6D, -0x65, 0x20, 0x2D, 0x20, 0x4C, 0x61, 0x62, 0x72, 0x61, 0x64, 0x6F, 0x72, 0x20, 0x2D, 0x20, 0x6D, -0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* America/Grand_Turk */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x86, 0x35, 0x00, 0x00, 0x00, 0x00, - -/* America/Grenada */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x34, 0x64, -0x01, 0xFF, 0xFF, 0xC6, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0xB7, 0x48, 0x00, 0xB6, 0xB9, -0x58, 0x00, 0x00, 0x00, 0x00, - -/* America/Guadeloupe */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0x19, 0x65, 0x00, 0xB6, 0x64, -0xB5, 0x00, 0x00, 0x00, 0x00, - -/* America/Guatemala */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9F, 0x9D, 0xEA, 0xDC, -0x07, 0x55, 0xAC, 0x60, 0x07, 0xCD, 0x96, 0xD0, 0x19, 0x2C, 0x78, 0x60, 0x19, 0xCF, 0xE4, 0x50, -0x27, 0xEA, 0xEE, 0xE0, 0x28, 0xC8, 0x5C, 0xD0, 0x44, 0x54, 0x52, 0x60, 0x45, 0x1F, 0x4B, 0x50, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xAB, 0x24, 0x00, 0x00, 0xFF, -0xFF, 0xB9, 0xB0, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, -0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0xA8, -0x65, 0x00, 0x8A, 0x1E, 0x12, 0x00, 0x00, 0x00, 0x00, - -/* America/Guayaquil */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xB6, 0xA4, 0x42, 0x18, -0x01, 0xFF, 0xFF, 0xB6, 0x68, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x51, 0x4D, 0x54, -0x00, 0x45, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x88, 0x1A, 0x00, 0x9B, 0x62, -0xA5, 0x00, 0x00, 0x00, 0x08, 0x6D, 0x61, 0x69, 0x6E, 0x6C, 0x61, 0x6E, 0x64, - -/* America/Guyana */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x98, 0xD9, 0x79, 0x88, -0xF9, 0x39, 0x3E, 0xBC, 0x0A, 0x7D, 0xB4, 0x3C, 0x27, 0x7F, 0xFB, 0x30, 0x01, 0x02, 0x03, 0x04, -0xFF, 0xFF, 0xC9, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0xCB, 0x44, 0x00, 0x04, 0xFF, 0xFF, 0xCB, 0x44, -0x00, 0x09, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, -0x54, 0x00, 0x47, 0x42, 0x47, 0x54, 0x00, 0x47, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x93, 0xB4, 0x80, 0x00, 0xBA, 0x69, 0x5A, 0x00, 0x00, 0x00, -0x00, - -/* America/Halifax */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xAB, 0xA0, -0x9A, 0xE4, 0xDE, 0xC0, 0x9B, 0xD6, 0x13, 0x30, 0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50, -0xA2, 0x9D, 0x17, 0x40, 0xA3, 0x30, 0xB1, 0x30, 0xA4, 0x7A, 0x56, 0x40, 0xA5, 0x1B, 0x1F, 0x30, -0xA6, 0x53, 0xA0, 0xC0, 0xA6, 0xFC, 0x52, 0xB0, 0xA8, 0x3C, 0xBD, 0x40, 0xA8, 0xDC, 0x34, 0xB0, -0xAA, 0x1C, 0x9F, 0x40, 0xAA, 0xCD, 0x3A, 0x30, 0xAB, 0xFC, 0x81, 0x40, 0xAC, 0xBF, 0x91, 0x30, -0xAD, 0xEE, 0xD8, 0x40, 0xAE, 0x8C, 0xFE, 0x30, 0xAF, 0xBC, 0x45, 0x40, 0xB0, 0x7F, 0x55, 0x30, -0xB1, 0xAE, 0x9C, 0x40, 0xB2, 0x4B, 0x70, 0xB0, 0xB3, 0x8E, 0x7E, 0x40, 0xB4, 0x24, 0xBB, 0x30, -0xB5, 0x6E, 0x60, 0x40, 0xB6, 0x15, 0xC0, 0xB0, 0xB7, 0x4E, 0x42, 0x40, 0xB8, 0x08, 0x17, 0xB0, -0xB9, 0x24, 0xE9, 0xC0, 0xB9, 0xE7, 0xF9, 0xB0, 0xBB, 0x04, 0xCB, 0xC0, 0xBB, 0xD1, 0x16, 0x30, -0xBD, 0x00, 0x5D, 0x40, 0xBD, 0x9D, 0x31, 0xB0, 0xBE, 0xF2, 0xB4, 0x40, 0xBF, 0x90, 0xDA, 0x30, -0xC0, 0xD3, 0xE7, 0xC0, 0xC1, 0x5E, 0x47, 0x30, 0xC2, 0x8D, 0x8E, 0x40, 0xC3, 0x50, 0x9E, 0x30, -0xC4, 0x6D, 0x70, 0x40, 0xC5, 0x30, 0x80, 0x30, 0xC6, 0x72, 0x3C, 0x40, 0xC7, 0x10, 0x62, 0x30, -0xC8, 0x36, 0x6E, 0xC0, 0xC8, 0xF9, 0x7E, 0xB0, 0xCA, 0x16, 0x50, 0xC0, 0xCA, 0xD9, 0x60, 0xB0, -0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xD3, 0x75, 0xD6, 0xE0, -0xD4, 0x40, 0xCF, 0xD0, 0xD5, 0x55, 0xB8, 0xE0, 0xD6, 0x20, 0xB1, 0xD0, 0xD7, 0x35, 0x9A, 0xE0, -0xD8, 0x00, 0x93, 0xD0, 0xD9, 0x15, 0x7C, 0xE0, 0xD9, 0xE0, 0x75, 0xD0, 0xDC, 0xDE, 0x7B, 0x60, -0xDD, 0xA9, 0x74, 0x50, 0xDE, 0xBE, 0x5D, 0x60, 0xDF, 0x89, 0x56, 0x50, 0xE0, 0x9E, 0x3F, 0x60, -0xE1, 0x69, 0x38, 0x50, 0xE2, 0x7E, 0x21, 0x60, 0xE3, 0x49, 0x1A, 0x50, 0xE6, 0x47, 0x1F, 0xE0, -0xE7, 0x12, 0x18, 0xD0, 0xE8, 0x27, 0x01, 0xE0, 0xE8, 0xF1, 0xFA, 0xD0, 0xEA, 0x06, 0xE3, 0xE0, -0xEA, 0xD1, 0xDC, 0xD0, 0xEB, 0xE6, 0xC5, 0xE0, 0xEC, 0xB1, 0xBE, 0xD0, 0xF1, 0x8F, 0xA6, 0x60, -0xF2, 0x7F, 0x89, 0x50, 0xF3, 0x6F, 0x88, 0x60, 0xF4, 0x5F, 0x6B, 0x50, 0xF5, 0x4F, 0x6A, 0x60, -0xF6, 0x3F, 0x4D, 0x50, 0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x69, 0xD0, 0xF9, 0x0F, 0x2E, 0x60, -0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0, -0xFD, 0xC8, 0x0F, 0xD0, 0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0, -0x01, 0x87, 0xD3, 0xD0, 0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60, -0x05, 0x50, 0xD2, 0x50, 0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60, -0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, -0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, -0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, -0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, -0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, -0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, -0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0, -0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0, -0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60, -0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, -0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0, -0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0, -0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0, -0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60, -0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60, -0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60, -0x45, 0x44, 0x35, 0x50, 0x45, 0xF3, 0x9A, 0xE0, 0x47, 0x2D, 0x51, 0xD0, 0x47, 0xD3, 0x7C, 0xE0, -0x49, 0x0D, 0x33, 0xD0, 0x49, 0xB3, 0x5E, 0xE0, 0x4A, 0xED, 0x15, 0xD0, 0x4B, 0x9C, 0x7B, 0x60, -0x4C, 0xD6, 0x32, 0x50, 0x4D, 0x7C, 0x5D, 0x60, 0x4E, 0xB6, 0x14, 0x50, 0x4F, 0x5C, 0x3F, 0x60, -0x50, 0x95, 0xF6, 0x50, 0x51, 0x3C, 0x21, 0x60, 0x52, 0x75, 0xD8, 0x50, 0x53, 0x1C, 0x03, 0x60, -0x54, 0x55, 0xBA, 0x50, 0x54, 0xFB, 0xE5, 0x60, 0x56, 0x35, 0x9C, 0x50, 0x56, 0xE5, 0x01, 0xE0, -0x58, 0x1E, 0xB8, 0xD0, 0x58, 0xC4, 0xE3, 0xE0, 0x59, 0xFE, 0x9A, 0xD0, 0x5A, 0xA4, 0xC5, 0xE0, -0x5B, 0xDE, 0x7C, 0xD0, 0x5C, 0x84, 0xA7, 0xE0, 0x5D, 0xBE, 0x5E, 0xD0, 0x5E, 0x64, 0x89, 0xE0, -0x5F, 0x9E, 0x40, 0xD0, 0x60, 0x4D, 0xA6, 0x60, 0x61, 0x87, 0x5D, 0x50, 0x62, 0x2D, 0x88, 0x60, -0x63, 0x67, 0x3F, 0x50, 0x64, 0x0D, 0x6A, 0x60, 0x65, 0x47, 0x21, 0x50, 0x65, 0xED, 0x4C, 0x60, -0x67, 0x27, 0x03, 0x50, 0x67, 0xCD, 0x2E, 0x60, 0x69, 0x06, 0xE5, 0x50, 0x69, 0xAD, 0x10, 0x60, -0x6A, 0xE6, 0xC7, 0x50, 0x6B, 0x96, 0x2C, 0xE0, 0x6C, 0xCF, 0xE3, 0xD0, 0x6D, 0x76, 0x0E, 0xE0, -0x6E, 0xAF, 0xC5, 0xD0, 0x6F, 0x55, 0xF0, 0xE0, 0x70, 0x8F, 0xA7, 0xD0, 0x71, 0x35, 0xD2, 0xE0, -0x72, 0x6F, 0x89, 0xD0, 0x73, 0x15, 0xB4, 0xE0, 0x74, 0x4F, 0x6B, 0xD0, 0x74, 0xFE, 0xD1, 0x60, -0x76, 0x38, 0x88, 0x50, 0x76, 0xDE, 0xB3, 0x60, 0x78, 0x18, 0x6A, 0x50, 0x78, 0xBE, 0x95, 0x60, -0x79, 0xF8, 0x4C, 0x50, 0x7A, 0x9E, 0x77, 0x60, 0x7B, 0xD8, 0x2E, 0x50, 0x7C, 0x7E, 0x59, 0x60, -0x7D, 0xB8, 0x10, 0x50, 0x7E, 0x5E, 0x3B, 0x60, 0x7F, 0x97, 0xF2, 0x50, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0xFF, 0xFF, 0xC4, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0x4C, 0x4D, -0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xCD, 0x75, 0xA8, -0x00, 0xB3, 0x71, 0x80, 0x00, 0x00, 0x00, 0x2E, 0x41, 0x74, 0x6C, 0x61, 0x6E, 0x74, 0x69, 0x63, -0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4E, 0x6F, 0x76, 0x61, 0x20, 0x53, 0x63, 0x6F, -0x74, 0x69, 0x61, 0x20, 0x28, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x70, 0x6C, 0x61, 0x63, 0x65, 0x73, -0x29, 0x2C, 0x20, 0x50, 0x45, 0x49, - -/* America/Havana */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0xAC, 0x62, 0xC2, 0x80, -0xB1, 0xD3, 0x94, 0x50, 0xB2, 0x74, 0x5D, 0x40, 0xC8, 0x5B, 0x66, 0xD0, 0xC8, 0xD3, 0x51, 0x40, -0xCA, 0x3B, 0x48, 0xD0, 0xCA, 0xBC, 0x6D, 0xC0, 0xCC, 0x24, 0x65, 0x50, 0xCC, 0x9C, 0x4F, 0xC0, -0xD1, 0xC4, 0x0B, 0x50, 0xD2, 0x3B, 0xF5, 0xC0, 0xD3, 0xA3, 0xED, 0x50, 0xD4, 0x1B, 0xD7, 0xC0, -0xF7, 0x60, 0x05, 0xD0, 0xF7, 0xFF, 0x7D, 0x40, 0xF9, 0x3D, 0x44, 0xD0, 0xF9, 0xE3, 0x53, 0xC0, -0xFA, 0xDB, 0x3B, 0xD0, 0xFB, 0xA7, 0x86, 0x40, 0xFC, 0xC5, 0xA9, 0xD0, 0xFD, 0x87, 0x68, 0x40, -0xFE, 0xB8, 0x00, 0xD0, 0xFF, 0xA7, 0xE3, 0xC0, 0x00, 0x97, 0xE2, 0xD0, 0x01, 0x87, 0xC5, 0xC0, -0x02, 0x77, 0xC4, 0xD0, 0x03, 0x70, 0xE2, 0x40, 0x04, 0x60, 0xE1, 0x50, 0x05, 0x35, 0x14, 0xC0, -0x06, 0x40, 0xC3, 0x50, 0x07, 0x16, 0x48, 0x40, 0x08, 0x20, 0xA5, 0x50, 0x08, 0xF7, 0x7B, 0xC0, -0x0A, 0x00, 0x87, 0x50, 0x0A, 0xF0, 0x6A, 0x40, 0x0B, 0xE0, 0x69, 0x50, 0x0C, 0xD9, 0x86, 0xC0, -0x0D, 0xC0, 0x4B, 0x50, 0x0E, 0xB9, 0x68, 0xC0, 0x0F, 0xB2, 0xA2, 0x50, 0x10, 0x7D, 0x9B, 0x40, -0x11, 0x51, 0xEA, 0xD0, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x31, 0xCC, 0xD0, 0x14, 0x46, 0x99, 0xC0, -0x15, 0x5B, 0x82, 0xD0, 0x16, 0x26, 0x7B, 0xC0, 0x17, 0x3B, 0x64, 0xD0, 0x18, 0x06, 0x5D, 0xC0, -0x19, 0x1B, 0x46, 0xD0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xFB, 0x28, 0xD0, 0x1B, 0xCF, 0x5C, 0x40, -0x1C, 0xDB, 0x0A, 0xD0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x7A, 0x53, 0x50, 0x1F, 0x8F, 0x20, 0x40, -0x20, 0x5A, 0x35, 0x50, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x43, 0x51, 0xD0, 0x23, 0x4E, 0xE4, 0x40, -0x24, 0x23, 0x33, 0xD0, 0x25, 0x2E, 0xC6, 0x40, 0x26, 0x15, 0x8A, 0xD0, 0x27, 0x17, 0xE2, 0xC0, -0x27, 0xFE, 0xA7, 0x50, 0x28, 0xF7, 0xD2, 0xD0, 0x29, 0xDE, 0x89, 0x50, 0x2A, 0xD7, 0xB4, 0xD0, -0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xB7, 0x96, 0xD0, 0x2D, 0x9E, 0x4D, 0x50, 0x2E, 0x97, 0x78, 0xD0, -0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x77, 0x5A, 0xD0, 0x31, 0x67, 0x4B, 0xD0, 0x32, 0x57, 0x3C, 0xD0, -0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50, -0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0, -0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0, -0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50, -0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50, -0x49, 0xBC, 0x8B, 0x50, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xA5, 0xA7, 0xD0, 0x4C, 0xCC, 0xF7, 0xD0, -0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x65, 0x6B, 0xD0, 0x50, 0x8C, 0xBB, 0xD0, -0x51, 0x45, 0x4D, 0xD0, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x25, 0x2F, 0xD0, 0x54, 0x4C, 0x7F, 0xD0, -0x55, 0x05, 0x11, 0xD0, 0x56, 0x2C, 0x61, 0xD0, 0x56, 0xEE, 0x2E, 0x50, 0x58, 0x15, 0x7E, 0x50, -0x58, 0xCE, 0x10, 0x50, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xAD, 0xF2, 0x50, 0x5B, 0xD5, 0x42, 0x50, -0x5C, 0x8D, 0xD4, 0x50, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x6D, 0xB6, 0x50, 0x5F, 0x95, 0x06, 0x50, -0x60, 0x56, 0xD2, 0xD0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x36, 0xB4, 0xD0, 0x63, 0x5E, 0x04, 0xD0, -0x64, 0x16, 0x96, 0xD0, 0x65, 0x3D, 0xE6, 0xD0, 0x65, 0xF6, 0x78, 0xD0, 0x67, 0x1D, 0xC8, 0xD0, -0x67, 0xD6, 0x5A, 0xD0, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xB6, 0x3C, 0xD0, 0x6A, 0xDD, 0x8C, 0xD0, -0x6B, 0x9F, 0x59, 0x50, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x7F, 0x3B, 0x50, 0x6E, 0xA6, 0x8B, 0x50, -0x6F, 0x5F, 0x1D, 0x50, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x3E, 0xFF, 0x50, 0x72, 0x66, 0x4F, 0x50, -0x73, 0x1E, 0xE1, 0x50, 0x74, 0x46, 0x31, 0x50, 0x75, 0x07, 0xFD, 0xD0, 0x76, 0x2F, 0x4D, 0xD0, -0x76, 0xE7, 0xDF, 0xD0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xC7, 0xC1, 0xD0, 0x79, 0xEF, 0x11, 0xD0, -0x7A, 0xA7, 0xA3, 0xD0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0x87, 0x85, 0xD0, 0x7D, 0xAE, 0xD5, 0xD0, -0x7E, 0x67, 0x67, 0xD0, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0xFF, 0xFF, 0xB2, 0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x04, 0x48, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAC, 0xA0, 0xB5, 0x00, 0x96, 0x18, 0x7A, 0x00, -0x00, 0x00, 0x00, - -/* America/Hermosillo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xCB, 0xEA, 0x71, 0x60, 0xD8, 0x91, 0xB4, 0xF0, 0x00, 0x00, 0x70, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, 0x97, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x9D, -0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x0C, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB5, 0xAE, 0x6A, 0x00, 0x6C, 0x49, 0x5A, 0x00, 0x00, 0x00, 0x1F, 0x4D, -0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, -0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x53, 0x6F, 0x6E, 0x6F, 0x72, 0x61, - -/* America/Indiana/Indianapolis */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80, -0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, -0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC6, -0x02, 0xC1, 0x00, 0x8F, 0xAC, 0x7D, 0x00, 0x00, 0x00, 0x27, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, -0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x49, 0x6E, 0x64, 0x69, 0x61, 0x6E, 0x61, -0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, -0x73, - -/* America/Indiana/Knox */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, -0xF1, 0x8F, 0xC2, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, -0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, -0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, -0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, -0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, -0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, -0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, -0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, -0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, -0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, -0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, -0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, -0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, -0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, -0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, -0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, -0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, -0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xC8, 0x57, 0x6F, 0x00, 0x90, 0x62, 0xE4, 0x00, 0x00, 0x00, -0x26, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, -0x49, 0x6E, 0x64, 0x69, 0x61, 0x6E, 0x61, 0x20, 0x2D, 0x20, 0x53, 0x74, 0x61, 0x72, 0x6B, 0x65, -0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x79, - -/* America/Indiana/Marengo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xB1, 0xDA, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xEF, 0xAF, 0xE0, 0x80, 0xFE, 0xB8, 0x1C, 0xF0, -0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, -0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, -0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0x94, 0xF0, -0x0A, 0xF0, 0x86, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, -0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, -0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, -0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0xC3, 0xE2, 0xB3, 0x00, 0x8F, 0xF5, 0x68, 0x00, 0x00, 0x00, 0x28, 0x45, 0x61, -0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x49, 0x6E, 0x64, -0x69, 0x61, 0x6E, 0x61, 0x20, 0x2D, 0x20, 0x43, 0x72, 0x61, 0x77, 0x66, 0x6F, 0x72, 0x64, 0x20, -0x43, 0x6F, 0x75, 0x6E, 0x74, 0x79, - -/* America/Indiana/Petersburg */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xE4, 0x67, 0x3D, 0xE0, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xB1, 0xDA, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, -0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70, 0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, -0xF5, 0x4F, 0x86, 0x80, 0xF6, 0x3F, 0x69, 0x70, 0xF7, 0x2F, 0x68, 0x80, 0xFA, 0x08, 0x67, 0xF0, -0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, -0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, -0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, -0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, -0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, -0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x51, 0x70, -0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, -0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0xC4, 0x10, 0x2A, 0x00, 0x8E, 0x54, 0xF5, 0x00, 0x00, 0x00, 0x24, 0x45, -0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x49, 0x6E, -0x64, 0x69, 0x61, 0x6E, 0x61, 0x20, 0x2D, 0x20, 0x50, 0x69, 0x6B, 0x65, 0x20, 0x43, 0x6F, 0x75, -0x6E, 0x74, 0x79, - -/* America/Indianapolis */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80, -0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, -0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x89, -0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Indiana/Tell_City */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, -0xE4, 0x67, 0x3D, 0xE0, 0xE5, 0x29, 0x18, 0x70, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, -0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, -0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xB1, 0xDA, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, -0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x71, 0x9E, 0xF0, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70, -0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xFE, 0xB8, 0x1C, 0xF0, -0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, -0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, -0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, -0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, -0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, -0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, -0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, -0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, -0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, -0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, -0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, -0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, -0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, -0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, -0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, -0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, -0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, -0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, -0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC3, 0x3D, 0xA9, 0x00, 0x90, 0x98, 0x2A, -0x00, 0x00, 0x00, 0x25, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x54, 0x69, 0x6D, 0x65, -0x20, 0x2D, 0x20, 0x49, 0x6E, 0x64, 0x69, 0x61, 0x6E, 0x61, 0x20, 0x2D, 0x20, 0x50, 0x65, 0x72, -0x72, 0x79, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x79, - -/* America/Indiana/Vevay */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xE2, 0x7E, 0x3D, 0x80, 0xFE, 0xB8, 0x1C, 0xF0, -0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, -0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, -0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, -0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, -0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, -0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, -0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, -0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, -0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, -0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, -0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, -0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, -0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, -0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, -0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, -0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, -0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, -0x02, 0x03, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x00, 0x00, 0x00, 0xC4, 0x74, 0x19, 0x00, 0x91, 0x0F, 0xA2, 0x00, 0x00, 0x00, 0x2B, -0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x49, -0x6E, 0x64, 0x69, 0x61, 0x6E, 0x61, 0x20, 0x2D, 0x20, 0x53, 0x77, 0x69, 0x74, 0x7A, 0x65, 0x72, -0x6C, 0x61, 0x6E, 0x64, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x79, - -/* America/Indiana/Vincennes */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, -0xE4, 0x67, 0x3D, 0xE0, 0xE5, 0x29, 0x18, 0x70, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, -0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, -0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xB1, 0xDA, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, -0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x71, 0x9E, 0xF0, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70, -0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xFE, 0xB8, 0x1C, 0xF0, -0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x8A, 0xF0, -0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, -0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, -0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, -0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, -0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, -0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, -0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, -0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, -0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, -0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, -0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, -0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, -0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, -0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, -0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, -0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, -0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, -0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, -0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC4, 0x58, 0x8A, 0x00, 0x8E, 0xB6, 0x9D, -0x00, 0x00, 0x00, 0x40, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, -0x20, 0x2D, 0x20, 0x49, 0x6E, 0x64, 0x69, 0x61, 0x6E, 0x61, 0x20, 0x2D, 0x20, 0x44, 0x61, 0x76, -0x69, 0x65, 0x73, 0x73, 0x2C, 0x20, 0x44, 0x75, 0x62, 0x6F, 0x69, 0x73, 0x2C, 0x20, 0x4B, 0x6E, -0x6F, 0x78, 0x20, 0x26, 0x20, 0x4D, 0x61, 0x72, 0x74, 0x69, 0x6E, 0x20, 0x43, 0x6F, 0x75, 0x6E, -0x74, 0x69, 0x65, 0x73, - -/* America/Indiana/Winamac */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, 0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, -0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, 0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, -0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, 0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, -0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, -0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, -0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, -0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xB1, 0xDA, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, -0xEF, 0xAF, 0xE0, 0x80, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x01, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, -0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, -0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, -0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC7, 0xF7, 0xF2, 0x00, 0x90, 0x5A, 0x51, 0x00, 0x00, -0x00, 0x27, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, -0x20, 0x49, 0x6E, 0x64, 0x69, 0x61, 0x6E, 0x61, 0x20, 0x2D, 0x20, 0x50, 0x75, 0x6C, 0x61, 0x73, -0x6B, 0x69, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x79, - -/* America/Inuvik */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0xE0, 0x06, 0x4E, 0x80, -0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x94, 0x00, 0x11, 0x89, 0x90, 0x20, 0x13, 0x69, 0x64, 0x10, -0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, -0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, -0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, -0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, -0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, -0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, -0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, -0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, -0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, -0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, -0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, -0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, -0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, -0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, 0x47, 0xD3, 0xA7, 0x10, -0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, 0x4B, 0x9C, 0xA5, 0x90, -0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, 0x4F, 0x5C, 0x69, 0x90, -0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, 0x53, 0x1C, 0x2D, 0x90, -0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, 0x56, 0xE5, 0x2C, 0x10, -0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, 0x5A, 0xA4, 0xF0, 0x10, -0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, 0x5E, 0x64, 0xB4, 0x10, -0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, 0x62, 0x2D, 0xB2, 0x90, -0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, 0x65, 0xED, 0x76, 0x90, -0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, 0x69, 0xAD, 0x3A, 0x90, -0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, 0x6D, 0x76, 0x39, 0x10, -0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, 0x71, 0x35, 0xFD, 0x10, -0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, 0x74, 0xFE, 0xFB, 0x90, -0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, 0x78, 0xBE, 0xBF, 0x90, -0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, 0x7C, 0x7E, 0x83, 0x90, -0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, 0x02, 0x01, 0x02, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, -0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x09, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x0D, 0xFF, 0xFF, 0xAB, 0xA0, -0x01, 0x11, 0x7A, 0x7A, 0x7A, 0x00, 0x50, 0x44, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, -0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xF1, 0x9F, 0x5C, 0x00, 0x48, 0xCF, 0x52, 0x00, 0x00, 0x00, 0x2A, 0x4D, 0x6F, 0x75, -0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x77, 0x65, 0x73, -0x74, 0x20, 0x4E, 0x6F, 0x72, 0x74, 0x68, 0x77, 0x65, 0x73, 0x74, 0x20, 0x54, 0x65, 0x72, 0x72, -0x69, 0x74, 0x6F, 0x72, 0x69, 0x65, 0x73, - -/* America/Iqaluit */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0xCC, 0x6C, 0xA1, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xF7, 0x2F, 0x3E, 0x50, 0xF8, 0x28, 0x69, 0xD0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, -0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, -0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, -0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, -0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, -0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x05, 0x01, 0x02, 0x03, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, -0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, -0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x06, 0x07, 0x02, 0x04, -0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, -0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, -0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, -0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, -0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, -0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x11, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x15, 0xFF, 0xFF, 0xAB, -0xA0, 0x00, 0x19, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x1D, 0x7A, 0x7A, 0x7A, 0x00, 0x45, 0x50, 0x54, -0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x44, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x57, -0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x94, 0x15, 0x00, 0xAB, -0x9C, 0x4A, 0x00, 0x00, 0x00, 0x2C, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, -0x6D, 0x65, 0x20, 0x2D, 0x20, 0x65, 0x61, 0x73, 0x74, 0x20, 0x4E, 0x75, 0x6E, 0x61, 0x76, 0x75, -0x74, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, -0x6E, 0x73, - -/* America/Jamaica */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xCB, 0x80, 0x00, 0x9F, 0xE9, -0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Jujuy */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x2A, 0x57, 0xC0, -0x27, 0xE2, 0xDB, 0xB0, 0x28, 0xEE, 0x8A, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x47, 0x77, 0x09, 0xB0, -0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0xFF, 0xFF, -0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, -0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x57, 0x41, 0x52, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, -0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Juneau */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, 0x1C, 0xD2, 0x24, 0xB0, -0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, 0x20, 0x76, 0x39, 0x30, -0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, 0x24, 0x35, 0xFD, 0x30, -0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, 0x27, 0xFE, 0xFB, 0xB0, -0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, 0x2B, 0xBE, 0xBF, 0xB0, -0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, 0x2F, 0x7E, 0x83, 0xB0, -0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, 0x33, 0x47, 0x82, 0x30, -0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, 0x37, 0x07, 0x46, 0x30, -0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, 0x3A, 0xC7, 0x0A, 0x30, -0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, 0x3E, 0x90, 0x08, 0xB0, -0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, 0x42, 0x4F, 0xCC, 0xB0, -0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, 0x45, 0xF3, 0xE1, 0x30, -0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, 0x49, 0xB3, 0xA5, 0x30, -0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, 0x4D, 0x7C, 0xA3, 0xB0, -0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, 0x51, 0x3C, 0x67, 0xB0, -0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, 0x54, 0xFC, 0x2B, 0xB0, -0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, 0x58, 0xC5, 0x2A, 0x30, -0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, 0x5C, 0x84, 0xEE, 0x30, -0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, 0x60, 0x4D, 0xEC, 0xB0, -0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, 0x64, 0x0D, 0xB0, 0xB0, -0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, 0x67, 0xCD, 0x74, 0xB0, -0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, 0x6B, 0x96, 0x73, 0x30, -0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, 0x6F, 0x56, 0x37, 0x30, -0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, 0x73, 0x15, 0xFB, 0x30, -0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, 0x76, 0xDE, 0xF9, 0xB0, -0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, 0x7A, 0x9E, 0xBD, 0xB0, -0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, 0x7E, 0x5E, 0x81, 0xB0, -0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, -0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, -0x00, 0x03, 0x00, 0x03, 0x04, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x04, 0xFF, 0xFF, -0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x10, -0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x14, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x18, 0xFF, 0xFF, 0x81, 0x70, -0x00, 0x1D, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, 0x00, 0x50, 0x44, -0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x59, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x44, 0x54, 0x00, 0x41, -0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xE2, 0x4A, 0x72, 0x00, 0x46, 0xD4, 0xB4, 0x00, 0x00, 0x00, 0x1E, -0x41, 0x6C, 0x61, 0x73, 0x6B, 0x61, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x41, 0x6C, -0x61, 0x73, 0x6B, 0x61, 0x20, 0x70, 0x61, 0x6E, 0x68, 0x61, 0x6E, 0x64, 0x6C, 0x65, - -/* America/Kentucky/Louisville */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA4, 0x73, 0xF7, 0x00, -0xA5, 0x16, 0x11, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD2, 0xDB, 0x97, 0x60, 0xD3, 0xA4, 0x09, 0x70, -0xD5, 0x55, 0xD5, 0x00, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x1E, 0x90, 0x70, -0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, -0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, -0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, -0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, -0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, -0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, -0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, -0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, -0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, -0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC3, 0xB3, 0x48, 0x00, 0x92, 0x1E, -0x08, 0x00, 0x00, 0x00, 0x29, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, -0x65, 0x20, 0x2D, 0x20, 0x4B, 0x65, 0x6E, 0x74, 0x75, 0x63, 0x6B, 0x79, 0x20, 0x2D, 0x20, 0x4C, -0x6F, 0x75, 0x69, 0x73, 0x76, 0x69, 0x6C, 0x6C, 0x65, 0x20, 0x61, 0x72, 0x65, 0x61, - -/* America/Kentucky/Monticello */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, -0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, -0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, -0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, -0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, -0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, -0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, -0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, -0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, -0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, -0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, -0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, -0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, -0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, -0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x10, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x14, 0x43, -0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0xC1, 0x86, 0xDC, 0x00, 0x93, 0xC7, 0xB4, 0x00, 0x00, 0x00, 0x26, 0x45, -0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4B, 0x65, -0x6E, 0x74, 0x75, 0x63, 0x6B, 0x79, 0x20, 0x2D, 0x20, 0x57, 0x61, 0x79, 0x6E, 0x65, 0x20, 0x43, -0x6F, 0x75, 0x6E, 0x74, 0x79, - -/* America/Knox_IN */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, -0xF1, 0x8F, 0xC2, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, -0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, -0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, -0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, -0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, -0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, -0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, -0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, -0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, -0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, -0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, -0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, -0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, -0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, -0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, -0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, -0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, -0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* America/La_Paz */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xB8, 0x1E, 0x96, 0xE4, -0xB8, 0xEE, 0xD5, 0xD4, 0x01, 0x02, 0xFF, 0xFF, 0xC0, 0x1C, 0x00, 0x00, 0xFF, 0xFF, 0xCE, 0x2C, -0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x43, 0x4D, 0x54, 0x00, 0x42, 0x4F, 0x53, 0x54, -0x00, 0x42, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0xAD, 0x90, 0x00, -0xAB, 0x20, 0x98, 0x00, 0x00, 0x00, 0x00, - -/* America/Lima */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x8C, 0x74, 0x40, 0xD4, -0xC3, 0xCF, 0x4A, 0x50, 0xC4, 0x45, 0xE3, 0x40, 0xC5, 0x2F, 0x4A, 0xD0, 0xC6, 0x1F, 0x2D, 0xC0, -0xC7, 0x0F, 0x2C, 0xD0, 0xC7, 0xFF, 0x0F, 0xC0, 0x1E, 0x18, 0xC4, 0x50, 0x1E, 0x8F, 0x5D, 0x40, -0x1F, 0xF9, 0xF7, 0xD0, 0x20, 0x70, 0x90, 0xC0, 0x25, 0x9E, 0xE3, 0xD0, 0x26, 0x15, 0x7C, 0xC0, -0x2D, 0x25, 0x03, 0x50, 0x2D, 0x9B, 0x9C, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xB7, 0xAC, 0x00, 0x00, 0xFF, 0xFF, 0xC7, -0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x45, 0x53, -0x54, 0x00, 0x50, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x18, 0x48, -0x00, 0x9D, 0x3D, 0xE8, 0x00, 0x00, 0x00, 0x00, - -/* America/Los_Angeles */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, -0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xBD, 0x49, 0xE6, 0x00, 0x5E, 0xF9, -0x95, 0x00, 0x00, 0x00, 0x0C, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x54, 0x69, 0x6D, -0x65, - -/* America/Louisville */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA4, 0x73, 0xF7, 0x00, -0xA5, 0x16, 0x11, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD2, 0xDB, 0x97, 0x60, 0xD3, 0xA4, 0x09, 0x70, -0xD5, 0x55, 0xD5, 0x00, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x1E, 0x90, 0x70, -0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, -0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, -0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, -0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, -0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, -0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, -0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, -0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, -0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, -0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, -0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Maceio */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x68, 0x7C, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, -0x39, 0xDF, 0xE3, 0x30, 0x39, 0xF2, 0x4A, 0x20, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xDE, 0x84, 0x00, 0x00, 0xFF, -0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, -0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, -0x9D, 0x0A, 0x00, 0xDE, 0x58, 0x92, 0x00, 0x00, 0x00, 0x10, 0x41, 0x6C, 0x61, 0x67, 0x6F, 0x61, -0x73, 0x2C, 0x20, 0x53, 0x65, 0x72, 0x67, 0x69, 0x70, 0x65, - -/* America/Managua */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xBD, 0x2D, 0x48, 0xE8, -0x06, 0x43, 0x74, 0x60, 0x09, 0xA4, 0x3E, 0x50, 0x11, 0x51, 0xF8, 0xE0, 0x11, 0xD4, 0x6F, 0x50, -0x13, 0x31, 0xDA, 0xE0, 0x13, 0xB4, 0x51, 0x50, 0x29, 0x61, 0x91, 0x20, 0x2A, 0xC1, 0x4B, 0x50, -0x2B, 0x43, 0xDD, 0xE0, 0x32, 0xC9, 0xEF, 0x50, 0x42, 0x58, 0xC0, 0xE0, 0x43, 0x3F, 0x69, 0x50, -0x44, 0x54, 0x6E, 0x80, 0x45, 0x1F, 0x59, 0x60, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x02, -0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0xFF, 0xFF, 0xAF, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xAB, -0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0x4D, -0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0xDE, 0x58, 0x00, 0x8F, 0xDD, 0x6D, 0x00, -0x00, 0x00, 0x00, - -/* America/Manaus */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7F, 0x44, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC7, 0xBC, 0x00, 0x00, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, -0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0xF4, 0x75, -0x00, 0xB7, 0x21, 0x82, 0x00, 0x00, 0x00, 0x0A, 0x45, 0x20, 0x41, 0x6D, 0x61, 0x7A, 0x6F, 0x6E, -0x61, 0x73, - -/* America/Marigot */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xE5, 0x8A, 0x00, 0xB2, 0xA7, -0xAD, 0x00, 0x00, 0x00, 0x00, - -/* America/Martinique */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xA3, 0xC8, 0x44, -0x13, 0x4D, 0x6E, 0x40, 0x14, 0x34, 0x16, 0xB0, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xC6, 0xBC, 0x00, -0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x05, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x09, 0x46, 0x46, 0x4D, -0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x9F, 0x9B, 0x60, 0x00, 0xB5, 0xB4, 0xED, 0x00, 0x00, 0x00, 0x00, - -/* America/Mazatlan */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xCB, 0xEA, 0x71, 0x60, 0xD8, 0x91, 0xB4, 0xF0, 0x00, 0x00, 0x70, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xF5, 0x12, 0x90, 0x3B, 0xB6, 0xD1, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, 0x47, 0x24, 0x41, 0x80, -0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, 0x4A, 0xE4, 0x05, 0x80, -0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, 0x4E, 0xAD, 0x04, 0x00, -0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, 0x52, 0x6C, 0xC8, 0x00, -0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, 0x56, 0x2C, 0x8C, 0x00, -0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, 0x59, 0xF5, 0x8A, 0x80, -0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, 0x5D, 0xB5, 0x4E, 0x80, -0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, 0x61, 0x7E, 0x4D, 0x00, -0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, 0x65, 0x3E, 0x11, 0x00, -0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, 0x68, 0xFD, 0xD5, 0x00, -0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, 0x6C, 0xC6, 0xD3, 0x80, -0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, 0x70, 0x86, 0x97, 0x80, -0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, 0x74, 0x46, 0x5B, 0x80, -0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, 0x78, 0x0F, 0x5A, 0x00, -0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, 0x7B, 0xCF, 0x1E, 0x00, -0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, 0x7F, 0x8E, 0xE2, 0x00, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, 0x9C, -0x3C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, -0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAC, 0xC1, 0x42, 0x00, 0x71, 0x8D, -0x02, 0x00, 0x00, 0x00, 0x28, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x54, 0x69, -0x6D, 0x65, 0x20, 0x2D, 0x20, 0x53, 0x20, 0x42, 0x61, 0x6A, 0x61, 0x2C, 0x20, 0x4E, 0x61, 0x79, -0x61, 0x72, 0x69, 0x74, 0x2C, 0x20, 0x53, 0x69, 0x6E, 0x61, 0x6C, 0x6F, 0x61, - -/* America/Mendoza */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x19, 0x34, 0x40, -0x27, 0xCD, 0xC3, 0xB0, 0x28, 0xFA, 0x67, 0xC0, 0x29, 0xB0, 0x48, 0xB0, 0x2A, 0xE0, 0xE1, 0x40, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x40, 0xB0, 0x13, 0xB0, -0x41, 0x56, 0x3E, 0xC0, 0x47, 0x77, 0x09, 0xB0, 0x47, 0xDC, 0x7F, 0x20, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06, 0x05, 0x06, 0x05, -0x03, 0x04, 0x02, 0x04, 0x05, 0x04, 0x03, 0x04, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, -0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, -0x01, 0x12, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, -0x41, 0x52, 0x54, 0x00, 0x57, 0x41, 0x52, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* America/Menominee */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0x06, 0x40, 0xDF, 0x70, -0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, -0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, -0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, -0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, -0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, -0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, -0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, -0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, -0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, -0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, 0x2B, 0xBE, 0x95, 0x80, -0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, -0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, -0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, -0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, -0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, -0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, -0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, -0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, -0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, -0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, -0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, -0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, -0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, -0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, -0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, -0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, -0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, -0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, -0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, -0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, -0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, -0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xCE, -0x28, 0x79, 0x00, 0x8E, 0xD8, 0x08, 0x00, 0x00, 0x00, 0x47, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, -0x6C, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4D, 0x69, 0x63, 0x68, 0x69, 0x67, 0x61, -0x6E, 0x20, 0x2D, 0x20, 0x44, 0x69, 0x63, 0x6B, 0x69, 0x6E, 0x73, 0x6F, 0x6E, 0x2C, 0x20, 0x47, -0x6F, 0x67, 0x65, 0x62, 0x69, 0x63, 0x2C, 0x20, 0x49, 0x72, 0x6F, 0x6E, 0x20, 0x26, 0x20, 0x4D, -0x65, 0x6E, 0x6F, 0x6D, 0x69, 0x6E, 0x65, 0x65, 0x20, 0x43, 0x6F, 0x75, 0x6E, 0x74, 0x69, 0x65, -0x73, - -/* America/Merida */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA5, 0xB6, 0xDA, 0x60, -0x16, 0x86, 0xD5, 0x60, 0x18, 0x4C, 0x4B, 0x50, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xF5, 0x04, 0x80, 0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, -0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, -0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, -0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, -0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, -0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, -0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, -0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, -0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, -0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, -0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, -0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, -0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, -0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, -0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, -0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, -0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0xFF, -0xFF, 0xAB, 0xFC, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xA9, 0x52, 0x5A, 0x00, 0x8B, 0xCB, 0xC2, 0x00, 0x00, 0x00, 0x20, 0x43, 0x65, 0x6E, 0x74, 0x72, -0x61, 0x6C, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x43, 0x61, 0x6D, 0x70, 0x65, 0x63, -0x68, 0x65, 0x2C, 0x20, 0x59, 0x75, 0x63, 0x61, 0x74, 0x61, 0x6E, - -/* America/Mexico_City */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xC5, 0xDE, 0xB0, 0x60, 0xC6, 0x97, 0x34, 0x50, 0xC9, 0x55, 0xF1, 0xE0, -0xC9, 0xEA, 0xDD, 0x50, 0xCF, 0x02, 0xC6, 0xE0, 0xCF, 0xB7, 0x56, 0x50, 0xDA, 0x99, 0x15, 0xE0, -0xDB, 0x76, 0x83, 0xD0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, -0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xF5, 0x04, 0x80, -0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, -0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, -0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80, -0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00, -0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00, -0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80, -0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80, -0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80, -0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00, -0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00, -0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00, -0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80, -0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80, -0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80, -0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00, -0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00, -0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00, -0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80, -0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xA3, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, -0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, -0x43, 0x44, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xA6, 0xEE, 0x60, 0x00, 0x7B, 0xD3, 0x38, 0x00, 0x00, 0x00, 0x1D, 0x43, 0x65, -0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, -0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* America/Miquelon */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x91, 0xB6, 0x38, 0xA8, -0x13, 0x6E, 0x63, 0xC0, 0x20, 0x75, 0xE4, 0xD0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x55, 0xC6, 0xD0, -0x23, 0x6A, 0x93, 0xC0, 0x24, 0x35, 0xA8, 0xD0, 0x25, 0x4A, 0x75, 0xC0, 0x26, 0x15, 0x8A, 0xD0, -0x27, 0x2A, 0x57, 0xC0, 0x27, 0xFE, 0xA7, 0x50, 0x29, 0x0A, 0x39, 0xC0, 0x29, 0xDE, 0x89, 0x50, -0x2A, 0xEA, 0x1B, 0xC0, 0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xD3, 0x38, 0x40, 0x2D, 0x9E, 0x4D, 0x50, -0x2E, 0xB3, 0x1A, 0x40, 0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x92, 0xFC, 0x40, 0x31, 0x67, 0x4B, 0xD0, -0x32, 0x72, 0xDE, 0x40, 0x33, 0x47, 0x2D, 0xD0, 0x34, 0x52, 0xC0, 0x40, 0x35, 0x27, 0x0F, 0xD0, -0x36, 0x32, 0xA2, 0x40, 0x37, 0x06, 0xF1, 0xD0, 0x38, 0x1B, 0xBE, 0xC0, 0x38, 0xE6, 0xD3, 0xD0, -0x39, 0xFB, 0xA0, 0xC0, 0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x82, 0xC0, 0x3C, 0xAF, 0xD2, 0x50, -0x3D, 0xBB, 0x64, 0xC0, 0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x46, 0xC0, 0x40, 0x6F, 0x96, 0x50, -0x41, 0x84, 0x63, 0x40, 0x42, 0x4F, 0x78, 0x50, 0x43, 0x64, 0x45, 0x40, 0x44, 0x2F, 0x5A, 0x50, -0x45, 0x44, 0x27, 0x40, 0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x2D, 0x43, 0xC0, 0x47, 0xD3, 0x6E, 0xD0, -0x49, 0x0D, 0x25, 0xC0, 0x49, 0xB3, 0x50, 0xD0, 0x4A, 0xED, 0x07, 0xC0, 0x4B, 0x9C, 0x6D, 0x50, -0x4C, 0xD6, 0x24, 0x40, 0x4D, 0x7C, 0x4F, 0x50, 0x4E, 0xB6, 0x06, 0x40, 0x4F, 0x5C, 0x31, 0x50, -0x50, 0x95, 0xE8, 0x40, 0x51, 0x3C, 0x13, 0x50, 0x52, 0x75, 0xCA, 0x40, 0x53, 0x1B, 0xF5, 0x50, -0x54, 0x55, 0xAC, 0x40, 0x54, 0xFB, 0xD7, 0x50, 0x56, 0x35, 0x8E, 0x40, 0x56, 0xE4, 0xF3, 0xD0, -0x58, 0x1E, 0xAA, 0xC0, 0x58, 0xC4, 0xD5, 0xD0, 0x59, 0xFE, 0x8C, 0xC0, 0x5A, 0xA4, 0xB7, 0xD0, -0x5B, 0xDE, 0x6E, 0xC0, 0x5C, 0x84, 0x99, 0xD0, 0x5D, 0xBE, 0x50, 0xC0, 0x5E, 0x64, 0x7B, 0xD0, -0x5F, 0x9E, 0x32, 0xC0, 0x60, 0x4D, 0x98, 0x50, 0x61, 0x87, 0x4F, 0x40, 0x62, 0x2D, 0x7A, 0x50, -0x63, 0x67, 0x31, 0x40, 0x64, 0x0D, 0x5C, 0x50, 0x65, 0x47, 0x13, 0x40, 0x65, 0xED, 0x3E, 0x50, -0x67, 0x26, 0xF5, 0x40, 0x67, 0xCD, 0x20, 0x50, 0x69, 0x06, 0xD7, 0x40, 0x69, 0xAD, 0x02, 0x50, -0x6A, 0xE6, 0xB9, 0x40, 0x6B, 0x96, 0x1E, 0xD0, 0x6C, 0xCF, 0xD5, 0xC0, 0x6D, 0x76, 0x00, 0xD0, -0x6E, 0xAF, 0xB7, 0xC0, 0x6F, 0x55, 0xE2, 0xD0, 0x70, 0x8F, 0x99, 0xC0, 0x71, 0x35, 0xC4, 0xD0, -0x72, 0x6F, 0x7B, 0xC0, 0x73, 0x15, 0xA6, 0xD0, 0x74, 0x4F, 0x5D, 0xC0, 0x74, 0xFE, 0xC3, 0x50, -0x76, 0x38, 0x7A, 0x40, 0x76, 0xDE, 0xA5, 0x50, 0x78, 0x18, 0x5C, 0x40, 0x78, 0xBE, 0x87, 0x50, -0x79, 0xF8, 0x3E, 0x40, 0x7A, 0x9E, 0x69, 0x50, 0x7B, 0xD8, 0x20, 0x40, 0x7C, 0x7E, 0x4B, 0x50, -0x7D, 0xB8, 0x02, 0x40, 0x7E, 0x5E, 0x2D, 0x50, 0x7F, 0x97, 0xE4, 0x40, 0x01, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xCB, 0x58, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, -0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x50, 0x4D, 0x53, 0x54, 0x00, 0x50, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD1, 0x1F, 0x28, 0x00, 0xBD, 0xB7, 0xB5, 0x00, 0x00, -0x00, 0x00, - -/* America/Moncton */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xB6, 0x50, -0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50, 0xBB, 0x3C, 0x38, 0xD0, 0xBB, 0xB4, 0x23, 0x40, -0xBD, 0x1C, 0x1A, 0xD0, 0xBD, 0x94, 0x05, 0x40, 0xBE, 0xFB, 0xFC, 0xD0, 0xBF, 0x73, 0xE7, 0x40, -0xC0, 0xDB, 0xDE, 0xD0, 0xC1, 0x53, 0xC9, 0x40, 0xC2, 0xBB, 0xC0, 0xD0, 0xC3, 0x33, 0xAB, 0x40, -0xC4, 0x9B, 0xA2, 0xD0, 0xC5, 0x13, 0x8D, 0x40, 0xC6, 0x70, 0xF8, 0xD0, 0xC7, 0x0D, 0xCD, 0x40, -0xC8, 0x48, 0xF1, 0xD0, 0xC8, 0xED, 0xAF, 0x40, 0xCA, 0x16, 0x5E, 0xD0, 0xCA, 0xD6, 0xCB, 0xC0, -0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xD3, 0x75, 0xD6, 0xE0, -0xD4, 0x40, 0xCF, 0xD0, 0xD5, 0x55, 0xB8, 0xE0, 0xD6, 0x20, 0xB1, 0xD0, 0xD7, 0x35, 0x9A, 0xE0, -0xD8, 0x00, 0x93, 0xD0, 0xD9, 0x15, 0x7C, 0xE0, 0xD9, 0xE0, 0x75, 0xD0, 0xDA, 0xFE, 0x99, 0x60, -0xDB, 0xC0, 0x57, 0xD0, 0xDC, 0xDE, 0x7B, 0x60, 0xDD, 0xA9, 0x74, 0x50, 0xDE, 0xBE, 0x5D, 0x60, -0xDF, 0x89, 0x56, 0x50, 0xE0, 0x9E, 0x3F, 0x60, 0xE1, 0x69, 0x38, 0x50, 0xE2, 0x7E, 0x21, 0x60, -0xE3, 0x49, 0x1A, 0x50, 0xE4, 0x5E, 0x03, 0x60, 0xE5, 0x28, 0xFC, 0x50, 0xE6, 0x47, 0x1F, 0xE0, -0xE7, 0x12, 0x18, 0xD0, 0xE8, 0x27, 0x01, 0xE0, 0xE9, 0x16, 0xE4, 0xD0, 0xEA, 0x06, 0xE3, 0xE0, -0xEA, 0xF6, 0xC6, 0xD0, 0xEB, 0xE6, 0xC5, 0xE0, 0xEC, 0xD6, 0xA8, 0xD0, 0xED, 0xC6, 0xA7, 0xE0, -0xEE, 0xBF, 0xC5, 0x50, 0xEF, 0xAF, 0xC4, 0x60, 0xF0, 0x9F, 0xA7, 0x50, 0xF1, 0x8F, 0xA6, 0x60, -0xF2, 0x7F, 0x89, 0x50, 0xF3, 0x6F, 0x88, 0x60, 0xF4, 0x5F, 0x6B, 0x50, 0xF5, 0x4F, 0x6A, 0x60, -0xF6, 0x3F, 0x4D, 0x50, 0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x69, 0xD0, 0xF9, 0x0F, 0x2E, 0x60, -0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0, -0xFD, 0xC8, 0x0F, 0xD0, 0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0, -0x01, 0x87, 0xD3, 0xD0, 0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60, -0x05, 0x50, 0xD2, 0x50, 0x08, 0x20, 0xB3, 0x60, 0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, -0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, 0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, -0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, 0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, -0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, -0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, -0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, -0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, -0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, -0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, -0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x5D, 0x7C, -0x2C, 0xD3, 0x2A, 0x6C, 0x2D, 0x9E, 0x3F, 0x7C, 0x2E, 0xB3, 0x0C, 0x6C, 0x2F, 0x7E, 0x21, 0x7C, -0x30, 0x92, 0xEE, 0x6C, 0x31, 0x67, 0x3D, 0xFC, 0x32, 0x72, 0xD0, 0x6C, 0x33, 0x47, 0x1F, 0xFC, -0x34, 0x52, 0xB2, 0x6C, 0x35, 0x27, 0x01, 0xFC, 0x36, 0x32, 0x94, 0x6C, 0x37, 0x06, 0xE3, 0xFC, -0x38, 0x1B, 0xB0, 0xEC, 0x38, 0xE6, 0xC5, 0xFC, 0x39, 0xFB, 0x92, 0xEC, 0x3A, 0xC6, 0xA7, 0xFC, -0x3B, 0xDB, 0x74, 0xEC, 0x3C, 0xAF, 0xC4, 0x7C, 0x3D, 0xBB, 0x56, 0xEC, 0x3E, 0x8F, 0xA6, 0x7C, -0x3F, 0x9B, 0x38, 0xEC, 0x40, 0x6F, 0x88, 0x7C, 0x41, 0x84, 0x55, 0x6C, 0x42, 0x4F, 0x6A, 0x7C, -0x43, 0x64, 0x37, 0x6C, 0x44, 0x2F, 0x4C, 0x7C, 0x45, 0x44, 0x19, 0x6C, 0x45, 0xF3, 0x9A, 0xE0, -0x47, 0x2D, 0x51, 0xD0, 0x47, 0xD3, 0x7C, 0xE0, 0x49, 0x0D, 0x33, 0xD0, 0x49, 0xB3, 0x5E, 0xE0, -0x4A, 0xED, 0x15, 0xD0, 0x4B, 0x9C, 0x7B, 0x60, 0x4C, 0xD6, 0x32, 0x50, 0x4D, 0x7C, 0x5D, 0x60, -0x4E, 0xB6, 0x14, 0x50, 0x4F, 0x5C, 0x3F, 0x60, 0x50, 0x95, 0xF6, 0x50, 0x51, 0x3C, 0x21, 0x60, -0x52, 0x75, 0xD8, 0x50, 0x53, 0x1C, 0x03, 0x60, 0x54, 0x55, 0xBA, 0x50, 0x54, 0xFB, 0xE5, 0x60, -0x56, 0x35, 0x9C, 0x50, 0x56, 0xE5, 0x01, 0xE0, 0x58, 0x1E, 0xB8, 0xD0, 0x58, 0xC4, 0xE3, 0xE0, -0x59, 0xFE, 0x9A, 0xD0, 0x5A, 0xA4, 0xC5, 0xE0, 0x5B, 0xDE, 0x7C, 0xD0, 0x5C, 0x84, 0xA7, 0xE0, -0x5D, 0xBE, 0x5E, 0xD0, 0x5E, 0x64, 0x89, 0xE0, 0x5F, 0x9E, 0x40, 0xD0, 0x60, 0x4D, 0xA6, 0x60, -0x61, 0x87, 0x5D, 0x50, 0x62, 0x2D, 0x88, 0x60, 0x63, 0x67, 0x3F, 0x50, 0x64, 0x0D, 0x6A, 0x60, -0x65, 0x47, 0x21, 0x50, 0x65, 0xED, 0x4C, 0x60, 0x67, 0x27, 0x03, 0x50, 0x67, 0xCD, 0x2E, 0x60, -0x69, 0x06, 0xE5, 0x50, 0x69, 0xAD, 0x10, 0x60, 0x6A, 0xE6, 0xC7, 0x50, 0x6B, 0x96, 0x2C, 0xE0, -0x6C, 0xCF, 0xE3, 0xD0, 0x6D, 0x76, 0x0E, 0xE0, 0x6E, 0xAF, 0xC5, 0xD0, 0x6F, 0x55, 0xF0, 0xE0, -0x70, 0x8F, 0xA7, 0xD0, 0x71, 0x35, 0xD2, 0xE0, 0x72, 0x6F, 0x89, 0xD0, 0x73, 0x15, 0xB4, 0xE0, -0x74, 0x4F, 0x6B, 0xD0, 0x74, 0xFE, 0xD1, 0x60, 0x76, 0x38, 0x88, 0x50, 0x76, 0xDE, 0xB3, 0x60, -0x78, 0x18, 0x6A, 0x50, 0x78, 0xBE, 0x95, 0x60, 0x79, 0xF8, 0x4C, 0x50, 0x7A, 0x9E, 0x77, 0x60, -0x7B, 0xD8, 0x2E, 0x50, 0x7C, 0x7E, 0x59, 0x60, 0x7D, 0xB8, 0x10, 0x50, 0x7E, 0x5E, 0x3B, 0x60, -0x7F, 0x97, 0xF2, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, -0x45, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, -0x41, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xCF, -0xAC, 0x10, 0x00, 0xB2, 0x32, 0x7D, 0x00, 0x00, 0x00, 0x1D, 0x41, 0x74, 0x6C, 0x61, 0x6E, 0x74, -0x69, 0x63, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4E, 0x65, 0x77, 0x20, 0x42, 0x72, -0x75, 0x6E, 0x73, 0x77, 0x69, 0x63, 0x6B, - -/* America/Monterrey */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA5, 0xB6, 0xDA, 0x60, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xF5, 0x04, 0x80, 0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x46, 0x0F, 0x66, 0x80, 0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, -0x49, 0xD8, 0x65, 0x00, 0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, -0x4D, 0x98, 0x29, 0x00, 0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, -0x51, 0x61, 0x27, 0x80, 0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, -0x55, 0x20, 0xEB, 0x80, 0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, -0x58, 0xE0, 0xAF, 0x80, 0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, -0x5C, 0xA9, 0xAE, 0x00, 0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, -0x60, 0x69, 0x72, 0x00, 0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, -0x64, 0x29, 0x36, 0x00, 0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, -0x67, 0xF2, 0x34, 0x80, 0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, -0x6B, 0xB1, 0xF8, 0x80, 0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, -0x6F, 0x71, 0xBC, 0x80, 0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, -0x73, 0x3A, 0xBB, 0x00, 0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, -0x76, 0xFA, 0x7F, 0x00, 0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, -0x7A, 0xBA, 0x43, 0x00, 0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, -0x7E, 0x83, 0x41, 0x80, 0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, -0xFF, 0xA1, 0xF4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB0, 0x7E, 0x4A, 0x00, 0x7A, 0x8D, 0xB2, 0x00, 0x00, 0x00, 0x38, 0x43, -0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x43, 0x6F, -0x61, 0x68, 0x75, 0x69, 0x6C, 0x61, 0x2C, 0x20, 0x44, 0x75, 0x72, 0x61, 0x6E, 0x67, 0x6F, 0x2C, -0x20, 0x4E, 0x75, 0x65, 0x76, 0x6F, 0x20, 0x4C, 0x65, 0x6F, 0x6E, 0x2C, 0x20, 0x54, 0x61, 0x6D, -0x61, 0x75, 0x6C, 0x69, 0x70, 0x61, 0x73, - -/* America/Montevideo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0xA2, 0x92, 0x87, 0xAC, -0xA9, 0x01, 0x25, 0xB8, 0xA9, 0xF1, 0x0F, 0xB0, 0xAA, 0xE2, 0x59, 0x38, 0xAB, 0xD2, 0x43, 0x30, -0xAC, 0xC3, 0x8C, 0xB8, 0xAD, 0xB3, 0x76, 0xB0, 0xBB, 0xF4, 0xB5, 0xB8, 0xBC, 0xBF, 0xB5, 0xB0, -0xBD, 0xD4, 0x97, 0xB8, 0xBE, 0x9F, 0x97, 0xB0, 0xBF, 0xB4, 0x79, 0xB8, 0xC0, 0x7F, 0x79, 0xB0, -0xC1, 0x9D, 0x96, 0x38, 0xC2, 0x5F, 0x5B, 0xB0, 0xC3, 0x7D, 0x78, 0x38, 0xC4, 0x3F, 0x3D, 0xB0, -0xC5, 0x5D, 0x5A, 0x38, 0xC6, 0x1F, 0x1F, 0xB0, 0xC7, 0x3D, 0x3C, 0x38, 0xC8, 0x08, 0x3C, 0x30, -0xC9, 0x1D, 0x1E, 0x38, 0xC9, 0xE8, 0x1E, 0x30, 0xCA, 0x8B, 0x9F, 0x38, 0xCB, 0x55, 0x4D, 0xB0, -0xCD, 0x1E, 0xCD, 0x38, 0xCD, 0x95, 0x5F, 0x20, 0xEC, 0x0B, 0x85, 0xB0, 0xEC, 0xF2, 0x2E, 0x20, -0xED, 0x45, 0x4A, 0xB0, 0xED, 0x85, 0xD6, 0x20, 0xF7, 0x13, 0x72, 0xB0, 0xF7, 0xFA, 0x1B, 0x20, -0xF8, 0xF3, 0x54, 0xB0, 0xFA, 0x09, 0x73, 0x20, 0xFA, 0xD3, 0x36, 0xB0, 0xFB, 0xEA, 0xA6, 0xA0, -0xFC, 0xFE, 0x3E, 0x30, 0xFD, 0xF7, 0x62, 0xA8, 0xFE, 0xDF, 0x71, 0xB0, 0xFF, 0xD8, 0x96, 0x28, -0x00, 0xC0, 0xA5, 0x30, 0x01, 0xB9, 0xC9, 0xA8, 0x04, 0x58, 0xDC, 0x30, 0x04, 0xED, 0xC7, 0xA0, -0x07, 0xDF, 0xEF, 0xB0, 0x09, 0x5A, 0x47, 0x28, 0x0C, 0xB1, 0xDD, 0xA0, 0x0E, 0xE7, 0x7F, 0x30, -0x0F, 0x83, 0x02, 0x20, 0x12, 0x55, 0x86, 0x30, 0x13, 0x6E, 0x47, 0xA0, 0x21, 0xC3, 0x54, 0x30, -0x22, 0x3B, 0x3E, 0xA0, 0x23, 0xA1, 0xE4, 0xB0, 0x24, 0x19, 0xCF, 0x20, 0x25, 0x4A, 0x67, 0xB0, -0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, 0x27, 0xD0, 0x58, 0xA0, 0x29, 0x0A, 0x2B, 0xB0, -0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, 0x2B, 0x90, 0x1C, 0xA0, 0x41, 0x4C, 0xF6, 0x30, -0x42, 0x46, 0x2F, 0xC0, 0x43, 0x48, 0xA3, 0xD0, 0x44, 0x13, 0x9C, 0xC0, 0x45, 0x1F, 0x4B, 0x50, -0x45, 0xF3, 0x7E, 0xC0, 0x47, 0x08, 0x67, 0xD0, 0x47, 0xD3, 0x60, 0xC0, 0x48, 0xE8, 0x49, 0xD0, -0x49, 0xB3, 0x42, 0xC0, 0x4A, 0xC8, 0x2B, 0xD0, 0x4B, 0x9C, 0x5F, 0x40, 0x4C, 0xA8, 0x0D, 0xD0, -0x4D, 0x7C, 0x41, 0x40, 0x4E, 0x87, 0xEF, 0xD0, 0x4F, 0x5C, 0x23, 0x40, 0x50, 0x71, 0x0C, 0x50, -0x51, 0x3C, 0x05, 0x40, 0x52, 0x50, 0xEE, 0x50, 0x53, 0x1B, 0xE7, 0x40, 0x54, 0x30, 0xD0, 0x50, -0x54, 0xFB, 0xC9, 0x40, 0x56, 0x10, 0xB2, 0x50, 0x56, 0xE4, 0xE5, 0xC0, 0x57, 0xF0, 0x94, 0x50, -0x58, 0xC4, 0xC7, 0xC0, 0x59, 0xD0, 0x76, 0x50, 0x5A, 0xA4, 0xA9, 0xC0, 0x5B, 0xB9, 0x92, 0xD0, -0x5C, 0x84, 0x8B, 0xC0, 0x5D, 0x99, 0x74, 0xD0, 0x5E, 0x64, 0x6D, 0xC0, 0x5F, 0x79, 0x56, 0xD0, -0x60, 0x4D, 0x8A, 0x40, 0x61, 0x59, 0x38, 0xD0, 0x62, 0x2D, 0x6C, 0x40, 0x63, 0x39, 0x1A, 0xD0, -0x64, 0x0D, 0x4E, 0x40, 0x65, 0x18, 0xFC, 0xD0, 0x65, 0xED, 0x30, 0x40, 0x67, 0x02, 0x19, 0x50, -0x67, 0xCD, 0x12, 0x40, 0x68, 0xE1, 0xFB, 0x50, 0x69, 0xAC, 0xF4, 0x40, 0x6A, 0xC1, 0xDD, 0x50, -0x6B, 0x96, 0x10, 0xC0, 0x6C, 0xA1, 0xBF, 0x50, 0x6D, 0x75, 0xF2, 0xC0, 0x6E, 0x81, 0xA1, 0x50, -0x6F, 0x55, 0xD4, 0xC0, 0x70, 0x6A, 0xBD, 0xD0, 0x71, 0x35, 0xB6, 0xC0, 0x72, 0x4A, 0x9F, 0xD0, -0x73, 0x15, 0x98, 0xC0, 0x74, 0x2A, 0x81, 0xD0, 0x74, 0xFE, 0xB5, 0x40, 0x76, 0x0A, 0x63, 0xD0, -0x76, 0xDE, 0x97, 0x40, 0x77, 0xEA, 0x45, 0xD0, 0x78, 0xBE, 0x79, 0x40, 0x79, 0xCA, 0x27, 0xD0, -0x7A, 0x9E, 0x5B, 0x40, 0x7B, 0xB3, 0x44, 0x50, 0x7C, 0x7E, 0x3D, 0x40, 0x7D, 0x93, 0x26, 0x50, -0x7E, 0x5E, 0x1F, 0x40, 0x7F, 0x73, 0x08, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x04, 0x06, -0x04, 0x06, 0x04, 0x05, 0x04, 0x06, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0xCB, 0x54, 0x00, -0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x0A, 0xFF, 0xFF, 0xCE, -0xC8, 0x00, 0x0A, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x0A, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x0E, 0xFF, -0xFF, 0xDC, 0xD8, 0x01, 0x04, 0x4D, 0x4D, 0x54, 0x00, 0x55, 0x59, 0x48, 0x53, 0x54, 0x00, 0x55, -0x59, 0x54, 0x00, 0x55, 0x59, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0xCC, 0x0D, 0x00, 0xBD, 0x7D, 0x1D, 0x00, 0x00, -0x00, 0x00, - -/* America/Montreal */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9C, 0xBD, 0x01, 0xF0, -0x9C, 0xE4, 0x64, 0xC0, 0x9E, 0xB8, 0x93, 0x70, 0x9F, 0xC0, 0x31, 0x60, 0xA0, 0x87, 0x58, 0xF8, -0xA1, 0x99, 0x82, 0xE8, 0xA2, 0x94, 0x0D, 0xF8, 0xA3, 0x5F, 0x06, 0xE8, 0xA4, 0x73, 0xE8, 0xF0, -0xA5, 0x3E, 0xE8, 0xE8, 0xA6, 0x53, 0xCA, 0xF0, 0xA7, 0x1E, 0xCA, 0xE8, 0xAA, 0x2D, 0xEC, 0xF0, -0xAA, 0xDE, 0x8E, 0xE8, 0xAB, 0xFC, 0xAB, 0x70, 0xAC, 0xBE, 0x70, 0xE8, 0xAD, 0xDC, 0x8D, 0x70, -0xAE, 0x9E, 0x52, 0xE8, 0xAF, 0xBC, 0x53, 0x50, 0xB0, 0x7E, 0x11, 0xC0, 0xB1, 0x9C, 0x35, 0x50, -0xB2, 0x67, 0x2E, 0x40, 0xB3, 0x7C, 0x17, 0x50, 0xB4, 0x47, 0x10, 0x40, 0xB5, 0x5B, 0xF9, 0x50, -0xB6, 0x26, 0xF2, 0x40, 0xB7, 0x3B, 0xDB, 0x50, 0xB8, 0x06, 0xD4, 0x40, 0xB9, 0x24, 0xF7, 0xD0, -0xB9, 0xE6, 0xB6, 0x40, 0xBB, 0x04, 0xD9, 0xD0, 0xBB, 0xCF, 0xD2, 0xC0, 0xBC, 0xE4, 0xBB, 0xD0, -0xBD, 0xAF, 0xB4, 0xC0, 0xBE, 0xC4, 0x9D, 0xD0, 0xBF, 0x8F, 0x96, 0xC0, 0xC0, 0xA4, 0x7F, 0xD0, -0xC1, 0x6F, 0x78, 0xC0, 0xC2, 0x84, 0x61, 0xD0, 0xC3, 0x4F, 0x5A, 0xC0, 0xC4, 0x64, 0x43, 0xD0, -0xC5, 0x2F, 0x3C, 0xC0, 0xC6, 0x4D, 0x60, 0x50, 0xC7, 0x0F, 0x1E, 0xC0, 0xC8, 0x2D, 0x42, 0x50, -0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, -0xD4, 0x40, 0xDD, 0xE0, 0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, -0xD8, 0x00, 0xA1, 0xE0, 0xD9, 0x15, 0x8A, 0xF0, 0xDA, 0x0E, 0xA8, 0x60, 0xDA, 0xFE, 0xA7, 0x70, -0xDB, 0xEE, 0x8A, 0x60, 0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, -0xDF, 0x89, 0x64, 0x60, 0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, -0xE3, 0x49, 0x28, 0x60, 0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x29, 0x0A, 0x60, 0xE6, 0x47, 0x2D, 0xF0, -0xE7, 0x12, 0x26, 0xE0, 0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, -0xEA, 0xF6, 0xD4, 0xE0, 0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, -0xEE, 0xBF, 0xD3, 0x60, 0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, -0xF2, 0x7F, 0x97, 0x60, 0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, -0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, -0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, -0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, -0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x08, 0x20, 0xC1, 0x70, -0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, -0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, -0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, -0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, -0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, -0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, -0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, -0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, -0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, -0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, -0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, -0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, -0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, -0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, -0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, -0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, -0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, -0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, -0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, -0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, -0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, -0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, -0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, -0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, -0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, -0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, -0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, -0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, -0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, -0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, -0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, 0x00, 0xCE, 0xC8, 0x32, 0x00, 0xA4, 0x22, 0x3A, 0x00, 0x00, 0x00, 0x26, -0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x51, -0x75, 0x65, 0x62, 0x65, 0x63, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, -0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* America/Montserrat */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x35, 0x10, -0x01, 0xFF, 0xFF, 0xC5, 0xAC, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0xD6, 0x32, 0x00, 0xB4, 0x62, -0x62, 0x00, 0x00, 0x00, 0x00, - -/* America/Nassau */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x37, 0x42, 0x84, -0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, -0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, -0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, -0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, -0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, -0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, -0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, -0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, -0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, -0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xB7, 0x7C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAF, 0x9A, 0x6D, 0x00, 0x9D, 0xB3, -0x18, 0x00, 0x00, 0x00, 0x00, - -/* America/New_York */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x1E, 0x70, -0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x86, 0x00, 0x70, 0xA1, 0x9A, 0xCD, 0x60, 0xA2, 0x65, 0xE2, 0x70, -0xA3, 0x83, 0xE9, 0xE0, 0xA4, 0x6A, 0xAE, 0x70, 0xA5, 0x35, 0xA7, 0x60, 0xA6, 0x53, 0xCA, 0xF0, -0xA7, 0x15, 0x89, 0x60, 0xA8, 0x33, 0xAC, 0xF0, 0xA8, 0xFE, 0xA5, 0xE0, 0xAA, 0x13, 0x8E, 0xF0, -0xAA, 0xDE, 0x87, 0xE0, 0xAB, 0xF3, 0x70, 0xF0, 0xAC, 0xBE, 0x69, 0xE0, 0xAD, 0xD3, 0x52, 0xF0, -0xAE, 0x9E, 0x4B, 0xE0, 0xAF, 0xB3, 0x34, 0xF0, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70, -0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70, -0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x1B, 0xD9, 0x70, -0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xC6, 0xB4, 0x60, 0xBC, 0xE4, 0xD7, 0xF0, -0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0, -0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0, -0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70, -0xC8, 0xF8, 0x57, 0x60, 0xCA, 0x0D, 0x40, 0x70, 0xCA, 0xD8, 0x39, 0x60, 0xCB, 0x88, 0xF0, 0x70, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, 0xD4, 0x40, 0xDD, 0xE0, -0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, -0xD9, 0x15, 0x8A, 0xF0, 0xD9, 0xE0, 0x83, 0xE0, 0xDA, 0xFE, 0xA7, 0x70, 0xDB, 0xC0, 0x65, 0xE0, -0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, 0xDF, 0x89, 0x64, 0x60, -0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, 0xE3, 0x49, 0x28, 0x60, -0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x57, 0x2E, 0xE0, 0xE6, 0x47, 0x2D, 0xF0, 0xE7, 0x37, 0x10, 0xE0, -0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, 0xEA, 0xF6, 0xD4, 0xE0, -0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, 0xEE, 0xBF, 0xD3, 0x60, -0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, 0xF2, 0x7F, 0x97, 0x60, -0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60, -0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0, -0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, -0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, -0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, -0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, -0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, -0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x01, 0x00, 0xC7, 0x74, 0x38, 0x00, 0xA1, 0xC0, 0xBE, 0x00, 0x00, 0x00, 0x0C, 0x45, -0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, - -/* America/Nipigon */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70, -0x9F, 0xC0, 0x31, 0x60, 0xC8, 0xF8, 0x49, 0x50, 0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xFB, 0xE0, 0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, -0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, -0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, -0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, -0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, -0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, -0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, -0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, -0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, -0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, -0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, -0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, -0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, -0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, -0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, -0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, -0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, -0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, -0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xD4, 0x1F, 0x62, 0x00, 0x8C, -0xC9, 0xAA, 0x00, 0x00, 0x00, 0x4B, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, -0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4F, 0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, 0x20, 0x26, 0x20, 0x51, -0x75, 0x65, 0x62, 0x65, 0x63, 0x20, 0x2D, 0x20, 0x70, 0x6C, 0x61, 0x63, 0x65, 0x73, 0x20, 0x74, -0x68, 0x61, 0x74, 0x20, 0x64, 0x69, 0x64, 0x20, 0x6E, 0x6F, 0x74, 0x20, 0x6F, 0x62, 0x73, 0x65, -0x72, 0x76, 0x65, 0x20, 0x44, 0x53, 0x54, 0x20, 0x31, 0x39, 0x36, 0x37, 0x2D, 0x31, 0x39, 0x37, -0x33, - -/* America/Nome */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x22, 0xCB, 0x89, 0x44, 0xD0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50, -0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50, -0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0, -0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50, -0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0, -0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50, -0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50, -0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50, -0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, -0x1C, 0xD2, 0x24, 0xB0, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, -0x20, 0x76, 0x39, 0x30, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, -0x24, 0x35, 0xFD, 0x30, 0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, -0x27, 0xFE, 0xFB, 0xB0, 0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, -0x2B, 0xBE, 0xBF, 0xB0, 0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, -0x2F, 0x7E, 0x83, 0xB0, 0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, -0x33, 0x47, 0x82, 0x30, 0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, -0x37, 0x07, 0x46, 0x30, 0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, -0x3A, 0xC7, 0x0A, 0x30, 0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, -0x3E, 0x90, 0x08, 0xB0, 0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, -0x42, 0x4F, 0xCC, 0xB0, 0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, -0x45, 0xF3, 0xE1, 0x30, 0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, -0x49, 0xB3, 0xA5, 0x30, 0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, -0x4D, 0x7C, 0xA3, 0xB0, 0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, -0x51, 0x3C, 0x67, 0xB0, 0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, -0x54, 0xFC, 0x2B, 0xB0, 0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, -0x58, 0xC5, 0x2A, 0x30, 0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, -0x5C, 0x84, 0xEE, 0x30, 0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, -0x60, 0x4D, 0xEC, 0xB0, 0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, -0x64, 0x0D, 0xB0, 0xB0, 0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, -0x67, 0xCD, 0x74, 0xB0, 0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, -0x6B, 0x96, 0x73, 0x30, 0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, -0x6F, 0x56, 0x37, 0x30, 0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, -0x73, 0x15, 0xFB, 0x30, 0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, -0x76, 0xDE, 0xF9, 0xB0, 0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, -0x7A, 0x9E, 0xBD, 0xB0, 0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, -0x7E, 0x5E, 0x81, 0xB0, 0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, -0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF, -0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x14, 0xFF, 0xFF, 0x8F, 0x80, 0x01, -0x18, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x1D, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, -0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x59, 0x53, 0x54, 0x00, 0x41, -0x4B, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEB, 0xBF, 0xFF, 0x00, 0x17, 0x82, -0x1E, 0x00, 0x00, 0x00, 0x19, 0x41, 0x6C, 0x61, 0x73, 0x6B, 0x61, 0x20, 0x54, 0x69, 0x6D, 0x65, -0x20, 0x2D, 0x20, 0x77, 0x65, 0x73, 0x74, 0x20, 0x41, 0x6C, 0x61, 0x73, 0x6B, 0x61, - -/* America/Noronha */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x65, 0x64, -0xB8, 0x0F, 0x3B, 0xD0, 0xB8, 0xFD, 0x32, 0x90, 0xB9, 0xF1, 0x26, 0x20, 0xBA, 0xDE, 0x66, 0x10, -0xDA, 0x38, 0xA0, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDC, 0x19, 0xD3, 0xA0, 0xDC, 0xB9, 0x4B, 0x10, -0xDD, 0xFB, 0x07, 0x20, 0xDE, 0x9B, 0xD0, 0x10, 0xDF, 0xDD, 0x8C, 0x20, 0xE0, 0x54, 0x25, 0x10, -0xF4, 0x97, 0xF1, 0xA0, 0xF5, 0x05, 0x50, 0x10, 0xF6, 0xC0, 0x56, 0x20, 0xF7, 0x0E, 0x10, 0x90, -0xF8, 0x51, 0x1E, 0x20, 0xF8, 0xC7, 0xB7, 0x10, 0xFA, 0x0A, 0xC4, 0xA0, 0xFA, 0xA8, 0xEA, 0x90, -0xFB, 0xEB, 0xF8, 0x20, 0xFC, 0x8B, 0x6F, 0x90, 0x1D, 0xC9, 0x80, 0x20, 0x1E, 0x78, 0xC9, 0x90, -0x1F, 0xA0, 0x27, 0xA0, 0x20, 0x33, 0xC1, 0x90, 0x21, 0x81, 0x5B, 0x20, 0x22, 0x0B, 0xBA, 0x90, -0x23, 0x58, 0x02, 0xA0, 0x23, 0xE2, 0x62, 0x10, 0x25, 0x37, 0xE4, 0xA0, 0x25, 0xD4, 0xB9, 0x10, -0x37, 0xF6, 0xB8, 0xA0, 0x38, 0xB8, 0x77, 0x10, 0x39, 0xDF, 0xD5, 0x20, 0x39, 0xE9, 0x01, 0x90, -0x3B, 0xC8, 0xF1, 0xA0, 0x3C, 0x6F, 0x00, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xE1, 0x9C, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4E, 0x53, 0x54, 0x00, 0x46, 0x4E, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x0C, 0x68, 0x00, 0xE2, 0x77, 0x42, 0x00, 0x00, 0x00, 0x10, -0x41, 0x74, 0x6C, 0x61, 0x6E, 0x74, 0x69, 0x63, 0x20, 0x69, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - - -/* America/North_Dakota/Center */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, -0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, -0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, -0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, -0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, -0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, -0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, -0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, -0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, -0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, -0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, -0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, -0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, -0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, -0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, -0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, -0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, -0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, -0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, -0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, -0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, -0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, -0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD1, 0x39, -0x16, 0x00, 0x79, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x2B, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, -0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4E, 0x6F, 0x72, 0x74, 0x68, 0x20, 0x44, 0x61, -0x6B, 0x6F, 0x74, 0x61, 0x20, 0x2D, 0x20, 0x4F, 0x6C, 0x69, 0x76, 0x65, 0x72, 0x20, 0x43, 0x6F, -0x75, 0x6E, 0x74, 0x79, - -/* America/North_Dakota/New_Salem */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, -0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, -0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, -0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, -0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, -0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, -0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, -0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, -0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, -0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, -0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, -0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, -0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, -0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, -0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, -0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, -0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, -0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, -0xB0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD0, 0xCF, -0x14, 0x00, 0x79, 0x2B, 0xDB, 0x00, 0x00, 0x00, 0x40, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, -0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4E, 0x6F, 0x72, 0x74, 0x68, 0x20, 0x44, 0x61, -0x6B, 0x6F, 0x74, 0x61, 0x20, 0x2D, 0x20, 0x4D, 0x6F, 0x72, 0x74, 0x6F, 0x6E, 0x20, 0x43, 0x6F, -0x75, 0x6E, 0x74, 0x79, 0x20, 0x28, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x4D, 0x61, 0x6E, -0x64, 0x61, 0x6E, 0x20, 0x61, 0x72, 0x65, 0x61, 0x29, - -/* America/Panama */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x8B, 0xF4, 0x61, 0xE8, -0x01, 0xFF, 0xFF, 0xB5, 0x18, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0x43, 0x4D, 0x54, -0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x02, 0xDA, 0x00, 0x9A, 0xED, -0x75, 0x00, 0x00, 0x00, 0x00, - -/* America/Pangnirtung */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x29, 0xA3, 0xD5, 0x52, 0x80, -0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xF7, 0x2F, 0x30, 0x40, -0xF8, 0x28, 0x5B, 0xC0, 0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, -0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, -0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, -0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, -0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, -0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, -0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, -0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, -0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, -0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, -0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xD1, 0xF0, -0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, -0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, -0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x03, 0x01, 0x02, 0x03, 0x04, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x08, 0x09, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, -0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0C, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x10, 0xFF, 0xFF, 0xD5, 0xD0, -0x01, 0x15, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x19, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x1D, 0xFF, 0xFF, -0xAB, 0xA0, 0x00, 0x21, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x25, 0x7A, 0x7A, 0x7A, 0x00, 0x41, 0x57, -0x54, 0x00, 0x41, 0x50, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x44, 0x54, 0x00, 0x41, -0x44, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, -0x44, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEE, 0x3D, 0x95, 0x00, 0xB0, 0x98, 0x55, 0x00, -0x00, 0x00, 0x23, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, -0x2D, 0x20, 0x50, 0x61, 0x6E, 0x67, 0x6E, 0x69, 0x72, 0x74, 0x75, 0x6E, 0x67, 0x2C, 0x20, 0x4E, -0x75, 0x6E, 0x61, 0x76, 0x75, 0x74, - -/* America/Paramaribo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x91, 0x05, 0x8E, 0xB8, -0xBE, 0x2A, 0x4B, 0xC4, 0xD2, 0x62, 0x2C, 0xB4, 0x0B, 0x11, 0x58, 0xB8, 0x1B, 0xBE, 0x31, 0xB8, -0x01, 0x02, 0x03, 0x04, 0x05, 0xFF, 0xFF, 0xCC, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xCC, 0x3C, 0x00, -0x04, 0xFF, 0xFF, 0xCC, 0x4C, 0x00, 0x04, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x08, 0xFF, 0xFF, 0xCE, -0xC8, 0x00, 0x0D, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4D, 0x54, -0x00, 0x4E, 0x45, 0x47, 0x54, 0x00, 0x53, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x3A, 0xE5, 0x00, 0xBE, 0xFD, 0x3A, 0x00, 0x00, -0x00, 0x00, - -/* America/Phoenix */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xCF, 0x17, 0xDF, 0x1C, 0xCF, 0x8F, 0xE5, 0xAC, 0xD0, 0x81, 0x1A, 0x1C, 0xFA, 0xF8, 0x75, 0x10, -0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF, -0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, -0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBC, 0x5E, 0x01, 0x00, 0x67, 0xDF, 0x25, 0x00, 0x00, 0x00, 0x20, 0x4D, 0x6F, -0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, -0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x41, 0x72, 0x69, 0x7A, 0x6F, 0x6E, 0x61, - -/* America/Port-au-Prince */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x9C, 0x6E, 0x71, 0xFC, -0x19, 0x1B, 0x46, 0xD0, 0x1A, 0x01, 0xEF, 0x40, 0x1A, 0xF1, 0xEE, 0x50, 0x1B, 0xE1, 0xD1, 0x40, -0x1C, 0xD1, 0xD0, 0x50, 0x1D, 0xC1, 0xB3, 0x40, 0x1E, 0xB1, 0xB2, 0x50, 0x1F, 0xA1, 0x95, 0x40, -0x20, 0x91, 0x94, 0x50, 0x21, 0x81, 0x77, 0x40, 0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xDC, 0x60, 0x42, 0x4F, 0x78, 0x50, 0x43, 0x64, 0x45, 0x40, -0x44, 0x2F, 0x5A, 0x50, 0x45, 0x44, 0x27, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBC, 0x44, 0x00, -0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, -0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0x50, 0x50, 0x4D, 0x54, 0x00, 0x45, 0x44, -0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xA5, 0x9B, 0xD5, 0x00, 0xA5, 0x4D, 0xB5, 0x00, 0x00, 0x00, 0x00, - -/* America/Porto_Acre */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0xAA, 0x86, 0x90, -0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40, -0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40, -0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40, -0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0, -0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0, -0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0, -0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0, -0x48, 0x60, 0x7F, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0xFF, 0xFF, 0xC0, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x43, -0x53, 0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Port_of_Spain */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x33, 0xAC, -0x01, 0xFF, 0xFF, 0xC6, 0x54, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x94, 0x68, 0x00, 0xB6, 0x5E, -0x32, 0x00, 0x00, 0x00, 0x00, - -/* America/Porto_Velho */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x82, 0xE8, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC4, -0x18, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x4A, 0xBA, 0x00, 0xB3, 0xE6, 0xB0, 0x00, 0x00, 0x00, 0x08, 0x52, 0x6F, -0x6E, 0x64, 0x6F, 0x6E, 0x69, 0x61, - -/* America/Puerto_Rico */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xCB, 0xF6, 0x32, 0xC0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0x02, 0x01, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0x41, 0x53, 0x54, -0x00, 0x41, 0x50, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, -0xA5, 0x82, 0x71, 0x00, 0xAE, 0x1C, 0xB3, 0x00, 0x00, 0x00, 0x00, - -/* America/Rainy_River */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0xA1, 0x80, -0x9F, 0xC0, 0x3F, 0x70, 0xC8, 0xF8, 0x57, 0x60, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x09, 0xF0, 0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x0A, 0x00, 0xB1, 0x80, -0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, -0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, -0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, -0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, -0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, -0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, -0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, -0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, -0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, 0x2B, 0xBE, 0x95, 0x80, -0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, -0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, -0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, -0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, -0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, -0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, -0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, -0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, -0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, -0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, -0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, -0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, -0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, -0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, -0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, -0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, -0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, -0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, -0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, -0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, -0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, -0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, -0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, -0x01, 0x0C, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xD3, 0xAA, 0x32, 0x00, 0x84, -0x17, 0x1A, 0x00, 0x00, 0x00, 0x32, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x54, 0x69, -0x6D, 0x65, 0x20, 0x2D, 0x20, 0x52, 0x61, 0x69, 0x6E, 0x79, 0x20, 0x52, 0x69, 0x76, 0x65, 0x72, -0x20, 0x26, 0x20, 0x46, 0x6F, 0x72, 0x74, 0x20, 0x46, 0x72, 0x61, 0x6E, 0x63, 0x65, 0x73, 0x2C, -0x20, 0x4F, 0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, - -/* America/Rankin_Inlet */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0xE7, 0x8C, 0x6E, 0x00, -0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x77, 0xE0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, -0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, -0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, -0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, -0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, -0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, -0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, -0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, -0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, -0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, -0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, -0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, -0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, -0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, -0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, -0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, -0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, -0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, -0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, -0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, -0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, -0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, -0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, -0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, -0x09, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0D, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x11, 0x7A, 0x7A, 0x7A, -0x00, 0x43, 0x44, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x45, 0x53, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE9, 0x2E, 0x02, -0x00, 0x86, 0x67, 0x71, 0x00, 0x00, 0x00, 0x1E, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, -0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x63, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x4E, -0x75, 0x6E, 0x61, 0x76, 0x75, 0x74, - -/* America/Recife */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x67, 0xB8, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x97, 0xFF, 0xB0, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, 0x39, 0xDF, 0xE3, 0x30, 0x39, 0xE9, 0x0F, 0xA0, -0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xDF, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x7D, 0x32, 0xC8, 0x00, 0xE0, 0x26, 0xD0, 0x00, 0x00, 0x00, 0x0A, -0x50, 0x65, 0x72, 0x6E, 0x61, 0x6D, 0x62, 0x75, 0x63, 0x6F, - -/* America/Regina */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x93, 0x1C, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xB5, 0x65, 0x4F, 0xF0, 0xB6, 0x30, 0x48, 0xE0, -0xB7, 0x45, 0x31, 0xF0, 0xB8, 0x10, 0x2A, 0xE0, 0xB9, 0x25, 0x13, 0xF0, 0xB9, 0xF0, 0x0C, 0xE0, -0xBB, 0x0E, 0x30, 0x70, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xEE, 0x12, 0x70, 0xBD, 0xB9, 0x0B, 0x60, -0xC2, 0x72, 0x08, 0xF0, 0xC3, 0x61, 0xEB, 0xE0, 0xC4, 0x51, 0xEA, 0xF0, 0xC5, 0x38, 0x93, 0x60, -0xC6, 0x31, 0xCC, 0xF0, 0xC7, 0x21, 0xAF, 0xE0, 0xC8, 0x1A, 0xE9, 0x70, 0xC9, 0x0A, 0xCC, 0x60, -0xC9, 0xFA, 0xCB, 0x70, 0xCA, 0xEA, 0xAE, 0x60, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x18, 0x00, 0xD3, 0x63, 0x8C, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10, -0xD9, 0xE0, 0xA0, 0x00, 0xDA, 0xFE, 0xC3, 0x90, 0xDB, 0xC0, 0x82, 0x00, 0xDC, 0xDE, 0xA5, 0x90, -0xDD, 0xA9, 0x9E, 0x80, 0xDE, 0xBE, 0x87, 0x90, 0xDF, 0x89, 0x80, 0x80, 0xE0, 0x9E, 0x69, 0x90, -0xE1, 0x69, 0x62, 0x80, 0xE2, 0x7E, 0x4B, 0x90, 0xE3, 0x49, 0x44, 0x80, 0xE4, 0x5E, 0x2D, 0x90, -0xE5, 0x29, 0x26, 0x80, 0xE6, 0x47, 0x4A, 0x10, 0xE7, 0x12, 0x43, 0x00, 0xE8, 0x27, 0x2C, 0x10, -0xE8, 0xF2, 0x25, 0x00, 0xEB, 0xE6, 0xF0, 0x10, 0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, 0xFF, 0x9D, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, -0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54, -0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xD6, 0x3B, -0xC0, 0x00, 0x74, 0xF5, 0x68, 0x00, 0x00, 0x00, 0x35, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, -0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, -0x20, 0x53, 0x61, 0x73, 0x6B, 0x61, 0x74, 0x63, 0x68, 0x65, 0x77, 0x61, 0x6E, 0x20, 0x2D, 0x20, -0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* America/Resolute */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0xD5, 0xFB, 0x81, 0x80, -0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x77, 0xE0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, -0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, -0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, -0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, -0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, -0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, -0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, -0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, -0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x09, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x0D, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x11, 0x7A, 0x7A, 0x7A, 0x00, 0x43, 0x44, 0x44, 0x54, 0x00, -0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x4E, 0x33, 0x00, 0x84, 0x7D, 0xA4, 0x00, 0x00, -0x00, 0x20, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, -0x20, 0x52, 0x65, 0x73, 0x6F, 0x6C, 0x75, 0x74, 0x65, 0x2C, 0x20, 0x4E, 0x75, 0x6E, 0x61, 0x76, -0x75, 0x74, - -/* America/Rio_Branco */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0xAA, 0x86, 0x90, -0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40, -0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40, -0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40, -0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0, -0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0, -0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0, -0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0, -0x48, 0x60, 0x7F, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0xFF, 0xFF, 0xC0, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x43, -0x53, 0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x7D, 0x12, 0x3A, 0x00, 0xAD, 0xA5, 0x20, 0x00, 0x00, 0x00, 0x04, 0x41, -0x63, 0x72, 0x65, - -/* America/Rosario */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA2, 0x92, 0x8F, 0x30, -0xB6, 0x7B, 0x52, 0x40, 0xB7, 0x1A, 0xC9, 0xB0, 0xB8, 0x1E, 0x8F, 0x40, 0xB8, 0xD4, 0x70, 0x30, -0xBA, 0x17, 0x7D, 0xC0, 0xBA, 0xB5, 0xA3, 0xB0, 0xBB, 0xF8, 0xB1, 0x40, 0xBC, 0x96, 0xD7, 0x30, -0xBD, 0xD9, 0xE4, 0xC0, 0xBE, 0x78, 0x0A, 0xB0, 0xBF, 0xBB, 0x18, 0x40, 0xC0, 0x5A, 0x8F, 0xB0, -0xC1, 0x9D, 0x9D, 0x40, 0xC2, 0x3B, 0xC3, 0x30, 0xC3, 0x7E, 0xD0, 0xC0, 0xC4, 0x1C, 0xF6, 0xB0, -0xC5, 0x60, 0x04, 0x40, 0xC5, 0xFE, 0x2A, 0x30, 0xC7, 0x41, 0x37, 0xC0, 0xC7, 0xE0, 0xAF, 0x30, -0xC8, 0x81, 0x94, 0x40, 0xCA, 0x4D, 0xA1, 0xB0, 0xCA, 0xEE, 0x86, 0xC0, 0xCE, 0x4D, 0xFF, 0x30, -0xCE, 0xB0, 0xED, 0xC0, 0xD3, 0x29, 0x35, 0xB0, 0xD4, 0x43, 0x64, 0xC0, 0xF4, 0x3D, 0x08, 0x30, -0xF4, 0x9F, 0xF6, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0x32, 0x10, 0x40, 0xF6, 0xE6, 0x9F, 0xB0, -0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, 0xFA, 0xD3, 0x36, 0xB0, -0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, 0xFE, 0x9C, 0x35, 0x30, -0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, 0x23, 0x94, 0xB5, 0xB0, -0x24, 0x10, 0x94, 0xA0, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xF0, 0x76, 0xA0, 0x27, 0x21, 0x0F, 0x30, -0x27, 0xD0, 0x58, 0xA0, 0x29, 0x00, 0xFF, 0x40, 0x29, 0xB0, 0x3A, 0xA0, 0x2A, 0xE0, 0xD3, 0x30, -0x2B, 0x99, 0x57, 0x20, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xBF, 0x2A, 0xB0, 0x47, 0x77, 0x09, 0xB0, -0x47, 0xDC, 0x7F, 0x20, 0x48, 0xFA, 0xA2, 0xB0, 0x49, 0xBC, 0x61, 0x20, 0x4A, 0xDA, 0x84, 0xB0, -0x4B, 0xA5, 0x7D, 0xA0, 0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x85, 0x5F, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, -0x4F, 0x65, 0x41, 0xA0, 0x50, 0x83, 0x65, 0x30, 0x51, 0x45, 0x23, 0xA0, 0x52, 0x63, 0x47, 0x30, -0x53, 0x25, 0x05, 0xA0, 0x54, 0x43, 0x29, 0x30, 0x55, 0x04, 0xE7, 0xA0, 0x56, 0x23, 0x0B, 0x30, -0x56, 0xEE, 0x04, 0x20, 0x58, 0x02, 0xED, 0x30, 0x58, 0xCD, 0xE6, 0x20, 0x59, 0xE2, 0xCF, 0x30, -0x5A, 0xAD, 0xC8, 0x20, 0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x8D, 0xAA, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, -0x5E, 0x6D, 0x8C, 0x20, 0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x56, 0xA8, 0xA0, 0x61, 0x6B, 0x91, 0xB0, -0x62, 0x36, 0x8A, 0xA0, 0x63, 0x4B, 0x73, 0xB0, 0x64, 0x16, 0x6C, 0xA0, 0x65, 0x2B, 0x55, 0xB0, -0x65, 0xF6, 0x4E, 0xA0, 0x67, 0x14, 0x72, 0x30, 0x67, 0xD6, 0x30, 0xA0, 0x68, 0xF4, 0x54, 0x30, -0x69, 0xB6, 0x12, 0xA0, 0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x9F, 0x2F, 0x20, 0x6C, 0xB4, 0x18, 0x30, -0x6D, 0x7F, 0x11, 0x20, 0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x5E, 0xF3, 0x20, 0x70, 0x7D, 0x16, 0xB0, -0x71, 0x3E, 0xD5, 0x20, 0x72, 0x5C, 0xF8, 0xB0, 0x73, 0x1E, 0xB7, 0x20, 0x74, 0x3C, 0xDA, 0xB0, -0x75, 0x07, 0xD3, 0xA0, 0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xE7, 0xB5, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, -0x78, 0xC7, 0x97, 0xA0, 0x79, 0xDC, 0x80, 0xB0, 0x7A, 0xA7, 0x79, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, -0x7C, 0x87, 0x5B, 0xA0, 0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x67, 0x3D, 0xA0, 0x7F, 0x85, 0x61, 0x30, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0xFF, 0xFF, 0xC3, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, -0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x41, 0x52, 0x54, -0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x57, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, -0x00, 0x00, 0x00, - -/* America/Santarem */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0xAA, 0x7A, 0x48, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x48, 0x60, 0x71, 0x40, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0xFF, 0xFF, 0xCC, 0xB8, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x09, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, -0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x86, 0xF0, 0x45, 0x00, 0xC1, 0x95, 0x4A, 0x00, 0x00, 0x00, 0x06, 0x57, -0x20, 0x50, 0x61, 0x72, 0x61, - -/* America/Santiago */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0D, 0x8F, 0x24, 0x69, 0xC6, -0x9B, 0x5C, 0xE5, 0x50, 0x9F, 0x71, 0x05, 0x46, 0xA1, 0x00, 0x71, 0xC0, 0xB0, 0x5E, 0x77, 0xC6, -0xB1, 0x77, 0x3D, 0x40, 0xB2, 0x41, 0x00, 0xD0, 0xB3, 0x58, 0x70, 0xC0, 0xB4, 0x22, 0x34, 0x50, -0xB5, 0x39, 0xA4, 0x40, 0xB6, 0x03, 0x67, 0xD0, 0xB7, 0x1A, 0xD7, 0xC0, 0xB7, 0xE4, 0x9B, 0x50, -0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xC7, 0x20, 0x50, 0xCC, 0x1C, 0x6E, 0x40, 0xCC, 0x6C, 0xE7, 0xD0, -0xD4, 0x1B, 0xC9, 0xB0, 0xD5, 0x76, 0xA0, 0x50, 0xFD, 0xD1, 0x3C, 0x40, 0xFE, 0x92, 0xFA, 0xB0, -0xFF, 0xCC, 0xCD, 0xC0, 0x00, 0x72, 0xDC, 0xB0, 0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, -0x03, 0x55, 0x32, 0xC0, 0x04, 0x20, 0x2B, 0xB0, 0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, -0x07, 0x0B, 0xBC, 0x40, 0x07, 0xDF, 0xEF, 0xB0, 0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, -0x0A, 0xDD, 0xF5, 0x40, 0x0B, 0xA8, 0xEE, 0x30, 0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, -0x0E, 0x9D, 0xB9, 0x40, 0x0F, 0x68, 0xB2, 0x30, 0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, -0x12, 0x66, 0xB7, 0xC0, 0x13, 0x28, 0x76, 0x30, 0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, -0x16, 0x26, 0x7B, 0xC0, 0x16, 0xF1, 0x74, 0xB0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, -0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, -0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x7F, 0x03, 0x30, -0x21, 0x6F, 0x02, 0x40, 0x22, 0x39, 0xFB, 0x30, 0x23, 0x45, 0xA9, 0xC0, 0x24, 0x19, 0xDD, 0x30, -0x25, 0x38, 0x00, 0xC0, 0x26, 0x02, 0xF9, 0xB0, 0x26, 0xF2, 0xF8, 0xC0, 0x27, 0xD9, 0xA1, 0x30, -0x28, 0xF7, 0xC4, 0xC0, 0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, -0x2C, 0xB7, 0x88, 0xC0, 0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, -0x30, 0x80, 0x87, 0x40, 0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x3D, 0xD7, 0x30, -0x34, 0x40, 0x4B, 0x40, 0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, -0x38, 0x00, 0x0F, 0x40, 0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, -0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, -0x3F, 0x88, 0xD1, 0xC0, 0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, -0x43, 0x48, 0x95, 0xC0, 0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, -0x47, 0x11, 0x94, 0x40, 0x47, 0xEF, 0x02, 0x30, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, -0x4A, 0xD1, 0x58, 0x40, 0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, -0x4E, 0x91, 0x1C, 0x40, 0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, -0x52, 0x5A, 0x1A, 0xC0, 0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, -0x56, 0x19, 0xDE, 0xC0, 0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, -0x59, 0xE2, 0xDD, 0x40, 0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, -0x5D, 0xA2, 0xA1, 0x40, 0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, -0x61, 0x62, 0x65, 0x40, 0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, -0x65, 0x2B, 0x63, 0xC0, 0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, -0x68, 0xEB, 0x27, 0xC0, 0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, -0x6C, 0xAA, 0xEB, 0xC0, 0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, -0x70, 0x73, 0xEA, 0x40, 0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, -0x74, 0x33, 0xAE, 0x40, 0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, -0x77, 0xF3, 0x72, 0x40, 0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, -0x7B, 0xBC, 0x70, 0xC0, 0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, -0x7F, 0x7C, 0x34, 0xC0, 0x01, 0x00, 0x02, 0x00, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x04, 0x05, 0x04, 0x02, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0xFF, 0xFF, 0xBD, 0xBA, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x04, 0x53, 0x4D, 0x54, 0x00, 0x43, 0x4C, 0x54, 0x00, 0x43, 0x4C, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, -0x57, 0xA9, 0x68, 0x00, 0xA8, 0xDD, 0x2A, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, -0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* America/Santo_Domingo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0xBA, 0xDF, 0x42, 0x60, -0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xA7, 0xC3, 0x40, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x43, 0x7B, 0xC8, -0x01, 0x87, 0xD3, 0xD0, 0x01, 0xFA, 0x7F, 0x48, 0x03, 0x70, 0xF0, 0x50, 0x03, 0xDD, 0x04, 0x48, -0x05, 0x50, 0xD2, 0x50, 0x05, 0xBF, 0x89, 0x48, 0x07, 0x30, 0xB4, 0x50, 0x07, 0xA0, 0xBC, 0xC8, -0x09, 0x10, 0x96, 0x50, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0x29, 0xE1, 0x60, 0x02, 0x01, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x02, 0x04, 0xFF, 0xFF, 0xBE, 0x60, -0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x05, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x09, 0xFF, 0xFF, -0xC0, 0xB8, 0x01, 0x0D, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x12, 0x53, 0x44, 0x4D, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x48, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x81, 0xCA, 0x00, 0xAA, -0xBE, 0xF0, 0x00, 0x00, 0x00, 0x00, - -/* America/Sao_Paulo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x72, 0xB4, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x5A, 0x09, 0x30, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x27, 0x21, 0x0F, 0x30, 0x27, 0xBD, 0xE3, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0x94, 0x8B, 0x20, -0x2A, 0xEA, 0x0D, 0xB0, 0x2B, 0x6B, 0x32, 0xA0, 0x2C, 0xC0, 0xB5, 0x30, 0x2D, 0x66, 0xC4, 0x20, -0x2E, 0xA0, 0x97, 0x30, 0x2F, 0x46, 0xA6, 0x20, 0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, -0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, -0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, -0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, -0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x3F, 0x91, 0xFE, 0x30, 0x40, 0x2E, 0xD2, 0xA0, -0x41, 0x86, 0xF8, 0x30, 0x42, 0x17, 0xEF, 0x20, 0x43, 0x51, 0xC2, 0x30, 0x43, 0xF7, 0xD1, 0x20, -0x45, 0x4D, 0x53, 0xB0, 0x45, 0xE0, 0xED, 0xA0, 0x47, 0x11, 0x86, 0x30, 0x47, 0xB7, 0x95, 0x20, -0x48, 0xFA, 0xA2, 0xB0, 0x49, 0x97, 0x77, 0x20, 0x4A, 0xDA, 0x84, 0xB0, 0x4B, 0x80, 0x93, 0xA0, -0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x60, 0x75, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, 0x4F, 0x49, 0x92, 0x20, -0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0, -0x54, 0x43, 0x29, 0x30, 0x54, 0xE9, 0x38, 0x20, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20, -0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20, -0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20, -0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0, -0x63, 0x4B, 0x73, 0xB0, 0x63, 0xFA, 0xBD, 0x20, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0, -0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x9A, 0x63, 0x20, -0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20, -0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20, -0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20, -0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xAB, 0xE8, 0x20, -0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0, -0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x4B, 0x8E, 0x20, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xD4, 0x4C, -0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, -0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x67, 0x0C, 0x35, 0x00, 0xCD, 0x68, 0xA2, 0x00, 0x00, 0x00, 0x32, 0x53, 0x20, 0x26, -0x20, 0x53, 0x45, 0x20, 0x42, 0x72, 0x61, 0x7A, 0x69, 0x6C, 0x20, 0x28, 0x47, 0x4F, 0x2C, 0x20, -0x44, 0x46, 0x2C, 0x20, 0x4D, 0x47, 0x2C, 0x20, 0x45, 0x53, 0x2C, 0x20, 0x52, 0x4A, 0x2C, 0x20, -0x53, 0x50, 0x2C, 0x20, 0x50, 0x52, 0x2C, 0x20, 0x53, 0x43, 0x2C, 0x20, 0x52, 0x53, 0x29, - -/* America/Scoresbysund */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x80, 0x4C, 0x18, -0x13, 0x4D, 0x6E, 0x40, 0x14, 0x34, 0x24, 0xC0, 0x15, 0x23, 0xF9, 0xA0, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x03, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xEB, 0x68, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, -0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x08, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x04, 0xFF, 0xFF, 0xF1, -0xF0, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x4C, -0x4D, 0x54, 0x00, 0x43, 0x47, 0x54, 0x00, 0x43, 0x47, 0x53, 0x54, 0x00, 0x45, 0x47, 0x54, 0x00, -0x45, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0xF4, 0xE0, 0xCD, 0x00, 0xF4, 0x16, 0xFA, 0x00, 0x00, 0x00, 0x1F, 0x53, -0x63, 0x6F, 0x72, 0x65, 0x73, 0x62, 0x79, 0x73, 0x75, 0x6E, 0x64, 0x20, 0x2F, 0x20, 0x49, 0x74, -0x74, 0x6F, 0x71, 0x71, 0x6F, 0x72, 0x74, 0x6F, 0x6F, 0x72, 0x6D, 0x69, 0x69, 0x74, - -/* America/Shiprock */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, -0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00, -0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xC1, 0x75, -0x9B, 0x00, 0x6E, 0xE9, 0x1E, 0x00, 0x00, 0x00, 0x16, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, -0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4E, 0x61, 0x76, 0x61, 0x6A, 0x6F, - -/* America/St_Barthelemy */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xD5, 0xE1, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0x9D, 0xED, 0x00, 0xB5, 0x59, -0xC8, 0x00, 0x00, 0x00, 0x00, - -/* America/St_Johns */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEE, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x9C, 0xCF, 0x62, 0x0C, -0x9D, 0xA4, 0xE6, 0xFC, 0x9E, 0xB8, 0x7E, 0x8C, 0x9F, 0xC0, 0x1C, 0x7C, 0xA0, 0xB6, 0x88, 0xDC, -0xA1, 0x38, 0xFF, 0x4C, 0xA2, 0x95, 0x19, 0x5C, 0xA3, 0x84, 0xFC, 0x4C, 0xA4, 0x74, 0xFB, 0x5C, -0xA5, 0x64, 0xDE, 0x4C, 0xA6, 0x5E, 0x17, 0xDC, 0xA7, 0x44, 0xC0, 0x4C, 0xA8, 0x3D, 0xF9, 0xDC, -0xA9, 0x24, 0xA2, 0x4C, 0xAA, 0x1D, 0xDB, 0xDC, 0xAB, 0x04, 0x84, 0x4C, 0xAB, 0xFD, 0xBD, 0xDC, -0xAC, 0xE4, 0x66, 0x4C, 0xAD, 0xDD, 0x9F, 0xDC, 0xAE, 0xCD, 0x82, 0xCC, 0xAF, 0xBD, 0x81, 0xDC, -0xB0, 0xAD, 0x64, 0xCC, 0xB1, 0xA6, 0x9E, 0x5C, 0xB2, 0x8D, 0x46, 0xCC, 0xB3, 0x86, 0x80, 0x5C, -0xB4, 0x6D, 0x28, 0xCC, 0xB5, 0x66, 0x62, 0x5C, 0xB6, 0x4D, 0x0A, 0xCC, 0xB7, 0x46, 0x44, 0x5C, -0xB8, 0x2C, 0xEC, 0xCC, 0xB9, 0x26, 0x26, 0x5C, 0xBA, 0x16, 0x09, 0x4C, 0xBB, 0x0F, 0x42, 0xDC, -0xBB, 0xF5, 0xEB, 0x4C, 0xBC, 0xEF, 0x24, 0xDC, 0xBD, 0xD5, 0xCD, 0x4C, 0xBE, 0x9E, 0x4D, 0x6C, -0xBE, 0xCF, 0x06, 0xA8, 0xBF, 0xB5, 0xAF, 0x18, 0xC0, 0xB8, 0x31, 0x38, 0xC1, 0x79, 0xEF, 0xA8, -0xC2, 0x98, 0x13, 0x38, 0xC3, 0x59, 0xD1, 0xA8, 0xC4, 0x77, 0xF5, 0x38, 0xC5, 0x39, 0xB3, 0xA8, -0xC6, 0x61, 0x11, 0xB8, 0xC7, 0x19, 0x95, 0xA8, 0xC8, 0x40, 0xF3, 0xB8, 0xC9, 0x02, 0xB2, 0x28, -0xCA, 0x20, 0xD5, 0xB8, 0xCA, 0xE2, 0x94, 0x28, 0xCC, 0x00, 0xB7, 0xB8, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xE6, 0xC8, 0xD3, 0x88, 0x44, 0xD8, 0xD4, 0x4A, 0x03, 0x48, 0xD5, 0x68, 0x26, 0xD8, -0xD6, 0x29, 0xE5, 0x48, 0xD7, 0x48, 0x08, 0xD8, 0xD8, 0x09, 0xC7, 0x48, 0xD9, 0x27, 0xEA, 0xD8, -0xD9, 0xE9, 0xA9, 0x48, 0xDB, 0x11, 0x07, 0x58, 0xDB, 0xD2, 0xC5, 0xC8, 0xDC, 0xDE, 0x74, 0x58, -0xDD, 0xA9, 0x6D, 0x48, 0xDE, 0xBE, 0x56, 0x58, 0xDF, 0x89, 0x4F, 0x48, 0xE0, 0x9E, 0x38, 0x58, -0xE1, 0x69, 0x31, 0x48, 0xE2, 0x7E, 0x1A, 0x58, 0xE3, 0x49, 0x13, 0x48, 0xE4, 0x5D, 0xFC, 0x58, -0xE5, 0x28, 0xF5, 0x48, 0xE6, 0x47, 0x18, 0xD8, 0xE7, 0x12, 0x11, 0xC8, 0xE8, 0x26, 0xFA, 0xD8, -0xE8, 0xF1, 0xF3, 0xC8, 0xEA, 0x06, 0xDC, 0xD8, 0xEA, 0xD1, 0xD5, 0xC8, 0xEB, 0xE6, 0xBE, 0xD8, -0xEC, 0xB1, 0xB7, 0xC8, 0xED, 0xC6, 0xA0, 0xD8, 0xEE, 0xBF, 0xBE, 0x48, 0xEF, 0xAF, 0xBD, 0x58, -0xF0, 0x9F, 0xA0, 0x48, 0xF1, 0x8F, 0x9F, 0x58, 0xF2, 0x7F, 0x82, 0x48, 0xF3, 0x6F, 0x81, 0x58, -0xF4, 0x5F, 0x64, 0x48, 0xF5, 0x4F, 0x63, 0x58, 0xF6, 0x3F, 0x46, 0x48, 0xF7, 0x2F, 0x45, 0x58, -0xF8, 0x28, 0x62, 0xC8, 0xF9, 0x0F, 0x27, 0x58, 0xFA, 0x08, 0x44, 0xC8, 0xFA, 0xF8, 0x43, 0xD8, -0xFB, 0xE8, 0x26, 0xC8, 0xFC, 0xD8, 0x25, 0xD8, 0xFD, 0xC8, 0x08, 0xC8, 0xFE, 0xB8, 0x07, 0xD8, -0xFF, 0xA7, 0xEA, 0xC8, 0x00, 0x97, 0xE9, 0xD8, 0x01, 0x87, 0xCC, 0xC8, 0x02, 0x77, 0xCB, 0xD8, -0x03, 0x70, 0xE9, 0x48, 0x04, 0x60, 0xE8, 0x58, 0x05, 0x50, 0xCB, 0x48, 0x06, 0x40, 0xCA, 0x58, -0x07, 0x30, 0xAD, 0x48, 0x08, 0x20, 0xAC, 0x58, 0x09, 0x10, 0x8F, 0x48, 0x0A, 0x00, 0x8E, 0x58, -0x0A, 0xF0, 0x71, 0x48, 0x0B, 0xE0, 0x70, 0x58, 0x0C, 0xD9, 0x8D, 0xC8, 0x0D, 0xC0, 0x52, 0x58, -0x0E, 0xB9, 0x6F, 0xC8, 0x0F, 0xA9, 0x6E, 0xD8, 0x10, 0x99, 0x51, 0xC8, 0x11, 0x89, 0x50, 0xD8, -0x12, 0x79, 0x33, 0xC8, 0x13, 0x69, 0x32, 0xD8, 0x14, 0x59, 0x15, 0xC8, 0x15, 0x49, 0x14, 0xD8, -0x16, 0x38, 0xF7, 0xC8, 0x17, 0x28, 0xF6, 0xD8, 0x18, 0x22, 0x14, 0x48, 0x19, 0x08, 0xD8, 0xD8, -0x1A, 0x01, 0xF6, 0x48, 0x1A, 0xF1, 0xF5, 0x58, 0x1B, 0xE1, 0xD8, 0x48, 0x1C, 0xD1, 0xD7, 0x58, -0x1D, 0xC1, 0xBA, 0x48, 0x1E, 0xB1, 0xB9, 0x58, 0x1F, 0xA1, 0x9C, 0x48, 0x20, 0x75, 0xCF, 0xF4, -0x21, 0x81, 0x62, 0x64, 0x22, 0x55, 0xB1, 0xF4, 0x23, 0x6A, 0x70, 0xD4, 0x24, 0x35, 0x93, 0xF4, -0x25, 0x4A, 0x60, 0xE4, 0x26, 0x15, 0x75, 0xF4, 0x27, 0x2A, 0x42, 0xE4, 0x27, 0xFE, 0x92, 0x74, -0x29, 0x0A, 0x24, 0xE4, 0x29, 0xDE, 0x74, 0x74, 0x2A, 0xEA, 0x06, 0xE4, 0x2B, 0xBE, 0x56, 0x74, -0x2C, 0xD3, 0x23, 0x64, 0x2D, 0x9E, 0x38, 0x74, 0x2E, 0xB3, 0x05, 0x64, 0x2F, 0x7E, 0x1A, 0x74, -0x30, 0x92, 0xE7, 0x64, 0x31, 0x67, 0x36, 0xF4, 0x32, 0x72, 0xC9, 0x64, 0x33, 0x47, 0x18, 0xF4, -0x34, 0x52, 0xAB, 0x64, 0x35, 0x26, 0xFA, 0xF4, 0x36, 0x32, 0x8D, 0x64, 0x37, 0x06, 0xDC, 0xF4, -0x38, 0x1B, 0xA9, 0xE4, 0x38, 0xE6, 0xBE, 0xF4, 0x39, 0xFB, 0x8B, 0xE4, 0x3A, 0xC6, 0xA0, 0xF4, -0x3B, 0xDB, 0x6D, 0xE4, 0x3C, 0xAF, 0xBD, 0x74, 0x3D, 0xBB, 0x4F, 0xE4, 0x3E, 0x8F, 0x9F, 0x74, -0x3F, 0x9B, 0x31, 0xE4, 0x40, 0x6F, 0x81, 0x74, 0x41, 0x84, 0x4E, 0x64, 0x42, 0x4F, 0x63, 0x74, -0x43, 0x64, 0x30, 0x64, 0x44, 0x2F, 0x45, 0x74, 0x45, 0x44, 0x12, 0x64, 0x45, 0xF3, 0x77, 0xF4, -0x47, 0x2D, 0x2E, 0xE4, 0x47, 0xD3, 0x59, 0xF4, 0x49, 0x0D, 0x10, 0xE4, 0x49, 0xB3, 0x3B, 0xF4, -0x4A, 0xEC, 0xF2, 0xE4, 0x4B, 0x9C, 0x58, 0x74, 0x4C, 0xD6, 0x0F, 0x64, 0x4D, 0x7C, 0x3A, 0x74, -0x4E, 0xB5, 0xF1, 0x64, 0x4F, 0x5C, 0x1C, 0x74, 0x50, 0x95, 0xD3, 0x64, 0x51, 0x3B, 0xFE, 0x74, -0x52, 0x75, 0xB5, 0x64, 0x53, 0x1B, 0xE0, 0x74, 0x54, 0x55, 0x97, 0x64, 0x54, 0xFB, 0xC2, 0x74, -0x56, 0x35, 0x79, 0x64, 0x56, 0xE4, 0xDE, 0xF4, 0x58, 0x1E, 0x95, 0xE4, 0x58, 0xC4, 0xC0, 0xF4, -0x59, 0xFE, 0x77, 0xE4, 0x5A, 0xA4, 0xA2, 0xF4, 0x5B, 0xDE, 0x59, 0xE4, 0x5C, 0x84, 0x84, 0xF4, -0x5D, 0xBE, 0x3B, 0xE4, 0x5E, 0x64, 0x66, 0xF4, 0x5F, 0x9E, 0x1D, 0xE4, 0x60, 0x4D, 0x83, 0x74, -0x61, 0x87, 0x3A, 0x64, 0x62, 0x2D, 0x65, 0x74, 0x63, 0x67, 0x1C, 0x64, 0x64, 0x0D, 0x47, 0x74, -0x65, 0x46, 0xFE, 0x64, 0x65, 0xED, 0x29, 0x74, 0x67, 0x26, 0xE0, 0x64, 0x67, 0xCD, 0x0B, 0x74, -0x69, 0x06, 0xC2, 0x64, 0x69, 0xAC, 0xED, 0x74, 0x6A, 0xE6, 0xA4, 0x64, 0x6B, 0x96, 0x09, 0xF4, -0x6C, 0xCF, 0xC0, 0xE4, 0x6D, 0x75, 0xEB, 0xF4, 0x6E, 0xAF, 0xA2, 0xE4, 0x6F, 0x55, 0xCD, 0xF4, -0x70, 0x8F, 0x84, 0xE4, 0x71, 0x35, 0xAF, 0xF4, 0x72, 0x6F, 0x66, 0xE4, 0x73, 0x15, 0x91, 0xF4, -0x74, 0x4F, 0x48, 0xE4, 0x74, 0xFE, 0xAE, 0x74, 0x76, 0x38, 0x65, 0x64, 0x76, 0xDE, 0x90, 0x74, -0x78, 0x18, 0x47, 0x64, 0x78, 0xBE, 0x72, 0x74, 0x79, 0xF8, 0x29, 0x64, 0x7A, 0x9E, 0x54, 0x74, -0x7B, 0xD8, 0x0B, 0x64, 0x7C, 0x7E, 0x36, 0x74, 0x7D, 0xB7, 0xED, 0x64, 0x7E, 0x5E, 0x18, 0x74, -0x7F, 0x97, 0xCF, 0x64, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x06, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0xFF, 0xFF, 0xDC, 0xA4, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0x94, 0x00, 0x04, 0xFF, 0xFF, -0xDC, 0xD8, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x04, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x08, -0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x0C, 0xFF, 0xFF, 0xEA, 0xE8, 0x01, 0x10, 0x4E, 0x44, 0x54, 0x00, -0x4E, 0x53, 0x54, 0x00, 0x4E, 0x50, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, 0x44, 0x44, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0xD1, 0xE8, 0xFA, 0x00, 0xC4, 0x67, 0xF2, 0x00, 0x00, 0x00, 0x28, 0x4E, 0x65, 0x77, 0x66, 0x6F, -0x75, 0x6E, 0x64, 0x6C, 0x61, 0x6E, 0x64, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x2C, 0x20, 0x69, 0x6E, -0x63, 0x6C, 0x75, 0x64, 0x69, 0x6E, 0x67, 0x20, 0x53, 0x45, 0x20, 0x4C, 0x61, 0x62, 0x72, 0x61, -0x64, 0x6F, 0x72, - -/* America/St_Kitts */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x93, 0x37, 0x34, 0xCC, -0x01, 0xFF, 0xFF, 0xC5, 0x34, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA3, 0xBA, 0x10, 0x00, 0xB5, 0x25, -0xB2, 0x00, 0x00, 0x00, 0x00, - -/* America/St_Lucia */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0xC7, 0xB0, -0x01, 0xFF, 0xFF, 0xC6, 0xD0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x43, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, 0xB7, 0x82, 0x00, 0xB5, 0x94, -0x60, 0x00, 0x00, 0x00, 0x00, - -/* America/St_Thomas */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60, -0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x54, 0x38, 0x00, 0xB2, 0x6D, -0x15, 0x00, 0x00, 0x00, 0x00, - -/* America/St_Vincent */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x92, 0xE6, 0xC7, 0xE8, -0x01, 0xFF, 0xFF, 0xC6, 0x98, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4B, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0x64, 0xF8, 0x00, 0xB5, 0xEF, -0x85, 0x00, 0x00, 0x00, 0x00, - -/* America/Swift_Current */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x96, 0x18, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x18, 0x00, 0xD3, 0x76, 0x01, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10, -0xD9, 0xE0, 0xA0, 0x00, 0xE8, 0x27, 0x2C, 0x10, 0xE9, 0x17, 0x0F, 0x00, 0xEB, 0xE6, 0xF0, 0x10, -0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10, 0xEE, 0x91, 0xCB, 0x00, 0xEF, 0xAF, 0xEE, 0x90, -0xF0, 0x71, 0xAD, 0x00, 0x04, 0x61, 0x19, 0x90, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, -0xFF, 0x9A, 0xE8, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, -0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, -0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, -0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xD6, 0x0E, 0x2D, 0x00, 0x70, 0xA9, 0x25, 0x00, -0x00, 0x00, 0x2E, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x53, 0x74, 0x61, 0x6E, 0x64, -0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x53, 0x61, 0x73, 0x6B, 0x61, -0x74, 0x63, 0x68, 0x65, 0x77, 0x61, 0x6E, 0x20, 0x2D, 0x20, 0x6D, 0x69, 0x64, 0x77, 0x65, 0x73, -0x74, - -/* America/Tegucigalpa */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA4, 0x4C, 0x4B, 0x44, -0x20, 0x9A, 0xDC, 0xE0, 0x21, 0x5C, 0x9B, 0x50, 0x22, 0x7A, 0xBE, 0xE0, 0x23, 0x3C, 0x7D, 0x50, -0x44, 0x5D, 0x8C, 0xE0, 0x44, 0xD6, 0xC8, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xAE, 0x3C, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, -0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x9E, 0xD8, 0x10, 0x00, 0x8E, 0x3C, 0xC2, 0x00, 0x00, 0x00, 0x00, - -/* America/Thule */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9B, 0x80, 0x77, 0xFC, -0x27, 0xF5, 0x7A, 0xE0, 0x28, 0xE5, 0x5D, 0xD0, 0x29, 0xD5, 0x5C, 0xE0, 0x2A, 0xC5, 0x3F, 0xD0, -0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x28, 0x50, -0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xEC, 0x50, -0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0, 0x36, 0x32, 0xB0, 0x50, -0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0, 0x39, 0xFB, 0xAE, 0xD0, -0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60, 0x3D, 0xBB, 0x72, 0xD0, -0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60, 0x41, 0x84, 0x71, 0x50, -0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60, 0x45, 0x44, 0x35, 0x50, -0x45, 0xF3, 0x9A, 0xE0, 0x47, 0x2D, 0x51, 0xD0, 0x47, 0xD3, 0x7C, 0xE0, 0x49, 0x0D, 0x33, 0xD0, -0x49, 0xB3, 0x5E, 0xE0, 0x4A, 0xED, 0x15, 0xD0, 0x4B, 0x9C, 0x7B, 0x60, 0x4C, 0xD6, 0x32, 0x50, -0x4D, 0x7C, 0x5D, 0x60, 0x4E, 0xB6, 0x14, 0x50, 0x4F, 0x5C, 0x3F, 0x60, 0x50, 0x95, 0xF6, 0x50, -0x51, 0x3C, 0x21, 0x60, 0x52, 0x75, 0xD8, 0x50, 0x53, 0x1C, 0x03, 0x60, 0x54, 0x55, 0xBA, 0x50, -0x54, 0xFB, 0xE5, 0x60, 0x56, 0x35, 0x9C, 0x50, 0x56, 0xE5, 0x01, 0xE0, 0x58, 0x1E, 0xB8, 0xD0, -0x58, 0xC4, 0xE3, 0xE0, 0x59, 0xFE, 0x9A, 0xD0, 0x5A, 0xA4, 0xC5, 0xE0, 0x5B, 0xDE, 0x7C, 0xD0, -0x5C, 0x84, 0xA7, 0xE0, 0x5D, 0xBE, 0x5E, 0xD0, 0x5E, 0x64, 0x89, 0xE0, 0x5F, 0x9E, 0x40, 0xD0, -0x60, 0x4D, 0xA6, 0x60, 0x61, 0x87, 0x5D, 0x50, 0x62, 0x2D, 0x88, 0x60, 0x63, 0x67, 0x3F, 0x50, -0x64, 0x0D, 0x6A, 0x60, 0x65, 0x47, 0x21, 0x50, 0x65, 0xED, 0x4C, 0x60, 0x67, 0x27, 0x03, 0x50, -0x67, 0xCD, 0x2E, 0x60, 0x69, 0x06, 0xE5, 0x50, 0x69, 0xAD, 0x10, 0x60, 0x6A, 0xE6, 0xC7, 0x50, -0x6B, 0x96, 0x2C, 0xE0, 0x6C, 0xCF, 0xE3, 0xD0, 0x6D, 0x76, 0x0E, 0xE0, 0x6E, 0xAF, 0xC5, 0xD0, -0x6F, 0x55, 0xF0, 0xE0, 0x70, 0x8F, 0xA7, 0xD0, 0x71, 0x35, 0xD2, 0xE0, 0x72, 0x6F, 0x89, 0xD0, -0x73, 0x15, 0xB4, 0xE0, 0x74, 0x4F, 0x6B, 0xD0, 0x74, 0xFE, 0xD1, 0x60, 0x76, 0x38, 0x88, 0x50, -0x76, 0xDE, 0xB3, 0x60, 0x78, 0x18, 0x6A, 0x50, 0x78, 0xBE, 0x95, 0x60, 0x79, 0xF8, 0x4C, 0x50, -0x7A, 0x9E, 0x77, 0x60, 0x7B, 0xD8, 0x2E, 0x50, 0x7C, 0x7E, 0x59, 0x60, 0x7D, 0xB8, 0x10, 0x50, -0x7E, 0x5E, 0x3B, 0x60, 0x7F, 0x97, 0xF2, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xBF, 0x84, 0x00, 0x00, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x44, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x29, 0x1A, 0x00, -0xAC, 0x17, 0xFD, 0x00, 0x00, 0x00, 0x10, 0x54, 0x68, 0x75, 0x6C, 0x65, 0x20, 0x2F, 0x20, 0x50, -0x69, 0x74, 0x75, 0x66, 0x66, 0x69, 0x6B, - -/* America/Thunder_Bay */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x8F, 0x24, 0x7B, 0xE0, -0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, -0x05, 0x50, 0xE0, 0x60, 0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, -0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, -0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, -0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, -0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, -0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, -0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, -0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, -0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, -0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, -0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, -0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, -0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, -0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, -0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, -0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, -0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, -0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, -0xAB, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x10, 0x43, 0x53, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xD3, 0x27, 0xFD, 0x00, 0x8B, -0x3C, 0x88, 0x00, 0x00, 0x00, 0x23, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, -0x6D, 0x65, 0x20, 0x2D, 0x20, 0x54, 0x68, 0x75, 0x6E, 0x64, 0x65, 0x72, 0x20, 0x42, 0x61, 0x79, -0x2C, 0x20, 0x4F, 0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, - -/* America/Tijuana */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0xA5, 0xB6, 0xF6, 0x80, -0xA9, 0x79, 0x4F, 0x70, 0xAF, 0xF2, 0x7C, 0xF0, 0xB6, 0x66, 0x64, 0x70, 0xB7, 0x1B, 0x10, 0x00, -0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x99, 0xBA, 0x70, -0xD7, 0x1B, 0x59, 0x00, 0xD8, 0x91, 0xB4, 0xF0, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, -0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, -0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, -0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, -0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, -0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, -0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, -0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, -0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, -0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, -0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, -0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, -0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, -0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, -0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, -0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, -0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, -0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, -0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, -0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x04, 0x05, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0x92, 0x4C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, -0x04, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, -0x90, 0x01, 0x10, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xBA, 0xF8, -0x95, 0x00, 0x60, 0x27, 0xE2, 0x00, 0x00, 0x00, 0x0C, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, -0x20, 0x54, 0x69, 0x6D, 0x65, - -/* America/Toronto */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70, -0x9F, 0xC0, 0x31, 0x60, 0xA0, 0x87, 0x2E, 0xC8, 0xA1, 0x9A, 0xB1, 0x40, 0xA2, 0x94, 0x06, 0xF0, -0xA3, 0x55, 0xA9, 0x40, 0xA4, 0x86, 0x5D, 0xF0, 0xA5, 0x28, 0x78, 0x60, 0xA6, 0x66, 0x3F, 0xF0, -0xA7, 0x0C, 0x4E, 0xE0, 0xA8, 0x46, 0x21, 0xF0, 0xA8, 0xEC, 0x30, 0xE0, 0xAA, 0x1C, 0xC9, 0x70, -0xAA, 0xD5, 0x4D, 0x60, 0xAB, 0xFC, 0xAB, 0x70, 0xAC, 0xB5, 0x2F, 0x60, 0xAD, 0xDC, 0x8D, 0x70, -0xAE, 0x95, 0x11, 0x60, 0xAF, 0xBC, 0x6F, 0x70, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70, -0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70, -0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x25, 0x13, 0xF0, -0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xE4, 0xD7, 0xF0, -0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0, -0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0, -0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70, -0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, -0xD4, 0x40, 0xDD, 0xE0, 0xD5, 0x55, 0xAA, 0xD0, 0xD6, 0x20, 0xA3, 0xC0, 0xD7, 0x35, 0x8C, 0xD0, -0xD8, 0x00, 0x85, 0xC0, 0xD9, 0x15, 0x6E, 0xD0, 0xDA, 0x33, 0x76, 0x40, 0xDA, 0xFE, 0xA7, 0x70, -0xDC, 0x13, 0x74, 0x60, 0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, -0xDF, 0x89, 0x64, 0x60, 0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, -0xE3, 0x49, 0x28, 0x60, 0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x29, 0x0A, 0x60, 0xE6, 0x47, 0x2D, 0xF0, -0xE7, 0x12, 0x26, 0xE0, 0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, -0xEA, 0xF6, 0xD4, 0xE0, 0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, -0xEE, 0xBF, 0xD3, 0x60, 0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, -0xF2, 0x7F, 0x97, 0x60, 0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, -0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, -0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, -0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, -0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x08, 0x20, 0xC1, 0x70, -0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, -0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, -0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, -0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, -0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, -0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, -0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, -0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, -0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, -0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, -0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, -0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, -0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, -0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, -0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, -0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, -0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, -0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, -0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, -0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, -0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, -0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, -0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, -0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, -0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, -0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, -0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, -0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, -0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, -0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, -0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, 0x00, 0xCB, 0xEF, 0x08, 0x00, 0x9A, 0xB2, 0xDD, 0x00, 0x00, 0x00, 0x27, -0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4F, -0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, -0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* America/Tortola */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x14, -0x01, 0xFF, 0xFF, 0xC3, 0x6C, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0x7B, 0x48, 0x00, 0xB1, 0xF1, -0x62, 0x00, 0x00, 0x00, 0x00, - -/* America/Vancouver */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0xBD, 0xA0, -0x9F, 0xC0, 0x5B, 0x90, 0xCB, 0x89, 0x1A, 0xA0, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, -0xD3, 0x76, 0x0F, 0x20, 0xD4, 0x53, 0x7D, 0x10, 0xD5, 0x55, 0xF1, 0x20, 0xD6, 0x20, 0xEA, 0x10, -0xD7, 0x35, 0xD3, 0x20, 0xD8, 0x00, 0xCC, 0x10, 0xD9, 0x15, 0xB5, 0x20, 0xD9, 0xE0, 0xAE, 0x10, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x08, 0x20, 0xEB, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x0A, 0x00, 0xCD, 0xA0, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, -0x90, 0x01, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, -0xFF, 0x9D, 0x90, 0x01, 0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, -0x00, 0x50, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0xD4, 0x81, -0x0A, 0x00, 0x57, 0x27, 0x32, 0x00, 0x00, 0x00, 0x24, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, -0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x77, 0x65, 0x73, 0x74, 0x20, 0x42, 0x72, 0x69, -0x74, 0x69, 0x73, 0x68, 0x20, 0x43, 0x6F, 0x6C, 0x75, 0x6D, 0x62, 0x69, 0x61, - -/* America/Virgin */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF4, 0x37, 0x60, -0x01, 0xFF, 0xFF, 0xC3, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, -0x80, 0x00, 0x00, 0x00, 0x00, - -/* America/Whitehorse */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xCB, 0xB0, -0x9F, 0xBB, 0x23, 0xA0, 0xA0, 0xD0, 0x0C, 0xB0, 0xA1, 0xA2, 0xD2, 0x80, 0xCB, 0x89, 0x28, 0xB0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x69, 0x1A, 0xB0, 0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, -0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, -0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, -0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, -0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, -0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, -0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, -0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, -0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, -0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, -0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, -0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, -0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, -0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, -0x47, 0x2D, 0x8A, 0x10, 0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, -0x4A, 0xED, 0x4E, 0x10, 0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, -0x4E, 0xB6, 0x4C, 0x90, 0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, -0x52, 0x76, 0x10, 0x90, 0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, -0x56, 0x35, 0xD4, 0x90, 0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, -0x59, 0xFE, 0xD3, 0x10, 0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, -0x5D, 0xBE, 0x97, 0x10, 0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, -0x61, 0x87, 0x95, 0x90, 0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, -0x65, 0x47, 0x59, 0x90, 0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, -0x69, 0x07, 0x1D, 0x90, 0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, -0x6C, 0xD0, 0x1C, 0x10, 0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, -0x70, 0x8F, 0xE0, 0x10, 0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, -0x74, 0x4F, 0xA4, 0x10, 0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, -0x78, 0x18, 0xA2, 0x90, 0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, -0x7B, 0xD8, 0x66, 0x90, 0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, -0x7F, 0x98, 0x2A, 0x90, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0xFF, 0xFF, -0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, -0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x15, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x19, 0x59, 0x44, 0x54, 0x00, -0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, 0x54, 0x00, 0x59, 0x44, 0x44, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xE5, 0xF9, 0xB2, 0x00, 0x44, 0xBD, 0xA8, 0x00, -0x00, 0x00, 0x1A, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, -0x2D, 0x20, 0x73, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x59, 0x75, 0x6B, 0x6F, 0x6E, - -/* America/Winnipeg */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x01, 0xFB, 0xE0, -0x9B, 0xC3, 0xBA, 0x50, 0x9E, 0xB8, 0xA1, 0x80, 0x9F, 0xC0, 0x3F, 0x70, 0xC2, 0xA0, 0x3B, 0x80, -0xC3, 0x4F, 0x84, 0xF0, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x88, 0x68, 0x00, 0xD4, 0x53, 0x60, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDB, 0x00, 0x07, 0x00, 0xDB, 0xC8, 0x5C, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x31, 0x62, 0xF0, -0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xDE, 0x80, -0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xB1, 0x80, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x45, 0x80, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x7D, 0x80, -0x43, 0xB7, 0x6F, 0xE0, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, -0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, -0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, -0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, -0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, -0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, -0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, -0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, -0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, -0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, -0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, -0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, -0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, -0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, -0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, -0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, -0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, -0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD5, -0x71, 0xED, 0x00, 0x7E, 0xE0, 0x78, 0x00, 0x00, 0x00, 0x26, 0x43, 0x65, 0x6E, 0x74, 0x72, 0x61, -0x6C, 0x20, 0x54, 0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x4D, 0x61, 0x6E, 0x69, 0x74, 0x6F, 0x62, -0x61, 0x20, 0x26, 0x20, 0x77, 0x65, 0x73, 0x74, 0x20, 0x4F, 0x6E, 0x74, 0x61, 0x72, 0x69, 0x6F, - - -/* America/Yakutat */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1A, 0xCB, 0x89, 0x28, 0xB0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xFE, 0xB8, 0x55, 0x30, 0xFF, 0xA8, 0x38, 0x20, -0x00, 0x98, 0x37, 0x30, 0x01, 0x88, 0x1A, 0x20, 0x02, 0x78, 0x19, 0x30, 0x03, 0x71, 0x36, 0xA0, -0x04, 0x61, 0x35, 0xB0, 0x05, 0x51, 0x18, 0xA0, 0x06, 0x41, 0x17, 0xB0, 0x07, 0x30, 0xFA, 0xA0, -0x07, 0x8D, 0x51, 0xB0, 0x09, 0x10, 0xDC, 0xA0, 0x09, 0xAD, 0xCD, 0x30, 0x0A, 0xF0, 0xBE, 0xA0, -0x0B, 0xE0, 0xBD, 0xB0, 0x0C, 0xD9, 0xDB, 0x20, 0x0D, 0xC0, 0x9F, 0xB0, 0x0E, 0xB9, 0xBD, 0x20, -0x0F, 0xA9, 0xBC, 0x30, 0x10, 0x99, 0x9F, 0x20, 0x11, 0x89, 0x9E, 0x30, 0x12, 0x79, 0x81, 0x20, -0x13, 0x69, 0x80, 0x30, 0x14, 0x59, 0x63, 0x20, 0x15, 0x49, 0x62, 0x30, 0x16, 0x39, 0x45, 0x20, -0x17, 0x29, 0x44, 0x30, 0x18, 0x22, 0x61, 0xA0, 0x19, 0x09, 0x26, 0x30, 0x1A, 0x02, 0x43, 0xA0, -0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, 0x1C, 0xD2, 0x24, 0xB0, -0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, 0x20, 0x76, 0x39, 0x30, -0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, 0x24, 0x35, 0xFD, 0x30, -0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, 0x27, 0xFE, 0xFB, 0xB0, -0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, 0x2B, 0xBE, 0xBF, 0xB0, -0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, 0x2F, 0x7E, 0x83, 0xB0, -0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, 0x33, 0x47, 0x82, 0x30, -0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, 0x37, 0x07, 0x46, 0x30, -0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, 0x3A, 0xC7, 0x0A, 0x30, -0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, 0x3E, 0x90, 0x08, 0xB0, -0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, 0x42, 0x4F, 0xCC, 0xB0, -0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, 0x45, 0xF3, 0xE1, 0x30, -0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, 0x49, 0xB3, 0xA5, 0x30, -0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, 0x4D, 0x7C, 0xA3, 0xB0, -0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, 0x51, 0x3C, 0x67, 0xB0, -0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, 0x54, 0xFC, 0x2B, 0xB0, -0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, 0x58, 0xC5, 0x2A, 0x30, -0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, 0x5C, 0x84, 0xEE, 0x30, -0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, 0x60, 0x4D, 0xEC, 0xB0, -0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, 0x64, 0x0D, 0xB0, 0xB0, -0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, 0x67, 0xCD, 0x74, 0xB0, -0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, 0x6B, 0x96, 0x73, 0x30, -0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, 0x6F, 0x56, 0x37, 0x30, -0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, 0x73, 0x15, 0xFB, 0x30, -0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, 0x76, 0xDE, 0xF9, 0xB0, -0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, 0x7A, 0x9E, 0xBD, 0xB0, -0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, 0x7E, 0x5E, 0x81, 0xB0, -0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, -0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, -0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x04, 0xFF, 0xFF, -0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x10, -0xFF, 0xFF, 0x81, 0x70, 0x00, 0x15, 0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, -0x54, 0x00, 0x59, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xE4, 0x30, 0xC6, -0x00, 0x3F, 0xAB, 0xB2, 0x00, 0x00, 0x00, 0x23, 0x41, 0x6C, 0x61, 0x73, 0x6B, 0x61, 0x20, 0x54, -0x69, 0x6D, 0x65, 0x20, 0x2D, 0x20, 0x41, 0x6C, 0x61, 0x73, 0x6B, 0x61, 0x20, 0x70, 0x61, 0x6E, -0x68, 0x61, 0x6E, 0x64, 0x6C, 0x65, 0x20, 0x6E, 0x65, 0x63, 0x6B, - -/* America/Yellowknife */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x19, 0xBE, 0x2A, 0x18, 0x00, -0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x5A, 0x70, -0xF8, 0x28, 0x85, 0xF0, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, -0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, -0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, -0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, -0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, -0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, -0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, -0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, -0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, -0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, -0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, -0x47, 0x2D, 0x7C, 0x00, 0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, -0x4A, 0xED, 0x40, 0x00, 0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, -0x4E, 0xB6, 0x3E, 0x80, 0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, -0x52, 0x76, 0x02, 0x80, 0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, -0x56, 0x35, 0xC6, 0x80, 0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, -0x59, 0xFE, 0xC5, 0x00, 0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, -0x5D, 0xBE, 0x89, 0x00, 0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, -0x61, 0x87, 0x87, 0x80, 0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, -0x65, 0x47, 0x4B, 0x80, 0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, -0x69, 0x07, 0x0F, 0x80, 0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, -0x6C, 0xD0, 0x0E, 0x00, 0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, -0x70, 0x8F, 0xD2, 0x00, 0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, -0x74, 0x4F, 0x96, 0x00, 0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, -0x78, 0x18, 0x94, 0x80, 0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, -0x7B, 0xD8, 0x58, 0x80, 0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, -0x7F, 0x98, 0x1C, 0x80, 0x03, 0x01, 0x02, 0x03, 0x04, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, -0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x05, 0x03, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, -0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, -0x01, 0x15, 0x7A, 0x7A, 0x7A, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x4D, 0x53, -0x54, 0x00, 0x4D, 0x44, 0x44, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x9E, 0xC7, 0x00, 0x65, 0x3D, 0xF7, 0x00, -0x00, 0x00, 0x2D, 0x4D, 0x6F, 0x75, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x20, 0x54, 0x69, 0x6D, 0x65, -0x20, 0x2D, 0x20, 0x63, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x4E, 0x6F, 0x72, 0x74, 0x68, -0x77, 0x65, 0x73, 0x74, 0x20, 0x54, 0x65, 0x72, 0x72, 0x69, 0x74, 0x6F, 0x72, 0x69, 0x65, 0x73, - - -/* Antarctica/Casey */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xFE, 0x1E, 0xCC, 0x80, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x0D, 0xAD, 0x01, 0xBB, 0x4B, -0x12, 0x00, 0x00, 0x00, 0x1F, 0x43, 0x61, 0x73, 0x65, 0x79, 0x20, 0x53, 0x74, 0x61, 0x74, 0x69, -0x6F, 0x6E, 0x2C, 0x20, 0x42, 0x61, 0x69, 0x6C, 0x65, 0x79, 0x20, 0x50, 0x65, 0x6E, 0x69, 0x6E, -0x73, 0x75, 0x6C, 0x61, - -/* Antarctica/Davis */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE7, 0x9C, 0x40, 0x00, -0xF6, 0x47, 0xDF, 0x10, 0xFE, 0x47, 0xAB, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x7A, 0x7A, 0x7A, 0x00, 0x44, 0x41, 0x56, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x75, 0x9D, 0x01, 0x89, 0xA0, 0x3A, 0x00, 0x00, 0x00, 0x1D, -0x44, 0x61, 0x76, 0x69, 0x73, 0x20, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x56, -0x65, 0x73, 0x74, 0x66, 0x6F, 0x6C, 0x64, 0x20, 0x48, 0x69, 0x6C, 0x6C, 0x73, - -/* Antarctica/DumontDUrville */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xD4, 0xBC, 0x76, 0x80, -0xDE, 0x34, 0x60, 0x60, 0xE7, 0x3C, 0x02, 0x80, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x08, 0x7A, 0x7A, 0x7A, -0x00, 0x50, 0x4D, 0x54, 0x00, 0x44, 0x44, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x25, 0xA3, 0x6A, 0x01, 0xE8, 0x4E, 0x82, 0x00, 0x00, 0x00, 0x26, 0x44, 0x75, 0x6D, 0x6F, -0x6E, 0x74, 0x2D, 0x64, 0x27, 0x55, 0x72, 0x76, 0x69, 0x6C, 0x6C, 0x65, 0x20, 0x53, 0x74, 0x61, -0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x54, 0x65, 0x72, 0x72, 0x65, 0x20, 0x41, 0x64, 0x65, 0x6C, -0x69, 0x65, - -/* Antarctica/Mawson */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE2, 0x20, 0x32, 0x80, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x4D, 0x41, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x02, 0xBF, 0x01, 0x72, -0x9C, 0x4D, 0x00, 0x00, 0x00, 0x19, 0x4D, 0x61, 0x77, 0x73, 0x6F, 0x6E, 0x20, 0x53, 0x74, 0x61, -0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x48, 0x6F, 0x6C, 0x6D, 0x65, 0x20, 0x42, 0x61, 0x79, - -/* Antarctica/McMurdo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, -0x48, 0xDE, 0x3C, 0x60, 0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, -0x4C, 0x9E, 0x00, 0x60, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, -0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, -0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, -0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, -0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, -0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, -0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, -0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, -0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, -0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, -0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, -0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, -0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, -0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00, -0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x1B, 0xA5, 0x02, 0x10, -0xDE, 0xA0, 0x00, 0x00, 0x00, 0x1C, 0x4D, 0x63, 0x4D, 0x75, 0x72, 0x64, 0x6F, 0x20, 0x53, 0x74, -0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x52, 0x6F, 0x73, 0x73, 0x20, 0x49, 0x73, 0x6C, 0x61, -0x6E, 0x64, - -/* Antarctica/Palmer */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x16, 0xF6, 0x98, 0xAD, 0x00, -0xF6, 0xE6, 0x9F, 0xB0, 0xF8, 0x13, 0x43, 0xC0, 0xF8, 0xC7, 0xD3, 0x30, 0xF9, 0xF4, 0x77, 0x40, -0xFA, 0xD3, 0x36, 0xB0, 0xFB, 0xC3, 0x35, 0xC0, 0xFC, 0xBC, 0x53, 0x30, 0xFD, 0xAC, 0x52, 0x40, -0xFE, 0x9C, 0x35, 0x30, 0xFF, 0x8C, 0x34, 0x40, 0x07, 0xA3, 0x4A, 0xB0, 0x08, 0x24, 0x6F, 0xA0, -0x17, 0x30, 0xBC, 0xB0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0, -0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40, -0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x7F, 0x03, 0x30, 0x21, 0x6F, 0x02, 0x40, -0x22, 0x39, 0xFB, 0x30, 0x23, 0x45, 0xA9, 0xC0, 0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0, -0x26, 0x02, 0xF9, 0xB0, 0x26, 0xF2, 0xF8, 0xC0, 0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0, -0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0, -0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40, -0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x3D, 0xD7, 0x30, 0x34, 0x40, 0x4B, 0x40, -0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40, -0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0, -0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0, -0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0, -0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40, -0x47, 0xD3, 0x52, 0xB0, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40, -0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40, -0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0, -0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0, -0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, -0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40, -0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40, -0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, -0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0, -0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0, -0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40, -0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40, -0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40, -0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0, -0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x07, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, -0xFF, 0xE3, 0xE0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, -0x0D, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x12, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x12, 0x7A, 0x7A, 0x7A, -0x00, 0x41, 0x52, 0x54, 0x00, 0x41, 0x52, 0x53, 0x54, 0x00, 0x43, 0x4C, 0x53, 0x54, 0x00, 0x43, -0x4C, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x28, 0xE4, 0xBF, 0x00, 0xB1, 0x27, 0x90, 0x00, 0x00, 0x00, 0x1D, 0x50, -0x61, 0x6C, 0x6D, 0x65, 0x72, 0x20, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x41, -0x6E, 0x76, 0x65, 0x72, 0x73, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, - -/* Antarctica/Rothera */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x0D, 0x02, 0x2D, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x52, 0x4F, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0xF5, 0xBA, 0x00, 0xAB, -0x1A, 0x15, 0x00, 0x00, 0x00, 0x20, 0x52, 0x6F, 0x74, 0x68, 0x65, 0x72, 0x61, 0x20, 0x53, 0x74, -0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x41, 0x64, 0x65, 0x6C, 0x61, 0x69, 0x64, 0x65, 0x20, -0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, - -/* Antarctica/South_Pole */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0E, 0xE5, 0xA9, 0xE9, 0x00, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, -0x48, 0xDE, 0x3C, 0x60, 0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, -0x4C, 0x9E, 0x00, 0x60, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, -0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, -0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, -0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, -0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, -0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, -0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, -0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, -0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, -0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, -0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, -0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, -0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, -0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x00, 0x00, -0xA8, 0xC0, 0x00, 0x09, 0x7A, 0x7A, 0x7A, 0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x4E, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x22, 0x41, 0x6D, 0x75, 0x6E, 0x64, 0x73, 0x65, 0x6E, 0x2D, 0x53, -0x63, 0x6F, 0x74, 0x74, 0x20, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x53, 0x6F, -0x75, 0x74, 0x68, 0x20, 0x50, 0x6F, 0x6C, 0x65, - -/* Antarctica/Syowa */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE7, 0xB1, 0x58, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x53, 0x59, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0D, 0x83, 0x01, 0x4F, -0x11, 0x58, 0x00, 0x00, 0x00, 0x18, 0x53, 0x79, 0x6F, 0x77, 0x61, 0x20, 0x53, 0x74, 0x61, 0x74, -0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x45, 0x20, 0x4F, 0x6E, 0x67, 0x75, 0x6C, 0x20, 0x49, - -/* Antarctica/Vostok */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xE9, 0x58, 0x89, 0x80, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x56, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0xEB, 0xC0, 0x01, 0xB5, -0xC6, 0x4F, 0x00, 0x00, 0x00, 0x1F, 0x56, 0x6F, 0x73, 0x74, 0x6F, 0x6B, 0x20, 0x53, 0x74, 0x61, -0x74, 0x69, 0x6F, 0x6E, 0x2C, 0x20, 0x53, 0x20, 0x4D, 0x61, 0x67, 0x6E, 0x65, 0x74, 0x69, 0x63, -0x20, 0x50, 0x6F, 0x6C, 0x65, - -/* Arctic/Longyearbyen */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x27, 0xE3, 0x00, -0x9B, 0xD4, 0x7B, 0x60, 0xC8, 0xB7, 0x4D, 0x60, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x62, 0x07, 0x10, 0xEB, 0xAF, 0x20, 0x90, 0xEC, 0xA8, 0x4C, 0x10, 0xED, 0x98, 0x3D, 0x10, -0xEE, 0x88, 0x2E, 0x10, 0xEF, 0x78, 0x1F, 0x10, 0xF0, 0x68, 0x10, 0x10, 0xF1, 0x58, 0x01, 0x10, -0xF2, 0x47, 0xF2, 0x10, 0xF3, 0x37, 0xE3, 0x10, 0xF4, 0x27, 0xD4, 0x10, 0xF5, 0x17, 0xC5, 0x10, -0xF6, 0x10, 0xF0, 0x90, 0xF7, 0x2F, 0x06, 0x10, 0xF7, 0xF0, 0xD2, 0x90, 0x12, 0xCE, 0x97, 0xF0, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x59, 0x00, 0x01, 0x2B, 0x12, 0x80, 0x00, 0x00, -0x00, 0x00, - -/* Asia/Aden */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x59, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x38, 0x20, -0x01, 0x00, 0x00, 0x2A, 0x60, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0xC8, 0xB8, 0x01, 0x57, 0xA0, -0xC0, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Almaty */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xAA, 0x19, 0x7B, 0xDC, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0x7F, 0x7C, 0xA0, 0x29, 0xD4, 0xA6, 0x10, 0x2A, 0xC4, 0x89, 0x00, -0x2B, 0xB4, 0xB2, 0x40, 0x2C, 0xA4, 0xA3, 0x40, 0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, -0x2F, 0x74, 0x76, 0x40, 0x30, 0x64, 0x67, 0x40, 0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, -0x33, 0x3D, 0x74, 0xC0, 0x34, 0x52, 0x4F, 0xC0, 0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, -0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x4E, 0x40, 0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, -0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x12, 0x40, 0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, -0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xD6, 0x40, 0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, -0x42, 0x35, 0xD1, 0x20, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x03, 0x02, 0x03, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x03, 0x00, 0x00, 0x48, 0x24, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, -0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, -0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4C, -0x4D, 0x54, 0x00, 0x41, 0x4C, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCB, 0x52, 0xC8, 0x01, 0x88, 0x13, 0x18, 0x00, 0x00, 0x00, -0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* Asia/Amman */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0, -0x06, 0x72, 0x79, 0xE0, 0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0, -0x0A, 0x05, 0x6A, 0xE0, 0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xDA, 0x75, 0xD0, -0x0D, 0xC9, 0x23, 0x60, 0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0, -0x1C, 0xAD, 0xD5, 0x60, 0x1D, 0x9F, 0x09, 0xD0, 0x1E, 0x92, 0xFD, 0x60, 0x1F, 0x82, 0xE0, 0x50, -0x20, 0x72, 0xDF, 0x60, 0x21, 0x62, 0xC2, 0x50, 0x22, 0x52, 0xC1, 0x60, 0x23, 0x4B, 0xDE, 0xD0, -0x24, 0x64, 0xBC, 0x60, 0x25, 0x2B, 0xC0, 0xD0, 0x26, 0x37, 0x6F, 0x60, 0x27, 0x0B, 0xA2, 0xD0, -0x28, 0x0B, 0x73, 0xE0, 0x28, 0xE2, 0x4A, 0x50, 0x29, 0xE4, 0xBE, 0x60, 0x2A, 0xCB, 0x66, 0xD0, -0x2B, 0xBB, 0x65, 0xE0, 0x2C, 0xAB, 0x48, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x78, 0xB5, 0xD0, -0x2F, 0x84, 0x64, 0x60, 0x30, 0x58, 0xA5, 0xE0, 0x31, 0x64, 0x46, 0x60, 0x32, 0x41, 0xC2, 0x60, -0x33, 0x44, 0x28, 0x60, 0x34, 0x21, 0xA4, 0x60, 0x35, 0x24, 0x0A, 0x60, 0x36, 0x01, 0x86, 0x60, -0x37, 0x7A, 0x93, 0x60, 0x37, 0xF2, 0x8B, 0xE0, 0x38, 0xE2, 0x7C, 0xE0, 0x39, 0xD2, 0x6D, 0xE0, -0x3A, 0xC2, 0x5E, 0xE0, 0x3B, 0xB2, 0x4F, 0xE0, 0x3C, 0xA2, 0x40, 0xE0, 0x3D, 0x92, 0x31, 0xE0, -0x3E, 0x82, 0x22, 0xE0, 0x3F, 0x98, 0x4F, 0x60, 0x40, 0x62, 0x04, 0xE0, 0x41, 0x6E, 0xF6, 0xE0, -0x42, 0x4B, 0x21, 0x60, 0x43, 0x3C, 0x63, 0xE0, 0x44, 0x2B, 0x03, 0x60, 0x45, 0x41, 0x2F, 0xE0, -0x46, 0x0A, 0xE5, 0x60, 0x47, 0x21, 0x11, 0xE0, 0x47, 0xEA, 0xC7, 0x60, 0x49, 0x0A, 0x2E, 0x60, -0x49, 0xCA, 0xA9, 0x60, 0x4A, 0xEA, 0x10, 0x60, 0x4B, 0xAA, 0x8B, 0x60, 0x4C, 0xC9, 0xF2, 0x60, -0x4D, 0x93, 0xA7, 0xE0, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x73, 0x89, 0xE0, 0x50, 0x89, 0xB6, 0x60, -0x51, 0x53, 0x6B, 0xE0, 0x52, 0x69, 0x98, 0x60, 0x53, 0x33, 0x4D, 0xE0, 0x54, 0x52, 0xB4, 0xE0, -0x55, 0x13, 0x2F, 0xE0, 0x56, 0x32, 0x96, 0xE0, 0x56, 0xFC, 0x4C, 0x60, 0x58, 0x12, 0x78, 0xE0, -0x58, 0xDC, 0x2E, 0x60, 0x59, 0xF2, 0x5A, 0xE0, 0x5A, 0xBC, 0x10, 0x60, 0x5B, 0xD2, 0x3C, 0xE0, -0x5C, 0x9B, 0xF2, 0x60, 0x5D, 0xB2, 0x1E, 0xE0, 0x5E, 0x7B, 0xD4, 0x60, 0x5F, 0x9B, 0x3B, 0x60, -0x60, 0x5B, 0xB6, 0x60, 0x61, 0x7B, 0x1D, 0x60, 0x62, 0x44, 0xD2, 0xE0, 0x63, 0x5A, 0xFF, 0x60, -0x64, 0x24, 0xB4, 0xE0, 0x65, 0x3A, 0xE1, 0x60, 0x66, 0x04, 0x96, 0xE0, 0x67, 0x1A, 0xC3, 0x60, -0x67, 0xE4, 0x78, 0xE0, 0x69, 0x03, 0xDF, 0xE0, 0x69, 0xC4, 0x5A, 0xE0, 0x6A, 0xE3, 0xC1, 0xE0, -0x6B, 0xA4, 0x3C, 0xE0, 0x6C, 0xC3, 0xA3, 0xE0, 0x6D, 0x8D, 0x59, 0x60, 0x6E, 0xA3, 0x85, 0xE0, -0x6F, 0x6D, 0x3B, 0x60, 0x70, 0x83, 0x67, 0xE0, 0x71, 0x4D, 0x1D, 0x60, 0x72, 0x63, 0x49, 0xE0, -0x73, 0x2C, 0xFF, 0x60, 0x74, 0x4C, 0x66, 0x60, 0x75, 0x0C, 0xE1, 0x60, 0x76, 0x2C, 0x48, 0x60, -0x76, 0xF5, 0xFD, 0xE0, 0x78, 0x0C, 0x2A, 0x60, 0x78, 0xD5, 0xDF, 0xE0, 0x79, 0xEC, 0x0C, 0x60, -0x7A, 0xB5, 0xC1, 0xE0, 0x7B, 0xCB, 0xEE, 0x60, 0x7C, 0x95, 0xA3, 0xE0, 0x7D, 0xB5, 0x0A, 0xE0, -0x7E, 0x75, 0x85, 0xE0, 0x7F, 0x94, 0xEC, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, -0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, 0x7C, 0xF5, 0x00, 0x00, 0x00, 0x00, - - -/* Asia/Anadyr */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xAA, 0x19, 0x1D, 0x9C, -0xB5, 0xA3, 0x8C, 0xC0, 0x15, 0x27, 0x1B, 0x30, 0x16, 0x18, 0x4F, 0xA0, 0x17, 0x08, 0x4E, 0xB0, -0x17, 0xF9, 0x91, 0x30, 0x18, 0xE9, 0x90, 0x40, 0x19, 0xDA, 0xC4, 0xB0, 0x1A, 0xCC, 0x15, 0x40, -0x1B, 0xBC, 0x22, 0x60, 0x1C, 0xAC, 0x13, 0x60, 0x1D, 0x9C, 0x04, 0x60, 0x1E, 0x8B, 0xF5, 0x60, -0x1F, 0x7B, 0xE6, 0x60, 0x20, 0x6B, 0xD7, 0x60, 0x21, 0x5B, 0xC8, 0x60, 0x22, 0x4B, 0xB9, 0x60, -0x23, 0x3B, 0xAA, 0x60, 0x24, 0x2B, 0x9B, 0x60, 0x25, 0x1B, 0x8C, 0x60, 0x26, 0x0B, 0x7D, 0x60, -0x27, 0x04, 0xA8, 0xE0, 0x27, 0xF4, 0x99, 0xE0, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0x78, 0x40, 0xF0, -0x29, 0xD4, 0x51, 0xB0, 0x2A, 0xC4, 0x34, 0xA0, 0x2B, 0xB4, 0x5D, 0xE0, 0x2C, 0xA4, 0x4E, 0xE0, -0x2D, 0x94, 0x3F, 0xE0, 0x2E, 0x84, 0x30, 0xE0, 0x2F, 0x74, 0x21, 0xE0, 0x30, 0x64, 0x12, 0xE0, -0x31, 0x5D, 0x3E, 0x60, 0x32, 0x72, 0x19, 0x60, 0x33, 0x3D, 0x20, 0x60, 0x34, 0x51, 0xFB, 0x60, -0x35, 0x1D, 0x02, 0x60, 0x36, 0x31, 0xDD, 0x60, 0x36, 0xFC, 0xE4, 0x60, 0x38, 0x1A, 0xF9, 0xE0, -0x38, 0xDC, 0xC6, 0x60, 0x39, 0xFA, 0xDB, 0xE0, 0x3A, 0xBC, 0xA8, 0x60, 0x3B, 0xDA, 0xBD, 0xE0, -0x3C, 0xA5, 0xC4, 0xE0, 0x3D, 0xBA, 0x9F, 0xE0, 0x3E, 0x85, 0xA6, 0xE0, 0x3F, 0x9A, 0x81, 0xE0, -0x40, 0x65, 0x88, 0xE0, 0x41, 0x83, 0x9E, 0x60, 0x42, 0x45, 0x6A, 0xE0, 0x43, 0x63, 0x80, 0x60, -0x44, 0x25, 0x4C, 0xE0, 0x45, 0x43, 0x62, 0x60, 0x46, 0x05, 0x2E, 0xE0, 0x47, 0x23, 0x44, 0x60, -0x47, 0xEE, 0x4B, 0x60, 0x49, 0x03, 0x26, 0x60, 0x49, 0xCE, 0x2D, 0x60, 0x4A, 0xE3, 0x08, 0x60, -0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xCC, 0x24, 0xE0, 0x4D, 0x8D, 0xF1, 0x60, 0x4E, 0xAC, 0x06, 0xE0, -0x4F, 0x6D, 0xD3, 0x60, 0x50, 0x8B, 0xE8, 0xE0, 0x51, 0x56, 0xEF, 0xE0, 0x52, 0x6B, 0xCA, 0xE0, -0x53, 0x36, 0xD1, 0xE0, 0x54, 0x4B, 0xAC, 0xE0, 0x55, 0x16, 0xB3, 0xE0, 0x56, 0x2B, 0x8E, 0xE0, -0x56, 0xF6, 0x95, 0xE0, 0x58, 0x14, 0xAB, 0x60, 0x58, 0xD6, 0x77, 0xE0, 0x59, 0xF4, 0x8D, 0x60, -0x5A, 0xB6, 0x59, 0xE0, 0x5B, 0xD4, 0x6F, 0x60, 0x5C, 0x9F, 0x76, 0x60, 0x5D, 0xB4, 0x51, 0x60, -0x5E, 0x7F, 0x58, 0x60, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x5F, 0x3A, 0x60, 0x61, 0x7D, 0x4F, 0xE0, -0x62, 0x3F, 0x1C, 0x60, 0x63, 0x5D, 0x31, 0xE0, 0x64, 0x1E, 0xFE, 0x60, 0x65, 0x3D, 0x13, 0xE0, -0x66, 0x08, 0x1A, 0xE0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0xE7, 0xFC, 0xE0, 0x68, 0xFC, 0xD7, 0xE0, -0x69, 0xC7, 0xDE, 0xE0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0xA7, 0xC0, 0xE0, 0x6C, 0xC5, 0xD6, 0x60, -0x6D, 0x87, 0xA2, 0xE0, 0x6E, 0xA5, 0xB8, 0x60, 0x6F, 0x67, 0x84, 0xE0, 0x70, 0x85, 0x9A, 0x60, -0x71, 0x50, 0xA1, 0x60, 0x72, 0x65, 0x7C, 0x60, 0x73, 0x30, 0x83, 0x60, 0x74, 0x45, 0x5E, 0x60, -0x75, 0x10, 0x65, 0x60, 0x76, 0x2E, 0x7A, 0xE0, 0x76, 0xF0, 0x47, 0x60, 0x78, 0x0E, 0x5C, 0xE0, -0x78, 0xD0, 0x29, 0x60, 0x79, 0xEE, 0x3E, 0xE0, 0x7A, 0xB0, 0x0B, 0x60, 0x7B, 0xCE, 0x20, 0xE0, -0x7C, 0x99, 0x27, 0xE0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x79, 0x09, 0xE0, 0x7F, 0x8D, 0xE4, 0xE0, -0x01, 0x03, 0x02, 0x03, 0x04, 0x01, 0x04, 0x01, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x05, 0x04, 0x01, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x00, 0x00, 0xA6, 0x64, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, -0x04, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x09, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x04, 0x00, 0x00, 0xB6, -0xD0, 0x01, 0x09, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x04, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x09, 0x00, -0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x41, -0x4E, 0x41, 0x54, 0x00, 0x41, 0x4E, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEC, 0x21, 0x38, -0x02, 0x21, 0x79, 0xED, 0x00, 0x00, 0x00, 0x16, 0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x31, -0x30, 0x20, 0x2D, 0x20, 0x42, 0x65, 0x72, 0x69, 0x6E, 0x67, 0x20, 0x53, 0x65, 0x61, - -/* Asia/Aqtau */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x1F, 0xAA, 0x19, 0x94, 0xE0, -0xB5, 0xA3, 0xFD, 0x40, 0xF2, 0xD4, 0xAE, 0x30, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0x7F, 0x8A, 0xB0, 0x29, 0x4B, 0xA6, 0x30, 0x29, 0xD4, 0xB4, 0x20, -0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xA2, 0x50, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x83, 0x60, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x72, 0x89, 0xE0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0, -0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0, -0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60, -0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60, -0x41, 0x84, 0x0E, 0xE0, 0x42, 0x35, 0xED, 0x40, 0x01, 0x02, 0x03, 0x04, 0x05, 0x03, 0x05, 0x03, -0x05, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x03, 0x09, -0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x09, 0x00, 0x00, 0x2F, 0x20, 0x00, -0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, -0x50, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0E, 0x00, -0x00, 0x46, 0x50, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0E, 0x00, 0x00, 0x54, 0x60, 0x01, -0x14, 0x00, 0x00, 0x46, 0x50, 0x00, 0x1A, 0x00, 0x00, 0x54, 0x60, 0x01, 0x14, 0x00, 0x00, 0x46, -0x50, 0x00, 0x1A, 0x00, 0x00, 0x46, 0x50, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, 0x00, 0x1A, 0x00, -0x00, 0x38, 0x40, 0x00, 0x1A, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4F, 0x52, 0x54, 0x00, 0x53, 0x48, -0x45, 0x54, 0x00, 0x53, 0x48, 0x45, 0x53, 0x54, 0x00, 0x41, 0x51, 0x54, 0x53, 0x54, 0x00, 0x41, -0x51, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xCD, 0x41, 0x92, 0x01, 0x5F, 0x5B, 0xEA, 0x00, 0x00, 0x00, 0x31, 0x41, 0x74, -0x79, 0x72, 0x61, 0x75, 0x20, 0x28, 0x41, 0x74, 0x69, 0x72, 0x61, 0x75, 0x2C, 0x20, 0x47, 0x75, -0x72, 0x27, 0x79, 0x65, 0x76, 0x29, 0x2C, 0x20, 0x4D, 0x61, 0x6E, 0x67, 0x67, 0x68, 0x79, 0x73, -0x74, 0x61, 0x75, 0x20, 0x28, 0x4D, 0x61, 0x6E, 0x6B, 0x69, 0x73, 0x74, 0x61, 0x75, 0x29, - -/* Asia/Aqtobe */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x19, 0x8E, 0x68, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0x7F, 0x8A, 0xB0, 0x29, 0x4B, 0xA6, 0x30, 0x29, 0xD4, 0xB4, 0x20, -0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xA2, 0x50, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xA0, 0xD0, -0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x5D, 0xD0, 0x35, 0x1D, 0x64, 0xD0, -0x36, 0x32, 0x3F, 0xD0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x5C, 0x50, 0x38, 0xDD, 0x28, 0xD0, -0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x0A, 0xD0, 0x3B, 0xDB, 0x20, 0x50, 0x3C, 0xA6, 0x27, 0x50, -0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x09, 0x50, 0x3F, 0x9A, 0xE4, 0x50, 0x40, 0x65, 0xEB, 0x50, -0x41, 0x84, 0x00, 0xD0, 0x42, 0x35, 0xDF, 0x30, 0x01, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02, -0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x02, 0x08, -0x07, 0x08, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, -0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x08, 0x00, 0x00, 0x35, 0x98, 0x00, -0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, -0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, -0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, -0x15, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x4B, 0x54, 0x54, 0x00, 0x41, 0x4B, 0x54, 0x53, 0x54, 0x00, 0x41, 0x51, 0x54, 0x53, -0x54, 0x00, 0x41, 0x51, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD6, 0x0E, -0x2D, 0x01, 0x69, 0xE3, 0x3A, 0x00, 0x00, 0x00, 0x0F, 0x41, 0x71, 0x74, 0x6F, 0x62, 0x65, 0x20, -0x28, 0x41, 0x6B, 0x74, 0x6F, 0x62, 0x65, 0x29, - -/* Asia/Ashgabat */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x13, 0xAA, 0x19, 0x8D, 0x44, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x09, 0xC9, 0x40, -0x29, 0x78, 0xA3, 0x60, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00, -0x36, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, -0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, -0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, -0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, -0x48, 0x54, 0x00, 0x41, 0x53, 0x48, 0x53, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xC3, 0x3C, 0x78, 0x01, 0x6B, 0xBE, 0x7D, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Ashkhabad */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x13, 0xAA, 0x19, 0x8D, 0x44, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x09, 0xC9, 0x40, -0x29, 0x78, 0xA3, 0x60, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00, -0x36, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, -0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, -0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, -0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, -0x48, 0x54, 0x00, 0x41, 0x53, 0x48, 0x53, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Baghdad */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0x30, 0x3C, 0xE0, -0x17, 0x30, 0x68, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xE8, 0xBD, 0x50, 0x19, 0xDB, 0x43, 0x40, -0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBD, 0xC8, 0x40, 0x1C, 0xAD, 0xC7, 0x50, 0x1D, 0x9C, 0x74, 0xE0, -0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, -0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, -0x26, 0x0B, 0xED, 0xE0, 0x27, 0x05, 0x19, 0x60, 0x27, 0xF6, 0x78, 0x00, 0x28, 0xE7, 0xBA, 0x80, -0x29, 0xD8, 0xFD, 0x00, 0x2A, 0xCA, 0x3F, 0x80, 0x2B, 0xBA, 0x30, 0x80, 0x2C, 0xAB, 0x73, 0x00, -0x2D, 0x9B, 0x64, 0x00, 0x2E, 0x8C, 0xA6, 0x80, 0x2F, 0x7C, 0x97, 0x80, 0x30, 0x6D, 0xDA, 0x00, -0x31, 0x5F, 0x1C, 0x80, 0x32, 0x50, 0x5F, 0x00, 0x33, 0x40, 0x50, 0x00, 0x34, 0x31, 0x92, 0x80, -0x35, 0x21, 0x83, 0x80, 0x36, 0x12, 0xC6, 0x00, 0x37, 0x02, 0xB7, 0x00, 0x37, 0xF3, 0xF9, 0x80, -0x38, 0xE5, 0x3C, 0x00, 0x39, 0xD6, 0x7E, 0x80, 0x3A, 0xC6, 0x6F, 0x80, 0x3B, 0xB7, 0xB2, 0x00, -0x3C, 0xA7, 0xA3, 0x00, 0x3D, 0x98, 0xE5, 0x80, 0x3E, 0x88, 0xD6, 0x80, 0x3F, 0x7A, 0x19, 0x00, -0x40, 0x6B, 0x5B, 0x80, 0x41, 0x5C, 0x9E, 0x00, 0x42, 0x4C, 0x8F, 0x00, 0x43, 0x3D, 0xD1, 0x80, -0x44, 0x2D, 0xC2, 0x80, 0x45, 0x1F, 0x05, 0x00, 0x46, 0x0E, 0xF6, 0x00, 0x47, 0x00, 0x38, 0x80, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x29, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, -0x40, 0x01, 0x08, 0x42, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBC, 0x37, 0x98, 0x01, 0x56, 0x6E, -0xC2, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Bahrain */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA1, 0xF2, 0x9E, 0x14, -0x04, 0x8A, 0x92, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x2F, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, -0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x53, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x96, 0x3D, 0x01, 0x5F, -0xD7, 0x9D, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Baku */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x95, 0x44, -0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40, -0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0, -0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0, -0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0, -0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0, -0x27, 0x05, 0x19, 0x60, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xBD, 0x52, 0x40, 0x28, 0xE5, 0x09, 0x70, -0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x32, 0xC9, 0x70, 0xC0, 0x33, 0x3D, 0xAD, 0x00, 0x34, 0x52, 0x88, 0x00, 0x35, 0x1D, 0x8F, 0x00, -0x36, 0x32, 0x6A, 0x00, 0x36, 0xFD, 0x71, 0x00, 0x38, 0x1B, 0x86, 0x80, 0x38, 0xDD, 0x53, 0x00, -0x39, 0xFB, 0x68, 0x80, 0x3A, 0xBD, 0x35, 0x00, 0x3B, 0xDB, 0x4A, 0x80, 0x3C, 0xA6, 0x51, 0x80, -0x3D, 0xBB, 0x2C, 0x80, 0x3E, 0x86, 0x33, 0x80, 0x3F, 0x9B, 0x0E, 0x80, 0x40, 0x66, 0x15, 0x80, -0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80, 0x43, 0x64, 0x0D, 0x00, 0x44, 0x25, 0xD9, 0x80, -0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80, 0x47, 0x23, 0xD1, 0x00, 0x47, 0xEE, 0xD8, 0x00, -0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00, 0x4A, 0xE3, 0x95, 0x00, 0x4B, 0xAE, 0x9C, 0x00, -0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x4E, 0xAC, 0x93, 0x80, 0x4F, 0x6E, 0x60, 0x00, -0x50, 0x8C, 0x75, 0x80, 0x51, 0x57, 0x7C, 0x80, 0x52, 0x6C, 0x57, 0x80, 0x53, 0x37, 0x5E, 0x80, -0x54, 0x4C, 0x39, 0x80, 0x55, 0x17, 0x40, 0x80, 0x56, 0x2C, 0x1B, 0x80, 0x56, 0xF7, 0x22, 0x80, -0x58, 0x15, 0x38, 0x00, 0x58, 0xD7, 0x04, 0x80, 0x59, 0xF5, 0x1A, 0x00, 0x5A, 0xB6, 0xE6, 0x80, -0x5B, 0xD4, 0xFC, 0x00, 0x5C, 0xA0, 0x03, 0x00, 0x5D, 0xB4, 0xDE, 0x00, 0x5E, 0x7F, 0xE5, 0x00, -0x5F, 0x94, 0xC0, 0x00, 0x60, 0x5F, 0xC7, 0x00, 0x61, 0x7D, 0xDC, 0x80, 0x62, 0x3F, 0xA9, 0x00, -0x63, 0x5D, 0xBE, 0x80, 0x64, 0x1F, 0x8B, 0x00, 0x65, 0x3D, 0xA0, 0x80, 0x66, 0x08, 0xA7, 0x80, -0x67, 0x1D, 0x82, 0x80, 0x67, 0xE8, 0x89, 0x80, 0x68, 0xFD, 0x64, 0x80, 0x69, 0xC8, 0x6B, 0x80, -0x6A, 0xDD, 0x46, 0x80, 0x6B, 0xA8, 0x4D, 0x80, 0x6C, 0xC6, 0x63, 0x00, 0x6D, 0x88, 0x2F, 0x80, -0x6E, 0xA6, 0x45, 0x00, 0x6F, 0x68, 0x11, 0x80, 0x70, 0x86, 0x27, 0x00, 0x71, 0x51, 0x2E, 0x00, -0x72, 0x66, 0x09, 0x00, 0x73, 0x31, 0x10, 0x00, 0x74, 0x45, 0xEB, 0x00, 0x75, 0x10, 0xF2, 0x00, -0x76, 0x2F, 0x07, 0x80, 0x76, 0xF0, 0xD4, 0x00, 0x78, 0x0E, 0xE9, 0x80, 0x78, 0xD0, 0xB6, 0x00, -0x79, 0xEE, 0xCB, 0x80, 0x7A, 0xB0, 0x98, 0x00, 0x7B, 0xCE, 0xAD, 0x80, 0x7C, 0x99, 0xB4, 0x80, -0x7D, 0xAE, 0x8F, 0x80, 0x7E, 0x79, 0x96, 0x80, 0x7F, 0x8E, 0x71, 0x80, 0x01, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x06, 0x08, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, -0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, -0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, -0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, -0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, -0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x0C, 0x09, 0x00, 0x00, 0x2E, 0xBC, -0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, -0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, -0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0F, 0x00, 0x00, 0x38, 0x40, -0x01, 0x13, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x01, 0x13, 0x00, 0x00, -0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x01, 0x13, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x41, -0x4B, 0x54, 0x00, 0x42, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x41, 0x5A, 0x54, 0x00, 0x41, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0xC6, 0xF2, 0xFD, -0x01, 0x5E, 0xB9, 0x28, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Bangkok */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA2, 0x6A, 0x67, 0xC4, -0x01, 0x00, 0x00, 0x5E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x42, 0x4D, 0x54, -0x00, 0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9E, 0x4F, 0x58, 0x01, 0xAC, 0x08, -0xD2, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Beirut */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xA2, 0x65, 0x63, 0xE0, -0xA3, 0x7B, 0x82, 0x50, 0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, -0xA7, 0x27, 0x7F, 0xD0, 0xA8, 0x29, 0xF3, 0xE0, 0xA8, 0xEB, 0xB2, 0x50, 0xE8, 0x2A, 0x85, 0xE0, -0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, 0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xEC, 0xE0, -0xEC, 0xB6, 0x94, 0x50, 0xED, 0xCF, 0x71, 0xE0, 0xEE, 0x99, 0x19, 0x50, 0xEF, 0xB0, 0xA5, 0x60, -0xF0, 0x7A, 0x4C, 0xD0, 0x04, 0xA6, 0x5E, 0x60, 0x05, 0x2B, 0x77, 0xD0, 0x06, 0x43, 0x03, 0xE0, -0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0, 0x0A, 0x05, 0x6A, 0xE0, -0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xB1, 0x97, 0x50, 0x0D, 0xC9, 0x23, 0x60, -0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0, 0x1A, 0xF4, 0x2E, 0xE0, -0x1B, 0xD1, 0x9C, 0xD0, 0x1C, 0xD5, 0x62, 0x60, 0x1D, 0xB2, 0xD0, 0x50, 0x1E, 0xB6, 0x95, 0xE0, -0x1F, 0x94, 0x03, 0xD0, 0x20, 0x97, 0xC9, 0x60, 0x21, 0x75, 0x37, 0x50, 0x22, 0xA3, 0x2C, 0xE0, -0x23, 0x57, 0xBC, 0x50, 0x24, 0x67, 0x5F, 0x60, 0x25, 0x38, 0xEF, 0xD0, 0x26, 0x3C, 0xB5, 0x60, -0x27, 0x1A, 0x23, 0x50, 0x28, 0x1D, 0xE8, 0xE0, 0x28, 0xFB, 0x56, 0xD0, 0x2A, 0x00, 0x6D, 0xE0, -0x2A, 0xCE, 0x09, 0xD0, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x4D, 0x91, 0xD0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x2D, 0x73, 0xD0, 0x35, 0x1D, 0x72, 0xE0, -0x36, 0x0D, 0x55, 0xD0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x5C, 0x50, 0x38, 0xDD, 0x36, 0xE0, -0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x20, 0x50, 0x3C, 0xA6, 0x35, 0x60, -0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xE4, 0x50, 0x40, 0x65, 0xF9, 0x60, -0x41, 0x84, 0x00, 0xD0, 0x42, 0x45, 0xDB, 0x60, 0x43, 0x63, 0xE2, 0xD0, 0x44, 0x25, 0xBD, 0x60, -0x45, 0x43, 0xC4, 0xD0, 0x46, 0x05, 0x9F, 0x60, 0x47, 0x23, 0xA6, 0xD0, 0x47, 0xEE, 0xBB, 0xE0, -0x49, 0x03, 0x88, 0xD0, 0x49, 0xCE, 0x9D, 0xE0, 0x4A, 0xE3, 0x6A, 0xD0, 0x4B, 0xAE, 0x7F, 0xE0, -0x4C, 0xCC, 0x87, 0x50, 0x4D, 0x8E, 0x61, 0xE0, 0x4E, 0xAC, 0x69, 0x50, 0x4F, 0x6E, 0x43, 0xE0, -0x50, 0x8C, 0x4B, 0x50, 0x51, 0x57, 0x60, 0x60, 0x52, 0x6C, 0x2D, 0x50, 0x53, 0x37, 0x42, 0x60, -0x54, 0x4C, 0x0F, 0x50, 0x55, 0x17, 0x24, 0x60, 0x56, 0x2B, 0xF1, 0x50, 0x56, 0xF7, 0x06, 0x60, -0x58, 0x15, 0x0D, 0xD0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xEF, 0xD0, 0x5A, 0xB6, 0xCA, 0x60, -0x5B, 0xD4, 0xD1, 0xD0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xB3, 0xD0, 0x5E, 0x7F, 0xC8, 0xE0, -0x5F, 0x94, 0x95, 0xD0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xB2, 0x50, 0x62, 0x3F, 0x8C, 0xE0, -0x63, 0x5D, 0x94, 0x50, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x76, 0x50, 0x66, 0x08, 0x8B, 0x60, -0x67, 0x1D, 0x58, 0x50, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x3A, 0x50, 0x69, 0xC8, 0x4F, 0x60, -0x6A, 0xDD, 0x1C, 0x50, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x38, 0xD0, 0x6D, 0x88, 0x13, 0x60, -0x6E, 0xA6, 0x1A, 0xD0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x85, 0xFC, 0xD0, 0x71, 0x51, 0x11, 0xE0, -0x72, 0x65, 0xDE, 0xD0, 0x73, 0x30, 0xF3, 0xE0, 0x74, 0x45, 0xC0, 0xD0, 0x75, 0x10, 0xD5, 0xE0, -0x76, 0x2E, 0xDD, 0x50, 0x76, 0xF0, 0xB7, 0xE0, 0x78, 0x0E, 0xBF, 0x50, 0x78, 0xD0, 0x99, 0xE0, -0x79, 0xEE, 0xA1, 0x50, 0x7A, 0xB0, 0x7B, 0xE0, 0x7B, 0xCE, 0x83, 0x50, 0x7C, 0x99, 0x98, 0x60, -0x7D, 0xAE, 0x65, 0x50, 0x7E, 0x79, 0x7A, 0x60, 0x7F, 0x8E, 0x47, 0x50, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xBD, 0x07, 0xED, 0x01, 0x48, 0xD3, 0xB0, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Bishkek */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x7E, 0x10, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xBE, 0xA3, 0xC0, 0x29, 0xE7, 0x37, 0x30, -0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xC7, 0x19, 0x30, 0x2C, 0xA4, 0x87, 0x20, 0x2D, 0xA6, 0xFB, 0x30, -0x2E, 0x84, 0x69, 0x20, 0x2F, 0x86, 0xDD, 0x30, 0x30, 0x64, 0x4B, 0x20, 0x31, 0x66, 0xBF, 0x30, -0x32, 0x4D, 0x67, 0xA0, 0x33, 0x3D, 0x89, 0xD8, 0x34, 0x52, 0x56, 0xC8, 0x35, 0x1D, 0x6B, 0xD8, -0x36, 0x32, 0x38, 0xC8, 0x36, 0xFD, 0x4D, 0xD8, 0x38, 0x1B, 0x55, 0x48, 0x38, 0xDD, 0x2F, 0xD8, -0x39, 0xFB, 0x37, 0x48, 0x3A, 0xBD, 0x11, 0xD8, 0x3B, 0xDB, 0x19, 0x48, 0x3C, 0xA6, 0x2E, 0x58, -0x3D, 0xBA, 0xFB, 0x48, 0x3E, 0x86, 0x10, 0x58, 0x3F, 0x9A, 0xDD, 0x48, 0x40, 0x65, 0xF2, 0x58, -0x41, 0x83, 0xF9, 0xC8, 0x42, 0x45, 0xD4, 0x58, 0x42, 0xFB, 0x92, 0x20, 0x01, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x06, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x0A, -0x00, 0x00, 0x45, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, -0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, -0x00, 0x00, 0x46, 0x50, 0x00, 0x14, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, -0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x52, 0x55, 0x54, 0x00, 0x46, 0x52, 0x55, 0x53, 0x54, -0x00, 0x4B, 0x47, 0x53, 0x54, 0x00, 0x4B, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xCA, 0xCA, 0x10, 0x01, 0x84, 0x7D, 0x20, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Brunei */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0xAD, 0x8A, 0x02, 0x44, -0xBA, 0x67, 0x47, 0x88, 0x01, 0x02, 0x00, 0x00, 0x6B, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x69, 0x78, -0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x42, 0x4E, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0xDB, 0x55, 0x01, 0xC2, 0x01, 0xD2, 0x00, 0x00, -0x00, 0x00, - -/* Asia/Calcutta */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xCA, 0xDB, 0x86, 0xB0, -0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xD2, 0x74, 0x12, 0x98, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x04, 0x00, 0x00, 0x4D, 0x58, -0x00, 0x09, 0x00, 0x00, 0x5B, 0x68, 0x01, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, -0x00, 0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Choibalsan */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x86, 0xD3, 0xE7, 0x28, -0x0F, 0x0B, 0xDC, 0x90, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xEE, 0xE0, 0x1A, 0xCC, 0x3F, 0x70, -0x1B, 0xBC, 0x22, 0x60, 0x1C, 0xAC, 0x21, 0x70, 0x1D, 0x9C, 0x04, 0x60, 0x1E, 0x8C, 0x03, 0x70, -0x1F, 0x7B, 0xE6, 0x60, 0x20, 0x6B, 0xE5, 0x70, 0x21, 0x5B, 0xC8, 0x60, 0x22, 0x4B, 0xC7, 0x70, -0x23, 0x3B, 0xAA, 0x60, 0x24, 0x2B, 0xA9, 0x70, 0x25, 0x1B, 0x8C, 0x60, 0x26, 0x0B, 0x8B, 0x70, -0x27, 0x04, 0xA8, 0xE0, 0x27, 0xF4, 0xA7, 0xF0, 0x28, 0xE4, 0x8A, 0xE0, 0x29, 0xD4, 0x89, 0xF0, -0x2A, 0xC4, 0x6C, 0xE0, 0x2B, 0xB4, 0x6B, 0xF0, 0x2C, 0xA4, 0x4E, 0xE0, 0x2D, 0x94, 0x4D, 0xF0, -0x2E, 0x84, 0x30, 0xE0, 0x2F, 0x74, 0x2F, 0xF0, 0x30, 0x64, 0x12, 0xE0, 0x31, 0x5D, 0x4C, 0x70, -0x32, 0x4D, 0x2F, 0x60, 0x33, 0x3D, 0x2E, 0x70, 0x34, 0x2D, 0x11, 0x60, 0x35, 0x1D, 0x10, 0x70, -0x36, 0x0C, 0xF3, 0x60, 0x3A, 0xE9, 0xA5, 0x90, 0x3B, 0xB4, 0x9E, 0x80, 0x3C, 0xA4, 0x9D, 0x90, -0x3D, 0x94, 0x80, 0x80, 0x3E, 0x84, 0x7F, 0x90, 0x3F, 0x74, 0x62, 0x80, 0x40, 0x64, 0x61, 0x90, -0x41, 0x54, 0x44, 0x80, 0x42, 0x44, 0x43, 0x90, 0x43, 0x34, 0x26, 0x80, 0x44, 0x24, 0x25, 0x90, -0x45, 0x1D, 0x43, 0x00, 0x47, 0xEF, 0xAA, 0xF0, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x00, 0x00, 0x6B, 0x58, 0x00, 0x00, 0x00, 0x00, 0x62, -0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, 0x00, -0x00, 0x8C, 0xA0, 0x01, 0x0E, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x55, -0x4C, 0x41, 0x54, 0x00, 0x43, 0x48, 0x4F, 0x54, 0x00, 0x43, 0x48, 0x4F, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD2, 0xAC, 0x4A, 0x01, -0xC1, 0x5F, 0x10, 0x00, 0x00, 0x00, 0x12, 0x44, 0x6F, 0x72, 0x6E, 0x6F, 0x64, 0x2C, 0x20, 0x53, -0x75, 0x6B, 0x68, 0x62, 0x61, 0x61, 0x74, 0x61, 0x72, - -/* Asia/Chongqing */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xA8, 0x94, -0x13, 0x6D, 0xC9, 0x10, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, -0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, -0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, -0x28, 0xD2, 0x23, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4C, 0x4F, -0x4E, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB6, 0x71, 0xBA, 0x01, 0xB5, 0x4A, 0x9D, 0x00, 0x00, 0x00, 0x40, 0x63, -0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x20, 0x2D, 0x20, 0x53, -0x69, 0x63, 0x68, 0x75, 0x61, 0x6E, 0x2C, 0x20, 0x59, 0x75, 0x6E, 0x6E, 0x61, 0x6E, 0x2C, 0x20, -0x47, 0x75, 0x61, 0x6E, 0x67, 0x78, 0x69, 0x2C, 0x20, 0x53, 0x68, 0x61, 0x61, 0x6E, 0x78, 0x69, -0x2C, 0x20, 0x47, 0x75, 0x69, 0x7A, 0x68, 0x6F, 0x75, 0x2C, 0x20, 0x65, 0x74, 0x63, 0x2E, - -/* Asia/Chungking */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xA8, 0x94, -0x13, 0x6D, 0xC9, 0x10, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, -0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, -0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, -0x28, 0xD2, 0x23, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4C, 0x4F, -0x4E, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Colombo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x87, 0x9D, 0xBD, 0x1C, -0xCB, 0x5A, 0x1C, 0x28, 0xCC, 0x95, 0x2B, 0xA0, 0xD2, 0x75, 0x80, 0x38, 0x31, 0xA6, 0x00, 0x28, -0x32, 0x71, 0x00, 0x20, 0x44, 0x3F, 0xEA, 0x28, 0x01, 0x02, 0x03, 0x01, 0x04, 0x05, 0x01, 0x00, -0x00, 0x4A, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, -0x08, 0x00, 0x00, 0x5B, 0x68, 0x01, 0x04, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x0D, 0x00, 0x00, 0x54, -0x60, 0x00, 0x0D, 0x4D, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x48, 0x53, 0x54, 0x00, -0x4C, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x93, 0xE8, 0x95, 0x01, 0x8C, 0x7F, 0xE8, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Dacca */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0xCA, 0xDB, 0x86, 0xB0, -0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xDD, 0xA8, 0xD2, 0x98, 0x02, 0x4F, 0x9D, 0x20, -0x01, 0x02, 0x01, 0x03, 0x04, 0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, -0x04, 0x00, 0x00, 0x4D, 0x58, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x00, 0x00, 0x54, -0x60, 0x00, 0x12, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x44, 0x41, 0x43, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Damascus */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xA1, 0xF2, 0xAB, 0x78, -0xA2, 0x81, 0x2F, 0x80, 0xA3, 0x5E, 0x9D, 0x70, 0xA4, 0x61, 0x11, 0x80, 0xA5, 0x3E, 0x7F, 0x70, -0xA6, 0x40, 0xF3, 0x80, 0xA7, 0x1E, 0x61, 0x70, 0xA8, 0x20, 0xD5, 0x80, 0xA9, 0x07, 0x7D, 0xF0, -0xF1, 0x8F, 0x52, 0x00, 0xF2, 0x5B, 0x9C, 0x70, 0xF3, 0x73, 0x28, 0x80, 0xF4, 0x3B, 0x7E, 0x70, -0xF5, 0x55, 0xAD, 0x80, 0xF6, 0x1F, 0x54, 0xF0, 0xF7, 0x36, 0xE1, 0x00, 0xF7, 0xFF, 0x36, 0xF0, -0xF9, 0x0E, 0xDA, 0x00, 0xF9, 0xE1, 0xBB, 0xF0, 0xFA, 0xF9, 0x48, 0x00, 0xFB, 0xC2, 0xEF, 0x70, -0xFC, 0xDB, 0xCD, 0x00, 0xFD, 0xA5, 0x74, 0x70, 0xFE, 0xBD, 0x00, 0x80, 0xFF, 0x86, 0xA7, 0xF0, -0x00, 0x9E, 0x34, 0x00, 0x01, 0x67, 0xDB, 0x70, 0x02, 0x7F, 0x67, 0x80, 0x03, 0x49, 0x0E, 0xF0, -0x04, 0x61, 0xEC, 0x80, 0x05, 0x2B, 0x93, 0xF0, 0x06, 0x43, 0x20, 0x00, 0x07, 0x0C, 0xC7, 0x70, -0x08, 0x24, 0x53, 0x80, 0x08, 0xED, 0xFA, 0xF0, 0x0A, 0x05, 0x87, 0x00, 0x0A, 0xCF, 0x2E, 0x70, -0x0B, 0xE8, 0x0C, 0x00, 0x0C, 0xB1, 0xB3, 0x70, 0x0D, 0xC9, 0x3F, 0x80, 0x0E, 0x6B, 0x59, 0xF0, -0x0F, 0xAA, 0x73, 0x00, 0x10, 0x4C, 0x8D, 0x70, 0x18, 0xF4, 0xC5, 0x00, 0x19, 0xDB, 0x6D, 0x70, -0x1A, 0xD7, 0x4A, 0x00, 0x1B, 0xBD, 0xF2, 0x70, 0x1E, 0x55, 0x23, 0x00, 0x1F, 0x8A, 0xE5, 0x70, -0x20, 0x47, 0x7A, 0x00, 0x21, 0x89, 0x19, 0xF0, 0x22, 0x3C, 0x74, 0x00, 0x23, 0x6B, 0x9E, 0xF0, -0x24, 0x32, 0xBF, 0x80, 0x25, 0x25, 0x45, 0x70, 0x26, 0x15, 0x44, 0x80, 0x27, 0x05, 0x27, 0x70, -0x27, 0xF6, 0x5B, 0xE0, 0x28, 0xE7, 0x90, 0x50, 0x29, 0xE2, 0x1B, 0x60, 0x2A, 0xCA, 0x15, 0x50, -0x2B, 0xB2, 0x2B, 0x60, 0x2C, 0xA3, 0x5F, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x8C, 0x7C, 0x50, -0x2F, 0x7C, 0x7B, 0x60, 0x30, 0x6D, 0xAF, 0xD0, 0x31, 0x5F, 0x00, 0x60, 0x32, 0x50, 0x34, 0xD0, -0x33, 0x3E, 0xE2, 0x60, 0x34, 0x31, 0x68, 0x50, 0x35, 0x1E, 0xC4, 0x60, 0x36, 0x12, 0x9B, 0xD0, -0x37, 0x02, 0x9A, 0xE0, 0x37, 0xF3, 0xCF, 0x50, 0x38, 0xE5, 0x1F, 0xE0, 0x39, 0xD6, 0x54, 0x50, -0x3A, 0xC6, 0x53, 0x60, 0x3B, 0xB7, 0x87, 0xD0, 0x3C, 0xA7, 0x86, 0xE0, 0x3D, 0x98, 0xBB, 0x50, -0x3E, 0x88, 0xBA, 0x60, 0x3F, 0x79, 0xEE, 0xD0, 0x40, 0x6B, 0x3F, 0x60, 0x41, 0x5C, 0x73, 0xD0, -0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3D, 0xA7, 0x50, 0x44, 0x2D, 0xA6, 0x60, 0x45, 0x12, 0xFD, 0x50, -0x46, 0x0C, 0x36, 0xE0, 0x47, 0x2A, 0x3E, 0x50, 0x47, 0xF5, 0x53, 0x60, 0x49, 0x0B, 0x71, 0xD0, -0x49, 0xD5, 0x35, 0x60, 0x4A, 0xEC, 0xA5, 0x50, 0x4B, 0xB5, 0x17, 0x60, 0x4C, 0xCD, 0xD8, 0xD0, -0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xAF, 0x0C, 0x50, 0x4F, 0x7E, 0x15, 0xE0, 0x50, 0x91, 0x91, 0x50, -0x51, 0x5D, 0xF7, 0xE0, 0x52, 0x72, 0xC4, 0xD0, 0x53, 0x3D, 0xD9, 0xE0, 0x54, 0x53, 0xF8, 0x50, -0x55, 0x1D, 0xBB, 0xE0, 0x56, 0x35, 0x2B, 0xD0, 0x56, 0xFD, 0x9D, 0xE0, 0x58, 0x17, 0xB0, 0xD0, -0x58, 0xE6, 0xBA, 0x60, 0x59, 0xF8, 0xE4, 0x50, 0x5A, 0xC6, 0x9C, 0x60, 0x5B, 0xDA, 0x17, 0xD0, -0x5C, 0xA6, 0x7E, 0x60, 0x5D, 0xBB, 0x4B, 0x50, 0x5E, 0x86, 0x60, 0x60, 0x5F, 0x9D, 0xD0, 0x50, -0x60, 0x66, 0x42, 0x60, 0x61, 0x7F, 0x03, 0xD0, 0x62, 0x46, 0x24, 0x60, 0x63, 0x60, 0x37, 0x50, -0x64, 0x2F, 0x40, 0xE0, 0x65, 0x41, 0x6A, 0xD0, 0x66, 0x0F, 0x22, 0xE0, 0x67, 0x23, 0xEF, 0xD0, -0x67, 0xEF, 0x04, 0xE0, 0x69, 0x05, 0x23, 0x50, 0x69, 0xCE, 0xE6, 0xE0, 0x6A, 0xE6, 0x56, 0xD0, -0x6B, 0xAE, 0xC8, 0xE0, 0x6C, 0xC7, 0x8A, 0x50, 0x6D, 0x97, 0xE5, 0x60, 0x6E, 0xAA, 0x0F, 0x50, -0x6F, 0x77, 0xC7, 0x60, 0x70, 0x8B, 0x42, 0xD0, 0x71, 0x57, 0xA9, 0x60, 0x72, 0x6C, 0x76, 0x50, -0x73, 0x37, 0x8B, 0x60, 0x74, 0x4D, 0xA9, 0xD0, 0x75, 0x17, 0x6D, 0x60, 0x76, 0x30, 0x2E, 0xD0, -0x76, 0xF7, 0x4F, 0x60, 0x78, 0x11, 0x62, 0x50, 0x78, 0xE0, 0x6B, 0xE0, 0x79, 0xF2, 0x95, 0xD0, -0x7A, 0xC0, 0x4D, 0xE0, 0x7B, 0xD3, 0xC9, 0x50, 0x7C, 0xA0, 0x2F, 0xE0, 0x7D, 0xB6, 0x4E, 0x50, -0x7E, 0x80, 0x11, 0xE0, 0x7F, 0x97, 0x81, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, -0x00, 0x22, 0x08, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xBC, 0x72, 0x30, 0x01, 0x4A, 0x0C, 0x30, 0x00, 0x00, 0x00, 0x00, - - -/* Asia/Dhaka */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0xCA, 0xDB, 0x86, 0xB0, -0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xDD, 0xA8, 0xD2, 0x98, 0x02, 0x4F, 0x9D, 0x20, -0x01, 0x02, 0x01, 0x03, 0x04, 0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, -0x04, 0x00, 0x00, 0x4D, 0x58, 0x00, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0D, 0x00, 0x00, 0x54, -0x60, 0x00, 0x12, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x44, 0x41, 0x43, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xAD, 0x84, 0x92, 0x01, 0x9C, 0x9F, 0x82, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Dili */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x92, 0xE6, 0x18, 0xC4, -0xCB, 0x99, 0x32, 0xF0, 0xD2, 0x56, 0xEE, 0x70, 0x0B, 0xEA, 0x30, 0x70, 0x39, 0xC3, 0x99, 0x00, -0x01, 0x02, 0x03, 0x04, 0x03, 0x00, 0x00, 0x75, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, -0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4C, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43, -0x49, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7D, 0xF6, -0x18, 0x01, 0xD2, 0x48, 0x7D, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Dubai */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0xF2, 0x99, 0xA8, -0x01, 0x00, 0x00, 0x33, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAF, 0xEF, 0x10, 0x01, 0x67, 0x0A, -0x10, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Dushanbe */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x13, 0xAA, 0x19, 0x83, 0x80, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xCA, 0x8F, 0x50, 0x01, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x06, 0x07, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, -0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, -0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, -0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x44, 0x55, 0x53, 0x54, 0x00, 0x44, 0x55, 0x53, -0x53, 0x54, 0x00, 0x54, 0x4A, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x33, 0xDD, 0x01, 0x7B, 0xA3, 0x80, 0x00, -0x00, 0x00, 0x00, - -/* Asia/Gaza */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xC8, 0x59, 0xB2, 0xE0, -0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0, -0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, 0xD3, 0x65, 0xB0, 0x80, -0xD4, 0x6B, 0xE0, 0xD0, 0xE8, 0x36, 0x63, 0x60, 0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, -0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xFA, 0xF0, 0xEC, 0xB5, 0x6D, 0x00, 0xED, 0xCF, 0x7F, 0xF0, -0xEE, 0x97, 0xF2, 0x00, 0xEF, 0xB0, 0xB3, 0x70, 0xF0, 0x79, 0x25, 0x80, 0xF1, 0x91, 0xE6, 0xF0, -0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x73, 0x1A, 0x70, 0xF4, 0x3B, 0x8C, 0x80, 0xF5, 0x55, 0x9F, 0x70, -0xF6, 0x1E, 0x11, 0x80, 0xF7, 0x36, 0xD2, 0xF0, 0xF7, 0xFF, 0x45, 0x00, 0xF9, 0x18, 0x06, 0x70, -0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0, 0xFB, 0x27, 0x42, 0x50, 0x08, 0x7C, 0x8B, 0xE0, -0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0, -0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60, -0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60, -0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0, -0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0, -0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0, -0x30, 0x48, 0xC5, 0xD0, 0x30, 0xE7, 0x07, 0xE0, 0x31, 0x64, 0x46, 0x60, 0x32, 0x41, 0xC2, 0x60, -0x33, 0x44, 0x28, 0x60, 0x34, 0x21, 0xA4, 0x60, 0x35, 0x24, 0x0A, 0x60, 0x36, 0x01, 0x86, 0x60, -0x36, 0x8B, 0xF3, 0xE0, 0x37, 0x16, 0x61, 0x60, 0x38, 0x06, 0x44, 0x50, 0x38, 0xFF, 0x7D, 0xE0, -0x39, 0xEF, 0x60, 0xD0, 0x3A, 0xDF, 0x5F, 0xE0, 0x3B, 0xCF, 0x42, 0xD0, 0x3C, 0xBF, 0x41, 0xE0, -0x3D, 0xAF, 0x24, 0xD0, 0x3E, 0x9F, 0x23, 0xE0, 0x3F, 0x8F, 0x06, 0xD0, 0x40, 0x7F, 0x05, 0xE0, -0x41, 0x5C, 0x81, 0xE0, 0x42, 0x5E, 0xE7, 0xE0, 0x43, 0x41, 0xB7, 0xF0, 0x44, 0x2D, 0xA6, 0x60, -0x45, 0x12, 0xFD, 0x50, 0x46, 0x0E, 0xD9, 0xE0, 0x46, 0xE8, 0x6F, 0x70, 0x47, 0xF1, 0x5E, 0xE0, -0x48, 0xB5, 0xDC, 0x70, 0x49, 0xD2, 0x92, 0x60, 0x4A, 0x95, 0xBE, 0x70, 0x4B, 0xB3, 0xC5, 0xE0, -0x4C, 0x75, 0xA0, 0x70, 0x4D, 0x94, 0xF9, 0x60, 0x4E, 0x55, 0x82, 0x70, 0x4F, 0x77, 0x7E, 0x60, -0x50, 0x3E, 0x9E, 0xF0, 0x51, 0x58, 0xB1, 0xE0, 0x52, 0x1E, 0x80, 0xF0, 0x53, 0x39, 0xE5, 0x60, -0x53, 0xFE, 0x62, 0xF0, 0x55, 0x1B, 0x18, 0xE0, 0x55, 0xDE, 0x44, 0xF0, 0x56, 0xFD, 0x9D, 0xE0, -0x57, 0xBE, 0x26, 0xF0, 0x58, 0xDE, 0xD1, 0x60, 0x59, 0xA7, 0x43, 0x70, 0x5A, 0xC0, 0x04, 0xE0, -0x5B, 0x87, 0x25, 0x70, 0x5C, 0xA1, 0x38, 0x60, 0x5D, 0x67, 0x07, 0x70, 0x5E, 0x83, 0xBD, 0x60, -0x5F, 0x46, 0xE9, 0x70, 0x60, 0x64, 0xF0, 0xE0, 0x61, 0x26, 0xCB, 0x70, 0x62, 0x46, 0x24, 0x60, -0x63, 0x06, 0xAD, 0x70, 0x64, 0x27, 0x57, 0xE0, 0x64, 0xEF, 0xC9, 0xF0, 0x66, 0x09, 0xDC, 0xE0, -0x66, 0xCF, 0xAB, 0xF0, 0x67, 0xEB, 0x10, 0x60, 0x68, 0xAF, 0x8D, 0xF0, 0x69, 0xCC, 0x43, 0xE0, -0x6A, 0x8F, 0x6F, 0xF0, 0x6B, 0xAD, 0x77, 0x60, 0x6C, 0x6F, 0x51, 0xF0, 0x6D, 0x8F, 0xFC, 0x60, -0x6E, 0x58, 0x6E, 0x70, 0x6F, 0x71, 0x2F, 0xE0, 0x70, 0x38, 0x50, 0x70, 0x71, 0x52, 0x63, 0x60, -0x72, 0x18, 0x32, 0x70, 0x73, 0x33, 0x96, 0xE0, 0x73, 0xF8, 0x14, 0x70, 0x75, 0x16, 0x1B, 0xE0, -0x75, 0xD7, 0xF6, 0x70, 0x76, 0xF7, 0x4F, 0x60, 0x77, 0xB7, 0xD8, 0x70, 0x78, 0xD8, 0x82, 0xE0, -0x79, 0xA0, 0xF4, 0xF0, 0x7A, 0xB9, 0xB6, 0x60, 0x7B, 0x80, 0xD6, 0xF0, 0x7C, 0x9C, 0x3B, 0x60, -0x7D, 0x60, 0xB8, 0xF0, 0x7E, 0x7D, 0x6E, 0xE0, 0x7F, 0x40, 0x9A, 0xF0, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x2A, 0x30, -0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, -0x45, 0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB9, 0x64, -0xF0, 0x01, 0x47, 0x40, 0x0A, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Harbin */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0x95, 0xBC, -0xB8, 0xD3, 0xCE, 0x78, 0xC7, 0x90, 0xFA, 0x80, 0xF9, 0x17, 0x95, 0xF0, 0x13, 0x6D, 0xB3, 0xF8, -0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70, -0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0, -0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0, -0x01, 0x02, 0x03, 0x01, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, -0x02, 0x00, 0x00, 0x76, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D, 0x4C, -0x4D, 0x54, 0x00, 0x43, 0x48, 0x41, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCF, 0x23, 0x58, 0x01, 0xD3, -0xF6, 0x2D, 0x00, 0x00, 0x00, 0x21, 0x48, 0x65, 0x69, 0x6C, 0x6F, 0x6E, 0x67, 0x6A, 0x69, 0x61, -0x6E, 0x67, 0x20, 0x28, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x4D, 0x6F, 0x68, 0x65, 0x29, -0x2C, 0x20, 0x4A, 0x69, 0x6C, 0x69, 0x6E, - -/* Asia/Ho_Chi_Minh */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0xBB, 0x78, -0x01, 0xB5, 0x6B, 0x2A, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Hong_Kong */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x69, 0x5A, 0xFC, -0xD3, 0x6A, 0xB7, 0x38, 0xD4, 0x93, 0x4A, 0xA8, 0xD5, 0x42, 0xB0, 0x38, 0xD6, 0x9A, 0xB9, 0xA8, -0xD7, 0x3E, 0x41, 0xB8, 0xD8, 0x2E, 0x24, 0xA8, 0xD8, 0xF9, 0x39, 0xB8, 0xDA, 0x0E, 0x06, 0xA8, -0xDA, 0xD9, 0x1B, 0xB8, 0xDB, 0xED, 0xE8, 0xA8, 0xDC, 0xB8, 0xFD, 0xB8, 0xDD, 0xCD, 0xCA, 0xA8, -0xDE, 0xA2, 0x1A, 0x38, 0xDF, 0xAD, 0xAC, 0xA8, 0xE0, 0x81, 0xFC, 0x38, 0xE1, 0x96, 0xC9, 0x28, -0xE2, 0x4F, 0x69, 0x38, 0xE3, 0x76, 0xAB, 0x28, 0xE4, 0x2F, 0x4B, 0x38, 0xE5, 0x5F, 0xC7, 0xA8, -0xE6, 0x0F, 0x2D, 0x38, 0xE7, 0x3F, 0xA9, 0xA8, 0xE7, 0xF8, 0x49, 0xB8, 0xE9, 0x1F, 0x8B, 0xA8, -0xE9, 0xD8, 0x2B, 0xB8, 0xEA, 0xFF, 0x6D, 0xA8, 0xEB, 0xB8, 0x0D, 0xB8, 0xEC, 0xDF, 0x4F, 0xA8, -0xED, 0x97, 0xEF, 0xB8, 0xEE, 0xC8, 0x6C, 0x28, 0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, -0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, 0xF3, 0x40, 0xD0, 0x38, 0xF4, 0x68, 0x12, 0x28, -0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, 0xF7, 0x25, 0x7E, 0x38, 0xF8, 0x15, 0x61, 0x28, -0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, 0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, -0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, 0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, -0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, 0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, -0x04, 0x4D, 0xE6, 0xB8, 0x05, 0x47, 0x04, 0x28, 0x06, 0x37, 0x03, 0x38, 0x07, 0x26, 0xE6, 0x28, -0x08, 0x16, 0xE5, 0x38, 0x09, 0x06, 0xC8, 0x28, 0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, -0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, 0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, -0x11, 0x9B, 0x39, 0x38, 0x12, 0x6F, 0x6C, 0xA8, 0x13, 0x7B, 0x1B, 0x38, 0x14, 0x4F, 0x4E, 0xA8, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x6B, 0x04, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, -0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x48, 0x4B, 0x53, 0x54, 0x00, -0x48, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAB, 0x54, 0xAD, 0x01, 0xC0, -0xD6, 0x57, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Hovd */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0F, 0x86, 0xD3, 0xFC, 0x94, -0x0F, 0x0B, 0xEA, 0xA0, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90, -0x1B, 0xBC, 0x3E, 0x80, 0x1C, 0xAC, 0x3D, 0x90, 0x1D, 0x9C, 0x20, 0x80, 0x1E, 0x8C, 0x1F, 0x90, -0x1F, 0x7C, 0x02, 0x80, 0x20, 0x6C, 0x01, 0x90, 0x21, 0x5B, 0xE4, 0x80, 0x22, 0x4B, 0xE3, 0x90, -0x23, 0x3B, 0xC6, 0x80, 0x24, 0x2B, 0xC5, 0x90, 0x25, 0x1B, 0xA8, 0x80, 0x26, 0x0B, 0xA7, 0x90, -0x27, 0x04, 0xC5, 0x00, 0x27, 0xF4, 0xC4, 0x10, 0x28, 0xE4, 0xA7, 0x00, 0x29, 0xD4, 0xA6, 0x10, -0x2A, 0xC4, 0x89, 0x00, 0x2B, 0xB4, 0x88, 0x10, 0x2C, 0xA4, 0x6B, 0x00, 0x2D, 0x94, 0x6A, 0x10, -0x2E, 0x84, 0x4D, 0x00, 0x2F, 0x74, 0x4C, 0x10, 0x30, 0x64, 0x2F, 0x00, 0x31, 0x5D, 0x68, 0x90, -0x32, 0x4D, 0x4B, 0x80, 0x33, 0x3D, 0x4A, 0x90, 0x34, 0x2D, 0x2D, 0x80, 0x35, 0x1D, 0x2C, 0x90, -0x36, 0x0D, 0x0F, 0x80, 0x3A, 0xE9, 0xC1, 0xB0, 0x3B, 0xB4, 0xBA, 0xA0, 0x3C, 0xA4, 0xB9, 0xB0, -0x3D, 0x94, 0x9C, 0xA0, 0x3E, 0x84, 0x9B, 0xB0, 0x3F, 0x74, 0x7E, 0xA0, 0x40, 0x64, 0x7D, 0xB0, -0x41, 0x54, 0x60, 0xA0, 0x42, 0x44, 0x5F, 0xB0, 0x43, 0x34, 0x42, 0xA0, 0x44, 0x24, 0x41, 0xB0, -0x45, 0x1D, 0x5F, 0x20, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x55, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, -0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x48, 0x4F, -0x56, 0x54, 0x00, 0x48, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xD2, 0x98, 0xC2, 0x01, 0x9E, 0x81, 0x47, 0x00, 0x00, 0x00, 0x2B, 0x42, 0x61, 0x79, -0x61, 0x6E, 0x2D, 0x4F, 0x6C, 0x67, 0x69, 0x79, 0x2C, 0x20, 0x47, 0x6F, 0x76, 0x69, 0x2D, 0x41, -0x6C, 0x74, 0x61, 0x69, 0x2C, 0x20, 0x48, 0x6F, 0x76, 0x64, 0x2C, 0x20, 0x55, 0x76, 0x73, 0x2C, -0x20, 0x5A, 0x61, 0x76, 0x6B, 0x68, 0x61, 0x6E, - -/* Asia/Irkutsk */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA2, 0x12, 0x0F, 0xB0, -0xB5, 0xA3, 0xD3, 0x10, 0x15, 0x27, 0x61, 0x80, 0x16, 0x18, 0x95, 0xF0, 0x17, 0x08, 0x95, 0x00, -0x17, 0xF9, 0xC9, 0x70, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80, -0x1B, 0xBC, 0x5A, 0xA0, 0x1C, 0xAC, 0x4B, 0xA0, 0x1D, 0x9C, 0x3C, 0xA0, 0x1E, 0x8C, 0x2D, 0xA0, -0x1F, 0x7C, 0x1E, 0xA0, 0x20, 0x6C, 0x0F, 0xA0, 0x21, 0x5C, 0x00, 0xA0, 0x22, 0x4B, 0xF1, 0xA0, -0x23, 0x3B, 0xE2, 0xA0, 0x24, 0x2B, 0xD3, 0xA0, 0x25, 0x1B, 0xC4, 0xA0, 0x26, 0x0B, 0xB5, 0xA0, -0x27, 0x04, 0xE1, 0x20, 0x27, 0xF4, 0xD2, 0x20, 0x28, 0xE4, 0xD1, 0x30, 0x29, 0x78, 0x79, 0x30, -0x29, 0xD4, 0x89, 0xF0, 0x2A, 0xC4, 0x6C, 0xE0, 0x2B, 0xB4, 0x96, 0x20, 0x2C, 0xA4, 0x87, 0x20, -0x2D, 0x94, 0x78, 0x20, 0x2E, 0x84, 0x69, 0x20, 0x2F, 0x74, 0x5A, 0x20, 0x30, 0x64, 0x4B, 0x20, -0x31, 0x5D, 0x76, 0xA0, 0x32, 0x72, 0x51, 0xA0, 0x33, 0x3D, 0x58, 0xA0, 0x34, 0x52, 0x33, 0xA0, -0x35, 0x1D, 0x3A, 0xA0, 0x36, 0x32, 0x15, 0xA0, 0x36, 0xFD, 0x1C, 0xA0, 0x38, 0x1B, 0x32, 0x20, -0x38, 0xDC, 0xFE, 0xA0, 0x39, 0xFB, 0x14, 0x20, 0x3A, 0xBC, 0xE0, 0xA0, 0x3B, 0xDA, 0xF6, 0x20, -0x3C, 0xA5, 0xFD, 0x20, 0x3D, 0xBA, 0xD8, 0x20, 0x3E, 0x85, 0xDF, 0x20, 0x3F, 0x9A, 0xBA, 0x20, -0x40, 0x65, 0xC1, 0x20, 0x41, 0x83, 0xD6, 0xA0, 0x42, 0x45, 0xA3, 0x20, 0x43, 0x63, 0xB8, 0xA0, -0x44, 0x25, 0x85, 0x20, 0x45, 0x43, 0x9A, 0xA0, 0x46, 0x05, 0x67, 0x20, 0x47, 0x23, 0x7C, 0xA0, -0x47, 0xEE, 0x83, 0xA0, 0x49, 0x03, 0x5E, 0xA0, 0x49, 0xCE, 0x65, 0xA0, 0x4A, 0xE3, 0x40, 0xA0, -0x4B, 0xAE, 0x47, 0xA0, 0x4C, 0xCC, 0x5D, 0x20, 0x4D, 0x8E, 0x29, 0xA0, 0x4E, 0xAC, 0x3F, 0x20, -0x4F, 0x6E, 0x0B, 0xA0, 0x50, 0x8C, 0x21, 0x20, 0x51, 0x57, 0x28, 0x20, 0x52, 0x6C, 0x03, 0x20, -0x53, 0x37, 0x0A, 0x20, 0x54, 0x4B, 0xE5, 0x20, 0x55, 0x16, 0xEC, 0x20, 0x56, 0x2B, 0xC7, 0x20, -0x56, 0xF6, 0xCE, 0x20, 0x58, 0x14, 0xE3, 0xA0, 0x58, 0xD6, 0xB0, 0x20, 0x59, 0xF4, 0xC5, 0xA0, -0x5A, 0xB6, 0x92, 0x20, 0x5B, 0xD4, 0xA7, 0xA0, 0x5C, 0x9F, 0xAE, 0xA0, 0x5D, 0xB4, 0x89, 0xA0, -0x5E, 0x7F, 0x90, 0xA0, 0x5F, 0x94, 0x6B, 0xA0, 0x60, 0x5F, 0x72, 0xA0, 0x61, 0x7D, 0x88, 0x20, -0x62, 0x3F, 0x54, 0xA0, 0x63, 0x5D, 0x6A, 0x20, 0x64, 0x1F, 0x36, 0xA0, 0x65, 0x3D, 0x4C, 0x20, -0x66, 0x08, 0x53, 0x20, 0x67, 0x1D, 0x2E, 0x20, 0x67, 0xE8, 0x35, 0x20, 0x68, 0xFD, 0x10, 0x20, -0x69, 0xC8, 0x17, 0x20, 0x6A, 0xDC, 0xF2, 0x20, 0x6B, 0xA7, 0xF9, 0x20, 0x6C, 0xC6, 0x0E, 0xA0, -0x6D, 0x87, 0xDB, 0x20, 0x6E, 0xA5, 0xF0, 0xA0, 0x6F, 0x67, 0xBD, 0x20, 0x70, 0x85, 0xD2, 0xA0, -0x71, 0x50, 0xD9, 0xA0, 0x72, 0x65, 0xB4, 0xA0, 0x73, 0x30, 0xBB, 0xA0, 0x74, 0x45, 0x96, 0xA0, -0x75, 0x10, 0x9D, 0xA0, 0x76, 0x2E, 0xB3, 0x20, 0x76, 0xF0, 0x7F, 0xA0, 0x78, 0x0E, 0x95, 0x20, -0x78, 0xD0, 0x61, 0xA0, 0x79, 0xEE, 0x77, 0x20, 0x7A, 0xB0, 0x43, 0xA0, 0x7B, 0xCE, 0x59, 0x20, -0x7C, 0x99, 0x60, 0x20, 0x7D, 0xAE, 0x3B, 0x20, 0x7E, 0x79, 0x42, 0x20, 0x7F, 0x8E, 0x1D, 0x20, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x61, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, -0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, -0x00, 0x62, 0x70, 0x00, 0x04, 0x49, 0x4D, 0x54, 0x00, 0x49, 0x52, 0x4B, 0x54, 0x00, 0x49, 0x52, -0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xD9, 0x14, 0xEA, 0x01, 0xB1, 0xDB, 0xB5, 0x00, 0x00, 0x00, 0x17, -0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x35, 0x20, 0x2D, 0x20, 0x4C, 0x61, 0x6B, 0x65, -0x20, 0x42, 0x61, 0x69, 0x6B, 0x61, 0x6C, - -/* Asia/Istanbul */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x90, 0x8B, 0xF5, 0x98, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xBE, 0xD0, 0xA2, 0x65, 0x63, 0xE0, 0xA3, 0x7B, 0x82, 0x50, -0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, 0xA7, 0x27, 0x7F, 0xD0, -0xAA, 0x28, 0x28, 0x60, 0xAA, 0xE1, 0xFD, 0xD0, 0xAB, 0xF9, 0x89, 0xE0, 0xAC, 0xC3, 0x31, 0x50, -0xC8, 0x7F, 0xEE, 0x60, 0xC8, 0xFF, 0xC1, 0xD0, 0xC9, 0x4A, 0xF5, 0x60, 0xCA, 0xCE, 0x80, 0x50, -0xCB, 0xCB, 0xAE, 0x60, 0xCC, 0xE5, 0xC1, 0x50, 0xD1, 0x71, 0xEB, 0xE0, 0xD2, 0x6B, 0x09, 0x50, -0xD3, 0xA2, 0x39, 0x60, 0xD4, 0x43, 0x02, 0x50, 0xD5, 0x4C, 0x0D, 0xE0, 0xD6, 0x29, 0x7B, 0xD0, -0xD7, 0x2B, 0xEF, 0xE0, 0xD8, 0x09, 0x5D, 0xD0, 0xD9, 0x02, 0x97, 0x60, 0xD9, 0xE9, 0x3F, 0xD0, -0xDA, 0xEF, 0xA8, 0x60, 0xDB, 0xD2, 0x5C, 0x50, 0xDC, 0xD4, 0xD0, 0x60, 0xDD, 0xB3, 0x8F, 0xD0, -0xF1, 0xF4, 0xB9, 0x60, 0xF2, 0x64, 0xBA, 0xD0, 0xF5, 0x68, 0x06, 0x60, 0xF6, 0x1F, 0x38, 0xD0, -0x00, 0xA0, 0xBA, 0xE0, 0x01, 0x6B, 0xB3, 0xD0, 0x02, 0x80, 0x9C, 0xE0, 0x03, 0x4B, 0x95, 0xD0, -0x04, 0x69, 0xB9, 0x60, 0x05, 0x34, 0xB2, 0x50, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x39, 0xA8, 0x80, -0x07, 0xFB, 0x75, 0x00, 0x09, 0x19, 0xA6, 0xA0, 0x09, 0xDB, 0x3A, 0xE0, 0x0A, 0xF0, 0x07, 0xD0, -0x0C, 0x10, 0xCE, 0x60, 0x0C, 0xD9, 0x24, 0x50, 0x0D, 0xA4, 0x39, 0x60, 0x0E, 0xA6, 0x91, 0x50, -0x0F, 0x84, 0x1B, 0x60, 0x10, 0x86, 0x73, 0x50, 0x12, 0x67, 0x98, 0xC0, 0x13, 0x4D, 0x36, 0x00, -0x14, 0x47, 0x7A, 0xC0, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x27, 0x5C, 0xC0, 0x17, 0x03, 0xBF, 0x80, -0x18, 0x07, 0x3E, 0xC0, 0x19, 0x89, 0x94, 0x50, 0x19, 0xDC, 0x94, 0xC0, 0x1C, 0xC6, 0xD3, 0xD0, -0x1D, 0x9B, 0x15, 0x50, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, -0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00, -0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0xF5, 0x18, 0x70, -0x28, 0xE5, 0x09, 0x70, 0x29, 0xD4, 0xFA, 0x70, 0x2A, 0xC4, 0xEB, 0x70, 0x2B, 0xB4, 0xDC, 0x70, -0x2C, 0xA4, 0xCD, 0x70, 0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, -0x30, 0x64, 0x91, 0x70, 0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, -0x34, 0x52, 0x79, 0xF0, 0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, -0x38, 0x1B, 0x78, 0x70, 0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, -0x3B, 0xDB, 0x3C, 0x70, 0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, -0x3F, 0x9B, 0x00, 0x70, 0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, -0x43, 0x63, 0xFE, 0xF0, 0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x45, 0x98, 0x32, 0xE0, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x00, 0x00, 0x1B, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x12, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x49, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x54, 0x52, 0x53, 0x54, 0x00, 0x54, 0x52, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Jakarta */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xA9, 0x78, 0x85, 0xE0, -0xBA, 0x16, 0xDE, 0x60, 0xCB, 0xBF, 0x83, 0x88, 0xD2, 0x56, 0xEE, 0x70, 0xD7, 0x3C, 0xC6, 0x08, -0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x01, 0x02, 0x03, 0x02, 0x04, 0x02, 0x05, 0x00, -0x00, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00, -0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x00, 0x00, 0x62, -0x70, 0x00, 0x09, 0x4A, 0x4D, 0x54, 0x00, 0x4A, 0x41, 0x56, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00, -0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x80, 0x6D, 0x9A, 0x01, 0xB5, 0x9F, 0x40, 0x00, 0x00, 0x00, 0x0E, 0x4A, 0x61, 0x76, 0x61, -0x20, 0x26, 0x20, 0x53, 0x75, 0x6D, 0x61, 0x74, 0x72, 0x61, - -/* Asia/Jayapura */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xBA, 0x16, 0xC1, 0x98, -0xD0, 0x58, 0xB9, 0xF0, 0xF4, 0xB5, 0xA2, 0x68, 0x01, 0x02, 0x01, 0x00, 0x00, 0x83, 0xE8, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x49, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x87, 0x17, 0x55, 0x01, 0xE9, 0x59, 0x70, 0x00, 0x00, 0x00, 0x19, 0x49, 0x72, 0x69, 0x61, 0x6E, -0x20, 0x4A, 0x61, 0x79, 0x61, 0x20, 0x26, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4D, 0x6F, 0x6C, 0x75, -0x63, 0x63, 0x61, 0x73, - -/* Asia/Jerusalem */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x9E, 0x30, 0x45, 0x88, -0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, -0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, -0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xD7, 0x5A, 0x14, 0x60, 0xD7, 0xDF, 0x1F, 0xC0, -0xD8, 0x2F, 0xB5, 0x70, 0xD9, 0x1E, 0x46, 0xE0, 0xDA, 0x10, 0xE8, 0xF0, 0xDA, 0xEB, 0xB3, 0xE0, -0xDB, 0xB4, 0x34, 0x00, 0xDC, 0xB9, 0x20, 0xE0, 0xDD, 0xE0, 0x8D, 0x00, 0xDE, 0xB4, 0xCE, 0x80, -0xDF, 0xA4, 0xBF, 0x80, 0xE0, 0x8B, 0x76, 0x00, 0xE1, 0x56, 0x7D, 0x00, 0xE2, 0xBE, 0x4A, 0x60, -0xE3, 0x36, 0x34, 0xD0, 0xE4, 0x9C, 0xF7, 0x00, 0xE5, 0x16, 0x16, 0xD0, 0xE6, 0x74, 0xD3, 0xE0, -0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0, -0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0, -0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60, -0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60, -0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0, -0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0, -0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0, -0x30, 0x48, 0xC5, 0xD0, 0x31, 0x48, 0x96, 0xE0, 0x32, 0x3C, 0x6E, 0x50, 0x33, 0x31, 0xB3, 0x60, -0x34, 0x1A, 0xFE, 0xD0, 0x35, 0x11, 0x95, 0x60, 0x35, 0xF1, 0xA6, 0x50, 0x37, 0x04, 0x08, 0x80, -0x37, 0xCF, 0x01, 0x70, 0x38, 0xF6, 0x5F, 0x80, 0x39, 0xDC, 0xF9, 0xE0, 0x3A, 0xD0, 0xED, 0x70, -0x3B, 0xAE, 0x5B, 0x60, 0x3C, 0xA3, 0xA0, 0x70, 0x3D, 0xA0, 0xB2, 0x60, 0x3E, 0x83, 0x82, 0x70, -0x3F, 0x7C, 0x9F, 0xE0, 0x40, 0x73, 0x36, 0x70, 0x41, 0x50, 0xA4, 0x60, 0x42, 0x4C, 0x8F, 0x00, -0x43, 0x48, 0x4F, 0x70, 0x44, 0x2C, 0x71, 0x00, 0x45, 0x1E, 0xF6, 0xF0, 0x46, 0x0C, 0x53, 0x00, -0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, -0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, -0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00, -0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80, -0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00, -0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44, -0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xB9, 0xCD, 0x1A, 0x01, 0x48, 0x6B, 0x85, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Kabul */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0xD0, 0xF9, 0xD7, 0x40, -0x01, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x48, 0x00, 0x00, 0x41, 0x46, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBD, 0xFF, 0x52, 0x01, 0x7C, 0x3F, 0xC0, 0x00, 0x00, 0x00, -0x00, - -/* Asia/Kamchatka */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA7, 0x52, 0x96, 0xC4, -0xB5, 0xA3, 0x9A, 0xD0, 0x15, 0x27, 0x29, 0x40, 0x16, 0x18, 0x5D, 0xB0, 0x17, 0x08, 0x5C, 0xC0, -0x17, 0xF9, 0x91, 0x30, 0x18, 0xE9, 0x90, 0x40, 0x19, 0xDA, 0xC4, 0xB0, 0x1A, 0xCC, 0x15, 0x40, -0x1B, 0xBC, 0x22, 0x60, 0x1C, 0xAC, 0x13, 0x60, 0x1D, 0x9C, 0x04, 0x60, 0x1E, 0x8B, 0xF5, 0x60, -0x1F, 0x7B, 0xE6, 0x60, 0x20, 0x6B, 0xD7, 0x60, 0x21, 0x5B, 0xC8, 0x60, 0x22, 0x4B, 0xB9, 0x60, -0x23, 0x3B, 0xAA, 0x60, 0x24, 0x2B, 0x9B, 0x60, 0x25, 0x1B, 0x8C, 0x60, 0x26, 0x0B, 0x7D, 0x60, -0x27, 0x04, 0xA8, 0xE0, 0x27, 0xF4, 0x99, 0xE0, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0x78, 0x40, 0xF0, -0x29, 0xD4, 0x51, 0xB0, 0x2A, 0xC4, 0x34, 0xA0, 0x2B, 0xB4, 0x5D, 0xE0, 0x2C, 0xA4, 0x4E, 0xE0, -0x2D, 0x94, 0x3F, 0xE0, 0x2E, 0x84, 0x30, 0xE0, 0x2F, 0x74, 0x21, 0xE0, 0x30, 0x64, 0x12, 0xE0, -0x31, 0x5D, 0x3E, 0x60, 0x32, 0x72, 0x19, 0x60, 0x33, 0x3D, 0x20, 0x60, 0x34, 0x51, 0xFB, 0x60, -0x35, 0x1D, 0x02, 0x60, 0x36, 0x31, 0xDD, 0x60, 0x36, 0xFC, 0xE4, 0x60, 0x38, 0x1A, 0xF9, 0xE0, -0x38, 0xDC, 0xC6, 0x60, 0x39, 0xFA, 0xDB, 0xE0, 0x3A, 0xBC, 0xA8, 0x60, 0x3B, 0xDA, 0xBD, 0xE0, -0x3C, 0xA5, 0xC4, 0xE0, 0x3D, 0xBA, 0x9F, 0xE0, 0x3E, 0x85, 0xA6, 0xE0, 0x3F, 0x9A, 0x81, 0xE0, -0x40, 0x65, 0x88, 0xE0, 0x41, 0x83, 0x9E, 0x60, 0x42, 0x45, 0x6A, 0xE0, 0x43, 0x63, 0x80, 0x60, -0x44, 0x25, 0x4C, 0xE0, 0x45, 0x43, 0x62, 0x60, 0x46, 0x05, 0x2E, 0xE0, 0x47, 0x23, 0x44, 0x60, -0x47, 0xEE, 0x4B, 0x60, 0x49, 0x03, 0x26, 0x60, 0x49, 0xCE, 0x2D, 0x60, 0x4A, 0xE3, 0x08, 0x60, -0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xCC, 0x24, 0xE0, 0x4D, 0x8D, 0xF1, 0x60, 0x4E, 0xAC, 0x06, 0xE0, -0x4F, 0x6D, 0xD3, 0x60, 0x50, 0x8B, 0xE8, 0xE0, 0x51, 0x56, 0xEF, 0xE0, 0x52, 0x6B, 0xCA, 0xE0, -0x53, 0x36, 0xD1, 0xE0, 0x54, 0x4B, 0xAC, 0xE0, 0x55, 0x16, 0xB3, 0xE0, 0x56, 0x2B, 0x8E, 0xE0, -0x56, 0xF6, 0x95, 0xE0, 0x58, 0x14, 0xAB, 0x60, 0x58, 0xD6, 0x77, 0xE0, 0x59, 0xF4, 0x8D, 0x60, -0x5A, 0xB6, 0x59, 0xE0, 0x5B, 0xD4, 0x6F, 0x60, 0x5C, 0x9F, 0x76, 0x60, 0x5D, 0xB4, 0x51, 0x60, -0x5E, 0x7F, 0x58, 0x60, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x5F, 0x3A, 0x60, 0x61, 0x7D, 0x4F, 0xE0, -0x62, 0x3F, 0x1C, 0x60, 0x63, 0x5D, 0x31, 0xE0, 0x64, 0x1E, 0xFE, 0x60, 0x65, 0x3D, 0x13, 0xE0, -0x66, 0x08, 0x1A, 0xE0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0xE7, 0xFC, 0xE0, 0x68, 0xFC, 0xD7, 0xE0, -0x69, 0xC7, 0xDE, 0xE0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0xA7, 0xC0, 0xE0, 0x6C, 0xC5, 0xD6, 0x60, -0x6D, 0x87, 0xA2, 0xE0, 0x6E, 0xA5, 0xB8, 0x60, 0x6F, 0x67, 0x84, 0xE0, 0x70, 0x85, 0x9A, 0x60, -0x71, 0x50, 0xA1, 0x60, 0x72, 0x65, 0x7C, 0x60, 0x73, 0x30, 0x83, 0x60, 0x74, 0x45, 0x5E, 0x60, -0x75, 0x10, 0x65, 0x60, 0x76, 0x2E, 0x7A, 0xE0, 0x76, 0xF0, 0x47, 0x60, 0x78, 0x0E, 0x5C, 0xE0, -0x78, 0xD0, 0x29, 0x60, 0x79, 0xEE, 0x3E, 0xE0, 0x7A, 0xB0, 0x0B, 0x60, 0x7B, 0xCE, 0x20, 0xE0, -0x7C, 0x99, 0x27, 0xE0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x79, 0x09, 0xE0, 0x7F, 0x8D, 0xE4, 0xE0, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x94, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, -0x04, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x09, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x04, 0x00, 0x00, 0xA8, -0xC0, 0x00, 0x04, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x09, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, -0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x45, 0x54, 0x54, 0x00, 0x50, 0x45, -0x54, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xDA, 0x39, 0xE2, 0x02, 0x04, 0xBD, 0x28, 0x00, 0x00, 0x00, 0x15, -0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x39, 0x20, 0x2D, 0x20, 0x4B, 0x61, 0x6D, 0x63, -0x68, 0x61, 0x74, 0x6B, 0x61, - -/* Asia/Karachi */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x89, 0x7E, 0xFC, 0xA4, -0xCC, 0x95, 0x32, 0xA8, 0xD2, 0x74, 0x12, 0x98, 0xDD, 0xA8, 0xE0, 0xA8, 0x02, 0x4F, 0xAB, 0x30, -0x3C, 0xAF, 0x45, 0xEC, 0x3D, 0x9F, 0x28, 0xDC, 0x48, 0x41, 0xA0, 0x30, 0x49, 0x0B, 0x47, 0xA0, -0x01, 0x02, 0x01, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x3E, 0xDC, 0x00, 0x00, 0x00, -0x00, 0x4D, 0x58, 0x00, 0x04, 0x00, 0x00, 0x5B, 0x68, 0x01, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, -0x08, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0D, 0x00, 0x00, 0x46, 0x50, 0x00, 0x12, 0x4C, 0x4D, 0x54, -0x00, 0x49, 0x53, 0x54, 0x00, 0x4B, 0x41, 0x52, 0x54, 0x00, 0x50, 0x4B, 0x53, 0x54, 0x00, 0x50, -0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xAF, 0x45, 0xCA, 0x01, 0x78, 0xF7, 0xE8, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Kashgar */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xC5, 0x44, -0xC7, 0x91, 0x1D, 0xA8, 0x13, 0x6D, 0xE5, 0x30, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, -0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, -0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, -0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x47, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x4D, -0x58, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, -0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x41, 0x53, 0x54, 0x00, 0x43, 0x44, -0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xC5, 0x93, 0x6D, 0x01, 0x86, 0x99, 0x7D, 0x00, 0x00, 0x00, 0x15, 0x77, 0x65, 0x73, 0x74, -0x20, 0x54, 0x69, 0x62, 0x65, 0x74, 0x20, 0x26, 0x20, 0x58, 0x69, 0x6E, 0x6A, 0x69, 0x61, 0x6E, -0x67, - -/* Asia/Katmandu */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA1, 0xF2, 0x7D, 0x84, -0x1E, 0x18, 0x30, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x4F, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58, -0x00, 0x04, 0x00, 0x00, 0x50, 0xDC, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x4E, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB3, 0x9F, 0x12, 0x01, 0x94, -0xD7, 0x52, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Kolkata */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xCA, 0xDB, 0x86, 0xB0, -0xCC, 0x05, 0x71, 0x18, 0xCC, 0x95, 0x32, 0xA8, 0xD2, 0x74, 0x12, 0x98, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x52, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x04, 0x00, 0x00, 0x4D, 0x58, -0x00, 0x09, 0x00, 0x00, 0x5B, 0x68, 0x01, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, -0x00, 0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAB, 0xB6, -0x55, 0x01, 0x99, 0x7E, 0xBA, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Krasnoyarsk */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xF9, 0x0D, 0xF8, -0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10, -0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90, -0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0, -0x1F, 0x7C, 0x2C, 0xB0, 0x20, 0x6C, 0x1D, 0xB0, 0x21, 0x5C, 0x0E, 0xB0, 0x22, 0x4B, 0xFF, 0xB0, -0x23, 0x3B, 0xF0, 0xB0, 0x24, 0x2B, 0xE1, 0xB0, 0x25, 0x1B, 0xD2, 0xB0, 0x26, 0x0B, 0xC3, 0xB0, -0x27, 0x04, 0xEF, 0x30, 0x27, 0xF4, 0xE0, 0x30, 0x28, 0xE4, 0xDF, 0x40, 0x29, 0x78, 0x87, 0x40, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0xA4, 0x30, 0x2C, 0xA4, 0x95, 0x30, -0x2D, 0x94, 0x86, 0x30, 0x2E, 0x84, 0x77, 0x30, 0x2F, 0x74, 0x68, 0x30, 0x30, 0x64, 0x59, 0x30, -0x31, 0x5D, 0x84, 0xB0, 0x32, 0x72, 0x5F, 0xB0, 0x33, 0x3D, 0x66, 0xB0, 0x34, 0x52, 0x41, 0xB0, -0x35, 0x1D, 0x48, 0xB0, 0x36, 0x32, 0x23, 0xB0, 0x36, 0xFD, 0x2A, 0xB0, 0x38, 0x1B, 0x40, 0x30, -0x38, 0xDD, 0x0C, 0xB0, 0x39, 0xFB, 0x22, 0x30, 0x3A, 0xBC, 0xEE, 0xB0, 0x3B, 0xDB, 0x04, 0x30, -0x3C, 0xA6, 0x0B, 0x30, 0x3D, 0xBA, 0xE6, 0x30, 0x3E, 0x85, 0xED, 0x30, 0x3F, 0x9A, 0xC8, 0x30, -0x40, 0x65, 0xCF, 0x30, 0x41, 0x83, 0xE4, 0xB0, 0x42, 0x45, 0xB1, 0x30, 0x43, 0x63, 0xC6, 0xB0, -0x44, 0x25, 0x93, 0x30, 0x45, 0x43, 0xA8, 0xB0, 0x46, 0x05, 0x75, 0x30, 0x47, 0x23, 0x8A, 0xB0, -0x47, 0xEE, 0x91, 0xB0, 0x49, 0x03, 0x6C, 0xB0, 0x49, 0xCE, 0x73, 0xB0, 0x4A, 0xE3, 0x4E, 0xB0, -0x4B, 0xAE, 0x55, 0xB0, 0x4C, 0xCC, 0x6B, 0x30, 0x4D, 0x8E, 0x37, 0xB0, 0x4E, 0xAC, 0x4D, 0x30, -0x4F, 0x6E, 0x19, 0xB0, 0x50, 0x8C, 0x2F, 0x30, 0x51, 0x57, 0x36, 0x30, 0x52, 0x6C, 0x11, 0x30, -0x53, 0x37, 0x18, 0x30, 0x54, 0x4B, 0xF3, 0x30, 0x55, 0x16, 0xFA, 0x30, 0x56, 0x2B, 0xD5, 0x30, -0x56, 0xF6, 0xDC, 0x30, 0x58, 0x14, 0xF1, 0xB0, 0x58, 0xD6, 0xBE, 0x30, 0x59, 0xF4, 0xD3, 0xB0, -0x5A, 0xB6, 0xA0, 0x30, 0x5B, 0xD4, 0xB5, 0xB0, 0x5C, 0x9F, 0xBC, 0xB0, 0x5D, 0xB4, 0x97, 0xB0, -0x5E, 0x7F, 0x9E, 0xB0, 0x5F, 0x94, 0x79, 0xB0, 0x60, 0x5F, 0x80, 0xB0, 0x61, 0x7D, 0x96, 0x30, -0x62, 0x3F, 0x62, 0xB0, 0x63, 0x5D, 0x78, 0x30, 0x64, 0x1F, 0x44, 0xB0, 0x65, 0x3D, 0x5A, 0x30, -0x66, 0x08, 0x61, 0x30, 0x67, 0x1D, 0x3C, 0x30, 0x67, 0xE8, 0x43, 0x30, 0x68, 0xFD, 0x1E, 0x30, -0x69, 0xC8, 0x25, 0x30, 0x6A, 0xDD, 0x00, 0x30, 0x6B, 0xA8, 0x07, 0x30, 0x6C, 0xC6, 0x1C, 0xB0, -0x6D, 0x87, 0xE9, 0x30, 0x6E, 0xA5, 0xFE, 0xB0, 0x6F, 0x67, 0xCB, 0x30, 0x70, 0x85, 0xE0, 0xB0, -0x71, 0x50, 0xE7, 0xB0, 0x72, 0x65, 0xC2, 0xB0, 0x73, 0x30, 0xC9, 0xB0, 0x74, 0x45, 0xA4, 0xB0, -0x75, 0x10, 0xAB, 0xB0, 0x76, 0x2E, 0xC1, 0x30, 0x76, 0xF0, 0x8D, 0xB0, 0x78, 0x0E, 0xA3, 0x30, -0x78, 0xD0, 0x6F, 0xB0, 0x79, 0xEE, 0x85, 0x30, 0x7A, 0xB0, 0x51, 0xB0, 0x7B, 0xCE, 0x67, 0x30, -0x7C, 0x99, 0x6E, 0x30, 0x7D, 0xAE, 0x49, 0x30, 0x7E, 0x79, 0x50, 0x30, 0x7F, 0x8E, 0x2B, 0x30, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x57, 0x08, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, -0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x62, -0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, -0x00, 0x54, 0x60, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xCD, 0xC2, 0x01, 0xA0, 0x4F, 0x85, 0x00, 0x00, 0x00, 0x19, -0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x34, 0x20, 0x2D, 0x20, 0x59, 0x65, 0x6E, 0x69, -0x73, 0x65, 0x69, 0x20, 0x52, 0x69, 0x76, 0x65, 0x72, - -/* Asia/Kuala_Lumpur */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x86, 0x83, 0x85, 0xA3, -0xBA, 0x67, 0x4E, 0x90, 0xC0, 0x0A, 0xE4, 0x60, 0xCA, 0xB3, 0xE5, 0x60, 0xCB, 0x91, 0x5F, 0x08, -0xD2, 0x48, 0x6D, 0xF0, 0x16, 0x91, 0xF5, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x06, 0x00, -0x00, 0x61, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x67, 0x20, 0x01, -0x09, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, 0x00, 0x04, 0x00, 0x00, 0x7E, -0x90, 0x00, 0x0F, 0x00, 0x00, 0x70, 0x80, 0x00, 0x13, 0x53, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x4C, -0x54, 0x00, 0x4D, 0x41, 0x4C, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4D, 0x59, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8E, -0x29, 0x3A, 0x01, 0xAD, 0xD7, 0x10, 0x00, 0x00, 0x00, 0x13, 0x70, 0x65, 0x6E, 0x69, 0x6E, 0x73, -0x75, 0x6C, 0x61, 0x72, 0x20, 0x4D, 0x61, 0x6C, 0x61, 0x79, 0x73, 0x69, 0x61, - -/* Asia/Kuching */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0xAD, 0x8A, 0x06, 0x90, -0xBA, 0x67, 0x47, 0x88, 0xBF, 0x7B, 0x27, 0x80, 0xBF, 0xF3, 0x1B, 0x50, 0xC1, 0x5D, 0xAC, 0x80, -0xC1, 0xD5, 0xA0, 0x50, 0xC3, 0x3E, 0xE0, 0x00, 0xC3, 0xB6, 0xD3, 0xD0, 0xC5, 0x20, 0x13, 0x80, -0xC5, 0x98, 0x07, 0x50, 0xC7, 0x01, 0x47, 0x00, 0xC7, 0x79, 0x3A, 0xD0, 0xC8, 0xE3, 0xCC, 0x00, -0xC9, 0x5B, 0xBF, 0xD0, 0xCA, 0xC4, 0xFF, 0x80, 0xCB, 0x3C, 0xF3, 0x50, 0xCB, 0x91, 0x58, 0x00, -0xD2, 0x48, 0x6D, 0xF0, 0x16, 0x91, 0xEE, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x04, 0x03, 0x05, 0x00, 0x00, 0x67, 0x70, 0x00, -0x00, 0x00, 0x00, 0x69, 0x78, 0x00, 0x04, 0x00, 0x00, 0x75, 0x30, 0x01, 0x09, 0x00, 0x00, 0x70, -0x80, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x10, 0x00, 0x00, 0x70, 0x80, 0x00, 0x14, 0x4C, -0x4D, 0x54, 0x00, 0x42, 0x4F, 0x52, 0x54, 0x00, 0x42, 0x4F, 0x52, 0x54, 0x53, 0x54, 0x00, 0x4A, -0x53, 0x54, 0x00, 0x4D, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x8B, 0xB1, 0xB8, 0x01, 0xBB, 0x03, 0x75, 0x00, 0x00, 0x00, 0x0F, 0x53, -0x61, 0x62, 0x61, 0x68, 0x20, 0x26, 0x20, 0x53, 0x61, 0x72, 0x61, 0x77, 0x61, 0x6B, - -/* Asia/Kuwait */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x35, 0x84, -0x01, 0x00, 0x00, 0x2C, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB6, 0x16, 0x95, 0x01, 0x5B, 0xDF, -0xFD, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Macao */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x92, 0xE6, 0x24, 0x04, -0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, 0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, -0xF3, 0x37, 0x64, 0x80, 0xF4, 0x68, 0x12, 0x28, 0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, -0xF7, 0x00, 0x63, 0x00, 0xF8, 0x27, 0xA4, 0xF0, 0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, -0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, 0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, -0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, 0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, -0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, 0x04, 0x4D, 0xB5, 0x80, 0x05, 0x3D, 0x98, 0x70, -0x06, 0x2D, 0x97, 0x80, 0x07, 0x26, 0xB4, 0xF0, 0x08, 0x16, 0xB4, 0x00, 0x09, 0x06, 0xC8, 0x28, -0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, 0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, -0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, 0x0F, 0x96, 0x3C, 0x00, 0x10, 0x86, 0x1E, 0xF0, -0x11, 0x76, 0x1E, 0x00, 0x12, 0x6F, 0x3B, 0x70, 0x13, 0x5F, 0x3A, 0x80, 0x14, 0x4F, 0x1D, 0x70, -0x38, 0x5D, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, -0x6A, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, -0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4F, 0x53, 0x54, 0x00, 0x4D, -0x4F, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Macau */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x92, 0xE6, 0x24, 0x04, -0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, 0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, -0xF3, 0x37, 0x64, 0x80, 0xF4, 0x68, 0x12, 0x28, 0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, -0xF7, 0x00, 0x63, 0x00, 0xF8, 0x27, 0xA4, 0xF0, 0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, -0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, 0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, -0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, 0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, -0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, 0x04, 0x4D, 0xB5, 0x80, 0x05, 0x3D, 0x98, 0x70, -0x06, 0x2D, 0x97, 0x80, 0x07, 0x26, 0xB4, 0xF0, 0x08, 0x16, 0xB4, 0x00, 0x09, 0x06, 0xC8, 0x28, -0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, 0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, -0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, 0x0F, 0x96, 0x3C, 0x00, 0x10, 0x86, 0x1E, 0xF0, -0x11, 0x76, 0x1E, 0x00, 0x12, 0x6F, 0x3B, 0x70, 0x13, 0x5F, 0x3A, 0x80, 0x14, 0x4F, 0x1D, 0x70, -0x38, 0x5D, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00, -0x6A, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, -0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4F, 0x53, 0x54, 0x00, 0x4D, -0x4F, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xAB, 0x41, 0x25, 0x01, 0xBF, 0xF8, 0xFD, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Magadan */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xAA, 0x19, 0x36, 0xA0, -0xB5, 0xA3, 0xA8, 0xE0, 0x15, 0x27, 0x37, 0x50, 0x16, 0x18, 0x6B, 0xC0, 0x17, 0x08, 0x6A, 0xD0, -0x17, 0xF9, 0x9F, 0x40, 0x18, 0xE9, 0x9E, 0x50, 0x19, 0xDA, 0xD2, 0xC0, 0x1A, 0xCC, 0x23, 0x50, -0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x21, 0x70, 0x1D, 0x9C, 0x12, 0x70, 0x1E, 0x8C, 0x03, 0x70, -0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xE5, 0x70, 0x21, 0x5B, 0xD6, 0x70, 0x22, 0x4B, 0xC7, 0x70, -0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xA9, 0x70, 0x25, 0x1B, 0x9A, 0x70, 0x26, 0x0B, 0x8B, 0x70, -0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xA7, 0xF0, 0x28, 0xE4, 0xA7, 0x00, 0x29, 0x78, 0x4F, 0x00, -0x29, 0xD4, 0x5F, 0xC0, 0x2A, 0xC4, 0x42, 0xB0, 0x2B, 0xB4, 0x6B, 0xF0, 0x2C, 0xA4, 0x5C, 0xF0, -0x2D, 0x94, 0x4D, 0xF0, 0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x2F, 0xF0, 0x30, 0x64, 0x20, 0xF0, -0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x27, 0x70, 0x33, 0x3D, 0x2E, 0x70, 0x34, 0x52, 0x09, 0x70, -0x35, 0x1D, 0x10, 0x70, 0x36, 0x31, 0xEB, 0x70, 0x36, 0xFC, 0xF2, 0x70, 0x38, 0x1B, 0x07, 0xF0, -0x38, 0xDC, 0xD4, 0x70, 0x39, 0xFA, 0xE9, 0xF0, 0x3A, 0xBC, 0xB6, 0x70, 0x3B, 0xDA, 0xCB, 0xF0, -0x3C, 0xA5, 0xD2, 0xF0, 0x3D, 0xBA, 0xAD, 0xF0, 0x3E, 0x85, 0xB4, 0xF0, 0x3F, 0x9A, 0x8F, 0xF0, -0x40, 0x65, 0x96, 0xF0, 0x41, 0x83, 0xAC, 0x70, 0x42, 0x45, 0x78, 0xF0, 0x43, 0x63, 0x8E, 0x70, -0x44, 0x25, 0x5A, 0xF0, 0x45, 0x43, 0x70, 0x70, 0x46, 0x05, 0x3C, 0xF0, 0x47, 0x23, 0x52, 0x70, -0x47, 0xEE, 0x59, 0x70, 0x49, 0x03, 0x34, 0x70, 0x49, 0xCE, 0x3B, 0x70, 0x4A, 0xE3, 0x16, 0x70, -0x4B, 0xAE, 0x1D, 0x70, 0x4C, 0xCC, 0x32, 0xF0, 0x4D, 0x8D, 0xFF, 0x70, 0x4E, 0xAC, 0x14, 0xF0, -0x4F, 0x6D, 0xE1, 0x70, 0x50, 0x8B, 0xF6, 0xF0, 0x51, 0x56, 0xFD, 0xF0, 0x52, 0x6B, 0xD8, 0xF0, -0x53, 0x36, 0xDF, 0xF0, 0x54, 0x4B, 0xBA, 0xF0, 0x55, 0x16, 0xC1, 0xF0, 0x56, 0x2B, 0x9C, 0xF0, -0x56, 0xF6, 0xA3, 0xF0, 0x58, 0x14, 0xB9, 0x70, 0x58, 0xD6, 0x85, 0xF0, 0x59, 0xF4, 0x9B, 0x70, -0x5A, 0xB6, 0x67, 0xF0, 0x5B, 0xD4, 0x7D, 0x70, 0x5C, 0x9F, 0x84, 0x70, 0x5D, 0xB4, 0x5F, 0x70, -0x5E, 0x7F, 0x66, 0x70, 0x5F, 0x94, 0x41, 0x70, 0x60, 0x5F, 0x48, 0x70, 0x61, 0x7D, 0x5D, 0xF0, -0x62, 0x3F, 0x2A, 0x70, 0x63, 0x5D, 0x3F, 0xF0, 0x64, 0x1F, 0x0C, 0x70, 0x65, 0x3D, 0x21, 0xF0, -0x66, 0x08, 0x28, 0xF0, 0x67, 0x1D, 0x03, 0xF0, 0x67, 0xE8, 0x0A, 0xF0, 0x68, 0xFC, 0xE5, 0xF0, -0x69, 0xC7, 0xEC, 0xF0, 0x6A, 0xDC, 0xC7, 0xF0, 0x6B, 0xA7, 0xCE, 0xF0, 0x6C, 0xC5, 0xE4, 0x70, -0x6D, 0x87, 0xB0, 0xF0, 0x6E, 0xA5, 0xC6, 0x70, 0x6F, 0x67, 0x92, 0xF0, 0x70, 0x85, 0xA8, 0x70, -0x71, 0x50, 0xAF, 0x70, 0x72, 0x65, 0x8A, 0x70, 0x73, 0x30, 0x91, 0x70, 0x74, 0x45, 0x6C, 0x70, -0x75, 0x10, 0x73, 0x70, 0x76, 0x2E, 0x88, 0xF0, 0x76, 0xF0, 0x55, 0x70, 0x78, 0x0E, 0x6A, 0xF0, -0x78, 0xD0, 0x37, 0x70, 0x79, 0xEE, 0x4C, 0xF0, 0x7A, 0xB0, 0x19, 0x70, 0x7B, 0xCE, 0x2E, 0xF0, -0x7C, 0x99, 0x35, 0xF0, 0x7D, 0xAE, 0x10, 0xF0, 0x7E, 0x79, 0x17, 0xF0, 0x7F, 0x8D, 0xF2, 0xF0, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x8D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, -0x04, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x00, 0x00, 0x9A, -0xB0, 0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x09, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x47, 0x54, 0x00, 0x4D, 0x41, -0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0x38, 0x7A, 0x01, 0xF8, 0xC2, 0xC0, 0x00, 0x00, 0x00, 0x13, -0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x38, 0x20, 0x2D, 0x20, 0x4D, 0x61, 0x67, 0x61, -0x64, 0x61, 0x6E, - -/* Asia/Makassar */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA1, 0xF2, 0x5D, 0x90, -0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x56, 0xEE, 0x70, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, -0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x81, 0xE0, 0xB2, 0x01, 0xC8, 0xD9, 0x1F, 0x00, 0x00, 0x00, 0x3D, 0x65, 0x61, 0x73, 0x74, -0x20, 0x26, 0x20, 0x73, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x42, 0x6F, 0x72, 0x6E, 0x65, 0x6F, 0x2C, -0x20, 0x43, 0x65, 0x6C, 0x65, 0x62, 0x65, 0x73, 0x2C, 0x20, 0x42, 0x61, 0x6C, 0x69, 0x2C, 0x20, -0x4E, 0x75, 0x73, 0x61, 0x20, 0x54, 0x65, 0x6E, 0x67, 0x61, 0x72, 0x72, 0x61, 0x2C, 0x20, 0x77, -0x65, 0x73, 0x74, 0x20, 0x54, 0x69, 0x6D, 0x6F, 0x72, - -/* Asia/Manila */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xC1, 0x9C, 0xF4, 0x80, -0xC2, 0x16, 0x30, 0x70, 0xCB, 0xF2, 0xE7, 0x00, 0xD0, 0xA9, 0x25, 0x70, 0xE2, 0x6C, 0x39, 0x00, -0xE2, 0xD5, 0xA2, 0xF0, 0x0F, 0x75, 0x46, 0x80, 0x10, 0x66, 0x7A, 0xF0, 0x00, 0x01, 0x02, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x05, -0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, 0x50, 0x48, 0x53, 0x54, 0x00, 0x50, 0x48, 0x54, 0x00, 0x4A, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x94, 0xDD, 0x01, 0xCB, 0x4A, -0x20, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Muscat */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4F, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA1, 0xF2, 0x96, 0x94, -0x01, 0x00, 0x00, 0x36, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAD, 0x57, 0x00, 0x01, 0x6C, 0x0C, -0x9D, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Nicosia */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA5, 0x77, 0x1E, 0xB8, -0x09, 0xED, 0xAF, 0xE0, 0x0A, 0xDD, 0x92, 0xD0, 0x0B, 0xFA, 0x64, 0xE0, 0x0C, 0xBE, 0xC6, 0x50, -0x0D, 0xA4, 0x39, 0x60, 0x0E, 0x8A, 0xE1, 0xD0, 0x0F, 0x84, 0x1B, 0x60, 0x10, 0x75, 0x4F, 0xD0, -0x11, 0x63, 0xFD, 0x60, 0x12, 0x53, 0xE0, 0x50, 0x13, 0x4D, 0x19, 0xE0, 0x14, 0x33, 0xC2, 0x50, -0x15, 0x23, 0xC1, 0x60, 0x16, 0x13, 0xA4, 0x50, 0x17, 0x03, 0xA3, 0x60, 0x17, 0xF3, 0x86, 0x50, -0x18, 0xE3, 0x85, 0x60, 0x19, 0xD3, 0x68, 0x50, 0x1A, 0xC3, 0x67, 0x60, 0x1B, 0xBC, 0x84, 0xD0, -0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x48, 0xD0, -0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x0C, 0xD0, -0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xED, 0xE0, 0x27, 0x05, 0x0B, 0x50, -0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xED, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, -0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, -0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x4D, 0x91, 0xD0, -0x33, 0x3D, 0x90, 0xE0, 0x34, 0x2D, 0x73, 0xD0, 0x35, 0x1D, 0x72, 0xE0, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x1F, 0x48, 0x00, 0x00, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xBE, 0xFD, 0x3A, -0x01, 0x45, 0x92, 0x5A, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Novosibirsk */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xDB, 0x19, 0x24, -0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10, -0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90, -0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0, -0x1F, 0x7C, 0x2C, 0xB0, 0x20, 0x6C, 0x1D, 0xB0, 0x21, 0x5C, 0x0E, 0xB0, 0x22, 0x4B, 0xFF, 0xB0, -0x23, 0x3B, 0xF0, 0xB0, 0x24, 0x2B, 0xE1, 0xB0, 0x25, 0x1B, 0xD2, 0xB0, 0x26, 0x0B, 0xC3, 0xB0, -0x27, 0x04, 0xEF, 0x30, 0x27, 0xF4, 0xE0, 0x30, 0x28, 0xE4, 0xDF, 0x40, 0x29, 0x78, 0x87, 0x40, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0xA4, 0x30, 0x2B, 0xFE, 0x4E, 0x00, -0x2C, 0xA4, 0xA3, 0x40, 0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, -0x30, 0x64, 0x67, 0x40, 0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, 0x33, 0x3D, 0x74, 0xC0, -0x34, 0x52, 0x4F, 0xC0, 0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x38, 0xC0, -0x38, 0x1B, 0x4E, 0x40, 0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBC, 0xFC, 0xC0, -0x3B, 0xDB, 0x12, 0x40, 0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x85, 0xFB, 0x40, -0x3F, 0x9A, 0xD6, 0x40, 0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x45, 0xBF, 0x40, -0x43, 0x63, 0xD4, 0xC0, 0x44, 0x25, 0xA1, 0x40, 0x45, 0x43, 0xB6, 0xC0, 0x46, 0x05, 0x83, 0x40, -0x47, 0x23, 0x98, 0xC0, 0x47, 0xEE, 0x9F, 0xC0, 0x49, 0x03, 0x7A, 0xC0, 0x49, 0xCE, 0x81, 0xC0, -0x4A, 0xE3, 0x5C, 0xC0, 0x4B, 0xAE, 0x63, 0xC0, 0x4C, 0xCC, 0x79, 0x40, 0x4D, 0x8E, 0x45, 0xC0, -0x4E, 0xAC, 0x5B, 0x40, 0x4F, 0x6E, 0x27, 0xC0, 0x50, 0x8C, 0x3D, 0x40, 0x51, 0x57, 0x44, 0x40, -0x52, 0x6C, 0x1F, 0x40, 0x53, 0x37, 0x26, 0x40, 0x54, 0x4C, 0x01, 0x40, 0x55, 0x17, 0x08, 0x40, -0x56, 0x2B, 0xE3, 0x40, 0x56, 0xF6, 0xEA, 0x40, 0x58, 0x14, 0xFF, 0xC0, 0x58, 0xD6, 0xCC, 0x40, -0x59, 0xF4, 0xE1, 0xC0, 0x5A, 0xB6, 0xAE, 0x40, 0x5B, 0xD4, 0xC3, 0xC0, 0x5C, 0x9F, 0xCA, 0xC0, -0x5D, 0xB4, 0xA5, 0xC0, 0x5E, 0x7F, 0xAC, 0xC0, 0x5F, 0x94, 0x87, 0xC0, 0x60, 0x5F, 0x8E, 0xC0, -0x61, 0x7D, 0xA4, 0x40, 0x62, 0x3F, 0x70, 0xC0, 0x63, 0x5D, 0x86, 0x40, 0x64, 0x1F, 0x52, 0xC0, -0x65, 0x3D, 0x68, 0x40, 0x66, 0x08, 0x6F, 0x40, 0x67, 0x1D, 0x4A, 0x40, 0x67, 0xE8, 0x51, 0x40, -0x68, 0xFD, 0x2C, 0x40, 0x69, 0xC8, 0x33, 0x40, 0x6A, 0xDD, 0x0E, 0x40, 0x6B, 0xA8, 0x15, 0x40, -0x6C, 0xC6, 0x2A, 0xC0, 0x6D, 0x87, 0xF7, 0x40, 0x6E, 0xA6, 0x0C, 0xC0, 0x6F, 0x67, 0xD9, 0x40, -0x70, 0x85, 0xEE, 0xC0, 0x71, 0x50, 0xF5, 0xC0, 0x72, 0x65, 0xD0, 0xC0, 0x73, 0x30, 0xD7, 0xC0, -0x74, 0x45, 0xB2, 0xC0, 0x75, 0x10, 0xB9, 0xC0, 0x76, 0x2E, 0xCF, 0x40, 0x76, 0xF0, 0x9B, 0xC0, -0x78, 0x0E, 0xB1, 0x40, 0x78, 0xD0, 0x7D, 0xC0, 0x79, 0xEE, 0x93, 0x40, 0x7A, 0xB0, 0x5F, 0xC0, -0x7B, 0xCE, 0x75, 0x40, 0x7C, 0x99, 0x7C, 0x40, 0x7D, 0xAE, 0x57, 0x40, 0x7E, 0x79, 0x5E, 0x40, -0x7F, 0x8E, 0x39, 0x40, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, -0x08, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x4D, 0xBC, 0x00, 0x00, -0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, -0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, -0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, -0x4C, 0x4D, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xDD, 0x4D, 0xA5, 0x01, 0x91, 0x2D, 0xD2, 0x00, 0x00, 0x00, 0x17, 0x4D, 0x6F, 0x73, -0x63, 0x6F, 0x77, 0x2B, 0x30, 0x33, 0x20, 0x2D, 0x20, 0x4E, 0x6F, 0x76, 0x6F, 0x73, 0x69, 0x62, -0x69, 0x72, 0x73, 0x6B, - -/* Asia/Omsk */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xB3, 0x40, 0xB0, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xE4, 0xED, 0x50, 0x29, 0x78, 0x95, 0x50, -0x29, 0xD4, 0xA6, 0x10, 0x2A, 0xC4, 0x89, 0x00, 0x2B, 0xB4, 0xB2, 0x40, 0x2C, 0xA4, 0xA3, 0x40, -0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, 0x30, 0x64, 0x67, 0x40, -0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, 0x33, 0x3D, 0x74, 0xC0, 0x34, 0x52, 0x4F, 0xC0, -0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x4E, 0x40, -0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x12, 0x40, -0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xD6, 0x40, -0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x45, 0xBF, 0x40, 0x43, 0x63, 0xD4, 0xC0, -0x44, 0x25, 0xA1, 0x40, 0x45, 0x43, 0xB6, 0xC0, 0x46, 0x05, 0x83, 0x40, 0x47, 0x23, 0x98, 0xC0, -0x47, 0xEE, 0x9F, 0xC0, 0x49, 0x03, 0x7A, 0xC0, 0x49, 0xCE, 0x81, 0xC0, 0x4A, 0xE3, 0x5C, 0xC0, -0x4B, 0xAE, 0x63, 0xC0, 0x4C, 0xCC, 0x79, 0x40, 0x4D, 0x8E, 0x45, 0xC0, 0x4E, 0xAC, 0x5B, 0x40, -0x4F, 0x6E, 0x27, 0xC0, 0x50, 0x8C, 0x3D, 0x40, 0x51, 0x57, 0x44, 0x40, 0x52, 0x6C, 0x1F, 0x40, -0x53, 0x37, 0x26, 0x40, 0x54, 0x4C, 0x01, 0x40, 0x55, 0x17, 0x08, 0x40, 0x56, 0x2B, 0xE3, 0x40, -0x56, 0xF6, 0xEA, 0x40, 0x58, 0x14, 0xFF, 0xC0, 0x58, 0xD6, 0xCC, 0x40, 0x59, 0xF4, 0xE1, 0xC0, -0x5A, 0xB6, 0xAE, 0x40, 0x5B, 0xD4, 0xC3, 0xC0, 0x5C, 0x9F, 0xCA, 0xC0, 0x5D, 0xB4, 0xA5, 0xC0, -0x5E, 0x7F, 0xAC, 0xC0, 0x5F, 0x94, 0x87, 0xC0, 0x60, 0x5F, 0x8E, 0xC0, 0x61, 0x7D, 0xA4, 0x40, -0x62, 0x3F, 0x70, 0xC0, 0x63, 0x5D, 0x86, 0x40, 0x64, 0x1F, 0x52, 0xC0, 0x65, 0x3D, 0x68, 0x40, -0x66, 0x08, 0x6F, 0x40, 0x67, 0x1D, 0x4A, 0x40, 0x67, 0xE8, 0x51, 0x40, 0x68, 0xFD, 0x2C, 0x40, -0x69, 0xC8, 0x33, 0x40, 0x6A, 0xDD, 0x0E, 0x40, 0x6B, 0xA8, 0x15, 0x40, 0x6C, 0xC6, 0x2A, 0xC0, -0x6D, 0x87, 0xF7, 0x40, 0x6E, 0xA6, 0x0C, 0xC0, 0x6F, 0x67, 0xD9, 0x40, 0x70, 0x85, 0xEE, 0xC0, -0x71, 0x50, 0xF5, 0xC0, 0x72, 0x65, 0xD0, 0xC0, 0x73, 0x30, 0xD7, 0xC0, 0x74, 0x45, 0xB2, 0xC0, -0x75, 0x10, 0xB9, 0xC0, 0x76, 0x2E, 0xCF, 0x40, 0x76, 0xF0, 0x9B, 0xC0, 0x78, 0x0E, 0xB1, 0x40, -0x78, 0xD0, 0x7D, 0xC0, 0x79, 0xEE, 0x93, 0x40, 0x7A, 0xB0, 0x5F, 0xC0, 0x7B, 0xCE, 0x75, 0x40, -0x7C, 0x99, 0x7C, 0x40, 0x7D, 0xAE, 0x57, 0x40, 0x7E, 0x79, 0x5E, 0x40, 0x7F, 0x8E, 0x39, 0x40, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x44, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, -0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, -0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, -0x00, 0x46, 0x50, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4F, 0x4D, 0x53, 0x54, 0x00, 0x4F, 0x4D, -0x53, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xDD, 0x40, 0xA0, 0x01, 0x82, 0xA8, 0x60, 0x00, 0x00, 0x00, 0x18, -0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x33, 0x20, 0x2D, 0x20, 0x77, 0x65, 0x73, 0x74, -0x20, 0x53, 0x69, 0x62, 0x65, 0x72, 0x69, 0x61, - -/* Asia/Oral */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x19, 0x93, 0xDC, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0, -0x27, 0x05, 0x19, 0x60, 0x27, 0x7F, 0x98, 0xC0, 0x29, 0x4B, 0xB4, 0x40, 0x29, 0xD4, 0xC2, 0x30, -0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xBF, 0x60, 0x2D, 0x94, 0xB0, 0x60, -0x2E, 0x84, 0xA1, 0x60, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x83, 0x60, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x72, 0x89, 0xE0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0, -0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0, -0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60, -0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60, -0x41, 0x84, 0x0E, 0xE0, 0x42, 0x35, 0xED, 0x40, 0x01, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02, -0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x01, 0x0A, -0x09, 0x0A, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, -0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0D, 0x00, 0x00, 0x30, 0x24, 0x00, -0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, -0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, -0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, -0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x00, 0x00, 0x46, -0x50, 0x01, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x15, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x4C, -0x4D, 0x54, 0x00, 0x55, 0x52, 0x41, 0x54, 0x00, 0x55, 0x52, 0x41, 0x53, 0x54, 0x00, 0x4F, 0x52, -0x41, 0x53, 0x54, 0x00, 0x4F, 0x52, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD7, 0x7A, 0xC2, 0x01, 0x61, 0x03, 0x18, 0x00, 0x00, 0x00, -0x0F, 0x57, 0x65, 0x73, 0x74, 0x20, 0x4B, 0x61, 0x7A, 0x61, 0x6B, 0x68, 0x73, 0x74, 0x61, 0x6E, - - -/* Asia/Phnom_Penh */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x44, 0x24, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x62, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xF3, 0xF8, -0x01, 0xB2, 0xBF, 0x92, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Pontianak */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x8B, 0xFF, 0x8E, 0x00, -0xBA, 0x16, 0xDF, 0x00, 0xCB, 0x79, 0xA4, 0x08, 0xD2, 0x56, 0xEE, 0x70, 0xD7, 0x3C, 0xC6, 0x08, -0xDA, 0xFF, 0x26, 0x00, 0xF4, 0xB5, 0xBE, 0x88, 0x21, 0xDA, 0x74, 0x80, 0x01, 0x02, 0x03, 0x02, -0x04, 0x02, 0x05, 0x06, 0x00, 0x00, 0x66, 0x80, 0x00, 0x00, 0x00, 0x00, 0x66, 0x80, 0x00, 0x04, -0x00, 0x00, 0x69, 0x78, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x10, 0x00, 0x00, 0x62, 0x70, 0x00, 0x08, 0x4C, 0x4D, -0x54, 0x00, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x43, 0x49, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x89, 0x61, 0x45, 0x01, 0xB9, 0x7C, 0xD5, 0x00, 0x00, 0x00, 0x15, 0x77, 0x65, 0x73, 0x74, -0x20, 0x26, 0x20, 0x63, 0x65, 0x6E, 0x74, 0x72, 0x61, 0x6C, 0x20, 0x42, 0x6F, 0x72, 0x6E, 0x65, -0x6F, - -/* Asia/Pyongyang */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xE2, 0x4F, 0x29, 0xF0, 0xF0, 0x35, 0x78, 0x80, -0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, -0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xC4, 0xDD, 0x22, 0x01, 0xD2, 0x89, 0x98, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Qatar */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x51, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xA1, 0xF2, 0x9D, 0x30, -0x04, 0x8A, 0x92, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x30, 0x50, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, -0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x47, 0x53, 0x54, 0x00, -0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAF, 0xE8, 0x8D, 0x01, 0x61, -0x4A, 0xB5, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Qyzylorda */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x19, 0x86, 0xA0, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0x7F, 0x8A, 0xB0, 0x29, 0x4B, 0xA6, 0x30, 0x29, 0x78, 0x95, 0x50, -0x29, 0xD4, 0xA6, 0x10, 0x2A, 0xC4, 0x89, 0x00, 0x2B, 0xB4, 0xB2, 0x40, 0x2C, 0xA4, 0xA3, 0x40, -0x2D, 0x94, 0x94, 0x40, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, 0x30, 0x64, 0x67, 0x40, -0x31, 0x5D, 0x92, 0xC0, 0x32, 0x72, 0x6D, 0xC0, 0x33, 0x3D, 0x74, 0xC0, 0x34, 0x52, 0x4F, 0xC0, -0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x31, 0xC0, 0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x4E, 0x40, -0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x30, 0x40, 0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x12, 0x40, -0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xF4, 0x40, 0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xD6, 0x40, -0x40, 0x65, 0xDD, 0x40, 0x41, 0x83, 0xF2, 0xC0, 0x42, 0x35, 0xD1, 0x20, 0x01, 0x02, 0x03, 0x04, -0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x02, 0x07, 0x09, 0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x09, -0x00, 0x00, 0x3D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, -0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, -0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, -0x00, 0x00, 0x62, 0x70, 0x01, 0x14, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0F, 0x00, 0x00, 0x62, 0x70, -0x01, 0x14, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x49, 0x5A, 0x54, -0x00, 0x4B, 0x49, 0x5A, 0x53, 0x54, 0x00, 0x51, 0x59, 0x5A, 0x54, 0x00, 0x51, 0x59, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0xB0, 0x40, 0x01, 0x76, -0x8D, 0x6A, 0x00, 0x00, 0x00, 0x20, 0x51, 0x79, 0x7A, 0x79, 0x6C, 0x6F, 0x72, 0x64, 0x61, 0x20, -0x28, 0x4B, 0x79, 0x7A, 0x79, 0x6C, 0x6F, 0x72, 0x64, 0x61, 0x2C, 0x20, 0x4B, 0x7A, 0x79, 0x6C, -0x2D, 0x4F, 0x72, 0x64, 0x61, 0x29, - -/* Asia/Rangoon */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0x73, 0x5C, -0xCB, 0xF2, 0xFC, 0x18, 0xD1, 0x9A, 0x67, 0xF0, 0x01, 0x02, 0x03, 0x00, 0x00, 0x5A, 0x24, 0x00, -0x00, 0x00, 0x00, 0x5B, 0x68, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x5B, -0x68, 0x00, 0x0D, 0x52, 0x4D, 0x54, 0x00, 0x42, 0x55, 0x52, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, -0x4D, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0xF0, 0x3D, -0x01, 0xA5, 0x65, 0x9A, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Riyadh */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x36, 0xB4, -0x01, 0x00, 0x00, 0x2B, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAE, 0xEA, 0xA5, 0x01, 0x59, 0xF1, -0x32, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Saigon */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, -0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Sakhalin */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x17, 0x86, 0xF0, 0xCD, 0xB8, -0xC3, 0xCE, 0x85, 0x70, 0xD2, 0x30, 0xB2, 0xF0, 0x15, 0x27, 0x37, 0x50, 0x16, 0x18, 0x6B, 0xC0, -0x17, 0x08, 0x6A, 0xD0, 0x17, 0xF9, 0x9F, 0x40, 0x18, 0xE9, 0x9E, 0x50, 0x19, 0xDA, 0xD2, 0xC0, -0x1A, 0xCC, 0x23, 0x50, 0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x21, 0x70, 0x1D, 0x9C, 0x12, 0x70, -0x1E, 0x8C, 0x03, 0x70, 0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xE5, 0x70, 0x21, 0x5B, 0xD6, 0x70, -0x22, 0x4B, 0xC7, 0x70, 0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xA9, 0x70, 0x25, 0x1B, 0x9A, 0x70, -0x26, 0x0B, 0x8B, 0x70, 0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xA7, 0xF0, 0x28, 0xE4, 0xA7, 0x00, -0x29, 0x78, 0x4F, 0x00, 0x29, 0xD4, 0x5F, 0xC0, 0x2A, 0xC4, 0x42, 0xB0, 0x2B, 0xB4, 0x6B, 0xF0, -0x2C, 0xA4, 0x5C, 0xF0, 0x2D, 0x94, 0x4D, 0xF0, 0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x2F, 0xF0, -0x30, 0x64, 0x20, 0xF0, 0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x27, 0x70, 0x33, 0x3D, 0x2E, 0x70, -0x34, 0x52, 0x17, 0x80, 0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, -0x38, 0x1B, 0x16, 0x00, 0x38, 0xDC, 0xE2, 0x80, 0x39, 0xFA, 0xF8, 0x00, 0x3A, 0xBC, 0xC4, 0x80, -0x3B, 0xDA, 0xDA, 0x00, 0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, -0x3F, 0x9A, 0x9E, 0x00, 0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, -0x43, 0x63, 0x9C, 0x80, 0x44, 0x25, 0x69, 0x00, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, -0x47, 0x23, 0x60, 0x80, 0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, -0x4A, 0xE3, 0x24, 0x80, 0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, -0x4E, 0xAC, 0x23, 0x00, 0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, -0x52, 0x6B, 0xE7, 0x00, 0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, -0x56, 0x2B, 0xAB, 0x00, 0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, -0x59, 0xF4, 0xA9, 0x80, 0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, -0x5D, 0xB4, 0x6D, 0x80, 0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, -0x61, 0x7D, 0x6C, 0x00, 0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, -0x65, 0x3D, 0x30, 0x00, 0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, -0x68, 0xFC, 0xF4, 0x00, 0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, -0x6C, 0xC5, 0xF2, 0x80, 0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, -0x70, 0x85, 0xB6, 0x80, 0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, -0x74, 0x45, 0x7A, 0x80, 0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, -0x78, 0x0E, 0x79, 0x00, 0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, -0x7B, 0xCE, 0x3D, 0x00, 0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, -0x7F, 0x8E, 0x01, 0x00, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x05, 0x03, 0x04, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x00, 0x00, 0x85, 0xC8, 0x00, 0x00, -0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0xA8, 0xC0, -0x01, 0x0C, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x12, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x12, 0x00, 0x00, -0xA8, 0xC0, 0x01, 0x0C, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x0C, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x12, -0x4C, 0x4D, 0x54, 0x00, 0x43, 0x4A, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x53, 0x41, 0x4B, 0x53, -0x54, 0x00, 0x53, 0x41, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xFE, 0x9A, 0x01, 0xEC, 0x66, -0xB0, 0x00, 0x00, 0x00, 0x1B, 0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x37, 0x20, 0x2D, -0x20, 0x53, 0x61, 0x6B, 0x68, 0x61, 0x6C, 0x69, 0x6E, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, - - -/* Asia/Samarkand */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x1D, 0xAA, 0x19, 0x85, 0x60, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xBF, 0xD9, 0x20, 0x28, 0xE4, 0xED, 0x50, -0x29, 0x60, 0xBE, 0x30, 0x01, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x08, 0x07, 0x09, 0x00, 0x00, -0x3E, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, -0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, -0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x14, 0x00, 0x00, -0x54, 0x60, 0x01, 0x18, 0x00, 0x00, 0x46, 0x50, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, -0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x54, 0x41, 0x53, 0x54, 0x00, 0x55, 0x5A, -0x54, 0x00, 0x55, 0x5A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC5, 0xDB, 0x0A, 0x01, -0x78, 0x96, 0x40, 0x00, 0x00, 0x00, 0x0F, 0x77, 0x65, 0x73, 0x74, 0x20, 0x55, 0x7A, 0x62, 0x65, -0x6B, 0x69, 0x73, 0x74, 0x61, 0x6E, - -/* Asia/Seoul */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, -0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, -0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, 0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x03, -0x02, 0x03, 0x00, 0x01, 0x04, 0x01, 0x04, 0x01, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, -0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, -0x00, 0x00, 0x8C, 0xA0, 0x01, 0x04, 0x4B, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0x38, 0x01, 0xD4, 0x64, 0xDA, -0x00, 0x00, 0x00, 0x00, - -/* Asia/Shanghai */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xB0, 0xFE, 0x9A, 0xA0, -0xC8, 0x5C, 0x01, 0x80, 0xC8, 0xFA, 0x27, 0x70, 0xC9, 0xD5, 0x0E, 0x80, 0xCA, 0xDB, 0x5A, 0xF0, -0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70, -0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0, -0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x00, 0x00, 0x71, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB8, 0xFC, 0xC5, 0x01, 0xCC, 0x00, 0x6A, 0x00, 0x00, 0x00, -0x2F, 0x65, 0x61, 0x73, 0x74, 0x20, 0x43, 0x68, 0x69, 0x6E, 0x61, 0x20, 0x2D, 0x20, 0x42, 0x65, -0x69, 0x6A, 0x69, 0x6E, 0x67, 0x2C, 0x20, 0x47, 0x75, 0x61, 0x6E, 0x67, 0x64, 0x6F, 0x6E, 0x67, -0x2C, 0x20, 0x53, 0x68, 0x61, 0x6E, 0x67, 0x68, 0x61, 0x69, 0x2C, 0x20, 0x65, 0x74, 0x63, 0x2E, - - -/* Asia/Singapore */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x86, 0x83, 0x85, 0xA3, -0xBA, 0x67, 0x4E, 0x90, 0xC0, 0x0A, 0xE4, 0x60, 0xCA, 0xB3, 0xE5, 0x60, 0xCB, 0x91, 0x5F, 0x08, -0xD2, 0x48, 0x6D, 0xF0, 0xF7, 0xBA, 0x4D, 0x88, 0x16, 0x91, 0xF5, 0x08, 0x01, 0x02, 0x03, 0x04, -0x05, 0x04, 0x06, 0x07, 0x00, 0x00, 0x61, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, -0x00, 0x00, 0x67, 0x20, 0x01, 0x09, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, -0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0F, 0x00, 0x00, 0x69, 0x78, 0x00, 0x13, 0x00, 0x00, -0x70, 0x80, 0x00, 0x13, 0x53, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x4C, 0x54, 0x00, 0x4D, 0x41, 0x4C, -0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x53, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x49, 0x8D, 0x01, -0xB1, 0x1E, 0xE8, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Taipei */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xD1, 0x97, 0xD3, 0x00, -0xD2, 0x61, 0x7A, 0x70, 0xD3, 0x79, 0x06, 0x80, 0xD4, 0x42, 0xAD, 0xF0, 0xD5, 0x5A, 0x3A, 0x00, -0xD6, 0x23, 0xE1, 0x70, 0xD7, 0x3C, 0xBF, 0x00, 0xD8, 0x06, 0x66, 0x70, 0xD9, 0x1D, 0xF2, 0x80, -0xD9, 0xE7, 0x99, 0xF0, 0xDA, 0xFF, 0x26, 0x00, 0xDB, 0xC8, 0xCD, 0x70, 0xDC, 0xE0, 0x59, 0x80, -0xDD, 0xAA, 0x00, 0xF0, 0xDE, 0x72, 0x73, 0x00, 0xDF, 0xB5, 0x64, 0x70, 0xE0, 0x7C, 0x85, 0x00, -0xE1, 0x96, 0x97, 0xF0, 0xE2, 0x5D, 0xB8, 0x80, 0xE3, 0x77, 0xCB, 0x70, 0xE4, 0x3E, 0xEC, 0x00, -0xE5, 0x30, 0x20, 0x70, 0xE6, 0x21, 0x71, 0x00, 0xE7, 0x12, 0xA5, 0x70, 0xE8, 0x02, 0xA4, 0x80, -0xE8, 0xF3, 0xD8, 0xF0, 0xE9, 0xE3, 0xD8, 0x00, 0xEA, 0xD5, 0x0C, 0x70, 0xEB, 0xC5, 0x0B, 0x80, -0xEC, 0xB6, 0x3F, 0xF0, 0xED, 0xF7, 0xFC, 0x00, 0xEE, 0x98, 0xC4, 0xF0, 0xEF, 0xD9, 0x2F, 0x80, -0xF0, 0x79, 0xF8, 0x70, 0x07, 0xFC, 0x56, 0x00, 0x08, 0xED, 0x8A, 0x70, 0x09, 0xDD, 0x89, 0x80, -0x0A, 0xCE, 0xBD, 0xF0, 0x13, 0xBC, 0xD5, 0x00, 0x14, 0x36, 0x10, 0xF0, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAF, 0x8D, 0x68, -0x01, 0xCC, 0x0D, 0x70, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Tashkent */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x83, 0x08, -0xB5, 0xA3, 0xEF, 0x30, 0x15, 0x27, 0x7D, 0xA0, 0x16, 0x18, 0xB2, 0x10, 0x17, 0x08, 0xB1, 0x20, -0x17, 0xF9, 0xE5, 0x90, 0x18, 0xE9, 0xE4, 0xA0, 0x19, 0xDB, 0x19, 0x10, 0x1A, 0xCC, 0x69, 0xA0, -0x1B, 0xBC, 0x76, 0xC0, 0x1C, 0xAC, 0x67, 0xC0, 0x1D, 0x9C, 0x58, 0xC0, 0x1E, 0x8C, 0x49, 0xC0, -0x1F, 0x7C, 0x3A, 0xC0, 0x20, 0x6C, 0x2B, 0xC0, 0x21, 0x5C, 0x1C, 0xC0, 0x22, 0x4C, 0x0D, 0xC0, -0x23, 0x3B, 0xFE, 0xC0, 0x24, 0x2B, 0xEF, 0xC0, 0x25, 0x1B, 0xE0, 0xC0, 0x26, 0x0B, 0xD1, 0xC0, -0x27, 0x04, 0xFD, 0x40, 0x27, 0xF4, 0xEE, 0x40, 0x28, 0xBF, 0xD9, 0x20, 0x28, 0xE4, 0xED, 0x50, -0x29, 0x60, 0xBE, 0x30, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x08, 0x07, 0x09, 0x00, 0x00, -0x40, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, -0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x00, 0x00, -0x54, 0x60, 0x01, 0x13, 0x00, 0x00, 0x46, 0x50, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x41, -0x53, 0x54, 0x00, 0x54, 0x41, 0x53, 0x53, 0x54, 0x00, 0x55, 0x5A, 0x54, 0x00, 0x55, 0x5A, 0x53, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8, 0x66, 0x15, 0x01, 0x7C, 0x66, 0xD0, 0x00, 0x00, -0x00, 0x0F, 0x65, 0x61, 0x73, 0x74, 0x20, 0x55, 0x7A, 0x62, 0x65, 0x6B, 0x69, 0x73, 0x74, 0x61, -0x6E, - -/* Asia/Tbilisi */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x19, 0xAA, 0x19, 0x99, 0xFC, -0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40, -0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0, -0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0, -0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0, -0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0, -0x27, 0x05, 0x19, 0x60, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0x00, 0xCB, 0xC0, 0x28, 0xE5, 0x09, 0x70, -0x29, 0x60, 0xDA, 0x50, 0x29, 0xD4, 0xDE, 0x50, 0x2A, 0xC4, 0xC1, 0x40, 0x2B, 0xB4, 0xC0, 0x50, -0x2C, 0xA4, 0xA3, 0x40, 0x2D, 0x94, 0xA2, 0x50, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x76, 0x40, -0x30, 0x64, 0x59, 0x30, 0x31, 0x5D, 0x92, 0xC0, 0x33, 0x3D, 0x66, 0xB0, 0x34, 0x52, 0x41, 0xB0, -0x35, 0x1D, 0x56, 0xC0, 0x36, 0x32, 0x23, 0xB0, 0x36, 0xFD, 0x38, 0xC0, 0x38, 0x1B, 0x40, 0x30, -0x38, 0xDD, 0x1A, 0xC0, 0x39, 0xFB, 0x22, 0x30, 0x3A, 0xBC, 0xFC, 0xC0, 0x3B, 0xDB, 0x04, 0x30, -0x3C, 0xA6, 0x19, 0x40, 0x3D, 0xBA, 0xE6, 0x30, 0x3E, 0x85, 0xFB, 0x40, 0x3F, 0x9A, 0xC8, 0x30, -0x40, 0x65, 0xDD, 0x40, 0x40, 0xDD, 0xC7, 0xB0, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x08, 0x07, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x0B, -0x0A, 0x0B, 0x0A, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x08, 0x07, 0x0B, 0x00, 0x00, 0x2A, 0x04, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x05, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0A, 0x00, 0x00, 0x38, 0x40, 0x00, 0x05, 0x00, 0x00, 0x38, -0x40, 0x00, 0x05, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0A, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0A, 0x00, -0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x14, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x10, 0x00, 0x00, 0x46, 0x50, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, 0x00, 0x10, 0x54, 0x42, 0x4D, -0x54, 0x00, 0x54, 0x42, 0x49, 0x54, 0x00, 0x54, 0x42, 0x49, 0x53, 0x54, 0x00, 0x47, 0x45, 0x54, -0x00, 0x47, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8, -0xFB, 0xD2, 0x01, 0x57, 0x0B, 0x02, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Tehran */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x9A, 0x6C, 0x7D, 0xC8, -0xD2, 0xDB, 0x12, 0xC8, 0x0E, 0xBB, 0xA2, 0x48, 0x0F, 0x74, 0x2D, 0x40, 0x10, 0x8E, 0x40, 0x30, -0x10, 0xED, 0x3A, 0x40, 0x11, 0x55, 0x67, 0xC8, 0x12, 0x45, 0x4A, 0xB8, 0x13, 0x37, 0xEC, 0xC8, -0x14, 0x2D, 0x15, 0xB8, 0x28, 0x20, 0x76, 0xC8, 0x28, 0xDB, 0x9D, 0xB8, 0x29, 0xCB, 0x9C, 0xC8, -0x2A, 0xBE, 0x22, 0xB8, 0x2B, 0xAC, 0xD0, 0x48, 0x2C, 0x9F, 0x56, 0x38, 0x2D, 0x8E, 0x03, 0xC8, -0x2E, 0x80, 0x89, 0xB8, 0x2F, 0x6F, 0x37, 0x48, 0x30, 0x61, 0xBD, 0x38, 0x31, 0x50, 0x6A, 0xC8, -0x32, 0x42, 0xF0, 0xB8, 0x33, 0x32, 0xEF, 0xC8, 0x34, 0x25, 0x75, 0xB8, 0x35, 0x14, 0x23, 0x48, -0x36, 0x06, 0xA9, 0x38, 0x36, 0xF5, 0x56, 0xC8, 0x37, 0xE7, 0xDC, 0xB8, 0x38, 0xD6, 0x8A, 0x48, -0x39, 0xC9, 0x10, 0x38, 0x3A, 0xB9, 0x0F, 0x48, 0x3B, 0xAB, 0x95, 0x38, 0x3C, 0x9A, 0x42, 0xC8, -0x3D, 0x8C, 0xC8, 0xB8, 0x3E, 0x7B, 0x76, 0x48, 0x3F, 0x6D, 0xFC, 0x38, 0x40, 0x5C, 0xA9, 0xC8, -0x41, 0x4F, 0x2F, 0xB8, 0x42, 0x3F, 0x2E, 0xC8, 0x43, 0x31, 0xB4, 0xB8, 0x47, 0xE2, 0xC9, 0x48, -0x48, 0xD5, 0x4F, 0x38, 0x49, 0xC5, 0x4E, 0x48, 0x4A, 0xB7, 0xD4, 0x38, 0x4B, 0xA6, 0x81, 0xC8, -0x4C, 0x99, 0x07, 0xB8, 0x4D, 0x87, 0xB5, 0x48, 0x4E, 0x7A, 0x3B, 0x38, 0x4F, 0x68, 0xE8, 0xC8, -0x50, 0x5B, 0x6E, 0xB8, 0x51, 0x4B, 0x6D, 0xC8, 0x52, 0x3D, 0xF3, 0xB8, 0x53, 0x2C, 0xA1, 0x48, -0x54, 0x1F, 0x27, 0x38, 0x55, 0x0D, 0xD4, 0xC8, 0x56, 0x00, 0x5A, 0xB8, 0x56, 0xEF, 0x08, 0x48, -0x57, 0xE1, 0x8E, 0x38, 0x58, 0xD1, 0x8D, 0x48, 0x59, 0xC4, 0x13, 0x38, 0x5A, 0xB2, 0xC0, 0xC8, -0x5B, 0xA5, 0x46, 0xB8, 0x5C, 0x93, 0xF4, 0x48, 0x5D, 0x86, 0x7A, 0x38, 0x5E, 0x75, 0x27, 0xC8, -0x5F, 0x67, 0xAD, 0xB8, 0x60, 0x57, 0xAC, 0xC8, 0x61, 0x4A, 0x32, 0xB8, 0x62, 0x38, 0xE0, 0x48, -0x63, 0x2B, 0x66, 0x38, 0x64, 0x1A, 0x13, 0xC8, 0x65, 0x0C, 0x99, 0xB8, 0x65, 0xFB, 0x47, 0x48, -0x66, 0xED, 0xCD, 0x38, 0x67, 0xDD, 0xCC, 0x48, 0x68, 0xD0, 0x52, 0x38, 0x69, 0xBE, 0xFF, 0xC8, -0x6A, 0xB1, 0x85, 0xB8, 0x6B, 0xA0, 0x33, 0x48, 0x6C, 0x92, 0xB9, 0x38, 0x6D, 0x81, 0x66, 0xC8, -0x6E, 0x73, 0xEC, 0xB8, 0x6F, 0x62, 0x9A, 0x48, 0x70, 0x55, 0x20, 0x38, 0x71, 0x45, 0x1F, 0x48, -0x72, 0x37, 0xA5, 0x38, 0x73, 0x26, 0x52, 0xC8, 0x74, 0x18, 0xD8, 0xB8, 0x75, 0x07, 0x86, 0x48, -0x75, 0xFA, 0x0C, 0x38, 0x76, 0xE8, 0xB9, 0xC8, 0x77, 0xDB, 0x3F, 0xB8, 0x78, 0xCB, 0x3E, 0xC8, -0x79, 0xBD, 0xC4, 0xB8, 0x7A, 0xAC, 0x72, 0x48, 0x7B, 0x9E, 0xF8, 0x38, 0x7C, 0x8D, 0xA5, 0xC8, -0x7D, 0x80, 0x2B, 0xB8, 0x7E, 0x6E, 0xD9, 0x48, 0x7F, 0x61, 0x5F, 0x38, 0x01, 0x02, 0x04, 0x03, -0x04, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x00, 0x00, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x00, 0x04, 0x00, 0x00, 0x31, 0x38, -0x00, 0x08, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x00, 0x08, 0x00, 0x00, -0x3F, 0x48, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, 0x49, 0x52, 0x53, 0x54, -0x00, 0x49, 0x52, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBF, 0xC0, 0x8A, 0x01, 0x61, 0x23, 0xA5, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Tel_Aviv */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x9E, 0x30, 0x45, 0x88, -0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, -0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, -0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xD7, 0x5A, 0x14, 0x60, 0xD7, 0xDF, 0x1F, 0xC0, -0xD8, 0x2F, 0xB5, 0x70, 0xD9, 0x1E, 0x46, 0xE0, 0xDA, 0x10, 0xE8, 0xF0, 0xDA, 0xEB, 0xB3, 0xE0, -0xDB, 0xB4, 0x34, 0x00, 0xDC, 0xB9, 0x20, 0xE0, 0xDD, 0xE0, 0x8D, 0x00, 0xDE, 0xB4, 0xCE, 0x80, -0xDF, 0xA4, 0xBF, 0x80, 0xE0, 0x8B, 0x76, 0x00, 0xE1, 0x56, 0x7D, 0x00, 0xE2, 0xBE, 0x4A, 0x60, -0xE3, 0x36, 0x34, 0xD0, 0xE4, 0x9C, 0xF7, 0x00, 0xE5, 0x16, 0x16, 0xD0, 0xE6, 0x74, 0xD3, 0xE0, -0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0, -0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0, -0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60, -0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60, -0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0, -0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0, -0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0, -0x30, 0x48, 0xC5, 0xD0, 0x31, 0x48, 0x96, 0xE0, 0x32, 0x3C, 0x6E, 0x50, 0x33, 0x31, 0xB3, 0x60, -0x34, 0x1A, 0xFE, 0xD0, 0x35, 0x11, 0x95, 0x60, 0x35, 0xF1, 0xA6, 0x50, 0x37, 0x04, 0x08, 0x80, -0x37, 0xCF, 0x01, 0x70, 0x38, 0xF6, 0x5F, 0x80, 0x39, 0xDC, 0xF9, 0xE0, 0x3A, 0xD0, 0xED, 0x70, -0x3B, 0xAE, 0x5B, 0x60, 0x3C, 0xA3, 0xA0, 0x70, 0x3D, 0xA0, 0xB2, 0x60, 0x3E, 0x83, 0x82, 0x70, -0x3F, 0x7C, 0x9F, 0xE0, 0x40, 0x73, 0x36, 0x70, 0x41, 0x50, 0xA4, 0x60, 0x42, 0x4C, 0x8F, 0x00, -0x43, 0x48, 0x4F, 0x70, 0x44, 0x2C, 0x71, 0x00, 0x45, 0x1E, 0xF6, 0xF0, 0x46, 0x0C, 0x53, 0x00, -0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, -0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, -0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00, -0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80, -0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00, -0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44, -0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Thimbu */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xD5, 0xE6, 0x15, 0x74, -0x21, 0x61, 0x4D, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x54, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58, -0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x42, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Thimphu */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xD5, 0xE6, 0x15, 0x74, -0x21, 0x61, 0x4D, 0xA8, 0x01, 0x02, 0x00, 0x00, 0x54, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x58, -0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x42, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB3, 0x3D, 0x6A, 0x01, 0x9B, -0x74, 0x07, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Tokyo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xC3, 0xCE, 0x85, 0x70, -0xD7, 0x3E, 0x1E, 0x90, 0xD7, 0xEC, 0x16, 0x80, 0xD8, 0xF9, 0x16, 0x90, 0xD9, 0xCB, 0xF8, 0x80, -0xDB, 0x07, 0x1D, 0x10, 0xDB, 0xAB, 0xDA, 0x80, 0xDC, 0xE6, 0xFF, 0x10, 0xDD, 0x8B, 0xBC, 0x80, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x01, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x43, 0x4A, 0x54, 0x00, 0x4A, -0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0xBB, -0xC4, 0x01, 0xE7, 0xE4, 0x48, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Ujung_Pandang */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xA1, 0xF2, 0x5D, 0x90, -0xBA, 0x16, 0xD5, 0x90, 0xCB, 0x88, 0x1D, 0x80, 0xD2, 0x56, 0xEE, 0x70, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x6F, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, -0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x4D, 0x54, 0x00, -0x43, 0x49, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Ulaanbaatar */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0F, 0x86, 0xD3, 0xEE, 0x4C, -0x0F, 0x0B, 0xDC, 0x90, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80, -0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x2F, 0x80, 0x1D, 0x9C, 0x12, 0x70, 0x1E, 0x8C, 0x11, 0x80, -0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xF3, 0x80, 0x21, 0x5B, 0xD6, 0x70, 0x22, 0x4B, 0xD5, 0x80, -0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xB7, 0x80, 0x25, 0x1B, 0x9A, 0x70, 0x26, 0x0B, 0x99, 0x80, -0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0xD4, 0x98, 0x00, -0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xA4, 0x5C, 0xF0, 0x2D, 0x94, 0x5C, 0x00, -0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x64, 0x20, 0xF0, 0x31, 0x5D, 0x5A, 0x80, -0x32, 0x4D, 0x3D, 0x70, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x2D, 0x1F, 0x70, 0x35, 0x1D, 0x1E, 0x80, -0x36, 0x0D, 0x01, 0x70, 0x3A, 0xE9, 0xB3, 0xA0, 0x3B, 0xB4, 0xAC, 0x90, 0x3C, 0xA4, 0xAB, 0xA0, -0x3D, 0x94, 0x8E, 0x90, 0x3E, 0x84, 0x8D, 0xA0, 0x3F, 0x74, 0x70, 0x90, 0x40, 0x64, 0x6F, 0xA0, -0x41, 0x54, 0x52, 0x90, 0x42, 0x44, 0x51, 0xA0, 0x43, 0x34, 0x34, 0x90, 0x44, 0x24, 0x33, 0xA0, -0x45, 0x1D, 0x51, 0x10, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x64, 0x34, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x55, 0x4C, -0x41, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xD2, 0x71, 0xB2, 0x01, 0xB5, 0xBF, 0xCD, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, -0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* Asia/Ulan_Bator */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0F, 0x86, 0xD3, 0xEE, 0x4C, -0x0F, 0x0B, 0xDC, 0x90, 0x18, 0xE9, 0xC8, 0x80, 0x19, 0xDA, 0xFC, 0xF0, 0x1A, 0xCC, 0x4D, 0x80, -0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x2F, 0x80, 0x1D, 0x9C, 0x12, 0x70, 0x1E, 0x8C, 0x11, 0x80, -0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xF3, 0x80, 0x21, 0x5B, 0xD6, 0x70, 0x22, 0x4B, 0xD5, 0x80, -0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xB7, 0x80, 0x25, 0x1B, 0x9A, 0x70, 0x26, 0x0B, 0x99, 0x80, -0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0xD4, 0x98, 0x00, -0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xA4, 0x5C, 0xF0, 0x2D, 0x94, 0x5C, 0x00, -0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x64, 0x20, 0xF0, 0x31, 0x5D, 0x5A, 0x80, -0x32, 0x4D, 0x3D, 0x70, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x2D, 0x1F, 0x70, 0x35, 0x1D, 0x1E, 0x80, -0x36, 0x0D, 0x01, 0x70, 0x3A, 0xE9, 0xB3, 0xA0, 0x3B, 0xB4, 0xAC, 0x90, 0x3C, 0xA4, 0xAB, 0xA0, -0x3D, 0x94, 0x8E, 0x90, 0x3E, 0x84, 0x8D, 0xA0, 0x3F, 0x74, 0x70, 0x90, 0x40, 0x64, 0x6F, 0xA0, -0x41, 0x54, 0x52, 0x90, 0x42, 0x44, 0x51, 0xA0, 0x43, 0x34, 0x34, 0x90, 0x44, 0x24, 0x33, 0xA0, -0x45, 0x1D, 0x51, 0x10, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x64, 0x34, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x55, 0x4C, -0x41, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Urumqi */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xB0, 0xFE, 0xBA, 0x64, -0x13, 0x6D, 0xD7, 0x20, 0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, -0x21, 0x49, 0x61, 0x70, 0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, -0x25, 0x12, 0x5F, 0xF0, 0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, -0x28, 0xD2, 0x23, 0xF0, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x52, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x01, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x55, 0x52, -0x55, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xCC, 0x29, 0xA0, 0x01, 0x98, 0x4C, 0xBD, 0x00, 0x00, 0x00, 0x18, 0x6D, -0x6F, 0x73, 0x74, 0x20, 0x6F, 0x66, 0x20, 0x54, 0x69, 0x62, 0x65, 0x74, 0x20, 0x26, 0x20, 0x58, -0x69, 0x6E, 0x6A, 0x69, 0x61, 0x6E, 0x67, - -/* Asia/Vientiane */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x46, 0x50, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xBE, 0x7A, -0x01, 0xAF, 0x36, 0xA0, 0x00, 0x00, 0x00, 0x00, - -/* Asia/Vladivostok */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x16, 0xA7, 0x59, 0x47, 0x50, -0xB5, 0xA3, 0xB6, 0xF0, 0x15, 0x27, 0x45, 0x60, 0x16, 0x18, 0x79, 0xD0, 0x17, 0x08, 0x78, 0xE0, -0x17, 0xF9, 0xAD, 0x50, 0x18, 0xE9, 0xAC, 0x60, 0x19, 0xDA, 0xE0, 0xD0, 0x1A, 0xCC, 0x31, 0x60, -0x1B, 0xBC, 0x3E, 0x80, 0x1C, 0xAC, 0x2F, 0x80, 0x1D, 0x9C, 0x20, 0x80, 0x1E, 0x8C, 0x11, 0x80, -0x1F, 0x7C, 0x02, 0x80, 0x20, 0x6B, 0xF3, 0x80, 0x21, 0x5B, 0xE4, 0x80, 0x22, 0x4B, 0xD5, 0x80, -0x23, 0x3B, 0xC6, 0x80, 0x24, 0x2B, 0xB7, 0x80, 0x25, 0x1B, 0xA8, 0x80, 0x26, 0x0B, 0x99, 0x80, -0x27, 0x04, 0xC5, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xE4, 0xB5, 0x10, 0x29, 0x78, 0x5D, 0x10, -0x29, 0xD4, 0x6D, 0xD0, 0x2A, 0xC4, 0x50, 0xC0, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xA4, 0x6B, 0x00, -0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x84, 0x4D, 0x00, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x64, 0x2F, 0x00, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xFA, 0xF8, 0x00, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x25, 0x69, 0x00, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xEE, 0x67, 0x80, 0x49, 0x03, 0x42, 0x80, 0x49, 0xCE, 0x49, 0x80, 0x4A, 0xE3, 0x24, 0x80, -0x4B, 0xAE, 0x2B, 0x80, 0x4C, 0xCC, 0x41, 0x00, 0x4D, 0x8E, 0x0D, 0x80, 0x4E, 0xAC, 0x23, 0x00, -0x4F, 0x6D, 0xEF, 0x80, 0x50, 0x8C, 0x05, 0x00, 0x51, 0x57, 0x0C, 0x00, 0x52, 0x6B, 0xE7, 0x00, -0x53, 0x36, 0xEE, 0x00, 0x54, 0x4B, 0xC9, 0x00, 0x55, 0x16, 0xD0, 0x00, 0x56, 0x2B, 0xAB, 0x00, -0x56, 0xF6, 0xB2, 0x00, 0x58, 0x14, 0xC7, 0x80, 0x58, 0xD6, 0x94, 0x00, 0x59, 0xF4, 0xA9, 0x80, -0x5A, 0xB6, 0x76, 0x00, 0x5B, 0xD4, 0x8B, 0x80, 0x5C, 0x9F, 0x92, 0x80, 0x5D, 0xB4, 0x6D, 0x80, -0x5E, 0x7F, 0x74, 0x80, 0x5F, 0x94, 0x4F, 0x80, 0x60, 0x5F, 0x56, 0x80, 0x61, 0x7D, 0x6C, 0x00, -0x62, 0x3F, 0x38, 0x80, 0x63, 0x5D, 0x4E, 0x00, 0x64, 0x1F, 0x1A, 0x80, 0x65, 0x3D, 0x30, 0x00, -0x66, 0x08, 0x37, 0x00, 0x67, 0x1D, 0x12, 0x00, 0x67, 0xE8, 0x19, 0x00, 0x68, 0xFC, 0xF4, 0x00, -0x69, 0xC7, 0xFB, 0x00, 0x6A, 0xDC, 0xD6, 0x00, 0x6B, 0xA7, 0xDD, 0x00, 0x6C, 0xC5, 0xF2, 0x80, -0x6D, 0x87, 0xBF, 0x00, 0x6E, 0xA5, 0xD4, 0x80, 0x6F, 0x67, 0xA1, 0x00, 0x70, 0x85, 0xB6, 0x80, -0x71, 0x50, 0xBD, 0x80, 0x72, 0x65, 0x98, 0x80, 0x73, 0x30, 0x9F, 0x80, 0x74, 0x45, 0x7A, 0x80, -0x75, 0x10, 0x81, 0x80, 0x76, 0x2E, 0x97, 0x00, 0x76, 0xF0, 0x63, 0x80, 0x78, 0x0E, 0x79, 0x00, -0x78, 0xD0, 0x45, 0x80, 0x79, 0xEE, 0x5B, 0x00, 0x7A, 0xB0, 0x27, 0x80, 0x7B, 0xCE, 0x3D, 0x00, -0x7C, 0x99, 0x44, 0x00, 0x7D, 0xAE, 0x1F, 0x00, 0x7E, 0x79, 0x26, 0x00, 0x7F, 0x8E, 0x01, 0x00, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x7B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, -0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x00, 0x00, 0x8C, -0xA0, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x09, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0F, 0x00, -0x00, 0x7E, 0x90, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x56, 0x4C, 0x41, 0x54, 0x00, 0x56, 0x4C, -0x41, 0x53, 0x54, 0x00, 0x56, 0x4C, 0x41, 0x53, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCB, 0x32, 0x3A, 0x01, -0xDB, 0xF8, 0xF5, 0x00, 0x00, 0x00, 0x16, 0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x37, -0x20, 0x2D, 0x20, 0x41, 0x6D, 0x75, 0x72, 0x20, 0x52, 0x69, 0x76, 0x65, 0x72, - -/* Asia/Yakutsk */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0F, 0xA1, 0xDB, 0xEA, 0x70, -0xB5, 0xA3, 0xC5, 0x00, 0x15, 0x27, 0x53, 0x70, 0x16, 0x18, 0x87, 0xE0, 0x17, 0x08, 0x86, 0xF0, -0x17, 0xF9, 0xBB, 0x60, 0x18, 0xE9, 0xBA, 0x70, 0x19, 0xDA, 0xEE, 0xE0, 0x1A, 0xCC, 0x3F, 0x70, -0x1B, 0xBC, 0x4C, 0x90, 0x1C, 0xAC, 0x3D, 0x90, 0x1D, 0x9C, 0x2E, 0x90, 0x1E, 0x8C, 0x1F, 0x90, -0x1F, 0x7C, 0x10, 0x90, 0x20, 0x6C, 0x01, 0x90, 0x21, 0x5B, 0xF2, 0x90, 0x22, 0x4B, 0xE3, 0x90, -0x23, 0x3B, 0xD4, 0x90, 0x24, 0x2B, 0xC5, 0x90, 0x25, 0x1B, 0xB6, 0x90, 0x26, 0x0B, 0xA7, 0x90, -0x27, 0x04, 0xD3, 0x10, 0x27, 0xF4, 0xC4, 0x10, 0x28, 0xE4, 0xC3, 0x20, 0x29, 0x78, 0x6B, 0x20, -0x29, 0xD4, 0x7B, 0xE0, 0x2A, 0xC4, 0x5E, 0xD0, 0x2B, 0xB4, 0x88, 0x10, 0x2C, 0xA4, 0x79, 0x10, -0x2D, 0x94, 0x6A, 0x10, 0x2E, 0x84, 0x5B, 0x10, 0x2F, 0x74, 0x4C, 0x10, 0x30, 0x64, 0x3D, 0x10, -0x31, 0x5D, 0x68, 0x90, 0x32, 0x72, 0x43, 0x90, 0x33, 0x3D, 0x4A, 0x90, 0x34, 0x52, 0x25, 0x90, -0x35, 0x1D, 0x2C, 0x90, 0x36, 0x32, 0x07, 0x90, 0x36, 0xFD, 0x0E, 0x90, 0x38, 0x1B, 0x24, 0x10, -0x38, 0xDC, 0xF0, 0x90, 0x39, 0xFB, 0x06, 0x10, 0x3A, 0xBC, 0xD2, 0x90, 0x3B, 0xDA, 0xE8, 0x10, -0x3C, 0xA5, 0xEF, 0x10, 0x3D, 0xBA, 0xCA, 0x10, 0x3E, 0x85, 0xD1, 0x10, 0x3F, 0x9A, 0xAC, 0x10, -0x40, 0x65, 0xB3, 0x10, 0x41, 0x83, 0xC8, 0x90, 0x42, 0x45, 0x95, 0x10, 0x43, 0x63, 0xAA, 0x90, -0x44, 0x25, 0x77, 0x10, 0x45, 0x43, 0x8C, 0x90, 0x46, 0x05, 0x59, 0x10, 0x47, 0x23, 0x6E, 0x90, -0x47, 0xEE, 0x75, 0x90, 0x49, 0x03, 0x50, 0x90, 0x49, 0xCE, 0x57, 0x90, 0x4A, 0xE3, 0x32, 0x90, -0x4B, 0xAE, 0x39, 0x90, 0x4C, 0xCC, 0x4F, 0x10, 0x4D, 0x8E, 0x1B, 0x90, 0x4E, 0xAC, 0x31, 0x10, -0x4F, 0x6D, 0xFD, 0x90, 0x50, 0x8C, 0x13, 0x10, 0x51, 0x57, 0x1A, 0x10, 0x52, 0x6B, 0xF5, 0x10, -0x53, 0x36, 0xFC, 0x10, 0x54, 0x4B, 0xD7, 0x10, 0x55, 0x16, 0xDE, 0x10, 0x56, 0x2B, 0xB9, 0x10, -0x56, 0xF6, 0xC0, 0x10, 0x58, 0x14, 0xD5, 0x90, 0x58, 0xD6, 0xA2, 0x10, 0x59, 0xF4, 0xB7, 0x90, -0x5A, 0xB6, 0x84, 0x10, 0x5B, 0xD4, 0x99, 0x90, 0x5C, 0x9F, 0xA0, 0x90, 0x5D, 0xB4, 0x7B, 0x90, -0x5E, 0x7F, 0x82, 0x90, 0x5F, 0x94, 0x5D, 0x90, 0x60, 0x5F, 0x64, 0x90, 0x61, 0x7D, 0x7A, 0x10, -0x62, 0x3F, 0x46, 0x90, 0x63, 0x5D, 0x5C, 0x10, 0x64, 0x1F, 0x28, 0x90, 0x65, 0x3D, 0x3E, 0x10, -0x66, 0x08, 0x45, 0x10, 0x67, 0x1D, 0x20, 0x10, 0x67, 0xE8, 0x27, 0x10, 0x68, 0xFD, 0x02, 0x10, -0x69, 0xC8, 0x09, 0x10, 0x6A, 0xDC, 0xE4, 0x10, 0x6B, 0xA7, 0xEB, 0x10, 0x6C, 0xC6, 0x00, 0x90, -0x6D, 0x87, 0xCD, 0x10, 0x6E, 0xA5, 0xE2, 0x90, 0x6F, 0x67, 0xAF, 0x10, 0x70, 0x85, 0xC4, 0x90, -0x71, 0x50, 0xCB, 0x90, 0x72, 0x65, 0xA6, 0x90, 0x73, 0x30, 0xAD, 0x90, 0x74, 0x45, 0x88, 0x90, -0x75, 0x10, 0x8F, 0x90, 0x76, 0x2E, 0xA5, 0x10, 0x76, 0xF0, 0x71, 0x90, 0x78, 0x0E, 0x87, 0x10, -0x78, 0xD0, 0x53, 0x90, 0x79, 0xEE, 0x69, 0x10, 0x7A, 0xB0, 0x35, 0x90, 0x7B, 0xCE, 0x4B, 0x10, -0x7C, 0x99, 0x52, 0x10, 0x7D, 0xAE, 0x2D, 0x10, 0x7E, 0x79, 0x34, 0x10, 0x7F, 0x8E, 0x0F, 0x10, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x04, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, 0x79, 0x90, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, -0x04, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, -0x90, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x09, 0x00, -0x00, 0x70, 0x80, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x59, 0x41, 0x4B, 0x54, 0x00, 0x59, 0x41, -0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xE7, 0xEF, 0x00, 0x01, 0xD8, 0x83, 0x8A, 0x00, 0x00, 0x00, 0x16, -0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x36, 0x20, 0x2D, 0x20, 0x4C, 0x65, 0x6E, 0x61, -0x20, 0x52, 0x69, 0x76, 0x65, 0x72, - -/* Asia/Yekaterinburg */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0x12, 0xAD, 0xF0, -0xB5, 0xA3, 0xFD, 0x40, 0x15, 0x27, 0x8B, 0xB0, 0x16, 0x18, 0xC0, 0x20, 0x17, 0x08, 0xBF, 0x30, -0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, -0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, -0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, -0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, -0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x78, 0xA3, 0x60, -0x29, 0xD4, 0xB4, 0x20, 0x2A, 0xC4, 0x97, 0x10, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50, -0x2D, 0x94, 0xA2, 0x50, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x75, 0x50, -0x31, 0x5D, 0xA0, 0xD0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x5D, 0xD0, -0x35, 0x1D, 0x64, 0xD0, 0x36, 0x32, 0x3F, 0xD0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x5C, 0x50, -0x38, 0xDD, 0x28, 0xD0, 0x39, 0xFB, 0x3E, 0x50, 0x3A, 0xBD, 0x0A, 0xD0, 0x3B, 0xDB, 0x20, 0x50, -0x3C, 0xA6, 0x27, 0x50, 0x3D, 0xBB, 0x02, 0x50, 0x3E, 0x86, 0x09, 0x50, 0x3F, 0x9A, 0xE4, 0x50, -0x40, 0x65, 0xEB, 0x50, 0x41, 0x84, 0x00, 0xD0, 0x42, 0x45, 0xCD, 0x50, 0x43, 0x63, 0xE2, 0xD0, -0x44, 0x25, 0xAF, 0x50, 0x45, 0x43, 0xC4, 0xD0, 0x46, 0x05, 0x91, 0x50, 0x47, 0x23, 0xA6, 0xD0, -0x47, 0xEE, 0xAD, 0xD0, 0x49, 0x03, 0x88, 0xD0, 0x49, 0xCE, 0x8F, 0xD0, 0x4A, 0xE3, 0x6A, 0xD0, -0x4B, 0xAE, 0x71, 0xD0, 0x4C, 0xCC, 0x87, 0x50, 0x4D, 0x8E, 0x53, 0xD0, 0x4E, 0xAC, 0x69, 0x50, -0x4F, 0x6E, 0x35, 0xD0, 0x50, 0x8C, 0x4B, 0x50, 0x51, 0x57, 0x52, 0x50, 0x52, 0x6C, 0x2D, 0x50, -0x53, 0x37, 0x34, 0x50, 0x54, 0x4C, 0x0F, 0x50, 0x55, 0x17, 0x16, 0x50, 0x56, 0x2B, 0xF1, 0x50, -0x56, 0xF6, 0xF8, 0x50, 0x58, 0x15, 0x0D, 0xD0, 0x58, 0xD6, 0xDA, 0x50, 0x59, 0xF4, 0xEF, 0xD0, -0x5A, 0xB6, 0xBC, 0x50, 0x5B, 0xD4, 0xD1, 0xD0, 0x5C, 0x9F, 0xD8, 0xD0, 0x5D, 0xB4, 0xB3, 0xD0, -0x5E, 0x7F, 0xBA, 0xD0, 0x5F, 0x94, 0x95, 0xD0, 0x60, 0x5F, 0x9C, 0xD0, 0x61, 0x7D, 0xB2, 0x50, -0x62, 0x3F, 0x7E, 0xD0, 0x63, 0x5D, 0x94, 0x50, 0x64, 0x1F, 0x60, 0xD0, 0x65, 0x3D, 0x76, 0x50, -0x66, 0x08, 0x7D, 0x50, 0x67, 0x1D, 0x58, 0x50, 0x67, 0xE8, 0x5F, 0x50, 0x68, 0xFD, 0x3A, 0x50, -0x69, 0xC8, 0x41, 0x50, 0x6A, 0xDD, 0x1C, 0x50, 0x6B, 0xA8, 0x23, 0x50, 0x6C, 0xC6, 0x38, 0xD0, -0x6D, 0x88, 0x05, 0x50, 0x6E, 0xA6, 0x1A, 0xD0, 0x6F, 0x67, 0xE7, 0x50, 0x70, 0x85, 0xFC, 0xD0, -0x71, 0x51, 0x03, 0xD0, 0x72, 0x65, 0xDE, 0xD0, 0x73, 0x30, 0xE5, 0xD0, 0x74, 0x45, 0xC0, 0xD0, -0x75, 0x10, 0xC7, 0xD0, 0x76, 0x2E, 0xDD, 0x50, 0x76, 0xF0, 0xA9, 0xD0, 0x78, 0x0E, 0xBF, 0x50, -0x78, 0xD0, 0x8B, 0xD0, 0x79, 0xEE, 0xA1, 0x50, 0x7A, 0xB0, 0x6D, 0xD0, 0x7B, 0xCE, 0x83, 0x50, -0x7C, 0x99, 0x8A, 0x50, 0x7D, 0xAE, 0x65, 0x50, 0x7E, 0x79, 0x6C, 0x50, 0x7F, 0x8E, 0x47, 0x50, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x0B, 0x08, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x38, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, -0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x00, 0x00, 0x46, -0x50, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x09, 0x00, -0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, -0x15, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x00, 0x15, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x56, 0x45, 0x54, 0x00, 0x53, 0x56, 0x45, 0x53, 0x54, 0x00, 0x59, 0x45, 0x4B, 0x53, -0x54, 0x00, 0x59, 0x45, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xE0, 0x13, 0x48, 0x01, 0x6F, 0x20, 0x60, 0x00, 0x00, 0x00, 0x11, 0x4D, 0x6F, 0x73, 0x63, 0x6F, -0x77, 0x2B, 0x30, 0x32, 0x20, 0x2D, 0x20, 0x55, 0x72, 0x61, 0x6C, 0x73, - -/* Asia/Yerevan */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x18, 0xAA, 0x19, 0x9A, 0x48, -0xE7, 0xDA, 0x0C, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40, -0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0, -0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0, -0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0, -0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xFC, 0xE0, 0x26, 0x0B, 0xED, 0xE0, -0x27, 0x05, 0x19, 0x60, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xDC, 0xF6, 0x40, 0x28, 0xE5, 0x09, 0x70, -0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70, -0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70, -0x32, 0xC9, 0x70, 0xC0, 0x33, 0x3D, 0x90, 0xE0, 0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0, -0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, 0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0, -0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60, -0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60, -0x41, 0x84, 0x0E, 0xE0, 0x42, 0x45, 0xDB, 0x60, 0x43, 0x63, 0xF0, 0xE0, 0x44, 0x25, 0xBD, 0x60, -0x45, 0x43, 0xD2, 0xE0, 0x46, 0x05, 0x9F, 0x60, 0x47, 0x23, 0xB4, 0xE0, 0x47, 0xEE, 0xBB, 0xE0, -0x49, 0x03, 0x96, 0xE0, 0x49, 0xCE, 0x9D, 0xE0, 0x4A, 0xE3, 0x78, 0xE0, 0x4B, 0xAE, 0x7F, 0xE0, -0x4C, 0xCC, 0x95, 0x60, 0x4D, 0x8E, 0x61, 0xE0, 0x4E, 0xAC, 0x77, 0x60, 0x4F, 0x6E, 0x43, 0xE0, -0x50, 0x8C, 0x59, 0x60, 0x51, 0x57, 0x60, 0x60, 0x52, 0x6C, 0x3B, 0x60, 0x53, 0x37, 0x42, 0x60, -0x54, 0x4C, 0x1D, 0x60, 0x55, 0x17, 0x24, 0x60, 0x56, 0x2B, 0xFF, 0x60, 0x56, 0xF7, 0x06, 0x60, -0x58, 0x15, 0x1B, 0xE0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xFD, 0xE0, 0x5A, 0xB6, 0xCA, 0x60, -0x5B, 0xD4, 0xDF, 0xE0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xC1, 0xE0, 0x5E, 0x7F, 0xC8, 0xE0, -0x5F, 0x94, 0xA3, 0xE0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xC0, 0x60, 0x62, 0x3F, 0x8C, 0xE0, -0x63, 0x5D, 0xA2, 0x60, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x84, 0x60, 0x66, 0x08, 0x8B, 0x60, -0x67, 0x1D, 0x66, 0x60, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x48, 0x60, 0x69, 0xC8, 0x4F, 0x60, -0x6A, 0xDD, 0x2A, 0x60, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x46, 0xE0, 0x6D, 0x88, 0x13, 0x60, -0x6E, 0xA6, 0x28, 0xE0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x86, 0x0A, 0xE0, 0x71, 0x51, 0x11, 0xE0, -0x72, 0x65, 0xEC, 0xE0, 0x73, 0x30, 0xF3, 0xE0, 0x74, 0x45, 0xCE, 0xE0, 0x75, 0x10, 0xD5, 0xE0, -0x76, 0x2E, 0xEB, 0x60, 0x76, 0xF0, 0xB7, 0xE0, 0x78, 0x0E, 0xCD, 0x60, 0x78, 0xD0, 0x99, 0xE0, -0x79, 0xEE, 0xAF, 0x60, 0x7A, 0xB0, 0x7B, 0xE0, 0x7B, 0xCE, 0x91, 0x60, 0x7C, 0x99, 0x98, 0x60, -0x7D, 0xAE, 0x73, 0x60, 0x7E, 0x79, 0x7A, 0x60, 0x7F, 0x8E, 0x55, 0x60, 0x01, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x06, 0x08, 0x07, 0x08, 0x09, 0x0A, 0x07, 0x0A, 0x07, 0x0A, 0x0B, 0x0D, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, -0x00, 0x00, 0x29, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, -0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, -0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0F, -0x00, 0x00, 0x38, 0x40, 0x01, 0x13, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0F, 0x00, 0x00, 0x38, 0x40, -0x01, 0x13, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, 0x01, 0x13, 0x00, 0x00, -0x38, 0x40, 0x00, 0x0F, 0x4C, 0x4D, 0x54, 0x00, 0x59, 0x45, 0x52, 0x54, 0x00, 0x59, 0x45, 0x52, -0x53, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xA4, 0xDD, 0x01, 0x56, 0x8F, 0x50, -0x00, 0x00, 0x00, 0x00, - -/* Atlantic/Azores */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x19, 0x91, 0xC1, 0xFC, 0x58, -0x9B, 0x4B, 0x89, 0x90, 0x9B, 0xFE, 0xE3, 0xA0, 0x9C, 0x9D, 0x09, 0x90, 0x9D, 0xC9, 0x9F, 0x90, -0x9E, 0x7F, 0x8E, 0x90, 0x9F, 0xAA, 0xD3, 0x10, 0xA0, 0x5F, 0x70, 0x90, 0xA1, 0x8C, 0x06, 0x90, -0xA2, 0x41, 0xF5, 0x90, 0xA3, 0x6E, 0x8B, 0x90, 0xA4, 0x23, 0x29, 0x10, 0xA5, 0x4F, 0xBF, 0x10, -0xAA, 0x06, 0x0B, 0x90, 0xAA, 0xF4, 0xAB, 0x10, 0xAD, 0xC9, 0xC4, 0x10, 0xAE, 0xA7, 0x40, 0x10, -0xAF, 0xA0, 0x6B, 0x90, 0xB0, 0x87, 0x22, 0x10, 0xB1, 0x89, 0x88, 0x10, 0xB2, 0x70, 0x3E, 0x90, -0xB3, 0x72, 0xA4, 0x90, 0xB4, 0x50, 0x20, 0x90, 0xB7, 0x32, 0x68, 0x90, 0xB8, 0x0F, 0xE4, 0x90, -0xB8, 0xFF, 0xD5, 0x90, 0xB9, 0xEF, 0xC6, 0x90, 0xBC, 0xC8, 0xD4, 0x10, 0xBD, 0xB8, 0xC5, 0x10, -0xBE, 0x9F, 0x7B, 0x90, 0xBF, 0x98, 0xA7, 0x10, 0xC0, 0x9B, 0x0D, 0x10, 0xC1, 0x78, 0x89, 0x10, -0xC2, 0x68, 0x7A, 0x10, 0xC3, 0x58, 0x6B, 0x10, 0xC4, 0x3F, 0x21, 0x90, 0xC5, 0x38, 0x4D, 0x10, -0xC6, 0x3A, 0xB3, 0x10, 0xC7, 0x58, 0xC8, 0x90, 0xC7, 0xD9, 0xFB, 0x90, 0xC9, 0x01, 0x4B, 0x90, -0xC9, 0xF1, 0x3C, 0x90, 0xCA, 0xE2, 0x7F, 0x10, 0xCB, 0xB5, 0x6F, 0x10, 0xCB, 0xEC, 0xC0, 0x00, -0xCC, 0x80, 0x68, 0x00, 0xCC, 0xDC, 0xBF, 0x10, 0xCD, 0x95, 0x51, 0x10, 0xCD, 0xC3, 0x67, 0x80, -0xCE, 0x72, 0xBF, 0x00, 0xCE, 0xC5, 0xDB, 0x90, 0xCF, 0x75, 0x33, 0x10, 0xCF, 0xAC, 0x84, 0x00, -0xD0, 0x52, 0xA1, 0x00, 0xD0, 0xA5, 0xBD, 0x90, 0xD1, 0x55, 0x15, 0x10, 0xD1, 0x8C, 0x66, 0x00, -0xD2, 0x32, 0x83, 0x00, 0xD2, 0x85, 0x9F, 0x90, 0xD3, 0x59, 0xE1, 0x10, 0xD4, 0x49, 0xD2, 0x10, -0xD5, 0x39, 0xED, 0x40, 0xD6, 0x29, 0xDE, 0x40, 0xD7, 0x19, 0xCF, 0x40, 0xD8, 0x09, 0xC0, 0x40, -0xD8, 0xF9, 0xB1, 0x40, 0xD9, 0xE9, 0xA2, 0x40, 0xDC, 0xB9, 0x75, 0x40, 0xDD, 0xB2, 0xA0, 0xC0, -0xDE, 0xA2, 0x91, 0xC0, 0xDF, 0x92, 0x82, 0xC0, 0xE0, 0x82, 0x73, 0xC0, 0xE1, 0x72, 0x64, 0xC0, -0xE2, 0x62, 0x55, 0xC0, 0xE3, 0x52, 0x46, 0xC0, 0xE4, 0x42, 0x37, 0xC0, 0xE5, 0x32, 0x28, 0xC0, -0xE6, 0x22, 0x19, 0xC0, 0xE7, 0x1B, 0x45, 0x40, 0xE8, 0x0B, 0x36, 0x40, 0xE8, 0xFB, 0x27, 0x40, -0xE9, 0xEB, 0x18, 0x40, 0xEA, 0xDB, 0x09, 0x40, 0xEB, 0xCA, 0xFA, 0x40, 0xEC, 0xBA, 0xEB, 0x40, -0xED, 0xAA, 0xDC, 0x40, 0xEE, 0x9A, 0xCD, 0x40, 0xEF, 0x8A, 0xBE, 0x40, 0xF0, 0x7A, 0xAF, 0x40, -0xF1, 0x6A, 0xA0, 0x40, 0xF2, 0x63, 0xCB, 0xC0, 0xF3, 0x53, 0xBC, 0xC0, 0xF4, 0x43, 0xAD, 0xC0, -0xF5, 0x33, 0x9E, 0xC0, 0xF6, 0x23, 0x8F, 0xC0, 0xF7, 0x13, 0x80, 0xC0, 0xF8, 0x03, 0x71, 0xC0, -0xF8, 0xF3, 0x62, 0xC0, 0x0D, 0x9B, 0x29, 0x10, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x26, 0xA0, 0x13, 0x44, 0x09, 0x90, -0x14, 0x34, 0x08, 0xA0, 0x15, 0x23, 0xF9, 0xA0, 0x16, 0x13, 0xEA, 0xA0, 0x17, 0x03, 0xDB, 0xA0, -0x17, 0xF3, 0xCC, 0xA0, 0x18, 0xE3, 0xCB, 0xB0, 0x19, 0xD3, 0xAE, 0xA0, 0x1A, 0xC3, 0x9F, 0xA0, -0x1B, 0xBC, 0xCB, 0x20, 0x1C, 0xAC, 0xBC, 0x20, 0x1D, 0x9C, 0xAD, 0x20, 0x1E, 0x8C, 0x9E, 0x20, -0x1F, 0x7C, 0x8F, 0x20, 0x20, 0x6C, 0x80, 0x20, 0x21, 0x5C, 0x71, 0x20, 0x22, 0x4C, 0x62, 0x20, -0x23, 0x3C, 0x53, 0x20, 0x24, 0x2C, 0x44, 0x20, 0x25, 0x1C, 0x35, 0x20, 0x26, 0x0C, 0x26, 0x20, -0x27, 0x05, 0x51, 0xA0, 0x27, 0xF5, 0x42, 0xA0, 0x28, 0xE5, 0x33, 0xA0, 0x29, 0xD5, 0x24, 0xA0, -0x2A, 0xC5, 0x15, 0xA0, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, -0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x08, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x09, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0xFF, 0xFF, 0xE5, 0x28, 0x00, 0x00, 0xFF, 0xFF, -0xF1, 0xF0, 0x01, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x0A, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x04, -0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, -0x48, 0x4D, 0x54, 0x00, 0x41, 0x5A, 0x4F, 0x53, 0x54, 0x00, 0x41, 0x5A, 0x4F, 0x54, 0x00, 0x41, -0x5A, 0x4F, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0xC2, 0xE7, 0xD5, 0x00, 0xED, 0x87, 0x4A, 0x00, 0x00, 0x00, 0x06, 0x41, 0x7A, 0x6F, -0x72, 0x65, 0x73, - -/* Atlantic/Bermuda */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xB4, 0xC3, 0x1D, 0xD8, -0x08, 0x20, 0xB3, 0x60, 0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, -0x0B, 0xE0, 0x77, 0x60, 0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, -0x0F, 0xA9, 0x75, 0xE0, 0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, -0x13, 0x69, 0x39, 0xE0, 0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, -0x17, 0x28, 0xFD, 0xE0, 0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, -0x1A, 0xF1, 0xFC, 0x60, 0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, -0x1E, 0xB1, 0xC0, 0x60, 0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, -0x22, 0x55, 0xD4, 0xE0, 0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, -0x26, 0x15, 0x98, 0xE0, 0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, -0x29, 0xDE, 0x97, 0x60, 0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, -0x2D, 0x9E, 0x5B, 0x60, 0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, -0x31, 0x67, 0x59, 0xE0, 0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, -0x35, 0x27, 0x1D, 0xE0, 0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, -0x38, 0xE6, 0xE1, 0xE0, 0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, -0x3C, 0xAF, 0xE0, 0x60, 0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, -0x40, 0x6F, 0xA4, 0x60, 0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, -0x44, 0x2F, 0x68, 0x60, 0x45, 0x44, 0x35, 0x50, 0x45, 0xF3, 0x9A, 0xE0, 0x47, 0x2D, 0x51, 0xD0, -0x47, 0xD3, 0x7C, 0xE0, 0x49, 0x0D, 0x33, 0xD0, 0x49, 0xB3, 0x5E, 0xE0, 0x4A, 0xED, 0x15, 0xD0, -0x4B, 0x9C, 0x7B, 0x60, 0x4C, 0xD6, 0x32, 0x50, 0x4D, 0x7C, 0x5D, 0x60, 0x4E, 0xB6, 0x14, 0x50, -0x4F, 0x5C, 0x3F, 0x60, 0x50, 0x95, 0xF6, 0x50, 0x51, 0x3C, 0x21, 0x60, 0x52, 0x75, 0xD8, 0x50, -0x53, 0x1C, 0x03, 0x60, 0x54, 0x55, 0xBA, 0x50, 0x54, 0xFB, 0xE5, 0x60, 0x56, 0x35, 0x9C, 0x50, -0x56, 0xE5, 0x01, 0xE0, 0x58, 0x1E, 0xB8, 0xD0, 0x58, 0xC4, 0xE3, 0xE0, 0x59, 0xFE, 0x9A, 0xD0, -0x5A, 0xA4, 0xC5, 0xE0, 0x5B, 0xDE, 0x7C, 0xD0, 0x5C, 0x84, 0xA7, 0xE0, 0x5D, 0xBE, 0x5E, 0xD0, -0x5E, 0x64, 0x89, 0xE0, 0x5F, 0x9E, 0x40, 0xD0, 0x60, 0x4D, 0xA6, 0x60, 0x61, 0x87, 0x5D, 0x50, -0x62, 0x2D, 0x88, 0x60, 0x63, 0x67, 0x3F, 0x50, 0x64, 0x0D, 0x6A, 0x60, 0x65, 0x47, 0x21, 0x50, -0x65, 0xED, 0x4C, 0x60, 0x67, 0x27, 0x03, 0x50, 0x67, 0xCD, 0x2E, 0x60, 0x69, 0x06, 0xE5, 0x50, -0x69, 0xAD, 0x10, 0x60, 0x6A, 0xE6, 0xC7, 0x50, 0x6B, 0x96, 0x2C, 0xE0, 0x6C, 0xCF, 0xE3, 0xD0, -0x6D, 0x76, 0x0E, 0xE0, 0x6E, 0xAF, 0xC5, 0xD0, 0x6F, 0x55, 0xF0, 0xE0, 0x70, 0x8F, 0xA7, 0xD0, -0x71, 0x35, 0xD2, 0xE0, 0x72, 0x6F, 0x89, 0xD0, 0x73, 0x15, 0xB4, 0xE0, 0x74, 0x4F, 0x6B, 0xD0, -0x74, 0xFE, 0xD1, 0x60, 0x76, 0x38, 0x88, 0x50, 0x76, 0xDE, 0xB3, 0x60, 0x78, 0x18, 0x6A, 0x50, -0x78, 0xBE, 0x95, 0x60, 0x79, 0xF8, 0x4C, 0x50, 0x7A, 0x9E, 0x77, 0x60, 0x7B, 0xD8, 0x2E, 0x50, -0x7C, 0x7E, 0x59, 0x60, 0x7D, 0xB8, 0x10, 0x50, 0x7E, 0x5E, 0x3B, 0x60, 0x7F, 0x97, 0xF2, 0x50, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0xFF, 0xFF, 0xC3, 0x48, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x96, 0xED, 0x00, 0xB2, 0x2B, 0xFA, 0x00, 0x00, 0x00, -0x00, - -/* Atlantic/Canary */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0xA6, 0x04, 0x5C, 0xF0, -0xD4, 0x41, 0xF7, 0x20, 0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xF1, 0x90, 0x00, 0x00, -0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, -0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x4C, 0x4D, -0x54, 0x00, 0x43, 0x41, 0x4E, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xB4, 0x34, 0xD0, -0x00, 0xFC, 0x61, 0x60, 0x00, 0x00, 0x00, 0x0E, 0x43, 0x61, 0x6E, 0x61, 0x72, 0x79, 0x20, 0x49, -0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Atlantic/Cape_Verde */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x89, 0x7F, 0x51, 0x8C, -0xCC, 0x95, 0x9C, 0x20, 0xD2, 0x74, 0x7C, 0x10, 0x0B, 0x17, 0xF7, 0x40, 0x01, 0x02, 0x01, 0x03, -0xFF, 0xFF, 0xE9, 0xF4, 0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, -0x01, 0x08, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x56, 0x54, 0x00, -0x43, 0x56, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x17, -0x12, 0x00, 0xF0, 0x59, 0xF2, 0x00, 0x00, 0x00, 0x00, - -/* Atlantic/Faeroe */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x8B, 0x6D, 0xA4, 0x58, -0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0xFF, 0xFF, 0xF9, 0xA8, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00, -0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Atlantic/Faroe */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x46, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x8B, 0x6D, 0xA4, 0x58, -0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0xFF, 0xFF, 0xF9, 0xA8, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00, -0x00, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0xE7, 0xF5, 0x82, 0x01, 0x0A, 0xAC, 0x3A, -0x00, 0x00, 0x00, 0x00, - -/* Atlantic/Jan_Mayen */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x27, 0xE3, 0x00, -0x9B, 0xD4, 0x7B, 0x60, 0xC8, 0xB7, 0x4D, 0x60, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x62, 0x07, 0x10, 0xEB, 0xAF, 0x20, 0x90, 0xEC, 0xA8, 0x4C, 0x10, 0xED, 0x98, 0x3D, 0x10, -0xEE, 0x88, 0x2E, 0x10, 0xEF, 0x78, 0x1F, 0x10, 0xF0, 0x68, 0x10, 0x10, 0xF1, 0x58, 0x01, 0x10, -0xF2, 0x47, 0xF2, 0x10, 0xF3, 0x37, 0xE3, 0x10, 0xF4, 0x27, 0xD4, 0x10, 0xF5, 0x17, 0xC5, 0x10, -0xF6, 0x10, 0xF0, 0x90, 0xF7, 0x2F, 0x06, 0x10, 0xF7, 0xF0, 0xD2, 0x90, 0x12, 0xCE, 0x97, 0xF0, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, -0x00, 0x00, - -/* Atlantic/Madeira */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0x91, 0xC1, 0xF1, 0x58, -0x9B, 0x4B, 0x7B, 0x80, 0x9B, 0xFE, 0xD5, 0x90, 0x9C, 0x9C, 0xFB, 0x80, 0x9D, 0xC9, 0x91, 0x80, -0x9E, 0x7F, 0x80, 0x80, 0x9F, 0xAA, 0xC5, 0x00, 0xA0, 0x5F, 0x62, 0x80, 0xA1, 0x8B, 0xF8, 0x80, -0xA2, 0x41, 0xE7, 0x80, 0xA3, 0x6E, 0x7D, 0x80, 0xA4, 0x23, 0x1B, 0x00, 0xA5, 0x4F, 0xB1, 0x00, -0xAA, 0x05, 0xFD, 0x80, 0xAA, 0xF4, 0x9D, 0x00, 0xAD, 0xC9, 0xB6, 0x00, 0xAE, 0xA7, 0x32, 0x00, -0xAF, 0xA0, 0x5D, 0x80, 0xB0, 0x87, 0x14, 0x00, 0xB1, 0x89, 0x7A, 0x00, 0xB2, 0x70, 0x30, 0x80, -0xB3, 0x72, 0x96, 0x80, 0xB4, 0x50, 0x12, 0x80, 0xB7, 0x32, 0x5A, 0x80, 0xB8, 0x0F, 0xD6, 0x80, -0xB8, 0xFF, 0xC7, 0x80, 0xB9, 0xEF, 0xB8, 0x80, 0xBC, 0xC8, 0xC6, 0x00, 0xBD, 0xB8, 0xB7, 0x00, -0xBE, 0x9F, 0x6D, 0x80, 0xBF, 0x98, 0x99, 0x00, 0xC0, 0x9A, 0xFF, 0x00, 0xC1, 0x78, 0x7B, 0x00, -0xC2, 0x68, 0x6C, 0x00, 0xC3, 0x58, 0x5D, 0x00, 0xC4, 0x3F, 0x13, 0x80, 0xC5, 0x38, 0x3F, 0x00, -0xC6, 0x3A, 0xA5, 0x00, 0xC7, 0x58, 0xBA, 0x80, 0xC7, 0xD9, 0xED, 0x80, 0xC9, 0x01, 0x3D, 0x80, -0xC9, 0xF1, 0x2E, 0x80, 0xCA, 0xE2, 0x71, 0x00, 0xCB, 0xB5, 0x61, 0x00, 0xCB, 0xEC, 0xB1, 0xF0, -0xCC, 0x80, 0x59, 0xF0, 0xCC, 0xDC, 0xB1, 0x00, 0xCD, 0x95, 0x43, 0x00, 0xCD, 0xC3, 0x59, 0x70, -0xCE, 0x72, 0xB0, 0xF0, 0xCE, 0xC5, 0xCD, 0x80, 0xCF, 0x75, 0x25, 0x00, 0xCF, 0xAC, 0x75, 0xF0, -0xD0, 0x52, 0x92, 0xF0, 0xD0, 0xA5, 0xAF, 0x80, 0xD1, 0x55, 0x07, 0x00, 0xD1, 0x8C, 0x57, 0xF0, -0xD2, 0x32, 0x74, 0xF0, 0xD2, 0x85, 0x91, 0x80, 0xD3, 0x59, 0xD3, 0x00, 0xD4, 0x49, 0xC4, 0x00, -0xD5, 0x39, 0xDF, 0x30, 0xD6, 0x29, 0xD0, 0x30, 0xD7, 0x19, 0xC1, 0x30, 0xD8, 0x09, 0xB2, 0x30, -0xD8, 0xF9, 0xA3, 0x30, 0xD9, 0xE9, 0x94, 0x30, 0xDC, 0xB9, 0x67, 0x30, 0xDD, 0xB2, 0x92, 0xB0, -0xDE, 0xA2, 0x83, 0xB0, 0xDF, 0x92, 0x74, 0xB0, 0xE0, 0x82, 0x65, 0xB0, 0xE1, 0x72, 0x56, 0xB0, -0xE2, 0x62, 0x47, 0xB0, 0xE3, 0x52, 0x38, 0xB0, 0xE4, 0x42, 0x29, 0xB0, 0xE5, 0x32, 0x1A, 0xB0, -0xE6, 0x22, 0x0B, 0xB0, 0xE7, 0x1B, 0x37, 0x30, 0xE8, 0x0B, 0x28, 0x30, 0xE8, 0xFB, 0x19, 0x30, -0xE9, 0xEB, 0x0A, 0x30, 0xEA, 0xDA, 0xFB, 0x30, 0xEB, 0xCA, 0xEC, 0x30, 0xEC, 0xBA, 0xDD, 0x30, -0xED, 0xAA, 0xCE, 0x30, 0xEE, 0x9A, 0xBF, 0x30, 0xEF, 0x8A, 0xB0, 0x30, 0xF0, 0x7A, 0xA1, 0x30, -0xF1, 0x6A, 0x92, 0x30, 0xF2, 0x63, 0xBD, 0xB0, 0xF3, 0x53, 0xAE, 0xB0, 0xF4, 0x43, 0x9F, 0xB0, -0xF5, 0x33, 0x90, 0xB0, 0xF6, 0x23, 0x81, 0xB0, 0xF7, 0x13, 0x72, 0xB0, 0xF8, 0x03, 0x63, 0xB0, -0xF8, 0xF3, 0x54, 0xB0, 0x0D, 0x9B, 0x1B, 0x00, 0x0E, 0x8B, 0x0C, 0x00, 0x0F, 0x84, 0x37, 0x80, -0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x18, 0x90, 0x13, 0x43, 0xFB, 0x80, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xBD, 0xA0, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, -0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x08, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0xFF, 0xFF, 0xF0, 0x28, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, -0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x0A, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0F, 0x00, 0x00, 0x0E, 0x10, -0x01, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x15, 0x46, 0x4D, 0x54, 0x00, 0x4D, 0x41, -0x44, 0x53, 0x54, 0x00, 0x4D, 0x41, 0x44, 0x54, 0x00, 0x4D, 0x41, 0x44, 0x4D, 0x54, 0x00, 0x57, -0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xBB, -0x1F, 0xA5, 0x00, 0xFB, 0x9E, 0x10, 0x00, 0x00, 0x00, 0x0F, 0x4D, 0x61, 0x64, 0x65, 0x69, 0x72, -0x61, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Atlantic/Reykjavik */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x8B, 0x60, 0x83, 0x94, -0x9C, 0x91, 0x1E, 0x00, 0x9D, 0xD1, 0x88, 0x90, 0x9E, 0x72, 0x51, 0x80, 0x9F, 0xD5, 0x03, 0x10, -0xC6, 0x4D, 0x1A, 0x00, 0xC7, 0x66, 0x05, 0xA0, 0xC7, 0xDA, 0x17, 0xB0, 0xC9, 0x26, 0x43, 0xA0, -0xC9, 0xC3, 0x26, 0x20, 0xCB, 0x06, 0x25, 0xA0, 0xCB, 0xAC, 0x42, 0xA0, 0xCC, 0xDC, 0xCD, 0x20, -0xCD, 0x8C, 0x24, 0xA0, 0xCE, 0xBC, 0xAF, 0x20, 0xCF, 0x6C, 0x06, 0xA0, 0xD0, 0x9C, 0x91, 0x20, -0xD1, 0x4B, 0xE8, 0xA0, 0xD2, 0x85, 0xAD, 0xA0, 0xD3, 0x2B, 0xCA, 0xA0, 0xD4, 0x65, 0x8F, 0xA0, -0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x45, 0x71, 0xA0, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x25, 0x53, 0xA0, -0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xD9, 0x77, 0x20, 0xDB, 0xE5, 0x17, 0xA0, -0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xCE, 0x34, 0x20, 0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0xAE, 0x16, 0x20, -0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x8D, 0xF8, 0x20, 0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x6D, 0xDA, 0x20, -0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x4D, 0xBC, 0x20, 0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x36, 0xD8, 0xA0, -0xE8, 0x0B, 0x1A, 0x20, 0xE9, 0x16, 0xBA, 0xA0, 0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xF6, 0x9C, 0xA0, -0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xD6, 0x7E, 0xA0, 0xED, 0xAA, 0xC0, 0x20, 0xEE, 0xB6, 0x60, 0xA0, -0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x96, 0x42, 0xA0, 0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x7F, 0x5F, 0x20, -0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x3F, 0x23, 0x20, -0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xF3, 0x46, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, -0xFA, 0xD3, 0x28, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0xBC, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0xFF, 0xFF, 0xEB, 0x6C, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, -0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, -0x52, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x53, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEB, 0x36, -0xD8, 0x00, 0xF3, 0xE9, 0x68, 0x00, 0x00, 0x00, 0x00, - -/* Atlantic/South_Georgia */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, -0x00, 0x00, 0x47, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x37, 0x56, 0xAA, 0x00, 0xDC, 0x8A, 0x55, -0x00, 0x00, 0x00, 0x00, - -/* Atlantic/Stanley */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x46, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x93, 0x44, 0x5F, 0x3C, -0xC3, 0x4F, 0x5A, 0xC0, 0xC4, 0x36, 0x03, 0x30, 0xC5, 0x2F, 0x3C, 0xC0, 0xC6, 0x15, 0xE5, 0x30, -0xC7, 0x18, 0x59, 0x40, 0xC7, 0xFF, 0x01, 0xB0, 0xC8, 0xF8, 0x3B, 0x40, 0xC9, 0xDE, 0xE3, 0xB0, -0xCA, 0xD8, 0x1D, 0x40, 0xCB, 0xBE, 0xC5, 0xB0, 0xCC, 0xB7, 0xFF, 0x40, 0xCD, 0x36, 0x81, 0x30, -0x19, 0x11, 0xFE, 0x40, 0x19, 0xD3, 0xBC, 0xB0, 0x1A, 0xF1, 0xC4, 0x20, 0x1B, 0xAA, 0x64, 0x30, -0x1C, 0xD1, 0xA6, 0x20, 0x1D, 0x8A, 0x46, 0x30, 0x1E, 0xA8, 0x5B, 0xB0, 0x1F, 0x6A, 0x36, 0x40, -0x20, 0x88, 0x3D, 0xB0, 0x21, 0x4A, 0x18, 0x40, 0x22, 0x68, 0x1F, 0xB0, 0x23, 0x29, 0xFA, 0x40, -0x24, 0x48, 0x01, 0xB0, 0x25, 0x09, 0xDC, 0x40, 0x26, 0x31, 0x1E, 0x30, 0x26, 0xE9, 0xBE, 0x40, -0x28, 0x11, 0x00, 0x30, 0x28, 0xD2, 0xDA, 0xC0, 0x29, 0xF0, 0xE2, 0x30, 0x2A, 0xB2, 0xBC, 0xC0, -0x2B, 0xD0, 0xC4, 0x30, 0x2C, 0x92, 0x9E, 0xC0, 0x2D, 0xB0, 0xA6, 0x30, 0x2E, 0x72, 0x80, 0xC0, -0x2F, 0x90, 0x88, 0x30, 0x30, 0x52, 0x62, 0xC0, 0x31, 0x79, 0xA4, 0xB0, 0x32, 0x3B, 0x7F, 0x40, -0x33, 0x59, 0x86, 0xB0, 0x34, 0x1B, 0x61, 0x40, 0x35, 0x39, 0x68, 0xB0, 0x35, 0xFB, 0x43, 0x40, -0x37, 0x19, 0x4A, 0xB0, 0x37, 0xDB, 0x25, 0x40, 0x38, 0xF9, 0x2C, 0xB0, 0x39, 0xBB, 0x07, 0x40, -0x3A, 0xD9, 0x2A, 0xD0, 0x3B, 0x91, 0xCA, 0xE0, 0x3C, 0xC2, 0x47, 0x50, 0x3D, 0x71, 0xAC, 0xE0, -0x3E, 0xA2, 0x29, 0x50, 0x3F, 0x5A, 0xC9, 0x60, 0x40, 0x82, 0x0B, 0x50, 0x41, 0x3A, 0xAB, 0x60, -0x42, 0x61, 0xED, 0x50, 0x43, 0x1A, 0x8D, 0x60, 0x44, 0x41, 0xCF, 0x50, 0x44, 0xFA, 0x6F, 0x60, -0x46, 0x21, 0xB1, 0x50, 0x46, 0xDA, 0x51, 0x60, 0x48, 0x0A, 0xCD, 0xD0, 0x48, 0xC3, 0x6D, 0xE0, -0x49, 0xEA, 0xAF, 0xD0, 0x4A, 0xA3, 0x4F, 0xE0, 0x4B, 0xCA, 0x91, 0xD0, 0x4C, 0x83, 0x31, 0xE0, -0x4D, 0xAA, 0x73, 0xD0, 0x4E, 0x63, 0x13, 0xE0, 0x4F, 0x8A, 0x55, 0xD0, 0x50, 0x42, 0xF5, 0xE0, -0x51, 0x73, 0x72, 0x50, 0x52, 0x22, 0xD7, 0xE0, 0x53, 0x53, 0x54, 0x50, 0x54, 0x0B, 0xF4, 0x60, -0x55, 0x33, 0x36, 0x50, 0x55, 0xEB, 0xD6, 0x60, 0x57, 0x13, 0x18, 0x50, 0x57, 0xCB, 0xB8, 0x60, -0x58, 0xF2, 0xFA, 0x50, 0x59, 0xAB, 0x9A, 0x60, 0x5A, 0xD2, 0xDC, 0x50, 0x5B, 0x8B, 0x7C, 0x60, -0x5C, 0xBB, 0xF8, 0xD0, 0x5D, 0x6B, 0x5E, 0x60, 0x5E, 0x9B, 0xDA, 0xD0, 0x5F, 0x54, 0x7A, 0xE0, -0x60, 0x7B, 0xBC, 0xD0, 0x61, 0x34, 0x5C, 0xE0, 0x62, 0x5B, 0x9E, 0xD0, 0x63, 0x14, 0x3E, 0xE0, -0x64, 0x3B, 0x80, 0xD0, 0x64, 0xF4, 0x20, 0xE0, 0x66, 0x24, 0x9D, 0x50, 0x66, 0xD4, 0x02, 0xE0, -0x68, 0x04, 0x7F, 0x50, 0x68, 0xBD, 0x1F, 0x60, 0x69, 0xE4, 0x61, 0x50, 0x6A, 0x9D, 0x01, 0x60, -0x6B, 0xC4, 0x43, 0x50, 0x6C, 0x7C, 0xE3, 0x60, 0x6D, 0xA4, 0x25, 0x50, 0x6E, 0x5C, 0xC5, 0x60, -0x6F, 0x84, 0x07, 0x50, 0x70, 0x3C, 0xA7, 0x60, 0x71, 0x6D, 0x23, 0xD0, 0x72, 0x1C, 0x89, 0x60, -0x73, 0x4D, 0x05, 0xD0, 0x74, 0x05, 0xA5, 0xE0, 0x75, 0x2C, 0xE7, 0xD0, 0x75, 0xE5, 0x87, 0xE0, -0x77, 0x0C, 0xC9, 0xD0, 0x77, 0xC5, 0x69, 0xE0, 0x78, 0xEC, 0xAB, 0xD0, 0x79, 0xA5, 0x4B, 0xE0, -0x7A, 0xCC, 0x8D, 0xD0, 0x7B, 0x85, 0x2D, 0xE0, 0x7C, 0xB5, 0xAA, 0x50, 0x7D, 0x6E, 0x4A, 0x60, -0x7E, 0x95, 0x8C, 0x50, 0x7F, 0x4E, 0x2C, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0xFF, 0xFF, 0xC9, 0xC4, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, -0xFF, 0xC7, 0xC0, 0x00, 0x09, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, -0x09, 0x53, 0x4D, 0x54, 0x00, 0x46, 0x4B, 0x53, 0x54, 0x00, 0x46, 0x4B, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x93, 0xD0, 0x00, 0xBC, 0xFA, 0xE8, -0x00, 0x00, 0x00, 0x00, - -/* Atlantic/St_Helena */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDC, 0x42, 0x9B, 0x58, -0x01, 0xFF, 0xFF, 0xFA, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x4A, 0x4D, 0x54, -0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0xD6, 0xF2, 0x01, 0x0C, 0x18, -0xD0, 0x00, 0x00, 0x00, 0x00, - -/* Australia/ACT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xF7, 0xA2, 0x00, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xD7, 0x84, 0x00, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xB7, 0x66, 0x00, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x97, 0x48, 0x00, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x77, 0x2A, 0x00, 0x50, 0x70, 0x55, 0x80, 0x51, 0x60, 0x46, 0x80, 0x52, 0x50, 0x37, 0x80, -0x53, 0x40, 0x28, 0x80, 0x54, 0x30, 0x19, 0x80, 0x55, 0x20, 0x0A, 0x80, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xFF, 0xEC, 0x80, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xDF, 0xCE, 0x80, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xBF, 0xB0, 0x80, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0xA8, 0xCD, 0x00, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x88, 0xAF, 0x00, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x68, 0x91, 0x00, 0x61, 0x58, 0x82, 0x00, -0x62, 0x48, 0x73, 0x00, 0x63, 0x38, 0x64, 0x00, 0x64, 0x28, 0x55, 0x00, 0x65, 0x18, 0x46, 0x00, -0x66, 0x11, 0x71, 0x80, 0x67, 0x01, 0x62, 0x80, 0x67, 0xF1, 0x53, 0x80, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xD1, 0x35, 0x80, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xB1, 0x17, 0x80, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x90, 0xF9, 0x80, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x70, 0xDB, 0x80, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x59, 0xF8, 0x00, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x39, 0xDA, 0x00, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x19, 0xBC, 0x00, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF9, 0x9E, 0x00, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD9, 0x80, 0x00, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB9, 0x62, 0x00, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0xA2, 0x7E, 0x80, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x82, 0x60, 0x80, 0x7F, 0x72, 0x51, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Adelaide */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88, -0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88, -0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88, -0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08, -0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08, -0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08, -0x16, 0xE7, 0xA6, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88, -0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88, -0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88, -0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08, -0x26, 0x02, 0x66, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08, -0x29, 0xCB, 0x64, 0x88, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88, -0x2D, 0x8B, 0x28, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x74, 0x45, 0x08, 0x30, 0x92, 0x5A, 0x88, -0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88, -0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08, -0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, 0x3B, 0xDA, 0xE1, 0x08, -0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, 0x3F, 0x9A, 0xA5, 0x08, -0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, 0x43, 0x63, 0xA3, 0x88, -0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, 0x47, 0x23, 0x67, 0x88, -0x47, 0xF7, 0xA9, 0x08, 0x48, 0xE7, 0x9A, 0x08, 0x49, 0xD7, 0x8B, 0x08, 0x4A, 0xC7, 0x7C, 0x08, -0x4B, 0xB7, 0x6D, 0x08, 0x4C, 0xA7, 0x5E, 0x08, 0x4D, 0x97, 0x4F, 0x08, 0x4E, 0x87, 0x40, 0x08, -0x4F, 0x77, 0x31, 0x08, 0x50, 0x70, 0x5C, 0x88, 0x51, 0x60, 0x4D, 0x88, 0x52, 0x50, 0x3E, 0x88, -0x53, 0x40, 0x2F, 0x88, 0x54, 0x30, 0x20, 0x88, 0x55, 0x20, 0x11, 0x88, 0x56, 0x10, 0x02, 0x88, -0x56, 0xFF, 0xF3, 0x88, 0x57, 0xEF, 0xE4, 0x88, 0x58, 0xDF, 0xD5, 0x88, 0x59, 0xCF, 0xC6, 0x88, -0x5A, 0xBF, 0xB7, 0x88, 0x5B, 0xB8, 0xE3, 0x08, 0x5C, 0xA8, 0xD4, 0x08, 0x5D, 0x98, 0xC5, 0x08, -0x5E, 0x88, 0xB6, 0x08, 0x5F, 0x78, 0xA7, 0x08, 0x60, 0x68, 0x98, 0x08, 0x61, 0x58, 0x89, 0x08, -0x62, 0x48, 0x7A, 0x08, 0x63, 0x38, 0x6B, 0x08, 0x64, 0x28, 0x5C, 0x08, 0x65, 0x18, 0x4D, 0x08, -0x66, 0x11, 0x78, 0x88, 0x67, 0x01, 0x69, 0x88, 0x67, 0xF1, 0x5A, 0x88, 0x68, 0xE1, 0x4B, 0x88, -0x69, 0xD1, 0x3C, 0x88, 0x6A, 0xC1, 0x2D, 0x88, 0x6B, 0xB1, 0x1E, 0x88, 0x6C, 0xA1, 0x0F, 0x88, -0x6D, 0x91, 0x00, 0x88, 0x6E, 0x80, 0xF1, 0x88, 0x6F, 0x70, 0xE2, 0x88, 0x70, 0x6A, 0x0E, 0x08, -0x71, 0x59, 0xFF, 0x08, 0x72, 0x49, 0xF0, 0x08, 0x73, 0x39, 0xE1, 0x08, 0x74, 0x29, 0xD2, 0x08, -0x75, 0x19, 0xC3, 0x08, 0x76, 0x09, 0xB4, 0x08, 0x76, 0xF9, 0xA5, 0x08, 0x77, 0xE9, 0x96, 0x08, -0x78, 0xD9, 0x87, 0x08, 0x79, 0xC9, 0x78, 0x08, 0x7A, 0xB9, 0x69, 0x08, 0x7B, 0xB2, 0x94, 0x88, -0x7C, 0xA2, 0x85, 0x88, 0x7D, 0x92, 0x76, 0x88, 0x7E, 0x82, 0x67, 0x88, 0x7F, 0x72, 0x58, 0x88, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x93, -0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, -0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x56, 0xD9, 0x12, 0x01, 0xE6, 0x1E, 0x9D, 0x00, 0x00, 0x00, 0x0F, 0x53, 0x6F, 0x75, -0x74, 0x68, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6C, 0x69, 0x61, - -/* Australia/Brisbane */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x25, 0x49, 0xCD, 0x00, 0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, -0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, 0x29, 0xAF, 0xAE, 0x00, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x9A, 0xB0, -0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, -0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x60, 0xD7, 0xAA, 0x01, 0xFC, 0x2B, 0x25, 0x00, 0x00, 0x00, 0x1B, 0x51, 0x75, 0x65, 0x65, -0x6E, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, -0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* Australia/Broken_Hill */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88, -0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88, -0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88, -0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08, -0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08, -0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08, -0x17, 0x0C, 0x90, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88, -0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88, -0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88, -0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08, -0x25, 0xEF, 0xF1, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08, -0x29, 0xAF, 0xB5, 0x08, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88, -0x2D, 0x78, 0xB3, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x58, 0x95, 0x88, 0x30, 0x92, 0x5A, 0x88, -0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88, -0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08, -0x38, 0x6C, 0xAF, 0xD8, 0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, -0x3B, 0xDA, 0xE1, 0x08, 0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, -0x3F, 0x9A, 0xA5, 0x08, 0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, -0x43, 0x63, 0xA3, 0x88, 0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, -0x47, 0x23, 0x67, 0x88, 0x47, 0xF7, 0xA9, 0x08, 0x48, 0xE7, 0x9A, 0x08, 0x49, 0xD7, 0x8B, 0x08, -0x4A, 0xC7, 0x7C, 0x08, 0x4B, 0xB7, 0x6D, 0x08, 0x4C, 0xA7, 0x5E, 0x08, 0x4D, 0x97, 0x4F, 0x08, -0x4E, 0x87, 0x40, 0x08, 0x4F, 0x77, 0x31, 0x08, 0x50, 0x70, 0x5C, 0x88, 0x51, 0x60, 0x4D, 0x88, -0x52, 0x50, 0x3E, 0x88, 0x53, 0x40, 0x2F, 0x88, 0x54, 0x30, 0x20, 0x88, 0x55, 0x20, 0x11, 0x88, -0x56, 0x10, 0x02, 0x88, 0x56, 0xFF, 0xF3, 0x88, 0x57, 0xEF, 0xE4, 0x88, 0x58, 0xDF, 0xD5, 0x88, -0x59, 0xCF, 0xC6, 0x88, 0x5A, 0xBF, 0xB7, 0x88, 0x5B, 0xB8, 0xE3, 0x08, 0x5C, 0xA8, 0xD4, 0x08, -0x5D, 0x98, 0xC5, 0x08, 0x5E, 0x88, 0xB6, 0x08, 0x5F, 0x78, 0xA7, 0x08, 0x60, 0x68, 0x98, 0x08, -0x61, 0x58, 0x89, 0x08, 0x62, 0x48, 0x7A, 0x08, 0x63, 0x38, 0x6B, 0x08, 0x64, 0x28, 0x5C, 0x08, -0x65, 0x18, 0x4D, 0x08, 0x66, 0x11, 0x78, 0x88, 0x67, 0x01, 0x69, 0x88, 0x67, 0xF1, 0x5A, 0x88, -0x68, 0xE1, 0x4B, 0x88, 0x69, 0xD1, 0x3C, 0x88, 0x6A, 0xC1, 0x2D, 0x88, 0x6B, 0xB1, 0x1E, 0x88, -0x6C, 0xA1, 0x0F, 0x88, 0x6D, 0x91, 0x00, 0x88, 0x6E, 0x80, 0xF1, 0x88, 0x6F, 0x70, 0xE2, 0x88, -0x70, 0x6A, 0x0E, 0x08, 0x71, 0x59, 0xFF, 0x08, 0x72, 0x49, 0xF0, 0x08, 0x73, 0x39, 0xE1, 0x08, -0x74, 0x29, 0xD2, 0x08, 0x75, 0x19, 0xC3, 0x08, 0x76, 0x09, 0xB4, 0x08, 0x76, 0xF9, 0xA5, 0x08, -0x77, 0xE9, 0x96, 0x08, 0x78, 0xD9, 0x87, 0x08, 0x79, 0xC9, 0x78, 0x08, 0x7A, 0xB9, 0x69, 0x08, -0x7B, 0xB2, 0x94, 0x88, 0x7C, 0xA2, 0x85, 0x88, 0x7D, 0x92, 0x76, 0x88, 0x7E, 0x82, 0x67, 0x88, -0x7F, 0x72, 0x58, 0x88, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, -0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x79, 0xF8, 0x01, 0xEA, 0x7E, 0x68, 0x00, 0x00, -0x00, 0x1C, 0x4E, 0x65, 0x77, 0x20, 0x53, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x57, 0x61, 0x6C, 0x65, -0x73, 0x20, 0x2D, 0x20, 0x59, 0x61, 0x6E, 0x63, 0x6F, 0x77, 0x69, 0x6E, 0x6E, 0x61, - -/* Australia/Canberra */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xF7, 0xA2, 0x00, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xD7, 0x84, 0x00, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xB7, 0x66, 0x00, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x97, 0x48, 0x00, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x77, 0x2A, 0x00, 0x50, 0x70, 0x55, 0x80, 0x51, 0x60, 0x46, 0x80, 0x52, 0x50, 0x37, 0x80, -0x53, 0x40, 0x28, 0x80, 0x54, 0x30, 0x19, 0x80, 0x55, 0x20, 0x0A, 0x80, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xFF, 0xEC, 0x80, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xDF, 0xCE, 0x80, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xBF, 0xB0, 0x80, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0xA8, 0xCD, 0x00, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x88, 0xAF, 0x00, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x68, 0x91, 0x00, 0x61, 0x58, 0x82, 0x00, -0x62, 0x48, 0x73, 0x00, 0x63, 0x38, 0x64, 0x00, 0x64, 0x28, 0x55, 0x00, 0x65, 0x18, 0x46, 0x00, -0x66, 0x11, 0x71, 0x80, 0x67, 0x01, 0x62, 0x80, 0x67, 0xF1, 0x53, 0x80, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xD1, 0x35, 0x80, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xB1, 0x17, 0x80, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x90, 0xF9, 0x80, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x70, 0xDB, 0x80, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x59, 0xF8, 0x00, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x39, 0xDA, 0x00, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x19, 0xBC, 0x00, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF9, 0x9E, 0x00, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD9, 0x80, 0x00, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB9, 0x62, 0x00, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0xA2, 0x7E, 0x80, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x82, 0x60, 0x80, 0x7F, 0x72, 0x51, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Currie */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9B, 0xD5, 0x78, 0x80, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x03, 0x4F, 0x00, 0x18, 0x21, 0x64, 0x80, 0x18, 0xE3, 0x31, 0x00, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x67, 0x27, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xED, 0xE1, 0x80, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xCD, 0xC3, 0x80, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xAD, 0xA5, 0x80, -0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x8D, 0x87, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x6D, 0x69, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x56, 0x86, 0x00, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x36, 0x68, 0x00, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x16, 0x4A, 0x00, 0x36, 0xFD, 0x00, 0x80, 0x37, 0xF6, 0x2C, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xBF, 0x2A, 0x80, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0x9F, 0x0C, 0x80, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x7E, 0xEE, 0x80, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x5E, 0xD0, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x3E, 0xB2, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x1E, 0x94, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x07, 0xB1, 0x00, -0x47, 0xF7, 0xA2, 0x00, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xD7, 0x84, 0x00, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xB7, 0x66, 0x00, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x97, 0x48, 0x00, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x77, 0x2A, 0x00, 0x50, 0x70, 0x55, 0x80, 0x51, 0x60, 0x46, 0x80, 0x52, 0x50, 0x37, 0x80, -0x53, 0x40, 0x28, 0x80, 0x54, 0x30, 0x19, 0x80, 0x55, 0x20, 0x0A, 0x80, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xFF, 0xEC, 0x80, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xDF, 0xCE, 0x80, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xBF, 0xB0, 0x80, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0xA8, 0xCD, 0x00, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x88, 0xAF, 0x00, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x68, 0x91, 0x00, 0x61, 0x58, 0x82, 0x00, -0x62, 0x48, 0x73, 0x00, 0x63, 0x38, 0x64, 0x00, 0x64, 0x28, 0x55, 0x00, 0x65, 0x18, 0x46, 0x00, -0x66, 0x11, 0x71, 0x80, 0x67, 0x01, 0x62, 0x80, 0x67, 0xF1, 0x53, 0x80, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xD1, 0x35, 0x80, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xB1, 0x17, 0x80, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x90, 0xF9, 0x80, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x70, 0xDB, 0x80, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x59, 0xF8, 0x00, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x39, 0xDA, 0x00, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x19, 0xBC, 0x00, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF9, 0x9E, 0x00, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD9, 0x80, 0x00, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB9, 0x62, 0x00, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0xA2, 0x7E, 0x80, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x82, 0x60, 0x80, 0x7F, 0x72, 0x51, 0x80, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x8C, -0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x4F, 0x3E, 0x75, 0x01, 0xEE, 0x2E, 0x6A, 0x00, 0x00, 0x00, 0x16, 0x54, 0x61, 0x73, -0x6D, 0x61, 0x6E, 0x69, 0x61, 0x20, 0x2D, 0x20, 0x4B, 0x69, 0x6E, 0x67, 0x20, 0x49, 0x73, 0x6C, -0x61, 0x6E, 0x64, - -/* Australia/Darwin */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, -0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0xBB, 0x0A, 0x01, 0xDA, 0x4B, 0x45, -0x00, 0x00, 0x00, 0x12, 0x4E, 0x6F, 0x72, 0x74, 0x68, 0x65, 0x72, 0x6E, 0x20, 0x54, 0x65, 0x72, -0x72, 0x69, 0x74, 0x6F, 0x72, 0x79, - -/* Australia/Eucla */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x9C, 0x4E, 0xB8, 0x30, -0x9C, 0xBC, 0x32, 0x84, 0xCB, 0x54, 0xC4, 0x94, 0xCB, 0xC7, 0x69, 0x04, 0xCC, 0xB7, 0x68, 0x14, -0xCD, 0xA7, 0x4B, 0x04, 0x09, 0x0F, 0xF1, 0x14, 0x09, 0xB6, 0x0E, 0x14, 0x1A, 0x01, 0x58, 0x14, -0x1A, 0xA7, 0x75, 0x14, 0x29, 0x25, 0x52, 0x14, 0x29, 0xAF, 0xBF, 0x94, 0x45, 0x71, 0xB4, 0x94, -0x46, 0x05, 0x5C, 0x94, 0x47, 0x23, 0x72, 0x14, 0x47, 0xEE, 0x79, 0x14, 0x49, 0x03, 0x54, 0x14, -0x49, 0xCE, 0x5B, 0x14, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x89, 0x1C, 0x01, 0x00, 0x00, 0x00, 0x7B, 0x0C, -0x00, 0x00, 0x00, 0x00, 0x89, 0x1C, 0x01, 0x00, 0x00, 0x00, 0x7B, 0x0C, 0x00, 0x00, 0x43, 0x57, -0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x1E, 0xD2, 0x01, -0xD7, 0x4B, 0x0A, 0x00, 0x00, 0x00, 0x1E, 0x57, 0x65, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x41, -0x75, 0x73, 0x74, 0x72, 0x61, 0x6C, 0x69, 0x61, 0x20, 0x2D, 0x20, 0x45, 0x75, 0x63, 0x6C, 0x61, -0x20, 0x61, 0x72, 0x65, 0x61, - -/* Australia/Hobart */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9B, 0xD5, 0x78, 0x80, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0xFB, 0xC2, 0x8D, 0x00, -0xFC, 0xB2, 0x7E, 0x00, 0xFD, 0xC7, 0x59, 0x00, 0xFE, 0x76, 0xB0, 0x80, 0xFF, 0xA7, 0x3B, 0x00, -0x00, 0x56, 0x92, 0x80, 0x01, 0x87, 0x1D, 0x00, 0x02, 0x3F, 0xAF, 0x00, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x03, 0x4F, 0x00, 0x18, 0x21, 0x64, 0x80, 0x18, 0xE3, 0x31, 0x00, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x67, 0x27, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xED, 0xE1, 0x80, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xCD, 0xC3, 0x80, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xAD, 0xA5, 0x80, -0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x8D, 0x87, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x6D, 0x69, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x56, 0x86, 0x00, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x36, 0x68, 0x00, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x16, 0x4A, 0x00, 0x36, 0xFD, 0x00, 0x80, 0x37, 0xF6, 0x2C, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xBF, 0x2A, 0x80, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0x9F, 0x0C, 0x80, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x7E, 0xEE, 0x80, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x5E, 0xD0, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x3E, 0xB2, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x1E, 0x94, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x07, 0xB1, 0x00, -0x47, 0xF7, 0xA2, 0x00, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xD7, 0x84, 0x00, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xB7, 0x66, 0x00, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x97, 0x48, 0x00, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x77, 0x2A, 0x00, 0x50, 0x70, 0x55, 0x80, 0x51, 0x60, 0x46, 0x80, 0x52, 0x50, 0x37, 0x80, -0x53, 0x40, 0x28, 0x80, 0x54, 0x30, 0x19, 0x80, 0x55, 0x20, 0x0A, 0x80, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xFF, 0xEC, 0x80, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xDF, 0xCE, 0x80, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xBF, 0xB0, 0x80, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0xA8, 0xCD, 0x00, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x88, 0xAF, 0x00, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x68, 0x91, 0x00, 0x61, 0x58, 0x82, 0x00, -0x62, 0x48, 0x73, 0x00, 0x63, 0x38, 0x64, 0x00, 0x64, 0x28, 0x55, 0x00, 0x65, 0x18, 0x46, 0x00, -0x66, 0x11, 0x71, 0x80, 0x67, 0x01, 0x62, 0x80, 0x67, 0xF1, 0x53, 0x80, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xD1, 0x35, 0x80, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xB1, 0x17, 0x80, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x90, 0xF9, 0x80, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x70, 0xDB, 0x80, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x59, 0xF8, 0x00, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x39, 0xDA, 0x00, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x19, 0xBC, 0x00, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF9, 0x9E, 0x00, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD9, 0x80, 0x00, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB9, 0x62, 0x00, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0xA2, 0x7E, 0x80, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x82, 0x60, 0x80, 0x7F, 0x72, 0x51, 0x80, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, -0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4A, 0x97, 0x0D, 0x01, 0xF3, 0x72, -0x12, 0x00, 0x00, 0x00, 0x19, 0x54, 0x61, 0x73, 0x6D, 0x61, 0x6E, 0x69, 0x61, 0x20, 0x2D, 0x20, -0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* Australia/LHI */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x14, 0xFE, 0x66, 0xE0, -0x16, 0x38, 0x40, 0xF8, 0x16, 0xE7, 0x8A, 0x68, 0x18, 0x21, 0x5D, 0x78, 0x18, 0xC7, 0x6C, 0x68, -0x1A, 0x01, 0x3F, 0x78, 0x1A, 0xA7, 0x4E, 0x68, 0x1B, 0xE1, 0x21, 0x78, 0x1C, 0x87, 0x30, 0x68, -0x1D, 0xC1, 0x03, 0x78, 0x1E, 0x79, 0x8E, 0x70, 0x1F, 0x97, 0xAA, 0xF8, 0x20, 0x59, 0x70, 0x70, -0x21, 0x80, 0xC7, 0x78, 0x22, 0x42, 0x8C, 0xF0, 0x23, 0x69, 0xE3, 0xF8, 0x24, 0x22, 0x6E, 0xF0, -0x25, 0x49, 0xC5, 0xF8, 0x25, 0xEF, 0xDB, 0xF0, 0x27, 0x29, 0xA7, 0xF8, 0x27, 0xCF, 0xBD, 0xF0, -0x29, 0x09, 0x89, 0xF8, 0x29, 0xAF, 0x9F, 0xF0, 0x2A, 0xE9, 0x6B, 0xF8, 0x2B, 0x98, 0xBC, 0x70, -0x2C, 0xD2, 0x88, 0x78, 0x2D, 0x78, 0x9E, 0x70, 0x2E, 0xB2, 0x6A, 0x78, 0x2F, 0x58, 0x80, 0x70, -0x30, 0x92, 0x4C, 0x78, 0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x2E, 0x78, 0x33, 0x3D, 0x2E, 0x70, -0x34, 0x52, 0x10, 0x78, 0x35, 0x1D, 0x10, 0x70, 0x36, 0x31, 0xF2, 0x78, 0x36, 0xFC, 0xF2, 0x70, -0x38, 0x1B, 0x0E, 0xF8, 0x38, 0xDC, 0xD4, 0x70, 0x39, 0xA7, 0xE2, 0x78, 0x3A, 0xBC, 0xB6, 0x70, -0x3B, 0xDA, 0xD2, 0xF8, 0x3C, 0xA5, 0xD2, 0xF0, 0x3D, 0xBA, 0xB4, 0xF8, 0x3E, 0x85, 0xB4, 0xF0, -0x3F, 0x9A, 0x96, 0xF8, 0x40, 0x65, 0x96, 0xF0, 0x41, 0x83, 0xB3, 0x78, 0x42, 0x45, 0x78, 0xF0, -0x43, 0x63, 0x95, 0x78, 0x44, 0x2E, 0x95, 0x70, 0x45, 0x43, 0x77, 0x78, 0x46, 0x05, 0x3C, 0xF0, -0x47, 0x23, 0x59, 0x78, 0x47, 0xF7, 0x93, 0xF0, 0x48, 0xE7, 0x8B, 0xF8, 0x49, 0xD7, 0x75, 0xF0, -0x4A, 0xC7, 0x6D, 0xF8, 0x4B, 0xB7, 0x57, 0xF0, 0x4C, 0xA7, 0x4F, 0xF8, 0x4D, 0x97, 0x39, 0xF0, -0x4E, 0x87, 0x31, 0xF8, 0x4F, 0x77, 0x1B, 0xF0, 0x50, 0x70, 0x4E, 0x78, 0x51, 0x60, 0x38, 0x70, -0x52, 0x50, 0x30, 0x78, 0x53, 0x40, 0x1A, 0x70, 0x54, 0x30, 0x12, 0x78, 0x55, 0x1F, 0xFC, 0x70, -0x56, 0x0F, 0xF4, 0x78, 0x56, 0xFF, 0xDE, 0x70, 0x57, 0xEF, 0xD6, 0x78, 0x58, 0xDF, 0xC0, 0x70, -0x59, 0xCF, 0xB8, 0x78, 0x5A, 0xBF, 0xA2, 0x70, 0x5B, 0xB8, 0xD4, 0xF8, 0x5C, 0xA8, 0xBE, 0xF0, -0x5D, 0x98, 0xB6, 0xF8, 0x5E, 0x88, 0xA0, 0xF0, 0x5F, 0x78, 0x98, 0xF8, 0x60, 0x68, 0x82, 0xF0, -0x61, 0x58, 0x7A, 0xF8, 0x62, 0x48, 0x64, 0xF0, 0x63, 0x38, 0x5C, 0xF8, 0x64, 0x28, 0x46, 0xF0, -0x65, 0x18, 0x3E, 0xF8, 0x66, 0x11, 0x63, 0x70, 0x67, 0x01, 0x5B, 0x78, 0x67, 0xF1, 0x45, 0x70, -0x68, 0xE1, 0x3D, 0x78, 0x69, 0xD1, 0x27, 0x70, 0x6A, 0xC1, 0x1F, 0x78, 0x6B, 0xB1, 0x09, 0x70, -0x6C, 0xA1, 0x01, 0x78, 0x6D, 0x90, 0xEB, 0x70, 0x6E, 0x80, 0xE3, 0x78, 0x6F, 0x70, 0xCD, 0x70, -0x70, 0x69, 0xFF, 0xF8, 0x71, 0x59, 0xE9, 0xF0, 0x72, 0x49, 0xE1, 0xF8, 0x73, 0x39, 0xCB, 0xF0, -0x74, 0x29, 0xC3, 0xF8, 0x75, 0x19, 0xAD, 0xF0, 0x76, 0x09, 0xA5, 0xF8, 0x76, 0xF9, 0x8F, 0xF0, -0x77, 0xE9, 0x87, 0xF8, 0x78, 0xD9, 0x71, 0xF0, 0x79, 0xC9, 0x69, 0xF8, 0x7A, 0xB9, 0x53, 0xF0, -0x7B, 0xB2, 0x86, 0x78, 0x7C, 0xA2, 0x70, 0x70, 0x7D, 0x92, 0x68, 0x78, 0x7E, 0x82, 0x52, 0x70, -0x7F, 0x72, 0x4A, 0x78, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, -0x01, 0x04, 0x00, 0x00, 0x93, 0xA8, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x04, 0x45, 0x53, -0x54, 0x00, 0x4C, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Lindeman */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x25, 0x49, 0xCD, 0x00, 0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, -0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, 0x29, 0xAF, 0xAE, 0x00, 0x2A, 0x50, 0x68, 0xE0, -0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, 0x2D, 0x78, 0xAC, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x01, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, -0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6B, 0x37, 0xEA, 0x01, 0xF6, 0x03, -0xA0, 0x00, 0x00, 0x00, 0x1C, 0x51, 0x75, 0x65, 0x65, 0x6E, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x20, -0x2D, 0x20, 0x48, 0x6F, 0x6C, 0x69, 0x64, 0x61, 0x79, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, -0x73, - -/* Australia/Lord_Howe */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x14, 0xFE, 0x66, 0xE0, -0x16, 0x38, 0x40, 0xF8, 0x16, 0xE7, 0x8A, 0x68, 0x18, 0x21, 0x5D, 0x78, 0x18, 0xC7, 0x6C, 0x68, -0x1A, 0x01, 0x3F, 0x78, 0x1A, 0xA7, 0x4E, 0x68, 0x1B, 0xE1, 0x21, 0x78, 0x1C, 0x87, 0x30, 0x68, -0x1D, 0xC1, 0x03, 0x78, 0x1E, 0x79, 0x8E, 0x70, 0x1F, 0x97, 0xAA, 0xF8, 0x20, 0x59, 0x70, 0x70, -0x21, 0x80, 0xC7, 0x78, 0x22, 0x42, 0x8C, 0xF0, 0x23, 0x69, 0xE3, 0xF8, 0x24, 0x22, 0x6E, 0xF0, -0x25, 0x49, 0xC5, 0xF8, 0x25, 0xEF, 0xDB, 0xF0, 0x27, 0x29, 0xA7, 0xF8, 0x27, 0xCF, 0xBD, 0xF0, -0x29, 0x09, 0x89, 0xF8, 0x29, 0xAF, 0x9F, 0xF0, 0x2A, 0xE9, 0x6B, 0xF8, 0x2B, 0x98, 0xBC, 0x70, -0x2C, 0xD2, 0x88, 0x78, 0x2D, 0x78, 0x9E, 0x70, 0x2E, 0xB2, 0x6A, 0x78, 0x2F, 0x58, 0x80, 0x70, -0x30, 0x92, 0x4C, 0x78, 0x31, 0x5D, 0x4C, 0x70, 0x32, 0x72, 0x2E, 0x78, 0x33, 0x3D, 0x2E, 0x70, -0x34, 0x52, 0x10, 0x78, 0x35, 0x1D, 0x10, 0x70, 0x36, 0x31, 0xF2, 0x78, 0x36, 0xFC, 0xF2, 0x70, -0x38, 0x1B, 0x0E, 0xF8, 0x38, 0xDC, 0xD4, 0x70, 0x39, 0xA7, 0xE2, 0x78, 0x3A, 0xBC, 0xB6, 0x70, -0x3B, 0xDA, 0xD2, 0xF8, 0x3C, 0xA5, 0xD2, 0xF0, 0x3D, 0xBA, 0xB4, 0xF8, 0x3E, 0x85, 0xB4, 0xF0, -0x3F, 0x9A, 0x96, 0xF8, 0x40, 0x65, 0x96, 0xF0, 0x41, 0x83, 0xB3, 0x78, 0x42, 0x45, 0x78, 0xF0, -0x43, 0x63, 0x95, 0x78, 0x44, 0x2E, 0x95, 0x70, 0x45, 0x43, 0x77, 0x78, 0x46, 0x05, 0x3C, 0xF0, -0x47, 0x23, 0x59, 0x78, 0x47, 0xF7, 0x93, 0xF0, 0x48, 0xE7, 0x8B, 0xF8, 0x49, 0xD7, 0x75, 0xF0, -0x4A, 0xC7, 0x6D, 0xF8, 0x4B, 0xB7, 0x57, 0xF0, 0x4C, 0xA7, 0x4F, 0xF8, 0x4D, 0x97, 0x39, 0xF0, -0x4E, 0x87, 0x31, 0xF8, 0x4F, 0x77, 0x1B, 0xF0, 0x50, 0x70, 0x4E, 0x78, 0x51, 0x60, 0x38, 0x70, -0x52, 0x50, 0x30, 0x78, 0x53, 0x40, 0x1A, 0x70, 0x54, 0x30, 0x12, 0x78, 0x55, 0x1F, 0xFC, 0x70, -0x56, 0x0F, 0xF4, 0x78, 0x56, 0xFF, 0xDE, 0x70, 0x57, 0xEF, 0xD6, 0x78, 0x58, 0xDF, 0xC0, 0x70, -0x59, 0xCF, 0xB8, 0x78, 0x5A, 0xBF, 0xA2, 0x70, 0x5B, 0xB8, 0xD4, 0xF8, 0x5C, 0xA8, 0xBE, 0xF0, -0x5D, 0x98, 0xB6, 0xF8, 0x5E, 0x88, 0xA0, 0xF0, 0x5F, 0x78, 0x98, 0xF8, 0x60, 0x68, 0x82, 0xF0, -0x61, 0x58, 0x7A, 0xF8, 0x62, 0x48, 0x64, 0xF0, 0x63, 0x38, 0x5C, 0xF8, 0x64, 0x28, 0x46, 0xF0, -0x65, 0x18, 0x3E, 0xF8, 0x66, 0x11, 0x63, 0x70, 0x67, 0x01, 0x5B, 0x78, 0x67, 0xF1, 0x45, 0x70, -0x68, 0xE1, 0x3D, 0x78, 0x69, 0xD1, 0x27, 0x70, 0x6A, 0xC1, 0x1F, 0x78, 0x6B, 0xB1, 0x09, 0x70, -0x6C, 0xA1, 0x01, 0x78, 0x6D, 0x90, 0xEB, 0x70, 0x6E, 0x80, 0xE3, 0x78, 0x6F, 0x70, 0xCD, 0x70, -0x70, 0x69, 0xFF, 0xF8, 0x71, 0x59, 0xE9, 0xF0, 0x72, 0x49, 0xE1, 0xF8, 0x73, 0x39, 0xCB, 0xF0, -0x74, 0x29, 0xC3, 0xF8, 0x75, 0x19, 0xAD, 0xF0, 0x76, 0x09, 0xA5, 0xF8, 0x76, 0xF9, 0x8F, 0xF0, -0x77, 0xE9, 0x87, 0xF8, 0x78, 0xD9, 0x71, 0xF0, 0x79, 0xC9, 0x69, 0xF8, 0x7A, 0xB9, 0x53, 0xF0, -0x7B, 0xB2, 0x86, 0x78, 0x7C, 0xA2, 0x70, 0x70, 0x7D, 0x92, 0x68, 0x78, 0x7E, 0x82, 0x52, 0x70, -0x7F, 0x72, 0x4A, 0x78, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, -0x01, 0x04, 0x00, 0x00, 0x93, 0xA8, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x04, 0x45, 0x53, -0x54, 0x00, 0x4C, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x5A, 0xDD, 0xB8, 0x02, 0x05, 0x66, 0x6D, 0x00, 0x00, 0x00, 0x10, 0x4C, 0x6F, 0x72, 0x64, 0x20, -0x48, 0x6F, 0x77, 0x65, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, - -/* Australia/Melbourne */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x16, 0xE7, 0x9F, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x77, 0x94, 0x00, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xF7, 0xA2, 0x00, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xD7, 0x84, 0x00, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xB7, 0x66, 0x00, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x97, 0x48, 0x00, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x77, 0x2A, 0x00, 0x50, 0x70, 0x55, 0x80, 0x51, 0x60, 0x46, 0x80, 0x52, 0x50, 0x37, 0x80, -0x53, 0x40, 0x28, 0x80, 0x54, 0x30, 0x19, 0x80, 0x55, 0x20, 0x0A, 0x80, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xFF, 0xEC, 0x80, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xDF, 0xCE, 0x80, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xBF, 0xB0, 0x80, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0xA8, 0xCD, 0x00, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x88, 0xAF, 0x00, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x68, 0x91, 0x00, 0x61, 0x58, 0x82, 0x00, -0x62, 0x48, 0x73, 0x00, 0x63, 0x38, 0x64, 0x00, 0x64, 0x28, 0x55, 0x00, 0x65, 0x18, 0x46, 0x00, -0x66, 0x11, 0x71, 0x80, 0x67, 0x01, 0x62, 0x80, 0x67, 0xF1, 0x53, 0x80, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xD1, 0x35, 0x80, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xB1, 0x17, 0x80, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x90, 0xF9, 0x80, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x70, 0xDB, 0x80, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x59, 0xF8, 0x00, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x39, 0xDA, 0x00, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x19, 0xBC, 0x00, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF9, 0x9E, 0x00, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD9, 0x80, 0x00, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB9, 0x62, 0x00, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0xA2, 0x7E, 0x80, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x82, 0x60, 0x80, 0x7F, 0x72, 0x51, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x52, 0x1E, 0x22, 0x01, 0xEF, 0xDC, 0x1A, 0x00, 0x00, 0x00, 0x08, 0x56, 0x69, 0x63, -0x74, 0x6F, 0x72, 0x69, 0x61, - -/* Australia/North */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, -0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Australia/NSW */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xF7, 0xA2, 0x00, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xD7, 0x84, 0x00, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xB7, 0x66, 0x00, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x97, 0x48, 0x00, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x77, 0x2A, 0x00, 0x50, 0x70, 0x55, 0x80, 0x51, 0x60, 0x46, 0x80, 0x52, 0x50, 0x37, 0x80, -0x53, 0x40, 0x28, 0x80, 0x54, 0x30, 0x19, 0x80, 0x55, 0x20, 0x0A, 0x80, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xFF, 0xEC, 0x80, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xDF, 0xCE, 0x80, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xBF, 0xB0, 0x80, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0xA8, 0xCD, 0x00, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x88, 0xAF, 0x00, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x68, 0x91, 0x00, 0x61, 0x58, 0x82, 0x00, -0x62, 0x48, 0x73, 0x00, 0x63, 0x38, 0x64, 0x00, 0x64, 0x28, 0x55, 0x00, 0x65, 0x18, 0x46, 0x00, -0x66, 0x11, 0x71, 0x80, 0x67, 0x01, 0x62, 0x80, 0x67, 0xF1, 0x53, 0x80, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xD1, 0x35, 0x80, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xB1, 0x17, 0x80, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x90, 0xF9, 0x80, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x70, 0xDB, 0x80, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x59, 0xF8, 0x00, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x39, 0xDA, 0x00, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x19, 0xBC, 0x00, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF9, 0x9E, 0x00, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD9, 0x80, 0x00, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB9, 0x62, 0x00, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0xA2, 0x7E, 0x80, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x82, 0x60, 0x80, 0x7F, 0x72, 0x51, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Perth */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xC2, 0xBC, -0x9C, 0xBC, 0x3D, 0x10, 0xCB, 0x54, 0xCF, 0x20, 0xCB, 0xC7, 0x73, 0x90, 0xCC, 0xB7, 0x72, 0xA0, -0xCD, 0xA7, 0x55, 0x90, 0x09, 0x0F, 0xFB, 0xA0, 0x09, 0xB6, 0x18, 0xA0, 0x1A, 0x01, 0x62, 0xA0, -0x1A, 0xA7, 0x7F, 0xA0, 0x29, 0x25, 0x5C, 0xA0, 0x29, 0xAF, 0xCA, 0x20, 0x45, 0x71, 0xBF, 0x20, -0x46, 0x05, 0x67, 0x20, 0x47, 0x23, 0x7C, 0xA0, 0x47, 0xEE, 0x83, 0xA0, 0x49, 0x03, 0x5E, 0xA0, -0x49, 0xCE, 0x65, 0xA0, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, -0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x57, 0x53, -0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5B, 0x79, 0xF8, 0x01, 0xC3, -0x6E, 0x68, 0x00, 0x00, 0x00, 0x22, 0x57, 0x65, 0x73, 0x74, 0x65, 0x72, 0x6E, 0x20, 0x41, 0x75, -0x73, 0x74, 0x72, 0x61, 0x6C, 0x69, 0x61, 0x20, 0x2D, 0x20, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, -0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* Australia/Queensland */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x25, 0x49, 0xCD, 0x00, 0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, -0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, 0x29, 0xAF, 0xAE, 0x00, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x9A, 0xB0, -0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, -0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Australia/South */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88, -0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88, -0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88, -0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08, -0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08, -0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08, -0x16, 0xE7, 0xA6, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88, -0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88, -0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88, -0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08, -0x26, 0x02, 0x66, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08, -0x29, 0xCB, 0x64, 0x88, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88, -0x2D, 0x8B, 0x28, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x74, 0x45, 0x08, 0x30, 0x92, 0x5A, 0x88, -0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88, -0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08, -0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, 0x3B, 0xDA, 0xE1, 0x08, -0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, 0x3F, 0x9A, 0xA5, 0x08, -0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, 0x43, 0x63, 0xA3, 0x88, -0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, 0x47, 0x23, 0x67, 0x88, -0x47, 0xF7, 0xA9, 0x08, 0x48, 0xE7, 0x9A, 0x08, 0x49, 0xD7, 0x8B, 0x08, 0x4A, 0xC7, 0x7C, 0x08, -0x4B, 0xB7, 0x6D, 0x08, 0x4C, 0xA7, 0x5E, 0x08, 0x4D, 0x97, 0x4F, 0x08, 0x4E, 0x87, 0x40, 0x08, -0x4F, 0x77, 0x31, 0x08, 0x50, 0x70, 0x5C, 0x88, 0x51, 0x60, 0x4D, 0x88, 0x52, 0x50, 0x3E, 0x88, -0x53, 0x40, 0x2F, 0x88, 0x54, 0x30, 0x20, 0x88, 0x55, 0x20, 0x11, 0x88, 0x56, 0x10, 0x02, 0x88, -0x56, 0xFF, 0xF3, 0x88, 0x57, 0xEF, 0xE4, 0x88, 0x58, 0xDF, 0xD5, 0x88, 0x59, 0xCF, 0xC6, 0x88, -0x5A, 0xBF, 0xB7, 0x88, 0x5B, 0xB8, 0xE3, 0x08, 0x5C, 0xA8, 0xD4, 0x08, 0x5D, 0x98, 0xC5, 0x08, -0x5E, 0x88, 0xB6, 0x08, 0x5F, 0x78, 0xA7, 0x08, 0x60, 0x68, 0x98, 0x08, 0x61, 0x58, 0x89, 0x08, -0x62, 0x48, 0x7A, 0x08, 0x63, 0x38, 0x6B, 0x08, 0x64, 0x28, 0x5C, 0x08, 0x65, 0x18, 0x4D, 0x08, -0x66, 0x11, 0x78, 0x88, 0x67, 0x01, 0x69, 0x88, 0x67, 0xF1, 0x5A, 0x88, 0x68, 0xE1, 0x4B, 0x88, -0x69, 0xD1, 0x3C, 0x88, 0x6A, 0xC1, 0x2D, 0x88, 0x6B, 0xB1, 0x1E, 0x88, 0x6C, 0xA1, 0x0F, 0x88, -0x6D, 0x91, 0x00, 0x88, 0x6E, 0x80, 0xF1, 0x88, 0x6F, 0x70, 0xE2, 0x88, 0x70, 0x6A, 0x0E, 0x08, -0x71, 0x59, 0xFF, 0x08, 0x72, 0x49, 0xF0, 0x08, 0x73, 0x39, 0xE1, 0x08, 0x74, 0x29, 0xD2, 0x08, -0x75, 0x19, 0xC3, 0x08, 0x76, 0x09, 0xB4, 0x08, 0x76, 0xF9, 0xA5, 0x08, 0x77, 0xE9, 0x96, 0x08, -0x78, 0xD9, 0x87, 0x08, 0x79, 0xC9, 0x78, 0x08, 0x7A, 0xB9, 0x69, 0x08, 0x7B, 0xB2, 0x94, 0x88, -0x7C, 0xA2, 0x85, 0x88, 0x7D, 0x92, 0x76, 0x88, 0x7E, 0x82, 0x67, 0x88, 0x7F, 0x72, 0x58, 0x88, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x93, -0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, -0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Sydney */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x0C, 0x89, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x25, 0xEF, 0xEA, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x58, 0x8E, 0x80, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xF7, 0xA2, 0x00, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xD7, 0x84, 0x00, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xB7, 0x66, 0x00, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x97, 0x48, 0x00, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x77, 0x2A, 0x00, 0x50, 0x70, 0x55, 0x80, 0x51, 0x60, 0x46, 0x80, 0x52, 0x50, 0x37, 0x80, -0x53, 0x40, 0x28, 0x80, 0x54, 0x30, 0x19, 0x80, 0x55, 0x20, 0x0A, 0x80, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xFF, 0xEC, 0x80, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xDF, 0xCE, 0x80, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xBF, 0xB0, 0x80, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0xA8, 0xCD, 0x00, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x88, 0xAF, 0x00, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x68, 0x91, 0x00, 0x61, 0x58, 0x82, 0x00, -0x62, 0x48, 0x73, 0x00, 0x63, 0x38, 0x64, 0x00, 0x64, 0x28, 0x55, 0x00, 0x65, 0x18, 0x46, 0x00, -0x66, 0x11, 0x71, 0x80, 0x67, 0x01, 0x62, 0x80, 0x67, 0xF1, 0x53, 0x80, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xD1, 0x35, 0x80, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xB1, 0x17, 0x80, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x90, 0xF9, 0x80, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x70, 0xDB, 0x80, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x59, 0xF8, 0x00, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x39, 0xDA, 0x00, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x19, 0xBC, 0x00, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF9, 0x9E, 0x00, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD9, 0x80, 0x00, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB9, 0x62, 0x00, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0xA2, 0x7E, 0x80, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x82, 0x60, 0x80, 0x7F, 0x72, 0x51, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x58, 0x4C, 0x2A, 0x01, 0xF9, 0x65, 0x82, 0x00, 0x00, 0x00, 0x20, 0x4E, 0x65, 0x77, -0x20, 0x53, 0x6F, 0x75, 0x74, 0x68, 0x20, 0x57, 0x61, 0x6C, 0x65, 0x73, 0x20, 0x2D, 0x20, 0x6D, -0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* Australia/Tasmania */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9B, 0xD5, 0x78, 0x80, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0xFB, 0xC2, 0x8D, 0x00, -0xFC, 0xB2, 0x7E, 0x00, 0xFD, 0xC7, 0x59, 0x00, 0xFE, 0x76, 0xB0, 0x80, 0xFF, 0xA7, 0x3B, 0x00, -0x00, 0x56, 0x92, 0x80, 0x01, 0x87, 0x1D, 0x00, 0x02, 0x3F, 0xAF, 0x00, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x17, 0x03, 0x4F, 0x00, 0x18, 0x21, 0x64, 0x80, 0x18, 0xE3, 0x31, 0x00, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x67, 0x27, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x80, 0xCE, 0x80, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xED, 0xE1, 0x80, -0x29, 0xD4, 0x98, 0x00, 0x2A, 0xCD, 0xC3, 0x80, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xAD, 0xA5, 0x80, -0x2D, 0x94, 0x5C, 0x00, 0x2E, 0x8D, 0x87, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x6D, 0x69, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x56, 0x86, 0x00, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x36, 0x68, 0x00, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x16, 0x4A, 0x00, 0x36, 0xFD, 0x00, 0x80, 0x37, 0xF6, 0x2C, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xBF, 0x2A, 0x80, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0x9F, 0x0C, 0x80, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x7E, 0xEE, 0x80, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x5E, 0xD0, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x3E, 0xB2, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x1E, 0x94, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x07, 0xB1, 0x00, -0x47, 0xF7, 0xA2, 0x00, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xD7, 0x84, 0x00, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xB7, 0x66, 0x00, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x97, 0x48, 0x00, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x77, 0x2A, 0x00, 0x50, 0x70, 0x55, 0x80, 0x51, 0x60, 0x46, 0x80, 0x52, 0x50, 0x37, 0x80, -0x53, 0x40, 0x28, 0x80, 0x54, 0x30, 0x19, 0x80, 0x55, 0x20, 0x0A, 0x80, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xFF, 0xEC, 0x80, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xDF, 0xCE, 0x80, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xBF, 0xB0, 0x80, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0xA8, 0xCD, 0x00, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x88, 0xAF, 0x00, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x68, 0x91, 0x00, 0x61, 0x58, 0x82, 0x00, -0x62, 0x48, 0x73, 0x00, 0x63, 0x38, 0x64, 0x00, 0x64, 0x28, 0x55, 0x00, 0x65, 0x18, 0x46, 0x00, -0x66, 0x11, 0x71, 0x80, 0x67, 0x01, 0x62, 0x80, 0x67, 0xF1, 0x53, 0x80, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xD1, 0x35, 0x80, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xB1, 0x17, 0x80, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x90, 0xF9, 0x80, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x70, 0xDB, 0x80, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x59, 0xF8, 0x00, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x39, 0xDA, 0x00, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x19, 0xBC, 0x00, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF9, 0x9E, 0x00, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD9, 0x80, 0x00, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB9, 0x62, 0x00, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0xA2, 0x7E, 0x80, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x82, 0x60, 0x80, 0x7F, 0x72, 0x51, 0x80, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, -0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, -0x80, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Victoria */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xA6, 0x9C, -0x9C, 0xBC, 0x20, 0xF0, 0xCB, 0x54, 0xB3, 0x00, 0xCB, 0xC7, 0x57, 0x70, 0xCC, 0xB7, 0x56, 0x80, -0xCD, 0xA7, 0x39, 0x70, 0xCE, 0xA0, 0x73, 0x00, 0xCF, 0x87, 0x1B, 0x70, 0x03, 0x70, 0x39, 0x80, -0x04, 0x0D, 0x1C, 0x00, 0x05, 0x50, 0x1B, 0x80, 0x05, 0xF6, 0x38, 0x80, 0x07, 0x2F, 0xFD, 0x80, -0x07, 0xD6, 0x1A, 0x80, 0x09, 0x0F, 0xDF, 0x80, 0x09, 0xB5, 0xFC, 0x80, 0x0A, 0xEF, 0xC1, 0x80, -0x0B, 0x9F, 0x19, 0x00, 0x0C, 0xD8, 0xDE, 0x00, 0x0D, 0x7E, 0xFB, 0x00, 0x0E, 0xB8, 0xC0, 0x00, -0x0F, 0x5E, 0xDD, 0x00, 0x10, 0x98, 0xA2, 0x00, 0x11, 0x3E, 0xBF, 0x00, 0x12, 0x78, 0x84, 0x00, -0x13, 0x1E, 0xA1, 0x00, 0x14, 0x58, 0x66, 0x00, 0x14, 0xFE, 0x83, 0x00, 0x16, 0x38, 0x48, 0x00, -0x16, 0xE7, 0x9F, 0x80, 0x18, 0x21, 0x64, 0x80, 0x18, 0xC7, 0x81, 0x80, 0x1A, 0x01, 0x46, 0x80, -0x1A, 0xA7, 0x63, 0x80, 0x1B, 0xE1, 0x28, 0x80, 0x1C, 0x87, 0x45, 0x80, 0x1D, 0xC1, 0x0A, 0x80, -0x1E, 0x79, 0x9C, 0x80, 0x1F, 0x97, 0xB2, 0x00, 0x20, 0x59, 0x7E, 0x80, 0x21, 0x77, 0x94, 0x00, -0x22, 0x42, 0x9B, 0x00, 0x23, 0x69, 0xEB, 0x00, 0x24, 0x22, 0x7D, 0x00, 0x25, 0x49, 0xCD, 0x00, -0x26, 0x02, 0x5F, 0x00, 0x27, 0x29, 0xAF, 0x00, 0x27, 0xCF, 0xCC, 0x00, 0x29, 0x09, 0x91, 0x00, -0x29, 0xAF, 0xAE, 0x00, 0x2A, 0xE9, 0x73, 0x00, 0x2B, 0x98, 0xCA, 0x80, 0x2C, 0xD2, 0x8F, 0x80, -0x2D, 0x78, 0xAC, 0x80, 0x2E, 0xB2, 0x71, 0x80, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x92, 0x53, 0x80, -0x31, 0x5D, 0x5A, 0x80, 0x32, 0x72, 0x35, 0x80, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x52, 0x17, 0x80, -0x35, 0x1D, 0x1E, 0x80, 0x36, 0x31, 0xF9, 0x80, 0x36, 0xFD, 0x00, 0x80, 0x38, 0x1B, 0x16, 0x00, -0x38, 0xDC, 0xE2, 0x80, 0x39, 0xA7, 0xE9, 0x80, 0x3A, 0xBC, 0xC4, 0x80, 0x3B, 0xDA, 0xDA, 0x00, -0x3C, 0xA5, 0xE1, 0x00, 0x3D, 0xBA, 0xBC, 0x00, 0x3E, 0x85, 0xC3, 0x00, 0x3F, 0x9A, 0x9E, 0x00, -0x40, 0x65, 0xA5, 0x00, 0x41, 0x83, 0xBA, 0x80, 0x42, 0x45, 0x87, 0x00, 0x43, 0x63, 0x9C, 0x80, -0x44, 0x2E, 0xA3, 0x80, 0x45, 0x43, 0x7E, 0x80, 0x46, 0x05, 0x4B, 0x00, 0x47, 0x23, 0x60, 0x80, -0x47, 0xF7, 0xA2, 0x00, 0x48, 0xE7, 0x93, 0x00, 0x49, 0xD7, 0x84, 0x00, 0x4A, 0xC7, 0x75, 0x00, -0x4B, 0xB7, 0x66, 0x00, 0x4C, 0xA7, 0x57, 0x00, 0x4D, 0x97, 0x48, 0x00, 0x4E, 0x87, 0x39, 0x00, -0x4F, 0x77, 0x2A, 0x00, 0x50, 0x70, 0x55, 0x80, 0x51, 0x60, 0x46, 0x80, 0x52, 0x50, 0x37, 0x80, -0x53, 0x40, 0x28, 0x80, 0x54, 0x30, 0x19, 0x80, 0x55, 0x20, 0x0A, 0x80, 0x56, 0x0F, 0xFB, 0x80, -0x56, 0xFF, 0xEC, 0x80, 0x57, 0xEF, 0xDD, 0x80, 0x58, 0xDF, 0xCE, 0x80, 0x59, 0xCF, 0xBF, 0x80, -0x5A, 0xBF, 0xB0, 0x80, 0x5B, 0xB8, 0xDC, 0x00, 0x5C, 0xA8, 0xCD, 0x00, 0x5D, 0x98, 0xBE, 0x00, -0x5E, 0x88, 0xAF, 0x00, 0x5F, 0x78, 0xA0, 0x00, 0x60, 0x68, 0x91, 0x00, 0x61, 0x58, 0x82, 0x00, -0x62, 0x48, 0x73, 0x00, 0x63, 0x38, 0x64, 0x00, 0x64, 0x28, 0x55, 0x00, 0x65, 0x18, 0x46, 0x00, -0x66, 0x11, 0x71, 0x80, 0x67, 0x01, 0x62, 0x80, 0x67, 0xF1, 0x53, 0x80, 0x68, 0xE1, 0x44, 0x80, -0x69, 0xD1, 0x35, 0x80, 0x6A, 0xC1, 0x26, 0x80, 0x6B, 0xB1, 0x17, 0x80, 0x6C, 0xA1, 0x08, 0x80, -0x6D, 0x90, 0xF9, 0x80, 0x6E, 0x80, 0xEA, 0x80, 0x6F, 0x70, 0xDB, 0x80, 0x70, 0x6A, 0x07, 0x00, -0x71, 0x59, 0xF8, 0x00, 0x72, 0x49, 0xE9, 0x00, 0x73, 0x39, 0xDA, 0x00, 0x74, 0x29, 0xCB, 0x00, -0x75, 0x19, 0xBC, 0x00, 0x76, 0x09, 0xAD, 0x00, 0x76, 0xF9, 0x9E, 0x00, 0x77, 0xE9, 0x8F, 0x00, -0x78, 0xD9, 0x80, 0x00, 0x79, 0xC9, 0x71, 0x00, 0x7A, 0xB9, 0x62, 0x00, 0x7B, 0xB2, 0x8D, 0x80, -0x7C, 0xA2, 0x7E, 0x80, 0x7D, 0x92, 0x6F, 0x80, 0x7E, 0x82, 0x60, 0x80, 0x7F, 0x72, 0x51, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x9A, -0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Australia/West */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xC2, 0xBC, -0x9C, 0xBC, 0x3D, 0x10, 0xCB, 0x54, 0xCF, 0x20, 0xCB, 0xC7, 0x73, 0x90, 0xCC, 0xB7, 0x72, 0xA0, -0xCD, 0xA7, 0x55, 0x90, 0x09, 0x0F, 0xFB, 0xA0, 0x09, 0xB6, 0x18, 0xA0, 0x1A, 0x01, 0x62, 0xA0, -0x1A, 0xA7, 0x7F, 0xA0, 0x29, 0x25, 0x5C, 0xA0, 0x29, 0xAF, 0xCA, 0x20, 0x45, 0x71, 0xBF, 0x20, -0x46, 0x05, 0x67, 0x20, 0x47, 0x23, 0x7C, 0xA0, 0x47, 0xEE, 0x83, 0xA0, 0x49, 0x03, 0x5E, 0xA0, -0x49, 0xCE, 0x65, 0xA0, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, -0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x57, 0x53, -0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Australia/Yancowinna */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x9C, 0x4E, 0xAD, 0xA4, -0x9C, 0xBC, 0x27, 0xF8, 0xCB, 0x54, 0xBA, 0x08, 0xCB, 0xC7, 0x5E, 0x78, 0xCC, 0xB7, 0x5D, 0x88, -0xCD, 0xA7, 0x40, 0x78, 0xCE, 0xA0, 0x7A, 0x08, 0xCF, 0x87, 0x22, 0x78, 0x03, 0x70, 0x40, 0x88, -0x04, 0x0D, 0x23, 0x08, 0x05, 0x50, 0x22, 0x88, 0x05, 0xF6, 0x3F, 0x88, 0x07, 0x30, 0x04, 0x88, -0x07, 0xD6, 0x21, 0x88, 0x09, 0x0F, 0xE6, 0x88, 0x09, 0xB6, 0x03, 0x88, 0x0A, 0xEF, 0xC8, 0x88, -0x0B, 0x9F, 0x20, 0x08, 0x0C, 0xD8, 0xE5, 0x08, 0x0D, 0x7F, 0x02, 0x08, 0x0E, 0xB8, 0xC7, 0x08, -0x0F, 0x5E, 0xE4, 0x08, 0x10, 0x98, 0xA9, 0x08, 0x11, 0x3E, 0xC6, 0x08, 0x12, 0x78, 0x8B, 0x08, -0x13, 0x1E, 0xA8, 0x08, 0x14, 0x58, 0x6D, 0x08, 0x14, 0xFE, 0x8A, 0x08, 0x16, 0x38, 0x4F, 0x08, -0x17, 0x0C, 0x90, 0x88, 0x18, 0x21, 0x6B, 0x88, 0x18, 0xC7, 0x88, 0x88, 0x1A, 0x01, 0x4D, 0x88, -0x1A, 0xA7, 0x6A, 0x88, 0x1B, 0xE1, 0x2F, 0x88, 0x1C, 0x87, 0x4C, 0x88, 0x1D, 0xC1, 0x11, 0x88, -0x1E, 0x79, 0xA3, 0x88, 0x1F, 0x97, 0xB9, 0x08, 0x20, 0x59, 0x85, 0x88, 0x21, 0x80, 0xD5, 0x88, -0x22, 0x42, 0xA2, 0x08, 0x23, 0x69, 0xF2, 0x08, 0x24, 0x22, 0x84, 0x08, 0x25, 0x49, 0xD4, 0x08, -0x25, 0xEF, 0xF1, 0x08, 0x27, 0x29, 0xB6, 0x08, 0x27, 0xCF, 0xD3, 0x08, 0x29, 0x09, 0x98, 0x08, -0x29, 0xAF, 0xB5, 0x08, 0x2A, 0xE9, 0x7A, 0x08, 0x2B, 0x98, 0xD1, 0x88, 0x2C, 0xD2, 0x96, 0x88, -0x2D, 0x78, 0xB3, 0x88, 0x2E, 0xB2, 0x78, 0x88, 0x2F, 0x58, 0x95, 0x88, 0x30, 0x92, 0x5A, 0x88, -0x31, 0x5D, 0x61, 0x88, 0x32, 0x72, 0x3C, 0x88, 0x33, 0x3D, 0x43, 0x88, 0x34, 0x52, 0x1E, 0x88, -0x35, 0x1D, 0x25, 0x88, 0x36, 0x32, 0x00, 0x88, 0x36, 0xFD, 0x07, 0x88, 0x38, 0x1B, 0x1D, 0x08, -0x38, 0x6C, 0xAF, 0xD8, 0x38, 0xDC, 0xE9, 0x88, 0x39, 0xFA, 0xFF, 0x08, 0x3A, 0xBC, 0xCB, 0x88, -0x3B, 0xDA, 0xE1, 0x08, 0x3C, 0xA5, 0xE8, 0x08, 0x3D, 0xBA, 0xC3, 0x08, 0x3E, 0x85, 0xCA, 0x08, -0x3F, 0x9A, 0xA5, 0x08, 0x40, 0x65, 0xAC, 0x08, 0x41, 0x83, 0xC1, 0x88, 0x42, 0x45, 0x8E, 0x08, -0x43, 0x63, 0xA3, 0x88, 0x44, 0x2E, 0xAA, 0x88, 0x45, 0x43, 0x85, 0x88, 0x46, 0x05, 0x52, 0x08, -0x47, 0x23, 0x67, 0x88, 0x47, 0xF7, 0xA9, 0x08, 0x48, 0xE7, 0x9A, 0x08, 0x49, 0xD7, 0x8B, 0x08, -0x4A, 0xC7, 0x7C, 0x08, 0x4B, 0xB7, 0x6D, 0x08, 0x4C, 0xA7, 0x5E, 0x08, 0x4D, 0x97, 0x4F, 0x08, -0x4E, 0x87, 0x40, 0x08, 0x4F, 0x77, 0x31, 0x08, 0x50, 0x70, 0x5C, 0x88, 0x51, 0x60, 0x4D, 0x88, -0x52, 0x50, 0x3E, 0x88, 0x53, 0x40, 0x2F, 0x88, 0x54, 0x30, 0x20, 0x88, 0x55, 0x20, 0x11, 0x88, -0x56, 0x10, 0x02, 0x88, 0x56, 0xFF, 0xF3, 0x88, 0x57, 0xEF, 0xE4, 0x88, 0x58, 0xDF, 0xD5, 0x88, -0x59, 0xCF, 0xC6, 0x88, 0x5A, 0xBF, 0xB7, 0x88, 0x5B, 0xB8, 0xE3, 0x08, 0x5C, 0xA8, 0xD4, 0x08, -0x5D, 0x98, 0xC5, 0x08, 0x5E, 0x88, 0xB6, 0x08, 0x5F, 0x78, 0xA7, 0x08, 0x60, 0x68, 0x98, 0x08, -0x61, 0x58, 0x89, 0x08, 0x62, 0x48, 0x7A, 0x08, 0x63, 0x38, 0x6B, 0x08, 0x64, 0x28, 0x5C, 0x08, -0x65, 0x18, 0x4D, 0x08, 0x66, 0x11, 0x78, 0x88, 0x67, 0x01, 0x69, 0x88, 0x67, 0xF1, 0x5A, 0x88, -0x68, 0xE1, 0x4B, 0x88, 0x69, 0xD1, 0x3C, 0x88, 0x6A, 0xC1, 0x2D, 0x88, 0x6B, 0xB1, 0x1E, 0x88, -0x6C, 0xA1, 0x0F, 0x88, 0x6D, 0x91, 0x00, 0x88, 0x6E, 0x80, 0xF1, 0x88, 0x6F, 0x70, 0xE2, 0x88, -0x70, 0x6A, 0x0E, 0x08, 0x71, 0x59, 0xFF, 0x08, 0x72, 0x49, 0xF0, 0x08, 0x73, 0x39, 0xE1, 0x08, -0x74, 0x29, 0xD2, 0x08, 0x75, 0x19, 0xC3, 0x08, 0x76, 0x09, 0xB4, 0x08, 0x76, 0xF9, 0xA5, 0x08, -0x77, 0xE9, 0x96, 0x08, 0x78, 0xD9, 0x87, 0x08, 0x79, 0xC9, 0x78, 0x08, 0x7A, 0xB9, 0x69, 0x08, -0x7B, 0xB2, 0x94, 0x88, 0x7C, 0xA2, 0x85, 0x88, 0x7D, 0x92, 0x76, 0x88, 0x7E, 0x82, 0x67, 0x88, -0x7F, 0x72, 0x58, 0x88, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x00, 0x00, 0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x00, 0x00, -0x93, 0xA8, 0x01, 0x00, 0x00, 0x00, 0x85, 0x98, 0x00, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, -0x00, 0x00, - -/* Brazil/Acre */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x96, 0xAA, 0x86, 0x90, -0xB8, 0x0F, 0x66, 0x00, 0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xF1, 0x50, 0x50, 0xBA, 0xDE, 0x90, 0x40, -0xDA, 0x38, 0xCA, 0x50, 0xDA, 0xEC, 0x16, 0x50, 0xDC, 0x19, 0xFD, 0xD0, 0xDC, 0xB9, 0x75, 0x40, -0xDD, 0xFB, 0x31, 0x50, 0xDE, 0x9B, 0xFA, 0x40, 0xDF, 0xDD, 0xB6, 0x50, 0xE0, 0x54, 0x4F, 0x40, -0xF4, 0x98, 0x1B, 0xD0, 0xF5, 0x05, 0x7A, 0x40, 0xF6, 0xC0, 0x80, 0x50, 0xF7, 0x0E, 0x3A, 0xC0, -0xF8, 0x51, 0x48, 0x50, 0xF8, 0xC7, 0xE1, 0x40, 0xFA, 0x0A, 0xEE, 0xD0, 0xFA, 0xA9, 0x14, 0xC0, -0xFB, 0xEC, 0x22, 0x50, 0xFC, 0x8B, 0x99, 0xC0, 0x1D, 0xC9, 0xAA, 0x50, 0x1E, 0x78, 0xF3, 0xC0, -0x1F, 0xA0, 0x51, 0xD0, 0x20, 0x33, 0xEB, 0xC0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x0B, 0xE4, 0xC0, -0x48, 0x60, 0x7F, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0xFF, 0xFF, 0xC0, 0x70, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x09, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x43, -0x53, 0x54, 0x00, 0x41, 0x43, 0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Brazil/DeNoronha */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x65, 0x64, -0xB8, 0x0F, 0x3B, 0xD0, 0xB8, 0xFD, 0x32, 0x90, 0xB9, 0xF1, 0x26, 0x20, 0xBA, 0xDE, 0x66, 0x10, -0xDA, 0x38, 0xA0, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDC, 0x19, 0xD3, 0xA0, 0xDC, 0xB9, 0x4B, 0x10, -0xDD, 0xFB, 0x07, 0x20, 0xDE, 0x9B, 0xD0, 0x10, 0xDF, 0xDD, 0x8C, 0x20, 0xE0, 0x54, 0x25, 0x10, -0xF4, 0x97, 0xF1, 0xA0, 0xF5, 0x05, 0x50, 0x10, 0xF6, 0xC0, 0x56, 0x20, 0xF7, 0x0E, 0x10, 0x90, -0xF8, 0x51, 0x1E, 0x20, 0xF8, 0xC7, 0xB7, 0x10, 0xFA, 0x0A, 0xC4, 0xA0, 0xFA, 0xA8, 0xEA, 0x90, -0xFB, 0xEB, 0xF8, 0x20, 0xFC, 0x8B, 0x6F, 0x90, 0x1D, 0xC9, 0x80, 0x20, 0x1E, 0x78, 0xC9, 0x90, -0x1F, 0xA0, 0x27, 0xA0, 0x20, 0x33, 0xC1, 0x90, 0x21, 0x81, 0x5B, 0x20, 0x22, 0x0B, 0xBA, 0x90, -0x23, 0x58, 0x02, 0xA0, 0x23, 0xE2, 0x62, 0x10, 0x25, 0x37, 0xE4, 0xA0, 0x25, 0xD4, 0xB9, 0x10, -0x37, 0xF6, 0xB8, 0xA0, 0x38, 0xB8, 0x77, 0x10, 0x39, 0xDF, 0xD5, 0x20, 0x39, 0xE9, 0x01, 0x90, -0x3B, 0xC8, 0xF1, 0xA0, 0x3C, 0x6F, 0x00, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, -0xFF, 0xE1, 0x9C, 0x00, 0x00, 0xFF, 0xFF, 0xF1, 0xF0, 0x01, 0x04, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, -0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4E, 0x53, 0x54, 0x00, 0x46, 0x4E, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - - -/* Brazil/East */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x72, 0xB4, -0xB8, 0x0F, 0x49, 0xE0, 0xB8, 0xFD, 0x40, 0xA0, 0xB9, 0xF1, 0x34, 0x30, 0xBA, 0xDE, 0x74, 0x20, -0xDA, 0x38, 0xAE, 0x30, 0xDA, 0xEB, 0xFA, 0x30, 0xDC, 0x19, 0xE1, 0xB0, 0xDC, 0xB9, 0x59, 0x20, -0xDD, 0xFB, 0x15, 0x30, 0xDE, 0x9B, 0xDE, 0x20, 0xDF, 0xDD, 0x9A, 0x30, 0xE0, 0x54, 0x33, 0x20, -0xF4, 0x5A, 0x09, 0x30, 0xF5, 0x05, 0x5E, 0x20, 0xF6, 0xC0, 0x64, 0x30, 0xF7, 0x0E, 0x1E, 0xA0, -0xF8, 0x51, 0x2C, 0x30, 0xF8, 0xC7, 0xC5, 0x20, 0xFA, 0x0A, 0xD2, 0xB0, 0xFA, 0xA8, 0xF8, 0xA0, -0xFB, 0xEC, 0x06, 0x30, 0xFC, 0x8B, 0x7D, 0xA0, 0x1D, 0xC9, 0x8E, 0x30, 0x1E, 0x78, 0xD7, 0xA0, -0x1F, 0xA0, 0x35, 0xB0, 0x20, 0x33, 0xCF, 0xA0, 0x21, 0x81, 0x69, 0x30, 0x22, 0x0B, 0xC8, 0xA0, -0x23, 0x58, 0x10, 0xB0, 0x23, 0xE2, 0x70, 0x20, 0x25, 0x37, 0xF2, 0xB0, 0x25, 0xD4, 0xC7, 0x20, -0x27, 0x21, 0x0F, 0x30, 0x27, 0xBD, 0xE3, 0xA0, 0x29, 0x00, 0xF1, 0x30, 0x29, 0x94, 0x8B, 0x20, -0x2A, 0xEA, 0x0D, 0xB0, 0x2B, 0x6B, 0x32, 0xA0, 0x2C, 0xC0, 0xB5, 0x30, 0x2D, 0x66, 0xC4, 0x20, -0x2E, 0xA0, 0x97, 0x30, 0x2F, 0x46, 0xA6, 0x20, 0x30, 0x80, 0x79, 0x30, 0x31, 0x1D, 0x4D, 0xA0, -0x32, 0x57, 0x20, 0xB0, 0x33, 0x06, 0x6A, 0x20, 0x34, 0x38, 0x54, 0x30, 0x34, 0xF8, 0xC1, 0x20, -0x36, 0x20, 0x1F, 0x30, 0x36, 0xCF, 0x68, 0xA0, 0x37, 0xF6, 0xC6, 0xB0, 0x38, 0xB8, 0x85, 0x20, -0x39, 0xDF, 0xE3, 0x30, 0x3A, 0x8F, 0x2C, 0xA0, 0x3B, 0xC8, 0xFF, 0xB0, 0x3C, 0x6F, 0x0E, 0xA0, -0x3D, 0xC4, 0x91, 0x30, 0x3E, 0x4E, 0xF0, 0xA0, 0x3F, 0x91, 0xFE, 0x30, 0x40, 0x2E, 0xD2, 0xA0, -0x41, 0x86, 0xF8, 0x30, 0x42, 0x17, 0xEF, 0x20, 0x43, 0x51, 0xC2, 0x30, 0x43, 0xF7, 0xD1, 0x20, -0x45, 0x4D, 0x53, 0xB0, 0x45, 0xE0, 0xED, 0xA0, 0x47, 0x11, 0x86, 0x30, 0x47, 0xB7, 0x95, 0x20, -0x48, 0xFA, 0xA2, 0xB0, 0x49, 0x97, 0x77, 0x20, 0x4A, 0xDA, 0x84, 0xB0, 0x4B, 0x80, 0x93, 0xA0, -0x4C, 0xBA, 0x66, 0xB0, 0x4D, 0x60, 0x75, 0xA0, 0x4E, 0x9A, 0x48, 0xB0, 0x4F, 0x49, 0x92, 0x20, -0x50, 0x83, 0x65, 0x30, 0x51, 0x20, 0x39, 0xA0, 0x52, 0x63, 0x47, 0x30, 0x53, 0x00, 0x1B, 0xA0, -0x54, 0x43, 0x29, 0x30, 0x54, 0xE9, 0x38, 0x20, 0x56, 0x23, 0x0B, 0x30, 0x56, 0xC9, 0x1A, 0x20, -0x58, 0x02, 0xED, 0x30, 0x58, 0xA8, 0xFC, 0x20, 0x59, 0xE2, 0xCF, 0x30, 0x5A, 0x88, 0xDE, 0x20, -0x5B, 0xCB, 0xEB, 0xB0, 0x5C, 0x68, 0xC0, 0x20, 0x5D, 0xAB, 0xCD, 0xB0, 0x5E, 0x48, 0xA2, 0x20, -0x5F, 0x8B, 0xAF, 0xB0, 0x60, 0x31, 0xBE, 0xA0, 0x61, 0x6B, 0x91, 0xB0, 0x62, 0x11, 0xA0, 0xA0, -0x63, 0x4B, 0x73, 0xB0, 0x63, 0xFA, 0xBD, 0x20, 0x65, 0x2B, 0x55, 0xB0, 0x65, 0xD1, 0x64, 0xA0, -0x67, 0x14, 0x72, 0x30, 0x67, 0xB1, 0x46, 0xA0, 0x68, 0xF4, 0x54, 0x30, 0x69, 0x9A, 0x63, 0x20, -0x6A, 0xD4, 0x36, 0x30, 0x6B, 0x7A, 0x45, 0x20, 0x6C, 0xB4, 0x18, 0x30, 0x6D, 0x5A, 0x27, 0x20, -0x6E, 0x93, 0xFA, 0x30, 0x6F, 0x3A, 0x09, 0x20, 0x70, 0x7D, 0x16, 0xB0, 0x71, 0x19, 0xEB, 0x20, -0x72, 0x5C, 0xF8, 0xB0, 0x72, 0xF9, 0xCD, 0x20, 0x74, 0x3C, 0xDA, 0xB0, 0x74, 0xD9, 0xAF, 0x20, -0x76, 0x1C, 0xBC, 0xB0, 0x76, 0xC2, 0xCB, 0xA0, 0x77, 0xFC, 0x9E, 0xB0, 0x78, 0xAB, 0xE8, 0x20, -0x79, 0xDC, 0x80, 0xB0, 0x7A, 0x82, 0x8F, 0xA0, 0x7B, 0xC5, 0x9D, 0x30, 0x7C, 0x62, 0x71, 0xA0, -0x7D, 0xA5, 0x7F, 0x30, 0x7E, 0x4B, 0x8E, 0x20, 0x7F, 0x85, 0x61, 0x30, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xD4, 0x4C, -0x00, 0x00, 0xFF, 0xFF, 0xE3, 0xE0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x00, 0x09, 0x4C, 0x4D, -0x54, 0x00, 0x42, 0x52, 0x53, 0x54, 0x00, 0x42, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Brazil/West */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x7F, 0x44, -0xB8, 0x0F, 0x57, 0xF0, 0xB8, 0xFD, 0x4E, 0xB0, 0xB9, 0xF1, 0x42, 0x40, 0xBA, 0xDE, 0x82, 0x30, -0xDA, 0x38, 0xBC, 0x40, 0xDA, 0xEC, 0x08, 0x40, 0xDC, 0x19, 0xEF, 0xC0, 0xDC, 0xB9, 0x67, 0x30, -0xDD, 0xFB, 0x23, 0x40, 0xDE, 0x9B, 0xEC, 0x30, 0xDF, 0xDD, 0xA8, 0x40, 0xE0, 0x54, 0x41, 0x30, -0xF4, 0x98, 0x0D, 0xC0, 0xF5, 0x05, 0x6C, 0x30, 0xF6, 0xC0, 0x72, 0x40, 0xF7, 0x0E, 0x2C, 0xB0, -0xF8, 0x51, 0x3A, 0x40, 0xF8, 0xC7, 0xD3, 0x30, 0xFA, 0x0A, 0xE0, 0xC0, 0xFA, 0xA9, 0x06, 0xB0, -0xFB, 0xEC, 0x14, 0x40, 0xFC, 0x8B, 0x8B, 0xB0, 0x1D, 0xC9, 0x9C, 0x40, 0x1E, 0x78, 0xE5, 0xB0, -0x1F, 0xA0, 0x43, 0xC0, 0x20, 0x33, 0xDD, 0xB0, 0x21, 0x81, 0x77, 0x40, 0x22, 0x0B, 0xD6, 0xB0, -0x2C, 0xC0, 0xC3, 0x40, 0x2D, 0x66, 0xD2, 0x30, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, 0xC7, 0xBC, 0x00, 0x00, 0xFF, 0xFF, 0xD5, -0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x41, 0x4D, 0x53, -0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, -0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Canada/Atlantic */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x80, 0xF1, 0xAB, 0xA0, -0x9A, 0xE4, 0xDE, 0xC0, 0x9B, 0xD6, 0x13, 0x30, 0x9E, 0xB8, 0x85, 0x60, 0x9F, 0xC0, 0x23, 0x50, -0xA2, 0x9D, 0x17, 0x40, 0xA3, 0x30, 0xB1, 0x30, 0xA4, 0x7A, 0x56, 0x40, 0xA5, 0x1B, 0x1F, 0x30, -0xA6, 0x53, 0xA0, 0xC0, 0xA6, 0xFC, 0x52, 0xB0, 0xA8, 0x3C, 0xBD, 0x40, 0xA8, 0xDC, 0x34, 0xB0, -0xAA, 0x1C, 0x9F, 0x40, 0xAA, 0xCD, 0x3A, 0x30, 0xAB, 0xFC, 0x81, 0x40, 0xAC, 0xBF, 0x91, 0x30, -0xAD, 0xEE, 0xD8, 0x40, 0xAE, 0x8C, 0xFE, 0x30, 0xAF, 0xBC, 0x45, 0x40, 0xB0, 0x7F, 0x55, 0x30, -0xB1, 0xAE, 0x9C, 0x40, 0xB2, 0x4B, 0x70, 0xB0, 0xB3, 0x8E, 0x7E, 0x40, 0xB4, 0x24, 0xBB, 0x30, -0xB5, 0x6E, 0x60, 0x40, 0xB6, 0x15, 0xC0, 0xB0, 0xB7, 0x4E, 0x42, 0x40, 0xB8, 0x08, 0x17, 0xB0, -0xB9, 0x24, 0xE9, 0xC0, 0xB9, 0xE7, 0xF9, 0xB0, 0xBB, 0x04, 0xCB, 0xC0, 0xBB, 0xD1, 0x16, 0x30, -0xBD, 0x00, 0x5D, 0x40, 0xBD, 0x9D, 0x31, 0xB0, 0xBE, 0xF2, 0xB4, 0x40, 0xBF, 0x90, 0xDA, 0x30, -0xC0, 0xD3, 0xE7, 0xC0, 0xC1, 0x5E, 0x47, 0x30, 0xC2, 0x8D, 0x8E, 0x40, 0xC3, 0x50, 0x9E, 0x30, -0xC4, 0x6D, 0x70, 0x40, 0xC5, 0x30, 0x80, 0x30, 0xC6, 0x72, 0x3C, 0x40, 0xC7, 0x10, 0x62, 0x30, -0xC8, 0x36, 0x6E, 0xC0, 0xC8, 0xF9, 0x7E, 0xB0, 0xCA, 0x16, 0x50, 0xC0, 0xCA, 0xD9, 0x60, 0xB0, -0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0xD3, 0x75, 0xD6, 0xE0, -0xD4, 0x40, 0xCF, 0xD0, 0xD5, 0x55, 0xB8, 0xE0, 0xD6, 0x20, 0xB1, 0xD0, 0xD7, 0x35, 0x9A, 0xE0, -0xD8, 0x00, 0x93, 0xD0, 0xD9, 0x15, 0x7C, 0xE0, 0xD9, 0xE0, 0x75, 0xD0, 0xDC, 0xDE, 0x7B, 0x60, -0xDD, 0xA9, 0x74, 0x50, 0xDE, 0xBE, 0x5D, 0x60, 0xDF, 0x89, 0x56, 0x50, 0xE0, 0x9E, 0x3F, 0x60, -0xE1, 0x69, 0x38, 0x50, 0xE2, 0x7E, 0x21, 0x60, 0xE3, 0x49, 0x1A, 0x50, 0xE6, 0x47, 0x1F, 0xE0, -0xE7, 0x12, 0x18, 0xD0, 0xE8, 0x27, 0x01, 0xE0, 0xE8, 0xF1, 0xFA, 0xD0, 0xEA, 0x06, 0xE3, 0xE0, -0xEA, 0xD1, 0xDC, 0xD0, 0xEB, 0xE6, 0xC5, 0xE0, 0xEC, 0xB1, 0xBE, 0xD0, 0xF1, 0x8F, 0xA6, 0x60, -0xF2, 0x7F, 0x89, 0x50, 0xF3, 0x6F, 0x88, 0x60, 0xF4, 0x5F, 0x6B, 0x50, 0xF5, 0x4F, 0x6A, 0x60, -0xF6, 0x3F, 0x4D, 0x50, 0xF7, 0x2F, 0x4C, 0x60, 0xF8, 0x28, 0x69, 0xD0, 0xF9, 0x0F, 0x2E, 0x60, -0xFA, 0x08, 0x4B, 0xD0, 0xFA, 0xF8, 0x4A, 0xE0, 0xFB, 0xE8, 0x2D, 0xD0, 0xFC, 0xD8, 0x2C, 0xE0, -0xFD, 0xC8, 0x0F, 0xD0, 0xFE, 0xB8, 0x0E, 0xE0, 0xFF, 0xA7, 0xF1, 0xD0, 0x00, 0x97, 0xF0, 0xE0, -0x01, 0x87, 0xD3, 0xD0, 0x02, 0x77, 0xD2, 0xE0, 0x03, 0x70, 0xF0, 0x50, 0x04, 0x60, 0xEF, 0x60, -0x05, 0x50, 0xD2, 0x50, 0x06, 0x40, 0xD1, 0x60, 0x07, 0x30, 0xB4, 0x50, 0x08, 0x20, 0xB3, 0x60, -0x09, 0x10, 0x96, 0x50, 0x0A, 0x00, 0x95, 0x60, 0x0A, 0xF0, 0x78, 0x50, 0x0B, 0xE0, 0x77, 0x60, -0x0C, 0xD9, 0x94, 0xD0, 0x0D, 0xC0, 0x59, 0x60, 0x0E, 0xB9, 0x76, 0xD0, 0x0F, 0xA9, 0x75, 0xE0, -0x10, 0x99, 0x58, 0xD0, 0x11, 0x89, 0x57, 0xE0, 0x12, 0x79, 0x3A, 0xD0, 0x13, 0x69, 0x39, 0xE0, -0x14, 0x59, 0x1C, 0xD0, 0x15, 0x49, 0x1B, 0xE0, 0x16, 0x38, 0xFE, 0xD0, 0x17, 0x28, 0xFD, 0xE0, -0x18, 0x22, 0x1B, 0x50, 0x19, 0x08, 0xDF, 0xE0, 0x1A, 0x01, 0xFD, 0x50, 0x1A, 0xF1, 0xFC, 0x60, -0x1B, 0xE1, 0xDF, 0x50, 0x1C, 0xD1, 0xDE, 0x60, 0x1D, 0xC1, 0xC1, 0x50, 0x1E, 0xB1, 0xC0, 0x60, -0x1F, 0xA1, 0xA3, 0x50, 0x20, 0x75, 0xF2, 0xE0, 0x21, 0x81, 0x85, 0x50, 0x22, 0x55, 0xD4, 0xE0, -0x23, 0x6A, 0xA1, 0xD0, 0x24, 0x35, 0xB6, 0xE0, 0x25, 0x4A, 0x83, 0xD0, 0x26, 0x15, 0x98, 0xE0, -0x27, 0x2A, 0x65, 0xD0, 0x27, 0xFE, 0xB5, 0x60, 0x29, 0x0A, 0x47, 0xD0, 0x29, 0xDE, 0x97, 0x60, -0x2A, 0xEA, 0x29, 0xD0, 0x2B, 0xBE, 0x79, 0x60, 0x2C, 0xD3, 0x46, 0x50, 0x2D, 0x9E, 0x5B, 0x60, -0x2E, 0xB3, 0x28, 0x50, 0x2F, 0x7E, 0x3D, 0x60, 0x30, 0x93, 0x0A, 0x50, 0x31, 0x67, 0x59, 0xE0, -0x32, 0x72, 0xEC, 0x50, 0x33, 0x47, 0x3B, 0xE0, 0x34, 0x52, 0xCE, 0x50, 0x35, 0x27, 0x1D, 0xE0, -0x36, 0x32, 0xB0, 0x50, 0x37, 0x06, 0xFF, 0xE0, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xE1, 0xE0, -0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xC3, 0xE0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xE0, 0x60, -0x3D, 0xBB, 0x72, 0xD0, 0x3E, 0x8F, 0xC2, 0x60, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0xA4, 0x60, -0x41, 0x84, 0x71, 0x50, 0x42, 0x4F, 0x86, 0x60, 0x43, 0x64, 0x53, 0x50, 0x44, 0x2F, 0x68, 0x60, -0x45, 0x44, 0x35, 0x50, 0x45, 0xF3, 0x9A, 0xE0, 0x47, 0x2D, 0x51, 0xD0, 0x47, 0xD3, 0x7C, 0xE0, -0x49, 0x0D, 0x33, 0xD0, 0x49, 0xB3, 0x5E, 0xE0, 0x4A, 0xED, 0x15, 0xD0, 0x4B, 0x9C, 0x7B, 0x60, -0x4C, 0xD6, 0x32, 0x50, 0x4D, 0x7C, 0x5D, 0x60, 0x4E, 0xB6, 0x14, 0x50, 0x4F, 0x5C, 0x3F, 0x60, -0x50, 0x95, 0xF6, 0x50, 0x51, 0x3C, 0x21, 0x60, 0x52, 0x75, 0xD8, 0x50, 0x53, 0x1C, 0x03, 0x60, -0x54, 0x55, 0xBA, 0x50, 0x54, 0xFB, 0xE5, 0x60, 0x56, 0x35, 0x9C, 0x50, 0x56, 0xE5, 0x01, 0xE0, -0x58, 0x1E, 0xB8, 0xD0, 0x58, 0xC4, 0xE3, 0xE0, 0x59, 0xFE, 0x9A, 0xD0, 0x5A, 0xA4, 0xC5, 0xE0, -0x5B, 0xDE, 0x7C, 0xD0, 0x5C, 0x84, 0xA7, 0xE0, 0x5D, 0xBE, 0x5E, 0xD0, 0x5E, 0x64, 0x89, 0xE0, -0x5F, 0x9E, 0x40, 0xD0, 0x60, 0x4D, 0xA6, 0x60, 0x61, 0x87, 0x5D, 0x50, 0x62, 0x2D, 0x88, 0x60, -0x63, 0x67, 0x3F, 0x50, 0x64, 0x0D, 0x6A, 0x60, 0x65, 0x47, 0x21, 0x50, 0x65, 0xED, 0x4C, 0x60, -0x67, 0x27, 0x03, 0x50, 0x67, 0xCD, 0x2E, 0x60, 0x69, 0x06, 0xE5, 0x50, 0x69, 0xAD, 0x10, 0x60, -0x6A, 0xE6, 0xC7, 0x50, 0x6B, 0x96, 0x2C, 0xE0, 0x6C, 0xCF, 0xE3, 0xD0, 0x6D, 0x76, 0x0E, 0xE0, -0x6E, 0xAF, 0xC5, 0xD0, 0x6F, 0x55, 0xF0, 0xE0, 0x70, 0x8F, 0xA7, 0xD0, 0x71, 0x35, 0xD2, 0xE0, -0x72, 0x6F, 0x89, 0xD0, 0x73, 0x15, 0xB4, 0xE0, 0x74, 0x4F, 0x6B, 0xD0, 0x74, 0xFE, 0xD1, 0x60, -0x76, 0x38, 0x88, 0x50, 0x76, 0xDE, 0xB3, 0x60, 0x78, 0x18, 0x6A, 0x50, 0x78, 0xBE, 0x95, 0x60, -0x79, 0xF8, 0x4C, 0x50, 0x7A, 0x9E, 0x77, 0x60, 0x7B, 0xD8, 0x2E, 0x50, 0x7C, 0x7E, 0x59, 0x60, -0x7D, 0xB8, 0x10, 0x50, 0x7E, 0x5E, 0x3B, 0x60, 0x7F, 0x97, 0xF2, 0x50, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0xFF, 0xFF, 0xC4, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x10, 0x4C, 0x4D, -0x54, 0x00, 0x41, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, -0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Canada/Central */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x01, 0xFB, 0xE0, -0x9B, 0xC3, 0xBA, 0x50, 0x9E, 0xB8, 0xA1, 0x80, 0x9F, 0xC0, 0x3F, 0x70, 0xC2, 0xA0, 0x3B, 0x80, -0xC3, 0x4F, 0x84, 0xF0, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x88, 0x68, 0x00, 0xD4, 0x53, 0x60, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDB, 0x00, 0x07, 0x00, 0xDB, 0xC8, 0x5C, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x29, 0x18, 0x70, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x12, 0x34, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0x91, 0xBC, 0xF0, 0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x31, 0x62, 0xF0, -0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xDE, 0x80, -0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xB1, 0x80, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x45, 0x80, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x7D, 0x80, -0x43, 0xB7, 0x6F, 0xE0, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, -0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, -0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, -0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, -0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, -0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, -0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, -0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, -0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, -0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, -0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, -0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, -0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, -0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, -0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, -0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, -0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, -0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x89, -0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Canada/Eastern */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x93, 0x70, -0x9F, 0xC0, 0x31, 0x60, 0xA0, 0x87, 0x2E, 0xC8, 0xA1, 0x9A, 0xB1, 0x40, 0xA2, 0x94, 0x06, 0xF0, -0xA3, 0x55, 0xA9, 0x40, 0xA4, 0x86, 0x5D, 0xF0, 0xA5, 0x28, 0x78, 0x60, 0xA6, 0x66, 0x3F, 0xF0, -0xA7, 0x0C, 0x4E, 0xE0, 0xA8, 0x46, 0x21, 0xF0, 0xA8, 0xEC, 0x30, 0xE0, 0xAA, 0x1C, 0xC9, 0x70, -0xAA, 0xD5, 0x4D, 0x60, 0xAB, 0xFC, 0xAB, 0x70, 0xAC, 0xB5, 0x2F, 0x60, 0xAD, 0xDC, 0x8D, 0x70, -0xAE, 0x95, 0x11, 0x60, 0xAF, 0xBC, 0x6F, 0x70, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70, -0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70, -0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x25, 0x13, 0xF0, -0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xE4, 0xD7, 0xF0, -0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0, -0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0, -0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70, -0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, -0xD4, 0x40, 0xDD, 0xE0, 0xD5, 0x55, 0xAA, 0xD0, 0xD6, 0x20, 0xA3, 0xC0, 0xD7, 0x35, 0x8C, 0xD0, -0xD8, 0x00, 0x85, 0xC0, 0xD9, 0x15, 0x6E, 0xD0, 0xDA, 0x33, 0x76, 0x40, 0xDA, 0xFE, 0xA7, 0x70, -0xDC, 0x13, 0x74, 0x60, 0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, -0xDF, 0x89, 0x64, 0x60, 0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, -0xE3, 0x49, 0x28, 0x60, 0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x29, 0x0A, 0x60, 0xE6, 0x47, 0x2D, 0xF0, -0xE7, 0x12, 0x26, 0xE0, 0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, -0xEA, 0xF6, 0xD4, 0xE0, 0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, -0xEE, 0xBF, 0xD3, 0x60, 0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, -0xF2, 0x7F, 0x97, 0x60, 0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, -0xF6, 0x3F, 0x5B, 0x60, 0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, -0xFA, 0x08, 0x59, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, -0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, -0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x08, 0x20, 0xC1, 0x70, -0x09, 0x10, 0xA4, 0x60, 0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, -0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, -0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, -0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, -0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, -0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, -0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, -0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, -0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, -0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, -0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, -0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, -0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, -0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, -0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, -0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, -0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, -0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, -0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, -0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, -0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, -0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, -0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, -0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, -0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, -0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, -0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, -0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, -0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, -0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, -0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, -0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, -0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - - -/* Canada/East-Saskatchewan */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x93, 0x1C, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xB5, 0x65, 0x4F, 0xF0, 0xB6, 0x30, 0x48, 0xE0, -0xB7, 0x45, 0x31, 0xF0, 0xB8, 0x10, 0x2A, 0xE0, 0xB9, 0x25, 0x13, 0xF0, 0xB9, 0xF0, 0x0C, 0xE0, -0xBB, 0x0E, 0x30, 0x70, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xEE, 0x12, 0x70, 0xBD, 0xB9, 0x0B, 0x60, -0xC2, 0x72, 0x08, 0xF0, 0xC3, 0x61, 0xEB, 0xE0, 0xC4, 0x51, 0xEA, 0xF0, 0xC5, 0x38, 0x93, 0x60, -0xC6, 0x31, 0xCC, 0xF0, 0xC7, 0x21, 0xAF, 0xE0, 0xC8, 0x1A, 0xE9, 0x70, 0xC9, 0x0A, 0xCC, 0x60, -0xC9, 0xFA, 0xCB, 0x70, 0xCA, 0xEA, 0xAE, 0x60, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x18, 0x00, 0xD3, 0x63, 0x8C, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10, -0xD9, 0xE0, 0xA0, 0x00, 0xDA, 0xFE, 0xC3, 0x90, 0xDB, 0xC0, 0x82, 0x00, 0xDC, 0xDE, 0xA5, 0x90, -0xDD, 0xA9, 0x9E, 0x80, 0xDE, 0xBE, 0x87, 0x90, 0xDF, 0x89, 0x80, 0x80, 0xE0, 0x9E, 0x69, 0x90, -0xE1, 0x69, 0x62, 0x80, 0xE2, 0x7E, 0x4B, 0x90, 0xE3, 0x49, 0x44, 0x80, 0xE4, 0x5E, 0x2D, 0x90, -0xE5, 0x29, 0x26, 0x80, 0xE6, 0x47, 0x4A, 0x10, 0xE7, 0x12, 0x43, 0x00, 0xE8, 0x27, 0x2C, 0x10, -0xE8, 0xF2, 0x25, 0x00, 0xEB, 0xE6, 0xF0, 0x10, 0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, 0xFF, 0x9D, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, -0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54, -0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Canada/Mountain */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x88, 0xDE, 0xCE, 0xE0, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xA0, 0x98, 0x91, 0x90, 0xA0, 0xD2, 0x85, 0x80, -0xA2, 0x8A, 0xE8, 0x90, 0xA3, 0x84, 0x06, 0x00, 0xA4, 0x6A, 0xCA, 0x90, 0xA5, 0x35, 0xC3, 0x80, -0xA6, 0x53, 0xE7, 0x10, 0xA7, 0x15, 0xA5, 0x80, 0xA8, 0x33, 0xC9, 0x10, 0xA8, 0xFE, 0xC2, 0x00, -0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, 0xFE, 0xB8, 0x39, 0x10, -0xFF, 0xA8, 0x1C, 0x00, 0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, -0x07, 0x30, 0xDE, 0x80, 0x08, 0x20, 0xDD, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xBF, 0x90, -0x0A, 0xF0, 0xA2, 0x80, 0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, -0x0E, 0xB9, 0xA1, 0x00, 0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, -0x12, 0x79, 0x65, 0x00, 0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, -0x16, 0x39, 0x29, 0x00, 0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, -0x1A, 0x02, 0x27, 0x80, 0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, -0x1D, 0xC1, 0xEB, 0x80, 0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, -0x21, 0x81, 0xAF, 0x80, 0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, -0x25, 0x4A, 0xAE, 0x00, 0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, -0x29, 0x0A, 0x72, 0x00, 0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, -0x2C, 0xD3, 0x70, 0x80, 0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, -0x30, 0x93, 0x34, 0x80, 0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, -0x34, 0x52, 0xF8, 0x80, 0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, -0x38, 0x1B, 0xF7, 0x00, 0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, -0x3B, 0xDB, 0xBB, 0x00, 0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, -0x3F, 0x9B, 0x7F, 0x00, 0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, -0x43, 0x64, 0x7D, 0x80, 0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, -0x47, 0x2D, 0x7C, 0x00, 0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, -0x4A, 0xED, 0x40, 0x00, 0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, -0x4E, 0xB6, 0x3E, 0x80, 0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, -0x52, 0x76, 0x02, 0x80, 0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, -0x56, 0x35, 0xC6, 0x80, 0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, -0x59, 0xFE, 0xC5, 0x00, 0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, -0x5D, 0xBE, 0x89, 0x00, 0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, -0x61, 0x87, 0x87, 0x80, 0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, -0x65, 0x47, 0x4B, 0x80, 0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, -0x69, 0x07, 0x0F, 0x80, 0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, -0x6C, 0xD0, 0x0E, 0x00, 0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, -0x70, 0x8F, 0xD2, 0x00, 0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, -0x74, 0x4F, 0x96, 0x00, 0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, -0x78, 0x18, 0x94, 0x80, 0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, -0x7B, 0xD8, 0x58, 0x80, 0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, -0x7F, 0x98, 0x1C, 0x80, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xFF, 0xFF, -0x95, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, -0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, -0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Canada/Newfoundland */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEE, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x9C, 0xCF, 0x62, 0x0C, -0x9D, 0xA4, 0xE6, 0xFC, 0x9E, 0xB8, 0x7E, 0x8C, 0x9F, 0xC0, 0x1C, 0x7C, 0xA0, 0xB6, 0x88, 0xDC, -0xA1, 0x38, 0xFF, 0x4C, 0xA2, 0x95, 0x19, 0x5C, 0xA3, 0x84, 0xFC, 0x4C, 0xA4, 0x74, 0xFB, 0x5C, -0xA5, 0x64, 0xDE, 0x4C, 0xA6, 0x5E, 0x17, 0xDC, 0xA7, 0x44, 0xC0, 0x4C, 0xA8, 0x3D, 0xF9, 0xDC, -0xA9, 0x24, 0xA2, 0x4C, 0xAA, 0x1D, 0xDB, 0xDC, 0xAB, 0x04, 0x84, 0x4C, 0xAB, 0xFD, 0xBD, 0xDC, -0xAC, 0xE4, 0x66, 0x4C, 0xAD, 0xDD, 0x9F, 0xDC, 0xAE, 0xCD, 0x82, 0xCC, 0xAF, 0xBD, 0x81, 0xDC, -0xB0, 0xAD, 0x64, 0xCC, 0xB1, 0xA6, 0x9E, 0x5C, 0xB2, 0x8D, 0x46, 0xCC, 0xB3, 0x86, 0x80, 0x5C, -0xB4, 0x6D, 0x28, 0xCC, 0xB5, 0x66, 0x62, 0x5C, 0xB6, 0x4D, 0x0A, 0xCC, 0xB7, 0x46, 0x44, 0x5C, -0xB8, 0x2C, 0xEC, 0xCC, 0xB9, 0x26, 0x26, 0x5C, 0xBA, 0x16, 0x09, 0x4C, 0xBB, 0x0F, 0x42, 0xDC, -0xBB, 0xF5, 0xEB, 0x4C, 0xBC, 0xEF, 0x24, 0xDC, 0xBD, 0xD5, 0xCD, 0x4C, 0xBE, 0x9E, 0x4D, 0x6C, -0xBE, 0xCF, 0x06, 0xA8, 0xBF, 0xB5, 0xAF, 0x18, 0xC0, 0xB8, 0x31, 0x38, 0xC1, 0x79, 0xEF, 0xA8, -0xC2, 0x98, 0x13, 0x38, 0xC3, 0x59, 0xD1, 0xA8, 0xC4, 0x77, 0xF5, 0x38, 0xC5, 0x39, 0xB3, 0xA8, -0xC6, 0x61, 0x11, 0xB8, 0xC7, 0x19, 0x95, 0xA8, 0xC8, 0x40, 0xF3, 0xB8, 0xC9, 0x02, 0xB2, 0x28, -0xCA, 0x20, 0xD5, 0xB8, 0xCA, 0xE2, 0x94, 0x28, 0xCC, 0x00, 0xB7, 0xB8, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x60, 0xE6, 0xC8, 0xD3, 0x88, 0x44, 0xD8, 0xD4, 0x4A, 0x03, 0x48, 0xD5, 0x68, 0x26, 0xD8, -0xD6, 0x29, 0xE5, 0x48, 0xD7, 0x48, 0x08, 0xD8, 0xD8, 0x09, 0xC7, 0x48, 0xD9, 0x27, 0xEA, 0xD8, -0xD9, 0xE9, 0xA9, 0x48, 0xDB, 0x11, 0x07, 0x58, 0xDB, 0xD2, 0xC5, 0xC8, 0xDC, 0xDE, 0x74, 0x58, -0xDD, 0xA9, 0x6D, 0x48, 0xDE, 0xBE, 0x56, 0x58, 0xDF, 0x89, 0x4F, 0x48, 0xE0, 0x9E, 0x38, 0x58, -0xE1, 0x69, 0x31, 0x48, 0xE2, 0x7E, 0x1A, 0x58, 0xE3, 0x49, 0x13, 0x48, 0xE4, 0x5D, 0xFC, 0x58, -0xE5, 0x28, 0xF5, 0x48, 0xE6, 0x47, 0x18, 0xD8, 0xE7, 0x12, 0x11, 0xC8, 0xE8, 0x26, 0xFA, 0xD8, -0xE8, 0xF1, 0xF3, 0xC8, 0xEA, 0x06, 0xDC, 0xD8, 0xEA, 0xD1, 0xD5, 0xC8, 0xEB, 0xE6, 0xBE, 0xD8, -0xEC, 0xB1, 0xB7, 0xC8, 0xED, 0xC6, 0xA0, 0xD8, 0xEE, 0xBF, 0xBE, 0x48, 0xEF, 0xAF, 0xBD, 0x58, -0xF0, 0x9F, 0xA0, 0x48, 0xF1, 0x8F, 0x9F, 0x58, 0xF2, 0x7F, 0x82, 0x48, 0xF3, 0x6F, 0x81, 0x58, -0xF4, 0x5F, 0x64, 0x48, 0xF5, 0x4F, 0x63, 0x58, 0xF6, 0x3F, 0x46, 0x48, 0xF7, 0x2F, 0x45, 0x58, -0xF8, 0x28, 0x62, 0xC8, 0xF9, 0x0F, 0x27, 0x58, 0xFA, 0x08, 0x44, 0xC8, 0xFA, 0xF8, 0x43, 0xD8, -0xFB, 0xE8, 0x26, 0xC8, 0xFC, 0xD8, 0x25, 0xD8, 0xFD, 0xC8, 0x08, 0xC8, 0xFE, 0xB8, 0x07, 0xD8, -0xFF, 0xA7, 0xEA, 0xC8, 0x00, 0x97, 0xE9, 0xD8, 0x01, 0x87, 0xCC, 0xC8, 0x02, 0x77, 0xCB, 0xD8, -0x03, 0x70, 0xE9, 0x48, 0x04, 0x60, 0xE8, 0x58, 0x05, 0x50, 0xCB, 0x48, 0x06, 0x40, 0xCA, 0x58, -0x07, 0x30, 0xAD, 0x48, 0x08, 0x20, 0xAC, 0x58, 0x09, 0x10, 0x8F, 0x48, 0x0A, 0x00, 0x8E, 0x58, -0x0A, 0xF0, 0x71, 0x48, 0x0B, 0xE0, 0x70, 0x58, 0x0C, 0xD9, 0x8D, 0xC8, 0x0D, 0xC0, 0x52, 0x58, -0x0E, 0xB9, 0x6F, 0xC8, 0x0F, 0xA9, 0x6E, 0xD8, 0x10, 0x99, 0x51, 0xC8, 0x11, 0x89, 0x50, 0xD8, -0x12, 0x79, 0x33, 0xC8, 0x13, 0x69, 0x32, 0xD8, 0x14, 0x59, 0x15, 0xC8, 0x15, 0x49, 0x14, 0xD8, -0x16, 0x38, 0xF7, 0xC8, 0x17, 0x28, 0xF6, 0xD8, 0x18, 0x22, 0x14, 0x48, 0x19, 0x08, 0xD8, 0xD8, -0x1A, 0x01, 0xF6, 0x48, 0x1A, 0xF1, 0xF5, 0x58, 0x1B, 0xE1, 0xD8, 0x48, 0x1C, 0xD1, 0xD7, 0x58, -0x1D, 0xC1, 0xBA, 0x48, 0x1E, 0xB1, 0xB9, 0x58, 0x1F, 0xA1, 0x9C, 0x48, 0x20, 0x75, 0xCF, 0xF4, -0x21, 0x81, 0x62, 0x64, 0x22, 0x55, 0xB1, 0xF4, 0x23, 0x6A, 0x70, 0xD4, 0x24, 0x35, 0x93, 0xF4, -0x25, 0x4A, 0x60, 0xE4, 0x26, 0x15, 0x75, 0xF4, 0x27, 0x2A, 0x42, 0xE4, 0x27, 0xFE, 0x92, 0x74, -0x29, 0x0A, 0x24, 0xE4, 0x29, 0xDE, 0x74, 0x74, 0x2A, 0xEA, 0x06, 0xE4, 0x2B, 0xBE, 0x56, 0x74, -0x2C, 0xD3, 0x23, 0x64, 0x2D, 0x9E, 0x38, 0x74, 0x2E, 0xB3, 0x05, 0x64, 0x2F, 0x7E, 0x1A, 0x74, -0x30, 0x92, 0xE7, 0x64, 0x31, 0x67, 0x36, 0xF4, 0x32, 0x72, 0xC9, 0x64, 0x33, 0x47, 0x18, 0xF4, -0x34, 0x52, 0xAB, 0x64, 0x35, 0x26, 0xFA, 0xF4, 0x36, 0x32, 0x8D, 0x64, 0x37, 0x06, 0xDC, 0xF4, -0x38, 0x1B, 0xA9, 0xE4, 0x38, 0xE6, 0xBE, 0xF4, 0x39, 0xFB, 0x8B, 0xE4, 0x3A, 0xC6, 0xA0, 0xF4, -0x3B, 0xDB, 0x6D, 0xE4, 0x3C, 0xAF, 0xBD, 0x74, 0x3D, 0xBB, 0x4F, 0xE4, 0x3E, 0x8F, 0x9F, 0x74, -0x3F, 0x9B, 0x31, 0xE4, 0x40, 0x6F, 0x81, 0x74, 0x41, 0x84, 0x4E, 0x64, 0x42, 0x4F, 0x63, 0x74, -0x43, 0x64, 0x30, 0x64, 0x44, 0x2F, 0x45, 0x74, 0x45, 0x44, 0x12, 0x64, 0x45, 0xF3, 0x77, 0xF4, -0x47, 0x2D, 0x2E, 0xE4, 0x47, 0xD3, 0x59, 0xF4, 0x49, 0x0D, 0x10, 0xE4, 0x49, 0xB3, 0x3B, 0xF4, -0x4A, 0xEC, 0xF2, 0xE4, 0x4B, 0x9C, 0x58, 0x74, 0x4C, 0xD6, 0x0F, 0x64, 0x4D, 0x7C, 0x3A, 0x74, -0x4E, 0xB5, 0xF1, 0x64, 0x4F, 0x5C, 0x1C, 0x74, 0x50, 0x95, 0xD3, 0x64, 0x51, 0x3B, 0xFE, 0x74, -0x52, 0x75, 0xB5, 0x64, 0x53, 0x1B, 0xE0, 0x74, 0x54, 0x55, 0x97, 0x64, 0x54, 0xFB, 0xC2, 0x74, -0x56, 0x35, 0x79, 0x64, 0x56, 0xE4, 0xDE, 0xF4, 0x58, 0x1E, 0x95, 0xE4, 0x58, 0xC4, 0xC0, 0xF4, -0x59, 0xFE, 0x77, 0xE4, 0x5A, 0xA4, 0xA2, 0xF4, 0x5B, 0xDE, 0x59, 0xE4, 0x5C, 0x84, 0x84, 0xF4, -0x5D, 0xBE, 0x3B, 0xE4, 0x5E, 0x64, 0x66, 0xF4, 0x5F, 0x9E, 0x1D, 0xE4, 0x60, 0x4D, 0x83, 0x74, -0x61, 0x87, 0x3A, 0x64, 0x62, 0x2D, 0x65, 0x74, 0x63, 0x67, 0x1C, 0x64, 0x64, 0x0D, 0x47, 0x74, -0x65, 0x46, 0xFE, 0x64, 0x65, 0xED, 0x29, 0x74, 0x67, 0x26, 0xE0, 0x64, 0x67, 0xCD, 0x0B, 0x74, -0x69, 0x06, 0xC2, 0x64, 0x69, 0xAC, 0xED, 0x74, 0x6A, 0xE6, 0xA4, 0x64, 0x6B, 0x96, 0x09, 0xF4, -0x6C, 0xCF, 0xC0, 0xE4, 0x6D, 0x75, 0xEB, 0xF4, 0x6E, 0xAF, 0xA2, 0xE4, 0x6F, 0x55, 0xCD, 0xF4, -0x70, 0x8F, 0x84, 0xE4, 0x71, 0x35, 0xAF, 0xF4, 0x72, 0x6F, 0x66, 0xE4, 0x73, 0x15, 0x91, 0xF4, -0x74, 0x4F, 0x48, 0xE4, 0x74, 0xFE, 0xAE, 0x74, 0x76, 0x38, 0x65, 0x64, 0x76, 0xDE, 0x90, 0x74, -0x78, 0x18, 0x47, 0x64, 0x78, 0xBE, 0x72, 0x74, 0x79, 0xF8, 0x29, 0x64, 0x7A, 0x9E, 0x54, 0x74, -0x7B, 0xD8, 0x0B, 0x64, 0x7C, 0x7E, 0x36, 0x74, 0x7D, 0xB7, 0xED, 0x64, 0x7E, 0x5E, 0x18, 0x74, -0x7F, 0x97, 0xCF, 0x64, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x06, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0xFF, 0xFF, 0xDC, 0xA4, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0x94, 0x00, 0x04, 0xFF, 0xFF, -0xDC, 0xD8, 0x01, 0x00, 0xFF, 0xFF, 0xCE, 0xC8, 0x00, 0x04, 0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x08, -0xFF, 0xFF, 0xDC, 0xD8, 0x01, 0x0C, 0xFF, 0xFF, 0xEA, 0xE8, 0x01, 0x10, 0x4E, 0x44, 0x54, 0x00, -0x4E, 0x53, 0x54, 0x00, 0x4E, 0x50, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, 0x44, 0x44, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Canada/Pacific */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0xBD, 0xA0, -0x9F, 0xC0, 0x5B, 0x90, 0xCB, 0x89, 0x1A, 0xA0, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, -0xD3, 0x76, 0x0F, 0x20, 0xD4, 0x53, 0x7D, 0x10, 0xD5, 0x55, 0xF1, 0x20, 0xD6, 0x20, 0xEA, 0x10, -0xD7, 0x35, 0xD3, 0x20, 0xD8, 0x00, 0xCC, 0x10, 0xD9, 0x15, 0xB5, 0x20, 0xD9, 0xE0, 0xAE, 0x10, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x08, 0x20, 0xEB, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x0A, 0x00, 0xCD, 0xA0, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, -0x90, 0x01, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, -0xFF, 0x9D, 0x90, 0x01, 0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, -0x00, 0x50, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Canada/Saskatchewan */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x86, 0xFD, 0x93, 0x1C, -0x9E, 0xB8, 0xAF, 0x90, 0x9F, 0xC0, 0x4D, 0x80, 0xB5, 0x65, 0x4F, 0xF0, 0xB6, 0x30, 0x48, 0xE0, -0xB7, 0x45, 0x31, 0xF0, 0xB8, 0x10, 0x2A, 0xE0, 0xB9, 0x25, 0x13, 0xF0, 0xB9, 0xF0, 0x0C, 0xE0, -0xBB, 0x0E, 0x30, 0x70, 0xBB, 0xCF, 0xEE, 0xE0, 0xBC, 0xEE, 0x12, 0x70, 0xBD, 0xB9, 0x0B, 0x60, -0xC2, 0x72, 0x08, 0xF0, 0xC3, 0x61, 0xEB, 0xE0, 0xC4, 0x51, 0xEA, 0xF0, 0xC5, 0x38, 0x93, 0x60, -0xC6, 0x31, 0xCC, 0xF0, 0xC7, 0x21, 0xAF, 0xE0, 0xC8, 0x1A, 0xE9, 0x70, 0xC9, 0x0A, 0xCC, 0x60, -0xC9, 0xFA, 0xCB, 0x70, 0xCA, 0xEA, 0xAE, 0x60, 0xCB, 0x89, 0x0C, 0x90, 0xD2, 0x23, 0xF4, 0x70, -0xD2, 0x61, 0x18, 0x00, 0xD3, 0x63, 0x8C, 0x10, 0xD4, 0x53, 0x6F, 0x00, 0xD5, 0x55, 0xE3, 0x10, -0xD6, 0x20, 0xDC, 0x00, 0xD7, 0x35, 0xC5, 0x10, 0xD8, 0x00, 0xBE, 0x00, 0xD9, 0x15, 0xA7, 0x10, -0xD9, 0xE0, 0xA0, 0x00, 0xDA, 0xFE, 0xC3, 0x90, 0xDB, 0xC0, 0x82, 0x00, 0xDC, 0xDE, 0xA5, 0x90, -0xDD, 0xA9, 0x9E, 0x80, 0xDE, 0xBE, 0x87, 0x90, 0xDF, 0x89, 0x80, 0x80, 0xE0, 0x9E, 0x69, 0x90, -0xE1, 0x69, 0x62, 0x80, 0xE2, 0x7E, 0x4B, 0x90, 0xE3, 0x49, 0x44, 0x80, 0xE4, 0x5E, 0x2D, 0x90, -0xE5, 0x29, 0x26, 0x80, 0xE6, 0x47, 0x4A, 0x10, 0xE7, 0x12, 0x43, 0x00, 0xE8, 0x27, 0x2C, 0x10, -0xE8, 0xF2, 0x25, 0x00, 0xEB, 0xE6, 0xF0, 0x10, 0xEC, 0xD6, 0xD3, 0x00, 0xED, 0xC6, 0xD2, 0x10, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x05, 0xFF, 0xFF, 0x9D, 0xE4, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, -0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x10, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x44, 0x54, -0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Canada/Yukon */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x9E, 0xB8, 0xCB, 0xB0, -0x9F, 0xBB, 0x23, 0xA0, 0xA0, 0xD0, 0x0C, 0xB0, 0xA1, 0xA2, 0xD2, 0x80, 0xCB, 0x89, 0x28, 0xB0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x34, 0x20, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x69, 0x1A, 0xB0, 0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, -0x16, 0x39, 0x37, 0x10, 0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, -0x1A, 0x02, 0x35, 0x90, 0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, -0x1D, 0xC1, 0xF9, 0x90, 0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, -0x21, 0x81, 0xBD, 0x90, 0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, -0x25, 0x4A, 0xBC, 0x10, 0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, -0x29, 0x0A, 0x80, 0x10, 0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, -0x2C, 0xD3, 0x7E, 0x90, 0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, -0x30, 0x93, 0x42, 0x90, 0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, -0x34, 0x53, 0x06, 0x90, 0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, -0x38, 0x1C, 0x05, 0x10, 0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, -0x3B, 0xDB, 0xC9, 0x10, 0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, -0x3F, 0x9B, 0x8D, 0x10, 0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, -0x43, 0x64, 0x8B, 0x90, 0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, -0x47, 0x2D, 0x8A, 0x10, 0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, -0x4A, 0xED, 0x4E, 0x10, 0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, -0x4E, 0xB6, 0x4C, 0x90, 0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, -0x52, 0x76, 0x10, 0x90, 0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, -0x56, 0x35, 0xD4, 0x90, 0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, -0x59, 0xFE, 0xD3, 0x10, 0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, -0x5D, 0xBE, 0x97, 0x10, 0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, -0x61, 0x87, 0x95, 0x90, 0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, -0x65, 0x47, 0x59, 0x90, 0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, -0x69, 0x07, 0x1D, 0x90, 0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, -0x6C, 0xD0, 0x1C, 0x10, 0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, -0x70, 0x8F, 0xE0, 0x10, 0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, -0x74, 0x4F, 0xA4, 0x10, 0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, -0x78, 0x18, 0xA2, 0x90, 0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, -0x7B, 0xD8, 0x66, 0x90, 0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, -0x7F, 0x98, 0x2A, 0x90, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x01, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0xFF, 0xFF, -0x8F, 0x80, 0x01, 0x08, 0xFF, 0xFF, 0x8F, 0x80, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x10, -0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x15, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x19, 0x59, 0x44, 0x54, 0x00, -0x59, 0x53, 0x54, 0x00, 0x59, 0x57, 0x54, 0x00, 0x59, 0x50, 0x54, 0x00, 0x59, 0x44, 0x44, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, -0x00, 0x00, 0x00, - -/* CET */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x4E, 0x40, 0x90, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Chile/Continental */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0D, 0x8F, 0x24, 0x69, 0xC6, -0x9B, 0x5C, 0xE5, 0x50, 0x9F, 0x71, 0x05, 0x46, 0xA1, 0x00, 0x71, 0xC0, 0xB0, 0x5E, 0x77, 0xC6, -0xB1, 0x77, 0x3D, 0x40, 0xB2, 0x41, 0x00, 0xD0, 0xB3, 0x58, 0x70, 0xC0, 0xB4, 0x22, 0x34, 0x50, -0xB5, 0x39, 0xA4, 0x40, 0xB6, 0x03, 0x67, 0xD0, 0xB7, 0x1A, 0xD7, 0xC0, 0xB7, 0xE4, 0x9B, 0x50, -0xB8, 0xFD, 0x5C, 0xC0, 0xB9, 0xC7, 0x20, 0x50, 0xCC, 0x1C, 0x6E, 0x40, 0xCC, 0x6C, 0xE7, 0xD0, -0xD4, 0x1B, 0xC9, 0xB0, 0xD5, 0x76, 0xA0, 0x50, 0xFD, 0xD1, 0x3C, 0x40, 0xFE, 0x92, 0xFA, 0xB0, -0xFF, 0xCC, 0xCD, 0xC0, 0x00, 0x72, 0xDC, 0xB0, 0x01, 0x75, 0x50, 0xC0, 0x02, 0x40, 0x49, 0xB0, -0x03, 0x55, 0x32, 0xC0, 0x04, 0x20, 0x2B, 0xB0, 0x05, 0x3E, 0x4F, 0x40, 0x06, 0x00, 0x0D, 0xB0, -0x07, 0x0B, 0xBC, 0x40, 0x07, 0xDF, 0xEF, 0xB0, 0x08, 0xFE, 0x13, 0x40, 0x09, 0xBF, 0xD1, 0xB0, -0x0A, 0xDD, 0xF5, 0x40, 0x0B, 0xA8, 0xEE, 0x30, 0x0C, 0xBD, 0xD7, 0x40, 0x0D, 0x88, 0xD0, 0x30, -0x0E, 0x9D, 0xB9, 0x40, 0x0F, 0x68, 0xB2, 0x30, 0x10, 0x86, 0xD5, 0xC0, 0x11, 0x48, 0x94, 0x30, -0x12, 0x66, 0xB7, 0xC0, 0x13, 0x28, 0x76, 0x30, 0x14, 0x46, 0x99, 0xC0, 0x15, 0x11, 0x92, 0xB0, -0x16, 0x26, 0x7B, 0xC0, 0x16, 0xF1, 0x74, 0xB0, 0x18, 0x06, 0x5D, 0xC0, 0x18, 0xD1, 0x56, 0xB0, -0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, 0x1C, 0x91, 0x1A, 0xB0, -0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, 0x20, 0x7F, 0x03, 0x30, -0x21, 0x6F, 0x02, 0x40, 0x22, 0x39, 0xFB, 0x30, 0x23, 0x45, 0xA9, 0xC0, 0x24, 0x19, 0xDD, 0x30, -0x25, 0x38, 0x00, 0xC0, 0x26, 0x02, 0xF9, 0xB0, 0x26, 0xF2, 0xF8, 0xC0, 0x27, 0xD9, 0xA1, 0x30, -0x28, 0xF7, 0xC4, 0xC0, 0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, 0x2B, 0xA2, 0x9F, 0xB0, -0x2C, 0xB7, 0x88, 0xC0, 0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, 0x2F, 0x62, 0x63, 0xB0, -0x30, 0x80, 0x87, 0x40, 0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x3D, 0xD7, 0x30, -0x34, 0x40, 0x4B, 0x40, 0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, 0x37, 0x06, 0xD5, 0xB0, -0x38, 0x00, 0x0F, 0x40, 0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, 0x3A, 0xAA, 0xEA, 0x30, -0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, 0x3E, 0x6A, 0xAE, 0x30, -0x3F, 0x88, 0xD1, 0xC0, 0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, 0x42, 0x33, 0xAC, 0xB0, -0x43, 0x48, 0x95, 0xC0, 0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, 0x45, 0xF3, 0x70, 0xB0, -0x47, 0x11, 0x94, 0x40, 0x47, 0xEF, 0x02, 0x30, 0x48, 0xF1, 0x76, 0x40, 0x49, 0xBC, 0x6F, 0x30, -0x4A, 0xD1, 0x58, 0x40, 0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, 0x4D, 0x7C, 0x33, 0x30, -0x4E, 0x91, 0x1C, 0x40, 0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, 0x51, 0x3B, 0xF7, 0x30, -0x52, 0x5A, 0x1A, 0xC0, 0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, 0x55, 0x04, 0xF5, 0xB0, -0x56, 0x19, 0xDE, 0xC0, 0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, 0x58, 0xC4, 0xB9, 0xB0, -0x59, 0xE2, 0xDD, 0x40, 0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, 0x5C, 0x84, 0x7D, 0xB0, -0x5D, 0xA2, 0xA1, 0x40, 0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, 0x60, 0x4D, 0x7C, 0x30, -0x61, 0x62, 0x65, 0x40, 0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, 0x64, 0x0D, 0x40, 0x30, -0x65, 0x2B, 0x63, 0xC0, 0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, 0x67, 0xCD, 0x04, 0x30, -0x68, 0xEB, 0x27, 0xC0, 0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, 0x6B, 0x96, 0x02, 0xB0, -0x6C, 0xAA, 0xEB, 0xC0, 0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, 0x6F, 0x55, 0xC6, 0xB0, -0x70, 0x73, 0xEA, 0x40, 0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, 0x73, 0x15, 0x8A, 0xB0, -0x74, 0x33, 0xAE, 0x40, 0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, 0x76, 0xDE, 0x89, 0x30, -0x77, 0xF3, 0x72, 0x40, 0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, 0x7A, 0x9E, 0x4D, 0x30, -0x7B, 0xBC, 0x70, 0xC0, 0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, 0x7E, 0x67, 0x4B, 0xB0, -0x7F, 0x7C, 0x34, 0xC0, 0x01, 0x00, 0x02, 0x00, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x04, 0x05, 0x04, 0x02, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0xFF, 0xFF, 0xBD, 0xBA, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, -0xC7, 0xC0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, -0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x04, 0x53, 0x4D, 0x54, 0x00, 0x43, 0x4C, 0x54, 0x00, 0x43, 0x4C, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, -0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Chile/EasterIsland */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB9, 0xC7, 0x40, 0x88, -0xCC, 0x1C, 0x6E, 0x40, 0xCC, 0x6C, 0xE7, 0xD0, 0xD4, 0x1B, 0xC9, 0xB0, 0xFD, 0xD1, 0x3C, 0x40, -0xFE, 0x92, 0xFA, 0xB0, 0xFF, 0xCC, 0xCD, 0xC0, 0x00, 0x72, 0xDC, 0xB0, 0x01, 0x75, 0x50, 0xC0, -0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0, 0x04, 0x20, 0x2B, 0xB0, 0x05, 0x3E, 0x4F, 0x40, -0x06, 0x00, 0x0D, 0xB0, 0x07, 0x0B, 0xBC, 0x40, 0x07, 0xDF, 0xEF, 0xB0, 0x08, 0xFE, 0x13, 0x40, -0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40, 0x0B, 0xA8, 0xEE, 0x30, 0x0C, 0xBD, 0xD7, 0x40, -0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40, 0x0F, 0x68, 0xB2, 0x30, 0x10, 0x86, 0xD5, 0xC0, -0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x28, 0x76, 0x30, 0x14, 0x46, 0x99, 0xC0, -0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0, 0x16, 0xF1, 0x74, 0xB0, 0x18, 0x06, 0x5D, 0xC0, -0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, -0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, -0x20, 0x7F, 0x03, 0x30, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x39, 0xFB, 0x30, 0x23, 0x45, 0xA9, 0xC0, -0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x26, 0x02, 0xF9, 0xB0, 0x26, 0xF2, 0xF8, 0xC0, -0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0, 0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, -0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0, 0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, -0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40, 0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, -0x33, 0x3D, 0xD7, 0x30, 0x34, 0x40, 0x4B, 0x40, 0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, -0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40, 0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, -0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, -0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0, 0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, -0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0, 0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, -0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40, 0x47, 0xEF, 0x02, 0x30, 0x48, 0xF1, 0x76, 0x40, -0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40, 0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, -0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40, 0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, -0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0, 0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, -0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0, 0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, -0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, -0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40, 0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, -0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40, 0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, -0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, -0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0, 0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, -0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0, 0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, -0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40, 0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, -0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40, 0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, -0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40, 0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, -0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0, 0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, -0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0x99, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0x9D, -0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x09, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x09, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x09, 0x45, 0x4D, 0x54, 0x00, 0x45, -0x41, 0x53, 0x54, 0x00, 0x45, 0x41, 0x53, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, -0x00, 0x00, - -/* CST6CDT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, -0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, -0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, 0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, -0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, 0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, -0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, -0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, -0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, -0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, -0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, -0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, -0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, -0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, -0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, -0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, -0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, -0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, -0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, -0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, -0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, -0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, -0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, -0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, -0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, -0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, -0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, -0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0x43, 0x44, 0x54, -0x00, 0x43, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* Cuba */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0xAC, 0x62, 0xC2, 0x80, -0xB1, 0xD3, 0x94, 0x50, 0xB2, 0x74, 0x5D, 0x40, 0xC8, 0x5B, 0x66, 0xD0, 0xC8, 0xD3, 0x51, 0x40, -0xCA, 0x3B, 0x48, 0xD0, 0xCA, 0xBC, 0x6D, 0xC0, 0xCC, 0x24, 0x65, 0x50, 0xCC, 0x9C, 0x4F, 0xC0, -0xD1, 0xC4, 0x0B, 0x50, 0xD2, 0x3B, 0xF5, 0xC0, 0xD3, 0xA3, 0xED, 0x50, 0xD4, 0x1B, 0xD7, 0xC0, -0xF7, 0x60, 0x05, 0xD0, 0xF7, 0xFF, 0x7D, 0x40, 0xF9, 0x3D, 0x44, 0xD0, 0xF9, 0xE3, 0x53, 0xC0, -0xFA, 0xDB, 0x3B, 0xD0, 0xFB, 0xA7, 0x86, 0x40, 0xFC, 0xC5, 0xA9, 0xD0, 0xFD, 0x87, 0x68, 0x40, -0xFE, 0xB8, 0x00, 0xD0, 0xFF, 0xA7, 0xE3, 0xC0, 0x00, 0x97, 0xE2, 0xD0, 0x01, 0x87, 0xC5, 0xC0, -0x02, 0x77, 0xC4, 0xD0, 0x03, 0x70, 0xE2, 0x40, 0x04, 0x60, 0xE1, 0x50, 0x05, 0x35, 0x14, 0xC0, -0x06, 0x40, 0xC3, 0x50, 0x07, 0x16, 0x48, 0x40, 0x08, 0x20, 0xA5, 0x50, 0x08, 0xF7, 0x7B, 0xC0, -0x0A, 0x00, 0x87, 0x50, 0x0A, 0xF0, 0x6A, 0x40, 0x0B, 0xE0, 0x69, 0x50, 0x0C, 0xD9, 0x86, 0xC0, -0x0D, 0xC0, 0x4B, 0x50, 0x0E, 0xB9, 0x68, 0xC0, 0x0F, 0xB2, 0xA2, 0x50, 0x10, 0x7D, 0x9B, 0x40, -0x11, 0x51, 0xEA, 0xD0, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x31, 0xCC, 0xD0, 0x14, 0x46, 0x99, 0xC0, -0x15, 0x5B, 0x82, 0xD0, 0x16, 0x26, 0x7B, 0xC0, 0x17, 0x3B, 0x64, 0xD0, 0x18, 0x06, 0x5D, 0xC0, -0x19, 0x1B, 0x46, 0xD0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xFB, 0x28, 0xD0, 0x1B, 0xCF, 0x5C, 0x40, -0x1C, 0xDB, 0x0A, 0xD0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x7A, 0x53, 0x50, 0x1F, 0x8F, 0x20, 0x40, -0x20, 0x5A, 0x35, 0x50, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x43, 0x51, 0xD0, 0x23, 0x4E, 0xE4, 0x40, -0x24, 0x23, 0x33, 0xD0, 0x25, 0x2E, 0xC6, 0x40, 0x26, 0x15, 0x8A, 0xD0, 0x27, 0x17, 0xE2, 0xC0, -0x27, 0xFE, 0xA7, 0x50, 0x28, 0xF7, 0xD2, 0xD0, 0x29, 0xDE, 0x89, 0x50, 0x2A, 0xD7, 0xB4, 0xD0, -0x2B, 0xBE, 0x6B, 0x50, 0x2C, 0xB7, 0x96, 0xD0, 0x2D, 0x9E, 0x4D, 0x50, 0x2E, 0x97, 0x78, 0xD0, -0x2F, 0x7E, 0x2F, 0x50, 0x30, 0x77, 0x5A, 0xD0, 0x31, 0x67, 0x4B, 0xD0, 0x32, 0x57, 0x3C, 0xD0, -0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50, -0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0, -0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0, -0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50, -0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50, -0x49, 0xBC, 0x8B, 0x50, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0xA5, 0xA7, 0xD0, 0x4C, 0xCC, 0xF7, 0xD0, -0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xAC, 0xD9, 0xD0, 0x4F, 0x65, 0x6B, 0xD0, 0x50, 0x8C, 0xBB, 0xD0, -0x51, 0x45, 0x4D, 0xD0, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x25, 0x2F, 0xD0, 0x54, 0x4C, 0x7F, 0xD0, -0x55, 0x05, 0x11, 0xD0, 0x56, 0x2C, 0x61, 0xD0, 0x56, 0xEE, 0x2E, 0x50, 0x58, 0x15, 0x7E, 0x50, -0x58, 0xCE, 0x10, 0x50, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xAD, 0xF2, 0x50, 0x5B, 0xD5, 0x42, 0x50, -0x5C, 0x8D, 0xD4, 0x50, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x6D, 0xB6, 0x50, 0x5F, 0x95, 0x06, 0x50, -0x60, 0x56, 0xD2, 0xD0, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x36, 0xB4, 0xD0, 0x63, 0x5E, 0x04, 0xD0, -0x64, 0x16, 0x96, 0xD0, 0x65, 0x3D, 0xE6, 0xD0, 0x65, 0xF6, 0x78, 0xD0, 0x67, 0x1D, 0xC8, 0xD0, -0x67, 0xD6, 0x5A, 0xD0, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xB6, 0x3C, 0xD0, 0x6A, 0xDD, 0x8C, 0xD0, -0x6B, 0x9F, 0x59, 0x50, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x7F, 0x3B, 0x50, 0x6E, 0xA6, 0x8B, 0x50, -0x6F, 0x5F, 0x1D, 0x50, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x3E, 0xFF, 0x50, 0x72, 0x66, 0x4F, 0x50, -0x73, 0x1E, 0xE1, 0x50, 0x74, 0x46, 0x31, 0x50, 0x75, 0x07, 0xFD, 0xD0, 0x76, 0x2F, 0x4D, 0xD0, -0x76, 0xE7, 0xDF, 0xD0, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xC7, 0xC1, 0xD0, 0x79, 0xEF, 0x11, 0xD0, -0x7A, 0xA7, 0xA3, 0xD0, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0x87, 0x85, 0xD0, 0x7D, 0xAE, 0xD5, 0xD0, -0x7E, 0x67, 0x67, 0xD0, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0xFF, 0xFF, 0xB2, 0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x04, 0x48, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, -0x00, 0x00, 0x00, - -/* EET */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x0D, 0xA4, 0x63, 0x90, -0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, -0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, -0x00, 0x00, 0x00, - -/* Egypt */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAE, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xC8, 0x93, 0xB4, 0xE0, -0xC8, 0xFA, 0x7B, 0xD0, 0xC9, 0xFC, 0xEF, 0xE0, 0xCA, 0xC7, 0xE8, 0xD0, 0xCB, 0xCB, 0xAE, 0x60, -0xCC, 0xDF, 0x29, 0xD0, 0xCD, 0xAC, 0xE1, 0xE0, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0, -0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xAD, 0x50, 0xE8, 0x36, 0x63, 0x60, -0xE8, 0xF4, 0x2D, 0x50, 0xEA, 0x0B, 0xB9, 0x60, 0xEA, 0xD5, 0x60, 0xD0, 0xEB, 0xEC, 0xFA, 0xF0, -0xEC, 0xB5, 0x6D, 0x00, 0xED, 0xCF, 0x7F, 0xF0, 0xEE, 0x97, 0xF2, 0x00, 0xEF, 0xB0, 0xB3, 0x70, -0xF0, 0x79, 0x25, 0x80, 0xF1, 0x91, 0xE6, 0xF0, 0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x73, 0x1A, 0x70, -0xF4, 0x3B, 0x8C, 0x80, 0xF5, 0x55, 0x9F, 0x70, 0xF6, 0x1E, 0x11, 0x80, 0xF7, 0x36, 0xD2, 0xF0, -0xF7, 0xFF, 0x45, 0x00, 0xF9, 0x18, 0x06, 0x70, 0xF9, 0xE1, 0xCA, 0x00, 0xFA, 0xF9, 0x39, 0xF0, -0xFB, 0xC2, 0xFD, 0x80, 0xFC, 0xDB, 0xBE, 0xF0, 0xFD, 0xA5, 0x82, 0x80, 0xFE, 0xBC, 0xF2, 0x70, -0xFF, 0x86, 0xB6, 0x00, 0x00, 0x9E, 0x25, 0xF0, 0x01, 0x67, 0xE9, 0x80, 0x02, 0x7F, 0x59, 0x70, -0x03, 0x49, 0x1D, 0x00, 0x04, 0x61, 0xDE, 0x70, 0x05, 0x2B, 0xA2, 0x00, 0x06, 0x43, 0x11, 0xF0, -0x07, 0x0C, 0xD5, 0x80, 0x08, 0x24, 0x45, 0x70, 0x08, 0xEE, 0x09, 0x00, 0x0A, 0x05, 0x78, 0xF0, -0x0A, 0xCF, 0x3C, 0x80, 0x0B, 0xE7, 0xFD, 0xF0, 0x0C, 0xB1, 0xC1, 0x80, 0x0D, 0xC9, 0x31, 0x70, -0x0E, 0x92, 0xF5, 0x00, 0x0F, 0xAA, 0x64, 0xF0, 0x10, 0x74, 0x28, 0x80, 0x11, 0x8B, 0x98, 0x70, -0x12, 0x55, 0x5C, 0x00, 0x13, 0x6E, 0x1D, 0x70, 0x14, 0x37, 0xE1, 0x00, 0x15, 0x4F, 0x50, 0xF0, -0x16, 0x19, 0x14, 0x80, 0x17, 0xA0, 0x93, 0xF0, 0x17, 0xFA, 0x48, 0x00, 0x19, 0x70, 0xA3, 0xF0, -0x19, 0xDB, 0x7B, 0x80, 0x1A, 0xF4, 0x3C, 0xF0, 0x1B, 0xBE, 0x00, 0x80, 0x1C, 0xD5, 0x70, 0x70, -0x1D, 0x9F, 0x34, 0x00, 0x1E, 0xB6, 0xA3, 0xF0, 0x1F, 0x80, 0x67, 0x80, 0x20, 0x97, 0xD7, 0x70, -0x21, 0x61, 0x9B, 0x00, 0x22, 0x7A, 0x5C, 0x70, 0x23, 0x44, 0x20, 0x00, 0x24, 0x62, 0x27, 0x70, -0x25, 0x25, 0x53, 0x80, 0x26, 0x3C, 0xC3, 0x70, 0x27, 0x06, 0x87, 0x00, 0x28, 0x1D, 0xF6, 0xF0, -0x28, 0xE7, 0xBA, 0x80, 0x2A, 0x00, 0x7B, 0xF0, 0x2A, 0xCA, 0x3F, 0x80, 0x2B, 0xE1, 0xAF, 0x70, -0x2C, 0xAB, 0x73, 0x00, 0x2D, 0xC2, 0xE2, 0xF0, 0x2E, 0x8C, 0xA6, 0x80, 0x2F, 0xA0, 0x13, 0xE0, -0x30, 0x6B, 0x0C, 0xD0, 0x31, 0x7F, 0xF5, 0xE0, 0x32, 0x4A, 0xEE, 0xD0, 0x33, 0x5F, 0xD7, 0xE0, -0x34, 0x2A, 0xD0, 0xD0, 0x35, 0x3F, 0xB9, 0xE0, 0x36, 0x0A, 0xB2, 0xD0, 0x37, 0x28, 0xD6, 0x60, -0x37, 0xF3, 0xCF, 0x50, 0x39, 0x08, 0xB8, 0x60, 0x39, 0xD3, 0xB1, 0x50, 0x3A, 0xE8, 0x9A, 0x60, -0x3B, 0xB3, 0x93, 0x50, 0x3C, 0xC8, 0x7C, 0x60, 0x3D, 0x93, 0x75, 0x50, 0x3E, 0xA8, 0x5E, 0x60, -0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0, -0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 0x46, 0x31, 0x20, 0xE0, -0x46, 0xE0, 0x6A, 0x50, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xF0, 0xE4, 0xE0, -0x4A, 0x96, 0xF3, 0xD0, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0x76, 0xD5, 0xD0, 0x4D, 0xB9, 0xE3, 0x60, -0x4E, 0x56, 0xB7, 0xD0, 0x4F, 0x99, 0xC5, 0x60, 0x50, 0x3F, 0xD4, 0x50, 0x51, 0x79, 0xA7, 0x60, -0x52, 0x1F, 0xB6, 0x50, 0x53, 0x59, 0x89, 0x60, 0x53, 0xFF, 0x98, 0x50, 0x55, 0x39, 0x6B, 0x60, -0x55, 0xDF, 0x7A, 0x50, 0x57, 0x22, 0x87, 0xE0, 0x57, 0xBF, 0x5C, 0x50, 0x59, 0x02, 0x69, 0xE0, -0x59, 0xA8, 0x78, 0xD0, 0x5A, 0xE2, 0x4B, 0xE0, 0x5B, 0x88, 0x5A, 0xD0, 0x5C, 0xC2, 0x2D, 0xE0, -0x5D, 0x68, 0x3C, 0xD0, 0x5E, 0xA2, 0x0F, 0xE0, 0x5F, 0x48, 0x1E, 0xD0, 0x60, 0x8B, 0x2C, 0x60, -0x61, 0x28, 0x00, 0xD0, 0x62, 0x6B, 0x0E, 0x60, 0x63, 0x07, 0xE2, 0xD0, 0x64, 0x4A, 0xF0, 0x60, -0x64, 0xF0, 0xFF, 0x50, 0x66, 0x2A, 0xD2, 0x60, 0x66, 0xD0, 0xE1, 0x50, 0x68, 0x0A, 0xB4, 0x60, -0x68, 0xB0, 0xC3, 0x50, 0x69, 0xEA, 0x96, 0x60, 0x6A, 0x90, 0xA5, 0x50, 0x6B, 0xD3, 0xB2, 0xE0, -0x6C, 0x70, 0x87, 0x50, 0x6D, 0xB3, 0x94, 0xE0, 0x6E, 0x59, 0xA3, 0xD0, 0x6F, 0x93, 0x76, 0xE0, -0x70, 0x39, 0x85, 0xD0, 0x71, 0x73, 0x58, 0xE0, 0x72, 0x19, 0x67, 0xD0, 0x73, 0x53, 0x3A, 0xE0, -0x73, 0xF9, 0x49, 0xD0, 0x75, 0x3C, 0x57, 0x60, 0x75, 0xD9, 0x2B, 0xD0, 0x77, 0x1C, 0x39, 0x60, -0x77, 0xB9, 0x0D, 0xD0, 0x78, 0xFC, 0x1B, 0x60, 0x79, 0xA2, 0x2A, 0x50, 0x7A, 0xDB, 0xFD, 0x60, -0x7B, 0x82, 0x0C, 0x50, 0x7C, 0xBB, 0xDF, 0x60, 0x7D, 0x61, 0xEE, 0x50, 0x7E, 0x9B, 0xC1, 0x60, -0x7F, 0x41, 0xD0, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Eire */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE5, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x26, 0xB3, 0x91, -0x9B, 0xD6, 0x0B, 0x11, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA5, 0x94, 0x3F, 0x00, -0xA6, 0x25, 0x60, 0x20, 0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, -0xAA, 0x00, 0xD3, 0xA0, 0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, -0xAD, 0xC9, 0xD2, 0x20, 0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, -0xB1, 0x92, 0xD0, 0xA0, 0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, -0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, -0xB9, 0x12, 0x58, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, -0xBC, 0xDB, 0x57, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, -0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, -0xC4, 0x51, 0xA4, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, -0xC7, 0xDA, 0x09, 0xA0, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x1E, 0x21, 0xA0, 0xD6, 0x4E, 0x9E, 0x10, -0xD7, 0x2C, 0x28, 0x20, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, -0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, 0xDD, 0xC4, 0xF9, 0xA0, -0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, 0xE1, 0x72, 0x48, 0xA0, -0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, 0xE5, 0x32, 0x0C, 0xA0, -0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, 0xE8, 0xFB, 0x0B, 0x20, -0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, 0xEC, 0xBA, 0xCF, 0x20, -0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, 0xF0, 0x9F, 0x7D, 0x20, -0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, 0xF4, 0x5F, 0x41, 0x20, -0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, 0xF8, 0x1F, 0x05, 0x20, -0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, -0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, 0x04, 0x29, 0x58, 0x20, -0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, 0x07, 0xE9, 0x1C, 0x20, -0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, 0x0B, 0xB2, 0x1A, 0xA0, -0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, 0x0F, 0x71, 0xDE, 0xA0, -0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, 0x13, 0x31, 0xA2, 0xA0, -0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, 0x30, 0xE7, 0x24, 0x00, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x06, 0x05, 0x06, 0x05, 0x06, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x07, 0x09, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0xFF, 0xFF, 0xFA, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1F, 0x01, -0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, -0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0C, 0x44, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* EST */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, -0x00, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* EST5EDT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x1E, 0x70, -0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x86, 0x00, 0x70, 0xA1, 0x9A, 0xCD, 0x60, 0xCB, 0x88, 0xF0, 0x70, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, -0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, -0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, 0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, -0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, 0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, -0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, 0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, -0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, 0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, -0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, 0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, -0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, 0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, -0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, 0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, -0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, 0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, -0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, 0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, -0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, 0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, -0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, 0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, -0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, 0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, -0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, 0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, -0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, -0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, -0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, -0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, -0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, -0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, -0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, -0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, -0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, -0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, -0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, -0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, -0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, -0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, -0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, -0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* Etc/GMT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT0 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-0 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+0 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-1 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+1 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xF1, 0xF0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-10 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x30, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+10 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x30, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-11 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x9A, 0xB0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+11 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-12 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+12 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x57, 0x40, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-13 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xB6, 0xD0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x33, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-14 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xC4, 0xE0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x31, 0x34, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-2 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x32, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+2 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xE3, 0xE0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x32, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-3 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x2A, 0x30, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x33, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+3 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xD5, 0xD0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x33, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-4 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x38, 0x40, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x34, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+4 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xC7, 0xC0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x34, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-5 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x46, 0x50, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x35, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+5 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xB9, 0xB0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x35, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-6 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x54, 0x60, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x36, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+6 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x36, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-7 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x62, 0x70, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x37, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+7 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x9D, 0x90, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x37, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-8 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x70, 0x80, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x38, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+8 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x8F, 0x80, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x38, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT-9 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x7E, 0x90, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2D, 0x39, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/GMT+9 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x81, 0x70, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x2B, 0x39, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Etc/Greenwich */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Etc/UCT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Etc/Universal */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Etc/UTC */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Etc/Zulu */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Europe/Amsterdam */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x1A, 0x9B, 0x0C, 0x2E, 0xEC, -0x9B, 0xD5, 0xD6, 0x5C, 0x9C, 0xD9, 0xB8, 0x0C, 0x9D, 0xA4, 0xBF, 0x0C, 0x9E, 0xA7, 0x25, 0x0C, -0x9F, 0x97, 0x16, 0x0C, 0xA0, 0x90, 0x41, 0x8C, 0xA1, 0x76, 0xF8, 0x0C, 0xA2, 0x70, 0x23, 0x8C, -0xA3, 0x56, 0xDA, 0x0C, 0xA4, 0x50, 0x05, 0x8C, 0xA5, 0x36, 0xBC, 0x0C, 0xA6, 0x25, 0x5B, 0x8C, -0xA7, 0x27, 0xC1, 0x8C, 0xA8, 0x5E, 0xE3, 0x8C, 0xA9, 0x07, 0xA3, 0x8C, 0xA9, 0xEE, 0x5A, 0x0C, -0xAA, 0xE7, 0x85, 0x8C, 0xAC, 0x27, 0xE2, 0x0C, 0xAC, 0xC7, 0x67, 0x8C, 0xAD, 0xED, 0x66, 0x0C, -0xAE, 0xA7, 0x49, 0x8C, 0xAF, 0xCE, 0x99, 0x8C, 0xB0, 0x87, 0x2B, 0x8C, 0xB1, 0xB1, 0x1E, 0x8C, -0xB2, 0x70, 0x48, 0x0C, 0xB3, 0x92, 0x52, 0x0C, 0xB4, 0x50, 0x2A, 0x0C, 0xB5, 0x73, 0x85, 0x8C, -0xB6, 0x30, 0x0C, 0x0C, 0xB7, 0x54, 0xB9, 0x0C, 0xB8, 0x0F, 0xEE, 0x0C, 0xB9, 0x40, 0x78, 0x8C, -0xB9, 0xEF, 0xD0, 0x0C, 0xBB, 0x18, 0x71, 0x8C, 0xBB, 0xD8, 0xEC, 0x8C, 0xBC, 0xF9, 0xA5, 0x0C, -0xBD, 0xB8, 0xCE, 0x8C, 0xBE, 0xDA, 0xD8, 0x8C, 0xBF, 0x98, 0xB0, 0x8C, 0xC0, 0xBD, 0x5D, 0x8C, -0xC1, 0x78, 0x92, 0x8C, 0xC2, 0xA7, 0xCB, 0x8C, 0xC2, 0xDC, 0x5D, 0x5C, 0xC3, 0x58, 0x74, 0x70, -0xC4, 0x7F, 0xC4, 0x70, 0xC5, 0x38, 0x56, 0x70, 0xC6, 0x60, 0xF7, 0xF0, 0xC7, 0x21, 0x72, 0xF0, -0xC8, 0x44, 0xB2, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, -0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, -0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x09, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x0C, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x00, 0x00, 0x12, 0xA4, 0x01, 0x00, 0x00, 0x00, 0x04, 0x94, 0x00, 0x04, 0x00, 0x00, 0x12, 0xA4, -0x01, 0x00, 0x00, 0x00, 0x04, 0x94, 0x00, 0x04, 0x00, 0x00, 0x04, 0xB0, 0x00, 0x08, 0x00, 0x00, -0x12, 0xC0, 0x01, 0x0C, 0x00, 0x00, 0x12, 0xC0, 0x01, 0x0C, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x11, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x15, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x11, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x11, 0x4E, 0x53, -0x54, 0x00, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x45, 0x54, 0x00, 0x4E, 0x45, 0x53, 0x54, 0x00, 0x43, -0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, -0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0xD9, 0x3B, 0xFA, 0x01, 0x1A, 0x22, 0x90, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Andorra */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0xD4, 0x41, 0xDB, 0x00, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x57, 0x45, 0x54, 0x00, 0x43, -0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, -0x00, 0xCA, 0x2D, 0xD0, 0x01, 0x14, 0xF8, 0xF2, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Athens */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x80, 0x21, 0x80, -0xB9, 0x7C, 0xE9, 0xE0, 0xB9, 0xC6, 0xAF, 0xD0, 0xC9, 0xF2, 0x63, 0xE0, 0xCA, 0x10, 0xA8, 0x50, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xAA, 0x4C, 0xF0, 0xCE, 0xA2, 0x18, 0xE0, 0xCF, 0x93, 0x69, 0x70, -0xDF, 0x13, 0x9E, 0x60, 0xDF, 0xB7, 0x0A, 0x50, 0x09, 0xEC, 0x5E, 0x60, 0x0B, 0x18, 0xF4, 0x60, -0x0B, 0xCD, 0xAE, 0x00, 0x0C, 0xBD, 0x9F, 0x00, 0x0D, 0xA4, 0x55, 0x80, 0x0E, 0x8C, 0x5D, 0x80, -0x0F, 0x84, 0x37, 0x80, 0x10, 0x6A, 0xFC, 0x10, 0x11, 0x64, 0x7B, 0xF0, 0x12, 0x52, 0xAA, 0xF0, -0x13, 0x46, 0x82, 0x60, 0x14, 0x33, 0xC2, 0x50, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x02, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x02, 0x01, 0x02, 0x01, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x00, 0x00, 0x16, 0x3C, 0x00, 0x00, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x11, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x41, -0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, -0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xC3, 0x42, 0xFA, 0x01, 0x36, 0xD8, 0xD2, 0x00, -0x00, 0x00, 0x00, - -/* Europe/Belfast */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Belgrade */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD0, 0xFA, 0x01, 0x70, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, -0x18, 0x45, 0x5F, 0x70, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xCD, 0xBD, -0x45, 0x01, 0x31, 0xF0, 0x50, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Berlin */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0E, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD1, 0xB6, 0x96, 0x00, 0xD2, 0x58, 0xBE, 0x80, 0xD2, 0xA1, 0x4F, 0x10, 0xD2, 0xDB, 0x34, 0xF0, -0xD3, 0x63, 0x1B, 0x90, 0xD4, 0x4B, 0x23, 0x90, 0xD5, 0x39, 0xD1, 0x20, 0xD5, 0x67, 0xE7, 0x90, -0xD5, 0xA8, 0x73, 0x00, 0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, -0xD9, 0x02, 0xC1, 0x90, 0xD9, 0xE9, 0x78, 0x10, 0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x00, 0x03, 0x01, 0x02, 0x03, 0x02, -0x05, 0x00, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, -0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD9, 0x70, 0x10, 0x01, 0x27, -0x0D, 0xDA, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Bratislava */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x6E, 0x5E, 0x90, 0xD1, 0x79, 0xFF, 0x10, -0xD2, 0xA1, 0x4F, 0x10, 0xD3, 0x80, 0x1C, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x4C, 0x38, 0x10, -0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x01, 0x70, 0x10, -0xD9, 0xE9, 0x78, 0x10, 0x10, 0xED, 0x64, 0x70, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD2, 0xCC, 0xD8, 0x01, 0x2C, 0xC6, 0xB2, 0x00, 0x00, -0x00, 0x00, - -/* Europe/Brussels */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x12, 0x98, 0x44, 0x49, 0x80, -0x9B, 0x0C, 0x25, 0x70, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0x9F, 0xCE, 0xF8, 0x30, 0xA0, 0x60, 0xA5, 0xF0, -0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, -0xA5, 0x5E, 0x23, 0x70, 0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0x9B, 0xF0, 0xA8, 0x2A, 0x01, 0xF0, -0xA9, 0x07, 0x7D, 0xF0, 0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAB, 0xD7, 0x50, 0xF0, -0xAC, 0xC7, 0x41, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, -0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, -0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, -0xB8, 0x0F, 0xF2, 0xA0, 0xB8, 0xFF, 0xE3, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xD6, 0x8B, 0x20, -0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xC8, 0xE2, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0x9F, 0x89, 0xA0, -0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x68, 0x88, 0x20, -0xC3, 0x58, 0x79, 0x20, 0xC4, 0x3F, 0x2F, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, -0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, 0xC8, 0x4A, 0x19, 0x20, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x5B, 0xBF, 0x60, -0xD0, 0x6E, 0x5E, 0x90, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0xD3, 0x91, 0x40, 0x10, -0xD4, 0x4B, 0x23, 0x90, 0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, -0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x04, 0x01, 0x02, 0x03, 0x02, 0x03, 0x07, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x04, 0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, -0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0xD6, 0xE5, 0x05, 0x01, -0x19, 0x45, 0x35, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Bucharest */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0xB7, 0xB0, 0xD2, 0x08, -0xB9, 0x3E, 0xF3, 0x60, 0xB9, 0xEF, 0x9C, 0x60, 0xBA, 0xDF, 0x8D, 0x60, 0xBB, 0xCF, 0x7E, 0x60, -0xBC, 0xC8, 0xA9, 0xE0, 0xBD, 0xB8, 0x9A, 0xE0, 0xBE, 0xA8, 0x8B, 0xE0, 0xBF, 0x98, 0x7C, 0xE0, -0xC0, 0x88, 0x6D, 0xE0, 0xC1, 0x78, 0x5E, 0xE0, 0xC2, 0x68, 0x4F, 0xE0, 0xC3, 0x58, 0x40, 0xE0, -0xC4, 0x48, 0x31, 0xE0, 0xC5, 0x38, 0x22, 0xE0, 0xC6, 0x28, 0x13, 0xE0, 0xC7, 0x18, 0x04, 0xE0, -0x11, 0xAD, 0xD1, 0x60, 0x12, 0x53, 0xE0, 0x50, 0x13, 0x4D, 0x0B, 0xD0, 0x14, 0x33, 0xD0, 0x60, -0x15, 0x23, 0xDD, 0x80, 0x16, 0x13, 0xCE, 0x80, 0x17, 0x03, 0xBF, 0x80, 0x17, 0xF3, 0xB0, 0x80, -0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80, 0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00, -0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, -0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, -0x24, 0x2C, 0x28, 0x00, 0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, -0x27, 0x7F, 0xB4, 0xE0, 0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0xD4, 0xEC, 0x60, -0x2A, 0xC4, 0xDD, 0x60, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xBF, 0x60, 0x2D, 0x24, 0xA0, 0xE0, -0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, -0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, -0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x00, 0x00, 0x18, 0x78, 0x00, 0x00, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x09, 0x42, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xCD, -0x21, 0x05, 0x01, 0x3A, 0x7B, 0xD0, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Budapest */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0x30, 0x58, 0x70, -0x9E, 0xA7, 0x29, 0xA0, 0x9F, 0x95, 0xBB, 0x10, 0xA0, 0x9A, 0xD2, 0x20, 0xA1, 0x64, 0x79, 0x90, -0xA2, 0x70, 0x28, 0x20, 0xA3, 0x5A, 0xC5, 0x10, 0xC9, 0xF1, 0x3C, 0x90, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, -0xD0, 0xFA, 0x01, 0x70, 0xD1, 0x99, 0x78, 0xE0, 0xD2, 0x8D, 0x5E, 0x60, 0xD3, 0x50, 0xA6, 0x90, -0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x39, 0xC3, 0x10, 0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x19, 0xA5, 0x10, -0xD8, 0x09, 0x96, 0x10, 0xD9, 0x02, 0xC1, 0x90, 0xD9, 0xE9, 0x78, 0x10, 0xDA, 0xED, 0x2F, 0x90, -0xDB, 0xE6, 0x5B, 0x10, 0xE2, 0xA2, 0xA8, 0xF0, 0xE3, 0x51, 0xF2, 0x60, 0xE4, 0x83, 0xDC, 0x70, -0xE5, 0x33, 0x25, 0xE0, 0xE6, 0x74, 0xE1, 0xF0, 0xE7, 0x11, 0xB6, 0x60, 0xE8, 0x54, 0xD2, 0x00, -0xE8, 0xF1, 0xC2, 0x90, 0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD1, 0xCE, 0xF0, 0x01, 0x2F, 0xC6, 0xED, 0x00, -0x00, 0x00, 0x00, - -/* Europe/Chisinau */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x22, 0x9E, 0x6B, 0x9F, 0x0C, -0xB7, 0xB0, 0xD2, 0x08, 0xB9, 0x3E, 0xF3, 0x60, 0xB9, 0xEF, 0x9C, 0x60, 0xBA, 0xDF, 0x8D, 0x60, -0xBB, 0xCF, 0x7E, 0x60, 0xBC, 0xC8, 0xA9, 0xE0, 0xBD, 0xB8, 0x9A, 0xE0, 0xBE, 0xA8, 0x8B, 0xE0, -0xBF, 0x98, 0x7C, 0xE0, 0xC0, 0x88, 0x6D, 0xE0, 0xC1, 0x78, 0x5E, 0xE0, 0xC2, 0x68, 0x4F, 0xE0, -0xC3, 0x58, 0x40, 0xE0, 0xC4, 0x48, 0x31, 0xE0, 0xC5, 0x38, 0x22, 0xE0, 0xC6, 0x28, 0x13, 0xE0, -0xC7, 0x18, 0x04, 0xE0, 0xC8, 0xBC, 0x93, 0x60, 0xCA, 0x77, 0x7D, 0x50, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x4E, 0x90, 0x60, -0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, -0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, -0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, -0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, -0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x43, 0x3E, 0xD0, -0x27, 0xF5, 0x26, 0x80, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x60, 0xE8, 0x60, 0x29, 0xD4, 0xEC, 0x60, -0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x04, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x08, -0x06, 0x07, 0x06, 0x07, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0B, 0x0C, 0x0B, 0x0C, -0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0A, 0x04, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x00, 0x00, 0x1A, 0xF4, 0x00, 0x00, 0x00, 0x00, -0x18, 0x78, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, -0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, -0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, -0x00, 0x00, 0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, -0x4D, 0x53, 0x4B, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0xD1, 0x0B, 0xA0, 0x01, 0x3E, 0xA7, 0x85, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Copenhagen */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x1E, 0x8C, 0x60, -0x9B, 0xD5, 0xBE, 0xD0, 0xC8, 0x43, 0x57, 0x70, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x24, 0x10, 0x90, 0xD3, 0x79, 0x85, 0x10, 0xD4, 0x1B, 0xAD, 0x90, 0xD5, 0x5E, 0xAD, 0x10, -0xD5, 0xDF, 0xE0, 0x10, 0xD7, 0x47, 0xC9, 0x90, 0xD7, 0xBF, 0xC2, 0x10, 0x12, 0xCE, 0x97, 0xF0, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, -0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xDE, -0x45, 0x0A, 0x01, 0x25, 0xDB, 0xDD, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Dublin */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xE5, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x26, 0xB3, 0x91, -0x9B, 0xD6, 0x0B, 0x11, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA5, 0x94, 0x3F, 0x00, -0xA6, 0x25, 0x60, 0x20, 0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, -0xAA, 0x00, 0xD3, 0xA0, 0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, -0xAD, 0xC9, 0xD2, 0x20, 0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, -0xB1, 0x92, 0xD0, 0xA0, 0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, -0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, -0xB9, 0x12, 0x58, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, -0xBC, 0xDB, 0x57, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, -0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, -0xC4, 0x51, 0xA4, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, -0xC7, 0xDA, 0x09, 0xA0, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x1E, 0x21, 0xA0, 0xD6, 0x4E, 0x9E, 0x10, -0xD7, 0x2C, 0x28, 0x20, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, -0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, 0xDD, 0xC4, 0xF9, 0xA0, -0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, 0xE1, 0x72, 0x48, 0xA0, -0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, 0xE5, 0x32, 0x0C, 0xA0, -0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, 0xE8, 0xFB, 0x0B, 0x20, -0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, 0xEC, 0xBA, 0xCF, 0x20, -0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, 0xF0, 0x9F, 0x7D, 0x20, -0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, 0xF4, 0x5F, 0x41, 0x20, -0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, 0xF8, 0x1F, 0x05, 0x20, -0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, -0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, 0x04, 0x29, 0x58, 0x20, -0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, 0x07, 0xE9, 0x1C, 0x20, -0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, 0x0B, 0xB2, 0x1A, 0xA0, -0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, 0x0F, 0x71, 0xDE, 0xA0, -0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, 0x13, 0x31, 0xA2, 0xA0, -0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, 0x30, 0xE7, 0x24, 0x00, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x06, 0x05, 0x06, 0x05, 0x06, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x07, 0x09, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0xFF, 0xFF, 0xFA, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1F, 0x01, -0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, -0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0C, 0x44, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xDA, 0xB5, 0x95, 0x01, 0x09, 0xE2, 0x68, 0x00, 0x00, 0x00, -0x00, - -/* Europe/Gibraltar */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xC5, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x11, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x01, -0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xC0, 0x76, 0xD5, 0x01, -0x0B, 0x90, 0x18, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Guernsey */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0xD4, 0xC8, 0xA7, 0x01, -0x10, 0x6B, 0x95, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Helsinki */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x46, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA4, 0x73, 0x6F, 0x18, -0xCB, 0xCE, 0x51, 0x60, 0xCC, 0xBF, 0x85, 0xD0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x17, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xE5, 0x22, 0xDA, 0x01, 0x38, -0xC1, 0x1A, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Isle_of_Man */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0xDB, 0xF4, 0x98, 0x01, -0x0D, 0x44, 0x4A, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Istanbul */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x90, 0x8B, 0xF5, 0x98, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xBE, 0xD0, 0xA2, 0x65, 0x63, 0xE0, 0xA3, 0x7B, 0x82, 0x50, -0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, 0xA7, 0x27, 0x7F, 0xD0, -0xAA, 0x28, 0x28, 0x60, 0xAA, 0xE1, 0xFD, 0xD0, 0xAB, 0xF9, 0x89, 0xE0, 0xAC, 0xC3, 0x31, 0x50, -0xC8, 0x7F, 0xEE, 0x60, 0xC8, 0xFF, 0xC1, 0xD0, 0xC9, 0x4A, 0xF5, 0x60, 0xCA, 0xCE, 0x80, 0x50, -0xCB, 0xCB, 0xAE, 0x60, 0xCC, 0xE5, 0xC1, 0x50, 0xD1, 0x71, 0xEB, 0xE0, 0xD2, 0x6B, 0x09, 0x50, -0xD3, 0xA2, 0x39, 0x60, 0xD4, 0x43, 0x02, 0x50, 0xD5, 0x4C, 0x0D, 0xE0, 0xD6, 0x29, 0x7B, 0xD0, -0xD7, 0x2B, 0xEF, 0xE0, 0xD8, 0x09, 0x5D, 0xD0, 0xD9, 0x02, 0x97, 0x60, 0xD9, 0xE9, 0x3F, 0xD0, -0xDA, 0xEF, 0xA8, 0x60, 0xDB, 0xD2, 0x5C, 0x50, 0xDC, 0xD4, 0xD0, 0x60, 0xDD, 0xB3, 0x8F, 0xD0, -0xF1, 0xF4, 0xB9, 0x60, 0xF2, 0x64, 0xBA, 0xD0, 0xF5, 0x68, 0x06, 0x60, 0xF6, 0x1F, 0x38, 0xD0, -0x00, 0xA0, 0xBA, 0xE0, 0x01, 0x6B, 0xB3, 0xD0, 0x02, 0x80, 0x9C, 0xE0, 0x03, 0x4B, 0x95, 0xD0, -0x04, 0x69, 0xB9, 0x60, 0x05, 0x34, 0xB2, 0x50, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x39, 0xA8, 0x80, -0x07, 0xFB, 0x75, 0x00, 0x09, 0x19, 0xA6, 0xA0, 0x09, 0xDB, 0x3A, 0xE0, 0x0A, 0xF0, 0x07, 0xD0, -0x0C, 0x10, 0xCE, 0x60, 0x0C, 0xD9, 0x24, 0x50, 0x0D, 0xA4, 0x39, 0x60, 0x0E, 0xA6, 0x91, 0x50, -0x0F, 0x84, 0x1B, 0x60, 0x10, 0x86, 0x73, 0x50, 0x12, 0x67, 0x98, 0xC0, 0x13, 0x4D, 0x36, 0x00, -0x14, 0x47, 0x7A, 0xC0, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x27, 0x5C, 0xC0, 0x17, 0x03, 0xBF, 0x80, -0x18, 0x07, 0x3E, 0xC0, 0x19, 0x89, 0x94, 0x50, 0x19, 0xDC, 0x94, 0xC0, 0x1C, 0xC6, 0xD3, 0xD0, -0x1D, 0x9B, 0x15, 0x50, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, -0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00, -0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0xF5, 0x18, 0x70, -0x28, 0xE5, 0x09, 0x70, 0x29, 0xD4, 0xFA, 0x70, 0x2A, 0xC4, 0xEB, 0x70, 0x2B, 0xB4, 0xDC, 0x70, -0x2C, 0xA4, 0xCD, 0x70, 0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, -0x30, 0x64, 0x91, 0x70, 0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, -0x34, 0x52, 0x79, 0xF0, 0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, -0x38, 0x1B, 0x78, 0x70, 0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, -0x3B, 0xDB, 0x3C, 0x70, 0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, -0x3F, 0x9B, 0x00, 0x70, 0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, -0x43, 0x63, 0xFE, 0xF0, 0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x45, 0x98, 0x32, 0xE0, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x00, 0x00, 0x1B, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x12, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x49, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x54, 0x52, 0x53, 0x54, 0x00, 0x54, 0x52, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0xC7, 0xEA, 0x62, 0x01, 0x3E, 0xDB, 0x9A, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Jersey */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0xD4, 0x66, 0xFF, 0x01, -0x0F, 0xC8, 0xD2, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Kaliningrad */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD0, 0xFA, 0x01, 0x70, -0xD1, 0x95, 0x84, 0x60, 0xD2, 0x8A, 0xAD, 0x50, 0xD2, 0xDB, 0x26, 0xE0, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, -0x28, 0xE5, 0x17, 0x80, 0x29, 0xD4, 0xDE, 0x50, 0x2A, 0xC4, 0xC1, 0x40, 0x2B, 0xB4, 0xEA, 0x80, -0x2C, 0xA4, 0xDB, 0x80, 0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, -0x30, 0x64, 0x9F, 0x80, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, -0x34, 0x52, 0x88, 0x00, 0x35, 0x1D, 0x8F, 0x00, 0x36, 0x32, 0x6A, 0x00, 0x36, 0xFD, 0x71, 0x00, -0x38, 0x1B, 0x86, 0x80, 0x38, 0xDD, 0x53, 0x00, 0x39, 0xFB, 0x68, 0x80, 0x3A, 0xBD, 0x35, 0x00, -0x3B, 0xDB, 0x4A, 0x80, 0x3C, 0xA6, 0x51, 0x80, 0x3D, 0xBB, 0x2C, 0x80, 0x3E, 0x86, 0x33, 0x80, -0x3F, 0x9B, 0x0E, 0x80, 0x40, 0x66, 0x15, 0x80, 0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80, -0x43, 0x64, 0x0D, 0x00, 0x44, 0x25, 0xD9, 0x80, 0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80, -0x47, 0x23, 0xD1, 0x00, 0x47, 0xEE, 0xD8, 0x00, 0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00, -0x4A, 0xE3, 0x95, 0x00, 0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, -0x4E, 0xAC, 0x93, 0x80, 0x4F, 0x6E, 0x60, 0x00, 0x50, 0x8C, 0x75, 0x80, 0x51, 0x57, 0x7C, 0x80, -0x52, 0x6C, 0x57, 0x80, 0x53, 0x37, 0x5E, 0x80, 0x54, 0x4C, 0x39, 0x80, 0x55, 0x17, 0x40, 0x80, -0x56, 0x2C, 0x1B, 0x80, 0x56, 0xF7, 0x22, 0x80, 0x58, 0x15, 0x38, 0x00, 0x58, 0xD7, 0x04, 0x80, -0x59, 0xF5, 0x1A, 0x00, 0x5A, 0xB6, 0xE6, 0x80, 0x5B, 0xD4, 0xFC, 0x00, 0x5C, 0xA0, 0x03, 0x00, -0x5D, 0xB4, 0xDE, 0x00, 0x5E, 0x7F, 0xE5, 0x00, 0x5F, 0x94, 0xC0, 0x00, 0x60, 0x5F, 0xC7, 0x00, -0x61, 0x7D, 0xDC, 0x80, 0x62, 0x3F, 0xA9, 0x00, 0x63, 0x5D, 0xBE, 0x80, 0x64, 0x1F, 0x8B, 0x00, -0x65, 0x3D, 0xA0, 0x80, 0x66, 0x08, 0xA7, 0x80, 0x67, 0x1D, 0x82, 0x80, 0x67, 0xE8, 0x89, 0x80, -0x68, 0xFD, 0x64, 0x80, 0x69, 0xC8, 0x6B, 0x80, 0x6A, 0xDD, 0x46, 0x80, 0x6B, 0xA8, 0x4D, 0x80, -0x6C, 0xC6, 0x63, 0x00, 0x6D, 0x88, 0x2F, 0x80, 0x6E, 0xA6, 0x45, 0x00, 0x6F, 0x68, 0x11, 0x80, -0x70, 0x86, 0x27, 0x00, 0x71, 0x51, 0x2E, 0x00, 0x72, 0x66, 0x09, 0x00, 0x73, 0x31, 0x10, 0x00, -0x74, 0x45, 0xEB, 0x00, 0x75, 0x10, 0xF2, 0x00, 0x76, 0x2F, 0x07, 0x80, 0x76, 0xF0, 0xD4, 0x00, -0x78, 0x0E, 0xE9, 0x80, 0x78, 0xD0, 0xB6, 0x00, 0x79, 0xEE, 0xCB, 0x80, 0x7A, 0xB0, 0x98, 0x00, -0x7B, 0xCE, 0xAD, 0x80, 0x7C, 0x99, 0xB4, 0x80, 0x7D, 0xAE, 0x8F, 0x80, 0x7E, 0x79, 0x96, 0x80, -0x7F, 0x8E, 0x71, 0x80, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x05, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0C, 0x0D, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, -0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, -0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x16, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x16, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, -0x45, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, -0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xDC, 0xD1, 0xF2, 0x01, 0x31, 0xF0, 0x50, 0x00, 0x00, 0x00, 0x17, 0x4D, 0x6F, 0x73, 0x63, -0x6F, 0x77, 0x2D, 0x30, 0x31, 0x20, 0x2D, 0x20, 0x4B, 0x61, 0x6C, 0x69, 0x6E, 0x69, 0x6E, 0x67, -0x72, 0x61, 0x64, - -/* Europe/Kiev */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA7, 0x64, -0xB5, 0xA4, 0x19, 0x60, 0xCA, 0xCD, 0x2E, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCE, 0xCD, 0xA8, 0x70, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, -0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, -0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, -0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, -0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, -0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, -0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x02, 0x06, -0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x02, 0x01, 0x09, 0x01, 0x09, 0x01, 0x09, 0x01, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, -0x00, 0x1C, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, -0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, -0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, -0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD6, 0x48, -0xC5, 0x01, 0x41, 0x39, 0x12, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, -0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* Europe/Lisbon */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x10, -0x9B, 0x4B, 0x6D, 0x70, 0x9B, 0xFE, 0xC7, 0x80, 0x9C, 0x9C, 0xED, 0x70, 0x9D, 0xC9, 0x83, 0x70, -0x9E, 0x7F, 0x72, 0x70, 0x9F, 0xAA, 0xB6, 0xF0, 0xA0, 0x5F, 0x54, 0x70, 0xA1, 0x8B, 0xEA, 0x70, -0xA2, 0x41, 0xD9, 0x70, 0xA3, 0x6E, 0x6F, 0x70, 0xA4, 0x23, 0x0C, 0xF0, 0xA5, 0x4F, 0xA2, 0xF0, -0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xF4, 0x8E, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, -0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, -0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70, -0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, -0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, 0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, -0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, 0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, -0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xDF, 0x70, 0xC9, 0x01, 0x2F, 0x70, -0xC9, 0xF1, 0x20, 0x70, 0xCA, 0xE2, 0x62, 0xF0, 0xCB, 0xB5, 0x52, 0xF0, 0xCB, 0xEC, 0xA3, 0xE0, -0xCC, 0x80, 0x4B, 0xE0, 0xCC, 0xDC, 0xA2, 0xF0, 0xCD, 0x95, 0x34, 0xF0, 0xCD, 0xC3, 0x4B, 0x60, -0xCE, 0x72, 0xA2, 0xE0, 0xCE, 0xC5, 0xBF, 0x70, 0xCF, 0x75, 0x16, 0xF0, 0xCF, 0xAC, 0x67, 0xE0, -0xD0, 0x52, 0x84, 0xE0, 0xD0, 0xA5, 0xA1, 0x70, 0xD1, 0x54, 0xF8, 0xF0, 0xD1, 0x8C, 0x49, 0xE0, -0xD2, 0x32, 0x66, 0xE0, 0xD2, 0x85, 0x83, 0x70, 0xD3, 0x59, 0xC4, 0xF0, 0xD4, 0x49, 0xB5, 0xF0, -0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x29, 0xC2, 0x20, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x09, 0xA4, 0x20, -0xD8, 0xF9, 0x95, 0x20, 0xD9, 0xE9, 0x86, 0x20, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xB2, 0x84, 0xA0, -0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0x92, 0x66, 0xA0, 0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x72, 0x48, 0xA0, -0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x32, 0x0C, 0xA0, -0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x0B, 0x1A, 0x20, 0xE8, 0xFB, 0x0B, 0x20, -0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xBA, 0xCF, 0x20, -0xED, 0xAA, 0xC0, 0x20, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x7A, 0x93, 0x20, -0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x63, 0xAF, 0xA0, 0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x43, 0x91, 0xA0, -0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x23, 0x73, 0xA0, 0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x03, 0x55, 0xA0, -0xF8, 0xF3, 0x46, 0xA0, 0x0C, 0xAB, 0x2A, 0x00, 0x0D, 0x9B, 0x1B, 0x00, 0x0E, 0x8B, 0x0C, 0x00, -0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x18, 0x90, -0x13, 0x43, 0xFB, 0x80, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xBD, 0xA0, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, -0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x06, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0xFF, 0xFF, 0xF7, -0x70, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, -0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0xC4, 0x67, 0xF2, 0x01, 0x05, 0x20, 0xF5, 0x00, 0x00, 0x00, 0x08, 0x6D, 0x61, 0x69, 0x6E, -0x6C, 0x61, 0x6E, 0x64, - -/* Europe/Ljubljana */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD0, 0xFA, 0x01, 0x70, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, -0x18, 0x45, 0x5F, 0x70, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xCF, 0x98, -0x88, 0x01, 0x28, 0xCF, 0x12, 0x00, 0x00, 0x00, 0x00, - -/* Europe/London */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0xD7, 0xEC, 0xB1, 0x01, -0x12, 0xD9, 0x6F, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Luxembourg */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x16, 0x84, 0xA2, 0xAD, 0xBC, -0x9B, 0x1E, 0x8C, 0x60, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xEA, 0xA7, 0xE0, 0x9D, 0xA4, 0x99, 0x70, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0x9F, 0xE0, 0xC4, 0x70, 0xA0, 0x60, 0xA5, 0xF0, -0xA1, 0x7E, 0xE5, 0xA0, 0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x69, 0x10, 0xA4, 0x35, 0x81, 0xF0, -0xA5, 0x5E, 0x3F, 0x90, 0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0xAA, 0x00, 0xA8, 0x2A, 0x01, 0xF0, -0xA9, 0x07, 0x9A, 0x10, 0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x6E, 0x00, 0xAB, 0xD8, 0xA2, 0x70, -0xAC, 0xC7, 0x50, 0x00, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x32, 0x00, 0xAF, 0xA0, 0x4F, 0x70, -0xB0, 0x87, 0x14, 0x00, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x30, 0x80, 0xB3, 0x72, 0x88, 0x70, -0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, 0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, -0xB8, 0x0F, 0xF2, 0xA0, 0xB8, 0xFF, 0xE3, 0xA0, 0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xD6, 0x8B, 0x20, -0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xC8, 0xE2, 0x20, 0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0x9F, 0x89, 0xA0, -0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, 0xC1, 0x78, 0x97, 0x20, 0xC2, 0x68, 0x88, 0x20, -0xC3, 0x58, 0x79, 0x20, 0xC4, 0x3F, 0x2F, 0xA0, 0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, -0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, 0xC8, 0x42, 0x30, 0x20, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x6F, 0xB0, 0x10, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0xD3, 0x91, 0x40, 0x10, 0xD4, 0x4B, 0x23, 0x90, -0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, -0x02, 0x03, 0x04, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x0B, -0x09, 0x0A, 0x09, 0x0A, 0x02, 0x03, 0x04, 0x03, 0x04, 0x02, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x05, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, -0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD5, 0x03, 0x40, 0x01, 0x1C, -0x0A, 0xD8, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Madrid */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xA3, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x9C, 0xF3, 0xF0, 0x70, -0x9D, 0xBE, 0xF7, 0x70, 0x9E, 0xBA, 0xC5, 0xF0, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x8E, 0xCA, 0x70, -0xA1, 0x81, 0x5E, 0x70, 0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, -0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, -0xB2, 0x70, 0x22, 0x70, 0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, 0xC2, 0xA8, 0xF7, 0x70, -0xC3, 0x58, 0x4E, 0xF0, 0xC4, 0x39, 0xBF, 0x70, 0xC5, 0x38, 0x30, 0xF0, 0xC6, 0x3A, 0x96, 0xF0, -0xC7, 0x21, 0x4D, 0x70, 0xC7, 0xF5, 0x8E, 0xF0, 0xCB, 0xF5, 0xDE, 0x60, 0xCC, 0x96, 0xB5, 0x60, -0xCD, 0xC3, 0x4B, 0x60, 0xCE, 0xA2, 0x18, 0xE0, 0xCF, 0xA3, 0x2D, 0x60, 0xD0, 0x8D, 0xD8, 0x60, -0xD1, 0x83, 0x0F, 0x60, 0xD2, 0x60, 0x99, 0x70, 0xD3, 0x62, 0xF1, 0x60, 0xD4, 0x41, 0xBE, 0xE0, -0xD9, 0x1E, 0x46, 0xE0, 0xD9, 0xE6, 0xB8, 0xF0, 0x08, 0x0D, 0xCD, 0xE0, 0x08, 0xF4, 0x92, 0x70, -0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xD4, 0x74, 0x70, 0x0B, 0xBB, 0x1C, 0xE0, 0x0C, 0xAB, 0x1B, 0xF0, -0x0D, 0xA4, 0x39, 0x60, 0x0E, 0x8A, 0xFD, 0xF0, 0x0F, 0x85, 0x6C, 0xE0, 0x10, 0x74, 0x1A, 0x70, -0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, -0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, -0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x03, 0x02, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x00, 0x00, 0x0E, 0x10, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x09, 0x00, 0x00, 0x0E, -0x10, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x0E, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x13, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x0E, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x13, 0x57, 0x45, 0x53, 0x54, 0x00, -0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, -0x54, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0xC6, 0xF9, 0x80, 0x01, 0x0F, 0x1F, 0x8D, 0x00, 0x00, 0x00, 0x08, 0x6D, 0x61, -0x69, 0x6E, 0x6C, 0x61, 0x6E, 0x64, - -/* Europe/Malta */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xA8, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70, -0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70, -0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x1D, 0xF7, 0x70, -0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10, 0xF9, 0x33, 0xB5, 0xF0, -0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0, 0xFC, 0xFC, 0xB4, 0x70, -0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60, 0x00, 0xC5, 0xB2, 0xF0, -0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70, 0x04, 0x85, 0x76, 0xF0, -0x05, 0x2B, 0x85, 0xE0, 0x06, 0x1A, 0x33, 0x70, 0x07, 0x0A, 0x24, 0x70, 0x08, 0x17, 0x16, 0x70, -0x08, 0xDA, 0x34, 0x70, 0x09, 0xF7, 0x14, 0x90, 0x0A, 0xC2, 0x0D, 0x80, 0x0B, 0xD6, 0xF6, 0x90, -0x0C, 0xA1, 0xEF, 0x80, 0x0D, 0xB6, 0xD8, 0x90, 0x0E, 0x81, 0xD1, 0x80, 0x0F, 0x96, 0xBA, 0x90, -0x10, 0x61, 0xB3, 0x80, 0x11, 0x76, 0x9C, 0x90, 0x12, 0x41, 0x95, 0x80, 0x13, 0x45, 0x5B, 0x10, -0x14, 0x2A, 0xB2, 0x00, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xC0, 0x1B, -0xB0, 0x01, 0x28, 0xCF, 0x12, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Mariehamn */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA4, 0x73, 0x6F, 0x18, -0xCB, 0xCE, 0x51, 0x60, 0xCC, 0xBF, 0x85, 0xD0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x17, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x09, 0x48, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xE5, 0x08, 0xD0, 0x01, 0x31, -0x19, 0x78, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Minsk */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xAA, 0x38, -0xB5, 0xA4, 0x19, 0x60, 0xCA, 0x5E, 0x70, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x0A, 0x02, 0x60, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, -0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xDD, 0x60, 0x2B, 0xB4, 0xEA, 0x80, 0x2C, 0xA4, 0xDB, 0x80, -0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, 0x30, 0x64, 0x9F, 0x80, -0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, 0x34, 0x52, 0x88, 0x00, -0x35, 0x1D, 0x8F, 0x00, 0x36, 0x32, 0x6A, 0x00, 0x36, 0xFD, 0x71, 0x00, 0x38, 0x1B, 0x86, 0x80, -0x38, 0xDD, 0x53, 0x00, 0x39, 0xFB, 0x68, 0x80, 0x3A, 0xBD, 0x35, 0x00, 0x3B, 0xDB, 0x4A, 0x80, -0x3C, 0xA6, 0x51, 0x80, 0x3D, 0xBB, 0x2C, 0x80, 0x3E, 0x86, 0x33, 0x80, 0x3F, 0x9B, 0x0E, 0x80, -0x40, 0x66, 0x15, 0x80, 0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80, 0x43, 0x64, 0x0D, 0x00, -0x44, 0x25, 0xD9, 0x80, 0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80, 0x47, 0x23, 0xD1, 0x00, -0x47, 0xEE, 0xD8, 0x00, 0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00, 0x4A, 0xE3, 0x95, 0x00, -0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x4E, 0xAC, 0x93, 0x80, -0x4F, 0x6E, 0x60, 0x00, 0x50, 0x8C, 0x75, 0x80, 0x51, 0x57, 0x7C, 0x80, 0x52, 0x6C, 0x57, 0x80, -0x53, 0x37, 0x5E, 0x80, 0x54, 0x4C, 0x39, 0x80, 0x55, 0x17, 0x40, 0x80, 0x56, 0x2C, 0x1B, 0x80, -0x56, 0xF7, 0x22, 0x80, 0x58, 0x15, 0x38, 0x00, 0x58, 0xD7, 0x04, 0x80, 0x59, 0xF5, 0x1A, 0x00, -0x5A, 0xB6, 0xE6, 0x80, 0x5B, 0xD4, 0xFC, 0x00, 0x5C, 0xA0, 0x03, 0x00, 0x5D, 0xB4, 0xDE, 0x00, -0x5E, 0x7F, 0xE5, 0x00, 0x5F, 0x94, 0xC0, 0x00, 0x60, 0x5F, 0xC7, 0x00, 0x61, 0x7D, 0xDC, 0x80, -0x62, 0x3F, 0xA9, 0x00, 0x63, 0x5D, 0xBE, 0x80, 0x64, 0x1F, 0x8B, 0x00, 0x65, 0x3D, 0xA0, 0x80, -0x66, 0x08, 0xA7, 0x80, 0x67, 0x1D, 0x82, 0x80, 0x67, 0xE8, 0x89, 0x80, 0x68, 0xFD, 0x64, 0x80, -0x69, 0xC8, 0x6B, 0x80, 0x6A, 0xDD, 0x46, 0x80, 0x6B, 0xA8, 0x4D, 0x80, 0x6C, 0xC6, 0x63, 0x00, -0x6D, 0x88, 0x2F, 0x80, 0x6E, 0xA6, 0x45, 0x00, 0x6F, 0x68, 0x11, 0x80, 0x70, 0x86, 0x27, 0x00, -0x71, 0x51, 0x2E, 0x00, 0x72, 0x66, 0x09, 0x00, 0x73, 0x31, 0x10, 0x00, 0x74, 0x45, 0xEB, 0x00, -0x75, 0x10, 0xF2, 0x00, 0x76, 0x2F, 0x07, 0x80, 0x76, 0xF0, 0xD4, 0x00, 0x78, 0x0E, 0xE9, 0x80, -0x78, 0xD0, 0xB6, 0x00, 0x79, 0xEE, 0xCB, 0x80, 0x7A, 0xB0, 0x98, 0x00, 0x7B, 0xCE, 0xAD, 0x80, -0x7C, 0x99, 0xB4, 0x80, 0x7D, 0xAE, 0x8F, 0x80, 0x7E, 0x79, 0x96, 0x80, 0x7F, 0x8E, 0x71, 0x80, -0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x02, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x00, 0x00, 0x19, 0xC8, 0x00, 0x00, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, -0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4D, 0x4D, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, -0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xDB, 0x92, 0xF0, 0x01, 0x3C, 0xB8, 0xBA, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Monaco */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x1B, 0x91, 0x60, 0x50, 0x4F, -0x9B, 0x47, 0x78, 0xF0, 0x9B, 0xD7, 0x2C, 0x70, 0x9C, 0xBC, 0x91, 0x70, 0x9D, 0xC0, 0x48, 0xF0, -0x9E, 0x89, 0xFE, 0x70, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x80, 0x0C, 0xF0, -0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, 0xA5, 0x5E, 0x23, 0x70, -0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0x9B, 0xF0, 0xA8, 0x58, 0x26, 0x70, 0xA9, 0x07, 0x7D, 0xF0, -0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAB, 0xD7, 0x50, 0xF0, 0xAC, 0xC7, 0x41, 0xF0, -0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, -0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, 0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, -0xB5, 0x49, 0x2F, 0xF0, 0xB6, 0x2F, 0xE6, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70, -0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBA, 0xD6, 0x60, 0xF0, 0xBB, 0xD8, 0xC6, 0xF0, -0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, 0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, -0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, 0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, -0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, 0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, -0xC7, 0xDA, 0x09, 0xA0, 0xCA, 0x17, 0x5B, 0xF0, 0xCA, 0xE2, 0x54, 0xE0, 0xCB, 0xAD, 0x69, 0xF0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x89, 0xF1, 0xF0, 0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x0B, 0xBB, 0x39, 0x00, -0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x05, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x07, 0x06, 0x07, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, -0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x12, 0x00, 0x00, -0x0E, 0x10, 0x00, 0x17, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x17, -0x50, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, -0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0xCC, 0x02, 0x8F, 0x01, 0x1D, 0xEC, 0x9D, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Moscow */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0x9B, 0x5F, 0x1E, 0xD8, -0x9D, 0x3E, 0xF2, 0x98, 0x9E, 0x2A, 0xEF, 0x18, 0x9E, 0xF7, 0x39, 0x88, 0x9F, 0x84, 0x58, 0x18, -0xA0, 0xD8, 0x6D, 0x08, 0xA1, 0x00, 0x16, 0x28, 0xA1, 0x3C, 0xA6, 0x40, 0xA4, 0x10, 0x6D, 0xC0, -0xA4, 0x3D, 0x32, 0xB0, 0xA5, 0x15, 0x68, 0xB0, 0xA5, 0x3D, 0x03, 0xC0, 0xA7, 0x1E, 0x45, 0x50, -0xB5, 0xA4, 0x19, 0x60, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, -0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, -0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, -0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, -0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0, -0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x78, 0xBF, 0x80, -0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70, -0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70, -0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, 0x34, 0x52, 0x79, 0xF0, -0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, 0x38, 0x1B, 0x78, 0x70, -0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, 0x3B, 0xDB, 0x3C, 0x70, -0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, 0x3F, 0x9B, 0x00, 0x70, -0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, 0x43, 0x63, 0xFE, 0xF0, -0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70, 0x47, 0x23, 0xC2, 0xF0, -0x47, 0xEE, 0xC9, 0xF0, 0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0, 0x4A, 0xE3, 0x86, 0xF0, -0x4B, 0xAE, 0x8D, 0xF0, 0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0, 0x4E, 0xAC, 0x85, 0x70, -0x4F, 0x6E, 0x51, 0xF0, 0x50, 0x8C, 0x67, 0x70, 0x51, 0x57, 0x6E, 0x70, 0x52, 0x6C, 0x49, 0x70, -0x53, 0x37, 0x50, 0x70, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x17, 0x32, 0x70, 0x56, 0x2C, 0x0D, 0x70, -0x56, 0xF7, 0x14, 0x70, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD6, 0xF6, 0x70, 0x59, 0xF5, 0x0B, 0xF0, -0x5A, 0xB6, 0xD8, 0x70, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9F, 0xF4, 0xF0, 0x5D, 0xB4, 0xCF, 0xF0, -0x5E, 0x7F, 0xD6, 0xF0, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5F, 0xB8, 0xF0, 0x61, 0x7D, 0xCE, 0x70, -0x62, 0x3F, 0x9A, 0xF0, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1F, 0x7C, 0xF0, 0x65, 0x3D, 0x92, 0x70, -0x66, 0x08, 0x99, 0x70, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE8, 0x7B, 0x70, 0x68, 0xFD, 0x56, 0x70, -0x69, 0xC8, 0x5D, 0x70, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA8, 0x3F, 0x70, 0x6C, 0xC6, 0x54, 0xF0, -0x6D, 0x88, 0x21, 0x70, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x68, 0x03, 0x70, 0x70, 0x86, 0x18, 0xF0, -0x71, 0x51, 0x1F, 0xF0, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x31, 0x01, 0xF0, 0x74, 0x45, 0xDC, 0xF0, -0x75, 0x10, 0xE3, 0xF0, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xF0, 0xC5, 0xF0, 0x78, 0x0E, 0xDB, 0x70, -0x78, 0xD0, 0xA7, 0xF0, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xB0, 0x89, 0xF0, 0x7B, 0xCE, 0x9F, 0x70, -0x7C, 0x99, 0xA6, 0x70, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x79, 0x88, 0x70, 0x7F, 0x8E, 0x63, 0x70, -0x02, 0x01, 0x02, 0x03, 0x01, 0x03, 0x05, 0x04, 0x05, 0x06, 0x05, 0x04, 0x07, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x0A, 0x0B, 0x08, 0x05, 0x04, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x00, 0x00, 0x23, 0x28, 0x00, 0x00, 0x00, 0x00, 0x31, 0x68, 0x01, 0x04, 0x00, 0x00, 0x23, -0x58, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x78, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, -0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x46, 0x50, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x15, 0x4D, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x4D, 0x44, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, -0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xDE, 0x65, 0x98, 0x01, 0x4C, 0x01, 0x7D, 0x00, 0x00, 0x00, 0x17, 0x4D, 0x6F, 0x73, 0x63, 0x6F, -0x77, 0x2B, 0x30, 0x30, 0x20, 0x2D, 0x20, 0x77, 0x65, 0x73, 0x74, 0x20, 0x52, 0x75, 0x73, 0x73, -0x69, 0x61, - -/* Europe/Nicosia */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xA5, 0x77, 0x1E, 0xB8, -0x09, 0xED, 0xAF, 0xE0, 0x0A, 0xDD, 0x92, 0xD0, 0x0B, 0xFA, 0x64, 0xE0, 0x0C, 0xBE, 0xC6, 0x50, -0x0D, 0xA4, 0x39, 0x60, 0x0E, 0x8A, 0xE1, 0xD0, 0x0F, 0x84, 0x1B, 0x60, 0x10, 0x75, 0x4F, 0xD0, -0x11, 0x63, 0xFD, 0x60, 0x12, 0x53, 0xE0, 0x50, 0x13, 0x4D, 0x19, 0xE0, 0x14, 0x33, 0xC2, 0x50, -0x15, 0x23, 0xC1, 0x60, 0x16, 0x13, 0xA4, 0x50, 0x17, 0x03, 0xA3, 0x60, 0x17, 0xF3, 0x86, 0x50, -0x18, 0xE3, 0x85, 0x60, 0x19, 0xD3, 0x68, 0x50, 0x1A, 0xC3, 0x67, 0x60, 0x1B, 0xBC, 0x84, 0xD0, -0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x48, 0xD0, -0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x0C, 0xD0, -0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xED, 0xE0, 0x27, 0x05, 0x0B, 0x50, -0x27, 0xF5, 0x0A, 0x60, 0x28, 0xE4, 0xED, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, -0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, -0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x4D, 0x91, 0xD0, -0x33, 0x3D, 0x90, 0xE0, 0x34, 0x2D, 0x73, 0xD0, 0x35, 0x1D, 0x72, 0xE0, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x1F, 0x48, 0x00, 0x00, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x89, 0x54, 0x40, -0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Oslo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x27, 0xE3, 0x00, -0x9B, 0xD4, 0x7B, 0x60, 0xC8, 0xB7, 0x4D, 0x60, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x62, 0x07, 0x10, 0xEB, 0xAF, 0x20, 0x90, 0xEC, 0xA8, 0x4C, 0x10, 0xED, 0x98, 0x3D, 0x10, -0xEE, 0x88, 0x2E, 0x10, 0xEF, 0x78, 0x1F, 0x10, 0xF0, 0x68, 0x10, 0x10, 0xF1, 0x58, 0x01, 0x10, -0xF2, 0x47, 0xF2, 0x10, 0xF3, 0x37, 0xE3, 0x10, 0xF4, 0x27, 0xD4, 0x10, 0xF5, 0x17, 0xC5, 0x10, -0xF6, 0x10, 0xF0, 0x90, 0xF7, 0x2F, 0x06, 0x10, 0xF7, 0xF0, 0xD2, 0x90, 0x12, 0xCE, 0x97, 0xF0, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xE4, 0xC1, 0x32, 0x01, 0x23, 0x0F, 0xB8, 0x00, 0x00, -0x00, 0x00, - -/* Europe/Paris */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x46, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1B, 0x91, 0x60, 0x50, 0x8B, -0x9B, 0x47, 0x78, 0xF0, 0x9B, 0xD7, 0x2C, 0x70, 0x9C, 0xBC, 0x91, 0x70, 0x9D, 0xC0, 0x48, 0xF0, -0x9E, 0x89, 0xFE, 0x70, 0x9F, 0xA0, 0x2A, 0xF0, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x80, 0x0C, 0xF0, -0xA2, 0x2E, 0x12, 0xF0, 0xA3, 0x7A, 0x4C, 0xF0, 0xA4, 0x35, 0x81, 0xF0, 0xA5, 0x5E, 0x23, 0x70, -0xA6, 0x25, 0x35, 0xF0, 0xA7, 0x27, 0x9B, 0xF0, 0xA8, 0x58, 0x26, 0x70, 0xA9, 0x07, 0x7D, 0xF0, -0xA9, 0xEE, 0x34, 0x70, 0xAA, 0xE7, 0x5F, 0xF0, 0xAB, 0xD7, 0x50, 0xF0, 0xAC, 0xC7, 0x41, 0xF0, -0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, 0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, -0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, 0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, -0xB5, 0x49, 0x2F, 0xF0, 0xB6, 0x2F, 0xE6, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70, -0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBA, 0xD6, 0x60, 0xF0, 0xBB, 0xD8, 0xC6, 0xF0, -0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, 0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, -0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, 0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, -0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, 0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, -0xC7, 0xDA, 0x09, 0xA0, 0xC8, 0x6C, 0x27, 0xE0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x4F, 0xE1, 0xE0, 0xD0, 0x89, 0xF1, 0xF0, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4E, 0x40, 0x90, 0x0B, 0xBB, 0x39, 0x00, 0x0C, 0xAB, 0x1B, 0xF0, -0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, -0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, -0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, -0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, -0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, -0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x07, 0x05, 0x06, 0x05, 0x06, 0x08, -0x03, 0x08, 0x09, 0x07, 0x09, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, -0x00, 0x02, 0x31, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -0x09, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x11, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x11, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0D, 0x50, 0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, -0x57, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x4D, -0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD3, 0xE4, 0xCA, 0x01, 0x16, -0x37, 0xF5, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Podgorica */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD0, 0xFA, 0x01, 0x70, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, -0x18, 0x45, 0x5F, 0x70, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xCA, 0x13, -0xC5, 0x01, 0x30, 0x0E, 0x8A, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Prague */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x6E, 0x5E, 0x90, 0xD1, 0x79, 0xFF, 0x10, -0xD2, 0xA1, 0x4F, 0x10, 0xD3, 0x80, 0x1C, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x4C, 0x38, 0x10, -0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0xD9, 0x01, 0x70, 0x10, -0xD9, 0xE9, 0x78, 0x10, 0x10, 0xED, 0x64, 0x70, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, -0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD5, 0xC0, 0x0D, 0x01, 0x28, 0xAE, 0x85, 0x00, 0x00, -0x00, 0x00, - -/* Europe/Riga */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x22, 0x9E, 0xB9, 0x88, 0x08, -0x9F, 0x84, 0x8F, 0x08, 0xA0, 0x88, 0x46, 0x88, 0xA0, 0xCB, 0x83, 0x08, 0xAD, 0xE7, 0xF1, 0xE8, -0xC8, 0xAF, 0x64, 0x60, 0xCA, 0x62, 0x65, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD0, 0x90, 0x89, 0x70, -0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, -0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, -0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, -0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, -0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, -0x27, 0xF5, 0x26, 0x80, 0x28, 0xE5, 0x17, 0x80, 0x29, 0xD5, 0x08, 0x80, 0x2A, 0xC4, 0xF9, 0x80, -0x2B, 0xB4, 0xEA, 0x80, 0x2C, 0xA4, 0xDB, 0x80, 0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, -0x2F, 0x74, 0xAE, 0x80, 0x30, 0x64, 0x9F, 0x80, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x4D, 0xBC, 0x00, -0x32, 0xE3, 0xEA, 0xE0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xBA, 0xEF, 0xE0, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x06, 0x04, -0x05, 0x04, 0x05, 0x04, 0x03, 0x07, 0x03, 0x07, 0x03, 0x07, 0x03, 0x07, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x02, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x02, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x16, 0x98, 0x00, 0x00, 0x00, 0x00, 0x24, -0xA8, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0C, 0x00, -0x00, 0x0E, 0x10, 0x00, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x14, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0C, 0x00, 0x00, 0x38, -0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x08, 0x52, 0x4D, 0x54, 0x00, 0x4C, -0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, -0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x3A, 0x57, 0x01, 0x37, 0x6E, -0x90, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Rome */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70, -0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70, -0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x07, 0x5F, 0x60, 0xD0, 0x6E, 0x42, 0x70, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10, -0xD5, 0x1D, 0xF7, 0x70, 0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10, -0xF9, 0x33, 0xB5, 0xF0, 0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0, -0xFC, 0xFC, 0xB4, 0x70, 0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60, -0x00, 0xC5, 0xB2, 0xF0, 0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70, -0x04, 0x85, 0x76, 0xF0, 0x05, 0x2B, 0x85, 0xE0, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x0B, 0x67, 0xE0, -0x08, 0x45, 0x3A, 0xF0, 0x08, 0xEB, 0x49, 0xE0, 0x0A, 0x2E, 0x57, 0x70, 0x0A, 0xCB, 0x39, 0xF0, -0x0C, 0x0E, 0x39, 0x70, 0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xE4, 0xE0, 0xF0, 0x0E, 0x8A, 0xFD, 0xF0, -0x0F, 0xCD, 0xFD, 0x70, 0x10, 0x74, 0x1A, 0x70, 0x11, 0xAD, 0xDF, 0x70, 0x12, 0x53, 0xFC, 0x70, -0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xC9, 0x43, 0x70, 0x01, 0x25, 0xB4, 0xCD, 0x00, -0x00, 0x00, 0x00, - -/* Europe/Samara */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0x00, 0x26, 0x9C, -0xB5, 0xA4, 0x0B, 0x50, 0xBE, 0x4C, 0x26, 0xC0, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, -0x17, 0x08, 0xCD, 0x40, 0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, -0x1A, 0xCC, 0x85, 0xC0, 0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, -0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, -0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, 0x25, 0x1C, 0x0A, 0xF0, -0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, -0x29, 0x00, 0xC7, 0x00, 0x29, 0xD4, 0xC2, 0x30, 0x2A, 0xC4, 0xA5, 0x20, 0x2B, 0xB4, 0xCE, 0x60, -0x2C, 0xA4, 0xBF, 0x60, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0xA1, 0x60, 0x2F, 0x74, 0x92, 0x60, -0x30, 0x64, 0x83, 0x60, 0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x72, 0x89, 0xE0, 0x33, 0x3D, 0x90, 0xE0, -0x34, 0x52, 0x6B, 0xE0, 0x35, 0x1D, 0x72, 0xE0, 0x36, 0x32, 0x4D, 0xE0, 0x36, 0xFD, 0x54, 0xE0, -0x38, 0x1B, 0x6A, 0x60, 0x38, 0xDD, 0x36, 0xE0, 0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, -0x3B, 0xDB, 0x2E, 0x60, 0x3C, 0xA6, 0x35, 0x60, 0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, -0x3F, 0x9A, 0xF2, 0x60, 0x40, 0x65, 0xF9, 0x60, 0x41, 0x84, 0x0E, 0xE0, 0x42, 0x45, 0xDB, 0x60, -0x43, 0x63, 0xF0, 0xE0, 0x44, 0x25, 0xBD, 0x60, 0x45, 0x43, 0xD2, 0xE0, 0x46, 0x05, 0x9F, 0x60, -0x47, 0x23, 0xB4, 0xE0, 0x47, 0xEE, 0xBB, 0xE0, 0x49, 0x03, 0x96, 0xE0, 0x49, 0xCE, 0x9D, 0xE0, -0x4A, 0xE3, 0x78, 0xE0, 0x4B, 0xAE, 0x7F, 0xE0, 0x4C, 0xCC, 0x95, 0x60, 0x4D, 0x8E, 0x61, 0xE0, -0x4E, 0xAC, 0x77, 0x60, 0x4F, 0x6E, 0x43, 0xE0, 0x50, 0x8C, 0x59, 0x60, 0x51, 0x57, 0x60, 0x60, -0x52, 0x6C, 0x3B, 0x60, 0x53, 0x37, 0x42, 0x60, 0x54, 0x4C, 0x1D, 0x60, 0x55, 0x17, 0x24, 0x60, -0x56, 0x2B, 0xFF, 0x60, 0x56, 0xF7, 0x06, 0x60, 0x58, 0x15, 0x1B, 0xE0, 0x58, 0xD6, 0xE8, 0x60, -0x59, 0xF4, 0xFD, 0xE0, 0x5A, 0xB6, 0xCA, 0x60, 0x5B, 0xD4, 0xDF, 0xE0, 0x5C, 0x9F, 0xE6, 0xE0, -0x5D, 0xB4, 0xC1, 0xE0, 0x5E, 0x7F, 0xC8, 0xE0, 0x5F, 0x94, 0xA3, 0xE0, 0x60, 0x5F, 0xAA, 0xE0, -0x61, 0x7D, 0xC0, 0x60, 0x62, 0x3F, 0x8C, 0xE0, 0x63, 0x5D, 0xA2, 0x60, 0x64, 0x1F, 0x6E, 0xE0, -0x65, 0x3D, 0x84, 0x60, 0x66, 0x08, 0x8B, 0x60, 0x67, 0x1D, 0x66, 0x60, 0x67, 0xE8, 0x6D, 0x60, -0x68, 0xFD, 0x48, 0x60, 0x69, 0xC8, 0x4F, 0x60, 0x6A, 0xDD, 0x2A, 0x60, 0x6B, 0xA8, 0x31, 0x60, -0x6C, 0xC6, 0x46, 0xE0, 0x6D, 0x88, 0x13, 0x60, 0x6E, 0xA6, 0x28, 0xE0, 0x6F, 0x67, 0xF5, 0x60, -0x70, 0x86, 0x0A, 0xE0, 0x71, 0x51, 0x11, 0xE0, 0x72, 0x65, 0xEC, 0xE0, 0x73, 0x30, 0xF3, 0xE0, -0x74, 0x45, 0xCE, 0xE0, 0x75, 0x10, 0xD5, 0xE0, 0x76, 0x2E, 0xEB, 0x60, 0x76, 0xF0, 0xB7, 0xE0, -0x78, 0x0E, 0xCD, 0x60, 0x78, 0xD0, 0x99, 0xE0, 0x79, 0xEE, 0xAF, 0x60, 0x7A, 0xB0, 0x7B, 0xE0, -0x7B, 0xCE, 0x91, 0x60, 0x7C, 0x99, 0x98, 0x60, 0x7D, 0xAE, 0x73, 0x60, 0x7E, 0x79, 0x7A, 0x60, -0x7F, 0x8E, 0x55, 0x60, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x09, 0x08, 0x02, 0x0B, 0x02, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, -0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x00, 0x00, 0x2F, 0x04, 0x00, 0x00, -0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, -0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, -0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0F, -0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50, -0x01, 0x14, 0x00, 0x00, 0x46, 0x50, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, -0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4B, 0x55, 0x59, 0x53, 0x54, 0x00, 0x4B, 0x55, 0x59, -0x54, 0x00, 0x53, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xDA, 0x81, 0x7F, 0x01, 0x5F, 0x2E, 0x58, 0x00, 0x00, 0x00, 0x1C, -0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x31, 0x20, 0x2D, 0x20, 0x53, 0x61, 0x6D, 0x61, -0x72, 0x61, 0x2C, 0x20, 0x55, 0x64, 0x6D, 0x75, 0x72, 0x74, 0x69, 0x61, - -/* Europe/San_Marino */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70, -0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70, -0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x07, 0x5F, 0x60, 0xD0, 0x6E, 0x42, 0x70, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10, -0xD5, 0x1D, 0xF7, 0x70, 0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10, -0xF9, 0x33, 0xB5, 0xF0, 0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0, -0xFC, 0xFC, 0xB4, 0x70, 0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60, -0x00, 0xC5, 0xB2, 0xF0, 0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70, -0x04, 0x85, 0x76, 0xF0, 0x05, 0x2B, 0x85, 0xE0, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x0B, 0x67, 0xE0, -0x08, 0x45, 0x3A, 0xF0, 0x08, 0xEB, 0x49, 0xE0, 0x0A, 0x2E, 0x57, 0x70, 0x0A, 0xCB, 0x39, 0xF0, -0x0C, 0x0E, 0x39, 0x70, 0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xE4, 0xE0, 0xF0, 0x0E, 0x8A, 0xFD, 0xF0, -0x0F, 0xCD, 0xFD, 0x70, 0x10, 0x74, 0x1A, 0x70, 0x11, 0xAD, 0xDF, 0x70, 0x12, 0x53, 0xFC, 0x70, -0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xCC, 0x57, 0x32, 0x01, 0x25, 0xAE, 0x4A, 0x00, -0x00, 0x00, 0x00, - -/* Europe/Sarajevo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD0, 0xFA, 0x01, 0x70, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, -0x18, 0x45, 0x5F, 0x70, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xCC, 0x43, -0xAA, 0x01, 0x2E, 0xC2, 0x82, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Simferopol */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA4, 0x20, -0xB5, 0xA4, 0x19, 0x60, 0xCB, 0x04, 0x8D, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xCF, 0x9F, 0x38, 0xE0, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x29, 0xD4, 0xEC, 0x60, -0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, -0x2D, 0xC2, 0xC6, 0xD0, 0x2E, 0x84, 0x85, 0x40, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x67, 0x40, -0x31, 0x5D, 0xA0, 0xD0, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x32, 0xC9, 0x7E, 0xD0, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, -0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x02, 0x01, 0x09, 0x01, 0x09, 0x01, 0x09, 0x06, 0x02, 0x06, 0x02, 0x06, 0x08, 0x07, -0x02, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, -0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, -0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x53, 0x4D, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, -0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0xCD, 0xEA, 0xD7, 0x01, 0x46, 0xB0, 0xD0, 0x00, 0x00, 0x00, 0x0E, 0x63, 0x65, 0x6E, -0x74, 0x72, 0x61, 0x6C, 0x20, 0x43, 0x72, 0x69, 0x6D, 0x65, 0x61, - -/* Europe/Skopje */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD0, 0xFA, 0x01, 0x70, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, -0x18, 0x45, 0x5F, 0x70, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xC9, 0x63, -0xFD, 0x01, 0x33, 0x5C, 0xE5, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Sofia */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x12, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, -0xD0, 0xFA, 0x01, 0x70, 0xD1, 0x72, 0x24, 0x20, 0x11, 0x63, 0xEF, 0x50, 0x12, 0x55, 0x3F, 0xE0, -0x13, 0x4D, 0x0B, 0xD0, 0x14, 0x35, 0x21, 0xE0, 0x15, 0x2C, 0xED, 0xD0, 0x16, 0x13, 0xC0, 0x70, -0x17, 0x0C, 0xCF, 0xD0, 0x17, 0xF3, 0xB0, 0x80, 0x18, 0xE3, 0xA1, 0x80, 0x19, 0xD3, 0x92, 0x80, -0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00, 0x1C, 0xAC, 0xA0, 0x00, 0x1D, 0x9C, 0x91, 0x00, -0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, 0x21, 0x5C, 0x55, 0x00, -0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00, 0x25, 0x1C, 0x19, 0x00, -0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0x7F, 0xB4, 0xE0, 0x27, 0xF5, 0x0A, 0x60, -0x28, 0xE4, 0xED, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, -0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, -0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, -0x00, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, -0x07, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, -0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, -0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x45, 0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, -0x43, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xCA, 0x75, 0x6D, -0x01, 0x36, 0x3C, 0x92, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Stockholm */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x1E, 0x8C, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x00, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x01, 0x01, 0x00, 0xE3, 0xDD, 0x55, 0x01, 0x2E, 0x33, 0x48, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Tallinn */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x1E, 0x9E, 0x59, 0x2D, 0xCC, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0xA1, 0x00, 0x2B, 0x70, 0xA4, 0x73, 0x6F, 0x4C, -0xC8, 0xB0, 0xB5, 0xE0, 0xCA, 0xC6, 0x97, 0x50, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x74, 0xCB, 0xE0, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0xF5, 0x26, 0x80, -0x28, 0xE5, 0x17, 0x80, 0x29, 0xD5, 0x08, 0x80, 0x2A, 0xC4, 0xF9, 0x80, 0x2B, 0xB4, 0xEA, 0x80, -0x2C, 0xA4, 0xDB, 0x80, 0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, -0x30, 0x64, 0x9F, 0x80, 0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, -0x34, 0x52, 0x88, 0x00, 0x35, 0x1D, 0x8F, 0x00, 0x36, 0x06, 0xBE, 0x50, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0x1C, 0xBB, 0xE0, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x00, -0x04, 0x05, 0x06, 0x02, 0x01, 0x02, 0x01, 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, 0x05, 0x07, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, -0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0E, 0x0C, 0x0D, 0x0C, 0x04, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, -0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x0D, 0x0C, 0x00, 0x00, 0x17, 0x34, 0x00, 0x00, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, -0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x11, 0x00, 0x00, -0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, -0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, -0x01, 0x19, 0x54, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0xE3, -0xFD, 0xE2, 0x01, 0x38, 0x6C, 0x78, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Tirane */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x96, 0xAA, 0x34, 0x68, -0xC8, 0x6D, 0x87, 0x70, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCD, 0xB8, 0xE9, 0x90, -0x08, 0x28, 0x39, 0xF0, 0x08, 0xEF, 0x3E, 0x60, 0x0A, 0x05, 0x78, 0xF0, 0x0A, 0xD0, 0x71, 0xE0, -0x0B, 0xE9, 0x4F, 0x70, 0x0C, 0xB4, 0x48, 0x60, 0x0D, 0xD2, 0x6B, 0xF0, 0x0E, 0x94, 0x2A, 0x60, -0x0F, 0xB0, 0xFC, 0x70, 0x10, 0x74, 0x0C, 0x60, 0x11, 0x90, 0xDE, 0x70, 0x12, 0x53, 0xEE, 0x60, -0x13, 0x70, 0xC0, 0x70, 0x14, 0x3B, 0xB9, 0x60, 0x15, 0x48, 0xB9, 0x70, 0x16, 0x13, 0xB2, 0x60, -0x17, 0x31, 0xD5, 0xF0, 0x17, 0xFC, 0xCE, 0xE0, 0x19, 0x00, 0x94, 0x70, 0x19, 0xDB, 0x5F, 0x60, -0x1A, 0xCC, 0xAF, 0xF0, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x00, 0x00, 0x12, 0x98, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xC8, 0x66, 0x15, 0x01, 0x30, -0xEB, 0xE5, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Tiraspol */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x22, 0x9E, 0x6B, 0x9F, 0x0C, -0xB7, 0xB0, 0xD2, 0x08, 0xB9, 0x3E, 0xF3, 0x60, 0xB9, 0xEF, 0x9C, 0x60, 0xBA, 0xDF, 0x8D, 0x60, -0xBB, 0xCF, 0x7E, 0x60, 0xBC, 0xC8, 0xA9, 0xE0, 0xBD, 0xB8, 0x9A, 0xE0, 0xBE, 0xA8, 0x8B, 0xE0, -0xBF, 0x98, 0x7C, 0xE0, 0xC0, 0x88, 0x6D, 0xE0, 0xC1, 0x78, 0x5E, 0xE0, 0xC2, 0x68, 0x4F, 0xE0, -0xC3, 0x58, 0x40, 0xE0, 0xC4, 0x48, 0x31, 0xE0, 0xC5, 0x38, 0x22, 0xE0, 0xC6, 0x28, 0x13, 0xE0, -0xC7, 0x18, 0x04, 0xE0, 0xC8, 0xBC, 0x93, 0x60, 0xCA, 0x77, 0x7D, 0x50, 0xCC, 0xE7, 0x4B, 0x10, -0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x4E, 0x90, 0x60, -0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, -0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, -0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, -0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, -0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x43, 0x3E, 0xD0, -0x27, 0xF5, 0x26, 0x80, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x60, 0xE8, 0x60, 0x29, 0xD4, 0xEC, 0x60, -0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, 0x2D, 0x94, 0xB0, 0x60, -0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x92, 0x60, 0x30, 0x64, 0x75, 0x50, 0x31, 0x5D, 0xAE, 0xE0, -0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x04, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x08, -0x06, 0x07, 0x06, 0x07, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0B, 0x0C, 0x0B, 0x0C, -0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0A, 0x04, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, -0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x0D, 0x0E, 0x00, 0x00, 0x1A, 0xF4, 0x00, 0x00, 0x00, 0x00, -0x18, 0x78, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, -0x00, 0x00, 0x1C, 0x20, 0x00, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x15, 0x00, 0x00, -0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, -0x00, 0x00, 0x38, 0x40, 0x01, 0x1A, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x0D, 0x43, 0x4D, 0x54, 0x00, 0x42, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, -0x4D, 0x53, 0x4B, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Uzhgorod */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1A, 0xC8, 0x09, 0x71, 0x90, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x80, 0xA9, 0x60, 0xD0, 0xA1, 0x9E, 0xE0, 0xD1, 0xE5, 0xFD, 0xF0, 0x15, 0x27, 0xA7, 0xD0, -0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, -0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, -0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, -0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, -0x25, 0x1C, 0x0A, 0xF0, 0x25, 0x9E, 0x73, 0x50, 0x26, 0x8D, 0x2E, 0xF0, 0x27, 0xF5, 0x42, 0xA0, -0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, -0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x00, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x05, 0x00, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x2A, -0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x11, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x15, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x11, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x4D, 0x53, -0x4B, 0x00, 0x45, 0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, -0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x01, 0x00, 0xD3, 0x83, 0x22, 0x01, 0x34, 0xAF, 0x70, 0x00, 0x00, 0x00, 0x08, 0x52, -0x75, 0x74, 0x68, 0x65, 0x6E, 0x69, 0x61, - -/* Europe/Vaduz */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0xD1, 0x46, 0x38, 0x01, 0x21, 0x2D, 0xF2, 0x00, -0x00, 0x00, 0x00, - -/* Europe/Vatican */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x37, 0xA6, 0xF0, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xC5, 0xCB, 0xF0, 0x9D, 0xB5, 0xBC, 0xF0, 0x9E, 0x89, 0xFE, 0x70, -0x9F, 0x9E, 0xD9, 0x70, 0xA0, 0x60, 0xA5, 0xF0, 0xA1, 0x7E, 0xBB, 0x70, 0xA2, 0x5C, 0x37, 0x70, -0xA3, 0x4C, 0x28, 0x70, 0xC8, 0x6C, 0x35, 0xF0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x07, 0x5F, 0x60, 0xD0, 0x6E, 0x42, 0x70, -0xD1, 0x72, 0x16, 0x10, 0xD2, 0x4C, 0xD2, 0xF0, 0xD3, 0x3E, 0x31, 0x90, 0xD4, 0x49, 0xD2, 0x10, -0xD5, 0x1D, 0xF7, 0x70, 0xD6, 0x29, 0x97, 0xF0, 0xD6, 0xEB, 0x80, 0x90, 0xD8, 0x09, 0x96, 0x10, -0xF9, 0x33, 0xB5, 0xF0, 0xF9, 0xD9, 0xC4, 0xE0, 0xFB, 0x1C, 0xD2, 0x70, 0xFB, 0xB9, 0xA6, 0xE0, -0xFC, 0xFC, 0xB4, 0x70, 0xFD, 0x99, 0x88, 0xE0, 0xFE, 0xE5, 0xD0, 0xF0, 0xFF, 0x82, 0xA5, 0x60, -0x00, 0xC5, 0xB2, 0xF0, 0x01, 0x62, 0x87, 0x60, 0x02, 0x9C, 0x5A, 0x70, 0x03, 0x42, 0x77, 0x70, -0x04, 0x85, 0x76, 0xF0, 0x05, 0x2B, 0x85, 0xE0, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x0B, 0x67, 0xE0, -0x08, 0x45, 0x3A, 0xF0, 0x08, 0xEB, 0x49, 0xE0, 0x0A, 0x2E, 0x57, 0x70, 0x0A, 0xCB, 0x39, 0xF0, -0x0C, 0x0E, 0x39, 0x70, 0x0C, 0xAB, 0x1B, 0xF0, 0x0D, 0xE4, 0xE0, 0xF0, 0x0E, 0x8A, 0xFD, 0xF0, -0x0F, 0xCD, 0xFD, 0x70, 0x10, 0x74, 0x1A, 0x70, 0x11, 0xAD, 0xDF, 0x70, 0x12, 0x53, 0xFC, 0x70, -0x12, 0xCE, 0x97, 0xF0, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, -0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, -0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, -0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xC9, 0x43, 0x70, 0x01, 0x25, 0xA7, 0xC8, 0x00, -0x00, 0x00, 0x00, - -/* Europe/Vienna */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xA1, 0xF2, 0xBF, 0x70, 0xA2, 0x70, 0x1A, 0x10, 0xA3, 0x44, 0x5B, 0x90, -0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, -0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, 0xD1, 0x7F, 0x45, 0x10, -0xD2, 0xDB, 0x34, 0xF0, 0xD3, 0x63, 0x1B, 0x90, 0xD4, 0x49, 0xD2, 0x10, 0xD5, 0x39, 0xC3, 0x10, -0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, 0x13, 0x4D, 0x27, 0xF0, -0x14, 0x33, 0xD0, 0x60, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, -0x02, 0x03, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0xD2, 0xE6, 0xE2, 0x01, 0x2B, 0x94, 0xB5, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Vilnius */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x22, 0x9C, 0x4F, 0x1F, 0x50, -0xA1, 0x85, 0x4A, 0x98, 0xA2, 0xF1, 0x30, 0xF0, 0xA3, 0x66, 0x78, 0x60, 0xC8, 0xAC, 0xCF, 0x70, -0xCA, 0x59, 0x2A, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, -0xCF, 0x92, 0x34, 0x10, 0xD0, 0x30, 0x3D, 0xE0, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, -0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, -0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, -0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, -0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, -0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, -0x29, 0xD5, 0x08, 0x80, 0x2A, 0xC4, 0xF9, 0x80, 0x2B, 0xB4, 0xEA, 0x80, 0x2C, 0xA4, 0xDB, 0x80, -0x2D, 0x94, 0xCC, 0x80, 0x2E, 0x84, 0xBD, 0x80, 0x2F, 0x74, 0xAE, 0x80, 0x30, 0x64, 0x9F, 0x80, -0x31, 0x5D, 0xCB, 0x00, 0x32, 0x72, 0xA6, 0x00, 0x33, 0x3D, 0xAD, 0x00, 0x34, 0x52, 0x88, 0x00, -0x34, 0xAA, 0xC0, 0x60, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x3E, 0x12, 0x13, 0x60, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x03, 0x02, 0x04, 0x07, 0x05, 0x06, 0x05, 0x06, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, -0x04, 0x08, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0B, -0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x0B, 0x0C, 0x03, 0x0D, 0x0E, -0x0D, 0x0F, 0x03, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, -0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, -0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, -0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, -0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x10, 0x0F, 0x00, 0x00, 0x13, 0xB0, 0x00, 0x00, 0x00, -0x00, 0x16, 0x68, 0x00, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x0C, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x08, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x14, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00, -0x00, 0x2A, 0x30, 0x00, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, -0x1D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x14, 0x00, 0x00, 0x0E, -0x10, 0x00, 0x08, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0C, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x1D, 0x57, -0x4D, 0x54, 0x00, 0x4B, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, -0x53, 0x4B, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0xDC, 0xC4, 0xED, 0x01, 0x39, 0x49, 0xD2, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Volgograd */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x19, 0xA1, 0xF5, 0x46, 0xDC, -0xAB, 0xD8, 0x86, 0x50, 0xB5, 0xA4, 0x0B, 0x50, 0xF0, 0xB0, 0x4C, 0x40, 0x15, 0x27, 0x99, 0xC0, -0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xCD, 0x40, 0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, -0x19, 0xDB, 0x35, 0x30, 0x1A, 0xCC, 0x85, 0xC0, 0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, -0x1D, 0x9C, 0x74, 0xE0, 0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, -0x21, 0x5C, 0x38, 0xE0, 0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x1A, 0xE0, 0x24, 0x2C, 0x0B, 0xE0, -0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, -0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70, -0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70, -0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, 0x34, 0x52, 0x79, 0xF0, -0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, 0x38, 0x1B, 0x78, 0x70, -0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, 0x3B, 0xDB, 0x3C, 0x70, -0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, 0x3F, 0x9B, 0x00, 0x70, -0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, 0x43, 0x63, 0xFE, 0xF0, -0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70, 0x47, 0x23, 0xC2, 0xF0, -0x47, 0xEE, 0xC9, 0xF0, 0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0, 0x4A, 0xE3, 0x86, 0xF0, -0x4B, 0xAE, 0x8D, 0xF0, 0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0, 0x4E, 0xAC, 0x85, 0x70, -0x4F, 0x6E, 0x51, 0xF0, 0x50, 0x8C, 0x67, 0x70, 0x51, 0x57, 0x6E, 0x70, 0x52, 0x6C, 0x49, 0x70, -0x53, 0x37, 0x50, 0x70, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x17, 0x32, 0x70, 0x56, 0x2C, 0x0D, 0x70, -0x56, 0xF7, 0x14, 0x70, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD6, 0xF6, 0x70, 0x59, 0xF5, 0x0B, 0xF0, -0x5A, 0xB6, 0xD8, 0x70, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9F, 0xF4, 0xF0, 0x5D, 0xB4, 0xCF, 0xF0, -0x5E, 0x7F, 0xD6, 0xF0, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5F, 0xB8, 0xF0, 0x61, 0x7D, 0xCE, 0x70, -0x62, 0x3F, 0x9A, 0xF0, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1F, 0x7C, 0xF0, 0x65, 0x3D, 0x92, 0x70, -0x66, 0x08, 0x99, 0x70, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE8, 0x7B, 0x70, 0x68, 0xFD, 0x56, 0x70, -0x69, 0xC8, 0x5D, 0x70, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA8, 0x3F, 0x70, 0x6C, 0xC6, 0x54, 0xF0, -0x6D, 0x88, 0x21, 0x70, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x68, 0x03, 0x70, 0x70, 0x86, 0x18, 0xF0, -0x71, 0x51, 0x1F, 0xF0, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x31, 0x01, 0xF0, 0x74, 0x45, 0xDC, 0xF0, -0x75, 0x10, 0xE3, 0xF0, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xF0, 0xC5, 0xF0, 0x78, 0x0E, 0xDB, 0x70, -0x78, 0xD0, 0xA7, 0xF0, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xB0, 0x89, 0xF0, 0x7B, 0xCE, 0x9F, 0x70, -0x7C, 0x99, 0xA6, 0x70, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x79, 0x88, 0x70, 0x7F, 0x8E, 0x63, 0x70, -0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x08, 0x09, 0x08, 0x09, 0x06, 0x08, 0x0A, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x00, 0x00, 0x29, 0xA4, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x09, 0x00, 0x00, 0x46, -0x50, 0x01, 0x0E, 0x00, 0x00, 0x38, 0x40, 0x00, 0x14, 0x00, 0x00, 0x38, 0x40, 0x00, 0x14, 0x00, -0x00, 0x46, 0x50, 0x01, 0x0E, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0E, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x14, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x53, 0x41, 0x54, 0x00, -0x53, 0x54, 0x41, 0x54, 0x00, 0x56, 0x4F, 0x4C, 0x53, 0x54, 0x00, 0x56, 0x4F, 0x4C, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD3, 0xB0, 0xB5, 0x01, 0x56, 0x6E, 0xC2, 0x00, 0x00, -0x00, 0x17, 0x4D, 0x6F, 0x73, 0x63, 0x6F, 0x77, 0x2B, 0x30, 0x30, 0x20, 0x2D, 0x20, 0x43, 0x61, -0x73, 0x70, 0x69, 0x61, 0x6E, 0x20, 0x53, 0x65, 0x61, - -/* Europe/Warsaw */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xA7, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x16, 0x99, 0xA8, 0x2A, 0xD0, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0xA0, 0x9A, 0xB6, 0x00, 0xA1, 0x65, 0xBD, 0x00, -0xA6, 0x7D, 0x7C, 0x60, 0xC8, 0x76, 0xDE, 0x10, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x80, 0xA9, 0x60, 0xD0, 0x84, 0xBA, 0x00, -0xD1, 0x95, 0x92, 0x70, 0xD2, 0x8A, 0xBB, 0x60, 0xD3, 0x62, 0xFF, 0x70, 0xD4, 0x4B, 0x23, 0x90, -0xD5, 0x5E, 0xAD, 0x10, 0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, -0xD9, 0x02, 0xC1, 0x90, 0xD9, 0xE9, 0x78, 0x10, 0xE8, 0x54, 0xD2, 0x00, 0xE8, 0xF1, 0xB4, 0x80, -0xE9, 0xE1, 0xA5, 0x80, 0xEA, 0xD1, 0x96, 0x80, 0xEC, 0x14, 0x96, 0x00, 0xEC, 0xBA, 0xB3, 0x00, -0xED, 0xAA, 0xA4, 0x00, 0xEE, 0x9A, 0x95, 0x00, 0xEF, 0xD4, 0x5A, 0x00, 0xF0, 0x7A, 0x77, 0x00, -0xF1, 0xB4, 0x3C, 0x00, 0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x94, 0x1E, 0x00, 0xF4, 0x3A, 0x3B, 0x00, -0xF5, 0x7D, 0x3A, 0x80, 0xF6, 0x1A, 0x1D, 0x00, 0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x55, 0x80, -0x0E, 0x8B, 0x0C, 0x00, 0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, -0x12, 0x54, 0x0A, 0x80, 0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xEC, 0x80, 0x15, 0x23, 0xDD, 0x80, -0x16, 0x13, 0xCE, 0x80, 0x17, 0x03, 0xBF, 0x80, 0x17, 0xF3, 0xB0, 0x80, 0x18, 0xE3, 0xA1, 0x80, -0x19, 0xD3, 0x92, 0x80, 0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00, 0x1C, 0xAC, 0xA0, 0x00, -0x1D, 0x9C, 0x91, 0x00, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, -0x21, 0x5C, 0x55, 0x00, 0x21, 0xDA, 0xD6, 0xF0, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x07, 0x05, -0x06, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x00, -0x00, 0x13, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x12, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x57, 0x4D, 0x54, 0x00, 0x43, -0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD9, 0x0E, 0x68, 0x01, 0x32, 0xB3, 0xA0, 0x00, 0x00, 0x00, -0x00, - -/* Europe/Zagreb */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xCA, 0x02, 0x35, 0xE0, -0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, -0xD0, 0x82, 0x25, 0x10, 0xD0, 0xFA, 0x01, 0x70, 0xD1, 0xA1, 0x8C, 0x10, 0xD2, 0x4E, 0x40, 0x90, -0x18, 0x45, 0x5F, 0x70, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, -0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xCF, 0x36, -0xE0, 0x01, 0x2B, 0x05, 0x7A, 0x00, 0x00, 0x00, 0x00, - -/* Europe/Zaporozhye */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0xAA, 0x19, 0xA3, 0x30, -0xB5, 0xA4, 0x19, 0x60, 0xCA, 0xAA, 0xE7, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCE, 0xBD, 0xD6, 0x70, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, -0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, -0x1A, 0xCC, 0x93, 0xD0, 0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, -0x1E, 0x8C, 0x73, 0xF0, 0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, -0x22, 0x4C, 0x37, 0xF0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, -0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE4, 0xED, 0x50, -0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xCE, 0x60, 0x2C, 0xA4, 0xB1, 0x50, -0x2D, 0x94, 0xB0, 0x60, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, -0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x09, 0x01, 0x09, 0x01, 0x09, -0x01, 0x09, 0x01, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, -0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x0A, 0x0B, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, -0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, -0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x04, 0x43, 0x55, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, -0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD2, 0x51, 0x25, 0x01, 0x48, 0x51, 0x7A, 0x00, -0x00, 0x00, 0x2E, 0x5A, 0x61, 0x70, 0x6F, 0x72, 0x6F, 0x7A, 0x68, 0x27, 0x79, 0x65, 0x2C, 0x20, -0x45, 0x20, 0x4C, 0x75, 0x67, 0x61, 0x6E, 0x73, 0x6B, 0x20, 0x2F, 0x20, 0x5A, 0x61, 0x70, 0x6F, -0x72, 0x69, 0x7A, 0x68, 0x69, 0x61, 0x2C, 0x20, 0x45, 0x20, 0x4C, 0x75, 0x68, 0x61, 0x6E, 0x73, -0x6B, - -/* Europe/Zurich */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xC9, 0x24, 0xC7, 0xF0, -0xC9, 0x72, 0x82, 0x60, 0xCA, 0x16, 0x26, 0x90, 0xCA, 0xE1, 0x03, 0x60, 0xCB, 0xF6, 0x08, 0x90, -0xCC, 0xC0, 0xE5, 0x60, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0xD1, 0xA1, -0x5D, 0x01, 0x1F, 0xAD, 0xD5, 0x00, 0x00, 0x00, 0x00, - -/* Factory */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x4C, 0x6F, 0x63, 0x61, 0x6C, 0x20, 0x74, 0x69, 0x6D, 0x65, 0x20, 0x7A, 0x6F, 0x6E, -0x65, 0x20, 0x6D, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x74, 0x2D, 0x2D, 0x73, -0x65, 0x65, 0x20, 0x7A, 0x69, 0x63, 0x20, 0x6D, 0x61, 0x6E, 0x75, 0x61, 0x6C, 0x20, 0x70, 0x61, -0x67, 0x65, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* GB */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* GB-Eire */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0D, 0x9B, 0x26, 0xAD, 0xA0, -0x9B, 0xD6, 0x05, 0x20, 0x9C, 0xCF, 0x30, 0xA0, 0x9D, 0xA4, 0xC3, 0xA0, 0x9E, 0x9C, 0x9D, 0xA0, -0x9F, 0x97, 0x1A, 0xA0, 0xA0, 0x85, 0xBA, 0x20, 0xA1, 0x76, 0xFC, 0xA0, 0xA2, 0x65, 0x9C, 0x20, -0xA3, 0x7B, 0xC8, 0xA0, 0xA4, 0x4E, 0xB8, 0xA0, 0xA5, 0x3F, 0xFB, 0x20, 0xA6, 0x25, 0x60, 0x20, -0xA7, 0x27, 0xC6, 0x20, 0xA8, 0x2A, 0x2C, 0x20, 0xA8, 0xEB, 0xF8, 0xA0, 0xAA, 0x00, 0xD3, 0xA0, -0xAA, 0xD5, 0x15, 0x20, 0xAB, 0xE9, 0xF0, 0x20, 0xAC, 0xC7, 0x6C, 0x20, 0xAD, 0xC9, 0xD2, 0x20, -0xAE, 0xA7, 0x4E, 0x20, 0xAF, 0xA0, 0x79, 0xA0, 0xB0, 0x87, 0x30, 0x20, 0xB1, 0x92, 0xD0, 0xA0, -0xB2, 0x70, 0x4C, 0xA0, 0xB3, 0x72, 0xB2, 0xA0, 0xB4, 0x50, 0x2E, 0xA0, 0xB5, 0x49, 0x5A, 0x20, -0xB6, 0x30, 0x10, 0xA0, 0xB7, 0x32, 0x76, 0xA0, 0xB8, 0x0F, 0xF2, 0xA0, 0xB9, 0x12, 0x58, 0xA0, -0xB9, 0xEF, 0xD4, 0xA0, 0xBA, 0xE9, 0x00, 0x20, 0xBB, 0xD8, 0xF1, 0x20, 0xBC, 0xDB, 0x57, 0x20, -0xBD, 0xB8, 0xD3, 0x20, 0xBE, 0xB1, 0xFE, 0xA0, 0xBF, 0x98, 0xB5, 0x20, 0xC0, 0x9B, 0x1B, 0x20, -0xC1, 0x78, 0x97, 0x20, 0xC2, 0x7A, 0xFD, 0x20, 0xC3, 0x58, 0x79, 0x20, 0xC4, 0x51, 0xA4, 0xA0, -0xC5, 0x38, 0x5B, 0x20, 0xC6, 0x3A, 0xC1, 0x20, 0xC7, 0x58, 0xD6, 0xA0, 0xC7, 0xDA, 0x09, 0xA0, -0xCA, 0x16, 0x26, 0x90, 0xCA, 0x97, 0x59, 0x90, 0xCB, 0xD1, 0x1E, 0x90, 0xCC, 0x77, 0x3B, 0x90, -0xCD, 0xB1, 0x00, 0x90, 0xCE, 0x60, 0x58, 0x10, 0xCF, 0x90, 0xE2, 0x90, 0xD0, 0x6E, 0x5E, 0x90, -0xD1, 0x72, 0x16, 0x10, 0xD1, 0xFB, 0x32, 0x10, 0xD2, 0x69, 0xFE, 0x20, 0xD3, 0x63, 0x29, 0xA0, -0xD4, 0x49, 0xE0, 0x20, 0xD5, 0x1E, 0x21, 0xA0, 0xD5, 0x42, 0xFD, 0x90, 0xD5, 0xDF, 0xE0, 0x10, -0xD6, 0x4E, 0xAC, 0x20, 0xD6, 0xFE, 0x03, 0xA0, 0xD8, 0x2E, 0x8E, 0x20, 0xD8, 0xF9, 0x95, 0x20, -0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xEB, 0xEC, 0x20, 0xDB, 0xE5, 0x17, 0xA0, 0xDC, 0xCB, 0xCE, 0x20, -0xDD, 0xC4, 0xF9, 0xA0, 0xDE, 0xB4, 0xEA, 0xA0, 0xDF, 0xAE, 0x16, 0x20, 0xE0, 0x94, 0xCC, 0xA0, -0xE1, 0x72, 0x48, 0xA0, 0xE2, 0x6B, 0x74, 0x20, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x54, 0x90, 0xA0, -0xE5, 0x32, 0x0C, 0xA0, 0xE6, 0x3D, 0xAD, 0x20, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x14, 0x54, 0xA0, -0xE8, 0xFB, 0x0B, 0x20, 0xE9, 0xFD, 0x71, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xDD, 0x53, 0x20, -0xEC, 0xBA, 0xCF, 0x20, 0xED, 0xB3, 0xFA, 0xA0, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x81, 0x67, 0xA0, -0xF0, 0x9F, 0x7D, 0x20, 0xF1, 0x61, 0x49, 0xA0, 0xF2, 0x7F, 0x5F, 0x20, 0xF3, 0x4A, 0x66, 0x20, -0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x21, 0x0D, 0xA0, 0xF6, 0x3F, 0x23, 0x20, 0xF7, 0x00, 0xEF, 0xA0, -0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xE0, 0xD1, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, 0xFA, 0xC0, 0xB3, 0xA0, -0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0x7B, 0xAB, 0xA0, 0xFD, 0xC7, 0xBB, 0x70, 0x03, 0x70, 0xC6, 0x20, -0x04, 0x29, 0x58, 0x20, 0x05, 0x50, 0xA8, 0x20, 0x06, 0x09, 0x3A, 0x20, 0x07, 0x30, 0x8A, 0x20, -0x07, 0xE9, 0x1C, 0x20, 0x09, 0x10, 0x6C, 0x20, 0x09, 0xC8, 0xFE, 0x20, 0x0A, 0xF0, 0x4E, 0x20, -0x0B, 0xB2, 0x1A, 0xA0, 0x0C, 0xD0, 0x30, 0x20, 0x0D, 0x91, 0xFC, 0xA0, 0x0E, 0xB0, 0x12, 0x20, -0x0F, 0x71, 0xDE, 0xA0, 0x10, 0x99, 0x2E, 0xA0, 0x11, 0x51, 0xC0, 0xA0, 0x12, 0x79, 0x10, 0xA0, -0x13, 0x31, 0xA2, 0xA0, 0x14, 0x58, 0xF2, 0xA0, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x38, 0xC6, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x18, 0x18, 0xA8, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xF8, 0x8A, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xE1, 0xA7, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0xC1, 0x89, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0xA1, 0x6B, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x81, 0x4D, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x61, 0x2F, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x4A, 0x4B, 0x90, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x2A, 0x2D, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x29, 0x0A, 0x0F, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xE9, 0xF1, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xC9, 0xD3, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0xA9, 0xB5, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x89, 0x97, 0x90, -0x30, 0xE7, 0x24, 0x00, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, -0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, -0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, -0x42, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x42, 0x44, 0x53, 0x54, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* GMT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* GMT0 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* GMT-0 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* GMT+0 */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Greenwich */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x47, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Hongkong */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x69, 0x5A, 0xFC, -0xD3, 0x6A, 0xB7, 0x38, 0xD4, 0x93, 0x4A, 0xA8, 0xD5, 0x42, 0xB0, 0x38, 0xD6, 0x9A, 0xB9, 0xA8, -0xD7, 0x3E, 0x41, 0xB8, 0xD8, 0x2E, 0x24, 0xA8, 0xD8, 0xF9, 0x39, 0xB8, 0xDA, 0x0E, 0x06, 0xA8, -0xDA, 0xD9, 0x1B, 0xB8, 0xDB, 0xED, 0xE8, 0xA8, 0xDC, 0xB8, 0xFD, 0xB8, 0xDD, 0xCD, 0xCA, 0xA8, -0xDE, 0xA2, 0x1A, 0x38, 0xDF, 0xAD, 0xAC, 0xA8, 0xE0, 0x81, 0xFC, 0x38, 0xE1, 0x96, 0xC9, 0x28, -0xE2, 0x4F, 0x69, 0x38, 0xE3, 0x76, 0xAB, 0x28, 0xE4, 0x2F, 0x4B, 0x38, 0xE5, 0x5F, 0xC7, 0xA8, -0xE6, 0x0F, 0x2D, 0x38, 0xE7, 0x3F, 0xA9, 0xA8, 0xE7, 0xF8, 0x49, 0xB8, 0xE9, 0x1F, 0x8B, 0xA8, -0xE9, 0xD8, 0x2B, 0xB8, 0xEA, 0xFF, 0x6D, 0xA8, 0xEB, 0xB8, 0x0D, 0xB8, 0xEC, 0xDF, 0x4F, 0xA8, -0xED, 0x97, 0xEF, 0xB8, 0xEE, 0xC8, 0x6C, 0x28, 0xEF, 0x77, 0xD1, 0xB8, 0xF0, 0xA8, 0x4E, 0x28, -0xF1, 0x57, 0xB3, 0xB8, 0xF2, 0x88, 0x30, 0x28, 0xF3, 0x40, 0xD0, 0x38, 0xF4, 0x68, 0x12, 0x28, -0xF5, 0x20, 0xB2, 0x38, 0xF6, 0x47, 0xF4, 0x28, 0xF7, 0x25, 0x7E, 0x38, 0xF8, 0x15, 0x61, 0x28, -0xF9, 0x05, 0x60, 0x38, 0xF9, 0xF5, 0x43, 0x28, 0xFA, 0xE5, 0x42, 0x38, 0xFB, 0xDE, 0x5F, 0xA8, -0xFC, 0xCE, 0x5E, 0xB8, 0xFD, 0xBE, 0x41, 0xA8, 0xFE, 0xAE, 0x40, 0xB8, 0xFF, 0x9E, 0x23, 0xA8, -0x00, 0x8E, 0x22, 0xB8, 0x01, 0x7E, 0x05, 0xA8, 0x02, 0x6E, 0x04, 0xB8, 0x03, 0x5D, 0xE7, 0xA8, -0x04, 0x4D, 0xE6, 0xB8, 0x05, 0x47, 0x04, 0x28, 0x06, 0x37, 0x03, 0x38, 0x07, 0x26, 0xE6, 0x28, -0x08, 0x16, 0xE5, 0x38, 0x09, 0x06, 0xC8, 0x28, 0x09, 0xF6, 0xC7, 0x38, 0x0A, 0xE6, 0xAA, 0x28, -0x0B, 0xD6, 0xA9, 0x38, 0x0C, 0xC6, 0x8C, 0x28, 0x0D, 0xB6, 0x8B, 0x38, 0x0E, 0xA6, 0x6E, 0x28, -0x11, 0x9B, 0x39, 0x38, 0x12, 0x6F, 0x6C, 0xA8, 0x13, 0x7B, 0x1B, 0x38, 0x14, 0x4F, 0x4E, 0xA8, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x6B, 0x04, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, -0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x48, 0x4B, 0x53, 0x54, 0x00, -0x48, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* HST */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Iceland */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x8B, 0x60, 0x83, 0x94, -0x9C, 0x91, 0x1E, 0x00, 0x9D, 0xD1, 0x88, 0x90, 0x9E, 0x72, 0x51, 0x80, 0x9F, 0xD5, 0x03, 0x10, -0xC6, 0x4D, 0x1A, 0x00, 0xC7, 0x66, 0x05, 0xA0, 0xC7, 0xDA, 0x17, 0xB0, 0xC9, 0x26, 0x43, 0xA0, -0xC9, 0xC3, 0x26, 0x20, 0xCB, 0x06, 0x25, 0xA0, 0xCB, 0xAC, 0x42, 0xA0, 0xCC, 0xDC, 0xCD, 0x20, -0xCD, 0x8C, 0x24, 0xA0, 0xCE, 0xBC, 0xAF, 0x20, 0xCF, 0x6C, 0x06, 0xA0, 0xD0, 0x9C, 0x91, 0x20, -0xD1, 0x4B, 0xE8, 0xA0, 0xD2, 0x85, 0xAD, 0xA0, 0xD3, 0x2B, 0xCA, 0xA0, 0xD4, 0x65, 0x8F, 0xA0, -0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x45, 0x71, 0xA0, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x25, 0x53, 0xA0, -0xD8, 0xF9, 0x95, 0x20, 0xDA, 0x0E, 0x70, 0x20, 0xDA, 0xD9, 0x77, 0x20, 0xDB, 0xE5, 0x17, 0xA0, -0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xCE, 0x34, 0x20, 0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0xAE, 0x16, 0x20, -0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x8D, 0xF8, 0x20, 0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x6D, 0xDA, 0x20, -0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x4D, 0xBC, 0x20, 0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x36, 0xD8, 0xA0, -0xE8, 0x0B, 0x1A, 0x20, 0xE9, 0x16, 0xBA, 0xA0, 0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xF6, 0x9C, 0xA0, -0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xD6, 0x7E, 0xA0, 0xED, 0xAA, 0xC0, 0x20, 0xEE, 0xB6, 0x60, 0xA0, -0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x96, 0x42, 0xA0, 0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x7F, 0x5F, 0x20, -0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x5F, 0x41, 0x20, 0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x3F, 0x23, 0x20, -0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x1F, 0x05, 0x20, 0xF8, 0xF3, 0x46, 0xA0, 0xF9, 0xFE, 0xE7, 0x20, -0xFA, 0xD3, 0x28, 0xA0, 0xFB, 0xE8, 0x03, 0xA0, 0xFC, 0xBC, 0x45, 0x20, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0xFF, 0xFF, 0xEB, 0x6C, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, -0x00, 0x00, 0x01, 0x04, 0xFF, 0xFF, 0xF1, 0xF0, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, -0x52, 0x4D, 0x54, 0x00, 0x49, 0x53, 0x53, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x47, 0x4D, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Antananarivo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xF3, 0xCD, 0xF4, -0xE2, 0x33, 0xC0, 0xC0, 0xE2, 0xAB, 0xB9, 0x40, 0x01, 0x02, 0x03, 0x00, 0x00, 0x2C, 0x8C, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x00, 0x00, 0x2A, -0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x43, 0x12, 0x01, 0x5B, 0x29, 0xB2, -0x00, 0x00, 0x00, 0x00, - -/* Indian/Chagos */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x89, 0x7E, 0xF7, 0x9C, -0x30, 0xE6, 0xDD, 0xB0, 0x01, 0x02, 0x00, 0x00, 0x43, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, -0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x49, 0x4F, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x28, 0x15, 0x01, 0x81, 0x28, 0x42, 0x00, 0x00, -0x00, 0x00, - -/* Indian/Christmas */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x00, 0x43, 0x58, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7A, 0xB4, 0xC2, 0x01, 0xB3, 0xF8, 0x12, -0x00, 0x00, 0x00, 0x00, - -/* Indian/Cocos */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x5B, 0x68, -0x00, 0x00, 0x43, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x77, 0x45, 0xDA, 0x01, 0xA6, 0x8A, 0x92, -0x00, 0x00, 0x00, 0x00, - -/* Indian/Comoro */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD1, 0xF0, -0x01, 0x00, 0x00, 0x28, 0x90, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x96, 0x4D, 0x01, 0x54, 0xAD, -0x8A, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Kerguelen */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDA, 0x61, 0x62, 0x80, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x7A, 0x7A, 0x7A, -0x00, 0x54, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x19, 0x6D, 0x01, 0x7D, 0xCD, -0x36, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Mahe */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x88, 0x64, 0xE6, 0x84, -0x01, 0x00, 0x00, 0x33, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x3E, 0x2A, 0x01, 0x67, 0x4B, -0x2A, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Maldives */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xED, 0x2F, 0xC3, 0x98, -0x01, 0x00, 0x00, 0x44, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x00, 0x04, 0x4D, 0x4D, 0x54, -0x00, 0x4D, 0x56, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8F, 0xAF, 0xDA, 0x01, 0x82, 0xCF, -0x70, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Mauritius */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x89, 0x7F, 0x05, 0x98, -0x18, 0x05, 0xED, 0x40, 0x18, 0xDB, 0x72, 0x30, 0x49, 0x03, 0x96, 0xE0, 0x49, 0xCE, 0x9D, 0xE0, -0x4A, 0xE3, 0x78, 0xE0, 0x4B, 0xAE, 0x7F, 0xE0, 0x4C, 0xCC, 0x95, 0x60, 0x4D, 0x8E, 0x61, 0xE0, -0x4E, 0xAC, 0x77, 0x60, 0x4F, 0x6E, 0x43, 0xE0, 0x50, 0x8C, 0x59, 0x60, 0x51, 0x57, 0x60, 0x60, -0x52, 0x6C, 0x3B, 0x60, 0x53, 0x37, 0x42, 0x60, 0x54, 0x4C, 0x1D, 0x60, 0x55, 0x17, 0x24, 0x60, -0x56, 0x2B, 0xFF, 0x60, 0x56, 0xF7, 0x06, 0x60, 0x58, 0x15, 0x1B, 0xE0, 0x58, 0xD6, 0xE8, 0x60, -0x59, 0xF4, 0xFD, 0xE0, 0x5A, 0xB6, 0xCA, 0x60, 0x5B, 0xD4, 0xDF, 0xE0, 0x5C, 0x9F, 0xE6, 0xE0, -0x5D, 0xB4, 0xC1, 0xE0, 0x5E, 0x7F, 0xC8, 0xE0, 0x5F, 0x94, 0xA3, 0xE0, 0x60, 0x5F, 0xAA, 0xE0, -0x61, 0x7D, 0xC0, 0x60, 0x62, 0x3F, 0x8C, 0xE0, 0x63, 0x5D, 0xA2, 0x60, 0x64, 0x1F, 0x6E, 0xE0, -0x65, 0x3D, 0x84, 0x60, 0x66, 0x08, 0x8B, 0x60, 0x67, 0x1D, 0x66, 0x60, 0x67, 0xE8, 0x6D, 0x60, -0x68, 0xFD, 0x48, 0x60, 0x69, 0xC8, 0x4F, 0x60, 0x6A, 0xDD, 0x2A, 0x60, 0x6B, 0xA8, 0x31, 0x60, -0x6C, 0xC6, 0x46, 0xE0, 0x6D, 0x88, 0x13, 0x60, 0x6E, 0xA6, 0x28, 0xE0, 0x6F, 0x67, 0xF5, 0x60, -0x70, 0x86, 0x0A, 0xE0, 0x71, 0x51, 0x11, 0xE0, 0x72, 0x65, 0xEC, 0xE0, 0x73, 0x30, 0xF3, 0xE0, -0x74, 0x45, 0xCE, 0xE0, 0x75, 0x10, 0xD5, 0xE0, 0x76, 0x2E, 0xEB, 0x60, 0x76, 0xF0, 0xB7, 0xE0, -0x78, 0x0E, 0xCD, 0x60, 0x78, 0xD0, 0x99, 0xE0, 0x79, 0xEE, 0xAF, 0x60, 0x7A, 0xB0, 0x7B, 0xE0, -0x7B, 0xCE, 0x91, 0x60, 0x7C, 0x99, 0x98, 0x60, 0x7D, 0xAE, 0x73, 0x60, 0x7E, 0x79, 0x7A, 0x60, -0x7F, 0x8E, 0x55, 0x60, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x00, 0x00, 0x35, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x46, 0x50, 0x01, 0x04, 0x00, 0x00, -0x38, 0x40, 0x00, 0x09, 0x00, 0x00, 0x46, 0x50, 0x01, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x09, -0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x55, 0x53, 0x54, 0x00, 0x4D, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6B, 0x10, 0xDA, 0x01, 0x6A, 0x65, 0x70, 0x00, -0x00, 0x00, 0x00, - -/* Indian/Mayotte */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD0, 0x18, -0x01, 0x00, 0x00, 0x2A, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x36, 0xBD, 0x01, 0x57, 0xAD, -0xC5, 0x00, 0x00, 0x00, 0x00, - -/* Indian/Reunion */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xCC, 0x39, 0x80, -0x01, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x52, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x22, 0x4A, 0x01, 0x67, 0x4B, -0x2A, 0x00, 0x00, 0x00, 0x00, - -/* Iran */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x9A, 0x6C, 0x7D, 0xC8, -0xD2, 0xDB, 0x12, 0xC8, 0x0E, 0xBB, 0xA2, 0x48, 0x0F, 0x74, 0x2D, 0x40, 0x10, 0x8E, 0x40, 0x30, -0x10, 0xED, 0x3A, 0x40, 0x11, 0x55, 0x67, 0xC8, 0x12, 0x45, 0x4A, 0xB8, 0x13, 0x37, 0xEC, 0xC8, -0x14, 0x2D, 0x15, 0xB8, 0x28, 0x20, 0x76, 0xC8, 0x28, 0xDB, 0x9D, 0xB8, 0x29, 0xCB, 0x9C, 0xC8, -0x2A, 0xBE, 0x22, 0xB8, 0x2B, 0xAC, 0xD0, 0x48, 0x2C, 0x9F, 0x56, 0x38, 0x2D, 0x8E, 0x03, 0xC8, -0x2E, 0x80, 0x89, 0xB8, 0x2F, 0x6F, 0x37, 0x48, 0x30, 0x61, 0xBD, 0x38, 0x31, 0x50, 0x6A, 0xC8, -0x32, 0x42, 0xF0, 0xB8, 0x33, 0x32, 0xEF, 0xC8, 0x34, 0x25, 0x75, 0xB8, 0x35, 0x14, 0x23, 0x48, -0x36, 0x06, 0xA9, 0x38, 0x36, 0xF5, 0x56, 0xC8, 0x37, 0xE7, 0xDC, 0xB8, 0x38, 0xD6, 0x8A, 0x48, -0x39, 0xC9, 0x10, 0x38, 0x3A, 0xB9, 0x0F, 0x48, 0x3B, 0xAB, 0x95, 0x38, 0x3C, 0x9A, 0x42, 0xC8, -0x3D, 0x8C, 0xC8, 0xB8, 0x3E, 0x7B, 0x76, 0x48, 0x3F, 0x6D, 0xFC, 0x38, 0x40, 0x5C, 0xA9, 0xC8, -0x41, 0x4F, 0x2F, 0xB8, 0x42, 0x3F, 0x2E, 0xC8, 0x43, 0x31, 0xB4, 0xB8, 0x47, 0xE2, 0xC9, 0x48, -0x48, 0xD5, 0x4F, 0x38, 0x49, 0xC5, 0x4E, 0x48, 0x4A, 0xB7, 0xD4, 0x38, 0x4B, 0xA6, 0x81, 0xC8, -0x4C, 0x99, 0x07, 0xB8, 0x4D, 0x87, 0xB5, 0x48, 0x4E, 0x7A, 0x3B, 0x38, 0x4F, 0x68, 0xE8, 0xC8, -0x50, 0x5B, 0x6E, 0xB8, 0x51, 0x4B, 0x6D, 0xC8, 0x52, 0x3D, 0xF3, 0xB8, 0x53, 0x2C, 0xA1, 0x48, -0x54, 0x1F, 0x27, 0x38, 0x55, 0x0D, 0xD4, 0xC8, 0x56, 0x00, 0x5A, 0xB8, 0x56, 0xEF, 0x08, 0x48, -0x57, 0xE1, 0x8E, 0x38, 0x58, 0xD1, 0x8D, 0x48, 0x59, 0xC4, 0x13, 0x38, 0x5A, 0xB2, 0xC0, 0xC8, -0x5B, 0xA5, 0x46, 0xB8, 0x5C, 0x93, 0xF4, 0x48, 0x5D, 0x86, 0x7A, 0x38, 0x5E, 0x75, 0x27, 0xC8, -0x5F, 0x67, 0xAD, 0xB8, 0x60, 0x57, 0xAC, 0xC8, 0x61, 0x4A, 0x32, 0xB8, 0x62, 0x38, 0xE0, 0x48, -0x63, 0x2B, 0x66, 0x38, 0x64, 0x1A, 0x13, 0xC8, 0x65, 0x0C, 0x99, 0xB8, 0x65, 0xFB, 0x47, 0x48, -0x66, 0xED, 0xCD, 0x38, 0x67, 0xDD, 0xCC, 0x48, 0x68, 0xD0, 0x52, 0x38, 0x69, 0xBE, 0xFF, 0xC8, -0x6A, 0xB1, 0x85, 0xB8, 0x6B, 0xA0, 0x33, 0x48, 0x6C, 0x92, 0xB9, 0x38, 0x6D, 0x81, 0x66, 0xC8, -0x6E, 0x73, 0xEC, 0xB8, 0x6F, 0x62, 0x9A, 0x48, 0x70, 0x55, 0x20, 0x38, 0x71, 0x45, 0x1F, 0x48, -0x72, 0x37, 0xA5, 0x38, 0x73, 0x26, 0x52, 0xC8, 0x74, 0x18, 0xD8, 0xB8, 0x75, 0x07, 0x86, 0x48, -0x75, 0xFA, 0x0C, 0x38, 0x76, 0xE8, 0xB9, 0xC8, 0x77, 0xDB, 0x3F, 0xB8, 0x78, 0xCB, 0x3E, 0xC8, -0x79, 0xBD, 0xC4, 0xB8, 0x7A, 0xAC, 0x72, 0x48, 0x7B, 0x9E, 0xF8, 0x38, 0x7C, 0x8D, 0xA5, 0xC8, -0x7D, 0x80, 0x2B, 0xB8, 0x7E, 0x6E, 0xD9, 0x48, 0x7F, 0x61, 0x5F, 0x38, 0x01, 0x02, 0x04, 0x03, -0x04, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, -0x00, 0x00, 0x30, 0x38, 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x00, 0x04, 0x00, 0x00, 0x31, 0x38, -0x00, 0x08, 0x00, 0x00, 0x46, 0x50, 0x01, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x00, 0x08, 0x00, 0x00, -0x3F, 0x48, 0x01, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x4D, 0x54, 0x00, 0x49, 0x52, 0x53, 0x54, -0x00, 0x49, 0x52, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Israel */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x9E, 0x30, 0x45, 0x88, -0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, -0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, -0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xD7, 0x5A, 0x14, 0x60, 0xD7, 0xDF, 0x1F, 0xC0, -0xD8, 0x2F, 0xB5, 0x70, 0xD9, 0x1E, 0x46, 0xE0, 0xDA, 0x10, 0xE8, 0xF0, 0xDA, 0xEB, 0xB3, 0xE0, -0xDB, 0xB4, 0x34, 0x00, 0xDC, 0xB9, 0x20, 0xE0, 0xDD, 0xE0, 0x8D, 0x00, 0xDE, 0xB4, 0xCE, 0x80, -0xDF, 0xA4, 0xBF, 0x80, 0xE0, 0x8B, 0x76, 0x00, 0xE1, 0x56, 0x7D, 0x00, 0xE2, 0xBE, 0x4A, 0x60, -0xE3, 0x36, 0x34, 0xD0, 0xE4, 0x9C, 0xF7, 0x00, 0xE5, 0x16, 0x16, 0xD0, 0xE6, 0x74, 0xD3, 0xE0, -0xE7, 0x11, 0xD2, 0x80, 0xE8, 0x27, 0xFF, 0x00, 0xE8, 0xE8, 0x4F, 0xD0, 0x08, 0x7C, 0x8B, 0xE0, -0x08, 0xFD, 0xB0, 0xD0, 0x09, 0xF6, 0xEA, 0x60, 0x0A, 0xA6, 0x33, 0xD0, 0x1C, 0xBE, 0xF8, 0xE0, -0x1D, 0x89, 0xF1, 0xD0, 0x1E, 0xCC, 0xFF, 0x60, 0x1F, 0x60, 0x99, 0x50, 0x20, 0x82, 0xB1, 0x60, -0x21, 0x49, 0xB5, 0xD0, 0x22, 0x5D, 0x4D, 0x60, 0x23, 0x1F, 0x0B, 0xD0, 0x24, 0x5A, 0x30, 0x60, -0x25, 0x00, 0x3F, 0x50, 0x26, 0x0B, 0xED, 0xE0, 0x26, 0xD6, 0xE6, 0xD0, 0x27, 0xEB, 0xCF, 0xE0, -0x28, 0xC0, 0x03, 0x50, 0x29, 0xD4, 0xEC, 0x60, 0x2A, 0xA9, 0x1F, 0xD0, 0x2B, 0xBB, 0x65, 0xE0, -0x2C, 0x89, 0x01, 0xD0, 0x2D, 0x9B, 0x47, 0xE0, 0x2E, 0x5F, 0xA9, 0x50, 0x2F, 0x7B, 0x29, 0xE0, -0x30, 0x48, 0xC5, 0xD0, 0x31, 0x48, 0x96, 0xE0, 0x32, 0x3C, 0x6E, 0x50, 0x33, 0x31, 0xB3, 0x60, -0x34, 0x1A, 0xFE, 0xD0, 0x35, 0x11, 0x95, 0x60, 0x35, 0xF1, 0xA6, 0x50, 0x37, 0x04, 0x08, 0x80, -0x37, 0xCF, 0x01, 0x70, 0x38, 0xF6, 0x5F, 0x80, 0x39, 0xDC, 0xF9, 0xE0, 0x3A, 0xD0, 0xED, 0x70, -0x3B, 0xAE, 0x5B, 0x60, 0x3C, 0xA3, 0xA0, 0x70, 0x3D, 0xA0, 0xB2, 0x60, 0x3E, 0x83, 0x82, 0x70, -0x3F, 0x7C, 0x9F, 0xE0, 0x40, 0x73, 0x36, 0x70, 0x41, 0x50, 0xA4, 0x60, 0x42, 0x4C, 0x8F, 0x00, -0x43, 0x48, 0x4F, 0x70, 0x44, 0x2C, 0x71, 0x00, 0x45, 0x1E, 0xF6, 0xF0, 0x46, 0x0C, 0x53, 0x00, -0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, -0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, -0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x2B, 0xAF, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x27, 0x41, 0x70, 0x55, 0x14, 0x9D, 0x80, -0x55, 0xFD, 0xE8, 0xF0, 0x56, 0xFD, 0xBA, 0x00, 0x57, 0xF9, 0x7A, 0x70, 0x58, 0xDD, 0x9C, 0x00, -0x59, 0xC6, 0xE7, 0x70, 0x5A, 0xBD, 0x7E, 0x00, 0x5B, 0x9D, 0x8E, 0xF0, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x6F, 0xC7, 0xF0, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x3D, 0x34, 0xF0, 0x62, 0x46, 0x40, 0x80, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x26, 0x22, 0x80, -0x65, 0x0F, 0x6D, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xD8, 0x6C, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xAF, 0x13, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xAA, 0xA5, 0x70, 0x6D, 0x8E, 0xC7, 0x00, 0x6E, 0x78, 0x12, 0x70, 0x6F, 0x6E, 0xA9, 0x00, -0x70, 0x4E, 0xB9, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x17, 0xB8, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x75, 0xEE, 0x5F, 0xF0, 0x76, 0xF7, 0x6B, 0x80, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xD7, 0x4D, 0x80, 0x79, 0xB7, 0x5E, 0x70, 0x7A, 0xB7, 0x2F, 0x80, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x89, 0x97, 0x70, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x57, 0x04, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x00, 0x00, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x4A, 0x4D, 0x54, 0x00, 0x49, 0x44, -0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x49, 0x44, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Jamaica */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB5, 0x00, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, -0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, -0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, -0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, -0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, 0xB8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, -0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, -0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, -0x80, 0x00, 0x00, 0x00, 0x00, - -/* Japan */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xC3, 0xCE, 0x85, 0x70, -0xD7, 0x3E, 0x1E, 0x90, 0xD7, 0xEC, 0x16, 0x80, 0xD8, 0xF9, 0x16, 0x90, 0xD9, 0xCB, 0xF8, 0x80, -0xDB, 0x07, 0x1D, 0x10, 0xDB, 0xAB, 0xDA, 0x80, 0xDC, 0xE6, 0xFF, 0x10, 0xDD, 0x8B, 0xBC, 0x80, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, -0x00, 0x8C, 0xA0, 0x01, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x43, 0x4A, 0x54, 0x00, 0x4A, -0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Kwajalein */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xFF, 0x86, 0x1B, 0x50, -0x2C, 0x74, 0xBC, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0xFF, 0xFF, 0x57, 0x40, -0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4D, 0x48, 0x54, 0x00, 0x4B, 0x57, 0x41, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, -0x00, 0x00, 0x00, - -/* Libya */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0xA1, 0xF2, 0xC1, 0x24, -0xDD, 0xBB, 0xB1, 0x10, 0xDE, 0x23, 0xAD, 0x60, 0xE1, 0x78, 0xD2, 0x10, 0xE1, 0xE7, 0x65, 0xE0, -0xE5, 0x2F, 0x3F, 0x70, 0xE5, 0xA9, 0xCC, 0xE0, 0xEB, 0x4E, 0xC6, 0xF0, 0x16, 0x92, 0x42, 0x60, -0x17, 0x08, 0xF7, 0x70, 0x17, 0xFA, 0x2B, 0xE0, 0x18, 0xEA, 0x2A, 0xF0, 0x19, 0xDB, 0x5F, 0x60, -0x1A, 0xCC, 0xAF, 0xF0, 0x1B, 0xBD, 0xE4, 0x60, 0x1C, 0xB4, 0x7A, 0xF0, 0x1D, 0x9F, 0x17, 0xE0, -0x1E, 0x93, 0x0B, 0x70, 0x1F, 0x82, 0xEE, 0x60, 0x20, 0x70, 0x4A, 0x70, 0x21, 0x61, 0x7E, 0xE0, -0x22, 0x52, 0xCF, 0x70, 0x23, 0x44, 0x03, 0xE0, 0x24, 0x34, 0x02, 0xF0, 0x25, 0x25, 0x37, 0x60, -0x26, 0x40, 0xB7, 0xF0, 0x32, 0x4E, 0xF1, 0x60, 0x33, 0x44, 0x36, 0x70, 0x34, 0x35, 0x6A, 0xE0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x01, 0x03, 0x00, 0x00, 0x0C, -0x5C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, -0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* MET */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x9B, 0x0C, 0x17, 0x60, -0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, 0x9E, 0xB9, 0x90, 0x90, -0x9F, 0x84, 0x97, 0x90, 0xC8, 0x09, 0x71, 0x90, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x82, 0x25, 0x10, 0xD1, 0x72, 0x16, 0x10, -0xD2, 0x4E, 0x40, 0x90, 0x0D, 0xA4, 0x63, 0x90, 0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, -0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, 0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, -0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, -0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, 0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, -0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, -0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, -0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, -0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, -0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, -0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, -0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, -0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, -0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, -0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, -0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, -0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, -0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, -0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, -0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, -0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, -0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, -0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, -0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, -0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, -0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, -0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, -0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, -0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, -0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, -0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, -0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, -0x00, 0x00, 0x1C, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x05, 0x4D, 0x45, 0x53, 0x54, -0x00, 0x4D, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Mexico/BajaNorte */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0xA5, 0xB6, 0xF6, 0x80, -0xA9, 0x79, 0x4F, 0x70, 0xAF, 0xF2, 0x7C, 0xF0, 0xB6, 0x66, 0x64, 0x70, 0xB7, 0x1B, 0x10, 0x00, -0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x99, 0xBA, 0x70, -0xD7, 0x1B, 0x59, 0x00, 0xD8, 0x91, 0xB4, 0xF0, 0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, -0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, 0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, -0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, 0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, -0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, 0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x46, 0x0F, 0x82, 0xA0, 0x47, 0x24, 0x4F, 0x90, -0x47, 0xF8, 0x9F, 0x20, 0x49, 0x04, 0x31, 0x90, 0x49, 0xD8, 0x81, 0x20, 0x4A, 0xE4, 0x13, 0x90, -0x4B, 0xB8, 0x63, 0x20, 0x4C, 0xCD, 0x30, 0x10, 0x4D, 0x98, 0x45, 0x20, 0x4E, 0xAD, 0x12, 0x10, -0x4F, 0x78, 0x27, 0x20, 0x50, 0x8C, 0xF4, 0x10, 0x51, 0x61, 0x43, 0xA0, 0x52, 0x6C, 0xD6, 0x10, -0x53, 0x41, 0x25, 0xA0, 0x54, 0x4C, 0xB8, 0x10, 0x55, 0x21, 0x07, 0xA0, 0x56, 0x2C, 0x9A, 0x10, -0x57, 0x00, 0xE9, 0xA0, 0x58, 0x15, 0xB6, 0x90, 0x58, 0xE0, 0xCB, 0xA0, 0x59, 0xF5, 0x98, 0x90, -0x5A, 0xC0, 0xAD, 0xA0, 0x5B, 0xD5, 0x7A, 0x90, 0x5C, 0xA9, 0xCA, 0x20, 0x5D, 0xB5, 0x5C, 0x90, -0x5E, 0x89, 0xAC, 0x20, 0x5F, 0x95, 0x3E, 0x90, 0x60, 0x69, 0x8E, 0x20, 0x61, 0x7E, 0x5B, 0x10, -0x62, 0x49, 0x70, 0x20, 0x63, 0x5E, 0x3D, 0x10, 0x64, 0x29, 0x52, 0x20, 0x65, 0x3E, 0x1F, 0x10, -0x66, 0x12, 0x6E, 0xA0, 0x67, 0x1E, 0x01, 0x10, 0x67, 0xF2, 0x50, 0xA0, 0x68, 0xFD, 0xE3, 0x10, -0x69, 0xD2, 0x32, 0xA0, 0x6A, 0xDD, 0xC5, 0x10, 0x6B, 0xB2, 0x14, 0xA0, 0x6C, 0xC6, 0xE1, 0x90, -0x6D, 0x91, 0xF6, 0xA0, 0x6E, 0xA6, 0xC3, 0x90, 0x6F, 0x71, 0xD8, 0xA0, 0x70, 0x86, 0xA5, 0x90, -0x71, 0x5A, 0xF5, 0x20, 0x72, 0x66, 0x87, 0x90, 0x73, 0x3A, 0xD7, 0x20, 0x74, 0x46, 0x69, 0x90, -0x75, 0x1A, 0xB9, 0x20, 0x76, 0x2F, 0x86, 0x10, 0x76, 0xFA, 0x9B, 0x20, 0x78, 0x0F, 0x68, 0x10, -0x78, 0xDA, 0x7D, 0x20, 0x79, 0xEF, 0x4A, 0x10, 0x7A, 0xBA, 0x5F, 0x20, 0x7B, 0xCF, 0x2C, 0x10, -0x7C, 0xA3, 0x7B, 0xA0, 0x7D, 0xAF, 0x0E, 0x10, 0x7E, 0x83, 0x5D, 0xA0, 0x7F, 0x8E, 0xF0, 0x10, -0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x04, 0x05, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0x92, 0x4C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, -0x04, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0xFF, 0xFF, 0x9D, -0x90, 0x01, 0x10, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Mexico/BajaSur */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xCB, 0xEA, 0x71, 0x60, 0xD8, 0x91, 0xB4, 0xF0, 0x00, 0x00, 0x70, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xF5, 0x12, 0x90, 0x3B, 0xB6, 0xD1, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x46, 0x0F, 0x74, 0x90, 0x47, 0x24, 0x41, 0x80, -0x47, 0xF8, 0x91, 0x10, 0x49, 0x04, 0x23, 0x80, 0x49, 0xD8, 0x73, 0x10, 0x4A, 0xE4, 0x05, 0x80, -0x4B, 0xB8, 0x55, 0x10, 0x4C, 0xCD, 0x22, 0x00, 0x4D, 0x98, 0x37, 0x10, 0x4E, 0xAD, 0x04, 0x00, -0x4F, 0x78, 0x19, 0x10, 0x50, 0x8C, 0xE6, 0x00, 0x51, 0x61, 0x35, 0x90, 0x52, 0x6C, 0xC8, 0x00, -0x53, 0x41, 0x17, 0x90, 0x54, 0x4C, 0xAA, 0x00, 0x55, 0x20, 0xF9, 0x90, 0x56, 0x2C, 0x8C, 0x00, -0x57, 0x00, 0xDB, 0x90, 0x58, 0x15, 0xA8, 0x80, 0x58, 0xE0, 0xBD, 0x90, 0x59, 0xF5, 0x8A, 0x80, -0x5A, 0xC0, 0x9F, 0x90, 0x5B, 0xD5, 0x6C, 0x80, 0x5C, 0xA9, 0xBC, 0x10, 0x5D, 0xB5, 0x4E, 0x80, -0x5E, 0x89, 0x9E, 0x10, 0x5F, 0x95, 0x30, 0x80, 0x60, 0x69, 0x80, 0x10, 0x61, 0x7E, 0x4D, 0x00, -0x62, 0x49, 0x62, 0x10, 0x63, 0x5E, 0x2F, 0x00, 0x64, 0x29, 0x44, 0x10, 0x65, 0x3E, 0x11, 0x00, -0x66, 0x12, 0x60, 0x90, 0x67, 0x1D, 0xF3, 0x00, 0x67, 0xF2, 0x42, 0x90, 0x68, 0xFD, 0xD5, 0x00, -0x69, 0xD2, 0x24, 0x90, 0x6A, 0xDD, 0xB7, 0x00, 0x6B, 0xB2, 0x06, 0x90, 0x6C, 0xC6, 0xD3, 0x80, -0x6D, 0x91, 0xE8, 0x90, 0x6E, 0xA6, 0xB5, 0x80, 0x6F, 0x71, 0xCA, 0x90, 0x70, 0x86, 0x97, 0x80, -0x71, 0x5A, 0xE7, 0x10, 0x72, 0x66, 0x79, 0x80, 0x73, 0x3A, 0xC9, 0x10, 0x74, 0x46, 0x5B, 0x80, -0x75, 0x1A, 0xAB, 0x10, 0x76, 0x2F, 0x78, 0x00, 0x76, 0xFA, 0x8D, 0x10, 0x78, 0x0F, 0x5A, 0x00, -0x78, 0xDA, 0x6F, 0x10, 0x79, 0xEF, 0x3C, 0x00, 0x7A, 0xBA, 0x51, 0x10, 0x7B, 0xCF, 0x1E, 0x00, -0x7C, 0xA3, 0x6D, 0x90, 0x7D, 0xAF, 0x00, 0x00, 0x7E, 0x83, 0x4F, 0x90, 0x7F, 0x8E, 0xE2, 0x00, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, -0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xFF, 0xFF, 0x9C, -0x3C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x0C, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, -0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, -0x80, 0x00, 0x00, 0x00, 0x00, - -/* Mexico/General */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0xA5, 0xB6, 0xE8, 0x70, -0xAF, 0xF2, 0x6E, 0xE0, 0xB6, 0x66, 0x56, 0x60, 0xB7, 0x43, 0xD2, 0x60, 0xB8, 0x0C, 0x36, 0x60, -0xB8, 0xFD, 0x86, 0xF0, 0xC5, 0xDE, 0xB0, 0x60, 0xC6, 0x97, 0x34, 0x50, 0xC9, 0x55, 0xF1, 0xE0, -0xC9, 0xEA, 0xDD, 0x50, 0xCF, 0x02, 0xC6, 0xE0, 0xCF, 0xB7, 0x56, 0x50, 0xDA, 0x99, 0x15, 0xE0, -0xDB, 0x76, 0x83, 0xD0, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, 0x33, 0x47, 0x58, 0x00, -0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, 0x37, 0x07, 0x1C, 0x00, -0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, 0x3A, 0xF5, 0x04, 0x80, -0x3B, 0xB6, 0xC2, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, 0x3E, 0x8F, 0xDE, 0x80, -0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, 0x42, 0x4F, 0xA2, 0x80, -0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, 0x46, 0x0F, 0x66, 0x80, -0x47, 0x24, 0x33, 0x70, 0x47, 0xF8, 0x83, 0x00, 0x49, 0x04, 0x15, 0x70, 0x49, 0xD8, 0x65, 0x00, -0x4A, 0xE3, 0xF7, 0x70, 0x4B, 0xB8, 0x47, 0x00, 0x4C, 0xCD, 0x13, 0xF0, 0x4D, 0x98, 0x29, 0x00, -0x4E, 0xAC, 0xF5, 0xF0, 0x4F, 0x78, 0x0B, 0x00, 0x50, 0x8C, 0xD7, 0xF0, 0x51, 0x61, 0x27, 0x80, -0x52, 0x6C, 0xB9, 0xF0, 0x53, 0x41, 0x09, 0x80, 0x54, 0x4C, 0x9B, 0xF0, 0x55, 0x20, 0xEB, 0x80, -0x56, 0x2C, 0x7D, 0xF0, 0x57, 0x00, 0xCD, 0x80, 0x58, 0x15, 0x9A, 0x70, 0x58, 0xE0, 0xAF, 0x80, -0x59, 0xF5, 0x7C, 0x70, 0x5A, 0xC0, 0x91, 0x80, 0x5B, 0xD5, 0x5E, 0x70, 0x5C, 0xA9, 0xAE, 0x00, -0x5D, 0xB5, 0x40, 0x70, 0x5E, 0x89, 0x90, 0x00, 0x5F, 0x95, 0x22, 0x70, 0x60, 0x69, 0x72, 0x00, -0x61, 0x7E, 0x3E, 0xF0, 0x62, 0x49, 0x54, 0x00, 0x63, 0x5E, 0x20, 0xF0, 0x64, 0x29, 0x36, 0x00, -0x65, 0x3E, 0x02, 0xF0, 0x66, 0x12, 0x52, 0x80, 0x67, 0x1D, 0xE4, 0xF0, 0x67, 0xF2, 0x34, 0x80, -0x68, 0xFD, 0xC6, 0xF0, 0x69, 0xD2, 0x16, 0x80, 0x6A, 0xDD, 0xA8, 0xF0, 0x6B, 0xB1, 0xF8, 0x80, -0x6C, 0xC6, 0xC5, 0x70, 0x6D, 0x91, 0xDA, 0x80, 0x6E, 0xA6, 0xA7, 0x70, 0x6F, 0x71, 0xBC, 0x80, -0x70, 0x86, 0x89, 0x70, 0x71, 0x5A, 0xD9, 0x00, 0x72, 0x66, 0x6B, 0x70, 0x73, 0x3A, 0xBB, 0x00, -0x74, 0x46, 0x4D, 0x70, 0x75, 0x1A, 0x9D, 0x00, 0x76, 0x2F, 0x69, 0xF0, 0x76, 0xFA, 0x7F, 0x00, -0x78, 0x0F, 0x4B, 0xF0, 0x78, 0xDA, 0x61, 0x00, 0x79, 0xEF, 0x2D, 0xF0, 0x7A, 0xBA, 0x43, 0x00, -0x7B, 0xCF, 0x0F, 0xF0, 0x7C, 0xA3, 0x5F, 0x80, 0x7D, 0xAE, 0xF1, 0xF0, 0x7E, 0x83, 0x41, 0x80, -0x7F, 0x8E, 0xD3, 0xF0, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0xFF, 0xFF, 0xA3, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0x9D, 0x90, -0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x01, 0x10, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, -0x43, 0x44, 0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* MST */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, -0x00, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* MST7MDT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, -0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, -0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* Navajo */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, -0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00, -0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* NZ */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8, -0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68, -0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68, -0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68, -0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8, -0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8, -0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8, -0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0, -0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0, -0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0, -0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0, -0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60, -0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60, -0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60, -0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0, -0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60, -0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60, -0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60, -0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0, -0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0, -0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0, -0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60, -0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60, -0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60, -0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, 0x48, 0xDE, 0x3C, 0x60, -0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, 0x4C, 0x9E, 0x00, 0x60, -0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, 0x50, 0x66, 0xFE, 0xE0, -0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, 0x54, 0x26, 0xC2, 0xE0, -0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, 0x57, 0xE6, 0x86, 0xE0, -0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, 0x5B, 0xAF, 0x85, 0x60, -0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, 0x5F, 0x6F, 0x49, 0x60, -0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, 0x63, 0x2F, 0x0D, 0x60, -0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, 0x66, 0xF8, 0x0B, 0xE0, -0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, 0x6A, 0xB7, 0xCF, 0xE0, -0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, 0x6E, 0x77, 0x93, 0xE0, -0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, 0x72, 0x40, 0x92, 0x60, -0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, 0x76, 0x00, 0x56, 0x60, -0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, 0x79, 0xC0, 0x1A, 0x60, -0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, 0x7D, 0x89, 0x18, 0xE0, -0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00, -0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00, -0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54, -0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* NZ-CHAT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xE7, 0x8B, 0xC2, 0x04, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, -0x48, 0xDE, 0x3C, 0x60, 0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, -0x4C, 0x9E, 0x00, 0x60, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, -0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, -0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, -0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, -0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, -0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, -0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, -0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, -0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, -0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, -0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, -0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, -0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, -0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0xAB, 0xFC, -0x00, 0x00, 0x00, 0x00, 0xC1, 0x5C, 0x01, 0x04, 0x00, 0x00, 0xB3, 0x4C, 0x00, 0x0A, 0x00, 0x00, -0xB3, 0x4C, 0x00, 0x0A, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x48, 0x41, 0x44, 0x54, 0x00, 0x43, 0x48, -0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, -0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Apia */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x57, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x91, 0x05, 0xFC, 0x00, -0xDA, 0x62, 0x04, 0x38, 0x01, 0x02, 0xFF, 0xFF, 0x5F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, -0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, -0x00, 0x57, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xC3, 0xA5, 0x00, -0x0E, 0xDA, 0x15, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Auckland */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0xB4, 0xB2, 0xE8, -0xB1, 0x51, 0x87, 0x58, 0xB2, 0x78, 0xE5, 0x68, 0xB3, 0x43, 0xE5, 0x60, 0xB4, 0x58, 0xC7, 0x68, -0xB5, 0x23, 0xC7, 0x60, 0xB6, 0x38, 0xA9, 0x68, 0xB7, 0x03, 0xA9, 0x60, 0xB8, 0x18, 0x8B, 0x68, -0xB8, 0xEC, 0xC5, 0xE0, 0xB9, 0xF8, 0x6D, 0x68, 0xBA, 0xCC, 0xA7, 0xE0, 0xBB, 0xD8, 0x4F, 0x68, -0xBC, 0xE3, 0xE8, 0xE0, 0xBD, 0xAE, 0xF6, 0xE8, 0xBE, 0xC3, 0xCA, 0xE0, 0xBF, 0x8E, 0xD8, 0xE8, -0xC0, 0xA3, 0xAC, 0xE0, 0xC1, 0x6E, 0xBA, 0xE8, 0xC2, 0x83, 0x8E, 0xE0, 0xC3, 0x4E, 0x9C, 0xE8, -0xC4, 0x63, 0x70, 0xE0, 0xC5, 0x2E, 0x7E, 0xE8, 0xC6, 0x4C, 0x8D, 0x60, 0xC7, 0x0E, 0x60, 0xE8, -0xC8, 0x2C, 0x6F, 0x60, 0xC8, 0xF7, 0x7D, 0x68, 0xD2, 0xDA, 0x9A, 0x40, 0x09, 0x18, 0xFD, 0xE0, -0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, 0x0C, 0xD8, 0xC1, 0xE0, -0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, 0x10, 0x98, 0x85, 0xE0, -0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, 0x14, 0x58, 0x49, 0xE0, -0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, 0x18, 0x21, 0x48, 0x60, -0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, 0x1B, 0xE1, 0x0C, 0x60, -0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, 0x1F, 0xA0, 0xD0, 0x60, -0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, 0x23, 0x69, 0xCE, 0xE0, -0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, 0x27, 0x0D, 0xE3, 0x60, -0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, 0x2A, 0xCD, 0xA7, 0x60, -0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, 0x2E, 0x8D, 0x6B, 0x60, -0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, 0x32, 0x56, 0x69, 0xE0, -0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, 0x36, 0x16, 0x2D, 0xE0, -0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, 0x39, 0xD5, 0xF1, 0xE0, -0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, 0x3D, 0x9E, 0xF0, 0x60, -0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, 0x41, 0x5E, 0xB4, 0x60, -0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, 0x45, 0x1E, 0x78, 0x60, -0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, 0x48, 0xDE, 0x3C, 0x60, -0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, 0x4C, 0x9E, 0x00, 0x60, -0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, 0x50, 0x66, 0xFE, 0xE0, -0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, 0x54, 0x26, 0xC2, 0xE0, -0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, 0x57, 0xE6, 0x86, 0xE0, -0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, 0x5B, 0xAF, 0x85, 0x60, -0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, 0x5F, 0x6F, 0x49, 0x60, -0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, 0x63, 0x2F, 0x0D, 0x60, -0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, 0x66, 0xF8, 0x0B, 0xE0, -0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, 0x6A, 0xB7, 0xCF, 0xE0, -0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, 0x6E, 0x77, 0x93, 0xE0, -0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, 0x72, 0x40, 0x92, 0x60, -0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, 0x76, 0x00, 0x56, 0x60, -0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, 0x79, 0xC0, 0x1A, 0x60, -0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, 0x7D, 0x89, 0x18, 0xE0, -0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x00, 0x00, 0xAF, 0xC8, 0x01, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x05, 0x00, -0x00, 0xA8, 0xC0, 0x01, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, 0x0A, 0x00, 0x00, 0xA8, 0xC0, 0x00, -0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4E, 0x5A, 0x53, 0x54, 0x00, 0x4E, 0x5A, 0x4D, 0x54, -0x00, 0x4E, 0x5A, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x53, 0xB8, 0x4A, 0x02, 0x1D, 0x54, 0xBA, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, -0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* Pacific/Chatham */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xE7, 0x8B, 0xC2, 0x04, -0x09, 0x18, 0xFD, 0xE0, 0x09, 0xAC, 0xA5, 0xE0, 0x0A, 0xEF, 0xA5, 0x60, 0x0B, 0x9E, 0xFC, 0xE0, -0x0C, 0xD8, 0xC1, 0xE0, 0x0D, 0x7E, 0xDE, 0xE0, 0x0E, 0xB8, 0xA3, 0xE0, 0x0F, 0x5E, 0xC0, 0xE0, -0x10, 0x98, 0x85, 0xE0, 0x11, 0x3E, 0xA2, 0xE0, 0x12, 0x78, 0x67, 0xE0, 0x13, 0x1E, 0x84, 0xE0, -0x14, 0x58, 0x49, 0xE0, 0x14, 0xFE, 0x66, 0xE0, 0x16, 0x38, 0x2B, 0xE0, 0x16, 0xE7, 0x83, 0x60, -0x18, 0x21, 0x48, 0x60, 0x18, 0xC7, 0x65, 0x60, 0x1A, 0x01, 0x2A, 0x60, 0x1A, 0xA7, 0x47, 0x60, -0x1B, 0xE1, 0x0C, 0x60, 0x1C, 0x87, 0x29, 0x60, 0x1D, 0xC0, 0xEE, 0x60, 0x1E, 0x67, 0x0B, 0x60, -0x1F, 0xA0, 0xD0, 0x60, 0x20, 0x46, 0xED, 0x60, 0x21, 0x80, 0xB2, 0x60, 0x22, 0x30, 0x09, 0xE0, -0x23, 0x69, 0xCE, 0xE0, 0x24, 0x0F, 0xEB, 0xE0, 0x25, 0x2E, 0x01, 0x60, 0x26, 0x02, 0x42, 0xE0, -0x27, 0x0D, 0xE3, 0x60, 0x27, 0xE2, 0x24, 0xE0, 0x28, 0xED, 0xC5, 0x60, 0x29, 0xC2, 0x06, 0xE0, -0x2A, 0xCD, 0xA7, 0x60, 0x2B, 0xAB, 0x23, 0x60, 0x2C, 0xAD, 0x89, 0x60, 0x2D, 0x8B, 0x05, 0x60, -0x2E, 0x8D, 0x6B, 0x60, 0x2F, 0x6A, 0xE7, 0x60, 0x30, 0x6D, 0x4D, 0x60, 0x31, 0x4A, 0xC9, 0x60, -0x32, 0x56, 0x69, 0xE0, 0x33, 0x2A, 0xAB, 0x60, 0x34, 0x36, 0x4B, 0xE0, 0x35, 0x0A, 0x8D, 0x60, -0x36, 0x16, 0x2D, 0xE0, 0x36, 0xF3, 0xA9, 0xE0, 0x37, 0xF6, 0x0F, 0xE0, 0x38, 0xD3, 0x8B, 0xE0, -0x39, 0xD5, 0xF1, 0xE0, 0x3A, 0xB3, 0x6D, 0xE0, 0x3B, 0xBF, 0x0E, 0x60, 0x3C, 0x93, 0x4F, 0xE0, -0x3D, 0x9E, 0xF0, 0x60, 0x3E, 0x73, 0x31, 0xE0, 0x3F, 0x7E, 0xD2, 0x60, 0x40, 0x5C, 0x4E, 0x60, -0x41, 0x5E, 0xB4, 0x60, 0x42, 0x3C, 0x30, 0x60, 0x43, 0x3E, 0x96, 0x60, 0x44, 0x1C, 0x12, 0x60, -0x45, 0x1E, 0x78, 0x60, 0x45, 0xFB, 0xF4, 0x60, 0x46, 0xFE, 0x5A, 0x60, 0x47, 0xF7, 0x85, 0xE0, -0x48, 0xDE, 0x3C, 0x60, 0x49, 0xD7, 0x67, 0xE0, 0x4A, 0xBE, 0x1E, 0x60, 0x4B, 0xB7, 0x49, 0xE0, -0x4C, 0x9E, 0x00, 0x60, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60, 0x4F, 0x77, 0x0D, 0xE0, -0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60, 0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, -0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60, 0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, -0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60, 0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, -0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0, 0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, -0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0, 0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, -0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0, 0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, -0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60, 0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, -0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60, 0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, -0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60, 0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, -0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0, 0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, -0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0, 0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, -0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0, 0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, -0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60, 0x7F, 0x68, 0xFA, 0xE0, 0x03, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0xAB, 0xFC, -0x00, 0x00, 0x00, 0x00, 0xC1, 0x5C, 0x01, 0x04, 0x00, 0x00, 0xB3, 0x4C, 0x00, 0x0A, 0x00, 0x00, -0xB3, 0x4C, 0x00, 0x0A, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x48, 0x41, 0x44, 0x54, 0x00, 0x43, 0x48, -0x41, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x2A, 0x78, -0x00, 0x06, 0xF1, 0x58, 0x00, 0x00, 0x00, 0x0F, 0x43, 0x68, 0x61, 0x74, 0x68, 0x61, 0x6D, 0x20, -0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Pacific/Easter */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0F, 0xB9, 0xC7, 0x40, 0x88, -0xCC, 0x1C, 0x6E, 0x40, 0xCC, 0x6C, 0xE7, 0xD0, 0xD4, 0x1B, 0xC9, 0xB0, 0xFD, 0xD1, 0x3C, 0x40, -0xFE, 0x92, 0xFA, 0xB0, 0xFF, 0xCC, 0xCD, 0xC0, 0x00, 0x72, 0xDC, 0xB0, 0x01, 0x75, 0x50, 0xC0, -0x02, 0x40, 0x49, 0xB0, 0x03, 0x55, 0x32, 0xC0, 0x04, 0x20, 0x2B, 0xB0, 0x05, 0x3E, 0x4F, 0x40, -0x06, 0x00, 0x0D, 0xB0, 0x07, 0x0B, 0xBC, 0x40, 0x07, 0xDF, 0xEF, 0xB0, 0x08, 0xFE, 0x13, 0x40, -0x09, 0xBF, 0xD1, 0xB0, 0x0A, 0xDD, 0xF5, 0x40, 0x0B, 0xA8, 0xEE, 0x30, 0x0C, 0xBD, 0xD7, 0x40, -0x0D, 0x88, 0xD0, 0x30, 0x0E, 0x9D, 0xB9, 0x40, 0x0F, 0x68, 0xB2, 0x30, 0x10, 0x86, 0xD5, 0xC0, -0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xB7, 0xC0, 0x13, 0x28, 0x76, 0x30, 0x14, 0x46, 0x99, 0xC0, -0x15, 0x11, 0x92, 0xB0, 0x16, 0x26, 0x7B, 0xC0, 0x16, 0xF1, 0x74, 0xB0, 0x18, 0x06, 0x5D, 0xC0, -0x18, 0xD1, 0x56, 0xB0, 0x19, 0xE6, 0x3F, 0xC0, 0x1A, 0xB1, 0x38, 0xB0, 0x1B, 0xCF, 0x5C, 0x40, -0x1C, 0x91, 0x1A, 0xB0, 0x1D, 0xAF, 0x3E, 0x40, 0x1E, 0x70, 0xFC, 0xB0, 0x1F, 0x8F, 0x20, 0x40, -0x20, 0x7F, 0x03, 0x30, 0x21, 0x6F, 0x02, 0x40, 0x22, 0x39, 0xFB, 0x30, 0x23, 0x45, 0xA9, 0xC0, -0x24, 0x19, 0xDD, 0x30, 0x25, 0x38, 0x00, 0xC0, 0x26, 0x02, 0xF9, 0xB0, 0x26, 0xF2, 0xF8, 0xC0, -0x27, 0xD9, 0xA1, 0x30, 0x28, 0xF7, 0xC4, 0xC0, 0x29, 0xC2, 0xBD, 0xB0, 0x2A, 0xD7, 0xA6, 0xC0, -0x2B, 0xA2, 0x9F, 0xB0, 0x2C, 0xB7, 0x88, 0xC0, 0x2D, 0x82, 0x81, 0xB0, 0x2E, 0x97, 0x6A, 0xC0, -0x2F, 0x62, 0x63, 0xB0, 0x30, 0x80, 0x87, 0x40, 0x31, 0x42, 0x45, 0xB0, 0x32, 0x60, 0x69, 0x40, -0x33, 0x3D, 0xD7, 0x30, 0x34, 0x40, 0x4B, 0x40, 0x35, 0x0B, 0x44, 0x30, 0x36, 0x0D, 0xB8, 0x40, -0x37, 0x06, 0xD5, 0xB0, 0x38, 0x00, 0x0F, 0x40, 0x38, 0xCB, 0x08, 0x30, 0x39, 0xE9, 0x2B, 0xC0, -0x3A, 0xAA, 0xEA, 0x30, 0x3B, 0xC9, 0x0D, 0xC0, 0x3C, 0x8A, 0xCC, 0x30, 0x3D, 0xA8, 0xEF, 0xC0, -0x3E, 0x6A, 0xAE, 0x30, 0x3F, 0x88, 0xD1, 0xC0, 0x40, 0x53, 0xCA, 0xB0, 0x41, 0x68, 0xB3, 0xC0, -0x42, 0x33, 0xAC, 0xB0, 0x43, 0x48, 0x95, 0xC0, 0x44, 0x13, 0x8E, 0xB0, 0x45, 0x31, 0xB2, 0x40, -0x45, 0xF3, 0x70, 0xB0, 0x47, 0x11, 0x94, 0x40, 0x47, 0xEF, 0x02, 0x30, 0x48, 0xF1, 0x76, 0x40, -0x49, 0xBC, 0x6F, 0x30, 0x4A, 0xD1, 0x58, 0x40, 0x4B, 0x9C, 0x51, 0x30, 0x4C, 0xB1, 0x3A, 0x40, -0x4D, 0x7C, 0x33, 0x30, 0x4E, 0x91, 0x1C, 0x40, 0x4F, 0x5C, 0x15, 0x30, 0x50, 0x7A, 0x38, 0xC0, -0x51, 0x3B, 0xF7, 0x30, 0x52, 0x5A, 0x1A, 0xC0, 0x53, 0x1B, 0xD9, 0x30, 0x54, 0x39, 0xFC, 0xC0, -0x55, 0x04, 0xF5, 0xB0, 0x56, 0x19, 0xDE, 0xC0, 0x56, 0xE4, 0xD7, 0xB0, 0x57, 0xF9, 0xC0, 0xC0, -0x58, 0xC4, 0xB9, 0xB0, 0x59, 0xE2, 0xDD, 0x40, 0x5A, 0xA4, 0x9B, 0xB0, 0x5B, 0xC2, 0xBF, 0x40, -0x5C, 0x84, 0x7D, 0xB0, 0x5D, 0xA2, 0xA1, 0x40, 0x5E, 0x6D, 0x9A, 0x30, 0x5F, 0x82, 0x83, 0x40, -0x60, 0x4D, 0x7C, 0x30, 0x61, 0x62, 0x65, 0x40, 0x62, 0x2D, 0x5E, 0x30, 0x63, 0x42, 0x47, 0x40, -0x64, 0x0D, 0x40, 0x30, 0x65, 0x2B, 0x63, 0xC0, 0x65, 0xED, 0x22, 0x30, 0x67, 0x0B, 0x45, 0xC0, -0x67, 0xCD, 0x04, 0x30, 0x68, 0xEB, 0x27, 0xC0, 0x69, 0xB6, 0x20, 0xB0, 0x6A, 0xCB, 0x09, 0xC0, -0x6B, 0x96, 0x02, 0xB0, 0x6C, 0xAA, 0xEB, 0xC0, 0x6D, 0x75, 0xE4, 0xB0, 0x6E, 0x94, 0x08, 0x40, -0x6F, 0x55, 0xC6, 0xB0, 0x70, 0x73, 0xEA, 0x40, 0x71, 0x35, 0xA8, 0xB0, 0x72, 0x53, 0xCC, 0x40, -0x73, 0x15, 0x8A, 0xB0, 0x74, 0x33, 0xAE, 0x40, 0x74, 0xFE, 0xA7, 0x30, 0x76, 0x13, 0x90, 0x40, -0x76, 0xDE, 0x89, 0x30, 0x77, 0xF3, 0x72, 0x40, 0x78, 0xBE, 0x6B, 0x30, 0x79, 0xDC, 0x8E, 0xC0, -0x7A, 0x9E, 0x4D, 0x30, 0x7B, 0xBC, 0x70, 0xC0, 0x7C, 0x7E, 0x2F, 0x30, 0x7D, 0x9C, 0x52, 0xC0, -0x7E, 0x67, 0x4B, 0xB0, 0x7F, 0x7C, 0x34, 0xC0, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0xFF, 0xFF, 0x99, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0x9D, -0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x09, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x09, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x09, 0x45, 0x4D, 0x54, 0x00, 0x45, -0x41, 0x53, 0x54, 0x00, 0x45, 0x41, 0x53, 0x53, 0x54, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, -0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x60, 0x5B, 0xF8, 0x00, 0x6C, 0xFF, 0xA5, 0x00, 0x00, -0x00, 0x1C, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x20, -0x26, 0x20, 0x53, 0x61, 0x6C, 0x61, 0x20, 0x79, 0x20, 0x47, 0x6F, 0x6D, 0x65, 0x7A, - -/* Pacific/Efate */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x92, 0xF5, 0xC2, 0xB4, -0x19, 0xD2, 0xF7, 0xD0, 0x1A, 0xC2, 0xDA, 0xC0, 0x1B, 0xDA, 0x66, 0xD0, 0x1C, 0xA2, 0xBC, 0xC0, -0x1D, 0x9B, 0xF6, 0x50, 0x1E, 0x82, 0x9E, 0xC0, 0x1F, 0x7B, 0xD8, 0x50, 0x20, 0x6B, 0xBB, 0x40, -0x21, 0x5B, 0xBA, 0x50, 0x22, 0x4B, 0x9D, 0x40, 0x23, 0x3B, 0x9C, 0x50, 0x24, 0x2B, 0x7F, 0x40, -0x25, 0x1B, 0x7E, 0x50, 0x26, 0x0B, 0x61, 0x40, 0x26, 0xFB, 0x60, 0x50, 0x27, 0xEB, 0x43, 0x40, -0x28, 0xE4, 0x7C, 0xD0, 0x29, 0x81, 0x51, 0x40, 0x2A, 0xE9, 0x48, 0xD0, 0x2B, 0x61, 0x33, 0x40, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x9D, 0xCC, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x01, -0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x56, 0x55, 0x53, 0x54, 0x00, -0x56, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x68, 0x0A, 0x02, 0x13, -0xA4, 0x42, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Enderbury */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x12, 0x56, 0x04, 0xC0, -0x2F, 0x06, 0x8B, 0x30, 0x01, 0x02, 0xFF, 0xFF, 0x57, 0x40, 0x00, 0x00, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x50, 0x48, 0x4F, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x84, 0xF4, 0x75, 0x00, 0x0D, 0xDC, 0x2D, 0x00, 0x00, 0x00, 0x0F, 0x50, -0x68, 0x6F, 0x65, 0x6E, 0x69, 0x78, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Pacific/Fakaofo */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x54, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x27, 0xDA, 0x00, 0x0E, 0x16, 0xC5, -0x00, 0x00, 0x00, 0x00, - -/* Pacific/Fiji */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x46, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0x9A, 0x13, 0xB2, 0x3C, -0x36, 0x3B, 0x17, 0xE0, 0x36, 0xD7, 0xFA, 0x60, 0x38, 0x24, 0x34, 0x60, 0x38, 0xB7, 0xDC, 0x60, -0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0xA7, 0x44, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x01, -0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x46, 0x4A, 0x53, 0x54, 0x00, -0x46, 0x4A, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x11, 0x15, 0x02, 0x22, -0xE6, 0x82, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Funafuti */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x54, 0x56, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7D, 0xE9, 0x12, 0x02, 0x24, 0x1F, 0x02, -0x00, 0x00, 0x00, 0x00, - -/* Pacific/Galapagos */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA4, 0x4C, 0x80, -0x1E, 0x18, 0xC4, 0x50, 0x01, 0x02, 0xFF, 0xFF, 0xAC, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, -0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x43, 0x54, 0x00, -0x47, 0x41, 0x4C, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8A, 0xB3, 0xD0, 0x00, -0x8B, 0xC5, 0x40, 0x00, 0x00, 0x00, 0x11, 0x47, 0x61, 0x6C, 0x61, 0x70, 0x61, 0x67, 0x6F, 0x73, -0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Pacific/Gambier */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x94, 0x50, 0x48, 0x04, -0x01, 0xFF, 0xFF, 0x81, 0x7C, 0x00, 0x00, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x47, 0x41, 0x4D, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x6F, 0xF5, 0x00, 0x47, -0xA3, 0xD7, 0x00, 0x00, 0x00, 0x0F, 0x47, 0x61, 0x6D, 0x62, 0x69, 0x65, 0x72, 0x20, 0x49, 0x73, -0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Pacific/Guadalcanal */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x94, 0x4F, 0x33, 0x8C, -0x01, 0x00, 0x00, 0x95, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x42, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x68, 0xF5, 0x02, 0x07, 0x1A, -0xA0, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Guam */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x3A, 0x43, 0x5E, 0x60, -0x01, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x47, 0x53, 0x54, -0x00, 0x43, 0x68, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0xE0, 0xAA, 0x01, 0xEF, -0x87, 0x78, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Honolulu */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0xBB, 0x05, 0x43, 0x48, -0xBB, 0x20, 0xE4, 0xB8, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x49, 0x38, -0xD5, 0x8D, 0x73, 0x48, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00, -0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x08, 0xFF, 0xFF, 0x7A, 0x68, -0x01, 0x0C, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00, -0x48, 0x57, 0x54, 0x00, 0x48, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0xA9, 0xD7, 0x46, 0x00, 0x24, 0x67, 0xA9, 0x00, 0x00, 0x00, 0x06, 0x48, 0x61, -0x77, 0x61, 0x69, 0x69, - -/* Pacific/Johnston */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0xA2, 0xE3, 0x38, 0x00, 0x11, 0x92, 0xB2, -0x00, 0x00, 0x00, 0x0E, 0x4A, 0x6F, 0x68, 0x6E, 0x73, 0x74, 0x6F, 0x6E, 0x20, 0x41, 0x74, 0x6F, -0x6C, 0x6C, - -/* Pacific/Kiritimati */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x12, 0x55, 0xF2, 0x00, -0x2F, 0x06, 0x7D, 0x20, 0x01, 0x02, 0xFF, 0xFF, 0x6A, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, -0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x00, 0x00, 0x4C, 0x49, 0x4E, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x8C, 0x2D, 0x6A, 0x00, 0x23, 0x9A, 0x95, 0x00, 0x00, 0x00, 0x0C, 0x4C, -0x69, 0x6E, 0x65, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Pacific/Kosrae */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x46, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0xFF, 0x86, 0x1B, 0x50, -0x36, 0x8B, 0x67, 0x40, 0x01, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x4B, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x71, 0x12, 0x02, -0x0B, 0x59, 0xDD, 0x00, 0x00, 0x00, 0x06, 0x4B, 0x6F, 0x73, 0x72, 0x61, 0x65, - -/* Pacific/Kwajalein */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xFF, 0x86, 0x1B, 0x50, -0x2C, 0x74, 0xBC, 0xC0, 0x01, 0x02, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0xFF, 0xFF, 0x57, 0x40, -0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4D, 0x48, 0x54, 0x00, 0x4B, 0x57, 0x41, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x30, 0x6D, 0x02, 0x11, 0xFD, 0x15, 0x00, -0x00, 0x00, 0x09, 0x4B, 0x77, 0x61, 0x6A, 0x61, 0x6C, 0x65, 0x69, 0x6E, - -/* Pacific/Majuro */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0xFF, 0x86, 0x1B, 0x50, -0x01, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x00, 0x4D, 0x48, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x3D, 0x38, 0x02, 0x17, 0xE3, 0x80, 0x00, 0x00, 0x00, -0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, - -/* Pacific/Marquesas */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x94, 0x50, 0x4C, 0x48, -0x01, 0xFF, 0xFF, 0x7D, 0x38, 0x00, 0x00, 0xFF, 0xFF, 0x7A, 0x68, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x4D, 0x41, 0x52, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7B, 0x98, 0xA0, 0x00, 0x3F, -0x52, 0xF0, 0x00, 0x00, 0x00, 0x11, 0x4D, 0x61, 0x72, 0x71, 0x75, 0x65, 0x73, 0x61, 0x73, 0x20, -0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Pacific/Midway */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0xE6, 0x75, 0x8A, 0xB0, -0xE6, 0xED, 0x75, 0x20, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x00, 0x02, 0x03, -0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x04, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x44, 0x54, 0x00, -0x42, 0x53, 0x54, 0x00, 0x53, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xB4, 0x62, 0x62, 0x00, 0x05, 0x23, 0x1A, 0x00, 0x00, 0x00, 0x0E, 0x4D, 0x69, 0x64, 0x77, -0x61, 0x79, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Pacific/Nauru */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0xA3, 0xE7, 0x2B, 0x04, -0xCB, 0xB4, 0xBF, 0x48, 0xD0, 0x42, 0x50, 0x70, 0x11, 0x8B, 0x04, 0xC8, 0x01, 0x02, 0x01, 0x03, -0x00, 0x00, 0x9C, 0x7C, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, -0x00, 0x08, 0x00, 0x00, 0xA8, 0xC0, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x4E, 0x52, 0x54, 0x00, -0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8A, 0x1E, 0x12, -0x02, 0x11, 0x5A, 0x52, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Niue */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0xDC, 0x43, 0x35, 0x60, -0x10, 0x74, 0xCA, 0x38, 0x01, 0x02, 0xFF, 0xFF, 0x60, 0xA0, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, -0x00, 0x00, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0x4E, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x6C, 0x5C, 0xE2, 0x00, 0x12, 0x2E, 0xF2, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Norfolk */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xDC, 0x41, 0xF8, 0x80, -0x01, 0x00, 0x00, 0x9D, 0x80, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB8, 0x00, 0x04, 0x4E, 0x4D, 0x54, -0x00, 0x4E, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5D, 0x27, 0xA8, 0x02, 0x12, 0xF4, -0x7A, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Noumea */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x92, 0xF5, 0xC4, 0x74, -0x0E, 0xE6, 0xBA, 0x50, 0x0F, 0x56, 0xBB, 0xC0, 0x10, 0xC6, 0x9C, 0x50, 0x11, 0x37, 0xEF, 0x40, -0x32, 0xA0, 0x4B, 0xF0, 0x33, 0x18, 0x44, 0x70, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x00, -0x00, 0x9C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, -0x09, 0x00, 0x00, 0xA8, 0xC0, 0x01, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x09, 0x4C, 0x4D, 0x54, -0x00, 0x4E, 0x43, 0x53, 0x54, 0x00, 0x4E, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x2A, 0xAA, 0x02, 0x0F, 0x30, 0xF0, 0x00, 0x00, 0x00, 0x00, - - -/* Pacific/Pago_Pago */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x41, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x91, 0x05, 0xFB, 0x08, -0xDA, 0x62, 0x04, 0x38, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x02, 0x03, 0x04, -0xFF, 0xFF, 0x5F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x09, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0D, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x11, 0x4C, 0x4D, -0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x53, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x5F, -0xAA, 0x00, 0x10, 0x53, 0xAF, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Palau */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, -0x00, 0x00, 0x50, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x94, 0x84, 0xD5, 0x01, 0xDF, 0xDD, 0x0D, -0x00, 0x00, 0x00, 0x00, - -/* Pacific/Pitcairn */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x35, 0x44, 0x42, 0x08, -0x01, 0xFF, 0xFF, 0x88, 0x78, 0x00, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x04, 0x50, 0x4E, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x48, 0xAA, 0x00, 0x4C, 0x6B, -0xCD, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Ponape */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x46, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x9A, 0xB0, -0x00, 0x00, 0x50, 0x4F, 0x4E, 0x54, 0x00, 0x00, 0x00, 0x00, 0x93, 0xF5, 0x9A, 0x02, 0x04, 0x13, -0xE2, 0x00, 0x00, 0x00, 0x10, 0x50, 0x6F, 0x6E, 0x61, 0x70, 0x65, 0x20, 0x28, 0x50, 0x6F, 0x68, -0x6E, 0x70, 0x65, 0x69, 0x29, - -/* Pacific/Port_Moresby */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x50, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x5B, 0xF0, 0x01, 0xF3, 0x37, 0x7A, -0x00, 0x00, 0x00, 0x00, - -/* Pacific/Rarotonga */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0A, 0x10, 0xAC, 0x1B, 0x28, -0x11, 0x3F, 0xB5, 0x18, 0x12, 0x79, 0x81, 0x20, 0x13, 0x1F, 0x97, 0x18, 0x14, 0x59, 0x63, 0x20, -0x14, 0xFF, 0x79, 0x18, 0x16, 0x39, 0x45, 0x20, 0x16, 0xE8, 0x95, 0x98, 0x18, 0x22, 0x61, 0xA0, -0x18, 0xC8, 0x77, 0x98, 0x1A, 0x02, 0x43, 0xA0, 0x1A, 0xA8, 0x59, 0x98, 0x1B, 0xE2, 0x25, 0xA0, -0x1C, 0x88, 0x3B, 0x98, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0x68, 0x1D, 0x98, 0x1F, 0xA1, 0xE9, 0xA0, -0x20, 0x47, 0xFF, 0x98, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x31, 0x1C, 0x18, 0x23, 0x6A, 0xE8, 0x20, -0x24, 0x10, 0xFE, 0x18, 0x25, 0x4A, 0xCA, 0x20, 0x25, 0xF0, 0xE0, 0x18, 0x27, 0x2A, 0xAC, 0x20, -0x27, 0xD0, 0xC2, 0x18, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0xFF, 0xFF, -0x6C, 0x58, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, -0x43, 0x4B, 0x54, 0x00, 0x43, 0x4B, 0x48, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x69, 0xA4, 0x45, 0x00, 0x21, 0x36, 0x9A, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Saipan */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xFF, 0x86, 0x37, 0x70, -0x3A, 0x43, 0x5E, 0x60, 0x01, 0x02, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x04, 0x4D, 0x50, 0x54, 0x00, 0x43, 0x68, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x85, 0xC0, 0x01, 0xF1, 0x0E, 0x18, 0x00, -0x00, 0x00, 0x00, - -/* Pacific/Samoa */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x91, 0x05, 0xFB, 0x08, -0xDA, 0x62, 0x04, 0x38, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x02, 0x03, 0x04, -0xFF, 0xFF, 0x5F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x09, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0D, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x11, 0x4C, 0x4D, -0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x53, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Tahiti */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x94, 0x50, 0x55, 0xB8, -0x01, 0xFF, 0xFF, 0x73, 0xC8, 0x00, 0x00, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x54, 0x41, 0x48, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x33, 0xF5, 0x00, 0x30, -0x2A, 0xBA, 0x00, 0x00, 0x00, 0x0F, 0x53, 0x6F, 0x63, 0x69, 0x65, 0x74, 0x79, 0x20, 0x49, 0x73, -0x6C, 0x61, 0x6E, 0x64, 0x73, - -/* Pacific/Tarawa */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x47, 0x49, 0x4C, 0x54, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x7D, 0xA2, 0x02, 0x1A, 0xA2, -0xA0, 0x00, 0x00, 0x00, 0x0F, 0x47, 0x69, 0x6C, 0x62, 0x65, 0x72, 0x74, 0x20, 0x49, 0x73, 0x6C, -0x61, 0x6E, 0x64, 0x73, - -/* Pacific/Tongatapu */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x09, 0xC9, 0x73, 0x42, 0x90, -0x37, 0xFB, 0x47, 0xD0, 0x38, 0xD3, 0x7D, 0xD0, 0x3A, 0x04, 0x08, 0x50, 0x3A, 0x72, 0xB8, 0x40, -0x3B, 0xE3, 0xEA, 0x50, 0x3C, 0x52, 0x9A, 0x40, 0x01, 0x02, 0x03, 0x04, 0x01, 0x04, 0x01, 0x00, -0x00, 0xAD, 0x70, 0x00, 0x00, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x01, -0x04, 0x00, 0x00, 0xB6, 0xD0, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x04, 0x54, 0x4F, 0x54, -0x00, 0x54, 0x4F, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x69, 0x8A, 0x3A, 0x02, 0x1D, 0xF0, 0xFA, 0x00, 0x00, 0x00, 0x00, - -/* Pacific/Truk */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x46, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x54, 0x52, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x94, 0xA5, 0x62, 0x01, 0xFA, 0x42, -0xDD, 0x00, 0x00, 0x00, 0x14, 0x54, 0x72, 0x75, 0x6B, 0x20, 0x28, 0x43, 0x68, 0x75, 0x75, 0x6B, -0x29, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x59, 0x61, 0x70, - -/* Pacific/Wake */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x57, 0x41, 0x4B, 0x54, 0x00, 0x00, 0x00, 0x00, 0xA6, 0xC0, 0xCD, 0x02, 0x10, 0xE5, -0x22, 0x00, 0x00, 0x00, 0x0B, 0x57, 0x61, 0x6B, 0x65, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, - - -/* Pacific/Wallis */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x57, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xA8, 0xC0, -0x00, 0x00, 0x57, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00, 0x75, 0xF3, 0x50, 0x00, 0x06, 0x5B, 0x9A, -0x00, 0x00, 0x00, 0x00, - -/* Pacific/Yap */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x8C, 0xA0, -0x00, 0x00, 0x54, 0x52, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, -0x80, 0x00, 0x00, 0x00, 0x00, - -/* Poland */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xA7, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x16, 0x99, 0xA8, 0x2A, 0xD0, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xDA, 0xF0, 0x9C, 0xD9, 0xAE, 0x90, 0x9D, 0xA4, 0xB5, 0x90, -0x9E, 0xB9, 0x90, 0x90, 0x9F, 0x84, 0x97, 0x90, 0xA0, 0x9A, 0xB6, 0x00, 0xA1, 0x65, 0xBD, 0x00, -0xA6, 0x7D, 0x7C, 0x60, 0xC8, 0x76, 0xDE, 0x10, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, -0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x80, 0xA9, 0x60, 0xD0, 0x84, 0xBA, 0x00, -0xD1, 0x95, 0x92, 0x70, 0xD2, 0x8A, 0xBB, 0x60, 0xD3, 0x62, 0xFF, 0x70, 0xD4, 0x4B, 0x23, 0x90, -0xD5, 0x5E, 0xAD, 0x10, 0xD6, 0x29, 0xB4, 0x10, 0xD7, 0x2C, 0x1A, 0x10, 0xD8, 0x09, 0x96, 0x10, -0xD9, 0x02, 0xC1, 0x90, 0xD9, 0xE9, 0x78, 0x10, 0xE8, 0x54, 0xD2, 0x00, 0xE8, 0xF1, 0xB4, 0x80, -0xE9, 0xE1, 0xA5, 0x80, 0xEA, 0xD1, 0x96, 0x80, 0xEC, 0x14, 0x96, 0x00, 0xEC, 0xBA, 0xB3, 0x00, -0xED, 0xAA, 0xA4, 0x00, 0xEE, 0x9A, 0x95, 0x00, 0xEF, 0xD4, 0x5A, 0x00, 0xF0, 0x7A, 0x77, 0x00, -0xF1, 0xB4, 0x3C, 0x00, 0xF2, 0x5A, 0x59, 0x00, 0xF3, 0x94, 0x1E, 0x00, 0xF4, 0x3A, 0x3B, 0x00, -0xF5, 0x7D, 0x3A, 0x80, 0xF6, 0x1A, 0x1D, 0x00, 0x0D, 0x2A, 0xFD, 0x70, 0x0D, 0xA4, 0x55, 0x80, -0x0E, 0x8B, 0x0C, 0x00, 0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, -0x12, 0x54, 0x0A, 0x80, 0x13, 0x4D, 0x36, 0x00, 0x14, 0x33, 0xEC, 0x80, 0x15, 0x23, 0xDD, 0x80, -0x16, 0x13, 0xCE, 0x80, 0x17, 0x03, 0xBF, 0x80, 0x17, 0xF3, 0xB0, 0x80, 0x18, 0xE3, 0xA1, 0x80, -0x19, 0xD3, 0x92, 0x80, 0x1A, 0xC3, 0x83, 0x80, 0x1B, 0xBC, 0xAF, 0x00, 0x1C, 0xAC, 0xA0, 0x00, -0x1D, 0x9C, 0x91, 0x00, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, -0x21, 0x5C, 0x55, 0x00, 0x21, 0xDA, 0xD6, 0xF0, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, -0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, -0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, -0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, -0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, -0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, -0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, -0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, -0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, -0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x07, 0x05, -0x06, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x01, 0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x00, -0x00, 0x13, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, -0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x12, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x12, 0x00, -0x00, 0x1C, 0x20, 0x01, 0x04, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x09, 0x57, 0x4D, 0x54, 0x00, 0x43, -0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* Portugal */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDD, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1B, 0x92, 0xE6, 0x97, 0x10, -0x9B, 0x4B, 0x6D, 0x70, 0x9B, 0xFE, 0xC7, 0x80, 0x9C, 0x9C, 0xED, 0x70, 0x9D, 0xC9, 0x83, 0x70, -0x9E, 0x7F, 0x72, 0x70, 0x9F, 0xAA, 0xB6, 0xF0, 0xA0, 0x5F, 0x54, 0x70, 0xA1, 0x8B, 0xEA, 0x70, -0xA2, 0x41, 0xD9, 0x70, 0xA3, 0x6E, 0x6F, 0x70, 0xA4, 0x23, 0x0C, 0xF0, 0xA5, 0x4F, 0xA2, 0xF0, -0xAA, 0x05, 0xEF, 0x70, 0xAA, 0xF4, 0x8E, 0xF0, 0xAD, 0xC9, 0xA7, 0xF0, 0xAE, 0xA7, 0x23, 0xF0, -0xAF, 0xA0, 0x4F, 0x70, 0xB0, 0x87, 0x05, 0xF0, 0xB1, 0x89, 0x6B, 0xF0, 0xB2, 0x70, 0x22, 0x70, -0xB3, 0x72, 0x88, 0x70, 0xB4, 0x50, 0x04, 0x70, 0xB7, 0x32, 0x4C, 0x70, 0xB8, 0x0F, 0xC8, 0x70, -0xB8, 0xFF, 0xB9, 0x70, 0xB9, 0xEF, 0xAA, 0x70, 0xBC, 0xC8, 0xB7, 0xF0, 0xBD, 0xB8, 0xA8, 0xF0, -0xBE, 0x9F, 0x5F, 0x70, 0xBF, 0x98, 0x8A, 0xF0, 0xC0, 0x9A, 0xF0, 0xF0, 0xC1, 0x78, 0x6C, 0xF0, -0xC2, 0x68, 0x5D, 0xF0, 0xC3, 0x58, 0x4E, 0xF0, 0xC4, 0x3F, 0x05, 0x70, 0xC5, 0x38, 0x30, 0xF0, -0xC6, 0x3A, 0x96, 0xF0, 0xC7, 0x58, 0xAC, 0x70, 0xC7, 0xD9, 0xDF, 0x70, 0xC9, 0x01, 0x2F, 0x70, -0xC9, 0xF1, 0x20, 0x70, 0xCA, 0xE2, 0x62, 0xF0, 0xCB, 0xB5, 0x52, 0xF0, 0xCB, 0xEC, 0xA3, 0xE0, -0xCC, 0x80, 0x4B, 0xE0, 0xCC, 0xDC, 0xA2, 0xF0, 0xCD, 0x95, 0x34, 0xF0, 0xCD, 0xC3, 0x4B, 0x60, -0xCE, 0x72, 0xA2, 0xE0, 0xCE, 0xC5, 0xBF, 0x70, 0xCF, 0x75, 0x16, 0xF0, 0xCF, 0xAC, 0x67, 0xE0, -0xD0, 0x52, 0x84, 0xE0, 0xD0, 0xA5, 0xA1, 0x70, 0xD1, 0x54, 0xF8, 0xF0, 0xD1, 0x8C, 0x49, 0xE0, -0xD2, 0x32, 0x66, 0xE0, 0xD2, 0x85, 0x83, 0x70, 0xD3, 0x59, 0xC4, 0xF0, 0xD4, 0x49, 0xB5, 0xF0, -0xD5, 0x39, 0xD1, 0x20, 0xD6, 0x29, 0xC2, 0x20, 0xD7, 0x19, 0xB3, 0x20, 0xD8, 0x09, 0xA4, 0x20, -0xD8, 0xF9, 0x95, 0x20, 0xD9, 0xE9, 0x86, 0x20, 0xDC, 0xB9, 0x59, 0x20, 0xDD, 0xB2, 0x84, 0xA0, -0xDE, 0xA2, 0x75, 0xA0, 0xDF, 0x92, 0x66, 0xA0, 0xE0, 0x82, 0x57, 0xA0, 0xE1, 0x72, 0x48, 0xA0, -0xE2, 0x62, 0x39, 0xA0, 0xE3, 0x52, 0x2A, 0xA0, 0xE4, 0x42, 0x1B, 0xA0, 0xE5, 0x32, 0x0C, 0xA0, -0xE6, 0x21, 0xFD, 0xA0, 0xE7, 0x1B, 0x29, 0x20, 0xE8, 0x0B, 0x1A, 0x20, 0xE8, 0xFB, 0x0B, 0x20, -0xE9, 0xEA, 0xFC, 0x20, 0xEA, 0xDA, 0xED, 0x20, 0xEB, 0xCA, 0xDE, 0x20, 0xEC, 0xBA, 0xCF, 0x20, -0xED, 0xAA, 0xC0, 0x20, 0xEE, 0x9A, 0xB1, 0x20, 0xEF, 0x8A, 0xA2, 0x20, 0xF0, 0x7A, 0x93, 0x20, -0xF1, 0x6A, 0x84, 0x20, 0xF2, 0x63, 0xAF, 0xA0, 0xF3, 0x53, 0xA0, 0xA0, 0xF4, 0x43, 0x91, 0xA0, -0xF5, 0x33, 0x82, 0xA0, 0xF6, 0x23, 0x73, 0xA0, 0xF7, 0x13, 0x64, 0xA0, 0xF8, 0x03, 0x55, 0xA0, -0xF8, 0xF3, 0x46, 0xA0, 0x0C, 0xAB, 0x2A, 0x00, 0x0D, 0x9B, 0x1B, 0x00, 0x0E, 0x8B, 0x0C, 0x00, -0x0F, 0x84, 0x37, 0x80, 0x10, 0x74, 0x28, 0x80, 0x11, 0x64, 0x19, 0x80, 0x12, 0x54, 0x18, 0x90, -0x13, 0x43, 0xFB, 0x80, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, 0x16, 0x13, 0xDC, 0x90, -0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xBD, 0xA0, 0x19, 0xD3, 0xA0, 0x90, -0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, 0x1D, 0x9C, 0x9F, 0x10, -0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, 0x21, 0x5C, 0x63, 0x10, -0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, 0x25, 0x1C, 0x27, 0x10, -0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, 0x28, 0xE5, 0x25, 0x90, -0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, 0x2C, 0xA4, 0xE9, 0x90, -0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, 0x30, 0x64, 0xAD, 0x90, -0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, 0x34, 0x52, 0x96, 0x10, -0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, 0x38, 0x1B, 0x94, 0x90, -0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, 0x3B, 0xDB, 0x58, 0x90, -0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, 0x3F, 0x9B, 0x1C, 0x90, -0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, 0x43, 0x64, 0x1B, 0x10, -0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, -0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, -0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, -0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, -0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, -0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, -0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, -0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, -0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, -0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, -0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, -0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, -0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, -0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, -0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, -0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, -0x02, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, -0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x05, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x06, 0x02, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0xFF, 0xFF, 0xF7, -0x70, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, -0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x01, -0x0D, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x12, 0x00, 0x00, 0x1C, -0x20, 0x01, 0x16, 0x00, 0x00, 0x0E, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x4C, -0x4D, 0x54, 0x00, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, 0x45, 0x54, 0x00, 0x57, 0x45, 0x4D, 0x54, -0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* PRC */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xB0, 0xFE, 0x9A, 0xA0, -0xC8, 0x5C, 0x01, 0x80, 0xC8, 0xFA, 0x27, 0x70, 0xC9, 0xD5, 0x0E, 0x80, 0xCA, 0xDB, 0x5A, 0xF0, -0x1E, 0xBA, 0x36, 0x00, 0x1F, 0x69, 0x7F, 0x70, 0x20, 0x7E, 0x68, 0x80, 0x21, 0x49, 0x61, 0x70, -0x22, 0x5E, 0x4A, 0x80, 0x23, 0x29, 0x43, 0x70, 0x24, 0x47, 0x67, 0x00, 0x25, 0x12, 0x5F, 0xF0, -0x26, 0x27, 0x49, 0x00, 0x26, 0xF2, 0x41, 0xF0, 0x28, 0x07, 0x2B, 0x00, 0x28, 0xD2, 0x23, 0xF0, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x00, 0x00, 0x71, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, -0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* PST8PDT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, 0xFF, 0x8F, 0x80, 0x00, -0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x0C, 0x50, 0x44, 0x54, -0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* ROC */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xD1, 0x97, 0xD3, 0x00, -0xD2, 0x61, 0x7A, 0x70, 0xD3, 0x79, 0x06, 0x80, 0xD4, 0x42, 0xAD, 0xF0, 0xD5, 0x5A, 0x3A, 0x00, -0xD6, 0x23, 0xE1, 0x70, 0xD7, 0x3C, 0xBF, 0x00, 0xD8, 0x06, 0x66, 0x70, 0xD9, 0x1D, 0xF2, 0x80, -0xD9, 0xE7, 0x99, 0xF0, 0xDA, 0xFF, 0x26, 0x00, 0xDB, 0xC8, 0xCD, 0x70, 0xDC, 0xE0, 0x59, 0x80, -0xDD, 0xAA, 0x00, 0xF0, 0xDE, 0x72, 0x73, 0x00, 0xDF, 0xB5, 0x64, 0x70, 0xE0, 0x7C, 0x85, 0x00, -0xE1, 0x96, 0x97, 0xF0, 0xE2, 0x5D, 0xB8, 0x80, 0xE3, 0x77, 0xCB, 0x70, 0xE4, 0x3E, 0xEC, 0x00, -0xE5, 0x30, 0x20, 0x70, 0xE6, 0x21, 0x71, 0x00, 0xE7, 0x12, 0xA5, 0x70, 0xE8, 0x02, 0xA4, 0x80, -0xE8, 0xF3, 0xD8, 0xF0, 0xE9, 0xE3, 0xD8, 0x00, 0xEA, 0xD5, 0x0C, 0x70, 0xEB, 0xC5, 0x0B, 0x80, -0xEC, 0xB6, 0x3F, 0xF0, 0xED, 0xF7, 0xFC, 0x00, 0xEE, 0x98, 0xC4, 0xF0, 0xEF, 0xD9, 0x2F, 0x80, -0xF0, 0x79, 0xF8, 0x70, 0x07, 0xFC, 0x56, 0x00, 0x08, 0xED, 0x8A, 0x70, 0x09, 0xDD, 0x89, 0x80, -0x0A, 0xCE, 0xBD, 0xF0, 0x13, 0xBC, 0xD5, 0x00, 0x14, 0x36, 0x10, 0xF0, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x04, -0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, -0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* ROK */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, -0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, -0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, 0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x03, -0x02, 0x03, 0x00, 0x01, 0x04, 0x01, 0x04, 0x01, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, -0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x04, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, -0x00, 0x00, 0x8C, 0xA0, 0x01, 0x04, 0x4B, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Singapore */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x17, 0x86, 0x83, 0x85, 0xA3, -0xBA, 0x67, 0x4E, 0x90, 0xC0, 0x0A, 0xE4, 0x60, 0xCA, 0xB3, 0xE5, 0x60, 0xCB, 0x91, 0x5F, 0x08, -0xD2, 0x48, 0x6D, 0xF0, 0xF7, 0xBA, 0x4D, 0x88, 0x16, 0x91, 0xF5, 0x08, 0x01, 0x02, 0x03, 0x04, -0x05, 0x04, 0x06, 0x07, 0x00, 0x00, 0x61, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, -0x00, 0x00, 0x67, 0x20, 0x01, 0x09, 0x00, 0x00, 0x67, 0x20, 0x00, 0x04, 0x00, 0x00, 0x69, 0x78, -0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0F, 0x00, 0x00, 0x69, 0x78, 0x00, 0x13, 0x00, 0x00, -0x70, 0x80, 0x00, 0x13, 0x53, 0x4D, 0x54, 0x00, 0x4D, 0x41, 0x4C, 0x54, 0x00, 0x4D, 0x41, 0x4C, -0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x53, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Turkey */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x16, 0x90, 0x8B, 0xF5, 0x98, -0x9B, 0x0C, 0x17, 0x60, 0x9B, 0xD5, 0xBE, 0xD0, 0xA2, 0x65, 0x63, 0xE0, 0xA3, 0x7B, 0x82, 0x50, -0xA4, 0x4E, 0x80, 0x60, 0xA5, 0x3F, 0xB4, 0xD0, 0xA6, 0x25, 0x27, 0xE0, 0xA7, 0x27, 0x7F, 0xD0, -0xAA, 0x28, 0x28, 0x60, 0xAA, 0xE1, 0xFD, 0xD0, 0xAB, 0xF9, 0x89, 0xE0, 0xAC, 0xC3, 0x31, 0x50, -0xC8, 0x7F, 0xEE, 0x60, 0xC8, 0xFF, 0xC1, 0xD0, 0xC9, 0x4A, 0xF5, 0x60, 0xCA, 0xCE, 0x80, 0x50, -0xCB, 0xCB, 0xAE, 0x60, 0xCC, 0xE5, 0xC1, 0x50, 0xD1, 0x71, 0xEB, 0xE0, 0xD2, 0x6B, 0x09, 0x50, -0xD3, 0xA2, 0x39, 0x60, 0xD4, 0x43, 0x02, 0x50, 0xD5, 0x4C, 0x0D, 0xE0, 0xD6, 0x29, 0x7B, 0xD0, -0xD7, 0x2B, 0xEF, 0xE0, 0xD8, 0x09, 0x5D, 0xD0, 0xD9, 0x02, 0x97, 0x60, 0xD9, 0xE9, 0x3F, 0xD0, -0xDA, 0xEF, 0xA8, 0x60, 0xDB, 0xD2, 0x5C, 0x50, 0xDC, 0xD4, 0xD0, 0x60, 0xDD, 0xB3, 0x8F, 0xD0, -0xF1, 0xF4, 0xB9, 0x60, 0xF2, 0x64, 0xBA, 0xD0, 0xF5, 0x68, 0x06, 0x60, 0xF6, 0x1F, 0x38, 0xD0, -0x00, 0xA0, 0xBA, 0xE0, 0x01, 0x6B, 0xB3, 0xD0, 0x02, 0x80, 0x9C, 0xE0, 0x03, 0x4B, 0x95, 0xD0, -0x04, 0x69, 0xB9, 0x60, 0x05, 0x34, 0xB2, 0x50, 0x06, 0x6E, 0x93, 0x70, 0x07, 0x39, 0xA8, 0x80, -0x07, 0xFB, 0x75, 0x00, 0x09, 0x19, 0xA6, 0xA0, 0x09, 0xDB, 0x3A, 0xE0, 0x0A, 0xF0, 0x07, 0xD0, -0x0C, 0x10, 0xCE, 0x60, 0x0C, 0xD9, 0x24, 0x50, 0x0D, 0xA4, 0x39, 0x60, 0x0E, 0xA6, 0x91, 0x50, -0x0F, 0x84, 0x1B, 0x60, 0x10, 0x86, 0x73, 0x50, 0x12, 0x67, 0x98, 0xC0, 0x13, 0x4D, 0x36, 0x00, -0x14, 0x47, 0x7A, 0xC0, 0x15, 0x23, 0xDD, 0x80, 0x16, 0x27, 0x5C, 0xC0, 0x17, 0x03, 0xBF, 0x80, -0x18, 0x07, 0x3E, 0xC0, 0x19, 0x89, 0x94, 0x50, 0x19, 0xDC, 0x94, 0xC0, 0x1C, 0xC6, 0xD3, 0xD0, -0x1D, 0x9B, 0x15, 0x50, 0x1E, 0x8C, 0x82, 0x00, 0x1F, 0x7C, 0x73, 0x00, 0x20, 0x6C, 0x64, 0x00, -0x21, 0x5C, 0x55, 0x00, 0x22, 0x4C, 0x46, 0x00, 0x23, 0x3C, 0x37, 0x00, 0x24, 0x2C, 0x28, 0x00, -0x25, 0x1C, 0x19, 0x00, 0x26, 0x0C, 0x0A, 0x00, 0x27, 0x05, 0x35, 0x80, 0x27, 0xF5, 0x18, 0x70, -0x28, 0xE5, 0x09, 0x70, 0x29, 0xD4, 0xFA, 0x70, 0x2A, 0xC4, 0xEB, 0x70, 0x2B, 0xB4, 0xDC, 0x70, -0x2C, 0xA4, 0xCD, 0x70, 0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, -0x30, 0x64, 0x91, 0x70, 0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, -0x34, 0x52, 0x79, 0xF0, 0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, -0x38, 0x1B, 0x78, 0x70, 0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, -0x3B, 0xDB, 0x3C, 0x70, 0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, -0x3F, 0x9B, 0x00, 0x70, 0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, -0x43, 0x63, 0xFE, 0xF0, 0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x45, 0x98, 0x32, 0xE0, -0x46, 0x05, 0xC9, 0x90, 0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, -0x49, 0xCE, 0xC8, 0x10, 0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, -0x4D, 0x8E, 0x8C, 0x10, 0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, -0x51, 0x57, 0x8A, 0x90, 0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, -0x55, 0x17, 0x4E, 0x90, 0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, -0x58, 0xD7, 0x12, 0x90, 0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, -0x5C, 0xA0, 0x11, 0x10, 0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, -0x60, 0x5F, 0xD5, 0x10, 0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, -0x64, 0x1F, 0x99, 0x10, 0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, -0x67, 0xE8, 0x97, 0x90, 0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, -0x6B, 0xA8, 0x5B, 0x90, 0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, -0x6F, 0x68, 0x1F, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, -0x73, 0x31, 0x1E, 0x10, 0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, -0x76, 0xF0, 0xE2, 0x10, 0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, -0x7A, 0xB0, 0xA6, 0x10, 0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, -0x7E, 0x79, 0xA4, 0x90, 0x7F, 0x8E, 0x7F, 0x90, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x04, -0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, -0x05, 0x06, 0x05, 0x06, 0x02, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x00, 0x00, 0x1B, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0D, 0x00, 0x00, 0x2A, 0x30, 0x00, -0x12, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x49, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x54, 0x52, 0x53, 0x54, 0x00, 0x54, 0x52, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* UCT */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* Universal */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* US/Alaska */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x26, 0xCB, 0x89, 0x36, 0xC0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x42, 0x30, 0xFA, 0xD2, 0x47, 0xA0, 0xFE, 0xB8, 0x63, 0x40, -0xFF, 0xA8, 0x46, 0x30, 0x00, 0x98, 0x45, 0x40, 0x01, 0x88, 0x28, 0x30, 0x02, 0x78, 0x27, 0x40, -0x03, 0x71, 0x44, 0xB0, 0x04, 0x61, 0x43, 0xC0, 0x05, 0x51, 0x26, 0xB0, 0x06, 0x41, 0x25, 0xC0, -0x07, 0x31, 0x08, 0xB0, 0x07, 0x8D, 0x5F, 0xC0, 0x09, 0x10, 0xEA, 0xB0, 0x09, 0xAD, 0xDB, 0x40, -0x0A, 0xF0, 0xCC, 0xB0, 0x0B, 0xE0, 0xCB, 0xC0, 0x0C, 0xD9, 0xE9, 0x30, 0x0D, 0xC0, 0xAD, 0xC0, -0x0E, 0xB9, 0xCB, 0x30, 0x0F, 0xA9, 0xCA, 0x40, 0x10, 0x99, 0xAD, 0x30, 0x11, 0x89, 0xAC, 0x40, -0x12, 0x79, 0x8F, 0x30, 0x13, 0x69, 0x8E, 0x40, 0x14, 0x59, 0x71, 0x30, 0x15, 0x49, 0x70, 0x40, -0x16, 0x39, 0x53, 0x30, 0x17, 0x29, 0x52, 0x40, 0x18, 0x22, 0x6F, 0xB0, 0x19, 0x09, 0x34, 0x40, -0x1A, 0x02, 0x51, 0xB0, 0x1A, 0x2B, 0x14, 0x10, 0x1A, 0xF2, 0x42, 0xB0, 0x1B, 0xE2, 0x25, 0xA0, -0x1C, 0xD2, 0x24, 0xB0, 0x1D, 0xC2, 0x07, 0xA0, 0x1E, 0xB2, 0x06, 0xB0, 0x1F, 0xA1, 0xE9, 0xA0, -0x20, 0x76, 0x39, 0x30, 0x21, 0x81, 0xCB, 0xA0, 0x22, 0x56, 0x1B, 0x30, 0x23, 0x6A, 0xE8, 0x20, -0x24, 0x35, 0xFD, 0x30, 0x25, 0x4A, 0xCA, 0x20, 0x26, 0x15, 0xDF, 0x30, 0x27, 0x2A, 0xAC, 0x20, -0x27, 0xFE, 0xFB, 0xB0, 0x29, 0x0A, 0x8E, 0x20, 0x29, 0xDE, 0xDD, 0xB0, 0x2A, 0xEA, 0x70, 0x20, -0x2B, 0xBE, 0xBF, 0xB0, 0x2C, 0xD3, 0x8C, 0xA0, 0x2D, 0x9E, 0xA1, 0xB0, 0x2E, 0xB3, 0x6E, 0xA0, -0x2F, 0x7E, 0x83, 0xB0, 0x30, 0x93, 0x50, 0xA0, 0x31, 0x67, 0xA0, 0x30, 0x32, 0x73, 0x32, 0xA0, -0x33, 0x47, 0x82, 0x30, 0x34, 0x53, 0x14, 0xA0, 0x35, 0x27, 0x64, 0x30, 0x36, 0x32, 0xF6, 0xA0, -0x37, 0x07, 0x46, 0x30, 0x38, 0x1C, 0x13, 0x20, 0x38, 0xE7, 0x28, 0x30, 0x39, 0xFB, 0xF5, 0x20, -0x3A, 0xC7, 0x0A, 0x30, 0x3B, 0xDB, 0xD7, 0x20, 0x3C, 0xB0, 0x26, 0xB0, 0x3D, 0xBB, 0xB9, 0x20, -0x3E, 0x90, 0x08, 0xB0, 0x3F, 0x9B, 0x9B, 0x20, 0x40, 0x6F, 0xEA, 0xB0, 0x41, 0x84, 0xB7, 0xA0, -0x42, 0x4F, 0xCC, 0xB0, 0x43, 0x64, 0x99, 0xA0, 0x44, 0x2F, 0xAE, 0xB0, 0x45, 0x44, 0x7B, 0xA0, -0x45, 0xF3, 0xE1, 0x30, 0x47, 0x2D, 0x98, 0x20, 0x47, 0xD3, 0xC3, 0x30, 0x49, 0x0D, 0x7A, 0x20, -0x49, 0xB3, 0xA5, 0x30, 0x4A, 0xED, 0x5C, 0x20, 0x4B, 0x9C, 0xC1, 0xB0, 0x4C, 0xD6, 0x78, 0xA0, -0x4D, 0x7C, 0xA3, 0xB0, 0x4E, 0xB6, 0x5A, 0xA0, 0x4F, 0x5C, 0x85, 0xB0, 0x50, 0x96, 0x3C, 0xA0, -0x51, 0x3C, 0x67, 0xB0, 0x52, 0x76, 0x1E, 0xA0, 0x53, 0x1C, 0x49, 0xB0, 0x54, 0x56, 0x00, 0xA0, -0x54, 0xFC, 0x2B, 0xB0, 0x56, 0x35, 0xE2, 0xA0, 0x56, 0xE5, 0x48, 0x30, 0x58, 0x1E, 0xFF, 0x20, -0x58, 0xC5, 0x2A, 0x30, 0x59, 0xFE, 0xE1, 0x20, 0x5A, 0xA5, 0x0C, 0x30, 0x5B, 0xDE, 0xC3, 0x20, -0x5C, 0x84, 0xEE, 0x30, 0x5D, 0xBE, 0xA5, 0x20, 0x5E, 0x64, 0xD0, 0x30, 0x5F, 0x9E, 0x87, 0x20, -0x60, 0x4D, 0xEC, 0xB0, 0x61, 0x87, 0xA3, 0xA0, 0x62, 0x2D, 0xCE, 0xB0, 0x63, 0x67, 0x85, 0xA0, -0x64, 0x0D, 0xB0, 0xB0, 0x65, 0x47, 0x67, 0xA0, 0x65, 0xED, 0x92, 0xB0, 0x67, 0x27, 0x49, 0xA0, -0x67, 0xCD, 0x74, 0xB0, 0x69, 0x07, 0x2B, 0xA0, 0x69, 0xAD, 0x56, 0xB0, 0x6A, 0xE7, 0x0D, 0xA0, -0x6B, 0x96, 0x73, 0x30, 0x6C, 0xD0, 0x2A, 0x20, 0x6D, 0x76, 0x55, 0x30, 0x6E, 0xB0, 0x0C, 0x20, -0x6F, 0x56, 0x37, 0x30, 0x70, 0x8F, 0xEE, 0x20, 0x71, 0x36, 0x19, 0x30, 0x72, 0x6F, 0xD0, 0x20, -0x73, 0x15, 0xFB, 0x30, 0x74, 0x4F, 0xB2, 0x20, 0x74, 0xFF, 0x17, 0xB0, 0x76, 0x38, 0xCE, 0xA0, -0x76, 0xDE, 0xF9, 0xB0, 0x78, 0x18, 0xB0, 0xA0, 0x78, 0xBE, 0xDB, 0xB0, 0x79, 0xF8, 0x92, 0xA0, -0x7A, 0x9E, 0xBD, 0xB0, 0x7B, 0xD8, 0x74, 0xA0, 0x7C, 0x7E, 0x9F, 0xB0, 0x7D, 0xB8, 0x56, 0xA0, -0x7E, 0x5E, 0x81, 0xB0, 0x7F, 0x98, 0x38, 0xA0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0xFF, 0xFF, 0x81, -0x70, 0x01, 0x04, 0xFF, 0xFF, 0x81, 0x70, 0x01, 0x09, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x0E, 0xFF, -0xFF, 0x81, 0x70, 0x01, 0x13, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x18, 0xFF, 0xFF, 0x8F, 0x80, 0x01, -0x1C, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x21, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x57, 0x54, 0x00, -0x43, 0x41, 0x50, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00, 0x41, 0x48, 0x44, 0x54, 0x00, 0x59, -0x53, 0x54, 0x00, 0x41, 0x4B, 0x44, 0x54, 0x00, 0x41, 0x4B, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Aleutian */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0xCB, 0x89, 0x44, 0xD0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x50, 0x40, 0xFA, 0xD2, 0x55, 0xB0, 0xFE, 0xB8, 0x71, 0x50, -0xFF, 0xA8, 0x54, 0x40, 0x00, 0x98, 0x53, 0x50, 0x01, 0x88, 0x36, 0x40, 0x02, 0x78, 0x35, 0x50, -0x03, 0x71, 0x52, 0xC0, 0x04, 0x61, 0x51, 0xD0, 0x05, 0x51, 0x34, 0xC0, 0x06, 0x41, 0x33, 0xD0, -0x07, 0x31, 0x16, 0xC0, 0x07, 0x8D, 0x6D, 0xD0, 0x09, 0x10, 0xF8, 0xC0, 0x09, 0xAD, 0xE9, 0x50, -0x0A, 0xF0, 0xDA, 0xC0, 0x0B, 0xE0, 0xD9, 0xD0, 0x0C, 0xD9, 0xF7, 0x40, 0x0D, 0xC0, 0xBB, 0xD0, -0x0E, 0xB9, 0xD9, 0x40, 0x0F, 0xA9, 0xD8, 0x50, 0x10, 0x99, 0xBB, 0x40, 0x11, 0x89, 0xBA, 0x50, -0x12, 0x79, 0x9D, 0x40, 0x13, 0x69, 0x9C, 0x50, 0x14, 0x59, 0x7F, 0x40, 0x15, 0x49, 0x7E, 0x50, -0x16, 0x39, 0x61, 0x40, 0x17, 0x29, 0x60, 0x50, 0x18, 0x22, 0x7D, 0xC0, 0x19, 0x09, 0x42, 0x50, -0x1A, 0x02, 0x5F, 0xC0, 0x1A, 0x2B, 0x22, 0x20, 0x1A, 0xF2, 0x50, 0xC0, 0x1B, 0xE2, 0x33, 0xB0, -0x1C, 0xD2, 0x32, 0xC0, 0x1D, 0xC2, 0x15, 0xB0, 0x1E, 0xB2, 0x14, 0xC0, 0x1F, 0xA1, 0xF7, 0xB0, -0x20, 0x76, 0x47, 0x40, 0x21, 0x81, 0xD9, 0xB0, 0x22, 0x56, 0x29, 0x40, 0x23, 0x6A, 0xF6, 0x30, -0x24, 0x36, 0x0B, 0x40, 0x25, 0x4A, 0xD8, 0x30, 0x26, 0x15, 0xED, 0x40, 0x27, 0x2A, 0xBA, 0x30, -0x27, 0xFF, 0x09, 0xC0, 0x29, 0x0A, 0x9C, 0x30, 0x29, 0xDE, 0xEB, 0xC0, 0x2A, 0xEA, 0x7E, 0x30, -0x2B, 0xBE, 0xCD, 0xC0, 0x2C, 0xD3, 0x9A, 0xB0, 0x2D, 0x9E, 0xAF, 0xC0, 0x2E, 0xB3, 0x7C, 0xB0, -0x2F, 0x7E, 0x91, 0xC0, 0x30, 0x93, 0x5E, 0xB0, 0x31, 0x67, 0xAE, 0x40, 0x32, 0x73, 0x40, 0xB0, -0x33, 0x47, 0x90, 0x40, 0x34, 0x53, 0x22, 0xB0, 0x35, 0x27, 0x72, 0x40, 0x36, 0x33, 0x04, 0xB0, -0x37, 0x07, 0x54, 0x40, 0x38, 0x1C, 0x21, 0x30, 0x38, 0xE7, 0x36, 0x40, 0x39, 0xFC, 0x03, 0x30, -0x3A, 0xC7, 0x18, 0x40, 0x3B, 0xDB, 0xE5, 0x30, 0x3C, 0xB0, 0x34, 0xC0, 0x3D, 0xBB, 0xC7, 0x30, -0x3E, 0x90, 0x16, 0xC0, 0x3F, 0x9B, 0xA9, 0x30, 0x40, 0x6F, 0xF8, 0xC0, 0x41, 0x84, 0xC5, 0xB0, -0x42, 0x4F, 0xDA, 0xC0, 0x43, 0x64, 0xA7, 0xB0, 0x44, 0x2F, 0xBC, 0xC0, 0x45, 0x44, 0x89, 0xB0, -0x45, 0xF3, 0xEF, 0x40, 0x47, 0x2D, 0xA6, 0x30, 0x47, 0xD3, 0xD1, 0x40, 0x49, 0x0D, 0x88, 0x30, -0x49, 0xB3, 0xB3, 0x40, 0x4A, 0xED, 0x6A, 0x30, 0x4B, 0x9C, 0xCF, 0xC0, 0x4C, 0xD6, 0x86, 0xB0, -0x4D, 0x7C, 0xB1, 0xC0, 0x4E, 0xB6, 0x68, 0xB0, 0x4F, 0x5C, 0x93, 0xC0, 0x50, 0x96, 0x4A, 0xB0, -0x51, 0x3C, 0x75, 0xC0, 0x52, 0x76, 0x2C, 0xB0, 0x53, 0x1C, 0x57, 0xC0, 0x54, 0x56, 0x0E, 0xB0, -0x54, 0xFC, 0x39, 0xC0, 0x56, 0x35, 0xF0, 0xB0, 0x56, 0xE5, 0x56, 0x40, 0x58, 0x1F, 0x0D, 0x30, -0x58, 0xC5, 0x38, 0x40, 0x59, 0xFE, 0xEF, 0x30, 0x5A, 0xA5, 0x1A, 0x40, 0x5B, 0xDE, 0xD1, 0x30, -0x5C, 0x84, 0xFC, 0x40, 0x5D, 0xBE, 0xB3, 0x30, 0x5E, 0x64, 0xDE, 0x40, 0x5F, 0x9E, 0x95, 0x30, -0x60, 0x4D, 0xFA, 0xC0, 0x61, 0x87, 0xB1, 0xB0, 0x62, 0x2D, 0xDC, 0xC0, 0x63, 0x67, 0x93, 0xB0, -0x64, 0x0D, 0xBE, 0xC0, 0x65, 0x47, 0x75, 0xB0, 0x65, 0xED, 0xA0, 0xC0, 0x67, 0x27, 0x57, 0xB0, -0x67, 0xCD, 0x82, 0xC0, 0x69, 0x07, 0x39, 0xB0, 0x69, 0xAD, 0x64, 0xC0, 0x6A, 0xE7, 0x1B, 0xB0, -0x6B, 0x96, 0x81, 0x40, 0x6C, 0xD0, 0x38, 0x30, 0x6D, 0x76, 0x63, 0x40, 0x6E, 0xB0, 0x1A, 0x30, -0x6F, 0x56, 0x45, 0x40, 0x70, 0x8F, 0xFC, 0x30, 0x71, 0x36, 0x27, 0x40, 0x72, 0x6F, 0xDE, 0x30, -0x73, 0x16, 0x09, 0x40, 0x74, 0x4F, 0xC0, 0x30, 0x74, 0xFF, 0x25, 0xC0, 0x76, 0x38, 0xDC, 0xB0, -0x76, 0xDF, 0x07, 0xC0, 0x78, 0x18, 0xBE, 0xB0, 0x78, 0xBE, 0xE9, 0xC0, 0x79, 0xF8, 0xA0, 0xB0, -0x7A, 0x9E, 0xCB, 0xC0, 0x7B, 0xD8, 0x82, 0xB0, 0x7C, 0x7E, 0xAD, 0xC0, 0x7D, 0xB8, 0x64, 0xB0, -0x7E, 0x5E, 0x8F, 0xC0, 0x7F, 0x98, 0x46, 0xB0, 0x01, 0x02, 0x00, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, -0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, -0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x00, 0xFF, 0xFF, 0x73, -0x60, 0x01, 0x04, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x08, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0C, 0xFF, -0xFF, 0x73, 0x60, 0x01, 0x10, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x14, 0xFF, 0xFF, 0x81, 0x70, 0x01, -0x19, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x1E, 0x4E, 0x53, 0x54, 0x00, 0x4E, 0x57, 0x54, 0x00, 0x4E, -0x50, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x42, 0x44, 0x54, 0x00, 0x41, 0x48, 0x53, 0x54, 0x00, -0x48, 0x41, 0x44, 0x54, 0x00, 0x48, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Arizona */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xCF, 0x17, 0xDF, 0x1C, 0xCF, 0x8F, 0xE5, 0xAC, 0xD0, 0x81, 0x1A, 0x1C, 0xFA, 0xF8, 0x75, 0x10, -0xFB, 0xE8, 0x58, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x01, 0xFF, 0xFF, -0xAB, 0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, -0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Central */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xA2, 0xCB, 0x74, 0x00, -0xA3, 0x83, 0xF7, 0xF0, 0xA4, 0x45, 0xD2, 0x80, 0xA5, 0x63, 0xD9, 0xF0, 0xA6, 0x53, 0xD9, 0x00, -0xA7, 0x15, 0x97, 0x70, 0xA8, 0x33, 0xBB, 0x00, 0xA8, 0xFE, 0xB3, 0xF0, 0xAA, 0x13, 0x9D, 0x00, -0xAA, 0xDE, 0x95, 0xF0, 0xAB, 0xF3, 0x7F, 0x00, 0xAC, 0xBE, 0x77, 0xF0, 0xAD, 0xD3, 0x61, 0x00, -0xAE, 0x9E, 0x59, 0xF0, 0xAF, 0xB3, 0x43, 0x00, 0xB0, 0x7E, 0x3B, 0xF0, 0xB1, 0x9C, 0x5F, 0x80, -0xB2, 0x67, 0x58, 0x70, 0xB3, 0x7C, 0x41, 0x80, 0xB4, 0x47, 0x3A, 0x70, 0xB5, 0x5C, 0x23, 0x80, -0xB6, 0x27, 0x1C, 0x70, 0xB7, 0x3C, 0x05, 0x80, 0xB8, 0x06, 0xFE, 0x70, 0xB9, 0x1B, 0xE7, 0x80, -0xB9, 0xE6, 0xE0, 0x70, 0xBB, 0x05, 0x04, 0x00, 0xBB, 0xC6, 0xC2, 0x70, 0xBC, 0xE4, 0xE6, 0x00, -0xBD, 0xAF, 0xDE, 0xF0, 0xBE, 0xC4, 0xC8, 0x00, 0xBF, 0x8F, 0xC0, 0xF0, 0xC0, 0x5A, 0xD6, 0x00, -0xC1, 0xB0, 0x3C, 0x70, 0xC2, 0x84, 0x8C, 0x00, 0xC3, 0x4F, 0x84, 0xF0, 0xC4, 0x64, 0x6E, 0x00, -0xC5, 0x2F, 0x66, 0xF0, 0xC6, 0x4D, 0x8A, 0x80, 0xC7, 0x0F, 0x48, 0xF0, 0xC8, 0x2D, 0x6C, 0x80, -0xC8, 0xF8, 0x65, 0x70, 0xCA, 0x0D, 0x4E, 0x80, 0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, -0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, 0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, -0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, 0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, -0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, 0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, -0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, 0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, -0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, 0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, -0xE8, 0x27, 0x1E, 0x00, 0xE9, 0x17, 0x00, 0xF0, 0xEA, 0x07, 0x00, 0x00, 0xEA, 0xF6, 0xE2, 0xF0, -0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, 0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, -0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, 0xF1, 0x8F, 0xC2, 0x80, 0xF2, 0x7F, 0xA5, 0x70, -0xF3, 0x6F, 0xA4, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xF5, 0x4F, 0x86, 0x80, 0xF6, 0x3F, 0x69, 0x70, -0xF7, 0x2F, 0x68, 0x80, 0xF8, 0x28, 0x85, 0xF0, 0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x67, 0xF0, -0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, 0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, -0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, 0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, -0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, 0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, -0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, 0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, -0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, 0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, -0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, 0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, -0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, 0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, -0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, 0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, -0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, 0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, -0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, 0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, -0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, 0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, -0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, 0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, -0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, 0x29, 0xDE, 0xB3, 0x80, 0x2A, 0xEA, 0x45, 0xF0, -0x2B, 0xBE, 0x95, 0x80, 0x2C, 0xD3, 0x62, 0x70, 0x2D, 0x9E, 0x77, 0x80, 0x2E, 0xB3, 0x44, 0x70, -0x2F, 0x7E, 0x59, 0x80, 0x30, 0x93, 0x26, 0x70, 0x31, 0x67, 0x76, 0x00, 0x32, 0x73, 0x08, 0x70, -0x33, 0x47, 0x58, 0x00, 0x34, 0x52, 0xEA, 0x70, 0x35, 0x27, 0x3A, 0x00, 0x36, 0x32, 0xCC, 0x70, -0x37, 0x07, 0x1C, 0x00, 0x38, 0x1B, 0xE8, 0xF0, 0x38, 0xE6, 0xFE, 0x00, 0x39, 0xFB, 0xCA, 0xF0, -0x3A, 0xC6, 0xE0, 0x00, 0x3B, 0xDB, 0xAC, 0xF0, 0x3C, 0xAF, 0xFC, 0x80, 0x3D, 0xBB, 0x8E, 0xF0, -0x3E, 0x8F, 0xDE, 0x80, 0x3F, 0x9B, 0x70, 0xF0, 0x40, 0x6F, 0xC0, 0x80, 0x41, 0x84, 0x8D, 0x70, -0x42, 0x4F, 0xA2, 0x80, 0x43, 0x64, 0x6F, 0x70, 0x44, 0x2F, 0x84, 0x80, 0x45, 0x44, 0x51, 0x70, -0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, 0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, -0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, 0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, -0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, 0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, -0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, 0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, -0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, 0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, -0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, 0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, -0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, 0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, -0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, 0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, -0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, 0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, -0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, 0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, -0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, 0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, -0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, 0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, -0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, 0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, -0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, 0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, -0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, 0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, -0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x43, 0x57, 0x54, -0x00, 0x43, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Eastern */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x1E, 0x70, -0x9F, 0xBA, 0xEB, 0x60, 0xA0, 0x86, 0x00, 0x70, 0xA1, 0x9A, 0xCD, 0x60, 0xA2, 0x65, 0xE2, 0x70, -0xA3, 0x83, 0xE9, 0xE0, 0xA4, 0x6A, 0xAE, 0x70, 0xA5, 0x35, 0xA7, 0x60, 0xA6, 0x53, 0xCA, 0xF0, -0xA7, 0x15, 0x89, 0x60, 0xA8, 0x33, 0xAC, 0xF0, 0xA8, 0xFE, 0xA5, 0xE0, 0xAA, 0x13, 0x8E, 0xF0, -0xAA, 0xDE, 0x87, 0xE0, 0xAB, 0xF3, 0x70, 0xF0, 0xAC, 0xBE, 0x69, 0xE0, 0xAD, 0xD3, 0x52, 0xF0, -0xAE, 0x9E, 0x4B, 0xE0, 0xAF, 0xB3, 0x34, 0xF0, 0xB0, 0x7E, 0x2D, 0xE0, 0xB1, 0x9C, 0x51, 0x70, -0xB2, 0x67, 0x4A, 0x60, 0xB3, 0x7C, 0x33, 0x70, 0xB4, 0x47, 0x2C, 0x60, 0xB5, 0x5C, 0x15, 0x70, -0xB6, 0x27, 0x0E, 0x60, 0xB7, 0x3B, 0xF7, 0x70, 0xB8, 0x06, 0xF0, 0x60, 0xB9, 0x1B, 0xD9, 0x70, -0xB9, 0xE6, 0xD2, 0x60, 0xBB, 0x04, 0xF5, 0xF0, 0xBB, 0xC6, 0xB4, 0x60, 0xBC, 0xE4, 0xD7, 0xF0, -0xBD, 0xAF, 0xD0, 0xE0, 0xBE, 0xC4, 0xB9, 0xF0, 0xBF, 0x8F, 0xB2, 0xE0, 0xC0, 0xA4, 0x9B, 0xF0, -0xC1, 0x6F, 0x94, 0xE0, 0xC2, 0x84, 0x7D, 0xF0, 0xC3, 0x4F, 0x76, 0xE0, 0xC4, 0x64, 0x5F, 0xF0, -0xC5, 0x2F, 0x58, 0xE0, 0xC6, 0x4D, 0x7C, 0x70, 0xC7, 0x0F, 0x3A, 0xE0, 0xC8, 0x2D, 0x5E, 0x70, -0xC8, 0xF8, 0x57, 0x60, 0xCA, 0x0D, 0x40, 0x70, 0xCA, 0xD8, 0x39, 0x60, 0xCB, 0x88, 0xF0, 0x70, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, 0xD3, 0x75, 0xE4, 0xF0, 0xD4, 0x40, 0xDD, 0xE0, -0xD5, 0x55, 0xC6, 0xF0, 0xD6, 0x20, 0xBF, 0xE0, 0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, -0xD9, 0x15, 0x8A, 0xF0, 0xD9, 0xE0, 0x83, 0xE0, 0xDA, 0xFE, 0xA7, 0x70, 0xDB, 0xC0, 0x65, 0xE0, -0xDC, 0xDE, 0x89, 0x70, 0xDD, 0xA9, 0x82, 0x60, 0xDE, 0xBE, 0x6B, 0x70, 0xDF, 0x89, 0x64, 0x60, -0xE0, 0x9E, 0x4D, 0x70, 0xE1, 0x69, 0x46, 0x60, 0xE2, 0x7E, 0x2F, 0x70, 0xE3, 0x49, 0x28, 0x60, -0xE4, 0x5E, 0x11, 0x70, 0xE5, 0x57, 0x2E, 0xE0, 0xE6, 0x47, 0x2D, 0xF0, 0xE7, 0x37, 0x10, 0xE0, -0xE8, 0x27, 0x0F, 0xF0, 0xE9, 0x16, 0xF2, 0xE0, 0xEA, 0x06, 0xF1, 0xF0, 0xEA, 0xF6, 0xD4, 0xE0, -0xEB, 0xE6, 0xD3, 0xF0, 0xEC, 0xD6, 0xB6, 0xE0, 0xED, 0xC6, 0xB5, 0xF0, 0xEE, 0xBF, 0xD3, 0x60, -0xEF, 0xAF, 0xD2, 0x70, 0xF0, 0x9F, 0xB5, 0x60, 0xF1, 0x8F, 0xB4, 0x70, 0xF2, 0x7F, 0x97, 0x60, -0xF3, 0x6F, 0x96, 0x70, 0xF4, 0x5F, 0x79, 0x60, 0xF5, 0x4F, 0x78, 0x70, 0xF6, 0x3F, 0x5B, 0x60, -0xF7, 0x2F, 0x5A, 0x70, 0xF8, 0x28, 0x77, 0xE0, 0xF9, 0x0F, 0x3C, 0x70, 0xFA, 0x08, 0x59, 0xE0, -0xFA, 0xF8, 0x58, 0xF0, 0xFB, 0xE8, 0x3B, 0xE0, 0xFC, 0xD8, 0x3A, 0xF0, 0xFD, 0xC8, 0x1D, 0xE0, -0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, 0x01, 0x87, 0xE1, 0xE0, -0x02, 0x77, 0xE0, 0xF0, 0x03, 0x70, 0xFE, 0x60, 0x04, 0x60, 0xFD, 0x70, 0x05, 0x50, 0xE0, 0x60, -0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, -0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, -0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, -0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0x45, 0x44, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/East-Indiana */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCA, 0x57, 0x22, 0x80, -0xCA, 0xD8, 0x47, 0x70, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, -0xD3, 0x75, 0xF3, 0x00, 0xD4, 0x40, 0xEB, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xFE, 0xB8, 0x1C, 0xF0, 0xFF, 0xA7, 0xFF, 0xE0, 0x00, 0x97, 0xFE, 0xF0, -0x01, 0x87, 0xE1, 0xE0, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, 0x45, 0xF3, 0xA8, 0xF0, -0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, 0x49, 0xB3, 0x6C, 0xF0, -0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, -0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, -0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, 0x54, 0xFB, 0xF3, 0x70, -0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, 0x58, 0xC4, 0xF1, 0xF0, -0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, 0x5C, 0x84, 0xB5, 0xF0, -0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, 0x60, 0x4D, 0xB4, 0x70, -0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, 0x64, 0x0D, 0x78, 0x70, -0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, 0x67, 0xCD, 0x3C, 0x70, -0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, 0x6B, 0x96, 0x3A, 0xF0, -0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, 0x6F, 0x55, 0xFE, 0xF0, -0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, 0x73, 0x15, 0xC2, 0xF0, -0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, 0x76, 0xDE, 0xC1, 0x70, -0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, 0x7A, 0x9E, 0x85, 0x70, -0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, 0x7E, 0x5E, 0x49, 0x70, -0x7F, 0x98, 0x00, 0x60, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x04, -0x01, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, -0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x0C, 0xFF, 0xFF, -0xB9, 0xB0, 0x00, 0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, -0x54, 0x00, 0x43, 0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, -0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x89, -0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Hawaii */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0xBB, 0x05, 0x43, 0x48, -0xBB, 0x20, 0xE4, 0xB8, 0xCB, 0x89, 0x3D, 0xC8, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x49, 0x38, -0xD5, 0x8D, 0x73, 0x48, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0xFF, 0xFF, 0x6C, 0x58, 0x00, 0x00, -0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x04, 0xFF, 0xFF, 0x7A, 0x68, 0x01, 0x08, 0xFF, 0xFF, 0x7A, 0x68, -0x01, 0x0C, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x00, 0x48, 0x53, 0x54, 0x00, 0x48, 0x44, 0x54, 0x00, -0x48, 0x57, 0x54, 0x00, 0x48, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Indiana-Starke */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x14, 0x9E, 0xA6, 0x2C, 0x80, -0x9F, 0xBA, 0xF9, 0x70, 0xA0, 0x86, 0x0E, 0x80, 0xA1, 0x9A, 0xDB, 0x70, 0xCB, 0x88, 0xFE, 0x80, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x09, 0xF0, 0xD5, 0x55, 0xD5, 0x00, 0xD6, 0x20, 0xCD, 0xF0, -0xD7, 0x35, 0xB7, 0x00, 0xD8, 0x00, 0xAF, 0xF0, 0xD9, 0x15, 0x99, 0x00, 0xD9, 0xE0, 0x91, 0xF0, -0xDA, 0xFE, 0xB5, 0x80, 0xDB, 0xC0, 0x73, 0xF0, 0xDC, 0xDE, 0x97, 0x80, 0xDD, 0xA9, 0x90, 0x70, -0xDE, 0xBE, 0x79, 0x80, 0xDF, 0x89, 0x72, 0x70, 0xE0, 0x9E, 0x5B, 0x80, 0xE1, 0x69, 0x54, 0x70, -0xE2, 0x7E, 0x3D, 0x80, 0xE3, 0x49, 0x36, 0x70, 0xE4, 0x5E, 0x1F, 0x80, 0xE5, 0x57, 0x3C, 0xF0, -0xE6, 0x47, 0x3C, 0x00, 0xE7, 0x37, 0x1E, 0xF0, 0xE8, 0x27, 0x1E, 0x00, 0xE8, 0xF2, 0x16, 0xF0, -0xEA, 0x07, 0x00, 0x00, 0xEA, 0xD1, 0xF8, 0xF0, 0xEB, 0xE6, 0xE2, 0x00, 0xEC, 0xD6, 0xC4, 0xF0, -0xED, 0xC6, 0xC4, 0x00, 0xEE, 0xBF, 0xE1, 0x70, 0xEF, 0xAF, 0xE0, 0x80, 0xF0, 0x9F, 0xC3, 0x70, -0xF1, 0x8F, 0xC2, 0x80, 0xF4, 0x5F, 0x87, 0x70, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x49, 0xF0, -0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x2B, 0xF0, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x0D, 0xF0, -0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xEF, 0xF0, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x0C, 0x70, -0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xEE, 0x70, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xD0, 0x70, -0x07, 0x8D, 0x27, 0x80, 0x09, 0x10, 0xB2, 0x70, 0x09, 0xAD, 0xA3, 0x00, 0x0A, 0xF0, 0x94, 0x70, -0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xB0, 0xF0, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0x92, 0xF0, -0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x74, 0xF0, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x56, 0xF0, -0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x38, 0xF0, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x1A, 0xF0, -0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x37, 0x70, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x19, 0x70, -0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE1, 0xFB, 0x70, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xDD, 0x70, -0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xBF, 0x70, 0x20, 0x76, 0x0F, 0x00, 0x21, 0x81, 0xA1, 0x70, -0x22, 0x55, 0xF1, 0x00, 0x23, 0x6A, 0xBD, 0xF0, 0x24, 0x35, 0xD3, 0x00, 0x25, 0x4A, 0x9F, 0xF0, -0x26, 0x15, 0xB5, 0x00, 0x27, 0x2A, 0x81, 0xF0, 0x27, 0xFE, 0xD1, 0x80, 0x29, 0x0A, 0x63, 0xF0, -0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x51, 0x70, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x6D, 0xF0, -0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x4F, 0xF0, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x31, 0xF0, -0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x4E, 0x70, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x30, 0x70, -0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x12, 0x70, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x75, 0xF4, 0x70, -0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xD6, 0x70, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xB8, 0x70, -0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xD4, 0xF0, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xB6, 0xF0, -0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0x98, 0xF0, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x7A, 0xF0, -0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x5C, 0xF0, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x79, 0x70, -0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x5B, 0x70, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x3D, 0x70, -0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x1F, 0x70, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x01, 0x70, -0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xE3, 0x70, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xCF, 0xFF, 0xF0, -0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xE1, 0xF0, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xC3, 0xF0, -0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xA5, 0xF0, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x87, 0xF0, -0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xA4, 0x70, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x86, 0x70, -0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x68, 0x70, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x4A, 0x70, -0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x2C, 0x70, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x0E, 0x70, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x00, 0xFF, -0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x08, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, -0x0C, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x10, 0x43, 0x44, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x43, -0x57, 0x54, 0x00, 0x43, 0x50, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, -0x00, - -/* US/Michigan */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x8B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x85, 0xBD, 0x22, 0x5B, -0x99, 0x3C, 0x94, 0x00, 0xCB, 0x88, 0xF0, 0x70, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xFB, 0xE0, -0xD7, 0x35, 0xA8, 0xF0, 0xD8, 0x00, 0xA1, 0xE0, 0xFB, 0x33, 0xAC, 0x70, 0xFB, 0xE8, 0x3B, 0xE0, -0x06, 0x40, 0xDF, 0x70, 0x07, 0x30, 0xC2, 0x60, 0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, -0x0A, 0x00, 0xA3, 0x70, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, -0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, -0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, -0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, -0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, -0x1C, 0xD1, 0xEC, 0x70, 0x1D, 0xC1, 0xCF, 0x60, 0x1E, 0xB1, 0xCE, 0x70, 0x1F, 0xA1, 0xB1, 0x60, -0x20, 0x76, 0x00, 0xF0, 0x21, 0x81, 0x93, 0x60, 0x22, 0x55, 0xE2, 0xF0, 0x23, 0x6A, 0xAF, 0xE0, -0x24, 0x35, 0xC4, 0xF0, 0x25, 0x4A, 0x91, 0xE0, 0x26, 0x15, 0xA6, 0xF0, 0x27, 0x2A, 0x73, 0xE0, -0x27, 0xFE, 0xC3, 0x70, 0x29, 0x0A, 0x55, 0xE0, 0x29, 0xDE, 0xA5, 0x70, 0x2A, 0xEA, 0x37, 0xE0, -0x2B, 0xBE, 0x87, 0x70, 0x2C, 0xD3, 0x54, 0x60, 0x2D, 0x9E, 0x69, 0x70, 0x2E, 0xB3, 0x36, 0x60, -0x2F, 0x7E, 0x4B, 0x70, 0x30, 0x93, 0x18, 0x60, 0x31, 0x67, 0x67, 0xF0, 0x32, 0x72, 0xFA, 0x60, -0x33, 0x47, 0x49, 0xF0, 0x34, 0x52, 0xDC, 0x60, 0x35, 0x27, 0x2B, 0xF0, 0x36, 0x32, 0xBE, 0x60, -0x37, 0x07, 0x0D, 0xF0, 0x38, 0x1B, 0xDA, 0xE0, 0x38, 0xE6, 0xEF, 0xF0, 0x39, 0xFB, 0xBC, 0xE0, -0x3A, 0xC6, 0xD1, 0xF0, 0x3B, 0xDB, 0x9E, 0xE0, 0x3C, 0xAF, 0xEE, 0x70, 0x3D, 0xBB, 0x80, 0xE0, -0x3E, 0x8F, 0xD0, 0x70, 0x3F, 0x9B, 0x62, 0xE0, 0x40, 0x6F, 0xB2, 0x70, 0x41, 0x84, 0x7F, 0x60, -0x42, 0x4F, 0x94, 0x70, 0x43, 0x64, 0x61, 0x60, 0x44, 0x2F, 0x76, 0x70, 0x45, 0x44, 0x43, 0x60, -0x45, 0xF3, 0xA8, 0xF0, 0x47, 0x2D, 0x5F, 0xE0, 0x47, 0xD3, 0x8A, 0xF0, 0x49, 0x0D, 0x41, 0xE0, -0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, -0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, -0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, -0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x56, 0xE5, 0x0F, 0xF0, 0x58, 0x1E, 0xC6, 0xE0, -0x58, 0xC4, 0xF1, 0xF0, 0x59, 0xFE, 0xA8, 0xE0, 0x5A, 0xA4, 0xD3, 0xF0, 0x5B, 0xDE, 0x8A, 0xE0, -0x5C, 0x84, 0xB5, 0xF0, 0x5D, 0xBE, 0x6C, 0xE0, 0x5E, 0x64, 0x97, 0xF0, 0x5F, 0x9E, 0x4E, 0xE0, -0x60, 0x4D, 0xB4, 0x70, 0x61, 0x87, 0x6B, 0x60, 0x62, 0x2D, 0x96, 0x70, 0x63, 0x67, 0x4D, 0x60, -0x64, 0x0D, 0x78, 0x70, 0x65, 0x47, 0x2F, 0x60, 0x65, 0xED, 0x5A, 0x70, 0x67, 0x27, 0x11, 0x60, -0x67, 0xCD, 0x3C, 0x70, 0x69, 0x06, 0xF3, 0x60, 0x69, 0xAD, 0x1E, 0x70, 0x6A, 0xE6, 0xD5, 0x60, -0x6B, 0x96, 0x3A, 0xF0, 0x6C, 0xCF, 0xF1, 0xE0, 0x6D, 0x76, 0x1C, 0xF0, 0x6E, 0xAF, 0xD3, 0xE0, -0x6F, 0x55, 0xFE, 0xF0, 0x70, 0x8F, 0xB5, 0xE0, 0x71, 0x35, 0xE0, 0xF0, 0x72, 0x6F, 0x97, 0xE0, -0x73, 0x15, 0xC2, 0xF0, 0x74, 0x4F, 0x79, 0xE0, 0x74, 0xFE, 0xDF, 0x70, 0x76, 0x38, 0x96, 0x60, -0x76, 0xDE, 0xC1, 0x70, 0x78, 0x18, 0x78, 0x60, 0x78, 0xBE, 0xA3, 0x70, 0x79, 0xF8, 0x5A, 0x60, -0x7A, 0x9E, 0x85, 0x70, 0x7B, 0xD8, 0x3C, 0x60, 0x7C, 0x7E, 0x67, 0x70, 0x7D, 0xB8, 0x1E, 0x60, -0x7E, 0x5E, 0x49, 0x70, 0x7F, 0x98, 0x00, 0x60, 0x01, 0x02, 0x03, 0x04, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, 0x02, 0x05, -0x02, 0x05, 0x02, 0xFF, 0xFF, 0xB2, 0x25, 0x00, 0x00, 0xFF, 0xFF, 0xAB, 0xA0, 0x00, 0x04, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x0C, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, -0x10, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x53, 0x54, 0x00, 0x45, -0x53, 0x54, 0x00, 0x45, 0x57, 0x54, 0x00, 0x45, 0x50, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Mountain */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x3A, 0x90, -0x9F, 0xBB, 0x07, 0x80, 0xA0, 0x86, 0x1C, 0x90, 0xA1, 0x9A, 0xE9, 0x80, 0xA2, 0x65, 0xFE, 0x90, -0xA3, 0x84, 0x06, 0x00, 0xA4, 0x45, 0xE0, 0x90, 0xA4, 0x8F, 0xA6, 0x80, 0xCB, 0x89, 0x0C, 0x90, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x18, 0x00, 0xF7, 0x2F, 0x76, 0x90, 0xF8, 0x28, 0x94, 0x00, -0xF9, 0x0F, 0x58, 0x90, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x75, 0x10, 0xFB, 0xE8, 0x58, 0x00, -0xFC, 0xD8, 0x57, 0x10, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x39, 0x10, 0xFF, 0xA8, 0x1C, 0x00, -0x00, 0x98, 0x1B, 0x10, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xFD, 0x10, 0x03, 0x71, 0x1A, 0x80, -0x04, 0x61, 0x19, 0x90, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xFB, 0x90, 0x07, 0x30, 0xDE, 0x80, -0x07, 0x8D, 0x35, 0x90, 0x09, 0x10, 0xC0, 0x80, 0x09, 0xAD, 0xB1, 0x10, 0x0A, 0xF0, 0xA2, 0x80, -0x0B, 0xE0, 0xA1, 0x90, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x83, 0x90, 0x0E, 0xB9, 0xA1, 0x00, -0x0F, 0xA9, 0xA0, 0x10, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x82, 0x10, 0x12, 0x79, 0x65, 0x00, -0x13, 0x69, 0x64, 0x10, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x46, 0x10, 0x16, 0x39, 0x29, 0x00, -0x17, 0x29, 0x28, 0x10, 0x18, 0x22, 0x45, 0x80, 0x19, 0x09, 0x0A, 0x10, 0x1A, 0x02, 0x27, 0x80, -0x1A, 0xF2, 0x26, 0x90, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD2, 0x08, 0x90, 0x1D, 0xC1, 0xEB, 0x80, -0x1E, 0xB1, 0xEA, 0x90, 0x1F, 0xA1, 0xCD, 0x80, 0x20, 0x76, 0x1D, 0x10, 0x21, 0x81, 0xAF, 0x80, -0x22, 0x55, 0xFF, 0x10, 0x23, 0x6A, 0xCC, 0x00, 0x24, 0x35, 0xE1, 0x10, 0x25, 0x4A, 0xAE, 0x00, -0x26, 0x15, 0xC3, 0x10, 0x27, 0x2A, 0x90, 0x00, 0x27, 0xFE, 0xDF, 0x90, 0x29, 0x0A, 0x72, 0x00, -0x29, 0xDE, 0xC1, 0x90, 0x2A, 0xEA, 0x54, 0x00, 0x2B, 0xBE, 0xA3, 0x90, 0x2C, 0xD3, 0x70, 0x80, -0x2D, 0x9E, 0x85, 0x90, 0x2E, 0xB3, 0x52, 0x80, 0x2F, 0x7E, 0x67, 0x90, 0x30, 0x93, 0x34, 0x80, -0x31, 0x67, 0x84, 0x10, 0x32, 0x73, 0x16, 0x80, 0x33, 0x47, 0x66, 0x10, 0x34, 0x52, 0xF8, 0x80, -0x35, 0x27, 0x48, 0x10, 0x36, 0x32, 0xDA, 0x80, 0x37, 0x07, 0x2A, 0x10, 0x38, 0x1B, 0xF7, 0x00, -0x38, 0xE7, 0x0C, 0x10, 0x39, 0xFB, 0xD9, 0x00, 0x3A, 0xC6, 0xEE, 0x10, 0x3B, 0xDB, 0xBB, 0x00, -0x3C, 0xB0, 0x0A, 0x90, 0x3D, 0xBB, 0x9D, 0x00, 0x3E, 0x8F, 0xEC, 0x90, 0x3F, 0x9B, 0x7F, 0x00, -0x40, 0x6F, 0xCE, 0x90, 0x41, 0x84, 0x9B, 0x80, 0x42, 0x4F, 0xB0, 0x90, 0x43, 0x64, 0x7D, 0x80, -0x44, 0x2F, 0x92, 0x90, 0x45, 0x44, 0x5F, 0x80, 0x45, 0xF3, 0xC5, 0x10, 0x47, 0x2D, 0x7C, 0x00, -0x47, 0xD3, 0xA7, 0x10, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x89, 0x10, 0x4A, 0xED, 0x40, 0x00, -0x4B, 0x9C, 0xA5, 0x90, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x87, 0x90, 0x4E, 0xB6, 0x3E, 0x80, -0x4F, 0x5C, 0x69, 0x90, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x4B, 0x90, 0x52, 0x76, 0x02, 0x80, -0x53, 0x1C, 0x2D, 0x90, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x0F, 0x90, 0x56, 0x35, 0xC6, 0x80, -0x56, 0xE5, 0x2C, 0x10, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x0E, 0x10, 0x59, 0xFE, 0xC5, 0x00, -0x5A, 0xA4, 0xF0, 0x10, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xD2, 0x10, 0x5D, 0xBE, 0x89, 0x00, -0x5E, 0x64, 0xB4, 0x10, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xD0, 0x90, 0x61, 0x87, 0x87, 0x80, -0x62, 0x2D, 0xB2, 0x90, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x94, 0x90, 0x65, 0x47, 0x4B, 0x80, -0x65, 0xED, 0x76, 0x90, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x58, 0x90, 0x69, 0x07, 0x0F, 0x80, -0x69, 0xAD, 0x3A, 0x90, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x57, 0x10, 0x6C, 0xD0, 0x0E, 0x00, -0x6D, 0x76, 0x39, 0x10, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x1B, 0x10, 0x70, 0x8F, 0xD2, 0x00, -0x71, 0x35, 0xFD, 0x10, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xDF, 0x10, 0x74, 0x4F, 0x96, 0x00, -0x74, 0xFE, 0xFB, 0x90, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xDD, 0x90, 0x78, 0x18, 0x94, 0x80, -0x78, 0xBE, 0xBF, 0x90, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0xA1, 0x90, 0x7B, 0xD8, 0x58, 0x80, -0x7C, 0x7E, 0x83, 0x90, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x65, 0x90, 0x7F, 0x98, 0x1C, 0x80, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xAB, -0xA0, 0x01, 0x00, 0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x04, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 0x08, 0xFF, -0xFF, 0xAB, 0xA0, 0x01, 0x0C, 0x4D, 0x44, 0x54, 0x00, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x57, 0x54, -0x00, 0x4D, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Pacific */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, -0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, -0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Pacific-New */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xA6, 0x48, 0xA0, -0x9F, 0xBB, 0x15, 0x90, 0xA0, 0x86, 0x2A, 0xA0, 0xA1, 0x9A, 0xF7, 0x90, 0xCB, 0x89, 0x1A, 0xA0, -0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x61, 0x26, 0x10, 0xD6, 0xFE, 0x74, 0x20, 0xD8, 0x80, 0xAD, 0x90, -0xDA, 0xFE, 0xD1, 0xA0, 0xDB, 0xC0, 0x90, 0x10, 0xDC, 0xDE, 0xB3, 0xA0, 0xDD, 0xA9, 0xAC, 0x90, -0xDE, 0xBE, 0x95, 0xA0, 0xDF, 0x89, 0x8E, 0x90, 0xE0, 0x9E, 0x77, 0xA0, 0xE1, 0x69, 0x70, 0x90, -0xE2, 0x7E, 0x59, 0xA0, 0xE3, 0x49, 0x52, 0x90, 0xE4, 0x5E, 0x3B, 0xA0, 0xE5, 0x29, 0x34, 0x90, -0xE6, 0x47, 0x58, 0x20, 0xE7, 0x12, 0x51, 0x10, 0xE8, 0x27, 0x3A, 0x20, 0xE8, 0xF2, 0x33, 0x10, -0xEA, 0x07, 0x1C, 0x20, 0xEA, 0xD2, 0x15, 0x10, 0xEB, 0xE6, 0xFE, 0x20, 0xEC, 0xB1, 0xF7, 0x10, -0xED, 0xC6, 0xE0, 0x20, 0xEE, 0x91, 0xD9, 0x10, 0xEF, 0xAF, 0xFC, 0xA0, 0xF0, 0x71, 0xBB, 0x10, -0xF1, 0x8F, 0xDE, 0xA0, 0xF2, 0x7F, 0xC1, 0x90, 0xF3, 0x6F, 0xC0, 0xA0, 0xF4, 0x5F, 0xA3, 0x90, -0xF5, 0x4F, 0xA2, 0xA0, 0xF6, 0x3F, 0x85, 0x90, 0xF7, 0x2F, 0x84, 0xA0, 0xF8, 0x28, 0xA2, 0x10, -0xF9, 0x0F, 0x66, 0xA0, 0xFA, 0x08, 0x84, 0x10, 0xFA, 0xF8, 0x83, 0x20, 0xFB, 0xE8, 0x66, 0x10, -0xFC, 0xD8, 0x65, 0x20, 0xFD, 0xC8, 0x48, 0x10, 0xFE, 0xB8, 0x47, 0x20, 0xFF, 0xA8, 0x2A, 0x10, -0x00, 0x98, 0x29, 0x20, 0x01, 0x88, 0x0C, 0x10, 0x02, 0x78, 0x0B, 0x20, 0x03, 0x71, 0x28, 0x90, -0x04, 0x61, 0x27, 0xA0, 0x05, 0x51, 0x0A, 0x90, 0x06, 0x41, 0x09, 0xA0, 0x07, 0x30, 0xEC, 0x90, -0x07, 0x8D, 0x43, 0xA0, 0x09, 0x10, 0xCE, 0x90, 0x09, 0xAD, 0xBF, 0x20, 0x0A, 0xF0, 0xB0, 0x90, -0x0B, 0xE0, 0xAF, 0xA0, 0x0C, 0xD9, 0xCD, 0x10, 0x0D, 0xC0, 0x91, 0xA0, 0x0E, 0xB9, 0xAF, 0x10, -0x0F, 0xA9, 0xAE, 0x20, 0x10, 0x99, 0x91, 0x10, 0x11, 0x89, 0x90, 0x20, 0x12, 0x79, 0x73, 0x10, -0x13, 0x69, 0x72, 0x20, 0x14, 0x59, 0x55, 0x10, 0x15, 0x49, 0x54, 0x20, 0x16, 0x39, 0x37, 0x10, -0x17, 0x29, 0x36, 0x20, 0x18, 0x22, 0x53, 0x90, 0x19, 0x09, 0x18, 0x20, 0x1A, 0x02, 0x35, 0x90, -0x1A, 0xF2, 0x34, 0xA0, 0x1B, 0xE2, 0x17, 0x90, 0x1C, 0xD2, 0x16, 0xA0, 0x1D, 0xC1, 0xF9, 0x90, -0x1E, 0xB1, 0xF8, 0xA0, 0x1F, 0xA1, 0xDB, 0x90, 0x20, 0x76, 0x2B, 0x20, 0x21, 0x81, 0xBD, 0x90, -0x22, 0x56, 0x0D, 0x20, 0x23, 0x6A, 0xDA, 0x10, 0x24, 0x35, 0xEF, 0x20, 0x25, 0x4A, 0xBC, 0x10, -0x26, 0x15, 0xD1, 0x20, 0x27, 0x2A, 0x9E, 0x10, 0x27, 0xFE, 0xED, 0xA0, 0x29, 0x0A, 0x80, 0x10, -0x29, 0xDE, 0xCF, 0xA0, 0x2A, 0xEA, 0x62, 0x10, 0x2B, 0xBE, 0xB1, 0xA0, 0x2C, 0xD3, 0x7E, 0x90, -0x2D, 0x9E, 0x93, 0xA0, 0x2E, 0xB3, 0x60, 0x90, 0x2F, 0x7E, 0x75, 0xA0, 0x30, 0x93, 0x42, 0x90, -0x31, 0x67, 0x92, 0x20, 0x32, 0x73, 0x24, 0x90, 0x33, 0x47, 0x74, 0x20, 0x34, 0x53, 0x06, 0x90, -0x35, 0x27, 0x56, 0x20, 0x36, 0x32, 0xE8, 0x90, 0x37, 0x07, 0x38, 0x20, 0x38, 0x1C, 0x05, 0x10, -0x38, 0xE7, 0x1A, 0x20, 0x39, 0xFB, 0xE7, 0x10, 0x3A, 0xC6, 0xFC, 0x20, 0x3B, 0xDB, 0xC9, 0x10, -0x3C, 0xB0, 0x18, 0xA0, 0x3D, 0xBB, 0xAB, 0x10, 0x3E, 0x8F, 0xFA, 0xA0, 0x3F, 0x9B, 0x8D, 0x10, -0x40, 0x6F, 0xDC, 0xA0, 0x41, 0x84, 0xA9, 0x90, 0x42, 0x4F, 0xBE, 0xA0, 0x43, 0x64, 0x8B, 0x90, -0x44, 0x2F, 0xA0, 0xA0, 0x45, 0x44, 0x6D, 0x90, 0x45, 0xF3, 0xD3, 0x20, 0x47, 0x2D, 0x8A, 0x10, -0x47, 0xD3, 0xB5, 0x20, 0x49, 0x0D, 0x6C, 0x10, 0x49, 0xB3, 0x97, 0x20, 0x4A, 0xED, 0x4E, 0x10, -0x4B, 0x9C, 0xB3, 0xA0, 0x4C, 0xD6, 0x6A, 0x90, 0x4D, 0x7C, 0x95, 0xA0, 0x4E, 0xB6, 0x4C, 0x90, -0x4F, 0x5C, 0x77, 0xA0, 0x50, 0x96, 0x2E, 0x90, 0x51, 0x3C, 0x59, 0xA0, 0x52, 0x76, 0x10, 0x90, -0x53, 0x1C, 0x3B, 0xA0, 0x54, 0x55, 0xF2, 0x90, 0x54, 0xFC, 0x1D, 0xA0, 0x56, 0x35, 0xD4, 0x90, -0x56, 0xE5, 0x3A, 0x20, 0x58, 0x1E, 0xF1, 0x10, 0x58, 0xC5, 0x1C, 0x20, 0x59, 0xFE, 0xD3, 0x10, -0x5A, 0xA4, 0xFE, 0x20, 0x5B, 0xDE, 0xB5, 0x10, 0x5C, 0x84, 0xE0, 0x20, 0x5D, 0xBE, 0x97, 0x10, -0x5E, 0x64, 0xC2, 0x20, 0x5F, 0x9E, 0x79, 0x10, 0x60, 0x4D, 0xDE, 0xA0, 0x61, 0x87, 0x95, 0x90, -0x62, 0x2D, 0xC0, 0xA0, 0x63, 0x67, 0x77, 0x90, 0x64, 0x0D, 0xA2, 0xA0, 0x65, 0x47, 0x59, 0x90, -0x65, 0xED, 0x84, 0xA0, 0x67, 0x27, 0x3B, 0x90, 0x67, 0xCD, 0x66, 0xA0, 0x69, 0x07, 0x1D, 0x90, -0x69, 0xAD, 0x48, 0xA0, 0x6A, 0xE6, 0xFF, 0x90, 0x6B, 0x96, 0x65, 0x20, 0x6C, 0xD0, 0x1C, 0x10, -0x6D, 0x76, 0x47, 0x20, 0x6E, 0xAF, 0xFE, 0x10, 0x6F, 0x56, 0x29, 0x20, 0x70, 0x8F, 0xE0, 0x10, -0x71, 0x36, 0x0B, 0x20, 0x72, 0x6F, 0xC2, 0x10, 0x73, 0x15, 0xED, 0x20, 0x74, 0x4F, 0xA4, 0x10, -0x74, 0xFF, 0x09, 0xA0, 0x76, 0x38, 0xC0, 0x90, 0x76, 0xDE, 0xEB, 0xA0, 0x78, 0x18, 0xA2, 0x90, -0x78, 0xBE, 0xCD, 0xA0, 0x79, 0xF8, 0x84, 0x90, 0x7A, 0x9E, 0xAF, 0xA0, 0x7B, 0xD8, 0x66, 0x90, -0x7C, 0x7E, 0x91, 0xA0, 0x7D, 0xB8, 0x48, 0x90, 0x7E, 0x5E, 0x73, 0xA0, 0x7F, 0x98, 0x2A, 0x90, -0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, -0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x00, 0xFF, -0xFF, 0x8F, 0x80, 0x00, 0x04, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x08, 0xFF, 0xFF, 0x9D, 0x90, 0x01, -0x0C, 0x50, 0x44, 0x54, 0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54, -0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, -0x80, 0x00, 0x00, 0x00, 0x00, - -/* US/Samoa */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x91, 0x05, 0xFB, 0x08, -0xDA, 0x62, 0x04, 0x38, 0xFA, 0xD2, 0x55, 0xB0, 0x1A, 0x2B, 0x30, 0x30, 0x01, 0x02, 0x03, 0x04, -0xFF, 0xFF, 0x5F, 0xF8, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, -0x00, 0x09, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x0D, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x11, 0x4C, 0x4D, -0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4E, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x53, -0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, -0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* UTC */ -0x50, 0x48, 0x50, 0x31, 0x01, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, - -/* WET */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x0D, 0xA4, 0x63, 0x90, -0x0E, 0x8B, 0x1A, 0x10, 0x0F, 0x84, 0x45, 0x90, 0x10, 0x74, 0x36, 0x90, 0x11, 0x64, 0x27, 0x90, -0x12, 0x54, 0x18, 0x90, 0x13, 0x4D, 0x44, 0x10, 0x14, 0x33, 0xFA, 0x90, 0x15, 0x23, 0xEB, 0x90, -0x16, 0x13, 0xDC, 0x90, 0x17, 0x03, 0xCD, 0x90, 0x17, 0xF3, 0xBE, 0x90, 0x18, 0xE3, 0xAF, 0x90, -0x19, 0xD3, 0xA0, 0x90, 0x1A, 0xC3, 0x91, 0x90, 0x1B, 0xBC, 0xBD, 0x10, 0x1C, 0xAC, 0xAE, 0x10, -0x1D, 0x9C, 0x9F, 0x10, 0x1E, 0x8C, 0x90, 0x10, 0x1F, 0x7C, 0x81, 0x10, 0x20, 0x6C, 0x72, 0x10, -0x21, 0x5C, 0x63, 0x10, 0x22, 0x4C, 0x54, 0x10, 0x23, 0x3C, 0x45, 0x10, 0x24, 0x2C, 0x36, 0x10, -0x25, 0x1C, 0x27, 0x10, 0x26, 0x0C, 0x18, 0x10, 0x27, 0x05, 0x43, 0x90, 0x27, 0xF5, 0x34, 0x90, -0x28, 0xE5, 0x25, 0x90, 0x29, 0xD5, 0x16, 0x90, 0x2A, 0xC5, 0x07, 0x90, 0x2B, 0xB4, 0xF8, 0x90, -0x2C, 0xA4, 0xE9, 0x90, 0x2D, 0x94, 0xDA, 0x90, 0x2E, 0x84, 0xCB, 0x90, 0x2F, 0x74, 0xBC, 0x90, -0x30, 0x64, 0xAD, 0x90, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10, 0x33, 0x3D, 0xBB, 0x10, -0x34, 0x52, 0x96, 0x10, 0x35, 0x1D, 0x9D, 0x10, 0x36, 0x32, 0x78, 0x10, 0x36, 0xFD, 0x7F, 0x10, -0x38, 0x1B, 0x94, 0x90, 0x38, 0xDD, 0x61, 0x10, 0x39, 0xFB, 0x76, 0x90, 0x3A, 0xBD, 0x43, 0x10, -0x3B, 0xDB, 0x58, 0x90, 0x3C, 0xA6, 0x5F, 0x90, 0x3D, 0xBB, 0x3A, 0x90, 0x3E, 0x86, 0x41, 0x90, -0x3F, 0x9B, 0x1C, 0x90, 0x40, 0x66, 0x23, 0x90, 0x41, 0x84, 0x39, 0x10, 0x42, 0x46, 0x05, 0x90, -0x43, 0x64, 0x1B, 0x10, 0x44, 0x25, 0xE7, 0x90, 0x45, 0x43, 0xFD, 0x10, 0x46, 0x05, 0xC9, 0x90, -0x47, 0x23, 0xDF, 0x10, 0x47, 0xEE, 0xE6, 0x10, 0x49, 0x03, 0xC1, 0x10, 0x49, 0xCE, 0xC8, 0x10, -0x4A, 0xE3, 0xA3, 0x10, 0x4B, 0xAE, 0xAA, 0x10, 0x4C, 0xCC, 0xBF, 0x90, 0x4D, 0x8E, 0x8C, 0x10, -0x4E, 0xAC, 0xA1, 0x90, 0x4F, 0x6E, 0x6E, 0x10, 0x50, 0x8C, 0x83, 0x90, 0x51, 0x57, 0x8A, 0x90, -0x52, 0x6C, 0x65, 0x90, 0x53, 0x37, 0x6C, 0x90, 0x54, 0x4C, 0x47, 0x90, 0x55, 0x17, 0x4E, 0x90, -0x56, 0x2C, 0x29, 0x90, 0x56, 0xF7, 0x30, 0x90, 0x58, 0x15, 0x46, 0x10, 0x58, 0xD7, 0x12, 0x90, -0x59, 0xF5, 0x28, 0x10, 0x5A, 0xB6, 0xF4, 0x90, 0x5B, 0xD5, 0x0A, 0x10, 0x5C, 0xA0, 0x11, 0x10, -0x5D, 0xB4, 0xEC, 0x10, 0x5E, 0x7F, 0xF3, 0x10, 0x5F, 0x94, 0xCE, 0x10, 0x60, 0x5F, 0xD5, 0x10, -0x61, 0x7D, 0xEA, 0x90, 0x62, 0x3F, 0xB7, 0x10, 0x63, 0x5D, 0xCC, 0x90, 0x64, 0x1F, 0x99, 0x10, -0x65, 0x3D, 0xAE, 0x90, 0x66, 0x08, 0xB5, 0x90, 0x67, 0x1D, 0x90, 0x90, 0x67, 0xE8, 0x97, 0x90, -0x68, 0xFD, 0x72, 0x90, 0x69, 0xC8, 0x79, 0x90, 0x6A, 0xDD, 0x54, 0x90, 0x6B, 0xA8, 0x5B, 0x90, -0x6C, 0xC6, 0x71, 0x10, 0x6D, 0x88, 0x3D, 0x90, 0x6E, 0xA6, 0x53, 0x10, 0x6F, 0x68, 0x1F, 0x90, -0x70, 0x86, 0x35, 0x10, 0x71, 0x51, 0x3C, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1E, 0x10, -0x74, 0x45, 0xF9, 0x10, 0x75, 0x11, 0x00, 0x10, 0x76, 0x2F, 0x15, 0x90, 0x76, 0xF0, 0xE2, 0x10, -0x78, 0x0E, 0xF7, 0x90, 0x78, 0xD0, 0xC4, 0x10, 0x79, 0xEE, 0xD9, 0x90, 0x7A, 0xB0, 0xA6, 0x10, -0x7B, 0xCE, 0xBB, 0x90, 0x7C, 0x99, 0xC2, 0x90, 0x7D, 0xAE, 0x9D, 0x90, 0x7E, 0x79, 0xA4, 0x90, -0x7F, 0x8E, 0x7F, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, -0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, -0x0E, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x57, 0x45, 0x53, 0x54, 0x00, 0x57, -0x45, 0x54, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, -0x00, 0x00, 0x00, - -/* W-SU */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1E, 0x9B, 0x5F, 0x1E, 0xD8, -0x9D, 0x3E, 0xF2, 0x98, 0x9E, 0x2A, 0xEF, 0x18, 0x9E, 0xF7, 0x39, 0x88, 0x9F, 0x84, 0x58, 0x18, -0xA0, 0xD8, 0x6D, 0x08, 0xA1, 0x00, 0x16, 0x28, 0xA1, 0x3C, 0xA6, 0x40, 0xA4, 0x10, 0x6D, 0xC0, -0xA4, 0x3D, 0x32, 0xB0, 0xA5, 0x15, 0x68, 0xB0, 0xA5, 0x3D, 0x03, 0xC0, 0xA7, 0x1E, 0x45, 0x50, -0xB5, 0xA4, 0x19, 0x60, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, -0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, 0x19, 0xDB, 0x43, 0x40, 0x1A, 0xCC, 0x93, 0xD0, -0x1B, 0xBC, 0xA0, 0xF0, 0x1C, 0xAC, 0x91, 0xF0, 0x1D, 0x9C, 0x82, 0xF0, 0x1E, 0x8C, 0x73, 0xF0, -0x1F, 0x7C, 0x64, 0xF0, 0x20, 0x6C, 0x55, 0xF0, 0x21, 0x5C, 0x46, 0xF0, 0x22, 0x4C, 0x37, 0xF0, -0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, 0x26, 0x0B, 0xFB, 0xF0, -0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x28, 0xE5, 0x17, 0x80, 0x29, 0x78, 0xBF, 0x80, -0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70, -0x2D, 0x94, 0xBE, 0x70, 0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70, -0x31, 0x5D, 0xBC, 0xF0, 0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, 0x34, 0x52, 0x79, 0xF0, -0x35, 0x1D, 0x80, 0xF0, 0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, 0x38, 0x1B, 0x78, 0x70, -0x38, 0xDD, 0x44, 0xF0, 0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, 0x3B, 0xDB, 0x3C, 0x70, -0x3C, 0xA6, 0x43, 0x70, 0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, 0x3F, 0x9B, 0x00, 0x70, -0x40, 0x66, 0x07, 0x70, 0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, 0x43, 0x63, 0xFE, 0xF0, -0x44, 0x25, 0xCB, 0x70, 0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70, 0x47, 0x23, 0xC2, 0xF0, -0x47, 0xEE, 0xC9, 0xF0, 0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0, 0x4A, 0xE3, 0x86, 0xF0, -0x4B, 0xAE, 0x8D, 0xF0, 0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0, 0x4E, 0xAC, 0x85, 0x70, -0x4F, 0x6E, 0x51, 0xF0, 0x50, 0x8C, 0x67, 0x70, 0x51, 0x57, 0x6E, 0x70, 0x52, 0x6C, 0x49, 0x70, -0x53, 0x37, 0x50, 0x70, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x17, 0x32, 0x70, 0x56, 0x2C, 0x0D, 0x70, -0x56, 0xF7, 0x14, 0x70, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD6, 0xF6, 0x70, 0x59, 0xF5, 0x0B, 0xF0, -0x5A, 0xB6, 0xD8, 0x70, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9F, 0xF4, 0xF0, 0x5D, 0xB4, 0xCF, 0xF0, -0x5E, 0x7F, 0xD6, 0xF0, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5F, 0xB8, 0xF0, 0x61, 0x7D, 0xCE, 0x70, -0x62, 0x3F, 0x9A, 0xF0, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1F, 0x7C, 0xF0, 0x65, 0x3D, 0x92, 0x70, -0x66, 0x08, 0x99, 0x70, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE8, 0x7B, 0x70, 0x68, 0xFD, 0x56, 0x70, -0x69, 0xC8, 0x5D, 0x70, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA8, 0x3F, 0x70, 0x6C, 0xC6, 0x54, 0xF0, -0x6D, 0x88, 0x21, 0x70, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x68, 0x03, 0x70, 0x70, 0x86, 0x18, 0xF0, -0x71, 0x51, 0x1F, 0xF0, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x31, 0x01, 0xF0, 0x74, 0x45, 0xDC, 0xF0, -0x75, 0x10, 0xE3, 0xF0, 0x76, 0x2E, 0xF9, 0x70, 0x76, 0xF0, 0xC5, 0xF0, 0x78, 0x0E, 0xDB, 0x70, -0x78, 0xD0, 0xA7, 0xF0, 0x79, 0xEE, 0xBD, 0x70, 0x7A, 0xB0, 0x89, 0xF0, 0x7B, 0xCE, 0x9F, 0x70, -0x7C, 0x99, 0xA6, 0x70, 0x7D, 0xAE, 0x81, 0x70, 0x7E, 0x79, 0x88, 0x70, 0x7F, 0x8E, 0x63, 0x70, -0x02, 0x01, 0x02, 0x03, 0x01, 0x03, 0x05, 0x04, 0x05, 0x06, 0x05, 0x04, 0x07, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, -0x09, 0x08, 0x0A, 0x0B, 0x08, 0x05, 0x04, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, -0x08, 0x00, 0x00, 0x23, 0x28, 0x00, 0x00, 0x00, 0x00, 0x31, 0x68, 0x01, 0x04, 0x00, 0x00, 0x23, -0x58, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x78, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, -0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x46, 0x50, 0x01, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, -0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x00, 0x00, 0x38, 0x40, 0x01, 0x11, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x15, 0x4D, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54, -0x00, 0x4D, 0x44, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, -0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, -0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, - -/* Zulu */ -0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, -0x00, 0x00, 0x00, 0x00, }; - -const timelib_tzdb timezonedb_builtin = { "2008.9", 559, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/lib/timezonemap.h b/ext/date/lib/timezonemap.h deleted file mode 100644 index 905694630ca61..0000000000000 --- a/ext/date/lib/timezonemap.h +++ /dev/null @@ -1,1698 +0,0 @@ - { "acst", 1, -14400, "America/Porto_Acre" }, - { "acst", 1, -14400, "America/Eirunepe" }, - { "acst", 1, -14400, "America/Rio_Branco" }, - { "acst", 1, -14400, "Brazil/Acre" }, - { "act", 0, -18000, "America/Porto_Acre" }, - { "act", 0, -18000, "America/Eirunepe" }, - { "act", 0, -18000, "America/Rio_Branco" }, - { "act", 0, -18000, "Brazil/Acre" }, - { "addt", 1, -7200, "America/Goose_Bay" }, - { "addt", 1, -7200, "America/Pangnirtung" }, - { "adt", 1, -10800, "America/Halifax" }, - { "adt", 1, -10800, "America/Barbados" }, - { "adt", 1, -10800, "America/Blanc-Sablon" }, - { "adt", 1, -10800, "America/Glace_Bay" }, - { "adt", 1, -10800, "America/Goose_Bay" }, - { "adt", 1, -10800, "America/Martinique" }, - { "adt", 1, -10800, "America/Moncton" }, - { "adt", 1, -10800, "America/Pangnirtung" }, - { "adt", 1, -10800, "America/Thule" }, - { "adt", 1, -10800, "Atlantic/Bermuda" }, - { "adt", 1, -10800, "Canada/Atlantic" }, - { "adt", 1, 14400, "Asia/Baghdad" }, - { "aft", 0, 16200, "Asia/Kabul" }, - { "ahdt", 1, -32400, "America/Anchorage" }, - { "ahdt", 1, -32400, "US/Alaska" }, - { "ahst", 0, -36000, "America/Anchorage" }, - { "ahst", 0, -36000, "America/Adak" }, - { "ahst", 0, -36000, "America/Atka" }, - { "ahst", 0, -36000, "US/Alaska" }, - { "ahst", 0, -36000, "US/Aleutian" }, - { "akdt", 1, -28800, "America/Anchorage" }, - { "akdt", 1, -28800, "America/Juneau" }, - { "akdt", 1, -28800, "America/Nome" }, - { "akdt", 1, -28800, "America/Yakutat" }, - { "akdt", 1, -28800, "US/Alaska" }, - { "akst", 0, -32400, "America/Anchorage" }, - { "akst", 0, -32400, "America/Juneau" }, - { "akst", 0, -32400, "America/Nome" }, - { "akst", 0, -32400, "America/Yakutat" }, - { "akst", 0, -32400, "US/Alaska" }, - { "aktst", 1, 21600, "Asia/Aqtobe" }, - { "aktt", 0, 14400, "Asia/Aqtobe" }, - { "aktt", 0, 18000, "Asia/Aqtobe" }, - { "aktt", 0, 21600, "Asia/Aqtobe" }, - { "almst", 1, 25200, "Asia/Almaty" }, - { "almt", 0, 18000, "Asia/Almaty" }, - { "almt", 0, 21600, "Asia/Almaty" }, - { "amst", 1, 14400, "Asia/Yerevan" }, - { "amst", 1, 18000, "Asia/Yerevan" }, - { "amst", 1, -10800, "America/Boa_Vista" }, - { "amst", 1, -10800, "America/Campo_Grande" }, - { "amst", 1, -10800, "America/Cuiaba" }, - { "amst", 1, -10800, "America/Manaus" }, - { "amst", 1, -10800, "America/Porto_Velho" }, - { "amst", 1, -10800, "Brazil/West" }, - { "amt", 0, 10800, "Asia/Yerevan" }, - { "amt", 0, 14400, "Asia/Yerevan" }, - { "amt", 0, -14400, "America/Boa_Vista" }, - { "amt", 0, -14400, "America/Campo_Grande" }, - { "amt", 0, -14400, "America/Cuiaba" }, - { "amt", 0, -14400, "America/Manaus" }, - { "amt", 0, -14400, "America/Porto_Velho" }, - { "amt", 0, -14400, "Brazil/West" }, - { "amt", 0, 1172, "Europe/Amsterdam" }, - { "anast", 1, 43200, "Asia/Anadyr" }, - { "anast", 1, 46800, "Asia/Anadyr" }, - { "anast", 1, 50400, "Asia/Anadyr" }, - { "anat", 0, 39600, "Asia/Anadyr" }, - { "anat", 0, 43200, "Asia/Anadyr" }, - { "anat", 0, 46800, "Asia/Anadyr" }, - { "ant", 0, -16200, "America/Curacao" }, - { "ant", 0, -16200, "America/Aruba" }, - { "apt", 1, -10800, "America/Halifax" }, - { "apt", 1, -10800, "America/Blanc-Sablon" }, - { "apt", 1, -10800, "America/Glace_Bay" }, - { "apt", 1, -10800, "America/Moncton" }, - { "apt", 1, -10800, "America/Pangnirtung" }, - { "apt", 1, -10800, "America/Puerto_Rico" }, - { "apt", 1, -10800, "Canada/Atlantic" }, - { "aqtst", 1, 18000, "Asia/Aqtau" }, - { "aqtst", 1, 21600, "Asia/Aqtau" }, - { "aqtst", 1, 21600, "Asia/Aqtobe" }, - { "aqtt", 0, 14400, "Asia/Aqtau" }, - { "aqtt", 0, 18000, "Asia/Aqtau" }, - { "aqtt", 0, 18000, "Asia/Aqtobe" }, - { "arst", 1, -10800, "America/Buenos_Aires" }, - { "arst", 1, -7200, "America/Buenos_Aires" }, - { "arst", 1, -10800, "America/Argentina/Buenos_Aires" }, - { "arst", 1, -10800, "America/Argentina/Catamarca" }, - { "arst", 1, -10800, "America/Argentina/ComodRivadavia" }, - { "arst", 1, -10800, "America/Argentina/Cordoba" }, - { "arst", 1, -10800, "America/Argentina/Jujuy" }, - { "arst", 1, -10800, "America/Argentina/La_Rioja" }, - { "arst", 1, -10800, "America/Argentina/Mendoza" }, - { "arst", 1, -10800, "America/Argentina/Rio_Gallegos" }, - { "arst", 1, -10800, "America/Argentina/San_Juan" }, - { "arst", 1, -10800, "America/Argentina/Tucuman" }, - { "arst", 1, -10800, "America/Argentina/Ushuaia" }, - { "arst", 1, -10800, "America/Catamarca" }, - { "arst", 1, -10800, "America/Cordoba" }, - { "arst", 1, -10800, "America/Jujuy" }, - { "arst", 1, -10800, "America/Mendoza" }, - { "arst", 1, -10800, "America/Rosario" }, - { "arst", 1, -10800, "Antarctica/Palmer" }, - { "arst", 1, -7200, "America/Argentina/Buenos_Aires" }, - { "arst", 1, -7200, "America/Argentina/Catamarca" }, - { "arst", 1, -7200, "America/Argentina/ComodRivadavia" }, - { "arst", 1, -7200, "America/Argentina/Cordoba" }, - { "arst", 1, -7200, "America/Argentina/Jujuy" }, - { "arst", 1, -7200, "America/Argentina/La_Rioja" }, - { "arst", 1, -7200, "America/Argentina/Mendoza" }, - { "arst", 1, -7200, "America/Argentina/Rio_Gallegos" }, - { "arst", 1, -7200, "America/Argentina/San_Juan" }, - { "arst", 1, -7200, "America/Argentina/Tucuman" }, - { "arst", 1, -7200, "America/Argentina/Ushuaia" }, - { "arst", 1, -7200, "America/Catamarca" }, - { "arst", 1, -7200, "America/Cordoba" }, - { "arst", 1, -7200, "America/Jujuy" }, - { "arst", 1, -7200, "America/Mendoza" }, - { "arst", 1, -7200, "America/Rosario" }, - { "arst", 1, -7200, "Antarctica/Palmer" }, - { "art", 0, -10800, "America/Buenos_Aires" }, - { "art", 0, -14400, "America/Buenos_Aires" }, - { "art", 0, -10800, "America/Argentina/Buenos_Aires" }, - { "art", 0, -10800, "America/Argentina/Catamarca" }, - { "art", 0, -10800, "America/Argentina/ComodRivadavia" }, - { "art", 0, -10800, "America/Argentina/Cordoba" }, - { "art", 0, -10800, "America/Argentina/Jujuy" }, - { "art", 0, -10800, "America/Argentina/La_Rioja" }, - { "art", 0, -10800, "America/Argentina/Mendoza" }, - { "art", 0, -10800, "America/Argentina/Rio_Gallegos" }, - { "art", 0, -10800, "America/Argentina/San_Juan" }, - { "art", 0, -10800, "America/Argentina/Tucuman" }, - { "art", 0, -10800, "America/Argentina/Ushuaia" }, - { "art", 0, -10800, "America/Catamarca" }, - { "art", 0, -10800, "America/Cordoba" }, - { "art", 0, -10800, "America/Jujuy" }, - { "art", 0, -10800, "America/Mendoza" }, - { "art", 0, -10800, "America/Rosario" }, - { "art", 0, -10800, "Antarctica/Palmer" }, - { "art", 0, -14400, "America/Argentina/Buenos_Aires" }, - { "art", 0, -14400, "America/Argentina/Catamarca" }, - { "art", 0, -14400, "America/Argentina/ComodRivadavia" }, - { "art", 0, -14400, "America/Argentina/Cordoba" }, - { "art", 0, -14400, "America/Argentina/Jujuy" }, - { "art", 0, -14400, "America/Argentina/La_Rioja" }, - { "art", 0, -14400, "America/Argentina/Mendoza" }, - { "art", 0, -14400, "America/Argentina/Rio_Gallegos" }, - { "art", 0, -14400, "America/Argentina/San_Juan" }, - { "art", 0, -14400, "America/Argentina/Tucuman" }, - { "art", 0, -14400, "America/Argentina/Ushuaia" }, - { "art", 0, -14400, "America/Catamarca" }, - { "art", 0, -14400, "America/Cordoba" }, - { "art", 0, -14400, "America/Jujuy" }, - { "art", 0, -14400, "America/Mendoza" }, - { "art", 0, -14400, "America/Rosario" }, - { "art", 0, -14400, "Antarctica/Palmer" }, - { "ashst", 1, 18000, "Asia/Ashkhabad" }, - { "ashst", 1, 21600, "Asia/Ashkhabad" }, - { "ashst", 1, 18000, "Asia/Ashgabat" }, - { "ashst", 1, 21600, "Asia/Ashgabat" }, - { "asht", 0, 14400, "Asia/Ashkhabad" }, - { "asht", 0, 18000, "Asia/Ashkhabad" }, - { "asht", 0, 14400, "Asia/Ashgabat" }, - { "asht", 0, 18000, "Asia/Ashgabat" }, - { "ast", 0, 10800, "Asia/Riyadh" }, - { "ast", 0, -14400, "America/Anguilla" }, - { "ast", 0, -14400, "America/Antigua" }, - { "ast", 0, -14400, "America/Aruba" }, - { "ast", 0, -14400, "America/Barbados" }, - { "ast", 0, -14400, "America/Blanc-Sablon" }, - { "ast", 0, -14400, "America/Curacao" }, - { "ast", 0, -14400, "America/Dominica" }, - { "ast", 0, -14400, "America/Glace_Bay" }, - { "ast", 0, -14400, "America/Goose_Bay" }, - { "ast", 0, -14400, "America/Grenada" }, - { "ast", 0, -14400, "America/Guadeloupe" }, - { "ast", 0, -14400, "America/Halifax" }, - { "ast", 0, -14400, "America/Martinique" }, - { "ast", 0, -14400, "America/Miquelon" }, - { "ast", 0, -14400, "America/Moncton" }, - { "ast", 0, -14400, "America/Montserrat" }, - { "ast", 0, -14400, "America/Pangnirtung" }, - { "ast", 0, -14400, "America/Port_of_Spain" }, - { "ast", 0, -14400, "America/Puerto_Rico" }, - { "ast", 0, -14400, "America/Santo_Domingo" }, - { "ast", 0, -14400, "America/St_Kitts" }, - { "ast", 0, -14400, "America/St_Lucia" }, - { "ast", 0, -14400, "America/St_Thomas" }, - { "ast", 0, -14400, "America/St_Vincent" }, - { "ast", 0, -14400, "America/Thule" }, - { "ast", 0, -14400, "America/Tortola" }, - { "ast", 0, -14400, "America/Virgin" }, - { "ast", 0, -14400, "Atlantic/Bermuda" }, - { "ast", 0, -14400, "Canada/Atlantic" }, - { "ast", 0, 10800, "Asia/Aden" }, - { "ast", 0, 10800, "Asia/Baghdad" }, - { "ast", 0, 10800, "Asia/Bahrain" }, - { "ast", 0, 10800, "Asia/Kuwait" }, - { "ast", 0, 10800, "Asia/Qatar" }, - { "awt", 1, -10800, "America/Halifax" }, - { "awt", 1, -10800, "America/Blanc-Sablon" }, - { "awt", 1, -10800, "America/Glace_Bay" }, - { "awt", 1, -10800, "America/Moncton" }, - { "awt", 1, -10800, "America/Pangnirtung" }, - { "awt", 1, -10800, "America/Puerto_Rico" }, - { "awt", 1, -10800, "Canada/Atlantic" }, - { "azomt", 1, 0, "Atlantic/Azores" }, - { "azost", 1, -3600, "Atlantic/Azores" }, - { "azost", 1, 0, "Atlantic/Azores" }, - { "azot", 0, -3600, "Atlantic/Azores" }, - { "azot", 0, -7200, "Atlantic/Azores" }, - { "azst", 1, 14400, "Asia/Baku" }, - { "azst", 1, 18000, "Asia/Baku" }, - { "azt", 0, 10800, "Asia/Baku" }, - { "azt", 0, 14400, "Asia/Baku" }, - { "bakst", 1, 14400, "Asia/Baku" }, - { "bakst", 1, 18000, "Asia/Baku" }, - { "bakt", 0, 10800, "Asia/Baku" }, - { "bakt", 0, 14400, "Asia/Baku" }, - { "bdst", 1, 7200, "Europe/London" }, - { "bdst", 1, 7200, "Europe/Belfast" }, - { "bdst", 1, 7200, "Europe/Gibraltar" }, - { "bdst", 1, 7200, "Europe/Guernsey" }, - { "bdst", 1, 7200, "Europe/Isle_of_Man" }, - { "bdst", 1, 7200, "Europe/Jersey" }, - { "bdst", 1, 7200, "GB" }, - { "bdst", 1, 7200, "GB-Eire" }, - { "bdt", 1, -36000, "America/Adak" }, - { "bdt", 1, -36000, "America/Atka" }, - { "bdt", 1, -36000, "America/Nome" }, - { "bdt", 1, -36000, "US/Aleutian" }, - { "bdt", 0, 21600, "Asia/Dacca" }, - { "bdt", 0, 21600, "Asia/Dhaka" }, - { "beat", 0, 9000, "Africa/Mogadishu" }, - { "beat", 0, 9000, "Africa/Kampala" }, - { "beat", 0, 9000, "Africa/Nairobi" }, - { "beaut", 0, 9885, "Africa/Nairobi" }, - { "beaut", 0, 9885, "Africa/Dar_es_Salaam" }, - { "beaut", 0, 9885, "Africa/Kampala" }, - { "bmt", 0, -14308, "America/Barbados" }, - { "bmt", 0, -3996, "Africa/Banjul" }, - { "bmt", 0, 6264, "Europe/Tiraspol" }, - { "bmt", 0, 6264, "Europe/Chisinau" }, - { "bnt", 0, 27000, "Asia/Brunei" }, - { "bnt", 0, 28800, "Asia/Brunei" }, - { "bortst", 1, 30000, "Asia/Kuching" }, - { "bort", 0, 27000, "Asia/Kuching" }, - { "bort", 0, 28800, "Asia/Kuching" }, - { "bost", 1, -12756, "America/La_Paz" }, - { "bot", 0, -14400, "America/La_Paz" }, - { "brst", 1, -7200, "America/Sao_Paulo" }, - { "brst", 1, -7200, "America/Araguaina" }, - { "brst", 1, -7200, "America/Bahia" }, - { "brst", 1, -7200, "America/Belem" }, - { "brst", 1, -7200, "America/Fortaleza" }, - { "brst", 1, -7200, "America/Maceio" }, - { "brst", 1, -7200, "America/Recife" }, - { "brst", 1, -7200, "Brazil/East" }, - { "brt", 0, -10800, "America/Sao_Paulo" }, - { "brt", 0, -10800, "America/Araguaina" }, - { "brt", 0, -10800, "America/Bahia" }, - { "brt", 0, -10800, "America/Belem" }, - { "brt", 0, -10800, "America/Fortaleza" }, - { "brt", 0, -10800, "America/Maceio" }, - { "brt", 0, -10800, "America/Recife" }, - { "brt", 0, -10800, "Brazil/East" }, - { "bst", 0, 3600, "Europe/London" }, - { "bst", 1, 3600, "Europe/London" }, - { "bst", 0, -39600, "America/Adak" }, - { "bst", 0, -39600, "America/Atka" }, - { "bst", 0, -39600, "America/Nome" }, - { "bst", 0, -39600, "Pacific/Midway" }, - { "bst", 0, -39600, "Pacific/Pago_Pago" }, - { "bst", 0, -39600, "Pacific/Samoa" }, - { "bst", 0, -39600, "US/Aleutian" }, - { "bst", 0, -39600, "US/Samoa" }, - { "bst", 0, 3600, "Europe/Belfast" }, - { "bst", 0, 3600, "Europe/Guernsey" }, - { "bst", 0, 3600, "Europe/Isle_of_Man" }, - { "bst", 0, 3600, "Europe/Jersey" }, - { "bst", 0, 3600, "GB" }, - { "bst", 0, 3600, "GB-Eire" }, - { "bst", 1, 3600, "Eire" }, - { "bst", 1, 3600, "Europe/Belfast" }, - { "bst", 1, 3600, "Europe/Dublin" }, - { "bst", 1, 3600, "Europe/Gibraltar" }, - { "bst", 1, 3600, "Europe/Guernsey" }, - { "bst", 1, 3600, "Europe/Isle_of_Man" }, - { "bst", 1, 3600, "Europe/Jersey" }, - { "bst", 1, 3600, "GB" }, - { "bst", 1, 3600, "GB-Eire" }, - { "btt", 0, 21600, "Asia/Thimbu" }, - { "btt", 0, 21600, "Asia/Thimphu" }, - { "burt", 0, 23400, "Asia/Calcutta" }, - { "burt", 0, 23400, "Asia/Dacca" }, - { "burt", 0, 23400, "Asia/Dhaka" }, - { "burt", 0, 23400, "Asia/Rangoon" }, - { "cant", 0, -3600, "Atlantic/Canary" }, - { "capt", 1, -32400, "America/Anchorage" }, - { "capt", 1, -32400, "US/Alaska" }, - { "cast", 0, 34200, "Australia/Adelaide" }, - { "cast", 1, 10800, "Africa/Gaborone" }, - { "cast", 1, 10800, "Africa/Khartoum" }, - { "cat", 0, -36000, "America/Anchorage" }, - { "cat", 0, -36000, "US/Alaska" }, - { "cat", 0, 7200, "Africa/Khartoum" }, - { "cat", 0, 7200, "Africa/Blantyre" }, - { "cat", 0, 7200, "Africa/Gaborone" }, - { "cat", 0, 7200, "Africa/Harare" }, - { "cat", 0, 7200, "Africa/Kigali" }, - { "cat", 0, 7200, "Africa/Lusaka" }, - { "cat", 0, 7200, "Africa/Maputo" }, - { "cat", 0, 7200, "Africa/Windhoek" }, - { "cawt", 1, -32400, "America/Anchorage" }, - { "cawt", 1, -32400, "US/Alaska" }, - { "cddt", 1, -14400, "America/Rankin_Inlet" }, - { "cdt", 1, -18000, "America/Chicago" }, - { "cdt", 1, -14400, "America/Havana" }, - { "cdt", 1, -14400, "Cuba" }, - { "cdt", 1, -18000, "America/Atikokan" }, - { "cdt", 1, -18000, "America/Belize" }, - { "cdt", 1, -18000, "America/Cambridge_Bay" }, - { "cdt", 1, -18000, "America/Cancun" }, - { "cdt", 1, -18000, "America/Chihuahua" }, - { "cdt", 1, -18000, "America/Coral_Harbour" }, - { "cdt", 1, -18000, "America/Costa_Rica" }, - { "cdt", 1, -18000, "America/El_Salvador" }, - { "cdt", 1, -18000, "America/Fort_Wayne" }, - { "cdt", 1, -18000, "America/Guatemala" }, - { "cdt", 1, -18000, "America/Indiana/Indianapolis" }, - { "cdt", 1, -18000, "America/Indiana/Knox" }, - { "cdt", 1, -18000, "America/Indiana/Marengo" }, - { "cdt", 1, -18000, "America/Indiana/Petersburg" }, - { "cdt", 1, -18000, "America/Indiana/Vevay" }, - { "cdt", 1, -18000, "America/Indiana/Vincennes" }, - { "cdt", 1, -18000, "America/Indiana/Winamac" }, - { "cdt", 1, -18000, "America/Indianapolis" }, - { "cdt", 1, -18000, "America/Iqaluit" }, - { "cdt", 1, -18000, "America/Kentucky/Louisville" }, - { "cdt", 1, -18000, "America/Kentucky/Monticello" }, - { "cdt", 1, -18000, "America/Knox_IN" }, - { "cdt", 1, -18000, "America/Louisville" }, - { "cdt", 1, -18000, "America/Managua" }, - { "cdt", 1, -18000, "America/Menominee" }, - { "cdt", 1, -18000, "America/Merida" }, - { "cdt", 1, -18000, "America/Mexico_City" }, - { "cdt", 1, -18000, "America/Monterrey" }, - { "cdt", 1, -18000, "America/North_Dakota/Center" }, - { "cdt", 1, -18000, "America/North_Dakota/New_Salem" }, - { "cdt", 1, -18000, "America/Pangnirtung" }, - { "cdt", 1, -18000, "America/Rainy_River" }, - { "cdt", 1, -18000, "America/Rankin_Inlet" }, - { "cdt", 1, -18000, "America/Tegucigalpa" }, - { "cdt", 1, -18000, "America/Winnipeg" }, - { "cdt", 1, -18000, "Canada/Central" }, - { "cdt", 1, -18000, "CST6CDT" }, - { "cdt", 1, -18000, "Mexico/General" }, - { "cdt", 1, -18000, "US/Central" }, - { "cdt", 1, -18000, "US/East-Indiana" }, - { "cdt", 1, -18000, "US/Indiana-Starke" }, - { "cdt", 1, 32400, "Asia/Shanghai" }, - { "cdt", 1, 32400, "Asia/Chongqing" }, - { "cdt", 1, 32400, "Asia/Chungking" }, - { "cdt", 1, 32400, "Asia/Harbin" }, - { "cdt", 1, 32400, "Asia/Kashgar" }, - { "cdt", 1, 32400, "Asia/Taipei" }, - { "cdt", 1, 32400, "Asia/Urumqi" }, - { "cdt", 1, 32400, "PRC" }, - { "cdt", 1, 32400, "ROC" }, - { "cemt", 1, 10800, "Europe/Berlin" }, - { "cemt", 1, 10800, "CET" }, - { "cest", 1, 7200, "Europe/Berlin" }, - { "cest", 1, 10800, "Europe/Kaliningrad" }, - { "cest", 1, 7200, "Africa/Algiers" }, - { "cest", 1, 7200, "Africa/Ceuta" }, - { "cest", 1, 7200, "Africa/Tripoli" }, - { "cest", 1, 7200, "Africa/Tunis" }, - { "cest", 1, 7200, "Arctic/Longyearbyen" }, - { "cest", 1, 7200, "Atlantic/Jan_Mayen" }, - { "cest", 1, 7200, "CET" }, - { "cest", 1, 7200, "Europe/Amsterdam" }, - { "cest", 1, 7200, "Europe/Andorra" }, - { "cest", 1, 7200, "Europe/Athens" }, - { "cest", 1, 7200, "Europe/Belgrade" }, - { "cest", 1, 7200, "Europe/Bratislava" }, - { "cest", 1, 7200, "Europe/Brussels" }, - { "cest", 1, 7200, "Europe/Budapest" }, - { "cest", 1, 7200, "Europe/Chisinau" }, - { "cest", 1, 7200, "Europe/Copenhagen" }, - { "cest", 1, 7200, "Europe/Gibraltar" }, - { "cest", 1, 7200, "Europe/Kaliningrad" }, - { "cest", 1, 7200, "Europe/Kiev" }, - { "cest", 1, 7200, "Europe/Lisbon" }, - { "cest", 1, 7200, "Europe/Ljubljana" }, - { "cest", 1, 7200, "Europe/Luxembourg" }, - { "cest", 1, 7200, "Europe/Madrid" }, - { "cest", 1, 7200, "Europe/Malta" }, - { "cest", 1, 7200, "Europe/Minsk" }, - { "cest", 1, 7200, "Europe/Monaco" }, - { "cest", 1, 7200, "Europe/Oslo" }, - { "cest", 1, 7200, "Europe/Paris" }, - { "cest", 1, 7200, "Europe/Podgorica" }, - { "cest", 1, 7200, "Europe/Prague" }, - { "cest", 1, 7200, "Europe/Riga" }, - { "cest", 1, 7200, "Europe/Rome" }, - { "cest", 1, 7200, "Europe/San_Marino" }, - { "cest", 1, 7200, "Europe/Sarajevo" }, - { "cest", 1, 7200, "Europe/Simferopol" }, - { "cest", 1, 7200, "Europe/Skopje" }, - { "cest", 1, 7200, "Europe/Sofia" }, - { "cest", 1, 7200, "Europe/Stockholm" }, - { "cest", 1, 7200, "Europe/Tallinn" }, - { "cest", 1, 7200, "Europe/Tirane" }, - { "cest", 1, 7200, "Europe/Tiraspol" }, - { "cest", 1, 7200, "Europe/Uzhgorod" }, - { "cest", 1, 7200, "Europe/Vaduz" }, - { "cest", 1, 7200, "Europe/Vatican" }, - { "cest", 1, 7200, "Europe/Vienna" }, - { "cest", 1, 7200, "Europe/Vilnius" }, - { "cest", 1, 7200, "Europe/Warsaw" }, - { "cest", 1, 7200, "Europe/Zagreb" }, - { "cest", 1, 7200, "Europe/Zaporozhye" }, - { "cest", 1, 7200, "Europe/Zurich" }, - { "cest", 1, 7200, "Libya" }, - { "cest", 1, 7200, "Poland" }, - { "cest", 1, 7200, "Portugal" }, - { "cest", 1, 7200, "WET" }, - { "cet", 0, 3600, "Europe/Berlin" }, - { "cet", 0, 3600, "Africa/Algiers" }, - { "cet", 0, 3600, "Africa/Casablanca" }, - { "cet", 0, 3600, "Africa/Ceuta" }, - { "cet", 0, 3600, "Africa/Tripoli" }, - { "cet", 0, 3600, "Africa/Tunis" }, - { "cet", 0, 3600, "Arctic/Longyearbyen" }, - { "cet", 0, 3600, "Atlantic/Jan_Mayen" }, - { "cet", 0, 3600, "CET" }, - { "cet", 0, 3600, "Europe/Amsterdam" }, - { "cet", 0, 3600, "Europe/Andorra" }, - { "cet", 0, 3600, "Europe/Athens" }, - { "cet", 0, 3600, "Europe/Belgrade" }, - { "cet", 0, 3600, "Europe/Bratislava" }, - { "cet", 0, 3600, "Europe/Brussels" }, - { "cet", 0, 3600, "Europe/Budapest" }, - { "cet", 0, 3600, "Europe/Chisinau" }, - { "cet", 0, 3600, "Europe/Copenhagen" }, - { "cet", 0, 3600, "Europe/Gibraltar" }, - { "cet", 0, 3600, "Europe/Kaliningrad" }, - { "cet", 0, 3600, "Europe/Kiev" }, - { "cet", 0, 3600, "Europe/Lisbon" }, - { "cet", 0, 3600, "Europe/Ljubljana" }, - { "cet", 0, 3600, "Europe/Luxembourg" }, - { "cet", 0, 3600, "Europe/Madrid" }, - { "cet", 0, 3600, "Europe/Malta" }, - { "cet", 0, 3600, "Europe/Minsk" }, - { "cet", 0, 3600, "Europe/Monaco" }, - { "cet", 0, 3600, "Europe/Oslo" }, - { "cet", 0, 3600, "Europe/Paris" }, - { "cet", 0, 3600, "Europe/Podgorica" }, - { "cet", 0, 3600, "Europe/Prague" }, - { "cet", 0, 3600, "Europe/Riga" }, - { "cet", 0, 3600, "Europe/Rome" }, - { "cet", 0, 3600, "Europe/San_Marino" }, - { "cet", 0, 3600, "Europe/Sarajevo" }, - { "cet", 0, 3600, "Europe/Simferopol" }, - { "cet", 0, 3600, "Europe/Skopje" }, - { "cet", 0, 3600, "Europe/Sofia" }, - { "cet", 0, 3600, "Europe/Stockholm" }, - { "cet", 0, 3600, "Europe/Tallinn" }, - { "cet", 0, 3600, "Europe/Tirane" }, - { "cet", 0, 3600, "Europe/Tiraspol" }, - { "cet", 0, 3600, "Europe/Uzhgorod" }, - { "cet", 0, 3600, "Europe/Vaduz" }, - { "cet", 0, 3600, "Europe/Vatican" }, - { "cet", 0, 3600, "Europe/Vienna" }, - { "cet", 0, 3600, "Europe/Vilnius" }, - { "cet", 0, 3600, "Europe/Warsaw" }, - { "cet", 0, 3600, "Europe/Zagreb" }, - { "cet", 0, 3600, "Europe/Zaporozhye" }, - { "cet", 0, 3600, "Europe/Zurich" }, - { "cet", 0, 3600, "Libya" }, - { "cet", 0, 3600, "Poland" }, - { "cet", 0, 3600, "Portugal" }, - { "cet", 0, 3600, "WET" }, - { "cet", 0, 7200, "Europe/Kaliningrad" }, - { "cgst", 1, -3600, "America/Scoresbysund" }, - { "cgt", 0, -7200, "America/Scoresbysund" }, - { "chadt", 1, 49500, "Pacific/Chatham" }, - { "chadt", 1, 49500, "NZ-CHAT" }, - { "chast", 0, 45900, "Pacific/Chatham" }, - { "chast", 0, 45900, "NZ-CHAT" }, - { "chat", 0, 30600, "Asia/Harbin" }, - { "chat", 0, 32400, "Asia/Harbin" }, - { "chdt", 1, -19800, "America/Belize" }, - { "chost", 1, 36000, "Asia/Choibalsan" }, - { "chot", 0, 32400, "Asia/Choibalsan" }, - { "cit", 0, 28800, "Asia/Dili" }, - { "cit", 0, 28800, "Asia/Makassar" }, - { "cit", 0, 28800, "Asia/Pontianak" }, - { "cit", 0, 28800, "Asia/Ujung_Pandang" }, - { "cjt", 0, 32400, "Asia/Sakhalin" }, - { "ckhst", 1, -34200, "Pacific/Rarotonga" }, - { "ckt", 0, -36000, "Pacific/Rarotonga" }, - { "clst", 1, -10800, "America/Santiago" }, - { "clst", 1, -14400, "America/Santiago" }, - { "clst", 1, -10800, "Antarctica/Palmer" }, - { "clst", 1, -10800, "Chile/Continental" }, - { "clst", 1, -14400, "Chile/Continental" }, - { "clt", 0, -14400, "America/Santiago" }, - { "clt", 0, -18000, "America/Santiago" }, - { "clt", 0, -14400, "Antarctica/Palmer" }, - { "clt", 0, -14400, "Chile/Continental" }, - { "clt", 0, -18000, "Chile/Continental" }, - { "cost", 1, -14400, "America/Bogota" }, - { "cot", 0, -18000, "America/Bogota" }, - { "cpt", 1, -18000, "America/Chicago" }, - { "cpt", 1, -18000, "America/Atikokan" }, - { "cpt", 1, -18000, "America/Coral_Harbour" }, - { "cpt", 1, -18000, "America/Fort_Wayne" }, - { "cpt", 1, -18000, "America/Indiana/Indianapolis" }, - { "cpt", 1, -18000, "America/Indiana/Knox" }, - { "cpt", 1, -18000, "America/Indiana/Marengo" }, - { "cpt", 1, -18000, "America/Indiana/Petersburg" }, - { "cpt", 1, -18000, "America/Indiana/Vevay" }, - { "cpt", 1, -18000, "America/Indiana/Vincennes" }, - { "cpt", 1, -18000, "America/Indiana/Winamac" }, - { "cpt", 1, -18000, "America/Indianapolis" }, - { "cpt", 1, -18000, "America/Kentucky/Louisville" }, - { "cpt", 1, -18000, "America/Kentucky/Monticello" }, - { "cpt", 1, -18000, "America/Knox_IN" }, - { "cpt", 1, -18000, "America/Louisville" }, - { "cpt", 1, -18000, "America/Menominee" }, - { "cpt", 1, -18000, "America/Rainy_River" }, - { "cpt", 1, -18000, "America/Rankin_Inlet" }, - { "cpt", 1, -18000, "America/Winnipeg" }, - { "cpt", 1, -18000, "Canada/Central" }, - { "cpt", 1, -18000, "CST6CDT" }, - { "cpt", 1, -18000, "US/Central" }, - { "cpt", 1, -18000, "US/East-Indiana" }, - { "cpt", 1, -18000, "US/Indiana-Starke" }, - { "cst", 0, -21600, "America/Chicago" }, - { "cst", 0, -18000, "America/Havana" }, - { "cst", 0, -18000, "Cuba" }, - { "cst", 0, -21600, "America/Atikokan" }, - { "cst", 0, -21600, "America/Belize" }, - { "cst", 0, -21600, "America/Cambridge_Bay" }, - { "cst", 0, -21600, "America/Cancun" }, - { "cst", 0, -21600, "America/Chihuahua" }, - { "cst", 0, -21600, "America/Coral_Harbour" }, - { "cst", 0, -21600, "America/Costa_Rica" }, - { "cst", 0, -21600, "America/Detroit" }, - { "cst", 0, -21600, "America/El_Salvador" }, - { "cst", 0, -21600, "America/Fort_Wayne" }, - { "cst", 0, -21600, "America/Guatemala" }, - { "cst", 0, -21600, "America/Hermosillo" }, - { "cst", 0, -21600, "America/Indiana/Indianapolis" }, - { "cst", 0, -21600, "America/Indiana/Knox" }, - { "cst", 0, -21600, "America/Indiana/Marengo" }, - { "cst", 0, -21600, "America/Indiana/Petersburg" }, - { "cst", 0, -21600, "America/Indiana/Vevay" }, - { "cst", 0, -21600, "America/Indiana/Vincennes" }, - { "cst", 0, -21600, "America/Indiana/Winamac" }, - { "cst", 0, -21600, "America/Indianapolis" }, - { "cst", 0, -21600, "America/Iqaluit" }, - { "cst", 0, -21600, "America/Kentucky/Louisville" }, - { "cst", 0, -21600, "America/Kentucky/Monticello" }, - { "cst", 0, -21600, "America/Knox_IN" }, - { "cst", 0, -21600, "America/Louisville" }, - { "cst", 0, -21600, "America/Managua" }, - { "cst", 0, -21600, "America/Mazatlan" }, - { "cst", 0, -21600, "America/Menominee" }, - { "cst", 0, -21600, "America/Merida" }, - { "cst", 0, -21600, "America/Mexico_City" }, - { "cst", 0, -21600, "America/Monterrey" }, - { "cst", 0, -21600, "America/North_Dakota/Center" }, - { "cst", 0, -21600, "America/North_Dakota/New_Salem" }, - { "cst", 0, -21600, "America/Pangnirtung" }, - { "cst", 0, -21600, "America/Rainy_River" }, - { "cst", 0, -21600, "America/Rankin_Inlet" }, - { "cst", 0, -21600, "America/Regina" }, - { "cst", 0, -21600, "America/Swift_Current" }, - { "cst", 0, -21600, "America/Tegucigalpa" }, - { "cst", 0, -21600, "America/Winnipeg" }, - { "cst", 0, -21600, "Canada/Central" }, - { "cst", 0, -21600, "Canada/East-Saskatchewan" }, - { "cst", 0, -21600, "Canada/Saskatchewan" }, - { "cst", 0, -21600, "CST6CDT" }, - { "cst", 0, -21600, "Mexico/BajaSur" }, - { "cst", 0, -21600, "Mexico/General" }, - { "cst", 0, -21600, "US/Central" }, - { "cst", 0, -21600, "US/East-Indiana" }, - { "cst", 0, -21600, "US/Indiana-Starke" }, - { "cst", 0, -21600, "US/Michigan" }, - { "cst", 0, 28800, "Asia/Chongqing" }, - { "cst", 0, 28800, "Asia/Chungking" }, - { "cst", 0, 28800, "Asia/Harbin" }, - { "cst", 0, 28800, "Asia/Kashgar" }, - { "cst", 0, 28800, "Asia/Macao" }, - { "cst", 0, 28800, "Asia/Macau" }, - { "cst", 0, 28800, "Asia/Shanghai" }, - { "cst", 0, 28800, "Asia/Taipei" }, - { "cst", 0, 28800, "Asia/Urumqi" }, - { "cst", 0, 28800, "PRC" }, - { "cst", 0, 28800, "ROC" }, - { "cst", 0, 34200, "Asia/Jayapura" }, - { "cst", 0, 34200, "Australia/Adelaide" }, - { "cst", 0, 34200, "Australia/Broken_Hill" }, - { "cst", 0, 34200, "Australia/Darwin" }, - { "cst", 0, 34200, "Australia/North" }, - { "cst", 0, 34200, "Australia/South" }, - { "cst", 0, 34200, "Australia/Yancowinna" }, - { "cst", 1, 37800, "Australia/Adelaide" }, - { "cst", 1, 37800, "Australia/Broken_Hill" }, - { "cst", 1, 37800, "Australia/Darwin" }, - { "cst", 1, 37800, "Australia/North" }, - { "cst", 1, 37800, "Australia/South" }, - { "cst", 1, 37800, "Australia/Yancowinna" }, - { "cvst", 1, -3600, "Atlantic/Cape_Verde" }, - { "cvt", 0, -3600, "Atlantic/Cape_Verde" }, - { "cvt", 0, -7200, "Atlantic/Cape_Verde" }, - { "cwst", 0, 31500, "Australia/Eucla" }, - { "cwst", 1, 35100, "Australia/Eucla" }, - { "cwt", 1, -18000, "America/Chicago" }, - { "cwt", 1, -18000, "America/Atikokan" }, - { "cwt", 1, -18000, "America/Coral_Harbour" }, - { "cwt", 1, -18000, "America/Fort_Wayne" }, - { "cwt", 1, -18000, "America/Indiana/Indianapolis" }, - { "cwt", 1, -18000, "America/Indiana/Knox" }, - { "cwt", 1, -18000, "America/Indiana/Marengo" }, - { "cwt", 1, -18000, "America/Indiana/Petersburg" }, - { "cwt", 1, -18000, "America/Indiana/Vevay" }, - { "cwt", 1, -18000, "America/Indiana/Vincennes" }, - { "cwt", 1, -18000, "America/Indiana/Winamac" }, - { "cwt", 1, -18000, "America/Indianapolis" }, - { "cwt", 1, -18000, "America/Kentucky/Louisville" }, - { "cwt", 1, -18000, "America/Kentucky/Monticello" }, - { "cwt", 1, -18000, "America/Knox_IN" }, - { "cwt", 1, -18000, "America/Louisville" }, - { "cwt", 1, -18000, "America/Menominee" }, - { "cwt", 1, -18000, "America/Mexico_City" }, - { "cwt", 1, -18000, "America/Rainy_River" }, - { "cwt", 1, -18000, "America/Rankin_Inlet" }, - { "cwt", 1, -18000, "America/Winnipeg" }, - { "cwt", 1, -18000, "Canada/Central" }, - { "cwt", 1, -18000, "CST6CDT" }, - { "cwt", 1, -18000, "Mexico/General" }, - { "cwt", 1, -18000, "US/Central" }, - { "cwt", 1, -18000, "US/East-Indiana" }, - { "cwt", 1, -18000, "US/Indiana-Starke" }, - { "chst", 0, 36000, "Pacific/Guam" }, - { "chst", 0, 36000, "Pacific/Saipan" }, - { "dact", 0, 21600, "Asia/Dacca" }, - { "dact", 0, 21600, "Asia/Dhaka" }, - { "davt", 0, 25200, "Antarctica/Davis" }, - { "ddut", 0, 36000, "Antarctica/DumontDUrville" }, - { "dusst", 1, 21600, "Asia/Dushanbe" }, - { "dusst", 1, 25200, "Asia/Dushanbe" }, - { "dust", 0, 18000, "Asia/Dushanbe" }, - { "dust", 0, 21600, "Asia/Dushanbe" }, - { "easst", 1, -18000, "Chile/EasterIsland" }, - { "easst", 1, -21600, "Chile/EasterIsland" }, - { "easst", 1, -18000, "Pacific/Easter" }, - { "easst", 1, -21600, "Pacific/Easter" }, - { "east", 0, -21600, "Chile/EasterIsland" }, - { "east", 0, -25200, "Chile/EasterIsland" }, - { "east", 0, -21600, "Pacific/Easter" }, - { "east", 0, -25200, "Pacific/Easter" }, - { "east", 1, 14400, "Indian/Antananarivo" }, - { "eat", 0, 10800, "Africa/Khartoum" }, - { "eat", 0, 10800, "Africa/Addis_Ababa" }, - { "eat", 0, 10800, "Africa/Asmara" }, - { "eat", 0, 10800, "Africa/Asmera" }, - { "eat", 0, 10800, "Africa/Dar_es_Salaam" }, - { "eat", 0, 10800, "Africa/Djibouti" }, - { "eat", 0, 10800, "Africa/Kampala" }, - { "eat", 0, 10800, "Africa/Mogadishu" }, - { "eat", 0, 10800, "Africa/Nairobi" }, - { "eat", 0, 10800, "Indian/Antananarivo" }, - { "eat", 0, 10800, "Indian/Comoro" }, - { "eat", 0, 10800, "Indian/Mayotte" }, - { "ect", 0, -18000, "America/Guayaquil" }, - { "ect", 0, -18000, "Pacific/Galapagos" }, - { "eddt", 1, -10800, "America/Iqaluit" }, - { "edt", 1, -14400, "America/New_York" }, - { "edt", 1, -14400, "America/Cancun" }, - { "edt", 1, -14400, "America/Detroit" }, - { "edt", 1, -14400, "America/Fort_Wayne" }, - { "edt", 1, -14400, "America/Grand_Turk" }, - { "edt", 1, -14400, "America/Indiana/Indianapolis" }, - { "edt", 1, -14400, "America/Indiana/Marengo" }, - { "edt", 1, -14400, "America/Indiana/Vevay" }, - { "edt", 1, -14400, "America/Indiana/Vincennes" }, - { "edt", 1, -14400, "America/Indiana/Winamac" }, - { "edt", 1, -14400, "America/Indianapolis" }, - { "edt", 1, -14400, "America/Iqaluit" }, - { "edt", 1, -14400, "America/Jamaica" }, - { "edt", 1, -14400, "America/Kentucky/Louisville" }, - { "edt", 1, -14400, "America/Kentucky/Monticello" }, - { "edt", 1, -14400, "America/Louisville" }, - { "edt", 1, -14400, "America/Montreal" }, - { "edt", 1, -14400, "America/Nassau" }, - { "edt", 1, -14400, "America/Nipigon" }, - { "edt", 1, -14400, "America/Pangnirtung" }, - { "edt", 1, -14400, "America/Port-au-Prince" }, - { "edt", 1, -14400, "America/Santo_Domingo" }, - { "edt", 1, -14400, "America/Thunder_Bay" }, - { "edt", 1, -14400, "America/Toronto" }, - { "edt", 1, -14400, "Canada/Eastern" }, - { "edt", 1, -14400, "EST" }, - { "edt", 1, -14400, "EST5EDT" }, - { "edt", 1, -14400, "Jamaica" }, - { "edt", 1, -14400, "US/East-Indiana" }, - { "edt", 1, -14400, "US/Eastern" }, - { "edt", 1, -14400, "US/Michigan" }, - { "eest", 1, 10800, "Europe/Helsinki" }, - { "eest", 1, 10800, "Africa/Cairo" }, - { "eest", 1, 10800, "Asia/Amman" }, - { "eest", 1, 10800, "Asia/Beirut" }, - { "eest", 1, 10800, "Asia/Damascus" }, - { "eest", 1, 10800, "Asia/Gaza" }, - { "eest", 1, 10800, "Asia/Istanbul" }, - { "eest", 1, 10800, "Asia/Nicosia" }, - { "eest", 1, 10800, "EET" }, - { "eest", 1, 10800, "Egypt" }, - { "eest", 1, 10800, "Europe/Athens" }, - { "eest", 1, 10800, "Europe/Bucharest" }, - { "eest", 1, 10800, "Europe/Chisinau" }, - { "eest", 1, 10800, "Europe/Istanbul" }, - { "eest", 1, 10800, "Europe/Kaliningrad" }, - { "eest", 1, 10800, "Europe/Kiev" }, - { "eest", 1, 10800, "Europe/Mariehamn" }, - { "eest", 1, 10800, "Europe/Minsk" }, - { "eest", 1, 10800, "Europe/Moscow" }, - { "eest", 1, 10800, "Europe/Nicosia" }, - { "eest", 1, 10800, "Europe/Riga" }, - { "eest", 1, 10800, "Europe/Simferopol" }, - { "eest", 1, 10800, "Europe/Sofia" }, - { "eest", 1, 10800, "Europe/Tallinn" }, - { "eest", 1, 10800, "Europe/Tiraspol" }, - { "eest", 1, 10800, "Europe/Uzhgorod" }, - { "eest", 1, 10800, "Europe/Vilnius" }, - { "eest", 1, 10800, "Europe/Warsaw" }, - { "eest", 1, 10800, "Europe/Zaporozhye" }, - { "eest", 1, 10800, "Poland" }, - { "eest", 1, 10800, "Turkey" }, - { "eest", 1, 10800, "W-SU" }, - { "eet", 0, 7200, "Europe/Helsinki" }, - { "eet", 1, 10800, "Asia/Gaza" }, - { "eet", 0, 7200, "Africa/Cairo" }, - { "eet", 0, 7200, "Africa/Tripoli" }, - { "eet", 0, 7200, "Asia/Amman" }, - { "eet", 0, 7200, "Asia/Beirut" }, - { "eet", 0, 7200, "Asia/Damascus" }, - { "eet", 0, 7200, "Asia/Gaza" }, - { "eet", 0, 7200, "Asia/Istanbul" }, - { "eet", 0, 7200, "Asia/Nicosia" }, - { "eet", 0, 7200, "EET" }, - { "eet", 0, 7200, "Egypt" }, - { "eet", 0, 7200, "Europe/Athens" }, - { "eet", 0, 7200, "Europe/Bucharest" }, - { "eet", 0, 7200, "Europe/Chisinau" }, - { "eet", 0, 7200, "Europe/Istanbul" }, - { "eet", 0, 7200, "Europe/Kaliningrad" }, - { "eet", 0, 7200, "Europe/Kiev" }, - { "eet", 0, 7200, "Europe/Mariehamn" }, - { "eet", 0, 7200, "Europe/Minsk" }, - { "eet", 0, 7200, "Europe/Moscow" }, - { "eet", 0, 7200, "Europe/Nicosia" }, - { "eet", 0, 7200, "Europe/Riga" }, - { "eet", 0, 7200, "Europe/Simferopol" }, - { "eet", 0, 7200, "Europe/Sofia" }, - { "eet", 0, 7200, "Europe/Tallinn" }, - { "eet", 0, 7200, "Europe/Tiraspol" }, - { "eet", 0, 7200, "Europe/Uzhgorod" }, - { "eet", 0, 7200, "Europe/Vilnius" }, - { "eet", 0, 7200, "Europe/Warsaw" }, - { "eet", 0, 7200, "Europe/Zaporozhye" }, - { "eet", 0, 7200, "Libya" }, - { "eet", 0, 7200, "Poland" }, - { "eet", 0, 7200, "Turkey" }, - { "eet", 0, 7200, "W-SU" }, - { "egst", 1, 0, "America/Scoresbysund" }, - { "egt", 0, -3600, "America/Scoresbysund" }, - { "ehdt", 1, -16200, "America/Santo_Domingo" }, - { "eit", 0, 32400, "Asia/Jayapura" }, - { "ept", 1, -14400, "America/New_York" }, - { "ept", 1, -14400, "America/Detroit" }, - { "ept", 1, -14400, "America/Iqaluit" }, - { "ept", 1, -14400, "America/Montreal" }, - { "ept", 1, -14400, "America/Nipigon" }, - { "ept", 1, -14400, "America/Thunder_Bay" }, - { "ept", 1, -14400, "America/Toronto" }, - { "ept", 1, -14400, "Canada/Eastern" }, - { "ept", 1, -14400, "EST" }, - { "ept", 1, -14400, "EST5EDT" }, - { "ept", 1, -14400, "US/Eastern" }, - { "ept", 1, -14400, "US/Michigan" }, - { "est", 0, -18000, "America/New_York" }, - { "est", 0, -18000, "America/Antigua" }, - { "est", 0, -18000, "America/Atikokan" }, - { "est", 0, -18000, "America/Cambridge_Bay" }, - { "est", 0, -18000, "America/Cancun" }, - { "est", 0, -18000, "America/Cayman" }, - { "est", 0, -18000, "America/Chicago" }, - { "est", 0, -18000, "America/Coral_Harbour" }, - { "est", 0, -18000, "America/Detroit" }, - { "est", 0, -18000, "America/Fort_Wayne" }, - { "est", 0, -18000, "America/Grand_Turk" }, - { "est", 0, -18000, "America/Indiana/Indianapolis" }, - { "est", 0, -18000, "America/Indiana/Knox" }, - { "est", 0, -18000, "America/Indiana/Marengo" }, - { "est", 0, -18000, "America/Indiana/Petersburg" }, - { "est", 0, -18000, "America/Indiana/Vevay" }, - { "est", 0, -18000, "America/Indiana/Vincennes" }, - { "est", 0, -18000, "America/Indiana/Winamac" }, - { "est", 0, -18000, "America/Indianapolis" }, - { "est", 0, -18000, "America/Iqaluit" }, - { "est", 0, -18000, "America/Jamaica" }, - { "est", 0, -18000, "America/Kentucky/Louisville" }, - { "est", 0, -18000, "America/Kentucky/Monticello" }, - { "est", 0, -18000, "America/Knox_IN" }, - { "est", 0, -18000, "America/Louisville" }, - { "est", 0, -18000, "America/Managua" }, - { "est", 0, -18000, "America/Menominee" }, - { "est", 0, -18000, "America/Merida" }, - { "est", 0, -18000, "America/Montreal" }, - { "est", 0, -18000, "America/Nassau" }, - { "est", 0, -18000, "America/Nipigon" }, - { "est", 0, -18000, "America/Panama" }, - { "est", 0, -18000, "America/Pangnirtung" }, - { "est", 0, -18000, "America/Port-au-Prince" }, - { "est", 0, -18000, "America/Rankin_Inlet" }, - { "est", 0, -18000, "America/Santo_Domingo" }, - { "est", 0, -18000, "America/Thunder_Bay" }, - { "est", 0, -18000, "America/Toronto" }, - { "est", 0, -18000, "Canada/Eastern" }, - { "est", 0, -18000, "EST" }, - { "est", 0, -18000, "EST5EDT" }, - { "est", 0, -18000, "Jamaica" }, - { "est", 0, -18000, "US/Central" }, - { "est", 0, -18000, "US/East-Indiana" }, - { "est", 0, -18000, "US/Eastern" }, - { "est", 0, -18000, "US/Indiana-Starke" }, - { "est", 0, -18000, "US/Michigan" }, - { "est", 0, 36000, "Australia/ACT" }, - { "est", 0, 36000, "Australia/Brisbane" }, - { "est", 0, 36000, "Australia/Canberra" }, - { "est", 0, 36000, "Australia/Currie" }, - { "est", 0, 36000, "Australia/Hobart" }, - { "est", 0, 36000, "Australia/Lindeman" }, - { "est", 0, 36000, "Australia/Melbourne" }, - { "est", 0, 36000, "Australia/NSW" }, - { "est", 0, 36000, "Australia/Queensland" }, - { "est", 0, 36000, "Australia/Sydney" }, - { "est", 0, 36000, "Australia/Tasmania" }, - { "est", 0, 36000, "Australia/Victoria" }, - { "est", 1, 39600, "Australia/Melbourne" }, - { "est", 1, 39600, "Australia/ACT" }, - { "est", 1, 39600, "Australia/Brisbane" }, - { "est", 1, 39600, "Australia/Canberra" }, - { "est", 1, 39600, "Australia/Currie" }, - { "est", 1, 39600, "Australia/Hobart" }, - { "est", 1, 39600, "Australia/Lindeman" }, - { "est", 1, 39600, "Australia/NSW" }, - { "est", 1, 39600, "Australia/Queensland" }, - { "est", 1, 39600, "Australia/Sydney" }, - { "est", 1, 39600, "Australia/Tasmania" }, - { "est", 1, 39600, "Australia/Victoria" }, - { "ewt", 1, -14400, "America/New_York" }, - { "ewt", 1, -14400, "America/Detroit" }, - { "ewt", 1, -14400, "America/Iqaluit" }, - { "ewt", 1, -14400, "America/Montreal" }, - { "ewt", 1, -14400, "America/Nipigon" }, - { "ewt", 1, -14400, "America/Thunder_Bay" }, - { "ewt", 1, -14400, "America/Toronto" }, - { "ewt", 1, -14400, "Canada/Eastern" }, - { "ewt", 1, -14400, "EST" }, - { "ewt", 1, -14400, "EST5EDT" }, - { "ewt", 1, -14400, "US/Eastern" }, - { "ewt", 1, -14400, "US/Michigan" }, - { "fjst", 1, 46800, "Pacific/Fiji" }, - { "fjt", 0, 43200, "Pacific/Fiji" }, - { "fkst", 1, -10800, "Atlantic/Stanley" }, - { "fkst", 1, -7200, "Atlantic/Stanley" }, - { "fkt", 0, -10800, "Atlantic/Stanley" }, - { "fkt", 0, -14400, "Atlantic/Stanley" }, - { "fnst", 1, -3600, "America/Noronha" }, - { "fnst", 1, -3600, "Brazil/DeNoronha" }, - { "fnt", 0, -7200, "America/Noronha" }, - { "fnt", 0, -7200, "Brazil/DeNoronha" }, - { "fort", 0, 14400, "Asia/Aqtau" }, - { "fort", 0, 18000, "Asia/Aqtau" }, - { "frust", 1, 21600, "Asia/Bishkek" }, - { "frust", 1, 25200, "Asia/Bishkek" }, - { "frut", 0, 18000, "Asia/Bishkek" }, - { "frut", 0, 21600, "Asia/Bishkek" }, - { "galt", 0, -21600, "Pacific/Galapagos" }, - { "gamt", 0, -32400, "Pacific/Gambier" }, - { "gbgt", 0, -13500, "America/Guyana" }, - { "gest", 1, 14400, "Asia/Tbilisi" }, - { "gest", 1, 18000, "Asia/Tbilisi" }, - { "get", 0, 10800, "Asia/Tbilisi" }, - { "get", 0, 14400, "Asia/Tbilisi" }, - { "gft", 0, -10800, "America/Cayenne" }, - { "gft", 0, -14400, "America/Cayenne" }, - { "ghst", 1, 1200, "Africa/Accra" }, - { "gmt", 0, 0, "Africa/Abidjan" }, - { "gmt", 0, 0, "Africa/Accra" }, - { "gmt", 0, 0, "Africa/Bamako" }, - { "gmt", 0, 0, "Africa/Banjul" }, - { "gmt", 0, 0, "Africa/Bissau" }, - { "gmt", 0, 0, "Africa/Conakry" }, - { "gmt", 0, 0, "Africa/Dakar" }, - { "gmt", 0, 0, "Africa/Freetown" }, - { "gmt", 0, 0, "Africa/Malabo" }, - { "gmt", 0, 0, "Africa/Monrovia" }, - { "gmt", 0, 0, "Africa/Niamey" }, - { "gmt", 0, 0, "Africa/Nouakchott" }, - { "gmt", 0, 0, "Africa/Ouagadougou" }, - { "gmt", 0, 0, "Africa/Porto-Novo" }, - { "gmt", 0, 0, "Africa/Sao_Tome" }, - { "gmt", 0, 0, "Africa/Timbuktu" }, - { "gmt", 0, 0, "America/Danmarkshavn" }, - { "gmt", 0, 0, "Atlantic/Reykjavik" }, - { "gmt", 0, 0, "Atlantic/St_Helena" }, - { "gmt", 0, 0, "Eire" }, - { "gmt", 0, 0, "Europe/Belfast" }, - { "gmt", 0, 0, "Europe/Dublin" }, - { "gmt", 0, 0, "Europe/Gibraltar" }, - { "gmt", 0, 0, "Europe/Guernsey" }, - { "gmt", 0, 0, "Europe/Isle_of_Man" }, - { "gmt", 0, 0, "Europe/Jersey" }, - { "gmt", 0, 0, "Europe/London" }, - { "gmt", 0, 0, "GB" }, - { "gmt", 0, 0, "GB-Eire" }, - { "gmt", 0, 0, "Iceland" }, - { "gst", 0, 14400, "Asia/Dubai" }, - { "gst", 0, 14400, "Asia/Bahrain" }, - { "gst", 0, 14400, "Asia/Muscat" }, - { "gst", 0, 14400, "Asia/Qatar" }, - { "gyt", 0, -10800, "America/Guyana" }, - { "gyt", 0, -13500, "America/Guyana" }, - { "gyt", 0, -14400, "America/Guyana" }, - { "hadt", 1, -32400, "America/Adak" }, - { "hadt", 1, -32400, "America/Atka" }, - { "hadt", 1, -32400, "US/Aleutian" }, - { "hast", 0, -36000, "America/Adak" }, - { "hast", 0, -36000, "America/Atka" }, - { "hast", 0, -36000, "US/Aleutian" }, - { "hdt", 1, -34200, "Pacific/Honolulu" }, - { "hdt", 1, -34200, "HST" }, - { "hdt", 1, -34200, "US/Hawaii" }, - { "hkst", 1, 32400, "Asia/Hong_Kong" }, - { "hkst", 1, 32400, "Hongkong" }, - { "hkt", 0, 28800, "Asia/Hong_Kong" }, - { "hkt", 0, 28800, "Hongkong" }, - { "hovst", 1, 28800, "Asia/Hovd" }, - { "hovt", 0, 21600, "Asia/Hovd" }, - { "hovt", 0, 25200, "Asia/Hovd" }, - { "hpt", 1, -34200, "Pacific/Honolulu" }, - { "hpt", 1, -34200, "HST" }, - { "hpt", 1, -34200, "US/Hawaii" }, - { "hst", 0, -36000, "Pacific/Honolulu" }, - { "hst", 0, -37800, "Pacific/Honolulu" }, - { "hst", 0, -36000, "HST" }, - { "hst", 0, -36000, "US/Hawaii" }, - { "hst", 0, -37800, "HST" }, - { "hst", 0, -37800, "US/Hawaii" }, - { "hwt", 1, -34200, "Pacific/Honolulu" }, - { "hwt", 1, -34200, "HST" }, - { "hwt", 1, -34200, "US/Hawaii" }, - { "ict", 0, 25200, "Asia/Bangkok" }, - { "ict", 0, 25200, "Asia/Phnom_Penh" }, - { "ict", 0, 25200, "Asia/Saigon" }, - { "ict", 0, 25200, "Asia/Vientiane" }, - { "ict", 0, 28800, "Asia/Phnom_Penh" }, - { "ict", 0, 28800, "Asia/Saigon" }, - { "ict", 0, 28800, "Asia/Vientiane" }, - { "iddt", 1, 14400, "Asia/Jerusalem" }, - { "iddt", 1, 14400, "Asia/Tel_Aviv" }, - { "iddt", 1, 14400, "Israel" }, - { "idt", 1, 10800, "Asia/Jerusalem" }, - { "idt", 1, 10800, "Asia/Gaza" }, - { "idt", 1, 10800, "Asia/Tel_Aviv" }, - { "idt", 1, 10800, "Israel" }, - { "ihst", 1, 21600, "Asia/Colombo" }, - { "iot", 0, 18000, "Indian/Chagos" }, - { "iot", 0, 21600, "Indian/Chagos" }, - { "irdt", 1, 16200, "Asia/Tehran" }, - { "irdt", 1, 18000, "Asia/Tehran" }, - { "irdt", 1, 16200, "Iran" }, - { "irdt", 1, 18000, "Iran" }, - { "irkst", 1, 28800, "Asia/Irkutsk" }, - { "irkst", 1, 32400, "Asia/Irkutsk" }, - { "irkt", 0, 25200, "Asia/Irkutsk" }, - { "irkt", 0, 28800, "Asia/Irkutsk" }, - { "irst", 0, 12600, "Asia/Tehran" }, - { "irst", 0, 14400, "Asia/Tehran" }, - { "irst", 0, 12600, "Iran" }, - { "irst", 0, 14400, "Iran" }, - { "isst", 1, 0, "Atlantic/Reykjavik" }, - { "isst", 1, 0, "Iceland" }, - { "ist", 0, 7200, "Asia/Jerusalem" }, - { "ist", 0, -3600, "Atlantic/Reykjavik" }, - { "ist", 0, -3600, "Iceland" }, - { "ist", 0, 19800, "Asia/Calcutta" }, - { "ist", 0, 19800, "Asia/Colombo" }, - { "ist", 0, 19800, "Asia/Dacca" }, - { "ist", 0, 19800, "Asia/Dhaka" }, - { "ist", 0, 19800, "Asia/Karachi" }, - { "ist", 0, 19800, "Asia/Katmandu" }, - { "ist", 0, 19800, "Asia/Thimbu" }, - { "ist", 0, 19800, "Asia/Thimphu" }, - { "ist", 1, 2079, "Eire" }, - { "ist", 1, 2079, "Europe/Dublin" }, - { "ist", 1, 23400, "Asia/Calcutta" }, - { "ist", 1, 23400, "Asia/Colombo" }, - { "ist", 1, 23400, "Asia/Karachi" }, - { "ist", 0, 3600, "Eire" }, - { "ist", 0, 3600, "Europe/Dublin" }, - { "ist", 1, 3600, "Eire" }, - { "ist", 1, 3600, "Europe/Dublin" }, - { "ist", 0, 7200, "Asia/Gaza" }, - { "ist", 0, 7200, "Asia/Tel_Aviv" }, - { "ist", 0, 7200, "Israel" }, - { "javt", 0, 26400, "Asia/Jakarta" }, - { "jdt", 1, 36000, "Asia/Tokyo" }, - { "jdt", 1, 36000, "Japan" }, - { "jst", 0, 32400, "Asia/Tokyo" }, - { "jst", 0, 32400, "Asia/Dili" }, - { "jst", 0, 32400, "Asia/Jakarta" }, - { "jst", 0, 32400, "Asia/Kuala_Lumpur" }, - { "jst", 0, 32400, "Asia/Kuching" }, - { "jst", 0, 32400, "Asia/Makassar" }, - { "jst", 0, 32400, "Asia/Manila" }, - { "jst", 0, 32400, "Asia/Pontianak" }, - { "jst", 0, 32400, "Asia/Rangoon" }, - { "jst", 0, 32400, "Asia/Sakhalin" }, - { "jst", 0, 32400, "Asia/Singapore" }, - { "jst", 0, 32400, "Asia/Ujung_Pandang" }, - { "jst", 0, 32400, "Japan" }, - { "jst", 0, 32400, "Pacific/Nauru" }, - { "jst", 0, 32400, "Singapore" }, - { "kart", 0, 18000, "Asia/Karachi" }, - { "kast", 0, 18000, "Asia/Kashgar" }, - { "kast", 0, 19800, "Asia/Kashgar" }, - { "kdt", 1, 32400, "Asia/Seoul" }, - { "kdt", 1, 36000, "Asia/Seoul" }, - { "kdt", 1, 32400, "ROK" }, - { "kdt", 1, 36000, "ROK" }, - { "kgst", 1, 21600, "Asia/Bishkek" }, - { "kgt", 0, 18000, "Asia/Bishkek" }, - { "kgt", 0, 21600, "Asia/Bishkek" }, - { "kizst", 1, 21600, "Asia/Qyzylorda" }, - { "kizt", 0, 14400, "Asia/Qyzylorda" }, - { "kizt", 0, 18000, "Asia/Qyzylorda" }, - { "kizt", 0, 21600, "Asia/Qyzylorda" }, - { "kmt", 0, 5736, "Europe/Vilnius" }, - { "kost", 0, 39600, "Pacific/Kosrae" }, - { "kost", 0, 43200, "Pacific/Kosrae" }, - { "krast", 1, 25200, "Asia/Krasnoyarsk" }, - { "krast", 1, 28800, "Asia/Krasnoyarsk" }, - { "krat", 0, 21600, "Asia/Krasnoyarsk" }, - { "krat", 0, 25200, "Asia/Krasnoyarsk" }, - { "kst", 0, 28800, "Asia/Seoul" }, - { "kst", 0, 30600, "Asia/Seoul" }, - { "kst", 0, 32400, "Asia/Seoul" }, - { "kst", 0, 28800, "Asia/Pyongyang" }, - { "kst", 0, 28800, "ROK" }, - { "kst", 0, 30600, "Asia/Pyongyang" }, - { "kst", 0, 30600, "ROK" }, - { "kst", 0, 32400, "Asia/Pyongyang" }, - { "kst", 0, 32400, "ROK" }, - { "kuyst", 1, 10800, "Europe/Samara" }, - { "kuyst", 1, 14400, "Europe/Samara" }, - { "kuyst", 1, 18000, "Europe/Samara" }, - { "kuyt", 0, 10800, "Europe/Samara" }, - { "kuyt", 0, 14400, "Europe/Samara" }, - { "kwat", 0, -43200, "Pacific/Kwajalein" }, - { "kwat", 0, -43200, "Kwajalein" }, - { "lhst", 0, 37800, "Australia/Lord_Howe" }, - { "lhst", 1, 39600, "Australia/Lord_Howe" }, - { "lhst", 1, 41400, "Australia/Lord_Howe" }, - { "lhst", 0, 37800, "Australia/LHI" }, - { "lhst", 1, 39600, "Australia/LHI" }, - { "lhst", 1, 41400, "Australia/LHI" }, - { "lint", 0, -36000, "Pacific/Kiritimati" }, - { "lint", 0, 50400, "Pacific/Kiritimati" }, - { "lkt", 0, 21600, "Asia/Colombo" }, - { "lkt", 0, 23400, "Asia/Colombo" }, - { "lont", 0, 25200, "Asia/Chongqing" }, - { "lont", 0, 25200, "Asia/Chungking" }, - { "lrt", 0, -2670, "Africa/Monrovia" }, - { "lst", 1, 9384, "Europe/Riga" }, - { "madmt", 1, 3600, "Atlantic/Madeira" }, - { "madst", 1, 0, "Atlantic/Madeira" }, - { "madt", 0, -3600, "Atlantic/Madeira" }, - { "magst", 1, 39600, "Asia/Magadan" }, - { "magst", 1, 43200, "Asia/Magadan" }, - { "magt", 0, 36000, "Asia/Magadan" }, - { "magt", 0, 39600, "Asia/Magadan" }, - { "malst", 1, 26400, "Asia/Singapore" }, - { "malst", 1, 26400, "Asia/Kuala_Lumpur" }, - { "malst", 1, 26400, "Singapore" }, - { "malt", 0, 25200, "Asia/Singapore" }, - { "malt", 0, 26400, "Asia/Singapore" }, - { "malt", 0, 27000, "Asia/Singapore" }, - { "malt", 0, 25200, "Asia/Kuala_Lumpur" }, - { "malt", 0, 25200, "Singapore" }, - { "malt", 0, 26400, "Asia/Kuala_Lumpur" }, - { "malt", 0, 26400, "Singapore" }, - { "malt", 0, 27000, "Asia/Kuala_Lumpur" }, - { "malt", 0, 27000, "Singapore" }, - { "mart", 0, -34200, "Pacific/Marquesas" }, - { "mawt", 0, 21600, "Antarctica/Mawson" }, - { "mddt", 1, -18000, "America/Cambridge_Bay" }, - { "mddt", 1, -18000, "America/Yellowknife" }, - { "mdst", 1, 16248, "Europe/Moscow" }, - { "mdst", 1, 16248, "W-SU" }, - { "mdt", 1, -21600, "America/Denver" }, - { "mdt", 1, -21600, "America/Boise" }, - { "mdt", 1, -21600, "America/Cambridge_Bay" }, - { "mdt", 1, -21600, "America/Chihuahua" }, - { "mdt", 1, -21600, "America/Edmonton" }, - { "mdt", 1, -21600, "America/Hermosillo" }, - { "mdt", 1, -21600, "America/Inuvik" }, - { "mdt", 1, -21600, "America/Mazatlan" }, - { "mdt", 1, -21600, "America/North_Dakota/Center" }, - { "mdt", 1, -21600, "America/North_Dakota/New_Salem" }, - { "mdt", 1, -21600, "America/Phoenix" }, - { "mdt", 1, -21600, "America/Regina" }, - { "mdt", 1, -21600, "America/Shiprock" }, - { "mdt", 1, -21600, "America/Swift_Current" }, - { "mdt", 1, -21600, "America/Yellowknife" }, - { "mdt", 1, -21600, "Canada/East-Saskatchewan" }, - { "mdt", 1, -21600, "Canada/Mountain" }, - { "mdt", 1, -21600, "Canada/Saskatchewan" }, - { "mdt", 1, -21600, "Mexico/BajaSur" }, - { "mdt", 1, -21600, "MST" }, - { "mdt", 1, -21600, "MST7MDT" }, - { "mdt", 1, -21600, "Navajo" }, - { "mdt", 1, -21600, "US/Arizona" }, - { "mdt", 1, -21600, "US/Mountain" }, - { "mest", 1, 7200, "MET" }, - { "met", 0, 3600, "MET" }, - { "mht", 0, 43200, "Pacific/Kwajalein" }, - { "mht", 0, 43200, "Kwajalein" }, - { "mht", 0, 43200, "Pacific/Majuro" }, - { "mmt", 0, 9048, "Europe/Moscow" }, - { "mmt", 0, 23400, "Asia/Rangoon" }, - { "mmt", 0, 28656, "Asia/Makassar" }, - { "mmt", 0, 28656, "Asia/Ujung_Pandang" }, - { "mmt", 0, 9048, "W-SU" }, - { "most", 1, 32400, "Asia/Macao" }, - { "most", 1, 32400, "Asia/Macau" }, - { "mot", 0, 28800, "Asia/Macao" }, - { "mot", 0, 28800, "Asia/Macau" }, - { "mpt", 1, -21600, "America/Denver" }, - { "mpt", 1, -21600, "America/Boise" }, - { "mpt", 1, -21600, "America/Cambridge_Bay" }, - { "mpt", 1, -21600, "America/Edmonton" }, - { "mpt", 1, -21600, "America/North_Dakota/Center" }, - { "mpt", 1, -21600, "America/North_Dakota/New_Salem" }, - { "mpt", 1, -21600, "America/Regina" }, - { "mpt", 1, -21600, "America/Shiprock" }, - { "mpt", 1, -21600, "America/Swift_Current" }, - { "mpt", 1, -21600, "America/Yellowknife" }, - { "mpt", 1, -21600, "Canada/East-Saskatchewan" }, - { "mpt", 1, -21600, "Canada/Mountain" }, - { "mpt", 1, -21600, "Canada/Saskatchewan" }, - { "mpt", 1, -21600, "MST" }, - { "mpt", 1, -21600, "MST7MDT" }, - { "mpt", 1, -21600, "Navajo" }, - { "mpt", 1, -21600, "US/Mountain" }, - { "mpt", 0, 36000, "Pacific/Saipan" }, - { "msd", 1, 14400, "Europe/Moscow" }, - { "msd", 1, 18000, "Europe/Moscow" }, - { "msd", 1, 14400, "Europe/Chisinau" }, - { "msd", 1, 14400, "Europe/Kaliningrad" }, - { "msd", 1, 14400, "Europe/Kiev" }, - { "msd", 1, 14400, "Europe/Minsk" }, - { "msd", 1, 14400, "Europe/Riga" }, - { "msd", 1, 14400, "Europe/Simferopol" }, - { "msd", 1, 14400, "Europe/Tallinn" }, - { "msd", 1, 14400, "Europe/Tiraspol" }, - { "msd", 1, 14400, "Europe/Uzhgorod" }, - { "msd", 1, 14400, "Europe/Vilnius" }, - { "msd", 1, 14400, "Europe/Zaporozhye" }, - { "msd", 1, 14400, "W-SU" }, - { "msd", 1, 18000, "W-SU" }, - { "msk", 0, 10800, "Europe/Moscow" }, - { "msk", 0, 10800, "Europe/Chisinau" }, - { "msk", 0, 10800, "Europe/Kaliningrad" }, - { "msk", 0, 10800, "Europe/Kiev" }, - { "msk", 0, 10800, "Europe/Minsk" }, - { "msk", 0, 10800, "Europe/Riga" }, - { "msk", 0, 10800, "Europe/Simferopol" }, - { "msk", 0, 10800, "Europe/Tallinn" }, - { "msk", 0, 10800, "Europe/Tiraspol" }, - { "msk", 0, 10800, "Europe/Uzhgorod" }, - { "msk", 0, 10800, "Europe/Vilnius" }, - { "msk", 0, 10800, "Europe/Zaporozhye" }, - { "msk", 0, 10800, "W-SU" }, - { "mst", 0, -25200, "America/Denver" }, - { "mst", 0, -25200, "America/Boise" }, - { "mst", 0, -25200, "America/Cambridge_Bay" }, - { "mst", 0, -25200, "America/Chihuahua" }, - { "mst", 0, -25200, "America/Dawson_Creek" }, - { "mst", 0, -25200, "America/Edmonton" }, - { "mst", 0, -25200, "America/Ensenada" }, - { "mst", 0, -25200, "America/Hermosillo" }, - { "mst", 0, -25200, "America/Inuvik" }, - { "mst", 0, -25200, "America/Mazatlan" }, - { "mst", 0, -25200, "America/Mexico_City" }, - { "mst", 0, -25200, "America/North_Dakota/Center" }, - { "mst", 0, -25200, "America/North_Dakota/New_Salem" }, - { "mst", 0, -25200, "America/Phoenix" }, - { "mst", 0, -25200, "America/Regina" }, - { "mst", 0, -25200, "America/Shiprock" }, - { "mst", 0, -25200, "America/Swift_Current" }, - { "mst", 0, -25200, "America/Tijuana" }, - { "mst", 0, -25200, "America/Yellowknife" }, - { "mst", 0, -25200, "Canada/East-Saskatchewan" }, - { "mst", 0, -25200, "Canada/Mountain" }, - { "mst", 0, -25200, "Canada/Saskatchewan" }, - { "mst", 0, -25200, "Mexico/BajaNorte" }, - { "mst", 0, -25200, "Mexico/BajaSur" }, - { "mst", 0, -25200, "Mexico/General" }, - { "mst", 0, -25200, "MST" }, - { "mst", 0, -25200, "MST7MDT" }, - { "mst", 0, -25200, "Navajo" }, - { "mst", 0, -25200, "US/Arizona" }, - { "mst", 0, -25200, "US/Mountain" }, - { "mst", 1, 12648, "Europe/Moscow" }, - { "mst", 1, 12648, "W-SU" }, - { "mut", 0, 14400, "Indian/Mauritius" }, - { "mvt", 0, 18000, "Indian/Maldives" }, - { "mwt", 1, -21600, "America/Denver" }, - { "mwt", 1, -21600, "America/Boise" }, - { "mwt", 1, -21600, "America/Cambridge_Bay" }, - { "mwt", 1, -21600, "America/Edmonton" }, - { "mwt", 1, -21600, "America/North_Dakota/Center" }, - { "mwt", 1, -21600, "America/North_Dakota/New_Salem" }, - { "mwt", 1, -21600, "America/Phoenix" }, - { "mwt", 1, -21600, "America/Regina" }, - { "mwt", 1, -21600, "America/Shiprock" }, - { "mwt", 1, -21600, "America/Swift_Current" }, - { "mwt", 1, -21600, "America/Yellowknife" }, - { "mwt", 1, -21600, "Canada/East-Saskatchewan" }, - { "mwt", 1, -21600, "Canada/Mountain" }, - { "mwt", 1, -21600, "Canada/Saskatchewan" }, - { "mwt", 1, -21600, "MST" }, - { "mwt", 1, -21600, "MST7MDT" }, - { "mwt", 1, -21600, "Navajo" }, - { "mwt", 1, -21600, "US/Arizona" }, - { "mwt", 1, -21600, "US/Mountain" }, - { "myt", 0, 28800, "Asia/Kuala_Lumpur" }, - { "myt", 0, 28800, "Asia/Kuching" }, - { "ncst", 1, 43200, "Pacific/Noumea" }, - { "nct", 0, 39600, "Pacific/Noumea" }, - { "nddt", 1, -5400, "America/St_Johns" }, - { "nddt", 1, -5400, "Canada/Newfoundland" }, - { "ndt", 1, -9000, "America/St_Johns" }, - { "ndt", 1, -9052, "America/St_Johns" }, - { "ndt", 1, -36000, "Pacific/Midway" }, - { "ndt", 1, -9000, "America/Goose_Bay" }, - { "ndt", 1, -9000, "Canada/Newfoundland" }, - { "ndt", 1, -9052, "America/Goose_Bay" }, - { "ndt", 1, -9052, "Canada/Newfoundland" }, - { "negt", 0, -12600, "America/Paramaribo" }, - { "nest", 1, 4800, "Europe/Amsterdam" }, - { "net", 0, 1200, "Europe/Amsterdam" }, - { "nft", 0, 41400, "Pacific/Norfolk" }, - { "novst", 1, 25200, "Asia/Novosibirsk" }, - { "novst", 1, 28800, "Asia/Novosibirsk" }, - { "novt", 0, 21600, "Asia/Novosibirsk" }, - { "novt", 0, 25200, "Asia/Novosibirsk" }, - { "npt", 1, -9000, "America/St_Johns" }, - { "npt", 1, -36000, "America/Adak" }, - { "npt", 1, -36000, "America/Atka" }, - { "npt", 1, -36000, "America/Nome" }, - { "npt", 1, -36000, "US/Aleutian" }, - { "npt", 1, -9000, "America/Goose_Bay" }, - { "npt", 1, -9000, "Canada/Newfoundland" }, - { "npt", 0, 20700, "Asia/Katmandu" }, - { "nrt", 0, 41400, "Pacific/Nauru" }, - { "nrt", 0, 43200, "Pacific/Nauru" }, - { "nst", 0, -12600, "America/St_Johns" }, - { "nst", 0, -12652, "America/St_Johns" }, - { "nst", 0, -12600, "America/Goose_Bay" }, - { "nst", 0, -12600, "Canada/Newfoundland" }, - { "nst", 0, -12652, "America/Goose_Bay" }, - { "nst", 0, -12652, "Canada/Newfoundland" }, - { "nst", 0, -39600, "America/Adak" }, - { "nst", 0, -39600, "America/Atka" }, - { "nst", 0, -39600, "America/Nome" }, - { "nst", 0, -39600, "Pacific/Midway" }, - { "nst", 0, -39600, "Pacific/Pago_Pago" }, - { "nst", 0, -39600, "Pacific/Samoa" }, - { "nst", 0, -39600, "US/Aleutian" }, - { "nst", 0, -39600, "US/Samoa" }, - { "nst", 1, 4772, "Europe/Amsterdam" }, - { "nut", 0, -39600, "Pacific/Niue" }, - { "nut", 0, -41400, "Pacific/Niue" }, - { "nwt", 1, -9000, "America/St_Johns" }, - { "nwt", 1, -36000, "America/Adak" }, - { "nwt", 1, -36000, "America/Atka" }, - { "nwt", 1, -36000, "America/Nome" }, - { "nwt", 1, -36000, "US/Aleutian" }, - { "nwt", 1, -9000, "America/Goose_Bay" }, - { "nwt", 1, -9000, "Canada/Newfoundland" }, - { "nzdt", 1, 46800, "Pacific/Auckland" }, - { "nzdt", 1, 46800, "Antarctica/McMurdo" }, - { "nzdt", 1, 46800, "Antarctica/South_Pole" }, - { "nzdt", 1, 46800, "NZ" }, - { "nzmt", 0, 41400, "Pacific/Auckland" }, - { "nzmt", 0, 41400, "NZ" }, - { "nzst", 0, 43200, "Pacific/Auckland" }, - { "nzst", 1, 43200, "Pacific/Auckland" }, - { "nzst", 1, 45000, "Pacific/Auckland" }, - { "nzst", 0, 43200, "Antarctica/McMurdo" }, - { "nzst", 0, 43200, "Antarctica/South_Pole" }, - { "nzst", 0, 43200, "NZ" }, - { "nzst", 1, 43200, "NZ" }, - { "nzst", 1, 45000, "NZ" }, - { "omsst", 1, 21600, "Asia/Omsk" }, - { "omsst", 1, 25200, "Asia/Omsk" }, - { "omst", 0, 18000, "Asia/Omsk" }, - { "omst", 0, 21600, "Asia/Omsk" }, - { "orast", 1, 18000, "Asia/Oral" }, - { "orat", 0, 14400, "Asia/Oral" }, - { "orat", 0, 18000, "Asia/Oral" }, - { "pddt", 1, -21600, "America/Inuvik" }, - { "pdt", 1, -25200, "America/Los_Angeles" }, - { "pdt", 1, -25200, "America/Boise" }, - { "pdt", 1, -25200, "America/Dawson" }, - { "pdt", 1, -25200, "America/Dawson_Creek" }, - { "pdt", 1, -25200, "America/Ensenada" }, - { "pdt", 1, -25200, "America/Inuvik" }, - { "pdt", 1, -25200, "America/Juneau" }, - { "pdt", 1, -25200, "America/Tijuana" }, - { "pdt", 1, -25200, "America/Vancouver" }, - { "pdt", 1, -25200, "America/Whitehorse" }, - { "pdt", 1, -25200, "Canada/Pacific" }, - { "pdt", 1, -25200, "Canada/Yukon" }, - { "pdt", 1, -25200, "Mexico/BajaNorte" }, - { "pdt", 1, -25200, "PST8PDT" }, - { "pdt", 1, -25200, "US/Pacific" }, - { "pdt", 1, -25200, "US/Pacific-New" }, - { "pest", 1, -14400, "America/Lima" }, - { "petst", 1, 43200, "Asia/Kamchatka" }, - { "petst", 1, 46800, "Asia/Kamchatka" }, - { "pett", 0, 39600, "Asia/Kamchatka" }, - { "pett", 0, 43200, "Asia/Kamchatka" }, - { "pet", 0, -18000, "America/Lima" }, - { "phot", 0, -39600, "Pacific/Enderbury" }, - { "phot", 0, 46800, "Pacific/Enderbury" }, - { "phst", 1, 32400, "Asia/Manila" }, - { "pht", 0, 28800, "Asia/Manila" }, - { "pkst", 1, 21600, "Asia/Karachi" }, - { "pkt", 0, 18000, "Asia/Karachi" }, - { "pmdt", 1, -7200, "America/Miquelon" }, - { "pmst", 0, -10800, "America/Miquelon" }, - { "pmt", 0, -13236, "America/Paramaribo" }, - { "pmt", 0, -13252, "America/Paramaribo" }, - { "pmt", 0, 26240, "Asia/Pontianak" }, - { "pmt", 0, 36000, "Antarctica/DumontDUrville" }, - { "ppt", 1, -25200, "America/Los_Angeles" }, - { "ppt", 1, -25200, "America/Dawson_Creek" }, - { "ppt", 1, -25200, "America/Ensenada" }, - { "ppt", 1, -25200, "America/Inuvik" }, - { "ppt", 1, -25200, "America/Juneau" }, - { "ppt", 1, -25200, "America/Tijuana" }, - { "ppt", 1, -25200, "America/Vancouver" }, - { "ppt", 1, -25200, "Canada/Pacific" }, - { "ppt", 1, -25200, "Mexico/BajaNorte" }, - { "ppt", 1, -25200, "PST8PDT" }, - { "ppt", 1, -25200, "US/Pacific" }, - { "ppt", 1, -25200, "US/Pacific-New" }, - { "pst", 0, -28800, "America/Los_Angeles" }, - { "pst", 0, -28800, "America/Boise" }, - { "pst", 0, -28800, "America/Dawson" }, - { "pst", 0, -28800, "America/Dawson_Creek" }, - { "pst", 0, -28800, "America/Ensenada" }, - { "pst", 0, -28800, "America/Hermosillo" }, - { "pst", 0, -28800, "America/Inuvik" }, - { "pst", 0, -28800, "America/Juneau" }, - { "pst", 0, -28800, "America/Mazatlan" }, - { "pst", 0, -28800, "America/Tijuana" }, - { "pst", 0, -28800, "America/Vancouver" }, - { "pst", 0, -28800, "America/Whitehorse" }, - { "pst", 0, -28800, "Canada/Pacific" }, - { "pst", 0, -28800, "Canada/Yukon" }, - { "pst", 0, -28800, "Mexico/BajaNorte" }, - { "pst", 0, -28800, "Mexico/BajaSur" }, - { "pst", 0, -28800, "Pacific/Pitcairn" }, - { "pst", 0, -28800, "PST8PDT" }, - { "pst", 0, -28800, "US/Pacific" }, - { "pst", 0, -28800, "US/Pacific-New" }, - { "pwt", 1, -25200, "America/Los_Angeles" }, - { "pwt", 1, -25200, "America/Dawson_Creek" }, - { "pwt", 1, -25200, "America/Ensenada" }, - { "pwt", 1, -25200, "America/Inuvik" }, - { "pwt", 1, -25200, "America/Juneau" }, - { "pwt", 1, -25200, "America/Tijuana" }, - { "pwt", 1, -25200, "America/Vancouver" }, - { "pwt", 1, -25200, "Canada/Pacific" }, - { "pwt", 1, -25200, "Mexico/BajaNorte" }, - { "pwt", 1, -25200, "PST8PDT" }, - { "pwt", 1, -25200, "US/Pacific" }, - { "pwt", 1, -25200, "US/Pacific-New" }, - { "pyst", 1, -10800, "America/Asuncion" }, - { "pyt", 0, -10800, "America/Asuncion" }, - { "pyt", 0, -14400, "America/Asuncion" }, - { "qyzst", 1, 25200, "Asia/Qyzylorda" }, - { "qyzt", 0, 18000, "Asia/Qyzylorda" }, - { "qyzt", 0, 21600, "Asia/Qyzylorda" }, - { "ret", 0, 14400, "Indian/Reunion" }, - { "rmt", 0, 5784, "Europe/Riga" }, - { "rott", 0, -10800, "Antarctica/Rothera" }, - { "sakst", 1, 39600, "Asia/Sakhalin" }, - { "sakst", 1, 43200, "Asia/Sakhalin" }, - { "sakt", 0, 36000, "Asia/Sakhalin" }, - { "sakt", 0, 39600, "Asia/Sakhalin" }, - { "samst", 1, 21600, "Asia/Samarkand" }, - { "samst", 1, 18000, "Europe/Samara" }, - { "samt", 0, 14400, "Asia/Samarkand" }, - { "samt", 0, 18000, "Asia/Samarkand" }, - { "samt", 0, -41400, "Pacific/Apia" }, - { "samt", 0, -41400, "Pacific/Pago_Pago" }, - { "samt", 0, -41400, "Pacific/Samoa" }, - { "samt", 0, -41400, "US/Samoa" }, - { "samt", 0, 10800, "Europe/Samara" }, - { "samt", 0, 14400, "Europe/Samara" }, - { "sast", 1, 10800, "Africa/Johannesburg" }, - { "sast", 0, 7200, "Africa/Johannesburg" }, - { "sast", 1, 10800, "Africa/Maseru" }, - { "sast", 1, 10800, "Africa/Windhoek" }, - { "sast", 0, 7200, "Africa/Maseru" }, - { "sast", 0, 7200, "Africa/Mbabane" }, - { "sast", 0, 7200, "Africa/Windhoek" }, - { "sbt", 0, 39600, "Pacific/Guadalcanal" }, - { "sct", 0, 14400, "Indian/Mahe" }, - { "sgt", 0, 27000, "Asia/Singapore" }, - { "sgt", 0, 28800, "Asia/Singapore" }, - { "sgt", 0, 27000, "Singapore" }, - { "sgt", 0, 28800, "Singapore" }, - { "shest", 1, 21600, "Asia/Aqtau" }, - { "shet", 0, 18000, "Asia/Aqtau" }, - { "shet", 0, 21600, "Asia/Aqtau" }, - { "slst", 1, -1200, "Africa/Freetown" }, - { "slst", 1, 3600, "Africa/Freetown" }, - { "smt", 0, 25580, "Asia/Saigon" }, - { "smt", 0, -16966, "America/Santiago" }, - { "smt", 0, -16966, "Chile/Continental" }, - { "smt", 0, 25580, "Asia/Phnom_Penh" }, - { "smt", 0, 25580, "Asia/Vientiane" }, - { "srt", 0, -10800, "America/Paramaribo" }, - { "srt", 0, -12600, "America/Paramaribo" }, - { "sst", 0, -39600, "Pacific/Samoa" }, - { "sst", 0, -39600, "Pacific/Midway" }, - { "sst", 0, -39600, "Pacific/Pago_Pago" }, - { "sst", 0, -39600, "US/Samoa" }, - { "stat", 0, 10800, "Europe/Volgograd" }, - { "stat", 0, 14400, "Europe/Volgograd" }, - { "svest", 1, 18000, "Asia/Yekaterinburg" }, - { "svest", 1, 21600, "Asia/Yekaterinburg" }, - { "svet", 0, 14400, "Asia/Yekaterinburg" }, - { "svet", 0, 18000, "Asia/Yekaterinburg" }, - { "syot", 0, 10800, "Antarctica/Syowa" }, - { "taht", 0, -36000, "Pacific/Tahiti" }, - { "tasst", 1, 25200, "Asia/Samarkand" }, - { "tasst", 1, 21600, "Asia/Tashkent" }, - { "tasst", 1, 25200, "Asia/Tashkent" }, - { "tast", 0, 21600, "Asia/Samarkand" }, - { "tast", 0, 18000, "Asia/Tashkent" }, - { "tast", 0, 21600, "Asia/Tashkent" }, - { "tbist", 1, 14400, "Asia/Tbilisi" }, - { "tbist", 1, 18000, "Asia/Tbilisi" }, - { "tbit", 0, 10800, "Asia/Tbilisi" }, - { "tbit", 0, 14400, "Asia/Tbilisi" }, - { "tft", 0, 18000, "Indian/Kerguelen" }, - { "tjt", 0, 18000, "Asia/Dushanbe" }, - { "tlt", 0, 28800, "Asia/Dili" }, - { "tlt", 0, 32400, "Asia/Dili" }, - { "tmt", 0, 12344, "Asia/Tehran" }, - { "tmt", 0, 12344, "Iran" }, - { "tmt", 0, 14400, "Asia/Ashgabat" }, - { "tmt", 0, 14400, "Asia/Ashkhabad" }, - { "tmt", 0, 18000, "Asia/Ashgabat" }, - { "tmt", 0, 18000, "Asia/Ashkhabad" }, - { "tmt", 0, 5940, "Europe/Tallinn" }, - { "tost", 1, 50400, "Pacific/Tongatapu" }, - { "tot", 0, 46800, "Pacific/Tongatapu" }, - { "trst", 1, 14400, "Europe/Istanbul" }, - { "trst", 1, 14400, "Asia/Istanbul" }, - { "trst", 1, 14400, "Turkey" }, - { "trt", 0, 10800, "Europe/Istanbul" }, - { "trt", 0, 10800, "Asia/Istanbul" }, - { "trt", 0, 10800, "Turkey" }, - { "tsat", 0, 10800, "Europe/Volgograd" }, - { "ulast", 1, 32400, "Asia/Ulaanbaatar" }, - { "ulast", 1, 32400, "Asia/Ulan_Bator" }, - { "ulat", 0, 25200, "Asia/Ulaanbaatar" }, - { "ulat", 0, 28800, "Asia/Ulaanbaatar" }, - { "ulat", 0, 25200, "Asia/Choibalsan" }, - { "ulat", 0, 25200, "Asia/Ulan_Bator" }, - { "ulat", 0, 28800, "Asia/Choibalsan" }, - { "ulat", 0, 28800, "Asia/Ulan_Bator" }, - { "urast", 1, 18000, "Asia/Oral" }, - { "urast", 1, 21600, "Asia/Oral" }, - { "urat", 0, 14400, "Asia/Oral" }, - { "urat", 0, 18000, "Asia/Oral" }, - { "urat", 0, 21600, "Asia/Oral" }, - { "urut", 0, 21600, "Asia/Urumqi" }, - { "uyhst", 1, -10800, "America/Montevideo" }, - { "uyhst", 1, -9000, "America/Montevideo" }, - { "uyst", 1, -7200, "America/Montevideo" }, - { "uyt", 0, -10800, "America/Montevideo" }, - { "uyt", 0, -12600, "America/Montevideo" }, - { "uzst", 1, 21600, "Asia/Samarkand" }, - { "uzst", 1, 21600, "Asia/Tashkent" }, - { "uzt", 0, 18000, "Asia/Samarkand" }, - { "uzt", 0, 18000, "Asia/Tashkent" }, - { "vet", 0, -14400, "America/Caracas" }, - { "vet", 0, -16200, "America/Caracas" }, - { "vlasst", 1, 36000, "Asia/Vladivostok" }, - { "vlast", 0, 32400, "Asia/Vladivostok" }, - { "vlast", 1, 39600, "Asia/Vladivostok" }, - { "vlat", 0, 32400, "Asia/Vladivostok" }, - { "vlat", 0, 36000, "Asia/Vladivostok" }, - { "volst", 1, 14400, "Europe/Volgograd" }, - { "volst", 1, 18000, "Europe/Volgograd" }, - { "volt", 0, 10800, "Europe/Volgograd" }, - { "volt", 0, 14400, "Europe/Volgograd" }, - { "vost", 0, 21600, "Antarctica/Vostok" }, - { "vust", 1, 43200, "Pacific/Efate" }, - { "vut", 0, 39600, "Pacific/Efate" }, - { "warst", 1, -10800, "America/Mendoza" }, - { "warst", 1, -10800, "America/Argentina/Jujuy" }, - { "warst", 1, -10800, "America/Argentina/Mendoza" }, - { "warst", 1, -10800, "America/Jujuy" }, - { "wart", 0, -14400, "America/Mendoza" }, - { "wart", 0, -14400, "America/Argentina/Catamarca" }, - { "wart", 0, -14400, "America/Argentina/ComodRivadavia" }, - { "wart", 0, -14400, "America/Argentina/Cordoba" }, - { "wart", 0, -14400, "America/Argentina/Jujuy" }, - { "wart", 0, -14400, "America/Argentina/La_Rioja" }, - { "wart", 0, -14400, "America/Argentina/Mendoza" }, - { "wart", 0, -14400, "America/Argentina/Rio_Gallegos" }, - { "wart", 0, -14400, "America/Argentina/San_Juan" }, - { "wart", 0, -14400, "America/Argentina/Tucuman" }, - { "wart", 0, -14400, "America/Argentina/Ushuaia" }, - { "wart", 0, -14400, "America/Catamarca" }, - { "wart", 0, -14400, "America/Cordoba" }, - { "wart", 0, -14400, "America/Jujuy" }, - { "wart", 0, -14400, "America/Rosario" }, - { "wast", 1, 7200, "Africa/Windhoek" }, - { "wast", 1, 7200, "Africa/Ndjamena" }, - { "wat", 0, -3600, "Africa/Dakar" }, - { "wat", 0, -3600, "Africa/Bamako" }, - { "wat", 0, -3600, "Africa/Banjul" }, - { "wat", 0, -3600, "Africa/Bissau" }, - { "wat", 0, -3600, "Africa/Conakry" }, - { "wat", 0, -3600, "Africa/El_Aaiun" }, - { "wat", 0, -3600, "Africa/Freetown" }, - { "wat", 0, -3600, "Africa/Niamey" }, - { "wat", 0, -3600, "Africa/Nouakchott" }, - { "wat", 0, -3600, "Africa/Timbuktu" }, - { "wat", 0, 0, "Africa/Freetown" }, - { "wat", 0, 3600, "Africa/Brazzaville" }, - { "wat", 0, 3600, "Africa/Bangui" }, - { "wat", 0, 3600, "Africa/Douala" }, - { "wat", 0, 3600, "Africa/Lagos" }, - { "wat", 0, 3600, "Africa/Libreville" }, - { "wat", 0, 3600, "Africa/Luanda" }, - { "wat", 0, 3600, "Africa/Malabo" }, - { "wat", 0, 3600, "Africa/Ndjamena" }, - { "wat", 0, 3600, "Africa/Niamey" }, - { "wat", 0, 3600, "Africa/Porto-Novo" }, - { "wat", 0, 3600, "Africa/Windhoek" }, - { "wemt", 1, 7200, "Europe/Lisbon" }, - { "wemt", 1, 7200, "Europe/Madrid" }, - { "wemt", 1, 7200, "Europe/Monaco" }, - { "wemt", 1, 7200, "Europe/Paris" }, - { "wemt", 1, 7200, "Portugal" }, - { "wemt", 1, 7200, "WET" }, - { "west", 1, 3600, "Europe/Paris" }, - { "west", 1, 3600, "Africa/Algiers" }, - { "west", 1, 3600, "Africa/Casablanca" }, - { "west", 1, 3600, "Africa/Ceuta" }, - { "west", 1, 3600, "Atlantic/Canary" }, - { "west", 1, 3600, "Atlantic/Faeroe" }, - { "west", 1, 3600, "Atlantic/Faroe" }, - { "west", 1, 3600, "Atlantic/Madeira" }, - { "west", 1, 3600, "Europe/Brussels" }, - { "west", 1, 3600, "Europe/Lisbon" }, - { "west", 1, 3600, "Europe/Luxembourg" }, - { "west", 1, 3600, "Europe/Madrid" }, - { "west", 1, 3600, "Europe/Monaco" }, - { "west", 1, 3600, "Portugal" }, - { "west", 1, 3600, "WET" }, - { "west", 1, 7200, "Europe/Luxembourg" }, - { "wet", 0, 0, "Europe/Paris" }, - { "wet", 0, 0, "Africa/Algiers" }, - { "wet", 0, 0, "Africa/Casablanca" }, - { "wet", 0, 0, "Africa/Ceuta" }, - { "wet", 0, 0, "Africa/El_Aaiun" }, - { "wet", 0, 0, "Atlantic/Azores" }, - { "wet", 0, 0, "Atlantic/Canary" }, - { "wet", 0, 0, "Atlantic/Faeroe" }, - { "wet", 0, 0, "Atlantic/Faroe" }, - { "wet", 0, 0, "Atlantic/Madeira" }, - { "wet", 0, 0, "Europe/Brussels" }, - { "wet", 0, 0, "Europe/Lisbon" }, - { "wet", 0, 0, "Europe/Luxembourg" }, - { "wet", 0, 0, "Europe/Madrid" }, - { "wet", 0, 0, "Europe/Monaco" }, - { "wet", 0, 0, "Portugal" }, - { "wet", 0, 0, "WET" }, - { "wet", 0, 3600, "Europe/Luxembourg" }, - { "wgst", 1, -7200, "America/Godthab" }, - { "wgst", 1, -7200, "America/Danmarkshavn" }, - { "wgt", 0, -10800, "America/Godthab" }, - { "wgt", 0, -10800, "America/Danmarkshavn" }, - { "wit", 0, 25200, "Asia/Jakarta" }, - { "wit", 0, 27000, "Asia/Jakarta" }, - { "wit", 0, 28800, "Asia/Jakarta" }, - { "wit", 0, 25200, "Asia/Pontianak" }, - { "wit", 0, 27000, "Asia/Pontianak" }, - { "wit", 0, 28800, "Asia/Pontianak" }, - { "wst", 0, 28800, "Australia/Perth" }, - { "wst", 1, 32400, "Australia/Perth" }, - { "wst", 0, -39600, "Pacific/Apia" }, - { "wst", 0, 28800, "Antarctica/Casey" }, - { "wst", 0, 28800, "Australia/West" }, - { "wst", 1, 32400, "Australia/West" }, - { "yakst", 1, 32400, "Asia/Yakutsk" }, - { "yakst", 1, 36000, "Asia/Yakutsk" }, - { "yakt", 0, 28800, "Asia/Yakutsk" }, - { "yakt", 0, 32400, "Asia/Yakutsk" }, - { "yddt", 1, -25200, "America/Dawson" }, - { "yddt", 1, -25200, "America/Whitehorse" }, - { "yddt", 1, -25200, "Canada/Yukon" }, - { "ydt", 1, -28800, "America/Dawson" }, - { "ydt", 1, -28800, "America/Whitehorse" }, - { "ydt", 1, -28800, "America/Yakutat" }, - { "ydt", 1, -28800, "Canada/Yukon" }, - { "yekst", 1, 21600, "Asia/Yekaterinburg" }, - { "yekt", 0, 18000, "Asia/Yekaterinburg" }, - { "yerst", 1, 14400, "Asia/Yerevan" }, - { "yerst", 1, 18000, "Asia/Yerevan" }, - { "yert", 0, 10800, "Asia/Yerevan" }, - { "yert", 0, 14400, "Asia/Yerevan" }, - { "ypt", 1, -28800, "America/Dawson" }, - { "ypt", 1, -28800, "America/Whitehorse" }, - { "ypt", 1, -28800, "America/Yakutat" }, - { "ypt", 1, -28800, "Canada/Yukon" }, - { "yst", 0, -32400, "America/Anchorage" }, - { "yst", 0, -32400, "America/Dawson" }, - { "yst", 0, -32400, "America/Juneau" }, - { "yst", 0, -32400, "America/Nome" }, - { "yst", 0, -32400, "America/Whitehorse" }, - { "yst", 0, -32400, "America/Yakutat" }, - { "yst", 0, -32400, "Canada/Yukon" }, - { "yst", 0, -32400, "US/Alaska" }, - { "ywt", 1, -28800, "America/Dawson" }, - { "ywt", 1, -28800, "America/Whitehorse" }, - { "ywt", 1, -28800, "America/Yakutat" }, - { "ywt", 1, -28800, "Canada/Yukon" }, - { "a", 0, 3600, NULL }, - { "b", 0, 7200, NULL }, - { "c", 0, 10800, NULL }, - { "d", 0, 14400, NULL }, - { "e", 0, 18000, NULL }, - { "f", 0, 21600, NULL }, - { "g", 0, 25200, NULL }, - { "h", 0, 28800, NULL }, - { "i", 0, 32400, NULL }, - { "k", 0, 36000, NULL }, - { "l", 0, 39600, NULL }, - { "m", 0, 43200, NULL }, - { "n", 0, -3600, NULL }, - { "o", 0, -7200, NULL }, - { "p", 0, -10800, NULL }, - { "q", 0, -14400, NULL }, - { "r", 0, -18000, NULL }, - { "s", 0, -21600, NULL }, - { "t", 0, -25200, NULL }, - { "utc", 0, 0, "UTC" }, - { "u", 0, -28800, NULL }, - { "v", 0, -32400, NULL }, - { "w", 0, -36000, NULL }, - { "x", 0, -39600, NULL }, - { "y", 0, -43200, NULL }, - { "zzz", 0, 0, "Antarctica/Davis" }, - { "zzz", 0, 0, "Antarctica/DumontDUrville" }, - { "z", 0, 0, NULL }, diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c deleted file mode 100644 index 0f9dfe89acd85..0000000000000 --- a/ext/date/lib/tm2unixtime.c +++ /dev/null @@ -1,354 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -/* jan feb mrt apr may jun jul aug sep oct nov dec */ -static int month_tab_leap[12] = { -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; -static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; - -/* dec jan feb mrt apr may jun jul aug sep oct nov dec */ -static int days_in_month_leap[13] = { 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -static int days_in_month[13] = { 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - -static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b) -{ - if (*a < start) { - *a += adj; - (*b)--; - return 1; - } - if (*a >= end) { - if (start == 0) { - (*b) += (*a / end); - (*a) -= (end * (*a / end)); - return 0; - } - - *a -= adj; - (*b)++; - return 1; - } - return 0; -} - -static int do_range_limit_days(timelib_sll *y, timelib_sll *m, timelib_sll *d) -{ - timelib_sll leapyear; - timelib_sll days_this_month; - timelib_sll last_month, last_year; - timelib_sll days_last_month; - - do_range_limit(1, 13, 12, m, y); - - leapyear = timelib_is_leap(*y); - days_this_month = leapyear ? days_in_month_leap[*m] : days_in_month[*m]; - last_month = (*m) - 1; - - if (last_month < 1) { - last_month += 12; - last_year = (*y) - 1; - } else { - last_year = (*y); - } - leapyear = timelib_is_leap(last_year); - days_last_month = leapyear ? days_in_month_leap[last_month] : days_in_month[last_month]; - - if (*d <= 0) { - *d += days_last_month; - (*m)--; - return 1; - } - if (*d > days_this_month) { - *d -= days_this_month; - (*m)++; - return 1; - } - return 0; -} - -static void do_adjust_for_weekday(timelib_time* time) -{ - timelib_sll current_dow, difference; - - current_dow = timelib_day_of_week(time->y, time->m, time->d); - difference = time->relative.weekday - current_dow; - if ((time->relative.d < 0 && difference < 0) || (time->relative.d >= 0 && difference <= -time->relative.weekday_behavior)) { - difference += 7; - } - if (time->relative.weekday >= 0) { - time->d += difference; - } else { - time->d -= (7 - (abs(time->relative.weekday) - current_dow)); - } - time->have_weekday_relative = 0; -} - -static void do_normalize(timelib_time* time) -{ - do {} while (do_range_limit(0, 60, 60, &time->s, &time->i)); - do {} while (do_range_limit(0, 60, 60, &time->i, &time->h)); - do {} while (do_range_limit(0, 24, 24, &time->h, &time->d)); - do {} while (do_range_limit(1, 13, 12, &time->m, &time->y)); - - do {} while (do_range_limit_days(&time->y, &time->m, &time->d)); - do {} while (do_range_limit(1, 13, 12, &time->m, &time->y)); -} - -static void do_adjust_relative(timelib_time* time) -{ - if (time->have_weekday_relative) { - do_adjust_for_weekday(time); - } - do_normalize(time); - - if (time->have_relative) { - time->s += time->relative.s; - time->i += time->relative.i; - time->h += time->relative.h; - - time->d += time->relative.d; - time->m += time->relative.m; - time->y += time->relative.y; - } - do_normalize(time); - - memset(&(time->relative), 0, sizeof(time->relative)); - time->have_relative = 0; -} - -static void do_adjust_special_weekday(timelib_time* time) -{ - timelib_sll current_dow, count; - - count = time->special.amount; - - current_dow = timelib_day_of_week(time->y, time->m, time->d); - if (count == 0) { - /* skip over saturday and sunday */ - if (current_dow == 6) { - time->d += 2; - } - /* skip over sunday */ - if (current_dow == 0) { - time->d += 1; - } - } else if (count > 0) { - /* skip over saturday and sunday */ - if (current_dow == 5) { - time->d += 2; - } - /* skip over sunday */ - if (current_dow == 6) { - time->d += 1; - } - /* add increments of 5 weekdays as a week */ - time->d += (count / 5) * 7; - /* if current DOW plus the remainder > 5, add two days */ - current_dow = timelib_day_of_week(time->y, time->m, time->d); - time->d += (count % 5); - if ((count % 5) + current_dow > 5) { - time->d += 2; - } - } else if (count < 0) { - /* skip over sunday and saturday */ - if (current_dow == 1) { - time->d -= 2; - } - /* skip over satruday */ - if (current_dow == 0 ) { - time->d -= 1; - } - /* subtract increments of 5 weekdays as a week */ - time->d += (count / 5) * 7; - /* if current DOW minus the remainder < 0, subtract two days */ - current_dow = timelib_day_of_week(time->y, time->m, time->d); - time->d += (count % 5); - if ((count % 5) + current_dow < 1) { - time->d -= 2; - } - } -} - -static void do_adjust_special(timelib_time* time) -{ - if (time->have_special_relative) { - switch (time->special.type) { - case TIMELIB_SPECIAL_WEEKDAY: - do_adjust_special_weekday(time); - break; - } - } - do_normalize(time); - memset(&(time->special), 0, sizeof(time->special)); - time->have_relative = 0; -} - -static timelib_sll do_years(timelib_sll year) -{ - timelib_sll i; - timelib_sll res = 0; - timelib_sll eras; - - eras = (year - 1970) / 40000; - if (eras != 0) { - year = year - (eras * 40000); - res += (SECS_PER_ERA * eras * 100); - } - - if (year >= 1970) { - for (i = year - 1; i >= 1970; i--) { - if (timelib_is_leap(i)) { - res += (DAYS_PER_LYEAR * SECS_PER_DAY); - } else { - res += (DAYS_PER_YEAR * SECS_PER_DAY); - } - } - } else { - for (i = 1969; i >= year; i--) { - if (timelib_is_leap(i)) { - res -= (DAYS_PER_LYEAR * SECS_PER_DAY); - } else { - res -= (DAYS_PER_YEAR * SECS_PER_DAY); - } - } - } - return res; -} - -static timelib_sll do_months(timelib_ull month, timelib_ull year) -{ - if (timelib_is_leap(year)) { - return ((month_tab_leap[month - 1] + 1) * SECS_PER_DAY); - } else { - return ((month_tab[month - 1]) * SECS_PER_DAY); - } -} - -static timelib_sll do_days(timelib_ull day) -{ - return ((day - 1) * SECS_PER_DAY); -} - -static timelib_sll do_time(timelib_ull hour, timelib_ull minute, timelib_ull second) -{ - timelib_sll res = 0; - - res += hour * 3600; - res += minute * 60; - res += second; - return res; -} - -static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi) -{ - switch (tz->zone_type) { - case TIMELIB_ZONETYPE_OFFSET: - - tz->is_localtime = 1; - return tz->z * 60; - break; - - case TIMELIB_ZONETYPE_ABBR: { - timelib_sll tmp; - - tz->is_localtime = 1; - tmp = tz->z; - tmp -= tz->dst * 60; - tmp *= 60; - return tmp; - } - break; - - case TIMELIB_ZONETYPE_ID: - tzi = tz->tz_info; - /* Break intentionally missing */ - - default: - /* No timezone in struct, fallback to reference if possible */ - if (tzi) { - timelib_time_offset *before, *after; - timelib_sll tmp; - int in_transistion; - - tz->is_localtime = 1; - before = timelib_get_time_zone_info(tz->sse, tzi); - after = timelib_get_time_zone_info(tz->sse - before->offset, tzi); - timelib_set_timezone(tz, tzi); - - in_transistion = ( - ((tz->sse - after->offset) >= (after->transistion_time + (before->offset - after->offset))) && - ((tz->sse - after->offset) < after->transistion_time) - ); - - if ((before->offset != after->offset) && !in_transistion) { - tmp = -after->offset; - } else { - tmp = -tz->z; - } - timelib_time_offset_dtor(before); - timelib_time_offset_dtor(after); - - return tmp; - } - } - return 0; -} - -void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi) -{ - timelib_sll res = 0; - - do_adjust_relative(time); - do_adjust_special(time); - res += do_years(time->y); - res += do_months(time->m, time->y); - res += do_days(time->d); - res += do_time(time->h, time->i, time->s); - time->sse = res; - - res += do_adjust_timezone(time, tzi); - time->sse = res; - - time->sse_uptodate = 1; -} - -#if 0 -int main(void) -{ - timelib_sll res; - timelib_time time; - - time = timelib_strtotime("10 Feb 2005 06:07:03 PM CET"); /* 1108055223 */ - printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d", - time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst); - if (time.have_relative) { - printf ("%3dY %3dM %3dD / %3dH %3dM %3dS", - time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s); - } - if (time.have_weekday_relative) { - printf (" / %d", time.relative.weekday); - } - res = time2unixtime(&time); - printf("%Ld\n", res); - - return 0; -} -#endif diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c deleted file mode 100644 index 3dabea82ba3b6..0000000000000 --- a/ext/date/lib/unixtime2tm.c +++ /dev/null @@ -1,259 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "timelib.h" - -#include - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#else -#include -#endif - -static int month_tab_leap[12] = { -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; -static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; - - -/* Converts a Unix timestamp value into broken down time, in GMT */ -void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts) -{ - timelib_sll days, remainder, tmp_days; - timelib_sll cur_year = 1970; - timelib_sll i; - timelib_sll hours, minutes, seconds; - int *months; - - days = ts / SECS_PER_DAY; - remainder = ts - (days * SECS_PER_DAY); - if (ts < 0 && remainder == 0) { - days++; - remainder -= SECS_PER_DAY; - } - DEBUG(printf("days=%lld, rem=%lld\n", days, remainder);); - - if (ts >= 0) { - tmp_days = days + 1; - while (tmp_days >= DAYS_PER_LYEAR) { - cur_year++; - if (timelib_is_leap(cur_year)) { - tmp_days -= DAYS_PER_LYEAR; - } else { - tmp_days -= DAYS_PER_YEAR; - } - } - } else { - tmp_days = days; - - /* Guess why this might be for, it has to do with a pope ;-). It's also - * only valid for Great Brittain and it's colonies. It needs fixing for - * other locales. *sigh*, why is this crap so complex! */ - /* - if (ts <= TIMELIB_LL_CONST(-6857352000)) { - tmp_days -= 11; - } - */ - - while (tmp_days <= 0) { - if (tmp_days < -1460970) { - cur_year -= 4000; - DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year);); - tmp_days += 1460970; - } else { - cur_year--; - DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year);); - if (timelib_is_leap(cur_year)) { - tmp_days += DAYS_PER_LYEAR; - } else { - tmp_days += DAYS_PER_YEAR; - } - } - } - remainder += SECS_PER_DAY; - } - DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year);); - - months = timelib_is_leap(cur_year) ? month_tab_leap : month_tab; - if (timelib_is_leap(cur_year) && cur_year < 1970) { - tmp_days--; - } - i = 11; - while (i > 0) { - DEBUG(printf("month=%lld (%d)\n", i, months[i]);); - if (tmp_days > months[i]) { - break; - } - i--; - } - DEBUG(printf("A: ts=%lld, year=%lld, month=%lld, day=%lld,", ts, cur_year, i + 1, tmp_days - months[i]);); - - /* That was the date, now we do the tiiiime */ - hours = remainder / 3600; - minutes = (remainder - hours * 3600) / 60; - seconds = remainder % 60; - DEBUG(printf(" hour=%lld, minute=%lld, second=%lld\n", hours, minutes, seconds);); - - tm->y = cur_year; - tm->m = i + 1; - tm->d = tmp_days - months[i]; - tm->h = hours; - tm->i = minutes; - tm->s = seconds; - tm->z = 0; - tm->dst = 0; - tm->sse = ts; - tm->sse_uptodate = 1; - tm->tim_uptodate = 1; - tm->is_localtime = 0; -} - -void timelib_update_from_sse(timelib_time *tm) -{ - timelib_sll sse; - - sse = tm->sse; - - switch (tm->zone_type) { - case TIMELIB_ZONETYPE_ABBR: - case TIMELIB_ZONETYPE_OFFSET: { - int z = tm->z; - signed int dst = tm->dst; - - timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60)); - - tm->z = z; - tm->dst = dst; - goto cleanup; - } - - case TIMELIB_ZONETYPE_ID: { - timelib_time_offset *gmt_offset; - - gmt_offset = timelib_get_time_zone_info(tm->sse, tm->tz_info); - timelib_unixtime2gmt(tm, tm->sse + gmt_offset->offset); - timelib_time_offset_dtor(gmt_offset); - - goto cleanup; - } - - default: - timelib_unixtime2gmt(tm, tm->sse); - goto cleanup; - } -cleanup: - tm->sse = sse; - tm->is_localtime = 1; - tm->have_zone = 1; -} - -void timelib_unixtime2local(timelib_time *tm, timelib_sll ts) -{ - timelib_time_offset *gmt_offset; - timelib_tzinfo *tz = tm->tz_info; - - switch (tm->zone_type) { - case TIMELIB_ZONETYPE_ABBR: - case TIMELIB_ZONETYPE_OFFSET: { - int z = tm->z; - signed int dst = tm->dst; - - timelib_unixtime2gmt(tm, ts - (tm->z * 60)); - - tm->z = z; - tm->dst = dst; - break; - } - - case TIMELIB_ZONETYPE_ID: - gmt_offset = timelib_get_time_zone_info(ts, tz); - timelib_unixtime2gmt(tm, ts + gmt_offset->offset); - - /* we need to reset the sse here as unixtime2gmt modifies it */ - tm->sse = ts; - tm->dst = gmt_offset->is_dst; - tm->z = gmt_offset->offset; - tm->tz_info = tz; - - timelib_time_tz_abbr_update(tm, gmt_offset->abbr); - timelib_time_offset_dtor(gmt_offset); - break; - - default: - tm->is_localtime = 0; - tm->have_zone = 0; - return; - } - - tm->is_localtime = 1; - tm->have_zone = 1; -} - -void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz) -{ - timelib_time_offset *gmt_offset; - - gmt_offset = timelib_get_time_zone_info(t->sse, tz); - t->z = gmt_offset->offset; -/* - if (t->dst != gmt_offset->is_dst) { - printf("ERROR (%d, %d)\n", t->dst, gmt_offset->is_dst); - exit(1); - } -*/ - t->dst = gmt_offset->is_dst; - t->tz_info = tz; - if (t->tz_abbr) { - free(t->tz_abbr); - } - t->tz_abbr = strdup(gmt_offset->abbr); - timelib_time_offset_dtor(gmt_offset); - - t->have_zone = 1; - t->zone_type = TIMELIB_ZONETYPE_ID; -} - -/* Converts the time stored in the struct to localtime if localtime = true, - * otherwise it converts it to gmttime. This is only done when necessary - * ofcourse. */ -int timelib_apply_localtime(timelib_time *t, unsigned int localtime) -{ - if (localtime) { - /* Converting from GMT time to local time */ - DEBUG(printf("Converting from GMT time to local time\n");); - - /* Check if TZ is set */ - if (!t->tz_info) { - DEBUG(printf("E: No timezone configured, can't switch to local time\n");); - return -1; - } - - timelib_unixtime2local(t, t->sse); - } else { - /* Converting from local time to GMT time */ - DEBUG(printf("Converting from local time to GMT time\n");); - - timelib_unixtime2gmt(t, t->sse); - } - return 0; -} diff --git a/ext/date/php_date.c b/ext/date/php_date.c deleted file mode 100644 index 43dd74e2fbe96..0000000000000 --- a/ext/date/php_date.c +++ /dev/null @@ -1,2599 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_streams.h" -#include "php_main.h" -#include "php_globals.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/standard/php_versioning.h" -#include "ext/standard/php_math.h" -#include "php_date.h" -#include "lib/timelib.h" -#include - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1) - ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(0, timestamp) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_gmdate, 0, 0, 1) - ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(0, timestamp) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_idate, 0, 0, 1) - ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(0, timestamp) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_strtotime, 0, 0, 1) - ZEND_ARG_INFO(0, time) - ZEND_ARG_INFO(0, now) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_mktime, 0, 0, 0) - ZEND_ARG_INFO(0, hour) - ZEND_ARG_INFO(0, min) - ZEND_ARG_INFO(0, sec) - ZEND_ARG_INFO(0, mon) - ZEND_ARG_INFO(0, day) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_gmmktime, 0, 0, 0) - ZEND_ARG_INFO(0, hour) - ZEND_ARG_INFO(0, min) - ZEND_ARG_INFO(0, sec) - ZEND_ARG_INFO(0, mon) - ZEND_ARG_INFO(0, day) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_checkdate, 0) - ZEND_ARG_INFO(0, month) - ZEND_ARG_INFO(0, day) - ZEND_ARG_INFO(0, year) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_strftime, 0, 0, 1) - ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(0, timestamp) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_gmstrftime, 0, 0, 1) - ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(0, timestamp) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_time, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_localtime, 0, 0, 0) - ZEND_ARG_INFO(0, timestamp) - ZEND_ARG_INFO(0, associative_array) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_getdate, 0, 0, 0) - ZEND_ARG_INFO(0, timestamp) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_date_default_timezone_set, 0) - ZEND_ARG_INFO(0, timezone_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_date_default_timezone_get, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_date_sunrise, 0, 0, 1) - ZEND_ARG_INFO(0, time) - ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(0, latitude) - ZEND_ARG_INFO(0, longitude) - ZEND_ARG_INFO(0, zenith) - ZEND_ARG_INFO(0, gmt_offset) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_date_sunset, 0, 0, 1) - ZEND_ARG_INFO(0, time) - ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(0, latitude) - ZEND_ARG_INFO(0, longitude) - ZEND_ARG_INFO(0, zenith) - ZEND_ARG_INFO(0, gmt_offset) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_date_sun_info, 0) - ZEND_ARG_INFO(0, time) - ZEND_ARG_INFO(0, latitude) - ZEND_ARG_INFO(0, longitude) -ZEND_END_ARG_INFO() - -/* }}} */ - -/* {{{ Function table */ -zend_function_entry date_functions[] = { - PHP_FE(strtotime, arginfo_strtotime) - PHP_FE(date, arginfo_date) - PHP_FE(idate, arginfo_idate) - PHP_FE(gmdate, arginfo_gmdate) - PHP_FE(mktime, arginfo_mktime) - PHP_FE(gmmktime, arginfo_gmmktime) - PHP_FE(checkdate, arginfo_checkdate) - -#ifdef HAVE_STRFTIME - PHP_FE(strftime, arginfo_strftime) - PHP_FE(gmstrftime, arginfo_gmstrftime) -#endif - - PHP_FE(time, arginfo_time) - PHP_FE(localtime, arginfo_localtime) - PHP_FE(getdate, arginfo_getdate) - - /* Advanced Interface */ - PHP_FE(date_create, NULL) - PHP_FE(date_parse, NULL) - PHP_FE(date_format, NULL) - PHP_FE(date_modify, NULL) - PHP_FE(date_timezone_get, NULL) - PHP_FE(date_timezone_set, NULL) - PHP_FE(date_offset_get, NULL) - - PHP_FE(date_time_set, NULL) - PHP_FE(date_date_set, NULL) - PHP_FE(date_isodate_set, NULL) - - PHP_FE(timezone_open, NULL) - PHP_FE(timezone_name_get, NULL) - PHP_FE(timezone_name_from_abbr, NULL) - PHP_FE(timezone_offset_get, NULL) - PHP_FE(timezone_transitions_get, NULL) - PHP_FE(timezone_identifiers_list, NULL) - PHP_FE(timezone_abbreviations_list, NULL) - - /* Options and Configuration */ - PHP_FE(date_default_timezone_set, arginfo_date_default_timezone_set) - PHP_FE(date_default_timezone_get, arginfo_date_default_timezone_get) - - /* Astronomical functions */ - PHP_FE(date_sunrise, arginfo_date_sunrise) - PHP_FE(date_sunset, arginfo_date_sunset) - PHP_FE(date_sun_info, arginfo_date_sun_info) - {NULL, NULL, NULL} -}; - -zend_function_entry date_funcs_date[] = { - PHP_ME(DateTime, __construct, NULL, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(format, date_format, NULL, 0) - PHP_ME_MAPPING(modify, date_modify, NULL, 0) - PHP_ME_MAPPING(getTimezone, date_timezone_get, NULL, 0) - PHP_ME_MAPPING(setTimezone, date_timezone_set, NULL, 0) - PHP_ME_MAPPING(getOffset, date_offset_get, NULL, 0) - PHP_ME_MAPPING(setTime, date_time_set, NULL, 0) - PHP_ME_MAPPING(setDate, date_date_set, NULL, 0) - PHP_ME_MAPPING(setISODate, date_isodate_set, NULL, 0) - {NULL, NULL, NULL} -}; - -zend_function_entry date_funcs_timezone[] = { - PHP_ME(DateTimeZone, __construct, NULL, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME_MAPPING(getName, timezone_name_get, NULL, 0) - PHP_ME_MAPPING(getOffset, timezone_offset_get, NULL, 0) - PHP_ME_MAPPING(getTransitions, timezone_transitions_get, NULL, 0) - PHP_ME_MAPPING(listAbbreviations, timezone_abbreviations_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME_MAPPING(listIdentifiers, timezone_identifiers_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - {NULL, NULL, NULL} -}; - -static void date_register_classes(TSRMLS_D); -static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC); -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(date) -static PHP_GINIT_FUNCTION(date); - -/* True global */ -timelib_tzdb *php_date_global_timezone_db; -int php_date_global_timezone_db_enabled; - -#define DATE_DEFAULT_LATITUDE "31.7667" -#define DATE_DEFAULT_LONGITUDE "35.2333" - -/* on 90'35; common sunset declaration (start of sun body appear) */ -#define DATE_SUNSET_ZENITH "90.583333" - -/* on 90'35; common sunrise declaration (sun body disappeared) */ -#define DATE_SUNRISE_ZENITH "90.583333" - -/* {{{ INI Settings */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdateString, default_timezone, zend_date_globals, date_globals) - PHP_INI_ENTRY("date.default_latitude", DATE_DEFAULT_LATITUDE, PHP_INI_ALL, NULL) - PHP_INI_ENTRY("date.default_longitude", DATE_DEFAULT_LONGITUDE, PHP_INI_ALL, NULL) - PHP_INI_ENTRY("date.sunset_zenith", DATE_SUNSET_ZENITH, PHP_INI_ALL, NULL) - PHP_INI_ENTRY("date.sunrise_zenith", DATE_SUNRISE_ZENITH, PHP_INI_ALL, NULL) -PHP_INI_END() -/* }}} */ - -zend_class_entry *date_ce_date, *date_ce_timezone; - -static zend_object_handlers date_object_handlers_date; -static zend_object_handlers date_object_handlers_timezone; - -typedef struct _php_date_obj php_date_obj; -typedef struct _php_timezone_obj php_timezone_obj; - -struct _php_date_obj { - zend_object std; - timelib_time *time; -}; - -struct _php_timezone_obj { - zend_object std; - int initialized; - int type; - union { - timelib_tzinfo *tz; /* TIMELIB_ZONETYPE_ID; */ - timelib_sll utc_offset; /* TIMELIB_ZONETYPE_OFFSET */ - struct /* TIMELIB_ZONETYPE_ABBR */ - { - timelib_sll utc_offset; - char *abbr; - int dst; - } z; - } tzi; -}; - -#define DATE_SET_CONTEXT \ - zval *object; \ - object = getThis(); \ - -#define DATE_FETCH_OBJECT \ - php_date_obj *obj; \ - DATE_SET_CONTEXT; \ - if (object) { \ - if (ZEND_NUM_ARGS()) { \ - WRONG_PARAM_COUNT; \ - } \ - } else { \ - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, date_ce_date) == FAILURE) { \ - RETURN_FALSE; \ - } \ - } \ - obj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); \ - -#define DATE_CHECK_INITIALIZED(member, class_name) \ - if (!(member)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The " #class_name " object has not been correctly initialized by its constructor"); \ - RETURN_FALSE; \ - } - -static void date_object_free_storage_date(void *object TSRMLS_DC); -static void date_object_free_storage_timezone(void *object TSRMLS_DC); -static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); -static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); -static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC); -static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC); -static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC); - -/* This is need to ensure that session extension request shutdown occurs 1st, because it uses the date extension */ -static zend_module_dep date_deps[] = { - ZEND_MOD_OPTIONAL("session") - {NULL, NULL, NULL} -}; - -/* {{{ Module struct */ -zend_module_entry date_module_entry = { - STANDARD_MODULE_HEADER_EX, - NULL, - date_deps, - "date", /* extension name */ - date_functions, /* function list */ - PHP_MINIT(date), /* process startup */ - PHP_MSHUTDOWN(date), /* process shutdown */ - PHP_RINIT(date), /* request startup */ - PHP_RSHUTDOWN(date), /* request shutdown */ - PHP_MINFO(date), /* extension info */ - PHP_VERSION, /* extension version */ - PHP_MODULE_GLOBALS(date), /* globals descriptor */ - PHP_GINIT(date), /* globals ctor */ - NULL, /* globals dtor */ - NULL, /* post deactivate */ - STANDARD_MODULE_PROPERTIES_EX -}; -/* }}} */ - - -/* {{{ PHP_GINIT_FUNCTION */ -static PHP_GINIT_FUNCTION(date) -{ - date_globals->default_timezone = NULL; - date_globals->timezone = NULL; -} -/* }}} */ - - -static void _php_date_tzinfo_dtor(void *tzinfo) -{ - timelib_tzinfo **tzi = (timelib_tzinfo **)tzinfo; - - timelib_tzinfo_dtor(*tzi); -} - -/* {{{ PHP_RINIT_FUNCTION */ -PHP_RINIT_FUNCTION(date) -{ - if (DATEG(timezone)) { - efree(DATEG(timezone)); - } - DATEG(timezone) = NULL; - zend_hash_init(&DATEG(tzcache), 4, NULL, _php_date_tzinfo_dtor, 0); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION */ -PHP_RSHUTDOWN_FUNCTION(date) -{ - if (DATEG(timezone)) { - efree(DATEG(timezone)); - } - DATEG(timezone) = NULL; - zend_hash_destroy(&DATEG(tzcache)); - - return SUCCESS; -} -/* }}} */ - -#define DATE_TIMEZONEDB php_date_global_timezone_db ? php_date_global_timezone_db : timelib_builtin_db() - -/* - * RFC822, Section 5.1: http://www.ietf.org/rfc/rfc822.txt - * date-time = [ day "," ] date time ; dd mm yy hh:mm:ss zzz - * day = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun" - * date = 1*2DIGIT month 2DIGIT ; day month year e.g. 20 Jun 82 - * month = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec" - * time = hour zone ; ANSI and Military - * hour = 2DIGIT ":" 2DIGIT [":" 2DIGIT] ; 00:00:00 - 23:59:59 - * zone = "UT" / "GMT" / "EST" / "EDT" / "CST" / "CDT" / "MST" / "MDT" / "PST" / "PDT" / 1ALPHA / ( ("+" / "-") 4DIGIT ) - */ -#define DATE_FORMAT_RFC822 "D, d M y H:i:s O" - -/* - * RFC850, Section 2.1.4: http://www.ietf.org/rfc/rfc850.txt - * Format must be acceptable both to the ARPANET and to the getdate routine. - * One format that is acceptable to both is Weekday, DD-Mon-YY HH:MM:SS TIMEZONE - * TIMEZONE can be any timezone name (3 or more letters) - */ -#define DATE_FORMAT_RFC850 "l, d-M-y H:i:s T" - -/* - * RFC1036, Section 2.1.2: http://www.ietf.org/rfc/rfc1036.txt - * Its format must be acceptable both in RFC-822 and to the getdate(3) - * Wdy, DD Mon YY HH:MM:SS TIMEZONE - * There is no hope of having a complete list of timezones. Universal - * Time (GMT), the North American timezones (PST, PDT, MST, MDT, CST, - * CDT, EST, EDT) and the +/-hhmm offset specifed in RFC-822 should be supported. - */ -#define DATE_FORMAT_RFC1036 "D, d M y H:i:s O" - -/* - * RFC1123, Section 5.2.14: http://www.ietf.org/rfc/rfc1123.txt - * RFC-822 Date and Time Specification: RFC-822 Section 5 - * The syntax for the date is hereby changed to: date = 1*2DIGIT month 2*4DIGIT - */ -#define DATE_FORMAT_RFC1123 "D, d M Y H:i:s O" - -/* - * RFC2822, Section 3.3: http://www.ietf.org/rfc/rfc2822.txt - * FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space - * CFWS = *([FWS] comment) (([FWS] comment) / FWS) - * - * date-time = [ day-of-week "," ] date FWS time [CFWS] - * day-of-week = ([FWS] day-name) - * day-name = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun" - * date = day month year - * year = 4*DIGIT - * month = (FWS month-name FWS) - * month-name = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec" - * day = ([FWS] 1*2DIGIT) - * time = time-of-day FWS zone - * time-of-day = hour ":" minute [ ":" second ] - * hour = 2DIGIT - * minute = 2DIGIT - * second = 2DIGIT - * zone = (( "+" / "-" ) 4DIGIT) - */ -#define DATE_FORMAT_RFC2822 "D, d M Y H:i:s O" -/* - * RFC3339, Section 5.6: http://www.ietf.org/rfc/rfc3339.txt - * date-fullyear = 4DIGIT - * date-month = 2DIGIT ; 01-12 - * date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on month/year - * - * time-hour = 2DIGIT ; 00-23 - * time-minute = 2DIGIT ; 00-59 - * time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second rules - * - * time-secfrac = "." 1*DIGIT - * time-numoffset = ("+" / "-") time-hour ":" time-minute - * time-offset = "Z" / time-numoffset - * - * partial-time = time-hour ":" time-minute ":" time-second [time-secfrac] - * full-date = date-fullyear "-" date-month "-" date-mday - * full-time = partial-time time-offset - * - * date-time = full-date "T" full-time - */ -#define DATE_FORMAT_RFC3339 "Y-m-d\\TH:i:sP" - -#define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sO" - -#define DATE_TZ_ERRMSG \ - "It is not safe to rely on the system's timezone settings. Please use " \ - "the date.timezone setting, the TZ environment variable or the " \ - "date_default_timezone_set() function. In case you used any of those " \ - "methods and you are still getting this warning, you most likely " \ - "misspelled the timezone identifier. " - -#define SUNFUNCS_RET_TIMESTAMP 0 -#define SUNFUNCS_RET_STRING 1 -#define SUNFUNCS_RET_DOUBLE 2 - - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(date) -{ - REGISTER_INI_ENTRIES(); - date_register_classes(TSRMLS_C); -/* - * RFC4287, Section 3.3: http://www.ietf.org/rfc/rfc4287.txt - * A Date construct is an element whose content MUST conform to the - * "date-time" production in [RFC3339]. In addition, an uppercase "T" - * character MUST be used to separate date and time, and an uppercase - * "Z" character MUST be present in the absence of a numeric time zone offset. - */ - REGISTER_STRING_CONSTANT("DATE_ATOM", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT); -/* - * Preliminary specification: http://wp.netscape.com/newsref/std/cookie_spec.html - * "This is based on RFC 822, RFC 850, RFC 1036, and RFC 1123, - * with the variations that the only legal time zone is GMT - * and the separators between the elements of the date must be dashes." - */ - REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC822, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC1036", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC1123", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC2822", DATE_FORMAT_RFC2822, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_RFC3339", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT); -/* - * RSS 2.0 Specification: http://blogs.law.harvard.edu/tech/rss - * "All date-times in RSS conform to the Date and Time Specification of RFC 822, - * with the exception that the year may be expressed with two characters or four characters (four preferred)" - */ - REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("DATE_W3C", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SUNFUNCS_RET_TIMESTAMP", SUNFUNCS_RET_TIMESTAMP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SUNFUNCS_RET_STRING", SUNFUNCS_RET_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SUNFUNCS_RET_DOUBLE", SUNFUNCS_RET_DOUBLE, CONST_CS | CONST_PERSISTENT); - - php_date_global_timezone_db = NULL; - php_date_global_timezone_db_enabled = 0; - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(date) -{ - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION(date) -{ - const timelib_tzdb *tzdb = DATE_TIMEZONEDB; - - php_info_print_table_start(); - php_info_print_table_row(2, "date/time support", "enabled"); - php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version); - php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal"); - php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb TSRMLS_CC)); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* {{{ Timezone Cache functions */ -static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_tzdb *tzdb TSRMLS_DC) -{ - timelib_tzinfo *tzi, **ptzi; - - if (zend_hash_find(&DATEG(tzcache), formal_tzname, strlen(formal_tzname) + 1, (void **) &ptzi) == SUCCESS) { - return *ptzi; - } - - tzi = timelib_parse_tzfile(formal_tzname, tzdb); - if (tzi) { - zend_hash_add(&DATEG(tzcache), formal_tzname, strlen(formal_tzname) + 1, (void *) &tzi, sizeof(timelib_tzinfo*), NULL); - } - return tzi; -} -/* }}} */ - -/* {{{ Helper functions */ -static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC) -{ - char *env; - - /* Checking configure timezone */ - if (DATEG(timezone) && (strlen(DATEG(timezone)) > 0)) { - return DATEG(timezone); - } - /* Check environment variable */ - env = getenv("TZ"); - if (env && *env && timelib_timezone_id_is_valid(env, tzdb)) { - return env; - } - /* Check config setting for default timezone */ - if (DATEG(default_timezone) && (strlen(DATEG(default_timezone)) > 0) && timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) { - return DATEG(default_timezone); - } -#if HAVE_TM_ZONE - /* Try to guess timezone from system information */ - { - struct tm *ta, tmbuf; - time_t the_time; - char *tzid = NULL; - - the_time = time(NULL); - ta = php_localtime_r(&the_time, &tmbuf); - if (ta) { - tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst); - } - if (! tzid) { - tzid = "UTC"; - } - - php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%s/%.1f/%s' instead", tzid, ta ? ta->tm_zone : "Unknown", ta ? (float) (ta->tm_gmtoff / 3600) : 0, ta ? (ta->tm_isdst ? "DST" : "no DST") : "Unknown"); - return tzid; - } -#endif -#ifdef PHP_WIN32 - { - char *tzid; - TIME_ZONE_INFORMATION tzi; - - switch (GetTimeZoneInformation(&tzi)) - { - /* no DST or not in effect */ - case TIME_ZONE_ID_UNKNOWN: - case TIME_ZONE_ID_STANDARD: -php_win_std_time: - tzid = timelib_timezone_id_from_abbr("", (tzi.Bias + tzi.StandardBias) * -60, 0); - if (! tzid) { - tzid = "UTC"; - } - php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/no DST' instead", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0)); - break; - - /* DST in effect */ - case TIME_ZONE_ID_DAYLIGHT: - /* If user has disabled DST in the control panel, Windows returns 0 here */ - if (tzi.DaylightBias == 0) { - goto php_win_std_time; - } - - tzid = timelib_timezone_id_from_abbr("", (tzi.Bias + tzi.DaylightBias) * -60, 1); - if (! tzid) { - tzid = "UTC"; - } - php_error_docref(NULL TSRMLS_CC, E_STRICT, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/DST' instead", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0)); - break; - } - return tzid; - } -#elif defined(NETWARE) - /* Try to guess timezone from system information */ - { - char *tzid = timelib_timezone_id_from_abbr("", ((_timezone * -1) + (daylightOffset * daylightOnOff)), daylightOnOff); - if (tzid) { - return tzid; - } - } -#endif - /* Fallback to UTC */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm"); - return "UTC"; -} - -PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D) -{ - char *tz; - timelib_tzinfo *tzi; - - tz = guess_timezone(DATE_TIMEZONEDB TSRMLS_CC); - tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC); - if (! tzi) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone database is corrupt - this should *never* happen!"); - } - return tzi; -} -/* }}} */ - - -/* {{{ date() and gmdate() data */ -#include "ext/standard/php_smart_str.h" - -static char *mon_full_names[] = { - "January", "February", "March", "April", - "May", "June", "July", "August", - "September", "October", "November", "December" -}; - -static char *mon_short_names[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" -}; - -static char *day_full_names[] = { - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" -}; - -static char *day_short_names[] = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" -}; - -static char *english_suffix(timelib_sll number) -{ - if (number >= 10 && number <= 19) { - return "th"; - } else { - switch (number % 10) { - case 1: return "st"; - case 2: return "nd"; - case 3: return "rd"; - } - } - return "th"; -} -/* }}} */ - -/* {{{ day of week helpers */ -char *php_date_full_day_name(timelib_sll y, timelib_sll m, timelib_sll d) -{ - timelib_sll day_of_week = timelib_day_of_week(y, m, d); - if (day_of_week < 0) { - return "Unknown"; - } - return day_full_names[day_of_week]; -} - -char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d) -{ - timelib_sll day_of_week = timelib_day_of_week(y, m, d); - if (day_of_week < 0) { - return "Unknown"; - } - return day_short_names[day_of_week]; -} -/* }}} */ - -/* {{{ date_format - (gm)date helper */ -static char *date_format(char *format, int format_len, timelib_time *t, int localtime) -{ - smart_str string = {0}; - int i, length; - char buffer[33]; - timelib_time_offset *offset = NULL; - timelib_sll isoweek, isoyear; - int rfc_colon; - - if (!format_len) { - return estrdup(""); - } - - if (localtime) { - if (t->zone_type == TIMELIB_ZONETYPE_ABBR) { - offset = timelib_time_offset_ctor(); - offset->offset = (t->z - (t->dst * 60)) * -60; - offset->leap_secs = 0; - offset->is_dst = t->dst; - offset->abbr = strdup(t->tz_abbr); - } else if (t->zone_type == TIMELIB_ZONETYPE_OFFSET) { - offset = timelib_time_offset_ctor(); - offset->offset = (t->z) * -60; - offset->leap_secs = 0; - offset->is_dst = 0; - offset->abbr = malloc(9); /* GMT±xxxx\0 */ - snprintf(offset->abbr, 9, "GMT%c%02d%02d", - localtime ? ((offset->offset < 0) ? '-' : '+') : '+', - localtime ? abs(offset->offset / 3600) : 0, - localtime ? abs((offset->offset % 3600) / 60) : 0 ); - } else { - offset = timelib_get_time_zone_info(t->sse, t->tz_info); - } - } - timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); - - for (i = 0; i < format_len; i++) { - rfc_colon = 0; - switch (format[i]) { - /* day */ - case 'd': length = slprintf(buffer, 32, "%02d", (int) t->d); break; - case 'D': length = slprintf(buffer, 32, "%s", php_date_short_day_name(t->y, t->m, t->d)); break; - case 'j': length = slprintf(buffer, 32, "%d", (int) t->d); break; - case 'l': length = slprintf(buffer, 32, "%s", php_date_full_day_name(t->y, t->m, t->d)); break; - case 'S': length = slprintf(buffer, 32, "%s", english_suffix(t->d)); break; - case 'w': length = slprintf(buffer, 32, "%d", (int) timelib_day_of_week(t->y, t->m, t->d)); break; - case 'N': length = slprintf(buffer, 32, "%d", (int) timelib_iso_day_of_week(t->y, t->m, t->d)); break; - case 'z': length = slprintf(buffer, 32, "%d", (int) timelib_day_of_year(t->y, t->m, t->d)); break; - - /* week */ - case 'W': length = slprintf(buffer, 32, "%02d", (int) isoweek); break; /* iso weeknr */ - case 'o': length = slprintf(buffer, 32, "%d", (int) isoyear); break; /* iso year */ - - /* month */ - case 'F': length = slprintf(buffer, 32, "%s", mon_full_names[t->m - 1]); break; - case 'm': length = slprintf(buffer, 32, "%02d", (int) t->m); break; - case 'M': length = slprintf(buffer, 32, "%s", mon_short_names[t->m - 1]); break; - case 'n': length = slprintf(buffer, 32, "%d", (int) t->m); break; - case 't': length = slprintf(buffer, 32, "%d", (int) timelib_days_in_month(t->y, t->m)); break; - - /* year */ - case 'L': length = slprintf(buffer, 32, "%d", timelib_is_leap((int) t->y)); break; - case 'y': length = slprintf(buffer, 32, "%02d", (int) t->y % 100); break; - case 'Y': length = slprintf(buffer, 32, "%s%04d", t->y < 0 ? "-" : "", abs((int) t->y)); break; - - /* time */ - case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break; - case 'A': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "PM" : "AM"); break; - case 'B': { - int retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864); - while (retval < 0) { - retval += 1000; - } - retval = retval % 1000; - length = slprintf(buffer, 32, "%03d", retval); - break; - } - case 'g': length = slprintf(buffer, 32, "%d", (t->h % 12) ? (int) t->h % 12 : 12); break; - case 'G': length = slprintf(buffer, 32, "%d", (int) t->h); break; - case 'h': length = slprintf(buffer, 32, "%02d", (t->h % 12) ? (int) t->h % 12 : 12); break; - case 'H': length = slprintf(buffer, 32, "%02d", (int) t->h); break; - case 'i': length = slprintf(buffer, 32, "%02d", (int) t->i); break; - case 's': length = slprintf(buffer, 32, "%02d", (int) t->s); break; - case 'u': length = slprintf(buffer, 32, "%06d", (int) floor(t->f * 1000000)); break; - - /* timezone */ - case 'I': length = slprintf(buffer, 32, "%d", localtime ? offset->is_dst : 0); break; - case 'P': rfc_colon = 1; /* break intentionally missing */ - case 'O': length = slprintf(buffer, 32, "%c%02d%s%02d", - localtime ? ((offset->offset < 0) ? '-' : '+') : '+', - localtime ? abs(offset->offset / 3600) : 0, - rfc_colon ? ":" : "", - localtime ? abs((offset->offset % 3600) / 60) : 0 - ); - break; - case 'T': length = slprintf(buffer, 32, "%s", localtime ? offset->abbr : "GMT"); break; - case 'e': if (!localtime) { - length = slprintf(buffer, 32, "%s", "UTC"); - } else { - switch (t->zone_type) { - case TIMELIB_ZONETYPE_ID: - length = slprintf(buffer, 32, "%s", t->tz_info->name); - break; - case TIMELIB_ZONETYPE_ABBR: - length = slprintf(buffer, 32, "%s", offset->abbr); - break; - case TIMELIB_ZONETYPE_OFFSET: - length = slprintf(buffer, 32, "%c%02d:%02d", - ((offset->offset < 0) ? '-' : '+'), - abs(offset->offset / 3600), - abs((offset->offset % 3600) / 60) - ); - break; - } - } - break; - case 'Z': length = slprintf(buffer, 32, "%d", localtime ? offset->offset : 0); break; - - /* full date/time */ - case 'c': length = slprintf(buffer, 32, "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d", - (int) t->y, (int) t->m, (int) t->d, - (int) t->h, (int) t->i, (int) t->s, - localtime ? ((offset->offset < 0) ? '-' : '+') : '+', - localtime ? abs(offset->offset / 3600) : 0, - localtime ? abs((offset->offset % 3600) / 60) : 0 - ); - break; - case 'r': length = slprintf(buffer, 32, "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d", - php_date_short_day_name(t->y, t->m, t->d), - (int) t->d, mon_short_names[t->m - 1], - (int) t->y, (int) t->h, (int) t->i, (int) t->s, - localtime ? ((offset->offset < 0) ? '-' : '+') : '+', - localtime ? abs(offset->offset / 3600) : 0, - localtime ? abs((offset->offset % 3600) / 60) : 0 - ); - break; - case 'U': length = slprintf(buffer, 32, "%lld", (timelib_sll) t->sse); break; - - case '\\': if (i < format_len) i++; /* break intentionally missing */ - - default: buffer[0] = format[i]; buffer[1] = '\0'; length = 1; break; - } - smart_str_appendl(&string, buffer, length); - } - - smart_str_0(&string); - - if (localtime) { - timelib_time_offset_dtor(offset); - } - - return string.c; -} - -static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) -{ - char *format; - int format_len; - long ts; - char *string; - - if (ZEND_NUM_ARGS() == 1) { - ts = time(NULL); - } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) { - RETURN_FALSE; - } - - string = php_format_date(format, format_len, ts, localtime TSRMLS_CC); - - RETVAL_STRING(string, 0); -} -/* }}} */ - -PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */ -{ - timelib_time *t; - timelib_tzinfo *tzi; - char *string; - - t = timelib_time_ctor(); - - if (localtime) { - tzi = get_timezone_info(TSRMLS_C); - t->tz_info = tzi; - t->zone_type = TIMELIB_ZONETYPE_ID; - timelib_unixtime2local(t, ts); - } else { - tzi = NULL; - timelib_unixtime2gmt(t, ts); - } - - string = date_format(format, format_len, t, localtime); - - timelib_time_dtor(t); - return string; -} -/* }}} */ - -/* {{{ php_idate - */ -PHPAPI int php_idate(char format, time_t ts, int localtime) -{ - timelib_time *t; - timelib_tzinfo *tzi; - int retval = -1; - timelib_time_offset *offset = NULL; - timelib_sll isoweek, isoyear; - - t = timelib_time_ctor(); - - if (!localtime) { - TSRMLS_FETCH(); - tzi = get_timezone_info(TSRMLS_C); - t->tz_info = tzi; - t->zone_type = TIMELIB_ZONETYPE_ID; - timelib_unixtime2local(t, ts); - } else { - tzi = NULL; - timelib_unixtime2gmt(t, ts); - } - - if (!localtime) { - if (t->zone_type == TIMELIB_ZONETYPE_ABBR) { - offset = timelib_time_offset_ctor(); - offset->offset = (t->z - (t->dst * 60)) * -60; - offset->leap_secs = 0; - offset->is_dst = t->dst; - offset->abbr = strdup(t->tz_abbr); - } else if (t->zone_type == TIMELIB_ZONETYPE_OFFSET) { - offset = timelib_time_offset_ctor(); - offset->offset = (t->z - (t->dst * 60)) * -60; - offset->leap_secs = 0; - offset->is_dst = t->dst; - offset->abbr = malloc(9); /* GMT±xxxx\0 */ - snprintf(offset->abbr, 9, "GMT%c%02d%02d", - !localtime ? ((offset->offset < 0) ? '-' : '+') : '+', - !localtime ? abs(offset->offset / 3600) : 0, - !localtime ? abs((offset->offset % 3600) / 60) : 0 ); - } else { - offset = timelib_get_time_zone_info(t->sse, t->tz_info); - } - } - - timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); - - switch (format) { - /* day */ - case 'd': case 'j': retval = (int) t->d; break; - - case 'w': retval = (int) timelib_day_of_week(t->y, t->m, t->d); break; - case 'z': retval = (int) timelib_day_of_year(t->y, t->m, t->d); break; - - /* week */ - case 'W': retval = (int) isoweek; break; /* iso weeknr */ - - /* month */ - case 'm': case 'n': retval = (int) t->m; break; - case 't': retval = (int) timelib_days_in_month(t->y, t->m); break; - - /* year */ - case 'L': retval = (int) timelib_is_leap((int) t->y); break; - case 'y': retval = (int) (t->y % 100); break; - case 'Y': retval = (int) t->y; break; - - /* Swatch Beat a.k.a. Internet Time */ - case 'B': - retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864); - while (retval < 0) { - retval += 1000; - } - retval = retval % 1000; - break; - - /* time */ - case 'g': case 'h': retval = (int) ((t->h % 12) ? (int) t->h % 12 : 12); break; - case 'H': case 'G': retval = (int) t->h; break; - case 'i': retval = (int) t->i; break; - case 's': retval = (int) t->s; break; - - /* timezone */ - case 'I': retval = (int) (!localtime ? offset->is_dst : 0); break; - case 'Z': retval = (int) (!localtime ? offset->offset : 0); break; - - case 'U': retval = (int) t->sse; break; - } - - if (!localtime) { - timelib_time_offset_dtor(offset); - } - timelib_time_dtor(t); - - return retval; -} -/* }}} */ - -/* {{{ proto string date(string format [, long timestamp]) - Format a local date/time */ -PHP_FUNCTION(date) -{ - php_date(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto string gmdate(string format [, long timestamp]) - Format a GMT date/time */ -PHP_FUNCTION(gmdate) -{ - php_date(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int idate(string format [, int timestamp]) - Format a local time/date as integer */ -PHP_FUNCTION(idate) -{ - char *format; - int format_len; - long ts; - int ret; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) { - RETURN_FALSE; - } - - if (format_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "idate format is one char"); - RETURN_FALSE; - } - - if (ZEND_NUM_ARGS() == 1) { - ts = time(NULL); - } - - ret = php_idate(format[0], ts, 0); - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date format token."); - RETURN_FALSE; - } - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ php_date_set_tzdb - NOT THREADSAFE */ -PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb) -{ - const timelib_tzdb *builtin = timelib_builtin_db(); - - if (php_version_compare(tzdb->version, builtin->version) > 0) { - php_date_global_timezone_db = tzdb; - php_date_global_timezone_db_enabled = 1; - } -} -/* }}} */ - -/* {{{ php_parse_date: Backwards compability function */ -PHPAPI signed long php_parse_date(char *string, signed long *now) -{ - timelib_time *parsed_time; - int error2; - signed long retval; - - parsed_time = timelib_strtotime(string, strlen(string), NULL, DATE_TIMEZONEDB); - timelib_update_ts(parsed_time, NULL); - retval = timelib_date_to_int(parsed_time, &error2); - timelib_time_dtor(parsed_time); - if (error2) { - return -1; - } - return retval; -} -/* }}} */ - - -/* {{{ proto int strtotime(string time [, int now ]) - Convert string representation of date and time to a timestamp */ -PHP_FUNCTION(strtotime) -{ - char *times, *initial_ts; - int time_len, error1, error2; - struct timelib_error_container *error; - long preset_ts, ts; - - timelib_time *t, *now; - timelib_tzinfo *tzi; - - tzi = get_timezone_info(TSRMLS_C); - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sl", ×, &time_len, &preset_ts) != FAILURE) { - /* We have an initial timestamp */ - now = timelib_time_ctor(); - - initial_ts = emalloc(25); - snprintf(initial_ts, 24, "@%ld UTC", preset_ts); - t = timelib_strtotime(initial_ts, strlen(initial_ts), NULL, DATE_TIMEZONEDB); /* we ignore the error here, as this should never fail */ - timelib_update_ts(t, tzi); - now->tz_info = tzi; - now->zone_type = TIMELIB_ZONETYPE_ID; - timelib_unixtime2local(now, t->sse); - timelib_time_dtor(t); - efree(initial_ts); - } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", ×, &time_len, &preset_ts) != FAILURE) { - /* We have no initial timestamp */ - now = timelib_time_ctor(); - now->tz_info = tzi; - now->zone_type = TIMELIB_ZONETYPE_ID; - timelib_unixtime2local(now, (timelib_sll) time(NULL)); - } else { - RETURN_FALSE; - } - - if (!time_len) { - timelib_time_dtor(now); - RETURN_FALSE; - } - - t = timelib_strtotime(times, time_len, &error, DATE_TIMEZONEDB); - error1 = error->error_count; - timelib_error_container_dtor(error); - timelib_fill_holes(t, now, TIMELIB_NO_CLONE); - timelib_update_ts(t, tzi); - ts = timelib_date_to_int(t, &error2); - - timelib_time_dtor(now); - timelib_time_dtor(t); - - if (error1 || error2) { - RETURN_FALSE; - } else { - RETURN_LONG(ts); - } -} -/* }}} */ - - -/* {{{ php_mktime - (gm)mktime helper */ -PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt) -{ - long hou, min, sec, mon, day, yea, dst = -1; - timelib_time *now; - timelib_tzinfo *tzi = NULL; - long ts, adjust_seconds = 0; - int error; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) { - RETURN_FALSE; - } - /* Initialize structure with current time */ - now = timelib_time_ctor(); - if (gmt) { - timelib_unixtime2gmt(now, (timelib_sll) time(NULL)); - } else { - tzi = get_timezone_info(TSRMLS_C); - now->tz_info = tzi; - now->zone_type = TIMELIB_ZONETYPE_ID; - timelib_unixtime2local(now, (timelib_sll) time(NULL)); - } - /* Fill in the new data */ - switch (ZEND_NUM_ARGS()) { - case 7: - /* break intentionally missing */ - case 6: - if (yea >= 0 && yea < 70) { - yea += 2000; - } else if (yea >= 70 && yea <= 100) { - yea += 1900; - } - now->y = yea; - /* break intentionally missing again */ - case 5: - now->d = day; - /* break missing intentionally here too */ - case 4: - now->m = mon; - /* and here */ - case 3: - now->s = sec; - /* yup, this break isn't here on purpose too */ - case 2: - now->i = min; - /* last intentionally missing break */ - case 1: - now->h = hou; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead"); - } - /* Update the timestamp */ - if (gmt) { - timelib_update_ts(now, NULL); - } else { - timelib_update_ts(now, tzi); - } - /* Support for the deprecated is_dst parameter */ - if (dst != -1) { - php_error_docref(NULL TSRMLS_CC, E_STRICT, "The is_dst parameter is deprecated"); - if (gmt) { - /* GMT never uses DST */ - if (dst == 1) { - adjust_seconds = -3600; - } - } else { - /* Figure out is_dst for current TS */ - timelib_time_offset *tmp_offset; - tmp_offset = timelib_get_time_zone_info(now->sse, tzi); - if (dst == 1 && tmp_offset->is_dst == 0) { - adjust_seconds = -3600; - } - if (dst == 0 && tmp_offset->is_dst == 1) { - adjust_seconds = +3600; - } - timelib_time_offset_dtor(tmp_offset); - } - } - /* Clean up and return */ - ts = timelib_date_to_int(now, &error); - ts += adjust_seconds; - timelib_time_dtor(now); - - if (error) { - RETURN_FALSE; - } else { - RETURN_LONG(ts); - } -} -/* }}} */ - -/* {{{ proto int mktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]]) - Get UNIX timestamp for a date */ -PHP_FUNCTION(mktime) -{ - php_mktime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int gmmktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]]) - Get UNIX timestamp for a GMT date */ -PHP_FUNCTION(gmmktime) -{ - php_mktime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - - -/* {{{ proto bool checkdate(int month, int day, int year) - Returns true(1) if it is a valid date in gregorian calendar */ -PHP_FUNCTION(checkdate) -{ - long m, d, y; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &m, &d, &y) == FAILURE) { - RETURN_FALSE; - } - - if (y < 1 || y > 32767 || m < 1 || m > 12 || d < 1 || d > timelib_days_in_month(y, m)) { - RETURN_FALSE; - } - RETURN_TRUE; /* True : This month, day, year arguments are valid */ -} -/* }}} */ - -#ifdef HAVE_STRFTIME -/* {{{ php_strftime - (gm)strftime helper */ -PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt) -{ - char *format, *buf; - int format_len; - long timestamp; - struct tm ta; - int max_reallocs = 5; - size_t buf_len = 64, real_len; - timelib_time *ts; - timelib_tzinfo *tzi; - timelib_time_offset *offset = NULL; - - timestamp = (long) time(NULL); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, ×tamp) == FAILURE) { - RETURN_FALSE; - } - - if (format_len == 0) { - RETURN_FALSE; - } - - ts = timelib_time_ctor(); - if (gmt) { - tzi = NULL; - timelib_unixtime2gmt(ts, (timelib_sll) timestamp); - } else { - tzi = get_timezone_info(TSRMLS_C); - ts->tz_info = tzi; - ts->zone_type = TIMELIB_ZONETYPE_ID; - timelib_unixtime2local(ts, (timelib_sll) timestamp); - } - ta.tm_sec = ts->s; - ta.tm_min = ts->i; - ta.tm_hour = ts->h; - ta.tm_mday = ts->d; - ta.tm_mon = ts->m - 1; - ta.tm_year = ts->y - 1900; - ta.tm_wday = timelib_day_of_week(ts->y, ts->m, ts->d); - ta.tm_yday = timelib_day_of_year(ts->y, ts->m, ts->d); - if (gmt) { - ta.tm_isdst = 0; -#if HAVE_TM_GMTOFF - ta.tm_gmtoff = 0; -#endif -#if HAVE_TM_ZONE - ta.tm_zone = "GMT"; -#endif - } else { - offset = timelib_get_time_zone_info(timestamp, tzi); - - ta.tm_isdst = offset->is_dst; -#if HAVE_TM_GMTOFF - ta.tm_gmtoff = offset->offset; -#endif -#if HAVE_TM_ZONE - ta.tm_zone = offset->abbr; -#endif - } - - buf = (char *) emalloc(buf_len); - while ((real_len=strftime(buf, buf_len, format, &ta))==buf_len || real_len==0) { - buf_len *= 2; - buf = (char *) erealloc(buf, buf_len); - if (!--max_reallocs) { - break; - } - } - - timelib_time_dtor(ts); - if (!gmt) { - timelib_time_offset_dtor(offset); - } - - if (real_len && real_len != buf_len) { - buf = (char *) erealloc(buf, real_len + 1); - RETURN_STRINGL(buf, real_len, 0); - } - efree(buf); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string strftime(string format [, int timestamp]) - Format a local time/date according to locale settings */ -PHP_FUNCTION(strftime) -{ - php_strftime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string gmstrftime(string format [, int timestamp]) - Format a GMT/UCT time/date according to locale settings */ -PHP_FUNCTION(gmstrftime) -{ - php_strftime(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ -#endif - -/* {{{ proto int time(void) - Return current UNIX timestamp */ -PHP_FUNCTION(time) -{ - RETURN_LONG((long)time(NULL)); -} -/* }}} */ - -/* {{{ proto array localtime([int timestamp [, bool associative_array]]) - Returns the results of the C system call localtime as an associative array if the associative_array argument is set to 1 other wise it is a regular array */ -PHP_FUNCTION(localtime) -{ - long timestamp = (long)time(NULL); - zend_bool associative = 0; - timelib_tzinfo *tzi; - timelib_time *ts; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lb", ×tamp, &associative) == FAILURE) { - RETURN_FALSE; - } - - tzi = get_timezone_info(TSRMLS_C); - ts = timelib_time_ctor(); - ts->tz_info = tzi; - ts->zone_type = TIMELIB_ZONETYPE_ID; - timelib_unixtime2local(ts, (timelib_sll) timestamp); - - array_init(return_value); - - if (associative) { - add_assoc_long(return_value, "tm_sec", ts->s); - add_assoc_long(return_value, "tm_min", ts->i); - add_assoc_long(return_value, "tm_hour", ts->h); - add_assoc_long(return_value, "tm_mday", ts->d); - add_assoc_long(return_value, "tm_mon", ts->m - 1); - add_assoc_long(return_value, "tm_year", ts->y - 1900); - add_assoc_long(return_value, "tm_wday", timelib_day_of_week(ts->y, ts->m, ts->d)); - add_assoc_long(return_value, "tm_yday", timelib_day_of_year(ts->y, ts->m, ts->d)); - add_assoc_long(return_value, "tm_isdst", ts->dst); - } else { - add_next_index_long(return_value, ts->s); - add_next_index_long(return_value, ts->i); - add_next_index_long(return_value, ts->h); - add_next_index_long(return_value, ts->d); - add_next_index_long(return_value, ts->m - 1); - add_next_index_long(return_value, ts->y- 1900); - add_next_index_long(return_value, timelib_day_of_week(ts->y, ts->m, ts->d)); - add_next_index_long(return_value, timelib_day_of_year(ts->y, ts->m, ts->d)); - add_next_index_long(return_value, ts->dst); - } - - timelib_time_dtor(ts); -} -/* }}} */ - -/* {{{ proto array getdate([int timestamp]) - Get date/time information */ -PHP_FUNCTION(getdate) -{ - long timestamp = (long)time(NULL); - timelib_tzinfo *tzi; - timelib_time *ts; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", ×tamp) == FAILURE) { - RETURN_FALSE; - } - - tzi = get_timezone_info(TSRMLS_C); - ts = timelib_time_ctor(); - ts->tz_info = tzi; - ts->zone_type = TIMELIB_ZONETYPE_ID; - timelib_unixtime2local(ts, (timelib_sll) timestamp); - - array_init(return_value); - - add_assoc_long(return_value, "seconds", ts->s); - add_assoc_long(return_value, "minutes", ts->i); - add_assoc_long(return_value, "hours", ts->h); - add_assoc_long(return_value, "mday", ts->d); - add_assoc_long(return_value, "wday", timelib_day_of_week(ts->y, ts->m, ts->d)); - add_assoc_long(return_value, "mon", ts->m); - add_assoc_long(return_value, "year", ts->y); - add_assoc_long(return_value, "yday", timelib_day_of_year(ts->y, ts->m, ts->d)); - add_assoc_string(return_value, "weekday", php_date_full_day_name(ts->y, ts->m, ts->d), 1); - add_assoc_string(return_value, "month", mon_full_names[ts->m - 1], 1); - add_index_long(return_value, 0, timestamp); - - timelib_time_dtor(ts); -} -/* }}} */ - -static void date_register_classes(TSRMLS_D) -{ - zend_class_entry ce_date, ce_timezone; - - INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date); - ce_date.create_object = date_object_new_date; - date_ce_date = zend_register_internal_class_ex(&ce_date, NULL, NULL TSRMLS_CC); - memcpy(&date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - date_object_handlers_date.clone_obj = date_object_clone_date; - date_object_handlers_date.compare_objects = date_object_compare_date; - -#define REGISTER_DATE_CLASS_CONST_STRING(const_name, value) \ - zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC); - - REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339); - REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC850); - REGISTER_DATE_CLASS_CONST_STRING("ISO8601", DATE_FORMAT_ISO8601); - REGISTER_DATE_CLASS_CONST_STRING("RFC822", DATE_FORMAT_RFC822); - REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850); - REGISTER_DATE_CLASS_CONST_STRING("RFC1036", DATE_FORMAT_RFC1036); - REGISTER_DATE_CLASS_CONST_STRING("RFC1123", DATE_FORMAT_RFC1123); - REGISTER_DATE_CLASS_CONST_STRING("RFC2822", DATE_FORMAT_RFC2822); - REGISTER_DATE_CLASS_CONST_STRING("RFC3339", DATE_FORMAT_RFC3339); - REGISTER_DATE_CLASS_CONST_STRING("RSS", DATE_FORMAT_RFC1123); - REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_RFC3339); - - - INIT_CLASS_ENTRY(ce_timezone, "DateTimeZone", date_funcs_timezone); - ce_timezone.create_object = date_object_new_timezone; - date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL, NULL TSRMLS_CC); - memcpy(&date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - date_object_handlers_timezone.clone_obj = date_object_clone_timezone; -} - -static inline zend_object_value date_object_new_date_ex(zend_class_entry *class_type, php_date_obj **ptr TSRMLS_DC) -{ - php_date_obj *intern; - zend_object_value retval; - zval *tmp; - - intern = emalloc(sizeof(php_date_obj)); - memset(intern, 0, sizeof(php_date_obj)); - if (ptr) { - *ptr = intern; - } - - zend_object_std_init(&intern->std, class_type TSRMLS_CC); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_date, NULL TSRMLS_CC); - retval.handlers = &date_object_handlers_date; - - return retval; -} - -static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC) -{ - return date_object_new_date_ex(class_type, NULL TSRMLS_CC); -} - -static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC) -{ - php_date_obj *new_obj = NULL; - php_date_obj *old_obj = (php_date_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC); - zend_object_value new_ov = date_object_new_date_ex(old_obj->std.ce, &new_obj TSRMLS_CC); - - zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); - - /* this should probably moved to a new `timelib_time *timelime_time_clone(timelib_time *)` */ - new_obj->time = timelib_time_ctor(); - *new_obj->time = *old_obj->time; - if (old_obj->time->tz_abbr) { - new_obj->time->tz_abbr = strdup(old_obj->time->tz_abbr); - } - if (old_obj->time->tz_info) { - new_obj->time->tz_info = old_obj->time->tz_info; - } - - return new_ov; -} - -static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) -{ - if (Z_TYPE_P(d1) == IS_OBJECT && Z_TYPE_P(d2) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(d1), date_ce_date TSRMLS_CC) && - instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) { - php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); - php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); - - if (!o1->time->sse_uptodate) { - timelib_update_ts(o1->time, o1->time->tz_info); - } - if (!o2->time->sse_uptodate) { - timelib_update_ts(o2->time, o2->time->tz_info); - } - - return (o1->time->sse == o2->time->sse) ? 0 : ((o1->time->sse < o2->time->sse) ? -1 : 1); - } - - return 1; -} - -static inline zend_object_value date_object_new_timezone_ex(zend_class_entry *class_type, php_timezone_obj **ptr TSRMLS_DC) -{ - php_timezone_obj *intern; - zend_object_value retval; - zval *tmp; - - intern = emalloc(sizeof(php_timezone_obj)); - memset(intern, 0, sizeof(php_timezone_obj)); - if (ptr) { - *ptr = intern; - } - - zend_object_std_init(&intern->std, class_type TSRMLS_CC); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL TSRMLS_CC); - retval.handlers = &date_object_handlers_timezone; - - return retval; -} - -static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC) -{ - return date_object_new_timezone_ex(class_type, NULL TSRMLS_CC); -} - -static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC) -{ - php_timezone_obj *new_obj = NULL; - php_timezone_obj *old_obj = (php_timezone_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC); - zend_object_value new_ov = date_object_new_timezone_ex(old_obj->std.ce, &new_obj TSRMLS_CC); - - zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); - new_obj->type = old_obj->type; - new_obj->initialized = 1; - switch (new_obj->type) { - case TIMELIB_ZONETYPE_ID: - new_obj->tzi.tz = old_obj->tzi.tz; - break; - case TIMELIB_ZONETYPE_OFFSET: - new_obj->tzi.utc_offset = old_obj->tzi.utc_offset; - break; - case TIMELIB_ZONETYPE_ABBR: - new_obj->tzi.z.utc_offset = old_obj->tzi.z.utc_offset; - new_obj->tzi.z.dst = old_obj->tzi.z.dst; - new_obj->tzi.z.abbr = old_obj->tzi.z.abbr; - break; - } - - return new_ov; -} - -static void date_object_free_storage_date(void *object TSRMLS_DC) -{ - php_date_obj *intern = (php_date_obj *)object; - - if (intern->time) { - timelib_time_dtor(intern->time); - } - - zend_object_std_dtor(&intern->std TSRMLS_CC); - efree(object); -} - -static void date_object_free_storage_timezone(void *object TSRMLS_DC) -{ - php_timezone_obj *intern = (php_timezone_obj *)object; - - if (intern->type == TIMELIB_ZONETYPE_ABBR) { - free(intern->tzi.z.abbr); - } - zend_object_std_dtor(&intern->std TSRMLS_CC); - efree(object); -} - -/* Advanced Interface */ -static zval * date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) -{ - if (!object) { - ALLOC_ZVAL(object); - } - - Z_TYPE_P(object) = IS_OBJECT; - object_init_ex(object, pce); - object->refcount = 1; - object->is_ref = 0; - return object; -} - -static int date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int time_str_len, zval *timezone_object, int ctor TSRMLS_DC) -{ - timelib_time *now; - timelib_tzinfo *tzi; - timelib_error_container *err = NULL; - int type = TIMELIB_ZONETYPE_ID, new_dst, errors_found = 0; - char *new_abbr; - timelib_sll new_offset; - - if (dateobj->time) { - timelib_time_dtor(dateobj->time); - } - dateobj->time = timelib_strtotime(time_str_len ? time_str : "now", time_str_len ? time_str_len : sizeof("now") -1, &err, DATE_TIMEZONEDB); - - if (err && err->error_count) { - if (ctor) { - /* spit out the first library error message, at least */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", time_str, - err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message); - } - errors_found = 1; - } - timelib_error_container_dtor(err); - if (errors_found) { - return 0; - } - - if (timezone_object) { - php_timezone_obj *tzobj; - - tzobj = (php_timezone_obj *) zend_object_store_get_object(timezone_object TSRMLS_CC); - switch (tzobj->type) { - case TIMELIB_ZONETYPE_ID: - tzi = tzobj->tzi.tz; - break; - case TIMELIB_ZONETYPE_OFFSET: - new_offset = tzobj->tzi.utc_offset; - break; - case TIMELIB_ZONETYPE_ABBR: - new_offset = tzobj->tzi.z.utc_offset; - new_dst = tzobj->tzi.z.dst; - new_abbr = strdup(tzobj->tzi.z.abbr); - break; - } - type = tzobj->type; - } else if (dateobj->time->tz_info) { - tzi = dateobj->time->tz_info; - } else { - tzi = get_timezone_info(TSRMLS_C); - } - - now = timelib_time_ctor(); - now->zone_type = type; - switch (type) { - case TIMELIB_ZONETYPE_ID: - now->tz_info = tzi; - break; - case TIMELIB_ZONETYPE_OFFSET: - now->z = new_offset; - break; - case TIMELIB_ZONETYPE_ABBR: - now->z = new_offset; - now->dst = new_dst; - now->tz_abbr = new_abbr; - break; - } - timelib_unixtime2local(now, (timelib_sll) time(NULL)); - - timelib_fill_holes(dateobj->time, now, 0); - timelib_update_ts(dateobj->time, tzi); - - dateobj->time->have_weekday_relative = dateobj->time->have_relative = 0; - - timelib_time_dtor(now); - - return 1; -} - -/* {{{ proto DateTime date_create([string time[, DateTimeZone object]]) - Returns new DateTime object -*/ -PHP_FUNCTION(date_create) -{ - zval *timezone_object = NULL; - char *time_str = NULL; - int time_str_len = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { - RETURN_FALSE; - } - - date_instantiate(date_ce_date, return_value TSRMLS_CC); - if (!date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, timezone_object, 0 TSRMLS_CC)) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto DateTime::__construct([string time[, DateTimeZone object]]) - Creates new DateTime object -*/ -PHP_METHOD(DateTime, __construct) -{ - zval *timezone_object = NULL; - char *time_str = NULL; - int time_str_len = 0; - - php_set_error_handling(EH_THROW, NULL TSRMLS_CC); - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) { - date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, timezone_object, 1 TSRMLS_CC); - } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto array date_parse(string date) - Returns associative array with detailed info about given date -*/ -PHP_FUNCTION(date_parse) -{ - char *date; - int date_len, i; - struct timelib_error_container *error; - timelib_time *parsed_time; - zval *element; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &date, &date_len) == FAILURE) { - RETURN_FALSE; - } - - parsed_time = timelib_strtotime(date, date_len, &error, DATE_TIMEZONEDB); - array_init(return_value); -#define PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(name, elem) \ - if (parsed_time->elem == -99999) { \ - add_assoc_bool(return_value, #name, 0); \ - } else { \ - add_assoc_long(return_value, #name, parsed_time->elem); \ - } - PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(year, y); - PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(month, m); - PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(day, d); - PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(hour, h); - PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(minute, i); - PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(second, s); - - if (parsed_time->f == -99999) { - add_assoc_bool(return_value, "fraction", 0); - } else { - add_assoc_double(return_value, "fraction", parsed_time->f); - } - - add_assoc_long(return_value, "warning_count", error->warning_count); - MAKE_STD_ZVAL(element); - array_init(element); - for (i = 0; i < error->warning_count; i++) { - add_index_string(element, error->warning_messages[i].position, error->warning_messages[i].message, 1); - } - add_assoc_zval(return_value, "warnings", element); - - add_assoc_long(return_value, "error_count", error->error_count); - MAKE_STD_ZVAL(element); - array_init(element); - for (i = 0; i < error->error_count; i++) { - add_index_string(element, error->error_messages[i].position, error->error_messages[i].message, 1); - } - add_assoc_zval(return_value, "errors", element); - timelib_error_container_dtor(error); - - add_assoc_bool(return_value, "is_localtime", parsed_time->is_localtime); - - if (parsed_time->is_localtime) { - PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone_type, zone_type); - switch (parsed_time->zone_type) { - case TIMELIB_ZONETYPE_OFFSET: - PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone, z); - add_assoc_bool(return_value, "is_dst", parsed_time->dst); - break; - case TIMELIB_ZONETYPE_ID: - if (parsed_time->tz_abbr) { - add_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1); - } - if (parsed_time->tz_info) { - add_assoc_string(return_value, "tz_id", parsed_time->tz_info->name, 1); - } - break; - case TIMELIB_ZONETYPE_ABBR: - PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone, z); - add_assoc_bool(return_value, "is_dst", parsed_time->dst); - add_assoc_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1); - break; - } - } - if (parsed_time->have_relative || parsed_time->have_weekday_relative) { - MAKE_STD_ZVAL(element); - array_init(element); - } - if (parsed_time->have_relative) { - add_assoc_long(element, "year", parsed_time->relative.y); - add_assoc_long(element, "month", parsed_time->relative.m); - add_assoc_long(element, "day", parsed_time->relative.d); - add_assoc_long(element, "hour", parsed_time->relative.h); - add_assoc_long(element, "minute", parsed_time->relative.i); - add_assoc_long(element, "second", parsed_time->relative.s); - } - if (parsed_time->have_weekday_relative) { - add_assoc_long(element, "weekday", parsed_time->relative.weekday); - } - if (parsed_time->have_relative || parsed_time->have_weekday_relative) { - add_assoc_zval(return_value, "relative", element); - } - timelib_time_dtor(parsed_time); -} -/* }}} */ - -/* {{{ proto string date_format(DateTime object, string format) - Returns date formatted according to given format -*/ -PHP_FUNCTION(date_format) -{ - zval *object; - php_date_obj *dateobj; - char *format; - int format_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &format, &format_len) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - RETURN_STRING(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime), 0); -} -/* }}} */ - -/* {{{ proto void date_modify(DateTime object, string modify) - Alters the timestamp. -*/ -PHP_FUNCTION(date_modify) -{ - zval *object; - php_date_obj *dateobj; - char *modify; - int modify_len; - timelib_time *tmp_time; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &modify, &modify_len) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - - tmp_time = timelib_strtotime(modify, modify_len, NULL, DATE_TIMEZONEDB); - memcpy(&dateobj->time->relative, &tmp_time->relative, sizeof(struct timelib_rel_time)); - dateobj->time->have_relative = tmp_time->have_relative; - dateobj->time->have_weekday_relative = tmp_time->have_weekday_relative; - dateobj->time->sse_uptodate = 0; - timelib_time_dtor(tmp_time); - - timelib_update_ts(dateobj->time, NULL); - timelib_update_from_sse(dateobj->time); -} -/* }}} */ - -/* {{{ proto DateTimeZone date_timezone_get(DateTime object) - Return new DateTimeZone object relative to give DateTime -*/ -PHP_FUNCTION(date_timezone_get) -{ - zval *object; - php_date_obj *dateobj; - php_timezone_obj *tzobj; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_date) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - if (dateobj->time->is_localtime/* && dateobj->time->tz_info*/) { - date_instantiate(date_ce_timezone, return_value TSRMLS_CC); - tzobj = (php_timezone_obj *) zend_object_store_get_object(return_value TSRMLS_CC); - tzobj->initialized = 1; - tzobj->type = dateobj->time->zone_type; - switch (dateobj->time->zone_type) { - case TIMELIB_ZONETYPE_ID: - tzobj->tzi.tz = dateobj->time->tz_info; - break; - case TIMELIB_ZONETYPE_OFFSET: - tzobj->tzi.utc_offset = dateobj->time->z; - break; - case TIMELIB_ZONETYPE_ABBR: - tzobj->tzi.z.utc_offset = dateobj->time->z; - tzobj->tzi.z.dst = dateobj->time->dst; - tzobj->tzi.z.abbr = strdup(dateobj->time->tz_abbr); - break; - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto void date_timezone_set(DateTime object, DateTimeZone object) - Sets the timezone for the DateTime object. -*/ -PHP_FUNCTION(date_timezone_set) -{ - zval *object; - zval *timezone_object; - php_date_obj *dateobj; - php_timezone_obj *tzobj; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - tzobj = (php_timezone_obj *) zend_object_store_get_object(timezone_object TSRMLS_CC); - if (tzobj->type != TIMELIB_ZONETYPE_ID) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only do this for zones with ID for now"); - return; - } - timelib_set_timezone(dateobj->time, tzobj->tzi.tz); - timelib_unixtime2local(dateobj->time, dateobj->time->sse); -} -/* }}} */ - -/* {{{ proto long date_offset_get(DateTime object) - Returns the DST offset. -*/ -PHP_FUNCTION(date_offset_get) -{ - zval *object; - php_date_obj *dateobj; - timelib_time_offset *offset; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_date) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - if (dateobj->time->is_localtime/* && dateobj->time->tz_info*/) { - switch (dateobj->time->zone_type) { - case TIMELIB_ZONETYPE_ID: - offset = timelib_get_time_zone_info(dateobj->time->sse, dateobj->time->tz_info); - RETVAL_LONG(offset->offset); - timelib_time_offset_dtor(offset); - break; - case TIMELIB_ZONETYPE_OFFSET: - RETVAL_LONG(dateobj->time->z * -60); - break; - case TIMELIB_ZONETYPE_ABBR: - RETVAL_LONG((dateobj->time->z - (60 * dateobj->time->dst)) * -60); - break; - } - return; - } else { - RETURN_LONG(0); - } -} -/* }}} */ - -/* {{{ proto void date_time_set(DateTime object, long hour, long minute[, long second]) - Sets the time. -*/ -PHP_FUNCTION(date_time_set) -{ - zval *object; - php_date_obj *dateobj; - long h, i, s = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &h, &i, &s) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - dateobj->time->h = h; - dateobj->time->i = i; - dateobj->time->s = s; - timelib_update_ts(dateobj->time, NULL); -} -/* }}} */ - -/* {{{ proto void date_date_set(DateTime object, long year, long month, long day) - Sets the date. -*/ -PHP_FUNCTION(date_date_set) -{ - zval *object; - php_date_obj *dateobj; - long y, m, d; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olll", &object, date_ce_date, &y, &m, &d) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - dateobj->time->y = y; - dateobj->time->m = m; - dateobj->time->d = d; - timelib_update_ts(dateobj->time, NULL); -} -/* }}} */ - -/* {{{ proto void date_isodate_set(DateTime object, long year, long week[, long day]) - Sets the ISO date. -*/ -PHP_FUNCTION(date_isodate_set) -{ - zval *object; - php_date_obj *dateobj; - long y, w, d = 1; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &y, &w, &d) == FAILURE) { - RETURN_FALSE; - } - dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - dateobj->time->y = y; - dateobj->time->m = 1; - dateobj->time->d = 1; - dateobj->time->relative.d = timelib_daynr_from_weeknr(y, w, d); - dateobj->time->have_relative = 1; - - timelib_update_ts(dateobj->time, NULL); -} -/* }}} */ - -static int timezone_initialize(timelib_tzinfo **tzi, /*const*/ char *tz TSRMLS_DC) -{ - char *tzid; - - *tzi = NULL; - - if ((tzid = timelib_timezone_id_from_abbr(tz, -1, 0))) { - *tzi = php_date_parse_tzfile(tzid, DATE_TIMEZONEDB TSRMLS_CC); - } else { - *tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC); - } - - if (*tzi) { - return SUCCESS; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad timezone (%s)", tz); - return FAILURE; - } -} - -/* {{{ proto DateTimeZone timezone_open(string timezone) - Returns new DateTimeZone object -*/ -PHP_FUNCTION(timezone_open) -{ - char *tz; - int tz_len; - timelib_tzinfo *tzi = NULL; - php_timezone_obj *tzobj; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len) == FAILURE) { - RETURN_FALSE; - } - if (SUCCESS != timezone_initialize(&tzi, tz TSRMLS_CC)) { - RETURN_FALSE; - } - tzobj = zend_object_store_get_object(date_instantiate(date_ce_timezone, return_value TSRMLS_CC) TSRMLS_CC); - tzobj->type = TIMELIB_ZONETYPE_ID; - tzobj->tzi.tz = tzi; - tzobj->initialized = 1; -} -/* }}} */ - -/* {{{ proto DateTimeZone::__construct(string timezone) - Creates new DateTimeZone object. -*/ -PHP_METHOD(DateTimeZone, __construct) -{ - char *tz; - int tz_len; - timelib_tzinfo *tzi = NULL; - php_timezone_obj *tzobj; - - php_set_error_handling(EH_THROW, NULL TSRMLS_CC); - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) { - if (SUCCESS == timezone_initialize(&tzi, tz TSRMLS_CC)) { - tzobj = zend_object_store_get_object(getThis() TSRMLS_CC); - tzobj->type = TIMELIB_ZONETYPE_ID; - tzobj->tzi.tz = tzi; - tzobj->initialized = 1; - } else { - ZVAL_NULL(getThis()); - } - } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string timezone_name_get(DateTimeZone object) - Returns the name of the timezone. -*/ -PHP_FUNCTION(timezone_name_get) -{ - zval *object; - php_timezone_obj *tzobj; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) { - RETURN_FALSE; - } - tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); - - switch (tzobj->type) { - case TIMELIB_ZONETYPE_ID: - RETURN_STRING(tzobj->tzi.tz->name, 1); - break; - case TIMELIB_ZONETYPE_OFFSET: { - char *tmpstr = emalloc(sizeof("UTC+05:00")); - timelib_sll utc_offset = tzobj->tzi.utc_offset; - - snprintf(tmpstr, sizeof("+05:00"), "%c%02d:%02d", - utc_offset > 0 ? '-' : '+', - abs(utc_offset / 60), - abs((utc_offset % 60))); - - RETURN_STRING(tmpstr, 0); - } - break; - case TIMELIB_ZONETYPE_ABBR: - RETURN_STRING(tzobj->tzi.z.abbr, 1); - break; - } -} -/* }}} */ - -/* {{{ proto string timezone_name_from_abbr(string abbr[, long gmtOffset[, long isdst]]) - Returns the timezone name from abbrevation -*/ -PHP_FUNCTION(timezone_name_from_abbr) -{ - char *abbr; - char *tzid; - int abbr_len; - long gmtoffset = -1; - long isdst = -1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &abbr, &abbr_len, &gmtoffset, &isdst) == FAILURE) { - RETURN_FALSE; - } - tzid = timelib_timezone_id_from_abbr(abbr, gmtoffset, isdst); - - if (tzid) { - RETURN_STRING(tzid, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object) - Returns the timezone offset. -*/ -PHP_FUNCTION(timezone_offset_get) -{ - zval *object, *dateobject; - php_timezone_obj *tzobj; - php_date_obj *dateobj; - timelib_time_offset *offset; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_date) == FAILURE) { - RETURN_FALSE; - } - tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); - dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - - switch (tzobj->type) { - case TIMELIB_ZONETYPE_ID: - offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tzi.tz); - RETVAL_LONG(offset->offset); - timelib_time_offset_dtor(offset); - break; - case TIMELIB_ZONETYPE_OFFSET: - RETURN_LONG(tzobj->tzi.utc_offset * -60); - break; - case TIMELIB_ZONETYPE_ABBR: - RETURN_LONG((tzobj->tzi.z.utc_offset - (tzobj->tzi.z.dst*60)) * -60); - break; - } -} -/* }}} */ - -/* {{{ proto array timezone_transitions_get(DateTimeZone object) - Returns numeracilly indexed array containing associative array for all transitions for the timezone. -*/ -PHP_FUNCTION(timezone_transitions_get) -{ - zval *object, *element; - php_timezone_obj *tzobj; - int i; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) { - RETURN_FALSE; - } - tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); - DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); - if (tzobj->type != TIMELIB_ZONETYPE_ID) { - RETURN_FALSE; - } - - array_init(return_value); - for (i = 0; i < tzobj->tzi.tz->timecnt; ++i) { - MAKE_STD_ZVAL(element); - array_init(element); - add_assoc_long(element, "ts", tzobj->tzi.tz->trans[i]); - add_assoc_string(element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, tzobj->tzi.tz->trans[i], 0 TSRMLS_CC), 0); - add_assoc_long(element, "offset", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].offset); - add_assoc_bool(element, "isdst", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].isdst); - add_assoc_string(element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].abbr_idx], 1); - - add_next_index_zval(return_value, element); - } -} -/* }}} */ - -/* {{{ proto array timezone_identifiers_list() - Returns numerically index array with all timezone identifiers. -*/ -PHP_FUNCTION(timezone_identifiers_list) -{ - const timelib_tzdb *tzdb; - const timelib_tzdb_index_entry *table; - int i, item_count; - - tzdb = DATE_TIMEZONEDB; - item_count = tzdb->index_size; - table = tzdb->index; - - array_init(return_value); - - for (i = 0; i < item_count; ++i) { - add_next_index_string(return_value, table[i].id, 1); - }; -} -/* }}} */ - -/* {{{ proto array timezone_abbreviations_list() - Returns associative array containing dst, offset and the timezone name -*/ -PHP_FUNCTION(timezone_abbreviations_list) -{ - const timelib_tz_lookup_table *table, *entry; - zval *element, **abbr_array_pp, *abbr_array; - - table = timelib_timezone_abbreviations_list(); - array_init(return_value); - entry = table; - - do { - MAKE_STD_ZVAL(element); - array_init(element); - add_assoc_bool(element, "dst", entry->type); - add_assoc_long(element, "offset", entry->gmtoffset); - if (entry->full_tz_name) { - add_assoc_string(element, "timezone_id", entry->full_tz_name, 1); - } else { - add_assoc_null(element, "timezone_id"); - } - - if (zend_hash_find(HASH_OF(return_value), entry->name, strlen(entry->name) + 1, (void **) &abbr_array_pp) == FAILURE) { - MAKE_STD_ZVAL(abbr_array); - array_init(abbr_array); - add_assoc_zval(return_value, entry->name, abbr_array); - } else { - abbr_array = *abbr_array_pp; - } - add_next_index_zval(abbr_array, element); - entry++; - } while (entry->name); -} -/* }}} */ - -/* {{{ proto bool date_default_timezone_set(string timezone_identifier) - Sets the default timezone used by all date/time functions in a script */ -PHP_FUNCTION(date_default_timezone_set) -{ - char *zone; - int zone_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &zone, &zone_len) == FAILURE) { - RETURN_FALSE; - } - if (!timelib_timezone_id_is_valid(zone, DATE_TIMEZONEDB)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone ID '%s' is invalid", zone); - RETURN_FALSE; - } - if (DATEG(timezone)) { - efree(DATEG(timezone)); - DATEG(timezone) = NULL; - } - DATEG(timezone) = estrndup(zone, zone_len); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string date_default_timezone_get() - Gets the default timezone used by all date/time functions in a script */ -PHP_FUNCTION(date_default_timezone_get) -{ - timelib_tzinfo *default_tz; - - default_tz = get_timezone_info(TSRMLS_C); - RETVAL_STRING(default_tz->name, 1); -} -/* }}} */ - -/* {{{ php_do_date_sunrise_sunset - * Common for date_sunrise() and date_sunset() functions - */ -static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_sunset) -{ - double latitude, longitude, zenith, gmt_offset = 0, altitude; - double h_rise, h_set, N; - timelib_sll rise, set, transit; - long time, retformat; - int rs; - timelib_time *t; - timelib_tzinfo *tzi; - char *retstr; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ldddd", &time, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) { - RETURN_FALSE; - } - - switch (ZEND_NUM_ARGS()) { - case 1: - retformat = SUNFUNCS_RET_STRING; - case 2: - latitude = INI_FLT("date.default_latitude"); - case 3: - longitude = INI_FLT("date.default_longitude"); - case 4: - if (calc_sunset) { - zenith = INI_FLT("date.sunset_zenith"); - } else { - zenith = INI_FLT("date.sunrise_zenith"); - } - case 5: - case 6: - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid format"); - RETURN_FALSE; - break; - } - if (retformat != SUNFUNCS_RET_TIMESTAMP && - retformat != SUNFUNCS_RET_STRING && - retformat != SUNFUNCS_RET_DOUBLE) - { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE"); - RETURN_FALSE; - } - altitude = 90 - zenith; - - /* Initialize time struct */ - t = timelib_time_ctor(); - tzi = get_timezone_info(TSRMLS_C); - t->tz_info = tzi; - t->zone_type = TIMELIB_ZONETYPE_ID; - - if (ZEND_NUM_ARGS() <= 5) { - gmt_offset = timelib_get_current_offset(t) / 3600; - } - - timelib_unixtime2local(t, time); - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, altitude > -1 ? 1 : 0, &h_rise, &h_set, &rise, &set, &transit); - timelib_time_dtor(t); - - if (rs != 0) { - RETURN_FALSE; - } - - if (retformat == SUNFUNCS_RET_TIMESTAMP) { - RETURN_LONG(calc_sunset ? set : rise); - } - N = (calc_sunset ? h_set : h_rise) + gmt_offset; - - if (N > 24 || N < 0) { - N -= floor(N / 24) * 24; - } - - switch (retformat) { - case SUNFUNCS_RET_STRING: - spprintf(&retstr, 0, "%02d:%02d", (int) N, (int) (60 * (N - (int) N))); - RETURN_STRINGL(retstr, 5, 0); - break; - case SUNFUNCS_RET_DOUBLE: - RETURN_DOUBLE(N); - break; - } -} -/* }}} */ - -/* {{{ proto mixed date_sunrise(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]]) - Returns time of sunrise for a given day and location */ -PHP_FUNCTION(date_sunrise) -{ - php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]]) - Returns time of sunset for a given day and location */ -PHP_FUNCTION(date_sunset) -{ - php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto array date_sun_info(long time, float latitude, float longitude) - Returns an array with information about sun set/rise and twilight begin/end */ -PHP_FUNCTION(date_sun_info) -{ - long time; - double latitude, longitude; - timelib_time *t, *t2; - timelib_tzinfo *tzi; - int rs; - timelib_sll rise, set, transit; - int dummy; - double ddummy; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ldd", &time, &latitude, &longitude) == FAILURE) { - RETURN_FALSE; - } - /* Initialize time struct */ - t = timelib_time_ctor(); - tzi = get_timezone_info(TSRMLS_C); - t->tz_info = tzi; - t->zone_type = TIMELIB_ZONETYPE_ID; - timelib_unixtime2local(t, time); - - /* Setup */ - t2 = timelib_time_ctor(); - array_init(return_value); - - /* Get sun up/down and transit */ - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -35.0/60, 1, &ddummy, &ddummy, &rise, &set, &transit); - switch (rs) { - case -1: /* always below */ - add_assoc_bool(return_value, "sunrise", 0); - add_assoc_bool(return_value, "sunset", 0); - break; - case 1: /* always above */ - add_assoc_bool(return_value, "sunrise", 1); - add_assoc_bool(return_value, "sunset", 1); - break; - default: - t2->sse = rise; - add_assoc_long(return_value, "sunrise", timelib_date_to_int(t2, &dummy)); - t2->sse = set; - add_assoc_long(return_value, "sunset", timelib_date_to_int(t2, &dummy)); - } - t2->sse = transit; - add_assoc_long(return_value, "transit", timelib_date_to_int(t2, &dummy)); - - /* Get civil twilight */ - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -6.0, 0, &ddummy, &ddummy, &rise, &set, &transit); - switch (rs) { - case -1: /* always below */ - add_assoc_bool(return_value, "civil_twilight_begin", 0); - add_assoc_bool(return_value, "civil_twilight_end", 0); - break; - case 1: /* always above */ - add_assoc_bool(return_value, "civil_twilight_begin", 1); - add_assoc_bool(return_value, "civil_twilight_end", 1); - break; - default: - t2->sse = rise; - add_assoc_long(return_value, "civil_twilight_begin", timelib_date_to_int(t2, &dummy)); - t2->sse = set; - add_assoc_long(return_value, "civil_twilight_end", timelib_date_to_int(t2, &dummy)); - } - - /* Get nautical twilight */ - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -12.0, 0, &ddummy, &ddummy, &rise, &set, &transit); - switch (rs) { - case -1: /* always below */ - add_assoc_bool(return_value, "nautical_twilight_begin", 0); - add_assoc_bool(return_value, "nautical_twilight_end", 0); - break; - case 1: /* always above */ - add_assoc_bool(return_value, "nautical_twilight_begin", 1); - add_assoc_bool(return_value, "nautical_twilight_end", 1); - break; - default: - t2->sse = rise; - add_assoc_long(return_value, "nautical_twilight_begin", timelib_date_to_int(t2, &dummy)); - t2->sse = set; - add_assoc_long(return_value, "nautical_twilight_end", timelib_date_to_int(t2, &dummy)); - } - - /* Get astronomical twilight */ - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, -18.0, 0, &ddummy, &ddummy, &rise, &set, &transit); - switch (rs) { - case -1: /* always below */ - add_assoc_bool(return_value, "astronomical_twilight_begin", 0); - add_assoc_bool(return_value, "astronomical_twilight_end", 0); - break; - case 1: /* always above */ - add_assoc_bool(return_value, "astronomical_twilight_begin", 1); - add_assoc_bool(return_value, "astronomical_twilight_end", 1); - break; - default: - t2->sse = rise; - add_assoc_long(return_value, "astronomical_twilight_begin", timelib_date_to_int(t2, &dummy)); - t2->sse = set; - add_assoc_long(return_value, "astronomical_twilight_end", timelib_date_to_int(t2, &dummy)); - } - timelib_time_dtor(t); - timelib_time_dtor(t2); -} -/* }}} */ -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/ext/date/php_date.h b/ext/date/php_date.h deleted file mode 100644 index fd4ee13d14b8a..0000000000000 --- a/ext/date/php_date.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_DATE_H -#define PHP_DATE_H - -#include "lib/timelib.h" -#include "Zend/zend_hash.h" - -extern zend_module_entry date_module_entry; -#define phpext_date_ptr &date_module_entry - -PHP_FUNCTION(date); -PHP_FUNCTION(idate); -PHP_FUNCTION(gmdate); -PHP_FUNCTION(strtotime); - -PHP_FUNCTION(mktime); -PHP_FUNCTION(gmmktime); - -PHP_FUNCTION(checkdate); - -#ifdef HAVE_STRFTIME -PHP_FUNCTION(strftime); -PHP_FUNCTION(gmstrftime); -#endif - -PHP_FUNCTION(time); -PHP_FUNCTION(localtime); -PHP_FUNCTION(getdate); - -/* Advanced Interface */ -PHP_METHOD(DateTime, __construct); -PHP_FUNCTION(date_create); -PHP_FUNCTION(date_parse); -PHP_FUNCTION(date_format); -PHP_FUNCTION(date_modify); -PHP_FUNCTION(date_timezone_get); -PHP_FUNCTION(date_timezone_set); -PHP_FUNCTION(date_offset_get); - -PHP_FUNCTION(date_time_set); -PHP_FUNCTION(date_date_set); -PHP_FUNCTION(date_isodate_set); - -PHP_METHOD(DateTimeZone, __construct); -PHP_FUNCTION(timezone_open); -PHP_FUNCTION(timezone_name_get); -PHP_FUNCTION(timezone_name_from_abbr); -PHP_FUNCTION(timezone_offset_get); -PHP_FUNCTION(timezone_transitions_get); -PHP_FUNCTION(timezone_identifiers_list); -PHP_FUNCTION(timezone_abbreviations_list); - -/* Options and Configuration */ -PHP_FUNCTION(date_default_timezone_set); -PHP_FUNCTION(date_default_timezone_get); - -/* Astro functions */ -PHP_FUNCTION(date_sunrise); -PHP_FUNCTION(date_sunset); -PHP_FUNCTION(date_sun_info); - -PHP_RINIT_FUNCTION(date); -PHP_RSHUTDOWN_FUNCTION(date); -PHP_MINIT_FUNCTION(date); -PHP_MSHUTDOWN_FUNCTION(date); -PHP_MINFO_FUNCTION(date); - -ZEND_BEGIN_MODULE_GLOBALS(date) - char *default_timezone; - char *timezone; - HashTable tzcache; -ZEND_END_MODULE_GLOBALS(date) - -#ifdef ZTS -#define DATEG(v) TSRMG(date_globals_id, zend_date_globals *, v) -#else -#define DATEG(v) (date_globals.v) -#endif - -/* Backwards compability wrapper */ -PHPAPI signed long php_parse_date(char *string, signed long *now); -PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt); -PHPAPI int php_idate(char format, time_t ts, int localtime); -#if HAVE_STRFTIME -#define _php_strftime php_strftime -PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm); -#endif -PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC); - -/* Mechanism to set new TZ database */ -PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb); -PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D); - -#endif /* PHP_DATE_H */ diff --git a/ext/date/tests/002.phpt b/ext/date/tests/002.phpt deleted file mode 100644 index 7384b7424469b..0000000000000 --- a/ext/date/tests/002.phpt +++ /dev/null @@ -1,93 +0,0 @@ ---TEST-- -strtotime() function ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** GMT0 -1999-10-13 00:00:00 -1999-10-13 00:00:00 -2000-01-19 00:00:00 -2000-01-19 00:00:00 -2001-12-21 00:00:00 -2001-12-21 00:00:00 -2001-12-21 12:16:00 -2001-12-21 12:16:00 -%d-12-21 12:16:00 -2001-10-22 21:19:58 -2001-10-22 23:19:58 -2001-10-22 23:32:58 -2001-10-22 19:19:58 -2001-10-22 19:06:58 -2001-10-23 01:00:58 -2001-10-22 23:19:58 -2001-10-22 19:06:58 -2001-10-22 19:05:00 -1996-12-30 00:00:00 -2004-03-01 05:00:00 -*** US/Eastern -1999-10-13 00:00:00 -1999-10-13 00:00:00 -2000-01-19 00:00:00 -2000-01-19 00:00:00 -2001-12-21 00:00:00 -2001-12-21 00:00:00 -2001-12-21 12:16:00 -2001-12-21 12:16:00 -%d-12-21 12:16:00 -2001-10-22 21:19:58 -2001-10-22 19:19:58 -2001-10-22 19:32:58 -2001-10-22 15:19:58 -2001-10-22 15:06:58 -2001-10-22 21:00:58 -2001-10-22 19:19:58 -2001-10-22 15:06:58 -2001-10-22 15:05:00 -1996-12-30 00:00:00 -2004-03-01 00:00:00 diff --git a/ext/date/tests/003.phpt b/ext/date/tests/003.phpt deleted file mode 100644 index 621a87b3412cb..0000000000000 --- a/ext/date/tests/003.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -date suffixes test ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -string(4) "31st" -string(3) "1st" -string(3) "2nd" -string(3) "3rd" -string(3) "4th" -string(3) "5th" -string(3) "6th" -string(3) "7th" -string(3) "8th" -string(3) "9th" -string(4) "10th" -string(4) "11th" -string(4) "12th" -string(4) "13th" -string(4) "14th" -string(4) "15th" -string(4) "16th" -string(4) "17th" -string(4) "18th" -string(4) "19th" -string(4) "20th" -string(4) "21st" -string(4) "22nd" -string(4) "23rd" -string(4) "24th" -string(4) "25th" -string(4) "26th" -string(4) "27th" -string(4) "28th" -string(4) "29th" -string(4) "30th" -string(4) "31st" -Done diff --git a/ext/date/tests/004.phpt b/ext/date/tests/004.phpt deleted file mode 100644 index 33e1fc791072a..0000000000000 --- a/ext/date/tests/004.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -date() format params ---FILE-- - ---EXPECTF-- -string(1) "2" -string(3) "177" -string(1) "6" -string(2) "30" -string(1) "0" -string(2) "am" -string(3) "041" -string(2) "12" -string(1) "0" -string(1) "0" -string(10) "1151366400" -string(1) "2" -string(3) "177" -string(1) "6" -string(2) "30" -string(1) "0" -string(2) "am" -string(3) "041" -string(1) "3" -string(1) "3" -string(5) "10800" -string(10) "1151366400" -string(1) "1" -string(3) "176" -string(1) "6" -string(2) "30" -string(1) "0" -string(2) "pm" -string(3) "041" -string(1) "7" -string(2) "19" -string(6) "-18000" -string(10) "1151366400" -string(1) "2" -string(3) "177" -string(1) "6" -string(2) "30" -string(1) "0" -string(2) "am" -string(3) "041" -string(1) "1" -string(1) "1" -string(4) "3600" -string(10) "1151366400" -Done diff --git a/ext/date/tests/005.phpt b/ext/date/tests/005.phpt deleted file mode 100644 index c6551b76b414a..0000000000000 --- a/ext/date/tests/005.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -idate() and invalid params ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -Warning: idate() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: idate() expects at most 2 parameters, 3 given in %s on line %d -bool(false) - -Warning: idate(): Unrecognized date format token. in %s on line %d -bool(false) - -Warning: idate(): idate format is one char in %s on line %d -bool(false) - -Warning: idate(): Unrecognized date format token. in %s on line %d -bool(false) -int(41) - -Warning: idate(): Unrecognized date format token. in %s on line %d -bool(false) - -Warning: idate(): Unrecognized date format token. in %s on line %d -bool(false) -Done diff --git a/ext/date/tests/006.phpt b/ext/date/tests/006.phpt deleted file mode 100644 index 407242b161e7b..0000000000000 --- a/ext/date/tests/006.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -checkdate() tests ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -Warning: checkdate() expects exactly 3 parameters, 0 given in %s on line %d -bool(false) -bool(true) -bool(false) -bool(false) -bool(false) -bool(true) -bool(false) -bool(false) -bool(false) -Done diff --git a/ext/date/tests/007.phpt b/ext/date/tests/007.phpt deleted file mode 100644 index f0c87846595c7..0000000000000 --- a/ext/date/tests/007.phpt +++ /dev/null @@ -1,101 +0,0 @@ ---TEST-- -localtime() tests ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -Warning: localtime() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -array(9) { - [0]=> - int(%d) - [1]=> - int(%d) - [2]=> - int(%d) - [3]=> - int(%d) - [4]=> - int(%d) - [5]=> - int(%d) - [6]=> - int(%d) - [7]=> - int(%d) - [8]=> - int(%d) -} -array(9) { - [0]=> - int(0) - [1]=> - int(0) - [2]=> - int(0) - [3]=> - int(27) - [4]=> - int(5) - [5]=> - int(106) - [6]=> - int(2) - [7]=> - int(177) - [8]=> - int(0) -} -array(9) { - ["tm_sec"]=> - int(0) - ["tm_min"]=> - int(0) - ["tm_hour"]=> - int(0) - ["tm_mday"]=> - int(27) - ["tm_mon"]=> - int(5) - ["tm_year"]=> - int(106) - ["tm_wday"]=> - int(2) - ["tm_yday"]=> - int(177) - ["tm_isdst"]=> - int(0) -} -array(9) { - [0]=> - int(0) - [1]=> - int(0) - [2]=> - int(0) - [3]=> - int(27) - [4]=> - int(5) - [5]=> - int(106) - [6]=> - int(2) - [7]=> - int(177) - [8]=> - int(0) -} -Done diff --git a/ext/date/tests/008.phpt b/ext/date/tests/008.phpt deleted file mode 100644 index 424e156783368..0000000000000 --- a/ext/date/tests/008.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -getdate() tests ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -Warning: getdate() expects at most 1 parameter, 2 given in %s on line %d -bool(false) -array(11) { - ["seconds"]=> - int(0) - ["minutes"]=> - int(0) - ["hours"]=> - int(0) - ["mday"]=> - int(27) - ["wday"]=> - int(2) - ["mon"]=> - int(6) - ["year"]=> - int(2006) - ["yday"]=> - int(177) - ["weekday"]=> - string(7) "Tuesday" - ["month"]=> - string(4) "June" - [0]=> - int(1151366400) -} -array(11) { - ["seconds"]=> - int(%d) - ["minutes"]=> - int(%d) - ["hours"]=> - int(%d) - ["mday"]=> - int(%d) - ["wday"]=> - int(%d) - ["mon"]=> - int(%d) - ["year"]=> - int(%d) - ["yday"]=> - int(%d) - ["weekday"]=> - string(%d) "%s" - ["month"]=> - string(%d) "%s" - [0]=> - int(%d) -} -Done diff --git a/ext/date/tests/009.phpt b/ext/date/tests/009.phpt deleted file mode 100644 index 0ce7b7e0bac20..0000000000000 --- a/ext/date/tests/009.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -strftime() and gmstrftime() tests ---INI-- -date.timezone=Asia/Jerusalem ---FILE-- - ---EXPECTF-- -Warning: strftime() expects at least 1 parameter, 0 given in %s on line %d -bool(false) -bool(false) -string(%d) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 %s -%s %" -string(5) "%q %a" -string(%d) "%s" -string(4) "blah" - -Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d -bool(false) -bool(false) -string(%d) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 %s -%s %" -string(5) "%q %a" -string(%d) "%s" -string(4) "blah" -Done diff --git a/ext/date/tests/010.phpt b/ext/date/tests/010.phpt deleted file mode 100644 index 3cba29f01bd63..0000000000000 --- a/ext/date/tests/010.phpt +++ /dev/null @@ -1,653 +0,0 @@ ---TEST-- -timezone_abbreviations_list() tests ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -array(71) { - [0]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(16) "America/New_York" - } - [1]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "America/Antigua" - } - [2]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(16) "America/Atikokan" - } - [3]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(21) "America/Cambridge_Bay" - } - [4]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(14) "America/Cancun" - } - [5]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(14) "America/Cayman" - } - [6]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "America/Chicago" - } - [7]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(21) "America/Coral_Harbour" - } - [8]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "America/Detroit" - } - [9]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(18) "America/Fort_Wayne" - } - [10]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(18) "America/Grand_Turk" - } - [11]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(28) "America/Indiana/Indianapolis" - } - [12]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(20) "America/Indiana/Knox" - } - [13]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(23) "America/Indiana/Marengo" - } - [14]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(26) "America/Indiana/Petersburg" - } - [15]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(21) "America/Indiana/Vevay" - } - [16]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(25) "America/Indiana/Vincennes" - } - [17]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(23) "America/Indiana/Winamac" - } - [18]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(20) "America/Indianapolis" - } - [19]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "America/Iqaluit" - } - [20]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "America/Jamaica" - } - [21]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(27) "America/Kentucky/Louisville" - } - [22]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(27) "America/Kentucky/Monticello" - } - [23]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "America/Knox_IN" - } - [24]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(18) "America/Louisville" - } - [25]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "America/Managua" - } - [26]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(17) "America/Menominee" - } - [27]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(14) "America/Merida" - } - [28]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(16) "America/Montreal" - } - [29]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(14) "America/Nassau" - } - [30]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "America/Nipigon" - } - [31]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(14) "America/Panama" - } - [32]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(19) "America/Pangnirtung" - } - [33]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(22) "America/Port-au-Prince" - } - [34]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(20) "America/Rankin_Inlet" - } - [35]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(21) "America/Santo_Domingo" - } - [36]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(19) "America/Thunder_Bay" - } - [37]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "America/Toronto" - } - [38]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(14) "Canada/Eastern" - } - [39]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(3) "EST" - } - [40]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(7) "EST5EDT" - } - [41]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(7) "Jamaica" - } - [42]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(10) "US/Central" - } - [43]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(15) "US/East-Indiana" - } - [44]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(10) "US/Eastern" - } - [45]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(17) "US/Indiana-Starke" - } - [46]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(-18000) - ["timezone_id"]=> - string(11) "US/Michigan" - } - [47]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(13) "Australia/ACT" - } - [48]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(18) "Australia/Brisbane" - } - [49]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(18) "Australia/Canberra" - } - [50]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(16) "Australia/Currie" - } - [51]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(16) "Australia/Hobart" - } - [52]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(18) "Australia/Lindeman" - } - [53]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(19) "Australia/Melbourne" - } - [54]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(13) "Australia/NSW" - } - [55]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(20) "Australia/Queensland" - } - [56]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(16) "Australia/Sydney" - } - [57]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(18) "Australia/Tasmania" - } - [58]=> - array(3) { - ["dst"]=> - bool(false) - ["offset"]=> - int(36000) - ["timezone_id"]=> - string(18) "Australia/Victoria" - } - [59]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(19) "Australia/Melbourne" - } - [60]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(13) "Australia/ACT" - } - [61]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(18) "Australia/Brisbane" - } - [62]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(18) "Australia/Canberra" - } - [63]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(16) "Australia/Currie" - } - [64]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(16) "Australia/Hobart" - } - [65]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(18) "Australia/Lindeman" - } - [66]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(13) "Australia/NSW" - } - [67]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(20) "Australia/Queensland" - } - [68]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(16) "Australia/Sydney" - } - [69]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(18) "Australia/Tasmania" - } - [70]=> - array(3) { - ["dst"]=> - bool(true) - ["offset"]=> - int(39600) - ["timezone_id"]=> - string(18) "Australia/Victoria" - } -} -Done diff --git a/ext/date/tests/011.phpt b/ext/date/tests/011.phpt deleted file mode 100644 index 1302f1d2122d2..0000000000000 --- a/ext/date/tests/011.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -timezone_name_from_abbr() tests ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -Warning: timezone_name_from_abbr() expects at least 1 parameter, 0 given in %s on line 3 -bool(false) -string(13) "Europe/Berlin" -bool(false) -bool(false) -string(12) "Europe/Paris" -Done diff --git a/ext/date/tests/012.phpt b/ext/date/tests/012.phpt deleted file mode 100644 index 1eaeca09966a4..0000000000000 --- a/ext/date/tests/012.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -date_isodate_set() tests ---INI-- -date.timezone=UTC ---FILE-- -format("Y/m/d H:i:s")); -var_dump(date_isodate_set($dto, 2006)); -var_dump($dto->format("Y/m/d H:i:s")); -var_dump(date_isodate_set($dto, 2006, 5)); -var_dump($dto->format("Y/m/d H:i:s")); -var_dump(date_isodate_set($dto, 2006, 100, 15)); -var_dump($dto->format("Y/m/d H:i:s")); -var_dump(date_isodate_set($dto, 2006, 100, 15, 10)); -var_dump($dto->format("Y/m/d H:i:s")); - -echo "Done\n"; -?> ---EXPECTF-- -NULL -string(19) "2006/01/23 00:00:00" - -Warning: date_isodate_set() expects at least 3 parameters, 2 given in %s on line %d -bool(false) -string(19) "2006/01/23 00:00:00" -NULL -string(19) "2006/01/30 00:00:00" -NULL -string(19) "2007/12/10 00:00:00" - -Warning: date_isodate_set() expects at most 4 parameters, 5 given in %s on line %d -bool(false) -string(19) "2007/12/10 00:00:00" -Done diff --git a/ext/date/tests/013.phpt b/ext/date/tests/013.phpt deleted file mode 100644 index f30954adab9ef..0000000000000 --- a/ext/date/tests/013.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -date_date_set() tests ---INI-- -date.timezone=UTC ---FILE-- -format("Y.m.d H:i:s")); -var_dump(date_date_set()); -var_dump($dto->format("Y.m.d H:i:s")); -var_dump(date_date_set($dto, 2006, 5)); -var_dump($dto->format("Y.m.d H:i:s")); -var_dump(date_date_set($dto, 2006, 2, 15)); -var_dump($dto->format("Y.m.d H:i:s")); -var_dump(date_date_set($dto, 2006, 24, 60)); -var_dump($dto->format("Y.m.d H:i:s")); - -echo "Done\n"; -?> ---EXPECTF-- -object(DateTime)#%d (0) { -} -string(19) "2006.12.12 00:00:00" - -Warning: date_date_set() expects exactly 4 parameters, 0 given in %s on line %d -bool(false) -string(19) "2006.12.12 00:00:00" - -Warning: date_date_set() expects exactly 4 parameters, 3 given in %s on line %d -bool(false) -string(19) "2006.12.12 00:00:00" -NULL -string(19) "2006.02.15 00:00:00" -NULL -string(19) "2008.01.29 00:00:00" -Done diff --git a/ext/date/tests/014.phpt b/ext/date/tests/014.phpt deleted file mode 100644 index af57e55dd4cc3..0000000000000 --- a/ext/date/tests/014.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -timezone_offset_get() tests ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -object(DateTime)#%d (0) { -} -object(DateTimeZone)#%d (0) { -} - -Warning: timezone_offset_get() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) -int(0) - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, object given in %s on line %d -bool(false) -Done diff --git a/ext/date/tests/bug13142.phpt b/ext/date/tests/bug13142.phpt deleted file mode 100644 index 5e54263c54932..0000000000000 --- a/ext/date/tests/bug13142.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #13142 (strtotime handling of "M d H:i:s Y" format) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Tue, 04 Sep 2001 16:39:45 -0400 -Tue, 04 Sep 2001 16:39:45 -0400 diff --git a/ext/date/tests/bug14561.phpt b/ext/date/tests/bug14561.phpt deleted file mode 100644 index 98638c3e4b525..0000000000000 --- a/ext/date/tests/bug14561.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #14561 (strtotime() bug) ---FILE-- - ---EXPECT-- -1134847800 -1134847800 diff --git a/ext/date/tests/bug17988.phpt b/ext/date/tests/bug17988.phpt deleted file mode 100644 index 259fa7dc2e3bd..0000000000000 --- a/ext/date/tests/bug17988.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #17988 (strtotime handling of postgresql timestamps) ---FILE-- - ---EXPECT-- -2002-06-25 14:18:48 -2002-06-25 14:18:48 -2002-06-25 13:18:48 -2002-06-25 12:18:48 -2002-06-25 18:18:48 -2002-06-25 14:18:48 -2002-06-25 14:18:48 -2002-06-25 18:18:48 -2002-06-25 10:18:48 -2002-06-25 17:18:48 -2002-06-25 11:18:48 -2002-06-25 17:48:48 -2002-06-25 10:48:48 diff --git a/ext/date/tests/bug20382-1.phpt b/ext/date/tests/bug20382-1.phpt deleted file mode 100644 index a259d934af1d6..0000000000000 --- a/ext/date/tests/bug20382-1.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #20382 [1] (strtotime ("Monday", $date) produces wrong result on DST changeover) ---FILE-- - ---EXPECT-- -tStamp=Wednesday 2004-10-27 17:17:17 CEST -result=Monday 2004-11-01 00:00:00 CET -wanted=Monday 2004-11-01 00:00:00 CET diff --git a/ext/date/tests/bug20382-2.phpt b/ext/date/tests/bug20382-2.phpt deleted file mode 100644 index 2026ed44da415..0000000000000 --- a/ext/date/tests/bug20382-2.phpt +++ /dev/null @@ -1,170 +0,0 @@ ---TEST-- -Bug #20382 [2] (strtotime ("Monday", $date) produces wrong result on DST changeover) ---FILE-- - ---EXPECT-- -Europe/Andorra -ts = Monday 2037-10-19 17:17:17 CEST -result = Monday 2037-10-26 00:00:00 CET -wanted = Monday 00:00:00 - -Asia/Dubai -ts = Thursday 1970-01-01 17:17:17 GST -result = Monday 1970-01-05 00:00:00 GST -wanted = Monday 00:00:00 - -Asia/Kabul -ts = Thursday 1970-01-01 17:17:17 AFT -result = Monday 1970-01-05 00:00:00 AFT -wanted = Monday 00:00:00 - -America/Antigua -ts = Thursday 1970-01-01 17:17:17 AST -result = Monday 1970-01-05 00:00:00 AST -wanted = Monday 00:00:00 - -America/Anguilla -ts = Thursday 1970-01-01 17:17:17 AST -result = Monday 1970-01-05 00:00:00 AST -wanted = Monday 00:00:00 - -Europe/Tirane -ts = Monday 1983-04-11 17:17:17 CET -result = Monday 1983-04-18 01:00:00 CEST -wanted = Monday 00:00:00 - -Asia/Yerevan -ts = Monday 2037-10-19 17:17:17 AMST -result = Monday 2037-10-26 00:00:00 AMT -wanted = Monday 00:00:00 - -America/Curacao -ts = Thursday 1970-01-01 17:17:17 AST -result = Monday 1970-01-05 00:00:00 AST -wanted = Monday 00:00:00 - -Africa/Luanda -ts = Thursday 1970-01-01 17:17:17 WAT -result = Monday 1970-01-05 00:00:00 WAT -wanted = Monday 00:00:00 - -Antarctica/McMurdo -ts = Monday 2037-09-28 17:17:17 NZDT -result = Monday 2037-10-05 00:00:00 NZDT -wanted = Monday 00:00:00 - -Australia/Adelaide -ts = Friday 1971-01-01 17:17:17 CST -result = Monday 1971-01-04 00:00:00 CST -wanted = Monday 00:00:00 - -Australia/Darwin -ts = Monday 1971-03-29 17:17:17 CST -result = Monday 1971-04-05 00:00:00 CST -wanted = Monday 00:00:00 - -Australia/Perth -ts = Friday 1971-01-01 17:17:17 WST -result = Monday 1971-01-04 00:00:00 WST -wanted = Monday 00:00:00 - -America/Aruba -ts = Monday 1971-03-29 17:17:17 AST -result = Monday 1971-04-05 00:00:00 AST -wanted = Monday 00:00:00 - -Asia/Baku -ts = Friday 1971-01-01 17:17:17 BAKT -result = Monday 1971-01-04 00:00:00 BAKT -wanted = Monday 00:00:00 - -Europe/Sarajevo -ts = Friday 1971-01-01 17:17:17 CET -result = Monday 1971-01-04 00:00:00 CET -wanted = Monday 00:00:00 - -America/Barbados -ts = Friday 1971-01-01 17:17:17 AST -result = Monday 1971-01-04 00:00:00 AST -wanted = Monday 00:00:00 - -Asia/Dacca -ts = Friday 1971-01-01 17:17:17 DACT -result = Monday 1971-01-04 00:00:00 DACT -wanted = Monday 00:00:00 - -Europe/Brussels -ts = Friday 1971-01-01 17:17:17 CET -result = Monday 1971-01-04 00:00:00 CET -wanted = Monday 00:00:00 - -Africa/Ouagadougou -ts = Monday 1971-03-29 17:17:17 GMT -result = Monday 1971-04-05 00:00:00 GMT -wanted = Monday 00:00:00 - -Europe/Tirane -ts = Monday 1983-04-11 17:17:17 CET -result = Monday 1983-04-18 01:00:00 CEST -wanted = Monday 00:00:00 - -America/Buenos_Aires -ts = Monday 1974-09-30 17:17:17 ART -result = Monday 1974-10-07 00:00:00 ART -wanted = Monday 00:00:00 - -America/Rosario -ts = Monday 1974-09-30 17:17:17 ART -result = Monday 1974-10-07 00:00:00 ART -wanted = Monday 00:00:00 - -Europe/Vienna -ts = Monday 1980-03-31 17:17:17 CET -result = Monday 1980-04-07 00:00:00 CEST -wanted = Monday 00:00:00 - -Asia/Baku -ts = Monday 1995-12-25 17:17:17 AZT -result = Monday 1996-01-01 00:00:00 AZT -wanted = Monday 00:00:00 diff --git a/ext/date/tests/bug21399.phpt b/ext/date/tests/bug21399.phpt deleted file mode 100644 index 08040bec54307..0000000000000 --- a/ext/date/tests/bug21399.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #21399 (strtotime() request for "YYYYMMDDhhmmss [ZZZ]") ---FILE-- - ---EXPECT-- -2005-06-20 09:14:07 diff --git a/ext/date/tests/bug21966.phpt b/ext/date/tests/bug21966.phpt deleted file mode 100644 index 31f592fa98407..0000000000000 --- a/ext/date/tests/bug21966.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #21966 (date() or mktime() returning bad value for mktime month param of '2') ---FILE-- - ---EXPECT-- -27/3/04 = 1080345600 -28/3/04 = 1080432000 -28/3/04 = 1080435600 -29/3/04 = 1080514800 -30/3/04 = 1080601200 diff --git a/ext/date/tests/bug26090.phpt b/ext/date/tests/bug26090.phpt deleted file mode 100644 index 03a90352cc092..0000000000000 --- a/ext/date/tests/bug26090.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #26090 (allow colons in time zone offset to strtotime()) ---FILE-- - ---EXPECT-- -2003-10-28 13:20:30 EST -2003-10-28 13:20:30 EST diff --git a/ext/date/tests/bug26198.phpt b/ext/date/tests/bug26198.phpt deleted file mode 100644 index c957bfcf7a9b9..0000000000000 --- a/ext/date/tests/bug26198.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #26198 (strtotime handling of "M Y" and "Y M" format) ---FILE-- - ---EXPECT-- -October 2001 (2001-10-01 00:00:00 GMT) -Oct 2001 (2001-10-01 00:00:00 GMT) diff --git a/ext/date/tests/bug26317.phpt b/ext/date/tests/bug26317.phpt deleted file mode 100644 index aef29035e2a91..0000000000000 --- a/ext/date/tests/bug26317.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #26317 (military timezone offset signedness) ---SKIPIF-- -if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { - die("skip unable to change TZ enviroment variable\n"); -} ---FILE-- - ---EXPECT-- -2003-11-19 16:20:42 -2003-11-19 16:20:42 -2003-11-19 16:20:42 diff --git a/ext/date/tests/bug26320.phpt b/ext/date/tests/bug26320.phpt deleted file mode 100644 index 5b237cadbf1cb..0000000000000 --- a/ext/date/tests/bug26320.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #26320 (strtotime handling of XML Schema/ISO 8601 format) ---SKIPIF-- -if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { - die("skip unable to change TZ enviroment variable\n"); -} ---FILE-- - ---EXPECT-- -2003-11-19 12:30:42 -2003-11-19 12:30:42 diff --git a/ext/date/tests/bug26694.phpt b/ext/date/tests/bug26694.phpt deleted file mode 100644 index a709d1666c335..0000000000000 --- a/ext/date/tests/bug26694.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #26694 (strtotime() request for "Sun, 21 Dec 2003 20:38:33 +0000 GMT") ---FILE-- - ---EXPECT-- -2003-12-21 20:38:33 diff --git a/ext/date/tests/bug27719.phpt b/ext/date/tests/bug27719.phpt deleted file mode 100644 index 6f65bfb85e0a2..0000000000000 --- a/ext/date/tests/bug27719.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -Bug #27719 (mktime returns incorrect timestamp for dst days) ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECTF-- -1081054800 04/04/04 12:00:00 -%s -1081054800 04/04/04 12:00:00 - -1075870800 02/04/04 12:00:00 -1075867200 02/03/04 11:00:00 -1075870800 02/04/04 12:00:00 - -1081054800 04/04/04 12:00:00 -1081051200 04/03/04 11:00:00 -1081054800 04/04/04 12:00:00 - -1081065600 04/04/04 04:00:00 -1081062000 04/04/04 03:00:00 -1081062000 04/04/04 03:00:00 - -1086325200 06/04/04 01:00:00 -1086321600 06/04/04 12:00:00 -1086321600 06/04/04 12:00:00 diff --git a/ext/date/tests/bug27780.phpt b/ext/date/tests/bug27780.phpt deleted file mode 100644 index f1e6eb67bd9e9..0000000000000 --- a/ext/date/tests/bug27780.phpt +++ /dev/null @@ -1,113 +0,0 @@ ---TEST-- -Bug #27780 (strtotime(+1 xxx) returns a wrong date/time) ---FILE-- - ---EXPECT-- -America/Chicago -1076824799 [2004-02-14 23:59:59 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076824800 [2004-02-15 00:00:00 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076824801 [2004-02-15 00:00:01 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079503200 [2004-03-17 00:00:00 CST] [2004-04-07 00:00:00 -21 days] -1080367200 [2004-03-27 00:00:00 CST] [2004-04-07 00:00:00 11 days ago] -1080460800 [2004-03-28 02:00:00 CST] [2004-04-07 00:00:00 -10 day +2 hours] -1081227600 [2004-04-06 00:00:00 CDT] [2004-04-07 00:00:00 -1 day] -1081314000 [2004-04-07 00:00:00 CDT] [2004-04-07 00:00:00] -1081317600 [2004-04-07 01:00:00 CDT] [2004-04-07 00:00:00 +1 hour] -1081321200 [2004-04-07 02:00:00 CDT] [2004-04-07 00:00:00 +2 hour] -1081400400 [2004-04-08 00:00:00 CDT] [2004-04-07 00:00:00 +1 day] -1081400400 [2004-04-08 00:00:00 CDT] [2004-04-07 00:00:00 1 day] -1083128400 [2004-04-28 00:00:00 CDT] [2004-04-07 00:00:00 +21 days] - -Europe/Amsterdam -1076799599 [2004-02-14 23:59:59 CET] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076799600 [2004-02-15 00:00:00 CET] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076799601 [2004-02-15 00:00:01 CET] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079478000 [2004-03-17 00:00:00 CET] [2004-04-07 00:00:00 -21 days] -1080342000 [2004-03-27 00:00:00 CET] [2004-04-07 00:00:00 11 days ago] -1080435600 [2004-03-28 03:00:00 CEST] [2004-04-07 00:00:00 -10 day +2 hours] -1081202400 [2004-04-06 00:00:00 CEST] [2004-04-07 00:00:00 -1 day] -1081288800 [2004-04-07 00:00:00 CEST] [2004-04-07 00:00:00] -1081292400 [2004-04-07 01:00:00 CEST] [2004-04-07 00:00:00 +1 hour] -1081296000 [2004-04-07 02:00:00 CEST] [2004-04-07 00:00:00 +2 hour] -1081375200 [2004-04-08 00:00:00 CEST] [2004-04-07 00:00:00 +1 day] -1081375200 [2004-04-08 00:00:00 CEST] [2004-04-07 00:00:00 1 day] -1083103200 [2004-04-28 00:00:00 CEST] [2004-04-07 00:00:00 +21 days] - -Asia/Jerusalem -1076795999 [2004-02-14 23:59:59 IST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076796000 [2004-02-15 00:00:00 IST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076796001 [2004-02-15 00:00:01 IST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079474400 [2004-03-17 00:00:00 IST] [2004-04-07 00:00:00 -21 days] -1080338400 [2004-03-27 00:00:00 IST] [2004-04-07 00:00:00 11 days ago] -1080432000 [2004-03-28 02:00:00 IST] [2004-04-07 00:00:00 -10 day +2 hours] -1081202400 [2004-04-06 00:00:00 IST] [2004-04-07 00:00:00 -1 day] -1081288800 [2004-04-07 00:00:00 IST] [2004-04-07 00:00:00] -1081292400 [2004-04-07 02:00:00 IDT] [2004-04-07 00:00:00 +1 hour] -1081292400 [2004-04-07 02:00:00 IDT] [2004-04-07 00:00:00 +2 hour] -1081371600 [2004-04-08 00:00:00 IDT] [2004-04-07 00:00:00 +1 day] -1081371600 [2004-04-08 00:00:00 IDT] [2004-04-07 00:00:00 1 day] -1083099600 [2004-04-28 00:00:00 IDT] [2004-04-07 00:00:00 +21 days] - -Asia/Singapore -1076774399 [2004-02-14 23:59:59 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076774400 [2004-02-15 00:00:00 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076774401 [2004-02-15 00:00:01 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079452800 [2004-03-17 00:00:00 SGT] [2004-04-07 00:00:00 -21 days] -1080316800 [2004-03-27 00:00:00 SGT] [2004-04-07 00:00:00 11 days ago] -1080410400 [2004-03-28 02:00:00 SGT] [2004-04-07 00:00:00 -10 day +2 hours] -1081180800 [2004-04-06 00:00:00 SGT] [2004-04-07 00:00:00 -1 day] -1081267200 [2004-04-07 00:00:00 SGT] [2004-04-07 00:00:00] -1081270800 [2004-04-07 01:00:00 SGT] [2004-04-07 00:00:00 +1 hour] -1081274400 [2004-04-07 02:00:00 SGT] [2004-04-07 00:00:00 +2 hour] -1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 +1 day] -1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 1 day] -1083081600 [2004-04-28 00:00:00 SGT] [2004-04-07 00:00:00 +21 days] - -America/Sao_Paulo -1076810399 [2004-02-14 23:59:59 BRST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds] -1076814000 [2004-02-15 00:00:00 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds] -1076814001 [2004-02-15 00:00:01 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds] -1079492400 [2004-03-17 00:00:00 BRT] [2004-04-07 00:00:00 -21 days] -1080356400 [2004-03-27 00:00:00 BRT] [2004-04-07 00:00:00 11 days ago] -1080450000 [2004-03-28 02:00:00 BRT] [2004-04-07 00:00:00 -10 day +2 hours] -1081220400 [2004-04-06 00:00:00 BRT] [2004-04-07 00:00:00 -1 day] -1081306800 [2004-04-07 00:00:00 BRT] [2004-04-07 00:00:00] -1081310400 [2004-04-07 01:00:00 BRT] [2004-04-07 00:00:00 +1 hour] -1081314000 [2004-04-07 02:00:00 BRT] [2004-04-07 00:00:00 +2 hour] -1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 +1 day] -1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 1 day] -1083121200 [2004-04-28 00:00:00 BRT] [2004-04-07 00:00:00 +21 days] diff --git a/ext/date/tests/bug28024.phpt b/ext/date/tests/bug28024.phpt deleted file mode 100644 index 3e0399adbed3b..0000000000000 --- a/ext/date/tests/bug28024.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #28024 (Changed behavior of strtotime()) ---FILE-- - ---EXPECT-- -1072972800 -2004-01-01 17:00:00 CET diff --git a/ext/date/tests/bug28088.phpt b/ext/date/tests/bug28088.phpt deleted file mode 100644 index 95866e00be461..0000000000000 --- a/ext/date/tests/bug28088.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #28088 (strtotime() cannot convert 00 hours") ---FILE-- - ---EXPECT-- -The following line rightly shows the correct date time: -04/04/04 2345 -But the following line fails to show the correct date time: -04/04/04 0045 diff --git a/ext/date/tests/bug28599.phpt b/ext/date/tests/bug28599.phpt deleted file mode 100644 index fcd17b46972fb..0000000000000 --- a/ext/date/tests/bug28599.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #28599 (strtotime fails with zero base time) ---FILE-- - ---EXPECT-- -15-11-2004 16:49:33 diff --git a/ext/date/tests/bug29150.phpt b/ext/date/tests/bug29150.phpt deleted file mode 100644 index 274584d050842..0000000000000 --- a/ext/date/tests/bug29150.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #29150 (Roman number format for months) ---FILE-- - ---EXPECT-- -2005-06-20 00:00:00 diff --git a/ext/date/tests/bug29585.phpt b/ext/date/tests/bug29585.phpt deleted file mode 100644 index 394569924662b..0000000000000 --- a/ext/date/tests/bug29585.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #29585 (Support week numbers in strtotime()) ---FILE-- - ---EXPECT-- -2004-07-19 00:00:00 diff --git a/ext/date/tests/bug29595.phpt b/ext/date/tests/bug29595.phpt deleted file mode 100644 index 285ade140b348..0000000000000 --- a/ext/date/tests/bug29595.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #29595 (Roman number format for months) ---FILE-- - ---EXPECT-- -1092026907 diff --git a/ext/date/tests/bug30096.phpt b/ext/date/tests/bug30096.phpt deleted file mode 100644 index fa4f716ee650b..0000000000000 --- a/ext/date/tests/bug30096.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Bug #30096 (gmmktime does not return the corrent time) ---INI-- -error_reporting=2047 ---FILE-- - dst\n"; -$ts = -1; -gm_date_check(01,00,00,03,27,2005); -gm_date_check(02,00,00,03,27,2005); -gm_date_check(03,00,00,03,27,2005); -gm_date_check(04,00,00,03,27,2005); - -echo "\ndst --> no dst\n"; -$ts = -1; -gm_date_check(01,00,00,10,30,2005); -gm_date_check(02,00,00,10,30,2005); -gm_date_check(03,00,00,10,30,2005); -gm_date_check(04,00,00,10,30,2005); - -function gm_date_check($hour, $minute, $second, $month, $day, $year) { - global $ts, $tsold; - - echo "gmmktime($hour,$minute,$second,$month,$day,$year): "; - - $tsold = $ts; - $ts = gmmktime($hour, $minute, $second, $month, $day, $year); - - echo $ts, " | gmdate('r', $ts):", gmdate('r', $ts); - if ($tsold > 0) { - echo " | Diff: " . ($ts - $tsold); - } - echo "\n"; -} - -?> ---EXPECT-- -no dst --> dst -gmmktime(1,0,0,3,27,2005): 1111885200 | gmdate('r', 1111885200):Sun, 27 Mar 2005 01:00:00 +0000 -gmmktime(2,0,0,3,27,2005): 1111888800 | gmdate('r', 1111888800):Sun, 27 Mar 2005 02:00:00 +0000 | Diff: 3600 -gmmktime(3,0,0,3,27,2005): 1111892400 | gmdate('r', 1111892400):Sun, 27 Mar 2005 03:00:00 +0000 | Diff: 3600 -gmmktime(4,0,0,3,27,2005): 1111896000 | gmdate('r', 1111896000):Sun, 27 Mar 2005 04:00:00 +0000 | Diff: 3600 - -dst --> no dst -gmmktime(1,0,0,10,30,2005): 1130634000 | gmdate('r', 1130634000):Sun, 30 Oct 2005 01:00:00 +0000 -gmmktime(2,0,0,10,30,2005): 1130637600 | gmdate('r', 1130637600):Sun, 30 Oct 2005 02:00:00 +0000 | Diff: 3600 -gmmktime(3,0,0,10,30,2005): 1130641200 | gmdate('r', 1130641200):Sun, 30 Oct 2005 03:00:00 +0000 | Diff: 3600 -gmmktime(4,0,0,10,30,2005): 1130644800 | gmdate('r', 1130644800):Sun, 30 Oct 2005 04:00:00 +0000 | Diff: 3600 diff --git a/ext/date/tests/bug30532.phpt b/ext/date/tests/bug30532.phpt deleted file mode 100644 index faee0b316f32c..0000000000000 --- a/ext/date/tests/bug30532.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #30532 (strtotime - crossing daylight savings time) ---FILE-- - ---EXPECT-- -2004-10-31 01:00:00 EDT -2004-10-31 01:00:00 EST -2004-10-31 02:00:00 EST - -2004-10-31 01:00:00 EDT -2004-10-31 02:00:00 EST -2004-10-31 03:00:00 EST diff --git a/ext/date/tests/bug32086.phpt b/ext/date/tests/bug32086.phpt deleted file mode 100644 index 2799164cb1842..0000000000000 --- a/ext/date/tests/bug32086.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Bug #32086 (strtotime don't work in DST) ---FILE-- - ---EXPECT-- -1099278000 -1099364400 -1099364400 -1099364400 -1099447200 -2004-11-01 00:00:00 BRT -2004-11-02 01:00:00 BRST -2004-11-02 01:00:00 BRST -2004-11-02 01:00:00 BRST -2004-11-03 00:00:00 BRST -1108778400 -1108868400 -1108868400 -1108868400 -1108954800 -2005-02-19 00:00:00 BRST -2005-02-20 00:00:00 BRT -2005-02-20 00:00:00 BRT -2005-02-20 00:00:00 BRT -2005-02-21 00:00:00 BRT diff --git a/ext/date/tests/bug32270.phpt b/ext/date/tests/bug32270.phpt deleted file mode 100644 index 2c5ff47549803..0000000000000 --- a/ext/date/tests/bug32270.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #32270 (strtotime/date behavior) ---FILE-- - ---EXPECT-- -01/01/1902 00:00:00 PST --2145888000 -01/01/1950 00:00:00 PST --631123200 -01/01/2000 00:00:00 PST -946713600 diff --git a/ext/date/tests/bug32555.phpt b/ext/date/tests/bug32555.phpt deleted file mode 100644 index 3ef513b5e902f..0000000000000 --- a/ext/date/tests/bug32555.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #32555 (strtotime("tomorrow") can return false) ---FILE-- - ---EXPECT-- -Sat Apr 2 02:30:00 2005 EST -Sun Apr 3 00:00:00 2005 EST -Sun Apr 3 03:30:00 2005 EDT -Mon Apr 4 02:30:00 2005 EDT diff --git a/ext/date/tests/bug32588.phpt b/ext/date/tests/bug32588.phpt deleted file mode 100644 index 6cf5ac92f85ff..0000000000000 --- a/ext/date/tests/bug32588.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #32588 (strtotime() error for 'last xxx' DST problem) ---FILE-- - ---EXPECT-- -1116406800 -1116407554 -1116443554 diff --git a/ext/date/tests/bug33414-1.phpt b/ext/date/tests/bug33414-1.phpt deleted file mode 100644 index 7b15228cf348b..0000000000000 --- a/ext/date/tests/bug33414-1.phpt +++ /dev/null @@ -1,320 +0,0 @@ ---TEST-- -Bug #33414 [1] (Comprehensive list of incorrect days returned after strotime() / date() tests) ---FILE-- - ---EXPECT-- -TZ=America/Mendoza - wrong day. -tStamp=Sunday 1992-10-18 17:17:17 ARST 1 -result=Sunday 1992-10-25 00:00:00 ARST 1 -wanted=Sunday 00:00:00 - -TZ=America/Catamarca - wrong day. -tStamp=Sunday 1990-10-21 17:17:17 ARST 1 -result=Sunday 1990-10-28 00:00:00 ARST 1 -wanted=Sunday 00:00:00 - -TZ=America/Cordoba - wrong day. -tStamp=Sunday 1990-10-21 17:17:17 ARST 1 -result=Sunday 1990-10-28 00:00:00 ARST 1 -wanted=Sunday 00:00:00 - -TZ=America/Rosario - wrong day. -tStamp=Tuesday 1991-10-15 17:17:17 WART 0 -result=Tuesday 1991-10-22 00:00:00 ARST 1 -wanted=Tuesday 00:00:00 - -TZ=Europe/Vienna - wrong day - giving unexpected results, at -least on my system :-) -tStamp=Thursday 1980-04-03 17:17:17 CET 0 -result=Thursday 1980-04-10 00:00:00 CEST 1 -wanted=Thursday 00:00:00 - -TZ=Asia/Baku - wrong day. -tStamp=Sunday 1992-09-20 17:17:17 AZST 1 -result=Sunday 1992-09-27 00:00:00 AZT 0 -wanted=Sunday 00:00:00 - -TZ=America/Noronha - wrong day. -tStamp=Friday 1999-10-01 17:17:17 FNT 0 -result=Friday 1999-10-08 00:00:00 FNST 1 -wanted=Friday 00:00:00 - -TZ=America/Havana - wrong day. -tStamp=Thursday 2004-10-28 17:17:17 CDT 1 -result=Thursday 2004-11-04 00:00:00 CDT 1 -wanted=Thursday 00:00:00 - -TZ=Europe/Tallinn - wrong day. -tStamp=Saturday 2002-03-30 17:17:17 EET 0 -result=Saturday 2002-04-06 00:00:00 EEST 1 -wanted=Saturday 00:00:00 - -TZ=Asia/Jerusalem - wrong day. -tStamp=Thursday 2005-09-29 17:17:17 IDT 1 -result=Thursday 2005-10-06 00:00:00 IDT 1 -wanted=Thursday 00:00:00 - -TZ=Europe/Vilnius - wrong day. -tStamp=Friday 2003-03-28 17:17:17 EET 0 -result=Friday 2003-04-04 00:00:00 EEST 1 -wanted=Friday 00:00:00 - -TZ=Pacific/Kwajalein - wrong day. -tStamp=Friday 1993-08-13 17:17:17 KWAT 0 -result=Saturday 1993-08-21 00:00:00 MHT 0 -wanted=Friday 00:00:00 - -TZ=Asia/Ulan_Bator - wrong day. -tStamp=Saturday 2001-09-22 17:17:17 ULAST 1 -result=Saturday 2001-09-29 00:00:00 ULAST 1 -wanted=Saturday 00:00:00 - -TZ=America/Cancun - wrong day. -tStamp=Sunday 2002-04-07 17:17:17 CDT 1 -result=Sunday 2002-04-14 00:00:00 CDT 1 -wanted=Sunday 00:00:00 - -TZ=America/Mexico_City - wrong day. -tStamp=Wednesday 2002-04-03 17:17:17 CST 0 -result=Wednesday 2002-04-10 00:00:00 CDT 1 -wanted=Wednesday 00:00:00 - -TZ=America/Mazatlan - wrong day. -tStamp=Tuesday 2002-04-02 17:17:17 MST 0 -result=Tuesday 2002-04-09 00:00:00 MDT 1 -wanted=Tuesday 00:00:00 - -TZ=America/Chihuahua - wrong day. -tStamp=Thursday 2002-04-04 17:17:17 MST 0 -result=Thursday 2002-04-11 00:00:00 MDT 1 -wanted=Thursday 00:00:00 - -TZ=Asia/Kuala_Lumpur - wrong day. -tStamp=Monday 1981-12-28 17:17:17 MALT 0 -result=Monday 1982-01-04 00:00:00 MYT 0 -wanted=Monday 00:00:00 - -TZ=Pacific/Chatham - wrong day. -tStamp=Monday 1974-10-28 17:17:17 CHAST 0 -result=Monday 1974-11-04 00:00:00 CHADT 1 -wanted=Monday 00:00:00 - -TZ=America/Lima - wrong day. -tStamp=Thursday 1985-12-26 17:17:17 PET 0 -result=Thursday 1986-01-02 00:00:00 PEST 1 -wanted=Thursday 00:00:00 - -TZ=Asia/Karachi - wrong day. -tStamp=Friday 2002-04-05 17:17:17 PKT 0 -result=Friday 2002-04-12 00:00:00 PKST 1 -wanted=Friday 00:00:00 - -TZ=America/Asuncion - wrong day. -tStamp=Wednesday 2002-02-27 17:17:17 PYST 1 -result=Wednesday 2002-03-06 00:00:00 PYST 1 -wanted=Wednesday 00:00:00 - -TZ=Asia/Singapore - wrong day. -tStamp=Thursday 1981-12-31 17:17:17 SGT 0 -result=Thursday 1982-01-07 00:00:00 SGT 0 -wanted=Thursday 00:00:00 - -TZ=America/Montevideo - wrong day. -tStamp=Thursday 2004-09-16 17:17:17 UYT 0 -result=Thursday 2004-09-23 00:00:00 UYST 1 -wanted=Thursday 00:00:00 diff --git a/ext/date/tests/bug33414-2.phpt b/ext/date/tests/bug33414-2.phpt deleted file mode 100644 index 8eb2a35697227..0000000000000 --- a/ext/date/tests/bug33414-2.phpt +++ /dev/null @@ -1,121 +0,0 @@ ---TEST-- -Bug #33414 [2] (Comprehensive list of incorrect days returned after strotime() / date() tests) ---FILE-- - ---EXPECT-- -TZ=Pacific/Rarotonga - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 CKT 0 -result=Tuesday 1970-01-06 00:00:00 CKT 0 -wanted=Tuesday 00:00:00 - -TZ=Atlantic/South_Georgia - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 GST 0 -result=Tuesday 1970-01-06 00:00:00 GST 0 -wanted=Tuesday 00:00:00 - -TZ=America/Port-au-Prince - wrong day. -tStamp=Monday 2005-03-28 17:17:17 EST 0 -result=Monday 2005-04-04 00:00:00 EDT 1 -wanted=Monday 00:00:00 - -TZ=Pacific/Enderbury - wrong day, off by 2 days. -tStamp=Thursday 1970-01-01 17:17:17 PHOT 0 -result=Monday 1970-01-05 00:00:00 PHOT 0 -wanted=Monday 00:00:00 - -TZ=Pacific/Kiritimati - wrong day, off by 2 days. -tStamp=Thursday 1970-01-01 17:17:17 LINT 0 -result=Monday 1970-01-05 00:00:00 LINT 0 -wanted=Monday 00:00:00 - -TZ=America/Managua - wrong day. -tStamp=Tuesday 2005-04-05 17:17:17 CST 0 -result=Tuesday 2005-04-12 00:00:00 CDT 1 -wanted=Tuesday 00:00:00 - -TZ=Pacific/Pitcairn - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 PNT 0 -result=Wednesday 1970-01-07 00:00:00 PNT 0 -wanted=Wednesday 00:00:00 - -TZ=Pacific/Fakaofo - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 TKT 0 -result=Saturday 1970-01-03 00:00:00 TKT 0 -wanted=Saturday 00:00:00 - -TZ=Pacific/Johnston - wrong day. -tStamp=Thursday 1970-01-01 17:17:17 HST 0 -result=Friday 1970-01-02 00:00:00 HST 0 -wanted=Friday 00:00:00 diff --git a/ext/date/tests/bug33415-1.phpt b/ext/date/tests/bug33415-1.phpt deleted file mode 100644 index 3d36af8a53329..0000000000000 --- a/ext/date/tests/bug33415-1.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #33415 [1] (Possibly invalid non-one-hour DST or timezone shifts) ---FILE-- - ---EXPECT-- -TZ=America/Jujuy - Is it OK for this to be 2 AM, rather than 1 -AM as per most DST transitions? -tStamp=Monday 1990-10-15 17:17:17 WART 0 -result=Monday 1990-10-22 00:00:00 WART 0 -wanted=Monday 00:00:00 - -TZ=Asia/Tbilisi - Is it OK for this to be 2 AM? -tStamp=Sunday 2005-03-20 17:17:17 GET 0 -result=Sunday 2005-03-27 00:00:00 GET 0 -wanted=Sunday 00:00:00 diff --git a/ext/date/tests/bug33415-2.phpt b/ext/date/tests/bug33415-2.phpt deleted file mode 100644 index a1e5930b5ff52..0000000000000 --- a/ext/date/tests/bug33415-2.phpt +++ /dev/null @@ -1,342 +0,0 @@ ---TEST-- -Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts) ---FILE-- - ---EXPECT-- -TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to -have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 CAT 0 -result=Wednesday 1970-01-07 00:00:00 CAT 0 -wanted=Wednesday 00:00:00 - -TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes -tStamp=Thursday 1987-09-24 17:17:17 IST 0 -result=Thursday 1987-10-01 00:30:00 BTT 0 -wanted=Thursday 00:30:00 - -TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not -appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 CCT 0 -result=Thursday 1970-01-08 00:00:00 CCT 0 -wanted=Thursday 00:00:00 - -TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 CAT 0 -result=Saturday 1970-01-03 00:00:00 CAT 0 -wanted=Saturday 00:00:00 - -TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes -tStamp=Thursday 1980-04-24 17:17:17 KAST 0 -result=Thursday 1980-05-01 03:00:00 CST 0 -wanted=Thursday 03:00:00 - -TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 CXT 0 -result=Sunday 1970-01-04 00:00:00 CXT 0 -wanted=Sunday 00:00:00 - -TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes -tStamp=Sunday 1970-10-18 17:17:17 EST 0 -result=Sunday 1970-10-25 00:30:00 EHDT 1 -wanted=Sunday 00:30:00 - -TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not -appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 TRUT 0 -result=Tuesday 1970-01-06 00:00:00 TRUT 0 -wanted=Tuesday 00:00:00 - -TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 PONT 0 -result=Monday 1970-01-05 00:00:00 PONT 0 -wanted=Monday 00:00:00 - -TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes -tStamp=Sunday 1981-03-22 17:17:17 CGT 0 -result=Sunday 1981-03-29 02:00:00 EGST 1 -wanted=Sunday 02:00:00 - -TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes -tStamp=Thursday 1975-07-24 17:17:17 GYT 0 -result=Thursday 1975-07-31 00:45:00 GYT 0 -wanted=Thursday 00:45:00 - -TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes -tStamp=Tuesday 1977-10-25 17:17:17 IRST 0 -result=Tuesday 1977-11-01 00:30:00 IRST 0 -wanted=Tuesday 00:30:00 - -TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 GILT 0 -result=Monday 1970-01-05 00:00:00 GILT 0 -wanted=Monday 00:00:00 - -TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes -tStamp=Monday 1972-04-24 17:17:17 LRT 0 -result=Monday 1972-05-01 00:44:30 GMT 0 -wanted=Monday 00:44:30 - -TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes -tStamp=Wednesday 1985-12-25 17:17:17 IST 0 -result=Wednesday 1986-01-01 00:15:00 NPT 0 -wanted=Wednesday 00:15:00 - -TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes -tStamp=Tuesday 1979-04-24 17:17:17 NRT 0 -result=Tuesday 1979-05-01 00:30:00 NRT 0 -wanted=Tuesday 00:30:00 - -TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes -tStamp=Sunday 1978-09-24 17:17:17 NUT 0 -result=Sunday 1978-10-01 00:30:00 NUT 0 -wanted=Sunday 00:30:00 - -TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST -or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 PGT 0 -result=Thursday 1970-01-08 00:00:00 PGT 0 -wanted=Thursday 00:00:00 - -TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes -tStamp=Thursday 1980-04-24 17:17:17 AST 0 -result=Thursday 1980-05-01 01:00:00 PMST 0 -wanted=Thursday 01:00:00 - -TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or -timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 PWT 0 -result=Saturday 1970-01-03 00:00:00 PWT 0 -wanted=Saturday 00:00:00 - -TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 TVT 0 -result=Wednesday 1970-01-07 00:00:00 TVT 0 -wanted=Wednesday 00:00:00 - -TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not -appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 WAKT 0 -result=Tuesday 1970-01-06 00:00:00 WAKT 0 -wanted=Tuesday 00:00:00 - -TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does -not appear to have a DST or timezone transition. -tStamp=Thursday 1970-01-01 17:17:17 WFT 0 -result=Tuesday 1970-01-06 00:00:00 WFT 0 -wanted=Tuesday 00:00:00 - -TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes -tStamp=Monday 1984-09-24 17:17:17 SRT 0 -result=Monday 1984-10-01 00:30:00 SRT 0 -wanted=Monday 00:30:00 diff --git a/ext/date/tests/bug33452.phpt b/ext/date/tests/bug33452.phpt deleted file mode 100644 index e5abebf3c8dd6..0000000000000 --- a/ext/date/tests/bug33452.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #33452 (Support for year accompanying ISO week nr) ---FILE-- - ---EXPECT-- -2005-53 -2004-53 diff --git a/ext/date/tests/bug33532.phpt b/ext/date/tests/bug33532.phpt deleted file mode 100644 index 2a8da034120c9..0000000000000 --- a/ext/date/tests/bug33532.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Bug #33532 (Different output for strftime() and date()) ---INI-- -error_reporting=2047 -date.timezone=UTC ---FILE-- - ---EXPECT-- -TZ has NOT been set -Should strftime==datestr? Strftime seems to assume GMT tStamp. -input 10:00:00 AM July 1 2005 -strftime 10:00:00 AM July 1 2005 UTC +0000 -datestr 10:00:00 AM July 1 2005 UTC - -Setting TZ -input 10:00:00 AM July 1 2005 -strftime 10:00:00 AM July 1 2005 EST +1000 -datestr 10:00:00 AM July 1 2005 EST diff --git a/ext/date/tests/bug33536.phpt b/ext/date/tests/bug33536.phpt deleted file mode 100644 index aa5f5ddb38bfe..0000000000000 --- a/ext/date/tests/bug33536.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #33456 (strtotime defaults to now even on non time string) ---FILE-- - ---EXPECT-- -bool(false) -1970-01-01 -1970-01-01 diff --git a/ext/date/tests/bug33562.phpt b/ext/date/tests/bug33562.phpt deleted file mode 100644 index 8383a79ab7359..0000000000000 --- a/ext/date/tests/bug33562.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #33562 (date("") crashes) ---FILE-- - ---EXPECT-- -[] -done diff --git a/ext/date/tests/bug33563.phpt b/ext/date/tests/bug33563.phpt deleted file mode 100644 index 9f4eb7b4d27dd..0000000000000 --- a/ext/date/tests/bug33563.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #33563 (strtotime('+1 month',$abc) cant get right time) ---FILE-- - ---EXPECT-- -strCurrDate:2005-06-30 21:04:23 strMonAfter:2005-07-30 21:04:23 diff --git a/ext/date/tests/bug33578.phpt b/ext/date/tests/bug33578.phpt deleted file mode 100644 index 4ba6df85971c3..0000000000000 --- a/ext/date/tests/bug33578.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #33578 (strtotime() doesn't parse "11 Oct" format") ---FILE-- - ---EXPECTF-- -10/11/%d -10/11/%d -10/11/2005 -10/11/%d -10/11/%d -10/11/2005 -10/11/2005 diff --git a/ext/date/tests/bug33869.phpt b/ext/date/tests/bug33869.phpt deleted file mode 100644 index 6957a6b7e24cd..0000000000000 --- a/ext/date/tests/bug33869.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #33869 (strtotime() doesn't parse "+1days" format) ---FILE-- - ---EXPECT-- -2005-01-06T01:01:01+0000 -2005-02-01T01:01:01+0000 -2006-01-01T01:01:01+0000 -2005-01-06T01:01:01+0000 -2005-02-01T01:01:01+0000 -2006-01-01T01:01:01+0000 diff --git a/ext/date/tests/bug33957.phpt b/ext/date/tests/bug33957.phpt deleted file mode 100644 index 43f14ee315f1d..0000000000000 --- a/ext/date/tests/bug33957.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -Bug #33957 (gmdate('W')/date('W') sometimes returns wrong week number) ---FILE-- - ---EXPECT-- -1992-12-14 51 -1992-12-15 51 -1992-12-16 51 -1992-12-17 51 -1992-12-18 51 -1992-12-19 51 -1992-12-20 51 -1992-12-21 52 -1992-12-22 52 -1992-12-23 52 -1992-12-24 52 -1992-12-25 52 -1992-12-26 52 -1992-12-27 52 -1992-12-28 53 -1992-12-29 53 -1992-12-30 53 -1992-12-31 53 -1993-01-1 53 -1993-01-2 53 -1993-01-3 53 -1993-01-4 01 -1993-01-5 01 -1993-01-6 01 -1993-01-7 01 -1993-01-8 01 ----- - 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 - (12-14) 51-1992 50-1993 50-1994 50-1995 50-1996 50-1997 51-1998 50-1999 50-2000 50-2001 50-2002 50-2003 51-2004 50-2005 50-2006 50-2007 50-2008 51-2009 50-2010 50-2011 50-2012 50-2013 50-2014 51-2015 50-2016 50-2017 50-2018 50-2019 - (12-15) 51-1992 50-1993 50-1994 50-1995 50-1996 51-1997 51-1998 50-1999 50-2000 50-2001 50-2002 51-2003 51-2004 50-2005 50-2006 50-2007 51-2008 51-2009 50-2010 50-2011 50-2012 50-2013 51-2014 51-2015 50-2016 50-2017 50-2018 50-2019 - (12-16) 51-1992 50-1993 50-1994 50-1995 51-1996 51-1997 51-1998 50-1999 50-2000 50-2001 51-2002 51-2003 51-2004 50-2005 50-2006 50-2007 51-2008 51-2009 50-2010 50-2011 50-2012 51-2013 51-2014 51-2015 50-2016 50-2017 50-2018 51-2019 - (12-17) 51-1992 50-1993 50-1994 50-1995 51-1996 51-1997 51-1998 50-1999 50-2000 51-2001 51-2002 51-2003 51-2004 50-2005 50-2006 51-2007 51-2008 51-2009 50-2010 50-2011 51-2012 51-2013 51-2014 51-2015 50-2016 50-2017 51-2018 51-2019 - (12-18) 51-1992 50-1993 50-1994 51-1995 51-1996 51-1997 51-1998 50-1999 51-2000 51-2001 51-2002 51-2003 51-2004 50-2005 51-2006 51-2007 51-2008 51-2009 50-2010 50-2011 51-2012 51-2013 51-2014 51-2015 50-2016 51-2017 51-2018 51-2019 - (12-19) 51-1992 50-1993 51-1994 51-1995 51-1996 51-1997 51-1998 50-1999 51-2000 51-2001 51-2002 51-2003 51-2004 51-2005 51-2006 51-2007 51-2008 51-2009 50-2010 51-2011 51-2012 51-2013 51-2014 51-2015 51-2016 51-2017 51-2018 51-2019 - (12-20) 51-1992 51-1993 51-1994 51-1995 51-1996 51-1997 51-1998 51-1999 51-2000 51-2001 51-2002 51-2003 52-2004 51-2005 51-2006 51-2007 51-2008 51-2009 51-2010 51-2011 51-2012 51-2013 51-2014 51-2015 51-2016 51-2017 51-2018 51-2019 - (12-21) 52-1992 51-1993 51-1994 51-1995 51-1996 51-1997 52-1998 51-1999 51-2000 51-2001 51-2002 51-2003 52-2004 51-2005 51-2006 51-2007 51-2008 52-2009 51-2010 51-2011 51-2012 51-2013 51-2014 52-2015 51-2016 51-2017 51-2018 51-2019 - (12-22) 52-1992 51-1993 51-1994 51-1995 51-1996 52-1997 52-1998 51-1999 51-2000 51-2001 51-2002 52-2003 52-2004 51-2005 51-2006 51-2007 52-2008 52-2009 51-2010 51-2011 51-2012 51-2013 52-2014 52-2015 51-2016 51-2017 51-2018 51-2019 - (12-23) 52-1992 51-1993 51-1994 51-1995 52-1996 52-1997 52-1998 51-1999 51-2000 51-2001 52-2002 52-2003 52-2004 51-2005 51-2006 51-2007 52-2008 52-2009 51-2010 51-2011 51-2012 52-2013 52-2014 52-2015 51-2016 51-2017 51-2018 52-2019 - (12-24) 52-1992 51-1993 51-1994 51-1995 52-1996 52-1997 52-1998 51-1999 51-2000 52-2001 52-2002 52-2003 52-2004 51-2005 51-2006 52-2007 52-2008 52-2009 51-2010 51-2011 52-2012 52-2013 52-2014 52-2015 51-2016 51-2017 52-2018 52-2019 - (12-25) 52-1992 51-1993 51-1994 52-1995 52-1996 52-1997 52-1998 51-1999 52-2000 52-2001 52-2002 52-2003 52-2004 51-2005 52-2006 52-2007 52-2008 52-2009 51-2010 51-2011 52-2012 52-2013 52-2014 52-2015 51-2016 52-2017 52-2018 52-2019 - (12-26) 52-1992 51-1993 52-1994 52-1995 52-1996 52-1997 52-1998 51-1999 52-2000 52-2001 52-2002 52-2003 52-2004 52-2005 52-2006 52-2007 52-2008 52-2009 51-2010 52-2011 52-2012 52-2013 52-2014 52-2015 52-2016 52-2017 52-2018 52-2019 - (12-27) 52-1992 52-1993 52-1994 52-1995 52-1996 52-1997 52-1998 52-1999 52-2000 52-2001 52-2002 52-2003 53-2004 52-2005 52-2006 52-2007 52-2008 52-2009 52-2010 52-2011 52-2012 52-2013 52-2014 52-2015 52-2016 52-2017 52-2018 52-2019 - (12-28) 53-1992 52-1993 52-1994 52-1995 52-1996 52-1997 53-1998 52-1999 52-2000 52-2001 52-2002 52-2003 53-2004 52-2005 52-2006 52-2007 52-2008 53-2009 52-2010 52-2011 52-2012 52-2013 52-2014 53-2015 52-2016 52-2017 52-2018 52-2019 - (12-29) 53-1992 52-1993 52-1994 52-1995 52-1996 01-1998 53-1998 52-1999 52-2000 52-2001 52-2002 01-2004 53-2004 52-2005 52-2006 52-2007 01-2009 53-2009 52-2010 52-2011 52-2012 52-2013 01-2015 53-2015 52-2016 52-2017 52-2018 52-2019 - (12-30) 53-1992 52-1993 52-1994 52-1995 01-1997 01-1998 53-1998 52-1999 52-2000 52-2001 01-2003 01-2004 53-2004 52-2005 52-2006 52-2007 01-2009 53-2009 52-2010 52-2011 52-2012 01-2014 01-2015 53-2015 52-2016 52-2017 52-2018 01-2020 - (12-31) 53-1992 52-1993 52-1994 52-1995 01-1997 01-1998 53-1998 52-1999 52-2000 01-2002 01-2003 01-2004 53-2004 52-2005 52-2006 01-2008 01-2009 53-2009 52-2010 52-2011 01-2013 01-2014 01-2015 53-2015 52-2016 52-2017 01-2019 01-2020 -+1 (01-01) 53-1992 52-1993 52-1994 01-1996 01-1997 01-1998 53-1998 52-1999 01-2001 01-2002 01-2003 01-2004 53-2004 52-2005 01-2007 01-2008 01-2009 53-2009 52-2010 52-2011 01-2013 01-2014 01-2015 53-2015 52-2016 01-2018 01-2019 01-2020 -+1 (01-02) 53-1992 52-1993 01-1995 01-1996 01-1997 01-1998 53-1998 52-1999 01-2001 01-2002 01-2003 01-2004 53-2004 01-2006 01-2007 01-2008 01-2009 53-2009 52-2010 01-2012 01-2013 01-2014 01-2015 53-2015 01-2017 01-2018 01-2019 01-2020 -+1 (01-03) 53-1992 01-1994 01-1995 01-1996 01-1997 01-1998 53-1998 01-2000 01-2001 01-2002 01-2003 01-2004 01-2005 01-2006 01-2007 01-2008 01-2009 53-2009 01-2011 01-2012 01-2013 01-2014 01-2015 53-2015 01-2017 01-2018 01-2019 01-2020 -+1 (01-04) 01-1993 01-1994 01-1995 01-1996 01-1997 01-1998 01-1999 01-2000 01-2001 01-2002 01-2003 01-2004 01-2005 01-2006 01-2007 01-2008 01-2009 01-2010 01-2011 01-2012 01-2013 01-2014 01-2015 01-2016 01-2017 01-2018 01-2019 01-2020 -+1 (01-05) 01-1993 01-1994 01-1995 01-1996 01-1997 02-1998 01-1999 01-2000 01-2001 01-2002 01-2003 02-2004 01-2005 01-2006 01-2007 01-2008 02-2009 01-2010 01-2011 01-2012 01-2013 01-2014 02-2015 01-2016 01-2017 01-2018 01-2019 01-2020 -+1 (01-06) 01-1993 01-1994 01-1995 01-1996 02-1997 02-1998 01-1999 01-2000 01-2001 01-2002 02-2003 02-2004 01-2005 01-2006 01-2007 01-2008 02-2009 01-2010 01-2011 01-2012 01-2013 02-2014 02-2015 01-2016 01-2017 01-2018 01-2019 02-2020 -+1 (01-07) 01-1993 01-1994 01-1995 01-1996 02-1997 02-1998 01-1999 01-2000 01-2001 02-2002 02-2003 02-2004 01-2005 01-2006 01-2007 02-2008 02-2009 01-2010 01-2011 01-2012 02-2013 02-2014 02-2015 01-2016 01-2017 01-2018 02-2019 02-2020 -+1 (01-08) 01-1993 01-1994 01-1995 02-1996 02-1997 02-1998 01-1999 01-2000 02-2001 02-2002 02-2003 02-2004 01-2005 01-2006 02-2007 02-2008 02-2009 01-2010 01-2011 01-2012 02-2013 02-2014 02-2015 01-2016 01-2017 02-2018 02-2019 02-2020 -+1 (01-09) 01-1993 01-1994 02-1995 02-1996 02-1997 02-1998 01-1999 01-2000 02-2001 02-2002 02-2003 02-2004 01-2005 02-2006 02-2007 02-2008 02-2009 01-2010 01-2011 02-2012 02-2013 02-2014 02-2015 01-2016 02-2017 02-2018 02-2019 02-2020 -+1 (01-10) 01-1993 02-1994 02-1995 02-1996 02-1997 02-1998 01-1999 02-2000 02-2001 02-2002 02-2003 02-2004 02-2005 02-2006 02-2007 02-2008 02-2009 01-2010 02-2011 02-2012 02-2013 02-2014 02-2015 01-2016 02-2017 02-2018 02-2019 02-2020 -+1 (01-11) 02-1993 02-1994 02-1995 02-1996 02-1997 02-1998 02-1999 02-2000 02-2001 02-2002 02-2003 02-2004 02-2005 02-2006 02-2007 02-2008 02-2009 02-2010 02-2011 02-2012 02-2013 02-2014 02-2015 02-2016 02-2017 02-2018 02-2019 02-2020 -+1 (01-12) 02-1993 02-1994 02-1995 02-1996 02-1997 03-1998 02-1999 02-2000 02-2001 02-2002 02-2003 03-2004 02-2005 02-2006 02-2007 02-2008 03-2009 02-2010 02-2011 02-2012 02-2013 02-2014 03-2015 02-2016 02-2017 02-2018 02-2019 02-2020 -+1 (01-13) 02-1993 02-1994 02-1995 02-1996 03-1997 03-1998 02-1999 02-2000 02-2001 02-2002 03-2003 03-2004 02-2005 02-2006 02-2007 02-2008 03-2009 02-2010 02-2011 02-2012 02-2013 03-2014 03-2015 02-2016 02-2017 02-2018 02-2019 03-2020 -+1 (01-14) 02-1993 02-1994 02-1995 02-1996 03-1997 03-1998 02-1999 02-2000 02-2001 03-2002 03-2003 03-2004 02-2005 02-2006 02-2007 03-2008 03-2009 02-2010 02-2011 02-2012 03-2013 03-2014 03-2015 02-2016 02-2017 02-2018 03-2019 03-2020 -+1 (01-15) 02-1993 02-1994 02-1995 03-1996 03-1997 03-1998 02-1999 02-2000 03-2001 03-2002 03-2003 03-2004 02-2005 02-2006 03-2007 03-2008 03-2009 02-2010 02-2011 02-2012 03-2013 03-2014 03-2015 02-2016 02-2017 03-2018 03-2019 03-2020 -+1 (01-16) 02-1993 02-1994 03-1995 03-1996 03-1997 03-1998 02-1999 02-2000 03-2001 03-2002 03-2003 03-2004 02-2005 03-2006 03-2007 03-2008 03-2009 02-2010 02-2011 03-2012 03-2013 03-2014 03-2015 02-2016 03-2017 03-2018 03-2019 03-2020 -+1 (01-17) 02-1993 03-1994 03-1995 03-1996 03-1997 03-1998 02-1999 03-2000 03-2001 03-2002 03-2003 03-2004 03-2005 03-2006 03-2007 03-2008 03-2009 02-2010 03-2011 03-2012 03-2013 03-2014 03-2015 02-2016 03-2017 03-2018 03-2019 03-2020 -+1 (01-18) 03-1993 03-1994 03-1995 03-1996 03-1997 03-1998 03-1999 03-2000 03-2001 03-2002 03-2003 03-2004 03-2005 03-2006 03-2007 03-2008 03-2009 03-2010 03-2011 03-2012 03-2013 03-2014 03-2015 03-2016 03-2017 03-2018 03-2019 03-2020 ----- diff --git a/ext/date/tests/bug34087.phpt b/ext/date/tests/bug34087.phpt deleted file mode 100644 index 3fa3885481731..0000000000000 --- a/ext/date/tests/bug34087.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #34087 (strtotime() does not work with date format "Y/m/d") ---FILE-- - ---EXPECT-- -Y/m/d: 1123804800 -Y-m-d: 1123804800 -2005-01-02T00:00:00+0000 -2005-01-02T00:00:00+0000 -2005-01-02T00:00:00+0000 -2005-01-02T00:00:00+0000 diff --git a/ext/date/tests/bug34304.phpt b/ext/date/tests/bug34304.phpt deleted file mode 100644 index 88030b7be5f7a..0000000000000 --- a/ext/date/tests/bug34304.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #34304 (date('w') returns wrong number for sunday, 'N' modifier is missing) ---FILE-- - ---EXPECT-- -2004-W53-7 -2005-W01-7 diff --git a/ext/date/tests/bug34676.phpt b/ext/date/tests/bug34676.phpt deleted file mode 100644 index 6f616feb4064a..0000000000000 --- a/ext/date/tests/bug34676.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #34676 (missing support for strtotime("midnight") and strtotime("noon")) ---FILE-- - %s\n", $test, date(DATE_ISO8601, $t)); -} - -?> ---EXPECT-- -noon => 2005-12-22T12:00:00+0000 -midnight => 2005-12-22T00:00:00+0000 diff --git a/ext/date/tests/bug34771.phpt b/ext/date/tests/bug34771.phpt deleted file mode 100644 index a27d085a1da7b..0000000000000 --- a/ext/date/tests/bug34771.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #34771 (strtotime() fails with 1-12am/pm) ---FILE-- - %s\n", $test, date(DATE_ISO8601, $t)); -} - -?> ---EXPECT-- -12am => 2005-12-22T00:00:00+0000 -1am => 2005-12-22T01:00:00+0000 -1pm => 2005-12-22T13:00:00+0000 -12a.m. => 2005-12-22T00:00:00+0000 -1a.m. => 2005-12-22T01:00:00+0000 -1p.m. => 2005-12-22T13:00:00+0000 -12:00am => 2005-12-22T00:00:00+0000 -1:00am => 2005-12-22T01:00:00+0000 -1:00pm => 2005-12-22T13:00:00+0000 -12:00a.m. => 2005-12-22T00:00:00+0000 -1:00a.m. => 2005-12-22T01:00:00+0000 -1:00p.m. => 2005-12-22T13:00:00+0000 diff --git a/ext/date/tests/bug35143.phpt b/ext/date/tests/bug35143.phpt deleted file mode 100644 index 02b0072713df1..0000000000000 --- a/ext/date/tests/bug35143.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #35143 (gettimeofday() ignores current time zone) ---FILE-- - ---EXPECTF-- -string(3) "UTC" -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(0) - ["dsttime"]=> - int(0) -} diff --git a/ext/date/tests/bug35218.phpt b/ext/date/tests/bug35218.phpt deleted file mode 100644 index 725f03c4aa60c..0000000000000 --- a/ext/date/tests/bug35218.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #35218 (strtotime no longer ignores timezone comments like "(PST)") ---FILE-- - ---EXPECT-- -int(1131951370) -int(1131951370) diff --git a/ext/date/tests/bug35414.phpt b/ext/date/tests/bug35414.phpt deleted file mode 100644 index f6af5110fb57e..0000000000000 --- a/ext/date/tests/bug35414.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #35414 (strtotime() no longer works with ordinal suffix) ---FILE-- - ---EXPECT-- -2005-11-26T18:18:00+0000 -2005-11-26T00:00:00+0000 -2005-12-04T00:00:00+0000 -2005-12-04T00:00:00+0000 diff --git a/ext/date/tests/bug35422.phpt b/ext/date/tests/bug35422.phpt deleted file mode 100644 index 8273c75411763..0000000000000 --- a/ext/date/tests/bug35422.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #35422 (strtotime() does not parse times with UTC as timezone) ---FILE-- - ---EXPECT-- -2000-07-01T00:00:00+0000 -2000-07-01T00:00:00+0000 diff --git a/ext/date/tests/bug35425.phpt b/ext/date/tests/bug35425.phpt deleted file mode 100644 index 4259b49a1c4fc..0000000000000 --- a/ext/date/tests/bug35425.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #35425 (idate() function ignores timezone settings) ---FILE-- - ---EXPECT-- -int(292) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(1) -int(1) -int(31) -int(1104559261) -int(6) -int(53) -int(5) -int(2005) -int(0) -int(-18000) diff --git a/ext/date/tests/bug35456.phpt b/ext/date/tests/bug35456.phpt deleted file mode 100644 index 6432b9944530e..0000000000000 --- a/ext/date/tests/bug35456.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #35456 (+ 1 [time unit] format did not work) ---FILE-- - ---EXPECT-- -2005-11-29T22:15:19+0000 -2005-12-28T22:15:19+0000 -2005-12-05T22:15:19+0000 diff --git a/ext/date/tests/bug35499.phpt b/ext/date/tests/bug35499.phpt deleted file mode 100644 index 03f5205daa1fc..0000000000000 --- a/ext/date/tests/bug35499.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -Bug #35499 (strtotime() does not handle whitespace around the date string) ---FILE-- - ---EXPECT-- -2005-11-20T08:00:00+0000 -2005-11-20T08:00:00+0000 -array(16) { - ["year"]=> - bool(false) - ["month"]=> - bool(false) - ["day"]=> - bool(false) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(0) - ["errors"]=> - array(0) { - } - ["is_localtime"]=> - bool(true) - ["zone_type"]=> - int(2) - ["zone"]=> - int(-60) - ["is_dst"]=> - bool(false) - ["tz_abbr"]=> - string(1) "A" -} -array(12) { - ["year"]=> - bool(false) - ["month"]=> - bool(false) - ["day"]=> - bool(false) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(0) - ["errors"]=> - array(0) { - } - ["is_localtime"]=> - bool(false) -} diff --git a/ext/date/tests/bug35624.phpt b/ext/date/tests/bug35624.phpt deleted file mode 100644 index 722adba823533..0000000000000 --- a/ext/date/tests/bug35624.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #35624 (strtotime() does not handle 3 character weekdays) ---FILE-- - ---EXPECT-- -MonMon -MonMon -TueTue -TueTue -WedWed -WedWed -ThuThu -ThuThu -FriFri -FriFri -SatSat -SatSat -SunSun -SunSun diff --git a/ext/date/tests/bug35630.phpt b/ext/date/tests/bug35630.phpt deleted file mode 100644 index b111b1aaf2e87..0000000000000 --- a/ext/date/tests/bug35630.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #35630 (strtotime() crashes on non-separated relative modifiers) ---FILE-- - ---EXPECT-- -2006-01-09T00:00:00+0000 diff --git a/ext/date/tests/bug35699.phpt b/ext/date/tests/bug35699.phpt deleted file mode 100644 index 5e4951e9fc60f..0000000000000 --- a/ext/date/tests/bug35699.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #35699 (date() can't handle leap years before 1970) ---FILE-- - ---EXPECT-- -1964-06-06T00:00:00+0000 -1963-06-06T00:00:00+0000 -1964-01-06T00:00:00+0000 diff --git a/ext/date/tests/bug35705.phpt b/ext/date/tests/bug35705.phpt deleted file mode 100644 index 6894160a4d4c1..0000000000000 --- a/ext/date/tests/bug35705.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #35705 (strtotime() fails to parse soap date format without TZ) ---FILE-- - ---EXPECT-- -2000-10-10T10:12:30+0000 diff --git a/ext/date/tests/bug35885.phpt b/ext/date/tests/bug35885.phpt deleted file mode 100644 index b3074f7f34fa7..0000000000000 --- a/ext/date/tests/bug35885.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #35885 (strtotime("NOW") no longer works) ---FILE-- - ---EXPECT-- -bool(true) diff --git a/ext/date/tests/bug35887.phpt b/ext/date/tests/bug35887.phpt deleted file mode 100644 index e6ea7bd3889a4..0000000000000 --- a/ext/date/tests/bug35887.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #35887 (wddx_deserialize not parsing dateTime fields properly) ---FILE-- - ---EXPECT-- -2006-01-06T08:00:00+0000 diff --git a/ext/date/tests/bug36224.phpt b/ext/date/tests/bug36224.phpt deleted file mode 100644 index 1690f4e7b2ce5..0000000000000 --- a/ext/date/tests/bug36224.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #36224 (date(DATE_ATOM) gives wrong resulsts) ---FILE-- - ---EXPECT-- -2006-01-31T20:23:56+01:00 -2006-01-31T19:23:56+01:00 diff --git a/ext/date/tests/bug36510.phpt b/ext/date/tests/bug36510.phpt deleted file mode 100644 index ea8bb028b22f5..0000000000000 --- a/ext/date/tests/bug36510.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #36510 (strtotime() fails to parse date strings with tabs) ---FILE-- - ---EXPECT-- -int(1140966188) -int(1140966188) diff --git a/ext/date/tests/bug36599.phpt b/ext/date/tests/bug36599.phpt deleted file mode 100644 index b34a7c288fbc4..0000000000000 --- a/ext/date/tests/bug36599.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #36599 (DATE_W3C format constant incorrect). ---FILE-- - ---EXPECT-- -2006-03-03T08:47:55+00:00 -2006-03-03T08:47:55+00:00 diff --git a/ext/date/tests/bug36988.phpt b/ext/date/tests/bug36988.phpt deleted file mode 100644 index d35e58939aa1b..0000000000000 --- a/ext/date/tests/bug36988.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #36988 (mktime freezes on long numbers) ---INI-- -date.timezone=GMT ---FILE-- - ---EXPECT-- -smaller than one second diff --git a/ext/date/tests/bug37017.phpt b/ext/date/tests/bug37017.phpt deleted file mode 100644 index 61dc8ba383f38..0000000000000 --- a/ext/date/tests/bug37017.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #37017 (strtotime fails before 13:00:00 with some time zones identifiers). ---INI-- -date.timezone=GMT ---FILE-- - ---EXPECT-- -1147453201 -1147453200 -1147453199 -1147438799 diff --git a/ext/date/tests/bug37368.phpt b/ext/date/tests/bug37368.phpt deleted file mode 100644 index 5be1c967987fe..0000000000000 --- a/ext/date/tests/bug37368.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #37368 (Incorrect timestamp returned for strtotime()). ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECT-- -Wed, 07 Jun 2006 17:06:44 +0000 diff --git a/ext/date/tests/bug37514.phpt b/ext/date/tests/bug37514.phpt deleted file mode 100644 index abbb4407c8d1c..0000000000000 --- a/ext/date/tests/bug37514.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #37514 (strtotime doesn't assume year correctly). ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECT-- -Fri, 18 May 2007 05:05:00 +0000 -Fri, 18 May 2007 17:05:00 +0000 -Fri, 18 May 2007 17:05:00 +0000 -Fri, 18 May 2007 05:05:00 +0000 -Fri, 18 May 2007 05:05:00 +0000 -Thu, 18 May 2006 17:05:00 +0000 diff --git a/ext/date/tests/bug37616.phpt b/ext/date/tests/bug37616.phpt deleted file mode 100644 index 7652501765e25..0000000000000 --- a/ext/date/tests/bug37616.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #37616 (DATE_RFC822 does not product RFC 822 dates) ---FILE-- - ---EXPECT-- -string(29) "Sat, 01 Jul 06 14:27:30 +0200" diff --git a/ext/date/tests/bug37747.phpt b/ext/date/tests/bug37747.phpt deleted file mode 100644 index 465f791c413d0..0000000000000 --- a/ext/date/tests/bug37747.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #37747 (strtotime segfaults when given "nextyear") ---FILE-- - ---EXPECT-- -bool(false) -ALIVE diff --git a/ext/date/tests/bug38229.phpt b/ext/date/tests/bug38229.phpt deleted file mode 100644 index 472a05faef23d..0000000000000 --- a/ext/date/tests/bug38229.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #38229 (strtotime() does not parse YYYY-MM) ---FILE-- - ---EXPECT-- -2006-01 -2006-03 -2006-12 diff --git a/ext/date/tests/bug39782.phpt b/ext/date/tests/bug39782.phpt deleted file mode 100644 index 99abdd7bc847b..0000000000000 --- a/ext/date/tests/bug39782.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #39782 (setTime() on a DateTime constructed with a Weekday yields incorrect results) ---FILE-- -format('D M j Y - H:i:s') . "\n"; - -$dttTest->setTime(12, 0, 0); -echo $dttTest->format('D M j Y - H:i:s') . "\n"; - -$dttTest->setTime(12, 0, 0); -echo $dttTest->format('D M j Y - H:i:s') . "\n"; -?> ---EXPECT-- -Wed Dec 13 2006 - 00:00:00 -Wed Dec 13 2006 - 12:00:00 -Wed Dec 13 2006 - 12:00:00 \ No newline at end of file diff --git a/ext/date/tests/bug40743.phpt b/ext/date/tests/bug40743.phpt deleted file mode 100644 index f3ce17124db93..0000000000000 --- a/ext/date/tests/bug40743.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #40743 (DateTime ignores the TimeZone object passed to the constructor) ---FILE-- -format(DATE_RFC822), "\n"; -echo $dt->format('T e Z'), "\n"; -echo "-----\n"; - -date_default_timezone_set('America/New_York'); - -$dt = new DateTime('16 Jan 08 13:04:59'); -echo $dt->format(DATE_RFC822 . " e T O U"), "\n"; - -$dt = new DateTime('@1200506699'); -echo $dt->format(DATE_RFC822 . " e T O U"), "\n"; - -$dt = new DateTime('@1200506699'); -$dt->setTimezone( new DateTimeZone( 'America/New_York' ) ); -echo $dt->format(DATE_RFC822 . " e T O U"), "\n"; - -$dt = new DateTime('@1200506699', new DateTimeZone('Europe/Berlin')); -echo $dt->format(DATE_RFC822 . " e T O U"), "\n"; - -$dt = new DateTime('16 Jan 08 13:04:59 America/Chicago'); -echo $dt->format(DATE_RFC822 . " e T O U"), "\n"; - -$dt = new DateTime('16 Jan 08 13:04:59 America/Chicago', new DateTimeZone('Europe/Berlin')); -echo $dt->format(DATE_RFC822 . " e T O U"), "\n"; -?> ---EXPECT-- -Wed, 16 Jan 08 18:04:59 +0000 -GMT+0000 +00:00 0 ------ -Wed, 16 Jan 08 13:04:59 -0500 America/New_York EST -0500 1200506699 -Wed, 16 Jan 08 18:04:59 +0000 +00:00 GMT+0000 +0000 1200506699 -Wed, 16 Jan 08 13:04:59 -0500 America/New_York EST -0500 1200506699 -Wed, 16 Jan 08 18:04:59 +0000 +00:00 GMT+0000 +0000 1200506699 -Wed, 16 Jan 08 13:04:59 -0600 America/Chicago CST -0600 1200510299 -Wed, 16 Jan 08 13:04:59 -0600 America/Chicago CST -0600 1200510299 diff --git a/ext/date/tests/bug40861.phpt b/ext/date/tests/bug40861.phpt deleted file mode 100644 index d4ef96198c7ff..0000000000000 --- a/ext/date/tests/bug40861.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #40861 (Multiple +/- on relative units breaks strtotime()) ---FILE-- - ---EXPECT-- -2000-01-01 13:00:00 -2000-01-01 11:00:00 -2000-01-01 13:00:00 -2000-01-01 13:00:00 diff --git a/ext/date/tests/bug41523-64bit.phpt b/ext/date/tests/bug41523-64bit.phpt deleted file mode 100644 index 9b4e900619372..0000000000000 --- a/ext/date/tests/bug41523-64bit.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30) (64 bit) ---SKIPIF-- - ---FILE-- -format( DateTime::ISO8601 ), "\n"; - -?> ---EXPECT-- -array(12) { - ["year"]=> - int(0) - ["month"]=> - int(0) - ["day"]=> - int(0) - ["hour"]=> - int(0) - ["minute"]=> - int(0) - ["second"]=> - int(0) - ["fraction"]=> - float(0) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(0) - ["errors"]=> - array(0) { - } - ["is_localtime"]=> - bool(false) -} -int(-62169984000) -object(DateTime)#1 (0) { -} --0001-11-30T00:00:00+0000 diff --git a/ext/date/tests/bug41523.phpt b/ext/date/tests/bug41523.phpt deleted file mode 100644 index 5b0d5bd1967ea..0000000000000 --- a/ext/date/tests/bug41523.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30) (32 bit) ---SKIPIF-- - ---FILE-- -format( DateTime::ISO8601 ), "\n"; - -?> ---EXPECT-- -array(12) { - ["year"]=> - int(0) - ["month"]=> - int(0) - ["day"]=> - int(0) - ["hour"]=> - int(0) - ["minute"]=> - int(0) - ["second"]=> - int(0) - ["fraction"]=> - float(0) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(0) - ["errors"]=> - array(0) { - } - ["is_localtime"]=> - bool(false) -} -bool(false) -object(DateTime)#1 (0) { -} --0001-11-30T00:00:00+0000 diff --git a/ext/date/tests/bug41599.phpt b/ext/date/tests/bug41599.phpt deleted file mode 100644 index e4febe2cd8bb5..0000000000000 --- a/ext/date/tests/bug41599.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #41599 (setTime() fails after modify() is used) ---FILE-- -format('Y-m-d H:i:s'),PHP_EOL; -//good - -$start->modify('Tuesday'); -echo $start->format('Y-m-d H:i:s'),PHP_EOL; -//good - -$start->setTime(4, 0, 0); -echo $start->format('Y-m-d H:i:s'),PHP_EOL; -//jumped to next Sunday - -$start->setTime(8, 0, 0); -echo $start->format('Y-m-d H:i:s'),PHP_EOL; -//jumped to next Sunday again -?> ---EXPECT-- -2008-01-14 00:00:00 -2008-01-15 00:00:00 -2008-01-15 04:00:00 -2008-01-15 08:00:00 diff --git a/ext/date/tests/bug41709.phpt b/ext/date/tests/bug41709.phpt deleted file mode 100644 index 69c7cb4f47270..0000000000000 --- a/ext/date/tests/bug41709.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #41709 (strtotime() does not handle 00.00.0000) ---FILE-- - ---EXPECT-- -Array -( - [year] => 0 - [month] => 0 - [day] => 0 - [hour] => 0 - [minute] => 0 - [second] => 0 - [fraction] => 0 - [warning_count] => 0 - [warnings] => Array - ( - ) - - [error_count] => 1 - [errors] => Array - ( - [11] => Unexpected character - ) - - [is_localtime] => -) diff --git a/ext/date/tests/bug41842.phpt b/ext/date/tests/bug41842.phpt deleted file mode 100644 index b2a5ef32acd10..0000000000000 --- a/ext/date/tests/bug41842.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #41842 (Cannot create years < 0100 & negative years with date_create or new DateTime) ---FILE-- -format(DATE_ISO8601); -?> ---EXPECT-- --2007-06-28T00:00:00+0000 diff --git a/ext/date/tests/bug41844.phpt b/ext/date/tests/bug41844.phpt deleted file mode 100644 index c18b2f77360ac..0000000000000 --- a/ext/date/tests/bug41844.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #41844 (Format returns incorrect number of digits for negative years -0001 to -0999) ---FILE-- -modify('-3006 years'); -echo $date->format(DATE_ISO8601), "\n"; - -$date = new DateTime('2007-06-28'); -$date->modify('-2008 years'); -echo $date->format(DATE_ISO8601), "\n"; -?> ---EXPECT-- --0999-06-28T00:00:00+0000 --0001-06-28T00:00:00+0000 diff --git a/ext/date/tests/bug41964.phpt b/ext/date/tests/bug41964.phpt deleted file mode 100644 index 022a1861b49cb..0000000000000 --- a/ext/date/tests/bug41964.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Bug #41964 (strtotime returns a timestamp for non-time string of pattern '(A|a) .+') ---FILE-- - ---EXPECT-- -NULL -NULL - -int(-60) -string(1) "A" - -int(-60) -string(1) "A" - -int(-60) -string(1) "A" - -int(-60) -string(1) "A" - -int(-60) -string(1) "A" - -int(-60) -string(1) "A" diff --git a/ext/date/tests/bug42910.phpt b/ext/date/tests/bug42910.phpt deleted file mode 100644 index 1bd079081234b..0000000000000 --- a/ext/date/tests/bug42910.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #42910 (Constructing DateTime with TimeZone Indicator invalidates DateTimeZone) ---FILE-- -format(DateTime::ISO8601) . ' - ' . $foo->getTimezone()->getName() . ' - ' . $foo->format('U') . "\r\n"; - print $bar->format(DateTime::ISO8601) . ' - ' . $bar->getTimezone()->getName() . ' - ' . $bar->format('U') . "\r\n"; - - $foo->setDate(2007, 03, 12); - $bar->setDate(2007, 03, 12); - - print $foo->format(DateTime::ISO8601) . ' - ' . $foo->getTimezone()->getName() . ' - ' . $foo->format('U') . "\r\n"; - print $bar->format(DateTime::ISO8601) . ' - ' . $bar->getTimezone()->getName() . ' - ' . $bar->format('U') . "\r\n"; - -// -------------- - - date_default_timezone_set('Australia/Sydney'); - - $date= date_create('2007-11-04 12:00:00+0200'); - var_dump(date_format($date, 'O e')); -?> ---EXPECT-- -2007-03-11T00:00:00-0800 - America/Los_Angeles - 1173600000 -2007-03-11T00:00:00-0800 - -08:00 - 1173600000 -2007-03-12T00:00:00-0700 - America/Los_Angeles - 1173682800 -2007-03-12T00:00:00-0800 - -08:00 - 1173686400 -string(12) "+0200 +02:00" diff --git a/ext/date/tests/bug43003.phpt b/ext/date/tests/bug43003.phpt deleted file mode 100644 index 8070358b95774..0000000000000 --- a/ext/date/tests/bug43003.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #43003 (Invalid timezone reported for DateTime objects constructed using a timestamp) ---FILE-- -getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n"; - -$oDateTest->setTimezone(new DateTimeZone("UTC")); -echo $oDateTest->getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n"; - -$oDateTest->setTimezone(new DateTimeZone(date_default_timezone_get())); -echo $oDateTest->getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n"; - -$oDateTest = new DateTime("@0"); -echo $oDateTest->getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n"; - -$oDateTest->setTimezone( new DateTimeZone(date_default_timezone_get())); -echo $oDateTest->getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n"; -?> ---EXPECT-- -+00:00: 1970-01-01 00:00:00 -UTC: 1970-01-01 00:00:00 -Europe/Oslo: 1970-01-01 01:00:00 -+00:00: 1970-01-01 00:00:00 -Europe/Oslo: 1970-01-01 01:00:00 diff --git a/ext/date/tests/bug43452.phpt b/ext/date/tests/bug43452.phpt deleted file mode 100644 index 25b4f0161acb7..0000000000000 --- a/ext/date/tests/bug43452.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -Bug #43452 ("weekday" is not equivalent to "1 weekday" of the current weekday is "weekday") ---INI-- -date.timezone=Europe/Oslo ---FILE-- - is equivalent to 1 and will *not* forward if the current day -// (November 1st) is the same day of week. -$day = strtotime( "Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "1 Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "2 Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "3 Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n\n"; - -// forward one week, then behaves like above for week days -$day = strtotime( "Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "+1 week Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "+2 week Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "+3 week Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n\n"; - -// First, second, etc skip to the first/second weekday *after* the current day. -// This makes "first thursday" equivalent to "+1 week thursday" - but only -// if the current day-of-week is the one mentioned in the phrase. -$day = strtotime( "Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "first Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "second Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "third Thursday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n\n"; - -// Now the same where the current day-of-week does not match the one in the -// phrase. -$day = strtotime( "Friday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "first Friday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "second Friday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n"; -$day = strtotime( "third Friday Nov 2007" ); -echo date( DateTime::ISO8601, $day ), "\n\n"; - -?> ---EXPECT-- -2007-11-01T00:00:00+0100 -2007-11-01T00:00:00+0100 -2007-11-08T00:00:00+0100 -2007-11-15T00:00:00+0100 - -2007-11-01T00:00:00+0100 -2007-11-08T00:00:00+0100 -2007-11-15T00:00:00+0100 -2007-11-22T00:00:00+0100 - -2007-11-01T00:00:00+0100 -2007-11-08T00:00:00+0100 -2007-11-15T00:00:00+0100 -2007-11-22T00:00:00+0100 - -2007-11-02T00:00:00+0100 -2007-11-02T00:00:00+0100 -2007-11-09T00:00:00+0100 -2007-11-16T00:00:00+0100 diff --git a/ext/date/tests/bug43527.phpt b/ext/date/tests/bug43527.phpt deleted file mode 100644 index cc69def7be9ca..0000000000000 --- a/ext/date/tests/bug43527.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #43527 (DateTime created from a timestamp reports environment timezone) ---FILE-- -getTimezone()->getName(), "\n"; -?> ---EXPECT-- -+10:00 diff --git a/ext/date/tests/bug43808.phpt b/ext/date/tests/bug43808.phpt deleted file mode 100644 index fe8102199e820..0000000000000 --- a/ext/date/tests/bug43808.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #43808 (date_create never fails (even when it should)) ---FILE-- - ---EXPECT-- -bool(false) diff --git a/ext/date/tests/bug44742.phpt b/ext/date/tests/bug44742.phpt deleted file mode 100644 index 48952b4e6cdcc..0000000000000 --- a/ext/date/tests/bug44742.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #44742 (timezone_offset_get() causes segmentation faults) ---FILE-- - ---EXPECT-- -int(0) -int(7200) -int(12600) -int(-18000) -int(-41400) -int(7200) -int(3600) -int(0) -int(-14400) -int(7200) -int(28800) diff --git a/ext/date/tests/bug46268.phpt b/ext/date/tests/bug46268.phpt deleted file mode 100644 index dd2d4a3ca5e2c..0000000000000 --- a/ext/date/tests/bug46268.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #46268 (When call DateTime#setTime, it seems to be called the last modify method too) ---FILE-- -format("Y-m-d H:i:s") . PHP_EOL; - -$now->modify("1 day after"); -echo $now->format("Y-m-d H:i:s") . PHP_EOL; - -$now->modify("1 hour after"); -echo $now->format("Y-m-d H:i:s") . PHP_EOL; - -$now->setTime(0, 0, 0); -//date_time_set($now, 0, 0, 0); -echo $now->format("Y-m-d H:i:s") . PHP_EOL; ---EXPECT-- -2008-10-10 01:02:03 -2008-10-11 01:02:03 -2008-10-11 02:02:03 -2008-10-11 00:00:00 diff --git a/ext/date/tests/date.phpt b/ext/date/tests/date.phpt deleted file mode 100644 index ccdb3cda946fe..0000000000000 --- a/ext/date/tests/date.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -date() function ---FILE-- - ---EXPECT-- -c: 2003-01-23T12:20:59+00:00 -r: Thu, 23 Jan 2003 12:20:59 +0000 -c: 2003-01-23T13:20:59+01:00 -r: Thu, 23 Jan 2003 13:20:59 +0100 diff --git a/ext/date/tests/date_constants.phpt b/ext/date/tests/date_constants.phpt deleted file mode 100644 index 132e24159bf84..0000000000000 --- a/ext/date/tests/date_constants.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -Date constants ---FILE-- - ---EXPECT-- -string(25) "2006-07-01T14:27:30+02:00" -string(25) "2006-05-30T14:32:13+02:00" -string(33) "Saturday, 01-Jul-06 14:27:30 CEST" -string(32) "Tuesday, 30-May-06 14:32:13 CEST" -string(24) "2006-07-01T14:27:30+0200" -string(24) "2006-05-30T14:32:13+0200" -string(29) "Sat, 01 Jul 06 14:27:30 +0200" -string(29) "Tue, 30 May 06 14:32:13 +0200" -string(33) "Saturday, 01-Jul-06 14:27:30 CEST" -string(32) "Tuesday, 30-May-06 14:32:13 CEST" -string(29) "Sat, 01 Jul 06 14:27:30 +0200" -string(29) "Tue, 30 May 06 14:32:13 +0200" -string(31) "Sat, 01 Jul 2006 14:27:30 +0200" -string(31) "Tue, 30 May 2006 14:32:13 +0200" -string(31) "Sat, 01 Jul 2006 14:27:30 +0200" -string(31) "Tue, 30 May 2006 14:32:13 +0200" -string(25) "2006-07-01T14:27:30+02:00" -string(25) "2006-05-30T14:32:13+02:00" -string(31) "Sat, 01 Jul 2006 14:27:30 +0200" -string(31) "Tue, 30 May 2006 14:32:13 +0200" -string(25) "2006-07-01T14:27:30+02:00" -string(25) "2006-05-30T14:32:13+02:00" - -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) diff --git a/ext/date/tests/date_create-1.phpt b/ext/date/tests/date_create-1.phpt deleted file mode 100644 index 365d54dc9469e..0000000000000 --- a/ext/date/tests/date_create-1.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -date_create() function [1] ---SKIPIF-- - ---FILE-- -format(DateTime::ISO8601), "\n"; -} -?> ---EXPECT-- -2005-07-14T22:30:41+0200 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0100 -2005-07-14T22:30:41+0200 -2005-07-14T22:30:41+0200 -2005-07-14T22:30:41-0700 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0100 -2005-07-14T22:30:41-0700 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0000 -2005-07-14T22:30:41+0200 -2005-07-14T22:30:41-0700 diff --git a/ext/date/tests/date_create-2.phpt b/ext/date/tests/date_create-2.phpt deleted file mode 100644 index 4aa33595d8c82..0000000000000 --- a/ext/date/tests/date_create-2.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -date_create() function [2] ---SKIPIF-- - ---FILE-- -format('D, d M Y H:i:s T'), "\n"; -?> ---EXPECT-- -Mon, 18 Jul 2005 22:10:00 GMT+0400 diff --git a/ext/date/tests/date_default_timezone_get-1.phpt b/ext/date/tests/date_default_timezone_get-1.phpt deleted file mode 100644 index b6494658e4d7c..0000000000000 --- a/ext/date/tests/date_default_timezone_get-1.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -date_default_timezone_get() function [1] ---INI-- -date.timezone= ---FILE-- - ---EXPECTF-- -Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 3 -UTC - -Strict Standards: date(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-1.php on line 4 -UTC diff --git a/ext/date/tests/date_default_timezone_get-2.phpt b/ext/date/tests/date_default_timezone_get-2.phpt deleted file mode 100644 index 73013a76267f6..0000000000000 --- a/ext/date/tests/date_default_timezone_get-2.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -date_default_timezone_get() function [2] ---INI-- -date.timezone=CEST ---FILE-- - ---EXPECTF-- -Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_get-2.php on line 3 -UTC diff --git a/ext/date/tests/date_default_timezone_get-3.phpt b/ext/date/tests/date_default_timezone_get-3.phpt deleted file mode 100644 index 0e2e3c53e558a..0000000000000 --- a/ext/date/tests/date_default_timezone_get-3.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -date_default_timezone_get() function [3] ---INI-- -date.timezone= ---FILE-- - ---EXPECT-- -Europe/Rome -America/Chicago diff --git a/ext/date/tests/date_default_timezone_set-1.phpt b/ext/date/tests/date_default_timezone_set-1.phpt deleted file mode 100644 index 3c7a9aa4d6a1e..0000000000000 --- a/ext/date/tests/date_default_timezone_set-1.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -date_default_timezone_set() function [1] ---INI-- -date.timezone= ---FILE-- - ---EXPECTF-- -Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3 - -Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 4 -America/Indiana/Knox -2005-01-12T03:00:00-0500 -2005-07-12T03:00:00-0500 -2005-01-12T08:00:00-0500 -2005-07-12T08:00:00-0500 diff --git a/ext/date/tests/date_modify-1.phpt b/ext/date/tests/date_modify-1.phpt deleted file mode 100644 index 7707b7fc241cc..0000000000000 --- a/ext/date/tests/date_modify-1.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -date_modify() function [1] ---SKIPIF-- - ---FILE-- -modify("+1 second"); -echo date_format($ts, 'D, d M Y H:i:s T'), "\n"; - -date_default_timezone_set("Europe/Amsterdam"); -$ts = date_create("Sun Mar 27 01:59:59 2005"); -echo date_format($ts, 'D, d M Y H:i:s T'), "\n"; -$ts->modify("+1 second"); -echo date_format($ts, 'D, d M Y H:i:s T'), "\n"; - -$ts = date_create("Sun Oct 30 01:59:59 2005"); -echo date_format($ts, 'D, d M Y H:i:s T'), "\n"; -$ts->modify("+ 1 hour 1 second"); -echo date_format($ts, 'D, d M Y H:i:s T'), "\n"; -?> ---EXPECT-- -Thu, 19 Aug 1993 23:59:59 KWAT -Sat, 21 Aug 1993 00:00:00 MHT -Sun, 27 Mar 2005 01:59:59 CET -Sun, 27 Mar 2005 03:00:00 CEST -Sun, 30 Oct 2005 01:59:59 CEST -Sun, 30 Oct 2005 03:00:00 CET diff --git a/ext/date/tests/date_modify-2.phpt b/ext/date/tests/date_modify-2.phpt deleted file mode 100644 index cc197fcdc499c..0000000000000 --- a/ext/date/tests/date_modify-2.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -date_modify() function [2] ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Mon, 18 Jul 2005 22:10:00 GMT+0400 -Mon, 18 Jul 2005 23:10:00 GMT+0400 diff --git a/ext/date/tests/date_parse_001.phpt b/ext/date/tests/date_parse_001.phpt deleted file mode 100644 index 542161016c435..0000000000000 --- a/ext/date/tests/date_parse_001.phpt +++ /dev/null @@ -1,303 +0,0 @@ ---TEST-- -Test basic date_parse() ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -array(12) { - ["year"]=> - int(2006) - ["month"]=> - int(12) - ["day"]=> - int(12) - ["hour"]=> - int(10) - ["minute"]=> - int(0) - ["second"]=> - int(0) - ["fraction"]=> - float(0.5) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(0) - ["errors"]=> - array(0) { - } - ["is_localtime"]=> - bool(false) -} -array(12) { - ["year"]=> - int(2006) - ["month"]=> - int(12) - ["day"]=> - int(12) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(0) - ["errors"]=> - array(0) { - } - ["is_localtime"]=> - bool(false) -} -array(15) { - ["year"]=> - int(2006) - ["month"]=> - int(12) - ["day"]=> - int(1) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(1) - ["errors"]=> - array(1) { - [7]=> - string(20) "Unexpected character" - } - ["is_localtime"]=> - bool(true) - ["zone_type"]=> - int(1) - ["zone"]=> - int(720) - ["is_dst"]=> - bool(false) -} -array(12) { - ["year"]=> - int(2006) - ["month"]=> - int(2) - ["day"]=> - int(30) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(0) - ["errors"]=> - array(0) { - } - ["is_localtime"]=> - bool(false) -} -array(12) { - ["year"]=> - int(2006) - ["month"]=> - int(3) - ["day"]=> - int(4) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(0) - ["errors"]=> - array(0) { - } - ["is_localtime"]=> - bool(false) -} -array(12) { - ["year"]=> - int(2006) - ["month"]=> - int(3) - ["day"]=> - int(1) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(0) - ["errors"]=> - array(0) { - } - ["is_localtime"]=> - bool(false) -} -array(15) { - ["year"]=> - bool(false) - ["month"]=> - bool(false) - ["day"]=> - bool(false) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(2) - ["errors"]=> - array(2) { - [0]=> - string(20) "Unexpected character" - [1]=> - string(20) "Unexpected character" - } - ["is_localtime"]=> - bool(true) - ["zone_type"]=> - int(1) - ["zone"]=> - int(180) - ["is_dst"]=> - bool(false) -} -array(15) { - ["year"]=> - bool(false) - ["month"]=> - bool(false) - ["day"]=> - bool(false) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(1) - ["errors"]=> - array(1) { - [0]=> - string(20) "Unexpected character" - } - ["is_localtime"]=> - bool(true) - ["zone_type"]=> - int(1) - ["zone"]=> - int(0) - ["is_dst"]=> - bool(false) -} -array(12) { - ["year"]=> - bool(false) - ["month"]=> - bool(false) - ["day"]=> - bool(false) - ["hour"]=> - bool(false) - ["minute"]=> - bool(false) - ["second"]=> - bool(false) - ["fraction"]=> - bool(false) - ["warning_count"]=> - int(0) - ["warnings"]=> - array(0) { - } - ["error_count"]=> - int(1) - ["errors"]=> - array(1) { - [0]=> - string(12) "Empty string" - } - ["is_localtime"]=> - bool(false) -} - -Warning: date_parse() expects parameter 1 to be string, array given in %s on line %d -bool(false) -Done diff --git a/ext/date/tests/date_sun_info_001.phpt b/ext/date/tests/date_sun_info_001.phpt deleted file mode 100644 index d469e37e7ef41..0000000000000 --- a/ext/date/tests/date_sun_info_001.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test basic date_sun_info() ---INI-- -date.timezone=UTC ---FILE-- - ---EXPECTF-- -array(9) { - ["sunrise"]=> - int(1165897782) - ["sunset"]=> - int(1165934168) - ["transit"]=> - int(1165915975) - ["civil_twilight_begin"]=> - int(1165896176) - ["civil_twilight_end"]=> - int(1165935773) - ["nautical_twilight_begin"]=> - int(1165894353) - ["nautical_twilight_end"]=> - int(1165937597) - ["astronomical_twilight_begin"]=> - int(1165892570) - ["astronomical_twilight_end"]=> - int(1165939380) -} -Done diff --git a/ext/date/tests/date_sun_info_002.phpt b/ext/date/tests/date_sun_info_002.phpt deleted file mode 100644 index b41d123d973b2..0000000000000 --- a/ext/date/tests/date_sun_info_002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test basic date_sun_info() ---INI-- -date.timezone=Europe/Oslo ---FILE-- - $elem ) -{ - echo date( 'Y-m-d H:i:s T', $elem ), " ", $key, "\n"; -} -echo "Done\n"; -?> ---EXPECTF-- -2007-04-13 06:12:19 CEST sunrise -2007-04-13 20:31:50 CEST sunset -2007-04-13 13:22:05 CEST transit -2007-04-13 05:28:03 CEST civil_twilight_begin -2007-04-13 21:16:06 CEST civil_twilight_end -2007-04-13 04:30:08 CEST nautical_twilight_begin -2007-04-13 22:14:01 CEST nautical_twilight_end -2007-04-13 03:14:36 CEST astronomical_twilight_begin -2007-04-13 23:29:33 CEST astronomical_twilight_end -Done diff --git a/ext/date/tests/date_sunrise_error.phpt b/ext/date/tests/date_sunrise_error.phpt deleted file mode 100644 index f57b7ed1c2624..0000000000000 --- a/ext/date/tests/date_sunrise_error.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test date_sunrise() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : error conditions *** - --- Testing date_sunrise() function with Zero arguments -- - -Warning: date_sunrise() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing date_sunrise() function with more than expected no. of arguments -- - -Warning: date_sunrise() expects at most 6 parameters, 7 given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/date_sunrise_variation1.phpt b/ext/date/tests/date_sunrise_variation1.phpt deleted file mode 100644 index bf6b17ede65b1..0000000000000 --- a/ext/date/tests/date_sunrise_variation1.phpt +++ /dev/null @@ -1,315 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Passing unexpected values to first argument time. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for time - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunrise($value, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $gmt_offset) ); - var_dump( date_sunrise($value, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $gmt_offset) ); - var_dump( date_sunrise($value, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $gmt_offset) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : usage variation *** - ---int 0-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---int 1-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---int 12345-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---int -12345-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---float 10.5-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---float -10.5-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---float .5-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---empty array-- - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---lowercase null-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---lowercase true-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---lowercase false-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---uppercase TRUE-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---uppercase FALSE-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---empty string DQ-- - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunrise() expects parameter 1 to be long, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunrise() expects parameter 1 to be long, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be long, object given in %s on line %d -bool(false) - ---undefined var-- -string(5) "08:56" -float(8.944%d) -int(28599) - ---unset var-- -string(5) "08:56" -float(8.944%d) -int(28599) -===DONE=== diff --git a/ext/date/tests/date_sunrise_variation2.phpt b/ext/date/tests/date_sunrise_variation2.phpt deleted file mode 100644 index 915b790bc7bd2..0000000000000 --- a/ext/date/tests/date_sunrise_variation2.phpt +++ /dev/null @@ -1,212 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Passing unexpected values to second argument format. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for format - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunrise($time, $value, $latitude, $longitude, $zenith, $gmt_offset) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : usage variation *** - ---float 10.5-- - -Warning: date_sunrise(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d -bool(false) - ---float -10.5-- - -Warning: date_sunrise(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d -bool(false) - ---float 12.3456789000e10-- - -Warning: date_sunrise(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d -bool(false) - ---float -12.3456789000e10-- - -Warning: date_sunrise(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d -bool(false) - ---float .5-- -int(1218174483) - ---empty array-- - -Warning: date_sunrise() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunrise() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunrise() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunrise() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---uppercase NULL-- -int(1218174483) - ---lowercase null-- -int(1218174483) - ---lowercase true-- -string(5) "06:48" - ---lowercase false-- -int(1218174483) - ---uppercase TRUE-- -string(5) "06:48" - ---uppercase FALSE-- -int(1218174483) - ---empty string DQ-- - -Warning: date_sunrise() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunrise() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunrise() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunrise() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunrise() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunrise() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunrise() expects parameter 2 to be long, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunrise() expects parameter 2 to be long, object given in %s on line %d -bool(false) - ---undefined var-- -int(1218174483) - ---unset var-- -int(1218174483) -===DONE=== diff --git a/ext/date/tests/date_sunrise_variation3.phpt b/ext/date/tests/date_sunrise_variation3.phpt deleted file mode 100644 index 46c5783c11906..0000000000000 --- a/ext/date/tests/date_sunrise_variation3.phpt +++ /dev/null @@ -1,294 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Passing unexpected values to third argument latitude. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for latitude - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $value, $longitude, $zenith, $gmt_offset) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, $value, $longitude, $zenith, $gmt_offset) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $value, $longitude, $zenith, $gmt_offset) ); -}; -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : usage variation *** - ---int 0-- -string(5) "01:10" -float(1.174%d) -int(1218177627) - ---int 1-- -string(5) "01:09" -float(1.155%d) -int(1218177558) - ---int 12345-- -bool(false) -bool(false) -bool(false) - ---int -12345-- -bool(false) -bool(false) -bool(false) - ---empty array-- - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(5) "01:10" -float(1.174%d) -int(1218177627) - ---lowercase null-- -string(5) "01:10" -float(1.174%d) -int(1218177627) - ---lowercase true-- -string(5) "01:09" -float(1.155%d) -int(1218177558) - ---lowercase false-- -string(5) "01:10" -float(1.174%d) -int(1218177627) - ---uppercase TRUE-- -string(5) "01:09" -float(1.155%d) -int(1218177558) - ---uppercase FALSE-- -string(5) "01:10" -float(1.174%d) -int(1218177627) - ---empty string DQ-- - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunrise() expects parameter 3 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunrise() expects parameter 3 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 3 to be double, object given in %s on line %d -bool(false) - ---undefined var-- -string(5) "01:10" -float(1.174%d) -int(1218177627) - ---unset var-- -string(5) "01:10" -float(1.1742%d) -int(1218177627) -===DONE=== diff --git a/ext/date/tests/date_sunrise_variation4.phpt b/ext/date/tests/date_sunrise_variation4.phpt deleted file mode 100644 index c48f53831de21..0000000000000 --- a/ext/date/tests/date_sunrise_variation4.phpt +++ /dev/null @@ -1,296 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Passing unexpected values to fourth argument longitude. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for longitude - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $latitude, $value, $zenith, $gmt_offset) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, $latitude, $value, $zenith, $gmt_offset) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $value, $zenith, $gmt_offset) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : usage variation *** - ---int 0-- -string(5) "05:12" -float(5.200%d) -int(1218172321) - ---int 1-- -string(5) "05:08" -float(5.133%d) -int(1218172081) - ---int 12345-- -string(5) "21:45" -float(21.759%d) -int(1218145534) - ---int -12345-- -string(5) "12:41" -float(12.698%d) -int(1218199315) - ---empty array-- - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(5) "05:12" -float(5.200%d) -int(1218172321) - ---lowercase null-- -string(5) "05:12" -float(5.200%d) -int(1218172321) - ---lowercase true-- -string(5) "05:08" -float(5.133%d) -int(1218172081) - ---lowercase false-- -string(5) "05:12" -float(5.200%d) -int(1218172321) - ---uppercase TRUE-- -string(5) "05:08" -float(5.133%d) -int(1218172081) - ---uppercase FALSE-- -string(5) "05:12" -float(5.200%d) -int(1218172321) - ---empty string DQ-- - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunrise() expects parameter 4 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunrise() expects parameter 4 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 4 to be double, object given in %s on line %d -bool(false) - ---undefined var-- -string(5) "05:12" -float(5.200%d) -int(1218172321) - ---unset var-- -string(5) "05:12" -float(5.200%d) -int(1218172321) -===DONE=== diff --git a/ext/date/tests/date_sunrise_variation5.phpt b/ext/date/tests/date_sunrise_variation5.phpt deleted file mode 100644 index e697836d1d219..0000000000000 --- a/ext/date/tests/date_sunrise_variation5.phpt +++ /dev/null @@ -1,296 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Passing unexpected values to fifth argument zenith ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for zenith - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $value, $gmt_offset) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $value, $gmt_offset) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $value, $gmt_offset) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : usage variation *** - ---int 0-- -bool(false) -bool(false) -bool(false) - ---int 1-- -bool(false) -bool(false) -bool(false) - ---int 12345-- -string(5) "09:52" -float(9.882%d) -int(1218169377) - ---int -12345-- -string(5) "09:54" -float(9.909%d) -int(1218169475) - ---empty array-- - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, array given in %s on line %d -bool(false) - ---uppercase NULL-- -bool(false) -bool(false) -bool(false) - ---lowercase null-- -bool(false) -bool(false) -bool(false) - ---lowercase true-- -bool(false) -bool(false) -bool(false) - ---lowercase false-- -bool(false) -bool(false) -bool(false) - ---uppercase TRUE-- -bool(false) -bool(false) -bool(false) - ---uppercase FALSE-- -bool(false) -bool(false) -bool(false) - ---empty string DQ-- - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunrise() expects parameter 5 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunrise() expects parameter 5 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 5 to be double, object given in %s on line %d -bool(false) - ---undefined var-- -bool(false) -bool(false) -bool(false) - ---unset var-- -bool(false) -bool(false) -bool(false) -===DONE=== diff --git a/ext/date/tests/date_sunrise_variation6.phpt b/ext/date/tests/date_sunrise_variation6.phpt deleted file mode 100644 index a96b95f564dec..0000000000000 --- a/ext/date/tests/date_sunrise_variation6.phpt +++ /dev/null @@ -1,295 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Passing unexpected values to sixth argument gmt_offset. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for gmt_offset - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $value) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $value) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $value) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : usage variation *** - ---int 0-- -string(5) "05:48" -float(5.800%d) -int(1218174483) - ---int 1-- -string(5) "06:48" -float(6.800%d) -int(1218174483) - ---int 12345-- -string(5) "14:48" -float(14.800%d) -int(1218174483) - ---int -12345-- -string(5) "12:48" -float(12.800%d) -int(1218174483) - ---empty array-- - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(5) "05:48" -float(5.800%d) -int(1218174483) - ---lowercase null-- -string(5) "05:48" -float(5.800%d) -int(1218174483) - ---lowercase true-- -string(5) "06:48" -float(6.800%d) -int(1218174483) - ---lowercase false-- -string(5) "05:48" -float(5.800%d) -int(1218174483) - ---uppercase TRUE-- -string(5) "06:48" -float(6.800%d) -int(1218174483) - ---uppercase FALSE-- -string(5) "05:48" -float(5.800%d) -int(1218174483) - ---empty string DQ-- - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunrise() expects parameter 6 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunrise() expects parameter 6 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 6 to be double, object given in %s on line %d -bool(false) - ---undefined var-- -string(5) "05:48" -float(5.800%d) -int(1218174483) - ---unset var-- -string(5) "05:48" -float(5.800%d) -int(1218174483) -===DONE=== diff --git a/ext/date/tests/date_sunrise_variation7.phpt b/ext/date/tests/date_sunrise_variation7.phpt deleted file mode 100644 index fa5f363a5dce9..0000000000000 --- a/ext/date/tests/date_sunrise_variation7.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Checking sunrise for consecutive days in specific timezone ---FILE-- - array ("Latitude" => -14.24, "Longitude" => -170.72, "GMT" => -11), - "US/Alaska" => array ("Latitude" => 61, "Longitude" => -150 , "GMT" => -9), - "America/Chicago" => array ("Latitude" => 41.85, "Longitude" => -87.65 , "GMT" => -5), - "America/Montevideo" => array ("Latitude" => -34.88, "Longitude" => -56.18 , "GMT" => -3), - "Africa/Casablanca" => array ("Latitude" => 33.65, "Longitude" => -7.58, "GMT" => 0), - "Europe/Moscow" => array ("Latitude" => 55.75, "Longitude" => 37.58, "GMT" => 4), - "Asia/Hong_Kong" => array ("Latitude" => 22.28, "Longitude" => 114.15 , "GMT" => 8), - "Australia/Brisbane" => array ("Latitude" => -27.46, "Longitude" => 153.2 , "GMT" => 10), - "Pacific/Wallis" => array ("Latitude" => -13.3, "Longitude" => -176.16, "GMT" => 12), -); - -foreach($inputs as $timezone => $value) { - date_default_timezone_set($timezone); - $time = mktime(8, 8, 8, 8, 11, 2008); - var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $value["Latitude"], $value["Longitude"], 90, $value["GMT"] )); - $time = mktime(8, 8, 8, 8, 12, 2008); - var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $value["Latitude"], $value["Longitude"], 90, $value["GMT"]) ); -} - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : usage variation *** -string(5) "06:41" -string(5) "06:41" -string(5) "05:09" -string(5) "05:11" -string(5) "05:59" -string(5) "06:00" -string(5) "07:30" -string(5) "07:29" -string(5) "05:53" -string(5) "05:53" -string(5) "05:59" -string(5) "06:01" -string(5) "06:01" -string(5) "06:02" -string(5) "06:23" -string(5) "06:22" -string(5) "06:03" -string(5) "06:02" -===DONE=== diff --git a/ext/date/tests/date_sunrise_variation8.phpt b/ext/date/tests/date_sunrise_variation8.phpt deleted file mode 100644 index 1d22be8c8c1e1..0000000000000 --- a/ext/date/tests/date_sunrise_variation8.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Checking with North and South poles when Sun is up and down all day ---FILE-- - mktime(8, 8, 8, 8, 12, 2008), - "13 Aug 2008" => mktime(8, 8, 8, 8, 13, 2008), - - //Date at which Sun is up all day at South Pole - "12 Nov 2008" => mktime(8, 8, 8, 11, 12, 2008), - "13 Nov 2008" => mktime(8, 8, 8, 11, 13, 2008), -); - -//Iterate over different date and time -foreach( $time_date as $date => $time ){ - echo "\n--$date--\n"; - var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, 90, 0 ) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, 90, 0 ) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, 90, 0 ) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, -90, 0 ) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, -90, 0 ) ); - var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, -90, 0 ) ); -} - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : usage variation *** - ---12 Aug 2008-- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---13 Aug 2008-- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---12 Nov 2008-- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---13 Nov 2008-- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -===DONE=== diff --git a/ext/date/tests/date_sunrise_variation9.phpt b/ext/date/tests/date_sunrise_variation9.phpt deleted file mode 100644 index 49af06d524586..0000000000000 --- a/ext/date/tests/date_sunrise_variation9.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Passing high positive and negative float values to time argument. ---FILE-- - -===DONE=== ---EXPECTREGEX-- -\*\*\* Testing date_sunrise\(\) : usage variation \*\*\* - --- Testing date_sunrise\(\) function by passing float 12.3456789000e10 value to time -- -string\(5\) "(07:34|07:49)" -float\((7.566[0-9]*|7.821[0-9]*)\) -int\((-1097256359|123456811756)\) - --- Testing date_sunrise\(\) function by passing float -12.3456789000e10 value to time -- -string\(5\) "(07:42|08:48|08:04)" -float\((7.713[0-9]*|8.810[0-9]*|8.074[0-9]*)\) -int\((1097304168|-2147443882|-123456761731)\) -===DONE=== diff --git a/ext/date/tests/date_sunset_error.phpt b/ext/date/tests/date_sunset_error.phpt deleted file mode 100644 index a5e75b649e0e0..0000000000000 --- a/ext/date/tests/date_sunset_error.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Test date_sunset() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : error conditions *** - --- Testing date_sunset() function with Zero arguments -- - -Warning: date_sunset() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing date_sunset() function with more than expected no. of arguments -- - -Warning: date_sunset() expects at most 6 parameters, 7 given in %s on line %d -bool(false) - -Warning: date_sunset() expects at most 6 parameters, 7 given in %s on line %d -bool(false) - -Warning: date_sunset() expects at most 6 parameters, 7 given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/date_sunset_variation1.phpt b/ext/date/tests/date_sunset_variation1.phpt deleted file mode 100644 index c2e1195713c50..0000000000000 --- a/ext/date/tests/date_sunset_variation1.phpt +++ /dev/null @@ -1,316 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Passing unexpected values to first argument time. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for time - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunset($value, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $gmt_offset) ); - var_dump( date_sunset($value, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $gmt_offset) ); - var_dump( date_sunset($value, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $gmt_offset) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : usage variation *** - ---int 0-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---int 1-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---int 12345-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---int -12345-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---float 10.5-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---float -10.5-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---float .5-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---empty array-- - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---lowercase null-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---lowercase true-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---lowercase false-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---uppercase TRUE-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---uppercase FALSE-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---empty string DQ-- - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunset() expects parameter 1 to be long, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunset() expects parameter 1 to be long, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be long, object given in %s on line %d -bool(false) - ---undefined var-- -string(5) "18:22" -float(18.377%d) -int(62558) - ---unset var-- -string(5) "18:22" -float(18.377%d) -int(62558) -===DONE=== diff --git a/ext/date/tests/date_sunset_variation2.phpt b/ext/date/tests/date_sunset_variation2.phpt deleted file mode 100644 index 575b64a22c2d7..0000000000000 --- a/ext/date/tests/date_sunset_variation2.phpt +++ /dev/null @@ -1,211 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Passing unexpected values to second argument format. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for format - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunset($time, $value, $latitude, $longitude, $zenith, $gmt_offset) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : usage variation *** - ---float 10.5-- - -Warning: date_sunset(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d -bool(false) - ---float -10.5-- - -Warning: date_sunset(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d -bool(false) - ---float 12.3456789000e10-- - -Warning: date_sunset(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d -bool(false) - ---float -12.3456789000e10-- - -Warning: date_sunset(): Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE in %s on line %d -bool(false) - ---float .5-- -int(1218199253) - ---empty array-- - -Warning: date_sunset() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunset() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunset() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunset() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---uppercase NULL-- -int(1218199253) - ---lowercase null-- -int(1218199253) - ---lowercase true-- -string(5) "18:10" - ---lowercase false-- -int(1218199253) - ---uppercase TRUE-- -string(5) "18:10" - ---uppercase FALSE-- -int(1218199253) - ---empty string DQ-- - -Warning: date_sunset() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunset() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunset() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunset() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunset() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunset() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunset() expects parameter 2 to be long, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunset() expects parameter 2 to be long, object given in %s on line %d -bool(false) - ---undefined var-- -int(1218199253) - ---unset var-- -int(1218199253) -===DONE=== diff --git a/ext/date/tests/date_sunset_variation3.phpt b/ext/date/tests/date_sunset_variation3.phpt deleted file mode 100644 index 142cb9d0b0a8a..0000000000000 --- a/ext/date/tests/date_sunset_variation3.phpt +++ /dev/null @@ -1,297 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Passing unexpected values to third argument latitude. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for latitude - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $value, $longitude, $zenith, $gmt_offset) ); - var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, $value, $longitude, $zenith, $gmt_offset) ); - var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $value, $longitude, $zenith, $gmt_offset) ); - -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : usage variation *** - ---int 0-- -string(5) "17:43" -float(17.730%d) -int(1218197630) - ---int 1-- -string(5) "17:44" -float(17.7496%d) -int(1218197698) - ---int 12345-- -bool(false) -bool(false) -bool(false) - ---int -12345-- -string(5) "17:35" -float(17.598%d) -int(1218197155) - ---empty array-- - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(5) "17:43" -float(17.730%d) -int(1218197630) - ---lowercase null-- -string(5) "17:43" -float(17.730%d) -int(1218197630) - ---lowercase true-- -string(5) "17:44" -float(17.7496%d) -int(1218197698) - ---lowercase false-- -string(5) "17:43" -float(17.730%d) -int(1218197630) - ---uppercase TRUE-- -string(5) "17:44" -float(17.7496%d) -int(1218197698) - ---uppercase FALSE-- -string(5) "17:43" -float(17.730%d) -int(1218197630) - ---empty string DQ-- - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunset() expects parameter 3 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunset() expects parameter 3 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 3 to be double, object given in %s on line %d -bool(false) - ---undefined var-- -string(5) "17:43" -float(17.730%d) -int(1218197630) - ---unset var-- -string(5) "17:43" -float(17.730%d) -int(1218197630) -===DONE=== diff --git a/ext/date/tests/date_sunset_variation4.phpt b/ext/date/tests/date_sunset_variation4.phpt deleted file mode 100644 index 7840f8f8f02b7..0000000000000 --- a/ext/date/tests/date_sunset_variation4.phpt +++ /dev/null @@ -1,296 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Passing unexpected values to fourth argument longitude. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for longitude - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $latitude, $value, $zenith, $gmt_offset) ); - var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, $latitude, $value, $zenith, $gmt_offset) ); - var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $value, $zenith, $gmt_offset) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : usage variation *** - ---int 0-- -string(5) "00:03" -float(0.059%d) -int(1218220414) - ---int 1-- -string(5) "23:59" -float(23.992%d) -int(1218220174) - ---int 12345-- -string(5) "17:15" -float(17.259%d) -int(1218195932) - ---int -12345-- -string(5) "12:18" -float(12.316%d) -int(1218178138) - ---empty array-- - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(5) "00:03" -float(0.059%d) -int(1218220414) - ---lowercase null-- -string(5) "00:03" -float(0.059%d) -int(1218220414) - ---lowercase true-- -string(5) "23:59" -float(23.992%d) -int(1218220174) - ---lowercase false-- -string(5) "00:03" -float(0.059%d) -int(1218220414) - ---uppercase TRUE-- -string(5) "23:59" -float(23.992%d) -int(1218220174) - ---uppercase FALSE-- -string(5) "00:03" -float(0.059%d) -int(1218220414) - ---empty string DQ-- - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunset() expects parameter 4 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunset() expects parameter 4 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 4 to be double, object given in %s on line %d -bool(false) - ---undefined var-- -string(5) "00:03" -float(0.059%d) -int(1218220414) - ---unset var-- -string(5) "00:03" -float(0.059%d) -int(1218220414) -===DONE=== diff --git a/ext/date/tests/date_sunset_variation5.phpt b/ext/date/tests/date_sunset_variation5.phpt deleted file mode 100644 index 26bf4ccc9dd39..0000000000000 --- a/ext/date/tests/date_sunset_variation5.phpt +++ /dev/null @@ -1,296 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Passing unexpected values to fifth argument zenith. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for zenith - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $value, $gmt_offset) ); - var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $value, $gmt_offset) ); - var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $value, $gmt_offset) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : usage variation *** - ---int 0-- -bool(false) -bool(false) -bool(false) - ---int 1-- -bool(false) -bool(false) -bool(false) - ---int 12345-- -string(5) "19:19" -float(19.319%d) -int(1218203349) - ---int -12345-- -bool(false) -bool(false) -bool(false) - ---empty array-- - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, array given in %s on line %d -bool(false) - ---uppercase NULL-- -bool(false) -bool(false) -bool(false) - ---lowercase null-- -bool(false) -bool(false) -bool(false) - ---lowercase true-- -bool(false) -bool(false) -bool(false) - ---lowercase false-- -bool(false) -bool(false) -bool(false) - ---uppercase TRUE-- -bool(false) -bool(false) -bool(false) - ---uppercase FALSE-- -bool(false) -bool(false) -bool(false) - ---empty string DQ-- - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunset() expects parameter 5 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunset() expects parameter 5 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 5 to be double, object given in %s on line %d -bool(false) - ---undefined var-- -bool(false) -bool(false) -bool(false) - ---unset var-- -bool(false) -bool(false) -bool(false) -===DONE=== diff --git a/ext/date/tests/date_sunset_variation6.phpt b/ext/date/tests/date_sunset_variation6.phpt deleted file mode 100644 index a434de8716cc8..0000000000000 --- a/ext/date/tests/date_sunset_variation6.phpt +++ /dev/null @@ -1,296 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Passing unexpected values to sixth argument gmt_offset. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -2345, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for gmt_offset - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $value) ); - var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $value) ); - var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $value) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : usage variation *** - ---int 0-- -string(5) "12:40" -float(12.681%d) -int(1218199253) - ---int 1-- -string(5) "13:40" -float(13.681%d) -int(1218199253) - ---int 12345-- -string(5) "21:40" -float(21.681%d) -int(1218199253) - ---int -12345-- -string(5) "19:40" -float(19.681%d) -int(1218199253) - ---empty array-- - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(5) "12:40" -float(12.681%d) -int(1218199253) - ---lowercase null-- -string(5) "12:40" -float(12.681%d) -int(1218199253) - ---lowercase true-- -string(5) "13:40" -float(13.681%d) -int(1218199253) - ---lowercase false-- -string(5) "12:40" -float(12.681%d) -int(1218199253) - ---uppercase TRUE-- -string(5) "13:40" -float(13.681%d) -int(1218199253) - ---uppercase FALSE-- -string(5) "12:40" -float(12.681%d) -int(1218199253) - ---empty string DQ-- - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: date_sunset() expects parameter 6 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: date_sunset() expects parameter 6 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, object given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 6 to be double, object given in %s on line %d -bool(false) - ---undefined var-- -string(5) "12:40" -float(12.681%d) -int(1218199253) - ---unset var-- -string(5) "12:40" -float(12.681%d) -int(1218199253) -===DONE=== diff --git a/ext/date/tests/date_sunset_variation7.phpt b/ext/date/tests/date_sunset_variation7.phpt deleted file mode 100644 index 0c64d969e20f5..0000000000000 --- a/ext/date/tests/date_sunset_variation7.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Checking sunrise for consecutive days in specific timezone ---FILE-- - array ("Latitude" => -14.24, "Longitude" => -170.72, "GMT" => -11), - "US/Alaska" => array ("Latitude" => 61, "Longitude" => -150 , "GMT" => -9), - "America/Chicago" => array ("Latitude" => 41.85, "Longitude" => -87.65 , "GMT" => -5), - "America/Montevideo" => array ("Latitude" => -34.88, "Longitude" => -56.18 , "GMT" => -3), - "Africa/Casablanca" => array ("Latitude" => 33.65, "Longitude" => "-7.58", "GMT" => 0), - "Europe/Moscow" => array ("Latitude" => 55.75, "Longitude" => 37.58, "GMT" => 4), - "Asia/Hong_Kong" => array ("Latitude" => 22.28, "Longitude" => 114.15 , "GMT" => 8), - "Australia/Brisbane" => array ("Latitude" => -27.46, "Longitude" => 153.2 , "GMT" => 10), - "Pacific/Wallis" => array ("Latitude" => -13.3, "Longitude" => -176.16, "GMT" => 12), -); - -foreach($inputs as $timezone => $value) { - echo "\n--$timezone--\n"; - date_default_timezone_set($timezone); - $time = mktime(8, 8, 8, 8, 11, 2008); - var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $value["Latitude"], $value["Longitude"], 90, $value["GMT"] )); - $time = mktime(8, 8, 8, 8, 12, 2008); - var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $value["Latitude"], $value["Longitude"], 90, $value["GMT"]) ); -} -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : usage variation *** - ---Pacific/Samoa-- -string(5) "18:13" -string(5) "18:13" - ---US/Alaska-- -string(5) "21:00" -string(5) "20:57" - ---America/Chicago-- -string(5) "19:51" -string(5) "19:50" - ---America/Montevideo-- -string(5) "18:08" -string(5) "18:09" - ---Africa/Casablanca-- -string(5) "19:17" -string(5) "19:16" - ---Europe/Moscow-- -string(5) "21:09" -string(5) "21:07" - ---Asia/Hong_Kong-- -string(5) "18:55" -string(5) "18:54" - ---Australia/Brisbane-- -string(5) "17:21" -string(5) "17:21" - ---Pacific/Wallis-- -string(5) "17:36" -string(5) "17:36" -===DONE=== diff --git a/ext/date/tests/date_sunset_variation8.phpt b/ext/date/tests/date_sunset_variation8.phpt deleted file mode 100644 index 9114e3bfae421..0000000000000 --- a/ext/date/tests/date_sunset_variation8.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Checking with North and South poles when Sun is up and down all day ---FILE-- - mktime(8, 8, 8, 8, 12, 2008), - - //Date at which Sun is up all day at South Pole - "12 Nov 2008" => mktime(8, 8, 8, 11, 12, 2008), -); - -//Iterate over different date and time -foreach( $time_date as $date => $time ){ - echo "\n--$date--\n"; - var_dump( date_sunset($time, SUNFUNCS_RET_STRING, 90, 0 ) ); - var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, 90, 0 ) ); - var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, 90, 0 ) ); - var_dump( date_sunset($time, SUNFUNCS_RET_STRING, -90, 0 ) ); - var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, -90, 0 ) ); - var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, -90, 0 ) ); -} - -?> -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : usage variation *** - ---12 Aug 2008-- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---12 Nov 2008-- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -===DONE=== diff --git a/ext/date/tests/date_sunset_variation9.phpt b/ext/date/tests/date_sunset_variation9.phpt deleted file mode 100644 index 59a4b584a5b4c..0000000000000 --- a/ext/date/tests/date_sunset_variation9.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Passing high positive and negative float values to time argument. ---FILE-- - -===DONE=== ---EXPECTREGEX-- -\*\*\* Testing date_sunset\(\) : usage variation \*\*\* - --- Testing date_sunset\(\) function by passing float 12.3456789000e10 value to time -- -string\(5\) "(19:49|19:28)" -float\((19.830[0-9]*|19.830[0-9]*|19.480[0-9]*)\) -int\((-1097212211|123456853728)\) - --- Testing date_sunset\(\) function by passing float -12.3456789000e10 value to time -- -string\(5\) "(19:03|18:12|18:48)" -float\((19.056[0-9]*|18.213[0-9]*|18.808[0-9]*)\) -int\((1097345002|-2147410031|-123456723090)\) -===DONE=== diff --git a/ext/date/tests/default-timezone-1.phpt b/ext/date/tests/default-timezone-1.phpt deleted file mode 100644 index ea5f2e6b84f46..0000000000000 --- a/ext/date/tests/default-timezone-1.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -date.timezone setting [1] ---INI-- -date.timezone=GMT ---FILE-- - ---EXPECT-- -1119132944 diff --git a/ext/date/tests/default-timezone-2.phpt b/ext/date/tests/default-timezone-2.phpt deleted file mode 100644 index c9a404bccba15..0000000000000 --- a/ext/date/tests/default-timezone-2.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -date.timezone setting [2] ---INI-- -date.timezone=Europe/Oslo ---FILE-- - ---EXPECT-- -1119125744 diff --git a/ext/date/tests/format-negative-timestamp.phpt b/ext/date/tests/format-negative-timestamp.phpt deleted file mode 100644 index 5fd6a65897b64..0000000000000 --- a/ext/date/tests/format-negative-timestamp.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -strtotime() - Format: @timestamps ---FILE-- - $max_2) - $new_tm *= -1; - - if (strtotime("@$new_tm") != $new_tm) { - echo "Error when parsing: @$new_tm\n"; - } -} - -echo "done!"; -?> ---EXPECT-- -done! diff --git a/ext/date/tests/gettimeofday_basic.phpt b/ext/date/tests/gettimeofday_basic.phpt deleted file mode 100644 index fe04f015e501b..0000000000000 --- a/ext/date/tests/gettimeofday_basic.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test gettimeofday() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gettimeofday() : basic functionality *** -float(%f) -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} -===DONE=== diff --git a/ext/date/tests/gettimeofday_error.phpt b/ext/date/tests/gettimeofday_error.phpt deleted file mode 100644 index 558a381fe3f28..0000000000000 --- a/ext/date/tests/gettimeofday_error.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test gettimeofday() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gettimeofday() : error conditions *** - --- Testing gettimeofday() function with more than expected no. of arguments -- - -Warning: gettimeofday() expects at most 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/date/tests/gettimeofday_variation1.phpt b/ext/date/tests/gettimeofday_variation1.phpt deleted file mode 100644 index f494a25b53be5..0000000000000 --- a/ext/date/tests/gettimeofday_variation1.phpt +++ /dev/null @@ -1,284 +0,0 @@ ---TEST-- -Test gettimeofday() function : usage variation - Passing unexpected values to get_as_float argument ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for get_as_float - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( gettimeofday($value) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing gettimeofday() : usage variation *** - ---int 0-- -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} - ---int 1-- -float(%f) - ---int 12345-- -float(%f) - ---int -12345-- -float(%f) - ---float 10.5-- -float(%f) - ---float -10.5-- -float(%f) - ---float 12.3456789000e10-- -float(%f) - ---float -12.3456789000e10-- -float(%f) - ---float .5-- -float(%f) - ---empty array-- - -Warning: gettimeofday() expects parameter 1 to be boolean, array given in %s on line %d -NULL - ---int indexed array-- - -Warning: gettimeofday() expects parameter 1 to be boolean, array given in %s on line %d -NULL - ---associative array-- - -Warning: gettimeofday() expects parameter 1 to be boolean, array given in %s on line %d -NULL - ---nested arrays-- - -Warning: gettimeofday() expects parameter 1 to be boolean, array given in %s on line %d -NULL - ---uppercase NULL-- -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} - ---lowercase null-- -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} - ---lowercase true-- -float(%f) - ---lowercase false-- -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} - ---uppercase TRUE-- -float(%f) - ---uppercase FALSE-- -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} - ---empty string DQ-- -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} - ---empty string SQ-- -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} - ---string DQ-- -float(%f) - ---string SQ-- -float(%f) - ---mixed case string-- -float(%f) - ---heredoc-- -float(%f) - ---instance of classWithToString-- - -Warning: gettimeofday() expects parameter 1 to be boolean, object given in %s on line %d -NULL - ---instance of classWithoutToString-- - -Warning: gettimeofday() expects parameter 1 to be boolean, object given in %s on line %d -NULL - ---undefined var-- -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} - ---unset var-- -array(4) { - ["sec"]=> - int(%d) - ["usec"]=> - int(%d) - ["minuteswest"]=> - int(-330) - ["dsttime"]=> - int(0) -} -===DONE=== diff --git a/ext/date/tests/gmdate_basic.phpt b/ext/date/tests/gmdate_basic.phpt deleted file mode 100644 index ae036cacba662..0000000000000 --- a/ext/date/tests/gmdate_basic.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test gmdate() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : basic functionality *** -string(24) "2008-08-08T08:08:08+0000" -string(%d) "%s" -===DONE=== diff --git a/ext/date/tests/gmdate_error.phpt b/ext/date/tests/gmdate_error.phpt deleted file mode 100644 index fbee071269cef..0000000000000 --- a/ext/date/tests/gmdate_error.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test gmdate() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : error conditions *** - --- Testing gmdate() function with Zero arguments -- - -Warning: gmdate() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing gmdate() function with more than expected no. of arguments -- - -Warning: gmdate() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/gmdate_variation1.phpt b/ext/date/tests/gmdate_variation1.phpt deleted file mode 100644 index f6850ccd20796..0000000000000 --- a/ext/date/tests/gmdate_variation1.phpt +++ /dev/null @@ -1,221 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing unexpected values to format argument. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for format - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( gmdate($value, $timestamp) ); - var_dump( gmdate($value) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - ---int 0-- -string(1) "0" -string(1) "0" - ---int 1-- -string(1) "1" -string(1) "1" - ---int 12345-- -string(5) "12345" -string(5) "12345" - ---int -12345-- -string(6) "-12345" -string(6) "-12345" - ---float 10.5-- -string(4) "10.5" -string(4) "10.5" - ---float -10.5-- -string(5) "-10.5" -string(5) "-10.5" - ---float 12.3456789000e10-- -string(12) "123456789000" -string(12) "123456789000" - ---float -12.3456789000e10-- -string(13) "-123456789000" -string(13) "-123456789000" - ---float .5-- -string(3) "0.5" -string(3) "0.5" - ---empty array-- - -Warning: gmdate() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: gmdate() expects parameter 1 to be string, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: gmdate() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: gmdate() expects parameter 1 to be string, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: gmdate() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: gmdate() expects parameter 1 to be string, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: gmdate() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: gmdate() expects parameter 1 to be string, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(0) "" -string(0) "" - ---lowercase null-- -string(0) "" -string(0) "" - ---lowercase true-- -string(1) "1" -string(1) "1" - ---lowercase false-- -string(0) "" -string(0) "" - ---uppercase TRUE-- -string(1) "1" -string(1) "1" - ---uppercase FALSE-- -string(0) "" -string(0) "" - ---empty string DQ-- -string(0) "" -string(0) "" - ---empty string SQ-- -string(0) "" -string(0) "" - ---instance of classWithToString-- -string(53) "CFridayam0808 AM 2008b8UTC2008-08-08T08:08:08+00:0031" -string(%d) "%s" - ---instance of classWithoutToString-- - -Warning: gmdate() expects parameter 1 to be string, object given in %s on line %d -bool(false) - -Warning: gmdate() expects parameter 1 to be string, object given in %s on line %d -bool(false) - ---undefined var-- -string(0) "" -string(0) "" - ---unset var-- -string(0) "" -string(0) "" -===DONE=== diff --git a/ext/date/tests/gmdate_variation10.phpt b/ext/date/tests/gmdate_variation10.phpt deleted file mode 100644 index d5298368d3fd8..0000000000000 --- a/ext/date/tests/gmdate_variation10.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing Timezone format options to format argument. ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - --- Testing gmdate() function with Timezone identifier format -- -string(3) "UTC" -string(3) "UTC" - --- Testing gmdate() function with checking whether date is in daylight saving time format -- -string(1) "%d" -string(1) "%d" - --- Testing gmdate() function with difference to GMT in hours format -- -string(5) "+0000" -string(5) "+0000" - --- Testing gmdate() function with Difference to GMT in hours using colon as separator format -- -string(6) "+00:00" -string(6) "+00:00" - --- Testing gmdate() function with timezone abbreviation format -- -string(3) "GMT" -string(3) "GMT" - --- Testing gmdate() function with timezone offset format -- -string(3) "GMT" -string(3) "GMT" -===DONE=== diff --git a/ext/date/tests/gmdate_variation11.phpt b/ext/date/tests/gmdate_variation11.phpt deleted file mode 100644 index a9520907cb8c2..0000000000000 --- a/ext/date/tests/gmdate_variation11.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing Full Date/Time format options to format argument. ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - --- Testing gmdate() function with ISO 8601 date format -- -string(%d) "%s" -string(25) "2008-08-08T08:08:08+00:00" - --- Testing gmdate() function with RFC 2822 date format -- -string(%d) "%s" -string(31) "Fri, 08 Aug 2008 08:08:08 +0000" - --- Testing gmdate() function with seconds since Unix Epoch format -- -string(%d) "%d" -string(10) "1218182888" -===DONE=== diff --git a/ext/date/tests/gmdate_variation12.phpt b/ext/date/tests/gmdate_variation12.phpt deleted file mode 100644 index 8f0146f384885..0000000000000 --- a/ext/date/tests/gmdate_variation12.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Valid and invalid range of timestamp. ---FILE-- - -===DONE=== ---EXPECTREGEX-- -\*\*\* Testing gmdate\(\) : usage variation \*\*\* - --- Testing gmdate\(\) function with minimum range of timestamp -- -string\(24\) "1901-12-13T20:45:54\+0000" - --- Testing gmdate\(\) function with less than the range of timestamp -- -string\(24\) "(1970-01-01T00:00:00\+0000|1901-12-13T20:45:50\+0000)" - --- Testing gmdate\(\) function with maximum range of timestamp -- -string\(24\) "2038-01-19T03:14:07\+0000" - --- Testing gmdate\(\) function with greater than the range of timestamp -- -string\(24\) "(1970-01-01T00:00:00\+0000|2038-01-19T03:14:10\+0000)" -===DONE=== diff --git a/ext/date/tests/gmdate_variation13.phpt b/ext/date/tests/gmdate_variation13.phpt deleted file mode 100644 index adc03919e85d1..0000000000000 --- a/ext/date/tests/gmdate_variation13.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing predefined constants to format argument. ---FILE-- - DATE_ATOM, - 'DATE_COOKIE Constant' => DATE_COOKIE, - 'DATE_RFC822 Constant' => DATE_RFC822, - 'DATE_RFC850 Constant' => DATE_RFC850, - 'DATE_RFC1036 Constant' => DATE_RFC1036, - 'DATE_RFC1123 Constant' => DATE_RFC1123, - 'DATE_RFC2822 Constant' => DATE_RFC2822, - 'DATE_RFC3339 Constant' => DATE_RFC3339, - 'DATE_RSS Constant' => DATE_RSS, - 'DATE_W3C Constant' => DATE_W3C, -); - -// loop through each element of the array for format -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( gmdate($value, $timestamp) ); - var_dump( gmdate($value) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - ---DATE_ATOM Constant-- -string(25) "2008-08-08T08:08:08+00:00" -string(%d) "%s" - ---DATE_COOKIE Constant-- -string(30) "Friday, 08-Aug-08 08:08:08 GMT" -string(%d) "%s" - ---DATE_RFC822 Constant-- -string(29) "Fri, 08 Aug 08 08:08:08 +0000" -string(%d) "%s" - ---DATE_RFC850 Constant-- -string(30) "Friday, 08-Aug-08 08:08:08 GMT" -string(%d) "%s" - ---DATE_RFC1036 Constant-- -string(29) "Fri, 08 Aug 08 08:08:08 +0000" -string(%d) "%s" - ---DATE_RFC1123 Constant-- -string(31) "Fri, 08 Aug 2008 08:08:08 +0000" -string(%d) "%s" - ---DATE_RFC2822 Constant-- -string(31) "Fri, 08 Aug 2008 08:08:08 +0000" -string(%d) "%s" - ---DATE_RFC3339 Constant-- -string(25) "2008-08-08T08:08:08+00:00" -string(%d) "%s" - ---DATE_RSS Constant-- -string(31) "Fri, 08 Aug 2008 08:08:08 +0000" -string(%d) "%s" - ---DATE_W3C Constant-- -string(25) "2008-08-08T08:08:08+00:00" -string(%d) "%s" -===DONE=== diff --git a/ext/date/tests/gmdate_variation14.phpt b/ext/date/tests/gmdate_variation14.phpt deleted file mode 100644 index dfea054c6486c..0000000000000 --- a/ext/date/tests/gmdate_variation14.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing high positive and negetive float values to timestamp. ---FILE-- - -===DONE=== ---EXPECTREGEX-- -\*\*\* Testing gmdate\(\) : usage variation \*\*\* - --- Testing gmdate\(\) function with float 12.3456789000e10 to timestamp -- -string\((24|25)\) "(1935-03-26T04:50:16\+0000|5882-03-11T00:30:00\+0000)" - --- Testing gmdate\(\) function with float -12.3456789000e10 to timestamp -- -string\((24|25)\) "(2004-10-08T19:09:44\+0000|1901-12-13T20:45:52\+0000|-1943-10-22T23:30:00\+0000)" -===DONE=== diff --git a/ext/date/tests/gmdate_variation2.phpt b/ext/date/tests/gmdate_variation2.phpt deleted file mode 100644 index c52de9da75d00..0000000000000 --- a/ext/date/tests/gmdate_variation2.phpt +++ /dev/null @@ -1,210 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing unexpected values to timestamp argument. ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // int data - 'int 0' => 0, - 'int 1' => 1, - 'int 12345' => 12345, - 'int -12345' => -12345, - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for timestamp - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( gmdate($format, $value) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - ---int 0-- -string(24) "1970-01-01T00:00:00+0000" - ---int 1-- -string(24) "1970-01-01T00:00:01+0000" - ---int 12345-- -string(24) "1970-01-01T03:25:45+0000" - ---int -12345-- -string(24) "1969-12-31T20:34:15+0000" - ---float 10.5-- -string(24) "1970-01-01T00:00:10+0000" - ---float -10.5-- -string(24) "1969-12-31T23:59:50+0000" - ---float .5-- -string(24) "1970-01-01T00:00:00+0000" - ---empty array-- - -Warning: gmdate() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---int indexed array-- - -Warning: gmdate() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---associative array-- - -Warning: gmdate() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---nested arrays-- - -Warning: gmdate() expects parameter 2 to be long, array given in %s on line %d -bool(false) - ---uppercase NULL-- -string(24) "1970-01-01T00:00:00+0000" - ---lowercase null-- -string(24) "1970-01-01T00:00:00+0000" - ---lowercase true-- -string(24) "1970-01-01T00:00:01+0000" - ---lowercase false-- -string(24) "1970-01-01T00:00:00+0000" - ---uppercase TRUE-- -string(24) "1970-01-01T00:00:01+0000" - ---uppercase FALSE-- -string(24) "1970-01-01T00:00:00+0000" - ---empty string DQ-- - -Warning: gmdate() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---empty string SQ-- - -Warning: gmdate() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---string DQ-- - -Warning: gmdate() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---string SQ-- - -Warning: gmdate() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---mixed case string-- - -Warning: gmdate() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---heredoc-- - -Warning: gmdate() expects parameter 2 to be long, string given in %s on line %d -bool(false) - ---instance of classWithToString-- - -Warning: gmdate() expects parameter 2 to be long, object given in %s on line %d -bool(false) - ---instance of classWithoutToString-- - -Warning: gmdate() expects parameter 2 to be long, object given in %s on line %d -bool(false) - ---undefined var-- -string(24) "1970-01-01T00:00:00+0000" - ---unset var-- -string(24) "1970-01-01T00:00:00+0000" -===DONE=== diff --git a/ext/date/tests/gmdate_variation3.phpt b/ext/date/tests/gmdate_variation3.phpt deleted file mode 100644 index a93d6e9239adf..0000000000000 --- a/ext/date/tests/gmdate_variation3.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing numeric representation of day formats. ---FILE-- - 'd', - 'Day without leading zeros' => 'j', - 'ISO representation' => 'N', - 'Numeric representation of day' => 'w', - 'Day of the year' => 'z' -); - -// loop through each element of the array for timestamp - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( gmdate($value) ); - var_dump( gmdate($value, $timestamp) ); -}; - -?> -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - ---Day with leading zeros-- -string(%d) "%d" -string(2) "08" - ---Day without leading zeros-- -string(%d) "%d" -string(1) "8" - ---ISO representation-- -string(%d) "%d" -string(1) "5" - ---Numeric representation of day-- -string(%d) "%d" -string(1) "5" - ---Day of the year-- -string(%d) "%d" -string(3) "220" -===DONE=== diff --git a/ext/date/tests/gmdate_variation4.phpt b/ext/date/tests/gmdate_variation4.phpt deleted file mode 100644 index bb97b567c6dc8..0000000000000 --- a/ext/date/tests/gmdate_variation4.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing textual representation of day formats. ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - --- Testing gmdate() function with partial textual representation of day -- -string(%d) "%s" -string(3) "Fri" - --- Testing gmdate() function with full textual representation of day -- -string(%d) "%s" -string(6) "Friday" - --- Testing gmdate() function with English ordinal suffix -- -string(%d) "%s" -string(2) "th" -===DONE=== diff --git a/ext/date/tests/gmdate_variation5.phpt b/ext/date/tests/gmdate_variation5.phpt deleted file mode 100644 index d40488a692746..0000000000000 --- a/ext/date/tests/gmdate_variation5.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing Week representation to format. ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - --- Testing gmdate() function with ISO-8601 week number of year format -- -string(%d) "%d" -string(2) "32" -===DONE=== diff --git a/ext/date/tests/gmdate_variation6.phpt b/ext/date/tests/gmdate_variation6.phpt deleted file mode 100644 index f5b63a5b3f616..0000000000000 --- a/ext/date/tests/gmdate_variation6.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing Month format options to format argument. ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - --- Testing gmdate() function with full textual representation of month format -- -string(%d) "%s" -string(6) "August" - --- Testing gmdate() function with numeric representation of month format -- -string(%d) "%d" -string(2) "08" - --- Testing gmdate() function with short textual representation of month format -- -string(%d) "%s" -string(3) "Aug" - --- Testing gmdate() function with numeric representation of month without leading zeros format -- -string(%d) "%d" -string(1) "8" - --- Testing gmdate() function with number of days in a month format -- -string(%d) "%d" -string(2) "31" -===DONE=== diff --git a/ext/date/tests/gmdate_variation7.phpt b/ext/date/tests/gmdate_variation7.phpt deleted file mode 100644 index 8d9c1b0b971ae..0000000000000 --- a/ext/date/tests/gmdate_variation7.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing Year format options to format argument. ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - --- Testing gmdate() function with checking non leap year using Leap Year format -- -string(1) "0" - --- Testing gmdate() function with checking leap year using Leap Year format -- -string(1) "%d" -string(1) "1" - --- Testing gmdate() function with ISO-8601 year number format -- -string(4) "%d" -string(4) "2008" - --- Testing gmdate() function with full numeric representation of year format -- -string(4) "%d" -string(4) "2008" - --- Testing gmdate() function with 2 digit representation year format -- -string(2) "%d" -string(2) "08" -===DONE=== diff --git a/ext/date/tests/gmdate_variation8.phpt b/ext/date/tests/gmdate_variation8.phpt deleted file mode 100644 index 8d9c1b0b971ae..0000000000000 --- a/ext/date/tests/gmdate_variation8.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing Year format options to format argument. ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - --- Testing gmdate() function with checking non leap year using Leap Year format -- -string(1) "0" - --- Testing gmdate() function with checking leap year using Leap Year format -- -string(1) "%d" -string(1) "1" - --- Testing gmdate() function with ISO-8601 year number format -- -string(4) "%d" -string(4) "2008" - --- Testing gmdate() function with full numeric representation of year format -- -string(4) "%d" -string(4) "2008" - --- Testing gmdate() function with 2 digit representation year format -- -string(2) "%d" -string(2) "08" -===DONE=== diff --git a/ext/date/tests/gmdate_variation9.phpt b/ext/date/tests/gmdate_variation9.phpt deleted file mode 100644 index e210557ace983..0000000000000 --- a/ext/date/tests/gmdate_variation9.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing Time format options to format argument. ---FILE-- - 'a', - 'Uppercase Ante meridiem and post meridiem' => 'a', - 'Swatch Internet time' => 'B', - '12-hour format without leading zeros' => 'g', - '24-hour format without leading zeros' => 'G', - '12-hour format with leading zeros' => 'h', - '24-hour format with leading zeros' => 'H', - 'Minutes with leading zeros' => 'i', - 'Seconds with leading zeros' => 's', - 'Milliseconds' => 'u', -); - -foreach($time_formats as $key =>$value) { - echo "\n--$key--\n"; - var_dump( gmdate($value) ); - var_dump( gmdate($value, $timestamp) ); -} - -?> -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - ---Lowercase Ante meridiem and post meridiem-- -string(2) "%s" -string(2) "am" - ---Uppercase Ante meridiem and post meridiem-- -string(2) "%s" -string(2) "am" - ---Swatch Internet time-- -string(%d) "%d" -string(3) "380" - ---12-hour format without leading zeros-- -string(%d) "%d" -string(1) "8" - ---24-hour format without leading zeros-- -string(%d) "%d" -string(1) "8" - ---12-hour format with leading zeros-- -string(%d) "%d" -string(2) "08" - ---24-hour format with leading zeros-- -string(2) "%d" -string(2) "08" - ---Minutes with leading zeros-- -string(2) "%d" -string(2) "08" - ---Seconds with leading zeros-- -string(2) "%d" -string(2) "08" - ---Milliseconds-- -string(%d) "%d" -string(6) "000000" -===DONE=== diff --git a/ext/date/tests/mktime-1.phpt b/ext/date/tests/mktime-1.phpt deleted file mode 100644 index 87fc0df68573d..0000000000000 --- a/ext/date/tests/mktime-1.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Check for mktime with out-of-range parameters ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECT-- -2000-02-29 -2000-02-28 -2000-02-29 -2001-02-28 -2001-03-01 -1999-11-30 -2000-05-29 12:00:00 -2000-05-29 13:00:00 -2000-05-29 12:00:00 -2000-01-31 12:00:00 -2000-01-31 12:00:00 -2000-01-31 11:00:00 -2000-04-29 12:00:00 -2000-04-29 13:00:00 -2000-04-29 12:00:00 diff --git a/ext/date/tests/mktime-2.phpt b/ext/date/tests/mktime-2.phpt deleted file mode 100644 index aa259b577cab7..0000000000000 --- a/ext/date/tests/mktime-2.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -mktime() [2] ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECTF-- -int(1009843200) -int(1009843200) -int(1009843200) -int(%s) -int(1025481600) -int(1025481600) -int(1025481600) -int(%s) -int(1009843200) -int(1009843200) -int(1009843200) -int(1009839600) -int(1025478000) -int(1025478000) -int(1025481600) -int(1025478000) diff --git a/ext/date/tests/mktime-3-64bit.phpt b/ext/date/tests/mktime-3-64bit.phpt deleted file mode 100644 index a3649cd1488ff..0000000000000 --- a/ext/date/tests/mktime-3-64bit.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -mktime() [3] (64-bit) ---SKIPIF-- - ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECT-- -America/Toronto -Y: 0 - January 2000-01-01T01:01:01-0500 -Y: 69 - January 2069-01-01T01:01:01-0500 -Y: 70 - January 1970-01-01T01:01:01-0500 -Y: 71 - January 1971-01-01T01:01:01-0500 -Y: 99 - January 1999-01-01T01:01:01-0500 -Y: 100 - January 2000-01-01T01:01:01-0500 -Y: 101 - January 0101-01-01T01:01:01-0500 -Y: 105 - January 0105-01-01T01:01:01-0500 -Y: 110 - January 0110-01-01T01:01:01-0500 -Y: 1900 - January 1900-01-01T01:01:01-0500 -Y: 1901 - January 1901-01-01T01:01:01-0500 -Y: 1902 - January 1902-01-01T01:01:01-0500 -Y: 1999 - January 1999-01-01T01:01:01-0500 -Y: 2000 - January 2000-01-01T01:01:01-0500 -Y: 2001 - January 2001-01-01T01:01:01-0500 - -Europe/Oslo -Y: 0 - January 2000-01-01T01:01:01+0100 -Y: 69 - January 2069-01-01T01:01:01+0100 -Y: 70 - January 1970-01-01T01:01:01+0100 -Y: 71 - January 1971-01-01T01:01:01+0100 -Y: 99 - January 1999-01-01T01:01:01+0100 -Y: 100 - January 2000-01-01T01:01:01+0100 -Y: 101 - January 0101-01-01T01:01:01+0100 -Y: 105 - January 0105-01-01T01:01:01+0100 -Y: 110 - January 0110-01-01T01:01:01+0100 -Y: 1900 - January 1900-01-01T01:01:01+0100 -Y: 1901 - January 1901-01-01T01:01:01+0100 -Y: 1902 - January 1902-01-01T01:01:01+0100 -Y: 1999 - January 1999-01-01T01:01:01+0100 -Y: 2000 - January 2000-01-01T01:01:01+0100 -Y: 2001 - January 2001-01-01T01:01:01+0100 diff --git a/ext/date/tests/mktime-3.phpt b/ext/date/tests/mktime-3.phpt deleted file mode 100644 index 3201def6caca3..0000000000000 --- a/ext/date/tests/mktime-3.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -mktime() [3] (32-bit) ---SKIPIF-- - ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECT-- -America/Toronto -Y: 0 - January 2000-01-01T01:01:01-0500 -Y: 69 - out of range -Y: 70 - January 1970-01-01T01:01:01-0500 -Y: 71 - January 1971-01-01T01:01:01-0500 -Y: 99 - January 1999-01-01T01:01:01-0500 -Y: 100 - January 2000-01-01T01:01:01-0500 -Y: 105 - January 2005-01-01T01:01:01-0500 -Y: 1900 - out of range -Y: 1901 - out of range -Y: 1902 - January 1902-01-01T01:01:01-0500 -Y: 1999 - January 1999-01-01T01:01:01-0500 -Y: 2000 - January 2000-01-01T01:01:01-0500 -Y: 2001 - January 2001-01-01T01:01:01-0500 - -Europe/Oslo -Y: 0 - January 2000-01-01T01:01:01+0100 -Y: 69 - out of range -Y: 70 - January 1970-01-01T01:01:01+0100 -Y: 71 - January 1971-01-01T01:01:01+0100 -Y: 99 - January 1999-01-01T01:01:01+0100 -Y: 100 - January 2000-01-01T01:01:01+0100 -Y: 105 - January 2005-01-01T01:01:01+0100 -Y: 1900 - out of range -Y: 1901 - out of range -Y: 1902 - January 1902-01-01T01:01:01+0100 -Y: 1999 - January 1999-01-01T01:01:01+0100 -Y: 2000 - January 2000-01-01T01:01:01+0100 -Y: 2001 - January 2001-01-01T01:01:01+0100 diff --git a/ext/date/tests/oo_001.phpt b/ext/date/tests/oo_001.phpt deleted file mode 100644 index 9b6142158f9c4..0000000000000 --- a/ext/date/tests/oo_001.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -date OO interface ---INI-- -date.timezone=UTC ---FILE-- -format("Y-m-d H:i:s")); - -$d = new _d; -var_dump($d->format("Y-m-d H:i:s")); - -try { - new DateTime("1am todax"); -} catch (Exception $e) { - echo $e->getMessage(),"\n"; -} - -$t = new DateTimeZone("UTC"); -var_dump($t->getName()); - -$t = new _t; -var_dump($t->getName()); - -try { - new DateTimeZone("GottaFindThisOne"); -} catch (Exception $e) { - echo $e->getMessage(),"\n"; -} - -echo "DONE\n"; -?> ---EXPECTF-- -string(19) "%d-%d-%d %d:%d:%d" - -Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %soo_001.php on line %d -bool(false) -DateTime::__construct(): Failed to parse time string (1am todax) at position 4 (t): The timezone could not be found in the database -string(3) "UTC" - -Warning: DateTimeZone::getName(): The DateTimeZone object has not been correctly initialized by its constructor in %soo_001.php on line %d -bool(false) -DateTimeZone::__construct(): Unknown or bad timezone (GottaFindThisOne) -DONE diff --git a/ext/date/tests/oo_002.phpt b/ext/date/tests/oo_002.phpt deleted file mode 100644 index 0cd9187b1e65d..0000000000000 --- a/ext/date/tests/oo_002.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -date OO cloning ---INI-- -date.timezone=Europe/Berlin ---FILE-- -format(DateTime::RFC822)); -$c = clone $d; -var_dump($c->format(DateTime::RFC822)); -$d->modify("1 hour after"); -$c->modify("1 second ago"); -var_dump($d->format(DateTime::RFC822)); -var_dump($c->format(DateTime::RFC822)); -$t = new _t("Asia/Tokyo"); -var_dump($t->getName()); -$c = clone $t; -var_dump($c->getName()); -?> ---EXPECT-- -string(29) "Wed, 01 Aug 07 13:00:00 +0000" -string(29) "Wed, 01 Aug 07 13:00:00 +0000" -string(29) "Wed, 01 Aug 07 14:00:00 +0000" -string(29) "Wed, 01 Aug 07 12:59:59 +0000" -string(10) "Asia/Tokyo" -string(10) "Asia/Tokyo" diff --git a/ext/date/tests/strtotime-mysql-64bit.phpt b/ext/date/tests/strtotime-mysql-64bit.phpt deleted file mode 100644 index 38e7f15dff1ad..0000000000000 --- a/ext/date/tests/strtotime-mysql-64bit.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -strtotime() and mysql timestamps (64 bit) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(31) "Fri, 23 May 1997 09:15:28 +0000" -string(31) "Sun, 31 Dec 2000 18:58:59 +0000" -string(31) "Wed, 10 Apr 2080 10:10:10 +0000" - diff --git a/ext/date/tests/strtotime-mysql.phpt b/ext/date/tests/strtotime-mysql.phpt deleted file mode 100755 index e5935bb165e47..0000000000000 --- a/ext/date/tests/strtotime-mysql.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -strtotime() and mysql timestamps (32 bit) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(31) "Fri, 23 May 1997 09:15:28 +0000" -string(31) "Sun, 31 Dec 2000 18:58:59 +0000" -bool(false) diff --git a/ext/date/tests/strtotime.phpt b/ext/date/tests/strtotime.phpt deleted file mode 100644 index 6560d7f1fd3e9..0000000000000 --- a/ext/date/tests/strtotime.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -strtotime() function ---FILE-- - ---EXPECT-- -2005-07-14T22:30:41+0200 -2005-07-15T00:30:41+0200 diff --git a/ext/date/tests/strtotime2.phpt b/ext/date/tests/strtotime2.phpt deleted file mode 100644 index b8b605923dbce..0000000000000 --- a/ext/date/tests/strtotime2.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -strtotime() on date constants ---FILE-- - ---EXPECT-- -DATE_ATOM: OK -DATE_COOKIE: OK -DATE_ISO8601: OK -DATE_RFC822: OK -DATE_RFC850: OK -DATE_RFC1036: OK -DATE_RFC1123: OK -DATE_RFC2822: OK -DATE_RFC3339: OK -DATE_RSS: OK -DATE_W3C: OK diff --git a/ext/date/tests/strtotime3-64bit.phpt b/ext/date/tests/strtotime3-64bit.phpt deleted file mode 100644 index 7dc0816359da8..0000000000000 --- a/ext/date/tests/strtotime3-64bit.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -strtotime() function (64 bit) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(false) -bool(false) -string(31) "Thu, 15 Jun 2006 00:00:00 +0100" -string(31) "Fri, 16 Jun 2006 22:49:12 +0100" -bool(false) -string(31) "Fri, 16 Jun 2006 23:49:12 +0100" -bool(false) -string(31) "Fri, 16 Jun 2006 02:22:00 +0100" -string(31) "Mon, 16 Jun 0222 02:22:00 -0036" -string(31) "Fri, 16 Jun 2006 02:22:33 +0100" -bool(false) -string(31) "Tue, 02 Mar 2004 00:00:00 +0000" -string(31) "Tue, 02 Mar 2004 00:00:00 +0000" -string(31) "Sun, 12 Feb 2006 23:12:23 +0000" -bool(false) -string(31) "Fri, 16 Jun 2006 00:00:00 +0100" -string(31) "Sun, 15 Jan 2006 00:00:00 +0000" -string(31) "Sun, 15 Jan 2006 00:00:00 +0000" -string(31) "Tue, 10 Oct 2000 13:55:36 +0100" -bool(false) -string(31) "Fri, 16 Jun 2006 20:06:00 +0100" -string(31) "Mon, 16 Jun 1986 22:51:59 +0100" -string(31) "Mon, 16 Jan 2006 00:00:00 +0000" -string(31) "Mon, 16 Jan 2006 00:00:00 +0000" diff --git a/ext/date/tests/strtotime3.phpt b/ext/date/tests/strtotime3.phpt deleted file mode 100644 index 6aa5640f64f73..0000000000000 --- a/ext/date/tests/strtotime3.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -strtotime() function (32 bit) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(false) -bool(false) -string(31) "Thu, 15 Jun 2006 00:00:00 +0100" -string(31) "Fri, 16 Jun 2006 22:49:12 +0100" -bool(false) -string(31) "Fri, 16 Jun 2006 23:49:12 +0100" -bool(false) -string(31) "Fri, 16 Jun 2006 02:22:00 +0100" -bool(false) -string(31) "Fri, 16 Jun 2006 02:22:33 +0100" -bool(false) -string(31) "Tue, 02 Mar 2004 00:00:00 +0000" -string(31) "Tue, 02 Mar 2004 00:00:00 +0000" -string(31) "Sun, 12 Feb 2006 23:12:23 +0000" -bool(false) -string(31) "Fri, 16 Jun 2006 00:00:00 +0100" -string(31) "Sun, 15 Jan 2006 00:00:00 +0000" -string(31) "Sun, 15 Jan 2006 00:00:00 +0000" -string(31) "Tue, 10 Oct 2000 13:55:36 +0100" -bool(false) -string(31) "Fri, 16 Jun 2006 20:06:00 +0100" -string(31) "Mon, 16 Jun 1986 22:51:59 +0100" -string(31) "Mon, 16 Jan 2006 00:00:00 +0000" -string(31) "Mon, 16 Jan 2006 00:00:00 +0000" diff --git a/ext/date/tests/strtotime_basic.phpt b/ext/date/tests/strtotime_basic.phpt deleted file mode 100644 index 7fa84deee5b9a..0000000000000 --- a/ext/date/tests/strtotime_basic.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -strtotime() function - a test to show the difference in behaviour between 'first' and '1', "second" and "2"... ---XFAIL-- -Expected to fail - fix to bug 43452 needs to be back ported to PHP52 ---INI-- -date.timezone="UTC" ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(10) "2008-12-01" -string(10) "2008-12-08" -string(10) "2008-12-15" -string(10) "2008-12-08" -string(10) "2008-12-15" -string(10) "2008-12-22" diff --git a/ext/date/tests/timestamp-in-dst.phpt b/ext/date/tests/timestamp-in-dst.phpt deleted file mode 100644 index 5b66351e1f5cf..0000000000000 --- a/ext/date/tests/timestamp-in-dst.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Format timestamp in DST test ---INI-- -date.timezone=CEST ---FILE-- -format( 'c' ) ); -?> ---EXPECT-- -string(25) "2008-02-14T13:34:51+00:00" diff --git a/ext/date/tests/timezone-configuration.phpt b/ext/date/tests/timezone-configuration.phpt deleted file mode 100644 index 147b10a8236c8..0000000000000 --- a/ext/date/tests/timezone-configuration.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -timezone configuration [1] ---INI-- -date.timezone=GMT ---FILE-- - ---EXPECT-- -1119125744 -1119129344 -1119125744 diff --git a/ext/date/tests/timezones.phpt b/ext/date/tests/timezones.phpt deleted file mode 100644 index c7e470ab8ca47..0000000000000 --- a/ext/date/tests/timezones.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -setting bogus timezones ---FILE-- - ---EXPECTF-- -Notice: date_default_timezone_set(): Timezone ID 'AAA' is invalid in %stimezones.php on line 4 -bool(false) - -Notice: date_default_timezone_set(): Timezone ID 'ZZZ' is invalid in %stimezones.php on line 5 -bool(false) -bool(true) -bool(true) -done diff --git a/ext/dba/CREDITS b/ext/dba/CREDITS deleted file mode 100644 index 370b3ea27108a..0000000000000 --- a/ext/dba/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -DBA -Sascha Schumann, Marcus Boerger \ No newline at end of file diff --git a/ext/dba/README b/ext/dba/README deleted file mode 100755 index 0c22830e5427c..0000000000000 --- a/ext/dba/README +++ /dev/null @@ -1,54 +0,0 @@ -These functions build the foundation for accessing Berkeley DB style -databases. - -This is a general abstraction layer for several file-based databases. As -such, functionality is limited to a common subset of features supported -by modern databases such as Sleepycat Software's DB2. (This is not to be -confused with IBM's DB2 software, which is supported through the ODBC -functions.) - -This extensions allows to work with the following databases: -dbm DBM is the oldest (original) type of Berkeley DB style databases. - You should avoid it, if possible. We do not support the - compatibility functions built into DB2 and gdbm, because they are - only compatible on the source code level, but cannot handle the - original dbm format. -ndbm NDBM is a newer type and more flexible than dbm. It still has - most of the arbitrary limits of dbm (therefore it is deprecated). -gdbm GDBM is the GNU database manager. -db2 DB2 is Sleepycat Software's DB2. It's described as "a programmatic - toolkit that provides high-performance built-in database support - for both standalone and client/server applications. -db3 DB3 is Sleepycat Software's DB3. -db4 DB4 is Sleepycat Software's DB4. This is available since PHP 5.0. -cdb CDB is "a fast, reliable, lightweight package for creating and - reading constant databases." It is from the author of qmail and - can be found at http://cr.yp.to/cdb.html. Since it is constant, - we support only reading operations. And since PHP 4.3.0 we support - writing (not updating) through the internal cdb library. -cdb_make Since PHP 4.3.0 we support creation (not updating) of cdb files - when the bundled cdb library is used. -flatfile This is available since PHP 4.3.0 for compatibility with the - deprecated dbm extension only and should be avoided. However you - may use this where files were created in this format. That happens - when configure could not find any external library. -inifile This is available since PHP 4.3.3 to be able to modify php.ini - files from within PHP scripts. When working with ini files you - can pass arrays of the form array(0=>group,1=>value_name) or - strings of the form "[group]value_name" where group is optional. - As the functions dba_firstkey() and dba_nextkey() return string - representations of the key there is a new function dba_key_split() - available since PHP 5 which allows to convert the string keys into - array keys without loosing FALSE. -qdbm This is available since PHP 5.0.0. The qdbm library can be loaded - from http://qdbm.sourceforge.net. - - -After configuring and compiling PHP you must execute the following test -from commandline: - php run-tests.php ext/dba. -This shows whether your combination of handlers works. Most problematic -are dbm and ndbm which conflict with many installations. The reason for -this is that on several systems these libraries are part of more than one -other library. The configuration test only prevents you from configuring -malfaunctioning single handlers but not combinations. \ No newline at end of file diff --git a/ext/dba/config.m4 b/ext/dba/config.m4 deleted file mode 100644 index 66976481b0b59..0000000000000 --- a/ext/dba/config.m4 +++ /dev/null @@ -1,579 +0,0 @@ -dnl -dnl $Id$ -dnl - -dnl Suppose we need FlatFile if no support or only CDB is used. - -AC_DEFUN([PHP_DBA_STD_BEGIN],[ - unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT -]) - -AC_DEFUN([PHP_TEMP_LDFLAGS],[ - old_LDFLAGS=$LDFLAGS - LDFLAGS="$1 $LDFLAGS" - old_LIBS=$LIBS - LIBS="$2 $LIBS" - $3 - LDFLAGS=$old_LDFLAGS - LIBS=$old_LIBS -]) - -dnl Assign INCLUDE/LFLAGS from PREFIX -AC_DEFUN([PHP_DBA_STD_ASSIGN],[ - if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then - THIS_LFLAGS=$THIS_PREFIX/$PHP_LIBDIR - fi -]) - -dnl Standard check -AC_DEFUN([PHP_DBA_STD_CHECK],[ - THIS_RESULT=yes - if test -z "$THIS_INCLUDE"; then - AC_MSG_ERROR([DBA: Could not find necessary header file(s).]) - fi - if test -z "$THIS_LIBS"; then - AC_MSG_ERROR([DBA: Could not find necessary library.]) - fi -]) - -dnl Attach THIS_x to DBA_x -AC_DEFUN([PHP_DBA_STD_ATTACH],[ - PHP_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD) - unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX -]) - -dnl Print the result message -dnl parameters(name [, full name [, empty or error message]]) -AC_DEFUN([PHP_DBA_STD_RESULT],[ - THIS_NAME=[]translit($1,a-z0-9-,A-Z0-9_) - if test -n "$2"; then - THIS_FULL_NAME="$2" - else - THIS_FULL_NAME="$THIS_NAME" - fi - AC_MSG_CHECKING([for $THIS_FULL_NAME support]) - if test -n "$3"; then - AC_MSG_ERROR($3) - fi - if test "$THIS_RESULT" = "yes" || test "$THIS_RESULT" = "builtin"; then - HAVE_DBA=1 - eval HAVE_$THIS_NAME=1 - AC_MSG_RESULT([$THIS_RESULT]) - else - AC_MSG_RESULT(no) - fi - unset THIS_RESULT THIS_NAME THIS_FULL_NAME -]) - -dnl -dnl Options -dnl - -PHP_ARG_ENABLE(dba,, -[ --enable-dba Build DBA with bundled modules. To build shared DBA - extension use --enable-dba=shared]) - -PHP_ARG_WITH(qdbm,, -[ --with-qdbm[=DIR] DBA: QDBM support], no, no) - -PHP_ARG_WITH(gdbm,, -[ --with-gdbm[=DIR] DBA: GDBM support], no, no) - -PHP_ARG_WITH(ndbm,, -[ --with-ndbm[=DIR] DBA: NDBM support], no, no) - -PHP_ARG_WITH(db4,, -[ --with-db4[=DIR] DBA: Berkeley DB4 support], no, no) - -PHP_ARG_WITH(db3,, -[ --with-db3[=DIR] DBA: Berkeley DB3 support], no, no) - -PHP_ARG_WITH(db2,, -[ --with-db2[=DIR] DBA: Berkeley DB2 support], no, no) - -PHP_ARG_WITH(db1,, -[ --with-db1[=DIR] DBA: Berkeley DB1 support/emulation], no, no) - -PHP_ARG_WITH(dbm,, -[ --with-dbm[=DIR] DBA: DBM support], no, no) - -dnl -dnl Library checks -dnl - -# QDBM -if test "$PHP_QDBM" != "no"; then - PHP_DBA_STD_BEGIN - for i in $PHP_QDBM /usr/local /usr; do - if test -f "$i/include/depot.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/depot.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - for LIB in qdbm; do - PHP_CHECK_LIBRARY($LIB, dpopen, [ - AC_DEFINE_UNQUOTED(QDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_QDBM, 1, [ ]) - THIS_LIBS=$LIB - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - if test -n "$THIS_LIBS"; then - break - fi - done - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH -fi -PHP_DBA_STD_RESULT(qdbm) - -# GDBM -if test "$PHP_GDBM" != "no"; then - PHP_DBA_STD_BEGIN - if test "$HAVE_QDBM" = "1"; then - PHP_DBA_STD_RESULT(gdbm, gdbm, [You cannot combine --with-gdbm with --with-qdbm]) - fi - for i in $PHP_GDBM /usr/local /usr; do - if test -f "$i/include/gdbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/gdbm.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - PHP_CHECK_LIBRARY(gdbm, gdbm_open, [ - AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_GDBM, 1, [ ]) - THIS_LIBS=gdbm - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH -fi -PHP_DBA_STD_RESULT(gdbm) - -# NDBM -if test "$PHP_NDBM" != "no"; then - PHP_DBA_STD_BEGIN - for i in $PHP_NDBM /usr/local /usr; do - if test -f "$i/include/ndbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/ndbm.h - break - elif test -f "$i/include/db1/ndbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db1/ndbm.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - for LIB in ndbm db1 c; do - PHP_CHECK_LIBRARY($LIB, dbm_open, [ - AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_NDBM, 1, [ ]) - THIS_LIBS=$LIB - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - if test -n "$THIS_LIBS"; then - break - fi - done - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH -fi -PHP_DBA_STD_RESULT(ndbm) - -dnl Berkeley specific (library and version test) -dnl parameters(version, library list, function) -AC_DEFUN([PHP_DBA_DB_CHECK],[ - if test -z "$THIS_INCLUDE"; then - AC_MSG_ERROR([DBA: Could not find necessary header file(s).]) - fi - for LIB in $2; do - if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then - lib_found=""; - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$LIB,[ - AC_TRY_LINK([ -#include "$THIS_INCLUDE" - ],[ - $3; - ],[ - AC_EGREP_CPP(yes,[ -#include "$THIS_INCLUDE" -#if DB_VERSION_MAJOR == $1 - yes -#endif - ],[ - THIS_LIBS=$LIB - lib_found=1 - ]) - ]) - ]) - if test -n "$lib_found"; then - lib_found=""; - break; - fi - fi - done - if test -z "$THIS_LIBS"; then - AC_MSG_CHECKING([for db$1 major version]) - AC_MSG_ERROR([Header contains different version]) - fi - if test "$1" = "4"; then - AC_MSG_CHECKING([for db4 minor version and patch level]) - AC_EGREP_CPP(yes,[ -#include "$THIS_INCLUDE" -#if DB_VERSION_MINOR != 1 || DB_VERSION_PATCH >= 25 - yes -#endif - ],[ - AC_MSG_RESULT(ok) - ],[ - AC_MSG_ERROR([Version 4.1 requires patch level 25]) - ]) - fi - if test "$ext_shared" = "yes"; then - AC_MSG_CHECKING([if dba can be used as shared extension]) - AC_EGREP_CPP(yes,[ -#include "$THIS_INCLUDE" -#if DB_VERSION_MAJOR > 3 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR > 2) - yes -#endif - ],[ - AC_MSG_RESULT(yes) - ],[ - AC_MSG_ERROR([At least version 3.3 is required]) - ]) - fi - if test -n "$THIS_LIBS"; then - AC_DEFINE(DBA_DB$1, 1, [ ]) - if test -n "$THIS_INCLUDE"; then - AC_DEFINE_UNQUOTED(DB$1_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - fi - else - AC_MSG_ERROR([DBA: Could not find necessary library.]) - fi - THIS_RESULT=yes - DB$1_LIBS=$THIS_LIBS - DB$1_PREFIX=$THIS_PREFIX - DB$1_INCLUDE=$THIS_INCLUDE - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_ATTACH -]) - -# DB4 -if test "$PHP_DB4" != "no"; then - PHP_DBA_STD_BEGIN - dbdp="/usr/local/BerkeleyDB.4." - for i in $PHP_DB4 ${dbdp}6 ${dbdp}5 ${dbdp}4 ${dbdp}3 ${dbdp}2 ${dbdp}1 ${dbdp}0 /usr/local /usr; do - if test -f "$i/db4/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/db4/db.h - break - elif test -f "$i/include/db4.6/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db4.6/db.h - break - elif test -f "$i/include/db4.5/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db4.5/db.h - break - elif test -f "$i/include/db4/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db4/db.h - break - elif test -f "$i/include/db/db4.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db/db4.h - break - elif test -f "$i/include/db4.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db4.h - break - elif test -f "$i/include/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db.h - break - fi - done - PHP_DBA_DB_CHECK(4, db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)]) -fi -PHP_DBA_STD_RESULT(db4,Berkeley DB4) - -# DB3 -if test "$PHP_DB3" != "no"; then - PHP_DBA_STD_BEGIN - if test "$HAVE_DB4" = "1"; then - PHP_DBA_STD_RESULT(db3, Berkeley DB3, [You cannot combine --with-db3 with --with-db4]) - fi - for i in $PHP_DB3 /usr/local/BerkeleyDB.3.3 /usr/local/BerkeleyDB.3.2 /usr/local/BerkeleyDB.3.1 /usr/local/BerkeleyDB.3.0 /usr/local /usr; do - if test -f "$i/db3/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db3/db.h - break - elif test -f "$i/include/db3/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db3/db.h - break - elif test -f "$i/include/db/db3.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db/db3.h - break - elif test -f "$i/include/db3.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db3.h - break - elif test -f "$i/include/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db.h - break - fi - done - PHP_DBA_DB_CHECK(3, db-3.3 db-3.2 db-3.1 db-3.0 db-3 db3 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)]) -fi -PHP_DBA_STD_RESULT(db3,Berkeley DB3) - -# DB2 -if test "$PHP_DB2" != "no"; then - PHP_DBA_STD_BEGIN - if test "$HAVE_DB3" = "1" || test "$HAVE_DB4" = "1"; then - PHP_DBA_STD_RESULT(db2, Berkeley DB2, [You cannot combine --with-db2 with --with-db3 or --with-db4]) - fi - for i in $PHP_DB2 $PHP_DB2/BerkeleyDB /usr/BerkeleyDB /usr/local /usr; do - if test -f "$i/db2/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/db2/db.h - break - elif test -f "$i/include/db2/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db2/db.h - break - elif test -f "$i/include/db/db2.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db/db2.h - break - elif test -f "$i/include/db2.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db2.h - break - elif test -f "$i/include/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db.h - break - fi - done - PHP_DBA_DB_CHECK(2, db-2 db2 db, [(void)db_appinit("", NULL, (DB_ENV*)0, 0)]) -fi -PHP_DBA_STD_RESULT(db2, Berkeley DB2) - -# DB1 -if test "$PHP_DB1" != "no"; then - PHP_DBA_STD_BEGIN - AC_MSG_CHECKING([for DB1 in library]) - if test "$HAVE_DB4" = "1"; then - THIS_VERSION=4 - THIS_LIBS=$DB4_LIBS - THIS_PREFIX=$DB4_PREFIX - elif test "$HAVE_DB3" = "1"; then - THIS_LIBS=$DB3_LIBS - THIS_PREFIX=$DB3_PREFIX - elif test "$HAVE_DB2" = "1"; then - THIS_VERSION=2 - THIS_LIBS=$DB2_LIBS - THIS_PREFIX=$DB2_PREFIX - fi - if test "$HAVE_DB4" = "1" || test "$HAVE_DB3" = "1" || test "$HAVE_DB2" = "1"; then - AC_DEFINE_UNQUOTED(DB1_VERSION, "Berkeley DB 1.85 emulation in DB$THIS_VERSION", [ ]) - for i in db$THIS_VERSION/db_185.h include/db$THIS_VERSION/db_185.h include/db/db_185.h; do - if test -f "$THIS_PREFIX/$i"; then - THIS_INCLUDE=$THIS_PREFIX/$i - break - fi - done - else - AC_DEFINE_UNQUOTED(DB1_VERSION, "Unknown DB1", [ ]) - for i in $PHP_DB1 /usr/local /usr; do - if test -f "$i/db1/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/db1/db.h - break - elif test -f "$i/include/db1/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db1/db.h - break - elif test -f "$i/include/db.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/db.h - break - fi - done - THIS_LIBS=db - fi - AC_MSG_RESULT([$THIS_LIBS]) - AC_MSG_CHECKING([for DB1 in header]) - AC_MSG_RESULT([$THIS_INCLUDE]) - if test -n "$THIS_INCLUDE"; then - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$THIS_LIBS,[ - AC_TRY_LINK([ -#include "$THIS_INCLUDE" - ],[ - DB * dbp = dbopen("", 0, 0, DB_HASH, 0); - ],[ - AC_DEFINE_UNQUOTED(DB1_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_DB1, 1, [ ]) - THIS_RESULT=yes - ],[ - THIS_RESULT=no - ]) - ]) - fi - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH -fi -PHP_DBA_STD_RESULT(db1, DB1) - -# DBM -if test "$PHP_DBM" != "no"; then - PHP_DBA_STD_BEGIN - if test "$HAVE_QDBM" = "1"; then - PHP_DBA_STD_RESULT(dbm, dbm, [You cannot combine --with-dbm with --with-qdbm]) - fi - for i in $PHP_DBM /usr/local /usr; do - if test -f "$i/include/dbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/dbm.h - break - elif test -f "$i/include/gdbm/dbm.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/gdbm/dbm.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - for LIB in dbm c gdbm; do - PHP_CHECK_LIBRARY($LIB, dbminit, [ - AC_MSG_CHECKING(for DBM using GDBM) - AC_DEFINE_UNQUOTED(DBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - if test "$LIB" = "gdbm"; then - AC_DEFINE_UNQUOTED(DBM_VERSION, "GDBM", [ ]) - AC_MSG_RESULT(yes) - else - AC_DEFINE_UNQUOTED(DBM_VERSION, "DBM", [ ]) - AC_MSG_RESULT(no) - fi - AC_DEFINE(DBA_DBM, 1, [ ]) - THIS_LIBS=$LIB - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - if test -n "$THIS_LIBS"; then - break - fi - done - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH -fi -PHP_DBA_STD_RESULT(dbm) - -dnl -dnl Bundled modules that should be enabled by default if any other option is enabled -dnl -if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1" || test "$with_cdb" = "yes" || test "$enable_inifile" = "yes" || test "$enable_flatfile" = "yes"; then - php_dba_enable=yes -else - php_dba_enable=no -fi - -PHP_ARG_WITH(cdb,, -[ --without-cdb[=DIR] DBA: CDB support (bundled)], $php_dba_enable, no) - -PHP_ARG_ENABLE(inifile,, -[ --disable-inifile DBA: INI support (bundled)], $php_dba_enable, no) - -PHP_ARG_ENABLE(flatfile,, -[ --disable-flatfile DBA: FlatFile support (bundled)], $php_dba_enable, no) - -# CDB -if test "$PHP_CDB" = "yes"; then - AC_DEFINE(DBA_CDB_BUILTIN, 1, [ ]) - AC_DEFINE(DBA_CDB_MAKE, 1, [ ]) - AC_DEFINE(DBA_CDB, 1, [ ]) - cdb_sources="libcdb/cdb.c libcdb/cdb_make.c libcdb/uint32.c" - THIS_RESULT="builtin" -elif test "$PHP_CDB" != "no"; then - PHP_DBA_STD_BEGIN - for i in $PHP_CDB /usr/local /usr; do - if test -f "$i/include/cdb.h"; then - THIS_PREFIX=$i - THIS_INCLUDE=$i/include/cdb.h - break - fi - done - - if test -n "$THIS_INCLUDE"; then - for LIB in cdb c; do - PHP_CHECK_LIBRARY($LIB, cdb_read, [ - AC_DEFINE_UNQUOTED(CDB_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) - AC_DEFINE(DBA_CDB, 1, [ ]) - THIS_LIBS=$LIB - ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) - if test -n "$THIS_LIBS"; then - break - fi - done - fi - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH -fi -PHP_DBA_STD_RESULT(cdb) - -# INIFILE -if test "$PHP_INIFILE" != "no"; then - AC_DEFINE(DBA_INIFILE, 1, [ ]) - ini_sources="libinifile/inifile.c" - THIS_RESULT="builtin" -fi -PHP_DBA_STD_RESULT(inifile, [INI File]) - -# FLATFILE -if test "$PHP_FLATFILE" != "no"; then - AC_DEFINE(DBA_FLATFILE, 1, [ ]) - flat_sources="libflatfile/flatfile.c" - THIS_RESULT="builtin" -fi -PHP_DBA_STD_RESULT(FlatFile, FlatFile) - -dnl -dnl Extension setup -dnl -AC_MSG_CHECKING([whether to enable DBA interface]) -if test "$HAVE_DBA" = "1"; then - if test "$ext_shared" = "yes"; then - AC_MSG_RESULT([yes, shared]) - else - AC_MSG_RESULT([yes]) - fi - AC_DEFINE(HAVE_DBA, 1, [ ]) - PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources, $ext_shared) - PHP_ADD_BUILD_DIR($ext_builddir/libinifile) - PHP_ADD_BUILD_DIR($ext_builddir/libcdb) - PHP_ADD_BUILD_DIR($ext_builddir/libflatfile) - PHP_SUBST(DBA_SHARED_LIBADD) -else - AC_MSG_RESULT(no) -fi diff --git a/ext/dba/config.w32 b/ext/dba/config.w32 deleted file mode 100644 index 4f3514e62f25c..0000000000000 --- a/ext/dba/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("dba", "DBA support", "no"); - -if (PHP_DBA != "no") { - if (CHECK_LIB("libdb31s.lib", "dba", PHP_DBA) && - CHECK_HEADER_ADD_INCLUDE("db.h", "CFLAGS_DBA")) { - EXTENSION("dba", "dba.c dba_cdb.c dba_db1.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c dba_inifile.c"); - ADD_SOURCES("ext/dba/libcdb", "cdb.c cdb_make.c uint32.c", "dba"); - ADD_SOURCES("ext/dba/libflatfile", "flatfile.c", "dba"); - ADD_SOURCES("ext/dba/libinifile", "inifile.c", "dba"); - AC_DEFINE('HAVE_DBA', 1, 'DBA support'); - ADD_FLAG("CFLAGS_DBA", "/D DBA_DB1=0 /D DB1_VERSION=\"\\\"Berkeley DB 1.85 emulation in DB3\\\"\" /D DB1_INCLUDE_FILE=\"\\\"db_185.h\\\"\" /D DBA_DB3=1 /D DB3_INCLUDE_FILE=\"\\\"db.h\\\"\" /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1"); - } else { - WARNING("dba not enabled; libraries and headers not found"); - } -} diff --git a/ext/dba/dba.c b/ext/dba/dba.c deleted file mode 100644 index 025ed34bd26e0..0000000000000 --- a/ext/dba/dba.c +++ /dev/null @@ -1,1232 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Sascha Schumann | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_DBA - -#include "php_ini.h" -#include -#include -#ifdef HAVE_SYS_FILE_H -#include -#endif - -#include "php_dba.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" -#include "ext/standard/flock_compat.h" - -#include "php_gdbm.h" -#include "php_ndbm.h" -#include "php_dbm.h" -#include "php_cdb.h" -#include "php_db1.h" -#include "php_db2.h" -#include "php_db3.h" -#include "php_db4.h" -#include "php_flatfile.h" -#include "php_inifile.h" -#include "php_qdbm.h" - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2) - ZEND_ARG_INFO(0, path) - ZEND_ARG_INFO(0, mode) - ZEND_ARG_INFO(0, handlername) - ZEND_ARG_INFO(0, ...) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_open, 0, 0, 2) - ZEND_ARG_INFO(0, path) - ZEND_ARG_INFO(0, mode) - ZEND_ARG_INFO(0, handlername) - ZEND_ARG_INFO(0, ...) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_close, 0) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_exists, 0) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_fetch, 0, 0, 2) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, skip) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_key_split, 0) - ZEND_ARG_INFO(0, key) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_firstkey, 0) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_nextkey, 0) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_delete, 0) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_insert, 0) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, value) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_replace, 0) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, value) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_optimize, 0) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_sync, 0) - ZEND_ARG_INFO(0, handle) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_handlers, 0, 0, 0) - ZEND_ARG_INFO(0, full_info) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dba_list, 0) -ZEND_END_ARG_INFO() - -/* }}} */ - -/* {{{ dba_functions[] - */ -zend_function_entry dba_functions[] = { - PHP_FE(dba_open, arginfo_dba_open) - PHP_FE(dba_popen, arginfo_dba_popen) - PHP_FE(dba_close, arginfo_dba_close) - PHP_FE(dba_delete, arginfo_dba_delete) - PHP_FE(dba_exists, arginfo_dba_exists) - PHP_FE(dba_fetch, arginfo_dba_fetch) - PHP_FE(dba_insert, arginfo_dba_insert) - PHP_FE(dba_replace, arginfo_dba_replace) - PHP_FE(dba_firstkey, arginfo_dba_firstkey) - PHP_FE(dba_nextkey, arginfo_dba_nextkey) - PHP_FE(dba_optimize, arginfo_dba_optimize) - PHP_FE(dba_sync, arginfo_dba_sync) - PHP_FE(dba_handlers, arginfo_dba_handlers) - PHP_FE(dba_list, arginfo_dba_list) - PHP_FE(dba_key_split, arginfo_dba_key_split) - {NULL, NULL, NULL} -}; -/* }}} */ - -PHP_MINIT_FUNCTION(dba); -PHP_MSHUTDOWN_FUNCTION(dba); -PHP_MINFO_FUNCTION(dba); - -ZEND_BEGIN_MODULE_GLOBALS(dba) - char *default_handler; - dba_handler *default_hptr; -ZEND_END_MODULE_GLOBALS(dba) - -ZEND_DECLARE_MODULE_GLOBALS(dba) - -#ifdef ZTS -#define DBA_G(v) TSRMG(dba_globals_id, zend_dba_globals *, v) -#else -#define DBA_G(v) (dba_globals.v) -#endif - -static PHP_GINIT_FUNCTION(dba); - -zend_module_entry dba_module_entry = { - STANDARD_MODULE_HEADER, - "dba", - dba_functions, - PHP_MINIT(dba), - PHP_MSHUTDOWN(dba), - NULL, - NULL, - PHP_MINFO(dba), - NO_VERSION_YET, - PHP_MODULE_GLOBALS(dba), - PHP_GINIT(dba), - NULL, - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; - -#ifdef COMPILE_DL_DBA -ZEND_GET_MODULE(dba) -#endif - -/* {{{ macromania */ - -#define DBA_ID_PARS \ - zval **id; \ - dba_info *info = NULL; \ - int ac = ZEND_NUM_ARGS() - -/* these are used to get the standard arguments */ - -#define DBA_GET1 \ - if(ac != 1 || zend_get_parameters_ex(ac, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } - -/* {{{ php_dba_myke_key */ -static size_t php_dba_make_key(zval **key, char **key_str, char **key_free TSRMLS_DC) -{ - if (Z_TYPE_PP(key) == IS_ARRAY) { - zval **group, **name; - HashPosition pos; - size_t len; - - if (zend_hash_num_elements(Z_ARRVAL_PP(key)) != 2) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)"); - return -1; - } - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(key), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_PP(key), (void **) &group, &pos); - zend_hash_move_forward_ex(Z_ARRVAL_PP(key), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_PP(key), (void **) &name, &pos); - convert_to_string_ex(group); - convert_to_string_ex(name); - if (Z_STRLEN_PP(group) == 0) { - *key_str = Z_STRVAL_PP(name); - *key_free = NULL; - return Z_STRLEN_PP(name); - } - len = spprintf(key_str, 0, "[%s]%s", Z_STRVAL_PP(group), Z_STRVAL_PP(name)); - *key_free = *key_str; - return len; - } else { - convert_to_string_ex(key); - *key_str = Z_STRVAL_PP(key); - *key_free = NULL; - return Z_STRLEN_PP(key); - } -} -/* }}} */ - -#define DBA_GET2 \ - zval **key; \ - char *key_str, *key_free; \ - size_t key_len; \ - if(ac != 2 || zend_get_parameters_ex(ac, &key, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } \ - if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\ - RETURN_FALSE; \ - } - -#define DBA_GET2_3 \ - zval **key; \ - char *key_str, *key_free; \ - size_t key_len; \ - zval **tmp; \ - int skip = 0; \ - switch(ac) { \ - case 2: \ - if (zend_get_parameters_ex(ac, &key, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } \ - break; \ - case 3: \ - if (zend_get_parameters_ex(ac, &key, &tmp, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } \ - convert_to_long_ex(tmp); \ - skip = Z_LVAL_PP(tmp); \ - break; \ - default: \ - WRONG_PARAM_COUNT; \ - } \ - if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\ - RETURN_FALSE; \ - } - -#define DBA_GET3 \ - zval **key, **val; \ - char *key_str, *key_free; \ - size_t key_len; \ - if(ac != 3 || zend_get_parameters_ex(ac, &key, &val, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } \ - convert_to_string_ex(val); \ - if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\ - RETURN_FALSE; \ - } - -#define DBA_ID_GET \ - ZEND_FETCH_RESOURCE2(info, dba_info *, id, -1, "DBA identifier", le_db, le_pdb); - -#define DBA_ID_GET1 DBA_ID_PARS; DBA_GET1; DBA_ID_GET -#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_ID_GET -#define DBA_ID_GET2_3 DBA_ID_PARS; DBA_GET2_3; DBA_ID_GET -#define DBA_ID_GET3 DBA_ID_PARS; DBA_GET3; DBA_ID_GET - -#define DBA_ID_DONE \ - if (key_free) efree(key_free) -/* a DBA handler must have specific routines */ - -#define DBA_NAMED_HND(alias, name, flags) \ -{\ - #alias, flags, dba_open_##name, dba_close_##name, dba_fetch_##name, dba_update_##name, \ - dba_exists_##name, dba_delete_##name, dba_firstkey_##name, dba_nextkey_##name, \ - dba_optimize_##name, dba_sync_##name, dba_info_##name \ -}, - -#define DBA_HND(name, flags) DBA_NAMED_HND(name, name, flags) - -/* check whether the user has write access */ -#define DBA_WRITE_CHECK \ - if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \ - RETURN_FALSE; \ - } - -/* }}} */ - -/* {{{ globals */ - -static dba_handler handler[] = { -#if DBA_GDBM - DBA_HND(gdbm, DBA_LOCK_EXT) /* Locking done in library if set */ -#endif -#if DBA_DBM - DBA_HND(dbm, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_NDBM - DBA_HND(ndbm, DBA_LOCK_ALL) /* Could be done in library: filemode = 0644 + S_ENFMT */ -#endif -#if DBA_CDB - DBA_HND(cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_CDB_BUILTIN - DBA_NAMED_HND(cdb_make, cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_DB1 - DBA_HND(db1, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_DB2 - DBA_HND(db2, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_DB3 - DBA_HND(db3, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_DB4 - DBA_HND(db4, DBA_LOCK_ALL) /* No lock in lib */ -#endif -#if DBA_INIFILE - DBA_HND(inifile, DBA_STREAM_OPEN|DBA_LOCK_ALL|DBA_CAST_AS_FD) /* No lock in lib */ -#endif -#if DBA_FLATFILE - DBA_HND(flatfile, DBA_STREAM_OPEN|DBA_LOCK_ALL|DBA_NO_APPEND) /* No lock in lib */ -#endif -#if DBA_QDBM - DBA_HND(qdbm, DBA_LOCK_EXT) -#endif - { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } -}; - -#if DBA_FLATFILE -#define DBA_DEFAULT "flatfile" -#elif DBA_DB4 -#define DBA_DEFAULT "db4" -#elif DBA_DB3 -#define DBA_DEFAULT "db3" -#elif DBA_DB2 -#define DBA_DEFAULT "db2" -#elif DBA_DB1 -#define DBA_DEFAULT "db1" -#elif DBA_GDBM -#define DBA_DEFAULT "gdbm" -#elif DBA_NBBM -#define DBA_DEFAULT "ndbm" -#elif DBA_DBM -#define DBA_DEFAULT "dbm" -#elif DBA_QDBM -#define DBA_DEFAULT "qdbm" -#else -#define DBA_DEFAULT "" -#endif -/* cdb/cdb_make and ini are no option here */ - -static int le_db; -static int le_pdb; -/* }}} */ - -/* {{{ dba_fetch_resource -PHPAPI void dba_fetch_resource(dba_info **pinfo, zval **id TSRMLS_DC) -{ - dba_info *info; - DBA_ID_FETCH - *pinfo = info; -} -*/ -/* }}} */ - -/* {{{ dba_get_handler -PHPAPI dba_handler *dba_get_handler(const char* handler_name) -{ - dba_handler *hptr; - for (hptr = handler; hptr->name && strcasecmp(hptr->name, handler_name); hptr++); - return hptr; -} -*/ -/* }}} */ - -/* {{{ dba_close - */ -static void dba_close(dba_info *info TSRMLS_DC) -{ - if (info->hnd) { - info->hnd->close(info TSRMLS_CC); - } - if (info->path) { - pefree(info->path, info->flags&DBA_PERSISTENT); - } - if (info->fp && info->fp!=info->lock.fp) { - if(info->flags&DBA_PERSISTENT) { - php_stream_pclose(info->fp); - } else { - php_stream_close(info->fp); - } - } - if (info->lock.fp) { - if(info->flags&DBA_PERSISTENT) { - php_stream_pclose(info->lock.fp); - } else { - php_stream_close(info->lock.fp); - } - } - if (info->lock.name) { - pefree(info->lock.name, info->flags&DBA_PERSISTENT); - } - pefree(info, info->flags&DBA_PERSISTENT); -} -/* }}} */ - -/* {{{ dba_close_rsrc - */ -static void dba_close_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - dba_info *info = (dba_info *)rsrc->ptr; - - dba_close(info TSRMLS_CC); -} -/* }}} */ - -/* {{{ dba_close_pe_rsrc_deleter */ -int dba_close_pe_rsrc_deleter(zend_rsrc_list_entry *le, void *pDba TSRMLS_DC) -{ - return le->ptr == pDba; -} -/* }}} */ - -/* {{{ dba_close_pe_rsrc */ -static void dba_close_pe_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - dba_info *info = (dba_info *)rsrc->ptr; - - /* closes the resource by calling dba_close_rsrc() */ - zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) dba_close_pe_rsrc_deleter, info TSRMLS_CC); -} -/* }}} */ - -/* {{{ PHP_INI - */ -ZEND_INI_MH(OnUpdateDefaultHandler) -{ - dba_handler *hptr; - - if (!strlen(new_value)) { - DBA_G(default_hptr) = NULL; - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - } - - for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value); hptr++); - - if (!hptr->name) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such handler: %s", new_value); - return FAILURE; - } - DBA_G(default_hptr) = hptr; - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("dba.default_handler", DBA_DEFAULT, PHP_INI_ALL, OnUpdateDefaultHandler, default_handler, zend_dba_globals, dba_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ PHP_GINIT_FUNCTION - */ -static PHP_GINIT_FUNCTION(dba) -{ - dba_globals->default_handler = ""; - dba_globals->default_hptr = NULL; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(dba) -{ - REGISTER_INI_ENTRIES(); - le_db = zend_register_list_destructors_ex(dba_close_rsrc, NULL, "dba", module_number); - le_pdb = zend_register_list_destructors_ex(dba_close_pe_rsrc, dba_close_rsrc, "dba persistent", module_number); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(dba) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -#include "ext/standard/php_smart_str.h" - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(dba) -{ - dba_handler *hptr; - smart_str handlers = {0}; - - for(hptr = handler; hptr->name; hptr++) { - smart_str_appends(&handlers, hptr->name); - smart_str_appendc(&handlers, ' '); - } - - php_info_print_table_start(); - php_info_print_table_row(2, "DBA support", "enabled"); - if (handlers.c) { - smart_str_0(&handlers); - php_info_print_table_row(2, "Supported handlers", handlers.c); - smart_str_free(&handlers); - } else { - php_info_print_table_row(2, "Supported handlers", "none"); - } - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ php_dba_update - */ -static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - char *v; - int len; - DBA_ID_GET3; - - DBA_WRITE_CHECK; - - if (PG(magic_quotes_runtime)) { - len = Z_STRLEN_PP(val); - v = estrndup(Z_STRVAL_PP(val), len); - php_stripslashes(v, &len TSRMLS_CC); - if(info->hnd->update(info, key_str, key_len, v, len, mode TSRMLS_CC) == SUCCESS) { - efree(v); - DBA_ID_DONE; - RETURN_TRUE; - } - efree(v); - } else { - if(info->hnd->update(info, key_str, key_len, VALLEN(val), mode TSRMLS_CC) == SUCCESS) - { - DBA_ID_DONE; - RETURN_TRUE; - } - } - DBA_ID_DONE; - RETURN_FALSE; -} -/* }}} */ - -#define FREENOW if(args) efree(args); if(key) efree(key) - -/* {{{ php_find_dbm - */ -dba_info *php_dba_find(const char* path TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - dba_info *info; - int numitems, i; - - numitems = zend_hash_next_free_element(&EG(regular_list)); - for (i=1; iptr); - if (!strcmp(info->path, path)) { - return (dba_info *)(le->ptr); - } - } - } - - return NULL; -} -/* }}} */ - -/* {{{ php_dba_open - */ -static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - zval ***args = (zval ***) NULL; - int ac = ZEND_NUM_ARGS(); - dba_mode_t modenr; - dba_info *info, *other; - dba_handler *hptr; - char *key = NULL, *error = NULL; - int keylen = 0; - int i; - int lock_mode, lock_flag, lock_dbf = 0; - char *file_mode; - char mode[4], *pmode, *lock_file_mode = NULL; - int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0; - char *opened_path, *lock_name; - - if(ac < 2) { - WRONG_PARAM_COUNT; - } - - /* we pass additional args to the respective handler */ - args = safe_emalloc(ac, sizeof(zval *), 0); - if (zend_get_parameters_array_ex(ac, args) != SUCCESS) { - FREENOW; - WRONG_PARAM_COUNT; - } - - /* we only take string arguments */ - for (i = 0; i < ac; i++) { - convert_to_string_ex(args[i]); - keylen += Z_STRLEN_PP(args[i]); - } - - if (persistent) { - zend_rsrc_list_entry *le; - - /* calculate hash */ - key = safe_emalloc(keylen, 1, 1); - key[keylen] = '\0'; - keylen = 0; - - for(i = 0; i < ac; i++) { - memcpy(key+keylen, Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i])); - keylen += Z_STRLEN_PP(args[i]); - } - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), key, keylen+1, (void **) &le) == SUCCESS) { - FREENOW; - - if (Z_TYPE_P(le) != le_pdb) { - RETURN_FALSE; - } - - info = (dba_info *)le->ptr; - - ZEND_REGISTER_RESOURCE(return_value, info, le_pdb); - return; - } - } - - if (ac==2) { - hptr = DBA_G(default_hptr); - if (!hptr) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "No default handler selected"); - FREENOW; - RETURN_FALSE; - } - } else { - for (hptr = handler; hptr->name && strcasecmp(hptr->name, Z_STRVAL_PP(args[2])); hptr++); - } - - if (!hptr->name) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "No such handler: %s", Z_STRVAL_PP(args[2])); - FREENOW; - RETURN_FALSE; - } - - /* Check mode: [rwnc][fl]?t? - * r: Read - * w: Write - * n: Create/Truncate - * c: Create - * - * d: force lock on database file - * l: force lock on lck file - * -: ignore locking - * - * t: test open database, warning if locked - */ - strlcpy(mode, Z_STRVAL_PP(args[1]), sizeof(mode)); - pmode = &mode[0]; - if (pmode[0] && (pmode[1]=='d' || pmode[1]=='l' || pmode[1]=='-')) { /* force lock on db file or lck file or disable locking */ - switch (pmode[1]) { - case 'd': - lock_dbf = 1; - if ((hptr->flags & DBA_LOCK_ALL) == 0) { - lock_flag = (hptr->flags & DBA_LOCK_ALL); - break; - } - /* no break */ - case 'l': - lock_flag = DBA_LOCK_ALL; - if ((hptr->flags & DBA_LOCK_ALL) == 0) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_NOTICE, "Handler %s does locking internally", hptr->name); - } - break; - default: - case '-': - if ((hptr->flags & DBA_LOCK_ALL) == 0) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Locking cannot be disabled for handler %s", hptr->name); - FREENOW; - RETURN_FALSE; - } - lock_flag = 0; - break; - } - } else { - lock_flag = (hptr->flags&DBA_LOCK_ALL); - lock_dbf = 1; - } - switch (*pmode++) { - case 'r': - modenr = DBA_READER; - lock_mode = (lock_flag & DBA_LOCK_READER) ? LOCK_SH : 0; - file_mode = "r"; - break; - case 'w': - modenr = DBA_WRITER; - lock_mode = (lock_flag & DBA_LOCK_WRITER) ? LOCK_EX : 0; - file_mode = "r+b"; - break; - case 'c': - modenr = DBA_CREAT; - lock_mode = (lock_flag & DBA_LOCK_CREAT) ? LOCK_EX : 0; - if (lock_mode) { - if (lock_dbf) { - /* the create/append check will be done on the lock - * when the lib opens the file it is already created - */ - file_mode = "r+b"; /* read & write, seek 0 */ - lock_file_mode = "a+b"; /* append */ - } else { - file_mode = "a+b"; /* append */ - lock_file_mode = "w+b"; /* create/truncate */ - } - } else { - file_mode = "a+b"; - } - /* In case of the 'a+b' append mode, the handler is responsible - * to handle any rewind problems (see flatfile handler). - */ - break; - case 'n': - modenr = DBA_TRUNC; - lock_mode = (lock_flag & DBA_LOCK_TRUNC) ? LOCK_EX : 0; - file_mode = "w+b"; - break; - default: - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Illegal DBA mode"); - FREENOW; - RETURN_FALSE; - } - if (!lock_file_mode) { - lock_file_mode = file_mode; - } - if (*pmode=='d' || *pmode=='l' || *pmode=='-') { - pmode++; /* done already - skip here */ - } - if (*pmode=='t') { - pmode++; - if (!lock_flag) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)"); - FREENOW; - RETURN_FALSE; - } - if (!lock_mode) { - if ((hptr->flags & DBA_LOCK_ALL) == 0) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (test lock)", hptr->name); - FREENOW; - RETURN_FALSE; - } else { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (test lock) obsolete", hptr->name); - FREENOW; - RETURN_FALSE; - } - } else { - lock_mode |= LOCK_NB; /* test =: non blocking */ - } - } - if (*pmode) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Illegal DBA mode"); - FREENOW; - RETURN_FALSE; - } - - info = pemalloc(sizeof(dba_info), persistent); - memset(info, 0, sizeof(dba_info)); - info->path = pestrdup(Z_STRVAL_PP(args[0]), persistent); - info->mode = modenr; - info->argc = ac - 3; - info->argv = args + 3; - info->flags = (hptr->flags & ~DBA_LOCK_ALL) | (lock_flag & DBA_LOCK_ALL) | (persistent ? DBA_PERSISTENT : 0); - info->lock.mode = lock_mode; - - /* if any open call is a locking call: - * check if we already habe a locking call open that should block this call - * the problem is some systems would allow read during write - */ - if (hptr->flags & DBA_LOCK_ALL) { - if ((other = php_dba_find(info->path TSRMLS_CC)) != NULL) { - if ( ( (lock_mode&LOCK_EX) && (other->lock.mode&(LOCK_EX|LOCK_SH)) ) - || ( (other->lock.mode&LOCK_EX) && (lock_mode&(LOCK_EX|LOCK_SH)) ) - ) { - error = "Unable to establish lock (database file already open)"; /* force failure exit */ - } - } - } - - if (!error && lock_mode) { - if (lock_dbf) { - lock_name = Z_STRVAL_PP(args[0]); - } else { - spprintf(&lock_name, 0, "%s.lck", info->path); - if (!strcmp(file_mode, "r")) { - /* when in read only mode try to use existing .lck file first */ - /* do not log errors for .lck file while in read ony mode on .lck file */ - lock_file_mode = "rb"; - info->lock.fp = php_stream_open_wrapper(lock_name, lock_file_mode, STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, &opened_path); - } - if (!info->lock.fp) { - /* when not in read mode or failed to open .lck file read only. now try again in create(write) mode and log errors */ - lock_file_mode = "a+b"; - } else { - if (!persistent) { - info->lock.name = opened_path; - } else { - info->lock.name = pestrdup(opened_path, persistent); - efree(opened_path); - } - } - } - if (!info->lock.fp) { - info->lock.fp = php_stream_open_wrapper(lock_name, lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, &opened_path); - if (info->lock.fp) { - if (lock_dbf) { - /* replace the path info with the real path of the opened file */ - pefree(info->path, persistent); - info->path = pestrdup(opened_path, persistent); - } - /* now store the name of the lock */ - if (!persistent) { - info->lock.name = opened_path; - } else { - info->lock.name = pestrdup(opened_path, persistent); - efree(opened_path); - } - } - } - if (!lock_dbf) { - efree(lock_name); - } - if (!info->lock.fp) { - dba_close(info TSRMLS_CC); - /* stream operation already wrote an error message */ - FREENOW; - RETURN_FALSE; - } - if (!php_stream_supports_lock(info->lock.fp)) { - error = "Stream does not support locking"; - } - if (php_stream_lock(info->lock.fp, lock_mode)) { - error = "Unable to establish lock"; /* force failure exit */ - } - } - - /* centralised open stream for builtin */ - if (!error && (hptr->flags&DBA_STREAM_OPEN)==DBA_STREAM_OPEN) { - if (info->lock.fp && lock_dbf) { - info->fp = info->lock.fp; /* use the same stream for locking and database access */ - } else { - info->fp = php_stream_open_wrapper(info->path, file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, NULL); - } - if (!info->fp) { - dba_close(info TSRMLS_CC); - /* stream operation already wrote an error message */ - FREENOW; - RETURN_FALSE; - } - if (hptr->flags & (DBA_NO_APPEND|DBA_CAST_AS_FD)) { - /* Needed becasue some systems do not allow to write to the original - * file contents with O_APPEND being set. - */ - if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&info->fd, 1)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast stream"); - dba_close(info TSRMLS_CC); - FREENOW; - RETURN_FALSE; -#ifdef F_SETFL - } else if (modenr == DBA_CREAT) { - int flags = fcntl(info->fd, F_SETFL); - fcntl(info->fd, F_SETFL, flags & ~O_APPEND); -#endif - } - - } - } - - if (error || hptr->open(info, &error TSRMLS_CC) != SUCCESS) { - dba_close(info TSRMLS_CC); - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:""); - FREENOW; - RETURN_FALSE; - } - - info->hnd = hptr; - info->argc = 0; - info->argv = NULL; - - if (persistent) { - zend_rsrc_list_entry new_le; - - Z_TYPE(new_le) = le_pdb; - new_le.ptr = info; - if (zend_hash_update(&EG(persistent_list), key, keylen+1, &new_le, sizeof(zend_rsrc_list_entry), NULL) == FAILURE) { - dba_close(info TSRMLS_CC); - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Could not register persistent resource"); - FREENOW; - RETURN_FALSE; - } - } - - ZEND_REGISTER_RESOURCE(return_value, info, (persistent ? le_pdb : le_db)); - FREENOW; -} -/* }}} */ -#undef FREENOW - -/* {{{ proto resource dba_popen(string path, string mode [, string handlername, string ...]) - Opens path using the specified handler in mode persistently */ -PHP_FUNCTION(dba_popen) -{ - php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto resource dba_open(string path, string mode [, string handlername, string ...]) - Opens path using the specified handler in mode*/ -PHP_FUNCTION(dba_open) -{ - php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto void dba_close(resource handle) - Closes database */ -PHP_FUNCTION(dba_close) -{ - DBA_ID_GET1; - - zend_list_delete(Z_RESVAL_PP(id)); -} -/* }}} */ - -/* {{{ proto bool dba_exists(string key, resource handle) - Checks, if the specified key exists */ -PHP_FUNCTION(dba_exists) -{ - DBA_ID_GET2; - - if(info->hnd->exists(info, key_str, key_len TSRMLS_CC) == SUCCESS) { - DBA_ID_DONE; - RETURN_TRUE; - } - DBA_ID_DONE; - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string dba_fetch(string key, [int skip ,] resource handle) - Fetches the data associated with key */ -PHP_FUNCTION(dba_fetch) -{ - char *val; - int len = 0; - DBA_ID_GET2_3; - - if (ac==3) { - if (!strcmp(info->hnd->name, "cdb")) { - if (skip < 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip values greater than or equal to zero, using skip=0", info->hnd->name); - skip = 0; - } - } else if (!strcmp(info->hnd->name, "inifile")) { - /* "-1" is compareable to 0 but allows a non restrictive - * access which is fater. For example 'inifile' uses this - * to allow faster access when the key was already found - * using firstkey/nextkey. However explicitly setting the - * value to 0 ensures the first value. - */ - if (skip < -1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip value -1 and greater, using skip=0", info->hnd->name); - skip = 0; - } - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s does not support optional skip parameter, the value will be ignored", info->hnd->name); - skip = 0; - } - } else { - skip = 0; - } - if((val = info->hnd->fetch(info, key_str, key_len, skip, &len TSRMLS_CC)) != NULL) { - if (val && PG(magic_quotes_runtime)) { - val = php_addslashes(val, len, &len, 1 TSRMLS_CC); - } - DBA_ID_DONE; - RETURN_STRINGL(val, len, 0); - } - DBA_ID_DONE; - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto array|false dba_key_split(string key) - Splits an inifile key into an array of the form array(0=>group,1=>value_name) but returns false if input is false or null */ -PHP_FUNCTION(dba_key_split) -{ - zval *zkey; - char *key, *name; - int key_len; - - if (ZEND_NUM_ARGS() != 1) { - WRONG_PARAM_COUNT; - } - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &zkey) == SUCCESS) { - if (Z_TYPE_P(zkey) == IS_NULL || (Z_TYPE_P(zkey) == IS_BOOL && !Z_LVAL_P(zkey))) { - RETURN_BOOL(0); - } - } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { - RETURN_BOOL(0); - } - array_init(return_value); - if (key[0] == '[' && (name = strchr(key, ']')) != NULL) { - add_next_index_stringl(return_value, key+1, name - (key + 1), 1); - add_next_index_stringl(return_value, name+1, key_len - (name - key + 1), 1); - } else { - add_next_index_stringl(return_value, "", 0, 1); - add_next_index_stringl(return_value, key, key_len, 1); - } -} -/* }}} */ - -/* {{{ proto string dba_firstkey(resource handle) - Resets the internal key pointer and returns the first key */ -PHP_FUNCTION(dba_firstkey) -{ - char *fkey; - int len; - DBA_ID_GET1; - - fkey = info->hnd->firstkey(info, &len TSRMLS_CC); - if(fkey) - RETURN_STRINGL(fkey, len, 0); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string dba_nextkey(resource handle) - Returns the next key */ -PHP_FUNCTION(dba_nextkey) -{ - char *nkey; - int len; - DBA_ID_GET1; - - nkey = info->hnd->nextkey(info, &len TSRMLS_CC); - if(nkey) - RETURN_STRINGL(nkey, len, 0); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool dba_delete(string key, resource handle) - Deletes the entry associated with key - If inifile: remove all other key lines */ -PHP_FUNCTION(dba_delete) -{ - DBA_ID_GET2; - - DBA_WRITE_CHECK; - - if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS) - { - DBA_ID_DONE; - RETURN_TRUE; - } - DBA_ID_DONE; - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool dba_insert(string key, string value, resource handle) - If not inifile: Insert value as key, return false, if key exists already - If inifile: Add vakue as key (next instance of key) */ -PHP_FUNCTION(dba_insert) -{ - php_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool dba_replace(string key, string value, resource handle) - Inserts value as key, replaces key, if key exists already - If inifile: remove all other key lines */ -PHP_FUNCTION(dba_replace) -{ - php_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool dba_optimize(resource handle) - Optimizes (e.g. clean up, vacuum) database */ -PHP_FUNCTION(dba_optimize) -{ - DBA_ID_GET1; - - DBA_WRITE_CHECK; - if(info->hnd->optimize(info TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool dba_sync(resource handle) - Synchronizes database */ -PHP_FUNCTION(dba_sync) -{ - DBA_ID_GET1; - - if(info->hnd->sync(info TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto array dba_handlers([bool full_info]) - List configured database handlers */ -PHP_FUNCTION(dba_handlers) -{ - dba_handler *hptr; - zend_bool full_info = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &full_info) == FAILURE) { - RETURN_FALSE; - } - - array_init(return_value); - - for(hptr = handler; hptr->name; hptr++) { - if (full_info) { - add_assoc_string(return_value, hptr->name, hptr->info(hptr, NULL TSRMLS_CC), 0); - } else { - add_next_index_string(return_value, hptr->name, 1); - } - } -} -/* }}} */ - -/* {{{ proto array dba_list() - List opened databases */ -PHP_FUNCTION(dba_list) -{ - ulong numitems, i; - zend_rsrc_list_entry *le; - dba_info *info; - - if (ZEND_NUM_ARGS()!=0) { - ZEND_WRONG_PARAM_COUNT(); - RETURN_FALSE; - } - - array_init(return_value); - - numitems = zend_hash_next_free_element(&EG(regular_list)); - for (i=1; iptr); - add_index_string(return_value, i, info->path, 1); - } - } -} -/* }}} */ - -#endif /* HAVE_DBA */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba.dsp b/ext/dba/dba.dsp deleted file mode 100644 index ddfd1485a965d..0000000000000 --- a/ext/dba/dba.dsp +++ /dev/null @@ -1,213 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dba" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dba - Win32 Debug_TS Berkeley DB3 -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dba.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dba.mak" CFG="dba - Win32 Debug_TS Berkeley DB3" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dba - Win32 Release_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dba - Win32 Debug_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dba - Win32 Release_TS Berkeley DB3" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_DB3=1 /D DB3_INCLUDE_FILE="db.h" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D DBA_DB3=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 php5ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "dba - Win32 Debug_TS Berkeley DB3" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D "DBA_DB3" /D DB3_INCLUDE_FILE="db.h" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "DBA_DB3" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" -# ADD LINK32 php5ts_debug.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "dba - Win32 Release_TS Berkeley DB3" -# Name "dba - Win32 Debug_TS Berkeley DB3" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\libcdb\cdb.c -# End Source File -# Begin Source File - -SOURCE=.\libcdb\cdb_make.c -# End Source File -# Begin Source File - -SOURCE=.\dba.c -# End Source File -# Begin Source File - -SOURCE=.\dba_cdb.c -# End Source File -# Begin Source File - -SOURCE=.\dba_db2.c -# End Source File -# Begin Source File - -SOURCE=.\dba_db3.c -# End Source File -# Begin Source File - -SOURCE=.\dba_dbm.c -# End Source File -# Begin Source File - -SOURCE=.\dba_flatfile.c -# End Source File -# Begin Source File - -SOURCE=.\dba_gdbm.c -# End Source File -# Begin Source File - -SOURCE=.\dba_inifile.c -# End Source File -# Begin Source File - -SOURCE=.\dba_ndbm.c -# End Source File -# Begin Source File - -SOURCE=.\libflatfile\flatfile.c -# End Source File -# Begin Source File - -SOURCE=.\libinifile\inifile.c -# End Source File -# Begin Source File - -SOURCE=.\libcdb\uint32.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\libcdb\cdb.h -# End Source File -# Begin Source File - -SOURCE=.\libcdb\cdb_make.h -# End Source File -# Begin Source File - -SOURCE=.\libflatfile\flatfile.h -# End Source File -# Begin Source File - -SOURCE=.\php_cdb.h -# End Source File -# Begin Source File - -SOURCE=.\php_db2.h -# End Source File -# Begin Source File - -SOURCE=.\php_db3.h -# End Source File -# Begin Source File - -SOURCE=.\php_dba.h -# End Source File -# Begin Source File - -SOURCE=.\php_dbm.h -# End Source File -# Begin Source File - -SOURCE=.\php_flatfile.h -# End Source File -# Begin Source File - -SOURCE=.\php_gdbm.h -# End Source File -# Begin Source File - -SOURCE=.\php_inifile.h -# End Source File -# Begin Source File - -SOURCE=.\php_ndbm.h -# End Source File -# Begin Source File - -SOURCE=.\libcdb\uint32.h -# End Source File -# Begin Source File - -SOURCE=.\libinifile\inifile.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c deleted file mode 100644 index 35df2fd309753..0000000000000 --- a/ext/dba/dba_cdb.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Sascha Schumann | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_CDB -#include "php_cdb.h" - -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include - -#if DBA_CDB_BUILTIN -# include "libcdb/cdb.h" -# include "libcdb/cdb_make.h" -# include "libcdb/uint32.h" -#else -# ifdef CDB_INCLUDE_FILE -# include CDB_INCLUDE_FILE -# endif -#endif - -#define CDB_INFO \ - dba_cdb *cdb = (dba_cdb *) info->dbf - -typedef struct { - struct cdb c; -#if DBA_CDB_BUILTIN - struct cdb_make m; - php_stream *file; - int make; -#else - int file; -#endif - uint32 eod; /* size of constant database */ - uint32 pos; /* current position for traversing */ -} dba_cdb; - -DBA_OPEN_FUNC(cdb) -{ -#if DBA_CDB_BUILTIN - php_stream* file = 0; - int make; -#else - int file = 0; -#endif - dba_cdb *cdb; - dba_info *pinfo = (dba_info *) info; - - switch (info->mode) { - case DBA_READER: -#if DBA_CDB_BUILTIN - make = 0; - file = info->fp; -#else - file = VCWD_OPEN(info->path, O_RDONLY); - if (file < 0) { - *error = "Unable to open file"; - return FAILURE; - } -#endif - break; -#if DBA_CDB_BUILTIN - case DBA_TRUNC: - make = 1; - file = info->fp; - break; - case DBA_CREAT: - case DBA_WRITER: - *error = "Update operations are not supported"; - return FAILURE; /* not supported */ -#endif - default: - *error = "Currently not supported"; - return FAILURE; - } - - cdb = pemalloc(sizeof(dba_cdb), info->flags&DBA_PERSISTENT); - memset(cdb, 0, sizeof(dba_cdb)); - -#if DBA_CDB_BUILTIN - if (make) { - cdb_make_start(&cdb->m, file TSRMLS_CC); - } else { - cdb_init(&cdb->c, file TSRMLS_CC); - } - cdb->make = make; -#else - cdb_init(&cdb->c, file); -#endif - cdb->file = file; - - pinfo->dbf = cdb; - return SUCCESS; -} - -DBA_CLOSE_FUNC(cdb) -{ - CDB_INFO; - - /* cdb_free does not close associated file */ -#if DBA_CDB_BUILTIN - if (cdb->make) { - cdb_make_finish(&cdb->m TSRMLS_CC); - } else { - cdb_free(&cdb->c TSRMLS_CC); - } -#else - cdb_free(&cdb->c); - close(cdb->file); -#endif - pefree(cdb, info->flags&DBA_PERSISTENT); -} - -#if DBA_CDB_BUILTIN -# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos TSRMLS_CC) -# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len TSRMLS_CC) -# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len TSRMLS_CC) -#else -# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos) -# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len) -# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len) -#endif - -DBA_FETCH_FUNC(cdb) -{ - CDB_INFO; - unsigned int len; - char *new_entry = NULL; - -#if DBA_CDB_BUILTIN - if (cdb->make) - return NULL; /* database was opened writeonly */ -#endif - if (php_cdb_find(&cdb->c, key, keylen) == 1) { - while(skip--) { - if (php_cdb_findnext(&cdb->c, key, keylen) != 1) { - return NULL; - } - } - len = cdb_datalen(&cdb->c); - new_entry = safe_emalloc(len, 1, 1); - - if (php_cdb_read(&cdb->c, new_entry, len, cdb_datapos(&cdb->c)) == -1) { - efree(new_entry); - return NULL; - } - new_entry[len] = 0; - if (newlen) - *newlen = len; - } - - return new_entry; -} - -DBA_UPDATE_FUNC(cdb) -{ -#if DBA_CDB_BUILTIN - CDB_INFO; - - if (!cdb->make) - return FAILURE; /* database was opened readonly */ - if (!mode) - return FAILURE; /* cdb_make dosn't know replace */ - if (cdb_make_add(&cdb->m, key, keylen, val, vallen TSRMLS_CC) != -1) - return SUCCESS; -#endif - return FAILURE; -} - -DBA_EXISTS_FUNC(cdb) -{ - CDB_INFO; - -#if DBA_CDB_BUILTIN - if (cdb->make) - return FAILURE; /* database was opened writeonly */ -#endif - if (php_cdb_find(&cdb->c, key, keylen) == 1) - return SUCCESS; - return FAILURE; -} - -DBA_DELETE_FUNC(cdb) -{ - return FAILURE; /* cdb doesn't support delete */ -} - -/* {{{ cdb_file_read */ -#if DBA_CDB_BUILTIN -# define cdb_file_read(fildes, buf, size) php_stream_read(fildes, buf, size) -#else -# define cdb_file_read(fildes, buf, size) read(fildes, buf, size) -#endif -/* }}} */ - -#define CREAD(n) do { \ - if (cdb_file_read(cdb->file, buf, n) < n) return NULL; \ -} while (0) - -/* {{{ cdb_file_lseek - php_stream_seek does not return actual position */ -#if DBA_CDB_BUILTIN -int cdb_file_lseek(php_stream *fp, off_t offset, int whence TSRMLS_DC) { - php_stream_seek(fp, offset, whence); - return php_stream_tell(fp); -} -#else -int cdb_file_lseek(int fd, off_t offset, int whence TSRMLS_DC) { - return lseek(fd, offset, whence); -} -#endif -/* }}} */ - -#define CSEEK(n) do { \ - if (n >= cdb->eod) return NULL; \ - if (cdb_file_lseek(cdb->file, (off_t)n, SEEK_SET TSRMLS_CC) != (off_t) n) return NULL; \ -} while (0) - - -DBA_FIRSTKEY_FUNC(cdb) -{ - CDB_INFO; - uint32 klen, dlen; - char buf[8]; - char *key; - -#if DBA_CDB_BUILTIN - if (cdb->make) - return NULL; /* database was opened writeonly */ -#endif - - cdb->eod = -1; - CSEEK(0); - CREAD(4); - - /* Total length of file in bytes */ - uint32_unpack(buf, &cdb->eod); - - CSEEK(2048); - CREAD(8); - - /* The first four bytes contain the length of the key */ - uint32_unpack(buf, &klen); - uint32_unpack(buf + 4, &dlen); - - key = safe_emalloc(klen, 1, 1); - if (cdb_file_read(cdb->file, key, klen) < klen) { - efree(key); - key = NULL; - } else { - key[klen] = '\0'; - if (newlen) *newlen = klen; - } - - /* header + klenlen + dlenlen + klen + dlen */ - cdb->pos = 2048 + 4 + 4 + klen + dlen; - - return key; -} - -DBA_NEXTKEY_FUNC(cdb) -{ - CDB_INFO; - uint32 klen, dlen; - char buf[8]; - char *key; - -#if DBA_CDB_BUILTIN - if (cdb->make) - return NULL; /* database was opened writeonly */ -#endif - - CSEEK(cdb->pos); - CREAD(8); - uint32_unpack(buf, &klen); - uint32_unpack(buf + 4, &dlen); - - key = safe_emalloc(klen, 1, 1); - if (cdb_file_read(cdb->file, key, klen) < klen) { - efree(key); - key = NULL; - } else { - key[klen] = '\0'; - if (newlen) *newlen = klen; - } - - cdb->pos += 8 + klen + dlen; - - return key; -} - -DBA_OPTIMIZE_FUNC(cdb) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(cdb) -{ - /* this is read-only */ - return SUCCESS; -} - -DBA_INFO_FUNC(cdb) -{ -#if DBA_CDB_BUILTIN - if (!strcmp(hnd->name, "cdb")) { - return estrdup(cdb_version()); - } else { - return estrdup(cdb_make_version()); - } -#else - return estrdup("External"); -#endif -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db1.c b/ext/dba/dba_db1.c deleted file mode 100755 index 3890904f59e56..0000000000000 --- a/ext/dba/dba_db1.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Shen Cheng-Da | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DB1 -#include "php_db1.h" - -#ifdef DB1_INCLUDE_FILE -#include DB1_INCLUDE_FILE -#endif - -#include -#include -#include - -#define DB1_DATA dba_db1_data *dba = info->dbf -#define DB1_GKEY DBT gkey; gkey.data = (char *) key; gkey.size = keylen - -typedef struct { - DB *dbp; -} dba_db1_data; - -DBA_OPEN_FUNC(db1) -{ - dba_db1_data *dba; - DB *db; - - int gmode; - int filemode = 0644; - - if (info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - gmode = 0; - switch (info->mode) { - case DBA_READER: - gmode = O_RDONLY; - break; - case DBA_WRITER: - gmode = O_RDWR; - break; - case DBA_CREAT: - gmode = O_RDWR | O_CREAT; - break; - case DBA_TRUNC: - gmode = O_RDWR | O_CREAT | O_TRUNC; - break; - default: - return FAILURE; /* not possible */ - } - - db = dbopen((char *)info->path, gmode, filemode, DB_HASH, NULL); - - if (db == NULL) { - return FAILURE; - } - - dba = pemalloc(sizeof(*dba), info->flags&DBA_PERSISTENT); - dba->dbp = db; - - info->dbf = dba; - - return SUCCESS; -} - -DBA_CLOSE_FUNC(db1) -{ - DB1_DATA; - dba->dbp->close(dba->dbp); - pefree(info->dbf, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(db1) -{ - DBT gval; - DB1_DATA; - DB1_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (dba->dbp->get(dba->dbp, &gkey, &gval, 0) == RET_SUCCESS) { - if (newlen) *newlen = gval.size; - return estrndup(gval.data, gval.size); - } - return NULL; -} - -DBA_UPDATE_FUNC(db1) -{ - DBT gval; - DB1_DATA; - DB1_GKEY; - - gval.data = (char *) val; - gval.size = vallen; - - return dba->dbp->put(dba->dbp, &gkey, &gval, mode == 1 ? R_NOOVERWRITE : 0) != RET_SUCCESS ? FAILURE : SUCCESS; -} - -DBA_EXISTS_FUNC(db1) -{ - DBT gval; - DB1_DATA; - DB1_GKEY; - - return dba->dbp->get(dba->dbp, &gkey, &gval, 0) != RET_SUCCESS ? FAILURE : SUCCESS; -} - -DBA_DELETE_FUNC(db1) -{ - DB1_DATA; - DB1_GKEY; - - return dba->dbp->del(dba->dbp, &gkey, 0) != RET_SUCCESS ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db1) -{ - DBT gkey; - DBT gval; - DB1_DATA; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_FIRST) == RET_SUCCESS) { - if (newlen) *newlen = gkey.size; - return estrndup(gkey.data, gkey.size); - } - return NULL; -} - -DBA_NEXTKEY_FUNC(db1) -{ - DBT gkey; - DBT gval; - DB1_DATA; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if (dba->dbp->seq(dba->dbp, &gkey, &gval, R_NEXT) == RET_SUCCESS) { - if (newlen) *newlen = gkey.size; - return estrndup(gkey.data, gkey.size); - } - return NULL; -} - -DBA_OPTIMIZE_FUNC(db1) -{ - /* dummy */ - return SUCCESS; -} - -DBA_SYNC_FUNC(db1) -{ - return SUCCESS; -} - -DBA_INFO_FUNC(db1) -{ - return estrdup(DB1_VERSION); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c deleted file mode 100644 index 1b62e1b796956..0000000000000 --- a/ext/dba/dba_db2.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DB2 -#include "php_db2.h" -#include - -#include -#ifdef DB2_INCLUDE_FILE -#include DB2_INCLUDE_FILE -#endif - -#define DB2_DATA dba_db2_data *dba = info->dbf -#define DB2_GKEY \ - DBT gkey = {0}; \ - gkey.data = (char *) key; \ - gkey.size = keylen - -typedef struct { - DB *dbp; - DBC *cursor; -} dba_db2_data; - -DBA_OPEN_FUNC(db2) -{ - DB *dbp; - DBTYPE type; - int gmode = 0; - int filemode = 0644; - struct stat check_stat; - int s = VCWD_STAT(info->path, &check_stat); - - if (!s && !check_stat.st_size) { - info->mode = DBA_TRUNC; /* force truncate */ - } - - type = info->mode == DBA_READER ? DB_UNKNOWN : - info->mode == DBA_TRUNC ? DB_BTREE : - s ? DB_BTREE : DB_UNKNOWN; - - gmode = info->mode == DBA_READER ? DB_RDONLY : - (info->mode == DBA_CREAT && s) ? DB_CREATE : - (info->mode == DBA_CREAT && !s) ? 0 : - info->mode == DBA_WRITER ? 0 : - info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1; - - if (gmode == -1) { - return FAILURE;/* not possible */ - } - - if (info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - if (db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) { - return FAILURE; - } - - info->dbf = pemalloc(sizeof(dba_db2_data), info->flags&DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(dba_db2_data)); - ((dba_db2_data *) info->dbf)->dbp = dbp; - return SUCCESS; -} - -DBA_CLOSE_FUNC(db2) -{ - DB2_DATA; - - if (dba->cursor) - dba->cursor->c_close(dba->cursor); - dba->dbp->close(dba->dbp, 0); - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(db2) -{ - DBT gval = {0}; - DB2_DATA; - DB2_GKEY; - - if (dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return NULL; - } - - if (newlen) *newlen = gval.size; - return estrndup(gval.data, gval.size); -} - -DBA_UPDATE_FUNC(db2) -{ - DBT gval = {0}; - DB2_DATA; - DB2_GKEY; - - gval.data = (char *) val; - gval.size = vallen; - - if (dba->dbp->put(dba->dbp, NULL, &gkey, &gval, - mode == 1 ? DB_NOOVERWRITE : 0)) { - return FAILURE; - } - return SUCCESS; -} - -DBA_EXISTS_FUNC(db2) -{ - DBT gval = {0}; - DB2_DATA; - DB2_GKEY; - - if (dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return FAILURE; - } - return SUCCESS; -} - -DBA_DELETE_FUNC(db2) -{ - DB2_DATA; - DB2_GKEY; - - return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db2) -{ - DB2_DATA; - - if (dba->cursor) { - dba->cursor->c_close(dba->cursor); - dba->cursor = NULL; - } - -#if (DB_VERSION_MAJOR > 2) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR > 6) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 6 && DB_VERSION_PATCH >= 4) - if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0)) { -#else - if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor)) { -#endif - return NULL; - } - - /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db2(info, newlen TSRMLS_CC); -} - -DBA_NEXTKEY_FUNC(db2) -{ - DB2_DATA; - DBT gkey = {0}, gval = {0}; - - if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) - || !gkey.data) - return NULL; - - if (newlen) *newlen = gkey.size; - return estrndup(gkey.data, gkey.size); -} - -DBA_OPTIMIZE_FUNC(db2) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(db2) -{ - DB2_DATA; - - return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS; -} - -DBA_INFO_FUNC(db2) -{ - return estrdup(DB_VERSION_STRING); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c deleted file mode 100644 index 910741df58ea4..0000000000000 --- a/ext/dba/dba_db3.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DB3 -#include "php_db3.h" -#include - -#include -#ifdef DB3_INCLUDE_FILE -#include DB3_INCLUDE_FILE -#else -#include -#endif - -static void php_dba_db3_errcall_fcn(const char *errpfx, char *msg) -{ - TSRMLS_FETCH(); - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg); -} - -#define DB3_DATA dba_db3_data *dba = info->dbf -#define DB3_GKEY \ - DBT gkey; \ - memset(&gkey, 0, sizeof(gkey)); \ - gkey.data = (char *) key; gkey.size = keylen - -typedef struct { - DB *dbp; - DBC *cursor; -} dba_db3_data; - -DBA_OPEN_FUNC(db3) -{ - DB *dbp = NULL; - DBTYPE type; - int gmode = 0, err; - int filemode = 0644; - struct stat check_stat; - int s = VCWD_STAT(info->path, &check_stat); - - if (!s && !check_stat.st_size) { - info->mode = DBA_TRUNC; /* force truncate */ - } - - type = info->mode == DBA_READER ? DB_UNKNOWN : - info->mode == DBA_TRUNC ? DB_BTREE : - s ? DB_BTREE : DB_UNKNOWN; - - gmode = info->mode == DBA_READER ? DB_RDONLY : - (info->mode == DBA_CREAT && s) ? DB_CREATE : - (info->mode == DBA_CREAT && !s) ? 0 : - info->mode == DBA_WRITER ? 0 : - info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1; - - if (gmode == -1) { - return FAILURE; /* not possible */ - } - - if (info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - -#ifdef DB_FCNTL_LOCKING - gmode |= DB_FCNTL_LOCKING; -#endif - - if ((err=db_create(&dbp, NULL, 0)) == 0) { - dbp->set_errcall(dbp, php_dba_db3_errcall_fcn); - if ((err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) { - dba_db3_data *data; - - data = pemalloc(sizeof(*data), info->flags&DBA_PERSISTENT); - data->dbp = dbp; - data->cursor = NULL; - info->dbf = data; - - return SUCCESS; - } else { - dbp->close(dbp, 0); - *error = db_strerror(err); - } - } else { - *error = db_strerror(err); - } - - return FAILURE; -} - -DBA_CLOSE_FUNC(db3) -{ - DB3_DATA; - - if (dba->cursor) dba->cursor->c_close(dba->cursor); - dba->dbp->close(dba->dbp, 0); - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(db3) -{ - DBT gval; - char *new = NULL; - DB3_DATA; - DB3_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - if (newlen) *newlen = gval.size; - new = estrndup(gval.data, gval.size); - } - return new; -} - -DBA_UPDATE_FUNC(db3) -{ - DBT gval; - DB3_DATA; - DB3_GKEY; - - memset(&gval, 0, sizeof(gval)); - gval.data = (char *) val; - gval.size = vallen; - - if (!dba->dbp->put(dba->dbp, NULL, &gkey, &gval, - mode == 1 ? DB_NOOVERWRITE : 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_EXISTS_FUNC(db3) -{ - DBT gval; - DB3_DATA; - DB3_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(db3) -{ - DB3_DATA; - DB3_GKEY; - - return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db3) -{ - DB3_DATA; - - if (dba->cursor) { - dba->cursor->c_close(dba->cursor); - } - - dba->cursor = NULL; - if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0) != 0) { - return NULL; - } - - /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db3(info, newlen TSRMLS_CC); -} - -DBA_NEXTKEY_FUNC(db3) -{ - DB3_DATA; - DBT gkey, gval; - char *nkey = NULL; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) == 0) { - if (gkey.data) { - nkey = estrndup(gkey.data, gkey.size); - if (newlen) *newlen = gkey.size; - } - } - - return nkey; -} - -DBA_OPTIMIZE_FUNC(db3) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(db3) -{ - DB3_DATA; - - return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS; -} - -DBA_INFO_FUNC(db3) -{ - return estrdup(DB_VERSION_STRING); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c deleted file mode 100644 index e0e6ec0424633..0000000000000 --- a/ext/dba/dba_db4.c +++ /dev/null @@ -1,266 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Marcus Boerger | - | Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DB4 -#include "php_db4.h" -#include - -#include -#ifdef DB4_INCLUDE_FILE -#include DB4_INCLUDE_FILE -#else -#include -#endif - -static void php_dba_db4_errcall_fcn( -#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) - const DB_ENV *dbenv, -#endif - const char *errpfx, const char *msg) -{ - TSRMLS_FETCH(); - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg); -} - -#define DB4_DATA dba_db4_data *dba = info->dbf -#define DB4_GKEY \ - DBT gkey; \ - memset(&gkey, 0, sizeof(gkey)); \ - gkey.data = (char *) key; gkey.size = keylen - -typedef struct { - DB *dbp; - DBC *cursor; -} dba_db4_data; - -DBA_OPEN_FUNC(db4) -{ - DB *dbp = NULL; - DBTYPE type; - int gmode = 0, err; - int filemode = 0644; - struct stat check_stat; - int s = VCWD_STAT(info->path, &check_stat); - - if (!s && !check_stat.st_size) { - info->mode = DBA_TRUNC; /* force truncate */ - } - - type = info->mode == DBA_READER ? DB_UNKNOWN : - info->mode == DBA_TRUNC ? DB_BTREE : - s ? DB_BTREE : DB_UNKNOWN; - - gmode = info->mode == DBA_READER ? DB_RDONLY : - (info->mode == DBA_CREAT && s) ? DB_CREATE : - (info->mode == DBA_CREAT && !s) ? 0 : - info->mode == DBA_WRITER ? 0 : - info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1; - - if (gmode == -1) { - return FAILURE; /* not possible */ - } - - if (info->flags & DBA_PERSISTENT) { - gmode |= DB_THREAD; - } - - if (info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - if ((err=db_create(&dbp, NULL, 0)) == 0) { - dbp->set_errcall(dbp, php_dba_db4_errcall_fcn); - if ( -#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1) - (err=dbp->open(dbp, 0, info->path, NULL, type, gmode, filemode)) == 0) { -#else - (err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) { -#endif - dba_db4_data *data; - - data = pemalloc(sizeof(*data), info->flags&DBA_PERSISTENT); - data->dbp = dbp; - data->cursor = NULL; - info->dbf = data; - - return SUCCESS; - } else { - dbp->close(dbp, 0); - *error = db_strerror(err); - } - } else { - *error = db_strerror(err); - } - - return FAILURE; -} - -DBA_CLOSE_FUNC(db4) -{ - DB4_DATA; - - if (dba->cursor) dba->cursor->c_close(dba->cursor); - dba->dbp->close(dba->dbp, 0); - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(db4) -{ - DBT gval; - char *new = NULL; - DB4_DATA; - DB4_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (info->flags & DBA_PERSISTENT) { - gval.flags |= DB_DBT_MALLOC; - } - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - if (newlen) *newlen = gval.size; - new = estrndup(gval.data, gval.size); - if (info->flags & DBA_PERSISTENT) { - free(gval.data); - } - } - return new; -} - -DBA_UPDATE_FUNC(db4) -{ - DBT gval; - DB4_DATA; - DB4_GKEY; - - memset(&gval, 0, sizeof(gval)); - gval.data = (char *) val; - gval.size = vallen; - - if (!dba->dbp->put(dba->dbp, NULL, &gkey, &gval, - mode == 1 ? DB_NOOVERWRITE : 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_EXISTS_FUNC(db4) -{ - DBT gval; - DB4_DATA; - DB4_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(db4) -{ - DB4_DATA; - DB4_GKEY; - - return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db4) -{ - DB4_DATA; - - if (dba->cursor) { - dba->cursor->c_close(dba->cursor); - } - - dba->cursor = NULL; - if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0) != 0) { - return NULL; - } - - /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db4(info, newlen TSRMLS_CC); -} - -DBA_NEXTKEY_FUNC(db4) -{ - DB4_DATA; - DBT gkey, gval; - char *nkey = NULL; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if (info->flags & DBA_PERSISTENT) { - gkey.flags |= DB_DBT_MALLOC; - gval.flags |= DB_DBT_MALLOC; - } - if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) == 0) { - if (gkey.data) { - nkey = estrndup(gkey.data, gkey.size); - if (newlen) *newlen = gkey.size; - } - if (info->flags & DBA_PERSISTENT) { - if (gkey.data) { - free(gkey.data); - } - if (gval.data) { - free(gval.data); - } - } - } - - return nkey; -} - -DBA_OPTIMIZE_FUNC(db4) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(db4) -{ - DB4_DATA; - - return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS; -} - -DBA_INFO_FUNC(db4) -{ - return estrdup(DB_VERSION_STRING); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c deleted file mode 100644 index 623f543a719f9..0000000000000 --- a/ext/dba/dba_dbm.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_DBM -#include "php_dbm.h" - -#ifdef DBM_INCLUDE_FILE -#include DBM_INCLUDE_FILE -#endif -#if DBA_GDBM -#include "php_gdbm.h" -#endif - -#include -#include -#include -#include - -#define DBM_DATA dba_dbm_data *dba = info->dbf -#define DBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -#define TRUNC_IT(extension, mode) \ - snprintf(buf, MAXPATHLEN, "%s" extension, info->path); \ - buf[MAXPATHLEN-1] = '\0'; \ - if((fd = VCWD_OPEN_MODE(buf, O_CREAT | mode | O_WRONLY, filemode)) == -1) \ - return FAILURE; \ - close(fd); - - -typedef struct { - datum nextkey; -} dba_dbm_data; - -DBA_OPEN_FUNC(dbm) -{ - int fd; - int filemode = 0644; - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - if(info->mode == DBA_TRUNC) { - char buf[MAXPATHLEN]; - - /* dbm/ndbm original */ - TRUNC_IT(".pag", O_TRUNC); - TRUNC_IT(".dir", O_TRUNC); - } - - if(info->mode == DBA_CREAT) { - char buf[MAXPATHLEN]; - - TRUNC_IT(".pag", 0); - TRUNC_IT(".dir", 0); - } - - if(dbminit((char *) info->path) == -1) { - return FAILURE; - } - - info->dbf = pemalloc(sizeof(dba_dbm_data), info->flags&DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(dba_dbm_data)); - return SUCCESS; -} - -DBA_CLOSE_FUNC(dbm) -{ - pefree(info->dbf, info->flags&DBA_PERSISTENT); - dbmclose(); -} - -DBA_FETCH_FUNC(dbm) -{ - datum gval; - char *new = NULL; - - DBM_GKEY; - gval = fetch(gkey); - if(gval.dptr) { - if(newlen) *newlen = gval.dsize; - new = estrndup(gval.dptr, gval.dsize); - } - return new; -} - -DBA_UPDATE_FUNC(dbm) -{ - datum gval; - - DBM_GKEY; - - if (mode == 1) { /* insert */ - gval = fetch(gkey); - if(gval.dptr) { - return FAILURE; - } - } - - gval.dptr = (char *) val; - gval.dsize = vallen; - - return (store(gkey, gval) == -1 ? FAILURE : SUCCESS); -} - -DBA_EXISTS_FUNC(dbm) -{ - datum gval; - DBM_GKEY; - - gval = fetch(gkey); - if(gval.dptr) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(dbm) -{ - DBM_GKEY; - return(delete(gkey) == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(dbm) -{ - DBM_DATA; - datum gkey; - char *key = NULL; - - gkey = firstkey(); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - key = estrndup(gkey.dptr, gkey.dsize); - dba->nextkey = gkey; - } else - dba->nextkey.dptr = NULL; - return key; -} - -DBA_NEXTKEY_FUNC(dbm) -{ - DBM_DATA; - datum gkey; - char *nkey = NULL; - - if(!dba->nextkey.dptr) return NULL; - - gkey = nextkey(dba->nextkey); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - nkey = estrndup(gkey.dptr, gkey.dsize); - dba->nextkey = gkey; - } else - dba->nextkey.dptr = NULL; - return nkey; -} - -DBA_OPTIMIZE_FUNC(dbm) -{ - /* dummy */ - return SUCCESS; -} - -DBA_SYNC_FUNC(dbm) -{ - return SUCCESS; -} - -DBA_INFO_FUNC(dbm) -{ -#if DBA_GDBM - if (!strcmp(DBM_VERSION, "GDBM")) - { - return dba_info_gdbm(hnd, info TSRMLS_CC); - } -#endif - return estrdup(DBM_VERSION); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c deleted file mode 100644 index b9242a9dbcd74..0000000000000 --- a/ext/dba/dba_flatfile.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_FLATFILE -#include "php_flatfile.h" - -#include "libflatfile/flatfile.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include - -#define FLATFILE_DATA flatfile *dba = info->dbf -#define FLATFILE_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -DBA_OPEN_FUNC(flatfile) -{ - info->dbf = pemalloc(sizeof(flatfile), info->flags&DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(flatfile)); - - ((flatfile*)info->dbf)->fp = info->fp; - - return SUCCESS; -} - -DBA_CLOSE_FUNC(flatfile) -{ - FLATFILE_DATA; - - if (dba->nextkey.dptr) { - efree(dba->nextkey.dptr); - } - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(flatfile) -{ - datum gval; - char *new = NULL; - - FLATFILE_DATA; - FLATFILE_GKEY; - - gval = flatfile_fetch(dba, gkey TSRMLS_CC); - if (gval.dptr) { - if (newlen) { - *newlen = gval.dsize; - } - new = estrndup(gval.dptr, gval.dsize); - efree(gval.dptr); - } - return new; -} - -DBA_UPDATE_FUNC(flatfile) -{ - datum gval; - - FLATFILE_DATA; - FLATFILE_GKEY; - gval.dptr = (char *) val; - gval.dsize = vallen; - - switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE TSRMLS_CC)) { - case -1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible"); - return FAILURE; - default: - case 0: - return SUCCESS; - case 1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Key already exists"); - return SUCCESS; - } -} - -DBA_EXISTS_FUNC(flatfile) -{ - datum gval; - FLATFILE_DATA; - FLATFILE_GKEY; - - gval = flatfile_fetch(dba, gkey TSRMLS_CC); - if (gval.dptr) { - efree(gval.dptr); - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(flatfile) -{ - FLATFILE_DATA; - FLATFILE_GKEY; - return(flatfile_delete(dba, gkey TSRMLS_CC) == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(flatfile) -{ - FLATFILE_DATA; - - if (dba->nextkey.dptr) { - efree(dba->nextkey.dptr); - } - dba->nextkey = flatfile_firstkey(dba TSRMLS_CC); - if (dba->nextkey.dptr) { - if (newlen) { - *newlen = dba->nextkey.dsize; - } - return estrndup(dba->nextkey.dptr, dba->nextkey.dsize); - } - return NULL; -} - -DBA_NEXTKEY_FUNC(flatfile) -{ - FLATFILE_DATA; - - if (!dba->nextkey.dptr) { - return NULL; - } - - if (dba->nextkey.dptr) { - efree(dba->nextkey.dptr); - } - dba->nextkey = flatfile_nextkey(dba TSRMLS_CC); - if (dba->nextkey.dptr) { - if (newlen) { - *newlen = dba->nextkey.dsize; - } - return estrndup(dba->nextkey.dptr, dba->nextkey.dsize); - } - return NULL; -} - -DBA_OPTIMIZE_FUNC(flatfile) -{ - /* dummy */ - return SUCCESS; -} - -DBA_SYNC_FUNC(flatfile) -{ - /* dummy */ - return SUCCESS; -} - -DBA_INFO_FUNC(flatfile) -{ - return estrdup(flatfile_version()); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c deleted file mode 100644 index cb347b83e128c..0000000000000 --- a/ext/dba/dba_gdbm.c +++ /dev/null @@ -1,200 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_GDBM -#include "php_gdbm.h" - -#ifdef GDBM_INCLUDE_FILE -#include GDBM_INCLUDE_FILE -#endif - -#define GDBM_DATA dba_gdbm_data *dba = info->dbf -#define GDBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -typedef struct { - GDBM_FILE dbf; - datum nextkey; -} dba_gdbm_data; - -DBA_OPEN_FUNC(gdbm) -{ - GDBM_FILE dbf; - int gmode = 0; - int filemode = 0644; - - gmode = info->mode == DBA_READER ? GDBM_READER : - info->mode == DBA_WRITER ? GDBM_WRITER : - info->mode == DBA_CREAT ? GDBM_WRCREAT : - info->mode == DBA_TRUNC ? GDBM_NEWDB : -1; - - if(gmode == -1) - return FAILURE; /* not possible */ - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - dbf = gdbm_open(info->path, 0, gmode, filemode, NULL); - - if(dbf) { - info->dbf = pemalloc(sizeof(dba_gdbm_data), info->flags&DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(dba_gdbm_data)); - ((dba_gdbm_data *) info->dbf)->dbf = dbf; - return SUCCESS; - } - *error = gdbm_strerror(gdbm_errno); - return FAILURE; -} - -DBA_CLOSE_FUNC(gdbm) -{ - GDBM_DATA; - - if(dba->nextkey.dptr) free(dba->nextkey.dptr); - gdbm_close(dba->dbf); - pefree(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(gdbm) -{ - GDBM_DATA; - datum gval; - char *new = NULL; - - GDBM_GKEY; - gval = gdbm_fetch(dba->dbf, gkey); - if(gval.dptr) { - if(newlen) *newlen = gval.dsize; - new = estrndup(gval.dptr, gval.dsize); - free(gval.dptr); - } - return new; -} - -DBA_UPDATE_FUNC(gdbm) -{ - datum gval; - GDBM_DATA; - - GDBM_GKEY; - gval.dptr = (char *) val; - gval.dsize = vallen; - - if(gdbm_store(dba->dbf, gkey, gval, - mode == 1 ? GDBM_INSERT : GDBM_REPLACE) == 0) - return SUCCESS; - php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", gdbm_strerror(gdbm_errno)); - return FAILURE; -} - -DBA_EXISTS_FUNC(gdbm) -{ - GDBM_DATA; - GDBM_GKEY; - - return gdbm_exists(dba->dbf, gkey) ? SUCCESS : FAILURE; -} - -DBA_DELETE_FUNC(gdbm) -{ - GDBM_DATA; - GDBM_GKEY; - - return gdbm_delete(dba->dbf, gkey) == -1 ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(gdbm) -{ - GDBM_DATA; - datum gkey; - char *key = NULL; - - if(dba->nextkey.dptr) { - free(dba->nextkey.dptr); - } - - gkey = gdbm_firstkey(dba->dbf); - if(gkey.dptr) { - key = estrndup(gkey.dptr, gkey.dsize); - if(newlen) *newlen = gkey.dsize; - dba->nextkey = gkey; - } else { - dba->nextkey.dptr = NULL; - } - return key; -} - -DBA_NEXTKEY_FUNC(gdbm) -{ - GDBM_DATA; - char *nkey = NULL; - datum gkey; - - if(!dba->nextkey.dptr) return NULL; - - gkey = gdbm_nextkey(dba->dbf, dba->nextkey); - free(dba->nextkey.dptr); - if(gkey.dptr) { - nkey = estrndup(gkey.dptr, gkey.dsize); - if(newlen) *newlen = gkey.dsize; - dba->nextkey = gkey; - } else { - dba->nextkey.dptr = NULL; - } - return nkey; -} - -DBA_OPTIMIZE_FUNC(gdbm) -{ - GDBM_DATA; - gdbm_reorganize(dba->dbf); - return SUCCESS; -} - -DBA_SYNC_FUNC(gdbm) -{ - GDBM_DATA; - - gdbm_sync(dba->dbf); - return SUCCESS; -} - -DBA_INFO_FUNC(gdbm) -{ - return estrdup(gdbm_version); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c deleted file mode 100644 index c6dd3d484b2d0..0000000000000 --- a/ext/dba/dba_inifile.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_INIFILE -#include "php_inifile.h" - -#include "libinifile/inifile.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include - -#define INIFILE_DATA \ - inifile *dba = info->dbf - -#define INIFILE_GKEY \ - key_type ini_key; \ - if (!key) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No key specified"); \ - return 0; \ - } \ - ini_key = inifile_key_split((char*)key) /* keylen not needed here */ - -#define INIFILE_DONE \ - inifile_key_free(&ini_key) - -DBA_OPEN_FUNC(inifile) -{ - info->dbf = inifile_alloc(info->fp, info->mode == DBA_READER, info->flags&DBA_PERSISTENT TSRMLS_CC); - - return info->dbf ? SUCCESS : FAILURE; -} - -DBA_CLOSE_FUNC(inifile) -{ - INIFILE_DATA; - - inifile_free(dba, info->flags&DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(inifile) -{ - val_type ini_val; - - INIFILE_DATA; - INIFILE_GKEY; - - ini_val = inifile_fetch(dba, &ini_key, skip TSRMLS_CC); - *newlen = ini_val.value ? strlen(ini_val.value) : 0; - INIFILE_DONE; - return ini_val.value; -} - -DBA_UPDATE_FUNC(inifile) -{ - val_type ini_val; - int res; - - INIFILE_DATA; - INIFILE_GKEY; - - ini_val.value = val; - - if (mode == 1) { - res = inifile_append(dba, &ini_key, &ini_val TSRMLS_CC); - } else { - res = inifile_replace(dba, &ini_key, &ini_val TSRMLS_CC); - } - INIFILE_DONE; - switch(res) { - case -1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible"); - return FAILURE; - default: - case 0: - return SUCCESS; - case 1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Key already exists"); - return SUCCESS; - } -} - -DBA_EXISTS_FUNC(inifile) -{ - val_type ini_val; - - INIFILE_DATA; - INIFILE_GKEY; - - ini_val = inifile_fetch(dba, &ini_key, 0 TSRMLS_CC); - INIFILE_DONE; - if (ini_val.value) { - inifile_val_free(&ini_val); - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(inifile) -{ - int res; - - INIFILE_DATA; - INIFILE_GKEY; - - res = inifile_delete(dba, &ini_key TSRMLS_CC); - - INIFILE_DONE; - return (res == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(inifile) -{ - INIFILE_DATA; - - if (inifile_firstkey(dba TSRMLS_CC)) { - char *result = inifile_key_string(&dba->curr.key); - *newlen = strlen(result); - return result; - } else { - return NULL; - } -} - -DBA_NEXTKEY_FUNC(inifile) -{ - INIFILE_DATA; - - if (!dba->curr.key.group && !dba->curr.key.name) { - return NULL; - } - - if (inifile_nextkey(dba TSRMLS_CC)) { - char *result = inifile_key_string(&dba->curr.key); - *newlen = strlen(result); - return result; - } else { - return NULL; - } -} - -DBA_OPTIMIZE_FUNC(inifile) -{ - /* dummy */ - return SUCCESS; -} - -DBA_SYNC_FUNC(inifile) -{ - /* dummy */ - return SUCCESS; -} - -DBA_INFO_FUNC(inifile) -{ - return estrdup(inifile_version()); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c deleted file mode 100644 index 8978d6bcc0ec3..0000000000000 --- a/ext/dba/dba_ndbm.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_NDBM -#include "php_ndbm.h" - -#include -#ifdef NDBM_INCLUDE_FILE -#include NDBM_INCLUDE_FILE -#endif - -#define NDBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -DBA_OPEN_FUNC(ndbm) -{ - DBM *dbf; - int gmode = 0; - int filemode = 0644; - dba_info *pinfo = (dba_info *) info; - - switch(info->mode) { - case DBA_READER: - gmode = O_RDONLY; - break; - case DBA_WRITER: - gmode = O_RDWR; - break; - case DBA_CREAT: - gmode = O_RDWR | O_CREAT; - break; - case DBA_TRUNC: - gmode = O_RDWR | O_CREAT | O_TRUNC; - break; - default: - return FAILURE; /* not possible */ - } - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - dbf = dbm_open(info->path, gmode, filemode); - - pinfo->dbf = dbf; - return SUCCESS; -} - -DBA_CLOSE_FUNC(ndbm) -{ - dbm_close(info->dbf); -} - -DBA_FETCH_FUNC(ndbm) -{ - datum gval; - char *new = NULL; - - NDBM_GKEY; - gval = dbm_fetch(info->dbf, gkey); - if(gval.dptr) { - if(newlen) *newlen = gval.dsize; - new = estrndup(gval.dptr, gval.dsize); - } - return new; -} - -DBA_UPDATE_FUNC(ndbm) -{ - datum gval; - - NDBM_GKEY; - gval.dptr = (char *) val; - gval.dsize = vallen; - - if(!dbm_store(info->dbf, gkey, gval, mode == 1 ? DBM_INSERT : DBM_REPLACE)) - return SUCCESS; - return FAILURE; -} - -DBA_EXISTS_FUNC(ndbm) -{ - datum gval; - NDBM_GKEY; - gval = dbm_fetch(info->dbf, gkey); - if(gval.dptr) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(ndbm) -{ - NDBM_GKEY; - return(dbm_delete(info->dbf, gkey) == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(ndbm) -{ - datum gkey; - char *key = NULL; - - gkey = dbm_firstkey(info->dbf); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - key = estrndup(gkey.dptr, gkey.dsize); - } - return key; -} - -DBA_NEXTKEY_FUNC(ndbm) -{ - datum gkey; - char *nkey = NULL; - - gkey = dbm_nextkey(info->dbf); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - nkey = estrndup(gkey.dptr, gkey.dsize); - } - return nkey; -} - -DBA_OPTIMIZE_FUNC(ndbm) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(ndbm) -{ - return SUCCESS; -} - -DBA_INFO_FUNC(ndbm) -{ - return estrdup("NDBM"); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c deleted file mode 100755 index fbd673e291301..0000000000000 --- a/ext/dba/dba_qdbm.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcin Gibula | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if DBA_QDBM -#include "php_qdbm.h" - -#ifdef QDBM_INCLUDE_FILE -#include QDBM_INCLUDE_FILE -#endif - -#define QDBM_DATA dba_qdbm_data *dba = info->dbf - -typedef struct { - DEPOT *dbf; -} dba_qdbm_data; - -DBA_OPEN_FUNC(qdbm) -{ - DEPOT *dbf; - - switch(info->mode) { - case DBA_READER: - dbf = dpopen(info->path, DP_OREADER, 0); - break; - case DBA_WRITER: - dbf = dpopen(info->path, DP_OWRITER, 0); - break; - case DBA_CREAT: - dbf = dpopen(info->path, DP_OWRITER | DP_OCREAT, 0); - break; - case DBA_TRUNC: - dbf = dpopen(info->path, DP_OWRITER | DP_OCREAT | DP_OTRUNC, 0); - break; - default: - return FAILURE; - } - - if (dbf) { - info->dbf = pemalloc(sizeof(dba_qdbm_data), info->flags & DBA_PERSISTENT); - memset(info->dbf, 0, sizeof(dba_qdbm_data)); - ((dba_qdbm_data *) info->dbf)->dbf = dbf; - return SUCCESS; - } - - *error = (char *) dperrmsg(dpecode); - return FAILURE; -} - -DBA_CLOSE_FUNC(qdbm) -{ - QDBM_DATA; - - dpclose(dba->dbf); - pefree(dba, info->flags & DBA_PERSISTENT); -} - -DBA_FETCH_FUNC(qdbm) -{ - QDBM_DATA; - char *value, *new = NULL; - int value_size; - - value = dpget(dba->dbf, key, keylen, 0, -1, &value_size); - if (value) { - if (newlen) *newlen = value_size; - new = estrndup(value, value_size); - free(value); - } - - return new; -} - -DBA_UPDATE_FUNC(qdbm) -{ - QDBM_DATA; - int result; - - result = dpput(dba->dbf, key, keylen, val, vallen, mode == 1 ? DP_DKEEP : DP_DOVER); - if (result) - return SUCCESS; - - php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", dperrmsg(dpecode)); - return FAILURE; -} - -DBA_EXISTS_FUNC(qdbm) -{ - QDBM_DATA; - char *value; - - value = dpget(dba->dbf, key, keylen, 0, -1, NULL); - if (value) { - free(value); - return SUCCESS; - } - - return FAILURE; -} - -DBA_DELETE_FUNC(qdbm) -{ - QDBM_DATA; - - return dpout(dba->dbf, key, keylen) ? SUCCESS : FAILURE; -} - -DBA_FIRSTKEY_FUNC(qdbm) -{ - QDBM_DATA; - int value_size; - char *value, *new = NULL; - - dpiterinit(dba->dbf); - - value = dpiternext(dba->dbf, &value_size); - if (value) { - if (newlen) *newlen = value_size; - new = estrndup(value, value_size); - free(value); - } - - return new; -} - -DBA_NEXTKEY_FUNC(qdbm) -{ - QDBM_DATA; - int value_size; - char *value, *new = NULL; - - value = dpiternext(dba->dbf, &value_size); - if (value) { - if (newlen) *newlen = value_size; - new = estrndup(value, value_size); - free(value); - } - - return new; -} - -DBA_OPTIMIZE_FUNC(qdbm) -{ - QDBM_DATA; - - dpoptimize(dba->dbf, 0); - return SUCCESS; -} - -DBA_SYNC_FUNC(qdbm) -{ - QDBM_DATA; - - dpsync(dba->dbf); - return SUCCESS; -} - -DBA_INFO_FUNC(qdbm) -{ - return estrdup(dpversion); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/install_cdb.sh b/ext/dba/install_cdb.sh deleted file mode 100755 index ce5f3cc856283..0000000000000 --- a/ext/dba/install_cdb.sh +++ /dev/null @@ -1,53 +0,0 @@ -#! /bin/sh - -# You can use this script if you want to use an external cdb lib. If you -# compile php using --with-cdb the internal functions will be used and no -# external library is used so that this script is not necessary. -# -# cdb-0.75 lacks support for installing header files and creating a -# library which programs can link against. This shell script fills -# the gap. -# -# $Id: install_cdb.sh,v 1.2 2002-11-04 17:53:04 helly Exp $ - -if test -r "cdb.a" && test -r "auto-str.c" && test -r "byte.a"; then - : -else - echo "Please execute this script in the cdb-0.75 source directory after 'make'" - exit 1 -fi - -prefix=$1 - -if test -z "$prefix"; then - prefix=/usr/local -fi - -echo "Using prefix $prefix" - -if mkdir -p "$prefix/include" "$prefix/lib"; then - : -else - echo "Creating directories failed. Please become superuser." - exit 1 -fi - -mkdir -p tmp || exit 1 -cd tmp -ar x ../cdb.a -ar x ../byte.a -ar x ../unix.a -ar x ../byte.a -ar x ../buffer.a -cp ../error.o . - -# not really portable -ar r "$prefix/lib/libcdb.a" * -ranlib "$prefix/lib/libcdb.a" -cd .. - -rm -rf tmp - -cp cdb.h uint32.h "$prefix/include" - -echo "done" diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c deleted file mode 100644 index 131543a0d6cc2..0000000000000 --- a/ext/dba/libcdb/cdb.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#include -#include -#ifndef PHP_WIN32 -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include "cdb.h" - -#ifndef EPROTO -# define EPROTO -15 /* cdb 0.75's default for PROTOless systems */ -#endif - -/* {{{ cdb_match */ -static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos TSRMLS_DC) -{ - char buf[32]; - unsigned int n; - - while (len > 0) { - n = sizeof(buf); - if (n > len) - n = len; - if (cdb_read(c, buf, n, pos TSRMLS_CC) == -1) - return -1; - if (memcmp(buf, key, n)) - return 0; - pos += n; - key += n; - len -= n; - } - return 1; -} -/* }}} */ - -/* {{{ cdb_hash */ -uint32 cdb_hash(char *buf, unsigned int len) -{ - uint32 h; - const unsigned char * b = (unsigned char *)buf; - - h = CDB_HASHSTART; - while (len--) { - h = ( h + (h << 5)) ^ (*b++); - } - return h; -} -/* }}} */ - -/* {{{ cdb_free */ -void cdb_free(struct cdb *c TSRMLS_DC) -{ -} -/* }}} */ - -/* {{{ cdb_findstart */ -void cdb_findstart(struct cdb *c TSRMLS_DC) -{ - c->loop = 0; -} -/* }}} */ - -/* {{{ cdb_init */ -void cdb_init(struct cdb *c, php_stream *fp TSRMLS_DC) -{ - cdb_free(c TSRMLS_CC); - cdb_findstart(c TSRMLS_CC); - c->fp = fp; -} -/* }}} */ - -/* {{{ cdb_read */ -int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos TSRMLS_DC) -{ - if (php_stream_seek(c->fp, pos, SEEK_SET) == -1) { - errno = EPROTO; - return -1; - } - while (len > 0) { - int r; - do { - r = php_stream_read(c->fp, buf, len); - } while ((r == -1) && (errno == EINTR)); - if (r == -1) - return -1; - if (r == 0) { - errno = EPROTO; - return -1; - } - buf += r; - len -= r; - } - return 0; -} -/* }}} */ - -/* {{{ cdb_findnext */ -int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC) -{ - char buf[8]; - uint32 pos; - uint32 u; - - if (!c->loop) { - u = cdb_hash(key, len); - if (cdb_read(c, buf, 8, (u << 3) & 2047 TSRMLS_CC) == -1) - return -1; - uint32_unpack(buf + 4,&c->hslots); - if (!c->hslots) - return 0; - uint32_unpack(buf, &c->hpos); - c->khash = u; - u >>= 8; - u %= c->hslots; - u <<= 3; - c->kpos = c->hpos + u; - } - - while (c->loop < c->hslots) { - if (cdb_read(c, buf, 8, c->kpos TSRMLS_CC) == -1) - return -1; - uint32_unpack(buf + 4, &pos); - if (!pos) - return 0; - c->loop += 1; - c->kpos += 8; - if (c->kpos == c->hpos + (c->hslots << 3)) - c->kpos = c->hpos; - uint32_unpack(buf, &u); - if (u == c->khash) { - if (cdb_read(c, buf, 8, pos TSRMLS_CC) == -1) - return -1; - uint32_unpack(buf, &u); - if (u == len) - switch(cdb_match(c, key, len, pos + 8 TSRMLS_CC)) { - case -1: - return -1; - case 1: - uint32_unpack(buf + 4, &c->dlen); - c->dpos = pos + 8 + len; - return 1; - } - } - } - - return 0; -} -/* }}} */ - -/* {{{ cdb_find */ -int cdb_find(struct cdb *c, char *key, unsigned int len TSRMLS_DC) -{ - cdb_findstart(c TSRMLS_CC); - return cdb_findnext(c, key, len TSRMLS_CC); -} -/* }}} */ - -/* {{{ cdb_version */ -char *cdb_version() -{ - return "0.75, $Revision$"; -} -/* }}} */ diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h deleted file mode 100644 index 6b3fcd352b61a..0000000000000 --- a/ext/dba/libcdb/cdb.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifndef CDB_H -#define CDB_H - -#include "uint32.h" - -#define CDB_HASHSTART 5381 - -struct cdb { - php_stream *fp; - uint32 loop; /* number of hash slots searched under this key */ - uint32 khash; /* initialized if loop is nonzero */ - uint32 kpos; /* initialized if loop is nonzero */ - uint32 hpos; /* initialized if loop is nonzero */ - uint32 hslots; /* initialized if loop is nonzero */ - uint32 dpos; /* initialized if cdb_findnext() returns 1 */ - uint32 dlen; /* initialized if cdb_findnext() returns 1 */ -}; - -uint32 cdb_hash(char *, unsigned int); - -void cdb_free(struct cdb * TSRMLS_DC); -void cdb_init(struct cdb *, php_stream *fp TSRMLS_DC); - -int cdb_read(struct cdb *, char *, unsigned int, uint32 TSRMLS_DC); - -void cdb_findstart(struct cdb * TSRMLS_DC); -int cdb_findnext(struct cdb *, char *, unsigned int TSRMLS_DC); -int cdb_find(struct cdb *, char *, unsigned int TSRMLS_DC); - -#define cdb_datapos(c) ((c)->dpos) -#define cdb_datalen(c) ((c)->dlen) - -char *cdb_version(); - -#endif diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c deleted file mode 100644 index 717f03a5b4ba5..0000000000000 --- a/ext/dba/libcdb/cdb_make.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#include "cdb.h" -#include "cdb_make.h" -#include "uint32.h" - -/* {{{ cdb_make_write */ -static int cdb_make_write(struct cdb_make *c, char *buf, uint32 sz TSRMLS_DC) { - return php_stream_write(c->fp, buf, sz) == sz ? 0 : -1; -} - -/* {{{ cdb_posplus */ -static int cdb_posplus(struct cdb_make *c, uint32 len) -{ - uint32 newpos = c->pos + len; - if (newpos < len) { - errno = ENOMEM; - return -1; - } - c->pos = newpos; - return 0; -} -/* }}} */ - -/* {{{ cdb_make_start */ -int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC) -{ - c->head = 0; - c->split = 0; - c->hash = 0; - c->numentries = 0; - c->fp = f; - c->pos = sizeof(c->final); - if (php_stream_seek(f, c->pos, SEEK_SET) == -1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Fseek failed"); - return -1; - } - return php_stream_tell(c->fp); -} -/* }}} */ - -/* {{{ cdb_make_addend */ -int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datalen, uint32 h TSRMLS_DC) -{ - struct cdb_hplist *head; - - head = c->head; - if (!head || (head->num >= CDB_HPLIST)) { - head = (struct cdb_hplist *) emalloc(sizeof(struct cdb_hplist)); - if (!head) - return -1; - head->num = 0; - head->next = c->head; - c->head = head; - } - head->hp[head->num].h = h; - head->hp[head->num].p = c->pos; - ++head->num; - ++c->numentries; - if (cdb_posplus(c,8) == -1) - return -1; - if (cdb_posplus(c, keylen) == -1) - return -1; - if (cdb_posplus(c, datalen) == -1) - return -1; - return 0; -} -/* }}} */ - -/* {{{ cdb_make_addbegin */ -int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int datalen TSRMLS_DC) -{ - char buf[8]; - - if (keylen > 0xffffffff) { - errno = ENOMEM; - return -1; - } - if (datalen > 0xffffffff) { - errno = ENOMEM; - return -1; - } - - uint32_pack(buf, keylen); - uint32_pack(buf + 4, datalen); - if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0) - return -1; - return 0; -} - -/* {{{ cdb_make_add */ -int cdb_make_add(struct cdb_make *c,char *key,unsigned int keylen,char *data,unsigned int datalen TSRMLS_DC) -{ - if (cdb_make_addbegin(c, keylen, datalen TSRMLS_CC) == -1) - return -1; - if (cdb_make_write(c, key, keylen TSRMLS_CC) != 0) - return -1; - if (cdb_make_write(c, data, datalen TSRMLS_CC) != 0) - return -1; - return cdb_make_addend(c, keylen, datalen, cdb_hash(key, keylen) TSRMLS_CC); -} -/* }}} */ - -/* {{{ cdb_make_finish */ -int cdb_make_finish(struct cdb_make *c TSRMLS_DC) -{ - char buf[8]; - int i; - uint32 len; - uint32 u; - uint32 memsize; - uint32 count; - uint32 where; - struct cdb_hplist *x; - struct cdb_hp *hp; - - for (i = 0;i < 256;++i) - c->count[i] = 0; - - for (x = c->head; x; x = x->next) { - i = x->num; - while (i--) - ++c->count[255 & x->hp[i].h]; - } - - memsize = 1; - for (i = 0;i < 256;++i) { - u = c->count[i] * 2; - if (u > memsize) - memsize = u; - } - - memsize += c->numentries; /* no overflow possible up to now */ - u = (uint32) 0 - (uint32) 1; - u /= sizeof(struct cdb_hp); - if (memsize > u) { - errno = ENOMEM; - return -1; - } - - c->split = (struct cdb_hp *) safe_emalloc(memsize, sizeof(struct cdb_hp), 0); - if (!c->split) - return -1; - - c->hash = c->split + c->numentries; - - u = 0; - for (i = 0;i < 256;++i) { - u += c->count[i]; /* bounded by numentries, so no overflow */ - c->start[i] = u; - } - - for (x = c->head; x; x = x->next) { - i = x->num; - while (i--) - c->split[--c->start[255 & x->hp[i].h]] = x->hp[i]; - } - - for (i = 0;i < 256;++i) { - count = c->count[i]; - - len = count + count; /* no overflow possible */ - uint32_pack(c->final + 8 * i,c->pos); - uint32_pack(c->final + 8 * i + 4,len); - - for (u = 0;u < len;++u) - c->hash[u].h = c->hash[u].p = 0; - - hp = c->split + c->start[i]; - for (u = 0;u < count;++u) { - where = (hp->h >> 8) % len; - while (c->hash[where].p) - if (++where == len) - where = 0; - c->hash[where] = *hp++; - } - - for (u = 0;u < len;++u) { - uint32_pack(buf, c->hash[u].h); - uint32_pack(buf + 4, c->hash[u].p); - if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0) - return -1; - if (cdb_posplus(c, 8) == -1) - return -1; - } - } - - if (c->split) - efree(c->split); - - for (x = c->head; x; c->head = x) { - x = x->next; - efree(c->head); - } - - if (php_stream_flush(c->fp) != 0) - return -1; - php_stream_rewind(c->fp); - if (php_stream_tell(c->fp) != 0) - return -1; - if (cdb_make_write(c, c->final, sizeof(c->final) TSRMLS_CC) != 0) - return -1; - return php_stream_flush(c->fp); -} -/* }}} */ - -/* {{{ cdb_make_version */ -char *cdb_make_version() -{ - return "0.75, $Revision$"; -} diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h deleted file mode 100644 index 6bd97f6724da8..0000000000000 --- a/ext/dba/libcdb/cdb_make.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifndef CDB_MAKE_H -#define CDB_MAKE_H - -#include -#include "uint32.h" - -#define CDB_HPLIST 1000 - -struct cdb_hp { - uint32 h; - uint32 p; -}; - -struct cdb_hplist { - struct cdb_hp hp[CDB_HPLIST]; - struct cdb_hplist *next; - int num; -} ; - -struct cdb_make { - /* char bspace[8192]; */ - char final[2048]; - uint32 count[256]; - uint32 start[256]; - struct cdb_hplist *head; - struct cdb_hp *split; /* includes space for hash */ - struct cdb_hp *hash; - uint32 numentries; - /* buffer b; */ - uint32 pos; - /* int fd; */ - php_stream * fp; -}; - -int cdb_make_start(struct cdb_make *, php_stream * TSRMLS_DC); -int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int TSRMLS_DC); -int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32 TSRMLS_DC); -int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int TSRMLS_DC); -int cdb_make_finish(struct cdb_make * TSRMLS_DC); -char *cdb_make_version(); - -#endif diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c deleted file mode 100644 index 3a48a55dcd6fe..0000000000000 --- a/ext/dba/libcdb/uint32.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#include "uint32.h" - -/* {{{ uint32_pack */ -void uint32_pack(char *out, uint32 in) -{ - out[0] = in&0xff; in>>=8; - out[1] = in&0xff; in>>=8; - out[2] = in&0xff; in>>=8; - out[3] = in&0xff; -} -/* }}} */ - -/* {{{ uint32_unpack */ -void uint32_unpack(const char *in, uint32 *out) -{ - *out = (((uint32)(unsigned char)in[3])<<24) | - (((uint32)(unsigned char)in[2])<<16) | - (((uint32)(unsigned char)in[1])<<8) | - (((uint32)(unsigned char)in[0])); -} -/* }}} */ diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h deleted file mode 100644 index 6d7ff8c7a5530..0000000000000 --- a/ext/dba/libcdb/uint32.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ - -#ifndef UINT32_H -#define UINT32_H - -#if SIZEOF_INT == 4 -/* Most 32-bit and 64-bit systems have 32-bit ints */ -typedef unsigned int uint32; -#elif SIZEOF_LONG == 4 -/* 16-bit systems? */ -typedef unsigned long uint32; -#else -#error Need type which holds 32 bits -#endif - -void uint32_pack(char *out, uint32 in); -void uint32_unpack(const char *in, uint32 *out); - -#endif diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c deleted file mode 100644 index f7c78dec1a64c..0000000000000 --- a/ext/dba/libflatfile/flatfile.c +++ /dev/null @@ -1,321 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Marcus Boerger | - | based on ext/db/db.c by: | - | Rasmus Lerdorf | - | Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "safe_mode.h" - -#include -#include -#include -#if HAVE_UNISTD_H -#include -#endif - -#include "flatfile.h" - -#define FLATFILE_BLOCK_SIZE 1024 - -/* - * ret = -1 means that database was opened for read-only - * ret = 0 success - * ret = 1 key already exists - nothing done - */ - -/* {{{ flatfile_store - */ -int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC) { - if (mode == FLATFILE_INSERT) { - if (flatfile_findkey(dba, key_datum TSRMLS_CC)) { - return 1; - } - php_stream_seek(dba->fp, 0L, SEEK_END); - php_stream_printf(dba->fp TSRMLS_CC, "%d\n", key_datum.dsize); - php_stream_flush(dba->fp); - if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) { - return -1; - } - php_stream_printf(dba->fp TSRMLS_CC, "%d\n", value_datum.dsize); - php_stream_flush(dba->fp); - if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) { - return -1; - } - } else { /* FLATFILE_REPLACE */ - flatfile_delete(dba, key_datum TSRMLS_CC); - php_stream_printf(dba->fp TSRMLS_CC, "%d\n", key_datum.dsize); - php_stream_flush(dba->fp); - if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) { - return -1; - } - php_stream_printf(dba->fp TSRMLS_CC, "%d\n", value_datum.dsize); - if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) { - return -1; - } - } - - php_stream_flush(dba->fp); - return 0; -} -/* }}} */ - -/* {{{ flatfile_fetch - */ -datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) { - datum value_datum = {NULL, 0}; - char buf[16]; - - if (flatfile_findkey(dba, key_datum TSRMLS_CC)) { - if (php_stream_gets(dba->fp, buf, sizeof(buf))) { - value_datum.dsize = atoi(buf); - value_datum.dptr = safe_emalloc(value_datum.dsize, 1, 1); - value_datum.dsize = php_stream_read(dba->fp, value_datum.dptr, value_datum.dsize); - } else { - value_datum.dptr = NULL; - value_datum.dsize = 0; - } - } - return value_datum; -} -/* }}} */ - -/* {{{ flatfile_delete - */ -int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) { - char *key = key_datum.dptr; - size_t size = key_datum.dsize; - size_t buf_size = FLATFILE_BLOCK_SIZE; - char *buf = emalloc(buf_size); - size_t num; - size_t pos; - - php_stream_rewind(dba->fp); - while(!php_stream_eof(dba->fp)) { - /* read in the length of the key name */ - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - pos = php_stream_tell(dba->fp); - - /* read in the key name */ - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - - if (size == num && !memcmp(buf, key, size)) { - php_stream_seek(dba->fp, pos, SEEK_SET); - php_stream_putc(dba->fp, 0); - php_stream_flush(dba->fp); - php_stream_seek(dba->fp, 0L, SEEK_END); - efree(buf); - return SUCCESS; - } - - /* read in the length of the value */ - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - /* read in the value */ - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - } - efree(buf); - return FAILURE; -} -/* }}} */ - -/* {{{ flatfile_findkey - */ -int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) { - size_t buf_size = FLATFILE_BLOCK_SIZE; - char *buf = emalloc(buf_size); - size_t num; - int ret=0; - void *key = key_datum.dptr; - size_t size = key_datum.dsize; - - php_stream_rewind(dba->fp); - while (!php_stream_eof(dba->fp)) { - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - if (size == num) { - if (!memcmp(buf, key, size)) { - ret = 1; - break; - } - } - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - } - efree(buf); - return ret; -} -/* }}} */ - -/* {{{ flatfile_firstkey - */ -datum flatfile_firstkey(flatfile *dba TSRMLS_DC) { - datum res; - size_t num; - size_t buf_size = FLATFILE_BLOCK_SIZE; - char *buf = emalloc(buf_size); - - php_stream_rewind(dba->fp); - while(!php_stream_eof(dba->fp)) { - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - if (*(buf) != 0) { - dba->CurrentFlatFilePos = php_stream_tell(dba->fp); - res.dptr = buf; - res.dsize = num; - return res; - } - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - } - efree(buf); - res.dptr = NULL; - res.dsize = 0; - return res; -} -/* }}} */ - -/* {{{ flatfile_nextkey - */ -datum flatfile_nextkey(flatfile *dba TSRMLS_DC) { - datum res; - size_t num; - size_t buf_size = FLATFILE_BLOCK_SIZE; - char *buf = emalloc(buf_size); - - php_stream_seek(dba->fp, dba->CurrentFlatFilePos, SEEK_SET); - while(!php_stream_eof(dba->fp)) { - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - if (!php_stream_gets(dba->fp, buf, 15)) { - break; - } - num = atoi(buf); - if (num >= buf_size) { - buf_size = num + FLATFILE_BLOCK_SIZE; - buf = erealloc(buf, buf_size); - } - num = php_stream_read(dba->fp, buf, num); - if (num < 0) { - break; - } - if (*(buf)!=0) { - dba->CurrentFlatFilePos = php_stream_tell(dba->fp); - res.dptr = buf; - res.dsize = num; - return res; - } - } - efree(buf); - res.dptr = NULL; - res.dsize = 0; - return res; -} -/* }}} */ - -/* {{{ flatfile_version */ -char *flatfile_version() -{ - return "1.0, $Revision$"; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h deleted file mode 100644 index 93c2361069aa3..0000000000000 --- a/ext/dba/libflatfile/flatfile.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_LIB_FLATFILE_H -#define PHP_LIB_FLATFILE_H - -typedef struct { - char *dptr; - size_t dsize; -} datum; - -typedef struct { - char *lockfn; - int lockfd; - php_stream *fp; - size_t CurrentFlatFilePos; - datum nextkey; -} flatfile; - -#define FLATFILE_INSERT 1 -#define FLATFILE_REPLACE 0 - -int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC); -datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC); -int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC); -int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC); -datum flatfile_firstkey(flatfile *dba TSRMLS_DC); -datum flatfile_nextkey(flatfile *dba TSRMLS_DC); -char *flatfile_version(); - -#endif diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c deleted file mode 100644 index e5b2940a48836..0000000000000 --- a/ext/dba/libinifile/inifile.c +++ /dev/null @@ -1,594 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "safe_mode.h" - -#include -#include -#include -#if HAVE_UNISTD_H -#include -#endif - -#include "inifile.h" - -/* ret = -1 means that database was opened for read-only - * ret = 0 success - * ret = 1 key already exists - nothing done - */ - -/* {{{ inifile_version */ -char *inifile_version() -{ - return "1.0, $Revision$"; -} -/* }}} */ - -/* {{{ inifile_free_key */ -void inifile_key_free(key_type *key) -{ - if (key->group) { - efree(key->group); - } - if (key->name) { - efree(key->name); - } - memset(key, 0, sizeof(key_type)); -} -/* }}} */ - -/* {{{ inifile_free_val */ -void inifile_val_free(val_type *val) -{ - if (val->value) { - efree(val->value); - } - memset(val, 0, sizeof(val_type)); -} -/* }}} */ - -/* {{{ inifile_free_val */ -void inifile_line_free(line_type *ln) -{ - inifile_key_free(&ln->key); - inifile_val_free(&ln->val); - ln->pos = 0; -} -/* }}} */ - -/* {{{ inifile_alloc */ -inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC) -{ - inifile *dba; - - if (!readonly) { - if (!php_stream_truncate_supported(fp)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream"); - return NULL; - } - } - - dba = pemalloc(sizeof(inifile), persistent); - memset(dba, 0, sizeof(inifile)); - dba->fp = fp; - dba->readonly = readonly; - return dba; -} -/* }}} */ - -/* {{{ inifile_free */ -void inifile_free(inifile *dba, int persistent) -{ - if (dba) { - inifile_line_free(&dba->curr); - inifile_line_free(&dba->next); - pefree(dba, persistent); - } -} -/* }}} */ - -/* {{{ inifile_key_split */ -key_type inifile_key_split(const char *group_name) -{ - key_type key; - char *name; - - if (group_name[0] == '[' && (name = strchr(group_name, ']')) != NULL) { - key.group = estrndup(group_name+1, name - (group_name + 1)); - key.name = estrdup(name+1); - } else { - key.group = estrdup(""); - key.name = estrdup(group_name); - } - return key; -} -/* }}} */ - -/* {{{ inifile_key_string */ -char * inifile_key_string(const key_type *key) -{ - if (key->group && *key->group) { - char *result; - spprintf(&result, 0, "[%s]%s", key->group, key->name ? key->name : ""); - return result; - } else if (key->name) { - return estrdup(key->name); - } else { - return NULL; - } -} -/* }}} */ - -/* {{{ etrim */ -static char *etrim(const char *str) -{ - char *val; - size_t l; - - if (!str) { - return NULL; - } - val = (char*)str; - while (*val && strchr(" \t\r\n", *val)) { - val++; - } - l = strlen(val); - while (l && (strchr(" \t\r\n", val[l-1]))) { - l--; - } - return estrndup(val, l); -} -/* }}} */ - -/* {{{ inifile_findkey - */ -static int inifile_read(inifile *dba, line_type *ln TSRMLS_DC) { - char *fline; - char *pos; - - inifile_val_free(&ln->val); - while ((fline = php_stream_gets(dba->fp, NULL, 0)) != NULL) { - if (fline) { - if (fline[0] == '[') { - /* A value name cannot start with '[' - * So either we find a ']' or we found an error - */ - pos = strchr(fline+1, ']'); - if (pos) { - *pos = '\0'; - inifile_key_free(&ln->key); - ln->key.group = etrim(fline+1); - ln->key.name = estrdup(""); - ln->pos = php_stream_tell(dba->fp); - efree(fline); - return 1; - } else { - efree(fline); - continue; - } - } else { - pos = strchr(fline, '='); - if (pos) { - *pos = '\0'; - /* keep group or make empty if not existent */ - if (!ln->key.group) { - ln->key.group = estrdup(""); - } - if (ln->key.name) { - efree(ln->key.name); - } - ln->key.name = etrim(fline); - ln->val.value = etrim(pos+1); - ln->pos = php_stream_tell(dba->fp); - efree(fline); - return 1; - } else { - /* simply ignore lines without '=' - * those should be comments - */ - efree(fline); - continue; - } - } - } - } - inifile_line_free(ln); - return 0; -} -/* }}} */ - -/* {{{ inifile_key_cmp */ -/* 0 = EQUAL - * 1 = GROUP-EQUAL,NAME-DIFFERENT - * 2 = DIFFERENT - */ -static int inifile_key_cmp(const key_type *k1, const key_type *k2 TSRMLS_DC) -{ - assert(k1->group && k1->name && k2->group && k2->name); - - if (!strcasecmp(k1->group, k2->group)) { - if (!strcasecmp(k1->name, k2->name)) { - return 0; - } else { - return 1; - } - } else { - return 2; - } -} -/* }}} */ - -/* {{{ inifile_fetch - */ -val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) { - line_type ln = {{NULL,NULL},{NULL}}; - val_type val; - int res, grp_eq = 0; - - if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key TSRMLS_CC)) { - /* we got position already from last fetch */ - php_stream_seek(dba->fp, dba->next.pos, SEEK_SET); - } else { - /* specific instance or not same key -> restart search */ - /* the slow way: restart and seacrch */ - php_stream_rewind(dba->fp); - inifile_line_free(&dba->next); - } - if (skip == -1) { - skip = 0; - } - while(inifile_read(dba, &ln TSRMLS_CC)) { - if (!(res=inifile_key_cmp(&ln.key, key TSRMLS_CC))) { - if (!skip) { - val.value = estrdup(ln.val.value ? ln.val.value : ""); - /* allow faster access by updating key read into next */ - inifile_line_free(&dba->next); - dba->next = ln; - dba->next.pos = php_stream_tell(dba->fp); - return val; - } - skip--; - } else if (res == 1) { - grp_eq = 1; - } else if (grp_eq) { - /* we are leaving group now: that means we cannot find the key */ - break; - } - } - inifile_line_free(&ln); - dba->next.pos = php_stream_tell(dba->fp); - return ln.val; -} -/* }}} */ - -/* {{{ inifile_firstkey - */ -int inifile_firstkey(inifile *dba TSRMLS_DC) { - inifile_line_free(&dba->curr); - dba->curr.pos = 0; - return inifile_nextkey(dba TSRMLS_CC); -} -/* }}} */ - -/* {{{ inifile_nextkey - */ -int inifile_nextkey(inifile *dba TSRMLS_DC) { - line_type ln = {{NULL,NULL},{NULL}}; - - /*inifile_line_free(&dba->next); ??? */ - php_stream_seek(dba->fp, dba->curr.pos, SEEK_SET); - ln.key.group = estrdup(dba->curr.key.group ? dba->curr.key.group : ""); - inifile_read(dba, &ln TSRMLS_CC); - inifile_line_free(&dba->curr); - dba->curr = ln; - return ln.key.group || ln.key.name; -} -/* }}} */ - -/* {{{ inifile_truncate - */ -static int inifile_truncate(inifile *dba, size_t size TSRMLS_DC) -{ - int res; - - if ((res=php_stream_truncate_set_size(dba->fp, size)) != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in ftruncate: %d", res); - return FAILURE; - } - php_stream_seek(dba->fp, size, SEEK_SET); - return SUCCESS; -} -/* }}} */ - -/* {{{ inifile_find_group - * if found pos_grp_start points to "[group_name]" - */ -static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC) -{ - int ret = FAILURE; - - php_stream_flush(dba->fp); - php_stream_seek(dba->fp, 0, SEEK_SET); - inifile_line_free(&dba->curr); - inifile_line_free(&dba->next); - - if (key->group && strlen(key->group)) { - int res; - line_type ln = {{NULL,NULL},{NULL}}; - - res = 1; - while(inifile_read(dba, &ln TSRMLS_CC)) { - if ((res=inifile_key_cmp(&ln.key, key TSRMLS_CC)) < 2) { - ret = SUCCESS; - break; - } - *pos_grp_start = php_stream_tell(dba->fp); - } - inifile_line_free(&ln); - } else { - *pos_grp_start = 0; - ret = SUCCESS; - } - if (ret == FAILURE) { - *pos_grp_start = php_stream_tell(dba->fp); - } - return ret; -} -/* }}} */ - -/* {{{ inifile_next_group - * only valid after a call to inifile_find_group - * if any next group is found pos_grp_start points to "[group_name]" or whitespace before that - */ -static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC) -{ - int ret = FAILURE; - line_type ln = {{NULL,NULL},{NULL}}; - - *pos_grp_start = php_stream_tell(dba->fp); - ln.key.group = estrdup(key->group); - while(inifile_read(dba, &ln TSRMLS_CC)) { - if (inifile_key_cmp(&ln.key, key TSRMLS_CC) == 2) { - ret = SUCCESS; - break; - } - *pos_grp_start = php_stream_tell(dba->fp); - } - inifile_line_free(&ln); - return ret; -} -/* }}} */ - -/* {{{ inifile_copy_to - */ -static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifile **ini_copy TSRMLS_DC) -{ - php_stream *fp; - - if (pos_start == pos_end) { - *ini_copy = NULL; - return SUCCESS; - } - if ((fp = php_stream_temp_create(0, 64 * 1024)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream"); - *ini_copy = NULL; - return FAILURE; - } - - if ((*ini_copy = inifile_alloc(fp, 1, 0 TSRMLS_CC)) == NULL) { - /* writes error */ - return FAILURE; - } - php_stream_seek(dba->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream(dba->fp, fp, pos_end - pos_start)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end); - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ inifile_filter - * copy from to dba while ignoring key name (group must equal) - */ -static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRMLS_DC) -{ - size_t pos_start = 0, pos_next = 0, pos_curr; - int ret = SUCCESS; - line_type ln = {{NULL,NULL},{NULL}}; - - php_stream_seek(from->fp, 0, SEEK_SET); - php_stream_seek(dba->fp, 0, SEEK_END); - while(inifile_read(from, &ln TSRMLS_CC)) { - switch(inifile_key_cmp(&ln.key, key TSRMLS_CC)) { - case 0: - pos_curr = php_stream_tell(from->fp); - if (pos_start != pos_next) { - php_stream_seek(from->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream(from->fp, dba->fp, pos_next - pos_start)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); - ret = FAILURE; - } - php_stream_seek(from->fp, pos_curr, SEEK_SET); - } - pos_next = pos_start = pos_curr; - break; - case 1: - pos_next = php_stream_tell(from->fp); - break; - case 2: - /* the function is meant to process only entries from same group */ - assert(0); - break; - } - } - if (pos_start != pos_next) { - php_stream_seek(from->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream(from->fp, dba->fp, pos_next - pos_start)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); - ret = FAILURE; - } - } - inifile_line_free(&ln); - return SUCCESS; -} -/* }}} */ - -/* {{{ inifile_delete_replace_append - */ -static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC) -{ - size_t pos_grp_start, pos_grp_next; - inifile *ini_tmp = NULL; - php_stream *fp_tmp = NULL; - int ret; - - /* 1) Search group start - * 2) Search next group - * 3) If not append: Copy group to ini_tmp - * 4) Open temp_stream and copy remainder - * 5) Truncate stream - * 6) If not append AND key.name given: Filtered copy back from ini_tmp - * to stream. Otherwise the user wanted to delete the group. - * 7) Append value if given - * 8) Append temporary stream - */ - - assert(!append || (key->name && value)); /* missuse */ - - /* 1 - 3 */ - inifile_find_group(dba, key, &pos_grp_start TSRMLS_CC); - inifile_next_group(dba, key, &pos_grp_next TSRMLS_CC); - if (append) { - ret = SUCCESS; - } else { - ret = inifile_copy_to(dba, pos_grp_start, pos_grp_next, &ini_tmp TSRMLS_CC); - } - - /* 4 */ - if (ret == SUCCESS) { - fp_tmp = php_stream_temp_create(0, 64 * 1024); - if (!fp_tmp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream"); - ret = FAILURE; - } else { - php_stream_seek(dba->fp, 0, SEEK_END); - if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) { - php_stream_seek(dba->fp, pos_grp_next, SEEK_SET); - if (!php_stream_copy_to_stream(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream"); - ret = FAILURE; - } - } - } - } - - /* 5 */ - if (ret == SUCCESS) { - if (!value || (key->name && strlen(key->name))) { - ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start TSRMLS_CC); /* writes error on fail */ - } - } - - if (ret == SUCCESS) { - if (key->name && strlen(key->name)) { - /* 6 */ - if (!append && ini_tmp) { - ret = inifile_filter(dba, ini_tmp, key TSRMLS_CC); - } - - /* 7 */ - /* important: do not query ret==SUCCESS again: inifile_filter might fail but - * however next operation must be done. - */ - if (value) { - if (pos_grp_start == pos_grp_next && key->group && strlen(key->group)) { - php_stream_printf(dba->fp TSRMLS_CC, "[%s]\n", key->group); - } - php_stream_printf(dba->fp TSRMLS_CC, "%s=%s\n", key->name, value->value ? value->value : ""); - } - } - - /* 8 */ - /* important: do not query ret==SUCCESS again: inifile_filter might fail but - * however next operation must be done. - */ - if (fp_tmp && php_stream_tell(fp_tmp)) { - php_stream_seek(fp_tmp, 0, SEEK_SET); - php_stream_seek(dba->fp, 0, SEEK_END); - if (!php_stream_copy_to_stream(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL)) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated"); - ret = FAILURE; - } - } - } - - if (ini_tmp) { - php_stream_close(ini_tmp->fp); - inifile_free(ini_tmp, 0); - } - if (fp_tmp) { - php_stream_close(fp_tmp); - } - php_stream_flush(dba->fp); - php_stream_seek(dba->fp, 0, SEEK_SET); - - return ret; -} -/* }}} */ - -/* {{{ inifile_delete - */ -int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC) -{ - return inifile_delete_replace_append(dba, key, NULL, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ inifile_relace - */ -int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) -{ - return inifile_delete_replace_append(dba, key, value, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ inifile_append - */ -int inifile_append(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) -{ - return inifile_delete_replace_append(dba, key, value, 1 TSRMLS_CC); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h deleted file mode 100644 index 8f620f21c6e6f..0000000000000 --- a/ext/dba/libinifile/inifile.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_LIB_INIFILE_H -#define PHP_LIB_INIFILE_H - -typedef struct { - char *group; - char *name; -} key_type; - -typedef struct { - char *value; -} val_type; - -typedef struct { - key_type key; - val_type val; - size_t pos; -} line_type; - -typedef struct { - char *lockfn; - int lockfd; - php_stream *fp; - int readonly; - line_type curr; - line_type next; -} inifile; - -val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC); -int inifile_firstkey(inifile *dba TSRMLS_DC); -int inifile_nextkey(inifile *dba TSRMLS_DC); -int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC); -int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); -int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); -char *inifile_version(); - -key_type inifile_key_split(const char *group_name); -char * inifile_key_string(const key_type *key); - -void inifile_key_free(key_type *key); -void inifile_val_free(val_type *val); -void inifile_line_free(line_type *ln); - -inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC); -void inifile_free(inifile *dba, int persistent); - -#endif diff --git a/ext/dba/php_cdb.h b/ext/dba/php_cdb.h deleted file mode 100644 index a046f0796b378..0000000000000 --- a/ext/dba/php_cdb.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_CDB_H -#define PHP_CDB_H - -#if DBA_CDB - -#include "php_dba.h" - -DBA_FUNCS(cdb); - -#endif - -#endif diff --git a/ext/dba/php_db1.h b/ext/dba/php_db1.h deleted file mode 100755 index c0bb5f08b4b6c..0000000000000 --- a/ext/dba/php_db1.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB1_H -#define PHP_DB1_H - -#if DBA_DB1 - -#include "php_dba.h" - -DBA_FUNCS(db1); - -#endif - -#endif diff --git a/ext/dba/php_db2.h b/ext/dba/php_db2.h deleted file mode 100644 index 2a95223a85442..0000000000000 --- a/ext/dba/php_db2.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB2_H -#define PHP_DB2_H - -#if DBA_DB2 - -#include "php_dba.h" - -DBA_FUNCS(db2); - -#endif - -#endif diff --git a/ext/dba/php_db3.h b/ext/dba/php_db3.h deleted file mode 100644 index 58bb0b62a08f7..0000000000000 --- a/ext/dba/php_db3.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB3_H -#define PHP_DB3_H - -#if DBA_DB3 - -#include "php_dba.h" - -DBA_FUNCS(db3); - -#endif - -#endif diff --git a/ext/dba/php_db4.h b/ext/dba/php_db4.h deleted file mode 100644 index fa814c3f5ec4b..0000000000000 --- a/ext/dba/php_db4.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB4_H -#define PHP_DB4_H - -#if DBA_DB4 - -#include "php_dba.h" - -DBA_FUNCS(db4); - -#endif - -#endif diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h deleted file mode 100644 index 8d743ab818ecf..0000000000000 --- a/ext/dba/php_dba.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_DBA_H -#define PHP_DBA_H - -#if HAVE_DBA - -typedef enum { - /* do not allow 0 here */ - DBA_READER = 1, - DBA_WRITER, - DBA_TRUNC, - DBA_CREAT -} dba_mode_t; - -typedef struct dba_lock { - php_stream *fp; - char *name; - int mode; /* LOCK_EX,LOCK_SH */ -} dba_lock; - -typedef struct dba_info { - /* public */ - void *dbf; /* ptr to private data or whatever */ - char *path; - dba_mode_t mode; - php_stream *fp; /* this is the database stream for builtin handlers */ - int fd; - /* arg[cv] are only available when the dba_open handler is called! */ - int argc; - zval ***argv; - /* private */ - int flags; /* whether and how dba did locking and other flags*/ - struct dba_handler *hnd; - dba_lock lock; -} dba_info; - -#define DBA_LOCK_READER (0x0001) -#define DBA_LOCK_WRITER (0x0002) -#define DBA_LOCK_CREAT (0x0004) -#define DBA_LOCK_TRUNC (0x0008) - -#define DBA_LOCK_EXT (0) -#define DBA_LOCK_ALL (DBA_LOCK_READER|DBA_LOCK_WRITER|DBA_LOCK_CREAT|DBA_LOCK_TRUNC) -#define DBA_LOCK_WCT (DBA_LOCK_WRITER|DBA_LOCK_CREAT|DBA_LOCK_TRUNC) - -#define DBA_STREAM_OPEN (0x0010) -#define DBA_PERSISTENT (0x0020) - -#define DBA_CAST_AS_FD (0x0050) -#define DBA_NO_APPEND (0x00D0) - -extern zend_module_entry dba_module_entry; -#define dba_module_ptr &dba_module_entry - -typedef struct dba_handler { - char *name; /* handler name */ - int flags; /* whether and how dba does locking and other flags*/ - int (*open)(dba_info *, char **error TSRMLS_DC); - void (*close)(dba_info * TSRMLS_DC); - char* (*fetch)(dba_info *, char *, int, int, int * TSRMLS_DC); - int (*update)(dba_info *, char *, int, char *, int, int TSRMLS_DC); - int (*exists)(dba_info *, char *, int TSRMLS_DC); - int (*delete)(dba_info *, char *, int TSRMLS_DC); - char* (*firstkey)(dba_info *, int * TSRMLS_DC); - char* (*nextkey)(dba_info *, int * TSRMLS_DC); - int (*optimize)(dba_info * TSRMLS_DC); - int (*sync)(dba_info * TSRMLS_DC); - char* (*info)(struct dba_handler *hnd, dba_info * TSRMLS_DC); - /* dba_info==NULL: Handler info, dba_info!=NULL: Database info */ -} dba_handler; - -/* common prototypes which must be supplied by modules */ - -#define DBA_OPEN_FUNC(x) \ - int dba_open_##x(dba_info *info, char **error TSRMLS_DC) -#define DBA_CLOSE_FUNC(x) \ - void dba_close_##x(dba_info *info TSRMLS_DC) -#define DBA_FETCH_FUNC(x) \ - char *dba_fetch_##x(dba_info *info, char *key, int keylen, int skip, int *newlen TSRMLS_DC) -#define DBA_UPDATE_FUNC(x) \ - int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode TSRMLS_DC) -#define DBA_EXISTS_FUNC(x) \ - int dba_exists_##x(dba_info *info, char *key, int keylen TSRMLS_DC) -#define DBA_DELETE_FUNC(x) \ - int dba_delete_##x(dba_info *info, char *key, int keylen TSRMLS_DC) -#define DBA_FIRSTKEY_FUNC(x) \ - char *dba_firstkey_##x(dba_info *info, int *newlen TSRMLS_DC) -#define DBA_NEXTKEY_FUNC(x) \ - char *dba_nextkey_##x(dba_info *info, int *newlen TSRMLS_DC) -#define DBA_OPTIMIZE_FUNC(x) \ - int dba_optimize_##x(dba_info *info TSRMLS_DC) -#define DBA_SYNC_FUNC(x) \ - int dba_sync_##x(dba_info *info TSRMLS_DC) -#define DBA_INFO_FUNC(x) \ - char *dba_info_##x(dba_handler *hnd, dba_info *info TSRMLS_DC) - -#define DBA_FUNCS(x) \ - DBA_OPEN_FUNC(x); \ - DBA_CLOSE_FUNC(x); \ - DBA_FETCH_FUNC(x); \ - DBA_UPDATE_FUNC(x); \ - DBA_DELETE_FUNC(x); \ - DBA_EXISTS_FUNC(x); \ - DBA_FIRSTKEY_FUNC(x); \ - DBA_NEXTKEY_FUNC(x); \ - DBA_OPTIMIZE_FUNC(x); \ - DBA_SYNC_FUNC(x); \ - DBA_INFO_FUNC(x) - -#define VALLEN(p) Z_STRVAL_PP(p), Z_STRLEN_PP(p) - -PHP_FUNCTION(dba_open); -PHP_FUNCTION(dba_popen); -PHP_FUNCTION(dba_close); -PHP_FUNCTION(dba_firstkey); -PHP_FUNCTION(dba_nextkey); -PHP_FUNCTION(dba_replace); -PHP_FUNCTION(dba_insert); -PHP_FUNCTION(dba_delete); -PHP_FUNCTION(dba_exists); -PHP_FUNCTION(dba_fetch); -PHP_FUNCTION(dba_optimize); -PHP_FUNCTION(dba_sync); -PHP_FUNCTION(dba_handlers); -PHP_FUNCTION(dba_list); -PHP_FUNCTION(dba_key_split); - -#else -#define dba_module_ptr NULL -#endif - -#define phpext_dba_ptr dba_module_ptr - -#endif diff --git a/ext/dba/php_dbm.h b/ext/dba/php_dbm.h deleted file mode 100644 index 4c963d18ed91f..0000000000000 --- a/ext/dba/php_dbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DBM_H -#define PHP_DBM_H - -#if DBA_DBM - -#include "php_dba.h" - -DBA_FUNCS(dbm); - -#endif - -#endif diff --git a/ext/dba/php_flatfile.h b/ext/dba/php_flatfile.h deleted file mode 100644 index afa9f6d5d3920..0000000000000 --- a/ext/dba/php_flatfile.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_FLATFILE_H -#define PHP_FLATFILE_H - -#if DBA_FLATFILE - -#include "php_dba.h" - -DBA_FUNCS(flatfile); - -#endif - -#endif diff --git a/ext/dba/php_gdbm.h b/ext/dba/php_gdbm.h deleted file mode 100644 index 3068404cfe265..0000000000000 --- a/ext/dba/php_gdbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_GDBM_H -#define PHP_GDBM_H - -#if DBA_GDBM - -#include "php_dba.h" - -DBA_FUNCS(gdbm); - -#endif - -#endif diff --git a/ext/dba/php_inifile.h b/ext/dba/php_inifile.h deleted file mode 100644 index 69444df3c6d48..0000000000000 --- a/ext/dba/php_inifile.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_INIFILE_H -#define PHP_INIFILE_H - -#if DBA_INIFILE - -#include "php_dba.h" - -DBA_FUNCS(inifile); - -#endif - -#endif diff --git a/ext/dba/php_ndbm.h b/ext/dba/php_ndbm.h deleted file mode 100644 index b1ebf15af32d7..0000000000000 --- a/ext/dba/php_ndbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_NDBM_H -#define PHP_NDBM_H - -#if DBA_NDBM - -#include "php_dba.h" - -DBA_FUNCS(ndbm); - -#endif - -#endif diff --git a/ext/dba/php_qdbm.h b/ext/dba/php_qdbm.h deleted file mode 100644 index c88efcff4cfa1..0000000000000 --- a/ext/dba/php_qdbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_QDBM_H -#define PHP_QDBM_H - -#if DBA_QDBM - -#include "php_dba.h" - -DBA_FUNCS(qdbm); - -#endif - -#endif diff --git a/ext/dba/tests/bug36436.phpt b/ext/dba/tests/bug36436.phpt deleted file mode 100755 index 60470660e8fac..0000000000000 --- a/ext/dba/tests/bug36436.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #36436 (DBA problem with Berkeley DB4) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -resource(%d) of type (dba persistent) -string(3) "XYZ" -string(1) "X" -string(1) "Y" -===DONE=== diff --git a/ext/dba/tests/dba001.phpt b/ext/dba/tests/dba001.phpt deleted file mode 100644 index 3d617fb2c231f..0000000000000 --- a/ext/dba/tests/dba001.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -DBA File Creation Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -database file created \ No newline at end of file diff --git a/ext/dba/tests/dba002.phpt b/ext/dba/tests/dba002.phpt deleted file mode 100644 index 3f862e38c5107..0000000000000 --- a/ext/dba/tests/dba002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -DBA Insert/Fetch Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -This is a test insert diff --git a/ext/dba/tests/dba003.phpt b/ext/dba/tests/dba003.phpt deleted file mode 100644 index 617ae91891ef6..0000000000000 --- a/ext/dba/tests/dba003.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -DBA Insert/Replace/Fetch Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -This is the replacement text diff --git a/ext/dba/tests/dba004.phpt b/ext/dba/tests/dba004.phpt deleted file mode 100644 index 3b1f29c7dd6e2..0000000000000 --- a/ext/dba/tests/dba004.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -DBA Multiple Insert/Fetch Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -Another Content String Content String 2 diff --git a/ext/dba/tests/dba005.phpt b/ext/dba/tests/dba005.phpt deleted file mode 100644 index 5a933c48f984b..0000000000000 --- a/ext/dba/tests/dba005.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -DBA FirstKey/NextKey Loop Test With 5 Items ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -5YYYYY diff --git a/ext/dba/tests/dba006.phpt b/ext/dba/tests/dba006.phpt deleted file mode 100644 index efa36a5d0709b..0000000000000 --- a/ext/dba/tests/dba006.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -DBA FirstKey/NextKey with 2 deletes ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -3NYNYY \ No newline at end of file diff --git a/ext/dba/tests/dba007.phpt b/ext/dba/tests/dba007.phpt deleted file mode 100644 index cc84a729c3245..0000000000000 --- a/ext/dba/tests/dba007.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -DBA Multiple File Creation Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -database file created -database file created -database file created -array(3) { - [%d]=> - string(%d) "%stest0.dbm" - [%d]=> - string(%d) "%stest1.dbm" - [%d]=> - string(%d) "%stest2.dbm" -} diff --git a/ext/dba/tests/dba008.phpt b/ext/dba/tests/dba008.phpt deleted file mode 100644 index 84a47ba0836f7..0000000000000 --- a/ext/dba/tests/dba008.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -DBA magic_quotes_runtime Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -string(1) """ -string(2) "\"" -string(2) "\"" -string(1) """ diff --git a/ext/dba/tests/dba009.phpt b/ext/dba/tests/dba009.phpt deleted file mode 100755 index 50a50c6bd5a08..0000000000000 --- a/ext/dba/tests/dba009.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -DBA dba_popen Test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -database handler: %s -Opened -Inserted -Closed -Opened -Inserted diff --git a/ext/dba/tests/dba_cdb.phpt b/ext/dba/tests/dba_cdb.phpt deleted file mode 100644 index f3bf7975ea06c..0000000000000 --- a/ext/dba/tests/dba_cdb.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -DBA CDB handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: cdb -5YYYYY -Content String 2 -array(5) { - ["key1"]=> - string(16) "Content String 1" - ["key2"]=> - string(16) "Content String 2" - ["key3"]=> - string(20) "Third Content String" - ["key4"]=> - string(22) "Another Content String" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -5YYYYY -Content String 2 -array(5) { - ["key1"]=> - string(16) "Content String 1" - ["key2"]=> - string(16) "Content String 2" - ["key3"]=> - string(20) "Third Content String" - ["key4"]=> - string(22) "Another Content String" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_cdb_make.phpt b/ext/dba/tests/dba_cdb_make.phpt deleted file mode 100644 index 04df9252d800b..0000000000000 --- a/ext/dba/tests/dba_cdb_make.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -DBA CDB_MAKE handler test ---INI-- -magic_quotes_runtime=1 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -database handler: cdb_make -string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5" -string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5" \ No newline at end of file diff --git a/ext/dba/tests/dba_cdb_read.phpt b/ext/dba/tests/dba_cdb_read.phpt deleted file mode 100644 index a0fbe7bccaee2..0000000000000 --- a/ext/dba/tests/dba_cdb_read.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -DBA CDB handler test (read only) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -database handler: cdb -7YYYYNNN -=1234 -#1122 -?1212314 -#1212314 -=1231324 \ No newline at end of file diff --git a/ext/dba/tests/dba_db1.phpt b/ext/dba/tests/dba_db1.phpt deleted file mode 100755 index 983954b50b165..0000000000000 --- a/ext/dba/tests/dba_db1.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DB1 handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: db1 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_db2.phpt b/ext/dba/tests/dba_db2.phpt deleted file mode 100644 index bcc5a9479306c..0000000000000 --- a/ext/dba/tests/dba_db2.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DB2 handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: db2 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_db3.phpt b/ext/dba/tests/dba_db3.phpt deleted file mode 100644 index c6d04cf02d084..0000000000000 --- a/ext/dba/tests/dba_db3.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DB3 handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: db3 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_db4.phpt b/ext/dba/tests/dba_db4.phpt deleted file mode 100644 index fcf089a1e90b0..0000000000000 --- a/ext/dba/tests/dba_db4.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DB4 handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: db4 -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_dbm.phpt b/ext/dba/tests/dba_dbm.phpt deleted file mode 100644 index fdd7b375f4457..0000000000000 --- a/ext/dba/tests/dba_dbm.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA DBM handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: dbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_flatfile.phpt b/ext/dba/tests/dba_flatfile.phpt deleted file mode 100644 index 2e32b8a327815..0000000000000 --- a/ext/dba/tests/dba_flatfile.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA FlatFile handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: flatfile -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_gdbm.phpt b/ext/dba/tests/dba_gdbm.phpt deleted file mode 100644 index f9b3e3c6067ad..0000000000000 --- a/ext/dba/tests/dba_gdbm.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -DBA GDBM handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -database handler: gdbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write:%sallowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc deleted file mode 100644 index 1c3f5127ef384..0000000000000 --- a/ext/dba/tests/dba_handler.inc +++ /dev/null @@ -1,90 +0,0 @@ - \ No newline at end of file diff --git a/ext/dba/tests/dba_inifile.phpt b/ext/dba/tests/dba_inifile.phpt deleted file mode 100644 index 9511a8bb49b5f..0000000000000 --- a/ext/dba/tests/dba_inifile.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA INIFILE handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: inifile -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_ndbm.phpt b/ext/dba/tests/dba_ndbm.phpt deleted file mode 100644 index f7955c5813ecd..0000000000000 --- a/ext/dba/tests/dba_ndbm.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DBA NDBM handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -database handler: ndbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} ---NO-LOCK-- -3NYNYY -Content String 2 -Content 2 replaced -Read during write: not allowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} -===DONE=== diff --git a/ext/dba/tests/dba_qdbm.phpt b/ext/dba/tests/dba_qdbm.phpt deleted file mode 100755 index a7c9ab69e13af..0000000000000 --- a/ext/dba/tests/dba_qdbm.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -DBA QDBM handler test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -database handler: qdbm -3NYNYY -Content String 2 -Content 2 replaced -Read during write:%sallowed -Content 2 replaced 2nd time -The 6th value -array(3) { - ["key number 6"]=> - string(13) "The 6th value" - ["key2"]=> - string(27) "Content 2 replaced 2nd time" - ["key5"]=> - string(23) "The last content string" -} - -Warning: dba_popen(%stest0.dbm,r-): Locking cannot be disabled for handler qdbm in %sdba_handler.inc on line %d -===DONE=== diff --git a/ext/dba/tests/skipif.inc b/ext/dba/tests/skipif.inc deleted file mode 100644 index e75000fafdeda..0000000000000 --- a/ext/dba/tests/skipif.inc +++ /dev/null @@ -1,23 +0,0 @@ - diff --git a/ext/dba/tests/test.cdb b/ext/dba/tests/test.cdb deleted file mode 100644 index 21529c6280e74..0000000000000 Binary files a/ext/dba/tests/test.cdb and /dev/null differ diff --git a/ext/dba/tests/test.inc b/ext/dba/tests/test.inc deleted file mode 100644 index 04f954541c553..0000000000000 --- a/ext/dba/tests/test.inc +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/ext/dbase/CREDITS b/ext/dbase/CREDITS deleted file mode 100644 index ea6adcaf41d17..0000000000000 --- a/ext/dbase/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -dBase -Jim Winstead diff --git a/ext/dbase/config.m4 b/ext/dbase/config.m4 deleted file mode 100644 index 84202b320c5da..0000000000000 --- a/ext/dbase/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(dbase,whether to enable dbase support, -[ --enable-dbase Enable the bundled dbase library]) - -if test "$PHP_DBASE" = "yes"; then - AC_DEFINE(DBASE,1,[ ]) - PHP_NEW_EXTENSION(dbase, dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c, $ext_shared) -fi diff --git a/ext/dbase/config.w32 b/ext/dbase/config.w32 deleted file mode 100644 index 4a424a9926bbe..0000000000000 --- a/ext/dbase/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("dbase", "Enable the bundled dbase library", "no"); - -if (PHP_DBASE != "no") { - EXTENSION("dbase", "dbase.c dbf_head.c dbf_misc.c dbf_ndx.c dbf_rec.c"); - AC_DEFINE('HAVE_DBASE', 1, 'dbase support'); - ADD_FLAG("CFLAGS_DBASE", "/D DBASE=1"); -} diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c deleted file mode 100644 index f23a0d510b473..0000000000000 --- a/ext/dbase/dbase.c +++ /dev/null @@ -1,945 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "safe_mode.h" -#include "fopen_wrappers.h" -#include "php_globals.h" - -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#if DBASE -#include "php_dbase.h" -#include "dbf.h" -#if defined(THREAD_SAFE) -DWORD DbaseTls; -static int numthreads=0; -void *dbase_mutex; - -typedef struct dbase_global_struct{ - int le_dbhead; -}dbase_global_struct; - -#define DBase_GLOBAL(a) dbase_globals->a - -#define DBase_TLS_VARS \ - dbase_global_struct *dbase_globals; \ - dbase_globals=TlsGetValue(DbaseTls); - -#else -static int le_dbhead; -#define DBase_GLOBAL(a) a -#define DBase_TLS_VARS -#endif - -#include -#include - - -static void _close_dbase(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - dbhead_t *dbhead = (dbhead_t *)rsrc->ptr; - - close(dbhead->db_fd); - free_dbf_head(dbhead); -} - - -PHP_MINIT_FUNCTION(dbase) -{ -#if defined(THREAD_SAFE) - dbase_global_struct *dbase_globals; -#ifdef COMPILE_DL_DBASE - CREATE_MUTEX(dbase_mutex, "DBase_TLS"); - SET_MUTEX(dbase_mutex); - numthreads++; - if (numthreads==1){ - if ((DbaseTls=TlsAlloc())==0xFFFFFFFF){ - FREE_MUTEX(dbase_mutex); - return 0; - }} - FREE_MUTEX(dbase_mutex); -#endif - dbase_globals = (dbase_global_struct *) LocalAlloc(LPTR, sizeof(dbase_global_struct)); - TlsSetValue(DbaseTls, (void *) dbase_globals); -#endif - DBase_GLOBAL(le_dbhead) = - zend_register_list_destructors_ex(_close_dbase, NULL, "dbase", module_number); - return SUCCESS; -} - -static PHP_MSHUTDOWN_FUNCTION(dbase) -{ -#if defined(THREAD_SAFE) - dbase_global_struct *dbase_globals; - dbase_globals = TlsGetValue(DbaseTls); - if (dbase_globals != 0) - LocalFree((HLOCAL) dbase_globals); -#ifdef COMPILE_DL_DBASE - SET_MUTEX(dbase_mutex); - numthreads--; - if (!numthreads){ - if (!TlsFree(DbaseTls)){ - FREE_MUTEX(dbase_mutex); - return 0; - }} - FREE_MUTEX(dbase_mutex); -#endif -#endif - return SUCCESS; -} - -/* {{{ proto int dbase_open(string name, int mode) - Opens a dBase-format database file */ -PHP_FUNCTION(dbase_open) -{ - zval **dbf_name, **options; - dbhead_t *dbh; - int handle; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dbf_name, &options) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(dbf_name); - convert_to_long_ex(options); - - if (!Z_STRLEN_PP(dbf_name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The filename cannot be empty."); - RETURN_FALSE; - } - - if (Z_LVAL_PP(options) == 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open %s in write-only mode", Z_STRVAL_PP(dbf_name)); - RETURN_FALSE; - } else if (Z_LVAL_PP(options) < 0 || Z_LVAL_PP(options) > 3) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid access mode %ld", Z_LVAL_PP(options)); - RETURN_FALSE; - } - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(dbf_name), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_PP(dbf_name) TSRMLS_CC)) { - RETURN_FALSE; - } - - dbh = dbf_open(Z_STRVAL_PP(dbf_name), Z_LVAL_PP(options) TSRMLS_CC); - if (dbh == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to open database %s", Z_STRVAL_PP(dbf_name)); - RETURN_FALSE; - } - - handle = zend_list_insert(dbh, DBase_GLOBAL(le_dbhead)); - RETURN_LONG(handle); -} -/* }}} */ - -/* {{{ proto bool dbase_close(int identifier) - Closes an open dBase-format database file */ -PHP_FUNCTION(dbase_close) -{ - zval **dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &dbh_id) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - zend_list_delete(Z_LVAL_PP(dbh_id)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int dbase_numrecords(int identifier) - Returns the number of records in the database */ -PHP_FUNCTION(dbase_numrecords) -{ - zval **dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &dbh_id) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - RETURN_LONG(dbh->db_records); -} -/* }}} */ - -/* {{{ proto int dbase_numfields(int identifier) - Returns the number of fields (columns) in the database */ -PHP_FUNCTION(dbase_numfields) -{ - zval **dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &dbh_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - RETURN_LONG(dbh->db_nfields); -} -/* }}} */ - -/* {{{ proto bool dbase_pack(int identifier) - Packs the database (deletes records marked for deletion) */ -PHP_FUNCTION(dbase_pack) -{ - zval **dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &dbh_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - pack_dbf(dbh); - put_dbf_info(dbh); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool dbase_add_record(int identifier, array data) - Adds a record to the database */ -PHP_FUNCTION(dbase_add_record) -{ - zval **dbh_id, **fields, **field; - dbhead_t *dbh; - int dbh_type; - - int num_fields; - dbfield_t *dbf, *cur_f; - char *cp, *t_cp; - int i; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dbh_id, &fields) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - if (Z_TYPE_PP(fields) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected array as second parameter"); - RETURN_FALSE; - } - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - num_fields = zend_hash_num_elements(Z_ARRVAL_PP(fields)); - - if (num_fields != dbh->db_nfields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong number of fields specified"); - RETURN_FALSE; - } - - cp = t_cp = (char *)emalloc(dbh->db_rlen + 1); - *t_cp++ = VALID_RECORD; - - dbf = dbh->db_fields; - for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) { - zval tmp; - if (zend_hash_index_find(Z_ARRVAL_PP(fields), i, (void **)&field) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unexpected error"); - efree(cp); - RETURN_FALSE; - } - - tmp = **field; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - snprintf(t_cp, cur_f->db_flen+1, cur_f->db_format, Z_STRVAL(tmp)); - zval_dtor(&tmp); - t_cp += cur_f->db_flen; - } - - dbh->db_records++; - if (put_dbf_record(dbh, dbh->db_records, cp) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to put record at %ld", dbh->db_records); - efree(cp); - RETURN_FALSE; - } - - put_dbf_info(dbh); - efree(cp); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool dbase_replace_record(int identifier, array data, int recnum) - Replaces a record to the database */ -PHP_FUNCTION(dbase_replace_record) -{ - zval **dbh_id, **fields, **field, **recnum; - dbhead_t *dbh; - int dbh_type; - - int num_fields; - dbfield_t *dbf, *cur_f; - char *cp, *t_cp; - int i; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &dbh_id, &fields, &recnum) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - convert_to_long_ex(recnum); - if (Z_TYPE_PP(fields) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected array as second parameter"); - RETURN_FALSE; - } - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - num_fields = zend_hash_num_elements(Z_ARRVAL_PP(fields)); - - if (num_fields != dbh->db_nfields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong number of fields specified"); - RETURN_FALSE; - } - - cp = t_cp = (char *)emalloc(dbh->db_rlen + 1); - *t_cp++ = VALID_RECORD; - - dbf = dbh->db_fields; - for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) { - if (zend_hash_index_find(Z_ARRVAL_PP(fields), i, (void **)&field) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unexpected error"); - efree(cp); - RETURN_FALSE; - } - convert_to_string_ex(field); - snprintf(t_cp, cur_f->db_flen+1, cur_f->db_format, Z_STRVAL_PP(field)); - t_cp += cur_f->db_flen; - } - - if (put_dbf_record(dbh, Z_LVAL_PP(recnum), cp) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to put record at %ld", dbh->db_records); - efree(cp); - RETURN_FALSE; - } - - put_dbf_info(dbh); - efree(cp); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool dbase_delete_record(int identifier, int record) - Marks a record to be deleted */ -PHP_FUNCTION(dbase_delete_record) -{ - zval **dbh_id, **record; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &dbh_id, &record) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - convert_to_long_ex(record); - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - if (del_dbf_record(dbh, Z_LVAL_PP(record)) < 0) { - if (Z_LVAL_PP(record) > dbh->db_records) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "record %ld out of bounds", Z_LVAL_PP(record)); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to delete record %ld", Z_LVAL_PP(record)); - } - RETURN_FALSE; - } - - put_dbf_info(dbh); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ php_dbase_get_record - */ -static void php_dbase_get_record(INTERNAL_FUNCTION_PARAMETERS, int assoc) -{ - zval **dbh_id, **record; - dbhead_t *dbh; - int dbh_type; - dbfield_t *dbf, *cur_f; - char *data, *fnp, *str_value; - size_t cursize = 0; - long overflow_test; - int errno_save; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &dbh_id, &record) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - convert_to_long_ex(record); - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - if ((data = get_dbf_record(dbh, Z_LVAL_PP(record))) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to read bad record %ld", Z_LVAL_PP(record)); - RETURN_FALSE; - } - - dbf = dbh->db_fields; - - array_init(return_value); - - fnp = NULL; - for (cur_f = dbf; cur_f < &dbf[dbh->db_nfields]; cur_f++) { - /* get the value */ - str_value = (char *)emalloc(cur_f->db_flen + 1); - - if(cursize <= (unsigned)cur_f->db_flen) { - cursize = cur_f->db_flen + 1; - fnp = erealloc(fnp, cursize); - } - snprintf(str_value, cursize, cur_f->db_format, get_field_val(data, cur_f, fnp)); - - /* now convert it to the right php internal type */ - switch (cur_f->db_type) { - case 'C': - case 'D': - if (!assoc) { - add_next_index_string(return_value, str_value, 1); - } else { - add_assoc_string(return_value, cur_f->db_fname, str_value, 1); - } - break; - case 'I': /* FALLS THROUGH */ - case 'N': - if (cur_f->db_fdc == 0) { - /* Large integers in dbase can be larger than long */ - errno_save = errno; - overflow_test = strtol(str_value, NULL, 10); - if (errno == ERANGE) { - /* If the integer is too large, keep it as string */ - if (!assoc) { - add_next_index_string(return_value, str_value, 1); - } else { - add_assoc_string(return_value, cur_f->db_fname, str_value, 1); - } - } else { - if (!assoc) { - add_next_index_long(return_value, overflow_test); - } else { - add_assoc_long(return_value, cur_f->db_fname, overflow_test); - } - } - errno = errno_save; - } else { - if (!assoc) { - add_next_index_double(return_value, atof(str_value)); - } else { - add_assoc_double(return_value, cur_f->db_fname, atof(str_value)); - } - } - break; - case 'F': - if (!assoc) { - add_next_index_double(return_value, atof(str_value)); - } else { - add_assoc_double(return_value, cur_f->db_fname, atof(str_value)); - } - break; - case 'L': /* we used to FALL THROUGH, but now we check for T/Y and F/N - and insert 1 or 0, respectively. db_fdc is the number of - decimals, which we don't care about. 3/14/2001 LEW */ - if ((*str_value == 'T') || (*str_value == 'Y')) { - if (!assoc) { - add_next_index_long(return_value, strtol("1", NULL, 10)); - } else { - add_assoc_long(return_value, cur_f->db_fname,strtol("1", NULL, 10)); - } - } else { - if ((*str_value == 'F') || (*str_value == 'N')) { - if (!assoc) { - add_next_index_long(return_value, strtol("0", NULL, 10)); - } else { - add_assoc_long(return_value, cur_f->db_fname,strtol("0", NULL, 10)); - } - } else { - if (!assoc) { - add_next_index_long(return_value, strtol(" ", NULL, 10)); - } else { - add_assoc_long(return_value, cur_f->db_fname,strtol(" ", NULL, 10)); - } - } - } - break; - case 'M': - /* this is a memo field. don't know how to deal with this yet */ - break; - default: - /* should deal with this in some way */ - break; - } - efree(str_value); - } - - efree(fnp); - - /* mark whether this record was deleted */ - if (data[0] == '*') { - add_assoc_long(return_value, "deleted", 1); - } else { - add_assoc_long(return_value, "deleted", 0); - } - - free(data); -} -/* }}} */ - -/* {{{ proto array dbase_get_record(int identifier, int record) - Returns an array representing a record from the database */ -PHP_FUNCTION(dbase_get_record) -{ - php_dbase_get_record(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* From Martin Kuba */ -/* {{{ proto array dbase_get_record_with_names(int identifier, int record) - Returns an associative array representing a record from the database */ -PHP_FUNCTION(dbase_get_record_with_names) -{ - php_dbase_get_record(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool dbase_create(string filename, array fields) - Creates a new dBase-format database file */ -PHP_FUNCTION(dbase_create) -{ - zval **filename, **fields, **field, **value; - int fd; - dbhead_t *dbh; - - int num_fields; - dbfield_t *dbf, *cur_f; - int i, rlen, handle; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &filename, &fields) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if (Z_TYPE_PP(fields) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected array as second parameter"); - RETURN_FALSE; - } - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(filename), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC)) { - RETURN_FALSE; - } - - if ((fd = VCWD_OPEN_MODE(Z_STRVAL_PP(filename), O_BINARY|O_RDWR|O_CREAT, 0644)) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create database (%d): %s", errno, strerror(errno)); - RETURN_FALSE; - } - - num_fields = zend_hash_num_elements(Z_ARRVAL_PP(fields)); - - if (num_fields <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create database without fields"); - RETURN_FALSE; - } - - /* have to use regular malloc() because this gets free()d by - code in the dbase library */ - dbh = (dbhead_t *)malloc(sizeof(dbhead_t)); - dbf = (dbfield_t *)malloc(sizeof(dbfield_t) * num_fields); - if (!dbh || !dbf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate memory for header info"); - RETURN_FALSE; - } - - /* initialize the header structure */ - dbh->db_fields = dbf; - dbh->db_fd = fd; - dbh->db_dbt = DBH_TYPE_NORMAL; - strcpy(dbh->db_date, "19930818"); - dbh->db_records = 0; - dbh->db_nfields = num_fields; - dbh->db_hlen = sizeof(struct dbf_dhead) + 1 + num_fields * sizeof(struct dbf_dfield); - - rlen = 1; - /** - * Patch by greg@darkphoton.com - **/ - /* make sure that the db_format entries for all fields are set to NULL to ensure we - don't seg fault if there's an error and we need to call free_dbf_head() before all - fields have been defined. */ - for (i = 0, cur_f = dbf; i < num_fields; i++, cur_f++) { - cur_f->db_format = NULL; - } - /** - * end patch - */ - - - for (i = 0, cur_f = dbf; i < num_fields; i++, cur_f++) { - /* look up the first field */ - if (zend_hash_index_find(Z_ARRVAL_PP(fields), i, (void **)&field) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to find field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - - if (Z_TYPE_PP (field) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "second parameter must be array of arrays"); - free_dbf_head(dbh); - RETURN_FALSE; - } - - /* field name */ - if (zend_hash_index_find(Z_ARRVAL_PP(field), 0, (void **)&value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "expected field name as first element of list in field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - convert_to_string_ex(value); - if (Z_STRLEN_PP(value) > 10 || Z_STRLEN_PP(value) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid field name '%s' (must be non-empty and less than or equal to 10 characters)", Z_STRVAL_PP(value)); - free_dbf_head(dbh); - RETURN_FALSE; - } - copy_crimp(cur_f->db_fname, Z_STRVAL_PP(value), Z_STRLEN_PP(value)); - - /* field type */ - if (zend_hash_index_find(Z_ARRVAL_PP (field), 1, (void **)&value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "expected field type as second element of list in field %d", i); - RETURN_FALSE; - } - convert_to_string_ex(value); - cur_f->db_type = toupper(*Z_STRVAL_PP(value)); - - cur_f->db_fdc = 0; - - /* verify the field length */ - switch (cur_f->db_type) { - case 'L': - cur_f->db_flen = 1; - break; - case 'M': - cur_f->db_flen = 10; - dbh->db_dbt = DBH_TYPE_MEMO; - /* should create the memo file here, probably */ - break; - case 'D': - cur_f->db_flen = 8; - break; - case 'F': - cur_f->db_flen = 20; - break; - case 'N': - case 'C': - /* field length */ - if (zend_hash_index_find(Z_ARRVAL_PP (field), 2, (void **)&value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "expected field length as third element of list in field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - convert_to_long_ex(value); - cur_f->db_flen = Z_LVAL_PP(value); - - if (cur_f->db_type == 'N') { - if (zend_hash_index_find(Z_ARRVAL_PP (field), 3, (void **)&value) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "expected field precision as fourth element of list in field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - convert_to_long_ex(value); - cur_f->db_fdc = Z_LVAL_PP(value); - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unknown field type '%c'", cur_f->db_type); - free_dbf_head(dbh); - RETURN_FALSE; - } - cur_f->db_foffset = rlen; - rlen += cur_f->db_flen; - - cur_f->db_format = get_dbf_f_fmt(cur_f); - } - - dbh->db_rlen = rlen; - put_dbf_info(dbh); - - handle = zend_list_insert(dbh, DBase_GLOBAL(le_dbhead)); - RETURN_LONG(handle); -} -/* }}} */ - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_open, 0) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_close, 0) - ZEND_ARG_INFO(0, identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_numrecords, 0) - ZEND_ARG_INFO(0, identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_numfields, 0) - ZEND_ARG_INFO(0, identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_pack, 0) - ZEND_ARG_INFO(0, identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_add_record, 0) - ZEND_ARG_INFO(0, identifier) - ZEND_ARG_INFO(0, data) /* ARRAY_INFO(0, data, 0) */ -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_replace_record, 0) - ZEND_ARG_INFO(0, identifier) - ZEND_ARG_INFO(0, data) /* ARRAY_INFO(0, data, 0) */ - ZEND_ARG_INFO(0, recnum) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_delete_record, 0) - ZEND_ARG_INFO(0, identifier) - ZEND_ARG_INFO(0, record) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_get_record, 0) - ZEND_ARG_INFO(0, identifier) - ZEND_ARG_INFO(0, record) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_get_record_with_names, 0) - ZEND_ARG_INFO(0, identifier) - ZEND_ARG_INFO(0, record) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_create, 0) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, fields) /* ARRAY_INFO(0, fields, 0) */ -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_dbase_get_header_info, 0) - ZEND_ARG_INFO(0, database_handle) -ZEND_END_ARG_INFO() - -/* }}} */ - -/* {{{ dbase_functions[] - */ -zend_function_entry dbase_functions[] = { - PHP_FE(dbase_open, arginfo_dbase_open) - PHP_FE(dbase_create, arginfo_dbase_create) - PHP_FE(dbase_close, arginfo_dbase_close) - PHP_FE(dbase_numrecords, arginfo_dbase_numrecords) - PHP_FE(dbase_numfields, arginfo_dbase_numfields) - PHP_FE(dbase_add_record, arginfo_dbase_add_record) - PHP_FE(dbase_replace_record, arginfo_dbase_replace_record) - PHP_FE(dbase_get_record, arginfo_dbase_get_record) - PHP_FE(dbase_get_record_with_names, arginfo_dbase_get_record_with_names) - PHP_FE(dbase_delete_record, arginfo_dbase_delete_record) - PHP_FE(dbase_pack, arginfo_dbase_pack) - PHP_FE(dbase_get_header_info, arginfo_dbase_get_header_info) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* Added by Zak Greant */ -/* {{{ proto array dbase_get_header_info(int database_handle) - */ -PHP_FUNCTION(dbase_get_header_info) -{ - zval **dbh_id, *row; - dbfield_t *dbf, *cur_f; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &dbh_id) == FAILURE)) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(dbh_id); - - dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find database for identifier %ld", Z_LVAL_PP(dbh_id)); - RETURN_FALSE; - } - - array_init(return_value); - - dbf = dbh->db_fields; - for (cur_f = dbf; cur_f < &dbh->db_fields[dbh->db_nfields]; ++cur_f) { - MAKE_STD_ZVAL(row); - array_init(row); - - add_next_index_zval(return_value, row); - - /* field name */ - add_assoc_string(row, "name", cur_f->db_fname, 1); - - /* field type */ - switch (cur_f->db_type) { - case 'C': add_assoc_string(row, "type", "character", 1); break; - case 'D': add_assoc_string(row, "type", "date", 1); break; - case 'I': add_assoc_string(row, "type", "integer", 1); break; - case 'N': add_assoc_string(row, "type", "number", 1); break; - case 'L': add_assoc_string(row, "type", "boolean", 1); break; - case 'M': add_assoc_string(row, "type", "memo", 1); break; - case 'F': add_assoc_string(row, "type", "float", 1); break; - default: add_assoc_string(row, "type", "unknown", 1); break; - } - - /* length of field */ - add_assoc_long(row, "length", cur_f->db_flen); - - /* number of decimals in field */ - switch (cur_f->db_type) { - case 'N': - case 'I': - add_assoc_long(row, "precision", cur_f->db_fdc); - break; - default: - add_assoc_long(row, "precision", 0); - } - - /* format for printing %s etc */ - add_assoc_string(row, "format", cur_f->db_format, 1); - - /* offset within record */ - add_assoc_long(row, "offset", cur_f->db_foffset); - } -} -/* }}} */ - -zend_module_entry dbase_module_entry = { - STANDARD_MODULE_HEADER, - "dbase", dbase_functions, PHP_MINIT(dbase), PHP_MSHUTDOWN(dbase), NULL, NULL, NULL, NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - - -#ifdef COMPILE_DL_DBASE -ZEND_GET_MODULE(dbase) - -#if defined(PHP_WIN32) && defined(THREAD_SAFE) - -/*NOTE: You should have an odbc.def file where you -export DllMain*/ -BOOL WINAPI DllMain(HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved) -{ - return 1; -} -#endif -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbase.dsp b/ext/dbase/dbase.dsp deleted file mode 100644 index 7c75304983e69..0000000000000 --- a/ext/dbase/dbase.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dbase" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dbase - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dbase.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dbase.mak" CFG="dbase - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dbase - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dbase - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dbase - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DBASE" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "DBASE_EXPORTS" /D "COMPILE_DL_DBASE" /D ZTS=1 /D HAVE_DBASE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D DBASE=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dbase.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "dbase - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DBASE" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DBASE_EXPORTS" /D "COMPILE_DL_DBASE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBASE=1 /D DBASE=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_dbase.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "dbase - Win32 Release_TS" -# Name "dbase - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\dbase.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_head.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_misc.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_ndx.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_rec.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\dbf.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_head.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_misc.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_ndx.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_rec.h -# End Source File -# Begin Source File - -SOURCE=.\php_dbase.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/dbase/dbf.h b/ext/dbase/dbf.h deleted file mode 100644 index c7ee8fde714e3..0000000000000 --- a/ext/dbase/dbf.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -/* - * dbf header structure on disk (pc dbase III) - * - * Basic info taken from: - * "File Formats for Popular PC Software" - * Jeff Walden - * (c) 1986 John Wiley & Sons, Inc. - */ - -#ifndef DBF_H_ -#define DBF_H_ - -#include -#include -#ifdef WIN32 -#include -#else -#include -#endif - -/* So we can use O_BINARY on non-Win32 systems. */ -#if !defined(O_BINARY) && !defined(WIN32) -#define O_BINARY (0) -#endif - -struct dbf_dhead { - char dbh_dbt; /* memo (dbt) file present */ - char dbh_date[3]; /* last update YY, MM, DD */ - char dbh_records[4]; /* number of records LE */ - char dbh_hlen[2]; /* header length LE */ - char dbh_rlen[2]; /* record length LE */ - char dbh_res[20]; /* padding */ -}; -#define DBH_DATE_YEAR 0 /* byte offset for year in dbh_date */ -#define DBH_DATE_MONTH 1 -#define DBH_DATE_DAY 2 - -/* - * field description on disk - */ - -#define DBF_NAMELEN 11 - -struct dbf_dfield { - char dbf_name[DBF_NAMELEN]; /* name of field */ - char dbf_type; /* type of field */ - char dbf_fda[4]; /* something for dbase III */ - char dbf_flen[2]; /* field length [and decimal if N] */ - char dbf_res[14]; /* padding */ -}; - -struct db_field { - char db_fname[DBF_NAMELEN+1]; /* 0 terminated */ - char db_type; /* type of field */ - int db_flen; /* length of field */ - int db_fdc; /* number of decimals in field */ - - char *db_format; /* format for printing %s etc */ - int db_foffset; /* offset within record */ -}; -typedef struct db_field dbfield_t; - -struct db_head { - int db_fd; - unsigned char db_dbt; /* dbt present */ - char db_date[9]; /* date of last update in db format */ - long db_records; /* number of records */ - int db_hlen; /* header length */ - int db_rlen; /* record length */ - - int db_nfields; /* number of fields */ - dbfield_t *db_fields; /* field info */ - char *db_name; /* name of dbf file */ - int db_cur_rec; /* current record */ -}; -typedef struct db_head dbhead_t; - -#define DBH_TYPE_NORMAL 0x03 -#define DBH_TYPE_MEMO 0x83 - -#define VALID_RECORD ' ' -#define DELETED_RECORD '*' - -#include "dbf_head.h" -#include "dbf_misc.h" -#include "dbf_rec.h" - -#endif /* DBF_H_ */ diff --git a/ext/dbase/dbf_head.c b/ext/dbase/dbf_head.c deleted file mode 100644 index 010fccf87b7fd..0000000000000 --- a/ext/dbase/dbf_head.c +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#include -#include - -#include "php.h" -#include "dbf.h" - -void free_dbf_head(dbhead_t *dbh); -int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf); - -/* - * get the header info from the file - * basic header info & field descriptions - */ -dbhead_t *get_dbf_head(int fd) -{ - dbhead_t *dbh; - struct dbf_dhead dbhead; - dbfield_t *dbf, *cur_f, *tdbf; - int ret, nfields, offset, gf_retval; - - if ((dbh = (dbhead_t *)calloc(1, sizeof(dbhead_t))) == NULL) - return NULL; - if (lseek(fd, 0, 0) < 0) { - free(dbh); - return NULL; - } - if ((ret = read(fd, &dbhead, sizeof(dbhead))) <= 0) { - free(dbh); - return NULL; - } - - /* build in core info */ - dbh->db_fd = fd; - dbh->db_dbt = dbhead.dbh_dbt; - dbh->db_records = get_long(dbhead.dbh_records); - dbh->db_hlen = get_short(dbhead.dbh_hlen); - dbh->db_rlen = get_short(dbhead.dbh_rlen); - - db_set_date(dbh->db_date, dbhead.dbh_date[DBH_DATE_YEAR] + 1900, - dbhead.dbh_date[DBH_DATE_MONTH], - dbhead.dbh_date[DBH_DATE_DAY]); - - /* malloc enough memory for the maximum number of fields: - 32 * 1024 = 32K dBase5 (for Win) seems to allow that many */ - tdbf = (dbfield_t *)calloc(1, sizeof(dbfield_t)*1024); - - offset = 1; - nfields = 0; - gf_retval = 0; - for (cur_f = tdbf; gf_retval < 2 && nfields < 1024; cur_f++) { - gf_retval = get_dbf_field(dbh, cur_f); - - if (gf_retval < 0) { - free_dbf_head(dbh); - free(tdbf); - return NULL; - } - if (gf_retval != 2 ) { - cur_f->db_foffset = offset; - offset += cur_f->db_flen; - nfields++; - } - } - dbh->db_nfields = nfields; - - /* malloc the right amount of space for records, copy and destroy old */ - dbf = (dbfield_t *)malloc(sizeof(dbfield_t)*nfields); - memcpy(dbf, tdbf, sizeof(dbfield_t)*nfields); - free(tdbf); - - dbh->db_fields = dbf; - - return dbh; -} - -/* - * free up the header info built above - */ -void free_dbf_head(dbhead_t *dbh) -{ - dbfield_t *dbf, *cur_f; - int nfields; - - dbf = dbh->db_fields; - nfields = dbh->db_nfields; - for (cur_f = dbf; cur_f < &dbf[nfields]; cur_f++) { - if (cur_f->db_format) { - free(cur_f->db_format); - } - } - - free(dbf); - free(dbh); -} - -/* - * put out the header info - */ -int put_dbf_head(dbhead_t *dbh) -{ - int fd = dbh->db_fd; - struct dbf_dhead dbhead; - int ret; - - memset (&dbhead, 0, sizeof(dbhead)); - - /* build on disk info */ - dbhead.dbh_dbt = dbh->db_dbt; - put_long(dbhead.dbh_records, dbh->db_records); - put_short(dbhead.dbh_hlen, dbh->db_hlen); - put_short(dbhead.dbh_rlen, dbh->db_rlen); - - /* put the date spec'd into the on disk header */ - dbhead.dbh_date[DBH_DATE_YEAR] =(char)(db_date_year(dbh->db_date) - - 1900); - dbhead.dbh_date[DBH_DATE_MONTH]=(char)(db_date_month(dbh->db_date)); - dbhead.dbh_date[DBH_DATE_DAY] =(char)(db_date_day(dbh->db_date)); - - if (lseek(fd, 0, 0) < 0) - return -1; - if ((ret = write(fd, &dbhead, sizeof(dbhead))) <= 0) - return -1; - return ret; -} - -/* - * get a field off the disk from the current file offset - */ -int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf) -{ - struct dbf_dfield dbfield; - int ret; - - if ((ret = read(dbh->db_fd, &dbfield, sizeof(dbfield))) <= 0) { - return ret; - } - - /* Check for the '0Dh' field terminator , if found return '2' - which will tell the loop we are at the end of fields */ - if (dbfield.dbf_name[0]==0x0d) { - return 2; - } - - /* build the field name */ - copy_crimp(dbf->db_fname, dbfield.dbf_name, DBF_NAMELEN); - - dbf->db_type = dbfield.dbf_type; - switch (dbf->db_type) { - case 'N': - case 'F': - dbf->db_flen = dbfield.dbf_flen[0]; - dbf->db_fdc = dbfield.dbf_flen[1]; - break; - case 'D': - dbf->db_flen = 8; - break; - case 'L': - dbf->db_flen = 1; - break; - default: - dbf->db_flen = get_short(dbfield.dbf_flen); - break; - } - - if ((dbf->db_format = get_dbf_f_fmt(dbf)) == NULL) { - /* something went wrong, most likely this fieldtype is not supported */ - return -1; - } - - return 0; -} - -/* - * put a field out on the disk at the current file offset - */ -int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf) -{ - struct dbf_dfield dbfield; - char *scp, *dcp; - int ret; - - memset (&dbfield, 0, sizeof(dbfield)); - - /* build the on disk field info */ - scp = dbf->db_fname; dcp = dbfield.dbf_name; - - strlcpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN + 1); - - dbfield.dbf_type = dbf->db_type; - switch (dbf->db_type) { - case 'N': - dbfield.dbf_flen[0] = dbf->db_flen; - dbfield.dbf_flen[1] = dbf->db_fdc; - break; - case 'D': - dbf->db_flen = 8; - break; - case 'L': - dbf->db_flen = 1; - break; - default: - put_short(dbfield.dbf_flen, dbf->db_flen); - } - - /* now write it out to disk */ - if ((ret = write(dbh->db_fd, &dbfield, sizeof(dbfield))) <= 0) { - return ret; - } - return 1; -} - -/* - * put out all the info at the top of the file... - */ -static char end_stuff[2] = {0x0d, 0}; - -void put_dbf_info(dbhead_t *dbh) -{ - dbfield_t *dbf; - char *cp; - int fcnt; - - if ((cp = db_cur_date(NULL))) { - strlcpy(dbh->db_date, cp, 9); - free(cp); - } - put_dbf_head(dbh); - dbf = dbh->db_fields; - for (fcnt = dbh->db_nfields; fcnt > 0; fcnt--, dbf++) - put_dbf_field(dbh, dbf); - write(dbh->db_fd, end_stuff, 1); -} - -char *get_dbf_f_fmt(dbfield_t *dbf) -{ - char format[100]; - - /* build the field format for printf */ - switch (dbf->db_type) { - case 'C': - snprintf(format, sizeof(format), "%%-%ds", dbf->db_flen); - break; - case 'N': - case 'L': - case 'D': - case 'F': - snprintf(format, sizeof(format), "%%%ds", dbf->db_flen); - break; - case 'M': - strlcpy(format, "%s", sizeof(format)); - break; - default: - return NULL; - } - return (char *)strdup(format); -} - -dbhead_t *dbf_open(char *dp, int o_flags TSRMLS_DC) -{ - int fd; - char *cp; - dbhead_t *dbh; - - cp = dp; - if ((fd = VCWD_OPEN(cp, o_flags|O_BINARY)) < 0) { - return NULL; - } - - if ((dbh = get_dbf_head(fd)) == NULL) { - return NULL; - } - - dbh->db_cur_rec = 0; - return dbh; -} - -void dbf_head_info(dbhead_t *dbh) -{ - int nfields; - dbfield_t *dbf, *cur_f; - - nfields = dbh->db_nfields; - printf("# fields: %d, record len: %d, total records %ld\n", - nfields, dbh->db_rlen, dbh->db_records); - dbf = dbh->db_fields; - for (cur_f = dbf; cur_f < &dbf[nfields] ; cur_f++) { - printf("# %s, %c, %d, %d\n", cur_f->db_fname, - cur_f->db_type, cur_f->db_flen, cur_f->db_fdc); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_head.h b/ext/dbase/dbf_head.h deleted file mode 100644 index 9a17a3a91f39b..0000000000000 --- a/ext/dbase/dbf_head.h +++ /dev/null @@ -1,11 +0,0 @@ -#include "php.h" - -extern dbhead_t *get_dbf_head(int fd); -void free_dbf_head(dbhead_t *dbh); -extern int put_dbf_head(dbhead_t *dbh); -extern int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf); -extern int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf); -void put_dbf_info(dbhead_t *dbh); -extern char *get_dbf_f_fmt(dbfield_t *dbf); -extern dbhead_t *dbf_open(char *dp, int o_flags TSRMLS_DC); -void dbf_head_info(dbhead_t *dbh); diff --git a/ext/dbase/dbf_misc.c b/ext/dbase/dbf_misc.c deleted file mode 100644 index d5727839642f0..0000000000000 --- a/ext/dbase/dbf_misc.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ -#include -#include -#include - -#include "dbf_misc.h" - -#include "php_reentrancy.h" - -/* - * routine to change little endian long to host long - */ -long get_long(char *cp) -{ - int ret; - unsigned char *source = (unsigned char *)cp; - - ret = *source++; - ret += ((*source++)<<8); - ret += ((*source++)<<16); - ret += ((*source++)<<24); - - return ret; -} - -void put_long(char *cp, long lval) -{ - *cp++ = lval & 0xff; - *cp++ = (lval >> 8) & 0xff; - *cp++ = (lval >> 16) & 0xff; - *cp++ = (lval >> 24) & 0xff; -} - -/* - * routine to change little endian short to host short - */ -int get_short(char *cp) -{ - int ret; - unsigned char *source = (unsigned char *)cp; - - ret = *source++; - ret += ((*source++)<<8); - - return ret; -} - -void put_short(char *cp, int sval) -{ - *cp++ = sval & 0xff; - *cp++ = (sval >> 8) & 0xff; -} - -double get_double(char *cp) -{ - double ret; - unsigned char *dp = (unsigned char *)&ret; - - dp[7] = *cp++; - dp[6] = *cp++; - dp[5] = *cp++; - dp[4] = *cp++; - dp[3] = *cp++; - dp[2] = *cp++; - dp[1] = *cp++; - dp[0] = *cp++; - - return ret; -} - -void put_double(char *cp, double fval) -{ - unsigned char *dp = (unsigned char *)&fval; - - cp[7] = *dp++; - cp[6] = *dp++; - cp[5] = *dp++; - cp[4] = *dp++; - cp[3] = *dp++; - cp[2] = *dp++; - cp[1] = *dp++; - cp[0] = *dp++; -} - -void copy_fill(char *dp, char *sp, int len) -{ - while (*sp && len > 0) { - *dp++ = *sp++; - len--; - } - while (len-- > 0) - *dp++ = ' '; -} - -void copy_crimp(char *dp, char *sp, int len) -{ - while (len-- > 0) { - *dp++ = *sp++; - } - *dp = 0; - for (dp-- ; *dp == ' '; dp--) { - *dp = 0; - } - -} - -void db_set_date(char *cp, int year, int month, int day) -{ - if (month > 12) - month = 0; - if (day > 31) - day = 0; - snprintf(cp, 9, "%04d%02d%02d", year, month, day); -} - -int db_date_year(char *cp) -{ - int year, i; - - for (year = 0, i = 0; i < 4; i++) - year = year * 10 + (cp[i] - '0'); - return year; -} - -int db_date_month(char *cp) -{ - int month, i; - - for (month = 0, i = 4; i < 6; i++) - month = month * 10 + (cp[i] - '0'); - return month; -} - -int db_date_day(char *cp) -{ - int day, i; - - for (day = 0, i = 6; i < 8; i++) - day = day * 10 + (cp[i] - '0'); - return day; -} - -#include - -char *db_cur_date(char *cp) -{ - struct tm *ctm, tmbuf; - time_t c_time; - - c_time = time((time_t *)NULL); - ctm = php_localtime_r(&c_time, &tmbuf); - if (cp == NULL) - cp = (char *)malloc(9); - - if (ctm == NULL || cp == NULL) - return NULL; - - db_set_date(cp, ctm->tm_year + 1900, ctm->tm_mon + 1, ctm->tm_mday); - - return cp; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_misc.h b/ext/dbase/dbf_misc.h deleted file mode 100644 index 37fe8b0ea98ae..0000000000000 --- a/ext/dbase/dbf_misc.h +++ /dev/null @@ -1,13 +0,0 @@ -void put_long(char *cp, long lval); -extern long get_long(char *cp); -extern int get_short(char *cp); -void put_short(char *cp, int sval); -void put_double(char *cp, double fval); -extern double get_double(char *cp); -void copy_fill(char *dp, char *sp, int len); -void copy_crimp(char *dp, char *sp, int len); -void db_set_date(char *cp, int year, int month, int day); -extern int db_date_year(char *cp); -extern int db_date_month(char *cp); -extern int db_date_day(char *cp); -extern char *db_cur_date(char *cp); diff --git a/ext/dbase/dbf_ndx.c b/ext/dbase/dbf_ndx.c deleted file mode 100644 index 121a0e81e263f..0000000000000 --- a/ext/dbase/dbf_ndx.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#include -#include - -#include "dbf.h" -#include "dbf_ndx.h" - -/* - * get the ndx header for this file - */ -ndx_header_t *ndx_get_header(int fd) -{ - dndx_header_t *dp; - ndx_header_t *np; - - if ((dp = (dndx_header_t *)malloc(NDX_PAGE_SZ)) == NULL) - return NULL; - if ((np = (ndx_header_t *)malloc(sizeof(ndx_header_t))) == NULL) { - free(dp); - return NULL; - } - if ((lseek(fd, 0, 0) < 0) || (read(fd, dp, NDX_PAGE_SZ) < 0)) { - free(dp); free(np); - return NULL; - } - np->ndx_hpage = dp; - np->ndx_fd = fd; - np->ndx_start_pg = get_long(dp->dndx_st_pg); - np->ndx_total_pgs = get_long(dp->dndx_tot_pg); - np->ndx_key_len = get_short(dp->dndx_key_len); - np->ndx_keys_ppg = get_short(dp->dndx_keys_ppg); - np->ndx_key_type = get_short(dp->dndx_key_type); - np->ndx_key_size = get_long(dp->dndx_size_key); - np->ndx_key_name = dp->dndx_key_name; - np->ndx_unique = dp->dndx_unique; - - np->ndx_fp = NULL; - - return np; -} - -static ndx_page_t *ndx_get_page(ndx_header_t *hp, int pageno) -{ - ndx_page_t *fp; - dndx_page_t *dp; - ndx_record_t *rp; - -#if PHP_DEBUG - printf("getting page %d", pageno); -#endif - if ((fp = (ndx_page_t *)malloc(sizeof(ndx_page_t))) == NULL) - return NULL; - if ((dp = (dndx_page_t *)malloc(NDX_PAGE_SZ)) == NULL) { - free(fp); - return NULL; - } - if ((rp = (ndx_record_t *)malloc(sizeof(ndx_record_t) * hp->ndx_keys_ppg)) == NULL) { - free(dp); free(fp); - return NULL; - } - fp->ndxp_page_data = dp; - if ((lseek(hp->ndx_fd, pageno * NDX_PAGE_SZ, 0) < 0) || - (read(hp->ndx_fd, dp, NDX_PAGE_SZ) < 0)) { - free(fp); free(dp); - return NULL; - } - fp->ndxp_parent = NULL; - fp->ndxp_page_no = pageno; - fp->ndxp_num_keys = get_long(dp->dndxp_num_keys); - memset(rp, 0, sizeof(ndx_record_t) * hp->ndx_keys_ppg); - fp->ndxp_records = rp; - fp->ndxp_header_p = hp; -#if PHP_DEBUG - printf(", n_keys %ld\n", fp->ndxp_num_keys); -#endif - return fp; -} - -/* - * get the first entry for this ndx - */ -static ndx_page_t *ndx_get_first_pg(ndx_header_t *hp) -{ - ndx_page_t *fp; - - if (hp->ndx_fp) - return hp->ndx_fp; - if ((fp = ndx_get_page(hp, hp->ndx_start_pg))) { - hp->ndx_fp = fp; - } - return fp; -} - -static ndx_record_t *ndx_get_record(ndx_page_t *fp, int rec_no) -{ - ndx_record_t *rp; - ndx_header_t *hp = fp->ndxp_header_p; - struct dndx_record *drp; - -#if PHP_DEBUG - printf("page %ld, rec %d: ", fp->ndxp_page_no, rec_no); -#endif - if (rec_no >= fp->ndxp_num_keys) - return NULL; - rp = &(fp->ndxp_records[rec_no]); - if (!rp->ndxr_page) { - rp->ndxr_page = fp; - drp = (dndx_record_t *)((char *)&fp->ndxp_page_data->dndx_rp - + rec_no * hp->ndx_key_size); - rp->ndxr_left = get_long(drp->dndx_left_pg); - rp->ndxr_rec = get_long(drp->dndx_dbf_rec); - rp->ndxr_key_data = &drp->dndx_key_data; - rp->ndxr_p_nrec = rec_no; - } -#if PHP_DEBUG - printf("left %ld, dbf_rec %ld, data '%s'\n", rp->ndxr_left, - rp->ndxr_rec, rp->ndxr_key_data); -#endif - return rp; -} - -static ndx_record_t *ndx_scan_down(ndx_header_t *hp, ndx_page_t *fp, int recno) -{ - ndx_page_t *np; - ndx_record_t *rp; - - while ((rp = ndx_get_record(fp, recno)) && (rp->ndxr_rec == 0)) { - np = ndx_get_page(hp, rp->ndxr_left); - np->ndxp_parent = fp; - np->ndxp_par_rno = recno; - fp = np; - recno = 0; - } - return rp; -} - -static ndx_record_t *ndx_scan_up(ndx_header_t *hp, ndx_page_t *fp, int recno) -{ - ndx_record_t *rp; - - if (fp == NULL) - rp = NULL; - else if (recno < fp->ndxp_num_keys) { - rp = ndx_scan_down(hp, fp, recno); - } else { - rp = ndx_scan_up(hp, fp->ndxp_parent, fp->ndxp_par_rno + 1); - } - return rp; -} - -ndx_record_t *ndx_get_first_rec(ndx_header_t *hp) -{ - ndx_page_t *fp; - ndx_record_t *rp = NULL; - - if ((fp = ndx_get_first_pg(hp))) { - fp->ndxp_last_key = 0; - rp = ndx_scan_down(hp, fp, 0); - } - hp->ndx_cur_rec = rp; - return rp; -} - -ndx_record_t *ndx_get_next_rec(ndx_header_t *hp, ndx_record_t *rp) -{ - ndx_page_t *fp; - int rec_no; - - fp = rp->ndxr_page; - rec_no = rp->ndxr_p_nrec + 1; - if (rec_no < fp->ndxp_num_keys) { - rp = ndx_scan_down(hp, fp, rec_no); - } else { - rp = ndx_scan_up(hp, fp->ndxp_parent, fp->ndxp_par_rno + 1); - } - return rp; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_ndx.h b/ext/dbase/dbf_ndx.h deleted file mode 100644 index 4bc3d29641f36..0000000000000 --- a/ext/dbase/dbf_ndx.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -/* - * dbf .ndx header structure on disk and in memory - * - * Basic info taken from: - * "Clipper Programming Guide, 3rd Edition, Version 5.01" - * by Rick Spence - */ - -#ifndef DBF_NDX_H_ -#define DBF_NDX_H_ - -#include "dbf.h" - -#define NDX_PAGE_SZ 512 - -/* on disk ndx header */ -struct dndx_header { - char dndx_st_pg[4]; /* starting page number */ - char dndx_tot_pg[4]; /* total number of pages */ - char dndx_filler1[4]; /* space */ - char dndx_key_len[2]; /* key length */ - char dndx_keys_ppg[2]; /* number of keys per page */ - char dndx_key_type[2]; /* key type */ - char dndx_size_key[4]; /* size of the key record */ - char dndx_filler2; /* space */ - char dndx_unique; /* whether or not done with unique */ - char dndx_key_name[488]; /* string defining the key */ -}; -typedef struct dndx_header dndx_header_t; - -/* in memory ndx header */ -struct ndx_header { - long ndx_start_pg; - long ndx_total_pgs; - unsigned short ndx_key_len; - unsigned short ndx_keys_ppg; - unsigned short ndx_key_type; - char ndx_unique; - long ndx_key_size; - char *ndx_key_name; - int ndx_fd; - struct ndx_page *ndx_fp; - dndx_header_t *ndx_hpage; - struct ndx_record *ndx_cur_rec; -}; -typedef struct ndx_header ndx_header_t; - -/* these are the possible values in the key type field */ -#define NDX_CHAR_TYPE 00 -#define NDX_NUM_TYPE 01 - -/* on disk key record */ -struct dndx_record { - char dndx_left_pg[4]; /* number of left page */ - char dndx_dbf_rec[4]; /* dbf record number */ - char dndx_key_data; /* key data */ -}; -typedef struct dndx_record dndx_record_t; - -struct ndx_record { - long ndxr_left; - long ndxr_rec; - char *ndxr_key_data; - struct ndx_page *ndxr_page; /* page pointer to where we are from*/ - int ndxr_p_nrec; /* number of the record within page */ -}; -typedef struct ndx_record ndx_record_t; - -struct dndx_page { - char dndxp_num_keys[4]; /* number of keys on this page */ - struct dndx_record dndx_rp; -}; -typedef struct dndx_page dndx_page_t; - -struct ndx_page { - long ndxp_page_no; - long ndxp_num_keys; - dndx_page_t *ndxp_page_data; - ndx_header_t *ndxp_header_p; - long ndxp_last_key; - struct ndx_page *ndxp_parent; /* parent page */ - int ndxp_par_rno; /* record number within parent */ - struct ndx_record *ndxp_records; -}; -typedef struct ndx_page ndx_page_t; - -extern ndx_header_t *ndx_get_header(int); - -extern ndx_record_t *ndx_get_first_rec(ndx_header_t *); -extern ndx_record_t *ndx_get_next_rec(ndx_header_t *, ndx_record_t *); - -#endif /* DBF_NDX_H_ */ diff --git a/ext/dbase/dbf_rec.c b/ext/dbase/dbf_rec.c deleted file mode 100644 index 86db49866672c..0000000000000 --- a/ext/dbase/dbf_rec.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#include "ext/standard/flock_compat.h" - -#include -#include - -#include "dbf.h" - -int get_piece(dbhead_t *dbh, long offset, char *cp, int len); -int put_piece(dbhead_t *dbh, long offset, char *cp, int len); - -/* - * get a record off the database - */ -char *get_dbf_record(dbhead_t *dbh, long rec_num) -{ - long offset; - char *cp; - - if (rec_num > dbh->db_records) { - return NULL; - } - if ((cp = (char *)malloc(dbh->db_rlen)) == NULL) { - return NULL; - } - - /* go to the correct spot on the file */ - offset = dbh->db_hlen + (rec_num - 1) * dbh->db_rlen; - if (get_piece(dbh, offset, cp, dbh->db_rlen) != dbh->db_rlen) { - free(cp); - cp = NULL; - } - if (cp) - dbh->db_cur_rec = rec_num; - return cp; -} - -int -get_piece(dbhead_t *dbh, long offset, char *cp, int len) -{ - /* go to the correct spot on the file */ - if ( lseek(dbh->db_fd, offset, 0) < 0 ) { - return -1; - } - - /* read the record into the allocated space */ - return read(dbh->db_fd, cp, len); -} - -/* - * put a record to the database - */ -long put_dbf_record(dbhead_t *dbh, long rec_num, char *cp) -{ - long offset; - - if (rec_num == 0) { - rec_num = dbh->db_records; - } - if (rec_num > dbh->db_records) { - return 0L; - } - /* go to the correct spot on the file */ - offset = dbh->db_hlen + (rec_num - 1) * dbh->db_rlen; - if (put_piece(dbh, offset, cp, dbh->db_rlen) != dbh->db_rlen) { - rec_num = -1; - } - return rec_num; -} - -int put_piece(dbhead_t *dbh, long offset, char *cp, int len) -{ - /* go to the correct spot on the file */ - if ( lseek(dbh->db_fd, offset, 0) < 0 ) { - return -1; - } - - /* write the record into the file */ - return write(dbh->db_fd, cp, len); -} - -int del_dbf_record(dbhead_t *dbh, long rec_num) -{ - int ret = 0; - char *cp; - - if (rec_num > dbh->db_records) - return -1; - if ((cp = get_dbf_record(dbh, rec_num))) { - *cp = DELETED_RECORD; - ret = put_dbf_record(dbh, rec_num, cp); - free(cp); - } - return ret; -} - -void pack_dbf(dbhead_t *dbh) -{ - long out_off, in_off; - int rec_cnt, new_cnt; - char *cp; - - if ((cp = (char *)malloc(dbh->db_rlen)) == NULL) { - return; - } - in_off = out_off = dbh->db_hlen; - - new_cnt = 0; - rec_cnt = dbh->db_records; - while (rec_cnt > 0) { - if (get_piece(dbh, in_off, cp, dbh->db_rlen) < 0) - break; - - if (*cp != DELETED_RECORD) { - /* write the record into the file */ - if (put_piece(dbh, out_off, cp, dbh->db_rlen) < 0) - break; - out_off += dbh->db_rlen; - new_cnt++; - } - in_off += dbh->db_rlen; - rec_cnt--; - } - free(cp); - - /* Try to truncate the file to the right size. */ - if (ftruncate(dbh->db_fd, out_off) != 0) { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbase_pack() couldn't truncate the file to the right size. Some deleted records may still be left in there."); - } - - if (rec_cnt == 0) - dbh->db_records = new_cnt; -} - -/* routine to get a field from a record */ -char *get_field_val(char *rp, dbfield_t *fldp, char *cp) -{ - int flen = fldp->db_flen; - - if ( !cp ) - cp = (char *)malloc(flen + 1); - if ( cp ) { - strlcpy(cp, &rp[fldp->db_foffset], flen + 1); - } - return cp; -} - -void put_field_val(char *rp, dbfield_t *fldp, char *cp) -{ - strncpy(&rp[fldp->db_foffset], cp, fldp->db_flen); -} - -/* - * output a record - */ -void out_rec(dbhead_t *dbh, dbfield_t *dbf, char *cp) -{ - dbfield_t *cur_f; - int nfields = dbh->db_nfields; - char *fnp = (char *)malloc(dbh->db_rlen); - - printf("%c", *cp); - for (cur_f = dbf; cur_f < &dbf[nfields] ; cur_f++) { - printf(" "); - printf(cur_f->db_format, get_field_val(cp, cur_f, fnp)); - } - printf("\n"); - free(fnp); -} - -/* check for record validity */ -int is_valid_rec(char *cp) -{ - if (cp && (*cp == VALID_RECORD)) - return 1; - else - return 0; -} - -/* get the next record */ -char *dbf_get_next(dbhead_t *dbh) -{ - return get_dbf_record(dbh, dbh->db_cur_rec + 1); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_rec.h b/ext/dbase/dbf_rec.h deleted file mode 100644 index 6407c702f6672..0000000000000 --- a/ext/dbase/dbf_rec.h +++ /dev/null @@ -1,10 +0,0 @@ -extern char *get_dbf_record(dbhead_t *dbh, long rec_num); -extern long put_dbf_record(dbhead_t *dbh, long rec_num, char *cp); -extern int put_piece(dbhead_t *dbh, long offset, char *cp, int len); -extern int del_dbf_record(dbhead_t *dbh, long rec_num); -void pack_dbf(dbhead_t *dbh); -extern char *get_field_val(char *rp, dbfield_t *fldp, char *cp); -void put_field_val(char *rp, dbfield_t *fldp, char *cp); -void out_rec(dbhead_t *dbh, dbfield_t *dbf, char *cp); -extern int is_valid_rec(char *cp); -extern char *dbf_get_next(dbhead_t *dbh); diff --git a/ext/dbase/package.xml b/ext/dbase/package.xml deleted file mode 100644 index a1c576fa1abf8..0000000000000 --- a/ext/dbase/package.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - dbase - dBase database file access functions - - - jimw - Jim Winstead - jimw@php.net - lead - - - -These functions allow you to access records stored -in dBase-format (dbf) databases. - -There is no support for indexes or memo fields. -There is no support for locking, too. -Two concurrent webserver processes modifying the -same dBase file will very likely ruin your database. - -dBase files are simple sequential files of fixed length records. -Records are appended to the end of the file and delete records -are kept until you call dbase_pack(). - - PHP - - beta - 5.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/dbase/php_dbase.h b/ext/dbase/php_dbase.h deleted file mode 100644 index 6e071950e9ed8..0000000000000 --- a/ext/dbase/php_dbase.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Jim Winstead | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_DBASE_H -#define PHP_DBASE_H -#if DBASE -extern zend_module_entry dbase_module_entry; -#define dbase_module_ptr &dbase_module_entry - -PHP_MINIT_FUNCTION(dbase); -PHP_FUNCTION(dbase_open); -PHP_FUNCTION(dbase_create); -PHP_FUNCTION(dbase_close); -PHP_FUNCTION(dbase_numrecords); -PHP_FUNCTION(dbase_numfields); -PHP_FUNCTION(dbase_add_record); -PHP_FUNCTION(dbase_get_record); -PHP_FUNCTION(dbase_delete_record); -PHP_FUNCTION(dbase_pack); -PHP_FUNCTION(dbase_get_record_with_names); -PHP_FUNCTION(dbase_get_header_info); -#else -#define dbase_module_ptr NULL -#endif - -#define phpext_dbase_ptr dbase_module_ptr - -#endif /* PHP_DBASE_H */ diff --git a/ext/dbase/tests/001.phpt b/ext/dbase/tests/001.phpt deleted file mode 100644 index 7c10efb267d9a..0000000000000 --- a/ext/dbase/tests/001.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -dbase_create() tests ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -int(%d) - -Warning: dbase_create(): unknown field type 'E' in %s on line %d -bool(false) - -Warning: dbase_create(): unknown field type '-' in %s on line %d -bool(false) -int(%d) - -Warning: dbase_create(): expected field name as first element of list in field 0 in %s on line %d -bool(false) - -Warning: dbase_create(): Unable to create database without fields in %s on line %d -bool(false) - -Warning: dbase_create(): Expected array as second parameter in %s on line %d -bool(false) - -Warning: dbase_create(): Expected array as second parameter in %s on line %d -bool(false) -Done diff --git a/ext/dbase/tests/002.phpt b/ext/dbase/tests/002.phpt deleted file mode 100644 index d5dd5c9e02c76..0000000000000 --- a/ext/dbase/tests/002.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -dbase_open() tests ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: dbase_open(): Invalid access mode -1 in %s on line %d -bool(false) - -Warning: dbase_open(): Invalid access mode 1000 in %s on line %d -bool(false) - -Warning: dbase_open(): unable to open database %s in %s on line %d -bool(false) - -Warning: dbase_open(): unable to open database %s in %s on line %d -bool(false) - -Warning: dbase_open(): The filename cannot be empty. in %s on line %d -bool(false) -int(%d) -int(%d) -Done diff --git a/ext/dbase/tests/bug31754.phpt b/ext/dbase/tests/bug31754.phpt deleted file mode 100644 index bc116ed1bdd2d..0000000000000 --- a/ext/dbase/tests/bug31754.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #31754 (dbase_open() fails for mode = 1) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: dbase_open(): Cannot open /tmp/bug31754.dbf in write-only mode in %sbug31754.php on line %d diff --git a/ext/dom/CREDITS b/ext/dom/CREDITS deleted file mode 100644 index b78e376d6edd9..0000000000000 --- a/ext/dom/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -DOM -Christian Stocker, Rob Richards, Marcus Boerger diff --git a/ext/dom/TODO b/ext/dom/TODO deleted file mode 100644 index 52afb18216e10..0000000000000 --- a/ext/dom/TODO +++ /dev/null @@ -1,4 +0,0 @@ -For 5.1 -1) enhance XPath functionality -2) look at auto encoding support for in/output -3) What DOM object types are really needed (i.e. not currently using DOMString) diff --git a/ext/dom/attr.c b/ext/dom/attr.c deleted file mode 100644 index 186226f297aff..0000000000000 --- a/ext/dom/attr.c +++ /dev/null @@ -1,292 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_LIBXML && HAVE_DOM - -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_attr_is_id, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_attr_construct, 0, 0, 1) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMAttr extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-637646024 -* Since: -*/ - -zend_function_entry php_dom_attr_class_functions[] = { - PHP_FALIAS(isId, dom_attr_is_id, arginfo_dom_attr_is_id) - PHP_ME(domattr, __construct, arginfo_dom_attr_construct, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMAttr::__construct(string name, [string value]); */ -PHP_METHOD(domattr, __construct) -{ - - zval *id; - xmlAttrPtr nodep = NULL; - xmlNodePtr oldnode = NULL; - dom_object *intern; - char *name, *value = NULL; - int name_len, value_len, name_valid; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - name_valid = xmlValidateName((xmlChar *) name, 0); - if (name_valid != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - nodep = xmlNewProp(NULL, (xmlChar *) name, value); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC); - } -} - -/* }}} end DOMAttr::__construct */ - - -/* {{{ name string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1112119403 -Since: -*/ -int dom_attr_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlAttrPtr attrp; - - attrp = (xmlAttrPtr) dom_object_get_node(obj); - - if (attrp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, (char *) (attrp->name), 1); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ specified boolean -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-862529273 -Since: -*/ -int dom_attr_specified_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - /* TODO */ - ALLOC_ZVAL(*retval); - ZVAL_TRUE(*retval); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ value string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-221662474 -Since: -*/ -int dom_attr_value_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlAttrPtr attrp; - xmlChar *content; - - attrp = (xmlAttrPtr) dom_object_get_node(obj); - - if (attrp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - - if ((content = xmlNodeGetContent((xmlNodePtr) attrp)) != NULL) { - ZVAL_STRING(*retval, content, 1); - xmlFree(content); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; - -} - -int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlAttrPtr attrp; - - attrp = (xmlAttrPtr) dom_object_get_node(obj); - - if (attrp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (attrp->children) { - node_list_unlink(attrp->children TSRMLS_CC); - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - xmlNodeSetContentLen((xmlNodePtr) attrp, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ ownerElement DOMElement -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-ownerElement -Since: DOM Level 2 -*/ -int dom_attr_owner_element_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep, nodeparent; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - nodeparent = nodep->parent; - if (!nodeparent) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; - -} - -/* }}} */ - - - -/* {{{ schemaTypeInfo DOMTypeInfo -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-schemaTypeInfo -Since: DOM Level 3 -*/ -int dom_attr_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not yet implemented"); - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ proto boolean dom_attr_is_id(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-isId -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_attr_is_id) -{ - zval *id; - dom_object *intern; - xmlAttrPtr attrp; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_attr_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(attrp, id, xmlAttrPtr, intern); - - if (attrp->atype == XML_ATTRIBUTE_ID) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_attr_is_id */ - -#endif diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c deleted file mode 100644 index 2945b66ca9599..0000000000000 --- a/ext/dom/cdatasection.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_cdatasection_construct, 0, 0, 1) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMCdataSection extends DOMText -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-667469212 -* Since: -*/ - -zend_function_entry php_dom_cdatasection_class_functions[] = { - PHP_ME(domcdatasection, __construct, arginfo_dom_cdatasection_construct, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMCdataSection::__construct(string value); */ -PHP_METHOD(domcdatasection, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *value = NULL; - int value_len; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - nodep = xmlNewCDataBlock(NULL, (xmlChar *) value, value_len); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMCdataSection::__construct */ - -#endif diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c deleted file mode 100644 index 774f1ee1fc4a6..0000000000000 --- a/ext/dom/characterdata.c +++ /dev/null @@ -1,426 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_substring_data, 0, 0, 2) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, count) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_append_data, 0, 0, 1) - ZEND_ARG_INFO(0, arg) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_insert_data, 0, 0, 2) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, arg) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_delete_data, 0, 0, 2) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, count) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_characterdata_replace_data, 0, 0, 3) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, count) - ZEND_ARG_INFO(0, arg) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMCharacterData extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-FF21A306 -* Since: -*/ - -zend_function_entry php_dom_characterdata_class_functions[] = { - PHP_FALIAS(substringData, dom_characterdata_substring_data, arginfo_dom_characterdata_substring_data) - PHP_FALIAS(appendData, dom_characterdata_append_data, arginfo_dom_characterdata_append_data) - PHP_FALIAS(insertData, dom_characterdata_insert_data, arginfo_dom_characterdata_insert_data) - PHP_FALIAS(deleteData, dom_characterdata_delete_data, arginfo_dom_characterdata_delete_data) - PHP_FALIAS(replaceData, dom_characterdata_replace_data, arginfo_dom_characterdata_replace_data) - {NULL, NULL, NULL} -}; - -/* {{{ data string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-72AB8359 -Since: -*/ -int dom_characterdata_data_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - xmlChar *content; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if ((content = xmlNodeGetContent(nodep)) != NULL) { - ZVAL_STRING(*retval, content, 1); - xmlFree(content); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlNode *nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - xmlNodeSetContentLen(nodep, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - -/* {{{ length long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7D61178C -Since: -*/ -int dom_characterdata_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - xmlChar *content; - long length = 0; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - content = xmlNodeGetContent(nodep); - - if (content) { - length = xmlUTF8Strlen(content); - xmlFree(content); - } - - ZVAL_LONG(*retval, length); - - return SUCCESS; -} - -/* }}} */ - - -/* {{{ proto string dom_characterdata_substring_data(int offset, int count); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6531BCCF -Since: -*/ -PHP_FUNCTION(dom_characterdata_substring_data) -{ - zval *id; - xmlChar *cur; - xmlChar *substring; - xmlNodePtr node; - long offset, count; - int length; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) { - return; - } - - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - - length = xmlUTF8Strlen(cur); - - if (offset < 0 || count < 0 || offset > length) { - xmlFree(cur); - php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if ((offset + count) > length) { - count = length - offset; - } - - substring = xmlUTF8Strsub(cur, offset, count); - xmlFree(cur); - - if (substring) { - RETVAL_STRING(substring, 1); - xmlFree(substring); - } else { - RETVAL_EMPTY_STRING(); - } -} -/* }}} end dom_characterdata_substring_data */ - - -/* {{{ proto void dom_characterdata_append_data(string arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-32791A2F -Since: -*/ -PHP_FUNCTION(dom_characterdata_append_data) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - char *arg; - int arg_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_characterdata_class_entry, &arg, &arg_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); -#if LIBXML_VERSION < 20627 -/* Implement logic from libxml xmlTextConcat to add suport for comments and PI */ - if ((nodep->content == (xmlChar *) &(nodep->properties)) || - ((nodep->doc != NULL) && (nodep->doc->dict != NULL) && - xmlDictOwns(nodep->doc->dict, nodep->content))) { - nodep->content = xmlStrncatNew(nodep->content, arg, arg_len); - } else { - nodep->content = xmlStrncat(nodep->content, arg, arg_len); - } - nodep->properties = NULL; -#else - xmlTextConcat(nodep, arg, arg_len); -#endif - RETURN_TRUE; -} -/* }}} end dom_characterdata_append_data */ - - -/* {{{ proto void dom_characterdata_insert_data(int offset, string arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3EDB695F -Since: -*/ -PHP_FUNCTION(dom_characterdata_insert_data) -{ - zval *id; - xmlChar *cur, *first, *second; - xmlNodePtr node; - char *arg; - long offset; - int length, arg_len; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &id, dom_characterdata_class_entry, &offset, &arg, &arg_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - - length = xmlUTF8Strlen(cur); - - if (offset < 0 || offset > length) { - xmlFree(cur); - php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - first = xmlUTF8Strndup(cur, offset); - second = xmlUTF8Strsub(cur, offset, length - offset); - xmlFree(cur); - - xmlNodeSetContent(node, first); - xmlNodeAddContent(node, arg); - xmlNodeAddContent(node, second); - - xmlFree(first); - xmlFree(second); - - RETURN_TRUE; -} -/* }}} end dom_characterdata_insert_data */ - - -/* {{{ proto void dom_characterdata_delete_data(int offset, int count); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7C603781 -Since: -*/ -PHP_FUNCTION(dom_characterdata_delete_data) -{ - zval *id; - xmlChar *cur, *substring, *second; - xmlNodePtr node; - long offset, count; - int length; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) { - return; - } - - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - - length = xmlUTF8Strlen(cur); - - if (offset < 0 || count < 0 || offset > length) { - xmlFree(cur); - php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (offset > 0) { - substring = xmlUTF8Strsub(cur, 0, offset); - } else { - substring = NULL; - } - - if ((offset + count) > length) { - count = length - offset; - } - - second = xmlUTF8Strsub(cur, offset + count, length - offset); - substring = xmlStrcat(substring, second); - - xmlNodeSetContent(node, substring); - - xmlFree(cur); - xmlFree(second); - xmlFree(substring); - - RETURN_TRUE; -} -/* }}} end dom_characterdata_delete_data */ - - -/* {{{ proto void dom_characterdata_replace_data(int offset, int count, string arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-E5CBA7FB -Since: -*/ -PHP_FUNCTION(dom_characterdata_replace_data) -{ - zval *id; - xmlChar *cur, *substring, *second = NULL; - xmlNodePtr node; - char *arg; - long offset, count; - int length, arg_len; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olls", &id, dom_characterdata_class_entry, &offset, &count, &arg, &arg_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - - length = xmlUTF8Strlen(cur); - - if (offset < 0 || count < 0 || offset > length) { - xmlFree(cur); - php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (offset > 0) { - substring = xmlUTF8Strsub(cur, 0, offset); - } else { - substring = NULL; - } - - if ((offset + count) > length) { - count = length - offset; - } - - if (offset < length) { - second = xmlUTF8Strsub(cur, offset + count, length - offset); - } - - substring = xmlStrcat(substring, arg); - substring = xmlStrcat(substring, second); - - xmlNodeSetContent(node, substring); - - xmlFree(cur); - if (second) { - xmlFree(second); - } - xmlFree(substring); - - RETURN_TRUE; -} -/* }}} end dom_characterdata_replace_data */ -#endif diff --git a/ext/dom/comment.c b/ext/dom/comment.c deleted file mode 100644 index edf5838cd70d4..0000000000000 --- a/ext/dom/comment.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_comment_construct, 0, 0, 0) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMComment extends DOMCharacterData -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1728279322 -* Since: -*/ - -zend_function_entry php_dom_comment_class_functions[] = { - PHP_ME(domcomment, __construct, arginfo_dom_comment_construct, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMComment::__construct([string value]); */ -PHP_METHOD(domcomment, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *value = NULL; - int value_len; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - nodep = xmlNewComment((xmlChar *) value); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMComment::__construct */ -#endif diff --git a/ext/dom/config.m4 b/ext/dom/config.m4 deleted file mode 100644 index 7882483b305e4..0000000000000 --- a/ext/dom/config.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(dom, whether to enable DOM support, -[ --disable-dom Disable DOM support], yes) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir[=DIR] DOM: libxml2 install prefix], no, no) -fi - -if test "$PHP_DOM" != "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([DOM extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(DOM_SHARED_LIBADD, [ - AC_DEFINE(HAVE_DOM,1,[ ]) - PHP_NEW_EXTENSION(dom, [php_dom.c attr.c document.c domerrorhandler.c \ - domstringlist.c domexception.c namelist.c \ - processinginstruction.c cdatasection.c \ - documentfragment.c domimplementation.c \ - element.c node.c string_extend.c characterdata.c \ - documenttype.c domimplementationlist.c entity.c \ - nodelist.c text.c comment.c domconfiguration.c \ - domimplementationsource.c entityreference.c \ - notation.c xpath.c dom_iterators.c \ - typeinfo.c domerror.c domlocator.c namednodemap.c userdatahandler.c], - $ext_shared) - PHP_SUBST(DOM_SHARED_LIBADD) - PHP_INSTALL_HEADERS([ext/dom/xml_common.h]) - PHP_ADD_EXTENSION_DEP(dom, libxml) - ], [ - AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) - ]) -fi diff --git a/ext/dom/config.w32 b/ext/dom/config.w32 deleted file mode 100644 index 382587ff6e375..0000000000000 --- a/ext/dom/config.w32 +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("dom", "DOM support", "yes"); - -if (PHP_DOM == "yes" && PHP_LIBXML == "yes") { - EXTENSION("dom", "php_dom.c attr.c document.c domerrorhandler.c \ - domstringlist.c domexception.c namelist.c processinginstruction.c \ - cdatasection.c documentfragment.c domimplementation.c element.c \ - node.c string_extend.c characterdata.c documenttype.c \ - domimplementationlist.c entity.c nodelist.c text.c comment.c \ - domconfiguration.c domimplementationsource.c entityreference.c \ - notation.c xpath.c dom_iterators.c typeinfo.c domerror.c \ - domlocator.c namednodemap.c userdatahandler.c"); - AC_DEFINE("HAVE_DOM", 1, "DOM support"); - if (!PHP_DOM_SHARED) { - ADD_FLAG("CFLAGS_DOM", "/D LIBXML_STATIC "); - } - ADD_EXTENSION_DEP('dom', 'libxml'); -} - - diff --git a/ext/dom/document.c b/ext/dom/document.c deleted file mode 100644 index 9c2abfb55e444..0000000000000 --- a/ext/dom/document.c +++ /dev/null @@ -1,2407 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" -#include -#ifdef LIBXML_SCHEMAS_ENABLED -#include -#include -#endif - -typedef struct _idsIterator idsIterator; -struct _idsIterator { - xmlChar *elementId; - xmlNode *element; -}; - -#define DOM_LOAD_STRING 0 -#define DOM_LOAD_FILE 1 - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_element, 0, 0, 1) - ZEND_ARG_INFO(0, tagName) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_document_fragment, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_text_node, 0, 0, 1) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_comment, 0, 0, 1) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_cdatasection, 0, 0, 1) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_processing_instruction, 0, 0, 2) - ZEND_ARG_INFO(0, target) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_attribute, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_entity_reference, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_get_elements_by_tag_name, 0, 0, 1) - ZEND_ARG_INFO(0, tagName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_import_node, 0, 0, 2) - ZEND_ARG_OBJ_INFO(0, importedNode, DOMNode, 0) - ZEND_ARG_INFO(0, deep) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_element_ns, 0, 0, 2) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, qualifiedName) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_create_attribute_ns, 0, 0, 2) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, qualifiedName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_get_elements_by_tag_name_ns, 0, 0, 2) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, localName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_get_element_by_id, 0, 0, 1) - ZEND_ARG_INFO(0, elementId) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_adopt_node, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, source, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_normalize_document, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_rename_node, 0, 0, 3) - ZEND_ARG_OBJ_INFO(0, node, DOMNode, 0) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, qualifiedName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_load, 0, 0, 1) - ZEND_ARG_INFO(0, source) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_save, 0, 0, 1) - ZEND_ARG_INFO(0, file) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadxml, 0, 0, 1) - ZEND_ARG_INFO(0, source) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savexml, 0, 0, 0) - ZEND_ARG_OBJ_INFO(0, node, DOMNode, 1) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_construct, 0, 0, 0) - ZEND_ARG_INFO(0, version) - ZEND_ARG_INFO(0, encoding) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_validate, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_xinclude, 0, 0, 0) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtml, 0, 0, 1) - ZEND_ARG_INFO(0, source) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtmlfile, 0, 0, 1) - ZEND_ARG_INFO(0, source) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savehtml, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savehtmlfile, 0, 0, 1) - ZEND_ARG_INFO(0, file) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_schema_validate_file, 0, 0, 1) - ZEND_ARG_INFO(0, filename) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_schema_validate_xml, 0, 0, 1) - ZEND_ARG_INFO(0, source) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_relaxNG_validate_file, 0, 0, 1) - ZEND_ARG_INFO(0, filename) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_relaxNG_validate_xml, 0, 0, 1) - ZEND_ARG_INFO(0, source) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_registernodeclass, 0, 0, 2) - ZEND_ARG_INFO(0, baseClass) - ZEND_ARG_INFO(0, extendedClass) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMDocument extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-i-Document -* Since: -*/ - -zend_function_entry php_dom_document_class_functions[] = { - PHP_FALIAS(createElement, dom_document_create_element, arginfo_dom_document_create_element) - PHP_FALIAS(createDocumentFragment, dom_document_create_document_fragment, arginfo_dom_document_create_document_fragment) - PHP_FALIAS(createTextNode, dom_document_create_text_node, arginfo_dom_document_create_text_node) - PHP_FALIAS(createComment, dom_document_create_comment, arginfo_dom_document_create_comment) - PHP_FALIAS(createCDATASection, dom_document_create_cdatasection, arginfo_dom_document_create_cdatasection) - PHP_FALIAS(createProcessingInstruction, dom_document_create_processing_instruction, arginfo_dom_document_create_processing_instruction) - PHP_FALIAS(createAttribute, dom_document_create_attribute, arginfo_dom_document_create_attribute) - PHP_FALIAS(createEntityReference, dom_document_create_entity_reference, arginfo_dom_document_create_entity_reference) - PHP_FALIAS(getElementsByTagName, dom_document_get_elements_by_tag_name, arginfo_dom_document_get_elements_by_tag_name) - PHP_FALIAS(importNode, dom_document_import_node, arginfo_dom_document_import_node) - PHP_FALIAS(createElementNS, dom_document_create_element_ns, arginfo_dom_document_create_element_ns) - PHP_FALIAS(createAttributeNS, dom_document_create_attribute_ns, arginfo_dom_document_create_attribute_ns) - PHP_FALIAS(getElementsByTagNameNS, dom_document_get_elements_by_tag_name_ns, arginfo_dom_document_get_elements_by_tag_name_ns) - PHP_FALIAS(getElementById, dom_document_get_element_by_id, arginfo_dom_document_get_element_by_id) - PHP_FALIAS(adoptNode, dom_document_adopt_node, arginfo_dom_document_adopt_node) - PHP_FALIAS(normalizeDocument, dom_document_normalize_document, arginfo_dom_document_normalize_document) - PHP_FALIAS(renameNode, dom_document_rename_node, arginfo_dom_document_rename_node) - PHP_ME(domdocument, load, arginfo_dom_document_load, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_FALIAS(save, dom_document_save, arginfo_dom_document_save) - PHP_ME(domdocument, loadXML, arginfo_dom_document_loadxml, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_FALIAS(saveXML, dom_document_savexml, arginfo_dom_document_savexml) - PHP_ME(domdocument, __construct, arginfo_dom_document_construct, ZEND_ACC_PUBLIC) - PHP_FALIAS(validate, dom_document_validate, arginfo_dom_document_validate) - PHP_FALIAS(xinclude, dom_document_xinclude, arginfo_dom_document_xinclude) -#if defined(LIBXML_HTML_ENABLED) - PHP_ME(domdocument, loadHTML, arginfo_dom_document_loadhtml, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domdocument, loadHTMLFile, arginfo_dom_document_loadhtmlfile, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_FALIAS(saveHTML, dom_document_save_html, arginfo_dom_document_savehtml) - PHP_FALIAS(saveHTMLFile, dom_document_save_html_file, arginfo_dom_document_savehtmlfile) -#endif /* defined(LIBXML_HTML_ENABLED) */ -#if defined(LIBXML_SCHEMAS_ENABLED) - PHP_FALIAS(schemaValidate, dom_document_schema_validate_file, arginfo_dom_document_schema_validate_file) - PHP_FALIAS(schemaValidateSource, dom_document_schema_validate_xml, arginfo_dom_document_schema_validate_xml) - PHP_FALIAS(relaxNGValidate, dom_document_relaxNG_validate_file, arginfo_dom_document_relaxNG_validate_file) - PHP_FALIAS(relaxNGValidateSource, dom_document_relaxNG_validate_xml, arginfo_dom_document_relaxNG_validate_xml) -#endif - PHP_ME(domdocument, registerNodeClass, arginfo_dom_document_registernodeclass, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ docType DOMDocumentType -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31 -Since: -*/ -int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - xmlDtdPtr dtdptr; - int ret; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - dtdptr = xmlGetIntSubset(docp); - if (!dtdptr) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (NULL == (*retval = php_dom_create_object((xmlNodePtr) dtdptr, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; - -} - -/* }}} */ - - - -/* {{{ implementation DOMImplementation -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA -Since: -*/ -int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - php_dom_create_implementation(retval TSRMLS_CC); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ documentElement DOMElement -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092 -Since: -*/ -int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - xmlNode *root; - int ret; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - root = xmlDocGetRootElement(docp); - if (!root) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (NULL == (*retval = php_dom_create_object(root, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - -/* {{{ encoding string -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-encoding -Since: DOM Level 3 -*/ -int dom_document_encoding_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - char *encoding; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - encoding = (char *) docp->encoding; - ALLOC_ZVAL(*retval); - - if (encoding != NULL) { - ZVAL_STRING(*retval, encoding, 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlDoc *docp; - xmlCharEncodingHandlerPtr handler; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - handler = xmlFindCharEncodingHandler(Z_STRVAL_P(newval)); - - if (handler != NULL) { - xmlCharEncCloseFunc(handler); - if (docp->encoding != NULL) { - xmlFree((xmlChar *)docp->encoding); - } - docp->encoding = xmlStrdup((const xmlChar *) Z_STRVAL_P(newval)); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Document Encoding"); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ standalone boolean -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone -Since: DOM Level 3 -*/ -int dom_document_standalone_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - int standalone; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - standalone = docp->standalone; - ZVAL_BOOL(*retval, standalone); - - return SUCCESS; -} - -int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlDoc *docp; - int standalone; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_long(newval); - - standalone = Z_LVAL_P(newval); - if (standalone > 0) { - docp->standalone = 1; - } - else if (standalone < 0) { - docp->standalone = -1; - } - else { - docp->standalone = 0; - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ version string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version -Since: DOM Level 3 -*/ -int dom_document_version_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - char *version; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - version = (char *) docp->version; - ALLOC_ZVAL(*retval); - - if (version != NULL) { - ZVAL_STRING(*retval, version, 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlDoc *docp; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (docp->version != NULL) { - xmlFree((xmlChar *) docp->version ); - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - docp->version = xmlStrdup((const xmlChar *) Z_STRVAL_P(newval)); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - -/* {{{ strictErrorChecking boolean -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking -Since: DOM Level 3 -*/ -int dom_document_strict_error_checking_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_propsptr doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->stricterror); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_propsptr doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->stricterror = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - -/* {{{ formatOutput boolean -readonly=no -*/ -int dom_document_format_output_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_propsptr doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->formatoutput); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_propsptr doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->formatoutput = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ validateOnParse boolean -readonly=no -*/ -int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_propsptr doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->validateonparse); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_propsptr doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->validateonparse = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - - -/* {{{ resolveExternals boolean -readonly=no -*/ -int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_propsptr doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->resolveexternals); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_propsptr doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->resolveexternals = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - - -/* {{{ preserveWhiteSpace boolean -readonly=no -*/ -int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_propsptr doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->preservewhitespace); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_propsptr doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->preservewhitespace = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ recover boolean -readonly=no -*/ -int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_propsptr doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->recover); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_propsptr doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->recover = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - - -/* {{{ substituteEntities boolean -readonly=no -*/ -int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_doc_propsptr doc_prop; - - ALLOC_ZVAL(*retval); - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - ZVAL_BOOL(*retval, doc_prop->substituteentities); - } else { - ZVAL_FALSE(*retval); - } - return SUCCESS; -} - -int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - dom_doc_propsptr doc_prop; - - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_boolean(newval); - - if (obj->document) { - doc_prop = dom_get_doc_props(obj->document); - doc_prop->substituteentities = Z_LVAL_P(newval); - } - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} -/* }}} */ - - -/* {{{ documentURI string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI -Since: DOM Level 3 -*/ -int dom_document_document_uri_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp; - char *url; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - url = (char *) docp->URL; - if (url != NULL) { - ZVAL_STRING(*retval, url, 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlDoc *docp; - - docp = (xmlDocPtr) dom_object_get_node(obj); - - if (docp == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (docp->URL != NULL) { - xmlFree((xmlChar *) docp->URL); - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - docp->URL = xmlStrdup((const xmlChar *) Z_STRVAL_P(newval)); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ config DOMConfiguration -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config -Since: DOM Level 3 -*/ -int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547 -Since: -*/ -PHP_FUNCTION(dom_document_create_element) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - dom_object *intern; - int ret, name_len, value_len; - char *name, *value = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (xmlValidateName((xmlChar *) name, 0) != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewDocNode(docp, NULL, name, value); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_element */ - - -/* {{{ proto DOMDocumentFragment dom_document_create_document_fragment(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5 -Since: -*/ -PHP_FUNCTION(dom_document_create_document_fragment) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - dom_object *intern; - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - node = xmlNewDocFragment(docp); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_document_fragment */ - - -/* {{{ proto DOMText dom_document_create_text_node(string data); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127 -Since: -*/ -PHP_FUNCTION(dom_document_create_text_node) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - int ret, value_len; - dom_object *intern; - char *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - node = xmlNewDocText(docp, (xmlChar *) value); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_text_node */ - - -/* {{{ proto DOMComment dom_document_create_comment(string data); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328 -Since: -*/ -PHP_FUNCTION(dom_document_create_comment) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - int ret, value_len; - dom_object *intern; - char *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - node = xmlNewDocComment(docp, (xmlChar *) value); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_comment */ - - -/* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8 -Since: -*/ -PHP_FUNCTION(dom_document_create_cdatasection) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - int ret, value_len; - dom_object *intern; - char *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - node = xmlNewCDataBlock(docp, (xmlChar *) value, value_len); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_cdatasection */ - - -/* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439 -Since: -*/ -PHP_FUNCTION(dom_document_create_processing_instruction) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp; - int ret, value_len, name_len = 0; - dom_object *intern; - char *name, *value = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (xmlValidateName((xmlChar *) name, 0) != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewPI((xmlChar *) name, (xmlChar *) value); - if (!node) { - RETURN_FALSE; - } - - node->doc = docp; - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_document_create_processing_instruction */ - - -/* {{{ proto DOMAttr dom_document_create_attribute(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198 -Since: -*/ -PHP_FUNCTION(dom_document_create_attribute) -{ - zval *id, *rv = NULL; - xmlAttrPtr node; - xmlDocPtr docp; - int ret, name_len; - dom_object *intern; - char *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (xmlValidateName((xmlChar *) name, 0) != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewDocProp(docp, (xmlChar *) name, NULL); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, (xmlNodePtr) node, &ret, intern); - -} -/* }}} end dom_document_create_attribute */ - - -/* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE -Since: -*/ -PHP_FUNCTION(dom_document_create_entity_reference) -{ - zval *id, *rv = NULL; - xmlNode *node; - xmlDocPtr docp = NULL; - dom_object *intern; - int ret, name_len; - char *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (xmlValidateName((xmlChar *) name, 0) != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewReference(docp, name); - if (!node) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, (xmlNodePtr) node, &ret, intern); -} -/* }}} end dom_document_create_entity_reference */ - - -/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094 -Since: -*/ -PHP_FUNCTION(dom_document_get_elements_by_tag_name) -{ - zval *id; - xmlDocPtr docp; - int name_len; - dom_object *intern, *namednode; - char *name; - xmlChar *local; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - local = xmlCharStrndup(name, name_len); - dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC); -} -/* }}} end dom_document_get_elements_by_tag_name */ - - -/* {{{ proto DOMNode dom_document_import_node(DOMNode importedNode, boolean deep); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Core-Document-importNode -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_import_node) -{ - zval *rv = NULL; - zval *id, *node; - xmlDocPtr docp; - xmlNodePtr nodep, retnodep; - dom_object *intern, *nodeobj; - int ret; - long recursive = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - DOM_GET_OBJ(nodep, node, xmlNodePtr, nodeobj); - - if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE - || nodep->type == XML_DOCUMENT_TYPE_NODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot import: Node Type Not Supported"); - RETURN_FALSE; - } - - if (nodep->doc == docp) { - retnodep = nodep; - } else { - retnodep = xmlDocCopyNode(nodep, docp, recursive); - if (!retnodep) { - RETURN_FALSE; - } - - } - - DOM_RET_OBJ(rv, (xmlNodePtr) retnodep, &ret, intern); -} -/* }}} end dom_document_import_node */ - - -/* {{{ proto DOMElement dom_document_create_element_ns(string namespaceURI, string qualifiedName [,string value]); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrElNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_create_element_ns) -{ - zval *id, *rv = NULL; - xmlDocPtr docp; - xmlNodePtr nodep = NULL; - xmlNsPtr nsptr = NULL; - int ret, uri_len = 0, name_len = 0, value_len = 0; - char *uri, *name, *value = NULL; - char *localname = NULL, *prefix = NULL; - int errorcode; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s|s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); - - if (errorcode == 0) { - if (xmlValidateName((xmlChar *) localname, 0) == 0) { - nodep = xmlNewDocNode (docp, NULL, localname, value); - if (nodep != NULL && uri != NULL) { - nsptr = xmlSearchNsByHref (nodep->doc, nodep, uri); - if (nsptr == NULL) { - nsptr = dom_get_ns(nodep, uri, &errorcode, prefix); - } - xmlSetNs(nodep, nsptr); - } - } else { - errorcode = INVALID_CHARACTER_ERR; - } - } - - xmlFree(localname); - if (prefix != NULL) { - xmlFree(prefix); - } - - if (errorcode != 0) { - if (nodep != NULL) { - xmlFreeNode(nodep); - } - php_dom_throw_error(errorcode, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (nodep == NULL) { - RETURN_FALSE; - } - - - nodep->ns = nsptr; - - DOM_RET_OBJ(rv, nodep, &ret, intern); -} -/* }}} end dom_document_create_element_ns */ - - -/* {{{ proto DOMAttr dom_document_create_attribute_ns(string namespaceURI, string qualifiedName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrAttrNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_create_attribute_ns) -{ - zval *id, *rv = NULL; - xmlDocPtr docp; - xmlNodePtr nodep = NULL, root; - xmlNsPtr nsptr; - int ret, uri_len = 0, name_len = 0; - char *uri, *name; - char *localname = NULL, *prefix = NULL; - dom_object *intern; - int errorcode; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - root = xmlDocGetRootElement(docp); - if (root != NULL) { - errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); - if (errorcode == 0) { - if (xmlValidateName((xmlChar *) localname, 0) == 0) { - nodep = (xmlNodePtr) xmlNewDocProp(docp, localname, NULL); - if (nodep != NULL && uri_len > 0) { - nsptr = xmlSearchNsByHref (nodep->doc, root, uri); - if (nsptr == NULL) { - nsptr = dom_get_ns(root, uri, &errorcode, prefix); - } - xmlSetNs(nodep, nsptr); - } - } else { - errorcode = INVALID_CHARACTER_ERR; - } - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Missing Root Element"); - RETURN_FALSE; - } - - xmlFree(localname); - if (prefix != NULL) { - xmlFree(prefix); - } - - if (errorcode != 0) { - if (nodep != NULL) { - xmlFreeProp((xmlAttrPtr) nodep); - } - php_dom_throw_error(errorcode, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (nodep == NULL) { - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, nodep, &ret, intern); -} -/* }}} end dom_document_create_attribute_ns */ - - -/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBTNNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns) -{ - zval *id; - xmlDocPtr docp; - int uri_len, name_len; - dom_object *intern, *namednode; - char *uri, *name; - xmlChar *local, *nsuri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - local = xmlCharStrndup(name, name_len); - nsuri = xmlCharStrndup(uri, uri_len); - dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC); -} -/* }}} end dom_document_get_elements_by_tag_name_ns */ - - -/* {{{ proto DOMElement dom_document_get_element_by_id(string elementId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBId -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_document_get_element_by_id) -{ - zval *id, *rv = NULL; - xmlDocPtr docp; - xmlAttrPtr attrp; - int ret, idname_len; - dom_object *intern; - char *idname; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &idname, &idname_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - attrp = xmlGetID(docp, (xmlChar *) idname); - - if (attrp && attrp->parent) { - DOM_RET_OBJ(rv, (xmlNodePtr) attrp->parent, &ret, intern); - } else { - RETVAL_NULL(); - } - -} -/* }}} end dom_document_get_element_by_id */ - - -/* {{{ proto DOMNode dom_document_adopt_node(DOMNode source); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-adoptNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_document_adopt_node) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_document_adopt_node */ - - -/* {{{ proto void dom_document_normalize_document(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-normalizeDocument -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_document_normalize_document) -{ - zval *id; - xmlDocPtr docp; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - dom_normalize((xmlNodePtr) docp TSRMLS_CC); -} -/* }}} end dom_document_normalize_document */ - - -/* {{{ proto DOMNode dom_document_rename_node(node n, string namespaceURI, string qualifiedName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-renameNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_document_rename_node) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_document_rename_node */ - -/* {{{ proto void DOMDocument::__construct([string version], [string encoding]); */ -PHP_METHOD(domdocument, __construct) -{ - - zval *id; - xmlDoc *docp = NULL, *olddoc; - dom_object *intern; - char *encoding, *version = NULL; - int encoding_len = 0, version_len = 0, refcount; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - docp = xmlNewDoc(version); - - if (!docp) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - if (encoding_len > 0) { - docp->encoding = (const xmlChar*)xmlStrdup(encoding); - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - olddoc = (xmlDocPtr) dom_object_get_node(intern); - if (olddoc != NULL) { - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC); - refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - if (refcount != 0) { - olddoc->_private = NULL; - } - } - intern->document = NULL; - if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC) == -1) { - RETURN_FALSE; - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMDocument::__construct */ - -char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) { - xmlURI *uri; - xmlChar *escsource; - char *file_dest; - int isFileUri = 0; - - uri = xmlCreateURI(); - escsource = xmlURIEscapeStr(source, ":"); - xmlParseURIReference(uri, escsource); - xmlFree(escsource); - - if (uri->scheme != NULL) { - /* absolute file uris - libxml only supports localhost or empty host */ - if (strncasecmp(source, "file:///",8) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 8; -#else - source += 7; -#endif - } else if (strncasecmp(source, "file://localhost/",17) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 17; -#else - source += 16; -#endif - } - } - - file_dest = source; - - if ((uri->scheme == NULL || isFileUri)) { - /* XXX possible buffer overflow if VCWD_REALPATH does not know size of resolved_path */ - if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) { - xmlFreeURI(uri); - return NULL; - } - file_dest = resolved_path; - } - - xmlFreeURI(uri); - - return file_dest; -} - - -/* {{{ */ -static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int options TSRMLS_DC) { - xmlDocPtr ret; - xmlParserCtxtPtr ctxt = NULL; - dom_doc_propsptr doc_props; - dom_object *intern; - php_libxml_ref_obj *document = NULL; - int validate, recover, resolve_externals, keep_blanks, substitute_ent; - int resolved_path_len; - int old_error_reporting = 0; - char *directory=NULL, resolved_path[MAXPATHLEN]; - - if (id != NULL) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - document = intern->document; - } - - doc_props = dom_get_doc_props(document); - validate = doc_props->validateonparse; - resolve_externals = doc_props->resolveexternals; - keep_blanks = doc_props->preservewhitespace; - substitute_ent = doc_props->substituteentities; - recover = doc_props->recover; - - if (document == NULL) { - efree(doc_props); - } - - xmlInitParser(); - - if (mode == DOM_LOAD_FILE) { - char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (file_dest) { - ctxt = xmlCreateFileParserCtxt(file_dest); - } - - } else { - ctxt = xmlCreateDocParserCtxt(source); - } - - if (ctxt == NULL) { - return(NULL); - } - - /* If loading from memory, we need to set the base directory for the document */ - if (mode != DOM_LOAD_FILE) { -#if HAVE_GETCWD - directory = VCWD_GETCWD(resolved_path, MAXPATHLEN); -#elif HAVE_GETWD - directory = VCWD_GETWD(resolved_path); -#endif - if (directory) { - if(ctxt->directory != NULL) { - xmlFree((char *) ctxt->directory); - } - resolved_path_len = strlen(resolved_path); - if (resolved_path[resolved_path_len - 1] != DEFAULT_SLASH) { - resolved_path[resolved_path_len] = DEFAULT_SLASH; - resolved_path[++resolved_path_len] = '\0'; - } - ctxt->directory = (char *) xmlCanonicPath((const xmlChar *) resolved_path); - } - } - - ctxt->vctxt.error = php_libxml_ctx_error; - ctxt->vctxt.warning = php_libxml_ctx_warning; - - if (ctxt->sax != NULL) { - ctxt->sax->error = php_libxml_ctx_error; - ctxt->sax->warning = php_libxml_ctx_warning; - } - - if (validate && ! (options & XML_PARSE_DTDVALID)) { - options |= XML_PARSE_DTDVALID; - } - if (resolve_externals && ! (options & XML_PARSE_DTDATTR)) { - options |= XML_PARSE_DTDATTR; - } - if (substitute_ent && ! (options & XML_PARSE_NOENT)) { - options |= XML_PARSE_NOENT; - } - if (keep_blanks == 0 && ! (options & XML_PARSE_NOBLANKS)) { - options |= XML_PARSE_NOBLANKS; - } - - xmlCtxtUseOptions(ctxt, options); - - ctxt->recovery = recover; - if (recover) { - old_error_reporting = EG(error_reporting); - EG(error_reporting) = old_error_reporting | E_WARNING; - } - - xmlParseDocument(ctxt); - - if (ctxt->wellFormed || recover) { - ret = ctxt->myDoc; - if (ctxt->recovery) { - EG(error_reporting) = old_error_reporting; - } - /* If loading from memory, set the base reference uri for the document */ - if (ret->URL == NULL && ctxt->directory != NULL) { - ret->URL = xmlStrdup(ctxt->directory); - } - } else { - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - - xmlFreeParserCtxt(ctxt); - - return(ret); -} -/* }}} */ - -/* {{{ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) */ -static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) { - zval *id, *rv = NULL; - xmlDoc *docp = NULL, *newdoc; - dom_doc_propsptr doc_prop; - dom_object *intern; - char *source; - int source_len, refcount, ret; - long options = 0; - - id = getThis(); - if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), dom_document_class_entry TSRMLS_CC)) { - id = NULL; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) { - return; - } - - if (!source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; - } - - newdoc = dom_document_parser(id, mode, source, options TSRMLS_CC); - - if (!newdoc) - RETURN_FALSE; - - if (id != NULL) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - docp = (xmlDocPtr) dom_object_get_node(intern); - doc_prop = NULL; - if (docp != NULL) { - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC); - doc_prop = intern->document->doc_props; - intern->document->doc_props = NULL; - refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - if (refcount != 0) { - docp->_private = NULL; - } - } - intern->document = NULL; - if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) { - RETURN_FALSE; - } - intern->document->doc_props = doc_prop; - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC); - - RETURN_TRUE; - } else { - DOM_RET_OBJ(rv, (xmlNodePtr) newdoc, &ret, NULL); - } -} -/* }}} end dom_parser_document */ - -/* {{{ proto DOMNode dom_document_load(string source [, int options]); -URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-load -Since: DOM Level 3 -*/ -PHP_METHOD(domdocument, load) -{ - dom_parse_document(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); -} -/* }}} end dom_document_load */ - -/* {{{ proto DOMNode dom_document_loadxml(string source [, int options]); -URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-loadXML -Since: DOM Level 3 -*/ -PHP_METHOD(domdocument, loadXML) -{ - dom_parse_document(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); -} -/* }}} end dom_document_loadxml */ - -/* {{{ proto int dom_document_save(string file); -Convenience method to save to file -*/ -PHP_FUNCTION(dom_document_save) -{ - zval *id; - xmlDoc *docp; - int file_len = 0, bytes, format, saveempty = 0; - dom_object *intern; - dom_doc_propsptr doc_props; - char *file; - long options = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) { - return; - } - - if (file_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename"); - RETURN_FALSE; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - /* encoding handled by property on doc */ - - doc_props = dom_get_doc_props(intern->document); - format = doc_props->formatoutput; - if (options & LIBXML_SAVE_NOEMPTYTAG) { - saveempty = xmlSaveNoEmptyTags; - xmlSaveNoEmptyTags = 1; - } - bytes = xmlSaveFormatFileEnc(file, docp, NULL, format); - if (options & LIBXML_SAVE_NOEMPTYTAG) { - xmlSaveNoEmptyTags = saveempty; - } - if (bytes == -1) { - RETURN_FALSE; - } - RETURN_LONG(bytes); -} -/* }}} end dom_document_save */ - -/* {{{ proto string dom_document_savexml([node n]); -URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-saveXML -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_document_savexml) -{ - zval *id, *nodep = NULL; - xmlDoc *docp; - xmlNode *node; - xmlBufferPtr buf; - xmlChar *mem; - dom_object *intern, *nodeobj; - dom_doc_propsptr doc_props; - int size, format, saveempty = 0; - long options = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O!l", &id, dom_document_class_entry, &nodep, dom_node_class_entry, &options) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - doc_props = dom_get_doc_props(intern->document); - format = doc_props->formatoutput; - - if (nodep != NULL) { - /* Dump contents of Node */ - DOM_GET_OBJ(node, nodep, xmlNodePtr, nodeobj); - if (node->doc != docp) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - buf = xmlBufferCreate(); - if (!buf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer"); - RETURN_FALSE; - } - if (options & LIBXML_SAVE_NOEMPTYTAG) { - saveempty = xmlSaveNoEmptyTags; - xmlSaveNoEmptyTags = 1; - } - xmlNodeDump(buf, docp, node, 0, format); - if (options & LIBXML_SAVE_NOEMPTYTAG) { - xmlSaveNoEmptyTags = saveempty; - } - mem = (xmlChar*) xmlBufferContent(buf); - if (!mem) { - xmlBufferFree(buf); - RETURN_FALSE; - } - RETVAL_STRING(mem, 1); - xmlBufferFree(buf); - } else { - if (options & LIBXML_SAVE_NOEMPTYTAG) { - saveempty = xmlSaveNoEmptyTags; - xmlSaveNoEmptyTags = 1; - } - /* Encoding is handled from the encoding property set on the document */ - xmlDocDumpFormatMemory(docp, &mem, &size, format); - if (options & LIBXML_SAVE_NOEMPTYTAG) { - xmlSaveNoEmptyTags = saveempty; - } - if (!size) { - RETURN_FALSE; - } - RETVAL_STRINGL(mem, size, 1); - xmlFree(mem); - } -} -/* }}} end dom_document_savexml */ - -static xmlNodePtr php_dom_free_xinclude_node(xmlNodePtr cur TSRMLS_DC) { - xmlNodePtr xincnode; - - xincnode = cur; - cur = cur->next; - xmlUnlinkNode(xincnode); - php_libxml_node_free_resource(xincnode TSRMLS_CC); - - return cur; -} - -static void php_dom_remove_xinclude_nodes(xmlNodePtr cur TSRMLS_DC) { - while(cur) { - if (cur->type == XML_XINCLUDE_START) { - cur = php_dom_free_xinclude_node(cur TSRMLS_CC); - - /* XML_XINCLUDE_END node will be a sibling of XML_XINCLUDE_START */ - while(cur && cur->type != XML_XINCLUDE_END) { - /* remove xinclude processing nodes from recursive xincludes */ - if (cur->type == XML_ELEMENT_NODE) { - php_dom_remove_xinclude_nodes(cur->children TSRMLS_CC); - } - cur = cur->next; - } - - if (cur && cur->type == XML_XINCLUDE_END) { - cur = php_dom_free_xinclude_node(cur TSRMLS_CC); - } - } else { - if (cur->type == XML_ELEMENT_NODE) { - php_dom_remove_xinclude_nodes(cur->children TSRMLS_CC); - } - cur = cur->next; - } - } -} - -/* {{{ proto int dom_document_xinclude([int options]) - Substitutues xincludes in a DomDocument */ -PHP_FUNCTION(dom_document_xinclude) -{ - zval *id; - xmlDoc *docp; - xmlNodePtr root; - long flags = 0; - int err; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_document_class_entry, &flags) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - err = xmlXIncludeProcessFlags(docp, flags); - - /* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these - are added via xmlXIncludeProcess to mark beginning and ending of xincluded document - but are not wanted in resulting document - must be done even if err as it could fail after - having processed some xincludes */ - root = (xmlNodePtr) docp->children; - while(root && root->type != XML_ELEMENT_NODE && root->type != XML_XINCLUDE_START) { - root = root->next; - } - if (root) { - php_dom_remove_xinclude_nodes(root TSRMLS_CC); - } - - if (err) { - RETVAL_LONG(err); - } else { - RETVAL_FALSE; - } - -} - - -/* {{{ proto boolean dom_document_validate(); -Since: DOM extended -*/ -PHP_FUNCTION(dom_document_validate) -{ - zval *id; - xmlDoc *docp; - dom_object *intern; - xmlValidCtxt *cvp; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (docp->intSubset == NULL) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No DTD given in XML-Document"); - } - - cvp = xmlNewValidCtxt(); - - cvp->userData = NULL; - cvp->error = (xmlValidityErrorFunc) php_libxml_error_handler; - cvp->warning = (xmlValidityErrorFunc) php_libxml_error_handler; - - if (xmlValidateDocument(cvp, docp)) { - RETVAL_TRUE; - } else { - RETVAL_FALSE; - } - - xmlFreeValidCtxt(cvp); - -} - - -#if defined(LIBXML_SCHEMAS_ENABLED) -static void -_dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - zval *id; - xmlDoc *docp; - dom_object *intern; - char *source = NULL, *valid_file = NULL; - int source_len = 0; - xmlSchemaParserCtxtPtr parser; - xmlSchemaPtr sptr; - xmlSchemaValidCtxtPtr vptr; - int is_valid; - char resolved_path[MAXPATHLEN + 1]; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) { - return; - } - - if (source_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source"); - RETURN_FALSE; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - switch (type) { - case DOM_LOAD_FILE: - valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (!valid_file) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema file source"); - RETURN_FALSE; - } - parser = xmlSchemaNewParserCtxt(valid_file); - break; - case DOM_LOAD_STRING: - parser = xmlSchemaNewMemParserCtxt(source, source_len); - /* If loading from memory, we need to set the base directory for the document - but it is not apparent how to do that for schema's */ - break; - default: - return; - } - - xmlSchemaSetParserErrors(parser, - (xmlSchemaValidityErrorFunc) php_libxml_error_handler, - (xmlSchemaValidityWarningFunc) php_libxml_error_handler, - parser); - sptr = xmlSchemaParse(parser); - xmlSchemaFreeParserCtxt(parser); - if (!sptr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema"); - RETURN_FALSE; - } - - docp = (xmlDocPtr) dom_object_get_node(intern); - - vptr = xmlSchemaNewValidCtxt(sptr); - if (!vptr) { - xmlSchemaFree(sptr); - php_error(E_ERROR, "Invalid Schema Validation Context"); - RETURN_FALSE; - } - - xmlSchemaSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr); - is_valid = xmlSchemaValidateDoc(vptr, docp); - xmlSchemaFree(sptr); - xmlSchemaFreeValidCtxt(vptr); - - if (is_valid == 0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} - -/* {{{ proto boolean dom_document_schema_validate_file(string filename); */ -PHP_FUNCTION(dom_document_schema_validate_file) -{ - _dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); -} -/* }}} end dom_document_schema_validate_file */ - -/* {{{ proto boolean dom_document_schema_validate(string source); */ -PHP_FUNCTION(dom_document_schema_validate_xml) -{ - _dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); -} -/* }}} end dom_document_schema_validate */ - - -static void -_dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - zval *id; - xmlDoc *docp; - dom_object *intern; - char *source = NULL, *valid_file = NULL; - int source_len = 0; - xmlRelaxNGParserCtxtPtr parser; - xmlRelaxNGPtr sptr; - xmlRelaxNGValidCtxtPtr vptr; - int is_valid; - char resolved_path[MAXPATHLEN + 1]; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) { - return; - } - - if (source_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source"); - RETURN_FALSE; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - switch (type) { - case DOM_LOAD_FILE: - valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (!valid_file) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG file source"); - RETURN_FALSE; - } - parser = xmlRelaxNGNewParserCtxt(valid_file); - break; - case DOM_LOAD_STRING: - parser = xmlRelaxNGNewMemParserCtxt(source, source_len); - /* If loading from memory, we need to set the base directory for the document - but it is not apparent how to do that for schema's */ - break; - default: - return; - } - - xmlRelaxNGSetParserErrors(parser, - (xmlRelaxNGValidityErrorFunc) php_libxml_error_handler, - (xmlRelaxNGValidityWarningFunc) php_libxml_error_handler, - parser); - sptr = xmlRelaxNGParse(parser); - xmlRelaxNGFreeParserCtxt(parser); - if (!sptr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG"); - RETURN_FALSE; - } - - docp = (xmlDocPtr) dom_object_get_node(intern); - - vptr = xmlRelaxNGNewValidCtxt(sptr); - if (!vptr) { - xmlRelaxNGFree(sptr); - php_error(E_ERROR, "Invalid RelaxNG Validation Context"); - RETURN_FALSE; - } - - xmlRelaxNGSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr); - is_valid = xmlRelaxNGValidateDoc(vptr, docp); - xmlRelaxNGFree(sptr); - xmlRelaxNGFreeValidCtxt(vptr); - - if (is_valid == 0) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} - -/* {{{ proto boolean dom_document_relaxNG_validate_file(string filename); */ -PHP_FUNCTION(dom_document_relaxNG_validate_file) -{ - _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); -} -/* }}} end dom_document_relaxNG_validate_file */ - -/* {{{ proto boolean dom_document_relaxNG_validate_xml(string source); */ -PHP_FUNCTION(dom_document_relaxNG_validate_xml) -{ - _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); -} -/* }}} end dom_document_relaxNG_validate_xml */ - -#endif - -#if defined(LIBXML_HTML_ENABLED) - -static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - zval *id, *rv = NULL; - xmlDoc *docp = NULL, *newdoc; - dom_object *intern; - dom_doc_propsptr doc_prop; - char *source; - int source_len, refcount, ret; - htmlParserCtxtPtr ctxt; - - id = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) { - return; - } - - if (!source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; - } - - if (mode == DOM_LOAD_FILE) { - ctxt = htmlCreateFileParserCtxt(source, NULL); - } else { - source_len = xmlStrlen(source); - ctxt = htmlCreateMemoryParserCtxt(source, source_len); - } - - if (!ctxt) { - RETURN_FALSE; - } - - ctxt->vctxt.error = php_libxml_ctx_error; - ctxt->vctxt.warning = php_libxml_ctx_warning; - if (ctxt->sax != NULL) { - ctxt->sax->error = php_libxml_ctx_error; - ctxt->sax->warning = php_libxml_ctx_warning; - } - htmlParseDocument(ctxt); - newdoc = ctxt->myDoc; - htmlFreeParserCtxt(ctxt); - - if (!newdoc) - RETURN_FALSE; - - if (id != NULL && instanceof_function(Z_OBJCE_P(id), dom_document_class_entry TSRMLS_CC)) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - docp = (xmlDocPtr) dom_object_get_node(intern); - doc_prop = NULL; - if (docp != NULL) { - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC); - doc_prop = intern->document->doc_props; - intern->document->doc_props = NULL; - refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - if (refcount != 0) { - docp->_private = NULL; - } - } - intern->document = NULL; - if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) { - RETURN_FALSE; - } - intern->document->doc_props = doc_prop; - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC); - - RETURN_TRUE; - } else { - DOM_RET_OBJ(rv, (xmlNodePtr) newdoc, &ret, NULL); - } -} - -/* {{{ proto DOMNode dom_document_load_html_file(string source); -Since: DOM extended -*/ -PHP_METHOD(domdocument, loadHTMLFile) -{ - dom_load_html(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE); -} -/* }}} end dom_document_load_html_file */ - -/* {{{ proto DOMNode dom_document_load_html(string source); -Since: DOM extended -*/ -PHP_METHOD(domdocument, loadHTML) -{ - dom_load_html(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING); -} -/* }}} end dom_document_load_html */ - -/* {{{ proto int dom_document_save_html_file(string file); -Convenience method to save to file as html -*/ -PHP_FUNCTION(dom_document_save_html_file) -{ - zval *id; - xmlDoc *docp; - int file_len, bytes, format; - dom_object *intern; - dom_doc_propsptr doc_props; - char *file; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) { - return; - } - - if (file_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename"); - RETURN_FALSE; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - /* encoding handled by property on doc */ - - doc_props = dom_get_doc_props(intern->document); - format = doc_props->formatoutput; - bytes = htmlSaveFileFormat(file, docp, NULL, format); - - if (bytes == -1) { - RETURN_FALSE; - } - RETURN_LONG(bytes); -} -/* }}} end dom_document_save_html_file */ - -/* {{{ proto string dom_document_save_html(); -Convenience method to output as html -*/ -PHP_FUNCTION(dom_document_save_html) -{ - zval *id; - xmlDoc *docp; - dom_object *intern; - xmlChar *mem; - int size; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - htmlDocDumpMemory(docp, &mem, &size); - if (!size) { - if (mem) - xmlFree(mem); - RETURN_FALSE; - } - RETVAL_STRINGL(mem, size, 1); - xmlFree(mem); -} -/* }}} end dom_document_save_html */ - -#endif /* defined(LIBXML_HTML_ENABLED) */ - -/* {{{ proto boolean DOMDocument::registerNodeClass(string baseclass, string extendedclass); - Register extended class used to create base node type */ -PHP_METHOD(domdocument, registerNodeClass) -{ - zval *id; - xmlDoc *docp; - char *baseclass = NULL, *extendedclass = NULL; - int baseclass_len = 0, extendedclass_len = 0; - zend_class_entry *basece = NULL, *ce = NULL; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss!", &id, dom_document_class_entry, &baseclass, &baseclass_len, &extendedclass, &extendedclass_len) == FAILURE) { - return; - } - - if (baseclass_len) { - zend_class_entry **pce; - if (zend_lookup_class(baseclass, baseclass_len, &pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", baseclass); - return; - } - basece = *pce; - } - - if (basece == NULL || ! instanceof_function(basece, dom_node_class_entry TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s is not derived from DOMNode.", baseclass); - return; - } - - if (extendedclass_len) { - zend_class_entry **pce; - if (zend_lookup_class(extendedclass, extendedclass_len, &pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", extendedclass); - } - ce = *pce; - } - - if (ce == NULL || instanceof_function(ce, basece TSRMLS_CC)) { - - DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - - if (dom_set_doc_classmap(intern->document, basece, ce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s could not be registered.", extendedclass); - } - RETURN_TRUE; - } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s is not derived from %s.", extendedclass, baseclass); - } - - RETURN_FALSE; -} -/* }}} */ - -#endif /* HAVE_LIBXML && HAVE_DOM */ diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c deleted file mode 100644 index f6030fd47ef62..0000000000000 --- a/ext/dom/documentfragment.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_documentfragement_construct, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_documentfragement_appendXML, 0, 0, 1) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMDocumentFragment extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-B63ED1A3 -* Since: -*/ - -zend_function_entry php_dom_documentfragment_class_functions[] = { - PHP_ME(domdocumentfragment, __construct, arginfo_dom_documentfragement_construct, ZEND_ACC_PUBLIC) - PHP_ME(domdocumentfragment, appendXML, arginfo_dom_documentfragement_appendXML, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMDocumentFragment::__construct(); */ -PHP_METHOD(domdocumentfragment, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - nodep = xmlNewDocFragment(NULL); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - /* php_dom_set_object(intern, nodep TSRMLS_CC); */ - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMDocumentFragment::__construct */ - -/* php_dom_xmlSetTreeDoc is a custom implementation of xmlSetTreeDoc - needed for hack in appendXML due to libxml bug - no need to share this function */ -static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) { - xmlAttrPtr prop; - xmlNodePtr cur; - - if (tree) { - if(tree->type == XML_ELEMENT_NODE) { - prop = tree->properties; - while (prop != NULL) { - prop->doc = doc; - if (prop->children) { - cur = prop->children; - while (cur != NULL) { - php_dom_xmlSetTreeDoc(cur, doc); - cur = cur->next; - } - } - prop = prop->next; - } - } - if (tree->children != NULL) { - cur = tree->children; - while (cur != NULL) { - php_dom_xmlSetTreeDoc(cur, doc); - cur = cur->next; - } - } - tree->doc = doc; - } -} - -/* {{{ proto void DOMDocumentFragment::appendXML(string data); */ -PHP_METHOD(domdocumentfragment, appendXML) { - zval *id; - xmlNode *nodep; - dom_object *intern; - char *data = NULL; - int data_len = 0; - int err; - xmlNodePtr lst; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_documentfragment_class_entry, &data, &data_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - if (data) { - err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, data, &lst); - if (err != 0) { - RETURN_FALSE; - } - /* Following needed due to bug in libxml2 <= 2.6.14 - ifdef after next libxml release as bug is fixed in their cvs */ - php_dom_xmlSetTreeDoc(lst, nodep->doc); - /* End stupid hack */ - - xmlAddChildList(nodep,lst); - } - - RETURN_TRUE; -} - -#endif diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c deleted file mode 100644 index ebd4e65be0849..0000000000000 --- a/ext/dom/documenttype.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* -* class DOMDocumentType extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-412266927 -* Since: -*/ - -zend_function_entry php_dom_documenttype_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ name string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1844763134 -Since: -*/ -int dom_documenttype_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr dtdptr; - - dtdptr = (xmlDtdPtr) dom_object_get_node(obj); - - if (dtdptr == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, (char *) (dtdptr->name), 1); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ entities DOMNamedNodeMap -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1788794630 -Since: -*/ -int dom_documenttype_entities_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr doctypep; - xmlHashTable *entityht; - dom_object *intern; - - doctypep = (xmlDtdPtr) dom_object_get_node(obj); - - if (doctypep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - MAKE_STD_ZVAL(*retval); - php_dom_create_interator(*retval, DOM_NAMEDNODEMAP TSRMLS_CC); - - entityht = (xmlHashTable *) doctypep->entities; - - intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC); - dom_namednode_iter(obj, XML_ENTITY_NODE, intern, entityht, NULL, NULL TSRMLS_CC); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ notations DOMNamedNodeMap -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D46829EF -Since: -*/ -int dom_documenttype_notations_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr doctypep; - xmlHashTable *notationht; - dom_object *intern; - - doctypep = (xmlDtdPtr) dom_object_get_node(obj); - - if (doctypep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - MAKE_STD_ZVAL(*retval); - php_dom_create_interator(*retval, DOM_NAMEDNODEMAP TSRMLS_CC); - - notationht = (xmlHashTable *) doctypep->notations; - - intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC); - dom_namednode_iter(obj, XML_NOTATION_NODE, intern, notationht, NULL, NULL TSRMLS_CC); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ publicId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-publicId -Since: DOM Level 2 -*/ -int dom_documenttype_public_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr dtdptr; - - dtdptr = (xmlDtdPtr) dom_object_get_node(obj); - - if (dtdptr == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (dtdptr->ExternalID) { - ZVAL_STRING(*retval, (char *) (dtdptr->ExternalID), 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - return SUCCESS; - -} - -/* }}} */ - - - -/* {{{ systemId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-systemId -Since: DOM Level 2 -*/ -int dom_documenttype_system_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDtdPtr dtdptr; - - dtdptr = (xmlDtdPtr) dom_object_get_node(obj); - - if (dtdptr == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (dtdptr->SystemID) { - ZVAL_STRING(*retval, (char *) (dtdptr->SystemID), 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ internalSubset string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-internalSubset -Since: DOM Level 2 -*/ -int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - - xmlDtdPtr dtdptr; - xmlDtd *intsubset; - xmlOutputBuffer *buff = NULL; - xmlChar *strintsubset; - - dtdptr = (xmlDtdPtr) dom_object_get_node(obj); - - if (dtdptr == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (dtdptr->doc != NULL && ((intsubset = dtdptr->doc->intSubset) != NULL)) { - buff = xmlAllocOutputBuffer(NULL); - if (buff != NULL) { - xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL); - xmlOutputBufferFlush(buff); - strintsubset = xmlStrndup(buff->buffer->content, buff->buffer->use); - (void)xmlOutputBufferClose(buff); - ZVAL_STRING(*retval, (char *) strintsubset, 1); - return SUCCESS; - } - } - - ZVAL_EMPTY_STRING(*retval); - - return SUCCESS; - -} - -/* }}} */ - -#endif diff --git a/ext/dom/dom.dsp b/ext/dom/dom.dsp deleted file mode 100644 index f2ae5b1a76759..0000000000000 --- a/ext/dom/dom.dsp +++ /dev/null @@ -1,250 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dom" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dom - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dom.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dom.mak" CFG="dom - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dom - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dom - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dom - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOM" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /D "COMPILE_DL_DOM" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOM=1 /D "LIBXML_THREAD_ENABLED" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 wsock32.lib php5ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /machine:I386 /out:"..\..\Release_TS/php_dom.dll" /implib:"..\..\Release_TS/php_dom.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "dom - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOM" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /D "COMPILE_DL_DOM" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOM=1 /D LIBXML_THREAD_ENABLED=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib ws2_32.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS\php_dom.dll" /implib:"..\..\Debug_TS/php_dom.lib" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" - -!ENDIF - -# Begin Target - -# Name "dom - Win32 Release_TS" -# Name "dom - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\attr.c -# End Source File -# Begin Source File - -SOURCE=.\cdatasection.c -# End Source File -# Begin Source File - -SOURCE=.\characterdata.c -# End Source File -# Begin Source File - -SOURCE=.\comment.c -# End Source File -# Begin Source File - -SOURCE=.\document.c -# End Source File -# Begin Source File - -SOURCE=.\documentfragment.c -# End Source File -# Begin Source File - -SOURCE=.\documenttype.c -# End Source File -# Begin Source File - -SOURCE=.\domconfiguration.c -# End Source File -# Begin Source File - -SOURCE=.\domerror.c -# End Source File -# Begin Source File - -SOURCE=.\domerrorhandler.c -# End Source File -# Begin Source File - -SOURCE=.\domexception.c -# End Source File -# Begin Source File - -SOURCE=.\domimplementation.c -# End Source File -# Begin Source File - -SOURCE=.\domimplementationlist.c -# End Source File -# Begin Source File - -SOURCE=.\domimplementationsource.c -# End Source File -# Begin Source File - -SOURCE=.\domlocator.c -# End Source File -# Begin Source File - -SOURCE=.\domstringlist.c -# End Source File -# Begin Source File - -SOURCE=.\element.c -# End Source File -# Begin Source File - -SOURCE=.\entity.c -# End Source File -# Begin Source File - -SOURCE=.\entityreference.c -# End Source File -# Begin Source File - -SOURCE=.\namednodemap.c -# End Source File -# Begin Source File - -SOURCE=.\namelist.c -# End Source File -# Begin Source File - -SOURCE=.\node.c -# End Source File -# Begin Source File - -SOURCE=.\nodelist.c -# End Source File -# Begin Source File - -SOURCE=.\notation.c -# End Source File -# Begin Source File - -SOURCE=.\php_dom.c -# End Source File -# Begin Source File - -SOURCE=.\processinginstruction.c -# End Source File -# Begin Source File - -SOURCE=.\string_extend.c -# End Source File -# Begin Source File - -SOURCE=.\text.c -# End Source File -# Begin Source File - -SOURCE=.\typeinfo.c -# End Source File -# Begin Source File - -SOURCE=.\userdatahandler.c -# End Source File -# Begin Source File - -SOURCE=.\xpath.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\dom_ce.h -# End Source File -# Begin Source File - -SOURCE=.\dom_fe.h -# End Source File -# Begin Source File - -SOURCE=.\dom_properties.h -# End Source File -# Begin Source File - -SOURCE=.\php_dom.h -# End Source File -# Begin Source File - -SOURCE=.\xml_common.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/dom/dom_ce.h b/ext/dom/dom_ce.h deleted file mode 100644 index a15ce074eb6ba..0000000000000 --- a/ext/dom/dom_ce.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#ifndef DOM_CE_H -#define DOM_CE_H - -extern zend_class_entry *dom_domexception_class_entry; -extern zend_class_entry *dom_domstringlist_class_entry; -extern zend_class_entry *dom_namelist_class_entry; -extern zend_class_entry *dom_domimplementationlist_class_entry; -extern zend_class_entry *dom_domimplementationsource_class_entry; -extern zend_class_entry *dom_domimplementation_class_entry; -extern zend_class_entry *dom_documentfragment_class_entry; -extern zend_class_entry *dom_document_class_entry; -extern zend_class_entry *dom_nodelist_class_entry; -extern zend_class_entry *dom_namednodemap_class_entry; -extern zend_class_entry *dom_characterdata_class_entry; -extern zend_class_entry *dom_attr_class_entry; -extern zend_class_entry *dom_element_class_entry; -extern zend_class_entry *dom_text_class_entry; -extern zend_class_entry *dom_comment_class_entry; -extern zend_class_entry *dom_typeinfo_class_entry; -extern zend_class_entry *dom_userdatahandler_class_entry; -extern zend_class_entry *dom_domerror_class_entry; -extern zend_class_entry *dom_domerrorhandler_class_entry; -extern zend_class_entry *dom_domlocator_class_entry; -extern zend_class_entry *dom_domconfiguration_class_entry; -extern zend_class_entry *dom_cdatasection_class_entry; -extern zend_class_entry *dom_documenttype_class_entry; -extern zend_class_entry *dom_notation_class_entry; -extern zend_class_entry *dom_entity_class_entry; -extern zend_class_entry *dom_entityreference_class_entry; -extern zend_class_entry *dom_processinginstruction_class_entry; -extern zend_class_entry *dom_string_extend_class_entry; -#if defined(LIBXML_XPATH_ENABLED) -extern zend_class_entry *dom_xpath_class_entry; -#endif -extern zend_class_entry *dom_namespace_node_class_entry; - -#endif /* DOM_CE_H */ diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h deleted file mode 100644 index be48f6cfe461b..0000000000000 --- a/ext/dom/dom_fe.h +++ /dev/null @@ -1,269 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#ifndef DOM_FE_H -#define DOM_FE_H - -extern zend_function_entry php_dom_domexception_class_functions[]; -extern zend_function_entry php_dom_domstringlist_class_functions[]; -extern zend_function_entry php_dom_namelist_class_functions[]; -extern zend_function_entry php_dom_domimplementationlist_class_functions[]; -extern zend_function_entry php_dom_domimplementationsource_class_functions[]; -extern zend_function_entry php_dom_domimplementation_class_functions[]; -extern zend_function_entry php_dom_documentfragment_class_functions[]; -extern zend_function_entry php_dom_document_class_functions[]; -extern zend_function_entry php_dom_node_class_functions[]; -extern zend_function_entry php_dom_nodelist_class_functions[]; -extern zend_function_entry php_dom_namednodemap_class_functions[]; -extern zend_function_entry php_dom_characterdata_class_functions[]; -extern zend_function_entry php_dom_attr_class_functions[]; -extern zend_function_entry php_dom_element_class_functions[]; -extern zend_function_entry php_dom_text_class_functions[]; -extern zend_function_entry php_dom_comment_class_functions[]; -extern zend_function_entry php_dom_typeinfo_class_functions[]; -extern zend_function_entry php_dom_userdatahandler_class_functions[]; -extern zend_function_entry php_dom_domerror_class_functions[]; -extern zend_function_entry php_dom_domerrorhandler_class_functions[]; -extern zend_function_entry php_dom_domlocator_class_functions[]; -extern zend_function_entry php_dom_domconfiguration_class_functions[]; -extern zend_function_entry php_dom_cdatasection_class_functions[]; -extern zend_function_entry php_dom_documenttype_class_functions[]; -extern zend_function_entry php_dom_notation_class_functions[]; -extern zend_function_entry php_dom_entity_class_functions[]; -extern zend_function_entry php_dom_entityreference_class_functions[]; -extern zend_function_entry php_dom_processinginstruction_class_functions[]; -extern zend_function_entry php_dom_string_extend_class_functions[]; -extern zend_function_entry php_dom_xpath_class_functions[]; - -/* domexception errors */ -typedef enum { -/* PHP_ERR is non-spec code for PHP errors: */ - PHP_ERR = 0, - INDEX_SIZE_ERR = 1, - DOMSTRING_SIZE_ERR = 2, - HIERARCHY_REQUEST_ERR = 3, - WRONG_DOCUMENT_ERR = 4, - INVALID_CHARACTER_ERR = 5, - NO_DATA_ALLOWED_ERR = 6, - NO_MODIFICATION_ALLOWED_ERR = 7, - NOT_FOUND_ERR = 8, - NOT_SUPPORTED_ERR = 9, - INUSE_ATTRIBUTE_ERR = 10, -/* Introduced in DOM Level 2: */ - INVALID_STATE_ERR = 11, -/* Introduced in DOM Level 2: */ - SYNTAX_ERR = 12, -/* Introduced in DOM Level 2: */ - INVALID_MODIFICATION_ERR = 13, -/* Introduced in DOM Level 2: */ - NAMESPACE_ERR = 14, -/* Introduced in DOM Level 2: */ - INVALID_ACCESS_ERR = 15, -/* Introduced in DOM Level 3: */ - VALIDATION_ERR = 16 -} dom_exception_code; - -/* domstringlist methods */ -PHP_FUNCTION(dom_domstringlist_item); - -/* domnamelist methods */ -PHP_FUNCTION(dom_namelist_get_name); -PHP_FUNCTION(dom_namelist_get_namespace_uri); - -/* domimplementationlist methods */ -PHP_FUNCTION(dom_domimplementationlist_item); - -/* domimplementationsource methods */ -PHP_FUNCTION(dom_domimplementationsource_get_domimplementation); -PHP_FUNCTION(dom_domimplementationsource_get_domimplementations); - -/* domimplementation methods */ -PHP_METHOD(domimplementation, hasFeature); -PHP_METHOD(domimplementation, createDocumentType); -PHP_METHOD(domimplementation, createDocument); -PHP_METHOD(domimplementation, getFeature); - -/* domdocumentfragment methods */ -PHP_METHOD(domdocumentfragment, __construct); -PHP_METHOD(domdocumentfragment, appendXML); - -/* domdocument methods */ -PHP_FUNCTION(dom_document_create_element); -PHP_FUNCTION(dom_document_create_document_fragment); -PHP_FUNCTION(dom_document_create_text_node); -PHP_FUNCTION(dom_document_create_comment); -PHP_FUNCTION(dom_document_create_cdatasection); -PHP_FUNCTION(dom_document_create_processing_instruction); -PHP_FUNCTION(dom_document_create_attribute); -PHP_FUNCTION(dom_document_create_entity_reference); -PHP_FUNCTION(dom_document_get_elements_by_tag_name); -PHP_FUNCTION(dom_document_import_node); -PHP_FUNCTION(dom_document_create_element_ns); -PHP_FUNCTION(dom_document_create_attribute_ns); -PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns); -PHP_FUNCTION(dom_document_get_element_by_id); -PHP_FUNCTION(dom_document_adopt_node); -PHP_FUNCTION(dom_document_normalize_document); -PHP_FUNCTION(dom_document_rename_node); -PHP_METHOD(domdocument, __construct); - /* convienience methods */ -PHP_METHOD(domdocument, load); -PHP_FUNCTION(dom_document_save); -PHP_METHOD(domdocument, loadXML); -PHP_FUNCTION(dom_document_savexml); -PHP_FUNCTION(dom_document_validate); -PHP_FUNCTION(dom_document_xinclude); -PHP_METHOD(domdocument, registerNodeClass); - -#if defined(LIBXML_HTML_ENABLED) -PHP_METHOD(domdocument, loadHTML); -PHP_METHOD(domdocument, loadHTMLFile); -PHP_FUNCTION(dom_document_save_html); -PHP_FUNCTION(dom_document_save_html_file); -#endif /* defined(LIBXML_HTML_ENABLED) */ - -#if defined(LIBXML_SCHEMAS_ENABLED) -PHP_FUNCTION(dom_document_schema_validate_file); -PHP_FUNCTION(dom_document_schema_validate_xml); -PHP_FUNCTION(dom_document_relaxNG_validate_file); -PHP_FUNCTION(dom_document_relaxNG_validate_xml); -#endif - -/* domnode methods */ -PHP_FUNCTION(dom_node_insert_before); -PHP_FUNCTION(dom_node_replace_child); -PHP_FUNCTION(dom_node_remove_child); -PHP_FUNCTION(dom_node_append_child); -PHP_FUNCTION(dom_node_has_child_nodes); -PHP_FUNCTION(dom_node_clone_node); -PHP_FUNCTION(dom_node_normalize); -PHP_FUNCTION(dom_node_is_supported); -PHP_FUNCTION(dom_node_has_attributes); -PHP_FUNCTION(dom_node_compare_document_position); -PHP_FUNCTION(dom_node_is_same_node); -PHP_FUNCTION(dom_node_lookup_prefix); -PHP_FUNCTION(dom_node_is_default_namespace); -PHP_FUNCTION(dom_node_lookup_namespace_uri); -PHP_FUNCTION(dom_node_is_equal_node); -PHP_FUNCTION(dom_node_get_feature); -PHP_FUNCTION(dom_node_set_user_data); -PHP_FUNCTION(dom_node_get_user_data); -PHP_METHOD(domnode, C14N); -PHP_METHOD(domnode, C14NFile); -PHP_METHOD(domnode, getNodePath); - -/* domnodelist methods */ -PHP_FUNCTION(dom_nodelist_item); - -/* domnamednodemap methods */ -PHP_FUNCTION(dom_namednodemap_get_named_item); -PHP_FUNCTION(dom_namednodemap_set_named_item); -PHP_FUNCTION(dom_namednodemap_remove_named_item); -PHP_FUNCTION(dom_namednodemap_item); -PHP_FUNCTION(dom_namednodemap_get_named_item_ns); -PHP_FUNCTION(dom_namednodemap_set_named_item_ns); -PHP_FUNCTION(dom_namednodemap_remove_named_item_ns); - -/* domcharacterdata methods */ -PHP_FUNCTION(dom_characterdata_substring_data); -PHP_FUNCTION(dom_characterdata_append_data); -PHP_FUNCTION(dom_characterdata_insert_data); -PHP_FUNCTION(dom_characterdata_delete_data); -PHP_FUNCTION(dom_characterdata_replace_data); - -/* domattr methods */ -PHP_FUNCTION(dom_attr_is_id); -PHP_METHOD(domattr, __construct); - -/* domelement methods */ -PHP_FUNCTION(dom_element_get_attribute); -PHP_FUNCTION(dom_element_set_attribute); -PHP_FUNCTION(dom_element_remove_attribute); -PHP_FUNCTION(dom_element_get_attribute_node); -PHP_FUNCTION(dom_element_set_attribute_node); -PHP_FUNCTION(dom_element_remove_attribute_node); -PHP_FUNCTION(dom_element_get_elements_by_tag_name); -PHP_FUNCTION(dom_element_get_attribute_ns); -PHP_FUNCTION(dom_element_set_attribute_ns); -PHP_FUNCTION(dom_element_remove_attribute_ns); -PHP_FUNCTION(dom_element_get_attribute_node_ns); -PHP_FUNCTION(dom_element_set_attribute_node_ns); -PHP_FUNCTION(dom_element_get_elements_by_tag_name_ns); -PHP_FUNCTION(dom_element_has_attribute); -PHP_FUNCTION(dom_element_has_attribute_ns); -PHP_FUNCTION(dom_element_set_id_attribute); -PHP_FUNCTION(dom_element_set_id_attribute_ns); -PHP_FUNCTION(dom_element_set_id_attribute_node); -PHP_METHOD(domelement, __construct); - -/* domtext methods */ -PHP_FUNCTION(dom_text_split_text); -PHP_FUNCTION(dom_text_is_whitespace_in_element_content); -PHP_FUNCTION(dom_text_replace_whole_text); -PHP_METHOD(domtext, __construct); - -/* domcomment methods */ -PHP_METHOD(domcomment, __construct); - -/* domtypeinfo methods */ - -/* domuserdatahandler methods */ -PHP_FUNCTION(dom_userdatahandler_handle); - -/* domdomerror methods */ - -/* domerrorhandler methods */ -PHP_FUNCTION(dom_domerrorhandler_handle_error); - -/* domlocator methods */ - -/* domconfiguration methods */ -PHP_FUNCTION(dom_domconfiguration_set_parameter); -PHP_FUNCTION(dom_domconfiguration_get_parameter); -PHP_FUNCTION(dom_domconfiguration_can_set_parameter); - -/* domcdatasection methods */ -PHP_METHOD(domcdatasection, __construct); - -/* domdocumenttype methods */ - -/* domnotation methods */ - -/* domentity methods */ - -/* domentityreference methods */ -PHP_METHOD(domentityreference, __construct); - -/* domprocessinginstruction methods */ -PHP_METHOD(domprocessinginstruction, __construct); - -/* string_extend methods */ -PHP_FUNCTION(dom_string_extend_find_offset16); -PHP_FUNCTION(dom_string_extend_find_offset32); - -#if defined(LIBXML_XPATH_ENABLED) -/* xpath methods */ -PHP_METHOD(domxpath, __construct); -PHP_FUNCTION(dom_xpath_register_ns); -PHP_FUNCTION(dom_xpath_query); -PHP_FUNCTION(dom_xpath_evaluate); -#endif - -#endif /* DOM_FE_H */ diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c deleted file mode 100644 index f09f0002ffd97..0000000000000 --- a/ext/dom/dom_iterators.c +++ /dev/null @@ -1,331 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" -#include "dom_ce.h" - -typedef struct _nodeIterator nodeIterator; -struct _nodeIterator { - int cur; - int index; - xmlNode *node; -}; - -typedef struct _notationIterator notationIterator; -struct _notationIterator { - int cur; - int index; - xmlNotation *notation; -}; - -static void itemHashScanner (void *payload, void *data, xmlChar *name) { - nodeIterator *priv = (nodeIterator *)data; - - if(priv->cur < priv->index) { - priv->cur++; - } else { - if(priv->node == NULL) { - priv->node = (xmlNode *)payload; - } - } -} - -xmlNodePtr create_notation(const xmlChar *name, - const xmlChar *ExternalID, const xmlChar *SystemID) { - xmlEntityPtr ret; - - ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity)); - memset(ret, 0, sizeof(xmlEntity)); - ret->type = XML_NOTATION_NODE; - ret->name = xmlStrdup(name); - ret->ExternalID = xmlStrdup(ExternalID); - ret->SystemID = xmlStrdup(SystemID); - ret->length = 0; - ret->content = NULL; - ret->URI = NULL; - ret->orig = NULL; - ret->children = NULL; - ret->parent = NULL; - ret->doc = NULL; - ret->_private = NULL; - ret->last = NULL; - ret->prev = NULL; - return((xmlNodePtr) ret); -} - -xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index) -{ - xmlNode *nodep = NULL; - nodeIterator *iter; - int htsize; - - if ((htsize = xmlHashSize(ht)) > 0 && index < htsize) { - iter = emalloc(sizeof(nodeIterator)); - iter->cur = 0; - iter->index = index; - iter->node = NULL; - xmlHashScan(ht, itemHashScanner, iter); - nodep = iter->node; - efree(iter); - return nodep; - } else { - return NULL; - } -} - -xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index) -{ - notationIterator *iter; - xmlNotation *notep = NULL; - int htsize; - - if ((htsize = xmlHashSize(ht)) > 0 && index < htsize) { - iter = emalloc(sizeof(notationIterator)); - iter->cur = 0; - iter->index = index; - iter->notation = NULL; - xmlHashScan(ht, itemHashScanner, iter); - notep = iter->notation; - efree(iter); - return create_notation(notep->name, notep->PublicID, notep->SystemID); - } else { - return NULL; - } -} - -static void php_dom_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) -{ - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - zval_ptr_dtor((zval**)&iterator->intern.data); - - if (iterator->curobj) { - zval_ptr_dtor((zval**)&iterator->curobj); - } - - efree(iterator); -} - -static int php_dom_iterator_valid(zend_object_iterator *iter TSRMLS_DC) -{ - - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - if (iterator->curobj) { - return SUCCESS; - } else { - return FAILURE; - } -} - -static void php_dom_iterator_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) -{ - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - *data = &iterator->curobj; -} - -static int php_dom_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - zval *curobj; - xmlNodePtr curnode = NULL; - dom_object *intern; - zval *object; - int namelen; - - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - object = (zval *)iterator->intern.data; - - if (instanceof_function(Z_OBJCE_P(object), dom_nodelist_class_entry TSRMLS_CC)) { - *int_key = iter->index; - return HASH_KEY_IS_LONG; - } else { - curobj = iterator->curobj; - - intern = (dom_object *)zend_object_store_get_object(curobj TSRMLS_CC); - if (intern != NULL && intern->ptr != NULL) { - curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->ptr)->node; - } else { - return HASH_KEY_NON_EXISTANT; - } - - namelen = xmlStrlen(curnode->name); - *str_key = estrndup(curnode->name, namelen); - *str_key_len = namelen + 1; - return HASH_KEY_IS_STRING; - } -} - -static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC) -{ - zval *curobj, *curattr = NULL; - zval *object; - xmlNodePtr curnode = NULL, basenode; - dom_object *intern; - dom_object *nnmap; - dom_nnodemap_object *objmap; - int ret, previndex=0; - HashTable *nodeht; - zval **entry; - - php_dom_iterator *iterator = (php_dom_iterator *)iter; - - object = (zval *)iterator->intern.data; - nnmap = (dom_object *)zend_object_store_get_object(object TSRMLS_CC); - objmap = (dom_nnodemap_object *)nnmap->ptr; - - curobj = iterator->curobj; - intern = (dom_object *)zend_object_store_get_object(curobj TSRMLS_CC); - if (intern != NULL && intern->ptr != NULL) { - if (objmap->nodetype != XML_ENTITY_NODE && - objmap->nodetype != XML_NOTATION_NODE) { - if (objmap->nodetype == DOM_NODESET) { - nodeht = HASH_OF(objmap->baseobjptr); - zend_hash_move_forward(nodeht); - if (zend_hash_get_current_data(nodeht, (void **) &entry)==SUCCESS) { - curattr = *entry; - curattr->refcount++; - } - } else { - curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->ptr)->node; - if (objmap->nodetype == XML_ATTRIBUTE_NODE || - objmap->nodetype == XML_ELEMENT_NODE) { - curnode = curnode->next; - } else { - /* Nav the tree evey time as this is LIVE */ - basenode = dom_object_get_node(objmap->baseobj); - if (basenode && (basenode->type == XML_DOCUMENT_NODE || - basenode->type == XML_HTML_DOCUMENT_NODE)) { - basenode = xmlDocGetRootElement((xmlDoc *) basenode); - } else if (basenode) { - basenode = basenode->children; - } else { - goto err; - } - curnode = dom_get_elements_by_tag_name_ns_raw(basenode, objmap->ns, objmap->local, &previndex, iter->index); - } - } - } else { - if (objmap->nodetype == XML_ENTITY_NODE) { - curnode = php_dom_libxml_hash_iter(objmap->ht, iter->index); - } else { - curnode = php_dom_libxml_notation_iter(objmap->ht, iter->index); - } - } - } -err: - zval_ptr_dtor((zval**)&curobj); - if (curnode) { - MAKE_STD_ZVAL(curattr); - curattr = php_dom_create_object(curnode, &ret, NULL, curattr, objmap->baseobj TSRMLS_CC); - } - - iterator->curobj = curattr; -} - -zend_object_iterator_funcs php_dom_iterator_funcs = { - php_dom_iterator_dtor, - php_dom_iterator_valid, - php_dom_iterator_current_data, - php_dom_iterator_current_key, - php_dom_iterator_move_forward, - NULL -}; - -zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) -{ - dom_object *intern; - dom_nnodemap_object *objmap; - xmlNodePtr nodep, curnode=NULL; - zval *curattr = NULL; - int ret, curindex = 0; - HashTable *nodeht; - zval **entry; - php_dom_iterator *iterator; - - if (by_ref) { - zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); - } - iterator = emalloc(sizeof(php_dom_iterator)); - - object->refcount++; - iterator->intern.data = (void*)object; - iterator->intern.funcs = &php_dom_iterator_funcs; - - intern = (dom_object *)zend_object_store_get_object(object TSRMLS_CC); - objmap = (dom_nnodemap_object *)intern->ptr; - if (objmap != NULL) { - if (objmap->nodetype != XML_ENTITY_NODE && - objmap->nodetype != XML_NOTATION_NODE) { - if (objmap->nodetype == DOM_NODESET) { - nodeht = HASH_OF(objmap->baseobjptr); - zend_hash_internal_pointer_reset(nodeht); - if (zend_hash_get_current_data(nodeht, (void **) &entry)==SUCCESS) { - curattr = *entry; - curattr->refcount++; - } - } else { - nodep = (xmlNode *)dom_object_get_node(objmap->baseobj); - if (!nodep) { - goto err; - } - if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) { - if (objmap->nodetype == XML_ATTRIBUTE_NODE) { - curnode = (xmlNodePtr) nodep->properties; - } else { - curnode = (xmlNodePtr) nodep->children; - } - } else { - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - nodep = xmlDocGetRootElement((xmlDoc *) nodep); - } else { - nodep = nodep->children; - } - curnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &curindex, 0); - } - } - } else { - if (objmap->nodetype == XML_ENTITY_NODE) { - curnode = php_dom_libxml_hash_iter(objmap->ht, 0); - } else { - curnode = php_dom_libxml_notation_iter(objmap->ht, 0); - } - } - } -err: - if (curnode) { - MAKE_STD_ZVAL(curattr); - curattr = php_dom_create_object(curnode, &ret, NULL, curattr, objmap->baseobj TSRMLS_CC); - } - - iterator->curobj = curattr; - - return (zend_object_iterator*)iterator; -} - -#endif diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h deleted file mode 100644 index 07c70fb69ac32..0000000000000 --- a/ext/dom/dom_properties.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#ifndef DOM_PROPERTIES_H -#define DOM_PROPERTIES_H - -/* attr properties */ -int dom_attr_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_attr_specified_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_attr_value_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_attr_owner_element_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_attr_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* characterdata properties */ -int dom_characterdata_data_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_characterdata_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* document properties */ -int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_actual_encoding_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_encoding_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_standalone_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_version_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_strict_error_checking_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_document_uri_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_format_output_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC); - -/* documenttype properties */ -int dom_documenttype_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_entities_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_notations_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_public_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_system_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* domerror properties */ -int dom_domerror_severity_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_message_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_type_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_related_exception_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_related_data_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domerror_location_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* domimplementationlist properties */ -int dom_domimplementationlist_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* domlocator properties */ -int dom_domlocator_line_number_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domlocator_column_number_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domlocator_offset_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domlocator_related_node_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_domlocator_uri_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* domstringlist properties */ -int dom_domstringlist_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* element properties */ -int dom_element_tag_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_element_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* entity properties */ -int dom_entity_public_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_system_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_notation_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_actual_encoding_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_entity_encoding_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_encoding_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_entity_version_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_entity_version_write(dom_object *obj, zval *newval TSRMLS_DC); - -/* namednodemap properties */ -int dom_namednodemap_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* namelist properties */ -int dom_namelist_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* node properties */ -int dom_node_node_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_node_value_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_node_node_type_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_parent_node_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_child_nodes_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_first_child_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_last_child_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_previous_sibling_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_next_sibling_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_attributes_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_owner_document_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_namespace_uri_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_prefix_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC); -int dom_node_local_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_base_uri_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_text_content_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC); - -/* nodelist properties */ -int dom_nodelist_length_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* notation properties */ -int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_notation_system_id_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* processinginstruction properties */ -int dom_processinginstruction_target_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_processinginstruction_data_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC); - -/* text properties */ -int dom_text_whole_text_read(dom_object *obj, zval **retval TSRMLS_DC); - -/* typeinfo properties */ -int dom_typeinfo_type_name_read(dom_object *obj, zval **retval TSRMLS_DC); -int dom_typeinfo_type_namespace_read(dom_object *obj, zval **retval TSRMLS_DC); - -#if defined(LIBXML_XPATH_ENABLED) -/* xpath properties */ -int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC); -#endif - -#endif /* DOM_PROPERTIERS_H */ diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c deleted file mode 100644 index 0d67c090ee981..0000000000000 --- a/ext/dom/domconfiguration.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_set_parameter, 0, 0, 2) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_get_parameter, 0, 0, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_can_set_parameter, 0, 0, 0) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domdomconfiguration -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domconfiguration_class_functions[] = { - PHP_FALIAS(setParameter, dom_domconfiguration_set_parameter, arginfo_dom_configuration_set_parameter) - PHP_FALIAS(getParameter, dom_domconfiguration_get_parameter, arginfo_dom_configuration_get_parameter) - PHP_FALIAS(canSetParameter, dom_domconfiguration_can_set_parameter, arginfo_dom_configuration_can_set_parameter) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto dom_void dom_domconfiguration_set_parameter(string name, domuserdata value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-property -Since: -*/ -PHP_FUNCTION(dom_domconfiguration_set_parameter) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domconfiguration_set_parameter */ - - -/* {{{ proto domdomuserdata dom_domconfiguration_get_parameter(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-getParameter -Since: -*/ -PHP_FUNCTION(dom_domconfiguration_get_parameter) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domconfiguration_get_parameter */ - - -/* {{{ proto boolean dom_domconfiguration_can_set_parameter(string name, domuserdata value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMConfiguration-canSetParameter -Since: -*/ -PHP_FUNCTION(dom_domconfiguration_can_set_parameter) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domconfiguration_can_set_parameter */ -#endif diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c deleted file mode 100644 index 5db2695e49377..0000000000000 --- a/ext/dom/domerror.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domerror -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-Interfaces-DOMError -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domerror_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ severity unsigned short -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-severity -Since: -*/ -int dom_domerror_severity_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ message string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-message -Since: -*/ -int dom_domerror_message_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ type string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-type -Since: -*/ -int dom_domerror_type_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ relatedException object -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedException -Since: -*/ -int dom_domerror_related_exception_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ relatedData domobject -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedData -Since: -*/ -int dom_domerror_related_data_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ location domlocator -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-location -Since: -*/ -int dom_domerror_location_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c deleted file mode 100644 index c93bced13d0fb..0000000000000 --- a/ext/dom/domerrorhandler.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, error, DOMError, 0) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domerrorhandler -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-Interfaces-DOMErrorHandler -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domerrorhandler_class_functions[] = { - PHP_FALIAS(handleError, dom_domerrorhandler_handle_error, arginfo_dom_domerrorhandler_handle_error) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto dom_boolean dom_domerrorhandler_handle_error(domerror error); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-ERRORS-DOMErrorHandler-handleError -Since: -*/ -PHP_FUNCTION(dom_domerrorhandler_handle_error) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domerrorhandler_handle_error */ -#endif diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c deleted file mode 100644 index c6c75a03340b9..0000000000000 --- a/ext/dom/domexception.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMException -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-17189187 -* Since: -*/ - -extern zend_class_entry *dom_domexception_class_entry; - -zend_function_entry php_dom_domexception_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ php_dom_throw_error_with_message */ -void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC) -{ - if (strict_error == 1) { - zend_throw_exception(dom_domexception_class_entry, error_message, error_code TSRMLS_CC); - } else { - php_libxml_issue_error(E_WARNING, error_message TSRMLS_CC); - } -} - -/* {{{ php_dom_throw_error */ -void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC) -{ - char *error_message; - - switch (error_code) - { - case INDEX_SIZE_ERR: - error_message = "Index Size Error"; - break; - case DOMSTRING_SIZE_ERR: - error_message = "DOM String Size Error"; - break; - case HIERARCHY_REQUEST_ERR: - error_message = "Hierarchy Request Error"; - break; - case WRONG_DOCUMENT_ERR: - error_message = "Wrong Document Error"; - break; - case INVALID_CHARACTER_ERR: - error_message = "Invalid Character Error"; - break; - case NO_DATA_ALLOWED_ERR: - error_message = "No Data Allowed Error"; - break; - case NO_MODIFICATION_ALLOWED_ERR: - error_message = "No Modification Allowed Error"; - break; - case NOT_FOUND_ERR: - error_message = "Not Found Error"; - break; - case NOT_SUPPORTED_ERR: - error_message = "Not Supported Error"; - break; - case INUSE_ATTRIBUTE_ERR: - error_message = "Inuse Attribute Error"; - break; - case INVALID_STATE_ERR: - error_message = "Invalid State Error"; - break; - case SYNTAX_ERR: - error_message = "Syntax Error"; - break; - case INVALID_MODIFICATION_ERR: - error_message = "Invalid Modification Error"; - break; - case NAMESPACE_ERR: - error_message = "Namespace Error"; - break; - case INVALID_ACCESS_ERR: - error_message = "Invalid Access Error"; - break; - case VALIDATION_ERR: - error_message = "Validation Error"; - break; - default: - error_message = "Unhandled Error"; - } - - php_dom_throw_error_with_message(error_code, error_message, strict_error TSRMLS_CC); -} -/* }}} end php_dom_throw_error */ - -#endif /* HAVE_LIBXML && HAVE_DOM */ diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c deleted file mode 100644 index 4a1aa5837de2f..0000000000000 --- a/ext/dom/domimplementation.c +++ /dev/null @@ -1,266 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementation_get_feature, 0, 0, 2) - ZEND_ARG_INFO(0, feature) - ZEND_ARG_INFO(0, version) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementation_has_feature, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementation_create_documenttype, 0, 0, 3) - ZEND_ARG_INFO(0, qualifiedName) - ZEND_ARG_INFO(0, publicId) - ZEND_ARG_INFO(0, systemId) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementation_create_document, 0, 0, 3) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, qualifiedName) - ZEND_ARG_OBJ_INFO(0, docType, DOMDocumentType, 0) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMImplementation -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-102161490 -* Since: -*/ - -zend_function_entry php_dom_domimplementation_class_functions[] = { - PHP_ME(domimplementation, getFeature, arginfo_dom_implementation_get_feature, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domimplementation, hasFeature, arginfo_dom_implementation_has_feature, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domimplementation, createDocumentType, arginfo_dom_implementation_create_documenttype, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(domimplementation, createDocument, arginfo_dom_implementation_create_document, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto boolean dom_domimplementation_has_feature(string feature, string version); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5CED94D7 -Since: -*/ -PHP_METHOD(domimplementation, hasFeature) -{ - int feature_len, version_len; - char *feature, *version; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &feature, &feature_len, &version, &version_len) == FAILURE) { - return; - } - - if (dom_has_feature(feature, version)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_domimplementation_has_feature */ - - -/* {{{ proto DOMDocumentType dom_domimplementation_create_document_type(string qualifiedName, string publicId, string systemId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocType -Since: DOM Level 2 -*/ -PHP_METHOD(domimplementation, createDocumentType) -{ - zval *rv = NULL; - xmlDtd *doctype; - int ret, name_len = 0, publicid_len = 0, systemid_len = 0; - char *name, *publicid, *systemid; - xmlChar *pch1 = NULL, *pch2 = NULL, *localname = NULL; - xmlURIPtr uri; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &name, &name_len, &publicid, &publicid_len, &systemid, &systemid_len) == FAILURE) { - return; - } - - if (name_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "qualifiedName is required"); - RETURN_FALSE; - } - - if (publicid_len > 0) - pch1 = publicid; - if (systemid_len > 0) - pch2 = systemid; - - uri = xmlParseURI(name); - if (uri != NULL && uri->opaque != NULL) { - localname = xmlStrdup(uri->opaque); - if (xmlStrchr(localname, (xmlChar) ':') != NULL) { - php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC); - xmlFreeURI(uri); - xmlFree(localname); - RETURN_FALSE; - } - } else { - localname = xmlStrdup(name); - } - - /* TODO: Test that localname has no invalid chars - php_dom_throw_error(INVALID_CHARACTER_ERR, TSRMLS_CC); - */ - - if (uri) { - xmlFreeURI(uri); - } - - doctype = xmlCreateIntSubset(NULL, localname, pch1, pch2); - xmlFree(localname); - - if (doctype == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create DocumentType"); - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, (xmlNodePtr) doctype, &ret, NULL); -} -/* }}} end dom_domimplementation_create_document_type */ - - -/* {{{ proto DOMDocument dom_domimplementation_create_document(string namespaceURI, string qualifiedName, DOMDocumentType doctype); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocument -Since: DOM Level 2 -*/ -PHP_METHOD(domimplementation, createDocument) -{ - zval *node = NULL, *rv = NULL; - xmlDoc *docp; - xmlNode *nodep; - xmlDtdPtr doctype = NULL; - xmlNsPtr nsptr = NULL; - int ret, uri_len = 0, name_len = 0, errorcode = 0; - char *uri, *name; - char *prefix = NULL, *localname = NULL; - dom_object *doctobj; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssO", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) { - return; - } - - if (node != NULL) { - DOM_GET_OBJ(doctype, node, xmlDtdPtr, doctobj); - if (doctype->type == XML_DOCUMENT_TYPE_NODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid DocumentType object"); - RETURN_FALSE; - } - if (doctype->doc != NULL) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - } else { - doctobj = NULL; - } - - if (name_len > 0) { - errorcode = dom_check_qname(name, &localname, &prefix, 1, name_len); - if (errorcode == 0 && uri_len > 0 && ((nsptr = xmlNewNs(NULL, uri, prefix)) == NULL)) { - errorcode = NAMESPACE_ERR; - } - } - - if (prefix != NULL) { - xmlFree(prefix); - } - - if (errorcode != 0) { - if (localname != NULL) { - xmlFree(localname); - } - php_dom_throw_error(errorcode, 1 TSRMLS_CC); - RETURN_FALSE; - } - - /* currently letting libxml2 set the version string */ - docp = xmlNewDoc(NULL); - if (!docp) { - if (localname != NULL) { - xmlFree(localname); - } - RETURN_FALSE; - } - - if (doctype != NULL) { - docp->intSubset = doctype; - doctype->parent = docp; - doctype->doc = docp; - docp->children = (xmlNodePtr) doctype; - docp->last = (xmlNodePtr) doctype; - } - - if (localname != NULL) { - nodep = xmlNewDocNode (docp, nsptr, localname, NULL); - if (!nodep) { - if (doctype != NULL) { - docp->intSubset = NULL; - doctype->parent = NULL; - doctype->doc = NULL; - docp->children = NULL; - docp->last = NULL; - } - xmlFreeDoc(docp); - xmlFree(localname); - /* Need some type of error here */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected Error"); - RETURN_FALSE; - } - - nodep->nsDef = nsptr; - - xmlDocSetRootElement(docp, nodep); - xmlFree(localname); - } - - DOM_RET_OBJ(rv, (xmlNodePtr) docp, &ret, NULL); - - if (doctobj != NULL) { - doctobj->document = ((dom_object *)((php_libxml_node_ptr *)docp->_private)->_private)->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)doctobj, docp TSRMLS_CC); - } -} -/* }}} end dom_domimplementation_create_document */ - - -/* {{{ proto DOMNode dom_domimplementation_get_feature(string feature, string version); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementation3-getFeature -Since: DOM Level 3 -*/ -PHP_METHOD(domimplementation, getFeature) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementation_get_feature */ -#endif diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c deleted file mode 100644 index cfab5ae178208..0000000000000 --- a/ext/dom/domimplementationlist.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationlist_item, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domimplementationlist -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domimplementationlist_class_functions[] = { - PHP_FALIAS(item, dom_domimplementationlist_item, arginfo_dom_implementationlist_item) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ length unsigned long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-length -Since: -*/ -int dom_domimplementationlist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - - -/* {{{ proto domdomimplementation dom_domimplementationlist_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-item -Since: -*/ -PHP_FUNCTION(dom_domimplementationlist_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementationlist_item */ -#endif diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c deleted file mode 100644 index f476350d3e8b4..0000000000000 --- a/ext/dom/domimplementationsource.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationsource_getdomimplementation, 0, 0, 1) - ZEND_ARG_INFO(0, features) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_implementationsource_getdomimplementations, 0, 0, 1) - ZEND_ARG_INFO(0, features) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domimplementationsource -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationSource -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domimplementationsource_class_functions[] = { - PHP_FALIAS(getDomimplementation, dom_domimplementationsource_get_domimplementation, arginfo_dom_implementationsource_getdomimplementation) - PHP_FALIAS(getDomimplementations, dom_domimplementationsource_get_domimplementations, arginfo_dom_implementationsource_getdomimplementations) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto domdomimplementation dom_domimplementationsource_get_domimplementation(string features); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpl -Since: -*/ -PHP_FUNCTION(dom_domimplementationsource_get_domimplementation) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementationsource_get_domimplementation */ - - -/* {{{ proto domimplementationlist dom_domimplementationsource_get_domimplementations(string features); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-getDOMImpls -Since: -*/ -PHP_FUNCTION(dom_domimplementationsource_get_domimplementations) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domimplementationsource_get_domimplementations */ -#endif diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c deleted file mode 100644 index bd1af6eeb50c0..0000000000000 --- a/ext/dom/domlocator.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domlocator -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Interfaces-DOMLocator -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domlocator_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ line_number long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-line-number -Since: -*/ -int dom_domlocator_line_number_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ column_number long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-column-number -Since: -*/ -int dom_domlocator_column_number_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ offset long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-offset -Since: -*/ -int dom_domlocator_offset_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ related_node node -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-node -Since: -*/ -int dom_domlocator_related_node_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ uri string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-uri -Since: -*/ -int dom_domlocator_uri_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - -#endif diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c deleted file mode 100644 index 074002ca4fb32..0000000000000 --- a/ext/dom/domstringlist.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_stringlist_item, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domstringlist -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_domstringlist_class_functions[] = { - PHP_FALIAS(item, dom_domstringlist_item, arginfo_dom_stringlist_item) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ length unsigned long -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-length -Since: -*/ -int dom_domstringlist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - - -/* {{{ proto domstring dom_domstringlist_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-item -Since: -*/ -PHP_FUNCTION(dom_domstringlist_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_domstringlist_item */ -#endif diff --git a/ext/dom/element.c b/ext/dom/element.c deleted file mode 100644 index 0171496265414..0000000000000 --- a/ext/dom/element.c +++ /dev/null @@ -1,1252 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_attribute, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_attribute, 0, 0, 2) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_remove_attribute, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_attribute_node, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_attribute_node, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, newAttr, DOMAttr, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_remove_attribute_node, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, oldAttr, DOMAttr, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_elements_by_tag_name, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_attribute_ns, 0, 0, 2) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, localName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_attribute_ns, 0, 0, 3) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, qualifiedName) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_remove_attribute_ns, 0, 0, 2) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, localName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_attribute_node_ns, 0, 0, 2) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, localName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_attribute_node_ns, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, newAttr, DOMAttr, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_get_elements_by_tag_name_ns, 0, 0, 2) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, localName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_has_attribute, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_has_attribute_ns, 0, 0, 2) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, localName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_id_attribute, 0, 0, 2) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, isId) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_id_attribute_ns, 0, 0, 3) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, localName) - ZEND_ARG_INFO(0, isId) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_set_id_attribute_node, 0, 0, 2) - ZEND_ARG_OBJ_INFO(0, attr, DOMAttr, 0) - ZEND_ARG_INFO(0, isId) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_element_construct, 0, 0, 1) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) - ZEND_ARG_INFO(0, uri) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMElement extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-745549614 -* Since: -*/ - -zend_function_entry php_dom_element_class_functions[] = { - PHP_FALIAS(getAttribute, dom_element_get_attribute, arginfo_dom_element_get_attribute) - PHP_FALIAS(setAttribute, dom_element_set_attribute, arginfo_dom_element_set_attribute) - PHP_FALIAS(removeAttribute, dom_element_remove_attribute, arginfo_dom_element_remove_attribute) - PHP_FALIAS(getAttributeNode, dom_element_get_attribute_node, arginfo_dom_element_get_attribute_node) - PHP_FALIAS(setAttributeNode, dom_element_set_attribute_node, arginfo_dom_element_set_attribute_node) - PHP_FALIAS(removeAttributeNode, dom_element_remove_attribute_node, arginfo_dom_element_remove_attribute_node) - PHP_FALIAS(getElementsByTagName, dom_element_get_elements_by_tag_name, arginfo_dom_element_get_elements_by_tag_name) - PHP_FALIAS(getAttributeNS, dom_element_get_attribute_ns, arginfo_dom_element_get_attribute_ns) - PHP_FALIAS(setAttributeNS, dom_element_set_attribute_ns, arginfo_dom_element_set_attribute_ns) - PHP_FALIAS(removeAttributeNS, dom_element_remove_attribute_ns, arginfo_dom_element_remove_attribute_ns) - PHP_FALIAS(getAttributeNodeNS, dom_element_get_attribute_node_ns, arginfo_dom_element_get_attribute_node_ns) - PHP_FALIAS(setAttributeNodeNS, dom_element_set_attribute_node_ns, arginfo_dom_element_set_attribute_node_ns) - PHP_FALIAS(getElementsByTagNameNS, dom_element_get_elements_by_tag_name_ns, arginfo_dom_element_get_elements_by_tag_name_ns) - PHP_FALIAS(hasAttribute, dom_element_has_attribute, arginfo_dom_element_has_attribute) - PHP_FALIAS(hasAttributeNS, dom_element_has_attribute_ns, arginfo_dom_element_has_attribute_ns) - PHP_FALIAS(setIdAttribute, dom_element_set_id_attribute, arginfo_dom_element_set_id_attribute) - PHP_FALIAS(setIdAttributeNS, dom_element_set_id_attribute_ns, arginfo_dom_element_set_id_attribute_ns) - PHP_FALIAS(setIdAttributeNode, dom_element_set_id_attribute_node, arginfo_dom_element_set_id_attribute_node) - PHP_ME(domelement, __construct, arginfo_dom_element_construct, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMElement::__construct(string name, [string value], [string uri]); */ -PHP_METHOD(domelement, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *name, *value = NULL, *uri = NULL; - char *localname = NULL, *prefix = NULL; - int errorcode = 0, uri_len = 0; - int name_len, value_len = 0, name_valid; - xmlNsPtr nsptr = NULL; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - name_valid = xmlValidateName((xmlChar *) name, 0); - if (name_valid != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - /* Namespace logic is seperate and only when uri passed in to insure no BC breakage */ - if (uri_len > 0) { - errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); - if (errorcode == 0) { - nodep = xmlNewNode (NULL, (xmlChar *)localname); - if (nodep != NULL && uri != NULL) { - nsptr = dom_get_ns(nodep, uri, &errorcode, prefix); - xmlSetNs(nodep, nsptr); - } - } - xmlFree(localname); - if (prefix != NULL) { - xmlFree(prefix); - } - if (errorcode != 0) { - if (nodep != NULL) { - xmlFreeNode(nodep); - } - php_dom_throw_error(errorcode, 1 TSRMLS_CC); - RETURN_FALSE; - } - } else { - /* If you don't pass a namespace uri, then you can't set a prefix */ - localname = xmlSplitQName2((xmlChar *)name, (xmlChar **) &prefix); - if (prefix != NULL) { - xmlFree(localname); - xmlFree(prefix); - php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - nodep = xmlNewNode(NULL, (xmlChar *) name); - } - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - if (value_len > 0) { - xmlNodeSetContentLen(nodep, (xmlChar *) value, value_len); - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMElement::__construct */ - -/* {{{ tagName string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-104682815 -Since: -*/ -int dom_element_tag_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - xmlNsPtr ns; - xmlChar *qname; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - ns = nodep->ns; - if (ns != NULL && ns->prefix) { - qname = xmlStrdup(ns->prefix); - qname = xmlStrcat(qname, ":"); - qname = xmlStrcat(qname, nodep->name); - ZVAL_STRING(*retval, (char *)qname, 1); - xmlFree(qname); - } else { - ZVAL_STRING(*retval, (char *) nodep->name, 1); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ schemaTypeInfo typeinfo -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Element-schemaTypeInfo -Since: DOM Level 3 -*/ -int dom_element_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - -static xmlNodePtr dom_get_dom1_attribute(xmlNodePtr elem, xmlChar *name) { - int len; - const xmlChar *nqname; - - nqname = xmlSplitQName3(name, &len); - if (nqname != NULL) { - xmlNsPtr ns; - xmlChar *prefix = xmlStrndup(name, len); - if (prefix && xmlStrEqual(prefix, "xmlns")) { - ns = elem->nsDef; - while (ns) { - if (xmlStrEqual(ns->prefix, nqname)) { - break; - } - ns = ns->next; - } - xmlFree(prefix); - return (xmlNodePtr)ns; - } - ns = xmlSearchNs(elem->doc, elem, prefix); - if (prefix != NULL) { - xmlFree(prefix); - } - if (ns != NULL) { - return (xmlNodePtr)xmlHasNsProp(elem, nqname, ns->href); - } - } else { - if (xmlStrEqual(name, "xmlns")) { - xmlNsPtr nsPtr = elem->nsDef; - while (nsPtr) { - if (nsPtr->prefix == NULL) { - return (xmlNodePtr)nsPtr; - } - nsPtr = nsPtr->next; - } - return NULL; - } - } - return (xmlNodePtr)xmlHasNsProp(elem, name, NULL); -} - -/* {{{ proto string dom_element_get_attribute(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-666EE0F9 -Since: -*/ -PHP_FUNCTION(dom_element_get_attribute) -{ - zval *id; - xmlNode *nodep; - char *name, *value = NULL; - dom_object *intern; - xmlNodePtr attr; - int name_len; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - attr = dom_get_dom1_attribute(nodep, (xmlChar *)name); - if (attr) { - switch (attr->type) { - case XML_ATTRIBUTE_NODE: - value = xmlNodeListGetString(attr->doc, attr->children, 1); - break; - case XML_NAMESPACE_DECL: - value = xmlStrdup(((xmlNsPtr)attr)->href); - break; - default: - value = xmlStrdup(((xmlAttributePtr)attr)->defaultValue); - } - } - - if (value == NULL) { - RETURN_EMPTY_STRING(); - } else { - RETVAL_STRING(value, 1); - xmlFree(value); - } -} -/* }}} end dom_element_get_attribute */ - - -/* {{{ proto void dom_element_set_attribute(string name, string value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68F082 -Since: -*/ -PHP_FUNCTION(dom_element_set_attribute) -{ - zval *id, *rv = NULL; - xmlNode *nodep; - xmlNodePtr attr = NULL; - int ret, name_len, value_len; - dom_object *intern; - char *name, *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_element_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - if (name_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required"); - RETURN_FALSE; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - attr = dom_get_dom1_attribute(nodep, (xmlChar *)name); - if (attr != NULL) { - switch (attr->type) { - case XML_ATTRIBUTE_NODE: - node_list_unlink(attr->children TSRMLS_CC); - break; - case XML_NAMESPACE_DECL: - RETURN_FALSE; - default: - break; - } - - } - - if (xmlStrEqual((xmlChar *)name, "xmlns")) { - if (xmlNewNs(nodep, (xmlChar *)value, NULL)) { - RETURN_TRUE; - } - } else { - attr = (xmlNodePtr)xmlSetProp(nodep, (xmlChar *) name, value); - } - if (!attr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such attribute '%s'", name); - RETURN_FALSE; - } - - DOM_RET_OBJ(rv, attr, &ret, intern); - -} -/* }}} end dom_element_set_attribute */ - - -/* {{{ proto void dom_element_remove_attribute(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D6AC0F9 -Since: -*/ -PHP_FUNCTION(dom_element_remove_attribute) -{ - zval *id; - xmlNodePtr nodep, attrp; - dom_object *intern; - int name_len; - char *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - attrp = dom_get_dom1_attribute(nodep, (xmlChar *)name); - if (attrp == NULL) { - RETURN_FALSE; - } - - switch (attrp->type) { - case XML_ATTRIBUTE_NODE: - if (php_dom_object_get_data(attrp) == NULL) { - node_list_unlink(attrp->children TSRMLS_CC); - xmlUnlinkNode(attrp); - xmlFreeProp((xmlAttrPtr)attrp); - } else { - xmlUnlinkNode(attrp); - } - break; - case XML_NAMESPACE_DECL: - RETURN_FALSE; - default: - break; - } - - RETURN_TRUE; -} -/* }}} end dom_element_remove_attribute */ - - -/* {{{ proto DOMAttr dom_element_get_attribute_node(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-217A91B8 -Since: -*/ -PHP_FUNCTION(dom_element_get_attribute_node) -{ - zval *id, *rv = NULL; - xmlNodePtr nodep, attrp; - int name_len, ret; - dom_object *intern; - char *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - attrp = dom_get_dom1_attribute(nodep, (xmlChar *)name); - if (attrp == NULL) { - RETURN_FALSE; - } - - if (attrp->type == XML_NAMESPACE_DECL) { - xmlNsPtr curns; - xmlNodePtr nsparent; - - nsparent = attrp->_private; - curns = xmlNewNs(NULL, attrp->name, NULL); - if (attrp->children) { - curns->prefix = xmlStrdup((xmlChar *) attrp->children); - } - if (attrp->children) { - attrp = xmlNewDocNode(nodep->doc, NULL, (xmlChar *) attrp->children, attrp->name); - } else { - attrp = xmlNewDocNode(nodep->doc, NULL, "xmlns", attrp->name); - } - attrp->type = XML_NAMESPACE_DECL; - attrp->parent = nsparent; - attrp->ns = curns; - } - - DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern); -} -/* }}} end dom_element_get_attribute_node */ - - -/* {{{ proto DOMAttr dom_element_set_attribute_node(DOMAttr newAttr); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-887236154 -Since: -*/ -PHP_FUNCTION(dom_element_set_attribute_node) -{ - zval *id, *node, *rv = NULL; - xmlNode *nodep; - xmlAttr *attrp, *existattrp = NULL; - dom_object *intern, *attrobj, *oldobj; - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj); - - if (attrp->type != XML_ATTRIBUTE_NODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute node is required"); - RETURN_FALSE; - } - - if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - existattrp = xmlHasProp(nodep, attrp->name); - if (existattrp != NULL && existattrp->type != XML_ATTRIBUTE_DECL) { - if ((oldobj = php_dom_object_get_data((xmlNodePtr) existattrp)) != NULL && - ((php_libxml_node_ptr *)oldobj->ptr)->node == (xmlNodePtr) attrp) - { - RETURN_NULL(); - } - xmlUnlinkNode((xmlNodePtr) existattrp); - } - - if (attrp->parent != NULL) { - xmlUnlinkNode((xmlNodePtr) attrp); - } - - if (attrp->doc == NULL && nodep->doc != NULL) { - attrobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC); - } - - xmlAddChild(nodep, (xmlNodePtr) attrp); - - /* Returns old property if removed otherwise NULL */ - if (existattrp != NULL) { - DOM_RET_OBJ(rv, (xmlNodePtr) existattrp, &ret, intern); - } else { - RETVAL_NULL(); - } - -} -/* }}} end dom_element_set_attribute_node */ - - -/* {{{ proto DOMAttr dom_element_remove_attribute_node(DOMAttr oldAttr); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D589198 -Since: -*/ -PHP_FUNCTION(dom_element_remove_attribute_node) -{ - zval *id, *node, *rv = NULL; - xmlNode *nodep; - xmlAttr *attrp; - dom_object *intern, *attrobj; - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj); - - if (attrp->type != XML_ATTRIBUTE_NODE || attrp->parent != nodep) { - php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - xmlUnlinkNode((xmlNodePtr) attrp); - - DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern); - -} -/* }}} end dom_element_remove_attribute_node */ - - -/* {{{ proto DOMNodeList dom_element_get_elements_by_tag_name(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1938918D -Since: -*/ -PHP_FUNCTION(dom_element_get_elements_by_tag_name) -{ - zval *id; - xmlNodePtr elemp; - int name_len; - dom_object *intern, *namednode; - char *name; - xmlChar *local; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - local = xmlCharStrndup(name, name_len); - dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC); -} -/* }}} end dom_element_get_elements_by_tag_name */ - - -/* {{{ proto string dom_element_get_attribute_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAttrNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_get_attribute_ns) -{ - zval *id; - xmlNodePtr elemp; - xmlNsPtr nsptr; - dom_object *intern; - int uri_len = 0, name_len = 0; - char *uri, *name, *strattr; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - strattr = xmlGetNsProp(elemp, (xmlChar *) name, (xmlChar *) uri); - - if (strattr != NULL) { - RETVAL_STRING(strattr, 1); - xmlFree(strattr); - } else { - if (xmlStrEqual((xmlChar *) uri, DOM_XMLNS_NAMESPACE)) { - nsptr = dom_get_nsdecl(elemp, name); - if (nsptr != NULL) { - RETVAL_STRING((char *) nsptr->href, 1); - } else { - RETVAL_EMPTY_STRING(); - } - } else { - RETVAL_EMPTY_STRING(); - } - } - -} -/* }}} end dom_element_get_attribute_ns */ - -static xmlNsPtr _dom_new_reconNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) { - xmlNsPtr def; - xmlChar prefix[50]; - int counter = 1; - - if ((tree == NULL) || (ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) { - return NULL; - } - - /* Code taken from libxml2 (2.6.20) xmlNewReconciliedNs - * - * Find a close prefix which is not already in use. - * Let's strip namespace prefixes longer than 20 chars ! - */ - if (ns->prefix == NULL) - snprintf((char *) prefix, sizeof(prefix), "default"); - else - snprintf((char *) prefix, sizeof(prefix), "%.20s", (char *)ns->prefix); - - def = xmlSearchNs(doc, tree, prefix); - while (def != NULL) { - if (counter > 1000) return(NULL); - if (ns->prefix == NULL) - snprintf((char *) prefix, sizeof(prefix), "default%d", counter++); - else - snprintf((char *) prefix, sizeof(prefix), "%.20s%d", - (char *)ns->prefix, counter++); - def = xmlSearchNs(doc, tree, prefix); - } - - /* - * OK, now we are ready to create a new one. - */ - def = xmlNewNs(tree, ns->href, prefix); - return(def); -} - -/* {{{ proto void dom_element_set_attribute_ns(string namespaceURI, string qualifiedName, string value); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAttrNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_set_attribute_ns) -{ - zval *id; - xmlNodePtr elemp, nodep = NULL; - xmlNsPtr nsptr; - xmlAttr *attr; - int uri_len = 0, name_len = 0, value_len = 0; - char *uri, *name, *value; - char *localname = NULL, *prefix = NULL; - dom_object *intern; - int errorcode = 0, stricterror, is_xmlns = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!ss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - if (name_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required"); - RETURN_FALSE; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(elemp) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_NULL(); - } - - errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len); - - if (errorcode == 0) { - if (uri_len > 0) { - nodep = (xmlNodePtr) xmlHasNsProp(elemp, (xmlChar *) localname, (xmlChar *) uri); - if (nodep != NULL && nodep->type != XML_ATTRIBUTE_DECL) { - node_list_unlink(nodep->children TSRMLS_CC); - } - - if (xmlStrEqual((xmlChar *) prefix,"xmlns") && xmlStrEqual((xmlChar *) uri, DOM_XMLNS_NAMESPACE)) { - is_xmlns = 1; - nsptr = dom_get_nsdecl(elemp, localname); - } else { - nsptr = xmlSearchNsByHref(elemp->doc, elemp, uri); - if (nsptr && nsptr->prefix == NULL) { - xmlNsPtr tmpnsptr; - - tmpnsptr = nsptr->next; - while (tmpnsptr) { - if ((tmpnsptr->prefix != NULL) && (tmpnsptr->href != NULL) && - (xmlStrEqual(tmpnsptr->href, (xmlChar *) uri))) { - nsptr = tmpnsptr; - break; - } - tmpnsptr = tmpnsptr->next; - } - if (tmpnsptr == NULL) { - nsptr = _dom_new_reconNs(elemp->doc, elemp, nsptr); - } - } - } - - if (nsptr == NULL) { - if (prefix == NULL) { - errorcode = NAMESPACE_ERR; - } else { - if (is_xmlns == 1) { - xmlNewNs(elemp, value, localname); - } else { - nsptr = dom_get_ns(elemp, uri, &errorcode, prefix); - } - xmlReconciliateNs(elemp->doc, elemp); - } - } else { - if (is_xmlns == 1) { - if (nsptr->href) { - xmlFree((xmlChar *) nsptr->href); - } - nsptr->href = xmlStrdup(value); - } - } - - if (errorcode == 0 && is_xmlns == 0) { - attr = xmlSetNsProp(elemp, nsptr, localname, value); - } - } else { - attr = xmlHasProp(elemp, localname); - if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) { - node_list_unlink(attr->children TSRMLS_CC); - } - attr = xmlSetProp(elemp, localname, value); - } - } - - xmlFree(localname); - if (prefix != NULL) { - xmlFree(prefix); - } - - if (errorcode != 0) { - php_dom_throw_error(errorcode, stricterror TSRMLS_CC); - } - - RETURN_NULL(); -} -/* }}} end dom_element_set_attribute_ns */ - - -/* {{{ proto void dom_element_remove_attribute_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElRemAtNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_remove_attribute_ns) -{ - zval *id; - xmlNode *nodep; - xmlAttr *attrp; - xmlNsPtr nsptr; - dom_object *intern; - int name_len, uri_len; - char *name, *uri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_NULL(); - } - - attrp = xmlHasNsProp(nodep, (xmlChar *)name, (xmlChar *)uri); - - nsptr = dom_get_nsdecl(nodep, (xmlChar *)name); - if (nsptr != NULL) { - if (xmlStrEqual((xmlChar *)uri, nsptr->href)) { - if (nsptr->href != NULL) { - xmlFree((char *) nsptr->href); - nsptr->href = NULL; - } - if (nsptr->prefix != NULL) { - xmlFree((char *) nsptr->prefix); - nsptr->prefix = NULL; - } - } else { - RETURN_NULL(); - } - } - - if (attrp && attrp->type != XML_ATTRIBUTE_DECL) { - if (php_dom_object_get_data((xmlNodePtr) attrp) == NULL) { - node_list_unlink(attrp->children TSRMLS_CC); - xmlUnlinkNode((xmlNodePtr) attrp); - xmlFreeProp(attrp); - } else { - xmlUnlinkNode((xmlNodePtr) attrp); - } - } - - RETURN_NULL(); -} -/* }}} end dom_element_remove_attribute_ns */ - - -/* {{{ proto DOMAttr dom_element_get_attribute_node_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAtNodeNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_get_attribute_node_ns) -{ - zval *id, *rv = NULL; - xmlNodePtr elemp; - xmlAttrPtr attrp; - dom_object *intern; - int uri_len, name_len, ret; - char *uri, *name; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - attrp = xmlHasNsProp(elemp, name, uri); - - if (attrp == NULL) { - RETURN_NULL(); - } - - DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern); - -} -/* }}} end dom_element_get_attribute_node_ns */ - - -/* {{{ proto DOMAttr dom_element_set_attribute_node_ns(DOMAttr newAttr); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAtNodeNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_set_attribute_node_ns) -{ - zval *id, *node, *rv = NULL; - xmlNode *nodep; - xmlNs *nsp; - xmlAttr *attrp, *existattrp = NULL; - dom_object *intern, *attrobj, *oldobj; - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj); - - if (attrp->type != XML_ATTRIBUTE_NODE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute node is required"); - RETURN_FALSE; - } - - if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } - - nsp = attrp->ns; - if (nsp != NULL) { - existattrp = xmlHasNsProp(nodep, nsp->href, attrp->name); - } else { - existattrp = xmlHasProp(nodep, attrp->name); - } - - if (existattrp != NULL && existattrp->type != XML_ATTRIBUTE_DECL) { - if ((oldobj = php_dom_object_get_data((xmlNodePtr) existattrp)) != NULL && - ((php_libxml_node_ptr *)oldobj->ptr)->node == (xmlNodePtr) attrp) - { - RETURN_NULL(); - } - xmlUnlinkNode((xmlNodePtr) existattrp); - } - - if (attrp->parent != NULL) { - xmlUnlinkNode((xmlNodePtr) attrp); - } - - if (attrp->doc == NULL && nodep->doc != NULL) { - attrobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC); - } - - xmlAddChild(nodep, (xmlNodePtr) attrp); - - /* Returns old property if removed otherwise NULL */ - if (existattrp != NULL) { - DOM_RET_OBJ(rv, (xmlNodePtr) existattrp, &ret, intern); - } else { - RETVAL_NULL(); - } - -} -/* }}} end dom_element_set_attribute_node_ns */ - - - -/* {{{ proto DOMNodeList dom_element_get_elements_by_tag_name_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C90942 -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_get_elements_by_tag_name_ns) -{ - zval *id; - xmlNodePtr elemp; - int uri_len, name_len; - dom_object *intern, *namednode; - char *uri, *name; - xmlChar *local, *nsuri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - local = xmlCharStrndup(name, name_len); - nsuri = xmlCharStrndup(uri, uri_len); - dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC); - -} -/* }}} end dom_element_get_elements_by_tag_name_ns */ - - -/* {{{ proto boolean dom_element_has_attribute(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElHasAttr -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_has_attribute) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - char *name; - int name_len; - xmlNodePtr attr; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - attr = dom_get_dom1_attribute(nodep, (xmlChar *)name); - if (attr == NULL) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} end dom_element_has_attribute */ - - -/* {{{ proto boolean dom_element_has_attribute_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElHasAttrNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_element_has_attribute_ns) -{ - zval *id; - xmlNodePtr elemp; - xmlNs *nsp; - dom_object *intern; - int uri_len, name_len; - char *uri, *name; - xmlChar *value; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - value = xmlGetNsProp(elemp, (xmlChar *)name, (xmlChar *)uri); - - if (value != NULL) { - xmlFree(value); - RETURN_TRUE; - } else { - if (xmlStrEqual(uri, DOM_XMLNS_NAMESPACE)) { - nsp = dom_get_nsdecl(elemp, name); - if (nsp != NULL) { - RETURN_TRUE; - } - } - } - - RETURN_FALSE; -} -/* }}} end dom_element_has_attribute_ns */ - - -static void php_set_attribute_id(xmlAttrPtr attrp, zend_bool is_id) -{ - if (is_id == 1 && attrp->atype != XML_ATTRIBUTE_ID) { - xmlChar *id_val; - - id_val = xmlNodeListGetString(attrp->doc, attrp->children, 1); - if (id_val != NULL) { - xmlAddID(NULL, attrp->doc, id_val, attrp); - xmlFree(id_val); - } - } else { - if (attrp->atype == XML_ATTRIBUTE_ID) { - xmlRemoveID(attrp->doc, attrp); - attrp->atype = 0; - } - } -} - -/* {{{ proto void dom_element_set_id_attribute(string name, boolean isId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttr -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_element_set_id_attribute) -{ - zval *id; - xmlNode *nodep; - xmlAttrPtr attrp; - dom_object *intern; - char *name; - int name_len; - zend_bool is_id; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osb", &id, dom_element_class_entry, &name, &name_len, &is_id) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_NULL(); - } - - attrp = xmlHasNsProp(nodep, name, NULL); - if (attrp == NULL || attrp->type == XML_ATTRIBUTE_DECL) { - php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - } else { - php_set_attribute_id(attrp, is_id); - } - - RETURN_NULL(); -} -/* }}} end dom_element_set_id_attribute */ - - -/* {{{ proto void dom_element_set_id_attribute_ns(string namespaceURI, string localName, boolean isId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNS -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_element_set_id_attribute_ns) -{ - zval *id; - xmlNodePtr elemp; - xmlAttrPtr attrp; - dom_object *intern; - int uri_len, name_len; - char *uri, *name; - zend_bool is_id; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ossb", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) { - return; - } - - DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(elemp) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_NULL(); - } - - attrp = xmlHasNsProp(elemp, (xmlChar *)name, (xmlChar *)uri); - if (attrp == NULL || attrp->type == XML_ATTRIBUTE_DECL) { - php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - } else { - php_set_attribute_id(attrp, is_id); - } - - RETURN_NULL(); -} -/* }}} end dom_element_set_id_attribute_ns */ - - -/* {{{ proto void dom_element_set_id_attribute_node(attr idAttr, boolean isId); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_element_set_id_attribute_node) -{ - zval *id, *node; - xmlNode *nodep; - xmlAttrPtr attrp; - dom_object *intern, *attrobj; - zend_bool is_id; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOb", &id, dom_element_class_entry, &node, dom_attr_class_entry, &is_id) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_is_read_only(nodep) == SUCCESS) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_NULL(); - } - - DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj); - - if (attrp->parent != nodep) { - php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - } else { - php_set_attribute_id(attrp, is_id); - } - - RETURN_NULL(); -} -/* }}} end dom_element_set_id_attribute_node */ - -#endif diff --git a/ext/dom/entity.c b/ext/dom/entity.c deleted file mode 100644 index af97b515fa516..0000000000000 --- a/ext/dom/entity.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMEntity extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-527DCFF2 -* Since: -*/ - -zend_function_entry php_dom_entity_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ publicId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7303025 -Since: -*/ -int dom_entity_public_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlEntity *nodep; - - nodep = (xmlEntity *) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) { - ZVAL_NULL(*retval); - } else { - ZVAL_STRING(*retval, (char *) (nodep->ExternalID), 1); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ systemId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7C29F3E -Since: -*/ -int dom_entity_system_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlEntity *nodep; - - nodep = (xmlEntity *) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) { - ZVAL_NULL(*retval); - } else { - ZVAL_STRING(*retval, (char *) (nodep->SystemID), 1); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ notationName string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-6ABAEB38 -Since: -*/ -int dom_entity_notation_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlEntity *nodep; - char *content; - - nodep = (xmlEntity *) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) { - ZVAL_NULL(*retval); - } else { - content = xmlNodeGetContent((xmlNodePtr) nodep); - ZVAL_STRING(*retval, content, 1); - xmlFree(content); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ actualEncoding string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-actualEncoding -Since: DOM Level 3 -*/ -int dom_entity_actual_encoding_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -int dom_entity_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ encoding string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-encoding -Since: DOM Level 3 -*/ -int dom_entity_encoding_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -int dom_entity_encoding_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ version string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-version -Since: DOM Level 3 -*/ -int dom_entity_version_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -int dom_entity_version_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c deleted file mode 100644 index 849639f9f7214..0000000000000 --- a/ext/dom/entityreference.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_entityreference_construct, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMEntityReference extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-11C98490 -* Since: -*/ - -zend_function_entry php_dom_entityreference_class_functions[] = { - PHP_ME(domentityreference, __construct, arginfo_dom_entityreference_construct, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMEntityReference::__construct(string name); */ -PHP_METHOD(domentityreference, __construct) -{ - zval *id; - xmlNode *node; - xmlNodePtr oldnode = NULL; - dom_object *intern; - char *name; - int name_len, name_valid; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - - name_valid = xmlValidateName((xmlChar *) name, 0); - if (name_valid != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - node = xmlNewReference(NULL, name); - - if (!node) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, node, (void *)intern TSRMLS_CC); - } -} - -/* }}} end DOMEntityReference::__construct */ -#endif diff --git a/ext/dom/examples/dom1.inc b/ext/dom/examples/dom1.inc deleted file mode 100644 index 792d6f2dbc481..0000000000000 --- a/ext/dom/examples/dom1.inc +++ /dev/null @@ -1,43 +0,0 @@ - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - "; - -function print_node($node) -{ - print "Node Name: " . $node->nodeName; - print "\nNode Type: " . $node->nodeType; - $child_count = $node->childNodes->length; - print "\nNum Children: " . $child_count; - if($child_count <= 1){ - print "\nNode Content: " . $node->nodeValue; - } - print "\n\n"; -} - -function print_node_list($nodelist) -{ - foreach($nodelist as $node) - { - print_node($node); - } -} - -?> diff --git a/ext/dom/examples/dom1.php b/ext/dom/examples/dom1.php deleted file mode 100644 index 8ea367458d6f6..0000000000000 --- a/ext/dom/examples/dom1.php +++ /dev/null @@ -1,94 +0,0 @@ -loadxml($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -// children() of of document would result in a memleak -//$children = $dom->children(); -//print_node_list($children); - -echo "--------- root\n"; -$rootnode = $dom->documentElement; -print_node($rootnode); - -echo "--------- children of root\n"; -$children = $rootnode->childNodes; -print_node_list($children); - -// The last node should be identical with the last entry in the children array -echo "--------- last\n"; -$last = $rootnode->lastChild; -print_node($last); - -// The parent of this last node is the root again -echo "--------- parent\n"; -$parent = $last->parentNode; -print_node($parent); - -// The children of this parent are the same children as one above -echo "--------- children of parent\n"; -$children = $parent->childNodes; -print_node_list($children); - -echo "--------- creating a new attribute\n"; -//This is worthless -//$attr = $dom->createAttribute("src", "picture.gif"); -//print_r($attr); - -//$rootnode->set_attributeNode($attr); -$attr = $rootnode->setAttribute("src", "picture.gif"); -$attr = $rootnode->getAttribute("src"); -print_r($attr); -print "\n"; - -echo "--------- Get Attribute Node\n"; -$attr = $rootnode->getAttributeNode("src"); -print_node($attr); - -echo "--------- Remove Attribute Node\n"; -$attr = $rootnode->removeAttribute("src"); -print "Removed " . $attr . " attributes.\n"; - -echo "--------- attributes of rootnode\n"; -$attrs = $rootnode->attributes; -print_node_list($attrs); - -echo "--------- children of an attribute\n"; -$children = $attrs->item(0)->childNodes; -print_node_list($children); - -echo "--------- Add child to root\n"; -$myelement = new domElement("Silly", "Symphony"); -$newchild = $rootnode->appendChild($myelement); -print_node($newchild); -print $dom->saveXML(); -print "\n"; - -echo "--------- Find element by tagname\n"; -echo " Using dom\n"; -$children = $dom->getElementsByTagname("Silly"); -print_node_list($children); - -echo " Using elem\n"; -$children = $rootnode->getElementsByTagName("Silly"); -print_node_list($children); - -echo "--------- Unlink Node\n"; -print_node($children->item(0)); -$rootnode->removeChild($children->item(0)); -print_node_list($rootnode->childNodes); -print $dom->savexml(); - -echo "--------- Find element by id\n"; -print ("Not implemented\n"); - -echo "--------- Check various node_name return values\n"; -print ("Not needed\n"); - -?> diff --git a/ext/dom/examples/note-invalid.xml b/ext/dom/examples/note-invalid.xml deleted file mode 100644 index 58d4e650441bb..0000000000000 --- a/ext/dom/examples/note-invalid.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -PHP User Group -Shane -Reminder -Don't forget the meeting tonight! -
Or I'll clobber you!
-
diff --git a/ext/dom/examples/note.dtd b/ext/dom/examples/note.dtd deleted file mode 100644 index 4016eb58111cd..0000000000000 --- a/ext/dom/examples/note.dtd +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ext/dom/examples/note.php b/ext/dom/examples/note.php deleted file mode 100644 index a8695f3664442..0000000000000 --- a/ext/dom/examples/note.php +++ /dev/null @@ -1,19 +0,0 @@ -load('note.xml'); -if (!$dom->validate('note.dtd')) { - print "Document note.dtd is not valid\n"; -} else { - print "Document note.dtd is valid\n"; -} - -$dom = new domDocument; -$dom->load('note-invalid.xml'); -if (!$dom->validate('note.dtd')) { - print "Document note-invalid.xml is not valid\n"; -} else { - print "Document note-invalid.xml is valid\n"; -} - -?> diff --git a/ext/dom/examples/note.xml b/ext/dom/examples/note.xml deleted file mode 100644 index 49614a1b5256c..0000000000000 --- a/ext/dom/examples/note.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - -PHP User Group -Shane -Reminder -Don't forget the meeting tonight! - diff --git a/ext/dom/examples/relaxNG.php b/ext/dom/examples/relaxNG.php deleted file mode 100644 index d265fd988e185..0000000000000 --- a/ext/dom/examples/relaxNG.php +++ /dev/null @@ -1,11 +0,0 @@ -load('relaxNG.xml'); -if (!$dom->relaxNGValidate('relaxNG.rng')) { - print "Document is not valid"; -} else { - print "Document is valid"; -} - -?> \ No newline at end of file diff --git a/ext/dom/examples/relaxNG.rng b/ext/dom/examples/relaxNG.rng deleted file mode 100644 index f4357e04ef8ab..0000000000000 --- a/ext/dom/examples/relaxNG.rng +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/ext/dom/examples/relaxNG.xml b/ext/dom/examples/relaxNG.xml deleted file mode 100644 index 6b0cac1225050..0000000000000 --- a/ext/dom/examples/relaxNG.xml +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/ext/dom/examples/relaxNG2.rng b/ext/dom/examples/relaxNG2.rng deleted file mode 100644 index 4adae7b15113d..0000000000000 --- a/ext/dom/examples/relaxNG2.rng +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/dom/examples/relaxNG3.rng b/ext/dom/examples/relaxNG3.rng deleted file mode 100644 index 73e1eb6165102..0000000000000 --- a/ext/dom/examples/relaxNG3.rng +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ext/dom/examples/shipping.php b/ext/dom/examples/shipping.php deleted file mode 100644 index 5205fd2014cb6..0000000000000 --- a/ext/dom/examples/shipping.php +++ /dev/null @@ -1,11 +0,0 @@ -load('shipping.xml'); -if (!$dom->schemaValidate('shipping.xsd')) { - print "Document is not valid"; -} else { - print "Document is valid"; -} - -?> \ No newline at end of file diff --git a/ext/dom/examples/shipping.xml b/ext/dom/examples/shipping.xml deleted file mode 100644 index dc8a09e301768..0000000000000 --- a/ext/dom/examples/shipping.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Tove Svendson - Ragnhildvei 2 -
4000 Stavanger
- Norway -
- - - Empire Burlesque - 1 - 10.90 - - - Hide your heart - 1 - 9.90 - - -
\ No newline at end of file diff --git a/ext/dom/examples/shipping.xsd b/ext/dom/examples/shipping.xsd deleted file mode 100644 index 8b16b7c03a621..0000000000000 --- a/ext/dom/examples/shipping.xsd +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c deleted file mode 100644 index 612984aed2ee8..0000000000000 --- a/ext/dom/namednodemap.c +++ /dev/null @@ -1,344 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_get_named_item, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_set_named_item, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, arg, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_remove_named_item, 0, 0, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_item, 0, 0, 0) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_get_named_item_ns, 0, 0, 0) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, localName) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_set_named_item_ns, 0, 0, 0) - ZEND_ARG_OBJ_INFO(0, arg, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namednodemap_remove_named_item_ns, 0, 0, 0) - ZEND_ARG_INFO(0, namespaceURI) - ZEND_ARG_INFO(0, localName) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMNamedNodeMap -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1780488922 -* Since: -*/ - -zend_function_entry php_dom_namednodemap_class_functions[] = { - PHP_FALIAS(getNamedItem, dom_namednodemap_get_named_item, arginfo_dom_namednodemap_get_named_item) - PHP_FALIAS(setNamedItem, dom_namednodemap_set_named_item, arginfo_dom_namednodemap_set_named_item) - PHP_FALIAS(removeNamedItem, dom_namednodemap_remove_named_item, arginfo_dom_namednodemap_remove_named_item) - PHP_FALIAS(item, dom_namednodemap_item, arginfo_dom_namednodemap_item) - PHP_FALIAS(getNamedItemNS, dom_namednodemap_get_named_item_ns, arginfo_dom_namednodemap_get_named_item_ns) - PHP_FALIAS(setNamedItemNS, dom_namednodemap_set_named_item_ns, arginfo_dom_namednodemap_set_named_item_ns) - PHP_FALIAS(removeNamedItemNS, dom_namednodemap_remove_named_item_ns, arginfo_dom_namednodemap_remove_named_item_ns) - {NULL, NULL, NULL} -}; - -/* {{{ length int -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D0FB19E -Since: -*/ -int dom_namednodemap_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_nnodemap_object *objmap; - xmlAttrPtr curnode; - xmlNodePtr nodep; - int count = 0; - - objmap = (dom_nnodemap_object *)obj->ptr; - - if (objmap != NULL) { - if ((objmap->nodetype == XML_NOTATION_NODE) || - objmap->nodetype == XML_ENTITY_NODE) { - if (objmap->ht) { - count = xmlHashSize(objmap->ht); - } - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - curnode = nodep->properties; - if (curnode) { - count++; - while (curnode->next != NULL) { - count++; - curnode = curnode->next; - } - } - } - } - } - - MAKE_STD_ZVAL(*retval); - ZVAL_LONG(*retval, count); - return SUCCESS; -} - -/* }}} */ - - - - -/* {{{ proto DOMNode dom_namednodemap_get_named_item(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1074577549 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_get_named_item) -{ - zval *id, *rv = NULL; - int ret, namedlen=0; - dom_object *intern; - xmlNodePtr itemnode = NULL; - char *named; - - dom_nnodemap_object *objmap; - xmlNodePtr nodep; - xmlNotation *notep = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_namednodemap_class_entry, &named, &namedlen) == FAILURE) { - return; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - objmap = (dom_nnodemap_object *)intern->ptr; - - if (objmap != NULL) { - if ((objmap->nodetype == XML_NOTATION_NODE) || - objmap->nodetype == XML_ENTITY_NODE) { - if (objmap->ht) { - if (objmap->nodetype == XML_ENTITY_NODE) { - itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, named); - } else { - notep = (xmlNotation *)xmlHashLookup(objmap->ht, named); - if (notep) { - itemnode = create_notation(notep->name, notep->PublicID, notep->SystemID); - } - } - } - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - itemnode = (xmlNodePtr)xmlHasProp(nodep, named); - } - } - } - - if (itemnode) { - DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj); - return; - } else { - RETVAL_NULL(); - } -} -/* }}} end dom_namednodemap_get_named_item */ - - -/* {{{ proto DOMNode dom_namednodemap_set_named_item(DOMNode arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1025163788 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_set_named_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_set_named_item */ - - -/* {{{ proto DOMNode dom_namednodemap_remove_named_item(string name); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D58B193 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_remove_named_item) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_remove_named_item */ - - -/* {{{ proto DOMNode dom_namednodemap_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-349467F9 -Since: -*/ -PHP_FUNCTION(dom_namednodemap_item) -{ - zval *id, *rv = NULL; - long index; - int ret; - dom_object *intern; - xmlNodePtr itemnode = NULL; - - dom_nnodemap_object *objmap; - xmlNodePtr nodep, curnode; - int count; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_namednodemap_class_entry, &index) == FAILURE) { - return; - } - if (index >= 0) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - objmap = (dom_nnodemap_object *)intern->ptr; - - if (objmap != NULL) { - if ((objmap->nodetype == XML_NOTATION_NODE) || - objmap->nodetype == XML_ENTITY_NODE) { - if (objmap->ht) { - if (objmap->nodetype == XML_ENTITY_NODE) { - itemnode = php_dom_libxml_hash_iter(objmap->ht, index); - } else { - itemnode = php_dom_libxml_notation_iter(objmap->ht, index); - } - } - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - curnode = (xmlNodePtr)nodep->properties; - count = 0; - while (count < index && curnode != NULL) { - count++; - curnode = (xmlNodePtr)curnode->next; - } - itemnode = curnode; - } - } - } - - if (itemnode) { - DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj); - return; - } - } - - RETVAL_NULL(); -} -/* }}} end dom_namednodemap_item */ - - -/* {{{ proto DOMNode dom_namednodemap_get_named_item_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getNamedItemNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_namednodemap_get_named_item_ns) -{ - zval *id, *rv = NULL; - int ret, namedlen=0, urilen=0; - dom_object *intern; - xmlNodePtr itemnode = NULL; - char *uri, *named; - - dom_nnodemap_object *objmap; - xmlNodePtr nodep; - xmlNotation *notep = NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_namednodemap_class_entry, &uri, &urilen, &named, &namedlen) == FAILURE) { - return; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - objmap = (dom_nnodemap_object *)intern->ptr; - - if (objmap != NULL) { - if ((objmap->nodetype == XML_NOTATION_NODE) || - objmap->nodetype == XML_ENTITY_NODE) { - if (objmap->ht) { - if (objmap->nodetype == XML_ENTITY_NODE) { - itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, named); - } else { - notep = (xmlNotation *)xmlHashLookup(objmap->ht, named); - if (notep) { - itemnode = create_notation(notep->name, notep->PublicID, notep->SystemID); - } - } - } - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - itemnode = (xmlNodePtr)xmlHasNsProp(nodep, named, uri); - } - } - } - - if (itemnode) { - DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj); - return; - } else { - RETVAL_NULL(); - } -} -/* }}} end dom_namednodemap_get_named_item_ns */ - - -/* {{{ proto DOMNode dom_namednodemap_set_named_item_ns(DOMNode arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-setNamedItemNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_namednodemap_set_named_item_ns) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_set_named_item_ns */ - - -/* {{{ proto DOMNode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-removeNamedItemNS -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_namednodemap_remove_named_item_ns) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namednodemap_remove_named_item_ns */ -#endif diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c deleted file mode 100644 index 32905e897a36a..0000000000000 --- a/ext/dom/namelist.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namelist_get_name, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_namelist_get_namespace_uri, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMNameList -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_namelist_class_functions[] = { - PHP_FALIAS(getName, dom_namelist_get_name, arginfo_dom_namelist_get_name) - PHP_FALIAS(getNamespaceURI, dom_namelist_get_namespace_uri, arginfo_dom_namelist_get_namespace_uri) - {NULL, NULL, NULL} -}; - -/* {{{ length int -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-length -Since: -*/ -int dom_namelist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, "TEST", 1); - return SUCCESS; -} - -/* }}} */ - - - - -/* {{{ proto string dom_namelist_get_name(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getName -Since: -*/ -PHP_FUNCTION(dom_namelist_get_name) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namelist_get_name */ - - -/* {{{ proto string dom_namelist_get_namespace_uri(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getNamespaceURI -Since: -*/ -PHP_FUNCTION(dom_namelist_get_namespace_uri) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_namelist_get_namespace_uri */ -#endif diff --git a/ext/dom/node.c b/ext/dom/node.c deleted file mode 100644 index fc2dd47e0d800..0000000000000 --- a/ext/dom/node.c +++ /dev/null @@ -1,2009 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_insert_before, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, newChild, DOMNode, 0) - ZEND_ARG_OBJ_INFO(0, refChild, DOMNode, 1) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_replace_child, 0, 0, 2) - ZEND_ARG_OBJ_INFO(0, newChild, DOMNode, 0) - ZEND_ARG_OBJ_INFO(0, oldChild, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_remove_child, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, oldChild, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_append_child, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, newChild, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_has_child_nodes, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 1) - ZEND_ARG_INFO(0, deep) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_normalize, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_is_supported, 0, 0, 2) - ZEND_ARG_INFO(0, feature) - ZEND_ARG_INFO(0, version) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_has_attributes, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_compare_document_position, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, other, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_is_same_node, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, other, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_lookup_prefix, 0, 0, 1) - ZEND_ARG_INFO(0, namespaceURI) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_is_default_namespace, 0, 0, 1) - ZEND_ARG_INFO(0, namespaceURI) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_lookup_namespace_uri, 0, 0, 1) - ZEND_ARG_INFO(0, prefix) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_is_equal_node, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, arg, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_get_feature, 0, 0, 2) - ZEND_ARG_INFO(0, feature) - ZEND_ARG_INFO(0, version) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_set_user_data, 0, 0, 3) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, handler) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_get_user_data, 0, 0, 1) - ZEND_ARG_INFO(0, key) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_getNodePath, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_C14N, 0, 0, 0) - ZEND_ARG_INFO(0, exclusive) - ZEND_ARG_INFO(0, with_comments) - ZEND_ARG_ARRAY_INFO(0, xpath, 1) - ZEND_ARG_ARRAY_INFO(0, ns_prefixes, 1) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_C14NFile, 0, 0, 1) - ZEND_ARG_INFO(0, uri) - ZEND_ARG_INFO(0, exclusive) - ZEND_ARG_INFO(0, with_comments) - ZEND_ARG_ARRAY_INFO(0, xpath, 1) - ZEND_ARG_ARRAY_INFO(0, ns_prefixes, 1) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1950641247 -* Since: -*/ - -zend_function_entry php_dom_node_class_functions[] = { - PHP_FALIAS(insertBefore, dom_node_insert_before, arginfo_dom_node_insert_before) - PHP_FALIAS(replaceChild, dom_node_replace_child, arginfo_dom_node_replace_child) - PHP_FALIAS(removeChild, dom_node_remove_child, arginfo_dom_node_remove_child) - PHP_FALIAS(appendChild, dom_node_append_child, arginfo_dom_node_append_child) - PHP_FALIAS(hasChildNodes, dom_node_has_child_nodes, arginfo_dom_node_has_child_nodes) - PHP_FALIAS(cloneNode, dom_node_clone_node, arginfo_dom_node_clone_node) - PHP_FALIAS(normalize, dom_node_normalize, arginfo_dom_node_normalize) - PHP_FALIAS(isSupported, dom_node_is_supported, arginfo_dom_node_is_supported) - PHP_FALIAS(hasAttributes, dom_node_has_attributes, arginfo_dom_node_has_attributes) - PHP_FALIAS(compareDocumentPosition, dom_node_compare_document_position, arginfo_dom_node_compare_document_position) - PHP_FALIAS(isSameNode, dom_node_is_same_node, arginfo_dom_node_is_same_node) - PHP_FALIAS(lookupPrefix, dom_node_lookup_prefix, arginfo_dom_node_lookup_prefix) - PHP_FALIAS(isDefaultNamespace, dom_node_is_default_namespace, arginfo_dom_node_is_default_namespace) - PHP_FALIAS(lookupNamespaceUri, dom_node_lookup_namespace_uri, arginfo_dom_node_lookup_namespace_uri) - PHP_FALIAS(isEqualNode, dom_node_is_equal_node, arginfo_dom_node_is_equal_node) - PHP_FALIAS(getFeature, dom_node_get_feature, arginfo_dom_node_get_feature) - PHP_FALIAS(setUserData, dom_node_set_user_data, arginfo_dom_node_set_user_data) - PHP_FALIAS(getUserData, dom_node_get_user_data, arginfo_dom_node_get_user_data) - PHP_ME(domnode, getNodePath, arginfo_dom_node_getNodePath, ZEND_ACC_PUBLIC) - PHP_ME(domnode, C14N, arginfo_dom_node_C14N, ZEND_ACC_PUBLIC) - PHP_ME(domnode, C14NFile, arginfo_dom_node_C14NFile, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -static void dom_reconcile_ns(xmlDocPtr doc, xmlNodePtr nodep) { - xmlNsPtr nsptr; - - if (nodep->type == XML_ELEMENT_NODE) { - /* Following if block primarily used for inserting nodes created via createElementNS */ - if (nodep->nsDef != NULL && nodep->nsDef->href != NULL) { - if((nsptr = xmlSearchNsByHref(doc, nodep->parent, nodep->nsDef->href)) && - (nodep->nsDef->prefix == NULL || xmlStrEqual(nsptr->prefix, nodep->nsDef->prefix))) { - dom_set_old_ns(doc, nodep->nsDef); - nodep->nsDef = NULL; - } - } - xmlReconciliateNs(doc, nodep); - } -} - -/* {{{ nodeName string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68D095 -Since: -*/ -int dom_node_node_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - xmlNsPtr ns; - char *str = NULL; - xmlChar *qname = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - switch (nodep->type) { - case XML_ATTRIBUTE_NODE: - case XML_ELEMENT_NODE: - ns = nodep->ns; - if (ns != NULL && ns->prefix) { - qname = xmlStrdup(ns->prefix); - qname = xmlStrcat(qname, ":"); - qname = xmlStrcat(qname, nodep->name); - str = qname; - } else { - str = (char *) nodep->name; - } - break; - case XML_NAMESPACE_DECL: - ns = nodep->ns; - if (ns != NULL && ns->prefix) { - qname = xmlStrdup("xmlns"); - qname = xmlStrcat(qname, ":"); - qname = xmlStrcat(qname, nodep->name); - str = qname; - } else { - str = (char *) nodep->name; - } - break; - case XML_DOCUMENT_TYPE_NODE: - case XML_DTD_NODE: - case XML_PI_NODE: - case XML_ENTITY_DECL: - case XML_ENTITY_REF_NODE: - case XML_NOTATION_NODE: - str = (char *) nodep->name; - break; - case XML_CDATA_SECTION_NODE: - str = "#cdata-section"; - break; - case XML_COMMENT_NODE: - str = "#comment"; - break; - case XML_HTML_DOCUMENT_NODE: - case XML_DOCUMENT_NODE: - str = "#document"; - break; - case XML_DOCUMENT_FRAG_NODE: - str = "#document-fragment"; - break; - case XML_TEXT_NODE: - str = "#text"; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Node Type"); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if(str != NULL) { - ZVAL_STRING(*retval, str, 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - if (qname != NULL) { - xmlFree(qname); - } - - return SUCCESS; - -} - -/* }}} */ - - - -/* {{{ nodeValue string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68D080 -Since: -*/ -int dom_node_node_value_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - char *str = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - /* Access to Element node is implemented as a convience method */ - switch (nodep->type) { - case XML_ATTRIBUTE_NODE: - case XML_TEXT_NODE: - case XML_ELEMENT_NODE: - case XML_COMMENT_NODE: - case XML_CDATA_SECTION_NODE: - case XML_PI_NODE: - str = xmlNodeGetContent(nodep); - break; - case XML_NAMESPACE_DECL: - str = xmlNodeGetContent(nodep->children); - break; - default: - str = NULL; - break; - } - - ALLOC_ZVAL(*retval); - - if(str != NULL) { - ZVAL_STRING(*retval, str, 1); - xmlFree(str); - } else { - ZVAL_NULL(*retval); - } - - - return SUCCESS; - -} - -int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - xmlNode *nodep; - zval value_copy; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - /* Access to Element node is implemented as a convience method */ - switch (nodep->type) { - case XML_ELEMENT_NODE: - case XML_ATTRIBUTE_NODE: - if (nodep->children) { - node_list_unlink(nodep->children TSRMLS_CC); - } - case XML_TEXT_NODE: - case XML_COMMENT_NODE: - case XML_CDATA_SECTION_NODE: - case XML_PI_NODE: - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - xmlNodeSetContentLen(nodep, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1); - if (newval == &value_copy) { - zval_dtor(newval); - } - break; - default: - break; - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ nodeType int -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-111237558 -Since: -*/ -int dom_node_node_type_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - /* Specs dictate that they are both type XML_DOCUMENT_TYPE_NODE */ - if (nodep->type == XML_DTD_NODE) { - ZVAL_LONG(*retval, XML_DOCUMENT_TYPE_NODE); - } else { - ZVAL_LONG(*retval, nodep->type); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ parentNode DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1060184317 -Since: -*/ -int dom_node_parent_node_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *nodeparent; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - nodeparent = nodep->parent; - if (!nodeparent) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(nodeparent, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ childNodes DomNodeList -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1451460987 -Since: -*/ -int dom_node_child_nodes_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - dom_object *intern; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (dom_node_children_valid(nodep) == FAILURE) { - ZVAL_NULL(*retval); - } else { - php_dom_create_interator(*retval, DOM_NODELIST TSRMLS_CC); - intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC); - dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL TSRMLS_CC); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ firstChild DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-169727388 -Since: -*/ -int dom_node_first_child_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *first = NULL; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (dom_node_children_valid(nodep) == SUCCESS) { - first = nodep->children; - } - - if (!first) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(first, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ lastChild DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-61AD09FB -Since: -*/ -int dom_node_last_child_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *last = NULL; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (dom_node_children_valid(nodep) == SUCCESS) { - last = nodep->last; - } - - if (!last) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(last, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ previousSibling DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-640FB3C8 -Since: -*/ -int dom_node_previous_sibling_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *prevsib; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - prevsib = nodep->prev; - if (!prevsib) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(prevsib, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ nextSibling DomNode -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6AC54C2F -Since: -*/ -int dom_node_next_sibling_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep, *nextsib; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - nextsib = nodep->next; - if (!nextsib) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object(nextsib, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ attributes DomNamedNodeMap -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-84CF096 -Since: -*/ -int dom_node_attributes_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - dom_object *intern; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (nodep->type == XML_ELEMENT_NODE) { - php_dom_create_interator(*retval, DOM_NAMEDNODEMAP TSRMLS_CC); - intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC); - dom_namednode_iter(obj, XML_ATTRIBUTE_NODE, intern, NULL, NULL, NULL TSRMLS_CC); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ ownerDocument DomDocument -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-node-ownerDoc -Since: -*/ -int dom_node_owner_document_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - xmlDocPtr docp; - int ret; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; - } - - docp = nodep->doc; - if (!docp) { - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ namespaceUri string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSname -Since: DOM Level 2 -*/ -int dom_node_namespace_uri_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - char *str = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - switch (nodep->type) { - case XML_ELEMENT_NODE: - case XML_ATTRIBUTE_NODE: - case XML_NAMESPACE_DECL: - if (nodep->ns != NULL) { - str = (char *) nodep->ns->href; - } - break; - default: - str = NULL; - break; - } - - ALLOC_ZVAL(*retval); - - if(str != NULL) { - ZVAL_STRING(*retval, str, 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ prefix string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSPrefix -Since: DOM Level 2 -*/ -int dom_node_prefix_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - xmlNsPtr ns; - char *str = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - switch (nodep->type) { - case XML_ELEMENT_NODE: - case XML_ATTRIBUTE_NODE: - case XML_NAMESPACE_DECL: - ns = nodep->ns; - if (ns != NULL && ns->prefix) { - str = (char *) ns->prefix; - } - break; - default: - str = NULL; - break; - } - - ALLOC_ZVAL(*retval); - - if (str == NULL) { - ZVAL_EMPTY_STRING(*retval); - } else { - ZVAL_STRING(*retval, str, 1); - } - return SUCCESS; - -} - -int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlNode *nodep, *nsnode = NULL; - xmlNsPtr ns = NULL, curns; - char *strURI; - char *prefix; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - switch (nodep->type) { - case XML_ELEMENT_NODE: - nsnode = nodep; - case XML_ATTRIBUTE_NODE: - if (nsnode == NULL) { - nsnode = nodep->parent; - if (nsnode == NULL) { - nsnode = xmlDocGetRootElement(nodep->doc); - } - } - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - prefix = Z_STRVAL_P(newval); - if (nsnode && nodep->ns != NULL && !xmlStrEqual(nodep->ns->prefix, (xmlChar *)prefix)) { - strURI = (char *) nodep->ns->href; - if (strURI == NULL || - (!strcmp (prefix, "xml") && strcmp(strURI, XML_XML_NAMESPACE)) || - (nodep->type == XML_ATTRIBUTE_NODE && !strcmp (prefix, "xmlns") && - strcmp (strURI, DOM_XMLNS_NAMESPACE)) || - (nodep->type == XML_ATTRIBUTE_NODE && !strcmp (nodep->name, "xmlns"))) { - ns = NULL; - } else { - curns = nsnode->nsDef; - while (curns != NULL) { - if (xmlStrEqual((xmlChar *)prefix, curns->prefix) && xmlStrEqual(nodep->ns->href, curns->href)) { - ns = curns; - break; - } - curns = curns->next; - } - if (ns == NULL) { - ns = xmlNewNs(nsnode, nodep->ns->href, (xmlChar *)prefix); - } - } - - if (ns == NULL) { - if (newval == &value_copy) { - zval_dtor(newval); - } - php_dom_throw_error(NAMESPACE_ERR, dom_get_strict_error(obj->document) TSRMLS_CC); - return FAILURE; - } - - xmlSetNs(nodep, ns); - } - if (newval == &value_copy) { - zval_dtor(newval); - } - break; - default: - break; - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ localName string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSLocalN -Since: DOM Level 2 -*/ -int dom_node_local_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE || nodep->type == XML_NAMESPACE_DECL) { - ZVAL_STRING(*retval, (char *) (nodep->name), 1); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ baseURI string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-baseURI -Since: DOM Level 3 -*/ -int dom_node_base_uri_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - xmlChar *baseuri; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - baseuri = xmlNodeGetBase(nodep->doc, nodep); - if (baseuri) { - ZVAL_STRING(*retval, (char *) (baseuri), 1); - xmlFree(baseuri); - } else { - ZVAL_NULL(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ textContent string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-textContent -Since: DOM Level 3 -*/ -int dom_node_text_content_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNode *nodep; - char *str = NULL; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - str = xmlNodeGetContent(nodep); - - ALLOC_ZVAL(*retval); - - if(str != NULL) { - ZVAL_STRING(*retval, str, 1); - xmlFree(str); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - return SUCCESS; -} - -/* }}} */ - - -static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib, - xmlNodePtr nextsib, xmlNodePtr fragment, - dom_object *intern, dom_object *childobj TSRMLS_DC) -{ - xmlNodePtr newchild, node; - - newchild = fragment->children; - - if (newchild) { - if (prevsib == NULL) { - nodep->children = newchild; - } else { - prevsib->next = newchild; - } - newchild->prev = prevsib; - if (nextsib == NULL) { - nodep->last = fragment->last; - } else { - fragment->last->next = nextsib; - nextsib->prev = fragment->last; - } - - node = newchild; - while (node != NULL) { - node->parent = nodep; - if (node->doc != nodep->doc) { - xmlSetTreeDoc(node, nodep->doc); - if (node->_private != NULL) { - childobj = node->_private; - childobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC); - } - } - if (node == fragment->last) { - break; - } - node = node->next; - } - - fragment->children = NULL; - fragment->last = NULL; - } - - return newchild; -} - -/* {{{ proto domnode dom_node_insert_before(DomNode newChild, DomNode refChild); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-952280727 -Since: -*/ -PHP_FUNCTION(dom_node_insert_before) -{ - zval *id, *node, *ref = NULL, *rv = NULL; - xmlNodePtr child, new_child, parentp, refp; - dom_object *intern, *childobj, *refpobj; - int ret, stricterror; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|O!", &id, dom_node_class_entry, &node, dom_node_class_entry, &ref, dom_node_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(parentp, id, xmlNodePtr, intern); - - if (dom_node_children_valid(parentp) == FAILURE) { - RETURN_FALSE; - } - - DOM_GET_OBJ(child, node, xmlNodePtr, childobj); - - new_child = NULL; - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(parentp) == SUCCESS || - (child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (dom_hierarchy(parentp, child) == FAILURE) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (child->doc != parentp->doc && child->doc != NULL) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty"); - RETURN_FALSE; - } - - if (child->doc == NULL && parentp->doc != NULL) { - childobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC); - } - - if (ref != NULL) { - DOM_GET_OBJ(refp, ref, xmlNodePtr, refpobj); - if (refp->parent != parentp) { - php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (child->parent != NULL) { - xmlUnlinkNode(child); - } - - if (child->type == XML_TEXT_NODE && (refp->type == XML_TEXT_NODE || - (refp->prev != NULL && refp->prev->type == XML_TEXT_NODE))) { - if (child->doc == NULL) { - xmlSetTreeDoc(child, parentp->doc); - } - new_child = child; - new_child->parent = refp->parent; - new_child->next = refp; - new_child->prev = refp->prev; - refp->prev = new_child; - if (new_child->prev != NULL) { - new_child->prev->next = new_child; - } - if (new_child->parent != NULL) { - if (new_child->parent->children == refp) { - new_child->parent->children = new_child; - } - } - - } else if (child->type == XML_ATTRIBUTE_NODE) { - xmlAttrPtr lastattr; - - if (child->ns == NULL) - lastattr = xmlHasProp(refp->parent, child->name); - else - lastattr = xmlHasNsProp(refp->parent, child->name, child->ns->href); - if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) { - if (lastattr != (xmlAttrPtr) child) { - xmlUnlinkNode((xmlNodePtr) lastattr); - php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); - } else { - DOM_RET_OBJ(rv, child, &ret, intern); - return; - } - } - } else if (child->type == XML_DOCUMENT_FRAG_NODE) { - new_child = _php_dom_insert_fragment(parentp, refp->prev, refp, child, intern, childobj TSRMLS_CC); - } - - if (new_child == NULL) { - new_child = xmlAddPrevSibling(refp, child); - } - } else { - if (child->parent != NULL){ - xmlUnlinkNode(child); - } - if (child->type == XML_TEXT_NODE && parentp->last != NULL && parentp->last->type == XML_TEXT_NODE) { - child->parent = parentp; - if (child->doc == NULL) { - xmlSetTreeDoc(child, parentp->doc); - } - new_child = child; - if (parentp->children == NULL) { - parentp->children = child; - parentp->last = child; - } else { - child = parentp->last; - child->next = new_child; - new_child->prev = child; - parentp->last = new_child; - } - } else if (child->type == XML_ATTRIBUTE_NODE) { - xmlAttrPtr lastattr; - - if (child->ns == NULL) - lastattr = xmlHasProp(parentp, child->name); - else - lastattr = xmlHasNsProp(parentp, child->name, child->ns->href); - if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) { - if (lastattr != (xmlAttrPtr) child) { - xmlUnlinkNode((xmlNodePtr) lastattr); - php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); - } else { - DOM_RET_OBJ(rv, child, &ret, intern); - return; - } - } - } else if (child->type == XML_DOCUMENT_FRAG_NODE) { - new_child = _php_dom_insert_fragment(parentp, parentp->last, NULL, child, intern, childobj TSRMLS_CC); - } - if (new_child == NULL) { - new_child = xmlAddChild(parentp, child); - } - } - - if (NULL == new_child) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't add newnode as the previous sibling of refnode"); - RETURN_FALSE; - } - - dom_reconcile_ns(parentp->doc, new_child); - - DOM_RET_OBJ(rv, new_child, &ret, intern); - -} -/* }}} end dom_node_insert_before */ - - -/* {{{ proto DomNode dom_node_replace_child(DomNode newChild, DomNode oldChild); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-785887307 -Since: -*/ -PHP_FUNCTION(dom_node_replace_child) -{ - zval *id, *newnode, *oldnode; - xmlNodePtr children, newchild, oldchild, nodep; - dom_object *intern, *newchildobj, *oldchildobj; - int foundoldchild = 0, stricterror; - - int ret; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOO", &id, dom_node_class_entry, &newnode, dom_node_class_entry, &oldnode, dom_node_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_children_valid(nodep) == FAILURE) { - RETURN_FALSE; - } - - DOM_GET_OBJ(newchild, newnode, xmlNodePtr, newchildobj); - DOM_GET_OBJ(oldchild, oldnode, xmlNodePtr, oldchildobj); - - children = nodep->children; - if (!children) { - RETURN_FALSE; - } - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(nodep) == SUCCESS || - (newchild->parent != NULL && dom_node_is_read_only(newchild->parent) == SUCCESS)) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (newchild->doc != nodep->doc && newchild->doc != NULL) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (dom_hierarchy(nodep, newchild) == FAILURE) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - /* check for the old child and whether the new child is already a child */ - while (children) { - if (children == oldchild) { - foundoldchild = 1; - break; - } - children = children->next; - } - - if (foundoldchild) { - xmlNodePtr node; - zval *rv = NULL; - - if (newchild->type == XML_DOCUMENT_FRAG_NODE) { - xmlNodePtr prevsib, nextsib; - prevsib = oldchild->prev; - nextsib = oldchild->next; - - xmlUnlinkNode(oldchild); - - newchild = _php_dom_insert_fragment(nodep, prevsib, nextsib, newchild, intern, newchildobj TSRMLS_CC); - if (newchild) { - dom_reconcile_ns(nodep->doc, newchild); - } - } else if (oldchild != newchild) { - if (newchild->doc == NULL && nodep->doc != NULL) { - xmlSetTreeDoc(newchild, nodep->doc); - newchildobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)newchildobj, NULL TSRMLS_CC); - } - node = xmlReplaceNode(oldchild, newchild); - dom_reconcile_ns(nodep->doc, newchild); - } - DOM_RET_OBJ(rv, oldchild, &ret, intern); - return; - } else { - php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC); - RETURN_FALSE; - } -} -/* }}} end dom_node_replace_child */ - - -/* {{{ proto DomNode dom_node_remove_child(DomNode oldChild); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1734834066 -Since: -*/ -PHP_FUNCTION(dom_node_remove_child) -{ - zval *id, *node; - xmlNodePtr children, child, nodep; - dom_object *intern, *childobj; - int ret, stricterror; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_children_valid(nodep) == FAILURE) { - RETURN_FALSE; - } - - DOM_GET_OBJ(child, node, xmlNodePtr, childobj); - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(nodep) == SUCCESS || - (child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - children = nodep->children; - if (!children) { - php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - while (children) { - if (children == child) { - zval *rv = NULL; - xmlUnlinkNode(child); - DOM_RET_OBJ(rv, child, &ret, intern); - return; - } - children = children->next; - } - - php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC); - RETURN_FALSE -} -/* }}} end dom_node_remove_child */ - - -/* {{{ proto DomNode dom_node_append_child(DomNode newChild); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-184E7107 -Since: -*/ -PHP_FUNCTION(dom_node_append_child) -{ - zval *id, *node, *rv = NULL; - xmlNodePtr child, nodep, new_child = NULL; - dom_object *intern, *childobj; - int ret, stricterror; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_children_valid(nodep) == FAILURE) { - RETURN_FALSE; - } - - DOM_GET_OBJ(child, node, xmlNodePtr, childobj); - - stricterror = dom_get_strict_error(intern->document); - - if (dom_node_is_read_only(nodep) == SUCCESS || - (child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) { - php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (dom_hierarchy(nodep, child) == FAILURE) { - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (!(child->doc == NULL || child->doc == nodep->doc)) { - php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC); - RETURN_FALSE; - } - - if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty"); - RETURN_FALSE; - } - - if (child->doc == NULL && nodep->doc != NULL) { - childobj->document = intern->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC); - } - - if (child->parent != NULL){ - xmlUnlinkNode(child); - } - - if (child->type == XML_TEXT_NODE && nodep->last != NULL && nodep->last->type == XML_TEXT_NODE) { - child->parent = nodep; - if (child->doc == NULL) { - xmlSetTreeDoc(child, nodep->doc); - } - new_child = child; - if (nodep->children == NULL) { - nodep->children = child; - nodep->last = child; - } else { - child = nodep->last; - child->next = new_child; - new_child->prev = child; - nodep->last = new_child; - } - } else if (child->type == XML_ATTRIBUTE_NODE) { - xmlAttrPtr lastattr; - - if (child->ns == NULL) - lastattr = xmlHasProp(nodep, child->name); - else - lastattr = xmlHasNsProp(nodep, child->name, child->ns->href); - if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) { - if (lastattr != (xmlAttrPtr) child) { - xmlUnlinkNode((xmlNodePtr) lastattr); - php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC); - } - } - } else if (child->type == XML_DOCUMENT_FRAG_NODE) { - new_child = _php_dom_insert_fragment(nodep, nodep->last, NULL, child, intern, childobj TSRMLS_CC); - } - - if (new_child == NULL) { - new_child = xmlAddChild(nodep, child); - if (new_child == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't append node"); - RETURN_FALSE; - } - } - - dom_reconcile_ns(nodep->doc, new_child); - - DOM_RET_OBJ(rv, new_child, &ret, intern); -} -/* }}} end dom_node_append_child */ - - -/* {{{ proto boolean dom_node_has_child_nodes(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-810594187 -Since: -*/ -PHP_FUNCTION(dom_node_has_child_nodes) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (dom_node_children_valid(nodep) == FAILURE) { - RETURN_FALSE; - } - - if (nodep->children) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_node_has_child_nodes */ - - -/* {{{ proto DomNode dom_node_clone_node(boolean deep); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3A0ED0A4 -Since: -*/ -PHP_FUNCTION(dom_node_clone_node) -{ - zval *rv = NULL; - zval *id; - xmlNode *n, *node; - int ret; - dom_object *intern; - long recursive = 0; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_node_class_entry, &recursive) == FAILURE) { - return; - } - - DOM_GET_OBJ(n, id, xmlNodePtr, intern); - - node = xmlDocCopyNode(n, n->doc, recursive); - - if (!node) { - RETURN_FALSE; - } - - /* When deep is false Element nodes still require the attributes - Following taken from libxml as xmlDocCopyNode doesnt do this */ - if (n->type == XML_ELEMENT_NODE && recursive == 0) { - if (n->nsDef != NULL) { - node->nsDef = xmlCopyNamespaceList(n->nsDef); - } - if (n->ns != NULL) { - xmlNsPtr ns; - ns = xmlSearchNs(n->doc, node, n->ns->prefix); - if (ns == NULL) { - ns = xmlSearchNs(n->doc, n, n->ns->prefix); - if (ns != NULL) { - xmlNodePtr root = node; - - while (root->parent != NULL) { - root = root->parent; - } - node->ns = xmlNewNs(root, ns->href, ns->prefix); - } - } else { - node->ns = ns; - } - } - if (n->properties != NULL) { - node->properties = xmlCopyPropList(node, n->properties); - } - } - - /* If document cloned we want a new document proxy */ - if (node->doc != n->doc) { - intern = NULL; - } - - DOM_RET_OBJ(rv, node, &ret, intern); -} -/* }}} end dom_node_clone_node */ - - - -/* {{{ proto void dom_node_normalize(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-normalize -Since: -*/ -PHP_FUNCTION(dom_node_normalize) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - dom_normalize(nodep TSRMLS_CC); - -} -/* }}} end dom_node_normalize */ - - -/* {{{ proto boolean dom_node_is_supported(string feature, string version); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Level-2-Core-Node-supports -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_node_is_supported) -{ - zval *id; - int feature_len, version_len; - char *feature, *version; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_node_class_entry, &feature, &feature_len, &version, &version_len) == FAILURE) { - return; - } - - if (dom_has_feature(feature, version)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_node_is_supported */ - - -/* {{{ proto boolean dom_node_has_attributes(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeHasAttrs -Since: DOM Level 2 -*/ -PHP_FUNCTION(dom_node_has_attributes) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (nodep->type != XML_ELEMENT_NODE) - RETURN_FALSE; - - if (nodep->properties) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_node_has_attributes */ - -/* {{{ proto short dom_node_compare_document_position(DomNode other); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-compareDocumentPosition -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_compare_document_position) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_compare_document_position */ - - -/* {{{ proto boolean dom_node_is_same_node(DomNode other); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isSameNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_is_same_node) -{ - zval *id, *node; - xmlNodePtr nodeotherp, nodep; - dom_object *intern, *nodeotherobj; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - DOM_GET_OBJ(nodeotherp, node, xmlNodePtr, nodeotherobj); - - if (nodep == nodeotherp) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_node_is_same_node */ - - -/* {{{ proto string dom_node_lookup_prefix(string namespaceURI); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-lookupNamespacePrefix -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_lookup_prefix) -{ - zval *id; - xmlNodePtr nodep, lookupp = NULL; - dom_object *intern; - xmlNsPtr nsptr; - int uri_len = 0; - char *uri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - if (uri_len > 0) { - switch (nodep->type) { - case XML_ELEMENT_NODE: - lookupp = nodep; - break; - case XML_DOCUMENT_NODE: - case XML_HTML_DOCUMENT_NODE: - lookupp = xmlDocGetRootElement((xmlDocPtr) nodep); - break; - case XML_ENTITY_NODE : - case XML_NOTATION_NODE: - case XML_DOCUMENT_FRAG_NODE: - case XML_DOCUMENT_TYPE_NODE: - case XML_DTD_NODE: - RETURN_NULL(); - break; - default: - lookupp = nodep->parent; - } - - if (lookupp != NULL && (nsptr = xmlSearchNsByHref(lookupp->doc, lookupp, uri))) { - if (nsptr->prefix != NULL) { - RETURN_STRING((char *) nsptr->prefix, 1); - } - } - } - - RETURN_NULL(); -} -/* }}} end dom_node_lookup_prefix */ - - -/* {{{ proto boolean dom_node_is_default_namespace(string namespaceURI); -URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isDefaultNamespace -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_is_default_namespace) -{ - zval *id; - xmlNodePtr nodep; - dom_object *intern; - xmlNsPtr nsptr; - int uri_len = 0; - char *uri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - nodep = xmlDocGetRootElement((xmlDocPtr) nodep); - } - - if (nodep && uri_len > 0) { - nsptr = xmlSearchNs(nodep->doc, nodep, NULL); - if (nsptr && xmlStrEqual(nsptr->href, uri)) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} end dom_node_is_default_namespace */ - - -/* {{{ proto string dom_node_lookup_namespace_uri(string prefix); -URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_lookup_namespace_uri) -{ - zval *id; - xmlNodePtr nodep; - dom_object *intern; - xmlNsPtr nsptr; - int prefix_len = 0; - char *prefix=NULL; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) { - return; - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - nodep = xmlDocGetRootElement((xmlDocPtr) nodep); - if (nodep == NULL) { - RETURN_NULL(); - } - } - - nsptr = xmlSearchNs(nodep->doc, nodep, prefix); - if (nsptr && nsptr->href != NULL) { - RETURN_STRING((char *) nsptr->href, 1); - } - - RETURN_NULL(); -} -/* }}} end dom_node_lookup_namespace_uri */ - - -/* {{{ proto boolean dom_node_is_equal_node(DomNode arg); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isEqualNode -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_is_equal_node) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_is_equal_node */ - - -/* {{{ proto DomNode dom_node_get_feature(string feature, string version); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getFeature -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_get_feature) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_get_feature */ - - -/* {{{ proto DomUserData dom_node_set_user_data(string key, DomUserData data, userdatahandler handler); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-setUserData -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_set_user_data) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_set_user_data */ - - -/* {{{ proto DomUserData dom_node_get_user_data(string key); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getUserData -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_node_get_user_data) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_node_get_user_data */ - - -static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - zval *id; - zval *xpath_array=NULL, *ns_prefixes=NULL; - xmlNodePtr nodep; - xmlDocPtr docp; - xmlNodeSetPtr nodeset = NULL; - dom_object *intern; - zend_bool exclusive=0, with_comments=0; - xmlChar **inclusive_ns_prefixes = NULL; - char *file = NULL; - int ret = -1, file_len = 0; - xmlOutputBufferPtr buf; - xmlXPathContextPtr ctxp=NULL; - xmlXPathObjectPtr xpathobjp=NULL; - - if (mode == 0) { - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), - "O|bba!a!", &id, dom_node_class_entry, &exclusive, &with_comments, - &xpath_array, &ns_prefixes) == FAILURE) { - return; - } - } else { - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), - "Os|bba!a!", &id, dom_node_class_entry, &file, &file_len, &exclusive, - &with_comments, &xpath_array, &ns_prefixes) == FAILURE) { - return; - } - } - - DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); - - docp = nodep->doc; - - if (! docp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node must be associated with a document"); - RETURN_FALSE; - } - - if (xpath_array == NULL) { - if (nodep->type != XML_DOCUMENT_NODE) { - ctxp = xmlXPathNewContext(docp); - ctxp->node = nodep; - xpathobjp = xmlXPathEvalExpression("(.//. | .//@* | .//namespace::*)", ctxp); - ctxp->node = NULL; - if (xpathobjp && xpathobjp->type == XPATH_NODESET) { - nodeset = xpathobjp->nodesetval; - } else { - if (xpathobjp) { - xmlXPathFreeObject(xpathobjp); - } - xmlXPathFreeContext(ctxp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "XPath query did not return a nodeset."); - RETURN_FALSE; - } - } - } else { - /*xpath query from xpath_array */ - HashTable *ht = Z_ARRVAL_P(xpath_array); - zval **tmp; - char *xquery; - - if (zend_hash_find(ht, "query", sizeof("query"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_STRING) { - xquery = Z_STRVAL_PP(tmp); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'query' missing from xpath array or is not a string"); - RETURN_FALSE; - } - - ctxp = xmlXPathNewContext(docp); - ctxp->node = nodep; - - if (zend_hash_find(ht, "namespaces", sizeof("namespaces"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_ARRAY) { - zval **tmpns; - while (zend_hash_get_current_data(Z_ARRVAL_PP(tmp), (void **)&tmpns) == SUCCESS) { - if (Z_TYPE_PP(tmpns) == IS_STRING) { - char *prefix; - ulong idx; - int prefix_key_len; - - if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(tmp), - &prefix, &prefix_key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) { - xmlXPathRegisterNs(ctxp, prefix, Z_STRVAL_PP(tmpns)); - } - } - zend_hash_move_forward(Z_ARRVAL_PP(tmp)); - } - } - - xpathobjp = xmlXPathEvalExpression(xquery, ctxp); - ctxp->node = NULL; - if (xpathobjp && xpathobjp->type == XPATH_NODESET) { - nodeset = xpathobjp->nodesetval; - } else { - if (xpathobjp) { - xmlXPathFreeObject(xpathobjp); - } - xmlXPathFreeContext(ctxp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "XPath query did not return a nodeset."); - RETURN_FALSE; - } - } - - if (ns_prefixes != NULL) { - if (exclusive) { - zval **tmpns; - int nscount = 0; - - inclusive_ns_prefixes = safe_emalloc(zend_hash_num_elements(Z_ARRVAL_P(ns_prefixes)) + 1, - sizeof(xmlChar *), 0); - while (zend_hash_get_current_data(Z_ARRVAL_P(ns_prefixes), (void **)&tmpns) == SUCCESS) { - if (Z_TYPE_PP(tmpns) == IS_STRING) { - inclusive_ns_prefixes[nscount++] = Z_STRVAL_PP(tmpns); - } - zend_hash_move_forward(Z_ARRVAL_P(ns_prefixes)); - } - inclusive_ns_prefixes[nscount] = NULL; - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, - "Inclusive namespace prefixes only allowed in exlcusive mode."); - } - } - - if (mode == 1) { - buf = xmlOutputBufferCreateFilename(file, NULL, 0); - } else { - buf = xmlAllocOutputBuffer(NULL); - } - - if (buf != NULL) { - ret = xmlC14NDocSaveTo(docp, nodeset, exclusive, inclusive_ns_prefixes, - with_comments, buf); - } - - if (inclusive_ns_prefixes != NULL) { - efree(inclusive_ns_prefixes); - } - if (xpathobjp != NULL) { - xmlXPathFreeObject(xpathobjp); - } - if (ctxp != NULL) { - xmlXPathFreeContext(ctxp); - } - - if (buf == NULL || ret < 0) { - RETVAL_FALSE; - } else { - if (mode == 0) { - ret = buf->buffer->use; - if (ret > 0) { - RETVAL_STRINGL((char *) buf->buffer->content, ret, 1); - } else { - RETVAL_EMPTY_STRING(); - } - } - } - - if (buf) { - int bytes; - - bytes = xmlOutputBufferClose(buf); - if (mode == 1 && (ret >= 0)) { - RETURN_LONG(bytes); - } - } -} - -/* {{{ proto string DOMNode::C14N([bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]]) - Canonicalize nodes to a string */ -PHP_METHOD(domnode, C14N) -{ - dom_canonicalization(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} - -/* {{{ proto int DOMNode::C14NFile(string uri [, bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]]) - Canonicalize nodes to a file */ -PHP_METHOD(domnode, C14NFile) -{ - dom_canonicalization(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} - -#endif - -/* {{{ proto int DOMNode::getNodePath() - Gets an xpath for a node */ - -PHP_METHOD(domnode, getNodePath) -{ - zval *id; - xmlNode *nodep; - dom_object *intern; - char *value; - - - - DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern); - - value = xmlGetNodePath(nodep); - if (value == NULL) { - RETURN_NULL(); - } else { - RETVAL_STRING(value, 1); - xmlFree(value); - } - - -} - diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c deleted file mode 100644 index a6073dec3c9ff..0000000000000 --- a/ext/dom/nodelist.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_nodelist_item, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMNodeList -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-536297177 -* Since: -*/ - -zend_function_entry php_dom_nodelist_class_functions[] = { - PHP_FALIAS(item, dom_nodelist_item, arginfo_dom_nodelist_item) - {NULL, NULL, NULL} -}; - -/* {{{ length int -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-203510337 -Since: -*/ -int dom_nodelist_length_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - dom_nnodemap_object *objmap; - xmlNodePtr nodep, curnode; - int count = 0; - HashTable *nodeht; - - objmap = (dom_nnodemap_object *)obj->ptr; - if (objmap != NULL) { - if (objmap->ht) { - count = xmlHashSize(objmap->ht); - } else { - if (objmap->nodetype == DOM_NODESET) { - nodeht = HASH_OF(objmap->baseobjptr); - count = zend_hash_num_elements(nodeht); - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) { - curnode = nodep->children; - if (curnode) { - count++; - while (curnode->next != NULL) { - count++; - curnode = curnode->next; - } - } - } else { - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - nodep = xmlDocGetRootElement((xmlDoc *) nodep); - } else { - nodep = nodep->children; - } - curnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &count, -1); - } - } - } - } - } - - MAKE_STD_ZVAL(*retval); - ZVAL_LONG(*retval, count); - return SUCCESS; -} - -/* }}} */ - - -/* {{{ proto DOMNode dom_nodelist_item(int index); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-844377136 -Since: -*/ -PHP_FUNCTION(dom_nodelist_item) -{ - zval *id, *rv = NULL; - long index; - int ret; - dom_object *intern; - xmlNodePtr itemnode = NULL; - - dom_nnodemap_object *objmap; - xmlNodePtr nodep, curnode; - int count = 0; - HashTable *nodeht; - zval **entry; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_nodelist_class_entry, &index) == FAILURE) { - return; - } - - if (index >= 0) { - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - objmap = (dom_nnodemap_object *)intern->ptr; - if (objmap != NULL) { - if (objmap->ht) { - if (objmap->nodetype == XML_ENTITY_NODE) { - itemnode = php_dom_libxml_hash_iter(objmap->ht, index); - } else { - itemnode = php_dom_libxml_notation_iter(objmap->ht, index); - } - } else { - if (objmap->nodetype == DOM_NODESET) { - nodeht = HASH_OF(objmap->baseobjptr); - if (zend_hash_index_find(nodeht, index, (void **) &entry)==SUCCESS) { - *return_value = **entry; - zval_copy_ctor(return_value); - return; - } - } else if (objmap->baseobj) { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) { - curnode = nodep->children; - while (count < index && curnode != NULL) { - count++; - curnode = curnode->next; - } - itemnode = curnode; - } else { - if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) { - nodep = xmlDocGetRootElement((xmlDoc *) nodep); - } else { - nodep = nodep->children; - } - itemnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &count, index); - } - } - } - } - } - - if (itemnode) { - DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj); - return; - } - } - - RETVAL_NULL(); -} -/* }}} end dom_nodelist_item */ -#endif diff --git a/ext/dom/notation.c b/ext/dom/notation.c deleted file mode 100644 index e06411f306333..0000000000000 --- a/ext/dom/notation.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class DOMNotation extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5431D1B9 -* Since: -*/ - -zend_function_entry php_dom_notation_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ publicId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-54F2B4D0 -Since: -*/ -int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlEntityPtr nodep; - - nodep = (xmlEntityPtr) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->ExternalID) { - ZVAL_STRING(*retval, (char *) (nodep->ExternalID), 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ systemId string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-E8AAB1D0 -Since: -*/ -int dom_notation_system_id_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlEntityPtr nodep; - - nodep = (xmlEntityPtr) dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - if (nodep->SystemID) { - ZVAL_STRING(*retval, (char *) (nodep->SystemID), 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c deleted file mode 100644 index b0276a14b27d9..0000000000000 --- a/ext/dom/php_dom.c +++ /dev/null @@ -1,1554 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - | Marcus Borger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "ext/standard/php_rand.h" -#include "php_dom.h" -#include "dom_properties.h" - -#include "ext/standard/info.h" -#define PHP_XPATH 1 -#define PHP_XPTR 2 - -zend_class_entry *dom_node_class_entry; -zend_class_entry *dom_domexception_class_entry; -zend_class_entry *dom_domstringlist_class_entry; -zend_class_entry *dom_namelist_class_entry; -zend_class_entry *dom_domimplementationlist_class_entry; -zend_class_entry *dom_domimplementationsource_class_entry; -zend_class_entry *dom_domimplementation_class_entry; -zend_class_entry *dom_documentfragment_class_entry; -zend_class_entry *dom_document_class_entry; -zend_class_entry *dom_nodelist_class_entry; -zend_class_entry *dom_namednodemap_class_entry; -zend_class_entry *dom_characterdata_class_entry; -zend_class_entry *dom_attr_class_entry; -zend_class_entry *dom_element_class_entry; -zend_class_entry *dom_text_class_entry; -zend_class_entry *dom_comment_class_entry; -zend_class_entry *dom_typeinfo_class_entry; -zend_class_entry *dom_userdatahandler_class_entry; -zend_class_entry *dom_domerror_class_entry; -zend_class_entry *dom_domerrorhandler_class_entry; -zend_class_entry *dom_domlocator_class_entry; -zend_class_entry *dom_domconfiguration_class_entry; -zend_class_entry *dom_cdatasection_class_entry; -zend_class_entry *dom_documenttype_class_entry; -zend_class_entry *dom_notation_class_entry; -zend_class_entry *dom_entity_class_entry; -zend_class_entry *dom_entityreference_class_entry; -zend_class_entry *dom_processinginstruction_class_entry; -zend_class_entry *dom_string_extend_class_entry; -#if defined(LIBXML_XPATH_ENABLED) -zend_class_entry *dom_xpath_class_entry; -#endif -zend_class_entry *dom_namespace_node_class_entry; - -zend_object_handlers dom_object_handlers; -zend_object_handlers dom_ze1_object_handlers; - -static HashTable classes; - -static HashTable dom_domstringlist_prop_handlers; -static HashTable dom_namelist_prop_handlers; -static HashTable dom_domimplementationlist_prop_handlers; -static HashTable dom_document_prop_handlers; -static HashTable dom_node_prop_handlers; -static HashTable dom_nodelist_prop_handlers; -static HashTable dom_namednodemap_prop_handlers; -static HashTable dom_characterdata_prop_handlers; -static HashTable dom_attr_prop_handlers; -static HashTable dom_element_prop_handlers; -static HashTable dom_text_prop_handlers; -static HashTable dom_typeinfo_prop_handlers; -static HashTable dom_domerror_prop_handlers; -static HashTable dom_domlocator_prop_handlers; -static HashTable dom_documenttype_prop_handlers; -static HashTable dom_notation_prop_handlers; -static HashTable dom_entity_prop_handlers; -static HashTable dom_processinginstruction_prop_handlers; -static HashTable dom_namespace_node_prop_handlers; -#if defined(LIBXML_XPATH_ENABLED) -static HashTable dom_xpath_prop_handlers; -#endif - -typedef int (*dom_read_t)(dom_object *obj, zval **retval TSRMLS_DC); -typedef int (*dom_write_t)(dom_object *obj, zval *newval TSRMLS_DC); - -typedef struct _dom_prop_handler { - dom_read_t read_func; - dom_write_t write_func; -} dom_prop_handler; - -/* {{{ int dom_node_is_read_only(xmlNodePtr node) */ -int dom_node_is_read_only(xmlNodePtr node) { - switch (node->type) { - case XML_ENTITY_REF_NODE: - case XML_ENTITY_NODE: - case XML_DOCUMENT_TYPE_NODE: - case XML_NOTATION_NODE: - case XML_DTD_NODE: - case XML_ELEMENT_DECL: - case XML_ATTRIBUTE_DECL: - case XML_ENTITY_DECL: - case XML_NAMESPACE_DECL: - return SUCCESS; - break; - default: - if (node->doc == NULL) { - return SUCCESS; - } else { - return FAILURE; - } - } -} -/* }}} end dom_node_is_read_only */ - -/* {{{ int dom_node_children_valid(xmlNodePtr node) */ -int dom_node_children_valid(xmlNodePtr node) { - switch (node->type) { - case XML_DOCUMENT_TYPE_NODE: - case XML_DTD_NODE: - case XML_PI_NODE: - case XML_COMMENT_NODE: - case XML_TEXT_NODE: - case XML_CDATA_SECTION_NODE: - case XML_NOTATION_NODE: - return FAILURE; - break; - default: - return SUCCESS; - } -} -/* }}} end dom_node_children_valid */ - -/* {{{ dom_get_doc_props() */ -dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document) -{ - dom_doc_propsptr doc_props; - - if (document && document->doc_props) { - return document->doc_props; - } else { - doc_props = emalloc(sizeof(libxml_doc_props)); - doc_props->formatoutput = 0; - doc_props->validateonparse = 0; - doc_props->resolveexternals = 0; - doc_props->preservewhitespace = 1; - doc_props->substituteentities = 0; - doc_props->stricterror = 1; - doc_props->recover = 0; - doc_props->classmap = NULL; - if (document) { - document->doc_props = doc_props; - } - return doc_props; - } -} - -int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC) -{ - dom_doc_propsptr doc_props; - - if (document) { - doc_props = dom_get_doc_props(document); - if (doc_props->classmap == NULL) { - if (ce == NULL) { - return SUCCESS; - } - ALLOC_HASHTABLE(doc_props->classmap); - zend_hash_init(doc_props->classmap, 0, NULL, NULL, 0); - } - if (ce) { - return zend_hash_update(doc_props->classmap, basece->name, basece->name_length + 1, &ce, sizeof(ce), NULL); - } else { - zend_hash_del(doc_props->classmap, basece->name, basece->name_length + 1); - } - } - return SUCCESS; -} - -zend_class_entry *dom_get_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece TSRMLS_DC) -{ - dom_doc_propsptr doc_props; - zend_class_entry **ce = NULL; - - if (document) { - doc_props = dom_get_doc_props(document); - if (doc_props->classmap) { - if (zend_hash_find(doc_props->classmap, basece->name, basece->name_length + 1, (void**) &ce) == SUCCESS) { - return *ce; - } - } - } - - return basece; -} -/* }}} */ - -/* {{{ dom_get_strict_error() */ -int dom_get_strict_error(php_libxml_ref_obj *document) { - int stricterror; - dom_doc_propsptr doc_props; - - doc_props = dom_get_doc_props(document); - stricterror = doc_props->stricterror; - if (document == NULL) { - efree(doc_props); - } - - return stricterror; -} -/* }}} */ - -/* {{{ xmlNodePtr dom_object_get_node(dom_object *obj) */ -PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj) -{ - if (obj && obj->ptr != NULL) { - return ((php_libxml_node_ptr *)obj->ptr)->node; - } else { - return NULL; - } -} -/* }}} end dom_object_get_node */ - -/* {{{ dom_object *php_dom_object_get_data(xmlNodePtr obj) */ -PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj) -{ - if (obj && obj->_private != NULL) { - return (dom_object *) ((php_libxml_node_ptr *) obj->_private)->_private; - } else { - return NULL; - } -} -/* }}} end php_dom_object_get_data */ - -/* {{{ dom_read_na */ -static int dom_read_na(dom_object *obj, zval **retval TSRMLS_DC) -{ - *retval = NULL; - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot read property"); - return FAILURE; -} -/* }}} */ - -/* {{{ dom_write_na */ -static int dom_write_na(dom_object *obj, zval *newval TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot write property"); - return FAILURE; -} -/* }}} */ - -/* {{{ dom_register_prop_handler */ -static void dom_register_prop_handler(HashTable *prop_handler, char *name, dom_read_t read_func, dom_write_t write_func TSRMLS_DC) -{ - dom_prop_handler hnd; - - hnd.read_func = read_func ? read_func : dom_read_na; - hnd.write_func = write_func ? write_func : dom_write_na; - zend_hash_add(prop_handler, name, strlen(name)+1, &hnd, sizeof(dom_prop_handler), NULL); -} -/* }}} */ - -static zval **dom_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) -{ - dom_object *obj; - zval tmp_member; - zval **retval = NULL; - dom_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret = FAILURE; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - if (ret == FAILURE) { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->get_property_ptr_ptr(object, member TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} - -/* {{{ dom_read_property */ -zval *dom_read_property(zval *object, zval *member, int type TSRMLS_DC) -{ - dom_object *obj; - zval tmp_member; - zval *retval; - dom_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } else if (instanceof_function(obj->std.ce, dom_node_class_entry TSRMLS_CC)) { - php_error(E_WARNING, "Couldn't fetch %s. Node no longer exists", obj->std.ce->name); - } - if (ret == SUCCESS) { - ret = hnd->read_func(obj, &retval TSRMLS_CC); - if (ret == SUCCESS) { - /* ensure we're creating a temporary variable */ - retval->refcount = 0; - retval->is_ref = 0; - } else { - retval = EG(uninitialized_zval_ptr); - } - } else { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->read_property(object, member, type TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} -/* }}} */ - -/* {{{ dom_write_property */ -void dom_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - dom_object *obj; - zval tmp_member; - dom_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find((HashTable *)obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - if (ret == SUCCESS) { - hnd->write_func(obj, value TSRMLS_CC); - } else { - std_hnd = zend_get_std_object_handlers(); - std_hnd->write_property(object, member, value TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } -} -/* }}} */ - -/* {{{ dom_property_exists */ -static int dom_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - dom_object *obj; - zval tmp_member; - dom_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret, retval=0; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find((HashTable *)obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - if (ret == SUCCESS) { - zval *tmp; - - if (check_empty == 2) { - retval = 1; - } else if (hnd->read_func(obj, &tmp TSRMLS_CC) == SUCCESS) { - tmp->refcount = 1; - tmp->is_ref = 0; - if (check_empty == 1) { - retval = zend_is_true(tmp); - } else if (check_empty == 0) { - retval = (Z_TYPE_P(tmp) != IS_NULL); - } - zval_ptr_dtor(&tmp); - } - } else { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->has_property(object, member, check_empty TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} -/* }}} */ - -void *php_dom_export_node(zval *object TSRMLS_DC) -{ - php_libxml_node_object *intern; - xmlNodePtr nodep = NULL; - - intern = (php_libxml_node_object *)zend_object_store_get_object(object TSRMLS_CC); - if (intern && intern->node) { - nodep = intern->node->node; - } - - return nodep; -} - -/* {{{ proto somNode dom_import_simplexml(sxeobject node) - Get a simplexml_element object from dom to allow for processing */ -PHP_FUNCTION(dom_import_simplexml) -{ - zval *rv = NULL; - zval *node; - xmlNodePtr nodep = NULL; - php_libxml_node_object *nodeobj; - int ret; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &node) == FAILURE) { - return; - } - - nodeobj = (php_libxml_node_object *)zend_object_store_get_object(node TSRMLS_CC); - nodep = php_libxml_import_node(node TSRMLS_CC); - - if (nodep && nodeobj && (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE)) { - DOM_RET_OBJ(rv, (xmlNodePtr) nodep, &ret, (dom_object *)nodeobj); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Nodetype to import"); - RETURN_NULL(); - } -} -/* }}} */ - -zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC) -{ - zend_object_value retval; - void *new_object; - dom_object *intern; - dom_object *old_object; - struct _store_object *obj; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - - if (obj->clone == NULL) { - php_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_P(zobject)->name); - } - - obj->clone(obj->object, &new_object TSRMLS_CC); - - retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC); - intern = (dom_object *) new_object; - intern->handle = retval.handle; - retval.handlers = Z_OBJ_HT_P(zobject); - - old_object = (dom_object *) obj->object; - zend_objects_clone_members(&intern->std, retval, &old_object->std, intern->handle TSRMLS_CC); - - return retval; -} - - -zend_object_value dom_objects_ze1_clone_obj(zval *zobject TSRMLS_DC) -{ - php_error(E_ERROR, "Cannot clone object of class %s due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(zobject)->name); - /* Return zobject->value.obj just to satisfy compiler */ - return zobject->value.obj; -} - -static zend_function_entry dom_functions[] = { - PHP_FE(dom_import_simplexml, NULL) - {NULL, NULL, NULL} -}; - -static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) { - if (EG(ze1_compatibility_mode)) { - return &dom_ze1_object_handlers; - } else { - return &dom_object_handlers; - } -} - -static zend_module_dep dom_deps[] = { - ZEND_MOD_REQUIRED("libxml") - ZEND_MOD_CONFLICTS("domxml") - {NULL, NULL, NULL} -}; - -zend_module_entry dom_module_entry = { - STANDARD_MODULE_HEADER_EX, NULL, - dom_deps, - "dom", - dom_functions, - PHP_MINIT(dom), - PHP_MSHUTDOWN(dom), - NULL, - NULL, - PHP_MINFO(dom), - DOM_API_VERSION, /* Extension versionnumber */ - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_DOM -ZEND_GET_MODULE(dom) -#endif - -/* {{{ PHP_MINIT_FUNCTION(dom) */ -PHP_MINIT_FUNCTION(dom) -{ - zend_class_entry ce; - - memcpy(&dom_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - dom_object_handlers.read_property = dom_read_property; - dom_object_handlers.write_property = dom_write_property; - dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr; - dom_object_handlers.clone_obj = dom_objects_store_clone_obj; - dom_object_handlers.has_property = dom_property_exists; - - memcpy(&dom_ze1_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - dom_ze1_object_handlers.read_property = dom_read_property; - dom_ze1_object_handlers.write_property = dom_write_property; - dom_ze1_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr; - dom_ze1_object_handlers.clone_obj = dom_objects_ze1_clone_obj; - dom_ze1_object_handlers.has_property = dom_property_exists; - - zend_hash_init(&classes, 0, NULL, NULL, 1); - - INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions); - dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); - dom_domexception_class_entry->ce_flags |= ZEND_ACC_FINAL; - zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); - - REGISTER_DOM_CLASS(ce, "DOMStringList", NULL, php_dom_domstringlist_class_functions, dom_domstringlist_class_entry); - - zend_hash_init(&dom_domstringlist_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_domstringlist_prop_handlers, "length", dom_domstringlist_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_domstringlist_prop_handlers, sizeof(dom_domstringlist_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMNameList", NULL, php_dom_namelist_class_functions, dom_namelist_class_entry); - - zend_hash_init(&dom_namelist_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_namelist_prop_handlers, "length", dom_namelist_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_namelist_prop_handlers, sizeof(dom_namelist_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMImplementationList", NULL, php_dom_domimplementationlist_class_functions, dom_domimplementationlist_class_entry); - - zend_hash_init(&dom_domimplementationlist_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_domimplementationlist_prop_handlers, "length", dom_domimplementationlist_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_domimplementationlist_prop_handlers, sizeof(dom_domimplementationlist_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMImplementationSource", NULL, php_dom_domimplementationsource_class_functions, dom_domimplementationsource_class_entry); - REGISTER_DOM_CLASS(ce, "DOMImplementation", NULL, php_dom_domimplementation_class_functions, dom_domimplementation_class_entry); - - REGISTER_DOM_CLASS(ce, "DOMNode", NULL, php_dom_node_class_functions, dom_node_class_entry); - - zend_hash_init(&dom_node_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "childNodes", dom_node_child_nodes_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "firstChild", dom_node_first_child_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "lastChild", dom_node_last_child_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "previousSibling", dom_node_previous_sibling_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "nextSibling", dom_node_next_sibling_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "attributes", dom_node_attributes_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "prefix", dom_node_prefix_read, dom_node_prefix_write TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "localName", dom_node_local_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "baseURI", dom_node_base_uri_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_node_prop_handlers, "textContent", dom_node_text_content_read, dom_node_text_content_write TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_node_prop_handlers, sizeof(dom_node_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMNameSpaceNode", NULL, NULL, dom_namespace_node_class_entry); - - zend_hash_init(&dom_namespace_node_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeValue", dom_node_node_value_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "prefix", dom_node_prefix_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "localName", dom_node_local_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_namespace_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_namespace_node_prop_handlers, sizeof(dom_namespace_node_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMDocumentFragment", dom_node_class_entry, php_dom_documentfragment_class_functions, dom_documentfragment_class_entry); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_node_prop_handlers, sizeof(dom_node_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMDocument", dom_node_class_entry, php_dom_document_class_functions, dom_document_class_entry); - zend_hash_init(&dom_document_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_document_prop_handlers, "doctype", dom_document_doctype_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "implementation", dom_document_implementation_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "documentElement", dom_document_document_element_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "actualEncoding", dom_document_encoding_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "encoding", dom_document_encoding_read, dom_document_encoding_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "xmlEncoding", dom_document_encoding_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "standalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "xmlStandalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "version", dom_document_version_read, dom_document_version_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "xmlVersion", dom_document_version_read, dom_document_version_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "strictErrorChecking", dom_document_strict_error_checking_read, dom_document_strict_error_checking_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "documentURI", dom_document_document_uri_read, dom_document_document_uri_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "config", dom_document_config_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "formatOutput", dom_document_format_output_read, dom_document_format_output_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "validateOnParse", dom_document_validate_on_parse_read, dom_document_validate_on_parse_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "resolveExternals", dom_document_resolve_externals_read, dom_document_resolve_externals_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "preserveWhiteSpace", dom_document_preserve_whitespace_read, dom_document_preserve_whitespace_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "recover", dom_document_recover_read, dom_document_recover_write TSRMLS_CC); - dom_register_prop_handler(&dom_document_prop_handlers, "substituteEntities", dom_document_substitue_entities_read, dom_document_substitue_entities_write TSRMLS_CC); - - zend_hash_merge(&dom_document_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_document_prop_handlers, sizeof(dom_document_prop_handlers), NULL); - - INIT_CLASS_ENTRY(ce, "DOMNodeList", php_dom_nodelist_class_functions); - ce.create_object = dom_nnodemap_objects_new; - dom_nodelist_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - dom_nodelist_class_entry->get_iterator = php_dom_get_iterator; - - zend_hash_init(&dom_nodelist_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_nodelist_prop_handlers, "length", dom_nodelist_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_nodelist_prop_handlers, sizeof(dom_nodelist_prop_handlers), NULL); - - INIT_CLASS_ENTRY(ce, "DOMNamedNodeMap", php_dom_namednodemap_class_functions); - ce.create_object = dom_nnodemap_objects_new; - dom_namednodemap_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - dom_namednodemap_class_entry->get_iterator = php_dom_get_iterator; - - zend_hash_init(&dom_namednodemap_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_namednodemap_prop_handlers, "length", dom_namednodemap_length_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_namednodemap_prop_handlers, sizeof(dom_namednodemap_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMCharacterData", dom_node_class_entry, php_dom_characterdata_class_functions, dom_characterdata_class_entry); - - zend_hash_init(&dom_characterdata_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_characterdata_prop_handlers, "data", dom_characterdata_data_read, dom_characterdata_data_write TSRMLS_CC); - dom_register_prop_handler(&dom_characterdata_prop_handlers, "length", dom_characterdata_length_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_characterdata_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_characterdata_prop_handlers, sizeof(dom_characterdata_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMAttr", dom_node_class_entry, php_dom_attr_class_functions, dom_attr_class_entry); - - zend_hash_init(&dom_attr_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_attr_prop_handlers, "name", dom_attr_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_attr_prop_handlers, "specified", dom_attr_specified_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_attr_prop_handlers, "value", dom_attr_value_read, dom_attr_value_write TSRMLS_CC); - dom_register_prop_handler(&dom_attr_prop_handlers, "ownerElement", dom_attr_owner_element_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_attr_prop_handlers, "schemaTypeInfo", dom_attr_schema_type_info_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_attr_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_attr_prop_handlers, sizeof(dom_attr_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMElement", dom_node_class_entry, php_dom_element_class_functions, dom_element_class_entry); - - zend_hash_init(&dom_element_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_element_prop_handlers, "tagName", dom_element_tag_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_element_prop_handlers, "schemaTypeInfo", dom_element_schema_type_info_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_element_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_element_prop_handlers, sizeof(dom_element_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMText", dom_characterdata_class_entry, php_dom_text_class_functions, dom_text_class_entry); - - zend_hash_init(&dom_text_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_text_prop_handlers, "wholeText", dom_text_whole_text_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_text_prop_handlers, &dom_characterdata_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_text_prop_handlers, sizeof(dom_text_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMComment", dom_characterdata_class_entry, php_dom_comment_class_functions, dom_comment_class_entry); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_characterdata_prop_handlers, sizeof(dom_typeinfo_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMTypeinfo", NULL, php_dom_typeinfo_class_functions, dom_typeinfo_class_entry); - - zend_hash_init(&dom_typeinfo_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeName", dom_typeinfo_type_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeNamespace", dom_typeinfo_type_namespace_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_typeinfo_prop_handlers, sizeof(dom_typeinfo_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMUserDataHandler", NULL, php_dom_userdatahandler_class_functions, dom_userdatahandler_class_entry); - REGISTER_DOM_CLASS(ce, "DOMDomError", NULL, php_dom_domerror_class_functions, dom_domerror_class_entry); - - zend_hash_init(&dom_domerror_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_domerror_prop_handlers, "severity", dom_domerror_severity_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "message", dom_domerror_message_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "type", dom_domerror_type_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "relatedException", dom_domerror_related_exception_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "related_data", dom_domerror_related_data_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domerror_prop_handlers, "location", dom_domerror_location_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_domerror_prop_handlers, sizeof(dom_domerror_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMErrorHandler", NULL, php_dom_domerrorhandler_class_functions, dom_domerrorhandler_class_entry); - REGISTER_DOM_CLASS(ce, "DOMLocator", NULL, php_dom_domlocator_class_functions, dom_domlocator_class_entry); - - zend_hash_init(&dom_domlocator_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "lineNumber", dom_domlocator_line_number_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "columnNumber", dom_domlocator_column_number_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "offset", dom_domlocator_offset_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "relatedNode", dom_domlocator_related_node_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_domlocator_prop_handlers, "uri", dom_domlocator_uri_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_domlocator_prop_handlers, sizeof(dom_domlocator_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMConfiguration", NULL, php_dom_domconfiguration_class_functions, dom_domconfiguration_class_entry); - REGISTER_DOM_CLASS(ce, "DOMCdataSection", dom_text_class_entry, php_dom_cdatasection_class_functions, dom_cdatasection_class_entry); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_text_prop_handlers, sizeof(dom_documenttype_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMDocumentType", dom_node_class_entry, php_dom_documenttype_class_functions, dom_documenttype_class_entry); - - zend_hash_init(&dom_documenttype_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "name", dom_documenttype_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "entities", dom_documenttype_entities_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "notations", dom_documenttype_notations_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "publicId", dom_documenttype_public_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "systemId", dom_documenttype_system_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_documenttype_prop_handlers, "internalSubset", dom_documenttype_internal_subset_read, NULL TSRMLS_CC); - zend_hash_merge(&dom_documenttype_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_documenttype_prop_handlers, sizeof(dom_documenttype_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMNotation", NULL, php_dom_notation_class_functions, dom_notation_class_entry); - - zend_hash_init(&dom_notation_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_notation_prop_handlers, "publicId", dom_notation_public_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_notation_prop_handlers, "systemId", dom_notation_system_id_read, NULL TSRMLS_CC); - /* Notation nodes are special */ - dom_register_prop_handler(&dom_notation_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_notation_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write TSRMLS_CC); - dom_register_prop_handler(&dom_notation_prop_handlers, "attributes", dom_node_attributes_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_notation_prop_handlers, sizeof(dom_notation_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMEntity", dom_node_class_entry, php_dom_entity_class_functions, dom_entity_class_entry); - - zend_hash_init(&dom_entity_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_entity_prop_handlers, "publicId", dom_entity_public_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "systemId", dom_entity_system_id_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "notationName", dom_entity_notation_name_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "actualEncoding", dom_entity_actual_encoding_read, dom_entity_actual_encoding_write TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "encoding", dom_entity_encoding_read, dom_entity_encoding_write TSRMLS_CC); - dom_register_prop_handler(&dom_entity_prop_handlers, "version", dom_entity_version_read, dom_entity_version_write TSRMLS_CC); - zend_hash_merge(&dom_entity_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_entity_prop_handlers, sizeof(dom_entity_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMEntityReference", dom_node_class_entry, php_dom_entityreference_class_functions, dom_entityreference_class_entry); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_node_prop_handlers, sizeof(dom_entity_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMProcessingInstruction", dom_node_class_entry, php_dom_processinginstruction_class_functions, dom_processinginstruction_class_entry); - - zend_hash_init(&dom_processinginstruction_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "target", dom_processinginstruction_target_read, NULL TSRMLS_CC); - dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "data", dom_processinginstruction_data_read, dom_processinginstruction_data_write TSRMLS_CC); - zend_hash_merge(&dom_processinginstruction_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_processinginstruction_prop_handlers, sizeof(dom_processinginstruction_prop_handlers), NULL); - - REGISTER_DOM_CLASS(ce, "DOMStringExtend", NULL, php_dom_string_extend_class_functions, dom_string_extend_class_entry); - -#if defined(LIBXML_XPATH_ENABLED) - INIT_CLASS_ENTRY(ce, "DOMXPath", php_dom_xpath_class_functions); - ce.create_object = dom_xpath_objects_new; - dom_xpath_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - - zend_hash_init(&dom_xpath_prop_handlers, 0, NULL, NULL, 1); - dom_register_prop_handler(&dom_xpath_prop_handlers, "document", dom_xpath_document_read, NULL TSRMLS_CC); - zend_hash_add(&classes, ce.name, ce.name_length + 1, &dom_xpath_prop_handlers, sizeof(dom_xpath_prop_handlers), NULL); -#endif - - REGISTER_LONG_CONSTANT("XML_ELEMENT_NODE", XML_ELEMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NODE", XML_ATTRIBUTE_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_TEXT_NODE", XML_TEXT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_CDATA_SECTION_NODE", XML_CDATA_SECTION_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ENTITY_REF_NODE", XML_ENTITY_REF_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ENTITY_NODE", XML_ENTITY_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_PI_NODE", XML_PI_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_COMMENT_NODE", XML_COMMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DOCUMENT_NODE", XML_DOCUMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DOCUMENT_TYPE_NODE", XML_DOCUMENT_TYPE_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DOCUMENT_FRAG_NODE", XML_DOCUMENT_FRAG_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_NOTATION_NODE", XML_NOTATION_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_HTML_DOCUMENT_NODE", XML_HTML_DOCUMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DTD_NODE", XML_DTD_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ELEMENT_DECL_NODE", XML_ELEMENT_DECL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_DECL_NODE", XML_ATTRIBUTE_DECL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ENTITY_DECL_NODE", XML_ENTITY_DECL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_NAMESPACE_DECL_NODE", XML_NAMESPACE_DECL, CONST_CS | CONST_PERSISTENT); -#ifdef XML_GLOBAL_NAMESPACE - REGISTER_LONG_CONSTANT("XML_GLOBAL_NAMESPACE", XML_GLOBAL_NAMESPACE, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("XML_LOCAL_NAMESPACE", XML_LOCAL_NAMESPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_CDATA", XML_ATTRIBUTE_CDATA, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ID", XML_ATTRIBUTE_ID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_IDREF", XML_ATTRIBUTE_IDREF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_IDREFS", XML_ATTRIBUTE_IDREFS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENTITY", XML_ATTRIBUTE_ENTITIES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NMTOKEN", XML_ATTRIBUTE_NMTOKEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NMTOKENS", XML_ATTRIBUTE_NMTOKENS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENUMERATION", XML_ATTRIBUTE_ENUMERATION, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NOTATION", XML_ATTRIBUTE_NOTATION, CONST_CS | CONST_PERSISTENT); - - /* DOMException Codes */ - REGISTER_LONG_CONSTANT("DOM_PHP_ERR", PHP_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INDEX_SIZE_ERR", INDEX_SIZE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOMSTRING_SIZE_ERR", DOMSTRING_SIZE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_HIERARCHY_REQUEST_ERR", HIERARCHY_REQUEST_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_WRONG_DOCUMENT_ERR", WRONG_DOCUMENT_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INVALID_CHARACTER_ERR", INVALID_CHARACTER_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NO_DATA_ALLOWED_ERR", NO_DATA_ALLOWED_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NO_MODIFICATION_ALLOWED_ERR", NO_MODIFICATION_ALLOWED_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NOT_FOUND_ERR", NOT_FOUND_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NOT_SUPPORTED_ERR", NOT_SUPPORTED_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INUSE_ATTRIBUTE_ERR", INUSE_ATTRIBUTE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INVALID_STATE_ERR", INVALID_STATE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_SYNTAX_ERR", SYNTAX_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INVALID_MODIFICATION_ERR", INVALID_MODIFICATION_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_NAMESPACE_ERR", NAMESPACE_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_INVALID_ACCESS_ERR", INVALID_ACCESS_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DOM_VALIDATION_ERR", VALIDATION_ERR, CONST_CS | CONST_PERSISTENT); - - php_libxml_register_export(dom_node_class_entry, php_dom_export_node); - - return SUCCESS; -} -/* }}} */ - -/* {{{ */ -PHP_MINFO_FUNCTION(dom) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "DOM/XML", "enabled"); - php_info_print_table_row(2, "DOM/XML API Version", DOM_API_VERSION); - php_info_print_table_row(2, "libxml Version", LIBXML_DOTTED_VERSION); -#if defined(LIBXML_HTML_ENABLED) - php_info_print_table_row(2, "HTML Support", "enabled"); -#endif -#if defined(LIBXML_XPATH_ENABLED) - php_info_print_table_row(2, "XPath Support", "enabled"); -#endif -#if defined(LIBXML_XPTR_ENABLED) - php_info_print_table_row(2, "XPointer Support", "enabled"); -#endif -#ifdef LIBXML_SCHEMAS_ENABLED - php_info_print_table_row(2, "Schema Support", "enabled"); - php_info_print_table_row(2, "RelaxNG Support", "enabled"); -#endif - php_info_print_table_end(); -} -/* }}} */ - -PHP_MSHUTDOWN_FUNCTION(dom) -{ - zend_hash_destroy(&dom_domstringlist_prop_handlers); - zend_hash_destroy(&dom_namelist_prop_handlers); - zend_hash_destroy(&dom_domimplementationlist_prop_handlers); - zend_hash_destroy(&dom_document_prop_handlers); - zend_hash_destroy(&dom_node_prop_handlers); - zend_hash_destroy(&dom_namespace_node_prop_handlers); - zend_hash_destroy(&dom_nodelist_prop_handlers); - zend_hash_destroy(&dom_namednodemap_prop_handlers); - zend_hash_destroy(&dom_characterdata_prop_handlers); - zend_hash_destroy(&dom_attr_prop_handlers); - zend_hash_destroy(&dom_element_prop_handlers); - zend_hash_destroy(&dom_text_prop_handlers); - zend_hash_destroy(&dom_typeinfo_prop_handlers); - zend_hash_destroy(&dom_domerror_prop_handlers); - zend_hash_destroy(&dom_domlocator_prop_handlers); - zend_hash_destroy(&dom_documenttype_prop_handlers); - zend_hash_destroy(&dom_notation_prop_handlers); - zend_hash_destroy(&dom_entity_prop_handlers); - zend_hash_destroy(&dom_processinginstruction_prop_handlers); -#if defined(LIBXML_XPATH_ENABLED) - zend_hash_destroy(&dom_xpath_prop_handlers); -#endif - zend_hash_destroy(&classes); - -/* If you want do find memleaks in this module, compile libxml2 with --with-mem-debug and - uncomment the following line, this will tell you the amount of not freed memory - and the total used memory into apaches error_log */ -/* xmlMemoryDump();*/ - - return SUCCESS; -} - -/* {{{ node_list_unlink */ -void node_list_unlink(xmlNodePtr node TSRMLS_DC) -{ - dom_object *wrapper; - - while (node != NULL) { - - wrapper = php_dom_object_get_data(node); - - if (wrapper != NULL ) { - xmlUnlinkNode(node); - } else { - if (node->type == XML_ENTITY_REF_NODE) - break; - node_list_unlink(node->children TSRMLS_CC); - - switch (node->type) { - case XML_ATTRIBUTE_DECL: - case XML_DTD_NODE: - case XML_DOCUMENT_TYPE_NODE: - case XML_ENTITY_DECL: - case XML_ATTRIBUTE_NODE: - case XML_TEXT_NODE: - break; - default: - node_list_unlink((xmlNodePtr) node->properties TSRMLS_CC); - } - - } - - node = node->next; - } -} -/* }}} end node_list_unlink */ - -#if defined(LIBXML_XPATH_ENABLED) -/* {{{ dom_xpath_objects_free_storage */ -void dom_xpath_objects_free_storage(void *object TSRMLS_DC) -{ - dom_object *intern = (dom_object *)object; - - zend_object_std_dtor(&intern->std TSRMLS_CC); - - if (intern->ptr != NULL) { - xmlXPathFreeContext((xmlXPathContextPtr) intern->ptr); - php_libxml_decrement_doc_ref((php_libxml_node_object *) intern TSRMLS_CC); - intern->ptr = NULL; - } - - efree(object); -} -/* }}} */ -#endif - -/* {{{ dom_objects_free_storage */ -void dom_objects_free_storage(void *object TSRMLS_DC) -{ - dom_object *intern = (dom_object *)object; - int retcount; - - zend_object_std_dtor(&intern->std TSRMLS_CC); - - if (intern->ptr != NULL && ((php_libxml_node_ptr *)intern->ptr)->node != NULL) { - if (((xmlNodePtr) ((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_DOCUMENT_NODE && ((xmlNodePtr) ((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_HTML_DOCUMENT_NODE) { - php_libxml_node_decrement_resource((php_libxml_node_object *) intern TSRMLS_CC); - } else { - php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC); - retcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - } - intern->ptr = NULL; - } - - efree(object); -} -/* }}} */ - -void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC) -{ - dom_nnodemap_object *mapptr; - zval *baseobj = NULL; - - mapptr = (dom_nnodemap_object *)intern->ptr; - if (basenode) { - MAKE_STD_ZVAL(baseobj); - baseobj->type = IS_OBJECT; - baseobj->is_ref = 1; - baseobj->value.obj.handle = basenode->handle; - baseobj->value.obj.handlers = dom_get_obj_handlers(TSRMLS_C); - zval_copy_ctor(baseobj); - } - mapptr->baseobjptr = baseobj; - mapptr->baseobj = basenode; - mapptr->nodetype = ntype; - mapptr->ht = ht; - mapptr->local = local; - mapptr->ns = ns; - -} - -static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy TSRMLS_DC) -{ - zend_class_entry *base_class; - zval *tmp; - dom_object *intern; - - intern = emalloc(sizeof(dom_object)); - intern->ptr = NULL; - intern->prop_handler = NULL; - intern->document = NULL; - - base_class = class_type; - while(base_class->type != ZEND_INTERNAL_CLASS && base_class->parent != NULL) { - base_class = base_class->parent; - } - - zend_hash_find(&classes, base_class->name, base_class->name_length + 1, (void **) &intern->prop_handler); - - zend_object_std_init(&intern->std, class_type TSRMLS_CC); - if (hash_copy) { - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - } - - return intern; -} - -/* {{{ dom_objects_clone */ -void dom_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - dom_object *intern = (dom_object *) object; - dom_object *clone; - xmlNodePtr node; - xmlNodePtr cloned_node; - - clone = dom_objects_set_class(intern->std.ce, 0 TSRMLS_CC); - - if (instanceof_function(intern->std.ce, dom_node_class_entry TSRMLS_CC)) { - node = (xmlNodePtr)dom_object_get_node((dom_object *) object); - if (node != NULL) { - cloned_node = xmlDocCopyNode(node, node->doc, 1); - if (cloned_node != NULL) { - /* If we cloned a document then we must create new doc proxy */ - if (cloned_node->doc == node->doc) { - clone->document = intern->document; - } - php_libxml_increment_doc_ref((php_libxml_node_object *)clone, cloned_node->doc TSRMLS_CC); - php_libxml_increment_node_ptr((php_libxml_node_object *)clone, cloned_node, (void *)clone TSRMLS_CC); - } - - } - } - - *object_clone = (void *) clone; -} -/* }}} */ - -/* {{{ dom_objects_new */ -zend_object_value dom_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - dom_object *intern; - - intern = dom_objects_set_class(class_type, 1 TSRMLS_CC); - - retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)dom_objects_free_storage, dom_objects_clone TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = dom_get_obj_handlers(TSRMLS_C); - - return retval; -} -/* }}} */ - -#if defined(LIBXML_XPATH_ENABLED) -/* {{{ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC) */ -zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - dom_object *intern; - - intern = dom_objects_set_class(class_type, 1 TSRMLS_CC); - - retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, dom_objects_clone TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = dom_get_obj_handlers(TSRMLS_C); - - return retval; -} -/* }}} */ -#endif - -static void dom_nnodemap_object_dtor(void *object, zend_object_handle handle TSRMLS_DC) -{ - zval *baseobj; - dom_object *intern; - dom_nnodemap_object *objmap; - - intern = (dom_object *)object; - objmap = (dom_nnodemap_object *)intern->ptr; - - if (objmap) { - if (objmap->local) { - xmlFree(objmap->local); - } - if (objmap->ns) { - xmlFree(objmap->ns); - } - if (objmap->baseobjptr) { - baseobj = objmap->baseobjptr; - zval_ptr_dtor((zval **)&baseobj); - } - efree(objmap); - intern->ptr = NULL; - } - - -} - -void dom_nnodemap_objects_free_storage(void *object TSRMLS_DC) -{ - dom_object *intern = (dom_object *)object; - - php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - - zend_object_std_dtor(&intern->std TSRMLS_CC); - - efree(object); -} - -zend_object_value dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - dom_object *intern; - dom_nnodemap_object *objmap; - - intern = dom_objects_set_class(class_type, 1 TSRMLS_CC); - intern->ptr = emalloc(sizeof(dom_nnodemap_object)); - objmap = (dom_nnodemap_object *)intern->ptr; - objmap->baseobj = NULL; - objmap->baseobjptr = NULL; - objmap->nodetype = 0; - objmap->ht = NULL; - objmap->local = NULL; - objmap->ns = NULL; - - retval.handle = zend_objects_store_put(intern, dom_nnodemap_object_dtor, (zend_objects_free_object_storage_t)dom_nnodemap_objects_free_storage, dom_objects_clone TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = dom_get_obj_handlers(TSRMLS_C); - - return retval; -} - -void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC) -{ - zend_class_entry *ce; - - if (ce_type == DOM_NAMEDNODEMAP) { - ce = dom_namednodemap_class_entry; - } else { - ce = dom_nodelist_class_entry; - } - - object_init_ex(return_value, ce); -} - -/* {{{ php_dom_create_object */ -PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *wrapper_in, zval *return_value, dom_object *domobj TSRMLS_DC) -{ - zval *wrapper; - zend_class_entry *ce; - dom_object *intern; - - *found = 0; - - if (!obj) { - ALLOC_ZVAL(wrapper); - ZVAL_NULL(wrapper); - return wrapper; - } - - if ((intern = (dom_object *) php_dom_object_get_data((void *) obj))) { - return_value->type = IS_OBJECT; - return_value->is_ref = 1; - return_value->value.obj.handle = intern->handle; - return_value->value.obj.handlers = dom_get_obj_handlers(TSRMLS_C); - zval_copy_ctor(return_value); - *found = 1; - return return_value; - } - - wrapper = return_value; - - switch (obj->type) { - case XML_DOCUMENT_NODE: - case XML_HTML_DOCUMENT_NODE: - { - ce = dom_document_class_entry; - break; - } - case XML_DTD_NODE: - case XML_DOCUMENT_TYPE_NODE: - { - ce = dom_documenttype_class_entry; - break; - } - case XML_ELEMENT_NODE: - { - ce = dom_element_class_entry; - break; - } - case XML_ATTRIBUTE_NODE: - { - ce = dom_attr_class_entry; - break; - } - case XML_TEXT_NODE: - { - ce = dom_text_class_entry; - break; - } - case XML_COMMENT_NODE: - { - ce = dom_comment_class_entry; - break; - } - case XML_PI_NODE: - { - ce = dom_processinginstruction_class_entry; - break; - } - case XML_ENTITY_REF_NODE: - { - ce = dom_entityreference_class_entry; - break; - } - case XML_ENTITY_DECL: - case XML_ELEMENT_DECL: - { - ce = dom_entity_class_entry; - break; - } - case XML_CDATA_SECTION_NODE: - { - ce = dom_cdatasection_class_entry; - break; - } - case XML_DOCUMENT_FRAG_NODE: - { - ce = dom_documentfragment_class_entry; - break; - } - case XML_NOTATION_NODE: - { - ce = dom_notation_class_entry; - break; - } - case XML_NAMESPACE_DECL: - { - ce = dom_namespace_node_class_entry; - break; - } - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported node type: %d", Z_TYPE_P(obj)); - ZVAL_NULL(wrapper); - return wrapper; - } - - if (domobj && domobj->document) { - ce = dom_get_doc_classmap(domobj->document, ce TSRMLS_CC); - } - object_init_ex(wrapper, ce); - - intern = (dom_object *)zend_objects_get_address(wrapper TSRMLS_CC); - if (obj->doc != NULL) { - if (domobj != NULL) { - intern->document = domobj->document; - } - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, obj->doc TSRMLS_CC); - } - - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, obj, (void *)intern TSRMLS_CC); - return (wrapper); -} -/* }}} end php_domobject_new */ - - -void php_dom_create_implementation(zval **retval TSRMLS_DC) { - object_init_ex(*retval, dom_domimplementation_class_entry); -} - -/* {{{ int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child) */ -int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child) -{ - xmlNodePtr nodep; - - if (parent == NULL || child == NULL || child->doc != parent->doc) { - return SUCCESS; - } - - nodep = parent; - - while (nodep) { - if (nodep == child) { - return FAILURE; - } - nodep = nodep->parent; - } - - return SUCCESS; -} -/* }}} end dom_hierarchy */ - -/* {{{ dom_has_feature(char *feature, char *version) */ -int dom_has_feature(char *feature, char *version) -{ - int retval = 0; - - if (!(strcmp (version, "1.0") && strcmp (version,"2.0") && strcmp(version, ""))) { - if ((!strcasecmp(feature, "Core") && !strcmp (version, "1.0")) || !strcasecmp(feature, "XML")) - retval = 1; - } - - return retval; -} -/* }}} end dom_has_feature */ - -xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *local, int *cur, int index) -{ - xmlNodePtr ret = NULL; - - while (nodep != NULL && (*cur <= index || index == -1)) { - if (nodep->type == XML_ELEMENT_NODE) { - if (xmlStrEqual(nodep->name, local) || xmlStrEqual("*", local)) { - if (ns == NULL || (nodep->ns != NULL && (xmlStrEqual(nodep->ns->href, ns) || xmlStrEqual("*", ns)))) { - if (*cur == index) { - ret = nodep; - break; - } - (*cur)++; - } - } - ret = dom_get_elements_by_tag_name_ns_raw(nodep->children, ns, local, cur, index); - if (ret != NULL) { - break; - } - } - nodep = nodep->next; - } - return ret; -} -/* }}} end dom_element_get_elements_by_tag_name_ns_raw */ - - -/* {{{ void dom_normalize (xmlNodePtr nodep TSRMLS_DC) */ -void dom_normalize (xmlNodePtr nodep TSRMLS_DC) -{ - xmlNodePtr child, nextp, newnextp; - xmlAttrPtr attr; - xmlChar *strContent; - - child = nodep->children; - while(child != NULL) { - switch (child->type) { - case XML_TEXT_NODE: - nextp = child->next; - while (nextp != NULL) { - if (nextp->type == XML_TEXT_NODE) { - newnextp = nextp->next; - strContent = xmlNodeGetContent(nextp); - xmlNodeAddContent(child, strContent); - xmlFree(strContent); - xmlUnlinkNode(nextp); - php_libxml_node_free_resource(nextp TSRMLS_CC); - nextp = newnextp; - } else { - break; - } - } - break; - case XML_ELEMENT_NODE: - dom_normalize (child TSRMLS_CC); - attr = child->properties; - while (attr != NULL) { - dom_normalize((xmlNodePtr) attr TSRMLS_CC); - attr = attr->next; - } - break; - case XML_ATTRIBUTE_NODE: - dom_normalize (child TSRMLS_CC); - break; - default: - break; - } - child = child->next; - } -} -/* }}} end dom_normalize */ - - -/* {{{ void dom_set_old_ns(xmlDoc *doc, xmlNs *ns) */ -void dom_set_old_ns(xmlDoc *doc, xmlNs *ns) { - xmlNs *cur; - - if (doc == NULL) - return; - - if (doc->oldNs == NULL) { - doc->oldNs = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); - if (doc->oldNs == NULL) { - return; - } - memset(doc->oldNs, 0, sizeof(xmlNs)); - doc->oldNs->type = XML_LOCAL_NAMESPACE; - doc->oldNs->href = xmlStrdup(XML_XML_NAMESPACE); - doc->oldNs->prefix = xmlStrdup((const xmlChar *)"xml"); - } - - cur = doc->oldNs; - while (cur->next != NULL) { - cur = cur->next; - } - cur->next = ns; -} -/* }}} end dom_set_old_ns */ - -/* -http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS - -NAMESPACE_ERR: Raised if - -1. the qualifiedName is a malformed qualified name -2. the qualifiedName has a prefix and the namespaceURI is null -*/ - -/* {{{ int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) */ -int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) { - if (name_len == 0) { - return NAMESPACE_ERR; - } - - *localname = xmlSplitQName2(qname, (xmlChar **) prefix); - if (*localname == NULL) { - *localname = xmlStrdup(qname); - if (*prefix == NULL && uri_len == 0) { - return 0; - } - } - - /* 1 */ - if (xmlValidateQName((xmlChar *) qname, 0) != 0) { - return NAMESPACE_ERR; - } - - /* 2 */ - if (*prefix != NULL && uri_len == 0) { - return NAMESPACE_ERR; - } - - return 0; -} - - -/* -http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS - -NAMESPACE_ERR: Raised if - -3. the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace" [XML Namespaces] -4. the qualifiedName or its prefix is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/" -5. the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the qualifiedName nor its prefix is "xmlns". -*/ - -/* {{{ xmlNsPtr dom_get_ns(xmlNodePtr nodep, char *uri, int *errorcode, char *prefix) */ -xmlNsPtr dom_get_ns(xmlNodePtr nodep, char *uri, int *errorcode, char *prefix) { - xmlNsPtr nsptr = NULL; - - *errorcode = 0; - - if (! ((prefix && !strcmp (prefix, "xml" ) && strcmp(uri, XML_XML_NAMESPACE)) || - (prefix && !strcmp (prefix, "xmlns") && strcmp(uri, DOM_XMLNS_NAMESPACE)) || - (prefix && !strcmp(uri, DOM_XMLNS_NAMESPACE) && strcmp (prefix, "xmlns")))) { - nsptr = xmlNewNs(nodep, uri, prefix); - } - - if (nsptr == NULL) { - *errorcode = NAMESPACE_ERR; - } - - return nsptr; - -} -/* }}} end dom_get_ns */ - -/* {{{ xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) */ -xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) { - xmlNsPtr cur; - xmlNs *ret = NULL; - if (node == NULL) - return NULL; - - if (localName == NULL || xmlStrEqual(localName, "")) { - cur = node->nsDef; - while (cur != NULL) { - if (cur->prefix == NULL && cur->href != NULL) { - ret = cur; - break; - } - cur = cur->next; - } - } else { - cur = node->nsDef; - while (cur != NULL) { - if (cur->prefix != NULL && xmlStrEqual(localName, cur->prefix)) { - ret = cur; - break; - } - cur = cur->next; - } - } - return ret; -} -/* }}} end dom_get_nsdecl */ - -#endif /* HAVE_DOM */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h deleted file mode 100644 index 00c3dd3422a16..0000000000000 --- a/ext/dom/php_dom.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - | Marcus Borger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_DOM_H -#define PHP_DOM_H - -extern zend_module_entry dom_module_entry; -#define phpext_dom_ptr &dom_module_entry - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(LIBXML_HTML_ENABLED) -#include -#include -#endif -#if defined(LIBXML_XPATH_ENABLED) -#include -#include -#endif -#if defined(LIBXML_XPTR_ENABLED) -#include -#endif -#ifdef PHP_WIN32 -#ifndef DOM_EXPORTS -#define DOM_EXPORTS -#endif -#endif - -#include "xml_common.h" -#include "ext/libxml/php_libxml.h" -#include "zend_exceptions.h" -#include "dom_ce.h" -/* DOM API_VERSION, please bump it up, if you change anything in the API - therefore it's easier for the script-programmers to check, what's working how - Can be checked with phpversion("dom"); -*/ -#define DOM_API_VERSION "20031129" -/* Define a custom type for iterating using an unused nodetype */ -#define DOM_NODESET XML_XINCLUDE_START - -typedef struct _dom_nnodemap_object { - dom_object *baseobj; - int nodetype; - xmlHashTable *ht; - xmlChar *local; - xmlChar *ns; - zval *baseobjptr; -} dom_nnodemap_object; - -typedef struct { - zend_object_iterator intern; - zval *curobj; -} php_dom_iterator; - -#include "dom_fe.h" - -dom_object *dom_object_get_data(xmlNodePtr obj); -dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document); -zend_object_value dom_objects_new(zend_class_entry *class_type TSRMLS_DC); -zend_object_value dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC); -#if defined(LIBXML_XPATH_ENABLED) -zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC); -#endif -int dom_get_strict_error(php_libxml_ref_obj *document); -void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC); -void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC); -void node_list_unlink(xmlNodePtr node TSRMLS_DC); -int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len); -xmlNsPtr dom_get_ns(xmlNodePtr node, char *uri, int *errorcode, char *prefix); -void dom_set_old_ns(xmlDoc *doc, xmlNs *ns); -xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName); -void dom_normalize (xmlNodePtr nodep TSRMLS_DC); -xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *local, int *cur, int index); -void php_dom_create_implementation(zval **retval TSRMLS_DC); -int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child); -int dom_has_feature(char *feature, char *version); -int dom_node_is_read_only(xmlNodePtr node); -int dom_node_children_valid(xmlNodePtr node); -void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC); -void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC); -xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index); -xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index); -zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); -int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC); - -#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \ -INIT_CLASS_ENTRY(ce, name, funcs); \ -ce.create_object = dom_objects_new; \ -entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC); - -#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \ - __intern = (dom_object *)zend_object_store_get_object(__id TSRMLS_CC); \ - if (__intern->ptr == NULL || !(__ptr = (__prtype)((php_libxml_node_ptr *)__intern->ptr)->node)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\ - RETURN_NULL();\ - } \ -} - -#define DOM_NO_ARGS() \ - if (ZEND_NUM_ARGS() != 0) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expects exactly 0 parameters, %d given", ZEND_NUM_ARGS()); \ - return; \ - } - -#define DOM_NOT_IMPLEMENTED() \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not yet implemented"); \ - return; - -#define DOM_NODELIST 0 -#define DOM_NAMEDNODEMAP 1 - -PHP_MINIT_FUNCTION(dom); -PHP_MSHUTDOWN_FUNCTION(dom); -PHP_MINFO_FUNCTION(dom); - -#endif /* PHP_DOM_H */ diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c deleted file mode 100644 index e9caec6ccc5c5..0000000000000 --- a/ext/dom/processinginstruction.c +++ /dev/null @@ -1,181 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_processinginstruction_construct, 0, 0, 1) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMProcessingInstruction extends DOMNode -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1004215813 -* Since: -*/ - -zend_function_entry php_dom_processinginstruction_class_functions[] = { - PHP_ME(domprocessinginstruction, __construct, arginfo_dom_processinginstruction_construct, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMProcessingInstruction::__construct(string name, [string value]); */ -PHP_METHOD(domprocessinginstruction, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *name, *value = NULL; - int name_len, value_len, name_valid; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - - name_valid = xmlValidateName((xmlChar *) name, 0); - if (name_valid != 0) { - php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - nodep = xmlNewPI((xmlChar *) name, (xmlChar *) value); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMProcessingInstruction::__construct */ - -/* {{{ target string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1478689192 -Since: -*/ -int dom_processinginstruction_target_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - ZVAL_STRING(*retval, (char *) (nodep->name), 1); - - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ data string -readonly=no -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-837822393 -Since: -*/ -int dom_processinginstruction_data_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr nodep; - xmlChar *content; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - ALLOC_ZVAL(*retval); - - - if ((content = xmlNodeGetContent(nodep)) != NULL) { - ZVAL_STRING(*retval, content, 1); - xmlFree(content); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC) -{ - zval value_copy; - xmlNode *nodep; - - nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - if (newval->type != IS_STRING) { - if(newval->refcount > 1) { - value_copy = *newval; - zval_copy_ctor(&value_copy); - newval = &value_copy; - } - convert_to_string(newval); - } - - xmlNodeSetContentLen(nodep, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1); - - if (newval == &value_copy) { - zval_dtor(newval); - } - - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c deleted file mode 100644 index 4d6eb54578e40..0000000000000 --- a/ext/dom/string_extend.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_string_extend_find_offset16, 0, 0, 1) - ZEND_ARG_INFO(0, offset32) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_string_extend_find_offset32, 0, 0, 1) - ZEND_ARG_INFO(0, offset16) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class domstringextend -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend -* Since: -*/ - -zend_function_entry php_dom_string_extend_class_functions[] = { - PHP_FALIAS(findOffset16, dom_string_extend_find_offset16, arginfo_dom_string_extend_find_offset16) - PHP_FALIAS(findOffset32, dom_string_extend_find_offset32, arginfo_dom_string_extend_find_offset32) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto int dom_string_extend_find_offset16(int offset32); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset16 -Since: -*/ -PHP_FUNCTION(dom_string_extend_find_offset16) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_string_extend_find_offset16 */ - - -/* {{{ proto int dom_string_extend_find_offset32(int offset16); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset32 -Since: -*/ -PHP_FUNCTION(dom_string_extend_find_offset32) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_string_extend_find_offset32 */ -#endif diff --git a/ext/dom/tests/DOMCharacterData_appendData_basic.phpt b/ext/dom/tests/DOMCharacterData_appendData_basic.phpt deleted file mode 100644 index ee590de80c4c2..0000000000000 --- a/ext/dom/tests/DOMCharacterData_appendData_basic.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -DOMCharacterData::appendData basic functionality test ---CREDITS-- -Mike Sullivan -#TestFest 2008 (London) ---FILE-- -createElement('root'); -$document->appendChild($root); - -$cdata = $document->createElement('cdata'); -$root->appendChild($cdata); - -$cdatanode = $document->createCDATASection(''); -$cdata->appendChild($cdatanode); -$cdatanode->appendData('data'); -echo "CDATA Length (one append): " . $cdatanode->length . "\n"; - -$cdatanode->appendData('><&"'); -echo "CDATA Length (two appends): " . $cdatanode->length . "\n"; - -echo "CDATA Content: " . $cdatanode->data . "\n"; - -echo "\n" . $document->saveXML(); - -?> ---EXPECT-- -CDATA Length (one append): 4 -CDATA Length (two appends): 8 -CDATA Content: data><&" - - -<&"]]> \ No newline at end of file diff --git a/ext/dom/tests/DOMComment_appendData_basic.phpt b/ext/dom/tests/DOMComment_appendData_basic.phpt deleted file mode 100644 index c756f1665a8c4..0000000000000 --- a/ext/dom/tests/DOMComment_appendData_basic.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Test adding data to a DOMComment ---CREDITS-- -Andrew Larssen -London TestFest 2008 ---SKIPIF-- - ---FILE-- -createComment('test-comment'); -$comment->appendData('-more-data'); -$dom->appendChild($comment); -$dom->saveXML(); -echo $dom->saveXML(); - -?> ---EXPECTF-- - - \ No newline at end of file diff --git a/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt b/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt deleted file mode 100644 index b7d90a1194904..0000000000000 --- a/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -DOMComment::appendData basic functionality test ---CREDITS-- -Mike Sullivan -#TestFest 2008 (London) ---FILE-- -createElement('root'); -$document->appendChild($root); - -$comment = $document->createElement('comment'); -$root->appendChild($comment); - -$commentnode = $document->createComment(''); -$comment->appendChild($commentnode); -$commentnode->appendData('data'); -echo "Comment Length (one append): " . $commentnode->length . "\n"; - -$commentnode->appendData('><&"'); -echo "Comment Length (two appends): " . $commentnode->length . "\n"; - -echo "Comment Content: " . $commentnode->data . "\n"; - -echo "\n" . $document->saveXML(); - -?> ---EXPECT-- -Comment Length (one append): 4 -Comment Length (two appends): 8 -Comment Content: data><&" - - - \ No newline at end of file diff --git a/ext/dom/tests/DOMComment_insertData_basic.phpt b/ext/dom/tests/DOMComment_insertData_basic.phpt deleted file mode 100644 index 5a4857d6770b2..0000000000000 --- a/ext/dom/tests/DOMComment_insertData_basic.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Test inserting data into a DOMComment basic test ---CREDITS-- -Andrew Larssen -London TestFest 2008 ---SKIPIF-- - ---FILE-- -createComment('test-comment'); -$comment->insertData(4,'-inserted'); -$dom->appendChild($comment); -echo $dom->saveXML(); - -?> ---EXPECTF-- - - diff --git a/ext/dom/tests/DOMComment_insertData_error1.phpt b/ext/dom/tests/DOMComment_insertData_error1.phpt deleted file mode 100644 index 56922ac5185a5..0000000000000 --- a/ext/dom/tests/DOMComment_insertData_error1.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test inserting data into a DOMComment basic test ---CREDITS-- -Andrew Larssen -London TestFest 2008 ---SKIPIF-- - ---FILE-- -createComment('test-comment'); -try { - $comment->insertData(-1,'-inserted'); -} catch (DOMException $e ) { - if ($e->getMessage() == 'Index Size Error'){ - echo "Throws DOMException for -ve offset\n"; - } -} - -?> ---EXPECTF-- -Throws DOMException for -ve offset diff --git a/ext/dom/tests/DOMComment_insertData_error2.phpt b/ext/dom/tests/DOMComment_insertData_error2.phpt deleted file mode 100644 index d2affa89e7ca6..0000000000000 --- a/ext/dom/tests/DOMComment_insertData_error2.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test inserting data into a DOMComment basic test ---CREDITS-- -Andrew Larssen -London TestFest 2008 ---SKIPIF-- - ---FILE-- -createComment('test-comment'); -try { - $comment->insertData(999,'-inserted'); -} catch (DOMException $e ) { - if ($e->getMessage() == 'Index Size Error'){ - echo "Throws DOMException for offset too large\n"; - } -} - -?> ---EXPECTF-- -Throws DOMException for offset too large \ No newline at end of file diff --git a/ext/dom/tests/DOMComment_replaceData_basic.phpt b/ext/dom/tests/DOMComment_replaceData_basic.phpt deleted file mode 100644 index 10bf677ff349f..0000000000000 --- a/ext/dom/tests/DOMComment_replaceData_basic.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test replacing data into a DOMComment basic test ---CREDITS-- -Andrew Larssen -London TestFest 2008 ---SKIPIF-- - ---FILE-- -createComment('test-comment'); -$comment->replaceData(4,1,'replaced'); -$dom->appendChild($comment); -echo $dom->saveXML(); - -// Replaces rest of string if count is greater than length of existing string -$dom = new DomDocument(); -$comment = $dom->createComment('test-comment'); -$comment->replaceData(0,50,'replaced'); -$dom->appendChild($comment); -echo $dom->saveXML(); - -?> ---EXPECTF-- - - - - diff --git a/ext/dom/tests/DOMComment_replaceData_error1.phpt b/ext/dom/tests/DOMComment_replaceData_error1.phpt deleted file mode 100644 index 4ae4cb61da8fa..0000000000000 --- a/ext/dom/tests/DOMComment_replaceData_error1.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test replacing data into a DOMComment basic test ---CREDITS-- -Andrew Larssen -London TestFest 2008 ---SKIPIF-- - ---FILE-- -createComment('test-comment'); -try { - $comment->replaceData(-1,4,'-inserted'); -} catch (DOMException $e ) { - if ($e->getMessage() == 'Index Size Error'){ - echo "Throws DOMException for -ve offest\n"; - } -} - -?> ---EXPECTF-- -Throws DOMException for -ve offest diff --git a/ext/dom/tests/DOMComment_replaceData_error2.phpt b/ext/dom/tests/DOMComment_replaceData_error2.phpt deleted file mode 100644 index 89614f9756a43..0000000000000 --- a/ext/dom/tests/DOMComment_replaceData_error2.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test replacing data into a DOMComment basic test ---CREDITS-- -Andrew Larssen -London TestFest 2008 ---SKIPIF-- - ---FILE-- -createComment('test-comment'); -try { - $comment->replaceData(999,4,'-inserted'); -} catch (DOMException $e ) { - if ($e->getMessage() == 'Index Size Error'){ - echo "Throws DOMException for offest too large\n"; - } -} - -?> ---EXPECTF-- -Throws DOMException for offest too large \ No newline at end of file diff --git a/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt b/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt deleted file mode 100644 index d6fb632132628..0000000000000 --- a/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Testing DOMDocumentFragment::appendXML and DOMDocumentFragment::hasChildNodes ---FILE-- -createDocumentFragment(); -if ($fragment->hasChildNodes()) { - echo "has child nodes\n"; -} else { - echo "has no child nodes\n"; -} -$fragment->appendXML('bar'); -if ($fragment->hasChildNodes()) { - echo "has child nodes\n"; -} else { - echo "has no child nodes\n"; -} ---EXPECT-- -has no child nodes -has child nodes diff --git a/ext/dom/tests/DOMDocument_createAttribute_basic.phpt b/ext/dom/tests/DOMDocument_createAttribute_basic.phpt deleted file mode 100644 index 5205a3e30fd75..0000000000000 --- a/ext/dom/tests/DOMDocument_createAttribute_basic.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -DomDocument::createAttribute() - basic test for DomDocument::createAttribute() ---CREDITS-- -Muhammad Khalid Adnan -# TestFest 2008 ---FILE-- -createElement("para"); -$newnode = $doc->appendChild($node); - -// A pass case. -$test_attribute = $doc->createAttribute("hahaha"); -$node->appendChild($test_attribute); - -echo $doc->saveXML(); - -?> ---EXPECT-- - - - diff --git a/ext/dom/tests/DOMDocument_createAttribute_error.phpt b/ext/dom/tests/DOMDocument_createAttribute_error.phpt deleted file mode 100644 index 3b318d40d285d..0000000000000 --- a/ext/dom/tests/DOMDocument_createAttribute_error.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Test DOMDocument::createAttribute() for expected expection thrown when wrong parameter passed ---FILE-- -createAttribute(0); -} -catch(DOMException $e) { - $code = $e->getCode(); - if(DOM_INVALID_CHARACTER_ERR === $code) { - echo "PASS"; - } - else { - echo 'Wrong exception code'; - } -} -catch(Exception $e) { - echo 'Wrong exception thrown'; -} - -?> ---EXPECTF-- -PASS diff --git a/ext/dom/tests/DOMDocument_createAttribute_error1.phpt b/ext/dom/tests/DOMDocument_createAttribute_error1.phpt deleted file mode 100644 index 153b18b5a24cb..0000000000000 --- a/ext/dom/tests/DOMDocument_createAttribute_error1.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -DomDocument::createAttribute() - error test for DomDocument::createAttribute() ---CREDITS-- -Muhammad Khalid Adnan -# TestFest 2008 ---FILE-- -createElement("para"); -$newnode = $doc->appendChild($node); - -try { - $failed_test_attribute = $doc->createAttribute("ha haha"); - $node->appendChild($failed_test_attribute); - - echo $doc->saveXML(); -} -catch (DOMException $e) { - echo 'Test failed!', PHP_EOL; -} - -?> ---EXPECT-- -Test failed! - diff --git a/ext/dom/tests/DOMDocument_createAttribute_variation.phpt b/ext/dom/tests/DOMDocument_createAttribute_variation.phpt deleted file mode 100644 index f00493455ca80..0000000000000 --- a/ext/dom/tests/DOMDocument_createAttribute_variation.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Test DOMDocument::createAttribute() for expected return value ---FILE-- -createAttribute('string'); -echo get_class($attr); - -?> ---EXPECTF-- -DOMAttr diff --git a/ext/dom/tests/DOMDocument_createProcessingInstruction_basic.phpt b/ext/dom/tests/DOMDocument_createProcessingInstruction_basic.phpt deleted file mode 100644 index ea0910417cea5..0000000000000 --- a/ext/dom/tests/DOMDocument_createProcessingInstruction_basic.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -DomDocument::createProcessingInstruction() - basic test for DomDocument::createProcessingInstruction() ---CREDITS-- -Muhammad Khalid Adnan -# TestFest 2008 ---FILE-- -createElement("para"); -$newnode = $doc->appendChild($node); - -$test_proc_inst0 = - $doc->createProcessingInstruction( "blablabla" ); -$node->appendChild($test_proc_inst0); - -$test_proc_inst1 = - $doc->createProcessingInstruction( "blablabla", "datadata" ); -$node->appendChild($test_proc_inst1); - -echo $doc->saveXML(); - -?> ---EXPECT-- - - - diff --git a/ext/dom/tests/DOMDocument_createProcessingInstruction_error.phpt b/ext/dom/tests/DOMDocument_createProcessingInstruction_error.phpt deleted file mode 100644 index d050b17714606..0000000000000 --- a/ext/dom/tests/DOMDocument_createProcessingInstruction_error.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -DomDocument::createProcessingInstruction() - error test for DomDocument::createProcessingInstruction() ---CREDITS-- -Muhammad Khalid Adnan -# TestFest 2008 ---FILE-- -createElement("para"); -$newnode = $doc->appendChild($node); - -try { - $test_proc_inst = - $doc->createProcessingInstruction( "bla bla bla" ); - $node->appendChild($test_proc_inst); - - echo $doc->saveXML(); -} -catch (DOMException $e) -{ - echo 'Test failed!', PHP_EOL; -} - -?> ---EXPECT-- -Test failed! - diff --git a/ext/dom/tests/DOMDocument_loadHTML_basic.phpt b/ext/dom/tests/DOMDocument_loadHTML_basic.phpt deleted file mode 100644 index 616d1d837150b..0000000000000 --- a/ext/dom/tests/DOMDocument_loadHTML_basic.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -DOMDocument::loadHTML ---CREDITS-- -Frank Cassedanne franck@ouarz.net -#London TestFest 2008 ---SKIPIF-- - ---FILE-- -loadHTML("

Test

"); -echo $doc->saveHTML(); -?> ---EXPECTF-- - -

Test

diff --git a/ext/dom/tests/DOMDocument_save_basic.phpt b/ext/dom/tests/DOMDocument_save_basic.phpt deleted file mode 100644 index c7d1ead24b46a..0000000000000 --- a/ext/dom/tests/DOMDocument_save_basic.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -DOMDocument::save Test basic function of save method ---SKIPIF-- - ---FILE-- -formatOutput = true; - -$root = $doc->createElement('book'); - -$root = $doc->appendChild($root); - -$title = $doc->createElement('title'); -$title = $root->appendChild($title); - -$text = $doc->createTextNode('This is the title'); -$text = $title->appendChild($text); - -$temp_filename = dirname(__FILE__)."/DomDocument_save_basic.tmp"; - -echo 'Wrote: ' . $doc->save($temp_filename) . ' bytes'; // Wrote: 72 bytes -?> ---CLEAN-- - ---EXPECTF-- -Wrote: 72 bytes - diff --git a/ext/dom/tests/DOMElement_hasAttributes_basic.phpt b/ext/dom/tests/DOMElement_hasAttributes_basic.phpt deleted file mode 100644 index f0d0c355b8242..0000000000000 --- a/ext/dom/tests/DOMElement_hasAttributes_basic.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -DOMNode: hasAttributes() ---CREDITS-- -James Lewis -#TestFest 2008 ---FILE-- -loadXML($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$element = $dom->documentElement; - -echo "Verify that we have a DOMElement object:\n"; -var_dump($element); - -echo "\nElement should have attributes:\n"; -var_dump($element->hasAttributes()); - -$nodelist=$dom->getElementsByTagName('tbody') ; -$element = $nodelist->item(0); - -echo "\nVerify that we have a DOMElement object:\n"; -var_dump($element); - -echo "\nElement should have no attributes:\n"; -var_dump($element->hasAttributes()) - - -?> ---EXPECTF-- -Verify that we have a DOMElement object: -object(DOMElement)#%d (0) { -} - -Element should have attributes: -bool(true) - -Verify that we have a DOMElement object: -object(DOMElement)#%d (0) { -} - -Element should have no attributes: -bool(false) diff --git a/ext/dom/tests/DOMNode_cloneNode_basic.phpt b/ext/dom/tests/DOMNode_cloneNode_basic.phpt deleted file mode 100644 index 16b8533f71913..0000000000000 --- a/ext/dom/tests/DOMNode_cloneNode_basic.phpt +++ /dev/null @@ -1,111 +0,0 @@ ---TEST-- -DOM cloneNode : Basic Functionality ---SKIPIF-- - ---CREDITS-- -Simon Hughes ---FILE-- - - - - - c1n1 - c1n2 - - - - - c2n1 - c2n2 - - - -EOXML; - -function dumpcourse($current) { - $title = ($current->nodeType != XML_TEXT_NODE && $current->hasAttribute('title')) ? $current->getAttribute('title'):"no title"; - echo "Course: $title:";var_dump($current); - echo "~";var_dump($current->textContent); -} - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$root = $dom->documentElement; - -// strip all text nodes from this tree -$children = $root->childNodes; -$len = $children->length; -for ($index = $children->length - 1; $index >=0; $index--) { - $current = $children->item($index); - if ($current->nodeType == XML_TEXT_NODE) { - $noderemoved = $root->removeChild($current); - } -} - -echo "Start cloneNode test\n"; -$first_course = $children->item(0); -$cloned_first_course_default = $first_course->cloneNode(); -$first_course->setAttribute('title', 'new title1'); - -$cloned_first_course_true = $first_course->cloneNode(true); -$first_course->setAttribute('title', 'new title2'); - -$cloned_first_course_false = $first_course->cloneNode(false); -$first_course->setAttribute('title', 'new title3'); - -$cloned_first_course_default->setAttribute('title', 'new title default'); -$cloned_first_course_true->setAttribute('title', 'new title true'); -$cloned_first_course_false->setAttribute('title', 'new title false'); - -$root->appendChild($cloned_first_course_default); -$root->appendChild($cloned_first_course_true); -$root->appendChild($cloned_first_course_false); - -$children = $root->childNodes; -for ($index = 0; $index < $children->length; $index++) { - echo "node $index\n"; - dumpcourse($children->item($index)); -} - ---EXPECTF-- -Start cloneNode test -node 0 -Course: new title3:object(DOMElement)#6 (0) { -} -~string(24) " - - c1n1 - c1n2 - - " -node 1 -Course: two:object(DOMElement)#3 (0) { -} -~string(24) " - - c2n1 - c2n2 - - " -node 2 -Course: new title default:object(DOMElement)#4 (0) { -} -~string(0) "" -node 3 -Course: new title true:object(DOMElement)#7 (0) { -} -~string(24) " - - c1n1 - c1n2 - - " -node 4 -Course: new title false:object(DOMElement)#8 (0) { -} -~string(0) "" \ No newline at end of file diff --git a/ext/dom/tests/DOMNode_hasChildNodes_basic.phpt b/ext/dom/tests/DOMNode_hasChildNodes_basic.phpt deleted file mode 100644 index 3a6f6b4218886..0000000000000 --- a/ext/dom/tests/DOMNode_hasChildNodes_basic.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test whether a node has child nodes: hasChildNodes() ---SKIPIF-- - ---FILE-- - - * This is the title - * - * Check for child nodes of the , and This is the title - * -*/ - -$doc = new DOMDocument(); - -$root = $doc->createElement('book'); -$doc->appendChild($root); - -$title = $doc->createElement('title'); -$root->appendChild($title); - -$text = $doc->createTextNode('This is the title'); -$title->appendChild($text); - -echo "Root has child nodes: "; -var_dump($root->hasChildNodes()); - -echo "Title has child nodes: "; -var_dump($title->hasChildNodes()); - -echo "Text has child nodes: "; -var_dump($text->hasChildNodes()); - -?> ---EXPECTF-- -Root has child nodes: bool(true) -Title has child nodes: bool(true) -Text has child nodes: bool(false) \ No newline at end of file diff --git a/ext/dom/tests/DOMNode_issamenode_basic.phpt b/ext/dom/tests/DOMNode_issamenode_basic.phpt deleted file mode 100644 index beccb8fb624d2..0000000000000 --- a/ext/dom/tests/DOMNode_issamenode_basic.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -DOMNode: isSameNode() ---CREDITS-- -James Lewis <james@s-1.com> -#TestFest 2008 ---FILE-- -<?php -require_once("dom_test.inc"); - -$dom = new DOMDocument; -$dom->loadXML($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$node = $dom->documentElement; -if($node->isSameNode($node)) - echo "EXPECTING SAME NODE, PASSED\n" ; -else - echo "EXPECTING SAME NODE, FAILED\n" ; - -$nodelist=$dom->getElementsByTagName('tbody') ; - -if($nodelist->item(0)->isSameNode($node)) - echo "EXPECTING NOT SAME NODE, FAILED\n" ; -else - echo "EXPECTING NOT SAME NODE, PASSED\n" ; - -?> -===DONE=== ---EXPECT-- -EXPECTING SAME NODE, PASSED -EXPECTING NOT SAME NODE, PASSED -===DONE=== diff --git a/ext/dom/tests/DOMNode_normalize_basic.phpt b/ext/dom/tests/DOMNode_normalize_basic.phpt deleted file mode 100644 index 79f5294d63076..0000000000000 --- a/ext/dom/tests/DOMNode_normalize_basic.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -normalize() ---SKIPIF-- -<?php -include('skipif.inc'); -?> ---FILE-- -<?php - -/* Create an XML document - * with structure - * <book> - * <author></author> - * <title>This is the title - * - * Calculate the number of title text nodes (1). - * Add another text node to title. Calculate the number of title text nodes (2). - * Normalize author. Calculate the number of title text nodes (2). - * Normalize title. Calculate the number of title text nodes (1). -*/ - -$doc = new DOMDocument(); - -$root = $doc->createElement('book'); -$doc->appendChild($root); - -$title = $doc->createElement('title'); -$root->appendChild($title); - -$author = $doc->createElement('author'); -$root->appendChild($author); - -$text = $doc->createTextNode('This is the first title'); -$title->appendChild($text); - -echo "Number of child nodes of title = "; -var_dump($title->childNodes->length); - -// add a second text node to title -$text = $doc->createTextNode('This is the second title'); -$title->appendChild($text); - -echo "Number of child nodes of title after adding second title = "; -var_dump($title->childNodes->length); - -// should do nothing -$author->normalize(); - -echo "Number of child nodes of title after normalizing author = "; -var_dump($title->childNodes->length); - - -// should concatenate first and second title text nodes -$title->normalize(); - -echo "Number of child nodes of title after normalizing title = "; -var_dump($title->childNodes->length); - -?> ---EXPECTF-- -Number of child nodes of title = int(1) -Number of child nodes of title after adding second title = int(2) -Number of child nodes of title after normalizing author = int(2) -Number of child nodes of title after normalizing title = int(1) \ No newline at end of file diff --git a/ext/dom/tests/DOMNode_removeChild_basic.phpt b/ext/dom/tests/DOMNode_removeChild_basic.phpt deleted file mode 100644 index 8609e58be59c6..0000000000000 --- a/ext/dom/tests/DOMNode_removeChild_basic.phpt +++ /dev/null @@ -1,113 +0,0 @@ ---TEST-- -DOM removeChild : Basic Functionality ---SKIPIF-- - ---CREDITS-- -Simon Hughes ---FILE-- - - - - - c1n1 - c1n2 - - - - - c2n1 - c2n2 - - - -EOXML; - -function dumpcourse($current) { - $title = ($current->nodeType != XML_TEXT_NODE && $current->hasAttribute('title')) ? $current->getAttribute('title'):"no title"; - echo "Course: $title:";var_dump($current); - echo "~";var_dump($current->textContent); -} - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$root = $dom->documentElement; - -$children = $root->childNodes; -$len = $children->length; -echo "orignal has $len nodes\n"; -for ($index = $children->length - 1; $index >=0; $index--) { - echo "node $index\n"; - $current = $children->item($index); - dumpcourse($current); - if ($current->nodeType == XML_TEXT_NODE) { - $noderemoved = $root->removeChild($current); - } -} -$children = $root->childNodes; -$len = $children->length; -echo "after text removed it now has $len nodes\n"; -for ($index = 0; $index < $children->length; $index++) { - echo "node $index\n"; - $current = $children->item($index); - dumpcourse($current); -} - ---EXPECTF-- -orignal has 5 nodes -node 4 -Course: no title:object(DOMText)#4 (0) { -} -~string(1) " -" -node 3 -Course: two:object(DOMElement)#5 (0) { -} -~string(24) " - - c2n1 - c2n2 - - " -node 2 -Course: no title:object(DOMText)#6 (0) { -} -~string(2) " - " -node 1 -Course: one:object(DOMElement)#4 (0) { -} -~string(24) " - - c1n1 - c1n2 - - " -node 0 -Course: no title:object(DOMText)#5 (0) { -} -~string(2) " - " -after text removed it now has 2 nodes -node 0 -Course: one:object(DOMElement)#3 (0) { -} -~string(24) " - - c1n1 - c1n2 - - " -node 1 -Course: two:object(DOMElement)#4 (0) { -} -~string(24) " - - c2n1 - c2n2 - - " \ No newline at end of file diff --git a/ext/dom/tests/DOMNode_replaceChild_basic.phpt b/ext/dom/tests/DOMNode_replaceChild_basic.phpt deleted file mode 100644 index 49fc05501f06b..0000000000000 --- a/ext/dom/tests/DOMNode_replaceChild_basic.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Replacing a child node ---SKIPIF-- - ---CREDITS-- -Matt Raines -#London TestFest 2008 ---FILE-- -loadXML(' -'); - -// Replaces the child node oldChild with newChild in the list of children, and -// returns the oldChild node. -$parent = $document->getElementsByTagName('foo')->item(0); -$new_child = $document->createElement('qux'); -$old_child = $parent->replaceChild($new_child, $parent->firstChild); -echo "New child replaces old child:\n" . $document->saveXML(); -echo "Old child is returned:\n" . $old_child->tagName . "\n"; - -// If the newChild is already in the tree, it is first removed. -$parent = $document->getElementsByTagName('spam')->item(0); -$parent->replaceChild($new_child, $parent->firstChild); -echo "Existing child is removed from tree:\n" . $document->saveXML(); - -// Children are inserted in the correct order. -$new_child = $document->getElementsByTagName('spam')->item(0); -$parent = $document->getElementsByTagName('foo')->item(0); -$parent->replaceChild($new_child, $parent->firstChild); -echo "Children are inserted in order:\n" . $document->saveXML(); -?> ---EXPECT-- -New child replaces old child: - - -Old child is returned: -bar -Existing child is removed from tree: - - -Children are inserted in order: - - diff --git a/ext/dom/tests/DOMText_appendData_basic.phpt b/ext/dom/tests/DOMText_appendData_basic.phpt deleted file mode 100644 index 6a28a9ae4558e..0000000000000 --- a/ext/dom/tests/DOMText_appendData_basic.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -DOMText::appendData basic functionality test ---CREDITS-- -Mike Sullivan -#TestFest 2008 (London) ---FILE-- -createElement('root'); -$document->appendChild($root); - -$text = $document->createElement('text'); -$root->appendChild($text); - -$textnode = $document->createTextNode(''); -$text->appendChild($textnode); -$textnode->appendData('data'); -echo "Text Length (one append): " . $textnode->length . "\n"; - -$textnode->appendData('><&"'); -echo "Text Length (two appends): " . $textnode->length . "\n"; - -echo "Text Content: " . $textnode->data . "\n"; - -echo "\n" . $document->saveXML(); - -?> ---EXPECT-- -Text Length (one append): 4 -Text Length (two appends): 8 -Text Content: data><&" - - -data><&" \ No newline at end of file diff --git a/ext/dom/tests/book.xml b/ext/dom/tests/book.xml deleted file mode 100644 index 95de0da86649e..0000000000000 --- a/ext/dom/tests/book.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/book.xml.gz b/ext/dom/tests/book.xml.gz deleted file mode 100644 index 2c97807a59fbe..0000000000000 Binary files a/ext/dom/tests/book.xml.gz and /dev/null differ diff --git a/ext/dom/tests/bug28721.phpt b/ext/dom/tests/bug28721.phpt deleted file mode 100644 index 464498ef808a0..0000000000000 --- a/ext/dom/tests/bug28721.phpt +++ /dev/null @@ -1,485 +0,0 @@ ---TEST-- -Bug #28721 (appendChild() and insertBefore() unset DOMText) ---SKIPIF-- - ---FILE-- -nodeName . " (" . $node->nodeValue . ")\n"; -} - -function print_node_r(DomNode $node) { - static $indent = ""; - echo "\n" . $indent; - print_node($node); - - echo $indent . "parent: "; - if ( $node->parentNode ) - print_node($node->parentNode); - else - echo "NULL\n"; - - echo $indent . "previousSibling: "; - if ( $node->previousSibling ) - print_node($node->previousSibling); - else - echo "NULL\n"; - - echo $indent . "nextSibling: "; - if ( $node->nextSibling ) - print_node($node->nextSibling); - else - echo "NULL\n"; - - if ( !$node->hasChildNodes() ) - return; - - foreach ($node->childNodes as $child) { - - $old_indent = $indent; - $indent .= " "; - print_node_r($child); - $indent = $old_indent; - } -} - -function err_handler($errno, $errstr, $errfile, $errline) { - echo "Error ($errno) on line $errline: $errstr\n"; -} - -// Record 'DocumentFragment is empty' warnings -set_error_handler("err_handler", E_WARNING); - -$xml = new DomDocument(); - -$p = $xml->createElement("p"); - -$p->appendChild($t1 = $xml->createTextNode(" t1 ")); -$p->appendChild($b = $xml->createElement("b")); -$b->appendChild($xml->createTextNode("X")); -$p->appendChild($t2 = $xml->createTextNode(" t2 ")); -$p->appendChild($xml->createTextNode(" xxx ")); - -print_node_r($p); - -echo "\nAppend t1 to p:\n"; -$ret = $p->appendChild($t1); - -print_node_r($p); -echo "\n"; - -echo "t1 == ret: "; -var_dump( $t1 === $ret ); - - -$d = $xml->createElement("div"); -$d->appendChild($t3 = $xml->createTextNode(" t3 ")); -$d->appendChild($b = $xml->createElement("b")); -$b->appendChild($xml->createElement("X")); -$d->appendChild($t4 = $xml->createTextNode(" t4 ")); -$d->appendChild($xml->createTextNode(" xxx ")); - -echo "\ndiv:\n"; -print_node_r($d); - -echo "\nInsert t4 before t3:\n"; - -$ret = $d->insertBefore($t4, $t3); - -print_node_r($d); -echo "\n"; - -$frag = $xml->createDocumentFragment(); - -$t5 = $frag->appendChild($xml->createTextNode(" t5 ")); -$frag->appendChild($i = $xml->createElement("i")); -$i->appendChild($xml->createTextNode(" frob ")); -$frag->appendChild($xml->createTextNOde(" t6 ")); - -echo "\np:\n"; -print_node_r($p); -echo "\nFragment:\n"; -print_node_r($frag); - -echo "\nAppending fragment to p:\n"; -$p->appendChild($frag); - -print_node_r($p); -echo "\nFragment:\n"; -print_node_r($frag); - -echo "\ndiv:\n"; -print_node_r($d); -echo "\nInserting fragment before t4\n"; -$d->insertBefore($frag, $t4); -print_node_r($d); - -echo "\np:\n"; -print_node_r($p); - -?> ---EXPECT-- - -name (value): p ( t1 X t2 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t1 ) - parent: name (value): p ( t1 X t2 xxx ) - previousSibling: NULL - nextSibling: name (value): b (X) - - name (value): b (X) - parent: name (value): p ( t1 X t2 xxx ) - previousSibling: name (value): #text ( t1 ) - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p ( t1 X t2 xxx ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p ( t1 X t2 xxx ) - previousSibling: name (value): #text ( t2 ) - nextSibling: NULL - -Append t1 to p: - -name (value): p (X t2 xxx t1 ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): b (X) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: NULL - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): #text ( t2 ) - nextSibling: name (value): #text ( t1 ) - - name (value): #text ( t1 ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): #text ( xxx ) - nextSibling: NULL - -t1 == ret: bool(true) - -div: - -name (value): div ( t3 t4 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t3 ) - parent: name (value): div ( t3 t4 xxx ) - previousSibling: NULL - nextSibling: name (value): b () - - name (value): b () - parent: name (value): div ( t3 t4 xxx ) - previousSibling: name (value): #text ( t3 ) - nextSibling: name (value): #text ( t4 ) - - name (value): X () - parent: name (value): b () - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t4 ) - parent: name (value): div ( t3 t4 xxx ) - previousSibling: name (value): b () - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): div ( t3 t4 xxx ) - previousSibling: name (value): #text ( t4 ) - nextSibling: NULL - -Insert t4 before t3: - -name (value): div ( t4 t3 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t4 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: NULL - nextSibling: name (value): #text ( t3 ) - - name (value): #text ( t3 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t4 ) - nextSibling: name (value): b () - - name (value): b () - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t3 ) - nextSibling: name (value): #text ( xxx ) - - name (value): X () - parent: name (value): b () - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( xxx ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): b () - nextSibling: NULL - - -p: - -name (value): p (X t2 xxx t1 ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): b (X) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: NULL - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): #text ( t2 ) - nextSibling: name (value): #text ( t1 ) - - name (value): #text ( t1 ) - parent: name (value): p (X t2 xxx t1 ) - previousSibling: name (value): #text ( xxx ) - nextSibling: NULL - -Fragment: - -name (value): #document-fragment () -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t5 ) - parent: name (value): #document-fragment () - previousSibling: NULL - nextSibling: name (value): i ( frob ) - - name (value): i ( frob ) - parent: name (value): #document-fragment () - previousSibling: name (value): #text ( t5 ) - nextSibling: name (value): #text ( t6 ) - - name (value): #text ( frob ) - parent: name (value): i ( frob ) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t6 ) - parent: name (value): #document-fragment () - previousSibling: name (value): i ( frob ) - nextSibling: NULL - -Appending fragment to p: - -name (value): p (X t2 xxx t1 t5 frob t6 ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): b (X) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: NULL - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t2 ) - nextSibling: name (value): #text ( t1 ) - - name (value): #text ( t1 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( xxx ) - nextSibling: name (value): #text ( t5 ) - - name (value): #text ( t5 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t1 ) - nextSibling: name (value): i ( frob ) - - name (value): i ( frob ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t5 ) - nextSibling: name (value): #text ( t6 ) - - name (value): #text ( frob ) - parent: name (value): i ( frob ) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t6 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): i ( frob ) - nextSibling: NULL - -Fragment: - -name (value): #document-fragment () -parent: NULL -previousSibling: NULL -nextSibling: NULL - -div: - -name (value): div ( t4 t3 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t4 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: NULL - nextSibling: name (value): #text ( t3 ) - - name (value): #text ( t3 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t4 ) - nextSibling: name (value): b () - - name (value): b () - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t3 ) - nextSibling: name (value): #text ( xxx ) - - name (value): X () - parent: name (value): b () - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( xxx ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): b () - nextSibling: NULL - -Inserting fragment before t4 -Error (2) on line 109: DOMNode::insertBefore(): Document Fragment is empty - -name (value): div ( t4 t3 xxx ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): #text ( t4 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: NULL - nextSibling: name (value): #text ( t3 ) - - name (value): #text ( t3 ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t4 ) - nextSibling: name (value): b () - - name (value): b () - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): #text ( t3 ) - nextSibling: name (value): #text ( xxx ) - - name (value): X () - parent: name (value): b () - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( xxx ) - parent: name (value): div ( t4 t3 xxx ) - previousSibling: name (value): b () - nextSibling: NULL - -p: - -name (value): p (X t2 xxx t1 t5 frob t6 ) -parent: NULL -previousSibling: NULL -nextSibling: NULL - - name (value): b (X) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: NULL - nextSibling: name (value): #text ( t2 ) - - name (value): #text (X) - parent: name (value): b (X) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t2 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): b (X) - nextSibling: name (value): #text ( xxx ) - - name (value): #text ( xxx ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t2 ) - nextSibling: name (value): #text ( t1 ) - - name (value): #text ( t1 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( xxx ) - nextSibling: name (value): #text ( t5 ) - - name (value): #text ( t5 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t1 ) - nextSibling: name (value): i ( frob ) - - name (value): i ( frob ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): #text ( t5 ) - nextSibling: name (value): #text ( t6 ) - - name (value): #text ( frob ) - parent: name (value): i ( frob ) - previousSibling: NULL - nextSibling: NULL - - name (value): #text ( t6 ) - parent: name (value): p (X t2 xxx t1 t5 frob t6 ) - previousSibling: name (value): i ( frob ) - nextSibling: NULL diff --git a/ext/dom/tests/bug28817.phpt b/ext/dom/tests/bug28817.phpt deleted file mode 100644 index a250bff03eb41..0000000000000 --- a/ext/dom/tests/bug28817.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Bug #28817 (properties in extended class) ---SKIPIF-- - ---FILE-- -p_array[] = 'bonus'; - $this->p_array[] = 'vir'; - $this->p_array[] = 'semper'; - $this->p_array[] = 'tiro'; - - $this->p_variable = 'Cessante causa cessat effectus'; - } -} - -$z=new z(); -var_dump($z->p_array); -var_dump($z->p_variable); -?> ---EXPECTF-- -array(4) { - [0]=> - string(5) "bonus" - [1]=> - string(3) "vir" - [2]=> - string(6) "semper" - [3]=> - string(4) "tiro" -} -string(30) "Cessante causa cessat effectus" diff --git a/ext/dom/tests/bug32615.phpt b/ext/dom/tests/bug32615.phpt deleted file mode 100644 index c6f2b5bf86448..0000000000000 --- a/ext/dom/tests/bug32615.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Bug #32615 (Replacing and inserting Fragments) ---SKIPIF-- - ---FILE-- -createDocumentFragment(); -$frag->appendChild(new DOMElement('root')); -$dom->appendChild($frag); -$root = $dom->documentElement; - -$frag->appendChild(new DOMElement('first')); -$root->appendChild($frag); - -$frag->appendChild(new DOMElement('second')); -$root->appendChild($frag); - -$node = $dom->createElement('newfirst'); -$frag->appendChild($node); -$root->replaceChild($frag, $root->firstChild); - -unset($frag); -$frag = $dom->createDocumentFragment(); - -$frag->appendChild(new DOMElement('newsecond')); -$root->replaceChild($frag, $root->lastChild); - -$node = $frag->appendChild(new DOMElement('fourth')); -$root->insertBefore($frag, NULL); - -$frag->appendChild(new DOMElement('third')); -$node = $root->insertBefore($frag, $node); - -$frag->appendChild(new DOMElement('start')); -$root->insertBefore($frag, $root->firstChild); - -$frag->appendChild(new DOMElement('newthird')); -$root->replaceChild($frag, $node); - -$frag->appendChild(new DOMElement('newfourth')); -$root->replaceChild($frag, $root->lastChild); - -$frag->appendChild(new DOMElement('first')); -$root->replaceChild($frag, $root->firstChild->nextSibling); - -$root->removeChild($root->firstChild); - -echo $dom->saveXML()."\n"; - -while ($root->hasChildNodes()) { - $root->removeChild($root->firstChild); -} - -$frag->appendChild(new DOMElement('first')); -$root->insertBefore($frag, $root->firstChild); - -$node = $frag->appendChild(new DOMElement('fourth')); -$root->appendChild($frag); - -$frag->appendChild(new DOMElement('second')); -$frag->appendChild(new DOMElement('third')); -$root->insertBefore($frag, $node); - -echo $dom->saveXML()."\n"; - -$frag = $dom->createDocumentFragment(); -$root = $dom->documentElement; -$root->replaceChild($frag, $root->firstChild); - -echo $dom->saveXML(); - -?> ---EXPECT-- - - - - - - - - - - diff --git a/ext/dom/tests/bug34276.phpt b/ext/dom/tests/bug34276.phpt deleted file mode 100644 index 6959d90a92e2d..0000000000000 --- a/ext/dom/tests/bug34276.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Bug #34276 (setAttributeNS and default namespace) ---SKIPIF-- - ---FILE-- - - -HERE; - -function dump($elems) { - foreach ($elems as $elem) { - var_dump($elem->nodeName); - dump($elem->childNodes); - } -} - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$foo = $dom->documentElement; -var_dump($foo->hasAttributeNS('http://www.example.com/ns/foo', 'attra')); -var_dump($foo->getAttributeNS('http://www.example.com/ns/foo', 'attra')); - -$foo->setAttributeNS('http://www.example.com/ns/foo', 'attra', 'attranew'); -$foo->setAttributeNS('http://www.example.com/ns/fubar', 'attrb', 'attrbnew'); -$foo->setAttributeNS('http://www.example.com/ns/foo', 'attrc', 'attrc'); - -var_dump($foo->getAttributeNS('http://www.example.com/ns/foo', 'attra')); -var_dump($foo->getAttributeNS('http://www.example.com/ns/fubar', 'attrb')); -var_dump($foo->getAttributeNS('http://www.example.com/ns/foo', 'attrc')); - -print $dom->saveXML(); -?> ---EXPECT-- -bool(false) -string(0) "" -string(8) "attranew" -string(8) "attrbnew" -string(5) "attrc" - - diff --git a/ext/dom/tests/bug35342.phpt b/ext/dom/tests/bug35342.phpt deleted file mode 100644 index f93c062330e83..0000000000000 --- a/ext/dom/tests/bug35342.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #35342 (isset(DOMNodeList->length) returns false) ---SKIPIF-- - ---FILE-- -loadXML("foobarfoobar#2"); - -$nodelist = $dom->getElementsByTagName("foo"); - -var_dump($nodelist->length, isset($nodelist->length), isset($nodelist->foo)); -var_dump(empty($nodelist->length), empty($nodelist->foo)); -?> ---EXPECT-- -int(2) -bool(true) -bool(false) -bool(false) -bool(true) diff --git a/ext/dom/tests/bug36756.phpt b/ext/dom/tests/bug36756.phpt deleted file mode 100644 index 4e47b86e4b008..0000000000000 --- a/ext/dom/tests/bug36756.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #36756 (DOMDocument::removeChild corrupts node) ---SKIPIF-- - ---FILE-- -loadXML(''); -$xpath = new DOMXpath($dom); -$node = $xpath->query('/root')->item(0); -echo $node->nodeName . "\n"; -$dom->removeChild($GLOBALS['dom']->firstChild); -echo "nodeType: " . $node->nodeType . "\n"; - -/* Node gets destroyed during removeChild */ -$dom->loadXML(''); -$xpath = new DOMXpath($dom); -$node = $xpath->query('//child')->item(0); -echo $node->nodeName . "\n"; -$GLOBALS['dom']->removeChild($GLOBALS['dom']->firstChild); - -echo "nodeType: " . $node->nodeType . "\n"; - -?> ---EXPECTF-- -root -nodeType: 1 -child - -Warning: Couldn't fetch DOMElement. Node no longer exists in %sbug36756.php on line %d - -Notice: Undefined property: DOMElement::$nodeType in %sbug36756.php on line %d -nodeType: diff --git a/ext/dom/tests/bug37277.phpt b/ext/dom/tests/bug37277.phpt deleted file mode 100644 index 112b9f46559c0..0000000000000 --- a/ext/dom/tests/bug37277.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #37277 (cloning Dom Documents or Nodes does not work) ---SKIPIF-- - ---FILE-- -'; -$dom1->loadXml($xml); - -$node = clone $dom1->documentElement; - -$dom2 = new DomDocument('1.0', 'UTF-8'); -$dom2->appendChild($dom2->importNode($node->cloneNode(true), TRUE)); - -print $dom2->saveXML(); - - -?> ---EXPECT-- - - - - diff --git a/ext/dom/tests/bug37456.phpt b/ext/dom/tests/bug37456.phpt deleted file mode 100644 index 5f0fc28778362..0000000000000 --- a/ext/dom/tests/bug37456.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #37456 (DOMElement->setAttribute() loops forever) ---SKIPIF-- - ---FILE-- -resolveExternals = true; -$doc->load(dirname(__FILE__)."/dom.xml"); - -$root = $doc->getElementsByTagName('foo')->item(0); -$root->setAttribute('bar', '>'); -$attr = $root->setAttribute('bar', 'newval'); -print $attr->nodeValue; - - -?> ---EXPECT-- - -newval - diff --git a/ext/dom/tests/bug38438.phpt b/ext/dom/tests/bug38438.phpt deleted file mode 100644 index f51252832c664..0000000000000 --- a/ext/dom/tests/bug38438.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #38438 (DOMNodeList->item(0) segfault on empty NodeList) ---SKIPIF-- - ---FILE-- -item(0)); -echo "OK\n"; -?> ---EXPECT-- -NULL -OK diff --git a/ext/dom/tests/bug38474.phpt b/ext/dom/tests/bug38474.phpt deleted file mode 100644 index 5c1c1abd1a529..0000000000000 --- a/ext/dom/tests/bug38474.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Bug #38474 (getAttribute select attribute by order, even when prefixed) (OK to fail with libxml2 < 2.6.2x) ---SKIPIF-- - ---FILE-- -'; -$dom = new DomDocument(); -$dom->loadXML($xml); -echo $dom->firstChild->getAttribute('type')."\n"; -echo $dom->firstChild->getAttribute('pre:type')."\n"; - -$dom->firstChild->setAttribute('pre:type', 'bar2'); -$dom->firstChild->setAttribute('type', 'foo2'); -$dom->firstChild->setAttribute('post:type', 'baz'); -$dom->firstChild->setAttribute('new:type', 'baz2'); - -echo $dom->firstChild->getAttribute('type')."\n"; -echo $dom->firstChild->getAttribute('pre:type')."\n"; -echo $dom->firstChild->getAttribute('post:type')."\n"; - -$dom->firstChild->removeAttribute('pre:type'); -$dom->firstChild->removeAttribute('type'); - -echo $dom->firstChild->getAttribute('type')."\n"; -echo $dom->firstChild->getAttribute('pre:type')."\n"; -echo $dom->firstChild->getAttribute('post:type')."\n"; -echo $dom->firstChild->getAttribute('new:type'); -?> ---EXPECT-- -foo -bar -foo2 -bar2 -baz - - -baz -baz2 diff --git a/ext/dom/tests/bug38850.phpt b/ext/dom/tests/bug38850.phpt deleted file mode 100644 index b0de90b88ded7..0000000000000 --- a/ext/dom/tests/bug38850.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #38850 (lookupNamespaceURI does not return default namespace) ---SKIPIF-- - ---FILE-- - - -HERE; - -$doc = new DOMDocument(); -$doc->loadXML($xml); - -$root = $doc->documentElement; - -print $root->lookupNamespaceURI(NULL); - - -?> ---EXPECT-- -http://www.example.com/ns/foo diff --git a/ext/dom/tests/bug38949.phpt b/ext/dom/tests/bug38949.phpt deleted file mode 100644 index 4c81d9b731986..0000000000000 --- a/ext/dom/tests/bug38949.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #38949 (Cannot get xmlns value attribute) ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/nsdoc.xml"); - -$root = $doc->documentElement; - -echo $root->getAttribute("xmlns")."\n"; -echo $root->getAttribute("xmlns:ns2")."\n"; - -$child = $root->firstChild->nextSibling; -echo $child->getAttribute("xmlns")."\n"; -echo $child->getAttribute("xmlns:ns2")."\n"; - -echo "DONE\n"; -?> ---EXPECT-- -http://ns -http://ns2 - - -DONE diff --git a/ext/dom/tests/bug40836.phpt b/ext/dom/tests/bug40836.phpt deleted file mode 100644 index b96b39cfe9fc4..0000000000000 --- a/ext/dom/tests/bug40836.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #40836 (Segfault in insertBefore) ---SKIPIF-- - ---FILE-- -preserveWhiteSpace = false; -$xml = (binary)' - - - 2007-02-14T00:00:00+01:00 - -
-

paragraph

-
-
-
-
'; -$dom->loadXML($xml); -$entry = $dom->getElementsByTagNameNS("http://www.w3.org/2005/Atom", "entry")->item(0); -$contentNode = $entry->getElementsByTagName("content")->item(0)->firstChild; -$dateNode = $entry->getElementsByTagName("updated")->item(0)->firstChild; -$contentNode->firstChild->insertBefore($dateNode); -echo $dom->saveXML(); -?> ---EXPECT-- - -

paragraph2007-02-14T00:00:00+01:00

diff --git a/ext/dom/tests/bug41257.phpt b/ext/dom/tests/bug41257.phpt deleted file mode 100644 index edf62a53a3b50..0000000000000 --- a/ext/dom/tests/bug41257.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #41257 (lookupNamespaceURI does not work as expected) ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/nsdoc.xml"); - -$root = $doc->documentElement; - -$duri = $doc->lookupNamespaceURI("ns2")."\n"; -$euri = $root->lookupNamespaceURI("ns2")."\n"; - -var_dump($duri == $euri); - -$dpref = $doc->lookupPrefix("http://ns2")."\n"; -$epref = $root->lookupPrefix("http://ns2")."\n"; - -var_dump($dpref == $epref); - -$disdef = $doc->isDefaultNamespace("http://ns")."\n"; -$eisdef = $root->isDefaultNamespace("http://ns")."\n"; - -var_dump($dpref === $epref); -?> ---EXPECT-- -bool(true) -bool(true) -bool(true) diff --git a/ext/dom/tests/bug41374.phpt b/ext/dom/tests/bug41374.phpt deleted file mode 100644 index 21fc3454cdd8b..0000000000000 --- a/ext/dom/tests/bug41374.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #41374 (wholetext concats values of wrong nodes) ---SKIPIF-- - ---FILE-- - -foobaz -EOXML; - -$doc = new DOMDocument(); -$doc->loadXML($xml); - -$root = $doc->documentElement; -$foo = $root->firstChild; - -var_dump($foo->wholeText == "foo"); - -$bar = $root->insertBefore($doc->createTextNode("bar"), $foo->nextSibling); - -var_dump($foo->wholeText == "foobar"); -var_dump($foo->wholeText == $bar->wholeText); -$baz = $bar->nextSibling->nextSibling; - -var_dump($baz->wholeText === $foo->wholeText); -?> ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(false) diff --git a/ext/dom/tests/bug42082.phpt b/ext/dom/tests/bug42082.phpt deleted file mode 100644 index 86f32dd8d91e1..0000000000000 --- a/ext/dom/tests/bug42082.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #42082 (NodeList length zero should be empty) ---FILE-- -query('*'); -var_dump($nodes); -var_dump($nodes->length); -$length = $nodes->length; -var_dump(empty($nodes->length), empty($length)); - -$doc->loadXML(""); -var_dump($doc->firstChild->nodeValue, empty($doc->firstChild->nodeValue), isset($doc->firstChild->nodeValue)); -var_dump(empty($doc->nodeType), empty($doc->firstChild->nodeType)) -?> ---EXPECTF-- -object(DOMNodeList)#%d (0) { -} -int(0) -bool(true) -bool(true) -string(0) "" -bool(true) -bool(true) -bool(false) -bool(false) \ No newline at end of file diff --git a/ext/dom/tests/bug43364.phpt b/ext/dom/tests/bug43364.phpt deleted file mode 100644 index 0df581b7acdab..0000000000000 --- a/ext/dom/tests/bug43364.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #43364 (recursive xincludes don't remove internal xml nodes properly) ---FILE-- -childNodes->length > 0) { - $count += loopElements($node->childNodes); - } - } - } - return $count; -} - -$xml = << - - - ac1 - ac2 - - - - -DOC; - -$doc = new DomDocument(); -$doc->loadXml($xml); -$doc->xinclude(); - -$count = loopElements(array($doc->documentElement)); - -var_dump($count); -?> ---EXPECT-- -int(13) diff --git a/ext/dom/tests/bug45251.phpt b/ext/dom/tests/bug45251.phpt deleted file mode 100644 index 652e3b25304c6..0000000000000 --- a/ext/dom/tests/bug45251.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #45251 (double free or corruption with setAttributeNode()) ---SKIPIF-- - ---FILE-- -loadXml(<< - - - -EOF -); - -$xpath = new DOMXPath($doc); - -$bbb = $xpath->query('bbb', $doc->documentElement)->item(0); - -$ccc = $doc->createElement('ccc'); -foreach ($bbb->attributes as $attr) -{ - $ccc->setAttributeNode($attr); -} - -echo $attr->parentNode->localName; - -?> ---EXPECT-- -ccc diff --git a/ext/dom/tests/bug46335.phpt b/ext/dom/tests/bug46335.phpt deleted file mode 100644 index bea4ae9e7d0d4..0000000000000 --- a/ext/dom/tests/bug46335.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #46335 (DOMText::splitText doesn't handle multibyte characters). ---SKIPIF-- - ---FILE-- -createTextNode($textascii); -$dom->appendChild($node); - -print "Text: $node->textContent\n"; - -$matched = $node->splitText($start); -$matched->splitText($length); -print "splitText (ASCII): $matched->textContent\n"; - -$node = $dom->createTextNode($text); -$dom->appendChild($node); - -print "Text: $node->textContent\n"; - -$matched = $node->splitText($start); -$matched->splitText($length); -print "splitText (UTF-8): $matched->textContent\n"; -?> ---EXPECT-- -Text: This is an "example" of using DOM splitText -splitText (ASCII): DOM -Text: This is an ‘example’ of using DOM splitText -splitText (UTF-8): DOM diff --git a/ext/dom/tests/canonicalization.phpt b/ext/dom/tests/canonicalization.phpt deleted file mode 100644 index cf1a81f24a95c..0000000000000 --- a/ext/dom/tests/canonicalization.phpt +++ /dev/null @@ -1,102 +0,0 @@ ---TEST-- -Test: Canonicalization - C14N() ---SKIPIF-- - ---FILE-- - - - - - - - - - -EOXML; - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$doc = $dom->documentElement->firstChild; - -/* inclusive/without comments first child element of doc element is context. */ -echo $doc->C14N()."\n\n"; - -/* exclusive/without comments first child element of doc element is context. */ -echo $doc->c14N(TRUE)."\n\n"; - -/* inclusive/with comments first child element of doc element is context. */ -echo $doc->C14N(FALSE, TRUE)."\n\n"; - -/* exclusive/with comments first child element of doc element is context. */ -echo $doc->C14N(TRUE, TRUE)."\n\n"; - -/* exclusive/without comments using xpath query. */ -echo $doc->c14N(TRUE, FALSE, array('query'=>'(//. | //@* | //namespace::*)'))."\n\n"; - -/* exclusive/without comments first child element of doc element is context. - using xpath query with registered namespace. - test namespace prefix is also included. */ -echo $doc->c14N(TRUE, FALSE, - array('query'=>'(//a:contain | //a:bar | .//namespace::*)', - 'namespaces'=>array('a'=>'http://www.example.com/ns/foo')), - array('test'))."\n\n"; - -/* exclusive/without comments first child element of doc element is context. - test namespace prefix is also included */ -echo $doc->C14N(TRUE, FALSE, NULL, array('test')); -?> ---EXPECTF-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/dom/tests/dom.ent b/ext/dom/tests/dom.ent deleted file mode 100644 index 987ff9dc0fab6..0000000000000 --- a/ext/dom/tests/dom.ent +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ext/dom/tests/dom.xml b/ext/dom/tests/dom.xml deleted file mode 100644 index 09ac674e55d83..0000000000000 --- a/ext/dom/tests/dom.xml +++ /dev/null @@ -1,8 +0,0 @@ - - -%incent; -]> - - - \ No newline at end of file diff --git a/ext/dom/tests/dom001.phpt b/ext/dom/tests/dom001.phpt deleted file mode 100644 index a0c78fbb0a19f..0000000000000 --- a/ext/dom/tests/dom001.phpt +++ /dev/null @@ -1,275 +0,0 @@ ---TEST-- -Test 1: Accessing single node ---SKIPIF-- - ---FILE-- -loadxml($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -// children() of of document would result in a memleak -//$children = $dom->children(); -//print_node_list($children); - -echo "--------- root\n"; -$rootnode = $dom->documentElement; -print_node($rootnode); - -echo "--------- children of root\n"; -$children = $rootnode->childNodes; -print_node_list($children); - -// The last node should be identical with the last entry in the children array -echo "--------- last\n"; -$last = $rootnode->lastChild; -print_node($last); - -// The parent of this last node is the root again -echo "--------- parent\n"; -$parent = $last->parentNode; -print_node($parent); - -// The children of this parent are the same children as one above -echo "--------- children of parent\n"; -$children = $parent->childNodes; -print_node_list($children); - -echo "--------- creating a new attribute\n"; -//This is worthless -//$attr = $dom->createAttribute("src", "picture.gif"); -//print_r($attr); - -//$rootnode->set_attributeNode($attr); -$attr = $rootnode->setAttribute("src", "picture.gif"); -$attr = $rootnode->getAttribute("src"); -print_r($attr); -print "\n"; - -echo "--------- Get Attribute Node\n"; -$attr = $rootnode->getAttributeNode("src"); -print_node($attr); - -echo "--------- Remove Attribute Node\n"; -$attr = $rootnode->removeAttribute("src"); -print "Removed " . $attr . " attributes.\n"; - -echo "--------- attributes of rootnode\n"; -$attrs = $rootnode->attributes; -print_node_list($attrs); - -echo "--------- children of an attribute\n"; -$children = $attrs->item(0)->childNodes; -print_node_list($children); - -echo "--------- Add child to root\n"; -$myelement = new domElement("Silly", "Symphony"); -$newchild = $rootnode->appendChild($myelement); -print_node($newchild); -print $dom->saveXML(); -print "\n"; - -echo "--------- Find element by tagname\n"; -echo " Using dom\n"; -$children = $dom->getElementsByTagname("Silly"); -print_node_list($children); - -echo " Using elem\n"; -$children = $rootnode->getElementsByTagName("Silly"); -print_node_list($children); - -echo "--------- Unlink Node\n"; -print_node($children->item(0)); -$rootnode->removeChild($children->item(0)); -print_node_list($rootnode->childNodes); -print $dom->savexml(); - -echo "--------- Find element by id\n"; -print ("Not implemented\n"); - -echo "--------- Check various node_name return values\n"; -print ("Not needed\n"); - -?> ---EXPECT-- -Test 1: accessing single nodes from php ---------- root -Node Name: chapter -Node Type: 1 -Num Children: 4 - ---------- children of root -Node Name: title -Node Type: 1 -Num Children: 1 -Node Content: Title - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - -Node Name: para -Node Type: 1 -Num Children: 7 - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - ---------- last -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - ---------- parent -Node Name: chapter -Node Type: 1 -Num Children: 4 - ---------- children of parent -Node Name: title -Node Type: 1 -Num Children: 1 -Node Content: Title - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - -Node Name: para -Node Type: 1 -Num Children: 7 - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - ---------- creating a new attribute -picture.gif ---------- Get Attribute Node -Node Name: src -Node Type: 2 -Num Children: 1 -Node Content: picture.gif - ---------- Remove Attribute Node -Removed 1 attributes. ---------- attributes of rootnode -Node Name: language -Node Type: 2 -Num Children: 1 -Node Content: en - ---------- children of an attribute -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: en - ---------- Add child to root -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - -Symphony - ---------- Find element by tagname - Using dom -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - - Using elem -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - ---------- Unlink Node -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - -Node Name: title -Node Type: 1 -Num Children: 1 -Node Content: Title - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - -Node Name: para -Node Type: 1 -Num Children: 7 - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - ---------- Find element by id -Not implemented ---------- Check various node_name return values -Not needed diff --git a/ext/dom/tests/dom002.phpt b/ext/dom/tests/dom002.phpt deleted file mode 100644 index 3343a1774ef9d..0000000000000 --- a/ext/dom/tests/dom002.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test 2: getElementsByTagName() / getElementsByTagNameNS() ---SKIPIF-- - ---FILE-- - - - - - - - -HERE; - -function dump($elems) { - foreach ($elems as $elem) { - var_dump($elem->nodeName); - dump($elem->childNodes); - } -} - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$doc = $dom->documentElement; -dump($dom->getElementsByTagName('bar')); -dump($doc->getElementsByTagName('bar')); -dump($dom->getElementsByTagNameNS('http://www.example.com/ns/fubar', 'bar')); -dump($doc->getElementsByTagNameNS('http://www.example.com/ns/fubar', 'bar')); -?> ---EXPECT-- -string(3) "bar" -string(5) "test1" -string(3) "bar" -string(5) "test2" -string(9) "fubar:bar" -string(5) "test3" -string(9) "fubar:bar" -string(5) "test4" -string(3) "bar" -string(5) "test1" -string(3) "bar" -string(5) "test2" -string(9) "fubar:bar" -string(5) "test3" -string(9) "fubar:bar" -string(5) "test4" -string(9) "fubar:bar" -string(5) "test3" -string(9) "fubar:bar" -string(5) "test4" -string(9) "fubar:bar" -string(5) "test3" -string(9) "fubar:bar" -string(5) "test4" diff --git a/ext/dom/tests/dom003.phpt b/ext/dom/tests/dom003.phpt deleted file mode 100644 index 1eb6d4a4f73ed..0000000000000 --- a/ext/dom/tests/dom003.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Test 3: Exception Test ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/book.xml"); -$rootNode = $dom->documentElement; -print "--- Catch exception with try/catch\n"; -try { - $rootNode->appendChild($rootNode); -} catch (domexception $e) { - var_dump($e); -} -print "--- Don't catch exception with try/catch\n"; -$rootNode->appendChild($rootNode); - - -?> ---EXPECTF-- ---- Catch exception with try/catch -object(DOMException)#%d (6) { - ["message:protected"]=> - string(23) "Hierarchy Request Error" - ["string:private"]=> - string(0) "" - ["file:protected"]=> - string(%d) "%sdom003.php" - ["line:protected"]=> - int(8) - ["trace:private"]=> - array(1) { - [0]=> - array(6) { - ["file"]=> - string(%d) "%sdom003.php" - ["line"]=> - int(8) - ["function"]=> - string(11) "appendChild" - ["class"]=> - string(7) "DOMNode" - ["type"]=> - string(2) "->" - ["args"]=> - array(1) { - [0]=> - object(DOMElement)#%d (0) { - } - } - } - } - ["code"]=> - int(3) -} ---- Don't catch exception with try/catch - -Fatal error: Uncaught exception 'DOMException' with message 'Hierarchy Request Error' in %sdom003.php:%d -Stack trace: -#0 %sdom003.php(13): DOMNode->appendChild(Object(DOMElement)) -#1 {main} - thrown in %sdom003.php on line %d diff --git a/ext/dom/tests/dom004.phpt b/ext/dom/tests/dom004.phpt deleted file mode 100644 index 82b7915f6f630..0000000000000 --- a/ext/dom/tests/dom004.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Test 4: Streams Test ---SKIPIF-- - ---FILE-- -load("compress.zlib://".dirname(__FILE__)."/book.xml.gz"); -print $dom->saveXML(); - ---EXPECT-- - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/dom005.phpt b/ext/dom/tests/dom005.phpt deleted file mode 100644 index 249869eff2f25..0000000000000 --- a/ext/dom/tests/dom005.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test 5: HTML Test ---SKIPIF-- - ---FILE-- -loadHTMLFile(dirname(__FILE__)."/test.html"); -print "--- save as XML\n"; - -print adjustDoctype($dom->saveXML()); -print "--- save as HTML\n"; - -print adjustDoctype($dom->saveHTML()); - -function adjustDoctype($xml) { - return str_replace(array("DOCTYPE HTML",'

','

'),array("DOCTYPE html",'',''),$xml); -} - ---EXPECT-- ---- save as XML - - -Hello world -This is a not well-formed
-html files with undeclared entities  - ---- save as HTML - - -Hello world - -This is a not well-formed
-html files with undeclared entities  - - diff --git a/ext/dom/tests/dom006.phpt b/ext/dom/tests/dom006.phpt deleted file mode 100644 index b8e8ed172440a..0000000000000 --- a/ext/dom/tests/dom006.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test 6: Extends Test ---SKIPIF-- - ---FILE-- -createElement("title"); - $titleElement->appendChild($this->createTextNode($title)); - $authorElement = $this->createElement("author"); - $authorElement->appendChild($this->createTextNode($author)); - - $bookElement = $this->createElement("book"); - - $bookElement->appendChild($titleElement); - $bookElement->appendChild($authorElement); - $this->documentElement->appendChild($bookElement); - } - -} - -$dom = new books; - -$dom->load(dirname(__FILE__)."/book.xml"); -$dom->addBook("PHP de Luxe", "Richard Samar, Christian Stocker"); -print $dom->saveXML(); ---EXPECT-- - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - -PHP de LuxeRichard Samar, Christian Stocker diff --git a/ext/dom/tests/dom007.phpt b/ext/dom/tests/dom007.phpt deleted file mode 100644 index 649d630336378..0000000000000 --- a/ext/dom/tests/dom007.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -Test 7: DTD tests ---SKIPIF-- - ---FILE-- - - - - - - - - - - - - -]> - - - Basic Languages - Introduction to Languages - - - French I - Introduction to French - - - - -EOXML; - -$dom = new DOMDocument(); -$dom->loadXML($xml); - -$dtd = $dom->doctype; - -/* Notation Tests */ -$nots = $dtd->notations; - -$length = $nots->length; -echo "Length: ".$length."\n"; - -foreach ($nots AS $key=>$node) { - echo "Key $key: ".$node->nodeName." (".$node->systemId.") (".$node->publicId.")\n"; -} -print "\n"; -for($x=0; $x < $length; $x++) { - echo "Index $x: ".$nots->item($x)->nodeName." (".$nots->item($x)->systemId.") (".$nots->item($x)->publicId.")\n"; -} - -echo "\n"; -$node = $nots->getNamedItem('xxx'); -var_dump($node); - -echo "\n"; -/* Entity Decl Tests */ -$ents = $dtd->entities; -$length = $ents->length; -echo "Length: ".$length."\n"; -foreach ($ents AS $key=>$node) { - echo "Key: $key Name: ".$node->nodeName."\n"; -} -echo "\n"; -for($x=0; $x < $length; $x++) { - echo "Index $x: ".$ents->item($x)->nodeName."\n"; -} - -echo "\n"; -$node = $ents->item(3); -var_dump($node); -$node = $ents->getNamedItem('xxx'); -var_dump($node); - - ---EXPECT-- -Length: 1 -Key GIF: GIF (image/gif) (-) - -Index 0: GIF (image/gif) (-) - -NULL - -Length: 3 -Key: test Name: test -Key: rdf Name: rdf -Key: myimage Name: myimage - -Index 0: test -Index 1: rdf -Index 2: myimage - -NULL -NULL diff --git a/ext/dom/tests/dom_comment_basic.phpt b/ext/dom/tests/dom_comment_basic.phpt deleted file mode 100644 index cb029ed04a50e..0000000000000 --- a/ext/dom/tests/dom_comment_basic.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -DOM Comment : Basic Functionality ---SKIPIF-- - ---FILE-- - - - - -EOXML; - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$root = $dom->documentElement; -var_dump($root->hasChildNodes()); -$children = $root->childNodes; - -for ($index = 0; $index < $children->length; $index++) { - echo "--- child $index ---\n"; - $current = $children->item($index); - var_dump($current); - var_dump($current->textContent); -} - ---EXPECTF-- -bool(true) ---- child 0 --- -object(DOMText)#%d (0) { -} -string(2) " - " ---- child 1 --- -object(DOMComment)#%d (0) { -} -string(14) " Hello World! " ---- child 2 --- -object(DOMText)#%d (0) { -} -string(1) " -" - diff --git a/ext/dom/tests/dom_comment_variation.phpt b/ext/dom/tests/dom_comment_variation.phpt deleted file mode 100644 index bef0ef1b10ae0..0000000000000 --- a/ext/dom/tests/dom_comment_variation.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -DOM Comment : Variation ---SKIPIF-- - ---FILE-- - -EOXML; - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$root = $dom->documentElement; -var_dump($root->hasChildNodes()); -$children = $root->childNodes; - -for ($index = 0; $index < $children->length; $index++) { - echo "--- child $index ---\n"; - $current = $children->item($index); - var_dump($current); - var_dump($current->textContent); -} - ---EXPECTF-- -bool(true) ---- child 0 --- -object(DOMComment)#%d (0) { -} -string(14) " Hello World! " - diff --git a/ext/dom/tests/dom_create_element.phpt b/ext/dom/tests/dom_create_element.phpt deleted file mode 100644 index 3f307099bb12b..0000000000000 --- a/ext/dom/tests/dom_create_element.phpt +++ /dev/null @@ -1,394 +0,0 @@ ---TEST-- -Test 1: Creating Elements with and without Namespaces ---SKIPIF-- - ---FILE-- -createElement('valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 2 DOMDocument::createElement('-invalid')\n"; -try { - $dom = new domDocument; - $dom->createElement('-invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 3 DOMDocument::createElement(' ')\n"; -try { - $dom = new domDocument; - $dom->createElement(' '); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 4 DOMDocument::createElement('prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElement('prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 5 DOMDocument::createElementNS('http://valid.com', 'valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', 'valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 6 DOMDocument::createElementNS('http://valid.com', 'prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', 'prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 7 DOMDocument::createElementNS('http://valid.com', '-invalid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', '-invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 8 DOMDocument::createElementNS('http://valid.com', 'prefix:-invalid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', 'prefix:-invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print " 9 DOMDocument::createElementNS('', 'prefix:invalid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('', 'prefix:invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "10 DOMDocument::createElementNS('http://valid.com', 'prefix:valid:invalid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', 'prefix:valid:invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "11 DOMDocument::createElementNS('http://valid.com', '-prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://valid.com', '-prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "12 DOMDocument::createElementNS('-', 'prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('-', 'prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - - -print "13 DOMElement::__construct('valid')\n"; -try { - $element = new DomElement('valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "14 DOMElement::__construct('-invalid')\n"; -try { - $element = new DomElement('-invalid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "15 DOMElement::__construct(' ')\n"; -try { - $element = new DomElement(' '); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "16 DOMElement::__construct('prefix:valid')\n"; -try { - $element = new DomElement('prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "17 DOMElement::__construct('valid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('valid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "18 DOMElement::__construct('prefix:valid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('prefix:valid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "19 DOMElement::__construct('-invalid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('-invalid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "20 DOMElement::__construct('prefix:-invalid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('prefix:-invalid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "21 DOMElement::__construct('prefix:invalid', '', '')\n"; -try { - $element = new DomElement('prefix:invalid', '', ''); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "22 DOMElement::__construct('prefix:valid:invalid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('prefix:valid:invalid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "23 DOMElement::__construct('-prefix:valid', '', 'http://valid.com')\n"; -try { - $element = new DomElement('-prefix:valid', '', 'http://valid.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "24 DOMElement::__construct('prefix:valid', '', '-')\n"; -try { - $element = new DomElement('prefix:valid', '', '-'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* the qualifiedName has a prefix and the namespaceURI is null */ - -print "25 DOMDocument::createElementNS('', 'prefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('', 'prefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* the qualifiedName has a prefix that is "xml" and the namespaceURI - is different from "http://www.w3.org/XML/1998/namespace" [XML Namespaces] */ - -print "26 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xml:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://wrong.namespaceURI.com', 'xml:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "27 DOMElement::__construct('xml:valid', '', 'http://wrong.namespaceURI.com')\n"; -try { - $element = new DomElement('xml:valid', '', 'http://wrong.namespaceURI.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* This is okay because we reuse the xml namespace from the document */ -print "28 DOMDocument::createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* This isn't because the xml namespace isn't there and we can't create it */ -print "29 DOMElement::__construct('xml:valid', '', 'http://www.w3.org/XML/1998/namespace')\n"; -try { - $element = new DomElement('xml:valid', '', 'http://www.w3.org/XML/1998/namespace'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - - -/* the qualifiedName or its prefix is "xmlns" and the namespaceURI is - different from "http://www.w3.org/2000/xmlns/" */ - -print "30 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xmlns:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://wrong.namespaceURI.com', 'xmlns:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "31 DOMElement::__construct('xmlns:valid', '', 'http://wrong.namespaceURI.com')\n"; -try { - $element = new DomElement('xmlns:valid', '', 'http://wrong.namespaceURI.com'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "32 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "33 DOMElement::__construct('xmlns:valid', '', 'http://www.w3.org/2000/xmlns/')\n"; -try { - $element = new DomElement('xmlns:valid', '', 'http://www.w3.org/2000/xmlns/'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -/* the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the - qualifiedName nor its prefix is "xmlns". */ - -print "34 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'wrongprefix:valid')\n"; -try { - $dom = new domDocument; - $dom->createElementNS('http://www.w3.org/2000/xmlns/', 'wrongprefix:valid'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - -print "35 DOMElement::__construct('wrongprefix:valid', '', 'http://www.w3.org/2000/xmlns/')\n"; -try { - $element = new DomElement('wrongprefix:valid', '', 'http://www.w3.org/2000/xmlns/'); - print "valid\n"; -} catch (Exception $e) { - print $e->getMessage() . "\n"; -} - - - -?> ---EXPECT-- - 1 DOMDocument::createElement('valid') -valid - 2 DOMDocument::createElement('-invalid') -Invalid Character Error - 3 DOMDocument::createElement(' ') -Invalid Character Error - 4 DOMDocument::createElement('prefix:valid') -valid - 5 DOMDocument::createElementNS('http://valid.com', 'valid') -valid - 6 DOMDocument::createElementNS('http://valid.com', 'prefix:valid') -valid - 7 DOMDocument::createElementNS('http://valid.com', '-invalid') -Namespace Error - 8 DOMDocument::createElementNS('http://valid.com', 'prefix:-invalid') -Namespace Error - 9 DOMDocument::createElementNS('', 'prefix:invalid') -Namespace Error -10 DOMDocument::createElementNS('http://valid.com', 'prefix:valid:invalid') -Namespace Error -11 DOMDocument::createElementNS('http://valid.com', '-prefix:valid') -Namespace Error -12 DOMDocument::createElementNS('-', 'prefix:valid') -valid -13 DOMElement::__construct('valid') -valid -14 DOMElement::__construct('-invalid') -Invalid Character Error -15 DOMElement::__construct(' ') -Invalid Character Error -16 DOMElement::__construct('prefix:valid') -Namespace Error -17 DOMElement::__construct('valid', '', 'http://valid.com') -valid -18 DOMElement::__construct('prefix:valid', '', 'http://valid.com') -valid -19 DOMElement::__construct('-invalid', '', 'http://valid.com') -Invalid Character Error -20 DOMElement::__construct('prefix:-invalid', '', 'http://valid.com') -Namespace Error -21 DOMElement::__construct('prefix:invalid', '', '') -Namespace Error -22 DOMElement::__construct('prefix:valid:invalid', '', 'http://valid.com') -Namespace Error -23 DOMElement::__construct('-prefix:valid', '', 'http://valid.com') -Invalid Character Error -24 DOMElement::__construct('prefix:valid', '', '-') -valid -25 DOMDocument::createElementNS('', 'prefix:valid') -Namespace Error -26 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xml:valid') -Namespace Error -27 DOMElement::__construct('xml:valid', '', 'http://wrong.namespaceURI.com') -Namespace Error -28 DOMDocument::createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:valid') -valid -29 DOMElement::__construct('xml:valid', '', 'http://www.w3.org/XML/1998/namespace') -Namespace Error -30 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xmlns:valid') -Namespace Error -31 DOMElement::__construct('xmlns:valid', '', 'http://wrong.namespaceURI.com') -Namespace Error -32 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns:valid') -valid -33 DOMElement::__construct('xmlns:valid', '', 'http://www.w3.org/2000/xmlns/') -valid -34 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'wrongprefix:valid') -Namespace Error -35 DOMElement::__construct('wrongprefix:valid', '', 'http://www.w3.org/2000/xmlns/') -Namespace Error diff --git a/ext/dom/tests/dom_import_simplexml.phpt b/ext/dom/tests/dom_import_simplexml.phpt deleted file mode 100644 index 81744aa260085..0000000000000 --- a/ext/dom/tests/dom_import_simplexml.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Interop Test: Import from SimpleXML ---SKIPIF-- - - ---FILE-- -ownerDocument->saveXML(); -?> ---EXPECT-- - - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/dom/tests/dom_set_attr_node.phpt b/ext/dom/tests/dom_set_attr_node.phpt deleted file mode 100644 index 7d783c56204fa..0000000000000 --- a/ext/dom/tests/dom_set_attr_node.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -Test: setAttributeNode() ---SKIPIF-- - ---FILE-- - - -HERE; - -$xml2 = << - -HERE; - -$dom = new DOMDocument(); -$dom->loadXML($xml); -$root = $dom->documentElement; -$attr = $root->getAttributeNode('a'); - -$dom2 = new DOMDocument(); -$dom2->loadXML($xml2); -$root2 = $dom2->documentElement; -try { - $root2->setAttributeNode($attr); -} catch (domexception $e) { - var_dump($e); -} - -?> ---EXPECTF-- -object(DOMException)#%d (6) { - ["message:protected"]=> - string(20) "Wrong Document Error" - ["string:private"]=> - string(0) "" - ["file:protected"]=> - string(%d) "%sdom_set_attr_node.php" - ["line:protected"]=> - int(%d) - ["trace:private"]=> - array(1) { - [0]=> - array(6) { - ["file"]=> - string(%d) "%sdom_set_attr_node.php" - ["line"]=> - int(%d) - ["function"]=> - string(16) "setAttributeNode" - ["class"]=> - string(10) "DOMElement" - ["type"]=> - string(2) "->" - ["args"]=> - array(1) { - [0]=> - object(DOMAttr)#%d (0) { - } - } - } - } - ["code"]=> - int(4) -} diff --git a/ext/dom/tests/dom_test.inc b/ext/dom/tests/dom_test.inc deleted file mode 100644 index 86b426f8f37ca..0000000000000 --- a/ext/dom/tests/dom_test.inc +++ /dev/null @@ -1,47 +0,0 @@ - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - "; - -function print_node($node) -{ - print "Node Name: " . $node->nodeName; - print "\nNode Type: " . $node->nodeType; - if ($node->nodeType != 3) { - $child_count = $node->childNodes->length; - } else { - $child_count = 0; - } - print "\nNum Children: " . $child_count; - if($child_count <= 1){ - print "\nNode Content: " . $node->nodeValue; - } - print "\n\n"; -} - -function print_node_list($nodelist) -{ - foreach($nodelist as $node) - { - print_node($node); - } -} - -?> diff --git a/ext/dom/tests/dom_xinclude.phpt b/ext/dom/tests/dom_xinclude.phpt deleted file mode 100644 index f9a3dd761ede6..0000000000000 --- a/ext/dom/tests/dom_xinclude.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Test: Xinclude and Streams ---SKIPIF-- - ---FILE-- -loadXML($data); - -$dom->xinclude(); -print $dom->saveXML()."\n"; -foreach ($dom->documentElement->childNodes as $node) { - print $node->nodeName."\n"; -} -?> ---EXPECTF-- - - - - The Grapes of Wrath - John Steinbeck - - The Pearl - John Steinbeck - - - -#text -book -book -#text diff --git a/ext/dom/tests/domattributes.phpt b/ext/dom/tests/domattributes.phpt deleted file mode 100644 index 9097a887e9f13..0000000000000 --- a/ext/dom/tests/domattributes.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Attributes: DOMAttribute functionality ---SKIPIF-- - ---FILE-- -loadXML($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$node = $dom->documentElement; - -$lang = $node->getAttributeNode('language'); -echo "Language: ".$lang->value."\n"; - -$lang->value = 'en-US'; -echo "Language: ".$lang->value."\n"; - -$parent = $lang->ownerElement; - -$chapter = new DOMAttr("num", "1"); -$parent->setAttributeNode($chapter); - -echo "Is ID?: ".($chapter->isId()?'YES':'NO')."\n"; - -$top_element = $node->cloneNode(); - -print $dom->saveXML($top_element); - - -?> ---EXPECT-- - -Language: en -Language: en-US -Is ID?: NO - - diff --git a/ext/dom/tests/domchardata.phpt b/ext/dom/tests/domchardata.phpt deleted file mode 100644 index 6baff6d148c17..0000000000000 --- a/ext/dom/tests/domchardata.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -CharData: DOMCharacterData and related functionality ---SKIPIF-- - ---FILE-- -loadXML($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$node = $dom->documentElement; - -$charnode = $dom->createElement('charnode'); -$node->appendChild($charnode); - -/* DOMComment */ -$comment = new DOMComment('Testing character data and extending nodes'); -$charnode->appendChild($comment); - -echo "Comment Length: ".$comment->length."\n"; - -$comment->data = 'Updated comment'; -echo "New Comment Length: ".$comment->length."\n"; -echo "New Comment Data: ".$comment->data."\n"; - -/* DOMCDataSection */ -$cdata = new DOMCDataSection('Chars: <>&"'); -$charnode->appendChild($cdata); - -echo "Substring: ".$cdata->substringData(7, 4)."\n"; -$cdata->replaceData(10, 1, "'"); -echo "New Substring: ".$cdata->substringData(7, 4)."\n"; - -/* DOMCharacterData using DOMComment */ -$comment = new DOMComment('instructions'); -echo "Comment Value: ".$comment->data."\n"; -$comment->data = 'some more instructions'; -echo "New Comment Value: ".$comment->data."\n"; - -$comment->insertData(10, 'pi '); -$comment->replaceData(18, 5, 'i'); -$comment->insertData(20, 'g'); -$comment->deleteData(13, 2); -$comment->deleteData(10, 3); -$comment->insertData(10, 'comment '); -echo "Updated Comment Value: ".$comment->data."\n"; - -/* DOMText */ -$text = new DOMText('some text characters'); - -echo "Whole Text: ".$text->wholeText."\n"; -$text2 = $text->splitText(9); - -echo "Split text: ".$text2->wholeText."\n"; -$text3 = $text2->splitText(1); - -echo "Is Whitespace?: ".($text2->isElementContentWhitespace()?'YES':'NO'); -?> ---EXPECT-- - -Comment Length: 42 -New Comment Length: 15 -New Comment Data: Updated comment -Substring: <>&" -New Substring: <>&' -Comment Value: instructions -New Comment Value: some more instructions -Updated Comment Value: some more comment strings -Whole Text: some text characters -Split text: characters -Is Whitespace?: YES diff --git a/ext/dom/tests/domelement.phpt b/ext/dom/tests/domelement.phpt deleted file mode 100644 index bc69af602c311..0000000000000 --- a/ext/dom/tests/domelement.phpt +++ /dev/null @@ -1,114 +0,0 @@ ---TEST-- -Elements: DOMElement functionality ---SKIPIF-- - ---FILE-- -loadXML($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$node = $dom->documentElement; -echo "Tag Name: ".$node->tagName."\n"; - - -$node->setAttribute('num', '1'); -echo "Chapter: ".$node->getAttribute('num')."\n"; -echo 'Attribute num exists?: '.($node->hasAttribute('num')?'Yes':'No')."\n"; -$node->removeAttribute('num'); -echo "Chapter: ".$node->getAttribute('num')."\n"; -echo 'Attribute num exists?: '.($node->hasAttribute('num')?'Yes':'No')."\n"; - -echo "Language: ".$node->getAttribute('language')."\n"; -$lang = $node->getAttributeNode('language'); -$lang->nodeValue = 'en-US'; -$node->setAttributeNode($lang); -echo "Language: ".$node->getAttribute('language')."\n"; -$node->removeAttributeNode($lang); -echo "Language: ".$node->getAttribute('language')."\n"; - -echo "\n-- xml:lang --\n"; -$node->setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang', 'en'); -echo "Language: ".$node->getAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')."\n"; -echo 'Attribute xml:lang exists?: '.($node->hasAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')?'Yes':'No')."\n"; - -$node->removeAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang'); -echo "Language: ".$node->getAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')."\n"; -echo 'Attribute xml:lang exists?: '.($node->hasAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')?'Yes':'No')."\n"; - -$lang = $dom->createAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang'); -$lang->nodeValue = 'en-GB'; -$node->setAttributeNodeNS($lang); -unset($lang); -echo "Language: ".$node->getAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')."\n"; -$lang = $node->getAttributeNodeNS('http://www.w3.org/XML/1998/namespace', 'lang'); -echo "Language: ".$lang->value."\n"; - -echo "\n-- Elements --\n"; -$rows = $node->getElementsByTagName('row'); -echo "Row Count: ".$rows->length."\n"; - -$element_ns = new DOMElement('newns:myelement', 'default content', 'urn::dummyns'); -$node->appendChild($element_ns); -$element_ns = new DOMElement('newns2:myelement', 'second default content', 'urn::dummyns'); -$node->appendChild($element_ns); - -$myelements = $node->getElementsByTagNameNS('urn::dummyns', 'myelement'); -$mylen = $myelements->length; -echo "myelements Count: ".$mylen."\n"; - -echo "\n-- IDs --\n"; -$node->setAttribute('idatt', 'n1'); -$node->setIdAttribute('idatt', TRUE); - -for ($x = 0; $x < $mylen; $x++) { - $current = $myelements->item($x); - $current->setAttributeNS('urn::dummyns', 'newns:idatt', 'n'.($x+2))."\n"; - $current->setIdAttributeNS('urn::dummyns', 'idatt', TRUE); -} - -echo 'Element Name: '.(($elem = $dom->getElementByID('n1'))?$elem->localName:'Not Found')."\n"; -$idatt = $node->getAttributeNode('idatt'); -$node->setIdAttributeNode($idatt, FALSE); -echo 'Element Name: '.(($elem = $dom->getElementByID('n1'))?$elem->localName:'Not Found')."\n"; - -echo 'Element Name: '.(($elem = $dom->getElementByID('n3'))?$elem->nodeName:'Not Found')."\n"; -for ($x = 0; $x < $mylen; $x++) { - $node = $myelements->item($x); - $node->setIdAttributeNS('urn::dummyns', 'idatt', FALSE); -} -echo 'Element Name: '.(($elem = $dom->getElementByID('n3'))?$elem->nodeName:'Not Found')."\n"; -?> ---EXPECT-- - -Tag Name: chapter -Chapter: 1 -Attribute num exists?: Yes -Chapter: -Attribute num exists?: No -Language: en -Language: en-US -Language: - --- xml:lang -- -Language: en -Attribute xml:lang exists?: Yes -Language: -Attribute xml:lang exists?: No -Language: en-GB -Language: en-GB - --- Elements -- -Row Count: 3 -myelements Count: 2 - --- IDs -- -Element Name: chapter -Element Name: Not Found -Element Name: newns2:myelement -Element Name: Not Found diff --git a/ext/dom/tests/nsdoc.xml b/ext/dom/tests/nsdoc.xml deleted file mode 100644 index 9503fd8c5b1ad..0000000000000 --- a/ext/dom/tests/nsdoc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/ext/dom/tests/regsiter_node_class.phpt b/ext/dom/tests/regsiter_node_class.phpt deleted file mode 100644 index 5444cc4b9ea82..0000000000000 --- a/ext/dom/tests/regsiter_node_class.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test: registerNodeClass() ---SKIPIF-- - ---FILE-- -registerNodeClass('DOMAttr', 'myAttribute'); -$doc->registerNodeClass('DOMElement', 'myElement'); -$doc->appendChild(new DOMElement('root')); -$root = $doc->documentElement; -$root->setAttribute('a', 'a1'); -var_dump($root); -print $root->testit()."\n"; -$attr = $root->getAttributeNode('a'); -var_dump($attr); -print $attr->testit()."\n"; -unset($attr); -$doc->registerNodeClass('DOMAttr', NULL); -$attr = $root->getAttributeNode('a'); -var_dump($attr); -print $attr->testit()."\n"; -?> ---EXPECTF-- - -object(myElement)#%d (0) { -} -HELLO Element -object(myAttribute)#%d (0) { -} -HELLO Attribute -object(DOMAttr)#%d (0) { -} - -Fatal error: Call to undefined method DOMAttr::testit() in %s on line 25 diff --git a/ext/dom/tests/skipif.inc b/ext/dom/tests/skipif.inc deleted file mode 100644 index 08fd695d97eba..0000000000000 --- a/ext/dom/tests/skipif.inc +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ext/dom/tests/test.html b/ext/dom/tests/test.html deleted file mode 100644 index fe6d0d3dbc1cc..0000000000000 --- a/ext/dom/tests/test.html +++ /dev/null @@ -1,9 +0,0 @@ - - -Hello world - - -This is a not well-formed
-html files with undeclared entities  - - diff --git a/ext/dom/tests/xinclude.xml b/ext/dom/tests/xinclude.xml deleted file mode 100644 index 27efa91aee06c..0000000000000 --- a/ext/dom/tests/xinclude.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/ext/dom/text.c b/ext/dom/text.c deleted file mode 100644 index 3234b4cc25df6..0000000000000 --- a/ext/dom/text.c +++ /dev/null @@ -1,241 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" -#include "dom_ce.h" - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_split_text, 0, 0, 1) - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_is_whitespace_in_element_content, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_replace_whole_text, 0, 0, 1) - ZEND_ARG_INFO(0, content) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_text_construct, 0, 0, 0) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class DOMText extends DOMCharacterData -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1312295772 -* Since: -*/ - -zend_function_entry php_dom_text_class_functions[] = { - PHP_FALIAS(splitText, dom_text_split_text, arginfo_dom_text_split_text) - PHP_FALIAS(isWhitespaceInElementContent, dom_text_is_whitespace_in_element_content, arginfo_dom_text_is_whitespace_in_element_content) - PHP_FALIAS(isElementContentWhitespace, dom_text_is_whitespace_in_element_content, arginfo_dom_text_is_whitespace_in_element_content) - PHP_FALIAS(replaceWholeText, dom_text_replace_whole_text, arginfo_dom_text_replace_whole_text) - PHP_ME(domtext, __construct, arginfo_dom_text_construct, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMText::__construct([string value]); */ -PHP_METHOD(domtext, __construct) -{ - - zval *id; - xmlNodePtr nodep = NULL, oldnode = NULL; - dom_object *intern; - char *value = NULL; - int value_len; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - nodep = xmlNewText((xmlChar *) value); - - if (!nodep) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldnode = dom_object_get_node(intern); - if (oldnode != NULL) { - php_libxml_node_free_resource(oldnode TSRMLS_CC); - } - php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC); - } -} -/* }}} end DOMText::__construct */ - -/* {{{ wholeText string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-wholeText -Since: DOM Level 3 -*/ -int dom_text_whole_text_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlNodePtr node; - xmlChar *wholetext = NULL; - - node = dom_object_get_node(obj); - - if (node == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); - return FAILURE; - } - - /* Find starting text node */ - while (node->prev && ((node->prev->type == XML_TEXT_NODE) || (node->prev->type == XML_CDATA_SECTION_NODE))) { - node = node->prev; - } - - /* concatenate all adjacent text and cdata nodes */ - while (node && ((node->type == XML_TEXT_NODE) || (node->type == XML_CDATA_SECTION_NODE))) { - wholetext = xmlStrcat(wholetext, node->content); - node = node->next; - } - - ALLOC_ZVAL(*retval); - if (wholetext != NULL) { - ZVAL_STRING(*retval, wholetext, 1); - xmlFree(wholetext); - } else { - ZVAL_EMPTY_STRING(*retval); - } - - return SUCCESS; -} - -/* }}} */ - - -/* {{{ proto DOMText dom_text_split_text(int offset); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-38853C1D -Since: -*/ -PHP_FUNCTION(dom_text_split_text) -{ - zval *id; - xmlChar *cur; - xmlChar *first; - xmlChar *second; - xmlNodePtr node; - xmlNodePtr nnode; - long offset; - int ret; - int length; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_text_class_entry, &offset) == FAILURE) { - return; - } - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - if (node->type != XML_TEXT_NODE) { - RETURN_FALSE; - } - - cur = xmlNodeGetContent(node); - if (cur == NULL) { - RETURN_FALSE; - } - length = xmlUTF8Strlen(cur); - - if (offset > length || offset < 0) { - xmlFree(cur); - RETURN_FALSE; - } - - first = xmlUTF8Strndup(cur, offset); - second = xmlUTF8Strsub(cur, offset, length - offset); - - xmlFree(cur); - - xmlNodeSetContent(node, first); - nnode = xmlNewDocText(node->doc, second); - - xmlFree(first); - xmlFree(second); - - if (nnode == NULL) { - RETURN_FALSE; - } - - if (node->parent != NULL) { - nnode->type = XML_ELEMENT_NODE; - xmlAddNextSibling(node, nnode); - nnode->type = XML_TEXT_NODE; - } - - return_value = php_dom_create_object(nnode, &ret, NULL, return_value, intern TSRMLS_CC); -} -/* }}} end dom_text_split_text */ - - -/* {{{ proto boolean dom_text_is_whitespace_in_element_content(); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-isWhitespaceInElementContent -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_text_is_whitespace_in_element_content) -{ - zval *id; - xmlNodePtr node; - dom_object *intern; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_text_class_entry) == FAILURE) { - return; - } - DOM_GET_OBJ(node, id, xmlNodePtr, intern); - - if (xmlIsBlankNode(node)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end dom_text_is_whitespace_in_element_content */ - - -/* {{{ proto DOMText dom_text_replace_whole_text(string content); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-replaceWholeText -Since: DOM Level 3 -*/ -PHP_FUNCTION(dom_text_replace_whole_text) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_text_replace_whole_text */ -#endif diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c deleted file mode 100644 index fbcdabb8a6ec0..0000000000000 --- a/ext/dom/typeinfo.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domtypeinfo -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_typeinfo_class_functions[] = { - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - -/* {{{ type_name string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeName -Since: -*/ -int dom_typeinfo_type_name_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - - - -/* {{{ type_namespace string -readonly=yes -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeNamespace -Since: -*/ -int dom_typeinfo_type_namespace_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - ALLOC_ZVAL(*retval); - ZVAL_NULL(*retval); - return SUCCESS; -} - -/* }}} */ - -#endif diff --git a/ext/dom/userdatahandler.c b/ext/dom/userdatahandler.c deleted file mode 100644 index b08ad374eef8e..0000000000000 --- a/ext/dom/userdatahandler.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - - -/* -* class domuserdatahandler -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#UserDataHandler -* Since: DOM Level 3 -*/ - -zend_function_entry php_dom_userdatahandler_class_functions[] = { - PHP_FALIAS(handle, dom_userdatahandler_handle, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ attribute protos, not implemented yet */ - - -/* {{{ proto dom_void dom_userdatahandler_handle(short operation, string key, domobject data, node src, node dst); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-handleUserDataEvent -Since: -*/ -PHP_FUNCTION(dom_userdatahandler_handle) -{ - DOM_NOT_IMPLEMENTED(); -} -/* }}} end dom_userdatahandler_handle */ -#endif diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h deleted file mode 100644 index 4193416218a6a..0000000000000 --- a/ext/dom/xml_common.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XML_COMMON_H -#define PHP_XML_COMMON_H - -#include "ext/libxml/php_libxml.h" - -typedef libxml_doc_props *dom_doc_propsptr; - -typedef struct _dom_object { - zend_object std; - void *ptr; - php_libxml_ref_obj *document; - HashTable *prop_handler; - zend_object_handle handle; -} dom_object; - -#ifdef PHP_WIN32 -#ifdef PHPAPI -#undef PHPAPI -#endif -#ifdef DOM_EXPORTS -#define PHPAPI __declspec(dllexport) -#else -#define PHPAPI __declspec(dllimport) -#endif /* DOM_EXPORTS */ -#endif /* PHP_WIN32 */ - -#define PHP_DOM_EXPORT PHPAPI - -PHP_DOM_EXPORT extern zend_class_entry *dom_node_class_entry; -PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj); -PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *in, zval* return_value, dom_object *domobj TSRMLS_DC); -PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj); - -#define DOM_XMLNS_NAMESPACE \ - (const xmlChar *) "http://www.w3.org/2000/xmlns/" - -#define NODE_GET_OBJ(__ptr, __id, __prtype, __intern) { \ - __intern = (php_libxml_node_object *)zend_object_store_get_object(__id TSRMLS_CC); \ - if (__intern->node == NULL || !(__ptr = (__prtype)__intern->node->node)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\ - RETURN_NULL();\ - } \ -} - -#define DOC_GET_OBJ(__ptr, __id, __prtype, __intern) { \ - __intern = (php_libxml_node_object *)zend_object_store_get_object(__id TSRMLS_CC); \ - if (__intern->document != NULL) { \ - if (!(__ptr = (__prtype)__intern->document->ptr)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\ - RETURN_NULL();\ - } \ - } \ -} - -#define DOM_RET_OBJ(zval, obj, ret, domobject) \ - if (NULL == (zval = php_dom_create_object(obj, ret, zval, return_value, domobject TSRMLS_CC))) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \ - RETURN_FALSE; \ - } - -#define DOM_GET_THIS(zval) \ - if (NULL == (zval = getThis())) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Underlying object missing"); \ - RETURN_FALSE; \ - } - -#define DOM_GET_THIS_OBJ(__ptr, __id, __prtype, __intern) \ - DOM_GET_THIS(__id); \ - DOM_GET_OBJ(__ptr, __id, __prtype, __intern); - -#endif diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c deleted file mode 100644 index 59a1d9279d6e9..0000000000000 --- a/ext/dom/xpath.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#if HAVE_LIBXML && HAVE_DOM -#include "php_dom.h" - -#define PHP_DOM_XPATH_QUERY 0 -#define PHP_DOM_XPATH_EVALUATE 1 - -/* -* class DOMXPath -*/ - -#if defined(LIBXML_XPATH_ENABLED) - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_register_ns, 0, 0, 2) - ZEND_ARG_INFO(0, prefix) - ZEND_ARG_INFO(0, uri) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_query, 0, 0, 1) - ZEND_ARG_INFO(0, expr) - ZEND_ARG_OBJ_INFO(0, context, DOMNode, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_xpath_evaluate, 0, 0, 1) - ZEND_ARG_INFO(0, expr) - ZEND_ARG_OBJ_INFO(0, context, DOMNode, 0) -ZEND_END_ARG_INFO(); -/* }}} */ - -zend_function_entry php_dom_xpath_class_functions[] = { - PHP_ME(domxpath, __construct, arginfo_dom_xpath_construct, ZEND_ACC_PUBLIC) - PHP_FALIAS(registerNamespace, dom_xpath_register_ns, arginfo_dom_xpath_register_ns) - PHP_FALIAS(query, dom_xpath_query, arginfo_dom_xpath_query) - PHP_FALIAS(evaluate, dom_xpath_evaluate, arginfo_dom_xpath_evaluate) - {NULL, NULL, NULL} -}; - -/* {{{ proto void DOMXPath::__construct(DOMDocument doc); */ -PHP_METHOD(domxpath, __construct) -{ - zval *id, *doc; - xmlDocPtr docp = NULL; - dom_object *docobj, *intern; - xmlXPathContextPtr ctx, oldctx; - - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) { - php_std_error_handling(); - return; - } - - php_std_error_handling(); - DOM_GET_OBJ(docp, doc, xmlDocPtr, docobj); - - ctx = xmlXPathNewContext(docp); - if (ctx == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC); - RETURN_FALSE; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL) { - oldctx = (xmlXPathContextPtr)intern->ptr; - if (oldctx != NULL) { - php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC); - xmlXPathFreeContext(oldctx); - } - intern->ptr = ctx; - intern->document = docobj->document; - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC); - } -} -/* }}} end DOMXPath::__construct */ - -/* {{{ document DOMDocument*/ -int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC) -{ - xmlDoc *docp = NULL; - xmlXPathContextPtr ctx; - int ret; - - ctx = (xmlXPathContextPtr) obj->ptr; - - if (ctx) { - docp = (xmlDocPtr) ctx->doc; - } - - ALLOC_ZVAL(*retval); - if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, NULL, *retval, obj TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); - return FAILURE; - } - return SUCCESS; -} - -/* {{{ proto boolean dom_xpath_register_ns(string prefix, string uri); */ -PHP_FUNCTION(dom_xpath_register_ns) -{ - zval *id; - xmlXPathContextPtr ctxp; - int prefix_len, ns_uri_len; - dom_object *intern; - unsigned char *prefix, *ns_uri; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_xpath_class_entry, &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) { - return; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - ctxp = (xmlXPathContextPtr) intern->ptr; - if (ctxp == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context"); - RETURN_FALSE; - } - - if (xmlXPathRegisterNs(ctxp, prefix, ns_uri) != 0) { - RETURN_FALSE - } - RETURN_TRUE; -} - -static void dom_xpath_iter(zval *baseobj, dom_object *intern) -{ - dom_nnodemap_object *mapptr; - - mapptr = (dom_nnodemap_object *)intern->ptr; - mapptr->baseobjptr = baseobj; - mapptr->nodetype = DOM_NODESET; - -} - -static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) { - zval *id, *retval, *context = NULL; - xmlXPathContextPtr ctxp; - xmlNodePtr nodep = NULL; - xmlXPathObjectPtr xpathobjp; - int expr_len, ret, nsnbr = 0, xpath_type; - dom_object *intern, *nodeobj; - char *expr; - xmlDoc *docp = NULL; - xmlNsPtr *ns; - - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|O", &id, dom_xpath_class_entry, &expr, &expr_len, &context, dom_node_class_entry) == FAILURE) { - return; - } - - intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); - - ctxp = (xmlXPathContextPtr) intern->ptr; - if (ctxp == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context"); - RETURN_FALSE; - } - - docp = (xmlDocPtr) ctxp->doc; - if (docp == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Document Pointer"); - RETURN_FALSE; - } - - if (context != NULL) { - DOM_GET_OBJ(nodep, context, xmlNodePtr, nodeobj); - } - - if (!nodep) { - nodep = xmlDocGetRootElement(docp); - } - - if (nodep && docp != nodep->doc) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node From Wrong Document"); - RETURN_FALSE; - } - - ctxp->node = nodep; - - /* Register namespaces in the node */ - ns = xmlGetNsList(docp, nodep); - - if (ns != NULL) { - while (ns[nsnbr] != NULL) - nsnbr++; - } - - - ctxp->namespaces = ns; - ctxp->nsNr = nsnbr; - - xpathobjp = xmlXPathEvalExpression(expr, ctxp); - ctxp->node = NULL; - - if (ns != NULL) { - xmlFree(ns); - ctxp->namespaces = NULL; - ctxp->nsNr = 0; - } - - if (! xpathobjp) { - RETURN_FALSE; - } - - if (type == PHP_DOM_XPATH_QUERY) { - xpath_type = XPATH_NODESET; - } else { - xpath_type = xpathobjp->type; - } - - switch (xpath_type) { - - case XPATH_NODESET: - { - int i; - xmlNodeSetPtr nodesetp; - - MAKE_STD_ZVAL(retval); - array_init(retval); - - if (xpathobjp->type == XPATH_NODESET && NULL != (nodesetp = xpathobjp->nodesetval)) { - - for (i = 0; i < nodesetp->nodeNr; i++) { - xmlNodePtr node = nodesetp->nodeTab[i]; - zval *child; - - MAKE_STD_ZVAL(child); - - if (node->type == XML_NAMESPACE_DECL) { - xmlNsPtr curns; - xmlNodePtr nsparent; - - nsparent = node->_private; - curns = xmlNewNs(NULL, node->name, NULL); - if (node->children) { - curns->prefix = xmlStrdup((char *) node->children); - } - if (node->children) { - node = xmlNewDocNode(docp, NULL, (char *) node->children, node->name); - } else { - node = xmlNewDocNode(docp, NULL, "xmlns", node->name); - } - node->type = XML_NAMESPACE_DECL; - node->parent = nsparent; - node->ns = curns; - } - child = php_dom_create_object(node, &ret, NULL, child, intern TSRMLS_CC); - add_next_index_zval(retval, child); - } - } - php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC); - intern = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC); - dom_xpath_iter(retval, intern); - break; - } - - case XPATH_BOOLEAN: - RETVAL_BOOL(xpathobjp->boolval); - break; - - case XPATH_NUMBER: - RETVAL_DOUBLE(xpathobjp->floatval) - break; - - case XPATH_STRING: - RETVAL_STRING(xpathobjp->stringval, 1); - break; - - default: - RETVAL_NULL(); - break; - } - - xmlXPathFreeObject(xpathobjp); -} - -/* {{{ proto DOMNodeList dom_xpath_query(string expr [,DOMNode context]); */ -PHP_FUNCTION(dom_xpath_query) -{ - php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_QUERY); -} -/* }}} end dom_xpath_query */ - -/* {{{ proto mixed dom_xpath_evaluate(string expr [,DOMNode context]); */ -PHP_FUNCTION(dom_xpath_evaluate) -{ - php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_EVALUATE); -} -/* }}} end dom_xpath_evaluate */ - -#endif /* LIBXML_XPATH_ENABLED */ - -/* }}} */ -#endif diff --git a/ext/exif/CREDITS b/ext/exif/CREDITS deleted file mode 100644 index 94de97e5b09f1..0000000000000 --- a/ext/exif/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -EXIF -Rasmus Lerdorf, Marcus Boerger diff --git a/ext/exif/config.m4 b/ext/exif/config.m4 deleted file mode 100644 index a3ba9240df595..0000000000000 --- a/ext/exif/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(exif, whether to enable EXIF (metadata from images) support, -[ --enable-exif Enable EXIF (metadata from images) support]) - -if test "$PHP_EXIF" != "no"; then - AC_DEFINE(HAVE_EXIF, 1, [Whether you want EXIF (metadata from images) support]) - PHP_NEW_EXTENSION(exif, exif.c, $ext_shared) -fi diff --git a/ext/exif/config.w32 b/ext/exif/config.w32 deleted file mode 100644 index 3ac0108f2d006..0000000000000 --- a/ext/exif/config.w32 +++ /dev/null @@ -1,10 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("exif", "exif", "no"); - -if (PHP_EXIF == "yes") { - EXTENSION("exif", "exif.c"); - AC_DEFINE('HAVE_EXIF', 1, 'Have exif'); - ADD_EXTENSION_DEP('exif', 'mbstring'); -} diff --git a/ext/exif/example.php b/ext/exif/example.php deleted file mode 100644 index e34dc05f6d4cc..0000000000000 --- a/ext/exif/example.php +++ /dev/null @@ -1,23 +0,0 @@ - - - -exif_read_data example - - -\n" : "Image contains headers
"; -$exif = exif_read_data ('tests/test2.jpg',0,true); -foreach($exif as $key=>$section) { - foreach($section as $name=>$val) { - echo "$key.$name: $val
\n"; - } -} -?> - - \ No newline at end of file diff --git a/ext/exif/exif.c b/ext/exif/exif.c deleted file mode 100644 index cba20b899c030..0000000000000 --- a/ext/exif/exif.c +++ /dev/null @@ -1,4207 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* ToDos - * - * See if example images from http://www.exif.org have illegal - * thumbnail sizes or if code is corrupt. - * Create/Update exif headers. - * Create/Remove/Update image thumbnails. - */ - -/* Security - * - * At current time i do not see any security problems but a potential - * attacker could generate an image with recursive ifd pointers...(Marcus) - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/file.h" - -#if HAVE_EXIF - -/* When EXIF_DEBUG is defined the module generates a lot of debug messages - * that help understanding what is going on. This can and should be used - * while extending the module as it shows if you are at the right position. - * You are always considered to have a copy of TIFF6.0 and EXIF2.10 standard. - */ -#undef EXIF_DEBUG - -#ifdef EXIF_DEBUG -#define EXIFERR_DC , const char *_file, size_t _line TSRMLS_DC -#define EXIFERR_CC , __FILE__, __LINE__ TSRMLS_CC -#else -#define EXIFERR_DC TSRMLS_DC -#define EXIFERR_CC TSRMLS_CC -#endif - -#undef EXIF_JPEG2000 - -#include "php_exif.h" -#include -#include "php_ini.h" -#include "ext/standard/php_string.h" -#include "ext/standard/php_image.h" -#include "ext/standard/info.h" - -#if defined(PHP_WIN32) || (HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)) -#define EXIF_USE_MBSTRING 1 -#else -#define EXIF_USE_MBSTRING 0 -#endif - -#if EXIF_USE_MBSTRING -#include "ext/mbstring/mbstring.h" -#endif - -/* needed for ssize_t definition */ -#include - -typedef unsigned char uchar; - -#ifndef safe_emalloc -# define safe_emalloc(a,b,c) emalloc((a)*(b)+(c)) -#endif -#ifndef safe_erealloc -# define safe_erealloc(p,a,b,c) erealloc(p, (a)*(b)+(c)) -#endif - -#ifndef TRUE -# define TRUE 1 -# define FALSE 0 -#endif - -#ifndef max -# define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -#define EFREE_IF(ptr) if (ptr) efree(ptr) - -#define MAX_IFD_NESTING_LEVEL 100 - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO(arginfo_exif_tagname, 0) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_exif_read_data, 0, 0, 1) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, sections_needed) - ZEND_ARG_INFO(0, sub_arrays) - ZEND_ARG_INFO(0, read_thumbnail) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_exif_thumbnail, 0, 0, 1) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(1, width) - ZEND_ARG_INFO(1, height) - ZEND_ARG_INFO(1, imagetype) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_exif_imagetype, 0) - ZEND_ARG_INFO(0, imagefile) -ZEND_END_ARG_INFO() - -/* }}} */ - -/* {{{ exif_functions[] - */ -zend_function_entry exif_functions[] = { - PHP_FE(exif_read_data, arginfo_exif_read_data) - PHP_FALIAS(read_exif_data, exif_read_data, arginfo_exif_read_data) - PHP_FE(exif_tagname, arginfo_exif_tagname) - PHP_FE(exif_thumbnail, arginfo_exif_thumbnail) - PHP_FE(exif_imagetype, arginfo_exif_imagetype) - {NULL, NULL, NULL} -}; -/* }}} */ - -#define EXIF_VERSION "1.4 $Id$" - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(exif) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "EXIF Support", "enabled"); - php_info_print_table_row(2, "EXIF Version", EXIF_VERSION); - php_info_print_table_row(2, "Supported EXIF Version", "0220"); - php_info_print_table_row(2, "Supported filetypes", "JPEG,TIFF"); - php_info_print_table_end(); -} -/* }}} */ - -ZEND_BEGIN_MODULE_GLOBALS(exif) - char * encode_unicode; - char * decode_unicode_be; - char * decode_unicode_le; - char * encode_jis; - char * decode_jis_be; - char * decode_jis_le; -ZEND_END_MODULE_GLOBALS(exif) - -ZEND_DECLARE_MODULE_GLOBALS(exif) - -#ifdef ZTS -#define EXIF_G(v) TSRMG(exif_globals_id, zend_exif_globals *, v) -#else -#define EXIF_G(v) (exif_globals.v) -#endif - -/* {{{ PHP_INI - */ - -ZEND_INI_MH(OnUpdateEncode) -{ -#if EXIF_USE_MBSTRING - if (new_value && strlen(new_value) && !php_mb_check_encoding_list(new_value TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value); - return FAILURE; - } -#endif - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); -} - -ZEND_INI_MH(OnUpdateDecode) -{ -#if EXIF_USE_MBSTRING - if (!php_mb_check_encoding_list(new_value TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value); - return FAILURE; - } -#endif - return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("exif.encode_unicode", "ISO-8859-15", PHP_INI_ALL, OnUpdateEncode, encode_unicode, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.decode_unicode_motorola", "UCS-2BE", PHP_INI_ALL, OnUpdateDecode, decode_unicode_be, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.decode_unicode_intel", "UCS-2LE", PHP_INI_ALL, OnUpdateDecode, decode_unicode_le, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.encode_jis", "", PHP_INI_ALL, OnUpdateEncode, encode_jis, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.decode_jis_motorola", "JIS", PHP_INI_ALL, OnUpdateDecode, decode_jis_be, zend_exif_globals, exif_globals) - STD_PHP_INI_ENTRY("exif.decode_jis_intel", "JIS", PHP_INI_ALL, OnUpdateDecode, decode_jis_le, zend_exif_globals, exif_globals) -PHP_INI_END() -/* }}} */ - -/* {{{ PHP_GINIT_FUNCTION - */ -static PHP_GINIT_FUNCTION(exif) -{ - exif_globals->encode_unicode = NULL; - exif_globals->decode_unicode_be = NULL; - exif_globals->decode_unicode_le = NULL; - exif_globals->encode_jis = NULL; - exif_globals->decode_jis_be = NULL; - exif_globals->decode_jis_le = NULL; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION(exif) - Get the size of an image as 4-element array */ -PHP_MINIT_FUNCTION(exif) -{ - REGISTER_INI_ENTRIES(); - REGISTER_LONG_CONSTANT("EXIF_USE_MBSTRING", EXIF_USE_MBSTRING, CONST_CS | CONST_PERSISTENT); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(exif) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ exif dependencies */ -static zend_module_dep exif_module_deps[] = { - ZEND_MOD_REQUIRED("standard") -#if EXIF_USE_MBSTRING - ZEND_MOD_REQUIRED("mbstring") -#endif - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ exif_module_entry - */ -zend_module_entry exif_module_entry = { - STANDARD_MODULE_HEADER_EX, NULL, - exif_module_deps, - "exif", - exif_functions, - PHP_MINIT(exif), - PHP_MSHUTDOWN(exif), - NULL, NULL, - PHP_MINFO(exif), -#if ZEND_MODULE_API_NO >= 20010901 - EXIF_VERSION, -#endif -#if ZEND_MODULE_API_NO >= 20060613 - PHP_MODULE_GLOBALS(exif), - PHP_GINIT(exif), - NULL, - NULL, - STANDARD_MODULE_PROPERTIES_EX -#else - STANDARD_MODULE_PROPERTIES -#endif -}; -/* }}} */ - -#ifdef COMPILE_DL_EXIF -ZEND_GET_MODULE(exif) -#endif - -/* {{{ php_strnlen - * get length of string if buffer if less than buffer size or buffer size */ -static size_t php_strnlen(char* str, size_t maxlen) { - size_t len = 0; - - if (str && maxlen && *str) { - do { - len++; - } while (--maxlen && *(++str)); - } - return len; -} -/* }}} */ - -/* {{{ error messages -*/ -static const char * EXIF_ERROR_FILEEOF = "Unexpected end of file reached"; -static const char * EXIF_ERROR_CORRUPT = "File structure corrupted"; -static const char * EXIF_ERROR_THUMBEOF = "Thumbnail goes IFD boundary or end of file reached"; -static const char * EXIF_ERROR_FSREALLOC = "Illegal reallocating of undefined file section"; - -#define EXIF_ERRLOG_FILEEOF(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_FILEEOF); -#define EXIF_ERRLOG_CORRUPT(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_CORRUPT); -#define EXIF_ERRLOG_THUMBEOF(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_THUMBEOF); -#define EXIF_ERRLOG_FSREALLOC(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_FSREALLOC); -/* }}} */ - -/* {{{ format description defines - Describes format descriptor -*/ -static int php_tiff_bytes_per_format[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 1}; -#define NUM_FORMATS 13 - -#define TAG_FMT_BYTE 1 -#define TAG_FMT_STRING 2 -#define TAG_FMT_USHORT 3 -#define TAG_FMT_ULONG 4 -#define TAG_FMT_URATIONAL 5 -#define TAG_FMT_SBYTE 6 -#define TAG_FMT_UNDEFINED 7 -#define TAG_FMT_SSHORT 8 -#define TAG_FMT_SLONG 9 -#define TAG_FMT_SRATIONAL 10 -#define TAG_FMT_SINGLE 11 -#define TAG_FMT_DOUBLE 12 -#define TAG_FMT_IFD 13 - -#ifdef EXIF_DEBUG -static char *exif_get_tagformat(int format) -{ - switch(format) { - case TAG_FMT_BYTE: return "BYTE"; - case TAG_FMT_STRING: return "STRING"; - case TAG_FMT_USHORT: return "USHORT"; - case TAG_FMT_ULONG: return "ULONG"; - case TAG_FMT_URATIONAL: return "URATIONAL"; - case TAG_FMT_SBYTE: return "SBYTE"; - case TAG_FMT_UNDEFINED: return "UNDEFINED"; - case TAG_FMT_SSHORT: return "SSHORT"; - case TAG_FMT_SLONG: return "SLONG"; - case TAG_FMT_SRATIONAL: return "SRATIONAL"; - case TAG_FMT_SINGLE: return "SINGLE"; - case TAG_FMT_DOUBLE: return "DOUBLE"; - case TAG_FMT_IFD: return "IFD"; - } - return "*Illegal"; -} -#endif - -/* Describes tag values */ -#define TAG_GPS_VERSION_ID 0x0000 -#define TAG_GPS_LATITUDE_REF 0x0001 -#define TAG_GPS_LATITUDE 0x0002 -#define TAG_GPS_LONGITUDE_REF 0x0003 -#define TAG_GPS_LONGITUDE 0x0004 -#define TAG_GPS_ALTITUDE_REF 0x0005 -#define TAG_GPS_ALTITUDE 0x0006 -#define TAG_GPS_TIME_STAMP 0x0007 -#define TAG_GPS_SATELLITES 0x0008 -#define TAG_GPS_STATUS 0x0009 -#define TAG_GPS_MEASURE_MODE 0x000A -#define TAG_GPS_DOP 0x000B -#define TAG_GPS_SPEED_REF 0x000C -#define TAG_GPS_SPEED 0x000D -#define TAG_GPS_TRACK_REF 0x000E -#define TAG_GPS_TRACK 0x000F -#define TAG_GPS_IMG_DIRECTION_REF 0x0010 -#define TAG_GPS_IMG_DIRECTION 0x0011 -#define TAG_GPS_MAP_DATUM 0x0012 -#define TAG_GPS_DEST_LATITUDE_REF 0x0013 -#define TAG_GPS_DEST_LATITUDE 0x0014 -#define TAG_GPS_DEST_LONGITUDE_REF 0x0015 -#define TAG_GPS_DEST_LONGITUDE 0x0016 -#define TAG_GPS_DEST_BEARING_REF 0x0017 -#define TAG_GPS_DEST_BEARING 0x0018 -#define TAG_GPS_DEST_DISTANCE_REF 0x0019 -#define TAG_GPS_DEST_DISTANCE 0x001A -#define TAG_GPS_PROCESSING_METHOD 0x001B -#define TAG_GPS_AREA_INFORMATION 0x001C -#define TAG_GPS_DATE_STAMP 0x001D -#define TAG_GPS_DIFFERENTIAL 0x001E -#define TAG_TIFF_COMMENT 0x00FE /* SHOUDLNT HAPPEN */ -#define TAG_NEW_SUBFILE 0x00FE /* New version of subfile tag */ -#define TAG_SUBFILE_TYPE 0x00FF /* Old version of subfile tag */ -#define TAG_IMAGEWIDTH 0x0100 -#define TAG_IMAGEHEIGHT 0x0101 -#define TAG_BITS_PER_SAMPLE 0x0102 -#define TAG_COMPRESSION 0x0103 -#define TAG_PHOTOMETRIC_INTERPRETATION 0x0106 -#define TAG_TRESHHOLDING 0x0107 -#define TAG_CELL_WIDTH 0x0108 -#define TAG_CELL_HEIGHT 0x0109 -#define TAG_FILL_ORDER 0x010A -#define TAG_DOCUMENT_NAME 0x010D -#define TAG_IMAGE_DESCRIPTION 0x010E -#define TAG_MAKE 0x010F -#define TAG_MODEL 0x0110 -#define TAG_STRIP_OFFSETS 0x0111 -#define TAG_ORIENTATION 0x0112 -#define TAG_SAMPLES_PER_PIXEL 0x0115 -#define TAG_ROWS_PER_STRIP 0x0116 -#define TAG_STRIP_BYTE_COUNTS 0x0117 -#define TAG_MIN_SAMPPLE_VALUE 0x0118 -#define TAG_MAX_SAMPLE_VALUE 0x0119 -#define TAG_X_RESOLUTION 0x011A -#define TAG_Y_RESOLUTION 0x011B -#define TAG_PLANAR_CONFIGURATION 0x011C -#define TAG_PAGE_NAME 0x011D -#define TAG_X_POSITION 0x011E -#define TAG_Y_POSITION 0x011F -#define TAG_FREE_OFFSETS 0x0120 -#define TAG_FREE_BYTE_COUNTS 0x0121 -#define TAG_GRAY_RESPONSE_UNIT 0x0122 -#define TAG_GRAY_RESPONSE_CURVE 0x0123 -#define TAG_RESOLUTION_UNIT 0x0128 -#define TAG_PAGE_NUMBER 0x0129 -#define TAG_TRANSFER_FUNCTION 0x012D -#define TAG_SOFTWARE 0x0131 -#define TAG_DATETIME 0x0132 -#define TAG_ARTIST 0x013B -#define TAG_HOST_COMPUTER 0x013C -#define TAG_PREDICTOR 0x013D -#define TAG_WHITE_POINT 0x013E -#define TAG_PRIMARY_CHROMATICITIES 0x013F -#define TAG_COLOR_MAP 0x0140 -#define TAG_HALFTONE_HINTS 0x0141 -#define TAG_TILE_WIDTH 0x0142 -#define TAG_TILE_LENGTH 0x0143 -#define TAG_TILE_OFFSETS 0x0144 -#define TAG_TILE_BYTE_COUNTS 0x0145 -#define TAG_SUB_IFD 0x014A -#define TAG_INK_SETMPUTER 0x014C -#define TAG_INK_NAMES 0x014D -#define TAG_NUMBER_OF_INKS 0x014E -#define TAG_DOT_RANGE 0x0150 -#define TAG_TARGET_PRINTER 0x0151 -#define TAG_EXTRA_SAMPLE 0x0152 -#define TAG_SAMPLE_FORMAT 0x0153 -#define TAG_S_MIN_SAMPLE_VALUE 0x0154 -#define TAG_S_MAX_SAMPLE_VALUE 0x0155 -#define TAG_TRANSFER_RANGE 0x0156 -#define TAG_JPEG_TABLES 0x015B -#define TAG_JPEG_PROC 0x0200 -#define TAG_JPEG_INTERCHANGE_FORMAT 0x0201 -#define TAG_JPEG_INTERCHANGE_FORMAT_LEN 0x0202 -#define TAG_JPEG_RESTART_INTERVAL 0x0203 -#define TAG_JPEG_LOSSLESS_PREDICTOR 0x0205 -#define TAG_JPEG_POINT_TRANSFORMS 0x0206 -#define TAG_JPEG_Q_TABLES 0x0207 -#define TAG_JPEG_DC_TABLES 0x0208 -#define TAG_JPEG_AC_TABLES 0x0209 -#define TAG_YCC_COEFFICIENTS 0x0211 -#define TAG_YCC_SUB_SAMPLING 0x0212 -#define TAG_YCC_POSITIONING 0x0213 -#define TAG_REFERENCE_BLACK_WHITE 0x0214 -/* 0x0301 - 0x0302 */ -/* 0x0320 */ -/* 0x0343 */ -/* 0x5001 - 0x501B */ -/* 0x5021 - 0x503B */ -/* 0x5090 - 0x5091 */ -/* 0x5100 - 0x5101 */ -/* 0x5110 - 0x5113 */ -/* 0x80E3 - 0x80E6 */ -/* 0x828d - 0x828F */ -#define TAG_COPYRIGHT 0x8298 -#define TAG_EXPOSURETIME 0x829A -#define TAG_FNUMBER 0x829D -#define TAG_EXIF_IFD_POINTER 0x8769 -#define TAG_ICC_PROFILE 0x8773 -#define TAG_EXPOSURE_PROGRAM 0x8822 -#define TAG_SPECTRAL_SENSITY 0x8824 -#define TAG_GPS_IFD_POINTER 0x8825 -#define TAG_ISOSPEED 0x8827 -#define TAG_OPTOELECTRIC_CONVERSION_F 0x8828 -/* 0x8829 - 0x882b */ -#define TAG_EXIFVERSION 0x9000 -#define TAG_DATE_TIME_ORIGINAL 0x9003 -#define TAG_DATE_TIME_DIGITIZED 0x9004 -#define TAG_COMPONENT_CONFIG 0x9101 -#define TAG_COMPRESSED_BITS_PER_PIXEL 0x9102 -#define TAG_SHUTTERSPEED 0x9201 -#define TAG_APERTURE 0x9202 -#define TAG_BRIGHTNESS_VALUE 0x9203 -#define TAG_EXPOSURE_BIAS_VALUE 0x9204 -#define TAG_MAX_APERTURE 0x9205 -#define TAG_SUBJECT_DISTANCE 0x9206 -#define TAG_METRIC_MODULE 0x9207 -#define TAG_LIGHT_SOURCE 0x9208 -#define TAG_FLASH 0x9209 -#define TAG_FOCAL_LENGTH 0x920A -/* 0x920B - 0x920D */ -/* 0x9211 - 0x9216 */ -#define TAG_SUBJECT_AREA 0x9214 -#define TAG_MAKER_NOTE 0x927C -#define TAG_USERCOMMENT 0x9286 -#define TAG_SUB_SEC_TIME 0x9290 -#define TAG_SUB_SEC_TIME_ORIGINAL 0x9291 -#define TAG_SUB_SEC_TIME_DIGITIZED 0x9292 -/* 0x923F */ -/* 0x935C */ -#define TAG_XP_TITLE 0x9C9B -#define TAG_XP_COMMENTS 0x9C9C -#define TAG_XP_AUTHOR 0x9C9D -#define TAG_XP_KEYWORDS 0x9C9E -#define TAG_XP_SUBJECT 0x9C9F -#define TAG_FLASH_PIX_VERSION 0xA000 -#define TAG_COLOR_SPACE 0xA001 -#define TAG_COMP_IMAGE_WIDTH 0xA002 /* compressed images only */ -#define TAG_COMP_IMAGE_HEIGHT 0xA003 -#define TAG_RELATED_SOUND_FILE 0xA004 -#define TAG_INTEROP_IFD_POINTER 0xA005 /* IFD pointer */ -#define TAG_FLASH_ENERGY 0xA20B -#define TAG_SPATIAL_FREQUENCY_RESPONSE 0xA20C -#define TAG_FOCALPLANE_X_RES 0xA20E -#define TAG_FOCALPLANE_Y_RES 0xA20F -#define TAG_FOCALPLANE_RESOLUTION_UNIT 0xA210 -#define TAG_SUBJECT_LOCATION 0xA214 -#define TAG_EXPOSURE_INDEX 0xA215 -#define TAG_SENSING_METHOD 0xA217 -#define TAG_FILE_SOURCE 0xA300 -#define TAG_SCENE_TYPE 0xA301 -#define TAG_CFA_PATTERN 0xA302 -#define TAG_CUSTOM_RENDERED 0xA401 -#define TAG_EXPOSURE_MODE 0xA402 -#define TAG_WHITE_BALANCE 0xA403 -#define TAG_DIGITAL_ZOOM_RATIO 0xA404 -#define TAG_FOCAL_LENGTH_IN_35_MM_FILM 0xA405 -#define TAG_SCENE_CAPTURE_TYPE 0xA406 -#define TAG_GAIN_CONTROL 0xA407 -#define TAG_CONTRAST 0xA408 -#define TAG_SATURATION 0xA409 -#define TAG_SHARPNESS 0xA40A -#define TAG_DEVICE_SETTING_DESCRIPTION 0xA40B -#define TAG_SUBJECT_DISTANCE_RANGE 0xA40C -#define TAG_IMAGE_UNIQUE_ID 0xA420 - -/* Olympus specific tags */ -#define TAG_OLYMPUS_SPECIALMODE 0x0200 -#define TAG_OLYMPUS_JPEGQUAL 0x0201 -#define TAG_OLYMPUS_MACRO 0x0202 -#define TAG_OLYMPUS_DIGIZOOM 0x0204 -#define TAG_OLYMPUS_SOFTWARERELEASE 0x0207 -#define TAG_OLYMPUS_PICTINFO 0x0208 -#define TAG_OLYMPUS_CAMERAID 0x0209 -/* end Olympus specific tags */ - -/* Internal */ -#define TAG_NONE -1 /* note that -1 <> 0xFFFF */ -#define TAG_COMPUTED_VALUE -2 -#define TAG_END_OF_LIST 0xFFFD - -/* Values for TAG_PHOTOMETRIC_INTERPRETATION */ -#define PMI_BLACK_IS_ZERO 0 -#define PMI_WHITE_IS_ZERO 1 -#define PMI_RGB 2 -#define PMI_PALETTE_COLOR 3 -#define PMI_TRANSPARENCY_MASK 4 -#define PMI_SEPARATED 5 -#define PMI_YCBCR 6 -#define PMI_CIELAB 8 - -/* }}} */ - -/* {{{ TabTable[] - */ -typedef const struct { - unsigned short Tag; - char *Desc; -} tag_info_type; - -typedef tag_info_type tag_info_array[]; -typedef tag_info_type *tag_table_type; - -#define TAG_TABLE_END \ - {TAG_NONE, "No tag value"},\ - {TAG_COMPUTED_VALUE, "Computed value"},\ - {TAG_END_OF_LIST, ""} /* Important for exif_get_tagname() IF value != "" function result is != false */ - -static tag_info_array tag_table_IFD = { - { 0x000B, "ACDComment"}, - { 0x00FE, "NewSubFile"}, /* better name it 'ImageType' ? */ - { 0x00FF, "SubFile"}, - { 0x0100, "ImageWidth"}, - { 0x0101, "ImageLength"}, - { 0x0102, "BitsPerSample"}, - { 0x0103, "Compression"}, - { 0x0106, "PhotometricInterpretation"}, - { 0x010A, "FillOrder"}, - { 0x010D, "DocumentName"}, - { 0x010E, "ImageDescription"}, - { 0x010F, "Make"}, - { 0x0110, "Model"}, - { 0x0111, "StripOffsets"}, - { 0x0112, "Orientation"}, - { 0x0115, "SamplesPerPixel"}, - { 0x0116, "RowsPerStrip"}, - { 0x0117, "StripByteCounts"}, - { 0x0118, "MinSampleValue"}, - { 0x0119, "MaxSampleValue"}, - { 0x011A, "XResolution"}, - { 0x011B, "YResolution"}, - { 0x011C, "PlanarConfiguration"}, - { 0x011D, "PageName"}, - { 0x011E, "XPosition"}, - { 0x011F, "YPosition"}, - { 0x0120, "FreeOffsets"}, - { 0x0121, "FreeByteCounts"}, - { 0x0122, "GrayResponseUnit"}, - { 0x0123, "GrayResponseCurve"}, - { 0x0124, "T4Options"}, - { 0x0125, "T6Options"}, - { 0x0128, "ResolutionUnit"}, - { 0x0129, "PageNumber"}, - { 0x012D, "TransferFunction"}, - { 0x0131, "Software"}, - { 0x0132, "DateTime"}, - { 0x013B, "Artist"}, - { 0x013C, "HostComputer"}, - { 0x013D, "Predictor"}, - { 0x013E, "WhitePoint"}, - { 0x013F, "PrimaryChromaticities"}, - { 0x0140, "ColorMap"}, - { 0x0141, "HalfToneHints"}, - { 0x0142, "TileWidth"}, - { 0x0143, "TileLength"}, - { 0x0144, "TileOffsets"}, - { 0x0145, "TileByteCounts"}, - { 0x014A, "SubIFD"}, - { 0x014C, "InkSet"}, - { 0x014D, "InkNames"}, - { 0x014E, "NumberOfInks"}, - { 0x0150, "DotRange"}, - { 0x0151, "TargetPrinter"}, - { 0x0152, "ExtraSample"}, - { 0x0153, "SampleFormat"}, - { 0x0154, "SMinSampleValue"}, - { 0x0155, "SMaxSampleValue"}, - { 0x0156, "TransferRange"}, - { 0x0157, "ClipPath"}, - { 0x0158, "XClipPathUnits"}, - { 0x0159, "YClipPathUnits"}, - { 0x015A, "Indexed"}, - { 0x015B, "JPEGTables"}, - { 0x015F, "OPIProxy"}, - { 0x0200, "JPEGProc"}, - { 0x0201, "JPEGInterchangeFormat"}, - { 0x0202, "JPEGInterchangeFormatLength"}, - { 0x0203, "JPEGRestartInterval"}, - { 0x0205, "JPEGLosslessPredictors"}, - { 0x0206, "JPEGPointTransforms"}, - { 0x0207, "JPEGQTables"}, - { 0x0208, "JPEGDCTables"}, - { 0x0209, "JPEGACTables"}, - { 0x0211, "YCbCrCoefficients"}, - { 0x0212, "YCbCrSubSampling"}, - { 0x0213, "YCbCrPositioning"}, - { 0x0214, "ReferenceBlackWhite"}, - { 0x02BC, "ExtensibleMetadataPlatform"}, /* XAP: Extensible Authoring Publishing, obsoleted by XMP: Extensible Metadata Platform */ - { 0x0301, "Gamma"}, - { 0x0302, "ICCProfileDescriptor"}, - { 0x0303, "SRGBRenderingIntent"}, - { 0x0320, "ImageTitle"}, - { 0x5001, "ResolutionXUnit"}, - { 0x5002, "ResolutionYUnit"}, - { 0x5003, "ResolutionXLengthUnit"}, - { 0x5004, "ResolutionYLengthUnit"}, - { 0x5005, "PrintFlags"}, - { 0x5006, "PrintFlagsVersion"}, - { 0x5007, "PrintFlagsCrop"}, - { 0x5008, "PrintFlagsBleedWidth"}, - { 0x5009, "PrintFlagsBleedWidthScale"}, - { 0x500A, "HalftoneLPI"}, - { 0x500B, "HalftoneLPIUnit"}, - { 0x500C, "HalftoneDegree"}, - { 0x500D, "HalftoneShape"}, - { 0x500E, "HalftoneMisc"}, - { 0x500F, "HalftoneScreen"}, - { 0x5010, "JPEGQuality"}, - { 0x5011, "GridSize"}, - { 0x5012, "ThumbnailFormat"}, - { 0x5013, "ThumbnailWidth"}, - { 0x5014, "ThumbnailHeight"}, - { 0x5015, "ThumbnailColorDepth"}, - { 0x5016, "ThumbnailPlanes"}, - { 0x5017, "ThumbnailRawBytes"}, - { 0x5018, "ThumbnailSize"}, - { 0x5019, "ThumbnailCompressedSize"}, - { 0x501A, "ColorTransferFunction"}, - { 0x501B, "ThumbnailData"}, - { 0x5020, "ThumbnailImageWidth"}, - { 0x5021, "ThumbnailImageHeight"}, - { 0x5022, "ThumbnailBitsPerSample"}, - { 0x5023, "ThumbnailCompression"}, - { 0x5024, "ThumbnailPhotometricInterp"}, - { 0x5025, "ThumbnailImageDescription"}, - { 0x5026, "ThumbnailEquipMake"}, - { 0x5027, "ThumbnailEquipModel"}, - { 0x5028, "ThumbnailStripOffsets"}, - { 0x5029, "ThumbnailOrientation"}, - { 0x502A, "ThumbnailSamplesPerPixel"}, - { 0x502B, "ThumbnailRowsPerStrip"}, - { 0x502C, "ThumbnailStripBytesCount"}, - { 0x502D, "ThumbnailResolutionX"}, - { 0x502E, "ThumbnailResolutionY"}, - { 0x502F, "ThumbnailPlanarConfig"}, - { 0x5030, "ThumbnailResolutionUnit"}, - { 0x5031, "ThumbnailTransferFunction"}, - { 0x5032, "ThumbnailSoftwareUsed"}, - { 0x5033, "ThumbnailDateTime"}, - { 0x5034, "ThumbnailArtist"}, - { 0x5035, "ThumbnailWhitePoint"}, - { 0x5036, "ThumbnailPrimaryChromaticities"}, - { 0x5037, "ThumbnailYCbCrCoefficients"}, - { 0x5038, "ThumbnailYCbCrSubsampling"}, - { 0x5039, "ThumbnailYCbCrPositioning"}, - { 0x503A, "ThumbnailRefBlackWhite"}, - { 0x503B, "ThumbnailCopyRight"}, - { 0x5090, "LuminanceTable"}, - { 0x5091, "ChrominanceTable"}, - { 0x5100, "FrameDelay"}, - { 0x5101, "LoopCount"}, - { 0x5110, "PixelUnit"}, - { 0x5111, "PixelPerUnitX"}, - { 0x5112, "PixelPerUnitY"}, - { 0x5113, "PaletteHistogram"}, - { 0x1000, "RelatedImageFileFormat"}, - { 0x800D, "ImageID"}, - { 0x80E3, "Matteing"}, /* obsoleted by ExtraSamples */ - { 0x80E4, "DataType"}, /* obsoleted by SampleFormat */ - { 0x80E5, "ImageDepth"}, - { 0x80E6, "TileDepth"}, - { 0x828D, "CFARepeatPatternDim"}, - { 0x828E, "CFAPattern"}, - { 0x828F, "BatteryLevel"}, - { 0x8298, "Copyright"}, - { 0x829A, "ExposureTime"}, - { 0x829D, "FNumber"}, - { 0x83BB, "IPTC/NAA"}, - { 0x84E3, "IT8RasterPadding"}, - { 0x84E5, "IT8ColorTable"}, - { 0x8649, "ImageResourceInformation"}, /* PhotoShop */ - { 0x8769, "Exif_IFD_Pointer"}, - { 0x8773, "ICC_Profile"}, - { 0x8822, "ExposureProgram"}, - { 0x8824, "SpectralSensity"}, - { 0x8828, "OECF"}, - { 0x8825, "GPS_IFD_Pointer"}, - { 0x8827, "ISOSpeedRatings"}, - { 0x8828, "OECF"}, - { 0x9000, "ExifVersion"}, - { 0x9003, "DateTimeOriginal"}, - { 0x9004, "DateTimeDigitized"}, - { 0x9101, "ComponentsConfiguration"}, - { 0x9102, "CompressedBitsPerPixel"}, - { 0x9201, "ShutterSpeedValue"}, - { 0x9202, "ApertureValue"}, - { 0x9203, "BrightnessValue"}, - { 0x9204, "ExposureBiasValue"}, - { 0x9205, "MaxApertureValue"}, - { 0x9206, "SubjectDistance"}, - { 0x9207, "MeteringMode"}, - { 0x9208, "LightSource"}, - { 0x9209, "Flash"}, - { 0x920A, "FocalLength"}, - { 0x920B, "FlashEnergy"}, /* 0xA20B in JPEG */ - { 0x920C, "SpatialFrequencyResponse"}, /* 0xA20C - - */ - { 0x920D, "Noise"}, - { 0x920E, "FocalPlaneXResolution"}, /* 0xA20E - - */ - { 0x920F, "FocalPlaneYResolution"}, /* 0xA20F - - */ - { 0x9210, "FocalPlaneResolutionUnit"}, /* 0xA210 - - */ - { 0x9211, "ImageNumber"}, - { 0x9212, "SecurityClassification"}, - { 0x9213, "ImageHistory"}, - { 0x9214, "SubjectLocation"}, /* 0xA214 - - */ - { 0x9215, "ExposureIndex"}, /* 0xA215 - - */ - { 0x9216, "TIFF/EPStandardID"}, - { 0x9217, "SensingMethod"}, /* 0xA217 - - */ - { 0x923F, "StoNits"}, - { 0x927C, "MakerNote"}, - { 0x9286, "UserComment"}, - { 0x9290, "SubSecTime"}, - { 0x9291, "SubSecTimeOriginal"}, - { 0x9292, "SubSecTimeDigitized"}, - { 0x935C, "ImageSourceData"}, /* "Adobe Photoshop Document Data Block": 8BIM... */ - { 0x9c9b, "Title" }, /* Win XP specific, Unicode */ - { 0x9c9c, "Comments" }, /* Win XP specific, Unicode */ - { 0x9c9d, "Author" }, /* Win XP specific, Unicode */ - { 0x9c9e, "Keywords" }, /* Win XP specific, Unicode */ - { 0x9c9f, "Subject" }, /* Win XP specific, Unicode, not to be confused with SubjectDistance and SubjectLocation */ - { 0xA000, "FlashPixVersion"}, - { 0xA001, "ColorSpace"}, - { 0xA002, "ExifImageWidth"}, - { 0xA003, "ExifImageLength"}, - { 0xA004, "RelatedSoundFile"}, - { 0xA005, "InteroperabilityOffset"}, - { 0xA20B, "FlashEnergy"}, /* 0x920B in TIFF/EP */ - { 0xA20C, "SpatialFrequencyResponse"}, /* 0x920C - - */ - { 0xA20D, "Noise"}, - { 0xA20E, "FocalPlaneXResolution"}, /* 0x920E - - */ - { 0xA20F, "FocalPlaneYResolution"}, /* 0x920F - - */ - { 0xA210, "FocalPlaneResolutionUnit"}, /* 0x9210 - - */ - { 0xA211, "ImageNumber"}, - { 0xA212, "SecurityClassification"}, - { 0xA213, "ImageHistory"}, - { 0xA214, "SubjectLocation"}, /* 0x9214 - - */ - { 0xA215, "ExposureIndex"}, /* 0x9215 - - */ - { 0xA216, "TIFF/EPStandardID"}, - { 0xA217, "SensingMethod"}, /* 0x9217 - - */ - { 0xA300, "FileSource"}, - { 0xA301, "SceneType"}, - { 0xA302, "CFAPattern"}, - { 0xA401, "CustomRendered"}, - { 0xA402, "ExposureMode"}, - { 0xA403, "WhiteBalance"}, - { 0xA404, "DigitalZoomRatio"}, - { 0xA405, "FocalLengthIn35mmFilm"}, - { 0xA406, "SceneCaptureType"}, - { 0xA407, "GainControl"}, - { 0xA408, "Contrast"}, - { 0xA409, "Saturation"}, - { 0xA40A, "Sharpness"}, - { 0xA40B, "DeviceSettingDescription"}, - { 0xA40C, "SubjectDistanceRange"}, - { 0xA420, "ImageUniqueID"}, - TAG_TABLE_END -} ; - -static tag_info_array tag_table_GPS = { - { 0x0000, "GPSVersion"}, - { 0x0001, "GPSLatitudeRef"}, - { 0x0002, "GPSLatitude"}, - { 0x0003, "GPSLongitudeRef"}, - { 0x0004, "GPSLongitude"}, - { 0x0005, "GPSAltitudeRef"}, - { 0x0006, "GPSAltitude"}, - { 0x0007, "GPSTimeStamp"}, - { 0x0008, "GPSSatellites"}, - { 0x0009, "GPSStatus"}, - { 0x000A, "GPSMeasureMode"}, - { 0x000B, "GPSDOP"}, - { 0x000C, "GPSSpeedRef"}, - { 0x000D, "GPSSpeed"}, - { 0x000E, "GPSTrackRef"}, - { 0x000F, "GPSTrack"}, - { 0x0010, "GPSImgDirectionRef"}, - { 0x0011, "GPSImgDirection"}, - { 0x0012, "GPSMapDatum"}, - { 0x0013, "GPSDestLatitudeRef"}, - { 0x0014, "GPSDestLatitude"}, - { 0x0015, "GPSDestLongitudeRef"}, - { 0x0016, "GPSDestLongitude"}, - { 0x0017, "GPSDestBearingRef"}, - { 0x0018, "GPSDestBearing"}, - { 0x0019, "GPSDestDistanceRef"}, - { 0x001A, "GPSDestDistance"}, - { 0x001B, "GPSProcessingMode"}, - { 0x001C, "GPSAreaInformation"}, - { 0x001D, "GPSDateStamp"}, - { 0x001E, "GPSDifferential"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_IOP = { - { 0x0001, "InterOperabilityIndex"}, /* should be 'R98' or 'THM' */ - { 0x0002, "InterOperabilityVersion"}, - { 0x1000, "RelatedFileFormat"}, - { 0x1001, "RelatedImageWidth"}, - { 0x1002, "RelatedImageHeight"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_CANON = { - { 0x0001, "ModeArray"}, /* guess */ - { 0x0004, "ImageInfo"}, /* guess */ - { 0x0006, "ImageType"}, - { 0x0007, "FirmwareVersion"}, - { 0x0008, "ImageNumber"}, - { 0x0009, "OwnerName"}, - { 0x000C, "Camera"}, - { 0x000F, "CustomFunctions"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_CASIO = { - { 0x0001, "RecordingMode"}, - { 0x0002, "Quality"}, - { 0x0003, "FocusingMode"}, - { 0x0004, "FlashMode"}, - { 0x0005, "FlashIntensity"}, - { 0x0006, "ObjectDistance"}, - { 0x0007, "WhiteBalance"}, - { 0x000A, "DigitalZoom"}, - { 0x000B, "Sharpness"}, - { 0x000C, "Contrast"}, - { 0x000D, "Saturation"}, - { 0x0014, "CCDSensitivity"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_FUJI = { - { 0x0000, "Version"}, - { 0x1000, "Quality"}, - { 0x1001, "Sharpness"}, - { 0x1002, "WhiteBalance"}, - { 0x1003, "Color"}, - { 0x1004, "Tone"}, - { 0x1010, "FlashMode"}, - { 0x1011, "FlashStrength"}, - { 0x1020, "Macro"}, - { 0x1021, "FocusMode"}, - { 0x1030, "SlowSync"}, - { 0x1031, "PictureMode"}, - { 0x1100, "ContTake"}, - { 0x1300, "BlurWarning"}, - { 0x1301, "FocusWarning"}, - { 0x1302, "AEWarning "}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_NIKON = { - { 0x0003, "Quality"}, - { 0x0004, "ColorMode"}, - { 0x0005, "ImageAdjustment"}, - { 0x0006, "CCDSensitivity"}, - { 0x0007, "WhiteBalance"}, - { 0x0008, "Focus"}, - { 0x000a, "DigitalZoom"}, - { 0x000b, "Converter"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_NIKON_990 = { - { 0x0001, "Version"}, - { 0x0002, "ISOSetting"}, - { 0x0003, "ColorMode"}, - { 0x0004, "Quality"}, - { 0x0005, "WhiteBalance"}, - { 0x0006, "ImageSharpening"}, - { 0x0007, "FocusMode"}, - { 0x0008, "FlashSetting"}, - { 0x000F, "ISOSelection"}, - { 0x0080, "ImageAdjustment"}, - { 0x0082, "AuxiliaryLens"}, - { 0x0085, "ManualFocusDistance"}, - { 0x0086, "DigitalZoom"}, - { 0x0088, "AFFocusPosition"}, - { 0x0010, "DataDump"}, - TAG_TABLE_END -}; - -static tag_info_array tag_table_VND_OLYMPUS = { - { 0x0200, "SpecialMode"}, - { 0x0201, "JPEGQuality"}, - { 0x0202, "Macro"}, - { 0x0204, "DigitalZoom"}, - { 0x0207, "SoftwareRelease"}, - { 0x0208, "PictureInfo"}, - { 0x0209, "CameraId"}, - { 0x0F00, "DataDump"}, - TAG_TABLE_END -}; - -typedef enum mn_byte_order_t { - MN_ORDER_INTEL = 0, - MN_ORDER_MOTOROLA = 1, - MN_ORDER_NORMAL -} mn_byte_order_t; - -typedef enum mn_offset_mode_t { - MN_OFFSET_NORMAL, - MN_OFFSET_MAKER, - MN_OFFSET_GUESS -} mn_offset_mode_t; - -typedef struct { - tag_table_type tag_table; - char * make; - char * model; - char * id_string; - int id_string_len; - int offset; - mn_byte_order_t byte_order; - mn_offset_mode_t offset_mode; -} maker_note_type; - -static const maker_note_type maker_note_array[] = { - { tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_GUESS}, -/* { tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},*/ - { tag_table_VND_CASIO, "CASIO", NULL, NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL}, - { tag_table_VND_FUJI, "FUJIFILM", NULL, "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER}, - { tag_table_VND_NIKON, "NIKON", NULL, "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, - { tag_table_VND_NIKON_990, "NIKON", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, - { tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", NULL, "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, -}; -/* }}} */ - -/* {{{ exif_get_tagname - Get headername for tag_num or NULL if not defined */ -static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table TSRMLS_DC) -{ - int i, t; - char tmp[32]; - - for (i = 0; (t = tag_table[i].Tag) != TAG_END_OF_LIST; i++) { - if (t == tag_num) { - if (ret && len) { - strlcpy(ret, tag_table[i].Desc, abs(len)); - if (len < 0) { - memset(ret + strlen(ret), ' ', -len - strlen(ret) - 1); - ret[-len - 1] = '\0'; - } - return ret; - } - return tag_table[i].Desc; - } - } - - if (ret && len) { - snprintf(tmp, sizeof(tmp), "UndefinedTag:0x%04X", tag_num); - strlcpy(ret, tmp, abs(len)); - if (len < 0) { - memset(ret + strlen(ret), ' ', -len - strlen(ret) - 1); - ret[-len - 1] = '\0'; - } - return ret; - } - return ""; -} -/* }}} */ - -/* {{{ exif_char_dump - * Do not use! This is a debug function... */ -#ifdef EXIF_DEBUG -static unsigned char* exif_char_dump(unsigned char * addr, int len, int offset) -{ - static unsigned char buf[4096+1]; - static unsigned char tmp[20]; - int c, i, p=0, n = 5+31; - - p += slprintf(buf+p, sizeof(buf)-p, "\nDump Len: %08X (%d)", len, len); - if (len) { - for(i=0; i=32 ? c : '.'; - tmp[(i%16)+1] = '\0'; - } else { - p += slprintf(buf+p, sizeof(buf)-p, " "); - } - if (i%16==15) { - p += slprintf(buf+p, sizeof(buf)-p, " %s", tmp); - if (i>=len) { - break; - } - } - } - } - buf[sizeof(buf)-1] = '\0'; - return buf; -} -#endif -/* }}} */ - -/* {{{ php_jpg_get16 - Get 16 bits motorola order (always) for jpeg header stuff. -*/ -static int php_jpg_get16(void *value) -{ - return (((uchar *)value)[0] << 8) | ((uchar *)value)[1]; -} -/* }}} */ - -/* {{{ php_ifd_get16u - * Convert a 16 bit unsigned value from file's native byte order */ -static int php_ifd_get16u(void *value, int motorola_intel) -{ - if (motorola_intel) { - return (((uchar *)value)[0] << 8) | ((uchar *)value)[1]; - } else { - return (((uchar *)value)[1] << 8) | ((uchar *)value)[0]; - } -} -/* }}} */ - -/* {{{ php_ifd_get16s - * Convert a 16 bit signed value from file's native byte order */ -static signed short php_ifd_get16s(void *value, int motorola_intel) -{ - return (signed short)php_ifd_get16u(value, motorola_intel); -} -/* }}} */ - -/* {{{ php_ifd_get32s - * Convert a 32 bit signed value from file's native byte order */ -static int php_ifd_get32s(void *value, int motorola_intel) -{ - if (motorola_intel) { - return (((char *)value)[0] << 24) - | (((uchar *)value)[1] << 16) - | (((uchar *)value)[2] << 8 ) - | (((uchar *)value)[3] ); - } else { - return (((char *)value)[3] << 24) - | (((uchar *)value)[2] << 16) - | (((uchar *)value)[1] << 8 ) - | (((uchar *)value)[0] ); - } -} -/* }}} */ - -/* {{{ php_ifd_get32u - * Write 32 bit unsigned value to data */ -static unsigned php_ifd_get32u(void *value, int motorola_intel) -{ - return (unsigned)php_ifd_get32s(value, motorola_intel) & 0xffffffff; -} -/* }}} */ - -/* {{{ php_ifd_set16u - * Write 16 bit unsigned value to data */ -static void php_ifd_set16u(char *data, unsigned int value, int motorola_intel) -{ - if (motorola_intel) { - data[0] = (value & 0xFF00) >> 8; - data[1] = (value & 0x00FF); - } else { - data[1] = (value & 0xFF00) >> 8; - data[0] = (value & 0x00FF); - } -} -/* }}} */ - -/* {{{ php_ifd_set32u - * Convert a 32 bit unsigned value from file's native byte order */ -static void php_ifd_set32u(char *data, size_t value, int motorola_intel) -{ - if (motorola_intel) { - data[0] = (value & 0xFF000000) >> 24; - data[1] = (value & 0x00FF0000) >> 16; - data[2] = (value & 0x0000FF00) >> 8; - data[3] = (value & 0x000000FF); - } else { - data[3] = (value & 0xFF000000) >> 24; - data[2] = (value & 0x00FF0000) >> 16; - data[1] = (value & 0x0000FF00) >> 8; - data[0] = (value & 0x000000FF); - } -} -/* }}} */ - -#ifdef EXIF_DEBUG -char * exif_dump_data(int *dump_free, int format, int components, int length, int motorola_intel, char *value_ptr TSRMLS_DC) /* {{{ */ -{ - char *dump; - int len; - - *dump_free = 0; - if (format == TAG_FMT_STRING) { - return value_ptr ? value_ptr : ""; - } - if (format == TAG_FMT_UNDEFINED) { - return "\n"; - } - if (format == TAG_FMT_IFD) { - return ""; - } - if (format == TAG_FMT_SINGLE || format == TAG_FMT_DOUBLE) { - return ""; - } - *dump_free = 1; - if (components > 1) { - len = spprintf(&dump, 0, "(%d,%d) {", components, length); - } else { - len = spprintf(&dump, 0, "{"); - } - while(components > 0) { - switch(format) { - case TAG_FMT_BYTE: - case TAG_FMT_UNDEFINED: - case TAG_FMT_STRING: - case TAG_FMT_SBYTE: - dump = erealloc(dump, len + 4 + 1); - snprintf(dump + len, 4 + 1, "0x%02X", *value_ptr); - len += 4; - value_ptr++; - break; - case TAG_FMT_USHORT: - case TAG_FMT_SSHORT: - dump = erealloc(dump, len + 6 + 1); - snprintf(dump + len, 6 + 1, "0x%04X", php_ifd_get16s(value_ptr, motorola_intel)); - len += 6; - value_ptr += 2; - break; - case TAG_FMT_ULONG: - case TAG_FMT_SLONG: - dump = erealloc(dump, len + 6 + 1); - snprintf(dump + len, 6 + 1, "0x%04X", php_ifd_get32s(value_ptr, motorola_intel)); - len += 6; - value_ptr += 4; - break; - case TAG_FMT_URATIONAL: - case TAG_FMT_SRATIONAL: - dump = erealloc(dump, len + 13 + 1); - snprintf(dump + len, 13 + 1, "0x%04X/0x%04X", php_ifd_get32s(value_ptr, motorola_intel), php_ifd_get32s(value_ptr+4, motorola_intel)); - len += 13; - value_ptr += 8; - break; - } - if (components > 0) { - dump = erealloc(dump, len + 2 + 1); - snprintf(dump + len, 2 + 1, ", "); - len += 2; - components--; - } else{ - break; - } - } - dump = erealloc(dump, len + 1 + 1); - snprintf(dump + len, 1 + 1, "}"); - return dump; -} -/* }}} */ -#endif - -/* {{{ exif_convert_any_format - * Evaluate number, be it int, rational, or float from directory. */ -static double exif_convert_any_format(void *value, int format, int motorola_intel TSRMLS_DC) -{ - int s_den; - unsigned u_den; - - switch(format) { - case TAG_FMT_SBYTE: return *(signed char *)value; - case TAG_FMT_BYTE: return *(uchar *)value; - - case TAG_FMT_USHORT: return php_ifd_get16u(value, motorola_intel); - case TAG_FMT_ULONG: return php_ifd_get32u(value, motorola_intel); - - case TAG_FMT_URATIONAL: - u_den = php_ifd_get32u(4+(char *)value, motorola_intel); - if (u_den == 0) { - return 0; - } else { - return (double)php_ifd_get32u(value, motorola_intel) / u_den; - } - - case TAG_FMT_SRATIONAL: - s_den = php_ifd_get32s(4+(char *)value, motorola_intel); - if (s_den == 0) { - return 0; - } else { - return (double)php_ifd_get32s(value, motorola_intel) / s_den; - } - - case TAG_FMT_SSHORT: return (signed short)php_ifd_get16u(value, motorola_intel); - case TAG_FMT_SLONG: return php_ifd_get32s(value, motorola_intel); - - /* Not sure if this is correct (never seen float used in Exif format) */ - case TAG_FMT_SINGLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single"); -#endif - return (double)*(float *)value; - case TAG_FMT_DOUBLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double"); -#endif - return *(double *)value; - } - return 0; -} -/* }}} */ - -/* {{{ exif_convert_any_to_int - * Evaluate number, be it int, rational, or float from directory. */ -static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel TSRMLS_DC) -{ - int s_den; - unsigned u_den; - - switch(format) { - case TAG_FMT_SBYTE: return *(signed char *)value; - case TAG_FMT_BYTE: return *(uchar *)value; - - case TAG_FMT_USHORT: return php_ifd_get16u(value, motorola_intel); - case TAG_FMT_ULONG: return php_ifd_get32u(value, motorola_intel); - - case TAG_FMT_URATIONAL: - u_den = php_ifd_get32u(4+(char *)value, motorola_intel); - if (u_den == 0) { - return 0; - } else { - return php_ifd_get32u(value, motorola_intel) / u_den; - } - - case TAG_FMT_SRATIONAL: - s_den = php_ifd_get32s(4+(char *)value, motorola_intel); - if (s_den == 0) { - return 0; - } else { - return php_ifd_get32s(value, motorola_intel) / s_den; - } - - case TAG_FMT_SSHORT: return php_ifd_get16u(value, motorola_intel); - case TAG_FMT_SLONG: return php_ifd_get32s(value, motorola_intel); - - /* Not sure if this is correct (never seen float used in Exif format) */ - case TAG_FMT_SINGLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single"); -#endif - return (size_t)*(float *)value; - case TAG_FMT_DOUBLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double"); -#endif - return (size_t)*(double *)value; - } - return 0; -} -/* }}} */ - -/* {{{ struct image_info_value, image_info_list -*/ -#ifndef WORD -#define WORD unsigned short -#endif -#ifndef DWORD -#define DWORD unsigned int -#endif - -typedef struct { - int num; - int den; -} signed_rational; - -typedef struct { - unsigned int num; - unsigned int den; -} unsigned_rational; - -typedef union _image_info_value { - char *s; - unsigned u; - int i; - float f; - double d; - signed_rational sr; - unsigned_rational ur; - union _image_info_value *list; -} image_info_value; - -typedef struct { - WORD tag; - WORD format; - DWORD length; - DWORD dummy; /* value ptr of tiff directory entry */ - char *name; - image_info_value value; -} image_info_data; - -typedef struct { - int count; - image_info_data *list; -} image_info_list; -/* }}} */ - -/* {{{ exif_get_sectionname - Returns the name of a section -*/ -#define SECTION_FILE 0 -#define SECTION_COMPUTED 1 -#define SECTION_ANY_TAG 2 -#define SECTION_IFD0 3 -#define SECTION_THUMBNAIL 4 -#define SECTION_COMMENT 5 -#define SECTION_APP0 6 -#define SECTION_EXIF 7 -#define SECTION_FPIX 8 -#define SECTION_GPS 9 -#define SECTION_INTEROP 10 -#define SECTION_APP12 11 -#define SECTION_WINXP 12 -#define SECTION_MAKERNOTE 13 -#define SECTION_COUNT 14 - -#define FOUND_FILE (1<2) - sections[len-2] = '\0'; - return sections; -} -/* }}} */ - -/* {{{ struct image_info_type - This structure stores Exif header image elements in a simple manner - Used to store camera data as extracted from the various ways that it can be - stored in a nexif header -*/ - -typedef struct { - int type; - size_t size; - uchar *data; -} file_section; - -typedef struct { - int count; - file_section *list; -} file_section_list; - -typedef struct { - image_filetype filetype; - size_t width, height; - size_t size; - size_t offset; - char *data; -} thumbnail_data; - -typedef struct { - char *value; - size_t size; - int tag; -} xp_field_type; - -typedef struct { - int count; - xp_field_type *list; -} xp_field_list; - -/* This structure is used to store a section of a Jpeg file. */ -typedef struct { - php_stream *infile; - char *FileName; - time_t FileDateTime; - size_t FileSize; - image_filetype FileType; - int Height, Width; - int IsColor; - - char *make; - char *model; - - float ApertureFNumber; - float ExposureTime; - double FocalplaneUnits; - float CCDWidth; - double FocalplaneXRes; - size_t ExifImageWidth; - float FocalLength; - float Distance; - - int motorola_intel; /* 1 Motorola; 0 Intel */ - - char *UserComment; - int UserCommentLength; - char *UserCommentEncoding; - char *encode_unicode; - char *decode_unicode_be; - char *decode_unicode_le; - char *encode_jis; - char *decode_jis_be; - char *decode_jis_le; - char *Copyright;/* EXIF standard defines Copyright as " [ '\0' ] ['\0']" */ - char *CopyrightPhotographer; - char *CopyrightEditor; - - xp_field_list xp_fields; - - thumbnail_data Thumbnail; - /* other */ - int sections_found; /* FOUND_ */ - image_info_list info_list[SECTION_COUNT]; - /* for parsing */ - int read_thumbnail; - int read_all; - int ifd_nesting_level; - /* internal */ - file_section_list file; -} image_info_type; -/* }}} */ - -/* {{{ exif_error_docref */ -static void exif_error_docref(const char *docref EXIFERR_DC, const image_info_type *ImageInfo, int type, const char *format, ...) -{ - va_list args; - - va_start(args, format); -#ifdef EXIF_DEBUG - { - char *buf; - - spprintf(&buf, 0, "%s(%d): %s", _file, _line, format); - php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args TSRMLS_CC); - efree(buf); - } -#else - php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args TSRMLS_CC); -#endif - va_end(args); -} -/* }}} */ - -/* {{{ jpeg_sof_info - */ -typedef struct { - int bits_per_sample; - size_t width; - size_t height; - int num_components; -} jpeg_sof_info; -/* }}} */ - -/* {{{ exif_file_sections_add - Add a file_section to image_info - returns the used block or -1. if size>0 and data == NULL buffer of size is allocated -*/ -static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t size, uchar *data) -{ - file_section *tmp; - int count = ImageInfo->file.count; - - tmp = safe_erealloc(ImageInfo->file.list, (count+1), sizeof(file_section), 0); - ImageInfo->file.list = tmp; - ImageInfo->file.list[count].type = 0xFFFF; - ImageInfo->file.list[count].data = NULL; - ImageInfo->file.list[count].size = 0; - ImageInfo->file.count = count+1; - if (!size) { - data = NULL; - } else if (data == NULL) { - data = safe_emalloc(size, 1, 0); - } - ImageInfo->file.list[count].type = type; - ImageInfo->file.list[count].data = data; - ImageInfo->file.list[count].size = size; - return count; -} -/* }}} */ - -/* {{{ exif_file_sections_realloc - Reallocate a file section returns 0 on success and -1 on failure -*/ -static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size TSRMLS_DC) -{ - void *tmp; - - /* This is not a malloc/realloc check. It is a plausibility check for the - * function parameters (requirements engineering). - */ - if (section_index >= ImageInfo->file.count) { - EXIF_ERRLOG_FSREALLOC(ImageInfo) - return -1; - } - tmp = safe_erealloc(ImageInfo->file.list[section_index].data, 1, size, 0); - ImageInfo->file.list[section_index].data = tmp; - ImageInfo->file.list[section_index].size = size; - return 0; -} -/* }}} */ - -/* {{{ exif_file_section_free - Discard all file_sections in ImageInfo -*/ -static int exif_file_sections_free(image_info_type *ImageInfo) -{ - int i; - - if (ImageInfo->file.count) { - for (i=0; ifile.count; i++) { - EFREE_IF(ImageInfo->file.list[i].data); - } - } - EFREE_IF(ImageInfo->file.list); - ImageInfo->file.count = 0; - return TRUE; -} -/* }}} */ - -/* {{{ exif_iif_add_value - Add a value to image_info -*/ -static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC) -{ - size_t idex; - void *vptr; - image_info_value *info_value; - image_info_data *info_data; - image_info_data *list; - - if (length < 0) { - return; - } - - list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(image_info_data), 0); - image_info->info_list[section_index].list = list; - - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - memset(info_data, 0, sizeof(image_info_data)); - info_data->tag = tag; - info_data->format = format; - info_data->length = length; - info_data->name = estrdup(name); - info_value = &info_data->value; - - switch (format) { - case TAG_FMT_STRING: - if (value) { - length = php_strnlen(value, length); - if (PG(magic_quotes_runtime)) { - info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC); - } else { - info_value->s = estrndup(value, length); - } - info_data->length = length; - } else { - info_data->length = 0; - info_value->s = estrdup(""); - } - break; - - default: - /* Standard says more types possible but skip them... - * but allow users to handle data if they know how to - * So not return but use type UNDEFINED - * return; - */ - info_data->tag = TAG_FMT_UNDEFINED;/* otherwise not freed from memory */ - case TAG_FMT_SBYTE: - case TAG_FMT_BYTE: - /* in contrast to strings bytes do not need to allocate buffer for NULL if length==0 */ - if (!length) - break; - case TAG_FMT_UNDEFINED: - if (value) { - /* do not recompute length here */ - if (PG(magic_quotes_runtime)) { - info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC); - } else { - info_value->s = estrndup(value, length); - } - info_data->length = length; - } else { - info_data->length = 0; - info_value->s = estrdup(""); - } - break; - - case TAG_FMT_USHORT: - case TAG_FMT_ULONG: - case TAG_FMT_URATIONAL: - case TAG_FMT_SSHORT: - case TAG_FMT_SLONG: - case TAG_FMT_SRATIONAL: - case TAG_FMT_SINGLE: - case TAG_FMT_DOUBLE: - if (length==0) { - break; - } else - if (length>1) { - info_value->list = safe_emalloc(length, sizeof(image_info_value), 0); - } else { - info_value = &info_data->value; - } - for (idex=0,vptr=value; idex<(size_t)length; idex++,vptr=(char *) vptr + php_tiff_bytes_per_format[format]) { - if (length>1) { - info_value = &info_data->value.list[idex]; - } - switch (format) { - case TAG_FMT_USHORT: - info_value->u = php_ifd_get16u(vptr, motorola_intel); - break; - - case TAG_FMT_ULONG: - info_value->u = php_ifd_get32u(vptr, motorola_intel); - break; - - case TAG_FMT_URATIONAL: - info_value->ur.num = php_ifd_get32u(vptr, motorola_intel); - info_value->ur.den = php_ifd_get32u(4+(char *)vptr, motorola_intel); - break; - - case TAG_FMT_SSHORT: - info_value->i = php_ifd_get16s(vptr, motorola_intel); - break; - - case TAG_FMT_SLONG: - info_value->i = php_ifd_get32s(vptr, motorola_intel); - break; - - case TAG_FMT_SRATIONAL: - info_value->sr.num = php_ifd_get32u(vptr, motorola_intel); - info_value->sr.den = php_ifd_get32u(4+(char *)vptr, motorola_intel); - break; - - case TAG_FMT_SINGLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type single"); -#endif - info_value->f = *(float *)value; - - case TAG_FMT_DOUBLE: -#ifdef EXIF_DEBUG - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type double"); -#endif - info_value->d = *(double *)value; - break; - } - } - } - image_info->sections_found |= 1<info_list[section_index].count++; -} -/* }}} */ - -/* {{{ exif_iif_add_tag - Add a tag from IFD to image_info -*/ -static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC) -{ - exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC); -} -/* }}} */ - -/* {{{ exif_iif_add_int - Add an int value to image_info -*/ -static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value TSRMLS_DC) -{ - image_info_data *info_data; - image_info_data *list; - - list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(image_info_data), 0); - image_info->info_list[section_index].list = list; - - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = TAG_NONE; - info_data->format = TAG_FMT_SLONG; - info_data->length = 1; - info_data->name = estrdup(name); - info_data->value.i = value; - image_info->sections_found |= 1<info_list[section_index].count++; -} -/* }}} */ - -/* {{{ exif_iif_add_str - Add a string value to image_info MUST BE NUL TERMINATED -*/ -static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value TSRMLS_DC) -{ - image_info_data *info_data; - image_info_data *list; - - if (value) { - list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(image_info_data), 0); - image_info->info_list[section_index].list = list; - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = TAG_NONE; - info_data->format = TAG_FMT_STRING; - info_data->length = 1; - info_data->name = estrdup(name); - if (PG(magic_quotes_runtime)) { - info_data->value.s = php_addslashes(value, strlen(value), NULL, 0 TSRMLS_CC); - } else { - info_data->value.s = estrdup(value); - } - image_info->sections_found |= 1<info_list[section_index].count++; - } -} -/* }}} */ - -/* {{{ exif_iif_add_fmt - Add a format string value to image_info MUST BE NUL TERMINATED -*/ -static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name TSRMLS_DC, char *value, ...) -{ - char *tmp; - va_list arglist; - - va_start(arglist, value); - if (value) { - vspprintf(&tmp, 0, value, arglist); - exif_iif_add_str(image_info, section_index, name, tmp TSRMLS_CC); - efree(tmp); - } - va_end(arglist); -} -/* }}} */ - -/* {{{ exif_iif_add_str - Add a string value to image_info MUST BE NUL TERMINATED -*/ -static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value TSRMLS_DC) -{ - image_info_data *info_data; - image_info_data *list; - - if (value) { - list = safe_erealloc(image_info->info_list[section_index].list, (image_info->info_list[section_index].count+1), sizeof(image_info_data), 0); - image_info->info_list[section_index].list = list; - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = TAG_NONE; - info_data->format = TAG_FMT_UNDEFINED; - info_data->length = length; - info_data->name = estrdup(name); - if (PG(magic_quotes_runtime)) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, image_info, E_NOTICE, "Adding %s as buffer%s", name, exif_char_dump(value, length, 0)); -#endif - info_data->value.s = php_addslashes(value, length, &length, 0 TSRMLS_CC); - info_data->length = length; - } else { - info_data->value.s = safe_emalloc(length, 1, 1); - memcpy(info_data->value.s, value, length); - info_data->value.s[length] = 0; - } - image_info->sections_found |= 1<info_list[section_index].count++; - } -} -/* }}} */ - -/* {{{ exif_iif_free - Free memory allocated for image_info -*/ -static void exif_iif_free(image_info_type *image_info, int section_index) { - int i; - void *f; /* faster */ - - if (image_info->info_list[section_index].count) { - for (i=0; i < image_info->info_list[section_index].count; i++) { - if ((f=image_info->info_list[section_index].list[i].name) != NULL) { - efree(f); - } - switch(image_info->info_list[section_index].list[i].format) { - case TAG_FMT_SBYTE: - case TAG_FMT_BYTE: - /* in contrast to strings bytes do not need to allocate buffer for NULL if length==0 */ - if (image_info->info_list[section_index].list[i].length<1) - break; - default: - case TAG_FMT_UNDEFINED: - case TAG_FMT_STRING: - if ((f=image_info->info_list[section_index].list[i].value.s) != NULL) { - efree(f); - } - break; - - case TAG_FMT_USHORT: - case TAG_FMT_ULONG: - case TAG_FMT_URATIONAL: - case TAG_FMT_SSHORT: - case TAG_FMT_SLONG: - case TAG_FMT_SRATIONAL: - case TAG_FMT_SINGLE: - case TAG_FMT_DOUBLE: - /* nothing to do here */ - if (image_info->info_list[section_index].list[i].length > 1) { - if ((f=image_info->info_list[section_index].list[i].value.list) != NULL) { - efree(f); - } - } - break; - } - } - } - EFREE_IF(image_info->info_list[section_index].list); -} -/* }}} */ - -/* {{{ add_assoc_image_info - * Add image_info to associative array value. */ -static void add_assoc_image_info(zval *value, int sub_array, image_info_type *image_info, int section_index TSRMLS_DC) -{ - char buffer[64], *val, *name, uname[64]; - int i, ap, l, b, idx=0, unknown=0; -#ifdef EXIF_DEBUG - int info_tag; -#endif - image_info_value *info_value; - image_info_data *info_data; - zval *tmpi, *array = NULL; - -#ifdef EXIF_DEBUG -/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding %d infos from section %s", image_info->info_list[section_index].count, exif_get_sectionname(section_index));*/ -#endif - if (image_info->info_list[section_index].count) { - if (sub_array) { - MAKE_STD_ZVAL(tmpi); - array_init(tmpi); - } else { - tmpi = value; - } - - for(i=0; iinfo_list[section_index].count; i++) { - info_data = &image_info->info_list[section_index].list[i]; -#ifdef EXIF_DEBUG - info_tag = info_data->tag; /* conversion */ -#endif - info_value = &info_data->value; - if (!(name = info_data->name)) { - snprintf(uname, sizeof(uname), "%d", unknown++); - name = uname; - } -#ifdef EXIF_DEBUG -/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding infos: tag(0x%04X,%12s,L=0x%04X): %s", info_tag, exif_get_tagname(info_tag, buffer, -12, exif_get_tag_table(section_index) TSRMLS_CC), info_data->length, info_data->format==TAG_FMT_STRING?(info_value&&info_value->s?info_value->s:""):exif_get_tagformat(info_data->format));*/ -#endif - if (info_data->length==0) { - add_assoc_null(tmpi, name); - } else { - switch (info_data->format) { - default: - /* Standard says more types possible but skip them... - * but allow users to handle data if they know how to - * So not return but use type UNDEFINED - * return; - */ - case TAG_FMT_BYTE: - case TAG_FMT_SBYTE: - case TAG_FMT_UNDEFINED: - if (!info_value->s) { - add_assoc_stringl(tmpi, name, "", 0, 1); - } else { - add_assoc_stringl(tmpi, name, info_value->s, info_data->length, 1); - } - break; - - case TAG_FMT_STRING: - if (!(val = info_value->s)) { - val = ""; - } - if (section_index==SECTION_COMMENT) { - add_index_string(tmpi, idx++, val, 1); - } else { - add_assoc_string(tmpi, name, val, 1); - } - break; - - case TAG_FMT_URATIONAL: - case TAG_FMT_SRATIONAL: - /*case TAG_FMT_BYTE: - case TAG_FMT_SBYTE:*/ - case TAG_FMT_USHORT: - case TAG_FMT_SSHORT: - case TAG_FMT_SINGLE: - case TAG_FMT_DOUBLE: - case TAG_FMT_ULONG: - case TAG_FMT_SLONG: - /* now the rest, first see if it becomes an array */ - if ((l = info_data->length) > 1) { - array = NULL; - MAKE_STD_ZVAL(array); - array_init(array); - } - for(ap=0; ap1) { - info_value = &info_data->value.list[ap]; - } - switch (info_data->format) { - case TAG_FMT_BYTE: - if (l>1) { - info_value = &info_data->value; - for (b=0;bs[b])); - } - break; - } - case TAG_FMT_USHORT: - case TAG_FMT_ULONG: - if (l==1) { - add_assoc_long(tmpi, name, (int)info_value->u); - } else { - add_index_long(array, ap, (int)info_value->u); - } - break; - - case TAG_FMT_URATIONAL: - snprintf(buffer, sizeof(buffer), "%i/%i", info_value->ur.num, info_value->ur.den); - if (l==1) { - add_assoc_string(tmpi, name, buffer, 1); - } else { - add_index_string(array, ap, buffer, 1); - } - break; - - case TAG_FMT_SBYTE: - if (l>1) { - info_value = &info_data->value; - for (b=0;bs[b]); - } - break; - } - case TAG_FMT_SSHORT: - case TAG_FMT_SLONG: - if (l==1) { - add_assoc_long(tmpi, name, info_value->i); - } else { - add_index_long(array, ap, info_value->i); - } - break; - - case TAG_FMT_SRATIONAL: - snprintf(buffer, sizeof(buffer), "%i/%i", info_value->sr.num, info_value->sr.den); - if (l==1) { - add_assoc_string(tmpi, name, buffer, 1); - } else { - add_index_string(array, ap, buffer, 1); - } - break; - - case TAG_FMT_SINGLE: - if (l==1) { - add_assoc_double(tmpi, name, info_value->f); - } else { - add_index_double(array, ap, info_value->f); - } - break; - - case TAG_FMT_DOUBLE: - if (l==1) { - add_assoc_double(tmpi, name, info_value->d); - } else { - add_index_double(array, ap, info_value->d); - } - break; - } - info_value = &info_data->value.list[ap]; - } - if (l>1) { - add_assoc_zval(tmpi, name, array); - } - break; - } - } - } - if (sub_array) { - add_assoc_zval(value, exif_get_sectionname(section_index), tmpi); - } - } -} -/* }}} */ - -/* {{{ Markers - JPEG markers consist of one or more 0xFF bytes, followed by a marker - code byte (which is not an FF). Here are the marker codes of interest - in this program. (See jdmarker.c for a more complete list.) -*/ - -#define M_TEM 0x01 /* temp for arithmetic coding */ -#define M_RES 0x02 /* reserved */ -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_DHT 0xC4 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_JPEG 0x08 /* reserved for extensions */ -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_DAC 0xCC /* arithmetic table */ -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_RST0 0xD0 /* restart segment */ -#define M_RST1 0xD1 -#define M_RST2 0xD2 -#define M_RST3 0xD3 -#define M_RST4 0xD4 -#define M_RST5 0xD5 -#define M_RST6 0xD6 -#define M_RST7 0xD7 -#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_DQT 0xDB -#define M_DNL 0xDC -#define M_DRI 0xDD -#define M_DHP 0xDE -#define M_EXP 0xDF -#define M_APP0 0xE0 /* JPEG: 'JFIFF' AND (additional 'JFXX') */ -#define M_EXIF 0xE1 /* Exif Attribute Information */ -#define M_APP2 0xE2 /* Flash Pix Extension Data? */ -#define M_APP3 0xE3 -#define M_APP4 0xE4 -#define M_APP5 0xE5 -#define M_APP6 0xE6 -#define M_APP7 0xE7 -#define M_APP8 0xE8 -#define M_APP9 0xE9 -#define M_APP10 0xEA -#define M_APP11 0xEB -#define M_APP12 0xEC -#define M_APP13 0xED /* IPTC International Press Telecommunications Council */ -#define M_APP14 0xEE /* Software, Copyright? */ -#define M_APP15 0xEF -#define M_JPG0 0xF0 -#define M_JPG1 0xF1 -#define M_JPG2 0xF2 -#define M_JPG3 0xF3 -#define M_JPG4 0xF4 -#define M_JPG5 0xF5 -#define M_JPG6 0xF6 -#define M_JPG7 0xF7 -#define M_JPG8 0xF8 -#define M_JPG9 0xF9 -#define M_JPG10 0xFA -#define M_JPG11 0xFB -#define M_JPG12 0xFC -#define M_JPG13 0xFD -#define M_COM 0xFE /* COMment */ - -#define M_PSEUDO 0x123 /* Extra value. */ - -/* }}} */ - -/* {{{ jpeg2000 markers - */ -/* Markers x30 - x3F do not have a segment */ -/* Markers x00, x01, xFE, xC0 - xDF ISO/IEC 10918-1 -> M_ */ -/* Markers xF0 - xF7 ISO/IEC 10918-3 */ -/* Markers xF7 - xF8 ISO/IEC 14495-1 */ -/* XY=Main/Tile-header:(R:required, N:not_allowed, O:optional, L:last_marker) */ -#define JC_SOC 0x4F /* NN, Start of codestream */ -#define JC_SIZ 0x51 /* RN, Image and tile size */ -#define JC_COD 0x52 /* RO, Codeing style defaulte */ -#define JC_COC 0x53 /* OO, Coding style component */ -#define JC_TLM 0x55 /* ON, Tile part length main header */ -#define JC_PLM 0x57 /* ON, Packet length main header */ -#define JC_PLT 0x58 /* NO, Packet length tile part header */ -#define JC_QCD 0x5C /* RO, Quantization default */ -#define JC_QCC 0x5D /* OO, Quantization component */ -#define JC_RGN 0x5E /* OO, Region of interest */ -#define JC_POD 0x5F /* OO, Progression order default */ -#define JC_PPM 0x60 /* ON, Packed packet headers main header */ -#define JC_PPT 0x61 /* NO, Packet packet headers tile part header */ -#define JC_CME 0x64 /* OO, Comment: "LL E " E=0:binary, E=1:ascii */ -#define JC_SOT 0x90 /* NR, Start of tile */ -#define JC_SOP 0x91 /* NO, Start of packeter default */ -#define JC_EPH 0x92 /* NO, End of packet header */ -#define JC_SOD 0x93 /* NL, Start of data */ -#define JC_EOC 0xD9 /* NN, End of codestream */ -/* }}} */ - -/* {{{ exif_process_COM - Process a COM marker. - We want to print out the marker contents as legible text; - we must guard against random junk and varying newline representations. -*/ -static void exif_process_COM (image_info_type *image_info, char *value, size_t length TSRMLS_DC) -{ - exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2 TSRMLS_CC); -} -/* }}} */ - -/* {{{ exif_process_CME - Process a CME marker. - We want to print out the marker contents as legible text; - we must guard against random junk and varying newline representations. -*/ -#ifdef EXIF_JPEG2000 -static void exif_process_CME (image_info_type *image_info, char *value, size_t length TSRMLS_DC) -{ - if (length>3) { - switch(value[2]) { - case 0: - exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value TSRMLS_CC); - break; - case 1: - exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Undefined JPEG2000 comment encoding"); - break; - } - } else { - exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "JPEG2000 comment section too small"); - } -} -#endif -/* }}} */ - -/* {{{ exif_process_SOFn - * Process a SOFn marker. This is useful for the image dimensions */ -static void exif_process_SOFn (uchar *Data, int marker, jpeg_sof_info *result) -{ -/* 0xFF SOSn SectLen(2) Bits(1) Height(2) Width(2) Channels(1) 3*Channels (1) */ - result->bits_per_sample = Data[2]; - result->height = php_jpg_get16(Data+3); - result->width = php_jpg_get16(Data+5); - result->num_components = Data[7]; - -/* switch (marker) { - case M_SOF0: process = "Baseline"; break; - case M_SOF1: process = "Extended sequential"; break; - case M_SOF2: process = "Progressive"; break; - case M_SOF3: process = "Lossless"; break; - case M_SOF5: process = "Differential sequential"; break; - case M_SOF6: process = "Differential progressive"; break; - case M_SOF7: process = "Differential lossless"; break; - case M_SOF9: process = "Extended sequential, arithmetic coding"; break; - case M_SOF10: process = "Progressive, arithmetic coding"; break; - case M_SOF11: process = "Lossless, arithmetic coding"; break; - case M_SOF13: process = "Differential sequential, arithmetic coding"; break; - case M_SOF14: process = "Differential progressive, arithmetic coding"; break; - case M_SOF15: process = "Differential lossless, arithmetic coding"; break; - default: process = "Unknown"; break; - }*/ -} -/* }}} */ - -/* forward declarations */ -static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC); -static int exif_process_IFD_TAG( image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC); - -/* {{{ exif_get_markername - Get name of marker */ -#ifdef EXIF_DEBUG -static char * exif_get_markername(int marker) -{ - switch(marker) { - case 0xC0: return "SOF0"; - case 0xC1: return "SOF1"; - case 0xC2: return "SOF2"; - case 0xC3: return "SOF3"; - case 0xC4: return "DHT"; - case 0xC5: return "SOF5"; - case 0xC6: return "SOF6"; - case 0xC7: return "SOF7"; - case 0xC9: return "SOF9"; - case 0xCA: return "SOF10"; - case 0xCB: return "SOF11"; - case 0xCD: return "SOF13"; - case 0xCE: return "SOF14"; - case 0xCF: return "SOF15"; - case 0xD8: return "SOI"; - case 0xD9: return "EOI"; - case 0xDA: return "SOS"; - case 0xDB: return "DQT"; - case 0xDC: return "DNL"; - case 0xDD: return "DRI"; - case 0xDE: return "DHP"; - case 0xDF: return "EXP"; - case 0xE0: return "APP0"; - case 0xE1: return "EXIF"; - case 0xE2: return "FPIX"; - case 0xE3: return "APP3"; - case 0xE4: return "APP4"; - case 0xE5: return "APP5"; - case 0xE6: return "APP6"; - case 0xE7: return "APP7"; - case 0xE8: return "APP8"; - case 0xE9: return "APP9"; - case 0xEA: return "APP10"; - case 0xEB: return "APP11"; - case 0xEC: return "APP12"; - case 0xED: return "APP13"; - case 0xEE: return "APP14"; - case 0xEF: return "APP15"; - case 0xF0: return "JPG0"; - case 0xFD: return "JPG13"; - case 0xFE: return "COM"; - case 0x01: return "TEM"; - } - return "Unknown"; -} -#endif -/* }}} */ - -/* {{{ proto string exif_tagname(index) - Get headername for index or false if not defined */ -PHP_FUNCTION(exif_tagname) -{ - zval **p_num; - int tag, ac = ZEND_NUM_ARGS(); - char *szTemp; - - if ((ac < 1 || ac > 1) || zend_get_parameters_ex(ac, &p_num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(p_num); - tag = Z_LVAL_PP(p_num); - szTemp = exif_get_tagname(tag, NULL, 0, tag_table_IFD TSRMLS_CC); - if (tag<0 || !szTemp || !szTemp[0]) { - RETURN_BOOL(FALSE); - } else { - RETURN_STRING(szTemp, 1) - } -} -/* }}} */ - -/* {{{ exif_ifd_make_value - * Create a value for an ifd from an info_data pointer */ -static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel TSRMLS_DC) { - size_t byte_count; - char *value_ptr, *data_ptr; - size_t i; - - image_info_value *info_value; - - byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length; - value_ptr = safe_emalloc(max(byte_count, 4), 1, 0); - memset(value_ptr, 0, 4); - if (!info_data->length) { - return value_ptr; - } - if (info_data->format == TAG_FMT_UNDEFINED || info_data->format == TAG_FMT_STRING - || (byte_count>1 && (info_data->format == TAG_FMT_BYTE || info_data->format == TAG_FMT_SBYTE)) - ) { - memmove(value_ptr, info_data->value.s, byte_count); - return value_ptr; - } else if (info_data->format == TAG_FMT_BYTE) { - *value_ptr = info_data->value.u; - return value_ptr; - } else if (info_data->format == TAG_FMT_SBYTE) { - *value_ptr = info_data->value.i; - return value_ptr; - } else { - data_ptr = value_ptr; - for(i=0; ilength; i++) { - if (info_data->length==1) { - info_value = &info_data->value; - } else { - info_value = &info_data->value.list[i]; - } - switch(info_data->format) { - case TAG_FMT_USHORT: - php_ifd_set16u(data_ptr, info_value->u, motorola_intel); - data_ptr += 2; - break; - case TAG_FMT_ULONG: - php_ifd_set32u(data_ptr, info_value->u, motorola_intel); - data_ptr += 4; - break; - case TAG_FMT_SSHORT: - php_ifd_set16u(data_ptr, info_value->i, motorola_intel); - data_ptr += 2; - break; - case TAG_FMT_SLONG: - php_ifd_set32u(data_ptr, info_value->i, motorola_intel); - data_ptr += 4; - break; - case TAG_FMT_URATIONAL: - php_ifd_set32u(data_ptr, info_value->sr.num, motorola_intel); - php_ifd_set32u(data_ptr+4, info_value->sr.den, motorola_intel); - data_ptr += 8; - break; - case TAG_FMT_SRATIONAL: - php_ifd_set32u(data_ptr, info_value->ur.num, motorola_intel); - php_ifd_set32u(data_ptr+4, info_value->ur.den, motorola_intel); - data_ptr += 8; - break; - case TAG_FMT_SINGLE: - memmove(data_ptr, &info_data->value.f, byte_count); - data_ptr += 4; - break; - case TAG_FMT_DOUBLE: - memmove(data_ptr, &info_data->value.d, byte_count); - data_ptr += 8; - break; - } - } - } - return value_ptr; -} -/* }}} */ - -/* {{{ exif_thumbnail_build - * Check and build thumbnail */ -static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) { - size_t new_size, new_move, new_value; - char *new_data; - void *value_ptr; - int i, byte_count; - image_info_list *info_list; - image_info_data *info_data; -#ifdef EXIF_DEBUG - char tagname[64]; -#endif - - if (!ImageInfo->read_thumbnail || !ImageInfo->Thumbnail.offset || !ImageInfo->Thumbnail.size) { - return; /* ignore this call */ - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: filetype = %d", ImageInfo->Thumbnail.filetype); -#endif - switch(ImageInfo->Thumbnail.filetype) { - default: - case IMAGE_FILETYPE_JPEG: - /* done */ - break; - case IMAGE_FILETYPE_TIFF_II: - case IMAGE_FILETYPE_TIFF_MM: - info_list = &ImageInfo->info_list[SECTION_THUMBNAIL]; - new_size = 8 + 2 + info_list->count * 12 + 4; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: size of signature + directory(%d): 0x%02X", info_list->count, new_size); -#endif - new_value= new_size; /* offset for ifd values outside ifd directory */ - for (i=0; icount; i++) { - info_data = &info_list->list[i]; - byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length; - if (byte_count > 4) { - new_size += byte_count; - } - } - new_move = new_size; - new_data = safe_erealloc(ImageInfo->Thumbnail.data, 1, ImageInfo->Thumbnail.size, new_size); - ImageInfo->Thumbnail.data = new_data; - memmove(ImageInfo->Thumbnail.data + new_move, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); - ImageInfo->Thumbnail.size += new_size; - /* fill in data */ - if (ImageInfo->motorola_intel) { - memmove(new_data, "MM\x00\x2a\x00\x00\x00\x08", 8); - } else { - memmove(new_data, "II\x2a\x00\x08\x00\x00\x00", 8); - } - new_data += 8; - php_ifd_set16u(new_data, info_list->count, ImageInfo->motorola_intel); - new_data += 2; - for (i=0; icount; i++) { - info_data = &info_list->list[i]; - byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process tag(x%04X=%s): %s%s (%d bytes)", info_data->tag, exif_get_tagname(info_data->tag, tagname, -12, tag_table_IFD TSRMLS_CC), (info_data->length>1)&&info_data->format!=TAG_FMT_UNDEFINED&&info_data->format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(info_data->format), byte_count); -#endif - if (info_data->tag==TAG_STRIP_OFFSETS || info_data->tag==TAG_JPEG_INTERCHANGE_FORMAT) { - php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel); - php_ifd_set16u(new_data + 2, TAG_FMT_ULONG, ImageInfo->motorola_intel); - php_ifd_set32u(new_data + 4, 1, ImageInfo->motorola_intel); - php_ifd_set32u(new_data + 8, new_move, ImageInfo->motorola_intel); - } else { - php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel); - php_ifd_set16u(new_data + 2, info_data->format, ImageInfo->motorola_intel); - php_ifd_set32u(new_data + 4, info_data->length, ImageInfo->motorola_intel); - value_ptr = exif_ifd_make_value(info_data, ImageInfo->motorola_intel TSRMLS_CC); - if (byte_count <= 4) { - memmove(new_data+8, value_ptr, 4); - } else { - php_ifd_set32u(new_data+8, new_value, ImageInfo->motorola_intel); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: writing with value offset: 0x%04X + 0x%02X", new_value, byte_count); -#endif - memmove(ImageInfo->Thumbnail.data+new_value, value_ptr, byte_count); - new_value += byte_count; - } - efree(value_ptr); - } - new_data += 12; - } - memset(new_data, 0, 4); /* next ifd pointer */ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: created"); -#endif - break; - } -} -/* }}} */ - -/* {{{ exif_thumbnail_extract - * Grab the thumbnail, corrected */ -static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length TSRMLS_DC) { - if (ImageInfo->Thumbnail.data) { - exif_error_docref("exif_read_data#error_mult_thumb" EXIFERR_CC, ImageInfo, E_WARNING, "Multiple possible thumbnails"); - return; /* Should not happen */ - } - if (!ImageInfo->read_thumbnail) { - return; /* ignore this call */ - } - /* according to exif2.1, the thumbnail is not supposed to be greater than 64K */ - if (ImageInfo->Thumbnail.size >= 65536 - || ImageInfo->Thumbnail.size <= 0 - || ImageInfo->Thumbnail.offset <= 0 - ) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Illegal thumbnail size/offset"); - return; - } - /* Check to make sure we are not going to go past the ExifLength */ - if ((ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length) { - EXIF_ERRLOG_THUMBEOF(ImageInfo) - return; - } - ImageInfo->Thumbnail.data = estrndup(offset + ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); - exif_thumbnail_build(ImageInfo TSRMLS_CC); -} -/* }}} */ - -/* {{{ exif_process_undefined - * Copy a string/buffer in Exif header to a character string and return length of allocated buffer if any. */ -static int exif_process_undefined(char **result, char *value, size_t byte_count TSRMLS_DC) { - /* we cannot use strlcpy - here the problem is that we have to copy NUL - * chars up to byte_count, we also have to add a single NUL character to - * force end of string. - * estrndup does not return length - */ - if (byte_count) { - (*result) = estrndup(value, byte_count); /* NULL @ byte_count!!! */ - return byte_count+1; - } - return 0; -} -/* }}} */ - -/* {{{ exif_process_string_raw - * Copy a string in Exif header to a character string returns length of allocated buffer if any. */ -#if !EXIF_USE_MBSTRING -static int exif_process_string_raw(char **result, char *value, size_t byte_count) { - /* we cannot use strlcpy - here the problem is that we have to copy NUL - * chars up to byte_count, we also have to add a single NUL character to - * force end of string. - */ - if (byte_count) { - (*result) = safe_emalloc(byte_count, 1, 1); - memcpy(*result, value, byte_count); - (*result)[byte_count] = '\0'; - return byte_count+1; - } - return 0; -} -#endif -/* }}} */ - -/* {{{ exif_process_string - * Copy a string in Exif header to a character string and return length of allocated buffer if any. - * In contrast to exif_process_string this function does allways return a string buffer */ -static int exif_process_string(char **result, char *value, size_t byte_count TSRMLS_DC) { - /* we cannot use strlcpy - here the problem is that we cannot use strlen to - * determin length of string and we cannot use strlcpy with len=byte_count+1 - * because then we might get into an EXCEPTION if we exceed an allocated - * memory page...so we use php_strnlen in conjunction with memcpy and add the NUL - * char. - * estrdup would sometimes allocate more memory and does not return length - */ - if ((byte_count=php_strnlen(value, byte_count)) > 0) { - return exif_process_undefined(result, value, byte_count TSRMLS_CC); - } - (*result) = estrndup("", 1); /* force empty string */ - return byte_count+1; -} -/* }}} */ - -/* {{{ exif_process_user_comment - * Process UserComment in IFD. */ -static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount TSRMLS_DC) -{ - int a; - -#if EXIF_USE_MBSTRING - char *decode; - size_t len;; -#endif - - *pszEncoding = NULL; - /* Copy the comment */ - if (ByteCount>=8) { - if (!memcmp(szValuePtr, "UNICODE\0", 8)) { - *pszEncoding = estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; -#if EXIF_USE_MBSTRING - /* First try to detect BOM: ZERO WIDTH NOBREAK SPACE (FEFF 16) - * since we have no encoding support for the BOM yet we skip that. - */ - if (!memcmp(szValuePtr, "\xFE\xFF", 2)) { - decode = "UCS-2BE"; - szValuePtr = szValuePtr+2; - ByteCount -= 2; - } else if (!memcmp(szValuePtr, "\xFF\xFE", 2)) { - decode = "UCS-2LE"; - szValuePtr = szValuePtr+2; - ByteCount -= 2; - } else if (ImageInfo->motorola_intel) { - decode = ImageInfo->decode_unicode_be; - } else { - decode = ImageInfo->decode_unicode_le; - } - *pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, decode, &len TSRMLS_CC); - return len; -#else - return exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount); -#endif - } else - if (!memcmp(szValuePtr, "ASCII\0\0\0", 8)) { - *pszEncoding = estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; - } else - if (!memcmp(szValuePtr, "JIS\0\0\0\0\0", 8)) { - /* JIS should be tanslated to MB or we leave it to the user - leave it to the user */ - *pszEncoding = estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; -#if EXIF_USE_MBSTRING - if (ImageInfo->motorola_intel) { - *pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_jis, ImageInfo->decode_jis_be, &len TSRMLS_CC); - } else { - *pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_jis, ImageInfo->decode_jis_le, &len TSRMLS_CC); - } - return len; -#else - return exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount); -#endif - } else - if (!memcmp(szValuePtr, "\0\0\0\0\0\0\0\0", 8)) { - /* 8 NULL means undefined and should be ASCII... */ - *pszEncoding = estrdup("UNDEFINED"); - szValuePtr = szValuePtr+8; - ByteCount -= 8; - } - } - - /* Olympus has this padded with trailing spaces. Remove these first. */ - if (ByteCount>0) { - for (a=ByteCount-1;a && szValuePtr[a]==' ';a--) { - (szValuePtr)[a] = '\0'; - } - } - - /* normal text without encoding */ - exif_process_string(pszInfoPtr, szValuePtr, ByteCount TSRMLS_CC); - return strlen(*pszInfoPtr); -} -/* }}} */ - -/* {{{ exif_process_unicode - * Process unicode field in IFD. */ -static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC) -{ - xp_field->tag = tag; - - /* Copy the comment */ -#if EXIF_USE_MBSTRING -/* What if MS supports big-endian with XP? */ -/* if (ImageInfo->motorola_intel) { - xp_field->value = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_be, &xp_field->size TSRMLS_CC); - } else { - xp_field->value = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_le, &xp_field->size TSRMLS_CC); - }*/ - xp_field->value = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_le, &xp_field->size TSRMLS_CC); - return xp_field->size; -#else - xp_field->size = exif_process_string_raw(&xp_field->value, szValuePtr, ByteCount); - return xp_field->size; -#endif -} -/* }}} */ - -/* {{{ exif_process_IFD_in_MAKERNOTE - * Process nested IFDs directories in Maker Note. */ -static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement TSRMLS_DC) -{ - int de, i=0, section_index = SECTION_MAKERNOTE; - int NumDirEntries, old_motorola_intel, offset_diff; - const maker_note_type *maker_note; - char *dir_start; - - for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) { - if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) - return FALSE; - maker_note = maker_note_array+i; - - /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/ - if (maker_note->make && (!ImageInfo->make || strcmp(maker_note->make, ImageInfo->make))) - continue; - if (maker_note->model && (!ImageInfo->model || strcmp(maker_note->model, ImageInfo->model))) - continue; - if (maker_note->id_string && strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len)) - continue; - break; - } - - dir_start = value_ptr + maker_note->offset; - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s @x%04X + 0x%04X=%d: %s", exif_get_sectionname(section_index), (int)dir_start-(int)offset_base+maker_note->offset+displacement, value_len, value_len, exif_char_dump(value_ptr, value_len, (int)dir_start-(int)offset_base+maker_note->offset+displacement)); -#endif - - ImageInfo->sections_found |= FOUND_MAKERNOTE; - - old_motorola_intel = ImageInfo->motorola_intel; - switch (maker_note->byte_order) { - case MN_ORDER_INTEL: - ImageInfo->motorola_intel = 0; - break; - case MN_ORDER_MOTOROLA: - ImageInfo->motorola_intel = 1; - break; - default: - case MN_ORDER_NORMAL: - break; - } - - NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel); - - switch (maker_note->offset_mode) { - case MN_OFFSET_MAKER: - offset_base = value_ptr; - break; - case MN_OFFSET_GUESS: - offset_diff = 2 + NumDirEntries*12 + 4 - php_ifd_get32u(dir_start+10, ImageInfo->motorola_intel); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Using automatic offset correction: 0x%04X", ((int)dir_start-(int)offset_base+maker_note->offset+displacement) + offset_diff); -#endif - offset_base = value_ptr + offset_diff; - break; - default: - case MN_OFFSET_NORMAL: - break; - } - - if ((2+NumDirEntries*12) > value_len) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + x%04X*12 = x%04X > x%04X", NumDirEntries, 2+NumDirEntries*12, value_len); - return FALSE; - } - - for (de=0;detag_table TSRMLS_CC)) { - return FALSE; - } - } - ImageInfo->motorola_intel = old_motorola_intel; -/* NextDirOffset (must be NULL) = php_ifd_get32u(dir_start+2+12*de, ImageInfo->motorola_intel);*/ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Subsection %s done", exif_get_sectionname(SECTION_MAKERNOTE)); -#endif - return TRUE; -} -/* }}} */ - -/* {{{ exif_process_IFD_TAG - * Process one of the nested IFDs directories. */ -static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC) -{ - size_t length; - int tag, format, components; - char *value_ptr, tagname[64], cbuf[32], *outside=NULL; - size_t byte_count, offset_val, fpos, fgot; - xp_field_type *tmp_xp; -#ifdef EXIF_DEBUG - char *dump_data; - int dump_free; -#endif /* EXIF_DEBUG */ - - /* Protect against corrupt headers */ - if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "corrupt EXIF header: maximum directory nesting level reached"); - return FALSE; - } - ImageInfo->ifd_nesting_level++; - - tag = php_ifd_get16u(dir_entry, ImageInfo->motorola_intel); - format = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); - components = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel); - - if (!format || format > NUM_FORMATS) { - /* (-1) catches illegal zero case as unsigned underflows to positive large. */ - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal format code 0x%04X, suppose BYTE", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), format); - format = TAG_FMT_BYTE; - /*return TRUE;*/ - } - - byte_count = components * php_tiff_bytes_per_format[format]; - - if ((ssize_t)byte_count < 0) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal byte_count(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), byte_count); - return FALSE; - } - - if (byte_count > 4) { - offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - /* If its bigger than 4 bytes, the dir entry contains an offset. */ - value_ptr = offset_base+offset_val; - if (offset_val+byte_count > IFDlength || value_ptr < dir_entry) { - /* It is important to check for IMAGE_FILETYPE_TIFF - * JPEG does not use absolute pointers instead its pointers are - * relative to the start of the TIFF header in APP1 section. */ - if (offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM && ImageInfo->FileType!=IMAGE_FILETYPE_JPEG)) { - if (value_ptr < dir_entry) { - /* we can read this if offset_val > 0 */ - /* some files have their values in other parts of the file */ - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X < x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val, dir_entry); - } else { - /* this is for sure not allowed */ - /* exception are IFD pointers */ - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X + x%04X = x%04X > x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val, byte_count, offset_val+byte_count, IFDlength); - } - return FALSE; - } - if (byte_count>sizeof(cbuf)) { - /* mark as outside range and get buffer */ - value_ptr = safe_emalloc(byte_count, 1, 0); - outside = value_ptr; - } else { - /* In most cases we only access a small range so - * it is faster to use a static buffer there - * BUT it offers also the possibility to have - * pointers read without the need to free them - * explicitley before returning. */ - memset(&cbuf, 0, sizeof(cbuf)); - value_ptr = cbuf; - } - - fpos = php_stream_tell(ImageInfo->infile); - php_stream_seek(ImageInfo->infile, offset_val, SEEK_SET); - fgot = php_stream_tell(ImageInfo->infile); - if (fgot!=offset_val) { - EFREE_IF(outside); - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Wrong file pointer: 0x%08X != 0x08X", fgot, offset_val); - return FALSE; - } - fgot = php_stream_read(ImageInfo->infile, value_ptr, byte_count); - php_stream_seek(ImageInfo->infile, fpos, SEEK_SET); - if (fgotsections_found |= FOUND_ANY_TAG; -#ifdef EXIF_DEBUG - dump_data = exif_dump_data(&dump_free, format, components, length, ImageInfo->motorola_intel, value_ptr TSRMLS_CC); - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s %s", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(format), dump_data); - if (dump_free) { - efree(dump_data); - } -#endif - if (section_index==SECTION_THUMBNAIL) { - if (!ImageInfo->Thumbnail.data) { - switch(tag) { - case TAG_IMAGEWIDTH: - case TAG_COMP_IMAGE_WIDTH: - ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_IMAGEHEIGHT: - case TAG_COMP_IMAGE_HEIGHT: - ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_STRIP_OFFSETS: - case TAG_JPEG_INTERCHANGE_FORMAT: - /* accept both formats */ - ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_STRIP_BYTE_COUNTS: - if (ImageInfo->FileType == IMAGE_FILETYPE_TIFF_II || ImageInfo->FileType == IMAGE_FILETYPE_TIFF_MM) { - ImageInfo->Thumbnail.filetype = ImageInfo->FileType; - } else { - /* motorola is easier to read */ - ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_TIFF_MM; - } - ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_JPEG_INTERCHANGE_FORMAT_LEN: - if (ImageInfo->Thumbnail.filetype == IMAGE_FILETYPE_UNKNOWN) { - ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_JPEG; - ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - } - break; - } - } - } else { - if (section_index==SECTION_IFD0 || section_index==SECTION_EXIF) - switch(tag) { - case TAG_COPYRIGHT: - /* check for " NUL NUL" */ - if (byte_count>1 && (length=php_strnlen(value_ptr, byte_count)) > 0) { - if (lengthCopyrightPhotographer = estrdup(value_ptr); - ImageInfo->CopyrightEditor = estrdup(value_ptr+length+1); - spprintf(&ImageInfo->Copyright, 0, "%s, %s", value_ptr, value_ptr+length+1); - /* format = TAG_FMT_UNDEFINED; this musn't be ASCII */ - /* but we are not supposed to change this */ - /* keep in mind that image_info does not store editor value */ - } else { - ImageInfo->Copyright = estrdup(value_ptr); - } - } - break; - - case TAG_USERCOMMENT: - ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count TSRMLS_CC); - break; - - case TAG_XP_TITLE: - case TAG_XP_COMMENTS: - case TAG_XP_AUTHOR: - case TAG_XP_KEYWORDS: - case TAG_XP_SUBJECT: - tmp_xp = (xp_field_type*)safe_erealloc(ImageInfo->xp_fields.list, (ImageInfo->xp_fields.count+1), sizeof(xp_field_type), 0); - ImageInfo->sections_found |= FOUND_WINXP; - ImageInfo->xp_fields.list = tmp_xp; - ImageInfo->xp_fields.count++; - exif_process_unicode(ImageInfo, &(ImageInfo->xp_fields.list[ImageInfo->xp_fields.count-1]), tag, value_ptr, byte_count TSRMLS_CC); - break; - - case TAG_FNUMBER: - /* Simplest way of expressing aperture, so I trust it the most. - (overwrite previously computed value if there is one) */ - ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_APERTURE: - case TAG_MAX_APERTURE: - /* More relevant info always comes earlier, so only use this field if we don't - have appropriate aperture information yet. */ - if (ImageInfo->ApertureFNumber == 0) { - ImageInfo->ApertureFNumber - = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2)*0.5); - } - break; - - case TAG_SHUTTERSPEED: - /* More complicated way of expressing exposure time, so only use - this value if we don't already have it from somewhere else. - SHUTTERSPEED comes after EXPOSURE TIME - */ - if (ImageInfo->ExposureTime == 0) { - ImageInfo->ExposureTime - = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2))); - } - break; - case TAG_EXPOSURETIME: - ImageInfo->ExposureTime = -1; - break; - - case TAG_COMP_IMAGE_WIDTH: - ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_FOCALPLANE_X_RES: - ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_SUBJECT_DISTANCE: - /* Inidcates the distacne the autofocus camera is focused to. - Tends to be less accurate as distance increases. */ - ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC); - break; - - case TAG_FOCALPLANE_RESOLUTION_UNIT: - switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)) { - case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */ - case 2: - /* According to the information I was using, 2 measn meters. - But looking at the Cannon powershot's files, inches is the only - sensible value. */ - ImageInfo->FocalplaneUnits = 25.4; - break; - - case 3: ImageInfo->FocalplaneUnits = 10; break; /* centimeter */ - case 4: ImageInfo->FocalplaneUnits = 1; break; /* milimeter */ - case 5: ImageInfo->FocalplaneUnits = .001; break; /* micrometer */ - } - break; - - case TAG_SUB_IFD: - if (format==TAG_FMT_IFD) { - /* If this is called we are either in a TIFFs thumbnail or a JPEG where we cannot handle it */ - /* TIFF thumbnail: our data structure cannot store a thumbnail of a thumbnail */ - /* JPEG do we have the data area and what to do with it */ - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Skip SUB IFD"); - } - break; - - case TAG_MAKE: - ImageInfo->make = estrdup(value_ptr); - break; - case TAG_MODEL: - ImageInfo->model = estrdup(value_ptr); - break; - - case TAG_MAKER_NOTE: - exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement TSRMLS_CC); - break; - - case TAG_EXIF_IFD_POINTER: - case TAG_GPS_IFD_POINTER: - case TAG_INTEROP_IFD_POINTER: - if (ReadNextIFD) { - char *Subdir_start; - int sub_section_index = 0; - switch(tag) { - case TAG_EXIF_IFD_POINTER: -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Found EXIF"); -#endif - ImageInfo->sections_found |= FOUND_EXIF; - sub_section_index = SECTION_EXIF; - break; - case TAG_GPS_IFD_POINTER: -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Found GPS"); -#endif - ImageInfo->sections_found |= FOUND_GPS; - sub_section_index = SECTION_GPS; - break; - case TAG_INTEROP_IFD_POINTER: -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Found INTEROPERABILITY"); -#endif - ImageInfo->sections_found |= FOUND_INTEROP; - sub_section_index = SECTION_INTEROP; - break; - } - Subdir_start = offset_base + php_ifd_get32u(value_ptr, ImageInfo->motorola_intel); - if (Subdir_start < offset_base || Subdir_start > offset_base+IFDlength) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer"); - return FALSE; - } - if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index TSRMLS_CC)) { - return FALSE; - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Subsection %s done", exif_get_sectionname(sub_section_index)); -#endif - } - } - } - exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table TSRMLS_CC), tag, format, components, value_ptr TSRMLS_CC); - EFREE_IF(outside); - return TRUE; -} -/* }}} */ - -/* {{{ exif_process_IFD_in_JPEG - * Process one of the nested IFDs directories. */ -static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC) -{ - int de; - int NumDirEntries; - int NextDirOffset; - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s (x%04X(=%d))", exif_get_sectionname(section_index), IFDlength, IFDlength); -#endif - - ImageInfo->sections_found |= FOUND_IFD0; - - NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel); - - if ((dir_start+2+NumDirEntries*12) > (offset_base+IFDlength)) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: x%04X + 2 + x%04X*12 = x%04X > x%04X", (int)((size_t)dir_start+2-(size_t)offset_base), NumDirEntries, (int)((size_t)dir_start+2+NumDirEntries*12-(size_t)offset_base), IFDlength); - return FALSE; - } - - for (de=0;demotorola_intel); - if (NextDirOffset) { - /* the next line seems false but here IFDlength means length of all IFDs */ - if (offset_base + NextDirOffset < offset_base || offset_base + NextDirOffset > offset_base+IFDlength) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD offset"); - return FALSE; - } - /* That is the IFD for the first thumbnail */ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Expect next IFD to be thumbnail"); -#endif - if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL TSRMLS_CC)) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail size: 0x%04X", ImageInfo->Thumbnail.size); -#endif - if (ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN - && ImageInfo->Thumbnail.size - && ImageInfo->Thumbnail.offset - && ImageInfo->read_thumbnail - ) { - exif_thumbnail_extract(ImageInfo, offset_base, IFDlength TSRMLS_CC); - } - return TRUE; - } else { - return FALSE; - } - } - return TRUE; -} -/* }}} */ - -/* {{{ exif_process_TIFF_in_JPEG - Process a TIFF header in a JPEG file -*/ -static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC) -{ - unsigned exif_value_2a, offset_of_ifd; - - /* set the thumbnail stuff to nothing so we can test to see if they get set up */ - if (memcmp(CharBuf, "II", 2) == 0) { - ImageInfo->motorola_intel = 0; - } else if (memcmp(CharBuf, "MM", 2) == 0) { - ImageInfo->motorola_intel = 1; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF alignment marker"); - return; - } - - /* Check the next two values for correctness. */ - exif_value_2a = php_ifd_get16u(CharBuf+2, ImageInfo->motorola_intel); - offset_of_ifd = php_ifd_get32u(CharBuf+4, ImageInfo->motorola_intel); - if ( exif_value_2a != 0x2a || offset_of_ifd < 0x08) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF start (1)"); - return; - } - - ImageInfo->sections_found |= FOUND_IFD0; - /* First directory starts at offset 8. Offsets starts at 0. */ - exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0 TSRMLS_CC); - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process TIFF in JPEG done"); -#endif - - /* Compute the CCD width, in milimeters. */ - if (ImageInfo->FocalplaneXRes != 0) { - ImageInfo->CCDWidth = (float)(ImageInfo->ExifImageWidth * ImageInfo->FocalplaneUnits / ImageInfo->FocalplaneXRes); - } -} -/* }}} */ - -/* {{{ exif_process_APP1 - Process an JPEG APP1 block marker - Describes all the drivel that most digital cameras include... -*/ -static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC) -{ - /* Check the APP1 for Exif Identifier Code */ - static const uchar ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; - if (memcmp(CharBuf+2, ExifHeader, 6)) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Incorrect APP1 Exif Identifier Code"); - return; - } - exif_process_TIFF_in_JPEG(ImageInfo, CharBuf + 8, length - 8, displacement+8 TSRMLS_CC); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process APP1/EXIF done"); -#endif -} -/* }}} */ - -/* {{{ exif_process_APP12 - Process an JPEG APP12 block marker used by OLYMPUS -*/ -static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length TSRMLS_DC) -{ - size_t l1, l2=0; - - if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { - exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC); - if (length > 2+l1+1) { - l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1); - exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC); - } - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process section APP12 with l1=%d, l2=%d done", l1, l2); -#endif -} -/* }}} */ - -/* {{{ exif_scan_JPEG_header - * Parse the marker stream until SOS or EOI is seen; */ -static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC) -{ - int section, sn; - int marker = 0, last_marker = M_PSEUDO, comment_correction=1; - unsigned int ll, lh; - uchar *Data; - size_t fpos, size, got, itemlen; - jpeg_sof_info sof_info; - - for(section=0;;section++) { -#ifdef EXIF_DEBUG - fpos = php_stream_tell(ImageInfo->infile); - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Needing section %d @ 0x%08X", ImageInfo->file.count, fpos); -#endif - - /* get marker byte, swallowing possible padding */ - /* some software does not count the length bytes of COM section */ - /* one company doing so is very much envolved in JPEG... so we accept too */ - if (last_marker==M_COM && comment_correction) { - comment_correction = 2; - } - do { - if ((marker = php_stream_getc(ImageInfo->infile)) == EOF) { - EXIF_ERRLOG_CORRUPT(ImageInfo) - return FALSE; - } - if (last_marker==M_COM && comment_correction>0) { - if (marker!=0xFF) { - marker = 0xff; - comment_correction--; - } else { - last_marker = M_PSEUDO; /* stop skipping 0 for M_COM */ - } - } - } while (marker == 0xff); - if (last_marker==M_COM && !comment_correction) { - exif_error_docref("exif_read_data#error_mcom" EXIFERR_CC, ImageInfo, E_NOTICE, "Image has corrupt COM section: some software set wrong length information"); - } - if (last_marker==M_COM && comment_correction) - return M_EOI; /* ah illegal: char after COM section not 0xFF */ - - fpos = php_stream_tell(ImageInfo->infile); - - if (marker == 0xff) { - /* 0xff is legal padding, but if we get that many, something's wrong. */ - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "To many padding bytes"); - return FALSE; - } - - /* Read the length of the section. */ - lh = php_stream_getc(ImageInfo->infile); - ll = php_stream_getc(ImageInfo->infile); - - itemlen = (lh << 8) | ll; - - if (itemlen < 2) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s, Section length: 0x%02X%02X", EXIF_ERROR_CORRUPT, lh, ll); -#else - EXIF_ERRLOG_CORRUPT(ImageInfo) -#endif - return FALSE; - } - - sn = exif_file_sections_add(ImageInfo, marker, itemlen+1, NULL); - Data = ImageInfo->file.list[sn].data; - - /* Store first two pre-read bytes. */ - Data[0] = (uchar)lh; - Data[1] = (uchar)ll; - - got = php_stream_read(ImageInfo->infile, (char*)(Data+2), itemlen-2); /* Read the whole section. */ - if (got != itemlen-2) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error reading from file: got=x%04X(=%d) != itemlen-2=x%04X(=%d)", got, got, itemlen-2, itemlen-2); - return FALSE; - } - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process section(x%02X=%s) @ x%04X + x%04X(=%d)", marker, exif_get_markername(marker), fpos, itemlen, itemlen); -#endif - switch(marker) { - case M_SOS: /* stop before hitting compressed data */ - /* If reading entire image is requested, read the rest of the data. */ - if (ImageInfo->read_all) { - /* Determine how much file is left. */ - fpos = php_stream_tell(ImageInfo->infile); - size = ImageInfo->FileSize - fpos; - sn = exif_file_sections_add(ImageInfo, M_PSEUDO, size, NULL); - Data = ImageInfo->file.list[sn].data; - got = php_stream_read(ImageInfo->infile, (char*)Data, size); - if (got != size) { - EXIF_ERRLOG_FILEEOF(ImageInfo) - return FALSE; - } - } - return TRUE; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "No image in jpeg!"); - return (ImageInfo->sections_found&(~FOUND_COMPUTED)) ? TRUE : FALSE; - - case M_COM: /* Comment section */ - exif_process_COM(ImageInfo, (char *)Data, itemlen TSRMLS_CC); - break; - - case M_EXIF: - if (!(ImageInfo->sections_found&FOUND_IFD0)) { - /*ImageInfo->sections_found |= FOUND_EXIF;*/ - /* Seen files from some 'U-lead' software with Vivitar scanner - that uses marker 31 later in the file (no clue what for!) */ - exif_process_APP1(ImageInfo, (char *)Data, itemlen, fpos TSRMLS_CC); - } - break; - - case M_APP12: - exif_process_APP12(ImageInfo, (char *)Data, itemlen TSRMLS_CC); - break; - - - case M_SOF0: - case M_SOF1: - case M_SOF2: - case M_SOF3: - case M_SOF5: - case M_SOF6: - case M_SOF7: - case M_SOF9: - case M_SOF10: - case M_SOF11: - case M_SOF13: - case M_SOF14: - case M_SOF15: - exif_process_SOFn(Data, marker, &sof_info); - ImageInfo->Width = sof_info.width; - ImageInfo->Height = sof_info.height; - if (sof_info.num_components == 3) { - ImageInfo->IsColor = 1; - } else { - ImageInfo->IsColor = 0; - } - break; - default: - /* skip any other marker silently. */ - break; - } - - /* keep track of last marker */ - last_marker = marker; - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Done"); -#endif - return TRUE; -} -/* }}} */ - -/* {{{ exif_scan_thumbnail - * scan JPEG in thumbnail (memory) */ -static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC) -{ - uchar c, *data = (uchar*)ImageInfo->Thumbnail.data; - int n, marker; - size_t length=2, pos=0; - jpeg_sof_info sof_info; - - if (!data) { - return FALSE; /* nothing to do here */ - } - if (memcmp(data, "\xFF\xD8\xFF", 3)) { - if (!ImageInfo->Thumbnail.width && !ImageInfo->Thumbnail.height) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Thumbnail is not a JPEG image"); - } - return FALSE; - } - for (;;) { - pos += length; - if (pos>=ImageInfo->Thumbnail.size) - return FALSE; - c = data[pos++]; - if (pos>=ImageInfo->Thumbnail.size) - return FALSE; - if (c != 0xFF) { - return FALSE; - } - n = 8; - while ((c = data[pos++]) == 0xFF && n--) { - if (pos+3>=ImageInfo->Thumbnail.size) - return FALSE; - /* +3 = pos++ of next check when reaching marker + 2 bytes for length */ - } - if (c == 0xFF) - return FALSE; - marker = c; - length = php_jpg_get16(data+pos); - if (pos+length>=ImageInfo->Thumbnail.size) { - return FALSE; - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process section(x%02X=%s) @ x%04X + x%04X", marker, exif_get_markername(marker), pos, length); -#endif - switch (marker) { - case M_SOF0: - case M_SOF1: - case M_SOF2: - case M_SOF3: - case M_SOF5: - case M_SOF6: - case M_SOF7: - case M_SOF9: - case M_SOF10: - case M_SOF11: - case M_SOF13: - case M_SOF14: - case M_SOF15: - /* handle SOFn block */ - exif_process_SOFn(data+pos, marker, &sof_info); - ImageInfo->Thumbnail.height = sof_info.height; - ImageInfo->Thumbnail.width = sof_info.width; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: size: %d * %d", sof_info.width, sof_info.height); -#endif - return TRUE; - - case M_SOS: - case M_EOI: - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Could not compute size of thumbnail"); - return FALSE; - break; - - default: - /* just skip */ - break; - } - } - - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Could not compute size of thumbnail"); - return FALSE; -} -/* }}} */ - -/* {{{ exif_process_IFD_in_TIFF - * Parse the TIFF header; */ -static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index TSRMLS_DC) -{ - int i, sn, num_entries, sub_section_index = 0; - unsigned char *dir_entry; - char tagname[64]; - size_t ifd_size, dir_size, entry_offset, next_offset, entry_length, entry_value=0, fgot; - int entry_tag , entry_type; - tag_table_type tag_table = exif_get_tag_table(section_index); - - if (ImageInfo->FileSize >= dir_offset+2) { - sn = exif_file_sections_add(ImageInfo, M_PSEUDO, 2, NULL); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, 2); -#endif - php_stream_seek(ImageInfo->infile, dir_offset, SEEK_SET); /* we do not know the order of sections */ - php_stream_read(ImageInfo->infile, (char*)ImageInfo->file.list[sn].data, 2); - num_entries = php_ifd_get16u(ImageInfo->file.list[sn].data, ImageInfo->motorola_intel); - dir_size = 2/*num dir entries*/ +12/*length of entry*/*num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/; - if (ImageInfo->FileSize >= dir_offset+dir_size) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries); -#endif - if (exif_file_sections_realloc(ImageInfo, sn, dir_size TSRMLS_CC)) { - return FALSE; - } - php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+2), dir_size-2); - /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Dump: %s", exif_char_dump(ImageInfo->file.list[sn].data, dir_size, 0));*/ - next_offset = php_ifd_get32u(ImageInfo->file.list[sn].data + dir_size - 4, ImageInfo->motorola_intel); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF done, next offset x%04X", next_offset); -#endif - /* now we have the directory we can look how long it should be */ - ifd_size = dir_size; - for(i=0;ifile.list[sn].data+2+i*12; - entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel); - entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); - if (entry_type > NUM_FORMATS) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: tag(0x%04X,%12s): Illegal format code 0x%04X, switching to BYTE", entry_tag, exif_get_tagname(entry_tag, tagname, -12, tag_table TSRMLS_CC), entry_type); - /* Since this is repeated in exif_process_IFD_TAG make it a notice here */ - /* and make it a warning in the exif_process_IFD_TAG which is called */ - /* elsewhere. */ - entry_type = TAG_FMT_BYTE; - /*The next line would break the image on writeback: */ - /* php_ifd_set16u(dir_entry+2, entry_type, ImageInfo->motorola_intel);*/ - } - entry_length = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel) * php_tiff_bytes_per_format[entry_type]; - if (entry_length <= 4) { - switch(entry_type) { - case TAG_FMT_USHORT: - entry_value = php_ifd_get16u(dir_entry+8, ImageInfo->motorola_intel); - break; - case TAG_FMT_SSHORT: - entry_value = php_ifd_get16s(dir_entry+8, ImageInfo->motorola_intel); - break; - case TAG_FMT_ULONG: - entry_value = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - break; - case TAG_FMT_SLONG: - entry_value = php_ifd_get32s(dir_entry+8, ImageInfo->motorola_intel); - break; - } - switch(entry_tag) { - case TAG_IMAGEWIDTH: - case TAG_COMP_IMAGE_WIDTH: - ImageInfo->Width = entry_value; - break; - case TAG_IMAGEHEIGHT: - case TAG_COMP_IMAGE_HEIGHT: - ImageInfo->Height = entry_value; - break; - case TAG_PHOTOMETRIC_INTERPRETATION: - switch (entry_value) { - case PMI_BLACK_IS_ZERO: - case PMI_WHITE_IS_ZERO: - case PMI_TRANSPARENCY_MASK: - ImageInfo->IsColor = 0; - break; - case PMI_RGB: - case PMI_PALETTE_COLOR: - case PMI_SEPARATED: - case PMI_YCBCR: - case PMI_CIELAB: - ImageInfo->IsColor = 1; - break; - } - break; - } - } else { - entry_offset = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - /* if entry needs expading ifd cache and entry is at end of current ifd cache. */ - /* otherwise there may be huge holes between two entries */ - if (entry_offset + entry_length > dir_offset + ifd_size - && entry_offset == dir_offset + ifd_size) { - ifd_size = entry_offset + entry_length - dir_offset; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Resize struct: x%04X + x%04X - x%04X = x%04X", entry_offset, entry_length, dir_offset, ifd_size); -#endif - } - } - } - if (ImageInfo->FileSize >= dir_offset + ImageInfo->file.list[sn].size) { - if (ifd_size > dir_size) { - if (dir_offset + ifd_size > ImageInfo->FileSize) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size); - return FALSE; - } - if (exif_file_sections_realloc(ImageInfo, sn, ifd_size TSRMLS_CC)) { - return FALSE; - } - /* read values not stored in directory itself */ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size); -#endif - php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+dir_size), ifd_size-dir_size); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF, done"); -#endif - } - /* now process the tags */ - for(i=0;ifile.list[sn].data+2+i*12; - entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel); - entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); - /*entry_length = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel);*/ - if (entry_tag == TAG_EXIF_IFD_POINTER || - entry_tag == TAG_INTEROP_IFD_POINTER || - entry_tag == TAG_GPS_IFD_POINTER || - entry_tag == TAG_SUB_IFD - ) { - switch(entry_tag) { - case TAG_EXIF_IFD_POINTER: - ImageInfo->sections_found |= FOUND_EXIF; - sub_section_index = SECTION_EXIF; - break; - case TAG_GPS_IFD_POINTER: - ImageInfo->sections_found |= FOUND_GPS; - sub_section_index = SECTION_GPS; - break; - case TAG_INTEROP_IFD_POINTER: - ImageInfo->sections_found |= FOUND_INTEROP; - sub_section_index = SECTION_INTEROP; - break; - case TAG_SUB_IFD: - ImageInfo->sections_found |= FOUND_THUMBNAIL; - sub_section_index = SECTION_THUMBNAIL; - break; - } - entry_offset = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s @x%04X", exif_get_sectionname(sub_section_index), entry_offset); -#endif - exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index TSRMLS_CC); - if (section_index!=SECTION_THUMBNAIL && entry_tag==TAG_SUB_IFD) { - if (ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN - && ImageInfo->Thumbnail.size - && ImageInfo->Thumbnail.offset - && ImageInfo->read_thumbnail - ) { -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); -#endif - if (!ImageInfo->Thumbnail.data) { - ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0); - php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET); - fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); - if (fgot < ImageInfo->Thumbnail.size) { - EXIF_ERRLOG_THUMBEOF(ImageInfo) - } - exif_thumbnail_build(ImageInfo TSRMLS_CC); - } - } - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s done", exif_get_sectionname(sub_section_index)); -#endif - } else { - if (!exif_process_IFD_TAG(ImageInfo, (char*)dir_entry, - (char*)(ImageInfo->file.list[sn].data-dir_offset), - ifd_size, 0, section_index, 0, tag_table TSRMLS_CC)) { - return FALSE; - } - } - } - /* If we had a thumbnail in a SUB_IFD we have ANOTHER image in NEXT IFD */ - if (next_offset && section_index != SECTION_THUMBNAIL) { - /* this should be a thumbnail IFD */ - /* the thumbnail itself is stored at Tag=StripOffsets */ -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) at x%04X", next_offset); -#endif - exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL TSRMLS_CC); -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); -#endif - if (!ImageInfo->Thumbnail.data && ImageInfo->Thumbnail.offset && ImageInfo->Thumbnail.size && ImageInfo->read_thumbnail) { - ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0); - php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET); - fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); - if (fgot < ImageInfo->Thumbnail.size) { - EXIF_ERRLOG_THUMBEOF(ImageInfo) - } - exif_thumbnail_build(ImageInfo TSRMLS_CC); - } -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done"); -#endif - } - return TRUE; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X)", ImageInfo->FileSize, dir_offset+ImageInfo->file.list[sn].size); - return FALSE; - } - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+dir_size); - return FALSE; - } - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than start of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+2); - return FALSE; - } -} -/* }}} */ - -/* {{{ exif_scan_FILE_header - * Parse the marker stream until SOS or EOI is seen; */ -static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC) -{ - unsigned char file_header[8]; - int ret = FALSE; - - ImageInfo->FileType = IMAGE_FILETYPE_UNKNOWN; - - if (ImageInfo->FileSize >= 2) { - php_stream_seek(ImageInfo->infile, 0, SEEK_SET); - if (php_stream_read(ImageInfo->infile, (char*)file_header, 2) != 2) { - return FALSE; - } - if ((file_header[0]==0xff) && (file_header[1]==M_SOI)) { - ImageInfo->FileType = IMAGE_FILETYPE_JPEG; - if (exif_scan_JPEG_header(ImageInfo TSRMLS_CC)) { - ret = TRUE; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid JPEG file"); - } - } else if (ImageInfo->FileSize >= 8) { - if (php_stream_read(ImageInfo->infile, (char*)(file_header+2), 6) != 6) { - return FALSE; - } - if (!memcmp(file_header, "II\x2A\x00", 4)) { - ImageInfo->FileType = IMAGE_FILETYPE_TIFF_II; - ImageInfo->motorola_intel = 0; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "File has TIFF/II format"); -#endif - ImageInfo->sections_found |= FOUND_IFD0; - if (exif_process_IFD_in_TIFF(ImageInfo, - php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel), - SECTION_IFD0 TSRMLS_CC)) { - ret = TRUE; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file"); - } - } - else - if (!memcmp(file_header, "MM\x00\x2a", 4)) { - ImageInfo->FileType = IMAGE_FILETYPE_TIFF_MM; - ImageInfo->motorola_intel = 1; -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "File has TIFF/MM format"); -#endif - ImageInfo->sections_found |= FOUND_IFD0; - if (exif_process_IFD_in_TIFF(ImageInfo, - php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel), - SECTION_IFD0 TSRMLS_CC)) { - ret = TRUE; - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file"); - } - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "File not supported"); - return FALSE; - } - } - } else { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "File too small (%d)", ImageInfo->FileSize); - } - return ret; -} -/* }}} */ - -/* {{{ exif_discard_imageinfo - Discard data scanned by exif_read_file. -*/ -static int exif_discard_imageinfo(image_info_type *ImageInfo) -{ - int i; - - EFREE_IF(ImageInfo->FileName); - EFREE_IF(ImageInfo->UserComment); - EFREE_IF(ImageInfo->UserCommentEncoding); - EFREE_IF(ImageInfo->Copyright); - EFREE_IF(ImageInfo->CopyrightPhotographer); - EFREE_IF(ImageInfo->CopyrightEditor); - EFREE_IF(ImageInfo->Thumbnail.data); - EFREE_IF(ImageInfo->encode_unicode); - EFREE_IF(ImageInfo->decode_unicode_be); - EFREE_IF(ImageInfo->decode_unicode_le); - EFREE_IF(ImageInfo->encode_jis); - EFREE_IF(ImageInfo->decode_jis_be); - EFREE_IF(ImageInfo->decode_jis_le); - EFREE_IF(ImageInfo->make); - EFREE_IF(ImageInfo->model); - for (i=0; ixp_fields.count; i++) { - EFREE_IF(ImageInfo->xp_fields.list[i].value); - } - EFREE_IF(ImageInfo->xp_fields.list); - for (i=0; imotorola_intel = -1; /* flag as unknown */ - - ImageInfo->infile = php_stream_open_wrapper(FileName, "rb", STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL); - if (!ImageInfo->infile) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Unable to open file"); - return FALSE; - } - - if (php_stream_is(ImageInfo->infile, PHP_STREAM_IS_STDIO)) { - if (VCWD_STAT(FileName, &st) >= 0) { - if ((st.st_mode & S_IFMT) != S_IFREG) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Not a file"); - php_stream_close(ImageInfo->infile); - return FALSE; - } - - /* Store file date/time. */ -#ifdef NETWARE - ImageInfo->FileDateTime = st.st_mtime.tv_sec; -#else - ImageInfo->FileDateTime = st.st_mtime; -#endif - ImageInfo->FileSize = st.st_size; - /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Opened stream is file: %d", ImageInfo->FileSize);*/ - } - } else { - if (!ImageInfo->FileSize) { - php_stream_seek(ImageInfo->infile, 0, SEEK_END); - ImageInfo->FileSize = php_stream_tell(ImageInfo->infile); - php_stream_seek(ImageInfo->infile, 0, SEEK_SET); - } - } - - php_basename(FileName, strlen(FileName), NULL, 0, &(ImageInfo->FileName), NULL TSRMLS_CC); - ImageInfo->read_thumbnail = read_thumbnail; - ImageInfo->read_all = read_all; - ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_UNKNOWN; - - ImageInfo->encode_unicode = safe_estrdup(EXIF_G(encode_unicode)); - ImageInfo->decode_unicode_be = safe_estrdup(EXIF_G(decode_unicode_be)); - ImageInfo->decode_unicode_le = safe_estrdup(EXIF_G(decode_unicode_le)); - ImageInfo->encode_jis = safe_estrdup(EXIF_G(encode_jis)); - ImageInfo->decode_jis_be = safe_estrdup(EXIF_G(decode_jis_be)); - ImageInfo->decode_jis_le = safe_estrdup(EXIF_G(decode_jis_le)); - - - ImageInfo->ifd_nesting_level = 0; - - /* Scan the JPEG headers. */ - ret = exif_scan_FILE_header(ImageInfo TSRMLS_CC); - - php_stream_close(ImageInfo->infile); - return ret; -} -/* }}} */ - -/* {{{ proto array exif_read_data(string filename [, sections_needed [, sub_arrays[, read_thumbnail]]]) - Reads header data from the JPEG/TIFF image filename and optionally reads the internal thumbnails */ -PHP_FUNCTION(exif_read_data) -{ - zval **p_name, **p_sections_needed, **p_sub_arrays, **p_read_thumbnail, **p_read_all; - int i, ac = ZEND_NUM_ARGS(), ret, sections_needed=0, sub_arrays=0, read_thumbnail=0, read_all=0; - image_info_type ImageInfo; - char tmp[64], *sections_str, *s; - - memset(&ImageInfo, 0, sizeof(ImageInfo)); - - if ((ac < 1 || ac > 4) || zend_get_parameters_ex(ac, &p_name, &p_sections_needed, &p_sub_arrays, &p_read_thumbnail, &p_read_all) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(p_name); - - if(ac >= 2) { - convert_to_string_ex(p_sections_needed); - spprintf(§ions_str, 0, ",%s,", Z_STRVAL_PP(p_sections_needed)); - /* sections_str DOES start with , and SPACES are NOT allowed in names */ - s = sections_str; - while(*++s) { - if(*s==' ') { - *s = ','; - } - } - for (i=0; i= 3) { - convert_to_long_ex(p_sub_arrays); - sub_arrays = Z_LVAL_PP(p_sub_arrays); - } - if(ac >= 4) { - convert_to_long_ex(p_read_thumbnail); - read_thumbnail = Z_LVAL_PP(p_read_thumbnail); - } - if(ac >= 5) { - convert_to_long_ex(p_read_all); - read_all = Z_LVAL_PP(p_read_all); - } - /* parameters 3,4 will be working in later versions.... */ - read_all = 0; /* just to make function work for 4.2 tree */ - - ret = exif_read_file(&ImageInfo, Z_STRVAL_PP(p_name), read_thumbnail, read_all TSRMLS_CC); - - sections_str = exif_get_sectionlist(ImageInfo.sections_found TSRMLS_CC); - -#ifdef EXIF_DEBUG - if (sections_str) - exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Sections found: %s", sections_str[0] ? sections_str : "None"); -#endif - - ImageInfo.sections_found |= FOUND_COMPUTED|FOUND_FILE;/* do not inform about in debug*/ - - if (ret==FALSE || (sections_needed && !(sections_needed&ImageInfo.sections_found))) { - /* array_init must be checked at last! otherwise the array must be freed if a later test fails. */ - exif_discard_imageinfo(&ImageInfo); - EFREE_IF(sections_str); - RETURN_FALSE; - } - - array_init(return_value); - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Generate section FILE"); -#endif - - /* now we can add our information */ - exif_iif_add_str(&ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName TSRMLS_CC); - exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime TSRMLS_CC); - exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize TSRMLS_CC); - exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType TSRMLS_CC); - exif_iif_add_str(&ImageInfo, SECTION_FILE, "MimeType", (char*)php_image_type_to_mime_type(ImageInfo.FileType) TSRMLS_CC); - exif_iif_add_str(&ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE" TSRMLS_CC); - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Generate section COMPUTED"); -#endif - - if (ImageInfo.Width>0 && ImageInfo.Height>0) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "html" TSRMLS_CC, "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height); - exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height TSRMLS_CC); - exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width TSRMLS_CC); - } - exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor TSRMLS_CC); - if (ImageInfo.motorola_intel != -1) { - exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel TSRMLS_CC); - } - if (ImageInfo.FocalLength) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1Fmm", ImageInfo.FocalLength); - if(ImageInfo.CCDWidth) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength" TSRMLS_CC, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5)); - } - } - if(ImageInfo.CCDWidth) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth" TSRMLS_CC, "%dmm", (int)ImageInfo.CCDWidth); - } - if(ImageInfo.ExposureTime>0) { - if(ImageInfo.ExposureTime <= 0.5) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime)); - } else { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s", ImageInfo.ExposureTime); - } - } - if(ImageInfo.ApertureFNumber) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1F", ImageInfo.ApertureFNumber); - } - if(ImageInfo.Distance) { - if(ImageInfo.Distance<0) { - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite" TSRMLS_CC); - } else { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2Fm", ImageInfo.Distance); - } - } - if (ImageInfo.UserComment) { - exif_iif_add_buffer(&ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserCommentLength, ImageInfo.UserComment TSRMLS_CC); - if (ImageInfo.UserCommentEncoding && strlen(ImageInfo.UserCommentEncoding)) { - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding TSRMLS_CC); - } - } - - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright TSRMLS_CC); - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer TSRMLS_CC); - exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor TSRMLS_CC); - - for (i=0; i= 3) { - if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) { - exif_scan_thumbnail(&ImageInfo TSRMLS_CC); - } - zval_dtor(p_width); - zval_dtor(p_height); - ZVAL_LONG(p_width, ImageInfo.Thumbnail.width); - ZVAL_LONG(p_height, ImageInfo.Thumbnail.height); - } - if (arg_c >= 4) { - zval_dtor(p_imagetype); - ZVAL_LONG(p_imagetype, ImageInfo.Thumbnail.filetype); - } - -#ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Discarding info"); -#endif - - exif_discard_imageinfo(&ImageInfo); - -#ifdef EXIF_DEBUG - php_error_docref1(NULL TSRMLS_CC, p_name, E_NOTICE, "Done"); -#endif -} -/* }}} */ - -/* {{{ proto int exif_imagetype(string imagefile) - Get the type of an image */ -PHP_FUNCTION(exif_imagetype) -{ - zval **arg1; - php_stream * stream; - int itype = 0; - - if (ZEND_NUM_ARGS() != 1) - WRONG_PARAM_COUNT; - - if (zend_get_parameters_ex(1, &arg1) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_string_ex(arg1); - stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); - - if (stream == NULL) { - RETURN_FALSE; - } - - itype = php_getimagetype(stream, NULL TSRMLS_CC); - - php_stream_close(stream); - - if (itype == IMAGE_FILETYPE_UNKNOWN) { - RETURN_FALSE; - } else { - ZVAL_LONG(return_value, itype); - } -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 tw=78 fdm=marker - * vim<600: sw=4 ts=4 tw=78 - */ diff --git a/ext/exif/exif.dsp b/ext/exif/exif.dsp deleted file mode 100644 index 4a827338b2bb3..0000000000000 --- a/ext/exif/exif.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="exif" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=exif - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "exif.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "exif.mak" CFG="exif - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "exif - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "exif - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "exif - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_exif.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "exif - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /D "LIBZEND_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_exif.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "exif - Win32 Release_TS" -# Name "exif - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\exif.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_exif.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/exif/package.xml b/ext/exif/package.xml deleted file mode 100644 index 6bdb089612fb0..0000000000000 --- a/ext/exif/package.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - exif - Read header information from JPEG and DIFF headers - - - rasmus - Rasmus Lerdorf - helly@php.net - lead - - - helly - Markus Boerger - helly@php.net - lead - - - -The EXIF functions provide access to information stored in headers -of JPEG and TIFF images. This way you can read meta data generated -by digital cameras and certain image processing applications. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/exif/php_exif.h b/ext/exif/php_exif.h deleted file mode 100644 index cf6521dcf2a38..0000000000000 --- a/ext/exif/php_exif.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#if HAVE_EXIF -extern zend_module_entry exif_module_entry; -#define phpext_exif_ptr &exif_module_entry - -PHP_FUNCTION(exif_read_data); -PHP_FUNCTION(exif_tagname); -PHP_FUNCTION(exif_thumbnail); -PHP_FUNCTION(exif_imagetype); -#endif diff --git a/ext/exif/test.php b/ext/exif/test.php deleted file mode 100644 index 907b9ea080aea..0000000000000 --- a/ext/exif/test.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/ext/exif/test.txt b/ext/exif/test.txt deleted file mode 100644 index 1c12b509e6559..0000000000000 --- a/ext/exif/test.txt +++ /dev/null @@ -1,365 +0,0 @@ -\n"; - echo "Thumbnail could not be extracted.\n"; - echo "
"; - } - die(); -} - -if ( !defined('IMAGETYPE_GIF')) define('IMAGETYPE_GIF',1); -if ( !defined('IMAGETYPE_JPEG')) define('IMAGETYPE_JPEG',2); -if ( !defined('IMAGETYPE_TIFF_II')) define('IMAGETYPE_TIFF_II',7); -if ( !defined('IMAGETYPE_TIFF_MM')) define('IMAGETYPE_TIFF_MM',8); - -$possible = array(); - -/****************************************************************************/ -// message function is used for debugging purpose: just to se what happens -function message($msg) { - error_log($msg,0); - echo "$msg\n"; -} - -function error_msg() { - $ret = 'O.K.'; - if (array_key_exists('php_errormsg',$GLOBALS) && strlen($GLOBALS['php_errormsg'])) { - $ret = ''.$GLOBALS['php_errormsg'].''; - $GLOBALS['php_errormsg'] = ''; - } - return $ret; -} - -/****************************************************************************/ -// private to function search_file() -function _search_file($root,&$possible,$path='') { - $sub = array(); - $cnt = 0; - $type= false; - - //error_log("search_file($root,$path)",0); - if ($dir = @opendir($root.$path.'/')) { - while (($found = @readdir($dir)) !== false) { - $type = @filetype($root.$path.'/'.$found); - //error_log("search_file($root$path):$type=$found",0); - switch( $type) { - case 'file': - $pos = strrpos($found,'.'); - if ( function_exists('exif_imagetype')) { - $type = exif_imagetype($root.$path.'/'.$found); - } else { - if ( $pos!==false) { - $type = GetImageSize($root.$path.'/'.$found); - if ( is_array($type)) { - $type = $type[2]; - } else { - $type = false; - } - } else $type = false; - } - if ( $type!==false) - { - $possible[] = array('file'=>$root.$path.'/'.$found, 'type'=>$type); - //error_log("search_file($root$path) add:$path/$found",0); - if ( ($cnt=count($possible)) % 100 == 0) { - error_log("exif test page - counting files: $cnt",0); - } - } - break; - case 'dir': - if ( $found!='.' && $found!='..') { - $sub[count($sub)] = $found; - } - break; - } - } - @closedir($dir); - foreach( $sub as $idx => $found) { - _search_file($root,$possible,$path.'/'.$found); - } - } -} - -/****************************************************************************/ -// function: search_file($file,$ext) -// -// Searches for $file in document tree. The path is ignored. -// -function search_file() { - global $argc, $argv; - $possible = array(); - - if ( $argc > 1) { - $path = $argv[1]; - } else if ( array_key_exists('SCRIPT_FILENAME',$_SERVER)) { - $path = $_SERVER['SCRIPT_FILENAME']; - //error_log("SCRIPT_FILENAME($path)",0); - } else { - $path = $argv[0]; - //error_log("argv($path)",0); - } - if ( ($p=strpos($path,'?')) !== false) $path = substr($path,0,$p); - if ( ($p=strrpos($path,'/')) /*< strlen($path)-1*/) $path = substr($path,0,$p); - error_log("exif test page - counting files in $path"); - _search_file($path,$possible); - error_log("exif test page - counting files: ".count($possible)." done.",0); - return $possible; -} - -/****************************************************************************/ -// function: search_file($file,$ext) -// -// Searches for $file in document tree. The path is ignored. -// -function AddInfo($Name,$Value,$highlight=0) { - if (is_array($Value)) $Value = 'Array: ('.join(',',$Value).')'; - $Value = nl2br($Value); - if ( $highlight) { - $Name = "$Name"; - } else { - $Name = "$Name"; - } - return "$Name$Value \n"; -} - -$possible = search_file(); - -$title = "PHP module exif test page"; - -?> - - -<?=$title ?> - - - -

-

(c) Marcus Börger, 2002

-

-

-Images taken from www.exif.org, -marcus-boerger.de -all rights reserved by their authors and artists, see exif headers. -The files can be downloaded here. -To start the test you simple have to put all images into the same directory as this script. -The test will work with all files in that directory and all subdirectories. To test private -images just put them into that directory. -

-

-Youmay take a look at the test source here. -

-

-This test just prooves that some exif headers can be scanned. -If all files produce a header in output the module might be o.k. -

-

-What to look for in detail: -

-
    -
  • kodak-dc4800-plus-acdsee.jpg -
      -
    • should provide a long comment 'by marcus börger<%04i>'*n
    • -
    • this file returns an array but it also produces an errormessage because ACDSee destroys - the integrity of IFD directory (size of directory and offsets of entries following any - edited entry maybe wrong). -
    • -
    -
  • -
  • hp-photosmart.jpg -
      -
    • should provide a two line copyright notice
    • -
    -
  • -
  • olympus-d320l -
      -
    • should provide an APP12 infoset
    • -
    -
  • -
  • unknown.jpg -
      -
    • should provide an empty comment, this is a comment section and not an IFD0, EXIF or GPS section
    • -
    -
  • -
  • some images -
      -
    • have empty fields, that is the tag is present but no data is stored
    • -
    -
  • -
-

function exif_tagname

- - - - - - -\n"; -} -?> -
ImageWidth
JPEGProc
SceneType
false
function exif_tagname is not supported
-
-

function exif_read_data for images

- -\n"; - $tab2 = "";//"\n"; - $types = array('','GIF','JPEG','PNG','SWF','PSD','BMP','TIFF_II','TIFF_MM','JPC','JP2','JPX','JB2'); - foreach($possible as $idx => $file) { - $type = $file['type']; - $file = $file['file']; - if ( !((++$num)%100)) error_log("exif test page - checking files: $num",0); - $error = ''; - $len = 2; - $rows = 1 - + ($check_getimagesize ? 1 : 0) - + ($check_exif_thumbnail ? 1 : 0) - + ($check_exif_read_data ? 1 : 0); - if ( !$fast_output) echo "\n"; - if ($check_getimagesize) { - $len++; - $size = GetImageSize($file); - $error = error_msg();// clear message - if ( $size === false) { - $error = 'GetImageSize returned false
'.$error; - $res_getimagesize = $error; - } else { - $res_getimagesize = '('.join($size,',').')'; - } - if ( !$fast_output) echo AddInfo("GetImageSize",$error,1); - } - if ( $check_exif_thumbnail) { - $len++; - if ($type!=IMAGETYPE_JPEG) {// && $type!=IMAGETYPE_TIFF_II && $type!=IMAGETYPE_TIFF_MM) { - $error = "filetype not supported: $types[$type]"; - $res_exif_thumbnail = $error; - } else { - $t_width = 0; - $t_height = 0; - $result = exif_thumbnail($file, $t_width, $t_height); - $error = error_msg();// clear message - if ( $result === false) { - $error = 'exif_thumbnail returned false
'.$error; - if ( $t_width && $t_height) { - $error = "$t_width x $t_height
$error"; - } - $res_exif_thumbnail = $error; - } else { - $res_exif_thumbnail = $t_width . " x " . $t_height; - } - } - if ( !$fast_output) echo AddInfo("exif_thumbnail",$error,1); - } - if ($check_exif_read_data) { - $len++; - if ($type!=IMAGETYPE_JPEG && $type!=IMAGETYPE_TIFF_II && $type!=IMAGETYPE_TIFF_MM) { - $res_exif_read_data = "filetype not supported: $types[$type]"; - if ( !$fast_output) echo AddInfo("exif_read_data",$res_exif_read_data); - $res = ''; - } else { - $image = exif_read_data($file,'COMMENT,IFD0,EXIF,APP12',true); - $error = error_msg();// clear message - if ( !$fast_output) echo AddInfo("exif_read_data",$error,1); - $res = ''; - if ( $image === false) { - $res_exif_read_data = "exif_read_data returned false
$error"; - } else { - $res_exif_read_data = $error; - // ah no!$error = error_msg(); // force o.k. - foreach($image as $Name => $Value) { - if ( $Name!='Thumbnail') { - if ( is_array($Value)) { - $len++; - $res .= AddInfo($Name,'Array('.count($Value).')'); - foreach( $Value as $idx => $Entry) { - if ($idx==='Thumbnail') $Entry = '<data>'; - $len++; - $res .= AddInfo($Name.':'.$idx,$Entry); - } - } else { - $len++; - $res .= AddInfo($Name,$Value); - } - } - } - } - } - } - $tab2 .= "\n"; - $tab2 .= "\n"; - if ($check_getimagesize) { - $tab2 .= "\n"; - } - if ($check_exif_thumbnail) { - $tab2 .= "\n"; - } - if ($check_exif_read_data) { - $tab2 .= "\n"; - $tab2 .= $res; - } - if ( $fast_output) { - echo $tab2; - $tab2 = ''; - } - } - error_log("exif test page - checking files: ".count($possible)." done.",0); - echo $tab2; - echo "
$num$file
$num
$file
GetImageSize$res_getimagesize
exif_thumbnail$res_exif_thumbnail
exif_read_data$res_exif_read_data
\n"; -} else { - echo "

function exif_read_data is not supported

\n"; -} -?> - - \ No newline at end of file diff --git a/ext/exif/tests/bug34704.jpg b/ext/exif/tests/bug34704.jpg deleted file mode 100755 index 42b14c1908fc3..0000000000000 Binary files a/ext/exif/tests/bug34704.jpg and /dev/null differ diff --git a/ext/exif/tests/bug34704.phpt b/ext/exif/tests/bug34704.phpt deleted file mode 100755 index b6b26de78d67c..0000000000000 --- a/ext/exif/tests/bug34704.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Bug #34704 (Infinite recursion due to corrupt JPEG) ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 -output_handler= -zlib.output_compression=0 ---FILE-- - -===DONE=== ---EXPECTF-- -array(7) { - ["FileName"]=> - string(12) "bug34704.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(9976) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(4) "IFD0" - ["COMPUTED"]=> - array(5) { - ["html"]=> - string(24) "width="386" height="488"" - ["Height"]=> - int(488) - ["Width"]=> - int(386) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - } -} -===DONE=== diff --git a/ext/exif/tests/exif000.phpt b/ext/exif/tests/exif000.phpt deleted file mode 100644 index eea16438cf136..0000000000000 --- a/ext/exif/tests/exif000.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Check for exif_read_data default behaviour ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -Array -( - [FileName] => test2.jpg - [FileDateTime] => %d - [FileSize] => 1240 - [FileType] => 2 - [MimeType] => image/jpeg - [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, COMMENT - [COMPUTED] => Array - ( - [html] => width="1" height="1" - [Height] => 1 - [Width] => 1 - [IsColor] => 1 - [ByteOrderMotorola] => 1 - [UserComment] => Exif test image. - [UserCommentEncoding] => ASCII - [Copyright] => Photo (c) M.Boerger, Edited by M.Boerger. - [Copyright.Photographer] => Photo (c) M.Boerger - [Copyright.Editor] => Edited by M.Boerger. - [Thumbnail.FileType] => 2 - [Thumbnail.MimeType] => image/jpeg - ) - - [Copyright] => Photo (c) M.Boerger - [UserComment] => ASCII - [THUMBNAIL] => Array - ( - [JPEGInterchangeFormat] => 134 - [JPEGInterchangeFormatLength] => 523 - ) - - [COMMENT] => Array - ( - [0] => Comment #1. - [1] => Comment #2. - [2] => Comment #3end - ) - -) diff --git a/ext/exif/tests/exif001.phpt b/ext/exif/tests/exif001.phpt deleted file mode 100644 index 8fac4286ca686..0000000000000 --- a/ext/exif/tests/exif001.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Check for exif_read_data ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(5) { - ["FILE"]=> - array(6) { - ["FileName"]=> - string(9) "test2.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(1240) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT" - } - ["COMPUTED"]=> - array(12) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["UserComment"]=> - string(16) "Exif test image." - ["UserCommentEncoding"]=> - string(5) "ASCII" - ["Copyright"]=> - string(41) "Photo (c) M.Boerger, Edited by M.Boerger." - ["Copyright.Photographer"]=> - string(19) "Photo (c) M.Boerger" - ["Copyright.Editor"]=> - string(20) "Edited by M.Boerger." - ["Thumbnail.FileType"]=> - int(2) - ["Thumbnail.MimeType"]=> - string(10) "image/jpeg" - } - ["IFD0"]=> - array(2) { - ["Copyright"]=> - string(19) "Photo (c) M.Boerger" - ["UserComment"]=> - string(5) "ASCII" - } - ["THUMBNAIL"]=> - array(2) { - ["JPEGInterchangeFormat"]=> - int(134) - ["JPEGInterchangeFormatLength"]=> - int(523) - } - ["COMMENT"]=> - array(3) { - [0]=> - string(11) "Comment #1." - [1]=> - string(11) "Comment #2." - [2]=> - string(13) "Comment #3end" - } -} \ No newline at end of file diff --git a/ext/exif/tests/exif002.phpt b/ext/exif/tests/exif002.phpt deleted file mode 100644 index 1b1220c60073a..0000000000000 --- a/ext/exif/tests/exif002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Check for exif_thumbnail ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECT-- -27bbfd9fc10e1e663d749f5225447905_523 == 27bbfd9fc10e1e663d749f5225447905_523 diff --git a/ext/exif/tests/exif003.phpt b/ext/exif/tests/exif003.phpt deleted file mode 100644 index 20cb61ee17183..0000000000000 --- a/ext/exif/tests/exif003.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Check for exif_read_data, Unicode user comment ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 -exif.decode_unicode_motorola=UCS-2BE -exif.encode_unicode=ISO-8859-15 ---FILE-- - ---EXPECTF-- -array(5) { - ["FILE"]=> - array(6) { - ["FileName"]=> - string(9) "test3.jpg" - ["FileDateTime"]=> - int(%s) - ["FileSize"]=> - int(1240) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT" - } - ["COMPUTED"]=> - array(12) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["UserComment"]=> - string(7) "ÄÖÜßäöü" - ["UserCommentEncoding"]=> - string(7) "UNICODE" - ["Copyright"]=> - string(41) "Photo (c) M.Boerger, Edited by M.Boerger." - ["Copyright.Photographer"]=> - string(19) "Photo (c) M.Boerger" - ["Copyright.Editor"]=> - string(20) "Edited by M.Boerger." - ["Thumbnail.FileType"]=> - int(2) - ["Thumbnail.MimeType"]=> - string(10) "image/jpeg" - } - ["IFD0"]=> - array(2) { - ["Copyright"]=> - string(19) "Photo (c) M.Boerger" - ["UserComment"]=> - string(7) "UNICODE" - } - ["THUMBNAIL"]=> - array(2) { - ["JPEGInterchangeFormat"]=> - int(134) - ["JPEGInterchangeFormatLength"]=> - int(523) - } - ["COMMENT"]=> - array(3) { - [0]=> - string(11) "Comment #1." - [1]=> - string(11) "Comment #2." - [2]=> - string(13) "Comment #3end" - } -} \ No newline at end of file diff --git a/ext/exif/tests/exif004.phpt b/ext/exif/tests/exif004.phpt deleted file mode 100644 index 229f49e1459b8..0000000000000 --- a/ext/exif/tests/exif004.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Check for exif_read_data, Unicode WinXP tags ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 -exif.decode_unicode_intel=UCS-2LE -exif.decode_unicode_motorola=UCS-2BE -exif.encode_unicode=ISO-8859-1 ---FILE-- - ---EXPECT-- -array(5) { - ["Subject"]=> - string(10) "Subject..." - ["Keywords"]=> - string(11) "Keywords..." - ["Author"]=> - string(9) "Rui Carmo" - ["Comments"]=> - string(29) "Comments -Line2 -Line3 -Line4" - ["Title"]=> - string(8) "Title..." -} diff --git a/ext/exif/tests/exif005.phpt b/ext/exif/tests/exif005.phpt deleted file mode 100644 index e34e3a0421746..0000000000000 --- a/ext/exif/tests/exif005.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Check for exif_read_data, unusual IFD start ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECT-- -array(2) { - ["ImageDescription"]=> - string(11) "Ifd00000009" - ["DateTime"]=> - string(19) "2002:10:18 20:06:00" -} \ No newline at end of file diff --git a/ext/exif/tests/exif006.phpt b/ext/exif/tests/exif006.phpt deleted file mode 100644 index bad74ee4fa98b..0000000000000 --- a/ext/exif/tests/exif006.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -Check for exif_read_data, magic_quotes_runtime ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 -magic_quotes_runtime=1 ---FILE-- - ---EXPECTF-- -array(5) { - ["FILE"]=> - array(6) { - ["FileName"]=> - string(9) "test6.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(1240) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT" - } - ["COMPUTED"]=> - array(12) { - ["html"]=> - string(24) "width=\"1\" height=\"1\"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["UserComment"]=> - string(16) "Hallo \'Du\'+da!" - ["UserCommentEncoding"]=> - string(5) "ASCII" - ["Copyright"]=> - string(45) "Photo \"M. Boerger\"., Edited \'M. Boerger\'." - ["Copyright.Photographer"]=> - string(21) "Photo \"M. Boerger\"." - ["Copyright.Editor"]=> - string(22) "Edited \'M. Boerger\'." - ["Thumbnail.FileType"]=> - int(2) - ["Thumbnail.MimeType"]=> - string(10) "image/jpeg" - } - ["IFD0"]=> - array(2) { - ["Copyright"]=> - string(21) "Photo \"M. Boerger\"." - ["UserComment"]=> - string(5) "ASCII" - } - ["THUMBNAIL"]=> - array(2) { - ["JPEGInterchangeFormat"]=> - int(134) - ["JPEGInterchangeFormatLength"]=> - int(523) - } - ["COMMENT"]=> - array(3) { - [0]=> - string(13) "Comment \"1\"" - [1]=> - string(13) "Comment \'2\'" - [2]=> - string(13) "Comment #3end" - } -} diff --git a/ext/exif/tests/exif007.phpt b/ext/exif/tests/exif007.phpt deleted file mode 100644 index 8e82fe5ab1fc3..0000000000000 --- a/ext/exif/tests/exif007.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Check for exif_read_data, baseline JPEG with no IFD, EXIF, GPS or Interoperability data in Intel byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(7) { - ["FileName"]=> - string(12) "image007.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(0) "" - ["COMPUTED"]=> - array(4) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - } -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif008.phpt b/ext/exif/tests/exif008.phpt deleted file mode 100644 index 01da06e01ff4a..0000000000000 --- a/ext/exif/tests/exif008.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Check for exif_read_data, JPEG with IFD data in Intel byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(16) { - ["FileName"]=> - string(12) "image008.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(13) "ANY_TAG, IFD0" - ["COMPUTED"]=> - array(8) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["XResolution"]=> - string(4) "72/1" - ["YResolution"]=> - string(4) "72/1" - ["ResolutionUnit"]=> - int(2) - ["DateTime"]=> - string(19) "2008:06:19 01:47:53" - ["Artist"]=> - string(12) "Eric Stewart" - ["Copyright"]=> - string(12) "Eric Stewart" -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif009.phpt b/ext/exif/tests/exif009.phpt deleted file mode 100644 index e2025e4f87c05..0000000000000 --- a/ext/exif/tests/exif009.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Check for exif_read_data, JPEG with IFD data in Motorola byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(16) { - ["FileName"]=> - string(12) "image009.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(13) "ANY_TAG, IFD0" - ["COMPUTED"]=> - array(8) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["XResolution"]=> - string(4) "72/1" - ["YResolution"]=> - string(4) "72/1" - ["ResolutionUnit"]=> - int(2) - ["DateTime"]=> - string(19) "2008:06:19 01:47:53" - ["Artist"]=> - string(12) "Eric Stewart" - ["Copyright"]=> - string(12) "Eric Stewart" -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif010.phpt b/ext/exif/tests/exif010.phpt deleted file mode 100644 index 45a2617b83898..0000000000000 --- a/ext/exif/tests/exif010.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Check for exif_read_data, JPEG with IFD and EXIF data in Intel byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(28) { - ["FileName"]=> - string(12) "image010.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(19) "ANY_TAG, IFD0, EXIF" - ["COMPUTED"]=> - array(9) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - ["ApertureFNumber"]=> - string(5) "f/8.0" - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["XResolution"]=> - string(4) "72/1" - ["YResolution"]=> - string(4) "72/1" - ["ResolutionUnit"]=> - int(2) - ["DateTime"]=> - string(19) "2008:06:19 01:47:53" - ["Artist"]=> - string(12) "Eric Stewart" - ["Copyright"]=> - string(12) "Eric Stewart" - ["Exif_IFD_Pointer"]=> - int(246) - ["ExposureTime"]=> - string(5) "1/125" - ["FNumber"]=> - string(3) "8/1" - ["ISOSpeedRatings"]=> - int(80) - ["DateTimeOriginal"]=> - string(19) "2008:06:19 01:47:53" - ["DateTimeDigitized"]=> - string(19) "2008:06:19 01:47:53" - ["MeteringMode"]=> - int(5) - ["LightSource"]=> - int(4) - ["Flash"]=> - int(7) - ["FocalLength"]=> - string(4) "29/5" - ["ExifImageWidth"]=> - int(1) - ["ExifImageLength"]=> - int(1) -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif011.phpt b/ext/exif/tests/exif011.phpt deleted file mode 100644 index adaf24640b833..0000000000000 --- a/ext/exif/tests/exif011.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Check for exif_read_data, JPEG with IFD and EXIF data in Motorola byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(28) { - ["FileName"]=> - string(12) "image011.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(19) "ANY_TAG, IFD0, EXIF" - ["COMPUTED"]=> - array(9) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["ApertureFNumber"]=> - string(5) "f/8.0" - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["XResolution"]=> - string(4) "72/1" - ["YResolution"]=> - string(4) "72/1" - ["ResolutionUnit"]=> - int(2) - ["DateTime"]=> - string(19) "2008:06:19 01:47:53" - ["Artist"]=> - string(12) "Eric Stewart" - ["Copyright"]=> - string(12) "Eric Stewart" - ["Exif_IFD_Pointer"]=> - int(246) - ["ExposureTime"]=> - string(5) "1/125" - ["FNumber"]=> - string(3) "8/1" - ["ISOSpeedRatings"]=> - int(80) - ["DateTimeOriginal"]=> - string(19) "2008:06:19 01:47:53" - ["DateTimeDigitized"]=> - string(19) "2008:06:19 01:47:53" - ["MeteringMode"]=> - int(5) - ["LightSource"]=> - int(4) - ["Flash"]=> - int(7) - ["FocalLength"]=> - string(4) "29/5" - ["ExifImageWidth"]=> - int(1) - ["ExifImageLength"]=> - int(1) -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif012.phpt b/ext/exif/tests/exif012.phpt deleted file mode 100644 index 8e8b01aef736d..0000000000000 Binary files a/ext/exif/tests/exif012.phpt and /dev/null differ diff --git a/ext/exif/tests/exif013.phpt b/ext/exif/tests/exif013.phpt deleted file mode 100644 index 88dc881752327..0000000000000 Binary files a/ext/exif/tests/exif013.phpt and /dev/null differ diff --git a/ext/exif/tests/exif014.phpt b/ext/exif/tests/exif014.phpt deleted file mode 100644 index 4a4df12d9aaad..0000000000000 Binary files a/ext/exif/tests/exif014.phpt and /dev/null differ diff --git a/ext/exif/tests/exif015.phpt b/ext/exif/tests/exif015.phpt deleted file mode 100644 index c38ef4ee95fd5..0000000000000 Binary files a/ext/exif/tests/exif015.phpt and /dev/null differ diff --git a/ext/exif/tests/exif016.phpt b/ext/exif/tests/exif016.phpt deleted file mode 100644 index 266801bf0fe2c..0000000000000 --- a/ext/exif/tests/exif016.phpt +++ /dev/null @@ -1,1622 +0,0 @@ ---TEST-- -Check for exif_read_data, TIFF with IFD data in Intel byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(26) { - ["FileName"]=> - string(13) "image016.tiff" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(7) - ["MimeType"]=> - string(10) "image/tiff" - ["SectionsFound"]=> - string(13) "ANY_TAG, IFD0" - ["COMPUTED"]=> - array(8) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageWidth"]=> - int(1) - ["ImageLength"]=> - int(1) - ["BitsPerSample"]=> - int(8) - ["Compression"]=> - int(5) - ["PhotometricInterpretation"]=> - int(3) - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["StripOffsets"]=> - int(1870) - ["SamplesPerPixel"]=> - int(1) - ["RowsPerStrip"]=> - int(8) - ["StripByteCounts"]=> - int(4) - ["XResolution"]=> - string(17) "381681664/2097152" - ["YResolution"]=> - string(17) "381681664/2097152" - ["PlanarConfiguration"]=> - int(1) - ["ResolutionUnit"]=> - int(2) - ["Artist"]=> - string(12) "Eric Stewart" - ["ColorMap"]=> - array(768) { - [0]=> - int(0) - [1]=> - int(65280) - [2]=> - int(32512) - [3]=> - int(49152) - [4]=> - int(99) - [5]=> - int(115) - [6]=> - int(116) - [7]=> - int(101) - [8]=> - int(119) - [9]=> - int(97) - [10]=> - int(114) - [11]=> - int(116) - [12]=> - int(0) - [13]=> - int(0) - [14]=> - int(0) - [15]=> - int(0) - [16]=> - int(0) - [17]=> - int(0) - [18]=> - int(0) - [19]=> - int(0) - [20]=> - int(0) - [21]=> - int(0) - [22]=> - int(0) - [23]=> - int(0) - [24]=> - int(0) - [25]=> - int(0) - [26]=> - int(0) - [27]=> - int(0) - [28]=> - int(0) - [29]=> - int(0) - [30]=> - int(0) - [31]=> - int(0) - [32]=> - int(0) - [33]=> - int(0) - [34]=> - int(0) - [35]=> - int(0) - [36]=> - int(0) - [37]=> - int(0) - [38]=> - int(0) - [39]=> - int(0) - [40]=> - int(0) - [41]=> - int(0) - [42]=> - int(0) - [43]=> - int(0) - [44]=> - int(0) - [45]=> - int(0) - [46]=> - int(0) - [47]=> - int(0) - [48]=> - int(0) - [49]=> - int(0) - [50]=> - int(0) - [51]=> - int(0) - [52]=> - int(0) - [53]=> - int(0) - [54]=> - int(0) - [55]=> - int(0) - [56]=> - int(0) - [57]=> - int(0) - [58]=> - int(0) - [59]=> - int(0) - [60]=> - int(0) - [61]=> - int(0) - [62]=> - int(0) - [63]=> - int(0) - [64]=> - int(0) - [65]=> - int(0) - [66]=> - int(0) - [67]=> - int(0) - [68]=> - int(0) - [69]=> - int(0) - [70]=> - int(0) - [71]=> - int(0) - [72]=> - int(0) - [73]=> - int(0) - [74]=> - int(0) - [75]=> - int(0) - [76]=> - int(0) - [77]=> - int(0) - [78]=> - int(0) - [79]=> - int(0) - [80]=> - int(0) - [81]=> - int(0) - [82]=> - int(0) - [83]=> - int(0) - [84]=> - int(0) - [85]=> - int(0) - [86]=> - int(0) - [87]=> - int(0) - [88]=> - int(0) - [89]=> - int(0) - [90]=> - int(0) - [91]=> - int(0) - [92]=> - int(0) - [93]=> - int(0) - [94]=> - int(0) - [95]=> - int(0) - [96]=> - int(0) - [97]=> - int(0) - [98]=> - int(0) - [99]=> - int(0) - [100]=> - int(0) - [101]=> - int(0) - [102]=> - int(0) - [103]=> - int(0) - [104]=> - int(0) - [105]=> - int(0) - [106]=> - int(0) - [107]=> - int(0) - [108]=> - int(0) - [109]=> - int(0) - [110]=> - int(0) - [111]=> - int(0) - [112]=> - int(0) - [113]=> - int(0) - [114]=> - int(0) - [115]=> - int(0) - [116]=> - int(0) - [117]=> - int(0) - [118]=> - int(0) - [119]=> - int(0) - [120]=> - int(0) - [121]=> - int(0) - [122]=> - int(0) - [123]=> - int(0) - [124]=> - int(0) - [125]=> - int(0) - [126]=> - int(0) - [127]=> - int(0) - [128]=> - int(0) - [129]=> - int(0) - [130]=> - int(0) - [131]=> - int(0) - [132]=> - int(0) - [133]=> - int(0) - [134]=> - int(0) - [135]=> - int(0) - [136]=> - int(0) - [137]=> - int(0) - [138]=> - int(0) - [139]=> - int(0) - [140]=> - int(0) - [141]=> - int(0) - [142]=> - int(0) - [143]=> - int(0) - [144]=> - int(0) - [145]=> - int(0) - [146]=> - int(0) - [147]=> - int(0) - [148]=> - int(0) - [149]=> - int(0) - [150]=> - int(0) - [151]=> - int(0) - [152]=> - int(0) - [153]=> - int(0) - [154]=> - int(0) - [155]=> - int(0) - [156]=> - int(0) - [157]=> - int(0) - [158]=> - int(0) - [159]=> - int(0) - [160]=> - int(0) - [161]=> - int(0) - [162]=> - int(0) - [163]=> - int(0) - [164]=> - int(0) - [165]=> - int(0) - [166]=> - int(0) - [167]=> - int(0) - [168]=> - int(0) - [169]=> - int(0) - [170]=> - int(0) - [171]=> - int(0) - [172]=> - int(0) - [173]=> - int(0) - [174]=> - int(0) - [175]=> - int(0) - [176]=> - int(0) - [177]=> - int(0) - [178]=> - int(0) - [179]=> - int(0) - [180]=> - int(0) - [181]=> - int(0) - [182]=> - int(0) - [183]=> - int(0) - [184]=> - int(0) - [185]=> - int(0) - [186]=> - int(0) - [187]=> - int(0) - [188]=> - int(0) - [189]=> - int(0) - [190]=> - int(0) - [191]=> - int(0) - [192]=> - int(0) - [193]=> - int(0) - [194]=> - int(0) - [195]=> - int(0) - [196]=> - int(0) - [197]=> - int(0) - [198]=> - int(0) - [199]=> - int(0) - [200]=> - int(0) - [201]=> - int(0) - [202]=> - int(0) - [203]=> - int(0) - [204]=> - int(0) - [205]=> - int(0) - [206]=> - int(0) - [207]=> - int(0) - [208]=> - int(0) - [209]=> - int(0) - [210]=> - int(0) - [211]=> - int(0) - [212]=> - int(0) - [213]=> - int(0) - [214]=> - int(0) - [215]=> - int(0) - [216]=> - int(0) - [217]=> - int(0) - [218]=> - int(0) - [219]=> - int(0) - [220]=> - int(0) - [221]=> - int(0) - [222]=> - int(0) - [223]=> - int(0) - [224]=> - int(0) - [225]=> - int(0) - [226]=> - int(0) - [227]=> - int(0) - [228]=> - int(0) - [229]=> - int(0) - [230]=> - int(0) - [231]=> - int(0) - [232]=> - int(0) - [233]=> - int(0) - [234]=> - int(0) - [235]=> - int(0) - [236]=> - int(0) - [237]=> - int(0) - [238]=> - int(0) - [239]=> - int(0) - [240]=> - int(0) - [241]=> - int(0) - [242]=> - int(0) - [243]=> - int(0) - [244]=> - int(0) - [245]=> - int(0) - [246]=> - int(0) - [247]=> - int(0) - [248]=> - int(0) - [249]=> - int(0) - [250]=> - int(0) - [251]=> - int(0) - [252]=> - int(0) - [253]=> - int(0) - [254]=> - int(0) - [255]=> - int(1) - [256]=> - int(0) - [257]=> - int(65280) - [258]=> - int(32512) - [259]=> - int(49152) - [260]=> - int(0) - [261]=> - int(0) - [262]=> - int(0) - [263]=> - int(0) - [264]=> - int(0) - [265]=> - int(0) - [266]=> - int(0) - [267]=> - int(0) - [268]=> - int(0) - [269]=> - int(0) - [270]=> - int(0) - [271]=> - int(0) - [272]=> - int(11945) - [273]=> - int(1914) - [274]=> - int(0) - [275]=> - int(24609) - [276]=> - int(1088) - [277]=> - int(960) - [278]=> - int(0) - [279]=> - int(0) - [280]=> - int(20000) - [281]=> - int(8414) - [282]=> - int(65436) - [283]=> - int(0) - [284]=> - int(47655) - [285]=> - int(8) - [286]=> - int(37936) - [287]=> - int(8406) - [288]=> - int(0) - [289]=> - int(0) - [290]=> - int(0) - [291]=> - int(0) - [292]=> - int(0) - [293]=> - int(0) - [294]=> - int(0) - [295]=> - int(0) - [296]=> - int(0) - [297]=> - int(64652) - [298]=> - int(50264) - [299]=> - int(0) - [300]=> - int(0) - [301]=> - int(64887) - [302]=> - int(50264) - [303]=> - int(0) - [304]=> - int(25714) - [305]=> - int(26220) - [306]=> - int(17235) - [307]=> - int(19777) - [308]=> - int(65535) - [309]=> - int(65535) - [310]=> - int(65535) - [311]=> - int(65535) - [312]=> - int(65535) - [313]=> - int(65535) - [314]=> - int(65535) - [315]=> - int(65535) - [316]=> - int(501) - [317]=> - int(0) - [318]=> - int(20) - [319]=> - int(0) - [320]=> - int(0) - [321]=> - int(0) - [322]=> - int(16877) - [323]=> - int(0) - [324]=> - int(3) - [325]=> - int(0) - [326]=> - int(0) - [327]=> - int(0) - [328]=> - int(0) - [329]=> - int(0) - [330]=> - int(0) - [331]=> - int(0) - [332]=> - int(65535) - [333]=> - int(65535) - [334]=> - int(65535) - [335]=> - int(65535) - [336]=> - int(65535) - [337]=> - int(65535) - [338]=> - int(65535) - [339]=> - int(65535) - [340]=> - int(0) - [341]=> - int(0) - [342]=> - int(52840) - [343]=> - int(2025) - [344]=> - int(16) - [345]=> - int(57377) - [346]=> - int(1024) - [347]=> - int(960) - [348]=> - int(0) - [349]=> - int(0) - [350]=> - int(27136) - [351]=> - int(8414) - [352]=> - int(65436) - [353]=> - int(0) - [354]=> - int(47655) - [355]=> - int(8) - [356]=> - int(62400) - [357]=> - int(8407) - [358]=> - int(0) - [359]=> - int(0) - [360]=> - int(0) - [361]=> - int(0) - [362]=> - int(0) - [363]=> - int(0) - [364]=> - int(0) - [365]=> - int(0) - [366]=> - int(0) - [367]=> - int(64857) - [368]=> - int(50264) - [369]=> - int(0) - [370]=> - int(0) - [371]=> - int(64892) - [372]=> - int(50264) - [373]=> - int(0) - [374]=> - int(25714) - [375]=> - int(26220) - [376]=> - int(17235) - [377]=> - int(19777) - [378]=> - int(65535) - [379]=> - int(65535) - [380]=> - int(65535) - [381]=> - int(65535) - [382]=> - int(65535) - [383]=> - int(65535) - [384]=> - int(65535) - [385]=> - int(65535) - [386]=> - int(501) - [387]=> - int(0) - [388]=> - int(20) - [389]=> - int(0) - [390]=> - int(0) - [391]=> - int(0) - [392]=> - int(16877) - [393]=> - int(0) - [394]=> - int(3) - [395]=> - int(0) - [396]=> - int(0) - [397]=> - int(0) - [398]=> - int(0) - [399]=> - int(0) - [400]=> - int(0) - [401]=> - int(0) - [402]=> - int(65535) - [403]=> - int(65535) - [404]=> - int(65535) - [405]=> - int(65535) - [406]=> - int(65535) - [407]=> - int(65535) - [408]=> - int(65535) - [409]=> - int(65535) - [410]=> - int(0) - [411]=> - int(0) - [412]=> - int(53440) - [413]=> - int(2025) - [414]=> - int(16) - [415]=> - int(57377) - [416]=> - int(1024) - [417]=> - int(960) - [418]=> - int(0) - [419]=> - int(0) - [420]=> - int(41120) - [421]=> - int(9024) - [422]=> - int(65436) - [423]=> - int(0) - [424]=> - int(47655) - [425]=> - int(8) - [426]=> - int(24480) - [427]=> - int(8404) - [428]=> - int(0) - [429]=> - int(0) - [430]=> - int(0) - [431]=> - int(0) - [432]=> - int(0) - [433]=> - int(0) - [434]=> - int(0) - [435]=> - int(0) - [436]=> - int(0) - [437]=> - int(21315) - [438]=> - int(50294) - [439]=> - int(0) - [440]=> - int(0) - [441]=> - int(53635) - [442]=> - int(50294) - [443]=> - int(0) - [444]=> - int(25714) - [445]=> - int(26220) - [446]=> - int(17235) - [447]=> - int(19777) - [448]=> - int(65535) - [449]=> - int(65535) - [450]=> - int(65535) - [451]=> - int(65535) - [452]=> - int(65535) - [453]=> - int(65535) - [454]=> - int(65535) - [455]=> - int(65535) - [456]=> - int(501) - [457]=> - int(0) - [458]=> - int(20) - [459]=> - int(0) - [460]=> - int(0) - [461]=> - int(0) - [462]=> - int(16877) - [463]=> - int(0) - [464]=> - int(3) - [465]=> - int(0) - [466]=> - int(0) - [467]=> - int(0) - [468]=> - int(0) - [469]=> - int(0) - [470]=> - int(0) - [471]=> - int(0) - [472]=> - int(65535) - [473]=> - int(65535) - [474]=> - int(65535) - [475]=> - int(65535) - [476]=> - int(65535) - [477]=> - int(65535) - [478]=> - int(65535) - [479]=> - int(65535) - [480]=> - int(0) - [481]=> - int(0) - [482]=> - int(54028) - [483]=> - int(2772) - [484]=> - int(16) - [485]=> - int(57377) - [486]=> - int(1024) - [487]=> - int(960) - [488]=> - int(0) - [489]=> - int(0) - [490]=> - int(42384) - [491]=> - int(8408) - [492]=> - int(65436) - [493]=> - int(0) - [494]=> - int(47655) - [495]=> - int(8) - [496]=> - int(1136) - [497]=> - int(8348) - [498]=> - int(0) - [499]=> - int(0) - [500]=> - int(0) - [501]=> - int(0) - [502]=> - int(0) - [503]=> - int(0) - [504]=> - int(0) - [505]=> - int(0) - [506]=> - int(0) - [507]=> - int(12326) - [508]=> - int(50261) - [509]=> - int(0) - [510]=> - int(0) - [511]=> - int(12326) - [512]=> - int(0) - [513]=> - int(65280) - [514]=> - int(32512) - [515]=> - int(49152) - [516]=> - int(0) - [517]=> - int(0) - [518]=> - int(22663) - [519]=> - int(2) - [520]=> - int(0) - [521]=> - int(0) - [522]=> - int(24576) - [523]=> - int(2) - [524]=> - int(0) - [525]=> - int(0) - [526]=> - int(501) - [527]=> - int(0) - [528]=> - int(20) - [529]=> - int(0) - [530]=> - int(0) - [531]=> - int(0) - [532]=> - int(33188) - [533]=> - int(0) - [534]=> - int(0) - [535]=> - int(0) - [536]=> - int(0) - [537]=> - int(0) - [538]=> - int(0) - [539]=> - int(0) - [540]=> - int(0) - [541]=> - int(0) - [542]=> - int(0) - [543]=> - int(0) - [544]=> - int(0) - [545]=> - int(0) - [546]=> - int(0) - [547]=> - int(0) - [548]=> - int(0) - [549]=> - int(0) - [550]=> - int(0) - [551]=> - int(0) - [552]=> - int(51766) - [553]=> - int(1946) - [554]=> - int(0) - [555]=> - int(24609) - [556]=> - int(1088) - [557]=> - int(960) - [558]=> - int(0) - [559]=> - int(0) - [560]=> - int(0) - [561]=> - int(0) - [562]=> - int(25116) - [563]=> - int(2012) - [564]=> - int(0) - [565]=> - int(0) - [566]=> - int(0) - [567]=> - int(0) - [568]=> - int(0) - [569]=> - int(0) - [570]=> - int(0) - [571]=> - int(0) - [572]=> - int(0) - [573]=> - int(0) - [574]=> - int(0) - [575]=> - int(0) - [576]=> - int(0) - [577]=> - int(0) - [578]=> - int(0) - [579]=> - int(0) - [580]=> - int(0) - [581]=> - int(0) - [582]=> - int(0) - [583]=> - int(0) - [584]=> - int(0) - [585]=> - int(0) - [586]=> - int(0) - [587]=> - int(0) - [588]=> - int(0) - [589]=> - int(0) - [590]=> - int(0) - [591]=> - int(0) - [592]=> - int(0) - [593]=> - int(0) - [594]=> - int(0) - [595]=> - int(0) - [596]=> - int(0) - [597]=> - int(0) - [598]=> - int(0) - [599]=> - int(0) - [600]=> - int(0) - [601]=> - int(0) - [602]=> - int(0) - [603]=> - int(0) - [604]=> - int(0) - [605]=> - int(0) - [606]=> - int(0) - [607]=> - int(0) - [608]=> - int(0) - [609]=> - int(0) - [610]=> - int(0) - [611]=> - int(0) - [612]=> - int(0) - [613]=> - int(0) - [614]=> - int(0) - [615]=> - int(0) - [616]=> - int(0) - [617]=> - int(0) - [618]=> - int(0) - [619]=> - int(0) - [620]=> - int(0) - [621]=> - int(0) - [622]=> - int(0) - [623]=> - int(0) - [624]=> - int(0) - [625]=> - int(0) - [626]=> - int(0) - [627]=> - int(0) - [628]=> - int(0) - [629]=> - int(0) - [630]=> - int(0) - [631]=> - int(0) - [632]=> - int(0) - [633]=> - int(0) - [634]=> - int(0) - [635]=> - int(0) - [636]=> - int(0) - [637]=> - int(0) - [638]=> - int(0) - [639]=> - int(0) - [640]=> - int(0) - [641]=> - int(0) - [642]=> - int(0) - [643]=> - int(0) - [644]=> - int(0) - [645]=> - int(0) - [646]=> - int(0) - [647]=> - int(0) - [648]=> - int(0) - [649]=> - int(0) - [650]=> - int(0) - [651]=> - int(0) - [652]=> - int(0) - [653]=> - int(0) - [654]=> - int(0) - [655]=> - int(0) - [656]=> - int(0) - [657]=> - int(0) - [658]=> - int(0) - [659]=> - int(0) - [660]=> - int(0) - [661]=> - int(0) - [662]=> - int(0) - [663]=> - int(0) - [664]=> - int(0) - [665]=> - int(0) - [666]=> - int(0) - [667]=> - int(0) - [668]=> - int(0) - [669]=> - int(0) - [670]=> - int(0) - [671]=> - int(0) - [672]=> - int(0) - [673]=> - int(0) - [674]=> - int(0) - [675]=> - int(0) - [676]=> - int(0) - [677]=> - int(0) - [678]=> - int(0) - [679]=> - int(0) - [680]=> - int(0) - [681]=> - int(0) - [682]=> - int(0) - [683]=> - int(0) - [684]=> - int(0) - [685]=> - int(0) - [686]=> - int(0) - [687]=> - int(0) - [688]=> - int(0) - [689]=> - int(0) - [690]=> - int(0) - [691]=> - int(0) - [692]=> - int(0) - [693]=> - int(0) - [694]=> - int(0) - [695]=> - int(0) - [696]=> - int(0) - [697]=> - int(0) - [698]=> - int(0) - [699]=> - int(0) - [700]=> - int(0) - [701]=> - int(0) - [702]=> - int(0) - [703]=> - int(0) - [704]=> - int(0) - [705]=> - int(0) - [706]=> - int(0) - [707]=> - int(0) - [708]=> - int(0) - [709]=> - int(0) - [710]=> - int(0) - [711]=> - int(0) - [712]=> - int(0) - [713]=> - int(0) - [714]=> - int(0) - [715]=> - int(0) - [716]=> - int(0) - [717]=> - int(0) - [718]=> - int(0) - [719]=> - int(0) - [720]=> - int(0) - [721]=> - int(0) - [722]=> - int(0) - [723]=> - int(0) - [724]=> - int(0) - [725]=> - int(0) - [726]=> - int(0) - [727]=> - int(0) - [728]=> - int(0) - [729]=> - int(0) - [730]=> - int(0) - [731]=> - int(0) - [732]=> - int(0) - [733]=> - int(0) - [734]=> - int(0) - [735]=> - int(0) - [736]=> - int(0) - [737]=> - int(0) - [738]=> - int(0) - [739]=> - int(0) - [740]=> - int(0) - [741]=> - int(0) - [742]=> - int(0) - [743]=> - int(0) - [744]=> - int(0) - [745]=> - int(0) - [746]=> - int(0) - [747]=> - int(0) - [748]=> - int(0) - [749]=> - int(0) - [750]=> - int(0) - [751]=> - int(0) - [752]=> - int(0) - [753]=> - int(0) - [754]=> - int(0) - [755]=> - int(0) - [756]=> - int(0) - [757]=> - int(0) - [758]=> - int(0) - [759]=> - int(0) - [760]=> - int(0) - [761]=> - int(0) - [762]=> - int(0) - [763]=> - int(0) - [764]=> - int(0) - [765]=> - int(0) - [766]=> - int(0) - [767]=> - int(0) - } - ["Copyright"]=> - string(12) "Eric Stewart" -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif017.phpt b/ext/exif/tests/exif017.phpt deleted file mode 100644 index 36c3965ee0f88..0000000000000 --- a/ext/exif/tests/exif017.phpt +++ /dev/null @@ -1,1622 +0,0 @@ ---TEST-- -Check for exif_read_data, TIFF with IFD data in Motorola byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(26) { - ["FileName"]=> - string(13) "image017.tiff" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(8) - ["MimeType"]=> - string(10) "image/tiff" - ["SectionsFound"]=> - string(13) "ANY_TAG, IFD0" - ["COMPUTED"]=> - array(8) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageWidth"]=> - int(1) - ["ImageLength"]=> - int(1) - ["BitsPerSample"]=> - int(8) - ["Compression"]=> - int(5) - ["PhotometricInterpretation"]=> - int(3) - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["StripOffsets"]=> - int(1870) - ["SamplesPerPixel"]=> - int(1) - ["RowsPerStrip"]=> - int(8) - ["StripByteCounts"]=> - int(4) - ["XResolution"]=> - string(17) "381681664/2097152" - ["YResolution"]=> - string(17) "381681664/2097152" - ["PlanarConfiguration"]=> - int(1) - ["ResolutionUnit"]=> - int(2) - ["Artist"]=> - string(12) "Eric Stewart" - ["ColorMap"]=> - array(768) { - [0]=> - int(0) - [1]=> - int(65280) - [2]=> - int(32512) - [3]=> - int(49152) - [4]=> - int(99) - [5]=> - int(115) - [6]=> - int(116) - [7]=> - int(101) - [8]=> - int(119) - [9]=> - int(97) - [10]=> - int(114) - [11]=> - int(116) - [12]=> - int(0) - [13]=> - int(0) - [14]=> - int(0) - [15]=> - int(0) - [16]=> - int(0) - [17]=> - int(0) - [18]=> - int(0) - [19]=> - int(0) - [20]=> - int(0) - [21]=> - int(0) - [22]=> - int(0) - [23]=> - int(0) - [24]=> - int(0) - [25]=> - int(0) - [26]=> - int(0) - [27]=> - int(0) - [28]=> - int(0) - [29]=> - int(0) - [30]=> - int(0) - [31]=> - int(0) - [32]=> - int(0) - [33]=> - int(0) - [34]=> - int(0) - [35]=> - int(0) - [36]=> - int(0) - [37]=> - int(0) - [38]=> - int(0) - [39]=> - int(0) - [40]=> - int(0) - [41]=> - int(0) - [42]=> - int(0) - [43]=> - int(0) - [44]=> - int(0) - [45]=> - int(0) - [46]=> - int(0) - [47]=> - int(0) - [48]=> - int(0) - [49]=> - int(0) - [50]=> - int(0) - [51]=> - int(0) - [52]=> - int(0) - [53]=> - int(0) - [54]=> - int(0) - [55]=> - int(0) - [56]=> - int(0) - [57]=> - int(0) - [58]=> - int(0) - [59]=> - int(0) - [60]=> - int(0) - [61]=> - int(0) - [62]=> - int(0) - [63]=> - int(0) - [64]=> - int(0) - [65]=> - int(0) - [66]=> - int(0) - [67]=> - int(0) - [68]=> - int(0) - [69]=> - int(0) - [70]=> - int(0) - [71]=> - int(0) - [72]=> - int(0) - [73]=> - int(0) - [74]=> - int(0) - [75]=> - int(0) - [76]=> - int(0) - [77]=> - int(0) - [78]=> - int(0) - [79]=> - int(0) - [80]=> - int(0) - [81]=> - int(0) - [82]=> - int(0) - [83]=> - int(0) - [84]=> - int(0) - [85]=> - int(0) - [86]=> - int(0) - [87]=> - int(0) - [88]=> - int(0) - [89]=> - int(0) - [90]=> - int(0) - [91]=> - int(0) - [92]=> - int(0) - [93]=> - int(0) - [94]=> - int(0) - [95]=> - int(0) - [96]=> - int(0) - [97]=> - int(0) - [98]=> - int(0) - [99]=> - int(0) - [100]=> - int(0) - [101]=> - int(0) - [102]=> - int(0) - [103]=> - int(0) - [104]=> - int(0) - [105]=> - int(0) - [106]=> - int(0) - [107]=> - int(0) - [108]=> - int(0) - [109]=> - int(0) - [110]=> - int(0) - [111]=> - int(0) - [112]=> - int(0) - [113]=> - int(0) - [114]=> - int(0) - [115]=> - int(0) - [116]=> - int(0) - [117]=> - int(0) - [118]=> - int(0) - [119]=> - int(0) - [120]=> - int(0) - [121]=> - int(0) - [122]=> - int(0) - [123]=> - int(0) - [124]=> - int(0) - [125]=> - int(0) - [126]=> - int(0) - [127]=> - int(0) - [128]=> - int(0) - [129]=> - int(0) - [130]=> - int(0) - [131]=> - int(0) - [132]=> - int(0) - [133]=> - int(0) - [134]=> - int(0) - [135]=> - int(0) - [136]=> - int(0) - [137]=> - int(0) - [138]=> - int(0) - [139]=> - int(0) - [140]=> - int(0) - [141]=> - int(0) - [142]=> - int(0) - [143]=> - int(0) - [144]=> - int(0) - [145]=> - int(0) - [146]=> - int(0) - [147]=> - int(0) - [148]=> - int(0) - [149]=> - int(0) - [150]=> - int(0) - [151]=> - int(0) - [152]=> - int(0) - [153]=> - int(0) - [154]=> - int(0) - [155]=> - int(0) - [156]=> - int(0) - [157]=> - int(0) - [158]=> - int(0) - [159]=> - int(0) - [160]=> - int(0) - [161]=> - int(0) - [162]=> - int(0) - [163]=> - int(0) - [164]=> - int(0) - [165]=> - int(0) - [166]=> - int(0) - [167]=> - int(0) - [168]=> - int(0) - [169]=> - int(0) - [170]=> - int(0) - [171]=> - int(0) - [172]=> - int(0) - [173]=> - int(0) - [174]=> - int(0) - [175]=> - int(0) - [176]=> - int(0) - [177]=> - int(0) - [178]=> - int(0) - [179]=> - int(0) - [180]=> - int(0) - [181]=> - int(0) - [182]=> - int(0) - [183]=> - int(0) - [184]=> - int(0) - [185]=> - int(0) - [186]=> - int(0) - [187]=> - int(0) - [188]=> - int(0) - [189]=> - int(0) - [190]=> - int(0) - [191]=> - int(0) - [192]=> - int(0) - [193]=> - int(0) - [194]=> - int(0) - [195]=> - int(0) - [196]=> - int(0) - [197]=> - int(0) - [198]=> - int(0) - [199]=> - int(0) - [200]=> - int(0) - [201]=> - int(0) - [202]=> - int(0) - [203]=> - int(0) - [204]=> - int(0) - [205]=> - int(0) - [206]=> - int(0) - [207]=> - int(0) - [208]=> - int(0) - [209]=> - int(0) - [210]=> - int(0) - [211]=> - int(0) - [212]=> - int(0) - [213]=> - int(0) - [214]=> - int(0) - [215]=> - int(0) - [216]=> - int(0) - [217]=> - int(0) - [218]=> - int(0) - [219]=> - int(0) - [220]=> - int(0) - [221]=> - int(0) - [222]=> - int(0) - [223]=> - int(0) - [224]=> - int(0) - [225]=> - int(0) - [226]=> - int(0) - [227]=> - int(0) - [228]=> - int(0) - [229]=> - int(0) - [230]=> - int(0) - [231]=> - int(0) - [232]=> - int(0) - [233]=> - int(0) - [234]=> - int(0) - [235]=> - int(0) - [236]=> - int(0) - [237]=> - int(0) - [238]=> - int(0) - [239]=> - int(0) - [240]=> - int(0) - [241]=> - int(0) - [242]=> - int(0) - [243]=> - int(0) - [244]=> - int(0) - [245]=> - int(0) - [246]=> - int(0) - [247]=> - int(0) - [248]=> - int(0) - [249]=> - int(0) - [250]=> - int(0) - [251]=> - int(0) - [252]=> - int(0) - [253]=> - int(0) - [254]=> - int(0) - [255]=> - int(1) - [256]=> - int(0) - [257]=> - int(65280) - [258]=> - int(32512) - [259]=> - int(49152) - [260]=> - int(0) - [261]=> - int(0) - [262]=> - int(0) - [263]=> - int(0) - [264]=> - int(0) - [265]=> - int(0) - [266]=> - int(0) - [267]=> - int(0) - [268]=> - int(0) - [269]=> - int(0) - [270]=> - int(0) - [271]=> - int(0) - [272]=> - int(11945) - [273]=> - int(1914) - [274]=> - int(0) - [275]=> - int(24609) - [276]=> - int(1088) - [277]=> - int(960) - [278]=> - int(0) - [279]=> - int(0) - [280]=> - int(20000) - [281]=> - int(8414) - [282]=> - int(65436) - [283]=> - int(0) - [284]=> - int(47655) - [285]=> - int(8) - [286]=> - int(37936) - [287]=> - int(8406) - [288]=> - int(0) - [289]=> - int(0) - [290]=> - int(0) - [291]=> - int(0) - [292]=> - int(0) - [293]=> - int(0) - [294]=> - int(0) - [295]=> - int(0) - [296]=> - int(0) - [297]=> - int(64652) - [298]=> - int(50264) - [299]=> - int(0) - [300]=> - int(0) - [301]=> - int(64887) - [302]=> - int(50264) - [303]=> - int(0) - [304]=> - int(25714) - [305]=> - int(26220) - [306]=> - int(17235) - [307]=> - int(19777) - [308]=> - int(65535) - [309]=> - int(65535) - [310]=> - int(65535) - [311]=> - int(65535) - [312]=> - int(65535) - [313]=> - int(65535) - [314]=> - int(65535) - [315]=> - int(65535) - [316]=> - int(501) - [317]=> - int(0) - [318]=> - int(20) - [319]=> - int(0) - [320]=> - int(0) - [321]=> - int(0) - [322]=> - int(16877) - [323]=> - int(0) - [324]=> - int(3) - [325]=> - int(0) - [326]=> - int(0) - [327]=> - int(0) - [328]=> - int(0) - [329]=> - int(0) - [330]=> - int(0) - [331]=> - int(0) - [332]=> - int(65535) - [333]=> - int(65535) - [334]=> - int(65535) - [335]=> - int(65535) - [336]=> - int(65535) - [337]=> - int(65535) - [338]=> - int(65535) - [339]=> - int(65535) - [340]=> - int(0) - [341]=> - int(0) - [342]=> - int(52840) - [343]=> - int(2025) - [344]=> - int(16) - [345]=> - int(57377) - [346]=> - int(1024) - [347]=> - int(960) - [348]=> - int(0) - [349]=> - int(0) - [350]=> - int(27136) - [351]=> - int(8414) - [352]=> - int(65436) - [353]=> - int(0) - [354]=> - int(47655) - [355]=> - int(8) - [356]=> - int(62400) - [357]=> - int(8407) - [358]=> - int(0) - [359]=> - int(0) - [360]=> - int(0) - [361]=> - int(0) - [362]=> - int(0) - [363]=> - int(0) - [364]=> - int(0) - [365]=> - int(0) - [366]=> - int(0) - [367]=> - int(64857) - [368]=> - int(50264) - [369]=> - int(0) - [370]=> - int(0) - [371]=> - int(64892) - [372]=> - int(50264) - [373]=> - int(0) - [374]=> - int(25714) - [375]=> - int(26220) - [376]=> - int(17235) - [377]=> - int(19777) - [378]=> - int(65535) - [379]=> - int(65535) - [380]=> - int(65535) - [381]=> - int(65535) - [382]=> - int(65535) - [383]=> - int(65535) - [384]=> - int(65535) - [385]=> - int(65535) - [386]=> - int(501) - [387]=> - int(0) - [388]=> - int(20) - [389]=> - int(0) - [390]=> - int(0) - [391]=> - int(0) - [392]=> - int(16877) - [393]=> - int(0) - [394]=> - int(3) - [395]=> - int(0) - [396]=> - int(0) - [397]=> - int(0) - [398]=> - int(0) - [399]=> - int(0) - [400]=> - int(0) - [401]=> - int(0) - [402]=> - int(65535) - [403]=> - int(65535) - [404]=> - int(65535) - [405]=> - int(65535) - [406]=> - int(65535) - [407]=> - int(65535) - [408]=> - int(65535) - [409]=> - int(65535) - [410]=> - int(0) - [411]=> - int(0) - [412]=> - int(53440) - [413]=> - int(2025) - [414]=> - int(16) - [415]=> - int(57377) - [416]=> - int(1024) - [417]=> - int(960) - [418]=> - int(0) - [419]=> - int(0) - [420]=> - int(41120) - [421]=> - int(9024) - [422]=> - int(65436) - [423]=> - int(0) - [424]=> - int(47655) - [425]=> - int(8) - [426]=> - int(24480) - [427]=> - int(8404) - [428]=> - int(0) - [429]=> - int(0) - [430]=> - int(0) - [431]=> - int(0) - [432]=> - int(0) - [433]=> - int(0) - [434]=> - int(0) - [435]=> - int(0) - [436]=> - int(0) - [437]=> - int(21315) - [438]=> - int(50294) - [439]=> - int(0) - [440]=> - int(0) - [441]=> - int(53635) - [442]=> - int(50294) - [443]=> - int(0) - [444]=> - int(25714) - [445]=> - int(26220) - [446]=> - int(17235) - [447]=> - int(19777) - [448]=> - int(65535) - [449]=> - int(65535) - [450]=> - int(65535) - [451]=> - int(65535) - [452]=> - int(65535) - [453]=> - int(65535) - [454]=> - int(65535) - [455]=> - int(65535) - [456]=> - int(501) - [457]=> - int(0) - [458]=> - int(20) - [459]=> - int(0) - [460]=> - int(0) - [461]=> - int(0) - [462]=> - int(16877) - [463]=> - int(0) - [464]=> - int(3) - [465]=> - int(0) - [466]=> - int(0) - [467]=> - int(0) - [468]=> - int(0) - [469]=> - int(0) - [470]=> - int(0) - [471]=> - int(0) - [472]=> - int(65535) - [473]=> - int(65535) - [474]=> - int(65535) - [475]=> - int(65535) - [476]=> - int(65535) - [477]=> - int(65535) - [478]=> - int(65535) - [479]=> - int(65535) - [480]=> - int(0) - [481]=> - int(0) - [482]=> - int(54028) - [483]=> - int(2772) - [484]=> - int(16) - [485]=> - int(57377) - [486]=> - int(1024) - [487]=> - int(960) - [488]=> - int(0) - [489]=> - int(0) - [490]=> - int(42384) - [491]=> - int(8408) - [492]=> - int(65436) - [493]=> - int(0) - [494]=> - int(47655) - [495]=> - int(8) - [496]=> - int(1136) - [497]=> - int(8348) - [498]=> - int(0) - [499]=> - int(0) - [500]=> - int(0) - [501]=> - int(0) - [502]=> - int(0) - [503]=> - int(0) - [504]=> - int(0) - [505]=> - int(0) - [506]=> - int(0) - [507]=> - int(12326) - [508]=> - int(50261) - [509]=> - int(0) - [510]=> - int(0) - [511]=> - int(12326) - [512]=> - int(0) - [513]=> - int(65280) - [514]=> - int(32512) - [515]=> - int(49152) - [516]=> - int(0) - [517]=> - int(0) - [518]=> - int(22663) - [519]=> - int(2) - [520]=> - int(0) - [521]=> - int(0) - [522]=> - int(24576) - [523]=> - int(2) - [524]=> - int(0) - [525]=> - int(0) - [526]=> - int(501) - [527]=> - int(0) - [528]=> - int(20) - [529]=> - int(0) - [530]=> - int(0) - [531]=> - int(0) - [532]=> - int(33188) - [533]=> - int(0) - [534]=> - int(0) - [535]=> - int(0) - [536]=> - int(0) - [537]=> - int(0) - [538]=> - int(0) - [539]=> - int(0) - [540]=> - int(0) - [541]=> - int(0) - [542]=> - int(0) - [543]=> - int(0) - [544]=> - int(0) - [545]=> - int(0) - [546]=> - int(0) - [547]=> - int(0) - [548]=> - int(0) - [549]=> - int(0) - [550]=> - int(0) - [551]=> - int(0) - [552]=> - int(51766) - [553]=> - int(1946) - [554]=> - int(0) - [555]=> - int(24609) - [556]=> - int(1088) - [557]=> - int(960) - [558]=> - int(0) - [559]=> - int(0) - [560]=> - int(0) - [561]=> - int(0) - [562]=> - int(25116) - [563]=> - int(2012) - [564]=> - int(0) - [565]=> - int(0) - [566]=> - int(0) - [567]=> - int(0) - [568]=> - int(0) - [569]=> - int(0) - [570]=> - int(0) - [571]=> - int(0) - [572]=> - int(0) - [573]=> - int(0) - [574]=> - int(0) - [575]=> - int(0) - [576]=> - int(0) - [577]=> - int(0) - [578]=> - int(0) - [579]=> - int(0) - [580]=> - int(0) - [581]=> - int(0) - [582]=> - int(0) - [583]=> - int(0) - [584]=> - int(0) - [585]=> - int(0) - [586]=> - int(0) - [587]=> - int(0) - [588]=> - int(0) - [589]=> - int(0) - [590]=> - int(0) - [591]=> - int(0) - [592]=> - int(0) - [593]=> - int(0) - [594]=> - int(0) - [595]=> - int(0) - [596]=> - int(0) - [597]=> - int(0) - [598]=> - int(0) - [599]=> - int(0) - [600]=> - int(0) - [601]=> - int(0) - [602]=> - int(0) - [603]=> - int(0) - [604]=> - int(0) - [605]=> - int(0) - [606]=> - int(0) - [607]=> - int(0) - [608]=> - int(0) - [609]=> - int(0) - [610]=> - int(0) - [611]=> - int(0) - [612]=> - int(0) - [613]=> - int(0) - [614]=> - int(0) - [615]=> - int(0) - [616]=> - int(0) - [617]=> - int(0) - [618]=> - int(0) - [619]=> - int(0) - [620]=> - int(0) - [621]=> - int(0) - [622]=> - int(0) - [623]=> - int(0) - [624]=> - int(0) - [625]=> - int(0) - [626]=> - int(0) - [627]=> - int(0) - [628]=> - int(0) - [629]=> - int(0) - [630]=> - int(0) - [631]=> - int(0) - [632]=> - int(0) - [633]=> - int(0) - [634]=> - int(0) - [635]=> - int(0) - [636]=> - int(0) - [637]=> - int(0) - [638]=> - int(0) - [639]=> - int(0) - [640]=> - int(0) - [641]=> - int(0) - [642]=> - int(0) - [643]=> - int(0) - [644]=> - int(0) - [645]=> - int(0) - [646]=> - int(0) - [647]=> - int(0) - [648]=> - int(0) - [649]=> - int(0) - [650]=> - int(0) - [651]=> - int(0) - [652]=> - int(0) - [653]=> - int(0) - [654]=> - int(0) - [655]=> - int(0) - [656]=> - int(0) - [657]=> - int(0) - [658]=> - int(0) - [659]=> - int(0) - [660]=> - int(0) - [661]=> - int(0) - [662]=> - int(0) - [663]=> - int(0) - [664]=> - int(0) - [665]=> - int(0) - [666]=> - int(0) - [667]=> - int(0) - [668]=> - int(0) - [669]=> - int(0) - [670]=> - int(0) - [671]=> - int(0) - [672]=> - int(0) - [673]=> - int(0) - [674]=> - int(0) - [675]=> - int(0) - [676]=> - int(0) - [677]=> - int(0) - [678]=> - int(0) - [679]=> - int(0) - [680]=> - int(0) - [681]=> - int(0) - [682]=> - int(0) - [683]=> - int(0) - [684]=> - int(0) - [685]=> - int(0) - [686]=> - int(0) - [687]=> - int(0) - [688]=> - int(0) - [689]=> - int(0) - [690]=> - int(0) - [691]=> - int(0) - [692]=> - int(0) - [693]=> - int(0) - [694]=> - int(0) - [695]=> - int(0) - [696]=> - int(0) - [697]=> - int(0) - [698]=> - int(0) - [699]=> - int(0) - [700]=> - int(0) - [701]=> - int(0) - [702]=> - int(0) - [703]=> - int(0) - [704]=> - int(0) - [705]=> - int(0) - [706]=> - int(0) - [707]=> - int(0) - [708]=> - int(0) - [709]=> - int(0) - [710]=> - int(0) - [711]=> - int(0) - [712]=> - int(0) - [713]=> - int(0) - [714]=> - int(0) - [715]=> - int(0) - [716]=> - int(0) - [717]=> - int(0) - [718]=> - int(0) - [719]=> - int(0) - [720]=> - int(0) - [721]=> - int(0) - [722]=> - int(0) - [723]=> - int(0) - [724]=> - int(0) - [725]=> - int(0) - [726]=> - int(0) - [727]=> - int(0) - [728]=> - int(0) - [729]=> - int(0) - [730]=> - int(0) - [731]=> - int(0) - [732]=> - int(0) - [733]=> - int(0) - [734]=> - int(0) - [735]=> - int(0) - [736]=> - int(0) - [737]=> - int(0) - [738]=> - int(0) - [739]=> - int(0) - [740]=> - int(0) - [741]=> - int(0) - [742]=> - int(0) - [743]=> - int(0) - [744]=> - int(0) - [745]=> - int(0) - [746]=> - int(0) - [747]=> - int(0) - [748]=> - int(0) - [749]=> - int(0) - [750]=> - int(0) - [751]=> - int(0) - [752]=> - int(0) - [753]=> - int(0) - [754]=> - int(0) - [755]=> - int(0) - [756]=> - int(0) - [757]=> - int(0) - [758]=> - int(0) - [759]=> - int(0) - [760]=> - int(0) - [761]=> - int(0) - [762]=> - int(0) - [763]=> - int(0) - [764]=> - int(0) - [765]=> - int(0) - [766]=> - int(0) - [767]=> - int(0) - } - ["Copyright"]=> - string(12) "Eric Stewart" -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif018.phpt b/ext/exif/tests/exif018.phpt deleted file mode 100644 index a4ca53cb9bcff..0000000000000 --- a/ext/exif/tests/exif018.phpt +++ /dev/null @@ -1,1646 +0,0 @@ ---TEST-- -Check for exif_read_data, TIFF with IFD and EXIF data in Intel byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(37) { - ["FileName"]=> - string(13) "image018.tiff" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(7) - ["MimeType"]=> - string(10) "image/tiff" - ["SectionsFound"]=> - string(19) "ANY_TAG, IFD0, EXIF" - ["COMPUTED"]=> - array(9) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - ["ApertureFNumber"]=> - string(5) "f/8.0" - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageWidth"]=> - int(1) - ["ImageLength"]=> - int(1) - ["BitsPerSample"]=> - int(8) - ["Compression"]=> - int(5) - ["PhotometricInterpretation"]=> - int(3) - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["StripOffsets"]=> - int(2084) - ["SamplesPerPixel"]=> - int(1) - ["RowsPerStrip"]=> - int(8) - ["StripByteCounts"]=> - int(4) - ["XResolution"]=> - string(17) "381681664/2097152" - ["YResolution"]=> - string(17) "381681664/2097152" - ["PlanarConfiguration"]=> - int(1) - ["ResolutionUnit"]=> - int(2) - ["Artist"]=> - string(12) "Eric Stewart" - ["ColorMap"]=> - array(768) { - [0]=> - int(0) - [1]=> - int(65280) - [2]=> - int(32512) - [3]=> - int(49152) - [4]=> - int(99) - [5]=> - int(115) - [6]=> - int(116) - [7]=> - int(101) - [8]=> - int(119) - [9]=> - int(97) - [10]=> - int(114) - [11]=> - int(116) - [12]=> - int(0) - [13]=> - int(0) - [14]=> - int(0) - [15]=> - int(0) - [16]=> - int(0) - [17]=> - int(0) - [18]=> - int(0) - [19]=> - int(0) - [20]=> - int(0) - [21]=> - int(0) - [22]=> - int(0) - [23]=> - int(0) - [24]=> - int(0) - [25]=> - int(0) - [26]=> - int(0) - [27]=> - int(0) - [28]=> - int(0) - [29]=> - int(0) - [30]=> - int(0) - [31]=> - int(0) - [32]=> - int(0) - [33]=> - int(0) - [34]=> - int(0) - [35]=> - int(0) - [36]=> - int(0) - [37]=> - int(0) - [38]=> - int(0) - [39]=> - int(0) - [40]=> - int(0) - [41]=> - int(0) - [42]=> - int(0) - [43]=> - int(0) - [44]=> - int(0) - [45]=> - int(0) - [46]=> - int(0) - [47]=> - int(0) - [48]=> - int(0) - [49]=> - int(0) - [50]=> - int(0) - [51]=> - int(0) - [52]=> - int(0) - [53]=> - int(0) - [54]=> - int(0) - [55]=> - int(0) - [56]=> - int(0) - [57]=> - int(0) - [58]=> - int(0) - [59]=> - int(0) - [60]=> - int(0) - [61]=> - int(0) - [62]=> - int(0) - [63]=> - int(0) - [64]=> - int(0) - [65]=> - int(0) - [66]=> - int(0) - [67]=> - int(0) - [68]=> - int(0) - [69]=> - int(0) - [70]=> - int(0) - [71]=> - int(0) - [72]=> - int(0) - [73]=> - int(0) - [74]=> - int(0) - [75]=> - int(0) - [76]=> - int(0) - [77]=> - int(0) - [78]=> - int(0) - [79]=> - int(0) - [80]=> - int(0) - [81]=> - int(0) - [82]=> - int(0) - [83]=> - int(0) - [84]=> - int(0) - [85]=> - int(0) - [86]=> - int(0) - [87]=> - int(0) - [88]=> - int(0) - [89]=> - int(0) - [90]=> - int(0) - [91]=> - int(0) - [92]=> - int(0) - [93]=> - int(0) - [94]=> - int(0) - [95]=> - int(0) - [96]=> - int(0) - [97]=> - int(0) - [98]=> - int(0) - [99]=> - int(0) - [100]=> - int(0) - [101]=> - int(0) - [102]=> - int(0) - [103]=> - int(0) - [104]=> - int(0) - [105]=> - int(0) - [106]=> - int(0) - [107]=> - int(0) - [108]=> - int(0) - [109]=> - int(0) - [110]=> - int(0) - [111]=> - int(0) - [112]=> - int(0) - [113]=> - int(0) - [114]=> - int(0) - [115]=> - int(0) - [116]=> - int(0) - [117]=> - int(0) - [118]=> - int(0) - [119]=> - int(0) - [120]=> - int(0) - [121]=> - int(0) - [122]=> - int(0) - [123]=> - int(0) - [124]=> - int(0) - [125]=> - int(0) - [126]=> - int(0) - [127]=> - int(0) - [128]=> - int(0) - [129]=> - int(0) - [130]=> - int(0) - [131]=> - int(0) - [132]=> - int(0) - [133]=> - int(0) - [134]=> - int(0) - [135]=> - int(0) - [136]=> - int(0) - [137]=> - int(0) - [138]=> - int(0) - [139]=> - int(0) - [140]=> - int(0) - [141]=> - int(0) - [142]=> - int(0) - [143]=> - int(0) - [144]=> - int(0) - [145]=> - int(0) - [146]=> - int(0) - [147]=> - int(0) - [148]=> - int(0) - [149]=> - int(0) - [150]=> - int(0) - [151]=> - int(0) - [152]=> - int(0) - [153]=> - int(0) - [154]=> - int(0) - [155]=> - int(0) - [156]=> - int(0) - [157]=> - int(0) - [158]=> - int(0) - [159]=> - int(0) - [160]=> - int(0) - [161]=> - int(0) - [162]=> - int(0) - [163]=> - int(0) - [164]=> - int(0) - [165]=> - int(0) - [166]=> - int(0) - [167]=> - int(0) - [168]=> - int(0) - [169]=> - int(0) - [170]=> - int(0) - [171]=> - int(0) - [172]=> - int(0) - [173]=> - int(0) - [174]=> - int(0) - [175]=> - int(0) - [176]=> - int(0) - [177]=> - int(0) - [178]=> - int(0) - [179]=> - int(0) - [180]=> - int(0) - [181]=> - int(0) - [182]=> - int(0) - [183]=> - int(0) - [184]=> - int(0) - [185]=> - int(0) - [186]=> - int(0) - [187]=> - int(0) - [188]=> - int(0) - [189]=> - int(0) - [190]=> - int(0) - [191]=> - int(0) - [192]=> - int(0) - [193]=> - int(0) - [194]=> - int(0) - [195]=> - int(0) - [196]=> - int(0) - [197]=> - int(0) - [198]=> - int(0) - [199]=> - int(0) - [200]=> - int(0) - [201]=> - int(0) - [202]=> - int(0) - [203]=> - int(0) - [204]=> - int(0) - [205]=> - int(0) - [206]=> - int(0) - [207]=> - int(0) - [208]=> - int(0) - [209]=> - int(0) - [210]=> - int(0) - [211]=> - int(0) - [212]=> - int(0) - [213]=> - int(0) - [214]=> - int(0) - [215]=> - int(0) - [216]=> - int(0) - [217]=> - int(0) - [218]=> - int(0) - [219]=> - int(0) - [220]=> - int(0) - [221]=> - int(0) - [222]=> - int(0) - [223]=> - int(0) - [224]=> - int(0) - [225]=> - int(0) - [226]=> - int(0) - [227]=> - int(0) - [228]=> - int(0) - [229]=> - int(0) - [230]=> - int(0) - [231]=> - int(0) - [232]=> - int(0) - [233]=> - int(0) - [234]=> - int(0) - [235]=> - int(0) - [236]=> - int(0) - [237]=> - int(0) - [238]=> - int(0) - [239]=> - int(0) - [240]=> - int(0) - [241]=> - int(0) - [242]=> - int(0) - [243]=> - int(0) - [244]=> - int(0) - [245]=> - int(0) - [246]=> - int(0) - [247]=> - int(0) - [248]=> - int(0) - [249]=> - int(0) - [250]=> - int(0) - [251]=> - int(0) - [252]=> - int(0) - [253]=> - int(0) - [254]=> - int(0) - [255]=> - int(1) - [256]=> - int(0) - [257]=> - int(65280) - [258]=> - int(32512) - [259]=> - int(49152) - [260]=> - int(0) - [261]=> - int(0) - [262]=> - int(0) - [263]=> - int(0) - [264]=> - int(0) - [265]=> - int(0) - [266]=> - int(0) - [267]=> - int(0) - [268]=> - int(0) - [269]=> - int(0) - [270]=> - int(0) - [271]=> - int(0) - [272]=> - int(11945) - [273]=> - int(1914) - [274]=> - int(0) - [275]=> - int(24609) - [276]=> - int(1088) - [277]=> - int(960) - [278]=> - int(0) - [279]=> - int(0) - [280]=> - int(20000) - [281]=> - int(8414) - [282]=> - int(65436) - [283]=> - int(0) - [284]=> - int(47655) - [285]=> - int(8) - [286]=> - int(37936) - [287]=> - int(8406) - [288]=> - int(0) - [289]=> - int(0) - [290]=> - int(0) - [291]=> - int(0) - [292]=> - int(0) - [293]=> - int(0) - [294]=> - int(0) - [295]=> - int(0) - [296]=> - int(0) - [297]=> - int(64652) - [298]=> - int(50264) - [299]=> - int(0) - [300]=> - int(0) - [301]=> - int(64887) - [302]=> - int(50264) - [303]=> - int(0) - [304]=> - int(25714) - [305]=> - int(26220) - [306]=> - int(17235) - [307]=> - int(19777) - [308]=> - int(65535) - [309]=> - int(65535) - [310]=> - int(65535) - [311]=> - int(65535) - [312]=> - int(65535) - [313]=> - int(65535) - [314]=> - int(65535) - [315]=> - int(65535) - [316]=> - int(501) - [317]=> - int(0) - [318]=> - int(20) - [319]=> - int(0) - [320]=> - int(0) - [321]=> - int(0) - [322]=> - int(16877) - [323]=> - int(0) - [324]=> - int(3) - [325]=> - int(0) - [326]=> - int(0) - [327]=> - int(0) - [328]=> - int(0) - [329]=> - int(0) - [330]=> - int(0) - [331]=> - int(0) - [332]=> - int(65535) - [333]=> - int(65535) - [334]=> - int(65535) - [335]=> - int(65535) - [336]=> - int(65535) - [337]=> - int(65535) - [338]=> - int(65535) - [339]=> - int(65535) - [340]=> - int(0) - [341]=> - int(0) - [342]=> - int(52840) - [343]=> - int(2025) - [344]=> - int(16) - [345]=> - int(57377) - [346]=> - int(1024) - [347]=> - int(960) - [348]=> - int(0) - [349]=> - int(0) - [350]=> - int(27136) - [351]=> - int(8414) - [352]=> - int(65436) - [353]=> - int(0) - [354]=> - int(47655) - [355]=> - int(8) - [356]=> - int(62400) - [357]=> - int(8407) - [358]=> - int(0) - [359]=> - int(0) - [360]=> - int(0) - [361]=> - int(0) - [362]=> - int(0) - [363]=> - int(0) - [364]=> - int(0) - [365]=> - int(0) - [366]=> - int(0) - [367]=> - int(64857) - [368]=> - int(50264) - [369]=> - int(0) - [370]=> - int(0) - [371]=> - int(64892) - [372]=> - int(50264) - [373]=> - int(0) - [374]=> - int(25714) - [375]=> - int(26220) - [376]=> - int(17235) - [377]=> - int(19777) - [378]=> - int(65535) - [379]=> - int(65535) - [380]=> - int(65535) - [381]=> - int(65535) - [382]=> - int(65535) - [383]=> - int(65535) - [384]=> - int(65535) - [385]=> - int(65535) - [386]=> - int(501) - [387]=> - int(0) - [388]=> - int(20) - [389]=> - int(0) - [390]=> - int(0) - [391]=> - int(0) - [392]=> - int(16877) - [393]=> - int(0) - [394]=> - int(3) - [395]=> - int(0) - [396]=> - int(0) - [397]=> - int(0) - [398]=> - int(0) - [399]=> - int(0) - [400]=> - int(0) - [401]=> - int(0) - [402]=> - int(65535) - [403]=> - int(65535) - [404]=> - int(65535) - [405]=> - int(65535) - [406]=> - int(65535) - [407]=> - int(65535) - [408]=> - int(65535) - [409]=> - int(65535) - [410]=> - int(0) - [411]=> - int(0) - [412]=> - int(53440) - [413]=> - int(2025) - [414]=> - int(16) - [415]=> - int(57377) - [416]=> - int(1024) - [417]=> - int(960) - [418]=> - int(0) - [419]=> - int(0) - [420]=> - int(41120) - [421]=> - int(9024) - [422]=> - int(65436) - [423]=> - int(0) - [424]=> - int(47655) - [425]=> - int(8) - [426]=> - int(24480) - [427]=> - int(8404) - [428]=> - int(0) - [429]=> - int(0) - [430]=> - int(0) - [431]=> - int(0) - [432]=> - int(0) - [433]=> - int(0) - [434]=> - int(0) - [435]=> - int(0) - [436]=> - int(0) - [437]=> - int(21315) - [438]=> - int(50294) - [439]=> - int(0) - [440]=> - int(0) - [441]=> - int(53635) - [442]=> - int(50294) - [443]=> - int(0) - [444]=> - int(25714) - [445]=> - int(26220) - [446]=> - int(17235) - [447]=> - int(19777) - [448]=> - int(65535) - [449]=> - int(65535) - [450]=> - int(65535) - [451]=> - int(65535) - [452]=> - int(65535) - [453]=> - int(65535) - [454]=> - int(65535) - [455]=> - int(65535) - [456]=> - int(501) - [457]=> - int(0) - [458]=> - int(20) - [459]=> - int(0) - [460]=> - int(0) - [461]=> - int(0) - [462]=> - int(16877) - [463]=> - int(0) - [464]=> - int(3) - [465]=> - int(0) - [466]=> - int(0) - [467]=> - int(0) - [468]=> - int(0) - [469]=> - int(0) - [470]=> - int(0) - [471]=> - int(0) - [472]=> - int(65535) - [473]=> - int(65535) - [474]=> - int(65535) - [475]=> - int(65535) - [476]=> - int(65535) - [477]=> - int(65535) - [478]=> - int(65535) - [479]=> - int(65535) - [480]=> - int(0) - [481]=> - int(0) - [482]=> - int(54028) - [483]=> - int(2772) - [484]=> - int(16) - [485]=> - int(57377) - [486]=> - int(1024) - [487]=> - int(960) - [488]=> - int(0) - [489]=> - int(0) - [490]=> - int(42384) - [491]=> - int(8408) - [492]=> - int(65436) - [493]=> - int(0) - [494]=> - int(47655) - [495]=> - int(8) - [496]=> - int(1136) - [497]=> - int(8348) - [498]=> - int(0) - [499]=> - int(0) - [500]=> - int(0) - [501]=> - int(0) - [502]=> - int(0) - [503]=> - int(0) - [504]=> - int(0) - [505]=> - int(0) - [506]=> - int(0) - [507]=> - int(12326) - [508]=> - int(50261) - [509]=> - int(0) - [510]=> - int(0) - [511]=> - int(12326) - [512]=> - int(0) - [513]=> - int(65280) - [514]=> - int(32512) - [515]=> - int(49152) - [516]=> - int(0) - [517]=> - int(0) - [518]=> - int(22663) - [519]=> - int(2) - [520]=> - int(0) - [521]=> - int(0) - [522]=> - int(24576) - [523]=> - int(2) - [524]=> - int(0) - [525]=> - int(0) - [526]=> - int(501) - [527]=> - int(0) - [528]=> - int(20) - [529]=> - int(0) - [530]=> - int(0) - [531]=> - int(0) - [532]=> - int(33188) - [533]=> - int(0) - [534]=> - int(0) - [535]=> - int(0) - [536]=> - int(0) - [537]=> - int(0) - [538]=> - int(0) - [539]=> - int(0) - [540]=> - int(0) - [541]=> - int(0) - [542]=> - int(0) - [543]=> - int(0) - [544]=> - int(0) - [545]=> - int(0) - [546]=> - int(0) - [547]=> - int(0) - [548]=> - int(0) - [549]=> - int(0) - [550]=> - int(0) - [551]=> - int(0) - [552]=> - int(51766) - [553]=> - int(1946) - [554]=> - int(0) - [555]=> - int(24609) - [556]=> - int(1088) - [557]=> - int(960) - [558]=> - int(0) - [559]=> - int(0) - [560]=> - int(0) - [561]=> - int(0) - [562]=> - int(25116) - [563]=> - int(2012) - [564]=> - int(0) - [565]=> - int(0) - [566]=> - int(0) - [567]=> - int(0) - [568]=> - int(0) - [569]=> - int(0) - [570]=> - int(0) - [571]=> - int(0) - [572]=> - int(0) - [573]=> - int(0) - [574]=> - int(0) - [575]=> - int(0) - [576]=> - int(0) - [577]=> - int(0) - [578]=> - int(0) - [579]=> - int(0) - [580]=> - int(0) - [581]=> - int(0) - [582]=> - int(0) - [583]=> - int(0) - [584]=> - int(0) - [585]=> - int(0) - [586]=> - int(0) - [587]=> - int(0) - [588]=> - int(0) - [589]=> - int(0) - [590]=> - int(0) - [591]=> - int(0) - [592]=> - int(0) - [593]=> - int(0) - [594]=> - int(0) - [595]=> - int(0) - [596]=> - int(0) - [597]=> - int(0) - [598]=> - int(0) - [599]=> - int(0) - [600]=> - int(0) - [601]=> - int(0) - [602]=> - int(0) - [603]=> - int(0) - [604]=> - int(0) - [605]=> - int(0) - [606]=> - int(0) - [607]=> - int(0) - [608]=> - int(0) - [609]=> - int(0) - [610]=> - int(0) - [611]=> - int(0) - [612]=> - int(0) - [613]=> - int(0) - [614]=> - int(0) - [615]=> - int(0) - [616]=> - int(0) - [617]=> - int(0) - [618]=> - int(0) - [619]=> - int(0) - [620]=> - int(0) - [621]=> - int(0) - [622]=> - int(0) - [623]=> - int(0) - [624]=> - int(0) - [625]=> - int(0) - [626]=> - int(0) - [627]=> - int(0) - [628]=> - int(0) - [629]=> - int(0) - [630]=> - int(0) - [631]=> - int(0) - [632]=> - int(0) - [633]=> - int(0) - [634]=> - int(0) - [635]=> - int(0) - [636]=> - int(0) - [637]=> - int(0) - [638]=> - int(0) - [639]=> - int(0) - [640]=> - int(0) - [641]=> - int(0) - [642]=> - int(0) - [643]=> - int(0) - [644]=> - int(0) - [645]=> - int(0) - [646]=> - int(0) - [647]=> - int(0) - [648]=> - int(0) - [649]=> - int(0) - [650]=> - int(0) - [651]=> - int(0) - [652]=> - int(0) - [653]=> - int(0) - [654]=> - int(0) - [655]=> - int(0) - [656]=> - int(0) - [657]=> - int(0) - [658]=> - int(0) - [659]=> - int(0) - [660]=> - int(0) - [661]=> - int(0) - [662]=> - int(0) - [663]=> - int(0) - [664]=> - int(0) - [665]=> - int(0) - [666]=> - int(0) - [667]=> - int(0) - [668]=> - int(0) - [669]=> - int(0) - [670]=> - int(0) - [671]=> - int(0) - [672]=> - int(0) - [673]=> - int(0) - [674]=> - int(0) - [675]=> - int(0) - [676]=> - int(0) - [677]=> - int(0) - [678]=> - int(0) - [679]=> - int(0) - [680]=> - int(0) - [681]=> - int(0) - [682]=> - int(0) - [683]=> - int(0) - [684]=> - int(0) - [685]=> - int(0) - [686]=> - int(0) - [687]=> - int(0) - [688]=> - int(0) - [689]=> - int(0) - [690]=> - int(0) - [691]=> - int(0) - [692]=> - int(0) - [693]=> - int(0) - [694]=> - int(0) - [695]=> - int(0) - [696]=> - int(0) - [697]=> - int(0) - [698]=> - int(0) - [699]=> - int(0) - [700]=> - int(0) - [701]=> - int(0) - [702]=> - int(0) - [703]=> - int(0) - [704]=> - int(0) - [705]=> - int(0) - [706]=> - int(0) - [707]=> - int(0) - [708]=> - int(0) - [709]=> - int(0) - [710]=> - int(0) - [711]=> - int(0) - [712]=> - int(0) - [713]=> - int(0) - [714]=> - int(0) - [715]=> - int(0) - [716]=> - int(0) - [717]=> - int(0) - [718]=> - int(0) - [719]=> - int(0) - [720]=> - int(0) - [721]=> - int(0) - [722]=> - int(0) - [723]=> - int(0) - [724]=> - int(0) - [725]=> - int(0) - [726]=> - int(0) - [727]=> - int(0) - [728]=> - int(0) - [729]=> - int(0) - [730]=> - int(0) - [731]=> - int(0) - [732]=> - int(0) - [733]=> - int(0) - [734]=> - int(0) - [735]=> - int(0) - [736]=> - int(0) - [737]=> - int(0) - [738]=> - int(0) - [739]=> - int(0) - [740]=> - int(0) - [741]=> - int(0) - [742]=> - int(0) - [743]=> - int(0) - [744]=> - int(0) - [745]=> - int(0) - [746]=> - int(0) - [747]=> - int(0) - [748]=> - int(0) - [749]=> - int(0) - [750]=> - int(0) - [751]=> - int(0) - [752]=> - int(0) - [753]=> - int(0) - [754]=> - int(0) - [755]=> - int(0) - [756]=> - int(0) - [757]=> - int(0) - [758]=> - int(0) - [759]=> - int(0) - [760]=> - int(0) - [761]=> - int(0) - [762]=> - int(0) - [763]=> - int(0) - [764]=> - int(0) - [765]=> - int(0) - [766]=> - int(0) - [767]=> - int(0) - } - ["Copyright"]=> - string(12) "Eric Stewart" - ["ExposureTime"]=> - string(5) "1/125" - ["FNumber"]=> - string(3) "8/1" - ["ISOSpeedRatings"]=> - int(80) - ["DateTimeOriginal"]=> - string(19) "2008:06:19 01:47:53" - ["DateTimeDigitized"]=> - string(19) "2008:06:19 01:47:53" - ["MeteringMode"]=> - int(5) - ["LightSource"]=> - int(4) - ["Flash"]=> - int(7) - ["FocalLength"]=> - string(4) "29/5" - ["ExifImageWidth"]=> - int(1) - ["ExifImageLength"]=> - int(1) -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif020.phpt b/ext/exif/tests/exif020.phpt deleted file mode 100644 index c6bb13c3258f4..0000000000000 --- a/ext/exif/tests/exif020.phpt +++ /dev/null @@ -1,1659 +0,0 @@ ---TEST-- -Check for exif_read_data, TIFF with IFD and GPS data in Intel byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(34) { - ["FileName"]=> - string(13) "image020.tiff" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(7) - ["MimeType"]=> - string(10) "image/tiff" - ["SectionsFound"]=> - string(18) "ANY_TAG, IFD0, GPS" - ["COMPUTED"]=> - array(8) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageWidth"]=> - int(1) - ["ImageLength"]=> - int(1) - ["BitsPerSample"]=> - int(8) - ["Compression"]=> - int(5) - ["PhotometricInterpretation"]=> - int(3) - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["StripOffsets"]=> - int(2064) - ["SamplesPerPixel"]=> - int(1) - ["RowsPerStrip"]=> - int(8) - ["StripByteCounts"]=> - int(4) - ["XResolution"]=> - string(17) "381681664/2097152" - ["YResolution"]=> - string(17) "381681664/2097152" - ["PlanarConfiguration"]=> - int(1) - ["ResolutionUnit"]=> - int(2) - ["Artist"]=> - string(12) "Eric Stewart" - ["ColorMap"]=> - array(768) { - [0]=> - int(0) - [1]=> - int(65280) - [2]=> - int(32512) - [3]=> - int(49152) - [4]=> - int(99) - [5]=> - int(115) - [6]=> - int(116) - [7]=> - int(101) - [8]=> - int(119) - [9]=> - int(97) - [10]=> - int(114) - [11]=> - int(116) - [12]=> - int(0) - [13]=> - int(0) - [14]=> - int(0) - [15]=> - int(0) - [16]=> - int(0) - [17]=> - int(0) - [18]=> - int(0) - [19]=> - int(0) - [20]=> - int(0) - [21]=> - int(0) - [22]=> - int(0) - [23]=> - int(0) - [24]=> - int(0) - [25]=> - int(0) - [26]=> - int(0) - [27]=> - int(0) - [28]=> - int(0) - [29]=> - int(0) - [30]=> - int(0) - [31]=> - int(0) - [32]=> - int(0) - [33]=> - int(0) - [34]=> - int(0) - [35]=> - int(0) - [36]=> - int(0) - [37]=> - int(0) - [38]=> - int(0) - [39]=> - int(0) - [40]=> - int(0) - [41]=> - int(0) - [42]=> - int(0) - [43]=> - int(0) - [44]=> - int(0) - [45]=> - int(0) - [46]=> - int(0) - [47]=> - int(0) - [48]=> - int(0) - [49]=> - int(0) - [50]=> - int(0) - [51]=> - int(0) - [52]=> - int(0) - [53]=> - int(0) - [54]=> - int(0) - [55]=> - int(0) - [56]=> - int(0) - [57]=> - int(0) - [58]=> - int(0) - [59]=> - int(0) - [60]=> - int(0) - [61]=> - int(0) - [62]=> - int(0) - [63]=> - int(0) - [64]=> - int(0) - [65]=> - int(0) - [66]=> - int(0) - [67]=> - int(0) - [68]=> - int(0) - [69]=> - int(0) - [70]=> - int(0) - [71]=> - int(0) - [72]=> - int(0) - [73]=> - int(0) - [74]=> - int(0) - [75]=> - int(0) - [76]=> - int(0) - [77]=> - int(0) - [78]=> - int(0) - [79]=> - int(0) - [80]=> - int(0) - [81]=> - int(0) - [82]=> - int(0) - [83]=> - int(0) - [84]=> - int(0) - [85]=> - int(0) - [86]=> - int(0) - [87]=> - int(0) - [88]=> - int(0) - [89]=> - int(0) - [90]=> - int(0) - [91]=> - int(0) - [92]=> - int(0) - [93]=> - int(0) - [94]=> - int(0) - [95]=> - int(0) - [96]=> - int(0) - [97]=> - int(0) - [98]=> - int(0) - [99]=> - int(0) - [100]=> - int(0) - [101]=> - int(0) - [102]=> - int(0) - [103]=> - int(0) - [104]=> - int(0) - [105]=> - int(0) - [106]=> - int(0) - [107]=> - int(0) - [108]=> - int(0) - [109]=> - int(0) - [110]=> - int(0) - [111]=> - int(0) - [112]=> - int(0) - [113]=> - int(0) - [114]=> - int(0) - [115]=> - int(0) - [116]=> - int(0) - [117]=> - int(0) - [118]=> - int(0) - [119]=> - int(0) - [120]=> - int(0) - [121]=> - int(0) - [122]=> - int(0) - [123]=> - int(0) - [124]=> - int(0) - [125]=> - int(0) - [126]=> - int(0) - [127]=> - int(0) - [128]=> - int(0) - [129]=> - int(0) - [130]=> - int(0) - [131]=> - int(0) - [132]=> - int(0) - [133]=> - int(0) - [134]=> - int(0) - [135]=> - int(0) - [136]=> - int(0) - [137]=> - int(0) - [138]=> - int(0) - [139]=> - int(0) - [140]=> - int(0) - [141]=> - int(0) - [142]=> - int(0) - [143]=> - int(0) - [144]=> - int(0) - [145]=> - int(0) - [146]=> - int(0) - [147]=> - int(0) - [148]=> - int(0) - [149]=> - int(0) - [150]=> - int(0) - [151]=> - int(0) - [152]=> - int(0) - [153]=> - int(0) - [154]=> - int(0) - [155]=> - int(0) - [156]=> - int(0) - [157]=> - int(0) - [158]=> - int(0) - [159]=> - int(0) - [160]=> - int(0) - [161]=> - int(0) - [162]=> - int(0) - [163]=> - int(0) - [164]=> - int(0) - [165]=> - int(0) - [166]=> - int(0) - [167]=> - int(0) - [168]=> - int(0) - [169]=> - int(0) - [170]=> - int(0) - [171]=> - int(0) - [172]=> - int(0) - [173]=> - int(0) - [174]=> - int(0) - [175]=> - int(0) - [176]=> - int(0) - [177]=> - int(0) - [178]=> - int(0) - [179]=> - int(0) - [180]=> - int(0) - [181]=> - int(0) - [182]=> - int(0) - [183]=> - int(0) - [184]=> - int(0) - [185]=> - int(0) - [186]=> - int(0) - [187]=> - int(0) - [188]=> - int(0) - [189]=> - int(0) - [190]=> - int(0) - [191]=> - int(0) - [192]=> - int(0) - [193]=> - int(0) - [194]=> - int(0) - [195]=> - int(0) - [196]=> - int(0) - [197]=> - int(0) - [198]=> - int(0) - [199]=> - int(0) - [200]=> - int(0) - [201]=> - int(0) - [202]=> - int(0) - [203]=> - int(0) - [204]=> - int(0) - [205]=> - int(0) - [206]=> - int(0) - [207]=> - int(0) - [208]=> - int(0) - [209]=> - int(0) - [210]=> - int(0) - [211]=> - int(0) - [212]=> - int(0) - [213]=> - int(0) - [214]=> - int(0) - [215]=> - int(0) - [216]=> - int(0) - [217]=> - int(0) - [218]=> - int(0) - [219]=> - int(0) - [220]=> - int(0) - [221]=> - int(0) - [222]=> - int(0) - [223]=> - int(0) - [224]=> - int(0) - [225]=> - int(0) - [226]=> - int(0) - [227]=> - int(0) - [228]=> - int(0) - [229]=> - int(0) - [230]=> - int(0) - [231]=> - int(0) - [232]=> - int(0) - [233]=> - int(0) - [234]=> - int(0) - [235]=> - int(0) - [236]=> - int(0) - [237]=> - int(0) - [238]=> - int(0) - [239]=> - int(0) - [240]=> - int(0) - [241]=> - int(0) - [242]=> - int(0) - [243]=> - int(0) - [244]=> - int(0) - [245]=> - int(0) - [246]=> - int(0) - [247]=> - int(0) - [248]=> - int(0) - [249]=> - int(0) - [250]=> - int(0) - [251]=> - int(0) - [252]=> - int(0) - [253]=> - int(0) - [254]=> - int(0) - [255]=> - int(1) - [256]=> - int(0) - [257]=> - int(65280) - [258]=> - int(32512) - [259]=> - int(49152) - [260]=> - int(0) - [261]=> - int(0) - [262]=> - int(0) - [263]=> - int(0) - [264]=> - int(0) - [265]=> - int(0) - [266]=> - int(0) - [267]=> - int(0) - [268]=> - int(0) - [269]=> - int(0) - [270]=> - int(0) - [271]=> - int(0) - [272]=> - int(11945) - [273]=> - int(1914) - [274]=> - int(0) - [275]=> - int(24609) - [276]=> - int(1088) - [277]=> - int(960) - [278]=> - int(0) - [279]=> - int(0) - [280]=> - int(20000) - [281]=> - int(8414) - [282]=> - int(65436) - [283]=> - int(0) - [284]=> - int(47655) - [285]=> - int(8) - [286]=> - int(37936) - [287]=> - int(8406) - [288]=> - int(0) - [289]=> - int(0) - [290]=> - int(0) - [291]=> - int(0) - [292]=> - int(0) - [293]=> - int(0) - [294]=> - int(0) - [295]=> - int(0) - [296]=> - int(0) - [297]=> - int(64652) - [298]=> - int(50264) - [299]=> - int(0) - [300]=> - int(0) - [301]=> - int(64887) - [302]=> - int(50264) - [303]=> - int(0) - [304]=> - int(25714) - [305]=> - int(26220) - [306]=> - int(17235) - [307]=> - int(19777) - [308]=> - int(65535) - [309]=> - int(65535) - [310]=> - int(65535) - [311]=> - int(65535) - [312]=> - int(65535) - [313]=> - int(65535) - [314]=> - int(65535) - [315]=> - int(65535) - [316]=> - int(501) - [317]=> - int(0) - [318]=> - int(20) - [319]=> - int(0) - [320]=> - int(0) - [321]=> - int(0) - [322]=> - int(16877) - [323]=> - int(0) - [324]=> - int(3) - [325]=> - int(0) - [326]=> - int(0) - [327]=> - int(0) - [328]=> - int(0) - [329]=> - int(0) - [330]=> - int(0) - [331]=> - int(0) - [332]=> - int(65535) - [333]=> - int(65535) - [334]=> - int(65535) - [335]=> - int(65535) - [336]=> - int(65535) - [337]=> - int(65535) - [338]=> - int(65535) - [339]=> - int(65535) - [340]=> - int(0) - [341]=> - int(0) - [342]=> - int(52840) - [343]=> - int(2025) - [344]=> - int(16) - [345]=> - int(57377) - [346]=> - int(1024) - [347]=> - int(960) - [348]=> - int(0) - [349]=> - int(0) - [350]=> - int(27136) - [351]=> - int(8414) - [352]=> - int(65436) - [353]=> - int(0) - [354]=> - int(47655) - [355]=> - int(8) - [356]=> - int(62400) - [357]=> - int(8407) - [358]=> - int(0) - [359]=> - int(0) - [360]=> - int(0) - [361]=> - int(0) - [362]=> - int(0) - [363]=> - int(0) - [364]=> - int(0) - [365]=> - int(0) - [366]=> - int(0) - [367]=> - int(64857) - [368]=> - int(50264) - [369]=> - int(0) - [370]=> - int(0) - [371]=> - int(64892) - [372]=> - int(50264) - [373]=> - int(0) - [374]=> - int(25714) - [375]=> - int(26220) - [376]=> - int(17235) - [377]=> - int(19777) - [378]=> - int(65535) - [379]=> - int(65535) - [380]=> - int(65535) - [381]=> - int(65535) - [382]=> - int(65535) - [383]=> - int(65535) - [384]=> - int(65535) - [385]=> - int(65535) - [386]=> - int(501) - [387]=> - int(0) - [388]=> - int(20) - [389]=> - int(0) - [390]=> - int(0) - [391]=> - int(0) - [392]=> - int(16877) - [393]=> - int(0) - [394]=> - int(3) - [395]=> - int(0) - [396]=> - int(0) - [397]=> - int(0) - [398]=> - int(0) - [399]=> - int(0) - [400]=> - int(0) - [401]=> - int(0) - [402]=> - int(65535) - [403]=> - int(65535) - [404]=> - int(65535) - [405]=> - int(65535) - [406]=> - int(65535) - [407]=> - int(65535) - [408]=> - int(65535) - [409]=> - int(65535) - [410]=> - int(0) - [411]=> - int(0) - [412]=> - int(53440) - [413]=> - int(2025) - [414]=> - int(16) - [415]=> - int(57377) - [416]=> - int(1024) - [417]=> - int(960) - [418]=> - int(0) - [419]=> - int(0) - [420]=> - int(41120) - [421]=> - int(9024) - [422]=> - int(65436) - [423]=> - int(0) - [424]=> - int(47655) - [425]=> - int(8) - [426]=> - int(24480) - [427]=> - int(8404) - [428]=> - int(0) - [429]=> - int(0) - [430]=> - int(0) - [431]=> - int(0) - [432]=> - int(0) - [433]=> - int(0) - [434]=> - int(0) - [435]=> - int(0) - [436]=> - int(0) - [437]=> - int(21315) - [438]=> - int(50294) - [439]=> - int(0) - [440]=> - int(0) - [441]=> - int(53635) - [442]=> - int(50294) - [443]=> - int(0) - [444]=> - int(25714) - [445]=> - int(26220) - [446]=> - int(17235) - [447]=> - int(19777) - [448]=> - int(65535) - [449]=> - int(65535) - [450]=> - int(65535) - [451]=> - int(65535) - [452]=> - int(65535) - [453]=> - int(65535) - [454]=> - int(65535) - [455]=> - int(65535) - [456]=> - int(501) - [457]=> - int(0) - [458]=> - int(20) - [459]=> - int(0) - [460]=> - int(0) - [461]=> - int(0) - [462]=> - int(16877) - [463]=> - int(0) - [464]=> - int(3) - [465]=> - int(0) - [466]=> - int(0) - [467]=> - int(0) - [468]=> - int(0) - [469]=> - int(0) - [470]=> - int(0) - [471]=> - int(0) - [472]=> - int(65535) - [473]=> - int(65535) - [474]=> - int(65535) - [475]=> - int(65535) - [476]=> - int(65535) - [477]=> - int(65535) - [478]=> - int(65535) - [479]=> - int(65535) - [480]=> - int(0) - [481]=> - int(0) - [482]=> - int(54028) - [483]=> - int(2772) - [484]=> - int(16) - [485]=> - int(57377) - [486]=> - int(1024) - [487]=> - int(960) - [488]=> - int(0) - [489]=> - int(0) - [490]=> - int(42384) - [491]=> - int(8408) - [492]=> - int(65436) - [493]=> - int(0) - [494]=> - int(47655) - [495]=> - int(8) - [496]=> - int(1136) - [497]=> - int(8348) - [498]=> - int(0) - [499]=> - int(0) - [500]=> - int(0) - [501]=> - int(0) - [502]=> - int(0) - [503]=> - int(0) - [504]=> - int(0) - [505]=> - int(0) - [506]=> - int(0) - [507]=> - int(12326) - [508]=> - int(50261) - [509]=> - int(0) - [510]=> - int(0) - [511]=> - int(12326) - [512]=> - int(0) - [513]=> - int(65280) - [514]=> - int(32512) - [515]=> - int(49152) - [516]=> - int(0) - [517]=> - int(0) - [518]=> - int(22663) - [519]=> - int(2) - [520]=> - int(0) - [521]=> - int(0) - [522]=> - int(24576) - [523]=> - int(2) - [524]=> - int(0) - [525]=> - int(0) - [526]=> - int(501) - [527]=> - int(0) - [528]=> - int(20) - [529]=> - int(0) - [530]=> - int(0) - [531]=> - int(0) - [532]=> - int(33188) - [533]=> - int(0) - [534]=> - int(0) - [535]=> - int(0) - [536]=> - int(0) - [537]=> - int(0) - [538]=> - int(0) - [539]=> - int(0) - [540]=> - int(0) - [541]=> - int(0) - [542]=> - int(0) - [543]=> - int(0) - [544]=> - int(0) - [545]=> - int(0) - [546]=> - int(0) - [547]=> - int(0) - [548]=> - int(0) - [549]=> - int(0) - [550]=> - int(0) - [551]=> - int(0) - [552]=> - int(51766) - [553]=> - int(1946) - [554]=> - int(0) - [555]=> - int(24609) - [556]=> - int(1088) - [557]=> - int(960) - [558]=> - int(0) - [559]=> - int(0) - [560]=> - int(0) - [561]=> - int(0) - [562]=> - int(25116) - [563]=> - int(2012) - [564]=> - int(0) - [565]=> - int(0) - [566]=> - int(0) - [567]=> - int(0) - [568]=> - int(0) - [569]=> - int(0) - [570]=> - int(0) - [571]=> - int(0) - [572]=> - int(0) - [573]=> - int(0) - [574]=> - int(0) - [575]=> - int(0) - [576]=> - int(0) - [577]=> - int(0) - [578]=> - int(0) - [579]=> - int(0) - [580]=> - int(0) - [581]=> - int(0) - [582]=> - int(0) - [583]=> - int(0) - [584]=> - int(0) - [585]=> - int(0) - [586]=> - int(0) - [587]=> - int(0) - [588]=> - int(0) - [589]=> - int(0) - [590]=> - int(0) - [591]=> - int(0) - [592]=> - int(0) - [593]=> - int(0) - [594]=> - int(0) - [595]=> - int(0) - [596]=> - int(0) - [597]=> - int(0) - [598]=> - int(0) - [599]=> - int(0) - [600]=> - int(0) - [601]=> - int(0) - [602]=> - int(0) - [603]=> - int(0) - [604]=> - int(0) - [605]=> - int(0) - [606]=> - int(0) - [607]=> - int(0) - [608]=> - int(0) - [609]=> - int(0) - [610]=> - int(0) - [611]=> - int(0) - [612]=> - int(0) - [613]=> - int(0) - [614]=> - int(0) - [615]=> - int(0) - [616]=> - int(0) - [617]=> - int(0) - [618]=> - int(0) - [619]=> - int(0) - [620]=> - int(0) - [621]=> - int(0) - [622]=> - int(0) - [623]=> - int(0) - [624]=> - int(0) - [625]=> - int(0) - [626]=> - int(0) - [627]=> - int(0) - [628]=> - int(0) - [629]=> - int(0) - [630]=> - int(0) - [631]=> - int(0) - [632]=> - int(0) - [633]=> - int(0) - [634]=> - int(0) - [635]=> - int(0) - [636]=> - int(0) - [637]=> - int(0) - [638]=> - int(0) - [639]=> - int(0) - [640]=> - int(0) - [641]=> - int(0) - [642]=> - int(0) - [643]=> - int(0) - [644]=> - int(0) - [645]=> - int(0) - [646]=> - int(0) - [647]=> - int(0) - [648]=> - int(0) - [649]=> - int(0) - [650]=> - int(0) - [651]=> - int(0) - [652]=> - int(0) - [653]=> - int(0) - [654]=> - int(0) - [655]=> - int(0) - [656]=> - int(0) - [657]=> - int(0) - [658]=> - int(0) - [659]=> - int(0) - [660]=> - int(0) - [661]=> - int(0) - [662]=> - int(0) - [663]=> - int(0) - [664]=> - int(0) - [665]=> - int(0) - [666]=> - int(0) - [667]=> - int(0) - [668]=> - int(0) - [669]=> - int(0) - [670]=> - int(0) - [671]=> - int(0) - [672]=> - int(0) - [673]=> - int(0) - [674]=> - int(0) - [675]=> - int(0) - [676]=> - int(0) - [677]=> - int(0) - [678]=> - int(0) - [679]=> - int(0) - [680]=> - int(0) - [681]=> - int(0) - [682]=> - int(0) - [683]=> - int(0) - [684]=> - int(0) - [685]=> - int(0) - [686]=> - int(0) - [687]=> - int(0) - [688]=> - int(0) - [689]=> - int(0) - [690]=> - int(0) - [691]=> - int(0) - [692]=> - int(0) - [693]=> - int(0) - [694]=> - int(0) - [695]=> - int(0) - [696]=> - int(0) - [697]=> - int(0) - [698]=> - int(0) - [699]=> - int(0) - [700]=> - int(0) - [701]=> - int(0) - [702]=> - int(0) - [703]=> - int(0) - [704]=> - int(0) - [705]=> - int(0) - [706]=> - int(0) - [707]=> - int(0) - [708]=> - int(0) - [709]=> - int(0) - [710]=> - int(0) - [711]=> - int(0) - [712]=> - int(0) - [713]=> - int(0) - [714]=> - int(0) - [715]=> - int(0) - [716]=> - int(0) - [717]=> - int(0) - [718]=> - int(0) - [719]=> - int(0) - [720]=> - int(0) - [721]=> - int(0) - [722]=> - int(0) - [723]=> - int(0) - [724]=> - int(0) - [725]=> - int(0) - [726]=> - int(0) - [727]=> - int(0) - [728]=> - int(0) - [729]=> - int(0) - [730]=> - int(0) - [731]=> - int(0) - [732]=> - int(0) - [733]=> - int(0) - [734]=> - int(0) - [735]=> - int(0) - [736]=> - int(0) - [737]=> - int(0) - [738]=> - int(0) - [739]=> - int(0) - [740]=> - int(0) - [741]=> - int(0) - [742]=> - int(0) - [743]=> - int(0) - [744]=> - int(0) - [745]=> - int(0) - [746]=> - int(0) - [747]=> - int(0) - [748]=> - int(0) - [749]=> - int(0) - [750]=> - int(0) - [751]=> - int(0) - [752]=> - int(0) - [753]=> - int(0) - [754]=> - int(0) - [755]=> - int(0) - [756]=> - int(0) - [757]=> - int(0) - [758]=> - int(0) - [759]=> - int(0) - [760]=> - int(0) - [761]=> - int(0) - [762]=> - int(0) - [763]=> - int(0) - [764]=> - int(0) - [765]=> - int(0) - [766]=> - int(0) - [767]=> - int(0) - } - ["Copyright"]=> - string(12) "Eric Stewart" - ["GPSVersion"]=> - string(4) "" - ["GPSLatitudeRef"]=> - string(1) "N" - ["GPSLatitude"]=> - array(3) { - [0]=> - string(4) "33/1" - [1]=> - string(4) "37/1" - [2]=> - string(3) "0/1" - } - ["GPSLongitudeRef"]=> - string(1) "W" - ["GPSLongitude"]=> - array(3) { - [0]=> - string(4) "84/1" - [1]=> - string(3) "7/1" - [2]=> - string(3) "0/1" - } - ["GPSAltitudeRef"]=> - string(1) "" - ["GPSAltitude"]=> - string(5) "295/1" - ["GPSTimeStamp"]=> - array(3) { - [0]=> - string(3) "1/1" - [1]=> - string(4) "47/1" - [2]=> - string(4) "53/1" - } -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif021.phpt b/ext/exif/tests/exif021.phpt deleted file mode 100644 index 2cf446b00ce91..0000000000000 --- a/ext/exif/tests/exif021.phpt +++ /dev/null @@ -1,1659 +0,0 @@ ---TEST-- -Check for exif_read_data, TIFF with IFD and GPS data in Motorola byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(34) { - ["FileName"]=> - string(13) "image021.tiff" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(8) - ["MimeType"]=> - string(10) "image/tiff" - ["SectionsFound"]=> - string(18) "ANY_TAG, IFD0, GPS" - ["COMPUTED"]=> - array(8) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageWidth"]=> - int(1) - ["ImageLength"]=> - int(1) - ["BitsPerSample"]=> - int(8) - ["Compression"]=> - int(5) - ["PhotometricInterpretation"]=> - int(3) - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["StripOffsets"]=> - int(2064) - ["SamplesPerPixel"]=> - int(1) - ["RowsPerStrip"]=> - int(8) - ["StripByteCounts"]=> - int(4) - ["XResolution"]=> - string(17) "381681664/2097152" - ["YResolution"]=> - string(17) "381681664/2097152" - ["PlanarConfiguration"]=> - int(1) - ["ResolutionUnit"]=> - int(2) - ["Artist"]=> - string(12) "Eric Stewart" - ["ColorMap"]=> - array(768) { - [0]=> - int(0) - [1]=> - int(65280) - [2]=> - int(32512) - [3]=> - int(49152) - [4]=> - int(99) - [5]=> - int(115) - [6]=> - int(116) - [7]=> - int(101) - [8]=> - int(119) - [9]=> - int(97) - [10]=> - int(114) - [11]=> - int(116) - [12]=> - int(0) - [13]=> - int(0) - [14]=> - int(0) - [15]=> - int(0) - [16]=> - int(0) - [17]=> - int(0) - [18]=> - int(0) - [19]=> - int(0) - [20]=> - int(0) - [21]=> - int(0) - [22]=> - int(0) - [23]=> - int(0) - [24]=> - int(0) - [25]=> - int(0) - [26]=> - int(0) - [27]=> - int(0) - [28]=> - int(0) - [29]=> - int(0) - [30]=> - int(0) - [31]=> - int(0) - [32]=> - int(0) - [33]=> - int(0) - [34]=> - int(0) - [35]=> - int(0) - [36]=> - int(0) - [37]=> - int(0) - [38]=> - int(0) - [39]=> - int(0) - [40]=> - int(0) - [41]=> - int(0) - [42]=> - int(0) - [43]=> - int(0) - [44]=> - int(0) - [45]=> - int(0) - [46]=> - int(0) - [47]=> - int(0) - [48]=> - int(0) - [49]=> - int(0) - [50]=> - int(0) - [51]=> - int(0) - [52]=> - int(0) - [53]=> - int(0) - [54]=> - int(0) - [55]=> - int(0) - [56]=> - int(0) - [57]=> - int(0) - [58]=> - int(0) - [59]=> - int(0) - [60]=> - int(0) - [61]=> - int(0) - [62]=> - int(0) - [63]=> - int(0) - [64]=> - int(0) - [65]=> - int(0) - [66]=> - int(0) - [67]=> - int(0) - [68]=> - int(0) - [69]=> - int(0) - [70]=> - int(0) - [71]=> - int(0) - [72]=> - int(0) - [73]=> - int(0) - [74]=> - int(0) - [75]=> - int(0) - [76]=> - int(0) - [77]=> - int(0) - [78]=> - int(0) - [79]=> - int(0) - [80]=> - int(0) - [81]=> - int(0) - [82]=> - int(0) - [83]=> - int(0) - [84]=> - int(0) - [85]=> - int(0) - [86]=> - int(0) - [87]=> - int(0) - [88]=> - int(0) - [89]=> - int(0) - [90]=> - int(0) - [91]=> - int(0) - [92]=> - int(0) - [93]=> - int(0) - [94]=> - int(0) - [95]=> - int(0) - [96]=> - int(0) - [97]=> - int(0) - [98]=> - int(0) - [99]=> - int(0) - [100]=> - int(0) - [101]=> - int(0) - [102]=> - int(0) - [103]=> - int(0) - [104]=> - int(0) - [105]=> - int(0) - [106]=> - int(0) - [107]=> - int(0) - [108]=> - int(0) - [109]=> - int(0) - [110]=> - int(0) - [111]=> - int(0) - [112]=> - int(0) - [113]=> - int(0) - [114]=> - int(0) - [115]=> - int(0) - [116]=> - int(0) - [117]=> - int(0) - [118]=> - int(0) - [119]=> - int(0) - [120]=> - int(0) - [121]=> - int(0) - [122]=> - int(0) - [123]=> - int(0) - [124]=> - int(0) - [125]=> - int(0) - [126]=> - int(0) - [127]=> - int(0) - [128]=> - int(0) - [129]=> - int(0) - [130]=> - int(0) - [131]=> - int(0) - [132]=> - int(0) - [133]=> - int(0) - [134]=> - int(0) - [135]=> - int(0) - [136]=> - int(0) - [137]=> - int(0) - [138]=> - int(0) - [139]=> - int(0) - [140]=> - int(0) - [141]=> - int(0) - [142]=> - int(0) - [143]=> - int(0) - [144]=> - int(0) - [145]=> - int(0) - [146]=> - int(0) - [147]=> - int(0) - [148]=> - int(0) - [149]=> - int(0) - [150]=> - int(0) - [151]=> - int(0) - [152]=> - int(0) - [153]=> - int(0) - [154]=> - int(0) - [155]=> - int(0) - [156]=> - int(0) - [157]=> - int(0) - [158]=> - int(0) - [159]=> - int(0) - [160]=> - int(0) - [161]=> - int(0) - [162]=> - int(0) - [163]=> - int(0) - [164]=> - int(0) - [165]=> - int(0) - [166]=> - int(0) - [167]=> - int(0) - [168]=> - int(0) - [169]=> - int(0) - [170]=> - int(0) - [171]=> - int(0) - [172]=> - int(0) - [173]=> - int(0) - [174]=> - int(0) - [175]=> - int(0) - [176]=> - int(0) - [177]=> - int(0) - [178]=> - int(0) - [179]=> - int(0) - [180]=> - int(0) - [181]=> - int(0) - [182]=> - int(0) - [183]=> - int(0) - [184]=> - int(0) - [185]=> - int(0) - [186]=> - int(0) - [187]=> - int(0) - [188]=> - int(0) - [189]=> - int(0) - [190]=> - int(0) - [191]=> - int(0) - [192]=> - int(0) - [193]=> - int(0) - [194]=> - int(0) - [195]=> - int(0) - [196]=> - int(0) - [197]=> - int(0) - [198]=> - int(0) - [199]=> - int(0) - [200]=> - int(0) - [201]=> - int(0) - [202]=> - int(0) - [203]=> - int(0) - [204]=> - int(0) - [205]=> - int(0) - [206]=> - int(0) - [207]=> - int(0) - [208]=> - int(0) - [209]=> - int(0) - [210]=> - int(0) - [211]=> - int(0) - [212]=> - int(0) - [213]=> - int(0) - [214]=> - int(0) - [215]=> - int(0) - [216]=> - int(0) - [217]=> - int(0) - [218]=> - int(0) - [219]=> - int(0) - [220]=> - int(0) - [221]=> - int(0) - [222]=> - int(0) - [223]=> - int(0) - [224]=> - int(0) - [225]=> - int(0) - [226]=> - int(0) - [227]=> - int(0) - [228]=> - int(0) - [229]=> - int(0) - [230]=> - int(0) - [231]=> - int(0) - [232]=> - int(0) - [233]=> - int(0) - [234]=> - int(0) - [235]=> - int(0) - [236]=> - int(0) - [237]=> - int(0) - [238]=> - int(0) - [239]=> - int(0) - [240]=> - int(0) - [241]=> - int(0) - [242]=> - int(0) - [243]=> - int(0) - [244]=> - int(0) - [245]=> - int(0) - [246]=> - int(0) - [247]=> - int(0) - [248]=> - int(0) - [249]=> - int(0) - [250]=> - int(0) - [251]=> - int(0) - [252]=> - int(0) - [253]=> - int(0) - [254]=> - int(0) - [255]=> - int(1) - [256]=> - int(0) - [257]=> - int(65280) - [258]=> - int(32512) - [259]=> - int(49152) - [260]=> - int(0) - [261]=> - int(0) - [262]=> - int(0) - [263]=> - int(0) - [264]=> - int(0) - [265]=> - int(0) - [266]=> - int(0) - [267]=> - int(0) - [268]=> - int(0) - [269]=> - int(0) - [270]=> - int(0) - [271]=> - int(0) - [272]=> - int(11945) - [273]=> - int(1914) - [274]=> - int(0) - [275]=> - int(24609) - [276]=> - int(1088) - [277]=> - int(960) - [278]=> - int(0) - [279]=> - int(0) - [280]=> - int(20000) - [281]=> - int(8414) - [282]=> - int(65436) - [283]=> - int(0) - [284]=> - int(47655) - [285]=> - int(8) - [286]=> - int(37936) - [287]=> - int(8406) - [288]=> - int(0) - [289]=> - int(0) - [290]=> - int(0) - [291]=> - int(0) - [292]=> - int(0) - [293]=> - int(0) - [294]=> - int(0) - [295]=> - int(0) - [296]=> - int(0) - [297]=> - int(64652) - [298]=> - int(50264) - [299]=> - int(0) - [300]=> - int(0) - [301]=> - int(64887) - [302]=> - int(50264) - [303]=> - int(0) - [304]=> - int(25714) - [305]=> - int(26220) - [306]=> - int(17235) - [307]=> - int(19777) - [308]=> - int(65535) - [309]=> - int(65535) - [310]=> - int(65535) - [311]=> - int(65535) - [312]=> - int(65535) - [313]=> - int(65535) - [314]=> - int(65535) - [315]=> - int(65535) - [316]=> - int(501) - [317]=> - int(0) - [318]=> - int(20) - [319]=> - int(0) - [320]=> - int(0) - [321]=> - int(0) - [322]=> - int(16877) - [323]=> - int(0) - [324]=> - int(3) - [325]=> - int(0) - [326]=> - int(0) - [327]=> - int(0) - [328]=> - int(0) - [329]=> - int(0) - [330]=> - int(0) - [331]=> - int(0) - [332]=> - int(65535) - [333]=> - int(65535) - [334]=> - int(65535) - [335]=> - int(65535) - [336]=> - int(65535) - [337]=> - int(65535) - [338]=> - int(65535) - [339]=> - int(65535) - [340]=> - int(0) - [341]=> - int(0) - [342]=> - int(52840) - [343]=> - int(2025) - [344]=> - int(16) - [345]=> - int(57377) - [346]=> - int(1024) - [347]=> - int(960) - [348]=> - int(0) - [349]=> - int(0) - [350]=> - int(27136) - [351]=> - int(8414) - [352]=> - int(65436) - [353]=> - int(0) - [354]=> - int(47655) - [355]=> - int(8) - [356]=> - int(62400) - [357]=> - int(8407) - [358]=> - int(0) - [359]=> - int(0) - [360]=> - int(0) - [361]=> - int(0) - [362]=> - int(0) - [363]=> - int(0) - [364]=> - int(0) - [365]=> - int(0) - [366]=> - int(0) - [367]=> - int(64857) - [368]=> - int(50264) - [369]=> - int(0) - [370]=> - int(0) - [371]=> - int(64892) - [372]=> - int(50264) - [373]=> - int(0) - [374]=> - int(25714) - [375]=> - int(26220) - [376]=> - int(17235) - [377]=> - int(19777) - [378]=> - int(65535) - [379]=> - int(65535) - [380]=> - int(65535) - [381]=> - int(65535) - [382]=> - int(65535) - [383]=> - int(65535) - [384]=> - int(65535) - [385]=> - int(65535) - [386]=> - int(501) - [387]=> - int(0) - [388]=> - int(20) - [389]=> - int(0) - [390]=> - int(0) - [391]=> - int(0) - [392]=> - int(16877) - [393]=> - int(0) - [394]=> - int(3) - [395]=> - int(0) - [396]=> - int(0) - [397]=> - int(0) - [398]=> - int(0) - [399]=> - int(0) - [400]=> - int(0) - [401]=> - int(0) - [402]=> - int(65535) - [403]=> - int(65535) - [404]=> - int(65535) - [405]=> - int(65535) - [406]=> - int(65535) - [407]=> - int(65535) - [408]=> - int(65535) - [409]=> - int(65535) - [410]=> - int(0) - [411]=> - int(0) - [412]=> - int(53440) - [413]=> - int(2025) - [414]=> - int(16) - [415]=> - int(57377) - [416]=> - int(1024) - [417]=> - int(960) - [418]=> - int(0) - [419]=> - int(0) - [420]=> - int(41120) - [421]=> - int(9024) - [422]=> - int(65436) - [423]=> - int(0) - [424]=> - int(47655) - [425]=> - int(8) - [426]=> - int(24480) - [427]=> - int(8404) - [428]=> - int(0) - [429]=> - int(0) - [430]=> - int(0) - [431]=> - int(0) - [432]=> - int(0) - [433]=> - int(0) - [434]=> - int(0) - [435]=> - int(0) - [436]=> - int(0) - [437]=> - int(21315) - [438]=> - int(50294) - [439]=> - int(0) - [440]=> - int(0) - [441]=> - int(53635) - [442]=> - int(50294) - [443]=> - int(0) - [444]=> - int(25714) - [445]=> - int(26220) - [446]=> - int(17235) - [447]=> - int(19777) - [448]=> - int(65535) - [449]=> - int(65535) - [450]=> - int(65535) - [451]=> - int(65535) - [452]=> - int(65535) - [453]=> - int(65535) - [454]=> - int(65535) - [455]=> - int(65535) - [456]=> - int(501) - [457]=> - int(0) - [458]=> - int(20) - [459]=> - int(0) - [460]=> - int(0) - [461]=> - int(0) - [462]=> - int(16877) - [463]=> - int(0) - [464]=> - int(3) - [465]=> - int(0) - [466]=> - int(0) - [467]=> - int(0) - [468]=> - int(0) - [469]=> - int(0) - [470]=> - int(0) - [471]=> - int(0) - [472]=> - int(65535) - [473]=> - int(65535) - [474]=> - int(65535) - [475]=> - int(65535) - [476]=> - int(65535) - [477]=> - int(65535) - [478]=> - int(65535) - [479]=> - int(65535) - [480]=> - int(0) - [481]=> - int(0) - [482]=> - int(54028) - [483]=> - int(2772) - [484]=> - int(16) - [485]=> - int(57377) - [486]=> - int(1024) - [487]=> - int(960) - [488]=> - int(0) - [489]=> - int(0) - [490]=> - int(42384) - [491]=> - int(8408) - [492]=> - int(65436) - [493]=> - int(0) - [494]=> - int(47655) - [495]=> - int(8) - [496]=> - int(1136) - [497]=> - int(8348) - [498]=> - int(0) - [499]=> - int(0) - [500]=> - int(0) - [501]=> - int(0) - [502]=> - int(0) - [503]=> - int(0) - [504]=> - int(0) - [505]=> - int(0) - [506]=> - int(0) - [507]=> - int(12326) - [508]=> - int(50261) - [509]=> - int(0) - [510]=> - int(0) - [511]=> - int(12326) - [512]=> - int(0) - [513]=> - int(65280) - [514]=> - int(32512) - [515]=> - int(49152) - [516]=> - int(0) - [517]=> - int(0) - [518]=> - int(22663) - [519]=> - int(2) - [520]=> - int(0) - [521]=> - int(0) - [522]=> - int(24576) - [523]=> - int(2) - [524]=> - int(0) - [525]=> - int(0) - [526]=> - int(501) - [527]=> - int(0) - [528]=> - int(20) - [529]=> - int(0) - [530]=> - int(0) - [531]=> - int(0) - [532]=> - int(33188) - [533]=> - int(0) - [534]=> - int(0) - [535]=> - int(0) - [536]=> - int(0) - [537]=> - int(0) - [538]=> - int(0) - [539]=> - int(0) - [540]=> - int(0) - [541]=> - int(0) - [542]=> - int(0) - [543]=> - int(0) - [544]=> - int(0) - [545]=> - int(0) - [546]=> - int(0) - [547]=> - int(0) - [548]=> - int(0) - [549]=> - int(0) - [550]=> - int(0) - [551]=> - int(0) - [552]=> - int(51766) - [553]=> - int(1946) - [554]=> - int(0) - [555]=> - int(24609) - [556]=> - int(1088) - [557]=> - int(960) - [558]=> - int(0) - [559]=> - int(0) - [560]=> - int(0) - [561]=> - int(0) - [562]=> - int(25116) - [563]=> - int(2012) - [564]=> - int(0) - [565]=> - int(0) - [566]=> - int(0) - [567]=> - int(0) - [568]=> - int(0) - [569]=> - int(0) - [570]=> - int(0) - [571]=> - int(0) - [572]=> - int(0) - [573]=> - int(0) - [574]=> - int(0) - [575]=> - int(0) - [576]=> - int(0) - [577]=> - int(0) - [578]=> - int(0) - [579]=> - int(0) - [580]=> - int(0) - [581]=> - int(0) - [582]=> - int(0) - [583]=> - int(0) - [584]=> - int(0) - [585]=> - int(0) - [586]=> - int(0) - [587]=> - int(0) - [588]=> - int(0) - [589]=> - int(0) - [590]=> - int(0) - [591]=> - int(0) - [592]=> - int(0) - [593]=> - int(0) - [594]=> - int(0) - [595]=> - int(0) - [596]=> - int(0) - [597]=> - int(0) - [598]=> - int(0) - [599]=> - int(0) - [600]=> - int(0) - [601]=> - int(0) - [602]=> - int(0) - [603]=> - int(0) - [604]=> - int(0) - [605]=> - int(0) - [606]=> - int(0) - [607]=> - int(0) - [608]=> - int(0) - [609]=> - int(0) - [610]=> - int(0) - [611]=> - int(0) - [612]=> - int(0) - [613]=> - int(0) - [614]=> - int(0) - [615]=> - int(0) - [616]=> - int(0) - [617]=> - int(0) - [618]=> - int(0) - [619]=> - int(0) - [620]=> - int(0) - [621]=> - int(0) - [622]=> - int(0) - [623]=> - int(0) - [624]=> - int(0) - [625]=> - int(0) - [626]=> - int(0) - [627]=> - int(0) - [628]=> - int(0) - [629]=> - int(0) - [630]=> - int(0) - [631]=> - int(0) - [632]=> - int(0) - [633]=> - int(0) - [634]=> - int(0) - [635]=> - int(0) - [636]=> - int(0) - [637]=> - int(0) - [638]=> - int(0) - [639]=> - int(0) - [640]=> - int(0) - [641]=> - int(0) - [642]=> - int(0) - [643]=> - int(0) - [644]=> - int(0) - [645]=> - int(0) - [646]=> - int(0) - [647]=> - int(0) - [648]=> - int(0) - [649]=> - int(0) - [650]=> - int(0) - [651]=> - int(0) - [652]=> - int(0) - [653]=> - int(0) - [654]=> - int(0) - [655]=> - int(0) - [656]=> - int(0) - [657]=> - int(0) - [658]=> - int(0) - [659]=> - int(0) - [660]=> - int(0) - [661]=> - int(0) - [662]=> - int(0) - [663]=> - int(0) - [664]=> - int(0) - [665]=> - int(0) - [666]=> - int(0) - [667]=> - int(0) - [668]=> - int(0) - [669]=> - int(0) - [670]=> - int(0) - [671]=> - int(0) - [672]=> - int(0) - [673]=> - int(0) - [674]=> - int(0) - [675]=> - int(0) - [676]=> - int(0) - [677]=> - int(0) - [678]=> - int(0) - [679]=> - int(0) - [680]=> - int(0) - [681]=> - int(0) - [682]=> - int(0) - [683]=> - int(0) - [684]=> - int(0) - [685]=> - int(0) - [686]=> - int(0) - [687]=> - int(0) - [688]=> - int(0) - [689]=> - int(0) - [690]=> - int(0) - [691]=> - int(0) - [692]=> - int(0) - [693]=> - int(0) - [694]=> - int(0) - [695]=> - int(0) - [696]=> - int(0) - [697]=> - int(0) - [698]=> - int(0) - [699]=> - int(0) - [700]=> - int(0) - [701]=> - int(0) - [702]=> - int(0) - [703]=> - int(0) - [704]=> - int(0) - [705]=> - int(0) - [706]=> - int(0) - [707]=> - int(0) - [708]=> - int(0) - [709]=> - int(0) - [710]=> - int(0) - [711]=> - int(0) - [712]=> - int(0) - [713]=> - int(0) - [714]=> - int(0) - [715]=> - int(0) - [716]=> - int(0) - [717]=> - int(0) - [718]=> - int(0) - [719]=> - int(0) - [720]=> - int(0) - [721]=> - int(0) - [722]=> - int(0) - [723]=> - int(0) - [724]=> - int(0) - [725]=> - int(0) - [726]=> - int(0) - [727]=> - int(0) - [728]=> - int(0) - [729]=> - int(0) - [730]=> - int(0) - [731]=> - int(0) - [732]=> - int(0) - [733]=> - int(0) - [734]=> - int(0) - [735]=> - int(0) - [736]=> - int(0) - [737]=> - int(0) - [738]=> - int(0) - [739]=> - int(0) - [740]=> - int(0) - [741]=> - int(0) - [742]=> - int(0) - [743]=> - int(0) - [744]=> - int(0) - [745]=> - int(0) - [746]=> - int(0) - [747]=> - int(0) - [748]=> - int(0) - [749]=> - int(0) - [750]=> - int(0) - [751]=> - int(0) - [752]=> - int(0) - [753]=> - int(0) - [754]=> - int(0) - [755]=> - int(0) - [756]=> - int(0) - [757]=> - int(0) - [758]=> - int(0) - [759]=> - int(0) - [760]=> - int(0) - [761]=> - int(0) - [762]=> - int(0) - [763]=> - int(0) - [764]=> - int(0) - [765]=> - int(0) - [766]=> - int(0) - [767]=> - int(0) - } - ["Copyright"]=> - string(12) "Eric Stewart" - ["GPSVersion"]=> - string(4) "" - ["GPSLatitudeRef"]=> - string(1) "N" - ["GPSLatitude"]=> - array(3) { - [0]=> - string(4) "33/1" - [1]=> - string(4) "37/1" - [2]=> - string(3) "0/1" - } - ["GPSLongitudeRef"]=> - string(1) "W" - ["GPSLongitude"]=> - array(3) { - [0]=> - string(4) "84/1" - [1]=> - string(3) "7/1" - [2]=> - string(3) "0/1" - } - ["GPSAltitudeRef"]=> - string(1) "" - ["GPSAltitude"]=> - string(5) "295/1" - ["GPSTimeStamp"]=> - array(3) { - [0]=> - string(3) "1/1" - [1]=> - string(4) "47/1" - [2]=> - string(4) "53/1" - } -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif022.phpt b/ext/exif/tests/exif022.phpt deleted file mode 100644 index f523d88bc1800..0000000000000 --- a/ext/exif/tests/exif022.phpt +++ /dev/null @@ -1,1683 +0,0 @@ ---TEST-- -Check for exif_read_data, TIFF with IFD, EXIF and GPS data in Intel byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(45) { - ["FileName"]=> - string(13) "image022.tiff" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(7) - ["MimeType"]=> - string(10) "image/tiff" - ["SectionsFound"]=> - string(24) "ANY_TAG, IFD0, EXIF, GPS" - ["COMPUTED"]=> - array(9) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - ["ApertureFNumber"]=> - string(5) "f/8.0" - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageWidth"]=> - int(1) - ["ImageLength"]=> - int(1) - ["BitsPerSample"]=> - int(8) - ["Compression"]=> - int(5) - ["PhotometricInterpretation"]=> - int(3) - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["StripOffsets"]=> - int(2278) - ["SamplesPerPixel"]=> - int(1) - ["RowsPerStrip"]=> - int(8) - ["StripByteCounts"]=> - int(4) - ["XResolution"]=> - string(17) "381681664/2097152" - ["YResolution"]=> - string(17) "381681664/2097152" - ["PlanarConfiguration"]=> - int(1) - ["ResolutionUnit"]=> - int(2) - ["Artist"]=> - string(12) "Eric Stewart" - ["ColorMap"]=> - array(768) { - [0]=> - int(0) - [1]=> - int(65280) - [2]=> - int(32512) - [3]=> - int(49152) - [4]=> - int(99) - [5]=> - int(115) - [6]=> - int(116) - [7]=> - int(101) - [8]=> - int(119) - [9]=> - int(97) - [10]=> - int(114) - [11]=> - int(116) - [12]=> - int(0) - [13]=> - int(0) - [14]=> - int(0) - [15]=> - int(0) - [16]=> - int(0) - [17]=> - int(0) - [18]=> - int(0) - [19]=> - int(0) - [20]=> - int(0) - [21]=> - int(0) - [22]=> - int(0) - [23]=> - int(0) - [24]=> - int(0) - [25]=> - int(0) - [26]=> - int(0) - [27]=> - int(0) - [28]=> - int(0) - [29]=> - int(0) - [30]=> - int(0) - [31]=> - int(0) - [32]=> - int(0) - [33]=> - int(0) - [34]=> - int(0) - [35]=> - int(0) - [36]=> - int(0) - [37]=> - int(0) - [38]=> - int(0) - [39]=> - int(0) - [40]=> - int(0) - [41]=> - int(0) - [42]=> - int(0) - [43]=> - int(0) - [44]=> - int(0) - [45]=> - int(0) - [46]=> - int(0) - [47]=> - int(0) - [48]=> - int(0) - [49]=> - int(0) - [50]=> - int(0) - [51]=> - int(0) - [52]=> - int(0) - [53]=> - int(0) - [54]=> - int(0) - [55]=> - int(0) - [56]=> - int(0) - [57]=> - int(0) - [58]=> - int(0) - [59]=> - int(0) - [60]=> - int(0) - [61]=> - int(0) - [62]=> - int(0) - [63]=> - int(0) - [64]=> - int(0) - [65]=> - int(0) - [66]=> - int(0) - [67]=> - int(0) - [68]=> - int(0) - [69]=> - int(0) - [70]=> - int(0) - [71]=> - int(0) - [72]=> - int(0) - [73]=> - int(0) - [74]=> - int(0) - [75]=> - int(0) - [76]=> - int(0) - [77]=> - int(0) - [78]=> - int(0) - [79]=> - int(0) - [80]=> - int(0) - [81]=> - int(0) - [82]=> - int(0) - [83]=> - int(0) - [84]=> - int(0) - [85]=> - int(0) - [86]=> - int(0) - [87]=> - int(0) - [88]=> - int(0) - [89]=> - int(0) - [90]=> - int(0) - [91]=> - int(0) - [92]=> - int(0) - [93]=> - int(0) - [94]=> - int(0) - [95]=> - int(0) - [96]=> - int(0) - [97]=> - int(0) - [98]=> - int(0) - [99]=> - int(0) - [100]=> - int(0) - [101]=> - int(0) - [102]=> - int(0) - [103]=> - int(0) - [104]=> - int(0) - [105]=> - int(0) - [106]=> - int(0) - [107]=> - int(0) - [108]=> - int(0) - [109]=> - int(0) - [110]=> - int(0) - [111]=> - int(0) - [112]=> - int(0) - [113]=> - int(0) - [114]=> - int(0) - [115]=> - int(0) - [116]=> - int(0) - [117]=> - int(0) - [118]=> - int(0) - [119]=> - int(0) - [120]=> - int(0) - [121]=> - int(0) - [122]=> - int(0) - [123]=> - int(0) - [124]=> - int(0) - [125]=> - int(0) - [126]=> - int(0) - [127]=> - int(0) - [128]=> - int(0) - [129]=> - int(0) - [130]=> - int(0) - [131]=> - int(0) - [132]=> - int(0) - [133]=> - int(0) - [134]=> - int(0) - [135]=> - int(0) - [136]=> - int(0) - [137]=> - int(0) - [138]=> - int(0) - [139]=> - int(0) - [140]=> - int(0) - [141]=> - int(0) - [142]=> - int(0) - [143]=> - int(0) - [144]=> - int(0) - [145]=> - int(0) - [146]=> - int(0) - [147]=> - int(0) - [148]=> - int(0) - [149]=> - int(0) - [150]=> - int(0) - [151]=> - int(0) - [152]=> - int(0) - [153]=> - int(0) - [154]=> - int(0) - [155]=> - int(0) - [156]=> - int(0) - [157]=> - int(0) - [158]=> - int(0) - [159]=> - int(0) - [160]=> - int(0) - [161]=> - int(0) - [162]=> - int(0) - [163]=> - int(0) - [164]=> - int(0) - [165]=> - int(0) - [166]=> - int(0) - [167]=> - int(0) - [168]=> - int(0) - [169]=> - int(0) - [170]=> - int(0) - [171]=> - int(0) - [172]=> - int(0) - [173]=> - int(0) - [174]=> - int(0) - [175]=> - int(0) - [176]=> - int(0) - [177]=> - int(0) - [178]=> - int(0) - [179]=> - int(0) - [180]=> - int(0) - [181]=> - int(0) - [182]=> - int(0) - [183]=> - int(0) - [184]=> - int(0) - [185]=> - int(0) - [186]=> - int(0) - [187]=> - int(0) - [188]=> - int(0) - [189]=> - int(0) - [190]=> - int(0) - [191]=> - int(0) - [192]=> - int(0) - [193]=> - int(0) - [194]=> - int(0) - [195]=> - int(0) - [196]=> - int(0) - [197]=> - int(0) - [198]=> - int(0) - [199]=> - int(0) - [200]=> - int(0) - [201]=> - int(0) - [202]=> - int(0) - [203]=> - int(0) - [204]=> - int(0) - [205]=> - int(0) - [206]=> - int(0) - [207]=> - int(0) - [208]=> - int(0) - [209]=> - int(0) - [210]=> - int(0) - [211]=> - int(0) - [212]=> - int(0) - [213]=> - int(0) - [214]=> - int(0) - [215]=> - int(0) - [216]=> - int(0) - [217]=> - int(0) - [218]=> - int(0) - [219]=> - int(0) - [220]=> - int(0) - [221]=> - int(0) - [222]=> - int(0) - [223]=> - int(0) - [224]=> - int(0) - [225]=> - int(0) - [226]=> - int(0) - [227]=> - int(0) - [228]=> - int(0) - [229]=> - int(0) - [230]=> - int(0) - [231]=> - int(0) - [232]=> - int(0) - [233]=> - int(0) - [234]=> - int(0) - [235]=> - int(0) - [236]=> - int(0) - [237]=> - int(0) - [238]=> - int(0) - [239]=> - int(0) - [240]=> - int(0) - [241]=> - int(0) - [242]=> - int(0) - [243]=> - int(0) - [244]=> - int(0) - [245]=> - int(0) - [246]=> - int(0) - [247]=> - int(0) - [248]=> - int(0) - [249]=> - int(0) - [250]=> - int(0) - [251]=> - int(0) - [252]=> - int(0) - [253]=> - int(0) - [254]=> - int(0) - [255]=> - int(1) - [256]=> - int(0) - [257]=> - int(65280) - [258]=> - int(32512) - [259]=> - int(49152) - [260]=> - int(0) - [261]=> - int(0) - [262]=> - int(0) - [263]=> - int(0) - [264]=> - int(0) - [265]=> - int(0) - [266]=> - int(0) - [267]=> - int(0) - [268]=> - int(0) - [269]=> - int(0) - [270]=> - int(0) - [271]=> - int(0) - [272]=> - int(11945) - [273]=> - int(1914) - [274]=> - int(0) - [275]=> - int(24609) - [276]=> - int(1088) - [277]=> - int(960) - [278]=> - int(0) - [279]=> - int(0) - [280]=> - int(20000) - [281]=> - int(8414) - [282]=> - int(65436) - [283]=> - int(0) - [284]=> - int(47655) - [285]=> - int(8) - [286]=> - int(37936) - [287]=> - int(8406) - [288]=> - int(0) - [289]=> - int(0) - [290]=> - int(0) - [291]=> - int(0) - [292]=> - int(0) - [293]=> - int(0) - [294]=> - int(0) - [295]=> - int(0) - [296]=> - int(0) - [297]=> - int(64652) - [298]=> - int(50264) - [299]=> - int(0) - [300]=> - int(0) - [301]=> - int(64887) - [302]=> - int(50264) - [303]=> - int(0) - [304]=> - int(25714) - [305]=> - int(26220) - [306]=> - int(17235) - [307]=> - int(19777) - [308]=> - int(65535) - [309]=> - int(65535) - [310]=> - int(65535) - [311]=> - int(65535) - [312]=> - int(65535) - [313]=> - int(65535) - [314]=> - int(65535) - [315]=> - int(65535) - [316]=> - int(501) - [317]=> - int(0) - [318]=> - int(20) - [319]=> - int(0) - [320]=> - int(0) - [321]=> - int(0) - [322]=> - int(16877) - [323]=> - int(0) - [324]=> - int(3) - [325]=> - int(0) - [326]=> - int(0) - [327]=> - int(0) - [328]=> - int(0) - [329]=> - int(0) - [330]=> - int(0) - [331]=> - int(0) - [332]=> - int(65535) - [333]=> - int(65535) - [334]=> - int(65535) - [335]=> - int(65535) - [336]=> - int(65535) - [337]=> - int(65535) - [338]=> - int(65535) - [339]=> - int(65535) - [340]=> - int(0) - [341]=> - int(0) - [342]=> - int(52840) - [343]=> - int(2025) - [344]=> - int(16) - [345]=> - int(57377) - [346]=> - int(1024) - [347]=> - int(960) - [348]=> - int(0) - [349]=> - int(0) - [350]=> - int(27136) - [351]=> - int(8414) - [352]=> - int(65436) - [353]=> - int(0) - [354]=> - int(47655) - [355]=> - int(8) - [356]=> - int(62400) - [357]=> - int(8407) - [358]=> - int(0) - [359]=> - int(0) - [360]=> - int(0) - [361]=> - int(0) - [362]=> - int(0) - [363]=> - int(0) - [364]=> - int(0) - [365]=> - int(0) - [366]=> - int(0) - [367]=> - int(64857) - [368]=> - int(50264) - [369]=> - int(0) - [370]=> - int(0) - [371]=> - int(64892) - [372]=> - int(50264) - [373]=> - int(0) - [374]=> - int(25714) - [375]=> - int(26220) - [376]=> - int(17235) - [377]=> - int(19777) - [378]=> - int(65535) - [379]=> - int(65535) - [380]=> - int(65535) - [381]=> - int(65535) - [382]=> - int(65535) - [383]=> - int(65535) - [384]=> - int(65535) - [385]=> - int(65535) - [386]=> - int(501) - [387]=> - int(0) - [388]=> - int(20) - [389]=> - int(0) - [390]=> - int(0) - [391]=> - int(0) - [392]=> - int(16877) - [393]=> - int(0) - [394]=> - int(3) - [395]=> - int(0) - [396]=> - int(0) - [397]=> - int(0) - [398]=> - int(0) - [399]=> - int(0) - [400]=> - int(0) - [401]=> - int(0) - [402]=> - int(65535) - [403]=> - int(65535) - [404]=> - int(65535) - [405]=> - int(65535) - [406]=> - int(65535) - [407]=> - int(65535) - [408]=> - int(65535) - [409]=> - int(65535) - [410]=> - int(0) - [411]=> - int(0) - [412]=> - int(53440) - [413]=> - int(2025) - [414]=> - int(16) - [415]=> - int(57377) - [416]=> - int(1024) - [417]=> - int(960) - [418]=> - int(0) - [419]=> - int(0) - [420]=> - int(41120) - [421]=> - int(9024) - [422]=> - int(65436) - [423]=> - int(0) - [424]=> - int(47655) - [425]=> - int(8) - [426]=> - int(24480) - [427]=> - int(8404) - [428]=> - int(0) - [429]=> - int(0) - [430]=> - int(0) - [431]=> - int(0) - [432]=> - int(0) - [433]=> - int(0) - [434]=> - int(0) - [435]=> - int(0) - [436]=> - int(0) - [437]=> - int(21315) - [438]=> - int(50294) - [439]=> - int(0) - [440]=> - int(0) - [441]=> - int(53635) - [442]=> - int(50294) - [443]=> - int(0) - [444]=> - int(25714) - [445]=> - int(26220) - [446]=> - int(17235) - [447]=> - int(19777) - [448]=> - int(65535) - [449]=> - int(65535) - [450]=> - int(65535) - [451]=> - int(65535) - [452]=> - int(65535) - [453]=> - int(65535) - [454]=> - int(65535) - [455]=> - int(65535) - [456]=> - int(501) - [457]=> - int(0) - [458]=> - int(20) - [459]=> - int(0) - [460]=> - int(0) - [461]=> - int(0) - [462]=> - int(16877) - [463]=> - int(0) - [464]=> - int(3) - [465]=> - int(0) - [466]=> - int(0) - [467]=> - int(0) - [468]=> - int(0) - [469]=> - int(0) - [470]=> - int(0) - [471]=> - int(0) - [472]=> - int(65535) - [473]=> - int(65535) - [474]=> - int(65535) - [475]=> - int(65535) - [476]=> - int(65535) - [477]=> - int(65535) - [478]=> - int(65535) - [479]=> - int(65535) - [480]=> - int(0) - [481]=> - int(0) - [482]=> - int(54028) - [483]=> - int(2772) - [484]=> - int(16) - [485]=> - int(57377) - [486]=> - int(1024) - [487]=> - int(960) - [488]=> - int(0) - [489]=> - int(0) - [490]=> - int(42384) - [491]=> - int(8408) - [492]=> - int(65436) - [493]=> - int(0) - [494]=> - int(47655) - [495]=> - int(8) - [496]=> - int(1136) - [497]=> - int(8348) - [498]=> - int(0) - [499]=> - int(0) - [500]=> - int(0) - [501]=> - int(0) - [502]=> - int(0) - [503]=> - int(0) - [504]=> - int(0) - [505]=> - int(0) - [506]=> - int(0) - [507]=> - int(12326) - [508]=> - int(50261) - [509]=> - int(0) - [510]=> - int(0) - [511]=> - int(12326) - [512]=> - int(0) - [513]=> - int(65280) - [514]=> - int(32512) - [515]=> - int(49152) - [516]=> - int(0) - [517]=> - int(0) - [518]=> - int(22663) - [519]=> - int(2) - [520]=> - int(0) - [521]=> - int(0) - [522]=> - int(24576) - [523]=> - int(2) - [524]=> - int(0) - [525]=> - int(0) - [526]=> - int(501) - [527]=> - int(0) - [528]=> - int(20) - [529]=> - int(0) - [530]=> - int(0) - [531]=> - int(0) - [532]=> - int(33188) - [533]=> - int(0) - [534]=> - int(0) - [535]=> - int(0) - [536]=> - int(0) - [537]=> - int(0) - [538]=> - int(0) - [539]=> - int(0) - [540]=> - int(0) - [541]=> - int(0) - [542]=> - int(0) - [543]=> - int(0) - [544]=> - int(0) - [545]=> - int(0) - [546]=> - int(0) - [547]=> - int(0) - [548]=> - int(0) - [549]=> - int(0) - [550]=> - int(0) - [551]=> - int(0) - [552]=> - int(51766) - [553]=> - int(1946) - [554]=> - int(0) - [555]=> - int(24609) - [556]=> - int(1088) - [557]=> - int(960) - [558]=> - int(0) - [559]=> - int(0) - [560]=> - int(0) - [561]=> - int(0) - [562]=> - int(25116) - [563]=> - int(2012) - [564]=> - int(0) - [565]=> - int(0) - [566]=> - int(0) - [567]=> - int(0) - [568]=> - int(0) - [569]=> - int(0) - [570]=> - int(0) - [571]=> - int(0) - [572]=> - int(0) - [573]=> - int(0) - [574]=> - int(0) - [575]=> - int(0) - [576]=> - int(0) - [577]=> - int(0) - [578]=> - int(0) - [579]=> - int(0) - [580]=> - int(0) - [581]=> - int(0) - [582]=> - int(0) - [583]=> - int(0) - [584]=> - int(0) - [585]=> - int(0) - [586]=> - int(0) - [587]=> - int(0) - [588]=> - int(0) - [589]=> - int(0) - [590]=> - int(0) - [591]=> - int(0) - [592]=> - int(0) - [593]=> - int(0) - [594]=> - int(0) - [595]=> - int(0) - [596]=> - int(0) - [597]=> - int(0) - [598]=> - int(0) - [599]=> - int(0) - [600]=> - int(0) - [601]=> - int(0) - [602]=> - int(0) - [603]=> - int(0) - [604]=> - int(0) - [605]=> - int(0) - [606]=> - int(0) - [607]=> - int(0) - [608]=> - int(0) - [609]=> - int(0) - [610]=> - int(0) - [611]=> - int(0) - [612]=> - int(0) - [613]=> - int(0) - [614]=> - int(0) - [615]=> - int(0) - [616]=> - int(0) - [617]=> - int(0) - [618]=> - int(0) - [619]=> - int(0) - [620]=> - int(0) - [621]=> - int(0) - [622]=> - int(0) - [623]=> - int(0) - [624]=> - int(0) - [625]=> - int(0) - [626]=> - int(0) - [627]=> - int(0) - [628]=> - int(0) - [629]=> - int(0) - [630]=> - int(0) - [631]=> - int(0) - [632]=> - int(0) - [633]=> - int(0) - [634]=> - int(0) - [635]=> - int(0) - [636]=> - int(0) - [637]=> - int(0) - [638]=> - int(0) - [639]=> - int(0) - [640]=> - int(0) - [641]=> - int(0) - [642]=> - int(0) - [643]=> - int(0) - [644]=> - int(0) - [645]=> - int(0) - [646]=> - int(0) - [647]=> - int(0) - [648]=> - int(0) - [649]=> - int(0) - [650]=> - int(0) - [651]=> - int(0) - [652]=> - int(0) - [653]=> - int(0) - [654]=> - int(0) - [655]=> - int(0) - [656]=> - int(0) - [657]=> - int(0) - [658]=> - int(0) - [659]=> - int(0) - [660]=> - int(0) - [661]=> - int(0) - [662]=> - int(0) - [663]=> - int(0) - [664]=> - int(0) - [665]=> - int(0) - [666]=> - int(0) - [667]=> - int(0) - [668]=> - int(0) - [669]=> - int(0) - [670]=> - int(0) - [671]=> - int(0) - [672]=> - int(0) - [673]=> - int(0) - [674]=> - int(0) - [675]=> - int(0) - [676]=> - int(0) - [677]=> - int(0) - [678]=> - int(0) - [679]=> - int(0) - [680]=> - int(0) - [681]=> - int(0) - [682]=> - int(0) - [683]=> - int(0) - [684]=> - int(0) - [685]=> - int(0) - [686]=> - int(0) - [687]=> - int(0) - [688]=> - int(0) - [689]=> - int(0) - [690]=> - int(0) - [691]=> - int(0) - [692]=> - int(0) - [693]=> - int(0) - [694]=> - int(0) - [695]=> - int(0) - [696]=> - int(0) - [697]=> - int(0) - [698]=> - int(0) - [699]=> - int(0) - [700]=> - int(0) - [701]=> - int(0) - [702]=> - int(0) - [703]=> - int(0) - [704]=> - int(0) - [705]=> - int(0) - [706]=> - int(0) - [707]=> - int(0) - [708]=> - int(0) - [709]=> - int(0) - [710]=> - int(0) - [711]=> - int(0) - [712]=> - int(0) - [713]=> - int(0) - [714]=> - int(0) - [715]=> - int(0) - [716]=> - int(0) - [717]=> - int(0) - [718]=> - int(0) - [719]=> - int(0) - [720]=> - int(0) - [721]=> - int(0) - [722]=> - int(0) - [723]=> - int(0) - [724]=> - int(0) - [725]=> - int(0) - [726]=> - int(0) - [727]=> - int(0) - [728]=> - int(0) - [729]=> - int(0) - [730]=> - int(0) - [731]=> - int(0) - [732]=> - int(0) - [733]=> - int(0) - [734]=> - int(0) - [735]=> - int(0) - [736]=> - int(0) - [737]=> - int(0) - [738]=> - int(0) - [739]=> - int(0) - [740]=> - int(0) - [741]=> - int(0) - [742]=> - int(0) - [743]=> - int(0) - [744]=> - int(0) - [745]=> - int(0) - [746]=> - int(0) - [747]=> - int(0) - [748]=> - int(0) - [749]=> - int(0) - [750]=> - int(0) - [751]=> - int(0) - [752]=> - int(0) - [753]=> - int(0) - [754]=> - int(0) - [755]=> - int(0) - [756]=> - int(0) - [757]=> - int(0) - [758]=> - int(0) - [759]=> - int(0) - [760]=> - int(0) - [761]=> - int(0) - [762]=> - int(0) - [763]=> - int(0) - [764]=> - int(0) - [765]=> - int(0) - [766]=> - int(0) - [767]=> - int(0) - } - ["Copyright"]=> - string(12) "Eric Stewart" - ["ExposureTime"]=> - string(5) "1/125" - ["FNumber"]=> - string(3) "8/1" - ["ISOSpeedRatings"]=> - int(80) - ["DateTimeOriginal"]=> - string(19) "2008:06:19 01:47:53" - ["DateTimeDigitized"]=> - string(19) "2008:06:19 01:47:53" - ["MeteringMode"]=> - int(5) - ["LightSource"]=> - int(4) - ["Flash"]=> - int(7) - ["FocalLength"]=> - string(4) "29/5" - ["ExifImageWidth"]=> - int(1) - ["ExifImageLength"]=> - int(1) - ["GPSVersion"]=> - string(4) "" - ["GPSLatitudeRef"]=> - string(1) "N" - ["GPSLatitude"]=> - array(3) { - [0]=> - string(4) "33/1" - [1]=> - string(4) "37/1" - [2]=> - string(3) "0/1" - } - ["GPSLongitudeRef"]=> - string(1) "W" - ["GPSLongitude"]=> - array(3) { - [0]=> - string(4) "84/1" - [1]=> - string(3) "7/1" - [2]=> - string(3) "0/1" - } - ["GPSAltitudeRef"]=> - string(1) "" - ["GPSAltitude"]=> - string(5) "295/1" - ["GPSTimeStamp"]=> - array(3) { - [0]=> - string(3) "1/1" - [1]=> - string(4) "47/1" - [2]=> - string(4) "53/1" - } -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif023.phpt b/ext/exif/tests/exif023.phpt deleted file mode 100644 index 5940d97144511..0000000000000 --- a/ext/exif/tests/exif023.phpt +++ /dev/null @@ -1,1683 +0,0 @@ ---TEST-- -Check for exif_read_data, TIFF with IFD, EXIF and GPS data in Motorola byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(45) { - ["FileName"]=> - string(13) "image023.tiff" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(8) - ["MimeType"]=> - string(10) "image/tiff" - ["SectionsFound"]=> - string(24) "ANY_TAG, IFD0, EXIF, GPS" - ["COMPUTED"]=> - array(9) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["ApertureFNumber"]=> - string(5) "f/8.0" - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageWidth"]=> - int(1) - ["ImageLength"]=> - int(1) - ["BitsPerSample"]=> - int(8) - ["Compression"]=> - int(5) - ["PhotometricInterpretation"]=> - int(3) - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["StripOffsets"]=> - int(2278) - ["SamplesPerPixel"]=> - int(1) - ["RowsPerStrip"]=> - int(8) - ["StripByteCounts"]=> - int(4) - ["XResolution"]=> - string(17) "381681664/2097152" - ["YResolution"]=> - string(17) "381681664/2097152" - ["PlanarConfiguration"]=> - int(1) - ["ResolutionUnit"]=> - int(2) - ["Artist"]=> - string(12) "Eric Stewart" - ["ColorMap"]=> - array(768) { - [0]=> - int(0) - [1]=> - int(65280) - [2]=> - int(32512) - [3]=> - int(49152) - [4]=> - int(99) - [5]=> - int(115) - [6]=> - int(116) - [7]=> - int(101) - [8]=> - int(119) - [9]=> - int(97) - [10]=> - int(114) - [11]=> - int(116) - [12]=> - int(0) - [13]=> - int(0) - [14]=> - int(0) - [15]=> - int(0) - [16]=> - int(0) - [17]=> - int(0) - [18]=> - int(0) - [19]=> - int(0) - [20]=> - int(0) - [21]=> - int(0) - [22]=> - int(0) - [23]=> - int(0) - [24]=> - int(0) - [25]=> - int(0) - [26]=> - int(0) - [27]=> - int(0) - [28]=> - int(0) - [29]=> - int(0) - [30]=> - int(0) - [31]=> - int(0) - [32]=> - int(0) - [33]=> - int(0) - [34]=> - int(0) - [35]=> - int(0) - [36]=> - int(0) - [37]=> - int(0) - [38]=> - int(0) - [39]=> - int(0) - [40]=> - int(0) - [41]=> - int(0) - [42]=> - int(0) - [43]=> - int(0) - [44]=> - int(0) - [45]=> - int(0) - [46]=> - int(0) - [47]=> - int(0) - [48]=> - int(0) - [49]=> - int(0) - [50]=> - int(0) - [51]=> - int(0) - [52]=> - int(0) - [53]=> - int(0) - [54]=> - int(0) - [55]=> - int(0) - [56]=> - int(0) - [57]=> - int(0) - [58]=> - int(0) - [59]=> - int(0) - [60]=> - int(0) - [61]=> - int(0) - [62]=> - int(0) - [63]=> - int(0) - [64]=> - int(0) - [65]=> - int(0) - [66]=> - int(0) - [67]=> - int(0) - [68]=> - int(0) - [69]=> - int(0) - [70]=> - int(0) - [71]=> - int(0) - [72]=> - int(0) - [73]=> - int(0) - [74]=> - int(0) - [75]=> - int(0) - [76]=> - int(0) - [77]=> - int(0) - [78]=> - int(0) - [79]=> - int(0) - [80]=> - int(0) - [81]=> - int(0) - [82]=> - int(0) - [83]=> - int(0) - [84]=> - int(0) - [85]=> - int(0) - [86]=> - int(0) - [87]=> - int(0) - [88]=> - int(0) - [89]=> - int(0) - [90]=> - int(0) - [91]=> - int(0) - [92]=> - int(0) - [93]=> - int(0) - [94]=> - int(0) - [95]=> - int(0) - [96]=> - int(0) - [97]=> - int(0) - [98]=> - int(0) - [99]=> - int(0) - [100]=> - int(0) - [101]=> - int(0) - [102]=> - int(0) - [103]=> - int(0) - [104]=> - int(0) - [105]=> - int(0) - [106]=> - int(0) - [107]=> - int(0) - [108]=> - int(0) - [109]=> - int(0) - [110]=> - int(0) - [111]=> - int(0) - [112]=> - int(0) - [113]=> - int(0) - [114]=> - int(0) - [115]=> - int(0) - [116]=> - int(0) - [117]=> - int(0) - [118]=> - int(0) - [119]=> - int(0) - [120]=> - int(0) - [121]=> - int(0) - [122]=> - int(0) - [123]=> - int(0) - [124]=> - int(0) - [125]=> - int(0) - [126]=> - int(0) - [127]=> - int(0) - [128]=> - int(0) - [129]=> - int(0) - [130]=> - int(0) - [131]=> - int(0) - [132]=> - int(0) - [133]=> - int(0) - [134]=> - int(0) - [135]=> - int(0) - [136]=> - int(0) - [137]=> - int(0) - [138]=> - int(0) - [139]=> - int(0) - [140]=> - int(0) - [141]=> - int(0) - [142]=> - int(0) - [143]=> - int(0) - [144]=> - int(0) - [145]=> - int(0) - [146]=> - int(0) - [147]=> - int(0) - [148]=> - int(0) - [149]=> - int(0) - [150]=> - int(0) - [151]=> - int(0) - [152]=> - int(0) - [153]=> - int(0) - [154]=> - int(0) - [155]=> - int(0) - [156]=> - int(0) - [157]=> - int(0) - [158]=> - int(0) - [159]=> - int(0) - [160]=> - int(0) - [161]=> - int(0) - [162]=> - int(0) - [163]=> - int(0) - [164]=> - int(0) - [165]=> - int(0) - [166]=> - int(0) - [167]=> - int(0) - [168]=> - int(0) - [169]=> - int(0) - [170]=> - int(0) - [171]=> - int(0) - [172]=> - int(0) - [173]=> - int(0) - [174]=> - int(0) - [175]=> - int(0) - [176]=> - int(0) - [177]=> - int(0) - [178]=> - int(0) - [179]=> - int(0) - [180]=> - int(0) - [181]=> - int(0) - [182]=> - int(0) - [183]=> - int(0) - [184]=> - int(0) - [185]=> - int(0) - [186]=> - int(0) - [187]=> - int(0) - [188]=> - int(0) - [189]=> - int(0) - [190]=> - int(0) - [191]=> - int(0) - [192]=> - int(0) - [193]=> - int(0) - [194]=> - int(0) - [195]=> - int(0) - [196]=> - int(0) - [197]=> - int(0) - [198]=> - int(0) - [199]=> - int(0) - [200]=> - int(0) - [201]=> - int(0) - [202]=> - int(0) - [203]=> - int(0) - [204]=> - int(0) - [205]=> - int(0) - [206]=> - int(0) - [207]=> - int(0) - [208]=> - int(0) - [209]=> - int(0) - [210]=> - int(0) - [211]=> - int(0) - [212]=> - int(0) - [213]=> - int(0) - [214]=> - int(0) - [215]=> - int(0) - [216]=> - int(0) - [217]=> - int(0) - [218]=> - int(0) - [219]=> - int(0) - [220]=> - int(0) - [221]=> - int(0) - [222]=> - int(0) - [223]=> - int(0) - [224]=> - int(0) - [225]=> - int(0) - [226]=> - int(0) - [227]=> - int(0) - [228]=> - int(0) - [229]=> - int(0) - [230]=> - int(0) - [231]=> - int(0) - [232]=> - int(0) - [233]=> - int(0) - [234]=> - int(0) - [235]=> - int(0) - [236]=> - int(0) - [237]=> - int(0) - [238]=> - int(0) - [239]=> - int(0) - [240]=> - int(0) - [241]=> - int(0) - [242]=> - int(0) - [243]=> - int(0) - [244]=> - int(0) - [245]=> - int(0) - [246]=> - int(0) - [247]=> - int(0) - [248]=> - int(0) - [249]=> - int(0) - [250]=> - int(0) - [251]=> - int(0) - [252]=> - int(0) - [253]=> - int(0) - [254]=> - int(0) - [255]=> - int(1) - [256]=> - int(0) - [257]=> - int(65280) - [258]=> - int(32512) - [259]=> - int(49152) - [260]=> - int(0) - [261]=> - int(0) - [262]=> - int(0) - [263]=> - int(0) - [264]=> - int(0) - [265]=> - int(0) - [266]=> - int(0) - [267]=> - int(0) - [268]=> - int(0) - [269]=> - int(0) - [270]=> - int(0) - [271]=> - int(0) - [272]=> - int(11945) - [273]=> - int(1914) - [274]=> - int(0) - [275]=> - int(24609) - [276]=> - int(1088) - [277]=> - int(960) - [278]=> - int(0) - [279]=> - int(0) - [280]=> - int(20000) - [281]=> - int(8414) - [282]=> - int(65436) - [283]=> - int(0) - [284]=> - int(47655) - [285]=> - int(8) - [286]=> - int(37936) - [287]=> - int(8406) - [288]=> - int(0) - [289]=> - int(0) - [290]=> - int(0) - [291]=> - int(0) - [292]=> - int(0) - [293]=> - int(0) - [294]=> - int(0) - [295]=> - int(0) - [296]=> - int(0) - [297]=> - int(64652) - [298]=> - int(50264) - [299]=> - int(0) - [300]=> - int(0) - [301]=> - int(64887) - [302]=> - int(50264) - [303]=> - int(0) - [304]=> - int(25714) - [305]=> - int(26220) - [306]=> - int(17235) - [307]=> - int(19777) - [308]=> - int(65535) - [309]=> - int(65535) - [310]=> - int(65535) - [311]=> - int(65535) - [312]=> - int(65535) - [313]=> - int(65535) - [314]=> - int(65535) - [315]=> - int(65535) - [316]=> - int(501) - [317]=> - int(0) - [318]=> - int(20) - [319]=> - int(0) - [320]=> - int(0) - [321]=> - int(0) - [322]=> - int(16877) - [323]=> - int(0) - [324]=> - int(3) - [325]=> - int(0) - [326]=> - int(0) - [327]=> - int(0) - [328]=> - int(0) - [329]=> - int(0) - [330]=> - int(0) - [331]=> - int(0) - [332]=> - int(65535) - [333]=> - int(65535) - [334]=> - int(65535) - [335]=> - int(65535) - [336]=> - int(65535) - [337]=> - int(65535) - [338]=> - int(65535) - [339]=> - int(65535) - [340]=> - int(0) - [341]=> - int(0) - [342]=> - int(52840) - [343]=> - int(2025) - [344]=> - int(16) - [345]=> - int(57377) - [346]=> - int(1024) - [347]=> - int(960) - [348]=> - int(0) - [349]=> - int(0) - [350]=> - int(27136) - [351]=> - int(8414) - [352]=> - int(65436) - [353]=> - int(0) - [354]=> - int(47655) - [355]=> - int(8) - [356]=> - int(62400) - [357]=> - int(8407) - [358]=> - int(0) - [359]=> - int(0) - [360]=> - int(0) - [361]=> - int(0) - [362]=> - int(0) - [363]=> - int(0) - [364]=> - int(0) - [365]=> - int(0) - [366]=> - int(0) - [367]=> - int(64857) - [368]=> - int(50264) - [369]=> - int(0) - [370]=> - int(0) - [371]=> - int(64892) - [372]=> - int(50264) - [373]=> - int(0) - [374]=> - int(25714) - [375]=> - int(26220) - [376]=> - int(17235) - [377]=> - int(19777) - [378]=> - int(65535) - [379]=> - int(65535) - [380]=> - int(65535) - [381]=> - int(65535) - [382]=> - int(65535) - [383]=> - int(65535) - [384]=> - int(65535) - [385]=> - int(65535) - [386]=> - int(501) - [387]=> - int(0) - [388]=> - int(20) - [389]=> - int(0) - [390]=> - int(0) - [391]=> - int(0) - [392]=> - int(16877) - [393]=> - int(0) - [394]=> - int(3) - [395]=> - int(0) - [396]=> - int(0) - [397]=> - int(0) - [398]=> - int(0) - [399]=> - int(0) - [400]=> - int(0) - [401]=> - int(0) - [402]=> - int(65535) - [403]=> - int(65535) - [404]=> - int(65535) - [405]=> - int(65535) - [406]=> - int(65535) - [407]=> - int(65535) - [408]=> - int(65535) - [409]=> - int(65535) - [410]=> - int(0) - [411]=> - int(0) - [412]=> - int(53440) - [413]=> - int(2025) - [414]=> - int(16) - [415]=> - int(57377) - [416]=> - int(1024) - [417]=> - int(960) - [418]=> - int(0) - [419]=> - int(0) - [420]=> - int(41120) - [421]=> - int(9024) - [422]=> - int(65436) - [423]=> - int(0) - [424]=> - int(47655) - [425]=> - int(8) - [426]=> - int(24480) - [427]=> - int(8404) - [428]=> - int(0) - [429]=> - int(0) - [430]=> - int(0) - [431]=> - int(0) - [432]=> - int(0) - [433]=> - int(0) - [434]=> - int(0) - [435]=> - int(0) - [436]=> - int(0) - [437]=> - int(21315) - [438]=> - int(50294) - [439]=> - int(0) - [440]=> - int(0) - [441]=> - int(53635) - [442]=> - int(50294) - [443]=> - int(0) - [444]=> - int(25714) - [445]=> - int(26220) - [446]=> - int(17235) - [447]=> - int(19777) - [448]=> - int(65535) - [449]=> - int(65535) - [450]=> - int(65535) - [451]=> - int(65535) - [452]=> - int(65535) - [453]=> - int(65535) - [454]=> - int(65535) - [455]=> - int(65535) - [456]=> - int(501) - [457]=> - int(0) - [458]=> - int(20) - [459]=> - int(0) - [460]=> - int(0) - [461]=> - int(0) - [462]=> - int(16877) - [463]=> - int(0) - [464]=> - int(3) - [465]=> - int(0) - [466]=> - int(0) - [467]=> - int(0) - [468]=> - int(0) - [469]=> - int(0) - [470]=> - int(0) - [471]=> - int(0) - [472]=> - int(65535) - [473]=> - int(65535) - [474]=> - int(65535) - [475]=> - int(65535) - [476]=> - int(65535) - [477]=> - int(65535) - [478]=> - int(65535) - [479]=> - int(65535) - [480]=> - int(0) - [481]=> - int(0) - [482]=> - int(54028) - [483]=> - int(2772) - [484]=> - int(16) - [485]=> - int(57377) - [486]=> - int(1024) - [487]=> - int(960) - [488]=> - int(0) - [489]=> - int(0) - [490]=> - int(42384) - [491]=> - int(8408) - [492]=> - int(65436) - [493]=> - int(0) - [494]=> - int(47655) - [495]=> - int(8) - [496]=> - int(1136) - [497]=> - int(8348) - [498]=> - int(0) - [499]=> - int(0) - [500]=> - int(0) - [501]=> - int(0) - [502]=> - int(0) - [503]=> - int(0) - [504]=> - int(0) - [505]=> - int(0) - [506]=> - int(0) - [507]=> - int(12326) - [508]=> - int(50261) - [509]=> - int(0) - [510]=> - int(0) - [511]=> - int(12326) - [512]=> - int(0) - [513]=> - int(65280) - [514]=> - int(32512) - [515]=> - int(49152) - [516]=> - int(0) - [517]=> - int(0) - [518]=> - int(22663) - [519]=> - int(2) - [520]=> - int(0) - [521]=> - int(0) - [522]=> - int(24576) - [523]=> - int(2) - [524]=> - int(0) - [525]=> - int(0) - [526]=> - int(501) - [527]=> - int(0) - [528]=> - int(20) - [529]=> - int(0) - [530]=> - int(0) - [531]=> - int(0) - [532]=> - int(33188) - [533]=> - int(0) - [534]=> - int(0) - [535]=> - int(0) - [536]=> - int(0) - [537]=> - int(0) - [538]=> - int(0) - [539]=> - int(0) - [540]=> - int(0) - [541]=> - int(0) - [542]=> - int(0) - [543]=> - int(0) - [544]=> - int(0) - [545]=> - int(0) - [546]=> - int(0) - [547]=> - int(0) - [548]=> - int(0) - [549]=> - int(0) - [550]=> - int(0) - [551]=> - int(0) - [552]=> - int(51766) - [553]=> - int(1946) - [554]=> - int(0) - [555]=> - int(24609) - [556]=> - int(1088) - [557]=> - int(960) - [558]=> - int(0) - [559]=> - int(0) - [560]=> - int(0) - [561]=> - int(0) - [562]=> - int(25116) - [563]=> - int(2012) - [564]=> - int(0) - [565]=> - int(0) - [566]=> - int(0) - [567]=> - int(0) - [568]=> - int(0) - [569]=> - int(0) - [570]=> - int(0) - [571]=> - int(0) - [572]=> - int(0) - [573]=> - int(0) - [574]=> - int(0) - [575]=> - int(0) - [576]=> - int(0) - [577]=> - int(0) - [578]=> - int(0) - [579]=> - int(0) - [580]=> - int(0) - [581]=> - int(0) - [582]=> - int(0) - [583]=> - int(0) - [584]=> - int(0) - [585]=> - int(0) - [586]=> - int(0) - [587]=> - int(0) - [588]=> - int(0) - [589]=> - int(0) - [590]=> - int(0) - [591]=> - int(0) - [592]=> - int(0) - [593]=> - int(0) - [594]=> - int(0) - [595]=> - int(0) - [596]=> - int(0) - [597]=> - int(0) - [598]=> - int(0) - [599]=> - int(0) - [600]=> - int(0) - [601]=> - int(0) - [602]=> - int(0) - [603]=> - int(0) - [604]=> - int(0) - [605]=> - int(0) - [606]=> - int(0) - [607]=> - int(0) - [608]=> - int(0) - [609]=> - int(0) - [610]=> - int(0) - [611]=> - int(0) - [612]=> - int(0) - [613]=> - int(0) - [614]=> - int(0) - [615]=> - int(0) - [616]=> - int(0) - [617]=> - int(0) - [618]=> - int(0) - [619]=> - int(0) - [620]=> - int(0) - [621]=> - int(0) - [622]=> - int(0) - [623]=> - int(0) - [624]=> - int(0) - [625]=> - int(0) - [626]=> - int(0) - [627]=> - int(0) - [628]=> - int(0) - [629]=> - int(0) - [630]=> - int(0) - [631]=> - int(0) - [632]=> - int(0) - [633]=> - int(0) - [634]=> - int(0) - [635]=> - int(0) - [636]=> - int(0) - [637]=> - int(0) - [638]=> - int(0) - [639]=> - int(0) - [640]=> - int(0) - [641]=> - int(0) - [642]=> - int(0) - [643]=> - int(0) - [644]=> - int(0) - [645]=> - int(0) - [646]=> - int(0) - [647]=> - int(0) - [648]=> - int(0) - [649]=> - int(0) - [650]=> - int(0) - [651]=> - int(0) - [652]=> - int(0) - [653]=> - int(0) - [654]=> - int(0) - [655]=> - int(0) - [656]=> - int(0) - [657]=> - int(0) - [658]=> - int(0) - [659]=> - int(0) - [660]=> - int(0) - [661]=> - int(0) - [662]=> - int(0) - [663]=> - int(0) - [664]=> - int(0) - [665]=> - int(0) - [666]=> - int(0) - [667]=> - int(0) - [668]=> - int(0) - [669]=> - int(0) - [670]=> - int(0) - [671]=> - int(0) - [672]=> - int(0) - [673]=> - int(0) - [674]=> - int(0) - [675]=> - int(0) - [676]=> - int(0) - [677]=> - int(0) - [678]=> - int(0) - [679]=> - int(0) - [680]=> - int(0) - [681]=> - int(0) - [682]=> - int(0) - [683]=> - int(0) - [684]=> - int(0) - [685]=> - int(0) - [686]=> - int(0) - [687]=> - int(0) - [688]=> - int(0) - [689]=> - int(0) - [690]=> - int(0) - [691]=> - int(0) - [692]=> - int(0) - [693]=> - int(0) - [694]=> - int(0) - [695]=> - int(0) - [696]=> - int(0) - [697]=> - int(0) - [698]=> - int(0) - [699]=> - int(0) - [700]=> - int(0) - [701]=> - int(0) - [702]=> - int(0) - [703]=> - int(0) - [704]=> - int(0) - [705]=> - int(0) - [706]=> - int(0) - [707]=> - int(0) - [708]=> - int(0) - [709]=> - int(0) - [710]=> - int(0) - [711]=> - int(0) - [712]=> - int(0) - [713]=> - int(0) - [714]=> - int(0) - [715]=> - int(0) - [716]=> - int(0) - [717]=> - int(0) - [718]=> - int(0) - [719]=> - int(0) - [720]=> - int(0) - [721]=> - int(0) - [722]=> - int(0) - [723]=> - int(0) - [724]=> - int(0) - [725]=> - int(0) - [726]=> - int(0) - [727]=> - int(0) - [728]=> - int(0) - [729]=> - int(0) - [730]=> - int(0) - [731]=> - int(0) - [732]=> - int(0) - [733]=> - int(0) - [734]=> - int(0) - [735]=> - int(0) - [736]=> - int(0) - [737]=> - int(0) - [738]=> - int(0) - [739]=> - int(0) - [740]=> - int(0) - [741]=> - int(0) - [742]=> - int(0) - [743]=> - int(0) - [744]=> - int(0) - [745]=> - int(0) - [746]=> - int(0) - [747]=> - int(0) - [748]=> - int(0) - [749]=> - int(0) - [750]=> - int(0) - [751]=> - int(0) - [752]=> - int(0) - [753]=> - int(0) - [754]=> - int(0) - [755]=> - int(0) - [756]=> - int(0) - [757]=> - int(0) - [758]=> - int(0) - [759]=> - int(0) - [760]=> - int(0) - [761]=> - int(0) - [762]=> - int(0) - [763]=> - int(0) - [764]=> - int(0) - [765]=> - int(0) - [766]=> - int(0) - [767]=> - int(0) - } - ["Copyright"]=> - string(12) "Eric Stewart" - ["ExposureTime"]=> - string(5) "1/125" - ["FNumber"]=> - string(3) "8/1" - ["ISOSpeedRatings"]=> - int(80) - ["DateTimeOriginal"]=> - string(19) "2008:06:19 01:47:53" - ["DateTimeDigitized"]=> - string(19) "2008:06:19 01:47:53" - ["MeteringMode"]=> - int(5) - ["LightSource"]=> - int(4) - ["Flash"]=> - int(7) - ["FocalLength"]=> - string(4) "29/5" - ["ExifImageWidth"]=> - int(1) - ["ExifImageLength"]=> - int(1) - ["GPSVersion"]=> - string(4) "" - ["GPSLatitudeRef"]=> - string(1) "N" - ["GPSLatitude"]=> - array(3) { - [0]=> - string(4) "33/1" - [1]=> - string(4) "37/1" - [2]=> - string(3) "0/1" - } - ["GPSLongitudeRef"]=> - string(1) "W" - ["GPSLongitude"]=> - array(3) { - [0]=> - string(4) "84/1" - [1]=> - string(3) "7/1" - [2]=> - string(3) "0/1" - } - ["GPSAltitudeRef"]=> - string(1) "" - ["GPSAltitude"]=> - string(5) "295/1" - ["GPSTimeStamp"]=> - array(3) { - [0]=> - string(3) "1/1" - [1]=> - string(4) "47/1" - [2]=> - string(4) "53/1" - } -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif024.phpt b/ext/exif/tests/exif024.phpt deleted file mode 100644 index 4839d1cb3f044..0000000000000 --- a/ext/exif/tests/exif024.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Check for exif_read_data, JPEG with IFD0, EXIF, INTEROP data in Intel byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(14) { - ["FileName"]=> - string(12) "image024.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(28) "ANY_TAG, IFD0, EXIF, INTEROP" - ["COMPUTED"]=> - array(5) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - } - ["Exif_IFD_Pointer"]=> - int(26) - ["InteroperabilityOffset"]=> - int(44) - ["InterOperabilityIndex"]=> - string(3) "R98" - ["InterOperabilityVersion"]=> - string(4) "0100" - ["RelatedFileFormat"]=> - string(12) "image024.jpg" - ["RelatedImageWidth"]=> - int(1) - ["RelatedImageHeight"]=> - int(1) -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif025.phpt b/ext/exif/tests/exif025.phpt deleted file mode 100644 index 683dc7e3eb0cd..0000000000000 --- a/ext/exif/tests/exif025.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Check for exif_read_data, JPEG with IFD0, EXIF, INTEROP data in Motorola byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(14) { - ["FileName"]=> - string(12) "image025.jpg" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(2) - ["MimeType"]=> - string(10) "image/jpeg" - ["SectionsFound"]=> - string(28) "ANY_TAG, IFD0, EXIF, INTEROP" - ["COMPUTED"]=> - array(5) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - } - ["Exif_IFD_Pointer"]=> - int(26) - ["InteroperabilityOffset"]=> - int(44) - ["InterOperabilityIndex"]=> - string(3) "R98" - ["InterOperabilityVersion"]=> - string(4) "0100" - ["RelatedFileFormat"]=> - string(12) "image025.jpg" - ["RelatedImageWidth"]=> - int(1) - ["RelatedImageHeight"]=> - int(1) -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif026.phpt b/ext/exif/tests/exif026.phpt deleted file mode 100644 index 7de796801d054..0000000000000 --- a/ext/exif/tests/exif026.phpt +++ /dev/null @@ -1,1632 +0,0 @@ ---TEST-- -Check for exif_read_data, TIFF with IFD0, EXIF, INTEROP data in Intel byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(31) { - ["FileName"]=> - string(13) "image026.tiff" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(7) - ["MimeType"]=> - string(10) "image/tiff" - ["SectionsFound"]=> - string(28) "ANY_TAG, IFD0, EXIF, INTEROP" - ["COMPUTED"]=> - array(8) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(0) - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageWidth"]=> - int(1) - ["ImageLength"]=> - int(1) - ["BitsPerSample"]=> - int(8) - ["Compression"]=> - int(5) - ["PhotometricInterpretation"]=> - int(3) - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["StripOffsets"]=> - int(1980) - ["SamplesPerPixel"]=> - int(1) - ["RowsPerStrip"]=> - int(8) - ["StripByteCounts"]=> - int(4) - ["XResolution"]=> - string(17) "381681664/2097152" - ["YResolution"]=> - string(17) "381681664/2097152" - ["PlanarConfiguration"]=> - int(1) - ["ResolutionUnit"]=> - int(2) - ["Artist"]=> - string(12) "Eric Stewart" - ["ColorMap"]=> - array(768) { - [0]=> - int(0) - [1]=> - int(65280) - [2]=> - int(32512) - [3]=> - int(49152) - [4]=> - int(99) - [5]=> - int(115) - [6]=> - int(116) - [7]=> - int(101) - [8]=> - int(119) - [9]=> - int(97) - [10]=> - int(114) - [11]=> - int(116) - [12]=> - int(0) - [13]=> - int(0) - [14]=> - int(0) - [15]=> - int(0) - [16]=> - int(0) - [17]=> - int(0) - [18]=> - int(0) - [19]=> - int(0) - [20]=> - int(0) - [21]=> - int(0) - [22]=> - int(0) - [23]=> - int(0) - [24]=> - int(0) - [25]=> - int(0) - [26]=> - int(0) - [27]=> - int(0) - [28]=> - int(0) - [29]=> - int(0) - [30]=> - int(0) - [31]=> - int(0) - [32]=> - int(0) - [33]=> - int(0) - [34]=> - int(0) - [35]=> - int(0) - [36]=> - int(0) - [37]=> - int(0) - [38]=> - int(0) - [39]=> - int(0) - [40]=> - int(0) - [41]=> - int(0) - [42]=> - int(0) - [43]=> - int(0) - [44]=> - int(0) - [45]=> - int(0) - [46]=> - int(0) - [47]=> - int(0) - [48]=> - int(0) - [49]=> - int(0) - [50]=> - int(0) - [51]=> - int(0) - [52]=> - int(0) - [53]=> - int(0) - [54]=> - int(0) - [55]=> - int(0) - [56]=> - int(0) - [57]=> - int(0) - [58]=> - int(0) - [59]=> - int(0) - [60]=> - int(0) - [61]=> - int(0) - [62]=> - int(0) - [63]=> - int(0) - [64]=> - int(0) - [65]=> - int(0) - [66]=> - int(0) - [67]=> - int(0) - [68]=> - int(0) - [69]=> - int(0) - [70]=> - int(0) - [71]=> - int(0) - [72]=> - int(0) - [73]=> - int(0) - [74]=> - int(0) - [75]=> - int(0) - [76]=> - int(0) - [77]=> - int(0) - [78]=> - int(0) - [79]=> - int(0) - [80]=> - int(0) - [81]=> - int(0) - [82]=> - int(0) - [83]=> - int(0) - [84]=> - int(0) - [85]=> - int(0) - [86]=> - int(0) - [87]=> - int(0) - [88]=> - int(0) - [89]=> - int(0) - [90]=> - int(0) - [91]=> - int(0) - [92]=> - int(0) - [93]=> - int(0) - [94]=> - int(0) - [95]=> - int(0) - [96]=> - int(0) - [97]=> - int(0) - [98]=> - int(0) - [99]=> - int(0) - [100]=> - int(0) - [101]=> - int(0) - [102]=> - int(0) - [103]=> - int(0) - [104]=> - int(0) - [105]=> - int(0) - [106]=> - int(0) - [107]=> - int(0) - [108]=> - int(0) - [109]=> - int(0) - [110]=> - int(0) - [111]=> - int(0) - [112]=> - int(0) - [113]=> - int(0) - [114]=> - int(0) - [115]=> - int(0) - [116]=> - int(0) - [117]=> - int(0) - [118]=> - int(0) - [119]=> - int(0) - [120]=> - int(0) - [121]=> - int(0) - [122]=> - int(0) - [123]=> - int(0) - [124]=> - int(0) - [125]=> - int(0) - [126]=> - int(0) - [127]=> - int(0) - [128]=> - int(0) - [129]=> - int(0) - [130]=> - int(0) - [131]=> - int(0) - [132]=> - int(0) - [133]=> - int(0) - [134]=> - int(0) - [135]=> - int(0) - [136]=> - int(0) - [137]=> - int(0) - [138]=> - int(0) - [139]=> - int(0) - [140]=> - int(0) - [141]=> - int(0) - [142]=> - int(0) - [143]=> - int(0) - [144]=> - int(0) - [145]=> - int(0) - [146]=> - int(0) - [147]=> - int(0) - [148]=> - int(0) - [149]=> - int(0) - [150]=> - int(0) - [151]=> - int(0) - [152]=> - int(0) - [153]=> - int(0) - [154]=> - int(0) - [155]=> - int(0) - [156]=> - int(0) - [157]=> - int(0) - [158]=> - int(0) - [159]=> - int(0) - [160]=> - int(0) - [161]=> - int(0) - [162]=> - int(0) - [163]=> - int(0) - [164]=> - int(0) - [165]=> - int(0) - [166]=> - int(0) - [167]=> - int(0) - [168]=> - int(0) - [169]=> - int(0) - [170]=> - int(0) - [171]=> - int(0) - [172]=> - int(0) - [173]=> - int(0) - [174]=> - int(0) - [175]=> - int(0) - [176]=> - int(0) - [177]=> - int(0) - [178]=> - int(0) - [179]=> - int(0) - [180]=> - int(0) - [181]=> - int(0) - [182]=> - int(0) - [183]=> - int(0) - [184]=> - int(0) - [185]=> - int(0) - [186]=> - int(0) - [187]=> - int(0) - [188]=> - int(0) - [189]=> - int(0) - [190]=> - int(0) - [191]=> - int(0) - [192]=> - int(0) - [193]=> - int(0) - [194]=> - int(0) - [195]=> - int(0) - [196]=> - int(0) - [197]=> - int(0) - [198]=> - int(0) - [199]=> - int(0) - [200]=> - int(0) - [201]=> - int(0) - [202]=> - int(0) - [203]=> - int(0) - [204]=> - int(0) - [205]=> - int(0) - [206]=> - int(0) - [207]=> - int(0) - [208]=> - int(0) - [209]=> - int(0) - [210]=> - int(0) - [211]=> - int(0) - [212]=> - int(0) - [213]=> - int(0) - [214]=> - int(0) - [215]=> - int(0) - [216]=> - int(0) - [217]=> - int(0) - [218]=> - int(0) - [219]=> - int(0) - [220]=> - int(0) - [221]=> - int(0) - [222]=> - int(0) - [223]=> - int(0) - [224]=> - int(0) - [225]=> - int(0) - [226]=> - int(0) - [227]=> - int(0) - [228]=> - int(0) - [229]=> - int(0) - [230]=> - int(0) - [231]=> - int(0) - [232]=> - int(0) - [233]=> - int(0) - [234]=> - int(0) - [235]=> - int(0) - [236]=> - int(0) - [237]=> - int(0) - [238]=> - int(0) - [239]=> - int(0) - [240]=> - int(0) - [241]=> - int(0) - [242]=> - int(0) - [243]=> - int(0) - [244]=> - int(0) - [245]=> - int(0) - [246]=> - int(0) - [247]=> - int(0) - [248]=> - int(0) - [249]=> - int(0) - [250]=> - int(0) - [251]=> - int(0) - [252]=> - int(0) - [253]=> - int(0) - [254]=> - int(0) - [255]=> - int(1) - [256]=> - int(0) - [257]=> - int(65280) - [258]=> - int(32512) - [259]=> - int(49152) - [260]=> - int(0) - [261]=> - int(0) - [262]=> - int(0) - [263]=> - int(0) - [264]=> - int(0) - [265]=> - int(0) - [266]=> - int(0) - [267]=> - int(0) - [268]=> - int(0) - [269]=> - int(0) - [270]=> - int(0) - [271]=> - int(0) - [272]=> - int(11945) - [273]=> - int(1914) - [274]=> - int(0) - [275]=> - int(24609) - [276]=> - int(1088) - [277]=> - int(960) - [278]=> - int(0) - [279]=> - int(0) - [280]=> - int(20000) - [281]=> - int(8414) - [282]=> - int(65436) - [283]=> - int(0) - [284]=> - int(47655) - [285]=> - int(8) - [286]=> - int(37936) - [287]=> - int(8406) - [288]=> - int(0) - [289]=> - int(0) - [290]=> - int(0) - [291]=> - int(0) - [292]=> - int(0) - [293]=> - int(0) - [294]=> - int(0) - [295]=> - int(0) - [296]=> - int(0) - [297]=> - int(64652) - [298]=> - int(50264) - [299]=> - int(0) - [300]=> - int(0) - [301]=> - int(64887) - [302]=> - int(50264) - [303]=> - int(0) - [304]=> - int(25714) - [305]=> - int(26220) - [306]=> - int(17235) - [307]=> - int(19777) - [308]=> - int(65535) - [309]=> - int(65535) - [310]=> - int(65535) - [311]=> - int(65535) - [312]=> - int(65535) - [313]=> - int(65535) - [314]=> - int(65535) - [315]=> - int(65535) - [316]=> - int(501) - [317]=> - int(0) - [318]=> - int(20) - [319]=> - int(0) - [320]=> - int(0) - [321]=> - int(0) - [322]=> - int(16877) - [323]=> - int(0) - [324]=> - int(3) - [325]=> - int(0) - [326]=> - int(0) - [327]=> - int(0) - [328]=> - int(0) - [329]=> - int(0) - [330]=> - int(0) - [331]=> - int(0) - [332]=> - int(65535) - [333]=> - int(65535) - [334]=> - int(65535) - [335]=> - int(65535) - [336]=> - int(65535) - [337]=> - int(65535) - [338]=> - int(65535) - [339]=> - int(65535) - [340]=> - int(0) - [341]=> - int(0) - [342]=> - int(52840) - [343]=> - int(2025) - [344]=> - int(16) - [345]=> - int(57377) - [346]=> - int(1024) - [347]=> - int(960) - [348]=> - int(0) - [349]=> - int(0) - [350]=> - int(27136) - [351]=> - int(8414) - [352]=> - int(65436) - [353]=> - int(0) - [354]=> - int(47655) - [355]=> - int(8) - [356]=> - int(62400) - [357]=> - int(8407) - [358]=> - int(0) - [359]=> - int(0) - [360]=> - int(0) - [361]=> - int(0) - [362]=> - int(0) - [363]=> - int(0) - [364]=> - int(0) - [365]=> - int(0) - [366]=> - int(0) - [367]=> - int(64857) - [368]=> - int(50264) - [369]=> - int(0) - [370]=> - int(0) - [371]=> - int(64892) - [372]=> - int(50264) - [373]=> - int(0) - [374]=> - int(25714) - [375]=> - int(26220) - [376]=> - int(17235) - [377]=> - int(19777) - [378]=> - int(65535) - [379]=> - int(65535) - [380]=> - int(65535) - [381]=> - int(65535) - [382]=> - int(65535) - [383]=> - int(65535) - [384]=> - int(65535) - [385]=> - int(65535) - [386]=> - int(501) - [387]=> - int(0) - [388]=> - int(20) - [389]=> - int(0) - [390]=> - int(0) - [391]=> - int(0) - [392]=> - int(16877) - [393]=> - int(0) - [394]=> - int(3) - [395]=> - int(0) - [396]=> - int(0) - [397]=> - int(0) - [398]=> - int(0) - [399]=> - int(0) - [400]=> - int(0) - [401]=> - int(0) - [402]=> - int(65535) - [403]=> - int(65535) - [404]=> - int(65535) - [405]=> - int(65535) - [406]=> - int(65535) - [407]=> - int(65535) - [408]=> - int(65535) - [409]=> - int(65535) - [410]=> - int(0) - [411]=> - int(0) - [412]=> - int(53440) - [413]=> - int(2025) - [414]=> - int(16) - [415]=> - int(57377) - [416]=> - int(1024) - [417]=> - int(960) - [418]=> - int(0) - [419]=> - int(0) - [420]=> - int(41120) - [421]=> - int(9024) - [422]=> - int(65436) - [423]=> - int(0) - [424]=> - int(47655) - [425]=> - int(8) - [426]=> - int(24480) - [427]=> - int(8404) - [428]=> - int(0) - [429]=> - int(0) - [430]=> - int(0) - [431]=> - int(0) - [432]=> - int(0) - [433]=> - int(0) - [434]=> - int(0) - [435]=> - int(0) - [436]=> - int(0) - [437]=> - int(21315) - [438]=> - int(50294) - [439]=> - int(0) - [440]=> - int(0) - [441]=> - int(53635) - [442]=> - int(50294) - [443]=> - int(0) - [444]=> - int(25714) - [445]=> - int(26220) - [446]=> - int(17235) - [447]=> - int(19777) - [448]=> - int(65535) - [449]=> - int(65535) - [450]=> - int(65535) - [451]=> - int(65535) - [452]=> - int(65535) - [453]=> - int(65535) - [454]=> - int(65535) - [455]=> - int(65535) - [456]=> - int(501) - [457]=> - int(0) - [458]=> - int(20) - [459]=> - int(0) - [460]=> - int(0) - [461]=> - int(0) - [462]=> - int(16877) - [463]=> - int(0) - [464]=> - int(3) - [465]=> - int(0) - [466]=> - int(0) - [467]=> - int(0) - [468]=> - int(0) - [469]=> - int(0) - [470]=> - int(0) - [471]=> - int(0) - [472]=> - int(65535) - [473]=> - int(65535) - [474]=> - int(65535) - [475]=> - int(65535) - [476]=> - int(65535) - [477]=> - int(65535) - [478]=> - int(65535) - [479]=> - int(65535) - [480]=> - int(0) - [481]=> - int(0) - [482]=> - int(54028) - [483]=> - int(2772) - [484]=> - int(16) - [485]=> - int(57377) - [486]=> - int(1024) - [487]=> - int(960) - [488]=> - int(0) - [489]=> - int(0) - [490]=> - int(42384) - [491]=> - int(8408) - [492]=> - int(65436) - [493]=> - int(0) - [494]=> - int(47655) - [495]=> - int(8) - [496]=> - int(1136) - [497]=> - int(8348) - [498]=> - int(0) - [499]=> - int(0) - [500]=> - int(0) - [501]=> - int(0) - [502]=> - int(0) - [503]=> - int(0) - [504]=> - int(0) - [505]=> - int(0) - [506]=> - int(0) - [507]=> - int(12326) - [508]=> - int(50261) - [509]=> - int(0) - [510]=> - int(0) - [511]=> - int(12326) - [512]=> - int(0) - [513]=> - int(65280) - [514]=> - int(32512) - [515]=> - int(49152) - [516]=> - int(0) - [517]=> - int(0) - [518]=> - int(22663) - [519]=> - int(2) - [520]=> - int(0) - [521]=> - int(0) - [522]=> - int(24576) - [523]=> - int(2) - [524]=> - int(0) - [525]=> - int(0) - [526]=> - int(501) - [527]=> - int(0) - [528]=> - int(20) - [529]=> - int(0) - [530]=> - int(0) - [531]=> - int(0) - [532]=> - int(33188) - [533]=> - int(0) - [534]=> - int(0) - [535]=> - int(0) - [536]=> - int(0) - [537]=> - int(0) - [538]=> - int(0) - [539]=> - int(0) - [540]=> - int(0) - [541]=> - int(0) - [542]=> - int(0) - [543]=> - int(0) - [544]=> - int(0) - [545]=> - int(0) - [546]=> - int(0) - [547]=> - int(0) - [548]=> - int(0) - [549]=> - int(0) - [550]=> - int(0) - [551]=> - int(0) - [552]=> - int(51766) - [553]=> - int(1946) - [554]=> - int(0) - [555]=> - int(24609) - [556]=> - int(1088) - [557]=> - int(960) - [558]=> - int(0) - [559]=> - int(0) - [560]=> - int(0) - [561]=> - int(0) - [562]=> - int(25116) - [563]=> - int(2012) - [564]=> - int(0) - [565]=> - int(0) - [566]=> - int(0) - [567]=> - int(0) - [568]=> - int(0) - [569]=> - int(0) - [570]=> - int(0) - [571]=> - int(0) - [572]=> - int(0) - [573]=> - int(0) - [574]=> - int(0) - [575]=> - int(0) - [576]=> - int(0) - [577]=> - int(0) - [578]=> - int(0) - [579]=> - int(0) - [580]=> - int(0) - [581]=> - int(0) - [582]=> - int(0) - [583]=> - int(0) - [584]=> - int(0) - [585]=> - int(0) - [586]=> - int(0) - [587]=> - int(0) - [588]=> - int(0) - [589]=> - int(0) - [590]=> - int(0) - [591]=> - int(0) - [592]=> - int(0) - [593]=> - int(0) - [594]=> - int(0) - [595]=> - int(0) - [596]=> - int(0) - [597]=> - int(0) - [598]=> - int(0) - [599]=> - int(0) - [600]=> - int(0) - [601]=> - int(0) - [602]=> - int(0) - [603]=> - int(0) - [604]=> - int(0) - [605]=> - int(0) - [606]=> - int(0) - [607]=> - int(0) - [608]=> - int(0) - [609]=> - int(0) - [610]=> - int(0) - [611]=> - int(0) - [612]=> - int(0) - [613]=> - int(0) - [614]=> - int(0) - [615]=> - int(0) - [616]=> - int(0) - [617]=> - int(0) - [618]=> - int(0) - [619]=> - int(0) - [620]=> - int(0) - [621]=> - int(0) - [622]=> - int(0) - [623]=> - int(0) - [624]=> - int(0) - [625]=> - int(0) - [626]=> - int(0) - [627]=> - int(0) - [628]=> - int(0) - [629]=> - int(0) - [630]=> - int(0) - [631]=> - int(0) - [632]=> - int(0) - [633]=> - int(0) - [634]=> - int(0) - [635]=> - int(0) - [636]=> - int(0) - [637]=> - int(0) - [638]=> - int(0) - [639]=> - int(0) - [640]=> - int(0) - [641]=> - int(0) - [642]=> - int(0) - [643]=> - int(0) - [644]=> - int(0) - [645]=> - int(0) - [646]=> - int(0) - [647]=> - int(0) - [648]=> - int(0) - [649]=> - int(0) - [650]=> - int(0) - [651]=> - int(0) - [652]=> - int(0) - [653]=> - int(0) - [654]=> - int(0) - [655]=> - int(0) - [656]=> - int(0) - [657]=> - int(0) - [658]=> - int(0) - [659]=> - int(0) - [660]=> - int(0) - [661]=> - int(0) - [662]=> - int(0) - [663]=> - int(0) - [664]=> - int(0) - [665]=> - int(0) - [666]=> - int(0) - [667]=> - int(0) - [668]=> - int(0) - [669]=> - int(0) - [670]=> - int(0) - [671]=> - int(0) - [672]=> - int(0) - [673]=> - int(0) - [674]=> - int(0) - [675]=> - int(0) - [676]=> - int(0) - [677]=> - int(0) - [678]=> - int(0) - [679]=> - int(0) - [680]=> - int(0) - [681]=> - int(0) - [682]=> - int(0) - [683]=> - int(0) - [684]=> - int(0) - [685]=> - int(0) - [686]=> - int(0) - [687]=> - int(0) - [688]=> - int(0) - [689]=> - int(0) - [690]=> - int(0) - [691]=> - int(0) - [692]=> - int(0) - [693]=> - int(0) - [694]=> - int(0) - [695]=> - int(0) - [696]=> - int(0) - [697]=> - int(0) - [698]=> - int(0) - [699]=> - int(0) - [700]=> - int(0) - [701]=> - int(0) - [702]=> - int(0) - [703]=> - int(0) - [704]=> - int(0) - [705]=> - int(0) - [706]=> - int(0) - [707]=> - int(0) - [708]=> - int(0) - [709]=> - int(0) - [710]=> - int(0) - [711]=> - int(0) - [712]=> - int(0) - [713]=> - int(0) - [714]=> - int(0) - [715]=> - int(0) - [716]=> - int(0) - [717]=> - int(0) - [718]=> - int(0) - [719]=> - int(0) - [720]=> - int(0) - [721]=> - int(0) - [722]=> - int(0) - [723]=> - int(0) - [724]=> - int(0) - [725]=> - int(0) - [726]=> - int(0) - [727]=> - int(0) - [728]=> - int(0) - [729]=> - int(0) - [730]=> - int(0) - [731]=> - int(0) - [732]=> - int(0) - [733]=> - int(0) - [734]=> - int(0) - [735]=> - int(0) - [736]=> - int(0) - [737]=> - int(0) - [738]=> - int(0) - [739]=> - int(0) - [740]=> - int(0) - [741]=> - int(0) - [742]=> - int(0) - [743]=> - int(0) - [744]=> - int(0) - [745]=> - int(0) - [746]=> - int(0) - [747]=> - int(0) - [748]=> - int(0) - [749]=> - int(0) - [750]=> - int(0) - [751]=> - int(0) - [752]=> - int(0) - [753]=> - int(0) - [754]=> - int(0) - [755]=> - int(0) - [756]=> - int(0) - [757]=> - int(0) - [758]=> - int(0) - [759]=> - int(0) - [760]=> - int(0) - [761]=> - int(0) - [762]=> - int(0) - [763]=> - int(0) - [764]=> - int(0) - [765]=> - int(0) - [766]=> - int(0) - [767]=> - int(0) - } - ["Copyright"]=> - string(12) "Eric Stewart" - ["InterOperabilityIndex"]=> - string(3) "R98" - ["InterOperabilityVersion"]=> - string(4) "0100" - ["RelatedFileFormat"]=> - string(13) "image026.tiff" - ["RelatedImageWidth"]=> - int(1) - ["RelatedImageHeight"]=> - int(1) -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif027.phpt b/ext/exif/tests/exif027.phpt deleted file mode 100644 index f527c37bf1f9e..0000000000000 --- a/ext/exif/tests/exif027.phpt +++ /dev/null @@ -1,1632 +0,0 @@ ---TEST-- -Check for exif_read_data, TIFF with IFD0, EXIF, INTEROP data in Motorola byte-order. ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - ---EXPECTF-- -array(31) { - ["FileName"]=> - string(13) "image027.tiff" - ["FileDateTime"]=> - int(%d) - ["FileSize"]=> - int(%d) - ["FileType"]=> - int(8) - ["MimeType"]=> - string(10) "image/tiff" - ["SectionsFound"]=> - string(28) "ANY_TAG, IFD0, EXIF, INTEROP" - ["COMPUTED"]=> - array(8) { - ["html"]=> - string(20) "width="1" height="1"" - ["Height"]=> - int(1) - ["Width"]=> - int(1) - ["IsColor"]=> - int(1) - ["ByteOrderMotorola"]=> - int(1) - ["Copyright"]=> - string(24) "Eric Stewart, Hex Editor" - ["Copyright.Photographer"]=> - string(12) "Eric Stewart" - ["Copyright.Editor"]=> - string(10) "Hex Editor" - } - ["ImageWidth"]=> - int(1) - ["ImageLength"]=> - int(1) - ["BitsPerSample"]=> - int(8) - ["Compression"]=> - int(5) - ["PhotometricInterpretation"]=> - int(3) - ["ImageDescription"]=> - string(15) "My description." - ["Make"]=> - string(11) "OpenShutter" - ["Model"]=> - string(8) "OS 1.0.0" - ["StripOffsets"]=> - int(1980) - ["SamplesPerPixel"]=> - int(1) - ["RowsPerStrip"]=> - int(8) - ["StripByteCounts"]=> - int(4) - ["XResolution"]=> - string(17) "381681664/2097152" - ["YResolution"]=> - string(17) "381681664/2097152" - ["PlanarConfiguration"]=> - int(1) - ["ResolutionUnit"]=> - int(2) - ["Artist"]=> - string(12) "Eric Stewart" - ["ColorMap"]=> - array(768) { - [0]=> - int(0) - [1]=> - int(65280) - [2]=> - int(32512) - [3]=> - int(49152) - [4]=> - int(99) - [5]=> - int(115) - [6]=> - int(116) - [7]=> - int(101) - [8]=> - int(119) - [9]=> - int(97) - [10]=> - int(114) - [11]=> - int(116) - [12]=> - int(0) - [13]=> - int(0) - [14]=> - int(0) - [15]=> - int(0) - [16]=> - int(0) - [17]=> - int(0) - [18]=> - int(0) - [19]=> - int(0) - [20]=> - int(0) - [21]=> - int(0) - [22]=> - int(0) - [23]=> - int(0) - [24]=> - int(0) - [25]=> - int(0) - [26]=> - int(0) - [27]=> - int(0) - [28]=> - int(0) - [29]=> - int(0) - [30]=> - int(0) - [31]=> - int(0) - [32]=> - int(0) - [33]=> - int(0) - [34]=> - int(0) - [35]=> - int(0) - [36]=> - int(0) - [37]=> - int(0) - [38]=> - int(0) - [39]=> - int(0) - [40]=> - int(0) - [41]=> - int(0) - [42]=> - int(0) - [43]=> - int(0) - [44]=> - int(0) - [45]=> - int(0) - [46]=> - int(0) - [47]=> - int(0) - [48]=> - int(0) - [49]=> - int(0) - [50]=> - int(0) - [51]=> - int(0) - [52]=> - int(0) - [53]=> - int(0) - [54]=> - int(0) - [55]=> - int(0) - [56]=> - int(0) - [57]=> - int(0) - [58]=> - int(0) - [59]=> - int(0) - [60]=> - int(0) - [61]=> - int(0) - [62]=> - int(0) - [63]=> - int(0) - [64]=> - int(0) - [65]=> - int(0) - [66]=> - int(0) - [67]=> - int(0) - [68]=> - int(0) - [69]=> - int(0) - [70]=> - int(0) - [71]=> - int(0) - [72]=> - int(0) - [73]=> - int(0) - [74]=> - int(0) - [75]=> - int(0) - [76]=> - int(0) - [77]=> - int(0) - [78]=> - int(0) - [79]=> - int(0) - [80]=> - int(0) - [81]=> - int(0) - [82]=> - int(0) - [83]=> - int(0) - [84]=> - int(0) - [85]=> - int(0) - [86]=> - int(0) - [87]=> - int(0) - [88]=> - int(0) - [89]=> - int(0) - [90]=> - int(0) - [91]=> - int(0) - [92]=> - int(0) - [93]=> - int(0) - [94]=> - int(0) - [95]=> - int(0) - [96]=> - int(0) - [97]=> - int(0) - [98]=> - int(0) - [99]=> - int(0) - [100]=> - int(0) - [101]=> - int(0) - [102]=> - int(0) - [103]=> - int(0) - [104]=> - int(0) - [105]=> - int(0) - [106]=> - int(0) - [107]=> - int(0) - [108]=> - int(0) - [109]=> - int(0) - [110]=> - int(0) - [111]=> - int(0) - [112]=> - int(0) - [113]=> - int(0) - [114]=> - int(0) - [115]=> - int(0) - [116]=> - int(0) - [117]=> - int(0) - [118]=> - int(0) - [119]=> - int(0) - [120]=> - int(0) - [121]=> - int(0) - [122]=> - int(0) - [123]=> - int(0) - [124]=> - int(0) - [125]=> - int(0) - [126]=> - int(0) - [127]=> - int(0) - [128]=> - int(0) - [129]=> - int(0) - [130]=> - int(0) - [131]=> - int(0) - [132]=> - int(0) - [133]=> - int(0) - [134]=> - int(0) - [135]=> - int(0) - [136]=> - int(0) - [137]=> - int(0) - [138]=> - int(0) - [139]=> - int(0) - [140]=> - int(0) - [141]=> - int(0) - [142]=> - int(0) - [143]=> - int(0) - [144]=> - int(0) - [145]=> - int(0) - [146]=> - int(0) - [147]=> - int(0) - [148]=> - int(0) - [149]=> - int(0) - [150]=> - int(0) - [151]=> - int(0) - [152]=> - int(0) - [153]=> - int(0) - [154]=> - int(0) - [155]=> - int(0) - [156]=> - int(0) - [157]=> - int(0) - [158]=> - int(0) - [159]=> - int(0) - [160]=> - int(0) - [161]=> - int(0) - [162]=> - int(0) - [163]=> - int(0) - [164]=> - int(0) - [165]=> - int(0) - [166]=> - int(0) - [167]=> - int(0) - [168]=> - int(0) - [169]=> - int(0) - [170]=> - int(0) - [171]=> - int(0) - [172]=> - int(0) - [173]=> - int(0) - [174]=> - int(0) - [175]=> - int(0) - [176]=> - int(0) - [177]=> - int(0) - [178]=> - int(0) - [179]=> - int(0) - [180]=> - int(0) - [181]=> - int(0) - [182]=> - int(0) - [183]=> - int(0) - [184]=> - int(0) - [185]=> - int(0) - [186]=> - int(0) - [187]=> - int(0) - [188]=> - int(0) - [189]=> - int(0) - [190]=> - int(0) - [191]=> - int(0) - [192]=> - int(0) - [193]=> - int(0) - [194]=> - int(0) - [195]=> - int(0) - [196]=> - int(0) - [197]=> - int(0) - [198]=> - int(0) - [199]=> - int(0) - [200]=> - int(0) - [201]=> - int(0) - [202]=> - int(0) - [203]=> - int(0) - [204]=> - int(0) - [205]=> - int(0) - [206]=> - int(0) - [207]=> - int(0) - [208]=> - int(0) - [209]=> - int(0) - [210]=> - int(0) - [211]=> - int(0) - [212]=> - int(0) - [213]=> - int(0) - [214]=> - int(0) - [215]=> - int(0) - [216]=> - int(0) - [217]=> - int(0) - [218]=> - int(0) - [219]=> - int(0) - [220]=> - int(0) - [221]=> - int(0) - [222]=> - int(0) - [223]=> - int(0) - [224]=> - int(0) - [225]=> - int(0) - [226]=> - int(0) - [227]=> - int(0) - [228]=> - int(0) - [229]=> - int(0) - [230]=> - int(0) - [231]=> - int(0) - [232]=> - int(0) - [233]=> - int(0) - [234]=> - int(0) - [235]=> - int(0) - [236]=> - int(0) - [237]=> - int(0) - [238]=> - int(0) - [239]=> - int(0) - [240]=> - int(0) - [241]=> - int(0) - [242]=> - int(0) - [243]=> - int(0) - [244]=> - int(0) - [245]=> - int(0) - [246]=> - int(0) - [247]=> - int(0) - [248]=> - int(0) - [249]=> - int(0) - [250]=> - int(0) - [251]=> - int(0) - [252]=> - int(0) - [253]=> - int(0) - [254]=> - int(0) - [255]=> - int(1) - [256]=> - int(0) - [257]=> - int(65280) - [258]=> - int(32512) - [259]=> - int(49152) - [260]=> - int(0) - [261]=> - int(0) - [262]=> - int(0) - [263]=> - int(0) - [264]=> - int(0) - [265]=> - int(0) - [266]=> - int(0) - [267]=> - int(0) - [268]=> - int(0) - [269]=> - int(0) - [270]=> - int(0) - [271]=> - int(0) - [272]=> - int(11945) - [273]=> - int(1914) - [274]=> - int(0) - [275]=> - int(24609) - [276]=> - int(1088) - [277]=> - int(960) - [278]=> - int(0) - [279]=> - int(0) - [280]=> - int(20000) - [281]=> - int(8414) - [282]=> - int(65436) - [283]=> - int(0) - [284]=> - int(47655) - [285]=> - int(8) - [286]=> - int(37936) - [287]=> - int(8406) - [288]=> - int(0) - [289]=> - int(0) - [290]=> - int(0) - [291]=> - int(0) - [292]=> - int(0) - [293]=> - int(0) - [294]=> - int(0) - [295]=> - int(0) - [296]=> - int(0) - [297]=> - int(64652) - [298]=> - int(50264) - [299]=> - int(0) - [300]=> - int(0) - [301]=> - int(64887) - [302]=> - int(50264) - [303]=> - int(0) - [304]=> - int(25714) - [305]=> - int(26220) - [306]=> - int(17235) - [307]=> - int(19777) - [308]=> - int(65535) - [309]=> - int(65535) - [310]=> - int(65535) - [311]=> - int(65535) - [312]=> - int(65535) - [313]=> - int(65535) - [314]=> - int(65535) - [315]=> - int(65535) - [316]=> - int(501) - [317]=> - int(0) - [318]=> - int(20) - [319]=> - int(0) - [320]=> - int(0) - [321]=> - int(0) - [322]=> - int(16877) - [323]=> - int(0) - [324]=> - int(3) - [325]=> - int(0) - [326]=> - int(0) - [327]=> - int(0) - [328]=> - int(0) - [329]=> - int(0) - [330]=> - int(0) - [331]=> - int(0) - [332]=> - int(65535) - [333]=> - int(65535) - [334]=> - int(65535) - [335]=> - int(65535) - [336]=> - int(65535) - [337]=> - int(65535) - [338]=> - int(65535) - [339]=> - int(65535) - [340]=> - int(0) - [341]=> - int(0) - [342]=> - int(52840) - [343]=> - int(2025) - [344]=> - int(16) - [345]=> - int(57377) - [346]=> - int(1024) - [347]=> - int(960) - [348]=> - int(0) - [349]=> - int(0) - [350]=> - int(27136) - [351]=> - int(8414) - [352]=> - int(65436) - [353]=> - int(0) - [354]=> - int(47655) - [355]=> - int(8) - [356]=> - int(62400) - [357]=> - int(8407) - [358]=> - int(0) - [359]=> - int(0) - [360]=> - int(0) - [361]=> - int(0) - [362]=> - int(0) - [363]=> - int(0) - [364]=> - int(0) - [365]=> - int(0) - [366]=> - int(0) - [367]=> - int(64857) - [368]=> - int(50264) - [369]=> - int(0) - [370]=> - int(0) - [371]=> - int(64892) - [372]=> - int(50264) - [373]=> - int(0) - [374]=> - int(25714) - [375]=> - int(26220) - [376]=> - int(17235) - [377]=> - int(19777) - [378]=> - int(65535) - [379]=> - int(65535) - [380]=> - int(65535) - [381]=> - int(65535) - [382]=> - int(65535) - [383]=> - int(65535) - [384]=> - int(65535) - [385]=> - int(65535) - [386]=> - int(501) - [387]=> - int(0) - [388]=> - int(20) - [389]=> - int(0) - [390]=> - int(0) - [391]=> - int(0) - [392]=> - int(16877) - [393]=> - int(0) - [394]=> - int(3) - [395]=> - int(0) - [396]=> - int(0) - [397]=> - int(0) - [398]=> - int(0) - [399]=> - int(0) - [400]=> - int(0) - [401]=> - int(0) - [402]=> - int(65535) - [403]=> - int(65535) - [404]=> - int(65535) - [405]=> - int(65535) - [406]=> - int(65535) - [407]=> - int(65535) - [408]=> - int(65535) - [409]=> - int(65535) - [410]=> - int(0) - [411]=> - int(0) - [412]=> - int(53440) - [413]=> - int(2025) - [414]=> - int(16) - [415]=> - int(57377) - [416]=> - int(1024) - [417]=> - int(960) - [418]=> - int(0) - [419]=> - int(0) - [420]=> - int(41120) - [421]=> - int(9024) - [422]=> - int(65436) - [423]=> - int(0) - [424]=> - int(47655) - [425]=> - int(8) - [426]=> - int(24480) - [427]=> - int(8404) - [428]=> - int(0) - [429]=> - int(0) - [430]=> - int(0) - [431]=> - int(0) - [432]=> - int(0) - [433]=> - int(0) - [434]=> - int(0) - [435]=> - int(0) - [436]=> - int(0) - [437]=> - int(21315) - [438]=> - int(50294) - [439]=> - int(0) - [440]=> - int(0) - [441]=> - int(53635) - [442]=> - int(50294) - [443]=> - int(0) - [444]=> - int(25714) - [445]=> - int(26220) - [446]=> - int(17235) - [447]=> - int(19777) - [448]=> - int(65535) - [449]=> - int(65535) - [450]=> - int(65535) - [451]=> - int(65535) - [452]=> - int(65535) - [453]=> - int(65535) - [454]=> - int(65535) - [455]=> - int(65535) - [456]=> - int(501) - [457]=> - int(0) - [458]=> - int(20) - [459]=> - int(0) - [460]=> - int(0) - [461]=> - int(0) - [462]=> - int(16877) - [463]=> - int(0) - [464]=> - int(3) - [465]=> - int(0) - [466]=> - int(0) - [467]=> - int(0) - [468]=> - int(0) - [469]=> - int(0) - [470]=> - int(0) - [471]=> - int(0) - [472]=> - int(65535) - [473]=> - int(65535) - [474]=> - int(65535) - [475]=> - int(65535) - [476]=> - int(65535) - [477]=> - int(65535) - [478]=> - int(65535) - [479]=> - int(65535) - [480]=> - int(0) - [481]=> - int(0) - [482]=> - int(54028) - [483]=> - int(2772) - [484]=> - int(16) - [485]=> - int(57377) - [486]=> - int(1024) - [487]=> - int(960) - [488]=> - int(0) - [489]=> - int(0) - [490]=> - int(42384) - [491]=> - int(8408) - [492]=> - int(65436) - [493]=> - int(0) - [494]=> - int(47655) - [495]=> - int(8) - [496]=> - int(1136) - [497]=> - int(8348) - [498]=> - int(0) - [499]=> - int(0) - [500]=> - int(0) - [501]=> - int(0) - [502]=> - int(0) - [503]=> - int(0) - [504]=> - int(0) - [505]=> - int(0) - [506]=> - int(0) - [507]=> - int(12326) - [508]=> - int(50261) - [509]=> - int(0) - [510]=> - int(0) - [511]=> - int(12326) - [512]=> - int(0) - [513]=> - int(65280) - [514]=> - int(32512) - [515]=> - int(49152) - [516]=> - int(0) - [517]=> - int(0) - [518]=> - int(22663) - [519]=> - int(2) - [520]=> - int(0) - [521]=> - int(0) - [522]=> - int(24576) - [523]=> - int(2) - [524]=> - int(0) - [525]=> - int(0) - [526]=> - int(501) - [527]=> - int(0) - [528]=> - int(20) - [529]=> - int(0) - [530]=> - int(0) - [531]=> - int(0) - [532]=> - int(33188) - [533]=> - int(0) - [534]=> - int(0) - [535]=> - int(0) - [536]=> - int(0) - [537]=> - int(0) - [538]=> - int(0) - [539]=> - int(0) - [540]=> - int(0) - [541]=> - int(0) - [542]=> - int(0) - [543]=> - int(0) - [544]=> - int(0) - [545]=> - int(0) - [546]=> - int(0) - [547]=> - int(0) - [548]=> - int(0) - [549]=> - int(0) - [550]=> - int(0) - [551]=> - int(0) - [552]=> - int(51766) - [553]=> - int(1946) - [554]=> - int(0) - [555]=> - int(24609) - [556]=> - int(1088) - [557]=> - int(960) - [558]=> - int(0) - [559]=> - int(0) - [560]=> - int(0) - [561]=> - int(0) - [562]=> - int(25116) - [563]=> - int(2012) - [564]=> - int(0) - [565]=> - int(0) - [566]=> - int(0) - [567]=> - int(0) - [568]=> - int(0) - [569]=> - int(0) - [570]=> - int(0) - [571]=> - int(0) - [572]=> - int(0) - [573]=> - int(0) - [574]=> - int(0) - [575]=> - int(0) - [576]=> - int(0) - [577]=> - int(0) - [578]=> - int(0) - [579]=> - int(0) - [580]=> - int(0) - [581]=> - int(0) - [582]=> - int(0) - [583]=> - int(0) - [584]=> - int(0) - [585]=> - int(0) - [586]=> - int(0) - [587]=> - int(0) - [588]=> - int(0) - [589]=> - int(0) - [590]=> - int(0) - [591]=> - int(0) - [592]=> - int(0) - [593]=> - int(0) - [594]=> - int(0) - [595]=> - int(0) - [596]=> - int(0) - [597]=> - int(0) - [598]=> - int(0) - [599]=> - int(0) - [600]=> - int(0) - [601]=> - int(0) - [602]=> - int(0) - [603]=> - int(0) - [604]=> - int(0) - [605]=> - int(0) - [606]=> - int(0) - [607]=> - int(0) - [608]=> - int(0) - [609]=> - int(0) - [610]=> - int(0) - [611]=> - int(0) - [612]=> - int(0) - [613]=> - int(0) - [614]=> - int(0) - [615]=> - int(0) - [616]=> - int(0) - [617]=> - int(0) - [618]=> - int(0) - [619]=> - int(0) - [620]=> - int(0) - [621]=> - int(0) - [622]=> - int(0) - [623]=> - int(0) - [624]=> - int(0) - [625]=> - int(0) - [626]=> - int(0) - [627]=> - int(0) - [628]=> - int(0) - [629]=> - int(0) - [630]=> - int(0) - [631]=> - int(0) - [632]=> - int(0) - [633]=> - int(0) - [634]=> - int(0) - [635]=> - int(0) - [636]=> - int(0) - [637]=> - int(0) - [638]=> - int(0) - [639]=> - int(0) - [640]=> - int(0) - [641]=> - int(0) - [642]=> - int(0) - [643]=> - int(0) - [644]=> - int(0) - [645]=> - int(0) - [646]=> - int(0) - [647]=> - int(0) - [648]=> - int(0) - [649]=> - int(0) - [650]=> - int(0) - [651]=> - int(0) - [652]=> - int(0) - [653]=> - int(0) - [654]=> - int(0) - [655]=> - int(0) - [656]=> - int(0) - [657]=> - int(0) - [658]=> - int(0) - [659]=> - int(0) - [660]=> - int(0) - [661]=> - int(0) - [662]=> - int(0) - [663]=> - int(0) - [664]=> - int(0) - [665]=> - int(0) - [666]=> - int(0) - [667]=> - int(0) - [668]=> - int(0) - [669]=> - int(0) - [670]=> - int(0) - [671]=> - int(0) - [672]=> - int(0) - [673]=> - int(0) - [674]=> - int(0) - [675]=> - int(0) - [676]=> - int(0) - [677]=> - int(0) - [678]=> - int(0) - [679]=> - int(0) - [680]=> - int(0) - [681]=> - int(0) - [682]=> - int(0) - [683]=> - int(0) - [684]=> - int(0) - [685]=> - int(0) - [686]=> - int(0) - [687]=> - int(0) - [688]=> - int(0) - [689]=> - int(0) - [690]=> - int(0) - [691]=> - int(0) - [692]=> - int(0) - [693]=> - int(0) - [694]=> - int(0) - [695]=> - int(0) - [696]=> - int(0) - [697]=> - int(0) - [698]=> - int(0) - [699]=> - int(0) - [700]=> - int(0) - [701]=> - int(0) - [702]=> - int(0) - [703]=> - int(0) - [704]=> - int(0) - [705]=> - int(0) - [706]=> - int(0) - [707]=> - int(0) - [708]=> - int(0) - [709]=> - int(0) - [710]=> - int(0) - [711]=> - int(0) - [712]=> - int(0) - [713]=> - int(0) - [714]=> - int(0) - [715]=> - int(0) - [716]=> - int(0) - [717]=> - int(0) - [718]=> - int(0) - [719]=> - int(0) - [720]=> - int(0) - [721]=> - int(0) - [722]=> - int(0) - [723]=> - int(0) - [724]=> - int(0) - [725]=> - int(0) - [726]=> - int(0) - [727]=> - int(0) - [728]=> - int(0) - [729]=> - int(0) - [730]=> - int(0) - [731]=> - int(0) - [732]=> - int(0) - [733]=> - int(0) - [734]=> - int(0) - [735]=> - int(0) - [736]=> - int(0) - [737]=> - int(0) - [738]=> - int(0) - [739]=> - int(0) - [740]=> - int(0) - [741]=> - int(0) - [742]=> - int(0) - [743]=> - int(0) - [744]=> - int(0) - [745]=> - int(0) - [746]=> - int(0) - [747]=> - int(0) - [748]=> - int(0) - [749]=> - int(0) - [750]=> - int(0) - [751]=> - int(0) - [752]=> - int(0) - [753]=> - int(0) - [754]=> - int(0) - [755]=> - int(0) - [756]=> - int(0) - [757]=> - int(0) - [758]=> - int(0) - [759]=> - int(0) - [760]=> - int(0) - [761]=> - int(0) - [762]=> - int(0) - [763]=> - int(0) - [764]=> - int(0) - [765]=> - int(0) - [766]=> - int(0) - [767]=> - int(0) - } - ["Copyright"]=> - string(12) "Eric Stewart" - ["InterOperabilityIndex"]=> - string(3) "R98" - ["InterOperabilityVersion"]=> - string(4) "0100" - ["RelatedFileFormat"]=> - string(13) "image027.tiff" - ["RelatedImageWidth"]=> - int(1) - ["RelatedImageHeight"]=> - int(1) -} ---CREDIT-- -Eric Stewart diff --git a/ext/exif/tests/exif_imagetype_basic.phpt b/ext/exif/tests/exif_imagetype_basic.phpt deleted file mode 100644 index 1248d39add18c..0000000000000 --- a/ext/exif/tests/exif_imagetype_basic.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Check for exif_imagetype default behaviour ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - -===Done=== ---EXPECT-- -*** Testing exif_imagetype() : basic functionality *** -int(2) -===Done=== \ No newline at end of file diff --git a/ext/exif/tests/exif_imagetype_error.phpt b/ext/exif/tests/exif_imagetype_error.phpt deleted file mode 100644 index fac6e0b9b8ca3..0000000000000 --- a/ext/exif/tests/exif_imagetype_error.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test exif_imagetype() function : error conditions ---SKIPIF-- - ---FILE-- - -===Done=== ---EXPECTF-- -*** Testing exif_imagetype() : error conditions *** - --- Testing exif_imagetype() function with no arguments -- - -Warning: Wrong parameter count for exif_imagetype() in %s on line %d -NULL - --- Testing exif_imagetype() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for exif_imagetype() in %s on line %d -NULL - --- Testing exif_imagetype() function with an unknown file -- - -Warning: exif_imagetype(%sfoo.jpg): failed to open stream: No such file or directory in %s on line %d -bool(false) -===Done=== diff --git a/ext/exif/tests/exif_imagetype_variation1.phpt b/ext/exif/tests/exif_imagetype_variation1.phpt deleted file mode 100644 index 471b64401f5f6..0000000000000 --- a/ext/exif/tests/exif_imagetype_variation1.phpt +++ /dev/null @@ -1,208 +0,0 @@ ---TEST-- -Test exif_imagetype() function : usage variations - different types for filename argument ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // empty string - "", - '', - - // undefined variable - $undefined_var, - - // unset variable - $unset_var, - - // objects - new sample(), - - // resource - $file_handle, - - NULL, - null -); - - -// loop through each element of the array and check the working of exif_imagetype() -// when $filename is supplied with different values - -echo "\n--- Testing exif_imagetype() by supplying different values for 'filename' argument ---\n"; -$counter = 1; -foreach($values as $filename) { - echo "-- Iteration $counter --\n"; - var_dump( exif_imagetype($filename) ); - $counter ++; -} - -// closing the file -fclose($file_handle); - -echo "Done\n"; -?> - -?> -===Done=== ---EXPECTF-- -*** Testing exif_imagetype() : different types for filename argument *** - -Notice: Undefined variable: undefined_var in %s on line %d - -Notice: Undefined variable: unset_var in %s on line %d - ---- Testing exif_imagetype() by supplying different values for 'filename' argument --- --- Iteration 1 -- - -Warning: exif_imagetype(0): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: exif_imagetype(1): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: exif_imagetype(12345): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: exif_imagetype(-2345): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: exif_imagetype(10.5): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: exif_imagetype(-10.5): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 7 -- - -Warning: exif_imagetype(101234567000): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 8 -- - -Warning: exif_imagetype(1.07654321E-9): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 9 -- - -Warning: exif_imagetype(0.5): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d - -Warning: exif_imagetype(Array): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d - -Warning: exif_imagetype(Array): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d - -Warning: exif_imagetype(Array): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d - -Warning: exif_imagetype(Array): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d - -Warning: exif_imagetype(Array): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 15 -- - -Warning: exif_imagetype(1): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- - -Warning: exif_imagetype(1): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- -bool(false) --- Iteration 20 -- -bool(false) --- Iteration 21 -- -bool(false) --- Iteration 22 -- -bool(false) --- Iteration 23 -- - -Warning: exif_imagetype(obj'ct): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 24 -- - -Warning: exif_imagetype(Resource id #%d): failed to open stream: No such file or directory in %s on line %d -bool(false) --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -Done - -?> -===Done=== diff --git a/ext/exif/tests/exif_read_exif_data_basic.phpt b/ext/exif/tests/exif_read_exif_data_basic.phpt deleted file mode 100644 index 435f13752ac3c..0000000000000 --- a/ext/exif/tests/exif_read_exif_data_basic.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Check for read_exif_data default behaviour ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - -===Done=== ---EXPECTF-- -*** Testing read_exif_data() : basic functionality *** -Array -( - [FileName] => test2.jpg - [FileDateTime] => %d - [FileSize] => 1240 - [FileType] => 2 - [MimeType] => image/jpeg - [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, COMMENT - [COMPUTED] => Array - ( - [html] => width="1" height="1" - [Height] => 1 - [Width] => 1 - [IsColor] => 1 - [ByteOrderMotorola] => 1 - [UserComment] => Exif test image. - [UserCommentEncoding] => ASCII - [Copyright] => Photo (c) M.Boerger, Edited by M.Boerger. - [Copyright.Photographer] => Photo (c) M.Boerger - [Copyright.Editor] => Edited by M.Boerger. - [Thumbnail.FileType] => 2 - [Thumbnail.MimeType] => image/jpeg - ) - - [Copyright] => Photo (c) M.Boerger - [UserComment] => ASCII - [THUMBNAIL] => Array - ( - [JPEGInterchangeFormat] => 134 - [JPEGInterchangeFormatLength] => 523 - ) - - [COMMENT] => Array - ( - [0] => Comment #1. - [1] => Comment #2. - [2] => Comment #3end - ) - -) -===Done=== \ No newline at end of file diff --git a/ext/exif/tests/exif_tagname_basic.phpt b/ext/exif/tests/exif_tagname_basic.phpt deleted file mode 100644 index e33601197b3c7..0000000000000 --- a/ext/exif/tests/exif_tagname_basic.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test exif_tagname() function : basic functionality ---SKIPIF-- - ---INI-- -output_handler= -zlib.output_compression=0 ---FILE-- - -===Done=== ---EXPECT-- -*** Testing exif_tagname() : basic functionality *** -string(16) "ImageDescription" -string(4) "Make" -string(5) "Model" -===Done=== diff --git a/ext/exif/tests/exif_tagname_error.phpt b/ext/exif/tests/exif_tagname_error.phpt deleted file mode 100644 index f74495adce782..0000000000000 --- a/ext/exif/tests/exif_tagname_error.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test exif_tagname() function : error conditions ---SKIPIF-- - ---FILE-- - -===Done=== ---EXPECTF-- -*** Testing exif_tagname() : error conditions *** - --- Testing exif_tagname() function with no arguments -- - -Warning: Wrong parameter count for exif_tagname() in %s on line %d -NULL - --- Testing exif_tagname() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for exif_tagname() in %s on line %d -NULL -===Done=== diff --git a/ext/exif/tests/exif_tagname_variation1.phpt b/ext/exif/tests/exif_tagname_variation1.phpt deleted file mode 100644 index cf1fcf2c61b2c..0000000000000 --- a/ext/exif/tests/exif_tagname_variation1.phpt +++ /dev/null @@ -1,164 +0,0 @@ ---TEST-- -Test exif_tagname() function : usage variations - different types for index argument ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // empty string - "", - '', - - // undefined variable - $undefined_var, - - // unset variable - $unset_var, - - // objects - new sample(), - - // resource - $file_handle, - - NULL, - null -); - - -// loop through each element of the array and check the working of exif_tagname() -// when $index arugment is supplied with different values - -echo "\n--- Testing exif_tagname() by supplying different values for 'index' argument ---\n"; -$counter = 1; -foreach($values as $index) { - echo "-- Iteration $counter --\n"; - var_dump( exif_tagname($index) ); - $counter ++; -} - -// closing the file -fclose($file_handle); - -echo "Done\n"; -?> - -?> -===Done=== ---EXPECTF-- -*** Testing exif_tagname() : different types for index argument *** - -Notice: Undefined variable: undefined_var in %s on line %d - -Notice: Undefined variable: unset_var in %s on line %d - ---- Testing exif_tagname() by supplying different values for 'index' argument --- --- Iteration 1 -- -bool(false) --- Iteration 2 -- -bool(false) --- Iteration 3 -- -bool(false) --- Iteration 4 -- -bool(false) --- Iteration 5 -- -bool(false) --- Iteration 6 -- -bool(false) --- Iteration 7 -- -bool(false) --- Iteration 8 -- -bool(false) --- Iteration 9 -- -bool(false) --- Iteration 10 -- -bool(false) --- Iteration 11 -- -bool(false) --- Iteration 12 -- -bool(false) --- Iteration 13 -- -bool(false) --- Iteration 14 -- -bool(false) --- Iteration 15 -- -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- -bool(false) --- Iteration 20 -- -bool(false) --- Iteration 21 -- -bool(false) --- Iteration 22 -- -bool(false) --- Iteration 23 -- - -Notice: Object of class sample could not be converted to int in %s on line %d -bool(false) --- Iteration 24 -- -%s --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -Done - -?> -===Done=== diff --git a/ext/exif/tests/image007.jpg b/ext/exif/tests/image007.jpg deleted file mode 100644 index 852654075a26b..0000000000000 Binary files a/ext/exif/tests/image007.jpg and /dev/null differ diff --git a/ext/exif/tests/image008.jpg b/ext/exif/tests/image008.jpg deleted file mode 100644 index 3e8bfe4512ee8..0000000000000 Binary files a/ext/exif/tests/image008.jpg and /dev/null differ diff --git a/ext/exif/tests/image009.jpg b/ext/exif/tests/image009.jpg deleted file mode 100644 index 8803ddccd4231..0000000000000 Binary files a/ext/exif/tests/image009.jpg and /dev/null differ diff --git a/ext/exif/tests/image010.jpg b/ext/exif/tests/image010.jpg deleted file mode 100644 index 31ed6d678dba8..0000000000000 Binary files a/ext/exif/tests/image010.jpg and /dev/null differ diff --git a/ext/exif/tests/image011.jpg b/ext/exif/tests/image011.jpg deleted file mode 100644 index fcd5783ec7b63..0000000000000 Binary files a/ext/exif/tests/image011.jpg and /dev/null differ diff --git a/ext/exif/tests/image012.jpg b/ext/exif/tests/image012.jpg deleted file mode 100644 index dd25e06181fb4..0000000000000 Binary files a/ext/exif/tests/image012.jpg and /dev/null differ diff --git a/ext/exif/tests/image013.jpg b/ext/exif/tests/image013.jpg deleted file mode 100644 index 93ded26667d72..0000000000000 Binary files a/ext/exif/tests/image013.jpg and /dev/null differ diff --git a/ext/exif/tests/image014.jpg b/ext/exif/tests/image014.jpg deleted file mode 100644 index 7657a0a4c7527..0000000000000 Binary files a/ext/exif/tests/image014.jpg and /dev/null differ diff --git a/ext/exif/tests/image015.jpg b/ext/exif/tests/image015.jpg deleted file mode 100644 index 6f52dec4d76de..0000000000000 Binary files a/ext/exif/tests/image015.jpg and /dev/null differ diff --git a/ext/exif/tests/image016.tiff b/ext/exif/tests/image016.tiff deleted file mode 100644 index 17121139331bd..0000000000000 Binary files a/ext/exif/tests/image016.tiff and /dev/null differ diff --git a/ext/exif/tests/image017.tiff b/ext/exif/tests/image017.tiff deleted file mode 100644 index 89800d8796279..0000000000000 Binary files a/ext/exif/tests/image017.tiff and /dev/null differ diff --git a/ext/exif/tests/image018.tiff b/ext/exif/tests/image018.tiff deleted file mode 100644 index 6b4492f7cdfea..0000000000000 Binary files a/ext/exif/tests/image018.tiff and /dev/null differ diff --git a/ext/exif/tests/image020.tiff b/ext/exif/tests/image020.tiff deleted file mode 100644 index 87f187821ad4b..0000000000000 Binary files a/ext/exif/tests/image020.tiff and /dev/null differ diff --git a/ext/exif/tests/image021.tiff b/ext/exif/tests/image021.tiff deleted file mode 100644 index 190f30b93aa17..0000000000000 Binary files a/ext/exif/tests/image021.tiff and /dev/null differ diff --git a/ext/exif/tests/image022.tiff b/ext/exif/tests/image022.tiff deleted file mode 100644 index 88f43733413e7..0000000000000 Binary files a/ext/exif/tests/image022.tiff and /dev/null differ diff --git a/ext/exif/tests/image023.tiff b/ext/exif/tests/image023.tiff deleted file mode 100644 index dc33f6ed90987..0000000000000 Binary files a/ext/exif/tests/image023.tiff and /dev/null differ diff --git a/ext/exif/tests/image024.jpg b/ext/exif/tests/image024.jpg deleted file mode 100644 index 0b5a42e8948b9..0000000000000 Binary files a/ext/exif/tests/image024.jpg and /dev/null differ diff --git a/ext/exif/tests/image025.jpg b/ext/exif/tests/image025.jpg deleted file mode 100644 index a5c0e17c7a523..0000000000000 Binary files a/ext/exif/tests/image025.jpg and /dev/null differ diff --git a/ext/exif/tests/image026.tiff b/ext/exif/tests/image026.tiff deleted file mode 100644 index 8fdafc738fe2a..0000000000000 Binary files a/ext/exif/tests/image026.tiff and /dev/null differ diff --git a/ext/exif/tests/image027.tiff b/ext/exif/tests/image027.tiff deleted file mode 100644 index 7c3a37a90a01a..0000000000000 Binary files a/ext/exif/tests/image027.tiff and /dev/null differ diff --git a/ext/exif/tests/test1.jpg b/ext/exif/tests/test1.jpg deleted file mode 100644 index 121decb65ad30..0000000000000 Binary files a/ext/exif/tests/test1.jpg and /dev/null differ diff --git a/ext/exif/tests/test2.jpg b/ext/exif/tests/test2.jpg deleted file mode 100644 index f60ecded6f8b0..0000000000000 Binary files a/ext/exif/tests/test2.jpg and /dev/null differ diff --git a/ext/exif/tests/test3.jpg b/ext/exif/tests/test3.jpg deleted file mode 100644 index 7547a16630f6b..0000000000000 Binary files a/ext/exif/tests/test3.jpg and /dev/null differ diff --git a/ext/exif/tests/test4.jpg b/ext/exif/tests/test4.jpg deleted file mode 100644 index 8a23a7b658ddc..0000000000000 Binary files a/ext/exif/tests/test4.jpg and /dev/null differ diff --git a/ext/exif/tests/test5.jpg b/ext/exif/tests/test5.jpg deleted file mode 100644 index d03cac18a3092..0000000000000 Binary files a/ext/exif/tests/test5.jpg and /dev/null differ diff --git a/ext/exif/tests/test6.jpg b/ext/exif/tests/test6.jpg deleted file mode 100644 index 073cefdfe0221..0000000000000 Binary files a/ext/exif/tests/test6.jpg and /dev/null differ diff --git a/ext/ext_skel b/ext/ext_skel deleted file mode 100755 index 58cc89f80f2d0..0000000000000 --- a/ext/ext_skel +++ /dev/null @@ -1,300 +0,0 @@ -#!/bin/sh - -givup() { - echo $* - exit 1 -} - -usage() { -echo "$0 --extname=module [--proto=file] [--stubs=file] [--xml[=file]]" -echo " [--skel=dir] [--full-xml] [--no-help]" -echo "" -echo " --extname=module module is the name of your extension" -echo " --proto=file file contains prototypes of functions to create" -echo " --stubs=file generate only function stubs in file" -echo " --xml generate xml documentation to be added to phpdoc-cvs" -echo " --skel=dir path to the skeleton directory" -echo " --full-xml generate xml documentation for a self-contained extension" -echo " (not yet implemented)" -echo " --no-help don't try to be nice and create comments in the code" -echo " and helper functions to test if the module compiled" -exit 1 -} - -if test $# = 0; then - usage -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --extname=?*) - extname=$optarg - EXTNAME=`echo $extname | tr "[:lower:]" "[:upper:]"` - ;; - --proto=?*) - proto=$optarg - ;; - --stubs=*) - stubs=yes - stubfile=$optarg - ;; - --xml) - xml="yes" - ;; - --xml=?*) - xml=$optarg - ;; - --full-xml) - full_xml="yes" - ;; - --no-help) - no_help="yes" - ;; - --skel=?*) - skel_dir=$optarg - ;; - *) - usage - ;; - esac - shift -done - -if test -d "$extname" ; then - givup "Directory $extname already exists." -fi - -if test -z "$skel_dir"; then - skel_dir="skeleton" -fi - -## convert skel_dir to full path -skel_dir=`cd $skel_dir && pwd` - -test -d $skel_dir || givup "directory $skel_dir does not exist or is not directory" - -if echo '\c' | grep -s c >/dev/null 2>&1 -then - ECHO_N="echo -n" - ECHO_C="" -else - ECHO_N="echo" - ECHO_C='\c' -fi - -if test -z "$stubs"; then - echo "Creating directory $extname" - stubfile=$extname"/function_stubs" - mkdir $extname || givup "Cannot create directory $extname" -fi - -if test -n "$proto"; then - cat $proto | awk -v extname=$extname -v stubs=$stubs -v stubfile=$stubfile -v xml=$xml -v full_xml=$full_xml -v i_know_what_to_do_shut_up_i_dont_need_your_help_mode=$no_help -f $skel_dir/create_stubs -fi - -if test -z "$stubs"; then - cd $extname - chmod 755 . - -$ECHO_N "Creating basic files:$ECHO_C" - -$ECHO_N " config.m4$ECHO_C" -cat >config.m4 < check with-path - dnl SEARCH_PATH="/usr/local /usr" # you might want to change this - dnl SEARCH_FOR="/include/$extname.h" # you most likely want to change this - dnl if test -r \$PHP_$EXTNAME/\$SEARCH_FOR; then # path given as parameter - dnl ${EXTNAME}_DIR=\$PHP_$EXTNAME - dnl else # search default path list - dnl AC_MSG_CHECKING([for $extname files in default path]) - dnl for i in \$SEARCH_PATH ; do - dnl if test -r \$i/\$SEARCH_FOR; then - dnl ${EXTNAME}_DIR=\$i - dnl AC_MSG_RESULT(found in \$i) - dnl fi - dnl done - dnl fi - dnl - dnl if test -z "\$${EXTNAME}_DIR"; then - dnl AC_MSG_RESULT([not found]) - dnl AC_MSG_ERROR([Please reinstall the $extname distribution]) - dnl fi - - dnl # --with-$extname -> add include path - dnl PHP_ADD_INCLUDE(\$${EXTNAME}_DIR/include) - - dnl # --with-$extname -> check for lib and symbol presence - dnl LIBNAME=$extname # you may want to change this - dnl LIBSYMBOL=$extname # you most likely want to change this - - dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL, - dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD) - dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ]) - dnl ],[ - dnl AC_MSG_ERROR([wrong $extname lib version or lib not found]) - dnl ],[ - dnl -L\$${EXTNAME}_DIR/lib -lm -ldl - dnl ]) - dnl - dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD) - - PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared) -fi -eof - -$ECHO_N " config.w32$ECHO_C" -cat >config.w32 <.cvsignore < sedscript -echo "s/EXTNAME/$EXTNAME/g" >> sedscript -echo '/__function_entries_here__/r function_entries' >> sedscript -echo '/__function_stubs_here__/r function_stubs' >> sedscript -echo '/__header_here__/r ../../header' >> sedscript -echo '/__footer_here__/r ../../footer' >> sedscript -echo '/__function_entries_here__/D' >> sedscript -echo '/__function_stubs_here__/D' >> sedscript -echo '/__header_here__/D' >> sedscript -echo '/__footer_here__/D' >> sedscript -if [ ! -z "$no_help" ]; then - echo "/confirm_$extname_compiled/D" >> sedscript - echo '/Remove the following/,/^\*\//D' >> sedscript - echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript - echo 's/^\/\*.*\*\/$//' >> sedscript - echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript -fi - -sed -f sedscript < $skel_dir/skeleton.c > $extname.c - - -$ECHO_N " php_$extname.h$ECHO_C" -echo "s/extname/$extname/g" > sedscript -echo "s/EXTNAME/$EXTNAME/g" >> sedscript -echo '/__function_declarations_here__/r function_declarations' >> sedscript -echo '/__header_here__/r ../../header' >> sedscript -echo '/__footer_here__/r ../../footer' >> sedscript -echo '/__function_declarations_here__/D' >> sedscript -echo '/__header_here__/D' >> sedscript -echo '/__footer_here__/D' >> sedscript -if [ ! -z "$no_help" ]; then - echo "/confirm_$extname_compiled/D" >> sedscript - echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript - echo 's/^\/\*.*\*\/$//' >> sedscript - echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript -fi -sed -f sedscript <$skel_dir/php_skeleton.h > php_$extname.h - -$ECHO_N " CREDITS$ECHO_C" -echo "s/extname/$extname/g" > sedscript -sed -f sedscript <$skel_dir/CREDITS > CREDITS - -$ECHO_N " EXPERIMENTAL$ECHO_C" -echo "s/extname/$extname/g" > sedscript -sed -f sedscript <$skel_dir/EXPERIMENTAL > EXPERIMENTAL - -$ECHO_N " tests/001.phpt$ECHO_C" -mkdir tests || givup "Cannot create tests directory" -chmod 755 tests -sed -f sedscript <$skel_dir/tests/001.phpt > tests/001.phpt - -if test -z "$stubs" && test -z "$no_help"; then - $ECHO_N " $extname.php$ECHO_C" - sed \ - -e "s/extname/$extname/g" \ - <$skel_dir/skeleton.php \ - > $extname.php -fi - -rm sedscript - -if test -n "$proto"; then - if test -z "$stubs"; then - rm function_entries - rm function_declarations - rm function_stubs - fi - if test -f function_warning; then - rm function_warning - warning=" -NOTE! Because some arguments to functions were resources, the code generated -cannot yet be compiled without editing. Please consider this to be step 4.5 -in the instructions above. -" - fi -fi - -find . -type f | xargs chmod 644 -find . -type d | xargs chmod 755 -fi - -echo " [done]." - -if test -z "$no_help" && test -z "$stubs"; then - cat < \ No newline at end of file diff --git a/ext/fbsql/CREDITS b/ext/fbsql/CREDITS deleted file mode 100644 index 3500fdc89e084..0000000000000 --- a/ext/fbsql/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FBSQL -Frank M. Kromann diff --git a/ext/fbsql/Readme_w32.txt b/ext/fbsql/Readme_w32.txt deleted file mode 100644 index af8bfdc1e9676..0000000000000 --- a/ext/fbsql/Readme_w32.txt +++ /dev/null @@ -1,22 +0,0 @@ -Rules for building FBSQL ------------------------- - -The fbsql project contains 2 configurations. - -To build this extension you must first download and -install FrontBase. The default instalation path would -be c:\usr\FrontBase. If you install it in another location -you need to change the include path in the project before -compiling. - -Start Visual Studio, load php_modules.dsw, select the fbsql projects, -configuration and build it. - -Finaly copy php_fbsql.dll to your extension directory and enable it -by adding the following line tp php.ini - -extension=php_fbsql.dll - -or by calling dl() in each script - -dl("php_fbsql.dll"); \ No newline at end of file diff --git a/ext/fbsql/config.m4 b/ext/fbsql/config.m4 deleted file mode 100644 index 384c4cd3808d5..0000000000000 --- a/ext/fbsql/config.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(fbsql, for FrontBase SQL92 (fbsql) support, -[ --with-fbsql[=DIR] Include FrontBase support. DIR is the FrontBase base directory]) - -if test "$PHP_FBSQL" != "no"; then - - AC_DEFINE(HAVE_FBSQL, 1, [Whether you have FrontBase]) - PHP_NEW_EXTENSION(fbsql, php_fbsql.c, $ext_shared) - - FBSQL_INSTALLATION_DIR="" - if test "$PHP_FBSQL" = "yes"; then - - for i in /Local/Library /usr/local /usr /opt /Library /usr/lib; do - if test -f $i/FrontBase/include/FBCAccess/FBCAccess.h; then - FBSQL_INSTALLATION_DIR=$i/FrontBase - break - fi - done - - if test -z "$FBSQL_INSTALLATION_DIR"; then - AC_MSG_ERROR(Cannot find FrontBase in known installation directories) - fi - - elif test "$PHP_FBSQL" != "no"; then - - if test -f $PHP_FBSQL/include/FBCAccess/FBCAccess.h; then - FBSQL_INSTALLATION_DIR=$PHP_FBSQL - else - AC_MSG_ERROR(Directory $PHP_FBSQL is not a FrontBase installation directory) - fi - fi - - if test ! -r "$FBSQL_INSTALLATION_DIR/lib/libFBCAccess.a"; then - AC_MSG_ERROR(Could not find $FBSQL_INSTALLATION_DIR/lib/libFBCAccess.a) - fi - - PHP_ADD_LIBRARY_WITH_PATH(FBCAccess, $FBSQL_INSTALLATION_DIR/lib, FBSQL_SHARED_LIBADD) - PHP_ADD_INCLUDE($FBSQL_INSTALLATION_DIR/include) - PHP_SUBST(FBSQL_SHARED_LIBADD) -fi diff --git a/ext/fbsql/config.w32 b/ext/fbsql/config.w32 deleted file mode 100644 index 0c6909ab52948..0000000000000 --- a/ext/fbsql/config.w32 +++ /dev/null @@ -1,19 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("fbsql", "FrontBase support", "no"); - -if (PHP_FBSQL == "yes") { - if (CHECK_LIB("FBCAccess.lib", "fbsql", - "\\usr\\FrontBase\\lib;" + PHP_PHP_BUILD + "\\FrontBase\\lib;" - + PHP_FBSQL + "\\lib;" + PHP_FBSQL) && - CHECK_HEADER_ADD_INCLUDE("FBCAccess\\FBCAccess.h", "CFLAGS_FBSQL", - "\\usr\\FrontBase\\include;" + PHP_PHP_BUILD + "\\FrontBase\\include;" - + PHP_FBSQL + "\\include;" + PHP_FBSQL)) { - EXTENSION("fbsql", "php_fbsql.c"); - ADD_FLAG('CFLAGS_FBSQL', '/DWinNT=1'); - AC_DEFINE('HAVE_FBSQL', 1, 'Have FrontBase support'); - } else { - WARNING("fbsql not enabled; libraries and headers not found"); - } -} diff --git a/ext/fbsql/fbsql.dsp b/ext/fbsql/fbsql.dsp deleted file mode 100644 index a71186361617a..0000000000000 --- a/ext/fbsql/fbsql.dsp +++ /dev/null @@ -1,171 +0,0 @@ -# Microsoft Developer Studio Project File - Name="fbsql" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=fbsql - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "fbsql.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "fbsql.mak" CFG="fbsql - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "fbsql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fbsql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fbsql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fbsql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "fbsql - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "NDEBUG" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /D ZEND_DEBUG=0 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts.lib /nologo /dll /machine:I386 /out:"Release/php_fbsql.dll" /libpath:"..\..\Release" - -!ELSEIF "$(CFG)" == "fbsql - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts_debug.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug" - -!ELSEIF "$(CFG)" == "fbsql - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /FR /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib php5ts_debug.lib FBCAccess.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Debug_TS/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"\usr\FrontBase\lib" - -!ELSEIF "$(CFG)" == "fbsql - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "NDEBUG" /D ZTS=1 /D ZEND_DEBUG=0 /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib FBCAccess.lib ws2_32.lib /nologo /dll /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Release_TS/php_fbsql.dll" /libpath:"..\..\Release_TS" /libpath:"\usr\FrontBase\lib" /libpath:"..\..\Release_TS_inline" - -!ENDIF - -# Begin Target - -# Name "fbsql - Win32 Release" -# Name "fbsql - Win32 Debug" -# Name "fbsql - Win32 Debug_TS" -# Name "fbsql - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_fbsql.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_fbsql.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\Readme_w32.txt -# End Source File -# End Target -# End Project diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c deleted file mode 100644 index a43cb151868dd..0000000000000 --- a/ext/fbsql/php_fbsql.c +++ /dev/null @@ -1,4150 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http:/*www.php.net/license/3_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. | - +----------------------------------------------------------------------+ - | Author: Frank M. Kromann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* TODO: - * - * ? Safe mode implementation - */ - -/* SB's list: - - API for a more natural FB connect semantic - - Connect & set session - - Autoreconnect when disconnected - - Comments and cleanup - - BUGS - - Select db with no arguments - - Query with everything defaulted -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" - -#ifdef PHP_WIN32 -#include -#else -#include - -#if HAVE_SYS_TYPES_H -#include -#endif -#include -#include -#endif - -#include "php_ini.h" - -#define HAVE_FBSQL 1 - -#ifndef min -# define min(a,b) ((a)<(b)?(a):(b)) -#endif - -#if HAVE_FBSQL -#include "php_fbsql.h" -#include - -static int le_result, le_link, le_plink; - -struct PHPFBResult; -typedef struct PHPFBResult PHPFBResult; - -struct PHPFBLink; -typedef struct PHPFBLink PHPFBLink; - -/* The PHPFBLink structure represents a fbsql link. The lion is used for - a connection to a machine, it may be persistent and is reference counted. - The reason for refcounting is mostly to avoid to think, it work independent of - any wierd and unforseen allocation deallocation order. - - The PHPFBDatabse structure implements to actual connection to a FrontBase server - ot may be persistent is the link it is connected to is persistent, and refcounted - for the same reasons as above. - - The PHPFBResult structure implements a result from the FrontBase server, and does all - required buffereing from of results. - - In the PHP code the 3 above a data structures are referenced by means of integers in the - range from 1 to som configurable maximum. You can put a limit to the number of links, databases - and results. The integer identifications is implemented by insertion in the list, which is passed - as an argument to all the functions, please note the list is polymorph. - - Database objects and link objects are all reused, base on the host name user name, host name database name - user name. So connecting twice to the same database as the same user will return the same database id. - We use the same coding for that as fbsql does, explioiting the underlying implementation of the lists. - - Persistent objects are put in the persistent list as well, but only by name, if you connect to a persistent object - and it is not in the list it is simply added and get a new index, and refcounted. Tricky, tricky ... -*/ - -/* Some functions which should be exported from FBCAccess */ - -void* fbaObjectAtIndex(); -void fbaRelease(); -unsigned int fbaCount(); - -struct FBCAutoStartInfo { - FBArray* infoLines; -}; - -struct PHPFBResult -{ - PHPFBLink* link; /* The link for the result, may be NULL if no link */ - char* fetchHandle; /* The fetch handle, the id used by the server. */ - FBCMetaData* metaData; /* The metadata describing the result */ - FBCMetaData* ResultmetaData; /* The metadata describing the result */ - FBCRowHandler* rowHandler; /* The row handler, the Frontbase structure used for accessing rows in the result */ - unsigned int batchSize; /* The number of row to fetch when expanding the number of rows in the row handler */ - unsigned int rowCount; /* The number of rows in the results set. The number of row is not in */ - /* general known when the select is done, one typically needs to fetch all the row - to figure out how many row you got. When the rowCount is unknown the value is - 0x7ffffffff */ - int columnCount; /* Number of columns in the row set. */ - unsigned int rowIndex; /* The current row index. */ - int columnIndex; /* The current column index */ - void** row; /* The last row accessed */ - FBArray* array; /* The link may return a result set, the database list, we implement that by the */ - /* FBArray, just a list of strings. */ - FBCPList* list; /* The same special kind result just for property list from extract, schema info. */ - unsigned int selectResults; /* number of results in select */ - unsigned int currentResult; /* current result number */ - int lobMode; /* 0=Fetch data (default); 1=Fetch handle */ -}; - -struct PHPFBLink -{ - int persistent; /* persistent ? */ - char* hostName; /* Host name */ - char* userName; /* User name */ - char* userPassword; /* User password */ - char* databasePassword; /* Database password */ - char* databaseName; /* The name of the database */ - FBCExecHandler* execHandler; /* The exechandler, can be used for database operations */ - FBCDatabaseConnection* connection; /* The connection to the database */ - unsigned int affectedRows; /* Number of rows affected by the last SQL statement */ - long autoCommit; /* Enable or disable autoCommit */ - unsigned int errorNo; /* The latest error on the connection, 0 is ok. */ - char* errorText; /* The error text */ - unsigned int insert_id; /* The row index of the latest row inserted into the database */ -}; - -#define FBSQL_ASSOC 1<<0 -#define FBSQL_NUM 1<<1 -#define FBSQL_BOTH (FBSQL_ASSOC|FBSQL_NUM) - -#define FBSQL_LOCK_DEFERRED 0 -#define FBSQL_LOCK_OPTIMISTIC 1 -#define FBSQL_LOCK_PESSIMISTIC 2 /* default */ - -#define FBSQL_ISO_READ_UNCOMMITTED 0 -#define FBSQL_ISO_READ_COMMITTED 1 -#define FBSQL_ISO_REPEATABLE_READ 2 -#define FBSQL_ISO_SERIALIZABLE 3 /* default */ -#define FBSQL_ISO_VERSIONED 4 - -#define FBSQL_LOB_DIRECT 0 /* default */ -#define FBSQL_LOB_HANDLE 1 /* default */ - -#define DIGEST_BUFFER_SIZE 17 /* fbcDigestPassword() expects a preallocated buffer for 16 bytes plus termination */ - -ZEND_DECLARE_MODULE_GLOBALS(fbsql) -static PHP_GINIT_FUNCTION(fbsql); - -int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql); -char *DigestPassword(char *user, char *password) -{ - char *digest = NULL; - - if (user && strlen(user) && password && strlen(password)) { - char *user_upper = estrdup(user); - digest = emalloc(DIGEST_BUFFER_SIZE); - digest[0] = '\0'; - (void)fbcDigestPassword(php_strtoupper(user_upper, strlen(user_upper)), password, digest); - efree(user_upper); - } - - return digest; -} - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_connect, 0, 0, 0) - ZEND_ARG_INFO(0, hostname) - ZEND_ARG_INFO(0, username) - ZEND_ARG_INFO(0, password) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_pconnect, 0, 0, 0) - ZEND_ARG_INFO(0, username) - ZEND_ARG_INFO(0, hostname) - ZEND_ARG_INFO(0, password) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_close, 0, 0, 0) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_set_transaction, 0) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, locking) - ZEND_ARG_INFO(0, isolation) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_autocommit, 0, 0, 1) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, OnOff) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_commit, 0, 0, 0) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_rollback, 0, 0, 0) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_create_blob, 0, 0, 1) - ZEND_ARG_INFO(0, blob_data) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_create_clob, 0, 0, 1) - ZEND_ARG_INFO(0, clob_data) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_set_lob_mode, 0) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, lob_mode) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_read_blob, 0, 0, 1) - ZEND_ARG_INFO(0, blob_handle) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_read_clob, 0, 0, 1) - ZEND_ARG_INFO(0, clob_handle) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_blob_size, 0, 0, 1) - ZEND_ARG_INFO(0, blob_handle) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_clob_size, 0, 0, 1) - ZEND_ARG_INFO(0, clob_handle) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_hostname, 0, 0, 1) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, host_name) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_database, 0, 0, 1) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, database) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_database_password, 0, 0, 1) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, database_password) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_username, 0, 0, 1) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, username) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_password, 0, 0, 1) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, password) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_set_password, 0) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, user) - ZEND_ARG_INFO(0, password) - ZEND_ARG_INFO(0, old_password) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_select_db, 0, 0, 0) - ZEND_ARG_INFO(0, database_name) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_set_characterset, 0, 0, 2) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, charcterset) - ZEND_ARG_INFO(0, in_out_both) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_change_user, 0, 0, 2) - ZEND_ARG_INFO(0, user) - ZEND_ARG_INFO(0, password) - ZEND_ARG_INFO(0, database) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_create_db, 0, 0, 1) - ZEND_ARG_INFO(0, database_name) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, database_options) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_drop_db, 0, 0, 1) - ZEND_ARG_INFO(0, database_name) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_start_db, 0, 0, 1) - ZEND_ARG_INFO(0, database_name) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, database_options) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_stop_db, 0, 0, 1) - ZEND_ARG_INFO(0, database_name) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_db_status, 0, 0, 1) - ZEND_ARG_INFO(0, database_name) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_query, 0, 0, 1) - ZEND_ARG_INFO(0, query) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, batch_size) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_db_query, 0, 0, 2) - ZEND_ARG_INFO(0, database_name) - ZEND_ARG_INFO(0, query) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_list_dbs, 0, 0, 0) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_list_tables, 0, 0, 1) - ZEND_ARG_INFO(0, database) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_list_fields, 0, 0, 2) - ZEND_ARG_INFO(0, database_name) - ZEND_ARG_INFO(0, table_name) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_error, 0, 0, 0) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_errno, 0, 0, 0) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_warnings, 0, 0, 0) - ZEND_ARG_INFO(0, flag) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_affected_rows, 0, 0, 0) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_rows_fetched, 0) - ZEND_ARG_INFO(0, result) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_insert_id, 0, 0, 0) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_result, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, row) - ZEND_ARG_INFO(0, field) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_next_result, 0) - ZEND_ARG_INFO(0, result) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_num_rows, 0) - ZEND_ARG_INFO(0, result) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_num_fields, 0) - ZEND_ARG_INFO(0, result) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_fetch_row, 0) - ZEND_ARG_INFO(0, result) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_fetch_assoc, 0) - ZEND_ARG_INFO(0, result) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_fetch_object, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, result_type) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_fetch_array, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, result_type) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_data_seek, 0) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, row_number) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_fetch_lengths, 0) - ZEND_ARG_INFO(0, result) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_fetch_field, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, field_index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_seek, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, field_index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_name, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, field_index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_table, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, field_index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_len, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, field_index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_type, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, field_index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_flags, 0, 0, 1) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, field_index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_table_name, 0) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fbsql_free_result, 0) - ZEND_ARG_INFO(0, result) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_get_autostart_info, 0, 0, 0) - ZEND_ARG_INFO(0, link_identifier) -ZEND_END_ARG_INFO() - -/* }}} */ - -/* {{{ fbsql_functions[] - */ -zend_function_entry fbsql_functions[] = { - PHP_FE(fbsql_connect, arginfo_fbsql_connect) - PHP_FE(fbsql_pconnect, arginfo_fbsql_pconnect) - PHP_FE(fbsql_close, arginfo_fbsql_close) - PHP_FE(fbsql_select_db, arginfo_fbsql_select_db) - PHP_FE(fbsql_set_characterset, arginfo_fbsql_set_characterset) - PHP_FE(fbsql_create_db, arginfo_fbsql_create_db) - PHP_FE(fbsql_drop_db, arginfo_fbsql_drop_db) - PHP_FE(fbsql_start_db, arginfo_fbsql_start_db) - PHP_FE(fbsql_stop_db, arginfo_fbsql_stop_db) - PHP_FE(fbsql_db_status, arginfo_fbsql_db_status) - PHP_FE(fbsql_query, arginfo_fbsql_query) - PHP_FE(fbsql_db_query, arginfo_fbsql_db_query) - PHP_FE(fbsql_list_dbs, arginfo_fbsql_list_dbs) - PHP_FE(fbsql_list_tables, arginfo_fbsql_list_tables) - PHP_FE(fbsql_list_fields, arginfo_fbsql_list_fields) - PHP_FE(fbsql_error, arginfo_fbsql_error) - PHP_FE(fbsql_errno, arginfo_fbsql_errno) - PHP_FE(fbsql_affected_rows, arginfo_fbsql_affected_rows) - PHP_FE(fbsql_rows_fetched, arginfo_fbsql_rows_fetched) - PHP_FE(fbsql_insert_id, arginfo_fbsql_insert_id) - PHP_FE(fbsql_result, arginfo_fbsql_result) - PHP_FE(fbsql_next_result, arginfo_fbsql_next_result) - PHP_FE(fbsql_num_rows, arginfo_fbsql_num_rows) - PHP_FE(fbsql_num_fields, arginfo_fbsql_num_fields) - PHP_FE(fbsql_fetch_row, arginfo_fbsql_fetch_row) - PHP_FE(fbsql_fetch_array, arginfo_fbsql_fetch_array) - PHP_FE(fbsql_fetch_assoc, arginfo_fbsql_fetch_assoc) - PHP_FE(fbsql_fetch_object, arginfo_fbsql_fetch_object) - PHP_FE(fbsql_data_seek, arginfo_fbsql_data_seek) - PHP_FE(fbsql_fetch_lengths, arginfo_fbsql_fetch_lengths) - PHP_FE(fbsql_fetch_field, arginfo_fbsql_fetch_field) - PHP_FE(fbsql_field_seek, arginfo_fbsql_field_seek) - PHP_FE(fbsql_free_result, arginfo_fbsql_free_result) - PHP_FE(fbsql_field_name, arginfo_fbsql_field_name) - PHP_FE(fbsql_field_table, arginfo_fbsql_field_table) - PHP_FE(fbsql_field_len, arginfo_fbsql_field_len) - PHP_FE(fbsql_field_type, arginfo_fbsql_field_type) - PHP_FE(fbsql_field_flags, arginfo_fbsql_field_flags) - PHP_FE(fbsql_table_name, arginfo_fbsql_table_name) - -/* Fontbase additions: */ - PHP_FE(fbsql_set_transaction, arginfo_fbsql_set_transaction) - PHP_FE(fbsql_autocommit, arginfo_fbsql_autocommit) - PHP_FE(fbsql_commit, arginfo_fbsql_commit) - PHP_FE(fbsql_rollback, arginfo_fbsql_rollback) - - PHP_FE(fbsql_create_blob, arginfo_fbsql_create_blob) - PHP_FE(fbsql_create_clob, arginfo_fbsql_create_clob) - PHP_FE(fbsql_set_lob_mode, arginfo_fbsql_set_lob_mode) - PHP_FE(fbsql_read_blob, arginfo_fbsql_read_blob) - PHP_FE(fbsql_read_clob, arginfo_fbsql_read_clob) - PHP_FE(fbsql_blob_size, arginfo_fbsql_blob_size) - PHP_FE(fbsql_clob_size, arginfo_fbsql_clob_size) - - PHP_FE(fbsql_hostname, arginfo_fbsql_hostname) - PHP_FE(fbsql_database, arginfo_fbsql_database) - PHP_FE(fbsql_database_password, arginfo_fbsql_database_password) - PHP_FE(fbsql_username, arginfo_fbsql_username) - PHP_FE(fbsql_password, arginfo_fbsql_password) - PHP_FE(fbsql_warnings, arginfo_fbsql_warnings) - PHP_FE(fbsql_set_password, arginfo_fbsql_set_password) - - PHP_FE(fbsql_get_autostart_info, arginfo_fbsql_get_autostart_info) -/* PHP_FE(fbsql_set_autostart_info, NULL) */ - -/* Aliases: */ - PHP_FALIAS(fbsql, fbsql_db_query, arginfo_fbsql_db_query) - PHP_FALIAS(fbsql_tablename, fbsql_table_name, arginfo_fbsql_table_name) - - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry fbsql_module_entry = { - STANDARD_MODULE_HEADER, - "fbsql", - fbsql_functions, - PHP_MINIT(fbsql), - PHP_MSHUTDOWN(fbsql), - PHP_RINIT(fbsql), - PHP_RSHUTDOWN(fbsql), - PHP_MINFO(fbsql), - NO_VERSION_YET, - PHP_MODULE_GLOBALS(fbsql), - PHP_GINIT(fbsql), - NULL, - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; - -#ifdef COMPILE_DL_FBSQL -ZEND_GET_MODULE(fbsql) -#endif - -#define CHECK_LINK(link) { \ - if (link==-1) { \ - if (FB_SQL_G(generateWarnings)) \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); \ - RETURN_FALSE; \ - } \ -} - -static void phpfbReleaseResult(zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void phpfbReleaseLink(zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void phpfbReleasePLink(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -static void phpfbReleaseResult(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PHPFBResult* result = (PHPFBResult *)rsrc->ptr; - - if (result) - { - if (result->fetchHandle) { - FBCMetaData *md = fbcdcCancelFetch(result->link->connection, result->fetchHandle); - fbcmdRelease(md); - } - if (result->rowHandler) fbcrhRelease(result->rowHandler); - if (result->list) fbcplRelease(result->list); - if (result->array) fbaRelease(result->array); - if (result->ResultmetaData) fbcmdRelease(result->ResultmetaData); - efree(result); - } -} - - -static void phpfbReleaseLink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PHPFBLink* link = (PHPFBLink *)rsrc->ptr; - - if (link) - { - if (link->hostName) free(link->hostName); - if (link->userName) free(link->userName); - if (link->userPassword) free(link->userPassword); - if (link->databasePassword) free(link->databasePassword); - if (link->databaseName) free(link->databaseName); - if (link->errorText) free(link->errorText); - if (link->connection) { - fbcdcClose(link->connection); - fbcdcRelease(link->connection); - } - if (link->execHandler) fbcehRelease(link->execHandler); - efree(link); - FB_SQL_G(linkCount)--; - } -} - -static void phpfbReleasePLink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PHPFBLink* link = (PHPFBLink *)rsrc->ptr; - - if (link) - { - if (link->hostName) free(link->hostName); - if (link->userName) free(link->userName); - if (link->userPassword) free(link->userPassword); - if (link->databasePassword) free(link->databasePassword); - if (link->databaseName) free(link->databaseName); - if (link->errorText) free(link->errorText); - if (link->connection) { - fbcdcClose(link->connection); - fbcdcRelease(link->connection); - } - if (link->execHandler) fbcehRelease(link->execHandler); - free(link); - FB_SQL_G(linkCount)--; - FB_SQL_G(persistentCount)--; - } -} - -static void php_fbsql_set_default_link(int id TSRMLS_DC) -{ - if (FB_SQL_G(linkIndex)!=-1) { - zend_list_delete(FB_SQL_G(linkIndex)); - } - FB_SQL_G(linkIndex) = id; - zend_list_addref(id); -} - -static int php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (FB_SQL_G(linkIndex)==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - } - return FB_SQL_G(linkIndex); -} - - -static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link, long batch_size); - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN ("fbsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allowPersistent, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_BOOLEAN ("fbsql.generate_warnings", "0", PHP_INI_SYSTEM, OnUpdateBool, generateWarnings, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_BOOLEAN ("fbsql.autocommit", "1", PHP_INI_SYSTEM, OnUpdateBool, autoCommit, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_BOOLEAN ("fbsql.show_timestamp_decimals", "0", PHP_INI_SYSTEM, OnUpdateBool, showTimestampDecimals, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY_EX ("fbsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, maxPersistent, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.max_links", "128", PHP_INI_SYSTEM, OnUpdateLong, maxLinks, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.max_connections", "128", PHP_INI_SYSTEM, OnUpdateLong, maxConnections, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.max_results", "128", PHP_INI_SYSTEM, OnUpdateLong, maxResults, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.batchsize", "1000", PHP_INI_ALL, OnUpdateLong, batchSize, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY ("fbsql.default_host", NULL, PHP_INI_SYSTEM, OnUpdateString, hostName, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_user", "_SYSTEM", PHP_INI_SYSTEM, OnUpdateString, userName, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_password", "", PHP_INI_SYSTEM, OnUpdateString, userPassword, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_database", "", PHP_INI_SYSTEM, OnUpdateString, databaseName, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_database_password", "", PHP_INI_SYSTEM, OnUpdateString, databasePassword, zend_fbsql_globals, fbsql_globals) -PHP_INI_END() -/* }}} */ - -static PHP_GINIT_FUNCTION(fbsql) -{ - fbsql_globals->persistentCount = 0; - - if (fbsql_globals->hostName==NULL) - { - char name[256]; - gethostname(name, sizeof(name)); - name[sizeof(name)-1] = 0; - fbsql_globals->hostName = strdup(name); - } - - fbsql_globals->persistentCount = 0; - fbsql_globals->linkCount = 0; -} - -PHP_MINIT_FUNCTION(fbsql) -{ - REGISTER_INI_ENTRIES(); - - fbcInitialize(); - fbcehSetMultiThreaded(True); - le_result = zend_register_list_destructors_ex(phpfbReleaseResult, NULL, "fbsql result", module_number); - le_link = zend_register_list_destructors_ex(phpfbReleaseLink, NULL, "fbsql link", module_number); - le_plink = zend_register_list_destructors_ex(NULL, phpfbReleasePLink, "fbsql plink", module_number); - Z_TYPE(fbsql_module_entry) = type; - - REGISTER_LONG_CONSTANT("FBSQL_ASSOC", FBSQL_ASSOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_NUM", FBSQL_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_BOTH", FBSQL_BOTH, CONST_CS | CONST_PERSISTENT); - - /* Register Transaction constants */ - REGISTER_LONG_CONSTANT("FBSQL_LOCK_DEFERRED", FBSQL_LOCK_DEFERRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_LOCK_OPTIMISTIC", FBSQL_LOCK_OPTIMISTIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_LOCK_PESSIMISTIC", FBSQL_LOCK_PESSIMISTIC, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FBSQL_ISO_READ_UNCOMMITTED", FBSQL_ISO_READ_UNCOMMITTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_READ_COMMITTED", FBSQL_ISO_READ_COMMITTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_REPEATABLE_READ", FBSQL_ISO_REPEATABLE_READ, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_SERIALIZABLE", FBSQL_ISO_SERIALIZABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_VERSIONED", FBSQL_ISO_VERSIONED, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FBSQL_UTF8", 0, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO8859_1", FBC_ISO8859_1, CONST_CS | CONST_PERSISTENT); - - /* Register Status constants */ - REGISTER_LONG_CONSTANT("FBSQL_UNKNOWN", FBUnknownStatus, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_STOPPED", FBStopped, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_STARTING", FBStarting, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_RUNNING", FBRunning, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_STOPPING", FBStopping, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_NOEXEC", FBNoExec, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FBSQL_LOB_DIRECT", FBSQL_LOB_DIRECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_LOB_HANDLE", FBSQL_LOB_HANDLE, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(fbsql) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_RINIT_FUNCTION(fbsql) -{ - FB_SQL_G(linkIndex) = -1; - FB_SQL_G(linkCount) = FB_SQL_G(persistentCount); - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(fbsql) -{ - return SUCCESS; -} - -PHP_MINFO_FUNCTION(fbsql) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_header(2, "FrontBase support", "enabled"); - - php_info_print_table_row(2, "Client API version", "2.24"); - - if (FB_SQL_G(allowPersistent)) - { - snprintf(buf, sizeof(buf), "%ld", FB_SQL_G(persistentCount)); - php_info_print_table_row(2, "Active Persistent Links", buf); - } - - snprintf(buf, sizeof(buf), "%ld", FB_SQL_G(linkCount)); - php_info_print_table_row(2, "Active Links", buf); - -/* - snprintf(buf, sizeof(buf), "%ld", FB_SQL_G(resultCount)); - php_info_print_table_row(2, "Active Results", buf); -*/ - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - -static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - PHPFBLink* phpLink; - zend_rsrc_list_entry *lep; - char name[1024]; - char *hostName = NULL, *userName = NULL, *userPassword = NULL; - int argc = ZEND_NUM_ARGS(), create_new = 0; - zval **argv[3]; - - if ((argc < 0) || (argc > 3)) WRONG_PARAM_COUNT; - if (zend_get_parameters_ex(argc, &argv[0], &argv[1], &argv[2])==FAILURE) RETURN_FALSE; - if (argc >= 1) - { - convert_to_string_ex(argv[0]); - hostName = Z_STRVAL_PP(argv[0]); - } - if (argc >= 2) - { - convert_to_string_ex(argv[1]); - userName = Z_STRVAL_PP(argv[1]); - } - if (argc == 3) - { - convert_to_string_ex(argv[2]); - userPassword = Z_STRVAL_PP(argv[2]); - } - - if (hostName == NULL) hostName = FB_SQL_G(hostName); - if (userName == NULL) userName = FB_SQL_G(userName); - if (userPassword == NULL) userPassword = FB_SQL_G(userPassword); - - if (snprintf(name, sizeof(name), "fbsql_%s_%s_%s", hostName, userName, userPassword) < 0) { - RETURN_FALSE; - } - - if (!FB_SQL_G(allowPersistent)) { - persistent=0; - } - if (persistent) { - if (zend_hash_find(&EG(persistent_list), name, strlen(name) + 1, (void **)&lep) == SUCCESS) - { - FBCMetaData *md; - phpLink = (PHPFBLink*)lep->ptr; - // Check if connection still there. - md = fbcdcRollback(phpLink->connection); - if ( !mdOk(phpLink, md, "Rollback;") ) { - if (FB_SQL_G(generateWarnings)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase link is not connected, ty to reconnect."); - } - // Make sure select_db will reconnect. - fbcmdRelease(md); - fbcdcClose(phpLink->connection); - fbcdcRelease(phpLink->connection); - free(phpLink->connection); - phpLink->connection = NULL; - if (phpLink->databaseName) free(phpLink->databaseName); - phpLink->databaseName = NULL; - } - else { - fbcmdRelease(md); - } - } - else { - zend_rsrc_list_entry le; - - if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks))) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase link limit %d exceeded", FB_SQL_G(maxLinks)); - RETURN_FALSE; - } - - if ((FB_SQL_G(maxPersistent) != -1 && FB_SQL_G(persistentCount) == FB_SQL_G(maxPersistent))) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase persistent link limit %d exceeded", FB_SQL_G(maxPersistent)); - RETURN_FALSE; - } - - phpLink = malloc(sizeof(PHPFBLink)); - phpLink->persistent = persistent; - phpLink->hostName = strdup(hostName); - phpLink->userName = strdup(userName); - phpLink->userPassword = strdup(userPassword); - phpLink->databasePassword = strdup(FB_SQL_G(databasePassword)); - phpLink->databaseName = NULL; - phpLink->execHandler = NULL; - phpLink->affectedRows = 0; - phpLink->autoCommit = FB_SQL_G(autoCommit); - phpLink->errorNo = 0; - phpLink->errorText = NULL; - phpLink->connection = NULL; - - - le.ptr = phpLink; - Z_TYPE(le) = le_plink; - if (zend_hash_update(&EG(persistent_list), name, strlen(name) + 1, &le, sizeof(le), NULL)==FAILURE) - { - free(phpLink->hostName); - free(phpLink->userName); - free(phpLink->userPassword); - free(phpLink->databasePassword); - free(phpLink); - RETURN_FALSE; - } - FB_SQL_G(linkCount)++; - FB_SQL_G(persistentCount)++; - } - ZEND_REGISTER_RESOURCE(return_value, phpLink, le_plink); - } - else - { - zend_rsrc_list_entry le; - - if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks))) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase link limit %d exceeded", FB_SQL_G(maxLinks)); - RETURN_FALSE; - } - - if (zend_hash_find(&EG(regular_list), name, strlen(name) + 1, (void **)&lep) == SUCCESS) - { - int type, link; - void *ptr; - - link = (int) lep->ptr; - ptr = zend_list_find(link, &type); /* check if the link is still there */ - if (ptr && (type==le_link || type==le_plink)) { - zend_list_addref(link); - Z_LVAL_P(return_value) = link; - php_fbsql_set_default_link(link TSRMLS_CC); - Z_TYPE_P(return_value) = IS_RESOURCE; - return; - } else { - zend_hash_del(&EG(regular_list), name, strlen(name) + 1); - } - phpLink = (PHPFBLink*)lep->ptr; - } - - phpLink = emalloc(sizeof(PHPFBLink)); - phpLink->persistent = persistent; - phpLink->hostName = strdup(hostName); - phpLink->userName = strdup(userName); - phpLink->userPassword = strdup(userPassword); - phpLink->databasePassword = strdup(FB_SQL_G(databasePassword)); - phpLink->databaseName = NULL; - phpLink->execHandler = NULL; - phpLink->affectedRows = 0; - phpLink->autoCommit = FB_SQL_G(autoCommit); - phpLink->errorNo = 0; - phpLink->errorText = NULL; - phpLink->connection = NULL; - - ZEND_REGISTER_RESOURCE(return_value, phpLink, le_link); - - le.ptr = (void *)Z_LVAL_P(return_value); - Z_TYPE(le) = le_index_ptr; - if (zend_hash_update(&EG(regular_list), name, strlen(name) + 1, &le, sizeof(le), NULL)==FAILURE) - { - free(phpLink->hostName); - free(phpLink->userName); - free(phpLink->userPassword); - free(phpLink->databasePassword); - efree(phpLink); - RETURN_FALSE; - } - FB_SQL_G(linkCount)++; - } - php_fbsql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC); -} - -int phpfbFetchRow(PHPFBResult* result, unsigned int row) -{ - if (result->rowHandler == NULL) - { - void *rawData = fbcdcFetch(result->link->connection, result->batchSize, result->fetchHandle); - if (rawData == NULL) { - result->rowCount = 0; - } - else - result->rowHandler = fbcrhInitWith(rawData, result->metaData); - } - for (;;) - { - void *rawData; - if (row >= result->rowCount && result->rowCount != 0x7fffffff) return 0; - if (fbcrhRowCount(result->rowHandler) > (unsigned int)row) return 1; - rawData = fbcdcFetch(result->link->connection, result->batchSize, result->fetchHandle); - if (!fbcrhAddBatch(result->rowHandler, rawData)) result->rowCount = fbcrhRowCount(result->rowHandler); - } -} - - -/* {{{ proto resource fbsql_connect([string hostname [, string username [, string password]]]) - Create a connection to a database server */ -PHP_FUNCTION(fbsql_connect) -{ - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto resource fbsql_pconnect([string hostname [, string username [, string password]]]) - Create a persistant connection to a database server */ -PHP_FUNCTION(fbsql_pconnect) -{ - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_close([resource link_identifier]) - Close a connection to a database server */ -PHP_FUNCTION(fbsql_close) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id, i, nument, type; - void *ptr; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - nument = zend_hash_next_free_element(&EG(regular_list)); - for (i = 1; i < nument; i++) { - ptr = zend_list_find(i, &type); - if (ptr && (type == le_result)) { - PHPFBResult *result; - - result = (PHPFBResult *)ptr; - if (result->link == phpLink) { - zend_list_delete(i); - } - } - } - - if (id==-1) { /* explicit resource number */ - zend_list_delete(Z_RESVAL_PP(fbsql_link_index)); - } - - if (id!=-1 - || (fbsql_link_index && Z_RESVAL_PP(fbsql_link_index)==FB_SQL_G(linkIndex))) { - zend_list_delete(FB_SQL_G(linkIndex)); - FB_SQL_G(linkIndex) = -1; - } - - RETURN_TRUE; -} -/* }}} */ - -static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC) -{ - unsigned port; - FBCDatabaseConnection* c; - FBCMetaData* md; - - if (!link->databaseName || strcmp(link->databaseName, databaseName)) - { - port = atoi(databaseName); - if (port>0 && port<65535) - c = fbcdcConnectToDatabaseUsingPort(link->hostName, port, link->databasePassword); - else - c = fbcdcConnectToDatabase(databaseName, link->hostName, link->databasePassword); - if (c == NULL) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", fbcdcClassErrorMessage()); - return 0; - } - md = fbcdcCreateSession(c, "PHP", link->userName, link->userPassword, link->userName); - if (fbcmdErrorsFound(md)) - { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); - char* emg = fbcemdAllErrorMessages(emd); - if (FB_SQL_G(generateWarnings)) - { - if (emg) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", emg); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message"); - } - link->errorText = strdup(emg); - link->errorNo = fbcemdErrorCodeAtIndex(emd, 0); - free(emg); - fbcemdRelease(emd); - fbcmdRelease(md); - fbcdcClose(c); - fbcdcRelease(c); - return 0; - } - fbcmdRelease(md); - - if (c) - { - if (link->autoCommit) - md = fbcdcExecuteDirectSQL(c, "SET COMMIT TRUE;"); - else - md = fbcdcExecuteDirectSQL(c, "SET COMMIT FALSE;"); - fbcmdRelease(md); - } - fbcdcSetOutputCharacterSet(c, FBC_ISO8859_1); - fbcdcSetInputCharacterSet(c, FBC_ISO8859_1); - - if (link->connection) - { - fbcdcClose(link->connection); - fbcdcRelease(link->connection); - } - link->connection = c; - if (link->databaseName) free(link->databaseName); - link->databaseName = strdup(databaseName); - } - return 1; -} - -void phpfbestrdup(const char * s, int* length, char** value) -{ - int l = s?strlen(s):0; - if (value) - { - char* r = emalloc(l+1); - if (s) - strcpy(r, s); - else - r[0] = 0; - *value = r; - } - *length = l; -} - -/* {{{ proto void fbsql_set_transaction(resource link_identifier, int locking, int isolation) - Sets the transaction locking and isolation */ -PHP_FUNCTION(fbsql_set_transaction) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL, **Locking = NULL, **Isolation = NULL; - char strSQL[1024]; - char *strLocking[] = {"DEFERRED", "OPTIMISTIC", "PESSIMISTIC"}; - char *strIsolation[] = {"READ UNCOMMITTED", "READ NCOMMITTED", "REPEATABLE READ", "SERIALIZABLE", "VERSIONED"}; - - switch (ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, &fbsql_link_index, &Locking, &Isolation)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (Z_LVAL_PP(Locking) < 0 || Z_LVAL_PP(Locking) > 2) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid locking type."); - RETURN_FALSE; - } - if (Z_LVAL_PP(Isolation) < 0 || Z_LVAL_PP(Isolation) > 4) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid isolation type."); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (snprintf(strSQL, sizeof(strSQL) , "SET TRANSACTION LOCKING %s, ISOLATION %s;", strLocking[Z_LVAL_PP(Locking)], strIsolation[Z_LVAL_PP(Isolation)]) < 0) { - RETURN_FALSE; - } - - md = fbcdcExecuteDirectSQL(phpLink->connection, strSQL); - fbcmdRelease(md); -} -/* }}} */ - -/* {{{ proto bool fbsql_autocommit(resource link_identifier [, bool OnOff]) - Turns on auto-commit */ -PHP_FUNCTION(fbsql_autocommit) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL, **onoff = NULL; - zend_bool OnOff; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &onoff)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (onoff) - { - convert_to_boolean_ex(onoff); - OnOff = Z_BVAL_PP(onoff); - phpLink->autoCommit = OnOff; - if (OnOff) - md = fbcdcExecuteDirectSQL(phpLink->connection, "SET COMMIT TRUE;"); - else - md = fbcdcExecuteDirectSQL(phpLink->connection, "SET COMMIT FALSE;"); - fbcmdRelease(md); - } - RETURN_BOOL(phpLink->autoCommit); -} -/* }}} */ - -/* {{{ proto bool fbsql_commit([resource link_identifier]) - Commit the transaction */ -PHP_FUNCTION(fbsql_commit) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - md = fbcdcCommit(phpLink->connection); - - if (md) { - fbcmdRelease(md); - RETURN_TRUE; - } - else - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool fbsql_rollback([resource link_identifier]) - Rollback all statments since last commit */ -PHP_FUNCTION(fbsql_rollback) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - md = fbcdcRollback(phpLink->connection); - - if (md) { - fbcmdRelease(md); - RETURN_TRUE; - } - else - RETURN_FALSE; -} -/* }}} */ - - -static void php_fbsql_create_lob(INTERNAL_FUNCTION_PARAMETERS, int lob_type) -{ - PHPFBLink* phpLink = NULL; - FBCBlobHandle *lobHandle; - zval **lob_data, **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &lob_data)==FAILURE) { - RETURN_FALSE; - } - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &lob_data, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(lob_data); - switch (lob_type) { - case 0 : /* BLOB */ - lobHandle = fbcdcWriteBLOB(phpLink->connection, Z_STRVAL_PP(lob_data), Z_STRLEN_PP(lob_data)); - break; - case 1 : /* CLOB */ - lobHandle = fbcdcWriteCLOB(phpLink->connection, Z_STRVAL_PP(lob_data)); - break; - } - if (lobHandle) { - RETURN_STRING(fbcbhDescription(lobHandle), 1); - fbcbhRelease(lobHandle); - } - else - RETURN_FALSE; -} - -/* {{{ proto string fbsql_create_blob(string blob_data [, resource link_identifier]) - Create a BLOB in the database for use with an insert or update statement */ -PHP_FUNCTION(fbsql_create_blob) -{ - php_fbsql_create_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string fbsql_create_clob(string clob_data [, resource link_identifier]) - Create a CLOB in the database for use with an insert or update statement */ -PHP_FUNCTION(fbsql_create_clob) -{ - php_fbsql_create_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_set_lob_mode(resource result, int lob_mode) - Sets the mode for how LOB data re retreived (actual data or a handle) */ -PHP_FUNCTION(fbsql_set_lob_mode) -{ - - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **lob_mode = NULL; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &lob_mode)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(lob_mode); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - result->lobMode = Z_LVAL_PP(lob_mode); - - RETURN_TRUE; -} -/* }}} */ - -static void php_fbsql_read_lob(INTERNAL_FUNCTION_PARAMETERS, int lob_type) -{ - PHPFBLink* phpLink = NULL; - zval **lob_handle, **fbsql_link_index = NULL; - int id; - long length = 0; - char* value = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &lob_handle)==FAILURE) { - RETURN_FALSE; - } - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &lob_handle, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(lob_handle); - - if (Z_STRLEN_PP(lob_handle) != 27 || Z_STRVAL_PP(lob_handle)[0] != '@') { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The handle is invalid"); - RETURN_FALSE; - } - - length = fbcbhBlobSize((FBCBlobHandle *)Z_STRVAL_PP(lob_handle)); - if (lob_type == 0) - value = estrndup((char *)fbcdcReadBLOB(phpLink->connection, (FBCBlobHandle *)Z_STRVAL_PP(lob_handle)), length); - else - value = estrndup((char *)fbcdcReadCLOB(phpLink->connection, (FBCBlobHandle *)Z_STRVAL_PP(lob_handle)), length); - if (value) { - RETURN_STRINGL(value, length, 0); - } - else { - RETURN_FALSE; - } -} - -/* {{{ proto string fbsql_read_blob(string blob_handle [, resource link_identifier]) - Read the BLOB data identified by blob_handle */ -PHP_FUNCTION(fbsql_read_blob) -{ - php_fbsql_read_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string fbsql_read_clob(string clob_handle [, resource link_identifier]) - Read the CLOB data identified by clob_handle */ -PHP_FUNCTION(fbsql_read_clob) -{ - php_fbsql_read_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -static void php_fbsql_lob_size(INTERNAL_FUNCTION_PARAMETERS, int lob_type) -{ - PHPFBLink* phpLink = NULL; - zval **lob_handle, **fbsql_link_index = NULL; - int id; - char* value = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &lob_handle)==FAILURE) { - RETURN_FALSE; - } - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &lob_handle, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(lob_handle); - - if (Z_STRLEN_PP(lob_handle) != 27 || Z_STRVAL_PP(lob_handle)[0] != '@') { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The handle is invalid"); - RETURN_FALSE; - } - - RETURN_LONG(fbcbhBlobSize((FBCBlobHandle *)Z_STRVAL_PP(lob_handle))); -} - -/* {{{ proto int fbsql_blob_size(string blob_handle [, resource link_identifier]) - Get the size of a BLOB identified by blob_handle */ -PHP_FUNCTION(fbsql_blob_size) -{ - php_fbsql_lob_size(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int fbsql_clob_size(string clob_handle [, resource link_identifier]) - Get the size of a CLOB identified by clob_handle */ -PHP_FUNCTION(fbsql_clob_size) -{ - php_fbsql_lob_size(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_hostname(resource link_identifier [, string host_name]) - Get or set the host name used with a connection */ -PHP_FUNCTION(fbsql_hostname) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **host_name = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &host_name)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (host_name) - { - convert_to_string_ex(host_name); - if (phpLink->hostName) free(phpLink->hostName); - phpLink->hostName = strdup(Z_STRVAL_PP(host_name)); - } - RETURN_STRING(phpLink->hostName, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_database(resource link_identifier [, string database]) - Get or set the database name used with a connection */ -PHP_FUNCTION(fbsql_database) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **dbname = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &dbname)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (dbname) - { - convert_to_string_ex(dbname); - if (phpLink->databaseName) free(phpLink->databaseName); - phpLink->databaseName = strdup(Z_STRVAL_PP(dbname)); - } - if (phpLink->databaseName) { - RETURN_STRING(phpLink->databaseName, 1); - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string fbsql_database_password(resource link_identifier [, string database_password]) - Get or set the databsae password used with a connection */ -PHP_FUNCTION(fbsql_database_password) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **db_password = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &db_password)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (db_password) - { - convert_to_string_ex(db_password); - if (phpLink->databasePassword) free(phpLink->databasePassword); - phpLink->databasePassword = strdup(Z_STRVAL_PP(db_password)); - } - RETURN_STRING(phpLink->databasePassword, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_username(resource link_identifier [, string username]) - Get or set the host user used with a connection */ -PHP_FUNCTION(fbsql_username) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **username = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &username)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (username) - { - convert_to_string_ex(username); - if (phpLink->userName) free(phpLink->userName); - phpLink->userName = strdup(Z_STRVAL_PP(username)); - } - RETURN_STRING(phpLink->userName, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_password(resource link_identifier [, string password]) - Get or set the user password used with a connection */ -PHP_FUNCTION(fbsql_password) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **password = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &password)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (password) - { - convert_to_string_ex(password); - if (phpLink->userPassword) free(phpLink->userPassword); - phpLink->userPassword = strdup(Z_STRVAL_PP(password)); - } - RETURN_STRING(phpLink->userPassword, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_set_password(resource link_identifier, string user, string password, string old_password) - Change the password for a given user */ -PHP_FUNCTION(fbsql_set_password) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **user, **password, **old_password; - char *digest_password, *digest_old_password; - FBCMetaData *md; - - switch (ZEND_NUM_ARGS()) { - case 4: - if (zend_get_parameters_ex(4, &fbsql_link_index, &user, &password, &old_password)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(user); - convert_to_string_ex(password); - convert_to_string_ex(old_password); - - digest_password = DigestPassword(Z_STRVAL_PP(user), Z_STRVAL_PP(password)); - digest_old_password = DigestPassword(Z_STRVAL_PP(user), Z_STRVAL_PP(old_password)); - - md = fbcdcSetPasswordForUser(phpLink->connection, Z_STRVAL_PP(user), digest_password, digest_old_password); - if (mdOk(phpLink, md, "Change password")) { - ZVAL_BOOL(return_value, 1); - } - else { - ZVAL_BOOL(return_value, 0); - } - fbcmdRelease(md); - if (digest_old_password) efree(digest_old_password); - if (digest_password) efree(digest_password); -} -/* }}} */ - - -/* {{{ proto bool fbsql_select_db([string database_name [, resource link_identifier]]) - Select the database to open */ -PHP_FUNCTION(fbsql_select_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **dbname; - int id; - char* name = NULL; - - switch (ZEND_NUM_ARGS()) { - case 0: - name = FB_SQL_G(databaseName); - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &dbname)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(dbname); - name = Z_STRVAL_PP(dbname); - break; - case 2: - if (zend_get_parameters_ex(2, &dbname, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(dbname); - name = Z_STRVAL_PP(dbname); - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (!php_fbsql_select_db(name, phpLink TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void fbsql_set_characterset(resource link_identifier, long charcterset [, long in_out_both]]) - Change input/output character set */ -PHP_FUNCTION(fbsql_set_characterset) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index, **zcharset, **zin_out; - int id = -1; - int charset = -1, in_out_both = 3; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &zcharset)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &fbsql_link_index, &zcharset, &zin_out)==FAILURE) { - RETURN_FALSE; - } - in_out_both = Z_LVAL_PP(zin_out); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - charset = Z_LVAL_PP(zcharset); - - if (in_out_both & 1) { - fbcdcSetInputCharacterSet(phpLink->connection, charset); - } - if (in_out_both & 2) { - fbcdcSetOutputCharacterSet(phpLink->connection, charset); - } -} -/* }}} */ - -/* {{{ proto int fbsql_change_user(string user, string password [, string database [, resource link_identifier]]) - Change the user for a session */ -PHP_FUNCTION(fbsql_change_user) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **user, **password, **database; - int id; - char *name = NULL, *userName, *userPassword; - char buffer[1024]; - - switch (ZEND_NUM_ARGS()) { - case 2: - name = FB_SQL_G(databaseName); - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(2, &user, &password)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(3, &user, &password, &database)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(database); - name = Z_STRVAL_PP(database); - break; - case 4: - if (zend_get_parameters_ex(4, &user, &password, &database, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(database); - name = Z_STRVAL_PP(database); - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(user); - userName = Z_STRVAL_PP(user); - - convert_to_string_ex(password); - userPassword = Z_STRVAL_PP(password); - - if (snprintf(buffer, sizeof(buffer), "SET AUTHORIZATION %s;", userName) < 0) { - RETURN_FALSE; - } - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, buffer, phpLink, 0); - if (Z_LVAL_P(return_value)) - { - free(phpLink->userName); - phpLink->userName = strdup(userName); - } -} -/* }}} */ - -/* {{{ proto bool fbsql_create_db(string database_name [, resource link_identifier [, string database_options]]) - Create a new database on the server */ -PHP_FUNCTION(fbsql_create_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name, **database_options = NULL; - int id; - int i, status; - char *databaseName, *databaseOptions = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - case 3: - if (zend_get_parameters_ex(3, &database_name, &fbsql_link_index, &database_options)==FAILURE) { - RETURN_FALSE; - } - id = -1; - convert_to_string_ex(database_options); - databaseOptions = Z_STRVAL_PP(database_options); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status != FBUnknownStatus) - { - char* txt = "Unknown status"; - if (status == FBStopped ) txt = "stopped"; - else if (status == FBStarting) txt = "starting"; - else if (status == FBRunning ) txt = "running"; - else if (status == FBStopping) txt = "stopping"; - else if (status == FBNoExec ) txt = "no exec"; - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create %s@%s, database is %s", databaseName, phpLink->hostName, txt); - RETURN_FALSE; - } - if (!fbcehCreateDatabaseNamedWithOptions(phpLink->execHandler, databaseName, databaseOptions)) - { - char* error = fbechErrorMessage(phpLink->execHandler); - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create %s@%s. %s", databaseName, phpLink->hostName, error); - RETURN_FALSE; - } - for (i=0; i < 20; i++) - { -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBRunning) break; - } - if (status != FBRunning) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database %s@%s created -- status unknown", databaseName, phpLink->hostName); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int fbsql_drop_db(string database_name [, resource link_identifier]) - Drop a database on the server */ -PHP_FUNCTION(fbsql_drop_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - int i, status; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status != FBStopped) - { - char* txt = "Unknown status"; - if (status == FBStopped ) txt = "stopped"; - else if (status == FBUnknownStatus) txt = "nonexisting"; - else if (status == FBStarting ) txt = "starting"; - else if (status == FBRunning ) txt = "running"; - else if (status == FBStopping ) txt = "stopping"; - else if (status == FBNoExec ) txt = "no exec"; - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not drop %s@%s, database is %s", databaseName, phpLink->hostName, txt); - RETURN_FALSE; - } - - if (!fbcehDeleteDatabaseNamed(phpLink->execHandler, databaseName)) - { - char* error = fbechErrorMessage(phpLink->execHandler); - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not drop %s@%s. %s", databaseName, phpLink->hostName, error); - RETURN_FALSE; - } - for (i=0; i < 20; i++) - { -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBUnknownStatus) break; - } - if (status != FBUnknownStatus) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database %s@%s dropped -- status unknown", databaseName, phpLink->hostName); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool fbsql_start_db(string database_name [, resource link_identifier [, string database_options]]) - Start a database on the server */ -PHP_FUNCTION(fbsql_start_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name, **database_options; - int id; - int i, status; - char *databaseName, *databaseOptions = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - case 3: - if (zend_get_parameters_ex(3, &database_name, &fbsql_link_index, &database_options)==FAILURE) { - RETURN_FALSE; - } - id = -1; - convert_to_string_ex(database_options); - databaseOptions = Z_STRVAL_PP(database_options); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if ((status != FBStopped) && (status != FBRunning) && (status != FBStarting)) - { - char* txt = "Unknown status"; - if (status == FBStopped ) txt = "stopped"; - else if (status == FBStarting) txt = "starting"; - else if (status == FBRunning ) txt = "running"; - else if (status == FBStopping) txt = "stopping"; - else if (status == FBNoExec ) txt = "no exec"; - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not start %s@%s, as database is %s", databaseName, phpLink->hostName, txt); - RETURN_FALSE; - } - - if (status == FBStopped) - { - int dbstarted; - if (databaseOptions != NULL) - { - dbstarted = fbcehStartDatabaseNamedWithOptions(phpLink->execHandler, databaseName, databaseOptions); - } - else - { - dbstarted = fbcehStartDatabaseNamed(phpLink->execHandler, databaseName); - } - if (!dbstarted) - { - char* error = fbechErrorMessage(phpLink->execHandler); - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not start %s@%s. %s", databaseName, phpLink->hostName, error); - RETURN_FALSE; - } - } - - for (i=0; i < 20; i++) - { -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBRunning) break; - } - if (status != FBRunning) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database %s@%s started -- status unknown", databaseName, phpLink->hostName); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool fbsql_stop_db(string database_name [, resource link_identifier]) - Stop a database on the server */ -PHP_FUNCTION(fbsql_stop_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - int i, status; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (!php_fbsql_select_db(databaseName, phpLink TSRMLS_CC)) { - RETURN_FALSE; - } - -/* printf("Stop db %x\n", phpDatabase->connection); */ - if (!fbcdcStopDatabase(phpLink->connection)) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot stop database %s@%s", databaseName, phpLink->hostName); - RETURN_FALSE; - } - - for (i=0; i < 20; i++) - { - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBStopped) break; -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int fbsql_db_status(string database_name [, resource link_identifier]) - Gets the status (Stopped, Starting, Running, Stopping) for a given database */ -PHP_FUNCTION(fbsql_db_status) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - if (phpLink->execHandler) { - RETURN_LONG(fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName)); - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ mdOk - */ -int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql) -{ - FBCDatabaseConnection* c = link->connection; - int result = 1; - TSRMLS_FETCH(); - - link->errorNo = 0; - if (link->errorText) - { - free(link->errorText); - link->errorText = NULL; - } - if (md == NULL) - { - link->errorNo = 1; - link->errorText = strdup("Connection to database server was lost"); - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", link->errorText); - result = 0; - } - else if (fbcmdErrorsFound(md)) - { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); - char* emg = fbcemdAllErrorMessages(emd); - if (FB_SQL_G(generateWarnings)) - { - if (emg) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in statement: '%s' %s", sql, emg); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message"); - } - link->errorText = strdup(emg); - link->errorNo = fbcemdErrorCodeAtIndex(emd, 0); - free(emg); - fbcemdRelease(emd); - result = 0; - } - else if (fbcmdWarningsFound(md)) - { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); - char* emg = fbcemdAllErrorMessages(emd); - if (FB_SQL_G(generateWarnings)) - { - if (emg) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Warning in statement: '%s' %s", sql, emg); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message"); - } - link->errorText = strdup(emg); - link->errorNo = fbcemdErrorCodeAtIndex(emd, 0); - free(emg); - fbcemdRelease(emd); - result = 1; - } - return result; -} -/* }}} */ - -static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link, long batch_size) -{ - PHPFBResult* result = NULL; - FBCMetaData* md, *meta; - char* tp; - char* fh = NULL; - unsigned int sR = 1, cR = 0; - - meta = fbcdcExecuteDirectSQL(link->connection, sql); - if (!mdOk(link, meta, sql)) - { - fbcmdRelease(meta); - ZVAL_BOOL(return_value, 0) - } - else { - if (fbcmdHasMetaDataArray(meta)) { - sR = fbcmdMetaDataArrayCount(meta); - md = (FBCMetaData*)fbcmdMetaDataAtIndex(meta, cR); - } - else - md = meta; - - tp = fbcmdStatementType(md); - if (tp == NULL) { - fbcmdRelease(meta); - ZVAL_BOOL(return_value, 1) - } - else if ((tp[0] == 'C') || (tp[0] == 'R')) - { - if (sR == 1 && md) fbcmdRelease(md); - ZVAL_BOOL(return_value, 1) - } - else if ((fh = fbcmdFetchHandle(md)) || tp[0] == 'E' || (tp[0] == 'U' && fh)) - { - result = (PHPFBResult *)emalloc(sizeof(PHPFBResult)); - result->link = link; - result->rowHandler = NULL; - result->fetchHandle = NULL; - result->ResultmetaData = meta; - result->metaData = md; - result->batchSize = batch_size > 0 ? batch_size : FB_SQL_G(batchSize); - result->rowCount = 0x7fffffff; - result->columnCount = 0; - result->rowIndex = 0; - result->columnIndex = 0; - result->row = NULL; - result->array = NULL; - result->list = NULL; - result->selectResults = sR; - result->currentResult = cR; - result->lobMode = FBSQL_LOB_DIRECT; - - if (tp[0] != 'E') - { - result->columnCount = fbcmdColumnCount(md); - result->fetchHandle = fh; - } - else - { - char* r = fbcmdMessage(result->metaData); - fbcrhConvertToOutputCharSet(fbcdcOutputCharacterSet(link->connection), (unsigned char *)r); - if ((result->list = fbcplParse(r))) - { - result->rowCount = fbcplCount(result->list); - result->columnCount = 7; - } - } - ZEND_REGISTER_RESOURCE(return_value, result, le_result); - } - else if (tp[0] == 'I' || tp[0] == 'U') - { - if (tp[0] == 'I') link->insert_id = fbcmdRowIndex(md); - if (sR == 1 && md) fbcmdRelease(md); - ZVAL_BOOL(return_value, 1) - } - else if(tp[0] == 'A' || tp[0] == 'D') - { - if (sR == 1 && md) fbcmdRelease(md); - ZVAL_BOOL(return_value, 1) - } - if (link) link->affectedRows = fbcmdRowCount(md); - } -} - -/* {{{ proto resource fbsql_query(string query [, resource link_identifier [, long batch_size]]) - Send one or more SQL statements to the server and execute them */ -PHP_FUNCTION(fbsql_query) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **query, **batch_size; - int id, bs = 0; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &query)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &query, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - case 3: - if (zend_get_parameters_ex(3, &query, &fbsql_link_index, &batch_size)==FAILURE) { - RETURN_FALSE; - } - id = -1; - convert_to_long_ex(batch_size); - bs = Z_LVAL_PP(batch_size); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(query); - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink, bs); -} -/* }}} */ - -/* {{{ proto resource fbsql_db_query(string database_name, string query [, resource link_identifier]) - Send one or more SQL statements to a specified database on the server */ -PHP_FUNCTION(fbsql_db_query) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **dbname, **query; - int id; - - switch (ZEND_NUM_ARGS()) { - case 2: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(2, &dbname, &query)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &dbname, &query, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(query); - convert_to_string_ex(dbname); - - if (php_fbsql_select_db(Z_STRVAL_PP(dbname), phpLink TSRMLS_CC)) { - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink, 0); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto resource fbsql_list_dbs([resource link_identifier]) - Retreive a list of all databases on the server */ -PHP_FUNCTION(fbsql_list_dbs) -{ - PHPFBResult* phpResult; - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - phpResult = emalloc(sizeof(PHPFBResult)); - phpResult->link = phpLink; - phpResult->fetchHandle = NULL; - phpResult->rowHandler = NULL; - phpResult->ResultmetaData = NULL; - phpResult->metaData = NULL; - phpResult->batchSize = FB_SQL_G(batchSize); - phpResult->columnCount = 1; - phpResult->rowIndex = 0; - phpResult->columnIndex = 0; - phpResult->row = NULL; - phpResult->array = fbcehAvailableDatabases(phpLink->execHandler); - phpResult->rowCount = fbaCount(phpResult->array); - phpResult->list = NULL; - - ZEND_REGISTER_RESOURCE(return_value, phpResult, le_result); -} -/* }}} */ - -/* {{{ proto resource fbsql_list_tables(string database [, int link_identifier]) - Retreive a list of all tables from the specifoied database */ -PHP_FUNCTION(fbsql_list_tables) -{ - char* sql = "select t0.\"table_name\"from information_schema.tables t0, information_schema.SCHEMATA t1 where t0.schema_pk = t1.schema_pk and t1.\"schema_name\" = current_schema order by \"table_name\";"; - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (databaseName == NULL) { - php_fbsql_select_db(FB_SQL_G(databaseName), phpLink TSRMLS_CC); - } else { - php_fbsql_select_db(databaseName, phpLink TSRMLS_CC); - } - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink, 0); -} -/* }}} */ - -/* {{{ proto resource fbsql_list_fields(string database_name, string table_name [, resource link_identifier]) - Retrieve a list of all fields for the specified database.table */ -PHP_FUNCTION(fbsql_list_fields) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name, **table_name; - int id; - char *databaseName, *tableName; - char sql[1024]; - - switch (ZEND_NUM_ARGS()) { - case 2: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(2, &database_name, &table_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &database_name, &table_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - convert_to_string_ex(table_name); - tableName = Z_STRVAL_PP(table_name); - - if (!php_fbsql_select_db(databaseName, phpLink TSRMLS_CC)) { - RETURN_FALSE; - } - - if (snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE 1=0;", tableName) < 0) { - RETURN_FALSE; - } - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink, 0); -} -/* }}} */ - -/* {{{ proto string fbsql_error([resource link_identifier]) - Returns the last error string */ -PHP_FUNCTION(fbsql_error) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (phpLink->errorText == NULL) { - RETURN_FALSE; - } - else { - RETURN_STRING(phpLink->errorText, 1); - } -} -/* }}} */ - -/* {{{ proto int fbsql_errno([resource link_identifier]) - Returns the last error code */ -PHP_FUNCTION(fbsql_errno) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - RETURN_LONG(phpLink->errorNo); -} -/* }}} */ - -/* {{{ proto bool fbsql_warnings([int flag]) - Enable or disable FrontBase warnings */ -PHP_FUNCTION(fbsql_warnings) -{ - int argc = ZEND_NUM_ARGS(); - zval **argv[1]; - - if ((argc < 0) || (argc > 1)) WRONG_PARAM_COUNT; - if (zend_get_parameters_ex(argc, &argv[0])==FAILURE) RETURN_FALSE; - if (argc >= 1) - { - convert_to_long_ex(argv[0]); - FB_SQL_G(generateWarnings) = Z_LVAL_PP(argv[0]) != 0; - } - RETURN_BOOL(FB_SQL_G(generateWarnings)); -} -/* }}} */ - -/* {{{ proto int fbsql_affected_rows([resource link_identifier]) - Get the number of rows affected by the last statement */ -PHP_FUNCTION(fbsql_affected_rows) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - RETURN_LONG(phpLink->affectedRows); -} -/* }}} */ - -/* {{{ proto int fbsql_rows_fetched(resource result) - Get the number of rows affected by the last statement */ -PHP_FUNCTION(fbsql_rows_fetched) -{ - PHPFBResult* phpResult = NULL; - zval **result = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &result)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(phpResult, PHPFBResult *, result, id, "FrontBase-Result", le_result); - - if (!phpResult->rowHandler) { - RETURN_FALSE; - } - else { - RETURN_LONG(fbcrhRowCount(phpResult->rowHandler)); - } -} -/* }}} */ - -/* {{{ proto int fbsql_insert_id([resource link_identifier]) - Get the internal index for the last insert statement */ -PHP_FUNCTION(fbsql_insert_id) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - RETURN_LONG(phpLink->insert_id); -} -/* }}} */ - -/* {{{ phpSizeOfInt - */ -int phpSizeOfInt (int i) -{ - int s = 1; - if (i < 0) - { - s++; - i = -i; - } - while ((i = i / 10)) s++; - return s; -} -/* }}} */ - -void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* length, char** value TSRMLS_DC) -{ - FBCMetaData* md = result->metaData; - const FBCDatatypeMetaData* dtmd = fbcmdDatatypeMetaDataAtIndex(md, column); - unsigned dtc = fbcdmdDatatypeCode(dtmd); - switch (dtc) - { - case FB_Boolean: - { - unsigned char v = *((unsigned char*)(data)); - if (v == 255) - phpfbestrdup("Unknown", length, value); - else if (v == 0) - phpfbestrdup("False", length, value); - else - phpfbestrdup("True", length, value); - } - break; - - case FB_PrimaryKey: - case FB_Integer: - { - int v = *((int*)data); - char b[128]; - snprintf(b, sizeof(b), "%d", v); - phpfbestrdup(b, length, value); - } - break; -#ifdef FB_TinyInteger - case FB_TinyInteger: - { - short int v = *((FBTinyInteger*)data); - char b[128]; - snprintf(b, sizeof(b), "%d", v); - phpfbestrdup(b, length, value); - } - break; -#endif -#ifdef FB_LongInteger - case FB_LongInteger: - { - FBLongInteger v = *((FBLongInteger*)data); - char b[128]; -#ifdef PHP_WIN32 - snprintf(b, sizeof(b), "%I64i", v); -#else - snprintf(b, sizeof(b), "%ll", v); -#endif - phpfbestrdup(b, length, value); - } - break; -#endif - case FB_SmallInteger: - { - short v = *((short*)data); - char b[128]; - snprintf(b, sizeof(b), "%d", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_Float: - case FB_Real: - case FB_Double: - { - double v = *((double*)data); - char b[128]; - snprintf(b, sizeof(b), "%F", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_Numeric: - case FB_Decimal: - { - unsigned precision = fbcdmdPrecision(dtmd); - unsigned scale = fbcdmdScale(dtmd); - double v = *((double*)data); - char b[128]; - snprintf(b, sizeof(b), "%.*F", scale, v); - phpfbestrdup(b, length, value); - } - break; - - case FB_Character: - case FB_VCharacter: - { - char* v = (char*)data; - phpfbestrdup(v, length, value); - } - break; - - case FB_Bit: - case FB_VBit: - { - const FBCColumnMetaData* clmd = fbcmdColumnMetaDataAtIndex(md, column); - struct bitValue - { - unsigned int nBytes; - unsigned char* bytes; - }; - struct bitValue* ptr = data; - unsigned nBits = ptr->nBytes * 8; - - if (dtc == FB_Bit) nBits = fbcdmdLength(fbccmdDatatype(clmd)); - if (nBits %8 == 0) - { - unsigned i; - unsigned int l = nBits / 8; - *length = l*2+3+1; - if (value) - { - char* r = safe_emalloc(l, 2, 4); - r[0] = 'X'; - r[1] = '\''; - for (i = 0; i < nBits / 8; i++) - { - char c[4]; - snprintf(c, sizeof(c), "%02x", ptr->bytes[i]); - r[i*2+2] = c[0]; - r[i*2+3] = c[1]; - } - r[i*2+2] = '\''; - r[i*2+3] = 0; - *value = r; - } - } - else - { - unsigned i; - unsigned int l = nBits; - *length = l*2+3+1; - if (value) - { - char* r = safe_emalloc(l, 2, 4); - r[0] = 'B'; - r[1] = '\''; - for (i = 0; i < nBits; i++) - { - int bit = 0; - if (i/8 < ptr->nBytes) bit = ptr->bytes[i/8] & (1<<(7-(i%8))); - r[i*2+2] = bit?'1':'0'; - } - r[i*2+2] = '\''; - r[i*2+3] = 0; - *value = r; - } - } - } - break; - - case FB_Date: - case FB_Time: - case FB_TimeTZ: - case FB_TimestampTZ: - { - char* v = (char*)data; - phpfbestrdup(v, length, value); - } - break; - - case FB_Timestamp: - { - char* v = (char*)data; - if (FB_SQL_G(showTimestampDecimals)) { - phpfbestrdup(v, length, value); - } - // Copy only YYYY-MM-DD HH:MM:SS - else { - int stringLength = strlen(v); - stringLength = min(stringLength, 19); - if (value) { - char* r = emalloc(stringLength+1); - memcpy(r, v, stringLength); - r[stringLength] = 0; - *value = r; - } - *length = stringLength; - } - } - break; - - case FB_YearMonth: - { - char b[128]; - int v = *((unsigned int*)data); - snprintf(b, sizeof(b), "%d", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_DayTime: - { - char b[128]; - double seconds = *((double*)data); - snprintf(b, sizeof(b), "%F", seconds); - phpfbestrdup(b, length, value); - } - break; - - case FB_CLOB: - case FB_BLOB: - { - if (*((unsigned char*) data) == '\1') - { /* Direct */ - *length = ((FBCBlobDirect *)data)->blobSize; - *value = estrndup((char *)((FBCBlobDirect *)data)->blobData, *length); - } - else - { - FBCBlobHandle *lobHandle; - unsigned char *bytes = (unsigned char *)data; - char *handle = (char *)(&bytes[1]); - lobHandle = fbcbhInitWithHandle(handle); - *length = fbcbhBlobSize(lobHandle); - - if (result->lobMode == FBSQL_LOB_HANDLE) { - phpfbestrdup(fbcbhDescription(lobHandle), length, value); - } - else { - if (dtc == FB_BLOB) - *value = estrndup((char *)fbcdcReadBLOB(result->link->connection, lobHandle), *length); - else - *value = estrndup((char *)fbcdcReadCLOB(result->link->connection, lobHandle), *length); - } - fbcbhRelease(lobHandle); - } - } - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unimplemented type (%d)", dtc); - break; - } -} - -/* {{{ phpfbSqlResult - */ -void phpfbSqlResult(INTERNAL_FUNCTION_PARAMETERS, PHPFBResult* result, int rowIndex, int columnIndex) -{ - void** row; - if (result->list) - { - FBCPList* columns = (FBCPList*)fbcplValueForKey(result->list, "COLUMNS"); - FBCPList* column = (FBCPList*)fbcplValueAtIndex(columns, result->rowIndex); - if (columnIndex == 0) - { /* Name */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column, "NAME"); - RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); - } - else if (columnIndex == 2) - { /* Length */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column, "WIDTH"); - RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); - } - else if (columnIndex == 1) - { /* Type */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column, "DATATYPE"); - RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); - } - else if (columnIndex == 3) - { /* Flags */ - RETURN_STRING("", 1); - } - else - { - RETURN_STRING("", 1); - } - } - else if (result->array) - { /* Special case for get dbs */ - RETURN_STRING(fbaObjectAtIndex(result->array, rowIndex), 1); - } - else if (!phpfbFetchRow(result, rowIndex)) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such row %d in result set %d", rowIndex, rowIndex); - RETURN_FALSE; - } - else if (columnIndex >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such column %d in result set %d", columnIndex, rowIndex); - RETURN_FALSE; - } - else - { - row = fbcrhRowAtIndex(result->rowHandler, rowIndex); - if (row == NULL) - { - RETURN_FALSE; - } - else if (row[columnIndex]) - { - phpfbColumnAsString(result, columnIndex, row[columnIndex], &Z_STRLEN_P(return_value), &Z_STRVAL_P(return_value) TSRMLS_CC); - Z_TYPE_P(return_value) = IS_STRING; - } - else - { - RETURN_NULL(); - } - } -} -/* }}} */ - -/* {{{ proto mixed fbsql_result(int result [, int row [, mixed field]]) - ??? */ -PHP_FUNCTION(fbsql_result) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **row = NULL, **field = NULL; - int rowIndex; - int columnIndex; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &row)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &fbsql_result_index, &row, &field)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - rowIndex = result->rowIndex; - if (row) - { - convert_to_long_ex(row); - rowIndex = Z_LVAL_PP(row); - } - - columnIndex = result->columnIndex; - if (field) - { - if ((Z_TYPE_PP(field) == IS_STRING) && (result->metaData)) - { - for (columnIndex =0; columnIndex < result->columnCount; columnIndex ++) - { - const FBCColumnMetaData* cmd = fbcmdColumnMetaDataAtIndex(result->metaData, columnIndex); - const char* lbl = fbccmdLabelName(cmd); - if (strcmp((char*)lbl, Z_STRVAL_PP(field)) == 0) break; - } - if (columnIndex == result->columnCount) RETURN_FALSE; - } - else - { - convert_to_long_ex(field); - columnIndex = Z_LVAL_PP(field); - if (columnIndex < 0) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal column index - %d", columnIndex); - RETURN_FALSE; - } - } - } - - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, rowIndex, columnIndex); - - result->columnIndex++; - if (result->columnIndex == result->columnCount) - { - result->rowIndex++; - result->columnIndex = 0; - } -} -/* }}} */ - -/* {{{ proto bool fbsql_next_result(int result) - Switch to the next result if multiple results are available */ -PHP_FUNCTION(fbsql_next_result) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - result->currentResult++; - if (result->currentResult < result->selectResults) { - if (result->fetchHandle) { - FBCMetaData *md = fbcdcCancelFetch(result->link->connection, result->fetchHandle); - fbcmdRelease(md); - } - if (result->rowHandler) fbcrhRelease(result->rowHandler); - result->metaData = (FBCMetaData*)fbcmdMetaDataAtIndex(result->ResultmetaData, result->currentResult); - result->fetchHandle = fbcmdFetchHandle(result->metaData); - result->rowHandler = NULL; - result->batchSize = FB_SQL_G(batchSize); - result->rowCount = 0x7fffffff; - result->columnCount = fbcmdColumnCount(result->metaData);; - result->rowIndex = 0; - result->columnIndex = 0; - result->row = NULL; - result->array = NULL; - result->list = NULL; - if (result->link) - result->link->affectedRows = fbcmdRowCount(result->metaData); - - RETURN_TRUE; - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int fbsql_num_rows(int result) - Get number of rows */ -PHP_FUNCTION(fbsql_num_rows) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - int rowCount; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - if (result->array) - rowCount = result->rowCount; - else { - rowCount = fbcmdRowCount(result->metaData); - if (rowCount == -1) - { - phpfbFetchRow(result, 0x7fffffff); - rowCount = result->rowCount; - } - } - RETURN_LONG(rowCount); -} -/* }}} */ - -/* {{{ proto int fbsql_num_fields(int result) - Get number of fields in the result set */ -PHP_FUNCTION(fbsql_num_fields) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - RETURN_LONG(result->columnCount); -} -/* }}} */ - -/* {{{ proto array fbsql_fetch_row(resource result) - Fetch a row of data. Returns an indexed array */ -PHP_FUNCTION(fbsql_fetch_row) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_NUM, 1); -} -/* }}} */ - -/* {{{ proto object fbsql_fetch_assoc(resource result) - Detch a row of data. Returns an assoc array */ -PHP_FUNCTION(fbsql_fetch_assoc) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 1); -} -/* }}} */ - -/* {{{ proto object fbsql_fetch_object(resource result [, int result_type]) - Fetch a row of data. Returns an object */ -PHP_FUNCTION(fbsql_fetch_object) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 2); - if (Z_TYPE_P(return_value)==IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} -/* }}} */ - -/* {{{ proto array fbsql_fetch_array(resource result [, int result_type]) - Fetches a result row as an array (associative, numeric or both)*/ -PHP_FUNCTION(fbsql_fetch_array) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_BOTH, 2); -} -/* }}} */ - -static void _parse_list(zval** return_value, FBCPList* list) -{ - int count = fbcplCount(list); - int i,j; - - for (i=0; i expected_args) { - WRONG_PARAM_COUNT; - } - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &zresult_type)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(zresult_type); - result_type = Z_LVAL_PP(zresult_type); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - rowIndex = result->rowIndex; - if (((result_type & FBSQL_NUM) != FBSQL_NUM) && ((result_type & FBSQL_ASSOC) != FBSQL_ASSOC)) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal result type use FBSQL_NUM, FBSQL_ASSOC, or FBSQL_BOTH"); - RETURN_FALSE; - } - array_init(return_value); - if (result->fetchHandle == NULL) - { - if (result->array == NULL && result->list == NULL) - { - RETURN_FALSE; - } - if (result->rowIndex >= result->rowCount) - { - RETURN_FALSE; - } - if (result->list) { - char* key; - FBCPList* value; - - value = (FBCPList*)fbcplValueAtIndex(result->list, result->rowIndex); - key = (char*)fbcplKeyAtIndex(result->list, result->rowIndex); - - if (key && key[0] == 2) - key = NULL; - - if (fbcplIsDictionary(value)) { - zval *value_array; - - MAKE_STD_ZVAL(value_array); - array_init(value_array); - - _parse_list(&value_array, value); - if (result_type & FBSQL_NUM || key == NULL) - { - add_index_zval(return_value, 0, value_array); - } - if (result_type & FBSQL_ASSOC && key != NULL) - { - add_assoc_zval(return_value, key, value_array); - } - } - else if (fbcplIsArray(value)) { - zval *value_array; - int valcount = fbcplCount(value); - int j; - - MAKE_STD_ZVAL(value_array); - array_init(value_array); - - for (j=0; jarray, result->rowIndex)), 0); - } - if (result_type & FBSQL_ASSOC) - { - add_assoc_string(return_value, "Database", estrdup(fbaObjectAtIndex(result->array, result->rowIndex)), 0); - } - } - } - else { - if (result->rowCount == 0) { - RETURN_FALSE; - } - if (result->rowCount == 0x7fffffff) - { - if (!phpfbFetchRow(result, result->rowIndex)) { - RETURN_FALSE; - } - } - row = fbcrhRowAtIndex(result->rowHandler, rowIndex); - if (row == NULL) - { - RETURN_FALSE; - } - for (i=0; i < result->columnCount; i++) - { - if (row[i]) - { - char* value; - unsigned int length; - unsigned int c = 0; - phpfbColumnAsString(result, i, row[i], &length, &value TSRMLS_CC); - if (result_type & FBSQL_NUM) - { - add_index_stringl(return_value, i, value, length, c); - c = 1; - } - if (result_type & FBSQL_ASSOC) - { - char* key = (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, i)); - add_assoc_stringl(return_value, key, value, length, c); - } - } - else - { - if (result_type & FBSQL_NUM) - { - add_index_unset(return_value, i); - } - if (result_type & FBSQL_ASSOC) - { - char* key = (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, i)); - add_assoc_unset(return_value, key); - } - } - } - } - result->rowIndex++; - result->columnIndex = 0; -} - -/* {{{ proto bool fbsql_data_seek(int result, int row_number) - Move the internal row counter to the specified row_number */ -PHP_FUNCTION(fbsql_data_seek) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **row_number = NULL; - unsigned int rowIndex; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &row_number)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - convert_to_long_ex(row_number); - rowIndex = Z_LVAL_PP(row_number); - - if (rowIndex < 0) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal row_index (%d)", rowIndex); - RETURN_FALSE; - } - - if (result->rowCount == 0x7fffffff) phpfbFetchRow(result, rowIndex); - if (rowIndex > result->rowCount) RETURN_FALSE; - result->rowIndex = rowIndex; - result->columnIndex = 0; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array fbsql_fetch_lengths(int result) - Returns an array of the lengths of each column in the result set */ -PHP_FUNCTION(fbsql_fetch_lengths) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - int i; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - if (result->row == NULL) RETURN_FALSE; - array_init(return_value); - for (i=0; i < result->columnCount; i++) - { - unsigned length = 0; - if (result->row[i]) phpfbColumnAsString(result, i, result->row[i], &length, NULL TSRMLS_CC); - add_index_long(return_value, i, length); - } -} -/* }}} */ - -/* {{{ proto object fbsql_fetch_field(int result [, int field_index]) - Get the field properties for a specified field_index */ -PHP_FUNCTION(fbsql_fetch_field) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - object_init(return_value); - - add_property_string(return_value, "name", (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); - add_property_string(return_value, "table", (char*)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); - add_property_long(return_value, "max_length", fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData, column)))); - add_property_string(return_value, "type", (char*)fbcdmdDatatypeString(fbcmdDatatypeMetaDataAtIndex(result->metaData, column)), 1); - add_property_long(return_value, "not_null", !fbccmdIsNullable(fbcmdColumnMetaDataAtIndex(result->metaData, column))); -/* Remember to add the rest */ -/* add_property_long(return_value, "primary_key", IS_PRI_KEY(fbsql_field->flags)?1:0); */ -/* add_property_long(return_value, "multiple_key", (fbsql_field->flags&MULTIPLE_KEY_FLAG?1:0)); */ -/* add_property_long(return_value, "unique_key", (fbsql_field->flags&UNIQUE_KEY_FLAG?1:0)); */ -/* add_property_long(return_value, "numeric", IS_NUM(Z_TYPE_P(fbsql_field))?1:0); */ -/* add_property_long(return_value, "blob", IS_BLOB(fbsql_field->flags)?1:0); */ -/* add_property_long(return_value, "unsigned", (fbsql_field->flags&UNSIGNED_FLAG?1:0)); */ -/* add_property_long(return_value, "zerofill", (fbsql_field->flags&ZEROFILL_FLAG?1:0)); */ -} -/* }}} */ - -/* {{{ proto bool fbsql_field_seek(int result [, int field_index]) - ??? */ -PHP_FUNCTION(fbsql_field_seek) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - - result->columnIndex = column; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string fbsql_field_name(int result [, int field_index]) - Get the column name for a specified field_index */ -PHP_FUNCTION(fbsql_field_name) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (result->list) - { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 0); - } - else if (result->metaData) - { - RETURN_STRING((char *)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); - result->columnIndex = column; - } -} -/* }}} */ - -/* {{{ proto string fbsql_field_table(int result [, int field_index]) - Get the table name for a specified field_index */ -PHP_FUNCTION(fbsql_field_table) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - RETURN_STRING((char *)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); -} -/* }}} */ - -/* {{{ proto mixed fbsql_field_len(int result [, int field_index]) - Get the column length for a specified field_index */ -PHP_FUNCTION(fbsql_field_len) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (result->list) - { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 2); - } - else if (result->metaData) - { - RETURN_LONG(fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData, column)))); - } - else - { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string fbsql_field_type(int result [, int field_index]) - Get the field type for a specified field_index */ -PHP_FUNCTION(fbsql_field_type) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (result->list) - { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 1); - } - else if (result->metaData) - { - RETURN_STRING((char *)fbcdmdDatatypeString (fbcmdDatatypeMetaDataAtIndex(result->metaData, column)), 1); - } - else - { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string fbsql_field_flags(int result [, int field_index]) - ??? */ -PHP_FUNCTION(fbsql_field_flags) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - char buf[512]; - int len; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - strcpy(buf, ""); - if (!fbccmdIsNullable(fbcmdColumnMetaDataAtIndex(result->metaData, column))) { - strcat(buf, "not_null "); - } -#if 0 - if (IS_PRI_KEY(fbsql_field->flags)) { - strcat(buf, "primary_key "); - } - if (fbsql_field->flags&UNIQUE_KEY_FLAG) { - strcat(buf, "unique_key "); - } - if (fbsql_field->flags&MULTIPLE_KEY_FLAG) { - strcat(buf, "multiple_key "); - } - if (IS_BLOB(fbsql_field->flags)) { - strcat(buf, "blob "); - } - if (fbsql_field->flags&UNSIGNED_FLAG) { - strcat(buf, "unsigned "); - } - if (fbsql_field->flags&ZEROFILL_FLAG) { - strcat(buf, "zerofill "); - } - if (fbsql_field->flags&BINARY_FLAG) { - strcat(buf, "binary "); - } - if (fbsql_field->flags&ENUM_FLAG) { - strcat(buf, "enum "); - } - if (fbsql_field->flags&AUTO_INCREMENT_FLAG) { - strcat(buf, "auto_increment "); - } - if (fbsql_field->flags&TIMESTAMP_FLAG) { - strcat(buf, "timestamp "); - } -#endif - len = strlen(buf); - /* remove trailing space, if present */ - if (len && buf[len-1] == ' ') { - buf[len-1] = 0; - len--; - } - RETURN_STRING(buf, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_table_name(resource result, int index) - Retreive the table name for index after a call to fbsql_list_tables() */ -PHP_FUNCTION(fbsql_table_name) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **table_index; - unsigned index; - char* value; - unsigned int length; - void** row; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &table_index)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(table_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - index = Z_LVAL_PP(table_index); - if (index < 0) - { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal index (%i)", index); - RETURN_FALSE; - } - - if (result->rowCount == 0x7fffffff) phpfbFetchRow(result, index); - if (index > result->rowCount) RETURN_FALSE; - result->rowIndex = index; - result->columnIndex = 0; - - row = fbcrhRowAtIndex(result->rowHandler, index); - phpfbColumnAsString(result, 0, row[0], &length, &value TSRMLS_CC); - RETURN_STRINGL(value, length, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_free_result(resource result) - free the memory used to store a result */ -PHP_FUNCTION(fbsql_free_result) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - zend_list_delete(Z_LVAL_PP(fbsql_result_index)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array fbsql_get_autostart_info([resource link_identifier]) - ??? */ -PHP_FUNCTION(fbsql_get_autostart_info) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - FBCAutoStartInfo* asInfo; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128); - if (phpLink->execHandler == NULL) { - if (FB_SQL_G(generateWarnings)) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No valid Exec handler available for this connection"); - RETURN_FALSE; - } - else { - array_init(return_value); - asInfo = fbcehGetAutoStartInfo(phpLink->execHandler); - if (asInfo != NULL) { - unsigned i; - - for (i=0; iinfoLines); i++) { - FBArray* infoLine = fbaObjectAtIndex(asInfo->infoLines, i); -/* - if (fbaCount(infoLine) == 2) { - fbaObjectAtIndex(infoLine, 0); - fbaObjectAtIndex(infoLine, 1); - } - else { -*/ - add_index_string(return_value, i, fbaObjectAtIndex(infoLine, 0), 1); -/* } - */ - - } - } - } -} -/* }}} */ - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/fbsql/php_fbsql.h b/ext/fbsql/php_fbsql.h deleted file mode 100644 index 8475333af8c46..0000000000000 --- a/ext/fbsql/php_fbsql.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Frank M. Kromann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define HAVE_FBSQL 1 - -#ifndef _PHP_FBSQL_H -#define _PHP_FBSQL_H - -#if COMPILE_DL_FBSQL -#undef HAVE_FBSQL -#define HAVE_FBSQL 1 -#endif -#if HAVE_FBSQL - -extern zend_module_entry fbsql_module_entry; -#define fbsql_module_ptr &fbsql_module_entry - -#include - -PHP_MINIT_FUNCTION(fbsql); -PHP_MSHUTDOWN_FUNCTION(fbsql); -PHP_RINIT_FUNCTION(fbsql); -PHP_RSHUTDOWN_FUNCTION(fbsql); -PHP_MINFO_FUNCTION(fbsql); -PHP_FUNCTION(fbsql_connect); -PHP_FUNCTION(fbsql_pconnect); -PHP_FUNCTION(fbsql_close); -PHP_FUNCTION(fbsql_select_db); -PHP_FUNCTION(fbsql_set_characterset); -PHP_FUNCTION(fbsql_change_user); -PHP_FUNCTION(fbsql_create_db); -PHP_FUNCTION(fbsql_drop_db); -PHP_FUNCTION(fbsql_start_db); -PHP_FUNCTION(fbsql_stop_db); -PHP_FUNCTION(fbsql_db_status); -PHP_FUNCTION(fbsql_query); -PHP_FUNCTION(fbsql_db_query); -PHP_FUNCTION(fbsql_list_dbs); -PHP_FUNCTION(fbsql_list_tables); -PHP_FUNCTION(fbsql_list_fields); -PHP_FUNCTION(fbsql_error); -PHP_FUNCTION(fbsql_errno); -PHP_FUNCTION(fbsql_affected_rows); -PHP_FUNCTION(fbsql_rows_fetched); -PHP_FUNCTION(fbsql_insert_id); -PHP_FUNCTION(fbsql_result); -PHP_FUNCTION(fbsql_next_result); -PHP_FUNCTION(fbsql_num_rows); -PHP_FUNCTION(fbsql_num_fields); -PHP_FUNCTION(fbsql_fetch_row); -PHP_FUNCTION(fbsql_fetch_array); -PHP_FUNCTION(fbsql_fetch_assoc); -PHP_FUNCTION(fbsql_fetch_object); -PHP_FUNCTION(fbsql_data_seek); -PHP_FUNCTION(fbsql_fetch_lengths); -PHP_FUNCTION(fbsql_fetch_field); -PHP_FUNCTION(fbsql_field_seek); -PHP_FUNCTION(fbsql_free_result); -PHP_FUNCTION(fbsql_field_name); -PHP_FUNCTION(fbsql_field_table); -PHP_FUNCTION(fbsql_field_len); -PHP_FUNCTION(fbsql_field_type); -PHP_FUNCTION(fbsql_field_flags); -PHP_FUNCTION(fbsql_table_name); - -PHP_FUNCTION(fbsql_set_transaction); -PHP_FUNCTION(fbsql_autocommit); -PHP_FUNCTION(fbsql_commit); -PHP_FUNCTION(fbsql_rollback); - -PHP_FUNCTION(fbsql_create_blob); -PHP_FUNCTION(fbsql_create_clob); -PHP_FUNCTION(fbsql_set_lob_mode); -PHP_FUNCTION(fbsql_read_blob); -PHP_FUNCTION(fbsql_read_clob); -PHP_FUNCTION(fbsql_blob_size); -PHP_FUNCTION(fbsql_clob_size); - -PHP_FUNCTION(fbsql_hostname); -PHP_FUNCTION(fbsql_database); -PHP_FUNCTION(fbsql_database_password); -PHP_FUNCTION(fbsql_username); -PHP_FUNCTION(fbsql_password); -PHP_FUNCTION(fbsql_warnings); -PHP_FUNCTION(fbsql_set_password); - -PHP_FUNCTION(fbsql_get_autostart_info); -/* PHP_FUNCTION(fbsql_set_autostart_info); */ - -static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args); -static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent); - -ZEND_BEGIN_MODULE_GLOBALS(fbsql) - zend_bool allowPersistent; - zend_bool generateWarnings; - zend_bool autoCommit; - zend_bool showTimestampDecimals; - long maxPersistent; - long maxLinks; - long maxConnections; - long maxResults; - long batchSize; - char *hostName; - char *databaseName; - char *databasePassword; - char *userName; - char *userPassword; - long persistentCount; - long linkCount; - long linkIndex; -ZEND_END_MODULE_GLOBALS(fbsql) - -#ifdef ZTS -# define FB_SQL_G(v) TSRMG(fbsql_globals_id, zend_fbsql_globals *, v) -#else -# define FB_SQL_G(v) (fbsql_globals.v) -#endif - -/*#ifndef ZTS /* No need for external definitions */ -/*extern fbsql_module* phpfbModule; */ -/*#endif */ - -#else /* HAVE_FBSQL */ - -#define fbsql_module_ptr NULL -#error not ok -#endif /* HAVE_FBSQL */ - -#define phpext_fbsql_ptr fbsql_module_ptr - -#endif /* _PHP_FBSQL_H */ diff --git a/ext/fdf/CREDITS b/ext/fdf/CREDITS deleted file mode 100644 index 57c33cc4b3d8c..0000000000000 --- a/ext/fdf/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FDF -Uwe Steinmann diff --git a/ext/fdf/config.m4 b/ext/fdf/config.m4 deleted file mode 100644 index 14fc261ec3450..0000000000000 --- a/ext/fdf/config.m4 +++ /dev/null @@ -1,73 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(fdftk, for FDF support, -[ --with-fdftk[=DIR] Include FDF support]) - -if test "$PHP_FDFTK" != "no"; then - - case $host_os in - aix*[)] - libtype=aix - ;; - solaris*[)] - libtype=solaris - ;; - linux*[)] - libtype=linux - ;; - *[)] - AC_MSG_ERROR([The fdf toolkit is not available for $host_os.]) - ;; - esac - - if test "$PHP_FDFTK" = "yes"; then - PHP_FDFTK="/usr/local /usr ../FDFToolkitForUNIX ext/fdf/FDFToolkitForUNIX ../fdftk ext/fdf/fdftk" - fi - - for dir in $PHP_FDFTK; do - for subdir in include HeadersAndLibraries/headers; do - if test -r $dir/$subdir/FdfTk.h; then - FDFTK_DIR=$dir - FDFTK_H_DIR=$dir/$subdir - break 2 - elif test -r $dir/$subdir/fdftk.h; then - AC_DEFINE(HAVE_FDFTK_H_LOWER,1,[ ]) - FDFTK_DIR=$dir - FDFTK_H_DIR=$dir/$subdir - break 2 - fi - done - done - - if test -z "$FDFTK_DIR"; then - AC_MSG_ERROR([FdfTk.h or fdftk.h not found. Please reinstall the fdf toolkit.]) - fi - - PHP_ADD_INCLUDE($FDFTK_H_DIR) - - FDFLIBRARY="" - for file in fdftk FdfTk; do - for dir in $FDFTK_DIR/lib $FDFTK_DIR/HeadersAndLibraries/$libtype/C; do - if test -r $dir/lib$file.so; then - PHP_CHECK_LIBRARY($file, FDFOpen, [FDFLIBRARY=$file], [], [-L$dir -lm]) - if test "$FDFLIBRARY"; then - PHP_CHECK_LIBRARY($file, FDFGetFDFVersion, [AC_DEFINE(HAVE_FDFTK_5,1,[ ])], [], [-L$dir -lm]) - FDFTK_LIB_DIR=$dir - break 2 - fi - fi - done - done - - if test -z "$FDFLIBRARY"; then - AC_MSG_ERROR(no usable fdf library found) - fi - - PHP_ADD_LIBRARY_WITH_PATH($FDFLIBRARY, $FDFTK_LIB_DIR, FDF_SHARED_LIBADD) - - PHP_NEW_EXTENSION(fdf, fdf.c, $ext_shared) - PHP_SUBST(FDF_SHARED_LIBADD) - AC_DEFINE(HAVE_FDFLIB,1,[ ]) -fi diff --git a/ext/fdf/config.w32 b/ext/fdf/config.w32 deleted file mode 100644 index befad2b816aa2..0000000000000 --- a/ext/fdf/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("fdf", "Include FDF support.", "no"); - -if (PHP_FDF != "no") { - if (CHECK_LIB("fdftk.lib", "fdf", PHP_FDF) && - CHECK_HEADER_ADD_INCLUDE("FdfTk.h", "CFLAGS_FDF")) { - EXTENSION("fdf", "fdf.c"); - AC_DEFINE('HAVE_FDFLIB', 1, 'FDF support'); - ADD_FLAG("CFLAGS_FDF", "/D HAVE_FDFTK_5"); - } else { - WARNING("fdf not enabled; libraries and headers not found"); - } -} diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c deleted file mode 100644 index 8fa4472b8d954..0000000000000 --- a/ext/fdf/fdf.c +++ /dev/null @@ -1,1864 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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 | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from - http://beta1.adobe.com/ada/acrosdk/forms.html. */ - -/* Note that there is no code from the FdfTk lib in this file */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_open_temporary_file.h" - -#if HAVE_FDFLIB - -#include "SAPI.h" -#include "ext/standard/info.h" -#include "php_open_temporary_file.h" -#include "php_variables.h" -#include "php_fdf.h" - -#ifndef S_ISDIR -#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR) -#endif - -static int le_fdf; - -SAPI_POST_HANDLER_FUNC(fdf_post_handler); - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_open, 0) - ZEND_ARG_INFO(0, filename) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_open_string, 0) - ZEND_ARG_INFO(0, fdf_data) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_create, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_close, 0) - ZEND_ARG_INFO(0, fdfdoc) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_get_value, 0, 0, 2) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, which) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_set_value, 0, 0, 3) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, value) - ZEND_ARG_INFO(0, isname) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_next_field_name, 0, 0, 1) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_ap, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, face) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, pagenr) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_ap, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, face) - ZEND_ARG_INFO(0, filename) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_encoding, 0) - ZEND_ARG_INFO(0, fdfdoc) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_status, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, status) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_status, 0) - ZEND_ARG_INFO(0, fdfdoc) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_set_file, 0, 0, 2) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, target_frame) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_file, 0) - ZEND_ARG_INFO(0, fdfdoc) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_save, 0, 0, 1) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, filename) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_save_string, 0) - ZEND_ARG_INFO(0, fdfdoc) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_add_template, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, newpage) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, template) - ZEND_ARG_INFO(0, rename) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_flags, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, whichflags) - ZEND_ARG_INFO(0, newflags) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_flags, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, whichflags) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_opt, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, element) - ZEND_ARG_INFO(0, value) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_get_opt, 0, 0, 2) - ZEND_ARG_INFO(0, fdfdof) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, element) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_submit_form_action, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, whichtrigger) - ZEND_ARG_INFO(0, url) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_javascript_action, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, whichtrigger) - ZEND_ARG_INFO(0, script) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_encoding, 0) - ZEND_ARG_INFO(0, fdf_document) - ZEND_ARG_INFO(0, encoding) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_errno, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_error, 0) - ZEND_ARG_INFO(0, errno) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_get_version, 0, 0, 0) - ZEND_ARG_INFO(0, fdfdoc) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_version, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, version) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_add_doc_javascript, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, scriptname) - ZEND_ARG_INFO(0, script) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_on_import_javascript, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, script) - ZEND_ARG_INFO(0, before_data_import) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_target_frame, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, target) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_remove_item, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, item) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_attachment, 0) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, fieldname) - ZEND_ARG_INFO(0, savepath) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_enum_values, 0, 0, 2) - ZEND_ARG_INFO(0, fdfdoc) - ZEND_ARG_INFO(0, function) - ZEND_ARG_INFO(0, userdata) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_fdf_header, 0) -ZEND_END_ARG_INFO() - -/* }}} */ - -/* {{{ fdf_functions[] - */ -zend_function_entry fdf_functions[] = { - PHP_FE(fdf_add_template, arginfo_fdf_add_template) - PHP_FE(fdf_close, arginfo_fdf_close) - PHP_FE(fdf_create, arginfo_fdf_create) - PHP_FE(fdf_enum_values, arginfo_fdf_enum_values) - PHP_FE(fdf_errno, arginfo_fdf_errno) - PHP_FE(fdf_error, arginfo_fdf_error) - PHP_FE(fdf_get_ap, arginfo_fdf_get_ap) - PHP_FE(fdf_get_encoding, arginfo_fdf_get_encoding) - PHP_FE(fdf_get_file, arginfo_fdf_get_file) - PHP_FE(fdf_get_flags, arginfo_fdf_get_flags) - PHP_FE(fdf_get_opt, arginfo_fdf_get_opt) - PHP_FE(fdf_get_status, arginfo_fdf_get_status) - PHP_FE(fdf_get_value, arginfo_fdf_get_value) - PHP_FE(fdf_get_version, arginfo_fdf_get_version) - PHP_FE(fdf_next_field_name, arginfo_fdf_next_field_name) - PHP_FE(fdf_open, arginfo_fdf_open) - PHP_FE(fdf_open_string, arginfo_fdf_open_string) - PHP_FE(fdf_remove_item, arginfo_fdf_remove_item) - PHP_FE(fdf_save, arginfo_fdf_save) - PHP_FE(fdf_save_string, arginfo_fdf_save_string) - PHP_FE(fdf_set_ap, arginfo_fdf_set_ap) - PHP_FE(fdf_set_encoding, arginfo_fdf_set_encoding) - PHP_FE(fdf_set_file, arginfo_fdf_set_file) - PHP_FE(fdf_set_flags, arginfo_fdf_set_flags) - PHP_FE(fdf_set_javascript_action, arginfo_fdf_set_javascript_action) - PHP_FE(fdf_set_opt, arginfo_fdf_set_opt) - PHP_FE(fdf_set_status, arginfo_fdf_set_status) - PHP_FE(fdf_set_submit_form_action, arginfo_fdf_set_submit_form_action) - PHP_FE(fdf_set_value, arginfo_fdf_set_value) - PHP_FE(fdf_header, arginfo_fdf_header) -#ifdef HAVE_FDFTK_5 - PHP_FE(fdf_add_doc_javascript, arginfo_fdf_add_doc_javascript) - PHP_FE(fdf_get_attachment, arginfo_fdf_get_attachment) - PHP_FE(fdf_set_on_import_javascript, arginfo_fdf_set_on_import_javascript) - PHP_FE(fdf_set_target_frame, arginfo_fdf_set_target_frame) - PHP_FE(fdf_set_version, arginfo_fdf_set_version) -#endif - {NULL, NULL, NULL} -}; -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(fdf) -static PHP_GINIT_FUNCTION(fdf); - -zend_module_entry fdf_module_entry = { - STANDARD_MODULE_HEADER, - "fdf", - fdf_functions, - PHP_MINIT(fdf), - PHP_MSHUTDOWN(fdf), - PHP_RINIT(fdf), - NULL, - PHP_MINFO(fdf), - NO_VERSION_YET, - PHP_MODULE_GLOBALS(fdf), - PHP_GINIT(fdf), - NULL, - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; - -#ifdef COMPILE_DL_FDF -ZEND_GET_MODULE(fdf) -#endif - -#define FDF_SUCCESS do { FDF_G(error)=FDFErcOK; RETURN_TRUE;} while(0) -#define FDF_FAILURE(err) do { FDF_G(error)=err; RETURN_FALSE;} while(0) - -static void phpi_FDFClose(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - FDFDoc fdf = (FDFDoc)rsrc->ptr; - - (void) FDFClose(fdf); -} - -#define FDF_POST_CONTENT_TYPE "application/vnd.fdf" - -static sapi_post_entry php_fdf_post_entry = { - FDF_POST_CONTENT_TYPE, - sizeof(FDF_POST_CONTENT_TYPE)-1, - sapi_read_standard_form_data, - fdf_post_handler -}; - -static PHP_GINIT_FUNCTION(fdf) -{ - memset(fdf_globals, 0, sizeof(*fdf_globals)); -} - - - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(fdf) -{ - le_fdf = zend_register_list_destructors_ex(phpi_FDFClose, NULL, "fdf", module_number); - - /* add handler for Acrobat FDF form post requests */ - sapi_register_post_entry(&php_fdf_post_entry TSRMLS_CC); - - - /* Constants used by fdf_set_opt() */ - REGISTER_LONG_CONSTANT("FDFValue", FDFValue, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFStatus", FDFStatus, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFile", FDFFile, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFID", FDFID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFf", FDFFf, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFSetFf", FDFSetFf, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFClearFf", FDFClearFf, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFlags", FDFFlags, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFSetF", FDFSetF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFClrF", FDFClrF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAP", FDFAP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAS", FDFAS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAction", FDFAction, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAA", FDFAA, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAPRef", FDFAPRef, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFIF", FDFIF, CONST_CS | CONST_PERSISTENT); - - /* Constants used by fdf_set_javascript_action() */ - REGISTER_LONG_CONSTANT("FDFEnter", FDFEnter, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFExit", FDFExit, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFDown", FDFDown, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFUp", FDFUp, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFormat", FDFFormat, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFValidate", FDFValidate, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FDFKeystroke", FDFKeystroke, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFCalculate", FDFCalculate, CONST_CS | CONST_PERSISTENT); - - /* Constants used by fdf_(set|get)_ap */ - REGISTER_LONG_CONSTANT("FDFNormalAP", 1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFRolloverAP", 2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFDownAP", 3, CONST_CS | CONST_PERSISTENT); - -#ifdef PHP_WIN32 - return SUCCESS; -#else - return (FDFInitialize() == FDFErcOK) ? SUCCESS : FAILURE; -#endif -} -/* }}} */ - -/* {{{ RINIT */ -PHP_RINIT_FUNCTION(fdf) -{ - FDF_G(error) = FDFErcOK; - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(fdf) -{ - /* need to use a PHPAPI function here because it is external module in windows */ - php_info_print_table_start(); - php_info_print_table_row(2, "FDF Support", "enabled"); - php_info_print_table_row(2, "FdfTk Version", FDFGetVersion() ); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(fdf) -{ - /* remove handler for Acrobat FDF form post requests */ - sapi_unregister_post_entry(&php_fdf_post_entry TSRMLS_CC); - -#ifdef PHP_WIN32 - return SUCCESS; -#else - return (FDFFinalize() == FDFErcOK) ? SUCCESS : FAILURE; -#endif -} -/* }}} */ - -/* {{{ proto resource fdf_open(string filename) - Opens a new FDF document */ -PHP_FUNCTION(fdf_open) -{ - zval **file; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(file); - - if (php_check_open_basedir(Z_STRVAL_PP(file) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(file), "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - err = FDFOpen(Z_STRVAL_PP(file), 0, &fdf); - - if(err != FDFErcOK || !fdf) { - if(err == FDFErcOK) err= FDFErcInternalError; - FDF_FAILURE(err); - } - - ZEND_REGISTER_RESOURCE(return_value, fdf, le_fdf); -} -/* }}} */ - -/* {{{ proto resource fdf_open_string(string fdf_data) - Opens a new FDF document from string */ -PHP_FUNCTION(fdf_open_string) -{ - char *fdf_data; - int fdf_data_len; - FDFDoc fdf; - FDFErc err; - char *temp_filename; - FILE *fp; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", - &fdf_data, &fdf_data_len) - == FAILURE) { - return; - } - - fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC); - if(!fp) { - RETURN_FALSE; - } - fwrite(fdf_data, fdf_data_len, 1, fp); - fclose(fp); - - err = FDFOpen(temp_filename, 0, &fdf); - unlink(temp_filename); - efree(temp_filename); - - if(err != FDFErcOK || !fdf) { - if(err == FDFErcOK) err= FDFErcInternalError; - FDF_FAILURE(err); - } - - ZEND_REGISTER_RESOURCE(return_value, fdf, le_fdf); -} -/* }}} */ - -/* {{{ proto resource fdf_create(void) - Creates a new FDF document */ -PHP_FUNCTION(fdf_create) -{ - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - err = FDFCreate(&fdf); - - if(err != FDFErcOK || !fdf) { - if(err == FDFErcOK) err= FDFErcInternalError; - FDF_FAILURE(err); - } - - ZEND_REGISTER_RESOURCE(return_value, fdf, le_fdf); -} -/* }}} */ - -/* {{{ proto void fdf_close(resource fdfdoc) - Closes the FDF document */ -PHP_FUNCTION(fdf_close) -{ - zval **fdfp; - FDFDoc fdf; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fdfp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - zend_list_delete(Z_RESVAL_PP(fdfp)); -} -/* }}} */ - -/* {{{ proto string fdf_get_value(resource fdfdoc, string fieldname [, int which]) - Gets the value of a field as string */ -PHP_FUNCTION(fdf_get_value) -{ - zval *r_fdf; - char *fieldname; - int fieldname_len; - long which = -1; - FDFDoc fdf; - FDFErc err; - ASInt32 nr, size = 256; - char *buffer; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", - &r_fdf, &fieldname, &fieldname_len, - &which) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - buffer = emalloc(size); - if(which >= 0) { -#if HAVE_FDFTK_5 - err = FDFGetNthValue(fdf, fieldname, which, buffer, size-2, &nr); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "the optional 'which' parameter requires FDF toolkit 5.0 or above, it will be ignored for now"); - which = -1; -#endif - } else { - err = FDFGetValue(fdf, fieldname, buffer, size-2, &nr); - } - if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer, nr+2); - if(which >= 0) { -#if HAVE_FDFTK_5 - err = FDFGetNthValue(fdf, fieldname, which, buffer, nr, &nr); -#endif - } else { - err = FDFGetValue(fdf, fieldname, buffer, nr, &nr); - } -#if HAVE_FDFTK_5 - } else if((err == FDFErcValueIsArray) && (which == -1)) { - array_init(return_value); - which = 0; - do { - err = FDFGetNthValue(fdf, fieldname, which, buffer, size-2, &nr); - if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer, nr+2); - err = FDFGetNthValue(fdf, fieldname, which, buffer, nr, &nr); - } - if (err == FDFErcOK) { - add_next_index_string(return_value, buffer, 1); - } - which++; - } while (err == FDFErcOK); - efree(buffer); - buffer = NULL; -#endif - } - - if((err != FDFErcOK) && (err != FDFErcNoValue)) { - if(buffer) efree(buffer); - FDF_FAILURE(err); - } - - if(buffer) { - RETVAL_STRING(buffer, 1); - efree(buffer); - } - - return; -} -/* }}} */ - -/* {{{ proto bool fdf_set_value(resource fdfdoc, string fieldname, mixed value [, int isname]) - Sets the value of a field */ -PHP_FUNCTION(fdf_set_value) -{ - zval **fdfp, **fieldname, **value, **dummy; - FDFDoc fdf; - FDFErc err; - - switch(ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, &fdfp, &fieldname, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 4: - if (zend_get_parameters_ex(4, &fdfp, &fieldname, &value, &dummy) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - default: - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - - if (Z_TYPE_PP(value) == IS_ARRAY) { -#ifdef HAVE_FDFTK_5 - ASInt32 nValues = zend_hash_num_elements(Z_ARRVAL_PP(value)); - char **newValues = ecalloc(nValues, sizeof(char *)), **next; - HashPosition pos; - zval **tmp; - - next = newValues; - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(value), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_PP(value), - (void **) &tmp, - &pos) == SUCCESS) { - convert_to_string_ex(tmp); - *next++ = estrdup(Z_STRVAL_PP(tmp)); - zend_hash_move_forward_ex(Z_ARRVAL_PP(value), &pos); - } - - err = FDFSetValues(fdf, Z_STRVAL_PP(fieldname), nValues, (const char **)newValues); - - for(next = newValues; nValues; nValues--) { - efree(*next++); - } - efree(newValues); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "setting array values is only possible with FDF toolkit 5.0 and above"); - RETURN_FALSE; -#endif - } else { - convert_to_string_ex(value); - - err = FDFSetValue(fdf, Z_STRVAL_PP(fieldname), Z_STRVAL_PP(value), (ASBool)0 /*dummy*/); - } - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto string fdf_next_field_name(resource fdfdoc [, string fieldname]) - Gets the name of the next field name or the first field name */ -PHP_FUNCTION(fdf_next_field_name) -{ - zval **fdfp, **field; - int argc=ZEND_NUM_ARGS(); - ASInt32 length=256, nr; - char *buffer=NULL, *fieldname=NULL; - FDFDoc fdf; - FDFErc err; - - if (argc > 2 || argc < 1 || zend_get_parameters_ex(argc, &fdfp, &field) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - if(argc == 2) { - convert_to_string_ex(field); - fieldname = Z_STRVAL_PP(field); - } - - buffer = emalloc(length); - err = FDFNextFieldName(fdf, fieldname, buffer, length-1, &nr); - - if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer, nr+1); - err = FDFNextFieldName(fdf, fieldname, buffer, length-1, &nr); - } - - if(err != FDFErcOK) { - efree(buffer); - FDF_FAILURE(err); - } - - RETVAL_STRING(buffer, 1); - efree(buffer); -} -/* }}} */ - -/* {{{ proto bool fdf_set_ap(resource fdfdoc, string fieldname, int face, string filename, int pagenr) - Sets the appearence of a field */ -PHP_FUNCTION(fdf_set_ap) -{ - zval **fdfp, **fieldname, **face, **filename, **pagenr; - FDFDoc fdf; - FDFErc err; - FDFAppFace facenr; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &fieldname, &face, &filename, &pagenr) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(face); - convert_to_string_ex(filename); - - if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(filename), "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - convert_to_long_ex(pagenr); - - switch(Z_LVAL_PP(face)) { - case 1: - facenr = FDFNormalAP; - break; - case 2: - facenr = FDFRolloverAP; - break; - case 3: - facenr = FDFDownAP; - break; - default: - facenr = FDFNormalAP; - break; - } - - err = FDFSetAP(fdf, Z_STRVAL_PP(fieldname), facenr, NULL, Z_STRVAL_PP(filename), (ASInt32) Z_LVAL_PP(pagenr)); - - /* This should be made more intelligent, ie. use switch() with the - possible errors this function can return. Or create global error handler function. - */ - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; - -} -/* }}} */ - -/* {{{ proto bool fdf_get_ap(resource fdfdoc, string fieldname, int face, string filename) - Gets the appearance of a field and creates a PDF document out of it. */ -PHP_FUNCTION(fdf_get_ap) { - zval *r_fdf; - char *fieldname, *filename; - int fieldname_len, filename_len; - long face; - FDFDoc fdf; - FDFErc err; - FDFAppFace facenr; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsls", - &r_fdf, &fieldname, &fieldname_len, - &face, &filename, &filename_len) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if (php_check_open_basedir(filename TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(filename, "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - switch(face) { - case 1: - facenr = FDFNormalAP; - break; - case 2: - facenr = FDFRolloverAP; - break; - case 3: - facenr = FDFDownAP; - break; - default: - facenr = FDFNormalAP; - break; - } - - err = FDFGetAP(fdf, fieldname, facenr, filename); - - /* This should be made more intelligent, ie. use switch() with the - possible errors this function can return. Or create global error handler function. - */ - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; - - -} -/* }}} */ - -/* {{{ proto string fdf_get_encoding(resource fdf) - Gets FDF file encoding scheme */ -PHP_FUNCTION(fdf_get_encoding) { - zval *r_fdf; - FDFDoc fdf; - FDFErc err; - char buffer[32]; - ASInt32 len; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", - &r_fdf) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFGetEncoding(fdf, buffer, 32, &len); - - /* This should be made more intelligent, ie. use switch() with the - possible errors this function can return. Or create global error handler function. - */ - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_G(error) = FDFErcOK; - RETURN_STRINGL(buffer, (size_t)len, 1); -} -/* }}} */ - -/* {{{ proto bool fdf_set_status(resource fdfdoc, string status) - Sets the value of /Status key */ -PHP_FUNCTION(fdf_set_status) -{ - zval **fdfp, **status; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &status) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(status); - - err = FDFSetStatus(fdf, Z_STRVAL_PP(status)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto string fdf_get_status(resource fdfdoc) - Gets the value of /Status key */ -PHP_FUNCTION(fdf_get_status) -{ - zval **fdfp; - ASInt32 nr, size = 256; - char *buf; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fdfp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - buf = emalloc(size); - err = FDFGetStatus(fdf, buf, size-1, &nr); - - if(err == FDFErcBufTooShort && nr > 0 ) { - buf = erealloc(buf, nr+1); - err = FDFGetStatus(fdf, buf, size-1, &nr); - } - - if(err != FDFErcOK) { - efree(buf); - FDF_FAILURE(err); - } - - RETVAL_STRING(buf, 1); - efree(buf); -} -/* }}} */ - -/* {{{ proto bool fdf_set_file(resource fdfdoc, string filename [, string target_frame]) - Sets the value of /F key */ -PHP_FUNCTION(fdf_set_file) -{ - zval *r_fdf; - char *filename, *target_frame= NULL; - int filename_len, target_frame_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &r_fdf, - &filename, &filename_len, - &target_frame, &target_frame_len) - == FAILURE) { - return; - } - - if (php_check_open_basedir(filename TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(filename, "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFSetFile(fdf, filename); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - if(target_frame) { -#ifdef HAVE_FDFTK_5 - err = FDFSetTargetFrame(fdf, target_frame); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "setting the target frame is only possible with FDF toolkit 5.0 and above, ignoring it for now"); -#endif - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto string fdf_get_file(resource fdfdoc) - Gets the value of /F key */ -PHP_FUNCTION(fdf_get_file) -{ - zval **fdfp; - ASInt32 nr, size = 256; - char *buf; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fdfp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - buf = emalloc(size); - err = FDFGetFile(fdf, buf, size-1, &nr); - - if(err == FDFErcBufTooShort && nr > 0 ) { - buf = erealloc(buf, nr+1); - err = FDFGetFile(fdf, buf, size-1, &nr); - } - - if(err != FDFErcOK) { - efree(buf); - FDF_FAILURE(err); - } - - RETVAL_STRING(buf, 1); - efree(buf); -} -/* }}} */ - -/* {{{ proto bool fdf_save(resource fdfdoc [, string filename]) - Writes out the FDF file */ -PHP_FUNCTION(fdf_save) -{ - zval *r_fdf; - char *filename = NULL; - int filename_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s", &r_fdf, &filename, &filename_len) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if(filename) { - if (php_check_open_basedir(filename TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(filename, "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - err = FDFSave(fdf, filename); - } else { - FILE *fp; - char *temp_filename; - - fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC); - if(!fp) { - err = FDFErcFileSysErr; - } else { - fclose(fp); - err = FDFSave(fdf, temp_filename); - - if(err == FDFErcOK) { - php_stream *stream = php_stream_open_wrapper(temp_filename, "rb", 0, NULL); - if (stream) { - php_stream_passthru(stream); - php_stream_close(stream); - } else { - err = FDFErcFileSysErr; - } - } - } - if(temp_filename) { - unlink(temp_filename); - efree(temp_filename); - } - } - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto string fdf_save_string(resource fdfdoc) - Returns the FDF file as a string */ -PHP_FUNCTION(fdf_save_string) -{ - zval *r_fdf; - FDFDoc fdf; - FDFErc err; - FILE *fp; - char *temp_filename = NULL; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fdf) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC); - if(!fp) { - err = FDFErcFileSysErr; - } else { - fclose(fp); - err = FDFSave(fdf, temp_filename); - - if(err == FDFErcOK) { - fp = fopen(temp_filename, "rb"); - if (fp) { - struct stat stat; - char *buf; - - if (fstat(fileno(fp), &stat) == -1) { - RETVAL_FALSE; - goto err; - } - buf = safe_emalloc(1, stat.st_size, 1); - fread(buf, stat.st_size, 1, fp); - buf[stat.st_size] = '\0'; - fclose(fp); - - unlink(temp_filename); - efree(temp_filename); - RETURN_STRINGL(buf, stat.st_size, 0); - } else { - err = FDFErcFileSysErr; - } - } - } - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } -err: - if(temp_filename) { - unlink(temp_filename); - efree(temp_filename); - } - - return; -} -/* }}} */ - -/* {{{ proto bool fdf_add_template(resource fdfdoc, int newpage, string filename, string template, int rename) - Adds a template into the FDF document */ -PHP_FUNCTION(fdf_add_template) -{ - zval **fdfp, **newpage, **filename, **template, **rename; - FDFDoc fdf; - FDFErc err; - pdfFileSpecRec filespec; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &newpage, &filename, &template, &rename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_long_ex(newpage); - convert_to_string_ex(filename); - convert_to_string_ex(template); - convert_to_long_ex(rename); - - if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(filename), "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - filespec.FS = NULL; - filespec.F = Z_STRVAL_PP(filename); - filespec.Mac = NULL; - filespec.DOS = NULL; - filespec.Unix = NULL; - filespec.ID[0] = NULL; - filespec.ID[1] = NULL; - filespec.bVolatile = false; - - err = FDFAddTemplate(fdf, (unsigned short)(Z_LVAL_PP(newpage)), &filespec, Z_STRVAL_PP(template), (unsigned short)(Z_LVAL_PP(rename))); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_flags(resource fdfdoc, string fieldname, int whichflags, int newflags) - Sets flags for a field in the FDF document */ -PHP_FUNCTION(fdf_set_flags) -{ - zval **fdfp, **fieldname, **flags, **newflags; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &fdfp, &fieldname, &flags, &newflags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(flags); - convert_to_long_ex(newflags); - - err=FDFSetFlags(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(flags), Z_LVAL_PP(newflags)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto int fdf_get_flags(resorce fdfdoc, string fieldname, int whichflags) - Gets the flags of a field */ -PHP_FUNCTION(fdf_get_flags) { - zval *r_fdf; - char *fieldname; - int fieldname_len; - long whichflags; - FDFDoc fdf; - FDFErc err; - ASUns32 flags; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", - &r_fdf, &fieldname, &fieldname_len, - &whichflags) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFGetFlags(fdf, fieldname, (FDFItem)whichflags, &flags); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - RETURN_LONG((long)flags); -} -/* }}} */ - -/* {{{ proto bool fdf_set_opt(resource fdfdoc, string fieldname, int element, string value, string name) - Sets a value in the opt array for a field */ -PHP_FUNCTION(fdf_set_opt) -{ - zval **fdfp, **fieldname, **element, **value, **name; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &fieldname, &element, &value, &name) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(element); - convert_to_string_ex(value); - convert_to_string_ex(name); - - err = FDFSetOpt(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(element), Z_STRVAL_PP(value), Z_STRVAL_PP(name)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto mixed fdf_get_opt(resource fdfdof, string fieldname [, int element]) - Gets a value from the opt array of a field */ -PHP_FUNCTION(fdf_get_opt) { - zval *r_fdf; - char *fieldname; - int fieldname_len; - long element = -1; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", - &r_fdf, &fieldname, &fieldname_len, - &element) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if(element == -1) { - ASInt32 elements; - err = FDFGetOpt(fdf, fieldname, (ASInt32)-1, NULL, NULL, 0, &elements); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - RETURN_LONG((long)elements); - } else { - ASInt32 bufSize, nRet; - char *buf1, *buf2; - - bufSize = 1024; - buf1 = emalloc(bufSize); - buf2 = emalloc(bufSize); - - err = FDFGetOpt(fdf, fieldname, (ASInt32)element, buf1, buf2, bufSize, &nRet); - if(err == FDFErcBufTooShort) { - efree(buf1); - efree(buf2); - buf1 = emalloc(nRet); - buf2 = emalloc(nRet); - bufSize = nRet; - err = FDFGetOpt(fdf, fieldname, (ASInt32)element, buf1, buf2, bufSize, &nRet); - } - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - array_init(return_value); - add_next_index_stringl(return_value, buf1, strlen(buf1), 1); - add_next_index_stringl(return_value, buf2, strlen(buf2), 1); - efree(buf1); - efree(buf2); - } -} -/* }}} */ - -/* {{{ proto bool fdf_set_submit_form_action(resource fdfdoc, string fieldname, int whichtrigger, string url, int flags) - Sets the submit form action for a field */ -PHP_FUNCTION(fdf_set_submit_form_action) -{ - zval **fdfp, **fieldname, **trigger, **url, **flags; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &fieldname, &trigger, &url, &flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(trigger); - convert_to_string_ex(url); - convert_to_long_ex(flags); - - err = FDFSetSubmitFormAction(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(trigger), Z_STRVAL_PP(url), Z_LVAL_PP(flags)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_javascript_action(resource fdfdoc, string fieldname, int whichtrigger, string script) - Sets the javascript action for a field */ -PHP_FUNCTION(fdf_set_javascript_action) -{ - zval **fdfp, **fieldname, **trigger, **script; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &fdfp, &fieldname, &trigger, &script) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(trigger); - convert_to_string_ex(script); - - err = FDFSetJavaScriptAction(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(trigger), Z_STRVAL_PP(script)); - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_encoding(resource fdf_document, string encoding) - Sets FDF encoding (either "Shift-JIS" or "Unicode") */ -PHP_FUNCTION(fdf_set_encoding) -{ - zval **fdfp, **enc; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &enc) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(enc); - - err = FDFSetEncoding(fdf, Z_STRVAL_PP(enc)); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ SAPI_POST_HANDLER_FUNC - * SAPI post handler for FDF forms */ -SAPI_POST_HANDLER_FUNC(fdf_post_handler) -{ - FILE *fp; - FDFDoc theFDF; - char *name=NULL, *value=NULL, *p, *data; - int name_len=0, value_len=0; - char *lastfieldname =NULL; - char *filename = NULL; - FDFErc err; - ASInt32 nBytes; - zval *array_ptr = (zval *) arg; - - fp=php_open_temporary_file(NULL, "fdfdata.", &filename TSRMLS_CC); - if(!fp) { - if(filename) efree(filename); - return; - } - fwrite(SG(request_info).post_data, SG(request_info).post_data_length, 1, fp); - fclose(fp); - - /* Set HTTP_FDF_DATA variable */ - data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length); - SET_VAR_STRINGL("HTTP_FDF_DATA", data, SG(request_info).post_data_length); - - err = FDFOpen(filename, 0, &theFDF); - - if(err==FDFErcOK){ - name = emalloc(name_len=256); - value= emalloc(value_len=256); - while (1) { - err = FDFNextFieldName(theFDF, lastfieldname, name, name_len-1, &nBytes); - if(err == FDFErcBufTooShort && nBytes >0 ) { - name = erealloc(name, name_len=(nBytes+1)); - err = FDFNextFieldName(theFDF, lastfieldname, name, name_len-1, &nBytes); - } - - if(err != FDFErcOK || nBytes == 0) break; - - if(lastfieldname) efree(lastfieldname); - lastfieldname = estrdup(name); - - err = FDFGetValue(theFDF, name, NULL, 0, &nBytes); - if(err != FDFErcOK && err != FDFErcNoValue ) break; - - if(value_len0) { - err = FDFGetValue(theFDF, name, value, value_len-1, &nBytes); - if(err == FDFErcOK && nBytes != 0) { - unsigned int new_val_len; - - for(p=value;*p;p++) if(*p=='\r') *p='\n'; - if(lastfieldname) efree(lastfieldname); - lastfieldname = estrdup(name); - - if (sapi_module.input_filter(PARSE_POST, name, &value, nBytes, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(name, value, new_val_len, array_ptr TSRMLS_CC); - } - } - } - } - FDFClose(theFDF); - - if(name) efree(name); - if(value) efree(value); - if(lastfieldname) efree(lastfieldname); - } - VCWD_UNLINK((const char *)filename); - efree(filename); -} -/* }}} */ - -/* {{{ proto int fdf_errno(void) - Gets error code for last operation */ -PHP_FUNCTION(fdf_errno) { - RETURN_LONG((long)FDF_G(error)); -} -/* }}} */ - -/* {{{ proto string fdf_error([int errno]) - Gets error description for error code */ -PHP_FUNCTION(fdf_error) { - FDFErc err; - long p_err = -1; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &p_err) - == FAILURE) { - return; - } - - err = (p_err >= 0) ? (FDFErc)p_err : FDF_G(error); - - switch(err) { - case FDFErcOK: - RETURN_STRING("no error", 1); - case FDFErcInternalError: - RETURN_STRING("An internal FDF Library error occurred", 1); - case FDFErcBadParameter: - RETURN_STRING("One or more of the parameters passed were invalid. ", 1); - case FDFErcFileSysErr: - RETURN_STRING("A file system error occurred or the file was not found", 1); - case FDFErcBadFDF: - RETURN_STRING("The FDF file being opened or parsed was invalid", 1); - case FDFErcFieldNotFound: - RETURN_STRING("The field whose name was passed in the parameter fieldName does not exist in the FDF file", 1); - case FDFErcNoValue: - RETURN_STRING("The field whose value was requested has no value", 1); - case FDFErcEnumStopped: - RETURN_STRING("Enumeration was stopped by FDFEnumValues by returning FALSE", 1); - case FDFErcCantInsertField: - RETURN_STRING("The field whose name was passed in the parameter fieldName cannot be inserted into the FDF file", 1); - case FDFErcNoOption: - RETURN_STRING("The requested element in a fields /Opt key does not exist, or the field has no /Opt key. ", 1); - case FDFErcNoFlags: - RETURN_STRING("The field has no /F or /Ff keys", 1); - case FDFErcBadPDF: - RETURN_STRING("The PDF file passed as the parameter to FDFSetAP was invalid, or did not contain the requested page ", 1); - case FDFErcBufTooShort: - RETURN_STRING("The buffer passed as a parameter was too short", 1); - case FDFErcNoAP: - RETURN_STRING("The field has no /AP key", 1); - case FDFErcIncompatibleFDF: - RETURN_STRING("An attempt to mix classic and template-based FDF files was made", 1); -#ifdef HAVE_FDFTK_5 - case FDFErcNoAppendSaves: - RETURN_STRING("The FDF does not include a /Difference key", 1); - case FDFErcValueIsArray: - RETURN_STRING("The value of this field is an array. Use FDFGetNthValue. ", 1); - case FDFErcEmbeddedFDFs: - RETURN_STRING("The FDF you passed as a parameter is a container for one or more FDFs embedded within it. Use FDFOpenFromEmbedded to gain access to each embedded FDF", 1); - case FDFErcNoMoreFDFs: - RETURN_STRING("Returned by FDFOpenFromEmbedded when parameter iWhich >= the number of embedded FDFs (including the case when the passed FDF does not contain any embedded FDFs)", 1); - case FDFErcInvalidPassword: - RETURN_STRING("Returned by FDFOpenFromEmbedded when the embedded FDF is encrypted, and you did not provide the correct password", 1); -#endif - case FDFErcLast: - RETURN_STRING("Reserved for future use", 1); - default: - RETURN_STRING("unknown error", 1); - } -} -/* }}} */ - -/* {{{ proto string fdf_get_version([resource fdfdoc]) - Gets version number for FDF api or file */ -PHP_FUNCTION(fdf_get_version) { - zval *r_fdf = NULL; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &r_fdf) - == FAILURE) { - return; - } - - if(r_fdf) { -#if HAVE_FDFTK_5 - const char *fdf_version; - FDFDoc fdf; - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - fdf_version = FDFGetFDFVersion(fdf); - RETURN_STRING((char *)fdf_version, 1); -#else - RETURN_STRING("1.2",1); -#endif - } else { - const char *api_version = FDFGetVersion(); - RETURN_STRING((char *)api_version, 1); - } -} -/* }}} */ - -#ifdef HAVE_FDFTK_5 -/* {{{ proto bool fdf_set_version(resourece fdfdoc, string version) - Sets FDF version for a file*/ -PHP_FUNCTION(fdf_set_version) { - zval *r_fdf; - char *version; - int version_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &r_fdf, &version, &version_len) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFSetFDFVersion(fdf, version); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_add_doc_javascript(resource fdfdoc, string scriptname, string script) - Add javascript code to the fdf file */ -PHP_FUNCTION(fdf_add_doc_javascript) { - zval *r_fdf; - char *name, *script; - int name_len, script_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &r_fdf, - &name, &name_len, - &script, &script_len - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFAddDocJavaScript(fdf, name, script); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_on_import_javascript(resource fdfdoc, string script, bool before_data_import) - Adds javascript code to be executed when Acrobat opens the FDF */ -PHP_FUNCTION(fdf_set_on_import_javascript) { - zval *r_fdf; - char *script; - int script_len; - zend_bool before; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsb", &r_fdf, - &script, &script_len, &before - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFSetOnImportJavaScript(fdf, script, before); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto bool fdf_set_target_frame(resource fdfdoc, string target) - Sets target frame for form */ -PHP_FUNCTION(fdf_set_target_frame) { - zval *r_fdf; - char *target; - int target_len; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &r_fdf, - &target, &target_len - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFSetTargetFrame(fdf, target); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ -#endif - -/* {{{ proto bool fdf_remove_item(resource fdfdoc, string fieldname, int item) - Sets target frame for form */ -PHP_FUNCTION(fdf_remove_item) { - zval *r_fdf; - char *fieldname; - int fieldname_len; - long item; - FDFDoc fdf; - FDFErc err; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", &r_fdf, - &fieldname, &fieldname_len, - &item - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - err = FDFRemoveItem(fdf, *fieldname ? fieldname : NULL, item); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -#ifdef HAVE_FDFTK_5 -/* {{{ proto array fdf_get_attachment(resource fdfdoc, string fieldname, string savepath) - Get attached uploaded file */ -PHP_FUNCTION(fdf_get_attachment) { - zval *r_fdf; - char *fieldname, *savepath; - int fieldname_len, savepath_len; - int is_dir=0; - FDFDoc fdf; - FDFErc err; - char pathbuf[MAXPATHLEN], mimebuf[1024]; - struct stat statBuf; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &r_fdf, - &fieldname, &fieldname_len, - &savepath, &savepath_len - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if (php_check_open_basedir(savepath TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(savepath, "wb+", CHECKUID_CHECK_MODE_PARAM))) { - RETURN_FALSE; - } - - strlcpy(pathbuf, savepath, sizeof(pathbuf)); - - if(0 == stat(pathbuf, &statBuf)) { - is_dir = S_ISDIR(statBuf.st_mode); - } - - err = FDFExtractAttachment(fdf, fieldname, pathbuf, sizeof(pathbuf), is_dir, mimebuf, sizeof(mimebuf)); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - - array_init(return_value); - add_assoc_string(return_value, "path", pathbuf, 1); - add_assoc_string(return_value, "type", mimebuf, 1); - stat(pathbuf, &statBuf); - add_assoc_long(return_value, "size", statBuf.st_size); -} -/* }}} */ -#endif - -/* {{{ enum_values_callback */ -static ASBool enum_values_callback(char *name, char *value, void *userdata) -{ - zval *retval_ptr, *z_name, *z_value, **args[3]; - long retval = 0; - int numargs = 2; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(z_name); - ZVAL_STRING(z_name, name, 1); - args[0] = &z_name; - - if (*value) { /* simple value */ - MAKE_STD_ZVAL(z_value); - ZVAL_STRING(z_value, value, 1); - args[1] = &z_value; - } else { /* empty value *might* be an array */ - /* TODO: do it like fdf_get_value (or re-implement yourself?) */ - } - - if (userdata) { - args[2] = (zval **) userdata; - numargs++; - } - - if (call_user_function_ex(EG(function_table), - NULL, - FDF_G(enum_callback), - &retval_ptr, - numargs, args, - 0, NULL TSRMLS_CC) == SUCCESS - && retval_ptr) { - - convert_to_long_ex(&retval_ptr); - retval = Z_LVAL_P(retval_ptr); - zval_ptr_dtor(&retval_ptr); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "callback failed"); - } - - zval_ptr_dtor(&z_name); - zval_ptr_dtor(&z_value); - - return (ASBool)retval; -} -/* }}} */ - -/* {{{ proto bool fdf_enum_values(resource fdfdoc, callback function [, mixed userdata]) - Call a user defined function for each document value */ -PHP_FUNCTION(fdf_enum_values) { - zval *r_fdf; - zval *callback; - zval *userdata = NULL; - FDFDoc fdf; - FDFErc err; - char *name; - char namebuf[1024], valbuf[1024]; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|z", &r_fdf, - &callback, &userdata - ) - == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf); - - if (!zend_is_callable(callback, 0, &name)) { - php_error_docref1(NULL TSRMLS_CC, name, E_WARNING, "Second argument is expected to be a valid callback"); - efree(name); - RETURN_FALSE; - } - efree(name); - FDF_G(enum_callback) = callback; - FDF_G(enum_fdf) = fdf; - - err = FDFEnumValues(fdf, enum_values_callback, - namebuf, sizeof(namebuf), - valbuf, sizeof(valbuf), - userdata ? &userdata : NULL, 0); - - if(err != FDFErcOK) { - FDF_FAILURE(err); - } - FDF_SUCCESS; -} -/* }}} */ - -/* {{{ proto void fdf_header(void) - Set FDF specific HTTP headers */ -PHP_FUNCTION(fdf_header) { - sapi_header_line ctr = {0}; - - ctr.line = "Content-type: application/vnd.fdf"; - ctr.line_len = strlen(ctr.line); - ctr.response_code = 200; - - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/fdf/fdf.dsp b/ext/fdf/fdf.dsp deleted file mode 100644 index 85b91ceac92df..0000000000000 --- a/ext/fdf/fdf.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="fdf" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=fdf - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "fdf.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "fdf.mak" CFG="fdf - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "fdf - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fdf - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "fdf - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /D "HAVE_FDFTK_5" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib fdftk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_fdf.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "fdf - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /D "HAVE_FDFTK_5" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib fdftk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_fdf.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "fdf - Win32 Release_TS" -# Name "fdf - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\fdf.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_fdf.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/fdf/package.xml b/ext/fdf/package.xml deleted file mode 100644 index b1f56f41a8d23..0000000000000 --- a/ext/fdf/package.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - fdf - PDF Form Data Format functions - - - steinm - Uwe Steinmann - steinm@php.net - lead - - - hholzgra - Hartmut Holzgraefe - hartmut@php.net - developer - - - -Forms Data Format (FDF) is a format for handling forms -within PDF documents. You should read the documentation -at http://partners.adobe.com/asn/acrobat/forms.jsp for -more information on what FDF is and how it is used in -general. - - PHP - - beta - 5.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/fdf/php_fdf.h b/ext/fdf/php_fdf.h deleted file mode 100644 index fcba10c5a2d2a..0000000000000 --- a/ext/fdf/php_fdf.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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$ */ - -#ifndef PHP_FDF_H -#define PHP_FDF_H - -#if HAVE_FDFLIB -#ifdef PHP_WIN32 -#else -#define UNIX_DEV -#endif - -#if HAVE_FDFTK_H_LOWER -# include -#else -# include -#endif - -ZEND_BEGIN_MODULE_GLOBALS(fdf) - FDFErc error; - zval *enum_callback; - FDFDoc enum_fdf; -ZEND_END_MODULE_GLOBALS(fdf) - -#ifdef ZTS -#define FDF_G(v) TSRMG(fdf_globals_id, zend_fdf_globals *, v) -#else -#define FDF_G(v) (fdf_globals.v) -#endif - - -extern zend_module_entry fdf_module_entry; -#define fdf_module_ptr &fdf_module_entry - -PHP_MINIT_FUNCTION(fdf); -PHP_MSHUTDOWN_FUNCTION(fdf); -PHP_RINIT_FUNCTION(fdf); -PHP_MINFO_FUNCTION(fdf); - -PHP_FUNCTION(fdf_open); -PHP_FUNCTION(fdf_open_string); -PHP_FUNCTION(fdf_close); -PHP_FUNCTION(fdf_create); -PHP_FUNCTION(fdf_save); -PHP_FUNCTION(fdf_save_string); -PHP_FUNCTION(fdf_get_value); -PHP_FUNCTION(fdf_set_value); -PHP_FUNCTION(fdf_next_field_name); -PHP_FUNCTION(fdf_set_ap); -PHP_FUNCTION(fdf_get_ap); -PHP_FUNCTION(fdf_get_status); -PHP_FUNCTION(fdf_set_status); -PHP_FUNCTION(fdf_set_file); -PHP_FUNCTION(fdf_get_file); -PHP_FUNCTION(fdf_add_template); -PHP_FUNCTION(fdf_set_flags); -PHP_FUNCTION(fdf_get_flags); -PHP_FUNCTION(fdf_set_opt); -PHP_FUNCTION(fdf_get_opt); -PHP_FUNCTION(fdf_set_submit_form_action); -PHP_FUNCTION(fdf_set_javascript_action); -PHP_FUNCTION(fdf_add_doc_javascript); -PHP_FUNCTION(fdf_set_on_import_javascript); -PHP_FUNCTION(fdf_set_encoding); -PHP_FUNCTION(fdf_get_encoding); -PHP_FUNCTION(fdf_set_version); -PHP_FUNCTION(fdf_get_version); -PHP_FUNCTION(fdf_set_target_frame); -PHP_FUNCTION(fdf_errno); -PHP_FUNCTION(fdf_error); -PHP_FUNCTION(fdf_remove_item); -PHP_FUNCTION(fdf_get_attachment); -PHP_FUNCTION(fdf_enum_values); -PHP_FUNCTION(fdf_header); -#else -#define fdf_module_ptr NULL -#endif -#define phpext_fdf_ptr fdf_module_ptr -#endif /* PHP_FDF_H */ diff --git a/ext/fdf/tests/01-general.phpt b/ext/fdf/tests/01-general.phpt deleted file mode 100644 index 998da3d7297cd..0000000000000 --- a/ext/fdf/tests/01-general.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Adobe Form Data Format functions ---SKIPIF-- - ---FILE-- - ---EXPECT-- -OK \ No newline at end of file diff --git a/ext/fdf/tests/02-values.phpt b/ext/fdf/tests/02-values.phpt deleted file mode 100644 index 40c7df4a0ebcd..0000000000000 --- a/ext/fdf/tests/02-values.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -FDF open/save and set/get values ---SKIPIF-- - ---FILE-- - ---EXPECT-- -foo: bar -bar: foo diff --git a/ext/fdf/tests/03-read-file.phpt b/ext/fdf/tests/03-read-file.phpt deleted file mode 100644 index a611142b3f123..0000000000000 --- a/ext/fdf/tests/03-read-file.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -FDF read file ---SKIPIF-- - ---FILE-- - ---EXPECT-- -foo: bar -bar: foo diff --git a/ext/fdf/tests/04-POST.phpt b/ext/fdf/tests/04-POST.phpt deleted file mode 100644 index 1d8c9de48f1d5..0000000000000 --- a/ext/fdf/tests/04-POST.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -FDF POST data parsing ---SKIPIF-- - ---HEADERS-- -return <<> ] /ID [ <3c0e51bf6427b09f7faa482297af6957><5f9787a1646a3bfe44b7725c9c1284df> -] >> ->> -endobj -trailer -<< -/Root 1 0 R - ->> -%%EOF ---FILE-- - $value) { - echo "$key => $value\n"; -} -?> ---EXPECT-- -209 -status: Thanks George \ No newline at end of file diff --git a/ext/fdf/tests/simple.fdf b/ext/fdf/tests/simple.fdf deleted file mode 100644 index 21d3fbd55af30..0000000000000 --- a/ext/fdf/tests/simple.fdf +++ /dev/null @@ -1,18 +0,0 @@ -%FDF-1.2 -%âãÏÓ -1 0 obj -<< -/FDF << /Fields 2 0 R >> ->> -endobj -2 0 obj -[ -<< /T (foo)/V (bar)>> << /T (bar)/V (foo)>> -] -endobj -trailer -<< -/Root 1 0 R - ->> -%%EOF diff --git a/ext/filter/CREDITS b/ext/filter/CREDITS deleted file mode 100644 index 8d75401f779b5..0000000000000 --- a/ext/filter/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Input Filter -Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c deleted file mode 100644 index 62c14e335f372..0000000000000 --- a/ext/filter/callback_filter.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Derick Rethans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php_filter.h" - -void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL) -{ - zval *retval_ptr; - zval ***args; - int status; - - if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument is expected to be a valid callback"); - zval_dtor(value); - Z_TYPE_P(value) = IS_NULL; - return; - } - - args = safe_emalloc(sizeof(zval **), 1, 0); - args[0] = &value; - - status = call_user_function_ex(EG(function_table), NULL, option_array, &retval_ptr, 1, args, 0, NULL TSRMLS_CC); - - if (status == SUCCESS && retval_ptr != NULL) { - if (retval_ptr != value) { - zval_dtor(value); - COPY_PZVAL_TO_ZVAL(*value, retval_ptr); - } else { - zval_ptr_dtor(&retval_ptr); - } - } else { - zval_dtor(value); - Z_TYPE_P(value) = IS_NULL; - } - - efree(args); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/filter/config.m4 b/ext/filter/config.m4 deleted file mode 100644 index b4e32a21a474a..0000000000000 --- a/ext/filter/config.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl $Id$ -dnl config.m4 for input filtering extension - -PHP_ARG_ENABLE(filter, whether to enable input filter support, -[ --disable-filter Disable input filter support], yes) - -PHP_ARG_WITH(pcre-dir, pcre install prefix, -[ --with-pcre-dir FILTER: pcre install prefix], no, no) - -if test "$PHP_FILTER" != "no"; then - - dnl Check if configure is the PHP core configure - if test -n "$PHP_VERSION"; then - dnl This extension can not be build as shared when in PHP core - ext_shared=no - else - dnl This is PECL build, check if bundled PCRE library is used - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=$INCLUDES - AC_EGREP_CPP(yes,[ -#include
-#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) -yes -#endif - ],[ - PHP_PCRE_REGEX=yes - ],[ - AC_EGREP_CPP(yes,[ -#include
-#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE) -yes -#endif - ],[ - PHP_PCRE_REGEX=pecl - ],[ - PHP_PCRE_REGEX=no - ]) - ]) - CPPFLAGS=$old_CPPFLAGS - fi - - PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared) - PHP_SUBST(FILTER_SHARED_LIBADD) - - PHP_INSTALL_HEADERS([ext/filter/php_filter.h]) - PHP_ADD_EXTENSION_DEP(filter, pcre) -fi diff --git a/ext/filter/config.w32 b/ext/filter/config.w32 deleted file mode 100644 index 083555a4c77a7..0000000000000 --- a/ext/filter/config.w32 +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("filter", "Filter Support", "yes"); - -if (PHP_FILTER == "yes") { - EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c"); -} diff --git a/ext/filter/docs/filter.txt b/ext/filter/docs/filter.txt deleted file mode 100644 index 48aae0c8d5b0b..0000000000000 --- a/ext/filter/docs/filter.txt +++ /dev/null @@ -1,331 +0,0 @@ -Input Filter Extension -~~~~~~~~~~~~~~~~~~~~~~ - -Introduction -============ -We all know that you should always check input variables, but PHP does not -offer really good functionality for doing this in a safe way. The Input Filter -extension is meant to address this issue by implementing a set of filters and -mechanisms that users can use to safely access their input data. - - -Change Log -========== -2005-10-27 - * Updated filter_data prototype - * Added filter constants - * Fixed minor problems - * Changes by David Tulloh - -2005-10-05 - * Changed "input_filter.paranoid_admin_default_filter" to - "filter.default". - * Updated API prototypes to reflect implementation. - * Added 'on' and 'off' to the boolean filter. - * Removed min_range and max_range flags from the float filter. - * Added validate_url, validate_email and validate_ip filters. - * Updated allows flags for all filters. - -2005-08-15 - * Unmade *source* a bitmask, it doesn't make sense to do. - * Changed return value of filters which got invalid data from 'false' to - 'null. - * Failed filters do not throw an E_NOTICE any longer. - * Added a magic_quotes sanitizing filter. - - -General Considerations -====================== -* If the filter's expected input data mask does not match the provided data - for logical filters the filter function returns "false". If the data was - not found, "null" is returned. -* Character filters always return a string. -* With the input filter extension enabled, and the - input_filter.paranoid_admin_default_filter is set to something != 'raw', - then all entries in the affected super globals will be passed through the - configured filter. The 'callback' filter can not be used here, as that - requieres a PHP script to be running already. -* As the input filter acts on input data before the magic quotes function - mangles data, all access through the filter() function will not have any - quotes or slashes added - it will be the pure data as send by the browser. -* All flags mentioned here should be prepended with `FILTER_FLAG_` when used - with PHP. - - -API -=== -mixed *input_get* (int *source*, string *name*, [, int *filter* [, mixed *filter_options*, [ string *characterset* ] ]); - Returns the filtered variable *$name* from source *$source*. It uses the - filter as specified in *$filter* with a constant, and additional options - to the filter through *$filter_options*. - -mixed *input_get_args* (array *definitions*, int *source*, [, array *data*]); - Returns an array with all filtered variables defined in 'definition'. - The keys are used as the name of the argument. The value can be either - an integer (flags) or an array of options. This array can contain - the 'filter' type, the 'flags', the 'otptions' or the 'charset' - -bool *input_has_variable (int *source*, string *name*); - Returns *true* if the variable with the name *name* exists in *source*, or - *false* otherwise. - -array *input_filters_list* (); - Returns a list with all supported filter names. - -mixed *filter_data* (mixed *variable*, int *filter* [, mixed *filter_options*, [ string *characterset* ] ]); - Filters the user supplied variable *$variable* in the same manner as - *input_get*. - -*$source*: - -* INPUT_POST 0 -* INPUT_GET 1 -* INPUT_COOKIE 2 -* INPUT_ENV 4 -* INPUT_SERVER 5 (not implemented yet) -* INPUT_SESSION 6 (not implemented yet) - - -General flags -============= - -* FILTER_FLAG_SCALAR -* FILTER_FLAG_ARRAY - -These two constants define whether to allow arrays in the source values. The -default value is SCALAR for input_get_args and ARRAY for the other functions -(< 0.9.5). These constants also insure that the function returns the correct -type, if you ask for an array, you will get an array even if the source is -only one value. However, if you ask for a scalar and the source is an array, -the result will be FALSE (invalid). - - -Logical Filters -=============== - -These filters check whether passed data was valid, and do never mangle input -variables, but ofcourse they can deny the whole input variable getting to the -application by returning false. - -The constants should be prepended by `FILTER_VALIDATE_` when used with php. - -================ ========== =========== ================================================== -Name Constant Return Type Description -================ ========== =========== ================================================== -int INT integer Returns the input variable as an integer - - $filter_options - an array with the optional - elements: - - * min_range: Minimal number that is allowed - (inclusive) - * max_range: Maximum number that is allowed - (inclusive) - * flags: A bitmask supporting the following flags: - - - ALLOW_OCTAL: allow octal numbers with the format - 0nn as input too. - - ALLOW_HEX: allow hexadecimal numbers with the - format 0xnn or 0Xnn too. - -boolean BOOLEAN boolean Returns *true* for '1', 'on' and 'true' and *false* - for '0', 'off' and 'false' - -float FLOAT float Returns the input variable as a floating point value - -validate_regexp REGEXP string Matches the input value as a string against the - regular expression. If there is a match then the - string is returned, otherwise the filter returns - *null*. - Remarks: Only available if pcre has been compiled - into PHP. - -validate_url URL string Validates an URL's format. - - $filter_options - an bitmask that supports the - following flags: - - * SCHEME_REQUIRED: The 'schema' part of the URL - needs to in the passed URL. - * HOST_REQUIRED: The 'host' part of the URL - needs to in the passed URL. - * PATH_REQUIRED: The 'path' part of the URL - needs to in the passed URL. - * QUERY_REQUIRED: The 'query' part of the URL - needs to in the passed URL. - -validate_email EMAIL string Validates the passed string against a reasonably - good regular expression for validating an email - address. - -validate_ip IP string Validates a string representing an IP address. - - $filter_options - an bitmask that supports the - following flags: - - * IPV4: Allows IPv4 addresses. - * IPV6: Allows IPv6 addresses. - * NO_RES_RANGE: Disallows addresses in reversed - ranges (IPv4 only) - * NO_PRIV_RANGE: Disallows addresses in private - ranges (IPv4 only) -================ ========== =========== ================================================== - - -Sanitizing Filters -================== - -These filters remove data, or change data depending on the filter, and the -set rules for this specific filter. Instead of taking an *options* array, they -use this parameter for flags for the specific filter. - -The constants should be prepended by `FILTER_SANITIZE_` when used with php. - -============= ================ =========== ===================================================== -Name Constant Return Type Description -============= ================ =========== ===================================================== -string STRING string Returns the input variable as a string after it has - been stripped of XML/HTML tags and other evil things - that can cause XSS problems. - - $filter_options - an bitmask that supports the - following flags: - - * NO_ENCODE_QUOTES: Prevents single and double - quotes from being encoded as numerical HTML - entities. - * STRIP_LOW: excludes all characters < 0x20 from the - allowed character list - * STRIP_HIGH: excludes all characters >= 0x80 from - the allowed character list - * ENCODE_LOW: allows characters < 0x20 but encodes - them as numerical HTML entities - * ENCODE_HIGH: allows characters >= 0x80 but encodes - them as numerical HTML entities - * ENCODE_AMP: encodes & as & - - The flags STRIP_LOW and ENCODE_LOW are mutual - exclusive, and so are STRIP_HIGH and ENCODE_HIGH. In - the case they clash, the characters will be - stripped. - -stripped STRIPPED string Alias for 'string'. - -encoded ENCODED string Encodes all characters outside the range - "a-zA-Z0-9-._" as URL encoded values. - - $filter_options - an bitmask that supports the - following flags: - - * STRIP_LOW: excludes all characters < 0x20 from the - allowed character list - * STRIP_HIGH: excludes all characters >= 0x80 from - the allowed character list - * ENCODE_LOW: allows characters < 0x20 but encodes - them as numerical HTML entities - * ENCODE_HIGH: allows characters >= 0x80 but encodes - them as numerical HTML entities - -special_chars SPECIAL_CHARS string Encodes the 'special' characters ' " < > &, \0 and - everything below 0x20 as numerical HTML entities. - - $filter_options - an bitmask that supports the - following flags: - - * STRIP_LOW: excludes all characters < 0x20 from the - allowed character list. If this is not set, then - those characters are encoded as numerical HTML - entities - * STRIP_HIGH: excludes all characters >= 0x80 from - the allowed character list - * ENCODE_HIGH: allows characters >= 0x80 but encodes - them as numerical HTML entities - -unsafe_raw UNSAFE_RAW string Returns the input variable as a string without - XML/HTML being stripped from the input value. - - $filter_options - an bitmask that supports the - following flags: - - * STRIP_LOW: excludes all characters < 0x20 from the - allowed character list - * STRIP_HIGH: excludes all characters >= 0x80 from - the allowed character list - * ENCODE_LOW: allows characters < 0x20 but encodes - them as numerical HTML entities - * ENCODE_HIGH: allows characters >= 0x80 but encodes - them as numerical HTML entities - * ENCODE_AMP: encodes & as & - - The flags STRIP_LOW and ENCODE_LOW are mutual - exclusive, and so are STRIP_HIGH and ENCODE_HIGH. In - the case they clash, the characters will be - stripped. - -email EMAIL string Removes all characters that can not be part of a - correctly formed e-mail address (exception are - comments in the email address) (a-z A-Z 0-9 " ! # $ - % & ' * + - / = ? ^ _ ` { | } ~ @ . [ ]). This - filter does `not` validate if the e-mail address has - the correct format, use the validate_email filter - for that. - -url URL string Removes all characters that can not be part of a - correctly formed URI. (a-z A-Z 0-9 $ - _ . + ! * ' ( - ) , { } | \ ^ ~ [ ] ` < > # % " ; / ? : @ & =) This - filter does `not` validate if a URI has the correct - format, use the validate_url filter for that. - -number_int NUMBER_INT int Removes all characters that are [^0-9+-]. - -number_float NUMBER_FLOAT float Removes all characters that are [^0-9+-]. - - $filter_options - an bitmask that supports the - following flags: - - * ALLOW_FRACTION: adds "." to the characters that - are not stripped. - * ALLOW_THOUSAND: adds "," to the characters that - are not stripped. - * ALLOW_SCIENTIFIC: adds "eE" to the characters that - are not stripped. - -magic_quotes MAGIC_QUOTES string BC filter for people who like magic quotes. -============= ================ =========== ===================================================== - - -Callback Filter -=============== - -This filter will callback to the specified callback function as specified with -the *filter_options* parameter. All variants of callback functions are -supported: - -* function with *'functionname'* -* static method with *array('classname', 'methodname')* -* dynamic method with *array(&$this, 'methodname')* - -The constants should be prepended by `FILTER_` when used with php. - -============= =========== =========== ===================================================== -Name Constant Return Type Description -============= =========== =========== ===================================================== -callback CALLBACK mixed Calls the callback function/method with the input - variable's value by reference which can do filtering - and modifying of the input value. If the callback - function returns "false" then the input value is - supposed to be incorrect and the returned value will - be 'false' (and an E_NOTICE will be raised). -============= =========== =========== ===================================================== - -The callback function's prototype is: - -boolean callback(&$value, $characterset); - With *$value* being a reference to the input variable and *$characterset* - containing the same value as this parameter's value in the call to - *input_get()* or *input_get_array()*. If the *$characterset* parameter was - not passed, it defaults to *'null'*. - -Version: $Id$ -.. vim: et syn=rst tw=78 - diff --git a/ext/filter/docs/input_get_args.php b/ext/filter/docs/input_get_args.php deleted file mode 100644 index b580524489ee8..0000000000000 --- a/ext/filter/docs/input_get_args.php +++ /dev/null @@ -1,41 +0,0 @@ - 'product idqqq", - "asdasdblah", - "some another text <> hoho " - ); - -foreach ($array as $str) { - file_put_contents($filename, $str); - $fp = fopen($filename, "r"); - var_dump(fgetss($fp)); - var_dump(fgetss($fp)); -} - -foreach ($array as $str) { - file_put_contents($filename, $str); - $fp = fopen($filename, "r"); - var_dump(fgetss($fp, 10)); - var_dump(fgetss($fp, 10)); -} - -var_dump(fgetss($fp, -10)); -var_dump(fgetss($fp, 0)); -fclose($fp); -var_dump(fgetss($fp, 0)); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -string(18) "askasdfasdfaaaaaa -" -string(6) "dddddd" -string(6) "asdqw -" -string(8) "aaaaqqqq" -string(23) "aaafunction foo() {}qqq" -bool(false) -string(6) "asdasd" -string(0) "" -bool(false) -bool(false) -string(11) "some text -" -string(4) "blah" -string(24) "some another text hoho " -bool(false) -string(9) "askasdfas" -string(6) "dfaaaa" -string(5) "asdqw" -string(0) "" -string(3) "aaa" -string(7) "functio" -string(6) "asdasd" -string(0) "" -bool(false) -bool(false) -string(9) "some text" -string(2) " -" -string(9) "some anot" -string(9) "her text " - -Warning: fgetss(): Length parameter must be greater than 0 in %s on line %d -bool(false) - -Warning: fgetss(): Length parameter must be greater than 0 in %s on line %d -bool(false) - -Warning: fgetss(): %d is not a valid stream resource in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/file/fgetss1.phpt b/ext/standard/tests/file/fgetss1.phpt deleted file mode 100644 index 96b8b6f5328e5..0000000000000 --- a/ext/standard/tests/file/fgetss1.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -more fgetss() tests ---FILE-- -aaaaaa\ndddddd", - "asdqw\naaaa<>qqqq", - "aaaqqq", - "asdasdblah", - "some another text <> hoho " - ); - -foreach ($array as $str) { - file_put_contents($filename, $str); - $fp = fopen($filename, "r"); - var_dump(fgetss($fp, 1000, ",,")); - var_dump(fgetss($fp)); -} - -foreach ($array as $str) { - file_put_contents($filename, $str); - $fp = fopen($filename, "r"); - var_dump(fgetss($fp, 10)); - var_dump(fgetss($fp, 10, "", - '', - "hello

world

", - 'hello

world

', - "", - '' -); - - -// Calling strip_tags() with default arguments -// loop through the $string_array to test strip_tags on various inputs -$iteration = 1; -foreach($string_array as $string) -{ - echo "-- Iteration $iteration --\n"; - var_dump( strip_tags($string) ); - $iteration++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : basic functionality *** --- Iteration 1 -- -string(5) "hello" --- Iteration 2 -- -string(5) "hello" --- Iteration 3 -- -string(0) "" --- Iteration 4 -- -string(0) "" --- Iteration 5 -- -string(0) "" --- Iteration 6 -- -string(0) "" --- Iteration 7 -- -string(0) "" --- Iteration 8 -- -string(0) "" --- Iteration 9 -- -string(12) " echo hello " --- Iteration 10 -- -string(12) " echo hello " --- Iteration 11 -- -string(10) "helloworld" --- Iteration 12 -- -string(10) "helloworld" --- Iteration 13 -- -string(0) "" --- Iteration 14 -- -string(0) "" -Done diff --git a/ext/standard/tests/strings/strip_tags_basic2.phpt b/ext/standard/tests/strings/strip_tags_basic2.phpt deleted file mode 100644 index 0ca5f6df39f56..0000000000000 --- a/ext/standard/tests/strings/strip_tags_basic2.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test strip_tags() function : basic functionality - with all arguments ---INI-- -set short_open_tag = on ---FILE-- -

hello

world
Other text"; - -$allowed_tags_array=array( - "", - '', - "

", - '

', - "", - '', - "

---EXPECTF-- -*** Testing strip_tags() : basic functionality *** --- Iteration 1 -- -string(33) "helloworldOther text" --- Iteration 2 -- -string(33) "helloworldOther text" --- Iteration 3 -- -string(27) "

hello

worldOther text" --- Iteration 4 -- -string(27) "

hello

worldOther text" --- Iteration 5 -- -string(44) "helloworld
Other text" --- Iteration 6 -- -string(44) "helloworldOther text" --- Iteration 7 -- -string(20) "helloworldOther text" --- Iteration 8 -- -string(20) "helloworldOther text" --- Iteration 9 -- -string(64) "

hello

worldOther text" -Done diff --git a/ext/standard/tests/strings/strip_tags_error.phpt b/ext/standard/tests/strings/strip_tags_error.phpt deleted file mode 100644 index fcd3963fe2dc9..0000000000000 --- a/ext/standard/tests/strings/strip_tags_error.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test strip_tags() function : error conditions ---INI-- -set short_open_tag = on ---FILE-- -hello"; -$allowable_tags = ""; -$extra_arg = 10; -var_dump( strip_tags($str, $allowable_tags, $extra_arg) ); - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : error conditions *** - --- Testing strip_tags() function with Zero arguments -- - -Warning: Wrong parameter count for strip_tags() in %s on line %d -NULL - --- Testing strip_tags() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for strip_tags() in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/strip_tags_variation1.phpt b/ext/standard/tests/strings/strip_tags_variation1.phpt deleted file mode 100644 index b312fb24e1aaa..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation1.phpt +++ /dev/null @@ -1,157 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - unexpected values for 'str' argument ---INI-- -set short_open_tag = on ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new classA(), - - // undefined data - @$undefined_var, - - // unset data - @$unset_var, - - // resource variable - $fp - -); - -// loop through each element of the array for allowable_tags -$iterator = 1; -foreach($values as $value) { - echo "-- Iteration $iterator --\n"; - var_dump( strip_tags($value) ); - $iterator++; -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : usage variations *** --- Iteration 1 -- -string(1) "0" --- Iteration 2 -- -string(1) "1" --- Iteration 3 -- -string(5) "12345" --- Iteration 4 -- -string(5) "-2345" --- Iteration 5 -- -string(4) "10.5" --- Iteration 6 -- -string(5) "-10.5" --- Iteration 7 -- -string(12) "105000000000" --- Iteration 8 -- -string(7) "1.06E-9" --- Iteration 9 -- -string(3) "0.5" --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 15 -- -string(0) "" --- Iteration 16 -- -string(0) "" --- Iteration 17 -- -string(1) "1" --- Iteration 18 -- -string(0) "" --- Iteration 19 -- -string(1) "1" --- Iteration 20 -- -string(0) "" --- Iteration 21 -- -string(0) "" --- Iteration 22 -- -string(0) "" --- Iteration 23 -- -string(14) "Class A object" --- Iteration 24 -- -string(0) "" --- Iteration 25 -- -string(0) "" --- Iteration 26 -- -string(%d) "Resource id #%d" -Done diff --git a/ext/standard/tests/strings/strip_tags_variation10.phpt b/ext/standard/tests/strings/strip_tags_variation10.phpt deleted file mode 100644 index a9c3f6466890e..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation10.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - single quoted strings ---INI-- -set short_open_tag = on ---FILE-- - \$ -> This represents the dollar sign', - '\t\r\v The quick brown fo\fx jumped over the lazy dog

', - 'This is a hyper text tag', - 'hello world\\t?>', - '

This is a paragraph

', - 'This is \ta text in bold letters\r\s\malong with slashes\n' -); - -$quotes = "

---EXPECTF-- -*** Testing strip_tags() : usage variations *** --- Iteration 1 -- -string(51) " \$ -> This represents the dollar sign" --- Iteration 2 -- -string(63) "\t\r\v The quick brown fo\fx jumped over the lazy dog

" --- Iteration 3 -- -string(31) "
This is a hyper text tag" --- Iteration 4 -- -string(0) "" --- Iteration 5 -- -string(26) "

This is a paragraph

" --- Iteration 6 -- -string(65) "This is \ta text in bold letters\r\s\malong with slashes\n" -Done diff --git a/ext/standard/tests/strings/strip_tags_variation11.phpt b/ext/standard/tests/strings/strip_tags_variation11.phpt deleted file mode 100644 index 3b47b5c6b14ce..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation11.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test strip_tags() function : obscure values within attributes ---INI-- -short_open_tag = on ---FILE-- - world', - 'hello world', - 'hello world', - "hello world" -); - - -// Calling strip_tags() with default arguments -// loop through the $string_array to test strip_tags on various inputs -$iteration = 1; -foreach($string_array as $string) -{ - echo "-- Iteration $iteration --\n"; - var_dump( strip_tags($string) ); - $iteration++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : obscure functionality *** --- Iteration 1 -- -string(12) "hello world" --- Iteration 2 -- -string(12) "hello world" --- Iteration 3 -- -string(12) "hello world" --- Iteration 4 -- -string(12) "hello world" -Done diff --git a/ext/standard/tests/strings/strip_tags_variation2.phpt b/ext/standard/tests/strings/strip_tags_variation2.phpt deleted file mode 100644 index 5e0df80292f9b..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation2.phpt +++ /dev/null @@ -1,159 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - unexpected values for 'allowable_tags' ---INI-- -set short_open_tag = on ---FILE-- -hello

world

"; - -//get an unset variable -$unset_var = 10; -unset ($unset_var); - -//get a resource variable -$fp = fopen(__FILE__, "r"); - -//get a class -class classA{ - public function __toString(){ - return "Class A Object"; - } -} - -//array of values to iterate over -$values = array( - - // int data - 0, - 1, - 12345, - -2345, - - // float data - 10.5, - -10.5, - 10.5e10, - 10.6E-10, - .5, - - // array data - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new classA(), - - // undefined data - @$undefined_var, - - // unset data - @$unset_var, - - // resource variable - $fp -); - -// loop through each element of the array for allowable_tags -$iterator = 1; -foreach($values as $value) { - echo "-- Iteration $iterator --\n"; - var_dump( strip_tags($string, $value) ); - $iterator++; -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : usage variations *** --- Iteration 1 -- -string(10) "helloworld" --- Iteration 2 -- -string(10) "helloworld" --- Iteration 3 -- -string(10) "helloworld" --- Iteration 4 -- -string(10) "helloworld" --- Iteration 5 -- -string(10) "helloworld" --- Iteration 6 -- -string(10) "helloworld" --- Iteration 7 -- -string(10) "helloworld" --- Iteration 8 -- -string(10) "helloworld" --- Iteration 9 -- -string(10) "helloworld" --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d -string(10) "helloworld" --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d -string(10) "helloworld" --- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d -string(10) "helloworld" --- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d -string(10) "helloworld" --- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d -string(10) "helloworld" --- Iteration 15 -- -string(10) "helloworld" --- Iteration 16 -- -string(10) "helloworld" --- Iteration 17 -- -string(10) "helloworld" --- Iteration 18 -- -string(10) "helloworld" --- Iteration 19 -- -string(10) "helloworld" --- Iteration 20 -- -string(10) "helloworld" --- Iteration 21 -- -string(10) "helloworld" --- Iteration 22 -- -string(10) "helloworld" --- Iteration 23 -- -string(10) "helloworld" --- Iteration 24 -- -string(10) "helloworld" --- Iteration 25 -- -string(10) "helloworld" --- Iteration 26 -- -string(10) "helloworld" -Done diff --git a/ext/standard/tests/strings/strip_tags_variation3.phpt b/ext/standard/tests/strings/strip_tags_variation3.phpt deleted file mode 100644 index 1e1ed9efb7ba9..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation3.phpt +++ /dev/null @@ -1,167 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - unexpected values for both 'str' and 'allowable_tags' ---INI-- -set short_open_tag = on ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new classA(), - - // undefined data - @$undefined_var, - - // unset data - @$unset_var, - - // resource variable - $fp - -); - -// loop through each element of the array for allowable_tags -$iterator = 1; -foreach($values as $value) { - echo "-- Iteration $iterator --\n"; - var_dump( strip_tags($value, $value) ); - $iterator++; -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : usage variations *** --- Iteration 1 -- -string(1) "0" --- Iteration 2 -- -string(1) "1" --- Iteration 3 -- -string(5) "12345" --- Iteration 4 -- -string(5) "-2345" --- Iteration 5 -- -string(4) "10.5" --- Iteration 6 -- -string(5) "-10.5" --- Iteration 7 -- -string(12) "105000000000" --- Iteration 8 -- -string(7) "1.06E-9" --- Iteration 9 -- -string(3) "0.5" --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 15 -- -string(0) "" --- Iteration 16 -- -string(0) "" --- Iteration 17 -- -string(1) "1" --- Iteration 18 -- -string(0) "" --- Iteration 19 -- -string(1) "1" --- Iteration 20 -- -string(0) "" --- Iteration 21 -- -string(0) "" --- Iteration 22 -- -string(0) "" --- Iteration 23 -- -string(14) "Class A object" --- Iteration 24 -- -string(0) "" --- Iteration 25 -- -string(0) "" --- Iteration 26 -- -string(%d) "Resource id #%d" -Done diff --git a/ext/standard/tests/strings/strip_tags_variation4.phpt b/ext/standard/tests/strings/strip_tags_variation4.phpt deleted file mode 100644 index b6fd404227797..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation4.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - invalid values for 'str' and valid 'allowable_tags' ---INI-- -set short_open_tag = on ---FILE-- -hello \t\tworld... strip_tags_test", - 'hello \t\tworld... strip_tags_test', - "<%?php hello\t world?%>", - '<%?php hello\t world?%>', - "<>hello<>", - '<>hello<>', - "HtMl text", - 'HtMl text', - "I am not a valid html text", - 'I am not a valid html text', - "I am a quoted (\") string with special chars like \$,\!,\@,\%,\&", - 'I am a quoted (\") string with special chars like \$,\!,\@,\%,\&', -); - -//valid html and php tags -$quotes = "

"; - -//loop through the various elements of strings array to test strip_tags() functionality -$iterator = 1; -foreach($strings as $string_value) -{ - echo "-- Iteration $iterator --\n"; - var_dump( strip_tags($string_value, $quotes) ); - $iterator++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : usage variations *** --- Iteration 1 -- -string(32) "hello world... strip_tags_test" --- Iteration 2 -- -string(34) "hello \t\tworld... strip_tags_test" --- Iteration 3 -- -string(0) "" --- Iteration 4 -- -string(0) "" --- Iteration 5 -- -string(18) "hello" --- Iteration 6 -- -string(18) "hello" --- Iteration 7 -- -string(9) "HtMl text" --- Iteration 8 -- -string(9) "HtMl text" --- Iteration 9 -- -string(26) "I am not a valid html text" --- Iteration 10 -- -string(26) "I am not a valid html text" --- Iteration 11 -- -string(62) "I am a quoted (") string with special chars like $,\!,\@,\%,\&" --- Iteration 12 -- -string(64) "I am a quoted (\") string with special chars like \$,\!,\@,\%,\&" -Done diff --git a/ext/standard/tests/strings/strip_tags_variation5.phpt b/ext/standard/tests/strings/strip_tags_variation5.phpt deleted file mode 100644 index ae7c4f748f365..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation5.phpt +++ /dev/null @@ -1,105 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - heredoc strings ---INI-- -set short_open_tag = on ---FILE-- -hello world -

13 < 25

- -This is a double quoted string -EOT; - -// here doc with diferent whitespaces -$diff_whitespaces = <<hello\r world\t -1111\t\t != 2222\v\v - -EOT; - -// here doc with numeric values -$numeric_string = <<11 < 12. 123 >22 -

string

1111\t 0000\t = 0000\n -EOT; - -// heredoc with quote chars & slash -$quote_char_string = <<This's a string with quotes: -"strings in double quote"; -'strings in single quote'; -this\line is single quoted /with\slashes -EOT; - -$res_heredoc_strings = array( - //heredoc strings - $null_string, - $blank_line, - $multiline_string, - $diff_whitespaces, - $numeric_string, - $quote_char_string -); - -// initialize the second argument -$quotes = "
---EXPECTF-- -*** Testing strip_tags() : usage variations *** --- Iteration 1 -- -string(0) "" --- Iteration 2 -- -string(0) "" --- Iteration 3 -- -string(67) "hello world -13 < 25 - -This is a double quoted string" --- Iteration 4 -- -string(44) "hello - world -1111 != 2222 -" --- Iteration 5 -- -string(56) "11 < 12. 123 >22 -string 1111 0000 = 0000 -" --- Iteration 6 -- -string(150) "This's a string with quotes: -"strings in double quote"; -'strings in single quote'; -this\line is single quoted /with\slashes " -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strip_tags_variation6.phpt b/ext/standard/tests/strings/strip_tags_variation6.phpt deleted file mode 100644 index ff219063650cb..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation6.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - binary safe checking ---INI-- -set short_open_tag = on ---FILE-- - I am html string ".chr(0)."", - " I am html string\0 ", - b"I am html string", - "I am html string".decbin(65)."" -); - -//loop through the strings array to check if strip_tags() is binary safe -$iterator = 1; -foreach($strings as $value) -{ - echo "-- Iteration $iterator --\n"; - var_dump( strip_tags($value) ); - $iterator++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : usage variations *** --- Iteration 1 -- -string(18) " I am html string " --- Iteration 2 -- -string(18) " I am html string " --- Iteration 3 -- -string(16) "I am html string" --- Iteration 4 -- -string(23) "I am html string1000001" -Done diff --git a/ext/standard/tests/strings/strip_tags_variation7.phpt b/ext/standard/tests/strings/strip_tags_variation7.phpt deleted file mode 100644 index 1c76940b8f1cb..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation7.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - invalid values for 'str' and 'allowable_tags' ---INI-- -set short_open_tag = on ---FILE-- -hello \t\tworld... strip_tags_test", - 'hello \t\tworld... strip_tags_test', - "<%?php hello\t world?%>", - '<%?php hello\t world?%>', - "<>hello<>", - '<>hello<>', - "HtMl text", - 'HtMl text', - "I am not a valid html text", - 'I am not a valid html text', - "I am a quoted (\") string with special chars like \$,\!,\@,\%,\&", - 'I am a quoted (\") string with special chars like \$,\!,\@,\%,\&', -); - -$quotes = "<%?<>"; - -//loop through the various elements of strings array to test strip_tags() functionality -$iterator = 1; -foreach($strings as $string_value) -{ - echo "-- Iteration $iterator --\n"; - var_dump( strip_tags($string_value, $quotes) ); - $iterator++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing strip_tags() : usage variations *** --- Iteration 1 -- -string(43) "hello world... strip_tags_test" --- Iteration 2 -- -string(45) "hello \t\tworld... strip_tags_test" --- Iteration 3 -- -string(0) "" --- Iteration 4 -- -string(0) "" --- Iteration 5 -- -string(18) "hello" --- Iteration 6 -- -string(18) "hello" --- Iteration 7 -- -string(9) "HtMl text" --- Iteration 8 -- -string(9) "HtMl text" --- Iteration 9 -- -string(37) "I am not a valid html text" --- Iteration 10 -- -string(37) "I am not a valid html text" --- Iteration 11 -- -string(73) "I am a quoted (") string with special chars like $,\!,\@,\%,\&" --- Iteration 12 -- -string(75) "I am a quoted (\") string with special chars like \$,\!,\@,\%,\&" -Done diff --git a/ext/standard/tests/strings/strip_tags_variation8.phpt b/ext/standard/tests/strings/strip_tags_variation8.phpt deleted file mode 100644 index a8b45c1a2a051..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation8.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - valid value for 'str' and invalid values for 'allowable_tags' ---INI-- -set short_open_tag = on ---FILE-- -hello \tworld...

strip_tags_test\v\f

"; - -$quotes = array ( - "", - '', - "", - '', - "<%?php", - '<%?php', - "<>", - '<>' -); - -//loop through the various elements of strings array to test strip_tags() functionality -$iterator = 1; -foreach($quotes as $string_value) -{ - echo "-- Iteration $iterator --\n"; - var_dump( strip_tags($strings, $string_value) ); - $iterator++; -} - -echo "Done"; ---EXPECTF-- -*** Testing strip_tags() : usage variations *** --- Iteration 1 -- -string(33) "hello world... strip_tags_test " --- Iteration 2 -- -string(33) "hello world... strip_tags_test " --- Iteration 3 -- -string(33) "hello world... strip_tags_test " --- Iteration 4 -- -string(33) "hello world... strip_tags_test " --- Iteration 5 -- -string(33) "hello world... strip_tags_test " --- Iteration 6 -- -string(33) "hello world... strip_tags_test " --- Iteration 7 -- -string(46) "hello world... strip_tags_test " --- Iteration 8 -- -string(46) "hello world... strip_tags_test " -Done diff --git a/ext/standard/tests/strings/strip_tags_variation9.phpt b/ext/standard/tests/strings/strip_tags_variation9.phpt deleted file mode 100644 index b133fb356bdd9..0000000000000 --- a/ext/standard/tests/strings/strip_tags_variation9.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Test strip_tags() function : usage variations - double quoted strings ---INI-- -set short_open_tag = on ---FILE-- - \$ -> This represents the dollar sign", - "\t\r\v The quick brown fo\fx jumped over the lazy dog

", - "This is a hyper text tag", - "hello world\\t?>", - "

This is a paragraph

", - "This is \ta text in bold letters\r\s\malong with slashes\n" -); - -$quotes = "

$ -> This represents the dollar sign" --- Iteration 2 -- -string(59) " - The quick brown fo x jumped over the lazy dog

" --- Iteration 3 -- -string(31) "
This is a hyper text tag" --- Iteration 4 -- -string(0) "" --- Iteration 5 -- -string(26) "

This is a paragraph

" --- Iteration 6 -- -string(62) "This is a text in bold letters -\s\malong with slashes -" -Done diff --git a/ext/standard/tests/strings/stripos.phpt b/ext/standard/tests/strings/stripos.phpt deleted file mode 100644 index ef0efe5b236c8..0000000000000 --- a/ext/standard/tests/strings/stripos.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -stripos() function test ---FILE-- - ---EXPECT-- -int(0) -int(5) -int(5) -int(3) -int(10) -int(2) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(1) -Done diff --git a/ext/standard/tests/strings/stripos_basic1.phpt b/ext/standard/tests/strings/stripos_basic1.phpt deleted file mode 100644 index cffbdba1b5975..0000000000000 --- a/ext/standard/tests/strings/stripos_basic1.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Test stripos() function : basic functionality - with default arguments ---FILE-- - ---EXPECTF-- -*** Testing stripos() function: basic functionality *** --- With default arguments -- -int(0) -int(0) -int(7) -int(7) -int(4) -int(5) -int(0) -int(0) -int(0) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_basic2.phpt b/ext/standard/tests/strings/stripos_basic2.phpt deleted file mode 100644 index 3022bae168052..0000000000000 --- a/ext/standard/tests/strings/stripos_basic2.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test stripos() function : basic functionality - with all arguments ---FILE-- - ---EXPECTF-- -*** Testing stripos() function: basic functionality *** --- With all arguments -- -int(0) -bool(false) -int(7) -int(7) -int(0) -int(0) -bool(false) -int(0) -bool(false) -int(4) -int(8) -int(8) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_error.phpt b/ext/standard/tests/strings/stripos_error.phpt deleted file mode 100644 index ef6ad9e6ec2c2..0000000000000 --- a/ext/standard/tests/strings/stripos_error.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test stripos() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing stripos() function: error conditions *** - --- With Zero arguments -- -Warning: stripos() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- With less than expected number of arguments -- -Warning: stripos() expects at least 2 parameters, 1 given in %s on line %d -NULL - --- With more than expected number of arguments -- -Warning: stripos() expects at most 3 parameters, 4 given in %s on line %d -NULL -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation1.phpt b/ext/standard/tests/strings/stripos_variation1.phpt deleted file mode 100644 index f3e743cc028d9..0000000000000 --- a/ext/standard/tests/strings/stripos_variation1.phpt +++ /dev/null @@ -1,226 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - double quoted strings for 'haystack' & 'needle' arguments ---FILE-- -?@hello123456he \x234 \101 "; -$needle = array( - //regular strings - "l", - "L", - "HELLO", - "hEllo", - - //escape characters - "\t", - "\T", //invalid input - " ", - "\n", - "\N", //invalid input - " -", //new line - - //nulls - "\0", - NULL, - null, - - //boolean false - FALSE, - false, - - //empty string - "", - - //special chars - " ", - "$", - " $", - "&", - "!#", - "%\o", - "\o,", - "()", - "*+", - "+", - "-", - ".", - ".;", - ":;", - ";", - "<=>", - ">", - "=>", - "?", - "@", - "@hEllo", - - "12345", //decimal numeric string - "\x23", //hexadecimal numeric string - "#", //respective ASCII char of \x23 - "\101", //octal numeric string - "A", //respective ASCII char of \101 - "456HEE", //numerics + chars - $haystack //haystack as needle -); - -/* loop through to get the position of the needle in haystack string */ -$count = 1; -for($index=0; $index ---EXPECTF-- -*** Testing stripos() function: with double quoted strings *** --- Iteration 1 -- -int(2) -int(2) --- Iteration 2 -- -int(2) -int(2) --- Iteration 3 -- -int(0) -int(34) --- Iteration 4 -- -int(0) -int(34) --- Iteration 5 -- -int(6) -int(6) --- Iteration 6 -- -bool(false) -bool(false) --- Iteration 7 -- -bool(false) -bool(false) --- Iteration 8 -- -int(7) -int(7) --- Iteration 9 -- -bool(false) -bool(false) --- Iteration 10 -- -int(7) -int(9) --- Iteration 11 -- -int(8) -bool(false) --- Iteration 12 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) --- Iteration 13 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) --- Iteration 14 -- -int(8) -bool(false) --- Iteration 15 -- -int(8) -bool(false) --- Iteration 16 -- -bool(false) -bool(false) --- Iteration 17 -- -int(10) -int(47) --- Iteration 18 -- -int(12) -bool(false) --- Iteration 19 -- -int(11) -bool(false) --- Iteration 20 -- -int(13) -bool(false) --- Iteration 21 -- -int(14) -bool(false) --- Iteration 22 -- -int(16) -bool(false) --- Iteration 23 -- -int(17) -bool(false) --- Iteration 24 -- -int(20) -bool(false) --- Iteration 25 -- -int(22) -bool(false) --- Iteration 26 -- -int(23) -bool(false) --- Iteration 27 -- -int(24) -bool(false) --- Iteration 28 -- -int(25) -bool(false) --- Iteration 29 -- -bool(false) -bool(false) --- Iteration 30 -- -int(27) -bool(false) --- Iteration 31 -- -int(28) -bool(false) --- Iteration 32 -- -int(29) -bool(false) --- Iteration 33 -- -int(31) -bool(false) --- Iteration 34 -- -int(30) -bool(false) --- Iteration 35 -- -int(32) -bool(false) --- Iteration 36 -- -int(33) -bool(false) --- Iteration 37 -- -int(33) -bool(false) --- Iteration 38 -- -int(39) -int(39) --- Iteration 39 -- -int(15) -int(48) --- Iteration 40 -- -int(15) -int(48) --- Iteration 41 -- -int(51) -int(51) --- Iteration 42 -- -int(51) -int(51) --- Iteration 43 -- -bool(false) -bool(false) --- Iteration 44 -- -int(0) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation10.phpt b/ext/standard/tests/strings/stripos_variation10.phpt deleted file mode 100644 index 963545cf2fea4..0000000000000 --- a/ext/standard/tests/strings/stripos_variation10.phpt +++ /dev/null @@ -1,196 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - unexpected inputs for 'needle' argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop through each element of the 'needle' array to check the working of stripos() -$counter = 1; -for($index = 0; $index < count($needles); $index ++) { - echo "\n-- Iteration $counter --\n"; - var_dump( stripos($haystack, $needles[$index]) ); - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing stripos() function with unexpected values for needle *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - --- Iteration 11 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - --- Iteration 12 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - --- Iteration 13 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - --- Iteration 14 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - --- Iteration 23 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - --- Iteration 24 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -%s - --- Iteration 25 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - --- Iteration 26 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation11.phpt b/ext/standard/tests/strings/stripos_variation11.phpt deleted file mode 100644 index 4736761261934..0000000000000 --- a/ext/standard/tests/strings/stripos_variation11.phpt +++ /dev/null @@ -1,215 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - unexpected inputs for 'haystack' and 'needle' arguments ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of stripos() -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $haystack = $values[$index]; - var_dump( stripos($values[$index], $values[$index]) ); - var_dump( stripos($values[$index], $values[$index], 1) ); - $counter ++; -} - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing stripos() function with unexpected values for haystack and needle *** --- Iteration 1 -- -bool(false) -bool(false) --- Iteration 2 -- -bool(false) -bool(false) --- Iteration 3 -- -bool(false) -bool(false) --- Iteration 4 -- -bool(false) -bool(false) --- Iteration 5 -- -bool(false) -bool(false) --- Iteration 6 -- -bool(false) -bool(false) --- Iteration 7 -- -bool(false) -bool(false) --- Iteration 8 -- -bool(false) -bool(false) --- Iteration 9 -- -bool(false) -bool(false) --- Iteration 10 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 11 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 12 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 13 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 14 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 15 -- -bool(false) -bool(false) --- Iteration 16 -- -bool(false) - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 17 -- -bool(false) -bool(false) --- Iteration 18 -- -bool(false) - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 19 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) --- Iteration 20 -- -bool(false) - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 21 -- -bool(false) - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 22 -- -bool(false) - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 23 -- -bool(false) - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 24 -- - -Warning: stripos() expects parameter 1 to be string, resource given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, resource given in %s on line %d -NULL --- Iteration 25 -- -bool(false) - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 26 -- -bool(false) - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation12.phpt b/ext/standard/tests/strings/stripos_variation12.phpt deleted file mode 100644 index bd0d8aeb8f198..0000000000000 --- a/ext/standard/tests/strings/stripos_variation12.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - null terminated strings for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Test stripos() function: binary safe *** -int(5) -int(5) -int(0) -bool(false) -int(11) -int(11) -int(0) -bool(false) -int(5) -int(5) -int(0) -bool(false) -int(5) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation13.phpt b/ext/standard/tests/strings/stripos_variation13.phpt deleted file mode 100644 index 3c4508f0837ab..0000000000000 --- a/ext/standard/tests/strings/stripos_variation13.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - null terminated strings for 'needle' argument ---FILE-- - ---EXPECTF-- -*** Test stripos() function: binary safe *** -int(1) -int(1) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(1) -bool(false) -int(0) -bool(false) -int(1) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation14.phpt b/ext/standard/tests/strings/stripos_variation14.phpt deleted file mode 100644 index 023585dbb765b..0000000000000 --- a/ext/standard/tests/strings/stripos_variation14.phpt +++ /dev/null @@ -1,155 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - unexpected inputs for 'offset' argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - //resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of stripos() -$counter = 1; -for($index = 0; $index < count($offsets); $index ++) { - echo "-- Iteration $counter --\n"; - var_dump( stripos($haystack, $needle, $offsets[$index]) ); - $counter ++; -} - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing stripos() function with unexpected values for offset *** --- Iteration 1 -- -int(6) --- Iteration 2 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 4 -- -int(6) --- Iteration 5 -- -int(6) --- Iteration 6 -- - -Warning: stripos() expects parameter 3 to be long, array given in %s on line %d -NULL --- Iteration 7 -- - -Warning: stripos() expects parameter 3 to be long, array given in %s on line %d -NULL --- Iteration 8 -- - -Warning: stripos() expects parameter 3 to be long, array given in %s on line %d -NULL --- Iteration 9 -- - -Warning: stripos() expects parameter 3 to be long, array given in %s on line %d -NULL --- Iteration 10 -- - -Warning: stripos() expects parameter 3 to be long, array given in %s on line %d -NULL --- Iteration 11 -- -int(6) --- Iteration 12 -- -int(6) --- Iteration 13 -- -int(6) --- Iteration 14 -- -int(6) --- Iteration 15 -- - -Warning: stripos() expects parameter 3 to be long, object given in %s on line %d -NULL --- Iteration 16 -- - -Warning: stripos() expects parameter 3 to be long, string given in %s on line %d -NULL --- Iteration 17 -- - -Warning: stripos() expects parameter 3 to be long, string given in %s on line %d -NULL --- Iteration 18 -- -int(6) --- Iteration 19 -- -int(6) --- Iteration 20 -- - -Warning: stripos() expects parameter 3 to be long, resource given in %s on line %d -NULL --- Iteration 21 -- -int(6) --- Iteration 22 -- -int(6) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation15.phpt b/ext/standard/tests/strings/stripos_variation15.phpt deleted file mode 100644 index 2304c1d35003f..0000000000000 --- a/ext/standard/tests/strings/stripos_variation15.phpt +++ /dev/null @@ -1,171 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - unexpected inputs for 'haystack', 'needle' & 'offset' arguments ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - //resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of stripos() -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - var_dump( stripos($values[$index], $values[$index], $values[$index]) ); - $counter ++; -} - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing stripos() function with unexpected values for haystack, needle & offset *** --- Iteration 1 -- -bool(false) --- Iteration 2 -- -bool(false) --- Iteration 3 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 7 -- - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) --- Iteration 8 -- -bool(false) --- Iteration 9 -- -bool(false) --- Iteration 10 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 11 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 12 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 13 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 14 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 15 -- -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- - -Warning: stripos() expects parameter 3 to be long, object given in %s on line %d -NULL --- Iteration 20 -- - -Warning: stripos() expects parameter 3 to be long, string given in %s on line %d -NULL --- Iteration 21 -- - -Warning: stripos() expects parameter 3 to be long, string given in %s on line %d -NULL --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- - -Warning: stripos() expects parameter 1 to be string, resource given in %s on line %d -NULL --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation2.phpt b/ext/standard/tests/strings/stripos_variation2.phpt deleted file mode 100644 index e4d8a153e0cf0..0000000000000 --- a/ext/standard/tests/strings/stripos_variation2.phpt +++ /dev/null @@ -1,234 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - single quoted strings for 'haystack' & 'needle' arguments ---FILE-- -?@hello123456he \x234 \101 '; -$needle = array( - //regular strings - 'l', - 'L', - 'HELLO', - 'hEllo', - - //escape characters - '\t', - '\T', - ' ', - '\n', - '\N', - ' -', //new line - - //nulls - '\0', - NULL, - null, - - //boolean false - FALSE, - false, - - //empty string - '', - - //special chars - ' ', - '$', - ' $', - '&', - '!#', - '%\o', - '\o,', - '()', - '*+', - '+', - '-', - '.', - '.;', - '.;', - ':;', - ';', - '<=>', - '>', - '=>', - '?', - '@', - '@hEllo', - - '12345', //decimal numeric string - '\x23', //hexadecimal numeric string - '#', //hexadecimal numeric string - '\101', //octal numeric string - 'A', - '456HEE', //numerics + chars - 42, //needle as int(ASCII value of '*') - $haystack //haystack as needle -); - -/* loop through to get the position of the needle in haystack string */ -$count = 1; -for($index=0; $index ---EXPECTF-- -*** Testing stripos() function: with single quoted strings *** --- Iteration 1 -- -int(2) -int(2) --- Iteration 2 -- -int(2) -int(2) --- Iteration 3 -- -int(0) -int(38) --- Iteration 4 -- -int(0) -int(38) --- Iteration 5 -- -int(6) -int(6) --- Iteration 6 -- -int(6) -int(6) --- Iteration 7 -- -bool(false) -bool(false) --- Iteration 8 -- -int(8) -int(8) --- Iteration 9 -- -int(8) -int(8) --- Iteration 10 -- -bool(false) -bool(false) --- Iteration 11 -- -int(10) -int(10) --- Iteration 12 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) --- Iteration 13 -- - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) - -Warning: stripos(): needle is not a string or an integer in %s on line %d -bool(false) --- Iteration 14 -- -bool(false) -bool(false) --- Iteration 15 -- -bool(false) -bool(false) --- Iteration 16 -- -bool(false) -bool(false) --- Iteration 17 -- -int(14) -int(51) --- Iteration 18 -- -int(16) -bool(false) --- Iteration 19 -- -int(15) -bool(false) --- Iteration 20 -- -int(17) -bool(false) --- Iteration 21 -- -int(18) -bool(false) --- Iteration 22 -- -int(20) -bool(false) --- Iteration 23 -- -int(21) -bool(false) --- Iteration 24 -- -int(24) -int(24) --- Iteration 25 -- -int(26) -int(26) --- Iteration 26 -- -int(27) -int(27) --- Iteration 27 -- -int(28) -int(28) --- Iteration 28 -- -int(29) -int(29) --- Iteration 29 -- -bool(false) -bool(false) --- Iteration 30 -- -bool(false) -bool(false) --- Iteration 31 -- -int(31) -int(31) --- Iteration 32 -- -int(32) -int(32) --- Iteration 33 -- -int(33) -int(33) --- Iteration 34 -- -int(35) -int(35) --- Iteration 35 -- -int(34) -int(34) --- Iteration 36 -- -int(36) -int(36) --- Iteration 37 -- -int(37) -int(37) --- Iteration 38 -- -int(37) -int(37) --- Iteration 39 -- -int(43) -int(43) --- Iteration 40 -- -int(52) -int(52) --- Iteration 41 -- -int(19) -bool(false) --- Iteration 42 -- -int(58) -int(58) --- Iteration 43 -- -bool(false) -bool(false) --- Iteration 44 -- -bool(false) -bool(false) --- Iteration 45 -- -int(26) -bool(false) --- Iteration 46 -- -int(0) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation3.phpt b/ext/standard/tests/strings/stripos_variation3.phpt deleted file mode 100644 index 40cdea48fe8ca..0000000000000 --- a/ext/standard/tests/strings/stripos_variation3.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - multi line heredoc string for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing stripos() function: with heredoc strings *** --- With heredoc string containing multi lines -- -int(14) -int(23) -int(23) -bool(false) -int(7) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation4.phpt b/ext/standard/tests/strings/stripos_variation4.phpt deleted file mode 100644 index 8249ef0f608d1..0000000000000 --- a/ext/standard/tests/strings/stripos_variation4.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - heredoc string containing special chars for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing stripos() function: with heredoc strings *** --- With heredoc string containing special chars -- -int(0) -bool(false) -int(38) -int(39) -int(55) -int(55) -int(57) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation5.phpt b/ext/standard/tests/strings/stripos_variation5.phpt deleted file mode 100644 index 900fe04bb7eeb..0000000000000 --- a/ext/standard/tests/strings/stripos_variation5.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - heredoc string containing escape chars for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing stripos() function: with heredoc strings *** --- With heredoc string containing escape characters -- -int(12) -int(19) -int(12) -int(19) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation6.phpt b/ext/standard/tests/strings/stripos_variation6.phpt deleted file mode 100644 index c69ee174d1990..0000000000000 --- a/ext/standard/tests/strings/stripos_variation6.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - heredoc string containing quotes for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing stripos() function: with heredoc strings *** --- With heredoc string containing quote & slash chars -- -int(88) -int(34) -int(34) -int(34) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation7.phpt b/ext/standard/tests/strings/stripos_variation7.phpt deleted file mode 100644 index 29a0a20469ac3..0000000000000 --- a/ext/standard/tests/strings/stripos_variation7.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - empty heredoc string for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing stripos() function: with heredoc strings *** --- With empty heredoc string -- -bool(false) - -Warning: stripos(): Offset not contained in string in %s on line %d -bool(false) -bool(false) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation8.phpt b/ext/standard/tests/strings/stripos_variation8.phpt deleted file mode 100644 index cbf96bf12a32d..0000000000000 --- a/ext/standard/tests/strings/stripos_variation8.phpt +++ /dev/null @@ -1,216 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - repetitive chars for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing stripos() function: strings repetitive chars *** - --- Iteration 1 -- -int(0) -int(2) -int(2) -int(4) -int(4) -int(6) -int(6) -int(8) -int(8) -int(10) -int(10) -int(12) -int(12) -int(14) -int(14) -int(16) -int(16) -bool(false) -bool(false) -bool(false) - --- Iteration 2 -- -int(0) -int(2) -int(2) -int(4) -int(4) -int(6) -int(6) -int(8) -int(8) -int(10) -int(10) -int(12) -int(12) -int(14) -int(14) -int(16) -int(16) -bool(false) -bool(false) -bool(false) - --- Iteration 3 -- -int(0) -int(2) -int(2) -int(4) -int(4) -int(6) -int(6) -int(8) -int(8) -int(10) -int(10) -int(12) -int(12) -int(14) -int(14) -int(16) -int(16) -bool(false) -bool(false) -bool(false) - --- Iteration 4 -- -int(0) -int(2) -int(2) -int(4) -int(4) -int(6) -int(6) -int(8) -int(8) -int(10) -int(10) -int(12) -int(12) -int(14) -int(14) -int(16) -int(16) -bool(false) -bool(false) -bool(false) - --- Iteration 5 -- -int(1) -int(1) -int(3) -int(3) -int(5) -int(5) -int(7) -int(7) -int(9) -int(9) -int(11) -int(11) -int(13) -int(13) -int(15) -int(15) -bool(false) -bool(false) -bool(false) -bool(false) - --- Iteration 6 -- -int(1) -int(1) -int(3) -int(3) -int(5) -int(5) -int(7) -int(7) -int(9) -int(9) -int(11) -int(11) -int(13) -int(13) -int(15) -int(15) -bool(false) -bool(false) -bool(false) -bool(false) - --- Iteration 7 -- -int(1) -int(1) -int(3) -int(3) -int(5) -int(5) -int(7) -int(7) -int(9) -int(9) -int(11) -int(11) -int(13) -int(13) -int(15) -int(15) -bool(false) -bool(false) -bool(false) -bool(false) - --- Iteration 8 -- -int(1) -int(1) -int(3) -int(3) -int(5) -int(5) -int(7) -int(7) -int(9) -int(9) -int(11) -int(11) -int(13) -int(13) -int(15) -int(15) -bool(false) -bool(false) -bool(false) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripos_variation9.phpt b/ext/standard/tests/strings/stripos_variation9.phpt deleted file mode 100644 index 1401dcfae8f8c..0000000000000 --- a/ext/standard/tests/strings/stripos_variation9.phpt +++ /dev/null @@ -1,184 +0,0 @@ ---TEST-- -Test stripos() function : usage variations - unexpected inputs for 'haystack' argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -$needle = "heredoc 0 1 2 -2 10.5 -10.5 10.5e10 10.6E-10 .5 array true false object \"\" null Resource"; - -// loop through each element of the array and check the working of stripos() -$counter = 1; -for($index = 0; $index < count($haystacks); $index ++) { - echo "\n-- Iteration $counter --\n"; - var_dump( stripos($haystacks[$index], $needle) ); - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing stripos() function with unexpected values for haystack *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 11 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 12 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 13 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 14 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- - -Warning: stripos() expects parameter 1 to be string, resource given in %s on line %d -NULL - --- Iteration 25 -- -bool(false) - --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/stripslashes_basic.phpt b/ext/standard/tests/strings/stripslashes_basic.phpt deleted file mode 100644 index 548aee5376ce0..0000000000000 Binary files a/ext/standard/tests/strings/stripslashes_basic.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/stripslashes_error.phpt b/ext/standard/tests/strings/stripslashes_error.phpt deleted file mode 100644 index cef09fc2df8bb..0000000000000 --- a/ext/standard/tests/strings/stripslashes_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test stripslashes() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing stripslashes() : error conditions *** - --- Testing stripslashes() function with Zero arguments -- - -Warning: Wrong parameter count for stripslashes() in %s on line %d -NULL - --- Testing stripslashes() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for stripslashes() in %s on line %d -NULL -string(18) "\"hello\"\"world\"" -Done diff --git a/ext/standard/tests/strings/stripslashes_variation1.phpt b/ext/standard/tests/strings/stripslashes_variation1.phpt deleted file mode 100644 index 4d58fd7a0543e..0000000000000 --- a/ext/standard/tests/strings/stripslashes_variation1.phpt +++ /dev/null @@ -1,170 +0,0 @@ ---TEST-- -Test stripslashes() function : usage variations - non-string type argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // empty string - "", - '', - - // undefined variable - $undefined_var, - - // unset variable - $unset_var, - - // objects - new sample(), - - // resource - $file_handle, - - // NULL values - NULL, - null -); - - -// loop through each element of the array and check the working of stripslashes() -// when $str arugment is supplied with different values -echo "\n--- Testing stripslashes() by supplying different values for 'str' argument ---\n"; -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $str = $values [$index]; - - var_dump( stripslashes($str) ); - - $counter ++; -} - -// closing the file -fclose($file_handle); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing stripslashes() : with non-string type argument *** - -Notice: Undefined variable: undefined_var in %s on line %d - -Notice: Undefined variable: unset_var in %s on line %d - ---- Testing stripslashes() by supplying different values for 'str' argument --- --- Iteration 1 -- -string(1) "0" --- Iteration 2 -- -string(1) "1" --- Iteration 3 -- -string(5) "12345" --- Iteration 4 -- -string(5) "-2345" --- Iteration 5 -- -string(4) "10.5" --- Iteration 6 -- -string(5) "-10.5" --- Iteration 7 -- -string(12) "105000000000" --- Iteration 8 -- -string(7) "1.06E-9" --- Iteration 9 -- -string(3) "0.5" --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 15 -- -string(1) "1" --- Iteration 16 -- -string(0) "" --- Iteration 17 -- -string(1) "1" --- Iteration 18 -- -string(0) "" --- Iteration 19 -- -string(0) "" --- Iteration 20 -- -string(0) "" --- Iteration 21 -- -string(0) "" --- Iteration 22 -- -string(0) "" --- Iteration 23 -- -string(6) "obj'ct" --- Iteration 24 -- -string(%d) "Resource id #%d" --- Iteration 25 -- -string(0) "" --- Iteration 26 -- -string(0) "" -Done diff --git a/ext/standard/tests/strings/stripslashes_variation2.phpt b/ext/standard/tests/strings/stripslashes_variation2.phpt deleted file mode 100644 index c86cd5890ce32..0000000000000 Binary files a/ext/standard/tests/strings/stripslashes_variation2.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/stripslashes_variation3.phpt b/ext/standard/tests/strings/stripslashes_variation3.phpt deleted file mode 100644 index 2ccf97ffd29fd..0000000000000 --- a/ext/standard/tests/strings/stripslashes_variation3.phpt +++ /dev/null @@ -1,124 +0,0 @@ ---TEST-- -Test stripslashes() function : usage variations - strings with newline and tab characters ---FILE-- - ---EXPECTF-- -*** Testing stripslashes() : with strings containing newline and tab characters *** - --- Iteration 1 -- -string(1) " -" - --- Iteration 2 -- -string(1) "n" - --- Iteration 3 -- -string(12) "Hello -world" - --- Iteration 4 -- -string(12) "Hello nworld" - --- Iteration 5 -- -string(1) "n" - --- Iteration 6 -- -string(1) "n" - --- Iteration 7 -- -string(12) "Hello nworld" - --- Iteration 8 -- -string(12) "Hello nworld" - --- Iteration 9 -- -string(71) "This is line 1 -of 'heredoc' string -This is line 2 -of "heredoc" string" - --- Iteration 10 -- -string(1) " " - --- Iteration 11 -- -string(1) "t" - --- Iteration 12 -- -string(12) "Hello world" - --- Iteration 13 -- -string(12) "Hello tworld" - --- Iteration 14 -- -string(1) "t" - --- Iteration 15 -- -string(1) "t" - --- Iteration 16 -- -string(12) "Hello tworld" - --- Iteration 17 -- -string(12) "Hello tworld" - --- Iteration 18 -- -string(71) "This is line 1 of 'heredoc' string -This is line 2 of "heredoc" string" -Done diff --git a/ext/standard/tests/strings/stripslashes_variation4.phpt b/ext/standard/tests/strings/stripslashes_variation4.phpt deleted file mode 100644 index eccca6a64d435..0000000000000 --- a/ext/standard/tests/strings/stripslashes_variation4.phpt +++ /dev/null @@ -1,133 +0,0 @@ ---TEST-- -Test stripslashes() function : usage variations - double dimensional arrays ---FILE-- - ---EXPECTF-- -*** Testing stripslashes() : with double dimensional arrays *** - --- Iteration 1 -- -array(2) { - [0]=> - string(0) "" - [1]=> - array(0) { - } -} - --- Iteration 2 -- -array(2) { - [0]=> - string(0) "" - [1]=> - array(1) { - [0]=> - string(0) "" - } -} - --- Iteration 3 -- -array(3) { - [0]=> - string(4) "f'oo" - [1]=> - string(4) "b'ar" - [2]=> - array(2) { - [0]=> - string(4) "fo'o" - [1]=> - string(4) "b'ar" - } -} - --- Iteration 4 -- -array(3) { - [0]=> - string(4) "f'oo" - [1]=> - string(4) "b'ar" - [2]=> - array(1) { - [0]=> - string(0) "" - } -} - --- Iteration 5 -- -array(3) { - [0]=> - string(4) "f'oo" - [1]=> - string(4) "b'ar" - [2]=> - array(3) { - [0]=> - string(4) "fo'o" - [1]=> - string(4) "b'ar" - [2]=> - array(1) { - [0]=> - string(0) "" - } - } -} - --- Iteration 6 -- -array(3) { - [0]=> - string(4) "f'oo" - [1]=> - string(4) "b'ar" - [2]=> - array(3) { - [0]=> - string(4) "fo'o" - [1]=> - string(4) "b'ar" - [2]=> - array(2) { - [0]=> - string(4) "fo'o" - [1]=> - string(4) "b'ar" - } - } -} -Done diff --git a/ext/standard/tests/strings/stripslashes_variation5.phpt b/ext/standard/tests/strings/stripslashes_variation5.phpt deleted file mode 100644 index 0507e04960797..0000000000000 Binary files a/ext/standard/tests/strings/stripslashes_variation5.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/stristr.phpt b/ext/standard/tests/strings/stristr.phpt deleted file mode 100644 index 51c4dae97c166..0000000000000 --- a/ext/standard/tests/strings/stristr.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -stristr() function ---FILE-- - ---EXPECTF-- -Warning: Wrong parameter count for stristr() in %s on line %d -NULL - -Notice: Array to string conversion in %s on line %d - -Warning: stristr(): Empty delimiter in %s on line %d -bool(false) -bool(false) - -Notice: Array to string conversion in %s on line %d -bool(false) -string(11) "tEsT sTrInG" -string(6) "sTrInG" -string(6) "sTrInG" -string(8) "T sTrInG" -string(1) "G" -string(32) "7272696018bdeb2c9a3f8d01fc2a9273" -bool(false) -bool(false) -bool(false) -string(32) "6ec19f52f0766c463f3bb240f4396913" -string(7) " sTrInG" diff --git a/ext/standard/tests/strings/strlen.phpt b/ext/standard/tests/strings/strlen.phpt deleted file mode 100644 index 1a9e5a11fdd32..0000000000000 Binary files a/ext/standard/tests/strings/strlen.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strncasecmp_basic.phpt b/ext/standard/tests/strings/strncasecmp_basic.phpt deleted file mode 100644 index 34a1b08dc4af1..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_basic.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test strncasecmp() function : basic functionality ---FILE-- - 0 - -echo "-- Testing strncasecmp() with double quoted string --\n"; -var_dump( strncasecmp("Hello", "Hello", 5) ); //expected: int(0) -var_dump( strncasecmp("Hello", "Hi", 5) ); //expected: value < 0 -var_dump( strncasecmp("Hi", "Hello", 5) ); //expected: value > 0 - -echo "-- Testing strncasecmp() with here-doc string --\n"; -$str = << 0 - -echo "*** Done ***"; -?> ---EXPECTREGEX-- -\*\*\* Testing strncasecmp\(\) function: basic functionality \*\*\* --- Testing strncasecmp\(\) with single quoted string -- -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) --- Testing strncasecmp\(\) with double quoted string -- -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) --- Testing strncasecmp\(\) with here-doc string -- -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) -\*\*\* Done \*\*\* diff --git a/ext/standard/tests/strings/strncasecmp_error.phpt b/ext/standard/tests/strings/strncasecmp_error.phpt deleted file mode 100644 index 7282ea95412c3..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_error.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test strncasecmp() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing strncasecmp() function: error conditions *** - --- Testing strncasecmp() function with Zero arguments -- -Warning: Wrong parameter count for strncasecmp() in %s on line %d -NULL - --- Testing strncasecmp() function with less than expected number of arguments -- -Warning: Wrong parameter count for strncasecmp() in %s on line %d -NULL - -Warning: Wrong parameter count for strncasecmp() in %s on line %d -NULL - --- Testing strncasecmp() function with more than expected number of arguments -- -Warning: Wrong parameter count for strncasecmp() in %s on line %d -NULL - --- Testing strncasecmp() function with invalid argument -- -Warning: Length must be greater than or equal to 0 in %s on line %d -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strncasecmp_variation1.phpt b/ext/standard/tests/strings/strncasecmp_variation1.phpt deleted file mode 100644 index bcc6ad3d069ec..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation1.phpt +++ /dev/null @@ -1,135 +0,0 @@ ---TEST-- -Test strncasecmp() function: usage variations - case-sensitivity ---FILE-- - ---EXPECTF-- -*** Test strncasecmp() function: with alphabets *** --- Passing upper-case letters for 'str1' -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Passing lower-case letters for 'str1' -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/strncasecmp_variation10.phpt b/ext/standard/tests/strings/strncasecmp_variation10.phpt deleted file mode 100644 index e06b2b26bfa05..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation10.phpt +++ /dev/null @@ -1,184 +0,0 @@ ---TEST-- -Test strncasecmp() function : usage variations - unexpected values for 'str1' ---FILE-- - 'red', 'item' => 'pen'), - - /* boolean values */ - true, - false, - TRUE, - FALSE, - - /* nulls */ - NULL, - null, - - /* empty string */ - "", - '', - - /* undefined variable */ - @$undefined_var, - - /* unset variable */ - @$unset_var, - - /* resource */ - $file_handle, - - /* object */ - new sample() -); - -/* loop through each element of the array and check the working of strncasecmp() */ -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $str1 = $values[$index]; - $len = strlen($values[$index]) + 1; - var_dump( strncasecmp($str1, "string", $len) ); - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***\n"; -?> ---EXPECTF-- -*** Testing strncasecmp() function: with unexpected values for 'str1' *** --- Iteration 1 -- -int(-%d) --- Iteration 2 -- -int(-%d) --- Iteration 3 -- -int(-%d) --- Iteration 4 -- -int(-%d) --- Iteration 5 -- -int(-%d) --- Iteration 6 -- -int(-%d) --- Iteration 7 -- -int(-%d) --- Iteration 8 -- -int(-%d) --- Iteration 9 -- -int(-%d) --- Iteration 10 -- -int(-%d) --- Iteration 11 -- -int(-%d) --- Iteration 12 -- -int(-%d) --- Iteration 13 -- -int(-%d) --- Iteration 14 -- -int(-%d) --- Iteration 15 -- - -Notice: Array to string conversion in %s on line 88 - -Notice: Array to string conversion in %s on line 89 -int(-%d) --- Iteration 16 -- - -Notice: Array to string conversion in %s on line 88 - -Notice: Array to string conversion in %s on line 89 -int(-%d) --- Iteration 17 -- - -Notice: Array to string conversion in %s on line 88 - -Notice: Array to string conversion in %s on line 89 -int(-%d) --- Iteration 18 -- - -Notice: Array to string conversion in %s on line 88 - -Notice: Array to string conversion in %s on line 89 -int(-%d) --- Iteration 19 -- - -Notice: Array to string conversion in %s on line 88 - -Notice: Array to string conversion in %s on line 89 -int(-%d) --- Iteration 20 -- -int(-%d) --- Iteration 21 -- -int(-%d) --- Iteration 22 -- -int(-%d) --- Iteration 23 -- -int(-%d) --- Iteration 24 -- -int(-%d) --- Iteration 25 -- -int(-%d) --- Iteration 26 -- -int(-%d) --- Iteration 27 -- -int(-%d) --- Iteration 28 -- -int(-%d) --- Iteration 29 -- -int(-%d) --- Iteration 30 -- -int(-%d) --- Iteration 31 -- -int(-%d) -*** Done *** diff --git a/ext/standard/tests/strings/strncasecmp_variation11.phpt b/ext/standard/tests/strings/strncasecmp_variation11.phpt deleted file mode 100644 index f756c6c006013..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation11.phpt +++ /dev/null @@ -1,185 +0,0 @@ ---TEST-- -Test strncasecmp() function : usage variations - unexpected values for 'str2' ---FILE-- - 'red', 'item' => 'pen'), - - /* boolean values */ - true, - false, - TRUE, - FALSE, - - /* nulls */ - NULL, - null, - - /* empty string */ - "", - '', - - /* undefined variable */ - @$undefined_var, - - /* unset variable */ - @$unset_var, - - /* resource */ - $file_handle, - - /* object */ - new sample() -); - -/* loop through each element of the array and check the working of strncasecmp() */ -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $str1 = $values[$index]; - $str2 = $values[$index]; - $len = strlen($values[$index]) + 1; - var_dump( strncasecmp("string", $str2, $len) ); - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***\n"; -?> ---EXPECTF-- -*** Testing strncasecmp() function: with unexpected values for 'str2' *** --- Iteration 1 -- -int(%d) --- Iteration 2 -- -int(%d) --- Iteration 3 -- -int(%d) --- Iteration 4 -- -int(%d) --- Iteration 5 -- -int(%d) --- Iteration 6 -- -int(%d) --- Iteration 7 -- -int(%d) --- Iteration 8 -- -int(%d) --- Iteration 9 -- -int(%d) --- Iteration 10 -- -int(%d) --- Iteration 11 -- -int(%d) --- Iteration 12 -- -int(%d) --- Iteration 13 -- -int(%d) --- Iteration 14 -- -int(%d) --- Iteration 15 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(%d) --- Iteration 16 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(%d) --- Iteration 17 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(%d) --- Iteration 18 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(%d) --- Iteration 19 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(%d) --- Iteration 20 -- -int(%d) --- Iteration 21 -- -int(%d) --- Iteration 22 -- -int(%d) --- Iteration 23 -- -int(%d) --- Iteration 24 -- -int(%d) --- Iteration 25 -- -int(%d) --- Iteration 26 -- -int(%d) --- Iteration 27 -- -int(%d) --- Iteration 28 -- -int(%d) --- Iteration 29 -- -int(%d) --- Iteration 30 -- -int(%d) --- Iteration 31 -- -int(%d) -*** Done *** diff --git a/ext/standard/tests/strings/strncasecmp_variation2.phpt b/ext/standard/tests/strings/strncasecmp_variation2.phpt deleted file mode 100644 index a6f8c1ebb8bcb..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation2.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Test strncasecmp() function: usage variations - double quoted strings ---FILE-- - ---EXPECTREGEX-- -\*\*\* Test strncasecmp\(\) function: with double quoted strings \*\*\* --- Iteration 1 -- -int\(0\) -int\(0\) -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) --- Iteration 2 -- -int\(0\) -int\(0\) -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) --- Iteration 3 -- -int\(0\) -int\(0\) -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) --- Iteration 4 -- -int\([1-9][0-9]*\) -int\([1-9][0-9]*\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) --- Iteration 5 -- -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(0\) -\*\*\* Done \*\*\* diff --git a/ext/standard/tests/strings/strncasecmp_variation3.phpt b/ext/standard/tests/strings/strncasecmp_variation3.phpt deleted file mode 100644 index 8409260b2e81e..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation3.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test strncasecmp() function: usage variations - various lengths ---FILE-- -= 0; $len--) { - var_dump( strncasecmp($str1, $str2, $len) ); -} -echo "*** Done ***\n"; -?> ---EXPECTF-- -*** Test strncasecmp() function: with different lengths *** -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/strncasecmp_variation4.phpt b/ext/standard/tests/strings/strncasecmp_variation4.phpt deleted file mode 100644 index 3f73aa3518812..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation4.phpt +++ /dev/null @@ -1,195 +0,0 @@ ---TEST-- -Test strncasecmp() function : usage variations - unexpected values for 'str1' & 'str2' ---FILE-- - 'red', 'item' => 'pen'), - - /* boolean values */ - true, - false, - TRUE, - FALSE, - - /* nulls */ - NULL, - null, - - /* empty string */ - "", - '', - - /* undefined variable */ - @$undefined_var, - - /* unset variable */ - @$unset_var, - - /* resource */ - $file_handle, - - /* object */ - new sample() -); - -/* loop through each element of the array and check the working of strncasecmp() */ -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $str1 = $values[$index]; - $str2 = $values[$index]; - $len = strlen($values[$index]) + 1; - var_dump( strncasecmp($str1, $str2, $len) ); - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***\n"; -?> ---EXPECTF-- -*** Testing strncasecmp() function: with unexpected values for 'str1' and 'str2' *** --- Iteration 1 -- -int(0) --- Iteration 2 -- -int(0) --- Iteration 3 -- -int(0) --- Iteration 4 -- -int(0) --- Iteration 5 -- -int(0) --- Iteration 6 -- -int(0) --- Iteration 7 -- -int(0) --- Iteration 8 -- -int(0) --- Iteration 9 -- -int(0) --- Iteration 10 -- -int(0) --- Iteration 11 -- -int(0) --- Iteration 12 -- -int(0) --- Iteration 13 -- -int(0) --- Iteration 14 -- -int(0) --- Iteration 15 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 16 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 17 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 18 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 19 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 20 -- -int(0) --- Iteration 21 -- -int(0) --- Iteration 22 -- -int(0) --- Iteration 23 -- -int(0) --- Iteration 24 -- -int(0) --- Iteration 25 -- -int(0) --- Iteration 26 -- -int(0) --- Iteration 27 -- -int(0) --- Iteration 28 -- -int(0) --- Iteration 29 -- -int(0) --- Iteration 30 -- -int(0) --- Iteration 31 -- -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/strncasecmp_variation5.phpt b/ext/standard/tests/strings/strncasecmp_variation5.phpt deleted file mode 100644 index 4a9fa89a7ce63..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation5.phpt +++ /dev/null @@ -1,147 +0,0 @@ ---TEST-- -Test strncasecmp() function : usage variations - unexpected values for 'len' ---FILE-- - 'red', 'item' => 'pen'), - - /* boolean values */ - true, - false, - TRUE, - FALSE, - - /* nulls */ - NULL, - null, - - /* empty string */ - "", - '', - - /* undefined variable */ - @$undefined_var, - - /* unset variable */ - @$unset_var, - - /* resource */ - $file_handle, - - /* object */ - new sample() -); - -/* loop through each element of the array and check the working of strncasecmp() */ -$counter = 1; -for($index = 0; $index < count($lengths); $index ++) { - $len = $lengths[$index]; - echo "-- Iteration $counter --\n"; - var_dump( strncasecmp($str1, $str2, $len) ); - $counter ++; -} -fclose($file_handle); - -echo "*** Done ***\n"; -?> ---EXPECTF-- -*** Test strncasecmp() function: unexpected values for 'len' *** --- Iteration 1 -- -int(0) --- Iteration 2 -- -int(0) --- Iteration 3 -- -int(0) --- Iteration 4 -- -int(0) --- Iteration 5 -- -int(0) --- Iteration 6 -- -int(0) --- Iteration 7 -- -int(0) --- Iteration 8 -- -int(0) --- Iteration 9 -- -int(0) --- Iteration 10 -- -int(0) --- Iteration 11 -- -int(0) --- Iteration 12 -- -int(0) --- Iteration 13 -- -int(0) --- Iteration 14 -- -int(0) --- Iteration 15 -- -int(0) --- Iteration 16 -- -int(0) --- Iteration 17 -- -int(0) --- Iteration 18 -- -int(0) --- Iteration 19 -- -int(0) --- Iteration 20 -- -int(0) --- Iteration 21 -- -int(0) --- Iteration 22 -- -int(0) --- Iteration 23 -- -int(0) --- Iteration 24 -- - -Notice: Object of class sample could not be converted to int in %s on line %d -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/strncasecmp_variation6.phpt b/ext/standard/tests/strings/strncasecmp_variation6.phpt deleted file mode 100644 index 765032b77347b..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation6.phpt +++ /dev/null @@ -1,810 +0,0 @@ ---TEST-- -Test strncasecmp() function : usage variations - binary safe - all ASCII chars ---FILE-- - ---EXPECTF-- -*** Test strncasecmp() function: with binary inputs *** - --- Checking with all 256 characters given, in binary format -- --- Iteration 1 -- -int(0) -int(0) --- Iteration 2 -- -int(0) -int(0) --- Iteration 3 -- -int(0) -int(0) --- Iteration 4 -- -int(0) -int(0) --- Iteration 5 -- -int(0) -int(0) --- Iteration 6 -- -int(0) -int(0) --- Iteration 7 -- -int(0) -int(0) --- Iteration 8 -- -int(0) -int(0) --- Iteration 9 -- -int(0) -int(0) --- Iteration 10 -- -int(0) -int(0) --- Iteration 11 -- -int(0) -int(0) --- Iteration 12 -- -int(0) -int(0) --- Iteration 13 -- -int(0) -int(0) --- Iteration 14 -- -int(0) -int(0) --- Iteration 15 -- -int(0) -int(0) --- Iteration 16 -- -int(0) -int(0) --- Iteration 17 -- -int(0) -int(0) --- Iteration 18 -- -int(0) -int(0) --- Iteration 19 -- -int(0) -int(0) --- Iteration 20 -- -int(0) -int(0) --- Iteration 21 -- -int(0) -int(0) --- Iteration 22 -- -int(0) -int(0) --- Iteration 23 -- -int(0) -int(0) --- Iteration 24 -- -int(0) -int(0) --- Iteration 25 -- -int(0) -int(0) --- Iteration 26 -- -int(0) -int(0) --- Iteration 27 -- -int(0) -int(0) --- Iteration 28 -- -int(0) -int(0) --- Iteration 29 -- -int(0) -int(0) --- Iteration 30 -- -int(0) -int(0) --- Iteration 31 -- -int(0) -int(0) --- Iteration 32 -- -int(0) -int(0) --- Iteration 33 -- -int(0) -int(0) --- Iteration 34 -- -int(0) -int(0) --- Iteration 35 -- -int(0) -int(0) --- Iteration 36 -- -int(0) -int(0) --- Iteration 37 -- -int(0) -int(0) --- Iteration 38 -- -int(0) -int(0) --- Iteration 39 -- -int(0) -int(0) --- Iteration 40 -- -int(0) -int(0) --- Iteration 41 -- -int(0) -int(0) --- Iteration 42 -- -int(0) -int(0) --- Iteration 43 -- -int(0) -int(0) --- Iteration 44 -- -int(0) -int(0) --- Iteration 45 -- -int(0) -int(0) --- Iteration 46 -- -int(0) -int(0) --- Iteration 47 -- -int(0) -int(0) --- Iteration 48 -- -int(0) -int(0) --- Iteration 49 -- -int(0) -int(0) --- Iteration 50 -- -int(0) -int(0) --- Iteration 51 -- -int(0) -int(0) --- Iteration 52 -- -int(0) -int(0) --- Iteration 53 -- -int(0) -int(0) --- Iteration 54 -- -int(0) -int(0) --- Iteration 55 -- -int(0) -int(0) --- Iteration 56 -- -int(0) -int(0) --- Iteration 57 -- -int(0) -int(0) --- Iteration 58 -- -int(0) -int(0) --- Iteration 59 -- -int(0) -int(0) --- Iteration 60 -- -int(0) -int(0) --- Iteration 61 -- -int(0) -int(0) --- Iteration 62 -- -int(0) -int(0) --- Iteration 63 -- -int(0) -int(0) --- Iteration 64 -- -int(0) -int(0) --- Iteration 65 -- -int(0) -int(0) --- Iteration 66 -- -int(0) -int(0) --- Iteration 67 -- -int(0) -int(0) --- Iteration 68 -- -int(0) -int(0) --- Iteration 69 -- -int(0) -int(0) --- Iteration 70 -- -int(0) -int(0) --- Iteration 71 -- -int(0) -int(0) --- Iteration 72 -- -int(0) -int(0) --- Iteration 73 -- -int(0) -int(0) --- Iteration 74 -- -int(0) -int(0) --- Iteration 75 -- -int(0) -int(0) --- Iteration 76 -- -int(0) -int(0) --- Iteration 77 -- -int(0) -int(0) --- Iteration 78 -- -int(0) -int(0) --- Iteration 79 -- -int(0) -int(0) --- Iteration 80 -- -int(0) -int(0) --- Iteration 81 -- -int(0) -int(0) --- Iteration 82 -- -int(0) -int(0) --- Iteration 83 -- -int(0) -int(0) --- Iteration 84 -- -int(0) -int(0) --- Iteration 85 -- -int(0) -int(0) --- Iteration 86 -- -int(0) -int(0) --- Iteration 87 -- -int(0) -int(0) --- Iteration 88 -- -int(0) -int(0) --- Iteration 89 -- -int(0) -int(0) --- Iteration 90 -- -int(0) -int(0) --- Iteration 91 -- -int(0) -int(0) --- Iteration 92 -- -int(0) -int(0) --- Iteration 93 -- -int(0) -int(0) --- Iteration 94 -- -int(0) -int(0) --- Iteration 95 -- -int(0) -int(0) --- Iteration 96 -- -int(0) -int(0) --- Iteration 97 -- -int(0) -int(0) --- Iteration 98 -- -int(0) -int(0) --- Iteration 99 -- -int(0) -int(0) --- Iteration 100 -- -int(0) -int(0) --- Iteration 101 -- -int(0) -int(0) --- Iteration 102 -- -int(0) -int(0) --- Iteration 103 -- -int(0) -int(0) --- Iteration 104 -- -int(0) -int(0) --- Iteration 105 -- -int(0) -int(0) --- Iteration 106 -- -int(0) -int(0) --- Iteration 107 -- -int(0) -int(0) --- Iteration 108 -- -int(0) -int(0) --- Iteration 109 -- -int(0) -int(0) --- Iteration 110 -- -int(0) -int(0) --- Iteration 111 -- -int(0) -int(0) --- Iteration 112 -- -int(0) -int(0) --- Iteration 113 -- -int(0) -int(0) --- Iteration 114 -- -int(0) -int(0) --- Iteration 115 -- -int(0) -int(0) --- Iteration 116 -- -int(0) -int(0) --- Iteration 117 -- -int(0) -int(0) --- Iteration 118 -- -int(0) -int(0) --- Iteration 119 -- -int(0) -int(0) --- Iteration 120 -- -int(0) -int(0) --- Iteration 121 -- -int(0) -int(0) --- Iteration 122 -- -int(0) -int(0) --- Iteration 123 -- -int(0) -int(0) --- Iteration 124 -- -int(0) -int(0) --- Iteration 125 -- -int(0) -int(0) --- Iteration 126 -- -int(0) -int(0) --- Iteration 127 -- -int(0) -int(0) --- Iteration 128 -- -int(0) -int(0) --- Iteration 129 -- -int(0) -int(0) --- Iteration 130 -- -int(0) -int(0) --- Iteration 131 -- -int(0) -int(0) --- Iteration 132 -- -int(0) -int(0) --- Iteration 133 -- -int(0) -int(0) --- Iteration 134 -- -int(0) -int(0) --- Iteration 135 -- -int(0) -int(0) --- Iteration 136 -- -int(0) -int(0) --- Iteration 137 -- -int(0) -int(0) --- Iteration 138 -- -int(0) -int(0) --- Iteration 139 -- -int(0) -int(0) --- Iteration 140 -- -int(0) -int(0) --- Iteration 141 -- -int(0) -int(0) --- Iteration 142 -- -int(0) -int(0) --- Iteration 143 -- -int(0) -int(0) --- Iteration 144 -- -int(0) -int(0) --- Iteration 145 -- -int(0) -int(0) --- Iteration 146 -- -int(0) -int(0) --- Iteration 147 -- -int(0) -int(0) --- Iteration 148 -- -int(0) -int(0) --- Iteration 149 -- -int(0) -int(0) --- Iteration 150 -- -int(0) -int(0) --- Iteration 151 -- -int(0) -int(0) --- Iteration 152 -- -int(0) -int(0) --- Iteration 153 -- -int(0) -int(0) --- Iteration 154 -- -int(0) -int(0) --- Iteration 155 -- -int(0) -int(0) --- Iteration 156 -- -int(0) -int(0) --- Iteration 157 -- -int(0) -int(0) --- Iteration 158 -- -int(0) -int(0) --- Iteration 159 -- -int(0) -int(0) --- Iteration 160 -- -int(0) -int(0) --- Iteration 161 -- -int(0) -int(0) --- Iteration 162 -- -int(0) -int(0) --- Iteration 163 -- -int(0) -int(0) --- Iteration 164 -- -int(0) -int(0) --- Iteration 165 -- -int(0) -int(0) --- Iteration 166 -- -int(0) -int(0) --- Iteration 167 -- -int(0) -int(0) --- Iteration 168 -- -int(0) -int(0) --- Iteration 169 -- -int(0) -int(0) --- Iteration 170 -- -int(0) -int(0) --- Iteration 171 -- -int(0) -int(0) --- Iteration 172 -- -int(0) -int(0) --- Iteration 173 -- -int(0) -int(0) --- Iteration 174 -- -int(0) -int(0) --- Iteration 175 -- -int(0) -int(0) --- Iteration 176 -- -int(0) -int(0) --- Iteration 177 -- -int(0) -int(0) --- Iteration 178 -- -int(0) -int(0) --- Iteration 179 -- -int(0) -int(0) --- Iteration 180 -- -int(0) -int(0) --- Iteration 181 -- -int(0) -int(0) --- Iteration 182 -- -int(0) -int(0) --- Iteration 183 -- -int(0) -int(0) --- Iteration 184 -- -int(0) -int(0) --- Iteration 185 -- -int(0) -int(0) --- Iteration 186 -- -int(0) -int(0) --- Iteration 187 -- -int(0) -int(0) --- Iteration 188 -- -int(0) -int(0) --- Iteration 189 -- -int(0) -int(0) --- Iteration 190 -- -int(0) -int(0) --- Iteration 191 -- -int(0) -int(0) --- Iteration 192 -- -int(0) -int(0) --- Iteration 193 -- -int(0) -int(0) --- Iteration 194 -- -int(0) -int(0) --- Iteration 195 -- -int(0) -int(0) --- Iteration 196 -- -int(0) -int(0) --- Iteration 197 -- -int(0) -int(0) --- Iteration 198 -- -int(0) -int(0) --- Iteration 199 -- -int(0) -int(0) --- Iteration 200 -- -int(0) -int(0) --- Iteration 201 -- -int(0) -int(0) --- Iteration 202 -- -int(0) -int(0) --- Iteration 203 -- -int(0) -int(0) --- Iteration 204 -- -int(0) -int(0) --- Iteration 205 -- -int(0) -int(0) --- Iteration 206 -- -int(0) -int(0) --- Iteration 207 -- -int(0) -int(0) --- Iteration 208 -- -int(0) -int(0) --- Iteration 209 -- -int(0) -int(0) --- Iteration 210 -- -int(0) -int(0) --- Iteration 211 -- -int(0) -int(0) --- Iteration 212 -- -int(0) -int(0) --- Iteration 213 -- -int(0) -int(0) --- Iteration 214 -- -int(0) -int(0) --- Iteration 215 -- -int(0) -int(0) --- Iteration 216 -- -int(0) -int(0) --- Iteration 217 -- -int(0) -int(0) --- Iteration 218 -- -int(0) -int(0) --- Iteration 219 -- -int(0) -int(0) --- Iteration 220 -- -int(0) -int(0) --- Iteration 221 -- -int(0) -int(0) --- Iteration 222 -- -int(0) -int(0) --- Iteration 223 -- -int(0) -int(0) --- Iteration 224 -- -int(0) -int(0) --- Iteration 225 -- -int(0) -int(0) --- Iteration 226 -- -int(0) -int(0) --- Iteration 227 -- -int(0) -int(0) --- Iteration 228 -- -int(0) -int(0) --- Iteration 229 -- -int(0) -int(0) --- Iteration 230 -- -int(0) -int(0) --- Iteration 231 -- -int(0) -int(0) --- Iteration 232 -- -int(0) -int(0) --- Iteration 233 -- -int(0) -int(0) --- Iteration 234 -- -int(0) -int(0) --- Iteration 235 -- -int(0) -int(0) --- Iteration 236 -- -int(0) -int(0) --- Iteration 237 -- -int(0) -int(0) --- Iteration 238 -- -int(0) -int(0) --- Iteration 239 -- -int(0) -int(0) --- Iteration 240 -- -int(0) -int(0) --- Iteration 241 -- -int(0) -int(0) --- Iteration 242 -- -int(0) -int(0) --- Iteration 243 -- -int(0) -int(0) --- Iteration 244 -- -int(0) -int(0) --- Iteration 245 -- -int(0) -int(0) --- Iteration 246 -- -int(0) -int(0) --- Iteration 247 -- -int(0) -int(0) --- Iteration 248 -- -int(0) -int(0) --- Iteration 249 -- -int(0) -int(0) --- Iteration 250 -- -int(0) -int(0) --- Iteration 251 -- -int(0) -int(0) --- Iteration 252 -- -int(0) -int(0) --- Iteration 253 -- -int(0) -int(0) --- Iteration 254 -- -int(0) -int(0) --- Iteration 255 -- -int(0) -int(0) --- Iteration 256 -- -int(0) -int(0) - --- Checking with out of character's range, given in binary format -- -int(1) - -*** Done *** diff --git a/ext/standard/tests/strings/strncasecmp_variation7.phpt b/ext/standard/tests/strings/strncasecmp_variation7.phpt deleted file mode 100644 index e22fad7659aae..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation7.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test strncasecmp() function : usage variations - binary safe ---FILE-- - ---EXPECTF-- -*** Test strncasecmp() function: with null terminated strings and binary inputs *** -int(5) -int(-119) -*** Done *** diff --git a/ext/standard/tests/strings/strncasecmp_variation8.phpt b/ext/standard/tests/strings/strncasecmp_variation8.phpt deleted file mode 100644 index 6011a7b0fd996..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation8.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test strncasecmp() function: usage variations - single quoted strings ---FILE-- - ---EXPECTREGEX-- -\*\*\* Test strncasecmp\(\) function: with single quoted strings \*\*\* --- Iteration 1 -- -int\(0\) -int\(0\) -int\(0\) -int\(-[1-9][0-9]*\) --- Iteration 2 -- -int\(0\) -int\(0\) -int\(0\) -int\(-[1-9][0-9]*\) --- Iteration 3 -- -int\(0\) -int\(0\) -int\(0\) -int\(-[1-9][0-9]*\) --- Iteration 4 -- -int\([1-9][0-9]*\) -int\([1-9][0-9]*\) -int\([1-9][0-9]*\) -int\(0\) -\*\*\* Done \*\*\* diff --git a/ext/standard/tests/strings/strncasecmp_variation9.phpt b/ext/standard/tests/strings/strncasecmp_variation9.phpt deleted file mode 100644 index 0d713032e035a..0000000000000 --- a/ext/standard/tests/strings/strncasecmp_variation9.phpt +++ /dev/null @@ -1,92 +0,0 @@ ---TEST-- -Test strncasecmp() function: usage variations - heredoc strings ---FILE-- - ---EXPECTF-- -*** Test strncasecmp() function: with here-doc strings *** -int(0) -int(63) -int(0) -int(84) -int(0) -int(-1) -int(0) -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/strncmp_basic.phpt b/ext/standard/tests/strings/strncmp_basic.phpt deleted file mode 100644 index 317039859f6db..0000000000000 --- a/ext/standard/tests/strings/strncmp_basic.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test strncmp() function : basic functionality ---FILE-- - 0 - -echo "-- Testing strncmp() with double quoted string --\n"; -var_dump( strncmp("Hello", "Hello", 5) ); //expected: int(0) -var_dump( strncmp("Hello", "Hi", 5) ); //expected: value < 0 -var_dump( strncmp("Hi", "Hello", 5) ); //expected: value > 0 - -echo "-- Testing strncmp() with here-doc string --\n"; -$str = << 0 - -echo "*** Done ***"; -?> ---EXPECTREGEX-- -\*\*\* Testing strncmp\(\) function: basic functionality \*\*\* --- Testing strncmp\(\) with single quoted string -- -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) --- Testing strncmp\(\) with double quoted string -- -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) --- Testing strncmp\(\) with here-doc string -- -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) -\*\*\* Done \*\*\* diff --git a/ext/standard/tests/strings/strncmp_error.phpt b/ext/standard/tests/strings/strncmp_error.phpt deleted file mode 100644 index 317a90406abae..0000000000000 --- a/ext/standard/tests/strings/strncmp_error.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test strncmp() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing strncmp() function: error conditions *** - -Warning: Wrong parameter count for strncmp() in %s on line %d -NULL - -Warning: Wrong parameter count for strncmp() in %s on line %d -NULL - -Warning: Wrong parameter count for strncmp() in %s on line %d -NULL - -Warning: Wrong parameter count for strncmp() in %s on line %d -NULL - -Warning: Length must be greater than or equal to 0 in %s on line %d -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strncmp_variation1.phpt b/ext/standard/tests/strings/strncmp_variation1.phpt deleted file mode 100644 index 2fc3c3d4c7ad2..0000000000000 --- a/ext/standard/tests/strings/strncmp_variation1.phpt +++ /dev/null @@ -1,135 +0,0 @@ ---TEST-- -Test strncmp() function: usage variations - case-sensitivity ---FILE-- - 0 -} -echo "*** Done ***"; -?> ---EXPECTREGEX-- -\*\*\* Test strncmp\(\) function: with alphabets \*\*\* --- Passing upper-case letters for 'str1' -- -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) - --- Passing lower-case letters for 'str1' -- -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -\*\*\* Done \*\*\* diff --git a/ext/standard/tests/strings/strncmp_variation2.phpt b/ext/standard/tests/strings/strncmp_variation2.phpt deleted file mode 100644 index 3c7452241725b..0000000000000 --- a/ext/standard/tests/strings/strncmp_variation2.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Test strncmp() function: usage variations - double quoted strings ---FILE-- - ---EXPECTREGEX-- -\*\*\* Test strncmp\(\) function: with double quoted strings \*\*\* --- Iteration 1 -- -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) --- Iteration 2 -- -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\([1-9][0-9]*\) -int\([1-9][0-9]*\) --- Iteration 3 -- -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) --- Iteration 4 -- -int\([1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) --- Iteration 5 -- -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(0\) -\*\*\* Done \*\*\* diff --git a/ext/standard/tests/strings/strncmp_variation3.phpt b/ext/standard/tests/strings/strncmp_variation3.phpt deleted file mode 100644 index 6a703c7050770..0000000000000 --- a/ext/standard/tests/strings/strncmp_variation3.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test strncmp() function: usage variations - different lengths ---FILE-- -= 0; $len--) { - var_dump( strncmp($str1, $str2, $len) ); -} -echo "*** Done ***\n"; -?> ---EXPECTREGEX-- -\*\*\* Test strncmp\(\) function: with different lengths \*\*\* -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(0\) -int\(0\) -int\(0\) -int\(0\) -int\(0\) -int\(0\) -int\(0\) -\*\*\* Done \*\*\* diff --git a/ext/standard/tests/strings/strncmp_variation4.phpt b/ext/standard/tests/strings/strncmp_variation4.phpt deleted file mode 100644 index 2af95e9b4981b..0000000000000 --- a/ext/standard/tests/strings/strncmp_variation4.phpt +++ /dev/null @@ -1,198 +0,0 @@ ---TEST-- -Test strncmp() function : usage variations - different inputs(all types) ---FILE-- - 'red', 'item' => 'pen'), - - /* boolean values */ - true, - false, - TRUE, - FALSE, - - /* nulls */ - NULL, - null, - - /* empty string */ - "", - '', - - /* undefined variable */ - $undefined_var, - - /* unset variable */ - $unset_var, - - /* resource */ - $file_handle, - - /* object */ - new sample() -); - -/* loop through each element of the array and check the working of strncmp() */ -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $str1 = $values[$index]; - $str2 = $values[$index]; - $len = strlen($values[$index]) + 1; - var_dump( strncmp($str1, $str2, $len) ); - $counter ++; -} -fclose($file_handle); - -echo "*** Done ***\n"; -?> ---EXPECTF-- -*** Testing strncmp() function: by supplying all types for 'str1' and 'str2' *** - -Notice: Undefined variable: undefined_var in %s on line %d - -Notice: Undefined variable: unset_var in %s on line %d --- Iteration 1 -- -int(0) --- Iteration 2 -- -int(0) --- Iteration 3 -- -int(0) --- Iteration 4 -- -int(0) --- Iteration 5 -- -int(0) --- Iteration 6 -- -int(0) --- Iteration 7 -- -int(0) --- Iteration 8 -- -int(0) --- Iteration 9 -- -int(0) --- Iteration 10 -- -int(0) --- Iteration 11 -- -int(0) --- Iteration 12 -- -int(0) --- Iteration 13 -- -int(0) --- Iteration 14 -- -int(0) --- Iteration 15 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 16 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 17 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 18 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 19 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -int(0) --- Iteration 20 -- -int(0) --- Iteration 21 -- -int(0) --- Iteration 22 -- -int(0) --- Iteration 23 -- -int(0) --- Iteration 24 -- -int(0) --- Iteration 25 -- -int(0) --- Iteration 26 -- -int(0) --- Iteration 27 -- -int(0) --- Iteration 28 -- -int(0) --- Iteration 29 -- -int(0) --- Iteration 30 -- -int(0) --- Iteration 31 -- -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/strncmp_variation5.phpt b/ext/standard/tests/strings/strncmp_variation5.phpt deleted file mode 100644 index cdb3afca194d6..0000000000000 --- a/ext/standard/tests/strings/strncmp_variation5.phpt +++ /dev/null @@ -1,161 +0,0 @@ ---TEST-- -Test strncmp() function : usage variations - different lengths(all types) ---FILE-- - 'red', 'item' => 'pen'), - - /* boolean values */ - true, - false, - TRUE, - FALSE, - - /* nulls */ - NULL, - null, - - /* empty string */ - "", - '', - - /* undefined variable */ - $undefined_var, - - /* unset variable */ - $unset_var, - - /* resource */ - $file_handle, - - /* object */ - new sample() -); - -/* loop through each element of the array and check the working of strncmp() */ -$counter = 1; -for($index = 0; $index < count($lengths); $index ++) { - $len = $lengths[$index]; - echo "-- Iteration $counter --\n"; - var_dump( strncmp($str1, $str2, $len) ); - $counter ++; -} -fclose($file_handle); - -echo "*** Done ***\n"; -?> ---EXPECTF-- -*** Test strncmp() function: by supplying all types for 'len' *** - -Notice: Undefined variable: undefined_var in %s on line %d - -Notice: Undefined variable: unset_var in %s on line %d --- Iteration 1 -- -int(0) --- Iteration 2 -- -int(0) --- Iteration 3 -- -int(0) --- Iteration 4 -- -int(0) --- Iteration 5 -- -int(0) --- Iteration 6 -- -int(0) --- Iteration 7 -- -int(0) --- Iteration 8 -- -int(0) --- Iteration 9 -- -int(0) --- Iteration 10 -- -int(0) --- Iteration 11 -- -int(0) --- Iteration 12 -- -int(0) --- Iteration 13 -- -int(0) --- Iteration 14 -- -int(0) --- Iteration 15 -- -int(0) --- Iteration 16 -- -int(0) --- Iteration 17 -- -int(0) --- Iteration 18 -- -int(0) --- Iteration 19 -- -int(0) --- Iteration 20 -- -int(0) --- Iteration 21 -- -int(0) --- Iteration 22 -- -int(0) --- Iteration 23 -- -int(0) --- Iteration 24 -- -int(0) --- Iteration 25 -- -int(0) --- Iteration 26 -- -int(0) --- Iteration 27 -- - -Notice: Object of class sample could not be converted to int in %s on line %d -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/strncmp_variation6.phpt b/ext/standard/tests/strings/strncmp_variation6.phpt deleted file mode 100644 index 7a79d29a514a6..0000000000000 --- a/ext/standard/tests/strings/strncmp_variation6.phpt +++ /dev/null @@ -1,811 +0,0 @@ ---TEST-- -Test strncmp() function : usage variations - binary safe(binary values) ---FILE-- - ---EXPECTF-- -*** Test strncmp() function: with binary inputs *** - --- Checking with all 256 characters given, in binary format -- --- Iteration 1 -- -int(0) -int(0) --- Iteration 2 -- -int(0) -int(0) --- Iteration 3 -- -int(0) -int(0) --- Iteration 4 -- -int(0) -int(0) --- Iteration 5 -- -int(0) -int(0) --- Iteration 6 -- -int(0) -int(0) --- Iteration 7 -- -int(0) -int(0) --- Iteration 8 -- -int(0) -int(0) --- Iteration 9 -- -int(0) -int(0) --- Iteration 10 -- -int(0) -int(0) --- Iteration 11 -- -int(0) -int(0) --- Iteration 12 -- -int(0) -int(0) --- Iteration 13 -- -int(0) -int(0) --- Iteration 14 -- -int(0) -int(0) --- Iteration 15 -- -int(0) -int(0) --- Iteration 16 -- -int(0) -int(0) --- Iteration 17 -- -int(0) -int(0) --- Iteration 18 -- -int(0) -int(0) --- Iteration 19 -- -int(0) -int(0) --- Iteration 20 -- -int(0) -int(0) --- Iteration 21 -- -int(0) -int(0) --- Iteration 22 -- -int(0) -int(0) --- Iteration 23 -- -int(0) -int(0) --- Iteration 24 -- -int(0) -int(0) --- Iteration 25 -- -int(0) -int(0) --- Iteration 26 -- -int(0) -int(0) --- Iteration 27 -- -int(0) -int(0) --- Iteration 28 -- -int(0) -int(0) --- Iteration 29 -- -int(0) -int(0) --- Iteration 30 -- -int(0) -int(0) --- Iteration 31 -- -int(0) -int(0) --- Iteration 32 -- -int(0) -int(0) --- Iteration 33 -- -int(0) -int(0) --- Iteration 34 -- -int(0) -int(0) --- Iteration 35 -- -int(0) -int(0) --- Iteration 36 -- -int(0) -int(0) --- Iteration 37 -- -int(0) -int(0) --- Iteration 38 -- -int(0) -int(0) --- Iteration 39 -- -int(0) -int(0) --- Iteration 40 -- -int(0) -int(0) --- Iteration 41 -- -int(0) -int(0) --- Iteration 42 -- -int(0) -int(0) --- Iteration 43 -- -int(0) -int(0) --- Iteration 44 -- -int(0) -int(0) --- Iteration 45 -- -int(0) -int(0) --- Iteration 46 -- -int(0) -int(0) --- Iteration 47 -- -int(0) -int(0) --- Iteration 48 -- -int(0) -int(0) --- Iteration 49 -- -int(0) -int(0) --- Iteration 50 -- -int(0) -int(0) --- Iteration 51 -- -int(0) -int(0) --- Iteration 52 -- -int(0) -int(0) --- Iteration 53 -- -int(0) -int(0) --- Iteration 54 -- -int(0) -int(0) --- Iteration 55 -- -int(0) -int(0) --- Iteration 56 -- -int(0) -int(0) --- Iteration 57 -- -int(0) -int(0) --- Iteration 58 -- -int(0) -int(0) --- Iteration 59 -- -int(0) -int(0) --- Iteration 60 -- -int(0) -int(0) --- Iteration 61 -- -int(0) -int(0) --- Iteration 62 -- -int(0) -int(0) --- Iteration 63 -- -int(0) -int(0) --- Iteration 64 -- -int(0) -int(0) --- Iteration 65 -- -int(0) -int(0) --- Iteration 66 -- -int(0) -int(0) --- Iteration 67 -- -int(0) -int(0) --- Iteration 68 -- -int(0) -int(0) --- Iteration 69 -- -int(0) -int(0) --- Iteration 70 -- -int(0) -int(0) --- Iteration 71 -- -int(0) -int(0) --- Iteration 72 -- -int(0) -int(0) --- Iteration 73 -- -int(0) -int(0) --- Iteration 74 -- -int(0) -int(0) --- Iteration 75 -- -int(0) -int(0) --- Iteration 76 -- -int(0) -int(0) --- Iteration 77 -- -int(0) -int(0) --- Iteration 78 -- -int(0) -int(0) --- Iteration 79 -- -int(0) -int(0) --- Iteration 80 -- -int(0) -int(0) --- Iteration 81 -- -int(0) -int(0) --- Iteration 82 -- -int(0) -int(0) --- Iteration 83 -- -int(0) -int(0) --- Iteration 84 -- -int(0) -int(0) --- Iteration 85 -- -int(0) -int(0) --- Iteration 86 -- -int(0) -int(0) --- Iteration 87 -- -int(0) -int(0) --- Iteration 88 -- -int(0) -int(0) --- Iteration 89 -- -int(0) -int(0) --- Iteration 90 -- -int(0) -int(0) --- Iteration 91 -- -int(0) -int(0) --- Iteration 92 -- -int(0) -int(0) --- Iteration 93 -- -int(0) -int(0) --- Iteration 94 -- -int(0) -int(0) --- Iteration 95 -- -int(0) -int(0) --- Iteration 96 -- -int(0) -int(0) --- Iteration 97 -- -int(0) -int(0) --- Iteration 98 -- -int(0) -int(0) --- Iteration 99 -- -int(0) -int(0) --- Iteration 100 -- -int(0) -int(0) --- Iteration 101 -- -int(0) -int(0) --- Iteration 102 -- -int(0) -int(0) --- Iteration 103 -- -int(0) -int(0) --- Iteration 104 -- -int(0) -int(0) --- Iteration 105 -- -int(0) -int(0) --- Iteration 106 -- -int(0) -int(0) --- Iteration 107 -- -int(0) -int(0) --- Iteration 108 -- -int(0) -int(0) --- Iteration 109 -- -int(0) -int(0) --- Iteration 110 -- -int(0) -int(0) --- Iteration 111 -- -int(0) -int(0) --- Iteration 112 -- -int(0) -int(0) --- Iteration 113 -- -int(0) -int(0) --- Iteration 114 -- -int(0) -int(0) --- Iteration 115 -- -int(0) -int(0) --- Iteration 116 -- -int(0) -int(0) --- Iteration 117 -- -int(0) -int(0) --- Iteration 118 -- -int(0) -int(0) --- Iteration 119 -- -int(0) -int(0) --- Iteration 120 -- -int(0) -int(0) --- Iteration 121 -- -int(0) -int(0) --- Iteration 122 -- -int(0) -int(0) --- Iteration 123 -- -int(0) -int(0) --- Iteration 124 -- -int(0) -int(0) --- Iteration 125 -- -int(0) -int(0) --- Iteration 126 -- -int(0) -int(0) --- Iteration 127 -- -int(0) -int(0) --- Iteration 128 -- -int(0) -int(0) --- Iteration 129 -- -int(0) -int(0) --- Iteration 130 -- -int(0) -int(0) --- Iteration 131 -- -int(0) -int(0) --- Iteration 132 -- -int(0) -int(0) --- Iteration 133 -- -int(0) -int(0) --- Iteration 134 -- -int(0) -int(0) --- Iteration 135 -- -int(0) -int(0) --- Iteration 136 -- -int(0) -int(0) --- Iteration 137 -- -int(0) -int(0) --- Iteration 138 -- -int(0) -int(0) --- Iteration 139 -- -int(0) -int(0) --- Iteration 140 -- -int(0) -int(0) --- Iteration 141 -- -int(0) -int(0) --- Iteration 142 -- -int(0) -int(0) --- Iteration 143 -- -int(0) -int(0) --- Iteration 144 -- -int(0) -int(0) --- Iteration 145 -- -int(0) -int(0) --- Iteration 146 -- -int(0) -int(0) --- Iteration 147 -- -int(0) -int(0) --- Iteration 148 -- -int(0) -int(0) --- Iteration 149 -- -int(0) -int(0) --- Iteration 150 -- -int(0) -int(0) --- Iteration 151 -- -int(0) -int(0) --- Iteration 152 -- -int(0) -int(0) --- Iteration 153 -- -int(0) -int(0) --- Iteration 154 -- -int(0) -int(0) --- Iteration 155 -- -int(0) -int(0) --- Iteration 156 -- -int(0) -int(0) --- Iteration 157 -- -int(0) -int(0) --- Iteration 158 -- -int(0) -int(0) --- Iteration 159 -- -int(0) -int(0) --- Iteration 160 -- -int(0) -int(0) --- Iteration 161 -- -int(0) -int(0) --- Iteration 162 -- -int(0) -int(0) --- Iteration 163 -- -int(0) -int(0) --- Iteration 164 -- -int(0) -int(0) --- Iteration 165 -- -int(0) -int(0) --- Iteration 166 -- -int(0) -int(0) --- Iteration 167 -- -int(0) -int(0) --- Iteration 168 -- -int(0) -int(0) --- Iteration 169 -- -int(0) -int(0) --- Iteration 170 -- -int(0) -int(0) --- Iteration 171 -- -int(0) -int(0) --- Iteration 172 -- -int(0) -int(0) --- Iteration 173 -- -int(0) -int(0) --- Iteration 174 -- -int(0) -int(0) --- Iteration 175 -- -int(0) -int(0) --- Iteration 176 -- -int(0) -int(0) --- Iteration 177 -- -int(0) -int(0) --- Iteration 178 -- -int(0) -int(0) --- Iteration 179 -- -int(0) -int(0) --- Iteration 180 -- -int(0) -int(0) --- Iteration 181 -- -int(0) -int(0) --- Iteration 182 -- -int(0) -int(0) --- Iteration 183 -- -int(0) -int(0) --- Iteration 184 -- -int(0) -int(0) --- Iteration 185 -- -int(0) -int(0) --- Iteration 186 -- -int(0) -int(0) --- Iteration 187 -- -int(0) -int(0) --- Iteration 188 -- -int(0) -int(0) --- Iteration 189 -- -int(0) -int(0) --- Iteration 190 -- -int(0) -int(0) --- Iteration 191 -- -int(0) -int(0) --- Iteration 192 -- -int(0) -int(0) --- Iteration 193 -- -int(0) -int(0) --- Iteration 194 -- -int(0) -int(0) --- Iteration 195 -- -int(0) -int(0) --- Iteration 196 -- -int(0) -int(0) --- Iteration 197 -- -int(0) -int(0) --- Iteration 198 -- -int(0) -int(0) --- Iteration 199 -- -int(0) -int(0) --- Iteration 200 -- -int(0) -int(0) --- Iteration 201 -- -int(0) -int(0) --- Iteration 202 -- -int(0) -int(0) --- Iteration 203 -- -int(0) -int(0) --- Iteration 204 -- -int(0) -int(0) --- Iteration 205 -- -int(0) -int(0) --- Iteration 206 -- -int(0) -int(0) --- Iteration 207 -- -int(0) -int(0) --- Iteration 208 -- -int(0) -int(0) --- Iteration 209 -- -int(0) -int(0) --- Iteration 210 -- -int(0) -int(0) --- Iteration 211 -- -int(0) -int(0) --- Iteration 212 -- -int(0) -int(0) --- Iteration 213 -- -int(0) -int(0) --- Iteration 214 -- -int(0) -int(0) --- Iteration 215 -- -int(0) -int(0) --- Iteration 216 -- -int(0) -int(0) --- Iteration 217 -- -int(0) -int(0) --- Iteration 218 -- -int(0) -int(0) --- Iteration 219 -- -int(0) -int(0) --- Iteration 220 -- -int(0) -int(0) --- Iteration 221 -- -int(0) -int(0) --- Iteration 222 -- -int(0) -int(0) --- Iteration 223 -- -int(0) -int(0) --- Iteration 224 -- -int(0) -int(0) --- Iteration 225 -- -int(0) -int(0) --- Iteration 226 -- -int(0) -int(0) --- Iteration 227 -- -int(0) -int(0) --- Iteration 228 -- -int(0) -int(0) --- Iteration 229 -- -int(0) -int(0) --- Iteration 230 -- -int(0) -int(0) --- Iteration 231 -- -int(0) -int(0) --- Iteration 232 -- -int(0) -int(0) --- Iteration 233 -- -int(0) -int(0) --- Iteration 234 -- -int(0) -int(0) --- Iteration 235 -- -int(0) -int(0) --- Iteration 236 -- -int(0) -int(0) --- Iteration 237 -- -int(0) -int(0) --- Iteration 238 -- -int(0) -int(0) --- Iteration 239 -- -int(0) -int(0) --- Iteration 240 -- -int(0) -int(0) --- Iteration 241 -- -int(0) -int(0) --- Iteration 242 -- -int(0) -int(0) --- Iteration 243 -- -int(0) -int(0) --- Iteration 244 -- -int(0) -int(0) --- Iteration 245 -- -int(0) -int(0) --- Iteration 246 -- -int(0) -int(0) --- Iteration 247 -- -int(0) -int(0) --- Iteration 248 -- -int(0) -int(0) --- Iteration 249 -- -int(0) -int(0) --- Iteration 250 -- -int(0) -int(0) --- Iteration 251 -- -int(0) -int(0) --- Iteration 252 -- -int(0) -int(0) --- Iteration 253 -- -int(0) -int(0) --- Iteration 254 -- -int(0) -int(0) --- Iteration 255 -- -int(0) -int(0) --- Iteration 256 -- -int(0) -int(0) - --- Checking with out of character's range, given in binary format -- -int(1) - -*** Done *** diff --git a/ext/standard/tests/strings/strncmp_variation7.phpt b/ext/standard/tests/strings/strncmp_variation7.phpt deleted file mode 100644 index 35d11d981a736..0000000000000 --- a/ext/standard/tests/strings/strncmp_variation7.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test strncmp() function : usage variations - binary safe(null terminated strings) ---FILE-- - ---EXPECTF-- -*** Test strncmp() function: Checking with the null terminated strings *** -int(5) -*** Done *** diff --git a/ext/standard/tests/strings/strncmp_variation8.phpt b/ext/standard/tests/strings/strncmp_variation8.phpt deleted file mode 100644 index bc000d171e9b9..0000000000000 --- a/ext/standard/tests/strings/strncmp_variation8.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test strncmp() function: usage variations - single quoted strings ---FILE-- - ---EXPECTREGEX-- -\*\*\* Test strncmp\(\) function: with single quoted strings \*\*\* --- Iteration 1 -- -int\(0\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) -int\(-[1-9][0-9]*\) --- Iteration 2 -- -int\([1-9][0-9]*\) -int\(0\) -int\([1-9][0-9]*\) -int\([1-9][0-9]*\) --- Iteration 3 -- -int\(-[1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\(0\) -int\(-[1-9][0-9]*\) --- Iteration 4 -- -int\([1-9][0-9]*\) -int\(-[1-9][0-9]*\) -int\([1-9][0-9]*\) -int\(0\) -\*\*\* Done \*\*\* diff --git a/ext/standard/tests/strings/strncmp_variation9.phpt b/ext/standard/tests/strings/strncmp_variation9.phpt deleted file mode 100644 index 282f2418491ae..0000000000000 --- a/ext/standard/tests/strings/strncmp_variation9.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test strncmp() function: usage variations - different inputs(heredoc strings) ---FILE-- - ---EXPECTF-- -*** Test strncmp() function: with different input strings *** -int(0) -int(0) -int(0) -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt deleted file mode 100644 index 566ef6c75c6d7..0000000000000 Binary files a/ext/standard/tests/strings/strpos.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strpos_number.phpt b/ext/standard/tests/strings/strpos_number.phpt deleted file mode 100644 index 73da09500dfe4..0000000000000 --- a/ext/standard/tests/strings/strpos_number.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -strpos() matching numbers ---FILE-- - ---EXPECT-- -bool(false) -int(1) -int(4) diff --git a/ext/standard/tests/strings/strrchr.phpt b/ext/standard/tests/strings/strrchr.phpt deleted file mode 100644 index 5a1fe12a82645..0000000000000 --- a/ext/standard/tests/strings/strrchr.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -strrchr() tests ---FILE-- - ---EXPECTF-- -bool(false) -bool(false) -bool(false) -string(3) "abc" -string(5) " test" -string(5) "tring" -Done diff --git a/ext/standard/tests/strings/strrchr_basic.phpt b/ext/standard/tests/strings/strrchr_basic.phpt deleted file mode 100644 index f396834837c3d..0000000000000 --- a/ext/standard/tests/strings/strrchr_basic.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test strrchr() function : basic functionality ---FILE-- - ---EXPECTF-- -*** Testing strrchr() function: basic functionality *** -string(12) "Hello, World" -string(12) "Hello, World" -string(12) "Hello, World" -string(12) "Hello, World" -bool(false) -bool(false) -string(5) "World" -string(5) "World" -string(7) ", World" -string(7) ", World" -string(12) "Hello, World" -string(12) "Hello, World" -string(4) "orld" -string(4) "orld" -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_error.phpt b/ext/standard/tests/strings/strrchr_error.phpt deleted file mode 100644 index 8c2881aa531da..0000000000000 --- a/ext/standard/tests/strings/strrchr_error.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test strrchr() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing strrchr() function: error conditions *** - --- Testing strrchr() function with Zero arguments -- -Warning: Wrong parameter count for strrchr() in %s on line %d -NULL - --- Testing strrchr() function with less than expected no. of arguments -- -Warning: Wrong parameter count for strrchr() in %s on line %d -NULL - --- Testing strrchr() function with more than expected no. of arguments -- -Warning: Wrong parameter count for strrchr() in %s on line %d -NULL -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation1.phpt b/ext/standard/tests/strings/strrchr_variation1.phpt deleted file mode 100644 index 91290ecf93f54..0000000000000 Binary files a/ext/standard/tests/strings/strrchr_variation1.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strrchr_variation10.phpt b/ext/standard/tests/strings/strrchr_variation10.phpt deleted file mode 100644 index c807dd44947ad..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation10.phpt +++ /dev/null @@ -1,188 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - unexpected inputs for needle ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // null vlaues - NULL, - null, - - // objects - new sample(), - - // empty string - "", - '', - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop through each element of the array and check the working of strrchr() -$count = 1; -for($index = 0; $index < count($haystacks); $index++) { - echo "-- Iteration $count --\n"; - var_dump( strrchr($haystacks[$index], $needles[$index]) ); - $count ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrchr() function with unexpected inputs for needle *** --- Iteration 1 -- -bool(false) --- Iteration 2 -- -bool(false) --- Iteration 3 -- -bool(false) --- Iteration 4 -- -bool(false) --- Iteration 5 -- -bool(false) --- Iteration 6 -- -bool(false) --- Iteration 7 -- -bool(false) --- Iteration 8 -- -bool(false) --- Iteration 9 -- -bool(false) --- Iteration 10 -- -bool(false) --- Iteration 11 -- -bool(false) --- Iteration 12 -- -bool(false) --- Iteration 13 -- -bool(false) --- Iteration 14 -- -bool(false) --- Iteration 15 -- -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- -bool(false) --- Iteration 20 -- -bool(false) --- Iteration 21 -- - -Notice: Object of class sample could not be converted to int in %s on line %d -bool(false) --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- -%s --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation11.phpt b/ext/standard/tests/strings/strrchr_variation11.phpt deleted file mode 100644 index a179c4089a7ea..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation11.phpt +++ /dev/null @@ -1,157 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - unexpected inputs for haystack and needle ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of strrchr() -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - var_dump( strrchr($values[$index], $values[$index]) ); - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrchr() function: with unexpected inputs for haystack and needle *** --- Iteration 1 -- -bool(false) --- Iteration 2 -- -bool(false) --- Iteration 3 -- -bool(false) --- Iteration 4 -- -bool(false) --- Iteration 5 -- -bool(false) --- Iteration 6 -- -bool(false) --- Iteration 7 -- -bool(false) --- Iteration 8 -- -bool(false) --- Iteration 9 -- -bool(false) --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d -bool(false) --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d -bool(false) --- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d -bool(false) --- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d -bool(false) --- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d -bool(false) --- Iteration 15 -- -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- - -Notice: Object of class sample could not be converted to int in %s on line %d -bool(false) --- Iteration 20 -- -bool(false) --- Iteration 21 -- -bool(false) --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- -%s --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation12.phpt b/ext/standard/tests/strings/strrchr_variation12.phpt deleted file mode 100644 index c31e0c86ced29..0000000000000 Binary files a/ext/standard/tests/strings/strrchr_variation12.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strrchr_variation2.phpt b/ext/standard/tests/strings/strrchr_variation2.phpt deleted file mode 100644 index 0b15ceeeb2da0..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation2.phpt +++ /dev/null @@ -1,220 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - single quoted strings ---FILE-- -?@hello123456he \x234 \101 '; -$needle = array( - //regular strings - 'l', - 'L', - 'HELLO', - 'hEllo', - - //escape characters - '\t', - '\T', - ' ', - '\n', - '\N', - ' -', //new line - - //nulls - '\0', - NULL, - null, - - //boolean false - FALSE, - false, - - //empty string - '', - - //special chars - ' ', - '$', - ' $', - '&', - '!#', - '%\o', - '\o,', - '()', - '*+', - '+', - '-', - '.', - '.;', - ':;', - ';', - '<=>', - '>', - '=>', - '?', - '@', - '@hEllo', - - '12345', //decimal numeric string - '\x23', //hexadecimal numeric string - '#', //hexadecimal numeric string - '\101', //octal numeric string - 'A', - '456HEE', //numerics + chars - 42, //needle as int(ASCII value of '*') - $haystack //haystack as needle -); - -/* loop through to get the position of the needle in haystack string */ -$count = 1; -for($index=0; $index ---EXPECTF-- -*** Testing strrchr() function: with various single quoted strings *** --- Iteration 1 -- -string(22) "lo123456he \x234 \101 " - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -string(63) "Hello,\t\n\0\n $&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 4 -- -string(14) "he \x234 \101 " - --- Iteration 5 -- -string(5) "\101 " - --- Iteration 6 -- -string(5) "\101 " - --- Iteration 7 -- -string(1) " " - --- Iteration 8 -- -string(5) "\101 " - --- Iteration 9 -- -string(5) "\101 " - --- Iteration 10 -- -bool(false) - --- Iteration 11 -- -string(5) "\101 " - --- Iteration 12 -- -bool(false) - --- Iteration 13 -- -bool(false) - --- Iteration 14 -- -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -string(1) " " - --- Iteration 18 -- -string(47) "$&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 19 -- -string(1) " " - --- Iteration 20 -- -string(46) "&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 21 -- -string(45) "!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 22 -- -string(43) "%\o,()*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 23 -- -string(5) "\101 " - --- Iteration 24 -- -string(39) "()*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 25 -- -string(37) "*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 26 -- -string(36) "+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 27 -- -string(35) "-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 28 -- -string(34) "./:;<=>?@hello123456he \x234 \101 " - --- Iteration 29 -- -string(34) "./:;<=>?@hello123456he \x234 \101 " - --- Iteration 30 -- -string(32) ":;<=>?@hello123456he \x234 \101 " - --- Iteration 31 -- -string(31) ";<=>?@hello123456he \x234 \101 " - --- Iteration 32 -- -string(30) "<=>?@hello123456he \x234 \101 " - --- Iteration 33 -- -string(28) ">?@hello123456he \x234 \101 " - --- Iteration 34 -- -string(29) "=>?@hello123456he \x234 \101 " - --- Iteration 35 -- -string(27) "?@hello123456he \x234 \101 " - --- Iteration 36 -- -string(26) "@hello123456he \x234 \101 " - --- Iteration 37 -- -string(26) "@hello123456he \x234 \101 " - --- Iteration 38 -- -string(2) "1 " - --- Iteration 39 -- -string(5) "\101 " - --- Iteration 40 -- -string(44) "#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 41 -- -string(5) "\101 " - --- Iteration 42 -- -bool(false) - --- Iteration 43 -- -string(7) "4 \101 " - --- Iteration 44 -- -string(37) "*+-./:;<=>?@hello123456he \x234 \101 " - --- Iteration 45 -- -string(63) "Hello,\t\n\0\n $&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 " -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation3.phpt b/ext/standard/tests/strings/strrchr_variation3.phpt deleted file mode 100644 index 1d0aa30091d96..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation3.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - multi line heredoc string for 'haystack' ---FILE-- - ---EXPECTF-- -*** Testing strrchr() function: with heredoc strings *** -string(19) "ing heredoc syntax." -bool(false) -string(8) " syntax." -string(63) "Example of string -spanning multiple lines -using heredoc syntax." -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation4.phpt b/ext/standard/tests/strings/strrchr_variation4.phpt deleted file mode 100644 index 8b2c10bf25303..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation4.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - heredoc string containing special chars for 'haystack' ---FILE-- - ---EXPECTF-- -*** Testing strrchr() function: with heredoc strings *** -string(24) "!$#$^^&*(special) -chars." -string(31) "_")!#@@!$#$^^&*(special) -chars." -string(16) "(special) -chars." -string(21) "$^^&*(special) -chars." -string(16) "(special) -chars." -string(19) "^&*(special) -chars." -string(76) "Example of heredoc string contains -$#%^*&*_("_")!#@@!$#$^^&*(special) -chars." -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation5.phpt b/ext/standard/tests/strings/strrchr_variation5.phpt deleted file mode 100644 index fe9b91f1d7b62..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation5.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - heredoc string containing escape sequences for 'haystack' ---FILE-- - ---EXPECTF-- -*** Testing strrchr() function: with heredoc strings *** -string(33) " st - -ch - using -\escape \seque -ce" -string(9) "\seque -ce" -string(25) " - using -\escape \seque -ce" -string(9) "\seque -ce" -string(33) " st - -ch - using -\escape \seque -ce" -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation6.phpt b/ext/standard/tests/strings/strrchr_variation6.phpt deleted file mode 100644 index ba0ffadbd76f6..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation6.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - heredoc string containing quote chars for 'haystack' ---FILE-- - ---EXPECTF-- -*** Testing strrchr() function: with heredoc strings *** -string(3) "te'" -string(32) "" -'things' 'in' 'single' 'quote'" -bool(false) -string(14) "ingle' 'quote'" -string(6) "quote'" -string(32) "" -'things' 'in' 'single' 'quote'" -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation7.phpt b/ext/standard/tests/strings/strrchr_variation7.phpt deleted file mode 100644 index ed5acdc045c4f..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation7.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - heredoc string containing blank line for 'haystack' ---FILE-- - ---EXPECTF-- -*** Testing strrchr() function: with heredoc strings *** -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation8.phpt b/ext/standard/tests/strings/strrchr_variation8.phpt deleted file mode 100644 index 3e298a0b3a4eb..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation8.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - empty heredoc string for 'haystack' ---FILE-- - ---EXPECTF-- -*** Testing strrchr() function: with heredoc strings *** -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrchr_variation9.phpt b/ext/standard/tests/strings/strrchr_variation9.phpt deleted file mode 100644 index cd4c5b2c32070..0000000000000 --- a/ext/standard/tests/strings/strrchr_variation9.phpt +++ /dev/null @@ -1,196 +0,0 @@ ---TEST-- -Test strrchr() function : usage variations - unexpected inputs for haystack ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // null vlaues - NULL, - null, - - // objects - new sample(), - - // empty string - "", - '', - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -$needles = array ( - //integer numeric strings - "0", - "1", - "2", - "-2", - - //float numeric strings - "10.5", - "-10.5", - "10.5e10", - "10.6E-10", - ".5", - - //regular strings - "array", - "a", - "r", - "y", - "ay", - "true", - "false", - "TRUE", - "FALSE", - "NULL", - "null", - "object", - - //empty string - "", - '', - - //resource variable in string form - "\$file_handle", - - //undefined variable in string form - @"$undefined_var", - @"$unset_var" -); - -// loop through each element of the array and check the working of strrchr() -$count = 1; -for($index = 0; $index < count($haystacks); $index++) { - echo "-- Iteration $count --\n"; - var_dump( strrchr($haystacks[$index], $needles[$index]) ); - $count ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrchr() function: with unexpected inputs for haystack *** --- Iteration 1 -- -string(1) "0" --- Iteration 2 -- -string(1) "1" --- Iteration 3 -- -string(4) "2345" --- Iteration 4 -- -string(5) "-2345" --- Iteration 5 -- -string(4) "10.5" --- Iteration 6 -- -string(5) "-10.5" --- Iteration 7 -- -string(12) "105000000000" --- Iteration 8 -- -string(7) "1.06E-9" --- Iteration 9 -- -string(2) ".5" --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d -string(2) "ay" --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d -string(2) "ay" --- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d -string(3) "ray" --- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d -string(1) "y" --- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d -string(2) "ay" --- Iteration 15 -- -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- -bool(false) --- Iteration 20 -- -bool(false) --- Iteration 21 -- -string(6) "object" --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- -bool(false) --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrev.phpt b/ext/standard/tests/strings/strrev.phpt deleted file mode 100644 index 321aca5bd7a69..0000000000000 --- a/ext/standard/tests/strings/strrev.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -strrev() function ---FILE-- - ---EXPECT-- -string(32) "ec6df70f2569891eae50321a9179eb82" -string(0) "" -string(0) "" diff --git a/ext/standard/tests/strings/strrev_basic.phpt b/ext/standard/tests/strings/strrev_basic.phpt deleted file mode 100644 index 2cde4cdf8977a..0000000000000 --- a/ext/standard/tests/strings/strrev_basic.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test strrev() function : basic functionality ---FILE-- - ---EXPECTF-- -*** Testing strrev() : basic functionality *** -string(12) "dlroW ,olleH" -string(12) "dlroW ,olleH" -string(1) "H" -string(1) "H" -string(6) "HHHHHH" -string(6) "HhhhhH" -string(13) " -dlroW ,olleH" -string(14) "n\dlroW ,olleH" -string(12) "dlrow ,olleH" -*** Done *** diff --git a/ext/standard/tests/strings/strrev_error.phpt b/ext/standard/tests/strings/strrev_error.phpt deleted file mode 100644 index e1fd9f8248eca..0000000000000 --- a/ext/standard/tests/strings/strrev_error.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test strrev() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing strrev() : error conditions *** --- Testing strrev() function with Zero arguments -- -Warning: Wrong parameter count for strrev() in %s on line %d -NULL - --- Testing strrev() function with more than expected no. of arguments -- -Warning: Wrong parameter count for strrev() in %s on line %d -NULL -*** Done *** diff --git a/ext/standard/tests/strings/strrev_variation1.phpt b/ext/standard/tests/strings/strrev_variation1.phpt deleted file mode 100644 index 39c1ec41443d7..0000000000000 Binary files a/ext/standard/tests/strings/strrev_variation1.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strrev_variation2.phpt b/ext/standard/tests/strings/strrev_variation2.phpt deleted file mode 100644 index 41e54d53c6667..0000000000000 Binary files a/ext/standard/tests/strings/strrev_variation2.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strrev_variation3.phpt b/ext/standard/tests/strings/strrev_variation3.phpt deleted file mode 100644 index 8ab3e25b6686c..0000000000000 Binary files a/ext/standard/tests/strings/strrev_variation3.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strrev_variation4.phpt b/ext/standard/tests/strings/strrev_variation4.phpt deleted file mode 100644 index bf4a7fad9fbb7..0000000000000 --- a/ext/standard/tests/strings/strrev_variation4.phpt +++ /dev/null @@ -1,180 +0,0 @@ ---TEST-- -Test strrev() function : usage variations - unexpected inputs ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new sample(), - - // resource - $resource, - - // undefined data - @$undefined_var, - - // unset data - @$unset_var -); - -// loop through each element of the array for str - -$count = 1; -foreach($values as $value) { - echo "\n-- Iterator $count --\n"; - var_dump( strrev($value) ); - $count++; -}; - -fclose($resource); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrev() : unexpected inputs for 'str' *** - --- Iterator 1 -- -string(1) "0" - --- Iterator 2 -- -string(1) "1" - --- Iterator 3 -- -string(5) "54321" - --- Iterator 4 -- -string(5) "5432-" - --- Iterator 5 -- -string(4) "5.01" - --- Iterator 6 -- -string(5) "5.01-" - --- Iterator 7 -- -string(12) "000000000501" - --- Iterator 8 -- -string(7) "9-E60.1" - --- Iterator 9 -- -string(3) "5.0" - --- Iterator 10 -- - -Notice: Array to string conversion in %s on line %d -string(5) "yarrA" - --- Iterator 11 -- - -Notice: Array to string conversion in %s on line %d -string(5) "yarrA" - --- Iterator 12 -- - -Notice: Array to string conversion in %s on line %d -string(5) "yarrA" - --- Iterator 13 -- - -Notice: Array to string conversion in %s on line %d -string(5) "yarrA" - --- Iterator 14 -- - -Notice: Array to string conversion in %s on line %d -string(5) "yarrA" - --- Iterator 15 -- -string(0) "" - --- Iterator 16 -- -string(0) "" - --- Iterator 17 -- -string(1) "1" - --- Iterator 18 -- -string(0) "" - --- Iterator 19 -- -string(1) "1" - --- Iterator 20 -- -string(0) "" - --- Iterator 21 -- -string(0) "" - --- Iterator 22 -- -string(0) "" - --- Iterator 23 -- -string(6) "tcejbo" - --- Iterator 24 -- -string(%d) "%d# di ecruoseR" - --- Iterator 25 -- -string(0) "" - --- Iterator 26 -- -string(0) "" -*** Done *** diff --git a/ext/standard/tests/strings/strripos.phpt b/ext/standard/tests/strings/strripos.phpt deleted file mode 100644 index eb4e70bd354a9..0000000000000 --- a/ext/standard/tests/strings/strripos.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -strripos() function ---FILE-- - ---EXPECT-- -int(5) -int(12) -int(18) -int(12) -int(10) -int(2) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -int(1) - diff --git a/ext/standard/tests/strings/strripos_offset.phpt b/ext/standard/tests/strings/strripos_offset.phpt deleted file mode 100644 index daa917e79fe22..0000000000000 --- a/ext/standard/tests/strings/strripos_offset.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -strripos() offset integer overflow ---FILE-- - ---EXPECTF-- -Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) - -Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) - -Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) - -Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) - -Warning: strripos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) - -Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) - -Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) - -Notice: strripos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/strings/strrpos.phpt b/ext/standard/tests/strings/strrpos.phpt deleted file mode 100644 index 691f67e599e14..0000000000000 --- a/ext/standard/tests/strings/strrpos.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -strrpos() function ---FILE-- - ---EXPECT-- -int(5) -int(5) -int(18) -int(12) -int(10) -int(2) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(1) diff --git a/ext/standard/tests/strings/strrpos_basic1.phpt b/ext/standard/tests/strings/strrpos_basic1.phpt deleted file mode 100644 index 26497fb3ffa71..0000000000000 --- a/ext/standard/tests/strings/strrpos_basic1.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test strrpos() function : basic functionality - with default arguments ---FILE-- - ---EXPECTF-- -*** Testing strrpos() function: basic functionality *** --- With default arguments -- -int(0) -bool(false) -int(7) -bool(false) -int(8) -int(5) -int(0) -int(0) -int(0) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_basic2.phpt b/ext/standard/tests/strings/strrpos_basic2.phpt deleted file mode 100644 index a65bbf3fd21f0..0000000000000 --- a/ext/standard/tests/strings/strrpos_basic2.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Test strrpos() function : basic functionality - with all arguments ---FILE-- - ---EXPECTF-- -*** Testing strrpos() function: basic functionality *** --- With all arguments -- -int(0) -bool(false) -int(7) -int(7) -int(0) -int(0) -bool(false) -int(0) -bool(false) -int(8) -int(8) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_error.phpt b/ext/standard/tests/strings/strrpos_error.phpt deleted file mode 100644 index 3900ceaa5d7ce..0000000000000 --- a/ext/standard/tests/strings/strrpos_error.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test strrpos() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing strrpos() function: error conditions *** --- With Zero arguments -- -Warning: strrpos() expects at least 2 parameters, 0 given in %s on line %d -bool(false) - --- With less than expected number of arguments -- -Warning: strrpos() expects at least 2 parameters, 1 given in %s on line %d -bool(false) - --- With more than expected number of arguments -- -Warning: strrpos() expects at most 3 parameters, 4 given in %s on line %d -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation1.phpt b/ext/standard/tests/strings/strrpos_variation1.phpt deleted file mode 100644 index a7ef3e9b059d7..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation1.phpt +++ /dev/null @@ -1,182 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - double quoted strings for 'haystack' & 'needle' arguments ---FILE-- -?@hello123456he \x234 \101 "; -$needle = array( - //regular strings - "l", - "L", - "HELLO", - "hEllo", - - //escape characters - "\t", - "\T", //invalid input - " ", - "\n", - "\N", //invalid input - " -", //new line - - //nulls - "\0", - NULL, - null, - - //boolean false - FALSE, - false, - - //empty string - "", - - //special chars - " ", - "$", - " $", - "&", - "!#", - "()", - "<=>", - ">", - "=>", - "?", - "@", - "@hEllo", - - "12345", //decimal numeric string - "\x23", //hexadecimal numeric string - "#", //respective ASCII char of \x23 - "\101", //octal numeric string - "A", //respective ASCII char of \101 - "456HEE", //numerics + chars - $haystack //haystack as needle -); - -/* loop through to get the position of the needle in haystack string */ -$count = 1; -for($index=0; $index ---EXPECTF-- -*** Testing strrpos() function: with double quoted strings *** --- Iteration 1 -- -int(28) -int(28) --- Iteration 2 -- -bool(false) -bool(false) --- Iteration 3 -- -bool(false) -bool(false) --- Iteration 4 -- -bool(false) -bool(false) --- Iteration 5 -- -int(6) -int(6) --- Iteration 6 -- -bool(false) -bool(false) --- Iteration 7 -- -bool(false) -bool(false) --- Iteration 8 -- -int(9) -int(9) --- Iteration 9 -- -bool(false) -bool(false) --- Iteration 10 -- -int(9) -int(9) --- Iteration 11 -- -int(8) -bool(false) --- Iteration 12 -- -int(8) -bool(false) --- Iteration 13 -- -int(8) -bool(false) --- Iteration 14 -- -int(8) -bool(false) --- Iteration 15 -- -int(8) -bool(false) --- Iteration 16 -- -bool(false) -bool(false) --- Iteration 17 -- -int(43) -int(43) --- Iteration 18 -- -int(12) -bool(false) --- Iteration 19 -- -int(11) -bool(false) --- Iteration 20 -- -int(13) -bool(false) --- Iteration 21 -- -int(14) -bool(false) --- Iteration 22 -- -int(17) -bool(false) --- Iteration 23 -- -int(20) -bool(false) --- Iteration 24 -- -int(22) -bool(false) --- Iteration 25 -- -int(21) -bool(false) --- Iteration 26 -- -int(23) -bool(false) --- Iteration 27 -- -int(24) -bool(false) --- Iteration 28 -- -bool(false) -bool(false) --- Iteration 29 -- -int(30) -int(30) --- Iteration 30 -- -int(39) -int(39) --- Iteration 31 -- -int(39) -int(39) --- Iteration 32 -- -int(42) -int(42) --- Iteration 33 -- -int(42) -int(42) --- Iteration 34 -- -bool(false) -bool(false) --- Iteration 35 -- -int(0) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation10.phpt b/ext/standard/tests/strings/strrpos_variation10.phpt deleted file mode 100644 index f3adb3ee92dc6..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation10.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - unexpected inputs for 'needle' argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop through each element of the 'needle' array to check the working of strrpos() -$counter = 1; -for($index = 0; $index < count($needles); $index ++) { - echo "-- Iteration $counter --\n"; - var_dump( strrpos($haystack, $needles[$index]) ); - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrpos() function with unexpected values for needle *** --- Iteration 1 -- -bool(false) --- Iteration 2 -- -bool(false) --- Iteration 3 -- -bool(false) --- Iteration 4 -- -bool(false) --- Iteration 5 -- -bool(false) --- Iteration 6 -- -bool(false) --- Iteration 7 -- -bool(false) --- Iteration 8 -- -bool(false) --- Iteration 9 -- -bool(false) --- Iteration 10 -- -bool(false) --- Iteration 11 -- -bool(false) --- Iteration 12 -- -bool(false) --- Iteration 13 -- -bool(false) --- Iteration 14 -- -bool(false) --- Iteration 15 -- -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- - -Notice: Object of class sample could not be converted to int in %s on line %d -bool(false) --- Iteration 20 -- -bool(false) --- Iteration 21 -- -bool(false) --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- -%s --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation11.phpt b/ext/standard/tests/strings/strrpos_variation11.phpt deleted file mode 100644 index 5b5e7e3e39bd4..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation11.phpt +++ /dev/null @@ -1,199 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - unexpected inputs for 'haystack' and 'needle' arguments ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of strrpos() -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $haystack = $values[$index]; - var_dump( strrpos($values[$index], $values[$index]) ); - var_dump( strrpos($values[$index], $values[$index], 1) ); - $counter ++; -} - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrpos() function with unexpected values for haystack and needle *** --- Iteration 1 -- -bool(false) -bool(false) --- Iteration 2 -- -bool(false) -bool(false) --- Iteration 3 -- -bool(false) -bool(false) --- Iteration 4 -- -bool(false) -bool(false) --- Iteration 5 -- -bool(false) -bool(false) --- Iteration 6 -- -bool(false) -bool(false) --- Iteration 7 -- -bool(false) -bool(false) --- Iteration 8 -- -bool(false) -bool(false) --- Iteration 9 -- -bool(false) -bool(false) --- Iteration 10 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 11 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 12 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 13 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 14 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 15 -- -bool(false) -bool(false) --- Iteration 16 -- -bool(false) -bool(false) --- Iteration 17 -- -bool(false) -bool(false) --- Iteration 18 -- -bool(false) -bool(false) --- Iteration 19 -- - -Notice: Object of class sample could not be converted to int in %s on line %d -bool(false) - -Notice: Object of class sample could not be converted to int in %s on line %d -bool(false) --- Iteration 20 -- -bool(false) -bool(false) --- Iteration 21 -- -bool(false) -bool(false) --- Iteration 22 -- -bool(false) -bool(false) --- Iteration 23 -- -bool(false) -bool(false) --- Iteration 24 -- - -Warning: strrpos() expects parameter 1 to be string, resource given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, resource given in %s on line %d -bool(false) --- Iteration 25 -- -bool(false) -bool(false) --- Iteration 26 -- -bool(false) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation12.phpt b/ext/standard/tests/strings/strrpos_variation12.phpt deleted file mode 100644 index 87ac3b2f84c6a..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation12.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - checking binary safe with 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Test strrpos() function: binary safe *** -int(5) -int(5) -int(0) -bool(false) -int(11) -int(11) -int(2) -bool(false) -int(5) -int(5) -int(0) -bool(false) -int(5) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation13.phpt b/ext/standard/tests/strings/strrpos_variation13.phpt deleted file mode 100644 index f85c3c454fceb..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation13.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - checking bianry safe with 'needle' argument ---FILE-- - ---EXPECTF-- -*** Test strrpos() function: binary safe *** -int(1) -int(1) -int(0) -bool(false) -int(12) -int(12) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -bool(false) -int(1) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation14.phpt b/ext/standard/tests/strings/strrpos_variation14.phpt deleted file mode 100644 index 617685325f1d4..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation14.phpt +++ /dev/null @@ -1,153 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - unexpected inputs for 'offset' argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - //resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of strrpos() -$counter = 1; -for($index = 0; $index < count($offsets); $index ++) { - echo "-- Iteration $counter --\n"; - var_dump( strrpos($haystack, $needle, $offsets[$index]) ); - $counter ++; -} - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrpos() function: with unexpected values for offset *** --- Iteration 1 -- -int(6) --- Iteration 2 -- -int(6) --- Iteration 3 -- - -Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) --- Iteration 4 -- -int(6) --- Iteration 5 -- -int(6) --- Iteration 6 -- - -Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d -bool(false) --- Iteration 7 -- - -Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d -bool(false) --- Iteration 8 -- - -Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d -bool(false) --- Iteration 9 -- - -Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d -bool(false) --- Iteration 10 -- - -Warning: strrpos() expects parameter 3 to be long, array given in %s on line %d -bool(false) --- Iteration 11 -- -int(6) --- Iteration 12 -- -int(6) --- Iteration 13 -- -int(6) --- Iteration 14 -- -int(6) --- Iteration 15 -- - -Warning: strrpos() expects parameter 3 to be long, object given in %s on line %d -bool(false) --- Iteration 16 -- - -Warning: strrpos() expects parameter 3 to be long, string given in %s on line %d -bool(false) --- Iteration 17 -- - -Warning: strrpos() expects parameter 3 to be long, string given in %s on line %d -bool(false) --- Iteration 18 -- -int(6) --- Iteration 19 -- -int(6) --- Iteration 20 -- - -Warning: strrpos() expects parameter 3 to be long, resource given in %s on line %d -bool(false) --- Iteration 21 -- -int(6) --- Iteration 22 -- -int(6) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation15.phpt b/ext/standard/tests/strings/strrpos_variation15.phpt deleted file mode 100644 index 23c7aef145eb8..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation15.phpt +++ /dev/null @@ -1,171 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - unexpected inputs for 'haystack', 'needle' & 'offset' arguments ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - //resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop through each element of the array and check the working of strrpos() -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - var_dump( strrpos($values[$index], $values[$index], $values[$index]) ); - $counter ++; -} - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrpos() function: with unexpected values for haystack, needle & offset *** --- Iteration 1 -- -bool(false) --- Iteration 2 -- -bool(false) --- Iteration 3 -- - -Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) --- Iteration 4 -- - -Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) --- Iteration 5 -- - -Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) --- Iteration 6 -- - -Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) --- Iteration 7 -- - -Notice: strrpos(): Offset is greater than the length of haystack string in %s on line %d -bool(false) --- Iteration 8 -- -bool(false) --- Iteration 9 -- -bool(false) --- Iteration 10 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 11 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 12 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 13 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 14 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) --- Iteration 15 -- -bool(false) --- Iteration 16 -- -bool(false) --- Iteration 17 -- -bool(false) --- Iteration 18 -- -bool(false) --- Iteration 19 -- - -Warning: strrpos() expects parameter 3 to be long, object given in %s on line %d -bool(false) --- Iteration 20 -- - -Warning: strrpos() expects parameter 3 to be long, string given in %s on line %d -bool(false) --- Iteration 21 -- - -Warning: strrpos() expects parameter 3 to be long, string given in %s on line %d -bool(false) --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- - -Warning: strrpos() expects parameter 1 to be string, resource given in %s on line %d -bool(false) --- Iteration 25 -- -bool(false) --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation2.phpt b/ext/standard/tests/strings/strrpos_variation2.phpt deleted file mode 100644 index 53645866be62e..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation2.phpt +++ /dev/null @@ -1,186 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - single quoted strings for 'haystack' & 'needle' arguments ---FILE-- -?@hello123456he \x234 \101 '; -$needle = array( - //regular strings - 'l', - 'L', - 'HELLO', - 'hEllo', - - //escape characters - '\t', - '\T', - ' ', - '\n', - '\N', - ' -', //new line - - //nulls - '\0', - NULL, - null, - - //boolean false - FALSE, - false, - - //empty string - '', - - //special chars - ' ', - '$', - ' $', - '&', - '!#', - '()', - '<=>', - '>', - '=>', - '?', - '@', - '@hEllo', - - '12345', //decimal numeric string - '\x23', //hexadecimal numeric string - '#', //hexadecimal numeric string - '\101', //octal numeric string - 'A', - '456HEE', //numerics + chars - 42, //needle as int(ASCII value of '*') - $haystack //haystack as needle -); - -/* loop through to get the position of the needle in haystack string */ -$count = 1; -for($index=0; $index ---EXPECTF-- -*** Testing strrpos() function: with single quoted strings *** --- Iteration 1 -- -int(32) -int(32) --- Iteration 2 -- -bool(false) -bool(false) --- Iteration 3 -- -bool(false) -bool(false) --- Iteration 4 -- -bool(false) -bool(false) --- Iteration 5 -- -int(6) -int(6) --- Iteration 6 -- -bool(false) -bool(false) --- Iteration 7 -- -bool(false) -bool(false) --- Iteration 8 -- -int(12) -int(12) --- Iteration 9 -- -bool(false) -bool(false) --- Iteration 10 -- -bool(false) -bool(false) --- Iteration 11 -- -int(10) -int(10) --- Iteration 12 -- -bool(false) -bool(false) --- Iteration 13 -- -bool(false) -bool(false) --- Iteration 14 -- -bool(false) -bool(false) --- Iteration 15 -- -bool(false) -bool(false) --- Iteration 16 -- -bool(false) -bool(false) --- Iteration 17 -- -int(53) -int(53) --- Iteration 18 -- -int(16) -bool(false) --- Iteration 19 -- -int(15) -bool(false) --- Iteration 20 -- -int(17) -bool(false) --- Iteration 21 -- -int(18) -bool(false) --- Iteration 22 -- -int(21) -int(21) --- Iteration 23 -- -int(24) -int(24) --- Iteration 24 -- -int(26) -int(26) --- Iteration 25 -- -int(25) -int(25) --- Iteration 26 -- -int(27) -int(27) --- Iteration 27 -- -int(28) -int(28) --- Iteration 28 -- -bool(false) -bool(false) --- Iteration 29 -- -int(34) -int(34) --- Iteration 30 -- -int(43) -int(43) --- Iteration 31 -- -int(19) -bool(false) --- Iteration 32 -- -int(49) -int(49) --- Iteration 33 -- -bool(false) -bool(false) --- Iteration 34 -- -bool(false) -bool(false) --- Iteration 35 -- -int(23) -bool(false) --- Iteration 36 -- -int(0) -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strrpos_variation3.phpt b/ext/standard/tests/strings/strrpos_variation3.phpt deleted file mode 100644 index a0a0d270e88f8..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation3.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - multi line heredoc string for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing strrpos() function: with heredoc strings *** --- With heredoc string containing multi lines -- -int(44) -int(44) -int(44) -bool(false) -int(55) -*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/strings/strrpos_variation4.phpt b/ext/standard/tests/strings/strrpos_variation4.phpt deleted file mode 100644 index 1ccf529856633..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation4.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - heredoc string containing special chars for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing strrpos() function: with heredoc strings *** --- With heredoc string containing special chars -- -int(0) -bool(false) -int(41) -int(39) -int(55) -int(55) -int(57) -*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/strings/strrpos_variation5.phpt b/ext/standard/tests/strings/strrpos_variation5.phpt deleted file mode 100644 index f9537da0e2d94..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation5.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - heredoc string containing escape chars for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing strrpos() function: with heredoc strings *** --- With heredoc string containing escape characters -- -int(13) -int(19) -int(13) -int(19) -*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/strings/strrpos_variation6.phpt b/ext/standard/tests/strings/strrpos_variation6.phpt deleted file mode 100644 index c879a91209dba..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation6.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - heredoc string containing quotes for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing strrpos() function: with heredoc strings *** --- With heredoc string containing quote & slash chars -- -int(88) -int(59) -int(59) -int(59) -*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/strings/strrpos_variation7.phpt b/ext/standard/tests/strings/strrpos_variation7.phpt deleted file mode 100644 index 239dc246bc859..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation7.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - empty heredoc string for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing strrpos() function: with heredoc strings *** --- With empty heredoc string -- -bool(false) -bool(false) -bool(false) -bool(false) -*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/strings/strrpos_variation8.phpt b/ext/standard/tests/strings/strrpos_variation8.phpt deleted file mode 100644 index eac7d8ff8372d..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation8.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - repetitive chars for 'haystack' argument ---FILE-- - ---EXPECTF-- -*** Testing strrpos() function: strings repetitive chars *** --- Iteration 1 -- -int(4) --- Iteration 2 -- -int(4) --- Iteration 3 -- -int(4) --- Iteration 4 -- -int(4) --- Iteration 5 -- -int(4) --- Iteration 6 -- -int(4) --- Iteration 7 -- -bool(false) --- Iteration 8 -- -bool(false) --- Iteration 9 -- -bool(false) --- Iteration 10 -- -bool(false) --- Iteration 11 -- -bool(false) --- Iteration 12 -- -bool(false) --- Iteration 13 -- -bool(false) --- Iteration 14 -- -bool(false) --- Iteration 15 -- -bool(false) -*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/strings/strrpos_variation9.phpt b/ext/standard/tests/strings/strrpos_variation9.phpt deleted file mode 100644 index 9b3b8d673dd25..0000000000000 --- a/ext/standard/tests/strings/strrpos_variation9.phpt +++ /dev/null @@ -1,184 +0,0 @@ ---TEST-- -Test strrpos() function : usage variations - unexpected inputs for 'haystack' argument ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -$needle = "heredoc 0 1 2 -2 10.5 -10.5 10.5e10 10.6E-10 .5 array true false object \"\" null Resource"; - -// loop through each element of the array and check the working of strrpos() -$counter = 1; -for($index = 0; $index < count($haystacks); $index ++) { - echo "\n-- Iteration $counter --\n"; - var_dump( strrpos($haystacks[$index], $needle) ); - $counter ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strrpos() function with unexpected values for haystack *** - --- Iteration 1 -- -bool(false) - --- Iteration 2 -- -bool(false) - --- Iteration 3 -- -bool(false) - --- Iteration 4 -- -bool(false) - --- Iteration 5 -- -bool(false) - --- Iteration 6 -- -bool(false) - --- Iteration 7 -- -bool(false) - --- Iteration 8 -- -bool(false) - --- Iteration 9 -- -bool(false) - --- Iteration 10 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - --- Iteration 11 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - --- Iteration 12 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - --- Iteration 13 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - --- Iteration 14 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - --- Iteration 15 -- -bool(false) - --- Iteration 16 -- -bool(false) - --- Iteration 17 -- -bool(false) - --- Iteration 18 -- -bool(false) - --- Iteration 19 -- -bool(false) - --- Iteration 20 -- -bool(false) - --- Iteration 21 -- -bool(false) - --- Iteration 22 -- -bool(false) - --- Iteration 23 -- -bool(false) - --- Iteration 24 -- - -Warning: strrpos() expects parameter 1 to be string, resource given in %s on line %d -bool(false) - --- Iteration 25 -- -bool(false) - --- Iteration 26 -- -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strspn.phpt b/ext/standard/tests/strings/strspn.phpt deleted file mode 100644 index 9f498b84d67db..0000000000000 --- a/ext/standard/tests/strings/strspn.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test strspn() behavior ---FILE-- - ---EXPECT-- -string(25) "22222222aaaa bbb1111 cccc" -string(4) "1234" -int(8) -int(6) -int(3) diff --git a/ext/standard/tests/strings/strspn_basic.phpt b/ext/standard/tests/strings/strspn_basic.phpt deleted file mode 100644 index d9b1a33881386..0000000000000 --- a/ext/standard/tests/strings/strspn_basic.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test strspn() function : basic functionality ---FILE-- - ---EXPECTF-- -*** Testing strspn() : basic functionality *** -int(11) -int(11) -int(2) -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_error.phpt b/ext/standard/tests/strings/strspn_error.phpt deleted file mode 100644 index caa1f901a110c..0000000000000 --- a/ext/standard/tests/strings/strspn_error.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test strspn() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing strspn() : error conditions *** - --- Testing strspn() function with Zero arguments -- - -Warning: strspn() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- Testing strspn() function with more than expected no. of arguments -- - -Warning: strspn() expects at most 4 parameters, 5 given in %s on line %d -NULL - --- Testing strspn() function with less than expected no. of arguments -- - -Warning: strspn() expects at least 2 parameters, 1 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/strspn_variation1.phpt b/ext/standard/tests/strings/strspn_variation1.phpt deleted file mode 100644 index 45e71edc28a95..0000000000000 --- a/ext/standard/tests/strings/strspn_variation1.phpt +++ /dev/null @@ -1,273 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - unexpected values for str argument ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new sample, - - // undefined data - $undefined_var, - - // unset data - $unset_var, - - // resource - $file_handle -); - -// loop through each element of the array for str - -foreach($values as $value) { - echo "\n-- Iteration with str value as \"$value\"\n"; - var_dump( strspn($value,$mask) ); // with default args - var_dump( strspn($value,$mask,$start) ); // with default len value - var_dump( strspn($value,$mask,$start,$len) ); // with all args -}; - -// closing the resource -fclose($file_handle); - -echo "Done" -?> ---EXPECTF-- -*** Testing strspn() : with unexpected values for str argument *** - --- Iteration with str value as "0" -int(1) -int(0) -int(0) - --- Iteration with str value as "1" -int(1) -int(0) -int(0) - --- Iteration with str value as "12345" -int(5) -int(4) -int(4) - --- Iteration with str value as "-2345" -int(0) -int(4) -int(4) - --- Iteration with str value as "10.5" -int(2) -int(1) -int(1) - --- Iteration with str value as "-10.5" -int(0) -int(2) -int(2) - --- Iteration with str value as "101234567000" -int(12) -int(11) -int(10) - --- Iteration with str value as "1.07654321E-9" -int(1) -int(0) -int(0) - --- Iteration with str value as "0.5" -int(1) -int(0) -int(0) - --- Iteration with str value as "Array" - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration with str value as "Array" - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration with str value as "Array" - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration with str value as "Array" - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration with str value as "Array" - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, array given in %s on line %d -NULL - --- Iteration with str value as "" -int(0) -bool(false) -bool(false) - --- Iteration with str value as "" -int(0) -bool(false) -bool(false) - --- Iteration with str value as "1" -int(1) -int(0) -int(0) - --- Iteration with str value as "" -int(0) -bool(false) -bool(false) - --- Iteration with str value as "1" -int(1) -int(0) -int(0) - --- Iteration with str value as "" -int(0) -bool(false) -bool(false) - --- Iteration with str value as "" -int(0) -bool(false) -bool(false) - --- Iteration with str value as "" -int(0) -bool(false) -bool(false) - --- Iteration with str value as "object" -int(2) -int(1) -int(1) - --- Iteration with str value as "" -int(0) -bool(false) -bool(false) - --- Iteration with str value as "" -int(0) -bool(false) -bool(false) - --- Iteration with str value as "Resource id #%d" - -Warning: strspn() expects parameter 1 to be string, resource given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, resource given in %s on line %d -NULL - -Warning: strspn() expects parameter 1 to be string, resource given in %s on line %d -NULL -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation10.phpt b/ext/standard/tests/strings/strspn_variation10.phpt deleted file mode 100644 index 318d16ccfb4dc..0000000000000 --- a/ext/standard/tests/strings/strspn_variation10.phpt +++ /dev/null @@ -1,274 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - with varying mask & default start and len args ---FILE-- - ---EXPECTF-- -*** Testing strspn() : with different mask strings and default start and len arguments *** - --- Iteration 1 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 2 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 3 -- -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) - --- Iteration 4 -- -int(0) -int(0) -int(1) -int(2) -int(0) -int(1) -int(1) -int(1) -int(0) -int(1) - --- Iteration 5 -- -int(0) -int(0) -int(4) -int(4) -int(4) -int(0) -int(4) -int(4) -int(0) -int(4) - --- Iteration 6 -- -int(0) -int(0) -int(4) -int(4) -int(4) -int(0) -int(4) -int(4) -int(0) -int(4) - --- Iteration 7 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 8 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 9 -- -int(0) -int(0) -int(4) -int(4) -int(4) -int(0) -int(4) -int(4) -int(0) -int(4) - --- Iteration 10 -- -int(0) -int(0) -int(4) -int(4) -int(4) -int(0) -int(4) -int(4) -int(0) -int(4) - --- Iteration 11 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 12 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 13 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 14 -- -int(0) -int(0) -int(4) -int(4) -int(4) -int(0) -int(4) -int(4) -int(0) -int(4) - --- Iteration 15 -- -int(0) -int(0) -int(4) -int(4) -int(4) -int(0) -int(4) -int(4) -int(0) -int(4) - --- Iteration 16 -- -int(0) -int(0) -int(4) -int(4) -int(4) -int(0) -int(4) -int(4) -int(0) -int(4) - --- Iteration 17 -- -int(0) -int(0) -int(4) -int(4) -int(4) -int(0) -int(4) -int(4) -int(0) -int(4) -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation11.phpt b/ext/standard/tests/strings/strspn_variation11.phpt deleted file mode 100644 index 209981e69a340..0000000000000 --- a/ext/standard/tests/strings/strspn_variation11.phpt +++ /dev/null @@ -1,1306 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - with varying start and default len args ---FILE-- - ---EXPECTF-- -*** Testing strspn() : with different start and default len values *** - --- Iteration 1 -- -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 2 -- -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 3 -- -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(1) -int(0) -bool(false) -int(1) -int(1) -bool(false) -int(1) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(1) -int(0) -bool(false) -int(1) -int(1) -bool(false) -int(1) - --- Iteration 4 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(1) -int(0) -int(0) -int(0) -int(1) -bool(false) -int(1) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(1) -int(0) -int(0) -int(0) -int(1) -bool(false) -int(1) -int(1) -int(0) -int(0) -int(0) -int(1) -bool(false) -int(1) -int(1) -int(0) -int(0) -int(0) -int(1) -bool(false) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(1) -int(0) -int(0) -int(0) -int(1) -bool(false) -int(1) - --- Iteration 5 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(1) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(1) -int(0) -bool(false) -int(4) - --- Iteration 6 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(1) -int(2) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(1) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) - --- Iteration 7 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 8 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 9 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(1) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(1) -int(0) -bool(false) -int(4) - --- Iteration 10 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) - --- Iteration 11 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 12 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 13 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(4) -int(3) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 14 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) - --- Iteration 15 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) - --- Iteration 16 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) - --- Iteration 17 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(1) -bool(false) -int(4) -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation12.phpt b/ext/standard/tests/strings/strspn_variation12.phpt deleted file mode 100644 index 9e2eaf010dd14..0000000000000 --- a/ext/standard/tests/strings/strspn_variation12.phpt +++ /dev/null @@ -1,2878 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - with varying start and len args ---FILE-- - ---EXPECTF-- -*** Testing strspn() : with different start and len values *** - --- Iteration 1 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 2 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 3 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) - --- Iteration 4 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) - --- Iteration 5 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 6 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 7 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 8 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 9 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 10 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 11 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation2.phpt b/ext/standard/tests/strings/strspn_variation2.phpt deleted file mode 100644 index 7af61e559ae92..0000000000000 --- a/ext/standard/tests/strings/strspn_variation2.phpt +++ /dev/null @@ -1,272 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - unexpected values for mask argument ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new sample(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, - - // resource - $file_handle -); - -// loop through each element of the array for mask - -foreach($values as $value) { - echo "\n-- Iteration with mask value as \"$value\" --\n"; - var_dump( strspn($str,$value) ); // with defalut args - var_dump( strspn($str,$value,$start) ); // with default len value - var_dump( strspn($str,$value,$start,$len) ); // with all args -}; - -// close the resource -fclose($file_handle); - -echo "Done" -?> ---EXPECTF-- -*** Testing strspn() : with diferent unexpected values of mask argument *** - --- Iteration with mask value as "0" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "1" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "12345" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "-2345" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "10.5" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "-10.5" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "101234567000" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "1.07654321E-9" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "0.5" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "Array" -- - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - --- Iteration with mask value as "Array" -- - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - --- Iteration with mask value as "Array" -- - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - --- Iteration with mask value as "Array" -- - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - --- Iteration with mask value as "Array" -- - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, array given in %s on line %d -NULL - --- Iteration with mask value as "" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "1" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "1" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "object" -- -int(0) -int(1) -int(1) - --- Iteration with mask value as "" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "" -- -int(0) -int(0) -int(0) - --- Iteration with mask value as "Resource id #%d" -- - -Warning: strspn() expects parameter 2 to be string, resource given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, resource given in %s on line %d -NULL - -Warning: strspn() expects parameter 2 to be string, resource given in %s on line %d -NULL -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation3.phpt b/ext/standard/tests/strings/strspn_variation3.phpt deleted file mode 100644 index 3195220dea57f..0000000000000 --- a/ext/standard/tests/strings/strspn_variation3.phpt +++ /dev/null @@ -1,243 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - unexpected values of start argument ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new sample(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, - - // resource - $file_handle -); - -// loop through each element of the array for start - -foreach($values as $value) { - echo "\n-- Iteration with start value as \"$value\" --\n"; - var_dump( strspn($str,$mask,$value) ); // with default len value - var_dump( strspn($str,$mask,$value,$len) ); // with all args -}; - -// closing the resource -fclose($file_handle); - -echo "Done" -?> ---EXPECTF-- -*** Testing strspn() : with unexpected values of start argument *** - --- Iteration with start value as "10.5" -- -int(0) -int(0) - --- Iteration with start value as "-10.5" -- -int(2) -int(2) - --- Iteration with start value as "1012345670" -- -bool(false) -bool(false) - --- Iteration with start value as "1.07654321E-7" -- -int(2) -int(2) - --- Iteration with start value as "0.5" -- -int(2) -int(2) - --- Iteration with start value as "Array" -- - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - --- Iteration with start value as "Array" -- - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - --- Iteration with start value as "Array" -- - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - --- Iteration with start value as "Array" -- - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - --- Iteration with start value as "Array" -- - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, array given in %s on line %d -NULL - --- Iteration with start value as "" -- -int(2) -int(2) - --- Iteration with start value as "" -- -int(2) -int(2) - --- Iteration with start value as "1" -- -int(1) -int(1) - --- Iteration with start value as "" -- -int(2) -int(2) - --- Iteration with start value as "1" -- -int(1) -int(1) - --- Iteration with start value as "" -- -int(2) -int(2) - --- Iteration with start value as "" -- - -Warning: strspn() expects parameter 3 to be long, string given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, string given in %s on line %d -NULL - --- Iteration with start value as "" -- - -Warning: strspn() expects parameter 3 to be long, string given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, string given in %s on line %d -NULL - --- Iteration with start value as "string" -- - -Warning: strspn() expects parameter 3 to be long, string given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, string given in %s on line %d -NULL - --- Iteration with start value as "string" -- - -Warning: strspn() expects parameter 3 to be long, string given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, string given in %s on line %d -NULL - --- Iteration with start value as "object" -- - -Warning: strspn() expects parameter 3 to be long, object given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, object given in %s on line %d -NULL - --- Iteration with start value as "" -- -int(2) -int(2) - --- Iteration with start value as "" -- -int(2) -int(2) - --- Iteration with start value as "Resource id #%d" -- - -Warning: strspn() expects parameter 3 to be long, resource given in %s on line %d -NULL - -Warning: strspn() expects parameter 3 to be long, resource given in %s on line %d -NULL -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation4.phpt b/ext/standard/tests/strings/strspn_variation4.phpt deleted file mode 100644 index 87dceac3b8b9e..0000000000000 --- a/ext/standard/tests/strings/strspn_variation4.phpt +++ /dev/null @@ -1,196 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - unexpected values of len argument ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new sample(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, - - // resource - $file_handle -); - -// loop through each element of the array for start - -foreach($values as $value) { - echo "\n-- Iteration with len value as \"$value\" --\n"; - var_dump( strspn($str,$mask,$start,$value) ); // with all args -}; - -// closing the resource -fclose($file_handle); - -echo "Done" -?> ---EXPECTF-- -*** Testing strspn() : with unexpected values of len argument *** - --- Iteration with len value as "10.5" -- -int(2) - --- Iteration with len value as "-10.5" -- -int(0) - --- Iteration with len value as "1012345670" -- -int(2) - --- Iteration with len value as "1.07654321E-7" -- -int(0) - --- Iteration with len value as "0.5" -- -int(0) - --- Iteration with len value as "Array" -- - -Warning: strspn() expects parameter 4 to be long, array given in %s on line %d -NULL - --- Iteration with len value as "Array" -- - -Warning: strspn() expects parameter 4 to be long, array given in %s on line %d -NULL - --- Iteration with len value as "Array" -- - -Warning: strspn() expects parameter 4 to be long, array given in %s on line %d -NULL - --- Iteration with len value as "Array" -- - -Warning: strspn() expects parameter 4 to be long, array given in %s on line %d -NULL - --- Iteration with len value as "Array" -- - -Warning: strspn() expects parameter 4 to be long, array given in %s on line %d -NULL - --- Iteration with len value as "" -- -int(0) - --- Iteration with len value as "" -- -int(0) - --- Iteration with len value as "1" -- -int(1) - --- Iteration with len value as "" -- -int(0) - --- Iteration with len value as "1" -- -int(1) - --- Iteration with len value as "" -- -int(0) - --- Iteration with len value as "" -- - -Warning: strspn() expects parameter 4 to be long, string given in %s on line %d -NULL - --- Iteration with len value as "" -- - -Warning: strspn() expects parameter 4 to be long, string given in %s on line %d -NULL - --- Iteration with len value as "string" -- - -Warning: strspn() expects parameter 4 to be long, string given in %s on line %d -NULL - --- Iteration with len value as "string" -- - -Warning: strspn() expects parameter 4 to be long, string given in %s on line %d -NULL - --- Iteration with len value as "object" -- - -Warning: strspn() expects parameter 4 to be long, object given in %s on line %d -NULL - --- Iteration with len value as "" -- -int(0) - --- Iteration with len value as "" -- -int(0) - --- Iteration with len value as "Resource id #%d" -- - -Warning: strspn() expects parameter 4 to be long, resource given in %s on line %d -NULL -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation5.phpt b/ext/standard/tests/strings/strspn_variation5.phpt deleted file mode 100644 index 514af55319113..0000000000000 Binary files a/ext/standard/tests/strings/strspn_variation5.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strspn_variation6.phpt b/ext/standard/tests/strings/strspn_variation6.phpt deleted file mode 100644 index 3c3c1d8c37c43..0000000000000 --- a/ext/standard/tests/strings/strspn_variation6.phpt +++ /dev/null @@ -1,179 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - with heredoc strings, varying mask & default start and len args ---FILE-- - ---EXPECTF-- -*** Testing strspn() : with different mask strings *** - --- Iteration 1 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 2 -- -int(0) -int(0) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 3 -- -int(0) -int(0) -int(8) -int(11) -int(0) -int(0) -int(0) -int(1) -int(0) -int(2) - --- Iteration 4 -- -int(0) -int(0) -int(4) -int(4) -int(0) -int(0) -int(0) -int(4) -int(0) -int(4) - --- Iteration 5 -- -int(0) -int(0) -int(4) -int(4) -int(0) -int(0) -int(0) -int(4) -int(0) -int(4) - --- Iteration 6 -- -int(0) -int(0) -int(4) -int(4) -int(0) -int(0) -int(0) -int(4) -int(0) -int(4) - --- Iteration 7 -- -int(0) -int(0) -int(4) -int(4) -int(0) -int(0) -int(0) -int(4) -int(0) -int(4) -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation7.phpt b/ext/standard/tests/strings/strspn_variation7.phpt deleted file mode 100644 index d0ebee3c9253c..0000000000000 --- a/ext/standard/tests/strings/strspn_variation7.phpt +++ /dev/null @@ -1,612 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - with heredoc strings, varying start and default len args ---FILE-- - ---EXPECTF-- -*** Testing strspn() : with different start values *** - --- Iteration 1 -- -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 2 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) - --- Iteration 3 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(8) -int(7) -int(6) -int(0) -int(0) -bool(false) -int(8) -int(11) -int(10) -int(9) -int(0) -int(1) -bool(false) -int(11) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) - --- Iteration 4 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(1) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(1) -int(0) -bool(false) -int(2) - --- Iteration 5 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) - --- Iteration 6 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) - --- Iteration 7 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation8.phpt b/ext/standard/tests/strings/strspn_variation8.phpt deleted file mode 100644 index 3e9e9ddd8c7b1..0000000000000 --- a/ext/standard/tests/strings/strspn_variation8.phpt +++ /dev/null @@ -1,1894 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - with heredoc strings, varying start and len args ---FILE-- - ---EXPECTF-- -*** Testing strspn() : with different start and len values *** - --- Iteration 1 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 2 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 3 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(8) -int(8) -int(0) -int(0) -int(1) -int(2) -int(7) -int(7) -int(0) -int(0) -int(1) -int(2) -int(6) -int(6) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(8) -int(8) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) - --- Iteration 4 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 5 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 6 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 7 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strspn_variation9.phpt b/ext/standard/tests/strings/strspn_variation9.phpt deleted file mode 100644 index 14af0ca0af275..0000000000000 Binary files a/ext/standard/tests/strings/strspn_variation9.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strstr.phpt b/ext/standard/tests/strings/strstr.phpt deleted file mode 100644 index 8c76c65d72b66..0000000000000 Binary files a/ext/standard/tests/strings/strstr.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strtok_basic.phpt b/ext/standard/tests/strings/strtok_basic.phpt deleted file mode 100644 index 6ba48f41e3fe5..0000000000000 --- a/ext/standard/tests/strings/strtok_basic.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Test strtok() function : basic functionality ---FILE-- - ---EXPECTF-- -*** Testing strtok() : basic functionality *** - -The Input string is: -"This testcase test strtok() function." - -The token string is: -" ()." - ---- Token 1 --- -string(4) "This" - ---- Token 2 --- -string(8) "testcase" - ---- Token 3 --- -string(4) "test" - ---- Token 4 --- -string(6) "strtok" - ---- Token 5 --- -string(8) "function" - ---- Token 6 --- -bool(false) - ---- Token 7 --- -bool(false) -Done diff --git a/ext/standard/tests/strings/strtok_error.phpt b/ext/standard/tests/strings/strtok_error.phpt deleted file mode 100644 index d83085b0c61c0..0000000000000 --- a/ext/standard/tests/strings/strtok_error.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test strtok() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing strtok() : error conditions *** - --- Testing strtok() function with Zero arguments -- - -Warning: Wrong parameter count for strtok() in %s on line %d -NULL - --- Testing strtok() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for strtok() in %s on line %d -NULL -string(13) "sample string" - --- Testing strtok() with less than expected no. of arguments -- -bool(false) -string(10) "string val" -Done diff --git a/ext/standard/tests/strings/strtok_variation1.phpt b/ext/standard/tests/strings/strtok_variation1.phpt deleted file mode 100644 index c23b3873fac06..0000000000000 --- a/ext/standard/tests/strings/strtok_variation1.phpt +++ /dev/null @@ -1,172 +0,0 @@ ---TEST-- -Test strtok() function : usage variations - first argument as non-string ---FILE-- - 'red-color', 'item' => 'pen-color'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - // undefined variable - $undefined_var, - - // unset variable - $unset_var, - - // resource - $file_handle -); - - -// loop through each element of the array and check the working of strtok() -// when $str arugment is supplied with different values - -echo "\n--- Testing strtok() by supplying different values for 'str' argument ---\n"; -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $str = $values [$index]; - - var_dump( strtok($str, $token) ); - - $counter ++; -} - -//closing the resource -fclose($file_handle); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing strtok() : with first argument as non-string *** - -Notice: Undefined variable: undefined_var in %s on line %d - -Notice: Undefined variable: unset_var in %s on line %d - ---- Testing strtok() by supplying different values for 'str' argument --- --- Iteration 1 -- -string(1) "0" --- Iteration 2 -- -string(1) "1" --- Iteration 3 -- -string(5) "12345" --- Iteration 4 -- -string(4) "2345" --- Iteration 5 -- -string(4) "10.5" --- Iteration 6 -- -string(4) "10.5" --- Iteration 7 -- -string(12) "101234567000" --- Iteration 8 -- -string(11) "1.07654321E" --- Iteration 9 -- -string(3) "0.5" --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 15 -- -string(1) "1" --- Iteration 16 -- -bool(false) --- Iteration 17 -- -string(1) "1" --- Iteration 18 -- -bool(false) --- Iteration 19 -- -string(3) "obj" --- Iteration 20 -- -bool(false) --- Iteration 21 -- -bool(false) --- Iteration 22 -- -bool(false) --- Iteration 23 -- -bool(false) --- Iteration 24 -- -bool(false) --- Iteration 25 -- -bool(false) --- Iteration 26 -- -string(%d) "Resource id #%d" -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/strtok_variation2.phpt b/ext/standard/tests/strings/strtok_variation2.phpt deleted file mode 100644 index e08005ca7d87d..0000000000000 --- a/ext/standard/tests/strings/strtok_variation2.phpt +++ /dev/null @@ -1,172 +0,0 @@ ---TEST-- -Test strtok() function : usage variations - with different token strings ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new sample(), - - // empty string - "", - '', - - // null vlaues - NULL, - null, - - // undefined variable - $undefined_var, - - // unset variable - $unset_var, - - // resource - $file_handle -); - - -// loop through each element of the array and check the working of strtok() -// when $token arugment is supplied with different values - -echo "\n--- Testing strtok() by supplying different values for 'token' argument ---\n"; -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $token = $values [$index]; - - var_dump( strtok($str, $token) ); - - $counter ++; -} - -// closing the resource -fclose($file_handle); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing strtok() : with different token strings *** - -Notice: Undefined variable: undefined_var in %s on line %d - -Notice: Undefined variable: unset_var in %s on line %d - ---- Testing strtok() by supplying different values for 'token' argument --- --- Iteration 1 -- -string(37) "this testcase test strtok() function " --- Iteration 2 -- -string(37) "this testcase test strtok() function " --- Iteration 3 -- -string(37) "this testcase test strtok() function " --- Iteration 4 -- -string(37) "this testcase test strtok() function " --- Iteration 5 -- -string(37) "this testcase test strtok() function " --- Iteration 6 -- -string(37) "this testcase test strtok() function " --- Iteration 7 -- -string(37) "this testcase test strtok() function " --- Iteration 8 -- -string(37) "this testcase test strtok() function " --- Iteration 9 -- -string(37) "this testcase test strtok() function " --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d -string(10) "this testc" --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d -string(10) "this testc" --- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d -string(10) "this testc" --- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d -string(10) "this testc" --- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d -string(10) "this testc" --- Iteration 15 -- -string(37) "this testcase test strtok() function " --- Iteration 16 -- -string(37) "this testcase test strtok() function " --- Iteration 17 -- -string(37) "this testcase test strtok() function " --- Iteration 18 -- -string(37) "this testcase test strtok() function " --- Iteration 19 -- -string(4) "his " --- Iteration 20 -- -string(37) "this testcase test strtok() function " --- Iteration 21 -- -string(37) "this testcase test strtok() function " --- Iteration 22 -- -string(37) "this testcase test strtok() function " --- Iteration 23 -- -string(37) "this testcase test strtok() function " --- Iteration 24 -- -string(37) "this testcase test strtok() function " --- Iteration 25 -- -string(37) "this testcase test strtok() function " --- Iteration 26 -- -string(2) "th" -Done diff --git a/ext/standard/tests/strings/strtok_variation3.phpt b/ext/standard/tests/strings/strtok_variation3.phpt deleted file mode 100644 index 3026d86a01991..0000000000000 --- a/ext/standard/tests/strings/strtok_variation3.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test strtok() function : usage variations - with heredoc strings ---FILE-- - ---EXPECTF-- -*** Testing strtok() : with heredoc strings *** - ---- Iteration 1 --- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 2 --- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 3 --- -string(11) "first line " -string(7) "f hered" -string(8) "c string" -string(3) "sec" -string(8) "nd line " -string(7) "f hered" -string(8) "c string" -string(11) "third line " -string(7) "f hered" -string(7) "cstring" -bool(false) - ---- Iteration 4 --- -string(4) "hell" -string(1) "w" -string(3) "rld" -string(4) "hell" -string(1) "w" -string(3) "rld" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 5 --- -string(4) "hell" -string(4) "123w" -string(4) "rld4" -string(1) "6" -string(8) "1234hell" -string(4) "1234" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 6 --- -string(4) "hell" -string(1) "w" -string(3) "rld" -string(4) "hell" -string(4) "hell" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -Done diff --git a/ext/standard/tests/strings/strtok_variation4.phpt b/ext/standard/tests/strings/strtok_variation4.phpt deleted file mode 100644 index 6f4fa6621b475..0000000000000 --- a/ext/standard/tests/strings/strtok_variation4.phpt +++ /dev/null @@ -1,110 +0,0 @@ ---TEST-- -Test strtok() function : usage variations - with embedded nulls in the strings ---FILE-- - ---EXPECTF-- -*** Testing strtok() : with embedded nulls in the strings *** - ---- Iteration 1 --- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 2 --- -string(2) "\0" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 3 --- -string(5) "hello" -string(5) "world" -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 4 --- -string(3) "hel" -string(2) "lo" -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 5 --- -string(5) "hello" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 6 --- -string(11) "hello world" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 7 --- -string(4) "\0he" -string(5) "llo\0" -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 8 --- -string(9) "hello\0\0" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -Done diff --git a/ext/standard/tests/strings/strtok_variation5.phpt b/ext/standard/tests/strings/strtok_variation5.phpt deleted file mode 100644 index c49f7ded9fda9..0000000000000 --- a/ext/standard/tests/strings/strtok_variation5.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test strtok() function : usage variations - miscellaneous inputs ---FILE-- - ---EXPECTF-- -*** Testing strtok() : with miscellaneous inputs *** - ---- Iteration 1 --- -string(11) "HELLO WORLD" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 2 --- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 3 --- -string(5) "HELLO" -string(5) "WORLD" -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 4 --- -string(5) "hello" -string(3) "wor" -string(2) "ld" -bool(false) -bool(false) -bool(false) - ---- Iteration 5 --- -string(3) "hel" -string(2) "lo" -string(5) "world" -bool(false) -bool(false) -bool(false) - ---- Iteration 6 --- -string(3) "one" -string(1) "$" -string(3) "two" -string(1) "!" -string(5) "three" -string(1) "#" - ---- Iteration 7 --- -string(11) "hello/r/wor" -string(3) "rld" -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 8 --- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 9 --- -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 10 --- -string(5) "hello" -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - ---- Iteration 11 --- -string(5) "hello" -string(5) "world" -bool(false) -bool(false) -bool(false) -bool(false) -Done diff --git a/ext/standard/tests/strings/strtok_variation6.phpt b/ext/standard/tests/strings/strtok_variation6.phpt deleted file mode 100644 index 5a77f6f9e96a4..0000000000000 --- a/ext/standard/tests/strings/strtok_variation6.phpt +++ /dev/null @@ -1,160 +0,0 @@ ---TEST-- -Test strtok() function : usage variations - invalid escape sequences as tokens ---FILE-- - ---EXPECTF-- -*** Testing strtok() : with invalid escape sequences in token *** - ---- Iteration 1 --- -string(5) "hello" -string(6) " world" -bool(false) -bool(false) - -string(7) "khellok" -string(6) "worldk" -bool(false) -bool(false) - -string(5) "hello" -string(6) " world" -bool(false) -bool(false) - -string(5) "hello" -string(6) " world" -bool(false) -bool(false) - -string(1) " " -string(1) "r" -bool(false) -bool(false) - - ---- Iteration 2 --- -string(1) "\" -string(6) "hello\" -string(7) " world\" -bool(false) - -string(9) "\khello\k" -string(7) "world\k" -bool(false) -bool(false) - -string(1) "\" -string(6) "hello\" -string(7) " world\" -bool(false) - -string(5) "hello" -string(6) " world" -bool(false) -bool(false) - -string(1) " " -string(1) "r" -bool(false) -bool(false) - - ---- Iteration 3 --- -string(1) "/" -string(6) "hello\" -string(7) " world/" -bool(false) - -string(8) "khello\k" -string(5) "world" -string(1) "k" -bool(false) - -string(6) "hello\" -string(6) " world" -bool(false) -bool(false) - -string(1) "/" -string(5) "hello" -string(7) " world/" -bool(false) - -string(1) "/" -string(1) " " -string(1) "r" -string(1) "/" - - ---- Iteration 4 --- -string(6) "/hello" -string(7) "/ world" -bool(false) -bool(false) - -string(6) "hellok" -string(5) "world" -bool(false) -bool(false) - -string(5) "hello" -string(6) " world" -bool(false) -bool(false) - -string(6) "/hello" -string(7) "/ world" -bool(false) -bool(false) - -string(1) "/" -string(2) "/ " -string(1) "r" -bool(false) - -Done diff --git a/ext/standard/tests/strings/strtok_variation7.phpt b/ext/standard/tests/strings/strtok_variation7.phpt deleted file mode 100644 index 28cbf7d917f98..0000000000000 --- a/ext/standard/tests/strings/strtok_variation7.phpt +++ /dev/null @@ -1,108 +0,0 @@ ---TEST-- -Test strtok() function : usage variations - modifying the input string while tokenising ---FILE-- - ---EXPECTF-- -*** Testing strtok() : with modification of input string in between tokenising *** - -*** Testing strtok() when string being tokenised is prefixed with another string in between the process *** -string(4) "this" - --- Token 1 is -- -string(2) "is" - --- Input str is "extra string this is a sample string" -- - --- Token 2 is -- -string(1) "a" - --- Input str is "extra string this is a sample string" -- - --- Token 3 is -- -string(6) "sample" - --- Input str is "extra string this is a sample string" -- - --- Token 4 is -- -string(6) "string" - --- Input str is "extra string this is a sample string" -- - --- Token 5 is -- -bool(false) - --- Input str is "extra string this is a sample string" -- - --- Token 6 is -- -bool(false) - --- Input str is "extra string this is a sample string" -- - -*** Testing strtok() when string being tokenised is suffixed with another string in between the process *** -string(5) "extra" - --- Token 1 is -- -string(6) "string" - --- Token 2 is -- -string(4) "this" - --- Token 3 is -- -string(2) "is" - --- Token 4 is -- -string(1) "a" - --- Token 5 is -- -string(6) "sample" - --- Token 6 is -- -string(6) "string" - --- Token 7 is -- -bool(false) - --- Token 8 is -- -bool(false) - --- Token 9 is -- -bool(false) - --- Token 10 is -- -bool(false) -Done diff --git a/ext/standard/tests/strings/strtolower-win32.phpt b/ext/standard/tests/strings/strtolower-win32.phpt deleted file mode 100644 index af1290f1b1bcb..0000000000000 Binary files a/ext/standard/tests/strings/strtolower-win32.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strtolower.phpt b/ext/standard/tests/strings/strtolower.phpt deleted file mode 100644 index b22bc19a5261c..0000000000000 Binary files a/ext/standard/tests/strings/strtolower.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strtoupper.phpt b/ext/standard/tests/strings/strtoupper.phpt deleted file mode 100644 index 41bc5e6080643..0000000000000 --- a/ext/standard/tests/strings/strtoupper.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Test strtoupper on non-ASCII characters ---SKIPIF-- - ---FILE-- - ---EXPECT-- -ÄÖÜ diff --git a/ext/standard/tests/strings/strtoupper1-win32.phpt b/ext/standard/tests/strings/strtoupper1-win32.phpt deleted file mode 100644 index 283492d9dd35c..0000000000000 Binary files a/ext/standard/tests/strings/strtoupper1-win32.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strtoupper1.phpt b/ext/standard/tests/strings/strtoupper1.phpt deleted file mode 100644 index 9fb7e47f0ea0d..0000000000000 Binary files a/ext/standard/tests/strings/strtoupper1.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/strtr.phpt b/ext/standard/tests/strings/strtr.phpt deleted file mode 100644 index 80ed722b8e4c3..0000000000000 --- a/ext/standard/tests/strings/strtr.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -strtr() function ---FILE-- -"hi", "hi"=>"hello", "a"=>"A", "world"=>"planet"); -var_dump(strtr("# hi all, I said hello world! #", $trans)); -?> ---EXPECT-- -string(32) "# hello All, I sAid hi planet! #" \ No newline at end of file diff --git a/ext/standard/tests/strings/strtr_basic.phpt b/ext/standard/tests/strings/strtr_basic.phpt deleted file mode 100644 index 2892ab008231a..0000000000000 --- a/ext/standard/tests/strings/strtr_basic.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Test strtr() function : basic functionality ---FILE-- - "T", "e" => "E", "st" => "ST"); -$trans2_arr = array('t' => 'T', 'e' => 'E', 'st' => 'ST'); -$heredoc_str = << ---EXPECTF-- -*** Testing strtr() : basic functionality *** -string(10) "TesT sTrTr" -string(10) "TesT sTrTr" -string(10) "TesT sTrTr" -string(10) "TEST STrTr" -string(10) "TEST STrTr" -string(10) "TEST STrTr" -string(10) "TEST STrTr" -string(10) "TEST STrTr" -string(10) "TEST STrTr" -string(10) "TEST STrTr" -string(10) "TEST STrTr" -string(10) "TEST STrTr" -*** Done *** diff --git a/ext/standard/tests/strings/strtr_error.phpt b/ext/standard/tests/strings/strtr_error.phpt deleted file mode 100644 index 8466a92011bbc..0000000000000 --- a/ext/standard/tests/strings/strtr_error.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test strtr() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing strtr() : error conditions *** - --- Testing strtr() function with Zero arguments -- -Warning: Wrong parameter count for strtr() in %s on line %d -NULL - --- Testing strtr() function with less than expected no. of arguments -- -Warning: Wrong parameter count for strtr() in %s on line %d -NULL - --- Testing strtr() function with more than expected no. of arguments -- -Warning: Wrong parameter count for strtr() in %s on line %d -NULL -Done diff --git a/ext/standard/tests/strings/strtr_variation1.phpt b/ext/standard/tests/strings/strtr_variation1.phpt deleted file mode 100644 index 640194fd48e57..0000000000000 --- a/ext/standard/tests/strings/strtr_variation1.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -Test strtr() function : usage variations - regular & numeric strings for 'str' argument ---FILE-- - "a", "a" => 1, "2b3c" => "b2c3", "b2c3" => "3c2b"); - -/* loop through to test strtr() with each element of $str_arr */ -for($index = 0; $index < count($str_arr); $index++) { - echo "-- Iteration $count --\n"; - - $str = $str_arr[$index]; //getting the $str_arr element in $str variable - - //strtr() call in three args syntax form - var_dump( strtr($str, $from, $to) ); - - //strtr() call in two args syntax form - var_dump( strtr($str, $replace_pairs) ); - - $count++; -} -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strtr() : numeric & regular double quoted strings *** --- Iteration 1 -- -string(3) "abc" -string(3) "a23" --- Iteration 2 -- -string(3) "123" -string(3) "1bc" --- Iteration 3 -- -string(6) "a1b2c3" -string(6) "a1b2c3" --- Iteration 4 -- -string(3) "abc" -string(3) "a23" --- Iteration 5 -- -string(3) "123" -string(3) "1bc" --- Iteration 6 -- -string(6) "a1b2c3" -string(6) "a1b2c3" --- Iteration 7 -- -string(14) "abc -123 -a1b2c3" -string(14) "a23 -1bc -a1b2c3" -*** Done *** diff --git a/ext/standard/tests/strings/strtr_variation2.phpt b/ext/standard/tests/strings/strtr_variation2.phpt deleted file mode 100644 index 5772f01fc4ad1..0000000000000 --- a/ext/standard/tests/strings/strtr_variation2.phpt +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -Test strtr() function : usage variations - string containing special chars for 'str' argument ---FILE-- - "%", "%" => "$", "#*&@()" => "()@&*#"); - -/* loop through to test strtr() with each element of $str_arr */ -for($index = 0; $index < count($str_arr); $index++) { - echo "-- Iteration $count --\n"; - - $str = $str_arr[$index]; //getting the array element in 'str' variable - - //strtr() call in three args syntax form - var_dump( strtr($str, $from, $to) ); - - //strtr() call in two args syntax form - var_dump( strtr($str, $replace_pairs) ); - - $count++; -} -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strtr() : string containing special chars for 'str' arg *** --- Iteration 1 -- -string(1) "s" -string(1) "$" --- Iteration 2 -- -string(3) "pec" -string(3) "#%*" --- Iteration 3 -- -string(10) "text i als" -string(10) "text & @()" --- Iteration 4 -- -string(1) "s" -string(1) "$" --- Iteration 5 -- -string(3) "pec" -string(3) "#%*" --- Iteration 6 -- -string(10) "text i als" -string(10) "text & @()" --- Iteration 7 -- -string(17) "s -peci -text i als" -string(17) "$ -#%*& -text & @()" -*** Done *** diff --git a/ext/standard/tests/strings/strtr_variation3.phpt b/ext/standard/tests/strings/strtr_variation3.phpt deleted file mode 100644 index d52f8507b3d79..0000000000000 --- a/ext/standard/tests/strings/strtr_variation3.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -Test strtr() function : usage variations - string containing escape sequences for 'str' argument ---FILE-- - "t", "\r\n" => "T", "\n\r\t\\" => "TEST"); - -/* loop through to test strtr() with each element of $str_arr */ -for($index = 0; $index < count($str_arr); $index++) { - echo "-- Iteration $count --\n"; - - $str = $str_arr[$index]; //getting the array element in 'str' variable - - //strtr() call in three args syntax form - var_dump( strtr($str, $from, $to) ); - - //strtr() call in two args syntax form - var_dump( strtr($str, $replace_pairs) ); - - $count++; -} -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strtr() : string containing escape sequences for 'str' arg *** --- Iteration 1 -- -string(9) "SesSTsttE" -string(9) " es \stt -" --- Iteration 2 -- -string(12) "TtestTTstrtr" -string(12) "\test\\strtr" --- Iteration 3 -- -string(12) "TtestETstrtr" -string(11) "ttestTstrtr" --- Iteration 4 -- -string(9) "$variable" -string(9) "$variable" --- Iteration 5 -- -string(7) ""quotes" -string(7) ""quotes" --- Iteration 6 -- -string(12) "TtesTtTsttTr" -string(12) "\tes\t\stt\r" --- Iteration 7 -- -string(12) "TtestTTstrtr" -string(12) "\test\\strtr" --- Iteration 8 -- -string(15) "TntestTrTnstrtr" -string(15) "\ntest\r\nstrtr" --- Iteration 9 -- -string(10) "T$variable" -string(10) "\$variable" --- Iteration 10 -- -string(8) "T"quotes" -string(8) "\"quotes" --- Iteration 11 -- -string(54) "SesSTsttETTtestTTstrtrTTtestETstrtrT$variableTT"quotes" -string(52) " es \sttT\test\\strtrtttestTstrtrt$variablet\"quotes" -*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/strings/strtr_variation4.phpt b/ext/standard/tests/strings/strtr_variation4.phpt deleted file mode 100644 index faec849830c3e..0000000000000 --- a/ext/standard/tests/strings/strtr_variation4.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -Test strtr() function : usage variations - empty string & null for 'str' argument ---FILE-- - "t", '' => "TEST"); - - -/* loop through to test strtr() with each element of $str_arr */ -for($index = 0; $index < count($str_arr); $index++) { - echo "-- Iteration $count --\n"; - - $str = $str_arr[$index]; //getting the array element in 'str' variable - - //strtr() call in three args syntax form - var_dump( strtr($str, $from, $to) ); - - //strtr() call in two args syntax form - var_dump( strtr($str, $replace_pairs) ); - - $count++; -} -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strtr() : empty string & null for 'str' arg *** --- Iteration 1 -- -string(0) "" -string(0) "" --- Iteration 2 -- -string(0) "" -string(0) "" --- Iteration 3 -- -string(0) "" -string(0) "" --- Iteration 4 -- -string(0) "" -string(0) "" --- Iteration 5 -- -string(0) "" -string(0) "" --- Iteration 6 -- -string(0) "" -string(0) "" --- Iteration 7 -- -string(0) "" -string(0) "" -*** Done *** diff --git a/ext/standard/tests/strings/strtr_variation5.phpt b/ext/standard/tests/strings/strtr_variation5.phpt deleted file mode 100644 index 7bd1704734a1d..0000000000000 --- a/ext/standard/tests/strings/strtr_variation5.phpt +++ /dev/null @@ -1,137 +0,0 @@ ---TEST-- -Test strtr() function : usage variations - unexpected inputs for 'str' argument ---FILE-- - ---EXPECTF-- -*** Testing strtr() function: with unexpected inputs for 'str' *** --- Iteration 1 -- -string(1) "a" --- Iteration 2 -- -string(1) "t" --- Iteration 3 -- -string(2) "-m" --- Iteration 4 -- -string(4) "ta.5" --- Iteration 5 -- -string(5) "-ma.5" --- Iteration 6 -- -string(12) "ta5aaaaaaaaa" --- Iteration 7 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Arr0y" --- Iteration 8 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Arr0y" --- Iteration 9 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Arr0y" --- Iteration 10 -- -string(1) "t" --- Iteration 11 -- -string(0) "" --- Iteration 12 -- -string(1) "t" --- Iteration 13 -- -string(0) "" --- Iteration 14 -- -string(0) "" --- Iteration 15 -- -string(0) "" --- Iteration 16 -- -string(13) "s02ple objec1" --- Iteration 17 -- -string(%d) "Resource id #%d" --- Iteration 18 -- -string(0) "" --- Iteration 19 -- -string(0) "" -*** Done *** diff --git a/ext/standard/tests/strings/strtr_variation6.phpt b/ext/standard/tests/strings/strtr_variation6.phpt deleted file mode 100644 index 2d8ab7183137d..0000000000000 --- a/ext/standard/tests/strings/strtr_variation6.phpt +++ /dev/null @@ -1,137 +0,0 @@ ---TEST-- -Test strtr() function : usage variations - unexpected inputs for 'from' argument ---FILE-- - ---EXPECTF-- -*** Testing strtr() function: with unexpected inputs for 'from' *** --- Iteration 1 -- -string(6) "a12atm" --- Iteration 2 -- -string(6) "0a2atm" --- Iteration 3 -- -string(6) "01tatm" --- Iteration 4 -- -string(6) "ta2atm" --- Iteration 5 -- -string(6) "m1tatm" --- Iteration 6 -- -string(6) "2a2atm" --- Iteration 7 -- - -Notice: Array to string conversion in %s on line %d -string(6) "0120tm" --- Iteration 8 -- - -Notice: Array to string conversion in %s on line %d -string(6) "0120tm" --- Iteration 9 -- - -Notice: Array to string conversion in %s on line %d -string(6) "0120tm" --- Iteration 10 -- -string(6) "0a2atm" --- Iteration 11 -- -string(6) "012atm" --- Iteration 12 -- -string(6) "0a2atm" --- Iteration 13 -- -string(6) "012atm" --- Iteration 14 -- -string(6) "012atm" --- Iteration 15 -- -string(6) "012atm" --- Iteration 16 -- -string(6) "012ttm" --- Iteration 17 -- -string(6) "012atm" --- Iteration 18 -- -string(6) "012atm" --- Iteration 19 -- -string(6) "012atm" -*** Done *** diff --git a/ext/standard/tests/strings/strtr_variation7.phpt b/ext/standard/tests/strings/strtr_variation7.phpt deleted file mode 100644 index 04b742f31219e..0000000000000 --- a/ext/standard/tests/strings/strtr_variation7.phpt +++ /dev/null @@ -1,156 +0,0 @@ ---TEST-- -Test strtr() function : usage variations - unexpected inputs for 'to' argument ---FILE-- - ---EXPECTF-- -*** Testing strtr() function: with unexpected inputs for 'to' *** - --- Iteration 1 -- -string(6) "0120tm" - --- Iteration 2 -- -string(6) "0121tm" - --- Iteration 3 -- -string(6) "012-2m" - --- Iteration 4 -- -string(6) "51210." - --- Iteration 5 -- -string(6) ".52-20" - --- Iteration 6 -- -string(6) "000105" - --- Iteration 7 -- - -Notice: Array to string conversion in %s on line %d -string(6) "ay2Arr" - --- Iteration 8 -- - -Notice: Array to string conversion in %s on line %d -string(6) "ay2Arr" - --- Iteration 9 -- - -Notice: Array to string conversion in %s on line %d -string(6) "ay2Arr" - --- Iteration 10 -- -string(6) "0121tm" - --- Iteration 11 -- -string(6) "012atm" - --- Iteration 12 -- -string(6) "0121tm" - --- Iteration 13 -- -string(6) "012atm" - --- Iteration 14 -- -string(6) "012atm" - --- Iteration 15 -- -string(6) "012atm" - --- Iteration 16 -- -string(6) "plesam" - --- Iteration 17 -- -string(6) "ourRes" - --- Iteration 18 -- -string(6) "012atm" - --- Iteration 19 -- -string(6) "012atm" -*** Done *** diff --git a/ext/standard/tests/strings/strtr_variation8.phpt b/ext/standard/tests/strings/strtr_variation8.phpt deleted file mode 100644 index 4d2b42b02b46d..0000000000000 --- a/ext/standard/tests/strings/strtr_variation8.phpt +++ /dev/null @@ -1,179 +0,0 @@ ---TEST-- -Test strtr() function : usage variations - unexpected inputs for 'replace_pairs' argument ---FILE-- - ---EXPECTF-- -*** Testing strtr() function: with unexpected inputs for 'replace_pairs' *** - --- Iteration 1 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 2 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 3 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 4 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 5 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 6 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 7 -- -string(6) "012atm" - --- Iteration 8 -- -string(6) "012atm" - --- Iteration 9 -- -string(6) "122atm" - --- Iteration 10 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 11 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 12 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 13 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 14 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 15 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 16 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 17 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 18 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 19 -- - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strtr_variation9.phpt b/ext/standard/tests/strings/strtr_variation9.phpt deleted file mode 100644 index 0f5875c723ae0..0000000000000 --- a/ext/standard/tests/strings/strtr_variation9.phpt +++ /dev/null @@ -1,243 +0,0 @@ ---TEST-- -Test strtr() function : usage variations - unexpected inputs for all arguments ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // null vlaues - NULL, - null, - - // objects - new sample(), - - // resource - $file_handle, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop through with each element of the $values array to test strtr() function -$count = 1; -for($index = 0; $index < count($values); $index++) { - echo "\n-- Iteration $count --\n"; - var_dump( strtr($values[$index], $values[$index], $values[$index]) ); //fn call with three args - var_dump( strtr($values[$index], $values[$index]) ); //fn call with two args - $count ++; -} - -fclose($file_handle); //closing the file handle - -echo "*** Done ***"; -?> ---EXPECTF-- -*** Testing strtr() function: with unexpected inputs for all arguments *** - --- Iteration 1 -- -string(1) "0" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 2 -- -string(1) "1" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 3 -- -string(2) "-2" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 4 -- -string(4) "10.5" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 5 -- -string(5) "-20.5" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 6 -- -string(12) "105000000000" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 7 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - --- Iteration 8 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - --- Iteration 9 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - --- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - --- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - --- Iteration 12 -- -string(1) "1" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 13 -- -string(0) "" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 14 -- -string(1) "1" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 15 -- -string(0) "" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 16 -- -string(0) "" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 17 -- -string(0) "" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 18 -- -string(13) "sample object" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 19 -- -string(%d) "Resource id #%d" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 20 -- -string(0) "" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) - --- Iteration 21 -- -string(0) "" - -Warning: strtr(): The second argument is not an array in %s on line %d -bool(false) -*** Done *** diff --git a/ext/standard/tests/strings/strval.phpt b/ext/standard/tests/strings/strval.phpt deleted file mode 100644 index 3f8b5cc985d1b..0000000000000 --- a/ext/standard/tests/strings/strval.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -strval() function ---FILE-- - ---EXPECT-- -string(3) "bar" -string(3) "BAR" -string(6) "foobar" -string(1) "1" -string(3) "1.1" -string(1) "1" -string(0) "" -string(5) "Array" diff --git a/ext/standard/tests/strings/substr.phpt b/ext/standard/tests/strings/substr.phpt deleted file mode 100644 index b43244e4c8ebc..0000000000000 Binary files a/ext/standard/tests/strings/substr.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/substr_compare.phpt b/ext/standard/tests/strings/substr_compare.phpt deleted file mode 100644 index 66a82a87833af..0000000000000 --- a/ext/standard/tests/strings/substr_compare.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -substr_compare() ---FILE-- - ---EXPECTF-- -int(0) -int(0) -int(0) -int(1) -int(-1) - -Warning: substr_compare(): The length cannot exceed initial string length in %s on line %d -bool(false) - -Warning: substr_compare() expects parameter 5 to be boolean, object given in %s on line %d -bool(false) -Test - -Warning: substr_compare(): The length must be greater than zero in %s on line %d -bool(false) - -Warning: substr_compare() expects parameter 4 to be long, string given in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/strings/substr_count_basic.phpt b/ext/standard/tests/strings/substr_count_basic.phpt deleted file mode 100644 index f880e9481e796..0000000000000 --- a/ext/standard/tests/strings/substr_count_basic.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Test substr_count() function (basic) ---FILE-- - ---EXPECTF-- -***Testing basic operations *** -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(100) -int(200) -int(160) -int(10) -Done diff --git a/ext/standard/tests/strings/substr_count_error.phpt b/ext/standard/tests/strings/substr_count_error.phpt deleted file mode 100644 index f8284c3a1da9c..0000000000000 --- a/ext/standard/tests/strings/substr_count_error.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Test substr_count() function (error conditions) ---FILE-- - size of the string */ -var_dump(substr_count($str, "t", 25)); - -/* Using offset and length to go beyond the size of the string: - Warning message expected, as length+offset > length of string */ -var_dump( substr_count($str, "i", 5, 15) ); - -/* length as Null */ -var_dump( substr_count($str, "t", "", "") ); -var_dump( substr_count($str, "i", NULL, NULL) ); - -echo "Done\n"; - -?> ---EXPECTF-- -*** Testing error conditions *** - -Warning: Wrong parameter count for substr_count() in %s on line %d -NULL - -Notice: Undefined variable: str in %s on line %d - -Warning: Wrong parameter count for substr_count() in %s on line %d -NULL - -Notice: Undefined variable: str in %s on line %d - -Warning: substr_count(): Offset should be greater than or equal to 0 in %s on line %d -bool(false) - -Notice: Undefined variable: str in %s on line %d - -Warning: substr_count(): Offset value 25 exceeds string length in %s on line %d -bool(false) - -Notice: Undefined variable: str in %s on line %d - -Warning: substr_count(): Offset value 5 exceeds string length in %s on line %d -bool(false) - -Notice: Undefined variable: str in %s on line %d - -Warning: substr_count(): Length should be greater than 0 in %s on line %d -bool(false) - -Notice: Undefined variable: str in %s on line %d - -Warning: substr_count(): Length should be greater than 0 in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/strings/substr_count_variation_001.phpt b/ext/standard/tests/strings/substr_count_variation_001.phpt deleted file mode 100644 index cb6fc6bd3ede6..0000000000000 --- a/ext/standard/tests/strings/substr_count_variation_001.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -Test substr_count() function (variation - 1) ---FILE-- - ---EXPECTF-- -*** Testing possible variations *** --- 3rd or 4th arg as string -- -int(1) -int(1) -int(2) -int(2) - --- 3rd or 4th arg as NULL -- -int(2) -int(0) -int(2) -int(0) -int(2) - --- overlapped substrings -- -int(2) -int(2) - --- complex strings containing other than 7-bit chars -- -int(2) -int(2) -int(1) - --- heredoc string -- -int(14) -int(16) - --- heredoc null string -- -int(0) -int(0) -int(0) -Done diff --git a/ext/standard/tests/strings/substr_count_variation_002.phpt b/ext/standard/tests/strings/substr_count_variation_002.phpt deleted file mode 100644 index f8b62bd837cd2..0000000000000 --- a/ext/standard/tests/strings/substr_count_variation_002.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Test substr_count() function (variation - 2) ---FILE-- - ---EXPECTF-- -*** Testing possible variations *** - --- complex strings containing other than 7-bit chars -- -int(2) -int(2) -int(1) - --- heredoc string -- -int(14) -int(16) - --- heredoc null string -- -int(0) -int(0) -int(0) -Done diff --git a/ext/standard/tests/strings/substr_replace.phpt b/ext/standard/tests/strings/substr_replace.phpt deleted file mode 100644 index 27620de9644b1..0000000000000 --- a/ext/standard/tests/strings/substr_replace.phpt +++ /dev/null @@ -1,810 +0,0 @@ ---TEST-- -substr_replace() function ---FILE-- - ---EXPECT-- -substr_replace('try this', 'bala ', 2) -string(7) "trbala " - -substr_replace('try this', 'bala ', 2, 3) -string(10) "trbala his" - -substr_replace('try this', 'bala ', 2, 0) -string(13) "trbala y this" - -substr_replace('try this', 'bala ', 2, -2) -string(9) "trbala is" - - - -substr_replace('try this', array ( 0 => 'bala ',), 4 -string(9) "try bala " - -substr_replace('try this', array ( 0 => 'bala ',), 4 -string(10) "try bala s" - - - - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,) -array(1) { - [0]=> - string(9) "ala bala " -} - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => 3,)) -array(1) { - [0]=> - string(15) "ala bala tokala" -} - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => 0,)) -array(1) { - [0]=> - string(18) "ala bala portokala" -} - -substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => -2,)) -array(1) { - [0]=> - string(11) "ala bala la" -} - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',4) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(5) "try s" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(10) "try bala s" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(13) "try bala this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(6) "try is" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(11) "try bala is" -} - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4,)) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(5) " this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(10) "bala this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(13) "bala try this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(2) "is" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(7) "bala is" -} - - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,)) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(5) "trhis" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), 3) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(10) "trbala his" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), 0) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(13) "trbala y this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(4) "tris" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), -2) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(9) "trbala is" -} - - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,)) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 3,)) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(2) "tr" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 3,)) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(7) "trbala " -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 0,)) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(2) "tr" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 0,)) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(7) "trbala " -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => -2,)) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(2) "tr" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => -2,)) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(7) "trbala " -} - - - - - - - -substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,)) -array(1) { - [0]=> - string(9) "ala bala " -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 3, 1 => 2,)) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(6) "trthis" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 3, 1 => 2,)) -array(2) { - [0]=> - string(15) "ala bala tokala" - [1]=> - string(11) "trbala this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 0, 1 => 0,)) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(8) "try this" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 0, 1 => 0,)) -array(2) { - [0]=> - string(18) "ala bala portokala" - [1]=> - string(13) "trbala y this" -} - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => -2, 1 => -3,)) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(5) "trhis" -} - - -substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => -2, 1 => -3,)) -array(2) { - [0]=> - string(11) "ala bala la" - [1]=> - string(10) "trbala his" -} - diff --git a/ext/standard/tests/strings/trim.phpt b/ext/standard/tests/strings/trim.phpt deleted file mode 100644 index a69f17c6d7ad4..0000000000000 --- a/ext/standard/tests/strings/trim.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -trim(), rtrim() and ltrim() functions ---FILE-- - ---EXPECTF-- -*** Testing ucwords() : basic functionality *** --- Iteration 1 -- -string(15) "Testing Ucwords" --- Iteration 2 -- -string(15) "Testing Ucwords" --- Iteration 3 -- -string(16) "Testing\tucwords" --- Iteration 4 -- -string(15) "Testing Ucwords" --- Iteration 5 -- -string(15) "Testing -Ucwords" --- Iteration 6 -- -string(16) "Testing\nucwords" --- Iteration 7 -- -string(15) "Testing Ucwords" --- Iteration 8 -- -string(16) "Testing\vucwords" --- Iteration 9 -- -string(7) "Testing" --- Iteration 10 -- -string(7) "Testing" --- Iteration 11 -- -string(8) " Testing" --- Iteration 12 -- -string(8) " Testing" --- Iteration 13 -- -string(16) "Testing Ucwords" --- Iteration 14 -- -string(16) "Testing Ucwords" --- Iteration 15 -- -string(16) "Testing\rucwords" --- Iteration 16 -- -string(15) "Testing -Ucwords" --- Iteration 17 -- -string(16) "Testing\fucwords" --- Iteration 18 -- -string(15) "Testing Ucwords" -Done diff --git a/ext/standard/tests/strings/ucwords_error.phpt b/ext/standard/tests/strings/ucwords_error.phpt deleted file mode 100644 index cd6e7513c3d0f..0000000000000 --- a/ext/standard/tests/strings/ucwords_error.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Test ucwords() function : error conditions ---INI-- ---FILE-- - ---EXPECTF-- -*** Testing ucwords() : error conditions *** - --- Testing ucwords() function with Zero arguments -- - -Warning: Wrong parameter count for ucwords() in %s on line %d -NULL - --- Testing ucwords() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for ucwords() in %s on line %d -NULL -string(10) "string_val" -Done diff --git a/ext/standard/tests/strings/ucwords_variation1.phpt b/ext/standard/tests/strings/ucwords_variation1.phpt deleted file mode 100644 index b7d61ab5da0e3..0000000000000 --- a/ext/standard/tests/strings/ucwords_variation1.phpt +++ /dev/null @@ -1,199 +0,0 @@ ---TEST-- -Test ucwords() function : usage variations - unexpected input values ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new my(), - - // empty string - "", - '', - - //NULL - NULL, - null, - - // hex in string - "0x123", - '0x123', - "0xFF12", - "-0xFF12", - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var, - - // resource variable - $fp -); - -// loop through each element of the array and check the working of ucwords() -// when $str arugment is supplied with different values -echo "\n--- Testing ucwords() by supplying different values for 'str' argument ---\n"; -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $str = $values [$index]; - - var_dump( ucwords($str) ); - - $counter ++; -} - -// close the file handle -fclose($fp); -echo "Done\n"; -?> ---EXPECTF-- -*** Testing ucwords() : usage variations *** - ---- Testing ucwords() by supplying different values for 'str' argument --- --- Iteration 1 -- -string(1) "0" --- Iteration 2 -- -string(1) "1" --- Iteration 3 -- -string(5) "12345" --- Iteration 4 -- -string(5) "-2345" --- Iteration 5 -- -string(2) "16" --- Iteration 6 -- -string(2) "32" --- Iteration 7 -- -string(3) "170" --- Iteration 8 -- -string(4) "-245" --- Iteration 9 -- -string(2) "83" --- Iteration 10 -- -string(4) "-226" --- Iteration 11 -- -string(4) "10.5" --- Iteration 12 -- -string(5) "-10.5" --- Iteration 13 -- -string(12) "101234567000" --- Iteration 14 -- -string(13) "1.07654321E-9" --- Iteration 15 -- -string(3) "0.5" --- Iteration 16 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 17 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 18 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 19 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" --- Iteration 20 -- - -Notice: Array to string conversion in %s on line 101 -string(5) "Array" --- Iteration 21 -- -string(1) "1" --- Iteration 22 -- -string(0) "" --- Iteration 23 -- -string(1) "1" --- Iteration 24 -- -string(0) "" --- Iteration 25 -- -string(8) "MyString" --- Iteration 26 -- -string(0) "" --- Iteration 27 -- -string(0) "" --- Iteration 28 -- -string(0) "" --- Iteration 29 -- -string(0) "" --- Iteration 30 -- -string(5) "0x123" --- Iteration 31 -- -string(5) "0x123" --- Iteration 32 -- -string(6) "0xFF12" --- Iteration 33 -- -string(7) "-0xFF12" --- Iteration 34 -- -string(0) "" --- Iteration 35 -- -string(0) "" --- Iteration 36 -- -string(%d) "Resource Id #%d" -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/ucwords_variation2.phpt b/ext/standard/tests/strings/ucwords_variation2.phpt deleted file mode 100644 index a6d743f9af444..0000000000000 --- a/ext/standard/tests/strings/ucwords_variation2.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -Test ucwords() function : usage variations - heredoc strings ---FILE-- - ---EXPECTF-- -*** Testing ucwords() : usage variations *** --- Iteration 1 -- -string(0) "" --- Iteration 2 -- -string(0) "" --- Iteration 3 -- -string(52) "Testing Ucword() With -Multiline String Using -Heredoc" --- Iteration 4 -- -string(93) "Testing -Ucword(str) With -Multiline String Using -Heredoc -String.with Different White Spaces" --- Iteration 5 -- -string(53) "12sting 123string 4567 -String 123string -12 Test -5test" --- Iteration 6 -- -string(108) "It's Bright,but I Cann't See It. -"things In Double Quote" -'things In Single Quote' -This\line Is /with\slashs" -Done diff --git a/ext/standard/tests/strings/ucwords_variation3.phpt b/ext/standard/tests/strings/ucwords_variation3.phpt deleted file mode 100644 index e6f7c405ace47..0000000000000 --- a/ext/standard/tests/strings/ucwords_variation3.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -Test ucwords() function : usage variations - single quoted string ---FILE-- - ---EXPECTF-- -*** Testing ucwords() : usage variations *** --- Iteration 1 -- -string(18) "Testing Ucwords" --- Iteration 2 -- -string(30) "T E S T I N G U C W O R D S " --- Iteration 3 -- -string(25) "Testing Function(ucwords)" --- Iteration 4 -- -string(38) "(testing ( Function (ucwords) )a )test" --- Iteration 5 -- -string(3) "(t)" --- Iteration 6 -- -string(7) " ( T )t" --- Iteration 7 -- -string(23) ""testing",ucword,"test"" --- Iteration 8 -- -string(14) ""t""t",test, T" --- Iteration 9 -- -string(11) "'t 't',test" --- Iteration 10 -- -string(27) "\ttesting\ttesting\tucwords" --- Iteration 11 -- -string(32) "Testing\rucwords Testing Ucwords" --- Iteration 12 -- -string(37) "Testing\fucwords \f Testing \nucwords" --- Iteration 13 -- -string(39) "\ntesting\nucwords\n Testing \n Ucwords" --- Iteration 14 -- -string(20) "Using\vvertical\vtab" --- Iteration 15 -- -string(42) "T@@#$% %test ^test &test *test +test -test" --- Iteration 16 -- -string(40) "!test ~test `test` =test= @test@test.com" --- Iteration 17 -- -string(40) "/test/r\test\ucwords\t\y\y\u\3 \yy\ /uu/" --- Iteration 18 -- -string(16) "!@#$%^&*()_+=-`~" -Done diff --git a/ext/standard/tests/strings/ucwords_variation4.phpt b/ext/standard/tests/strings/ucwords_variation4.phpt deleted file mode 100644 index 28be9ec0bb734..0000000000000 --- a/ext/standard/tests/strings/ucwords_variation4.phpt +++ /dev/null @@ -1,125 +0,0 @@ ---TEST-- -Test ucwords() function : usage variations - double quoted string ---FILE-- - ---EXPECTF-- -*** Testing ucwords() : usage variations *** --- Iteration 1 -- -string(18) "Testing Ucwords" --- Iteration 2 -- -string(30) "T E S T I N G U C W O R D S " --- Iteration 3 -- -string(25) "Testing Function(ucwords)" --- Iteration 4 -- -string(38) "(testing ( Function (ucwords) )a )test" --- Iteration 5 -- -string(3) "(t)" --- Iteration 6 -- -string(7) " ( T )t" --- Iteration 7 -- -string(24) ""testing",ucwords,"test"" --- Iteration 8 -- -string(14) ""t""t",test, T" --- Iteration 9 -- -string(14) "\'t \'t\',test" --- Iteration 10 -- -string(10) "Jack's Pen" --- Iteration 11 -- -string(14) "P't'y 't It's " --- Iteration 12 -- -string(24) " Testing Testing Ucwords" --- Iteration 13 -- -string(26) "\ttesting\ttesting Ucwords" --- Iteration 14 -- -string(31) "Testing -Ucwords Testing Ucwords" --- Iteration 15 -- -string(32) "Testing\rucwords Testing Ucwords" --- Iteration 16 -- -string(34) "Testing Ucwords Testing -Ucwords" --- Iteration 17 -- -string(36) "Testing\fucwords \f Testing -Ucwords" --- Iteration 18 -- -string(35) " -Testing -Ucwords - Testing - Ucwords" --- Iteration 19 -- -string(39) "\ntesting\nucwords\n Testing \n Ucwords" --- Iteration 20 -- -string(18) "Using Vertical Tab" --- Iteration 21 -- -string(20) "Using\vvertical\vtab" --- Iteration 22 -- -string(42) "T@@#$% %test ^test &test *test +test -test" --- Iteration 23 -- -string(40) "!test ~test `test` =test= @test@test.com" --- Iteration 24 -- -string(37) "/test/r Est\ucwords \y\y\u \yy\ /uu/" --- Iteration 25 -- -string(16) "!@#$%^&*()_+=-`~" -Done diff --git a/ext/standard/tests/strings/unpack.phpt b/ext/standard/tests/strings/unpack.phpt deleted file mode 100644 index 26f3f2eaf974d..0000000000000 --- a/ext/standard/tests/strings/unpack.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Invalid format type validation ---FILE-- - ---EXPECTF-- -Warning: unpack(): Invalid format type - in %sunpack.php on line %d -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt deleted file mode 100644 index e0e54110364ef..0000000000000 --- a/ext/standard/tests/strings/url_t.phpt +++ /dev/null @@ -1,712 +0,0 @@ ---TEST-- -parse_url() function ---FILE-- - ---EXPECT-- -array(1) { - ["path"]=> - string(0) "" -} -array(1) { - ["path"]=> - string(12) "64.246.30.37" -} -array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(12) "64.246.30.37" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(12) "64.246.30.37" - ["path"]=> - string(1) "/" -} -array(1) { - ["path"]=> - string(13) "64.246.30.37/" -} -array(3) { - ["host"]=> - string(12) "64.246.30.37" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(1) { - ["path"]=> - string(7) "php.net" -} -array(1) { - ["path"]=> - string(8) "php.net/" -} -array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "php.net" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "php.net" - ["path"]=> - string(1) "/" -} -array(1) { - ["path"]=> - string(11) "www.php.net" -} -array(1) { - ["path"]=> - string(12) "www.php.net/" -} -array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(1) "/" -} -array(2) { - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(10) "/index.php" -} -array(1) { - ["path"]=> - string(12) "www.php.net/" -} -array(3) { - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(1) "/" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(18) "/foo/bar/index.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(53) "/this/is/a/very/deep/directory/structure/and/file.php" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(53) "/this/is/a/very/deep/directory/structure/and/file.php" - ["query"]=> - string(37) "lots=1&of=2¶meters=3&too=4&here=5" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(45) "/this/is/a/very/deep/directory/structure/and/" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(53) "/this/is/a/very/deep/directory/structure/and/file.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(28) "/this/../a/../deep/directory" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(29) "/this/../a/../deep/directory/" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(42) "/this/is/a/very/deep/directory/../file.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" - ["fragment"]=> - string(3) "foo" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" - ["query"]=> - string(6) "test=1" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(1) "/" - ["query"]=> - string(7) "test=1&" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" - ["query"]=> - string(1) "&" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(7) "test=1&" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(1) "&" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(4) "foo&" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(4) "&foo" -} -array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" -} -array(5) { - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(6) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["user"]=> - string(6) "secret" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(14) "secret@hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(8) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hid:out" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} -array(2) { - ["scheme"]=> - string(4) "nntp" - ["host"]=> - string(12) "news.php.net" -} -array(3) { - ["scheme"]=> - string(3) "ftp" - ["host"]=> - string(11) "ftp.gnu.org" - ["path"]=> - string(22) "/gnu/glic/glibc.tar.gz" -} -array(2) { - ["scheme"]=> - string(4) "zlib" - ["path"]=> - string(14) "http://foo@bar" -} -array(2) { - ["scheme"]=> - string(4) "zlib" - ["path"]=> - string(12) "filename.txt" -} -array(2) { - ["scheme"]=> - string(4) "zlib" - ["path"]=> - string(25) "/path/to/my/file/file.txt" -} -array(3) { - ["scheme"]=> - string(3) "foo" - ["host"]=> - string(3) "bar" - ["user"]=> - string(3) "foo" -} -array(2) { - ["scheme"]=> - string(6) "mailto" - ["path"]=> - string(15) "me@mydomain.com" -} -array(2) { - ["path"]=> - string(8) "/foo.php" - ["query"]=> - string(7) "a=b&c=d" -} -array(2) { - ["path"]=> - string(7) "foo.php" - ["query"]=> - string(7) "a=b&c=d" -} -array(6) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(15) "www.example.com" - ["port"]=> - int(8080) - ["user"]=> - string(4) "user" - ["pass"]=> - string(6) "passwd" - ["query"]=> - string(12) "bar=1&boom=0" -} -array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(13) "/path/to/file" -} -array(3) { - ["scheme"]=> - string(4) "file" - ["host"]=> - string(4) "path" - ["path"]=> - string(8) "/to/file" -} -array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(13) "/path/to/file" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "1.2.3.4" - ["path"]=> - string(8) "/abc.asp" - ["query"]=> - string(7) "a=1&b=2" -} -array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "foo.com" - ["fragment"]=> - string(3) "bar" -} -array(1) { - ["scheme"]=> - string(6) "scheme" -} -array(4) { - ["scheme"]=> - string(7) "foo+bar" - ["host"]=> - string(4) "bang" - ["user"]=> - string(3) "baz" - ["path"]=> - string(4) "/bla" -} -array(2) { - ["scheme"]=> - string(2) "gg" - ["path"]=> - string(7) "9130731" -} -array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(4) "host" - ["user"]=> - string(4) "user" - ["pass"]=> - string(5) "@pass" - ["path"]=> - string(5) "/path" - ["query"]=> - string(14) "argument?value" - ["fragment"]=> - string(3) "etc" -} -string(4) "http" -string(11) "www.php.net" -int(80) -string(6) "secret" -string(7) "hideout" -string(10) "/index.php" -string(31) "test=1&test2=char&test3=mixesCI" -string(16) "some_page_ref123" diff --git a/ext/standard/tests/strings/uuencode.phpt b/ext/standard/tests/strings/uuencode.phpt deleted file mode 100644 index 3671cd736ce88..0000000000000 --- a/ext/standard/tests/strings/uuencode.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -uuencode family tests ---FILE-- - ---EXPECTF-- -Warning: convert_uuencode() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: convert_uudecode() expects parameter 1 to be string, array given in %s on line %d -bool(false) -bool(false) -bool(false) -string(60) "J?B%`(R0E7B8J*"E??7M03TE5651215=145-$1D=(2DM,.CQ-3D)60UA: -` -" -string(1) "%s" -string(42) "~!@#$%^&*()_}{POIUYTREWQQSDFGHJKL: ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using string format *** -string(3) "one" -string(7) "one two" -string(13) "one two three" -Done diff --git a/ext/standard/tests/strings/vsprintf_basic2.phpt b/ext/standard/tests/strings/vsprintf_basic2.phpt deleted file mode 100644 index 3e78aab7617bf..0000000000000 --- a/ext/standard/tests/strings/vsprintf_basic2.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test vsprintf() function : basic functionality - integer format ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using integer format *** -string(3) "111" -string(7) "111 222" -string(11) "111 222 333" -Done diff --git a/ext/standard/tests/strings/vsprintf_basic3.phpt b/ext/standard/tests/strings/vsprintf_basic3.phpt deleted file mode 100644 index bbb6a3267cf31..0000000000000 --- a/ext/standard/tests/strings/vsprintf_basic3.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test vsprintf() function : basic functionality - float format ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using float format *** -string(9) "11.110000" -string(9) "11.110000" -string(19) "11.110000 22.220000" -string(19) "11.110000 22.220000" -string(29) "11.110000 22.220000 33.330000" -string(29) "11.110000 22.220000 33.330000" -Done diff --git a/ext/standard/tests/strings/vsprintf_basic4.phpt b/ext/standard/tests/strings/vsprintf_basic4.phpt deleted file mode 100644 index a82df93ad358a..0000000000000 --- a/ext/standard/tests/strings/vsprintf_basic4.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test vsprintf() function : basic functionality - bool format ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using bool format *** -string(1) "1" -string(3) "1 0" -string(5) "1 0 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_basic5.phpt b/ext/standard/tests/strings/vsprintf_basic5.phpt deleted file mode 100644 index a4a43d0521270..0000000000000 --- a/ext/standard/tests/strings/vsprintf_basic5.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test vsprintf() function : basic functionality - char format ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using char format *** -string(1) "A" -string(3) "A B" -string(5) "A B C" -Done diff --git a/ext/standard/tests/strings/vsprintf_basic6.phpt b/ext/standard/tests/strings/vsprintf_basic6.phpt deleted file mode 100644 index f6f6ed58a42dd..0000000000000 --- a/ext/standard/tests/strings/vsprintf_basic6.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test vsprintf() function : basic functionality - exponential format ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using exponential format *** -string(11) "1.000000e+3" -string(23) "1.000000e+3 2.000000e+3" -string(35) "1.000000e+3 2.000000e+3 3.000000e+3" -Done diff --git a/ext/standard/tests/strings/vsprintf_basic7.phpt b/ext/standard/tests/strings/vsprintf_basic7.phpt deleted file mode 100644 index daf514391bce5..0000000000000 --- a/ext/standard/tests/strings/vsprintf_basic7.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test vsprintf() function : basic functionality - unsigned format ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using unsigned format *** -string(10) "4294966185" -string(21) "4294966185 4293732729" -string(32) "4294966185 4293732729 4292621864" -Done diff --git a/ext/standard/tests/strings/vsprintf_basic7_64bit.phpt b/ext/standard/tests/strings/vsprintf_basic7_64bit.phpt deleted file mode 100644 index 022919ec73f2d..0000000000000 --- a/ext/standard/tests/strings/vsprintf_basic7_64bit.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test vsprintf() function : basic functionality - unsigned format ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using unsigned format *** -string(20) "18446744073709550505" -string(41) "18446744073709550505 18446744073708317049" -string(62) "18446744073709550505 18446744073708317049 18446744073707206184" -Done diff --git a/ext/standard/tests/strings/vsprintf_basic8.phpt b/ext/standard/tests/strings/vsprintf_basic8.phpt deleted file mode 100644 index 59f17b65071e7..0000000000000 --- a/ext/standard/tests/strings/vsprintf_basic8.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test vsprintf() function : basic functionality - octal format ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using octal format *** -string(2) "21" -string(6) "21 347" -string(10) "21 347 567" -Done diff --git a/ext/standard/tests/strings/vsprintf_basic9.phpt b/ext/standard/tests/strings/vsprintf_basic9.phpt deleted file mode 100644 index 42012a5c8f3fe..0000000000000 --- a/ext/standard/tests/strings/vsprintf_basic9.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test vsprintf() function : basic functionality - hexadecimal format ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : basic functionality - using hexadecimal format *** -string(1) "b" -string(1) "B" -string(4) "b 84" -string(4) "B 84" -string(7) "b 84 b1" -string(7) "B 84 B1" -Done diff --git a/ext/standard/tests/strings/vsprintf_error.phpt b/ext/standard/tests/strings/vsprintf_error.phpt deleted file mode 100644 index 0ece4a420f0a4..0000000000000 --- a/ext/standard/tests/strings/vsprintf_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test vsprintf() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : error conditions *** - --- Testing vsprintf() function with Zero arguments -- - -Warning: Wrong parameter count for vsprintf() in %s on line %d -bool(false) - --- Testing vsprintf() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for vsprintf() in %s on line %d -bool(false) - --- testing vsprintf() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for vsprintf() in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/strings/vsprintf_variation1.phpt b/ext/standard/tests/strings/vsprintf_variation1.phpt deleted file mode 100644 index 3911587620fe7..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation1.phpt +++ /dev/null @@ -1,191 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - unexpected values for the format argument ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new sample(), - - // undefined data - @$undefined_var, - - // unset data - @$unset_var, - - // resource data - $file_handle -); - -// loop through each element of the array for format - -$counter = 1; -foreach($values as $value) { - echo "\n -- Iteration $counter --\n"; - var_dump( vsprintf($value,$args) ); - $counter++; - -}; - -// closing the resource -fclose($file_handle); - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : with unexpected values for format argument *** - - -- Iteration 1 -- -string(1) "0" - - -- Iteration 2 -- -string(1) "1" - - -- Iteration 3 -- -string(5) "12345" - - -- Iteration 4 -- -string(5) "-2345" - - -- Iteration 5 -- -string(4) "10.5" - - -- Iteration 6 -- -string(5) "-10.5" - - -- Iteration 7 -- -string(12) "101234567000" - - -- Iteration 8 -- -string(13) "1.07654321E-9" - - -- Iteration 9 -- -string(3) "0.5" - - -- Iteration 10 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - - -- Iteration 11 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - - -- Iteration 12 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - - -- Iteration 13 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - - -- Iteration 14 -- - -Notice: Array to string conversion in %s on line %d -string(5) "Array" - - -- Iteration 15 -- -string(0) "" - - -- Iteration 16 -- -string(0) "" - - -- Iteration 17 -- -string(1) "1" - - -- Iteration 18 -- -string(0) "" - - -- Iteration 19 -- -string(1) "1" - - -- Iteration 20 -- -string(0) "" - - -- Iteration 21 -- -string(0) "" - - -- Iteration 22 -- -string(0) "" - - -- Iteration 23 -- -string(6) "object" - - -- Iteration 24 -- -string(0) "" - - -- Iteration 25 -- -string(0) "" - - -- Iteration 26 -- -string(%d) "Resource id #%d" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation10.phpt b/ext/standard/tests/strings/vsprintf_variation10.phpt deleted file mode 100644 index 42ba2679f18ab..0000000000000 Binary files a/ext/standard/tests/strings/vsprintf_variation10.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/vsprintf_variation11.phpt b/ext/standard/tests/strings/vsprintf_variation11.phpt deleted file mode 100644 index e7fe663c4e8c4..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation11.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - octal formats with octal values ---SKIPIF-- - ---FILE-- - - ---EXPECTF-- -*** Testing vsprintf() : octal formats with octal values *** - --- Iteration 1 -- -string(1) "0" - --- Iteration 2 -- -string(14) "37777777777 1 " - --- Iteration 3 -- -string(38) "20000000000 o, 17777777777 20000000001" - --- Iteration 4 -- -string(38) " 37776543211 0000" - --- Iteration 5 -- -string(32) "111 2222 37777444445 37733333334" - --- Iteration 6 -- -string(17) "11073 7653 123 12" - --- Iteration 7 -- -string(6) "% %o o" - --- Iteration 8 -- -string(7) "1 2 3 4" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation11_64bit.phpt b/ext/standard/tests/strings/vsprintf_variation11_64bit.phpt deleted file mode 100644 index 61327c84bab3d..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation11_64bit.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - octal formats with octal values ---SKIPIF-- - ---FILE-- - - ---EXPECTF-- -*** Testing vsprintf() : octal formats with octal values *** - --- Iteration 1 -- -string(1) "0" - --- Iteration 2 -- -string(25) "1777777777777777777777 1 " - --- Iteration 3 -- -string(60) "1777777777760000000000 o, 17777777777 1777777777760000000001" - --- Iteration 4 -- -string(49) " 1777777777777776543211 0000" - --- Iteration 5 -- -string(54) "111 2222 1777777777777777444445 1777777777777733333334" - --- Iteration 6 -- -string(17) "11073 7653 123 12" - --- Iteration 7 -- -string(6) "% %o o" - --- Iteration 8 -- -string(7) "1 2 3 4" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation12.phpt b/ext/standard/tests/strings/vsprintf_variation12.phpt deleted file mode 100644 index ab67cc82f9d38..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation12.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - octal formats with non-octal values ---SKIPIF-- - ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, false, TRUE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different octal formats from the above $format array -// and with non-octal values from the above $args_array array -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : octal formats and non-octal values *** - --- Iteration 1 -- -string(116) "2 0 12 - 361100 o 37777775456 2322 - - 30071 14 37777777764 37777416700 - 12 361100 2 0" - --- Iteration 2 -- -string(146) "2 37777777776 2 - 361100 o 37720715133 57062645 - - 57060664 4475347 37721631371 37720717336 - 2 361100 2 37777777776" - --- Iteration 3 -- -string(88) "0 0 0 - 173 o 37777777605 173 - - 2322 0 $0 _0 - 0 173 0 0" - --- Iteration 4 -- -string(75) "1 1 1 - 1 o 1 1 - - #1 1 $1 _1 - 1 1 1 1" - --- Iteration 5 -- -string(75) "1 1 0 - 1 o 0 1 - - #0 1 $1 _0 - 0 1 1 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation12_64bit.phpt b/ext/standard/tests/strings/vsprintf_variation12_64bit.phpt deleted file mode 100644 index 530f05b13f35c..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation12_64bit.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - octal formats with non-octal values ---SKIPIF-- - ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, false, TRUE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different octal formats from the above $format array -// and with non-octal values from the above $args_array array -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : octal formats and non-octal values *** - --- Iteration 1 -- -string(149) "2 0 12 - 361100 o 1777777777777777775456 2322 - - 30071 14 1777777777777777777764 1777777777777777416700 - 12 361100 2 0" - --- Iteration 2 -- -string(201) "2 1777777777777777777776 2 - 361100 o 1777777777777720715133 57062645 - - 57060664 4475347 1777777777777721631371 1777777777777720717336 - 2 361100 2 1777777777777777777776" - --- Iteration 3 -- -string(99) "0 0 0 - 173 o 1777777777777777777605 173 - - 2322 0 $0 _0 - 0 173 0 0" - --- Iteration 4 -- -string(75) "1 1 1 - 1 o 1 1 - - #1 1 $1 _1 - 1 1 1 1" - --- Iteration 5 -- -string(75) "1 1 0 - 1 o 0 1 - - #0 1 $1 _0 - 0 1 1 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation13.phpt b/ext/standard/tests/strings/vsprintf_variation13.phpt deleted file mode 100644 index 3e89fa3508779..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation13.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - hexa formats with hexa values ---SKIPIF-- - ---FILE-- - - ---EXPECTF-- -*** Testing vsprintf() : hexa formats with hexa values *** - --- Iteration 1 -- -string(1) "0" - --- Iteration 2 -- -string(13) "ffffffff 1 22" - --- Iteration 3 -- -string(28) "7fffffff x, 7000000 80000000" - --- Iteration 4 -- -string(35) " ffed2979 0000" - --- Iteration 5 -- -string(22) "#1 2222 1b6db bbbbbbbc" - --- Iteration 6 -- -string(12) "123b fab 0 a" - --- Iteration 7 -- -string(5) "%34 x" - --- Iteration 8 -- -string(7) "1 2 3 4" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation13_64bit.phpt b/ext/standard/tests/strings/vsprintf_variation13_64bit.phpt deleted file mode 100644 index 749a4a858fb93..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation13_64bit.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - hexa formats with hexa values ---SKIPIF-- - ---FILE-- - - ---EXPECTF-- -*** Testing vsprintf() : hexa formats with hexa values *** - --- Iteration 1 -- -string(1) "0" - --- Iteration 2 -- -string(21) "ffffffffffffffff 1 22" - --- Iteration 3 -- -string(36) "7fffffff x, 7000000 ffffffff80000000" - --- Iteration 4 -- -string(43) " ffffffffffed2979 0000" - --- Iteration 5 -- -string(30) "#1 2222 1b6db ffffffffbbbbbbbc" - --- Iteration 6 -- -string(12) "123b fab 0 a" - --- Iteration 7 -- -string(5) "%34 x" - --- Iteration 8 -- -string(7) "1 2 3 4" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation14.phpt b/ext/standard/tests/strings/vsprintf_variation14.phpt deleted file mode 100644 index bfe816ee1f910..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation14.phpt +++ /dev/null @@ -1,119 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - hexa formats with non-hexa values ---SKIPIF-- - ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, TRUE, FALSE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different hexa formats from the above $format array -// and with non-hexa values from the above $args_array array - -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : hexa formats and non-hexa values *** - --- Iteration 1 -- -string(101) "2 0 a - 1e240 x fffffb2e 4d2 - - 3039 c fffffff4 fffe1dc0 - a 1e240 2 0" - --- Iteration 2 -- -string(124) "2 fffffffe 2 - 1e240 x ff439a5b bc65a5 - - bc61b4 127ae7 ff4732f9 ff439ede - 2 1e240 2 fffffffe" - --- Iteration 3 -- -string(82) "0 0 0 - 7b x ffffff85 7b - - 4d2 0 $0 _0 - 0 7b 0 0" - --- Iteration 4 -- -string(75) "1 1 1 - 1 x 1 1 - - #1 1 $1 _1 - 1 1 1 1" - --- Iteration 5 -- -string(75) "1 1 0 - 1 x 0 1 - - #0 1 $1 _0 - 0 1 1 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation14_64bit.phpt b/ext/standard/tests/strings/vsprintf_variation14_64bit.phpt deleted file mode 100644 index f1940ef2ee03a..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation14_64bit.phpt +++ /dev/null @@ -1,119 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - hexa formats with non-hexa values ---SKIPIF-- - ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, TRUE, FALSE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different hexa formats from the above $format array -// and with non-hexa values from the above $args_array array - -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : hexa formats and non-hexa values *** - --- Iteration 1 -- -string(125) "2 0 a - 1e240 x fffffffffffffb2e 4d2 - - 3039 c fffffffffffffff4 fffffffffffe1dc0 - a 1e240 2 0" - --- Iteration 2 -- -string(164) "2 fffffffffffffffe 2 - 1e240 x ffffffffff439a5b bc65a5 - - bc61b4 127ae7 ffffffffff4732f9 ffffffffff439ede - 2 1e240 2 fffffffffffffffe" - --- Iteration 3 -- -string(90) "0 0 0 - 7b x ffffffffffffff85 7b - - 4d2 0 $0 _0 - 0 7b 0 0" - --- Iteration 4 -- -string(75) "1 1 1 - 1 x 1 1 - - #1 1 $1 _1 - 1 1 1 1" - --- Iteration 5 -- -string(75) "1 1 0 - 1 x 0 1 - - #0 1 $1 _0 - 0 1 1 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation15.phpt b/ext/standard/tests/strings/vsprintf_variation15.phpt deleted file mode 100644 index cedfe3f0efe1d..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation15.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - unsigned formats with unsigned values ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : unsigned formats and unsigned values *** - --- Iteration 1 -- -string(16) "1234567 342391 0" - --- Iteration 2 -- -string(23) "3755744308 u 1234 12345" - --- Iteration 3 -- -string(25) " 1234000 0 120" - --- Iteration 4 -- -string(10) "#1 0 $0 10" - --- Iteration 5 -- -string(7) "1 2 3 4" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation15_64bit.phpt b/ext/standard/tests/strings/vsprintf_variation15_64bit.phpt deleted file mode 100644 index 3af1738e564d8..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation15_64bit.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - unsigned formats with unsigned values ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : unsigned formats and unsigned values *** - --- Iteration 1 -- -string(16) "1234567 342391 0" - --- Iteration 2 -- -string(24) "12345678900 u 1234 12345" - --- Iteration 3 -- -string(25) " 1234000 0 120" - --- Iteration 4 -- -string(10) "#1 0 $0 10" - --- Iteration 5 -- -string(7) "1 2 3 4" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation16.phpt b/ext/standard/tests/strings/vsprintf_variation16.phpt deleted file mode 100644 index 01bcc662d504f..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation16.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - unsigned formats with signed and other types of values ---SKIPIF-- - ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, TRUE, FALSE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different unsigned formats from the above $format array -// and with signed and other types of values from the above $args_array array -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : unsigned formats and signed & other types of values *** - --- Iteration 1 -- -string(115) "2 0 10 - 123456 u 1234 2820130816 - 2840207360 1177509888 12345 - 12 4294967284 4294843840 _3 - 10 123456 2 0" - --- Iteration 2 -- -string(88) "0 0 0 - 123 u 4294967173 123 - 0 0 0 - 1234 0 $0 _0 - 0 123 0 0" - --- Iteration 3 -- -string(76) "1 1 1 - 1 u 1 1 - 1 1 1 - #1 1 $1 _1 - 1 1 1 1" - --- Iteration 4 -- -string(76) "1 1 0 - 1 u 0 1 - 1 1 0 - #0 1 $1 _0 - 0 1 1 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation16_64bit.phpt b/ext/standard/tests/strings/vsprintf_variation16_64bit.phpt deleted file mode 100644 index 91a69c7e70f91..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation16_64bit.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - unsigned formats with signed and other types of values ---SKIPIF-- - ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, TRUE, FALSE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different unsigned formats from the above $format array -// and with signed and other types of values from the above $args_array array -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : unsigned formats and signed & other types of values *** - --- Iteration 1 -- -string(143) "2 0 10 - 123456 u 1234 20000000000 - 2000000000000 22000000000000 12345 - 12 18446744073709551604 18446744073709428160 _3 - 10 123456 2 0" - --- Iteration 2 -- -string(98) "0 0 0 - 123 u 18446744073709551493 123 - 0 0 0 - 1234 0 $0 _0 - 0 123 0 0" - --- Iteration 3 -- -string(76) "1 1 1 - 1 u 1 1 - 1 1 1 - #1 1 $1 _1 - 1 1 1 1" - --- Iteration 4 -- -string(76) "1 1 0 - 1 u 0 1 - 1 1 0 - #0 1 $1 _0 - 0 1 1 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation17.phpt b/ext/standard/tests/strings/vsprintf_variation17.phpt deleted file mode 100644 index 88cacdd49a5dc..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation17.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - scientific formats with scientific values ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : scientific formats and scientific values *** - --- Iteration 1 -- -string(36) "0.000000e+0 +1.000000e+0 1.000000e+3" - --- Iteration 2 -- -string(38) "2.200000e+2 e 1.000000e+1 1.000000e+10" - --- Iteration 3 -- -string(32) "-2.2000e+13 1.0000e+21 1.2000e+2" - --- Iteration 4 -- -string(74) "#########1.000000e+1 1.000000e+2 $$$$$$$$-1.000000e+3 _________1.000000e+2" - --- Iteration 5 -- -string(47) "1.000000e+3 2.000000e+3 3.000000e+3 4.000000e+3" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation18.phpt b/ext/standard/tests/strings/vsprintf_variation18.phpt deleted file mode 100644 index 3d1aeba33548d..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation18.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - scientific formats with non-scientific values ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, false, TRUE, FALSE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different scientific formats from the above $format array -// and with non-scientific values from the above $args_array array -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : scientific formats and non-scientific values *** - --- Iteration 1 -- -string(232) "2.200000e+0 +2.000000e-1 1.020000e+1 - 1.234562e+5 e -1.234679e+3 1.234679e+3 - 2.0000e+1 2.1220e+2 -4.110000e+11 2.2120e+3 - 1.234578e+4 1.200000e+1 -1.200000e+1 -1.234562e+5 - 1.020000e+1 1.234562e+5 2.200000e+0 2.000000e-1" - --- Iteration 2 -- -string(228) "0.000000e+0 +0.000000e+0 0.000000e+0 - 1.230000e+2 e -1.230000e+2 1.230000e+2 - 0.0000e+0 0.0000e+0 1.234560e+5 0.0000e+0 - 1.234000e+3 0.000000e+0 0.000000e+0 0.000000e+0 - 0.000000e+0 1.230000e+2 0.000000e+0 0.000000e+0" - --- Iteration 3 -- -string(227) "1.000000e+0 +1.000000e+0 1.000000e+0 - 1.000000e+0 e 1.000000e+0 1.000000e+0 - 1.0000e+0 1.0000e+0 1.000000e+0 1.0000e+0 - 1.000000e+0 1.000000e+0 1.000000e+0 1.000000e+0 - 1.000000e+0 1.000000e+0 1.000000e+0 1.000000e+0" - --- Iteration 4 -- -string(227) "1.000000e+0 +1.000000e+0 0.000000e+0 - 1.000000e+0 e 0.000000e+0 1.000000e+0 - 1.0000e+0 0.0000e+0 1.000000e+0 0.0000e+0 - 0.000000e+0 1.000000e+0 1.000000e+0 0.000000e+0 - 0.000000e+0 1.000000e+0 1.000000e+0 1.000000e+0" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation19.phpt b/ext/standard/tests/strings/vsprintf_variation19.phpt deleted file mode 100644 index 4ad276a8800d3..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation19.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - with whitespaces in format strings ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : with white spaces in format strings *** - --- Iteration 1 -- -string(13) "111 222 333" - --- Iteration 2 -- -string(29) "1.100000 0.200000 -0.600000" - --- Iteration 3 -- -string(29) "1.120000 -1.130000 0.230000" - --- Iteration 4 -- -string(9) "1 10 11" - --- Iteration 5 -- -string(7) "A B C" - --- Iteration 6 -- -string(38) "2.000000e+1 2.000000e-1 -2.000000e+1" - --- Iteration 7 -- -string(18) "4294967285 22 33" - --- Iteration 8 -- -string(19) "12 37777777755 23" - --- Iteration 9 -- -string(16) "11 ffffffde 33" - --- Iteration 10 -- -string(16) "11 FFFFFFDE 33" - --- Iteration 11 -- -string(38) "2.000000E+1 2.000000E-1 -2.000000E+1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation19_64bit.phpt b/ext/standard/tests/strings/vsprintf_variation19_64bit.phpt deleted file mode 100644 index 6e805feb7f294..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation19_64bit.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - with whitespaces in format strings ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : with white spaces in format strings *** - --- Iteration 1 -- -string(13) "111 222 333" - --- Iteration 2 -- -string(29) "1.100000 0.200000 -0.600000" - --- Iteration 3 -- -string(29) "1.120000 -1.130000 0.230000" - --- Iteration 4 -- -string(9) "1 10 11" - --- Iteration 5 -- -string(7) "A B C" - --- Iteration 6 -- -string(38) "2.000000e+1 2.000000e-1 -2.000000e+1" - --- Iteration 7 -- -string(28) "18446744073709551605 22 33" - --- Iteration 8 -- -string(30) "12 1777777777777777777755 23" - --- Iteration 9 -- -string(24) "11 ffffffffffffffde 33" - --- Iteration 10 -- -string(24) "11 FFFFFFFFFFFFFFDE 33" - --- Iteration 11 -- -string(38) "2.000000E+1 2.000000E-1 -2.000000E+1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation2.phpt b/ext/standard/tests/strings/vsprintf_variation2.phpt deleted file mode 100644 index acf4bea9e361b..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation2.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - unexpected values for args argument ---FILE-- - ---EXPECTF-- -*** Testing vsprintf() : with unexpected values for args argument *** - --- Iteration 1 -- -string(1) "0" - --- Iteration 2 -- -string(1) "1" - --- Iteration 3 -- -string(5) "12345" - --- Iteration 4 -- -string(5) "-2345" - --- Iteration 5 -- -string(4) "10.5" - --- Iteration 6 -- -string(5) "-10.5" - --- Iteration 7 -- -string(12) "101234567000" - --- Iteration 8 -- -string(13) "1.07654321E-9" - --- Iteration 9 -- -string(3) "0.5" - --- Iteration 10 -- - -Warning: vsprintf(): Too few arguments in %s on line %d -bool(false) - --- Iteration 11 -- - -Warning: vsprintf(): Too few arguments in %s on line %d -bool(false) - --- Iteration 12 -- -string(1) "1" - --- Iteration 13 -- -string(0) "" - --- Iteration 14 -- -string(1) "1" - --- Iteration 15 -- -string(0) "" - --- Iteration 16 -- -string(0) "" - --- Iteration 17 -- -string(0) "" - --- Iteration 18 -- -string(6) "string" - --- Iteration 19 -- -string(6) "string" - --- Iteration 20 -- - -Warning: vsprintf(): Too few arguments in %s on line %d -bool(false) - --- Iteration 21 -- - -Warning: vsprintf(): Too few arguments in %s on line %d -bool(false) - --- Iteration 22 -- - -Warning: vsprintf(): Too few arguments in %s on line %d -bool(false) - --- Iteration 23 -- -string(%d) "Resource id #%d" -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/vsprintf_variation3.phpt b/ext/standard/tests/strings/vsprintf_variation3.phpt deleted file mode 100644 index fff82c8032ce5..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation3.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - int formats with int values ---FILE-- - - ---EXPECTF-- -*** Testing vsprintf() : int formats with int values *** - --- Iteration 1 -- -string(1) "0" - --- Iteration 2 -- -string(5) "-1 1 " - --- Iteration 3 -- -string(36) "2147483647 d, 2147483640 -2147483640" - --- Iteration 4 -- -string(38) " 123456 12345678 -1234567 1234567" - --- Iteration 5 -- -string(24) "111 2222 333333 44444444" - --- Iteration 6 -- -string(15) "4667 4011 83 10" - --- Iteration 7 -- -string(8) "%-5678 d" - --- Iteration 8 -- -string(7) "1 2 3 4" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation4.phpt b/ext/standard/tests/strings/vsprintf_variation4.phpt deleted file mode 100644 index e3e6737b82679..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation4.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - int formats with non-integer values ---SKIPIF-- - ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, false, TRUE, FALSE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different int formats from the above $format array -// and with non-int values from the above $args_array array -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : int formats and non-integer values *** - --- Iteration 1 -- -string(112) "2 +0 10 - 123456 d -1234 1234 - -1474836480 200000 4000 22000000 - 12345 12 -12 -123456 - 10 123456 2 0" - --- Iteration 2 -- -string(92) "0 +0 0 - 123 d -123 123 - 0 0 123456 0000 - 1234 0 $0 _0 - 0 123 0 0" - --- Iteration 3 -- -string(81) "1 +1 1 - 1 d 1 1 - 1 1 1 0001 - #1 1 $1 _1 - 1 1 1 1" - --- Iteration 4 -- -string(81) "1 +1 0 - 1 d 0 1 - 1 0 1 0000 - #0 1 $1 _0 - 0 1 1 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation4_64bit.phpt b/ext/standard/tests/strings/vsprintf_variation4_64bit.phpt deleted file mode 100644 index c6b6db572ccfe..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation4_64bit.phpt +++ /dev/null @@ -1,104 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - int formats with non-integer values ---SKIPIF-- - ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, false, TRUE, FALSE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different int formats from the above $format array -// and with non-int values from the above $args_array array -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : int formats and non-integer values *** - --- Iteration 1 -- -string(112) "2 +0 10 - 123456 d -1234 1234 - 20000000000 200000 4000 22000000 - 12345 12 -12 -123456 - 10 123456 2 0" - --- Iteration 2 -- -string(92) "0 +0 0 - 123 d -123 123 - 0 0 123456 0000 - 1234 0 $0 _0 - 0 123 0 0" - --- Iteration 3 -- -string(81) "1 +1 1 - 1 d 1 1 - 1 1 1 0001 - #1 1 $1 _1 - 1 1 1 1" - --- Iteration 4 -- -string(81) "1 +1 0 - 1 d 0 1 - 1 0 1 0000 - #0 1 $1 _0 - 0 1 1 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation5.phpt b/ext/standard/tests/strings/vsprintf_variation5.phpt deleted file mode 100644 index dd356fbbe020c..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation5.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - float formats with float values ---FILE-- - - ---EXPECTF-- -*** Testing vsprintf() : int formats with float values *** - --- Iteration 1 -- -string(8) "0.000000" - --- Iteration 2 -- -string(28) "-0.100000 0.100000 10.000001" - --- Iteration 3 -- -string(57) "2147483649.000000 f, 2147483640.000000 -2147483640.000000" - --- Iteration 4 -- -string(45) "200000.0000 0.0000 -200000.000000 -0.0000" - --- Iteration 5 -- -string(98) "20000.000000 -1999999999999999879418332743206357172224.000000 0.000000 20000000000000000000.000000" - --- Iteration 6 -- -string(43) "4667.000000 4011.000000 83.000000 10.000000" - --- Iteration 7 -- -string(15) "%-5678.567800 f" - --- Iteration 8 -- -string(35) "1.110000 2.220000 3.330000 4.440000" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation6.phpt b/ext/standard/tests/strings/vsprintf_variation6.phpt deleted file mode 100644 index 00f9467cf9972..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation6.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - float formats with non-float values ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, false, TRUE, FALSE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different float formats from the above $format array -// and with non-float values from the above $args_array array -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : float formats and non-float values *** - --- Iteration 1 -- -string(244) "2.000000 -2.000000 2.000000 - 123456.000000 f -12346789.000000 12346789.000000 - 123200.0000 20000.0000 -40000.000000 22212.0000 - 12345780.000000 1211111.000000 -12111111.000000 -12345634.000000 - 2.000000 123456.000000 2.000000 -2.000000" - --- Iteration 2 -- -string(196) "0.000000 +0.000000 0.000000 - 123.000000 f -123.000000 123.000000 - 0.0000 0.0000 123456.000000 0.0000 - 1234.000000 0.000000 0.000000 0.000000 - 0.000000 123.000000 0.000000 0.000000" - --- Iteration 3 -- -string(179) "1.000000 +1.000000 1.000000 - 1.000000 f 1.000000 1.000000 - 1.0000 1.0000 1.000000 1.0000 - 1.000000 1.000000 1.000000 1.000000 - 1.000000 1.000000 1.000000 1.000000" - --- Iteration 4 -- -string(179) "1.000000 +1.000000 0.000000 - 1.000000 f 0.000000 1.000000 - 1.0000 0.0000 1.000000 0.0000 - 0.000000 1.000000 1.000000 0.000000 - 0.000000 1.000000 1.000000 1.000000" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation7.phpt b/ext/standard/tests/strings/vsprintf_variation7.phpt deleted file mode 100644 index 0085138b78221..0000000000000 Binary files a/ext/standard/tests/strings/vsprintf_variation7.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/vsprintf_variation8.phpt b/ext/standard/tests/strings/vsprintf_variation8.phpt deleted file mode 100644 index 38e8699f42631..0000000000000 --- a/ext/standard/tests/strings/vsprintf_variation8.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -Test vsprintf() function : usage variations - string formats with non-string values ---INI-- -precision=14 ---FILE-- -"12twelve"), - array("3"), array("4"), array("1"), array("2") ), - - // array of boolean data - array( true, TRUE, false, - TRUE, 0, FALSE, 1, - true, false, TRUE, FALSE, - 0, 1, 1, 0, - 1, TRUE, 0, FALSE), - -); - -// looping to test vsprintf() with different string formats from the above $format array -// and with non-string values from the above $args_array array -$counter = 1; -foreach($args_array as $args) { - echo "\n-- Iteration $counter --\n"; - var_dump( vsprintf($formats, $args) ); - $counter++; -} - -echo "Done"; -?> ---EXPECTF-- -*** Testing vsprintf() : string formats and non-string values *** - --- Iteration 1 -- -string(177) "2.2 0.2 10.2 - 123456.234 s -1234.6789 1234.6789 - 2000 2000 -400000000000 2200 - 12345.78 12.000000011111 -12.00000111111 -123456.234 - 10.2 123456.234 2.2 0.2" - --- Iteration 2 -- -string(132) "2 -2 2 - 123456 s -12346789 12346789 - 1232 2000 -40000 2221 - 12345780 1211111 -12111111 -12345634 - 2 123456 2 -2" - --- Iteration 3 -- -string(131) "Array Array Array - Array s Array Array - Arra Arra Array Arra - Array Array Array Array - Array Array Array Array" - --- Iteration 4 -- -string(81) "1 1 - 1 s 1 - 1 0001 0000 - #0 1 $1 _0 - 1 1 1" -Done diff --git a/ext/standard/tests/strings/vsprintf_variation9.phpt b/ext/standard/tests/strings/vsprintf_variation9.phpt deleted file mode 100644 index 2d466373915e9..0000000000000 Binary files a/ext/standard/tests/strings/vsprintf_variation9.phpt and /dev/null differ diff --git a/ext/standard/tests/strings/wordwrap.phpt b/ext/standard/tests/strings/wordwrap.phpt deleted file mode 100644 index c1f3b05bda56a..0000000000000 --- a/ext/standard/tests/strings/wordwrap.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -wordwrap() function ---FILE-- -\n'; - -// Calling wordwrap() with default arguments -var_dump( wordwrap($str) ); - -// Calling wordwrap() with all possible optional arguments -// with $width arg -var_dump( wordwrap($str, $width) ); -// with $break arg -var_dump( wordwrap($str, $width, $break) ); - -// Calling wordwrap() with all arguments -// $cut as true -$width = 10; -$cut = true; -var_dump( wordwrap($str, $width, $break, $cut) ); - -// $cut as false -$width = 10; -$cut = false; -var_dump( wordwrap($str, $width, $break, $cut) ); -echo "Done\n"; -?> ---EXPECTF-- -*** Testing wordwrap() : basic functionality *** -string(96) "The quick brown foooooooooox jummmmmmmmmmmmped over the lazzzzzzzzzzzy -doooooooooooooooooooooog." -string(96) "The quick brown foooooooooox jummmmmmmmmmmmped over the lazzzzzzzzzzzy -doooooooooooooooooooooog." -string(103) "The quick brown foooooooooox jummmmmmmmmmmmped over the lazzzzzzzzzzzy
\ndoooooooooooooooooooooog." -string(178) "The quick
\nbrown
\nfooooooooo
\nox
\njummmmmmmm
\nmmmmped
\nover the
\nlazzzzzzzz
\nzzzy
\ndooooooooo
\noooooooooo
\nooog." -string(138) "The quick
\nbrown
\nfoooooooooox
\njummmmmmmmmmmmped
\nover the
\nlazzzzzzzzzzzy
\ndoooooooooooooooooooooog." -Done diff --git a/ext/standard/tests/strings/wordwrap_error.phpt b/ext/standard/tests/strings/wordwrap_error.phpt deleted file mode 100644 index 98f199abc6821..0000000000000 --- a/ext/standard/tests/strings/wordwrap_error.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -Test wordwrap() function : error conditions ---FILE-- -\n'; -$cut = true; -$extra_arg = "extra_arg"; - -var_dump( wordwrap($str, $width, $break, $cut, $extra_arg) ); - -// $width arg as negative value -echo "\n-- Testing wordwrap() function with negative/zero value for width argument --\n"; -echo "-- width = 0 & cut = false --\n"; -// width as zero and cut as false -$width = 0; -$cut = false; -var_dump( wordwrap($str, $width, $break, $cut) ); - -echo "-- width = 0 & cut = true --\n"; -// width as zero and cut as true -$width = 0; -$cut = true; -var_dump( wordwrap($str, $width, $break, $cut) ); - -echo "-- width = -10 & cut = false --\n"; -// width as -ne and cut as false -$width = -10; -$cut = false; -var_dump( wordwrap($str, $width, $break, $cut) ); - -echo "-- width = -10 & cut = true --\n"; -// width as -ne and cut as true -$width = -10; -$cut = true; -var_dump( wordwrap($str, $width, $break, $cut) ); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing wordwrap() : error conditions *** - --- Testing wordwrap() function with Zero arguments -- - -Warning: wordwrap() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing wordwrap() function with more than expected no. of arguments -- - -Warning: wordwrap() expects at most 4 parameters, 5 given in %s on line %d -NULL - --- Testing wordwrap() function with negative/zero value for width argument -- --- width = 0 & cut = false -- -string(39) "testing
\nwordwrap
\nfunction" --- width = 0 & cut = true -- - -Warning: wordwrap(): Can't force cut when width is zero in %s on line %d -bool(false) --- width = -10 & cut = false -- -string(39) "testing
\nwordwrap
\nfunction" --- width = -10 & cut = true -- -string(223) "
\nt
\ne
\ns
\nt
\ni
\nn
\ng
\n
\nw
\no
\nr
\nd
\nw
\nr
\na
\np
\n
\nf
\nu
\nn
\nc
\nt
\ni
\no
\nn" -Done diff --git a/ext/standard/tests/strings/wordwrap_variation1.phpt b/ext/standard/tests/strings/wordwrap_variation1.phpt deleted file mode 100644 index d13e7dee2dee6..0000000000000 --- a/ext/standard/tests/strings/wordwrap_variation1.phpt +++ /dev/null @@ -1,335 +0,0 @@ ---TEST-- -Test wordwrap() function : usage variations - unexpected values for str argument ---FILE-- -\n'; -$cut = true; - -// resource variable -$fp = fopen(__FILE__, "r"); - -// get an unset variable -$unset_var = 'string_val'; -unset($unset_var); - -// array with different values -$values = array ( - - // integer values - 0, - 1, - 12345, - -2345, - - // float values - 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, - - // array values - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new stdclass(), - - // Null - NULL, - null, - - // empty string - "", - '', - - // resource variable - $fp, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop though each element of the array and check the working of wordwrap() -// when $str arugment is supplied with different values -echo "\n--- Testing wordwrap() by supplying different values for 'str' argument ---\n"; -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $str = $values [$index]; - - var_dump( wordwrap($str) ); - var_dump( wordwrap($str, $width) ); - var_dump( wordwrap($str, $width, $break) ); - - // $cut as false - $cut = false; - var_dump( wordwrap($str, $width, $break, $cut) ); - - // $cut as true - $cut = true; - var_dump( wordwrap($str, $width, $break, $cut) ); - - $counter ++; -} - -// close the resource -fclose($fp); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing wordwrap() : usage variations *** - ---- Testing wordwrap() by supplying different values for 'str' argument --- --- Iteration 1 -- -string(1) "0" -string(1) "0" -string(1) "0" -string(1) "0" -string(1) "0" --- Iteration 2 -- -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" --- Iteration 3 -- -string(5) "12345" -string(5) "12345" -string(5) "12345" -string(5) "12345" -string(13) "123
\n45" --- Iteration 4 -- -string(5) "-2345" -string(5) "-2345" -string(5) "-2345" -string(5) "-2345" -string(13) "-23
\n45" --- Iteration 5 -- -string(4) "10.5" -string(4) "10.5" -string(4) "10.5" -string(4) "10.5" -string(12) "10.
\n5" --- Iteration 6 -- -string(5) "-10.5" -string(5) "-10.5" -string(5) "-10.5" -string(5) "-10.5" -string(13) "-10
\n.5" --- Iteration 7 -- -string(12) "101234567000" -string(12) "101234567000" -string(12) "101234567000" -string(12) "101234567000" -string(36) "101
\n234
\n567
\n000" --- Iteration 8 -- -string(13) "1.07654321E-9" -string(13) "1.07654321E-9" -string(13) "1.07654321E-9" -string(13) "1.07654321E-9" -string(45) "1.0
\n765
\n432
\n1E-
\n9" --- Iteration 9 -- -string(3) "0.5" -string(3) "0.5" -string(3) "0.5" -string(3) "0.5" -string(3) "0.5" --- Iteration 10 -- - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 11 -- - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 12 -- - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 13 -- - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 14 -- - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, array given in %s on line %d -NULL --- Iteration 15 -- -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" --- Iteration 16 -- -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 17 -- -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" -string(1) "1" --- Iteration 18 -- -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 19 -- - -Warning: wordwrap() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, object given in %s on line %d -NULL --- Iteration 20 -- -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 21 -- -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 22 -- -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 23 -- -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 24 -- - -Warning: wordwrap() expects parameter 1 to be string, resource given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, resource given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, resource given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, resource given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 1 to be string, resource given in %s on line %d -NULL --- Iteration 25 -- -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" --- Iteration 26 -- -string(0) "" -string(0) "" -string(0) "" -string(0) "" -string(0) "" -Done \ No newline at end of file diff --git a/ext/standard/tests/strings/wordwrap_variation2.phpt b/ext/standard/tests/strings/wordwrap_variation2.phpt deleted file mode 100644 index 2718791943dca..0000000000000 --- a/ext/standard/tests/strings/wordwrap_variation2.phpt +++ /dev/null @@ -1,340 +0,0 @@ ---TEST-- -Test wordwrap() function : usage variations - unexpected values for width argument ---FILE-- -\n'; -$cut = true; - -// resource var -$fp = fopen(__FILE__, "r"); - -// get an unset variable -$unset_var = 10; -unset($unset_var); - - -// array with different values as width -$values = array ( - // zerovalue for width - 0, - - // -ve value for width - -1, - -10, - - // array values - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // string values - "string", - 'string', - - // objects - new stdclass(), - - // Null value - NULL, - null, - - // empty string - "", - '', - - // resource variable - $fp, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - - -// loop though each element of the array and check the working of wordwrap() -// when $width arugment is supplied with different values -echo "\n--- Testing wordwrap() by supplying different values for 'width' argument ---\n"; -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $width = $values [$index]; - - var_dump( wordwrap($str, $width) ); - var_dump( wordwrap($str, $width, $break) ); - - // cut as false - $cut = false; - var_dump( wordwrap($str, $width, $break, $cut) ); - - // cut as true - $cut = true; - var_dump( wordwrap($str, $width, $break, $cut) ); - - $counter ++; -} - -// close the resource -fclose($fp); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing wordwrap() : usage variations *** - ---- Testing wordwrap() by supplying different values for 'width' argument --- --- Iteration 1 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" - -Warning: wordwrap(): Can't force cut when width is zero in %s on line %d -bool(false) --- Iteration 2 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" -string(223) "
\nt
\ne
\ns
\nt
\ni
\nn
\ng
\n
\nw
\no
\nr
\nd
\nw
\nr
\na
\np
\n
\nf
\nu
\nn
\nc
\nt
\ni
\no
\nn" --- Iteration 3 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" -string(223) "
\nt
\ne
\ns
\nt
\ni
\nn
\ng
\n
\nw
\no
\nr
\nd
\nw
\nr
\na
\np
\n
\nf
\nu
\nn
\nc
\nt
\ni
\no
\nn" --- Iteration 4 -- - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL --- Iteration 5 -- - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL --- Iteration 6 -- - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL --- Iteration 7 -- - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL --- Iteration 8 -- - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, array given in %s on line %d -NULL --- Iteration 9 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" -string(199) "t
\ne
\ns
\nt
\ni
\nn
\ng
\nw
\no
\nr
\nd
\nw
\nr
\na
\np
\nf
\nu
\nn
\nc
\nt
\ni
\no
\nn" --- Iteration 10 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" - -Warning: wordwrap(): Can't force cut when width is zero in %s on line %d -bool(false) --- Iteration 11 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" -string(199) "t
\ne
\ns
\nt
\ni
\nn
\ng
\nw
\no
\nr
\nd
\nw
\nr
\na
\np
\nf
\nu
\nn
\nc
\nt
\ni
\no
\nn" --- Iteration 12 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" - -Warning: wordwrap(): Can't force cut when width is zero in %s on line %d -bool(false) --- Iteration 13 -- - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL --- Iteration 14 -- - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL --- Iteration 15 -- - -Warning: wordwrap() expects parameter 2 to be long, object given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, object given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, object given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, object given in %s on line %d -NULL --- Iteration 16 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" - -Warning: wordwrap(): Can't force cut when width is zero in %s on line %d -bool(false) --- Iteration 17 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" - -Warning: wordwrap(): Can't force cut when width is zero in %s on line %d -bool(false) --- Iteration 18 -- - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL --- Iteration 19 -- - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, string given in %s on line %d -NULL --- Iteration 20 -- - -Warning: wordwrap() expects parameter 2 to be long, resource given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, resource given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, resource given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 2 to be long, resource given in %s on line %d -NULL --- Iteration 21 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" - -Warning: wordwrap(): Can't force cut when width is zero in %s on line %d -bool(false) --- Iteration 22 -- -string(25) "testing -wordwrap -function" -string(39) "testing
\nwordwrap
\nfunction" -string(39) "testing
\nwordwrap
\nfunction" - -Warning: wordwrap(): Can't force cut when width is zero in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/strings/wordwrap_variation3.phpt b/ext/standard/tests/strings/wordwrap_variation3.phpt deleted file mode 100644 index 2f83add7bde7a..0000000000000 --- a/ext/standard/tests/strings/wordwrap_variation3.phpt +++ /dev/null @@ -1,302 +0,0 @@ ---TEST-- -Test wordwrap() function : usage variations - unexptected values for break argument ---INI-- ---FILE-- - 'red', 'item' => 'pen'), - - // boolean values - true, - false, - TRUE, - FALSE, - - // objects - new stdclass(), - - // empty string - "", - '', - - //Null - NULL, - null, - - // resource var - $fp, - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop though each element of the array and check the working of wordwrap() -// when $break arugment is supplied with different values -echo "\n--- Testing wordwrap() by supplying different values for 'break' argument ---\n"; -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $break = $values [$index]; - - var_dump( wordwrap($str, $width, $break) ); - - // $cut as false - $cut = false; - var_dump( wordwrap($str, $width, $break, $cut) ); - - // $cut as true - $cut = true; - var_dump( wordwrap($str, $width, $break, $cut) ); - - $counter ++; -} - -// close the resource used -fclose($fp); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing wordwrap() : usage variations *** - ---- Testing wordwrap() by supplying different values for 'break' argument --- --- Iteration 1 -- -string(25) "testing0wordwrap0function" -string(25) "testing0wordwrap0function" -string(25) "testing0wordwrap0function" --- Iteration 2 -- -string(25) "testing1wordwrap1function" -string(25) "testing1wordwrap1function" -string(25) "testing1wordwrap1function" --- Iteration 3 -- -string(33) "testing12345wordwrap12345function" -string(33) "testing12345wordwrap12345function" -string(33) "testing12345wordwrap12345function" --- Iteration 4 -- -string(33) "testing-2345wordwrap-2345function" -string(33) "testing-2345wordwrap-2345function" -string(33) "testing-2345wordwrap-2345function" --- Iteration 5 -- -string(31) "testing10.5wordwrap10.5function" -string(31) "testing10.5wordwrap10.5function" -string(31) "testing10.5wordwrap10.5function" --- Iteration 6 -- -string(33) "testing-10.5wordwrap-10.5function" -string(33) "testing-10.5wordwrap-10.5function" -string(33) "testing-10.5wordwrap-10.5function" --- Iteration 7 -- -string(47) "testing101234567000wordwrap101234567000function" -string(47) "testing101234567000wordwrap101234567000function" -string(47) "testing101234567000wordwrap101234567000function" --- Iteration 8 -- -string(49) "testing1.07654321E-9wordwrap1.07654321E-9function" -string(49) "testing1.07654321E-9wordwrap1.07654321E-9function" -string(49) "testing1.07654321E-9wordwrap1.07654321E-9function" --- Iteration 9 -- -string(29) "testing0.5wordwrap0.5function" -string(29) "testing0.5wordwrap0.5function" -string(29) "testing0.5wordwrap0.5function" --- Iteration 10 -- - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL --- Iteration 11 -- - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL --- Iteration 12 -- - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL --- Iteration 13 -- - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL --- Iteration 14 -- - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, array given in %s on line %d -NULL --- Iteration 15 -- -string(25) "testing1wordwrap1function" -string(25) "testing1wordwrap1function" -string(25) "testing1wordwrap1function" --- Iteration 16 -- - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) --- Iteration 17 -- -string(25) "testing1wordwrap1function" -string(25) "testing1wordwrap1function" -string(25) "testing1wordwrap1function" --- Iteration 18 -- - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) --- Iteration 19 -- - -Warning: wordwrap() expects parameter 3 to be string, object given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, object given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, object given in %s on line %d -NULL --- Iteration 20 -- - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) --- Iteration 21 -- - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) --- Iteration 22 -- - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) --- Iteration 23 -- - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) --- Iteration 24 -- - -Warning: wordwrap() expects parameter 3 to be string, resource given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, resource given in %s on line %d -NULL - -Warning: wordwrap() expects parameter 3 to be string, resource given in %s on line %d -NULL --- Iteration 25 -- - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) --- Iteration 26 -- - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) - -Warning: wordwrap(): Break string cannot be empty in %s on line %d -bool(false) -Done diff --git a/ext/standard/tests/strings/wordwrap_variation4.phpt b/ext/standard/tests/strings/wordwrap_variation4.phpt deleted file mode 100644 index 440e93740a6b9..0000000000000 --- a/ext/standard/tests/strings/wordwrap_variation4.phpt +++ /dev/null @@ -1,144 +0,0 @@ ---TEST-- -Test wordwrap() function : usage variations - unexptected value for cut argument ---FILE-- -\n'; - -// get an unset variable -$unset_var = true; -unset($unset_var); - -// resource variable -$fp = fopen(__FILE__, "r"); - -// array with different values -$values = array ( - - // integer values - 0, - 1, - 12345, - -2345, - - // float values - 10.5, - -10.5, - 10.5e10, - 10.6E-10, - .5, - - // array values - array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), - - // string values - "string", - 'string', - - // objects - new stdclass(), - - // empty string - "", - '', - - // undefined variable - @$undefined_var, - - // unset variable - @$unset_var -); - -// loop though each element of the array and check the working of wordwrap() -// when $cut arugment is supplied with different values -echo "\n--- Testing wordwrap() by supplying different values for 'cut' argument ---\n"; -$counter = 1; -for($index = 0; $index < count($values); $index ++) { - echo "-- Iteration $counter --\n"; - $cut = $values [$index]; - - var_dump( wordwrap($str, $width, $break, $cut) ); - - $counter ++; -} - -// close the resource -fclose($fp); - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing wordwrap() : usage variations *** - ---- Testing wordwrap() by supplying different values for 'cut' argument --- --- Iteration 1 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 2 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 3 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 4 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 5 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 6 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 7 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 8 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 9 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 10 -- - -Warning: wordwrap() expects parameter 4 to be boolean, array given in %s on line %d -NULL --- Iteration 11 -- - -Warning: wordwrap() expects parameter 4 to be boolean, array given in %s on line %d -NULL --- Iteration 12 -- - -Warning: wordwrap() expects parameter 4 to be boolean, array given in %s on line %d -NULL --- Iteration 13 -- - -Warning: wordwrap() expects parameter 4 to be boolean, array given in %s on line %d -NULL --- Iteration 14 -- - -Warning: wordwrap() expects parameter 4 to be boolean, array given in %s on line %d -NULL --- Iteration 15 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 16 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 17 -- - -Warning: wordwrap() expects parameter 4 to be boolean, object given in %s on line %d -NULL --- Iteration 18 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 19 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 20 -- -string(39) "testing
\nwordwrap
\nfunction" --- Iteration 21 -- -string(39) "testing
\nwordwrap
\nfunction" -Done diff --git a/ext/standard/tests/strings/wordwrap_variation5.phpt b/ext/standard/tests/strings/wordwrap_variation5.phpt deleted file mode 100644 index b0911a899cd0e..0000000000000 --- a/ext/standard/tests/strings/wordwrap_variation5.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -Test wordwrap() function : usage variations - valid break arguments(spaces) ---FILE-- - ---EXPECTF-- -*** Testing wordwrap() : usage variations *** - --- Testing wordwrap() with default break value and single space as value -- --- with default break and cut value -- -string(24) "Testing -wordrap -function" --- with default cut value -- -string(24) "Testing wordrap function" -string(26) "Testing wordrap function" --- with cut value as false -- -string(24) "Testing wordrap function" -string(26) "Testing wordrap function" --- with cut value as true -- -string(43) "T e s t i n g w o r d r a p f u n c t i o n" -string(64) "T e s t i n g w o r d r a p f u n c t i o n" -Done diff --git a/ext/standard/tests/time/001.phpt b/ext/standard/tests/time/001.phpt deleted file mode 100644 index 3b0ed8a77f40d..0000000000000 --- a/ext/standard/tests/time/001.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -microtime() function ---SKIPIF-- - ---FILE-- - $last_t || ($time == $last_t && $micro >= $last_m)) { - $passed++; - } else if ($failed++ <=10) { - $result .= sprintf('%06d', $i).": $time $micro < $last_t $last_m\n"; - } - $last_m = $micro; - $last_t = $time; -} -echo "Passed: $passed\n"; -echo "Failed: $failed\n"; -echo $result; -?> ---EXPECT-- -Passed: 100000 -Failed: 0 diff --git a/ext/standard/tests/time/bug38524.phpt b/ext/standard/tests/time/bug38524.phpt deleted file mode 100755 index 77d0f4f2341b1..0000000000000 --- a/ext/standard/tests/time/bug38524.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #38524 (strptime() does not initialize the internal date storage structure) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -array(9) { - ["tm_sec"]=> - int(0) - ["tm_min"]=> - int(0) - ["tm_hour"]=> - int(0) - ["tm_mday"]=> - int(20) - ["tm_mon"]=> - int(7) - ["tm_year"]=> - int(106) - ["tm_wday"]=> - int(0) - ["tm_yday"]=> - int(%d) - ["unparsed"]=> - string(0) "" -} -===DONE=== diff --git a/ext/standard/tests/time/idate.phpt b/ext/standard/tests/time/idate.phpt deleted file mode 100644 index efeef665fd9e0..0000000000000 --- a/ext/standard/tests/time/idate.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -idate() function ---FILE-- - ---EXPECT-- -U: 1043324459 -Y: 2003 -z: 22 -y: 3 -m: 1 -n: 1 -d: 23 -j: 23 -H: 12 -G: 12 -h: 12 -g: 12 -i: 20 -s: 59 -t: 31 -w: 4 -L: 0 -B: 556 -I: 0 -W: 4 diff --git a/ext/standard/tests/url/base64_decode_basic_001.phpt b/ext/standard/tests/url/base64_decode_basic_001.phpt deleted file mode 100644 index 7aba807e198bb..0000000000000 --- a/ext/standard/tests/url/base64_decode_basic_001.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test base64_decode() function : basic functionality - ensure all base64 alphabet is supported. ---FILE-- - ---EXPECTF-- -Decode an input string containing the whole base64 alphabet: -string(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf" -string(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf" -string(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf" -Done \ No newline at end of file diff --git a/ext/standard/tests/url/base64_decode_basic_002.phpt b/ext/standard/tests/url/base64_decode_basic_002.phpt deleted file mode 100644 index 1289894f4a36f..0000000000000 --- a/ext/standard/tests/url/base64_decode_basic_002.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test base64_decode() function : basic functionality - strict vs non-strict with non-base64 chars. ---FILE-- - ---EXPECTF-- -Decode 'hello world!': -string(12) "hello world!" -string(12) "hello world!" -string(12) "hello world!" - -Whitespace does not affect base64_decode, even with $strict===true: -string(12) "hello world!" -string(12) "hello world!" -string(12) "hello world!" - -Other chars outside the base64 alphabet are ignored when $strict===false, but cause failure with $strict===true: -string(12) "hello world!" -string(12) "hello world!" -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/base64_decode_error_001.phpt b/ext/standard/tests/url/base64_decode_error_001.phpt deleted file mode 100644 index 2725164464efd..0000000000000 --- a/ext/standard/tests/url/base64_decode_error_001.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Test base64_decode() function : error conditions - wrong number of args ---FILE-- - ---EXPECTF-- -*** Testing base64_decode() : error conditions *** - --- Testing base64_decode() function with Zero arguments -- - -Warning: base64_decode() expects at least 1 parameter, 0 given in %s on line 12 -NULL - --- Testing base64_decode() function with more than expected no. of arguments -- - -Warning: base64_decode() expects at most 2 parameters, 3 given in %s on line 19 -NULL -Done diff --git a/ext/standard/tests/url/base64_decode_variation_001.phpt b/ext/standard/tests/url/base64_decode_variation_001.phpt deleted file mode 100644 index b01cd23e544a5..0000000000000 --- a/ext/standard/tests/url/base64_decode_variation_001.phpt +++ /dev/null @@ -1,167 +0,0 @@ ---TEST-- -Test base64_decode() function : usage variations - unexpected types for arg 1 ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for str - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( base64_decode($value, $strict) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing base64_decode() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(63) -Error: 8 - Undefined variable: unset_var, %s(66) - -Arg value 0 -string(0) "" - -Arg value 1 -string(0) "" - -Arg value 12345 -string(3) "×mø" - -Arg value -2345 -bool(false) - -Arg value 10.5 -bool(false) - -Arg value -10.5 -bool(false) - -Arg value 101234567000 -string(9) "×MvߎzïM4" - -Arg value 1.07654321E-9 -bool(false) - -Arg value 0.5 -bool(false) - -Arg value Array -Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value Array -Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value Array -Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value Array -Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value Array -Error: 2 - base64_decode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value 1 -string(0) "" - -Arg value -string(0) "" - -Arg value 1 -string(0) "" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value -string(0) "" -Error: 4096 - Object of class stdClass could not be converted to string, %s(72) - -Arg value -Error: 2 - base64_decode() expects parameter 1 to be string, object given, %s(73) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" -Done diff --git a/ext/standard/tests/url/base64_decode_variation_002.phpt b/ext/standard/tests/url/base64_decode_variation_002.phpt deleted file mode 100644 index 145784a4ed778..0000000000000 --- a/ext/standard/tests/url/base64_decode_variation_002.phpt +++ /dev/null @@ -1,177 +0,0 @@ ---TEST-- -Test base64_decode() function : usage variations - unexpected types for arg 2 ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for strict - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( base64_decode($str, $value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing base64_decode() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(67) -Error: 8 - Undefined variable: unset_var, %s(70) - -Arg value 0 -string(12) "hello world!" - -Arg value 1 -bool(false) - -Arg value 12345 -bool(false) - -Arg value -2345 -bool(false) - -Arg value 10.5 -bool(false) - -Arg value -10.5 -bool(false) - -Arg value 101234567000 -bool(false) - -Arg value 1.07654321E-9 -bool(false) - -Arg value 0.5 -bool(false) - -Arg value Array -Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) -NULL - -Arg value Array -Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) -NULL - -Arg value Array -Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) -NULL - -Arg value Array -Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) -NULL - -Arg value Array -Error: 2 - base64_decode() expects parameter 2 to be boolean, array given, %s(77) -NULL - -Arg value -string(12) "hello world!" - -Arg value -string(12) "hello world!" - -Arg value 1 -bool(false) - -Arg value -string(12) "hello world!" - -Arg value 1 -bool(false) - -Arg value -string(12) "hello world!" - -Arg value -string(12) "hello world!" - -Arg value -string(12) "hello world!" - -Arg value string -bool(false) - -Arg value string -bool(false) -Error: 4096 - Object of class stdClass could not be converted to string, %s(76) - -Arg value -Error: 2 - base64_decode() expects parameter 2 to be boolean, object given, %s(77) -NULL - -Arg value -string(12) "hello world!" - -Arg value -string(12) "hello world!" -Done \ No newline at end of file diff --git a/ext/standard/tests/url/base64_encode_basic_001.phpt b/ext/standard/tests/url/base64_encode_basic_001.phpt deleted file mode 100644 index 6ab57f4c558b3..0000000000000 --- a/ext/standard/tests/url/base64_encode_basic_001.phpt +++ /dev/null @@ -1,283 +0,0 @@ ---TEST-- -Test base64_encode() function : basic functionality ---FILE-- - ---EXPECTF-- -*** Testing base64_encode() : basic functionality *** -0x0: AA== -0x1: AQ== -0x2: Ag== -0x3: Aw== -0x4: BA== -0x5: BQ== -0x6: Bg== -0x7: Bw== -0x8: CA== -0x9: CQ== -0xA: Cg== -0xB: Cw== -0xC: DA== -0xD: DQ== -0xE: Dg== -0xF: Dw== -0x10: EA== -0x11: EQ== -0x12: Eg== -0x13: Ew== -0x14: FA== -0x15: FQ== -0x16: Fg== -0x17: Fw== -0x18: GA== -0x19: GQ== -0x1A: Gg== -0x1B: Gw== -0x1C: HA== -0x1D: HQ== -0x1E: Hg== -0x1F: Hw== -0x20: IA== -0x21: IQ== -0x22: Ig== -0x23: Iw== -0x24: JA== -0x25: JQ== -0x26: Jg== -0x27: Jw== -0x28: KA== -0x29: KQ== -0x2A: Kg== -0x2B: Kw== -0x2C: LA== -0x2D: LQ== -0x2E: Lg== -0x2F: Lw== -0x30: MA== -0x31: MQ== -0x32: Mg== -0x33: Mw== -0x34: NA== -0x35: NQ== -0x36: Ng== -0x37: Nw== -0x38: OA== -0x39: OQ== -0x3A: Og== -0x3B: Ow== -0x3C: PA== -0x3D: PQ== -0x3E: Pg== -0x3F: Pw== -0x40: QA== -0x41: QQ== -0x42: Qg== -0x43: Qw== -0x44: RA== -0x45: RQ== -0x46: Rg== -0x47: Rw== -0x48: SA== -0x49: SQ== -0x4A: Sg== -0x4B: Sw== -0x4C: TA== -0x4D: TQ== -0x4E: Tg== -0x4F: Tw== -0x50: UA== -0x51: UQ== -0x52: Ug== -0x53: Uw== -0x54: VA== -0x55: VQ== -0x56: Vg== -0x57: Vw== -0x58: WA== -0x59: WQ== -0x5A: Wg== -0x5B: Ww== -0x5C: XA== -0x5D: XQ== -0x5E: Xg== -0x5F: Xw== -0x60: YA== -0x61: YQ== -0x62: Yg== -0x63: Yw== -0x64: ZA== -0x65: ZQ== -0x66: Zg== -0x67: Zw== -0x68: aA== -0x69: aQ== -0x6A: ag== -0x6B: aw== -0x6C: bA== -0x6D: bQ== -0x6E: bg== -0x6F: bw== -0x70: cA== -0x71: cQ== -0x72: cg== -0x73: cw== -0x74: dA== -0x75: dQ== -0x76: dg== -0x77: dw== -0x78: eA== -0x79: eQ== -0x7A: eg== -0x7B: ew== -0x7C: fA== -0x7D: fQ== -0x7E: fg== -0x7F: fw== -0x80: gA== -0x81: gQ== -0x82: gg== -0x83: gw== -0x84: hA== -0x85: hQ== -0x86: hg== -0x87: hw== -0x88: iA== -0x89: iQ== -0x8A: ig== -0x8B: iw== -0x8C: jA== -0x8D: jQ== -0x8E: jg== -0x8F: jw== -0x90: kA== -0x91: kQ== -0x92: kg== -0x93: kw== -0x94: lA== -0x95: lQ== -0x96: lg== -0x97: lw== -0x98: mA== -0x99: mQ== -0x9A: mg== -0x9B: mw== -0x9C: nA== -0x9D: nQ== -0x9E: ng== -0x9F: nw== -0xA0: oA== -0xA1: oQ== -0xA2: og== -0xA3: ow== -0xA4: pA== -0xA5: pQ== -0xA6: pg== -0xA7: pw== -0xA8: qA== -0xA9: qQ== -0xAA: qg== -0xAB: qw== -0xAC: rA== -0xAD: rQ== -0xAE: rg== -0xAF: rw== -0xB0: sA== -0xB1: sQ== -0xB2: sg== -0xB3: sw== -0xB4: tA== -0xB5: tQ== -0xB6: tg== -0xB7: tw== -0xB8: uA== -0xB9: uQ== -0xBA: ug== -0xBB: uw== -0xBC: vA== -0xBD: vQ== -0xBE: vg== -0xBF: vw== -0xC0: wA== -0xC1: wQ== -0xC2: wg== -0xC3: ww== -0xC4: xA== -0xC5: xQ== -0xC6: xg== -0xC7: xw== -0xC8: yA== -0xC9: yQ== -0xCA: yg== -0xCB: yw== -0xCC: zA== -0xCD: zQ== -0xCE: zg== -0xCF: zw== -0xD0: 0A== -0xD1: 0Q== -0xD2: 0g== -0xD3: 0w== -0xD4: 1A== -0xD5: 1Q== -0xD6: 1g== -0xD7: 1w== -0xD8: 2A== -0xD9: 2Q== -0xDA: 2g== -0xDB: 2w== -0xDC: 3A== -0xDD: 3Q== -0xDE: 3g== -0xDF: 3w== -0xE0: 4A== -0xE1: 4Q== -0xE2: 4g== -0xE3: 4w== -0xE4: 5A== -0xE5: 5Q== -0xE6: 5g== -0xE7: 5w== -0xE8: 6A== -0xE9: 6Q== -0xEA: 6g== -0xEB: 6w== -0xEC: 7A== -0xED: 7Q== -0xEE: 7g== -0xEF: 7w== -0xF0: 8A== -0xF1: 8Q== -0xF2: 8g== -0xF3: 8w== -0xF4: 9A== -0xF5: 9Q== -0xF6: 9g== -0xF7: 9w== -0xF8: +A== -0xF9: +Q== -0xFA: +g== -0xFB: +w== -0xFC: /A== -0xFD: /Q== -0xFE: /g== -0xFF: /w== -Done diff --git a/ext/standard/tests/url/base64_encode_error_001.phpt b/ext/standard/tests/url/base64_encode_error_001.phpt deleted file mode 100644 index a8883ac8f91a3..0000000000000 --- a/ext/standard/tests/url/base64_encode_error_001.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test base64_encode() function : error conditions - wrong number of args ---FILE-- - ---EXPECTF-- -*** Testing base64_encode() : error conditions - wrong number of args *** - --- Testing base64_encode() function with Zero arguments -- - -Warning: base64_encode() expects exactly 1 parameter, 0 given in %s on line 12 -NULL - --- Testing base64_encode() function with more than expected no. of arguments -- - -Warning: base64_encode() expects exactly 1 parameter, 2 given in %s on line 18 -NULL -Done \ No newline at end of file diff --git a/ext/standard/tests/url/base64_encode_variation_001.phpt b/ext/standard/tests/url/base64_encode_variation_001.phpt deleted file mode 100644 index 30da145a8b7bb..0000000000000 --- a/ext/standard/tests/url/base64_encode_variation_001.phpt +++ /dev/null @@ -1,167 +0,0 @@ ---TEST-- -Test base64_encode() function : usage variations - unexpected types for argument 1 ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for str - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( base64_encode($value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing base64_encode() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(63) -Error: 8 - Undefined variable: unset_var, %s(66) - -Arg value 0 -string(4) "MA==" - -Arg value 1 -string(4) "MQ==" - -Arg value 12345 -string(8) "MTIzNDU=" - -Arg value -2345 -string(8) "LTIzNDU=" - -Arg value 10.5 -string(8) "MTAuNQ==" - -Arg value -10.5 -string(8) "LTEwLjU=" - -Arg value 101234567000 -string(16) "MTAxMjM0NTY3MDAw" - -Arg value 1.07654321E-9 -string(20) "MS4wNzY1NDMyMUUtOQ==" - -Arg value 0.5 -string(4) "MC41" - -Arg value Array -Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value Array -Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value Array -Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value Array -Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value Array -Error: 2 - base64_encode() expects parameter 1 to be string, array given, %s(73) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value 1 -string(4) "MQ==" - -Arg value -string(0) "" - -Arg value 1 -string(4) "MQ==" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value -string(0) "" -Error: 4096 - Object of class stdClass could not be converted to string, %s(72) - -Arg value -Error: 2 - base64_encode() expects parameter 1 to be string, object given, %s(73) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" -Done diff --git a/ext/standard/tests/url/parse_url_basic_001.phpt b/ext/standard/tests/url/parse_url_basic_001.phpt deleted file mode 100644 index 3d50689a4d0d6..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_001.phpt +++ /dev/null @@ -1,899 +0,0 @@ ---TEST-- -Test parse_url() function: Parse a load of URLs without specifying the component ---FILE-- - $url: "; - var_dump(parse_url($url)); -} - -echo "Done"; -?> ---EXPECTF-- - ---> 64.246.30.37: array(1) { - ["path"]=> - string(12) "64.246.30.37" -} - ---> http://64.246.30.37: array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(12) "64.246.30.37" -} - ---> http://64.246.30.37/: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(12) "64.246.30.37" - ["path"]=> - string(1) "/" -} - ---> 64.246.30.37/: array(1) { - ["path"]=> - string(13) "64.246.30.37/" -} - ---> 64.246.30.37:80/: array(3) { - ["host"]=> - string(12) "64.246.30.37" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} - ---> php.net: array(1) { - ["path"]=> - string(7) "php.net" -} - ---> php.net/: array(1) { - ["path"]=> - string(8) "php.net/" -} - ---> http://php.net: array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "php.net" -} - ---> http://php.net/: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "php.net" - ["path"]=> - string(1) "/" -} - ---> www.php.net: array(1) { - ["path"]=> - string(11) "www.php.net" -} - ---> www.php.net/: array(1) { - ["path"]=> - string(12) "www.php.net/" -} - ---> http://www.php.net: array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" -} - ---> http://www.php.net/: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(1) "/" -} - ---> www.php.net:80: array(2) { - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) -} - ---> http://www.php.net:80: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) -} - ---> http://www.php.net:80/: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} - ---> http://www.php.net/index.php: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(10) "/index.php" -} - ---> www.php.net/?: array(1) { - ["path"]=> - string(12) "www.php.net/" -} - ---> www.php.net:80/?: array(3) { - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} - ---> http://www.php.net/?: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(1) "/" -} - ---> http://www.php.net:80/?: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} - ---> http://www.php.net:80/index.php: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" -} - ---> http://www.php.net:80/foo/bar/index.php: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(18) "/foo/bar/index.php" -} - ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(53) "/this/is/a/very/deep/directory/structure/and/file.php" -} - ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5: array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(53) "/this/is/a/very/deep/directory/structure/and/file.php" - ["query"]=> - string(37) "lots=1&of=2¶meters=3&too=4&here=5" -} - ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(45) "/this/is/a/very/deep/directory/structure/and/" -} - ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(53) "/this/is/a/very/deep/directory/structure/and/file.php" -} - ---> http://www.php.net:80/this/../a/../deep/directory: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(28) "/this/../a/../deep/directory" -} - ---> http://www.php.net:80/this/../a/../deep/directory/: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(29) "/this/../a/../deep/directory/" -} - ---> http://www.php.net:80/this/is/a/very/deep/directory/../file.php: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(42) "/this/is/a/very/deep/directory/../file.php" -} - ---> http://www.php.net:80/index.php: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" -} - ---> http://www.php.net:80/index.php?: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" -} - ---> http://www.php.net:80/#foo: array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" - ["fragment"]=> - string(3) "foo" -} - ---> http://www.php.net:80/?#: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" -} - ---> http://www.php.net:80/?test=1: array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" - ["query"]=> - string(6) "test=1" -} - ---> http://www.php.net/?test=1&: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(1) "/" - ["query"]=> - string(7) "test=1&" -} - ---> http://www.php.net:80/?&: array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(1) "/" - ["query"]=> - string(1) "&" -} - ---> http://www.php.net:80/index.php?test=1&: array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(7) "test=1&" -} - ---> http://www.php.net/index.php?&: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(1) "&" -} - ---> http://www.php.net:80/index.php?foo&: array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(4) "foo&" -} - ---> http://www.php.net/index.php?&foo: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(4) "&foo" -} - ---> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI: array(5) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" -} - ---> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(5) { - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - ---> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(6) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["user"]=> - string(6) "secret" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - ---> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - ---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(14) "secret@hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - ---> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hid:out" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - ---> nntp://news.php.net: array(2) { - ["scheme"]=> - string(4) "nntp" - ["host"]=> - string(12) "news.php.net" -} - ---> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz: array(3) { - ["scheme"]=> - string(3) "ftp" - ["host"]=> - string(11) "ftp.gnu.org" - ["path"]=> - string(22) "/gnu/glic/glibc.tar.gz" -} - ---> zlib:http://foo@bar: array(2) { - ["scheme"]=> - string(4) "zlib" - ["path"]=> - string(14) "http://foo@bar" -} - ---> zlib:filename.txt: array(2) { - ["scheme"]=> - string(4) "zlib" - ["path"]=> - string(12) "filename.txt" -} - ---> zlib:/path/to/my/file/file.txt: array(2) { - ["scheme"]=> - string(4) "zlib" - ["path"]=> - string(25) "/path/to/my/file/file.txt" -} - ---> foo://foo@bar: array(3) { - ["scheme"]=> - string(3) "foo" - ["host"]=> - string(3) "bar" - ["user"]=> - string(3) "foo" -} - ---> mailto:me@mydomain.com: array(2) { - ["scheme"]=> - string(6) "mailto" - ["path"]=> - string(15) "me@mydomain.com" -} - ---> /foo.php?a=b&c=d: array(2) { - ["path"]=> - string(8) "/foo.php" - ["query"]=> - string(7) "a=b&c=d" -} - ---> foo.php?a=b&c=d: array(2) { - ["path"]=> - string(7) "foo.php" - ["query"]=> - string(7) "a=b&c=d" -} - ---> http://user:passwd@www.example.com:8080?bar=1&boom=0: array(6) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(15) "www.example.com" - ["port"]=> - int(8080) - ["user"]=> - string(4) "user" - ["pass"]=> - string(6) "passwd" - ["query"]=> - string(12) "bar=1&boom=0" -} - ---> file:///path/to/file: array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(13) "/path/to/file" -} - ---> file://path/to/file: array(3) { - ["scheme"]=> - string(4) "file" - ["host"]=> - string(4) "path" - ["path"]=> - string(8) "/to/file" -} - ---> file:/path/to/file: array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(13) "/path/to/file" -} - ---> http://1.2.3.4:/abc.asp?a=1&b=2: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "1.2.3.4" - ["path"]=> - string(8) "/abc.asp" - ["query"]=> - string(7) "a=1&b=2" -} - ---> http://foo.com#bar: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(7) "foo.com" - ["fragment"]=> - string(3) "bar" -} - ---> scheme:: array(1) { - ["scheme"]=> - string(6) "scheme" -} - ---> foo+bar://baz@bang/bla: array(4) { - ["scheme"]=> - string(7) "foo+bar" - ["host"]=> - string(4) "bang" - ["user"]=> - string(3) "baz" - ["path"]=> - string(4) "/bla" -} - ---> gg:9130731: array(2) { - ["scheme"]=> - string(2) "gg" - ["path"]=> - string(7) "9130731" -} - ---> http://user:@pass@host/path?argument?value#etc: array(7) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(4) "host" - ["user"]=> - string(4) "user" - ["pass"]=> - string(5) "@pass" - ["path"]=> - string(5) "/path" - ["query"]=> - string(14) "argument?value" - ["fragment"]=> - string(3) "etc" -} - ---> http://10.10.10.10/:80: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "10.10.10.10" - ["path"]=> - string(4) "/:80" -} - ---> http://x:?: array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(1) "x" -} - ---> x:blah.com: array(2) { - ["scheme"]=> - string(1) "x" - ["path"]=> - string(8) "blah.com" -} - ---> x:/blah.com: array(2) { - ["scheme"]=> - string(1) "x" - ["path"]=> - string(9) "/blah.com" -} - ---> x://::abc/?: array(3) { - ["scheme"]=> - string(1) "x" - ["host"]=> - string(1) ":" - ["path"]=> - string(1) "/" -} - ---> http://::?: array(2) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(1) ":" -} - ---> x://::6.5: array(3) { - ["scheme"]=> - string(1) "x" - ["host"]=> - string(1) ":" - ["port"]=> - int(6) -} - ---> http://?:/: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(1) "?" - ["path"]=> - string(1) "/" -} - ---> http://@?:/: array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(1) "?" - ["user"]=> - string(0) "" - ["path"]=> - string(1) "/" -} - ---> file:///:: array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(2) "/:" -} - ---> file:///a:/: array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(3) "a:/" -} - ---> file:///ab:/: array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(5) "/ab:/" -} - ---> file:///a:/: array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(3) "a:/" -} - ---> file:///@:/: array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(3) "@:/" -} - ---> file:///:80/: array(2) { - ["scheme"]=> - string(4) "file" - ["path"]=> - string(5) "/:80/" -} - ---> []: array(1) { - ["path"]=> - string(2) "[]" -} - ---> http://[x:80]/: array(3) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(6) "[x:80]" - ["path"]=> - string(1) "/" -} - ---> : array(1) { - ["path"]=> - string(0) "" -} - ---> /: array(1) { - ["path"]=> - string(1) "/" -} - ---> http:///blah.com: -Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 -bool(false) - ---> http://:80: -Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 -bool(false) - ---> http://user@:80: -Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 -bool(false) - ---> http://user:pass@:80: -Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 -bool(false) - ---> http://:: -Warning: parse_url(http://:): Unable to parse URL in %s on line 15 -bool(false) - ---> http://@/: -Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 -bool(false) - ---> http://@:/: -Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 -bool(false) - ---> http://:/: -Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 -bool(false) - ---> http://?: -Warning: parse_url(http://?): Unable to parse URL in %s on line 15 -bool(false) - ---> http://?:: -Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 -bool(false) - ---> http://:?: -Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 -bool(false) - ---> http://blah.com:123456: -Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 -bool(false) - ---> http://blah.com:abcdef: -Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_002.phpt b/ext/standard/tests/url/parse_url_basic_002.phpt deleted file mode 100644 index e25ab8dcd1406..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_002.phpt +++ /dev/null @@ -1,151 +0,0 @@ ---TEST-- -Test parse_url() function: Parse a load of URLs without specifying PHP_URL_SCHEME as the URL component ---FILE-- - $url : "; - var_dump(parse_url($url, PHP_URL_SCHEME)); - -} - -echo "Done"; -?> ---EXPECTF-- ---> 64.246.30.37 : NULL ---> http://64.246.30.37 : string(4) "http" ---> http://64.246.30.37/ : string(4) "http" ---> 64.246.30.37/ : NULL ---> 64.246.30.37:80/ : NULL ---> php.net : NULL ---> php.net/ : NULL ---> http://php.net : string(4) "http" ---> http://php.net/ : string(4) "http" ---> www.php.net : NULL ---> www.php.net/ : NULL ---> http://www.php.net : string(4) "http" ---> http://www.php.net/ : string(4) "http" ---> www.php.net:80 : NULL ---> http://www.php.net:80 : string(4) "http" ---> http://www.php.net:80/ : string(4) "http" ---> http://www.php.net/index.php : string(4) "http" ---> www.php.net/? : NULL ---> www.php.net:80/? : NULL ---> http://www.php.net/? : string(4) "http" ---> http://www.php.net:80/? : string(4) "http" ---> http://www.php.net:80/index.php : string(4) "http" ---> http://www.php.net:80/foo/bar/index.php : string(4) "http" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(4) "http" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5 : string(4) "http" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : string(4) "http" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(4) "http" ---> http://www.php.net:80/this/../a/../deep/directory : string(4) "http" ---> http://www.php.net:80/this/../a/../deep/directory/ : string(4) "http" ---> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : string(4) "http" ---> http://www.php.net:80/index.php : string(4) "http" ---> http://www.php.net:80/index.php? : string(4) "http" ---> http://www.php.net:80/#foo : string(4) "http" ---> http://www.php.net:80/?# : string(4) "http" ---> http://www.php.net:80/?test=1 : string(4) "http" ---> http://www.php.net/?test=1& : string(4) "http" ---> http://www.php.net:80/?& : string(4) "http" ---> http://www.php.net:80/index.php?test=1& : string(4) "http" ---> http://www.php.net/index.php?& : string(4) "http" ---> http://www.php.net:80/index.php?foo& : string(4) "http" ---> http://www.php.net/index.php?&foo : string(4) "http" ---> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : string(4) "http" ---> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" ---> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" ---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" ---> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" ---> nntp://news.php.net : string(4) "nntp" ---> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(3) "ftp" ---> zlib:http://foo@bar : string(4) "zlib" ---> zlib:filename.txt : string(4) "zlib" ---> zlib:/path/to/my/file/file.txt : string(4) "zlib" ---> foo://foo@bar : string(3) "foo" ---> mailto:me@mydomain.com : string(6) "mailto" ---> /foo.php?a=b&c=d : NULL ---> foo.php?a=b&c=d : NULL ---> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(4) "http" ---> file:///path/to/file : string(4) "file" ---> file://path/to/file : string(4) "file" ---> file:/path/to/file : string(4) "file" ---> http://1.2.3.4:/abc.asp?a=1&b=2 : string(4) "http" ---> http://foo.com#bar : string(4) "http" ---> scheme: : string(6) "scheme" ---> foo+bar://baz@bang/bla : string(7) "foo+bar" ---> gg:9130731 : string(2) "gg" ---> http://user:@pass@host/path?argument?value#etc : string(4) "http" ---> http://10.10.10.10/:80 : string(4) "http" ---> http://x:? : string(4) "http" ---> x:blah.com : string(1) "x" ---> x:/blah.com : string(1) "x" ---> x://::abc/? : string(1) "x" ---> http://::? : string(4) "http" ---> x://::6.5 : string(1) "x" ---> http://?:/ : string(4) "http" ---> http://@?:/ : string(4) "http" ---> file:///: : string(4) "file" ---> file:///a:/ : string(4) "file" ---> file:///ab:/ : string(4) "file" ---> file:///a:/ : string(4) "file" ---> file:///@:/ : string(4) "file" ---> file:///:80/ : string(4) "file" ---> [] : NULL ---> http://[x:80]/ : string(4) "http" ---> : NULL ---> / : NULL ---> http:///blah.com : -Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 -bool(false) ---> http://:80 : -Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user@:80 : -Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user:pass@:80 : -Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://: : -Warning: parse_url(http://:): Unable to parse URL in %s on line 15 -bool(false) ---> http://@/ : -Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 -bool(false) ---> http://@:/ : -Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://:/ : -Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://? : -Warning: parse_url(http://?): Unable to parse URL in %s on line 15 -bool(false) ---> http://?: : -Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 -bool(false) ---> http://:? : -Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:123456 : -Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:abcdef : -Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_003.phpt b/ext/standard/tests/url/parse_url_basic_003.phpt deleted file mode 100644 index e34dc2d194302..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_003.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test parse_url() function: Parse a load of URLs without specifying PHP_URL_HOST as the URL component ---FILE-- - $url : "; - var_dump(parse_url($url, PHP_URL_HOST)); -} - -echo "Done"; -?> ---EXPECTF-- ---> 64.246.30.37 : NULL ---> http://64.246.30.37 : string(12) "64.246.30.37" ---> http://64.246.30.37/ : string(12) "64.246.30.37" ---> 64.246.30.37/ : NULL ---> 64.246.30.37:80/ : string(12) "64.246.30.37" ---> php.net : NULL ---> php.net/ : NULL ---> http://php.net : string(7) "php.net" ---> http://php.net/ : string(7) "php.net" ---> www.php.net : NULL ---> www.php.net/ : NULL ---> http://www.php.net : string(11) "www.php.net" ---> http://www.php.net/ : string(11) "www.php.net" ---> www.php.net:80 : string(11) "www.php.net" ---> http://www.php.net:80 : string(11) "www.php.net" ---> http://www.php.net:80/ : string(11) "www.php.net" ---> http://www.php.net/index.php : string(11) "www.php.net" ---> www.php.net/? : NULL ---> www.php.net:80/? : string(11) "www.php.net" ---> http://www.php.net/? : string(11) "www.php.net" ---> http://www.php.net:80/? : string(11) "www.php.net" ---> http://www.php.net:80/index.php : string(11) "www.php.net" ---> http://www.php.net:80/foo/bar/index.php : string(11) "www.php.net" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(11) "www.php.net" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5 : string(11) "www.php.net" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : string(11) "www.php.net" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(11) "www.php.net" ---> http://www.php.net:80/this/../a/../deep/directory : string(11) "www.php.net" ---> http://www.php.net:80/this/../a/../deep/directory/ : string(11) "www.php.net" ---> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : string(11) "www.php.net" ---> http://www.php.net:80/index.php : string(11) "www.php.net" ---> http://www.php.net:80/index.php? : string(11) "www.php.net" ---> http://www.php.net:80/#foo : string(11) "www.php.net" ---> http://www.php.net:80/?# : string(11) "www.php.net" ---> http://www.php.net:80/?test=1 : string(11) "www.php.net" ---> http://www.php.net/?test=1& : string(11) "www.php.net" ---> http://www.php.net:80/?& : string(11) "www.php.net" ---> http://www.php.net:80/index.php?test=1& : string(11) "www.php.net" ---> http://www.php.net/index.php?& : string(11) "www.php.net" ---> http://www.php.net:80/index.php?foo& : string(11) "www.php.net" ---> http://www.php.net/index.php?&foo : string(11) "www.php.net" ---> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : string(11) "www.php.net" ---> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" ---> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" ---> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" ---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" ---> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" ---> nntp://news.php.net : string(12) "news.php.net" ---> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(11) "ftp.gnu.org" ---> zlib:http://foo@bar : NULL ---> zlib:filename.txt : NULL ---> zlib:/path/to/my/file/file.txt : NULL ---> foo://foo@bar : string(3) "bar" ---> mailto:me@mydomain.com : NULL ---> /foo.php?a=b&c=d : NULL ---> foo.php?a=b&c=d : NULL ---> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(15) "www.example.com" ---> file:///path/to/file : NULL ---> file://path/to/file : string(4) "path" ---> file:/path/to/file : NULL ---> http://1.2.3.4:/abc.asp?a=1&b=2 : string(7) "1.2.3.4" ---> http://foo.com#bar : string(7) "foo.com" ---> scheme: : NULL ---> foo+bar://baz@bang/bla : string(4) "bang" ---> gg:9130731 : NULL ---> http://user:@pass@host/path?argument?value#etc : string(4) "host" ---> http://10.10.10.10/:80 : string(11) "10.10.10.10" ---> http://x:? : string(1) "x" ---> x:blah.com : NULL ---> x:/blah.com : NULL ---> x://::abc/? : string(1) ":" ---> http://::? : string(1) ":" ---> x://::6.5 : string(1) ":" ---> http://?:/ : string(1) "?" ---> http://@?:/ : string(1) "?" ---> file:///: : NULL ---> file:///a:/ : NULL ---> file:///ab:/ : NULL ---> file:///a:/ : NULL ---> file:///@:/ : NULL ---> file:///:80/ : NULL ---> [] : NULL ---> http://[x:80]/ : string(6) "[x:80]" ---> : NULL ---> / : NULL ---> http:///blah.com : -Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 -bool(false) ---> http://:80 : -Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user@:80 : -Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user:pass@:80 : -Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://: : -Warning: parse_url(http://:): Unable to parse URL in %s on line 15 -bool(false) ---> http://@/ : -Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 -bool(false) ---> http://@:/ : -Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://:/ : -Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://? : -Warning: parse_url(http://?): Unable to parse URL in %s on line 15 -bool(false) ---> http://?: : -Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 -bool(false) ---> http://:? : -Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:123456 : -Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:abcdef : -Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_004.phpt b/ext/standard/tests/url/parse_url_basic_004.phpt deleted file mode 100644 index af327954700c7..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_004.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PORT as the URL component ---FILE-- - $url : "; - var_dump(parse_url($url, PHP_URL_PORT)); -} - -echo "Done"; -?> ---EXPECTF-- ---> 64.246.30.37 : NULL ---> http://64.246.30.37 : NULL ---> http://64.246.30.37/ : NULL ---> 64.246.30.37/ : NULL ---> 64.246.30.37:80/ : int(80) ---> php.net : NULL ---> php.net/ : NULL ---> http://php.net : NULL ---> http://php.net/ : NULL ---> www.php.net : NULL ---> www.php.net/ : NULL ---> http://www.php.net : NULL ---> http://www.php.net/ : NULL ---> www.php.net:80 : int(80) ---> http://www.php.net:80 : int(80) ---> http://www.php.net:80/ : int(80) ---> http://www.php.net/index.php : NULL ---> www.php.net/? : NULL ---> www.php.net:80/? : int(80) ---> http://www.php.net/? : NULL ---> http://www.php.net:80/? : int(80) ---> http://www.php.net:80/index.php : int(80) ---> http://www.php.net:80/foo/bar/index.php : int(80) ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : int(80) ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5 : int(80) ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : int(80) ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : int(80) ---> http://www.php.net:80/this/../a/../deep/directory : int(80) ---> http://www.php.net:80/this/../a/../deep/directory/ : int(80) ---> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : int(80) ---> http://www.php.net:80/index.php : int(80) ---> http://www.php.net:80/index.php? : int(80) ---> http://www.php.net:80/#foo : int(80) ---> http://www.php.net:80/?# : int(80) ---> http://www.php.net:80/?test=1 : int(80) ---> http://www.php.net/?test=1& : NULL ---> http://www.php.net:80/?& : int(80) ---> http://www.php.net:80/index.php?test=1& : int(80) ---> http://www.php.net/index.php?& : NULL ---> http://www.php.net:80/index.php?foo& : int(80) ---> http://www.php.net/index.php?&foo : NULL ---> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : int(80) ---> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) ---> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) ---> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) ---> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) ---> nntp://news.php.net : NULL ---> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL ---> zlib:http://foo@bar : NULL ---> zlib:filename.txt : NULL ---> zlib:/path/to/my/file/file.txt : NULL ---> foo://foo@bar : NULL ---> mailto:me@mydomain.com : NULL ---> /foo.php?a=b&c=d : NULL ---> foo.php?a=b&c=d : NULL ---> http://user:passwd@www.example.com:8080?bar=1&boom=0 : int(8080) ---> file:///path/to/file : NULL ---> file://path/to/file : NULL ---> file:/path/to/file : NULL ---> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL ---> http://foo.com#bar : NULL ---> scheme: : NULL ---> foo+bar://baz@bang/bla : NULL ---> gg:9130731 : NULL ---> http://user:@pass@host/path?argument?value#etc : NULL ---> http://10.10.10.10/:80 : NULL ---> http://x:? : NULL ---> x:blah.com : NULL ---> x:/blah.com : NULL ---> x://::abc/? : NULL ---> http://::? : NULL ---> x://::6.5 : int(6) ---> http://?:/ : NULL ---> http://@?:/ : NULL ---> file:///: : NULL ---> file:///a:/ : NULL ---> file:///ab:/ : NULL ---> file:///a:/ : NULL ---> file:///@:/ : NULL ---> file:///:80/ : NULL ---> [] : NULL ---> http://[x:80]/ : NULL ---> : NULL ---> / : NULL ---> http:///blah.com : -Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 -bool(false) ---> http://:80 : -Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user@:80 : -Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user:pass@:80 : -Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://: : -Warning: parse_url(http://:): Unable to parse URL in %s on line 15 -bool(false) ---> http://@/ : -Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 -bool(false) ---> http://@:/ : -Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://:/ : -Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://? : -Warning: parse_url(http://?): Unable to parse URL in %s on line 15 -bool(false) ---> http://?: : -Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 -bool(false) ---> http://:? : -Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:123456 : -Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:abcdef : -Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_005.phpt b/ext/standard/tests/url/parse_url_basic_005.phpt deleted file mode 100644 index 5eb2541c110ac..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_005.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test parse_url() function: Parse a load of URLs without specifying PHP_URL_USER as the URL component ---FILE-- - $url : "; - var_dump(parse_url($url, PHP_URL_USER)); -} - -echo "Done"; -?> ---EXPECTF-- ---> 64.246.30.37 : NULL ---> http://64.246.30.37 : NULL ---> http://64.246.30.37/ : NULL ---> 64.246.30.37/ : NULL ---> 64.246.30.37:80/ : NULL ---> php.net : NULL ---> php.net/ : NULL ---> http://php.net : NULL ---> http://php.net/ : NULL ---> www.php.net : NULL ---> www.php.net/ : NULL ---> http://www.php.net : NULL ---> http://www.php.net/ : NULL ---> www.php.net:80 : NULL ---> http://www.php.net:80 : NULL ---> http://www.php.net:80/ : NULL ---> http://www.php.net/index.php : NULL ---> www.php.net/? : NULL ---> www.php.net:80/? : NULL ---> http://www.php.net/? : NULL ---> http://www.php.net:80/? : NULL ---> http://www.php.net:80/index.php : NULL ---> http://www.php.net:80/foo/bar/index.php : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5 : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL ---> http://www.php.net:80/this/../a/../deep/directory : NULL ---> http://www.php.net:80/this/../a/../deep/directory/ : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL ---> http://www.php.net:80/index.php : NULL ---> http://www.php.net:80/index.php? : NULL ---> http://www.php.net:80/#foo : NULL ---> http://www.php.net:80/?# : NULL ---> http://www.php.net:80/?test=1 : NULL ---> http://www.php.net/?test=1& : NULL ---> http://www.php.net:80/?& : NULL ---> http://www.php.net:80/index.php?test=1& : NULL ---> http://www.php.net/index.php?& : NULL ---> http://www.php.net:80/index.php?foo& : NULL ---> http://www.php.net/index.php?&foo : NULL ---> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL ---> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" ---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(14) "secret@hideout" ---> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" ---> nntp://news.php.net : NULL ---> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL ---> zlib:http://foo@bar : NULL ---> zlib:filename.txt : NULL ---> zlib:/path/to/my/file/file.txt : NULL ---> foo://foo@bar : string(3) "foo" ---> mailto:me@mydomain.com : NULL ---> /foo.php?a=b&c=d : NULL ---> foo.php?a=b&c=d : NULL ---> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(4) "user" ---> file:///path/to/file : NULL ---> file://path/to/file : NULL ---> file:/path/to/file : NULL ---> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL ---> http://foo.com#bar : NULL ---> scheme: : NULL ---> foo+bar://baz@bang/bla : string(3) "baz" ---> gg:9130731 : NULL ---> http://user:@pass@host/path?argument?value#etc : string(4) "user" ---> http://10.10.10.10/:80 : NULL ---> http://x:? : NULL ---> x:blah.com : NULL ---> x:/blah.com : NULL ---> x://::abc/? : NULL ---> http://::? : NULL ---> x://::6.5 : NULL ---> http://?:/ : NULL ---> http://@?:/ : string(0) "" ---> file:///: : NULL ---> file:///a:/ : NULL ---> file:///ab:/ : NULL ---> file:///a:/ : NULL ---> file:///@:/ : NULL ---> file:///:80/ : NULL ---> [] : NULL ---> http://[x:80]/ : NULL ---> : NULL ---> / : NULL ---> http:///blah.com : -Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 -bool(false) ---> http://:80 : -Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user@:80 : -Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user:pass@:80 : -Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://: : -Warning: parse_url(http://:): Unable to parse URL in %s on line 15 -bool(false) ---> http://@/ : -Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 -bool(false) ---> http://@:/ : -Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://:/ : -Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://? : -Warning: parse_url(http://?): Unable to parse URL in %s on line 15 -bool(false) ---> http://?: : -Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 -bool(false) ---> http://:? : -Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:123456 : -Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:abcdef : -Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_006.phpt b/ext/standard/tests/url/parse_url_basic_006.phpt deleted file mode 100644 index 926200a1a0a33..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_006.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PASS as the URL component ---FILE-- - $url : "; - var_dump(parse_url($url, PHP_URL_PASS)); -} - -echo "Done"; -?> ---EXPECTF-- ---> 64.246.30.37 : NULL ---> http://64.246.30.37 : NULL ---> http://64.246.30.37/ : NULL ---> 64.246.30.37/ : NULL ---> 64.246.30.37:80/ : NULL ---> php.net : NULL ---> php.net/ : NULL ---> http://php.net : NULL ---> http://php.net/ : NULL ---> www.php.net : NULL ---> www.php.net/ : NULL ---> http://www.php.net : NULL ---> http://www.php.net/ : NULL ---> www.php.net:80 : NULL ---> http://www.php.net:80 : NULL ---> http://www.php.net:80/ : NULL ---> http://www.php.net/index.php : NULL ---> www.php.net/? : NULL ---> www.php.net:80/? : NULL ---> http://www.php.net/? : NULL ---> http://www.php.net:80/? : NULL ---> http://www.php.net:80/index.php : NULL ---> http://www.php.net:80/foo/bar/index.php : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5 : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL ---> http://www.php.net:80/this/../a/../deep/directory : NULL ---> http://www.php.net:80/this/../a/../deep/directory/ : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL ---> http://www.php.net:80/index.php : NULL ---> http://www.php.net:80/index.php? : NULL ---> http://www.php.net:80/#foo : NULL ---> http://www.php.net:80/?# : NULL ---> http://www.php.net:80/?test=1 : NULL ---> http://www.php.net/?test=1& : NULL ---> http://www.php.net:80/?& : NULL ---> http://www.php.net:80/index.php?test=1& : NULL ---> http://www.php.net/index.php?& : NULL ---> http://www.php.net:80/index.php?foo& : NULL ---> http://www.php.net/index.php?&foo : NULL ---> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL ---> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" ---> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" ---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hid:out" ---> nntp://news.php.net : NULL ---> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL ---> zlib:http://foo@bar : NULL ---> zlib:filename.txt : NULL ---> zlib:/path/to/my/file/file.txt : NULL ---> foo://foo@bar : NULL ---> mailto:me@mydomain.com : NULL ---> /foo.php?a=b&c=d : NULL ---> foo.php?a=b&c=d : NULL ---> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(6) "passwd" ---> file:///path/to/file : NULL ---> file://path/to/file : NULL ---> file:/path/to/file : NULL ---> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL ---> http://foo.com#bar : NULL ---> scheme: : NULL ---> foo+bar://baz@bang/bla : NULL ---> gg:9130731 : NULL ---> http://user:@pass@host/path?argument?value#etc : string(5) "@pass" ---> http://10.10.10.10/:80 : NULL ---> http://x:? : NULL ---> x:blah.com : NULL ---> x:/blah.com : NULL ---> x://::abc/? : NULL ---> http://::? : NULL ---> x://::6.5 : NULL ---> http://?:/ : NULL ---> http://@?:/ : NULL ---> file:///: : NULL ---> file:///a:/ : NULL ---> file:///ab:/ : NULL ---> file:///a:/ : NULL ---> file:///@:/ : NULL ---> file:///:80/ : NULL ---> [] : NULL ---> http://[x:80]/ : NULL ---> : NULL ---> / : NULL ---> http:///blah.com : -Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 -bool(false) ---> http://:80 : -Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user@:80 : -Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user:pass@:80 : -Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://: : -Warning: parse_url(http://:): Unable to parse URL in %s on line 15 -bool(false) ---> http://@/ : -Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 -bool(false) ---> http://@:/ : -Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://:/ : -Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://? : -Warning: parse_url(http://?): Unable to parse URL in %s on line 15 -bool(false) ---> http://?: : -Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 -bool(false) ---> http://:? : -Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:123456 : -Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:abcdef : -Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_007.phpt b/ext/standard/tests/url/parse_url_basic_007.phpt deleted file mode 100644 index d99ccb66741ae..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_007.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PATH as the URL component ---FILE-- - $url : "; - var_dump(parse_url($url, PHP_URL_PATH)); -} - -echo "Done"; -?> ---EXPECTF-- ---> 64.246.30.37 : string(12) "64.246.30.37" ---> http://64.246.30.37 : NULL ---> http://64.246.30.37/ : string(1) "/" ---> 64.246.30.37/ : string(13) "64.246.30.37/" ---> 64.246.30.37:80/ : string(1) "/" ---> php.net : string(7) "php.net" ---> php.net/ : string(8) "php.net/" ---> http://php.net : NULL ---> http://php.net/ : string(1) "/" ---> www.php.net : string(11) "www.php.net" ---> www.php.net/ : string(12) "www.php.net/" ---> http://www.php.net : NULL ---> http://www.php.net/ : string(1) "/" ---> www.php.net:80 : NULL ---> http://www.php.net:80 : NULL ---> http://www.php.net:80/ : string(1) "/" ---> http://www.php.net/index.php : string(10) "/index.php" ---> www.php.net/? : string(12) "www.php.net/" ---> www.php.net:80/? : string(1) "/" ---> http://www.php.net/? : string(1) "/" ---> http://www.php.net:80/? : string(1) "/" ---> http://www.php.net:80/index.php : string(10) "/index.php" ---> http://www.php.net:80/foo/bar/index.php : string(18) "/foo/bar/index.php" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(53) "/this/is/a/very/deep/directory/structure/and/file.php" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5 : string(53) "/this/is/a/very/deep/directory/structure/and/file.php" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : string(45) "/this/is/a/very/deep/directory/structure/and/" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : string(53) "/this/is/a/very/deep/directory/structure/and/file.php" ---> http://www.php.net:80/this/../a/../deep/directory : string(28) "/this/../a/../deep/directory" ---> http://www.php.net:80/this/../a/../deep/directory/ : string(29) "/this/../a/../deep/directory/" ---> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : string(42) "/this/is/a/very/deep/directory/../file.php" ---> http://www.php.net:80/index.php : string(10) "/index.php" ---> http://www.php.net:80/index.php? : string(10) "/index.php" ---> http://www.php.net:80/#foo : string(1) "/" ---> http://www.php.net:80/?# : string(1) "/" ---> http://www.php.net:80/?test=1 : string(1) "/" ---> http://www.php.net/?test=1& : string(1) "/" ---> http://www.php.net:80/?& : string(1) "/" ---> http://www.php.net:80/index.php?test=1& : string(10) "/index.php" ---> http://www.php.net/index.php?& : string(10) "/index.php" ---> http://www.php.net:80/index.php?foo& : string(10) "/index.php" ---> http://www.php.net/index.php?&foo : string(10) "/index.php" ---> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : string(10) "/index.php" ---> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" ---> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" ---> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" ---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" ---> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" ---> nntp://news.php.net : NULL ---> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(22) "/gnu/glic/glibc.tar.gz" ---> zlib:http://foo@bar : string(14) "http://foo@bar" ---> zlib:filename.txt : string(12) "filename.txt" ---> zlib:/path/to/my/file/file.txt : string(25) "/path/to/my/file/file.txt" ---> foo://foo@bar : NULL ---> mailto:me@mydomain.com : string(15) "me@mydomain.com" ---> /foo.php?a=b&c=d : string(8) "/foo.php" ---> foo.php?a=b&c=d : string(7) "foo.php" ---> http://user:passwd@www.example.com:8080?bar=1&boom=0 : NULL ---> file:///path/to/file : string(13) "/path/to/file" ---> file://path/to/file : string(8) "/to/file" ---> file:/path/to/file : string(13) "/path/to/file" ---> http://1.2.3.4:/abc.asp?a=1&b=2 : string(8) "/abc.asp" ---> http://foo.com#bar : NULL ---> scheme: : NULL ---> foo+bar://baz@bang/bla : string(4) "/bla" ---> gg:9130731 : string(7) "9130731" ---> http://user:@pass@host/path?argument?value#etc : string(5) "/path" ---> http://10.10.10.10/:80 : string(4) "/:80" ---> http://x:? : NULL ---> x:blah.com : string(8) "blah.com" ---> x:/blah.com : string(9) "/blah.com" ---> x://::abc/? : string(1) "/" ---> http://::? : NULL ---> x://::6.5 : NULL ---> http://?:/ : string(1) "/" ---> http://@?:/ : string(1) "/" ---> file:///: : string(2) "/:" ---> file:///a:/ : string(3) "a:/" ---> file:///ab:/ : string(5) "/ab:/" ---> file:///a:/ : string(3) "a:/" ---> file:///@:/ : string(3) "@:/" ---> file:///:80/ : string(5) "/:80/" ---> [] : string(2) "[]" ---> http://[x:80]/ : string(1) "/" ---> : string(0) "" ---> / : string(1) "/" ---> http:///blah.com : -Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 -bool(false) ---> http://:80 : -Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user@:80 : -Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user:pass@:80 : -Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://: : -Warning: parse_url(http://:): Unable to parse URL in %s on line 15 -bool(false) ---> http://@/ : -Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 -bool(false) ---> http://@:/ : -Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://:/ : -Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://? : -Warning: parse_url(http://?): Unable to parse URL in %s on line 15 -bool(false) ---> http://?: : -Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 -bool(false) ---> http://:? : -Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:123456 : -Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:abcdef : -Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_008.phpt b/ext/standard/tests/url/parse_url_basic_008.phpt deleted file mode 100644 index d2d2ebb594c77..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_008.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test parse_url() function: Parse a load of URLs without specifying PHP_URL_QUERY as the URL component ---FILE-- - $url : "; - var_dump(parse_url($url, PHP_URL_QUERY)); -} - -echo "Done"; -?> ---EXPECTF-- ---> 64.246.30.37 : NULL ---> http://64.246.30.37 : NULL ---> http://64.246.30.37/ : NULL ---> 64.246.30.37/ : NULL ---> 64.246.30.37:80/ : NULL ---> php.net : NULL ---> php.net/ : NULL ---> http://php.net : NULL ---> http://php.net/ : NULL ---> www.php.net : NULL ---> www.php.net/ : NULL ---> http://www.php.net : NULL ---> http://www.php.net/ : NULL ---> www.php.net:80 : NULL ---> http://www.php.net:80 : NULL ---> http://www.php.net:80/ : NULL ---> http://www.php.net/index.php : NULL ---> www.php.net/? : NULL ---> www.php.net:80/? : NULL ---> http://www.php.net/? : NULL ---> http://www.php.net:80/? : NULL ---> http://www.php.net:80/index.php : NULL ---> http://www.php.net:80/foo/bar/index.php : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5 : string(37) "lots=1&of=2¶meters=3&too=4&here=5" ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL ---> http://www.php.net:80/this/../a/../deep/directory : NULL ---> http://www.php.net:80/this/../a/../deep/directory/ : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL ---> http://www.php.net:80/index.php : NULL ---> http://www.php.net:80/index.php? : NULL ---> http://www.php.net:80/#foo : NULL ---> http://www.php.net:80/?# : NULL ---> http://www.php.net:80/?test=1 : string(6) "test=1" ---> http://www.php.net/?test=1& : string(7) "test=1&" ---> http://www.php.net:80/?& : string(1) "&" ---> http://www.php.net:80/index.php?test=1& : string(7) "test=1&" ---> http://www.php.net/index.php?& : string(1) "&" ---> http://www.php.net:80/index.php?foo& : string(4) "foo&" ---> http://www.php.net/index.php?&foo : string(4) "&foo" ---> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : string(31) "test=1&test2=char&test3=mixesCI" ---> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" ---> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" ---> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" ---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" ---> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" ---> nntp://news.php.net : NULL ---> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL ---> zlib:http://foo@bar : NULL ---> zlib:filename.txt : NULL ---> zlib:/path/to/my/file/file.txt : NULL ---> foo://foo@bar : NULL ---> mailto:me@mydomain.com : NULL ---> /foo.php?a=b&c=d : string(7) "a=b&c=d" ---> foo.php?a=b&c=d : string(7) "a=b&c=d" ---> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(12) "bar=1&boom=0" ---> file:///path/to/file : NULL ---> file://path/to/file : NULL ---> file:/path/to/file : NULL ---> http://1.2.3.4:/abc.asp?a=1&b=2 : string(7) "a=1&b=2" ---> http://foo.com#bar : NULL ---> scheme: : NULL ---> foo+bar://baz@bang/bla : NULL ---> gg:9130731 : NULL ---> http://user:@pass@host/path?argument?value#etc : string(14) "argument?value" ---> http://10.10.10.10/:80 : NULL ---> http://x:? : NULL ---> x:blah.com : NULL ---> x:/blah.com : NULL ---> x://::abc/? : NULL ---> http://::? : NULL ---> x://::6.5 : NULL ---> http://?:/ : NULL ---> http://@?:/ : NULL ---> file:///: : NULL ---> file:///a:/ : NULL ---> file:///ab:/ : NULL ---> file:///a:/ : NULL ---> file:///@:/ : NULL ---> file:///:80/ : NULL ---> [] : NULL ---> http://[x:80]/ : NULL ---> : NULL ---> / : NULL ---> http:///blah.com : -Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 -bool(false) ---> http://:80 : -Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user@:80 : -Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user:pass@:80 : -Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://: : -Warning: parse_url(http://:): Unable to parse URL in %s on line 15 -bool(false) ---> http://@/ : -Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 -bool(false) ---> http://@:/ : -Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://:/ : -Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://? : -Warning: parse_url(http://?): Unable to parse URL in %s on line 15 -bool(false) ---> http://?: : -Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 -bool(false) ---> http://:? : -Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:123456 : -Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:abcdef : -Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_009.phpt b/ext/standard/tests/url/parse_url_basic_009.phpt deleted file mode 100644 index b23a30edfc020..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_009.phpt +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -Test parse_url() function: Parse a load of URLs without specifying PHP_URL_FRAGMENT as the URL component ---FILE-- - $url : "; - var_dump(parse_url($url, PHP_URL_FRAGMENT)); -} - -echo "Done"; -?> ---EXPECTF-- ---> 64.246.30.37 : NULL ---> http://64.246.30.37 : NULL ---> http://64.246.30.37/ : NULL ---> 64.246.30.37/ : NULL ---> 64.246.30.37:80/ : NULL ---> php.net : NULL ---> php.net/ : NULL ---> http://php.net : NULL ---> http://php.net/ : NULL ---> www.php.net : NULL ---> www.php.net/ : NULL ---> http://www.php.net : NULL ---> http://www.php.net/ : NULL ---> www.php.net:80 : NULL ---> http://www.php.net:80 : NULL ---> http://www.php.net:80/ : NULL ---> http://www.php.net/index.php : NULL ---> www.php.net/? : NULL ---> www.php.net:80/? : NULL ---> http://www.php.net/? : NULL ---> http://www.php.net:80/? : NULL ---> http://www.php.net:80/index.php : NULL ---> http://www.php.net:80/foo/bar/index.php : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5 : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/ : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php : NULL ---> http://www.php.net:80/this/../a/../deep/directory : NULL ---> http://www.php.net:80/this/../a/../deep/directory/ : NULL ---> http://www.php.net:80/this/is/a/very/deep/directory/../file.php : NULL ---> http://www.php.net:80/index.php : NULL ---> http://www.php.net:80/index.php? : NULL ---> http://www.php.net:80/#foo : string(3) "foo" ---> http://www.php.net:80/?# : NULL ---> http://www.php.net:80/?test=1 : NULL ---> http://www.php.net/?test=1& : NULL ---> http://www.php.net:80/?& : NULL ---> http://www.php.net:80/index.php?test=1& : NULL ---> http://www.php.net/index.php?& : NULL ---> http://www.php.net:80/index.php?foo& : NULL ---> http://www.php.net/index.php?&foo : NULL ---> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL ---> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" ---> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" ---> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" ---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" ---> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" ---> nntp://news.php.net : NULL ---> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL ---> zlib:http://foo@bar : NULL ---> zlib:filename.txt : NULL ---> zlib:/path/to/my/file/file.txt : NULL ---> foo://foo@bar : NULL ---> mailto:me@mydomain.com : NULL ---> /foo.php?a=b&c=d : NULL ---> foo.php?a=b&c=d : NULL ---> http://user:passwd@www.example.com:8080?bar=1&boom=0 : NULL ---> file:///path/to/file : NULL ---> file://path/to/file : NULL ---> file:/path/to/file : NULL ---> http://1.2.3.4:/abc.asp?a=1&b=2 : NULL ---> http://foo.com#bar : string(3) "bar" ---> scheme: : NULL ---> foo+bar://baz@bang/bla : NULL ---> gg:9130731 : NULL ---> http://user:@pass@host/path?argument?value#etc : string(3) "etc" ---> http://10.10.10.10/:80 : NULL ---> http://x:? : NULL ---> x:blah.com : NULL ---> x:/blah.com : NULL ---> x://::abc/? : NULL ---> http://::? : NULL ---> x://::6.5 : NULL ---> http://?:/ : NULL ---> http://@?:/ : NULL ---> file:///: : NULL ---> file:///a:/ : NULL ---> file:///ab:/ : NULL ---> file:///a:/ : NULL ---> file:///@:/ : NULL ---> file:///:80/ : NULL ---> [] : NULL ---> http://[x:80]/ : NULL ---> : NULL ---> / : NULL ---> http:///blah.com : -Warning: parse_url(http:///blah.com): Unable to parse URL in %s on line 15 -bool(false) ---> http://:80 : -Warning: parse_url(http://:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user@:80 : -Warning: parse_url(http://user@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://user:pass@:80 : -Warning: parse_url(http://user:pass@:80): Unable to parse URL in %s on line 15 -bool(false) ---> http://: : -Warning: parse_url(http://:): Unable to parse URL in %s on line 15 -bool(false) ---> http://@/ : -Warning: parse_url(http://@/): Unable to parse URL in %s on line 15 -bool(false) ---> http://@:/ : -Warning: parse_url(http://@:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://:/ : -Warning: parse_url(http://:/): Unable to parse URL in %s on line 15 -bool(false) ---> http://? : -Warning: parse_url(http://?): Unable to parse URL in %s on line 15 -bool(false) ---> http://?: : -Warning: parse_url(http://?:): Unable to parse URL in %s on line 15 -bool(false) ---> http://:? : -Warning: parse_url(http://:?): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:123456 : -Warning: parse_url(http://blah.com:123456): Unable to parse URL in %s on line 15 -bool(false) ---> http://blah.com:abcdef : -Warning: parse_url(http://blah.com:abcdef): Unable to parse URL in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_basic_010.phpt b/ext/standard/tests/url/parse_url_basic_010.phpt deleted file mode 100644 index 3bb2dba14254b..0000000000000 --- a/ext/standard/tests/url/parse_url_basic_010.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Test parse_url() function : check values of URL related constants ---FILE-- - $constantValue) { - if (strpos($constantName, 'PHP_URL')===0) { - echo "$constantName: $constantValue \n"; - } -} - -echo "Done"; -?> ---EXPECTF-- -PHP_URL_SCHEME: 0 -PHP_URL_HOST: 1 -PHP_URL_PORT: 2 -PHP_URL_USER: 3 -PHP_URL_PASS: 4 -PHP_URL_PATH: 5 -PHP_URL_QUERY: 6 -PHP_URL_FRAGMENT: 7 -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_error_001.phpt b/ext/standard/tests/url/parse_url_error_001.phpt deleted file mode 100644 index 0280a87cbc761..0000000000000 --- a/ext/standard/tests/url/parse_url_error_001.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Test parse_url() function : error conditions - wrong number of args ---FILE-- - ---EXPECTF-- -*** Testing parse_url() : error conditions *** - --- Testing parse_url() function with Zero arguments -- - -Warning: parse_url() expects at least 1 parameter, 0 given in %s on line 12 -NULL - --- Testing parse_url() function with more than expected no. of arguments -- - -Warning: parse_url() expects at most 2 parameters, 3 given in %s on line 19 -NULL -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_error_002.phpt b/ext/standard/tests/url/parse_url_error_002.phpt deleted file mode 100644 index 45c20f410d9ce..0000000000000 --- a/ext/standard/tests/url/parse_url_error_002.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test parse_url() function: url component specifier out of range ---FILE-- - Below range:"; -var_dump(parse_url($url, -1)); - -echo "\n\n--> Above range:"; -var_dump(parse_url($url, 99)); - -echo "Done" -?> ---EXPECTF-- -*** Testing parse_url() : error conditions: url component specifier out of range *** ---> Below range:array(8) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - - ---> Above range: -Warning: parse_url(): Invalid URL component identifier 99 in %s on line 15 -bool(false) -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_variation_001.phpt b/ext/standard/tests/url/parse_url_variation_001.phpt deleted file mode 100644 index 18ef0a547b56a..0000000000000 --- a/ext/standard/tests/url/parse_url_variation_001.phpt +++ /dev/null @@ -1,221 +0,0 @@ ---TEST-- -Test parse_url() function : usage variations - unexpected type for arg 1. ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for url - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( parse_url($value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing parse_url() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(60) -Error: 8 - Undefined variable: unset_var, %s(63) - -Arg value 0 -array(1) { - ["path"]=> - string(1) "0" -} - -Arg value 1 -array(1) { - ["path"]=> - string(1) "1" -} - -Arg value 12345 -array(1) { - ["path"]=> - string(5) "12345" -} - -Arg value -2345 -array(1) { - ["path"]=> - string(5) "-2345" -} - -Arg value 10.5 -array(1) { - ["path"]=> - string(4) "10.5" -} - -Arg value -10.5 -array(1) { - ["path"]=> - string(5) "-10.5" -} - -Arg value 101234567000 -array(1) { - ["path"]=> - string(12) "101234567000" -} - -Arg value 1.07654321E-9 -array(1) { - ["path"]=> - string(13) "1.07654321E-9" -} - -Arg value 0.5 -array(1) { - ["path"]=> - string(3) "0.5" -} - -Arg value Array -Error: 2 - parse_url() expects parameter 1 to be string, array given, %s(70) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 1 to be string, array given, %s(70) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 1 to be string, array given, %s(70) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 1 to be string, array given, %s(70) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 1 to be string, array given, %s(70) -NULL - -Arg value -array(1) { - ["path"]=> - string(0) "" -} - -Arg value -array(1) { - ["path"]=> - string(0) "" -} - -Arg value 1 -array(1) { - ["path"]=> - string(1) "1" -} - -Arg value -array(1) { - ["path"]=> - string(0) "" -} - -Arg value 1 -array(1) { - ["path"]=> - string(1) "1" -} - -Arg value -array(1) { - ["path"]=> - string(0) "" -} - -Arg value -array(1) { - ["path"]=> - string(0) "" -} - -Arg value -array(1) { - ["path"]=> - string(0) "" -} -Error: 4096 - Object of class stdClass could not be converted to string, %s(69) - -Arg value -Error: 2 - parse_url() expects parameter 1 to be string, object given, %s(70) -NULL - -Arg value -array(1) { - ["path"]=> - string(0) "" -} - -Arg value -array(1) { - ["path"]=> - string(0) "" -} -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_variation_002_32bit.phpt b/ext/standard/tests/url/parse_url_variation_002_32bit.phpt deleted file mode 100644 index 88971e9642788..0000000000000 --- a/ext/standard/tests/url/parse_url_variation_002_32bit.phpt +++ /dev/null @@ -1,200 +0,0 @@ ---TEST-- -Test parse_url() function : usage variations - unexpected type for arg 2. ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for url_component - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( parse_url($url, $value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing parse_url() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(61) -Error: 8 - Undefined variable: unset_var, %s(64) - -Arg value 10.5 -Error: 2 - parse_url(): Invalid URL component identifier 10, %s(71) -bool(false) - -Arg value -10.5 -array(8) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - -Arg value 101234567000 -array(8) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - -Arg value 1.07654321E-9 -string(4) "http" - -Arg value 0.5 -string(4) "http" - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value -string(4) "http" - -Arg value -string(4) "http" - -Arg value 1 -string(11) "www.php.net" - -Arg value -string(4) "http" - -Arg value 1 -string(11) "www.php.net" - -Arg value -string(4) "http" - -Arg value -Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) -NULL - -Arg value -Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) -NULL - -Arg value string -Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) -NULL - -Arg value string -Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) -NULL -Error: 4096 - Object of class stdClass could not be converted to string, %s(70) - -Arg value -Error: 2 - parse_url() expects parameter 2 to be long, object given, %s(71) -NULL - -Arg value -string(4) "http" - -Arg value -string(4) "http" -Done \ No newline at end of file diff --git a/ext/standard/tests/url/parse_url_variation_002_64bit.phpt b/ext/standard/tests/url/parse_url_variation_002_64bit.phpt deleted file mode 100644 index 561a43353e3eb..0000000000000 --- a/ext/standard/tests/url/parse_url_variation_002_64bit.phpt +++ /dev/null @@ -1,184 +0,0 @@ ---TEST-- -Test parse_url() function : usage variations - unexpected type for arg 2. ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for url_component - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( parse_url($url, $value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing parse_url() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(61) -Error: 8 - Undefined variable: unset_var, %s(64) - -Arg value 10.5 -Error: 2 - parse_url(): Invalid URL component identifier 10, %s(71) -bool(false) - -Arg value -10.5 -array(8) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(11) "www.php.net" - ["port"]=> - int(80) - ["user"]=> - string(6) "secret" - ["pass"]=> - string(7) "hideout" - ["path"]=> - string(10) "/index.php" - ["query"]=> - string(31) "test=1&test2=char&test3=mixesCI" - ["fragment"]=> - string(16) "some_page_ref123" -} - -Arg value 101234567000 -Error: 2 - parse_url(): Invalid URL component identifier 101234567000, %s(71) -bool(false) - -Arg value 1.07654321E-9 -string(4) "http" - -Arg value 0.5 -string(4) "http" - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value Array -Error: 2 - parse_url() expects parameter 2 to be long, array given, %s(71) -NULL - -Arg value -string(4) "http" - -Arg value -string(4) "http" - -Arg value 1 -string(11) "www.php.net" - -Arg value -string(4) "http" - -Arg value 1 -string(11) "www.php.net" - -Arg value -string(4) "http" - -Arg value -Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) -NULL - -Arg value -Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) -NULL - -Arg value string -Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) -NULL - -Arg value string -Error: 2 - parse_url() expects parameter 2 to be long, string given, %s(71) -NULL -Error: 4096 - Object of class stdClass could not be converted to string, %s(70) - -Arg value -Error: 2 - parse_url() expects parameter 2 to be long, object given, %s(71) -NULL - -Arg value -string(4) "http" - -Arg value -string(4) "http" -Done \ No newline at end of file diff --git a/ext/standard/tests/url/rawurldecode_error_001.phpt b/ext/standard/tests/url/rawurldecode_error_001.phpt deleted file mode 100644 index 1dcaf40fd4942..0000000000000 --- a/ext/standard/tests/url/rawurldecode_error_001.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test rawurldecode() function : error conditions - wrong number of args ---FILE-- - ---EXPECTF-- -*** Testing rawurldecode() : error conditions *** - --- Testing rawurldecode() function with Zero arguments -- - -Warning: rawurldecode() expects exactly 1 parameter, 0 given in %s on line 14 -NULL - --- Testing rawurldecode() function with more than expected no. of arguments -- - -Warning: rawurldecode() expects exactly 1 parameter, 2 given in %s on line 20 -NULL -Done diff --git a/ext/standard/tests/url/rawurldecode_variation_001.phpt b/ext/standard/tests/url/rawurldecode_variation_001.phpt deleted file mode 100644 index 4942e8b357e3d..0000000000000 --- a/ext/standard/tests/url/rawurldecode_variation_001.phpt +++ /dev/null @@ -1,168 +0,0 @@ ---TEST-- -Test rawurldecode() function : usage variations - unexpected type for arg 1. ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for str - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( rawurldecode($value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing rawurldecode() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -string(1) "0" - -Arg value 1 -string(1) "1" - -Arg value 12345 -string(5) "12345" - -Arg value -2345 -string(5) "-2345" - -Arg value 10.5 -string(4) "10.5" - -Arg value -10.5 -string(5) "-10.5" - -Arg value 101234567000 -string(12) "101234567000" - -Arg value 1.07654321E-9 -string(13) "1.07654321E-9" - -Arg value 0.5 -string(3) "0.5" - -Arg value Array -Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - rawurldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value -string(0) "" -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 2 - rawurldecode() expects parameter 1 to be string, object given, %s(74) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" -Done \ No newline at end of file diff --git a/ext/standard/tests/url/rawurlencode_error_001.phpt b/ext/standard/tests/url/rawurlencode_error_001.phpt deleted file mode 100644 index 7acce9e0c454e..0000000000000 --- a/ext/standard/tests/url/rawurlencode_error_001.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test rawurlencode() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing rawurlencode() : error conditions *** - --- Testing rawurlencode() function with Zero arguments -- - -Warning: rawurlencode() expects exactly 1 parameter, 0 given in %s on line 14 -NULL - --- Testing rawurlencode() function with more than expected no. of arguments -- - -Warning: rawurlencode() expects exactly 1 parameter, 2 given in %s on line 20 -NULL -Done \ No newline at end of file diff --git a/ext/standard/tests/url/rawurlencode_variation_001.phpt b/ext/standard/tests/url/rawurlencode_variation_001.phpt deleted file mode 100644 index d90825ba7f53f..0000000000000 --- a/ext/standard/tests/url/rawurlencode_variation_001.phpt +++ /dev/null @@ -1,168 +0,0 @@ ---TEST-- -Test rawurlencode() function : usage variations - unexpected type for arg 1. ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for str - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( rawurlencode($value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing rawurlencode() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -string(1) "0" - -Arg value 1 -string(1) "1" - -Arg value 12345 -string(5) "12345" - -Arg value -2345 -string(5) "-2345" - -Arg value 10.5 -string(4) "10.5" - -Arg value -10.5 -string(5) "-10.5" - -Arg value 101234567000 -string(12) "101234567000" - -Arg value 1.07654321E-9 -string(13) "1.07654321E-9" - -Arg value 0.5 -string(3) "0.5" - -Arg value Array -Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - rawurlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value -string(0) "" -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 2 - rawurlencode() expects parameter 1 to be string, object given, %s(74) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" -Done \ No newline at end of file diff --git a/ext/standard/tests/url/urldecode_error_001.phpt b/ext/standard/tests/url/urldecode_error_001.phpt deleted file mode 100644 index f0e5ae0838333..0000000000000 --- a/ext/standard/tests/url/urldecode_error_001.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test urldecode() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing urldecode() : error conditions *** - --- Testing urldecode() function with Zero arguments -- - -Warning: urldecode() expects exactly 1 parameter, 0 given in %s on line 14 -NULL - --- Testing urldecode() function with more than expected no. of arguments -- - -Warning: urldecode() expects exactly 1 parameter, 2 given in %s on line 20 -NULL -Done \ No newline at end of file diff --git a/ext/standard/tests/url/urldecode_variation_001.phpt b/ext/standard/tests/url/urldecode_variation_001.phpt deleted file mode 100644 index 7ebc7bdbef830..0000000000000 --- a/ext/standard/tests/url/urldecode_variation_001.phpt +++ /dev/null @@ -1,168 +0,0 @@ ---TEST-- -Test urldecode() function : usage variations - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for str - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( urldecode($value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing urldecode() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -string(1) "0" - -Arg value 1 -string(1) "1" - -Arg value 12345 -string(5) "12345" - -Arg value -2345 -string(5) "-2345" - -Arg value 10.5 -string(4) "10.5" - -Arg value -10.5 -string(5) "-10.5" - -Arg value 101234567000 -string(12) "101234567000" - -Arg value 1.07654321E-9 -string(13) "1.07654321E-9" - -Arg value 0.5 -string(3) "0.5" - -Arg value Array -Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - urldecode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value -string(0) "" -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 2 - urldecode() expects parameter 1 to be string, object given, %s(74) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" -Done \ No newline at end of file diff --git a/ext/standard/tests/url/urlencode_error_001.phpt b/ext/standard/tests/url/urlencode_error_001.phpt deleted file mode 100644 index fc00b057d8677..0000000000000 --- a/ext/standard/tests/url/urlencode_error_001.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test urlencode() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing urlencode() : error conditions *** - --- Testing urlencode() function with Zero arguments -- - -Warning: urlencode() expects exactly 1 parameter, 0 given in %s on line 14 -NULL - --- Testing urlencode() function with more than expected no. of arguments -- - -Warning: urlencode() expects exactly 1 parameter, 2 given in %s on line 20 -NULL -Done \ No newline at end of file diff --git a/ext/standard/tests/url/urlencode_variation_001.phpt b/ext/standard/tests/url/urlencode_variation_001.phpt deleted file mode 100644 index 1f82b65f3891d..0000000000000 --- a/ext/standard/tests/url/urlencode_variation_001.phpt +++ /dev/null @@ -1,168 +0,0 @@ ---TEST-- -Test urlencode() function : usage variations - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new stdclass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for str - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( urlencode($value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing urlencode() : usage variations *** -Error: 8 - Undefined variable: undefined_var, %s(64) -Error: 8 - Undefined variable: unset_var, %s(67) - -Arg value 0 -string(1) "0" - -Arg value 1 -string(1) "1" - -Arg value 12345 -string(5) "12345" - -Arg value -2345 -string(5) "-2345" - -Arg value 10.5 -string(4) "10.5" - -Arg value -10.5 -string(5) "-10.5" - -Arg value 101234567000 -string(12) "101234567000" - -Arg value 1.07654321E-9 -string(13) "1.07654321E-9" - -Arg value 0.5 -string(3) "0.5" - -Arg value Array -Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value Array -Error: 2 - urlencode() expects parameter 1 to be string, array given, %s(74) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value -string(0) "" -Error: 4096 - Object of class stdClass could not be converted to string, %s(73) - -Arg value -Error: 2 - urlencode() expects parameter 1 to be string, object given, %s(74) -NULL - -Arg value -string(0) "" - -Arg value -string(0) "" -Done \ No newline at end of file diff --git a/ext/standard/tests/url/urls.inc b/ext/standard/tests/url/urls.inc deleted file mode 100644 index 27521c852007e..0000000000000 --- a/ext/standard/tests/url/urls.inc +++ /dev/null @@ -1,109 +0,0 @@ - \ No newline at end of file diff --git a/ext/standard/tests/versioning/version_compare.phpt b/ext/standard/tests/versioning/version_compare.phpt deleted file mode 100644 index 145fb933abda2..0000000000000 --- a/ext/standard/tests/versioning/version_compare.phpt +++ /dev/null @@ -1,795 +0,0 @@ ---TEST-- -version_compare test ---FILE-- -", - "ge", ">=", - "eq", "=", "==", - "ne", "<>", "!=" -); -test("1", "2"); -test("10", "2"); -test("1.0", "1.1"); -test("1.2", "1.0.1"); -foreach ($special_forms as $f1) { - foreach ($special_forms as $f2) { - test("1.0$f1", "1.0$f2"); - } -} -print "TESTING OPERATORS\n"; -foreach ($special_forms as $f1) { - foreach ($special_forms as $f2) { - foreach ($operators as $op) { - $v1 = "1.0$f1"; - $v2 = "1.0$f2"; - $test = version_compare($v1, $v2, $op) ? "true" : "false"; - printf("%7s %2s %-7s : %s\n", $v1, $op, $v2, $test); - } - } -} - -function test($v1, $v2) { - $compare = version_compare($v1, $v2); - switch ($compare) { - case -1: - print "$v1 < $v2\n"; - break; - case 1: - print "$v1 > $v2\n"; - break; - case 0: - default: - print "$v1 = $v2\n"; - break; - } -} - -?> ---EXPECT-- -TESTING COMPARE -1 < 2 -10 > 2 -1.0 < 1.1 -1.2 > 1.0.1 -1.0-dev = 1.0-dev -1.0-dev < 1.0a1 -1.0-dev < 1.0b1 -1.0-dev < 1.0RC1 -1.0-dev < 1.0rc1 -1.0-dev < 1.0 -1.0-dev < 1.0pl1 -1.0a1 > 1.0-dev -1.0a1 = 1.0a1 -1.0a1 < 1.0b1 -1.0a1 < 1.0RC1 -1.0a1 < 1.0rc1 -1.0a1 < 1.0 -1.0a1 < 1.0pl1 -1.0b1 > 1.0-dev -1.0b1 > 1.0a1 -1.0b1 = 1.0b1 -1.0b1 < 1.0RC1 -1.0b1 < 1.0rc1 -1.0b1 < 1.0 -1.0b1 < 1.0pl1 -1.0RC1 > 1.0-dev -1.0RC1 > 1.0a1 -1.0RC1 > 1.0b1 -1.0RC1 = 1.0RC1 -1.0RC1 = 1.0rc1 -1.0RC1 < 1.0 -1.0RC1 < 1.0pl1 -1.0rc1 > 1.0-dev -1.0rc1 > 1.0a1 -1.0rc1 > 1.0b1 -1.0rc1 = 1.0RC1 -1.0rc1 = 1.0rc1 -1.0rc1 < 1.0 -1.0rc1 < 1.0pl1 -1.0 > 1.0-dev -1.0 > 1.0a1 -1.0 > 1.0b1 -1.0 > 1.0RC1 -1.0 > 1.0rc1 -1.0 = 1.0 -1.0 < 1.0pl1 -1.0pl1 > 1.0-dev -1.0pl1 > 1.0a1 -1.0pl1 > 1.0b1 -1.0pl1 > 1.0RC1 -1.0pl1 > 1.0rc1 -1.0pl1 > 1.0 -1.0pl1 = 1.0pl1 -TESTING OPERATORS -1.0-dev lt 1.0-dev : false -1.0-dev < 1.0-dev : false -1.0-dev le 1.0-dev : true -1.0-dev <= 1.0-dev : true -1.0-dev gt 1.0-dev : false -1.0-dev > 1.0-dev : false -1.0-dev ge 1.0-dev : true -1.0-dev >= 1.0-dev : true -1.0-dev eq 1.0-dev : true -1.0-dev = 1.0-dev : true -1.0-dev == 1.0-dev : true -1.0-dev ne 1.0-dev : false -1.0-dev <> 1.0-dev : false -1.0-dev != 1.0-dev : false -1.0-dev lt 1.0a1 : true -1.0-dev < 1.0a1 : true -1.0-dev le 1.0a1 : true -1.0-dev <= 1.0a1 : true -1.0-dev gt 1.0a1 : false -1.0-dev > 1.0a1 : false -1.0-dev ge 1.0a1 : false -1.0-dev >= 1.0a1 : false -1.0-dev eq 1.0a1 : false -1.0-dev = 1.0a1 : false -1.0-dev == 1.0a1 : false -1.0-dev ne 1.0a1 : true -1.0-dev <> 1.0a1 : true -1.0-dev != 1.0a1 : true -1.0-dev lt 1.0b1 : true -1.0-dev < 1.0b1 : true -1.0-dev le 1.0b1 : true -1.0-dev <= 1.0b1 : true -1.0-dev gt 1.0b1 : false -1.0-dev > 1.0b1 : false -1.0-dev ge 1.0b1 : false -1.0-dev >= 1.0b1 : false -1.0-dev eq 1.0b1 : false -1.0-dev = 1.0b1 : false -1.0-dev == 1.0b1 : false -1.0-dev ne 1.0b1 : true -1.0-dev <> 1.0b1 : true -1.0-dev != 1.0b1 : true -1.0-dev lt 1.0RC1 : true -1.0-dev < 1.0RC1 : true -1.0-dev le 1.0RC1 : true -1.0-dev <= 1.0RC1 : true -1.0-dev gt 1.0RC1 : false -1.0-dev > 1.0RC1 : false -1.0-dev ge 1.0RC1 : false -1.0-dev >= 1.0RC1 : false -1.0-dev eq 1.0RC1 : false -1.0-dev = 1.0RC1 : false -1.0-dev == 1.0RC1 : false -1.0-dev ne 1.0RC1 : true -1.0-dev <> 1.0RC1 : true -1.0-dev != 1.0RC1 : true -1.0-dev lt 1.0rc1 : true -1.0-dev < 1.0rc1 : true -1.0-dev le 1.0rc1 : true -1.0-dev <= 1.0rc1 : true -1.0-dev gt 1.0rc1 : false -1.0-dev > 1.0rc1 : false -1.0-dev ge 1.0rc1 : false -1.0-dev >= 1.0rc1 : false -1.0-dev eq 1.0rc1 : false -1.0-dev = 1.0rc1 : false -1.0-dev == 1.0rc1 : false -1.0-dev ne 1.0rc1 : true -1.0-dev <> 1.0rc1 : true -1.0-dev != 1.0rc1 : true -1.0-dev lt 1.0 : true -1.0-dev < 1.0 : true -1.0-dev le 1.0 : true -1.0-dev <= 1.0 : true -1.0-dev gt 1.0 : false -1.0-dev > 1.0 : false -1.0-dev ge 1.0 : false -1.0-dev >= 1.0 : false -1.0-dev eq 1.0 : false -1.0-dev = 1.0 : false -1.0-dev == 1.0 : false -1.0-dev ne 1.0 : true -1.0-dev <> 1.0 : true -1.0-dev != 1.0 : true -1.0-dev lt 1.0pl1 : true -1.0-dev < 1.0pl1 : true -1.0-dev le 1.0pl1 : true -1.0-dev <= 1.0pl1 : true -1.0-dev gt 1.0pl1 : false -1.0-dev > 1.0pl1 : false -1.0-dev ge 1.0pl1 : false -1.0-dev >= 1.0pl1 : false -1.0-dev eq 1.0pl1 : false -1.0-dev = 1.0pl1 : false -1.0-dev == 1.0pl1 : false -1.0-dev ne 1.0pl1 : true -1.0-dev <> 1.0pl1 : true -1.0-dev != 1.0pl1 : true - 1.0a1 lt 1.0-dev : false - 1.0a1 < 1.0-dev : false - 1.0a1 le 1.0-dev : false - 1.0a1 <= 1.0-dev : false - 1.0a1 gt 1.0-dev : true - 1.0a1 > 1.0-dev : true - 1.0a1 ge 1.0-dev : true - 1.0a1 >= 1.0-dev : true - 1.0a1 eq 1.0-dev : false - 1.0a1 = 1.0-dev : false - 1.0a1 == 1.0-dev : false - 1.0a1 ne 1.0-dev : true - 1.0a1 <> 1.0-dev : true - 1.0a1 != 1.0-dev : true - 1.0a1 lt 1.0a1 : false - 1.0a1 < 1.0a1 : false - 1.0a1 le 1.0a1 : true - 1.0a1 <= 1.0a1 : true - 1.0a1 gt 1.0a1 : false - 1.0a1 > 1.0a1 : false - 1.0a1 ge 1.0a1 : true - 1.0a1 >= 1.0a1 : true - 1.0a1 eq 1.0a1 : true - 1.0a1 = 1.0a1 : true - 1.0a1 == 1.0a1 : true - 1.0a1 ne 1.0a1 : false - 1.0a1 <> 1.0a1 : false - 1.0a1 != 1.0a1 : false - 1.0a1 lt 1.0b1 : true - 1.0a1 < 1.0b1 : true - 1.0a1 le 1.0b1 : true - 1.0a1 <= 1.0b1 : true - 1.0a1 gt 1.0b1 : false - 1.0a1 > 1.0b1 : false - 1.0a1 ge 1.0b1 : false - 1.0a1 >= 1.0b1 : false - 1.0a1 eq 1.0b1 : false - 1.0a1 = 1.0b1 : false - 1.0a1 == 1.0b1 : false - 1.0a1 ne 1.0b1 : true - 1.0a1 <> 1.0b1 : true - 1.0a1 != 1.0b1 : true - 1.0a1 lt 1.0RC1 : true - 1.0a1 < 1.0RC1 : true - 1.0a1 le 1.0RC1 : true - 1.0a1 <= 1.0RC1 : true - 1.0a1 gt 1.0RC1 : false - 1.0a1 > 1.0RC1 : false - 1.0a1 ge 1.0RC1 : false - 1.0a1 >= 1.0RC1 : false - 1.0a1 eq 1.0RC1 : false - 1.0a1 = 1.0RC1 : false - 1.0a1 == 1.0RC1 : false - 1.0a1 ne 1.0RC1 : true - 1.0a1 <> 1.0RC1 : true - 1.0a1 != 1.0RC1 : true - 1.0a1 lt 1.0rc1 : true - 1.0a1 < 1.0rc1 : true - 1.0a1 le 1.0rc1 : true - 1.0a1 <= 1.0rc1 : true - 1.0a1 gt 1.0rc1 : false - 1.0a1 > 1.0rc1 : false - 1.0a1 ge 1.0rc1 : false - 1.0a1 >= 1.0rc1 : false - 1.0a1 eq 1.0rc1 : false - 1.0a1 = 1.0rc1 : false - 1.0a1 == 1.0rc1 : false - 1.0a1 ne 1.0rc1 : true - 1.0a1 <> 1.0rc1 : true - 1.0a1 != 1.0rc1 : true - 1.0a1 lt 1.0 : true - 1.0a1 < 1.0 : true - 1.0a1 le 1.0 : true - 1.0a1 <= 1.0 : true - 1.0a1 gt 1.0 : false - 1.0a1 > 1.0 : false - 1.0a1 ge 1.0 : false - 1.0a1 >= 1.0 : false - 1.0a1 eq 1.0 : false - 1.0a1 = 1.0 : false - 1.0a1 == 1.0 : false - 1.0a1 ne 1.0 : true - 1.0a1 <> 1.0 : true - 1.0a1 != 1.0 : true - 1.0a1 lt 1.0pl1 : true - 1.0a1 < 1.0pl1 : true - 1.0a1 le 1.0pl1 : true - 1.0a1 <= 1.0pl1 : true - 1.0a1 gt 1.0pl1 : false - 1.0a1 > 1.0pl1 : false - 1.0a1 ge 1.0pl1 : false - 1.0a1 >= 1.0pl1 : false - 1.0a1 eq 1.0pl1 : false - 1.0a1 = 1.0pl1 : false - 1.0a1 == 1.0pl1 : false - 1.0a1 ne 1.0pl1 : true - 1.0a1 <> 1.0pl1 : true - 1.0a1 != 1.0pl1 : true - 1.0b1 lt 1.0-dev : false - 1.0b1 < 1.0-dev : false - 1.0b1 le 1.0-dev : false - 1.0b1 <= 1.0-dev : false - 1.0b1 gt 1.0-dev : true - 1.0b1 > 1.0-dev : true - 1.0b1 ge 1.0-dev : true - 1.0b1 >= 1.0-dev : true - 1.0b1 eq 1.0-dev : false - 1.0b1 = 1.0-dev : false - 1.0b1 == 1.0-dev : false - 1.0b1 ne 1.0-dev : true - 1.0b1 <> 1.0-dev : true - 1.0b1 != 1.0-dev : true - 1.0b1 lt 1.0a1 : false - 1.0b1 < 1.0a1 : false - 1.0b1 le 1.0a1 : false - 1.0b1 <= 1.0a1 : false - 1.0b1 gt 1.0a1 : true - 1.0b1 > 1.0a1 : true - 1.0b1 ge 1.0a1 : true - 1.0b1 >= 1.0a1 : true - 1.0b1 eq 1.0a1 : false - 1.0b1 = 1.0a1 : false - 1.0b1 == 1.0a1 : false - 1.0b1 ne 1.0a1 : true - 1.0b1 <> 1.0a1 : true - 1.0b1 != 1.0a1 : true - 1.0b1 lt 1.0b1 : false - 1.0b1 < 1.0b1 : false - 1.0b1 le 1.0b1 : true - 1.0b1 <= 1.0b1 : true - 1.0b1 gt 1.0b1 : false - 1.0b1 > 1.0b1 : false - 1.0b1 ge 1.0b1 : true - 1.0b1 >= 1.0b1 : true - 1.0b1 eq 1.0b1 : true - 1.0b1 = 1.0b1 : true - 1.0b1 == 1.0b1 : true - 1.0b1 ne 1.0b1 : false - 1.0b1 <> 1.0b1 : false - 1.0b1 != 1.0b1 : false - 1.0b1 lt 1.0RC1 : true - 1.0b1 < 1.0RC1 : true - 1.0b1 le 1.0RC1 : true - 1.0b1 <= 1.0RC1 : true - 1.0b1 gt 1.0RC1 : false - 1.0b1 > 1.0RC1 : false - 1.0b1 ge 1.0RC1 : false - 1.0b1 >= 1.0RC1 : false - 1.0b1 eq 1.0RC1 : false - 1.0b1 = 1.0RC1 : false - 1.0b1 == 1.0RC1 : false - 1.0b1 ne 1.0RC1 : true - 1.0b1 <> 1.0RC1 : true - 1.0b1 != 1.0RC1 : true - 1.0b1 lt 1.0rc1 : true - 1.0b1 < 1.0rc1 : true - 1.0b1 le 1.0rc1 : true - 1.0b1 <= 1.0rc1 : true - 1.0b1 gt 1.0rc1 : false - 1.0b1 > 1.0rc1 : false - 1.0b1 ge 1.0rc1 : false - 1.0b1 >= 1.0rc1 : false - 1.0b1 eq 1.0rc1 : false - 1.0b1 = 1.0rc1 : false - 1.0b1 == 1.0rc1 : false - 1.0b1 ne 1.0rc1 : true - 1.0b1 <> 1.0rc1 : true - 1.0b1 != 1.0rc1 : true - 1.0b1 lt 1.0 : true - 1.0b1 < 1.0 : true - 1.0b1 le 1.0 : true - 1.0b1 <= 1.0 : true - 1.0b1 gt 1.0 : false - 1.0b1 > 1.0 : false - 1.0b1 ge 1.0 : false - 1.0b1 >= 1.0 : false - 1.0b1 eq 1.0 : false - 1.0b1 = 1.0 : false - 1.0b1 == 1.0 : false - 1.0b1 ne 1.0 : true - 1.0b1 <> 1.0 : true - 1.0b1 != 1.0 : true - 1.0b1 lt 1.0pl1 : true - 1.0b1 < 1.0pl1 : true - 1.0b1 le 1.0pl1 : true - 1.0b1 <= 1.0pl1 : true - 1.0b1 gt 1.0pl1 : false - 1.0b1 > 1.0pl1 : false - 1.0b1 ge 1.0pl1 : false - 1.0b1 >= 1.0pl1 : false - 1.0b1 eq 1.0pl1 : false - 1.0b1 = 1.0pl1 : false - 1.0b1 == 1.0pl1 : false - 1.0b1 ne 1.0pl1 : true - 1.0b1 <> 1.0pl1 : true - 1.0b1 != 1.0pl1 : true - 1.0RC1 lt 1.0-dev : false - 1.0RC1 < 1.0-dev : false - 1.0RC1 le 1.0-dev : false - 1.0RC1 <= 1.0-dev : false - 1.0RC1 gt 1.0-dev : true - 1.0RC1 > 1.0-dev : true - 1.0RC1 ge 1.0-dev : true - 1.0RC1 >= 1.0-dev : true - 1.0RC1 eq 1.0-dev : false - 1.0RC1 = 1.0-dev : false - 1.0RC1 == 1.0-dev : false - 1.0RC1 ne 1.0-dev : true - 1.0RC1 <> 1.0-dev : true - 1.0RC1 != 1.0-dev : true - 1.0RC1 lt 1.0a1 : false - 1.0RC1 < 1.0a1 : false - 1.0RC1 le 1.0a1 : false - 1.0RC1 <= 1.0a1 : false - 1.0RC1 gt 1.0a1 : true - 1.0RC1 > 1.0a1 : true - 1.0RC1 ge 1.0a1 : true - 1.0RC1 >= 1.0a1 : true - 1.0RC1 eq 1.0a1 : false - 1.0RC1 = 1.0a1 : false - 1.0RC1 == 1.0a1 : false - 1.0RC1 ne 1.0a1 : true - 1.0RC1 <> 1.0a1 : true - 1.0RC1 != 1.0a1 : true - 1.0RC1 lt 1.0b1 : false - 1.0RC1 < 1.0b1 : false - 1.0RC1 le 1.0b1 : false - 1.0RC1 <= 1.0b1 : false - 1.0RC1 gt 1.0b1 : true - 1.0RC1 > 1.0b1 : true - 1.0RC1 ge 1.0b1 : true - 1.0RC1 >= 1.0b1 : true - 1.0RC1 eq 1.0b1 : false - 1.0RC1 = 1.0b1 : false - 1.0RC1 == 1.0b1 : false - 1.0RC1 ne 1.0b1 : true - 1.0RC1 <> 1.0b1 : true - 1.0RC1 != 1.0b1 : true - 1.0RC1 lt 1.0RC1 : false - 1.0RC1 < 1.0RC1 : false - 1.0RC1 le 1.0RC1 : true - 1.0RC1 <= 1.0RC1 : true - 1.0RC1 gt 1.0RC1 : false - 1.0RC1 > 1.0RC1 : false - 1.0RC1 ge 1.0RC1 : true - 1.0RC1 >= 1.0RC1 : true - 1.0RC1 eq 1.0RC1 : true - 1.0RC1 = 1.0RC1 : true - 1.0RC1 == 1.0RC1 : true - 1.0RC1 ne 1.0RC1 : false - 1.0RC1 <> 1.0RC1 : false - 1.0RC1 != 1.0RC1 : false - 1.0RC1 lt 1.0rc1 : false - 1.0RC1 < 1.0rc1 : false - 1.0RC1 le 1.0rc1 : true - 1.0RC1 <= 1.0rc1 : true - 1.0RC1 gt 1.0rc1 : false - 1.0RC1 > 1.0rc1 : false - 1.0RC1 ge 1.0rc1 : true - 1.0RC1 >= 1.0rc1 : true - 1.0RC1 eq 1.0rc1 : true - 1.0RC1 = 1.0rc1 : true - 1.0RC1 == 1.0rc1 : true - 1.0RC1 ne 1.0rc1 : false - 1.0RC1 <> 1.0rc1 : false - 1.0RC1 != 1.0rc1 : false - 1.0RC1 lt 1.0 : true - 1.0RC1 < 1.0 : true - 1.0RC1 le 1.0 : true - 1.0RC1 <= 1.0 : true - 1.0RC1 gt 1.0 : false - 1.0RC1 > 1.0 : false - 1.0RC1 ge 1.0 : false - 1.0RC1 >= 1.0 : false - 1.0RC1 eq 1.0 : false - 1.0RC1 = 1.0 : false - 1.0RC1 == 1.0 : false - 1.0RC1 ne 1.0 : true - 1.0RC1 <> 1.0 : true - 1.0RC1 != 1.0 : true - 1.0RC1 lt 1.0pl1 : true - 1.0RC1 < 1.0pl1 : true - 1.0RC1 le 1.0pl1 : true - 1.0RC1 <= 1.0pl1 : true - 1.0RC1 gt 1.0pl1 : false - 1.0RC1 > 1.0pl1 : false - 1.0RC1 ge 1.0pl1 : false - 1.0RC1 >= 1.0pl1 : false - 1.0RC1 eq 1.0pl1 : false - 1.0RC1 = 1.0pl1 : false - 1.0RC1 == 1.0pl1 : false - 1.0RC1 ne 1.0pl1 : true - 1.0RC1 <> 1.0pl1 : true - 1.0RC1 != 1.0pl1 : true - 1.0rc1 lt 1.0-dev : false - 1.0rc1 < 1.0-dev : false - 1.0rc1 le 1.0-dev : false - 1.0rc1 <= 1.0-dev : false - 1.0rc1 gt 1.0-dev : true - 1.0rc1 > 1.0-dev : true - 1.0rc1 ge 1.0-dev : true - 1.0rc1 >= 1.0-dev : true - 1.0rc1 eq 1.0-dev : false - 1.0rc1 = 1.0-dev : false - 1.0rc1 == 1.0-dev : false - 1.0rc1 ne 1.0-dev : true - 1.0rc1 <> 1.0-dev : true - 1.0rc1 != 1.0-dev : true - 1.0rc1 lt 1.0a1 : false - 1.0rc1 < 1.0a1 : false - 1.0rc1 le 1.0a1 : false - 1.0rc1 <= 1.0a1 : false - 1.0rc1 gt 1.0a1 : true - 1.0rc1 > 1.0a1 : true - 1.0rc1 ge 1.0a1 : true - 1.0rc1 >= 1.0a1 : true - 1.0rc1 eq 1.0a1 : false - 1.0rc1 = 1.0a1 : false - 1.0rc1 == 1.0a1 : false - 1.0rc1 ne 1.0a1 : true - 1.0rc1 <> 1.0a1 : true - 1.0rc1 != 1.0a1 : true - 1.0rc1 lt 1.0b1 : false - 1.0rc1 < 1.0b1 : false - 1.0rc1 le 1.0b1 : false - 1.0rc1 <= 1.0b1 : false - 1.0rc1 gt 1.0b1 : true - 1.0rc1 > 1.0b1 : true - 1.0rc1 ge 1.0b1 : true - 1.0rc1 >= 1.0b1 : true - 1.0rc1 eq 1.0b1 : false - 1.0rc1 = 1.0b1 : false - 1.0rc1 == 1.0b1 : false - 1.0rc1 ne 1.0b1 : true - 1.0rc1 <> 1.0b1 : true - 1.0rc1 != 1.0b1 : true - 1.0rc1 lt 1.0RC1 : false - 1.0rc1 < 1.0RC1 : false - 1.0rc1 le 1.0RC1 : true - 1.0rc1 <= 1.0RC1 : true - 1.0rc1 gt 1.0RC1 : false - 1.0rc1 > 1.0RC1 : false - 1.0rc1 ge 1.0RC1 : true - 1.0rc1 >= 1.0RC1 : true - 1.0rc1 eq 1.0RC1 : true - 1.0rc1 = 1.0RC1 : true - 1.0rc1 == 1.0RC1 : true - 1.0rc1 ne 1.0RC1 : false - 1.0rc1 <> 1.0RC1 : false - 1.0rc1 != 1.0RC1 : false - 1.0rc1 lt 1.0rc1 : false - 1.0rc1 < 1.0rc1 : false - 1.0rc1 le 1.0rc1 : true - 1.0rc1 <= 1.0rc1 : true - 1.0rc1 gt 1.0rc1 : false - 1.0rc1 > 1.0rc1 : false - 1.0rc1 ge 1.0rc1 : true - 1.0rc1 >= 1.0rc1 : true - 1.0rc1 eq 1.0rc1 : true - 1.0rc1 = 1.0rc1 : true - 1.0rc1 == 1.0rc1 : true - 1.0rc1 ne 1.0rc1 : false - 1.0rc1 <> 1.0rc1 : false - 1.0rc1 != 1.0rc1 : false - 1.0rc1 lt 1.0 : true - 1.0rc1 < 1.0 : true - 1.0rc1 le 1.0 : true - 1.0rc1 <= 1.0 : true - 1.0rc1 gt 1.0 : false - 1.0rc1 > 1.0 : false - 1.0rc1 ge 1.0 : false - 1.0rc1 >= 1.0 : false - 1.0rc1 eq 1.0 : false - 1.0rc1 = 1.0 : false - 1.0rc1 == 1.0 : false - 1.0rc1 ne 1.0 : true - 1.0rc1 <> 1.0 : true - 1.0rc1 != 1.0 : true - 1.0rc1 lt 1.0pl1 : true - 1.0rc1 < 1.0pl1 : true - 1.0rc1 le 1.0pl1 : true - 1.0rc1 <= 1.0pl1 : true - 1.0rc1 gt 1.0pl1 : false - 1.0rc1 > 1.0pl1 : false - 1.0rc1 ge 1.0pl1 : false - 1.0rc1 >= 1.0pl1 : false - 1.0rc1 eq 1.0pl1 : false - 1.0rc1 = 1.0pl1 : false - 1.0rc1 == 1.0pl1 : false - 1.0rc1 ne 1.0pl1 : true - 1.0rc1 <> 1.0pl1 : true - 1.0rc1 != 1.0pl1 : true - 1.0 lt 1.0-dev : false - 1.0 < 1.0-dev : false - 1.0 le 1.0-dev : false - 1.0 <= 1.0-dev : false - 1.0 gt 1.0-dev : true - 1.0 > 1.0-dev : true - 1.0 ge 1.0-dev : true - 1.0 >= 1.0-dev : true - 1.0 eq 1.0-dev : false - 1.0 = 1.0-dev : false - 1.0 == 1.0-dev : false - 1.0 ne 1.0-dev : true - 1.0 <> 1.0-dev : true - 1.0 != 1.0-dev : true - 1.0 lt 1.0a1 : false - 1.0 < 1.0a1 : false - 1.0 le 1.0a1 : false - 1.0 <= 1.0a1 : false - 1.0 gt 1.0a1 : true - 1.0 > 1.0a1 : true - 1.0 ge 1.0a1 : true - 1.0 >= 1.0a1 : true - 1.0 eq 1.0a1 : false - 1.0 = 1.0a1 : false - 1.0 == 1.0a1 : false - 1.0 ne 1.0a1 : true - 1.0 <> 1.0a1 : true - 1.0 != 1.0a1 : true - 1.0 lt 1.0b1 : false - 1.0 < 1.0b1 : false - 1.0 le 1.0b1 : false - 1.0 <= 1.0b1 : false - 1.0 gt 1.0b1 : true - 1.0 > 1.0b1 : true - 1.0 ge 1.0b1 : true - 1.0 >= 1.0b1 : true - 1.0 eq 1.0b1 : false - 1.0 = 1.0b1 : false - 1.0 == 1.0b1 : false - 1.0 ne 1.0b1 : true - 1.0 <> 1.0b1 : true - 1.0 != 1.0b1 : true - 1.0 lt 1.0RC1 : false - 1.0 < 1.0RC1 : false - 1.0 le 1.0RC1 : false - 1.0 <= 1.0RC1 : false - 1.0 gt 1.0RC1 : true - 1.0 > 1.0RC1 : true - 1.0 ge 1.0RC1 : true - 1.0 >= 1.0RC1 : true - 1.0 eq 1.0RC1 : false - 1.0 = 1.0RC1 : false - 1.0 == 1.0RC1 : false - 1.0 ne 1.0RC1 : true - 1.0 <> 1.0RC1 : true - 1.0 != 1.0RC1 : true - 1.0 lt 1.0rc1 : false - 1.0 < 1.0rc1 : false - 1.0 le 1.0rc1 : false - 1.0 <= 1.0rc1 : false - 1.0 gt 1.0rc1 : true - 1.0 > 1.0rc1 : true - 1.0 ge 1.0rc1 : true - 1.0 >= 1.0rc1 : true - 1.0 eq 1.0rc1 : false - 1.0 = 1.0rc1 : false - 1.0 == 1.0rc1 : false - 1.0 ne 1.0rc1 : true - 1.0 <> 1.0rc1 : true - 1.0 != 1.0rc1 : true - 1.0 lt 1.0 : false - 1.0 < 1.0 : false - 1.0 le 1.0 : true - 1.0 <= 1.0 : true - 1.0 gt 1.0 : false - 1.0 > 1.0 : false - 1.0 ge 1.0 : true - 1.0 >= 1.0 : true - 1.0 eq 1.0 : true - 1.0 = 1.0 : true - 1.0 == 1.0 : true - 1.0 ne 1.0 : false - 1.0 <> 1.0 : false - 1.0 != 1.0 : false - 1.0 lt 1.0pl1 : true - 1.0 < 1.0pl1 : true - 1.0 le 1.0pl1 : true - 1.0 <= 1.0pl1 : true - 1.0 gt 1.0pl1 : false - 1.0 > 1.0pl1 : false - 1.0 ge 1.0pl1 : false - 1.0 >= 1.0pl1 : false - 1.0 eq 1.0pl1 : false - 1.0 = 1.0pl1 : false - 1.0 == 1.0pl1 : false - 1.0 ne 1.0pl1 : true - 1.0 <> 1.0pl1 : true - 1.0 != 1.0pl1 : true - 1.0pl1 lt 1.0-dev : false - 1.0pl1 < 1.0-dev : false - 1.0pl1 le 1.0-dev : false - 1.0pl1 <= 1.0-dev : false - 1.0pl1 gt 1.0-dev : true - 1.0pl1 > 1.0-dev : true - 1.0pl1 ge 1.0-dev : true - 1.0pl1 >= 1.0-dev : true - 1.0pl1 eq 1.0-dev : false - 1.0pl1 = 1.0-dev : false - 1.0pl1 == 1.0-dev : false - 1.0pl1 ne 1.0-dev : true - 1.0pl1 <> 1.0-dev : true - 1.0pl1 != 1.0-dev : true - 1.0pl1 lt 1.0a1 : false - 1.0pl1 < 1.0a1 : false - 1.0pl1 le 1.0a1 : false - 1.0pl1 <= 1.0a1 : false - 1.0pl1 gt 1.0a1 : true - 1.0pl1 > 1.0a1 : true - 1.0pl1 ge 1.0a1 : true - 1.0pl1 >= 1.0a1 : true - 1.0pl1 eq 1.0a1 : false - 1.0pl1 = 1.0a1 : false - 1.0pl1 == 1.0a1 : false - 1.0pl1 ne 1.0a1 : true - 1.0pl1 <> 1.0a1 : true - 1.0pl1 != 1.0a1 : true - 1.0pl1 lt 1.0b1 : false - 1.0pl1 < 1.0b1 : false - 1.0pl1 le 1.0b1 : false - 1.0pl1 <= 1.0b1 : false - 1.0pl1 gt 1.0b1 : true - 1.0pl1 > 1.0b1 : true - 1.0pl1 ge 1.0b1 : true - 1.0pl1 >= 1.0b1 : true - 1.0pl1 eq 1.0b1 : false - 1.0pl1 = 1.0b1 : false - 1.0pl1 == 1.0b1 : false - 1.0pl1 ne 1.0b1 : true - 1.0pl1 <> 1.0b1 : true - 1.0pl1 != 1.0b1 : true - 1.0pl1 lt 1.0RC1 : false - 1.0pl1 < 1.0RC1 : false - 1.0pl1 le 1.0RC1 : false - 1.0pl1 <= 1.0RC1 : false - 1.0pl1 gt 1.0RC1 : true - 1.0pl1 > 1.0RC1 : true - 1.0pl1 ge 1.0RC1 : true - 1.0pl1 >= 1.0RC1 : true - 1.0pl1 eq 1.0RC1 : false - 1.0pl1 = 1.0RC1 : false - 1.0pl1 == 1.0RC1 : false - 1.0pl1 ne 1.0RC1 : true - 1.0pl1 <> 1.0RC1 : true - 1.0pl1 != 1.0RC1 : true - 1.0pl1 lt 1.0rc1 : false - 1.0pl1 < 1.0rc1 : false - 1.0pl1 le 1.0rc1 : false - 1.0pl1 <= 1.0rc1 : false - 1.0pl1 gt 1.0rc1 : true - 1.0pl1 > 1.0rc1 : true - 1.0pl1 ge 1.0rc1 : true - 1.0pl1 >= 1.0rc1 : true - 1.0pl1 eq 1.0rc1 : false - 1.0pl1 = 1.0rc1 : false - 1.0pl1 == 1.0rc1 : false - 1.0pl1 ne 1.0rc1 : true - 1.0pl1 <> 1.0rc1 : true - 1.0pl1 != 1.0rc1 : true - 1.0pl1 lt 1.0 : false - 1.0pl1 < 1.0 : false - 1.0pl1 le 1.0 : false - 1.0pl1 <= 1.0 : false - 1.0pl1 gt 1.0 : true - 1.0pl1 > 1.0 : true - 1.0pl1 ge 1.0 : true - 1.0pl1 >= 1.0 : true - 1.0pl1 eq 1.0 : false - 1.0pl1 = 1.0 : false - 1.0pl1 == 1.0 : false - 1.0pl1 ne 1.0 : true - 1.0pl1 <> 1.0 : true - 1.0pl1 != 1.0 : true - 1.0pl1 lt 1.0pl1 : false - 1.0pl1 < 1.0pl1 : false - 1.0pl1 le 1.0pl1 : true - 1.0pl1 <= 1.0pl1 : true - 1.0pl1 gt 1.0pl1 : false - 1.0pl1 > 1.0pl1 : false - 1.0pl1 ge 1.0pl1 : true - 1.0pl1 >= 1.0pl1 : true - 1.0pl1 eq 1.0pl1 : true - 1.0pl1 = 1.0pl1 : true - 1.0pl1 == 1.0pl1 : true - 1.0pl1 ne 1.0pl1 : false - 1.0pl1 <> 1.0pl1 : false - 1.0pl1 != 1.0pl1 : false \ No newline at end of file diff --git a/ext/standard/type.c b/ext/standard/type.c deleted file mode 100644 index 6782b654f423f..0000000000000 --- a/ext/standard/type.c +++ /dev/null @@ -1,396 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_incomplete_class.h" - -/* {{{ proto string gettype(mixed var) - Returns the type of the variable */ -PHP_FUNCTION(gettype) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (Z_TYPE_PP(arg)) { - case IS_NULL: - RETVAL_STRING("NULL", 1); - break; - - case IS_BOOL: - RETVAL_STRING("boolean", 1); - break; - - case IS_LONG: - RETVAL_STRING("integer", 1); - break; - - case IS_DOUBLE: - RETVAL_STRING("double", 1); - break; - - case IS_STRING: - RETVAL_STRING("string", 1); - break; - - case IS_ARRAY: - RETVAL_STRING("array", 1); - break; - - case IS_OBJECT: - RETVAL_STRING("object", 1); - /* - { - char *result; - int res_len; - - res_len = sizeof("object of type ")-1 + Z_OBJCE_P(arg)->name_length; - spprintf(&result, 0, "object of type %s", Z_OBJCE_P(arg)->name); - RETVAL_STRINGL(result, res_len, 0); - } - */ - break; - - case IS_RESOURCE: - { - char *type_name; - type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) TSRMLS_CC); - if (type_name) { - RETVAL_STRING("resource", 1); - break; - } - } - - default: - RETVAL_STRING("unknown type", 1); - } -} -/* }}} */ - -/* {{{ proto bool settype(mixed var, string type) - Set the type of the variable */ -PHP_FUNCTION(settype) -{ - zval **var, **type; - char *new_type; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &var, &type) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(type); - new_type = Z_STRVAL_PP(type); - - if (!strcasecmp(new_type, "integer")) { - convert_to_long(*var); - } else if (!strcasecmp(new_type, "int")) { - convert_to_long(*var); - } else if (!strcasecmp(new_type, "float")) { - convert_to_double(*var); - } else if (!strcasecmp(new_type, "double")) { /* deprecated */ - convert_to_double(*var); - } else if (!strcasecmp(new_type, "string")) { - convert_to_string(*var); - } else if (!strcasecmp(new_type, "array")) { - convert_to_array(*var); - } else if (!strcasecmp(new_type, "object")) { - convert_to_object(*var); - } else if (!strcasecmp(new_type, "bool")) { - convert_to_boolean(*var); - } else if (!strcasecmp(new_type, "boolean")) { - convert_to_boolean(*var); - } else if (!strcasecmp(new_type, "null")) { - convert_to_null(*var); - } else if (!strcasecmp(new_type, "resource")) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot convert to resource type"); - RETURN_FALSE; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type"); - RETURN_FALSE; - } - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int intval(mixed var [, int base]) - Get the integer value of a variable using the optional base for the conversion */ -PHP_FUNCTION(intval) -{ - zval **num, **arg_base; - int base; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - base = 10; - break; - - case 2: - if (zend_get_parameters_ex(2, &num, &arg_base) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(arg_base); - base = Z_LVAL_PP(arg_base); - break; - - default: - WRONG_PARAM_COUNT; - } - - RETVAL_ZVAL(*num, 1, 0); - convert_to_long_base(return_value, base); -} -/* }}} */ - -/* {{{ proto float floatval(mixed var) - Get the float value of a variable */ -PHP_FUNCTION(floatval) -{ - zval **num; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - RETVAL_ZVAL(*num, 1, 0); - convert_to_double(return_value); -} -/* }}} */ - -/* {{{ proto string strval(mixed var) - Get the string value of a variable */ -PHP_FUNCTION(strval) -{ - zval **num, *tmp; - zval expr_copy; - int use_copy; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - zend_make_printable_zval(*num, &expr_copy, &use_copy); - if (use_copy) { - tmp = &expr_copy; - RETVAL_ZVAL(tmp, 0, 0); - } else { - RETVAL_ZVAL(*num, 1, 0); - } -} -/* }}} */ - -static void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only one argument expected"); - RETURN_FALSE; - } - - if (Z_TYPE_PP(arg) == type) { - if (type == IS_OBJECT) { - zend_class_entry *ce; - if(Z_OBJ_HT_PP(arg)->get_class_entry == NULL) { - /* if there's no get_class_entry it's not a PHP object, so it can't be INCOMPLETE_CLASS */ - RETURN_TRUE; - } - ce = Z_OBJCE_PP(arg); - if (!strcmp(ce->name, INCOMPLETE_CLASS)) { - RETURN_FALSE; - } - } - if (type == IS_RESOURCE) { - char *type_name; - type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) TSRMLS_CC); - if (!type_name) { - RETURN_FALSE; - } - } - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} - - -/* {{{ proto bool is_null(mixed var) - Returns true if variable is null */ -PHP_FUNCTION(is_null) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_NULL); -} -/* }}} */ - -/* {{{ proto bool is_resource(mixed var) - Returns true if variable is a resource */ -PHP_FUNCTION(is_resource) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_RESOURCE); -} -/* }}} */ - -/* {{{ proto bool is_bool(mixed var) - Returns true if variable is a boolean */ -PHP_FUNCTION(is_bool) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_BOOL); -} -/* }}} */ - -/* {{{ proto bool is_long(mixed var) - Returns true if variable is a long (integer) */ -PHP_FUNCTION(is_long) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_LONG); -} -/* }}} */ - -/* {{{ proto bool is_float(mixed var) - Returns true if variable is float point*/ -PHP_FUNCTION(is_float) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_DOUBLE); -} -/* }}} */ - -/* {{{ proto bool is_string(mixed var) - Returns true if variable is a string */ -PHP_FUNCTION(is_string) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_STRING); -} -/* }}} */ - -/* {{{ proto bool is_array(mixed var) - Returns true if variable is an array */ -PHP_FUNCTION(is_array) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_ARRAY); -} -/* }}} */ - -/* {{{ proto bool is_object(mixed var) - Returns true if variable is an object */ -PHP_FUNCTION(is_object) -{ - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_OBJECT); -} -/* }}} */ - -/* {{{ proto bool is_numeric(mixed value) - Returns true if value is a number or a numeric string */ -PHP_FUNCTION(is_numeric) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (Z_TYPE_PP(arg)) { - case IS_LONG: - case IS_DOUBLE: - RETURN_TRUE; - break; - - case IS_STRING: - if (is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), NULL, NULL, 0)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } - break; - - default: - RETURN_FALSE; - break; - } -} -/* }}} */ - -/* {{{ proto bool is_scalar(mixed value) - Returns true if value is a scalar */ -PHP_FUNCTION(is_scalar) -{ - zval **arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (Z_TYPE_PP(arg)) { - case IS_BOOL: - case IS_DOUBLE: - case IS_LONG: - case IS_STRING: - RETURN_TRUE; - break; - - default: - RETURN_FALSE; - break; - } -} -/* }}} */ - -/* {{{ proto bool is_callable(mixed var [, bool syntax_only [, string callable_name]]) - Returns true if var is callable. */ -PHP_FUNCTION(is_callable) -{ - zval **var, **syntax_only, **callable_name; - char *name; - zend_bool retval; - zend_bool syntax = 0; - int argc=ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &var, &syntax_only, &callable_name) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (argc > 1) { - convert_to_boolean_ex(syntax_only); - syntax = Z_BVAL_PP(syntax_only); - } - - if (argc > 2) { - retval = zend_is_callable(*var, syntax, &name); - zval_dtor(*callable_name); - ZVAL_STRING(*callable_name, name, 0); - } else { - retval = zend_is_callable(*var, syntax, NULL); - } - - RETURN_BOOL(retval); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c deleted file mode 100644 index d7b5fbb1142e0..0000000000000 --- a/ext/standard/uniqid.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Stig Sæther Bakken | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#include -#if HAVE_UNISTD_H -#include -#endif - -#include -#include - -#include -#ifdef PHP_WIN32 -#include "win32/time.h" -#else -#include -#endif - -#include "php_lcg.h" -#include "uniqid.h" - -/* {{{ proto string uniqid([string prefix [, bool more_entropy]]) - Generates a unique ID */ -#ifdef HAVE_GETTIMEOFDAY -PHP_FUNCTION(uniqid) -{ - char *prefix = ""; -#if defined(__CYGWIN__) - zend_bool more_entropy = 1; -#else - zend_bool more_entropy = 0; -#endif - char *uniqid; - int sec, usec, prefix_len = 0; - struct timeval tv; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &prefix, &prefix_len, - &more_entropy)) { - return; - } - -#if HAVE_USLEEP && !defined(PHP_WIN32) - if (!more_entropy) { -#if defined(__CYGWIN__) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must use 'more entropy' under CYGWIN"); - RETURN_FALSE; -#else - usleep(1); -#endif - } -#endif - gettimeofday((struct timeval *) &tv, (struct timezone *) NULL); - sec = (int) tv.tv_sec; - usec = (int) (tv.tv_usec % 0x100000); - - /* The max value usec can have is 0xF423F, so we use only five hex - * digits for usecs. - */ - if (more_entropy) { - spprintf(&uniqid, 0, "%s%08x%05x%.8F", prefix, sec, usec, php_combined_lcg(TSRMLS_C) * 10); - } else { - spprintf(&uniqid, 0, "%s%08x%05x", prefix, sec, usec); - } - - RETURN_STRING(uniqid, 0); -} -#endif -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/uniqid.h b/ext/standard/uniqid.h deleted file mode 100644 index 6e923971ee252..0000000000000 --- a/ext/standard/uniqid.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Stig Sæther Bakken | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef UNIQID_H -#define UNIQID_H - -#ifdef HAVE_GETTIMEOFDAY -PHP_FUNCTION(uniqid); -#endif - -#endif /* UNIQID_H */ diff --git a/ext/standard/url.c b/ext/standard/url.c deleted file mode 100644 index 2a6463dddc895..0000000000000 --- a/ext/standard/url.c +++ /dev/null @@ -1,744 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Jim Winstead | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include -#include -#include -#include - -#include "php.h" - -#include "url.h" -#include "file.h" -#ifdef _OSD_POSIX -#ifndef APACHE -#error On this EBCDIC platform, PHP is only supported as an Apache module. -#else /*APACHE*/ -#ifndef CHARSET_EBCDIC -#define CHARSET_EBCDIC /* this machine uses EBCDIC, not ASCII! */ -#endif -#include "ebcdic.h" -#endif /*APACHE*/ -#endif /*_OSD_POSIX*/ - -/* {{{ free_url - */ -PHPAPI void php_url_free(php_url *theurl) -{ - if (theurl->scheme) - efree(theurl->scheme); - if (theurl->user) - efree(theurl->user); - if (theurl->pass) - efree(theurl->pass); - if (theurl->host) - efree(theurl->host); - if (theurl->path) - efree(theurl->path); - if (theurl->query) - efree(theurl->query); - if (theurl->fragment) - efree(theurl->fragment); - efree(theurl); -} -/* }}} */ - -/* {{{ php_replace_controlchars - */ -PHPAPI char *php_replace_controlchars_ex(char *str, int len) -{ - unsigned char *s = (unsigned char *)str; - unsigned char *e = (unsigned char *)str + len; - - if (!str) { - return (NULL); - } - - while (s < e) { - - if (iscntrl(*s)) { - *s='_'; - } - s++; - } - - return (str); -} -/* }}} */ - -PHPAPI char *php_replace_controlchars(char *str) -{ - return php_replace_controlchars_ex(str, strlen(str)); -} - -PHPAPI php_url *php_url_parse(char const *str) -{ - return php_url_parse_ex(str, strlen(str)); -} - -/* {{{ php_url_parse - */ -PHPAPI php_url *php_url_parse_ex(char const *str, int length) -{ - char port_buf[6]; - php_url *ret = ecalloc(1, sizeof(php_url)); - char const *s, *e, *p, *pp, *ue; - - s = str; - ue = s + length; - - /* parse scheme */ - if ((e = memchr(s, ':', length)) && (e - s)) { - /* validate scheme */ - p = s; - while (p < e) { - /* scheme = 1*[ lowalpha | digit | "+" | "-" | "." ] */ - if (!isalpha(*p) && !isdigit(*p) && *p != '+' && *p != '.' && *p != '-') { - if (e + 1 < ue) { - goto parse_port; - } else { - goto just_path; - } - } - p++; - } - - if (*(e + 1) == '\0') { /* only scheme is available */ - ret->scheme = estrndup(s, (e - s)); - php_replace_controlchars_ex(ret->scheme, (e - s)); - goto end; - } - - /* - * certain schemas like mailto: and zlib: may not have any / after them - * this check ensures we support those. - */ - if (*(e+1) != '/') { - /* check if the data we get is a port this allows us to - * correctly parse things like a.com:80 - */ - p = e + 1; - while (isdigit(*p)) { - p++; - } - - if ((*p == '\0' || *p == '/') && (p - e) < 7) { - goto parse_port; - } - - ret->scheme = estrndup(s, (e-s)); - php_replace_controlchars_ex(ret->scheme, (e - s)); - - length -= ++e - s; - s = e; - goto just_path; - } else { - ret->scheme = estrndup(s, (e-s)); - php_replace_controlchars_ex(ret->scheme, (e - s)); - - if (*(e+2) == '/') { - s = e + 3; - if (!strncasecmp("file", ret->scheme, sizeof("file"))) { - if (*(e + 3) == '/') { - /* support windows drive letters as in: - file:///c:/somedir/file.txt - */ - if (*(e + 5) == ':') { - s = e + 4; - } - goto nohost; - } - } - } else { - if (!strncasecmp("file", ret->scheme, sizeof("file"))) { - s = e + 1; - goto nohost; - } else { - length -= ++e - s; - s = e; - goto just_path; - } - } - } - } else if (e) { /* no scheme, look for port */ - parse_port: - p = e + 1; - pp = p; - - while (pp-p < 6 && isdigit(*pp)) { - pp++; - } - - if (pp-p < 6 && (*pp == '/' || *pp == '\0')) { - memcpy(port_buf, p, (pp-p)); - port_buf[pp-p] = '\0'; - ret->port = atoi(port_buf); - } else { - goto just_path; - } - } else { - just_path: - ue = s + length; - goto nohost; - } - - e = ue; - - if (!(p = memchr(s, '/', (ue - s)))) { - if ((p = memchr(s, '?', (ue - s)))) { - e = p; - } else if ((p = memchr(s, '#', (ue - s)))) { - e = p; - } - } else { - e = p; - } - - /* check for login and password */ - if ((p = zend_memrchr(s, '@', (e-s)))) { - if ((pp = memchr(s, ':', (p-s)))) { - if ((pp-s) > 0) { - ret->user = estrndup(s, (pp-s)); - php_replace_controlchars_ex(ret->user, (pp - s)); - } - - pp++; - if (p-pp > 0) { - ret->pass = estrndup(pp, (p-pp)); - php_replace_controlchars_ex(ret->pass, (p-pp)); - } - } else { - ret->user = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->user, (p-s)); - } - - s = p + 1; - } - - /* check for port */ - if (*s == '[' && *(e-1) == ']') { - /* Short circuit portscan, - we're dealing with an - IPv6 embedded address */ - p = s; - } else { - /* memrchr is a GNU specific extension - Emulate for wide compatability */ - for(p = e; *p != ':' && p >= s; p--); - } - - if (p >= s && *p == ':') { - if (!ret->port) { - p++; - if (e-p > 5) { /* port cannot be longer then 5 characters */ - STR_FREE(ret->scheme); - STR_FREE(ret->user); - STR_FREE(ret->pass); - efree(ret); - return NULL; - } else if (e - p > 0) { - memcpy(port_buf, p, (e-p)); - port_buf[e-p] = '\0'; - ret->port = atoi(port_buf); - } - p--; - } - } else { - p = e; - } - - /* check if we have a valid host, if we don't reject the string as url */ - if ((p-s) < 1) { - STR_FREE(ret->scheme); - STR_FREE(ret->user); - STR_FREE(ret->pass); - efree(ret); - return NULL; - } - - ret->host = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->host, (p - s)); - - if (e == ue) { - return ret; - } - - s = e; - - nohost: - - if ((p = memchr(s, '?', (ue - s)))) { - pp = strchr(s, '#'); - - if (pp && pp < p) { - p = pp; - pp = strchr(pp+2, '#'); - } - - if (p - s) { - ret->path = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->path, (p - s)); - } - - if (pp) { - if (pp - ++p) { - ret->query = estrndup(p, (pp-p)); - php_replace_controlchars_ex(ret->query, (pp - p)); - } - p = pp; - goto label_parse; - } else if (++p - ue) { - ret->query = estrndup(p, (ue-p)); - php_replace_controlchars_ex(ret->query, (ue - p)); - } - } else if ((p = memchr(s, '#', (ue - s)))) { - if (p - s) { - ret->path = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->path, (p - s)); - } - - label_parse: - p++; - - if (ue - p) { - ret->fragment = estrndup(p, (ue-p)); - php_replace_controlchars_ex(ret->fragment, (ue - p)); - } - } else { - ret->path = estrndup(s, (ue-s)); - php_replace_controlchars_ex(ret->path, (ue - s)); - } -end: - return ret; -} -/* }}} */ - -/* {{{ proto mixed parse_url(string url, [int url_component]) - Parse a URL and return its components */ -PHP_FUNCTION(parse_url) -{ - char *str; - int str_len; - php_url *resource; - long key = -1; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &key) == FAILURE) { - return; - } - - resource = php_url_parse_ex(str, str_len); - if (resource == NULL) { - php_error_docref1(NULL TSRMLS_CC, str, E_WARNING, "Unable to parse URL"); - RETURN_FALSE; - } - - if (key > -1) { - switch (key) { - case PHP_URL_SCHEME: - if (resource->scheme != NULL) RETVAL_STRING(resource->scheme, 1); - break; - case PHP_URL_HOST: - if (resource->host != NULL) RETVAL_STRING(resource->host, 1); - break; - case PHP_URL_PORT: - if (resource->port != 0) RETVAL_LONG(resource->port); - break; - case PHP_URL_USER: - if (resource->user != NULL) RETVAL_STRING(resource->user, 1); - break; - case PHP_URL_PASS: - if (resource->pass != NULL) RETVAL_STRING(resource->pass, 1); - break; - case PHP_URL_PATH: - if (resource->path != NULL) RETVAL_STRING(resource->path, 1); - break; - case PHP_URL_QUERY: - if (resource->query != NULL) RETVAL_STRING(resource->query, 1); - break; - case PHP_URL_FRAGMENT: - if (resource->fragment != NULL) RETVAL_STRING(resource->fragment, 1); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier %ld", key); - RETVAL_FALSE; - } - goto done; - } - - /* allocate an array for return */ - array_init(return_value); - - /* add the various elements to the array */ - if (resource->scheme != NULL) - add_assoc_string(return_value, "scheme", resource->scheme, 1); - if (resource->host != NULL) - add_assoc_string(return_value, "host", resource->host, 1); - if (resource->port != 0) - add_assoc_long(return_value, "port", resource->port); - if (resource->user != NULL) - add_assoc_string(return_value, "user", resource->user, 1); - if (resource->pass != NULL) - add_assoc_string(return_value, "pass", resource->pass, 1); - if (resource->path != NULL) - add_assoc_string(return_value, "path", resource->path, 1); - if (resource->query != NULL) - add_assoc_string(return_value, "query", resource->query, 1); - if (resource->fragment != NULL) - add_assoc_string(return_value, "fragment", resource->fragment, 1); -done: - php_url_free(resource); -} -/* }}} */ - -/* {{{ php_htoi - */ -static int php_htoi(char *s) -{ - int value; - int c; - - c = ((unsigned char *)s)[0]; - if (isupper(c)) - c = tolower(c); - value = (c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10) * 16; - - c = ((unsigned char *)s)[1]; - if (isupper(c)) - c = tolower(c); - value += c >= '0' && c <= '9' ? c - '0' : c - 'a' + 10; - - return (value); -} -/* }}} */ - -/* rfc1738: - - ...The characters ";", - "/", "?", ":", "@", "=" and "&" are the characters which may be - reserved for special meaning within a scheme... - - ...Thus, only alphanumerics, the special characters "$-_.+!*'(),", and - reserved characters used for their reserved purposes may be used - unencoded within a URL... - - For added safety, we only leave -_. unencoded. - */ - -static unsigned char hexchars[] = "0123456789ABCDEF"; - -/* {{{ php_url_encode - */ -PHPAPI char *php_url_encode(char const *s, int len, int *new_length) -{ - register unsigned char c; - unsigned char *to, *start; - unsigned char const *from, *end; - - from = s; - end = s + len; - start = to = (unsigned char *) safe_emalloc(3, len, 1); - - while (from < end) { - c = *from++; - - if (c == ' ') { - *to++ = '+'; -#ifndef CHARSET_EBCDIC - } else if ((c < '0' && c != '-' && c != '.') || - (c < 'A' && c > '9') || - (c > 'Z' && c < 'a' && c != '_') || - (c > 'z')) { - to[0] = '%'; - to[1] = hexchars[c >> 4]; - to[2] = hexchars[c & 15]; - to += 3; -#else /*CHARSET_EBCDIC*/ - } else if (!isalnum(c) && strchr("_-.", c) == NULL) { - /* Allow only alphanumeric chars and '_', '-', '.'; escape the rest */ - to[0] = '%'; - to[1] = hexchars[os_toascii[c] >> 4]; - to[2] = hexchars[os_toascii[c] & 15]; - to += 3; -#endif /*CHARSET_EBCDIC*/ - } else { - *to++ = c; - } - } - *to = 0; - if (new_length) { - *new_length = to - start; - } - return (char *) start; -} -/* }}} */ - -/* {{{ proto string urlencode(string str) - URL-encodes string */ -PHP_FUNCTION(urlencode) -{ - char *in_str, *out_str; - int in_str_len, out_str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in_str, - &in_str_len) == FAILURE) { - return; - } - - out_str = php_url_encode(in_str, in_str_len, &out_str_len); - RETURN_STRINGL(out_str, out_str_len, 0); -} -/* }}} */ - -/* {{{ proto string urldecode(string str) - Decodes URL-encoded string */ -PHP_FUNCTION(urldecode) -{ - char *in_str, *out_str; - int in_str_len, out_str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in_str, - &in_str_len) == FAILURE) { - return; - } - - out_str = estrndup(in_str, in_str_len); - out_str_len = php_url_decode(out_str, in_str_len); - - RETURN_STRINGL(out_str, out_str_len, 0); -} -/* }}} */ - -/* {{{ php_url_decode - */ -PHPAPI int php_url_decode(char *str, int len) -{ - char *dest = str; - char *data = str; - - while (len--) { - if (*data == '+') { - *dest = ' '; - } - else if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) - && isxdigit((int) *(data + 2))) { -#ifndef CHARSET_EBCDIC - *dest = (char) php_htoi(data + 1); -#else - *dest = os_toebcdic[(char) php_htoi(data + 1)]; -#endif - data += 2; - len -= 2; - } else { - *dest = *data; - } - data++; - dest++; - } - *dest = '\0'; - return dest - str; -} -/* }}} */ - -/* {{{ php_raw_url_encode - */ -PHPAPI char *php_raw_url_encode(char const *s, int len, int *new_length) -{ - register int x, y; - unsigned char *str; - - str = (unsigned char *) safe_emalloc(3, len, 1); - for (x = 0, y = 0; len--; x++, y++) { - str[y] = (unsigned char) s[x]; -#ifndef CHARSET_EBCDIC - if ((str[y] < '0' && str[y] != '-' && str[y] != '.') || - (str[y] < 'A' && str[y] > '9') || - (str[y] > 'Z' && str[y] < 'a' && str[y] != '_') || - (str[y] > 'z')) { - str[y++] = '%'; - str[y++] = hexchars[(unsigned char) s[x] >> 4]; - str[y] = hexchars[(unsigned char) s[x] & 15]; -#else /*CHARSET_EBCDIC*/ - if (!isalnum(str[y]) && strchr("_-.", str[y]) != NULL) { - str[y++] = '%'; - str[y++] = hexchars[os_toascii[(unsigned char) s[x]] >> 4]; - str[y] = hexchars[os_toascii[(unsigned char) s[x]] & 15]; -#endif /*CHARSET_EBCDIC*/ - } - } - str[y] = '\0'; - if (new_length) { - *new_length = y; - } - return ((char *) str); -} -/* }}} */ - -/* {{{ proto string rawurlencode(string str) - URL-encodes string */ -PHP_FUNCTION(rawurlencode) -{ - char *in_str, *out_str; - int in_str_len, out_str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in_str, - &in_str_len) == FAILURE) { - return; - } - - out_str = php_raw_url_encode(in_str, in_str_len, &out_str_len); - RETURN_STRINGL(out_str, out_str_len, 0); -} -/* }}} */ - -/* {{{ proto string rawurldecode(string str) - Decodes URL-encodes string */ -PHP_FUNCTION(rawurldecode) -{ - char *in_str, *out_str; - int in_str_len, out_str_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in_str, - &in_str_len) == FAILURE) { - return; - } - - out_str = estrndup(in_str, in_str_len); - out_str_len = php_raw_url_decode(out_str, in_str_len); - - RETURN_STRINGL(out_str, out_str_len, 0); -} -/* }}} */ - -/* {{{ php_raw_url_decode - */ -PHPAPI int php_raw_url_decode(char *str, int len) -{ - char *dest = str; - char *data = str; - - while (len--) { - if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) - && isxdigit((int) *(data + 2))) { -#ifndef CHARSET_EBCDIC - *dest = (char) php_htoi(data + 1); -#else - *dest = os_toebcdic[(char) php_htoi(data + 1)]; -#endif - data += 2; - len -= 2; - } else { - *dest = *data; - } - data++; - dest++; - } - *dest = '\0'; - return dest - str; -} -/* }}} */ - -/* {{{ proto array get_headers(string url[, int format]) - fetches all the headers sent by the server in response to a HTTP request */ -PHP_FUNCTION(get_headers) -{ - char *url; - int url_len; - php_stream_context *context; - php_stream *stream; - zval **prev_val, **hdr = NULL, **h; - HashPosition pos; - HashTable *hashT; - long format = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) { - return; - } - context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc()); - - if (!(stream = php_stream_open_wrapper_ex(url, "r", REPORT_ERRORS | STREAM_USE_URL | STREAM_ONLY_GET_HEADERS, NULL, context))) { - RETURN_FALSE; - } - - if (!stream->wrapperdata || Z_TYPE_P(stream->wrapperdata) != IS_ARRAY) { - php_stream_close(stream); - RETURN_FALSE; - } - - array_init(return_value); - - /* check for curl-wrappers that provide headers via a special "headers" element */ - if (zend_hash_find(HASH_OF(stream->wrapperdata), "headers", sizeof("headers"), (void **)&h) != FAILURE && Z_TYPE_PP(h) == IS_ARRAY) { - /* curl-wrappers don't load data until the 1st read */ - if (!Z_ARRVAL_PP(h)->nNumOfElements) { - php_stream_getc(stream); - } - zend_hash_find(HASH_OF(stream->wrapperdata), "headers", sizeof("headers"), (void **)&h); - hashT = Z_ARRVAL_PP(h); - } else { - hashT = HASH_OF(stream->wrapperdata); - } - - zend_hash_internal_pointer_reset_ex(hashT, &pos); - while (zend_hash_get_current_data_ex(hashT, (void**)&hdr, &pos) != FAILURE) { - if (!hdr || Z_TYPE_PP(hdr) != IS_STRING) { - zend_hash_move_forward_ex(hashT, &pos); - continue; - } - if (!format) { -no_name_header: - add_next_index_stringl(return_value, Z_STRVAL_PP(hdr), Z_STRLEN_PP(hdr), 1); - } else { - char c; - char *s, *p; - - if ((p = strchr(Z_STRVAL_PP(hdr), ':'))) { - c = *p; - *p = '\0'; - s = p + 1; - while (isspace((int)*(unsigned char *)s)) { - s++; - } - - if (zend_hash_find(HASH_OF(return_value), Z_STRVAL_PP(hdr), (p - Z_STRVAL_PP(hdr) + 1), (void **) &prev_val) == FAILURE) { - add_assoc_stringl_ex(return_value, Z_STRVAL_PP(hdr), (p - Z_STRVAL_PP(hdr) + 1), s, (Z_STRLEN_PP(hdr) - (s - Z_STRVAL_PP(hdr))), 1); - } else { /* some headers may occur more then once, therefor we need to remake the string into an array */ - convert_to_array(*prev_val); - add_next_index_stringl(*prev_val, s, (Z_STRLEN_PP(hdr) - (s - Z_STRVAL_PP(hdr))), 1); - } - - *p = c; - } else { - goto no_name_header; - } - } - zend_hash_move_forward_ex(hashT, &pos); - } - - php_stream_close(stream); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/url.h b/ext/standard/url.h deleted file mode 100644 index 0cf20838b3d87..0000000000000 --- a/ext/standard/url.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Jim Winstead | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef URL_H -#define URL_H - -typedef struct php_url { - char *scheme; - char *user; - char *pass; - char *host; - unsigned short port; - char *path; - char *query; - char *fragment; -} php_url; - -PHPAPI void php_url_free(php_url *theurl); -PHPAPI php_url *php_url_parse(char const *str); -PHPAPI php_url *php_url_parse_ex(char const *str, int length); -PHPAPI int php_url_decode(char *str, int len); /* return value: length of decoded string */ -PHPAPI int php_raw_url_decode(char *str, int len); /* return value: length of decoded string */ -PHPAPI char *php_url_encode(char const *s, int len, int *new_length); -PHPAPI char *php_raw_url_encode(char const *s, int len, int *new_length); - -PHP_FUNCTION(parse_url); -PHP_FUNCTION(urlencode); -PHP_FUNCTION(urldecode); -PHP_FUNCTION(rawurlencode); -PHP_FUNCTION(rawurldecode); -PHP_FUNCTION(get_headers); - -#define PHP_URL_SCHEME 0 -#define PHP_URL_HOST 1 -#define PHP_URL_PORT 2 -#define PHP_URL_USER 3 -#define PHP_URL_PASS 4 -#define PHP_URL_PATH 5 -#define PHP_URL_QUERY 6 -#define PHP_URL_FRAGMENT 7 - -#endif /* URL_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/standard/url_scanner.c b/ext/standard/url_scanner.c deleted file mode 100644 index b72ab976fe635..0000000000000 --- a/ext/standard/url_scanner.c +++ /dev/null @@ -1,373 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php.h" - -#include "php_globals.h" - -#include -#include -#include -#include -#include "basic_functions.h" -#include "url_scanner.h" - -#ifndef BUFSIZE -#define BUFSIZE 256 -#endif - -int php_url_scanner_activate(TSRMLS_D) -{ - url_adapt(NULL,0,NULL,NULL); - return SUCCESS; -} - - -int php_url_scanner_deactivate(TSRMLS_D) -{ - url_adapt(NULL,0,NULL,NULL); - return SUCCESS; -} - -/* {{{ url_attr_addon - */ -static char *url_attr_addon(const char *tag,const char *attr,const char *val,const char *buf) -{ - int flag = 0; - - if (!strcasecmp(tag,"a") && !strcasecmp(attr,"href")) { - flag = 1; - } else if (!strcasecmp(tag,"area" ) && !strcasecmp(attr,"href" )) { - flag = 1; - } else if (!strcasecmp(tag,"form" ) && !strcasecmp(attr,"action" )) { - flag = 1; - } else if (!strcasecmp(tag,"frame") && !strcasecmp(attr,"source" )) { - flag = 1; - } else if (!strcasecmp(tag,"img" ) && !strcasecmp(attr,"action" )) { - flag = 1; - } - if(flag && !strstr(val,buf) && !strchr(val,':')) { - char *result; - TSRMLS_FETCH(); - - spprintf(&result, 0, "%s%s", (strchr(val,'?') ? PG(arg_separator).output : "?"), buf); - return result; - } - return NULL; -} -/* }}} */ - -#define US BG(url_adapt_state) - -/* {{{ url_adapt_ext - */ -char *url_adapt_ext(const char *src, uint srclen, const char *name, const char *val, size_t *newlen) -{ - char buf[1024]; - - snprintf(buf, sizeof(buf)-1, "%s=%s", name, val); - - return url_adapt(src, srclen, buf, newlen); -} -/* }}} */ - -/* {{{ url_adapt - */ -char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen) -{ - char *out,*outp; - int maxl,n; - TSRMLS_FETCH(); - - if(src==NULL) { - US.state=STATE_NORMAL; - if(US.tag) { efree(US.tag); US.tag =NULL; } - if(US.attr) { efree(US.attr); US.attr=NULL; } - if(US.val) { efree(US.val); US.val =NULL; } - return NULL; - } - - if(srclen==0) - srclen=strlen(src); - - out=malloc(srclen+1); - maxl=srclen; - n=srclen; - - *newlen=0; - outp=out; - - while(n--) { - switch(US.state) { - case STATE_NORMAL: - if(*src=='<') - US.state=STATE_TAG_START; - break; - - case STATE_TAG_START: - if(! isalnum(*src)) - US.state=STATE_NORMAL; - US.state=STATE_TAG; - US.ml=BUFSIZE; - US.p=US.tag=erealloc(US.tag,US.ml); - *(US.p)++=*src; - US.l=1; - break; - - case STATE_TAG: - if(isalnum(*src)) { - *(US.p)++ = *src; - US.l++; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.tag=erealloc(US.tag,US.ml); - US.p = US.tag+US.l; - } - } else if (isspace(*src)) { - US.state = STATE_IN_TAG; - *US.p='\0'; - US.tag=erealloc(US.tag,US.l); - } else { - US.state = STATE_NORMAL; - efree(US.tag); - US.tag=NULL; - } - break; - - case STATE_IN_TAG: - if(isalnum(*src)) { - US.state=STATE_TAG_ATTR; - US.ml=BUFSIZE; - US.p=US.attr=erealloc(US.attr,US.ml); - *(US.p)++=*src; - US.l=1; - } else if (! isspace(*src)) { - US.state = STATE_NORMAL; - efree(US.tag); - US.tag=NULL; - } - break; - - case STATE_TAG_ATTR: - if(isalnum(*src)) { - *US.p++=*src; - ++US.l; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.attr=erealloc(US.attr,US.ml); - US.p = US.attr+US.l; - } - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.attr=erealloc(US.attr,US.ml); - US.p = US.attr+US.l; - } - } else if(isspace(*src)||(*src=='=')){ - US.state=STATE_TAG_IS; - *US.p=0; - US.attr=erealloc(US.attr,US.l); - } else if(*src=='>') { - US.state=STATE_NORMAL; - } else { - efree(US.attr); - US.attr=NULL; - US.state=STATE_IN_TAG; - } - break; - - case STATE_TAG_IS: - case STATE_TAG_IS2: - if(*src=='>'){ - US.state=STATE_NORMAL; - if(! (US.attr_done)) { - char *p; - p=url_attr_addon(US.tag,US.attr,"",data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strlcpy(outp,p,maxl); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else if(*src=='#') { - if(! (US.attr_done)) { - char *p; - US.attr_done=1; - p=url_attr_addon(US.tag,US.attr,"#",data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strlcpy(outp, p, maxl); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else if(!isspace(*src)&&(*src!='=')) { - US.ml=BUFSIZE; - US.p=US.val=erealloc(US.val,US.ml); - US.l=0; - US.attr_done=0; - if((*src=='"')||(*src=='\'')) { - US.state=STATE_TAG_QVAL2; - US.delim=*src; - } else { - US.state=STATE_TAG_VAL; - *US.p++=*src; - US.l++; - } - } - break; - - - case STATE_TAG_QVAL2: - if(*src=='#') { - if(! (US.attr_done)) { - char *p; - US.attr_done=1; - *US.p='\0'; - p=url_attr_addon(US.tag,US.attr,US.val,data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strlcpy(outp,p,maxl); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else if(*src==US.delim) { - US.state=STATE_IN_TAG; - *US.p='\0'; - if(! (US.attr_done)) { - char *p; - p=url_attr_addon(US.tag,US.attr,US.val,data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strlcpy(outp,p,maxl); - outp+=l; - *newlen+=l; - efree(p); - } - } - break; - } else if(*src=='\\') { - US.state=STATE_TAG_QVAL2b; - } else if (*src=='>') { - US.state=STATE_NORMAL; - } - - *US.p++=*src; - ++US.l; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.val=erealloc(US.val,US.ml); - US.p = US.val+US.l; - } - - break; - - case STATE_TAG_QVAL2b: - US.state=STATE_TAG_QVAL2; - *US.p++=*src; - ++US.l; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.val=erealloc(US.val,US.ml); - US.p = US.val+US.l; - } - break; - - case STATE_TAG_VAL: - case STATE_TAG_VAL2: - if(*src=='#') { - if(! (US.attr_done)) { - char *p; - US.attr_done=1; - *US.p='\0'; - p=url_attr_addon(US.tag,US.attr,US.val,data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strlcpy(outp,p,maxl); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else if(isspace(*src)||(*src=='>')) { - US.state=(*src=='>')?STATE_NORMAL:STATE_IN_TAG; - *US.p='\0'; - if(! (US.attr_done)) { - char *p; - p=url_attr_addon(US.tag,US.attr,US.val,data); - if(p) { - int l= strlen(p); - maxl+=l; - out=realloc(out,maxl); - outp=out+*newlen; - strlcpy(outp,p,maxl); - outp+=l; - *newlen+=l; - efree(p); - } - } - } else { - *US.p++=*src; - US.l++; - if(US.l==US.ml) { - US.ml+=BUFSIZE; - US.val=erealloc(US.val,US.ml); - US.p = US.val+US.l; - } - } - break; - default: - break; - } - - *outp++=*src++; - *newlen+=1; - } - *outp='\0'; - return out; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/url_scanner.h b/ext/standard/url_scanner.h deleted file mode 100644 index 166beaf7e0aac..0000000000000 --- a/ext/standard/url_scanner.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef URI_SCANNER_H -#define URI_SCANNER_H - -int php_url_scanner_activate(TSRMLS_D); -int php_url_scanner_deactivate(TSRMLS_D); - -char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen); - -enum url_state { - STATE_NORMAL, - STATE_TAG_START, - STATE_TAG, - STATE_IN_TAG, - STATE_TAG_ATTR, - STATE_TAG_IS, - STATE_TAG_IS2, - STATE_TAG_VAL, - STATE_TAG_VAL2, - STATE_TAG_QVAL1, - STATE_TAG_QVAL2, - STATE_TAG_QVAL2b -}; - -typedef struct url_adapt_struct { - enum url_state state; - char *tag; - char *attr; - char *val; - char delim; - char *p; - int l, ml; - int attr_done; -} url_adapt_state_t; - -#endif diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c deleted file mode 100644 index b93190c3b2570..0000000000000 --- a/ext/standard/url_scanner_ex.c +++ /dev/null @@ -1,1106 +0,0 @@ -/* Generated by re2c 0.13.5 on Wed Jul 2 12:48:53 2008 */ -#line 1 "ext/standard/url_scanner_ex.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_LIMITS_H -#include -#endif - -#include -#include -#include - -#include "php_ini.h" -#include "php_globals.h" -#define STATE_TAG SOME_OTHER_STATE_TAG -#include "basic_functions.h" -#include "url.h" -#undef STATE_TAG - -#define url_scanner url_scanner_ex - -#include "php_smart_str.h" - -static PHP_INI_MH(OnUpdateTags) -{ - url_adapt_state_ex_t *ctx; - char *key; - char *lasts; - char *tmp; - - ctx = &BG(url_adapt_state_ex); - - tmp = estrndup(new_value, new_value_length); - - if (ctx->tags) - zend_hash_destroy(ctx->tags); - else - ctx->tags = malloc(sizeof(HashTable)); - - zend_hash_init(ctx->tags, 0, NULL, NULL, 1); - - for (key = php_strtok_r(tmp, ",", &lasts); - key; - key = php_strtok_r(NULL, ",", &lasts)) { - char *val; - - val = strchr(key, '='); - if (val) { - char *q; - int keylen; - - *val++ = '\0'; - for (q = key; *q; q++) - *q = tolower(*q); - keylen = q - key; - /* key is stored withOUT NUL - val is stored WITH NUL */ - zend_hash_add(ctx->tags, key, keylen, val, strlen(val)+1, NULL); - } - } - - efree(tmp); - - return SUCCESS; -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals) -PHP_INI_END() - -#line 98 "ext/standard/url_scanner_ex.re" - - -#define YYFILL(n) goto done -#define YYCTYPE unsigned char -#define YYCURSOR p -#define YYLIMIT q -#define YYMARKER r - -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator) -{ - register const char *p, *q; - const char *bash = NULL; - const char *sep = "?"; - - q = (p = url->c) + url->len; - -scan: - -#line 114 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 128, 128, 128, 128, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy8; - } - if (yych <= '9') goto yy6; - if (yych >= ';') goto yy4; - ++YYCURSOR; -#line 116 "ext/standard/url_scanner_ex.re" - { smart_str_append(dest, url); return; } -#line 162 "ext/standard/url_scanner_ex.c" -yy4: - ++YYCURSOR; -#line 117 "ext/standard/url_scanner_ex.re" - { sep = separator; goto scan; } -#line 167 "ext/standard/url_scanner_ex.c" -yy6: - ++YYCURSOR; -#line 118 "ext/standard/url_scanner_ex.re" - { bash = p - 1; goto done; } -#line 172 "ext/standard/url_scanner_ex.c" -yy8: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy8; - } -#line 119 "ext/standard/url_scanner_ex.re" - { goto scan; } -#line 182 "ext/standard/url_scanner_ex.c" -} -#line 120 "ext/standard/url_scanner_ex.re" - -done: - - /* Don't modify URLs of the format "#mark" */ - if (bash && bash - url->c == 0) { - smart_str_append(dest, url); - return; - } - - if (bash) - smart_str_appendl(dest, url->c, bash - url->c); - else - smart_str_append(dest, url); - - smart_str_appends(dest, sep); - smart_str_append(dest, url_app); - - if (bash) - smart_str_appendl(dest, bash, q - bash); -} - - -#undef YYFILL -#undef YYCTYPE -#undef YYCURSOR -#undef YYLIMIT -#undef YYMARKER - -static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC) -{ - char f = 0; - - if (strncasecmp(ctx->arg.c, ctx->lookup_data, ctx->arg.len) == 0) - f = 1; - - if (quotes) - smart_str_appendc(&ctx->result, type); - if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output); - } else { - smart_str_append(&ctx->result, &ctx->val); - } - if (quotes) - smart_str_appendc(&ctx->result, type); -} - -enum { - STATE_PLAIN = 0, - STATE_TAG, - STATE_NEXT_ARG, - STATE_ARG, - STATE_BEFORE_VAL, - STATE_VAL -}; - -#define YYFILL(n) goto stop -#define YYCTYPE unsigned char -#define YYCURSOR xp -#define YYLIMIT end -#define YYMARKER q -#define STATE ctx->state - -#define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR TSRMLS_DC -#define STD_ARGS ctx, start, xp TSRMLS_CC - -#if SCANNER_DEBUG -#define scdebug(x) printf x -#else -#define scdebug(x) -#endif - -static inline void passthru(STD_PARA) -{ - scdebug(("appending %d chars, starting with %c\n", YYCURSOR-start, *start)); - smart_str_appendl(&ctx->result, start, YYCURSOR - start); -} - -/* - * This function appends a hidden input field after a
or - *
. The latter is important for XHTML. - */ - -static void handle_form(STD_PARA) -{ - int doit = 0; - - if (ctx->form_app.len > 0) { - switch (ctx->tag.len) { - case sizeof("form") - 1: - if (!strncasecmp(ctx->tag.c, "form", sizeof("form") - 1)) { - doit = 1; - } - if (doit && ctx->val.c && ctx->lookup_data && *ctx->lookup_data) { - char *e, *p = zend_memnstr(ctx->val.c, "://", sizeof("://") - 1, ctx->val.c + ctx->val.len); - if (p) { - e = memchr(p, '/', (ctx->val.c + ctx->val.len) - p); - if (!e) { - e = ctx->val.c + ctx->val.len; - } - if ((e - p) && strncasecmp(p, ctx->lookup_data, (e - p))) { - doit = 0; - } - } - } - break; - - case sizeof("fieldset") - 1: - if (!strncasecmp(ctx->tag.c, "fieldset", sizeof("fieldset") - 1)) { - doit = 1; - } - break; - } - - if (doit) - smart_str_append(&ctx->result, &ctx->form_app); - } -} - -/* - * HANDLE_TAG copies the HTML Tag and checks whether we - * have that tag in our table. If we might modify it, - * we continue to scan the tag, otherwise we simply copy the complete - * HTML stuff to the result buffer. - */ - -static inline void handle_tag(STD_PARA) -{ - int ok = 0; - int i; - - ctx->tag.len = 0; - smart_str_appendl(&ctx->tag, start, YYCURSOR - start); - for (i = 0; i < ctx->tag.len; i++) - ctx->tag.c[i] = tolower((int)(unsigned char)ctx->tag.c[i]); - if (zend_hash_find(ctx->tags, ctx->tag.c, ctx->tag.len, (void **) &ctx->lookup_data) == SUCCESS) - ok = 1; - STATE = ok ? STATE_NEXT_ARG : STATE_PLAIN; -} - -static inline void handle_arg(STD_PARA) -{ - ctx->arg.len = 0; - smart_str_appendl(&ctx->arg, start, YYCURSOR - start); -} - -static inline void handle_val(STD_PARA, char quotes, char type) -{ - smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2); - tag_arg(ctx, quotes, type TSRMLS_CC); -} - -static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC) -{ - char *end, *q; - char *xp; - char *start; - int rest; - - smart_str_appendl(&ctx->buf, newdata, newlen); - - YYCURSOR = ctx->buf.c; - YYLIMIT = ctx->buf.c + ctx->buf.len; - - switch (STATE) { - case STATE_PLAIN: goto state_plain; - case STATE_TAG: goto state_tag; - case STATE_NEXT_ARG: goto state_next_arg; - case STATE_ARG: goto state_arg; - case STATE_BEFORE_VAL: goto state_before_val; - case STATE_VAL: goto state_val; - } - - -state_plain_begin: - STATE = STATE_PLAIN; - -state_plain: - start = YYCURSOR; - -#line 364 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 0, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy15; - } - ++YYCURSOR; -#line 299 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } -#line 409 "ext/standard/url_scanner_ex.c" -yy15: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy15; - } -#line 300 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_plain; } -#line 419 "ext/standard/url_scanner_ex.c" -} -#line 301 "ext/standard/url_scanner_ex.re" - - -state_tag: - start = YYCURSOR; - -#line 427 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '@') { - if (yych != ':') goto yy22; - } else { - if (yych <= 'Z') goto yy20; - if (yych <= '`') goto yy22; - if (yych >= '{') goto yy22; - } -yy20: - ++YYCURSOR; - yych = *YYCURSOR; - goto yy25; -yy21: -#line 306 "ext/standard/url_scanner_ex.re" - { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } -#line 480 "ext/standard/url_scanner_ex.c" -yy22: - ++YYCURSOR; -#line 307 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_plain_begin; } -#line 485 "ext/standard/url_scanner_ex.c" -yy24: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy25: - if (yybm[0+yych] & 128) { - goto yy24; - } - goto yy21; -} -#line 308 "ext/standard/url_scanner_ex.re" - - -state_next_arg_begin: - STATE = STATE_NEXT_ARG; - -state_next_arg: - start = YYCURSOR; - -#line 505 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= ' ') { - if (yych <= '\f') { - if (yych <= 0x08) goto yy34; - if (yych <= '\v') goto yy30; - goto yy34; - } else { - if (yych <= '\r') goto yy30; - if (yych <= 0x1F) goto yy34; - goto yy30; - } - } else { - if (yych <= '@') { - if (yych != '>') goto yy34; - } else { - if (yych <= 'Z') goto yy32; - if (yych <= '`') goto yy34; - if (yych <= 'z') goto yy32; - goto yy34; - } - } - ++YYCURSOR; -#line 316 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } -#line 567 "ext/standard/url_scanner_ex.c" -yy30: - ++YYCURSOR; - yych = *YYCURSOR; - goto yy37; -yy31: -#line 317 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_next_arg; } -#line 575 "ext/standard/url_scanner_ex.c" -yy32: - ++YYCURSOR; -#line 318 "ext/standard/url_scanner_ex.re" - { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } -#line 580 "ext/standard/url_scanner_ex.c" -yy34: - ++YYCURSOR; -#line 319 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_plain_begin; } -#line 585 "ext/standard/url_scanner_ex.c" -yy36: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy37: - if (yybm[0+yych] & 128) { - goto yy36; - } - goto yy31; -} -#line 320 "ext/standard/url_scanner_ex.re" - - -state_arg: - start = YYCURSOR; - -#line 602 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '@') goto yy42; - if (yych <= 'Z') goto yy40; - if (yych <= '`') goto yy42; - if (yych >= '{') goto yy42; -yy40: - ++YYCURSOR; - yych = *YYCURSOR; - goto yy45; -yy41: -#line 325 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } -#line 652 "ext/standard/url_scanner_ex.c" -yy42: - ++YYCURSOR; -#line 326 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } -#line 657 "ext/standard/url_scanner_ex.c" -yy44: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy45: - if (yybm[0+yych] & 128) { - goto yy44; - } - goto yy41; -} -#line 327 "ext/standard/url_scanner_ex.re" - - -state_before_val: - start = YYCURSOR; - -#line 674 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych == ' ') goto yy48; - if (yych == '=') goto yy50; - goto yy52; -yy48: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ' ') goto yy55; - if (yych == '=') goto yy53; -yy49: -#line 333 "ext/standard/url_scanner_ex.re" - { --YYCURSOR; goto state_next_arg_begin; } -#line 723 "ext/standard/url_scanner_ex.c" -yy50: - ++YYCURSOR; - yych = *YYCURSOR; - goto yy54; -yy51: -#line 332 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } -#line 731 "ext/standard/url_scanner_ex.c" -yy52: - yych = *++YYCURSOR; - goto yy49; -yy53: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy54: - if (yybm[0+yych] & 128) { - goto yy53; - } - goto yy51; -yy55: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych == ' ') goto yy55; - if (yych == '=') goto yy53; - YYCURSOR = YYMARKER; - goto yy49; -} -#line 334 "ext/standard/url_scanner_ex.re" - - - -state_val: - start = YYCURSOR; - -#line 760 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 160, 160, 248, 248, 160, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 160, 248, 56, 248, 248, 248, 248, 200, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 0, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - }; - if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - if (yych <= ' ') { - if (yych <= '\f') { - if (yych <= 0x08) goto yy63; - if (yych <= '\n') goto yy64; - goto yy63; - } else { - if (yych <= '\r') goto yy64; - if (yych <= 0x1F) goto yy63; - goto yy64; - } - } else { - if (yych <= '&') { - if (yych != '"') goto yy63; - } else { - if (yych <= '\'') goto yy62; - if (yych == '>') goto yy64; - goto yy63; - } - } - yych = *(YYMARKER = ++YYCURSOR); - goto yy77; -yy61: -#line 342 "ext/standard/url_scanner_ex.re" - { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } -#line 823 "ext/standard/url_scanner_ex.c" -yy62: - yych = *(YYMARKER = ++YYCURSOR); - goto yy69; -yy63: - yych = *++YYCURSOR; - goto yy67; -yy64: - ++YYCURSOR; -#line 343 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_next_arg_begin; } -#line 834 "ext/standard/url_scanner_ex.c" -yy66: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy67: - if (yybm[0+yych] & 8) { - goto yy66; - } - goto yy61; -yy68: - YYMARKER = ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; -yy69: - if (yybm[0+yych] & 16) { - goto yy68; - } - if (yych <= '&') goto yy72; - if (yych >= '(') goto yy61; - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 8) { - goto yy66; - } -yy71: -#line 341 "ext/standard/url_scanner_ex.re" - { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } -#line 861 "ext/standard/url_scanner_ex.c" -yy72: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 32) { - goto yy72; - } - if (yych <= '=') goto yy75; -yy74: - YYCURSOR = YYMARKER; - goto yy61; -yy75: - yych = *++YYCURSOR; - goto yy71; -yy76: - YYMARKER = ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; -yy77: - if (yybm[0+yych] & 64) { - goto yy76; - } - if (yych <= '!') goto yy80; - if (yych >= '#') goto yy61; - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 8) { - goto yy66; - } -yy79: -#line 340 "ext/standard/url_scanner_ex.re" - { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } -#line 893 "ext/standard/url_scanner_ex.c" -yy80: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy80; - } - if (yych >= '>') goto yy74; - ++YYCURSOR; - yych = *YYCURSOR; - goto yy79; -} -#line 344 "ext/standard/url_scanner_ex.re" - - -stop: - rest = YYLIMIT - start; - scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); - /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ - if (rest < 0) rest = 0; - - if (rest) memmove(ctx->buf.c, start, rest); - ctx->buf.len = rest; -} - -char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) -{ - smart_str surl = {0}; - smart_str buf = {0}; - smart_str url_app = {0}; - - smart_str_setl(&surl, url, urllen); - - smart_str_appends(&url_app, name); - smart_str_appendc(&url_app, '='); - smart_str_appends(&url_app, value); - - append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output); - - smart_str_0(&buf); - if (newlen) *newlen = buf.len; - - smart_str_free(&url_app); - - return buf.c; -} - - -static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC) -{ - url_adapt_state_ex_t *ctx; - char *retval; - - ctx = &BG(url_adapt_state_ex); - - xx_mainloop(ctx, src, srclen TSRMLS_CC); - - *newlen = ctx->result.len; - if (!ctx->result.c) { - smart_str_appendl(&ctx->result, "", 0); - } - smart_str_0(&ctx->result); - if (do_flush) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - *newlen += ctx->buf.len; - smart_str_free(&ctx->buf); - } - retval = ctx->result.c; - ctx->result.c = NULL; - ctx->result.len = 0; - return retval; -} - -int php_url_scanner_ex_activate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - memset(ctx, 0, ((size_t) &((url_adapt_state_ex_t *)0)->tags)); - - return SUCCESS; -} - -int php_url_scanner_ex_deactivate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - smart_str_free(&ctx->result); - smart_str_free(&ctx->buf); - smart_str_free(&ctx->tag); - smart_str_free(&ctx->arg); - - return SUCCESS; -} - -static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) -{ - size_t len; - - if (BG(url_adapt_state_ex).url_app.len != 0) { - *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT) ? 1 : 0) TSRMLS_CC); - if (sizeof(uint) < sizeof(size_t)) { - if (len > UINT_MAX) - len = UINT_MAX; - } - *handled_output_len = len; - } else if (BG(url_adapt_state_ex).url_app.len == 0) { - url_adapt_state_ex_t *ctx = &BG(url_adapt_state_ex); - if (ctx->buf.len) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - smart_str_appendl(&ctx->result, output, output_len); - - *handled_output = ctx->result.c; - *handled_output_len = ctx->buf.len + output_len; - - ctx->result.c = NULL; - ctx->result.len = 0; - smart_str_free(&ctx->buf); - } else { - *handled_output = NULL; - } - } else { - *handled_output = NULL; - } -} - -int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC) -{ - char *encoded; - int encoded_len; - smart_str val; - - if (! BG(url_adapt_state_ex).active) { - php_url_scanner_ex_activate(TSRMLS_C); - php_ob_set_internal_handler(php_url_scanner_output_handler, 0, "URL-Rewriter", 1 TSRMLS_CC); - BG(url_adapt_state_ex).active = 1; - } - - - if (BG(url_adapt_state_ex).url_app.len != 0) { - smart_str_appends(&BG(url_adapt_state_ex).url_app, PG(arg_separator).output); - } - - if (urlencode) { - encoded = php_url_encode(value, value_len, &encoded_len); - smart_str_setl(&val, encoded, encoded_len); - } else { - smart_str_setl(&val, value, value_len); - } - - smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len); - smart_str_appendc(&BG(url_adapt_state_ex).url_app, '='); - smart_str_append(&BG(url_adapt_state_ex).url_app, &val); - - smart_str_appends(&BG(url_adapt_state_ex).form_app, ""); - - if (urlencode) - efree(encoded); - - return SUCCESS; -} - -int php_url_scanner_reset_vars(TSRMLS_D) -{ - BG(url_adapt_state_ex).form_app.len = 0; - BG(url_adapt_state_ex).url_app.len = 0; - - return SUCCESS; -} - -PHP_MINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).tags = NULL; - - BG(url_adapt_state_ex).form_app.c = BG(url_adapt_state_ex).url_app.c = 0; - BG(url_adapt_state_ex).form_app.len = BG(url_adapt_state_ex).url_app.len = 0; - - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(url_scanner) -{ - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} - -PHP_RINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).active = 0; - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(url_scanner) -{ - if (BG(url_adapt_state_ex).active) { - php_url_scanner_ex_deactivate(TSRMLS_C); - BG(url_adapt_state_ex).active = 0; - } - - smart_str_free(&BG(url_adapt_state_ex).form_app); - smart_str_free(&BG(url_adapt_state_ex).url_app); - - return SUCCESS; -} diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h deleted file mode 100644 index b8110c4c4dc8c..0000000000000 --- a/ext/standard/url_scanner_ex.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef URL_SCANNER_EX_H -#define URL_SCANNER_EX_H - -PHP_MINIT_FUNCTION(url_scanner_ex); -PHP_MSHUTDOWN_FUNCTION(url_scanner_ex); - -PHP_RINIT_FUNCTION(url_scanner_ex); -PHP_RSHUTDOWN_FUNCTION(url_scanner_ex); - -char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC); - -int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC); -int php_url_scanner_reset_vars(TSRMLS_D); - -int php_url_scanner_ex_activate(TSRMLS_D); -int php_url_scanner_ex_deactivate(TSRMLS_D); - -#include "php_smart_str_public.h" - -typedef struct { - /* Used by the mainloop of the scanner */ - smart_str tag; /* read only */ - smart_str arg; /* read only */ - smart_str val; /* read only */ - smart_str buf; - - /* The result buffer */ - smart_str result; - - /* The data which is appended to each relative URL/FORM */ - smart_str form_app, url_app; - - int active; - - char *lookup_data; - int state; - - /* Everything above is zeroed in RINIT */ - HashTable *tags; -} url_adapt_state_ex_t; - -typedef struct { - smart_str var; - smart_str val; -} url_adapt_var_t; - -#endif diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re deleted file mode 100644 index 02f094cda02f8..0000000000000 --- a/ext/standard/url_scanner_ex.re +++ /dev/null @@ -1,544 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_LIMITS_H -#include -#endif - -#include -#include -#include - -#include "php_ini.h" -#include "php_globals.h" -#define STATE_TAG SOME_OTHER_STATE_TAG -#include "basic_functions.h" -#include "url.h" -#undef STATE_TAG - -#define url_scanner url_scanner_ex - -#include "php_smart_str.h" - -static PHP_INI_MH(OnUpdateTags) -{ - url_adapt_state_ex_t *ctx; - char *key; - char *lasts; - char *tmp; - - ctx = &BG(url_adapt_state_ex); - - tmp = estrndup(new_value, new_value_length); - - if (ctx->tags) - zend_hash_destroy(ctx->tags); - else - ctx->tags = malloc(sizeof(HashTable)); - - zend_hash_init(ctx->tags, 0, NULL, NULL, 1); - - for (key = php_strtok_r(tmp, ",", &lasts); - key; - key = php_strtok_r(NULL, ",", &lasts)) { - char *val; - - val = strchr(key, '='); - if (val) { - char *q; - int keylen; - - *val++ = '\0'; - for (q = key; *q; q++) - *q = tolower(*q); - keylen = q - key; - /* key is stored withOUT NUL - val is stored WITH NUL */ - zend_hash_add(ctx->tags, key, keylen, val, strlen(val)+1, NULL); - } - } - - efree(tmp); - - return SUCCESS; -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals) -PHP_INI_END() - -/*!re2c -any = [\000-\377]; -N = (any\[<]); -alpha = [a-zA-Z]; -alphanamespace = [a-zA-Z:]; -alphadash = ([a-zA-Z] | "-"); -*/ - -#define YYFILL(n) goto done -#define YYCTYPE unsigned char -#define YYCURSOR p -#define YYLIMIT q -#define YYMARKER r - -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator) -{ - register const char *p, *q; - const char *bash = NULL; - const char *sep = "?"; - - q = (p = url->c) + url->len; - -scan: -/*!re2c - ":" { smart_str_append(dest, url); return; } - "?" { sep = separator; goto scan; } - "#" { bash = p - 1; goto done; } - (any\[:?#])+ { goto scan; } -*/ -done: - - /* Don't modify URLs of the format "#mark" */ - if (bash && bash - url->c == 0) { - smart_str_append(dest, url); - return; - } - - if (bash) - smart_str_appendl(dest, url->c, bash - url->c); - else - smart_str_append(dest, url); - - smart_str_appends(dest, sep); - smart_str_append(dest, url_app); - - if (bash) - smart_str_appendl(dest, bash, q - bash); -} - - -#undef YYFILL -#undef YYCTYPE -#undef YYCURSOR -#undef YYLIMIT -#undef YYMARKER - -static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC) -{ - char f = 0; - - if (strncasecmp(ctx->arg.c, ctx->lookup_data, ctx->arg.len) == 0) - f = 1; - - if (quotes) - smart_str_appendc(&ctx->result, type); - if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output); - } else { - smart_str_append(&ctx->result, &ctx->val); - } - if (quotes) - smart_str_appendc(&ctx->result, type); -} - -enum { - STATE_PLAIN = 0, - STATE_TAG, - STATE_NEXT_ARG, - STATE_ARG, - STATE_BEFORE_VAL, - STATE_VAL -}; - -#define YYFILL(n) goto stop -#define YYCTYPE unsigned char -#define YYCURSOR xp -#define YYLIMIT end -#define YYMARKER q -#define STATE ctx->state - -#define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR TSRMLS_DC -#define STD_ARGS ctx, start, xp TSRMLS_CC - -#if SCANNER_DEBUG -#define scdebug(x) printf x -#else -#define scdebug(x) -#endif - -static inline void passthru(STD_PARA) -{ - scdebug(("appending %d chars, starting with %c\n", YYCURSOR-start, *start)); - smart_str_appendl(&ctx->result, start, YYCURSOR - start); -} - -/* - * This function appends a hidden input field after a or - *
. The latter is important for XHTML. - */ - -static void handle_form(STD_PARA) -{ - int doit = 0; - - if (ctx->form_app.len > 0) { - switch (ctx->tag.len) { - case sizeof("form") - 1: - if (!strncasecmp(ctx->tag.c, "form", sizeof("form") - 1)) { - doit = 1; - } - if (doit && ctx->val.c && ctx->lookup_data && *ctx->lookup_data) { - char *e, *p = zend_memnstr(ctx->val.c, "://", sizeof("://") - 1, ctx->val.c + ctx->val.len); - if (p) { - e = memchr(p, '/', (ctx->val.c + ctx->val.len) - p); - if (!e) { - e = ctx->val.c + ctx->val.len; - } - if ((e - p) && strncasecmp(p, ctx->lookup_data, (e - p))) { - doit = 0; - } - } - } - break; - - case sizeof("fieldset") - 1: - if (!strncasecmp(ctx->tag.c, "fieldset", sizeof("fieldset") - 1)) { - doit = 1; - } - break; - } - - if (doit) - smart_str_append(&ctx->result, &ctx->form_app); - } -} - -/* - * HANDLE_TAG copies the HTML Tag and checks whether we - * have that tag in our table. If we might modify it, - * we continue to scan the tag, otherwise we simply copy the complete - * HTML stuff to the result buffer. - */ - -static inline void handle_tag(STD_PARA) -{ - int ok = 0; - int i; - - ctx->tag.len = 0; - smart_str_appendl(&ctx->tag, start, YYCURSOR - start); - for (i = 0; i < ctx->tag.len; i++) - ctx->tag.c[i] = tolower((int)(unsigned char)ctx->tag.c[i]); - if (zend_hash_find(ctx->tags, ctx->tag.c, ctx->tag.len, (void **) &ctx->lookup_data) == SUCCESS) - ok = 1; - STATE = ok ? STATE_NEXT_ARG : STATE_PLAIN; -} - -static inline void handle_arg(STD_PARA) -{ - ctx->arg.len = 0; - smart_str_appendl(&ctx->arg, start, YYCURSOR - start); -} - -static inline void handle_val(STD_PARA, char quotes, char type) -{ - smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2); - tag_arg(ctx, quotes, type TSRMLS_CC); -} - -static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC) -{ - char *end, *q; - char *xp; - char *start; - int rest; - - smart_str_appendl(&ctx->buf, newdata, newlen); - - YYCURSOR = ctx->buf.c; - YYLIMIT = ctx->buf.c + ctx->buf.len; - - switch (STATE) { - case STATE_PLAIN: goto state_plain; - case STATE_TAG: goto state_tag; - case STATE_NEXT_ARG: goto state_next_arg; - case STATE_ARG: goto state_arg; - case STATE_BEFORE_VAL: goto state_before_val; - case STATE_VAL: goto state_val; - } - - -state_plain_begin: - STATE = STATE_PLAIN; - -state_plain: - start = YYCURSOR; -/*!re2c - "<" { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } - N+ { passthru(STD_ARGS); goto state_plain; } -*/ - -state_tag: - start = YYCURSOR; -/*!re2c - alphanamespace+ { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } - any { passthru(STD_ARGS); goto state_plain_begin; } -*/ - -state_next_arg_begin: - STATE = STATE_NEXT_ARG; - -state_next_arg: - start = YYCURSOR; -/*!re2c - ">" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } - [ \v\r\t\n]+ { passthru(STD_ARGS); goto state_next_arg; } - alpha { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } - any { passthru(STD_ARGS); goto state_plain_begin; } -*/ - -state_arg: - start = YYCURSOR; -/*!re2c - alpha alphadash* { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } - any { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } -*/ - -state_before_val: - start = YYCURSOR; -/*!re2c - [ ]* "=" [ ]* { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } - any { --YYCURSOR; goto state_next_arg_begin; } -*/ - - -state_val: - start = YYCURSOR; -/*!re2c - ["] (any\[">])* ["] { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } - ['] (any\['>])* ['] { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } - (any\[ \r\t\n>])+ { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } - any { passthru(STD_ARGS); goto state_next_arg_begin; } -*/ - -stop: - rest = YYLIMIT - start; - scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); - /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ - if (rest < 0) rest = 0; - - if (rest) memmove(ctx->buf.c, start, rest); - ctx->buf.len = rest; -} - -char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) -{ - smart_str surl = {0}; - smart_str buf = {0}; - smart_str url_app = {0}; - - smart_str_setl(&surl, url, urllen); - - smart_str_appends(&url_app, name); - smart_str_appendc(&url_app, '='); - smart_str_appends(&url_app, value); - - append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output); - - smart_str_0(&buf); - if (newlen) *newlen = buf.len; - - smart_str_free(&url_app); - - return buf.c; -} - - -static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC) -{ - url_adapt_state_ex_t *ctx; - char *retval; - - ctx = &BG(url_adapt_state_ex); - - xx_mainloop(ctx, src, srclen TSRMLS_CC); - - *newlen = ctx->result.len; - if (!ctx->result.c) { - smart_str_appendl(&ctx->result, "", 0); - } - smart_str_0(&ctx->result); - if (do_flush) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - *newlen += ctx->buf.len; - smart_str_free(&ctx->buf); - } - retval = ctx->result.c; - ctx->result.c = NULL; - ctx->result.len = 0; - return retval; -} - -int php_url_scanner_ex_activate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - memset(ctx, 0, ((size_t) &((url_adapt_state_ex_t *)0)->tags)); - - return SUCCESS; -} - -int php_url_scanner_ex_deactivate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - smart_str_free(&ctx->result); - smart_str_free(&ctx->buf); - smart_str_free(&ctx->tag); - smart_str_free(&ctx->arg); - - return SUCCESS; -} - -static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) -{ - size_t len; - - if (BG(url_adapt_state_ex).url_app.len != 0) { - *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT) ? 1 : 0) TSRMLS_CC); - if (sizeof(uint) < sizeof(size_t)) { - if (len > UINT_MAX) - len = UINT_MAX; - } - *handled_output_len = len; - } else if (BG(url_adapt_state_ex).url_app.len == 0) { - url_adapt_state_ex_t *ctx = &BG(url_adapt_state_ex); - if (ctx->buf.len) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - smart_str_appendl(&ctx->result, output, output_len); - - *handled_output = ctx->result.c; - *handled_output_len = ctx->buf.len + output_len; - - ctx->result.c = NULL; - ctx->result.len = 0; - smart_str_free(&ctx->buf); - } else { - *handled_output = NULL; - } - } else { - *handled_output = NULL; - } -} - -int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC) -{ - char *encoded; - int encoded_len; - smart_str val; - - if (! BG(url_adapt_state_ex).active) { - php_url_scanner_ex_activate(TSRMLS_C); - php_ob_set_internal_handler(php_url_scanner_output_handler, 0, "URL-Rewriter", 1 TSRMLS_CC); - BG(url_adapt_state_ex).active = 1; - } - - - if (BG(url_adapt_state_ex).url_app.len != 0) { - smart_str_appends(&BG(url_adapt_state_ex).url_app, PG(arg_separator).output); - } - - if (urlencode) { - encoded = php_url_encode(value, value_len, &encoded_len); - smart_str_setl(&val, encoded, encoded_len); - } else { - smart_str_setl(&val, value, value_len); - } - - smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len); - smart_str_appendc(&BG(url_adapt_state_ex).url_app, '='); - smart_str_append(&BG(url_adapt_state_ex).url_app, &val); - - smart_str_appends(&BG(url_adapt_state_ex).form_app, ""); - - if (urlencode) - efree(encoded); - - return SUCCESS; -} - -int php_url_scanner_reset_vars(TSRMLS_D) -{ - BG(url_adapt_state_ex).form_app.len = 0; - BG(url_adapt_state_ex).url_app.len = 0; - - return SUCCESS; -} - -PHP_MINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).tags = NULL; - - BG(url_adapt_state_ex).form_app.c = BG(url_adapt_state_ex).url_app.c = 0; - BG(url_adapt_state_ex).form_app.len = BG(url_adapt_state_ex).url_app.len = 0; - - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(url_scanner) -{ - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} - -PHP_RINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).active = 0; - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(url_scanner) -{ - if (BG(url_adapt_state_ex).active) { - php_url_scanner_ex_deactivate(TSRMLS_C); - BG(url_adapt_state_ex).active = 0; - } - - smart_str_free(&BG(url_adapt_state_ex).form_app); - smart_str_free(&BG(url_adapt_state_ex).url_app); - - return SUCCESS; -} diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c deleted file mode 100644 index 659c090a8349b..0000000000000 --- a/ext/standard/user_filters.c +++ /dev/null @@ -1,617 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: | - | Wez Furlong (wez@thebrainroom.com) | - | Sara Golemon (pollita@php.net) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/basic_functions.h" -#include "ext/standard/file.h" - -#define PHP_STREAM_BRIGADE_RES_NAME "userfilter.bucket brigade" -#define PHP_STREAM_BUCKET_RES_NAME "userfilter.bucket" -#define PHP_STREAM_FILTER_RES_NAME "userfilter.filter" - -struct php_user_filter_data { - zend_class_entry *ce; - /* variable length; this *must* be last in the structure */ - char classname[1]; -}; - -/* to provide context for calling into the next filter from user-space */ -static int le_userfilters; -static int le_bucket_brigade; -static int le_bucket; - -#define GET_FILTER_FROM_OBJ() { \ - zval **tmp; \ - if (FAILURE == zend_hash_index_find(Z_OBJPROP_P(this_ptr), 0, (void**)&tmp)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "filter property vanished"); \ - RETURN_FALSE; \ - } \ - ZEND_FETCH_RESOURCE(filter, php_stream_filter*, tmp, -1, "filter", le_userfilters); \ -} - -/* define the base filter class */ - -PHP_FUNCTION(user_filter_nop) -{ -} -static -ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_filter, 0) - ZEND_ARG_INFO(0, in) - ZEND_ARG_INFO(0, out) - ZEND_ARG_INFO(1, consumed) - ZEND_ARG_INFO(0, closing) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_onCreate, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_onClose, 0) -ZEND_END_ARG_INFO() - -static zend_function_entry user_filter_class_funcs[] = { - PHP_NAMED_FE(filter, PHP_FN(user_filter_nop), arginfo_php_user_filter_filter) - PHP_NAMED_FE(onCreate, PHP_FN(user_filter_nop), arginfo_php_user_filter_onCreate) - PHP_NAMED_FE(onClose, PHP_FN(user_filter_nop), arginfo_php_user_filter_onClose) - { NULL, NULL, NULL } -}; - -static zend_class_entry user_filter_class_entry; - -static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor) -{ - php_stream_bucket *bucket = (php_stream_bucket *)rsrc->ptr; - if (bucket) { - php_stream_bucket_delref(bucket TSRMLS_CC); - bucket = NULL; - } -} - -PHP_MINIT_FUNCTION(user_filters) -{ - zend_class_entry *php_user_filter; - /* init the filter class ancestor */ - INIT_CLASS_ENTRY(user_filter_class_entry, "php_user_filter", user_filter_class_funcs); - if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry TSRMLS_CC)) == NULL) { - return FAILURE; - } - zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); - - /* init the filter resource; it has no dtor, as streams will always clean it up - * at the correct time */ - le_userfilters = zend_register_list_destructors_ex(NULL, NULL, PHP_STREAM_FILTER_RES_NAME, 0); - - if (le_userfilters == FAILURE) { - return FAILURE; - } - - /* Filters will dispose of their brigades */ - le_bucket_brigade = zend_register_list_destructors_ex(NULL, NULL, PHP_STREAM_BRIGADE_RES_NAME, module_number); - /* Brigades will dispose of their buckets */ - le_bucket = zend_register_list_destructors_ex(php_bucket_dtor, NULL, PHP_STREAM_BUCKET_RES_NAME, module_number); - - if (le_bucket_brigade == FAILURE) { - return FAILURE; - } - - REGISTER_LONG_CONSTANT("PSFS_PASS_ON", PSFS_PASS_ON, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PSFS_FEED_ME", PSFS_FEED_ME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PSFS_ERR_FATAL", PSFS_ERR_FATAL, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("PSFS_FLAG_NORMAL", PSFS_FLAG_NORMAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_INC", PSFS_FLAG_FLUSH_INC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_CLOSE", PSFS_FLAG_FLUSH_CLOSE, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(user_filters) -{ - if (BG(user_filter_map)) { - zend_hash_destroy(BG(user_filter_map)); - efree(BG(user_filter_map)); - BG(user_filter_map) = NULL; - } - - return SUCCESS; -} - -static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - zval *obj = (zval*)thisfilter->abstract; - zval func_name; - zval *retval = NULL; - - if (obj == NULL) { - /* If there's no object associated then there's nothing to dispose of */ - return; - } - - ZVAL_STRINGL(&func_name, "onclose", sizeof("onclose")-1, 0); - - call_user_function_ex(NULL, - &obj, - &func_name, - &retval, - 0, NULL, - 0, NULL TSRMLS_CC); - - if (retval) - zval_ptr_dtor(&retval); - - /* kill the object */ - zval_ptr_dtor(&obj); -} - -php_stream_filter_status_t userfilter_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - int ret = PSFS_ERR_FATAL; - zval *obj = (zval*)thisfilter->abstract; - zval func_name; - zval *retval = NULL; - zval **args[4]; - zval *zclosing, *zconsumed, *zin, *zout, *zstream; - zval zpropname; - int call_result; - - if (FAILURE == zend_hash_find(Z_OBJPROP_P(obj), "stream", sizeof("stream"), (void**)&zstream)) { - /* Give the userfilter class a hook back to the stream */ - ALLOC_INIT_ZVAL(zstream); - php_stream_to_zval(stream, zstream); - zval_copy_ctor(zstream); - add_property_zval(obj, "stream", zstream); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zstream); - } - - ZVAL_STRINGL(&func_name, "filter", sizeof("filter")-1, 0); - - /* Setup calling arguments */ - ALLOC_INIT_ZVAL(zin); - ZEND_REGISTER_RESOURCE(zin, buckets_in, le_bucket_brigade); - args[0] = &zin; - - ALLOC_INIT_ZVAL(zout); - ZEND_REGISTER_RESOURCE(zout, buckets_out, le_bucket_brigade); - args[1] = &zout; - - ALLOC_INIT_ZVAL(zconsumed); - if (bytes_consumed) { - ZVAL_LONG(zconsumed, *bytes_consumed); - } else { - ZVAL_NULL(zconsumed); - } - args[2] = &zconsumed; - - ALLOC_INIT_ZVAL(zclosing); - ZVAL_BOOL(zclosing, flags & PSFS_FLAG_FLUSH_CLOSE); - args[3] = &zclosing; - - call_result = call_user_function_ex(NULL, - &obj, - &func_name, - &retval, - 4, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL) { - convert_to_long(retval); - ret = Z_LVAL_P(retval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call filter function"); - } - - if (bytes_consumed) { - *bytes_consumed = Z_LVAL_P(zconsumed); - } - - if (retval) { - zval_ptr_dtor(&retval); - } - - if (buckets_in->head) { - php_stream_bucket *bucket = buckets_in->head; - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unprocessed filter buckets remaining on input brigade"); - while ((bucket = buckets_in->head)) { - /* Remove unconsumed buckets from the brigade */ - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - } - - /* filter resources are cleaned up by the stream destructor, - * keeping a reference to the stream resource here would prevent it - * from being destroyed properly */ - INIT_ZVAL(zpropname); - ZVAL_STRINGL(&zpropname, "stream", sizeof("stream")-1, 0); - Z_OBJ_HANDLER_P(obj, unset_property)(obj, &zpropname TSRMLS_CC); - - zval_ptr_dtor(&zclosing); - zval_ptr_dtor(&zconsumed); - zval_ptr_dtor(&zout); - zval_ptr_dtor(&zin); - - return ret; -} - -static php_stream_filter_ops userfilter_ops = { - userfilter_filter, - userfilter_dtor, - "user-filter" -}; - -static php_stream_filter *user_filter_factory_create(const char *filtername, - zval *filterparams, int persistent TSRMLS_DC) -{ - struct php_user_filter_data *fdat = NULL; - php_stream_filter *filter; - zval *obj, *zfilter; - zval func_name; - zval *retval = NULL; - int len; - - /* some sanity checks */ - if (persistent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "cannot use a user-space filter with a persistent stream"); - return NULL; - } - - len = strlen(filtername); - - /* determine the classname/class entry */ - if (FAILURE == zend_hash_find(BG(user_filter_map), (char*)filtername, len + 1, (void**)&fdat)) { - char *period; - - /* Userspace Filters using ambiguous wildcards could cause problems. - i.e.: myfilter.foo.bar will always call into myfilter.foo.* - never seeing myfilter.* - TODO: Allow failed userfilter creations to continue - scanning through the list */ - if ((period = strrchr(filtername, '.'))) { - char *wildcard = emalloc(len + 3); - - /* Search for wildcard matches instead */ - memcpy(wildcard, filtername, len + 1); /* copy \0 */ - period = wildcard + (period - filtername); - while (period) { - *period = '\0'; - strcat(wildcard, ".*"); - if (SUCCESS == zend_hash_find(BG(user_filter_map), wildcard, strlen(wildcard) + 1, (void**)&fdat)) { - period = NULL; - } else { - *period = '\0'; - period = strrchr(wildcard, '.'); - } - } - efree(wildcard); - } - if (fdat == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Err, filter \"%s\" is not in the user-filter map, but somehow the user-filter-factory was invoked for it!?", filtername); - return NULL; - } - } - - /* bind the classname to the actual class */ - if (fdat->ce == NULL) { - if (FAILURE == zend_lookup_class(fdat->classname, strlen(fdat->classname), - (zend_class_entry ***)&fdat->ce TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "user-filter \"%s\" requires class \"%s\", but that class is not defined", - filtername, fdat->classname); - return NULL; - } - fdat->ce = *(zend_class_entry**)fdat->ce; - - } - - filter = php_stream_filter_alloc(&userfilter_ops, NULL, 0); - if (filter == NULL) { - return NULL; - } - - /* create the object */ - ALLOC_ZVAL(obj); - object_init_ex(obj, fdat->ce); - ZVAL_REFCOUNT(obj) = 1; - PZVAL_IS_REF(obj) = 1; - - /* filtername */ - add_property_string(obj, "filtername", (char*)filtername, 1); - - /* and the parameters, if any */ - if (filterparams) { - add_property_zval(obj, "params", filterparams); - } else { - add_property_null(obj, "params"); - } - - /* invoke the constructor */ - ZVAL_STRINGL(&func_name, "oncreate", sizeof("oncreate")-1, 0); - - call_user_function_ex(NULL, - &obj, - &func_name, - &retval, - 0, NULL, - 0, NULL TSRMLS_CC); - - if (retval) { - if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) { - /* User reported filter creation error "return false;" */ - zval_ptr_dtor(&retval); - - /* Kill the filter (safely) */ - filter->abstract = NULL; - php_stream_filter_free(filter TSRMLS_CC); - - /* Kill the object */ - zval_ptr_dtor(&obj); - - /* Report failure to filter_alloc */ - return NULL; - } - zval_ptr_dtor(&retval); - } - - /* set the filter property, this will be used during cleanup */ - ALLOC_INIT_ZVAL(zfilter); - ZEND_REGISTER_RESOURCE(zfilter, filter, le_userfilters); - filter->abstract = obj; - add_property_zval(obj, "filter", zfilter); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zfilter); - - return filter; -} - -static php_stream_filter_factory user_filter_factory = { - user_filter_factory_create -}; - -static void filter_item_dtor(struct php_user_filter_data *fdat) -{ -} - -/* {{{ proto object stream_bucket_make_writeable(resource brigade) - Return a bucket object from the brigade for operating on */ -PHP_FUNCTION(stream_bucket_make_writeable) -{ - zval *zbrigade, *zbucket; - php_stream_bucket_brigade *brigade; - php_stream_bucket *bucket; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zbrigade) == FAILURE) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(brigade, php_stream_bucket_brigade *, &zbrigade, -1, PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade); - - ZVAL_NULL(return_value); - - if (brigade->head && (bucket = php_stream_bucket_make_writeable(brigade->head TSRMLS_CC))) { - ALLOC_INIT_ZVAL(zbucket); - ZEND_REGISTER_RESOURCE(zbucket, bucket, le_bucket); - object_init(return_value); - add_property_zval(return_value, "bucket", zbucket); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zbucket); - add_property_stringl(return_value, "data", bucket->buf, bucket->buflen, 1); - add_property_long(return_value, "datalen", bucket->buflen); - } -} -/* }}} */ - -/* {{{ php_stream_bucket_attach */ -static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *zbrigade, *zobject; - zval **pzbucket, **pzdata; - php_stream_bucket_brigade *brigade; - php_stream_bucket *bucket; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zo", &zbrigade, &zobject) == FAILURE) { - RETURN_FALSE; - } - - if (FAILURE == zend_hash_find(Z_OBJPROP_P(zobject), "bucket", 7, (void**)&pzbucket)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Object has no bucket property"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(brigade, php_stream_bucket_brigade *, &zbrigade, -1, PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade); - ZEND_FETCH_RESOURCE(bucket, php_stream_bucket *, pzbucket, -1, PHP_STREAM_BUCKET_RES_NAME, le_bucket); - - if (SUCCESS == zend_hash_find(Z_OBJPROP_P(zobject), "data", 5, (void**)&pzdata) && (*pzdata)->type == IS_STRING) { - if (!bucket->own_buf) { - bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC); - } - if ((int)bucket->buflen != Z_STRLEN_PP(pzdata)) { - bucket->buf = perealloc(bucket->buf, Z_STRLEN_PP(pzdata), bucket->is_persistent); - bucket->buflen = Z_STRLEN_PP(pzdata); - } - memcpy(bucket->buf, Z_STRVAL_PP(pzdata), bucket->buflen); - } - - if (append) { - php_stream_bucket_append(brigade, bucket TSRMLS_CC); - } else { - php_stream_bucket_prepend(brigade, bucket TSRMLS_CC); - } - /* This is a hack necessary to accomodate situations where bucket is appended to the stream - * multiple times. See bug35916.phpt for reference. - */ - if (bucket->refcount == 1) { - bucket->refcount++; - } -} -/* }}} */ - -/* {{{ proto void stream_bucket_prepend(resource brigade, resource bucket) - Prepend bucket to brigade */ -PHP_FUNCTION(stream_bucket_prepend) -{ - php_stream_bucket_attach(0, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto void stream_bucket_append(resource brigade, resource bucket) - Append bucket to brigade */ -PHP_FUNCTION(stream_bucket_append) -{ - php_stream_bucket_attach(1, INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto resource stream_bucket_new(resource stream, string buffer) - Create a new bucket for use on the current stream */ -PHP_FUNCTION(stream_bucket_new) -{ - zval *zstream, *zbucket; - php_stream *stream; - char *buffer; - char *pbuffer; - int buffer_len; - php_stream_bucket *bucket; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &zstream, &buffer, &buffer_len) == FAILURE) { - RETURN_FALSE; - } - - php_stream_from_zval(stream, &zstream); - - if (!(pbuffer = pemalloc(buffer_len, php_stream_is_persistent(stream)))) { - RETURN_FALSE; - } - - memcpy(pbuffer, buffer, buffer_len); - - bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream) TSRMLS_CC); - - if (bucket == NULL) { - RETURN_FALSE; - } - - ALLOC_INIT_ZVAL(zbucket); - ZEND_REGISTER_RESOURCE(zbucket, bucket, le_bucket); - object_init(return_value); - add_property_zval(return_value, "bucket", zbucket); - /* add_property_zval increments the refcount which is unwanted here */ - zval_ptr_dtor(&zbucket); - add_property_stringl(return_value, "data", bucket->buf, bucket->buflen, 1); - add_property_long(return_value, "datalen", bucket->buflen); -} -/* }}} */ - -/* {{{ proto array stream_get_filters(void) - Returns a list of registered filters */ -PHP_FUNCTION(stream_get_filters) -{ - char *filter_name; - int key_flags, filter_name_len = 0; - HashTable *filters_hash; - ulong num_key; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - - filters_hash = php_get_stream_filters_hash(); - - if (filters_hash) { - for(zend_hash_internal_pointer_reset(filters_hash); - (key_flags = zend_hash_get_current_key_ex(filters_hash, &filter_name, &filter_name_len, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT; - zend_hash_move_forward(filters_hash)) - if (key_flags == HASH_KEY_IS_STRING) { - add_next_index_stringl(return_value, filter_name, filter_name_len - 1, 1); - } - } - /* It's okay to return an empty array if no filters are registered */ -} -/* }}} */ - -/* {{{ proto bool stream_filter_register(string filtername, string classname) - Registers a custom filter handler class */ -PHP_FUNCTION(stream_filter_register) -{ - char *filtername, *classname; - int filtername_len, classname_len; - struct php_user_filter_data *fdat; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &filtername, &filtername_len, - &classname, &classname_len) == FAILURE) { - RETURN_FALSE; - } - - RETVAL_FALSE; - - if (!filtername_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter name cannot be empty"); - return; - } - - if (!classname_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class name cannot be empty"); - return; - } - - if (!BG(user_filter_map)) { - BG(user_filter_map) = (HashTable*) emalloc(sizeof(HashTable)); - zend_hash_init(BG(user_filter_map), 5, NULL, (dtor_func_t) filter_item_dtor, 0); - } - - fdat = ecalloc(1, sizeof(*fdat) + classname_len); - memcpy(fdat->classname, classname, classname_len); - - if (zend_hash_add(BG(user_filter_map), filtername, filtername_len + 1, (void*)fdat, - sizeof(*fdat) + classname_len, NULL) == SUCCESS && - php_stream_filter_register_factory_volatile(filtername, &user_filter_factory TSRMLS_CC) == SUCCESS) { - RETVAL_TRUE; - } - - efree(fdat); -} -/* }}} */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c deleted file mode 100644 index 1c712e430a508..0000000000000 --- a/ext/standard/uuencode.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Ilia Alshanetsky | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * Portions of this code are based on Berkeley's uuencode/uudecode - * implementation. - * - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -#include "php.h" -#include "php_uuencode.h" - -#define PHP_UU_ENC(c) ((c) ? ((c) & 077) + ' ' : '`') -#define PHP_UU_ENC_C2(c) PHP_UU_ENC(((*(c) << 4) & 060) | ((*((c) + 1) >> 4) & 017)) -#define PHP_UU_ENC_C3(c) PHP_UU_ENC(((*(c + 1) << 2) & 074) | ((*((c) + 2) >> 6) & 03)) - -#define PHP_UU_DEC(c) (((c) - ' ') & 077) - -PHPAPI int php_uuencode(char *src, int src_len, char **dest) /* {{{ */ -{ - int len = 45; - char *p, *s, *e, *ee; - - /* encoded length is ~ 38% greater then the original */ - p = *dest = safe_emalloc(ceil(src_len * 1.38), 1, 46); - s = src; - e = src + src_len; - - while ((s + 3) < e) { - ee = s + len; - if (ee > e) { - ee = e; - len = ee - s; - if (len % 3) { - ee = s + (int) (floor(len / 3) * 3); - } - } - *p++ = PHP_UU_ENC(len); - - while (s < ee) { - *p++ = PHP_UU_ENC(*s >> 2); - *p++ = PHP_UU_ENC_C2(s); - *p++ = PHP_UU_ENC_C3(s); - *p++ = PHP_UU_ENC(*(s + 2) & 077); - - s += 3; - } - - if (len == 45) { - *p++ = '\n'; - } - } - - if (s < e) { - if (len == 45) { - *p++ = PHP_UU_ENC(e - s); - len = 0; - } - - *p++ = PHP_UU_ENC(*s >> 2); - *p++ = PHP_UU_ENC_C2(s); - *p++ = ((e - s) > 1) ? PHP_UU_ENC_C3(s) : PHP_UU_ENC('\0'); - *p++ = ((e - s) > 2) ? PHP_UU_ENC(*(s + 2) & 077) : PHP_UU_ENC('\0'); - } - - if (len < 45) { - *p++ = '\n'; - } - - *p++ = PHP_UU_ENC('\0'); - *p++ = '\n'; - *p = '\0'; - - return (p - *dest); -} -/* }}} */ - -PHPAPI int php_uudecode(char *src, int src_len, char **dest) /* {{{ */ -{ - int len, total_len=0; - char *s, *e, *p, *ee; - - p = *dest = safe_emalloc(ceil(src_len * 0.75), 1, 1); - s = src; - e = src + src_len; - - while (s < e) { - if ((len = PHP_UU_DEC(*s++)) <= 0) { - break; - } - /* sanity check */ - if (len > src_len) { - goto err; - } - - total_len += len; - - ee = s + (len == 45 ? 60 : (int) floor(len * 1.33)); - /* sanity check */ - if (ee > e) { - goto err; - } - - while (s < ee) { - *p++ = PHP_UU_DEC(*s) << 2 | PHP_UU_DEC(*(s + 1)) >> 4; - *p++ = PHP_UU_DEC(*(s + 1)) << 4 | PHP_UU_DEC(*(s + 2)) >> 2; - *p++ = PHP_UU_DEC(*(s + 2)) << 6 | PHP_UU_DEC(*(s + 3)); - s += 4; - } - - if (len < 45) { - break; - } - - /* skip \n */ - s++; - } - - if ((len = total_len > (p - *dest))) { - *p++ = PHP_UU_DEC(*s) << 2 | PHP_UU_DEC(*(s + 1)) >> 4; - if (len > 1) { - *p++ = PHP_UU_DEC(*(s + 1)) << 4 | PHP_UU_DEC(*(s + 2)) >> 2; - if (len > 2) { - *p++ = PHP_UU_DEC(*(s + 2)) << 6 | PHP_UU_DEC(*(s + 3)); - } - } - } - - *(*dest + total_len) = '\0'; - - return total_len; - -err: - efree(*dest); - return -1; -} -/* }}} */ - -/* {{{ proto string convert_uuencode(string data) - uuencode a string */ -PHP_FUNCTION(convert_uuencode) -{ - char *src, *dst; - int src_len, dst_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &src, &src_len) == FAILURE || src_len < 1) { - RETURN_FALSE; - } - - dst_len = php_uuencode(src, src_len, &dst); - - RETURN_STRINGL(dst, dst_len, 0); -} -/* }}} */ - -/* {{{ proto string convert_uudecode(string data) - decode a uuencoded string */ -PHP_FUNCTION(convert_uudecode) -{ - char *src, *dst; - int src_len, dst_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &src, &src_len) == FAILURE || src_len < 1) { - RETURN_FALSE; - } - - dst_len = php_uudecode(src, src_len, &dst); - if (dst_len < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The given parameter is not a valid uuencoded string"); - RETURN_FALSE; - } - - RETURN_STRINGL(dst, dst_len, 0); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/standard/var.c b/ext/standard/var.c deleted file mode 100644 index 96b81562b2bec..0000000000000 --- a/ext/standard/var.c +++ /dev/null @@ -1,940 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Jani Lehtimäki | - | Thies C. Arntzen | - | Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - - -/* {{{ includes -*/ - -#include -#include -#include -#include "php.h" -#include "php_string.h" -#include "php_var.h" -#include "php_smart_str.h" -#include "basic_functions.h" -#include "php_incomplete_class.h" - -#define COMMON ((*struc)->is_ref ? "&" : "") -#define Z_REFCOUNT_PP(a) ((*a)->refcount) - -/* }}} */ - -/* {{{ php_var_dump */ - -static int php_array_element_dump(zval **zv, int num_args, va_list args, zend_hash_key *hash_key) -{ - int level; - TSRMLS_FETCH(); - - level = va_arg(args, int); - - if (hash_key->nKeyLength==0) { /* numeric key */ - php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h); - } else { /* string key */ - php_printf("%*c[\"", level + 1, ' '); - PHPWRITE(hash_key->arKey, hash_key->nKeyLength - 1); - php_printf("\"]=>\n"); - } - php_var_dump(zv, level + 2 TSRMLS_CC); - return 0; -} - -static int php_object_property_dump(zval **zv, int num_args, va_list args, zend_hash_key *hash_key) -{ - int level; - char *prop_name, *class_name; - TSRMLS_FETCH(); - - level = va_arg(args, int); - - if (hash_key->nKeyLength ==0 ) { /* numeric key */ - php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h); - } else { /* string key */ - int unmangle = zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name); - if (class_name && unmangle == SUCCESS) { - php_printf("%*c[\"%s", level + 1, ' ', prop_name); - if (class_name[0]=='*') { - ZEND_PUTS(":protected"); - } else { - ZEND_PUTS(":private"); - } - } else { - php_printf("%*c[\"", level + 1, ' '); - PHPWRITE(hash_key->arKey, hash_key->nKeyLength - 1); -#ifdef ANDREY_0 - ZEND_PUTS(":public"); -#endif - } - ZEND_PUTS("\"]=>\n"); - } - php_var_dump(zv, level + 2 TSRMLS_CC); - return 0; -} - - -PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC) -{ - HashTable *myht = NULL; - char *class_name; - zend_uint class_name_len; - int (*php_element_dump_func)(zval**, int, va_list, zend_hash_key*); - - if (level > 1) { - php_printf("%*c", level - 1, ' '); - } - - switch (Z_TYPE_PP(struc)) { - case IS_BOOL: - php_printf("%sbool(%s)\n", COMMON, Z_LVAL_PP(struc)?"true":"false"); - break; - case IS_NULL: - php_printf("%sNULL\n", COMMON); - break; - case IS_LONG: - php_printf("%sint(%ld)\n", COMMON, Z_LVAL_PP(struc)); - break; - case IS_DOUBLE: - php_printf("%sfloat(%.*G)\n", COMMON, (int) EG(precision), Z_DVAL_PP(struc)); - break; - case IS_STRING: - php_printf("%sstring(%d) \"", COMMON, Z_STRLEN_PP(struc)); - PHPWRITE(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc)); - PUTS("\"\n"); - break; - case IS_ARRAY: - myht = Z_ARRVAL_PP(struc); - if (myht->nApplyCount > 1) { - PUTS("*RECURSION*\n"); - return; - } - php_printf("%sarray(%d) {\n", COMMON, zend_hash_num_elements(myht)); - php_element_dump_func = php_array_element_dump; - goto head_done; - case IS_OBJECT: - myht = Z_OBJPROP_PP(struc); - if (myht && myht->nApplyCount > 1) { - PUTS("*RECURSION*\n"); - return; - } - - Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC); - php_printf("%sobject(%s)#%d (%d) {\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0); - efree(class_name); - php_element_dump_func = php_object_property_dump; -head_done: - if (myht) { - zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_element_dump_func, 1, level); - } - if (level > 1) { - php_printf("%*c", level-1, ' '); - } - PUTS("}\n"); - break; - case IS_RESOURCE: { - char *type_name; - - type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC); - php_printf("%sresource(%ld) of type (%s)\n", COMMON, Z_LVAL_PP(struc), type_name ? type_name : "Unknown"); - break; - } - default: - php_printf("%sUNKNOWN:0\n", COMMON); - break; - } -} - -/* }}} */ - -/* {{{ proto void var_dump(mixed var) - Dumps a string representation of variable to output */ -PHP_FUNCTION(var_dump) -{ - zval ***args; - int argc; - int i; - - argc = ZEND_NUM_ARGS(); - - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (ZEND_NUM_ARGS() == 0 || zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - for (i=0; inKeyLength==0) { /* numeric key */ - php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h); - } else { /* string key */ - /* XXX: perphaps when we are inside the class we should permit access to - * private & protected values - */ - if (va_arg(args, int) && hash_key->arKey[0] == '\0') { - return 0; - } - php_printf("%*c[\"", level + 1, ' '); - PHPWRITE(hash_key->arKey, hash_key->nKeyLength - 1); - php_printf("\"]=>\n"); - } - php_debug_zval_dump(zv, level + 2 TSRMLS_CC); - return 0; -} - -static int zval_object_property_dump(zval **zv, int num_args, va_list args, zend_hash_key *hash_key) -{ - int level; - char *prop_name, *class_name; - TSRMLS_FETCH(); - - level = va_arg(args, int); - - if (hash_key->nKeyLength ==0 ) { /* numeric key */ - php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h); - } else { /* string key */ - zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name); - if (class_name) { - php_printf("%*c[\"%s", level + 1, ' ', prop_name); - if (class_name[0]=='*') { - ZEND_PUTS(":protected"); - } else { - ZEND_PUTS(":private"); - } - } else { - php_printf("%*c[\"%s", level + 1, ' ', hash_key->arKey); -#ifdef ANDREY_0 - ZEND_PUTS(":public"); -#endif - } - ZEND_PUTS("\"]=>\n"); - } - php_debug_zval_dump(zv, level + 2 TSRMLS_CC); - return 0; -} - -PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC) -{ - HashTable *myht = NULL; - char *class_name; - zend_uint class_name_len; - zend_class_entry *ce; - int (*zval_element_dump_func)(zval**, int, va_list, zend_hash_key*); - - if (level > 1) { - php_printf("%*c", level - 1, ' '); - } - - switch (Z_TYPE_PP(struc)) { - case IS_BOOL: - php_printf("%sbool(%s) refcount(%u)\n", COMMON, Z_LVAL_PP(struc)?"true":"false", Z_REFCOUNT_PP(struc)); - break; - case IS_NULL: - php_printf("%sNULL refcount(%u)\n", COMMON, Z_REFCOUNT_PP(struc)); - break; - case IS_LONG: - php_printf("%slong(%ld) refcount(%u)\n", COMMON, Z_LVAL_PP(struc), Z_REFCOUNT_PP(struc)); - break; - case IS_DOUBLE: - php_printf("%sdouble(%.*G) refcount(%u)\n", COMMON, (int) EG(precision), Z_DVAL_PP(struc), Z_REFCOUNT_PP(struc)); - break; - case IS_STRING: - php_printf("%sstring(%d) \"", COMMON, Z_STRLEN_PP(struc)); - PHPWRITE(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc)); - php_printf("\" refcount(%u)\n", Z_REFCOUNT_PP(struc)); - break; - case IS_ARRAY: - myht = Z_ARRVAL_PP(struc); - if (myht->nApplyCount > 1) { - PUTS("*RECURSION*\n"); - return; - } - php_printf("%sarray(%d) refcount(%u){\n", COMMON, zend_hash_num_elements(myht), Z_REFCOUNT_PP(struc)); - zval_element_dump_func = zval_array_element_dump; - goto head_done; - case IS_OBJECT: - myht = Z_OBJPROP_PP(struc); - if (myht && myht->nApplyCount > 1) { - PUTS("*RECURSION*\n"); - return; - } - ce = Z_OBJCE(**struc); - Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC); - php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0, Z_REFCOUNT_PP(struc)); - efree(class_name); - zval_element_dump_func = zval_object_property_dump; -head_done: - if (myht) { - zend_hash_apply_with_arguments(myht, (apply_func_args_t) zval_element_dump_func, 1, level, (Z_TYPE_PP(struc) == IS_ARRAY ? 0 : 1)); - } - if (level > 1) { - php_printf("%*c", level-1, ' '); - } - PUTS("}\n"); - break; - case IS_RESOURCE: { - char *type_name; - - type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC); - php_printf("%sresource(%ld) of type (%s) refcount(%u)\n", COMMON, Z_LVAL_PP(struc), type_name ? type_name : "Unknown", Z_REFCOUNT_PP(struc)); - break; - } - default: - php_printf("%sUNKNOWN:0\n", COMMON); - break; - } -} - -/* }}} */ - -/* {{{ proto void debug_zval_dump(mixed var) - Dumps a string representation of an internal zend value to output. */ -PHP_FUNCTION(debug_zval_dump) -{ - zval ***args; - int argc; - int i; - - argc = ZEND_NUM_ARGS(); - - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (ZEND_NUM_ARGS() == 0 || zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - for (i=0; inKeyLength==0) { /* numeric key */ - php_printf("%*c%ld => ", level + 1, ' ', hash_key->h); - } else { /* string key */ - char *key, *tmp_str; - int key_len, tmp_len; - key = php_addcslashes(hash_key->arKey, hash_key->nKeyLength - 1, &key_len, 0, "'\\", 2 TSRMLS_CC); - tmp_str = php_str_to_str_ex(key, key_len, "\0", 1, "' . \"\\0\" . '", 12, &tmp_len, 0, NULL); - php_printf("%*c'", level + 1, ' '); - PHPWRITE(tmp_str, tmp_len); - php_printf("' => "); - efree(key); - efree(tmp_str); - } - php_var_export(zv, level + 2 TSRMLS_CC); - PUTS (",\n"); - return 0; -} - -static int php_object_element_export(zval **zv, int num_args, va_list args, zend_hash_key *hash_key) -{ - int level; - char *prop_name, *class_name; - TSRMLS_FETCH(); - - level = va_arg(args, int); - - if (hash_key->nKeyLength != 0) { - php_printf("%*c", level + 1, ' '); - zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name); - php_printf(" '%s' => ", prop_name); - php_var_export(zv, level + 2 TSRMLS_CC); - PUTS (",\n"); - } - return 0; -} - -PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC) -{ - HashTable *myht; - char *tmp_str, *tmp_str2; - int tmp_len, tmp_len2; - char *class_name; - zend_uint class_name_len; - - switch (Z_TYPE_PP(struc)) { - case IS_BOOL: - php_printf("%s", Z_LVAL_PP(struc) ? "true" : "false"); - break; - case IS_NULL: - php_printf("NULL"); - break; - case IS_LONG: - php_printf("%ld", Z_LVAL_PP(struc)); - break; - case IS_DOUBLE: - php_printf("%.*H", (int) EG(precision), Z_DVAL_PP(struc)); - break; - case IS_STRING: - tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\", 2 TSRMLS_CC); - tmp_str2 = php_str_to_str_ex(tmp_str, tmp_len, "\0", 1, "' . \"\\0\" . '", 12, &tmp_len2, 0, NULL); - PUTS ("'"); - PHPWRITE(tmp_str2, tmp_len2); - PUTS ("'"); - efree(tmp_str2); - efree(tmp_str); - break; - case IS_ARRAY: - myht = Z_ARRVAL_PP(struc); - if (level > 1) { - php_printf("\n%*c", level - 1, ' '); - } - PUTS ("array (\n"); - zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_array_element_export, 1, level, 0); - if (level > 1) { - php_printf("%*c", level - 1, ' '); - } - PUTS(")"); - break; - case IS_OBJECT: - myht = Z_OBJPROP_PP(struc); - if (level > 1) { - php_printf("\n%*c", level - 1, ' '); - } - Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC); - php_printf ("%s::__set_state(array(\n", class_name); - efree(class_name); - if (myht) { - zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_object_element_export, 1, level); - } - if (level > 1) { - php_printf("%*c", level - 1, ' '); - } - php_printf ("))"); - break; - default: - PUTS ("NULL"); - break; - } -} - -/* }}} */ - -/* {{{ proto mixed var_export(mixed var [, bool return]) - Outputs or returns a string representation of a variable */ -PHP_FUNCTION(var_export) -{ - zval *var; - zend_bool return_output = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &return_output) == FAILURE) { - return; - } - - if (return_output) { - php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC); - } - - php_var_export(&var, 1 TSRMLS_CC); - - if (return_output) { - php_ob_get_buffer (return_value TSRMLS_CC); - php_end_ob_buffer (0, 0 TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ php_var_serialize */ - -static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var_hash TSRMLS_DC); - -static inline int php_add_var_hash(HashTable *var_hash, zval *var, void *var_old TSRMLS_DC) -{ - ulong var_no; - char id[32], *p; - register int len; - - /* relies on "(long)" being a perfect hash function for data pointers, - however the actual identity of an object has had to be determined - by its object handle and the class entry since 5.0. */ - if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) { - p = smart_str_print_long(id + sizeof(id) - 1, - (((size_t)Z_OBJCE_P(var) << 5) - | ((size_t)Z_OBJCE_P(var) >> (sizeof(long) * 8 - 5))) - + (long) Z_OBJ_HANDLE_P(var)); - *(--p) = 'O'; - len = id + sizeof(id) - 1 - p; - } else { - p = smart_str_print_long(id + sizeof(id) - 1, (long) var); - len = id + sizeof(id) - 1 - p; - } - - if (var_old && zend_hash_find(var_hash, p, len, var_old) == SUCCESS) { - if (!var->is_ref) { - /* we still need to bump up the counter, since non-refs will - be counted separately by unserializer */ - var_no = -1; - zend_hash_next_index_insert(var_hash, &var_no, sizeof(var_no), NULL); - } - return FAILURE; - } - - /* +1 because otherwise hash will think we are trying to store NULL pointer */ - var_no = zend_hash_num_elements(var_hash) + 1; - zend_hash_add(var_hash, p, len, &var_no, sizeof(var_no), NULL); - return SUCCESS; -} - -static inline void php_var_serialize_long(smart_str *buf, long val) -{ - smart_str_appendl(buf, "i:", 2); - smart_str_append_long(buf, val); - smart_str_appendc(buf, ';'); -} - -static inline void php_var_serialize_string(smart_str *buf, char *str, int len) -{ - smart_str_appendl(buf, "s:", 2); - smart_str_append_long(buf, len); - smart_str_appendl(buf, ":\"", 2); - smart_str_appendl(buf, str, len); - smart_str_appendl(buf, "\";", 2); -} - -static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc TSRMLS_DC) -{ - PHP_CLASS_ATTRIBUTES; - - PHP_SET_CLASS_ATTRIBUTES(struc); - smart_str_appendl(buf, "O:", 2); - smart_str_append_long(buf, name_len); - smart_str_appendl(buf, ":\"", 2); - smart_str_appendl(buf, class_name, name_len); - smart_str_appendl(buf, "\":", 2); - PHP_CLEANUP_CLASS_ATTRIBUTES(); - return incomplete_class; -} - -static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, HashTable *var_hash TSRMLS_DC) -{ - int count; - zend_bool incomplete_class; - - incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC); - /* count after serializing name, since php_var_serialize_class_name - changes the count if the variable is incomplete class */ - count = zend_hash_num_elements(HASH_OF(retval_ptr)); - if (incomplete_class) { - --count; - } - smart_str_append_long(buf, count); - smart_str_appendl(buf, ":{", 2); - - if (count > 0) { - char *key; - zval **d, **name; - ulong index; - HashPosition pos; - int i; - zval nval, *nvalp; - - ZVAL_NULL(&nval); - nvalp = &nval; - - zend_hash_internal_pointer_reset_ex(HASH_OF(retval_ptr), &pos); - - for (;; zend_hash_move_forward_ex(HASH_OF(retval_ptr), &pos)) { - i = zend_hash_get_current_key_ex(HASH_OF(retval_ptr), &key, NULL, - &index, 0, &pos); - - if (i == HASH_KEY_NON_EXISTANT) - break; - - if (incomplete_class && strcmp(key, MAGIC_MEMBER) == 0) { - continue; - } - zend_hash_get_current_data_ex(HASH_OF(retval_ptr), - (void **) &name, &pos); - - if (Z_TYPE_PP(name) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only " - "containing the names of instance-variables to " - "serialize"); - /* we should still add element even if it's not OK, - since we already wrote the length of the array before */ - smart_str_appendl(buf,"N;", 2); - continue; - } - if (zend_hash_find(Z_OBJPROP_P(struc), Z_STRVAL_PP(name), - Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) { - php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); - php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC); - } else { - zend_class_entry *ce; - ce = zend_get_class_entry(struc TSRMLS_CC); - if (ce) { - char *prot_name, *priv_name; - int prop_name_length; - - do { - zend_mangle_property_name(&priv_name, &prop_name_length, ce->name, ce->name_length, - Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); - if (zend_hash_find(Z_OBJPROP_P(struc), priv_name, prop_name_length+1, (void *) &d) == SUCCESS) { - php_var_serialize_string(buf, priv_name, prop_name_length); - efree(priv_name); - php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC); - break; - } - efree(priv_name); - zend_mangle_property_name(&prot_name, &prop_name_length, "*", 1, - Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS); - if (zend_hash_find(Z_OBJPROP_P(struc), prot_name, prop_name_length+1, (void *) &d) == SUCCESS) { - php_var_serialize_string(buf, prot_name, prop_name_length); - efree(prot_name); - php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC); - break; - } - efree(prot_name); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but does not exist", Z_STRVAL_PP(name)); - php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); - php_var_serialize_intern(buf, nvalp, var_hash TSRMLS_CC); - } while (0); - } else { - php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); - php_var_serialize_intern(buf, nvalp, var_hash TSRMLS_CC); - } - } - } - } - smart_str_appendc(buf, '}'); -} - - -static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var_hash TSRMLS_DC) -{ - int i; - ulong *var_already; - HashTable *myht; - - if (var_hash - && php_add_var_hash(var_hash, struc, (void *) &var_already TSRMLS_CC) == FAILURE) { - if(struc->is_ref) { - smart_str_appendl(buf, "R:", 2); - smart_str_append_long(buf, *var_already); - smart_str_appendc(buf, ';'); - return; - } else if(Z_TYPE_P(struc) == IS_OBJECT) { - smart_str_appendl(buf, "r:", 2); - smart_str_append_long(buf, *var_already); - smart_str_appendc(buf, ';'); - return; - } - } - - switch (Z_TYPE_P(struc)) { - case IS_BOOL: - smart_str_appendl(buf, "b:", 2); - smart_str_append_long(buf, Z_LVAL_P(struc)); - smart_str_appendc(buf, ';'); - return; - - case IS_NULL: - smart_str_appendl(buf, "N;", 2); - return; - - case IS_LONG: - php_var_serialize_long(buf, Z_LVAL_P(struc)); - return; - - case IS_DOUBLE: { - char *s; - - smart_str_appendl(buf, "d:", 2); - s = (char *) safe_emalloc(PG(serialize_precision), 1, MAX_LENGTH_OF_DOUBLE + 1); - php_gcvt(Z_DVAL_P(struc), PG(serialize_precision), '.', 'E', s); - smart_str_appends(buf, s); - smart_str_appendc(buf, ';'); - efree(s); - return; - } - - case IS_STRING: - php_var_serialize_string(buf, Z_STRVAL_P(struc), Z_STRLEN_P(struc)); - return; - - case IS_OBJECT: { - zval *retval_ptr = NULL; - zval fname; - int res; - zend_class_entry *ce = NULL; - - if(Z_OBJ_HT_P(struc)->get_class_entry) { - ce = Z_OBJCE_P(struc); - } - - if(ce && ce->serialize != NULL) { - /* has custom handler */ - unsigned char *serialized_data = NULL; - zend_uint serialized_length; - - if(ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) { - smart_str_appendl(buf, "C:", 2); - smart_str_append_long(buf, Z_OBJCE_P(struc)->name_length); - smart_str_appendl(buf, ":\"", 2); - smart_str_appendl(buf, Z_OBJCE_P(struc)->name, Z_OBJCE_P(struc)->name_length); - smart_str_appendl(buf, "\":", 2); - - smart_str_append_long(buf, serialized_length); - smart_str_appendl(buf, ":{", 2); - smart_str_appendl(buf, serialized_data, serialized_length); - smart_str_appendc(buf, '}'); - } else { - smart_str_appendl(buf, "N;", 2); - } - if(serialized_data) { - efree(serialized_data); - } - return; - } - - if (ce && ce != PHP_IC_ENTRY && - zend_hash_exists(&ce->function_table, "__sleep", sizeof("__sleep"))) { - INIT_PZVAL(&fname); - ZVAL_STRINGL(&fname, "__sleep", sizeof("__sleep") - 1, 0); - res = call_user_function_ex(CG(function_table), &struc, &fname, - &retval_ptr, 0, 0, 1, NULL TSRMLS_CC); - - if (res == SUCCESS && !EG(exception)) { - if (retval_ptr) { - if (HASH_OF(retval_ptr)) { - php_var_serialize_class(buf, struc, retval_ptr, - var_hash TSRMLS_CC); - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only " - "containing the names of instance-variables to " - "serialize"); - /* we should still add element even if it's not OK, - since we already wrote the length of the array before */ - smart_str_appendl(buf,"N;", 2); - } - - zval_ptr_dtor(&retval_ptr); - } - return; - } - } - - if (retval_ptr) - zval_ptr_dtor(&retval_ptr); - /* fall-through */ - } - case IS_ARRAY: { - zend_bool incomplete_class = 0; - if (Z_TYPE_P(struc) == IS_ARRAY) { - smart_str_appendl(buf, "a:", 2); - myht = HASH_OF(struc); - } else { - incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC); - myht = Z_OBJPROP_P(struc); - } - /* count after serializing name, since php_var_serialize_class_name - changes the count if the variable is incomplete class */ - i = myht ? zend_hash_num_elements(myht) : 0; - if (i > 0 && incomplete_class) { - --i; - } - smart_str_append_long(buf, i); - smart_str_appendl(buf, ":{", 2); - if (i > 0) { - char *key; - zval **data; - ulong index; - uint key_len; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(myht, &pos); - for (;; zend_hash_move_forward_ex(myht, &pos)) { - i = zend_hash_get_current_key_ex(myht, &key, &key_len, - &index, 0, &pos); - if (i == HASH_KEY_NON_EXISTANT) - break; - - if (incomplete_class && strcmp(key, MAGIC_MEMBER) == 0) { - continue; - } - - switch (i) { - case HASH_KEY_IS_LONG: - php_var_serialize_long(buf, index); - break; - case HASH_KEY_IS_STRING: - php_var_serialize_string(buf, key, key_len - 1); - break; - } - - /* we should still add element even if it's not OK, - since we already wrote the length of the array before */ - if (zend_hash_get_current_data_ex(myht, - (void **) &data, &pos) != SUCCESS - || !data - || data == &struc - || (Z_TYPE_PP(data) == IS_ARRAY && Z_ARRVAL_PP(data)->nApplyCount > 1) - ) { - smart_str_appendl(buf, "N;", 2); - } else { - if (Z_TYPE_PP(data) == IS_ARRAY) { - Z_ARRVAL_PP(data)->nApplyCount++; - } - php_var_serialize_intern(buf, *data, var_hash TSRMLS_CC); - if (Z_TYPE_PP(data) == IS_ARRAY) { - Z_ARRVAL_PP(data)->nApplyCount--; - } - } - } - } - smart_str_appendc(buf, '}'); - return; - } - default: - smart_str_appendl(buf, "i:0;", 4); - return; - } -} - -PHPAPI void php_var_serialize(smart_str *buf, zval **struc, HashTable *var_hash TSRMLS_DC) -{ - php_var_serialize_intern(buf, *struc, var_hash TSRMLS_CC); - smart_str_0(buf); -} - -/* }}} */ - -/* {{{ proto string serialize(mixed variable) - Returns a string representation of variable (which can later be unserialized) */ -PHP_FUNCTION(serialize) -{ - zval **struc; - php_serialize_data_t var_hash; - smart_str buf = {0}; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &struc) == FAILURE) { - WRONG_PARAM_COUNT; - } - - Z_TYPE_P(return_value) = IS_STRING; - Z_STRVAL_P(return_value) = NULL; - Z_STRLEN_P(return_value) = 0; - - PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&buf, struc, &var_hash TSRMLS_CC); - PHP_VAR_SERIALIZE_DESTROY(var_hash); - - if (buf.c) { - RETURN_STRINGL(buf.c, buf.len, 0); - } else { - RETURN_NULL(); - } -} - -/* }}} */ - -/* {{{ proto mixed unserialize(string variable_representation) - Takes a string representation of variable and recreates it */ - - -PHP_FUNCTION(unserialize) -{ - char *buf; - int buf_len; - const unsigned char *p; - php_unserialize_data_t var_hash; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) { - RETURN_FALSE; - } - - if (buf_len == 0) { - RETURN_FALSE; - } - - p = (const unsigned char*)buf; - PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (!php_var_unserialize(&return_value, &p, p + buf_len, &var_hash TSRMLS_CC)) { - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - zval_dtor(return_value); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %d bytes", (long)((char*)p - buf), buf_len); - RETURN_FALSE; - } - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); -} - -/* }}} */ - -/* {{{ proto int memory_get_usage([real_usage]) - Returns the allocated by PHP memory */ -PHP_FUNCTION(memory_get_usage) { - zend_bool real_usage = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(zend_memory_usage(real_usage TSRMLS_CC)); -} -/* }}} */ - -/* {{{ proto int memory_get_peak_usage([real_usage]) - Returns the peak allocated by PHP memory */ -PHP_FUNCTION(memory_get_peak_usage) { - zend_bool real_usage = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) { - RETURN_FALSE; - } - - RETURN_LONG(zend_memory_peak_usage(real_usage TSRMLS_CC)); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c deleted file mode 100644 index 273ddbf9185b6..0000000000000 --- a/ext/standard/var_unserializer.c +++ /dev/null @@ -1,1153 +0,0 @@ -/* Generated by re2c 0.13.5 on Sat Oct 4 10:07:18 2008 */ -#line 1 "ext/standard/var_unserializer.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/php_var.h" -#include "php_incomplete_class.h" - -/* {{{ reference-handling for unserializer: var_* */ -#define VAR_ENTRIES_MAX 1024 - -typedef struct { - zval *data[VAR_ENTRIES_MAX]; - long used_slots; - void *next; -} var_entries; - -static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first) - var_hashx->first = var_hash; - else - prev->next = var_hash; - } - - var_hash->data[var_hash->used_slots++] = *rval; -} - -static inline void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first_dtor, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first_dtor) - var_hashx->first_dtor = var_hash; - else - prev->next = var_hash; - } - - (*rval)->refcount++; - var_hash->data[var_hash->used_slots++] = *rval; -} - -PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) -{ - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - if (var_hash->data[i] == ozval) { - var_hash->data[i] = *nzval; - /* do not break here */ - } - } - var_hash = var_hash->next; - } -} - -static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store) -{ - var_entries *var_hash = var_hashx->first; - - while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - var_hash = var_hash->next; - id -= VAR_ENTRIES_MAX; - } - - if (!var_hash) return !SUCCESS; - - if (id < 0 || id >= var_hash->used_slots) return !SUCCESS; - - *store = &var_hash->data[id]; - - return SUCCESS; -} - -PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) -{ - void *next; - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - next = var_hash->next; - efree(var_hash); - var_hash = next; - } - - var_hash = var_hashx->first_dtor; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - zval_ptr_dtor(&var_hash->data[i]); - } - next = var_hash->next; - efree(var_hash); - var_hash = next; - } -} - -/* }}} */ - -static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen) -{ - size_t i, j; - char *str = safe_emalloc(*len, 1, 1); - unsigned char *end = *(unsigned char **)p+maxlen; - - if (end < *p) { - efree(str); - return NULL; - } - - for (i = 0; i < *len; i++) { - if (*p >= end) { - efree(str); - return NULL; - } - if (**p != '\\') { - str[i] = (char)**p; - } else { - unsigned char ch = 0; - - for (j = 0; j < 2; j++) { - (*p)++; - if (**p >= '0' && **p <= '9') { - ch = (ch << 4) + (**p -'0'); - } else if (**p >= 'a' && **p <= 'f') { - ch = (ch << 4) + (**p -'a'+10); - } else if (**p >= 'A' && **p <= 'F') { - ch = (ch << 4) + (**p -'A'+10); - } else { - efree(str); - return NULL; - } - } - str[i] = (char)ch; - } - (*p)++; - } - str[i] = 0; - *len = i; - return str; -} - -#define YYFILL(n) do { } while (0) -#define YYCTYPE unsigned char -#define YYCURSOR cursor -#define YYLIMIT limit -#define YYMARKER marker - - -#line 198 "ext/standard/var_unserializer.re" - - - - -static inline long parse_iv2(const unsigned char *p, const unsigned char **q) -{ - char cursor; - long result = 0; - int neg = 0; - - switch (*p) { - case '-': - neg++; - /* fall-through */ - case '+': - p++; - } - - while (1) { - cursor = (char)*p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + cursor - '0'; - } else { - break; - } - p++; - } - if (q) *q = p; - if (neg) return -result; - return result; -} - -static inline long parse_iv(const unsigned char *p) -{ - return parse_iv2(p, NULL); -} - -/* no need to check for length - re2c already did */ -static inline size_t parse_uiv(const unsigned char *p) -{ - unsigned char cursor; - size_t result = 0; - - if (*p == '+') { - p++; - } - - while (1) { - cursor = *p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + (size_t)(cursor - (unsigned char)'0'); - } else { - break; - } - p++; - } - return result; -} - -#define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC -#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC - -static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements) -{ - while (elements-- > 0) { - zval *key, *data, **old_data; - - ALLOC_INIT_ZVAL(key); - - if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - if (Z_TYPE_P(key) != IS_LONG && Z_TYPE_P(key) != IS_STRING) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - ALLOC_INIT_ZVAL(data); - - if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - zval_dtor(data); - FREE_ZVAL(data); - return 0; - } - - switch (Z_TYPE_P(key)) { - case IS_LONG: - if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); - break; - case IS_STRING: - if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_symtable_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); - break; - } - - zval_dtor(key); - FREE_ZVAL(key); - - if (elements && *(*p-1) != ';' && *(*p-1) != '}') { - (*p)--; - return 0; - } - } - - return 1; -} - -static inline int finish_nested_data(UNSERIALIZE_PARAMETER) -{ - if (*((*p)++) == '}') - return 1; - -#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE - zval_ptr_dtor(rval); -#endif - return 0; -} - -static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long datalen; - - if (ce->unserialize == NULL) { - zend_error(E_WARNING, "Class %s has no unserializer", ce->name); - return 0; - } - - datalen = parse_iv2((*p) + 2, p); - - (*p) += 2; - - if (datalen < 0 || (*p) + datalen >= max) { - zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p))); - return 0; - } - - if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { - return 0; - } - - (*p) += datalen; - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} - -static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long elements; - - elements = parse_iv2((*p) + 2, p); - - (*p) += 2; - - object_init_ex(*rval, ce); - return elements; -} - -static inline int object_common2(UNSERIALIZE_PARAMETER, long elements) -{ - zval *retval_ptr = NULL; - zval fname; - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements)) { - return 0; - } - - if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY && - zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))) { - INIT_PZVAL(&fname); - ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0); - call_user_function_ex(CG(function_table), rval, &fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC); - } - - if (retval_ptr) - zval_ptr_dtor(&retval_ptr); - - return finish_nested_data(UNSERIALIZE_PASSTHRU); - -} - -PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) -{ - const unsigned char *cursor, *limit, *marker, *start; - zval **rval_ref; - - limit = cursor = *p; - - if (var_hash && cursor[0] != 'R') { - var_push(var_hash, rval); - } - - start = cursor; - - - - -#line 402 "ext/standard/var_unserializer.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - - if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7); - yych = *YYCURSOR; - switch (yych) { - case 'C': - case 'O': goto yy13; - case 'N': goto yy5; - case 'R': goto yy2; - case 'S': goto yy10; - case 'a': goto yy11; - case 'b': goto yy6; - case 'd': goto yy8; - case 'i': goto yy7; - case 'o': goto yy12; - case 'r': goto yy4; - case 's': goto yy9; - case '}': goto yy14; - default: goto yy16; - } -yy2: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy95; -yy3: -#line 698 "ext/standard/var_unserializer.re" - { return 0; } -#line 464 "ext/standard/var_unserializer.c" -yy4: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy89; - goto yy3; -yy5: - yych = *++YYCURSOR; - if (yych == ';') goto yy87; - goto yy3; -yy6: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy83; - goto yy3; -yy7: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy77; - goto yy3; -yy8: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy53; - goto yy3; -yy9: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy46; - goto yy3; -yy10: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy39; - goto yy3; -yy11: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy32; - goto yy3; -yy12: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy25; - goto yy3; -yy13: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy17; - goto yy3; -yy14: - ++YYCURSOR; -#line 692 "ext/standard/var_unserializer.re" - { - /* this is the case where we have less data than planned */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); - return 0; /* not sure if it should be 0 or 1 here? */ -} -#line 513 "ext/standard/var_unserializer.c" -yy16: - yych = *++YYCURSOR; - goto yy3; -yy17: - yych = *++YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy20; - } - if (yych == '+') goto yy19; -yy18: - YYCURSOR = YYMARKER; - goto yy3; -yy19: - yych = *++YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy20; - } - goto yy18; -yy20: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy20; - } - if (yych != ':') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; - ++YYCURSOR; -#line 580 "ext/standard/var_unserializer.re" - { - size_t len, len2, len3, maxlen; - long elements; - char *class_name; - zend_class_entry *ce; - zend_class_entry **pce; - int incomplete_class = 0; - - int custom_object = 0; - - zval *user_func; - zval *retval_ptr; - zval **args[1]; - zval *arg_func_name; - - if (*start == 'C') { - custom_object = 1; - } - - INIT_PZVAL(*rval); - len2 = len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len || len == 0) { - *p = start + 2; - return 0; - } - - class_name = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - if (*(YYCURSOR+1) != ':') { - *p = YYCURSOR+1; - return 0; - } - - len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"); - if (len3 != len) - { - *p = YYCURSOR + len3 - len; - return 0; - } - - class_name = estrndup(class_name, len); - - do { - /* Try to find class directly */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - break; - } - - /* Check for unserialize callback */ - if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { - incomplete_class = 1; - ce = PHP_IC_ENTRY; - break; - } - - /* Call unserialize callback */ - MAKE_STD_ZVAL(user_func); - ZVAL_STRING(user_func, PG(unserialize_callback_func), 1); - args[0] = &arg_func_name; - MAKE_STD_ZVAL(arg_func_name); - ZVAL_STRING(arg_func_name, class_name, 1); - if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - - /* The callback function may have defined the class */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - } - - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } while (1); - - *p = YYCURSOR; - - if (custom_object) { - efree(class_name); - return object_custom(UNSERIALIZE_PASSTHRU, ce); - } - - elements = object_common1(UNSERIALIZE_PASSTHRU, ce); - - if (incomplete_class) { - php_store_class_name(*rval, class_name, len2); - } - efree(class_name); - - return object_common2(UNSERIALIZE_PASSTHRU, elements); -} -#line 655 "ext/standard/var_unserializer.c" -yy25: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy26; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy27; - goto yy18; - } -yy26: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy27: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy27; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; - ++YYCURSOR; -#line 572 "ext/standard/var_unserializer.re" - { - - INIT_PZVAL(*rval); - - return object_common2(UNSERIALIZE_PASSTHRU, - object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); -} -#line 688 "ext/standard/var_unserializer.c" -yy32: - yych = *++YYCURSOR; - if (yych == '+') goto yy33; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy34; - goto yy18; -yy33: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy34: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy34; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '{') goto yy18; - ++YYCURSOR; -#line 550 "ext/standard/var_unserializer.re" - { - long elements = parse_iv(start + 2); - /* use iv() not uiv() in order to check data range */ - *p = YYCURSOR; - - if (elements < 0) { - return 0; - } - - INIT_PZVAL(*rval); - Z_TYPE_PP(rval) = IS_ARRAY; - ALLOC_HASHTABLE(Z_ARRVAL_PP(rval)); - - zend_hash_init(Z_ARRVAL_PP(rval), elements + 1, NULL, ZVAL_PTR_DTOR, 0); - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_PP(rval), elements)) { - return 0; - } - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} -#line 731 "ext/standard/var_unserializer.c" -yy39: - yych = *++YYCURSOR; - if (yych == '+') goto yy40; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy41; - goto yy18; -yy40: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy41: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy41; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; - ++YYCURSOR; -#line 521 "ext/standard/var_unserializer.re" - { - size_t len, maxlen; - char *str; - - len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len) { - *p = start + 2; - return 0; - } - - if ((str = unserialize_str(&YYCURSOR, &len, maxlen)) == NULL) { - return 0; - } - - if (*(YYCURSOR) != '"') { - efree(str); - *p = YYCURSOR; - return 0; - } - - YYCURSOR += 2; - *p = YYCURSOR; - - INIT_PZVAL(*rval); - ZVAL_STRINGL(*rval, str, len, 0); - return 1; -} -#line 781 "ext/standard/var_unserializer.c" -yy46: - yych = *++YYCURSOR; - if (yych == '+') goto yy47; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy48; - goto yy18; -yy47: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy48: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy48; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; - ++YYCURSOR; -#line 493 "ext/standard/var_unserializer.re" - { - size_t len, maxlen; - char *str; - - len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len) { - *p = start + 2; - return 0; - } - - str = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - - YYCURSOR += 2; - *p = YYCURSOR; - - INIT_PZVAL(*rval); - ZVAL_STRINGL(*rval, str, len, 1); - return 1; -} -#line 830 "ext/standard/var_unserializer.c" -yy53: - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych <= ',') { - if (yych == '+') goto yy57; - goto yy18; - } else { - if (yych <= '-') goto yy55; - if (yych <= '.') goto yy60; - goto yy18; - } - } else { - if (yych <= 'I') { - if (yych <= '9') goto yy58; - if (yych <= 'H') goto yy18; - goto yy56; - } else { - if (yych != 'N') goto yy18; - } - } - yych = *++YYCURSOR; - if (yych == 'A') goto yy76; - goto yy18; -yy55: - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy60; - goto yy18; - } else { - if (yych <= '9') goto yy58; - if (yych != 'I') goto yy18; - } -yy56: - yych = *++YYCURSOR; - if (yych == 'N') goto yy72; - goto yy18; -yy57: - yych = *++YYCURSOR; - if (yych == '.') goto yy60; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy58: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - if (yych <= ':') { - if (yych <= '.') { - if (yych <= '-') goto yy18; - goto yy70; - } else { - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy58; - goto yy18; - } - } else { - if (yych <= 'E') { - if (yych <= ';') goto yy63; - if (yych <= 'D') goto yy18; - goto yy65; - } else { - if (yych == 'e') goto yy65; - goto yy18; - } - } -yy60: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy61: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - if (yych <= ';') { - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy61; - if (yych <= ':') goto yy18; - } else { - if (yych <= 'E') { - if (yych <= 'D') goto yy18; - goto yy65; - } else { - if (yych == 'e') goto yy65; - goto yy18; - } - } -yy63: - ++YYCURSOR; -#line 486 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL)); - return 1; -} -#line 925 "ext/standard/var_unserializer.c" -yy65: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy66; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy67; - goto yy18; - } -yy66: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych == '+') goto yy69; - goto yy18; - } else { - if (yych <= '-') goto yy69; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; - } -yy67: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy67; - if (yych == ';') goto yy63; - goto yy18; -yy69: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy67; - goto yy18; -yy70: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - if (yych <= ';') { - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy70; - if (yych <= ':') goto yy18; - goto yy63; - } else { - if (yych <= 'E') { - if (yych <= 'D') goto yy18; - goto yy65; - } else { - if (yych == 'e') goto yy65; - goto yy18; - } - } -yy72: - yych = *++YYCURSOR; - if (yych != 'F') goto yy18; -yy73: - yych = *++YYCURSOR; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 471 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - INIT_PZVAL(*rval); - - if (!strncmp(start + 2, "NAN", 3)) { - ZVAL_DOUBLE(*rval, php_get_nan()); - } else if (!strncmp(start + 2, "INF", 3)) { - ZVAL_DOUBLE(*rval, php_get_inf()); - } else if (!strncmp(start + 2, "-INF", 4)) { - ZVAL_DOUBLE(*rval, -php_get_inf()); - } - - return 1; -} -#line 999 "ext/standard/var_unserializer.c" -yy76: - yych = *++YYCURSOR; - if (yych == 'N') goto yy73; - goto yy18; -yy77: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy78; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy79; - goto yy18; - } -yy78: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy79: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy79; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 464 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_LONG(*rval, parse_iv(start + 2)); - return 1; -} -#line 1033 "ext/standard/var_unserializer.c" -yy83: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= '2') goto yy18; - yych = *++YYCURSOR; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 457 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_BOOL(*rval, parse_iv(start + 2)); - return 1; -} -#line 1048 "ext/standard/var_unserializer.c" -yy87: - ++YYCURSOR; -#line 450 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_NULL(*rval); - return 1; -} -#line 1058 "ext/standard/var_unserializer.c" -yy89: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy90; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy91; - goto yy18; - } -yy90: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy91: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy91; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 427 "ext/standard/var_unserializer.re" - { - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval == *rval_ref) return 0; - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - (*rval)->refcount++; - (*rval)->is_ref = 0; - - return 1; -} -#line 1104 "ext/standard/var_unserializer.c" -yy95: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy96; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy97; - goto yy18; - } -yy96: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy97: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy97; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 406 "ext/standard/var_unserializer.re" - { - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - (*rval)->refcount++; - (*rval)->is_ref = 1; - - return 1; -} -#line 1148 "ext/standard/var_unserializer.c" -} -#line 700 "ext/standard/var_unserializer.re" - - - return 0; -} diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re deleted file mode 100644 index c4d936a79078b..0000000000000 --- a/ext/standard/var_unserializer.re +++ /dev/null @@ -1,703 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/php_var.h" -#include "php_incomplete_class.h" - -/* {{{ reference-handling for unserializer: var_* */ -#define VAR_ENTRIES_MAX 1024 - -typedef struct { - zval *data[VAR_ENTRIES_MAX]; - long used_slots; - void *next; -} var_entries; - -static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first) - var_hashx->first = var_hash; - else - prev->next = var_hash; - } - - var_hash->data[var_hash->used_slots++] = *rval; -} - -static inline void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first_dtor, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first_dtor) - var_hashx->first_dtor = var_hash; - else - prev->next = var_hash; - } - - (*rval)->refcount++; - var_hash->data[var_hash->used_slots++] = *rval; -} - -PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) -{ - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - if (var_hash->data[i] == ozval) { - var_hash->data[i] = *nzval; - /* do not break here */ - } - } - var_hash = var_hash->next; - } -} - -static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store) -{ - var_entries *var_hash = var_hashx->first; - - while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - var_hash = var_hash->next; - id -= VAR_ENTRIES_MAX; - } - - if (!var_hash) return !SUCCESS; - - if (id < 0 || id >= var_hash->used_slots) return !SUCCESS; - - *store = &var_hash->data[id]; - - return SUCCESS; -} - -PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) -{ - void *next; - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - next = var_hash->next; - efree(var_hash); - var_hash = next; - } - - var_hash = var_hashx->first_dtor; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - zval_ptr_dtor(&var_hash->data[i]); - } - next = var_hash->next; - efree(var_hash); - var_hash = next; - } -} - -/* }}} */ - -static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen) -{ - size_t i, j; - char *str = safe_emalloc(*len, 1, 1); - unsigned char *end = *(unsigned char **)p+maxlen; - - if (end < *p) { - efree(str); - return NULL; - } - - for (i = 0; i < *len; i++) { - if (*p >= end) { - efree(str); - return NULL; - } - if (**p != '\\') { - str[i] = (char)**p; - } else { - unsigned char ch = 0; - - for (j = 0; j < 2; j++) { - (*p)++; - if (**p >= '0' && **p <= '9') { - ch = (ch << 4) + (**p -'0'); - } else if (**p >= 'a' && **p <= 'f') { - ch = (ch << 4) + (**p -'a'+10); - } else if (**p >= 'A' && **p <= 'F') { - ch = (ch << 4) + (**p -'A'+10); - } else { - efree(str); - return NULL; - } - } - str[i] = (char)ch; - } - (*p)++; - } - str[i] = 0; - *len = i; - return str; -} - -#define YYFILL(n) do { } while (0) -#define YYCTYPE unsigned char -#define YYCURSOR cursor -#define YYLIMIT limit -#define YYMARKER marker - - -/*!re2c -uiv = [+]? [0-9]+; -iv = [+-]? [0-9]+; -nv = [+-]? ([0-9]* "." [0-9]+|[0-9]+ "." [0-9]*); -nvexp = (iv | nv) [eE] [+-]? iv; -any = [\000-\377]; -object = [OC]; -*/ - - - -static inline long parse_iv2(const unsigned char *p, const unsigned char **q) -{ - char cursor; - long result = 0; - int neg = 0; - - switch (*p) { - case '-': - neg++; - /* fall-through */ - case '+': - p++; - } - - while (1) { - cursor = (char)*p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + cursor - '0'; - } else { - break; - } - p++; - } - if (q) *q = p; - if (neg) return -result; - return result; -} - -static inline long parse_iv(const unsigned char *p) -{ - return parse_iv2(p, NULL); -} - -/* no need to check for length - re2c already did */ -static inline size_t parse_uiv(const unsigned char *p) -{ - unsigned char cursor; - size_t result = 0; - - if (*p == '+') { - p++; - } - - while (1) { - cursor = *p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + (size_t)(cursor - (unsigned char)'0'); - } else { - break; - } - p++; - } - return result; -} - -#define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC -#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC - -static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements) -{ - while (elements-- > 0) { - zval *key, *data, **old_data; - - ALLOC_INIT_ZVAL(key); - - if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - if (Z_TYPE_P(key) != IS_LONG && Z_TYPE_P(key) != IS_STRING) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - ALLOC_INIT_ZVAL(data); - - if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - zval_dtor(data); - FREE_ZVAL(data); - return 0; - } - - switch (Z_TYPE_P(key)) { - case IS_LONG: - if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); - break; - case IS_STRING: - if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_symtable_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); - break; - } - - zval_dtor(key); - FREE_ZVAL(key); - - if (elements && *(*p-1) != ';' && *(*p-1) != '}') { - (*p)--; - return 0; - } - } - - return 1; -} - -static inline int finish_nested_data(UNSERIALIZE_PARAMETER) -{ - if (*((*p)++) == '}') - return 1; - -#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE - zval_ptr_dtor(rval); -#endif - return 0; -} - -static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long datalen; - - if (ce->unserialize == NULL) { - zend_error(E_WARNING, "Class %s has no unserializer", ce->name); - return 0; - } - - datalen = parse_iv2((*p) + 2, p); - - (*p) += 2; - - if (datalen < 0 || (*p) + datalen >= max) { - zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p))); - return 0; - } - - if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { - return 0; - } - - (*p) += datalen; - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} - -static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long elements; - - elements = parse_iv2((*p) + 2, p); - - (*p) += 2; - - object_init_ex(*rval, ce); - return elements; -} - -static inline int object_common2(UNSERIALIZE_PARAMETER, long elements) -{ - zval *retval_ptr = NULL; - zval fname; - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements)) { - return 0; - } - - if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY && - zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))) { - INIT_PZVAL(&fname); - ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0); - call_user_function_ex(CG(function_table), rval, &fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC); - } - - if (retval_ptr) - zval_ptr_dtor(&retval_ptr); - - return finish_nested_data(UNSERIALIZE_PASSTHRU); - -} - -PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) -{ - const unsigned char *cursor, *limit, *marker, *start; - zval **rval_ref; - - limit = cursor = *p; - - if (var_hash && cursor[0] != 'R') { - var_push(var_hash, rval); - } - - start = cursor; - - - -/*!re2c - -"R:" iv ";" { - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - (*rval)->refcount++; - (*rval)->is_ref = 1; - - return 1; -} - -"r:" iv ";" { - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval == *rval_ref) return 0; - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - (*rval)->refcount++; - (*rval)->is_ref = 0; - - return 1; -} - -"N;" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_NULL(*rval); - return 1; -} - -"b:" [01] ";" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_BOOL(*rval, parse_iv(start + 2)); - return 1; -} - -"i:" iv ";" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_LONG(*rval, parse_iv(start + 2)); - return 1; -} - -"d:" ("NAN" | "-"? "INF") ";" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - - if (!strncmp(start + 2, "NAN", 3)) { - ZVAL_DOUBLE(*rval, php_get_nan()); - } else if (!strncmp(start + 2, "INF", 3)) { - ZVAL_DOUBLE(*rval, php_get_inf()); - } else if (!strncmp(start + 2, "-INF", 4)) { - ZVAL_DOUBLE(*rval, -php_get_inf()); - } - - return 1; -} - -"d:" (iv | nv | nvexp) ";" { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL)); - return 1; -} - -"s:" uiv ":" ["] { - size_t len, maxlen; - char *str; - - len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len) { - *p = start + 2; - return 0; - } - - str = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - - YYCURSOR += 2; - *p = YYCURSOR; - - INIT_PZVAL(*rval); - ZVAL_STRINGL(*rval, str, len, 1); - return 1; -} - -"S:" uiv ":" ["] { - size_t len, maxlen; - char *str; - - len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len) { - *p = start + 2; - return 0; - } - - if ((str = unserialize_str(&YYCURSOR, &len, maxlen)) == NULL) { - return 0; - } - - if (*(YYCURSOR) != '"') { - efree(str); - *p = YYCURSOR; - return 0; - } - - YYCURSOR += 2; - *p = YYCURSOR; - - INIT_PZVAL(*rval); - ZVAL_STRINGL(*rval, str, len, 0); - return 1; -} - -"a:" uiv ":" "{" { - long elements = parse_iv(start + 2); - /* use iv() not uiv() in order to check data range */ - *p = YYCURSOR; - - if (elements < 0) { - return 0; - } - - INIT_PZVAL(*rval); - Z_TYPE_PP(rval) = IS_ARRAY; - ALLOC_HASHTABLE(Z_ARRVAL_PP(rval)); - - zend_hash_init(Z_ARRVAL_PP(rval), elements + 1, NULL, ZVAL_PTR_DTOR, 0); - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_PP(rval), elements)) { - return 0; - } - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} - -"o:" iv ":" ["] { - - INIT_PZVAL(*rval); - - return object_common2(UNSERIALIZE_PASSTHRU, - object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); -} - -object ":" uiv ":" ["] { - size_t len, len2, len3, maxlen; - long elements; - char *class_name; - zend_class_entry *ce; - zend_class_entry **pce; - int incomplete_class = 0; - - int custom_object = 0; - - zval *user_func; - zval *retval_ptr; - zval **args[1]; - zval *arg_func_name; - - if (*start == 'C') { - custom_object = 1; - } - - INIT_PZVAL(*rval); - len2 = len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len || len == 0) { - *p = start + 2; - return 0; - } - - class_name = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - if (*(YYCURSOR+1) != ':') { - *p = YYCURSOR+1; - return 0; - } - - len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"); - if (len3 != len) - { - *p = YYCURSOR + len3 - len; - return 0; - } - - class_name = estrndup(class_name, len); - - do { - /* Try to find class directly */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - break; - } - - /* Check for unserialize callback */ - if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { - incomplete_class = 1; - ce = PHP_IC_ENTRY; - break; - } - - /* Call unserialize callback */ - MAKE_STD_ZVAL(user_func); - ZVAL_STRING(user_func, PG(unserialize_callback_func), 1); - args[0] = &arg_func_name; - MAKE_STD_ZVAL(arg_func_name); - ZVAL_STRING(arg_func_name, class_name, 1); - if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - - /* The callback function may have defined the class */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - } - - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } while (1); - - *p = YYCURSOR; - - if (custom_object) { - efree(class_name); - return object_custom(UNSERIALIZE_PASSTHRU, ce); - } - - elements = object_common1(UNSERIALIZE_PASSTHRU, ce); - - if (incomplete_class) { - php_store_class_name(*rval, class_name, len2); - } - efree(class_name); - - return object_common2(UNSERIALIZE_PASSTHRU, elements); -} - -"}" { - /* this is the case where we have less data than planned */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); - return 0; /* not sure if it should be 0 or 1 here? */ -} - -any { return 0; } - -*/ - - return 0; -} diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c deleted file mode 100644 index 4160fc6359fae..0000000000000 --- a/ext/standard/versioning.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Stig Sæther Bakken | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include -#include -#include -#include -#include "php.h" -#include "php_versioning.h" - -#define sign(n) ((n)<0?-1:((n)>0?1:0)) - -/* {{{ php_canonicalize_version() */ - -PHPAPI char * -php_canonicalize_version(const char *version) -{ - int len = strlen(version); - char *buf = safe_emalloc(len, 2, 1), *q, lp, lq; - const char *p; - - if (len == 0) { - *buf = '\0'; - return buf; - } - - p = version; - q = buf; - *q++ = lp = *p++; - lq = '\0'; - while (*p) { -/* s/[-_+]/./g; - * s/([^\d\.])([^\D\.])/$1.$2/g; - * s/([^\D\.])([^\d\.])/$1.$2/g; - */ -#define isdig(x) (isdigit(x)&&(x)!='.') -#define isndig(x) (!isdigit(x)&&(x)!='.') -#define isspecialver(x) ((x)=='-'||(x)=='_'||(x)=='+') - - lq = *(q - 1); - if (isspecialver(*p)) { - if (lq != '.') { - lq = *q++ = '.'; - } - } else if ((isndig(lp) && isdig(*p)) || (isdig(lp) && isndig(*p))) { - if (lq != '.') { - *q++ = '.'; - } - lq = *q++ = *p; - } else if (!isalnum(*p)) { - if (lq != '.') { - lq = *q++ = '.'; - } - } else { - lq = *q++ = *p; - } - lp = *p++; - } - *q++ = '\0'; - return buf; -} - -/* }}} */ -/* {{{ compare_special_version_forms() */ - -typedef struct { - const char *name; - int order; -} special_forms_t; - -static int -compare_special_version_forms(char *form1, char *form2) -{ - int found1 = -1, found2 = -1; - special_forms_t special_forms[11] = { - {"dev", 0}, - {"alpha", 1}, - {"a", 1}, - {"beta", 2}, - {"b", 2}, - {"RC", 3}, - {"rc", 3}, - {"#", 4}, - {"pl", 5}, - {"p", 5}, - {NULL, 0}, - }; - special_forms_t *pp; - - for (pp = special_forms; pp && pp->name; pp++) { - if (strncmp(form1, pp->name, strlen(pp->name)) == 0) { - found1 = pp->order; - break; - } - } - for (pp = special_forms; pp && pp->name; pp++) { - if (strncmp(form2, pp->name, strlen(pp->name)) == 0) { - found2 = pp->order; - break; - } - } - return sign(found1 - found2); -} - -/* }}} */ -/* {{{ php_version_compare() */ - -PHPAPI int -php_version_compare(const char *orig_ver1, const char *orig_ver2) -{ - char *ver1; - char *ver2; - char *p1, *p2, *n1, *n2; - long l1, l2; - int compare = 0; - - if (!*orig_ver1 || !*orig_ver2) { - if (!*orig_ver1 && !*orig_ver2) { - return 0; - } else { - return *orig_ver1 ? 1 : -1; - } - } - if (orig_ver1[0] == '#') { - ver1 = estrdup(orig_ver1); - } else { - ver1 = php_canonicalize_version(orig_ver1); - } - if (orig_ver2[0] == '#') { - ver2 = estrdup(orig_ver2); - } else { - ver2 = php_canonicalize_version(orig_ver2); - } - p1 = n1 = ver1; - p2 = n2 = ver2; - while (*p1 && *p2 && n1 && n2) { - if ((n1 = strchr(p1, '.')) != NULL) { - *n1 = '\0'; - } - if ((n2 = strchr(p2, '.')) != NULL) { - *n2 = '\0'; - } - if (isdigit(*p1) && isdigit(*p2)) { - /* compare element numerically */ - l1 = strtol(p1, NULL, 10); - l2 = strtol(p2, NULL, 10); - compare = sign(l1 - l2); - } else if (!isdigit(*p1) && !isdigit(*p2)) { - /* compare element names */ - compare = compare_special_version_forms(p1, p2); - } else { - /* mix of names and numbers */ - if (isdigit(*p1)) { - compare = compare_special_version_forms("#N#", p2); - } else { - compare = compare_special_version_forms(p1, "#N#"); - } - } - if (compare != 0) { - break; - } - if (n1 != NULL) { - p1 = n1 + 1; - } - if (n2 != NULL) { - p2 = n2 + 1; - } - } - if (compare == 0) { - if (n1 != NULL) { - if (isdigit(*p1)) { - compare = 1; - } else { - compare = php_version_compare(p1, "#N#"); - } - } else if (n2 != NULL) { - if (isdigit(*p2)) { - compare = -1; - } else { - compare = php_version_compare("#N#", p2); - } - } - } - efree(ver1); - efree(ver2); - return compare; -} - -/* }}} */ -/* {{{ proto int version_compare(string ver1, string ver2 [, string oper]) - Compares two "PHP-standardized" version number strings */ - -PHP_FUNCTION(version_compare) -{ - char *v1, *v2, *op; - int v1_len, v2_len, op_len; - int compare, argc; - - argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc TSRMLS_CC, "ss|s", &v1, &v1_len, &v2, - &v2_len, &op, &op_len) == FAILURE) { - return; - } - compare = php_version_compare(v1, v2); - if (argc == 2) { - RETURN_LONG(compare); - } - if (!strncmp(op, "<", op_len) || !strncmp(op, "lt", op_len)) { - RETURN_BOOL(compare == -1); - } - if (!strncmp(op, "<=", op_len) || !strncmp(op, "le", op_len)) { - RETURN_BOOL(compare != 1); - } - if (!strncmp(op, ">", op_len) || !strncmp(op, "gt", op_len)) { - RETURN_BOOL(compare == 1); - } - if (!strncmp(op, ">=", op_len) || !strncmp(op, "ge", op_len)) { - RETURN_BOOL(compare != -1); - } - if (!strncmp(op, "==", op_len) || !strncmp(op, "=", op_len) || !strncmp(op, "eq", op_len)) { - RETURN_BOOL(compare == 0); - } - if (!strncmp(op, "!=", op_len) || !strncmp(op, "<>", op_len) || !strncmp(op, "ne", op_len)) { - RETURN_BOOL(compare != 0); - } - RETURN_NULL(); -} - -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/sybase/CREDITS b/ext/sybase/CREDITS deleted file mode 100644 index 632dcce0ca499..0000000000000 --- a/ext/sybase/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Sybase-DB -Zeev Suraski diff --git a/ext/sybase/config.m4 b/ext/sybase/config.m4 deleted file mode 100644 index 742a5e62dbd71..0000000000000 --- a/ext/sybase/config.m4 +++ /dev/null @@ -1,31 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(sybase,for Sybase support, -[ --with-sybase[=DIR] Include Sybase-DB support. DIR is the Sybase home - directory [/home/sybase]]) - -if test "$PHP_SYBASE" != "no"; then - if test "$PHP_SYBASE" = "yes"; then - SYBASE_INCDIR=/home/sybase/include - SYBASE_LIBDIR=/home/sybase/lib - else - SYBASE_INCDIR=$PHP_SYBASE/include - SYBASE_LIBDIR=$PHP_SYBASE/lib - fi - PHP_ADD_INCLUDE($SYBASE_INCDIR) - PHP_ADD_LIBRARY_WITH_PATH(sybdb, $SYBASE_LIBDIR, SYBASE_SHARED_LIBADD) - PHP_NEW_EXTENSION(sybase, php_sybase_db.c, $ext_shared) - AC_CHECK_LIB(dnet_stub, dnet_addr, - [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,SYBASE_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ]) - ]) - AC_DEFINE(HAVE_SYBASE,1,[ ]) - AC_CHECK_LIB(sybdb, tdsdbopen, - [ AC_DEFINE(PHP_SYBASE_DBOPEN,tdsdbopen,[ ]) - AC_DEFINE(DBMFIX,1,[ ]) ], - [ AC_DEFINE(PHP_SYBASE_DBOPEN,dbopen,[ ]) ]) - - PHP_SUBST(SYBASE_SHARED_LIBADD) -fi diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c deleted file mode 100644 index a1898964ceb47..0000000000000 --- a/ext/sybase/php_sybase_db.c +++ /dev/null @@ -1,1448 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Zeev Suraski | - +----------------------------------------------------------------------+ - | php_sybase_get_column_content_with_type() based on code by: | - | Muhammad A Muquit | - | Rasmus Lerdorf | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_sybase_db.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/info.h" -#include "php_globals.h" -#include "php_ini.h" - -#if HAVE_SYBASE - -#include -#include -#include - -#if BROKEN_SYBASE_PCONNECTS -#include "http_log.h" -#endif - -/* Moved these structures/defines into the .c file (or into a *private* header), - because leaving them in php_sybase_db.h caused namespace pollution in - main/internal_functions.c. */ - -#define coltype(j) dbcoltype(sybase_ptr->link,j) -#define intcol(i) ((int) *(DBINT *) dbdata(sybase_ptr->link,i)) -#define smallintcol(i) ((int) *(DBSMALLINT *) dbdata(sybase_ptr->link,i)) -#define tinyintcol(i) ((int) *(DBTINYINT *) dbdata(sybase_ptr->link,i)) -#define anyintcol(j) (coltype(j)==SYBINT4?intcol(j):(coltype(j)==SYBINT2?smallintcol(j):tinyintcol(j))) -#define charcol(i) ((DBCHAR *) dbdata(sybase_ptr->link,i)) -#define floatcol(i) ((float) *(DBFLT8 *) dbdata(sybase_ptr->link,i)) - -typedef struct sybase_link_struct sybase_link; - -struct sybase_link_struct { - LOGINREC *login; - DBPROCESS *link; - int valid; -}; - -#define SYBASE_ROWS_BLOCK 128 - -typedef struct { - char *name,*column_source; - int max_length, numeric; - int type; -} sybase_field; - -typedef struct { - zval ***data; - sybase_field *fields; - sybase_link *sybase_ptr; - int cur_row,cur_field; - int num_rows,num_fields; -} sybase_result; - - -zend_function_entry sybase_functions[] = { - PHP_FE(sybase_connect, NULL) - PHP_FE(sybase_pconnect, NULL) - PHP_FE(sybase_close, NULL) - PHP_FE(sybase_select_db, NULL) - PHP_FE(sybase_query, NULL) - PHP_FE(sybase_free_result, NULL) - PHP_FE(sybase_get_last_message, NULL) - PHP_FE(sybase_num_rows, NULL) - PHP_FE(sybase_num_fields, NULL) - PHP_FE(sybase_fetch_row, NULL) - PHP_FE(sybase_fetch_array, NULL) - PHP_FE(sybase_fetch_object, NULL) - PHP_FE(sybase_data_seek, NULL) - PHP_FE(sybase_fetch_field, NULL) - PHP_FE(sybase_field_seek, NULL) - PHP_FE(sybase_result, NULL) - PHP_FE(sybase_affected_rows, NULL) - PHP_FE(sybase_min_error_severity, NULL) - PHP_FE(sybase_min_message_severity, NULL) - -#if !defined(PHP_WIN32) && !defined(HAVE_MSSQL) - PHP_FALIAS(mssql_connect, sybase_connect, NULL) - PHP_FALIAS(mssql_pconnect, sybase_pconnect, NULL) - PHP_FALIAS(mssql_close, sybase_close, NULL) - PHP_FALIAS(mssql_select_db, sybase_select_db, NULL) - PHP_FALIAS(mssql_query, sybase_query, NULL) - PHP_FALIAS(mssql_free_result, sybase_free_result, NULL) - PHP_FALIAS(mssql_get_last_message, sybase_get_last_message, NULL) - PHP_FALIAS(mssql_num_rows, sybase_num_rows, NULL) - PHP_FALIAS(mssql_num_fields, sybase_num_fields, NULL) - PHP_FALIAS(mssql_fetch_row, sybase_fetch_row, NULL) - PHP_FALIAS(mssql_fetch_array, sybase_fetch_array, NULL) - PHP_FALIAS(mssql_fetch_object, sybase_fetch_object, NULL) - PHP_FALIAS(mssql_data_seek, sybase_data_seek, NULL) - PHP_FALIAS(mssql_fetch_field, sybase_fetch_field, NULL) - PHP_FALIAS(mssql_field_seek, sybase_field_seek, NULL) - PHP_FALIAS(mssql_result, sybase_result, NULL) - PHP_FALIAS(mssql_affected_rows, sybase_affected_rows, NULL) - PHP_FALIAS(mssql_min_error_severity, sybase_min_error_severity, NULL) - PHP_FALIAS(mssql_min_message_severity, sybase_min_message_severity, NULL) -#endif - {NULL, NULL, NULL} -}; - -zend_module_entry sybase_module_entry = { - STANDARD_MODULE_HEADER, - "sybase", sybase_functions, PHP_MINIT(sybase), PHP_MSHUTDOWN(sybase), PHP_RINIT(sybase), PHP_RSHUTDOWN(sybase), PHP_MINFO(sybase), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_SYBASE -ZEND_GET_MODULE(sybase) -#endif - -THREAD_LS sybase_module php_sybase_module; - - -#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } } - - -static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,zval **result_ptr, int column_type); - -/* error handler */ -static int php_sybase_error_handler(DBPROCESS *dbproc,int severity,int dberr, - int oserr,char *dberrstr,char *oserrstr) -{ - if (severity >= php_sybase_module.min_error_severity) { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase error: %s (severity %d)",dberrstr,severity); - } - return INT_CANCEL; -} - -/* message handler */ -static int php_sybase_message_handler(DBPROCESS *dbproc,DBINT msgno,int msgstate, - int severity,char *msgtext,char *srvname, - char *procname,DBUSMALLINT line) -{ - if (severity >= php_sybase_module.min_message_severity) { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase message: %s (severity %d)",msgtext,severity); - } - STR_FREE(php_sybase_module.server_message); - php_sybase_module.server_message = estrdup(msgtext); - return 0; -} - - -static int _clean_invalid_results(zend_rsrc_list_entry *le TSRMLS_DC) -{ - if (Z_TYPE_P(le) == php_sybase_module.le_result) { - sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr; - - if (!sybase_ptr->valid) { - return 1; - } - } - return 0; -} - - -static void _free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_result *result = (sybase_result *)rsrc->ptr; - int i,j; - - if (result->data) { - for (i=0; inum_rows; i++) { - for (j=0; jnum_fields; j++) { - zval_ptr_dtor(&result->data[i][j]); - } - efree(result->data[i]); - } - efree(result->data); - } - - if (result->fields) { - for (i=0; inum_fields; i++) { - STR_FREE(result->fields[i].name); - STR_FREE(result->fields[i].column_source); - } - efree(result->fields); - } - efree(result); -} - - -static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; - - sybase_ptr->valid = 0; - - /* - this can cause crashes in the current model. - if the resource gets destroyed via destroy_resource_list() resource_list - will *not* be in a consistent state. thies@thieso.net - */ - - zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC); - dbclose(sybase_ptr->link); - dbloginfree(sybase_ptr->login); - efree(sybase_ptr); - php_sybase_module.num_links--; -} - - -static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; - - dbclose(sybase_ptr->link); - dbloginfree(sybase_ptr->login); - free(sybase_ptr); - php_sybase_module.num_persistent--; - php_sybase_module.num_links--; -} - - -PHP_MINIT_FUNCTION(sybase) -{ - char *interface_file; - - if (dbinit()==FAIL) { - return FAILURE; - } - dberrhandle((EHANDLEFUNC) php_sybase_error_handler); - dbmsghandle((MHANDLEFUNC) php_sybase_message_handler); - - if (cfg_get_string("sybase.interface_file",&interface_file)==SUCCESS) { - dbsetifile(interface_file); - } - if (cfg_get_long("sybase.allow_persistent",&php_sybase_module.allow_persistent)==FAILURE) { - php_sybase_module.allow_persistent=1; - } - if (cfg_get_long("sybase.max_persistent",&php_sybase_module.max_persistent)==FAILURE) { - php_sybase_module.max_persistent=-1; - } - if (cfg_get_long("sybase.max_links",&php_sybase_module.max_links)==FAILURE) { - php_sybase_module.max_links=-1; - } - if (cfg_get_long("sybase.min_error_severity",&php_sybase_module.cfg_min_error_severity)==FAILURE) { - php_sybase_module.cfg_min_error_severity=10; - } - if (cfg_get_long("sybase.min_message_severity",&php_sybase_module.cfg_min_message_severity)==FAILURE) { - php_sybase_module.cfg_min_message_severity=10; - } - if (cfg_get_long("sybase.compatability_mode",&php_sybase_module.compatability_mode)==FAILURE) { - php_sybase_module.compatability_mode = 0; - } - - php_sybase_module.num_persistent=0; - php_sybase_module.le_link = zend_register_list_destructors_ex(_close_sybase_link, NULL, "sybase-db link", module_number); - php_sybase_module.le_plink = zend_register_list_destructors_ex(NULL, _close_sybase_plink, "sybase-db link persistent", module_number); - php_sybase_module.le_result = zend_register_list_destructors_ex(_free_sybase_result, NULL, "sybase-db result", module_number); - - return SUCCESS; -} - - -PHP_RINIT_FUNCTION(sybase) -{ - php_sybase_module.default_link=-1; - php_sybase_module.num_links = php_sybase_module.num_persistent; - php_sybase_module.appname = estrndup("PHP " PHP_VERSION, sizeof("PHP " PHP_VERSION)); - php_sybase_module.server_message = STR_EMPTY_ALLOC(); - php_sybase_module.min_error_severity = php_sybase_module.cfg_min_error_severity; - php_sybase_module.min_message_severity = php_sybase_module.cfg_min_message_severity; - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(sybase) -{ - dbexit(); - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(sybase) -{ - efree(php_sybase_module.appname); - php_sybase_module.appname = NULL; - STR_FREE(php_sybase_module.server_message); - php_sybase_module.server_message = NULL; - return SUCCESS; -} - -static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) -{ - char *user=NULL,*passwd=NULL,*host=NULL,*charset=NULL,*appname=NULL; - char *hashed_details; - int hashed_details_length; - sybase_link sybase,*sybase_ptr; - - switch(ZEND_NUM_ARGS()) { - case 0: /* defaults */ - hashed_details_length=6+3; - hashed_details = (char *) emalloc(hashed_details_length+1); - strcpy(hashed_details,"sybase___"); - break; - case 1: { - zval **yyhost; - - if (zend_get_parameters_ex(1, &yyhost) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - host = Z_STRVAL_PP(yyhost); - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s____", Z_STRVAL_PP(yyhost)); - } - break; - case 2: { - zval **yyhost, **yyuser; - - if (zend_get_parameters_ex(2, &yyhost, &yyuser) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s_%s___", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser)); - } - break; - case 3: { - zval **yyhost, **yyuser,**yypasswd; - - if (zend_get_parameters_ex(3, &yyhost, &yyuser, &yypasswd) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s_%s_%s__", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd)); - } - break; - case 4: { - zval **yyhost, **yyuser, **yypasswd, **yycharset; - - if (zend_get_parameters_ex(4, &yyhost, &yyuser, &yypasswd, &yycharset) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_string_ex(yycharset); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset = Z_STRVAL_PP(yycharset); - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s_%s_%s_%s_", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset)); - } - break; - case 5: { - zval **yyhost, **yyuser, **yypasswd, **yycharset, **yyappname; - - if (zend_get_parameters_ex(5, &yyhost, &yyuser, &yypasswd, &yycharset, &yyappname) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_string_ex(yycharset); - convert_to_string_ex(yyappname); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset = Z_STRVAL_PP(yycharset); - appname = Z_STRVAL_PP(yyappname); - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s_%s_%s_%s_%s", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset), Z_STRVAL_PP(yyappname)); - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - - /* set a DBLOGIN record */ - if ((sybase.login=dblogin())==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to allocate login record"); - goto err; - } - - if (user) { - DBSETLUSER(sybase.login,user); - } - if (passwd) { - DBSETLPWD(sybase.login,passwd); - } - if (charset) { - DBSETLCHARSET(sybase.login,charset); - } - if (appname) { - DBSETLAPP(sybase.login,appname); - } else { - DBSETLAPP(sybase.login,php_sybase_module.appname); - } - - sybase.valid = 1; - - if (!php_sybase_module.allow_persistent) { - persistent=0; - } - if (persistent) { - zend_rsrc_list_entry *le; - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */ - zend_rsrc_list_entry new_le; - - if (php_sybase_module.max_links!=-1 && php_sybase_module.num_links>=php_sybase_module.max_links) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open links (%d)",php_sybase_module.num_links); - goto err_login; - } - if (php_sybase_module.max_persistent!=-1 && php_sybase_module.num_persistent>=php_sybase_module.max_persistent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open persistent links (%d)",php_sybase_module.num_persistent); - goto err_login; - } - /* create the link */ - if ((sybase.link=PHP_SYBASE_DBOPEN(sybase.login,host))==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ - goto err_login; - } - - if (dbsetopt(sybase.link,DBBUFFER,"2",-1)==FAIL) { - goto err_link; - } - - /* hash it up */ - sybase_ptr = (sybase_link *) malloc(sizeof(sybase_link)); - memcpy(sybase_ptr,&sybase,sizeof(sybase_link)); - Z_TYPE(new_le) = php_sybase_module.le_plink; - new_le.ptr = sybase_ptr; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(zend_rsrc_list_entry),NULL)==FAILURE) { - free(sybase_ptr); - goto err_link; - } - php_sybase_module.num_persistent++; - php_sybase_module.num_links++; - } else { /* we do */ - if (Z_TYPE_P(le) != php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Hashed persistent link is not a Sybase link!"); - goto err_login; - } - - sybase_ptr = (sybase_link *) le->ptr; - /* test that the link hasn't died */ - if (DBDEAD(sybase_ptr->link)==TRUE) { - if ((sybase_ptr->link=PHP_SYBASE_DBOPEN(sybase_ptr->login,host))==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Link to server lost, unable to reconnect");*/ - zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); - goto err_login; - } - if (dbsetopt(sybase_ptr->link,DBBUFFER,"2",-1)==FAIL) { - zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); - goto err_login; - } - } - } - Z_LVAL_P(return_value) = zend_list_insert(sybase_ptr,php_sybase_module.le_plink); - Z_TYPE_P(return_value) = IS_LONG; - } else { /* non persistent */ - zend_rsrc_list_entry *index_ptr,new_index_ptr; - - /* first we check the hash for the hashed_details key. if it exists, - * it should point us to the right offset where the actual sybase link sits. - * if it doesn't, open a new sybase link, add it to the resource list, - * and add a pointer to it with hashed_details as the key. - */ - if (zend_hash_find(&EG(regular_list),hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { - int type,link; - void *ptr; - - if (Z_TYPE_P(index_ptr) != le_index_ptr) { - goto err_login; - } - link = (int) index_ptr->ptr; - ptr = zend_list_find(link,&type); /* check if the link is still there */ - if (ptr && (type==php_sybase_module.le_link || type==php_sybase_module.le_plink)) { - Z_LVAL_P(return_value) = php_sybase_module.default_link = link; - Z_TYPE_P(return_value) = IS_LONG; - efree(hashed_details); - dbloginfree(sybase.login); - return; - } else { - zend_hash_del(&EG(regular_list),hashed_details,hashed_details_length+1); - } - } - if (php_sybase_module.max_links!=-1 && php_sybase_module.num_links>=php_sybase_module.max_links) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open links (%d)",php_sybase_module.num_links); - goto err_login; - } - - if ((sybase.link=PHP_SYBASE_DBOPEN(sybase.login,host))==NULL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ - goto err_login; - } - - if (dbsetopt(sybase.link,DBBUFFER,"2",-1)==FAIL) { - goto err_link; - } - - /* add it to the list */ - sybase_ptr = (sybase_link *) emalloc(sizeof(sybase_link)); - memcpy(sybase_ptr,&sybase,sizeof(sybase_link)); - Z_LVAL_P(return_value) = zend_list_insert(sybase_ptr,php_sybase_module.le_link); - Z_TYPE_P(return_value) = IS_LONG; - - /* add it to the hash */ - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(zend_rsrc_list_entry),NULL)==FAILURE) { - goto err_link; - } - php_sybase_module.num_links++; - } - efree(hashed_details); - php_sybase_module.default_link=Z_LVAL_P(return_value); - return; - -err_link: - dbclose(sybase.link); -err_login: - dbloginfree(sybase.login); -err: - efree(hashed_details); - RETURN_FALSE; -} - - -static int php_sybase_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (php_sybase_module.default_link==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); - } - return php_sybase_module.default_link; -} - - -/* {{{ proto int sybase_connect([string host [, string user [, string password [, string charset [, string appname]]]]]) - Open Sybase server connection */ -PHP_FUNCTION(sybase_connect) -{ - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); -} -/* }}} */ - -/* {{{ proto int sybase_pconnect([string host [, string user [, string password [, string charset [, string appname]]]]]) - Open persistent Sybase connection */ -PHP_FUNCTION(sybase_pconnect) -{ - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); -} -/* }}} */ - -/* {{{ proto bool sybase_close([int link_id]) - Close Sybase connection */ -PHP_FUNCTION(sybase_close) -{ - zval **sybase_link_index; - int id,type; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_sybase_module.default_link; - break; - case 1: - if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sybase_link_index); - id = Z_LVAL_PP(sybase_link_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - zend_list_find(id,&type); - if (type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); - RETURN_FALSE; - } - - zend_list_delete(id); - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool sybase_select_db(string database [, int link_id]) - Select Sybase database */ -PHP_FUNCTION(sybase_select_db) -{ - zval **db, **sybase_link_index; - int id,type; - sybase_link *sybase_ptr; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &db) == FAILURE) { - RETURN_FALSE; - } - id = php_sybase_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 2: - if (zend_get_parameters_ex(2, &db, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sybase_link_index); - id = Z_LVAL_PP(sybase_link_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - CHECK_LINK(id); - - sybase_ptr = (sybase_link *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); - RETURN_FALSE; - } - - convert_to_string_ex(db); - - if (dbuse(sybase_ptr->link,Z_STRVAL_PP(db))==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to select database: %s",sybase_error(sybase));*/ - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - - -static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,zval **result_ptr, int column_type) -{ - zval *result; - - ALLOC_INIT_ZVAL(result); - *result_ptr = result; - - if (dbdatlen(sybase_ptr->link,offset) == 0) { - ZVAL_FALSE(result); - return; - } - - switch (column_type) - { - case SYBINT2: - case SYBINT4: { - Z_LVAL_P(result) = (long) anyintcol(offset); - Z_TYPE_P(result) = IS_LONG; - break; - } - case SYBCHAR: - case SYBTEXT: { - int length; - char *data = charcol(offset); - - length=dbdatlen(sybase_ptr->link,offset); - while (length>0 && charcol(offset)[length-1] == ' ') { /* nuke trailing whitespace */ - length--; - } - Z_STRVAL_P(result) = estrndup(data,length); - Z_STRLEN_P(result) = length; - Z_TYPE_P(result) = IS_STRING; - break; - } - /*case SYBFLT8:*/ - case SYBREAL: { - Z_DVAL_P(result) = (double) floatcol(offset); - Z_TYPE_P(result) = IS_DOUBLE; - break; - } - default: { - if (dbwillconvert(coltype(offset),SYBCHAR)) { - char *res_buf; - int res_length = dbdatlen(sybase_ptr->link,offset); - int src_length = res_length; - register char *p; - - switch (coltype(offset)) { - case SYBBINARY: - case SYBVARBINARY: - case SYBIMAGE: - res_length *= 2; - break; - case SYBCHAR: - case SYBVARCHAR: - case SYBTEXT: - break; - default: - /* take no chances, no telling how big the result would really be */ - res_length += 20; - break; - } - - res_buf = (char *) emalloc(res_length+1); - memset(res_buf,' ',res_length+1); /* XXX i'm sure there's a better way - but i don't have sybase here to test - 991105 thies@thieso.net */ - dbconvert(NULL,coltype(offset),dbdata(sybase_ptr->link,offset), src_length,SYBCHAR,res_buf,res_length); -#if ilia_0 - /* get rid of trailing spaces */ - p = res_buf + res_length; - while (p >= res_buf && (*p == ' ' || *p == '\0')) { - p--; - } - *(++p) = 0; /* put a trailing NULL */ - res_length = p - res_buf; -#endif - Z_STRLEN_P(result) = res_length; - Z_STRVAL_P(result) = res_buf; - Z_TYPE_P(result) = IS_STRING; - } else { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: column %d has unknown data type (%d)", offset, coltype(offset)); - ZVAL_FALSE(result); - } - } - } -} - - -/* {{{ proto int sybase_query(string query [, int link_id]) - Send Sybase query */ -PHP_FUNCTION(sybase_query) -{ - zval **query, **sybase_link_index; - int id,type,retvalue; - sybase_link *sybase_ptr; - sybase_result *result; - int num_fields; - int blocks_initialized=1; - int i,j; - int *column_types; - RETCODE dbresults_retval; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &query) == FAILURE) { - RETURN_FALSE; - } - id = php_sybase_module.default_link; - break; - case 2: - if (zend_get_parameters_ex(2, &query, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sybase_link_index); - id = Z_LVAL_PP(sybase_link_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - sybase_ptr = (sybase_link *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); - RETURN_FALSE; - } - - convert_to_string_ex(query); - if (dbcmd(sybase_ptr->link,Z_STRVAL_PP(query))==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to set query");*/ - RETURN_FALSE; - } - - if (dbsqlexec(sybase_ptr->link)==FAIL) { - /*php_error(E_WARNING,"Sybase: Query failed");*/ - RETURN_FALSE; - } - - dbresults_retval = dbresults(sybase_ptr->link); - if (dbresults_retval==FAIL) { - /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Query failed");*/ - RETURN_FALSE; - } - - /* The following is more or less the equivalent of mysql_store_result(). - * fetch all rows from the server into the row buffer, thus: - * 1) Being able to fire up another query without explicitly reading all rows - * 2) Having numrows accessible - */ - - retvalue=dbnextrow(sybase_ptr->link); - - if (retvalue==FAIL) { - RETURN_FALSE; - } - - num_fields = dbnumcols(sybase_ptr->link); - if (num_fields<=0) { - RETURN_TRUE; - } - - column_types = (int *) safe_emalloc(sizeof(int), num_fields, 0); - for (i=0; idata = (zval ***) safe_emalloc(sizeof(zval **), SYBASE_ROWS_BLOCK, 0); - result->sybase_ptr = sybase_ptr; - result->cur_field=result->cur_row=result->num_rows=0; - result->num_fields = num_fields; - - i=0; - while (retvalue!=FAIL && retvalue!=NO_MORE_ROWS) { - result->num_rows++; - if (result->num_rows > blocks_initialized*SYBASE_ROWS_BLOCK) { - result->data = (zval ***) safe_erealloc(result->data, SYBASE_ROWS_BLOCK*(++blocks_initialized), sizeof(zval **), 0); - } - result->data[i] = (zval **) safe_emalloc(sizeof(zval *), num_fields, 0); - for (j=1; j<=num_fields; j++) { - php_sybase_get_column_content(sybase_ptr, j, &result->data[i][j-1], column_types[j-1]); - if (!php_sybase_module.compatability_mode) { - zval *cur_value = result->data[i][j-1]; - - convert_to_string(cur_value); - if (PG(magic_quotes_runtime)) { - Z_STRVAL_P(cur_value) = php_addslashes(Z_STRVAL_P(cur_value), Z_STRLEN_P(cur_value), &Z_STRLEN_P(cur_value),0 TSRMLS_CC); - } - } - } - retvalue=dbnextrow(sybase_ptr->link); - dbclrbuf(sybase_ptr->link,DBLASTROW(sybase_ptr->link)-1); - i++; - } - result->num_rows = DBCOUNT(sybase_ptr->link); - - result->fields = (sybase_field *) safe_emalloc(sizeof(sybase_field), num_fields, 0); - j=0; - for (i=0; ilink,i+1); - char computed_buf[16]; - - if (*fname) { - result->fields[i].name = estrdup(fname); - } else { - if (j>0) { - snprintf(computed_buf,16,"computed%d",j); - } else { - strcpy(computed_buf,"computed"); - } - result->fields[i].name = estrdup(computed_buf); - j++; - } - result->fields[i].max_length = dbcollen(sybase_ptr->link,i+1); - result->fields[i].column_source = estrdup(dbcolsource(sybase_ptr->link,i+1)); - if (!result->fields[i].column_source) { - result->fields[i].column_source = STR_EMPTY_ALLOC(); - } - Z_TYPE(result->fields[i]) = column_types[i]; - /* set numeric flag */ - switch (column_types[i]) { - case SYBINT2: - case SYBINT4: - case SYBFLT8: - case SYBREAL: - result->fields[i].numeric = 1; - break; - case SYBCHAR: - case SYBTEXT: - default: - result->fields[i].numeric = 0; - break; - } - } - efree(column_types); - Z_LVAL_P(return_value) = zend_list_insert(result,php_sybase_module.le_result); - Z_TYPE_P(return_value) = IS_LONG; - - /** - * mgruetzner@rw3.com -- 3-6/2003 - * - * If you do a query that calls a stored procedure which returns - * data AND calls raiserror to generated a user-defined error message, - * then after retrieving the first set of results above, the call - * to dbresults will have returned SUCCESS, instead of NO_MORE_RESULTS - * which indicates that the message generated by raiserror is still - * waiting to be read. If this is the case, then call dbresults - * again to force the reading of the message. This will ensure the - * get_last_message call will return the message properly if called - * after mssql_query, like it should. - * - * One thing to note, we are assuming that no more data should follow - * in this case--only the message will be read. To make sure, I have - * added a call to dbnextrow. The assumption is that it will return - * NO_MORE_ROWS in this case. If the assumption is false, generate - * a PHP error so we can debug this case. - * - */ - if (dbresults_retval != NO_MORE_RESULTS) { - /* Call dbresults again to read message */ - dbresults_retval = dbresults(sybase_ptr->link); - - /* Check assumption that dbnextrow returns NO_MORE_ROWS */ - retvalue = dbnextrow(sybase_ptr->link); - if (retvalue != NO_MORE_ROWS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Expected dbnextrow() to return NO_MORE_ROWS"); - } - } -} -/* }}} */ - - -/* {{{ proto bool sybase_free_result(int result) - Free result memory */ -PHP_FUNCTION(sybase_free_result) -{ - zval **sybase_result_index; - sybase_result *result; - int type; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - if (Z_LVAL_PP(sybase_result_index)==0) { - RETURN_FALSE; - } - result = (sybase_result *) zend_list_find(Z_LVAL_PP(sybase_result_index),&type); - - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Sybase result index", Z_LVAL_PP(sybase_result_index)); - RETURN_FALSE; - } - zend_list_delete(Z_LVAL_PP(sybase_result_index)); - RETURN_TRUE; -} -/* }}} */ - - - -/* {{{ proto string sybase_get_last_message(void) - Returns the last message from server (over min_message_severity) */ -PHP_FUNCTION(sybase_get_last_message) -{ - RETURN_STRING(php_sybase_module.server_message,1); -} -/* }}} */ - -/* {{{ proto int sybase_num_rows(int result) - Get number of rows in result */ -PHP_FUNCTION(sybase_num_rows) -{ - zval **result_index; - int type,id; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(result_index); - id = Z_LVAL_PP(result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - Z_LVAL_P(return_value) = result->num_rows; - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - -/* {{{ proto int sybase_num_fields(int result) - Get number of fields in result */ -PHP_FUNCTION(sybase_num_fields) -{ - zval **result_index; - int type,id; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(result_index); - id = Z_LVAL_PP(result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - Z_LVAL_P(return_value) = result->num_fields; - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - -/* {{{ proto array sybase_fetch_row(int result) - Get row as enumerated array */ -PHP_FUNCTION(sybase_fetch_row) -{ - zval **sybase_result_index; - int type,i,id; - sybase_result *result; - zval *field_content; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index)==FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - if (result->cur_row >= result->num_rows) { - RETURN_FALSE; - } - - array_init(return_value); - for (i=0; inum_fields; i++) { - ZVAL_ADDREF(result->data[result->cur_row][i]); - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &result->data[result->cur_row][i], sizeof(zval *), NULL); - } - result->cur_row++; -} -/* }}} */ - - -static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS) -{ - zval **sybase_result_index; - sybase_result *result; - int type; - int i; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - result = (sybase_result *) zend_list_find(Z_LVAL_PP(sybase_result_index),&type); - - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Sybase result index", Z_LVAL_PP(sybase_result_index)); - RETURN_FALSE; - } - - if (result->cur_row >= result->num_rows) { - RETURN_FALSE; - } - - array_init(return_value); - - for (i=0; inum_fields; i++) { - ZVAL_ADDREF(result->data[result->cur_row][i]); - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &result->data[result->cur_row][i], sizeof(zval *), NULL); - ZVAL_ADDREF(result->data[result->cur_row][i]); - zend_hash_update(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &result->data[result->cur_row][i], sizeof(zval *), NULL); - } - result->cur_row++; -} - - -/* {{{ proto object sybase_fetch_object(int result) - Fetch row as object */ -PHP_FUNCTION(sybase_fetch_object) -{ - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (Z_TYPE_P(return_value)==IS_ARRAY) { - object_and_properties_init( - return_value, - ZEND_STANDARD_CLASS_DEF_PTR, - Z_ARRVAL_P(return_value) - ); - } -} -/* }}} */ - -/* {{{ proto array sybase_fetch_array(int result) - Fetch row as array */ -PHP_FUNCTION(sybase_fetch_array) -{ - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto bool sybase_data_seek(int result, int offset) - Move internal row pointer */ -PHP_FUNCTION(sybase_data_seek) -{ - zval **sybase_result_index, **offset; - int type,id; - sybase_result *result; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - convert_to_long_ex(offset); - if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad row offset"); - RETURN_FALSE; - } - - result->cur_row = Z_LVAL_PP(offset); - RETURN_TRUE; -} -/* }}} */ - -static char *php_sybase_get_field_name(int type) -{ - switch (type) { - case SYBBINARY: - case SYBVARBINARY: - return "blob"; - break; - case SYBCHAR: - case SYBVARCHAR: - case SYBTEXT: - return "string"; - case SYBDATETIME: - case SYBDATETIME4: - case SYBDATETIMN: - return "datetime"; - break; - case SYBDECIMAL: - case SYBFLT8: - case SYBFLTN: - case SYBREAL: - case SYBNUMERIC: - return "real"; - break; - case SYBINT1: - case SYBINT2: - case SYBINT4: - case SYBINTN: - return "int"; - break; - case SYBMONEY: - case SYBMONEY4: - case SYBMONEYN: - return "money"; - break; - case SYBBIT: - return "bit"; - break; - case SYBIMAGE: - return "image"; - break; - default: - return "unknown"; - break; - } -} - - -/* {{{ proto object sybase_fetch_field(int result [, int offset]) - Get field information */ -PHP_FUNCTION(sybase_fetch_field) -{ - zval **sybase_result_index, **offset; - int type,id,field_offset; - sybase_result *result; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - RETURN_FALSE; - } - field_offset=-1; - break; - case 2: - if (zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - if (field_offset==-1) { - field_offset = result->cur_field; - result->cur_field++; - } - - if (field_offset<0 || field_offset >= result->num_fields) { - if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad column offset"); - } - RETURN_FALSE; - } - - object_init(return_value); - - add_property_string(return_value, "name",result->fields[field_offset].name, 1); - add_property_long(return_value, "max_length",result->fields[field_offset].max_length); - add_property_string(return_value, "column_source",result->fields[field_offset].column_source, 1); - add_property_long(return_value, "numeric", result->fields[field_offset].numeric); - add_property_string(return_value, "type", php_sybase_get_field_name(Z_TYPE(result->fields[field_offset])), 1); -} -/* }}} */ - -/* {{{ proto bool sybase_field_seek(int result, int offset) - Set field offset */ -PHP_FUNCTION(sybase_field_seek) -{ - zval **sybase_result_index, **offset; - int type,id,field_offset; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - - if (field_offset<0 || field_offset >= result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad column offset"); - RETURN_FALSE; - } - - result->cur_field = field_offset; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string sybase_result(int result, int row, mixed field) - Get result data */ -PHP_FUNCTION(sybase_result) -{ - zval **row, **field, **sybase_result_index; - int id,type,field_offset=0; - sybase_result *result; - - - if (ZEND_NUM_ARGS() !=3 || zend_get_parameters_ex(3, &sybase_result_index, &row, &field) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sybase_result_index); - id = Z_LVAL_PP(sybase_result_index); - - result = (sybase_result *) zend_list_find(id,&type); - if (type!=php_sybase_module.le_result) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); - RETURN_FALSE; - } - - convert_to_long_ex(row); - if (Z_LVAL_PP(row)<0 || Z_LVAL_PP(row)>=result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad row offset (%ld)", Z_LVAL_PP(row)); - RETURN_FALSE; - } - - switch(Z_TYPE_PP(field)) { - case IS_STRING: { - int i; - - for (i=0; inum_fields; i++) { - if (!strcasecmp(result->fields[i].name,Z_STRVAL_PP(field))) { - field_offset = i; - break; - } - } - if (i>=result->num_fields) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: %s field not found in result",Z_STRVAL_PP(field)); - RETURN_FALSE; - } - break; - } - default: - convert_to_long_ex(field); - field_offset = Z_LVAL_PP(field); - if (field_offset<0 || field_offset>=result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad column offset specified"); - RETURN_FALSE; - } - break; - } - - *return_value = *result->data[Z_LVAL_PP(row)][field_offset]; - zval_copy_ctor(return_value); -} -/* }}} */ - - -/* {{{ proto int sybase_affected_rows([int link_id]) - Get number of affected rows in last query */ -PHP_FUNCTION(sybase_affected_rows) -{ - zval **sybase_link_index = NULL; - sybase_link *sybase_ptr = NULL; - int id = 0; - int type = 0; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = php_sybase_module.default_link; - break; - case 1: - if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sybase_link_index); - id = Z_LVAL_PP(sybase_link_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - sybase_ptr = (sybase_link *)zend_list_find(id, &type); - - if(type != php_sybase_module.le_link && type != php_sybase_module.le_plink) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); - RETURN_FALSE; - } - - Z_LVAL_P(return_value) = DBCOUNT(sybase_ptr->link); - Z_TYPE_P(return_value) = IS_LONG; -} - - -PHP_MINFO_FUNCTION(sybase) -{ - char maxp[32], maxl[32]; - - if (php_sybase_module.max_persistent==-1) { - snprintf(maxp, 31, "%ld/unlimited", php_sybase_module.num_persistent ); - } else { - snprintf(maxp, 31, "%ld/%ld", php_sybase_module.num_persistent, php_sybase_module.max_persistent); - } - maxp[31]=0; - - if (php_sybase_module.max_links==-1) { - snprintf(maxl, 31, "%ld/unlimited", php_sybase_module.num_links ); - } else { - snprintf(maxl, 31, "%ld/%ld", php_sybase_module.num_links, php_sybase_module.max_links); - } - maxl[31]=0; - - php_info_print_table_start(); - php_info_print_table_row(2, "Sybase Support", "enabled"); - php_info_print_table_row(2, "Allow Persistent Links", (php_sybase_module.allow_persistent?"Yes":"No") ); - php_info_print_table_row(2, "Persistent Links", maxp); - php_info_print_table_row(2, "Total Links", maxl); - php_info_print_table_row(2, "Application Name", php_sybase_module.appname ); - php_info_print_table_row(2, "Client API Version", dbversion() ); - php_info_print_table_end(); - -} - - -/* {{{ proto void sybase_min_error_severity(int severity) - Sets the minimum error severity */ -PHP_FUNCTION(sybase_min_error_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - php_sybase_module.min_error_severity = Z_LVAL_PP(severity); -} -/* }}} */ - -/* {{{ proto void sybase_min_message_severity(int severity) - Sets the minimum message severity */ -PHP_FUNCTION(sybase_min_message_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - php_sybase_module.min_message_severity = Z_LVAL_PP(severity); -} -/* }}} */ - -#endif diff --git a/ext/sybase/php_sybase_db.h b/ext/sybase/php_sybase_db.h deleted file mode 100644 index eca30588b11d2..0000000000000 --- a/ext/sybase/php_sybase_db.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYBASE_DB_H -#define PHP_SYBASE_DB_H - -#if HAVE_SYBASE - -extern zend_module_entry sybase_module_entry; -#define sybase_module_ptr &sybase_module_entry - -PHP_MINIT_FUNCTION(sybase); -PHP_RINIT_FUNCTION(sybase); -PHP_MSHUTDOWN_FUNCTION(sybase); -PHP_RSHUTDOWN_FUNCTION(sybase); -PHP_MINFO_FUNCTION(sybase); -PHP_FUNCTION(sybase_connect); -PHP_FUNCTION(sybase_pconnect); -PHP_FUNCTION(sybase_close); -PHP_FUNCTION(sybase_select_db); -PHP_FUNCTION(sybase_query); -PHP_FUNCTION(sybase_free_result); -PHP_FUNCTION(sybase_get_last_message); -PHP_FUNCTION(sybase_num_rows); -PHP_FUNCTION(sybase_num_fields); -PHP_FUNCTION(sybase_fetch_row); -PHP_FUNCTION(sybase_fetch_array); -PHP_FUNCTION(sybase_fetch_object); -PHP_FUNCTION(sybase_data_seek); -PHP_FUNCTION(sybase_affected_rows); -PHP_FUNCTION(sybase_result); -PHP_FUNCTION(sybase_field_seek); -PHP_FUNCTION(sybase_min_error_severity); -PHP_FUNCTION(sybase_min_message_severity); - -PHP_FUNCTION(sybase_db_query); -PHP_FUNCTION(sybase_list_fields); -PHP_FUNCTION(sybase_fetch_lengths); -PHP_FUNCTION(sybase_fetch_field); -PHP_FUNCTION(sybase_field_seek); -PHP_FUNCTION(sybase_free_result); -PHP_FUNCTION(sybase_field_name); -PHP_FUNCTION(sybase_field_table); -PHP_FUNCTION(sybase_field_len); -PHP_FUNCTION(sybase_field_type); -PHP_FUNCTION(sybase_field_flags); - - -typedef struct { - long default_link; - long num_links,num_persistent; - long max_links,max_persistent; - long allow_persistent; - char *appname; - char *server_message; - int le_link,le_plink,le_result; - long min_error_severity,min_message_severity; - long cfg_min_error_severity,cfg_min_message_severity; - long compatability_mode; -} sybase_module; - -extern sybase_module php_sybase_module; - -#else - -#define sybase_module_ptr NULL - -#endif - -#define phpext_sybase_ptr sybase_module_ptr - -#endif /* PHP_SYBASE_DB_H */ diff --git a/ext/sybase_ct/CREDITS b/ext/sybase_ct/CREDITS deleted file mode 100644 index f739a533c41f0..0000000000000 --- a/ext/sybase_ct/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Sybase-CT -Zeev Suraski, Tom May, Timm Friebe diff --git a/ext/sybase_ct/config.m4 b/ext/sybase_ct/config.m4 deleted file mode 100644 index 00d5b9cc199e9..0000000000000 --- a/ext/sybase_ct/config.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(sybase-ct, for Sybase-CT support, -[ --with-sybase-ct[=DIR] Include Sybase-CT support. DIR is the Sybase home - directory [/home/sybase]]) - -if test "$PHP_SYBASE_CT" != "no"; then - - if test "$PHP_SYBASE" != "no" && test "$ext_shared" = "no"; then - AC_MSG_ERROR([You can not use both --with-sybase and --with-sybase-ct in same build!]) - fi - - AC_DEFINE(HAVE_SYBASE_CT,1,[ ]) - PHP_NEW_EXTENSION(sybase_ct, php_sybase_ct.c, $ext_shared) - PHP_SUBST(SYBASE_CT_SHARED_LIBADD) - - if test "$PHP_SYBASE_CT" = "yes"; then - SYBASE_CT_INCDIR=/home/sybase/include - SYBASE_CT_LIBDIR=/home/sybase/lib - else - SYBASE_CT_INCDIR=$PHP_SYBASE_CT/include - SYBASE_CT_LIBDIR=$PHP_SYBASE_CT/lib - fi - - if test -f $SYBASE_CT_INCDIR/ctpublic.h; then - PHP_ADD_INCLUDE($SYBASE_CT_INCDIR) - else - AC_MSG_ERROR([ctpublic.h missing!]) - fi - - PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD) - if test -f $SYBASE_CT_INCDIR/tds.h; then - PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) - SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lct" - else - PHP_ADD_LIBRARY(cs,, SYBASE_CT_SHARED_LIBADD) - PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) - PHP_ADD_LIBRARY(comn,, SYBASE_CT_SHARED_LIBADD) - PHP_ADD_LIBRARY(intl,, SYBASE_CT_SHARED_LIBADD) - - SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lcs -lct -lcomn -lintl" - - PHP_CHECK_LIBRARY(tcl, netg_errstr, [ - PHP_ADD_LIBRARY(tcl,,SYBASE_CT_SHARED_LIBADD) - ],[ - PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) - ],[ - $SYBASE_CT_LIBS - ]) - - PHP_CHECK_LIBRARY(insck, insck__getVdate, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) - PHP_CHECK_LIBRARY(insck, bsd_tcp, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) - fi -fi diff --git a/ext/sybase_ct/config.w32 b/ext/sybase_ct/config.w32 deleted file mode 100644 index bf56bd1402989..0000000000000 --- a/ext/sybase_ct/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ - -// $Id$ -// vim:ft=javascript - -ARG_WITH("sybase-ct", "SYBASE_CT support", "no"); - -if (PHP_SYBASE_CT != "no") { - - if (CHECK_HEADER_ADD_INCLUDE("ctpublic.h", "CFLAGS_SYBASE_CT", PHP_PHP_BUILD + "\\sybase\\include;" + PHP_SYBASE_CT) && - CHECK_LIB("libcs.lib", "sybase_ct", PHP_PHP_BUILD + "\\sybase\\lib;" + PHP_SYBASE_CT) && - CHECK_LIB("libct.lib", "sybase_ct", PHP_PHP_BUILD + "\\sybase\\lib;" + PHP_SYBASE_CT)) { - EXTENSION('sybase_ct', 'php_sybase_ct.c'); - AC_DEFINE('HAVE_SYBASE_CT', 1); - } else { - WARNING("sybase_ct not enabled; libraries and headers not found"); - } -} - diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c deleted file mode 100644 index 942936c34944b..0000000000000 --- a/ext/sybase_ct/php_sybase_ct.c +++ /dev/null @@ -1,2263 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Zeev Suraski | - | Tom May | - | Timm Friebe | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_sybase_ct.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/info.h" -#include "php_globals.h" -#include "php_ini.h" - -/* True globals, no need for thread safety */ -static int le_link, le_plink, le_result; - -#if HAVE_SYBASE_CT - -ZEND_DECLARE_MODULE_GLOBALS(sybase) -static PHP_GINIT_FUNCTION(sybase); -static PHP_GSHUTDOWN_FUNCTION(sybase); - -zend_function_entry sybase_functions[] = { - PHP_FE(sybase_connect, NULL) - PHP_FE(sybase_pconnect, NULL) - PHP_FE(sybase_close, NULL) - PHP_FE(sybase_select_db, NULL) - PHP_FE(sybase_query, NULL) - PHP_FE(sybase_unbuffered_query, NULL) - PHP_FE(sybase_free_result, NULL) - PHP_FE(sybase_get_last_message, NULL) - PHP_FE(sybase_num_rows, NULL) - PHP_FE(sybase_num_fields, NULL) - PHP_FE(sybase_fetch_row, NULL) - PHP_FE(sybase_fetch_array, NULL) - PHP_FE(sybase_fetch_assoc, NULL) - PHP_FE(sybase_fetch_object, NULL) - PHP_FE(sybase_data_seek, NULL) - PHP_FE(sybase_fetch_field, NULL) - PHP_FE(sybase_field_seek, NULL) - PHP_FE(sybase_result, NULL) - PHP_FE(sybase_affected_rows, NULL) - PHP_FE(sybase_min_client_severity, NULL) - PHP_FE(sybase_min_server_severity, NULL) - PHP_FE(sybase_set_message_handler, NULL) - PHP_FE(sybase_deadlock_retry_count, NULL) - -#if !defined(PHP_WIN32) && !defined(HAVE_MSSQL) - PHP_FALIAS(mssql_connect, sybase_connect, NULL) - PHP_FALIAS(mssql_pconnect, sybase_pconnect, NULL) - PHP_FALIAS(mssql_close, sybase_close, NULL) - PHP_FALIAS(mssql_select_db, sybase_select_db, NULL) - PHP_FALIAS(mssql_query, sybase_query, NULL) - PHP_FALIAS(mssql_unbuffered_query, sybase_unbuffered_query, NULL) - PHP_FALIAS(mssql_free_result, sybase_free_result, NULL) - PHP_FALIAS(mssql_get_last_message, sybase_get_last_message, NULL) - PHP_FALIAS(mssql_num_rows, sybase_num_rows, NULL) - PHP_FALIAS(mssql_num_fields, sybase_num_fields, NULL) - PHP_FALIAS(mssql_fetch_row, sybase_fetch_row, NULL) - PHP_FALIAS(mssql_fetch_array, sybase_fetch_array, NULL) - PHP_FALIAS(mssql_fetch_assoc, sybase_fetch_assoc, NULL) - PHP_FALIAS(mssql_fetch_object, sybase_fetch_object, NULL) - PHP_FALIAS(mssql_data_seek, sybase_data_seek, NULL) - PHP_FALIAS(mssql_fetch_field, sybase_fetch_field, NULL) - PHP_FALIAS(mssql_field_seek, sybase_field_seek, NULL) - PHP_FALIAS(mssql_result, sybase_result, NULL) - PHP_FALIAS(mssql_affected_rows, sybase_affected_rows, NULL) - PHP_FALIAS(mssql_min_client_severity, sybase_min_client_severity, NULL) - PHP_FALIAS(mssql_min_server_severity, sybase_min_server_severity, NULL) - PHP_FALIAS(mssql_set_message_handler, sybase_set_message_handler, NULL) - PHP_FALIAS(mssql_deadlock_retry_count, sybase_deadlock_retry_count, NULL) -#endif - - {NULL, NULL, NULL} -}; - -zend_module_entry sybase_module_entry = { - STANDARD_MODULE_HEADER, - "sybase_ct", - sybase_functions, - PHP_MINIT(sybase), - PHP_MSHUTDOWN(sybase), - PHP_RINIT(sybase), - PHP_RSHUTDOWN(sybase), - PHP_MINFO(sybase), - NO_VERSION_YET, - PHP_MODULE_GLOBALS(sybase), - PHP_GINIT(sybase), - PHP_GSHUTDOWN(sybase), - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; - -/* static CS_CONTEXT *context; */ - -#ifdef COMPILE_DL_SYBASE_CT -ZEND_GET_MODULE(sybase) -#endif - -ZEND_DECLARE_MODULE_GLOBALS(sybase) - -#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } } - - -static int _clean_invalid_results(zend_rsrc_list_entry *le TSRMLS_DC) -{ - if (Z_TYPE_P(le) == le_result) { - sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr; - - if (!sybase_ptr->valid) { - return 1; - } - } - return 0; -} - -#define efree_n(x) { efree(x); x = NULL; } -#define efree_if(x) if (x) efree_n(x) - -#ifdef PHP_SYBASE_DEBUG -#define FREE_SYBASE_RESULT(result) \ - if (result) { \ - fprintf(stderr, "_free_sybase_result(%p) called from line #%d\n", result, __LINE__); \ - fflush(stderr); \ - _free_sybase_result(result); \ - result = NULL; \ - } -#else -#define FREE_SYBASE_RESULT(result) \ - if (result) { \ - _free_sybase_result(result); \ - result = NULL; \ - } -#endif -static void _free_sybase_result(sybase_result *result) -{ - int i, j; - - if (result->data) { - for (i = 0; i < (result->store ? result->num_rows : MIN(1, result->num_rows)); i++) { - for (j=0; jnum_fields; j++) { - zval_dtor(&result->data[i][j]); - } - efree(result->data[i]); - } - efree(result->data); - } - - if (result->fields) { - for (i=0; inum_fields; i++) { - STR_FREE(result->fields[i].name); - STR_FREE(result->fields[i].column_source); - } - efree(result->fields); - } - - if (result->tmp_buffer) { - for (i=0; inum_fields; i++) { - efree(result->tmp_buffer[i]); - } - efree(result->tmp_buffer); - } - - efree_if(result->lengths); - efree_if(result->indicators); - efree_if(result->datafmt); - efree_if(result->numerics); - efree_if(result->types); - - efree(result); -} - -/* Forward declaration */ -static int php_sybase_finish_results (sybase_result *result TSRMLS_DC); - -static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_result *result = (sybase_result *)rsrc->ptr; - - /* Check to see if we've read all rows */ - if (result->sybase_ptr && result->sybase_ptr->active_result_index) { - if (result->sybase_ptr->cmd) { - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - } - php_sybase_finish_results(result TSRMLS_CC); - } - - FREE_SYBASE_RESULT(result); -} - -static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; - CS_INT con_status; - - sybase_ptr->valid = 0; - if (sybase_ptr->callback_name != NULL) { - zval_ptr_dtor(&sybase_ptr->callback_name); - sybase_ptr->callback_name= NULL; - } - - zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC); - - /* Non-persistent connections will always be connected or we wouldn't - * get here, but since we want to check the death status anyway - * we might as well double-check the connect status. - */ - if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS, - &con_status, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status on close"); - /* Assume the worst. */ - con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD; - } - if (con_status & CS_CONSTAT_CONNECTED) { - if ((con_status & CS_CONSTAT_DEAD) || ct_close(sybase_ptr->connection, CS_UNUSED)!=CS_SUCCEED) { - ct_close(sybase_ptr->connection, CS_FORCE_CLOSE); - } - } - - ct_cmd_drop(sybase_ptr->cmd); - ct_con_drop(sybase_ptr->connection); - efree(sybase_ptr); - SybCtG(num_links)--; -} - - -static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; - CS_INT con_status; - - /* Persistent connections may have been closed before a failed - * reopen attempt. - */ - if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS, - &con_status, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status on close"); - /* Assume the worst. */ - con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD; - } - if (con_status & CS_CONSTAT_CONNECTED) { - if ((con_status & CS_CONSTAT_DEAD) || ct_close(sybase_ptr->connection, CS_UNUSED)!=CS_SUCCEED) { - ct_close(sybase_ptr->connection, CS_FORCE_CLOSE); - } - } - - ct_con_drop(sybase_ptr->connection); - free(sybase_ptr); - SybCtG(num_persistent)--; - SybCtG(num_links)--; -} - - -static CS_RETCODE CS_PUBLIC _client_message_handler(CS_CONTEXT *context, CS_CONNECTION *connection, CS_CLIENTMSG *errmsg) -{ - TSRMLS_FETCH(); - - if (CS_SEVERITY(errmsg->msgnumber) >= SybCtG(min_client_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Client message: %s (severity %ld)", errmsg->msgstring, CS_SEVERITY(errmsg->msgnumber)); - } - STR_FREE(SybCtG(server_message)); - SybCtG(server_message) = estrdup(errmsg->msgstring); - - - /* If this is a timeout message, return CS_FAIL to cancel the - * operation and mark the connection as dead. - */ - if (CS_SEVERITY(errmsg->msgnumber) == CS_SV_RETRY_FAIL && - CS_NUMBER(errmsg->msgnumber) == 63 && - CS_ORIGIN(errmsg->msgnumber) == 2 && - CS_LAYER(errmsg->msgnumber) == 1) - { - return CS_FAIL; - } - - return CS_SUCCEED; -} - -static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg TSRMLS_DC) -{ - int handled = 0; - - if (callback_name) { - zval *msgnumber, *severity, *state, *line, *text, *retval = NULL; - zval **args[5]; - - MAKE_STD_ZVAL(msgnumber); - ZVAL_LONG(msgnumber, srvmsg->msgnumber); - args[0] = &msgnumber; - - MAKE_STD_ZVAL(severity); - ZVAL_LONG(severity, srvmsg->severity); - args[1] = &severity; - - MAKE_STD_ZVAL(state); - ZVAL_LONG(state, srvmsg->state); - args[2] = &state; - - MAKE_STD_ZVAL(line); - ZVAL_LONG(line, srvmsg->line); - args[3] = &line; - - MAKE_STD_ZVAL(text); - ZVAL_STRING(text, srvmsg->text, 1); - args[4] = &text; - - if (call_user_function_ex(EG(function_table), NULL, callback_name, &retval, 5, args, 0, NULL TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot call the messagehandler %s", Z_STRVAL_P(callback_name)); - } - - if (retval) { - handled= ((Z_TYPE_P(retval) != IS_BOOL) || (Z_BVAL_P(retval) != 0)); - zval_ptr_dtor(&retval); - } - - zval_ptr_dtor(&msgnumber); - zval_ptr_dtor(&severity); - zval_ptr_dtor(&state); - zval_ptr_dtor(&line); - zval_ptr_dtor(&text); - } - - return handled; -} - -static CS_RETCODE CS_PUBLIC _server_message_handler(CS_CONTEXT *context, CS_CONNECTION *connection, CS_SERVERMSG *srvmsg) -{ - sybase_link *sybase; - int handled = 0; - TSRMLS_FETCH(); - - /* Remember the last server message in any case */ - STR_FREE(SybCtG(server_message)); - SybCtG(server_message) = estrdup(srvmsg->text); - - /* Retrieve sybase link */ - if (ct_con_props(connection, CS_GET, CS_USERDATA, &sybase, CS_SIZEOF(sybase), NULL) != CS_SUCCEED) { - sybase = NULL; - } - - /* If this is a deadlock message, set the connection's deadlock flag - * so we will retry the request. Sorry about the bare constant here, - * but it's not defined anywhere and it's a "well-known" number. - */ - if (sybase && (srvmsg->msgnumber == 1205)) { - sybase->deadlock = 1; - } - - /* Check mininum server severity level */ - if (srvmsg->severity < SybCtG(min_server_severity)) { - return CS_SUCCEED; - } - - /* Call global message handler */ - handled = handled | _call_message_handler(SybCtG(callback_name), srvmsg TSRMLS_CC); - - /* Call link specific message handler */ - if (sybase) { - handled = handled | _call_message_handler(sybase->callback_name, srvmsg TSRMLS_CC); - } - - /* Spit out a warning if neither of them has handled this message */ - if (!handled) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Server message: %s (severity %ld, procedure %s)", - srvmsg->text, (long)srvmsg->severity, ((srvmsg->proclen>0) ? srvmsg->proc : "N/A")); - } - - return CS_SUCCEED; -} - - -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("sybct.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong, allow_persistent, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY_EX("sybct.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_sybase_globals, sybase_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX("sybct.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_sybase_globals, sybase_globals, display_link_numbers) - STD_PHP_INI_ENTRY("sybct.min_server_severity", "10", PHP_INI_ALL, OnUpdateLong, min_server_severity, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY("sybct.min_client_severity", "10", PHP_INI_ALL, OnUpdateLong, min_client_severity, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY("sybct.login_timeout", "-1", PHP_INI_ALL, OnUpdateLong, login_timeout, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY("sybct.hostname", NULL, PHP_INI_ALL, OnUpdateString, hostname, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY_EX("sybct.deadlock_retry_count", "0", PHP_INI_ALL, OnUpdateLong, deadlock_retry_count, zend_sybase_globals, sybase_globals, display_link_numbers) -PHP_INI_END() - - -static PHP_GINIT_FUNCTION(sybase) -{ - long opt; - - if (cs_ctx_alloc(CTLIB_VERSION, &sybase_globals->context)!=CS_SUCCEED || ct_init(sybase_globals->context, CTLIB_VERSION)!=CS_SUCCEED) { - return; - } - - /* Initialize message handlers */ - if (ct_callback(sybase_globals->context, NULL, CS_SET, CS_SERVERMSG_CB, (CS_VOID *)_server_message_handler)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set server message handler"); - } - - if (ct_callback(sybase_globals->context, NULL, CS_SET, CS_CLIENTMSG_CB, (CS_VOID *)_client_message_handler)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set client message handler"); - } - - /* Set datetime conversion format to "Nov 3 1998 8:06PM". - * This is the default format for the ct-lib that comes with - * Sybase ASE 11.5.1 for Solaris, but the Linux libraries that - * come with 11.0.3.3 default to "03/11/98" which is singularly - * useless. This levels the playing field for all platforms. - */ - { - CS_INT dt_convfmt = CS_DATES_SHORT; - if (cs_dt_info(sybase_globals->context, CS_SET, NULL, CS_DT_CONVFMT, CS_UNUSED, &dt_convfmt, sizeof(dt_convfmt), NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set datetime conversion format"); - } - } - - /* Set the timeout, which is per context and can't be set with - * ct_con_props(), so set it globally from the config value if - * requested. The default is CS_NO_LIMIT. - * - * Note that despite some noise in the documentation about using - * signals to implement timeouts, they are actually implemented - * by using poll() or select() on Solaris and Linux. - */ - if (cfg_get_long("sybct.timeout", &opt)==SUCCESS) { - CS_INT cs_timeout = opt; - if (ct_config(sybase_globals->context, CS_SET, CS_TIMEOUT, &cs_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the timeout"); - } - } - - sybase_globals->num_persistent=0; - sybase_globals->callback_name = NULL; -} - - -static PHP_GSHUTDOWN_FUNCTION(sybase) -{ - ct_exit(sybase_globals->context, CS_UNUSED); - cs_ctx_drop(sybase_globals->context); -} - -PHP_MINIT_FUNCTION(sybase) -{ - REGISTER_INI_ENTRIES(); - - le_link = zend_register_list_destructors_ex(_close_sybase_link, NULL, "sybase-ct link", module_number); - le_plink = zend_register_list_destructors_ex(NULL, _close_sybase_plink, "sybase-ct link persistent", module_number); - le_result = zend_register_list_destructors_ex(php_free_sybase_result, NULL, "sybase-ct result", module_number); - - return SUCCESS; -} - - - -PHP_RINIT_FUNCTION(sybase) -{ - SybCtG(default_link)=-1; - SybCtG(num_links) = SybCtG(num_persistent); - SybCtG(appname) = estrndup("PHP " PHP_VERSION, sizeof("PHP " PHP_VERSION)); - SybCtG(server_message) = STR_EMPTY_ALLOC(); - return SUCCESS; -} - - - -PHP_MSHUTDOWN_FUNCTION(sybase) -{ - UNREGISTER_INI_ENTRIES(); -#if 0 - ct_exit(context, CS_UNUSED); - cs_ctx_drop(context); -#endif - return SUCCESS; -} - - -PHP_RSHUTDOWN_FUNCTION(sybase) -{ - efree(SybCtG(appname)); - SybCtG(appname) = NULL; - if (SybCtG(callback_name)) { - zval_ptr_dtor(&SybCtG(callback_name)); - SybCtG(callback_name)= NULL; - } - STR_FREE(SybCtG(server_message)); - SybCtG(server_message) = NULL; - return SUCCESS; -} - - -static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char *user, char *passwd, char *charset, char *appname TSRMLS_DC) -{ - CS_LOCALE *tmp_locale; - long packetsize; - - /* set a CS_CONNECTION record */ - if (ct_con_alloc(SybCtG(context), &sybase->connection)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate connection record"); - return 0; - } - - /* Note - this saves a copy of sybase, not a pointer to it. */ - if (ct_con_props(sybase->connection, CS_SET, CS_USERDATA, &sybase, CS_SIZEOF(sybase), NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set userdata"); - ct_con_drop(sybase->connection); - return 0; - } - - if (user) { - ct_con_props(sybase->connection, CS_SET, CS_USERNAME, user, CS_NULLTERM, NULL); - } - if (passwd) { - ct_con_props(sybase->connection, CS_SET, CS_PASSWORD, passwd, CS_NULLTERM, NULL); - } - if (appname) { - ct_con_props(sybase->connection, CS_SET, CS_APPNAME, appname, CS_NULLTERM, NULL); - } else { - ct_con_props(sybase->connection, CS_SET, CS_APPNAME, SybCtG(appname), CS_NULLTERM, NULL); - } - - if (SybCtG(hostname)) { - ct_con_props(sybase->connection, CS_SET, CS_HOSTNAME, SybCtG(hostname), CS_NULLTERM, NULL); - } - - if (charset) { - if (cs_loc_alloc(SybCtG(context), &tmp_locale)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate locale information"); - } else { - if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_LC_ALL, NULL, CS_NULLTERM, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to load default locale data"); - } else { - if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_SYB_CHARSET, charset, CS_NULLTERM, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update character set"); - } else { - if (ct_con_props(sybase->connection, CS_SET, CS_LOC_PROP, tmp_locale, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection properties"); - } - } - } - } - } - - if (cfg_get_long("sybct.packet_size", &packetsize) == SUCCESS) { - if (ct_con_props(sybase->connection, CS_SET, CS_PACKETSIZE, (CS_VOID *)&packetsize, CS_UNUSED, NULL) != CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection packetsize"); - } - } - - /* Set the login timeout. Actually, the login timeout is per context - * and not per connection, but we will update the context here to - * allow for code such as the following: - * - * ini_set('sybct.login_timeout', $timeout); - * sybase_connect(...) - * - * Note that preceding calls to sybase_connect() will now use the - * updated value and not the default one! - * - * The default value for CS_LOGIN_TIMEOUT is 60 (1 minute). - */ - if (SybCtG(login_timeout) != -1) { - CS_INT cs_login_timeout = SybCtG(login_timeout); - if (ct_config(SybCtG(context), CS_SET, CS_LOGIN_TIMEOUT, &cs_login_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the login timeout"); - } - } - - sybase->valid = 1; - sybase->dead = 0; - sybase->active_result_index = 0; - sybase->callback_name = NULL; - - /* create the link */ - if (ct_connect(sybase->connection, host, CS_NULLTERM)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to connect"); - ct_con_drop(sybase->connection); - return 0; - } - - if (ct_cmd_alloc(sybase->connection, &sybase->cmd)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate command record"); - ct_close(sybase->connection, CS_UNUSED); - ct_con_drop(sybase->connection); - return 0; - } - - return 1; -} - - -static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - char *user, *passwd, *host, *charset, *appname; - char *hashed_details; - int hashed_details_length; - sybase_link *sybase_ptr; - - switch(ZEND_NUM_ARGS()) { - case 0: /* defaults */ - host=user=passwd=charset=appname=NULL; - hashed_details_length=6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - strcpy(hashed_details, "sybase_____"); - break; - case 1: { - zval **yyhost; - - if (zend_get_parameters_ex(1, &yyhost) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - host = Z_STRVAL_PP(yyhost); - user=passwd=charset=appname=NULL; - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s____", Z_STRVAL_PP(yyhost)); - } - break; - case 2: { - zval **yyhost, **yyuser; - - if (zend_get_parameters_ex(2, &yyhost, &yyuser) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd=charset=appname=NULL; - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s_%s___", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser)); - } - break; - case 3: { - zval **yyhost, **yyuser, **yypasswd; - - if (zend_get_parameters_ex(3, &yyhost, &yyuser, &yypasswd) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset=appname=NULL; - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s_%s_%s__", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd)); - } - break; - case 4: { - zval **yyhost, **yyuser, **yypasswd, **yycharset; - - if (zend_get_parameters_ex(4, &yyhost, &yyuser, &yypasswd, &yycharset) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_string_ex(yycharset); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset = Z_STRVAL_PP(yycharset); - appname=NULL; - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s_%s_%s_%s_", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset)); - } - break; - case 5: { - zval **yyhost, **yyuser, **yypasswd, **yycharset, **yyappname; - - if (zend_get_parameters_ex(5, &yyhost, &yyuser, &yypasswd, &yycharset, &yyappname) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_string_ex(yycharset); - convert_to_string_ex(yyappname); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset = Z_STRVAL_PP(yycharset); - appname = Z_STRVAL_PP(yyappname); - hashed_details_length = spprintf(&hashed_details, 0, "sybase_%s_%s_%s_%s_%s", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset), Z_STRVAL_PP(yyappname)); - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (!SybCtG(allow_persistent)) { - persistent=0; - } - if (persistent) { - zend_rsrc_list_entry *le; - - /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */ - zend_rsrc_list_entry new_le; - - if (SybCtG(max_links)!=-1 && SybCtG(num_links)>=SybCtG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links)); - efree(hashed_details); - RETURN_FALSE; - } - if (SybCtG(max_persistent)!=-1 && SybCtG(num_persistent)>=SybCtG(max_persistent)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open persistent links (%ld)", SybCtG(num_persistent)); - efree(hashed_details); - RETURN_FALSE; - } - - sybase_ptr = (sybase_link *) malloc(sizeof(sybase_link)); - if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) { - free(sybase_ptr); - efree(hashed_details); - RETURN_FALSE; - } - - /* hash it up */ - Z_TYPE(new_le) = le_plink; - new_le.ptr = sybase_ptr; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(zend_rsrc_list_entry), NULL)==FAILURE) { - ct_close(sybase_ptr->connection, CS_UNUSED); - ct_con_drop(sybase_ptr->connection); - free(sybase_ptr); - efree(hashed_details); - RETURN_FALSE; - } - SybCtG(num_persistent)++; - SybCtG(num_links)++; - } else { /* we do */ - CS_INT con_status; - - if (Z_TYPE_P(le) != le_plink) { - efree(hashed_details); - RETURN_FALSE; - } - - sybase_ptr = (sybase_link *) le->ptr; - - /* If the link has died, close it and overwrite it with a new one. */ - - if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS, - &con_status, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status"); - efree(hashed_details); - RETURN_FALSE; - } - if (!(con_status & CS_CONSTAT_CONNECTED) || (con_status & CS_CONSTAT_DEAD) || sybase_ptr->dead) { - sybase_link sybase; - - if (con_status & CS_CONSTAT_CONNECTED) { - ct_close(sybase_ptr->connection, CS_FORCE_CLOSE); - } - /* Create a new connection, then replace the old - * connection. If we fail to create a new connection, - * put the old one back so there will be a connection, - * even if it is a non-functional one. This is because - * code may still be holding an id for this connection - * so we can't free the CS_CONNECTION. - * (This is actually totally hokey, it would be better - * to just ct_con_drop() the connection and set - * sybase_ptr->connection to NULL, then test it for - * NULL before trying to use it elsewhere . . .) - */ - memcpy(&sybase, sybase_ptr, sizeof(sybase_link)); - if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) { - memcpy(sybase_ptr, &sybase, sizeof(sybase_link)); - efree(hashed_details); - RETURN_FALSE; - } - ct_con_drop(sybase.connection); /* drop old connection */ - } - } - ZEND_REGISTER_RESOURCE(return_value, sybase_ptr, le_plink); - } else { /* non persistent */ - zend_rsrc_list_entry *index_ptr, new_index_ptr; - - /* first we check the hash for the hashed_details key. if it exists, - * it should point us to the right offset where the actual sybase link sits. - * if it doesn't, open a new sybase link, add it to the resource list, - * and add a pointer to it with hashed_details as the key. - */ - if (zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length+1, (void **) &index_ptr)==SUCCESS) { - int type, link; - void *ptr; - - if (Z_TYPE_P(index_ptr) != le_index_ptr) { - efree(hashed_details); - RETURN_FALSE; - } - link = (int) index_ptr->ptr; - ptr = zend_list_find(link, &type); /* check if the link is still there */ - if (ptr && (type==le_link || type==le_plink)) { - zend_list_addref(link); - Z_LVAL_P(return_value) = SybCtG(default_link) = link; - Z_TYPE_P(return_value) = IS_RESOURCE; - efree(hashed_details); - return; - } else { - zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length+1); - } - } - if (SybCtG(max_links)!=-1 && SybCtG(num_links)>=SybCtG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links)); - efree(hashed_details); - RETURN_FALSE; - } - - sybase_ptr = (sybase_link *) emalloc(sizeof(sybase_link)); - if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) { - efree(sybase_ptr); - efree(hashed_details); - RETURN_FALSE; - } - - /* add it to the list */ - ZEND_REGISTER_RESOURCE(return_value, sybase_ptr, le_link); - - /* add it to the hash */ - new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); - Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length+1, (void *) &new_index_ptr, sizeof(zend_rsrc_list_entry), NULL)==FAILURE) { - ct_close(sybase_ptr->connection, CS_UNUSED); - ct_con_drop(sybase_ptr->connection); - efree(sybase_ptr); - efree(hashed_details); - RETURN_FALSE; - } - SybCtG(num_links)++; - } - efree(hashed_details); - SybCtG(default_link)=Z_LVAL_P(return_value); - zend_list_addref(SybCtG(default_link)); -} - - -static int php_sybase_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (SybCtG(default_link)==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - } - return SybCtG(default_link); -} - - -/* {{{ proto int sybase_connect([string host [, string user [, string password [, string charset [, string appname]]]]]) - Open Sybase server connection */ -PHP_FUNCTION(sybase_connect) -{ - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} - -/* }}} */ - -/* {{{ proto int sybase_pconnect([string host [, string user [, string password [, string charset [, string appname]]]]]) - Open persistent Sybase connection */ -PHP_FUNCTION(sybase_pconnect) -{ - php_sybase_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} - -/* }}} */ - - -/* {{{ proto bool sybase_close([int link_id]) - Close Sybase connection */ -PHP_FUNCTION(sybase_close) -{ - zval **sybase_link_index = 0; - int id; - sybase_link *sybase_ptr; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = SybCtG(default_link); - break; - case 1: - if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink); - - if (id == -1) { /* explicit resource number */ - zend_list_delete(Z_RESVAL_PP(sybase_link_index)); - } - - if (id != -1 || (sybase_link_index && Z_RESVAL_PP(sybase_link_index)==SybCtG(default_link))) { - zend_list_delete(SybCtG(default_link)); - SybCtG(default_link) = -1; - } - - RETURN_TRUE; -} - -/* }}} */ - - -static int exec_cmd(sybase_link *sybase_ptr, char *cmdbuf) -{ - CS_RETCODE retcode; - CS_INT restype; - int failure=0; - - /* Fail if we already marked this connection dead. */ - - if (sybase_ptr->dead) { - return FAILURE; - } - - /* - ** Get a command handle, store the command string in it, and - ** send it to the server. - */ - - if (ct_command(sybase_ptr->cmd, CS_LANG_CMD, cmdbuf, CS_NULLTERM, CS_UNUSED)!=CS_SUCCEED) { - sybase_ptr->dead = 1; - return FAILURE; - } - if (ct_send(sybase_ptr->cmd)!=CS_SUCCEED) { - sybase_ptr->dead = 1; - return FAILURE; - } - - while ((retcode = ct_results(sybase_ptr->cmd, &restype))==CS_SUCCEED) { - switch ((int) restype) { - case CS_CMD_SUCCEED: - case CS_CMD_DONE: - break; - - case CS_CMD_FAIL: - failure=1; - break; - - case CS_STATUS_RESULT: - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT); - break; - - default: - failure=1; - break; - } - if (failure) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - return FAILURE; - } - } - - switch (retcode) { - case CS_END_RESULTS: - return SUCCESS; - break; - - case CS_FAIL: - /* Hopefully this either cleans up the connection, or the - * connection ends up marked dead so it will be reopened - * if it is persistent. We may want to do - * ct_close(CS_FORCE_CLOSE) if ct_cancel() fails; see the - * doc for ct_results()==CS_FAIL. - */ - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - /* Don't take chances with the vagaries of ct-lib. Mark it - * dead ourselves. - */ - sybase_ptr->dead = 1; - return FAILURE; - - default: - return FAILURE; - } -} - - -/* {{{ proto bool sybase_select_db(string database [, int link_id]) - Select Sybase database */ -PHP_FUNCTION(sybase_select_db) -{ - zval **db, **sybase_link_index; - int id; - char *cmdbuf; - sybase_link *sybase_ptr; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &db) == FAILURE) { - RETURN_FALSE; - } - id = php_sybase_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &db, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink); - - convert_to_string_ex(db); - spprintf(&cmdbuf, 0, "use %s", Z_STRVAL_PP(db)); /* SAFE */ - - if (exec_cmd(sybase_ptr, cmdbuf)==FAILURE) { - efree(cmdbuf); - RETURN_FALSE; - } else { - efree(cmdbuf); - RETURN_TRUE; - } -} - -/* }}} */ - -static int php_sybase_finish_results(sybase_result *result TSRMLS_DC) -{ - int i, fail; - CS_RETCODE retcode; - CS_INT restype; - - efree_n(result->datafmt); - efree_n(result->lengths); - efree_n(result->indicators); - efree_n(result->numerics); - efree_n(result->types); - for (i=0; inum_fields; i++) { - efree(result->tmp_buffer[i]); - } - efree_n(result->tmp_buffer); - - /* Indicate we have read all rows */ - result->sybase_ptr->active_result_index= 0; - - /* The only restype we should get now is CS_CMD_DONE, possibly - * followed by a CS_STATUS_RESULT/CS_CMD_SUCCEED/CS_CMD_DONE - * sequence if the command was a stored procedure call. But we - * still need to read and discard unexpected results. We might - * want to return a failure in this case because the application - * won't be getting all the results it asked for. - */ - fail = 0; - while ((retcode = ct_results(result->sybase_ptr->cmd, &restype))==CS_SUCCEED) { - switch ((int) restype) { - case CS_CMD_SUCCEED: - case CS_CMD_DONE: - break; - - case CS_CMD_FAIL: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Command failed, cancelling rest"); - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - fail = 1; - break; - - case CS_COMPUTE_RESULT: - case CS_CURSOR_RESULT: - case CS_PARAM_RESULT: - case CS_ROW_RESULT: - /* Unexpected results, cancel them. */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, cancelling current"); - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT); - break; - - case CS_STATUS_RESULT: - /* Status result from a stored procedure, cancel it but do not tell user */ - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, cancelling all"); - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - break; - } - - if (fail) { - break; - } - } - - switch (retcode) { - case CS_END_RESULTS: - /* Normal. */ - break; - - case CS_FAIL: - /* Hopefully this either cleans up the connection, or the - * connection ends up marked dead so it will be reopened - * if it is persistent. We may want to do - * ct_close(CS_FORCE_CLOSE) if ct_cancel() fails; see the - * doc for ct_results()==CS_FAIL. - */ - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - /* Don't take chances with the vagaries of ct-lib. Mark it - * dead ourselves. - */ - result->sybase_ptr->dead = 1; - - case CS_CANCELED: - default: - retcode = CS_FAIL; - break; - } - - return retcode; -} - -#define RETURN_DOUBLE_VAL(result, buf, length) \ - if ((length - 1) <= EG(precision)) { \ - errno = 0; \ - Z_DVAL(result) = zend_strtod(buf, NULL); \ - if (errno != ERANGE) { \ - Z_TYPE(result) = IS_DOUBLE; \ - } else { \ - ZVAL_STRINGL(&result, buf, length- 1, 1); \ - } \ - } else { \ - ZVAL_STRINGL(&result, buf, length- 1, 1); \ - } - -static int php_sybase_fetch_result_row (sybase_result *result, int numrows) -{ - int i, j; - CS_INT retcode; - TSRMLS_FETCH(); - - /* We've already fetched everything */ - if (result->last_retcode == CS_END_DATA || result->last_retcode == CS_END_RESULTS) { - return result->last_retcode; - } - - if (numrows!=-1) numrows+= result->num_rows; - while ((retcode=ct_fetch(result->sybase_ptr->cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, NULL))==CS_SUCCEED || retcode == CS_ROW_FAIL) { - result->num_rows++; - i= result->store ? result->num_rows- 1 : 0; - if (i >= result->blocks_initialized*SYBASE_ROWS_BLOCK) { - result->data = (zval **) safe_erealloc(result->data, SYBASE_ROWS_BLOCK*(++result->blocks_initialized), sizeof(zval *), 0); - } - if (result->store || 1 == result->num_rows) { - result->data[i] = (zval *) safe_emalloc(sizeof(zval), result->num_fields, 0); - } - - for (j = 0; j < result->num_fields; j++) { - - /* If we are in non-storing mode, free the previous result */ - if (!result->store && result->num_rows > 1 && Z_TYPE(result->data[i][j]) == IS_STRING) { - efree(Z_STRVAL(result->data[i][j])); - } - - if (result->indicators[j] == -1) { /* null value */ - ZVAL_NULL(&result->data[i][j]); - } else { - switch (result->numerics[j]) { - case 1: { - /* This indicates a long */ - ZVAL_LONG(&result->data[i][j], strtol(result->tmp_buffer[j], NULL, 10)); - break; - } - - case 2: { - /* This indicates a float */ - RETURN_DOUBLE_VAL(result->data[i][j], result->tmp_buffer[j], result->lengths[j]); - break; - } - - case 3: { - /* This indicates either a long or a float, which ever fits */ - errno = 0; - Z_LVAL(result->data[i][j]) = strtol(result->tmp_buffer[j], NULL, 10); - if (errno == ERANGE) { - - /* An overflow occurred, so try to fit it into a double */ - RETURN_DOUBLE_VAL(result->data[i][j], result->tmp_buffer[j], result->lengths[j]); - break; - } - Z_TYPE(result->data[i][j]) = IS_LONG; - break; - } - - default: { - /* This indicates anything else, return it as string */ - ZVAL_STRINGL(&result->data[i][j], result->tmp_buffer[j], result->lengths[j]- 1, 1); - break; - } - } - } - } - if (numrows!=-1 && result->num_rows>=numrows) break; - } - - if (retcode==CS_ROW_FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Error reading row %d", result->num_rows); - return retcode; - } - result->last_retcode= retcode; - switch (retcode) { - case CS_END_DATA: - retcode = php_sybase_finish_results(result TSRMLS_CC); - break; - - case CS_ROW_FAIL: - case CS_SUCCEED: - break; - - default: - FREE_SYBASE_RESULT(result); - result = NULL; - retcode = CS_FAIL; /* Just to be sure */ - break; - } - - return retcode; -} - -static sybase_result * php_sybase_fetch_result_set (sybase_link *sybase_ptr, int buffered, int store) -{ - int num_fields; - sybase_result *result; - int i, j; - CS_INT retcode; - - /* The following (if unbuffered) is more or less the equivalent of mysql_store_result(). - * fetch all rows from the server into the row buffer, thus: - * 1) Being able to fire up another query without explicitly reading all rows - * 2) Having numrows accessible - */ - if (ct_res_info(sybase_ptr->cmd, CS_NUMDATA, &num_fields, CS_UNUSED, NULL)!=CS_SUCCEED) { - return NULL; - } - - result = (sybase_result *) emalloc(sizeof(sybase_result)); - result->data = (zval **) safe_emalloc(sizeof(zval *), SYBASE_ROWS_BLOCK, 0); - result->fields = NULL; - result->sybase_ptr = sybase_ptr; - result->cur_field=result->cur_row=result->num_rows=0; - result->num_fields = num_fields; - result->last_retcode = 0; - result->store= store; - result->blocks_initialized= 1; - result->tmp_buffer = (char **) safe_emalloc(sizeof(char *), num_fields, 0); - result->lengths = (CS_INT *) safe_emalloc(sizeof(CS_INT), num_fields, 0); - result->indicators = (CS_SMALLINT *) safe_emalloc(sizeof(CS_INT), num_fields, 0); - result->datafmt = (CS_DATAFMT *) safe_emalloc(sizeof(CS_DATAFMT), num_fields, 0); - result->numerics = (unsigned char *) safe_emalloc(sizeof(unsigned char), num_fields, 0); - result->types = (CS_INT *) safe_emalloc(sizeof(CS_INT), num_fields, 0); - - for (i=0; icmd, i+1, &result->datafmt[i]); - result->types[i] = result->datafmt[i].datatype; - switch (result->datafmt[i].datatype) { - case CS_CHAR_TYPE: - case CS_VARCHAR_TYPE: - case CS_TEXT_TYPE: - case CS_IMAGE_TYPE: - result->datafmt[i].maxlength++; - result->numerics[i] = 0; - break; - case CS_BINARY_TYPE: - case CS_VARBINARY_TYPE: - result->datafmt[i].maxlength *= 2; - result->datafmt[i].maxlength++; - result->numerics[i] = 0; - break; - case CS_BIT_TYPE: - case CS_TINYINT_TYPE: - result->datafmt[i].maxlength = 4; - result->numerics[i] = 1; - break; - case CS_SMALLINT_TYPE: - result->datafmt[i].maxlength = 7; - result->numerics[i] = 1; - break; - case CS_INT_TYPE: - result->datafmt[i].maxlength = 12; - result->numerics[i] = 1; - break; - case CS_REAL_TYPE: - case CS_FLOAT_TYPE: - result->datafmt[i].maxlength = 24; - result->numerics[i] = 2; - break; - case CS_MONEY_TYPE: - case CS_MONEY4_TYPE: - result->datafmt[i].maxlength = 24; - result->numerics[i] = 2; - break; - case CS_DATETIME_TYPE: - case CS_DATETIME4_TYPE: - result->datafmt[i].maxlength = 30; - result->numerics[i] = 0; - break; - case CS_NUMERIC_TYPE: - case CS_DECIMAL_TYPE: - result->datafmt[i].maxlength = result->datafmt[i].precision + 3; - /* numeric(10) vs numeric(10, 1) */ - result->numerics[i] = (result->datafmt[i].scale == 0) ? 3 : 2; - break; - default: - result->datafmt[i].maxlength++; - result->numerics[i] = 0; - break; - } - result->tmp_buffer[i] = (char *)emalloc(result->datafmt[i].maxlength); - result->datafmt[i].datatype = CS_CHAR_TYPE; - result->datafmt[i].format = CS_FMT_NULLTERM; - ct_bind(sybase_ptr->cmd, i+1, &result->datafmt[i], result->tmp_buffer[i], &result->lengths[i], &result->indicators[i]); - } - - result->fields = (sybase_field *) safe_emalloc(sizeof(sybase_field), num_fields, 0); - j=0; - for (i=0; idatafmt[i].namelen>0) { - result->fields[i].name = estrndup(result->datafmt[i].name, result->datafmt[i].namelen); - } else { - if (j>0) { - snprintf(computed_buf, 16, "computed%d", j); - } else { - strcpy(computed_buf, "computed"); - } - result->fields[i].name = estrdup(computed_buf); - j++; - } - result->fields[i].column_source = STR_EMPTY_ALLOC(); - result->fields[i].max_length = result->datafmt[i].maxlength-1; - result->fields[i].numeric = result->numerics[i]; - Z_TYPE(result->fields[i]) = result->types[i]; - } - - if (buffered) { - retcode = CS_SUCCEED; - } else { - if ((retcode = php_sybase_fetch_result_row(result, -1)) == CS_FAIL) { - return NULL; - } - } - - result->last_retcode = retcode; - return result; -} - -static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered) -{ - zval **query, **sybase_link_index=NULL; - zval **store_mode= NULL; - int id, deadlock_count, store; - sybase_link *sybase_ptr; - sybase_result *result; - CS_INT restype; - CS_RETCODE retcode; - enum { - Q_RESULT, /* Success with results. */ - Q_SUCCESS, /* Success but no results. */ - Q_FAILURE, /* Failure, no results. */ - } status; - - store= 1; - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &query)==FAILURE) { - RETURN_FALSE; - } - id = SybCtG(default_link); - break; - case 2: - if (zend_get_parameters_ex(2, &query, &sybase_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - case 3: - if (zend_get_parameters_ex(3, &query, &sybase_link_index, &store_mode)==FAILURE) { - RETURN_FALSE; - } - if (!buffered) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "cannot use non-storing mode with buffered queries"); - store = 1; - } else { - convert_to_long_ex(store_mode); - store= (Z_LVAL_PP(store_mode) != 0); - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink); - - convert_to_string_ex(query); - - /* Fail if we already marked this connection dead. */ - if (sybase_ptr->dead) { - RETURN_FALSE; - } - - /* Check to see if a previous sybase_unbuffered_query has read all rows */ - if (sybase_ptr->active_result_index) { - zval *tmp = NULL; - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "called without first fetching all rows from a previous unbuffered query"); - if (sybase_ptr->cmd) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - } - - /* Get the resultset and free it */ - ALLOC_ZVAL(tmp); - Z_LVAL_P(tmp)= sybase_ptr->active_result_index; - Z_TYPE_P(tmp)= IS_RESOURCE; - INIT_PZVAL(tmp); - ZEND_FETCH_RESOURCE(result, sybase_result *, &tmp, -1, "Sybase result", le_result); - - if (result) { - php_sybase_finish_results(result TSRMLS_CC); - } - - zval_ptr_dtor(&tmp); - zend_list_delete(sybase_ptr->active_result_index); - sybase_ptr->active_result_index= 0; - } - - /* Repeat until we don't deadlock. */ - deadlock_count= 0; - for (;;) { - result = NULL; - sybase_ptr->deadlock = 0; - sybase_ptr->affected_rows = 0; - - /* On Solaris 11.5, ct_command() can be moved outside the - * loop, but not on Linux 11.0. - */ - if (ct_command(sybase_ptr->cmd, CS_LANG_CMD, Z_STRVAL_PP(query), CS_NULLTERM, CS_UNUSED)!=CS_SUCCEED) { - /* If this didn't work, the connection is screwed but - * ct-lib might not set CS_CONSTAT_DEAD. So set our own - * flag. This happens sometimes when the database is restarted - * and/or its machine is rebooted, and ct_command() returns - * CS_BUSY for some reason. - */ - sybase_ptr->dead = 1; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Connection is dead"); - RETURN_FALSE; - } - - if (ct_send(sybase_ptr->cmd)!=CS_SUCCEED) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - sybase_ptr->dead = 1; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot send command"); - RETURN_FALSE; - } - - /* Use the first result set or succeed/fail status and discard the - * others. Applications really shouldn't be making calls that - * return multiple result sets, but if they do then we need to - * properly read or cancel them or the connection will become - * unusable. - */ - if (ct_results(sybase_ptr->cmd, &restype)!=CS_SUCCEED) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - sybase_ptr->dead = 1; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot read results"); - RETURN_FALSE; - } - switch ((int) restype) { - case CS_CMD_FAIL: - default: - status = Q_FAILURE; - break; - case CS_CMD_SUCCEED: - case CS_CMD_DONE: { - CS_INT row_count; - if (ct_res_info(sybase_ptr->cmd, CS_ROW_COUNT, &row_count, CS_UNUSED, NULL)==CS_SUCCEED) { - sybase_ptr->affected_rows = (long)row_count; - } - } - /* Fall through */ - case CS_COMPUTEFMT_RESULT: - case CS_ROWFMT_RESULT: - case CS_DESCRIBE_RESULT: - case CS_MSG_RESULT: - buffered= 0; /* These queries have no need for buffering */ - status = Q_SUCCESS; - break; - case CS_COMPUTE_RESULT: - case CS_CURSOR_RESULT: - case CS_PARAM_RESULT: - case CS_ROW_RESULT: - case CS_STATUS_RESULT: - result = php_sybase_fetch_result_set(sybase_ptr, buffered, store); - if (result == NULL) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - RETURN_FALSE; - } - status = Q_RESULT; - break; - } - - /* Check for left-over results */ - if (!buffered && status != Q_RESULT) { - while ((retcode = ct_results(sybase_ptr->cmd, &restype))==CS_SUCCEED) { - switch ((int) restype) { - case CS_CMD_SUCCEED: - case CS_CMD_DONE: - break; - - case CS_CMD_FAIL: - status = Q_FAILURE; - break; - - case CS_COMPUTE_RESULT: - case CS_CURSOR_RESULT: - case CS_PARAM_RESULT: - case CS_ROW_RESULT: - if (status != Q_RESULT) { - result = php_sybase_fetch_result_set(sybase_ptr, buffered, store); - if (result == NULL) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - sybase_ptr->dead = 1; - RETURN_FALSE; - } - status = Q_RESULT; - retcode = result->last_retcode; - } else { - /* Unexpected results, cancel them. */ - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT); - } - break; - case CS_STATUS_RESULT: - /* Unexpected results, cancel them. */ - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT); - break; - - default: - status = Q_FAILURE; - break; - } - if (status == Q_FAILURE) { - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - } - if (retcode == CS_END_RESULTS) { - break; - } - } - switch (retcode) { - case CS_END_RESULTS: - /* Normal. */ - break; - - case CS_FAIL: - /* Hopefully this either cleans up the connection, or the - * connection ends up marked dead so it will be reopened - * if it is persistent. We may want to do - * ct_close(CS_FORCE_CLOSE) if ct_cancel() fails; see the - * doc for ct_results()==CS_FAIL. - */ - ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); - /* Don't take chances with the vagaries of ct-lib. Mark it - * dead ourselves. - */ - sybase_ptr->dead = 1; - case CS_CANCELED: - default: - status = Q_FAILURE; - break; - } - } - - /* Retry deadlocks up until deadlock_retry_count times */ - if (sybase_ptr->deadlock && SybCtG(deadlock_retry_count) != -1 && ++deadlock_count > SybCtG(deadlock_retry_count)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Retried deadlock %d times [max: %ld], giving up", deadlock_count- 1, SybCtG(deadlock_retry_count)); - FREE_SYBASE_RESULT(result); - break; - } - - /* If query completed without deadlock, break out of the loop. - * Sometimes deadlock results in failures and sometimes not, - * it seems to depend on the server flavor. But we want to - * retry all deadlocks. - */ - if (sybase_ptr->dead || sybase_ptr->deadlock == 0) { - break; - } - - /* Get rid of any results we may have fetched. This happens: - * e.g., our result set may be a stored procedure status which - * is returned even if the stored procedure deadlocks. As an - * optimization, we could try not to fetch results in known - * deadlock conditions, but deadlock is (should be) rare. - */ - FREE_SYBASE_RESULT(result); - } - - if (status == Q_SUCCESS) { - RETURN_TRUE; - } - - if (status == Q_FAILURE) { - FREE_SYBASE_RESULT(result); - RETURN_FALSE; - } - - /* Indicate we have data in case of buffered queries */ - id= ZEND_REGISTER_RESOURCE(return_value, result, le_result); - sybase_ptr->active_result_index= buffered ? id : 0; -} - -/* {{{ proto int sybase_query(string query [, int link_id]) - Send Sybase query */ -PHP_FUNCTION(sybase_query) -{ - php_sybase_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int sybase_unbuffered_query(string query [, int link_id]) - Send Sybase query */ -PHP_FUNCTION(sybase_unbuffered_query) -{ - php_sybase_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} - -/* {{{ proto bool sybase_free_result(int result) - Free result memory */ -PHP_FUNCTION(sybase_free_result) -{ - zval **sybase_result_index; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(sybase_result_index) == IS_RESOURCE && Z_LVAL_PP(sybase_result_index) == 0) { - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - /* Did we fetch up until the end? */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - /* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cancelling the rest of the results"); */ - ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); - php_sybase_finish_results(result TSRMLS_CC); - } - - zend_list_delete(Z_LVAL_PP(sybase_result_index)); - RETURN_TRUE; -} - -/* }}} */ - -/* {{{ proto string sybase_get_last_message(void) - Returns the last message from server (over min_message_severity) */ -PHP_FUNCTION(sybase_get_last_message) -{ - RETURN_STRING(SybCtG(server_message), 1); -} -/* }}} */ - -/* {{{ proto int sybase_num_rows(int result) - Get number of rows in result */ -PHP_FUNCTION(sybase_num_rows) -{ - zval **sybase_result_index; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - Z_LVAL_P(return_value) = result->num_rows; - Z_TYPE_P(return_value) = IS_LONG; -} - -/* }}} */ - -/* {{{ proto int sybase_num_fields(int result) - Get number of fields in result */ -PHP_FUNCTION(sybase_num_fields) -{ - zval **sybase_result_index; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - Z_LVAL_P(return_value) = result->num_fields; - Z_TYPE_P(return_value) = IS_LONG; -} - -/* }}} */ - -/* {{{ proto array sybase_fetch_row(int result) - Get row as enumerated array */ -PHP_FUNCTION(sybase_fetch_row) -{ - zval **sybase_result_index; - int i; - sybase_result *result; - zval *field_content; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - /* Unbuffered? */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - php_sybase_fetch_result_row(result, 1); - } - - /* At the end? */ - if (result->cur_row >= result->num_rows) { - RETURN_FALSE; - } - - array_init(return_value); - for (i=0; inum_fields; i++) { - ALLOC_ZVAL(field_content); - *field_content = result->data[result->store ? result->cur_row : 0][i]; - INIT_PZVAL(field_content); - zval_copy_ctor(field_content); - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &field_content, sizeof(zval* ), NULL); - } - result->cur_row++; -} - -/* }}} */ - -static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int numerics) -{ - zval **sybase_result_index; - sybase_result *result; - int i, j; - zval *tmp; - char name[32]; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - /* Unbuffered ? Fetch next row */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - php_sybase_fetch_result_row(result, 1); - } - - /* At the end? */ - if (result->cur_row >= result->num_rows) { - RETURN_FALSE; - } - - array_init(return_value); - - j= 1; - for (i=0; inum_fields; i++) { - ALLOC_ZVAL(tmp); - *tmp = result->data[result->store ? result->cur_row : 0][i]; - INIT_PZVAL(tmp); - if (PG(magic_quotes_runtime) && Z_TYPE_P(tmp) == IS_STRING) { - Z_STRVAL_P(tmp) = php_addslashes(Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), &Z_STRLEN_P(tmp), 0 TSRMLS_CC); - } else { - zval_copy_ctor(tmp); - } - if (numerics) { - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &tmp, sizeof(zval *), NULL); - tmp->refcount++; - } - - if (zend_hash_exists(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1)) { - snprintf(name, 32, "%s%d", result->fields[i].name, j); - result->fields[i].name= estrdup(name); - j++; - } - zend_hash_update(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(zval *), NULL); - } - result->cur_row++; -} - - -/* {{{ proto object sybase_fetch_object(int result [, mixed object]) - Fetch row as object */ -PHP_FUNCTION(sybase_fetch_object) -{ - zval **object= NULL; - zval *sybase_result_index; - zend_class_entry *ce= NULL; - - /* Was a second parameter given? */ - if (2 == ZEND_NUM_ARGS()) { - if (zend_get_parameters_ex(2, &sybase_result_index, &object) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (Z_TYPE_PP(object)) { - case IS_OBJECT: - ce = Z_OBJCE_PP(object); - break; - case IS_NULL: - break; - default: { - zend_class_entry **pce = NULL; - - convert_to_string_ex(object); - if (zend_lookup_class(Z_STRVAL_PP(object), Z_STRLEN_PP(object), &pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Class %s has not been declared", Z_STRVAL_PP(object)); - } else { - ce = *pce; - } - } - } - - /* Reset no. of arguments to 1 so that we can use INTERNAL_FUNCTION_PARAM_PASSTHRU */ - ht= 1; - } - - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - if (Z_TYPE_P(return_value)==IS_ARRAY) { - object_and_properties_init( - return_value, - ce ? ce : ZEND_STANDARD_CLASS_DEF_PTR, - Z_ARRVAL_P(return_value) - ); - } -} -/* }}} */ - -/* {{{ proto array sybase_fetch_array(int result) - Fetch row as array */ -PHP_FUNCTION(sybase_fetch_array) -{ - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto array sybase_fetch_assoc(int result) - Fetch row as array without numberic indices */ -PHP_FUNCTION(sybase_fetch_assoc) -{ - php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool sybase_data_seek(int result, int offset) - Move internal row pointer */ -PHP_FUNCTION(sybase_data_seek) -{ - zval **sybase_result_index, **offset; - sybase_result *result; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset)==FAILURE) { - WRONG_PARAM_COUNT; - } - - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - convert_to_long_ex(offset); - - /* Unbuffered ? */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && Z_LVAL_PP(offset)>=result->num_rows) { - php_sybase_fetch_result_row(result, Z_LVAL_PP(offset)+ 1); - } - - if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset %ld, must be betweem 0 and %d", Z_LVAL_PP(offset), result->num_rows - 1); - RETURN_FALSE; - } - - result->cur_row = Z_LVAL_PP(offset); - RETURN_TRUE; -} -/* }}} */ - -static char *php_sybase_get_field_name(CS_INT type) -{ - switch (type) { - case CS_CHAR_TYPE: - case CS_VARCHAR_TYPE: - case CS_TEXT_TYPE: - return "string"; - break; - case CS_IMAGE_TYPE: - return "image"; - break; - case CS_BINARY_TYPE: - case CS_VARBINARY_TYPE: - return "blob"; - break; - case CS_BIT_TYPE: - return "bit"; - break; - case CS_TINYINT_TYPE: - case CS_SMALLINT_TYPE: - case CS_INT_TYPE: - return "int"; - break; - case CS_REAL_TYPE: - case CS_FLOAT_TYPE: - case CS_NUMERIC_TYPE: - case CS_DECIMAL_TYPE: - return "real"; - break; - case CS_MONEY_TYPE: - case CS_MONEY4_TYPE: - return "money"; - break; - case CS_DATETIME_TYPE: - case CS_DATETIME4_TYPE: - return "datetime"; - break; - default: - return "unknown"; - break; - } -} - - -/* {{{ proto object sybase_fetch_field(int result [, int offset]) - Get field information */ -PHP_FUNCTION(sybase_fetch_field) -{ - zval **sybase_result_index, **offset; - int field_offset; - sybase_result *result; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { - RETURN_FALSE; - } - field_offset=-1; - break; - case 2: - if (zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - if (field_offset==-1) { - field_offset = result->cur_field; - result->cur_field++; - } - - if (field_offset<0 || field_offset >= result->num_fields) { - if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset"); - } - RETURN_FALSE; - } - - object_init(return_value); - - add_property_string(return_value, "name", result->fields[field_offset].name, 1); - add_property_long(return_value, "max_length", result->fields[field_offset].max_length); - add_property_string(return_value, "column_source", result->fields[field_offset].column_source, 1); - add_property_long(return_value, "numeric", result->fields[field_offset].numeric); - add_property_string(return_value, "type", php_sybase_get_field_name(Z_TYPE(result->fields[field_offset])), 1); -} -/* }}} */ - - -/* {{{ proto bool sybase_field_seek(int result, int offset) - Set field offset */ -PHP_FUNCTION(sybase_field_seek) -{ - zval **sybase_result_index, **offset; - int field_offset; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - convert_to_long_ex(offset); - field_offset = Z_LVAL_PP(offset); - - if (field_offset<0 || field_offset >= result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset"); - RETURN_FALSE; - } - - result->cur_field = field_offset; - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto string sybase_result(int result, int row, mixed field) - Get result data */ -PHP_FUNCTION(sybase_result) -{ - zval **row, **field, **sybase_result_index; - int field_offset=0; - sybase_result *result; - - if (ZEND_NUM_ARGS() !=3 || zend_get_parameters_ex(3, &sybase_result_index, &row, &field)==FAILURE) { - WRONG_PARAM_COUNT; - } - - - ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); - - convert_to_long_ex(row); - - /* Unbuffered ? */ - if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && Z_LVAL_PP(row) >= result->num_rows) { - php_sybase_fetch_result_row(result, Z_LVAL_PP(row)); - } - - if (Z_LVAL_PP(row) < 0 || Z_LVAL_PP(row) >= result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset (%ld)", Z_LVAL_PP(row)); - RETURN_FALSE; - } - - switch(Z_TYPE_PP(field)) { - case IS_STRING: { - int i; - - for (i=0; inum_fields; i++) { - if (!strcasecmp(result->fields[i].name, Z_STRVAL_PP(field))) { - field_offset = i; - break; - } - } - if (i>=result->num_fields) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: %s field not found in result", Z_STRVAL_PP(field)); - RETURN_FALSE; - } - break; - } - default: - convert_to_long_ex(field); - field_offset = Z_LVAL_PP(field); - if (field_offset<0 || field_offset>=result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset specified"); - RETURN_FALSE; - } - break; - } - - *return_value = result->data[Z_LVAL_PP(row)][field_offset]; - zval_copy_ctor(return_value); -} -/* }}} */ - - -/* {{{ proto int sybase_affected_rows([int link_id]) - Get number of affected rows in last query */ -PHP_FUNCTION(sybase_affected_rows) -{ - zval **sybase_link_index; - sybase_link *sybase_ptr; - int id; - - switch(ZEND_NUM_ARGS()) { - case 0: - id = php_sybase_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - break; - case 1: - if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink); - - Z_LVAL_P(return_value) = sybase_ptr->affected_rows; - Z_TYPE_P(return_value) = IS_LONG; -} -/* }}} */ - - -PHP_MINFO_FUNCTION(sybase) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_header(2, "Sybase_CT Support", "enabled" ); - snprintf(buf, sizeof(buf), "%ld", SybCtG(num_persistent)); - php_info_print_table_row(2, "Active Persistent Links", buf); - snprintf(buf, sizeof(buf), "%ld", SybCtG(num_links)); - php_info_print_table_row(2, "Active Links", buf); - snprintf(buf, sizeof(buf), "%ld", SybCtG(min_server_severity)); - php_info_print_table_row(2, "Min server severity", buf); - snprintf(buf, sizeof(buf), "%ld", SybCtG(min_client_severity)); - php_info_print_table_row(2, "Min client severity", buf); - php_info_print_table_row(2, "Application Name", SybCtG(appname)); - snprintf(buf, sizeof(buf), "%ld", SybCtG(deadlock_retry_count)); - php_info_print_table_row(2, "Deadlock retry count", buf); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - - -/* {{{ proto void sybase_min_client_severity(int severity) - Sets minimum client severity */ -PHP_FUNCTION(sybase_min_client_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - SybCtG(min_client_severity) = Z_LVAL_PP(severity); -} -/* }}} */ - - -/* {{{ proto void sybase_min_server_severity(int severity) - Sets minimum server severity */ -PHP_FUNCTION(sybase_min_server_severity) -{ - zval **severity; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(severity); - SybCtG(min_server_severity) = Z_LVAL_PP(severity); -} -/* }}} */ - -/* {{{ proto void sybase_deadlock_retry_count(int retry_count) - Sets deadlock retry count */ -PHP_FUNCTION(sybase_deadlock_retry_count) -{ - zval **retry_count; - - if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &retry_count) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(retry_count); - SybCtG(deadlock_retry_count) = Z_LVAL_PP(retry_count); -} -/* }}} */ - - -/* {{{ proto bool sybase_set_message_handler(mixed error_func [, resource connection]) - Set the error handler, to be called when a server message is raised. - If error_func is NULL the handler will be deleted */ -PHP_FUNCTION(sybase_set_message_handler) -{ - zval **callback, **param, **sybase_link_index= NULL; - char *name; - sybase_link *sybase_ptr; - - switch (ZEND_NUM_ARGS()) { - case 1: /* Default message handler */ - if (zend_get_parameters_ex(1, ¶m) == FAILURE) { - RETURN_FALSE; - } - callback = &SybCtG(callback_name); - break; - - case 2: /* Connection-based message handler */ - if (zend_get_parameters_ex(2, ¶m, &sybase_link_index) == FAILURE) { - RETURN_FALSE; - } - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, -1, "Sybase-Link", le_link, le_plink); - callback = &sybase_ptr->callback_name; - break; - - default: - WRONG_PARAM_COUNT; - } - - /* Clean out old callback */ - if (*callback) { - zval_ptr_dtor(callback); - *callback = NULL; - } - - switch (Z_TYPE_PP(param)) { - case IS_NULL: - /* Return TRUE to indicate we deleted the message handler */ - RETURN_TRUE; - break; - - case IS_ARRAY: - case IS_STRING: - /* Either "function", array("class", "function") or array($object, "function") */ - if (!zend_is_callable(*param, 0, &name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argumented is expected to be a valid callback, '%s' was given", name); - efree(name); - RETURN_FALSE; - } - efree(name); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argumented is expected to be either NULL, an array or string, %s given", zend_zval_type_name(*param)); - RETURN_FALSE; - } - - ALLOC_ZVAL(*callback); - **callback = **param; - INIT_PZVAL(*callback); - zval_copy_ctor(*callback); - RETURN_TRUE; -} -/* }}} */ - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/sybase_ct/php_sybase_ct.h b/ext/sybase_ct/php_sybase_ct.h deleted file mode 100644 index 03e686aed822c..0000000000000 --- a/ext/sybase_ct/php_sybase_ct.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Zeev Suraski | - | Timm Friebe | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYBASE_CT_H -#define PHP_SYBASE_CT_H - -#if HAVE_SYBASE_CT - -#define CTLIB_VERSION CS_VERSION_100 - -extern zend_module_entry sybase_module_entry; -#define sybase_module_ptr &sybase_module_entry - -PHP_MINIT_FUNCTION(sybase); -PHP_MSHUTDOWN_FUNCTION(sybase); -PHP_RINIT_FUNCTION(sybase); -PHP_RSHUTDOWN_FUNCTION(sybase); -PHP_MINFO_FUNCTION(sybase); - -PHP_FUNCTION(sybase_connect); -PHP_FUNCTION(sybase_pconnect); -PHP_FUNCTION(sybase_close); -PHP_FUNCTION(sybase_select_db); -PHP_FUNCTION(sybase_query); -PHP_FUNCTION(sybase_unbuffered_query); -PHP_FUNCTION(sybase_free_result); -PHP_FUNCTION(sybase_get_last_message); -PHP_FUNCTION(sybase_num_rows); -PHP_FUNCTION(sybase_num_fields); -PHP_FUNCTION(sybase_fetch_row); -PHP_FUNCTION(sybase_fetch_array); -PHP_FUNCTION(sybase_fetch_assoc); -PHP_FUNCTION(sybase_fetch_object); -PHP_FUNCTION(sybase_data_seek); -PHP_FUNCTION(sybase_result); -PHP_FUNCTION(sybase_affected_rows); -PHP_FUNCTION(sybase_field_seek); -PHP_FUNCTION(sybase_min_client_severity); -PHP_FUNCTION(sybase_min_server_severity); -PHP_FUNCTION(sybase_fetch_field); -PHP_FUNCTION(sybase_set_message_handler); -PHP_FUNCTION(sybase_deadlock_retry_count); - -#include - -ZEND_BEGIN_MODULE_GLOBALS(sybase) - long default_link; - long num_links,num_persistent; - long max_links,max_persistent; - long login_timeout; - long allow_persistent; - char *appname; - char *hostname; - char *server_message; - long min_server_severity, min_client_severity; - long deadlock_retry_count; - zval *callback_name; - CS_CONTEXT *context; -ZEND_END_MODULE_GLOBALS(sybase) - -typedef struct { - CS_CONNECTION *connection; - CS_COMMAND *cmd; - int valid; - int deadlock; - int dead; - int active_result_index; - long affected_rows; - zval *callback_name; -} sybase_link; - -#define SYBASE_ROWS_BLOCK 128 - -typedef struct { - char *name,*column_source; - int max_length, numeric; - CS_INT type; -} sybase_field; - -typedef struct { - zval **data; - sybase_field *fields; - sybase_link *sybase_ptr; - int cur_row,cur_field; - int num_rows,num_fields; - - /* For unbuffered reads */ - CS_INT *lengths; - CS_SMALLINT *indicators; - char **tmp_buffer; - unsigned char *numerics; - CS_INT *types; - CS_DATAFMT *datafmt; - int blocks_initialized; - CS_RETCODE last_retcode; - int store; -} sybase_result; - -#ifdef ZTS -# define SybCtG(v) TSRMG(sybase_globals_id, zend_sybase_globals *, v) -#else -# define SybCtG(v) (sybase_globals.v) -#endif - -#else - -#define sybase_module_ptr NULL - -#endif - -#define phpext_sybase_ct_ptr sybase_module_ptr - -#endif /* PHP_SYBASE_CT_H */ diff --git a/ext/sybase_ct/sybase_ct.dsp b/ext/sybase_ct/sybase_ct.dsp deleted file mode 100644 index be2f890bab09a..0000000000000 --- a/ext/sybase_ct/sybase_ct.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sybase_ct" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=sybase_ct - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "sybase_ct.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "sybase_ct.mak" CFG="sybase_ct - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "sybase_ct - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "sybase_ct - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "sybase_ct - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D HAVE_SYBASE_CT=1 /D ZTS=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libct.lib libcs.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_sybase_ct.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "sybase_ct - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SYBASE_CT=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_sybase_ct.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "sybase_ct - Win32 Release_TS" -# Name "sybase_ct - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_sybase_ct.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_sybase_ct.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/sybase_ct/tests/bug22403.phpt b/ext/sybase_ct/tests/bug22403.phpt deleted file mode 100644 index 20d5248ff42a2..0000000000000 --- a/ext/sybase_ct/tests/bug22403.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -Sybase-CT bug #22403 (crash when executing a stored procedure without parameters) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -Stored procedure %s -bool(true) ->>> Query: exec %s -*** Caught Sybase Server Message #201 [Severity 16, state 2] at line 0 - %s -<<< Return: boolean -bool(false) ->>> Query: exec %s "foo" -*** Caught Sybase Server Message #257 [Severity 16, state 1] at line 0 - %s -<<< Return: boolean -bool(false) ->>> Query: exec does_not_exist -*** Caught Sybase Server Message #2812 [Severity 16, state %d] at line 1 - %s -<<< Return: boolean -bool(false) ->>> Query: exec %s NULL -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - NULL - } -} ->>> Query: exec %s 1 -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - int(1) - } -} -bool(true) diff --git a/ext/sybase_ct/tests/bug26407.phpt b/ext/sybase_ct/tests/bug26407.phpt deleted file mode 100644 index 35bf6df7ada3a..0000000000000 --- a/ext/sybase_ct/tests/bug26407.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -Sybase-CT bug #26407 (Result set fetching broken around transactions) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) ->>> Query: - begin transaction - -- anything producing a result set here will fail; - -- however, print or update statements will work - select "foo" - commit - -- anything afterwards will fail, too - -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - string(3) "foo" - } -} ->>> Query: - begin transaction - -- no result returned... - update #phpt_bug26407 set the_big_answer=42 - commit - -<<< Return: boolean -bool(true) ->>> Query: - select "foo" - begin transaction - -- do anything, even return a result set - commit - select "bar" - - -Notice: sybase_query(): Sybase: Unexpected results, cancelling current in %stest.inc on line %d -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - string(3) "foo" - } -} diff --git a/ext/sybase_ct/tests/bug27843.phpt b/ext/sybase_ct/tests/bug27843.phpt deleted file mode 100644 index 861d1f95e7da3..0000000000000 --- a/ext/sybase_ct/tests/bug27843.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -Sybase-CT bug #27843 (notices when query is a stored procedure) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -Stored procedure %s -bool(true) ->>> Query: exec phpt_bug27843 -<<< Return: resource -array(1) { - [0]=> - array(1) { - ["computed"]=> - int(1) - } -} -bool(true) diff --git a/ext/sybase_ct/tests/bug28354.phpt b/ext/sybase_ct/tests/bug28354.phpt deleted file mode 100644 index 018f7bddec6aa..0000000000000 --- a/ext/sybase_ct/tests/bug28354.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Sybase-CT bug #28354 (sybase_free_result crash) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -Stored procedure %s -bool(true) -int(0) -string(%d) "%s" diff --git a/ext/sybase_ct/tests/bug29064.phpt b/ext/sybase_ct/tests/bug29064.phpt deleted file mode 100644 index df13d28a1d8c7..0000000000000 --- a/ext/sybase_ct/tests/bug29064.phpt +++ /dev/null @@ -1,143 +0,0 @@ ---TEST-- -Sybase-CT bug #29064 (Exact numeric/decimal/money datatypes lose precision) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -bool(true) -bool(true) ->>> Query: select * from #test -<<< Return: resource -array(2) { - [0]=> - array(10) { - ["test_decimal"]=> - string(39) "12345678901234567890123456789012.123456" - ["test_numeric"]=> - string(39) "12345678901234567890123456.123456789012" - ["test_money"]=> - string(18) "123456789012345.12" - ["test_bigint"]=> - string(38) "12345678901234567890123456789012345678" - ["test_int"]=> - int(1234567890) - ["test_smallmoney"]=> - float(123456.12) - ["test_smallint"]=> - int(12345) - ["test_tinyint"]=> - int(123) - ["test_real"]=> - string(18) "123456789.12345679" - ["test_double"]=> - string(18) "123456789.12345679" - } - [1]=> - array(10) { - ["test_decimal"]=> - string(40) "-12345678901234567890123456789012.123456" - ["test_numeric"]=> - string(40) "-12345678901234567890123456.123456789012" - ["test_money"]=> - string(19) "-123456789012345.12" - ["test_bigint"]=> - string(39) "-12345678901234567890123456789012345678" - ["test_int"]=> - int(-1234567890) - ["test_smallmoney"]=> - float(-123456.12) - ["test_smallint"]=> - int(-12345) - ["test_tinyint"]=> - int(255) - ["test_real"]=> - string(19) "-123456789.12345679" - ["test_double"]=> - string(19) "-123456789.12345679" - } -} -bool(true) diff --git a/ext/sybase_ct/tests/bug30312.phpt b/ext/sybase_ct/tests/bug30312.phpt deleted file mode 100644 index 273b579d610a4..0000000000000 --- a/ext/sybase_ct/tests/bug30312.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Sybase-CT bug #30312 (sybase_unbuffered_query calls) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -int(%d) -int(%d) diff --git a/ext/sybase_ct/tests/bug6339.phpt b/ext/sybase_ct/tests/bug6339.phpt deleted file mode 100644 index 3b0a072b4a10e..0000000000000 --- a/ext/sybase_ct/tests/bug6339.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Sybase-CT bug #6339 (invalid Sybase-link resource) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(1) { - [0]=> - int(1) -} diff --git a/ext/sybase_ct/tests/index.php b/ext/sybase_ct/tests/index.php deleted file mode 100644 index 47202efa3b524..0000000000000 --- a/ext/sybase_ct/tests/index.php +++ /dev/null @@ -1,216 +0,0 @@ -expected= $expected; - } - - function matches($output) { } - } - // }}} - - // {{{ class PHPTRegexExpectancy - // Expectancy class for regular expressions - class PHPTRegexExpectancy extends PHPTExpectancy { - - function matches($output) { - return preg_match('°^'.strtr(preg_quote(rtrim($this->expected), '°'), array( - '%s' => '(.+)', - '%d' => '([0-9]+)' - )).'°', $output); - } - } - // }}} - - // {{{ class PHPTTest - // Represents a single .phpt-style test - class PHPTTest { - var - $name = '', - $description = '', - $skipif = '', - $code = '', - $expectancy = NULL, - $output = ''; - - function &fromFile($filename) { - $fd= fopen($filename, 'r'); - - $sections= array(); - $current= NULL; - while (!feof($fd)) { - $line= fgets($fd, 0xFFFF); - if (1 == sscanf($line, '--%[^-]--', $section)) { - $sections[$section]= ''; - $current= $section; - continue; - } - $sections[$current].= $line; - } - fclose($fd); - - // Create instance from read data and return it - $t= &new PHPTTest(); { - $t->name= substr(realpath($filename), 0, -1); - $t->description= rtrim($sections['TEST']); - $t->skipif= $sections['SKIPIF']; - $t->code= $sections['FILE']; - - if (isset($sections['EXPECTF'])) { - $t->expectancy= &new PHPTRegexExpectancy($sections['EXPECTF']); - } else { - // XXX TBI XXX - } - } - return $t; - } - - function onError($errno, $errstr, $errfile, $errline) { - static $names= array( - E_NOTICE => 'Notice', - E_WARNING => 'Warning' - ); - - if (!(error_reporting() & $errno)) return; - printf( - "\n%s: %s in %s on line %d\n", - $names[$errno], - $errstr, - strstr($errfile, 'eval()\'d code') ? $this->name : $errfile, - $errline - ); - } - - function run() { - - // Precondition check - will die if test needs to be skipped - eval('?>'.$this->skipif); - - set_error_handler(array(&$this, 'onError')); { - error_reporting(E_ALL); - - ob_start(); - eval('?>'.$this->code); - $this->output= rtrim(ob_get_contents()); - ob_end_clean(); - } restore_error_handler(); - - return $this->expectancy->matches($this->output); - } - } - // }}} - - // {{{ main - if (isset($_GET['phpinfo'])) { - phpinfo((int)$_GET['phpinfo']); - - echo 'Home'; - exit(); - } - - echo <<<__ - - - PHPT Test - - - -__; - - $test= basename($_SERVER['QUERY_STRING']); - if ($test && file_exists($test)) { - $t= &PHPTTest::fromFile($test); - echo '

'.basename($t->name), ': ', $t->description.'

'; - echo 'Back to test suite'; - flush(); - - // Run the test - $result= $t->run(); - - // Evaluate results - if ($result) { - echo '

Passed

'; - } else { - echo '

Failed


'; - - echo '

Actual output

'; - echo '', $t->output, '
'; - - echo '

Expectancy

'; - echo '', $t->expectancy->expected, ''; - } - - echo '
'; - exit(); - } - - echo '

Test suite

'; - - // phpinfo() links - echo 'phpinfo(): '; - foreach (array( - 1 => 'General', - 4 => 'Configuration', - 8 => 'Modules' - ) as $const => $name) { - printf('%s | ', $const, $name); - } - echo '(All)'; - - echo '

Select one to run

'; - echo '
    '; - $d= dir(dirname(__FILE__)); - while ($entry= $d->read()) { - if ('.phpt' != substr($entry, -5)) continue; - echo '
  • '.$entry.'
  • '; - } - $d->close(); - echo '

'; - - echo <<<__ - - -__; - // }}} -?> diff --git a/ext/sybase_ct/tests/skipif.inc b/ext/sybase_ct/tests/skipif.inc deleted file mode 100644 index 55bf53aa7798a..0000000000000 --- a/ext/sybase_ct/tests/skipif.inc +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/ext/sybase_ct/tests/test.inc b/ext/sybase_ct/tests/test.inc deleted file mode 100644 index 107a74d856c95..0000000000000 --- a/ext/sybase_ct/tests/test.inc +++ /dev/null @@ -1,86 +0,0 @@ ->> Query: %s\n", $query); - $h= sybase_query($query, $dbh); - printf("<<< Return: %s\n", gettype($h)); - flush(); - if (!is_resource($h)) return $h; - - $return= array(); - while ($row= sybase_fetch_assoc($h)) { - $return[]= $row; - } - return $return; - } - - // {{{ mixed sybase_select_single(resource dbh, string query) - // Fires an SQL query and returns the first value from the first row - function sybase_select_single($dbh, $query) { - $a = sybase_fetch_row(sybase_query($query, $dbh)); - return array_shift($a); - } - // }}} -?> diff --git a/ext/sybase_ct/tests/test_appname.phpt b/ext/sybase_ct/tests/test_appname.phpt deleted file mode 100644 index 71f5c32f4de84..0000000000000 --- a/ext/sybase_ct/tests/test_appname.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Sybase-CT application name ---SKIPIF-- - ---FILE-- - ---EXPECTF-- ->>> Query: - select - hostname, - program_name - from - master..sysprocesses - where - program_name = "phpt_test" -<<< Return: resource -bool(true) -bool(true) diff --git a/ext/sybase_ct/tests/test_connect.phpt b/ext/sybase_ct/tests/test_connect.phpt deleted file mode 100644 index e1e3eead389cc..0000000000000 --- a/ext/sybase_ct/tests/test_connect.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Sybase-CT connectivity ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (sybase-ct link) diff --git a/ext/sybase_ct/tests/test_connectionbased_msghandler.phpt b/ext/sybase_ct/tests/test_connectionbased_msghandler.phpt deleted file mode 100644 index 72e6b3a8dc12b..0000000000000 --- a/ext/sybase_ct/tests/test_connectionbased_msghandler.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Sybase-CT connection-based server message handler ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (sybase-ct link) -bool(true) ->>> Query: select getdate(NULL) -*** Caught Sybase Server Message #%d [Severity %d, state %d] at line %d - %s -<<< Return: boolean -bool(false) diff --git a/ext/sybase_ct/tests/test_fetch_object.phpt b/ext/sybase_ct/tests/test_fetch_object.phpt deleted file mode 100644 index c23658fa35d37..0000000000000 --- a/ext/sybase_ct/tests/test_fetch_object.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Sybase-CT sybase_fetch_object ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -stdClass::__set_state(array( - 'id' => 1, - 'caption' => 'Hello', - 'author' => 'timm', - 'lastchange' => '%s', -)) -article::__set_state(array( - 'id' => 1, - 'caption' => 'Hello', - 'author' => 'timm', - 'lastchange' => '%s', -)) -article::__set_state(array( - 'id' => 1, - 'caption' => 'Hello', - 'author' => 'timm', - 'lastchange' => '%s', -)) - -Notice: sybase_fetch_object(): Sybase: Class *** has not been declared in %stest_fetch_object.php on line %d -stdClass::__set_state(array( - 'id' => 1, - 'caption' => 'Hello', - 'author' => 'timm', - 'lastchange' => '%s', -)) diff --git a/ext/sybase_ct/tests/test_fields.phpt b/ext/sybase_ct/tests/test_fields.phpt deleted file mode 100644 index 46e932b85d50f..0000000000000 --- a/ext/sybase_ct/tests/test_fields.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -Sybase-CT sybase_field_* functions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (sybase-ct result) -int(4) -stdClass::__set_state(array( - 'name' => 'id', - 'max_length' => 11, - 'column_source' => '', - 'numeric' => 1, - 'type' => 'int', -)) -stdClass::__set_state(array( - 'name' => 'caption', - 'max_length' => 5, - 'column_source' => '', - 'numeric' => 0, - 'type' => 'string', -)) -stdClass::__set_state(array( - 'name' => 'author', - 'max_length' => 4, - 'column_source' => '', - 'numeric' => 0, - 'type' => 'string', -)) -stdClass::__set_state(array( - 'name' => 'lastchange', - 'max_length' => 29, - 'column_source' => '', - 'numeric' => 0, - 'type' => 'datetime', -)) -bool(true) -stdClass::__set_state(array( - 'name' => 'caption', - 'max_length' => 5, - 'column_source' => '', - 'numeric' => 0, - 'type' => 'string', -)) diff --git a/ext/sybase_ct/tests/test_long.phpt b/ext/sybase_ct/tests/test_long.phpt deleted file mode 100644 index de59bb93cbdf0..0000000000000 --- a/ext/sybase_ct/tests/test_long.phpt +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -Sybase-CT select LONG_MAX / LONG_MIN ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) ->>> Query: select value from test_long -<<< Return: resource -array(6) { - [0]=> - array(1) { - ["value"]=> - int(%s) - } - [1]=> - array(1) { - ["value"]=> - int(%s) - } - [2]=> - array(1) { - ["value"]=> - float(%s) - } - [3]=> - array(1) { - ["value"]=> - int(-%s) - } - [4]=> - array(1) { - ["value"]=> - int(-%s) - } - [5]=> - array(1) { - ["value"]=> - float(-%s) - } -} -bool(true) diff --git a/ext/sybase_ct/tests/test_msghandler.phpt b/ext/sybase_ct/tests/test_msghandler.phpt deleted file mode 100644 index d97fe3f76c963..0000000000000 --- a/ext/sybase_ct/tests/test_msghandler.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Sybase-CT server message handler ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Nonexistant: -Warning: sybase_set_message_handler(): First argumented is expected to be a valid callback, 'function_does_not_exist' was given in %stest.inc on line %d -bool(false) -Static method: bool(true) -Instance method: bool(true) -Lambda function: bool(true) -Unset: bool(true) -Incorrect type: -Warning: sybase_set_message_handler(): First argumented is expected to be either NULL, an array or string, integer given in %stest.inc on line %d -bool(false) -Function: bool(true) ->>> Query: select getdate(NULL) -*** Caught Sybase Server Message #%d [Severity %d, state %d] at line %d - %s -<<< Return: boolean -bool(false) diff --git a/ext/sybase_ct/tests/test_msghandler_handled.phpt b/ext/sybase_ct/tests/test_msghandler_handled.phpt deleted file mode 100644 index 5952c3b00b6e5..0000000000000 --- a/ext/sybase_ct/tests/test_msghandler_handled.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -Sybase-CT server message handler ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) ->>> Query: select getdate(NULL) -*** Caught '%s' -<<< Return: boolean -bool(false) ->>> Query: print "Hi" -!!! Hi -<<< Return: boolean -bool(true) ->>> Query: use NULL -Cannot handle message #156 - -Warning: sybase_query(): Sybase: Server message: Incorrect syntax near the keyword 'NULL'. - (severity 15, procedure N/A) in %s on line %d -<<< Return: boolean -bool(false) ->>> Query: select convert(datetime, "notadate") -Cannot handle message #249 - -Warning: sybase_query(): Sybase: Server message: Syntax error during explicit conversion of VARCHAR value 'notadate' to a DATETIME field. - (severity 16, procedure N/A) in %s on line %d -<<< Return: boolean -bool(false) diff --git a/ext/sybase_ct/tests/test_query_nostore.phpt b/ext/sybase_ct/tests/test_query_nostore.phpt deleted file mode 100644 index 9d717ec2fd64a..0000000000000 --- a/ext/sybase_ct/tests/test_query_nostore.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -Sybase-CT query without storing ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -bool(true) -bool(true) -bool(true) -resource(%d) of type (sybase-ct result) -array(5) { - ["id"]=> - int(1) - ["caption"]=> - string(5) "Hello" - ["author"]=> - string(4) "timm" - ["link"]=> - NULL - ["lastchange"]=> - string(%d) "%s" -} -array(5) { - ["id"]=> - int(2) - ["caption"]=> - string(5) "World" - ["author"]=> - string(6) "thekid" - ["link"]=> - string(17) "http://thekid.de/" - ["lastchange"]=> - string(%d) "%s" -} -array(5) { - ["id"]=> - int(3) - ["caption"]=> - string(3) "PHP" - ["author"]=> - string(6) "friebe" - ["link"]=> - NULL - ["lastchange"]=> - string(%d) "%s" -} -bool(true) diff --git a/ext/sybase_ct/tests/test_types.phpt b/ext/sybase_ct/tests/test_types.phpt deleted file mode 100644 index 735c02d8437a4..0000000000000 --- a/ext/sybase_ct/tests/test_types.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -Sybase-CT select and types ---SKIPIF-- - ---FILE-- - ---EXPECTF-- ->>> Query: select - 1 as "integer", - -%s as "integer_min", - -%s as "integer_min_exceed", - %s as "integer_max", - %s as "integer_max_exceed", - 1.0 as "float", - 12345678901234567890123456789012.123456 as "large_float", - $22.36 as "money", - "Binford" as "string", - convert(datetime, "2004-01-23") as "date", - NULL as "null", - convert(bit, 1) as "bit", - convert(smalldatetime, "2004-01-23") as "smalldate", - convert(char(10), "char") as "char10" - -<<< Return: resource -array(1) { - [0]=> - array(%d) { - ["integer"]=> - int(1) - ["integer_min"]=> - int(-%s) - ["integer_min_exceed"]=> - float(-%s) - ["integer_max"]=> - int(%s) - ["integer_max_exceed"]=> - float(%s) - ["float"]=> - float(1) - ["large_float"]=> - string(39) "12345678901234567890123456789012.123456" - ["money"]=> - float(22.36) - ["string"]=> - string(7) "Binford" - ["date"]=> - string(19) "Jan 23 2004 12:00AM" - ["null"]=> - NULL - ["bit"]=> - int(1) - ["smalldate"]=> - string(19) "Jan 23 2004 12:00AM" - ["char10"]=> - string(10) "char " - } -} diff --git a/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt b/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt deleted file mode 100644 index eecd02cf63c01..0000000000000 --- a/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Sybase-CT unbuffered query without full fetching ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (sybase-ct link) -resource(%d) of type (sybase-ct result) -string(4) "name" - -Notice: sybase_unbuffered_query(): called without first fetching all rows from a previous unbuffered query in %s on line %d -resource(%d) of type (sybase-ct result) -string(4) "name" -CLOSED diff --git a/ext/sybase_ct/tests/test_unbuffered_query.phpt b/ext/sybase_ct/tests/test_unbuffered_query.phpt deleted file mode 100644 index b2be2f2304bf5..0000000000000 --- a/ext/sybase_ct/tests/test_unbuffered_query.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Sybase-CT unbuffered query ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -resource(%d) of type (sybase-ct link) -resource(%d) of type (sybase-ct result) -int(%d) -int(%d) -bool(true) -resource(%d) of type (sybase-ct result) -resource(%d) of type (Unknown) - -Warning: sybase_num_rows(): %d is not a valid Sybase result resource in %stest_unbuffered_query.php on line %d -bool(true) -resource(%d) of type (sybase-ct result) -int(%d) -int(%d) -int(4) diff --git a/ext/sysvmsg/CREDITS b/ext/sysvmsg/CREDITS deleted file mode 100644 index 6b150d5301455..0000000000000 --- a/ext/sysvmsg/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -System V Message based IPC -Wez Furlong diff --git a/ext/sysvmsg/config.m4 b/ext/sysvmsg/config.m4 deleted file mode 100644 index 4ae8a2e6962b4..0000000000000 --- a/ext/sysvmsg/config.m4 +++ /dev/null @@ -1,14 +0,0 @@ -dnl $Id$ - -PHP_ARG_ENABLE(sysvmsg,whether to enable System V IPC support, -[ --enable-sysvmsg Enable sysvmsg support]) - -if test "$PHP_SYSVMSG" != "no"; then - AC_CHECK_HEADER([sys/msg.h], - [], - [AC_MSG_ERROR([Cannot enable System V IPC support, sys/msg.h is missing]) - ]) - - AC_DEFINE(HAVE_SYSVMSG, 1, [ ]) - PHP_NEW_EXTENSION(sysvmsg, sysvmsg.c, $ext_shared) -fi diff --git a/ext/sysvmsg/package.xml b/ext/sysvmsg/package.xml deleted file mode 100644 index 403e949d359f1..0000000000000 --- a/ext/sysvmsg/package.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - sysvmsg - Unix System V IPC Message Queues - - - wez - Wez Furlong - wez@php.net - lead - - - -Unix System V IPC Message Queues - - PHP - - stable - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - diff --git a/ext/sysvmsg/php_sysvmsg.h b/ext/sysvmsg/php_sysvmsg.h deleted file mode 100644 index d19a593c9abcd..0000000000000 --- a/ext/sysvmsg/php_sysvmsg.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYSVMSG_H -#define PHP_SYSVMSG_H - -#if HAVE_SYSVMSG - -extern zend_module_entry sysvmsg_module_entry; -#define phpext_sysvmsg_ptr &sysvmsg_module_entry - -#ifndef __USE_GNU -/* we want to use mtype instead of __mtype */ -#define __USE_GNU -#endif - -#include -#include -#include - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(sysvmsg); -PHP_MINFO_FUNCTION(sysvmsg); - -PHP_FUNCTION(msg_get_queue); -PHP_FUNCTION(msg_remove_queue); -PHP_FUNCTION(msg_stat_queue); -PHP_FUNCTION(msg_set_queue); -PHP_FUNCTION(msg_send); -PHP_FUNCTION(msg_receive); - -typedef struct { - key_t key; - long id; -} sysvmsg_queue_t; - -struct php_msgbuf { - long mtype; - char mtext[1]; -}; - -#endif /* HAVE_SYSVMSG */ - -#endif /* PHP_SYSVMSG_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c deleted file mode 100644 index b51a3f94dffea..0000000000000 --- a/ext/sysvmsg/sysvmsg.c +++ /dev/null @@ -1,437 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "php_sysvmsg.h" -#include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" - -/* In order to detect MSG_EXCEPT use at run time; we have no way - * of knowing what the bit definitions are, so we can't just define - * out own MSG_EXCEPT value. */ -#define PHP_MSG_IPC_NOWAIT 1 -#define PHP_MSG_NOERROR 2 -#define PHP_MSG_EXCEPT 4 - -/* True global resources - no need for thread safety here */ -static int le_sysvmsg; - -static - ZEND_BEGIN_ARG_INFO(sixth_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(msg_receive_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -/* {{{ sysvmsg_functions[] - * - * Every user visible function must have an entry in sysvmsg_functions[]. - */ -zend_function_entry sysvmsg_functions[] = { - PHP_FE(msg_get_queue, NULL) - PHP_FE(msg_send, sixth_arg_force_ref) - PHP_FE(msg_receive, msg_receive_args_force_ref) - PHP_FE(msg_remove_queue, NULL) - PHP_FE(msg_stat_queue, NULL) - PHP_FE(msg_set_queue, NULL) - {NULL, NULL, NULL} /* Must be the last line in sysvmsg_functions[] */ -}; -/* }}} */ - -/* {{{ sysvmsg_module_entry - */ -zend_module_entry sysvmsg_module_entry = { - STANDARD_MODULE_HEADER, - "sysvmsg", - sysvmsg_functions, - PHP_MINIT(sysvmsg), - NULL, - NULL, - NULL, - PHP_MINFO(sysvmsg), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_SYSVMSG -ZEND_GET_MODULE(sysvmsg) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -static void sysvmsg_release(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sysvmsg_queue_t * mq = (sysvmsg_queue_t *) rsrc->ptr; - efree(mq); -} - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(sysvmsg) -{ - le_sysvmsg = zend_register_list_destructors_ex(sysvmsg_release, NULL, "sysvmsg queue", module_number); - REGISTER_LONG_CONSTANT("MSG_IPC_NOWAIT", PHP_MSG_IPC_NOWAIT, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("MSG_EAGAIN", EAGAIN, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("MSG_ENOMSG", ENOMSG, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("MSG_NOERROR", PHP_MSG_NOERROR, CONST_PERSISTENT|CONST_CS); - REGISTER_LONG_CONSTANT("MSG_EXCEPT", PHP_MSG_EXCEPT, CONST_PERSISTENT|CONST_CS); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(sysvmsg) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "sysvmsg support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision$"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ proto bool msg_set_queue(resource queue, array data) - Set information for a message queue */ -PHP_FUNCTION(msg_set_queue) -{ - zval *queue, *data; - sysvmsg_queue_t *mq = NULL; - struct msqid_ds stat; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &queue, &data) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg); - - if (msgctl(mq->id, IPC_STAT, &stat) == 0) { - zval **item; - - /* now pull out members of data and set them in the stat buffer */ - if (zend_hash_find(Z_ARRVAL_P(data), "msg_perm.uid", sizeof("msg_perm.uid"), (void **) &item) == SUCCESS) { - convert_to_long_ex(item); - stat.msg_perm.uid = Z_LVAL_PP(item); - } - if (zend_hash_find(Z_ARRVAL_P(data), "msg_perm.gid", sizeof("msg_perm.gid"), (void **) &item) == SUCCESS) { - convert_to_long_ex(item); - stat.msg_perm.gid = Z_LVAL_PP(item); - } - if (zend_hash_find(Z_ARRVAL_P(data), "msg_perm.mode", sizeof("msg_perm.mode"), (void **) &item) == SUCCESS) { - convert_to_long_ex(item); - stat.msg_perm.mode = Z_LVAL_PP(item); - } - if (zend_hash_find(Z_ARRVAL_P(data), "msg_qbytes", sizeof("msg_qbytes"), (void **) &item) == SUCCESS) { - convert_to_long_ex(item); - stat.msg_qbytes = Z_LVAL_PP(item); - } - if (msgctl(mq->id, IPC_SET, &stat) == 0) { - RETVAL_TRUE; - } - } -} -/* }}} */ - -/* {{{ proto array msg_stat_queue(resource queue) - Returns information about a message queue */ -PHP_FUNCTION(msg_stat_queue) -{ - zval *queue; - sysvmsg_queue_t *mq = NULL; - struct msqid_ds stat; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg); - - if (msgctl(mq->id, IPC_STAT, &stat) == 0) { - array_init(return_value); - - add_assoc_long(return_value, "msg_perm.uid", stat.msg_perm.uid); - add_assoc_long(return_value, "msg_perm.gid", stat.msg_perm.gid); - add_assoc_long(return_value, "msg_perm.mode", stat.msg_perm.mode); - add_assoc_long(return_value, "msg_stime", stat.msg_stime); - add_assoc_long(return_value, "msg_rtime", stat.msg_rtime); - add_assoc_long(return_value, "msg_ctime", stat.msg_ctime); - add_assoc_long(return_value, "msg_qnum", stat.msg_qnum); - add_assoc_long(return_value, "msg_qbytes", stat.msg_qbytes); - add_assoc_long(return_value, "msg_lspid", stat.msg_lspid); - add_assoc_long(return_value, "msg_lrpid", stat.msg_lrpid); - } -} -/* }}} */ - -/* {{{ proto resource msg_get_queue(int key [, int perms]) - Attach to a message queue */ -PHP_FUNCTION(msg_get_queue) -{ - long key; - long perms = 0666; - sysvmsg_queue_t *mq; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &key, &perms) == FAILURE) { - return; - } - - mq = (sysvmsg_queue_t *) emalloc(sizeof(sysvmsg_queue_t)); - - mq->key = key; - mq->id = msgget(key, 0); - if (mq->id < 0) { - /* doesn't already exist; create it */ - mq->id = msgget(key, IPC_CREAT | IPC_EXCL | perms); - if (mq->id < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - efree(mq); - RETURN_FALSE; - } - } - RETVAL_RESOURCE(zend_list_insert(mq, le_sysvmsg)); -} -/* }}} */ - -/* {{{ proto bool msg_remove_queue(resource queue) - Destroy the queue */ -PHP_FUNCTION(msg_remove_queue) -{ - zval *queue; - sysvmsg_queue_t *mq = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg); - - if (msgctl(mq->id, IPC_RMID, NULL) == 0) { - RETVAL_TRUE; - } else { - RETVAL_FALSE; - } -} -/* }}} */ - -/* {{{ proto mixed msg_receive(resource queue, int desiredmsgtype, int &msgtype, int maxsize, mixed message [, bool unserialize=true [, int flags=0 [, int errorcode]]]) - Send a message of type msgtype (must be > 0) to a message queue */ -PHP_FUNCTION(msg_receive) -{ - zval *out_message, *queue, *out_msgtype, *zerrcode = NULL; - long desiredmsgtype, maxsize, flags = 0; - long realflags = 0; - zend_bool do_unserialize = 1; - sysvmsg_queue_t *mq = NULL; - struct php_msgbuf *messagebuffer = NULL; /* buffer to transmit */ - int result; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlzlz|blz", - &queue, &desiredmsgtype, &out_msgtype, &maxsize, - &out_message, &do_unserialize, &flags, &zerrcode) == FAILURE) { - return; - } - - if (maxsize <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "maximum size of the message has to be greater than zero"); - return; - } - - if (flags != 0) { - if (flags & PHP_MSG_EXCEPT) { -#ifndef MSG_EXCEPT - php_error_docref(NULL TSRMLS_CC, E_WARNING, "MSG_EXCEPT is not supported on your system"); - RETURN_FALSE; -#else - realflags |= MSG_EXCEPT; -#endif - } - if (flags & PHP_MSG_NOERROR) { - realflags |= MSG_NOERROR; - } - if (flags & PHP_MSG_IPC_NOWAIT) { - realflags |= IPC_NOWAIT; - } - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, &queue, -1, "sysvmsg queue", le_sysvmsg); - - messagebuffer = (struct php_msgbuf *) safe_emalloc(maxsize, 1, sizeof(struct php_msgbuf)); - - result = msgrcv(mq->id, messagebuffer, maxsize, desiredmsgtype, realflags); - - zval_dtor(out_msgtype); - zval_dtor(out_message); - ZVAL_LONG(out_msgtype, 0); - ZVAL_FALSE(out_message); - - if (zerrcode) { - zval_dtor(zerrcode); - ZVAL_LONG(zerrcode, 0); - } - - if (result >= 0) { - /* got it! */ - ZVAL_LONG(out_msgtype, messagebuffer->mtype); - - RETVAL_TRUE; - if (do_unserialize) { - php_unserialize_data_t var_hash; - zval *tmp = NULL; - const unsigned char *p = (const unsigned char *) messagebuffer->mtext; - - MAKE_STD_ZVAL(tmp); - PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (!php_var_unserialize(&tmp, &p, p + result, &var_hash TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "message corrupted"); - RETVAL_FALSE; - } else { - REPLACE_ZVAL_VALUE(&out_message, tmp, 0); - } - FREE_ZVAL(tmp); - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - } else { - ZVAL_STRINGL(out_message, messagebuffer->mtext, result, 1); - } - } else if (zerrcode) { - ZVAL_LONG(zerrcode, errno); - } - efree(messagebuffer); -} -/* }}} */ - -/* {{{ proto bool msg_send(resource queue, int msgtype, mixed message [, bool serialize=true [, bool blocking=true [, int errorcode]]]) - Send a message of type msgtype (must be > 0) to a message queue */ -PHP_FUNCTION(msg_send) -{ - zval *message, *queue, *zerror=NULL; - long msgtype; - zend_bool do_serialize = 1, blocking = 1; - sysvmsg_queue_t * mq = NULL; - struct php_msgbuf * messagebuffer = NULL; /* buffer to transmit */ - int result; - int message_len = 0; - - RETVAL_FALSE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz|bbz", - &queue, &msgtype, &message, &do_serialize, &blocking, &zerror) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t*, &queue, -1, "sysvmsg queue", le_sysvmsg); - - if (do_serialize) { - smart_str msg_var = {0}; - php_serialize_data_t var_hash; - - PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&msg_var, &message, &var_hash TSRMLS_CC); - PHP_VAR_SERIALIZE_DESTROY(var_hash); - - /* NB: php_msgbuf is 1 char bigger than a long, so there is no need to - * allocate the extra byte. */ - messagebuffer = safe_emalloc(msg_var.len, 1, sizeof(struct php_msgbuf)); - memcpy(messagebuffer->mtext, msg_var.c, msg_var.len + 1); - message_len = msg_var.len; - smart_str_free(&msg_var); - } else { - char *p; - switch (Z_TYPE_P(message)) { - case IS_STRING: - p = Z_STRVAL_P(message); - message_len = Z_STRLEN_P(message); - break; - - case IS_LONG: - case IS_BOOL: - message_len = spprintf(&p, 0, "%ld", Z_LVAL_P(message)); - break; - - case IS_DOUBLE: - message_len = spprintf(&p, 0, "%F", Z_DVAL_P(message)); - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Message parameter must be either a string or a number."); - RETURN_FALSE; - } - - messagebuffer = safe_emalloc(message_len, 1, sizeof(struct php_msgbuf)); - memcpy(messagebuffer->mtext, p, message_len + 1); - - if (Z_TYPE_P(message) != IS_STRING) { - efree(p); - } - } - - /* set the message type */ - messagebuffer->mtype = msgtype; - - result = msgsnd(mq->id, messagebuffer, message_len, blocking ? 0 : IPC_NOWAIT); - - efree(messagebuffer); - - if (result == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "msgsnd failed: %s", strerror(errno)); - if (zerror) { - ZVAL_LONG(zerror, errno); - } - } else { - RETVAL_TRUE; - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 tw=78 fdm=marker - * vim<600: noet sw=4 ts=4 tw=78 - */ diff --git a/ext/sysvmsg/tests/001.phpt b/ext/sysvmsg/tests/001.phpt deleted file mode 100644 index d3a5b1e3e6d61..0000000000000 --- a/ext/sysvmsg/tests/001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -send/receive serialized message. ---SKIPIF-- - ---FILE-- - ---EXPECT-- -TYPE: 1 -DATA: hello diff --git a/ext/sysvmsg/tests/002.phpt b/ext/sysvmsg/tests/002.phpt deleted file mode 100644 index e603ed02b5e04..0000000000000 --- a/ext/sysvmsg/tests/002.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -msg_receive() should return false when unserialize() failed ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: msg_receive(): message corrupted in %s002.php on line %d -bool(false) -Done diff --git a/ext/sysvsem/CREDITS b/ext/sysvsem/CREDITS deleted file mode 100644 index 45232809f01ba..0000000000000 --- a/ext/sysvsem/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -System V Semaphores -Tom May diff --git a/ext/sysvsem/config.m4 b/ext/sysvsem/config.m4 deleted file mode 100644 index bfb5d92f4ea37..0000000000000 --- a/ext/sysvsem/config.m4 +++ /dev/null @@ -1,29 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(sysvsem,whether to enable System V semaphore support, -[ --enable-sysvsem Enable System V semaphore support]) - -if test "$PHP_SYSVSEM" != "no"; then - PHP_NEW_EXTENSION(sysvsem, sysvsem.c, $ext_shared) - AC_DEFINE(HAVE_SYSVSEM, 1, [ ]) - AC_CACHE_CHECK(for union semun,php_cv_semun, - AC_TRY_COMPILE([ -#include -#include -#include - ], - [union semun x;], - [ - php_cv_semun=yes - ],[ - php_cv_semun=no - ]) - ) - if test "$php_cv_semun" = "yes"; then - AC_DEFINE(HAVE_SEMUN, 1, [ ]) - else - AC_DEFINE(HAVE_SEMUN, 0, [ ]) - fi -fi diff --git a/ext/sysvsem/package.xml b/ext/sysvsem/package.xml deleted file mode 100644 index 6c40af0e3b4d7..0000000000000 --- a/ext/sysvsem/package.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - sysvsem - Unix System V IPC Semaphores - - - ??? - Tom May - tom@go2net.com - lead - - - -Unix System V IPC Semaphores - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - diff --git a/ext/sysvsem/php_sysvsem.h b/ext/sysvsem/php_sysvsem.h deleted file mode 100644 index 8297e0cd727c9..0000000000000 --- a/ext/sysvsem/php_sysvsem.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Tom May | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYSVSEM_H -#define PHP_SYSVSEM_H - -#if HAVE_SYSVSEM - -extern zend_module_entry sysvsem_module_entry; -#define sysvsem_module_ptr &sysvsem_module_entry - -PHP_MINIT_FUNCTION(sysvsem); -PHP_FUNCTION(sem_get); -PHP_FUNCTION(sem_acquire); -PHP_FUNCTION(sem_release); -PHP_FUNCTION(sem_remove); - -typedef struct { - int le_sem; -} sysvsem_module; - -typedef struct { - int id; /* For error reporting. */ - int key; /* For error reporting. */ - int semid; /* Returned by semget(). */ - int count; /* Acquire count for auto-release. */ - int auto_release; /* flag that says to auto-release. */ -} sysvsem_sem; - -extern sysvsem_module php_sysvsem_module; - -#else - -#define sysvsem_module_ptr NULL - -#endif - -#define phpext_sysvsem_ptr sysvsem_module_ptr - -#endif /* PHP_SYSVSEM_H */ diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c deleted file mode 100644 index 213d5110e9120..0000000000000 --- a/ext/sysvsem/sysvsem.c +++ /dev/null @@ -1,394 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Tom May | - | Gavin Sherry | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* Latest update build anc tested on Linux 2.2.14 - * - * This has been built and tested on Solaris 2.6 and Linux 2.1.122. - * It may not compile or execute correctly on other systems. - * - * sas: Works for me on Linux 2.0.36 and FreeBSD 3.0-current - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_SYSVSEM - -#include -#include -#include -#include - -#include "php_sysvsem.h" - -#if !HAVE_SEMUN - -union semun { - int val; /* value for SETVAL */ - struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */ - unsigned short int *array; /* array for GETALL, SETALL */ - struct seminfo *__buf; /* buffer for IPC_INFO */ -}; - -#undef HAVE_SEMUN -#define HAVE_SEMUN 1 - -#endif - -/* {{{ sysvsem_functions[] - */ -zend_function_entry sysvsem_functions[] = { - PHP_FE(sem_get, NULL) - PHP_FE(sem_acquire, NULL) - PHP_FE(sem_release, NULL) - PHP_FE(sem_remove, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ sysvsem_module_entry - */ -zend_module_entry sysvsem_module_entry = { - STANDARD_MODULE_HEADER, - "sysvsem", - sysvsem_functions, - PHP_MINIT(sysvsem), - NULL, - NULL, - NULL, - NULL, - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_SYSVSEM -ZEND_GET_MODULE(sysvsem) -#endif - - -THREAD_LS sysvsem_module php_sysvsem_module; - -/* Semaphore functions using System V semaphores. Each semaphore - * actually consists of three semaphores allocated as a unit under the - * same key. Semaphore 0 (SYSVSEM_SEM) is the actual semaphore, it is - * initialized to max_acquire and decremented as processes acquire it. - * The value of semaphore 1 (SYSVSEM_USAGE) is a count of the number - * of processes using the semaphore. After calling semget(), if a - * process finds that the usage count is 1, it will set the value of - * SYSVSEM_SEM to max_acquire. This allows max_acquire to be set and - * track the PHP code without having a global init routine or external - * semaphore init code. Except see the bug regarding a race condition - * php_sysvsem_get(). Semaphore 2 (SYSVSEM_SETVAL) serializes the - * calls to GETVAL SYSVSEM_USAGE and SETVAL SYSVSEM_SEM. It can be - * acquired only when it is zero. - */ - -#define SYSVSEM_SEM 0 -#define SYSVSEM_USAGE 1 -#define SYSVSEM_SETVAL 2 - -/* {{{ release_sysvsem_sem - */ -static void release_sysvsem_sem(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sysvsem_sem *sem_ptr = (sysvsem_sem *)rsrc->ptr; - struct sembuf sop[2]; - int opcount = 1; -/* - * if count == -1, semaphore has been removed - * Need better way to handle this - */ - - if (sem_ptr->count == -1 || !sem_ptr->auto_release) { - efree(sem_ptr); - return; - } - /* Decrement the usage count. */ - - sop[0].sem_num = SYSVSEM_USAGE; - sop[0].sem_op = -1; - sop[0].sem_flg = SEM_UNDO; - - /* Release the semaphore if it has been acquired but not released. */ - - if (sem_ptr->count) { - - sop[1].sem_num = SYSVSEM_SEM; - sop[1].sem_op = sem_ptr->count; - sop[1].sem_flg = SEM_UNDO; - - opcount++; - } - - semop(sem_ptr->semid, sop, opcount); - efree(sem_ptr); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(sysvsem) -{ - php_sysvsem_module.le_sem = zend_register_list_destructors_ex(release_sysvsem_sem, NULL, "sysvsem", module_number); - return SUCCESS; -} -/* }}} */ - -#define SETVAL_WANTS_PTR - -#if defined(_AIX) -#undef SETVAL_WANTS_PTR -#endif - -/* {{{ proto resource sem_get(int key [, int max_acquire [, int perm [, int auto_release]]) - Return an id for the semaphore with the given key, and allow max_acquire (default 1) processes to acquire it simultaneously */ -PHP_FUNCTION(sem_get) -{ - long key, max_acquire = 1, perm = 0666, auto_release = 1; - int semid; - struct sembuf sop[3]; - int count; - sysvsem_sem *sem_ptr; - - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|lll", &key, &max_acquire, &perm, &auto_release)) { - RETURN_FALSE; - } - - /* Get/create the semaphore. Note that we rely on the semaphores - * being zeroed when they are created. Despite the fact that - * the(?) Linux semget() man page says they are not initialized, - * the kernel versions 2.0.x and 2.1.z do in fact zero them. - */ - - semid = semget(key, 3, perm|IPC_CREAT); - if (semid == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - RETURN_FALSE; - } - - /* Find out how many processes are using this semaphore. Note - * that on Linux (at least) there is a race condition here because - * semaphore undo on process exit is not atomic, so we could - * acquire SYSVSEM_SETVAL before a crashed process has decremented - * SYSVSEM_USAGE in which case count will be greater than it - * should be and we won't set max_acquire. Fortunately this - * doesn't actually matter in practice. - */ - - /* Wait for sem 1 to be zero . . . */ - - sop[0].sem_num = SYSVSEM_SETVAL; - sop[0].sem_op = 0; - sop[0].sem_flg = 0; - - /* . . . and increment it so it becomes non-zero . . . */ - - sop[1].sem_num = SYSVSEM_SETVAL; - sop[1].sem_op = 1; - sop[1].sem_flg = SEM_UNDO; - - /* . . . and increment the usage count. */ - - sop[2].sem_num = SYSVSEM_USAGE; - sop[2].sem_op = 1; - sop[2].sem_flg = SEM_UNDO; - while (semop(semid, sop, 3) == -1) { - if (errno != EINTR) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno)); - break; - } - } - - /* Get the usage count. */ - count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL); - if (count == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - } - - /* If we are the only user, then take this opportunity to set the max. */ - - if (count == 1) { -#if HAVE_SEMUN - /* This is correct for Linux which has union semun. */ - union semun semarg; - semarg.val = max_acquire; - if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - } -#elif defined(SETVAL_WANTS_PTR) - /* This is correct for Solaris 2.6 which does not have union semun. */ - if (semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - } -#else - /* This works for i.e. AIX */ - if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno)); - } -#endif - } - - /* Set semaphore 1 back to zero. */ - - sop[0].sem_num = SYSVSEM_SETVAL; - sop[0].sem_op = -1; - sop[0].sem_flg = SEM_UNDO; - while (semop(semid, sop, 1) == -1) { - if (errno != EINTR) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno)); - break; - } - } - - sem_ptr = (sysvsem_sem *) emalloc(sizeof(sysvsem_sem)); - sem_ptr->key = key; - sem_ptr->semid = semid; - sem_ptr->count = 0; - sem_ptr->auto_release = auto_release; - - sem_ptr->id = ZEND_REGISTER_RESOURCE(return_value, sem_ptr, php_sysvsem_module.le_sem); -} -/* }}} */ - -/* {{{ php_sysvsem_semop - */ -static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire) -{ - zval **arg_id; - sysvsem_sem *sem_ptr; - struct sembuf sop; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &arg_id)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semaphore", php_sysvsem_module.le_sem); - - if (!acquire && sem_ptr->count == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_PP(arg_id), sem_ptr->key); - RETURN_FALSE; - } - - sop.sem_num = SYSVSEM_SEM; - sop.sem_op = acquire ? -1 : 1; - sop.sem_flg = SEM_UNDO; - - while (semop(sem_ptr->semid, &sop, 1) == -1) { - if (errno != EINTR) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno)); - RETURN_FALSE; - } - } - - sem_ptr->count -= acquire ? -1 : 1; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool sem_acquire(resource id) - Acquires the semaphore with the given id, blocking if necessary */ -PHP_FUNCTION(sem_acquire) -{ - php_sysvsem_semop(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool sem_release(resource id) - Releases the semaphore with the given id */ -PHP_FUNCTION(sem_release) -{ - php_sysvsem_semop(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool sem_remove(resource id) - Removes semaphore from Unix systems */ - -/* - * contributed by Gavin Sherry gavin@linuxworld.com.au - * Fri Mar 16 00:50:13 EST 2001 - */ - -PHP_FUNCTION(sem_remove) -{ - zval **arg_id; - sysvsem_sem *sem_ptr; -#if HAVE_SEMUN - union semun un; - struct semid_ds buf; -#endif - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semaphore", php_sysvsem_module.le_sem); - -#if HAVE_SEMUN - un.buf = &buf; - if (semctl(sem_ptr->semid, 0, IPC_STAT, un) < 0) { -#else - if (semctl(sem_ptr->semid, 0, IPC_STAT, NULL) < 0) { -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld does not (any longer) exist", Z_LVAL_PP(arg_id)); - RETURN_FALSE; - } - -#if HAVE_SEMUN - if (semctl(sem_ptr->semid, 0, IPC_RMID, un) < 0) { -#else - if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) { -#endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_PP(arg_id), strerror(errno)); - RETURN_FALSE; - } - - /* let release_sysvsem_sem know we have removed - * the semaphore to avoid issues with releasing. - */ - - sem_ptr->count = -1; - RETURN_TRUE; -} - -/* }}} */ - -#endif /* HAVE_SYSVSEM */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/sysvsem/tests/sysv.phpt b/ext/sysvsem/tests/sysv.phpt deleted file mode 100644 index f7d95f7f48f00..0000000000000 --- a/ext/sysvsem/tests/sysv.phpt +++ /dev/null @@ -1,114 +0,0 @@ ---TEST-- -General semaphore and shared memory test ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- - ---EXPECTF-- -Start. -Got semaphore Resource id #%i. -Success aquire semaphore Resource id #%i. -Success to attach shared memory : %i. -Write var1 to shared memory. -Write var2 to shared memory. -Read var1=Variable 1. -Read var2=Variable 2. -Semaphore Resource id #%i released. -Shared memory successfully removed from SysV. -semaphore removed successfully from SysV. -End. diff --git a/ext/sysvshm/CREDITS b/ext/sysvshm/CREDITS deleted file mode 100644 index 65a30ceb0cec9..0000000000000 --- a/ext/sysvshm/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -System V Shared Memory -Christian Cartus diff --git a/ext/sysvshm/config.m4 b/ext/sysvshm/config.m4 deleted file mode 100644 index 3827f59541893..0000000000000 --- a/ext/sysvshm/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(sysvshm,whether to enable System V shared memory support, -[ --enable-sysvshm Enable the System V shared memory support]) - -if test "$PHP_SYSVSHM" != "no"; then - AC_DEFINE(HAVE_SYSVSHM, 1, [ ]) - PHP_NEW_EXTENSION(sysvshm, sysvshm.c, $ext_shared) -fi diff --git a/ext/sysvshm/package.xml b/ext/sysvshm/package.xml deleted file mode 100644 index d26986bfa1b91..0000000000000 --- a/ext/sysvshm/package.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - sysvsem - Unix System V IPC Shared Memory - - - ??? - Cristian Cartus - cartus@atrior.de - lead - - - -Unix System V IPC Shared Memory - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - diff --git a/ext/sysvshm/php_sysvshm.h b/ext/sysvshm/php_sysvshm.h deleted file mode 100644 index 8d0897e6ba4f2..0000000000000 --- a/ext/sysvshm/php_sysvshm.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Christian Cartus | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYSVSHM_H -#define PHP_SYSVSHM_H - -#if HAVE_SYSVSHM - -extern zend_module_entry sysvshm_module_entry; -#define sysvshm_module_ptr &sysvshm_module_entry - -#include -#include -#include - -typedef struct { - int le_shm; - long init_mem; -} sysvshm_module; - -typedef struct { - long key; - long length; - long next; - char mem; -} sysvshm_chunk; - -typedef struct { - char magic[8]; - long start; - long end; - long free; - long total; -} sysvshm_chunk_head; - -typedef struct { - key_t key; /* Key set by user */ - long id; /* Returned by shmget. */ - sysvshm_chunk_head *ptr; /* memoryaddress of shared memory */ -} sysvshm_shm; - -PHP_MINIT_FUNCTION(sysvshm); -PHP_FUNCTION(shm_attach); -PHP_FUNCTION(shm_detach); -PHP_FUNCTION(shm_remove); -PHP_FUNCTION(shm_put_var); -PHP_FUNCTION(shm_get_var); -PHP_FUNCTION(shm_remove_var); - -extern sysvshm_module php_sysvshm; - -#else - -#define sysvshm_module_ptr NULL - -#endif - -#define phpext_sysvshm_ptr sysvshm_module_ptr - -#endif /* PHP_SYSVSHM_H */ diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c deleted file mode 100644 index bcb55e03394d5..0000000000000 --- a/ext/sysvshm/sysvshm.c +++ /dev/null @@ -1,455 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Christian Cartus | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* This has been built and tested on Linux 2.2.14 - * - * This has been built and tested on Solaris 2.6. - * It may not compile or execute correctly on other systems. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_SYSVSHM - -#include - -#include "php_sysvshm.h" -#include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" -#include "php_ini.h" - -/* {{{ sysvshm_functions[] - */ -zend_function_entry sysvshm_functions[] = { - PHP_FE(shm_attach, NULL) - PHP_FE(shm_remove, NULL) - PHP_FE(shm_detach, NULL) - PHP_FE(shm_put_var, NULL) - PHP_FE(shm_get_var, NULL) - PHP_FE(shm_remove_var, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ sysvshm_module_entry - */ -zend_module_entry sysvshm_module_entry = { - STANDARD_MODULE_HEADER, - "sysvshm", - sysvshm_functions, - PHP_MINIT(sysvshm), - NULL, - NULL, - NULL, - NULL, - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_SYSVSHM -ZEND_GET_MODULE(sysvshm) -#endif - -#undef shm_ptr /* undefine AIX-specific macro */ - -THREAD_LS sysvshm_module php_sysvshm; - -static int php_put_shm_data(sysvshm_chunk_head *ptr, long key, char *data, long len); -static long php_check_shm_data(sysvshm_chunk_head *ptr, long key); -static int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos); - -/* {{{ php_release_sysvshm - */ -static void php_release_sysvshm(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - sysvshm_shm *shm_ptr = (sysvshm_shm *) rsrc->ptr; - shmdt((void *) shm_ptr->ptr); - efree(shm_ptr); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(sysvshm) -{ - php_sysvshm.le_shm = zend_register_list_destructors_ex(php_release_sysvshm, NULL, "sysvshm", module_number); - - if (cfg_get_long("sysvshm.init_mem", &php_sysvshm.init_mem) == FAILURE) { - php_sysvshm.init_mem=10000; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ proto int shm_attach(int key [, int memsize [, int perm]]) - Creates or open a shared memory segment */ -PHP_FUNCTION(shm_attach) -{ - zval **arg_key, **arg_size, **arg_flag; - long shm_size, shm_flag; - sysvshm_shm *shm_list_ptr; - char *shm_ptr; - sysvshm_chunk_head *chunk_ptr; - key_t shm_key = (key_t) 0; - long shm_id, list_id; - int ac = ZEND_NUM_ARGS(); - - shm_flag = 0666; - shm_size = php_sysvshm.init_mem; - - if (ac < 1 || ac > 3 || zend_get_parameters_ex(ac, &arg_key, &arg_size, &arg_flag) == FAILURE) { - WRONG_PARAM_COUNT; - } - - switch (ac) { - case 3: - convert_to_long_ex(arg_flag); - shm_flag = Z_LVAL_PP(arg_flag); - case 2: - convert_to_long_ex(arg_size); - shm_size= Z_LVAL_PP(arg_size); - case 1: - convert_to_long_ex(arg_key); - shm_key = Z_LVAL_PP(arg_key); - } - - if (shm_size < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Segment size must be greater then zero."); - RETURN_FALSE; - } - - shm_list_ptr = (sysvshm_shm *) emalloc(sizeof(sysvshm_shm)); - - /* get the id from a specified key or create new shared memory */ - if ((shm_id = shmget(shm_key, 0, 0)) < 0) { - if (shm_size < sizeof(sysvshm_chunk_head)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: memorysize too small", shm_key); - efree(shm_list_ptr); - RETURN_FALSE; - } - if ((shm_id = shmget(shm_key, shm_size, shm_flag | IPC_CREAT | IPC_EXCL)) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", shm_key, strerror(errno)); - efree(shm_list_ptr); - RETURN_FALSE; - } - } - - if ((shm_ptr = shmat(shm_id, NULL, 0)) == (void *) - 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", shm_key, strerror(errno)); - efree(shm_list_ptr); - RETURN_FALSE; - } - - /* check if shm is already initialized */ - chunk_ptr = (sysvshm_chunk_head *) shm_ptr; - if (strcmp((char*) &(chunk_ptr->magic), "PHP_SM") != 0) { - strcpy((char*) &(chunk_ptr->magic), "PHP_SM"); - chunk_ptr->start = sizeof(sysvshm_chunk_head); - chunk_ptr->end = chunk_ptr->start; - chunk_ptr->total = shm_size; - chunk_ptr->free = shm_size-chunk_ptr->end; - } - - shm_list_ptr->key = shm_key; - shm_list_ptr->id = shm_id; - shm_list_ptr->ptr = chunk_ptr; - list_id = zend_list_insert(shm_list_ptr, php_sysvshm.le_shm); - RETURN_LONG(list_id); -} -/* }}} */ - -/* {{{ proto bool shm_detach(int shm_identifier) - Disconnects from shared memory segment */ -PHP_FUNCTION(shm_detach) -{ - zval **arg_id; - int type; - sysvshm_shm *shm_list_ptr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - shm_list_ptr = (sysvshm_shm *) zend_list_find(Z_LVAL_PP(arg_id), &type); - if (!shm_list_ptr || type != php_sysvshm.le_shm) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The parameter is not a valid shm_identifier"); - RETURN_FALSE; - } - - zend_list_delete(Z_LVAL_PP(arg_id)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool shm_remove(int shm_identifier) - Removes shared memory from Unix systems */ -PHP_FUNCTION(shm_remove) -{ - zval **arg_id; - long id; - int type; - sysvshm_shm *shm_list_ptr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg_id) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - id = Z_LVAL_PP(arg_id); - shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type); - - if (!shm_list_ptr || type != php_sysvshm.le_shm) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The parameter is not a valid shm_identifier"); - RETURN_FALSE; - } - - if (shmctl(shm_list_ptr->id, IPC_RMID,NULL) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x, id %ld: %s", shm_list_ptr->key, id, strerror(errno)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool shm_put_var(int shm_identifier, int variable_key, mixed variable) - Inserts or updates a variable in shared memory */ -PHP_FUNCTION(shm_put_var) -{ - zval **arg_id, **arg_key, **arg_var; - long key, id; - sysvshm_shm *shm_list_ptr; - int type; - smart_str shm_var = {0}; - int ret; - php_serialize_data_t var_hash; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg_id, &arg_key, &arg_var) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - id = Z_LVAL_PP(arg_id); - convert_to_long_ex(arg_key); - key = Z_LVAL_PP(arg_key); - - shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type); - if (!shm_list_ptr || type != php_sysvshm.le_shm) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id); - RETURN_FALSE; - } - - /* setup string-variable and serialize */ - - PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&shm_var, arg_var, &var_hash TSRMLS_CC); - PHP_VAR_SERIALIZE_DESTROY(var_hash); - /* insert serialized variable into shared memory */ - ret = php_put_shm_data(shm_list_ptr->ptr, key, shm_var.c, shm_var.len); - - /* free string */ - smart_str_free(&shm_var); - - if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "not enough shared memory left"); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed shm_get_var(int id, int variable_key) - Returns a variable from shared memory */ -PHP_FUNCTION(shm_get_var) -{ - zval **arg_id, **arg_key; - long key, id; - sysvshm_shm *shm_list_ptr; - int type; - char *shm_data; - long shm_varpos; - sysvshm_chunk *shm_var; - php_unserialize_data_t var_hash; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg_id, &arg_key) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - id = Z_LVAL_PP(arg_id); - convert_to_long_ex(arg_key); - key = Z_LVAL_PP(arg_key); - - shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type); - if (!shm_list_ptr || type != php_sysvshm.le_shm) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id); - RETURN_FALSE; - } - - /* setup string-variable and serialize */ - /* get serialized variable from shared memory */ - shm_varpos = php_check_shm_data((shm_list_ptr->ptr), key); - - if (shm_varpos < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %ld doesn't exist", key); - RETURN_FALSE; - } - shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos); - shm_data = &shm_var->mem; - - PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (php_var_unserialize(&return_value, (const unsigned char **) &shm_data, shm_data + shm_var->length, &var_hash TSRMLS_CC) != 1) { - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable data in shared memory is corrupted"); - RETURN_FALSE; - } - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); -} -/* }}} */ - -/* {{{ proto bool shm_remove_var(int id, int variable_key) - Removes variable from shared memory */ -PHP_FUNCTION(shm_remove_var) -{ - zval **arg_id, **arg_key; - long key, id; - sysvshm_shm *shm_list_ptr; - int type; - long shm_varpos; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg_id, &arg_key) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(arg_id); - id = Z_LVAL_PP(arg_id); - convert_to_long_ex(arg_key); - key = Z_LVAL_PP(arg_key); - - shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type); - if (!shm_list_ptr || type != php_sysvshm.le_shm) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id); - RETURN_FALSE; - } - - shm_varpos = php_check_shm_data((shm_list_ptr->ptr), key); - - if (shm_varpos < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %ld doesn't exist", key); - RETURN_FALSE; - } - php_remove_shm_data((shm_list_ptr->ptr), shm_varpos); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ php_put_shm_data - * inserts an ascii-string into shared memory */ -static int php_put_shm_data(sysvshm_chunk_head *ptr, long key, char *data, long len) -{ - sysvshm_chunk *shm_var; - long total_size; - long shm_varpos; - - total_size = ((long) (len + sizeof(sysvshm_chunk) - 1) / 4) * 4 + 4; /* 4-byte alligment */ - - if ((shm_varpos = php_check_shm_data(ptr, key)) > 0) { - php_remove_shm_data(ptr, shm_varpos); - } - - if (ptr->free < total_size) { - return -1; /* not enough memeory */ - } - - shm_var = (sysvshm_chunk *) ((char *) ptr + ptr->end); - shm_var->key = key; - shm_var->length = len; - shm_var->next = total_size; - memcpy(&(shm_var->mem), data, len); - ptr->end += total_size; - ptr->free -= total_size; - return 0; -} -/* }}} */ - -/* {{{ php_check_shm_data - */ -static long php_check_shm_data(sysvshm_chunk_head *ptr, long key) -{ - long pos; - sysvshm_chunk *shm_var; - - pos = ptr->start; - - for (;;) { - if (pos >= ptr->end) { - return -1; - } - shm_var = (sysvshm_chunk*) ((char *) ptr + pos); - if (shm_var->key == key) { - return pos; - } - pos += shm_var->next; - - if (shm_var->next <= 0 || pos < ptr->start) { - return -1; - } - } - return -1; -} -/* }}} */ - -/* {{{ php_remove_shm_data - */ -static int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos) -{ - sysvshm_chunk *chunk_ptr, *next_chunk_ptr; - long memcpy_len; - - chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos); - next_chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos + chunk_ptr->next); - - memcpy_len = ptr->end-shm_varpos - chunk_ptr->next; - ptr->free += chunk_ptr->next; - ptr->end -= chunk_ptr->next; - if (memcpy_len > 0) { - memcpy(chunk_ptr, next_chunk_ptr, memcpy_len); - } - return 0; -} -/* }}} */ - -#endif /* HAVE_SYSVSHM */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/sysvshm/tests/001.phpt b/ext/sysvshm/tests/001.phpt deleted file mode 100644 index 5228265d223f0..0000000000000 --- a/ext/sysvshm/tests/001.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -ftok() tests ---FILE-- - ---EXPECTF-- -Warning: Wrong parameter count for ftok() in %s on line %d -NULL - -Warning: Wrong parameter count for ftok() in %s on line %d -NULL - -Warning: Wrong parameter count for ftok() in %s on line %d -NULL - -Warning: ftok(): Pathname is invalid in %s on line %d -int(-1) - -Warning: ftok(): Project identifier is invalid in %s on line %d -int(-1) - -Warning: ftok(): Project identifier is invalid in %s on line %d -int(-1) - -Warning: ftok(): ftok() failed - No such file or directory in %s on line %d -int(-1) -int(%d) -Done diff --git a/ext/sysvshm/tests/002.phpt b/ext/sysvshm/tests/002.phpt deleted file mode 100644 index 21651dee58278..0000000000000 --- a/ext/sysvshm/tests/002.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -shm_attach() tests ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: Wrong parameter count for shm_attach() in %s/sysvshm/tests/002.php on line %d -NULL - -Warning: Wrong parameter count for shm_attach() in %s/sysvshm/tests/002.php on line %d -NULL - -Warning: shm_attach(): Segment size must be greater then zero. in %s/sysvshm/tests/002.php on line %d -bool(false) - -Warning: shm_attach(): Segment size must be greater then zero. in %s/sysvshm/tests/002.php on line %d -bool(false) - -Warning: shm_attach(): Segment size must be greater then zero. in %s/sysvshm/tests/002.php on line %d -bool(false) - -Warning: shm_attach(): Segment size must be greater then zero. in %s/sysvshm/tests/002.php on line %d -bool(false) - -Warning: shm_remove(): The parameter is not a valid shm_identifier in %s/sysvshm/tests/002.php on line %d - -Warning: shm_attach(): Segment size must be greater then zero. in %s/sysvshm/tests/002.php on line %d -bool(false) - -Warning: shm_remove(): The parameter is not a valid shm_identifier in %s/sysvshm/tests/002.php on line %d -int(%d) - -Warning: shm_remove(): The parameter is not a valid shm_identifier in %s/sysvshm/tests/002.php on line %d -int(%d) -int(%d) -int(%d) -int(%d) -Done \ No newline at end of file diff --git a/ext/sysvshm/tests/003.phpt b/ext/sysvshm/tests/003.phpt deleted file mode 100644 index 0e8b0a55224cb..0000000000000 --- a/ext/sysvshm/tests/003.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -shm_detach() tests ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECTF-- -Warning: Wrong parameter count for shm_detach() in %s on line %d -NULL - -Warning: Wrong parameter count for shm_detach() in %s on line %d -NULL -bool(true) - -Warning: shm_detach(): The parameter is not a valid shm_identifier in %s on line %d -bool(false) - -Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d - -Warning: shm_detach(): The parameter is not a valid shm_identifier in %s on line %d -bool(false) - -Warning: shm_detach(): The parameter is not a valid shm_identifier in %s on line %d -bool(false) - -Warning: shm_detach(): The parameter is not a valid shm_identifier in %s on line %d -bool(false) -Done diff --git a/ext/sysvshm/tests/004.phpt b/ext/sysvshm/tests/004.phpt deleted file mode 100644 index ea4d7500aa3ff..0000000000000 --- a/ext/sysvshm/tests/004.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -shm_put_var() tests ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: Wrong parameter count for shm_put_var() in %s on line %d -NULL - -Warning: shm_put_var(): -1 is not a SysV shared memory index in %s on line %d -bool(false) - -Warning: shm_put_var(): -1 is not a SysV shared memory index in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) - -Warning: shm_put_var(): not enough shared memory left in %s on line %d -bool(false) -Done diff --git a/ext/sysvshm/tests/005.phpt b/ext/sysvshm/tests/005.phpt deleted file mode 100644 index 49d158c7b2417..0000000000000 --- a/ext/sysvshm/tests/005.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -shm_get_var() tests ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: Wrong parameter count for shm_get_var() in %s on line %d -NULL - -Warning: shm_get_var(): -1 is not a SysV shared memory index in %s on line %d -bool(false) - -Warning: shm_get_var(): variable key 1000 doesn't exist in %s on line %d -bool(false) - -Warning: shm_get_var(): variable key -10000 doesn't exist in %s on line %d -bool(false) -object(stdClass)#%d (0) { -} -string(11) "test string" -object(stdClass)#%d (0) { -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -bool(false) -NULL -NULL -Done diff --git a/ext/sysvshm/tests/006.phpt b/ext/sysvshm/tests/006.phpt deleted file mode 100644 index ae0eef445da20..0000000000000 --- a/ext/sysvshm/tests/006.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -shm_remove_var() tests ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: Wrong parameter count for shm_remove_var() in %s on line %d -NULL - -Warning: shm_remove_var(): -1 is not a SysV shared memory index in %s on line %d -bool(false) - -Warning: shm_remove_var(): variable key -10 doesn't exist in %s on line %d -bool(false) -string(11) "test string" -bool(true) - -Warning: shm_get_var(): variable key 1 doesn't exist in %s on line %d -bool(false) - -Warning: shm_remove_var(): variable key 1 doesn't exist in %s on line %d -bool(false) - -Warning: shm_get_var(): variable key 1 doesn't exist in %s on line %d -bool(false) -Done diff --git a/ext/sysvshm/tests/007.phpt b/ext/sysvshm/tests/007.phpt deleted file mode 100644 index 05ef7ea189a35..0000000000000 --- a/ext/sysvshm/tests/007.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -shm_remove() tests ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: Wrong parameter count for shm_remove() in %s on line %d -NULL - -Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d -bool(false) - -Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d -bool(false) - -Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d -bool(false) -bool(true) -bool(true) - -Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d -bool(false) -Done diff --git a/ext/tidy/CREDITS b/ext/tidy/CREDITS deleted file mode 100644 index 1c77b2ff3b49d..0000000000000 --- a/ext/tidy/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -tidy -John Coggeshall, Ilia Alshanetsky diff --git a/ext/tidy/README b/ext/tidy/README deleted file mode 100644 index 0fb6c0f035ab1..0000000000000 --- a/ext/tidy/README +++ /dev/null @@ -1,7 +0,0 @@ - -README FOR ext/tidy by John Coggeshall - - -Tidy is an extension based on Libtidy (http://tidy.sf.net/) and allows a PHP developer -to clean, repair, and traverse HTML, XHTML, and XML documents -- including ones with -embedded scripting languages such as PHP or ASP within them using OO constructs. diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4 deleted file mode 100644 index 675498c8cecab..0000000000000 --- a/ext/tidy/config.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(tidy,for TIDY support, -[ --with-tidy[=DIR] Include TIDY support]) - -if test "$PHP_TIDY" != "no"; then - - if test "$PHP_TIDY" != "yes"; then - TIDY_SEARCH_DIRS=$PHP_TIDY - else - TIDY_SEARCH_DIRS="/usr/local /usr" - fi - - for i in $TIDY_SEARCH_DIRS; do - if test -f $i/include/tidy/tidy.h; then - TIDY_DIR=$i - TIDY_INCDIR=$i/include/tidy - elif test -f $i/include/tidy.h; then - TIDY_DIR=$i - TIDY_INCDIR=$i/include - fi - done - - if test -z "$TIDY_DIR"; then - AC_MSG_ERROR(Cannot find libtidy) - fi - - TIDY_LIBDIR=$TIDY_DIR/$PHP_LIBDIR - - PHP_ADD_LIBRARY_WITH_PATH(tidy, $TIDY_LIBDIR, TIDY_SHARED_LIBADD) - PHP_ADD_INCLUDE($TIDY_INCDIR) - - PHP_CHECK_LIBRARY(tidy,tidyOptGetDoc, - [ - AC_DEFINE(HAVE_TIDYOPTGETDOC,1,[ ]) - ],[],[]) - - - PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared) - PHP_SUBST(TIDY_SHARED_LIBADD) - AC_DEFINE(HAVE_TIDY,1,[ ]) -fi diff --git a/ext/tidy/config.w32 b/ext/tidy/config.w32 deleted file mode 100644 index e9e2a225f7ddc..0000000000000 --- a/ext/tidy/config.w32 +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("tidy", "TIDY support", "no"); - -if (PHP_TIDY != "no") { - if (CHECK_LIB("libtidy.lib", "tidy", PHP_TIDY) && - ( - CHECK_HEADER_ADD_INCLUDE("tidy.h", "CFLAGS_TIDY") || - CHECK_HEADER_ADD_INCLUDE("tidy/tidy.h", "CFLAGS_TIDY", null, null, true) || - CHECK_HEADER_ADD_INCLUDE("libtidy/tidy.h", "CFLAGS_TIDY", null, null, true) - )) { - EXTENSION("tidy", "tidy.c"); - AC_DEFINE('HAVE_TIDY', 1, 'Have TIDY library'); - if (!PHP_TIDY_SHARED) { - ADD_DEF_FILE("ext\\tidy\\php_tidy.def"); - } - } else { - WARNING("tidy not enabled; libraries and headers not found"); - } -} - diff --git a/ext/tidy/examples/cleanhtml.php b/ext/tidy/examples/cleanhtml.php deleted file mode 100644 index 9a6713dc55f0a..0000000000000 --- a/ext/tidy/examples/cleanhtml.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * Usage: php cleanhtml.php [filename] - * - */ - - if(!isset($_SERVER['argv'][1])) { - $data = file_get_contents("php://stdin"); - tidy_parse_string($data); - } else { - tidy_parse_file($_SERVER['argv'][1]); - } - - tidy_clean_repair(); - - if(tidy_warning_count() || - tidy_error_count()) { - - echo "\n\nThe following errors or warnings occured:\n"; - echo tidy_get_error_buffer(); - echo "\n"; - } - - echo tidy_get_output(); - -?> - - - - \ No newline at end of file diff --git a/ext/tidy/examples/cleanhtml5.php b/ext/tidy/examples/cleanhtml5.php deleted file mode 100644 index 4dfd7643e133c..0000000000000 --- a/ext/tidy/examples/cleanhtml5.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * Usage: php cleanhtml5.php [filename] - * - */ - - if(!isset($_SERVER['argv'][1])) { - $data = file_get_contents("php://stdin"); - $tidy = tidy_parse_string($data); - } else { - $tidy = tidy_parse_file($_SERVER['argv'][1]); - } - - $tidy->cleanRepair(); - - if(!empty($tidy->errorBuffer)) { - - echo "\n\nThe following errors or warnings occured:\n"; - echo "{$tidy->errorBuffer}\n"; - - } - - echo $tidy; - -?> - - - - diff --git a/ext/tidy/examples/dumpit5.php b/ext/tidy/examples/dumpit5.php deleted file mode 100644 index d7aee2d652dfa..0000000000000 --- a/ext/tidy/examples/dumpit5.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * Usage; php dumpit5.php - */ - - $tidy = tidy_parse_file($_SERVER['argv'][1]); - - /* Optionally you can do this here if you want to fix up the document */ - - /* $tidy->clean_repair() */ - - $tree = $tidy->root(); - dump_tree($tree); - echo "\n"; - - function node_type($type) { - - switch($type) { - - case TIDY_NODETYPE_ROOT: return "Root Node"; - case TIDY_NODETYPE_DOCTYPE: return "DocType Node"; - case TIDY_NODETYPE_COMMENT: return "Comment Node"; - case TIDY_NODETYPE_PROCINS: return "ProcIns Node"; - case TIDY_NODETYPE_TEXT: return "Text Node"; - case TIDY_NODETYPE_START: return "Start Node"; - case TIDY_NODETYPE_END: return "End Node"; - case TIDY_NODETYPE_STARTEND: return "Start/End Node"; - case TIDY_NODETYPE_CDATA: return "CDATA Node"; - case TIDY_NODETYPE_SECTION: return "Section Node"; - case TIDY_NODETYPE_ASP: return "ASP Source Code Node"; - case TIDY_NODETYPE_PHP: return "PHP Source Code Node"; - case TIDY_NODETYPE_JSTE: return "JSTE Source Code"; - case TIDY_NODETYPE_XMLDECL: return "XML Declaration Node"; - default: return "Unknown Node"; - } - } - - function do_leaf($string, $indent) { - for($i = 0; $i < $indent; $i++) { - echo " "; - } - echo $string; - } - - function dump_tree(tidyNode $node, $indent = 0) { - - /* Put something there if the node name is empty */ - $nodename = trim(strtoupper($node->name)); - $nodename = (empty($nodename)) ? "[EMPTY]" : $nodename; - - /* Generate the Node, and a pretty name for it */ - do_leaf(" + $nodename (".node_type($node->type).")\n", $indent); - - /* Check to see if this node is a text node. Text nodes are - generated by start/end tags and contain the text in between. - i.e. foo will create a text node with $node->value - equal to 'foo' */ - if($node->type == TIDY_NODETYPE_TEXT) { - do_leaf(" |\n", $indent); - do_leaf(" +---- Value: '{$node->value}'\n", $indent); - } - - if(count($node->attribute)) { - do_leaf(" |\n", $indent); - do_leaf(" +---- Attributes\n", $indent); - - foreach($node->attribute as $name=>$value) { - @do_leaf(" +-- $name\n", $indent); - do_leaf(" | +-- Value: $value\n", $indent); - } - } - - /* Recurse along the children to generate the remaining nodes */ - if($node->hasChildren()) { - foreach($node->child as $child) { - dump_tree($child, $indent + 3); - } - } - - } - - -?> \ No newline at end of file diff --git a/ext/tidy/examples/urlgrab5.php b/ext/tidy/examples/urlgrab5.php deleted file mode 100644 index 875baf0cf90d2..0000000000000 --- a/ext/tidy/examples/urlgrab5.php +++ /dev/null @@ -1,39 +0,0 @@ - tags from a document. - * - * NOTE: Only works with tidy for PHP 5, please see urlgrab.php for tidy for PHP 4.3.x - * - * By: John Coggeshall - * - * Usage: php urlgrab5.php - * - */ - function dump_nodes(tidyNode $node, &$urls = NULL) { - - $urls = (is_array($urls)) ? $urls : array(); - - if(isset($node->id)) { - if($node->id == TIDY_TAG_A) { - $urls[] = $node->attribute['href']; - } - } - - if($node->hasChildren()) { - - foreach($node->child as $c) { - dump_nodes($c, $urls); - } - - } - - return $urls; - } - - $a = tidy_parse_file($_SERVER['argv'][1]); - $a->cleanRepair(); - print_r(dump_nodes($a->html())); -?> diff --git a/ext/tidy/package.xml b/ext/tidy/package.xml deleted file mode 100644 index a5b461ce45094..0000000000000 --- a/ext/tidy/package.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - tidy - Tidy HTML Repairing and Parsing - - - john - John Coggeshall - john@php.net - lead - - - iliaa - Ilia Alshanetsky - ilia@php.net - developer - - - -Tidy is a binding for the Tidy HTML clean and repair utility which -allows you to not only clean and otherwise manipluate HTML documents, -but also traverse the document tree using the Zend Engine 2 OO semantics. - - PHP - - beta - 2.0dev - 2003-11-13 - - Major API changes for PHP 5.0, including the re-introduction of resources, output buffering support, - dual-nature syntax (tidy_clean_repair($tidy_res) or $tidy->clean_repair()) and more. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/tidy/php_tidy.def b/ext/tidy/php_tidy.def deleted file mode 100644 index 1d438a7162f42..0000000000000 --- a/ext/tidy/php_tidy.def +++ /dev/null @@ -1,290 +0,0 @@ -EXPORTS -tidyBufInit -tidyBufAlloc -tidyBufCheckAlloc -tidyBufFree -tidyBufClear -tidyBufAttach -tidyBufDetach -tidyBufAppend -tidyBufPutByte -tidyBufPopByte -tidyBufGetByte -tidyBufEndOfInput -tidyBufUngetByte -tidyCreate -tidyRelease -tidySetAppData -tidyGetAppData -tidyReleaseDate -tidyStatus -tidyDetectedHtmlVersion -tidyDetectedXhtml -tidyDetectedGenericXml -tidyErrorCount -tidyWarningCount -tidyAccessWarningCount -tidyConfigErrorCount -tidyLoadConfig -tidyLoadConfigEnc -tidyFileExists -tidySetCharEncoding -tidySetOptionCallback -tidyOptGetIdForName -tidyGetOptionList -tidyGetNextOption -tidyGetOption -tidyGetOptionByName -tidyOptGetId -tidyOptGetName -tidyOptGetType -tidyOptIsReadOnly -tidyOptGetCategory -tidyOptGetDefault -tidyOptGetDefaultInt -tidyOptGetDefaultBool -tidyOptGetPickList -tidyOptGetNextPick -tidyOptGetValue -tidyOptSetValue -tidyOptParseValue -tidyOptGetInt -tidyOptSetInt -tidyOptGetBool -tidyOptSetBool -tidyOptResetToDefault -tidyOptResetAllToDefault -tidyOptSnapshot -tidyOptResetToSnapshot -tidyOptDiffThanDefault -tidyOptDiffThanSnapshot -tidyOptCopyConfig -tidyOptGetEncName -tidyOptGetCurrPick -tidyOptGetDeclTagList -tidyOptGetNextDeclTag -tidyInitSource -tidyGetByte -tidyUngetByte -tidyIsEOF -tidyInitSink -tidyPutByte -tidySetReportFilter -tidySetErrorFile -tidySetErrorBuffer -tidySetErrorSink -tidySetMallocCall -tidySetReallocCall -tidySetFreeCall -tidySetPanicCall -tidyParseFile -tidyParseStdin -tidyParseString -tidyParseBuffer -tidyParseSource -tidyCleanAndRepair -tidyRunDiagnostics -tidySaveFile -tidySaveStdout -tidySaveBuffer -tidySaveString -tidySaveSink -tidyOptSaveFile -tidyOptSaveSink -tidyErrorSummary -tidyGeneralInfo -tidyGetRoot -tidyGetHtml -tidyGetHead -tidyGetBody -tidyGetParent -tidyGetChild -tidyGetNext -tidyGetPrev -tidyAttrFirst -tidyAttrNext -tidyAttrName -tidyAttrValue -tidyNodeGetType -tidyNodeGetName -tidyNodeIsText -tidyNodeIsProp -tidyNodeIsHeader -tidyNodeHasText -tidyNodeGetText -tidyNodeGetId -tidyNodeLine -tidyNodeColumn -tidyNodeIsHTML -tidyNodeIsHEAD -tidyNodeIsTITLE -tidyNodeIsBASE -tidyNodeIsMETA -tidyNodeIsBODY -tidyNodeIsFRAMESET -tidyNodeIsFRAME -tidyNodeIsIFRAME -tidyNodeIsNOFRAMES -tidyNodeIsHR -tidyNodeIsH1 -tidyNodeIsH2 -tidyNodeIsPRE -tidyNodeIsLISTING -tidyNodeIsP -tidyNodeIsUL -tidyNodeIsOL -tidyNodeIsDL -tidyNodeIsDIR -tidyNodeIsLI -tidyNodeIsDT -tidyNodeIsDD -tidyNodeIsTABLE -tidyNodeIsCAPTION -tidyNodeIsTD -tidyNodeIsTH -tidyNodeIsTR -tidyNodeIsCOL -tidyNodeIsCOLGROUP -tidyNodeIsBR -tidyNodeIsA -tidyNodeIsLINK -tidyNodeIsB -tidyNodeIsI -tidyNodeIsSTRONG -tidyNodeIsEM -tidyNodeIsBIG -tidyNodeIsSMALL -tidyNodeIsPARAM -tidyNodeIsOPTION -tidyNodeIsOPTGROUP -tidyNodeIsIMG -tidyNodeIsMAP -tidyNodeIsAREA -tidyNodeIsNOBR -tidyNodeIsWBR -tidyNodeIsFONT -tidyNodeIsLAYER -tidyNodeIsSPACER -tidyNodeIsCENTER -tidyNodeIsSTYLE -tidyNodeIsSCRIPT -tidyNodeIsNOSCRIPT -tidyNodeIsFORM -tidyNodeIsTEXTAREA -tidyNodeIsBLOCKQUOTE -tidyNodeIsAPPLET -tidyNodeIsOBJECT -tidyNodeIsDIV -tidyNodeIsSPAN -tidyNodeIsINPUT -tidyNodeIsQ -tidyNodeIsLABEL -tidyNodeIsH3 -tidyNodeIsH4 -tidyNodeIsH5 -tidyNodeIsH6 -tidyNodeIsADDRESS -tidyNodeIsXMP -tidyNodeIsSELECT -tidyNodeIsBLINK -tidyNodeIsMARQUEE -tidyNodeIsEMBED -tidyNodeIsBASEFONT -tidyNodeIsISINDEX -tidyNodeIsS -tidyNodeIsSTRIKE -tidyNodeIsU -tidyNodeIsMENU -tidyAttrGetId -tidyAttrIsEvent -tidyAttrIsProp -tidyAttrIsHREF -tidyAttrIsSRC -tidyAttrIsID -tidyAttrIsNAME -tidyAttrIsSUMMARY -tidyAttrIsALT -tidyAttrIsLONGDESC -tidyAttrIsUSEMAP -tidyAttrIsISMAP -tidyAttrIsLANGUAGE -tidyAttrIsTYPE -tidyAttrIsVALUE -tidyAttrIsCONTENT -tidyAttrIsTITLE -tidyAttrIsXMLNS -tidyAttrIsDATAFLD -tidyAttrIsWIDTH -tidyAttrIsHEIGHT -tidyAttrIsFOR -tidyAttrIsSELECTED -tidyAttrIsCHECKED -tidyAttrIsLANG -tidyAttrIsTARGET -tidyAttrIsHTTP_EQUIV -tidyAttrIsREL -tidyAttrIsOnMOUSEMOVE -tidyAttrIsOnMOUSEDOWN -tidyAttrIsOnMOUSEUP -tidyAttrIsOnCLICK -tidyAttrIsOnMOUSEOVER -tidyAttrIsOnMOUSEOUT -tidyAttrIsOnKEYDOWN -tidyAttrIsOnKEYUP -tidyAttrIsOnKEYPRESS -tidyAttrIsOnFOCUS -tidyAttrIsOnBLUR -tidyAttrIsBGCOLOR -tidyAttrIsLINK -tidyAttrIsALINK -tidyAttrIsVLINK -tidyAttrIsTEXT -tidyAttrIsSTYLE -tidyAttrIsABBR -tidyAttrIsCOLSPAN -tidyAttrIsROWSPAN -tidyAttrGetHREF -tidyAttrGetSRC -tidyAttrGetID -tidyAttrGetNAME -tidyAttrGetSUMMARY -tidyAttrGetALT -tidyAttrGetLONGDESC -tidyAttrGetUSEMAP -tidyAttrGetISMAP -tidyAttrGetLANGUAGE -tidyAttrGetTYPE -tidyAttrGetVALUE -tidyAttrGetCONTENT -tidyAttrGetTITLE -tidyAttrGetXMLNS -tidyAttrGetDATAFLD -tidyAttrGetWIDTH -tidyAttrGetHEIGHT -tidyAttrGetFOR -tidyAttrGetSELECTED -tidyAttrGetCHECKED -tidyAttrGetLANG -tidyAttrGetTARGET -tidyAttrGetHTTP_EQUIV -tidyAttrGetREL -tidyAttrGetOnMOUSEMOVE -tidyAttrGetOnMOUSEDOWN -tidyAttrGetOnMOUSEUP -tidyAttrGetOnCLICK -tidyAttrGetOnMOUSEOVER -tidyAttrGetOnMOUSEOUT -tidyAttrGetOnKEYDOWN -tidyAttrGetOnKEYUP -tidyAttrGetOnKEYPRESS -tidyAttrGetOnFOCUS -tidyAttrGetOnBLUR -tidyAttrGetBGCOLOR -tidyAttrGetLINK -tidyAttrGetALINK -tidyAttrGetVLINK -tidyAttrGetTEXT -tidyAttrGetSTYLE -tidyAttrGetABBR -tidyAttrGetCOLSPAN -tidyAttrGetROWSPAN diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h deleted file mode 100644 index 12226743ecee1..0000000000000 --- a/ext/tidy/php_tidy.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: John Coggeshall | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_TIDY_H -#define PHP_TIDY_H - -extern zend_module_entry tidy_module_entry; -#define phpext_tidy_ptr &tidy_module_entry - -#define TIDY_METHOD_MAP(name, func_name, arg_types) \ - ZEND_NAMED_FE(name, ZEND_FN(func_name), arg_types) -#define TIDY_NODE_METHOD(name) PHP_FUNCTION(tnm_ ##name) -#define TIDY_NODE_ME(name, param) TIDY_METHOD_MAP(name, tnm_ ##name, param) -#define TIDY_DOC_METHOD(name) PHP_FUNCTION(tdm_ ##name) -#define TIDY_DOC_ME(name, param) TIDY_METHOD_MAP(name, tdm_ ##name, param) -#define TIDY_ATTR_METHOD(name) PHP_FUNCTION(tam_ ##name) -#define TIDY_ATTR_ME(name, param) TIDY_METHOD_MAP(name, tam_ ##name, param) - -ZEND_BEGIN_MODULE_GLOBALS(tidy) - char *default_config; -ZEND_END_MODULE_GLOBALS(tidy) - -#ifdef ZTS -#define TG(v) TSRMG(tidy_globals_id, zend_tidy_globals *, v) -#else -#define TG(v) (tidy_globals.v) -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/tidy/tests/001.phpt b/ext/tidy/tests/001.phpt deleted file mode 100644 index bfd3782078bf3..0000000000000 --- a/ext/tidy/tests/001.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Check for tidy presence ---SKIPIF-- - ---FILE-- - ---EXPECT-- -tidy extension is available diff --git a/ext/tidy/tests/002.phpt b/ext/tidy/tests/002.phpt deleted file mode 100644 index 89c3804b89d38..0000000000000 --- a/ext/tidy/tests/002.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -tidy_parse_string() ---SKIPIF-- - ---FILE-- -"); - echo tidy_get_output($a); - -?> ---EXPECT-- - - - - - - - \ No newline at end of file diff --git a/ext/tidy/tests/003.phpt b/ext/tidy/tests/003.phpt deleted file mode 100644 index 7201d6a5a22a2..0000000000000 --- a/ext/tidy/tests/003.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -tidy_clean_repair() ---SKIPIF-- - ---FILE-- -"); - tidy_clean_repair($a); - echo tidy_get_output($a); - -?> ---EXPECT-- - - - - - - - - diff --git a/ext/tidy/tests/004.phpt b/ext/tidy/tests/004.phpt deleted file mode 100644 index e941de452bbc4..0000000000000 --- a/ext/tidy/tests/004.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -tidy_diagnose() ---SKIPIF-- - ---FILE-- -"); - tidy_diagnose($a); - echo tidy_get_error_buffer($a); -?> ---EXPECT-- - -line 1 column 1 - Warning: missing declaration -line 1 column 7 - Warning: discarding unexpected -line 1 column 14 - Warning: inserting missing 'title' element -Info: Document content looks like HTML 3.2 -3 warnings, 0 errors were found! \ No newline at end of file diff --git a/ext/tidy/tests/005.html b/ext/tidy/tests/005.html deleted file mode 100644 index 8c17451f917d9..0000000000000 --- a/ext/tidy/tests/005.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ext/tidy/tests/005.phpt b/ext/tidy/tests/005.phpt deleted file mode 100644 index 1d3a10c2ffadd..0000000000000 --- a/ext/tidy/tests/005.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -tidy_parse_file() ---SKIPIF-- - ---FILE-- - ---EXPECT-- - - - - - - - \ No newline at end of file diff --git a/ext/tidy/tests/006.phpt b/ext/tidy/tests/006.phpt deleted file mode 100644 index c8261813145a0..0000000000000 --- a/ext/tidy/tests/006.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Verbose tidy_get_error_buffer() ---SKIPIF-- - ---FILE-- -"); - echo tidy_get_error_buffer($a); - -?> ---EXPECT-- -line 1 column 1 - Warning: missing declaration -line 1 column 7 - Error: is not recognized! -line 1 column 7 - Warning: discarding unexpected -line 1 column 17 - Warning: discarding unexpected -line 1 column 7 - Warning: inserting missing 'title' element \ No newline at end of file diff --git a/ext/tidy/tests/007.html b/ext/tidy/tests/007.html deleted file mode 100644 index 7dc0357779df4..0000000000000 --- a/ext/tidy/tests/007.html +++ /dev/null @@ -1 +0,0 @@ -testing
diff --git a/ext/tidy/tests/007.phpt b/ext/tidy/tests/007.phpt deleted file mode 100644 index f6bb13d556a8f..0000000000000 --- a/ext/tidy/tests/007.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Verbose tidy_getopt() ---SKIPIF-- - ---INI-- -tidy.default_config= ---FILE-- -getopt("tidy-mark")); - echo "Current Value of 'error-file': "; - var_dump($a->getopt("error-file")); - echo "Current Value of 'tab-size': "; - var_dump($a->getopt("tab-size")); - - var_dump($a->getopt('bogus-opt')); - var_dump(tidy_getopt($a, 'non-ASCII string àáç')); -?> ---EXPECTF-- -Current Value of 'tidy-mark': bool(false) -Current Value of 'error-file': string(0) "" -Current Value of 'tab-size': int(8) - -Warning: tidy::getOpt(): Unknown Tidy Configuration Option 'bogus-opt' in %s007.php on line 10 -bool(false) - -Warning: tidy_getopt(): Unknown Tidy Configuration Option 'non-ASCII string àáç' in %s007.php on line 11 -bool(false) diff --git a/ext/tidy/tests/008.phpt b/ext/tidy/tests/008.phpt deleted file mode 100644 index 150b98f56074a..0000000000000 --- a/ext/tidy/tests/008.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Accessing the error buffer via $obj->error_buf... ---SKIPIF-- - ---FILE-- -"); - echo $a->errorBuffer; -?> ---EXPECT-- -line 1 column 1 - Warning: missing declaration -line 1 column 7 - Error: is not recognized! -line 1 column 7 - Warning: discarding unexpected -line 1 column 17 - Warning: discarding unexpected -line 1 column 7 - Warning: inserting missing 'title' element \ No newline at end of file diff --git a/ext/tidy/tests/009.phpt b/ext/tidy/tests/009.phpt deleted file mode 100644 index 02c65df7cbd98..0000000000000 --- a/ext/tidy/tests/009.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -tidy_doc object overloading ---SKIPIF-- - ---FILE-- -"); - echo $a; - -?> ---EXPECT-- - - - - - - - \ No newline at end of file diff --git a/ext/tidy/tests/010.phpt b/ext/tidy/tests/010.phpt deleted file mode 100644 index eabbc0391ff80..0000000000000 --- a/ext/tidy/tests/010.phpt +++ /dev/null @@ -1,317 +0,0 @@ ---TEST-- -Accessing root, body, html, and head nodes.. ---SKIPIF-- - ---FILE-- -"); - var_dump($a->root()); - var_dump($a->body()); - var_dump($a->html()); - var_dump($a->head()); - -?> ---EXPECT-- -object(tidyNode)#2 (8) { - ["value"]=> - string(94) " - - - - - -" - ["name"]=> - string(0) "" - ["type"]=> - int(0) - ["line"]=> - int(1) - ["column"]=> - int(1) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#3 (9) { - ["value"]=> - string(94) " - - - - - -" - ["name"]=> - string(4) "html" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(1) - ["proprietary"]=> - bool(false) - ["id"]=> - int(48) - ["attribute"]=> - NULL - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#4 (9) { - ["value"]=> - string(31) " - - -" - ["name"]=> - string(4) "head" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(46) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#5 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(57) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - [1]=> - &object(tidyNode)#6 (9) { - ["value"]=> - string(49) " - -" - ["name"]=> - string(4) "body" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(16) - ["attribute"]=> - array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" - } - ["child"]=> - NULL - } - } - } - } -} -object(tidyNode)#2 (9) { - ["value"]=> - string(49) " - -" - ["name"]=> - string(4) "body" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(16) - ["attribute"]=> - array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" - } - ["child"]=> - NULL -} -object(tidyNode)#2 (9) { - ["value"]=> - string(94) " - - - - - -" - ["name"]=> - string(4) "html" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(1) - ["proprietary"]=> - bool(false) - ["id"]=> - int(48) - ["attribute"]=> - NULL - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#3 (9) { - ["value"]=> - string(31) " - - -" - ["name"]=> - string(4) "head" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(46) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#6 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(57) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - [1]=> - &object(tidyNode)#4 (9) { - ["value"]=> - string(49) " - -" - ["name"]=> - string(4) "body" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(16) - ["attribute"]=> - array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" - } - ["child"]=> - NULL - } - } -} -object(tidyNode)#2 (9) { - ["value"]=> - string(31) " - - -" - ["name"]=> - string(4) "head" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(46) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#4 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(57) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } -} diff --git a/ext/tidy/tests/011.phpt b/ext/tidy/tests/011.phpt deleted file mode 100644 index 2a9461675907f..0000000000000 --- a/ext/tidy/tests/011.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Accessing attributes of a node ---SKIPIF-- - ---FILE-- -"); - $body = $a->body(); - var_dump($body->attribute); - foreach($body->attribute as $key=>$val) { - echo "Attrib '$key': $val\n"; - } -?> ---EXPECT-- -array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" -} -Attrib 'bgcolor': #FFFFFF -Attrib 'alink': #000000 \ No newline at end of file diff --git a/ext/tidy/tests/012.phpt b/ext/tidy/tests/012.phpt deleted file mode 100644 index 43fff38df589e..0000000000000 --- a/ext/tidy/tests/012.phpt +++ /dev/null @@ -1,473 +0,0 @@ ---TEST-- -Accessing children nodes ---SKIPIF-- - ---FILE-- -hasChildren()); - if($node->hasChildren()) { - - foreach($node->child as $c) { - - var_dump($c); - - if($c->hasChildren()) { - - dump_nodes($c); - - } - } - - } - - } - - $a = tidy_parse_string("HiByeTest"); - $html = $a->html(); - dump_nodes($html); - -?> ---EXPECT-- -bool(true) -object(tidyNode)#3 (9) { - ["value"]=> - string(31) " - - -" - ["name"]=> - string(4) "head" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(46) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#4 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(87) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } -} -bool(true) -object(tidyNode)#4 (9) { - ["value"]=> - string(16) " -" - ["name"]=> - string(5) "title" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(87) - ["proprietary"]=> - bool(false) - ["id"]=> - int(111) - ["attribute"]=> - NULL - ["child"]=> - NULL -} -object(tidyNode)#5 (9) { - ["value"]=> - string(80) " -HiByeTest - -" - ["name"]=> - string(4) "body" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(7) - ["proprietary"]=> - bool(false) - ["id"]=> - int(16) - ["attribute"]=> - array(2) { - ["bgcolor"]=> - string(7) "#FFFFFF" - ["alink"]=> - string(7) "#000000" - } - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#6 (9) { - ["value"]=> - string(9) "Hi" - ["name"]=> - string(1) "b" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(43) - ["proprietary"]=> - bool(false) - ["id"]=> - int(8) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#7 (8) { - ["value"]=> - string(2) "Hi" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(46) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - [1]=> - &object(tidyNode)#8 (9) { - ["value"]=> - string(21) "ByeTest" - ["name"]=> - string(1) "i" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(52) - ["proprietary"]=> - bool(false) - ["id"]=> - int(49) - ["attribute"]=> - NULL - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#9 (8) { - ["value"]=> - string(3) "Bye" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(55) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - [1]=> - &object(tidyNode)#10 (9) { - ["value"]=> - string(11) "Test" - ["name"]=> - string(1) "u" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(58) - ["proprietary"]=> - bool(false) - ["id"]=> - int(114) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#11 (8) { - ["value"]=> - string(4) "Test" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(61) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - } - } - } -} -bool(true) -object(tidyNode)#6 (9) { - ["value"]=> - string(9) "Hi" - ["name"]=> - string(1) "b" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(43) - ["proprietary"]=> - bool(false) - ["id"]=> - int(8) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#7 (8) { - ["value"]=> - string(2) "Hi" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(46) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } -} -bool(true) -object(tidyNode)#7 (8) { - ["value"]=> - string(2) "Hi" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(46) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL -} -object(tidyNode)#8 (9) { - ["value"]=> - string(21) "ByeTest" - ["name"]=> - string(1) "i" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(52) - ["proprietary"]=> - bool(false) - ["id"]=> - int(49) - ["attribute"]=> - NULL - ["child"]=> - array(2) { - [0]=> - &object(tidyNode)#9 (8) { - ["value"]=> - string(3) "Bye" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(55) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - [1]=> - &object(tidyNode)#10 (9) { - ["value"]=> - string(11) "Test" - ["name"]=> - string(1) "u" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(58) - ["proprietary"]=> - bool(false) - ["id"]=> - int(114) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#11 (8) { - ["value"]=> - string(4) "Test" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(61) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } - } - } -} -bool(true) -object(tidyNode)#9 (8) { - ["value"]=> - string(3) "Bye" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(55) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL -} -object(tidyNode)#10 (9) { - ["value"]=> - string(11) "Test" - ["name"]=> - string(1) "u" - ["type"]=> - int(5) - ["line"]=> - int(1) - ["column"]=> - int(58) - ["proprietary"]=> - bool(false) - ["id"]=> - int(114) - ["attribute"]=> - NULL - ["child"]=> - array(1) { - [0]=> - &object(tidyNode)#11 (8) { - ["value"]=> - string(4) "Test" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(61) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL - } - } -} -bool(true) -object(tidyNode)#11 (8) { - ["value"]=> - string(4) "Test" - ["name"]=> - string(0) "" - ["type"]=> - int(4) - ["line"]=> - int(1) - ["column"]=> - int(61) - ["proprietary"]=> - bool(false) - ["attribute"]=> - NULL - ["child"]=> - NULL -} diff --git a/ext/tidy/tests/013.html b/ext/tidy/tests/013.html deleted file mode 100644 index 7dc0357779df4..0000000000000 --- a/ext/tidy/tests/013.html +++ /dev/null @@ -1 +0,0 @@ -testing diff --git a/ext/tidy/tests/013.phpt b/ext/tidy/tests/013.phpt deleted file mode 100644 index 8f1ac94ef4a13..0000000000000 --- a/ext/tidy/tests/013.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Parsing a file using constructor ---SKIPIF-- - ---FILE-- -true)); - $tidy->cleanRepair(); - echo $tidy; - -?> ---EXPECT-- -testing diff --git a/ext/tidy/tests/014.phpt b/ext/tidy/tests/014.phpt deleted file mode 100644 index a391b3dc9ebf3..0000000000000 --- a/ext/tidy/tests/014.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Passing configuration options through tidy_parse_string(). ---SKIPIF-- - ---FILE-- -testing"; - $tidy = tidy_parse_string($text, array('show-body-only'=>true)); - tidy_clean_repair($tidy); - echo tidy_get_output($tidy); - -?> ---EXPECT-- -testing \ No newline at end of file diff --git a/ext/tidy/tests/015.html b/ext/tidy/tests/015.html deleted file mode 100644 index 7dc0357779df4..0000000000000 --- a/ext/tidy/tests/015.html +++ /dev/null @@ -1 +0,0 @@ -testing diff --git a/ext/tidy/tests/015.phpt b/ext/tidy/tests/015.phpt deleted file mode 100644 index 03018ffa198fd..0000000000000 --- a/ext/tidy/tests/015.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Passing configuration options through tidy_parse_file(). ---SKIPIF-- - ---FILE-- -true)); - tidy_clean_repair($tidy); - echo tidy_get_output($tidy); - -?> ---EXPECT-- -testing \ No newline at end of file diff --git a/ext/tidy/tests/016.html b/ext/tidy/tests/016.html deleted file mode 100644 index 7dc6e4aba8c96..0000000000000 --- a/ext/tidy/tests/016.html +++ /dev/null @@ -1 +0,0 @@ -

testing

diff --git a/ext/tidy/tests/016.phpt b/ext/tidy/tests/016.phpt deleted file mode 100644 index 001371aa3e13e..0000000000000 --- a/ext/tidy/tests/016.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Passing configuration file through tidy_parse_file() (may fail with buggy libtidy) ---SKIPIF-- - ---FILE-- - ---EXPECT-- - - - - - - - - -

testing

- - diff --git a/ext/tidy/tests/016.tcfg b/ext/tidy/tests/016.tcfg deleted file mode 100644 index fd6e4e44f4fdd..0000000000000 --- a/ext/tidy/tests/016.tcfg +++ /dev/null @@ -1 +0,0 @@ -clean: yes diff --git a/ext/tidy/tests/017.phpt b/ext/tidy/tests/017.phpt deleted file mode 100644 index ba620a32ec329..0000000000000 --- a/ext/tidy/tests/017.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -The Tidy Output Buffer Filter ---SKIPIF-- - ---FILE-- - -testing ---EXPECT-- - - - - - - -testing - - \ No newline at end of file diff --git a/ext/tidy/tests/018.phpt b/ext/tidy/tests/018.phpt deleted file mode 100644 index 405a46d42b204..0000000000000 --- a/ext/tidy/tests/018.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -binary safety ---SKIPIF-- - ---FILE-- -abra\0cadabra

", - array( 'show-body-only' => true, - 'clean' => false, - 'newline' => "\n") - ); -var_dump($x); -?> ---EXPECT-- -string(19) "

abracadabra

-" diff --git a/ext/tidy/tests/019.phpt b/ext/tidy/tests/019.phpt deleted file mode 100644 index 9d2c693cdbad3..0000000000000 --- a/ext/tidy/tests/019.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -tidy_repair_*() and invalid parameters ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d - -Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d - -Warning: tidy_repair_string(): Could not load configuration file '' in %s on line %d - -Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d - -Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d - -Warning: tidy_repair_string() expects parameter 1 to be string, array given in %s on line %d - -Warning: tidy_repair_file() expects parameter 1 to be string, array given in %s on line %d -Done diff --git a/ext/tidy/tests/020.phpt b/ext/tidy/tests/020.phpt deleted file mode 100644 index dbfda96375bcb..0000000000000 --- a/ext/tidy/tests/020.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -OO API ---SKIPIF-- - ---FILE-- -Isto é um texto em Português
-para testes.

-EOF; - -$tidy->parseString($str, array('output-xhtml'=>1), 'latin1'); -$tidy->cleanRepair(); -$tidy->diagnose(); -var_dump(tidy_warning_count($tidy) > 0); -var_dump(strlen($tidy->errorBuffer) > 50); - -echo $tidy; -?> ---EXPECT-- -bool(true) -bool(true) - - - - - - - -

Isto é um texto em Português
-para testes.

- - diff --git a/ext/tidy/tests/021.phpt b/ext/tidy/tests/021.phpt deleted file mode 100644 index bdf954617babd..0000000000000 --- a/ext/tidy/tests/021.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -tidy_get_opt_doc() ---SKIPIF-- - ---FILE-- -getOptDoc('ncr')); -var_dump(strlen(tidy_get_opt_doc($t, 'wrap')) > 99); -?> ---EXPECTF-- -Warning: tidy_get_opt_doc(): Unknown Tidy Configuration Option 'some_bogus_cfg' in %s021.php on line 3 -bool(false) -string(73) "This option specifies if Tidy should allow numeric character references. " -bool(true) diff --git a/ext/tidy/tests/022.phpt b/ext/tidy/tests/022.phpt deleted file mode 100644 index 9d2c693cdbad3..0000000000000 --- a/ext/tidy/tests/022.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -tidy_repair_*() and invalid parameters ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d - -Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d - -Warning: tidy_repair_string(): Could not load configuration file '' in %s on line %d - -Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d - -Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d - -Warning: tidy_repair_string() expects parameter 1 to be string, array given in %s on line %d - -Warning: tidy_repair_file() expects parameter 1 to be string, array given in %s on line %d -Done diff --git a/ext/tidy/tests/023.phpt b/ext/tidy/tests/023.phpt deleted file mode 100644 index e7ee4b3c0c496..0000000000000 --- a/ext/tidy/tests/023.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -tidy and tidyNode OO ---SKIPIF-- - ---FILE-- -isHtml()); - -$tidy = new tidy(); -$tidy->parseString(''); - -var_dump(tidy_get_root($tidy)->child[0]->isHtml()); -var_dump(tidy_get_root($tidy)->child[0]->child[0]->isPHP()); -var_dump(tidy_get_root($tidy)->child[0]->child[0]->isAsp()); -var_dump(tidy_get_root($tidy)->child[0]->child[0]->isJste()); -var_dump(tidy_get_root($tidy)->child[0]->child[0]->type === TIDY_NODETYPE_PHP); - -var_dump(tidy_get_root($tidy)->child[0]->hasChildren()); -var_dump(tidy_get_root($tidy)->child[0]->child[0]->hasChildren()); - -?> ---EXPECT-- -object(tidyNode)#1 (0) { -} -object(tidy)#1 (2) { - ["errorBuffer"]=> - NULL - ["value"]=> - NULL -} -------- -bool(false) -bool(true) -bool(true) -bool(false) -bool(false) -bool(true) -bool(true) -bool(false) diff --git a/ext/tidy/tests/024.phpt b/ext/tidy/tests/024.phpt deleted file mode 100644 index f69b962aee7d6..0000000000000 --- a/ext/tidy/tests/024.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -libtidy handling of 'new-blocklevel-tags' ---SKIPIF-- - ---FILE-- - - - - -'; - -$config = array( -'new-blocklevel-tags' => 'wps:block,wps:var,wps:value' -); - -$tidy = tidy_parse_string($contents, $config, 'utf8'); -$tidy->cleanRepair(); - -var_dump($tidy->value); - -?> ---EXPECTF-- -string(11%d) " - - - - -%w -%w - -" diff --git a/ext/tidy/tests/025.phpt b/ext/tidy/tests/025.phpt deleted file mode 100644 index a7bd544d6736e..0000000000000 --- a/ext/tidy/tests/025.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -tidyNode tests ---SKIPIF-- - ---FILE-- -isPhp()); -var_dump($node->isText()); -var_dump($node->isComment()); -var_dump($node->hasSiblings()); -var_dump((string)$node); - -$tidy=tidy_parse_string('<% %>'); -var_dump($tidy->Root()->child[0]->isAsp()); - -$tidy=tidy_parse_string('<# #>'); -var_dump($tidy->Root()->child[0]->isJste()); - -$tidy=tidy_parse_string('text'); -var_dump($tidy->Root()->child[0]->child[1]->child[0]->isText()); - -$tidy=tidy_parse_string(''); -$n = $tidy->Root()->child[0]->child[1]->child[0]; -var_dump($n->isComment()); -var_dump((string)$n); -var_dump((bool)$n); -var_dump((double)$n); -var_dump((int)$n); -var_dump($tidy->Root()->child[0]->child[0]->hasSiblings()); - -?> ---EXPECT-- -bool(false) -bool(false) -bool(false) -bool(false) -string(0) "" -bool(true) -bool(true) -bool(true) -bool(true) -string(16) "" -bool(true) -float(0) -int(0) -bool(true) diff --git a/ext/tidy/tests/026.phpt b/ext/tidy/tests/026.phpt deleted file mode 100644 index 24a1e6f4a7c11..0000000000000 --- a/ext/tidy/tests/026.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -tidy.clean_output test ---SKIPIF-- - ---INI-- -tidy.clean_output=1 ---FILE-- - -xpto

'; - -?> - ---EXPECT-- - - - - - - -

xpto

- - diff --git a/ext/tidy/tests/027.phpt b/ext/tidy/tests/027.phpt deleted file mode 100644 index 8d9f66eaf714d..0000000000000 --- a/ext/tidy/tests/027.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Bug: tidy segfaults with markup=false ---SKIPIF-- - ---FILE-- -tidyconfig = array( - 'indent' => false, - 'clean' => true, - 'merge-divs' => false, - 'quote-marks' => true, - 'drop-empty-paras' => false, - 'markup' => false, - 'output-xhtml' => true, - 'wrap' => 0); - - } - - abstract public function run(); - - public function getURL($url) { - $data = "awerawer"; // in my code, $data is downloaded from a site - - $tidy = new tidy; - $tidy->parseString($data, $this->tidyconfig, 'utf8'); - $tidy->cleanRepair(); - - return $tidy; - } - -} - -class ChildClass extends BaseClass { - public function ChildClass() { - parent::__construct(); - } - - public function run() { - $result = $this->getURL('awer'); - if ($result === null) { - echo "\tError:\n"; - } - var_dump((string)$result); - } -} - -$instance = new ChildClass(); -$instance->run(); - -?> ---EXPECT-- -string(0) "" diff --git a/ext/tidy/tests/028.phpt b/ext/tidy/tests/028.phpt deleted file mode 100644 index 01f3fd1e1a99d..0000000000000 --- a/ext/tidy/tests/028.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -tidyNode::getParent() ---SKIPIF-- - ---FILE-- -
Content
"); -var_dump($x->body()->child[0]->name); -var_dump($x->body()->child[0]->getParent()->name); -var_dump($x->root()->getParent()); -?> ---EXPECT-- -string(3) "div" -string(4) "body" -NULL diff --git a/ext/tidy/tests/029.phpt b/ext/tidy/tests/029.phpt deleted file mode 100644 index 1709cd6f09b05..0000000000000 --- a/ext/tidy/tests/029.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -tidy_get_body() crash ---SKIPIF-- - ---FILE-- - ', - ' cleanRepair(); - var_dump(tidy_get_body($t)); -} - -echo "Done\n"; -?> ---EXPECT-- -NULL -NULL -Done diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c deleted file mode 100644 index e212b09bac4e1..0000000000000 --- a/ext/tidy/tidy.c +++ /dev/null @@ -1,1843 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: John Coggeshall | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_tidy.h" - -#if HAVE_TIDY - -#include "php_ini.h" -#include "ext/standard/info.h" -#include "safe_mode.h" - -#include "tidy.h" -#include "buffio.h" - -/* compatibility with older versions of libtidy */ -#ifndef TIDY_CALL -#define TIDY_CALL -#endif - -#define PHP_TIDY_MODULE_VERSION "2.0" - -/* {{{ ext/tidy macros -*/ -#define TIDY_SET_CONTEXT \ - zval *object = getThis(); - -#define TIDY_FETCH_OBJECT \ - PHPTidyObj *obj; \ - TIDY_SET_CONTEXT; \ - if (object) { \ - if (ZEND_NUM_ARGS()) { \ - WRONG_PARAM_COUNT; \ - } \ - } else { \ - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, tidy_ce_doc) == FAILURE) { \ - RETURN_FALSE; \ - } \ - } \ - obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC); \ - -#define TIDY_FETCH_ONLY_OBJECT \ - PHPTidyObj *obj; \ - TIDY_SET_CONTEXT; \ - if (ZEND_NUM_ARGS()) { \ - WRONG_PARAM_COUNT; \ - } \ - obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC); \ - -#define TIDY_APPLY_CONFIG_ZVAL(_doc, _val) \ - if(_val) { \ - if(Z_TYPE_PP(_val) == IS_ARRAY) { \ - _php_tidy_apply_config_array(_doc, HASH_OF(*_val) TSRMLS_CC); \ - } else { \ - convert_to_string_ex(_val); \ - TIDY_SAFE_MODE_CHECK(Z_STRVAL_PP(_val)); \ - switch (tidyLoadConfig(_doc, Z_STRVAL_PP(_val))) { \ - case -1: \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_PP(_val)); \ - break; \ - case 1: \ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There were errors while parsing the configuration file '%s'", Z_STRVAL_PP(_val)); \ - break; \ - } \ - } \ - } - -#define REGISTER_TIDY_CLASS(classname, name, parent, __flags) \ - { \ - zend_class_entry ce; \ - INIT_CLASS_ENTRY(ce, # classname, tidy_funcs_ ## name); \ - ce.create_object = tidy_object_new_ ## name; \ - tidy_ce_ ## name = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \ - tidy_ce_ ## name->ce_flags |= __flags; \ - memcpy(&tidy_object_handlers_ ## name, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); \ - tidy_object_handlers_ ## name.clone_obj = NULL; \ - } - -#define TIDY_TAG_CONST(tag) REGISTER_LONG_CONSTANT("TIDY_TAG_" #tag, TidyTag_##tag, CONST_CS | CONST_PERSISTENT) -#define TIDY_NODE_CONST(name, type) REGISTER_LONG_CONSTANT("TIDY_NODETYPE_" #name, TidyNode_##type, CONST_CS | CONST_PERSISTENT) - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#define ADD_PROPERTY_STRING(_table, _key, _string) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - if (_string) { \ - ZVAL_STRING(tmp, (char *)_string, 1); \ - } else { \ - ZVAL_EMPTY_STRING(tmp); \ - } \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define ADD_PROPERTY_STRINGL(_table, _key, _string, _len) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - if (_string) { \ - ZVAL_STRINGL(tmp, (char *)_string, _len, 1); \ - } else { \ - ZVAL_EMPTY_STRING(tmp); \ - } \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define ADD_PROPERTY_LONG(_table, _key, _long) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - ZVAL_LONG(tmp, _long); \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define ADD_PROPERTY_NULL(_table, _key) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - ZVAL_NULL(tmp); \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define ADD_PROPERTY_BOOL(_table, _key, _bool) \ - { \ - zval *tmp; \ - MAKE_STD_ZVAL(tmp); \ - ZVAL_BOOL(tmp, _bool); \ - zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, sizeof(zval *), NULL); \ - } - -#define TIDY_SAFE_MODE_CHECK(filename) \ -if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)) { \ - RETURN_FALSE; \ -} \ - -#define TIDY_SET_DEFAULT_CONFIG(_doc) \ - if (TG(default_config) && TG(default_config)[0]) { \ - if (tidyLoadConfig(_doc, TG(default_config)) < 0) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load Tidy configuration file at '%s'.", TG(default_config)); \ - } \ - } -/* }}} */ - -/* {{{ ext/tidy structs -*/ -typedef struct _PHPTidyDoc PHPTidyDoc; -typedef struct _PHPTidyObj PHPTidyObj; - -typedef enum { - is_node, - is_doc -} tidy_obj_type; - -typedef enum { - is_root_node, - is_html_node, - is_head_node, - is_body_node -} tidy_base_nodetypes; - -struct _PHPTidyDoc { - TidyDoc doc; - TidyBuffer *errbuf; - unsigned int ref_count; -}; - -struct _PHPTidyObj { - zend_object std; - TidyNode node; - tidy_obj_type type; - PHPTidyDoc *ptdoc; -}; -/* }}} */ - -/* {{{ ext/tidy prototypes -*/ -static char *php_tidy_file_to_mem(char *, zend_bool, int * TSRMLS_DC); -static void tidy_object_free_storage(void * TSRMLS_DC); -static zend_object_value tidy_object_new_node(zend_class_entry * TSRMLS_DC); -static zend_object_value tidy_object_new_doc(zend_class_entry * TSRMLS_DC); -static zend_class_entry *tidy_get_ce_node(zval * TSRMLS_DC); -static zend_class_entry *tidy_get_ce_doc(zval * TSRMLS_DC); -static zval * tidy_instanciate(zend_class_entry *, zval * TSRMLS_DC); -static int tidy_doc_cast_handler(zval *, zval *, int TSRMLS_DC); -static int tidy_node_cast_handler(zval *, zval *, int TSRMLS_DC); -static void tidy_doc_update_properties(PHPTidyObj * TSRMLS_DC); -static void tidy_add_default_properties(PHPTidyObj *, tidy_obj_type TSRMLS_DC); -static void *php_tidy_get_opt_val(PHPTidyDoc *, TidyOption, TidyOptionType * TSRMLS_DC); -static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetypes); -static int _php_tidy_set_tidy_opt(TidyDoc, char *, zval * TSRMLS_DC); -static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRMLS_DC); -static void _php_tidy_register_nodetypes(INIT_FUNC_ARGS); -static void _php_tidy_register_tags(INIT_FUNC_ARGS); - -static PHP_MINIT_FUNCTION(tidy); -static PHP_MSHUTDOWN_FUNCTION(tidy); -static PHP_RINIT_FUNCTION(tidy); -static PHP_MINFO_FUNCTION(tidy); - -static PHP_FUNCTION(tidy_getopt); -static PHP_FUNCTION(tidy_parse_string); -static PHP_FUNCTION(tidy_parse_file); -static PHP_FUNCTION(tidy_clean_repair); -static PHP_FUNCTION(tidy_repair_string); -static PHP_FUNCTION(tidy_repair_file); -static PHP_FUNCTION(tidy_diagnose); -static PHP_FUNCTION(tidy_get_output); -static PHP_FUNCTION(tidy_get_error_buffer); -static PHP_FUNCTION(tidy_get_release); -static PHP_FUNCTION(tidy_get_config); -static PHP_FUNCTION(tidy_get_status); -static PHP_FUNCTION(tidy_get_html_ver); -#if HAVE_TIDYOPTGETDOC -static PHP_FUNCTION(tidy_get_opt_doc); -#endif -static PHP_FUNCTION(tidy_is_xhtml); -static PHP_FUNCTION(tidy_is_xml); -static PHP_FUNCTION(tidy_error_count); -static PHP_FUNCTION(tidy_warning_count); -static PHP_FUNCTION(tidy_access_count); -static PHP_FUNCTION(tidy_config_count); - -static PHP_FUNCTION(ob_tidyhandler); - -static PHP_FUNCTION(tidy_get_root); -static PHP_FUNCTION(tidy_get_html); -static PHP_FUNCTION(tidy_get_head); -static PHP_FUNCTION(tidy_get_body); - -static TIDY_DOC_METHOD(__construct); -static TIDY_DOC_METHOD(parseFile); -static TIDY_DOC_METHOD(parseString); - -static TIDY_NODE_METHOD(hasChildren); -static TIDY_NODE_METHOD(hasSiblings); -static TIDY_NODE_METHOD(isComment); -static TIDY_NODE_METHOD(isHtml); -static TIDY_NODE_METHOD(isText); -static TIDY_NODE_METHOD(isJste); -static TIDY_NODE_METHOD(isAsp); -static TIDY_NODE_METHOD(isPhp); -static TIDY_NODE_METHOD(getParent); -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(tidy) - -PHP_INI_BEGIN() -STD_PHP_INI_ENTRY("tidy.default_config", "", PHP_INI_SYSTEM, OnUpdateString, default_config, zend_tidy_globals, tidy_globals) -PHP_INI_ENTRY("tidy.clean_output", "0", PHP_INI_PERDIR, NULL) -PHP_INI_END() - -static zend_function_entry tidy_functions[] = { - PHP_FE(tidy_getopt, NULL) - PHP_FE(tidy_parse_string, NULL) - PHP_FE(tidy_parse_file, NULL) - PHP_FE(tidy_get_output, NULL) - PHP_FE(tidy_get_error_buffer, NULL) - PHP_FE(tidy_clean_repair, NULL) - PHP_FE(tidy_repair_string, NULL) - PHP_FE(tidy_repair_file, NULL) - PHP_FE(tidy_diagnose, NULL) - PHP_FE(tidy_get_release, NULL) - PHP_FE(tidy_get_config, NULL) - PHP_FE(tidy_get_status, NULL) - PHP_FE(tidy_get_html_ver, NULL) - PHP_FE(tidy_is_xhtml, NULL) - PHP_FE(tidy_is_xml, NULL) - PHP_FE(tidy_error_count, NULL) - PHP_FE(tidy_warning_count, NULL) - PHP_FE(tidy_access_count, NULL) - PHP_FE(tidy_config_count, NULL) -#if HAVE_TIDYOPTGETDOC - PHP_FE(tidy_get_opt_doc, NULL) -#endif - PHP_FE(tidy_get_root, NULL) - PHP_FE(tidy_get_head, NULL) - PHP_FE(tidy_get_html, NULL) - PHP_FE(tidy_get_body, NULL) - PHP_FE(ob_tidyhandler, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry tidy_funcs_doc[] = { - TIDY_METHOD_MAP(getOpt, tidy_getopt, NULL) - TIDY_METHOD_MAP(cleanRepair, tidy_clean_repair, NULL) - TIDY_DOC_ME(parseFile, NULL) - TIDY_DOC_ME(parseString, NULL) - TIDY_METHOD_MAP(repairString, tidy_repair_string, NULL) - TIDY_METHOD_MAP(repairFile, tidy_repair_file, NULL) - TIDY_METHOD_MAP(diagnose, tidy_diagnose, NULL) - TIDY_METHOD_MAP(getRelease, tidy_get_release, NULL) - TIDY_METHOD_MAP(getConfig, tidy_get_config, NULL) - TIDY_METHOD_MAP(getStatus, tidy_get_status, NULL) - TIDY_METHOD_MAP(getHtmlVer, tidy_get_html_ver, NULL) -#if HAVE_TIDYOPTGETDOC - TIDY_METHOD_MAP(getOptDoc, tidy_get_opt_doc, NULL) -#endif - TIDY_METHOD_MAP(isXhtml, tidy_is_xhtml, NULL) - TIDY_METHOD_MAP(isXml, tidy_is_xml, NULL) - TIDY_METHOD_MAP(root, tidy_get_root, NULL) - TIDY_METHOD_MAP(head, tidy_get_head, NULL) - TIDY_METHOD_MAP(html, tidy_get_html, NULL) - TIDY_METHOD_MAP(body, tidy_get_body, NULL) - TIDY_DOC_ME(__construct, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry tidy_funcs_node[] = { - TIDY_NODE_ME(hasChildren, NULL) - TIDY_NODE_ME(hasSiblings, NULL) - TIDY_NODE_ME(isComment, NULL) - TIDY_NODE_ME(isHtml, NULL) - TIDY_NODE_ME(isText, NULL) - TIDY_NODE_ME(isJste, NULL) - TIDY_NODE_ME(isAsp, NULL) - TIDY_NODE_ME(isPhp, NULL) - TIDY_NODE_ME(getParent, NULL) - {NULL, NULL, NULL} -}; - -static zend_class_entry *tidy_ce_doc, *tidy_ce_node; - -static zend_object_handlers tidy_object_handlers_doc; -static zend_object_handlers tidy_object_handlers_node; - -zend_module_entry tidy_module_entry = { - STANDARD_MODULE_HEADER, - "tidy", - tidy_functions, - PHP_MINIT(tidy), - PHP_MSHUTDOWN(tidy), - PHP_RINIT(tidy), - NULL, - PHP_MINFO(tidy), - PHP_TIDY_MODULE_VERSION, - PHP_MODULE_GLOBALS(tidy), - NULL, - NULL, - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; - -#ifdef COMPILE_DL_TIDY -ZEND_GET_MODULE(tidy) -#endif - -static void* TIDY_CALL php_tidy_malloc(size_t len) -{ - return emalloc(len); -} - -static void* TIDY_CALL php_tidy_realloc(void *buf, size_t len) -{ - return erealloc(buf, len); -} - -static void TIDY_CALL php_tidy_free(void *buf) -{ - efree(buf); -} - -static void TIDY_CALL php_tidy_panic(ctmbstr msg) -{ - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg); -} - -static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS_DC) -{ - TidyOption opt = tidyGetOptionByName(doc, optname); - zval conv = *value; - - if (!opt) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown Tidy Configuration Option '%s'", optname); - return FAILURE; - } - - if (tidyOptIsReadOnly(opt)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Attempting to set read-only option '%s'", optname); - return FAILURE; - } - - switch(tidyOptGetType(opt)) { - case TidyString: - if (Z_TYPE(conv) != IS_STRING) { - zval_copy_ctor(&conv); - convert_to_string(&conv); - } - if (tidyOptSetValue(doc, tidyOptGetId(opt), Z_STRVAL(conv))) { - if (Z_TYPE(conv) != Z_TYPE_P(value)) { - zval_dtor(&conv); - } - return SUCCESS; - } - if (Z_TYPE(conv) != Z_TYPE_P(value)) { - zval_dtor(&conv); - } - break; - - case TidyInteger: - if (Z_TYPE(conv) != IS_LONG) { - zval_copy_ctor(&conv); - convert_to_long(&conv); - } - if (tidyOptSetInt(doc, tidyOptGetId(opt), Z_LVAL(conv))) { - return SUCCESS; - } - break; - - case TidyBoolean: - if (Z_TYPE(conv) != IS_LONG) { - zval_copy_ctor(&conv); - convert_to_long(&conv); - } - if (tidyOptSetBool(doc, tidyOptGetId(opt), Z_LVAL(conv))) { - return SUCCESS; - } - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of configuration option"); - break; - } - - return FAILURE; -} - -static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_file) -{ - char *data=NULL, *arg1, *enc = NULL; - int arg1_len, enc_len = 0, data_len = 0; - zend_bool use_include_path = 0; - TidyDoc doc; - TidyBuffer *errbuf; - zval **config; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) { - RETURN_FALSE; - } - - if (is_file) { - if (!(data = php_tidy_file_to_mem(arg1, use_include_path, &data_len TSRMLS_CC))) { - RETURN_FALSE; - } - } else { - data = arg1; - data_len = arg1_len; - } - - doc = tidyCreate(); - errbuf = emalloc(sizeof(TidyBuffer)); - tidyBufInit(errbuf); - - if (tidySetErrorBuffer(doc, errbuf) != 0) { - tidyBufFree(errbuf); - efree(errbuf); - tidyRelease(doc); - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer"); - } - - tidyOptSetBool(doc, TidyForceOutput, yes); - tidyOptSetBool(doc, TidyMark, no); - - TIDY_SET_DEFAULT_CONFIG(doc); - - if (ZEND_NUM_ARGS() > 1) { - TIDY_APPLY_CONFIG_ZVAL(doc, config); - } - - if(enc_len) { - if (tidySetCharEncoding(doc, enc) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", enc); - RETVAL_FALSE; - } - } - - if (data) { - TidyBuffer buf; - - tidyBufInit(&buf); - tidyBufAppend(&buf, data, data_len); - - if (tidyParseBuffer(doc, &buf) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf->bp); - RETVAL_FALSE; - } else { - if (tidyCleanAndRepair(doc) >= 0) { - TidyBuffer output; - tidyBufInit(&output); - - tidySaveBuffer (doc, &output); - RETVAL_STRINGL((char*)output.bp, output.size ? output.size-1 : 0, 1); - tidyBufFree(&output); - } else { - RETVAL_FALSE; - } - } - - tidyBufFree(&buf); - } - - if (is_file) { - efree(data); - } - - tidyBufFree(errbuf); - efree(errbuf); - tidyRelease(doc); -} - -static char *php_tidy_file_to_mem(char *filename, zend_bool use_include_path, int *len TSRMLS_DC) -{ - php_stream *stream; - char *data = NULL; - - if (!(stream = php_stream_open_wrapper(filename, "rb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE, NULL))) { - return NULL; - } - if ((*len = (int) php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0)) == 0) { - data = estrdup(""); - *len = 0; - } - php_stream_close(stream); - - return data; -} - -static void tidy_object_free_storage(void *object TSRMLS_DC) -{ - PHPTidyObj *intern = (PHPTidyObj *)object; - - zend_object_std_dtor(&intern->std TSRMLS_CC); - - if (intern->ptdoc) { - intern->ptdoc->ref_count--; - - if (intern->ptdoc->ref_count <= 0) { - tidyBufFree(intern->ptdoc->errbuf); - efree(intern->ptdoc->errbuf); - tidyRelease(intern->ptdoc->doc); - efree(intern->ptdoc); - } - } - - efree(object); -} - -static void tidy_object_new(zend_class_entry *class_type, zend_object_handlers *handlers, - zend_object_value *retval, tidy_obj_type objtype TSRMLS_DC) -{ - PHPTidyObj *intern; - zval *tmp; - - intern = emalloc(sizeof(PHPTidyObj)); - memset(intern, 0, sizeof(PHPTidyObj)); - zend_object_std_init(&intern->std, class_type TSRMLS_CC); - - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - switch(objtype) { - case is_node: - break; - - case is_doc: - tidySetMallocCall(php_tidy_malloc); - tidySetReallocCall(php_tidy_realloc); - tidySetFreeCall(php_tidy_free); - tidySetPanicCall(php_tidy_panic); - - intern->ptdoc = emalloc(sizeof(PHPTidyDoc)); - intern->ptdoc->doc = tidyCreate(); - intern->ptdoc->ref_count = 1; - intern->ptdoc->errbuf = emalloc(sizeof(TidyBuffer)); - tidyBufInit(intern->ptdoc->errbuf); - - if (tidySetErrorBuffer(intern->ptdoc->doc, intern->ptdoc->errbuf) != 0) { - tidyBufFree(intern->ptdoc->errbuf); - efree(intern->ptdoc->errbuf); - tidyRelease(intern->ptdoc->doc); - efree(intern->ptdoc); - efree(intern); - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer"); - } - - tidyOptSetBool(intern->ptdoc->doc, TidyForceOutput, yes); - tidyOptSetBool(intern->ptdoc->doc, TidyMark, no); - - TIDY_SET_DEFAULT_CONFIG(intern->ptdoc->doc); - - tidy_add_default_properties(intern, is_doc TSRMLS_CC); - break; - - default: - break; - } - - retval->handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) tidy_object_free_storage, NULL TSRMLS_CC); - retval->handlers = handlers; -} - -static zend_object_value tidy_object_new_node(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - tidy_object_new(class_type, &tidy_object_handlers_node, &retval, is_node TSRMLS_CC); - return retval; -} - -static zend_object_value tidy_object_new_doc(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - tidy_object_new(class_type, &tidy_object_handlers_doc, &retval, is_doc TSRMLS_CC); - return retval; -} - -static zend_class_entry *tidy_get_ce_node(zval *object TSRMLS_DC) -{ - return tidy_ce_node; -} - -static zend_class_entry *tidy_get_ce_doc(zval *object TSRMLS_DC) -{ - return tidy_ce_doc; -} - -static zval * tidy_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC) -{ - if (!object) { - ALLOC_ZVAL(object); - } - - Z_TYPE_P(object) = IS_OBJECT; - object_init_ex(object, pce); - object->refcount = 1; - object->is_ref = 1; - return object; -} - -static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC) -{ - TidyBuffer output; - PHPTidyObj *obj; - - switch(type) { - case IS_LONG: - ZVAL_LONG(out, 0); - break; - - case IS_DOUBLE: - ZVAL_DOUBLE(out, 0); - break; - - case IS_BOOL: - ZVAL_BOOL(out, TRUE); - break; - - case IS_STRING: - obj = (PHPTidyObj *)zend_object_store_get_object(in TSRMLS_CC); - tidyBufInit(&output); - tidySaveBuffer (obj->ptdoc->doc, &output); - ZVAL_STRINGL(out, (char*)output.bp, output.size ? output.size-1 : 0, TRUE); - tidyBufFree(&output); - break; - - default: - return FAILURE; - } - - return SUCCESS; -} - -static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC) -{ - TidyBuffer buf; - PHPTidyObj *obj; - - switch(type) { - case IS_LONG: - ZVAL_LONG(out, 0); - break; - - case IS_DOUBLE: - ZVAL_DOUBLE(out, 0); - break; - - case IS_BOOL: - ZVAL_BOOL(out, TRUE); - break; - - case IS_STRING: - obj = (PHPTidyObj *)zend_object_store_get_object(in TSRMLS_CC); - tidyBufInit(&buf); - if (obj->ptdoc) { - tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf); - } - ZVAL_STRINGL(out, (char*)buf.bp, buf.size ? buf.size-1 : 0, TRUE); - tidyBufFree(&buf); - break; - - default: - return FAILURE; - } - - return SUCCESS; -} - -static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC) -{ - - TidyBuffer output; - zval *temp; - - tidyBufInit(&output); - tidySaveBuffer (obj->ptdoc->doc, &output); - - if (output.size) { - MAKE_STD_ZVAL(temp); - ZVAL_STRINGL(temp, (char*)output.bp, output.size-1, TRUE); - zend_hash_update(obj->std.properties, "value", sizeof("value"), (void *)&temp, sizeof(zval *), NULL); - } - - tidyBufFree(&output); - - if (obj->ptdoc->errbuf->size) { - MAKE_STD_ZVAL(temp); - ZVAL_STRINGL(temp, (char*)obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size-1, TRUE); - zend_hash_update(obj->std.properties, "errorBuffer", sizeof("errorBuffer"), (void *)&temp, sizeof(zval *), NULL); - } -} - -static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRMLS_DC) -{ - - TidyBuffer buf; - TidyAttr tempattr; - TidyNode tempnode; - zval *attribute, *children, *temp; - PHPTidyObj *newobj; - - switch(type) { - - case is_node: - tidyBufInit(&buf); - tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf); - ADD_PROPERTY_STRINGL(obj->std.properties, value, buf.bp, buf.size-1); - tidyBufFree(&buf); - - ADD_PROPERTY_STRING(obj->std.properties, name, tidyNodeGetName(obj->node)); - ADD_PROPERTY_LONG(obj->std.properties, type, tidyNodeGetType(obj->node)); - ADD_PROPERTY_LONG(obj->std.properties, line, tidyNodeLine(obj->node)); - ADD_PROPERTY_LONG(obj->std.properties, column, tidyNodeColumn(obj->node)); - ADD_PROPERTY_BOOL(obj->std.properties, proprietary, tidyNodeIsProp(obj->ptdoc->doc, obj->node)); - - switch(tidyNodeGetType(obj->node)) { - case TidyNode_Root: - case TidyNode_DocType: - case TidyNode_Text: - case TidyNode_Comment: - break; - - default: - ADD_PROPERTY_LONG(obj->std.properties, id, tidyNodeGetId(obj->node)); - } - - tempattr = tidyAttrFirst(obj->node); - MAKE_STD_ZVAL(attribute); - - if (tempattr) { - char *name, *val; - array_init(attribute); - - do { - name = (char *)tidyAttrName(tempattr); - val = (char *)tidyAttrValue(tempattr); - if (name && val) { - add_assoc_string(attribute, name, val, TRUE); - } - } while((tempattr = tidyAttrNext(tempattr))); - } else { - ZVAL_NULL(attribute); - } - zend_hash_update(obj->std.properties, "attribute", sizeof("attribute"), (void *)&attribute, sizeof(zval *), NULL); - - tempnode = tidyGetChild(obj->node); - - MAKE_STD_ZVAL(children); - if (tempnode) { - array_init(children); - do { - MAKE_STD_ZVAL(temp); - tidy_instanciate(tidy_ce_node, temp TSRMLS_CC); - newobj = (PHPTidyObj *) zend_object_store_get_object(temp TSRMLS_CC); - newobj->node = tempnode; - newobj->type = is_node; - newobj->ptdoc = obj->ptdoc; - newobj->ptdoc->ref_count++; - - tidy_add_default_properties(newobj, is_node TSRMLS_CC); - add_next_index_zval(children, temp); - - } while((tempnode = tidyGetNext(tempnode))); - - } else { - ZVAL_NULL(children); - } - - zend_hash_update(obj->std.properties, "child", sizeof("child"), (void *)&children, sizeof(zval *), NULL); - - break; - - case is_doc: - ADD_PROPERTY_NULL(obj->std.properties, errorBuffer); - ADD_PROPERTY_NULL(obj->std.properties, value); - break; - } -} - -static void *php_tidy_get_opt_val(PHPTidyDoc *ptdoc, TidyOption opt, TidyOptionType *type TSRMLS_DC) -{ - *type = tidyOptGetType(opt); - - switch (*type) { - case TidyString: { - char *val = (char *) tidyOptGetValue(ptdoc->doc, tidyOptGetId(opt)); - if (val) { - return (void *) estrdup(val); - } else { - return (void *) estrdup(""); - } - } - break; - - case TidyInteger: - return (void *) tidyOptGetInt(ptdoc->doc, tidyOptGetId(opt)); - break; - - case TidyBoolean: - return (void *) tidyOptGetBool(ptdoc->doc, tidyOptGetId(opt)); - break; - } - - /* should not happen */ - return NULL; -} - -static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetypes node_type) -{ - PHPTidyObj *newobj; - TidyNode node; - TIDY_FETCH_OBJECT; - - switch (node_type) { - case is_root_node: - node = tidyGetRoot(obj->ptdoc->doc); - break; - - case is_html_node: - node = tidyGetHtml(obj->ptdoc->doc); - break; - - case is_head_node: - node = tidyGetHead(obj->ptdoc->doc); - break; - - case is_body_node: - node = tidyGetBody(obj->ptdoc->doc); - break; - } - - if (!node) { - RETURN_NULL(); - } - - tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC); - newobj = (PHPTidyObj *) zend_object_store_get_object(return_value TSRMLS_CC); - newobj->type = is_node; - newobj->ptdoc = obj->ptdoc; - newobj->node = node; - newobj->ptdoc->ref_count++; - - tidy_add_default_properties(newobj, is_node TSRMLS_CC); -} - -static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRMLS_DC) -{ - char *opt_name = NULL; - zval **opt_val; - ulong opt_indx; - - for (zend_hash_internal_pointer_reset(ht_options); - zend_hash_get_current_data(ht_options, (void **)&opt_val) == SUCCESS; - zend_hash_move_forward(ht_options)) { - - if(zend_hash_get_current_key(ht_options, &opt_name, &opt_indx, FALSE) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not retrieve key from option array"); - return FAILURE; - } - - if(opt_name) { - _php_tidy_set_tidy_opt(doc, opt_name, *opt_val TSRMLS_CC); - opt_name = NULL; - } - - } - - return SUCCESS; -} - -static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *enc TSRMLS_DC) -{ - TidyBuffer buf; - - if(enc) { - if (tidySetCharEncoding(obj->ptdoc->doc, enc) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", enc); - return FAILURE; - } - } - - tidyBufInit(&buf); - tidyBufAppend(&buf, string, len); - if (tidyParseBuffer(obj->ptdoc->doc, &buf) < 0) { - tidyBufFree(&buf); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", obj->ptdoc->errbuf->bp); - return FAILURE; - - } - tidyBufFree(&buf); - tidy_doc_update_properties(obj TSRMLS_CC); - - return SUCCESS; -} - -static PHP_MINIT_FUNCTION(tidy) -{ - REGISTER_INI_ENTRIES(); - REGISTER_TIDY_CLASS(tidy, doc, NULL, 0); - REGISTER_TIDY_CLASS(tidyNode, node, NULL, ZEND_ACC_FINAL_CLASS); - - tidy_object_handlers_doc.get_class_entry = tidy_get_ce_doc; - tidy_object_handlers_node.get_class_entry = tidy_get_ce_node; - - tidy_object_handlers_doc.cast_object = tidy_doc_cast_handler; - tidy_object_handlers_node.cast_object = tidy_node_cast_handler; - - _php_tidy_register_tags(INIT_FUNC_ARGS_PASSTHRU); - _php_tidy_register_nodetypes(INIT_FUNC_ARGS_PASSTHRU); - - return SUCCESS; -} - -static PHP_RINIT_FUNCTION(tidy) -{ - if (INI_BOOL("tidy.clean_output") == TRUE) { - if (php_start_ob_buffer_named("ob_tidyhandler", 0, 1 TSRMLS_CC) == FAILURE) { - zend_error(E_NOTICE, "Failure installing Tidy output buffering."); - } - } - - return SUCCESS; -} - -static PHP_MSHUTDOWN_FUNCTION(tidy) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -static PHP_MINFO_FUNCTION(tidy) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "Tidy support", "enabled"); - php_info_print_table_row(2, "libTidy Release", (char *)tidyReleaseDate()); - php_info_print_table_row(2, "Extension Version", PHP_TIDY_MODULE_VERSION " ($Id$)"); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - -static PHP_FUNCTION(ob_tidyhandler) -{ - char *input; - int input_len; - long mode; - TidyBuffer errbuf; - TidyDoc doc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &input, &input_len, &mode) == FAILURE) { - return; - } - - doc = tidyCreate(); - tidyBufInit(&errbuf); - - tidyOptSetBool(doc, TidyForceOutput, yes); - tidyOptSetBool(doc, TidyMark, no); - - if (tidySetErrorBuffer(doc, &errbuf) != 0) { - tidyRelease(doc); - tidyBufFree(&errbuf); - - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer"); - } - - TIDY_SET_DEFAULT_CONFIG(doc); - - if (input_len > 1) { - TidyBuffer buf; - - tidyBufInit(&buf); - tidyBufAppend(&buf, input, input_len); - - if (tidyParseBuffer(doc, &buf) < 0 || tidyCleanAndRepair(doc) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf.bp); - RETVAL_NULL(); - } else { - TidyBuffer output; - tidyBufInit(&output); - - tidySaveBuffer(doc, &output); - RETVAL_STRINGL((char*)output.bp, output.size ? output.size-1 : 0, 1); - - tidyBufFree(&output); - } - - tidyBufFree(&buf); - } else { - RETVAL_NULL(); - } - - tidyRelease(doc); - tidyBufFree(&errbuf); -} - -/* {{{ proto bool tidy_parse_string(string input [, mixed config_options [, string encoding]]) - Parse a document stored in a string */ -static PHP_FUNCTION(tidy_parse_string) -{ - char *input, *enc = NULL; - int input_len, enc_len = 0; - zval **options = NULL; - - PHPTidyObj *obj; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zs", &input, &input_len, &options, &enc, &enc_len) == FAILURE) { - RETURN_FALSE; - } - - tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC); - obj = (PHPTidyObj *) zend_object_store_get_object(return_value TSRMLS_CC); - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - if(php_tidy_parse_string(obj, input, input_len, enc TSRMLS_CC) == FAILURE) { - zval_dtor(return_value); - INIT_ZVAL(*return_value); - RETURN_FALSE; - } - -} -/* }}} */ - -/* {{{ proto string tidy_get_error_buffer([boolean detailed]) - Return warnings and errors which occured parsing the specified document*/ -static PHP_FUNCTION(tidy_get_error_buffer) -{ - TIDY_FETCH_OBJECT; - - if (obj->ptdoc->errbuf && obj->ptdoc->errbuf->bp) { - RETURN_STRINGL((char*)obj->ptdoc->errbuf->bp, obj->ptdoc->errbuf->size-1, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string tidy_get_output() - Return a string representing the parsed tidy markup */ -static PHP_FUNCTION(tidy_get_output) -{ - TidyBuffer output; - TIDY_FETCH_OBJECT; - - tidyBufInit(&output); - tidySaveBuffer(obj->ptdoc->doc, &output); - - RETVAL_STRINGL((char*)output.bp, output.size ? output.size-1 : 0, 1); - - tidyBufFree(&output); -} -/* }}} */ - -/* {{{ proto boolean tidy_parse_file(string file [, mixed config_options [, string encoding [, bool use_include_path]]]) - Parse markup in file or URI */ -static PHP_FUNCTION(tidy_parse_file) -{ - char *inputfile, *enc = NULL; - int input_len, contents_len, enc_len = 0; - zend_bool use_include_path = 0; - char *contents; - zval **options = NULL; - - PHPTidyObj *obj; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &inputfile, &input_len, - &options, &enc, &enc_len, &use_include_path) == FAILURE) { - RETURN_FALSE; - } - - tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC); - obj = (PHPTidyObj *) zend_object_store_get_object(return_value TSRMLS_CC); - - if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path, &contents_len TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include path)" : ""); - RETURN_FALSE; - } - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - if(php_tidy_parse_string(obj, contents, contents_len, enc TSRMLS_CC) == FAILURE) { - zval_dtor(return_value); - INIT_ZVAL(*return_value); - RETVAL_FALSE; - } - - efree(contents); -} -/* }}} */ - -/* {{{ proto boolean tidy_clean_repair() - Execute configured cleanup and repair operations on parsed markup */ -static PHP_FUNCTION(tidy_clean_repair) -{ - TIDY_FETCH_OBJECT; - - if (tidyCleanAndRepair(obj->ptdoc->doc) >= 0) { - tidy_doc_update_properties(obj TSRMLS_CC); - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean tidy_repair_string(string data [, mixed config_file [, string encoding]]) - Repair a string using an optionally provided configuration file */ -static PHP_FUNCTION(tidy_repair_string) -{ - php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE); -} -/* }}} */ - -/* {{{ proto boolean tidy_repair_file(string filename [, mixed config_file [, string encoding [, bool use_include_path]]]) - Repair a file using an optionally provided configuration file */ -static PHP_FUNCTION(tidy_repair_file) -{ - php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, TRUE); -} -/* }}} */ - -/* {{{ proto boolean tidy_diagnose() - Run configured diagnostics on parsed and repaired markup. */ -static PHP_FUNCTION(tidy_diagnose) -{ - TIDY_FETCH_OBJECT; - - if (tidyRunDiagnostics(obj->ptdoc->doc) >= 0) { - tidy_doc_update_properties(obj TSRMLS_CC); - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string tidy_get_release() - Get release date (version) for Tidy library */ -static PHP_FUNCTION(tidy_get_release) -{ - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - - RETURN_STRING((char *)tidyReleaseDate(), 1); -} -/* }}} */ - - -#if HAVE_TIDYOPTGETDOC -/* {{{ proto string tidy_get_opt_doc(tidy resource, string optname) - Returns the documentation for the given option name */ -static PHP_FUNCTION(tidy_get_opt_doc) -{ - PHPTidyObj *obj; - char *optname, *optval; - int optname_len; - TidyOption opt; - - TIDY_SET_CONTEXT; - - if (object) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) { - RETURN_FALSE; - } - } else { - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) { - RETURN_FALSE; - } - } - - obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC); - - opt = tidyGetOptionByName(obj->ptdoc->doc, optname); - - if (!opt) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname); - RETURN_FALSE; - } - - if ( (optval = (char *) tidyOptGetDoc(obj->ptdoc->doc, opt)) ) { - RETURN_STRING(optval, 1); - } - - RETURN_FALSE; -} -/* }}} */ -#endif - - -/* {{{ proto array tidy_get_config() - Get current Tidy configuarion */ -static PHP_FUNCTION(tidy_get_config) -{ - TidyIterator itOpt; - char *opt_name; - void *opt_value; - TidyOptionType optt; - - TIDY_FETCH_OBJECT; - - itOpt = tidyGetOptionList(obj->ptdoc->doc); - - array_init(return_value); - - while (itOpt) { - TidyOption opt = tidyGetNextOption(obj->ptdoc->doc, &itOpt); - - opt_name = (char *)tidyOptGetName(opt); - opt_value = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC); - switch (optt) { - case TidyString: - add_assoc_string(return_value, opt_name, (char*)opt_value, 0); - break; - - case TidyInteger: - add_assoc_long(return_value, opt_name, (long)opt_value); - break; - - case TidyBoolean: - add_assoc_bool(return_value, opt_name, (long)opt_value); - break; - } - } - - return; -} -/* }}} */ - -/* {{{ proto int tidy_get_status() - Get status of specfied document. */ -static PHP_FUNCTION(tidy_get_status) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyStatus(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_get_html_ver() - Get the Detected HTML version for the specified document. */ -static PHP_FUNCTION(tidy_get_html_ver) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyDetectedHtmlVersion(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto boolean tidy_is_xhtml() - Indicates if the document is a XHTML document. */ -static PHP_FUNCTION(tidy_is_xhtml) -{ - TIDY_FETCH_OBJECT; - - RETURN_BOOL(tidyDetectedXhtml(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto boolean tidy_is_xml() - Indicates if the document is a generic (non HTML/XHTML) XML document. */ -static PHP_FUNCTION(tidy_is_xml) -{ - TIDY_FETCH_OBJECT; - - RETURN_BOOL(tidyDetectedGenericXml(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_error_count() - Returns the Number of Tidy errors encountered for specified document. */ -static PHP_FUNCTION(tidy_error_count) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyErrorCount(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_warning_count() - Returns the Number of Tidy warnings encountered for specified document. */ -static PHP_FUNCTION(tidy_warning_count) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyWarningCount(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_access_count() - Returns the Number of Tidy accessibility warnings encountered for specified document. */ -static PHP_FUNCTION(tidy_access_count) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyAccessWarningCount(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto int tidy_config_count() - Returns the Number of Tidy configuration errors encountered for specified document. */ -static PHP_FUNCTION(tidy_config_count) -{ - TIDY_FETCH_OBJECT; - - RETURN_LONG(tidyConfigErrorCount(obj->ptdoc->doc)); -} -/* }}} */ - -/* {{{ proto mixed tidy_getopt(string option) - Returns the value of the specified configuration option for the tidy document. */ -static PHP_FUNCTION(tidy_getopt) -{ - PHPTidyObj *obj; - char *optname; - void *optval; - int optname_len; - TidyOption opt; - TidyOptionType optt; - - TIDY_SET_CONTEXT; - - if (object) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) { - RETURN_FALSE; - } - } else { - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) { - RETURN_FALSE; - } - } - - obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC); - - opt = tidyGetOptionByName(obj->ptdoc->doc, optname); - - if (!opt) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname); - RETURN_FALSE; - } - - optval = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC); - switch (optt) { - case TidyString: - RETURN_STRING((char *)optval, 0); - break; - - case TidyInteger: - RETURN_LONG((long)optval); - break; - - case TidyBoolean: - if (optval) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } - break; - - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of configuration option"); - break; - } - - RETURN_FALSE; -} -/* }}} */ - -static TIDY_DOC_METHOD(__construct) -{ - char *inputfile = NULL, *enc = NULL; - int input_len = 0, enc_len = 0, contents_len = 0; - zend_bool use_include_path = 0; - char *contents; - zval **options = NULL; - - PHPTidyObj *obj; - TIDY_SET_CONTEXT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sZsb", &inputfile, &input_len, - &options, &enc, &enc_len, &use_include_path) == FAILURE) { - RETURN_FALSE; - } - - obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC); - - if (inputfile) { - if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path, &contents_len TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include path)" : ""); - return; - } - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - php_tidy_parse_string(obj, contents, contents_len, enc TSRMLS_CC); - - efree(contents); - } -} - -static TIDY_DOC_METHOD(parseFile) -{ - char *inputfile, *enc = NULL; - int input_len, enc_len = 0, contents_len = 0; - zend_bool use_include_path = 0; - char *contents; - zval **options = NULL; - PHPTidyObj *obj; - - TIDY_SET_CONTEXT; - - obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &inputfile, &input_len, - &options, &enc, &enc_len, &use_include_path) == FAILURE) { - RETURN_FALSE; - } - - if (!(contents = php_tidy_file_to_mem(inputfile, use_include_path, &contents_len TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory %s", inputfile, (use_include_path) ? "(Using include path)" : ""); - RETURN_FALSE; - } - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - if(php_tidy_parse_string(obj, contents, contents_len, enc TSRMLS_CC) == FAILURE) { - RETVAL_FALSE; - } else { - RETVAL_TRUE; - } - - efree(contents); -} - -static TIDY_DOC_METHOD(parseString) -{ - char *input, *enc = NULL; - int input_len, enc_len = 0; - zval **options = NULL; - PHPTidyObj *obj; - - TIDY_SET_CONTEXT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zs", &input, &input_len, &options, &enc, &enc_len) == FAILURE) { - RETURN_FALSE; - } - - obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC); - - TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - - if(php_tidy_parse_string(obj, input, input_len, enc TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } - - RETURN_FALSE; -} - - -/* {{{ proto TidyNode tidy_get_root() - Returns a TidyNode Object representing the root of the tidy parse tree */ -static PHP_FUNCTION(tidy_get_root) -{ - php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_root_node); -} -/* }}} */ - -/* {{{ proto TidyNode tidy_get_html() - Returns a TidyNode Object starting from the tag of the tidy parse tree */ -static PHP_FUNCTION(tidy_get_html) -{ - php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_html_node); -} -/* }}} */ - -/* {{{ proto TidyNode tidy_get_head() - Returns a TidyNode Object starting from the tag of the tidy parse tree */ -static PHP_FUNCTION(tidy_get_head) -{ - php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_head_node); -} -/* }}} */ - -/* {{{ proto TidyNode tidy_get_body(resource tidy) - Returns a TidyNode Object starting from the tag of the tidy parse tree */ -static PHP_FUNCTION(tidy_get_body) -{ - php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_body_node); -} -/* }}} */ - -/* {{{ proto boolean tidyNode::hasChildren() - Returns true if this node has children */ -static TIDY_NODE_METHOD(hasChildren) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyGetChild(obj->node)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::hasSiblings() - Returns true if this node has siblings */ -static TIDY_NODE_METHOD(hasSiblings) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (obj->node && tidyGetNext(obj->node)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isComment() - Returns true if this node represents a comment */ -static TIDY_NODE_METHOD(isComment) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Comment) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isHtml() - Returns true if this node is part of a HTML document */ -static TIDY_NODE_METHOD(isHtml) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) & (TidyNode_Start | TidyNode_End | TidyNode_StartEnd)) { - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isText() - Returns true if this node represents text (no markup) */ -static TIDY_NODE_METHOD(isText) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Text) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isJste() - Returns true if this node is JSTE */ -static TIDY_NODE_METHOD(isJste) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Jste) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isAsp() - Returns true if this node is ASP */ -static TIDY_NODE_METHOD(isAsp) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Asp) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto boolean tidyNode::isPhp() - Returns true if this node is PHP */ -static TIDY_NODE_METHOD(isPhp) -{ - TIDY_FETCH_ONLY_OBJECT; - - if (tidyNodeGetType(obj->node) == TidyNode_Php) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto tidyNode tidyNode::getParent() - Returns the parent node if available or NULL */ -static TIDY_NODE_METHOD(getParent) -{ - TidyNode parent_node; - PHPTidyObj *newobj; - TIDY_FETCH_ONLY_OBJECT; - - parent_node = tidyGetParent(obj->node); - if(parent_node) { - tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC); - newobj = (PHPTidyObj *) zend_object_store_get_object(return_value TSRMLS_CC); - newobj->node = parent_node; - newobj->type = is_node; - newobj->ptdoc = obj->ptdoc; - newobj->ptdoc->ref_count++; - tidy_add_default_properties(newobj, is_node TSRMLS_CC); - } else { - ZVAL_NULL(return_value); - } -} -/* }}} */ - -static void _php_tidy_register_nodetypes(INIT_FUNC_ARGS) -{ - TIDY_NODE_CONST(ROOT, Root); - TIDY_NODE_CONST(DOCTYPE, DocType); - TIDY_NODE_CONST(COMMENT, Comment); - TIDY_NODE_CONST(PROCINS, ProcIns); - TIDY_NODE_CONST(TEXT, Text); - TIDY_NODE_CONST(START, Start); - TIDY_NODE_CONST(END, End); - TIDY_NODE_CONST(STARTEND, StartEnd); - TIDY_NODE_CONST(CDATA, CDATA); - TIDY_NODE_CONST(SECTION, Section); - TIDY_NODE_CONST(ASP, Asp); - TIDY_NODE_CONST(JSTE, Jste); - TIDY_NODE_CONST(PHP, Php); - TIDY_NODE_CONST(XMLDECL, XmlDecl); -} - -static void _php_tidy_register_tags(INIT_FUNC_ARGS) -{ - TIDY_TAG_CONST(UNKNOWN); - TIDY_TAG_CONST(A); - TIDY_TAG_CONST(ABBR); - TIDY_TAG_CONST(ACRONYM); - TIDY_TAG_CONST(ADDRESS); - TIDY_TAG_CONST(ALIGN); - TIDY_TAG_CONST(APPLET); - TIDY_TAG_CONST(AREA); - TIDY_TAG_CONST(B); - TIDY_TAG_CONST(BASE); - TIDY_TAG_CONST(BASEFONT); - TIDY_TAG_CONST(BDO); - TIDY_TAG_CONST(BGSOUND); - TIDY_TAG_CONST(BIG); - TIDY_TAG_CONST(BLINK); - TIDY_TAG_CONST(BLOCKQUOTE); - TIDY_TAG_CONST(BODY); - TIDY_TAG_CONST(BR); - TIDY_TAG_CONST(BUTTON); - TIDY_TAG_CONST(CAPTION); - TIDY_TAG_CONST(CENTER); - TIDY_TAG_CONST(CITE); - TIDY_TAG_CONST(CODE); - TIDY_TAG_CONST(COL); - TIDY_TAG_CONST(COLGROUP); - TIDY_TAG_CONST(COMMENT); - TIDY_TAG_CONST(DD); - TIDY_TAG_CONST(DEL); - TIDY_TAG_CONST(DFN); - TIDY_TAG_CONST(DIR); - TIDY_TAG_CONST(DIV); - TIDY_TAG_CONST(DL); - TIDY_TAG_CONST(DT); - TIDY_TAG_CONST(EM); - TIDY_TAG_CONST(EMBED); - TIDY_TAG_CONST(FIELDSET); - TIDY_TAG_CONST(FONT); - TIDY_TAG_CONST(FORM); - TIDY_TAG_CONST(FRAME); - TIDY_TAG_CONST(FRAMESET); - TIDY_TAG_CONST(H1); - TIDY_TAG_CONST(H2); - TIDY_TAG_CONST(H3); - TIDY_TAG_CONST(H4); - TIDY_TAG_CONST(H5); - TIDY_TAG_CONST(H6); - TIDY_TAG_CONST(HEAD); - TIDY_TAG_CONST(HR); - TIDY_TAG_CONST(HTML); - TIDY_TAG_CONST(I); - TIDY_TAG_CONST(IFRAME); - TIDY_TAG_CONST(ILAYER); - TIDY_TAG_CONST(IMG); - TIDY_TAG_CONST(INPUT); - TIDY_TAG_CONST(INS); - TIDY_TAG_CONST(ISINDEX); - TIDY_TAG_CONST(KBD); - TIDY_TAG_CONST(KEYGEN); - TIDY_TAG_CONST(LABEL); - TIDY_TAG_CONST(LAYER); - TIDY_TAG_CONST(LEGEND); - TIDY_TAG_CONST(LI); - TIDY_TAG_CONST(LINK); - TIDY_TAG_CONST(LISTING); - TIDY_TAG_CONST(MAP); - TIDY_TAG_CONST(MARQUEE); - TIDY_TAG_CONST(MENU); - TIDY_TAG_CONST(META); - TIDY_TAG_CONST(MULTICOL); - TIDY_TAG_CONST(NOBR); - TIDY_TAG_CONST(NOEMBED); - TIDY_TAG_CONST(NOFRAMES); - TIDY_TAG_CONST(NOLAYER); - TIDY_TAG_CONST(NOSAVE); - TIDY_TAG_CONST(NOSCRIPT); - TIDY_TAG_CONST(OBJECT); - TIDY_TAG_CONST(OL); - TIDY_TAG_CONST(OPTGROUP); - TIDY_TAG_CONST(OPTION); - TIDY_TAG_CONST(P); - TIDY_TAG_CONST(PARAM); - TIDY_TAG_CONST(PLAINTEXT); - TIDY_TAG_CONST(PRE); - TIDY_TAG_CONST(Q); - TIDY_TAG_CONST(RB); - TIDY_TAG_CONST(RBC); - TIDY_TAG_CONST(RP); - TIDY_TAG_CONST(RT); - TIDY_TAG_CONST(RTC); - TIDY_TAG_CONST(RUBY); - TIDY_TAG_CONST(S); - TIDY_TAG_CONST(SAMP); - TIDY_TAG_CONST(SCRIPT); - TIDY_TAG_CONST(SELECT); - TIDY_TAG_CONST(SERVER); - TIDY_TAG_CONST(SERVLET); - TIDY_TAG_CONST(SMALL); - TIDY_TAG_CONST(SPACER); - TIDY_TAG_CONST(SPAN); - TIDY_TAG_CONST(STRIKE); - TIDY_TAG_CONST(STRONG); - TIDY_TAG_CONST(STYLE); - TIDY_TAG_CONST(SUB); - TIDY_TAG_CONST(SUP); - TIDY_TAG_CONST(TABLE); - TIDY_TAG_CONST(TBODY); - TIDY_TAG_CONST(TD); - TIDY_TAG_CONST(TEXTAREA); - TIDY_TAG_CONST(TFOOT); - TIDY_TAG_CONST(TH); - TIDY_TAG_CONST(THEAD); - TIDY_TAG_CONST(TITLE); - TIDY_TAG_CONST(TR); - TIDY_TAG_CONST(TT); - TIDY_TAG_CONST(U); - TIDY_TAG_CONST(UL); - TIDY_TAG_CONST(VAR); - TIDY_TAG_CONST(WBR); - TIDY_TAG_CONST(XMP); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/tidy/tidy.dsp b/ext/tidy/tidy.dsp deleted file mode 100755 index fe44fa7a512e4..0000000000000 --- a/ext/tidy/tidy.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tidy" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=tidy - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "tidy.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "tidy.mak" CFG="tidy - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tidy - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "tidy - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "tidy - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_tidy.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release" - -!ELSEIF "$(CFG)" == "tidy - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_tidy.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release" - -!ENDIF - -# Begin Target - -# Name "tidy - Win32 Release_TS" -# Name "tidy - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\tidy.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_tidy.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/tokenizer/CREDITS b/ext/tokenizer/CREDITS deleted file mode 100644 index 6189688c81b4d..0000000000000 --- a/ext/tokenizer/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -tokenizer -Andrei Zmievski, Johannes Schlueter diff --git a/ext/tokenizer/Makefile.frag b/ext/tokenizer/Makefile.frag deleted file mode 100644 index 6802d40e9223d..0000000000000 --- a/ext/tokenizer/Makefile.frag +++ /dev/null @@ -1,2 +0,0 @@ -$(top_srcdir)/Zend/zend_language_parser.h: -$(builddir)/tokenizer.lo: $(top_srcdir)/Zend/zend_language_parser.h diff --git a/ext/tokenizer/config.m4 b/ext/tokenizer/config.m4 deleted file mode 100644 index 007dddfc0254f..0000000000000 --- a/ext/tokenizer/config.m4 +++ /dev/null @@ -1,12 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension tokenizer - -dnl Otherwise use enable: - -PHP_ARG_ENABLE(tokenizer, whether to enable tokenizer support, -[ --disable-tokenizer Disable tokenizer support], yes) - -if test "$PHP_TOKENIZER" != "no"; then - PHP_NEW_EXTENSION(tokenizer, tokenizer.c tokenizer_data.c, $ext_shared) - PHP_ADD_MAKEFILE_FRAGMENT -fi diff --git a/ext/tokenizer/config.w32 b/ext/tokenizer/config.w32 deleted file mode 100644 index dd3b89e77891d..0000000000000 --- a/ext/tokenizer/config.w32 +++ /dev/null @@ -1,11 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("tokenizer", "tokenizer support", "yes"); - -if (PHP_TOKENIZER == "yes") { - EXTENSION("tokenizer", "tokenizer.c tokenizer_data.c"); - AC_DEFINE("HAVE_TOKENIZER", 1, "Tokenizer support"); -} - - diff --git a/ext/tokenizer/package.xml b/ext/tokenizer/package.xml deleted file mode 100644 index f6f754c3d2a2b..0000000000000 --- a/ext/tokenizer/package.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - tokenizer - PHP Source code tokenizer - - - andrei - Andrei Zmievski - andrei@php.net - lead - - - -The tokenizer functions provide an interface to the PHP tokenizer -embedded in the Zend Engine. Using these functions you may write -your own PHP source analyzing or modification tools without having -to deal with the language specification at the lexical level. - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - diff --git a/ext/tokenizer/php_tokenizer.h b/ext/tokenizer/php_tokenizer.h deleted file mode 100644 index 2a3b8c4a569b2..0000000000000 --- a/ext/tokenizer/php_tokenizer.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Andrei Zmievski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_TOKENIZER_H -#define PHP_TOKENIZER_H - -extern zend_module_entry tokenizer_module_entry; -#define phpext_tokenizer_ptr &tokenizer_module_entry - -#ifdef PHP_WIN32 -#define PHP_TOKENIZER_API __declspec(dllexport) -#else -#define PHP_TOKENIZER_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -void tokenizer_register_constants(INIT_FUNC_ARGS); -char *get_token_type_name(int token_type); - - -PHP_MINIT_FUNCTION(tokenizer); -PHP_MINFO_FUNCTION(tokenizer); - -PHP_FUNCTION(token_get_all); -PHP_FUNCTION(token_name); - -#ifdef ZTS -#define TOKENIZER_G(v) TSRMG(tokenizer_globals_id, zend_tokenizer_globals *, v) -#else -#define TOKENIZER_G(v) (tokenizer_globals.v) -#endif - -#endif /* PHP_TOKENIZER_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/tokenizer/tests/001.phpt b/ext/tokenizer/tests/001.phpt deleted file mode 100644 index 203e3c7ddb04e..0000000000000 --- a/ext/tokenizer/tests/001.phpt +++ /dev/null @@ -1,259 +0,0 @@ ---TEST-- -token_name() ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -T_INCLUDE -T_INCLUDE_ONCE -T_EVAL -T_REQUIRE -T_REQUIRE_ONCE -T_LOGICAL_OR -T_LOGICAL_XOR -T_LOGICAL_AND -T_PRINT -T_PLUS_EQUAL -T_MINUS_EQUAL -T_MUL_EQUAL -T_DIV_EQUAL -T_CONCAT_EQUAL -T_MOD_EQUAL -T_AND_EQUAL -T_OR_EQUAL -T_XOR_EQUAL -T_SL_EQUAL -T_SR_EQUAL -T_BOOLEAN_OR -T_BOOLEAN_AND -T_IS_EQUAL -T_IS_NOT_EQUAL -T_IS_IDENTICAL -T_IS_NOT_IDENTICAL -T_IS_SMALLER_OR_EQUAL -T_IS_GREATER_OR_EQUAL -T_SL -T_SR -T_INC -T_DEC -T_INT_CAST -T_DOUBLE_CAST -T_STRING_CAST -T_ARRAY_CAST -T_OBJECT_CAST -T_BOOL_CAST -T_UNSET_CAST -T_NEW -T_EXIT -T_IF -T_ELSEIF -T_ELSE -T_ENDIF -T_LNUMBER -T_DNUMBER -T_STRING -T_STRING_VARNAME -T_VARIABLE -T_NUM_STRING -T_INLINE_HTML -T_ENCAPSED_AND_WHITESPACE -T_CONSTANT_ENCAPSED_STRING -T_ECHO -T_DO -T_WHILE -T_ENDWHILE -T_FOR -T_ENDFOR -T_FOREACH -T_ENDFOREACH -T_DECLARE -T_ENDDECLARE -T_AS -T_SWITCH -T_ENDSWITCH -T_CASE -T_DEFAULT -T_BREAK -T_CONTINUE -T_FUNCTION -T_CONST -T_RETURN -T_USE -T_GLOBAL -T_STATIC -T_VAR -T_UNSET -T_ISSET -T_EMPTY -T_CLASS -T_EXTENDS -T_INTERFACE -T_IMPLEMENTS -T_OBJECT_OPERATOR -T_DOUBLE_ARROW -T_LIST -T_ARRAY -T_CLASS_C -T_FUNC_C -T_METHOD_C -T_LINE -T_FILE -T_COMMENT -T_DOC_COMMENT -T_OPEN_TAG -T_OPEN_TAG_WITH_ECHO -T_CLOSE_TAG -T_WHITESPACE -T_START_HEREDOC -T_END_HEREDOC -T_DOLLAR_OPEN_CURLY_BRACES -T_CURLY_OPEN -T_DOUBLE_COLON -T_DOUBLE_COLON -T_ABSTRACT -T_CATCH -T_FINAL -T_INSTANCEOF -T_PRIVATE -T_PROTECTED -T_PUBLIC -T_THROW -T_TRY -T_CLONE -T_HALT_COMPILER -UNKNOWN -UNKNOWN - -Warning: token_name() expects parameter 1 to be long, string given in %s on line %d - - -Warning: token_name() expects parameter 1 to be long, array given in %s on line %d - -Done diff --git a/ext/tokenizer/tests/002.phpt b/ext/tokenizer/tests/002.phpt deleted file mode 100644 index 2a40ffe292fd5..0000000000000 --- a/ext/tokenizer/tests/002.phpt +++ /dev/null @@ -1,982 +0,0 @@ ---TEST-- -token_get_all() ---SKIPIF-- - ---INI-- -short_open_tag=1 ---FILE-- -', - '', - '', - /* feel free to add more yourself */ - 'wrong syntax here' -); - -foreach ($strings as $s) { - var_dump(token_get_all($s)); -} - -echo "Done\n"; -?> ---EXPECTF-- -array(49) { - [0]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(4) "echo" - [2]=> - int(1) - } - [3]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [4]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "1" - [2]=> - int(1) - } - [5]=> - string(1) ";" - [6]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "if" - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - string(1) "(" - [10]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(5) "isset" - [2]=> - int(1) - } - [11]=> - string(1) "(" - [12]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [13]=> - string(1) ")" - [14]=> - string(1) ")" - [15]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [16]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(5) "print" - [2]=> - int(1) - } - [17]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [18]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [19]=> - string(1) "+" - [20]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "1" - [2]=> - int(1) - } - [21]=> - string(1) ";" - [22]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [23]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [24]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "++" - [2]=> - int(1) - } - [25]=> - string(1) ";" - [26]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [27]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [28]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "--" - [2]=> - int(1) - } - [29]=> - string(1) ";" - [30]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [31]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [32]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [33]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "==" - [2]=> - int(1) - } - [34]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [35]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [36]=> - string(1) ";" - [37]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [38]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [39]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [40]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(3) "===" - [2]=> - int(1) - } - [41]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [42]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [43]=> - string(1) ";" - [44]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [45]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(5) "endif" - [2]=> - int(1) - } - [46]=> - string(1) ";" - [47]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [48]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} -array(37) { - [0]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(6) "switch" - [2]=> - int(1) - } - [2]=> - string(1) "(" - [3]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [4]=> - string(1) ")" - [5]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [6]=> - string(1) "{" - [7]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(4) "case" - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [10]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "1" - [2]=> - int(1) - } - [11]=> - string(1) ":" - [12]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [13]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(5) "break" - [2]=> - int(1) - } - [14]=> - string(1) ";" - [15]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [16]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(7) "default" - [2]=> - int(1) - } - [17]=> - string(1) ":" - [18]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [19]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(5) "break" - [2]=> - int(1) - } - [20]=> - string(1) ";" - [21]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [22]=> - string(1) "}" - [23]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [24]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(5) "while" - [2]=> - int(1) - } - [25]=> - string(1) "(" - [26]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [27]=> - string(1) ")" - [28]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [29]=> - string(1) "{" - [30]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [31]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(4) "exit" - [2]=> - int(1) - } - [32]=> - string(1) ";" - [33]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [34]=> - string(1) "}" - [35]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [36]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} -array(48) { - [0]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(13) "/* comment */" - [2]=> - int(1) - } - [3]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [4]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "if" - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [6]=> - string(1) "(" - [7]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "1" - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "||" - [2]=> - int(1) - } - [10]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [11]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [12]=> - string(1) ")" - [13]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [14]=> - string(1) "{" - [15]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [16]=> - string(1) "}" - [17]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [18]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [19]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [20]=> - string(1) "=" - [21]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [22]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [23]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [24]=> - string(1) "|" - [25]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [26]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "1" - [2]=> - int(1) - } - [27]=> - string(1) ";" - [28]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [29]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [30]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [31]=> - string(1) "=" - [32]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [33]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "3" - [2]=> - int(1) - } - [34]=> - string(1) "^" - [35]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [36]=> - string(1) ";" - [37]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [38]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$c" - [2]=> - int(1) - } - [39]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [40]=> - string(1) "=" - [41]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [42]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "4" - [2]=> - int(1) - } - [43]=> - string(1) "&" - [44]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [45]=> - string(1) ";" - [46]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " " - [2]=> - int(1) - } - [47]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(17) "wrong syntax here" - [2]=> - int(1) - } -} -Done diff --git a/ext/tokenizer/tests/003.phpt b/ext/tokenizer/tests/003.phpt deleted file mode 100644 index fdcf7748a8440..0000000000000 --- a/ext/tokenizer/tests/003.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -token_get_all() and wrong parameters ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: token_get_all() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: token_get_all() expects parameter 1 to be string, object given in %s on line %d -NULL -array(0) { -} -array(1) { - [0]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) "0" - [2]=> - int(1) - } -} -array(1) { - [0]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "-1" - [2]=> - int(1) - } -} -Done diff --git a/ext/tokenizer/tests/bug26463.phpt b/ext/tokenizer/tests/bug26463.phpt deleted file mode 100644 index d07476b2046c8..0000000000000 --- a/ext/tokenizer/tests/bug26463.phpt +++ /dev/null @@ -1,164 +0,0 @@ ---TEST-- -Bug #26463 (token_get_all() does not correctly handle semicolons after T_END_HEREDOC) ---SKIPIF-- - ---FILE-- -'; -var_dump(token_get_all($str)); -?> ---EXPECTF-- -array(19) { - [0]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$x" - [2]=> - int(2) - } - [2]=> - string(1) "=" - [3]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(6) "<<
- int(2) - } - [4]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(13) "jhdsjkfhjdsh -" - [2]=> - int(3) - } - [5]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "DD" - [2]=> - int(4) - } - [6]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [7]=> - string(1) "." - [8]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) """" - [2]=> - int(5) - } - [9]=> - string(1) ";" - [10]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [11]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "$a" - [2]=> - int(6) - } - [12]=> - string(1) "=" - [13]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(8) "<< - int(6) - } - [14]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(13) "jhdsjkfhjdsh -" - [2]=> - int(7) - } - [15]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(4) "DDDD" - [2]=> - int(8) - } - [16]=> - string(1) ";" - [17]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(1) " -" - [2]=> - int(8) - } - [18]=> - array(3) { - [0]=> - int(%d) - [1]=> - string(2) "?>" - [2]=> - int(9) - } -} diff --git a/ext/tokenizer/tests/token_get_all_basic.phpt b/ext/tokenizer/tests/token_get_all_basic.phpt deleted file mode 100644 index 0ae84a2a75d22..0000000000000 --- a/ext/tokenizer/tests/token_get_all_basic.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -Test token_get_all() function : basic functionality ---FILE-- -'; -echo "-- source string with PHP open and close tags --\n"; -var_dump( token_get_all($source) ); - -// without php open/close tags testing for T_INLINE_HTML -$source = "echo 'Hello World';"; -echo "-- source string without PHP open and close tags --\n"; -var_dump( token_get_all($source) ); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : basic functionality *** --- source string with PHP open and close tags -- -array(7) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - array(3) { - [0]=> - int(315) - [1]=> - string(13) ""Hello World"" - [2]=> - int(1) - } - [4]=> - string(1) ";" - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- source string without PHP open and close tags -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(19) "echo 'Hello World';" - [2]=> - int(1) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_error.phpt b/ext/tokenizer/tests/token_get_all_error.phpt deleted file mode 100644 index 52b1efc1dd600..0000000000000 --- a/ext/tokenizer/tests/token_get_all_error.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test token_get_all() function : error conditions ---FILE-- -'; -$extra_arg = 10; -var_dump( token_get_all($source, $extra_arg)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : error conditions *** - --- Testing token_get_all() function with zero arguments -- - -Warning: token_get_all() expects exactly 1 parameter, 0 given in %s on line %d -NULL --- Testing token_get_all() function with more than expected no. of arguments -- - -Warning: token_get_all() expects exactly 1 parameter, 2 given in %s on line %d -NULL -Done diff --git a/ext/tokenizer/tests/token_get_all_variation1.phpt b/ext/tokenizer/tests/token_get_all_variation1.phpt deleted file mode 100644 index f0e10d6d5cf24..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation1.phpt +++ /dev/null @@ -1,285 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - unexpected values for 'source' argument ---FILE-- - 'red', 'item' => 'pen'), - - // null data -/*15*/ NULL, - null, - - // boolean data -/*17*/ true, - false, - TRUE, - FALSE, - - // empty string -/*21*/ "", - '', - - // object data -/*23*/ new MyClass(), - - // resource data - $fp, - - // undefined data - @$undefined_var, - - // unset data -/*26*/ @$unset_var, -); - -for($count = 0; $count < count($source_values); $count++) { - echo "--Iteration ".($count + 1)." --\n"; - var_dump( token_get_all($source_values[$count])); -}; - -fclose($fp); -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : unexpected values for 'source' argument *** ---Iteration 1 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(1) "0" - [2]=> - int(1) - } -} ---Iteration 2 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(1) "1" - [2]=> - int(1) - } -} ---Iteration 3 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(5) "12345" - [2]=> - int(1) - } -} ---Iteration 4 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(5) "-2345" - [2]=> - int(1) - } -} ---Iteration 5 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(4) "10.5" - [2]=> - int(1) - } -} ---Iteration 6 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(5) "-10.5" - [2]=> - int(1) - } -} ---Iteration 7 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(10) "1012345670" - [2]=> - int(1) - } -} ---Iteration 8 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(13) "1.07654321E-7" - [2]=> - int(1) - } -} ---Iteration 9 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(3) "0.5" - [2]=> - int(1) - } -} ---Iteration 10 -- - -Warning: token_get_all() expects parameter 1 to be string, array given in %s on line %d -NULL ---Iteration 11 -- - -Warning: token_get_all() expects parameter 1 to be string, array given in %s on line %d -NULL ---Iteration 12 -- - -Warning: token_get_all() expects parameter 1 to be string, array given in %s on line %d -NULL ---Iteration 13 -- - -Warning: token_get_all() expects parameter 1 to be string, array given in %s on line %d -NULL ---Iteration 14 -- - -Warning: token_get_all() expects parameter 1 to be string, array given in %s on line %d -NULL ---Iteration 15 -- -array(0) { -} ---Iteration 16 -- -array(0) { -} ---Iteration 17 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(1) "1" - [2]=> - int(1) - } -} ---Iteration 18 -- -array(0) { -} ---Iteration 19 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(1) "1" - [2]=> - int(1) - } -} ---Iteration 20 -- -array(0) { -} ---Iteration 21 -- -array(0) { -} ---Iteration 22 -- -array(0) { -} ---Iteration 23 -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(6) "object" - [2]=> - int(1) - } -} ---Iteration 24 -- - -Warning: token_get_all() expects parameter 1 to be string, resource given in %s on line %d -NULL ---Iteration 25 -- -array(0) { -} ---Iteration 26 -- -array(0) { -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation10.phpt b/ext/tokenizer/tests/token_get_all_variation10.phpt deleted file mode 100644 index 63b61e731bc42..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation10.phpt +++ /dev/null @@ -1,781 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with constant tokens ---FILE-- -', - - // float const - '', - - // string const - '', - - // bool const - "", - "", - - // null const - '' -); -for($count = 0; $count < count($source); $count++) { - echo "-- Iteration ".($count + 1)." --\n"; - var_dump( token_get_all($source[$count])); -} - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with different constants *** --- Iteration 1 -- -array(24) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - string(1) "+" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(305) - [1]=> - string(3) "034" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [13]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [14]=> - string(1) "=" - [15]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [16]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [17]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [18]=> - string(1) "+" - [19]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [20]=> - array(3) { - [0]=> - int(305) - [1]=> - string(4) "0x3F" - [2]=> - int(1) - } - [21]=> - string(1) ";" - [22]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [23]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 2 -- -array(17) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(306) - [1]=> - string(7) "0.23E-2" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - string(1) "+" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(306) - [1]=> - string(6) "0.43e2" - [2]=> - int(1) - } - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [11]=> - string(1) "+" - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [13]=> - array(3) { - [0]=> - int(306) - [1]=> - string(3) "0.5" - [2]=> - int(1) - } - [14]=> - string(1) ";" - [15]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [16]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 3 -- -array(11) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(315) - [1]=> - string(8) ""hello "" - [2]=> - int(1) - } - [6]=> - string(1) "." - [7]=> - array(3) { - [0]=> - int(315) - [1]=> - string(7) "'world'" - [2]=> - int(1) - } - [8]=> - string(1) ";" - [9]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [10]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 4 -- -array(18) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - string(1) "(" - [6]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [7]=> - string(1) ")" - [8]=> - string(1) "?" - [9]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [10]=> - array(3) { - [0]=> - int(307) - [1]=> - string(4) "true" - [2]=> - int(1) - } - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - string(1) ":" - [13]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [14]=> - array(3) { - [0]=> - int(307) - [1]=> - string(5) "false" - [2]=> - int(1) - } - [15]=> - string(1) ";" - [16]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [17]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 5 -- -array(18) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - string(1) "(" - [6]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [7]=> - string(1) ")" - [8]=> - string(1) "?" - [9]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [10]=> - array(3) { - [0]=> - int(307) - [1]=> - string(5) "FALSE" - [2]=> - int(1) - } - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - string(1) ":" - [13]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [14]=> - array(3) { - [0]=> - int(307) - [1]=> - string(4) "TRUE" - [2]=> - int(1) - } - [15]=> - string(1) ";" - [16]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [17]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 6 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(307) - [1]=> - string(4) "null" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - string(1) "|" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(307) - [1]=> - string(4) "NULL" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation11.phpt b/ext/tokenizer/tests/token_get_all_variation11.phpt deleted file mode 100644 index c38b050cb0066..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation11.phpt +++ /dev/null @@ -1,1147 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with control structure tokens ---FILE-- -'; - -var_dump( token_get_all($source)); - -// while..., do..while, break, continue -echo "-- with while..., do..while, switch & continue tokens --\n"; - -$source = ""; - -var_dump( token_get_all($source)); - -// for..., foreach( as ) -echo "-- with for..foreach( as ) tokens --\n"; - -$source = ''; - -var_dump( token_get_all($source)); - -// switch..case, default -echo "-- with switch...case tokens --\n"; - -$source = ''; - -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : for control structure tokens *** --- with if..elseif..else..tokens -- -array(49) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(2) - } - [3]=> - string(1) "(" - [4]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(2) - } - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [6]=> - array(3) { - [0]=> - int(283) - [1]=> - string(2) "==" - [2]=> - int(2) - } - [7]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [8]=> - array(3) { - [0]=> - int(307) - [1]=> - string(4) "true" - [2]=> - int(2) - } - [9]=> - string(1) ")" - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [11]=> - string(1) "{" - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(6) " - " - [2]=> - int(2) - } - [13]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(3) - } - [14]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [15]=> - string(1) """ - [16]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(3) - } - [17]=> - array(3) { - [0]=> - int(314) - [1]=> - string(7) " = true" - [2]=> - int(3) - } - [18]=> - string(1) """ - [19]=> - string(1) ";" - [20]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [21]=> - string(1) "}" - [22]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [23]=> - array(3) { - [0]=> - int(302) - [1]=> - string(6) "elseif" - [2]=> - int(5) - } - [24]=> - string(1) "(" - [25]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(5) - } - [26]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [27]=> - array(3) { - [0]=> - int(283) - [1]=> - string(2) "==" - [2]=> - int(5) - } - [28]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [29]=> - array(3) { - [0]=> - int(307) - [1]=> - string(5) "false" - [2]=> - int(5) - } - [30]=> - string(1) ")" - [31]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [32]=> - string(1) "{" - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(5) - } - [34]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(6) - } - [35]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [36]=> - array(3) { - [0]=> - int(307) - [1]=> - string(5) "false" - [2]=> - int(6) - } - [37]=> - string(1) ";" - [38]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(6) - } - [39]=> - string(1) "}" - [40]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(7) - } - [41]=> - array(3) { - [0]=> - int(303) - [1]=> - string(4) "else" - [2]=> - int(8) - } - [42]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(8) - } - [43]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(9) - } - [44]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [45]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(9) - } - [46]=> - string(1) ";" - [47]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(9) - } - [48]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(10) - } -} --- with while..., do..while, switch & continue tokens -- -array(33) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(318) - [1]=> - string(5) "while" - [2]=> - int(1) - } - [2]=> - string(1) "(" - [3]=> - array(3) { - [0]=> - int(307) - [1]=> - string(4) "true" - [2]=> - int(1) - } - [4]=> - string(1) ")" - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [6]=> - string(1) "{" - [7]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(2) - } - [9]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [10]=> - array(3) { - [0]=> - int(315) - [1]=> - string(6) "'True'" - [2]=> - int(2) - } - [11]=> - string(1) ";" - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [13]=> - array(3) { - [0]=> - int(331) - [1]=> - string(5) "break" - [2]=> - int(3) - } - [14]=> - string(1) ";" - [15]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [16]=> - string(1) "}" - [17]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [18]=> - array(3) { - [0]=> - int(317) - [1]=> - string(2) "do" - [2]=> - int(5) - } - [19]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [20]=> - string(1) "{" - [21]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [22]=> - array(3) { - [0]=> - int(332) - [1]=> - string(8) "continue" - [2]=> - int(6) - } - [23]=> - string(1) ";" - [24]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(6) - } - [25]=> - string(1) "}" - [26]=> - array(3) { - [0]=> - int(318) - [1]=> - string(5) "while" - [2]=> - int(7) - } - [27]=> - string(1) "(" - [28]=> - array(3) { - [0]=> - int(307) - [1]=> - string(5) "false" - [2]=> - int(7) - } - [29]=> - string(1) ")" - [30]=> - string(1) ";" - [31]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(7) - } - [32]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(7) - } -} --- with for..foreach( as ) tokens -- -array(45) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(320) - [1]=> - string(3) "for" - [2]=> - int(1) - } - [2]=> - string(1) "(" - [3]=> - array(3) { - [0]=> - int(309) - [1]=> - string(6) "$count" - [2]=> - int(1) - } - [4]=> - string(1) "=" - [5]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "0" - [2]=> - int(1) - } - [6]=> - string(1) ";" - [7]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(309) - [1]=> - string(6) "$count" - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [10]=> - string(1) "<" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "5" - [2]=> - int(1) - } - [13]=> - string(1) ";" - [14]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [15]=> - array(3) { - [0]=> - int(309) - [1]=> - string(6) "$count" - [2]=> - int(1) - } - [16]=> - array(3) { - [0]=> - int(297) - [1]=> - string(2) "++" - [2]=> - int(1) - } - [17]=> - string(1) ")" - [18]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [19]=> - string(1) "{" - [20]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [21]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(2) - } - [22]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [23]=> - array(3) { - [0]=> - int(309) - [1]=> - string(6) "$count" - [2]=> - int(2) - } - [24]=> - string(1) ";" - [25]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [26]=> - string(1) "}" - [27]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [28]=> - array(3) { - [0]=> - int(322) - [1]=> - string(7) "foreach" - [2]=> - int(4) - } - [29]=> - string(1) "(" - [30]=> - array(3) { - [0]=> - int(309) - [1]=> - string(7) "$values" - [2]=> - int(4) - } - [31]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [32]=> - array(3) { - [0]=> - int(326) - [1]=> - string(2) "as" - [2]=> - int(4) - } - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [34]=> - array(3) { - [0]=> - int(309) - [1]=> - string(6) "$index" - [2]=> - int(4) - } - [35]=> - string(1) ")" - [36]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [37]=> - string(1) "{" - [38]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [39]=> - array(3) { - [0]=> - int(332) - [1]=> - string(8) "continue" - [2]=> - int(5) - } - [40]=> - string(1) ";" - [41]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [42]=> - string(1) "}" - [43]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [44]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(6) - } -} --- with switch...case tokens -- -array(23) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(327) - [1]=> - string(6) "switch" - [2]=> - int(1) - } - [2]=> - string(1) "(" - [3]=> - array(3) { - [0]=> - int(309) - [1]=> - string(4) "$var" - [2]=> - int(1) - } - [4]=> - string(1) ")" - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(329) - [1]=> - string(4) "case" - [2]=> - int(2) - } - [7]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [8]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(2) - } - [9]=> - string(1) ":" - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [11]=> - array(3) { - [0]=> - int(331) - [1]=> - string(5) "break" - [2]=> - int(2) - } - [12]=> - string(1) ";" - [13]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [14]=> - array(3) { - [0]=> - int(330) - [1]=> - string(7) "default" - [2]=> - int(3) - } - [15]=> - string(1) ":" - [16]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [17]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(3) - } - [18]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [19]=> - array(3) { - [0]=> - int(315) - [1]=> - string(9) ""default"" - [2]=> - int(3) - } - [20]=> - string(1) ";" - [21]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [22]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(3) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation12.phpt b/ext/tokenizer/tests/token_get_all_variation12.phpt deleted file mode 100644 index 8394cb6267b1d..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation12.phpt +++ /dev/null @@ -1,532 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with predefined language constants ---FILE-- -"; -var_dump( token_get_all($source)); - -// parsing __CLASS__ and __FUNCTION__ tokens -echo "-- with CLASS and FUNCTION --\n"; -$source = ''; -var_dump( token_get_all($source)); - -// parsing __LINE__ and __METHOD__ tokens -echo "-- with LINE and METHOD --\n"; -$source = ''; -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : with language constants *** --- with FILE -- -array(16) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(309) - [1]=> - string(3) "$fp" - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [4]=> - string(1) "=" - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " " - [2]=> - int(2) - } - [6]=> - array(3) { - [0]=> - int(307) - [1]=> - string(5) "fopen" - [2]=> - int(2) - } - [7]=> - string(1) "(" - [8]=> - array(3) { - [0]=> - int(364) - [1]=> - string(8) "__FILE__" - [2]=> - int(2) - } - [9]=> - string(1) "," - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [11]=> - array(3) { - [0]=> - int(315) - [1]=> - string(3) "'r'" - [2]=> - int(2) - } - [12]=> - string(1) ")" - [13]=> - string(1) ";" - [14]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [15]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(3) - } -} --- with CLASS and FUNCTION -- -array(30) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(352) - [1]=> - string(5) "class" - [2]=> - int(2) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(307) - [1]=> - string(7) "MyClass" - [2]=> - int(2) - } - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [5]=> - string(1) "{" - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(3) - } - [7]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(4) - } - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " " - [2]=> - int(4) - } - [9]=> - array(3) { - [0]=> - int(360) - [1]=> - string(9) "__CLASS__" - [2]=> - int(4) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(4) - } - [12]=> - array(3) { - [0]=> - int(333) - [1]=> - string(8) "function" - [2]=> - int(5) - } - [13]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [14]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "myFunction" - [2]=> - int(5) - } - [15]=> - string(1) "(" - [16]=> - string(1) ")" - [17]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(5) - } - [18]=> - string(1) "{" - [19]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " " - [2]=> - int(6) - } - [20]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(6) - } - [21]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " " - [2]=> - int(6) - } - [22]=> - array(3) { - [0]=> - int(362) - [1]=> - string(12) "__FUNCTION__" - [2]=> - int(6) - } - [23]=> - string(1) ";" - [24]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [25]=> - string(1) "}" - [26]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(6) - } - [27]=> - string(1) "}" - [28]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(7) - } - [29]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(8) - } -} --- with LINE and METHOD -- -array(19) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " " - [2]=> - int(2) - } - [2]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [4]=> - string(1) "=" - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [6]=> - array(3) { - [0]=> - int(363) - [1]=> - string(8) "__LINE__" - [2]=> - int(2) - } - [7]=> - string(1) ";" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(2) - } - [9]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(3) - } - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [11]=> - string(1) "=" - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [13]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(3) - } - [14]=> - string(1) "." - [15]=> - array(3) { - [0]=> - int(361) - [1]=> - string(10) "__METHOD__" - [2]=> - int(3) - } - [16]=> - string(1) ";" - [17]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [18]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(4) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation13.phpt b/ext/tokenizer/tests/token_get_all_variation13.phpt deleted file mode 100644 index e79545e7e4103..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation13.phpt +++ /dev/null @@ -1,1167 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with class/object constructs ---FILE-- -'; -$tokens = token_get_all($source); -var_dump($tokens); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : with class/object constructs *** -array(145) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(353) - [1]=> - string(9) "interface" - [2]=> - int(2) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(307) - [1]=> - string(11) "MyInterface" - [2]=> - int(2) - } - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [5]=> - string(1) "{" - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(3) - } - [7]=> - array(3) { - [0]=> - int(341) - [1]=> - string(6) "public" - [2]=> - int(4) - } - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [9]=> - array(3) { - [0]=> - int(334) - [1]=> - string(5) "const" - [2]=> - int(4) - } - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [11]=> - array(3) { - [0]=> - int(347) - [1]=> - string(3) "var" - [2]=> - int(4) - } - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [13]=> - array(3) { - [0]=> - int(309) - [1]=> - string(4) "$var" - [2]=> - int(4) - } - [14]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [15]=> - string(1) "=" - [16]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [17]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "10" - [2]=> - int(4) - } - [18]=> - string(1) ";" - [19]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [20]=> - string(1) "}" - [21]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [22]=> - array(3) { - [0]=> - int(345) - [1]=> - string(8) "abstract" - [2]=> - int(6) - } - [23]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [24]=> - array(3) { - [0]=> - int(352) - [1]=> - string(5) "class" - [2]=> - int(6) - } - [25]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [26]=> - array(3) { - [0]=> - int(307) - [1]=> - string(7) "MyClass" - [2]=> - int(6) - } - [27]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(6) - } - [28]=> - string(1) "{" - [29]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(7) - } - [30]=> - array(3) { - [0]=> - int(343) - [1]=> - string(7) "private" - [2]=> - int(8) - } - [31]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [32]=> - array(3) { - [0]=> - int(347) - [1]=> - string(3) "var" - [2]=> - int(8) - } - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [34]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(8) - } - [35]=> - string(1) ";" - [36]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(8) - } - [37]=> - array(3) { - [0]=> - int(341) - [1]=> - string(6) "public" - [2]=> - int(9) - } - [38]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [39]=> - array(3) { - [0]=> - int(347) - [1]=> - string(3) "var" - [2]=> - int(9) - } - [40]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [41]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(9) - } - [42]=> - string(1) ";" - [43]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(9) - } - [44]=> - array(3) { - [0]=> - int(342) - [1]=> - string(9) "protected" - [2]=> - int(10) - } - [45]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(10) - } - [46]=> - array(3) { - [0]=> - int(347) - [1]=> - string(3) "var" - [2]=> - int(10) - } - [47]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(10) - } - [48]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(10) - } - [49]=> - string(1) ";" - [50]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(10) - } - [51]=> - array(3) { - [0]=> - int(346) - [1]=> - string(6) "static" - [2]=> - int(11) - } - [52]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(11) - } - [53]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$d" - [2]=> - int(11) - } - [54]=> - string(1) ";" - [55]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(11) - } - [56]=> - array(3) { - [0]=> - int(344) - [1]=> - string(5) "final" - [2]=> - int(12) - } - [57]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(12) - } - [58]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$e" - [2]=> - int(12) - } - [59]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(12) - } - [60]=> - string(1) "=" - [61]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(12) - } - [62]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "10" - [2]=> - int(12) - } - [63]=> - string(1) ";" - [64]=> - array(3) { - [0]=> - int(370) - [1]=> - string(6) " - - " - [2]=> - int(12) - } - [65]=> - array(3) { - [0]=> - int(345) - [1]=> - string(8) "abstract" - [2]=> - int(14) - } - [66]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(14) - } - [67]=> - array(3) { - [0]=> - int(341) - [1]=> - string(6) "public" - [2]=> - int(14) - } - [68]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(14) - } - [69]=> - array(3) { - [0]=> - int(333) - [1]=> - string(8) "function" - [2]=> - int(14) - } - [70]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(14) - } - [71]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "myFunction" - [2]=> - int(14) - } - [72]=> - string(1) "(" - [73]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(14) - } - [74]=> - string(1) ")" - [75]=> - string(1) ";" - [76]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(14) - } - [77]=> - string(1) "}" - [78]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(15) - } - [79]=> - array(3) { - [0]=> - int(352) - [1]=> - string(5) "class" - [2]=> - int(16) - } - [80]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(16) - } - [81]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "ChildClass" - [2]=> - int(16) - } - [82]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(16) - } - [83]=> - array(3) { - [0]=> - int(354) - [1]=> - string(7) "extends" - [2]=> - int(16) - } - [84]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(16) - } - [85]=> - array(3) { - [0]=> - int(307) - [1]=> - string(7) "MyClass" - [2]=> - int(16) - } - [86]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(16) - } - [87]=> - array(3) { - [0]=> - int(355) - [1]=> - string(10) "implements" - [2]=> - int(16) - } - [88]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(16) - } - [89]=> - array(3) { - [0]=> - int(307) - [1]=> - string(11) "MyInterface" - [2]=> - int(16) - } - [90]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(16) - } - [91]=> - string(1) "{" - [92]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(17) - } - [93]=> - array(3) { - [0]=> - int(340) - [1]=> - string(6) "global" - [2]=> - int(18) - } - [94]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(18) - } - [95]=> - array(3) { - [0]=> - int(309) - [1]=> - string(6) "$value" - [2]=> - int(18) - } - [96]=> - string(1) ";" - [97]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(18) - } - [98]=> - array(3) { - [0]=> - int(333) - [1]=> - string(8) "function" - [2]=> - int(19) - } - [99]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(19) - } - [100]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "myFunction" - [2]=> - int(19) - } - [101]=> - string(1) "(" - [102]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(19) - } - [103]=> - string(1) ")" - [104]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(19) - } - [105]=> - string(1) "{" - [106]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(20) - } - [107]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(21) - } - [108]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(21) - } - [109]=> - string(1) "=" - [110]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(21) - } - [111]=> - array(3) { - [0]=> - int(299) - [1]=> - string(3) "new" - [2]=> - int(21) - } - [112]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(21) - } - [113]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "ChildClass" - [2]=> - int(21) - } - [114]=> - string(1) "(" - [115]=> - string(1) ")" - [116]=> - string(1) ";" - [117]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(21) - } - [118]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(22) - } - [119]=> - string(1) "(" - [120]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(22) - } - [121]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(22) - } - [122]=> - array(3) { - [0]=> - int(288) - [1]=> - string(10) "instanceof" - [2]=> - int(22) - } - [123]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(22) - } - [124]=> - array(3) { - [0]=> - int(307) - [1]=> - string(7) "MyClass" - [2]=> - int(22) - } - [125]=> - string(1) ")" - [126]=> - array(3) { - [0]=> - int(370) - [1]=> - string(7) " - " - [2]=> - int(22) - } - [127]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(23) - } - [128]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(23) - } - [129]=> - array(3) { - [0]=> - int(315) - [1]=> - string(16) ""object created"" - [2]=> - int(23) - } - [130]=> - string(1) ";" - [131]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(23) - } - [132]=> - string(1) "}" - [133]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(24) - } - [134]=> - string(1) "}" - [135]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(25) - } - [136]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "ChildClass" - [2]=> - int(26) - } - [137]=> - array(3) { - [0]=> - int(375) - [1]=> - string(2) "::" - [2]=> - int(26) - } - [138]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "myFunction" - [2]=> - int(26) - } - [139]=> - string(1) "(" - [140]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "10" - [2]=> - int(26) - } - [141]=> - string(1) ")" - [142]=> - string(1) ";" - [143]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(26) - } - [144]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(27) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation14.phpt b/ext/tokenizer/tests/token_get_all_variation14.phpt deleted file mode 100644 index d4e4ec6437eb1..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation14.phpt +++ /dev/null @@ -1,289 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - invalid token values ---FILE-- -'; -var_dump( token_get_all($source)); - -// with invalid open tag for testing entire source to be unkown token -echo "-- with invlalid PHP open tag & valid tokens --\n"; -$source = ''; -var_dump( token_get_all($source)); - -// with invalid PHP tags and invalid tokens -echo "-- with invalid PHP tags and tokens --\n"; -$source = ' ---EXPECTF-- -*** Testing token_get_all() : with invalid/unknown tokens *** --- with valid PHP tags & invlid tokens -- -array(29) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(307) - [1]=> - string(6) "struct" - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [4]=> - array(3) { - [0]=> - int(307) - [1]=> - string(8) "myStruct" - [2]=> - int(2) - } - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [6]=> - string(1) "{" - [7]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(2) - } - [8]=> - array(3) { - [0]=> - int(307) - [1]=> - string(8) "variable" - [2]=> - int(3) - } - [9]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [10]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(3) - } - [11]=> - string(1) ";" - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(3) - } - [13]=> - array(3) { - [0]=> - int(307) - [1]=> - string(6) "method" - [2]=> - int(4) - } - [14]=> - string(1) "(" - [15]=> - string(1) ")" - [16]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [17]=> - string(1) "{" - [18]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [19]=> - array(3) { - [0]=> - int(307) - [1]=> - string(7) "display" - [2]=> - int(4) - } - [20]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [21]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(4) - } - [22]=> - string(1) ";" - [23]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [24]=> - string(1) "}" - [25]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [26]=> - string(1) "}" - [27]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [28]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(6) - } -} --- with invlalid PHP open tag & valid tokens -- -array(1) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(28) "" - [2]=> - int(1) - } -} --- with invalid PHP tags and tokens -- -array(2) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(18) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(311) - [1]=> - string(1) "<" - [2]=> - int(1) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation15.phpt b/ext/tokenizer/tests/token_get_all_variation15.phpt deleted file mode 100644 index 03ccd4d9d12ea..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation15.phpt +++ /dev/null @@ -1,778 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - heredoc string for 'source' ---INI-- -short_open_tag=On ---FILE-- - 0) { - echo "*"; - \$a--; - } - myFunction(10); -?> -EOT; -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : with heredoc source string *** -array(103) { - [0]=> - array(3) { - [0]=> - int(368) - [1]=> - string(3) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(4) " - " - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [4]=> - string(1) "=" - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [6]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(2) - } - [7]=> - string(1) ";" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(2) - } - [9]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(3) - } - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [11]=> - string(1) "=" - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [13]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(3) - } - [14]=> - string(1) ";" - [15]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(3) - } - [16]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(4) - } - [17]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [18]=> - string(1) "=" - [19]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [20]=> - array(3) { - [0]=> - int(371) - [1]=> - string(7) "<< - int(4) - } - [21]=> - array(3) { - [0]=> - int(314) - [1]=> - string(36) " This is to test - heredoc string -" - [2]=> - int(5) - } - [22]=> - array(3) { - [0]=> - int(372) - [1]=> - string(3) "EOS" - [2]=> - int(7) - } - [23]=> - string(1) ";" - [24]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(7) - } - [25]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(8) - } - [26]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [27]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(8) - } - [28]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [29]=> - string(1) "+" - [30]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [31]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(8) - } - [32]=> - string(1) ";" - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(8) - } - [34]=> - array(3) { - [0]=> - int(333) - [1]=> - string(8) "function" - [2]=> - int(9) - } - [35]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [36]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "myFunction" - [2]=> - int(9) - } - [37]=> - string(1) "(" - [38]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(9) - } - [39]=> - string(1) ")" - [40]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(9) - } - [41]=> - string(1) "{" - [42]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(10) - } - [43]=> - array(3) { - [0]=> - int(307) - [1]=> - string(8) "var_dump" - [2]=> - int(11) - } - [44]=> - string(1) "(" - [45]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(11) - } - [46]=> - string(1) ")" - [47]=> - string(1) ";" - [48]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(11) - } - [49]=> - string(1) "}" - [50]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(12) - } - [51]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(13) - } - [52]=> - string(1) "(" - [53]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(13) - } - [54]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(13) - } - [55]=> - string(1) "<" - [56]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(13) - } - [57]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "10" - [2]=> - int(13) - } - [58]=> - string(1) ")" - [59]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(13) - } - [60]=> - string(1) "{" - [61]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(13) - } - [62]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(14) - } - [63]=> - array(3) { - [0]=> - int(297) - [1]=> - string(2) "++" - [2]=> - int(14) - } - [64]=> - string(1) ";" - [65]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(14) - } - [66]=> - string(1) "}" - [67]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(15) - } - [68]=> - array(3) { - [0]=> - int(303) - [1]=> - string(4) "else" - [2]=> - int(16) - } - [69]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(16) - } - [70]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(17) - } - [71]=> - array(3) { - [0]=> - int(296) - [1]=> - string(2) "--" - [2]=> - int(17) - } - [72]=> - string(1) ";" - [73]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(17) - } - [74]=> - array(3) { - [0]=> - int(318) - [1]=> - string(5) "while" - [2]=> - int(18) - } - [75]=> - string(1) "(" - [76]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(18) - } - [77]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(18) - } - [78]=> - string(1) ">" - [79]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(18) - } - [80]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "0" - [2]=> - int(18) - } - [81]=> - string(1) ")" - [82]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(18) - } - [83]=> - string(1) "{" - [84]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(18) - } - [85]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(19) - } - [86]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(19) - } - [87]=> - array(3) { - [0]=> - int(315) - [1]=> - string(3) ""*"" - [2]=> - int(19) - } - [88]=> - string(1) ";" - [89]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(19) - } - [90]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(20) - } - [91]=> - array(3) { - [0]=> - int(296) - [1]=> - string(2) "--" - [2]=> - int(20) - } - [92]=> - string(1) ";" - [93]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(20) - } - [94]=> - string(1) "}" - [95]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(21) - } - [96]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "myFunction" - [2]=> - int(22) - } - [97]=> - string(1) "(" - [98]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "10" - [2]=> - int(22) - } - [99]=> - string(1) ")" - [100]=> - string(1) ";" - [101]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(22) - } - [102]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(23) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation16.phpt b/ext/tokenizer/tests/token_get_all_variation16.phpt deleted file mode 100644 index 87646e955d8e2..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation16.phpt +++ /dev/null @@ -1,1001 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with function constructs ---FILE-- ->= 2; - -if($b <= 0) - die; -else - print($b); - -list($value1,$value2) = $c; -if(empty($value1) && !isset($value1)) { - __halt_compiler(); -} -?>'; -$tokens = token_get_all($source); -var_dump($tokens); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : with different function constructs *** -array(142) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(324) - [1]=> - string(7) "declare" - [2]=> - int(2) - } - [2]=> - string(1) "(" - [3]=> - array(3) { - [0]=> - int(307) - [1]=> - string(5) "VALUE" - [2]=> - int(2) - } - [4]=> - string(1) "=" - [5]=> - array(3) { - [0]=> - int(305) - [1]=> - string(3) "100" - [2]=> - int(2) - } - [6]=> - string(1) ")" - [7]=> - string(1) ";" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [9]=> - array(3) { - [0]=> - int(262) - [1]=> - string(7) "include" - [2]=> - int(3) - } - [10]=> - string(1) "(" - [11]=> - array(3) { - [0]=> - int(315) - [1]=> - string(13) ""addfile.php"" - [2]=> - int(3) - } - [12]=> - string(1) ")" - [13]=> - string(1) ";" - [14]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [15]=> - array(3) { - [0]=> - int(259) - [1]=> - string(7) "require" - [2]=> - int(4) - } - [16]=> - string(1) "(" - [17]=> - array(3) { - [0]=> - int(315) - [1]=> - string(13) ""sumfile.php"" - [2]=> - int(4) - } - [18]=> - string(1) ")" - [19]=> - string(1) ";" - [20]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " - -" - [2]=> - int(4) - } - [21]=> - array(3) { - [0]=> - int(333) - [1]=> - string(8) "function" - [2]=> - int(6) - } - [22]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [23]=> - array(3) { - [0]=> - int(307) - [1]=> - string(10) "myFunction" - [2]=> - int(6) - } - [24]=> - string(1) "(" - [25]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(6) - } - [26]=> - string(1) ")" - [27]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(6) - } - [28]=> - string(1) "{" - [29]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(7) - } - [30]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(8) - } - [31]=> - string(1) "(" - [32]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(8) - } - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [34]=> - string(1) "%" - [35]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [36]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(8) - } - [37]=> - string(1) ")" - [38]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(8) - } - [39]=> - array(3) { - [0]=> - int(335) - [1]=> - string(6) "return" - [2]=> - int(9) - } - [40]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [41]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(9) - } - [42]=> - string(1) ";" - [43]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(9) - } - [44]=> - array(3) { - [0]=> - int(303) - [1]=> - string(4) "else" - [2]=> - int(10) - } - [45]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(10) - } - [46]=> - array(3) { - [0]=> - int(300) - [1]=> - string(4) "exit" - [2]=> - int(11) - } - [47]=> - string(1) ";" - [48]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(11) - } - [49]=> - string(1) "}" - [50]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " - -" - [2]=> - int(12) - } - [51]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(14) - } - [52]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(14) - } - [53]=> - string(1) "=" - [54]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(14) - } - [55]=> - array(3) { - [0]=> - int(307) - [1]=> - string(5) "VALUE" - [2]=> - int(14) - } - [56]=> - string(1) ";" - [57]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(14) - } - [58]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(15) - } - [59]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(15) - } - [60]=> - string(1) "=" - [61]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(15) - } - [62]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "20" - [2]=> - int(15) - } - [63]=> - string(1) ";" - [64]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(15) - } - [65]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(16) - } - [66]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(16) - } - [67]=> - string(1) "=" - [68]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(16) - } - [69]=> - array(3) { - [0]=> - int(359) - [1]=> - string(5) "array" - [2]=> - int(16) - } - [70]=> - string(1) "(" - [71]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(16) - } - [72]=> - string(1) "," - [73]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(16) - } - [74]=> - string(1) ")" - [75]=> - string(1) ";" - [76]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(16) - } - [77]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(17) - } - [78]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(17) - } - [79]=> - array(3) { - [0]=> - int(267) - [1]=> - string(3) ">>=" - [2]=> - int(17) - } - [80]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(17) - } - [81]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(17) - } - [82]=> - string(1) ";" - [83]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " - -" - [2]=> - int(17) - } - [84]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(19) - } - [85]=> - string(1) "(" - [86]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(19) - } - [87]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(19) - } - [88]=> - array(3) { - [0]=> - int(285) - [1]=> - string(2) "<=" - [2]=> - int(19) - } - [89]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(19) - } - [90]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "0" - [2]=> - int(19) - } - [91]=> - string(1) ")" - [92]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(19) - } - [93]=> - array(3) { - [0]=> - int(300) - [1]=> - string(3) "die" - [2]=> - int(20) - } - [94]=> - string(1) ";" - [95]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(20) - } - [96]=> - array(3) { - [0]=> - int(303) - [1]=> - string(4) "else" - [2]=> - int(21) - } - [97]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(21) - } - [98]=> - array(3) { - [0]=> - int(266) - [1]=> - string(5) "print" - [2]=> - int(22) - } - [99]=> - string(1) "(" - [100]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(22) - } - [101]=> - string(1) ")" - [102]=> - string(1) ";" - [103]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " - -" - [2]=> - int(22) - } - [104]=> - array(3) { - [0]=> - int(358) - [1]=> - string(4) "list" - [2]=> - int(24) - } - [105]=> - string(1) "(" - [106]=> - array(3) { - [0]=> - int(309) - [1]=> - string(7) "$value1" - [2]=> - int(24) - } - [107]=> - string(1) "," - [108]=> - array(3) { - [0]=> - int(309) - [1]=> - string(7) "$value2" - [2]=> - int(24) - } - [109]=> - string(1) ")" - [110]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(24) - } - [111]=> - string(1) "=" - [112]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(24) - } - [113]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(24) - } - [114]=> - string(1) ";" - [115]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(24) - } - [116]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(25) - } - [117]=> - string(1) "(" - [118]=> - array(3) { - [0]=> - int(350) - [1]=> - string(5) "empty" - [2]=> - int(25) - } - [119]=> - string(1) "(" - [120]=> - array(3) { - [0]=> - int(309) - [1]=> - string(7) "$value1" - [2]=> - int(25) - } - [121]=> - string(1) ")" - [122]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(25) - } - [123]=> - array(3) { - [0]=> - int(279) - [1]=> - string(2) "&&" - [2]=> - int(25) - } - [124]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(25) - } - [125]=> - string(1) "!" - [126]=> - array(3) { - [0]=> - int(349) - [1]=> - string(5) "isset" - [2]=> - int(25) - } - [127]=> - string(1) "(" - [128]=> - array(3) { - [0]=> - int(309) - [1]=> - string(7) "$value1" - [2]=> - int(25) - } - [129]=> - string(1) ")" - [130]=> - string(1) ")" - [131]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(25) - } - [132]=> - string(1) "{" - [133]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(25) - } - [134]=> - array(3) { - [0]=> - int(351) - [1]=> - string(15) "__halt_compiler" - [2]=> - int(26) - } - [135]=> - string(1) "(" - [136]=> - string(1) ")" - [137]=> - string(1) ";" - [138]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(26) - } - [139]=> - string(1) "}" - [140]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(27) - } - [141]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(28) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation17.phpt b/ext/tokenizer/tests/token_get_all_variation17.phpt deleted file mode 100644 index e10fb5851b666..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation17.phpt +++ /dev/null @@ -1,611 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with exception keywords ---FILE-- -'; -$tokens = token_get_all($source); -var_dump($tokens); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : with exception keywords *** -array(81) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(333) - [1]=> - string(8) "function" - [2]=> - int(2) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(307) - [1]=> - string(7) "inverse" - [2]=> - int(2) - } - [4]=> - string(1) "(" - [5]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$x" - [2]=> - int(2) - } - [6]=> - string(1) ")" - [7]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [8]=> - string(1) "{" - [9]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(3) - } - [10]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(4) - } - [11]=> - string(1) "(" - [12]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$x" - [2]=> - int(4) - } - [13]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [14]=> - array(3) { - [0]=> - int(283) - [1]=> - string(2) "==" - [2]=> - int(4) - } - [15]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [16]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "0" - [2]=> - int(4) - } - [17]=> - string(1) ")" - [18]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [19]=> - string(1) "{" - [20]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(4) - } - [21]=> - array(3) { - [0]=> - int(338) - [1]=> - string(5) "throw" - [2]=> - int(5) - } - [22]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [23]=> - array(3) { - [0]=> - int(299) - [1]=> - string(3) "new" - [2]=> - int(5) - } - [24]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [25]=> - array(3) { - [0]=> - int(307) - [1]=> - string(9) "Exception" - [2]=> - int(5) - } - [26]=> - string(1) "(" - [27]=> - array(3) { - [0]=> - int(315) - [1]=> - string(17) ""Divison by zero"" - [2]=> - int(5) - } - [28]=> - string(1) ")" - [29]=> - string(1) ";" - [30]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(5) - } - [31]=> - array(3) { - [0]=> - int(303) - [1]=> - string(4) "else" - [2]=> - int(6) - } - [32]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(6) - } - [33]=> - array(3) { - [0]=> - int(335) - [1]=> - string(6) "return" - [2]=> - int(7) - } - [34]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(7) - } - [35]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(7) - } - [36]=> - string(1) "/" - [37]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$x" - [2]=> - int(7) - } - [38]=> - string(1) ";" - [39]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(7) - } - [40]=> - string(1) "}" - [41]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(8) - } - [42]=> - array(3) { - [0]=> - int(336) - [1]=> - string(3) "try" - [2]=> - int(9) - } - [43]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [44]=> - string(1) "{" - [45]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(9) - } - [46]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(10) - } - [47]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(10) - } - [48]=> - array(3) { - [0]=> - int(307) - [1]=> - string(7) "inverse" - [2]=> - int(10) - } - [49]=> - string(1) "(" - [50]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "0" - [2]=> - int(10) - } - [51]=> - string(1) ")" - [52]=> - string(1) ";" - [53]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(10) - } - [54]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(11) - } - [55]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(11) - } - [56]=> - array(3) { - [0]=> - int(307) - [1]=> - string(7) "inverse" - [2]=> - int(11) - } - [57]=> - string(1) "(" - [58]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "5" - [2]=> - int(11) - } - [59]=> - string(1) ")" - [60]=> - string(1) ";" - [61]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(11) - } - [62]=> - string(1) "}" - [63]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(12) - } - [64]=> - array(3) { - [0]=> - int(337) - [1]=> - string(5) "catch" - [2]=> - int(12) - } - [65]=> - string(1) "(" - [66]=> - array(3) { - [0]=> - int(307) - [1]=> - string(9) "Exception" - [2]=> - int(12) - } - [67]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(12) - } - [68]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$e" - [2]=> - int(12) - } - [69]=> - string(1) ")" - [70]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(12) - } - [71]=> - string(1) "{" - [72]=> - array(3) { - [0]=> - int(370) - [1]=> - string(5) " - " - [2]=> - int(12) - } - [73]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(13) - } - [74]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(13) - } - [75]=> - array(3) { - [0]=> - int(315) - [1]=> - string(19) ""caught exception:"" - [2]=> - int(13) - } - [76]=> - string(1) ";" - [77]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(13) - } - [78]=> - string(1) "}" - [79]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(14) - } - [80]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(15) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation18.phpt b/ext/tokenizer/tests/token_get_all_variation18.phpt deleted file mode 100644 index 309b7e626d264..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation18.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with HTML code ---FILE-- - - - Testing HTML - -" - -'; -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with HTML tags *** -array(9) { - [0]=> - array(3) { - [0]=> - int(311) - [1]=> - string(48) " - - - Testing HTML - -" - -" - [2]=> - int(1) - } - [1]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(8) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(8) - } - [3]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(9) - } - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [5]=> - array(3) { - [0]=> - int(315) - [1]=> - string(20) ""php code with HTML"" - [2]=> - int(9) - } - [6]=> - string(1) ";" - [7]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(9) - } - [8]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(10) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation19.phpt b/ext/tokenizer/tests/token_get_all_variation19.phpt deleted file mode 100644 index ae614054f432e..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation19.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -Reconstructing a script using token_get_all() ---FILE-- -foo(); - -for ($i = 0; $i < 10; $i++) { - echo "Loop iteration $i\n"; -} - -?>'; - -$token_array = token_get_all($phpstr); - -$script = ""; -// reconstruct a script (without open/close tags) from the token array -foreach ($token_array as $token) { - if (is_array($token)) { - if (strncmp($token[1], '', 2) == 0) { - continue; - } - $script .= $token[1]; - } else { - $script .= $token; - } -} - -var_dump($script); - -eval($script); - -?> ---EXPECT-- -string(259) " - -// A php script to test token_get_all() - -/* a different -type of -comment */ - -// a class -class TestClass { - public function foo() { - echo "Called foo()\n"; - } -} - -$a = new TestClass(); -$a->foo(); - -for ($i = 0; $i < 10; $i++) { - echo "Loop iteration $i\n"; -} - -" -Called foo() -Loop iteration 0 -Loop iteration 1 -Loop iteration 2 -Loop iteration 3 -Loop iteration 4 -Loop iteration 5 -Loop iteration 6 -Loop iteration 7 -Loop iteration 8 -Loop iteration 9 diff --git a/ext/tokenizer/tests/token_get_all_variation2.phpt b/ext/tokenizer/tests/token_get_all_variation2.phpt deleted file mode 100644 index d4f62dcab17d1..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation2.phpt +++ /dev/null @@ -1,429 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with different arithmetic operators ---FILE-- -', - '', - '', - '' -); -for($count = 0; $count < count($source); $count++) { - echo "-- Iteration ".($count + 1)." --\n"; - var_dump( token_get_all($source[$count])); -} -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with different arithmetic operators *** --- Iteration 1 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - string(1) "+" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 2 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - string(1) "-" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 3 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - string(1) "*" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 4 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - string(1) "%" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation3.phpt b/ext/tokenizer/tests/token_get_all_variation3.phpt deleted file mode 100644 index 267e8c5b4b0d3..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation3.phpt +++ /dev/null @@ -1,568 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with logical operators ---FILE-- -', - '', - '', - '', - '' -); -for($count = 0; $count < count($source); $count++) { - echo "-- Iteration ".($count + 1)." --\n"; - var_dump( token_get_all($source[$count])); -} - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with different logical operators *** --- Iteration 1 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - array(3) { - [0]=> - int(265) - [1]=> - string(3) "and" - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(305) - [1]=> - string(3) "024" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 2 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - array(3) { - [0]=> - int(263) - [1]=> - string(2) "or" - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(305) - [1]=> - string(4) "0X1E" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 3 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - array(3) { - [0]=> - int(264) - [1]=> - string(3) "xor" - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 4 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - array(3) { - [0]=> - int(279) - [1]=> - string(2) "&&" - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} --- Iteration 5 -- -array(13) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [5]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(1) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [7]=> - array(3) { - [0]=> - int(278) - [1]=> - string(2) "||" - [2]=> - int(1) - } - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [9]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(1) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(1) - } - [12]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(1) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation4.phpt b/ext/tokenizer/tests/token_get_all_variation4.phpt deleted file mode 100644 index e63a917ea3aba..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation4.phpt +++ /dev/null @@ -1,747 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with comparison operators ---FILE-- -= - T_IS_GREATER_OR_EQUAL(284), <= - T_IS_LESS_OR_EQUAL(285) - * != - T_IS_NOT_EQUAL, <> - T_IS_NOT_EQUAL(282), !== - T_IS_NOT_IDENTICAL(280) -*/ - -echo "*** Testing token_get_all() : 'source' string with different comparison operators ***\n"; - -// comparison operators : '==', '===', '>=', '<=', '!=', '!==', '<>' -$source = '= 10 && $a <= 20) - echo ">= 10 & <=20"; -elseif($a != 1 || $a <> 1) - echo "!= 1"; -elseif($a !== 1) - echo "!==1"; -?>'; -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with different comparison operators *** -array(89) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(2) - } - [3]=> - string(1) "(" - [4]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(2) - } - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [6]=> - array(3) { - [0]=> - int(283) - [1]=> - string(2) "==" - [2]=> - int(2) - } - [7]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [8]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "0" - [2]=> - int(2) - } - [9]=> - string(1) ")" - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(4) " - " - [2]=> - int(2) - } - [11]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(3) - } - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [13]=> - array(3) { - [0]=> - int(315) - [1]=> - string(6) ""== 0"" - [2]=> - int(3) - } - [14]=> - string(1) ";" - [15]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [16]=> - array(3) { - [0]=> - int(302) - [1]=> - string(6) "elseif" - [2]=> - int(4) - } - [17]=> - string(1) "(" - [18]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(4) - } - [19]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [20]=> - array(3) { - [0]=> - int(281) - [1]=> - string(3) "===" - [2]=> - int(4) - } - [21]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [22]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(4) - } - [23]=> - string(1) ")" - [24]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(4) - } - [25]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(5) - } - [26]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [27]=> - array(3) { - [0]=> - int(315) - [1]=> - string(7) ""=== 2"" - [2]=> - int(5) - } - [28]=> - string(1) ";" - [29]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [30]=> - array(3) { - [0]=> - int(302) - [1]=> - string(6) "elseif" - [2]=> - int(6) - } - [31]=> - string(1) "(" - [32]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(6) - } - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [34]=> - array(3) { - [0]=> - int(284) - [1]=> - string(2) ">=" - [2]=> - int(6) - } - [35]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [36]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "10" - [2]=> - int(6) - } - [37]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [38]=> - array(3) { - [0]=> - int(279) - [1]=> - string(2) "&&" - [2]=> - int(6) - } - [39]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [40]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(6) - } - [41]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [42]=> - array(3) { - [0]=> - int(285) - [1]=> - string(2) "<=" - [2]=> - int(6) - } - [43]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [44]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "20" - [2]=> - int(6) - } - [45]=> - string(1) ")" - [46]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(6) - } - [47]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(7) - } - [48]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(7) - } - [49]=> - array(3) { - [0]=> - int(315) - [1]=> - string(14) "">= 10 & <=20"" - [2]=> - int(7) - } - [50]=> - string(1) ";" - [51]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(7) - } - [52]=> - array(3) { - [0]=> - int(302) - [1]=> - string(6) "elseif" - [2]=> - int(8) - } - [53]=> - string(1) "(" - [54]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(8) - } - [55]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [56]=> - array(3) { - [0]=> - int(282) - [1]=> - string(2) "!=" - [2]=> - int(8) - } - [57]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [58]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(8) - } - [59]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [60]=> - array(3) { - [0]=> - int(278) - [1]=> - string(2) "||" - [2]=> - int(8) - } - [61]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [62]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(8) - } - [63]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [64]=> - array(3) { - [0]=> - int(282) - [1]=> - string(2) "<>" - [2]=> - int(8) - } - [65]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [66]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(8) - } - [67]=> - string(1) ")" - [68]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(8) - } - [69]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(9) - } - [70]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [71]=> - array(3) { - [0]=> - int(315) - [1]=> - string(6) ""!= 1"" - [2]=> - int(9) - } - [72]=> - string(1) ";" - [73]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(9) - } - [74]=> - array(3) { - [0]=> - int(302) - [1]=> - string(6) "elseif" - [2]=> - int(10) - } - [75]=> - string(1) "(" - [76]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(10) - } - [77]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(10) - } - [78]=> - array(3) { - [0]=> - int(280) - [1]=> - string(3) "!==" - [2]=> - int(10) - } - [79]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(10) - } - [80]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(10) - } - [81]=> - string(1) ")" - [82]=> - array(3) { - [0]=> - int(370) - [1]=> - string(3) " - " - [2]=> - int(10) - } - [83]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(11) - } - [84]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(11) - } - [85]=> - array(3) { - [0]=> - int(315) - [1]=> - string(6) ""!==1"" - [2]=> - int(11) - } - [86]=> - string(1) ";" - [87]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(11) - } - [88]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(12) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation5.phpt b/ext/tokenizer/tests/token_get_all_variation5.phpt deleted file mode 100644 index 5a7d16a36b282..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation5.phpt +++ /dev/null @@ -1,798 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with assignment operators ---FILE-- ->= - T_SR_EQUAL(267), <<= - T_SL_EQUAL(268), .= - T_CONCAT_EQUAL(273) -*/ - -echo "*** Testing token_get_all() : 'source' string with different assignment operators ***\n"; - -// assignment operators : '+=', '-=', '*=', '/=', '%=', '&=', '|=', '^=', '>>=', '<<=', '.=' -$source = '>= 1; -$b <<= 2; -$d .= "hello world"; -?>'; -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with different assignment operators *** -array(94) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [4]=> - string(1) "=" - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [6]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(2) - } - [7]=> - string(1) "," - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [9]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(2) - } - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [11]=> - string(1) "=" - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [13]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(2) - } - [14]=> - string(1) ";" - [15]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [16]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(3) - } - [17]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [18]=> - array(3) { - [0]=> - int(277) - [1]=> - string(2) "+=" - [2]=> - int(3) - } - [19]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [20]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(3) - } - [21]=> - string(1) ";" - [22]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [23]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(4) - } - [24]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [25]=> - array(3) { - [0]=> - int(276) - [1]=> - string(2) "-=" - [2]=> - int(4) - } - [26]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [27]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(4) - } - [28]=> - string(1) ";" - [29]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [30]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(5) - } - [31]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [32]=> - array(3) { - [0]=> - int(275) - [1]=> - string(2) "*=" - [2]=> - int(5) - } - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [34]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(5) - } - [35]=> - string(1) ";" - [36]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [37]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$d" - [2]=> - int(6) - } - [38]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [39]=> - array(3) { - [0]=> - int(274) - [1]=> - string(2) "/=" - [2]=> - int(6) - } - [40]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [41]=> - array(3) { - [0]=> - int(306) - [1]=> - string(5) "10.50" - [2]=> - int(6) - } - [42]=> - string(1) ";" - [43]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(6) - } - [44]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(7) - } - [45]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(7) - } - [46]=> - array(3) { - [0]=> - int(272) - [1]=> - string(2) "%=" - [2]=> - int(7) - } - [47]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(7) - } - [48]=> - array(3) { - [0]=> - int(306) - [1]=> - string(5) "10.50" - [2]=> - int(7) - } - [49]=> - string(1) ";" - [50]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(7) - } - [51]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(8) - } - [52]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [53]=> - array(3) { - [0]=> - int(271) - [1]=> - string(2) "&=" - [2]=> - int(8) - } - [54]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [55]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(8) - } - [56]=> - string(1) ";" - [57]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(8) - } - [58]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(9) - } - [59]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [60]=> - array(3) { - [0]=> - int(270) - [1]=> - string(2) "|=" - [2]=> - int(9) - } - [61]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [62]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(9) - } - [63]=> - string(1) ";" - [64]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(9) - } - [65]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$d" - [2]=> - int(10) - } - [66]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(10) - } - [67]=> - array(3) { - [0]=> - int(269) - [1]=> - string(2) "^=" - [2]=> - int(10) - } - [68]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(10) - } - [69]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "5" - [2]=> - int(10) - } - [70]=> - string(1) ";" - [71]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(10) - } - [72]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(11) - } - [73]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(11) - } - [74]=> - array(3) { - [0]=> - int(267) - [1]=> - string(3) ">>=" - [2]=> - int(11) - } - [75]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(11) - } - [76]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(11) - } - [77]=> - string(1) ";" - [78]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(11) - } - [79]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(12) - } - [80]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(12) - } - [81]=> - array(3) { - [0]=> - int(268) - [1]=> - string(3) "<<=" - [2]=> - int(12) - } - [82]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(12) - } - [83]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(12) - } - [84]=> - string(1) ";" - [85]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(12) - } - [86]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$d" - [2]=> - int(13) - } - [87]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(13) - } - [88]=> - array(3) { - [0]=> - int(273) - [1]=> - string(2) ".=" - [2]=> - int(13) - } - [89]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(13) - } - [90]=> - array(3) { - [0]=> - int(315) - [1]=> - string(13) ""hello world"" - [2]=> - int(13) - } - [91]=> - string(1) ";" - [92]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(13) - } - [93]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(14) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation6.phpt b/ext/tokenizer/tests/token_get_all_variation6.phpt deleted file mode 100644 index 5d81104a24aab..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation6.phpt +++ /dev/null @@ -1,392 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with bitwise operators ---FILE-- -> - T_SR(286) -*/ - -echo "*** Testing token_get_all() : 'source' string with different bitwise operators ***\n"; - -// bitwise operators : '<<' , '>>' -$source = '> 2; -var_dump($a); -var_dump($b); -?>'; -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with different bitwise operators *** -array(50) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(2) - } - [2]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [3]=> - string(1) "=" - [4]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [5]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(2) - } - [6]=> - string(1) "," - [7]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [8]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(2) - } - [9]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [10]=> - string(1) "=" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [12]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "4" - [2]=> - int(2) - } - [13]=> - string(1) ";" - [14]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [15]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(3) - } - [16]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [17]=> - string(1) "=" - [18]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [19]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(3) - } - [20]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [21]=> - array(3) { - [0]=> - int(287) - [1]=> - string(2) "<<" - [2]=> - int(3) - } - [22]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [23]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(3) - } - [24]=> - string(1) ";" - [25]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [26]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(4) - } - [27]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [28]=> - string(1) "=" - [29]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [30]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(4) - } - [31]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [32]=> - array(3) { - [0]=> - int(286) - [1]=> - string(2) ">>" - [2]=> - int(4) - } - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [34]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "2" - [2]=> - int(4) - } - [35]=> - string(1) ";" - [36]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [37]=> - array(3) { - [0]=> - int(307) - [1]=> - string(8) "var_dump" - [2]=> - int(5) - } - [38]=> - string(1) "(" - [39]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(5) - } - [40]=> - string(1) ")" - [41]=> - string(1) ";" - [42]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [43]=> - array(3) { - [0]=> - int(307) - [1]=> - string(8) "var_dump" - [2]=> - int(6) - } - [44]=> - string(1) "(" - [45]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(6) - } - [46]=> - string(1) ")" - [47]=> - string(1) ";" - [48]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(6) - } - [49]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(7) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation7.phpt b/ext/tokenizer/tests/token_get_all_variation7.phpt deleted file mode 100644 index 5ba8563840b69..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation7.phpt +++ /dev/null @@ -1,259 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with increment/decrement operators ---FILE-- -'; -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with different increment/decrement operators *** -array(30) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [4]=> - string(1) "=" - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [6]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "10" - [2]=> - int(2) - } - [7]=> - string(1) "," - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [9]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(2) - } - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [11]=> - string(1) "=" - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [13]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "5" - [2]=> - int(2) - } - [14]=> - string(1) ";" - [15]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [16]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(3) - } - [17]=> - array(3) { - [0]=> - int(297) - [1]=> - string(2) "++" - [2]=> - int(3) - } - [18]=> - string(1) ";" - [19]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [20]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(4) - } - [21]=> - array(3) { - [0]=> - int(296) - [1]=> - string(2) "--" - [2]=> - int(4) - } - [22]=> - string(1) ";" - [23]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [24]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(5) - } - [25]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [26]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(5) - } - [27]=> - string(1) ";" - [28]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [29]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(6) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation8.phpt b/ext/tokenizer/tests/token_get_all_variation8.phpt deleted file mode 100644 index 5c761f6cbdc0e..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation8.phpt +++ /dev/null @@ -1,832 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with type casting operators ---FILE-- -'; -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with different type casting operators *** -array(108) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [4]=> - string(1) "=" - [5]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [6]=> - array(3) { - [0]=> - int(305) - [1]=> - string(1) "1" - [2]=> - int(2) - } - [7]=> - string(1) "," - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [9]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(2) - } - [10]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [11]=> - string(1) "=" - [12]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(2) - } - [13]=> - array(3) { - [0]=> - int(306) - [1]=> - string(4) "10.5" - [2]=> - int(2) - } - [14]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(2) - } - [15]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(3) - } - [16]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [17]=> - string(1) "=" - [18]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [19]=> - array(3) { - [0]=> - int(295) - [1]=> - string(5) "(int)" - [2]=> - int(3) - } - [20]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(3) - } - [21]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [22]=> - string(1) "+" - [23]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(3) - } - [24]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(3) - } - [25]=> - string(1) ";" - [26]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(3) - } - [27]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$d" - [2]=> - int(4) - } - [28]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [29]=> - string(1) "=" - [30]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [31]=> - array(3) { - [0]=> - int(294) - [1]=> - string(7) "(float)" - [2]=> - int(4) - } - [32]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(4) - } - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [34]=> - string(1) "+" - [35]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(4) - } - [36]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(4) - } - [37]=> - string(1) ";" - [38]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(4) - } - [39]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$e" - [2]=> - int(5) - } - [40]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [41]=> - string(1) "=" - [42]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(5) - } - [43]=> - array(3) { - [0]=> - int(293) - [1]=> - string(8) "(string)" - [2]=> - int(5) - } - [44]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(5) - } - [45]=> - string(1) "." - [46]=> - array(3) { - [0]=> - int(293) - [1]=> - string(8) "(string)" - [2]=> - int(5) - } - [47]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(5) - } - [48]=> - string(1) ";" - [49]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(5) - } - [50]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(6) - } - [51]=> - string(1) "(" - [52]=> - array(3) { - [0]=> - int(290) - [1]=> - string(6) "(bool)" - [2]=> - int(6) - } - [53]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(6) - } - [54]=> - string(1) ")" - [55]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [56]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(6) - } - [57]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(6) - } - [58]=> - array(3) { - [0]=> - int(315) - [1]=> - string(6) ""true"" - [2]=> - int(6) - } - [59]=> - string(1) ";" - [60]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(6) - } - [61]=> - array(3) { - [0]=> - int(301) - [1]=> - string(2) "if" - [2]=> - int(7) - } - [62]=> - string(1) "(" - [63]=> - string(1) "!" - [64]=> - array(3) { - [0]=> - int(290) - [1]=> - string(9) "(boolean)" - [2]=> - int(7) - } - [65]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(7) - } - [66]=> - string(1) ")" - [67]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(7) - } - [68]=> - array(3) { - [0]=> - int(316) - [1]=> - string(4) "echo" - [2]=> - int(7) - } - [69]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(7) - } - [70]=> - array(3) { - [0]=> - int(315) - [1]=> - string(7) ""false"" - [2]=> - int(7) - } - [71]=> - string(1) ";" - [72]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(7) - } - [73]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(8) - } - [74]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [75]=> - string(1) "=" - [76]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [77]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(8) - } - [78]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [79]=> - string(1) "+" - [80]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [81]=> - array(3) { - [0]=> - int(295) - [1]=> - string(9) "(integer)" - [2]=> - int(8) - } - [82]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [83]=> - array(3) { - [0]=> - int(306) - [1]=> - string(7) "123.4e2" - [2]=> - int(8) - } - [84]=> - string(1) ";" - [85]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(8) - } - [86]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$d" - [2]=> - int(9) - } - [87]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [88]=> - string(1) "=" - [89]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [90]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(9) - } - [91]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [92]=> - string(1) "-" - [93]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [94]=> - array(3) { - [0]=> - int(294) - [1]=> - string(6) "(real)" - [2]=> - int(9) - } - [95]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [96]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "12" - [2]=> - int(9) - } - [97]=> - string(1) ";" - [98]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(9) - } - [99]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(10) - } - [100]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(10) - } - [101]=> - string(1) "=" - [102]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(10) - } - [103]=> - array(3) { - [0]=> - int(289) - [1]=> - string(7) "(unset)" - [2]=> - int(10) - } - [104]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(10) - } - [105]=> - string(1) ";" - [106]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(10) - } - [107]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(11) - } -} -Done diff --git a/ext/tokenizer/tests/token_get_all_variation9.phpt b/ext/tokenizer/tests/token_get_all_variation9.phpt deleted file mode 100644 index 247b754f7c710..0000000000000 --- a/ext/tokenizer/tests/token_get_all_variation9.phpt +++ /dev/null @@ -1,441 +0,0 @@ ---TEST-- -Test token_get_all() function : usage variations - with different types of comments ---FILE-- -'; -var_dump( token_get_all($source)); - -echo "Done" -?> ---EXPECTF-- -*** Testing token_get_all() : 'source' string with different comments *** -array(51) { - [0]=> - array(3) { - [0]=> - int(367) - [1]=> - string(6) " - int(1) - } - [1]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(1) - } - [2]=> - array(3) { - [0]=> - int(366) - [1]=> - string(65) "/** Performing addition operation on given values : - * a, b - */" - [2]=> - int(2) - } - [3]=> - array(3) { - [0]=> - int(370) - [1]=> - string(2) " - -" - [2]=> - int(4) - } - [4]=> - array(3) { - [0]=> - int(365) - [1]=> - string(13) "// int value -" - [2]=> - int(6) - } - [5]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(7) - } - [6]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(7) - } - [7]=> - string(1) "=" - [8]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(7) - } - [9]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "10" - [2]=> - int(7) - } - [10]=> - string(1) ";" - [11]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(7) - } - [12]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(8) - } - [13]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [14]=> - string(1) "=" - [15]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(8) - } - [16]=> - array(3) { - [0]=> - int(305) - [1]=> - string(2) "20" - [2]=> - int(8) - } - [17]=> - string(1) ";" - [18]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(8) - } - [19]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(9) - } - [20]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [21]=> - string(1) "=" - [22]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [23]=> - array(3) { - [0]=> - int(307) - [1]=> - string(4) "true" - [2]=> - int(9) - } - [24]=> - string(1) ";" - [25]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(9) - } - [26]=> - array(3) { - [0]=> - int(365) - [1]=> - string(14) "// bool value -" - [2]=> - int(9) - } - [27]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(10) - } - [28]=> - array(3) { - [0]=> - int(365) - [1]=> - string(59) "/* - * Performing operation on $a,$b - * display result - */" - [2]=> - int(11) - } - [29]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(14) - } - [30]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(15) - } - [31]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(15) - } - [32]=> - string(1) "=" - [33]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(15) - } - [34]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$a" - [2]=> - int(15) - } - [35]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(15) - } - [36]=> - string(1) "+" - [37]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(15) - } - [38]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$b" - [2]=> - int(15) - } - [39]=> - string(1) ";" - [40]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(15) - } - [41]=> - array(3) { - [0]=> - int(307) - [1]=> - string(8) "var_dump" - [2]=> - int(16) - } - [42]=> - string(1) "(" - [43]=> - array(3) { - [0]=> - int(309) - [1]=> - string(2) "$c" - [2]=> - int(16) - } - [44]=> - string(1) ")" - [45]=> - string(1) ";" - [46]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " " - [2]=> - int(16) - } - [47]=> - array(3) { - [0]=> - int(365) - [1]=> - string(20) "# expected: int(30) -" - [2]=> - int(16) - } - [48]=> - array(3) { - [0]=> - int(370) - [1]=> - string(1) " -" - [2]=> - int(17) - } - [49]=> - array(3) { - [0]=> - int(365) - [1]=> - string(17) "# end of program -" - [2]=> - int(18) - } - [50]=> - array(3) { - [0]=> - int(369) - [1]=> - string(2) "?>" - [2]=> - int(19) - } -} -Done diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c deleted file mode 100644 index 3118ed84bfab8..0000000000000 --- a/ext/tokenizer/tokenizer.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Andrei Zmievski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_tokenizer.h" - -typedef struct yy_buffer_state *YY_BUFFER_STATE; -typedef unsigned int yy_size_t; -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -#include "zend.h" -#include "zend_language_scanner.h" -#include - -#define zendtext LANG_SCNG(yy_text) -#define zendleng LANG_SCNG(yy_leng) - -/* {{{ tokenizer_functions[] - * - * Every user visible function must have an entry in tokenizer_functions[]. - */ -zend_function_entry tokenizer_functions[] = { - PHP_FE(token_get_all, NULL) - PHP_FE(token_name, NULL) - {NULL, NULL, NULL} /* Must be the last line in tokenizer_functions[] */ -}; -/* }}} */ - -/* {{{ tokenizer_module_entry - */ -zend_module_entry tokenizer_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "tokenizer", - tokenizer_functions, - PHP_MINIT(tokenizer), - NULL, - NULL, - NULL, - PHP_MINFO(tokenizer), -#if ZEND_MODULE_API_NO >= 20010901 - "0.1", /* Replace with version number for your extension */ -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_TOKENIZER -ZEND_GET_MODULE(tokenizer) -#endif - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(tokenizer) -{ - tokenizer_register_constants(INIT_FUNC_ARGS_PASSTHRU); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(tokenizer) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Tokenizer Support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -static void tokenize(zval *return_value TSRMLS_DC) -{ - zval token; - zval *keyword; - int token_type; - zend_bool destroy; - int token_line = 1; - - array_init(return_value); - - ZVAL_NULL(&token); - while ((token_type = lex_scan(&token TSRMLS_CC))) { - destroy = 1; - switch (token_type) { - case T_CLOSE_TAG: - if (zendtext[zendleng - 1] != '>') { - CG(zend_lineno)++; - } - case T_OPEN_TAG: - case T_OPEN_TAG_WITH_ECHO: - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - destroy = 0; - break; - } - - if (token_type >= 256) { - MAKE_STD_ZVAL(keyword); - array_init(keyword); - add_next_index_long(keyword, token_type); - if (token_type == T_END_HEREDOC) { - if (CG(increment_lineno)) { - token_line = ++CG(zend_lineno); - CG(increment_lineno) = 0; - } - add_next_index_stringl(keyword, Z_STRVAL(token), Z_STRLEN(token), 1); - efree(Z_STRVAL(token)); - } else { - add_next_index_stringl(keyword, zendtext, zendleng, 1); - } - add_next_index_long(keyword, token_line); - add_next_index_zval(return_value, keyword); - } else { - add_next_index_stringl(return_value, zendtext, zendleng, 1); - } - if (destroy && Z_TYPE(token) != IS_NULL) { - zval_dtor(&token); - } - ZVAL_NULL(&token); - - token_line = CG(zend_lineno); - } -} - -/* {{{ proto array token_get_all(string source) - */ -PHP_FUNCTION(token_get_all) -{ - char *source = NULL; - int argc = ZEND_NUM_ARGS(); - int source_len; - zval source_z; - zend_lex_state original_lex_state; - - if (zend_parse_parameters(argc TSRMLS_CC, "s", &source, &source_len) == FAILURE) - return; - - ZVAL_STRINGL(&source_z, source, source_len, 1); - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - - if (zend_prepare_string_for_scanning(&source_z, "" TSRMLS_CC) == FAILURE) { - RETURN_EMPTY_STRING(); - } - - LANG_SCNG(start) = 1; - - tokenize(return_value TSRMLS_CC); - - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - zval_dtor(&source_z); -} -/* }}} */ - -/* {{{ proto string token_name(int type) - */ -PHP_FUNCTION(token_name) -{ - int argc = ZEND_NUM_ARGS(); - long type; - - if (zend_parse_parameters(argc TSRMLS_CC, "l", &type) == FAILURE) { - return; - } - RETVAL_STRING(get_token_type_name(type), 1); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/tokenizer/tokenizer.dsp b/ext/tokenizer/tokenizer.dsp deleted file mode 100644 index 9844574a8a820..0000000000000 --- a/ext/tokenizer/tokenizer.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tokenizer" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=tokenizer - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "tokenizer.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "tokenizer.mak" CFG="tokenizer - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tokenizer - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "tokenizer - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "tokenizer - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOKENIZER_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_TOKENIZER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_TOKENIZER=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_tokenizer.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "tokenizer - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOKENIZER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_TOKENIZER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_TOKENIZER=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_tokenizer.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "tokenizer - Win32 Release_TS" -# Name "tokenizer - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\tokenizer.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_tokenizer.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/tokenizer/tokenizer.php b/ext/tokenizer/tokenizer.php deleted file mode 100644 index c13063c628ac2..0000000000000 --- a/ext/tokenizer/tokenizer.php +++ /dev/null @@ -1,35 +0,0 @@ - diff --git a/ext/tokenizer/tokenizer_data.c b/ext/tokenizer/tokenizer_data.c deleted file mode 100644 index a15004dfadbf2..0000000000000 --- a/ext/tokenizer/tokenizer_data.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Johannes Schlueter | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - DO NOT EDIT THIS FILE! - This file is generated using tokenizer_data_gen.sh -*/ - -#include "php.h" -#include "zend.h" -#include - - -void tokenizer_register_constants(INIT_FUNC_ARGS) { - REGISTER_LONG_CONSTANT("T_REQUIRE_ONCE", T_REQUIRE_ONCE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_REQUIRE", T_REQUIRE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_EVAL", T_EVAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INCLUDE_ONCE", T_INCLUDE_ONCE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INCLUDE", T_INCLUDE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LOGICAL_OR", T_LOGICAL_OR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LOGICAL_XOR", T_LOGICAL_XOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LOGICAL_AND", T_LOGICAL_AND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PRINT", T_PRINT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SR_EQUAL", T_SR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SL_EQUAL", T_SL_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_XOR_EQUAL", T_XOR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OR_EQUAL", T_OR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_AND_EQUAL", T_AND_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_MOD_EQUAL", T_MOD_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CONCAT_EQUAL", T_CONCAT_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DIV_EQUAL", T_DIV_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_MUL_EQUAL", T_MUL_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_MINUS_EQUAL", T_MINUS_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PLUS_EQUAL", T_PLUS_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BOOLEAN_OR", T_BOOLEAN_OR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BOOLEAN_AND", T_BOOLEAN_AND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_NOT_IDENTICAL", T_IS_NOT_IDENTICAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_IDENTICAL", T_IS_IDENTICAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_NOT_EQUAL", T_IS_NOT_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_EQUAL", T_IS_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_GREATER_OR_EQUAL", T_IS_GREATER_OR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IS_SMALLER_OR_EQUAL", T_IS_SMALLER_OR_EQUAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SR", T_SR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SL", T_SL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INSTANCEOF", T_INSTANCEOF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_UNSET_CAST", T_UNSET_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BOOL_CAST", T_BOOL_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OBJECT_CAST", T_OBJECT_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ARRAY_CAST", T_ARRAY_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STRING_CAST", T_STRING_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOUBLE_CAST", T_DOUBLE_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INT_CAST", T_INT_CAST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DEC", T_DEC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INC", T_INC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CLONE", T_CLONE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_NEW", T_NEW, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_EXIT", T_EXIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IF", T_IF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ELSEIF", T_ELSEIF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ELSE", T_ELSE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDIF", T_ENDIF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LNUMBER", T_LNUMBER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DNUMBER", T_DNUMBER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STRING", T_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STRING_VARNAME", T_STRING_VARNAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_VARIABLE", T_VARIABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_NUM_STRING", T_NUM_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INLINE_HTML", T_INLINE_HTML, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CHARACTER", T_CHARACTER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BAD_CHARACTER", T_BAD_CHARACTER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENCAPSED_AND_WHITESPACE", T_ENCAPSED_AND_WHITESPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CONSTANT_ENCAPSED_STRING", T_CONSTANT_ENCAPSED_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ECHO", T_ECHO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DO", T_DO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_WHILE", T_WHILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDWHILE", T_ENDWHILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FOR", T_FOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDFOR", T_ENDFOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FOREACH", T_FOREACH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDFOREACH", T_ENDFOREACH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DECLARE", T_DECLARE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDDECLARE", T_ENDDECLARE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_AS", T_AS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_SWITCH", T_SWITCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ENDSWITCH", T_ENDSWITCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CASE", T_CASE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DEFAULT", T_DEFAULT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BREAK", T_BREAK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CONTINUE", T_CONTINUE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FUNCTION", T_FUNCTION, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CONST", T_CONST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_RETURN", T_RETURN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_TRY", T_TRY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CATCH", T_CATCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_THROW", T_THROW, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_USE", T_USE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_GLOBAL", T_GLOBAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PUBLIC", T_PUBLIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PROTECTED", T_PROTECTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PRIVATE", T_PRIVATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FINAL", T_FINAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ABSTRACT", T_ABSTRACT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STATIC", T_STATIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_VAR", T_VAR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_UNSET", T_UNSET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ISSET", T_ISSET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_EMPTY", T_EMPTY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_HALT_COMPILER", T_HALT_COMPILER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CLASS", T_CLASS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_INTERFACE", T_INTERFACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_EXTENDS", T_EXTENDS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IMPLEMENTS", T_IMPLEMENTS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OBJECT_OPERATOR", T_OBJECT_OPERATOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOUBLE_ARROW", T_DOUBLE_ARROW, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LIST", T_LIST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ARRAY", T_ARRAY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CLASS_C", T_CLASS_C, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_METHOD_C", T_METHOD_C, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FUNC_C", T_FUNC_C, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LINE", T_LINE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FILE", T_FILE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_COMMENT", T_COMMENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOC_COMMENT", T_DOC_COMMENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OPEN_TAG", T_OPEN_TAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_OPEN_TAG_WITH_ECHO", T_OPEN_TAG_WITH_ECHO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CLOSE_TAG", T_CLOSE_TAG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_WHITESPACE", T_WHITESPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_START_HEREDOC", T_START_HEREDOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_END_HEREDOC", T_END_HEREDOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOLLAR_OPEN_CURLY_BRACES", T_DOLLAR_OPEN_CURLY_BRACES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CURLY_OPEN", T_CURLY_OPEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PAAMAYIM_NEKUDOTAYIM", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT); -} - -char *get_token_type_name(int token_type) -{ - switch (token_type) { - - case T_REQUIRE_ONCE: return "T_REQUIRE_ONCE"; - case T_REQUIRE: return "T_REQUIRE"; - case T_EVAL: return "T_EVAL"; - case T_INCLUDE_ONCE: return "T_INCLUDE_ONCE"; - case T_INCLUDE: return "T_INCLUDE"; - case T_LOGICAL_OR: return "T_LOGICAL_OR"; - case T_LOGICAL_XOR: return "T_LOGICAL_XOR"; - case T_LOGICAL_AND: return "T_LOGICAL_AND"; - case T_PRINT: return "T_PRINT"; - case T_SR_EQUAL: return "T_SR_EQUAL"; - case T_SL_EQUAL: return "T_SL_EQUAL"; - case T_XOR_EQUAL: return "T_XOR_EQUAL"; - case T_OR_EQUAL: return "T_OR_EQUAL"; - case T_AND_EQUAL: return "T_AND_EQUAL"; - case T_MOD_EQUAL: return "T_MOD_EQUAL"; - case T_CONCAT_EQUAL: return "T_CONCAT_EQUAL"; - case T_DIV_EQUAL: return "T_DIV_EQUAL"; - case T_MUL_EQUAL: return "T_MUL_EQUAL"; - case T_MINUS_EQUAL: return "T_MINUS_EQUAL"; - case T_PLUS_EQUAL: return "T_PLUS_EQUAL"; - case T_BOOLEAN_OR: return "T_BOOLEAN_OR"; - case T_BOOLEAN_AND: return "T_BOOLEAN_AND"; - case T_IS_NOT_IDENTICAL: return "T_IS_NOT_IDENTICAL"; - case T_IS_IDENTICAL: return "T_IS_IDENTICAL"; - case T_IS_NOT_EQUAL: return "T_IS_NOT_EQUAL"; - case T_IS_EQUAL: return "T_IS_EQUAL"; - case T_IS_GREATER_OR_EQUAL: return "T_IS_GREATER_OR_EQUAL"; - case T_IS_SMALLER_OR_EQUAL: return "T_IS_SMALLER_OR_EQUAL"; - case T_SR: return "T_SR"; - case T_SL: return "T_SL"; - case T_INSTANCEOF: return "T_INSTANCEOF"; - case T_UNSET_CAST: return "T_UNSET_CAST"; - case T_BOOL_CAST: return "T_BOOL_CAST"; - case T_OBJECT_CAST: return "T_OBJECT_CAST"; - case T_ARRAY_CAST: return "T_ARRAY_CAST"; - case T_STRING_CAST: return "T_STRING_CAST"; - case T_DOUBLE_CAST: return "T_DOUBLE_CAST"; - case T_INT_CAST: return "T_INT_CAST"; - case T_DEC: return "T_DEC"; - case T_INC: return "T_INC"; - case T_CLONE: return "T_CLONE"; - case T_NEW: return "T_NEW"; - case T_EXIT: return "T_EXIT"; - case T_IF: return "T_IF"; - case T_ELSEIF: return "T_ELSEIF"; - case T_ELSE: return "T_ELSE"; - case T_ENDIF: return "T_ENDIF"; - case T_LNUMBER: return "T_LNUMBER"; - case T_DNUMBER: return "T_DNUMBER"; - case T_STRING: return "T_STRING"; - case T_STRING_VARNAME: return "T_STRING_VARNAME"; - case T_VARIABLE: return "T_VARIABLE"; - case T_NUM_STRING: return "T_NUM_STRING"; - case T_INLINE_HTML: return "T_INLINE_HTML"; - case T_CHARACTER: return "T_CHARACTER"; - case T_BAD_CHARACTER: return "T_BAD_CHARACTER"; - case T_ENCAPSED_AND_WHITESPACE: return "T_ENCAPSED_AND_WHITESPACE"; - case T_CONSTANT_ENCAPSED_STRING: return "T_CONSTANT_ENCAPSED_STRING"; - case T_ECHO: return "T_ECHO"; - case T_DO: return "T_DO"; - case T_WHILE: return "T_WHILE"; - case T_ENDWHILE: return "T_ENDWHILE"; - case T_FOR: return "T_FOR"; - case T_ENDFOR: return "T_ENDFOR"; - case T_FOREACH: return "T_FOREACH"; - case T_ENDFOREACH: return "T_ENDFOREACH"; - case T_DECLARE: return "T_DECLARE"; - case T_ENDDECLARE: return "T_ENDDECLARE"; - case T_AS: return "T_AS"; - case T_SWITCH: return "T_SWITCH"; - case T_ENDSWITCH: return "T_ENDSWITCH"; - case T_CASE: return "T_CASE"; - case T_DEFAULT: return "T_DEFAULT"; - case T_BREAK: return "T_BREAK"; - case T_CONTINUE: return "T_CONTINUE"; - case T_FUNCTION: return "T_FUNCTION"; - case T_CONST: return "T_CONST"; - case T_RETURN: return "T_RETURN"; - case T_TRY: return "T_TRY"; - case T_CATCH: return "T_CATCH"; - case T_THROW: return "T_THROW"; - case T_USE: return "T_USE"; - case T_GLOBAL: return "T_GLOBAL"; - case T_PUBLIC: return "T_PUBLIC"; - case T_PROTECTED: return "T_PROTECTED"; - case T_PRIVATE: return "T_PRIVATE"; - case T_FINAL: return "T_FINAL"; - case T_ABSTRACT: return "T_ABSTRACT"; - case T_STATIC: return "T_STATIC"; - case T_VAR: return "T_VAR"; - case T_UNSET: return "T_UNSET"; - case T_ISSET: return "T_ISSET"; - case T_EMPTY: return "T_EMPTY"; - case T_HALT_COMPILER: return "T_HALT_COMPILER"; - case T_CLASS: return "T_CLASS"; - case T_INTERFACE: return "T_INTERFACE"; - case T_EXTENDS: return "T_EXTENDS"; - case T_IMPLEMENTS: return "T_IMPLEMENTS"; - case T_OBJECT_OPERATOR: return "T_OBJECT_OPERATOR"; - case T_DOUBLE_ARROW: return "T_DOUBLE_ARROW"; - case T_LIST: return "T_LIST"; - case T_ARRAY: return "T_ARRAY"; - case T_CLASS_C: return "T_CLASS_C"; - case T_METHOD_C: return "T_METHOD_C"; - case T_FUNC_C: return "T_FUNC_C"; - case T_LINE: return "T_LINE"; - case T_FILE: return "T_FILE"; - case T_COMMENT: return "T_COMMENT"; - case T_DOC_COMMENT: return "T_DOC_COMMENT"; - case T_OPEN_TAG: return "T_OPEN_TAG"; - case T_OPEN_TAG_WITH_ECHO: return "T_OPEN_TAG_WITH_ECHO"; - case T_CLOSE_TAG: return "T_CLOSE_TAG"; - case T_WHITESPACE: return "T_WHITESPACE"; - case T_START_HEREDOC: return "T_START_HEREDOC"; - case T_END_HEREDOC: return "T_END_HEREDOC"; - case T_DOLLAR_OPEN_CURLY_BRACES: return "T_DOLLAR_OPEN_CURLY_BRACES"; - case T_CURLY_OPEN: return "T_CURLY_OPEN"; - case T_PAAMAYIM_NEKUDOTAYIM: return "T_DOUBLE_COLON"; - - } - return "UNKNOWN"; -} - diff --git a/ext/tokenizer/tokenizer_data_gen.sh b/ext/tokenizer/tokenizer_data_gen.sh deleted file mode 100755 index 16dee3aab2fcc..0000000000000 --- a/ext/tokenizer/tokenizer_data_gen.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -INFILE="../../Zend/zend_language_parser.h" -OUTFILE="tokenizer_data.c" -AWK=awk - -#################################################################### - -if test ! -f "./tokenizer.c"; then - echo "Please run this script from within php-src/ext/tokenizer" - exit 0 -fi - - -echo '/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Johannes Schlueter | - +----------------------------------------------------------------------+ -*/ - -/* $Id: tokenizer_data_gen.sh,v 1.1.2.2 2007-07-31 23:24:11 johannes Exp $ */ - -/* - DO NOT EDIT THIS FILE! - This file is generated using tokenizer_data_gen.sh -*/ - -#include "php.h" -#include "zend.h" -#include - -' > $OUTFILE - - -echo 'void tokenizer_register_constants(INIT_FUNC_ARGS) {' >> $OUTFILE -$AWK '/^#define T_/ { print " REGISTER_LONG_CONSTANT(\"" $2 "\", " $2 ", CONST_CS | CONST_PERSISTENT);" }' < $INFILE >> $OUTFILE -echo ' REGISTER_LONG_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT);' >> $OUTFILE -echo '}' >> $OUTFILE - - -echo ' -char *get_token_type_name(int token_type) -{ - switch (token_type) { -' >> $OUTFILE - -$AWK ' - /^#define T_PAAMAYIM_NEKUDOTAYIM/ { - print " case T_PAAMAYIM_NEKUDOTAYIM: return \"T_DOUBLE_COLON\";" - next - } - /^#define T_/ { - print " case " $2 ": return \"" $2 "\";" - } -' < $INFILE >> $OUTFILE - -echo ' - } - return "UNKNOWN"; -} -' >> $OUTFILE - -echo "Wrote $OUTFILE" diff --git a/ext/wddx/CREDITS b/ext/wddx/CREDITS deleted file mode 100644 index 4c98513048e0f..0000000000000 --- a/ext/wddx/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -WDDX -Andrei Zmievski diff --git a/ext/wddx/config.m4 b/ext/wddx/config.m4 deleted file mode 100644 index 2b02a92aa9fc9..0000000000000 --- a/ext/wddx/config.m4 +++ /dev/null @@ -1,60 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(wddx,whether to enable WDDX support, -[ --enable-wddx Enable WDDX support]) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR WDDX: libxml2 install prefix], no, no) -fi - -PHP_ARG_WITH(libexpat-dir, libexpat dir for WDDX, -[ --with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated)],no,no) - -if test "$PHP_WDDX" != "no"; then - - dnl - dnl Default to libxml2 if --with-libexpat-dir is not used - dnl - if test "$PHP_LIBEXPAT_DIR" = "no"; then - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([WDDX extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(WDDX_SHARED_LIBADD, [ - if test "$PHP_XML" = "no"; then - PHP_ADD_SOURCES(ext/xml, compat.c) - PHP_ADD_BUILD_DIR(ext/xml) - fi - ], [ - AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=]) - ]) - fi - - dnl - dnl Check for expat only if --with-libexpat-dir is used. - dnl - if test "$PHP_LIBEXPAT_DIR" != "no"; then - for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do - if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then - EXPAT_DIR=$i - break - fi - done - - if test -z "$EXPAT_DIR"; then - AC_MSG_ERROR([not found. Please reinstall the expat distribution.]) - fi - - PHP_ADD_INCLUDE($EXPAT_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/$PHP_LIBDIR, WDDX_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBEXPAT, 1, [ ]) - fi - - AC_DEFINE(HAVE_WDDX, 1, [ ]) - PHP_NEW_EXTENSION(wddx, wddx.c, $ext_shared) - PHP_ADD_EXTENSION_DEP(wddx, libxml) - PHP_SUBST(XMLRPC_SHARED_LIBADD) -fi diff --git a/ext/wddx/config.w32 b/ext/wddx/config.w32 deleted file mode 100644 index 7b8483d0aa1b0..0000000000000 --- a/ext/wddx/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("wddx", "WDDX support", "yes"); - -if (PHP_WDDX == "yes" && PHP_LIBXML == "yes") { - EXTENSION("wddx", "wddx.c"); - AC_DEFINE("HAVE_WDDX", 1, "WDDX support"); - ADD_EXTENSION_DEP('wddx', 'libxml'); - CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_WDDX", "ext/date/lib"); -} - - diff --git a/ext/wddx/package.xml b/ext/wddx/package.xml deleted file mode 100644 index 9656ed1d167b8..0000000000000 --- a/ext/wddx/package.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - wddx - WDDX serialization functions - - - andrei - Andrei Zmievski - andrei@php.net - lead - - - -These functions are intended for work with WDDX (http://www.openwddx.org/) - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - diff --git a/ext/wddx/php_wddx.h b/ext/wddx/php_wddx.h deleted file mode 100644 index f589ed5ffb4f2..0000000000000 --- a/ext/wddx/php_wddx.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Andrei Zmievski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_WDDX_H -#define PHP_WDDX_H - -#if HAVE_WDDX - -extern zend_module_entry wddx_module_entry; -#define wddx_module_ptr &wddx_module_entry - -PHP_FUNCTION(wddx_serialize_value); -PHP_FUNCTION(wddx_serialize_vars); -PHP_FUNCTION(wddx_packet_start); -PHP_FUNCTION(wddx_packet_end); -PHP_FUNCTION(wddx_add_vars); -PHP_FUNCTION(wddx_deserialize); - -#else - -#define wddx_module_ptr NULL - -#endif /* HAVE_WDDX */ - -#define phpext_wddx_ptr wddx_module_ptr - -#endif /* !PHP_WDDX_H */ diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h deleted file mode 100644 index 6a884f7189f4c..0000000000000 --- a/ext/wddx/php_wddx_api.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Andrei Zmievski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_WDDX_API_H -#define PHP_WDDX_API_H - -#include "ext/standard/php_smart_str.h" - -#define WDDX_ARRAY_S "" -#define WDDX_ARRAY_E "" -#define WDDX_BINARY_S "" -#define WDDX_BINARY_E "" -#define WDDX_BOOLEAN "" -#define WDDX_CHAR "" -#define WDDX_COMMENT_S "" -#define WDDX_COMMENT_E "" -#define WDDX_DATA_S "" -#define WDDX_DATA_E "" -#define WDDX_HEADER "
" -#define WDDX_HEADER_S "
" -#define WDDX_HEADER_E "
" -#define WDDX_NULL "" -#define WDDX_NUMBER "%s" -#define WDDX_PACKET_S "" -#define WDDX_PACKET_E "" -#define WDDX_STRING_S "" -#define WDDX_STRING_E "" -#define WDDX_STRUCT_S "" -#define WDDX_STRUCT_E "" -#define WDDX_VAR_S "" -#define WDDX_VAR_E "" - -#define php_wddx_add_chunk(packet, str) smart_str_appends(packet, str) -#define php_wddx_add_chunk_ex(packet, str, len) smart_str_appendl(packet, str, len) -#define php_wddx_add_chunk_static(packet, str) smart_str_appendl(packet, str, sizeof(str)-1) - -typedef smart_str wddx_packet; - -wddx_packet* php_wddx_constructor(void); -void php_wddx_destructor(wddx_packet *packet); - -void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len); -void php_wddx_packet_end(wddx_packet *packet); - -void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC); -int php_wddx_deserialize_ex(char *, int, zval *return_value); -#define php_wddx_gather(packet) estrndup(packet->c, packet->len) - -#endif /* PHP_WDDX_API_H */ diff --git a/ext/wddx/tests/001-64bit.phpt b/ext/wddx/tests/001-64bit.phpt deleted file mode 100644 index 78b1dc9994b67..0000000000000 --- a/ext/wddx/tests/001-64bit.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -wddx deserialization test (64-bit) ---SKIPIF-- - - ---INI-- -precision=14 ---FILE-- - ---EXPECT-- -array(11) { - ["aNull"]=> - NULL - ["aString"]=> - string(8) "a string" - ["aNumber"]=> - float(-12.456) - ["aDateTime"]=> - int(897625932) - ["aDateTime2"]=> - int(329632332) - ["aDateTime3"]=> - int(2223088332) - ["aBoolean"]=> - bool(true) - ["anArray"]=> - array(2) { - [0]=> - int(10) - [1]=> - string(14) "second element" - } - ["aBinary"]=> - string(11) "binary data" - ["anObject"]=> - array(2) { - ["s"]=> - string(8) "a string" - ["n"]=> - float(-12.456) - } - ["aRecordset"]=> - array(2) { - ["NAME"]=> - array(2) { - [0]=> - string(8) "John Doe" - [1]=> - string(8) "Jane Doe" - } - ["AGE"]=> - array(2) { - [0]=> - int(34) - [1]=> - int(31) - } - } -} diff --git a/ext/wddx/tests/001.phpt b/ext/wddx/tests/001.phpt deleted file mode 100644 index e1aafd0ab0543..0000000000000 --- a/ext/wddx/tests/001.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -wddx deserialization test (32-bit) ---SKIPIF-- - - ---INI-- -precision=14 ---FILE-- - ---EXPECT-- -array(11) { - ["aNull"]=> - NULL - ["aString"]=> - string(8) "a string" - ["aNumber"]=> - float(-12.456) - ["aDateTime"]=> - int(897625932) - ["aDateTime2"]=> - int(329632332) - ["aDateTime3"]=> - string(22) "2040-06-12T04:32:12+00" - ["aBoolean"]=> - bool(true) - ["anArray"]=> - array(2) { - [0]=> - int(10) - [1]=> - string(14) "second element" - } - ["aBinary"]=> - string(11) "binary data" - ["anObject"]=> - array(2) { - ["s"]=> - string(8) "a string" - ["n"]=> - float(-12.456) - } - ["aRecordset"]=> - array(2) { - ["NAME"]=> - array(2) { - [0]=> - string(8) "John Doe" - [1]=> - string(8) "Jane Doe" - } - ["AGE"]=> - array(2) { - [0]=> - int(34) - [1]=> - int(31) - } - } -} diff --git a/ext/wddx/tests/002.phpt b/ext/wddx/tests/002.phpt deleted file mode 100644 index 692bfa85c6078..0000000000000 --- a/ext/wddx/tests/002.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -wddx packet construction using wddx ressource ---SKIPIF-- - ---INI-- -precision=14 ---FILE-- - ---EXPECT-- -
TEST comment
some string756
diff --git a/ext/wddx/tests/003.phpt b/ext/wddx/tests/003.phpt deleted file mode 100644 index 3240e43e92ce2..0000000000000 --- a/ext/wddx/tests/003.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -wddx deserialize from ressource ---SKIPIF-- - ---INI-- -precision=14 ---FILE-- -
TEST comment
some string756"); - rewind($fp); - var_dump(wddx_deserialize($fp)); - fclose($fp); -?> ---EXPECT-- -array(4) { - ["var1"]=> - NULL - ["var2"]=> - string(11) "some string" - ["var3"]=> - int(756) - ["var4"]=> - bool(true) -} diff --git a/ext/wddx/tests/004.phpt b/ext/wddx/tests/004.phpt deleted file mode 100644 index ae5a6b4bd5974..0000000000000 --- a/ext/wddx/tests/004.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -wddx session serializer handler (serialize) ---SKIPIF-- - ---INI-- -precision=14 -session.serialize_handler=wddx -session.use_cookies=0 -session.cache_limiter= -session.save_handler=files ---FILE-- -yes = "done"; } - - public function __sleep() { return array('bar', 'yes'); } - } - - session_start(); - - $_SESSION['data'] = array( - 'test1' => true, - 'test2' => 'some string', - 'test3' => 654321, - 'test4' => array( - 'some string', - true, - null - ), - ); - - $_SESSION['class'] = new foo(); - $_SESSION['class']->method(); - - var_dump(session_encode()); - - session_destroy(); -?> ---EXPECT-- -string(550) "
some string654321some stringfoookdone" diff --git a/ext/wddx/tests/005.phpt b/ext/wddx/tests/005.phpt deleted file mode 100644 index 99e7a9e31f954..0000000000000 --- a/ext/wddx/tests/005.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -wddx session serializer handler (deserialize) ---SKIPIF-- - ---INI-- -precision=14 -session.serialize_handler=wddx -session.use_cookies=0 -session.cache_limiter= -session.save_handler=files ---FILE-- -yes = "done"; } - } - - session_start(); - - session_decode("
some string654321some stringfoookdone"); - - var_dump($_SESSION); - - session_destroy(); -?> ---EXPECT-- -array(2) { - ["data"]=> - array(4) { - ["test1"]=> - bool(true) - ["test2"]=> - string(11) "some string" - ["test3"]=> - int(654321) - ["test4"]=> - array(3) { - [0]=> - string(11) "some string" - [1]=> - bool(true) - [2]=> - NULL - } - } - ["class"]=> - object(foo)#1 (2) { - ["bar"]=> - string(2) "ok" - ["yes"]=> - string(4) "done" - } -} diff --git a/ext/wddx/tests/bug27287.phpt b/ext/wddx/tests/bug27287.phpt deleted file mode 100755 index 72ac317aa07e2..0000000000000 --- a/ext/wddx/tests/bug27287.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #27287 (segfault with deserializing object data) ---SKIPIF-- - ---FILE-- -abc = 'def'; - - $string = wddx_serialize_value($foo); - $bar = wddx_deserialize($string); - - echo "OK\n"; - -?> ---EXPECT-- -OK diff --git a/ext/wddx/tests/bug34306.phpt b/ext/wddx/tests/bug34306.phpt deleted file mode 100755 index 5f1a0df72f14a..0000000000000 --- a/ext/wddx/tests/bug34306.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -#34306 (wddx_serialize_value() crashes with long array keys) ---SKIPIF-- - ---FILE-- - 1); -$buf = wddx_serialize_value($var, 'name'); -echo "OK\n"; - -?> ---EXPECT-- -OK diff --git a/ext/wddx/tests/bug35410.phpt b/ext/wddx/tests/bug35410.phpt deleted file mode 100755 index 3b4b9b62cf611..0000000000000 --- a/ext/wddx/tests/bug35410.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -#35410 (wddx_deserialize() doesn't handle large ints as keys properly) ---SKIPIF-- - ---FILE-- - -
-Content Configuration File -
- - - - - - - - - -10 - - -4 - - - - - - -desc - - - - - - - - - - - - - - -WDX; - -var_dump(wddx_deserialize($wddx)); -?> ---EXPECT-- -array(1) { - ["content_queries"]=> - array(1) { - ["content_113300831086270200"]=> - array(1) { - ["113301888545229100"]=> - array(3) { - ["max"]=> - int(10) - ["cache"]=> - int(4) - ["order"]=> - array(1) { - ["content_113300831086270200"]=> - array(1) { - ["CMS_BUILD"]=> - string(4) "desc" - } - } - } - } - } -} diff --git a/ext/wddx/tests/bug35410_64bit.phpt b/ext/wddx/tests/bug35410_64bit.phpt deleted file mode 100755 index 15377b175ea2c..0000000000000 --- a/ext/wddx/tests/bug35410_64bit.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -#35410 (wddx_deserialize() doesn't handle large ints as keys properly) ---SKIPIF-- - ---FILE-- - -
-Content Configuration File -
- - - - - - - - - -10 - - -4 - - - - - - -desc - - - - - - - - - - - - - - -WDX; - -var_dump(wddx_deserialize($wddx)); -?> ---EXPECT-- -array(1) { - ["content_queries"]=> - array(1) { - ["content_113300831086270200"]=> - array(1) { - [113301888545229100]=> - array(3) { - ["max"]=> - int(10) - ["cache"]=> - int(4) - ["order"]=> - array(1) { - ["content_113300831086270200"]=> - array(1) { - ["CMS_BUILD"]=> - string(4) "desc" - } - } - } - } - } -} diff --git a/ext/wddx/tests/bug37569.phpt b/ext/wddx/tests/bug37569.phpt deleted file mode 100755 index 45cd68a80ba0a..0000000000000 --- a/ext/wddx/tests/bug37569.phpt +++ /dev/null @@ -1,784 +0,0 @@ ---TEST-- -Bug #37569 (WDDX incorrectly encodes high-ascii characters) ---SKIPIF-- - ---FILE-- -= 0xc0) { - $v = chr(0xc3) . chr($i - 64); - } elseif ($i >= 0x80) { - $v = chr(0xc2) . chr($i); - } else { - $v = chr($i); // make it UTF-8 - } - $ret = wddx_serialize_value($v); - echo $ret . "\n"; - var_dump(bin2hex($v), bin2hex(wddx_deserialize($ret)), $v == wddx_deserialize($ret)); -} -?> ---EXPECT-- -
A -string(2) "41" -string(2) "41" -bool(true) -
B -string(2) "42" -string(2) "42" -bool(true) -
C -string(2) "43" -string(2) "43" -bool(true) -
D -string(2) "44" -string(2) "44" -bool(true) -
E -string(2) "45" -string(2) "45" -bool(true) -
F -string(2) "46" -string(2) "46" -bool(true) -
G -string(2) "47" -string(2) "47" -bool(true) -
H -string(2) "48" -string(2) "48" -bool(true) -
I -string(2) "49" -string(2) "49" -bool(true) -
J -string(2) "4a" -string(2) "4a" -bool(true) -
K -string(2) "4b" -string(2) "4b" -bool(true) -
L -string(2) "4c" -string(2) "4c" -bool(true) -
M -string(2) "4d" -string(2) "4d" -bool(true) -
N -string(2) "4e" -string(2) "4e" -bool(true) -
O -string(2) "4f" -string(2) "4f" -bool(true) -
P -string(2) "50" -string(2) "50" -bool(true) -
Q -string(2) "51" -string(2) "51" -bool(true) -
R -string(2) "52" -string(2) "52" -bool(true) -
S -string(2) "53" -string(2) "53" -bool(true) -
T -string(2) "54" -string(2) "54" -bool(true) -
U -string(2) "55" -string(2) "55" -bool(true) -
V -string(2) "56" -string(2) "56" -bool(true) -
W -string(2) "57" -string(2) "57" -bool(true) -
X -string(2) "58" -string(2) "58" -bool(true) -
Y -string(2) "59" -string(2) "59" -bool(true) -
Z -string(2) "5a" -string(2) "5a" -bool(true) -
[ -string(2) "5b" -string(2) "5b" -bool(true) -
\ -string(2) "5c" -string(2) "5c" -bool(true) -
] -string(2) "5d" -string(2) "5d" -bool(true) -
^ -string(2) "5e" -string(2) "5e" -bool(true) -
_ -string(2) "5f" -string(2) "5f" -bool(true) -
` -string(2) "60" -string(2) "60" -bool(true) -
a -string(2) "61" -string(2) "61" -bool(true) -
b -string(2) "62" -string(2) "62" -bool(true) -
c -string(2) "63" -string(2) "63" -bool(true) -
d -string(2) "64" -string(2) "64" -bool(true) -
e -string(2) "65" -string(2) "65" -bool(true) -
f -string(2) "66" -string(2) "66" -bool(true) -
g -string(2) "67" -string(2) "67" -bool(true) -
h -string(2) "68" -string(2) "68" -bool(true) -
i -string(2) "69" -string(2) "69" -bool(true) -
j -string(2) "6a" -string(2) "6a" -bool(true) -
k -string(2) "6b" -string(2) "6b" -bool(true) -
l -string(2) "6c" -string(2) "6c" -bool(true) -
m -string(2) "6d" -string(2) "6d" -bool(true) -
n -string(2) "6e" -string(2) "6e" -bool(true) -
o -string(2) "6f" -string(2) "6f" -bool(true) -
p -string(2) "70" -string(2) "70" -bool(true) -
q -string(2) "71" -string(2) "71" -bool(true) -
r -string(2) "72" -string(2) "72" -bool(true) -
s -string(2) "73" -string(2) "73" -bool(true) -
t -string(2) "74" -string(2) "74" -bool(true) -
u -string(2) "75" -string(2) "75" -bool(true) -
v -string(2) "76" -string(2) "76" -bool(true) -
w -string(2) "77" -string(2) "77" -bool(true) -
x -string(2) "78" -string(2) "78" -bool(true) -
y -string(2) "79" -string(2) "79" -bool(true) -
z -string(2) "7a" -string(2) "7a" -bool(true) -
{ -string(2) "7b" -string(2) "7b" -bool(true) -
| -string(2) "7c" -string(2) "7c" -bool(true) -
} -string(2) "7d" -string(2) "7d" -bool(true) -
~ -string(2) "7e" -string(2) "7e" -bool(true) -
 -string(2) "7f" -string(2) "7f" -bool(true) -
€ -string(4) "c280" -string(4) "c280" -bool(true) -
 -string(4) "c281" -string(4) "c281" -bool(true) -
‚ -string(4) "c282" -string(4) "c282" -bool(true) -
ƒ -string(4) "c283" -string(4) "c283" -bool(true) -
„ -string(4) "c284" -string(4) "c284" -bool(true) -
Â… -string(4) "c285" -string(4) "c285" -bool(true) -
† -string(4) "c286" -string(4) "c286" -bool(true) -
‡ -string(4) "c287" -string(4) "c287" -bool(true) -
ˆ -string(4) "c288" -string(4) "c288" -bool(true) -
‰ -string(4) "c289" -string(4) "c289" -bool(true) -
Š -string(4) "c28a" -string(4) "c28a" -bool(true) -
‹ -string(4) "c28b" -string(4) "c28b" -bool(true) -
Π-string(4) "c28c" -string(4) "c28c" -bool(true) -
 -string(4) "c28d" -string(4) "c28d" -bool(true) -
ÂŽ -string(4) "c28e" -string(4) "c28e" -bool(true) -
 -string(4) "c28f" -string(4) "c28f" -bool(true) -
 -string(4) "c290" -string(4) "c290" -bool(true) -
‘ -string(4) "c291" -string(4) "c291" -bool(true) -
Â’ -string(4) "c292" -string(4) "c292" -bool(true) -
“ -string(4) "c293" -string(4) "c293" -bool(true) -
” -string(4) "c294" -string(4) "c294" -bool(true) -
• -string(4) "c295" -string(4) "c295" -bool(true) -
– -string(4) "c296" -string(4) "c296" -bool(true) -
— -string(4) "c297" -string(4) "c297" -bool(true) -
˜ -string(4) "c298" -string(4) "c298" -bool(true) -
™ -string(4) "c299" -string(4) "c299" -bool(true) -
š -string(4) "c29a" -string(4) "c29a" -bool(true) -
› -string(4) "c29b" -string(4) "c29b" -bool(true) -
œ -string(4) "c29c" -string(4) "c29c" -bool(true) -
 -string(4) "c29d" -string(4) "c29d" -bool(true) -
ž -string(4) "c29e" -string(4) "c29e" -bool(true) -
Ÿ -string(4) "c29f" -string(4) "c29f" -bool(true) -
  -string(4) "c2a0" -string(4) "c2a0" -bool(true) -
¡ -string(4) "c2a1" -string(4) "c2a1" -bool(true) -
¢ -string(4) "c2a2" -string(4) "c2a2" -bool(true) -
£ -string(4) "c2a3" -string(4) "c2a3" -bool(true) -
¤ -string(4) "c2a4" -string(4) "c2a4" -bool(true) -
Â¥ -string(4) "c2a5" -string(4) "c2a5" -bool(true) -
¦ -string(4) "c2a6" -string(4) "c2a6" -bool(true) -
§ -string(4) "c2a7" -string(4) "c2a7" -bool(true) -
¨ -string(4) "c2a8" -string(4) "c2a8" -bool(true) -
© -string(4) "c2a9" -string(4) "c2a9" -bool(true) -
ª -string(4) "c2aa" -string(4) "c2aa" -bool(true) -
« -string(4) "c2ab" -string(4) "c2ab" -bool(true) -
¬ -string(4) "c2ac" -string(4) "c2ac" -bool(true) -
­ -string(4) "c2ad" -string(4) "c2ad" -bool(true) -
® -string(4) "c2ae" -string(4) "c2ae" -bool(true) -
¯ -string(4) "c2af" -string(4) "c2af" -bool(true) -
° -string(4) "c2b0" -string(4) "c2b0" -bool(true) -
± -string(4) "c2b1" -string(4) "c2b1" -bool(true) -
² -string(4) "c2b2" -string(4) "c2b2" -bool(true) -
³ -string(4) "c2b3" -string(4) "c2b3" -bool(true) -
´ -string(4) "c2b4" -string(4) "c2b4" -bool(true) -
µ -string(4) "c2b5" -string(4) "c2b5" -bool(true) -
¶ -string(4) "c2b6" -string(4) "c2b6" -bool(true) -
· -string(4) "c2b7" -string(4) "c2b7" -bool(true) -
¸ -string(4) "c2b8" -string(4) "c2b8" -bool(true) -
¹ -string(4) "c2b9" -string(4) "c2b9" -bool(true) -
º -string(4) "c2ba" -string(4) "c2ba" -bool(true) -
» -string(4) "c2bb" -string(4) "c2bb" -bool(true) -
¼ -string(4) "c2bc" -string(4) "c2bc" -bool(true) -
½ -string(4) "c2bd" -string(4) "c2bd" -bool(true) -
¾ -string(4) "c2be" -string(4) "c2be" -bool(true) -
¿ -string(4) "c2bf" -string(4) "c2bf" -bool(true) -
À -string(4) "c380" -string(4) "c380" -bool(true) -
à -string(4) "c381" -string(4) "c381" -bool(true) -
 -string(4) "c382" -string(4) "c382" -bool(true) -
à -string(4) "c383" -string(4) "c383" -bool(true) -
Ä -string(4) "c384" -string(4) "c384" -bool(true) -
Ã… -string(4) "c385" -string(4) "c385" -bool(true) -
Æ -string(4) "c386" -string(4) "c386" -bool(true) -
Ç -string(4) "c387" -string(4) "c387" -bool(true) -
È -string(4) "c388" -string(4) "c388" -bool(true) -
É -string(4) "c389" -string(4) "c389" -bool(true) -
Ê -string(4) "c38a" -string(4) "c38a" -bool(true) -
Ë -string(4) "c38b" -string(4) "c38b" -bool(true) -
Ì -string(4) "c38c" -string(4) "c38c" -bool(true) -
à -string(4) "c38d" -string(4) "c38d" -bool(true) -
ÃŽ -string(4) "c38e" -string(4) "c38e" -bool(true) -
à -string(4) "c38f" -string(4) "c38f" -bool(true) -
à -string(4) "c390" -string(4) "c390" -bool(true) -
Ñ -string(4) "c391" -string(4) "c391" -bool(true) -
Ã’ -string(4) "c392" -string(4) "c392" -bool(true) -
Ó -string(4) "c393" -string(4) "c393" -bool(true) -
Ô -string(4) "c394" -string(4) "c394" -bool(true) -
Õ -string(4) "c395" -string(4) "c395" -bool(true) -
Ö -string(4) "c396" -string(4) "c396" -bool(true) -
× -string(4) "c397" -string(4) "c397" -bool(true) -
Ø -string(4) "c398" -string(4) "c398" -bool(true) -
Ù -string(4) "c399" -string(4) "c399" -bool(true) -
Ú -string(4) "c39a" -string(4) "c39a" -bool(true) -
Û -string(4) "c39b" -string(4) "c39b" -bool(true) -
Ü -string(4) "c39c" -string(4) "c39c" -bool(true) -
à -string(4) "c39d" -string(4) "c39d" -bool(true) -
Þ -string(4) "c39e" -string(4) "c39e" -bool(true) -
ß -string(4) "c39f" -string(4) "c39f" -bool(true) -
à -string(4) "c3a0" -string(4) "c3a0" -bool(true) -
á -string(4) "c3a1" -string(4) "c3a1" -bool(true) -
â -string(4) "c3a2" -string(4) "c3a2" -bool(true) -
ã -string(4) "c3a3" -string(4) "c3a3" -bool(true) -
ä -string(4) "c3a4" -string(4) "c3a4" -bool(true) -
Ã¥ -string(4) "c3a5" -string(4) "c3a5" -bool(true) -
æ -string(4) "c3a6" -string(4) "c3a6" -bool(true) -
ç -string(4) "c3a7" -string(4) "c3a7" -bool(true) -
è -string(4) "c3a8" -string(4) "c3a8" -bool(true) -
é -string(4) "c3a9" -string(4) "c3a9" -bool(true) -
ê -string(4) "c3aa" -string(4) "c3aa" -bool(true) -
ë -string(4) "c3ab" -string(4) "c3ab" -bool(true) -
ì -string(4) "c3ac" -string(4) "c3ac" -bool(true) -
í -string(4) "c3ad" -string(4) "c3ad" -bool(true) -
î -string(4) "c3ae" -string(4) "c3ae" -bool(true) -
ï -string(4) "c3af" -string(4) "c3af" -bool(true) -
ð -string(4) "c3b0" -string(4) "c3b0" -bool(true) -
ñ -string(4) "c3b1" -string(4) "c3b1" -bool(true) -
ò -string(4) "c3b2" -string(4) "c3b2" -bool(true) -
ó -string(4) "c3b3" -string(4) "c3b3" -bool(true) -
ô -string(4) "c3b4" -string(4) "c3b4" -bool(true) -
õ -string(4) "c3b5" -string(4) "c3b5" -bool(true) -
ö -string(4) "c3b6" -string(4) "c3b6" -bool(true) -
÷ -string(4) "c3b7" -string(4) "c3b7" -bool(true) -
ø -string(4) "c3b8" -string(4) "c3b8" -bool(true) -
ù -string(4) "c3b9" -string(4) "c3b9" -bool(true) -
ú -string(4) "c3ba" -string(4) "c3ba" -bool(true) -
û -string(4) "c3bb" -string(4) "c3bb" -bool(true) -
ü -string(4) "c3bc" -string(4) "c3bc" -bool(true) -
ý -string(4) "c3bd" -string(4) "c3bd" -bool(true) -
þ -string(4) "c3be" -string(4) "c3be" -bool(true) -
ÿ -string(4) "c3bf" -string(4) "c3bf" -bool(true) diff --git a/ext/wddx/tests/bug37587.phpt b/ext/wddx/tests/bug37587.phpt deleted file mode 100755 index 7780355b8e4aa..0000000000000 --- a/ext/wddx/tests/bug37587.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #37587 (var without attribute causes segfault) ---SKIPIF-- - ---FILE-- - -
- - - - - Hello World - - - - - -EOF -)); - -?> -===DONE=== ---EXPECT-- -array(1) { - [0]=> - array(1) { - ["test"]=> - string(11) "Hello World" - } -} -===DONE=== diff --git a/ext/wddx/tests/bug41283.phpt b/ext/wddx/tests/bug41283.phpt deleted file mode 100644 index af716d1893f34..0000000000000 --- a/ext/wddx/tests/bug41283.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #41283 (Bug with serializing array key that are doubles or floats) ---SKIPIF-- - ---FILE-- - array('1.1' => 'One 1','1.2' => 'One 2', '1.0' => 'Three') -); - -var_dump(wddx_deserialize(wddx_serialize_vars('data'))); -?> ---EXPECT-- -array(1) { - ["data"]=> - array(1) { - ["somearray"]=> - array(3) { - ["1.1"]=> - string(5) "One 1" - ["1.2"]=> - string(5) "One 2" - ["1.0"]=> - string(5) "Three" - } - } -} diff --git a/ext/wddx/tests/bug41527.phpt b/ext/wddx/tests/bug41527.phpt deleted file mode 100644 index 447bfc34d1c1b..0000000000000 --- a/ext/wddx/tests/bug41527.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #41527 (WDDX deserialize numeric string array keys) ---SKIPIF-- - ---FILE-- - 'Zero', '+1' => 'Plus sign', ' 1' => 'Space'); - -var_dump(wddx_deserialize(wddx_serialize_vars('data'))); -?> ---EXPECT-- -array(1) { - ["data"]=> - array(3) { - ["01"]=> - string(4) "Zero" - ["+1"]=> - string(9) "Plus sign" - [" 1"]=> - string(5) "Space" - } -} diff --git a/ext/wddx/tests/bug45901.phpt b/ext/wddx/tests/bug45901.phpt deleted file mode 100644 index 4084ccbf202bf..0000000000000 --- a/ext/wddx/tests/bug45901.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #45901 (wddx_serialize_value crash with SimpleXMLElement object) ---SKIPIF-- - ---FILE-- -'); -$xml->addChild('test'); -echo wddx_serialize_value($xml, 'Variables') . "\n"; -echo "DONE"; -?> ---EXPECTF-- -
Variables
SimpleXMLElementSimpleXMLElement
-DONE \ No newline at end of file diff --git a/ext/wddx/tests/wddx.xml b/ext/wddx/tests/wddx.xml deleted file mode 100644 index 00857095c9809..0000000000000 --- a/ext/wddx/tests/wddx.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - -
- - - - - - - a string - - - -12.456 - - - 1998-06-12T04:32:12+00 - - - 1980-06-12T04:32:12+00 - - - 2040-06-12T04:32:12+00 - - - - - - - 10 - second element - - - - YmluYXJ5IGRhdGE= - - - - - a string - - - -12.456 - - - - - - - John Doe - Jane Doe - - - 34 - 31 - - - - - diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c deleted file mode 100644 index 63e47047272d0..0000000000000 --- a/ext/wddx/wddx.c +++ /dev/null @@ -1,1327 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Andrei Zmievski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_WDDX - -#include "ext/xml/expat_compat.h" -#include "php_wddx.h" -#include "php_wddx_api.h" - -#define PHP_XML_INTERNAL -#include "ext/xml/php_xml.h" -#include "ext/standard/php_incomplete_class.h" -#include "ext/standard/base64.h" -#include "ext/standard/info.h" -#include "ext/standard/php_smart_str.h" -#include "ext/standard/html.h" -#include "ext/standard/php_string.h" -#include "ext/date/php_date.h" -#include "zend_globals.h" - -#define WDDX_BUF_LEN 256 -#define PHP_CLASS_NAME_VAR "php_class_name" - -#define EL_ARRAY "array" -#define EL_BINARY "binary" -#define EL_BOOLEAN "boolean" -#define EL_CHAR "char" -#define EL_CHAR_CODE "code" -#define EL_NULL "null" -#define EL_NUMBER "number" -#define EL_PACKET "wddxPacket" -#define EL_STRING "string" -#define EL_STRUCT "struct" -#define EL_VALUE "value" -#define EL_VAR "var" -#define EL_NAME "name" -#define EL_VERSION "version" -#define EL_RECORDSET "recordset" -#define EL_FIELD "field" -#define EL_DATETIME "dateTime" - -#define php_wddx_deserialize(a,b) \ - php_wddx_deserialize_ex((a)->value.str.val, (a)->value.str.len, (b)) - -#define SET_STACK_VARNAME \ - if (stack->varname) { \ - ent.varname = estrdup(stack->varname); \ - efree(stack->varname); \ - stack->varname = NULL; \ - } else \ - ent.varname = NULL; \ - -static int le_wddx; - -typedef struct { - zval *data; - enum { - ST_ARRAY, - ST_BOOLEAN, - ST_NULL, - ST_NUMBER, - ST_STRING, - ST_BINARY, - ST_STRUCT, - ST_RECORDSET, - ST_FIELD, - ST_DATETIME - } type; - char *varname; -} st_entry; - -typedef struct { - int top, max; - char *varname; - zend_bool done; - void **elements; -} wddx_stack; - - -static void php_wddx_process_data(void *user_data, const XML_Char *s, int len); - -/* {{{ wddx_functions[] - */ -zend_function_entry wddx_functions[] = { - PHP_FE(wddx_serialize_value, NULL) - PHP_FE(wddx_serialize_vars, NULL) - PHP_FE(wddx_packet_start, NULL) - PHP_FE(wddx_packet_end, NULL) - PHP_FE(wddx_add_vars, NULL) - PHP_FE(wddx_deserialize, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -PHP_MINIT_FUNCTION(wddx); -PHP_MINFO_FUNCTION(wddx); - -/* {{{ dynamically loadable module stuff */ -#ifdef COMPILE_DL_WDDX -ZEND_GET_MODULE(wddx) -#endif /* COMPILE_DL_WDDX */ -/* }}} */ - -/* {{{ wddx_module_entry - */ -zend_module_entry wddx_module_entry = { - STANDARD_MODULE_HEADER, - "wddx", - wddx_functions, - PHP_MINIT(wddx), - NULL, - NULL, - NULL, - PHP_MINFO(wddx), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ wddx_stack_init - */ -static int wddx_stack_init(wddx_stack *stack) -{ - stack->top = 0; - stack->elements = (void **) safe_emalloc(sizeof(void **), STACK_BLOCK_SIZE, 0); - stack->max = STACK_BLOCK_SIZE; - stack->varname = NULL; - stack->done = 0; - - return SUCCESS; -} -/* }}} */ - -/* {{{ wddx_stack_push - */ -static int wddx_stack_push(wddx_stack *stack, void *element, int size) -{ - if (stack->top >= stack->max) { /* we need to allocate more memory */ - stack->elements = (void **) erealloc(stack->elements, - (sizeof(void **) * (stack->max += STACK_BLOCK_SIZE))); - } - stack->elements[stack->top] = (void *) emalloc(size); - memcpy(stack->elements[stack->top], element, size); - return stack->top++; -} -/* }}} */ - -/* {{{ wddx_stack_top - */ -static int wddx_stack_top(wddx_stack *stack, void **element) -{ - if (stack->top > 0) { - *element = stack->elements[stack->top - 1]; - return SUCCESS; - } else { - *element = NULL; - return FAILURE; - } -} -/* }}} */ - -/* {{{ wddx_stack_is_empty - */ -static int wddx_stack_is_empty(wddx_stack *stack) -{ - if (stack->top == 0) { - return 1; - } else { - return 0; - } -} -/* }}} */ - -/* {{{ wddx_stack_destroy - */ -static int wddx_stack_destroy(wddx_stack *stack) -{ - register int i; - - if (stack->elements) { - for (i = 0; i < stack->top; i++) { - if (((st_entry *)stack->elements[i])->data) - { - zval_ptr_dtor(&((st_entry *)stack->elements[i])->data); - } - if (((st_entry *)stack->elements[i])->varname) - efree(((st_entry *)stack->elements[i])->varname); - efree(stack->elements[i]); - } - efree(stack->elements); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ release_wddx_packet_rsrc - */ -static void release_wddx_packet_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - smart_str *str = (smart_str *)rsrc->ptr; - smart_str_free(str); - efree(str); -} -/* }}} */ - -#include "ext/session/php_session.h" - -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) -/* {{{ PS_SERIALIZER_ENCODE_FUNC - */ -PS_SERIALIZER_ENCODE_FUNC(wddx) -{ - wddx_packet *packet; - PS_ENCODE_VARS; - - packet = php_wddx_constructor(); - - php_wddx_packet_start(packet, NULL, 0); - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - - PS_ENCODE_LOOP( - php_wddx_serialize_var(packet, *struc, key, key_length TSRMLS_CC); - ); - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - php_wddx_packet_end(packet); - *newstr = php_wddx_gather(packet); - php_wddx_destructor(packet); - - if (newlen) - *newlen = strlen(*newstr); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PS_SERIALIZER_DECODE_FUNC - */ -PS_SERIALIZER_DECODE_FUNC(wddx) -{ - zval *retval; - zval **ent; - char *key; - uint key_length; - char tmp[128]; - ulong idx; - int hash_type; - int ret; - - if (vallen == 0) - return SUCCESS; - - MAKE_STD_ZVAL(retval); - - if ((ret = php_wddx_deserialize_ex((char *)val, vallen, retval)) == SUCCESS) { - - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(retval)); - zend_hash_get_current_data(Z_ARRVAL_P(retval), (void **) &ent) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(retval))) { - hash_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(retval), &key, &key_length, &idx, 0, NULL); - - switch (hash_type) { - case HASH_KEY_IS_LONG: - key_length = slprintf(tmp, sizeof(tmp), "%ld", idx) + 1; - key = tmp; - /* fallthru */ - case HASH_KEY_IS_STRING: - php_set_session_var(key, key_length-1, *ent, NULL TSRMLS_CC); - PS_ADD_VAR(key); - } - } - } - - zval_ptr_dtor(&retval); - - return ret; -} -/* }}} */ -#endif - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(wddx) -{ - le_wddx = zend_register_list_destructors_ex(release_wddx_packet_rsrc, NULL, "wddx", module_number); - -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - php_session_register_serializer("wddx", - PS_SERIALIZER_ENCODE_NAME(wddx), - PS_SERIALIZER_DECODE_NAME(wddx)); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(wddx) -{ - php_info_print_table_start(); -#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) - php_info_print_table_header(2, "WDDX Support", "enabled" ); - php_info_print_table_row(2, "WDDX Session Serializer", "enabled" ); -#else - php_info_print_table_row(2, "WDDX Support", "enabled" ); -#endif - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ php_wddx_packet_start - */ -void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len) -{ - php_wddx_add_chunk_static(packet, WDDX_PACKET_S); - if (comment) { - php_wddx_add_chunk_static(packet, WDDX_HEADER_S); - php_wddx_add_chunk_static(packet, WDDX_COMMENT_S); - php_wddx_add_chunk_ex(packet, comment, comment_len); - php_wddx_add_chunk_static(packet, WDDX_COMMENT_E); - php_wddx_add_chunk_static(packet, WDDX_HEADER_E); - } else - php_wddx_add_chunk_static(packet, WDDX_HEADER); - php_wddx_add_chunk_static(packet, WDDX_DATA_S); -} -/* }}} */ - -/* {{{ php_wddx_packet_end - */ -void php_wddx_packet_end(wddx_packet *packet) -{ - php_wddx_add_chunk_static(packet, WDDX_DATA_E); - php_wddx_add_chunk_static(packet, WDDX_PACKET_E); -} -/* }}} */ - -#define FLUSH_BUF() \ - if (l > 0) { \ - php_wddx_add_chunk_ex(packet, buf, l); \ - l = 0; \ - } - -/* {{{ php_wddx_serialize_string - */ -static void php_wddx_serialize_string(wddx_packet *packet, zval *var TSRMLS_DC) -{ - php_wddx_add_chunk_static(packet, WDDX_STRING_S); - - if (Z_STRLEN_P(var) > 0) { - char *buf; - int buf_len; - - buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), &buf_len, 0, ENT_QUOTES, NULL TSRMLS_CC); - - php_wddx_add_chunk_ex(packet, buf, buf_len); - - efree(buf); - } - php_wddx_add_chunk_static(packet, WDDX_STRING_E); -} -/* }}} */ - -/* {{{ php_wddx_serialize_number - */ -static void php_wddx_serialize_number(wddx_packet *packet, zval *var) -{ - char tmp_buf[WDDX_BUF_LEN]; - zval tmp; - - tmp = *var; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - snprintf(tmp_buf, sizeof(tmp_buf), WDDX_NUMBER, Z_STRVAL(tmp)); - zval_dtor(&tmp); - - php_wddx_add_chunk(packet, tmp_buf); -} -/* }}} */ - -/* {{{ php_wddx_serialize_boolean - */ -static void php_wddx_serialize_boolean(wddx_packet *packet, zval *var) -{ - char tmp_buf[WDDX_BUF_LEN]; - - snprintf(tmp_buf, sizeof(tmp_buf), WDDX_BOOLEAN, Z_LVAL_P(var) ? "true" : "false"); - php_wddx_add_chunk(packet, tmp_buf); -} -/* }}} */ - -/* {{{ php_wddx_serialize_unset - */ -static void php_wddx_serialize_unset(wddx_packet *packet) -{ - php_wddx_add_chunk_static(packet, WDDX_NULL); -} -/* }}} */ - -/* {{{ php_wddx_serialize_object - */ -static void php_wddx_serialize_object(wddx_packet *packet, zval *obj) -{ -/* OBJECTS_FIXME */ - zval **ent, *fname, **varname; - zval *retval = NULL; - char *key; - ulong idx; - char tmp_buf[WDDX_BUF_LEN]; - HashTable *objhash, *sleephash; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(fname); - ZVAL_STRING(fname, "__sleep", 1); - - /* - * We try to call __sleep() method on object. It's supposed to return an - * array of property names to be serialized. - */ - if (call_user_function_ex(CG(function_table), &obj, fname, &retval, 0, 0, 1, NULL TSRMLS_CC) == SUCCESS) { - if (retval && (sleephash = HASH_OF(retval))) { - PHP_CLASS_ATTRIBUTES; - - PHP_SET_CLASS_ATTRIBUTES(obj); - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - snprintf(tmp_buf, WDDX_BUF_LEN, WDDX_VAR_S, PHP_CLASS_NAME_VAR); - php_wddx_add_chunk(packet, tmp_buf); - php_wddx_add_chunk_static(packet, WDDX_STRING_S); - php_wddx_add_chunk_ex(packet, class_name, name_len); - php_wddx_add_chunk_static(packet, WDDX_STRING_E); - php_wddx_add_chunk_static(packet, WDDX_VAR_E); - - PHP_CLEANUP_CLASS_ATTRIBUTES(); - - objhash = HASH_OF(obj); - - for (zend_hash_internal_pointer_reset(sleephash); - zend_hash_get_current_data(sleephash, (void **)&varname) == SUCCESS; - zend_hash_move_forward(sleephash)) { - if (Z_TYPE_PP(varname) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize."); - continue; - } - - if (zend_hash_find(objhash, Z_STRVAL_PP(varname), Z_STRLEN_PP(varname)+1, (void **)&ent) == SUCCESS) { - php_wddx_serialize_var(packet, *ent, Z_STRVAL_PP(varname), Z_STRLEN_PP(varname) TSRMLS_CC); - } - } - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - } - } else { - uint key_len; - - PHP_CLASS_ATTRIBUTES; - - PHP_SET_CLASS_ATTRIBUTES(obj); - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - snprintf(tmp_buf, WDDX_BUF_LEN, WDDX_VAR_S, PHP_CLASS_NAME_VAR); - php_wddx_add_chunk(packet, tmp_buf); - php_wddx_add_chunk_static(packet, WDDX_STRING_S); - php_wddx_add_chunk_ex(packet, class_name, name_len); - php_wddx_add_chunk_static(packet, WDDX_STRING_E); - php_wddx_add_chunk_static(packet, WDDX_VAR_E); - - PHP_CLEANUP_CLASS_ATTRIBUTES(); - - objhash = HASH_OF(obj); - for (zend_hash_internal_pointer_reset(objhash); - zend_hash_get_current_data(objhash, (void**)&ent) == SUCCESS; - zend_hash_move_forward(objhash)) { - if (*ent == obj) { - continue; - } - - if (zend_hash_get_current_key_ex(objhash, &key, &key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) { - char *class_name, *prop_name; - - zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name); - php_wddx_serialize_var(packet, *ent, prop_name, strlen(prop_name)+1 TSRMLS_CC); - } else { - key_len = slprintf(tmp_buf, sizeof(tmp_buf), "%ld", idx); - php_wddx_serialize_var(packet, *ent, tmp_buf, key_len TSRMLS_CC); - } - } - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - } - - zval_dtor(fname); - FREE_ZVAL(fname); - - if (retval) { - zval_ptr_dtor(&retval); - } -} -/* }}} */ - -/* {{{ php_wddx_serialize_array - */ -static void php_wddx_serialize_array(wddx_packet *packet, zval *arr) -{ - zval **ent; - char *key; - uint key_len; - int is_struct = 0, ent_type; - ulong idx; - HashTable *target_hash; - char tmp_buf[WDDX_BUF_LEN]; - ulong ind = 0; - int type; - TSRMLS_FETCH(); - - target_hash = HASH_OF(arr); - - for (zend_hash_internal_pointer_reset(target_hash); - zend_hash_get_current_data(target_hash, (void**)&ent) == SUCCESS; - zend_hash_move_forward(target_hash)) { - - type = zend_hash_get_current_key(target_hash, &key, &idx, 0); - - if (type == HASH_KEY_IS_STRING) { - is_struct = 1; - break; - } - - if (idx != ind) { - is_struct = 1; - break; - } - - ind++; - } - - if (is_struct) { - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - } else { - snprintf(tmp_buf, sizeof(tmp_buf), WDDX_ARRAY_S, zend_hash_num_elements(target_hash)); - php_wddx_add_chunk(packet, tmp_buf); - } - - for (zend_hash_internal_pointer_reset(target_hash); - zend_hash_get_current_data(target_hash, (void**)&ent) == SUCCESS; - zend_hash_move_forward(target_hash)) { - if (*ent == arr) - continue; - - if (is_struct) { - ent_type = zend_hash_get_current_key_ex(target_hash, &key, &key_len, &idx, 0, NULL); - - if (ent_type == HASH_KEY_IS_STRING) { - php_wddx_serialize_var(packet, *ent, key, key_len TSRMLS_CC); - } else { - key_len = slprintf(tmp_buf, sizeof(tmp_buf), "%ld", idx); - php_wddx_serialize_var(packet, *ent, tmp_buf, key_len TSRMLS_CC); - } - } else - php_wddx_serialize_var(packet, *ent, NULL, 0 TSRMLS_CC); - } - - if (is_struct) { - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - } else { - php_wddx_add_chunk_static(packet, WDDX_ARRAY_E); - } -} -/* }}} */ - -/* {{{ php_wddx_serialize_var - */ -void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC) -{ - char *tmp_buf; - char *name_esc; - int name_esc_len; - HashTable *ht; - - if (name) { - name_esc = php_escape_html_entities(name, name_len, &name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC); - tmp_buf = emalloc(name_esc_len + sizeof(WDDX_VAR_S)); - snprintf(tmp_buf, name_esc_len + sizeof(WDDX_VAR_S), WDDX_VAR_S, name_esc); - php_wddx_add_chunk(packet, tmp_buf); - efree(tmp_buf); - efree(name_esc); - } - - switch(Z_TYPE_P(var)) { - case IS_STRING: - php_wddx_serialize_string(packet, var TSRMLS_CC); - break; - - case IS_LONG: - case IS_DOUBLE: - php_wddx_serialize_number(packet, var); - break; - - case IS_BOOL: - php_wddx_serialize_boolean(packet, var); - break; - - case IS_NULL: - php_wddx_serialize_unset(packet); - break; - - case IS_ARRAY: - ht = Z_ARRVAL_P(var); - if (ht->nApplyCount > 1) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references"); - return; - } - ht->nApplyCount++; - php_wddx_serialize_array(packet, var); - ht->nApplyCount--; - break; - - case IS_OBJECT: - ht = Z_OBJPROP_P(var); - if (ht->nApplyCount > 1) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references"); - return; - } - ht->nApplyCount++; - php_wddx_serialize_object(packet, var); - ht->nApplyCount--; - break; - } - - if (name) { - php_wddx_add_chunk_static(packet, WDDX_VAR_E); - } -} -/* }}} */ - -/* {{{ php_wddx_add_var - */ -static void php_wddx_add_var(wddx_packet *packet, zval *name_var) -{ - zval **val; - HashTable *target_hash; - TSRMLS_FETCH(); - - if (Z_TYPE_P(name_var) == IS_STRING) - { - if (zend_hash_find(EG(active_symbol_table), Z_STRVAL_P(name_var), - Z_STRLEN_P(name_var)+1, (void**)&val) != FAILURE) { - php_wddx_serialize_var(packet, *val, Z_STRVAL_P(name_var), Z_STRLEN_P(name_var) TSRMLS_CC); - } - } - else if (Z_TYPE_P(name_var) == IS_ARRAY || Z_TYPE_P(name_var) == IS_OBJECT) - { - target_hash = HASH_OF(name_var); - - zend_hash_internal_pointer_reset(target_hash); - - while(zend_hash_get_current_data(target_hash, (void**)&val) == SUCCESS) { - php_wddx_add_var(packet, *val); - - zend_hash_move_forward(target_hash); - } - } -} -/* }}} */ - -/* {{{ php_wddx_push_element - */ -static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts) -{ - st_entry ent; - wddx_stack *stack = (wddx_stack *)user_data; - - if (!strcmp(name, EL_PACKET)) { - int i; - - if (atts) for (i=0; atts[i]; i++) { - if (!strcmp(atts[i], EL_VERSION)) { - /* nothing for now */ - } - } - } else if (!strcmp(name, EL_STRING)) { - ent.type = ST_STRING; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_STRING; - Z_STRVAL_P(ent.data) = STR_EMPTY_ALLOC(); - Z_STRLEN_P(ent.data) = 0; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_BINARY)) { - ent.type = ST_BINARY; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_STRING; - Z_STRVAL_P(ent.data) = STR_EMPTY_ALLOC(); - Z_STRLEN_P(ent.data) = 0; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_CHAR)) { - int i; - - if (atts) for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], EL_CHAR_CODE) && atts[++i] && atts[i][0]) { - char tmp_buf[2]; - - snprintf(tmp_buf, sizeof(tmp_buf), "%c", (char)strtol(atts[i], NULL, 16)); - php_wddx_process_data(user_data, tmp_buf, strlen(tmp_buf)); - break; - } - } - } else if (!strcmp(name, EL_NUMBER)) { - ent.type = ST_NUMBER; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_LONG; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_BOOLEAN)) { - int i; - - if (atts) for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], EL_VALUE) && atts[++i] && atts[i][0]) { - ent.type = ST_BOOLEAN; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_BOOL; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - php_wddx_process_data(user_data, atts[i], strlen(atts[i])); - break; - } - } - } else if (!strcmp(name, EL_NULL)) { - ent.type = ST_NULL; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - ZVAL_NULL(ent.data); - - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_ARRAY)) { - ent.type = ST_ARRAY; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - array_init(ent.data); - INIT_PZVAL(ent.data); - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_STRUCT)) { - ent.type = ST_STRUCT; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - array_init(ent.data); - INIT_PZVAL(ent.data); - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_VAR)) { - int i; - - if (atts) for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], EL_NAME) && atts[++i] && atts[i][0]) { - stack->varname = estrdup(atts[i]); - break; - } - } - } else if (!strcmp(name, EL_RECORDSET)) { - int i; - - ent.type = ST_RECORDSET; - SET_STACK_VARNAME; - MAKE_STD_ZVAL(ent.data); - array_init(ent.data); - - if (atts) for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], "fieldNames") && atts[++i] && atts[i][0]) { - zval *tmp; - char *key; - char *p1, *p2, *endp; - - endp = (char *)atts[i] + strlen(atts[i]); - p1 = (char *)atts[i]; - while ((p2 = php_memnstr(p1, ",", sizeof(",")-1, endp)) != NULL) { - key = estrndup(p1, p2 - p1); - MAKE_STD_ZVAL(tmp); - array_init(tmp); - add_assoc_zval_ex(ent.data, key, p2 - p1 + 1, tmp); - p1 = p2 + sizeof(",")-1; - efree(key); - } - - if (p1 <= endp) { - MAKE_STD_ZVAL(tmp); - array_init(tmp); - add_assoc_zval_ex(ent.data, p1, endp - p1 + 1, tmp); - } - - break; - } - } - - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_FIELD)) { - int i; - st_entry ent; - - ent.type = ST_FIELD; - ent.varname = NULL; - ent.data = NULL; - - if (atts) for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], EL_NAME) && atts[++i] && atts[i][0]) { - st_entry *recordset; - zval **field; - - if (wddx_stack_top(stack, (void**)&recordset) == SUCCESS && - recordset->type == ST_RECORDSET && - zend_hash_find(Z_ARRVAL_P(recordset->data), (char*)atts[i], strlen(atts[i])+1, (void**)&field) == SUCCESS) { - ent.data = *field; - } - - break; - } - } - - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } else if (!strcmp(name, EL_DATETIME)) { - ent.type = ST_DATETIME; - SET_STACK_VARNAME; - - ALLOC_ZVAL(ent.data); - INIT_PZVAL(ent.data); - Z_TYPE_P(ent.data) = IS_LONG; - wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); - } -} -/* }}} */ - -/* {{{ php_wddx_pop_element - */ -static void php_wddx_pop_element(void *user_data, const XML_Char *name) -{ - st_entry *ent1, *ent2; - wddx_stack *stack = (wddx_stack *)user_data; - HashTable *target_hash; - zend_class_entry **pce; - zval *obj; - zval *tmp; - TSRMLS_FETCH(); - -/* OBJECTS_FIXME */ - if (stack->top == 0) - return; - - if (!strcmp(name, EL_STRING) || !strcmp(name, EL_NUMBER) || - !strcmp(name, EL_BOOLEAN) || !strcmp(name, EL_NULL) || - !strcmp(name, EL_ARRAY) || !strcmp(name, EL_STRUCT) || - !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY) || - !strcmp(name, EL_DATETIME)) { - wddx_stack_top(stack, (void**)&ent1); - - if (!strcmp(name, EL_BINARY)) { - int new_len=0; - unsigned char *new_str; - - new_str = php_base64_decode(Z_STRVAL_P(ent1->data), Z_STRLEN_P(ent1->data), &new_len); - STR_FREE(Z_STRVAL_P(ent1->data)); - Z_STRVAL_P(ent1->data) = new_str; - Z_STRLEN_P(ent1->data) = new_len; - } - - /* Call __wakeup() method on the object. */ - if (Z_TYPE_P(ent1->data) == IS_OBJECT) { - zval *fname, *retval = NULL; - - MAKE_STD_ZVAL(fname); - ZVAL_STRING(fname, "__wakeup", 1); - - call_user_function_ex(NULL, &ent1->data, fname, &retval, 0, 0, 0, NULL TSRMLS_CC); - - zval_dtor(fname); - FREE_ZVAL(fname); - if (retval) - zval_ptr_dtor(&retval); - } - - if (stack->top > 1) { - stack->top--; - wddx_stack_top(stack, (void**)&ent2); - - /* if non-existent field */ - if (ent2->type == ST_FIELD && ent2->data == NULL) { - zval_ptr_dtor(&ent1->data); - efree(ent1); - return; - } - - if (Z_TYPE_P(ent2->data) == IS_ARRAY || Z_TYPE_P(ent2->data) == IS_OBJECT) { - target_hash = HASH_OF(ent2->data); - - if (ent1->varname) { - if (!strcmp(ent1->varname, PHP_CLASS_NAME_VAR) && - Z_TYPE_P(ent1->data) == IS_STRING && Z_STRLEN_P(ent1->data)) { - zend_bool incomplete_class = 0; - - zend_str_tolower(Z_STRVAL_P(ent1->data), Z_STRLEN_P(ent1->data)); - if (zend_hash_find(EG(class_table), Z_STRVAL_P(ent1->data), - Z_STRLEN_P(ent1->data)+1, (void **) &pce)==FAILURE) { - incomplete_class = 1; - pce = &PHP_IC_ENTRY; - } - - /* Initialize target object */ - MAKE_STD_ZVAL(obj); - object_init_ex(obj, *pce); - - /* Merge current hashtable with object's default properties */ - zend_hash_merge(Z_OBJPROP_P(obj), - Z_ARRVAL_P(ent2->data), - (void (*)(void *)) zval_add_ref, - (void *) &tmp, sizeof(zval *), 0); - - if (incomplete_class) { - php_store_class_name(obj, Z_STRVAL_P(ent1->data), Z_STRLEN_P(ent1->data)); - } - - /* Clean up old array entry */ - zval_ptr_dtor(&ent2->data); - - /* Set stack entry to point to the newly created object */ - ent2->data = obj; - - /* Clean up class name var entry */ - zval_ptr_dtor(&ent1->data); - } else if (Z_TYPE_P(ent2->data) == IS_OBJECT) { - zend_class_entry *old_scope = EG(scope); - - EG(scope) = Z_OBJCE_P(ent2->data); - ent1->data->refcount--; - add_property_zval(ent2->data, ent1->varname, ent1->data); - EG(scope) = old_scope; - } else { - zend_symtable_update(target_hash, ent1->varname, strlen(ent1->varname)+1, &ent1->data, sizeof(zval *), NULL); - } - efree(ent1->varname); - } else { - zend_hash_next_index_insert(target_hash, - &ent1->data, - sizeof(zval *), NULL); - } - } - efree(ent1); - } else - stack->done = 1; - } else if (!strcmp(name, EL_VAR) && stack->varname) { - efree(stack->varname); - } else if (!strcmp(name, EL_FIELD)) { - st_entry *ent; - wddx_stack_top(stack, (void **)&ent); - efree(ent); - stack->top--; - } -} -/* }}} */ - -/* {{{ php_wddx_process_data - */ -static void php_wddx_process_data(void *user_data, const XML_Char *s, int len) -{ - st_entry *ent; - wddx_stack *stack = (wddx_stack *)user_data; - TSRMLS_FETCH(); - - if (!wddx_stack_is_empty(stack) && !stack->done) { - wddx_stack_top(stack, (void**)&ent); - switch (Z_TYPE_P(ent)) { - case ST_STRING: - if (Z_STRLEN_P(ent->data) == 0) { - STR_FREE(Z_STRVAL_P(ent->data)); - Z_STRVAL_P(ent->data) = estrndup(s, len); - Z_STRLEN_P(ent->data) = len; - } else { - Z_STRVAL_P(ent->data) = erealloc(Z_STRVAL_P(ent->data), Z_STRLEN_P(ent->data) + len + 1); - memcpy(Z_STRVAL_P(ent->data) + Z_STRLEN_P(ent->data), s, len); - Z_STRLEN_P(ent->data) += len; - Z_STRVAL_P(ent->data)[Z_STRLEN_P(ent->data)] = '\0'; - } - break; - - case ST_BINARY: - if (Z_STRLEN_P(ent->data) == 0) { - STR_FREE(Z_STRVAL_P(ent->data)); - Z_STRVAL_P(ent->data) = estrndup(s, len + 1); - } else { - Z_STRVAL_P(ent->data) = erealloc(Z_STRVAL_P(ent->data), Z_STRLEN_P(ent->data) + len + 1); - memcpy(Z_STRVAL_P(ent->data) + Z_STRLEN_P(ent->data), s, len); - } - Z_STRLEN_P(ent->data) += len; - Z_STRVAL_P(ent->data)[Z_STRLEN_P(ent->data)] = '\0'; - break; - - case ST_NUMBER: - Z_TYPE_P(ent->data) = IS_STRING; - Z_STRLEN_P(ent->data) = len; - Z_STRVAL_P(ent->data) = estrndup(s, len); - convert_scalar_to_number(ent->data TSRMLS_CC); - break; - - case ST_BOOLEAN: - if (!strcmp(s, "true")) - Z_LVAL_P(ent->data) = 1; - else if (!strcmp(s, "false")) - Z_LVAL_P(ent->data) = 0; - else { - stack->top--; - zval_ptr_dtor(&ent->data); - if (ent->varname) - efree(ent->varname); - efree(ent); - } - break; - - case ST_DATETIME: { - char *tmp; - - tmp = emalloc(len + 1); - memcpy(tmp, s, len); - tmp[len] = '\0'; - - Z_LVAL_P(ent->data) = php_parse_date(tmp, NULL); - /* date out of range < 1969 or > 2038 */ - if (Z_LVAL_P(ent->data) == -1) { - Z_TYPE_P(ent->data) = IS_STRING; - Z_STRLEN_P(ent->data) = len; - Z_STRVAL_P(ent->data) = estrndup(s, len); - } - efree(tmp); - } - break; - - default: - break; - } - } -} -/* }}} */ - -/* {{{ php_wddx_deserialize_ex - */ -int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value) -{ - wddx_stack stack; - XML_Parser parser; - st_entry *ent; - int retval; - - wddx_stack_init(&stack); - parser = XML_ParserCreate("UTF-8"); - - XML_SetUserData(parser, &stack); - XML_SetElementHandler(parser, php_wddx_push_element, php_wddx_pop_element); - XML_SetCharacterDataHandler(parser, php_wddx_process_data); - - XML_Parse(parser, value, vallen, 1); - - XML_ParserFree(parser); - - if (stack.top == 1) { - wddx_stack_top(&stack, (void**)&ent); - *return_value = *(ent->data); - zval_copy_ctor(return_value); - retval = SUCCESS; - } else - retval = FAILURE; - - wddx_stack_destroy(&stack); - - return retval; -} -/* }}} */ - -/* {{{ proto string wddx_serialize_value(mixed var [, string comment]) - Creates a new packet and serializes the given value */ -PHP_FUNCTION(wddx_serialize_value) -{ - zval *var; - char *comment = NULL; - int comment_len = 0; - wddx_packet *packet; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", - &var, &comment, &comment_len) == FAILURE) - return; - - packet = php_wddx_constructor(); - - php_wddx_packet_start(packet, comment, comment_len); - php_wddx_serialize_var(packet, var, NULL, 0 TSRMLS_CC); - php_wddx_packet_end(packet); - - ZVAL_STRINGL(return_value, packet->c, packet->len, 1); - smart_str_free(packet); - efree(packet); -} -/* }}} */ - -/* {{{ proto string wddx_serialize_vars(mixed var_name [, mixed ...]) - Creates a new packet and serializes given variables into a struct */ -PHP_FUNCTION(wddx_serialize_vars) -{ - int argc, i; - wddx_packet *packet; - zval ***args; - - argc = ZEND_NUM_ARGS(); - if (argc < 1) { - WRONG_PARAM_COUNT; - } - - /* Allocate arguments array and get the arguments, checking for errors. */ - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - packet = php_wddx_constructor(); - - php_wddx_packet_start(packet, NULL, 0); - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - - for (i=0; ic, packet->len, 1); - smart_str_free(packet); - efree(packet); -} -/* }}} */ - -/* {{{ php_wddx_constructor - */ -wddx_packet *php_wddx_constructor(void) -{ - smart_str *packet; - - packet = (smart_str *)emalloc(sizeof(smart_str)); - packet->c = NULL; - - return packet; -} -/* }}} */ - -/* {{{ php_wddx_destructor - */ -void php_wddx_destructor(wddx_packet *packet) -{ - smart_str_free(packet); - efree(packet); -} -/* }}} */ - -/* {{{ proto int wddx_packet_start([string comment]) - Starts a WDDX packet with optional comment and returns the packet id */ -PHP_FUNCTION(wddx_packet_start) -{ - char *comment = NULL; - int comment_len = 0; - wddx_packet *packet; - - comment = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &comment, &comment_len) == FAILURE) - return; - - packet = php_wddx_constructor(); - - php_wddx_packet_start(packet, comment, comment_len); - php_wddx_add_chunk_static(packet, WDDX_STRUCT_S); - - ZEND_REGISTER_RESOURCE(return_value, packet, le_wddx); -} -/* }}} */ - -/* {{{ proto string wddx_packet_end(int packet_id) - Ends specified WDDX packet and returns the string containing the packet */ -PHP_FUNCTION(wddx_packet_end) -{ - zval *packet_id; - wddx_packet *packet = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &packet_id) == FAILURE) - return; - - ZEND_FETCH_RESOURCE(packet, wddx_packet *, &packet_id, -1, "WDDX packet ID", le_wddx); - - php_wddx_add_chunk_static(packet, WDDX_STRUCT_E); - - php_wddx_packet_end(packet); - - ZVAL_STRINGL(return_value, packet->c, packet->len, 1); - - zend_list_delete(Z_LVAL_P(packet_id)); -} -/* }}} */ - -/* {{{ proto int wddx_add_vars(int packet_id, mixed var_names [, mixed ...]) - Serializes given variables and adds them to packet given by packet_id */ -PHP_FUNCTION(wddx_add_vars) -{ - int argc, i; - zval ***args; - zval **packet_id; - wddx_packet *packet = NULL; - - argc = ZEND_NUM_ARGS(); - if (argc < 2) { - WRONG_PARAM_COUNT; - } - - /* Allocate arguments array and get the arguments, checking for errors. */ - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - - packet_id = args[0]; - - packet = (wddx_packet *)zend_fetch_resource(packet_id TSRMLS_CC, -1, "WDDX packet ID", NULL, 1, le_wddx); - if (!packet) - { - efree(args); - RETURN_FALSE; - } - - for (i=1; i | - +----------------------------------------------------------------------+ - */ - -#include "php.h" -#if defined(HAVE_LIBXML) && (defined(HAVE_XML) || defined(HAVE_XMLRPC)) && !defined(HAVE_LIBEXPAT) -#include "expat_compat.h" - -typedef struct _php_xml_ns { - xmlNsPtr nsptr; - int ref_count; - void *next; - void *prev; -} php_xml_ns; - -#ifdef LIBXML_EXPAT_COMPAT - -#define IS_NS_DECL(__ns) \ - ((__ns) != NULL && strlen(__ns) == 5 && *(__ns) == 'x' && *((__ns)+1) == 'm' && \ - *((__ns)+2) == 'l' && *((__ns)+3) == 'n' && *((__ns)+4) == 's') - -static void -_qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI, xmlChar **qualified) -{ - if (URI) { - /* Use libxml functions otherwise its memory deallocation is screwed up */ - *qualified = xmlStrdup(URI); - *qualified = xmlStrncat(*qualified, parser->_ns_seperator, 1); - *qualified = xmlStrncat(*qualified, name, xmlStrlen(name)); - } else { - *qualified = xmlStrdup(name); - } -} - -static void -_start_element_handler(void *user, const xmlChar *name, const xmlChar **attributes) -{ - XML_Parser parser = (XML_Parser) user; - xmlChar *qualified_name = NULL; - - if (parser->h_start_element == NULL) { - if (parser->h_default) { - int attno = 0; - - qualified_name = xmlStrncatNew((xmlChar *)"<", name, xmlStrlen(name)); - if (attributes) { - while (attributes[attno] != NULL) { - int att_len; - char *att_string, *att_name, *att_value; - - att_name = (char *)attributes[attno++]; - att_value = (char *)attributes[attno++]; - - att_len = spprintf(&att_string, 0, " %s=\"%s\"", att_name, att_value); - - qualified_name = xmlStrncat(qualified_name, (xmlChar *)att_string, att_len); - efree(att_string); - } - - } - qualified_name = xmlStrncat(qualified_name, (xmlChar *)">", 1); - parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name)); - xmlFree(qualified_name); - } - return; - } - - qualified_name = xmlStrdup(name); - - parser->h_start_element(parser->user, (const XML_Char *) qualified_name, (const XML_Char **) attributes); - - xmlFree(qualified_name); -} - -static void -_start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar ** namespaces, int nb_attributes, int nb_defaulted, const xmlChar ** attributes) -{ - XML_Parser parser = (XML_Parser) user; - xmlChar *qualified_name = NULL; - xmlChar **attrs = NULL; - int i; - int z = 0; - int y = 0; - - if (nb_namespaces > 0 && parser->h_start_ns != NULL) { - for (i = 0; i < nb_namespaces; i += 1) { - parser->h_start_ns(parser->user, (const XML_Char *) namespaces[y], (const XML_Char *) namespaces[y+1]); - y += 2; - } - y = 0; - } - - if (parser->h_start_element == NULL) { - if (parser->h_default) { - - if (prefix) { - qualified_name = xmlStrncatNew((xmlChar *)"<", prefix, xmlStrlen(prefix)); - qualified_name = xmlStrncat(qualified_name, (xmlChar *)":", 1); - qualified_name = xmlStrncat(qualified_name, name, xmlStrlen(name)); - } else { - qualified_name = xmlStrncatNew((xmlChar *)"<", name, xmlStrlen(name)); - } - - if (namespaces) { - int i, j; - for (i = 0,j = 0;j < nb_namespaces;j++) { - int ns_len; - char *ns_string, *ns_prefix, *ns_url; - - ns_prefix = (char *) namespaces[i++]; - ns_url = (char *) namespaces[i++]; - - if (ns_prefix) { - ns_len = spprintf(&ns_string, 0, " xmlns:%s=\"%s\"", ns_prefix, ns_url); - } else { - ns_len = spprintf(&ns_string, 0, " xmlns=\"%s\"", ns_url); - } - qualified_name = xmlStrncat(qualified_name, (xmlChar *)ns_string, ns_len); - - efree(ns_string); - } - } - - if (attributes) { - for (i = 0; i < nb_attributes; i += 1) { - int att_len; - char *att_string, *att_name, *att_value, *att_prefix, *att_valueend; - - att_name = (char *) attributes[y++]; - att_prefix = (char *)attributes[y++]; - y++; - att_value = (char *)attributes[y++]; - att_valueend = (char *)attributes[y++]; - - if (att_prefix) { - att_len = spprintf(&att_string, 0, " %s:%s=\"", att_prefix, att_name); - } else { - att_len = spprintf(&att_string, 0, " %s=\"", att_name); - } - - qualified_name = xmlStrncat(qualified_name, (xmlChar *)att_string, att_len); - qualified_name = xmlStrncat(qualified_name, (xmlChar *)att_value, att_valueend - att_value); - qualified_name = xmlStrncat(qualified_name, (xmlChar *)"\"", 1); - - efree(att_string); - } - - } - qualified_name = xmlStrncat(qualified_name, (xmlChar *)">", 1); - parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name)); - xmlFree(qualified_name); - } - return; - } - _qualify_namespace(parser, name, URI, &qualified_name); - - if (attributes != NULL) { - xmlChar *qualified_name_attr = NULL; - attrs = safe_emalloc((nb_attributes * 2) + 1, sizeof(int *), 0); - - for (i = 0; i < nb_attributes; i += 1) { - - if (attributes[y+1] != NULL) { - _qualify_namespace(parser, attributes[y] , attributes[y + 2], &qualified_name_attr); - } else { - qualified_name_attr = xmlStrdup(attributes[y]); - } - attrs[z] = qualified_name_attr; - attrs[z + 1] = xmlStrndup(attributes[y + 3] , (int) (attributes[y + 4] - attributes[y + 3])); - z += 2; - y += 5; - } - - attrs[z] = NULL; - } - parser->h_start_element(parser->user, (const XML_Char *) qualified_name, (const XML_Char **) attrs); - if (attrs) { - for (i = 0; i < z; i++) { - xmlFree(attrs[i]); - } - efree(attrs); - } - xmlFree(qualified_name); -} - -static void -_namespace_handler(XML_Parser parser, xmlNsPtr nsptr) -{ - if (nsptr != NULL) { - _namespace_handler(parser, nsptr->next); - parser->h_end_ns(parser->user, nsptr->prefix); - } -} - -static void -_end_element_handler(void *user, const xmlChar *name) -{ - xmlChar *qualified_name; - XML_Parser parser = (XML_Parser) user; - - if (parser->h_end_element == NULL) { - if (parser->h_default) { - char *end_element; - - spprintf(&end_element, 0, "", (char *)name); - parser->h_default(parser->user, (const XML_Char *) end_element, strlen(end_element)); - efree(end_element); - } - return; - } - - qualified_name = xmlStrdup(name); - - parser->h_end_element(parser->user, (const XML_Char *) qualified_name); - - xmlFree(qualified_name); -} - -static void -_end_element_handler_ns(void *user, const xmlChar *name, const xmlChar * prefix, const xmlChar *URI) -{ - xmlChar *qualified_name; - XML_Parser parser = (XML_Parser) user; - - if (parser->h_end_element == NULL) { - if (parser->h_default) { - char *end_element; - int end_element_len; - - if (prefix) { - end_element_len = spprintf(&end_element, 0, "", (char *) prefix, (char *)name); - } else { - end_element_len = spprintf(&end_element, 0, "", (char *)name); - } - parser->h_default(parser->user, (const XML_Char *) end_element, end_element_len); - efree(end_element); - } - return; - } - - _qualify_namespace(parser, name, URI, &qualified_name); - - parser->h_end_element(parser->user, (const XML_Char *) qualified_name); - - xmlFree(qualified_name); -} - -static void -_cdata_handler(void *user, const xmlChar *cdata, int cdata_len) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_cdata == NULL) { - if (parser->h_default) { - parser->h_default(parser->user, (const XML_Char *) cdata, cdata_len); - } - return; - } - - parser->h_cdata(parser->user, (const XML_Char *) cdata, cdata_len); -} - -static void -_pi_handler(void *user, const xmlChar *target, const xmlChar *data) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_pi == NULL) { - if (parser->h_default) { - char *full_pi; - spprintf(&full_pi, 0, "", (char *)target, (char *)data); - parser->h_default(parser->user, (const XML_Char *) full_pi, strlen(full_pi)); - efree(full_pi); - } - return; - } - - parser->h_pi(parser->user, (const XML_Char *) target, (const XML_Char *) data); -} - -static void -_unparsed_entity_decl_handler(void *user, - const xmlChar *name, - const xmlChar *pub_id, - const xmlChar *sys_id, - const xmlChar *notation) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_unparsed_entity_decl == NULL) { - return; - } - - parser->h_unparsed_entity_decl(parser->user, name, NULL, sys_id, pub_id, notation); -} - -static void -_notation_decl_handler(void *user, const xmlChar *notation, const xmlChar *pub_id, const xmlChar *sys_id) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_notation_decl == NULL) { - return; - } - - parser->h_notation_decl(parser->user, notation, NULL, sys_id, pub_id); -} - -static void -_build_comment(const xmlChar *data, int data_len, xmlChar **comment, int *comment_len) -{ - *comment_len = data_len + 7; - - *comment = xmlMalloc(*comment_len + 1); - memcpy(*comment, "", 3); - - (*comment)[*comment_len] = '\0'; -} - -static void -_comment_handler(void *user, const xmlChar *comment) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_default) { - xmlChar *d_comment; - int d_comment_len; - - _build_comment(comment, xmlStrlen(comment), &d_comment, &d_comment_len); - parser->h_default(parser->user, d_comment, d_comment_len); - xmlFree(d_comment); - } -} - -static void -_build_entity(const xmlChar *name, int len, xmlChar **entity, int *entity_len) -{ - *entity_len = len + 2; - *entity = xmlMalloc(*entity_len + 1); - (*entity)[0] = '&'; - memcpy(*entity+1, name, len); - (*entity)[len+1] = ';'; - (*entity)[*entity_len] = '\0'; -} - -static void -_external_entity_ref_handler(void *user, const xmlChar *names, int type, const xmlChar *sys_id, const xmlChar *pub_id, xmlChar *content) -{ - XML_Parser parser = (XML_Parser) user; - - if (parser->h_external_entity_ref == NULL) { - return; - } - - parser->h_external_entity_ref(parser, names, "", sys_id, pub_id); -} - -static xmlEntityPtr -_get_entity(void *user, const xmlChar *name) -{ - XML_Parser parser = (XML_Parser) user; - xmlEntityPtr ret = NULL; - - if (parser->parser->inSubset == 0) { - ret = xmlGetPredefinedEntity(name); - if (ret == NULL) - ret = xmlGetDocEntity(parser->parser->myDoc, name); - - if (ret == NULL || (parser->parser->instate != XML_PARSER_ENTITY_VALUE && parser->parser->instate != XML_PARSER_ATTRIBUTE_VALUE)) { - if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) { - /* Predefined entities will expand unless no cdata handler is present */ - if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) { - xmlChar *entity; - int len; - - _build_entity(name, xmlStrlen(name), &entity, &len); - parser->h_default(parser->user, (const xmlChar *) entity, len); - xmlFree(entity); - } else { - /* expat will not expand internal entities if default handler is present otherwise - it will expand and pass them to cdata handler */ - if (parser->h_cdata && ret) { - parser->h_cdata(parser->user, ret->content, xmlStrlen(ret->content)); - } - } - } else { - if (ret->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) { - _external_entity_ref_handler(user, ret->name, ret->etype, ret->SystemID, ret->ExternalID, NULL); - } - } - } - } - - return ret; -} - -static xmlSAXHandler -php_xml_compat_handlers = { - NULL, /* internalSubset */ - NULL, /* isStandalone */ - NULL, /* hasInternalSubset */ - NULL, /* hasExternalSubset */ - NULL, /* resolveEntity */ - _get_entity, /* getEntity */ - NULL, /* entityDecl */ - _notation_decl_handler, - NULL, /* attributeDecl */ - NULL, /* elementDecl */ - _unparsed_entity_decl_handler, /* unparsedEntity */ - NULL, /* setDocumentLocator */ - NULL, /* startDocument */ - NULL, /* endDocument */ - _start_element_handler, /* startElement */ - _end_element_handler, /* endElement */ - NULL, /* reference */ - _cdata_handler, - NULL, /* ignorableWhitespace */ - _pi_handler, - _comment_handler, /* comment */ - NULL, /* warning */ - NULL, /* error */ - NULL, /* fatalError */ - NULL, /* getParameterEntity */ - _cdata_handler, /* cdataBlock */ - NULL, /* externalSubset */ - XML_SAX2_MAGIC, - NULL, - _start_element_handler_ns, - _end_element_handler_ns, - NULL -}; - -PHPAPI XML_Parser -XML_ParserCreate(const XML_Char *encoding) -{ - return XML_ParserCreate_MM(encoding, NULL, NULL); -} - -PHPAPI XML_Parser -XML_ParserCreateNS(const XML_Char *encoding, const XML_Char sep) -{ - XML_Char tmp[2]; - tmp[0] = sep; - tmp[1] = '\0'; - return XML_ParserCreate_MM(encoding, NULL, tmp); -} - -PHPAPI XML_Parser -XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, const XML_Char *sep) -{ - XML_Parser parser; - - parser = (XML_Parser) emalloc(sizeof(struct _XML_Parser)); - memset(parser, 0, sizeof(struct _XML_Parser)); - parser->use_namespace = 0; - parser->_ns_seperator = NULL; - - parser->parser = xmlCreatePushParserCtxt((xmlSAXHandlerPtr) &php_xml_compat_handlers, (void *) parser, NULL, 0, NULL); - if (parser->parser == NULL) { - efree(parser); - return NULL; - } -#if LIBXML_VERSION <= 20617 - /* for older versions of libxml2, allow correct detection of - * charset in documents with a BOM: */ - parser->parser->charset = XML_CHAR_ENCODING_NONE; -#endif - - parser->parser->replaceEntities = 1; - parser->parser->wellFormed = 0; - if (sep != NULL) { - parser->use_namespace = 1; - parser->parser->sax2 = 1; - parser->_ns_seperator = xmlStrdup(sep); - } else { - /* Reset flag as XML_SAX2_MAGIC is needed for xmlCreatePushParserCtxt - so must be set in the handlers */ - parser->parser->sax->initialized = 1; - } - return parser; -} - -PHPAPI void -XML_SetUserData(XML_Parser parser, void *user) -{ - parser->user = user; -} - -PHPAPI void * -XML_GetUserData(XML_Parser parser) -{ - return parser->user; -} - -PHPAPI void -XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end) -{ - parser->h_start_element = start; - parser->h_end_element = end; -} - -PHPAPI void -XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler cdata) -{ - parser->h_cdata = cdata; -} - -PHPAPI void -XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler pi) -{ - parser->h_pi = pi; -} - -PHPAPI void -XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler comment) -{ - parser->h_comment = comment; -} - -PHPAPI void -XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler d) -{ - parser->h_default = d; -} - -PHPAPI void -XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler unparsed_decl) -{ - parser->h_unparsed_entity_decl = unparsed_decl; -} - -PHPAPI void -XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler notation_decl) -{ - parser->h_notation_decl = notation_decl; -} - -PHPAPI void -XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler ext_entity) -{ - parser->h_external_entity_ref = ext_entity; -} - -PHPAPI void -XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start_ns) -{ - parser->h_start_ns = start_ns; -} - -PHPAPI void -XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end_ns) -{ - parser->h_end_ns = end_ns; -} - -PHPAPI int -XML_Parse(XML_Parser parser, const XML_Char *data, int data_len, int is_final) -{ - int error; - -/* The following is a hack to keep BC with PHP 4 while avoiding -the inifite loop in libxml <= 2.6.17 which occurs when no encoding -has been defined and none can be detected */ -#if LIBXML_VERSION <= 20617 - if (parser->parser->charset == XML_CHAR_ENCODING_NONE) { - if (data_len >= 4 || (parser->parser->input->buf->buffer->use + data_len >= 4)) { - xmlChar start[4]; - int char_count; - - char_count = parser->parser->input->buf->buffer->use; - if (char_count > 4) { - char_count = 4; - } - - memcpy(start, parser->parser->input->buf->buffer->content, (size_t)char_count); - memcpy(start + char_count, data, (size_t)(4 - char_count)); - - if (xmlDetectCharEncoding(&start[0], 4) == XML_CHAR_ENCODING_NONE) { - parser->parser->charset = XML_CHAR_ENCODING_UTF8; - } - } - } -#endif - - error = xmlParseChunk(parser->parser, data, data_len, is_final); - if (!error) { - return 1; - } else if (parser->parser->lastError.level > XML_ERR_WARNING ){ - return 0; - } else { - return 1; - } -} - -PHPAPI int -XML_GetErrorCode(XML_Parser parser) -{ - return parser->parser->errNo; -} - -static const XML_Char *const error_mapping[] = { - "No error", - "Internal error", - "No memory", - "Invalid document start", - "Empty document", - "Invalid document end", - "Invalid hexadecimal character reference", - "Invalid decimal character reference", - "Invalid character reference", - "Invalid character", - "XML_ERR_CHARREF_AT_EOF", - "XML_ERR_CHARREF_IN_PROLOG", - "XML_ERR_CHARREF_IN_EPILOG", - "XML_ERR_CHARREF_IN_DTD", - "XML_ERR_ENTITYREF_AT_EOF", - "XML_ERR_ENTITYREF_IN_PROLOG", - "XML_ERR_ENTITYREF_IN_EPILOG", - "XML_ERR_ENTITYREF_IN_DTD", - "PEReference at end of document", - "PEReference in prolog", - "PEReference in epilog", - "PEReference: forbidden within markup decl in internal subset", - "XML_ERR_ENTITYREF_NO_NAME", - "EntityRef: expecting ';'", - "PEReference: no name", - "PEReference: expecting ';'", - "Undeclared entity error", - "Undeclared entity warning", - "Unparsed Entity", - "XML_ERR_ENTITY_IS_EXTERNAL", - "XML_ERR_ENTITY_IS_PARAMETER", - "Unknown encoding", - "Unsupported encoding", - "String not started expecting ' or \"", - "String not closed expecting \" or '", - "Namespace declaration error", - "EntityValue: \" or ' expected", - "EntityValue: \" or ' expected", - "< in attribute", - "Attribute not started", - "Attribute not finished", - "Attribute without value", - "Attribute redefined", - "SystemLiteral \" or ' expected", - "SystemLiteral \" or ' expected", - /* "XML_ERR_COMMENT_NOT_STARTED", <= eliminated on purpose */ - "Comment not finished", - "Processing Instruction not started", - "Processing Instruction not finished", - "NOTATION: Name expected here", - "'>' required to close NOTATION declaration", - "'(' required to start ATTLIST enumeration", - "'(' required to start ATTLIST enumeration", - "MixedContentDecl : '|' or ')*' expected", - "XML_ERR_MIXED_NOT_FINISHED", - "ELEMENT in DTD not started", - "ELEMENT in DTD not finished", - "XML declaration not started", - "XML declaration not finished", - "XML_ERR_CONDSEC_NOT_STARTED", - "XML conditional section not closed", - "Content error in the external subset", - "DOCTYPE not finished", - "Sequence ']]>' not allowed in content", - "CDATA not finished", - "Reserved XML Name", - "Space required", - "XML_ERR_SEPARATOR_REQUIRED", - "NmToken expected in ATTLIST enumeration", - "XML_ERR_NAME_REQUIRED", - "MixedContentDecl : '#PCDATA' expected", - "SYSTEM or PUBLIC, the URI is missing", - "PUBLIC, the Public Identifier is missing", - "< required", - "> required", - "= (int)(sizeof(error_mapping) / sizeof(error_mapping[0]))) { - return "Unknown"; - } - return error_mapping[code]; -} - -PHPAPI int -XML_GetCurrentLineNumber(XML_Parser parser) -{ - return parser->parser->input->line; -} - -PHPAPI int -XML_GetCurrentColumnNumber(XML_Parser parser) -{ - return parser->parser->input->col; -} - -PHPAPI int -XML_GetCurrentByteIndex(XML_Parser parser) -{ - return parser->parser->input->consumed + - (parser->parser->input->cur - parser->parser->input->base); -} - -PHPAPI int -XML_GetCurrentByteCount(XML_Parser parser) -{ - /* WARNING: this is identical to ByteIndex; it should probably - * be different */ - return parser->parser->input->consumed + - (parser->parser->input->cur - parser->parser->input->base); -} - -PHPAPI const XML_Char *XML_ExpatVersion(void) -{ - return "1.0"; -} - -PHPAPI void -XML_ParserFree(XML_Parser parser) -{ - if (parser->use_namespace) { - if (parser->_ns_seperator) { - xmlFree(parser->_ns_seperator); - } - } - if (parser->parser->myDoc) { - xmlFreeDoc(parser->parser->myDoc); - parser->parser->myDoc = NULL; - } - xmlFreeParserCtxt(parser->parser); - efree(parser); -} - -#endif /* LIBXML_EXPAT_COMPAT */ -#endif - -/** - * Local Variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: fdm=marker - * vim: ts=4 noet sw=4 - */ diff --git a/ext/xml/config.m4 b/ext/xml/config.m4 deleted file mode 100644 index 65f22915b93af..0000000000000 --- a/ext/xml/config.m4 +++ /dev/null @@ -1,59 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(xml,whether to enable XML support, -[ --disable-xml Disable XML support], yes) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XML: libxml2 install prefix], no, no) -fi - -PHP_ARG_WITH(libexpat-dir, libexpat install dir, -[ --with-libexpat-dir=DIR XML: libexpat install prefix (deprecated)], no, no) - -if test "$PHP_XML" != "no"; then - - dnl - dnl Default to libxml2 if --with-libexpat-dir is not used. - dnl - if test "$PHP_LIBEXPAT_DIR" = "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([XML extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(XML_SHARED_LIBADD, [ - xml_extra_sources="compat.c" - PHP_ADD_EXTENSION_DEP(xml, libxml) - ], [ - AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=]) - ]) - fi - - dnl - dnl Check for expat only if --with-libexpat-dir is used. - dnl - if test "$PHP_LIBEXPAT_DIR" != "no"; then - for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do - if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then - EXPAT_DIR=$i - break - fi - done - - if test -z "$EXPAT_DIR"; then - AC_MSG_ERROR([not found. Please reinstall the expat distribution.]) - fi - - PHP_ADD_INCLUDE($EXPAT_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/$PHP_LIBDIR, XML_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBEXPAT, 1, [ ]) - fi - - PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared) - PHP_SUBST(XML_SHARED_LIBADD) - PHP_INSTALL_HEADERS([ext/xml/]) - AC_DEFINE(HAVE_XML, 1, [ ]) -fi diff --git a/ext/xml/config.w32 b/ext/xml/config.w32 deleted file mode 100644 index 08d25ffe57042..0000000000000 --- a/ext/xml/config.w32 +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("xml", "XML support", "yes"); - -if (PHP_XML == "yes" && PHP_LIBXML == "yes") { - EXTENSION("xml", "xml.c compat.c"); - AC_DEFINE("HAVE_XML", 1, "XML support"); - if (!PHP_XML_SHARED) { - ADD_FLAG("CFLAGS_XML", "/D LIBXML_STATIC "); - } - ADD_EXTENSION_DEP('xml', 'libxml'); -} - - diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h deleted file mode 100644 index 57aa51e65f4ca..0000000000000 --- a/ext/xml/expat_compat.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_EXPAT_COMPAT_H -#define PHP_EXPAT_COMPAT_H - -#ifdef PHP_WIN32 -#include "config.w32.h" -#else -#include -#endif - -#if !defined(HAVE_LIBEXPAT) && defined(HAVE_LIBXML) -#define LIBXML_EXPAT_COMPAT 1 - -#include "php.h" -#include "php_compat.h" - -#include -#include -#include -#include - -typedef xmlChar XML_Char; - -typedef void (*XML_StartElementHandler)(void *, const XML_Char *, const XML_Char **); -typedef void (*XML_EndElementHandler)(void *, const XML_Char *); -typedef void (*XML_CharacterDataHandler)(void *, const XML_Char *, int); -typedef void (*XML_ProcessingInstructionHandler)(void *, const XML_Char *, const XML_Char *); -typedef void (*XML_CommentHandler)(void *, const XML_Char *); -typedef void (*XML_DefaultHandler)(void *, const XML_Char *, int); -typedef void (*XML_UnparsedEntityDeclHandler)(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -typedef void (*XML_NotationDeclHandler)(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -typedef int (*XML_ExternalEntityRefHandler)(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -typedef void (*XML_StartNamespaceDeclHandler)(void *, const XML_Char *, const XML_Char *); -typedef void (*XML_EndNamespaceDeclHandler)(void *, const XML_Char *); - -typedef struct _XML_Memory_Handling_Suite { - void *(*malloc_fcn)(size_t size); - void *(*realloc_fcn)(void *ptr, size_t size); - void (*free_fcn)(void *ptr); -} XML_Memory_Handling_Suite; - -typedef struct _XML_Parser { - int use_namespace; - - xmlChar *_ns_seperator; - - void *user; - xmlParserCtxtPtr parser; - - XML_StartElementHandler h_start_element; - XML_EndElementHandler h_end_element; - XML_CharacterDataHandler h_cdata; - XML_ProcessingInstructionHandler h_pi; - XML_CommentHandler h_comment; - XML_DefaultHandler h_default; - XML_UnparsedEntityDeclHandler h_unparsed_entity_decl; - XML_NotationDeclHandler h_notation_decl; - XML_ExternalEntityRefHandler h_external_entity_ref; - XML_StartNamespaceDeclHandler h_start_ns; - XML_EndNamespaceDeclHandler h_end_ns; -} *XML_Parser; - -enum XML_Error { - XML_ERROR_NONE, - XML_ERROR_NO_MEMORY, - XML_ERROR_SYNTAX, - XML_ERROR_NO_ELEMENTS, - XML_ERROR_INVALID_TOKEN, - XML_ERROR_UNCLOSED_TOKEN, - XML_ERROR_PARTIAL_CHAR, - XML_ERROR_TAG_MISMATCH, - XML_ERROR_DUPLICATE_ATTRIBUTE, - XML_ERROR_JUNK_AFTER_DOC_ELEMENT, - XML_ERROR_PARAM_ENTITY_REF, - XML_ERROR_UNDEFINED_ENTITY, - XML_ERROR_RECURSIVE_ENTITY_REF, - XML_ERROR_ASYNC_ENTITY, - XML_ERROR_BAD_CHAR_REF, - XML_ERROR_BINARY_ENTITY_REF, - XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, - XML_ERROR_MISPLACED_XML_PI, - XML_ERROR_UNKNOWN_ENCODING, - XML_ERROR_INCORRECT_ENCODING, - XML_ERROR_UNCLOSED_CDATA_SECTION, - XML_ERROR_EXTERNAL_ENTITY_HANDLING, - XML_ERROR_NOT_STANDALONE, - XML_ERROR_UNEXPECTED_STATE, - XML_ERROR_ENTITY_DECLARED_IN_PE, - XML_ERROR_FEATURE_REQUIRES_XML_DTD, - XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING -}; - -enum XML_Content_Type { - XML_CTYPE_EMPTY = 1, - XML_CTYPE_ANY, - XML_CTYPE_MIXED, - XML_CTYPE_NAME, - XML_CTYPE_CHOICE, - XML_CTYPE_SEQ -}; - -PHPAPI XML_Parser XML_ParserCreate(const XML_Char *); -PHPAPI XML_Parser XML_ParserCreateNS(const XML_Char *, const XML_Char); -PHPAPI XML_Parser XML_ParserCreate_MM(const XML_Char *, const XML_Memory_Handling_Suite *, const XML_Char *); -PHPAPI void XML_SetUserData(XML_Parser, void *); -PHPAPI void *XML_GetUserData(XML_Parser); -PHPAPI void XML_SetElementHandler(XML_Parser, XML_StartElementHandler, XML_EndElementHandler); -PHPAPI void XML_SetCharacterDataHandler(XML_Parser, XML_CharacterDataHandler); -PHPAPI void XML_SetProcessingInstructionHandler(XML_Parser, XML_ProcessingInstructionHandler); -PHPAPI void XML_SetDefaultHandler(XML_Parser, XML_DefaultHandler); -PHPAPI void XML_SetUnparsedEntityDeclHandler(XML_Parser, XML_UnparsedEntityDeclHandler); -PHPAPI void XML_SetNotationDeclHandler(XML_Parser, XML_NotationDeclHandler); -PHPAPI void XML_SetExternalEntityRefHandler(XML_Parser, XML_ExternalEntityRefHandler); -PHPAPI void XML_SetStartNamespaceDeclHandler(XML_Parser, XML_StartNamespaceDeclHandler); -PHPAPI void XML_SetEndNamespaceDeclHandler(XML_Parser, XML_EndNamespaceDeclHandler); -PHPAPI int XML_Parse(XML_Parser, const XML_Char *, int data_len, int is_final); -PHPAPI int XML_GetErrorCode(XML_Parser); -PHPAPI const XML_Char *XML_ErrorString(int); -PHPAPI int XML_GetCurrentLineNumber(XML_Parser); -PHPAPI int XML_GetCurrentColumnNumber(XML_Parser); -PHPAPI int XML_GetCurrentByteIndex(XML_Parser); -PHPAPI int XML_GetCurrentByteCount(XML_Parser); -PHPAPI const XML_Char *XML_ExpatVersion(void); -PHPAPI void XML_ParserFree(XML_Parser); - -#elif defined(HAVE_LIBEXPAT) -#include -#endif /* HAVE_LIBEXPAT */ - -#endif /* PHP_EXPAT_COMPAT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/xml/package.xml b/ext/xml/package.xml deleted file mode 100644 index ae5e6450d8ff9..0000000000000 --- a/ext/xml/package.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - xml - XML Parsing functions - - - ssb - Stig Bakken - ssb@php.net - lead - - - thies - Thies Arntzen - thies@php.net - lead - - - sterling - Sterling Hughes - sterling@php.net - lead - - - -This extension lets you create XML parsers and then define -handlers for different XML events. Each XML parser also has -a few parameters you can adjust. - - PHP - - beta - 5.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h deleted file mode 100644 index d22f28de82fc6..0000000000000 --- a/ext/xml/php_xml.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Stig Sæther Bakken | - | Thies C. Arntzen | - | Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XML_H -#define PHP_XML_H - -#ifdef HAVE_XML -extern zend_module_entry xml_module_entry; -#define xml_module_ptr &xml_module_entry -#else -#define xml_module_ptr NULL -#endif - -#ifdef HAVE_XML - -#include "ext/xml/expat_compat.h" - -#ifdef PHP_WIN32 -#define PHP_XML_API __declspec(dllexport) -#else -#define PHP_XML_API -#endif - - -#ifdef XML_UNICODE -#error "UTF-16 Unicode support not implemented!" -#endif - -ZEND_BEGIN_MODULE_GLOBALS(xml) - XML_Char *default_encoding; -ZEND_END_MODULE_GLOBALS(xml) - -typedef struct { - int index; - int case_folding; - XML_Parser parser; - XML_Char *target_encoding; - - zval *startElementHandler; - zval *endElementHandler; - zval *characterDataHandler; - zval *processingInstructionHandler; - zval *defaultHandler; - zval *unparsedEntityDeclHandler; - zval *notationDeclHandler; - zval *externalEntityRefHandler; - zval *unknownEncodingHandler; - zval *startNamespaceDeclHandler; - zval *endNamespaceDeclHandler; - - zend_function *startElementPtr; - zend_function *endElementPtr; - zend_function *characterDataPtr; - zend_function *processingInstructionPtr; - zend_function *defaultPtr; - zend_function *unparsedEntityDeclPtr; - zend_function *notationDeclPtr; - zend_function *externalEntityRefPtr; - zend_function *unknownEncodingPtr; - zend_function *startNamespaceDeclPtr; - zend_function *endNamespaceDeclPtr; - - zval *object; - - zval *data; - zval *info; - int level; - int toffset; - int curtag; - zval **ctag; - char **ltags; - int lastwasopen; - int skipwhite; - int isparsing; - - XML_Char *baseURI; -} xml_parser; - - -typedef struct { - XML_Char *name; - char (*decoding_function)(unsigned short); - unsigned short (*encoding_function)(unsigned char); -} xml_encoding; - - -enum php_xml_option { - PHP_XML_OPTION_CASE_FOLDING = 1, - PHP_XML_OPTION_TARGET_ENCODING, - PHP_XML_OPTION_SKIP_TAGSTART, - PHP_XML_OPTION_SKIP_WHITE -}; - -/* for xml_parse_into_struct */ - -#define XML_MAXLEVEL 255 /* XXX this should be dynamic */ - -PHP_FUNCTION(xml_parser_create); -PHP_FUNCTION(xml_parser_create_ns); -PHP_FUNCTION(xml_set_object); -PHP_FUNCTION(xml_set_element_handler); -PHP_FUNCTION(xml_set_character_data_handler); -PHP_FUNCTION(xml_set_processing_instruction_handler); -PHP_FUNCTION(xml_set_default_handler); -PHP_FUNCTION(xml_set_unparsed_entity_decl_handler); -PHP_FUNCTION(xml_set_notation_decl_handler); -PHP_FUNCTION(xml_set_external_entity_ref_handler); -PHP_FUNCTION(xml_set_start_namespace_decl_handler); -PHP_FUNCTION(xml_set_end_namespace_decl_handler); -PHP_FUNCTION(xml_parse); -PHP_FUNCTION(xml_get_error_code); -PHP_FUNCTION(xml_error_string); -PHP_FUNCTION(xml_get_current_line_number); -PHP_FUNCTION(xml_get_current_column_number); -PHP_FUNCTION(xml_get_current_byte_index); -PHP_FUNCTION(xml_parser_free); -PHP_FUNCTION(xml_parser_set_option); -PHP_FUNCTION(xml_parser_get_option); -PHP_FUNCTION(utf8_encode); -PHP_FUNCTION(utf8_decode); -PHP_FUNCTION(xml_parse_into_struct); - -PHPAPI char *_xml_zval_strdup(zval *val); -PHPAPI char *xml_utf8_decode(const XML_Char *, int, int *, const XML_Char *); -PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding); - -#endif /* HAVE_LIBEXPAT */ - -#define phpext_xml_ptr xml_module_ptr - -#ifdef ZTS -#define XML(v) TSRMG(xml_globals_id, zend_xml_globals *, v) -#else -#define XML(v) (xml_globals.v) -#endif - -#endif /* PHP_XML_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/xml/tests/bug25666.phpt b/ext/xml/tests/bug25666.phpt deleted file mode 100644 index e162d5a2bd586..0000000000000 --- a/ext/xml/tests/bug25666.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #25666 (XML namespaces broken in libxml-based SAX interface) ---SKIPIF-- - ---FILE-- - - - - -HERE; - -$parser = xml_parser_create_ns("ISO-8859-1","@"); -xml_set_element_handler($parser,'start_elem','end_elem'); -xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); -xml_parse($parser, $xml); -xml_parser_free($parser); -?> ---EXPECT-- -string(24) "http://example.com/foo@a" -string(24) "http://example.com/bar@b" -string(24) "http://example.com/baz@c" diff --git a/ext/xml/tests/bug26528.phpt b/ext/xml/tests/bug26528.phpt deleted file mode 100644 index 40a1c53c9b4c0..0000000000000 --- a/ext/xml/tests/bug26528.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #26528 (HTML entities are not being decoded) ---SKIPIF-- - ---FILE-- -"; - $parser = xml_parser_create(); - $res = xml_parse_into_struct($parser,$sample,$vals,$index); - xml_parser_free($parser); - var_dump($vals); -?> ---EXPECT-- -array(1) { - [0]=> - array(4) { - ["tag"]=> - string(4) "TEST" - ["type"]=> - string(8) "complete" - ["level"]=> - int(1) - ["attributes"]=> - array(1) { - ["ATTR"]=> - string(13) "angle ---FILE-- - - - -'; - -// Case 2: replace some characters so that we get comments instead -$xmls["Comment"] =' - - -'; - -// Case 3: replace even more characters so that only textual data is left -$xmls["Text"] =' - --!-- ATA[ -multi -line -CDATA -block ---- -'; - -function startElement($parser, $name, $attrs) { - printf("<$name> at line %d, col %d (byte %d)\n", - xml_get_current_line_number($parser), - xml_get_current_column_number($parser), - xml_get_current_byte_index($parser)); -} - -function endElement($parser, $name) { - printf(" at line %d, col %d (byte %d)\n", - xml_get_current_line_number($parser), - xml_get_current_column_number($parser), - xml_get_current_byte_index($parser)); -} - -function characterData($parser, $data) { - // dummy -} - -foreach ($xmls as $desc => $xml) { - echo "$desc\n"; - $xml_parser = xml_parser_create(); - xml_set_element_handler($xml_parser, "startElement", "endElement"); - xml_set_character_data_handler($xml_parser, "characterData"); - if (!xml_parse($xml_parser, $xml, true)) - echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n"; - xml_parser_free($xml_parser); -} -?> ---EXPECT-- -CDATA - at line 2, col 0 (byte 45) - at line 9, col 0 (byte 90) -Comment - at line 2, col 0 (byte 45) - at line 9, col 0 (byte 90) -Text - at line 2, col 0 (byte 45) - at line 9, col 0 (byte 90) diff --git a/ext/xml/tests/bug26614_libxml.phpt b/ext/xml/tests/bug26614_libxml.phpt deleted file mode 100755 index 782bdb19366b3..0000000000000 --- a/ext/xml/tests/bug26614_libxml.phpt +++ /dev/null @@ -1,93 +0,0 @@ ---TEST-- -Bug #26614 (CDATA sections skipped on line count) ---SKIPIF-- - ---FILE-- - - - -'; - -// Case 2: replace some characters so that we get comments instead -$xmls["Comment"] =' - - -'; - -// Case 3: replace even more characters so that only textual data is left -$xmls["Text"] =' - --!-- ATA[ -multi -line -CDATA -block ---- -'; - -function startElement($parser, $name, $attrs) { - printf("<$name> at line %d, col %d (byte %d)\n", - xml_get_current_line_number($parser), - xml_get_current_column_number($parser), - xml_get_current_byte_index($parser)); -} - -function endElement($parser, $name) { - printf(" at line %d, col %d (byte %d)\n", - xml_get_current_line_number($parser), - xml_get_current_column_number($parser), - xml_get_current_byte_index($parser)); -} - -function characterData($parser, $data) { - // dummy -} - -foreach ($xmls as $desc => $xml) { - echo "$desc\n"; - $xml_parser = xml_parser_create(); - xml_set_element_handler($xml_parser, "startElement", "endElement"); - xml_set_character_data_handler($xml_parser, "characterData"); - if (!xml_parse($xml_parser, $xml, true)) - echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n"; - xml_parser_free($xml_parser); -} -?> ---EXPECTF-- -CDATA - at line 2, col %d (byte 9) - at line 9, col %d (byte 56) -Comment - at line 2, col %d (byte 9) - at line 9, col %d (byte 56) -Text - at line 2, col %d (byte 9) - at line 9, col %d (byte 56) diff --git a/ext/xml/tests/bug27908.phpt b/ext/xml/tests/bug27908.phpt deleted file mode 100644 index e60466fa19f54..0000000000000 --- a/ext/xml/tests/bug27908.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #27908 (default handler not being called) ---SKIPIF-- - ---FILE-- -',TRUE); -xml_parser_free($xp); -echo "Done\n"; -?> ---EXPECT-- -x_default_handler -x_default_handler -Done diff --git a/ext/xml/tests/bug30266.phpt b/ext/xml/tests/bug30266.phpt deleted file mode 100644 index 0a3a5ca46bfd2..0000000000000 --- a/ext/xml/tests/bug30266.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Bug #30266 (Invalid opcode 137/1/8) ---SKIPIF-- - ---FILE-- -dummy = "b"; - throw new Exception("ex"); - } - - function endHandler($XmlParser, $tag) - { - } -} - -$p1 = new Xml_Parser(); -try { - $p1->parse(''); -} catch (Exception $e) { - echo "OK\n"; -} -?> ---EXPECT-- -OK diff --git a/ext/xml/tests/bug32001.phpt b/ext/xml/tests/bug32001.phpt deleted file mode 100644 index 0853b3ab1c15a..0000000000000 --- a/ext/xml/tests/bug32001.phpt +++ /dev/null @@ -1,406 +0,0 @@ ---TEST-- -Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using UTF-* ---SKIPIF-- - ---FILE-- -encoding = $enc; - $this->chunk_size = $chunk_size; - $this->bom = $bom; - $this->prologue = !$omit_prologue; - $this->tags = array(); - } - - function start_element($parser, $name, $attrs) { - $attrs = array_map('bin2hex', $attrs); - $this->tags[] = bin2hex($name).": ".implode(', ', $attrs); - } - - function end_element($parser, $name) { - } - - function run() { - $data = ''; - - if ($this->prologue) { - $canonical_name = preg_replace('/BE|LE/i', '', $this->encoding); - $data .= "\n"; - } - - $data .= << - <テスト:テスト2 テスト="テスト"> - <テスト:テスト3> - test! - - - -HERE; - - $data = iconv("UTF-8", $this->encoding, $data); - - if ($this->bom) { - switch (strtoupper($this->encoding)) { - case 'UTF-8': - case 'UTF8': - $data = "\xef\xbb\xbf".$data; - break; - - case 'UTF-16': - case 'UTF16': - case 'UTF-16BE': - case 'UTF16BE': - case 'UCS-2': - case 'UCS2': - case 'UCS-2BE': - case 'UCS2BE': - $data = "\xfe\xff".$data; - break; - - case 'UTF-16LE': - case 'UTF16LE': - case 'UCS-2LE': - case 'UCS2LE': - $data = "\xff\xfe".$data; - break; - - case 'UTF-32': - case 'UTF32': - case 'UTF-32BE': - case 'UTF32BE': - case 'UCS-4': - case 'UCS4': - case 'UCS-4BE': - case 'UCS4BE': - $data = "\x00\x00\xfe\xff".$data; - break; - - case 'UTF-32LE': - case 'UTF32LE': - case 'UCS-4LE': - case 'UCS4LE': - $data = "\xff\xfe\x00\x00".$data; - break; - } - } - - $parser = xml_parser_create(NULL); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_set_element_handler($parser, "start_element", "end_element"); - xml_set_object($parser, $this); - - if ($this->chunk_size == 0) { - $success = @xml_parse($parser, $data, true); - } else { - for ($offset = 0; $offset < strlen($data); - $offset += $this->chunk_size) { - $success = @xml_parse($parser, substr($data, $offset, $this->chunk_size), false); - if (!$success) { - break; - } - } - if ($success) { - $success = @xml_parse($parser, "", true); - } - } - - echo "Encoding: $this->encoding\n"; - echo "XML Prologue: ".($this->prologue ? 'present': 'not present'), "\n"; - echo "Chunk size: ".($this->chunk_size ? "$this->chunk_size byte(s)\n": "all data at once\n"); - echo "BOM: ".($this->bom ? 'prepended': 'not prepended'), "\n"; - - if ($success) { - var_dump($this->tags); - } else { - echo "[Error] ", xml_error_string(xml_get_error_code($parser)), "\n"; - } - } -} -$suite = array( - new testcase("UTF-8", 0, 0, 0), - new testcase("UTF-8", 0, 0, 1), - new testcase("UTF-8", 0, 1, 0), - new testcase("UTF-8", 0, 1, 1), - new testcase("UTF-16BE", 0, 0, 0), - new testcase("UTF-16BE", 0, 1, 0), - new testcase("UTF-16BE", 0, 1, 1), - new testcase("UTF-16LE", 0, 0, 0), - new testcase("UTF-16LE", 0, 1, 0), - new testcase("UTF-16LE", 0, 1, 1), - new testcase("UTF-8", 1, 0, 0), - new testcase("UTF-8", 1, 0, 1), - new testcase("UTF-8", 1, 1, 0), - new testcase("UTF-8", 1, 1, 1), - new testcase("UTF-16BE", 1, 0, 0), - new testcase("UTF-16BE", 1, 1, 0), - new testcase("UTF-16BE", 1, 1, 1), - new testcase("UTF-16LE", 1, 0, 0), - new testcase("UTF-16LE", 1, 1, 0), - new testcase("UTF-16LE", 1, 1, 1), -); - -if (XML_SAX_IMPL == 'libxml') { - echo "libxml2 Version => " . LIBXML_DOTTED_VERSION. "\n"; -} else { - echo "libxml2 Version => NONE\n"; -} - -foreach ($suite as $testcase) { - $testcase->run(); -} - -// vim600: sts=4 sw=4 ts=4 encoding=UTF-8 -?> ---EXPECTF-- -libxml2 Version => %s -Encoding: UTF-8 -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: not present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: not present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: not present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: not present -Chunk size: all data at once -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: not present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-8 -XML Prologue: not present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16BE -XML Prologue: not present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: UTF-16LE -XML Prologue: not present -Chunk size: 1 byte(s) -BOM: prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} diff --git a/ext/xml/tests/bug32001b.phpt b/ext/xml/tests/bug32001b.phpt deleted file mode 100755 index f4aea08e5da40..0000000000000 --- a/ext/xml/tests/bug32001b.phpt +++ /dev/null @@ -1,184 +0,0 @@ ---TEST-- -Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using EUC-JP, Shift_JIS, GB2312 ---SKIPIF-- - ---FILE-- -encoding = $enc; - $this->chunk_size = $chunk_size; - $this->bom = $bom; - $this->prologue = !$omit_prologue; - $this->tags = array(); - } - - function start_element($parser, $name, $attrs) { - $attrs = array_map('bin2hex', $attrs); - $this->tags[] = bin2hex($name).": ".implode(', ', $attrs); - } - - function end_element($parser, $name) { - } - - function run() { - $data = ''; - - if ($this->prologue) { - $canonical_name = preg_replace('/BE|LE/i', '', $this->encoding); - $data .= "\n"; - } - - $data .= << - <テスト:テスト2 テスト="テスト"> - <テスト:テスト3> - test! - - - -HERE; - - $data = iconv("UTF-8", $this->encoding, $data); - - $parser = xml_parser_create(NULL); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_set_element_handler($parser, "start_element", "end_element"); - xml_set_object($parser, $this); - - if ($this->chunk_size == 0) { - $success = @xml_parse($parser, $data, true); - } else { - for ($offset = 0; $offset < strlen($data); - $offset += $this->chunk_size) { - $success = @xml_parse($parser, substr($data, $offset, $this->chunk_size), false); - if (!$success) { - break; - } - } - if ($success) { - $success = @xml_parse($parser, "", true); - } - } - - echo "Encoding: $this->encoding\n"; - echo "XML Prologue: ".($this->prologue ? 'present': 'not present'), "\n"; - echo "Chunk size: ".($this->chunk_size ? "$this->chunk_size byte(s)\n": "all data at once\n"); - echo "BOM: ".($this->bom ? 'prepended': 'not prepended'), "\n"; - - if ($success) { - var_dump($this->tags); - } else { - echo "[Error] ", xml_error_string(xml_get_error_code($parser)), "\n"; - } - } -} -$suite = array( - new testcase("EUC-JP" , 0), - new testcase("EUC-JP" , 1), - new testcase("Shift_JIS", 0), - new testcase("Shift_JIS", 1), - new testcase("GB2312", 0), - new testcase("GB2312", 1), -); - -if (XML_SAX_IMPL == 'libxml') { - $php = getenv('TEST_PHP_EXECUTABLE'); - preg_match("/^libxml2 Version.*\$/im", `$php -i`, $match); - echo $match[0], "\n"; -} else { - echo "libxml2 Version => NONE\n"; -} - -foreach ($suite as $testcase) { - $testcase->run(); -} - -// vim600: sts=4 sw=4 ts=4 encoding=UTF-8 -?> ---EXPECTF-- -libxml2 Version => %s -Encoding: EUC-JP -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: EUC-JP -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: Shift_JIS -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: Shift_JIS -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: GB2312 -XML Prologue: present -Chunk size: all data at once -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} -Encoding: GB2312 -XML Prologue: present -Chunk size: 1 byte(s) -BOM: not prepended -array(3) { - [0]=> - string(128) "e38386e382b9e383883ae38386e382b9e3838831: 687474703a2f2f7777772e6578616d706c652e636f6d2fe38386e382b9e383882f, e38386e382b9e38388" - [1]=> - string(60) "e38386e382b9e383883ae38386e382b9e3838832: e38386e382b9e38388" - [2]=> - string(42) "e38386e382b9e383883ae38386e382b9e3838833: " -} diff --git a/ext/xml/tests/bug35447.phpt b/ext/xml/tests/bug35447.phpt deleted file mode 100644 index 8cbb5e519323c..0000000000000 --- a/ext/xml/tests/bug35447.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Bug #35447 (xml_parse_into_struct() chokes on the UTF-8 BOM) ---SKIPIF-- - ---FILE-- - - - -]> -A bient&244;t -END_OF_XML; - -$parser = xml_parser_create_ns('UTF-8'); -xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); -$result = xml_parse_into_struct($parser, $data, $vals, $index); -xml_parser_free($parser); -var_dump($vals); -?> ---EXPECT-- -array(1) { - [0]=> - array(5) { - ["tag"]=> - string(8) "resource" - ["type"]=> - string(8) "complete" - ["level"]=> - int(1) - ["attributes"]=> - array(2) { - ["key"]=> - string(7) "rSeeYou" - ["type"]=> - string(7) "literal" - } - ["value"]=> - string(13) "A bient&244;t" - } -} diff --git a/ext/xml/tests/bug43957.phpt b/ext/xml/tests/bug43957.phpt deleted file mode 100644 index f11d15627be82..0000000000000 --- a/ext/xml/tests/bug43957.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #43957 (utf8_decode() bogus conversion on multibyte indicator near end of string) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -abc? diff --git a/ext/xml/tests/bug46699.phpt b/ext/xml/tests/bug46699.phpt deleted file mode 100644 index 3996fd191773d..0000000000000 --- a/ext/xml/tests/bug46699.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #46699: (xml_parse crash when parser is namespace aware) ---SKIPIF-- - ---FILE-- - - 1 - 2 - -HERE; - -$parser = xml_parser_create_ns("ISO-8859-1","@"); -xml_set_default_handler($parser,'defaultfunc'); -xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); -xml_parse($parser, $xml); -xml_parser_free($parser); -?> ---EXPECT-- - - 1 - 2 - diff --git a/ext/xml/tests/inc.ent b/ext/xml/tests/inc.ent deleted file mode 100644 index 8f86465c2ab0e..0000000000000 --- a/ext/xml/tests/inc.ent +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ext/xml/tests/skipif.inc b/ext/xml/tests/skipif.inc deleted file mode 100644 index 44898f3da63c2..0000000000000 --- a/ext/xml/tests/skipif.inc +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/ext/xml/tests/utf8_decode_error.phpt b/ext/xml/tests/utf8_decode_error.phpt deleted file mode 100644 index 6ece3223d90c9..0000000000000 --- a/ext/xml/tests/utf8_decode_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test utf8_decode() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing utf8_decode() : error conditions *** - --- Testing utf8_decode() function with Zero arguments -- - -Warning: Wrong parameter count for utf8_decode() in %s on line %d -NULL - --- Testing utf8_decode() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for utf8_decode() in %s on line %d -NULL -Done \ No newline at end of file diff --git a/ext/xml/tests/utf8_decode_variation1.phpt b/ext/xml/tests/utf8_decode_variation1.phpt deleted file mode 100644 index 64d50679379c1..0000000000000 --- a/ext/xml/tests/utf8_decode_variation1.phpt +++ /dev/null @@ -1,165 +0,0 @@ ---TEST-- -Test utf8_decode() function : usage variations - different types for data ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new aClass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for data - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( utf8_decode($value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing utf8_decode() : usage variations *** - -Arg value 0 -string(1) "0" - -Arg value 1 -string(1) "1" - -Arg value 12345 -string(5) "12345" - -Arg value -2345 -string(5) "-2345" - -Arg value 10.5 -string(4) "10.5" - -Arg value -10.5 -string(5) "-10.5" - -Arg value 101234567000 -string(12) "101234567000" - -Arg value 1.07654321E-9 -string(13) "1.07654321E-9" - -Arg value 0.5 -string(3) "0.5" - -Arg value Array -string(5) "Array" - -Arg value Array -string(5) "Array" - -Arg value Array -string(5) "Array" - -Arg value Array -string(5) "Array" - -Arg value Array -string(5) "Array" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value Some Ascii Data -string(15) "Some Ascii Data" - -Arg value -string(0) "" - -Arg value -string(0) "" -Done diff --git a/ext/xml/tests/utf8_encode_error.phpt b/ext/xml/tests/utf8_encode_error.phpt deleted file mode 100644 index ebc7dd29c36aa..0000000000000 --- a/ext/xml/tests/utf8_encode_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test utf8_encode() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing utf8_encode() : error conditions *** - --- Testing utf8_encode() function with Zero arguments -- - -Warning: Wrong parameter count for utf8_encode() in %s on line %d -NULL - --- Testing utf8_encode() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for utf8_encode() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/utf8_encode_variation1.phpt b/ext/xml/tests/utf8_encode_variation1.phpt deleted file mode 100644 index 3bb92afe2a205..0000000000000 --- a/ext/xml/tests/utf8_encode_variation1.phpt +++ /dev/null @@ -1,165 +0,0 @@ ---TEST-- -Test utf8_encode() function : usage variations - ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // object data - new aClass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for data - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( utf8_encode($value) ); -}; - -echo "Done"; -?> ---EXPECTF-- -*** Testing utf8_encode() : usage variations *** - -Arg value 0 -string(1) "0" - -Arg value 1 -string(1) "1" - -Arg value 12345 -string(5) "12345" - -Arg value -2345 -string(5) "-2345" - -Arg value 10.5 -string(4) "10.5" - -Arg value -10.5 -string(5) "-10.5" - -Arg value 101234567000 -string(12) "101234567000" - -Arg value 1.07654321E-9 -string(13) "1.07654321E-9" - -Arg value 0.5 -string(3) "0.5" - -Arg value Array -string(5) "Array" - -Arg value Array -string(5) "Array" - -Arg value Array -string(5) "Array" - -Arg value Array -string(5) "Array" - -Arg value Array -string(5) "Array" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value 1 -string(1) "1" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value -string(0) "" - -Arg value Some Ascii Data -string(15) "Some Ascii Data" - -Arg value -string(0) "" - -Arg value -string(0) "" -Done diff --git a/ext/xml/tests/xml001.phpt b/ext/xml/tests/xml001.phpt deleted file mode 100644 index 62d597c5f8e5a..0000000000000 --- a/ext/xml/tests/xml001.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -XML parser test, function callbacks ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- - ---EXPECT-- -{?[]}{?[ -]}{?[]}{?[ -]}{?[%incent;]}{?[ -]}{?[]]}{?[>]}{?[ -]}{ROOT ID="elem1"}{CDATA[ -]}{CDATA[ Plain text.]}{CDATA[ -]}{CDATA[ ]}{ELEM1}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM2}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM3}{CDATA[ -]}{CDATA[ ]}{ENTREF[&included-entity;]}{CDATA[ -]}{CDATA[ ]}{ELEM4}{CDATA[ -]}{CDATA[ ]}{PI[test,processing instruction ]}{CDATA[ -]}{CDATA[ ]}{/ELEM4}{CDATA[ -]}{CDATA[ ]}{/ELEM3}{CDATA[ -]}{CDATA[ ]}{/ELEM2}{CDATA[ -]}{CDATA[ ]}{/ELEM1}{CDATA[ -]}{/ROOT}{?[ -]}parse complete diff --git a/ext/xml/tests/xml002.phpt b/ext/xml/tests/xml002.phpt deleted file mode 100644 index 8ae8dfbe66d12..0000000000000 --- a/ext/xml/tests/xml002.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -XML parser test, object tuple callbacks ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- - ---EXPECT-- -{?[]}{?[ -]}{?[]}{?[ -]}{?[%incent;]}{?[ -]}{?[]]}{?[>]}{?[ -]}{ROOT ID="elem1"}{CDATA[ -]}{CDATA[ Plain text.]}{CDATA[ -]}{CDATA[ ]}{ELEM1}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM2}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM3}{CDATA[ -]}{CDATA[ ]}{ENTREF[&included-entity;]}{CDATA[ -]}{CDATA[ ]}{ELEM4}{CDATA[ -]}{CDATA[ ]}{PI[test,processing instruction ]}{CDATA[ -]}{CDATA[ ]}{/ELEM4}{CDATA[ -]}{CDATA[ ]}{/ELEM3}{CDATA[ -]}{CDATA[ ]}{/ELEM2}{CDATA[ -]}{CDATA[ ]}{/ELEM1}{CDATA[ -]}{/ROOT}{?[ -]}parse complete diff --git a/ext/xml/tests/xml003.phpt b/ext/xml/tests/xml003.phpt deleted file mode 100644 index 311c81acfbf46..0000000000000 --- a/ext/xml/tests/xml003.phpt +++ /dev/null @@ -1,98 +0,0 @@ ---TEST-- -XML parser test, xml_set_object callbacks ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- - ---EXPECT-- -{?[]}{?[ -]}{?[]}{?[ -]}{?[%incent;]}{?[ -]}{?[]]}{?[>]}{?[ -]}{ROOT ID="elem1"}{CDATA[ -]}{CDATA[ Plain text.]}{CDATA[ -]}{CDATA[ ]}{ELEM1}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM2}{CDATA[ -]}{CDATA[ ]}{?[]}{CDATA[ -]}{CDATA[ ]}{ELEM3}{CDATA[ -]}{CDATA[ ]}{ENTREF[&included-entity;]}{CDATA[ -]}{CDATA[ ]}{ELEM4}{CDATA[ -]}{CDATA[ ]}{PI[test,processing instruction ]}{CDATA[ -]}{CDATA[ ]}{/ELEM4}{CDATA[ -]}{CDATA[ ]}{/ELEM3}{CDATA[ -]}{CDATA[ ]}{/ELEM2}{CDATA[ -]}{CDATA[ ]}{/ELEM1}{CDATA[ -]}{/ROOT}{?[ -]}parse complete diff --git a/ext/xml/tests/xml004.phpt b/ext/xml/tests/xml004.phpt deleted file mode 100644 index 78840ee122762..0000000000000 --- a/ext/xml/tests/xml004.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -XML parser case folding test ---SKIPIF-- - ---INI-- -magic_quotes_runtime=0 ---FILE-- -\n"; -} - -function end_element($xp, $elem) -{ - print "\n"; -} -?> ---EXPECT-- - - - - - - - - - - - - - - - - - - - - diff --git a/ext/xml/tests/xml006.phpt b/ext/xml/tests/xml006.phpt deleted file mode 100644 index c714e85913979..0000000000000 --- a/ext/xml/tests/xml006.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -UTF-8<->ISO Latin 1 encoding/decoding test ---SKIPIF-- - ---FILE-- - %s\n", urlencode("æ"), urlencode(utf8_encode("æ"))); -printf("%s <- %s\n", urlencode(utf8_decode(urldecode("%C3%A6"))), "%C3%A6"); -?> ---EXPECT-- -%E6 -> %C3%A6 -%E6 <- %C3%A6 diff --git a/ext/xml/tests/xml007.phpt b/ext/xml/tests/xml007.phpt deleted file mode 100644 index 377475bb1c5b7..0000000000000 --- a/ext/xml/tests/xml007.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -xml_parse_into_struct/umlauts in tags ---SKIPIF-- - ---FILE-- -<äöü üäß="Üäß">ÄÖÜ'; -$parser = xml_parser_create('ISO-8859-1'); -xml_set_element_handler($parser, "startHandler", "endHandler"); -xml_parse_into_struct($parser, $xmldata, $struct, $index); -var_dump($struct); -?> ---EXPECT-- -string(3) "ÄÖÜ" -array(1) { - ["ÜÄß"]=> - string(3) "Üäß" -} -string(3) "ÄÖÜ" -array(1) { - [0]=> - array(5) { - ["tag"]=> - string(3) "ÄÖÜ" - ["type"]=> - string(8) "complete" - ["level"]=> - int(1) - ["attributes"]=> - array(1) { - ["ÜÄß"]=> - string(3) "Üäß" - } - ["value"]=> - string(3) "ÄÖÜ" - } -} diff --git a/ext/xml/tests/xml009.phpt b/ext/xml/tests/xml009.phpt deleted file mode 100644 index 84b89bb48802a..0000000000000 --- a/ext/xml/tests/xml009.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -XML parser test, default namespaces ---SKIPIF-- - ---FILE-- - - - - -HERE; - -$parser = xml_parser_create_ns("ISO-8859-1","@"); -xml_set_element_handler($parser,'start_elem','end_elem'); -xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); -xml_parse($parser, $xml); -xml_parser_free($parser); -?> ---EXPECT-- -string(24) "http://example.com/foo@a" -string(24) "http://example.com/bar@b" -string(24) "http://example.com/foo@c" diff --git a/ext/xml/tests/xml010.phpt b/ext/xml/tests/xml010.phpt deleted file mode 100644 index e968442123423..0000000000000 --- a/ext/xml/tests/xml010.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -XML parser test, attributes ---SKIPIF-- - ---FILE-- - $value) { - print "$key = $value "; - } - print "\n"; -} -function end_elem() -{ -} - -$xml = << - - - -HERE; - -$parser = xml_parser_create_ns("ISO-8859-1","@"); -xml_set_element_handler($parser,'start_elem','end_elem'); -xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); -xml_parse($parser, $xml); -xml_parser_free($parser); -?> ---EXPECT-- -http://example.com/foo@a -http://example.com/bar@b foo = bar -http://example.com/bar@c http://example.com/bar@nix = null foo = bar diff --git a/ext/xml/tests/xml011.phpt b/ext/xml/tests/xml011.phpt deleted file mode 100644 index 9c4cfca8f14ac..0000000000000 --- a/ext/xml/tests/xml011.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -XML Parser test: concat character data and set empty handlers ---SKIPIF-- - ---FILE-- -"; -} -function end_elem() -{ - echo ""; -} - -$xml = 'start This & that'; - -$parser = xml_parser_create(); -xml_parse_into_struct($parser, $xml, $vals, $index); -print_r($vals); -xml_parser_free($parser); - -echo "\nChange to empty end handler\n"; -$parser = xml_parser_create(); -xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); -xml_set_element_handler($parser,'start_elem','end_elem'); -xml_set_element_handler($parser,'start_elem',NULL); -xml_parse($parser, $xml, TRUE); - -xml_parser_free($parser); -echo "\nDone\n"; -?> ---EXPECT-- -Array -( - [0] => Array - ( - [tag] => TEXT - [type] => open - [level] => 1 - [value] => start - ) - - [1] => Array - ( - [tag] => B - [type] => complete - [level] => 2 - ) - - [2] => Array - ( - [tag] => TEXT - [value] => This & that - [type] => cdata - [level] => 1 - ) - - [3] => Array - ( - [tag] => TEXT - [type] => close - [level] => 1 - ) - -) - -Change to empty end handler - -Done diff --git a/ext/xml/tests/xml_error_string_error.phpt b/ext/xml/tests/xml_error_string_error.phpt deleted file mode 100644 index 4c8f25476840c..0000000000000 --- a/ext/xml/tests/xml_error_string_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test xml_error_string() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_error_string() : error conditions *** - --- Testing xml_error_string() function with Zero arguments -- - -Warning: Wrong parameter count for xml_error_string() in %s on line %d -NULL - --- Testing xml_error_string() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_error_string() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_error_string_variation1.phpt b/ext/xml/tests/xml_error_string_variation1.phpt deleted file mode 100644 index b4a167c44ad46..0000000000000 --- a/ext/xml/tests/xml_error_string_variation1.phpt +++ /dev/null @@ -1,157 +0,0 @@ ---TEST-- -Test xml_error_string() function : usage variations - test different types for code ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for code - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_error_string($value) ); -}; - -echo "Done"; -?> ---EXPECT-- -*** Testing xml_error_string() : usage variations *** - -Arg value 10.5 -string(22) "XML_ERR_CHARREF_AT_EOF" - -Arg value -10.5 -string(7) "Unknown" - -Arg value 101234567000 -string(7) "Unknown" - -Arg value 1.07654321E-9 -string(8) "No error" - -Arg value 0.5 -string(8) "No error" - -Arg value Array -string(8) "No error" - -Arg value Array -string(14) "Internal error" - -Arg value Array -string(14) "Internal error" - -Arg value Array -string(14) "Internal error" - -Arg value Array -string(14) "Internal error" - -Arg value -string(8) "No error" - -Arg value -string(8) "No error" - -Arg value 1 -string(14) "Internal error" - -Arg value -string(8) "No error" - -Arg value 1 -string(14) "Internal error" - -Arg value -string(8) "No error" - -Arg value -string(8) "No error" - -Arg value -string(8) "No error" - -Arg value string -string(8) "No error" - -Arg value string -string(8) "No error" - -Arg value Some Ascii Data -string(14) "Internal error" - -Arg value -string(8) "No error" - -Arg value -string(8) "No error" -Done diff --git a/ext/xml/tests/xml_get_current_byte_index_error.phpt b/ext/xml/tests/xml_get_current_byte_index_error.phpt deleted file mode 100644 index d9001e65b5106..0000000000000 --- a/ext/xml/tests/xml_get_current_byte_index_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test xml_get_current_byte_index() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_get_current_byte_index() : error conditions *** - --- Testing xml_get_current_byte_index() function with Zero arguments -- - -Warning: Wrong parameter count for xml_get_current_byte_index() in %s on line %d -NULL - --- Testing xml_get_current_byte_index() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_get_current_byte_index() in %s on line %d -NULL -Done \ No newline at end of file diff --git a/ext/xml/tests/xml_get_current_byte_index_variation1.phpt b/ext/xml/tests/xml_get_current_byte_index_variation1.phpt deleted file mode 100644 index 2c0df15e1197b..0000000000000 --- a/ext/xml/tests/xml_get_current_byte_index_variation1.phpt +++ /dev/null @@ -1,239 +0,0 @@ ---TEST-- -Test xml_get_current_byte_index() function : usage variations - ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_get_current_byte_index($value) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_get_current_byte_index() : usage variations *** - -Arg value 0 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_get_current_byte_index(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_byte_index(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_get_current_column_number_error.phpt b/ext/xml/tests/xml_get_current_column_number_error.phpt deleted file mode 100644 index 5d47c4cd162cc..0000000000000 --- a/ext/xml/tests/xml_get_current_column_number_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test xml_get_current_column_number() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_get_current_column_number() : error conditions *** - --- Testing xml_get_current_column_number() function with Zero arguments -- - -Warning: Wrong parameter count for xml_get_current_column_number() in %s on line %d -NULL - --- Testing xml_get_current_column_number() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_get_current_column_number() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_get_current_column_number_variation1.phpt b/ext/xml/tests/xml_get_current_column_number_variation1.phpt deleted file mode 100644 index babc16c642dd4..0000000000000 --- a/ext/xml/tests/xml_get_current_column_number_variation1.phpt +++ /dev/null @@ -1,240 +0,0 @@ ---TEST-- -Test xml_get_current_column_number() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_get_current_column_number($value) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_get_current_column_number() : usage variations *** - -Arg value 0 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_get_current_column_number(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_column_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_get_current_line_number_error.phpt b/ext/xml/tests/xml_get_current_line_number_error.phpt deleted file mode 100644 index 7c8e244905b7d..0000000000000 --- a/ext/xml/tests/xml_get_current_line_number_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test xml_get_current_line_number() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_get_current_line_number() : error conditions *** - --- Testing xml_get_current_line_number() function with Zero arguments -- - -Warning: Wrong parameter count for xml_get_current_line_number() in %s on line %d -NULL - --- Testing xml_get_current_line_number() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_get_current_line_number() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_get_current_line_number_variation1.phpt b/ext/xml/tests/xml_get_current_line_number_variation1.phpt deleted file mode 100644 index c13fd5488efbf..0000000000000 --- a/ext/xml/tests/xml_get_current_line_number_variation1.phpt +++ /dev/null @@ -1,239 +0,0 @@ ---TEST-- -Test xml_get_current_line_number() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_get_current_line_number($value) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_get_current_line_number() : usage variations *** - -Arg value 0 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_get_current_line_number(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_current_line_number(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done \ No newline at end of file diff --git a/ext/xml/tests/xml_get_error_code_error.phpt b/ext/xml/tests/xml_get_error_code_error.phpt deleted file mode 100644 index 7007a46fb737b..0000000000000 --- a/ext/xml/tests/xml_get_error_code_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test xml_get_error_code() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_get_error_code() : error conditions *** - --- Testing xml_get_error_code() function with Zero arguments -- - -Warning: Wrong parameter count for xml_get_error_code() in %s on line %d -NULL - --- Testing xml_get_error_code() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_get_error_code() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_get_error_code_variation1.phpt b/ext/xml/tests/xml_get_error_code_variation1.phpt deleted file mode 100644 index 51a7aeed53ebd..0000000000000 --- a/ext/xml/tests/xml_get_error_code_variation1.phpt +++ /dev/null @@ -1,239 +0,0 @@ ---TEST-- -Test xml_get_error_code() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_get_error_code($value) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_get_error_code() : usage variations *** - -Arg value 0 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_get_error_code(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_get_error_code(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_parse_error.phpt b/ext/xml/tests/xml_parse_error.phpt deleted file mode 100644 index 82d01a43ec274..0000000000000 --- a/ext/xml/tests/xml_parse_error.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test xml_parse() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_parse() : error conditions *** - --- Testing xml_parse() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_parse() in %s on line %d -NULL - --- Testing xml_parse() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_parse() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_parse_into_struct_error.phpt b/ext/xml/tests/xml_parse_into_struct_error.phpt deleted file mode 100644 index c2512f6a0a207..0000000000000 --- a/ext/xml/tests/xml_parse_into_struct_error.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Test xml_parse_into_struct() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_parse_into_struct() : error conditions *** - --- Testing xml_parse_into_struct() function with more than expected no. of arguments -- - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - --- Testing xml_parse_into_struct() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_parse_into_struct() in %s on line %d -NULL -Done \ No newline at end of file diff --git a/ext/xml/tests/xml_parse_into_struct_variation.phpt b/ext/xml/tests/xml_parse_into_struct_variation.phpt deleted file mode 100644 index a353e51419641..0000000000000 --- a/ext/xml/tests/xml_parse_into_struct_variation.phpt +++ /dev/null @@ -1,120 +0,0 @@ ---TEST-- -Test xml_parse_into_struct() function : variation ---SKIPIF-- - ---FILE-- -simple notesimple note
"; -$p = xml_parser_create(); -xml_parse_into_struct($p, $simple, $vals, $index); -xml_parser_free($p); -echo "Index array\n"; -print_r($index); -echo "\nVals array\n"; -print_r($vals); - - -echo "Done"; -?> ---EXPECT-- -*** Testing xml_parse_into_struct() : variation *** -Index array -Array -( - [MAIN] => Array - ( - [0] => 0 - [1] => 7 - ) - - [PARA] => Array - ( - [0] => 1 - [1] => 3 - [2] => 4 - [3] => 6 - ) - - [NOTE] => Array - ( - [0] => 2 - [1] => 5 - ) - -) - -Vals array -Array -( - [0] => Array - ( - [tag] => MAIN - [type] => open - [level] => 1 - ) - - [1] => Array - ( - [tag] => PARA - [type] => open - [level] => 2 - ) - - [2] => Array - ( - [tag] => NOTE - [type] => complete - [level] => 3 - [value] => simple note - ) - - [3] => Array - ( - [tag] => PARA - [type] => close - [level] => 2 - ) - - [4] => Array - ( - [tag] => PARA - [type] => open - [level] => 2 - ) - - [5] => Array - ( - [tag] => NOTE - [type] => complete - [level] => 3 - [value] => simple note - ) - - [6] => Array - ( - [tag] => PARA - [type] => close - [level] => 2 - ) - - [7] => Array - ( - [tag] => MAIN - [type] => close - [level] => 1 - ) - -) -Done \ No newline at end of file diff --git a/ext/xml/tests/xml_parse_into_struct_variation1.phpt b/ext/xml/tests/xml_parse_into_struct_variation1.phpt deleted file mode 100644 index 2ce679e5cd632..0000000000000 --- a/ext/xml/tests/xml_parse_into_struct_variation1.phpt +++ /dev/null @@ -1,240 +0,0 @@ ---TEST-- -Test xml_parse_into_struct() function : usage variations - different types for parser ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_parse_into_struct($value, $data, $struct, $index) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parse_into_struct() : usage variations *** - -Arg value 0 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_parse_into_struct(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse_into_struct(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_parse_variation1.phpt b/ext/xml/tests/xml_parse_variation1.phpt deleted file mode 100644 index 3ea494a6f140d..0000000000000 --- a/ext/xml/tests/xml_parse_variation1.phpt +++ /dev/null @@ -1,241 +0,0 @@ ---TEST-- -Test xml_parse() function : usage variations - different types of parser ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_parse($value, $data, $isFinal) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parse() : usage variations *** - -Arg value 0 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_parse(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parse(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_parser_create_error.phpt b/ext/xml/tests/xml_parser_create_error.phpt deleted file mode 100644 index 571350e873bb4..0000000000000 --- a/ext/xml/tests/xml_parser_create_error.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test xml_parser_create() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_parser_create() : error conditions *** - --- Testing xml_parser_create() function with more than expected no. of arguments -- - -Warning: xml_parser_create() expects at most 1 parameter, 2 given in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_parser_create_ns_error.phpt b/ext/xml/tests/xml_parser_create_ns_error.phpt deleted file mode 100644 index fd50f29488f76..0000000000000 --- a/ext/xml/tests/xml_parser_create_ns_error.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test xml_parser_create_ns() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_parser_create_ns() : error conditions *** - --- Testing xml_parser_create_ns() function with more than expected no. of arguments -- - -Warning: xml_parser_create_ns() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -Done \ No newline at end of file diff --git a/ext/xml/tests/xml_parser_create_ns_variation1.phpt b/ext/xml/tests/xml_parser_create_ns_variation1.phpt deleted file mode 100644 index 5446a4f3eeec8..0000000000000 --- a/ext/xml/tests/xml_parser_create_ns_variation1.phpt +++ /dev/null @@ -1,245 +0,0 @@ ---TEST-- -Test xml_parser_create_ns() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - "ISO-8859-1", - "UTF-8", - "US-ASCII", - "UTF-32", - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for encoding - -foreach($values as $value) { - echo "\nArg value $value \n"; - $res = xml_parser_create_ns($value); - var_dump($res); - if ($res !== false) { - xml_parser_free($res); - } -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parser_create_ns() : usage variations *** - -Arg value 0 - -Warning: xml_parser_create_ns(): unsupported source encoding "0" in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_create_ns(): unsupported source encoding "1" in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_parser_create_ns(): unsupported source encoding "12345" in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_parser_create_ns(): unsupported source encoding "-2345" in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_parser_create_ns(): unsupported source encoding "10.5" in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_parser_create_ns(): unsupported source encoding "-10.5" in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_parser_create_ns(): unsupported source encoding "101234567000" in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_parser_create_ns(): unsupported source encoding "1.07654321E-9" in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_parser_create_ns(): unsupported source encoding "0.5" in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create_ns() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create_ns() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create_ns() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create_ns() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create_ns() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value -resource(%d) of type (xml) - -Arg value -resource(%d) of type (xml) - -Arg value 1 - -Warning: xml_parser_create_ns(): unsupported source encoding "1" in %s on line %d -bool(false) - -Arg value -resource(%d) of type (xml) - -Arg value 1 - -Warning: xml_parser_create_ns(): unsupported source encoding "1" in %s on line %d -bool(false) - -Arg value -resource(%d) of type (xml) - -Arg value -resource(%d) of type (xml) - -Arg value -resource(%d) of type (xml) - -Arg value string - -Warning: xml_parser_create_ns(): unsupported source encoding "string" in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_create_ns(): unsupported source encoding "string" in %s on line %d -bool(false) - -Arg value ISO-8859-1 -resource(%d) of type (xml) - -Arg value UTF-8 -resource(%d) of type (xml) - -Arg value US-ASCII -resource(%d) of type (xml) - -Arg value UTF-32 - -Warning: xml_parser_create_ns(): unsupported source encoding "UTF-32" in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_parser_create_ns(): unsupported source encoding "Some Ascii Data" in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_parser_create_ns() expects parameter 1 to be string, resource given in %s on line %d -bool(false) - -Arg value -resource(%d) of type (xml) - -Arg value -resource(%d) of type (xml) -Done diff --git a/ext/xml/tests/xml_parser_create_variation1.phpt b/ext/xml/tests/xml_parser_create_variation1.phpt deleted file mode 100644 index 445b40d08e907..0000000000000 --- a/ext/xml/tests/xml_parser_create_variation1.phpt +++ /dev/null @@ -1,245 +0,0 @@ ---TEST-- -Test xml_parser_create() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - "ISO-8859-1", - "UTF-8", - "US-ASCII", - "UTF-32", - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for encoding - -foreach($values as $value) { - echo "\nArg value $value \n"; - $res = xml_parser_create($value); - var_dump($res); - if ($res !== false) { - xml_parser_free($res); - } -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parser_create() : usage variations *** - -Arg value 0 - -Warning: xml_parser_create(): unsupported source encoding "0" in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_create(): unsupported source encoding "1" in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_parser_create(): unsupported source encoding "12345" in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_parser_create(): unsupported source encoding "-2345" in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_parser_create(): unsupported source encoding "10.5" in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_parser_create(): unsupported source encoding "-10.5" in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_parser_create(): unsupported source encoding "101234567000" in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_parser_create(): unsupported source encoding "1.07654321E-9" in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_parser_create(): unsupported source encoding "0.5" in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_create() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Arg value -resource(%d) of type (xml) - -Arg value -resource(%d) of type (xml) - -Arg value 1 - -Warning: xml_parser_create(): unsupported source encoding "1" in %s on line %d -bool(false) - -Arg value -resource(%d) of type (xml) - -Arg value 1 - -Warning: xml_parser_create(): unsupported source encoding "1" in %s on line %d -bool(false) - -Arg value -resource(%d) of type (xml) - -Arg value -resource(%d) of type (xml) - -Arg value -resource(%d) of type (xml) - -Arg value string - -Warning: xml_parser_create(): unsupported source encoding "string" in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_create(): unsupported source encoding "string" in %s on line %d -bool(false) - -Arg value ISO-8859-1 -resource(%d) of type (xml) - -Arg value UTF-8 -resource(%d) of type (xml) - -Arg value US-ASCII -resource(%d) of type (xml) - -Arg value UTF-32 - -Warning: xml_parser_create(): unsupported source encoding "UTF-32" in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_parser_create(): unsupported source encoding "Some Ascii Data" in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_parser_create() expects parameter 1 to be string, resource given in %s on line %d -bool(false) - -Arg value -resource(%d) of type (xml) - -Arg value -resource(%d) of type (xml) -Done \ No newline at end of file diff --git a/ext/xml/tests/xml_parser_free_error.phpt b/ext/xml/tests/xml_parser_free_error.phpt deleted file mode 100644 index a28940ae55518..0000000000000 --- a/ext/xml/tests/xml_parser_free_error.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Test xml_parser_free() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_parser_free() : error conditions *** - --- Testing xml_parser_free() function with Zero arguments -- - -Warning: Wrong parameter count for xml_parser_free() in %s on line %d -NULL - --- Testing xml_parser_free() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_parser_free() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_parser_free_variation1.phpt b/ext/xml/tests/xml_parser_free_variation1.phpt deleted file mode 100644 index b6feadd9997ae..0000000000000 --- a/ext/xml/tests/xml_parser_free_variation1.phpt +++ /dev/null @@ -1,239 +0,0 @@ ---TEST-- -Test xml_parser_free() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_parser_free($value) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parser_free() : usage variations *** - -Arg value 0 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_parser_free(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_free(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_parser_get_option_error.phpt b/ext/xml/tests/xml_parser_get_option_error.phpt deleted file mode 100644 index 354329f7e39dd..0000000000000 --- a/ext/xml/tests/xml_parser_get_option_error.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test xml_parser_get_option() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_parser_get_option() : error conditions *** - --- Testing xml_parser_get_option() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_parser_get_option() in %s on line %d -NULL - --- Testing xml_parser_get_option() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_parser_get_option() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_parser_get_option_variation1.phpt b/ext/xml/tests/xml_parser_get_option_variation1.phpt deleted file mode 100644 index 8d16e742ad0b3..0000000000000 --- a/ext/xml/tests/xml_parser_get_option_variation1.phpt +++ /dev/null @@ -1,240 +0,0 @@ ---TEST-- -Test xml_parser_get_option() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_parser_get_option($value, $option) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parser_get_option() : usage variations *** - -Arg value 0 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_parser_get_option(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_parser_get_option_variation2.phpt b/ext/xml/tests/xml_parser_get_option_variation2.phpt deleted file mode 100644 index 4d6d9924a41c8..0000000000000 --- a/ext/xml/tests/xml_parser_get_option_variation2.phpt +++ /dev/null @@ -1,215 +0,0 @@ ---TEST-- -Test xml_parser_get_option() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for option - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_parser_get_option($parser, $value) ); -}; - -fclose($fp); -xml_parser_free($parser); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parser_get_option() : usage variations *** - -Arg value 12345 - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value Array -int(1) - -Arg value Array -int(1) - -Arg value Array -int(1) - -Arg value Array -int(1) - -Arg value - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value 1 -int(1) - -Arg value - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value 1 -int(1) - -Arg value - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value Some Ascii Data -int(1) - -Arg value Resource id %s - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_get_option(): Unknown option in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_parser_set_option_basic.phpt b/ext/xml/tests/xml_parser_set_option_basic.phpt deleted file mode 100644 index 61316a4b0fe65..0000000000000 --- a/ext/xml/tests/xml_parser_set_option_basic.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test xml_set_notation_decl_handler function : basic ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Simple testcase for xml_parser_get_option() function -int(1) -string(5) "UTF-8" -bool(true) -bool(true) -int(1) -string(10) "ISO-8859-1" -bool(true) -bool(true) -int(0) -string(5) "UTF-8" -bool(true) -string(8) "US-ASCII" -Done diff --git a/ext/xml/tests/xml_parser_set_option_error.phpt b/ext/xml/tests/xml_parser_set_option_error.phpt deleted file mode 100644 index 6b2b426f171a8..0000000000000 --- a/ext/xml/tests/xml_parser_set_option_error.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Test xml_parser_set_option() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_parser_set_option() : error conditions *** - --- Testing xml_parser_set_option() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_parser_set_option() in %s on line %d -NULL - --- Testing xml_parser_set_option() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_parser_set_option() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_parser_set_option_variation1.phpt b/ext/xml/tests/xml_parser_set_option_variation1.phpt deleted file mode 100644 index 90058bf7fa6d1..0000000000000 --- a/ext/xml/tests/xml_parser_set_option_variation1.phpt +++ /dev/null @@ -1,240 +0,0 @@ ---TEST-- -Test xml_parser_set_option() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_parser_set_option($value, $option, 1) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parser_set_option() : usage variations *** - -Arg value 0 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_parser_set_option(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_parser_set_option_variation2.phpt b/ext/xml/tests/xml_parser_set_option_variation2.phpt deleted file mode 100644 index 93d87a6f7ac85..0000000000000 --- a/ext/xml/tests/xml_parser_set_option_variation2.phpt +++ /dev/null @@ -1,204 +0,0 @@ ---TEST-- -Test xml_parser_set_option() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for option - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_parser_set_option($parser, $value, 1) ); -}; - -xml_parser_free($parser); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parser_set_option() : usage variations *** - -Arg value 12345 - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value Array -bool(true) - -Arg value Array -bool(true) - -Arg value Array -bool(true) - -Arg value Array -bool(true) - -Arg value - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value 1 -bool(true) - -Arg value - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value 1 -bool(true) - -Arg value - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value string - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value Some Ascii Data -bool(true) - -Arg value - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) - -Arg value - -Warning: xml_parser_set_option(): Unknown option in %s on line %d -bool(false) -Done \ No newline at end of file diff --git a/ext/xml/tests/xml_parser_set_option_variation3.phpt b/ext/xml/tests/xml_parser_set_option_variation3.phpt deleted file mode 100644 index 5f98803905380..0000000000000 --- a/ext/xml/tests/xml_parser_set_option_variation3.phpt +++ /dev/null @@ -1,187 +0,0 @@ ---TEST-- -Test xml_parser_set_option() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for value - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_parser_set_option($parser, $option, $value) ); -}; - -fclose($fp); -xml_parser_free($parser); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_parser_set_option() : usage variations *** - -Arg value 0 -bool(true) - -Arg value 1 -bool(true) - -Arg value 12345 -bool(true) - -Arg value -2345 -bool(true) - -Arg value 10.5 -bool(true) - -Arg value -10.5 -bool(true) - -Arg value 101234567000 -bool(true) - -Arg value 1.07654321E-9 -bool(true) - -Arg value 0.5 -bool(true) - -Arg value Array -bool(true) - -Arg value Array -bool(true) - -Arg value Array -bool(true) - -Arg value Array -bool(true) - -Arg value Array -bool(true) - -Arg value -bool(true) - -Arg value -bool(true) - -Arg value 1 -bool(true) - -Arg value -bool(true) - -Arg value 1 -bool(true) - -Arg value -bool(true) - -Arg value -bool(true) - -Arg value -bool(true) - -Arg value string -bool(true) - -Arg value string -bool(true) - -Arg value Some Ascii Data -bool(true) - -Arg value Resource id %s -bool(true) - -Arg value -bool(true) - -Arg value -bool(true) -Done diff --git a/ext/xml/tests/xml_set_character_data_handler_error.phpt b/ext/xml/tests/xml_set_character_data_handler_error.phpt deleted file mode 100644 index 23fb9a23cf1b4..0000000000000 --- a/ext/xml/tests/xml_set_character_data_handler_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test xml_set_character_data_handler() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_character_data_handler() : error conditions *** - --- Testing xml_set_character_data_handler() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_character_data_handler() in %s on line %d -NULL - --- Testing xml_set_character_data_handler() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_character_data_handler() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_character_data_handler_variation1.phpt b/ext/xml/tests/xml_set_character_data_handler_variation1.phpt deleted file mode 100644 index 0609700116217..0000000000000 --- a/ext/xml/tests/xml_set_character_data_handler_variation1.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test xml_set_character_data_handler() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_character_data_handler($value, $hdl) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_character_data_handler() : usage variations *** - -Arg value 0 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_character_data_handler(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_character_data_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_default_handler_error.phpt b/ext/xml/tests/xml_set_default_handler_error.phpt deleted file mode 100644 index 91d1c3da30d4e..0000000000000 --- a/ext/xml/tests/xml_set_default_handler_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test xml_set_default_handler() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_default_handler() : error conditions *** - --- Testing xml_set_default_handler() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_default_handler() in %s on line %d -NULL - --- Testing xml_set_default_handler() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_default_handler() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_default_handler_variation1.phpt b/ext/xml/tests/xml_set_default_handler_variation1.phpt deleted file mode 100644 index 77903f746b4a5..0000000000000 --- a/ext/xml/tests/xml_set_default_handler_variation1.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test xml_set_default_handler() function : usage variations - test different types for parser ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_default_handler($value, $hdl) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_default_handler() : usage variations *** - -Arg value 0 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_default_handler(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_default_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_element_handler_error.phpt b/ext/xml/tests/xml_set_element_handler_error.phpt deleted file mode 100644 index a3315dc44a65c..0000000000000 --- a/ext/xml/tests/xml_set_element_handler_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test xml_set_element_handler() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_element_handler() : error conditions *** - --- Testing xml_set_element_handler() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_element_handler() in %s on line %d -NULL - --- Testing xml_set_element_handler() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_element_handler() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_element_handler_variation1.phpt b/ext/xml/tests/xml_set_element_handler_variation1.phpt deleted file mode 100644 index d2c318052c3db..0000000000000 --- a/ext/xml/tests/xml_set_element_handler_variation1.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test xml_set_element_handler() function : usage variations - test different types for parser ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_element_handler($value, $hdl, $hdl) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_element_handler() : usage variations *** - -Arg value 0 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_element_handler(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_element_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_end_namespace_decl_handler_error.phpt b/ext/xml/tests/xml_set_end_namespace_decl_handler_error.phpt deleted file mode 100644 index e6df90b7ab9f3..0000000000000 --- a/ext/xml/tests/xml_set_end_namespace_decl_handler_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test xml_set_end_namespace_decl_handler() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_end_namespace_decl_handler() : error conditions *** - --- Testing xml_set_end_namespace_decl_handler() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_end_namespace_decl_handler() in %s on line %d -NULL - --- Testing xml_set_end_namespace_decl_handler() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_end_namespace_decl_handler() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_end_namespace_decl_handler_variation1.phpt b/ext/xml/tests/xml_set_end_namespace_decl_handler_variation1.phpt deleted file mode 100644 index 3951c45811f6e..0000000000000 --- a/ext/xml/tests/xml_set_end_namespace_decl_handler_variation1.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test xml_set_end_namespace_decl_handler() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_end_namespace_decl_handler($value, $hdl) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_end_namespace_decl_handler() : usage variations *** - -Arg value 0 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_end_namespace_decl_handler(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_end_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_external_entity_ref_handler_error.phpt b/ext/xml/tests/xml_set_external_entity_ref_handler_error.phpt deleted file mode 100644 index 0f4dc435e7285..0000000000000 --- a/ext/xml/tests/xml_set_external_entity_ref_handler_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test xml_set_external_entity_ref_handler() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_external_entity_ref_handler() : error conditions *** - --- Testing xml_set_external_entity_ref_handler() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_external_entity_ref_handler() in %s on line %d -NULL - --- Testing xml_set_external_entity_ref_handler() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_external_entity_ref_handler() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_external_entity_ref_handler_variation1.phpt b/ext/xml/tests/xml_set_external_entity_ref_handler_variation1.phpt deleted file mode 100644 index dfb9fa6107d57..0000000000000 --- a/ext/xml/tests/xml_set_external_entity_ref_handler_variation1.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test xml_set_external_entity_ref_handler() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_external_entity_ref_handler($value, $hdl) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_external_entity_ref_handler() : usage variations *** - -Arg value 0 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_external_entity_ref_handler(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_external_entity_ref_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_notation_decl_handler_basic.phpt b/ext/xml/tests/xml_set_notation_decl_handler_basic.phpt deleted file mode 100644 index 6616681ff8b86..0000000000000 --- a/ext/xml/tests/xml_set_notation_decl_handler_basic.phpt +++ /dev/null @@ -1,102 +0,0 @@ ---TEST-- -Test xml_set_notation_decl_handler function : basic ---SKIPIF-- - ---FILE-- - - - - - - - ]> -]> -HERE; - -echo "Simple test of xml_set_notation_decl_handler(() function\n"; -$p1 = new Xml_Parser(); -$p1->parse($xml); -echo "Done\n"; -?> ---EXPECT-- -Simple test of xml_set_notation_decl_handler(() function -notation_decl_handler called -...Name=USDATE -...Base= -...System ID=http://www.schema.net/usdate.not -...Public ID= -notation_decl_handler called -...Name=AUSDATE -...Base= -...System ID=http://www.schema.net/ausdate.not -...Public ID= -notation_decl_handler called -...Name=ISODATE -...Base= -...System ID=http://www.schema.net/isodate.not -...Public ID= -unparsed_entity_decl_handler called -...Entity name=testUS -...Base= -...System ID=test_usdate.xml -...Public ID= -...Notation name=USDATE -unparsed_entity_decl_handler called -...Entity name=testAUS -...Base= -...System ID=test_ausdate.xml -...Public ID= -...Notation name=AUSDATE -unparsed_entity_decl_handler called -...Entity name=testISO -...Base= -...System ID=test_isodate_xml -...Public ID= -...Notation name=ISODATE -Done diff --git a/ext/xml/tests/xml_set_notation_decl_handler_error.phpt b/ext/xml/tests/xml_set_notation_decl_handler_error.phpt deleted file mode 100644 index f84202416a565..0000000000000 --- a/ext/xml/tests/xml_set_notation_decl_handler_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test xml_set_notation_decl_handler() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_notation_decl_handler() : error conditions *** - --- Testing xml_set_notation_decl_handler() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_notation_decl_handler() in %s on line %d -NULL - --- Testing xml_set_notation_decl_handler() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_notation_decl_handler() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_notation_decl_handler_variation1.phpt b/ext/xml/tests/xml_set_notation_decl_handler_variation1.phpt deleted file mode 100644 index 450e7d9d646b4..0000000000000 --- a/ext/xml/tests/xml_set_notation_decl_handler_variation1.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test xml_set_notation_decl_handler() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_notation_decl_handler($value, $hdl) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_notation_decl_handler() : usage variations *** - -Arg value 0 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_notation_decl_handler(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_notation_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_object_error.phpt b/ext/xml/tests/xml_set_object_error.phpt deleted file mode 100644 index 3d16d35f8c461..0000000000000 --- a/ext/xml/tests/xml_set_object_error.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Test xml_set_object() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_object() : error conditions *** - --- Testing xml_set_object() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_object() in %s on line %d -NULL - --- Testing xml_set_object() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_object() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_object_variation1.phpt b/ext/xml/tests/xml_set_object_variation1.phpt deleted file mode 100644 index ea3781322069c..0000000000000 --- a/ext/xml/tests/xml_set_object_variation1.phpt +++ /dev/null @@ -1,240 +0,0 @@ ---TEST-- -Test xml_set_object() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_object($value, $obj) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_object() : usage variations *** - -Arg value 0 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_object(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_object_variation2.phpt b/ext/xml/tests/xml_set_object_variation2.phpt deleted file mode 100644 index 7ee304c220795..0000000000000 --- a/ext/xml/tests/xml_set_object_variation2.phpt +++ /dev/null @@ -1,229 +0,0 @@ ---TEST-- -Test xml_set_object() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for obj - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_object($parser, $value) ); -}; - -xml_parser_free($parser); -fclose($fp); - -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_object() : usage variations *** - -Arg value 0 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_object(): Argument 2 has wrong type in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_processing_instruction_handler_basic.phpt b/ext/xml/tests/xml_set_processing_instruction_handler_basic.phpt deleted file mode 100644 index e5589cee29553..0000000000000 --- a/ext/xml/tests/xml_set_processing_instruction_handler_basic.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test xml_set_processing_instruction_handler function : basic ---SKIPIF-- - ---FILE-- - - -HERE; - -echo "Simple test of xml_set_processing_instruction_handler() function\n"; -$p1 = new Xml_Parser(); -$p1->parse($xml); -echo "Done\n"; -?> ---EXPECT-- -Simple test of xml_set_processing_instruction_handler() function -Target: xml-stylesheet -Data: href="default.xsl" type="text/xml" -Done \ No newline at end of file diff --git a/ext/xml/tests/xml_set_processing_instruction_handler_error.phpt b/ext/xml/tests/xml_set_processing_instruction_handler_error.phpt deleted file mode 100644 index bfa3f64c6e1fa..0000000000000 --- a/ext/xml/tests/xml_set_processing_instruction_handler_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test xml_set_processing_instruction_handler() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_processing_instruction_handler() : error conditions *** - --- Testing xml_set_processing_instruction_handler() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_processing_instruction_handler() in %s on line %d -NULL - --- Testing xml_set_processing_instruction_handler() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_processing_instruction_handler() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_processing_instruction_handler_variation1.phpt b/ext/xml/tests/xml_set_processing_instruction_handler_variation1.phpt deleted file mode 100644 index 72c56ae356fcb..0000000000000 --- a/ext/xml/tests/xml_set_processing_instruction_handler_variation1.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test xml_set_processing_instruction_handler() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_processing_instruction_handler($value, $hdl) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_processing_instruction_handler() : usage variations *** - -Arg value 0 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_processing_instruction_handler(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_processing_instruction_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_start_namespace_decl_handler_basic.phpt b/ext/xml/tests/xml_set_start_namespace_decl_handler_basic.phpt deleted file mode 100644 index 79b8cb88fcec4..0000000000000 --- a/ext/xml/tests/xml_set_start_namespace_decl_handler_basic.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test xml_set_start_namespace_decl_handler function: basic ---SKIPIF-- - ---FILE-- - -Any old text. -An HTML table cell. - -HERE; - -$parser = xml_parser_create_ns(); -xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - -var_dump(xml_set_start_namespace_decl_handler( $parser, "Namespace_Start_Handler" )); -var_dump(xml_set_end_namespace_decl_handler( $parser, "Namespace_End_Handler" )); - -xml_parse( $parser, $xml, true); -xml_parser_free( $parser ); - -echo "Done\n"; - -function Namespace_Start_Handler( $parser, $prefix, $uri ) { - echo "Namespace_Start_Handler called\n"; - echo "...Prefix: ". $prefix . "\n"; - echo "...Uri: ". $uri . "\n"; -} - -function Namespace_End_Handler($parser, $prefix) { - echo "Namespace_End_Handler called\n"; - echo "...Prefix: ". $prefix . "\n\n"; -} - -function DefaultHandler( $parser, $data ) { - print( 'DefaultHandler Called
' ); -} -?> ---EXPECT-- -bool(true) -bool(true) -Namespace_Start_Handler called -...Prefix: aw1 -...Uri: http://www.somewhere.com/namespace1 -Namespace_Start_Handler called -...Prefix: aw2 -...Uri: file:/DTD/somewhere.dtd -Done - diff --git a/ext/xml/tests/xml_set_start_namespace_decl_handler_error.phpt b/ext/xml/tests/xml_set_start_namespace_decl_handler_error.phpt deleted file mode 100644 index 2db4cfadb583e..0000000000000 --- a/ext/xml/tests/xml_set_start_namespace_decl_handler_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test xml_set_start_namespace_decl_handler() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_start_namespace_decl_handler() : error conditions *** - --- Testing xml_set_start_namespace_decl_handler() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_start_namespace_decl_handler() in %s on line %d -NULL - --- Testing xml_set_start_namespace_decl_handler() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_start_namespace_decl_handler() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_start_namespace_decl_handler_variation1.phpt b/ext/xml/tests/xml_set_start_namespace_decl_handler_variation1.phpt deleted file mode 100644 index 56f2d20c16be8..0000000000000 --- a/ext/xml/tests/xml_set_start_namespace_decl_handler_variation1.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test xml_set_start_namespace_decl_handler() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_start_namespace_decl_handler($value, $hdl) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_start_namespace_decl_handler() : usage variations *** - -Arg value 0 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_start_namespace_decl_handler(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_start_namespace_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xml_set_unparsed_entity_decl_handler_error.phpt b/ext/xml/tests/xml_set_unparsed_entity_decl_handler_error.phpt deleted file mode 100644 index 4eb3f0d3d4c33..0000000000000 --- a/ext/xml/tests/xml_set_unparsed_entity_decl_handler_error.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test xml_set_unparsed_entity_decl_handler() function : error conditions ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing xml_set_unparsed_entity_decl_handler() : error conditions *** - --- Testing xml_set_unparsed_entity_decl_handler() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_unparsed_entity_decl_handler() in %s on line %d -NULL - --- Testing xml_set_unparsed_entity_decl_handler() function with less than expected no. of arguments -- - -Warning: Wrong parameter count for xml_set_unparsed_entity_decl_handler() in %s on line %d -NULL -Done diff --git a/ext/xml/tests/xml_set_unparsed_entity_decl_handler_variation1.phpt b/ext/xml/tests/xml_set_unparsed_entity_decl_handler_variation1.phpt deleted file mode 100644 index b628744405af2..0000000000000 --- a/ext/xml/tests/xml_set_unparsed_entity_decl_handler_variation1.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test xml_set_unparsed_entity_decl_handler() function : usage variations ---SKIPIF-- - ---FILE-- - 'red', 'item' => 'pen'), - - // null data - NULL, - null, - - // boolean data - true, - false, - TRUE, - FALSE, - - // empty data - "", - '', - - // string data - "string", - 'string', - - // object data - new aClass(), - - // resource data - $fp, - - // undefined data - $undefined_var, - - // unset data - $unset_var, -); - -// loop through each element of the array for parser - -foreach($values as $value) { - echo "\nArg value $value \n"; - var_dump( xml_set_unparsed_entity_decl_handler($value, $hdl) ); -}; - -fclose($fp); -echo "Done"; -?> ---EXPECTF-- -*** Testing xml_set_unparsed_entity_decl_handler() : usage variations *** - -Arg value 0 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 12345 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -2345 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 10.5 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value -10.5 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 101234567000 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1.07654321E-9 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 0.5 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Array - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value 1 - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value string - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Some Ascii Data - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value Resource id %s - -Warning: xml_set_unparsed_entity_decl_handler(): supplied resource is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) - -Arg value - -Warning: xml_set_unparsed_entity_decl_handler(): supplied argument is not a valid XML Parser resource in %s on line %d -bool(false) -Done diff --git a/ext/xml/tests/xmltest.xml b/ext/xml/tests/xmltest.xml deleted file mode 100644 index c15d6ea1ab04d..0000000000000 --- a/ext/xml/tests/xmltest.xml +++ /dev/null @@ -1,20 +0,0 @@ - - -%incent; -]> - - Plain text. - - - - - - &included-entity; - - - - - - - diff --git a/ext/xml/xml.c b/ext/xml/xml.c deleted file mode 100644 index f39bd999cba00..0000000000000 --- a/ext/xml/xml.c +++ /dev/null @@ -1,1657 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Stig Sæther Bakken | - | Thies C. Arntzen | - | Sterling Hughes | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define IS_EXT_MODULE - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#define PHP_XML_INTERNAL -#include "zend_variables.h" -#include "ext/standard/php_string.h" -#include "ext/standard/info.h" - -#if HAVE_XML - -#include "php_xml.h" -# include "ext/standard/head.h" -#ifdef LIBXML_EXPAT_COMPAT -#include "ext/libxml/php_libxml.h" -#endif - -/* Short-term TODO list: - * - Implement XML_ExternalEntityParserCreate() - * - XML_SetCommentHandler - * - XML_SetCdataSectionHandler - * - XML_SetParamEntityParsing - */ - -/* Long-term TODO list: - * - Fix the expat library so you can install your own memory manager - * functions - */ - -/* Known bugs: - * - Weird things happen with sections. - */ - -ZEND_DECLARE_MODULE_GLOBALS(xml) - -/* {{{ dynamically loadable module stuff */ -#ifdef COMPILE_DL_XML -ZEND_GET_MODULE(xml) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif /* COMPILE_DL_XML */ -/* }}} */ - -/* {{{ function prototypes */ -PHP_MINIT_FUNCTION(xml); -PHP_MINFO_FUNCTION(xml); -static PHP_GINIT_FUNCTION(xml); - -static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void xml_set_handler(zval **, zval **); -inline static unsigned short xml_encode_iso_8859_1(unsigned char); -inline static char xml_decode_iso_8859_1(unsigned short); -inline static unsigned short xml_encode_us_ascii(unsigned char); -inline static char xml_decode_us_ascii(unsigned short); -static zval *xml_call_handler(xml_parser *, zval *, zend_function *, int, zval **); -static zval *_xml_xmlchar_zval(const XML_Char *, int, const XML_Char *); -static int _xml_xmlcharlen(const XML_Char *); -static void _xml_add_to_info(xml_parser *parser,char *name); -inline static char *_xml_decode_tag(xml_parser *parser, const char *tag); - -void _xml_startElementHandler(void *, const XML_Char *, const XML_Char **); -void _xml_endElementHandler(void *, const XML_Char *); -void _xml_characterDataHandler(void *, const XML_Char *, int); -void _xml_processingInstructionHandler(void *, const XML_Char *, const XML_Char *); -void _xml_defaultHandler(void *, const XML_Char *, int); -void _xml_unparsedEntityDeclHandler(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -void _xml_notationDeclHandler(void *, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); -int _xml_externalEntityRefHandler(XML_Parser, const XML_Char *, const XML_Char *, const XML_Char *, const XML_Char *); - -void _xml_startNamespaceDeclHandler(void *, const XML_Char *, const XML_Char *); -void _xml_endNamespaceDeclHandler(void *, const XML_Char *); -/* }}} */ - -/* {{{ extension definition structures */ -static - ZEND_BEGIN_ARG_INFO(third_and_fourth_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -zend_function_entry xml_functions[] = { - PHP_FE(xml_parser_create, NULL) - PHP_FE(xml_parser_create_ns, NULL) - PHP_FE(xml_set_object, second_arg_force_ref) - PHP_FE(xml_set_element_handler, NULL) - PHP_FE(xml_set_character_data_handler, NULL) - PHP_FE(xml_set_processing_instruction_handler, NULL) - PHP_FE(xml_set_default_handler, NULL) - PHP_FE(xml_set_unparsed_entity_decl_handler, NULL) - PHP_FE(xml_set_notation_decl_handler, NULL) - PHP_FE(xml_set_external_entity_ref_handler, NULL) - PHP_FE(xml_set_start_namespace_decl_handler, NULL) - PHP_FE(xml_set_end_namespace_decl_handler, NULL) - PHP_FE(xml_parse, NULL) - PHP_FE(xml_parse_into_struct, third_and_fourth_args_force_ref) - PHP_FE(xml_get_error_code, NULL) - PHP_FE(xml_error_string, NULL) - PHP_FE(xml_get_current_line_number, NULL) - PHP_FE(xml_get_current_column_number, NULL) - PHP_FE(xml_get_current_byte_index, NULL) - PHP_FE(xml_parser_free, NULL) - PHP_FE(xml_parser_set_option, NULL) - PHP_FE(xml_parser_get_option, NULL) - PHP_FE(utf8_encode, NULL) - PHP_FE(utf8_decode, NULL) - {NULL, NULL, NULL} -}; - -#ifdef LIBXML_EXPAT_COMPAT -static zend_module_dep xml_deps[] = { - ZEND_MOD_REQUIRED("libxml") - {NULL, NULL, NULL} -}; -#endif - -zend_module_entry xml_module_entry = { -#ifdef LIBXML_EXPAT_COMPAT - STANDARD_MODULE_HEADER_EX, NULL, - xml_deps, -#else - STANDARD_MODULE_HEADER, -#endif - "xml", /* extension name */ - xml_functions, /* extension function list */ - PHP_MINIT(xml), /* extension-wide startup function */ - NULL, /* extension-wide shutdown function */ - NULL, /* per-request startup function */ - NULL, /* per-request shutdown function */ - PHP_MINFO(xml), /* information function */ - NO_VERSION_YET, - PHP_MODULE_GLOBALS(xml), /* globals descriptor */ - PHP_GINIT(xml), /* globals ctor */ - NULL, /* globals dtor */ - NULL, /* post deactivate */ - STANDARD_MODULE_PROPERTIES_EX -}; - -/* All the encoding functions are set to NULL right now, since all - * the encoding is currently done internally by expat/xmltok. - */ -xml_encoding xml_encodings[] = { - { "ISO-8859-1", xml_decode_iso_8859_1, xml_encode_iso_8859_1 }, - { "US-ASCII", xml_decode_us_ascii, xml_encode_us_ascii }, - { "UTF-8", NULL, NULL }, - { NULL, NULL, NULL } -}; - -static XML_Memory_Handling_Suite php_xml_mem_hdlrs; - -/* True globals, no need for thread safety */ -static int le_xml_parser; - -/* }}} */ - -/* {{{ startup, shutdown and info functions */ -static PHP_GINIT_FUNCTION(xml) -{ - xml_globals->default_encoding = "UTF-8"; -} - -static void *php_xml_malloc_wrapper(size_t sz) -{ - return emalloc(sz); -} - -static void *php_xml_realloc_wrapper(void *ptr, size_t sz) -{ - return erealloc(ptr, sz); -} - -static void php_xml_free_wrapper(void *ptr) -{ - if (ptr != NULL) { - efree(ptr); - } -} - -PHP_MINIT_FUNCTION(xml) -{ - le_xml_parser = zend_register_list_destructors_ex(xml_parser_dtor, NULL, "xml", module_number); - - REGISTER_LONG_CONSTANT("XML_ERROR_NONE", XML_ERROR_NONE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_NO_MEMORY", XML_ERROR_NO_MEMORY, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_SYNTAX", XML_ERROR_SYNTAX, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_NO_ELEMENTS", XML_ERROR_NO_ELEMENTS, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_INVALID_TOKEN", XML_ERROR_INVALID_TOKEN, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_UNCLOSED_TOKEN", XML_ERROR_UNCLOSED_TOKEN, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_PARTIAL_CHAR", XML_ERROR_PARTIAL_CHAR, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_TAG_MISMATCH", XML_ERROR_TAG_MISMATCH, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_DUPLICATE_ATTRIBUTE", XML_ERROR_DUPLICATE_ATTRIBUTE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_JUNK_AFTER_DOC_ELEMENT", XML_ERROR_JUNK_AFTER_DOC_ELEMENT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_PARAM_ENTITY_REF", XML_ERROR_PARAM_ENTITY_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_UNDEFINED_ENTITY", XML_ERROR_UNDEFINED_ENTITY, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_RECURSIVE_ENTITY_REF", XML_ERROR_RECURSIVE_ENTITY_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_ASYNC_ENTITY", XML_ERROR_ASYNC_ENTITY, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_BAD_CHAR_REF", XML_ERROR_BAD_CHAR_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_BINARY_ENTITY_REF", XML_ERROR_BINARY_ENTITY_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF", XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_MISPLACED_XML_PI", XML_ERROR_MISPLACED_XML_PI, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_UNKNOWN_ENCODING", XML_ERROR_UNKNOWN_ENCODING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_INCORRECT_ENCODING", XML_ERROR_INCORRECT_ENCODING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_UNCLOSED_CDATA_SECTION", XML_ERROR_UNCLOSED_CDATA_SECTION, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ERROR_EXTERNAL_ENTITY_HANDLING", XML_ERROR_EXTERNAL_ENTITY_HANDLING, CONST_CS|CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("XML_OPTION_CASE_FOLDING", PHP_XML_OPTION_CASE_FOLDING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_OPTION_TARGET_ENCODING", PHP_XML_OPTION_TARGET_ENCODING, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_TAGSTART", PHP_XML_OPTION_SKIP_TAGSTART, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHITE", PHP_XML_OPTION_SKIP_WHITE, CONST_CS|CONST_PERSISTENT); - - /* this object should not be pre-initialised at compile time, - as the order of members may vary */ - - php_xml_mem_hdlrs.malloc_fcn = php_xml_malloc_wrapper; - php_xml_mem_hdlrs.realloc_fcn = php_xml_realloc_wrapper; - php_xml_mem_hdlrs.free_fcn = php_xml_free_wrapper; - -#ifdef LIBXML_EXPAT_COMPAT - REGISTER_STRING_CONSTANT("XML_SAX_IMPL", "libxml", CONST_CS|CONST_PERSISTENT); -#else - REGISTER_STRING_CONSTANT("XML_SAX_IMPL", "expat", CONST_CS|CONST_PERSISTENT); -#endif - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(xml) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "XML Support", "active"); - php_info_print_table_row(2, "XML Namespace Support", "active"); -#if defined(LIBXML_DOTTED_VERSION) && defined(LIBXML_EXPAT_COMPAT) - php_info_print_table_row(2, "libxml2 Version", LIBXML_DOTTED_VERSION); -#else - php_info_print_table_row(2, "EXPAT Version", XML_ExpatVersion()); -#endif - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ extension-internal functions */ -static zval *_xml_resource_zval(long value) -{ - zval *ret; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(ret); - - Z_TYPE_P(ret) = IS_RESOURCE; - Z_LVAL_P(ret) = value; - - zend_list_addref(value); - - return ret; -} - -static zval *_xml_string_zval(const char *str) -{ - zval *ret; - int len = strlen(str); - MAKE_STD_ZVAL(ret); - - Z_TYPE_P(ret) = IS_STRING; - Z_STRLEN_P(ret) = len; - Z_STRVAL_P(ret) = estrndup(str, len); - return ret; -} - -static zval *_xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encoding) -{ - zval *ret; - MAKE_STD_ZVAL(ret); - - if (s == NULL) { - ZVAL_FALSE(ret); - return ret; - } - if (len == 0) { - len = _xml_xmlcharlen(s); - } - Z_TYPE_P(ret) = IS_STRING; - Z_STRVAL_P(ret) = xml_utf8_decode(s, len, &Z_STRLEN_P(ret), encoding); - return ret; -} -/* }}} */ - -/* {{{ xml_parser_dtor() */ -static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - xml_parser *parser = (xml_parser *)rsrc->ptr; - - if (parser->parser) { - XML_ParserFree(parser->parser); - } - if (parser->ltags) { - int inx; - for (inx = 0; inx < parser->level; inx++) - efree(parser->ltags[ inx ]); - efree(parser->ltags); - } - if (parser->startElementHandler) { - zval_ptr_dtor(&parser->startElementHandler); - } - if (parser->endElementHandler) { - zval_ptr_dtor(&parser->endElementHandler); - } - if (parser->characterDataHandler) { - zval_ptr_dtor(&parser->characterDataHandler); - } - if (parser->processingInstructionHandler) { - zval_ptr_dtor(&parser->processingInstructionHandler); - } - if (parser->defaultHandler) { - zval_ptr_dtor(&parser->defaultHandler); - } - if (parser->unparsedEntityDeclHandler) { - zval_ptr_dtor(&parser->unparsedEntityDeclHandler); - } - if (parser->notationDeclHandler) { - zval_ptr_dtor(&parser->notationDeclHandler); - } - if (parser->externalEntityRefHandler) { - zval_ptr_dtor(&parser->externalEntityRefHandler); - } - if (parser->unknownEncodingHandler) { - zval_ptr_dtor(&parser->unknownEncodingHandler); - } - if (parser->startNamespaceDeclHandler) { - zval_ptr_dtor(&parser->startNamespaceDeclHandler); - } - if (parser->endNamespaceDeclHandler) { - zval_ptr_dtor(&parser->endNamespaceDeclHandler); - } - if (parser->baseURI) { - efree(parser->baseURI); - } - if (parser->object) { - zval_ptr_dtor(&parser->object); - } - - efree(parser); -} -/* }}} */ - -/* {{{ xml_set_handler() */ -static void xml_set_handler(zval **handler, zval **data) -{ - /* If we have already a handler, release it */ - if (*handler) { - zval_ptr_dtor(handler); - } - - /* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */ - if (Z_TYPE_PP(data) != IS_ARRAY) { - - convert_to_string_ex(data); - if (Z_STRLEN_PP(data) == 0) { - *handler = NULL; - return; - } - } - - zval_add_ref(data); - - *handler = *data; -} -/* }}} */ - -/* {{{ xml_call_handler() */ -static zval *xml_call_handler(xml_parser *parser, zval *handler, zend_function *function_ptr, int argc, zval **argv) -{ - int i; - TSRMLS_FETCH(); - - if (parser && handler && !EG(exception)) { - zval ***args; - zval *retval; - int result; - zend_fcall_info fci; - - args = safe_emalloc(sizeof(zval **), argc, 0); - for (i = 0; i < argc; i++) { - args[i] = &argv[i]; - } - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = handler; - fci.symbol_table = NULL; - fci.object_pp = &parser->object; - fci.retval_ptr_ptr = &retval; - fci.param_count = argc; - fci.params = args; - fci.no_separation = 0; - /*fci.function_handler_cache = &function_ptr;*/ - - result = zend_call_function(&fci, NULL TSRMLS_CC); - if (result == FAILURE) { - zval **method; - zval **obj; - - if (Z_TYPE_P(handler) == IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(handler)); - } else if (zend_hash_index_find(Z_ARRVAL_P(handler), 0, (void **) &obj) == SUCCESS && - zend_hash_index_find(Z_ARRVAL_P(handler), 1, (void **) &method) == SUCCESS && - Z_TYPE_PP(obj) == IS_OBJECT && - Z_TYPE_PP(method) == IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s::%s()", Z_OBJCE_PP(obj)->name, Z_STRVAL_PP(method)); - } else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler"); - } - - for (i = 0; i < argc; i++) { - zval_ptr_dtor(args[i]); - } - efree(args); - - if (result == FAILURE) { - return NULL; - } else { - return EG(exception) ? NULL : retval; - } - } else { - for (i = 0; i < argc; i++) { - zval_ptr_dtor(&argv[i]); - } - return NULL; - } -} -/* }}} */ - -/* {{{ xml_encode_iso_8859_1() */ -inline static unsigned short xml_encode_iso_8859_1(unsigned char c) -{ - return (unsigned short)c; -} -/* }}} */ - -/* {{{ xml_decode_iso_8859_1() */ -inline static char xml_decode_iso_8859_1(unsigned short c) -{ - return (char)(c > 0xff ? '?' : c); -} -/* }}} */ - -/* {{{ xml_encode_us_ascii() */ -inline static unsigned short xml_encode_us_ascii(unsigned char c) -{ - return (unsigned short)c; -} -/* }}} */ - -/* {{{ xml_decode_us_ascii() */ -inline static char xml_decode_us_ascii(unsigned short c) -{ - return (char)(c > 0x7f ? '?' : c); -} -/* }}} */ - -/* {{{ xml_get_encoding() */ -static xml_encoding *xml_get_encoding(const XML_Char *name) -{ - xml_encoding *enc = &xml_encodings[0]; - - while (enc && enc->name) { - if (strcasecmp(name, enc->name) == 0) { - return enc; - } - enc++; - } - return NULL; -} -/* }}} */ - -/* {{{ xml_utf8_encode */ -PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding) -{ - int pos = len; - char *newbuf; - unsigned int c; - unsigned short (*encoder)(unsigned char) = NULL; - xml_encoding *enc = xml_get_encoding(encoding); - - *newlen = 0; - if (enc) { - encoder = enc->encoding_function; - } else { - /* If the target encoding was unknown, fail */ - return NULL; - } - if (encoder == NULL) { - /* If no encoder function was specified, return the data as-is. - */ - newbuf = emalloc(len + 1); - memcpy(newbuf, s, len); - *newlen = len; - newbuf[*newlen] = '\0'; - return newbuf; - } - /* This is the theoretical max (will never get beyond len * 2 as long - * as we are converting from single-byte characters, though) */ - newbuf = safe_emalloc(len, 4, 1); - while (pos > 0) { - c = encoder ? encoder((unsigned char)(*s)) : (unsigned short)(*s); - if (c < 0x80) { - newbuf[(*newlen)++] = (char) c; - } else if (c < 0x800) { - newbuf[(*newlen)++] = (0xc0 | (c >> 6)); - newbuf[(*newlen)++] = (0x80 | (c & 0x3f)); - } else if (c < 0x10000) { - newbuf[(*newlen)++] = (0xe0 | (c >> 12)); - newbuf[(*newlen)++] = (0xc0 | ((c >> 6) & 0x3f)); - newbuf[(*newlen)++] = (0x80 | (c & 0x3f)); - } else if (c < 0x200000) { - newbuf[(*newlen)++] = (0xf0 | (c >> 18)); - newbuf[(*newlen)++] = (0xe0 | ((c >> 12) & 0x3f)); - newbuf[(*newlen)++] = (0xc0 | ((c >> 6) & 0x3f)); - newbuf[(*newlen)++] = (0x80 | (c & 0x3f)); - } - pos--; - s++; - } - newbuf[*newlen] = 0; - newbuf = erealloc(newbuf, (*newlen)+1); - return newbuf; -} -/* }}} */ - -/* {{{ xml_utf8_decode */ -PHPAPI char *xml_utf8_decode(const XML_Char *s, int len, int *newlen, const XML_Char *encoding) -{ - int pos = len; - char *newbuf = emalloc(len + 1); - unsigned short c; - char (*decoder)(unsigned short) = NULL; - xml_encoding *enc = xml_get_encoding(encoding); - - *newlen = 0; - if (enc) { - decoder = enc->decoding_function; - } - if (decoder == NULL) { - /* If the target encoding was unknown, or no decoder function - * was specified, return the UTF-8-encoded data as-is. - */ - memcpy(newbuf, s, len); - *newlen = len; - newbuf[*newlen] = '\0'; - return newbuf; - } - while (pos > 0) { - c = (unsigned char)(*s); - if (c >= 0xf0) { /* four bytes encoded, 21 bits */ - if(pos-4 >= 0) { - c = ((s[0]&7)<<18) | ((s[1]&63)<<12) | ((s[2]&63)<<6) | (s[3]&63); - } else { - c = '?'; - } - s += 4; - pos -= 4; - } else if (c >= 0xe0) { /* three bytes encoded, 16 bits */ - if(pos-3 >= 0) { - c = ((s[0]&63)<<12) | ((s[1]&63)<<6) | (s[2]&63); - } else { - c = '?'; - } - s += 3; - pos -= 3; - } else if (c >= 0xc0) { /* two bytes encoded, 11 bits */ - if(pos-2 >= 0) { - c = ((s[0]&63)<<6) | (s[1]&63); - } else { - c = '?'; - } - s += 2; - pos -= 2; - } else { - s++; - pos--; - } - newbuf[*newlen] = decoder ? decoder(c) : c; - ++*newlen; - } - if (*newlen < len) { - newbuf = erealloc(newbuf, *newlen + 1); - } - newbuf[*newlen] = '\0'; - return newbuf; -} -/* }}} */ - -/* {{{ _xml_xmlcharlen() */ -static int _xml_xmlcharlen(const XML_Char *s) -{ - int len = 0; - - while (*s) { - len++; - s++; - } - return len; -} -/* }}} */ - -/* {{{ _xml_zval_strdup() */ -PHPAPI char *_xml_zval_strdup(zval *val) -{ - if (Z_TYPE_P(val) == IS_STRING) { - char *buf = emalloc(Z_STRLEN_P(val) + 1); - memcpy(buf, Z_STRVAL_P(val), Z_STRLEN_P(val)); - buf[Z_STRLEN_P(val)] = '\0'; - return buf; - } - return NULL; -} -/* }}} */ - -/* {{{ _xml_add_to_info */ -static void _xml_add_to_info(xml_parser *parser,char *name) -{ - zval **element, *values; - - if (! parser->info) { - return; - } - - if (zend_hash_find(Z_ARRVAL_P(parser->info),name,strlen(name) + 1,(void **) &element) == FAILURE) { - MAKE_STD_ZVAL(values); - - array_init(values); - - zend_hash_update(Z_ARRVAL_P(parser->info), name, strlen(name)+1, (void *) &values, sizeof(zval*), (void **) &element); - } - - add_next_index_long(*element,parser->curtag); - - parser->curtag++; -} -/* }}} */ - -/* {{{ _xml_decode_tag() */ -static char *_xml_decode_tag(xml_parser *parser, const char *tag) -{ - char *newstr; - int out_len; - - newstr = xml_utf8_decode(tag, strlen(tag), &out_len, parser->target_encoding); - - if (parser->case_folding) { - php_strtoupper(newstr, out_len); - } - - return newstr; -} -/* }}} */ - -/* {{{ _xml_startElementHandler() */ -void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Char **attributes) -{ - xml_parser *parser = (xml_parser *)userData; - const char **attrs = (const char **) attributes; - char *tag_name; - char *att, *val; - int val_len; - zval *retval, *args[3]; - - if (parser) { - parser->level++; - - tag_name = _xml_decode_tag(parser, name); - - if (parser->startElementHandler) { - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_string_zval(tag_name); - MAKE_STD_ZVAL(args[2]); - array_init(args[2]); - - while (attributes && *attributes) { - att = _xml_decode_tag(parser, attributes[0]); - val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding); - - add_assoc_stringl(args[2], att, val, val_len, 0); - - attributes += 2; - - efree(att); - } - - if ((retval = xml_call_handler(parser, parser->startElementHandler, parser->startElementPtr, 3, args))) { - zval_ptr_dtor(&retval); - } - } - - if (parser->data) { - zval *tag, *atr; - int atcnt = 0; - - MAKE_STD_ZVAL(tag); - MAKE_STD_ZVAL(atr); - - array_init(tag); - array_init(atr); - - _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); - - add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ - add_assoc_string(tag,"type","open",1); - add_assoc_long(tag,"level",parser->level); - - parser->ltags[parser->level-1] = estrdup(tag_name); - parser->lastwasopen = 1; - - attributes = (const XML_Char **) attrs; - - while (attributes && *attributes) { - att = _xml_decode_tag(parser, attributes[0]); - val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding); - - add_assoc_stringl(atr,att,val,val_len,0); - - atcnt++; - attributes += 2; - - efree(att); - } - - if (atcnt) { - zend_hash_add(Z_ARRVAL_P(tag),"attributes",sizeof("attributes"),&atr,sizeof(zval*),NULL); - } else { - zval_ptr_dtor(&atr); - } - - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),(void *) &parser->ctag); - } - - efree(tag_name); - } -} -/* }}} */ - -/* {{{ _xml_endElementHandler() */ -void _xml_endElementHandler(void *userData, const XML_Char *name) -{ - xml_parser *parser = (xml_parser *)userData; - char *tag_name; - - if (parser) { - zval *retval, *args[2]; - - tag_name = _xml_decode_tag(parser, name); - - if (parser->endElementHandler) { - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_string_zval(tag_name); - - if ((retval = xml_call_handler(parser, parser->endElementHandler, parser->endElementPtr, 2, args))) { - zval_ptr_dtor(&retval); - } - } - - if (parser->data) { - zval *tag; - - if (parser->lastwasopen) { - add_assoc_string(*(parser->ctag),"type","complete",1); - } else { - MAKE_STD_ZVAL(tag); - - array_init(tag); - - _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); - - add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ - add_assoc_string(tag,"type","close",1); - add_assoc_long(tag,"level",parser->level); - - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),NULL); - } - - parser->lastwasopen = 0; - } - - efree(tag_name); - - if (parser->ltags) { - efree(parser->ltags[parser->level-1]); - } - - parser->level--; - } -} -/* }}} */ - -/* {{{ _xml_characterDataHandler() */ -void _xml_characterDataHandler(void *userData, const XML_Char *s, int len) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser) { - zval *retval, *args[2]; - - if (parser->characterDataHandler) { - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(s, len, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->characterDataHandler, parser->characterDataPtr, 2, args))) { - zval_ptr_dtor(&retval); - } - } - - if (parser->data) { - int i; - int doprint = 0; - - char *decoded_value; - int decoded_len; - - decoded_value = xml_utf8_decode(s,len,&decoded_len,parser->target_encoding); - for (i = 0; i < decoded_len; i++) { - switch (decoded_value[i]) { - case ' ': - case '\t': - case '\n': - continue; - default: - doprint = 1; - break; - } - if (doprint) { - break; - } - } - if (doprint || (! parser->skipwhite)) { - if (parser->lastwasopen) { - zval **myval; - - /* check if the current tag already has a value - if yes append to that! */ - if (zend_hash_find(Z_ARRVAL_PP(parser->ctag),"value",sizeof("value"),(void **) &myval) == SUCCESS) { - int newlen = Z_STRLEN_PP(myval) + decoded_len; - Z_STRVAL_PP(myval) = erealloc(Z_STRVAL_PP(myval),newlen+1); - strcpy(Z_STRVAL_PP(myval) + Z_STRLEN_PP(myval),decoded_value); - Z_STRLEN_PP(myval) += decoded_len; - efree(decoded_value); - } else { - add_assoc_string(*(parser->ctag),"value",decoded_value,0); - } - - } else { - zval *tag; - zval **curtag, **mytype, **myval; - HashPosition hpos=NULL; - - zend_hash_internal_pointer_end_ex(Z_ARRVAL_P(parser->data), &hpos); - - if (hpos && (zend_hash_get_current_data_ex(Z_ARRVAL_P(parser->data), (void **) &curtag, &hpos) == SUCCESS)) { - if (zend_hash_find(Z_ARRVAL_PP(curtag),"type",sizeof("type"),(void **) &mytype) == SUCCESS) { - if (!strcmp(Z_STRVAL_PP(mytype), "cdata")) { - if (zend_hash_find(Z_ARRVAL_PP(curtag),"value",sizeof("value"),(void **) &myval) == SUCCESS) { - int newlen = Z_STRLEN_PP(myval) + decoded_len; - Z_STRVAL_PP(myval) = erealloc(Z_STRVAL_PP(myval),newlen+1); - strcpy(Z_STRVAL_PP(myval) + Z_STRLEN_PP(myval),decoded_value); - Z_STRLEN_PP(myval) += decoded_len; - efree(decoded_value); - return; - } - } - } - } - - MAKE_STD_ZVAL(tag); - - array_init(tag); - - _xml_add_to_info(parser,parser->ltags[parser->level-1] + parser->toffset); - - add_assoc_string(tag,"tag",parser->ltags[parser->level-1] + parser->toffset,1); - add_assoc_string(tag,"value",decoded_value,0); - add_assoc_string(tag,"type","cdata",1); - add_assoc_long(tag,"level",parser->level); - - zend_hash_next_index_insert(Z_ARRVAL_P(parser->data),&tag,sizeof(zval*),NULL); - } - } else { - efree(decoded_value); - } - } - } -} -/* }}} */ - -/* {{{ _xml_processingInstructionHandler() */ -void _xml_processingInstructionHandler(void *userData, const XML_Char *target, const XML_Char *data) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->processingInstructionHandler) { - zval *retval, *args[3]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(target, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(data, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->processingInstructionHandler, parser->processingInstructionPtr, 3, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_defaultHandler() */ -void _xml_defaultHandler(void *userData, const XML_Char *s, int len) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->defaultHandler) { - zval *retval, *args[2]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(s, len, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->defaultHandler, parser->defaultPtr, 2, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_unparsedEntityDeclHandler() */ -void _xml_unparsedEntityDeclHandler(void *userData, - const XML_Char *entityName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->unparsedEntityDeclHandler) { - zval *retval, *args[6]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(entityName, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(base, 0, parser->target_encoding); - args[3] = _xml_xmlchar_zval(systemId, 0, parser->target_encoding); - args[4] = _xml_xmlchar_zval(publicId, 0, parser->target_encoding); - args[5] = _xml_xmlchar_zval(notationName, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->unparsedEntityDeclHandler, parser->unparsedEntityDeclPtr, 6, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_notationDeclHandler() */ -void _xml_notationDeclHandler(void *userData, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->notationDeclHandler) { - zval *retval, *args[5]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(notationName, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(base, 0, parser->target_encoding); - args[3] = _xml_xmlchar_zval(systemId, 0, parser->target_encoding); - args[4] = _xml_xmlchar_zval(publicId, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->notationDeclHandler, parser->notationDeclPtr, 5, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_externalEntityRefHandler() */ -int _xml_externalEntityRefHandler(XML_Parser parserPtr, - const XML_Char *openEntityNames, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - xml_parser *parser = XML_GetUserData(parserPtr); - int ret = 0; /* abort if no handler is set (should be configurable?) */ - - if (parser && parser->externalEntityRefHandler) { - zval *retval, *args[5]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(openEntityNames, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(base, 0, parser->target_encoding); - args[3] = _xml_xmlchar_zval(systemId, 0, parser->target_encoding); - args[4] = _xml_xmlchar_zval(publicId, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->externalEntityRefHandler, parser->externalEntityRefPtr, 5, args))) { - convert_to_long(retval); - ret = Z_LVAL_P(retval); - efree(retval); - } else { - ret = 0; - } - } - return ret; -} -/* }}} */ - -/* {{{ _xml_startNamespaceDeclHandler() */ -void _xml_startNamespaceDeclHandler(void *userData,const XML_Char *prefix, const XML_Char *uri) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->startNamespaceDeclHandler) { - zval *retval, *args[3]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding); - args[2] = _xml_xmlchar_zval(uri, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->startNamespaceDeclHandler, parser->startNamespaceDeclPtr, 3, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/* {{{ _xml_endNamespaceDeclHandler() */ -void _xml_endNamespaceDeclHandler(void *userData, const XML_Char *prefix) -{ - xml_parser *parser = (xml_parser *)userData; - - if (parser && parser->endNamespaceDeclHandler) { - zval *retval, *args[2]; - - args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding); - if ((retval = xml_call_handler(parser, parser->endNamespaceDeclHandler, parser->endNamespaceDeclPtr, 2, args))) { - zval_ptr_dtor(&retval); - } - } -} -/* }}} */ - -/************************* EXTENSION FUNCTIONS *************************/ - -static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_support) -{ - xml_parser *parser; - int auto_detect = 0; - - char *encoding_param = NULL; - int encoding_param_len = 0; - - char *ns_param = NULL; - int ns_param_len = 0; - - XML_Char *encoding; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, (ns_support ? "|ss": "|s"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) { - RETURN_FALSE; - } - - if (encoding_param != NULL) { - /* The supported encoding types are hardcoded here because - * we are limited to the encodings supported by expat/xmltok. - */ - if (encoding_param_len == 0) { - encoding = XML(default_encoding); - auto_detect = 1; - } else if (strcasecmp(encoding_param, "ISO-8859-1") == 0) { - encoding = "ISO-8859-1"; - } else if (strcasecmp(encoding_param, "UTF-8") == 0) { - encoding = "UTF-8"; - } else if (strcasecmp(encoding_param, "US-ASCII") == 0) { - encoding = "US-ASCII"; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported source encoding \"%s\"", encoding_param); - RETURN_FALSE; - } - } else { - encoding = XML(default_encoding); - } - - if (ns_support && ns_param == NULL){ - ns_param = ":"; - } - - parser = ecalloc(1, sizeof(xml_parser)); - parser->parser = XML_ParserCreate_MM((auto_detect ? NULL : encoding), - &php_xml_mem_hdlrs, ns_param); - - parser->target_encoding = encoding; - parser->case_folding = 1; - parser->object = NULL; - parser->isparsing = 0; - - XML_SetUserData(parser->parser, parser); - - ZEND_REGISTER_RESOURCE(return_value, parser,le_xml_parser); - parser->index = Z_LVAL_P(return_value); -} - -/* {{{ proto resource xml_parser_create([string encoding]) - Create an XML parser */ -PHP_FUNCTION(xml_parser_create) -{ - php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto resource xml_parser_create_ns([string encoding [, string sep]]) - Create an XML parser */ -PHP_FUNCTION(xml_parser_create_ns) -{ - php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int xml_set_object(resource parser, object &obj) - Set up object which should be used for callbacks */ -PHP_FUNCTION(xml_set_object) -{ - xml_parser *parser; - zval **pind, **mythis; - - if (ZEND_NUM_ARGS() != 2 || - zend_get_parameters_ex(2, &pind, &mythis) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(mythis) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument 2 has wrong type"); - RETURN_FALSE; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *,pind, -1, "XML Parser", le_xml_parser); - - /* please leave this commented - or ask thies@thieso.net before doing it (again) */ - if (parser->object) { - zval_ptr_dtor(&parser->object); - } - - /* please leave this commented - or ask thies@thieso.net before doing it (again) */ -/* #ifdef ZEND_ENGINE_2 - zval_add_ref(&parser->object); -#endif */ - - ALLOC_ZVAL(parser->object); - *parser->object = **mythis; - zval_copy_ctor(parser->object); - INIT_PZVAL(parser->object); - - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string ehdl) - Set up start and end element handlers */ -PHP_FUNCTION(xml_set_element_handler) -{ - xml_parser *parser; - zval **pind, **shdl, **ehdl; - - if (ZEND_NUM_ARGS() != 3 || - zend_get_parameters_ex(3, &pind, &shdl, &ehdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *,pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->startElementHandler, shdl); - xml_set_handler(&parser->endElementHandler, ehdl); - XML_SetElementHandler(parser->parser, _xml_startElementHandler, _xml_endElementHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl) - Set up character data handler */ -PHP_FUNCTION(xml_set_character_data_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->characterDataHandler, hdl); - XML_SetCharacterDataHandler(parser->parser, _xml_characterDataHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_processing_instruction_handler(resource parser, string hdl) - Set up processing instruction (PI) handler */ -PHP_FUNCTION(xml_set_processing_instruction_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->processingInstructionHandler, hdl); - XML_SetProcessingInstructionHandler(parser->parser, _xml_processingInstructionHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_default_handler(resource parser, string hdl) - Set up default handler */ -PHP_FUNCTION(xml_set_default_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->defaultHandler, hdl); - XML_SetDefaultHandler(parser->parser, _xml_defaultHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string hdl) - Set up unparsed entity declaration handler */ -PHP_FUNCTION(xml_set_unparsed_entity_decl_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->unparsedEntityDeclHandler, hdl); - XML_SetUnparsedEntityDeclHandler(parser->parser, _xml_unparsedEntityDeclHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl) - Set up notation declaration handler */ -PHP_FUNCTION(xml_set_notation_decl_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->notationDeclHandler, hdl); - XML_SetNotationDeclHandler(parser->parser, _xml_notationDeclHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string hdl) - Set up external entity reference handler */ -PHP_FUNCTION(xml_set_external_entity_ref_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->externalEntityRefHandler, hdl); - XML_SetExternalEntityRefHandler(parser->parser, (void *) _xml_externalEntityRefHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string hdl) - Set up character data handler */ -PHP_FUNCTION(xml_set_start_namespace_decl_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->startNamespaceDeclHandler, hdl); - XML_SetStartNamespaceDeclHandler(parser->parser, _xml_startNamespaceDeclHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string hdl) - Set up character data handler */ -PHP_FUNCTION(xml_set_end_namespace_decl_handler) -{ - xml_parser *parser; - zval **pind, **hdl; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &hdl) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - xml_set_handler(&parser->endNamespaceDeclHandler, hdl); - XML_SetEndNamespaceDeclHandler(parser->parser, _xml_endNamespaceDeclHandler); - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_parse(resource parser, string data [, int isFinal]) - Start parsing an XML document */ -PHP_FUNCTION(xml_parse) -{ - xml_parser *parser; - zval **pind, **data, **final; - int argc, isFinal, ret; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &pind, &data, &final) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - convert_to_string_ex(data); - - if (argc == 3) { - convert_to_long_ex(final); - isFinal = Z_LVAL_PP(final); - } else { - isFinal = 0; - } - - parser->isparsing = 1; - ret = XML_Parse(parser->parser, Z_STRVAL_PP(data), Z_STRLEN_PP(data), isFinal); - parser->isparsing = 0; - RETVAL_LONG(ret); -} - -/* }}} */ - -/* {{{ proto int xml_parse_into_struct(resource parser, string data, array &struct, array &index) - Parsing a XML document */ - -PHP_FUNCTION(xml_parse_into_struct) -{ - xml_parser *parser; - zval **pind, **data, **xdata, **info = 0; - int ret; - - if (zend_get_parameters_ex(4, &pind, &data, &xdata,&info) == SUCCESS) { - zval_dtor(*info); - array_init(*info); - } else if (zend_get_parameters_ex(3, &pind, &data, &xdata) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - convert_to_string_ex(data); - zval_dtor(*xdata); - array_init(*xdata); - - parser->data = *xdata; - if (info) - parser->info = *info; - parser->level = 0; - parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0); - - XML_SetDefaultHandler(parser->parser, _xml_defaultHandler); - XML_SetElementHandler(parser->parser, _xml_startElementHandler, _xml_endElementHandler); - XML_SetCharacterDataHandler(parser->parser, _xml_characterDataHandler); - - parser->isparsing = 1; - ret = XML_Parse(parser->parser, Z_STRVAL_PP(data), Z_STRLEN_PP(data), 1); - parser->isparsing = 0; - - RETVAL_LONG(ret); -} -/* }}} */ - -/* {{{ proto int xml_get_error_code(resource parser) - Get XML parser error code */ -PHP_FUNCTION(xml_get_error_code) -{ - xml_parser *parser; - zval **pind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - RETVAL_LONG((long)XML_GetErrorCode(parser->parser)); -} -/* }}} */ - -/* {{{ proto string xml_error_string(int code) - Get XML parser error string */ -PHP_FUNCTION(xml_error_string) -{ - zval **code; - char *str; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &code) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(code); - str = (char *)XML_ErrorString((int)Z_LVAL_PP(code)); - if (str) { - RETVAL_STRING(str, 1); - } -} -/* }}} */ - -/* {{{ proto int xml_get_current_line_number(resource parser) - Get current line number for an XML parser */ -PHP_FUNCTION(xml_get_current_line_number) -{ - xml_parser *parser; - zval **pind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - RETVAL_LONG(XML_GetCurrentLineNumber(parser->parser)); -} -/* }}} */ - -/* {{{ proto int xml_get_current_column_number(resource parser) - Get current column number for an XML parser */ -PHP_FUNCTION(xml_get_current_column_number) -{ - xml_parser *parser; - zval **pind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - RETVAL_LONG(XML_GetCurrentColumnNumber(parser->parser)); -} -/* }}} */ - -/* {{{ proto int xml_get_current_byte_index(resource parser) - Get current byte index for an XML parser */ -PHP_FUNCTION(xml_get_current_byte_index) -{ - xml_parser *parser; - zval **pind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - RETVAL_LONG(XML_GetCurrentByteIndex(parser->parser)); -} -/* }}} */ - -/* {{{ proto int xml_parser_free(resource parser) - Free an XML parser */ -PHP_FUNCTION(xml_parser_free) -{ - zval **pind; - xml_parser *parser; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pind) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - if (parser->isparsing == 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parser cannot be freed while it is parsing."); - RETURN_FALSE; - } - - if (zend_list_delete(parser->index) == FAILURE) { - RETURN_FALSE; - } - - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_parser_set_option(resource parser, int option, mixed value) - Set options in an XML parser */ -PHP_FUNCTION(xml_parser_set_option) -{ - xml_parser *parser; - zval **pind, **opt, **val; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &pind, &opt, &val) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - convert_to_long_ex(opt); - - switch (Z_LVAL_PP(opt)) { - case PHP_XML_OPTION_CASE_FOLDING: - convert_to_long_ex(val); - parser->case_folding = Z_LVAL_PP(val); - break; - case PHP_XML_OPTION_SKIP_TAGSTART: - convert_to_long_ex(val); - parser->toffset = Z_LVAL_PP(val); - break; - case PHP_XML_OPTION_SKIP_WHITE: - convert_to_long_ex(val); - parser->skipwhite = Z_LVAL_PP(val); - break; - case PHP_XML_OPTION_TARGET_ENCODING: { - xml_encoding *enc; - convert_to_string_ex(val); - enc = xml_get_encoding(Z_STRVAL_PP(val)); - if (enc == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported target encoding \"%s\"", Z_STRVAL_PP(val)); - RETURN_FALSE; - } - parser->target_encoding = enc->name; - break; - } - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option"); - RETURN_FALSE; - break; - } - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto int xml_parser_get_option(resource parser, int option) - Get options from an XML parser */ -PHP_FUNCTION(xml_parser_get_option) -{ - xml_parser *parser; - zval **pind, **opt; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &pind, &opt) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); - - convert_to_long_ex(opt); - - switch (Z_LVAL_PP(opt)) { - case PHP_XML_OPTION_CASE_FOLDING: - RETURN_LONG(parser->case_folding); - break; - case PHP_XML_OPTION_TARGET_ENCODING: - RETURN_STRING(parser->target_encoding, 1); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option"); - RETURN_FALSE; - break; - } - - RETVAL_FALSE; /* never reached */ -} -/* }}} */ - -/* {{{ proto string utf8_encode(string data) - Encodes an ISO-8859-1 string to UTF-8 */ -PHP_FUNCTION(utf8_encode) -{ - zval **arg; - XML_Char *encoded; - int len; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg); - encoded = xml_utf8_encode(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &len, "ISO-8859-1"); - if (encoded == NULL) { - RETURN_FALSE; - } - RETVAL_STRINGL(encoded, len, 0); -} -/* }}} */ - -/* {{{ proto string utf8_decode(string data) - Converts a UTF-8 encoded string to ISO-8859-1 */ -PHP_FUNCTION(utf8_decode) -{ - zval **arg; - XML_Char *decoded; - int len; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(arg); - decoded = xml_utf8_decode(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &len, "ISO-8859-1"); - if (decoded == NULL) { - RETURN_FALSE; - } - RETVAL_STRINGL(decoded, len, 0); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/xml/xml.mak b/ext/xml/xml.mak deleted file mode 100644 index ab60f28eeddeb..0000000000000 --- a/ext/xml/xml.mak +++ /dev/null @@ -1,172 +0,0 @@ -# Temporarily here -- later may go into some batch file -# which will set this as an environment variable -PROJECT_ROOT = ..\.. - -# Module details -MODULE_NAME = php_xml -MODULE_DESC = "PHP 5 - XML Extension" -VMAJ = 3 -VMIN = 0 -VREV = 0 - -#include the common settings -include $(PROJECT_ROOT)/netware/common.mif - -# Extensions of all input and output files -.SUFFIXES: -.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d - -# Source files -C_SRC = xml.c \ - start.c - -CPP_SRC_NODIR = $(notdir $(CPP_SRC)) -C_SRC_NODIR = $(notdir $(C_SRC)) -SRC_DIR = $(dir $(CPP_SRC) $(C_SRC)) - -# Library files -LIBRARY = - -# Destination directories and files -OBJ_DIR = $(BUILD) -FINAL_DIR = $(BUILD) -MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map -OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj)) -DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d)) - -# Binary file -ifndef BINARY - BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm -endif - -# Compile flags -C_FLAGS += -c -maxerrors 25 -msgstyle gcc -C_FLAGS += -wchar_t on -bool on -C_FLAGS += -processor Pentium -C_FLAGS += -nostdinc -nosyspath -C_FLAGS += -relax_pointers # To remove type-casting errors -C_FLAGS += -DNETWARE -DZTS -C_FLAGS += -DNEW_LIBC -C_FLAGS += -DCOMPILE_DL_XML -DHAVE_LIBEXPAT=1 -C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main -C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware -C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm -C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes) -C_FLAGS += -I$(EXPAT_DIR)/include - -ifndef STACK_SIZE -STACK_SIZE=8192 -endif - -# Extra stuff based on debug / release builds -ifeq '$(BUILD)' 'debug' - SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym - C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON - C_FLAGS += -exc cw -DZEND_DEBUG=1 - LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE) - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib -else - C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off - C_FLAGS += -opt intrinsics - C_FLAGS += -opt level=4 -DZEND_DEBUG=0 - LD_FLAGS += -sym off - export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib -endif - -# Dependencies -MODULE = LibC \ - expatlbc \ - phplib -IMPORT = @$(SDK_DIR)/imports/libc.imp \ - @$(SDK_DIR)/imports/ws2nlm.imp \ - @$(MPK_DIR)/import/mpkOrg.imp \ - @$(EXPAT_DIR)/imports/expatlbc.imp \ - @$(PROJECT_ROOT)/netware/phplib.imp -EXPORT = ($(MODULE_NAME)) get_module -API = OutputToScreen - - -# Virtual paths -vpath %.cpp . -vpath %.c . ..\..\netware -vpath %.obj $(OBJ_DIR) - - -all: prebuild project - -.PHONY: all - -prebuild: - @if not exist $(OBJ_DIR) md $(OBJ_DIR) - -project: $(BINARY) - @echo Build complete. - -$(OBJ_DIR)/%.d: %.cpp - @echo Building Dependencies for $( $(basename $@).def -ifdef API - @echo Import $(API) >> $(basename $@).def -endif - @echo Module $(MODULE) >> $(basename $@).def -ifdef EXPORT - @echo Export $(EXPORT) >> $(basename $@).def -endif - @echo AutoUnload >> $(basename $@).def -ifeq '$(BUILD)' 'debug' - @echo Debug >> $(basename $@).def -endif - @echo Flag_On 0x00000008 >> $(basename $@).def - @echo Start _LibCPrelude >> $(basename $@).def - @echo Exit _LibCPostlude >> $(basename $@).def - - $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc - @echo xdcdata $(basename $@).xdc >> $(basename $@).def - - @echo Linking $@... - @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link - @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link - - @$(LINK) @$(basename $@).link - - -.PHONY: clean -clean: cleanobj cleanbin - -.PHONY: cleand -cleand: - @echo Deleting all dependency files... - -@del "$(OBJ_DIR)\*.d" - -.PHONY: cleanobj -cleanobj: - @echo Deleting all object files... - -@del "$(OBJ_DIR)\*.obj" - -.PHONY: cleanbin -cleanbin: - @echo Deleting binary files... - -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm" - @echo Deleting MAP, DEF files, etc.... - -@del "$(FINAL_DIR)\$(MODULE_NAME).map" - -@del "$(FINAL_DIR)\$(MODULE_NAME).def" - -@del "$(FINAL_DIR)\$(MODULE_NAME).link" -ifeq '$(BUILD)' 'debug' - -@del $(FINAL_DIR)\$(MODULE_NAME).sym -endif diff --git a/ext/xmlreader/CREDITS b/ext/xmlreader/CREDITS deleted file mode 100644 index 35f3af1933050..0000000000000 --- a/ext/xmlreader/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -XMLReader -Rob Richards diff --git a/ext/xmlreader/README b/ext/xmlreader/README deleted file mode 100644 index 0d946f62da4b4..0000000000000 --- a/ext/xmlreader/README +++ /dev/null @@ -1,5 +0,0 @@ -XMLReader represents a reader that provides non-cached, -forward-only access to XML data. It is based upon the -xmlTextReader api from libxml - -This extension is designed to only work under PHP 5. diff --git a/ext/xmlreader/TODO b/ext/xmlreader/TODO deleted file mode 100644 index 744c56192a15a..0000000000000 --- a/ext/xmlreader/TODO +++ /dev/null @@ -1,8 +0,0 @@ -- Implement functions to support PHP 4 - -- Refactor internals once libxml 2.6.x is minimum requirement for PHP 5 - use new api for creating the xmlTextReaderPtr - -- Add Custom Error Handling - - diff --git a/ext/xmlreader/config.m4 b/ext/xmlreader/config.m4 deleted file mode 100644 index 3614996fb4338..0000000000000 --- a/ext/xmlreader/config.m4 +++ /dev/null @@ -1,27 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(xmlreader, whether to enable XMLReader support, -[ --disable-xmlreader Disable XMLReader support], yes) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XMLReader: libxml2 install prefix], no, no) -fi - -if test "$PHP_XMLREADER" != "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([XMLReader extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(XMLREADER_SHARED_LIBADD, [ - AC_DEFINE(HAVE_XMLREADER,1,[ ]) - PHP_NEW_EXTENSION(xmlreader, php_xmlreader.c, $ext_shared) - PHP_ADD_EXTENSION_DEP(xmlreader, dom, true) - PHP_SUBST(XMLREADER_SHARED_LIBADD) - ], [ - AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) - ]) -fi diff --git a/ext/xmlreader/config.w32 b/ext/xmlreader/config.w32 deleted file mode 100644 index 703f2bc4dfdae..0000000000000 --- a/ext/xmlreader/config.w32 +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("xmlreader", "XMLReader support", "yes"); - -if (PHP_XMLREADER == "yes" && PHP_LIBXML == "yes") { - EXTENSION("xmlreader", "php_xmlreader.c"); - AC_DEFINE("HAVE_XMLREADER", 1, "XMLReader support"); - if (!PHP_XMLREADER_SHARED) { - ADD_FLAG("CFLAGS_XMLREADER", "/D LIBXML_STATIC"); - } - ADD_EXTENSION_DEP('xmlreader', 'libxml'); -} - diff --git a/ext/xmlreader/examples/dtdexample.dtd b/ext/xmlreader/examples/dtdexample.dtd deleted file mode 100644 index ce53f0bc18c94..0000000000000 --- a/ext/xmlreader/examples/dtdexample.dtd +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/ext/xmlreader/examples/dtdexample.xml b/ext/xmlreader/examples/dtdexample.xml deleted file mode 100644 index 052889c05d296..0000000000000 --- a/ext/xmlreader/examples/dtdexample.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - -Move Title 1 -Location 1 - - - -Move Title 2 - -Location 2 - - - diff --git a/ext/xmlreader/examples/relaxNG.rng b/ext/xmlreader/examples/relaxNG.rng deleted file mode 100644 index f4357e04ef8ab..0000000000000 --- a/ext/xmlreader/examples/relaxNG.rng +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/ext/xmlreader/examples/relaxNG.xml b/ext/xmlreader/examples/relaxNG.xml deleted file mode 100644 index 6b0cac1225050..0000000000000 --- a/ext/xmlreader/examples/relaxNG.xml +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/ext/xmlreader/examples/relaxNG2.rng b/ext/xmlreader/examples/relaxNG2.rng deleted file mode 100644 index 4adae7b15113d..0000000000000 --- a/ext/xmlreader/examples/relaxNG2.rng +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/xmlreader/examples/relaxNG3.rng b/ext/xmlreader/examples/relaxNG3.rng deleted file mode 100644 index 73e1eb6165102..0000000000000 --- a/ext/xmlreader/examples/relaxNG3.rng +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ext/xmlreader/examples/xmlreader.xml b/ext/xmlreader/examples/xmlreader.xml deleted file mode 100644 index 4c53743de66b5..0000000000000 --- a/ext/xmlreader/examples/xmlreader.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - - diff --git a/ext/xmlreader/examples/xmlreader_file.php b/ext/xmlreader/examples/xmlreader_file.php deleted file mode 100644 index 531e20b6f8b96..0000000000000 --- a/ext/xmlreader/examples/xmlreader_file.php +++ /dev/null @@ -1,20 +0,0 @@ -open('xmlreader.xml'); -while ($reader->read()) { - if ($reader->nodeType != XMLREADER::END_ELEMENT) { - print "Node Name: ".$reader->name."\n"; - print "Node Value: ".$reader->value."\n"; - print "Node Depth: ".$reader->depth."\n"; - if ($reader->nodeType==XMLREADER::ELEMENT && $reader->hasAttributes) { - $attr = $reader->moveToFirstAttribute(); - while ($attr) { - print " Attribute Name: ".$reader->name."\n"; - print " Attribute Value: ".$reader->value."\n"; - $attr = $reader->moveToNextAttribute(); - } - } - print "\n"; - } -} -?> diff --git a/ext/xmlreader/examples/xmlreader_relaxNG.php b/ext/xmlreader/examples/xmlreader_relaxNG.php deleted file mode 100644 index e56739a2fb267..0000000000000 --- a/ext/xmlreader/examples/xmlreader_relaxNG.php +++ /dev/null @@ -1,25 +0,0 @@ -open('relaxNG.xml'); -/* -Example setting relaxNG using string: -$reader->setRelaxNGSchemaSource(file_get_contents('relaxNG.rng')); -*/ -if ($reader->setRelaxNGSchema('relaxNG.rng')) { - while ($reader->read()) { - /* Print node name indenting it based on depth and $indent var */ - print str_repeat(" ", $reader->depth * $indent).$reader->name."\n"; - } -} - -print "\n"; - -if (! $reader->isValid()) { - print "Document is not valid\n"; -} else { - print "Document is valid\n"; -} - -?> \ No newline at end of file diff --git a/ext/xmlreader/examples/xmlreader_string.php b/ext/xmlreader/examples/xmlreader_string.php deleted file mode 100644 index f267245fd93f0..0000000000000 --- a/ext/xmlreader/examples/xmlreader_string.php +++ /dev/null @@ -1,31 +0,0 @@ - - - The Grapes of Wrath - John Steinbeck - - - The Pearl - John Steinbeck - -'; - -$reader = new XMLReader(); -$reader->XML($xmlstring); -while ($reader->read()) { - if ($reader->nodeType != XMLREADER::END_ELEMENT) { - print "Node Name: ".$reader->name."\n"; - print "Node Value: ".$reader->value."\n"; - print "Node Depth: ".$reader->depth."\n"; - if ($reader->nodeType==XMLREADER::ELEMENT && $reader->hasAttributes) { - $attr = $reader->moveToFirstAttribute(); - while ($attr) { - print " Attribute Name: ".$reader->name."\n"; - print " Attribute Value: ".$reader->value."\n"; - $attr = $reader->moveToNextAttribute(); - } - } - print "\n"; - } -} -?> diff --git a/ext/xmlreader/examples/xmlreader_validatedtd.php b/ext/xmlreader/examples/xmlreader_validatedtd.php deleted file mode 100644 index 520a61ee30dde..0000000000000 --- a/ext/xmlreader/examples/xmlreader_validatedtd.php +++ /dev/null @@ -1,18 +0,0 @@ -open("dtdexample.xml"); -$xml->setParserProperty(XMLREADER::LOADDTD, TRUE); -$xml->setParserProperty(XMLREADER::VALIDATE, TRUE); -while($xml->read()) { - /* Print node name indenting it based on depth and $indent var */ - print str_repeat(" ", $xml->depth * $indent).$xml->name."\n"; - if ($xml->hasAttributes) { - $attCount = $xml->attributeCount; - print str_repeat(" ", $xml->depth * $indent)." Number of Attributes: ".$xml->attributeCount."\n"; - } -} -print "\n\nValid:\n"; -var_dump($xml->isValid()); -?> \ No newline at end of file diff --git a/ext/xmlreader/package.xml b/ext/xmlreader/package.xml deleted file mode 100644 index 6536b78c1f1c1..0000000000000 --- a/ext/xmlreader/package.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - xmlreader - Provides fast, non-cached, forward-only access to XML data under PHP 5. - - This extension wraps the libxml xmlReader API. The reader acts as a cursor - going forward on the document stream and stopping at each node in the way. - xmlReader is similar to SAX though uses a much simpler API. - - PHP License - - - rrichards - Rob Richards - rrichards@php.net - lead - - - chregu - lead - Christian Stocker - chregu@php.net - - - - - 1.0.1 - 2005-04-30 - stable - - Add workaround for next() bug when using libxml 2.6.17 and lower. - - - - - - 1.0 - 2004-07-27 - stable - - Add name parameter to next() to skip to next named sibling node. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - libxml - - diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c deleted file mode 100644 index 24e734e873289..0000000000000 --- a/ext/xmlreader/php_xmlreader.c +++ /dev/null @@ -1,1433 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_xmlreader.h" -#ifdef HAVE_DOM -#include "ext/dom/xml_common.h" -#endif -#include - -zend_class_entry *xmlreader_class_entry; - -static zend_object_handlers xmlreader_object_handlers; -static zend_object_handlers xmlreader_object_handlers_ze1; - -static HashTable xmlreader_prop_handlers; - -typedef int (*xmlreader_read_int_t)(xmlTextReaderPtr reader); -typedef unsigned char *(*xmlreader_read_char_t)(xmlTextReaderPtr reader); -typedef const unsigned char *(*xmlreader_read_const_char_t)(xmlTextReaderPtr reader); -typedef int (*xmlreader_write_t)(xmlreader_object *obj, zval *newval TSRMLS_DC); - -typedef unsigned char *(*xmlreader_read_one_char_t)(xmlTextReaderPtr reader, const unsigned char *); - -typedef struct _xmlreader_prop_handler { - xmlreader_read_int_t read_int_func; - xmlreader_read_const_char_t read_char_func; - xmlreader_write_t write_func; - int type; -} xmlreader_prop_handler; - -#define XMLREADER_LOAD_STRING 0 -#define XMLREADER_LOAD_FILE 1 - -/* {{{ xmlreader_register_prop_handler */ -static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_const_char_t read_char_func, int rettype TSRMLS_DC) -{ - xmlreader_prop_handler hnd; - - hnd.read_char_func = read_char_func; - hnd.read_int_func = read_int_func; - hnd.type = rettype; - zend_hash_add(prop_handler, name, strlen(name)+1, &hnd, sizeof(xmlreader_prop_handler), NULL); -} -/* }}} */ - -/* {{{ xmlreader_property_reader */ -static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handler *hnd, zval **retval TSRMLS_DC) -{ - const xmlChar *retchar = NULL; - int retint = 0; - - if (obj->ptr != NULL) { - if (hnd->read_char_func) { - retchar = hnd->read_char_func(obj->ptr); - } else { - if (hnd->read_int_func) { - retint = hnd->read_int_func(obj->ptr); - if (retint == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal libxml error returned"); - return FAILURE; - } - } - } - } - - ALLOC_ZVAL(*retval); - - switch (hnd->type) { - case IS_STRING: - if (retchar) { - ZVAL_STRING(*retval, (xmlChar *) retchar, 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - break; - case IS_BOOL: - ZVAL_BOOL(*retval, retint); - break; - case IS_LONG: - ZVAL_LONG(*retval, retint); - break; - default: - ZVAL_NULL(*retval); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ xmlreader_get_property_ptr_ptr */ -zval **xmlreader_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) -{ - xmlreader_object *obj; - zval tmp_member; - zval **retval = NULL; - xmlreader_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret = FAILURE; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - obj = (xmlreader_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - if (ret == FAILURE) { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->get_property_ptr_ptr(object, member TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} -/* }}} */ - -/* {{{ xmlreader_read_property */ -zval *xmlreader_read_property(zval *object, zval *member, int type TSRMLS_DC) -{ - xmlreader_object *obj; - zval tmp_member; - zval *retval; - xmlreader_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (xmlreader_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - if (ret == SUCCESS) { - ret = xmlreader_property_reader(obj, hnd, &retval TSRMLS_CC); - if (ret == SUCCESS) { - /* ensure we're creating a temporary variable */ - retval->refcount = 0; - } else { - retval = EG(uninitialized_zval_ptr); - } - } else { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->read_property(object, member, type TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} -/* }}} */ - -/* {{{ xmlreader_write_property */ -void xmlreader_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - xmlreader_object *obj; - zval tmp_member; - xmlreader_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (xmlreader_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find((HashTable *)obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - if (ret == SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write to read-only property"); - } else { - std_hnd = zend_get_std_object_handlers(); - std_hnd->write_property(object, member, value TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } -} -/* }}} */ - -/* {{{ _xmlreader_get_valid_file_path */ -/* _xmlreader_get_valid_file_path and _xmlreader_get_relaxNG should be made a - common function in libxml extension as code is common to a few xml extensions */ -char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) { - xmlURI *uri; - xmlChar *escsource; - char *file_dest; - int isFileUri = 0; - - uri = xmlCreateURI(); - escsource = xmlURIEscapeStr(source, ":"); - xmlParseURIReference(uri, escsource); - xmlFree(escsource); - - if (uri->scheme != NULL) { - /* absolute file uris - libxml only supports localhost or empty host */ - if (strncasecmp(source, "file:///",8) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 8; -#else - source += 7; -#endif - } else if (strncasecmp(source, "file://localhost/",17) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 17; -#else - source += 16; -#endif - } - } - - file_dest = source; - - if ((uri->scheme == NULL || isFileUri)) { - if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) { - xmlFreeURI(uri); - return NULL; - } - file_dest = resolved_path; - } - - xmlFreeURI(uri); - - return file_dest; -} -/* }}} */ - -#ifdef LIBXML_SCHEMAS_ENABLED -/* {{{ _xmlreader_get_relaxNG */ -static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, int source_len, int type, - xmlRelaxNGValidityErrorFunc error_func, - xmlRelaxNGValidityWarningFunc warn_func TSRMLS_DC) -{ - char *valid_file = NULL; - xmlRelaxNGParserCtxtPtr parser = NULL; - xmlRelaxNGPtr sptr; - char resolved_path[MAXPATHLEN + 1]; - - switch (type) { - case XMLREADER_LOAD_FILE: - valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (!valid_file) { - return NULL; - } - parser = xmlRelaxNGNewParserCtxt(valid_file); - break; - case XMLREADER_LOAD_STRING: - parser = xmlRelaxNGNewMemParserCtxt(source, source_len); - /* If loading from memory, we need to set the base directory for the document - but it is not apparent how to do that for schema's */ - break; - default: - return NULL; - } - - if (parser == NULL) { - return NULL; - } - - if (error_func || warn_func) { - xmlRelaxNGSetParserErrors(parser, - (xmlRelaxNGValidityErrorFunc) error_func, - (xmlRelaxNGValidityWarningFunc) warn_func, - parser); - } - sptr = xmlRelaxNGParse(parser); - xmlRelaxNGFreeParserCtxt(parser); - - return sptr; -} -/* }}} */ -#endif - -static zend_module_dep xmlreader_deps[] = { - ZEND_MOD_REQUIRED("libxml") - {NULL, NULL, NULL} -}; - -/* {{{ xmlreader_module_entry - */ -zend_module_entry xmlreader_module_entry = { - STANDARD_MODULE_HEADER_EX, NULL, - xmlreader_deps, - "xmlreader", - NULL, - PHP_MINIT(xmlreader), - PHP_MSHUTDOWN(xmlreader), - NULL, - NULL, - PHP_MINFO(xmlreader), - "0.1", /* Replace with version number for your extension */ - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_XMLREADER -ZEND_GET_MODULE(xmlreader) -#endif - -/* {{{ xmlreader_objects_clone */ -void xmlreader_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - /* TODO */ -} -/* }}} */ - -/* {{{ xmlreader_objects_ze1_clone_obj */ -zend_object_value xmlreader_objects_ze1_clone_obj(zval *object TSRMLS_DC) -{ - php_error(E_ERROR, "Cannot clone object of class %s due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(object)->name); - return object->value.obj; -} -/* }}} */ - -/* {{{ xmlreader_free_resources */ -static void xmlreader_free_resources(xmlreader_object *intern) { - if (intern) { - if (intern->input) { - xmlFreeParserInputBuffer(intern->input); - intern->input = NULL; - } - - if (intern->ptr) { - xmlFreeTextReader(intern->ptr); - intern->ptr = NULL; - } -#ifdef LIBXML_SCHEMAS_ENABLED - if (intern->schema) { - xmlRelaxNGFree((xmlRelaxNGPtr) intern->schema); - intern->schema = NULL; - } -#endif - } -} -/* }}} */ - -/* {{{ xmlreader_objects_free_storage */ -void xmlreader_objects_free_storage(void *object TSRMLS_DC) -{ - xmlreader_object *intern = (xmlreader_object *)object; - - zend_object_std_dtor(&intern->std TSRMLS_CC); - - xmlreader_free_resources(intern); - - efree(object); -} -/* }}} */ - -/* {{{ xmlreader_objects_new */ -zend_object_value xmlreader_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - xmlreader_object *intern; - zval *tmp; - - intern = emalloc(sizeof(xmlreader_object)); - memset(&intern->std, 0, sizeof(zend_object)); - intern->ptr = NULL; - intern->input = NULL; - intern->schema = NULL; - intern->prop_handler = &xmlreader_prop_handlers; - - zend_object_std_init(&intern->std, class_type TSRMLS_CC); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) xmlreader_objects_free_storage, xmlreader_objects_clone TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = EG(ze1_compatibility_mode) ? &xmlreader_object_handlers_ze1 : &xmlreader_object_handlers; - return retval; -} -/* }}} */ - -/* {{{ php_xmlreader_string_arg */ -static void php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_one_char_t internal_function) { - zval *id; - int name_len = 0; - char *retchar = NULL; - xmlreader_object *intern; - char *name; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - if (!name_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument cannot be an empty string"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retchar = internal_function(intern->ptr, name); - } - if (retchar) { - RETVAL_STRING(retchar, 1); - xmlFree(retchar); - return; - } else { - RETVAL_NULL(); - } -} -/* }}} */ - -/* {{{ php_xmlreader_no_arg */ -static void php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_int_t internal_function) { - zval *id; - int retval; - xmlreader_object *intern; - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = internal_function(intern->ptr); - if (retval == 1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -#if LIBXML_VERSION >= 20620 -/* {{{ php_xmlreader_no_arg_string */ -static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_char_t internal_function) { - zval *id; - char *retchar = NULL; - xmlreader_object *intern; - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retchar = internal_function(intern->ptr); - } - if (retchar) { - RETVAL_STRING(retchar, 1); - xmlFree(retchar); - return; - } else { - RETVAL_EMPTY_STRING(); - } -} -/* }}} */ -#endif - -/* {{{ php_xmlreader_set_relaxng_schema */ -static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int type) { -#ifdef LIBXML_SCHEMAS_ENABLED - zval *id; - int source_len = 0, retval = -1; - xmlreader_object *intern; - xmlRelaxNGPtr schema = NULL; - char *source; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &source, &source_len) == FAILURE) { - return; - } - - if (source != NULL && !source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Schema data source is required"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - if (source) { - schema = _xmlreader_get_relaxNG(source, source_len, type, NULL, NULL TSRMLS_CC); - if (schema) { - retval = xmlTextReaderRelaxNGSetSchema(intern->ptr, schema); - } - } else { - /* unset the associated relaxNG context and schema if one exists */ - retval = xmlTextReaderRelaxNGSetSchema(intern->ptr, NULL); - } - - if (retval == 0) { - if (intern->schema) { - xmlRelaxNGFree((xmlRelaxNGPtr) intern->schema); - } - - intern->schema = schema; - - RETURN_TRUE; - } - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors."); - - RETURN_FALSE; -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No Schema support built into libxml."); - - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto boolean XMLReader::close() -Closes xmlreader - current frees resources until xmlTextReaderClose is fixed in libxml */ -PHP_METHOD(xmlreader, close) -{ - zval *id; - xmlreader_object *intern; - - id = getThis(); - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - /* libxml is segfaulting in versions up to 2.6.8 using xmlTextReaderClose so for - now we will free the whole reader when close is called as it would get rebuilt on - a new load anyways */ - xmlreader_free_resources(intern); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string XMLReader::getAttribute(string name) -Get value of an attribute from current element */ -PHP_METHOD(xmlreader, getAttribute) -{ - php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderGetAttribute); -} -/* }}} */ - -/* {{{ proto string XMLReader::getAttributeNo(int index) -Get value of an attribute at index from current element */ -PHP_METHOD(xmlreader, getAttributeNo) -{ - zval *id; - long attr_pos; - char *retchar = NULL; - xmlreader_object *intern; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) { - return; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retchar = xmlTextReaderGetAttributeNo(intern->ptr,attr_pos); - } - if (retchar) { - RETVAL_STRING(retchar, 1); - xmlFree(retchar); - return; - } else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ proto string XMLReader::getAttributeNs(string name, string namespaceURI) -Get value of a attribute via name and namespace from current element */ -PHP_METHOD(xmlreader, getAttributeNs) -{ - zval *id; - int name_len = 0, ns_uri_len = 0; - xmlreader_object *intern; - char *name, *ns_uri, *retchar = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) { - return; - } - - if (name_len == 0 || ns_uri_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retchar = xmlTextReaderGetAttributeNs(intern->ptr, name, ns_uri); - } - if (retchar) { - RETVAL_STRING(retchar, 1); - xmlFree(retchar); - return; - } else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ proto boolean XMLReader::getParserProperty(int property) -Indicates whether given property (one of the parser option constants) is set or not on parser */ -PHP_METHOD(xmlreader, getParserProperty) -{ - zval *id; - long property; - int retval = -1; - xmlreader_object *intern; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &property) == FAILURE) { - return; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderGetParserProp(intern->ptr,property); - } - if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property"); - RETURN_FALSE; - } - - RETURN_BOOL(retval); -} -/* }}} */ - -/* {{{ proto boolean XMLReader::isValid() -Returns boolean indicating if parsed document is valid or not. -Must set XMLREADER_LOADDTD or XMLREADER_VALIDATE parser option prior to the first call to read -or this method will always return FALSE */ -PHP_METHOD(xmlreader, isValid) -{ - php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderIsValid); -} -/* }}} */ - -/* {{{ proto string XMLReader::lookupNamespace(string prefix) -Return namespaceURI for associated prefix on current node */ -PHP_METHOD(xmlreader, lookupNamespace) -{ - php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderLookupNamespace); -} -/* }}} */ - -/* {{{ proto boolean XMLReader::moveToAttribute(string name) -Positions reader at specified attribute - Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttribute) -{ - zval *id; - int name_len = 0, retval; - xmlreader_object *intern; - char *name; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - if (name_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderMoveToAttribute(intern->ptr, name); - if (retval == 1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean XMLReader::moveToAttributeNo(int index) -Positions reader at attribute at spcecified index. -Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttributeNo) -{ - zval *id; - long attr_pos; - int retval; - xmlreader_object *intern; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) { - return; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderMoveToAttributeNo(intern->ptr, attr_pos); - if (retval == 1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean XMLReader::moveToAttributeNs(string name, string namespaceURI) -Positions reader at attribute spcified by name and namespaceURI. -Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttributeNs) -{ - zval *id; - int name_len=0, ns_uri_len=0, retval; - xmlreader_object *intern; - char *name, *ns_uri; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) { - return; - } - - if (name_len == 0 || ns_uri_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderMoveToAttributeNs(intern->ptr, name, ns_uri); - if (retval == 1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean XMLReader::moveToElement() -Moves the position of the current instance to the node that contains the current Attribute node. */ -PHP_METHOD(xmlreader, moveToElement) -{ - php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToElement); -} -/* }}} */ - -/* {{{ proto boolean XMLReader::moveToFirstAttribute() -Moves the position of the current instance to the first attribute associated with the current node. */ -PHP_METHOD(xmlreader, moveToFirstAttribute) -{ - php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToFirstAttribute); -} -/* }}} */ - -/* {{{ proto boolean XMLReader::moveToNextAttribute() -Moves the position of the current instance to the next attribute associated with the current node. */ -PHP_METHOD(xmlreader, moveToNextAttribute) -{ - php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToNextAttribute); -} -/* }}} */ - -/* {{{ proto boolean XMLReader::read() -Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, read) -{ - zval *id; - int retval; - xmlreader_object *intern; - - id = getThis(); - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL && intern->ptr != NULL) { - retval = xmlTextReaderRead(intern->ptr); - if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading"); - RETURN_FALSE; - } else { - RETURN_BOOL(retval); - } - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read"); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean XMLReader::next([string localname]) -Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, next) -{ - zval *id; - int retval, name_len=0; - xmlreader_object *intern; - char *name = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { - return; - } - - id = getThis(); - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern != NULL && intern->ptr != NULL) { -#if LIBXML_VERSION <= 20617 - /* Bug in libxml prevents a next in certain cases when positioned on end of element */ - if (xmlTextReaderNodeType(intern->ptr) == XML_READER_TYPE_END_ELEMENT) { - retval = xmlTextReaderRead(intern->ptr); - } else -#endif - retval = xmlTextReaderNext(intern->ptr); - while (name != NULL && retval == 1) { - if (xmlStrEqual(xmlTextReaderConstLocalName(intern->ptr), name)) { - RETURN_TRUE; - } - retval = xmlTextReaderNext(intern->ptr); - } - if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading"); - RETURN_FALSE; - } else { - RETURN_BOOL(retval); - } - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read"); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean XMLReader::open(string URI [, string encoding [, int options]]) -Sets the URI that the the XMLReader will parse. */ -PHP_METHOD(xmlreader, open) -{ - zval *id; - int source_len = 0, encoding_len = 0; - long options = 0; - xmlreader_object *intern = NULL; - char *source, *valid_file = NULL; - char *encoding = NULL; - char resolved_path[MAXPATHLEN + 1]; - xmlTextReaderPtr reader = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) { - return; - } - - id = getThis(); - if (id != NULL) { - if (! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) { - id = NULL; - } else { - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - xmlreader_free_resources(intern); - } - } - - if (!source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; - } - - valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - - if (valid_file) { - reader = xmlReaderForFile(valid_file, encoding, options); - } - - if (reader == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open source data"); - RETURN_FALSE; - } - - if (id == NULL) { - object_init_ex(return_value, xmlreader_class_entry); - intern = (xmlreader_object *)zend_objects_get_address(return_value TSRMLS_CC); - intern->ptr = reader; - return; - } - - intern->ptr = reader; - - RETURN_TRUE; - -} -/* }}} */ - -/* Not Yet Implemented in libxml - functions exist just not coded -PHP_METHOD(xmlreader, resetState) -{ - -} -*/ - -#if LIBXML_VERSION >= 20620 -/* {{{ proto boolean XMLReader::readInnerXml() -Reads the contents of the current node, including child nodes and markup. */ -PHP_METHOD(xmlreader, readInnerXml) -{ - php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadInnerXml); -} -/* }}} */ - -/* {{{ proto boolean XMLReader::readOuterXml() -Reads the contents of the current node, including child nodes and markup. */ -PHP_METHOD(xmlreader, readOuterXml) -{ - php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadOuterXml); -} -/* }}} */ - -/* {{{ proto boolean XMLReader::readString() -Reads the contents of an element or a text node as a string. */ -PHP_METHOD(xmlreader, readString) -{ - php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadString); -} -/* }}} */ - -/* {{{ proto boolean XMLReader::setSchema(string filename) -Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). */ -PHP_METHOD(xmlreader, setSchema) -{ -#ifdef LIBXML_SCHEMAS_ENABLED - zval *id; - int source_len = 0, retval = -1; - xmlreader_object *intern; - char *source; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &source, &source_len) == FAILURE) { - return; - } - - if (source != NULL && !source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Schema data source is required"); - RETURN_FALSE; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderSchemaValidate(intern->ptr, source); - - if (retval == 0) { - RETURN_TRUE; - } - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors."); - - RETURN_FALSE; -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No Schema support built into libxml."); - - RETURN_FALSE; -#endif -} -/* }}} */ -#endif - -/* {{{ proto boolean XMLReader::setParserProperty(int property, boolean value) -Sets parser property (one of the parser option constants). -Properties must be set after open() or XML() and before the first read() is called */ -PHP_METHOD(xmlreader, setParserProperty) -{ - zval *id; - long property; - int retval = -1; - zend_bool value; - xmlreader_object *intern; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &property, &value) == FAILURE) { - return; - } - - id = getThis(); - - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - if (intern && intern->ptr) { - retval = xmlTextReaderSetParserProp(intern->ptr,property, value); - } - if (retval == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property"); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto boolean XMLReader::setRelaxNGSchema(string filename) -Sets the string that the the XMLReader will parse. */ -PHP_METHOD(xmlreader, setRelaxNGSchema) -{ - php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_FILE); -} -/* }}} */ - -/* {{{ proto boolean XMLReader::setRelaxNGSchemaSource(string source) -Sets the string that the the XMLReader will parse. */ -PHP_METHOD(xmlreader, setRelaxNGSchemaSource) -{ - php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_STRING); -} -/* }}} */ - -/* TODO -XMLPUBFUN int XMLCALL - xmlTextReaderSetSchema (xmlTextReaderPtr reader, - xmlSchemaPtr schema); -*/ - -/* {{{ proto boolean XMLReader::XML(string source [, string encoding [, int options]]) -Sets the string that the the XMLReader will parse. */ -PHP_METHOD(xmlreader, XML) -{ - zval *id; - int source_len = 0, encoding_len = 0; - long options = 0; - xmlreader_object *intern = NULL; - char *source, *uri = NULL, *encoding = NULL; - int resolved_path_len, ret = 0; - char *directory=NULL, resolved_path[MAXPATHLEN]; - xmlParserInputBufferPtr inputbfr; - xmlTextReaderPtr reader; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) { - return; - } - - id = getThis(); - if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) { - id = NULL; - } - if (id != NULL) { - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - xmlreader_free_resources(intern); - } - - if (!source_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; - } - - inputbfr = xmlParserInputBufferCreateMem(source, source_len, XML_CHAR_ENCODING_NONE); - - if (inputbfr != NULL) { -/* Get the URI of the current script so that we can set the base directory in libxml */ -#if HAVE_GETCWD - directory = VCWD_GETCWD(resolved_path, MAXPATHLEN); -#elif HAVE_GETWD - directory = VCWD_GETWD(resolved_path); -#endif - if (directory) { - resolved_path_len = strlen(resolved_path); - if (resolved_path[resolved_path_len - 1] != DEFAULT_SLASH) { - resolved_path[resolved_path_len] = DEFAULT_SLASH; - resolved_path[++resolved_path_len] = '\0'; - } - uri = (char *) xmlCanonicPath((const xmlChar *) resolved_path); - } - reader = xmlNewTextReader(inputbfr, uri); - if (uri) { - xmlFree(uri); - } - if (reader != NULL) { -#if LIBXML_VERSION >= 20628 - ret = xmlTextReaderSetup(reader, NULL, uri, encoding, options); -#endif - if (ret == 0) { - if (id == NULL) { - object_init_ex(return_value, xmlreader_class_entry); - intern = (xmlreader_object *)zend_objects_get_address(return_value TSRMLS_CC); - } else { - RETVAL_TRUE; - } - intern->input = inputbfr; - intern->ptr = reader; - return; - } - } - } - - if (inputbfr) { - xmlFreeParserInputBuffer(inputbfr); - } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load source data"); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto boolean XMLReader::expand() -Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, expand) -{ -#ifdef HAVE_DOM - zval *id, *rv = NULL; - int ret; - xmlreader_object *intern; - xmlNode *node, *nodec; - - id = getThis(); - intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); - - if (intern && intern->ptr) { - node = xmlTextReaderExpand(intern->ptr); - - if (node == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while expanding "); - RETURN_FALSE; - } else { - nodec = xmlCopyNode(node, 1); - if (nodec == NULL) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot expand this node type"); - RETURN_FALSE; - } else { - DOM_RET_OBJ(rv, nodec, &ret, NULL); - } - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to expand"); - RETURN_FALSE; - } -#else - php_error(E_WARNING, "DOM support is not enabled"); - return; -#endif -} -/* }}} */ -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_close, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_getAttribute, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_getAttributeNo, 0) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_getAttributeNs, 0) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, namespaceURI) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_getParserProperty, 0) - ZEND_ARG_INFO(0, property) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_isValid, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_lookupNamespace, 0) -ZEND_ARG_INFO(0, prefix) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_moveToAttribute, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_moveToAttributeNo, 0) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_moveToAttributeNs, 0) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, namespaceURI) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_moveToElement, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_moveToFirstAttribute, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_moveToNextAttribute, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_read, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xmlreader_next, 0, 0, 0) - ZEND_ARG_INFO(0, localname) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xmlreader_open, 0, 0, 1) - ZEND_ARG_INFO(0, URI) - ZEND_ARG_INFO(0, encoding) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_readInnerXml, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_readOuterXml, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_readString, 0) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_setSchema, 0) - ZEND_ARG_INFO(0, filename) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_setParserProperty, 0) - ZEND_ARG_INFO(0, property) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_setRelaxNGSchema, 0) - ZEND_ARG_INFO(0, filename) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_setRelaxNGSchemaSource, 0) - ZEND_ARG_INFO(0, source) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xmlreader_XML, 0, 0, 1) - ZEND_ARG_INFO(0, source) - ZEND_ARG_INFO(0, encoding) - ZEND_ARG_INFO(0, options) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_xmlreader_expand, 0) -ZEND_END_ARG_INFO() -/* }}} */ - -static zend_function_entry xmlreader_functions[] = { - PHP_ME(xmlreader, close, arginfo_xmlreader_close, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttribute, arginfo_xmlreader_getAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttributeNo, arginfo_xmlreader_getAttributeNo, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttributeNs, arginfo_xmlreader_getAttributeNs, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getParserProperty, arginfo_xmlreader_getParserProperty, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, isValid, arginfo_xmlreader_isValid, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, lookupNamespace, arginfo_xmlreader_lookupNamespace, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttributeNo, arginfo_xmlreader_moveToAttributeNo, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttribute, arginfo_xmlreader_moveToAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttributeNs, arginfo_xmlreader_moveToAttributeNs, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToElement, arginfo_xmlreader_moveToElement, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToFirstAttribute, arginfo_xmlreader_moveToFirstAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToNextAttribute, arginfo_xmlreader_moveToNextAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, open, arginfo_xmlreader_open, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(xmlreader, read, arginfo_xmlreader_read, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, next, arginfo_xmlreader_next, ZEND_ACC_PUBLIC) -#if LIBXML_VERSION >= 20620 - PHP_ME(xmlreader, readInnerXml, arginfo_xmlreader_readInnerXml, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readOuterXml, arginfo_xmlreader_readOuterXml, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readString, arginfo_xmlreader_readString, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setSchema, arginfo_xmlreader_setSchema, ZEND_ACC_PUBLIC) -#endif -/* Not Yet Implemented though defined in libxml as of 2.6.9dev - PHP_ME(xmlreader, resetState, NULL, ZEND_ACC_PUBLIC) -*/ - PHP_ME(xmlreader, setParserProperty, arginfo_xmlreader_setParserProperty, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setRelaxNGSchema, arginfo_xmlreader_setRelaxNGSchema, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setRelaxNGSchemaSource, arginfo_xmlreader_setRelaxNGSchemaSource, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, XML, arginfo_xmlreader_XML, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC) - PHP_ME(xmlreader, expand, arginfo_xmlreader_expand, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(xmlreader) -{ - - zend_class_entry ce; - - memcpy(&xmlreader_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - xmlreader_object_handlers.read_property = xmlreader_read_property; - xmlreader_object_handlers.write_property = xmlreader_write_property; - xmlreader_object_handlers.get_property_ptr_ptr = xmlreader_get_property_ptr_ptr; - - memcpy(&xmlreader_object_handlers_ze1, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - xmlreader_object_handlers_ze1.read_property = xmlreader_read_property; - xmlreader_object_handlers_ze1.write_property = xmlreader_write_property; - xmlreader_object_handlers_ze1.get_property_ptr_ptr = xmlreader_get_property_ptr_ptr; - xmlreader_object_handlers_ze1.clone_obj = xmlreader_objects_ze1_clone_obj; - - INIT_CLASS_ENTRY(ce, "XMLReader", xmlreader_functions); - ce.create_object = xmlreader_objects_new; - xmlreader_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - - zend_hash_init(&xmlreader_prop_handlers, 0, NULL, NULL, 1); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "attributeCount", xmlTextReaderAttributeCount, NULL, IS_LONG TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "baseURI", NULL, xmlTextReaderConstBaseUri, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "depth", xmlTextReaderDepth, NULL, IS_LONG TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasAttributes", xmlTextReaderHasAttributes, NULL, IS_BOOL TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasValue", xmlTextReaderHasValue, NULL, IS_BOOL TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isDefault", xmlTextReaderIsDefault, NULL, IS_BOOL TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isEmptyElement", xmlTextReaderIsEmptyElement, NULL, IS_BOOL TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "localName", NULL, xmlTextReaderConstLocalName, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "name", NULL, xmlTextReaderConstName, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "namespaceURI", NULL, xmlTextReaderConstNamespaceUri, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "nodeType", xmlTextReaderNodeType, NULL, IS_LONG TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "prefix", NULL, xmlTextReaderConstPrefix, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "value", NULL, xmlTextReaderConstValue, IS_STRING TSRMLS_CC); - xmlreader_register_prop_handler(&xmlreader_prop_handlers, "xmlLang", NULL, xmlTextReaderConstXmlLang, IS_STRING TSRMLS_CC); - - /* Constants for NodeType - cannot define common types to share with dom as there are differences in these types */ - - REGISTER_XMLREADER_CLASS_CONST_LONG("NONE", XML_READER_TYPE_NONE); - REGISTER_XMLREADER_CLASS_CONST_LONG("ELEMENT", XML_READER_TYPE_ELEMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("ATTRIBUTE", XML_READER_TYPE_ATTRIBUTE); - REGISTER_XMLREADER_CLASS_CONST_LONG("TEXT", XML_READER_TYPE_TEXT); - REGISTER_XMLREADER_CLASS_CONST_LONG("CDATA", XML_READER_TYPE_CDATA); - REGISTER_XMLREADER_CLASS_CONST_LONG("ENTITY_REF", XML_READER_TYPE_ENTITY_REFERENCE); - REGISTER_XMLREADER_CLASS_CONST_LONG("ENTITY", XML_READER_TYPE_ENTITY); - REGISTER_XMLREADER_CLASS_CONST_LONG("PI", XML_READER_TYPE_PROCESSING_INSTRUCTION); - REGISTER_XMLREADER_CLASS_CONST_LONG("COMMENT", XML_READER_TYPE_COMMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("DOC", XML_READER_TYPE_DOCUMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("DOC_TYPE", XML_READER_TYPE_DOCUMENT_TYPE); - REGISTER_XMLREADER_CLASS_CONST_LONG("DOC_FRAGMENT", XML_READER_TYPE_DOCUMENT_FRAGMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("NOTATION", XML_READER_TYPE_NOTATION); - REGISTER_XMLREADER_CLASS_CONST_LONG("WHITESPACE", XML_READER_TYPE_WHITESPACE); - REGISTER_XMLREADER_CLASS_CONST_LONG("SIGNIFICANT_WHITESPACE", XML_READER_TYPE_SIGNIFICANT_WHITESPACE); - REGISTER_XMLREADER_CLASS_CONST_LONG("END_ELEMENT", XML_READER_TYPE_END_ELEMENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("END_ENTITY", XML_READER_TYPE_END_ENTITY); - REGISTER_XMLREADER_CLASS_CONST_LONG("XML_DECLARATION", XML_READER_TYPE_XML_DECLARATION); - - /* Constants for Parser options */ - REGISTER_XMLREADER_CLASS_CONST_LONG("LOADDTD", XML_PARSER_LOADDTD); - REGISTER_XMLREADER_CLASS_CONST_LONG("DEFAULTATTRS", XML_PARSER_DEFAULTATTRS); - REGISTER_XMLREADER_CLASS_CONST_LONG("VALIDATE", XML_PARSER_VALIDATE); - REGISTER_XMLREADER_CLASS_CONST_LONG("SUBST_ENTITIES", XML_PARSER_SUBST_ENTITIES); - - /* Constants for Errors when loading - not yet used until we implement custom error handling - REGISTER_XMLREADER_CLASS_CONST_LONG("VALIDITY_WARNING", XML_PARSER_SEVERITY_VALIDITY_WARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("VALIDITY_ERROR", XML_PARSER_SEVERITY_VALIDITY_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("WARNING", XML_PARSER_SEVERITY_WARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_XMLREADER_CLASS_CONST_LONG("ERROR", XML_PARSER_SEVERITY_ERROR, CONST_CS | CONST_PERSISTENT); - */ - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(xmlreader) -{ - zend_hash_destroy(&xmlreader_prop_handlers); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(xmlreader) -{ - php_info_print_table_start(); - { - php_info_print_table_row(2, "XMLReader", "enabled"); - } - php_info_print_table_end(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h deleted file mode 100644 index 9c48d681360e9..0000000000000 --- a/ext/xmlreader/php_xmlreader.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XMLREADER_H -#define PHP_XMLREADER_H - -extern zend_module_entry xmlreader_module_entry; -#define phpext_xmlreader_ptr &xmlreader_module_entry - -#ifdef PHP_WIN32 -#define PHP_XMLREADER_API __declspec(dllexport) -#else -#define PHP_XMLREADER_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include "ext/libxml/php_libxml.h" -#include - -typedef struct _xmlreader_object { - zend_object std; - xmlTextReaderPtr ptr; - /* strings must be set in input buffer as copy is required */ - xmlParserInputBufferPtr input; - void *schema; - HashTable *prop_handler; - zend_object_handle handle; -} xmlreader_object; - -PHP_MINIT_FUNCTION(xmlreader); -PHP_MSHUTDOWN_FUNCTION(xmlreader); -PHP_MINFO_FUNCTION(xmlreader); - -#define REGISTER_XMLREADER_CLASS_CONST_LONG(const_name, value) \ - zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); - -#ifdef ZTS -#define XMLREADER_G(v) TSRMG(xmlreader_globals_id, zend_xmlreader_globals *, v) -#else -#define XMLREADER_G(v) (xmlreader_globals.v) -#endif - -#endif /* PHP_XMLREADER_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xmlreader/tests/001.phpt b/ext/xmlreader/tests/001.phpt deleted file mode 100644 index ce9ade9618993..0000000000000 --- a/ext/xmlreader/tests/001.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, string data ---SKIPIF-- - ---FILE-- - -'; - -$reader = new XMLReader(); -$reader->XML($xmlstring); - -// Only go through -while ($reader->read()) { - echo $reader->name."\n"; -} -$xmlstring = ''; -$reader = new XMLReader(); -$reader->XML($xmlstring); -?> -===DONE=== ---EXPECTF-- -books -books - -Warning: XMLReader::XML(): Empty string supplied as input in %s on line %d -===DONE=== diff --git a/ext/xmlreader/tests/002.phpt b/ext/xmlreader/tests/002.phpt deleted file mode 100644 index 7abd3e216c342..0000000000000 --- a/ext/xmlreader/tests/002.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, file data ---SKIPIF-- - ---FILE-- - -'; -file_put_contents($filename, $xmlstring); - -$reader = new XMLReader(); -if ($reader->open('')) exit(); - -$reader = new XMLReader(); -if (!$reader->open($filename)) { - $reader->close(); - exit(); -} - -// Only go through -while ($reader->read()) { - echo $reader->name."\n"; -} -$reader->close(); -unlink($filename); -touch($filename); -$reader = new XMLReader(); -$reader->open($filename); -$reader->close(); -unlink($filename); - -?> -===DONE=== ---EXPECTF-- - -Warning: XMLReader::open(): Empty string supplied as input in %s on line %d -books -books -===DONE=== diff --git a/ext/xmlreader/tests/003.phpt b/ext/xmlreader/tests/003.phpt deleted file mode 100644 index 48aa4be0ba27a..0000000000000 --- a/ext/xmlreader/tests/003.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, attributes test ---SKIPIF-- - ---FILE-- - -book1'; -file_put_contents($filename, $xmlstring); - -$reader = new XMLReader(); -if (!$reader->open($filename)) { - exit(); -} - -// Only go through -while ($reader->read()) { - if ($reader->nodeType != XMLREADER::END_ELEMENT) { - if ($reader->nodeType == XMLREADER::ELEMENT && $reader->hasAttributes) { - $attr = $reader->moveToFirstAttribute(); - echo $reader->name . ": "; - echo $reader->value . "\n"; - - if ($reader->getAttribute($reader->name) == $reader->value) { - echo "1st attr (num) failed\n"; - } - - - $attr = $reader->moveToNextAttribute(); - echo $reader->name . ": "; - echo $reader->value . "\n"; - - if ($reader->getAttribute($reader->name) == $reader->value) { - echo "2nd attr (idx) failed\n"; - } - - // Named attribute - $attr = $reader->moveToAttribute('num'); - echo $reader->name . ": "; - echo $reader->value . "\n"; - - if ($reader->getAttribute('num') == $reader->value) { - echo "attr num failed\n"; - } - - $attr = $reader->moveToAttribute('idx'); - echo $reader->name . ": "; - echo $reader->value . "\n"; - - if ($reader->getAttribute('idx') == $reader->value) { - echo "attr idx failed\n"; - } - - // Numeric positions of attributes - $attr = $reader->moveToAttributeNo(0); - echo $reader->name . ": "; - echo $reader->value . "\n"; - - if ($reader->getAttributeNo(0) == $reader->value) { - echo "attr 0 failed\n"; - } - - $attr = $reader->moveToAttributeNo(1); - echo $reader->name . ": "; - echo $reader->value . "\n"; - - } - } -} -$reader->close(); -unlink($filename); -?> -===DONE=== ---EXPECT-- -num: 1 -idx: 2 -num: 1 -idx: 2 -num: 1 -idx: 2 -===DONE=== diff --git a/ext/xmlreader/tests/004.phpt b/ext/xmlreader/tests/004.phpt deleted file mode 100644 index d4f044e97fc11..0000000000000 --- a/ext/xmlreader/tests/004.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, attributes test ---SKIPIF-- - ---FILE-- - -book1'; -file_put_contents($filename, $xmlstring); - -$reader = new XMLReader(); -if (!$reader->open($filename)) { - exit(); -} - -while ($reader->read()) { - if ($reader->nodeType != XMLREADER::END_ELEMENT) { - echo $reader->name."\n"; - if ($reader->nodeType == XMLREADER::ELEMENT && $reader->hasAttributes) { - $attr = $reader->moveToFirstAttribute(); - while ($attr) { - echo " Attribute Name: ".$reader->name."\n"; - echo " Attribute Value: ".$reader->value."\n"; - $attr = $reader->moveToNextAttribute(); - } - } - } -} -$reader->close(); -unlink($filename); -?> -===DONE=== ---EXPECT-- -books -book - Attribute Name: num - Attribute Value: 1 - Attribute Name: idx - Attribute Value: 2 -#text -===DONE=== diff --git a/ext/xmlreader/tests/005.phpt b/ext/xmlreader/tests/005.phpt deleted file mode 100644 index e6fd02c9aaa1c..0000000000000 --- a/ext/xmlreader/tests/005.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, parser property set/get ---SKIPIF-- - ---FILE-- - -'; - -$reader = new XMLReader(); - -$reader->XML($xmlstring); - - -$a = $reader->setParserProperty(XMLReader::LOADDTD, false); -$b = $reader->getParserProperty(XMLReader::LOADDTD); - -if (!$a && !$b) { - echo "ok\n"; -} - -$a = $reader->setParserProperty(XMLReader::SUBST_ENTITIES, true); -$b = $reader->getParserProperty(XMLReader::SUBST_ENTITIES); - -if ($a && $b) { - echo "ok\n"; -} -// Only go through -while ($reader->read()); -$reader->close(); -?> -===DONE=== ---EXPECT-- -ok -===DONE=== diff --git a/ext/xmlreader/tests/006.phpt b/ext/xmlreader/tests/006.phpt deleted file mode 100644 index ce9bb451aff44..0000000000000 --- a/ext/xmlreader/tests/006.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, moveToElement ---SKIPIF-- - ---FILE-- - -'; - -$reader = new XMLReader(); - -$reader->XML($xmlstring); - -// 2 read to get on the 2nd node -$reader->read(); -$reader->read(); - -if ($reader->nodeType != XMLREADER::END_ELEMENT) { - if ($reader->nodeType == XMLREADER::ELEMENT && $reader->hasAttributes) { - $attr = $reader->moveToFirstAttribute(); - if ($reader->moveToElement()) { - if ($reader->name == 'book') { - echo "ok\n"; - } - } - } -} - -$reader->close(); -?> -===DONE=== ---EXPECT-- -ok -===DONE=== diff --git a/ext/xmlreader/tests/007.phpt b/ext/xmlreader/tests/007.phpt deleted file mode 100644 index 842f25e5f61a6..0000000000000 --- a/ext/xmlreader/tests/007.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, setRelaxNGSchema ---SKIPIF-- - ---FILE-- -hello'; -$relaxngfile = dirname(__FILE__) . '/relaxNG.rng'; -$file = dirname(__FILE__) . '/__007.xml'; -file_put_contents($file, $xmlstring); - -$reader = new XMLReader(); -$reader->open($file); - -if ($reader->setRelaxNGSchema($relaxngfile)) { - while ($reader->read()); -} -if ($reader->isValid()) { - print "file relaxNG: ok\n"; -} else { - print "file relaxNG: failed\n"; -} -$reader->close(); -unlink($file); - - -$reader = new XMLReader(); -$reader->XML($xmlstring); - -if ($reader->setRelaxNGSchema($relaxngfile)) { - while ($reader->read()); -} -if ($reader->isValid()) { - print "string relaxNG: ok\n"; -} else { - print "string relaxNG: failed\n"; -} - -$reader->close(); - -$reader = new XMLReader(); -$reader->XML($xmlstring); - -if ($reader->setRelaxNGSchema('')) { - echo 'failed'; -} -$reader->close(); -?> -===DONE=== ---EXPECTF-- -file relaxNG: ok -string relaxNG: ok - -Warning: XMLReader::setRelaxNGSchema(): Schema data source is required in %s on line %d -===DONE=== diff --git a/ext/xmlreader/tests/008.phpt b/ext/xmlreader/tests/008.phpt deleted file mode 100644 index e3af00e4f7f36..0000000000000 --- a/ext/xmlreader/tests/008.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, DTD ---SKIPIF-- - ---FILE-- - - - - -Move Title 1 -Location 1 - - - -Move Title 2 - -Location 2 - - -'; - -$dtdfile = rawurlencode(dirname(__FILE__)) . '/dtdexample.dtd'; -$file = dirname(__FILE__) . '/__008.xml'; -file_put_contents($file, $xmlstring); - - -$reader = new XMLReader(); -$reader->open($file); -$reader->setParserProperty(XMLREADER::LOADDTD, TRUE); -$reader->setParserProperty(XMLREADER::VALIDATE, TRUE); -while($reader->read()); -if ($reader->isValid()) { - echo "file DTD: ok\n"; -} -$reader->close(); -unlink($file); - -$xmlstring = ' - - - -Move Title 1 -Location 1 - - - -Move Title 2 - -Location 2 - - -'; - -$reader = new XMLReader(); -$reader->XML($xmlstring); - -$reader->setParserProperty(XMLREADER::LOADDTD, TRUE); -$reader->setParserProperty(XMLREADER::VALIDATE, TRUE); -while($reader->read()); -if ($reader->isValid()) { - echo "string DTD: ok\n"; -} -?> -===DONE=== ---EXPECTF-- -file DTD: ok -string DTD: ok -===DONE=== diff --git a/ext/xmlreader/tests/009.phpt b/ext/xmlreader/tests/009.phpt deleted file mode 100644 index 613ef678cbd96..0000000000000 --- a/ext/xmlreader/tests/009.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, next ---SKIPIF-- - ---FILE-- - -'; - -$reader = new XMLReader(); -$reader->XML($xmlstring); - -// Only go through -$reader->read(); -$reader->read(); - -$reader->next(); -echo $reader->name; -echo " "; -echo $reader->getAttribute('num'); -echo "\n"; -?> -===DONE=== ---EXPECTF-- -book 2 -===DONE=== diff --git a/ext/xmlreader/tests/010.phpt b/ext/xmlreader/tests/010.phpt deleted file mode 100644 index a107c7441ffad..0000000000000 --- a/ext/xmlreader/tests/010.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, next ---SKIPIF-- - ---FILE-- - -book1'; - -$reader = new XMLReader(); -$reader->XML($xmlstring); - -// Only go through -$reader->read(); -$reader->read(); - -$reader->next(); -echo $reader->name; -echo " "; -echo $reader->getAttributeNs('isbn', 'uri'); -echo "\n"; -?> -===DONE=== ---EXPECTF-- -prefix:books 12isbn -===DONE=== diff --git a/ext/xmlreader/tests/011.phpt b/ext/xmlreader/tests/011.phpt deleted file mode 100644 index 89599232fce04..0000000000000 --- a/ext/xmlreader/tests/011.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -XMLReader: libxml2 XML Reader, string data ---SKIPIF-- - ---FILE-- - -test'; - -$reader = new XMLReader(); -$reader->XML($xmlstring); -$reader->read(); -echo $reader->readInnerXml(); -echo "\n"; -$reader->close(); - - -$reader = new XMLReader(); -$reader->XML($xmlstring); -$reader->read(); -echo $reader->readOuterXml(); -echo "\n"; -$reader->close(); -?> -===DONE=== ---EXPECT-- -test -test -===DONE=== diff --git a/ext/xmlreader/tests/012.dtd b/ext/xmlreader/tests/012.dtd deleted file mode 100755 index b65412af0e6a9..0000000000000 --- a/ext/xmlreader/tests/012.dtd +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/ext/xmlreader/tests/012.phpt b/ext/xmlreader/tests/012.phpt deleted file mode 100755 index e420bb7a17a82..0000000000000 --- a/ext/xmlreader/tests/012.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -XMLReader: accessing empty and non existing attributes ---SKIPIF-- - ---FILE-- - - -EOF; - -$reader = new XMLReader(); -$reader->XML($xmlstring); -$reader->read(); -var_dump($reader->getAttribute('bar')); -var_dump($reader->getAttribute('baz')); -$reader->close(); - -$xmlstring =<< - - -EOF; - -$xmlstring = str_replace('012.dtd', dirname(__FILE__).'/012.dtd', $xmlstring); - -$reader = new XMLReader(); -$reader->XML($xmlstring); -$reader->setParserProperty(XMLReader::DEFAULTATTRS, true); -while($reader->read() && $reader->nodeType != XMLReader::ELEMENT); -var_dump($reader->getAttribute('bar')); -var_dump($reader->getAttribute('baz')); -$reader->close(); - -?> -===FILE=== -open(dirname(__FILE__) . '/012.xml'); -//$reader->setParserProperty(XMLReader::DEFAULTATTRS, true); -while($reader->read() && $reader->nodeType != XMLReader::ELEMENT); -var_dump($reader->getAttribute('bar')); -var_dump($reader->getAttribute('baz')); -$reader->close(); - -$reader = new XMLReader(); -$reader->open(dirname(__FILE__) . '/012.xml'); -$reader->setParserProperty(XMLReader::DEFAULTATTRS, true); -while($reader->read() && $reader->nodeType != XMLReader::ELEMENT); -var_dump($reader->getAttribute('bar')); -var_dump($reader->getAttribute('baz')); -$reader->close(); - -?> -===DONE=== ---EXPECT-- -string(0) "" -NULL -string(0) "" -string(0) "" -===FILE=== -string(0) "" -NULL -string(0) "" -string(0) "" -===DONE=== diff --git a/ext/xmlreader/tests/012.xml b/ext/xmlreader/tests/012.xml deleted file mode 100755 index 5012bd5eff691..0000000000000 --- a/ext/xmlreader/tests/012.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/ext/xmlreader/tests/013.phpt b/ext/xmlreader/tests/013.phpt deleted file mode 100755 index f9dcdeeec7e01..0000000000000 --- a/ext/xmlreader/tests/013.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -XMLReader: Schema validation ---SKIPIF-- - - ---FILE-- - - - 123 - 456 - -EOF; - -$reader = new XMLReader(); -$reader->XML($xml); -$reader->setSchema(dirname(__FILE__) . '/013.xsd'); -while($reader->read()) { - if ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'item') { - $reader->read(); - var_dump($reader->value); - } -} -$reader->close(); - -?> -===FAIL=== - - -EOF; - -$reader = new XMLReader(); -$reader->XML($xml); -$reader->setSchema(dirname(__FILE__) . '/013.xsd'); -while($reader->read() && $reader->nodeType != XMLReader::ELEMENT); -$reader->close(); - -?> -===DONE=== ---EXPECTF-- -string(3) "123" -string(3) "456" -===FAIL=== - -Warning: XMLReader::read(): Element 'foo': %s -===DONE=== diff --git a/ext/xmlreader/tests/013.xsd b/ext/xmlreader/tests/013.xsd deleted file mode 100755 index 50b000b6fcb05..0000000000000 --- a/ext/xmlreader/tests/013.xsd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ext/xmlreader/tests/bug36743.phpt b/ext/xmlreader/tests/bug36743.phpt deleted file mode 100644 index 374941b0c712f..0000000000000 --- a/ext/xmlreader/tests/bug36743.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #36743 (In a class extending XMLReader array properties are not writable) ---SKIPIF-- - ---FILE-- -testArr[] = 1; - var_dump($this->testArr); - } -} - -$t = new test; - -echo "Done\n"; -?> ---EXPECT-- -array(1) { - [0]=> - int(1) -} -Done diff --git a/ext/xmlreader/tests/bug42139.phpt b/ext/xmlreader/tests/bug42139.phpt deleted file mode 100644 index 19602f01035dc..0000000000000 --- a/ext/xmlreader/tests/bug42139.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #42139 (XMLReader option constants are broken using XML()) ---SKIPIF-- - ---FILE-- - - - -]> -&x; -XML; - -$reader = new XMLReader; -$reader->XML( $xml, NULL, LIBXML_NOENT); -while ( $reader->read() ) { - echo "{$reader->nodeType}, {$reader->name}, {$reader->value}\n"; -} -$reader->close(); - -?> ---EXPECT-- -10, root, -1, root, -3, #text, y -15, root, diff --git a/ext/xmlreader/tests/dtdexample.dtd b/ext/xmlreader/tests/dtdexample.dtd deleted file mode 100644 index ce53f0bc18c94..0000000000000 --- a/ext/xmlreader/tests/dtdexample.dtd +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/ext/xmlreader/tests/relaxNG.rng b/ext/xmlreader/tests/relaxNG.rng deleted file mode 100644 index f4357e04ef8ab..0000000000000 --- a/ext/xmlreader/tests/relaxNG.rng +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/ext/xmlreader/tests/relaxNG2.rng b/ext/xmlreader/tests/relaxNG2.rng deleted file mode 100644 index 4adae7b15113d..0000000000000 --- a/ext/xmlreader/tests/relaxNG2.rng +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ext/xmlreader/tests/relaxNG3.rng b/ext/xmlreader/tests/relaxNG3.rng deleted file mode 100644 index 73e1eb6165102..0000000000000 --- a/ext/xmlreader/tests/relaxNG3.rng +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ext/xmlreader/xmlreader.dsp b/ext/xmlreader/xmlreader.dsp deleted file mode 100644 index 7b21518ba3198..0000000000000 --- a/ext/xmlreader/xmlreader.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlreader" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=xmlreader - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "xmlreader.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "xmlreader.mak" CFG="xmlreader - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "xmlreader - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "xmlreader - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "xmlreader - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "xmlreader___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "xmlreader___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XMLREADER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" - -!ELSEIF "$(CFG)" == "xmlreader - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "xmlreader___Win32_Release_TS0" -# PROP BASE Intermediate_Dir "xmlreader___Win32_Release_TS0" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /YX /FD /GZ /c -# SUBTRACT CPP /Fr -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" -# ADD LINK32 php5ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /incremental:no /machine:I386 /out:"..\..\Release_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" -# SUBTRACT LINK32 /debug - -!ENDIF - -# Begin Target - -# Name "xmlreader - Win32 Debug_TS" -# Name "xmlreader - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_xmlreader.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_xmlreader.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/xmlrpc/CREDITS b/ext/xmlrpc/CREDITS deleted file mode 100644 index cfb14faf804ea..0000000000000 --- a/ext/xmlrpc/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -xmlrpc -Dan Libby diff --git a/ext/xmlrpc/EXPERIMENTAL b/ext/xmlrpc/EXPERIMENTAL deleted file mode 100644 index 6443e99646410..0000000000000 --- a/ext/xmlrpc/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this extension is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/ext/xmlrpc/config.m4 b/ext/xmlrpc/config.m4 deleted file mode 100644 index 7f7277d4df995..0000000000000 --- a/ext/xmlrpc/config.m4 +++ /dev/null @@ -1,118 +0,0 @@ -dnl -dnl $Id$ -dnl - -sinclude(ext/xmlrpc/libxmlrpc/acinclude.m4) -sinclude(ext/xmlrpc/libxmlrpc/xmlrpc.m4) -sinclude(libxmlrpc/acinclude.m4) -sinclude(libxmlrpc/xmlrpc.m4) - -PHP_ARG_WITH(xmlrpc, for XMLRPC-EPI support, -[ --with-xmlrpc[=DIR] Include XMLRPC-EPI support]) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XMLRPC-EPI: libxml2 install prefix], no, no) -fi - -PHP_ARG_WITH(libexpat-dir, libexpat dir for XMLRPC-EPI, -[ --with-libexpat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)],no,no) - -PHP_ARG_WITH(iconv-dir, iconv dir for XMLRPC-EPI, -[ --with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI],no,no) - -if test "$PHP_XMLRPC" != "no"; then - - PHP_ADD_EXTENSION_DEP(xmlrpc, libxml) - PHP_SUBST(XMLRPC_SHARED_LIBADD) - AC_DEFINE(HAVE_XMLRPC,1,[ ]) - - dnl - dnl Default to libxml2 if --with-libexpat-dir is not used - dnl - if test "$PHP_LIBEXPAT_DIR" = "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([XML-RPC extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(XMLRPC_SHARED_LIBADD, [ - if test "$PHP_XML" = "no"; then - PHP_ADD_SOURCES(ext/xml, compat.c) - PHP_ADD_BUILD_DIR(ext/xml) - fi - ], [ - AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=]) - ]) - else - testval=no - for i in $PHP_LIBEXPAT_DIR $XMLRPC_DIR /usr/local /usr; do - if test -f $i/$PHP_LIBDIR/libexpat.a || test -f $i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME; then - AC_DEFINE(HAVE_LIBEXPAT,1,[ ]) - PHP_ADD_LIBRARY_WITH_PATH(expat, $i/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD) - PHP_ADD_INCLUDE($i/include) - testval=yes - break - fi - done - - if test "$testval" = "no"; then - AC_MSG_ERROR([XML-RPC support requires libexpat. Use --with-libexpat-dir= (deprecated!)]) - fi - fi - - if test "$PHP_ICONV_DIR" != "no"; then - PHP_ICONV=$PHP_ICONV_DIR - fi - - if test -z "$PHP_ICONV" || test "$PHP_ICONV" = "no"; then - PHP_ICONV=yes - fi - - PHP_SETUP_ICONV(XMLRPC_SHARED_LIBADD, [], [ - AC_MSG_ERROR([iconv not found, in order to build xmlrpc you need the iconv library]) - ]) -fi - -if test "$PHP_XMLRPC" = "yes"; then - XMLRPC_CHECKS - PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c libxmlrpc/base64.c \ - libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \ - libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \ - libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \ - libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \ - libxmlrpc/xml_to_soap.c,$ext_shared,, - -I@ext_srcdir@/libxmlrpc -DVERSION="0.50") - PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc) - XMLRPC_MODULE_TYPE=builtin - -elif test "$PHP_XMLRPC" != "no"; then - - if test -r $PHP_XMLRPC/include/xmlrpc.h; then - XMLRPC_DIR=$PHP_XMLRPC/include - elif test -r $PHP_XMLRPC/include/xmlrpc-epi/xmlrpc.h; then -dnl some xmlrpc-epi header files have generic file names like -dnl queue.h or base64.h. Distributions have to create dir -dnl for xmlrpc-epi because of this. - XMLRPC_DIR=$PHP_XMLRPC/include/xmlrpc-epi - else - AC_MSG_CHECKING(for XMLRPC-EPI in default path) - for i in /usr/local /usr; do - if test -r $i/include/xmlrpc.h; then - XMLRPC_DIR=$i/include - AC_MSG_RESULT(found in $i) - break - fi - done - fi - - if test -z "$XMLRPC_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the XMLRPC-EPI distribution) - fi - - PHP_ADD_INCLUDE($XMLRPC_DIR) - PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD) - PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c, $ext_shared) - XMLRPC_MODULE_TYPE=external -fi diff --git a/ext/xmlrpc/config.w32 b/ext/xmlrpc/config.w32 deleted file mode 100644 index 8c399cd147935..0000000000000 --- a/ext/xmlrpc/config.w32 +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_WITH("xmlrpc", "XMLRPC-EPI support", "no"); - -if (PHP_XMLRPC != "no") { - CHECK_HEADER_ADD_INCLUDE("xmlrpc.h", "CFLAGS_XMLRPC", configure_module_dirname + "/libxmlrpc"); - EXTENSION('xmlrpc', 'xmlrpc-epi-php.c', PHP_XMLRPC_SHARED, "-DVERSION=\"0.50\""); - ADD_SOURCES(configure_module_dirname + "/libxmlrpc", "base64.c simplestring.c xml_to_dandarpc.c \ - xmlrpc_introspection.c encodings.c system_methods.c xml_to_xmlrpc.c \ - queue.c xml_element.c xmlrpc.c xml_to_soap.c", "xmlrpc"); - ADD_EXTENSION_DEP('xmlrpc', 'libxml'); -} - diff --git a/ext/xmlrpc/libxmlrpc/README b/ext/xmlrpc/libxmlrpc/README deleted file mode 100644 index 323edfa67185b..0000000000000 --- a/ext/xmlrpc/libxmlrpc/README +++ /dev/null @@ -1,17 +0,0 @@ -organization of this directory is moving towards this approach: - -.h -- public API and data types -_private.h -- protected API and data types -.c -- implementation and private API / types - -The rules are: -.c files may include *_private.h. -.h files may not include *_private.h - -This allows us to have a nicely encapsulated C api with opaque data types and private functions -that are nonetheless shared between source files without redundant extern declarations.. - - - - - diff --git a/ext/xmlrpc/libxmlrpc/acinclude.m4 b/ext/xmlrpc/libxmlrpc/acinclude.m4 deleted file mode 100644 index 49b6090f6b068..0000000000000 --- a/ext/xmlrpc/libxmlrpc/acinclude.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# Local macros for automake & autoconf - -AC_DEFUN([XMLRPC_FUNCTION_CHECKS],[ - -# Standard XMLRPC list -AC_CHECK_FUNCS( \ - strtoul strtoull snprintf \ - strstr strpbrk strerror\ - memcpy memmove) - -]) - -AC_DEFUN([XMLRPC_HEADER_CHECKS],[ -AC_HEADER_STDC -AC_CHECK_HEADERS(xmlparse.h xmltok.h stdlib.h strings.h string.h) -]) - -AC_DEFUN([XMLRPC_TYPE_CHECKS],[ - -AC_REQUIRE([AC_C_CONST]) -AC_REQUIRE([AC_C_INLINE]) -AC_CHECK_SIZEOF(char, 1) - -AC_CHECK_SIZEOF(int, 4) -AC_CHECK_SIZEOF(long, 4) -AC_CHECK_SIZEOF(long long, 8) -AC_TYPE_SIZE_T -AC_HEADER_TIME -AC_TYPE_UID_T - - -]) diff --git a/ext/xmlrpc/libxmlrpc/base64.c b/ext/xmlrpc/libxmlrpc/base64.c deleted file mode 100644 index d020bd6646287..0000000000000 --- a/ext/xmlrpc/libxmlrpc/base64.c +++ /dev/null @@ -1,192 +0,0 @@ -static const char rcsid[] = "#(@) $Id$"; - -/* - - Encode or decode file as MIME base64 (RFC 1341) - - by John Walker - http://www.fourmilab.ch/ - - This program is in the public domain. - -*/ -#include - -/* ENCODE -- Encode binary file into base64. */ -#include -#include - -#include "base64.h" - -static unsigned char dtable[512]; - -void buffer_new(struct buffer_st *b) -{ - b->length = 512; - b->data = malloc(sizeof(char)*(b->length)); - b->data[0] = 0; - b->ptr = b->data; - b->offset = 0; -} - -void buffer_add(struct buffer_st *b, char c) -{ - *(b->ptr++) = c; - b->offset++; - if (b->offset == b->length) { - b->length += 512; - b->data = realloc(b->data, b->length); - b->ptr = b->data + b->offset; - } -} - -void buffer_delete(struct buffer_st *b) -{ - free(b->data); - b->length = 0; - b->offset = 0; - b->ptr = NULL; - b->data = NULL; -} - -void base64_encode_xmlrpc(struct buffer_st *b, const char *source, int length) -{ - int i, hiteof = 0; - int offset = 0; - int olen; - - olen = 0; - - buffer_new(b); - - /* Fill dtable with character encodings. */ - - for (i = 0; i < 26; i++) { - dtable[i] = 'A' + i; - dtable[26 + i] = 'a' + i; - } - for (i = 0; i < 10; i++) { - dtable[52 + i] = '0' + i; - } - dtable[62] = '+'; - dtable[63] = '/'; - - while (!hiteof) { - unsigned char igroup[3], ogroup[4]; - int c, n; - - igroup[0] = igroup[1] = igroup[2] = 0; - for (n = 0; n < 3; n++) { - c = *(source++); - offset++; - if (offset > length) { - hiteof = 1; - break; - } - igroup[n] = (unsigned char) c; - } - if (n > 0) { - ogroup[0] = dtable[igroup[0] >> 2]; - ogroup[1] = dtable[((igroup[0] & 3) << 4) | (igroup[1] >> 4)]; - ogroup[2] = dtable[((igroup[1] & 0xF) << 2) | (igroup[2] >> 6)]; - ogroup[3] = dtable[igroup[2] & 0x3F]; - - /* Replace characters in output stream with "=" pad - characters if fewer than three characters were - read from the end of the input stream. */ - - if (n < 3) { - ogroup[3] = '='; - if (n < 2) { - ogroup[2] = '='; - } - } - for (i = 0; i < 4; i++) { - buffer_add(b, ogroup[i]); - if (!(b->offset % 72)) { - /* buffer_add(b, '\r'); */ - buffer_add(b, '\n'); - } - } - } - } - /* buffer_add(b, '\r'); */ - buffer_add(b, '\n'); -} - -void base64_decode_xmlrpc(struct buffer_st *bfr, const char *source, int length) -{ - int i; - int offset = 0; - int endoffile; - int count; - - buffer_new(bfr); - - for (i = 0; i < 255; i++) { - dtable[i] = 0x80; - } - for (i = 'A'; i <= 'Z'; i++) { - dtable[i] = 0 + (i - 'A'); - } - for (i = 'a'; i <= 'z'; i++) { - dtable[i] = 26 + (i - 'a'); - } - for (i = '0'; i <= '9'; i++) { - dtable[i] = 52 + (i - '0'); - } - dtable['+'] = 62; - dtable['/'] = 63; - dtable['='] = 0; - - endoffile = 0; - - /*CONSTANTCONDITION*/ - while (1) { - unsigned char a[4], b[4], o[3]; - - for (i = 0; i < 4; i++) { - int c; - while (1) { - c = *(source++); - offset++; - if (offset > length) endoffile = 1; - if (isspace(c) || c == '\n' || c == '\r') continue; - break; - } - - if (endoffile) { - /* - if (i > 0) { - fprintf(stderr, "Input file incomplete.\n"); - exit(1); - } - */ - return; - } - - if (dtable[c] & 0x80) { - /* - fprintf(stderr, "Offset %i length %i\n", offset, length); - fprintf(stderr, "character '%c:%x:%c' in input file.\n", c, c, dtable[c]); - exit(1); - */ - i--; - continue; - } - a[i] = (unsigned char) c; - b[i] = (unsigned char) dtable[c]; - } - o[0] = (b[0] << 2) | (b[1] >> 4); - o[1] = (b[1] << 4) | (b[2] >> 2); - o[2] = (b[2] << 6) | b[3]; - i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3); - count = 0; - while (count < i) { - buffer_add(bfr, o[count++]); - } - if (i < 3) { - return; - } - } -} diff --git a/ext/xmlrpc/libxmlrpc/base64.h b/ext/xmlrpc/libxmlrpc/base64.h deleted file mode 100644 index 6a0c8ef6fc855..0000000000000 --- a/ext/xmlrpc/libxmlrpc/base64.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Encode or decode file as MIME base64 (RFC 1341) - - by John Walker - http://www.fourmilab.ch/ - - This program is in the public domain. - -*/ - - -struct buffer_st { - char *data; - int length; - char *ptr; - int offset; -}; - -void buffer_new(struct buffer_st *b); -void buffer_add(struct buffer_st *b, char c); -void buffer_delete(struct buffer_st *b); - -void base64_encode_xmlrpc(struct buffer_st *b, const char *source, int length); -void base64_decode_xmlrpc(struct buffer_st *b, const char *source, int length); - -/* -#define DEBUG_MALLOC - */ - -#ifdef DEBUG_MALLOC -void *_malloc_real(size_t s, char *file, int line); -void _free_real(void *p, char *file, int line); - -#define malloc(s) _malloc_real(s,__FILE__,__LINE__) -#define free(p) _free_real(p, __FILE__,__LINE__) -#endif - diff --git a/ext/xmlrpc/libxmlrpc/encodings.c b/ext/xmlrpc/libxmlrpc/encodings.c deleted file mode 100644 index f4cc212d7c963..0000000000000 --- a/ext/xmlrpc/libxmlrpc/encodings.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef PHP_WIN32 -#include -#else -#include -#include -#endif - -static const char rcsid[] = "#(@) $Id$"; - -#include - -#ifdef HAVE_GICONV_H -#include -#else -#include -#endif - -#include "encodings.h" - -#ifndef ICONV_CSNMAXLEN -#define ICONV_CSNMAXLEN 64 -#endif - -static char* convert(const char* src, int src_len, int *new_len, const char* from_enc, const char* to_enc) { - char* outbuf = 0; - - if(src && src_len && from_enc && to_enc) { - size_t outlenleft = src_len; - size_t inlenleft = src_len; - int outlen = src_len; - iconv_t ic; - char* out_ptr = 0; - - if(strlen(to_enc) >= ICONV_CSNMAXLEN || strlen(from_enc) >= ICONV_CSNMAXLEN) { - return NULL; - } - ic = iconv_open(to_enc, from_enc); - if(ic != (iconv_t)-1) { - size_t st; - outbuf = (char*)malloc(outlen + 1); - - if(outbuf) { - out_ptr = (char*)outbuf; - while(inlenleft) { - st = iconv(ic, (char**)&src, &inlenleft, &out_ptr, &outlenleft); - if(st == -1) { - if(errno == E2BIG) { - int diff = out_ptr - outbuf; - outlen += inlenleft; - outlenleft += inlenleft; - outbuf = (char*)realloc(outbuf, outlen + 1); - if(!outbuf) { - break; - } - out_ptr = outbuf + diff; - } - else { - free(outbuf); - outbuf = 0; - break; - } - } - } - } - iconv_close(ic); - } - outlen -= outlenleft; - - if(new_len) { - *new_len = outbuf ? outlen : 0; - } - if(outbuf) { - outbuf[outlen] = 0; - } - } - return outbuf; -} - -/* returns a new string that must be freed */ -char* utf8_encode(const char *s, int len, int *newlen, const char* encoding) -{ - return convert(s, len, newlen, encoding, "UTF-8"); -} - -/* returns a new string, possibly decoded */ -char* utf8_decode(const char *s, int len, int *newlen, const char* encoding) -{ - return convert(s, len, newlen, "UTF-8", encoding); -} - diff --git a/ext/xmlrpc/libxmlrpc/encodings.h b/ext/xmlrpc/libxmlrpc/encodings.h deleted file mode 100644 index 486360b1be9b0..0000000000000 --- a/ext/xmlrpc/libxmlrpc/encodings.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -#ifndef __ENCODINGS__H -#define __ENCODINGS__H - -/* these defines are for legacy purposes. */ -#define encoding_utf_8 "UTF-8" -typedef const char* ENCODING_ID; -#define utf8_get_encoding_id_string(desired_enc) ((const char*)desired_enc) -#define utf8_get_encoding_id_from_string(id_string) ((ENCODING_ID)id_string) - -char* utf8_encode(const char *s, int len, int *newlen, ENCODING_ID encoding); -char* utf8_decode(const char *s, int len, int *newlen, ENCODING_ID encoding); - -#endif /* __ENCODINGS__H */ diff --git a/ext/xmlrpc/libxmlrpc/queue.c b/ext/xmlrpc/libxmlrpc/queue.c deleted file mode 100644 index 24187383fd13b..0000000000000 --- a/ext/xmlrpc/libxmlrpc/queue.c +++ /dev/null @@ -1,982 +0,0 @@ -static const char rcsid[] = "#(@) $Id$"; - -/* - * Date last modified: Jan 2001 - * Modifications by Dan Libby (dan@libby.com), including: - * - various fixes, null checks, etc - * - addition of Q_Iter funcs, macros - */ - - -/*-************************************************************** - * - * File : q.c - * - * Author: Peter Yard [1993.01.02] -- 02 Jan 1993 - * - * Disclaimer: This code is released to the public domain. - * - * Description: - * Generic double ended queue (Deque pronounced DEK) for handling - * any data types, with sorting. - * - * By use of various functions in this module the caller - * can create stacks, queues, lists, doubly linked lists, - * sorted lists, indexed lists. All lists are dynamic. - * - * It is the responsibility of the caller to malloc and free - * memory for insertion into the queue. A pointer to the object - * is used so that not only can any data be used but various kinds - * of data can be pushed on the same queue if one so wished e.g. - * various length string literals mixed with pointers to structures - * or integers etc. - * - * Enhancements: - * A future improvement would be the option of multiple "cursors" - * so that multiple locations could occur in the one queue to allow - * placemarkers and additional flexibility. Perhaps even use queue - * itself to have a list of cursors. - * - * Usage: - * - * /x init queue x/ - * queue q; - * Q_Init(&q); - * - * To create a stack : - * - * Q_PushHead(&q, &mydata1); /x push x/ - * Q_PushHead(&q, &mydata2); - * ..... - * data_ptr = Q_PopHead(&q); /x pop x/ - * ..... - * data_ptr = Q_Head(&q); /x top of stack x/ - * - * To create a FIFO: - * - * Q_PushHead(&q, &mydata1); - * ..... - * data_ptr = Q_PopTail(&q); - * - * To create a double list: - * - * data_ptr = Q_Head(&q); - * .... - * data_ptr = Q_Next(&q); - * data_ptr = Q_Tail(&q); - * if (Q_IsEmpty(&q)) .... - * ..... - * data_ptr = Q_Previous(&q); - * - * To create a sorted list: - * - * Q_PushHead(&q, &mydata1); /x push x/ - * Q_PushHead(&q, &mydata2); - * ..... - * if (!Q_Sort(&q, MyFunction)) - * .. error .. - * - * /x fill in key field of mydata1. - * * NB: Q_Find does linear search - * x/ - * - * if (Q_Find(&q, &mydata1, MyFunction)) - * { - * /x found it, queue cursor now at correct record x/ - * /x can retrieve with x/ - * data_ptr = Q_Get(&q); - * - * /x alter data , write back with x/ - * Q_Put(&q, data_ptr); - * } - * - * /x Search with binary search x/ - * if (Q_Seek(&q, &mydata, MyFunction)) - * /x etc x/ - * - * - ****************************************************************/ - -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include "queue.h" - - -static void QuickSort(void *list[], int low, int high, - int (*Comp)(const void *, const void *)); -static int Q_BSearch(queue *q, void *key, - int (*Comp)(const void *, const void *)); - -/* The index: a pointer to pointers */ - -static void **index; -static datanode **posn_index; - - -/*** - * - ** function : Q_Init - * - ** purpose : Initialise queue object and pointers. - * - ** parameters : 'queue' pointer. - * - ** returns : True_ if init successful else False_ - * - ** comments : - ***/ - -int Q_Init(queue *q) -{ - if(q) { - q->head = q->tail = NULL; - q->cursor = q->head; - q->size = 0; - q->sorted = False_; - } - - return True_; -} - -/*** - * - ** function : Q_AtHead - * - ** purpose : tests if cursor is at head of queue - * - ** parameters : 'queue' pointer. - * - ** returns : boolean - True_ is at head else False_ - * - ** comments : - * - ***/ - -int Q_AtHead(queue *q) -{ - return(q && q->cursor == q->head); -} - - -/*** - * - ** function : Q_AtTail - * - ** purpose : boolean test if cursor at tail of queue - * - ** parameters : 'queue' pointer to test. - * - ** returns : True_ or False_ - * - ** comments : - * - ***/ - -int Q_AtTail(queue *q) -{ - return(q && q->cursor == q->tail); -} - - -/*** - * - ** function : Q_IsEmpty - * - ** purpose : test if queue has nothing in it. - * - ** parameters : 'queue' pointer - * - ** returns : True_ if IsEmpty queue, else False_ - * - ** comments : - * - ***/ - -inline int Q_IsEmpty(queue *q) -{ - return(!q || q->size == 0); -} - -/*** - * - ** function : Q_Size - * - ** purpose : return the number of elements in the queue - * - ** parameters : queue pointer - * - ** returns : number of elements - * - ** comments : - * - ***/ - -int Q_Size(queue *q) -{ - return q ? q->size : 0; -} - - -/*** - * - ** function : Q_Head - * - ** purpose : position queue cursor to first element (head) of queue. - * - ** parameters : 'queue' pointer - * - ** returns : pointer to data at head. If queue is IsEmpty returns NULL - * - ** comments : - * - ***/ - -void *Q_Head(queue *q) -{ - if(Q_IsEmpty(q)) - return NULL; - - q->cursor = q->head; - - return q->cursor->data; -} - - -/*** - * - ** function : Q_Tail - * - ** purpose : locate cursor at tail of queue. - * - ** parameters : 'queue' pointer - * - ** returns : pointer to data at tail , if queue IsEmpty returns NULL - * - ** comments : - * - ***/ - -void *Q_Tail(queue *q) -{ - if(Q_IsEmpty(q)) - return NULL; - - q->cursor = q->tail; - - return q->cursor->data; -} - - -/*** - * - ** function : Q_PushHead - * - ** purpose : put a data pointer at the head of the queue - * - ** parameters : 'queue' pointer, void pointer to the data. - * - ** returns : True_ if success else False_ if unable to push data. - * - ** comments : - * - ***/ - -int Q_PushHead(queue *q, void *d) -{ - if(q && d) { - node *n; - datanode *p; - - p = malloc(sizeof(datanode)); - if(p == NULL) - return False_; - - n = q->head; - - q->head = (node*)p; - q->head->prev = NULL; - - if(q->size == 0) { - q->head->next = NULL; - q->tail = q->head; - } - else { - q->head->next = (datanode*)n; - n->prev = q->head; - } - - q->head->data = d; - q->size++; - - q->cursor = q->head; - - q->sorted = False_; - - return True_; - } - return False_; -} - - - -/*** - * - ** function : Q_PushTail - * - ** purpose : put a data element pointer at the tail of the queue - * - ** parameters : queue pointer, pointer to the data - * - ** returns : True_ if data pushed, False_ if data not inserted. - * - ** comments : - * - ***/ - -int Q_PushTail(queue *q, void *d) -{ - if(q && d) { - node *p; - datanode *n; - - n = malloc(sizeof(datanode)); - if(n == NULL) - return False_; - - p = q->tail; - q->tail = (node *)n; - - if(q->size == 0) { - q->tail->prev = NULL; - q->head = q->tail; - } - else { - q->tail->prev = (datanode *)p; - p->next = q->tail; - } - - q->tail->next = NULL; - - q->tail->data = d; - q->cursor = q->tail; - q->size++; - - q->sorted = False_; - - return True_; - } - return False_; -} - - - -/*** - * - ** function : Q_PopHead - * - ** purpose : remove and return the top element at the head of the - * queue. - * - ** parameters : queue pointer - * - ** returns : pointer to data element or NULL if queue is IsEmpty. - * - ** comments : - * - ***/ - -void *Q_PopHead(queue *q) -{ - datanode *n; - void *d; - - if(Q_IsEmpty(q)) - return NULL; - - d = q->head->data; - n = q->head->next; - free(q->head); - - q->size--; - - if(q->size == 0) - q->head = q->tail = q->cursor = NULL; - else { - q->head = (node *)n; - q->head->prev = NULL; - q->cursor = q->head; - } - - q->sorted = False_; - - return d; -} - - -/*** - * - ** function : Q_PopTail - * - ** purpose : remove element from tail of queue and return data. - * - ** parameters : queue pointer - * - ** returns : pointer to data element that was at tail. NULL if queue - * IsEmpty. - * - ** comments : - * - ***/ - -void *Q_PopTail(queue *q) -{ - datanode *p; - void *d; - - if(Q_IsEmpty(q)) - return NULL; - - d = q->tail->data; - p = q->tail->prev; - free(q->tail); - q->size--; - - if(q->size == 0) - q->head = q->tail = q->cursor = NULL; - else { - q->tail = (node *)p; - q->tail->next = NULL; - q->cursor = q->tail; - } - - q->sorted = False_; - - return d; -} - - - -/*** - * - ** function : Q_Next - * - ** purpose : Move to the next element in the queue without popping - * - ** parameters : queue pointer. - * - ** returns : pointer to data element of new element or NULL if end - * of the queue. - * - ** comments : This uses the cursor for the current position. Q_Next - * only moves in the direction from the head of the queue - * to the tail. - ***/ - -void *Q_Next(queue *q) -{ - if(!q) - return NULL; - - if(!q->cursor || q->cursor->next == NULL) - return NULL; - - q->cursor = (node *)q->cursor->next; - - return q->cursor->data ; -} - - - -/*** - * - ** function : Q_Previous - * - ** purpose : Opposite of Q_Next. Move to next element closer to the - * head of the queue. - * - ** parameters : pointer to queue - * - ** returns : pointer to data of new element else NULL if queue IsEmpty - * - ** comments : Makes cursor move towards the head of the queue. - * - ***/ - -void *Q_Previous(queue *q) -{ - if(!q) - return NULL; - - if(q->cursor->prev == NULL) - return NULL; - - q->cursor = (node *)q->cursor->prev; - - return q->cursor->data; -} - - -void *Q_Iter_Del(queue *q, q_iter iter) -{ - void *d; - datanode *n, *p; - - if(!q) - return NULL; - - if(iter == NULL) - return NULL; - - if(iter == (q_iter)q->head) - return Q_PopHead(q); - - if(iter == (q_iter)q->tail) - return Q_PopTail(q); - - n = ((node*)iter)->next; - p = ((node*)iter)->prev; - d = ((node*)iter)->data; - - free(iter); - - if(p) { - p->next = n; - } - if (q->cursor == (node*)iter) { - if (p) { - q->cursor = p; - } else { - q->cursor = n; - } - } - - - if (n != NULL) { - n->prev = p; - } - - q->size--; - - q->sorted = False_; - - return d; -} - - - -/*** - * - ** function : Q_DelCur - * - ** purpose : Delete the current queue element as pointed to by - * the cursor. - * - ** parameters : queue pointer - * - ** returns : pointer to data element. - * - ** comments : WARNING! It is the responsibility of the caller to - * free any memory. Queue cannot distinguish between - * pointers to literals and malloced memory. - * - ***/ - -void *Q_DelCur(queue* q) { - if(q) { - return Q_Iter_Del(q, (q_iter)q->cursor); - } - return 0; -} - - -/*** - * - ** function : Q_Destroy - * - ** purpose : Free all queue resources - * - ** parameters : queue pointer - * - ** returns : null. - * - ** comments : WARNING! It is the responsibility of the caller to - * free any memory. Queue cannot distinguish between - * pointers to literals and malloced memory. - * - ***/ - -void Q_Destroy(queue *q) -{ - while(!Q_IsEmpty(q)) { - Q_PopHead(q); - } -} - - -/*** - * - ** function : Q_Get - * - ** purpose : get the pointer to the data at the cursor location - * - ** parameters : queue pointer - * - ** returns : data element pointer - * - ** comments : - * - ***/ - -void *Q_Get(queue *q) -{ - if(!q) - return NULL; - - if(q->cursor == NULL) - return NULL; - return q->cursor->data; -} - - - -/*** - * - ** function : Q_Put - * - ** purpose : replace pointer to data with new pointer to data. - * - ** parameters : queue pointer, data pointer - * - ** returns : boolean- True_ if successful, False_ if cursor at NULL - * - ** comments : - * - ***/ - -int Q_Put(queue *q, void *data) -{ - if(q && data) { - if(q->cursor == NULL) - return False_; - - q->cursor->data = data; - return True_; - } - return False_; -} - - -/*** - * - ** function : Q_Find - * - ** purpose : Linear search of queue for match with key in *data - * - ** parameters : queue pointer q, data pointer with data containing key - * comparison function here called Comp. - * - ** returns : True_ if found , False_ if not in queue. - * - ** comments : Useful for small queues that are constantly changing - * and would otherwise need constant sorting with the - * Q_Seek function. - * For description of Comp see Q_Sort. - * Queue cursor left on position found item else at end. - * - ***/ - -int Q_Find(queue *q, void *data, - int (*Comp)(const void *, const void *)) -{ - void *d; - - if (q == NULL) { - return False_; - } - - d = Q_Head(q); - do { - if(Comp(d, data) == 0) - return True_; - d = Q_Next(q); - } while(!Q_AtTail(q)); - - if(Comp(d, data) == 0) - return True_; - - return False_; -} - -/*======== Sorted Queue and Index functions ========= */ - - -static void QuickSort(void *list[], int low, int high, - int (*Comp)(const void *, const void *)) -{ - int flag = 1, i, j; - void *key, *temp; - - if(low < high) { - i = low; - j = high + 1; - - key = list[ low ]; - - while(flag) { - i++; - while(Comp(list[i], key) < 0) - i++; - - j--; - while(Comp(list[j], key) > 0) - j--; - - if(i < j) { - temp = list[i]; - list[i] = list[j]; - list[j] = temp; - } - else flag = 0; - } - - temp = list[low]; - list[low] = list[j]; - list[j] = temp; - - QuickSort(list, low, j-1, Comp); - QuickSort(list, j+1, high, Comp); - } -} - - -/*** - * - ** function : Q_Sort - * - ** purpose : sort the queue and allow index style access. - * - ** parameters : queue pointer, comparison function compatible with - * with 'qsort'. - * - ** returns : True_ if sort succeeded. False_ if error occurred. - * - ** comments : Comp function supplied by caller must return - * -1 if data1 < data2 - * 0 if data1 == data2 - * +1 if data1 > data2 - * - * for Comp(data1, data2) - * - * If queue is already sorted it frees the memory of the - * old index and starts again. - * - ***/ - -int Q_Sort(queue *q, int (*Comp)(const void *, const void *)) -{ - int i; - void *d; - datanode *dn; - - /* if already sorted free memory for tag array */ - - if(q->sorted) { - free(index); - free(posn_index); - q->sorted = False_; - } - - /* Now allocate memory of array, array of pointers */ - - index = malloc(q->size * sizeof(q->cursor->data)); - if(index == NULL) - return False_; - - posn_index = malloc(q->size * sizeof(q->cursor)); - if(posn_index == NULL) { - free(index); - return False_; - } - - /* Walk queue putting pointers into array */ - - d = Q_Head(q); - for(i=0; i < q->size; i++) { - index[i] = d; - posn_index[i] = q->cursor; - d = Q_Next(q); - } - - /* Now sort the index */ - - QuickSort(index, 0, q->size - 1, Comp); - - /* Rearrange the actual queue into correct order */ - - dn = q->head; - i = 0; - while(dn != NULL) { - dn->data = index[i++]; - dn = dn->next; - } - - /* Re-position to original element */ - - if(d != NULL) - Q_Find(q, d, Comp); - else Q_Head(q); - - q->sorted = True_; - - return True_; -} - - -/*** - * - ** function : Q_BSearch - * - ** purpose : binary search of queue index for node containing key - * - ** parameters : queue pointer 'q', data pointer of key 'key', - * Comp comparison function. - * - ** returns : integer index into array of node pointers, - * or -1 if not found. - * - ** comments : see Q_Sort for description of 'Comp' function. - * - ***/ - -static int Q_BSearch( queue *q, void *key, - int (*Comp)(const void *, const void*)) -{ - int low, mid, hi, val; - - low = 0; - hi = q->size - 1; - - while(low <= hi) { - mid = (low + hi) / 2; - val = Comp(key, index[ mid ]); - - if(val < 0) - hi = mid - 1; - - else if(val > 0) - low = mid + 1; - - else /* Success */ - return mid; - } - - /* Not Found */ - - return -1; -} - - -/*** - * - ** function : Q_Seek - * - ** purpose : use index to locate data according to key in 'data' - * - ** parameters : queue pointer 'q', data pointer 'data', Comp comparison - * function. - * - ** returns : pointer to data or NULL if could not find it or could - * not sort queue. - * - ** comments : see Q_Sort for description of 'Comp' function. - * - ***/ - -void *Q_Seek(queue *q, void *data, int (*Comp)(const void *, const void *)) -{ - int idx; - - if (q == NULL) { - return NULL; - } - - if(!q->sorted) { - if(!Q_Sort(q, Comp)) - return NULL; - } - - idx = Q_BSearch(q, data, Comp); - - if(idx < 0) - return NULL; - - q->cursor = posn_index[idx]; - - return index[idx]; -} - - - -/*** - * - ** function : Q_Insert - * - ** purpose : Insert an element into an indexed queue - * - ** parameters : queue pointer 'q', data pointer 'data', Comp comparison - * function. - * - ** returns : pointer to data or NULL if could not find it or could - * not sort queue. - * - ** comments : see Q_Sort for description of 'Comp' function. - * WARNING! This code can be very slow since each new - * element means a new Q_Sort. Should only be used for - * the insertion of the odd element ,not the piecemeal - * building of an entire queue. - ***/ - -int Q_Insert(queue *q, void *data, int (*Comp)(const void *, const void *)) -{ - if (q == NULL) { - return False_; - } - - Q_PushHead(q, data); - - if(!Q_Sort(q, Comp)) - return False_; - - return True_; -} - -/* read only funcs for iterating through queue. above funcs modify queue */ -q_iter Q_Iter_Head(queue *q) { - return q ? (q_iter)q->head : NULL; -} - -q_iter Q_Iter_Tail(queue *q) { - return q ? (q_iter)q->tail : NULL; -} - -q_iter Q_Iter_Next(q_iter qi) { - return qi ? (q_iter)((node*)qi)->next : NULL; -} - -q_iter Q_Iter_Prev(q_iter qi) { - return qi ? (q_iter)((node*)qi)->prev : NULL; -} - -void * Q_Iter_Get(q_iter qi) { - return qi ? ((node*)qi)->data : NULL; -} - -int Q_Iter_Put(q_iter qi, void* data) { - if(qi) { - ((node*)qi)->data = data; - return True_; - } - return False_; -} diff --git a/ext/xmlrpc/libxmlrpc/queue.h b/ext/xmlrpc/libxmlrpc/queue.h deleted file mode 100644 index be73f6da00ecb..0000000000000 --- a/ext/xmlrpc/libxmlrpc/queue.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Date last modified: Jan 2001 - * Modifications by Dan Libby (dan@libby.com), including: - * - various fixes, null checks, etc - * - addition of Q_Iter funcs, macros - */ - -/* - * File : q.h - * - * Peter Yard 02 Jan 1993. - * - * Disclaimer: This code is released to the public domain. - */ - -#ifndef Q__H -#define Q__H - -#ifndef False_ - #define False_ 0 -#endif - -#ifndef True_ - #define True_ 1 -#endif - -typedef struct nodeptr datanode; - -typedef struct nodeptr { - void *data ; - datanode *prev, *next ; -} node ; - -/* For external use with Q_Iter* funcs */ -typedef struct nodeptr* q_iter; - -typedef struct { - node *head, *tail, *cursor; - int size, sorted, item_deleted; -} queue; - -typedef struct { - void *dataptr; - node *loc ; -} index_elt ; - - -int Q_Init(queue *q); -void Q_Destroy(queue *q); -int Q_IsEmpty(queue *q); -int Q_Size(queue *q); -int Q_AtHead(queue *q); -int Q_AtTail(queue *q); -int Q_PushHead(queue *q, void *d); -int Q_PushTail(queue *q, void *d); -void *Q_Head(queue *q); -void *Q_Tail(queue *q); -void *Q_PopHead(queue *q); -void *Q_PopTail(queue *q); -void *Q_Next(queue *q); -void *Q_Previous(queue *q); -void *Q_DelCur(queue *q); -void *Q_Get(queue *q); -int Q_Put(queue *q, void *data); -int Q_Sort(queue *q, int (*Comp)(const void *, const void *)); -int Q_Find(queue *q, void *data, - int (*Comp)(const void *, const void *)); -void *Q_Seek(queue *q, void *data, - int (*Comp)(const void *, const void *)); -int Q_Insert(queue *q, void *data, - int (*Comp)(const void *, const void *)); - -/* read only funcs for iterating through queue. above funcs modify queue */ -q_iter Q_Iter_Head(queue *q); -q_iter Q_Iter_Tail(queue *q); -q_iter Q_Iter_Next(q_iter qi); -q_iter Q_Iter_Prev(q_iter qi); -void* Q_Iter_Get(q_iter qi); -int Q_Iter_Put(q_iter qi, void* data); /* not read only! here for completeness. */ -void* Q_Iter_Del(queue *q, q_iter iter); /* not read only! here for completeness. */ - -/* Fast (macro'd) versions of above */ -#define Q_Iter_Head_F(q) (q ? (q_iter)((queue*)q)->head : NULL) -#define Q_Iter_Tail_F(q) (q ? (q_iter)((queue*)q)->tail : NULL) -#define Q_Iter_Next_F(qi) (qi ? (q_iter)((node*)qi)->next : NULL) -#define Q_Iter_Prev_F(qi) (qi ? (q_iter)((node*)qi)->prev : NULL) -#define Q_Iter_Get_F(qi) (qi ? ((node*)qi)->data : NULL) - -#endif /* Q__H */ diff --git a/ext/xmlrpc/libxmlrpc/simplestring.c b/ext/xmlrpc/libxmlrpc/simplestring.c deleted file mode 100644 index 7211d2cd94195..0000000000000 --- a/ext/xmlrpc/libxmlrpc/simplestring.c +++ /dev/null @@ -1,248 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -static const char rcsid[] = "#(@) $Id$"; - - -#define SIMPLESTRING_INCR 32 - -/****h* ABOUT/simplestring - * NAME - * simplestring - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * CREATION DATE - * 06/2000 - * HISTORY - * $Log$ - * Revision 1.3 2002/08/22 01:25:50 sniper - * kill some compile warnings - * - * Revision 1.2 2002/07/05 04:43:53 danda - * merged in updates from SF project. bring php repository up to date with xmlrpc-epi version 0.51 - * - * Revision 1.4 2002/02/13 20:58:50 danda - * patch to make source more windows friendly, contributed by Jeff Lawson - * - * Revision 1.3 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 10/15/2000 -- danda -- adding robodoc documentation - * PORTABILITY - * Coded on RedHat Linux 6.2. Builds on Solaris x86. Should build on just - * about anything with minor mods. - * NOTES - * This code was written primarily for xmlrpc, but has found some other uses. - * - * simplestring is, as the name implies, a simple API for dealing with C strings. - * Why would I write yet another string API? Because I couldn't find any that were - * a) free / GPL, b) simple/lightweight, c) fast, not doing unneccesary strlens all - * over the place. So. It is simple, and it seems to work, and it is pretty fast. - * - * Oh, and it is also binary safe, ie it can handle strings with embedded NULLs, - * so long as the real length is passed in. - * - * And the masses rejoiced. - * - * BUGS - * there must be some. - ******/ - -#include -#include -#include "simplestring.h" - -#define my_free(thing) if(thing) {free(thing); thing = 0;} - -/*----------------------** -* Begin String Functions * -*-----------------------*/ - -/****f* FUNC/simplestring_init - * NAME - * simplestring_init - * SYNOPSIS - * void simplestring_init(simplestring* string) - * FUNCTION - * initialize string - * INPUTS - * string - pointer to a simplestring struct that will be initialized - * RESULT - * void - * NOTES - * SEE ALSO - * simplestring_free () - * simplestring_clear () - * SOURCE - */ -void simplestring_init(simplestring* string) { - memset(string, 0, sizeof(simplestring)); -} -/******/ - -static void simplestring_init_str(simplestring* string) { - string->str = (char*)malloc(SIMPLESTRING_INCR); - if(string->str) { - string->str[0] = 0; - string->len = 0; - string->size = SIMPLESTRING_INCR; - } - else { - string->size = 0; - } -} - -/****f* FUNC/simplestring_clear - * NAME - * simplestring_clear - * SYNOPSIS - * void simplestring_clear(simplestring* string) - * FUNCTION - * clears contents of a string - * INPUTS - * string - the string value to clear - * RESULT - * void - * NOTES - * This function is very fast as it does not de-allocate any memory. - * SEE ALSO - * - * SOURCE - */ -void simplestring_clear(simplestring* string) { - if(string->str) { - string->str[0] = 0; - } - string->len = 0; -} -/******/ - -/****f* FUNC/simplestring_free - * NAME - * simplestring_free - * SYNOPSIS - * void simplestring_free(simplestring* string) - * FUNCTION - * frees contents of a string, if any. Does *not* free the simplestring struct itself. - * INPUTS - * string - value containing string to be free'd - * RESULT - * void - * NOTES - * caller is responsible for allocating and freeing simplestring* struct itself. - * SEE ALSO - * simplestring_init () - * SOURCE - */ -void simplestring_free(simplestring* string) { - if(string && string->str) { - my_free(string->str); - string->len = 0; - } -} -/******/ - -/****f* FUNC/simplestring_addn - * NAME - * simplestring_addn - * SYNOPSIS - * void simplestring_addn(simplestring* string, const char* add, int add_len) - * FUNCTION - * copies n characters from source to target string - * INPUTS - * target - target string - * source - source string - * add_len - number of characters to copy - * RESULT - * void - * NOTES - * SEE ALSO - * simplestring_add () - * SOURCE - */ -void simplestring_addn(simplestring* target, const char* source, int add_len) { - if(target && source) { - if(!target->str) { - simplestring_init_str(target); - } - if(target->len + add_len + 1 > target->size) { - /* newsize is current length + new length */ - int newsize = target->len + add_len + 1; - int incr = target->size * 2; - - /* align to SIMPLESTRING_INCR increments */ - newsize = newsize - (newsize % incr) + incr; - target->str = (char*)realloc(target->str, newsize); - - target->size = target->str ? newsize : 0; - } - - if(target->str) { - if(add_len) { - memcpy(target->str + target->len, source, add_len); - } - target->len += add_len; - target->str[target->len] = 0; /* null terminate */ - } - } -} -/******/ - -/****f* FUNC/simplestring_add - * NAME - * simplestring_add - * SYNOPSIS - * void simplestring_add(simplestring* string, const char* add) - * FUNCTION - * appends a string of unknown length from source to target - * INPUTS - * target - the target string to append to - * source - the source string of unknown length - * RESULT - * void - * NOTES - * SEE ALSO - * simplestring_addn () - * SOURCE - */ -void simplestring_add(simplestring* target, const char* source) { - if(target && source) { - simplestring_addn(target, source, strlen(source)); - } -} -/******/ - - -/*---------------------- -* End String Functions * -*--------------------**/ diff --git a/ext/xmlrpc/libxmlrpc/simplestring.h b/ext/xmlrpc/libxmlrpc/simplestring.h deleted file mode 100644 index c5d98cf1d8e01..0000000000000 --- a/ext/xmlrpc/libxmlrpc/simplestring.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifndef __SIMPLESTRING_H__ - #define __SIMPLESTRING_H__ - -/*-******************************** -* begin simplestring header stuff * -**********************************/ - -#ifdef __cplusplus -extern "C" { -#endif - - /****s* struct/simplestring - * NAME - * simplestring - * NOTES - * represents a string efficiently for fast appending, etc. - * SOURCE - */ -typedef struct _simplestring { - char* str; /* string buf */ - int len; /* length of string/buf */ - int size; /* size of allocated buffer */ -} simplestring; -/******/ - -#ifndef NULL - #define NULL 0 -#endif - -void simplestring_init(simplestring* string); -void simplestring_clear(simplestring* string); -void simplestring_free(simplestring* string); -void simplestring_add(simplestring* string, const char* add); -void simplestring_addn(simplestring* string, const char* add, int add_len); - -#ifdef __cplusplus -} -#endif - -/*-****************************** -* end simplestring header stuff * -********************************/ - -#endif /* __SIMPLESTRING_H__ */ diff --git a/ext/xmlrpc/libxmlrpc/system_methods.c b/ext/xmlrpc/libxmlrpc/system_methods.c deleted file mode 100644 index c47236df140e5..0000000000000 --- a/ext/xmlrpc/libxmlrpc/system_methods.c +++ /dev/null @@ -1,375 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -/****h* ABOUT/system_methods - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * HISTORY - * $Log$ - * Revision 1.7 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 4/28/2001 -- danda -- adding system.multicall and separating out system methods. - * TODO - * NOTES - *******/ - - -#include "queue.h" -#include "xmlrpc.h" -#include "xmlrpc_private.h" -#include "xmlrpc_introspection_private.h" -#include "system_methods_private.h" -#include -#include -#include - - -static const char* xsm_introspection_xml = -"" - -"" - "" - - "" - "value identifier" - "value's xmlrpc or user-defined type" - "value's textual description " - "true if value is optional, else it is required " - "a child of this element. n/a for scalar types " - "" - - "" - "" - "" - - "" - "" - "" - - - "" - - "" - - "" - "" - "Dan Libby" - "fully describes the methods and types implemented by this XML-RPC server." - "1.1" - "" - "" - "" - "" - "a valid method name" - "" - "" - "" - "" - "" - "" - "method name" - "method version" - "method author" - "method purpose" - "" - "" - "parameter list" - "return value list" - "" - "" - "list of known bugs" - "list of possible errors and error codes" - "list of examples" - "list of modifications" - "list of notes" - "see also. list of related methods" - "list of unimplemented features" - "" - "" - "" - "a type description" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "enumerates the methods implemented by this XML-RPC server." - "1.0" - "" - "" - "" - "" - "name of a method implemented by the server." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "provides documentation string for a single method" - "1.0" - "" - "" - "" - "name of the method for which documentation is desired" - "" - "" - "help text if defined for the method passed, otherwise an empty string" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "provides 1 or more signatures for a single method" - "1.0" - "" - "" - "" - "name of the method for which documentation is desired" - "" - "" - "" - "" - "a string indicating the xmlrpc type of a value. one of: string, int, double, base64, datetime, array, struct" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "executes multiple methods in sequence and returns the results" - "1.0" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" - "" - "Dan Libby" - "returns a list of capabilities supported by this server" - "1.0" - "spec url: http://groups.yahoo.com/group/xml-rpc/message/2897" - "" - "" - "" - "" - "" - "www address of the specification defining this capability" - "version of the spec that this server's implementation conforms to" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - - "" -""; - - -/* forward declarations for static (non public, non api) funcs */ -static XMLRPC_VALUE xsm_system_multicall_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -static XMLRPC_VALUE xsm_system_get_capabilities_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); - -/*-******************* -* System Methods API * -*********************/ - -static void xsm_lazy_doc_methods_cb(XMLRPC_SERVER server, void* userData) { - XMLRPC_VALUE xDesc = XMLRPC_IntrospectionCreateDescription(xsm_introspection_xml, NULL); - XMLRPC_ServerAddIntrospectionData(server, xDesc); - XMLRPC_CleanupValue(xDesc); -} - -void xsm_register(XMLRPC_SERVER server) { - xi_register_system_methods(server); - - XMLRPC_ServerRegisterMethod(server, xsm_token_system_multicall, xsm_system_multicall_cb); - XMLRPC_ServerRegisterMethod(server, xsm_token_system_get_capabilities, xsm_system_get_capabilities_cb); - - /* callback for documentation generation should it be requested */ - XMLRPC_ServerRegisterIntrospectionCallback(server, xsm_lazy_doc_methods_cb); -} - -XMLRPC_VALUE xsm_system_multicall_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - XMLRPC_VALUE xArray = XMLRPC_VectorRewind(XMLRPC_RequestGetData(input)); - XMLRPC_VALUE xReturn = XMLRPC_CreateVector(0, xmlrpc_vector_array); - - if (xArray) { - XMLRPC_VALUE xMethodIter = XMLRPC_VectorRewind(xArray); - - while (xMethodIter) { - XMLRPC_REQUEST request = XMLRPC_RequestNew(); - if(request) { - const char* methodName = XMLRPC_VectorGetStringWithID(xMethodIter, "methodName"); - XMLRPC_VALUE params = XMLRPC_VectorGetValueWithID(xMethodIter, "params"); - - if(methodName && params) { - XMLRPC_VALUE xRandomArray = XMLRPC_CreateVector(0, xmlrpc_vector_array); - XMLRPC_RequestSetMethodName(request, methodName); - XMLRPC_RequestSetData(request, params); - XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); - - XMLRPC_AddValueToVector(xRandomArray, - XMLRPC_ServerCallMethod(server, request, userData)); - - XMLRPC_AddValueToVector(xReturn, xRandomArray); - } - XMLRPC_RequestFree(request, 1); - } - xMethodIter = XMLRPC_VectorNext(xArray); - } - } - return xReturn; -} - - -XMLRPC_VALUE xsm_system_get_capabilities_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - XMLRPC_VALUE xReturn = XMLRPC_CreateVector(0, xmlrpc_vector_struct); - XMLRPC_VALUE xFaults = XMLRPC_CreateVector("faults_interop", xmlrpc_vector_struct); - XMLRPC_VALUE xIntro = XMLRPC_CreateVector("introspection", xmlrpc_vector_struct); - - /* support for fault spec */ - XMLRPC_VectorAppendString(xFaults, "specURL", "http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php", 0); - XMLRPC_VectorAppendInt(xFaults, "specVersion", 20010516); - - /* support for introspection spec */ - XMLRPC_VectorAppendString(xIntro, "specURL", "http://xmlrpc-epi.sourceforge.net/specs/rfc.introspection.php", 0); - XMLRPC_VectorAppendInt(xIntro, "specVersion", 20010516); - - XMLRPC_AddValuesToVector(xReturn, - xFaults, - xIntro, - NULL); - - return xReturn; - -} - -/*-*********************** -* End System Methods API * -*************************/ - - - diff --git a/ext/xmlrpc/libxmlrpc/system_methods_private.h b/ext/xmlrpc/libxmlrpc/system_methods_private.h deleted file mode 100644 index 72408fd3c4baf..0000000000000 --- a/ext/xmlrpc/libxmlrpc/system_methods_private.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Dan Libby, Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* IMPORTANT! - * - * only non-public things should be in this file. It is fine for any .c file - * in xmlrpc/src to include it, but users of the public API should never - * include it, and thus *.h files that are part of the public API should - * never include it, or they would break if this file is not present. - */ - - -#ifndef __SYSTEM_METHODS_PRIVATE_H -/* - * Avoid include redundancy. - */ -#define __SYSTEM_METHODS_PRIVATE_H - -/*---------------------------------------------------------------------------- - * system_methods_private.h - * - * Purpose: - * define non-public system.* methods - * Comments: - * xsm = xmlrpc system methods - */ - -/*---------------------------------------------------------------------------- - * Constants - */ -#define xsm_token_system_multicall "system.multiCall" -#define xsm_token_system_get_capabilities "system.getCapabilities" - - -/*---------------------------------------------------------------------------- - * Includes - */ - -/*---------------------------------------------------------------------------- - * Structures - */ - -/*---------------------------------------------------------------------------- - * Globals - */ - -/*---------------------------------------------------------------------------- - * Functions - */ -void xsm_register(XMLRPC_SERVER server); -int xsm_is_system_method(XMLRPC_Callback cb); - -/*---------------------------------------------------------------------------- - * Macros - */ - - -#endif /* __SYSTEM_METHODS_PRIVATE_H */ - - - - diff --git a/ext/xmlrpc/libxmlrpc/xml_element.c b/ext/xmlrpc/libxmlrpc/xml_element.c deleted file mode 100644 index 8d15549802194..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_element.c +++ /dev/null @@ -1,766 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -static const char rcsid[] = "#(@) $Id$"; - - - -/****h* ABOUT/xml_element - * NAME - * xml_element - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * CREATION DATE - * 06/2000 - * HISTORY - * $Log$ - * Revision 1.9.4.2 2008/12/17 00:30:48 iliaa - * - * MFH: removed unused var - * - * Revision 1.9.4.1 2006/07/30 11:34:02 tony2001 - * MFH: fix compile warnings (#38257) - * - * Revision 1.9 2005/04/22 11:06:53 jorton - * Fixed bug #32797 (invalid C code in xmlrpc extension). - * - * Revision 1.8 2005/03/28 00:07:24 edink - * Reshufle includes to make it compile on windows - * - * Revision 1.7 2005/03/26 03:13:58 sniper - * - Made it possible to build ext/xmlrpc with libxml2 - * - * Revision 1.6 2004/06/01 20:16:06 iliaa - * Fixed bug #28597 (xmlrpc_encode_request() incorrectly encodes chars in - * 200-210 range). - * Patch by: fernando dot nemec at folha dot com dot br - * - * Revision 1.5 2003/12/16 21:00:21 sniper - * Fix some compile warnings (patch by Joe Orton) - * - * Revision 1.4 2002/11/26 23:01:16 fmk - * removing unused variables - * - * Revision 1.3 2002/07/05 04:43:53 danda - * merged in updates from SF project. bring php repository up to date with xmlrpc-epi version 0.51 - * - * Revision 1.9 2002/07/03 20:54:30 danda - * root element should not have a parent. patch from anon SF user - * - * Revision 1.8 2002/05/23 17:46:51 danda - * patch from mukund - fix non utf-8 encoding conversions - * - * Revision 1.7 2002/02/13 20:58:50 danda - * patch to make source more windows friendly, contributed by Jeff Lawson - * - * Revision 1.6 2002/01/08 01:06:55 danda - * enable format for parsers that are very picky. - * - * Revision 1.5 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 10/15/2000 -- danda -- adding robodoc documentation - * TODO - * Nicer external API. Get rid of macros. Make opaque types, etc. - * PORTABILITY - * Coded on RedHat Linux 6.2. Builds on Solaris x86. Should build on just - * about anything with minor mods. - * NOTES - * This code incorporates ideas from expat-ensor from http://xml.ensor.org. - * - * It was coded primarily to act as a go-between for expat and xmlrpc. To this - * end, it stores xml elements, their sub-elements, and their attributes in an - * in-memory tree. When expat is done parsing, the tree can be walked, thus - * retrieving the values. The code can also be used to build a tree via API then - * write out the tree to a buffer, thus "serializing" the xml. - * - * It turns out this is useful for other purposes, such as parsing config files. - * YMMV. - * - * Some Features: - * - output option for xml escaping data. Choices include no escaping, entity escaping, - * or CDATA sections. - * - output option for character encoding. Defaults to (none) utf-8. - * - output option for verbosity/readability. ultra-compact, newlines, pretty/level indented. - * - * BUGS - * there must be some. - ******/ - -#include "ext/xml/expat_compat.h" -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include - -#include "xml_element.h" -#include "queue.h" -#include "encodings.h" - -#define my_free(thing) if(thing) {free(thing); thing = NULL;} - -#define XML_DECL_START "" -#define XML_DECL_END_LEN sizeof(XML_DECL_END) - 1 -#define START_TOKEN_BEGIN "<" -#define START_TOKEN_BEGIN_LEN sizeof(START_TOKEN_BEGIN) - 1 -#define START_TOKEN_END ">" -#define START_TOKEN_END_LEN sizeof(START_TOKEN_END) - 1 -#define EMPTY_START_TOKEN_END "/>" -#define EMPTY_START_TOKEN_END_LEN sizeof(EMPTY_START_TOKEN_END) - 1 -#define END_TOKEN_BEGIN "" -#define END_TOKEN_END_LEN sizeof(END_TOKEN_END) - 1 -#define ATTR_DELIMITER "\"" -#define ATTR_DELIMITER_LEN sizeof(ATTR_DELIMITER) - 1 -#define CDATA_BEGIN "" -#define CDATA_END_LEN sizeof(CDATA_END) - 1 -#define EQUALS "=" -#define EQUALS_LEN sizeof(EQUALS) - 1 -#define WHITESPACE " " -#define WHITESPACE_LEN sizeof(WHITESPACE) - 1 -#define NEWLINE "\n" -#define NEWLINE_LEN sizeof(NEWLINE) - 1 -#define MAX_VAL_BUF 144 -#define SCALAR_STR "SCALAR" -#define SCALAR_STR_LEN sizeof(SCALAR_STR) - 1 -#define VECTOR_STR "VECTOR" -#define VECTOR_STR_LEN sizeof(VECTOR_STR) - 1 -#define RESPONSE_STR "RESPONSE" -#define RESPONSE_STR_LEN sizeof(RESPONSE_STR) - 1 - - -/*----------------------------- -- Begin xml_element Functions - ------------------------------*/ - -/****f* xml_element/xml_elem_free_non_recurse - * NAME - * xml_elem_free_non_recurse - * SYNOPSIS - * void xml_elem_free_non_recurse(xml_element* root) - * FUNCTION - * free a single xml element. child elements will not be freed. - * INPUTS - * root - the element to free - * RESULT - * void - * NOTES - * SEE ALSO - * xml_elem_free () - * xml_elem_new () - * SOURCE - */ -void xml_elem_free_non_recurse(xml_element* root) { - if(root) { - xml_element_attr* attrs = Q_Head(&root->attrs); - while(attrs) { - my_free(attrs->key); - my_free(attrs->val); - my_free(attrs); - attrs = Q_Next(&root->attrs); - } - - Q_Destroy(&root->children); - Q_Destroy(&root->attrs); - if(root->name) { - free((char *)root->name); - root->name = NULL; - } - simplestring_free(&root->text); - my_free(root); - } -} -/******/ - -/****f* xml_element/xml_elem_free - * NAME - * xml_elem_free - * SYNOPSIS - * void xml_elem_free(xml_element* root) - * FUNCTION - * free an xml element and all of its child elements - * INPUTS - * root - the root of an xml tree you would like to free - * RESULT - * void - * NOTES - * SEE ALSO - * xml_elem_free_non_recurse () - * xml_elem_new () - * SOURCE - */ -void xml_elem_free(xml_element* root) { - if(root) { - xml_element* kids = Q_Head(&root->children); - while(kids) { - xml_elem_free(kids); - kids = Q_Next(&root->children); - } - xml_elem_free_non_recurse(root); - } -} -/******/ - -/****f* xml_element/xml_elem_new - * NAME - * xml_elem_new - * SYNOPSIS - * xml_element* xml_elem_new() - * FUNCTION - * allocates and initializes a new xml_element - * INPUTS - * none - * RESULT - * xml_element* or NULL. NULL indicates an out-of-memory condition. - * NOTES - * SEE ALSO - * xml_elem_free () - * xml_elem_free_non_recurse () - * SOURCE - */ -xml_element* xml_elem_new() { - xml_element* elem = calloc(1, sizeof(xml_element)); - if(elem) { - Q_Init(&elem->children); - Q_Init(&elem->attrs); - simplestring_init(&elem->text); - - /* init empty string in case we don't find any char data */ - simplestring_addn(&elem->text, "", 0); - } - return elem; -} -/******/ - -static int xml_elem_writefunc(int (*fptr)(void *data, const char *text, int size), const char *text, void *data, int len) -{ - return fptr && text ? fptr(data, text, len ? len : strlen(text)) : 0; -} - - - -static int create_xml_escape(char *pString, unsigned char c) -{ - int counter = 0; - - pString[counter++] = '&'; - pString[counter++] = '#'; - if(c >= 100) { - pString[counter++] = c / 100 + '0'; - c = c % 100; - } - pString[counter++] = c / 10 + '0'; - c = c % 10; - - pString[counter++] = c + '0'; - pString[counter++] = ';'; - return counter; -} - -#define non_ascii(c) (c > 127) -#define non_print(c) (!isprint(c)) -#define markup(c) (c == '&' || c == '\"' || c == '>' || c == '<') -#define entity_length(c) ( (c >= 100) ? 3 : ((c >= 10) ? 2 : 1) ) + 3; /* "&#" + c + ";" */ - -/* - * xml_elem_entity_escape - * - * Purpose: - * escape reserved xml chars and non utf-8 chars as xml entities - * Comments: - * The return value may be a new string, or null if no - * conversion was performed. In the latter case, *newlen will - * be 0. - * Flags (to escape) - * xml_elem_no_escaping = 0x000, - * xml_elem_entity_escaping = 0x002, // escape xml special chars as entities - * xml_elem_non_ascii_escaping = 0x008, // escape chars above 127 - * xml_elem_cdata_escaping = 0x010, // wrap in cdata - */ -static char* xml_elem_entity_escape(const char* buf, int old_len, int *newlen, XML_ELEM_ESCAPING flags) { - char *pRetval = 0; - int iNewBufLen=0; - -#define should_escape(c, flag) ( ((flag & xml_elem_markup_escaping) && markup(c)) || \ - ((flag & xml_elem_non_ascii_escaping) && non_ascii(c)) || \ - ((flag & xml_elem_non_print_escaping) && non_print(c)) ) - - if(buf && *buf) { - const unsigned char *bufcopy; - char *NewBuffer; - int ToBeXmlEscaped=0; - int iLength; - bufcopy = buf; - iLength= old_len ? old_len : strlen(buf); - while(*bufcopy) { - if( should_escape(*bufcopy, flags) ) { - /* the length will increase by length of xml escape - the character length */ - iLength += entity_length(*bufcopy); - ToBeXmlEscaped=1; - } - bufcopy++; - } - - if(ToBeXmlEscaped) { - - NewBuffer= malloc(iLength+1); - if(NewBuffer) { - bufcopy=buf; - while(*bufcopy) { - if(should_escape(*bufcopy, flags)) { - iNewBufLen += create_xml_escape(NewBuffer+iNewBufLen,*bufcopy); - } - else { - NewBuffer[iNewBufLen++]=*bufcopy; - } - bufcopy++; - } - NewBuffer[iNewBufLen] = 0; - pRetval = NewBuffer; - } - } - } - - if(newlen) { - *newlen = iNewBufLen; - } - - return pRetval; -} - - -static void xml_element_serialize(xml_element *el, int (*fptr)(void *data, const char *text, int size), void *data, XML_ELEM_OUTPUT_OPTIONS options, int depth) -{ - int i; - static STRUCT_XML_ELEM_OUTPUT_OPTIONS default_opts = {xml_elem_pretty, xml_elem_markup_escaping | xml_elem_non_print_escaping, XML_DECL_ENCODING_DEFAULT}; - static char whitespace[] = " " - " " - " "; - depth++; - - if(!el) { -/* fprintf(stderr, "Nothing to write\n"); */ - return; - } - if(!options) { - options = &default_opts; - } - - /* print xml declaration if at root level */ - if(depth == 1) { - xml_elem_writefunc(fptr, XML_DECL_START, data, XML_DECL_START_LEN); - xml_elem_writefunc(fptr, WHITESPACE, data, WHITESPACE_LEN); - xml_elem_writefunc(fptr, XML_DECL_VERSION, data, XML_DECL_VERSION_LEN); - if(options->encoding && *options->encoding) { - xml_elem_writefunc(fptr, WHITESPACE, data, WHITESPACE_LEN); - xml_elem_writefunc(fptr, XML_DECL_ENCODING_ATTR, data, XML_DECL_ENCODING_ATTR_LEN); - xml_elem_writefunc(fptr, EQUALS, data, EQUALS_LEN); - xml_elem_writefunc(fptr, ATTR_DELIMITER, data, ATTR_DELIMITER_LEN); - xml_elem_writefunc(fptr, options->encoding, data, 0); - xml_elem_writefunc(fptr, ATTR_DELIMITER, data, ATTR_DELIMITER_LEN); - } - xml_elem_writefunc(fptr, XML_DECL_END, data, XML_DECL_END_LEN); - if(options->verbosity != xml_elem_no_white_space) { - xml_elem_writefunc(fptr, NEWLINE, data, NEWLINE_LEN); - } - } - - if(options->verbosity == xml_elem_pretty && depth > 2) { - xml_elem_writefunc(fptr, whitespace, data, depth - 2); - } - /* begin element */ - xml_elem_writefunc(fptr,START_TOKEN_BEGIN, data, START_TOKEN_BEGIN_LEN); - if(el->name) { - xml_elem_writefunc(fptr, el->name, data, 0); - - /* write attrs, if any */ - if(Q_Size(&el->attrs)) { - xml_element_attr* iter = Q_Head(&el->attrs); - while( iter ) { - xml_elem_writefunc(fptr, WHITESPACE, data, WHITESPACE_LEN); - xml_elem_writefunc(fptr, iter->key, data, 0); - xml_elem_writefunc(fptr, EQUALS, data, EQUALS_LEN); - xml_elem_writefunc(fptr, ATTR_DELIMITER, data, ATTR_DELIMITER_LEN); - xml_elem_writefunc(fptr, iter->val, data, 0); - xml_elem_writefunc(fptr, ATTR_DELIMITER, data, ATTR_DELIMITER_LEN); - - iter = Q_Next(&el->attrs); - } - } - } - else { - xml_elem_writefunc(fptr, "None", data, 0); - } - /* if no text and no children, use abbreviated form, eg: */ - if(!el->text.len && !Q_Size(&el->children)) { - xml_elem_writefunc(fptr, EMPTY_START_TOKEN_END, data, EMPTY_START_TOKEN_END_LEN); - } - /* otherwise, print element contents */ - else { - xml_elem_writefunc(fptr, START_TOKEN_END, data, START_TOKEN_END_LEN); - - /* print text, if any */ - if(el->text.len) { - char* escaped_str = el->text.str; - int buflen = el->text.len; - - if(options->escaping && options->escaping != xml_elem_cdata_escaping) { - escaped_str = xml_elem_entity_escape(el->text.str, buflen, &buflen, options->escaping ); - if(!escaped_str) { - escaped_str = el->text.str; - } - } - - if(options->escaping & xml_elem_cdata_escaping) { - xml_elem_writefunc(fptr, CDATA_BEGIN, data, CDATA_BEGIN_LEN); - } - - xml_elem_writefunc(fptr, escaped_str, data, buflen); - - if(escaped_str != el->text.str) { - my_free(escaped_str); - } - - if(options->escaping & xml_elem_cdata_escaping) { - xml_elem_writefunc(fptr, CDATA_END, data, CDATA_END_LEN); - } - } - /* no text, so print child elems */ - else { - xml_element *kids = Q_Head(&el->children); - i = 0; - while( kids ) { - if(i++ == 0) { - if(options->verbosity != xml_elem_no_white_space) { - xml_elem_writefunc(fptr, NEWLINE, data, NEWLINE_LEN); - } - } - xml_element_serialize(kids, fptr, data, options, depth); - kids = Q_Next(&el->children); - } - if(i) { - if(options->verbosity == xml_elem_pretty && depth > 2) { - xml_elem_writefunc(fptr, whitespace, data, depth - 2); - } - } - } - - xml_elem_writefunc(fptr, END_TOKEN_BEGIN, data, END_TOKEN_BEGIN_LEN); - xml_elem_writefunc(fptr,el->name ? el->name : "None", data, 0); - xml_elem_writefunc(fptr, END_TOKEN_END, data, END_TOKEN_END_LEN); - } - if(options->verbosity != xml_elem_no_white_space) { - xml_elem_writefunc(fptr, NEWLINE, data, NEWLINE_LEN); - } -} - -/* print buf to file */ -static int file_out_fptr(void *f, const char *text, int size) -{ - fputs(text, (FILE *)f); - return 0; -} - -/* print buf to simplestring */ -static int simplestring_out_fptr(void *f, const char *text, int size) -{ - simplestring* buf = (simplestring*)f; - if(buf) { - simplestring_addn(buf, text, size); - } - return 0; -} - -/****f* xml_element/xml_elem_serialize_to_string - * NAME - * xml_elem_serialize_to_string - * SYNOPSIS - * void xml_element_serialize_to_string(xml_element *el, XML_ELEM_OUTPUT_OPTIONS options, int *buf_len) - * FUNCTION - * writes element tree as XML into a newly allocated buffer - * INPUTS - * el - root element of tree - * options - options determining how output is written. see XML_ELEM_OUTPUT_OPTIONS - * buf_len - length of returned buffer, if not null. - * RESULT - * char* or NULL. Must be free'd by caller. - * NOTES - * SEE ALSO - * xml_elem_serialize_to_stream () - * xml_elem_parse_buf () - * SOURCE - */ -char* xml_elem_serialize_to_string(xml_element *el, XML_ELEM_OUTPUT_OPTIONS options, int *buf_len) -{ - simplestring buf; - simplestring_init(&buf); - - xml_element_serialize(el, simplestring_out_fptr, (void *)&buf, options, 0); - - if(buf_len) { - *buf_len = buf.len; - } - - return buf.str; -} -/******/ - -/****f* xml_element/xml_elem_serialize_to_stream - * NAME - * xml_elem_serialize_to_stream - * SYNOPSIS - * void xml_elem_serialize_to_stream(xml_element *el, FILE *output, XML_ELEM_OUTPUT_OPTIONS options) - * FUNCTION - * writes element tree as XML into a stream (typically an opened file) - * INPUTS - * el - root element of tree - * output - stream handle - * options - options determining how output is written. see XML_ELEM_OUTPUT_OPTIONS - * RESULT - * void - * NOTES - * SEE ALSO - * xml_elem_serialize_to_string () - * xml_elem_parse_buf () - * SOURCE - */ -void xml_elem_serialize_to_stream(xml_element *el, FILE *output, XML_ELEM_OUTPUT_OPTIONS options) -{ - xml_element_serialize(el, file_out_fptr, (void *)output, options, 0); -} -/******/ - -/*--------------------------* -* End xml_element Functions * -*--------------------------*/ - - -/*---------------------- -* Begin Expat Handlers * -*---------------------*/ - -typedef struct _xml_elem_data { - xml_element* root; - xml_element* current; - XML_ELEM_INPUT_OPTIONS input_options; - int needs_enc_conversion; -} xml_elem_data; - - -/* expat start of element handler */ -static void _xmlrpc_startElement(void *userData, const char *name, const char **attrs) -{ - xml_element *c; - xml_elem_data* mydata = (xml_elem_data*)userData; - const char** p = attrs; - - if(mydata) { - c = mydata->current; - - mydata->current = xml_elem_new(); - mydata->current->name = (char*)strdup(name); - mydata->current->parent = c; - - /* init attrs */ - while(p && *p) { - xml_element_attr* attr = malloc(sizeof(xml_element_attr)); - if(attr) { - attr->key = strdup(*p); - attr->val = strdup(*(p+1)); - Q_PushTail(&mydata->current->attrs, attr); - - p += 2; - } - } - } -} - -/* expat end of element handler */ -static void _xmlrpc_endElement(void *userData, const char *name) -{ - xml_elem_data* mydata = (xml_elem_data*)userData; - - if(mydata && mydata->current && mydata->current->parent) { - Q_PushTail(&mydata->current->parent->children, mydata->current); - - mydata->current = mydata->current->parent; - } -} - -/* expat char data handler */ -static void _xmlrpc_charHandler(void *userData, - const char *s, - int len) -{ - xml_elem_data* mydata = (xml_elem_data*)userData; - if(mydata && mydata->current) { - - /* Check if we need to decode utf-8 parser output to another encoding */ - if(mydata->needs_enc_conversion && mydata->input_options->encoding) { - int new_len = 0; - char* add_text = utf8_decode(s, len, &new_len, mydata->input_options->encoding); - if(add_text) { - len = new_len; - simplestring_addn(&mydata->current->text, add_text, len); - free(add_text); - return; - } - } - simplestring_addn(&mydata->current->text, s, len); - } -} -/******/ - -/*-------------------* -* End Expat Handlers * -*-------------------*/ - -/*-------------------* -* xml_elem_parse_buf * -*-------------------*/ - -/****f* xml_element/xml_elem_parse_buf - * NAME - * xml_elem_parse_buf - * SYNOPSIS - * xml_element* xml_elem_parse_buf(const char* in_buf, int len, XML_ELEM_INPUT_OPTIONS options, XML_ELEM_ERROR error) - * FUNCTION - * parse a buffer containing XML into an xml_element in-memory tree - * INPUTS - * in_buf - buffer containing XML document - * len - length of buffer - * options - input options. optional - * error - error result data. optional. check if result is null. - * RESULT - * void - * NOTES - * The returned data must be free'd by caller - * SEE ALSO - * xml_elem_serialize_to_string () - * xml_elem_free () - * SOURCE - */ -xml_element* xml_elem_parse_buf(const char* in_buf, int len, XML_ELEM_INPUT_OPTIONS options, XML_ELEM_ERROR error) -{ - xml_element* xReturn = NULL; - char buf[100] = ""; - static STRUCT_XML_ELEM_INPUT_OPTIONS default_opts = {encoding_utf_8}; - - if(!options) { - options = &default_opts; - } - - if(in_buf) { - XML_Parser parser; - xml_elem_data mydata = {0}; - - parser = XML_ParserCreate(NULL); - - mydata.root = xml_elem_new(); - mydata.current = mydata.root; - mydata.input_options = options; - mydata.needs_enc_conversion = options->encoding && strcmp(options->encoding, encoding_utf_8); - - XML_SetElementHandler(parser, (XML_StartElementHandler)_xmlrpc_startElement, (XML_EndElementHandler)_xmlrpc_endElement); - XML_SetCharacterDataHandler(parser, (XML_CharacterDataHandler)_xmlrpc_charHandler); - - /* pass the xml_elem_data struct along */ - XML_SetUserData(parser, (void*)&mydata); - - if(!len) { - len = strlen(in_buf); - } - - /* parse the XML */ - if(XML_Parse(parser, in_buf, len, 1) == 0) { - enum XML_Error err_code = XML_GetErrorCode(parser); - int line_num = XML_GetCurrentLineNumber(parser); - int col_num = XML_GetCurrentColumnNumber(parser); - long byte_idx = XML_GetCurrentByteIndex(parser); -/* int byte_total = XML_GetCurrentByteCount(parser); */ - const char * error_str = XML_ErrorString(err_code); - if(byte_idx >= 0) { - snprintf(buf, - sizeof(buf), - "\n\tdata beginning %ld before byte index: %s\n", - byte_idx > 10 ? 10 : byte_idx, - in_buf + (byte_idx > 10 ? byte_idx - 10 : byte_idx)); - } -/* - fprintf(stderr, "expat reports error code %i\n" - "\tdescription: %s\n" - "\tline: %i\n" - "\tcolumn: %i\n" - "\tbyte index: %ld\n" - "\ttotal bytes: %i\n%s ", - err_code, error_str, line_num, - col_num, byte_idx, byte_total, buf); -*/ - - /* error condition */ - if(error) { - error->parser_code = (long)err_code; - error->line = line_num; - error->column = col_num; - error->byte_index = byte_idx; - error->parser_error = error_str; - } - } - else { - xReturn = (xml_element*)Q_Head(&mydata.root->children); - xReturn->parent = NULL; - } - - XML_ParserFree(parser); - - - xml_elem_free_non_recurse(mydata.root); - } - - return xReturn; -} - -/******/ diff --git a/ext/xmlrpc/libxmlrpc/xml_element.h b/ext/xmlrpc/libxmlrpc/xml_element.h deleted file mode 100644 index cfe7ca2483396..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_element.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifndef __XML_ELEMENT_H__ - #define __XML_ELEMENT_H__ - -/* includes */ -#include -#include "queue.h" -#include "simplestring.h" -#include "encodings.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/****d* enum/XML_ELEM_VERBOSITY - * NAME - * XML_ELEM_VERBOSITY - * NOTES - * verbosity/readability options for generated xml - * SEE ALSO - * XML_ELEM_OUTPUT_OPTIONS - * SOURCE - */ -typedef enum _xml_elem_verbosity { - xml_elem_no_white_space, /* compact xml with no white space */ - xml_elem_newlines_only, /* add newlines for enhanced readability */ - xml_elem_pretty /* add newlines and indent accordint to depth */ -} XML_ELEM_VERBOSITY; -/******/ - - -/****d* enum/XML_ELEM_ESCAPING - * NAME - * XML_ELEM_ESCAPING - * NOTES - * xml escaping options for generated xml - * SEE ALSO - * XML_ELEM_OUTPUT_OPTIONS - * SOURCE - */ -typedef enum _xml_elem_escaping { - xml_elem_no_escaping = 0x000, - xml_elem_markup_escaping = 0x002, /* entity escape xml special chars */ - xml_elem_non_ascii_escaping = 0x008, /* entity escape chars above 127 */ - xml_elem_non_print_escaping = 0x010, /* entity escape non print (illegal) chars */ - xml_elem_cdata_escaping = 0x020, /* wrap in cdata section */ -} XML_ELEM_ESCAPING; -/******/ - - -/****s* struct/XML_ELEM_OUTPUT_OPTIONS - * NAME - * XML_ELEM_OUTPUT_OPTIONS - * NOTES - * defines various output options - * SOURCE - */ -typedef struct _xml_output_options { - XML_ELEM_VERBOSITY verbosity; /* length/verbosity of xml */ - XML_ELEM_ESCAPING escaping; /* how to escape special chars */ - const char* encoding; /* " ?> */ -} STRUCT_XML_ELEM_OUTPUT_OPTIONS, *XML_ELEM_OUTPUT_OPTIONS; -/******/ - -/****s* struct/XML_ELEM_INPUT_OPTIONS - * NAME - * XML_ELEM_INPUT_OPTIONS - * NOTES - * defines various input options - * SOURCE - */ -typedef struct _xml_input_options { - ENCODING_ID encoding; /* which encoding to use. */ -} STRUCT_XML_ELEM_INPUT_OPTIONS, *XML_ELEM_INPUT_OPTIONS; -/******/ - -/****s* struct/XML_ELEM_ERROR - * NAME - * XML_ELEM_ERROR - * NOTES - * defines an xml parser error - * SOURCE - */ -typedef struct _xml_elem_error { - int parser_code; - const char* parser_error; - long line; - long column; - long byte_index; -} STRUCT_XML_ELEM_ERROR, *XML_ELEM_ERROR; -/******/ - - -/*-************************ -* begin xml element stuff * -**************************/ - -/****s* struct/xml_elem_attr - * NAME - * xml_elem_attr - * NOTES - * representation of an xml attribute, foo="bar" - * SOURCE - */ -typedef struct _xml_element_attr { - char* key; /* attribute key */ - char* val; /* attribute value */ -} xml_element_attr; -/******/ - -/****s* struct/xml_elem_attr - * NAME - * xml_elem_attr - * NOTES - * representation of an xml element, eg - * SOURCE - */ -typedef struct _xml_element { - const char* name; /* element identifier */ - simplestring text; /* text contained between element begin/end pairs */ - struct _xml_element* parent; /* element's parent */ - - queue attrs; /* attribute list */ - queue children; /* child element list */ -} xml_element; -/******/ - -void xml_elem_free(xml_element* root); -void xml_elem_free_non_recurse(xml_element* root); -xml_element* xml_elem_new(void); -char* xml_elem_serialize_to_string(xml_element *el, XML_ELEM_OUTPUT_OPTIONS options, int *buf_len); -void xml_elem_serialize_to_stream(xml_element *el, FILE *output, XML_ELEM_OUTPUT_OPTIONS options); -xml_element* xml_elem_parse_buf(const char* in_buf, int len, XML_ELEM_INPUT_OPTIONS options, XML_ELEM_ERROR error); - -/*-********************** -* end xml element stuff * -************************/ - -/*-********************** -* Begin xml_element API * -************************/ - -/****d* VALUE/XMLRPC_MACROS - * NAME - * Some Helpful Macros - * NOTES - * Some macros for making life easier. Should be self-explanatory. - * SEE ALSO - * XMLRPC_AddValueToVector () - * XMLRPC_VectorGetValueWithID_Case () - * XMLRPC_VALUE - * SOURCE - */ -#define xml_elem_next_element(el) ((el) ? (xml_element *)Q_Next(&el->children) : NULL) -#define xml_elem_head_element(el) ((el) ? (xml_element *)Q_Head(&el->children) : NULL) -#define xml_elem_next_attr(el) ((el) ? (xml_element_attr *)Q_Next(&el->attrs) : NULL) -#define xml_elem_head_attr(el) ((el) ? (xml_element_attr *)Q_Head(&el->attrs) : NULL) -#define xml_elem_get_name(el) (char *)((el) ? el->name : NULL) -#define xml_elem_get_val(el) (char *)((el) ? el->text.str : NULL) -/******/ - - -/*-******************** -* End xml_element API * -**********************/ - -#ifdef __cplusplus -} -#endif - -#endif /* __XML_ELEMENT_H__ */ diff --git a/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c b/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c deleted file mode 100644 index 753222c55d8a2..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include "xml_to_dandarpc.h" -#include "base64.h" - -/* list of tokens used in vocab */ -#define ELEM_METHODCALL "methodCall" -#define ELEM_METHODNAME "methodName" -#define ELEM_METHODRESPONSE "methodResponse" -#define ELEM_ROOT "simpleRPC" - -#define ATTR_ARRAY "array" -#define ATTR_BASE64 "base64" -#define ATTR_BOOLEAN "boolean" -#define ATTR_DATETIME "dateTime.iso8601" -#define ATTR_DOUBLE "double" -#define ATTR_ID "id" -#define ATTR_INT "int" -#define ATTR_MIXED "mixed" -#define ATTR_SCALAR "scalar" -#define ATTR_STRING "string" -#define ATTR_STRUCT "struct" -#define ATTR_TYPE "type" -#define ATTR_VECTOR "vector" -#define ATTR_VERSION "version" - -#define VAL_VERSION_0_9 "0.9" - - -XMLRPC_VALUE xml_element_to_DANDARPC_REQUEST_worker(XMLRPC_REQUEST request, XMLRPC_VALUE xCurrent, xml_element* el) { - if(!xCurrent) { - xCurrent = XMLRPC_CreateValueEmpty(); - } - - if(el->name) { - const char* id = NULL; - const char* type = NULL; - xml_element_attr* attr_iter = Q_Head(&el->attrs); - - while(attr_iter) { - if(!strcmp(attr_iter->key, ATTR_ID)) { - id = attr_iter->val; - } - if(!strcmp(attr_iter->key, ATTR_TYPE)) { - type = attr_iter->val; - } - attr_iter = Q_Next(&el->attrs); - } - - if(id) { - XMLRPC_SetValueID_Case(xCurrent, id, 0, xmlrpc_case_exact); - } - - if(!strcmp(el->name, ATTR_SCALAR)) { - if(!type || !strcmp(type, ATTR_STRING)) { - XMLRPC_SetValueString(xCurrent, el->text.str, el->text.len); - } - else if(!strcmp(type, ATTR_INT)) { - XMLRPC_SetValueInt(xCurrent, atoi(el->text.str)); - } - else if(!strcmp(type, ATTR_BOOLEAN)) { - XMLRPC_SetValueBoolean(xCurrent, atoi(el->text.str)); - } - else if(!strcmp(type, ATTR_DOUBLE)) { - XMLRPC_SetValueDouble(xCurrent, atof(el->text.str)); - } - else if(!strcmp(type, ATTR_DATETIME)) { - XMLRPC_SetValueDateTime_ISO8601(xCurrent, el->text.str); - } - else if(!strcmp(type, ATTR_BASE64)) { - struct buffer_st buf; - base64_decode_xmlrpc(&buf, el->text.str, el->text.len); - XMLRPC_SetValueBase64(xCurrent, buf.data, buf.offset); - buffer_delete(&buf); - } - } - else if(!strcmp(el->name, ATTR_VECTOR)) { - xml_element* iter = (xml_element*)Q_Head(&el->children); - - if(!type || !strcmp(type, ATTR_MIXED)) { - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_mixed); - } - else if(!strcmp(type, ATTR_ARRAY)) { - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_array); - } - else if(!strcmp(type, ATTR_STRUCT)) { - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_struct); - } - while( iter ) { - XMLRPC_VALUE xNext = XMLRPC_CreateValueEmpty(); - xml_element_to_DANDARPC_REQUEST_worker(request, xNext, iter); - XMLRPC_AddValueToVector(xCurrent, xNext); - iter = (xml_element*)Q_Next(&el->children); - } - } - else { - xml_element* iter = (xml_element*)Q_Head(&el->children); - while( iter ) { - xml_element_to_DANDARPC_REQUEST_worker(request, xCurrent, iter); - iter = (xml_element*)Q_Next(&el->children); - } - - if(!strcmp(el->name, ELEM_METHODCALL)) { - if(request) { - XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); - } - } - else if(!strcmp(el->name, ELEM_METHODRESPONSE)) { - if(request) { - XMLRPC_RequestSetRequestType(request, xmlrpc_request_response); - } - } - else if(!strcmp(el->name, ELEM_METHODNAME)) { - if(request) { - XMLRPC_RequestSetMethodName(request, el->text.str); - } - } - } - } - return xCurrent; -} - -XMLRPC_VALUE xml_element_to_DANDARPC_VALUE(xml_element* el) -{ - return xml_element_to_DANDARPC_REQUEST_worker(NULL, NULL, el); -} - -XMLRPC_VALUE xml_element_to_DANDARPC_REQUEST(XMLRPC_REQUEST request, xml_element* el) -{ - if(request) { - return XMLRPC_RequestSetData(request, xml_element_to_DANDARPC_REQUEST_worker(request, NULL, el)); - } - return NULL; -} - -xml_element* DANDARPC_to_xml_element_worker(XMLRPC_REQUEST request, XMLRPC_VALUE node) { -#define BUF_SIZE 512 - xml_element* root = NULL; - if(node) { - char buf[BUF_SIZE]; - const char* id = XMLRPC_GetValueID(node); - XMLRPC_VALUE_TYPE type = XMLRPC_GetValueType(node); - XMLRPC_REQUEST_OUTPUT_OPTIONS output = XMLRPC_RequestGetOutputOptions(request); - int bNoAddType = (type == xmlrpc_string && request && output && output->xml_elem_opts.verbosity == xml_elem_no_white_space); - xml_element* elem_val = xml_elem_new(); - const char* pAttrType = NULL; - - xml_element_attr* attr_type = bNoAddType ? NULL : malloc(sizeof(xml_element_attr)); - - if(attr_type) { - attr_type->key = strdup(ATTR_TYPE); - attr_type->val = 0; - Q_PushTail(&elem_val->attrs, attr_type); - } - - elem_val->name = (type == xmlrpc_vector) ? strdup(ATTR_VECTOR) : strdup(ATTR_SCALAR); - - if(id && *id) { - xml_element_attr* attr_id = malloc(sizeof(xml_element_attr)); - if(attr_id) { - attr_id->key = strdup(ATTR_ID); - attr_id->val = strdup(id); - Q_PushTail(&elem_val->attrs, attr_id); - } - } - - switch(type) { - case xmlrpc_string: - pAttrType = ATTR_STRING; - simplestring_addn(&elem_val->text, XMLRPC_GetValueString(node), XMLRPC_GetValueStringLen(node)); - break; - case xmlrpc_int: - pAttrType = ATTR_INT; - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueInt(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_boolean: - pAttrType = ATTR_BOOLEAN; - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueBoolean(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_double: - pAttrType = ATTR_DOUBLE; - snprintf(buf, BUF_SIZE, "%f", XMLRPC_GetValueDouble(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_datetime: - pAttrType = ATTR_DATETIME; - simplestring_add(&elem_val->text, XMLRPC_GetValueDateTime_ISO8601(node)); - break; - case xmlrpc_base64: - { - struct buffer_st buf; - pAttrType = ATTR_BASE64; - base64_encode_xmlrpc(&buf, XMLRPC_GetValueBase64(node), XMLRPC_GetValueStringLen(node)); - simplestring_addn(&elem_val->text, buf.data, buf.offset ); - buffer_delete(&buf); - } - break; - case xmlrpc_vector: - { - XMLRPC_VECTOR_TYPE my_type = XMLRPC_GetVectorType(node); - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(node); - - switch(my_type) { - case xmlrpc_vector_array: - pAttrType = ATTR_ARRAY; - break; - case xmlrpc_vector_mixed: - pAttrType = ATTR_MIXED; - break; - case xmlrpc_vector_struct: - pAttrType = ATTR_STRUCT; - break; - default: - break; - } - - /* recurse through sub-elements */ - while( xIter ) { - xml_element* next_el = DANDARPC_to_xml_element_worker(request, xIter); - if(next_el) { - Q_PushTail(&elem_val->children, next_el); - } - xIter = XMLRPC_VectorNext(node); - } - } - break; - default: - break; - } - if(pAttrType && attr_type && !bNoAddType) { - attr_type->val = strdup(pAttrType); - } - root = elem_val; - } - return root; -} - -xml_element* DANDARPC_VALUE_to_xml_element(XMLRPC_VALUE node) { - return DANDARPC_to_xml_element_worker(NULL, node); -} - -xml_element* DANDARPC_REQUEST_to_xml_element(XMLRPC_REQUEST request) { - xml_element* wrapper = NULL; - xml_element* root = NULL; - if(request) { - XMLRPC_REQUEST_TYPE request_type = XMLRPC_RequestGetRequestType(request); - const char* pStr = NULL; - xml_element_attr* version = malloc(sizeof(xml_element_attr)); - version->key = strdup(ATTR_VERSION); - version->val = strdup(VAL_VERSION_0_9); - - wrapper = xml_elem_new(); - - if(request_type == xmlrpc_request_response) { - pStr = ELEM_METHODRESPONSE; - } - else if(request_type == xmlrpc_request_call) { - pStr = ELEM_METHODCALL; - } - if(pStr) { - wrapper->name = strdup(pStr); - } - - root = xml_elem_new(); - root->name = strdup(ELEM_ROOT); - Q_PushTail(&root->attrs, version); - Q_PushTail(&root->children, wrapper); - - pStr = XMLRPC_RequestGetMethodName(request); - - if(pStr) { - xml_element* method = xml_elem_new(); - method->name = strdup(ELEM_METHODNAME); - simplestring_add(&method->text, pStr); - Q_PushTail(&wrapper->children, method); - } - Q_PushTail(&wrapper->children, - DANDARPC_to_xml_element_worker(request, XMLRPC_RequestGetData(request))); - } - return root; -} - diff --git a/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.h b/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.h deleted file mode 100644 index 6facb557788c4..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifndef XML_TO_DANDARPC_H - #define XML_TO_DANDARPC_H - -#include "time.h" -#include "xmlrpc.h" - -XMLRPC_VALUE xml_element_to_DANDARPC_VALUE(xml_element* el); -XMLRPC_VALUE xml_element_to_DANDARPC_REQUEST(XMLRPC_REQUEST request, xml_element* el); -xml_element* DANDARPC_VALUE_to_xml_element(XMLRPC_VALUE node); -xml_element* DANDARPC_REQUEST_to_xml_element(XMLRPC_REQUEST request); - -#endif /* XML_TO_DANDARPC_H */ diff --git a/ext/xmlrpc/libxmlrpc/xml_to_soap.c b/ext/xmlrpc/libxmlrpc/xml_to_soap.c deleted file mode 100644 index 07c57087fbeeb..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_soap.c +++ /dev/null @@ -1,670 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) -*/ - - -/*-********************************************************************** -* TODO: * -* - [SOAP-ENC:position] read sparse arrays (and write?) * -* - [SOAP-ENC:offset] read partially transmitted arrays (and write?) * -* - read "flattened" multi-dimensional arrays. (don't bother writing) * -* * -* BUGS: * -* - does not read schema. thus only knows soap pre-defined types. * -* - references (probably) do not work. untested. * -* - does not expose SOAP-ENV:Header to application at all. * -* - does not use namespaces correctly, thus: * -* - namespaces are hard-coded in comparison tokens * -* - if a sender uses another namespace identifer, it will break * -************************************************************************/ - - -static const char rcsid[] = "#(@) $Id:"; - -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include "xml_to_soap.h" -#include "base64.h" - -/* list of tokens used in vocab */ -#define TOKEN_ANY "xsd:ur-type" -#define TOKEN_ARRAY "SOAP-ENC:Array" -#define TOKEN_ARRAY_TYPE "SOAP-ENC:arrayType" -#define TOKEN_BASE64 "SOAP-ENC:base64" -#define TOKEN_BOOLEAN "xsd:boolean" -#define TOKEN_DATETIME "xsd:timeInstant" -#define TOKEN_DOUBLE "xsd:double" -#define TOKEN_FLOAT "xsd:float" -#define TOKEN_ID "id" -#define TOKEN_INT "xsd:int" -#define TOKEN_NULL "xsi:null" -#define TOKEN_STRING "xsd:string" -#define TOKEN_STRUCT "xsd:struct" -#define TOKEN_TYPE "xsi:type" -#define TOKEN_FAULT "SOAP-ENV:Fault" -#define TOKEN_MUSTUNDERSTAND "SOAP-ENV:mustUnderstand" -#define TOKEN_ACTOR "SOAP-ENV:actor" -#define TOKEN_ACTOR_NEXT "http://schemas.xmlsoap.org/soap/actor/next" - -#define TOKEN_XMLRPC_FAULTCODE "faultCode" -#define TOKEN_XMLRPC_FAULTSTRING "faultString" -#define TOKEN_SOAP_FAULTCODE "faultcode" -#define TOKEN_SOAP_FAULTSTRING "faultstring" -#define TOKEN_SOAP_FAULTDETAILS "details" -#define TOKEN_SOAP_FAULTACTOR "actor" - - -/* determine if a string represents a soap type, as used in element names */ -static inline int is_soap_type(const char* soap_type) { - return(strstr(soap_type, "SOAP-ENC:") || strstr(soap_type, "xsd:")) ? 1 : 0; -} - -/* utility func to generate a new attribute. possibly should be in xml_element.c?? */ -static xml_element_attr* new_attr(const char* key, const char* val) { - xml_element_attr* attr = malloc(sizeof(xml_element_attr)); - if (attr) { - attr->key = key ? strdup(key) : NULL; - attr->val = val ? strdup(val) : NULL; - } - return attr; -} - -struct array_info { - char kids_type[128]; - unsigned long size; - /* ... ? */ -}; - - -/* parses soap arrayType attribute to generate an array_info structure. - * TODO: should deal with sparse, flattened, & multi-dimensional arrays - */ -static struct array_info* parse_array_type_info(const char* array_type) { - struct array_info* ai = NULL; - if (array_type) { - ai = (struct array_info*)calloc(1, sizeof(struct array_info)); - if (ai) { - char buf[128], *p; - snprintf(buf, sizeof(buf), "%s", array_type); - p = strchr(buf, '['); - if (p) { - *p = 0; - } - strcpy(ai->kids_type, buf); - } - } - return ai; -} - -/* performs heuristics on an xmlrpc_vector_array to determine - * appropriate soap arrayType string. - */ -static const char* get_array_soap_type(XMLRPC_VALUE node) { - XMLRPC_VALUE_TYPE_EASY type = xmlrpc_type_none; - - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(node); - int loopCount = 0; - const char* soapType = TOKEN_ANY; - - type = XMLRPC_GetValueTypeEasy(xIter); - xIter = XMLRPC_VectorNext(node); - - while (xIter) { - /* 50 seems like a decent # of loops. That will likely - * cover most cases. Any more and we start to sacrifice - * performance. - */ - if ( (XMLRPC_GetValueTypeEasy(xIter) != type) || loopCount >= 50) { - type = xmlrpc_type_none; - break; - } - loopCount ++; - - xIter = XMLRPC_VectorNext(node); - } - switch (type) { - case xmlrpc_type_none: - soapType = TOKEN_ANY; - break; - case xmlrpc_type_empty: - soapType = TOKEN_NULL; - break; - case xmlrpc_type_int: - soapType = TOKEN_INT; - break; - case xmlrpc_type_double: - soapType = TOKEN_DOUBLE; - break; - case xmlrpc_type_boolean: - soapType = TOKEN_BOOLEAN; - break; - case xmlrpc_type_string: - soapType = TOKEN_STRING; - break; - case xmlrpc_type_base64: - soapType = TOKEN_BASE64; - break; - case xmlrpc_type_datetime: - soapType = TOKEN_DATETIME; - break; - case xmlrpc_type_struct: - soapType = TOKEN_STRUCT; - break; - case xmlrpc_type_array: - soapType = TOKEN_ARRAY; - break; - case xmlrpc_type_mixed: - soapType = TOKEN_STRUCT; - break; - } - return soapType; -} - -/* determines whether a node is a fault or not, and of which type: - * 0 = not a fault, - * 1 = xmlrpc style fault - * 2 = soap style fault. - */ -static inline int get_fault_type(XMLRPC_VALUE node) { - if (XMLRPC_VectorGetValueWithID(node, TOKEN_XMLRPC_FAULTCODE) && - XMLRPC_VectorGetValueWithID(node, TOKEN_XMLRPC_FAULTSTRING)) { - return 1; - } - else if (XMLRPC_VectorGetValueWithID(node, TOKEN_SOAP_FAULTCODE) && - XMLRPC_VectorGetValueWithID(node, TOKEN_SOAP_FAULTSTRING)) { - return 2; - } - return 0; -} - -/* input: an XMLRPC_VALUE representing a fault struct in xml-rpc style. - * output: an XMLRPC_VALUE representing a fault struct in soap style, - * with xmlrpc codes mapped to soap codes, and all other values preserved. - * note that the returned value is a completely new value, and must be freed. - * the input value is untouched. - */ -static XMLRPC_VALUE gen_fault_xmlrpc(XMLRPC_VALUE node, xml_element* el_target) { - XMLRPC_VALUE xDup = XMLRPC_DupValueNew(node); - XMLRPC_VALUE xCode = XMLRPC_VectorGetValueWithID(xDup, TOKEN_XMLRPC_FAULTCODE); - XMLRPC_VALUE xStr = XMLRPC_VectorGetValueWithID(xDup, TOKEN_XMLRPC_FAULTSTRING); - - XMLRPC_SetValueID(xCode, TOKEN_SOAP_FAULTCODE, 0); - XMLRPC_SetValueID(xStr, TOKEN_SOAP_FAULTSTRING, 0); - - /* rough mapping of xmlrpc fault codes to soap codes */ - switch (XMLRPC_GetValueInt(xCode)) { - case -32700: /* "parse error. not well formed", */ - case -32701: /* "parse error. unsupported encoding" */ - case -32702: /* "parse error. invalid character for encoding" */ - case -32600: /* "server error. invalid xml-rpc. not conforming to spec." */ - case -32601: /* "server error. requested method not found" */ - case -32602: /* "server error. invalid method parameters" */ - XMLRPC_SetValueString(xCode, "SOAP-ENV:Client", 0); - break; - case -32603: /* "server error. internal xml-rpc error" */ - case -32500: /* "application error" */ - case -32400: /* "system error" */ - case -32300: /* "transport error */ - XMLRPC_SetValueString(xCode, "SOAP-ENV:Server", 0); - break; - } - return xDup; -} - -/* returns a new XMLRPC_VALUE representing a soap fault, comprised of a struct with four keys. */ -static XMLRPC_VALUE gen_soap_fault(const char* fault_code, const char* fault_string, - const char* actor, const char* details) { - XMLRPC_VALUE xReturn = XMLRPC_CreateVector(TOKEN_FAULT, xmlrpc_vector_struct); - XMLRPC_AddValuesToVector(xReturn, - XMLRPC_CreateValueString(TOKEN_SOAP_FAULTCODE, fault_code, 0), - XMLRPC_CreateValueString(TOKEN_SOAP_FAULTSTRING, fault_string, 0), - XMLRPC_CreateValueString(TOKEN_SOAP_FAULTACTOR, actor, 0), - XMLRPC_CreateValueString(TOKEN_SOAP_FAULTDETAILS, details, 0), - NULL); - return xReturn; -} - -/* translates xml soap dom to native data structures. recursive. */ -XMLRPC_VALUE xml_element_to_SOAP_REQUEST_worker(XMLRPC_REQUEST request, - XMLRPC_VALUE xParent, - struct array_info* parent_array, - XMLRPC_VALUE xCurrent, - xml_element* el, - int depth) { - XMLRPC_REQUEST_TYPE rtype = xmlrpc_request_none; - - /* no current element on first call */ - if (!xCurrent) { - xCurrent = XMLRPC_CreateValueEmpty(); - } - - /* increment recursion depth guage */ - depth ++; - - /* safety first. must have a valid element */ - if (el && el->name) { - const char* id = NULL; - const char* type = NULL, *arrayType=NULL, *actor = NULL; - xml_element_attr* attr_iter = Q_Head(&el->attrs); - int b_must_understand = 0; - - /* in soap, types may be specified in either element name -or- with xsi:type attribute. */ - if (is_soap_type(el->name)) { - type = el->name; - } - /* if our parent node, by definition a vector, is not an array, then - our element name must be our key identifier. */ - else if (XMLRPC_GetVectorType(xParent) != xmlrpc_vector_array) { - id = el->name; - if(!strcmp(id, "item")) { - } - } - - /* iterate through element attributes, pick out useful stuff. */ - while (attr_iter) { - /* element's type */ - if (!strcmp(attr_iter->key, TOKEN_TYPE)) { - type = attr_iter->val; - } - /* array type */ - else if (!strcmp(attr_iter->key, TOKEN_ARRAY_TYPE)) { - arrayType = attr_iter->val; - } - /* must understand, sometimes present in headers. */ - else if (!strcmp(attr_iter->key, TOKEN_MUSTUNDERSTAND)) { - b_must_understand = strchr(attr_iter->val, '1') ? 1 : 0; - } - /* actor, used in conjuction with must understand. */ - else if (!strcmp(attr_iter->key, TOKEN_ACTOR)) { - actor = attr_iter->val; - } - attr_iter = Q_Next(&el->attrs); - } - - /* check if caller says we must understand something in a header. */ - if (b_must_understand) { - /* is must understand actually indended for us? - BUG: spec says we should also determine if actor is our URL, but - we do not have that information. */ - if (!actor || !strcmp(actor, TOKEN_ACTOR_NEXT)) { - /* TODO: implement callbacks or other mechanism for applications - to "understand" these headers. For now, we just bail if we - get a mustUnderstand header intended for us. */ - XMLRPC_RequestSetError(request, - gen_soap_fault("SOAP-ENV:MustUnderstand", - "SOAP Must Understand Error", - "", "")); - return xCurrent; - } - } - - /* set id (key) if one was found. */ - if (id) { - XMLRPC_SetValueID_Case(xCurrent, id, 0, xmlrpc_case_exact); - } - - /* according to soap spec, - depth 1 = Envelope, 2 = Header, Body & Fault, 3 = methodcall or response. */ - if (depth == 3) { - const char* methodname = el->name; - char* p = NULL; - - /* BUG: we determine request or response type using presence of "Response" in element name. - According to spec, this is only recommended, not required. Apparently, implementations - are supposed to know the type of action based on state, which strikes me as a bit lame. - Anyway, we don't have that state info, thus we use Response as a heuristic. */ - rtype = -#ifdef strcasestr - strcasestr(el->name, "response") ? xmlrpc_request_response : xmlrpc_request_call; -#else - strstr(el->name, "esponse") ? xmlrpc_request_response : xmlrpc_request_call; -#endif - XMLRPC_RequestSetRequestType(request, rtype); - - /* Get methodname. strip xml namespace crap. */ - p = strchr(el->name, ':'); - if (p) { - methodname = p + 1; - } - if (rtype == xmlrpc_request_call) { - XMLRPC_RequestSetMethodName(request, methodname); - } - } - - - /* Next, we begin to convert actual values. if no children, then must be a scalar value. */ - if (!Q_Size(&el->children)) { - if (!type && parent_array && parent_array->kids_type[0]) { - type = parent_array->kids_type; - } - if (!type || !strcmp(type, TOKEN_STRING)) { - XMLRPC_SetValueString(xCurrent, el->text.str, el->text.len); - } - else if (!strcmp(type, TOKEN_INT)) { - XMLRPC_SetValueInt(xCurrent, atoi(el->text.str)); - } - else if (!strcmp(type, TOKEN_BOOLEAN)) { - XMLRPC_SetValueBoolean(xCurrent, atoi(el->text.str)); - } - else if (!strcmp(type, TOKEN_DOUBLE) || - !strcmp(type, TOKEN_FLOAT)) { - XMLRPC_SetValueDouble(xCurrent, atof(el->text.str)); - } - else if (!strcmp(type, TOKEN_NULL)) { - /* already an empty val. do nothing. */ - } - else if (!strcmp(type, TOKEN_DATETIME)) { - XMLRPC_SetValueDateTime_ISO8601(xCurrent, el->text.str); - } - else if (!strcmp(type, TOKEN_BASE64)) { - struct buffer_st buf; - base64_decode_xmlrpc(&buf, el->text.str, el->text.len); - XMLRPC_SetValueBase64(xCurrent, buf.data, buf.offset); - buffer_delete(&buf); - } - } - /* Element has children, thus a vector, or "compound type" in soap-speak. */ - else { - struct array_info* ai = NULL; - xml_element* iter = (xml_element*)Q_Head(&el->children); - - if (!type || !strcmp(type, TOKEN_STRUCT)) { - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_struct); - } - else if (!strcmp(type, TOKEN_ARRAY) || arrayType != NULL) { - /* determine magic associated with soap array type. - this is passed down as we recurse, so our children have access to the info. */ - ai = parse_array_type_info(arrayType); // alloc'ed ai free'd below. - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_array); - } - else { - /* mixed is probably closest thing we have to compound type. */ - XMLRPC_SetIsVector(xCurrent, xmlrpc_vector_mixed); - } - /* Recurse, adding values as we go. Check for error during recursion - and if found, bail. this short-circuits us out of the recursion. */ - while ( iter && !XMLRPC_RequestGetError(request) ) { - XMLRPC_VALUE xNext = NULL; - /* top level elements don't actually represent values, so we just pass the - current value along until we are deep enough. */ - if ( depth <= 2 || - (rtype == xmlrpc_request_response && depth <= 3) ) { - xml_element_to_SOAP_REQUEST_worker(request, NULL, ai, xCurrent, iter, depth); - } - /* ready to do some actual de-serialization. create a new empty value and - pass that along to be init'd, then add it to our current vector. */ - else { - xNext = XMLRPC_CreateValueEmpty(); - xml_element_to_SOAP_REQUEST_worker(request, xCurrent, ai, xNext, iter, depth); - XMLRPC_AddValueToVector(xCurrent, xNext); - } - iter = (xml_element*)Q_Next(&el->children); - } - /* cleanup */ - if (ai) { - free(ai); - } - } - } - return xCurrent; -} - -/* Convert soap xml dom to XMLRPC_VALUE, sans request info. untested. */ -XMLRPC_VALUE xml_element_to_SOAP_VALUE(xml_element* el) -{ - return xml_element_to_SOAP_REQUEST_worker(NULL, NULL, NULL, NULL, el, 0); -} - -/* Convert soap xml dom to XMLRPC_REQUEST */ -XMLRPC_VALUE xml_element_to_SOAP_REQUEST(XMLRPC_REQUEST request, xml_element* el) -{ - if (request) { - return XMLRPC_RequestSetData(request, xml_element_to_SOAP_REQUEST_worker(request, NULL, NULL, NULL, el, 0)); - } - return NULL; -} - - -/* translates data structures to soap/xml. recursive */ -xml_element* SOAP_to_xml_element_worker(XMLRPC_REQUEST request, XMLRPC_VALUE node) { -#define BUF_SIZE 128 - xml_element* elem_val = NULL; - if (node) { - int bFreeNode = 0; /* sometimes we may need to free 'node' variable */ - char buf[BUF_SIZE]; - XMLRPC_VALUE_TYPE_EASY type = XMLRPC_GetValueTypeEasy(node); - char* pName = NULL, *pAttrType = NULL; - - /* create our return value element */ - elem_val = xml_elem_new(); - - switch (type) { - case xmlrpc_type_struct: - case xmlrpc_type_mixed: - case xmlrpc_type_array: - if (type == xmlrpc_type_array) { - /* array's are _very_ special in soap. - TODO: Should handle sparse/partial arrays here. */ - - /* determine soap array type. */ - const char* type = get_array_soap_type(node); - xml_element_attr* attr_array_type = NULL; - - /* specify array kids type and array size. */ - snprintf(buf, sizeof(buf), "%s[%i]", type, XMLRPC_VectorSize(node)); - attr_array_type = new_attr(TOKEN_ARRAY_TYPE, buf); - - Q_PushTail(&elem_val->attrs, attr_array_type); - - pAttrType = TOKEN_ARRAY; - } - /* check for fault, which is a rather special case. - (can't these people design anything consistent/simple/elegant?) */ - else if (type == xmlrpc_type_struct) { - int fault_type = get_fault_type(node); - if (fault_type) { - if (fault_type == 1) { - /* gen fault from xmlrpc style fault codes - notice that we get a new node, which must be freed herein. */ - node = gen_fault_xmlrpc(node, elem_val); - bFreeNode = 1; - } - pName = TOKEN_FAULT; - } - } - - { - /* recurse through sub-elements */ - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(node); - while ( xIter ) { - xml_element* next_el = SOAP_to_xml_element_worker(request, xIter); - if (next_el) { - Q_PushTail(&elem_val->children, next_el); - } - xIter = XMLRPC_VectorNext(node); - } - } - - break; - - /* handle scalar types */ - case xmlrpc_type_empty: - pAttrType = TOKEN_NULL; - break; - case xmlrpc_type_string: - pAttrType = TOKEN_STRING; - simplestring_addn(&elem_val->text, XMLRPC_GetValueString(node), XMLRPC_GetValueStringLen(node)); - break; - case xmlrpc_type_int: - pAttrType = TOKEN_INT; - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueInt(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_type_boolean: - pAttrType = TOKEN_BOOLEAN; - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueBoolean(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_type_double: - pAttrType = TOKEN_DOUBLE; - snprintf(buf, BUF_SIZE, "%f", XMLRPC_GetValueDouble(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_type_datetime: - { - time_t tt = XMLRPC_GetValueDateTime(node); - struct tm *tm = localtime (&tt); - pAttrType = TOKEN_DATETIME; - if(strftime (buf, BUF_SIZE, "%Y-%m-%dT%H:%M:%SZ", tm)) { - simplestring_add(&elem_val->text, buf); - } - } - break; - case xmlrpc_type_base64: - { - struct buffer_st buf; - pAttrType = TOKEN_BASE64; - base64_encode_xmlrpc(&buf, XMLRPC_GetValueBase64(node), XMLRPC_GetValueStringLen(node)); - simplestring_addn(&elem_val->text, buf.data, buf.offset ); - buffer_delete(&buf); - } - break; - break; - default: - break; - } - - /* determining element's name is a bit tricky, due to soap semantics. */ - if (!pName) { - /* if the value's type is known... */ - if (pAttrType) { - /* see if it has an id (key). If so, use that as name, and type as an attribute. */ - pName = (char*)XMLRPC_GetValueID(node); - if (pName) { - Q_PushTail(&elem_val->attrs, new_attr(TOKEN_TYPE, pAttrType)); - } - - /* otherwise, use the type as the name. */ - else { - pName = pAttrType; - } - } - /* if the value's type is not known... (a rare case?) */ - else { - /* see if it has an id (key). otherwise, default to generic "item" */ - pName = (char*)XMLRPC_GetValueID(node); - if (!pName) { - pName = "item"; - } - } - } - elem_val->name = strdup(pName); - - /* cleanup */ - if (bFreeNode) { - XMLRPC_CleanupValue(node); - } - } - return elem_val; -} - -/* convert XMLRPC_VALUE to soap xml dom. untested. */ -xml_element* SOAP_VALUE_to_xml_element(XMLRPC_VALUE node) { - return SOAP_to_xml_element_worker(NULL, node); -} - -/* convert XMLRPC_REQUEST to soap xml dom. */ -xml_element* SOAP_REQUEST_to_xml_element(XMLRPC_REQUEST request) { - xml_element* root = xml_elem_new(); - - /* safety first. */ - if (root) { - xml_element* body = xml_elem_new(); - root->name = strdup("SOAP-ENV:Envelope"); - - /* silly namespace stuff */ - Q_PushTail(&root->attrs, new_attr("xmlns:SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/")); - Q_PushTail(&root->attrs, new_attr("xmlns:xsi", "http://www.w3.org/1999/XMLSchema-instance")); - Q_PushTail(&root->attrs, new_attr("xmlns:xsd", "http://www.w3.org/1999/XMLSchema")); - Q_PushTail(&root->attrs, new_attr("xmlns:SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/")); - Q_PushTail(&root->attrs, new_attr("xmlns:si", "http://soapinterop.org/xsd")); - Q_PushTail(&root->attrs, new_attr("xmlns:ns6", "http://testuri.org")); - Q_PushTail(&root->attrs, new_attr("SOAP-ENV:encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/")); - - /* Q_PushHead(&root->attrs, new_attr("xmlns:ks", "http://kitchen.sink.org/soap/everything/under/sun")); - JUST KIDDING!! :-) ----> ------------------------------------------------- */ - - if (body) { - /* go ahead and serialize first... */ - xml_element* el_serialized = - SOAP_to_xml_element_worker(request, - XMLRPC_RequestGetData(request)); - - /* check for fault, in which case, there is no intermediate element */ - if (el_serialized && !strcmp(el_serialized->name, TOKEN_FAULT)) { - Q_PushTail(&body->children, el_serialized); - } - /* usual case: not a fault. Add Response element in between. */ - else { - xml_element* rpc = xml_elem_new(); - - if (rpc) { - const char* methodname = XMLRPC_RequestGetMethodName(request); - XMLRPC_REQUEST_TYPE rtype = XMLRPC_RequestGetRequestType(request); - - /* if we are making a request, we want to use the methodname as is. */ - if (rtype == xmlrpc_request_call) { - if (methodname) { - rpc->name = strdup(methodname); - } - } - /* if it's a response, we append "Response". Also, given xmlrpc-epi - API/architecture, it's likely that we don't have a methodname for - the response, so we have to check that. */ - else { - char buf[128]; - snprintf(buf, sizeof(buf), "%s%s", - methodname ? methodname : "", - "Response"); - - rpc->name = strdup(buf); - } - - /* add serialized data to method call/response. - add method call/response to body element */ - if (rpc->name) { - if(el_serialized) { - if(Q_Size(&el_serialized->children) && rtype == xmlrpc_request_call) { - xml_element* iter = (xml_element*)Q_Head(&el_serialized->children); - while(iter) { - Q_PushTail(&rpc->children, iter); - iter = (xml_element*)Q_Next(&el_serialized->children); - } - xml_elem_free_non_recurse(el_serialized); - } - else { - Q_PushTail(&rpc->children, el_serialized); - } - } - - Q_PushTail(&body->children, rpc); - } - else { - /* no method name?! - TODO: fault here...? */ - } - } - } - body->name = strdup("SOAP-ENV:Body"); - Q_PushTail(&root->children, body); - } - } - - return root; -} - diff --git a/ext/xmlrpc/libxmlrpc/xml_to_soap.h b/ext/xmlrpc/libxmlrpc/xml_to_soap.h deleted file mode 100644 index 9ae9308b225bb..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_soap.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -#ifndef XML_TO_SOAP_H - #define XML_TO_SOAP_H - -#include "xmlrpc.h" - -XMLRPC_VALUE xml_element_to_SOAP_VALUE(xml_element* el); -XMLRPC_VALUE xml_element_to_SOAP_REQUEST(XMLRPC_REQUEST request, xml_element* el); -xml_element* SOAP_VALUE_to_xml_element(XMLRPC_VALUE node); -xml_element* SOAP_REQUEST_to_xml_element(XMLRPC_REQUEST request); - -#endif /* XML_TO_XMLRPC_H */ diff --git a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c b/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c deleted file mode 100644 index 13976077be6d1..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c +++ /dev/null @@ -1,414 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -static const char rcsid[] = "#(@) $Id$"; - -#include "php.h" -#include "main/snprintf.h" -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include "xml_to_xmlrpc.h" -#include "base64.h" - -/* list of tokens used in vocab */ -#define ELEM_ARRAY "array" -#define ELEM_BASE64 "base64" -#define ELEM_BOOLEAN "boolean" -#define ELEM_DATA "data" -#define ELEM_DATETIME "dateTime.iso8601" -#define ELEM_DOUBLE "double" -#define ELEM_FAULT "fault" -#define ELEM_FAULTCODE "faultCode" -#define ELEM_FAULTSTRING "faultString" -#define ELEM_I4 "i4" -#define ELEM_INT "int" -#define ELEM_MEMBER "member" -#define ELEM_METHODCALL "methodCall" -#define ELEM_METHODNAME "methodName" -#define ELEM_METHODRESPONSE "methodResponse" -#define ELEM_NAME "name" -#define ELEM_PARAM "param" -#define ELEM_PARAMS "params" -#define ELEM_STRING "string" -#define ELEM_STRUCT "struct" -#define ELEM_VALUE "value" - - -XMLRPC_VALUE xml_element_to_XMLRPC_REQUEST_worker(XMLRPC_REQUEST request, XMLRPC_VALUE parent_vector, XMLRPC_VALUE current_val, xml_element* el) { - if (!current_val) { - /* This should only be the case for the first element */ - current_val = XMLRPC_CreateValueEmpty(); - } - - if (el->name) { - - /* first, deal with the crazy/stupid fault format */ - if (!strcmp(el->name, ELEM_FAULT)) { - xml_element* fault_value = (xml_element*)Q_Head(&el->children); - XMLRPC_SetIsVector(current_val, xmlrpc_vector_struct); - - if(fault_value) { - xml_element* fault_struct = (xml_element*)Q_Head(&fault_value->children); - if(fault_struct) { - xml_element* iter = (xml_element*)Q_Head(&fault_struct->children); - - while (iter) { - XMLRPC_VALUE xNextVal = XMLRPC_CreateValueEmpty(); - xml_element_to_XMLRPC_REQUEST_worker(request, current_val, xNextVal, iter); - XMLRPC_AddValueToVector(current_val, xNextVal); - iter = (xml_element*)Q_Next(&fault_struct->children); - } - } - } - } - else if (!strcmp(el->name, ELEM_DATA) /* should be ELEM_ARRAY, but there is an extra level. weird */ - || (!strcmp(el->name, ELEM_PARAMS) && - (XMLRPC_RequestGetRequestType(request) == xmlrpc_request_call)) ) { /* this "PARAMS" concept is silly. dave?! */ - xml_element* iter = (xml_element*)Q_Head(&el->children); - XMLRPC_SetIsVector(current_val, xmlrpc_vector_array); - - while (iter) { - XMLRPC_VALUE xNextVal = XMLRPC_CreateValueEmpty(); - xml_element_to_XMLRPC_REQUEST_worker(request, current_val, xNextVal, iter); - XMLRPC_AddValueToVector(current_val, xNextVal); - iter = (xml_element*)Q_Next(&el->children); - } - } - else if (!strcmp(el->name, ELEM_STRUCT)) { - xml_element* iter = (xml_element*)Q_Head(&el->children); - XMLRPC_SetIsVector(current_val, xmlrpc_vector_struct); - - while ( iter ) { - XMLRPC_VALUE xNextVal = XMLRPC_CreateValueEmpty(); - xml_element_to_XMLRPC_REQUEST_worker(request, current_val, xNextVal, iter); - XMLRPC_AddValueToVector(current_val, xNextVal); - iter = (xml_element*)Q_Next(&el->children); - } - } - else if (!strcmp(el->name, ELEM_STRING) || - (!strcmp(el->name, ELEM_VALUE) && Q_Size(&el->children) == 0)) { - XMLRPC_SetValueString(current_val, el->text.str, el->text.len); - } - else if (!strcmp(el->name, ELEM_NAME)) { - XMLRPC_SetValueID_Case(current_val, el->text.str, 0, xmlrpc_case_exact); - } - else if (!strcmp(el->name, ELEM_INT) || !strcmp(el->name, ELEM_I4)) { - XMLRPC_SetValueInt(current_val, atoi(el->text.str)); - } - else if (!strcmp(el->name, ELEM_BOOLEAN)) { - XMLRPC_SetValueBoolean(current_val, atoi(el->text.str)); - } - else if (!strcmp(el->name, ELEM_DOUBLE)) { - XMLRPC_SetValueDouble(current_val, atof(el->text.str)); - } - else if (!strcmp(el->name, ELEM_DATETIME)) { - XMLRPC_SetValueDateTime_ISO8601(current_val, el->text.str); - } - else if (!strcmp(el->name, ELEM_BASE64)) { - struct buffer_st buf; - base64_decode_xmlrpc(&buf, el->text.str, el->text.len); - XMLRPC_SetValueBase64(current_val, buf.data, buf.offset); - buffer_delete(&buf); - } - else { - xml_element* iter; - - if (!strcmp(el->name, ELEM_METHODCALL)) { - if (request) { - XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); - } - } - else if (!strcmp(el->name, ELEM_METHODRESPONSE)) { - if (request) { - XMLRPC_RequestSetRequestType(request, xmlrpc_request_response); - } - } - else if (!strcmp(el->name, ELEM_METHODNAME)) { - if (request) { - XMLRPC_RequestSetMethodName(request, el->text.str); - } - } - - iter = (xml_element*)Q_Head(&el->children); - while ( iter ) { - xml_element_to_XMLRPC_REQUEST_worker(request, parent_vector, - current_val, iter); - iter = (xml_element*)Q_Next(&el->children); - } - } - } - return current_val; -} - -XMLRPC_VALUE xml_element_to_XMLRPC_VALUE(xml_element* el) -{ - return xml_element_to_XMLRPC_REQUEST_worker(NULL, NULL, NULL, el); -} - -XMLRPC_VALUE xml_element_to_XMLRPC_REQUEST(XMLRPC_REQUEST request, xml_element* el) -{ - if (request) { - return XMLRPC_RequestSetData(request, xml_element_to_XMLRPC_REQUEST_worker(request, NULL, NULL, el)); - } - return NULL; -} - -xml_element* XMLRPC_to_xml_element_worker(XMLRPC_VALUE current_vector, XMLRPC_VALUE node, - XMLRPC_REQUEST_TYPE request_type, int depth) { -#define BUF_SIZE 512 - xml_element* root = NULL; - if (node) { - char buf[BUF_SIZE]; - XMLRPC_VALUE_TYPE type = XMLRPC_GetValueType(node); - XMLRPC_VECTOR_TYPE vtype = XMLRPC_GetVectorType(node); - xml_element* elem_val = xml_elem_new(); - - /* special case for when root element is not an array */ - if (depth == 0 && - !(type == xmlrpc_vector && - vtype == xmlrpc_vector_array && - request_type == xmlrpc_request_call) ) { - int bIsFault = (vtype == xmlrpc_vector_struct && XMLRPC_VectorGetValueWithID(node, ELEM_FAULTCODE)); - - xml_element* next_el = XMLRPC_to_xml_element_worker(NULL, node, request_type, depth + 1); - if (next_el) { - Q_PushTail(&elem_val->children, next_el); - } - elem_val->name = strdup(bIsFault ? ELEM_FAULT : ELEM_PARAMS); - } - else { - switch (type) { - case xmlrpc_empty: /* treat null value as empty string in xmlrpc. */ - case xmlrpc_string: - elem_val->name = strdup(ELEM_STRING); - simplestring_addn(&elem_val->text, XMLRPC_GetValueString(node), XMLRPC_GetValueStringLen(node)); - break; - case xmlrpc_int: - elem_val->name = strdup(ELEM_INT); - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueInt(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_boolean: - elem_val->name = strdup(ELEM_BOOLEAN); - snprintf(buf, BUF_SIZE, "%i", XMLRPC_GetValueBoolean(node)); - simplestring_add(&elem_val->text, buf); - break; - case xmlrpc_double: - { - TSRMLS_FETCH(); - elem_val->name = strdup(ELEM_DOUBLE); - ap_php_snprintf(buf, BUF_SIZE, "%.*G", (int) EG(precision), XMLRPC_GetValueDouble(node)); - simplestring_add(&elem_val->text, buf); - } - break; - case xmlrpc_datetime: - elem_val->name = strdup(ELEM_DATETIME); - simplestring_add(&elem_val->text, XMLRPC_GetValueDateTime_ISO8601(node)); - break; - case xmlrpc_base64: - { - struct buffer_st buf; - elem_val->name = strdup(ELEM_BASE64); - base64_encode_xmlrpc(&buf, XMLRPC_GetValueBase64(node), XMLRPC_GetValueStringLen(node)); - simplestring_addn(&elem_val->text, buf.data, buf.offset ); - buffer_delete(&buf); - } - break; - case xmlrpc_vector: - { - XMLRPC_VECTOR_TYPE my_type = XMLRPC_GetVectorType(node); - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(node); - xml_element* root_vector_elem = elem_val; - - switch (my_type) { - case xmlrpc_vector_array: - { - if(depth == 0) { - elem_val->name = strdup(ELEM_PARAMS); - } - else { - /* Hi my name is Dave and I like to make things as confusing - * as possible, thus I will throw in this 'data' element - * where it absolutely does not belong just so that people - * cannot code arrays and structs in a similar and straight - * forward manner. Have a good day. - * - * GRRRRRRRRR! - */ - xml_element* data = xml_elem_new(); - data->name = strdup(ELEM_DATA); - - elem_val->name = strdup(ELEM_ARRAY); - Q_PushTail(&elem_val->children, data); - root_vector_elem = data; - } - } - break; - case xmlrpc_vector_mixed: /* not officially supported */ - case xmlrpc_vector_struct: - elem_val->name = strdup(ELEM_STRUCT); - break; - default: - break; - } - - /* recurse through sub-elements */ - while ( xIter ) { - xml_element* next_el = XMLRPC_to_xml_element_worker(node, xIter, request_type, depth + 1); - if (next_el) { - Q_PushTail(&root_vector_elem->children, next_el); - } - xIter = XMLRPC_VectorNext(node); - } - } - break; - default: - break; - } - } - - { - XMLRPC_VECTOR_TYPE vtype = XMLRPC_GetVectorType(current_vector); - - if (depth == 1) { - xml_element* value = xml_elem_new(); - value->name = strdup(ELEM_VALUE); - - /* yet another hack for the "fault" crap */ - if (XMLRPC_VectorGetValueWithID(node, ELEM_FAULTCODE)) { - root = value; - } - else { - xml_element* param = xml_elem_new(); - param->name = strdup(ELEM_PARAM); - - Q_PushTail(¶m->children, value); - - root = param; - } - Q_PushTail(&value->children, elem_val); - } - else if (vtype == xmlrpc_vector_struct || vtype == xmlrpc_vector_mixed) { - xml_element* member = xml_elem_new(); - xml_element* name = xml_elem_new(); - xml_element* value = xml_elem_new(); - - member->name = strdup(ELEM_MEMBER); - name->name = strdup(ELEM_NAME); - value->name = strdup(ELEM_VALUE); - - simplestring_add(&name->text, XMLRPC_GetValueID(node)); - - Q_PushTail(&member->children, name); - Q_PushTail(&member->children, value); - Q_PushTail(&value->children, elem_val); - - root = member; - } - else if (vtype == xmlrpc_vector_array) { - xml_element* value = xml_elem_new(); - - value->name = strdup(ELEM_VALUE); - - Q_PushTail(&value->children, elem_val); - - root = value; - } - else if (vtype == xmlrpc_vector_none) { - /* no parent. non-op */ - root = elem_val; - } - else { - xml_element* value = xml_elem_new(); - - value->name = strdup(ELEM_VALUE); - - Q_PushTail(&value->children, elem_val); - - root = value; - } - } - } - return root; -} - -xml_element* XMLRPC_VALUE_to_xml_element(XMLRPC_VALUE node) { - return XMLRPC_to_xml_element_worker(NULL, node, xmlrpc_request_none, 0); -} - -xml_element* XMLRPC_REQUEST_to_xml_element(XMLRPC_REQUEST request) { - xml_element* wrapper = NULL; - if (request) { - const char* pStr = NULL; - XMLRPC_REQUEST_TYPE request_type = XMLRPC_RequestGetRequestType(request); - XMLRPC_VALUE xParams = XMLRPC_RequestGetData(request); - - wrapper = xml_elem_new(); - - if (request_type == xmlrpc_request_call) { - pStr = ELEM_METHODCALL; - } - else if (request_type == xmlrpc_request_response) { - pStr = ELEM_METHODRESPONSE; - } - if (pStr) { - wrapper->name = strdup(pStr); - } - - if(request_type == xmlrpc_request_call) { - pStr = XMLRPC_RequestGetMethodName(request); - - if (pStr) { - xml_element* method = xml_elem_new(); - method->name = strdup(ELEM_METHODNAME); - simplestring_add(&method->text, pStr); - Q_PushTail(&wrapper->children, method); - } - } - if (xParams) { - Q_PushTail(&wrapper->children, - XMLRPC_to_xml_element_worker(NULL, XMLRPC_RequestGetData(request), XMLRPC_RequestGetRequestType(request), 0)); - } - else { - /* Despite the spec, the xml-rpc list folk want me to send an empty params element */ - xml_element* params = xml_elem_new(); - params->name = strdup(ELEM_PARAMS); - Q_PushTail(&wrapper->children, params); - } - } - return wrapper; -} - diff --git a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.h b/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.h deleted file mode 100644 index 234a153460db2..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -#ifndef XML_TO_XMLRPC_H - #define XML_TO_XMLRPC_H - -#include "time.h" -#include "xmlrpc.h" - -XMLRPC_VALUE xml_element_to_XMLRPC_VALUE(xml_element* el); -XMLRPC_VALUE xml_element_to_XMLRPC_REQUEST(XMLRPC_REQUEST request, xml_element* el); -xml_element* XMLRPC_VALUE_to_xml_element(XMLRPC_VALUE node); -xml_element* XMLRPC_REQUEST_to_xml_element(XMLRPC_REQUEST request); - -#endif /* XML_TO_XMLRPC_H */ diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c deleted file mode 100644 index 9852b88632fba..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.c +++ /dev/null @@ -1,3006 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -static const char rcsid[] = "#(@) $Id$"; - - -/****h* ABOUT/xmlrpc - * NAME - * XMLRPC_VALUE - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * CREATION DATE - * 9/1999 - 10/2000 - * HISTORY - * $Log$ - * Revision 1.8.4.4 2008/09/10 00:09:04 felipe - * MFH: - * - Merged fix from SF project (Import Jeff Lawsons patches for XML datetime bug fixes) - * Fixed bugs: - * #45226 (xmlrpc_set_type() segfaults with valid ISO8601 date string) - * #18916 (xmlrpc_set_type() "not working") - * - * Revision 1.8.4.3 2007/09/18 19:49:53 iliaa - * - * Fixed bug #42189 (xmlrpc_set_type() crashes php on invalid datetime - * values). - * - * Revision 1.8.4.2 2007/06/07 09:07:36 tony2001 - * MFH: php_localtime_r() checks - * - * Revision 1.8.4.1 2006/11/30 16:38:37 iliaa - * last set of zts fixes - * - * Revision 1.8 2005/03/28 00:07:24 edink - * Reshufle includes to make it compile on windows - * - * Revision 1.7 2005/03/26 03:13:58 sniper - * - Made it possible to build ext/xmlrpc with libxml2 - * - * Revision 1.6 2004/04/27 17:33:59 iliaa - * Removed C++ style comments. - * - * Revision 1.5 2003/12/16 21:00:21 sniper - * Fix some compile warnings (patch by Joe Orton) - * - * Revision 1.4 2002/07/05 04:43:53 danda - * merged in updates from SF project. bring php repository up to date with xmlrpc-epi version 0.51 - * - * Revision 1.22 2002/03/09 23:15:44 danda - * add fault interrogation funcs - * - * Revision 1.21 2002/03/09 22:27:41 danda - * win32 build patches contributed by Jeff Lawson - * - * Revision 1.20 2002/02/13 20:58:50 danda - * patch to make source more windows friendly, contributed by Jeff Lawson - * - * Revision 1.19 2001/10/12 23:25:54 danda - * default to writing xmlrpc - * - * Revision 1.18 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 10/15/2000 -- danda -- adding robodoc documentation - * 08/2000 -- danda -- PHP C extension that uses XMLRPC - * 08/2000 -- danda -- support for two vocabularies: danda-rpc and xml-rpc - * 09/1999 -- danda -- Initial API, before I even knew of standard XMLRPC vocab. Response only. - * 07/2000 -- danda -- wrote new implementation to be compatible with xmlrpc standard and - * incorporated some ideas from ensor, most notably the separation of - * xml dom from xmlrpc api. - * 06/2000 -- danda -- played with expat-ensor from www.ensor.org. Cool, but some flaws. - * TODO - * PORTABILITY - * Coded on RedHat Linux 6.2. Builds on Solaris x86. Should build on just - * about anything with minor mods. - * NOTES - * Welcome to XMLRPC. For more info on the specification and history, see - * http://www.xmlrpc.org. - * - * This code aims to be a full-featured C implementation of XMLRPC. It does not - * have any networking code. Rather, it is intended to be plugged into apps - * or libraries with existing networking facilities, eg PHP, apache, perl, mozilla, - * home-brew application servers, etc. - * - * Usage Paradigm: - * The user of this library will typically be implementing either an XMLRPC server, - * an XMLRPC client, or both. The client will use the library to build an in-memory - * representation of a request, and then serialize (encode) that request into XML. The - * client will then send the XML to the server via external mechanism. The server will - * de-serialize the XML back into an binary representation, call the appropriate registered - * method -- thereby generating a response. The response will be serialized into XML and - * sent back to the client. The client will de-serialize it into memory, and can - * iterate through the results via API. - * - * Both the request and the response may consist of arbitrarily long, arbitrarily nested - * values. The values may be one of several types, as defined by XMLRPC_VALUE_TYPE. - * - * Features and Architecture: - * - The XML parsing (xml_element.c) is completely independent of the XMLRPC api. In fact, - * it can be used as a standalone dom implementation. - * - Because of this, the same XMLRPC data can be serialized into multiple xml vocabularies. - * It is simply a matter of writing a transport. So far, two transports have been defined. - * The default xmlrpc vocab (xml_to_xmlrpc.c), and simple-rpc (xml_to_dandarpc.c) which is - * proprietary, but imho more readable, and nice for proprietary legacy reasons. - * - Various output options, including: xml escaping via CDATA or entity, case folding, - * vocab version, and character encoding. - * - One to One mapping between C structures and actual values, unlike ensor which forces - * one to understand the arcana of the xmlrpc vocab. - * - support for mixed indexed/keyed vector types, making it more compatible with - * languages such as PHP. - * - quite speedy compared to implementations written in interpreted languages. Also, uses - * intelligent string handling, so not many strlen() calls, etc. - * - comprehensive API for manipulation of values - *******/ - -#include "ext/xml/expat_compat.h" -#include "main/php_reentrancy.h" -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include -#include -#include -#include -#include -#include - -#include "queue.h" -#include "xmlrpc.h" -#include "base64.h" - -#include "xml_to_xmlrpc.h" -#include "xml_to_dandarpc.h" -#include "xml_to_soap.h" -#include "xml_element.h" -#include "xmlrpc_private.h" -#include "xmlrpc_introspection_private.h" -#include "system_methods_private.h" - - - -/*-********************* -* Begin Time Functions * -***********************/ - -static time_t mkgmtime(struct tm *tm) -{ - static const int mdays[12] = {0,31,59,90,120,151,181,212,243,273,304,334}; - - return ((((((tm->tm_year - 70) * 365) + mdays[tm->tm_mon] + tm->tm_mday-1 + - (tm->tm_year-68-1+(tm->tm_mon>=2))/4) * 24) + tm->tm_hour) * 60 + - tm->tm_min) * 60 + tm->tm_sec; -} - -static int date_from_ISO8601 (const char *text, time_t * value) { - struct tm tm; - int n; - int i; - char buf[30]; - - - if (strchr (text, '-')) { - char *p = (char *) text, *p2 = buf; - while (p && *p) { - if (*p != '-') { - *p2 = *p; - p2++; - if (p2-buf >= sizeof(buf)) { - return -1; - } - } - p++; - } - text = buf; - } - - - tm.tm_isdst = -1; - -#define XMLRPC_IS_NUMBER(x) if (x < '0' || x > '9') return -1; - - n = 1000; - tm.tm_year = 0; - for(i = 0; i < 4; i++) { - XMLRPC_IS_NUMBER(text[i]) - tm.tm_year += (text[i]-'0')*n; - n /= 10; - } - n = 10; - tm.tm_mon = 0; - for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) - tm.tm_mon += (text[i+4]-'0')*n; - n /= 10; - } - tm.tm_mon --; - - n = 10; - tm.tm_mday = 0; - for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) - tm.tm_mday += (text[i+6]-'0')*n; - n /= 10; - } - - n = 10; - tm.tm_hour = 0; - for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) - tm.tm_hour += (text[i+9]-'0')*n; - n /= 10; - } - - n = 10; - tm.tm_min = 0; - for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) - tm.tm_min += (text[i+12]-'0')*n; - n /= 10; - } - - n = 10; - tm.tm_sec = 0; - for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) - tm.tm_sec += (text[i+15]-'0')*n; - n /= 10; - } - - tm.tm_year -= 1900; - - *value = mkgmtime(&tm); - - return 0; - -} - -static int date_to_ISO8601 (time_t value, char *buf, int length) { - struct tm *tm, tmbuf; - tm = php_gmtime_r(&value, &tmbuf); - if (!tm) { - return 0; - } -#if 0 /* TODO: soap seems to favor this method. xmlrpc the latter. */ - return strftime (buf, length, "%Y-%m-%dT%H:%M:%SZ", tm); -#else - return strftime(buf, length, "%Y%m%dT%H:%M:%SZ", tm); -#endif -} - -/*-******************* -* End Time Functions * -*********************/ - - -/*-*************************** -* Begin XMLRPC_REQUEST funcs * -*****************************/ - -/****f* REQUEST/XMLRPC_RequestNew - * NAME - * XMLRPC_RequestNew - * SYNOPSIS - * XMLRPC_REQUEST XMLRPC_RequestNew() - * FUNCTION - * Creates a new XMLRPC_Request data struct - * INPUTS - * none - * SEE ALSO - * XMLRPC_RequestFree () - * SOURCE - */ -XMLRPC_REQUEST XMLRPC_RequestNew() { - XMLRPC_REQUEST xRequest = calloc(1, sizeof(STRUCT_XMLRPC_REQUEST)); - if(xRequest) { - simplestring_init(&xRequest->methodName); - } - return xRequest; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestFree - * NAME - * XMLRPC_RequestFree - * SYNOPSIS - * void XMLRPC_RequestFree(XMLRPC_REQUEST request, int bFreeIO) - * FUNCTION - * Free XMLRPC Request and all sub-values - * INPUTS - * request -- previously allocated request struct - * bFreeIO -- 1 = also free request value data, if any, 0 = ignore. - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_CleanupValue () - * SOURCE - */ -void XMLRPC_RequestFree(XMLRPC_REQUEST request, int bFreeIO) { - if(request) { - simplestring_free(&request->methodName); - - if(request->io && bFreeIO) { - XMLRPC_CleanupValue(request->io); - } - if(request->error) { - XMLRPC_CleanupValue(request->error); - } - my_free(request); - } -} - -/*******/ - -/* Set Method Name to call */ -/****f* REQUEST/XMLRPC_RequestSetMethodName - * NAME - * XMLRPC_RequestSetMethodName - * SYNOPSIS - * const char* XMLRPC_RequestSetMethodName(XMLRPC_REQUEST request, const char* methodName) - * FUNCTION - * Set name of method to call with this request. - * INPUTS - * request -- previously allocated request struct - * methodName -- name of method - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestGetMethodName () - * XMLRPC_RequestFree () - * SOURCE - */ -const char* XMLRPC_RequestSetMethodName(XMLRPC_REQUEST request, const char* methodName) { - if(request) { - simplestring_clear(&request->methodName); - simplestring_add(&request->methodName, methodName); - return request->methodName.str; - } - return NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestGetMethodName - * NAME - * XMLRPC_RequestGetMethodName - * SYNOPSIS - * const char* XMLRPC_RequestGetMethodName(XMLRPC_REQUEST request) - * FUNCTION - * Get name of method called by this request - * INPUTS - * request -- previously allocated request struct - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestSetMethodName () - * XMLRPC_RequestFree () - * SOURCE - */ -const char* XMLRPC_RequestGetMethodName(XMLRPC_REQUEST request) { - return request ? request->methodName.str : NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestSetRequestType - * NAME - * XMLRPC_RequestSetRequestType - * SYNOPSIS - * XMLRPC_REQUEST_TYPE XMLRPC_RequestSetRequestType(XMLRPC_REQUEST request, XMLRPC_REQUEST_TYPE type) - * FUNCTION - * A request struct may be allocated by a caller or by xmlrpc - * in response to a request. This allows setting the - * request type. - * INPUTS - * request -- previously allocated request struct - * type -- request type [xmlrpc_method_call | xmlrpc_method_response] - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestGetRequestType () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -XMLRPC_REQUEST_TYPE XMLRPC_RequestSetRequestType (XMLRPC_REQUEST request, - XMLRPC_REQUEST_TYPE type) { - if(request) { - request->request_type = type; - return request->request_type; - } - return xmlrpc_request_none; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestGetRequestType - * NAME - * XMLRPC_RequestGetRequestType - * SYNOPSIS - * XMLRPC_REQUEST_TYPE XMLRPC_RequestGetRequestType(XMLRPC_REQUEST request) - * FUNCTION - * A request struct may be allocated by a caller or by xmlrpc - * in response to a request. This allows setting the - * request type. - * INPUTS - * request -- previously allocated request struct - * RESULT - * type -- request type [xmlrpc_method_call | xmlrpc_method_response] - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestSetRequestType () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -XMLRPC_REQUEST_TYPE XMLRPC_RequestGetRequestType(XMLRPC_REQUEST request) { - return request ? request->request_type : xmlrpc_request_none; -} - -/*******/ - - -/****f* REQUEST/XMLRPC_RequestSetData - * NAME - * XMLRPC_RequestSetData - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_RequestSetData(XMLRPC_REQUEST request, XMLRPC_VALUE data) - * FUNCTION - * Associates a block of xmlrpc data with the request. The - * data is *not* copied. A pointer is kept. The caller - * should be careful not to doubly free the data value, - * which may optionally be free'd by XMLRPC_RequestFree(). - * INPUTS - * request -- previously allocated request struct - * data -- previously allocated data struct - * RESULT - * XMLRPC_VALUE -- pointer to value stored, or NULL - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestGetData () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_RequestSetData(XMLRPC_REQUEST request, XMLRPC_VALUE data) { - if(request && data) { - if (request->io) { - XMLRPC_CleanupValue (request->io); - } - request->io = XMLRPC_CopyValue(data); - return request->io; - } - return NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestGetData - * NAME - * XMLRPC_RequestGetData - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_RequestGetData(XMLRPC_REQUEST request) - * FUNCTION - * Returns data associated with request, if any. - * INPUTS - * request -- previously allocated request struct - * RESULT - * XMLRPC_VALUE -- pointer to value stored, or NULL - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestSetData () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_RequestGetData(XMLRPC_REQUEST request) { - return request ? request->io : NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestSetError - * NAME - * XMLRPC_RequestSetError - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_RequestSetError(XMLRPC_REQUEST request, XMLRPC_VALUE error) - * FUNCTION - * Associates a block of xmlrpc data, representing an error - * condition, with the request. - * INPUTS - * request -- previously allocated request struct - * error -- previously allocated error code or struct - * RESULT - * XMLRPC_VALUE -- pointer to value stored, or NULL - * NOTES - * This is a private function for usage by internals only. - * SEE ALSO - * XMLRPC_RequestGetError () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_RequestSetError (XMLRPC_REQUEST request, XMLRPC_VALUE error) { - if (request && error) { - if (request->error) { - XMLRPC_CleanupValue (request->error); - } - request->error = XMLRPC_CopyValue (error); - return request->error; - } - return NULL; -} - -/*******/ - -/****f* REQUEST/XMLRPC_RequestGetError - * NAME - * XMLRPC_RequestGetError - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_RequestGetError(XMLRPC_REQUEST request) - * FUNCTION - * Returns error data associated with request, if any. - * INPUTS - * request -- previously allocated request struct - * RESULT - * XMLRPC_VALUE -- pointer to error value stored, or NULL - * NOTES - * This is a private function for usage by internals only. - * SEE ALSO - * XMLRPC_RequestSetError () - * XMLRPC_RequestFree () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_RequestGetError (XMLRPC_REQUEST request) { - return request ? request->error : NULL; -} - -/*******/ - - -/****f* REQUEST/XMLRPC_RequestSetOutputOptions - * NAME - * XMLRPC_RequestSetOutputOptions - * SYNOPSIS - * XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestSetOutputOptions(XMLRPC_REQUEST request, XMLRPC_REQUEST_OUTPUT_OPTIONS output) - * FUNCTION - * Sets output options used for generating XML. The output struct - * is copied, and may be freed by the caller. - * INPUTS - * request -- previously allocated request struct - * output -- output options struct initialized by caller - * RESULT - * XMLRPC_REQUEST_OUTPUT_OPTIONS -- pointer to value stored, or NULL - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestGetOutputOptions () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST - * XMLRPC_REQUEST_OUTPUT_OPTIONS - * SOURCE - */ -XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestSetOutputOptions(XMLRPC_REQUEST request, XMLRPC_REQUEST_OUTPUT_OPTIONS output) { - if(request && output) { - memcpy (&request->output, output, - sizeof (STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS)); - return &request->output; - } - return NULL; -} - -/*******/ - - -/****f* REQUEST/XMLRPC_RequestGetOutputOptions - * NAME - * XMLRPC_RequestGetOutputOptions - * SYNOPSIS - * XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestGetOutputOptions(XMLRPC_REQUEST request) - * FUNCTION - * Gets a pointer to output options used for generating XML. - * INPUTS - * request -- previously allocated request struct - * RESULT - * XMLRPC_REQUEST_OUTPUT_OPTIONS -- pointer to options stored, or NULL - * SEE ALSO - * XMLRPC_RequestNew () - * XMLRPC_RequestSetOutputOptions () - * XMLRPC_RequestFree () - * XMLRPC_REQUEST - * XMLRPC_REQUEST_OUTPUT_OPTIONS - * SOURCE - */ -XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestGetOutputOptions(XMLRPC_REQUEST request) { - return request ? &request->output : NULL; -} - -/*******/ - -/*-************************* -* End XMLRPC_REQUEST funcs * -***************************/ - - -/*-*************************** -* Begin Serializiation funcs * -*****************************/ - -/****f* SERIALIZE/XMLRPC_VALUE_ToXML - * NAME - * XMLRPC_VALUE_ToXML - * SYNOPSIS - * char* XMLRPC_VALUE_ToXML(XMLRPC_VALUE val) - * FUNCTION - * encode XMLRPC_VALUE into XML buffer. Note that the generated - * buffer will not contain a methodCall. - * INPUTS - * val -- previously allocated XMLRPC_VALUE - * buf_len -- length of returned buffer, if not null - * RESULT - * char* -- newly allocated buffer containing XML. - * It is the caller's responsibility to free it. - * SEE ALSO - * XMLRPC_REQUEST_ToXML () - * XMLRPC_VALUE_FromXML () - * XMLRPC_Free () - * XMLRPC_VALUE - * SOURCE - */ -char* XMLRPC_VALUE_ToXML(XMLRPC_VALUE val, int* buf_len) { - xml_element *root_elem = XMLRPC_VALUE_to_xml_element(val); - char* pRet = NULL; - - if(root_elem) { - pRet = xml_elem_serialize_to_string(root_elem, NULL, buf_len); - xml_elem_free(root_elem); - } - return pRet; -} - -/*******/ - -/****f* SERIALIZE/XMLRPC_REQUEST_ToXML - * NAME - * XMLRPC_REQUEST_ToXML - * SYNOPSIS - * char* XMLRPC_REQUEST_ToXML(XMLRPC_REQUEST request) - * FUNCTION - * encode XMLRPC_REQUEST into XML buffer - * INPUTS - * request -- previously allocated XMLRPC_REQUEST - * buf_len -- size of returned buf, if not null - * RESULT - * char* -- newly allocated buffer containing XML. - * It is the caller's responsibility to free it. - * SEE ALSO - * XMLRPC_REQUEST_ToXML () - * XMLRPC_REQUEST_FromXML () - * XMLRPC_Free () - * XMLRPC_VALUE_ToXML () - * XMLRPC_REQUEST - * SOURCE - */ -char* XMLRPC_REQUEST_ToXML(XMLRPC_REQUEST request, int* buf_len) { - char* pRet = NULL; - if (request) { - xml_element *root_elem = NULL; - if (request->output.version == xmlrpc_version_simple) { - root_elem = DANDARPC_REQUEST_to_xml_element (request); - } - else if (request->output.version == xmlrpc_version_1_0 || - request->output.version == xmlrpc_version_none) { - root_elem = XMLRPC_REQUEST_to_xml_element (request); - } - else if (request->output.version == xmlrpc_version_soap_1_1) { - root_elem = SOAP_REQUEST_to_xml_element (request); - } - - if(root_elem) { - pRet = - xml_elem_serialize_to_string (root_elem, - &request->output.xml_elem_opts, - buf_len); - xml_elem_free(root_elem); - } - } - return pRet; -} - -/*******/ - -/****f* SERIALIZE/XMLRPC_VALUE_FromXML - * NAME - * XMLRPC_VALUE_FromXML - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_VALUE_FromXML(const char* in_buf, int le - * FUNCTION - * Retrieve XMLRPC_VALUE from XML buffer. Note that this will - * ignore any methodCall. See XMLRPC_REQUEST_FromXML - * INPUTS - * in_buf -- character buffer containing XML - * len -- length of buffer - * RESULT - * XMLRPC_VALUE -- newly allocated data, or NULL if error. Should - * be free'd by caller. - * SEE ALSO - * XMLRPC_VALUE_ToXML () - * XMLRPC_REQUEST_FromXML () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_VALUE_FromXML (const char *in_buf, int len, XMLRPC_REQUEST_INPUT_OPTIONS in_options) { - XMLRPC_VALUE xResponse = NULL; - XMLRPC_REQUEST req = XMLRPC_REQUEST_FromXML(in_buf, len, in_options); - - if(req) { - xResponse = req->io; - XMLRPC_RequestFree(req, 0); - } - return xResponse; -} - -/*******/ - -/* map parser errors to standard xml-rpc errors */ -static XMLRPC_VALUE map_expat_errors(XML_ELEM_ERROR error) { - XMLRPC_VALUE xReturn = NULL; - if(error) { - XMLRPC_ERROR_CODE code; - char buf[1024]; - snprintf(buf, sizeof(buf), - "error occurred at line %ld, column %ld, byte index %ld", - error->line, error->column, error->byte_index); - - /* expat specific errors */ - switch(error->parser_code) { - case XML_ERROR_UNKNOWN_ENCODING: - code = xmlrpc_error_parse_unknown_encoding; - break; - case XML_ERROR_INCORRECT_ENCODING: - code = xmlrpc_error_parse_bad_encoding; - break; - default: - code = xmlrpc_error_parse_xml_syntax; - break; - } - xReturn = XMLRPC_UtilityCreateFault(code, buf); - } - return xReturn; -} - -/****f* SERIALIZE/XMLRPC_REQUEST_FromXML - * NAME - * XMLRPC_REQUEST_FromXML - * SYNOPSIS - * XMLRPC_REQUEST XMLRPC_REQUEST_FromXML(const char* in_buf, int le - * FUNCTION - * Retrieve XMLRPC_REQUEST from XML buffer - * INPUTS - * in_buf -- character buffer containing XML - * len -- length of buffer - * RESULT - * XMLRPC_REQUEST -- newly allocated data, or NULL if error. Should - * be free'd by caller. - * SEE ALSO - * XMLRPC_REQUEST_ToXML () - * XMLRPC_VALUE_FromXML () - * XMLRPC_REQUEST - * SOURCE - */ -XMLRPC_REQUEST XMLRPC_REQUEST_FromXML (const char *in_buf, int len, - XMLRPC_REQUEST_INPUT_OPTIONS in_options) { - XMLRPC_REQUEST request = XMLRPC_RequestNew(); - STRUCT_XML_ELEM_ERROR error = {0}; - - if(request) { - xml_element *root_elem = - xml_elem_parse_buf (in_buf, len, - (in_options ? &in_options->xml_elem_opts : NULL), - &error); - - if(root_elem) { - if(!strcmp(root_elem->name, "simpleRPC")) { - request->output.version = xmlrpc_version_simple; - xml_element_to_DANDARPC_REQUEST(request, root_elem); - } - else if (!strcmp (root_elem->name, "SOAP-ENV:Envelope")) { - request->output.version = xmlrpc_version_soap_1_1; - xml_element_to_SOAP_REQUEST (request, root_elem); - } - else { - request->output.version = xmlrpc_version_1_0; - xml_element_to_XMLRPC_REQUEST(request, root_elem); - } - xml_elem_free(root_elem); - } - else { - if(error.parser_error) { - XMLRPC_RequestSetError (request, map_expat_errors (&error)); - } - } - } - - return request; -} - -/*******/ - -/*-************************ -* End Serialization Funcs * -**************************/ - - - -/****f* VALUE/XMLRPC_CreateValueEmpty - * NAME - * XMLRPC_CreateValueEmpty - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueEmpty () - * FUNCTION - * Create an XML value to be used/modified elsewhere. - * INPUTS - * RESULT - * XMLRPC_VALUE. The new value, or NULL on failure. - * SEE ALSO - * XMLRPC_CleanupValue () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueEmpty() { - XMLRPC_VALUE v = calloc(1, sizeof(STRUCT_XMLRPC_VALUE)); - if(v) { -#ifdef XMLRPC_DEBUG_REFCOUNT - printf ("calloc'd 0x%x\n", v); -#endif - v->type = xmlrpc_empty; - simplestring_init(&v->id); - simplestring_init(&v->str); - } - return v; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetValueID_Case - * NAME - * XMLRPC_SetValueID_Case - * SYNOPSIS - * const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, XMLRPC_CASE id_case) - * FUNCTION - * Assign an ID (key) to an XMLRPC value. - * INPUTS - * value The xml value who's ID we will set. - * id The desired new id. - * len length of id string if known, or 0 if unknown. - * id_case one of XMLRPC_CASE - * RESULT - * const char* pointer to the newly allocated id string, or NULL - * SEE ALSO - * XMLRPC_SetValueID () - * XMLRPC_GetValueID () - * XMLRPC_VALUE - * XMLRPC_CASE - * SOURCE - */ -const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, XMLRPC_CASE id_case) { - const char* pRetval = NULL; - if(value) { - if(id) { - simplestring_clear(&value->id); - (len > 0) ? simplestring_addn(&value->id, id, len) : - simplestring_add(&value->id, id); - - /* upper or lower case string in place if required. could be a seperate func. */ - if(id_case == xmlrpc_case_lower || id_case == xmlrpc_case_upper) { - int i; - for(i = 0; i < value->id.len; i++) { - value->id.str[i] = - (id_case == - xmlrpc_case_lower) ? tolower (value->id. - str[i]) : toupper (value-> - id. - str[i]); - } - } - - pRetval = value->id.str; - -#ifdef XMLRPC_DEBUG_REFCOUNT - printf("set value id: %s\n", pRetval); -#endif - } - } - - return pRetval; -} - -/*******/ - - -/****f* VALUE/XMLRPC_SetValueString - * NAME - * XMLRPC_SetValueString - * SYNOPSIS - * const char *XMLRPC_SetValueString(XMLRPC_VALUE value, const char* val, int len) - * FUNCTION - * Assign a string value to an XMLRPC_VALUE, and set it to type xmlrpc_string - * INPUTS - * value The xml value who's ID we will set. - * val The desired new string val. - * len length of val string if known, or 0 if unknown. - * RESULT - * const char* pointer to the newly allocated value string, or NULL - * SEE ALSO - * XMLRPC_GetValueString () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -const char *XMLRPC_SetValueString(XMLRPC_VALUE value, const char* val, int len) { - char *pRetval = NULL; - if(value && val) { - simplestring_clear(&value->str); - (len > 0) ? simplestring_addn(&value->str, val, len) : - simplestring_add(&value->str, val); - value->type = xmlrpc_string; - pRetval = (char *)value->str.str; - } - - return pRetval; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetValueInt - * NAME - * XMLRPC_SetValueInt - * SYNOPSIS - * void XMLRPC_SetValueInt(XMLRPC_VALUE value, int val) - * FUNCTION - * Assign an int value to an XMLRPC_VALUE, and set it to type xmlrpc_int - * INPUTS - * value The xml value who's ID we will set. - * val The desired new integer value - * RESULT - * SEE ALSO - * XMLRPC_GetValueInt () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -void XMLRPC_SetValueInt(XMLRPC_VALUE value, int val) { - if(value) { - value->type = xmlrpc_int; - value->i = val; - } -} - -/*******/ - -/****f* VALUE/XMLRPC_SetValueBoolean - * NAME - * XMLRPC_SetValueBoolean - * SYNOPSIS - * void XMLRPC_SetValueBoolean(XMLRPC_VALUE value, int val) - * FUNCTION - * Assign a boolean value to an XMLRPC_VALUE, and set it to type xmlrpc_boolean - * INPUTS - * value The xml value who's value we will set. - * val The desired new boolean value. [0 | 1] - * RESULT - * SEE ALSO - * XMLRPC_GetValueBoolean () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -void XMLRPC_SetValueBoolean(XMLRPC_VALUE value, int val) { - if(value) { - value->type = xmlrpc_boolean; - value->i = val ? 1 : 0; - } -} - -/*******/ - - -/****f* VECTOR/XMLRPC_SetIsVector - * NAME - * XMLRPC_SetIsVector - * SYNOPSIS - * int XMLRPC_SetIsVector(XMLRPC_VALUE value, XMLRPC_VECTOR_TYPE type) - * FUNCTION - * Set the XMLRPC_VALUE to be a vector (list) type. The vector may be one of - * [xmlrpc_array | xmlrpc_struct | xmlrpc_mixed]. An array has only index values. - * A struct has key/val pairs. Mixed allows both index and key/val combinations. - * INPUTS - * value The xml value who's vector type we will set - * type New type of vector as enumerated by XMLRPC_VECTOR_TYPE - * RESULT - * int 1 if successful, 0 otherwise - * SEE ALSO - * XMLRPC_GetValueType () - * XMLRPC_GetVectorType () - * XMLRPC_VALUE - * XMLRPC_VECTOR_TYPE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -int XMLRPC_SetIsVector(XMLRPC_VALUE value, XMLRPC_VECTOR_TYPE type) { - int bSuccess = 0; - - if (value) { - /* we can change the type so long as nothing is currently stored. */ - if(value->type == xmlrpc_vector) { - if(value->v) { - if(!Q_Size(value->v->q)) { - value->v->type = type; - } - } - } - else { - value->v = calloc(1, sizeof(STRUCT_XMLRPC_VECTOR)); - if(value->v) { - value->v->q = (queue*)malloc(sizeof(queue)); - if(value->v->q) { - Q_Init(value->v->q); - value->v->type = type; - value->type = xmlrpc_vector; - bSuccess = 1; - } - } - } - } - - return bSuccess; -} - -/*******/ - -/****f* VECTOR/XMLRPC_CreateVector - * NAME - * XMLRPC_CreateVector - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateVector(const char* id, XMLRPC_VECTOR_TYPE type) - * FUNCTION - * Create a new vector and optionally set an id. - * INPUTS - * id The id of the vector, or NULL - * type New type of vector as enumerated by XMLRPC_VECTOR_TYPE - * RESULT - * XMLRPC_VALUE The new vector, or NULL on failure. - * SEE ALSO - * XMLRPC_CreateValueEmpty () - * XMLRPC_SetIsVector () - * XMLRPC_GetValueType () - * XMLRPC_GetVectorType () - * XMLRPC_VALUE - * XMLRPC_VECTOR_TYPE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateVector(const char* id, XMLRPC_VECTOR_TYPE type) { - XMLRPC_VALUE val = NULL; - - val = XMLRPC_CreateValueEmpty(); - if(val) { - if(XMLRPC_SetIsVector(val, type)) { - if(id) { - const char *pSVI = NULL; - - pSVI = XMLRPC_SetValueID(val, id, 0); - if(NULL == pSVI) { - val = NULL; - } - } - } - else { - val = NULL; - } - } - return val; -} - -/*******/ - - -/* Not yet implemented. - * - * This should use a hash to determine if a given target id has already - * been appended. - * - * Alternately, it could walk the entire vector, but that could be quite - * slow for very large lists. - */ -static int isDuplicateEntry(XMLRPC_VALUE target, XMLRPC_VALUE source) { - return 0; -} - -/****f* VECTOR/XMLRPC_AddValueToVector - * NAME - * XMLRPC_AddValueToVector - * SYNOPSIS - * int XMLRPC_AddValueToVector(XMLRPC_VALUE target, XMLRPC_VALUE source) - * FUNCTION - * Add (append) an existing XMLRPC_VALUE to a vector. - * INPUTS - * target The target vector - * source The source value to append - * RESULT - * int 1 if successful, else 0 - * SEE ALSO - * XMLRPC_AddValuesToVector () - * XMLRPC_VectorGetValueWithID_Case () - * XMLRPC_VALUE - * NOTES - * The function will fail and return 0 if an attempt is made to add - * a value with an ID into a vector of type xmlrpc_vector_array. Such - * values can only be added to xmlrpc_vector_struct. - * SOURCE - */ -int XMLRPC_AddValueToVector(XMLRPC_VALUE target, XMLRPC_VALUE source) { - if(target && source) { - if(target->type == xmlrpc_vector && target->v && - target->v->q && target->v->type != xmlrpc_vector_none) { - - /* guard against putting value of unknown type into vector */ - switch(source->type) { - case xmlrpc_empty: - case xmlrpc_base64: - case xmlrpc_boolean: - case xmlrpc_datetime: - case xmlrpc_double: - case xmlrpc_int: - case xmlrpc_string: - case xmlrpc_vector: - /* Guard against putting a key/val pair into an array vector */ - if( !(source->id.len && target->v->type == xmlrpc_vector_array) ) { - if (isDuplicateEntry (target, source) - || Q_PushTail (target->v->q, XMLRPC_CopyValue (source))) { - return 1; - } - } - else { -/* fprintf (stderr, - "xmlrpc: attempted to add key/val pair to vector of type array\n"); */ - } - break; - default: -/* fprintf (stderr, - "xmlrpc: attempted to add value of unknown type to vector\n"); */ - break; - } - } - } - return 0; -} - -/*******/ - - -/****f* VECTOR/XMLRPC_AddValuesToVector - * NAME - * XMLRPC_AddValuesToVector - * SYNOPSIS - * XMLRPC_AddValuesToVector ( target, val1, val2, val3, val(n), 0 ) - * XMLRPC_AddValuesToVector( XMLRPC_VALUE, ... ) - * FUNCTION - * Add (append) a series of existing XMLRPC_VALUE to a vector. - * INPUTS - * target The target vector - * ... The source value(s) to append. The last item *must* be 0. - * RESULT - * int 1 if successful, else 0 - * SEE ALSO - * XMLRPC_AddValuesToVector () - * XMLRPC_VectorGetValueWithID_Case () - * XMLRPC_VALUE - * NOTES - * This function may actually return failure after it has already modified - * or added items to target. You can not trust the state of target - * if this function returns failure. - * SOURCE - */ -int XMLRPC_AddValuesToVector(XMLRPC_VALUE target, ...) { - int iRetval = 0; - - if(target) { - if(target->type == xmlrpc_vector) { - XMLRPC_VALUE v = NULL; - va_list vl; - - va_start(vl, target); - - do { - v = va_arg(vl, XMLRPC_VALUE); - if(v) { - if(!XMLRPC_AddValueToVector(target, v)) { - iRetval = 0; - break; - } - } - } - while (v); - - va_end(vl); - - if(NULL == v) { - iRetval = 1; - } - } - } - return iRetval; -} - -/*******/ - - -/****f* VECTOR/XMLRPC_VectorGetValueWithID_Case - * NAME - * XMLRPC_VectorGetValueWithID_Case - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_VectorGetValueWithID_Case(XMLRPC_VALUE vector, const char* id, XMLRPC_CASE_COMPARISON id_case) - * FUNCTION - * Get value from vector matching id (key) - * INPUTS - * vector The source vector - * id The key to find - * id_case Rule for how to match key - * RESULT - * int 1 if successful, else 0 - * SEE ALSO - * XMLRPC_SetValueID_Case () - * XMLRPC_VALUE - * XMLRPC_CASE_COMPARISON - * SOURCE - */ -XMLRPC_VALUE XMLRPC_VectorGetValueWithID_Case (XMLRPC_VALUE vector, const char *id, - XMLRPC_CASE_COMPARISON id_case) { - if(vector && vector->v && vector->v->q) { - q_iter qi = Q_Iter_Head_F(vector->v->q); - - while(qi) { - XMLRPC_VALUE xIter = Q_Iter_Get_F(qi); - if(xIter && xIter->id.str) { - if(id_case == xmlrpc_case_sensitive) { - if(!strcmp(xIter->id.str, id)) { - return xIter; - } - } - else if(id_case == xmlrpc_case_insensitive) { - if(!strcasecmp(xIter->id.str, id)) { - return xIter; - } - } - } - qi = Q_Iter_Next_F(qi); - } - } - return NULL; -} - -/*******/ - - -int XMLRPC_VectorRemoveValue(XMLRPC_VALUE vector, XMLRPC_VALUE value) { - if(vector && vector->v && vector->v->q && value) { - q_iter qi = Q_Iter_Head_F(vector->v->q); - - while(qi) { - XMLRPC_VALUE xIter = Q_Iter_Get_F(qi); - if(xIter == value) { - XMLRPC_CleanupValue(xIter); - Q_Iter_Del(vector->v->q, qi); - return 1; - } - qi = Q_Iter_Next_F(qi); - } - } - return 0; -} - - -/****f* VALUE/XMLRPC_CreateValueString - * NAME - * XMLRPC_CreateValueString - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueString(const char* id, const char* val, int len) - * FUNCTION - * Create an XMLRPC_VALUE, and assign a string to it - * INPUTS - * id The id of the value, or NULL - * val The desired new string val. - * len length of val string if known, or 0 if unknown. - * RESULT - * newly allocated XMLRPC_VALUE, or NULL - * SEE ALSO - * XMLRPC_GetValueString () - * XMLRPC_CreateValueEmpty () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueString(const char* id, const char* val, int len) { - XMLRPC_VALUE value = NULL; - if(val) { - value = XMLRPC_CreateValueEmpty(); - if(value) { - XMLRPC_SetValueString(value, val, len); - if(id) { - XMLRPC_SetValueID(value, id, 0); - } - } - } - return value; -} - -/*******/ - -/****f* VALUE/XMLRPC_CreateValueInt - * NAME - * XMLRPC_CreateValueInt - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueInt(const char* id, int i) - * FUNCTION - * Create an XMLRPC_VALUE, and assign an int to it - * INPUTS - * id The id of the value, or NULL - * i The desired new int val. - * RESULT - * newly allocated XMLRPC_VALUE, or NULL - * SEE ALSO - * XMLRPC_GetValueInt () - * XMLRPC_CreateValueEmpty () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueInt(const char* id, int i) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueInt(val, i); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - -/****f* VALUE/XMLRPC_CreateValueBoolean - * NAME - * XMLRPC_CreateValueBoolean - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueBoolean(const char* id, int i) - * FUNCTION - * Create an XMLRPC_VALUE, and assign an int to it - * INPUTS - * id The id of the value, or NULL - * i The desired new int val. - * RESULT - * newly allocated XMLRPC_VALUE, or NULL - * SEE ALSO - * XMLRPC_GetValueBoolean () - * XMLRPC_CreateValueEmpty () - * XMLRPC_VALUE - * XMLRPC_VALUE_TYPE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueBoolean(const char* id, int i) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueBoolean(val, i); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - - -/****f* VALUE/XMLRPC_CleanupValue - * NAME - * XMLRPC_CleanupValue - * SYNOPSIS - * void XMLRPC_CleanupValue(XMLRPC_VALUE value) - * FUNCTION - * Frees all memory allocated for an XMLRPC_VALUE and any of its children (if a vector) - * INPUTS - * value The id of the value to be cleaned up. - * RESULT - * void - * NOTES - * Normally this function will be called for the topmost vector, thus free-ing - * all children. If a child of a vector is free'd first, results are undefined. - * Failure to call this function *will* cause memory leaks. - * - * Also, this function is implemented using reference counting. Thus a value - * may be added and freed from multiple parents so long as a reference is added - * first using XMLRPC_CopyValue() - * SEE ALSO - * XMLRPC_RequestFree () - * XMLRPC_CreateValueEmpty () - * XMLRPC_CopyValue() - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_CleanupValue(XMLRPC_VALUE value) { - if(value) { - if(value->iRefCount > 0) { - value->iRefCount --; - } - -#ifdef XMLRPC_DEBUG_REFCOUNT - if(value->id.str) { - printf ("decremented refcount of %s, now %i\n", value->id.str, - value->iRefCount); - } - else { - printf ("decremented refcount of 0x%x, now %i\n", value, - value->iRefCount); - } -#endif - - if(value->type == xmlrpc_vector) { - if(value->v) { - if(value->iRefCount == 0) { - XMLRPC_VALUE cur = (XMLRPC_VALUE)Q_Head(value->v->q); - while( cur ) { - XMLRPC_CleanupValue(cur); - - /* Make sure some idiot didn't include a vector as a child of itself - * and thus it would have already free'd these. - */ - if(value->v && value->v->q) { - cur = Q_Next(value->v->q); - } - else { - break; - } - } - - Q_Destroy(value->v->q); - my_free(value->v->q); - my_free(value->v); - } - } - } - - - if(value->iRefCount == 0) { - - /* guard against freeing invalid types */ - switch(value->type) { - case xmlrpc_empty: - case xmlrpc_base64: - case xmlrpc_boolean: - case xmlrpc_datetime: - case xmlrpc_double: - case xmlrpc_int: - case xmlrpc_string: - case xmlrpc_vector: -#ifdef XMLRPC_DEBUG_REFCOUNT - if(value->id.str) { - printf("free'd %s\n", value->id.str); - } - else { - printf("free'd 0x%x\n", value); - } -#endif - simplestring_free(&value->id); - simplestring_free(&value->str); - - memset(value, 0, sizeof(STRUCT_XMLRPC_VALUE)); - my_free(value); - break; - default: -/* fprintf (stderr, - "xmlrpc: attempted to free value of invalid type\n"); */ - break; - } - } - } -} - -/*******/ - - -/****f* VALUE/XMLRPC_SetValueDateTime - * NAME - * XMLRPC_SetValueDateTime - * SYNOPSIS - * void XMLRPC_SetValueDateTime(XMLRPC_VALUE value, time_t time) - * FUNCTION - * Assign time value to XMLRPC_VALUE - * INPUTS - * value The target XMLRPC_VALUE - * time The desired new unix time value (time_t) - * RESULT - * void - * SEE ALSO - * XMLRPC_GetValueDateTime () - * XMLRPC_SetValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime () - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_SetValueDateTime(XMLRPC_VALUE value, time_t time) { - if(value) { - char timeBuf[30]; - value->type = xmlrpc_datetime; - value->i = time; - - timeBuf[0] = 0; - - date_to_ISO8601(time, timeBuf, sizeof(timeBuf)); - - if(timeBuf[0]) { - XMLRPC_SetValueDateTime_ISO8601 (value, timeBuf); - } - } -} - -/*******/ - -/****f* VALUE/XMLRPC_CopyValue - * NAME - * XMLRPC_CopyValue - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) - * FUNCTION - * Make a copy (reference) of an XMLRPC_VALUE - * INPUTS - * value The target XMLRPC_VALUE - * RESULT - * XMLRPC_VALUE -- address of the copy - * SEE ALSO - * XMLRPC_CleanupValue () - * XMLRPC_DupValueNew () - * NOTES - * This function is implemented via reference counting, so the - * returned value is going to be the same as the passed in value. - * The value must be freed the same number of times it is copied - * or there will be a memory leak. - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) { - if(value) { - value->iRefCount ++; -#ifdef XMLRPC_DEBUG_REFCOUNT - if(value->id.str) { - printf ("incremented refcount of %s, now %i\n", value->id.str, - value->iRefCount); - } - else { - printf ("incremented refcount of 0x%x, now %i\n", value, - value->iRefCount); - } -#endif - } - return value; -} - -/*******/ - - -/****f* VALUE/XMLRPC_DupValueNew - * NAME - * XMLRPC_DupValueNew - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_DupValueNew(XMLRPC_VALUE value) - * FUNCTION - * Make a duplicate (non reference) of an XMLRPC_VALUE with newly allocated mem. - * INPUTS - * value The source XMLRPC_VALUE to duplicate - * RESULT - * XMLRPC_VALUE -- address of the duplicate value - * SEE ALSO - * XMLRPC_CleanupValue () - * XMLRPC_CopyValue () - * NOTES - * Use this when function when you need to modify the contents of - * the copied value seperately from the original. - * - * this function is recursive, thus the value and all of its children - * (if any) will be duplicated. - * SOURCE - */ -XMLRPC_VALUE XMLRPC_DupValueNew (XMLRPC_VALUE xSource) { - XMLRPC_VALUE xReturn = NULL; - if (xSource) { - xReturn = XMLRPC_CreateValueEmpty (); - if (xSource->id.len) { - XMLRPC_SetValueID (xReturn, xSource->id.str, xSource->id.len); - } - - switch (xSource->type) { - case xmlrpc_int: - case xmlrpc_boolean: - XMLRPC_SetValueInt (xReturn, xSource->i); - break; - case xmlrpc_string: - case xmlrpc_base64: - XMLRPC_SetValueString (xReturn, xSource->str.str, xSource->str.len); - break; - case xmlrpc_datetime: - XMLRPC_SetValueDateTime (xReturn, xSource->i); - break; - case xmlrpc_double: - XMLRPC_SetValueDouble (xReturn, xSource->d); - break; - case xmlrpc_vector: - { - q_iter qi = Q_Iter_Head_F (xSource->v->q); - XMLRPC_SetIsVector (xReturn, xSource->v->type); - - while (qi) { - XMLRPC_VALUE xIter = Q_Iter_Get_F (qi); - XMLRPC_AddValueToVector (xReturn, XMLRPC_DupValueNew (xIter)); - qi = Q_Iter_Next_F (qi); - } - } - break; - default: - break; - } - } - return xReturn; -} - -/*******/ - - - -/****f* VALUE/XMLRPC_CreateValueDateTime - * NAME - * XMLRPC_CreateValueDateTime - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueDateTime(const char* id, time_t time) - * FUNCTION - * Create new datetime value from time_t - * INPUTS - * id id of the new value, or NULL - * time The desired unix time value (time_t) - * RESULT - * void - * SEE ALSO - * XMLRPC_GetValueDateTime () - * XMLRPC_SetValueDateTime () - * XMLRPC_CreateValueDateTime_ISO8601 () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueDateTime(const char* id, time_t time) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueDateTime(val, time); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - - -/****f* VALUE/XMLRPC_SetValueDateTime_ISO8601 - * NAME - * XMLRPC_SetValueDateTime_ISO8601 - * SYNOPSIS - * void XMLRPC_SetValueDateTime_ISO8601(XMLRPC_VALUE value, const char* s) - * FUNCTION - * Set datetime value from IS08601 encoded string - * INPUTS - * value The target XMLRPC_VALUE - * s The desired new time value - * RESULT - * void - * BUGS - * This function currently attempts to convert the time string to a valid unix time - * value before passing it. Behavior when the string is invalid or out of range - * is not well defined, but will probably result in Jan 1, 1970 (0) being passed. - * SEE ALSO - * XMLRPC_GetValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime () - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_SetValueDateTime_ISO8601(XMLRPC_VALUE value, const char* s) { - if(value) { - time_t time_val = 0; - if(s) { - value->type = xmlrpc_datetime; - date_from_ISO8601(s, &time_val); - value->i = time_val; - simplestring_clear(&value->str); - simplestring_add(&value->str, s); - } - } -} - -/*******/ - -/****f* VALUE/XMLRPC_CreateValueDateTime_ISO8601 - * NAME - * XMLRPC_CreateValueDateTime_ISO8601 - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueDateTime_ISO8601(const char* id, const char *s) - * FUNCTION - * Create datetime value from IS08601 encoded string - * INPUTS - * id The id of the new value, or NULL - * s The desired new time value - * RESULT - * newly allocated XMLRPC_VALUE, or NULL if no value created. - * BUGS - * See XMLRPC_SetValueDateTime_ISO8601 () - * SEE ALSO - * XMLRPC_GetValueDateTime_ISO8601 () - * XMLRPC_SetValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueDateTime_ISO8601(const char* id, const char *s) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueDateTime_ISO8601(val, s); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - - -/****f* VALUE/XMLRPC_SetValueBase64 - * NAME - * XMLRPC_SetValueBase64 - * SYNOPSIS - * void XMLRPC_SetValueBase64(XMLRPC_VALUE value, const char* s, int len) - * FUNCTION - * Set base64 value. Base64 is useful for transferring binary data, such as an image. - * INPUTS - * value The target XMLRPC_VALUE - * s The desired new binary value - * len The length of s, or NULL. If buffer is not null terminated, len *must* be passed. - * RESULT - * void - * NOTES - * Data is set/stored/retrieved as passed in, but is base64 encoded for XML transfer, and - * decoded on the other side. This is transparent to the caller. - * SEE ALSO - * XMLRPC_GetValueBase64 () - * XMLRPC_CreateValueBase64 () - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_SetValueBase64(XMLRPC_VALUE value, const char* s, int len) { - if(value && s) { - simplestring_clear(&value->str); - (len > 0) ? simplestring_addn(&value->str, s, len) : - simplestring_add(&value->str, s); - value->type = xmlrpc_base64; - } -} - -/*******/ - - -/****f* VALUE/XMLRPC_CreateValueBase64 - * NAME - * XMLRPC_CreateValueBase64 - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueBase64(const char* id, const char* s, int len) - * FUNCTION - * Create base64 value. Base64 is useful for transferring binary data, such as an image. - * INPUTS - * id id of the new value, or NULL - * s The desired new binary value - * len The length of s, or NULL. If buffer is not null terminated, len *must* be passed. - * RESULT - * newly allocated XMLRPC_VALUE, or NULL if error - * NOTES - * See XMLRPC_SetValueBase64 () - * SEE ALSO - * XMLRPC_GetValueBase64 () - * XMLRPC_SetValueBase64 () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueBase64(const char* id, const char* s, int len) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueBase64(val, s, len); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetValueDouble - * NAME - * XMLRPC_SetValueDouble - * SYNOPSIS - * void XMLRPC_SetValueDouble(XMLRPC_VALUE value, double val) - * FUNCTION - * Set double (floating point) value. - * INPUTS - * value The target XMLRPC_VALUE - * val The desired new double value - * RESULT - * void - * SEE ALSO - * XMLRPC_GetValueDouble () - * XMLRPC_CreateValueDouble () - * XMLRPC_VALUE - * SOURCE - */ -void XMLRPC_SetValueDouble(XMLRPC_VALUE value, double val) { - if(value) { - value->type = xmlrpc_double; - value->d = val; - } -} - -/*******/ - -/****f* VALUE/XMLRPC_CreateValueDouble - * NAME - * XMLRPC_CreateValueDouble - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_CreateValueDouble(const char* id, double d) - * FUNCTION - * Create double (floating point) value. - * INPUTS - * id id of the newly created value, or NULL - * d The desired new double value - * RESULT - * void - * SEE ALSO - * XMLRPC_GetValueDouble () - * XMLRPC_CreateValueDouble () - * XMLRPC_VALUE - * SOURCE - */ -XMLRPC_VALUE XMLRPC_CreateValueDouble(const char* id, double d) { - XMLRPC_VALUE val = XMLRPC_CreateValueEmpty(); - if(val) { - XMLRPC_SetValueDouble(val, d); - if(id) { - XMLRPC_SetValueID(val, id, 0); - } - } - return val; -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueString - * NAME - * XMLRPC_GetValueString - * SYNOPSIS - * const char* XMLRPC_GetValueString(XMLRPC_VALUE value) - * FUNCTION - * retrieve string value - * INPUTS - * value source XMLRPC_VALUE of type xmlrpc_string - * RESULT - * void - * SEE ALSO - * XMLRPC_SetValueString () - * XMLRPC_GetValueType () - * XMLRPC_VALUE - * SOURCE - */ -const char* XMLRPC_GetValueString(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_string) ? value->str.str : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueStringLen - * NAME - * XMLRPC_GetValueStringLen - * SYNOPSIS - * int XMLRPC_GetValueStringLen(XMLRPC_VALUE value) - * FUNCTION - * determine length of string value - * INPUTS - * value XMLRPC_VALUE of type xmlrpc_string - * RESULT - * length of string, or 0 - * NOTES - * SEE ALSO - * XMLRPC_SetValueString () - * XMLRPC_GetValueString () - * SOURCE - */ -int XMLRPC_GetValueStringLen(XMLRPC_VALUE value) { - return ((value) ? value->str.len : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueInt - * NAME - * XMLRPC_GetValueInt - * SYNOPSIS - * int XMLRPC_GetValueInt(XMLRPC_VALUE value) - * FUNCTION - * retrieve integer value. - * INPUTS - * value XMLRPC_VALUE of type xmlrpc_int - * RESULT - * integer value or 0 if value is not valid int - * NOTES - * use XMLRPC_GetValueType () to be sure if 0 is real return value or not - * SEE ALSO - * XMLRPC_SetValueInt () - * XMLRPC_CreateValueInt () - * SOURCE - */ -int XMLRPC_GetValueInt(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_int) ? value->i : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueBoolean - * NAME - * XMLRPC_GetValueBoolean - * SYNOPSIS - * int XMLRPC_GetValueBoolean(XMLRPC_VALUE value) - * FUNCTION - * retrieve boolean value. - * INPUTS - * XMLRPC_VALUE of type xmlrpc_boolean - * RESULT - * boolean value or 0 if value is not valid boolean - * NOTES - * use XMLRPC_GetValueType() to be sure if 0 is real value or not - * SEE ALSO - * XMLRPC_SetValueBoolean () - * XMLRPC_CreateValueBoolean () - * SOURCE - */ -int XMLRPC_GetValueBoolean(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_boolean) ? value->i : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueDouble - * NAME - * XMLRPC_GetValueDouble - * SYNOPSIS - * double XMLRPC_GetValueDouble(XMLRPC_VALUE value) - * FUNCTION - * retrieve double value - * INPUTS - * XMLRPC_VALUE of type xmlrpc_double - * RESULT - * double value or 0 if value is not valid double. - * NOTES - * use XMLRPC_GetValueType() to be sure if 0 is real value or not - * SEE ALSO - * XMLRPC_SetValueDouble () - * XMLRPC_CreateValueDouble () - * SOURCE - */ -double XMLRPC_GetValueDouble(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_double) ? value->d : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueBase64 - * NAME - * XMLRPC_GetValueBase64 - * SYNOPSIS - * const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value) - * FUNCTION - * retrieve binary value - * INPUTS - * XMLRPC_VALUE of type xmlrpc_base64 - * RESULT - * pointer to binary value or 0 if value is not valid. - * SEE ALSO - * XMLRPC_SetValueBase64 () - * XMLRPC_CreateValueBase64 () - * NOTES - * Call XMLRPC_GetValueStringLen() to retrieve real length of binary data. strlen() - * will not be accurate, as returned data may contain embedded nulls. - * SOURCE - */ -const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_base64) ? value->str.str : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueDateTime - * NAME - * XMLRPC_GetValueDateTime - * SYNOPSIS - * time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value) - * FUNCTION - * retrieve time_t value - * INPUTS - * XMLRPC_VALUE of type xmlrpc_datetime - * RESULT - * time_t value or 0 if value is not valid datetime. - * NOTES - * use XMLRPC_GetValueType() to be sure if 0 is real value or not - * SEE ALSO - * XMLRPC_SetValueDateTime () - * XMLRPC_GetValueDateTime_ISO8601 () - * XMLRPC_CreateValueDateTime () - * SOURCE - */ -time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value) { - return (time_t)((value && value->type == xmlrpc_datetime) ? value->i : 0); -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueDateTime_IOS8601 - * NAME - * XMLRPC_GetValueDateTime_IOS8601 - * SYNOPSIS - * const char* XMLRPC_GetValueDateTime_IOS8601(XMLRPC_VALUE value) - * FUNCTION - * retrieve ISO8601 formatted time value - * INPUTS - * XMLRPC_VALUE of type xmlrpc_datetime - * RESULT - * const char* value or 0 if value is not valid datetime. - * SEE ALSO - * XMLRPC_SetValueDateTime_IOS8601 () - * XMLRPC_GetValueDateTime () - * XMLRPC_CreateValueDateTime_IOS8601 () - * SOURCE - */ -const char* XMLRPC_GetValueDateTime_ISO8601(XMLRPC_VALUE value) { - return ((value && value->type == xmlrpc_datetime) ? value->str.str : 0); -} - -/*******/ - -/* Get ID (key) of value or NULL */ -/****f* VALUE/XMLRPC_GetValueID - * NAME - * XMLRPC_GetValueID - * SYNOPSIS - * const char* XMLRPC_GetValueID(XMLRPC_VALUE value) - * FUNCTION - * retrieve id (key) of value - * INPUTS - * XMLRPC_VALUE of any type - * RESULT - * const char* pointer to id of value, or NULL - * NOTES - * SEE ALSO - * XMLRPC_SetValueID() - * XMLRPC_CreateValueEmpty() - * SOURCE - */ -const char* XMLRPC_GetValueID(XMLRPC_VALUE value) { - return (const char*)((value && value->id.len) ? value->id.str : 0); -} - -/*******/ - - -/****f* VECTOR/XMLRPC_VectorSize - * NAME - * XMLRPC_VectorSize - * SYNOPSIS - * int XMLRPC_VectorSize(XMLRPC_VALUE value) - * FUNCTION - * retrieve size of vector - * INPUTS - * XMLRPC_VALUE of type xmlrpc_vector - * RESULT - * count of items in vector - * NOTES - * This is a cheap operation even on large vectors. Vector size is - * maintained by queue during add/remove ops. - * SEE ALSO - * XMLRPC_AddValueToVector () - * SOURCE - */ -int XMLRPC_VectorSize(XMLRPC_VALUE value) { - int size = 0; - if(value && value->type == xmlrpc_vector && value->v) { - size = Q_Size(value->v->q); - } - return size; -} - -/*******/ - -/****f* VECTOR/XMLRPC_VectorRewind - * NAME - * XMLRPC_VectorRewind - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_VectorRewind(XMLRPC_VALUE value) - * FUNCTION - * reset vector to first item - * INPUTS - * XMLRPC_VALUE of type xmlrpc_vector - * RESULT - * first XMLRPC_VALUE in list, or NULL if empty or error. - * NOTES - * Be careful to rewind any vector passed in to you if you expect to - * iterate through the entire list. - * SEE ALSO - * XMLRPC_VectorNext () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_VectorRewind(XMLRPC_VALUE value) { - XMLRPC_VALUE xReturn = NULL; - if(value && value->type == xmlrpc_vector && value->v) { - xReturn = (XMLRPC_VALUE)Q_Head(value->v->q); - } - return xReturn; -} - -/*******/ - -/****f* VECTOR/XMLRPC_VectorNext - * NAME - * XMLRPC_VectorNext - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_VectorNext(XMLRPC_VALUE value) - * FUNCTION - * Iterate vector to next item in list. - * INPUTS - * XMLRPC_VALUE of type xmlrpc_vector - * RESULT - * Next XMLRPC_VALUE in vector, or NULL if at end. - * NOTES - * SEE ALSO - * XMLRPC_VectorRewind () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_VectorNext(XMLRPC_VALUE value) { - XMLRPC_VALUE xReturn = NULL; - if(value && value->type == xmlrpc_vector && value->v) { - xReturn = (XMLRPC_VALUE)Q_Next(value->v->q); - } - return xReturn; -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueType - * NAME - * XMLRPC_GetValueType - * SYNOPSIS - * XMLRPC_VALUE_TYPE XMLRPC_GetValueType(XMLRPC_VALUE value) - * FUNCTION - * determine data type of the XMLRPC_VALUE - * INPUTS - * XMLRPC_VALUE target of query - * RESULT - * data type of value as enumerated by XMLRPC_VALUE_TYPE - * NOTES - * all values are of type xmlrpc_empty until set. - * Deprecated for public use. See XMLRPC_GetValueTypeEasy - * SEE ALSO - * XMLRPC_SetValue* - * XMLRPC_CreateValue* - * XMLRPC_Append* - * XMLRPC_GetValueTypeEasy () - * SOURCE - */ -XMLRPC_VALUE_TYPE XMLRPC_GetValueType(XMLRPC_VALUE value) { - return value ? value->type : xmlrpc_empty; -} - -/*******/ - -/* Vector type accessor */ -/****f* VALUE/XMLRPC_GetVectorType - * NAME - * XMLRPC_GetVectorType - * SYNOPSIS - * XMLRPC_VECTOR_TYPE XMLRPC_GetVectorType(XMLRPC_VALUE value) - * FUNCTION - * determine vector type of the XMLRPC_VALUE - * INPUTS - * XMLRPC_VALUE of type xmlrpc_vector - * RESULT - * vector type of value as enumerated by XMLRPC_VECTOR_TYPE. - * xmlrpc_none if not a value. - * NOTES - * xmlrpc_none is returned if value is not a vector - * Deprecated for public use. See XMLRPC_GetValueTypeEasy - * SEE ALSO - * XMLRPC_SetIsVector () - * XMLRPC_GetValueType () - * XMLRPC_GetValueTypeEasy () - * SOURCE - */ -XMLRPC_VECTOR_TYPE XMLRPC_GetVectorType(XMLRPC_VALUE value) { - return(value && value->v) ? value->v->type : xmlrpc_none; -} - -/*******/ - -/****f* VALUE/XMLRPC_GetValueTypeEasy - * NAME - * XMLRPC_GetValueTypeEasy - * SYNOPSIS - * XMLRPC_VALUE_TYPE_EASY XMLRPC_GetValueTypeEasy(XMLRPC_VALUE value) - * FUNCTION - * determine data type of the XMLRPC_VALUE. includes vector types. - * INPUTS - * XMLRPC_VALUE target of query - * RESULT - * data type of value as enumerated by XMLRPC_VALUE_TYPE_EASY - * xmlrpc_type_none if not a value. - * NOTES - * all values are of type xmlrpc_type_empty until set. - * SEE ALSO - * XMLRPC_SetValue* - * XMLRPC_CreateValue* - * XMLRPC_Append* - * SOURCE - */ -XMLRPC_VALUE_TYPE_EASY XMLRPC_GetValueTypeEasy (XMLRPC_VALUE value) { - if (value) { - switch (value->type) { - case xmlrpc_vector: - switch (value->v->type) { - case xmlrpc_vector_none: - return xmlrpc_type_none; - case xmlrpc_vector_struct: - return xmlrpc_type_struct; - case xmlrpc_vector_mixed: - return xmlrpc_type_mixed; - case xmlrpc_vector_array: - return xmlrpc_type_array; - } - default: - /* evil cast, but we know they are the same */ - return(XMLRPC_VALUE_TYPE_EASY) value->type; - } - } - return xmlrpc_none; -} - -/*******/ - - - -/*-******************* -* Begin Server Funcs * -*********************/ - - -/****f* VALUE/XMLRPC_ServerCreate - * NAME - * XMLRPC_ServerCreate - * SYNOPSIS - * XMLRPC_SERVER XMLRPC_ServerCreate() - * FUNCTION - * Allocate/Init XMLRPC Server Resources. - * INPUTS - * none - * RESULT - * newly allocated XMLRPC_SERVER - * NOTES - * SEE ALSO - * XMLRPC_ServerDestroy () - * XMLRPC_GetGlobalServer () - * SOURCE - */ -XMLRPC_SERVER XMLRPC_ServerCreate() { - XMLRPC_SERVER server = calloc(1, sizeof(STRUCT_XMLRPC_SERVER)); - if(server) { - Q_Init(&server->methodlist); - Q_Init(&server->docslist); - - /* register system methods */ - xsm_register(server); - } - return server; -} - -/*******/ - -/* Return global server. Not locking! Not Thread Safe! */ -/****f* VALUE/XMLRPC_GetGlobalServer - * NAME - * XMLRPC_GetGlobalServer - * SYNOPSIS - * XMLRPC_SERVER XMLRPC_GetGlobalServer() - * FUNCTION - * Allocates a global (process-wide) server, or returns pointer if pre-existing. - * INPUTS - * none - * RESULT - * pointer to global server, or 0 if error. - * NOTES - * ***WARNING*** This function is not thread safe. It is included only for the very lazy. - * Multi-threaded programs that use this may experience problems. - * BUGS - * There is currently no way to cleanup the global server gracefully. - * SEE ALSO - * XMLRPC_ServerCreate () - * SOURCE - */ -XMLRPC_SERVER XMLRPC_GetGlobalServer() { - static XMLRPC_SERVER xsServer = 0; - if(!xsServer) { - xsServer = XMLRPC_ServerCreate(); - } - return xsServer; -} - -/*******/ - -/****f* VALUE/XMLRPC_ServerDestroy - * NAME - * XMLRPC_ServerDestroy - * SYNOPSIS - * void XMLRPC_ServerDestroy(XMLRPC_SERVER server) - * FUNCTION - * Free Server Resources - * INPUTS - * server The server to be free'd - * RESULT - * void - * NOTES - * This frees the server struct and any methods that have been added. - * SEE ALSO - * XMLRPC_ServerCreate () - * SOURCE - */ -void XMLRPC_ServerDestroy(XMLRPC_SERVER server) { - if(server) { - doc_method* dm = Q_Head(&server->docslist); - server_method* sm = Q_Head(&server->methodlist); - while( dm ) { - my_free(dm); - dm = Q_Next(&server->docslist); - } - while( sm ) { - if(sm->name) { - my_free(sm->name); - } - if(sm->desc) { - XMLRPC_CleanupValue(sm->desc); - } - my_free(sm); - sm = Q_Next(&server->methodlist); - } - if(server->xIntrospection) { - XMLRPC_CleanupValue(server->xIntrospection); - } - - Q_Destroy(&server->methodlist); - Q_Destroy(&server->docslist); - my_free(server); - } -} - -/*******/ - - -/****f* VALUE/XMLRPC_ServerRegisterMethod - * NAME - * XMLRPC_ServerRegisterMethod - * SYNOPSIS - * void XMLRPC_ServerRegisterMethod(XMLRPC_SERVER server, const char *name, XMLRPC_Callback cb) - * FUNCTION - * Register new XMLRPC method with server - * INPUTS - * server The XMLRPC_SERVER to register the method with - * name public name of the method - * cb C function that implements the method - * RESULT - * int - 1 if success, else 0 - * NOTES - * A C function must be registered for every "method" that the server recognizes. The - * method name is equivalent to method name in the - * XML syntax. - * SEE ALSO - * XMLRPC_ServerFindMethod () - * XMLRPC_ServerCallMethod () - * SOURCE - */ -int XMLRPC_ServerRegisterMethod(XMLRPC_SERVER server, const char *name, XMLRPC_Callback cb) { - if(server && name && cb) { - - server_method* sm = malloc(sizeof(server_method)); - - if(sm) { - sm->name = strdup(name); - sm->method = cb; - sm->desc = NULL; - - return Q_PushTail(&server->methodlist, sm); - } - } - return 0; -} - -/*******/ - -server_method* find_method(XMLRPC_SERVER server, const char* name) { - server_method* sm; - - q_iter qi = Q_Iter_Head_F(&server->methodlist); - - while( qi ) { - sm = Q_Iter_Get_F(qi); - if(sm && !strcmp(sm->name, name)) { - return sm; - } - qi = Q_Iter_Next_F(qi); - } - return NULL; -} - - -const char* type_to_str(XMLRPC_VALUE_TYPE type, XMLRPC_VECTOR_TYPE vtype) { - switch(type) { - case xmlrpc_none: - return "none"; - case xmlrpc_empty: - return "empty"; - case xmlrpc_base64: - return "base64"; - case xmlrpc_boolean: - return "boolean"; - case xmlrpc_datetime: - return "datetime"; - case xmlrpc_double: - return "double"; - case xmlrpc_int: - return "int"; - case xmlrpc_string: - return "string"; - case xmlrpc_vector: - switch(vtype) { - case xmlrpc_vector_none: - return "none"; - case xmlrpc_vector_array: - return "array"; - case xmlrpc_vector_mixed: - return "mixed vector (struct)"; - case xmlrpc_vector_struct: - return "struct"; - } - } - return "unknown"; -} - -/****f* VALUE/XMLRPC_ServerFindMethod - * NAME - * XMLRPC_ServerFindMethod - * SYNOPSIS - * XMLRPC_Callback XMLRPC_ServerFindMethod(XMLRPC_SERVER server, const char* callName) - * FUNCTION - * retrieve C callback associated with a given method name. - * INPUTS - * server The XMLRPC_SERVER the method is registered with - * callName the method to find - * RESULT - * previously registered XMLRPC_Callback, or NULL - * NOTES - * Typically, this is used to determine if a requested method exists, without actually calling it. - * SEE ALSO - * XMLRPC_ServerCallMethod () - * XMLRPC_ServerRegisterMethod () - * SOURCE - */ -XMLRPC_Callback XMLRPC_ServerFindMethod(XMLRPC_SERVER server, const char* callName) { - if(server && callName) { - q_iter qi = Q_Iter_Head_F(&server->methodlist); - while( qi ) { - server_method* sm = Q_Iter_Get_F(qi); - if(sm && !strcmp(sm->name, callName)) { - return sm->method; - } - qi = Q_Iter_Next_F(qi); - } - } - return NULL; -} - -/*******/ - - -/* Call method specified in request */ -/****f* VALUE/XMLRPC_ServerCallMethod - * NAME - * XMLRPC_ServerCallMethod - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_ServerCallMethod(XMLRPC_SERVER server, XMLRPC_REQUEST request, void* userData) - * FUNCTION - * - * INPUTS - * server The XMLRPC_SERVER the method is registered with - * request the request to handle - * userData any additional data to pass to the C callback, or NULL - * RESULT - * XMLRPC_VALUE allocated by the callback, or NULL - * NOTES - * It is typically the caller's responsibility to free the returned value. - * - * Often the caller will want to serialize the result as XML, via - * XMLRPC_VALUE_To_XML () or XMLRPC_REQUEST_To_XML () - * SEE ALSO - * XMLRPC_ServerFindMethod () - * XMLRPC_ServerRegisterMethod () - * XMLRPC_CleanupValue () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_ServerCallMethod(XMLRPC_SERVER server, XMLRPC_REQUEST request, void* userData) { - XMLRPC_VALUE xReturn = NULL; - - /* check for error set during request parsing / generation */ - if(request && request->error) { - xReturn = XMLRPC_CopyValue(request->error); - } - else if (server && request) { - XMLRPC_Callback cb = - XMLRPC_ServerFindMethod (server, request->methodName.str); - if(cb) { - xReturn = cb(server, request, userData); - } - else { - xReturn = - XMLRPC_UtilityCreateFault (xmlrpc_error_unknown_method, - request->methodName.str); - } - } - return xReturn; -} - -/*******/ - -/*-***************** -* End server funcs * -*******************/ - - -/*-*********************************** -* Begin XMLRPC General Options funcs * -*************************************/ - -/* For options used by XMLRPC_VALUE funcs that otherwise do not have - * parameters for options. Kind of gross. :( - */ -typedef struct _xmlrpc_options { - XMLRPC_CASE id_case; - XMLRPC_CASE_COMPARISON id_case_compare; -} -STRUCT_XMLRPC_OPTIONS, *XMLRPC_OPTIONS; - -static XMLRPC_OPTIONS XMLRPC_GetDefaultOptions() { - static STRUCT_XMLRPC_OPTIONS options = { - xmlrpc_case_exact, - xmlrpc_case_sensitive - }; - return &options; -} - -/****f* VALUE/XMLRPC_GetDefaultIdCase - * NAME - * XMLRPC_GetDefaultIdCase - * SYNOPSIS - * XMLRPC_CASE XMLRPC_GetDefaultIdCase() - * FUNCTION - * Gets default case options used by XMLRPC_VALUE funcs - * INPUTS - * none - * RESULT - * XMLRPC_CASE - * BUGS - * Nasty and gross. Should be server specific, but that requires changing all - * the XMLRPC_VALUE api's. - * SEE ALSO - * XMLRPC_SetDefaultIdCase () - * SOURCE - */ -XMLRPC_CASE XMLRPC_GetDefaultIdCase() { - XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions(); - return options->id_case; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetDefaultIdCase - * NAME - * XMLRPC_SetDefaultIdCase - * SYNOPSIS - * XMLRPC_CASE XMLRPC_SetDefaultIdCase(XMLRPC_CASE id_case) - * FUNCTION - * Sets default case options used by XMLRPC_VALUE funcs - * INPUTS - * id_case case options as enumerated by XMLRPC_CASE - * RESULT - * XMLRPC_CASE -- newly set option - * BUGS - * Nasty and gross. Should be server specific, but that requires changing all - * the XMLRPC_VALUE api's. - * SEE ALSO - * XMLRPC_GetDefaultIdCase () - * SOURCE - */ -XMLRPC_CASE XMLRPC_SetDefaultIdCase(XMLRPC_CASE id_case) { - XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions(); - options->id_case = id_case; - return options->id_case; -} - -/*******/ - -/****f* VALUE/XMLRPC_GetDefaultIdCaseComparison - * NAME - * XMLRPC_GetDefaultIdCaseComparison - * SYNOPSIS - * XMLRPC_CASE XMLRPC_GetDefaultIdCaseComparison( ) - * FUNCTION - * Gets default case comparison options used by XMLRPC_VALUE funcs - * INPUTS - * none - * RESULT - * XMLRPC_CASE_COMPARISON default - * BUGS - * Nasty and gross. Should be server specific, but that requires changing all - * the XMLRPC_VALUE api's. - * SEE ALSO - * XMLRPC_SetDefaultIdCaseComparison () - * SOURCE - */ -XMLRPC_CASE_COMPARISON XMLRPC_GetDefaultIdCaseComparison() { - XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions(); - return options->id_case_compare; -} - -/*******/ - -/****f* VALUE/XMLRPC_SetDefaultIdCaseComparison - * NAME - * XMLRPC_SetDefaultIdCaseComparison - * SYNOPSIS - * XMLRPC_CASE XMLRPC_SetDefaultIdCaseComparison( XMLRPC_CASE_COMPARISON id_case_compare ) - * FUNCTION - * Gets default case comparison options used by XMLRPC_VALUE funcs - * INPUTS - * id_case_compare case comparison rule to set as default - * RESULT - * XMLRPC_CASE_COMPARISON newly set default - * BUGS - * Nasty and gross. Should be server specific, but that requires changing all - * the XMLRPC_VALUE api's. - * SEE ALSO - * XMLRPC_GetDefaultIdCaseComparison () - * SOURCE - */ -XMLRPC_CASE_COMPARISON XMLRPC_SetDefaultIdCaseComparison(XMLRPC_CASE_COMPARISON id_case_compare) { - XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions(); - options->id_case_compare = id_case_compare; - return options->id_case_compare; -} - -/*******/ - -/*-********************************* -* End XMLRPC General Options funcs * -***********************************/ - - -/*-****************** -* Fault API funcs * -********************/ - -/****f* UTILITY/XMLRPC_UtilityCreateFault - * NAME - * XMLRPC_UtilityCreateFault - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_UtilityCreateFault( int fault_code, const char* fault_string ) - * FUNCTION - * generates a struct containing a string member with id "faultString" and an int member - * with id "faultCode". When using the xmlrpc xml serialization, these will be translated - * to ... format. - * INPUTS - * fault_code application specific error code. can be 0. - * fault_string application specific error string. cannot be null. - * RESULT - * XMLRPC_VALUE a newly created struct vector representing the error, or null on error. - * NOTES - * This is a utility function. xmlrpc "faults" are not directly represented in this xmlrpc - * API or data structures. It is the author's view, that this API is intended for simple - * data types, and a "fault" is a complex data type consisting of multiple simple data - * types. This function is provided for convenience only, the same result could be - * achieved directly by the application. - * - * This function now supports some "standardized" fault codes, as specified at. - * http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php. - * If one of these fault codes is received, the description string will automatically - * be prefixed with a standard error string and 2 newlines. - * - * The actual transformation between this complex type and the xml "" element takes - * place in the xmlrpc to xml serialization layer. This step is not performed when using the - * simplerpc serialization, meaning that there will be no "" element in that - * serialization. There will simply be a standard struct with 2 child elements. - * imho, the "" element is unnecessary and/or out of place as part of the standard API. - * - * SOURCE - */ -XMLRPC_VALUE XMLRPC_UtilityCreateFault(int fault_code, const char* fault_string) { - XMLRPC_VALUE xOutput = NULL; - - char* string = NULL; - simplestring description; - simplestring_init(&description); - - switch (fault_code) { - case xmlrpc_error_parse_xml_syntax: - string = xmlrpc_error_parse_xml_syntax_str; - break; - case xmlrpc_error_parse_unknown_encoding: - string = xmlrpc_error_parse_unknown_encoding_str; - break; - case xmlrpc_error_parse_bad_encoding: - string = xmlrpc_error_parse_bad_encoding_str; - break; - case xmlrpc_error_invalid_xmlrpc: - string = xmlrpc_error_invalid_xmlrpc_str; - break; - case xmlrpc_error_unknown_method: - string = xmlrpc_error_unknown_method_str; - break; - case xmlrpc_error_invalid_params: - string = xmlrpc_error_invalid_params_str; - break; - case xmlrpc_error_internal_server: - string = xmlrpc_error_internal_server_str; - break; - case xmlrpc_error_application: - string = xmlrpc_error_application_str; - break; - case xmlrpc_error_system: - string = xmlrpc_error_system_str; - break; - case xmlrpc_error_transport: - string = xmlrpc_error_transport_str; - break; - } - - simplestring_add(&description, string); - - if(string && fault_string) { - simplestring_add(&description, "\n\n"); - } - simplestring_add(&description, fault_string); - - - if(description.len) { - xOutput = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - - XMLRPC_VectorAppendString (xOutput, "faultString", description.str, - description.len); - XMLRPC_VectorAppendInt(xOutput, "faultCode", fault_code); - } - - simplestring_free(&description); - - return xOutput; -} - -/*******/ - - -/****f* FAULT/XMLRPC_ValueIsFault - * NAME - * XMLRPC_ValueIsFault - * SYNOPSIS - * int XMLRPC_ValueIsFault (XMLRPC_VALUE value) - * FUNCTION - * Determines if a value encapsulates a fault "object" - * INPUTS - * value any XMLRPC_VALUE - * RESULT - * 1 if it is a fault, else 0 - * SEE ALSO - * XMLRPC_ResponseIsFault () - * SOURCE - */ -int XMLRPC_ValueIsFault (XMLRPC_VALUE value) { - if( XMLRPC_VectorGetValueWithID(value, "faultCode") && - XMLRPC_VectorGetValueWithID(value, "faultString") ) { - return 1; - } - return 0; -} -/*******/ - - -/****f* FAULT/XMLRPC_ResponseIsFault - * NAME - * XMLRPC_ResponseIsFault - * SYNOPSIS - * int XMLRPC_ResponseIsFault (XMLRPC_REQUEST response) - * FUNCTION - * Determines if a response contains an encapsulated fault "object" - * INPUTS - * value any XMLRPC_REQUEST. typically of type xmlrpc_request_response - * RESULT - * 1 if it contains a fault, else 0 - * SEE ALSO - * XMLRPC_ValueIsFault () - * SOURCE - */ -int XMLRPC_ResponseIsFault(XMLRPC_REQUEST response) { - return XMLRPC_ValueIsFault( XMLRPC_RequestGetData(response) ); -} - -/*******/ - -/****f* FAULT/XMLRPC_GetValueFaultCode - * NAME - * XMLRPC_GetValueFaultCode - * SYNOPSIS - * int XMLRPC_GetValueFaultCode (XMLRPC_VALUE value) - * FUNCTION - * returns fault code from a struct, if any - * INPUTS - * value XMLRPC_VALUE of type xmlrpc_vector_struct. - * RESULT - * fault code, else 0. - * BUGS - * impossible to distinguish faultCode == 0 from faultCode not present. - * SEE ALSO - * XMLRPC_GetResponseFaultCode () - * SOURCE - */ -int XMLRPC_GetValueFaultCode (XMLRPC_VALUE value) { - return XMLRPC_VectorGetIntWithID(value, "faultCode"); -} - -/*******/ - -/****f* FAULT/XMLRPC_GetResponseFaultCode - * NAME - * XMLRPC_GetResponseFaultCode - * SYNOPSIS - * int XMLRPC_GetResponseFaultCode(XMLRPC_REQUEST response) - * FUNCTION - * returns fault code from a response, if any - * INPUTS - * response XMLRPC_REQUEST. typically of type xmlrpc_request_response. - * RESULT - * fault code, else 0. - * BUGS - * impossible to distinguish faultCode == 0 from faultCode not present. - * SEE ALSO - * XMLRPC_GetValueFaultCode () - * SOURCE - */ -int XMLRPC_GetResponseFaultCode(XMLRPC_REQUEST response) { - return XMLRPC_GetValueFaultCode( XMLRPC_RequestGetData(response) ); -} - -/*******/ - - -/****f* FAULT/XMLRPC_GetValueFaultString - * NAME - * XMLRPC_GetValueFaultString - * SYNOPSIS - * const char* XMLRPC_GetValueFaultString (XMLRPC_VALUE value) - * FUNCTION - * returns fault string from a struct, if any - * INPUTS - * value XMLRPC_VALUE of type xmlrpc_vector_struct. - * RESULT - * fault string, else 0. - * SEE ALSO - * XMLRPC_GetResponseFaultString () - * SOURCE - */ -const char* XMLRPC_GetValueFaultString (XMLRPC_VALUE value) { - return XMLRPC_VectorGetStringWithID(value, "faultString"); -} - -/*******/ - -/****f* FAULT/XMLRPC_GetResponseFaultString - * NAME - * XMLRPC_GetResponseFaultString - * SYNOPSIS - * const char* XMLRPC_GetResponseFaultString (XMLRPC_REQUEST response) - * FUNCTION - * returns fault string from a response, if any - * INPUTS - * response XMLRPC_REQUEST. typically of type xmlrpc_request_response. - * RESULT - * fault string, else 0. - * SEE ALSO - * XMLRPC_GetValueFaultString () - * SOURCE - */ -const char* XMLRPC_GetResponseFaultString (XMLRPC_REQUEST response) { - return XMLRPC_GetValueFaultString( XMLRPC_RequestGetData(response) ); -} - -/*******/ - - -/*-****************** -* Utility API funcs * -********************/ - - -/****f* UTILITY/XMLRPC_Free - * NAME - * XMLRPC_Free - * SYNOPSIS - * void XMLRPC_Free(void* mem) - * FUNCTION - * frees a block of memory allocated by xmlrpc. - * INPUTS - * mem memory to free - * RESULT - * void - * NOTES - * Useful for OS's where memory must be free'd - * in the same library in which it is allocated. - * SOURCE - */ -void XMLRPC_Free(void* mem) { - my_free(mem); -} - -/*******/ - - -/****f* UTILITY/XMLRPC_GetVersionString - * NAME - * XMLRPC_GetVersionString - * SYNOPSIS - * const char* XMLRPC_GetVersionString() - * FUNCTION - * returns library version string - * INPUTS - * - * RESULT - * const char* - * NOTES - * SOURCE - */ -const char* XMLRPC_GetVersionString() { - return XMLRPC_VERSION_STR; -} - -/*******/ - - -/*-********************** -* End Utility API funcs * -************************/ diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.h b/ext/xmlrpc/libxmlrpc/xmlrpc.h deleted file mode 100644 index dde3d5e122439..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.h +++ /dev/null @@ -1,454 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -#ifndef XMLRPC_ALREADY_INCLUDED -#define XMLRPC_ALREADY_INCLUDED 1 - -/* includes */ -#include "xml_element.h" -#include /* for time_t */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* allow version to be specified via compile line define */ -#ifndef XMLRPC_LIB_VERSION - #define XMLRPC_LIB_VERSION "0.51" -#endif - -/* this number, representing the date, must be increased each time the API changes */ -#define XMLRPC_API_NO 20020623 - -/* this string should be changed with each packaged release */ -#define XMLRPC_VERSION_STR "xmlrpc-epi v. " XMLRPC_LIB_VERSION - -/* where to find more info. shouldn't need to change much */ -#define XMLRPC_HOME_PAGE_STR "http://xmlprc-epi.sourceforge.net/" - - -/****d* VALUE/XMLRPC_VALUE_TYPE - * NAME - * XMLRPC_VALUE_TYPE - * NOTES - * Defines data types for XMLRPC_VALUE - * Deprecated for public use. See XMLRPC_VALUE_TYPE_EASY - * SEE ALSO - * XMLRPC_VECTOR_TYPE - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -typedef enum _XMLRPC_VALUE_TYPE { - xmlrpc_none, /* not a value */ - xmlrpc_empty, /* empty value, eg NULL */ - xmlrpc_base64, /* base64 value, eg binary data */ - xmlrpc_boolean, /* boolean [0 | 1] */ - xmlrpc_datetime, /* datetime [ISO8601 | time_t] */ - xmlrpc_double, /* double / floating point */ - xmlrpc_int, /* integer */ - xmlrpc_string, /* string */ - xmlrpc_vector /* vector, aka list, array */ -} XMLRPC_VALUE_TYPE; -/*******/ - -/****d* VALUE/XMLRPC_VECTOR_TYPE - * NAME - * XMLRPC_VECTOR_TYPE - * NOTES - * Defines data types for XMLRPC_VECTOR. - * Deprecated for public use. See XMLRPC_VALUE_TYPE_EASY - * SEE ALSO - * XMLRPC_VALUE_TYPE - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -typedef enum _XMLRPC_VECTOR_TYPE { - xmlrpc_vector_none, /* not an array */ - xmlrpc_vector_array, /* no values may have key names */ - xmlrpc_vector_mixed, /* some values may have key names */ - xmlrpc_vector_struct /* all values must have key names */ -} XMLRPC_VECTOR_TYPE; -/*******/ - -/****d* VALUE/XMLRPC_VALUE_TYPE_EASY - * NAME - * XMLRPC_VALUE_TYPE_EASY - * NOTES - * Defines data types for XMLRPC_VALUE, including vector types. - * SEE ALSO - * XMLRPC_VECTOR_TYPE - * XMLRPC_REQUEST_TYPE - * SOURCE - */ -typedef enum _XMLRPC_VALUE_TYPE_EASY { - xmlrpc_type_none, /* not a value */ - xmlrpc_type_empty, /* empty value, eg NULL */ - xmlrpc_type_base64, /* base64 value, eg binary data */ - xmlrpc_type_boolean, /* boolean [0 | 1] */ - xmlrpc_type_datetime, /* datetime [ISO8601 | time_t] */ - xmlrpc_type_double, /* double / floating point */ - xmlrpc_type_int, /* integer */ - xmlrpc_type_string, /* string */ -/* -- IMPORTANT: identical to XMLRPC_VALUE_TYPE to this point. -- */ - xmlrpc_type_array, /* vector array */ - xmlrpc_type_mixed, /* vector mixed */ - xmlrpc_type_struct /* vector struct */ -} XMLRPC_VALUE_TYPE_EASY; -/*******/ - - -/****d* VALUE/XMLRPC_REQUEST_TYPE - * NAME - * XMLRPC_REQUEST_TYPE - * NOTES - * Defines data types for XMLRPC_REQUEST - * SEE ALSO - * XMLRPC_VALUE_TYPE - * XMLRPC_VECTOR_TYPE - * SOURCE - */ -typedef enum _xmlrpc_request_type { - xmlrpc_request_none, /* not a valid request */ - xmlrpc_request_call, /* calling/invoking a method */ - xmlrpc_request_response, /* responding to a method call */ -} XMLRPC_REQUEST_TYPE; -/*******/ - -/****d* VALUE/XMLRPC_ERROR_CODE - * NAME - * XMLRPC_ERROR_CODE - * NOTES - * All existing error codes - * SEE ALSO - * XMLRPC_REQUEST_ERROR - * SOURCE - */ -typedef enum _xmlrpc_error_code { - xmlrpc_error_none = 0, /* not an error */ - xmlrpc_error_parse_xml_syntax = -32700, - xmlrpc_error_parse_unknown_encoding = -32701, - xmlrpc_error_parse_bad_encoding = -32702, - xmlrpc_error_invalid_xmlrpc = -32600, - xmlrpc_error_unknown_method = -32601, - xmlrpc_error_invalid_params = -32602, - xmlrpc_error_internal_server = -32603, - xmlrpc_error_application = -32500, - xmlrpc_error_system = -32400, - xmlrpc_error_transport = -32300 -} XMLRPC_ERROR_CODE; -/******/ - -#define xmlrpc_error_parse_xml_syntax_str "parse error. not well formed." -#define xmlrpc_error_parse_unknown_encoding_str "parse error. unknown encoding" -#define xmlrpc_error_parse_bad_encoding_str "parse error. invalid character for encoding" -#define xmlrpc_error_invalid_xmlrpc_str "server error. xml-rpc not conforming to spec" -#define xmlrpc_error_unknown_method_str "server error. method not found." -#define xmlrpc_error_invalid_params_str "server error. invalid method parameters" -#define xmlrpc_error_internal_server_str "server error. internal xmlrpc library error" -#define xmlrpc_error_application_str "application error." -#define xmlrpc_error_system_str "system error." -#define xmlrpc_error_transport_str "transport error." - - - -/****d* VALUE/XMLRPC_VERSION - * NAME - * XMLRPC_VERSION - * NOTES - * Defines xml vocabulary used for generated xml - * SEE ALSO - * XMLRPC_REQUEST_OUTPUT_OPTIONS - * XMLRPC_REQUEST_To_XML () - * SOURCE - */ -typedef enum _xmlrpc_version { - xmlrpc_version_none = 0, /* not a recognized vocabulary */ - xmlrpc_version_1_0 = 1, /* xmlrpc 1.0 standard vocab */ - xmlrpc_version_simple = 2, /* alt more readable vocab */ - xmlrpc_version_danda = 2, /* same as simple. legacy */ - xmlrpc_version_soap_1_1 = 3 /* SOAP. version 1.1 */ -} XMLRPC_VERSION; -/******/ - -/****s* VALUE/XMLRPC_REQUEST_OUTPUT_OPTIONS - * NAME - * XMLRPC_REQUEST_OUTPUT_OPTIONS - * NOTES - * Defines output options for generated xml - * SEE ALSO - * XMLRPC_VERSION - * XML_ELEM_OUTPUT_OPTIONS - * XMLRPC_REQUEST_To_XML () - * SOURCE - */ -typedef struct _xmlrpc_request_output_options { - STRUCT_XML_ELEM_OUTPUT_OPTIONS xml_elem_opts; /* xml_element specific output options */ - XMLRPC_VERSION version; /* xml vocabulary to use */ -} STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS, *XMLRPC_REQUEST_OUTPUT_OPTIONS; -/******/ - -/****s* VALUE/XMLRPC_REQUEST_INPUT_OPTIONS - * NAME - * XMLRPC_REQUEST_INPUT_OPTIONS - * NOTES - * Defines options for reading in xml data - * SEE ALSO - * XMLRPC_VERSION - * XML_ELEM_INPUT_OPTIONS - * XMLRPC_REQUEST_From_XML () - * SOURCE - */ -typedef struct _xmlrpc_request_input_options { - STRUCT_XML_ELEM_INPUT_OPTIONS xml_elem_opts; /* xml_element specific output options */ -} STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS, *XMLRPC_REQUEST_INPUT_OPTIONS; -/******/ - -/****s* VALUE/XMLRPC_ERROR - * NAME - * XMLRPC_ERROR - * NOTES - * For the reporting and handling of errors - * SOURCE - */ -typedef struct _xmlrpc_error { - XMLRPC_ERROR_CODE code; - STRUCT_XML_ELEM_ERROR xml_elem_error; /* xml_element errors (parser errors) */ -} STRUCT_XMLRPC_ERROR, *XMLRPC_ERROR; -/******/ - - -/****d* VALUE/XMLRPC_CASE_COMPARISON - * NAME - * XMLRPC_CASE_COMPARISON - * NOTES - * Defines case comparison options for XMLRPC_VALUE/VECTOR API's - * SEE ALSO - * XMLRPC_CASE - * XMLRPC_VALUE - * SOURCE - */ -typedef enum _xmlrpc_case_comparison { - xmlrpc_case_insensitive, /* use case-insensitive compare */ - xmlrpc_case_sensitive /* use case-sensitive compare */ -} XMLRPC_CASE_COMPARISON; -/******/ - -/****d* VALUE/XMLRPC_CASE - * NAME - * XMLRPC_CASE - * NOTES - * Defines case behavior when setting IDs in XMLRPC_VALUE API's - * SEE ALSO - * XMLRPC_CASE_COMPARISON - * XMLRPC_VALUE - * SOURCE - */ -typedef enum _xmlrpc_case { - xmlrpc_case_exact, /* leave case alone */ - xmlrpc_case_lower, /* lower-case id */ - xmlrpc_case_upper /* upper-case id */ -} XMLRPC_CASE; -/******/ - -/* if you don't like these defaults, you can set them with XMLRPC_SetDefaultIdCase*() */ -#define XMLRPC_DEFAULT_ID_CASE XMLRPC_GetDefaultIdCase() -#define XMLRPC_DEFAULT_ID_CASE_SENSITIVITY XMLRPC_GetDefaultIdCaseComparison() - -/* opaque (non-public) types. defined locally in xmlrpc.c */ -typedef struct _xmlrpc_request* XMLRPC_REQUEST; -typedef struct _xmlrpc_server* XMLRPC_SERVER; -typedef struct _xmlrpc_value* XMLRPC_VALUE; - -/****d* VALUE/XMLRPC_Callback - * NAME - * XMLRPC_Callback - * NOTES - * Function prototype for user defined method handlers (callbacks). - * SEE ALSO - * XMLRPC_ServerRegisterMethod () - * XMLRPC_ServerCallMethod () - * XMLRPC_REQUEST - * XMLRPC_VALUE - * SOURCE - */ -typedef XMLRPC_VALUE (*XMLRPC_Callback)(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -/******/ - -/* ID Case Defaults */ -XMLRPC_CASE XMLRPC_GetDefaultIdCase(void); -XMLRPC_CASE XMLRPC_SetDefaultIdCase(XMLRPC_CASE id_case); -XMLRPC_CASE_COMPARISON XMLRPC_GetDefaultIdCaseComparison(void); -XMLRPC_CASE_COMPARISON XMLRPC_SetDefaultIdCaseComparison(XMLRPC_CASE_COMPARISON id_case); - -/* Vector manipulation */ -int XMLRPC_VectorSize(XMLRPC_VALUE value); -XMLRPC_VALUE XMLRPC_VectorRewind(XMLRPC_VALUE value); -XMLRPC_VALUE XMLRPC_VectorNext(XMLRPC_VALUE value); -int XMLRPC_SetIsVector(XMLRPC_VALUE value, XMLRPC_VECTOR_TYPE type); -int XMLRPC_AddValueToVector(XMLRPC_VALUE target, XMLRPC_VALUE source); -int XMLRPC_AddValuesToVector(XMLRPC_VALUE target, ...); -int XMLRPC_VectorRemoveValue(XMLRPC_VALUE vector, XMLRPC_VALUE value); -XMLRPC_VALUE XMLRPC_VectorGetValueWithID_Case(XMLRPC_VALUE vector, const char* id, XMLRPC_CASE_COMPARISON id_case); - - -/* Create values */ -XMLRPC_VALUE XMLRPC_CreateValueBoolean(const char* id, int truth); -XMLRPC_VALUE XMLRPC_CreateValueBase64(const char* id, const char* s, int len); -XMLRPC_VALUE XMLRPC_CreateValueDateTime(const char* id, time_t time); -XMLRPC_VALUE XMLRPC_CreateValueDateTime_ISO8601(const char* id, const char *s); -XMLRPC_VALUE XMLRPC_CreateValueDouble(const char* id, double f); -XMLRPC_VALUE XMLRPC_CreateValueInt(const char* id, int i); -XMLRPC_VALUE XMLRPC_CreateValueString(const char* id, const char* s, int len); -XMLRPC_VALUE XMLRPC_CreateValueEmpty(void); -XMLRPC_VALUE XMLRPC_CreateVector(const char* id, XMLRPC_VECTOR_TYPE type); - -/* Cleanup values */ -void XMLRPC_CleanupValue(XMLRPC_VALUE value); - -/* Request error */ -XMLRPC_VALUE XMLRPC_RequestSetError (XMLRPC_REQUEST request, XMLRPC_VALUE error); -XMLRPC_VALUE XMLRPC_RequestGetError (XMLRPC_REQUEST request); - -/* Copy values */ -XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value); -XMLRPC_VALUE XMLRPC_DupValueNew(XMLRPC_VALUE xSource); - -/* Set Values */ -void XMLRPC_SetValueDateTime(XMLRPC_VALUE value, time_t time); -void XMLRPC_SetValueDateTime_ISO8601(XMLRPC_VALUE value, const char* s); -void XMLRPC_SetValueDouble(XMLRPC_VALUE value, double val); -void XMLRPC_SetValueInt(XMLRPC_VALUE value, int val); -void XMLRPC_SetValueBoolean(XMLRPC_VALUE value, int val); -const char *XMLRPC_SetValueString(XMLRPC_VALUE value, const char* s, int len); -void XMLRPC_SetValueBase64(XMLRPC_VALUE value, const char* s, int len); -const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, XMLRPC_CASE id_case); -#define XMLRPC_SetValueID(value, id, len) XMLRPC_SetValueID_Case(value, id, len, XMLRPC_DEFAULT_ID_CASE) - -/* Get Values */ -const char* XMLRPC_GetValueString(XMLRPC_VALUE value); -int XMLRPC_GetValueStringLen(XMLRPC_VALUE value); -int XMLRPC_GetValueInt(XMLRPC_VALUE value); -int XMLRPC_GetValueBoolean(XMLRPC_VALUE value); -double XMLRPC_GetValueDouble(XMLRPC_VALUE value); -const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value); -time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value); -const char* XMLRPC_GetValueDateTime_ISO8601(XMLRPC_VALUE value); -const char* XMLRPC_GetValueID(XMLRPC_VALUE value); - -/* Type introspection */ -XMLRPC_VALUE_TYPE XMLRPC_GetValueType(XMLRPC_VALUE v); -XMLRPC_VALUE_TYPE_EASY XMLRPC_GetValueTypeEasy(XMLRPC_VALUE v); -XMLRPC_VECTOR_TYPE XMLRPC_GetVectorType(XMLRPC_VALUE v); - -/* Parsing and Creating XML */ -XMLRPC_REQUEST XMLRPC_REQUEST_FromXML(const char* in_buf, int len, XMLRPC_REQUEST_INPUT_OPTIONS in_options); -XMLRPC_VALUE XMLRPC_VALUE_FromXML(const char* in_buf, int len, XMLRPC_REQUEST_INPUT_OPTIONS in_options); -char* XMLRPC_REQUEST_ToXML(XMLRPC_REQUEST request, int *buf_len); -char* XMLRPC_VALUE_ToXML(XMLRPC_VALUE val, int* buf_len); - -/* Request manipulation funcs */ -const char* XMLRPC_RequestSetMethodName(XMLRPC_REQUEST request, const char* methodName); -const char* XMLRPC_RequestGetMethodName(XMLRPC_REQUEST request); -XMLRPC_REQUEST XMLRPC_RequestNew(void); -void XMLRPC_RequestFree(XMLRPC_REQUEST request, int bFreeIO); -XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestSetOutputOptions(XMLRPC_REQUEST request, XMLRPC_REQUEST_OUTPUT_OPTIONS output); -XMLRPC_REQUEST_OUTPUT_OPTIONS XMLRPC_RequestGetOutputOptions(XMLRPC_REQUEST request); -XMLRPC_VALUE XMLRPC_RequestSetData(XMLRPC_REQUEST request, XMLRPC_VALUE data); -XMLRPC_VALUE XMLRPC_RequestGetData(XMLRPC_REQUEST request); -XMLRPC_REQUEST_TYPE XMLRPC_RequestSetRequestType(XMLRPC_REQUEST request, XMLRPC_REQUEST_TYPE type); -XMLRPC_REQUEST_TYPE XMLRPC_RequestGetRequestType(XMLRPC_REQUEST request); - -/* Server Creation/Destruction; Method Registration and Invocation */ -XMLRPC_SERVER XMLRPC_ServerCreate(void); -XMLRPC_SERVER XMLRPC_GetGlobalServer(void); /* better to use XMLRPC_ServerCreate if you can */ -void XMLRPC_ServerDestroy(XMLRPC_SERVER server); -int XMLRPC_ServerRegisterMethod(XMLRPC_SERVER server, const char *name, XMLRPC_Callback cb); -XMLRPC_Callback XMLRPC_ServerFindMethod(XMLRPC_SERVER server, const char* callName); -XMLRPC_VALUE XMLRPC_ServerCallMethod(XMLRPC_SERVER server, XMLRPC_REQUEST request, void* userData); - -#include "xmlrpc_introspection.h" - -/* Fault interrogation funcs */ -int XMLRPC_ValueIsFault (XMLRPC_VALUE value); -int XMLRPC_ResponseIsFault(XMLRPC_REQUEST response); -int XMLRPC_GetValueFaultCode (XMLRPC_VALUE value); -int XMLRPC_GetResponseFaultCode(XMLRPC_REQUEST response); -const char* XMLRPC_GetValueFaultString (XMLRPC_VALUE value); -const char* XMLRPC_GetResponseFaultString (XMLRPC_REQUEST response); - - -/* Public Utility funcs */ -XMLRPC_VALUE XMLRPC_UtilityCreateFault(int fault_code, const char* fault_string); -void XMLRPC_Free(void* mem); -const char* XMLRPC_GetVersionString(void); - -/****d* VALUE/XMLRPC_MACROS - * NAME - * Some Helpful Macros - * NOTES - * Some macros for making life easier. Should be self-explanatory. - * SEE ALSO - * XMLRPC_AddValueToVector () - * XMLRPC_VectorGetValueWithID_Case () - * XMLRPC_VALUE - * SOURCE - */ - -/* Append values to vector */ -#define XMLRPC_VectorAppendString(vector, id, s, len) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueString(id, s, len)) -#define XMLRPC_VectorAppendBase64(vector, id, s, len) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueBase64(id, s, len)) -#define XMLRPC_VectorAppendDateTime(vector, id, time) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueDateTime(id, time)) -#define XMLRPC_VectorAppendDateTime_ISO8601(vector, id, s) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueDateTime_ISO8601(id, s)) -#define XMLRPC_VectorAppendDouble(vector, id, f) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueDouble(id, f)) -#define XMLRPC_VectorAppendInt(vector, id, i) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueInt(id, i)) -#define XMLRPC_VectorAppendBoolean(vector, id, i) XMLRPC_AddValueToVector(vector, XMLRPC_CreateValueBoolean(id, i)) - -/* Get named values from vector */ -#define XMLRPC_VectorGetValueWithID(vector, id) XMLRPC_VectorGetValueWithID_Case(vector, id, XMLRPC_DEFAULT_ID_CASE_SENSITIVITY) -#define XMLRPC_VectorGetStringWithID(vector, id) XMLRPC_GetValueString(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetBase64WithID(vector, id) XMLRPC_GetValueBase64(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetDateTimeWithID(vector, id) XMLRPC_GetValueDateTime(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetDoubleWithID(vector, id) XMLRPC_GetValueDouble(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetIntWithID(vector, id) XMLRPC_GetValueInt(XMLRPC_VectorGetValueWithID(vector, id)) -#define XMLRPC_VectorGetBooleanWithID(vector, id) XMLRPC_GetValueBoolean(XMLRPC_VectorGetValueWithID(vector, id)) - -/******/ - - -#ifdef __cplusplus -} -#endif - -#endif /* not XMLRPC_ALREADY_INCLUDED */ - - - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.m4 b/ext/xmlrpc/libxmlrpc/xmlrpc.m4 deleted file mode 100644 index 87da92db8a678..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.m4 +++ /dev/null @@ -1,12 +0,0 @@ -AC_DEFUN([XMLRPC_CHECKS],[ - -AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_PROG_LN_S]) -AC_REQUIRE([AC_PROG_RANLIB]) - -AC_DEFINE(UNDEF_THREADS_HACK,,[ ]) - -XMLRPC_HEADER_CHECKS -XMLRPC_TYPE_CHECKS -XMLRPC_FUNCTION_CHECKS -]) diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c b/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c deleted file mode 100644 index 9964d839f3024..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c +++ /dev/null @@ -1,604 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - - -/****h* ABOUT/xmlrpc_introspection - * AUTHOR - * Dan Libby, aka danda (dan@libby.com) - * HISTORY - * $Log$ - * Revision 1.4 2003/12/16 21:00:21 sniper - * Fix some compile warnings (patch by Joe Orton) - * - * Revision 1.3 2002/07/05 04:43:53 danda - * merged in updates from SF project. bring php repository up to date with xmlrpc-epi version 0.51 - * - * Revision 1.9 2001/09/29 21:58:05 danda - * adding cvs log to history section - * - * 4/10/2001 -- danda -- initial introspection support - * TODO - * NOTES - *******/ - - -#ifdef _WIN32 -#include "xmlrpc_win32.h" -#endif -#include "queue.h" -#include "xmlrpc.h" -#include "xmlrpc_private.h" -#include "xmlrpc_introspection_private.h" -#include -#include -#include - - -/* forward declarations for static (non public, non api) funcs */ -static XMLRPC_VALUE xi_system_describe_methods_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -static XMLRPC_VALUE xi_system_list_methods_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -static XMLRPC_VALUE xi_system_method_signature_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); -static XMLRPC_VALUE xi_system_method_help_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData); - - -/*-********************************** -* Introspection Callbacks (methods) * -************************************/ - -/* iterates through a list of structs and finds the one with key "name" matching - * needle. slow, would benefit from a struct key hash. - */ -static inline XMLRPC_VALUE find_named_value(XMLRPC_VALUE list, const char* needle) { - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(list); - while(xIter) { - const char* name = XMLRPC_VectorGetStringWithID(xIter, xi_token_name); - if(name && !strcmp(name, needle)) { - return xIter; - } - xIter = XMLRPC_VectorNext(list); - } - return NULL; -} - - -/* iterates through docs callbacks and calls any that have not yet been called */ -static void check_docs_loaded(XMLRPC_SERVER server, void* userData) { - if(server) { - q_iter qi = Q_Iter_Head_F(&server->docslist); - while( qi ) { - doc_method* dm = Q_Iter_Get_F(qi); - if(dm && !dm->b_called) { - dm->method(server, userData); - dm->b_called = 1; - } - qi = Q_Iter_Next_F(qi); - } - } -} - - -/* utility function for xi_system_describe_methods_cb */ -static inline void describe_method(XMLRPC_SERVER server, XMLRPC_VALUE vector, const char* method) { - if(method) { - server_method* sm = find_method(server, method); - if(sm) { - XMLRPC_AddValueToVector(vector, sm->desc); - } - } -} - - - -/* system.describeMethods() callback */ -static XMLRPC_VALUE xi_system_describe_methods_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - XMLRPC_VALUE xParams = XMLRPC_VectorRewind(XMLRPC_RequestGetData(input)); - XMLRPC_VALUE xResponse = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - XMLRPC_VALUE xMethodList = XMLRPC_CreateVector("methodList", xmlrpc_vector_array); - XMLRPC_VALUE xTypeList = NULL; - int bAll = 1; - - /* lazy loading of introspection data */ - check_docs_loaded(server, userData); - - xTypeList = XMLRPC_VectorGetValueWithID(server->xIntrospection, "typeList"); - - XMLRPC_AddValueToVector(xResponse, xTypeList); - XMLRPC_AddValueToVector(xResponse, xMethodList); - - /* check if we have any param */ - if(xParams) { - /* check if string or vector (1 or n) */ - XMLRPC_VALUE_TYPE type = XMLRPC_GetValueType(xParams); - if(type == xmlrpc_string) { - /* just one. spit it out. */ - describe_method(server, xMethodList, XMLRPC_GetValueString(xParams)); - bAll = 0; - } - else if(type == xmlrpc_vector) { - /* multiple. spit all out */ - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(xParams); - while(xIter) { - describe_method(server, xMethodList, XMLRPC_GetValueString(xIter)); - xIter = XMLRPC_VectorNext(xParams); - } - bAll = 0; - } - } - - /* otherwise, default to sending all methods */ - if(bAll) { - q_iter qi = Q_Iter_Head_F(&server->methodlist); - while( qi ) { - server_method* sm = Q_Iter_Get_F(qi); - if(sm) { - XMLRPC_AddValueToVector(xMethodList, sm->desc); - } - qi = Q_Iter_Next_F(qi); - } - } - - return xResponse; -} - -/* this complies with system.listMethods as defined at http://xmlrpc.usefulinc.com/doc/reserved.html */ -static XMLRPC_VALUE xi_system_list_methods_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - XMLRPC_VALUE xResponse = XMLRPC_CreateVector(NULL, xmlrpc_vector_array); - - q_iter qi = Q_Iter_Head_F(&server->methodlist); - while( qi ) { - server_method* sm = Q_Iter_Get_F(qi); - if(sm) { - XMLRPC_VectorAppendString(xResponse, 0, sm->name, 0); - } - qi = Q_Iter_Next_F(qi); - } - return xResponse; -} - -/* this complies with system.methodSignature as defined at - * http://xmlrpc.usefulinc.com/doc/sysmethodsig.html - */ -static XMLRPC_VALUE xi_system_method_signature_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - const char* method = XMLRPC_GetValueString(XMLRPC_VectorRewind(XMLRPC_RequestGetData(input))); - XMLRPC_VALUE xResponse = NULL; - - /* lazy loading of introspection data */ - check_docs_loaded(server, userData); - - if(method) { - server_method* sm = find_method(server, method); - if(sm && sm->desc) { - XMLRPC_VALUE xTypesArray = XMLRPC_CreateVector(NULL, xmlrpc_vector_array); - XMLRPC_VALUE xIter, xParams, xSig, xSigIter; - const char* type; - - /* array of possible signatures. */ - xResponse = XMLRPC_CreateVector(NULL, xmlrpc_vector_array); - - /* find first signature */ - xSig = XMLRPC_VectorGetValueWithID(sm->desc, xi_token_signatures); - xSigIter = XMLRPC_VectorRewind( xSig ); - - /* iterate through sigs */ - while(xSigIter) { - /* first type is the return value */ - type = XMLRPC_VectorGetStringWithID(XMLRPC_VectorRewind( - XMLRPC_VectorGetValueWithID(xSigIter, xi_token_returns)), - xi_token_type); - XMLRPC_AddValueToVector(xTypesArray, - XMLRPC_CreateValueString(NULL, - type ? type : type_to_str(xmlrpc_none, 0), - 0)); - - /* the rest are parameters */ - xParams = XMLRPC_VectorGetValueWithID(xSigIter, xi_token_params); - xIter = XMLRPC_VectorRewind(xParams); - - /* iter through params, adding to types array */ - while(xIter) { - XMLRPC_AddValueToVector(xTypesArray, - XMLRPC_CreateValueString(NULL, - XMLRPC_VectorGetStringWithID(xIter, xi_token_type), - 0)); - xIter = XMLRPC_VectorNext(xParams); - } - - /* add types for this signature */ - XMLRPC_AddValueToVector(xResponse, xTypesArray); - - xSigIter = XMLRPC_VectorNext( xSig ); - } - } - } - - return xResponse; -} - -/* this complies with system.methodHelp as defined at - * http://xmlrpc.usefulinc.com/doc/sysmethhelp.html - */ -static XMLRPC_VALUE xi_system_method_help_cb(XMLRPC_SERVER server, XMLRPC_REQUEST input, void* userData) { - const char* method = XMLRPC_GetValueString(XMLRPC_VectorRewind(XMLRPC_RequestGetData(input))); - XMLRPC_VALUE xResponse = NULL; - - /* lazy loading of introspection data */ - check_docs_loaded(server, userData); - - if(method) { - server_method* sm = find_method(server, method); - if(sm && sm->desc) { - const char* help = XMLRPC_VectorGetStringWithID(sm->desc, xi_token_purpose); - - /* returns a documentation string, or empty string */ - xResponse = XMLRPC_CreateValueString(NULL, help ? help : xi_token_empty, 0); - } - } - - return xResponse; -} - -/*-************************************** -* End Introspection Callbacks (methods) * -****************************************/ - - -/*-************************ -* Introspection Utilities * -**************************/ - -/* performs registration of introspection methods */ -void xi_register_system_methods(XMLRPC_SERVER server) { - XMLRPC_ServerRegisterMethod(server, xi_token_system_list_methods, xi_system_list_methods_cb); - XMLRPC_ServerRegisterMethod(server, xi_token_system_method_help, xi_system_method_help_cb); - XMLRPC_ServerRegisterMethod(server, xi_token_system_method_signature, xi_system_method_signature_cb); - XMLRPC_ServerRegisterMethod(server, xi_token_system_describe_methods, xi_system_describe_methods_cb); -} - -/* describe a value (param, return, type) */ -static XMLRPC_VALUE describeValue_worker(const char* type, const char* id, const char* desc, int optional, const char* default_val, XMLRPC_VALUE sub_params) { - XMLRPC_VALUE xParam = NULL; - if(id || desc) { - xParam = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - XMLRPC_VectorAppendString(xParam, xi_token_name, id, 0); - XMLRPC_VectorAppendString(xParam, xi_token_type, type, 0); - XMLRPC_VectorAppendString(xParam, xi_token_description, desc, 0); - if(optional != 2) { - XMLRPC_VectorAppendInt(xParam, xi_token_optional, optional); - } - if(optional == 1 && default_val) { - XMLRPC_VectorAppendString(xParam, xi_token_default, default_val, 0); - } - XMLRPC_AddValueToVector(xParam, sub_params); - } - return xParam; -} - - -/* convert an xml tree conforming to spec to XMLRPC_VALUE - * suitable for use with XMLRPC_ServerAddIntrospectionData - */ -XMLRPC_VALUE xml_element_to_method_description(xml_element* el, XMLRPC_ERROR err) { - XMLRPC_VALUE xReturn = NULL; - - if(el->name) { - const char* name = NULL; - const char* type = NULL; - const char* basetype = NULL; - const char* desc = NULL; - const char* def = NULL; - int optional = 0; - xml_element_attr* attr_iter = Q_Head(&el->attrs); - - /* grab element attributes up front to save redundant while loops */ - while(attr_iter) { - if(!strcmp(attr_iter->key, "name")) { - name = attr_iter->val; - } - else if(!strcmp(attr_iter->key, "type")) { - type = attr_iter->val; - } - else if(!strcmp(attr_iter->key, "basetype")) { - basetype = attr_iter->val; - } - else if(!strcmp(attr_iter->key, "desc")) { - desc = attr_iter->val; - } - else if(!strcmp(attr_iter->key, "optional")) { - if(attr_iter->val && !strcmp(attr_iter->val, "yes")) { - optional = 1; - } - } - else if(!strcmp(attr_iter->key, "default")) { - def = attr_iter->val; - } - attr_iter = Q_Next(&el->attrs); - } - - /* value and typeDescription behave about the same */ - if(!strcmp(el->name, "value") || !strcmp(el->name, "typeDescription")) { - XMLRPC_VALUE xSubList = NULL; - const char* ptype = !strcmp(el->name, "value") ? type : basetype; - if(ptype) { - if(Q_Size(&el->children) && - (!strcmp(ptype, "array") || !strcmp(ptype, "struct") || !strcmp(ptype, "mixed"))) { - xSubList = XMLRPC_CreateVector("member", xmlrpc_vector_array); - - if(xSubList) { - xml_element* elem_iter = Q_Head(&el->children); - while(elem_iter) { - XMLRPC_AddValueToVector(xSubList, - xml_element_to_method_description(elem_iter, err)); - elem_iter = Q_Next(&el->children); - } - } - } - xReturn = describeValue_worker(ptype, name, (desc ? desc : (xSubList ? NULL : el->text.str)), optional, def, xSubList); - } - } - - /* these three kids are about equivalent */ - else if(!strcmp(el->name, "params") || - !strcmp(el->name, "returns") || - !strcmp(el->name, "signature")) { - if(Q_Size(&el->children)) { - xml_element* elem_iter = Q_Head(&el->children); - xReturn = XMLRPC_CreateVector(!strcmp(el->name, "signature") ? NULL : el->name, xmlrpc_vector_struct); - - - while(elem_iter) { - XMLRPC_AddValueToVector(xReturn, - xml_element_to_method_description(elem_iter, err)); - elem_iter = Q_Next(&el->children); - } - } - } - - - else if(!strcmp(el->name, "methodDescription")) { - xml_element* elem_iter = Q_Head(&el->children); - xReturn = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - - XMLRPC_VectorAppendString(xReturn, xi_token_name, name, 0); - - while(elem_iter) { - XMLRPC_AddValueToVector(xReturn, - xml_element_to_method_description(elem_iter, err)); - elem_iter = Q_Next(&el->children); - } - } - - /* items are slightly special */ - else if(!strcmp(el->name, "item")) { - xReturn = XMLRPC_CreateValueString(name, el->text.str, el->text.len); - } - - /* sure. we'll let any ol element with children through */ - else if(Q_Size(&el->children)) { - xml_element* elem_iter = Q_Head(&el->children); - xReturn = XMLRPC_CreateVector(el->name, xmlrpc_vector_mixed); - - while(elem_iter) { - XMLRPC_AddValueToVector(xReturn, - xml_element_to_method_description(elem_iter, err)); - elem_iter = Q_Next(&el->children); - } - } - - /* or anything at all really, so long as its got some text. - * no reason being all snotty about a spec, right? - */ - else if(el->name && el->text.len) { - xReturn = XMLRPC_CreateValueString(el->name, el->text.str, el->text.len); - } - } - - return xReturn; -} - -/*-**************************** -* End Introspection Utilities * -******************************/ - - - -/*-****************** -* Introspection API * -********************/ - - -/****f* VALUE/XMLRPC_IntrospectionCreateDescription - * NAME - * XMLRPC_IntrospectionCreateDescription - * SYNOPSIS - * XMLRPC_VALUE XMLRPC_IntrospectionCreateDescription(const char* xml, XMLRPC_ERROR err) - * FUNCTION - * converts raw xml describing types and methods into an - * XMLRPC_VALUE suitable for use with XMLRPC_ServerAddIntrospectionData() - * INPUTS - * xml - xml data conforming to introspection spec at - * err - optional pointer to error struct. filled in if error occurs and not NULL. - * RESULT - * XMLRPC_VALUE - newly created value, or NULL if fatal error. - * BUGS - * Currently does little or no validation of xml. - * Only parse errors are currently reported in err, not structural errors. - * SEE ALSO - * XMLRPC_ServerAddIntrospectionData () - * SOURCE - */ -XMLRPC_VALUE XMLRPC_IntrospectionCreateDescription(const char* xml, XMLRPC_ERROR err) { - XMLRPC_VALUE xReturn = NULL; - xml_element* root = xml_elem_parse_buf(xml, 0, 0, err ? &err->xml_elem_error : NULL); - - if(root) { - xReturn = xml_element_to_method_description(root, err); - - xml_elem_free(root); - } - - return xReturn; - -} -/*******/ - - -/****f* SERVER/XMLRPC_ServerAddIntrospectionData - * NAME - * XMLRPC_ServerAddIntrospectionData - * SYNOPSIS - * int XMLRPC_ServerAddIntrospectionData(XMLRPC_SERVER server, XMLRPC_VALUE desc) - * FUNCTION - * updates server with additional introspection data - * INPUTS - * server - target server - * desc - introspection data, should be a struct generated by - * XMLRPC_IntrospectionCreateDescription () - * RESULT - * int - 1 if success, else 0 - * NOTES - * - function will fail if neither typeList nor methodList key is present in struct. - * - if method or type already exists, it will be replaced. - * - desc is never freed by the server. caller is responsible for cleanup. - * BUGS - * - horribly slow lookups. prime candidate for hash improvements. - * - uglier and more complex than I like to see for API functions. - * SEE ALSO - * XMLRPC_ServerAddIntrospectionData () - * XMLRPC_ServerRegisterIntrospectionCallback () - * XMLRPC_CleanupValue () - * SOURCE - */ -int XMLRPC_ServerAddIntrospectionData(XMLRPC_SERVER server, XMLRPC_VALUE desc) { - int bSuccess = 0; - if(server && desc) { - XMLRPC_VALUE xNewTypes = XMLRPC_VectorGetValueWithID(desc, "typeList"); - XMLRPC_VALUE xNewMethods = XMLRPC_VectorGetValueWithID(desc, "methodList"); - XMLRPC_VALUE xServerTypes = XMLRPC_VectorGetValueWithID(server->xIntrospection, "typeList"); - - if(xNewMethods) { - XMLRPC_VALUE xMethod = XMLRPC_VectorRewind(xNewMethods); - - while(xMethod) { - const char* name = XMLRPC_VectorGetStringWithID(xMethod, xi_token_name); - server_method* sm = find_method(server, name); - - if(sm) { - if(sm->desc) { - XMLRPC_CleanupValue(sm->desc); - } - sm->desc = XMLRPC_CopyValue(xMethod); - bSuccess = 1; - } - - xMethod = XMLRPC_VectorNext(xNewMethods); - } - } - if(xNewTypes) { - if(!xServerTypes) { - if(!server->xIntrospection) { - server->xIntrospection = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); - } - - XMLRPC_AddValueToVector(server->xIntrospection, xNewTypes); - bSuccess = 1; - } - else { - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(xNewTypes); - while(xIter) { - /* get rid of old values */ - XMLRPC_VALUE xPrev = find_named_value(xServerTypes, XMLRPC_VectorGetStringWithID(xIter, xi_token_name)); - if(xPrev) { - XMLRPC_VectorRemoveValue(xServerTypes, xPrev); - } - XMLRPC_AddValueToVector(xServerTypes, xIter); - bSuccess = 1; - xIter = XMLRPC_VectorNext(xNewTypes); - } - } - } - } - return bSuccess; -} -/*******/ - - -/****f* SERVER/XMLRPC_ServerRegisterIntrospectionCallback - * NAME - * XMLRPC_ServerRegisterIntrospectionCallback - * SYNOPSIS - * int XMLRPC_ServerRegisterIntrospectionCallback(XMLRPC_SERVER server, XMLRPC_IntrospectionCallback cb) - * FUNCTION - * registers a callback for lazy generation of introspection data - * INPUTS - * server - target server - * cb - callback that will generate introspection data - * RESULT - * int - 1 if success, else 0 - * NOTES - * parsing xml and generating introspection data is fairly expensive, thus a - * server may wish to wait until this data is actually requested before generating - * it. Any number of callbacks may be registered at any time. A given callback - * will only ever be called once, the first time an introspection request is - * processed after the time of callback registration. - * SEE ALSO - * XMLRPC_ServerAddIntrospectionData () - * XMLRPC_IntrospectionCreateDescription () - * SOURCE - */ -int XMLRPC_ServerRegisterIntrospectionCallback(XMLRPC_SERVER server, XMLRPC_IntrospectionCallback cb) { - int bSuccess = 0; - if(server && cb) { - - doc_method* dm = calloc(1, sizeof(doc_method)); - - if(dm) { - dm->method = cb; - dm->b_called = 0; - - if(Q_PushTail(&server->docslist, dm)) { - bSuccess = 1; - } - else { - my_free(dm); - } - } - } - return 0; -} -/*******/ - -/*-********************** -* End Introspection API * -************************/ - - - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.h b/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.h deleted file mode 100644 index 656e441b96bfb..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* IMPORTANT! - * - * only public (official API) things should be in this file. Anything else - * should go in _private.h, or in the appropriate .c file. - */ - - -#ifndef __XI_INTROSPECTION_H -/* - * Avoid include redundancy. - */ -#define __XI_INTROSPECTION_H - -/*---------------------------------------------------------------------------- - * xmlrpc_introspection.h - * - * Purpose: - * define public introspection API - * Comments: - */ - -/*---------------------------------------------------------------------------- - * Constants - */ - #define xi_token_params "params" - #define xi_token_returns "returns" - #define xi_token_related "related" - #define xi_token_sub "sub" - - -/*---------------------------------------------------------------------------- - * Includes - */ - -/*---------------------------------------------------------------------------- - * Structures - */ - - /****d* VALUE/XMLRPC_IntrospectionCallback - * NAME - * XMLRPC_IntrospectionCallback - * NOTES - * Function prototype for lazy documentation generation (not generated until requested). - * SOURCE - */ -typedef void (*XMLRPC_IntrospectionCallback)(XMLRPC_SERVER server, void* userData); -/******/ - - -/*---------------------------------------------------------------------------- - * Globals - */ - -/*---------------------------------------------------------------------------- - * Functions - */ -XMLRPC_VALUE XMLRPC_IntrospectionCreateDescription(const char* xml, XMLRPC_ERROR error); -int XMLRPC_ServerAddIntrospectionData(XMLRPC_SERVER server, XMLRPC_VALUE desc); -int XMLRPC_ServerRegisterIntrospectionCallback(XMLRPC_SERVER server, XMLRPC_IntrospectionCallback cb); - -/*---------------------------------------------------------------------------- - * Macros - */ - - -#endif /* __XI_INTROSPECTION_H */ - - - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection_private.h b/ext/xmlrpc/libxmlrpc/xmlrpc_introspection_private.h deleted file mode 100644 index 7b97fa7ed7cb7..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_introspection_private.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Dan Libby, Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* IMPORTANT! - * - * only non-public things should be in this file. It is fine for any .c file - * in xmlrpc/src to include it, but users of the public API should never - * include it, and thus *.h files that are part of the public API should - * never include it, or they would break if this file is not present. - */ - - -#ifndef __XI_INTROSPECTION_PRIVATE_H -/* - * Avoid include redundancy. - */ -#define __XI_INTROSPECTION_PRIVATE_H - -/*---------------------------------------------------------------------------- - * xmlrpc_introspection_private.h - * - * Purpose: - * define non-public introspection routines - * Comments: - */ - -/*---------------------------------------------------------------------------- - * Constants - */ -#define xi_token_default "default" -#define xi_token_description "description" -#define xi_token_name "name" -#define xi_token_optional "optional" -#define xi_token_params "params" -#define xi_token_purpose "purpose" -#define xi_token_returns "returns" -#define xi_token_signatures "signatures" -#define xi_token_type "type" -#define xi_token_version "version" -#define xi_token_empty "" -#define xi_token_system_describe_methods "system.describeMethods" -#define xi_token_system_list_methods "system.listMethods" -#define xi_token_system_method_help "system.methodHelp" -#define xi_token_system_method_signature "system.methodSignature" - - -/*---------------------------------------------------------------------------- - * Includes - */ - -/*---------------------------------------------------------------------------- - * Structures - */ -typedef struct _doc_method { - XMLRPC_IntrospectionCallback method; - int b_called; -} doc_method; - -/*---------------------------------------------------------------------------- - * Globals - */ - -/*---------------------------------------------------------------------------- - * Functions - */ -void xi_register_system_methods(XMLRPC_SERVER server); - -/*---------------------------------------------------------------------------- - * Macros - */ - - -#endif /* __XI_INTROSPECTION_PRIVATE_H */ - - - - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_private.h b/ext/xmlrpc/libxmlrpc/xmlrpc_private.h deleted file mode 100644 index 65c6b136a6948..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_private.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - This file is part of libXMLRPC - a C library for xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2000 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* only non-public things should be in this file. It is fine for any .c file - * in xmlrpc/src to include it, but users of the public API should never - * include it, and thus *.h files that are part of the public API should - * never include it, or they would break if this file is not present. - */ - -#ifndef XMLRPC_PRIVATE_ALREADY_INCLUDED -/* - * Avoid include redundancy. - */ -#define XMLRPC_PRIVATE_ALREADY_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - - -/*---------------------------------------------------------------------------- - * xmlrpc_private.h - * - * Purpose: - * define non-public intra-library routines & data - * Comments: - */ - -/*---------------------------------------------------------------------------- - * Constants - */ - - -/*---------------------------------------------------------------------------- - * Includes - */ - -/*---------------------------------------------------------------------------- - * Structures - */ - -/* Some of these are typedef'd in xmlrpc.h for public use */ - -typedef struct _xmlrpc_vector* XMLRPC_VECTOR; - -/****s* VALUE/XMLRPC_VALUE - * NAME - * XMLRPC_VALUE - * NOTES - * A value of variable data type. The most important object in this API. :) - * - * This struct is opaque to callers and should be accessed only via accessor functions. - * SEE ALSO - * XMLRPC_REQUEST - * XMLRPC_CreateValueEmpty () - * XMLRPC_CleanupValue () - * SOURCE - */ -typedef struct _xmlrpc_value { - XMLRPC_VALUE_TYPE type; /* data type of this value */ - XMLRPC_VECTOR v; /* vector type specific info */ - simplestring str; /* string value buffer */ - simplestring id; /* id of this value. possibly empty. */ - int i; /* integer value. */ - double d; /* double value */ - int iRefCount; /* So we know when we can delete the value . */ -} STRUCT_XMLRPC_VALUE; -/******/ - -/****s* VALUE/XMLRPC_REQUEST - * NAME - * XMLRPC_REQUEST - * NOTES - * Internal representation of an XML request. - * - * This struct is opaque to callers and should be accessed only via accessor functions. - * - * SEE ALSO - * XMLRPC_VALUE - * XMLRPC_RequestNew () - * XMLRPC_RequestFree () - * SOURCE - */ -typedef struct _xmlrpc_request { - XMLRPC_VALUE io; /* data associated with this request */ - simplestring methodName; /* name of method being called */ - XMLRPC_REQUEST_TYPE request_type; /* type of request */ - STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS output; /* xml output options */ - XMLRPC_VALUE error; /* error codes */ -} STRUCT_XMLRPC_REQUEST; -/******/ - -/* Vector type. Used by XMLRPC_VALUE. Never visible to users of the API. */ -typedef struct _xmlrpc_vector { - XMLRPC_VECTOR_TYPE type; /* vector type */ - queue *q; /* list of child values */ -} STRUCT_XMLRPC_VECTOR; -/******/ - -/****s* VALUE/XMLRPC_SERVER - * NAME - * XMLRPC_SERVER - * NOTES - * internal representation of an xmlrpc server - * - * This struct is opaque to callers and should be accessed only via accessor functions. - * - * SEE ALSO - * XMLRPC_ServerCreate () - * XMLRPC_ServerDestroy () - * SOURCE - */ -typedef struct _xmlrpc_server { - queue methodlist; /* list of callback methods */ - queue docslist; /* list of introspection callbacks */ - XMLRPC_VALUE xIntrospection; -} STRUCT_XMLRPC_SERVER; -/******/ - -typedef struct _server_method { - char* name; - XMLRPC_VALUE desc; - XMLRPC_Callback method; -} server_method; - - -/*---------------------------------------------------------------------------- - * Globals - */ - -/*---------------------------------------------------------------------------- - * Functions - */ -server_method* find_method(XMLRPC_SERVER server, const char* name); -const char* type_to_str(XMLRPC_VALUE_TYPE type, XMLRPC_VECTOR_TYPE vtype); - -/*---------------------------------------------------------------------------- - * Macros - */ -#define my_free(thing) if(thing) {free(thing); thing = 0;} - - -#ifdef __cplusplus -} -#endif - - -#endif /* XMLRPC_PRIVATE_ALREADY_INCLUDED */ - diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc_win32.h b/ext/xmlrpc/libxmlrpc/xmlrpc_win32.h deleted file mode 100644 index 58c54bbb80931..0000000000000 --- a/ext/xmlrpc/libxmlrpc/xmlrpc_win32.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _XMLRPC_WIN32_H -#define _XMLRPC_WIN32_H -/* just some things needed to compile win32 */ -#include -#include -#define inline __inline -#define snprintf _snprintf -#define strcasecmp(s1, s2) stricmp(s1, s2) - - -#endif \ No newline at end of file diff --git a/ext/xmlrpc/php_xmlrpc.h b/ext/xmlrpc/php_xmlrpc.h deleted file mode 100644 index 8650437e35c8c..0000000000000 --- a/ext/xmlrpc/php_xmlrpc.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - This file is part of, or distributed with, libXMLRPC - a C library for - xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* auto-generated portions of this file are also subject to the php license */ - -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Dan Libby | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef _PHP_XMLRPC_H -#define _PHP_XMLRPC_H - -#if 1 /* HAVE_XMLRPC */ - -extern zend_module_entry xmlrpc_module_entry; -#define phpext_xmlrpc_ptr &xmlrpc_module_entry - -#ifdef PHP_WIN32 -#define PHP_XMLRPC_API __declspec(dllexport) -#else -#define PHP_XMLRPC_API -#endif - -PHP_MINIT_FUNCTION(xmlrpc); -PHP_MINFO_FUNCTION(xmlrpc); - -PHP_FUNCTION(xmlrpc_encode); -PHP_FUNCTION(xmlrpc_decode); -PHP_FUNCTION(xmlrpc_decode_request); -PHP_FUNCTION(xmlrpc_encode_request); -PHP_FUNCTION(xmlrpc_get_type); -PHP_FUNCTION(xmlrpc_set_type); -PHP_FUNCTION(xmlrpc_is_fault); -PHP_FUNCTION(xmlrpc_server_create); -PHP_FUNCTION(xmlrpc_server_destroy); -PHP_FUNCTION(xmlrpc_server_register_method); -PHP_FUNCTION(xmlrpc_server_call_method); -PHP_FUNCTION(xmlrpc_parse_method_descriptions); -PHP_FUNCTION(xmlrpc_server_add_introspection_data); -PHP_FUNCTION(xmlrpc_server_register_introspection_callback); - -#else - -#define phpext_xmlrpc_ptr NULL - -#endif - -#endif /* _PHP_XMLRPC_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/xmlrpc/tests/001.phpt b/ext/xmlrpc/tests/001.phpt deleted file mode 100644 index 99fd958d29fca..0000000000000 --- a/ext/xmlrpc/tests/001.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -xmlrpc_encode_request() with wrong arguments ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(174) " - --1 - - - - 1 - - - - -" -string(160) " - - - - - - 1 - - - - -" - -Notice: Array to string conversion in %s on line %d -string(177) " - -Array - - - - 1 - - - - -" -string(175) " - -3.4 - - - - 1 - - - - -" -Done diff --git a/ext/xmlrpc/tests/002.phpt b/ext/xmlrpc/tests/002.phpt deleted file mode 100644 index c8d722b808fd0..0000000000000 --- a/ext/xmlrpc/tests/002.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -xmlrpc_encode_request() and various arguments ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(0) { -} -string(6) "method" -array(1) { - [0]=> - int(1) -} -string(6) "method" -array(1) { - [0]=> - string(5) "param" -} -string(6) "method" -array(1) { - [0]=> - string(0) "" -} -string(2) "-1" - -Notice: Array to string conversion in %s on line %d -array(1) { - [0]=> - int(1) -} -string(5) "Array" -Done diff --git a/ext/xmlrpc/tests/bug18916.phpt b/ext/xmlrpc/tests/bug18916.phpt deleted file mode 100644 index b2eb525d8c801..0000000000000 --- a/ext/xmlrpc/tests/bug18916.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #18916 (xmlrpc_set_type() not working) ---INI-- -date.timezone="America/Sao_Paulo" ---FILE-- - ---EXPECTF-- - - - - - %dT%d:%d:%d - - - diff --git a/ext/xmlrpc/tests/bug37057.phpt b/ext/xmlrpc/tests/bug37057.phpt deleted file mode 100644 index 013cc9192ce49..0000000000000 --- a/ext/xmlrpc/tests/bug37057.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Bug #37057 (xmlrpc_decode() may produce arrays with numeric string keys which are unaccessible) ---SKIPIF-- - ---FILE-- - - - - - - - - 50 - 0.29 - - - - - -'; - -$retval=xmlrpc_decode($response); -var_dump($retval); -var_dump($retval["50"]); -var_dump($retval[50]); - -$response=' - - - - - - - 0 - 0.29 - - - - - -'; - -$retval=xmlrpc_decode($response); -var_dump($retval); -var_dump($retval["0"]); -var_dump($retval[0]); - -echo "Done\n"; -?> ---EXPECT-- -array(1) { - [50]=> - string(4) "0.29" -} -string(4) "0.29" -string(4) "0.29" -array(1) { - [0]=> - string(4) "0.29" -} -string(4) "0.29" -string(4) "0.29" -Done diff --git a/ext/xmlrpc/tests/bug38431.phpt b/ext/xmlrpc/tests/bug38431.phpt deleted file mode 100644 index 288fe1041d901..0000000000000 --- a/ext/xmlrpc/tests/bug38431.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #38431 (xmlrpc_get_type() crashes PHP on objects) ---SKIPIF-- - ---FILE-- -1,2,3); -var_dump(xmlrpc_get_type($var)); -$var = array("test"=>1,"test2"=>2); -var_dump(xmlrpc_get_type($var)); - -echo "Done\n"; -?> ---EXPECTF-- -string(5) "array" -string(5) "array" -string(5) "array" -string(5) "mixed" -string(6) "struct" -Done diff --git a/ext/xmlrpc/tests/bug40576.phpt b/ext/xmlrpc/tests/bug40576.phpt deleted file mode 100644 index 6b73f4d2cd951..0000000000000 --- a/ext/xmlrpc/tests/bug40576.phpt +++ /dev/null @@ -1,77 +0,0 @@ ---TEST-- -Bug #40576 (double values are truncated to 6 decimal digits when encoding) ---SKIPIF-- - ---INI-- -precision=12 ---FILE-- - ---EXPECTF-- -string(125) " - - - - 1.123456789 - - - -" -string(128) " - - - - 11234567891000 - - - -" -string(116) " - - - - 11234567 - - - -" -string(106) " - - - - - - - -" -string(118) " - - - - test - - - -" -string(139) " - - - - 1.22222222222222222222222 - - - -" -Done diff --git a/ext/xmlrpc/tests/bug40576_64bit.phpt b/ext/xmlrpc/tests/bug40576_64bit.phpt deleted file mode 100644 index bb4cbe78438cc..0000000000000 --- a/ext/xmlrpc/tests/bug40576_64bit.phpt +++ /dev/null @@ -1,77 +0,0 @@ ---TEST-- -Bug #40576 (double values are truncated to 6 decimal digits when encoding) ---SKIPIF-- - ---INI-- -precision=12 ---FILE-- - ---EXPECTF-- -string(125) " - - - - 1.123456789 - - - -" -string(119) " - - - - -1066555326 - - - -" -string(116) " - - - - 11234567 - - - -" -string(106) " - - - - - - - -" -string(118) " - - - - test - - - -" -string(139) " - - - - 1.22222222222222222222222 - - - -" -Done diff --git a/ext/xmlrpc/tests/bug42189.phpt b/ext/xmlrpc/tests/bug42189.phpt deleted file mode 100644 index 55e726cf68707..0000000000000 --- a/ext/xmlrpc/tests/bug42189.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #42189 (xmlrpc_get_type() crashes PHP on invalid dates) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(false) -Done diff --git a/ext/xmlrpc/tests/bug42736.phpt b/ext/xmlrpc/tests/bug42736.phpt deleted file mode 100644 index b9a46cff5c0a8..0000000000000 --- a/ext/xmlrpc/tests/bug42736.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #42736 (xmlrpc_server_call_method() crashes) ---SKIPIF-- - ---FILE-- -add($id); - } -} - -$xml = xmlrpc_server_create(); - -$Myrequest = 'GetProducts20060922T14:26:19'; - -class MyClass { - function GetProducts($dummy, $time){ - return array('faultString' => $time); - } -} -$myclass = new MyClass(); -xmlrpc_server_register_method($xml, 'GetProducts', array($myclass, 'GetProducts')); -$response = xmlrpc_server_call_method($xml, $Myrequest, null); - -var_dump($response); - -echo "Done\n"; -?> ---EXPECTF-- -string(402) " - - - - - - - faultString - - - - - 20060922T14:26:19 - - - - - - - - - - -" -Done diff --git a/ext/xmlrpc/tests/bug45226.phpt b/ext/xmlrpc/tests/bug45226.phpt deleted file mode 100644 index af9b6c472cd04..0000000000000 --- a/ext/xmlrpc/tests/bug45226.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Bug #45226 (xmlrpc_set_type() segfaults with valid ISO8601 date string) ---INI-- -date.timezone="America/Sao_Paulo" ---FILE-- - $d)); - -$d = '2008-01-01 20:00:00'; -xmlrpc_set_type($d, 'datetime'); -echo xmlrpc_encode_request('method.call', array('date' => $d)); - -?> ---EXPECTF-- - - -method.call - - - - - - date - - %d-%d-%dT%d:%d:%d%s%d - - - - - - - - - -method.call - - - - - - date - - %d-%d-%d %d:%d:%d - - - - - - - diff --git a/ext/xmlrpc/tests/bug45555.phpt b/ext/xmlrpc/tests/bug45555.phpt deleted file mode 100644 index 376b14fec0892..0000000000000 --- a/ext/xmlrpc/tests/bug45555.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #45555 (Segfault with invalid non-string as register_introspection_callback) ---FILE-- - 'xml', 'version' => 'xmlrpc'); -xmlrpc_server_call_method ($server, $request, NULL, $options); - -?> ---EXPECTF-- -Warning: xmlrpc_server_call_method(): Invalid callback '1' passed in %s on line %d - -Warning: xmlrpc_server_call_method(): Invalid callback 'foo::bar' passed in %s on line %d diff --git a/ext/xmlrpc/tests/bug45556.phpt b/ext/xmlrpc/tests/bug45556.phpt deleted file mode 100644 index 9c73e0e5df16e..0000000000000 --- a/ext/xmlrpc/tests/bug45556.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Bug #45556 (Return value from callback isn't freed) ---FILE-- - 'xml', 'version' => 'xmlrpc'); -xmlrpc_server_call_method ($server, $request, NULL, $options); - -?> ---EXPECTF-- - -Warning: xmlrpc_server_call_method(): Invalid callback 'foobar' passed in %s on line %d -expat reports error code 5 - description: Invalid document end - line: 1 - column: 1 - byte index: 0 - total bytes: 0 - - data beginning 0 before byte index: foo - -Warning: xmlrpc_server_call_method(): xml parse error: [line 1, column 1, message: Invalid document end] Unable to add introspection data returned from bar::test() in %s on line %d - -Warning: xmlrpc_server_call_method(): Invalid callback 'foo::bar' passed in %s on line %d diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c deleted file mode 100644 index 95936f6ee0f1e..0000000000000 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ /dev/null @@ -1,1483 +0,0 @@ -/* - This file is part of, or distributed with, libXMLRPC - a C library for - xml-encoded function calls. - - Author: Dan Libby (dan@libby.com) - Epinions.com may be contacted at feedback@epinions-inc.com -*/ - -/* - Copyright 2001 Epinions, Inc. - - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. - - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. - - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. - - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. - -*/ - -/* auto-generated portions of this file are also subject to the php license */ - -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Dan Libby | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/********************************************************************** -* BUGS: * -* - when calling a php user function, there appears to be no way to * -* distinguish between a return value of null, and no return value * -* at all. The xml serialization layer(s) will then return a value * -* of null, when the right thing may be no value at all. (SOAP) * -**********************************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" -#include "php_xmlrpc.h" -#include "xmlrpc.h" - -#define PHP_EXT_VERSION "0.51" - -static int le_xmlrpc_server; - -zend_function_entry xmlrpc_functions[] = { - PHP_FE(xmlrpc_encode, NULL) - PHP_FE(xmlrpc_decode, NULL) - PHP_FE(xmlrpc_decode_request, second_arg_force_ref) - PHP_FE(xmlrpc_encode_request, NULL) - PHP_FE(xmlrpc_get_type, NULL) - PHP_FE(xmlrpc_set_type, first_arg_force_ref) - PHP_FE(xmlrpc_is_fault, NULL) - PHP_FE(xmlrpc_server_create, NULL) - PHP_FE(xmlrpc_server_destroy, NULL) - PHP_FE(xmlrpc_server_register_method, NULL) - PHP_FE(xmlrpc_server_call_method, NULL) - PHP_FE(xmlrpc_parse_method_descriptions, NULL) - PHP_FE(xmlrpc_server_add_introspection_data, NULL) - PHP_FE(xmlrpc_server_register_introspection_callback, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry xmlrpc_module_entry = { - STANDARD_MODULE_HEADER, - "xmlrpc", - xmlrpc_functions, - PHP_MINIT(xmlrpc), - NULL, - NULL, - NULL, - PHP_MINFO(xmlrpc), - PHP_EXT_VERSION, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_XMLRPC -ZEND_GET_MODULE(xmlrpc) -# ifdef PHP_WIN32 -# include "zend_arg_defs.c" -# endif -#endif - -/******************************* -* local structures and defines * -*******************************/ - -/* per server data */ -typedef struct _xmlrpc_server_data { - zval* method_map; - zval* introspection_map; - XMLRPC_SERVER server_ptr; -} xmlrpc_server_data; - - -/* how to format output */ -typedef struct _php_output_options { - int b_php_out; - int b_auto_version; - STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS xmlrpc_out; -} php_output_options; - -/* data passed to C callback */ -typedef struct _xmlrpc_callback_data { - zval* xmlrpc_method; - zval* php_function; - zval* caller_params; - zval* return_data; - xmlrpc_server_data* server; - char php_executed; -} xmlrpc_callback_data; - -/* output options */ -#define OUTPUT_TYPE_KEY "output_type" -#define OUTPUT_TYPE_KEY_LEN (sizeof(OUTPUT_TYPE_KEY) - 1) -#define OUTPUT_TYPE_VALUE_PHP "php" -#define OUTPUT_TYPE_VALUE_XML "xml" - -#define VERBOSITY_KEY "verbosity" -#define VERBOSITY_KEY_LEN (sizeof(VERBOSITY_KEY) - 1) -#define VERBOSITY_VALUE_NO_WHITE_SPACE "no_white_space" -#define VERBOSITY_VALUE_NEWLINES_ONLY "newlines_only" -#define VERBOSITY_VALUE_PRETTY "pretty" - -#define ESCAPING_KEY "escaping" -#define ESCAPING_KEY_LEN (sizeof(ESCAPING_KEY) - 1) -#define ESCAPING_VALUE_CDATA "cdata" -#define ESCAPING_VALUE_NON_ASCII "non-ascii" -#define ESCAPING_VALUE_NON_PRINT "non-print" -#define ESCAPING_VALUE_MARKUP "markup" - -#define VERSION_KEY "version" -#define VERSION_KEY_LEN (sizeof(VERSION_KEY) - 1) -#define VERSION_VALUE_SIMPLE "simple" -#define VERSION_VALUE_XMLRPC "xmlrpc" -#define VERSION_VALUE_SOAP11 "soap 1.1" -#define VERSION_VALUE_AUTO "auto" - -#define ENCODING_KEY "encoding" -#define ENCODING_KEY_LEN (sizeof(ENCODING_KEY) - 1) -#define ENCODING_DEFAULT "iso-8859-1" - -/* value types */ -#define OBJECT_TYPE_ATTR "xmlrpc_type" -#define OBJECT_VALUE_ATTR "scalar" -#define OBJECT_VALUE_TS_ATTR "timestamp" - -/* faults */ -#define FAULT_CODE "faultCode" -#define FAULT_CODE_LEN (sizeof(FAULT_CODE) - 1) -#define FAULT_STRING "faultString" -#define FAULT_STRING_LEN (sizeof(FAULT_STRING) - 1) - -/*********************** -* forward declarations * -***********************/ -XMLRPC_VALUE_TYPE get_zval_xmlrpc_type(zval* value, zval** newvalue); -static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data); -int sset_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE type); -zval* decode_request_worker(zval* xml_in, zval* encoding_in, zval* method_name_out); -const char* xmlrpc_type_as_str(XMLRPC_VALUE_TYPE type, XMLRPC_VECTOR_TYPE vtype); -XMLRPC_VALUE_TYPE xmlrpc_str_as_type(const char* str); -XMLRPC_VECTOR_TYPE xmlrpc_str_as_vector_type(const char* str); -int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE type); - -/********************* -* startup / shutdown * -*********************/ - -static void destroy_server_data(xmlrpc_server_data *server) -{ - if (server) { - XMLRPC_ServerDestroy(server->server_ptr); - - zval_dtor(server->method_map); - FREE_ZVAL(server->method_map); - - zval_dtor(server->introspection_map); - FREE_ZVAL(server->introspection_map); - - efree(server); - } -} - -/* called when server is being destructed. either when xmlrpc_server_destroy - * is called, or when request ends. */ -static void xmlrpc_server_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - if (rsrc && rsrc->ptr) { - destroy_server_data((xmlrpc_server_data*) rsrc->ptr); - } -} - -/* module init */ -PHP_MINIT_FUNCTION(xmlrpc) -{ - le_xmlrpc_server = zend_register_list_destructors_ex(xmlrpc_server_destructor, NULL, "xmlrpc server", module_number); - - return SUCCESS; -} - -/* display info in phpinfo() */ -PHP_MINFO_FUNCTION(xmlrpc) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "core library version", XMLRPC_GetVersionString()); - php_info_print_table_row(2, "php extension version", PHP_EXT_VERSION); - php_info_print_table_row(2, "author", "Dan Libby"); - php_info_print_table_row(2, "homepage", "http://xmlrpc-epi.sourceforge.net"); - php_info_print_table_row(2, "open sourced by", "Epinions.com"); - php_info_print_table_end(); -} - -/******************* -* random utilities * -*******************/ - -/* Utility functions for adding data types to arrays, with or without key (assoc, non-assoc). - * Could easily be further generalized to work with objects. - */ -#if 0 -static int add_long(zval* list, char* id, int num) { - if(id) return add_assoc_long(list, id, num); - else return add_next_index_long(list, num); -} - -static int add_double(zval* list, char* id, double num) { - if(id) return add_assoc_double(list, id, num); - else return add_next_index_double(list, num); -} - -static int add_string(zval* list, char* id, char* string, int duplicate) { - if(id) return add_assoc_string(list, id, string, duplicate); - else return add_next_index_string(list, string, duplicate); -} - -static int add_stringl(zval* list, char* id, char* string, uint length, int duplicate) { - if(id) return add_assoc_stringl(list, id, string, length, duplicate); - else return add_next_index_stringl(list, string, length, duplicate); -} - -#endif - -static int add_zval(zval* list, const char* id, zval** val) -{ - if (list && val) { - if (id) { - int id_len = strlen(id); - if (!(id_len > 1 && id[0] == '0') && is_numeric_string((char *)id, id_len, NULL, NULL, 0) == IS_LONG) { - long index = strtol(id, NULL, 0); - return zend_hash_index_update(Z_ARRVAL_P(list), index, (void *) val, sizeof(zval **), NULL); - } else { - return zend_hash_update(Z_ARRVAL_P(list), (char*) id, strlen(id) + 1, (void *) val, sizeof(zval **), NULL); - } - } else { - return zend_hash_next_index_insert(Z_ARRVAL_P(list), (void *) val, sizeof(zval **), NULL); - } - } - /* what is the correct return on error? */ - return 0; -} - -#define my_zend_hash_get_current_key(ht, my_key, num_index) zend_hash_get_current_key(ht, my_key, num_index, 0) - - -/************************* -* input / output options * -*************************/ - -/* parse an array (user input) into output options suitable for use by xmlrpc engine - * and determine whether to return data as xml or php vars */ -static void set_output_options(php_output_options* options, zval* output_opts) -{ - if (options) { - - /* defaults */ - options->b_php_out = 0; - options->b_auto_version = 1; - options->xmlrpc_out.version = xmlrpc_version_1_0; - options->xmlrpc_out.xml_elem_opts.encoding = ENCODING_DEFAULT; - options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_pretty; - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_markup_escaping | xml_elem_non_ascii_escaping | xml_elem_non_print_escaping; - - if (output_opts && Z_TYPE_P(output_opts) == IS_ARRAY) { - zval** val; - - /* type of output (xml/php) */ - if (zend_hash_find(Z_ARRVAL_P(output_opts), OUTPUT_TYPE_KEY, OUTPUT_TYPE_KEY_LEN + 1, (void**) &val) == SUCCESS) { - if (Z_TYPE_PP(val) == IS_STRING) { - if (!strcmp(Z_STRVAL_PP(val), OUTPUT_TYPE_VALUE_PHP)) { - options->b_php_out = 1; - } else if (!strcmp(Z_STRVAL_PP(val), OUTPUT_TYPE_VALUE_XML)) { - options->b_php_out = 0; - } - } - } - - /* verbosity of generated xml */ - if (zend_hash_find(Z_ARRVAL_P(output_opts), VERBOSITY_KEY, VERBOSITY_KEY_LEN + 1, (void**) &val) == SUCCESS) { - if (Z_TYPE_PP(val) == IS_STRING) { - if (!strcmp(Z_STRVAL_PP(val), VERBOSITY_VALUE_NO_WHITE_SPACE)) { - options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_no_white_space; - } else if (!strcmp(Z_STRVAL_PP(val), VERBOSITY_VALUE_NEWLINES_ONLY)) { - options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_newlines_only; - } else if (!strcmp(Z_STRVAL_PP(val), VERBOSITY_VALUE_PRETTY)) { - options->xmlrpc_out.xml_elem_opts.verbosity = xml_elem_pretty; - } - } - } - - /* version of xml to output */ - if (zend_hash_find(Z_ARRVAL_P(output_opts), VERSION_KEY, VERSION_KEY_LEN + 1, (void**) &val) == SUCCESS) { - if (Z_TYPE_PP(val) == IS_STRING) { - options->b_auto_version = 0; - if (!strcmp(Z_STRVAL_PP(val), VERSION_VALUE_XMLRPC)) { - options->xmlrpc_out.version = xmlrpc_version_1_0; - } else if (!strcmp(Z_STRVAL_PP(val), VERSION_VALUE_SIMPLE)) { - options->xmlrpc_out.version = xmlrpc_version_simple; - } else if (!strcmp((*val)->value.str.val, VERSION_VALUE_SOAP11)) { - options->xmlrpc_out.version = xmlrpc_version_soap_1_1; - } else { /* if(!strcmp((*val)->value.str.val, VERSION_VALUE_AUTO)) { */ - options->b_auto_version = 1; - } - } - } - - /* encoding code set */ - if(zend_hash_find(Z_ARRVAL_P(output_opts), ENCODING_KEY, ENCODING_KEY_LEN + 1, (void**)&val) == SUCCESS) { - if(Z_TYPE_PP(val) == IS_STRING) { - options->xmlrpc_out.xml_elem_opts.encoding = estrdup(Z_STRVAL_PP(val)); - } - } - - /* escaping options */ - if (zend_hash_find(Z_ARRVAL_P(output_opts), ESCAPING_KEY, ESCAPING_KEY_LEN + 1, (void**)&val) == SUCCESS) { - /* multiple values allowed. check if array */ - if (Z_TYPE_PP(val) == IS_ARRAY) { - zval** iter_val; - zend_hash_internal_pointer_reset(Z_ARRVAL_PP(val)); - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_no_escaping; - while(1) { - if(zend_hash_get_current_data(Z_ARRVAL_PP(val), (void**)&iter_val) == SUCCESS) { - if(Z_TYPE_PP(iter_val) == IS_STRING && Z_STRVAL_PP(iter_val)) { - if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_CDATA)) { - options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_cdata_escaping; - } - else if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_NON_ASCII)) { - options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_non_ascii_escaping; - } - else if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_NON_PRINT)) { - options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_non_print_escaping; - } - else if(!strcmp(Z_STRVAL_PP(iter_val), ESCAPING_VALUE_MARKUP)) { - options->xmlrpc_out.xml_elem_opts.escaping |= xml_elem_markup_escaping; - } - } - } - else { - break; - } - - zend_hash_move_forward(Z_ARRVAL_PP(val)); - } - } - /* else, check for single value */ - else if(Z_TYPE_PP(val) == IS_STRING) { - if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_CDATA)) { - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_cdata_escaping; - } - else if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_NON_ASCII)) { - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_non_ascii_escaping; - } - else if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_NON_PRINT)) { - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_non_print_escaping; - } - else if(!strcmp(Z_STRVAL_PP(val), ESCAPING_VALUE_MARKUP)) { - options->xmlrpc_out.xml_elem_opts.escaping = xml_elem_markup_escaping; - } - } - } - } - } -} - - -/****************** -* encode / decode * -******************/ - -/* php arrays have no distinction between array and struct types. - * they even allow mixed. Thus, we determine the type by iterating - * through the entire array and figuring out each element. - * room for some optimation here if we stop after a specific # of elements. - */ -static XMLRPC_VECTOR_TYPE determine_vector_type (HashTable *ht) -{ - int bArray = 0, bStruct = 0, bMixed = 0; - unsigned long num_index; - char* my_key; - - zend_hash_internal_pointer_reset(ht); - while(1) { - int res = my_zend_hash_get_current_key(ht, &my_key, &num_index); - if(res == HASH_KEY_IS_LONG) { - if(bStruct) { - bMixed = 1; - break; - } - bArray = 1; - } - else if(res == HASH_KEY_NON_EXISTANT) { - break; - } - else if(res == HASH_KEY_IS_STRING) { - if(bArray) { - bMixed = 1; - break; - } - bStruct = 1; - } - - zend_hash_move_forward(ht); - } - return bMixed ? xmlrpc_vector_mixed : (bStruct ? xmlrpc_vector_struct : xmlrpc_vector_array); -} - -/* recursively convert php values into xmlrpc values */ -static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth TSRMLS_DC) -{ - XMLRPC_VALUE xReturn = NULL; - if(in_val) { - zval* val = NULL; - XMLRPC_VALUE_TYPE type = get_zval_xmlrpc_type(in_val, &val); - if(val) { - switch(type) { - case xmlrpc_base64: - if(Z_TYPE_P(val) == IS_NULL) { - xReturn = XMLRPC_CreateValueEmpty(); - XMLRPC_SetValueID(xReturn, key, 0); - } else { - xReturn = XMLRPC_CreateValueBase64(key, Z_STRVAL_P(val), Z_STRLEN_P(val)); - } - break; - case xmlrpc_datetime: - convert_to_string(val); - xReturn = XMLRPC_CreateValueDateTime_ISO8601(key, Z_STRVAL_P(val)); - break; - case xmlrpc_boolean: - convert_to_boolean(val); - xReturn = XMLRPC_CreateValueBoolean(key, Z_LVAL_P(val)); - break; - case xmlrpc_int: - convert_to_long(val); - xReturn = XMLRPC_CreateValueInt(key, Z_LVAL_P(val)); - break; - case xmlrpc_double: - convert_to_double(val); - xReturn = XMLRPC_CreateValueDouble(key, Z_DVAL_P(val)); - break; - case xmlrpc_string: - convert_to_string(val); - xReturn = XMLRPC_CreateValueString(key, Z_STRVAL_P(val), Z_STRLEN_P(val)); - break; - case xmlrpc_vector: { - unsigned long num_index; - zval** pIter; - char* my_key; - HashTable *ht = NULL; - - ht = HASH_OF(val); - if (ht && ht->nApplyCount > 1) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "XML-RPC doesn't support circular references"); - return NULL; - } - - convert_to_array(val); - xReturn = XMLRPC_CreateVector(key, determine_vector_type(Z_ARRVAL_P(val))); - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(val)); - while(zend_hash_get_current_data(Z_ARRVAL_P(val), (void**)&pIter) == SUCCESS) { - int res = my_zend_hash_get_current_key(Z_ARRVAL_P(val), &my_key, &num_index); - - switch (res) { - case HASH_KEY_NON_EXISTANT: - break; - case HASH_KEY_IS_STRING: - case HASH_KEY_IS_LONG: - ht = HASH_OF(*pIter); - if (ht) { - ht->nApplyCount++; - } - if (res == HASH_KEY_IS_LONG) { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++ TSRMLS_CC)); - } else { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++ TSRMLS_CC)); - } - if (ht) { - ht->nApplyCount--; - } - break; - } - zend_hash_move_forward(Z_ARRVAL_P(val)); - } - } - break; - default: - break; - } - } - } - return xReturn; -} - -static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val TSRMLS_DC) -{ - return PHP_to_XMLRPC_worker(NULL, root_val, 0 TSRMLS_CC); -} - -/* recursively convert xmlrpc values into php values */ -static zval* XMLRPC_to_PHP(XMLRPC_VALUE el) -{ - zval* elem = NULL; - const char* pStr; - - if(el) { - XMLRPC_VALUE_TYPE type = XMLRPC_GetValueType(el); - - MAKE_STD_ZVAL(elem); /* init. very important. spent a frustrating day finding this out. */ - - switch(type) { - case xmlrpc_empty: - Z_TYPE_P(elem) = IS_NULL; - break; - case xmlrpc_string: - pStr = XMLRPC_GetValueString(el); - if(pStr) { - Z_STRLEN_P(elem) = XMLRPC_GetValueStringLen(el); - Z_STRVAL_P(elem) = estrndup(pStr, Z_STRLEN_P(elem)); - Z_TYPE_P(elem) = IS_STRING; - } - break; - case xmlrpc_int: - Z_LVAL_P(elem) = XMLRPC_GetValueInt(el); - Z_TYPE_P(elem) = IS_LONG; - break; - case xmlrpc_boolean: - Z_LVAL_P(elem) = XMLRPC_GetValueBoolean(el); - Z_TYPE_P(elem) = IS_BOOL; - break; - case xmlrpc_double: - Z_DVAL_P(elem) = XMLRPC_GetValueDouble(el); - Z_TYPE_P(elem) = IS_DOUBLE; - break; - case xmlrpc_datetime: - Z_STRLEN_P(elem) = XMLRPC_GetValueStringLen(el); - Z_STRVAL_P(elem) = estrndup(XMLRPC_GetValueDateTime_ISO8601(el), Z_STRLEN_P(elem)); - Z_TYPE_P(elem) = IS_STRING; - break; - case xmlrpc_base64: - pStr = XMLRPC_GetValueBase64(el); - if(pStr) { - Z_STRLEN_P(elem) = XMLRPC_GetValueStringLen(el); - Z_STRVAL_P(elem) = estrndup(pStr, Z_STRLEN_P(elem)); - Z_TYPE_P(elem) = IS_STRING; - } - break; - case xmlrpc_vector: - array_init(elem); - { - XMLRPC_VALUE xIter = XMLRPC_VectorRewind(el); - - while( xIter ) { - zval *val = XMLRPC_to_PHP(xIter); - if (val) { - add_zval(elem, XMLRPC_GetValueID(xIter), &val); - } - xIter = XMLRPC_VectorNext(el); - } - } - break; - default: - break; - } - set_zval_xmlrpc_type(elem, type); - } - return elem; -} - -/* {{{ proto string xmlrpc_encode_request(string method, mixed params) - Generates XML for a method request */ -PHP_FUNCTION(xmlrpc_encode_request) -{ - XMLRPC_REQUEST xRequest = NULL; - zval **method, **vals, **out_opts; - char* outBuf; - php_output_options out; - - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3 || (zend_get_parameters_ex(ZEND_NUM_ARGS(), &method, &vals, &out_opts) == FAILURE)) { - WRONG_PARAM_COUNT; /* prints/logs a warning and returns */ - } - - set_output_options(&out, (ZEND_NUM_ARGS() == 3) ? *out_opts : 0); - - if(return_value_used) { - xRequest = XMLRPC_RequestNew(); - - if(xRequest) { - XMLRPC_RequestSetOutputOptions(xRequest, &out.xmlrpc_out); - if (Z_TYPE_PP(method) == IS_NULL) { - XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_response); - } else { - convert_to_string_ex(method); - XMLRPC_RequestSetMethodName(xRequest, Z_STRVAL_PP(method)); - XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call); - } - if (Z_TYPE_PP(vals) != IS_NULL) { - XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals TSRMLS_CC)); - } - - outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0); - if(outBuf) { - RETVAL_STRING(outBuf, 1); - free(outBuf); - } - XMLRPC_RequestFree(xRequest, 1); - } - } - - if (out.xmlrpc_out.xml_elem_opts.encoding != ENCODING_DEFAULT) { - efree((char *)out.xmlrpc_out.xml_elem_opts.encoding); - } -} -/* }}} */ - -/* {{{ proto string xmlrpc_encode(mixed value) - Generates XML for a PHP value */ -PHP_FUNCTION(xmlrpc_encode) -{ - XMLRPC_VALUE xOut = NULL; - zval **arg1; - char *outBuf; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - if( return_value_used ) { - /* convert native php type to xmlrpc type */ - xOut = PHP_to_XMLRPC(*arg1 TSRMLS_CC); - - /* generate raw xml from xmlrpc data */ - outBuf = XMLRPC_VALUE_ToXML(xOut, 0); - - if(xOut) { - if(outBuf) { - RETVAL_STRING(outBuf, 1); - free(outBuf); - } - /* cleanup */ - XMLRPC_CleanupValue(xOut); - } - } -} -/* }}} */ - - -zval* decode_request_worker (zval* xml_in, zval* encoding_in, zval* method_name_out) -{ - zval* retval = NULL; - XMLRPC_REQUEST response; - STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS opts = {{0}}; - opts.xml_elem_opts.encoding = encoding_in ? utf8_get_encoding_id_from_string(Z_STRVAL_P(encoding_in)) : ENCODING_DEFAULT; - - /* generate XMLRPC_REQUEST from raw xml */ - response = XMLRPC_REQUEST_FromXML(Z_STRVAL_P(xml_in), Z_STRLEN_P(xml_in), &opts); - if(response) { - /* convert xmlrpc data to native php types */ - retval = XMLRPC_to_PHP(XMLRPC_RequestGetData(response)); - - if(XMLRPC_RequestGetRequestType(response) == xmlrpc_request_call) { - if(method_name_out) { - zval_dtor(method_name_out); - Z_TYPE_P(method_name_out) = IS_STRING; - Z_STRVAL_P(method_name_out) = estrdup(XMLRPC_RequestGetMethodName(response)); - Z_STRLEN_P(method_name_out) = strlen(Z_STRVAL_P(method_name_out)); - } - } - - /* dust, sweep, and mop */ - XMLRPC_RequestFree(response, 1); - } - return retval; -} - -/* {{{ proto array xmlrpc_decode_request(string xml, string& method [, string encoding]) - Decodes XML into native PHP types */ -PHP_FUNCTION(xmlrpc_decode_request) -{ - zval **xml, **method, **encoding = NULL; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || (zend_get_parameters_ex(argc, &xml, &method, &encoding) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(xml); - convert_to_string_ex(method); - if(argc == 3) { - convert_to_string_ex(encoding); - } - - if(return_value_used) { - zval* retval = decode_request_worker(*xml, encoding ? *encoding : NULL, *method); - if(retval) { - *return_value = *retval; - FREE_ZVAL(retval); - } - } -} -/* }}} */ - - -/* {{{ proto array xmlrpc_decode(string xml [, string encoding]) - Decodes XML into native PHP types */ -PHP_FUNCTION(xmlrpc_decode) -{ - zval **arg1, **arg2 = NULL; - int argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 2 || (zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg1); - if(argc == 2) { - convert_to_string_ex(arg2); - } - - if(return_value_used) { - zval* retval = decode_request_worker(*arg1, arg2 ? *arg2 : NULL, NULL); - if(retval) { - *return_value = *retval; - FREE_ZVAL(retval); - } - } -} -/* }}} */ - - -/************************* -* server related methods * -*************************/ - -/* {{{ proto resource xmlrpc_server_create(void) - Creates an xmlrpc server */ -PHP_FUNCTION(xmlrpc_server_create) -{ - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if(return_value_used) { - zval *method_map, *introspection_map; - xmlrpc_server_data *server = emalloc(sizeof(xmlrpc_server_data)); - MAKE_STD_ZVAL(method_map); - MAKE_STD_ZVAL(introspection_map); - - array_init(method_map); - array_init(introspection_map); - - /* allocate server data. free'd in destroy_server_data() */ - server->method_map = method_map; - server->introspection_map = introspection_map; - server->server_ptr = XMLRPC_ServerCreate(); - - XMLRPC_ServerRegisterIntrospectionCallback(server->server_ptr, php_xmlrpc_introspection_callback); - - /* store for later use */ - ZEND_REGISTER_RESOURCE(return_value,server, le_xmlrpc_server); - } -} -/* }}} */ - -/* {{{ proto int xmlrpc_server_destroy(resource server) - Destroys server resources */ -PHP_FUNCTION(xmlrpc_server_destroy) -{ - zval **arg1; - int bSuccess = FAILURE; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - if(Z_TYPE_PP(arg1) == IS_RESOURCE) { - int type; - - xmlrpc_server_data *server = zend_list_find(Z_LVAL_PP(arg1), &type); - - if(server && type == le_xmlrpc_server) { - bSuccess = zend_list_delete(Z_LVAL_PP(arg1)); - - /* called by hashtable destructor - * destroy_server_data(server); - */ - } - } - RETVAL_LONG(bSuccess == SUCCESS); -} -/* }}} */ - - -/* called by xmlrpc C engine as method handler for all registered methods. - * it then calls the corresponding PHP function to handle the method. - */ -static XMLRPC_VALUE php_xmlrpc_callback(XMLRPC_SERVER server, XMLRPC_REQUEST xRequest, void* data) -{ - xmlrpc_callback_data* pData = (xmlrpc_callback_data*)data; - zval* xmlrpc_params; - zval* callback_params[3]; - TSRMLS_FETCH(); - - /* convert xmlrpc to native php types */ - xmlrpc_params = XMLRPC_to_PHP(XMLRPC_RequestGetData(xRequest)); - - /* setup data hoojum */ - callback_params[0] = pData->xmlrpc_method; - callback_params[1] = xmlrpc_params; - callback_params[2] = pData->caller_params; - - /* Use same C function for all methods */ - - /* php func prototype: function user_func($method_name, $xmlrpc_params, $user_params) */ - call_user_function(CG(function_table), NULL, pData->php_function, pData->return_data, 3, callback_params TSRMLS_CC); - - pData->php_executed = 1; - - zval_ptr_dtor(&xmlrpc_params); - - return NULL; -} - -/* called by the C server when it first receives an introspection request. We pass this on to - * our PHP listeners, if any - */ -static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data) -{ - zval retval, **php_function; - zval* callback_params[1]; - char *php_function_name; - xmlrpc_callback_data* pData = (xmlrpc_callback_data*)data; - TSRMLS_FETCH(); - - /* setup data hoojum */ - callback_params[0] = pData->caller_params; - - /* loop through and call all registered callbacks */ - zend_hash_internal_pointer_reset(Z_ARRVAL_P(pData->server->introspection_map)); - while(1) { - if(zend_hash_get_current_data(Z_ARRVAL_P(pData->server->introspection_map), (void**)&php_function) == SUCCESS) { - - if (zend_is_callable(*php_function, 0, &php_function_name)) { - /* php func prototype: function string user_func($user_params) */ - if (call_user_function(CG(function_table), NULL, *php_function, &retval, 1, callback_params TSRMLS_CC) == SUCCESS) { - XMLRPC_VALUE xData; - STRUCT_XMLRPC_ERROR err = {0}; - - /* return value should be a string */ - convert_to_string(&retval); - - xData = XMLRPC_IntrospectionCreateDescription(Z_STRVAL(retval), &err); - - if(xData) { - if(!XMLRPC_ServerAddIntrospectionData(server, xData)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add introspection data returned from %s(), improper element structure", php_function_name); - } - XMLRPC_CleanupValue(xData); - } else { - /* could not create description */ - if(err.xml_elem_error.parser_code) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to add introspection data returned from %s()", - err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error, php_function_name); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add introspection data returned from %s()", php_function_name); - } - } - zval_dtor(&retval); - } else { - /* user func failed */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error calling user introspection callback: %s()", php_function_name); - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid callback '%s' passed", php_function_name); - } - efree(php_function_name); - } else { - break; - } - zend_hash_move_forward(Z_ARRVAL_P(pData->server->introspection_map)); - } - - /* so we don't call the same callbacks ever again */ - zend_hash_clean(Z_ARRVAL_P(pData->server->introspection_map)); -} - -/* {{{ proto bool xmlrpc_server_register_method(resource server, string method_name, string function) - Register a PHP function to handle method matching method_name */ -PHP_FUNCTION(xmlrpc_server_register_method) -{ - zval **method_key, **method_name, **handle, *method_name_save; - int type; - xmlrpc_server_data* server; - - if (ZEND_NUM_ARGS() != 3 || (zend_get_parameters_ex(3, &handle, &method_key, &method_name) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - server = zend_list_find(Z_LVAL_PP(handle), &type); - - if(type == le_xmlrpc_server) { - /* register with C engine. every method just calls our standard callback, - * and it then dispatches to php as necessary - */ - if(XMLRPC_ServerRegisterMethod(server->server_ptr, Z_STRVAL_PP(method_key), php_xmlrpc_callback)) { - /* save for later use */ - MAKE_STD_ZVAL(method_name_save); - *method_name_save = **method_name; - zval_copy_ctor(method_name_save); - - /* register our php method */ - add_zval(server->method_map, Z_STRVAL_PP(method_key), &method_name_save); - - RETURN_BOOL(1); - } - } - RETURN_BOOL(0); -} -/* }}} */ - - -/* {{{ proto bool xmlrpc_server_register_introspection_callback(resource server, string function) - Register a PHP function to generate documentation */ -PHP_FUNCTION(xmlrpc_server_register_introspection_callback) -{ - zval **method_name, **handle, *method_name_save; - int type; - xmlrpc_server_data* server; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &handle, &method_name) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - server = zend_list_find(Z_LVAL_PP(handle), &type); - - if(type == le_xmlrpc_server) { - /* save for later use */ - MAKE_STD_ZVAL(method_name_save); - *method_name_save = **method_name; - zval_copy_ctor(method_name_save); - - /* register our php method */ - add_zval(server->introspection_map, NULL, &method_name_save); - - RETURN_BOOL(1); - } - RETURN_BOOL(0); -} -/* }}} */ - - -/* this function is itchin for a re-write */ - -/* {{{ proto mixed xmlrpc_server_call_method(resource server, string xml, mixed user_data [, array output_options]) - Parses XML requests and call methods */ -PHP_FUNCTION(xmlrpc_server_call_method) -{ - xmlrpc_callback_data data = {0}; - XMLRPC_REQUEST xRequest; - STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS input_opts; - xmlrpc_server_data* server; - zval **rawxml, **caller_params, **handle, **output_opts = NULL; - int type; - php_output_options out; - int argc =ZEND_NUM_ARGS(); - - if (argc < 3 || argc > 4 || (zend_get_parameters_ex(argc, &handle, &rawxml, &caller_params, &output_opts) != SUCCESS)) { - WRONG_PARAM_COUNT; - } - /* user output options */ - if (argc == 3) { - set_output_options(&out, NULL); - } - else { - set_output_options(&out, *output_opts); - } - - server = zend_list_find(Z_LVAL_PP(handle), &type); - - if(type == le_xmlrpc_server) { - /* HACK: use output encoding for now */ - input_opts.xml_elem_opts.encoding = utf8_get_encoding_id_from_string(out.xmlrpc_out.xml_elem_opts.encoding); - - /* generate an XMLRPC_REQUEST from the raw xml input */ - xRequest = XMLRPC_REQUEST_FromXML(Z_STRVAL_PP(rawxml), Z_STRLEN_PP(rawxml), &input_opts); - - if(xRequest) { - const char* methodname = XMLRPC_RequestGetMethodName(xRequest); - zval **php_function; - XMLRPC_VALUE xAnswer = NULL; - MAKE_STD_ZVAL(data.xmlrpc_method); /* init. very important. spent a frustrating day finding this out. */ - MAKE_STD_ZVAL(data.return_data); - Z_TYPE_P(data.return_data) = IS_NULL; /* in case value is never init'd, we don't dtor to think it is a string or something */ - Z_TYPE_P(data.xmlrpc_method) = IS_NULL; - - if (!methodname) { - methodname = ""; - } - - /* setup some data to pass to the callback function */ - Z_STRVAL_P(data.xmlrpc_method) = estrdup(methodname); - Z_STRLEN_P(data.xmlrpc_method) = strlen(methodname); - Z_TYPE_P(data.xmlrpc_method) = IS_STRING; - data.caller_params = *caller_params; - data.php_executed = 0; - data.server = server; - - /* check if the called method has been previous registered */ - if(zend_hash_find(Z_ARRVAL_P(server->method_map), - Z_STRVAL_P(data.xmlrpc_method), - Z_STRLEN_P(data.xmlrpc_method) + 1, - (void**)&php_function) == SUCCESS) { - - data.php_function = *php_function; - } - - /* We could just call the php method directly ourselves at this point, but we do this - * with a C callback in case the xmlrpc library ever implements some cool usage stats, - * or somesuch. - */ - xAnswer = XMLRPC_ServerCallMethod(server->server_ptr, xRequest, &data); - if(xAnswer && out.b_php_out) { - zval_dtor(data.return_data); - FREE_ZVAL(data.return_data); - data.return_data = XMLRPC_to_PHP(xAnswer); - } else if(data.php_executed && !out.b_php_out) { - xAnswer = PHP_to_XMLRPC(data.return_data TSRMLS_CC); - } - - /* should we return data as xml? */ - if(!out.b_php_out) { - XMLRPC_REQUEST xResponse = XMLRPC_RequestNew(); - if(xResponse) { - char *outBuf = 0; - int buf_len = 0; - - /* automagically determine output serialization type from request type */ - if (out.b_auto_version) { - XMLRPC_REQUEST_OUTPUT_OPTIONS opts = XMLRPC_RequestGetOutputOptions(xRequest); - if (opts) { - out.xmlrpc_out.version = opts->version; - } - } - /* set some required request hoojum */ - XMLRPC_RequestSetOutputOptions(xResponse, &out.xmlrpc_out); - XMLRPC_RequestSetRequestType(xResponse, xmlrpc_request_response); - XMLRPC_RequestSetData(xResponse, xAnswer); - XMLRPC_RequestSetMethodName(xResponse, methodname); - - /* generate xml */ - outBuf = XMLRPC_REQUEST_ToXML(xResponse, &buf_len); - if(outBuf) { - RETVAL_STRINGL(outBuf, buf_len, 1); - free(outBuf); - } - /* cleanup after ourselves. what a sty! */ - XMLRPC_RequestFree(xResponse, 0); - } - } else { /* or as native php types? */ - *return_value = *data.return_data; - zval_copy_ctor(return_value); - } - - /* cleanup after ourselves. what a sty! */ - zval_dtor(data.xmlrpc_method); - FREE_ZVAL(data.xmlrpc_method); - zval_dtor(data.return_data); - FREE_ZVAL(data.return_data); - - if(xAnswer) { - XMLRPC_CleanupValue(xAnswer); - } - - XMLRPC_RequestFree(xRequest, 1); - } - } -} -/* }}} */ - - -/* {{{ proto int xmlrpc_server_add_introspection_data(resource server, array desc) - Adds introspection documentation */ -PHP_FUNCTION(xmlrpc_server_add_introspection_data) -{ - zval **handle, **desc; - int type; - xmlrpc_server_data* server; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &handle, &desc) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - server = zend_list_find(Z_LVAL_PP(handle), &type); - - if (type == le_xmlrpc_server) { - XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc TSRMLS_CC); - if (xDesc) { - int retval = XMLRPC_ServerAddIntrospectionData(server->server_ptr, xDesc); - XMLRPC_CleanupValue(xDesc); - RETURN_LONG(retval); - } - } - RETURN_LONG(0); -} -/* }}} */ - - -/* {{{ proto array xmlrpc_parse_method_descriptions(string xml) - Decodes XML into a list of method descriptions */ -PHP_FUNCTION(xmlrpc_parse_method_descriptions) -{ - zval **arg1, *retval; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg1) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg1); - - if(return_value_used) { - STRUCT_XMLRPC_ERROR err = {0}; - XMLRPC_VALUE xVal = XMLRPC_IntrospectionCreateDescription(Z_STRVAL_PP(arg1), &err); - if(xVal) { - retval = XMLRPC_to_PHP(xVal); - - if(retval) { - *return_value = *retval; - zval_copy_ctor(return_value); - } - /* dust, sweep, and mop */ - XMLRPC_CleanupValue(xVal); - } else { - /* could not create description */ - if(err.xml_elem_error.parser_code) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to create introspection data", - err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid xml structure. Unable to create introspection data"); - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error. no method description created"); - } - } -} -/* }}} */ - - -/************ -* type data * -************/ - -#define XMLRPC_TYPE_COUNT 9 -#define XMLRPC_VECTOR_TYPE_COUNT 4 -#define TYPE_STR_MAP_SIZE (XMLRPC_TYPE_COUNT + XMLRPC_VECTOR_TYPE_COUNT) - -/* return a string matching a given xmlrpc type */ -static const char** get_type_str_mapping(void) -{ - static const char* str_mapping[TYPE_STR_MAP_SIZE]; - static int first = 1; - if (first) { - /* warning. do not add/delete without changing size define */ - str_mapping[xmlrpc_none] = "none"; - str_mapping[xmlrpc_empty] = "empty"; - str_mapping[xmlrpc_base64] = "base64"; - str_mapping[xmlrpc_boolean] = "boolean"; - str_mapping[xmlrpc_datetime] = "datetime"; - str_mapping[xmlrpc_double] = "double"; - str_mapping[xmlrpc_int] = "int"; - str_mapping[xmlrpc_string] = "string"; - str_mapping[xmlrpc_vector] = "vector"; - str_mapping[XMLRPC_TYPE_COUNT + xmlrpc_vector_none] = "none"; - str_mapping[XMLRPC_TYPE_COUNT + xmlrpc_vector_array] = "array"; - str_mapping[XMLRPC_TYPE_COUNT + xmlrpc_vector_mixed] = "mixed"; - str_mapping[XMLRPC_TYPE_COUNT + xmlrpc_vector_struct] = "struct"; - first = 0; - } - return (const char**)str_mapping; -} - -/* map an xmlrpc type to a string */ -const char* xmlrpc_type_as_str(XMLRPC_VALUE_TYPE type, XMLRPC_VECTOR_TYPE vtype) -{ - const char** str_mapping = get_type_str_mapping(); - - if (vtype == xmlrpc_vector_none) { - return str_mapping[type]; - } else { - return str_mapping[XMLRPC_TYPE_COUNT + vtype]; - } -} - -/* map a string to an xmlrpc type */ -XMLRPC_VALUE_TYPE xmlrpc_str_as_type(const char* str) -{ - const char** str_mapping = get_type_str_mapping(); - int i; - - if (str) { - for (i = 0; i < XMLRPC_TYPE_COUNT; i++) { - if (!strcmp(str_mapping[i], str)) { - return (XMLRPC_VALUE_TYPE) i; - } - } - } - return xmlrpc_none; -} - -/* map a string to an xmlrpc vector type */ -XMLRPC_VECTOR_TYPE xmlrpc_str_as_vector_type(const char* str) -{ - const char** str_mapping = get_type_str_mapping(); - int i; - - if (str) { - for (i = XMLRPC_TYPE_COUNT; i < TYPE_STR_MAP_SIZE; i++) { - if (!strcmp(str_mapping[i], str)) { - return (XMLRPC_VECTOR_TYPE) (i - XMLRPC_TYPE_COUNT); - } - } - } - return xmlrpc_none; -} - - -/* set a given value to a particular type. - * note: this only works on strings, and only for date and base64, - * which do not have native php types. black magic lies herein. - */ -int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE newtype) -{ - int bSuccess = FAILURE; - TSRMLS_FETCH(); - - /* we only really care about strings because they can represent - * base64 and datetime. all other types have corresponding php types - */ - if (Z_TYPE_P(value) == IS_STRING) { - if (newtype == xmlrpc_base64 || newtype == xmlrpc_datetime) { - const char* typestr = xmlrpc_type_as_str(newtype, xmlrpc_vector_none); - zval* type; - - MAKE_STD_ZVAL(type); - - Z_TYPE_P(type) = IS_STRING; - Z_STRVAL_P(type) = estrdup(typestr); - Z_STRLEN_P(type) = strlen(typestr); - - if(newtype == xmlrpc_datetime) { - XMLRPC_VALUE v = XMLRPC_CreateValueDateTime_ISO8601(NULL, value->value.str.val); - if(v) { - time_t timestamp = XMLRPC_GetValueDateTime(v); - if(timestamp) { - zval* ztimestamp; - - MAKE_STD_ZVAL(ztimestamp); - - ztimestamp->type = IS_LONG; - ztimestamp->value.lval = timestamp; - - convert_to_object(value); - if(SUCCESS == zend_hash_update(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR), (void *) &type, sizeof(zval *), NULL)) { - bSuccess = zend_hash_update(Z_OBJPROP_P(value), OBJECT_VALUE_TS_ATTR, sizeof(OBJECT_VALUE_TS_ATTR), (void *) &ztimestamp, sizeof(zval *), NULL); - } - } else { - zval_ptr_dtor(&type); - } - XMLRPC_CleanupValue(v); - } else { - zval_ptr_dtor(&type); - } - } else { - convert_to_object(value); - bSuccess = zend_hash_update(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR), (void *) &type, sizeof(zval *), NULL); - } - } - } - - return bSuccess; -} - -/* return xmlrpc type of a php value */ -XMLRPC_VALUE_TYPE get_zval_xmlrpc_type(zval* value, zval** newvalue) -{ - XMLRPC_VALUE_TYPE type = xmlrpc_none; - TSRMLS_FETCH(); - - if (value) { - switch (Z_TYPE_P(value)) { - case IS_NULL: - type = xmlrpc_base64; - break; -#ifndef BOOL_AS_LONG - - /* Right thing to do, but it breaks some legacy code. */ - case IS_BOOL: - type = xmlrpc_boolean; - break; -#else - case IS_BOOL: -#endif - case IS_LONG: - case IS_RESOURCE: - type = xmlrpc_int; - break; - case IS_DOUBLE: - type = xmlrpc_double; - break; - case IS_CONSTANT: - type = xmlrpc_string; - break; - case IS_STRING: - type = xmlrpc_string; - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: - type = xmlrpc_vector; - break; - case IS_OBJECT: - { - zval** attr; - type = xmlrpc_vector; - - if (zend_hash_find(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR), (void**) &attr) == SUCCESS) { - if (Z_TYPE_PP(attr) == IS_STRING) { - type = xmlrpc_str_as_type(Z_STRVAL_PP(attr)); - } - } - break; - } - } - - /* if requested, return an unmolested (magic removed) copy of the value */ - if (newvalue) { - zval** val; - - if ((type == xmlrpc_base64 && Z_TYPE_P(value) != IS_NULL) || type == xmlrpc_datetime) { - if (zend_hash_find(Z_OBJPROP_P(value), OBJECT_VALUE_ATTR, sizeof(OBJECT_VALUE_ATTR), (void**) &val) == SUCCESS) { - *newvalue = *val; - } - } else { - *newvalue = value; - } - } - } - return type; -} - - -/* {{{ proto bool xmlrpc_set_type(string value, string type) - Sets xmlrpc type, base64 or datetime, for a PHP string value */ -PHP_FUNCTION(xmlrpc_set_type) -{ - zval **arg, **type; - XMLRPC_VALUE_TYPE vtype; - - if (ZEND_NUM_ARGS() != 2 || (zend_get_parameters_ex(2, &arg, &type) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(type); - vtype = xmlrpc_str_as_type(Z_STRVAL_PP(type)); - if (vtype != xmlrpc_none) { - if (set_zval_xmlrpc_type(*arg, vtype) == SUCCESS) { - RETURN_TRUE; - } - } else { - zend_error(E_WARNING,"invalid type '%s' passed to xmlrpc_set_type()", Z_STRVAL_PP(type)); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string xmlrpc_get_type(mixed value) - Gets xmlrpc type for a PHP value. Especially useful for base64 and datetime strings */ -PHP_FUNCTION(xmlrpc_get_type) -{ - zval **arg; - XMLRPC_VALUE_TYPE type; - XMLRPC_VECTOR_TYPE vtype = xmlrpc_vector_none; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - type = get_zval_xmlrpc_type(*arg, 0); - if (type == xmlrpc_vector) { - vtype = determine_vector_type((Z_TYPE_PP(arg) == IS_OBJECT) ? Z_OBJPROP_PP(arg) : Z_ARRVAL_PP(arg)); - } - - RETURN_STRING((char*) xmlrpc_type_as_str(type, vtype), 1); -} -/* }}} */ - -/* {{{ proto bool xmlrpc_is_fault(array) - Determines if an array value represents an XMLRPC fault. */ -PHP_FUNCTION(xmlrpc_is_fault) -{ - zval **arg, **val; - - if (ZEND_NUM_ARGS() != 1 || (zend_get_parameters_ex(1, &arg) == FAILURE)) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(arg) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array argument expected"); - } else { - /* The "correct" way to do this would be to call the xmlrpc - * library XMLRPC_ValueIsFault() func. However, doing that - * would require us to create an xmlrpc value from the php - * array, which is rather expensive, especially if it was - * a big array. Thus, we resort to this not so clever hackery. - */ - if (zend_hash_find(Z_ARRVAL_PP(arg), FAULT_CODE, FAULT_CODE_LEN + 1, (void**) &val) == SUCCESS && - zend_hash_find(Z_ARRVAL_PP(arg), FAULT_STRING, FAULT_STRING_LEN + 1, (void**) &val) == SUCCESS) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ - diff --git a/ext/xmlrpc/xmlrpc.dsp b/ext/xmlrpc/xmlrpc.dsp deleted file mode 100644 index 8c455d3fcd775..0000000000000 --- a/ext/xmlrpc/xmlrpc.dsp +++ /dev/null @@ -1,211 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlrpc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=xmlrpc - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "xmlrpc.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "xmlrpc.mak" CFG="xmlrpc - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "xmlrpc - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "xmlrpc - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "xmlrpc - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libxmlrpc" /I "..\..\bundle\expat" /D HAVE_XMLRPC=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D ZTS=1 /D COMPILE_DL_XMLRPC=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x1009 /d "_DEBUG" -# ADD RSC /l 0x1009 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib expat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_xmlrpc.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ELSEIF "$(CFG)" == "xmlrpc - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libxmlrpc" /I "..\..\bundle\expat" /D HAVE_XMLRPC=1 /D "ZEND_WIN32" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D ZTS=1 /D COMPILE_DL_XMLRPC=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x1009 /d "NDEBUG" -# ADD RSC /l 0x1009 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib expat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xmlrpc.dll" /libpath:"..\..\Release_TS" - -!ENDIF - -# Begin Target - -# Name "xmlrpc - Win32 Debug_TS" -# Name "xmlrpc - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=".\xmlrpc-epi-php.c" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_xmlrpc.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Group "libxmlrpc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\libxmlrpc\base64.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\base64.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\encodings.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\encodings.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\queue.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\queue.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\simplestring.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\simplestring.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\system_methods.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\system_methods_private.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_element.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_element.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_dandarpc.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_dandarpc.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_soap.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_soap.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_xmlrpc.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xml_to_xmlrpc.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc_introspection.c -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc_introspection.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc_introspection_private.h -# End Source File -# Begin Source File - -SOURCE=.\libxmlrpc\xmlrpc_private.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/xmlwriter/CREDITS b/ext/xmlwriter/CREDITS deleted file mode 100644 index e40bc651a59ef..0000000000000 --- a/ext/xmlwriter/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -XMLWriter -Rob Richards, Pierre-Alain Joye diff --git a/ext/xmlwriter/TODO b/ext/xmlwriter/TODO deleted file mode 100644 index bfc895d769194..0000000000000 --- a/ext/xmlwriter/TODO +++ /dev/null @@ -1,5 +0,0 @@ -- Fix up config file for PHP 5 to use libxml extension configuration -- Add tests for Namespace functions/methods -- Sync with xmlwriter (new dtd func?) -- Write documentations in docbook - diff --git a/ext/xmlwriter/config.m4 b/ext/xmlwriter/config.m4 deleted file mode 100644 index 0a5d079430095..0000000000000 --- a/ext/xmlwriter/config.m4 +++ /dev/null @@ -1,26 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(xmlwriter, whether to enable XMLWriter support, -[ --disable-xmlwriter Disable XMLWriter support], yes) - -if test -z "$PHP_LIBXML_DIR"; then - PHP_ARG_WITH(libxml-dir, libxml2 install dir, - [ --with-libxml-dir=DIR XMLWriter: libxml2 install prefix], no, no) -fi - -if test "$PHP_XMLWRITER" != "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([XMLWriter extension requires LIBXML extension, add --enable-libxml]) - fi - - PHP_SETUP_LIBXML(XMLWRITER_SHARED_LIBADD, [ - AC_DEFINE(HAVE_XMLWRITER,1,[ ]) - PHP_NEW_EXTENSION(xmlwriter, php_xmlwriter.c, $ext_shared) - PHP_SUBST(XMLWRITER_SHARED_LIBADD) - ], [ - AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.]) - ]) -fi diff --git a/ext/xmlwriter/config.w32 b/ext/xmlwriter/config.w32 deleted file mode 100644 index 31977ef7808e6..0000000000000 --- a/ext/xmlwriter/config.w32 +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("xmlwriter", "XMLWriter support", "yes"); - -if (PHP_XMLWRITER == "yes" && PHP_LIBXML == "yes") { - if (CHECK_HEADER_ADD_INCLUDE('libxml/xmlwriter.h', 'CFLAGS_XMLWRITER', PHP_XMLWRITER)) { - EXTENSION("xmlwriter", "php_xmlwriter.c"); - AC_DEFINE("HAVE_XMLWRITER", 1, "XMLWriter support"); - if (!PHP_XMLWRITER_SHARED) { - ADD_FLAG("CFLAGS_XMLWRITER", "/D LIBXML_STATIC"); - } - ADD_EXTENSION_DEP('xmlwriter', 'libxml'); - } else { - WARNING('Could not find xmlwriter.h'); - } -} - diff --git a/ext/xmlwriter/examples/xmlwriter_file.php b/ext/xmlwriter/examples/xmlwriter_file.php deleted file mode 100644 index 13bb262334bb7..0000000000000 --- a/ext/xmlwriter/examples/xmlwriter_file.php +++ /dev/null @@ -1,44 +0,0 @@ -openUri('test.xml'); -$xw->startDocument("1.0"); -$xw->startElement("book"); -$xw->text("example"); -$xw->endElement(); -$xw->endDocument(); -$xw->flush(0); diff --git a/ext/xmlwriter/package.xml b/ext/xmlwriter/package.xml deleted file mode 100644 index 01f7ad4424c4a..0000000000000 --- a/ext/xmlwriter/package.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - xmlwriter - Provides fast, non-cached, forward-only means to write XML data. - This extension wraps the libxml xmlWriter API. Represents a writer that provides a non-cached, forward-only means of generating streams or files containing XML data. - - PHP - - - rrichards - Rob Richards - rrichards@php.net - lead - - - - pajoye - Pierre-Alain Joye - pajoye@php.net - developer - - - 2.0.2 - 2005-12-01 - stable - - fix build under 5.0 -- fix crash when XMLWriter is instantiated but not used -- Switch from BSD-like license to PHP License 3.01 - - - - - 2.0.0 - 2005-08-07 - stable - - fix tests using UTF-8 - move to stable state - - - - - 1.1.0 - 2005-05-24 - beta - - Add OO interface (php5 only) - Add test cases - - - - - 2.0.1 - 2005-11-15 - stable - - Switch from PHP License to BSD-like license -- Allow recursive calls to __get/__set for different properties (ilia) - - - 1.0 - 2005-05-02 - stable - - Many Bug Fixes - Use PHP streams under PHP 4 - Add xmlwriter_flush function to flush buffer - Add support for xmlTextWriterStart/EndComment - - - - 0.1 - 2004-07-20 - alpha - Initial Release - - - 0.2 - 2004-10-08 - alpha - Fix bug 2482 and other function parameters - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/xmlwriter/package2.xml b/ext/xmlwriter/package2.xml deleted file mode 100644 index ec6ef313b160a..0000000000000 --- a/ext/xmlwriter/package2.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - xmlwriter - pecl.php.net - Provides fast, non-cached, forward-only means to write XML data. - This extension wraps the libxml xmlWriter API. Represents a writer that provides a non-cached, forward-only means of generating streams or files containing XML data. - - - Rob Richards - rrichards - rrichards@php.net - yes - - - Pierre-Alain Joye - pajoye - pajoye@php.net - yes - - 2005-12-01 - - 2.0.2 - 2.0.0 - - - stable - stable - - PHP - - fix build under 5.0 -- fix crash when XMLWriter is instantiated but not used -- Switch from BSD-like license to PHP License 3.01 - - - - - - - - - - - - - - - - - - - - - - - 4.3.0 - - - 1.4.0a2 - - - - xmlwriter - - - - - 2.0.1 - 2.0.0 - - - stable - stable - - BSD - - Switch from PHP License to BSD-like license -- Allow recursive calls to __get/__set for different properties (ilia) - - - - 2005-08-07 - - - 2.0.0 - 2.0.0 - - - stable - stable - - PHP License - Promote to stable - - - diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c deleted file mode 100644 index 65e3d54e70c44..0000000000000 --- a/ext/xmlwriter/php_xmlwriter.c +++ /dev/null @@ -1,1667 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Rob Richards | - | Pierre-A. Joye | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_xmlwriter.h" - - -#if LIBXML_VERSION >= 20605 -static PHP_FUNCTION(xmlwriter_set_indent); -static PHP_FUNCTION(xmlwriter_set_indent_string); -#endif -static PHP_FUNCTION(xmlwriter_start_attribute); -static PHP_FUNCTION(xmlwriter_end_attribute); -static PHP_FUNCTION(xmlwriter_write_attribute); -#if LIBXML_VERSION > 20617 -static PHP_FUNCTION(xmlwriter_start_attribute_ns); -static PHP_FUNCTION(xmlwriter_write_attribute_ns); -#endif -static PHP_FUNCTION(xmlwriter_start_element); -static PHP_FUNCTION(xmlwriter_end_element); -static PHP_FUNCTION(xmlwriter_full_end_element); -static PHP_FUNCTION(xmlwriter_start_element_ns); -static PHP_FUNCTION(xmlwriter_write_element); -static PHP_FUNCTION(xmlwriter_write_element_ns); -static PHP_FUNCTION(xmlwriter_start_pi); -static PHP_FUNCTION(xmlwriter_end_pi); -static PHP_FUNCTION(xmlwriter_write_pi); -static PHP_FUNCTION(xmlwriter_start_cdata); -static PHP_FUNCTION(xmlwriter_end_cdata); -static PHP_FUNCTION(xmlwriter_write_cdata); -static PHP_FUNCTION(xmlwriter_text); -static PHP_FUNCTION(xmlwriter_write_raw); -static PHP_FUNCTION(xmlwriter_start_document); -static PHP_FUNCTION(xmlwriter_end_document); -#if LIBXML_VERSION >= 20607 -static PHP_FUNCTION(xmlwriter_start_comment); -static PHP_FUNCTION(xmlwriter_end_comment); -#endif -static PHP_FUNCTION(xmlwriter_write_comment); -static PHP_FUNCTION(xmlwriter_start_dtd); -static PHP_FUNCTION(xmlwriter_end_dtd); -static PHP_FUNCTION(xmlwriter_write_dtd); -static PHP_FUNCTION(xmlwriter_start_dtd_element); -static PHP_FUNCTION(xmlwriter_end_dtd_element); -static PHP_FUNCTION(xmlwriter_write_dtd_element); -#if LIBXML_VERSION > 20608 -static PHP_FUNCTION(xmlwriter_start_dtd_attlist); -static PHP_FUNCTION(xmlwriter_end_dtd_attlist); -static PHP_FUNCTION(xmlwriter_write_dtd_attlist); -static PHP_FUNCTION(xmlwriter_start_dtd_entity); -static PHP_FUNCTION(xmlwriter_end_dtd_entity); -static PHP_FUNCTION(xmlwriter_write_dtd_entity); -#endif -static PHP_FUNCTION(xmlwriter_open_uri); -static PHP_FUNCTION(xmlwriter_open_memory); -static PHP_FUNCTION(xmlwriter_output_memory); -static PHP_FUNCTION(xmlwriter_flush); - -static zend_class_entry *xmlwriter_class_entry_ce; - -static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC); -static void xmlwriter_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -typedef int (*xmlwriter_read_one_char_t)(xmlTextWriterPtr writer, const xmlChar *content); -typedef int (*xmlwriter_read_int_t)(xmlTextWriterPtr writer); - -/* {{{ xmlwriter_object_free_storage */ -static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC) -{ - if (intern) { - if (intern->ptr) { - xmlFreeTextWriter(intern->ptr); - intern->ptr = NULL; - } - if (intern->output) { - xmlBufferFree(intern->output); - intern->output = NULL; - } - efree(intern); - } -} -/* }}} */ - -#ifdef ZEND_ENGINE_2 -/* {{{ XMLWRITER_FROM_OBJECT */ -#define XMLWRITER_FROM_OBJECT(intern, object) \ - { \ - ze_xmlwriter_object *obj = (ze_xmlwriter_object*) zend_object_store_get_object(object TSRMLS_CC); \ - intern = obj->xmlwriter_ptr; \ - if (!intern) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or unitialized XMLWriter object"); \ - RETURN_FALSE; \ - } \ - } -/* }}} */ - -static zend_object_handlers xmlwriter_object_handlers; - -/* {{{ xmlwriter_object_free_storage */ -static void xmlwriter_object_free_storage(void *object TSRMLS_DC) -{ - ze_xmlwriter_object * intern = (ze_xmlwriter_object *) object; - if (!intern) { - return; - } - if (intern->xmlwriter_ptr) { - xmlwriter_free_resource_ptr(intern->xmlwriter_ptr TSRMLS_CC); - } - intern->xmlwriter_ptr = NULL; - zend_object_std_dtor(&intern->zo TSRMLS_CC); - - efree(intern); -} -/* }}} */ - - -/* {{{ xmlwriter_object_new */ -static zend_object_value xmlwriter_object_new(zend_class_entry *class_type TSRMLS_DC) -{ - ze_xmlwriter_object *intern; - zval *tmp; - zend_object_value retval; - - intern = emalloc(sizeof(ze_xmlwriter_object)); - memset(&intern->zo, 0, sizeof(zend_object)); - intern->xmlwriter_ptr = NULL; - - zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, - (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(intern, - NULL, - (zend_objects_free_object_storage_t) xmlwriter_object_free_storage, - NULL TSRMLS_CC); - - retval.handlers = (zend_object_handlers *) & xmlwriter_object_handlers; - - return retval; -} -/* }}} */ -#endif - -#define XMLW_NAME_CHK(__err) \ - if (xmlValidateName((xmlChar *) name, 0) != 0) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", __err); \ - RETURN_FALSE; \ - } \ - -/* {{{ xmlwriter_functions */ -static zend_function_entry xmlwriter_functions[] = { - PHP_FE(xmlwriter_open_uri, NULL) - PHP_FE(xmlwriter_open_memory, NULL) -#if LIBXML_VERSION >= 20605 - PHP_FE(xmlwriter_set_indent, NULL) - PHP_FE(xmlwriter_set_indent_string, NULL) -#endif -#if LIBXML_VERSION >= 20607 - PHP_FE(xmlwriter_start_comment, NULL) - PHP_FE(xmlwriter_end_comment, NULL) -#endif - PHP_FE(xmlwriter_start_attribute, NULL) - PHP_FE(xmlwriter_end_attribute, NULL) - PHP_FE(xmlwriter_write_attribute, NULL) -#if LIBXML_VERSION > 20617 - PHP_FE(xmlwriter_start_attribute_ns,NULL) - PHP_FE(xmlwriter_write_attribute_ns,NULL) -#endif - PHP_FE(xmlwriter_start_element, NULL) - PHP_FE(xmlwriter_end_element, NULL) - PHP_FE(xmlwriter_full_end_element, NULL) - PHP_FE(xmlwriter_start_element_ns, NULL) - PHP_FE(xmlwriter_write_element, NULL) - PHP_FE(xmlwriter_write_element_ns, NULL) - PHP_FE(xmlwriter_start_pi, NULL) - PHP_FE(xmlwriter_end_pi, NULL) - PHP_FE(xmlwriter_write_pi, NULL) - PHP_FE(xmlwriter_start_cdata, NULL) - PHP_FE(xmlwriter_end_cdata, NULL) - PHP_FE(xmlwriter_write_cdata, NULL) - PHP_FE(xmlwriter_text, NULL) - PHP_FE(xmlwriter_write_raw, NULL) - PHP_FE(xmlwriter_start_document, NULL) - PHP_FE(xmlwriter_end_document, NULL) - PHP_FE(xmlwriter_write_comment, NULL) - PHP_FE(xmlwriter_start_dtd, NULL) - PHP_FE(xmlwriter_end_dtd, NULL) - PHP_FE(xmlwriter_write_dtd, NULL) - PHP_FE(xmlwriter_start_dtd_element, NULL) - PHP_FE(xmlwriter_end_dtd_element, NULL) - PHP_FE(xmlwriter_write_dtd_element, NULL) -#if LIBXML_VERSION > 20608 - PHP_FE(xmlwriter_start_dtd_attlist, NULL) - PHP_FE(xmlwriter_end_dtd_attlist, NULL) - PHP_FE(xmlwriter_write_dtd_attlist, NULL) - PHP_FE(xmlwriter_start_dtd_entity, NULL) - PHP_FE(xmlwriter_end_dtd_entity, NULL) - PHP_FE(xmlwriter_write_dtd_entity, NULL) -#endif - PHP_FE(xmlwriter_output_memory, NULL) - PHP_FE(xmlwriter_flush, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -#ifdef ZEND_ENGINE_2 -/* {{{ xmlwriter_class_functions */ -static zend_function_entry xmlwriter_class_functions[] = { - PHP_ME_MAPPING(openUri, xmlwriter_open_uri, NULL, 0) - PHP_ME_MAPPING(openMemory, xmlwriter_open_memory, NULL, 0) -#if LIBXML_VERSION >= 20605 - PHP_ME_MAPPING(setIndent, xmlwriter_set_indent, NULL, 0) - PHP_ME_MAPPING(setIndentString, xmlwriter_set_indent_string, NULL, 0) -#endif -#if LIBXML_VERSION >= 20607 - PHP_ME_MAPPING(startComment, xmlwriter_start_comment, NULL, 0) - PHP_ME_MAPPING(endComment, xmlwriter_end_comment, NULL, 0) -#endif - PHP_ME_MAPPING(startAttribute, xmlwriter_start_attribute, NULL, 0) - PHP_ME_MAPPING(endAttribute, xmlwriter_end_attribute, NULL, 0) - PHP_ME_MAPPING(writeAttribute, xmlwriter_write_attribute, NULL, 0) -#if LIBXML_VERSION > 20617 - PHP_ME_MAPPING(startAttributeNs, xmlwriter_start_attribute_ns,NULL, 0) - PHP_ME_MAPPING(writeAttributeNs, xmlwriter_write_attribute_ns,NULL, 0) -#endif - PHP_ME_MAPPING(startElement, xmlwriter_start_element, NULL, 0) - PHP_ME_MAPPING(endElement, xmlwriter_end_element, NULL, 0) - PHP_ME_MAPPING(fullEndElement, xmlwriter_full_end_element, NULL, 0) - PHP_ME_MAPPING(startElementNs, xmlwriter_start_element_ns, NULL, 0) - PHP_ME_MAPPING(writeElement, xmlwriter_write_element, NULL, 0) - PHP_ME_MAPPING(writeElementNs, xmlwriter_write_element_ns, NULL, 0) - PHP_ME_MAPPING(startPi, xmlwriter_start_pi, NULL, 0) - PHP_ME_MAPPING(endPi, xmlwriter_end_pi, NULL, 0) - PHP_ME_MAPPING(writePi, xmlwriter_write_pi, NULL, 0) - PHP_ME_MAPPING(startCdata, xmlwriter_start_cdata, NULL, 0) - PHP_ME_MAPPING(endCdata, xmlwriter_end_cdata, NULL, 0) - PHP_ME_MAPPING(writeCdata, xmlwriter_write_cdata, NULL, 0) - PHP_ME_MAPPING(text, xmlwriter_text, NULL, 0) - PHP_ME_MAPPING(writeRaw, xmlwriter_write_raw, NULL, 0) - PHP_ME_MAPPING(startDocument, xmlwriter_start_document, NULL, 0) - PHP_ME_MAPPING(endDocument, xmlwriter_end_document, NULL, 0) - PHP_ME_MAPPING(writeComment, xmlwriter_write_comment, NULL, 0) - PHP_ME_MAPPING(startDtd, xmlwriter_start_dtd, NULL, 0) - PHP_ME_MAPPING(endDtd, xmlwriter_end_dtd, NULL, 0) - PHP_ME_MAPPING(writeDtd, xmlwriter_write_dtd, NULL, 0) - PHP_ME_MAPPING(startDtdElement, xmlwriter_start_dtd_element, NULL, 0) - PHP_ME_MAPPING(endDtdElement, xmlwriter_end_dtd_element, NULL, 0) - PHP_ME_MAPPING(writeDtdElement, xmlwriter_write_dtd_element, NULL, 0) -#if LIBXML_VERSION > 20608 - PHP_ME_MAPPING(startDtdAttlist, xmlwriter_start_dtd_attlist, NULL, 0) - PHP_ME_MAPPING(endDtdAttlist, xmlwriter_end_dtd_attlist, NULL, 0) - PHP_ME_MAPPING(writeDtdAttlist, xmlwriter_write_dtd_attlist, NULL, 0) - PHP_ME_MAPPING(startDtdEntity, xmlwriter_start_dtd_entity, NULL, 0) - PHP_ME_MAPPING(endDtdEntity, xmlwriter_end_dtd_entity, NULL, 0) - PHP_ME_MAPPING(writeDtdEntity, xmlwriter_write_dtd_entity, NULL, 0) -#endif - PHP_ME_MAPPING(outputMemory, xmlwriter_output_memory, NULL, 0) - PHP_ME_MAPPING(flush, xmlwriter_flush, NULL, 0) - {NULL, NULL, NULL} -}; -/* }}} */ -#endif - -/* {{{ function prototypes */ -static PHP_MINIT_FUNCTION(xmlwriter); -static PHP_MSHUTDOWN_FUNCTION(xmlwriter); -static PHP_MINFO_FUNCTION(xmlwriter); - -static int le_xmlwriter; -/* }}} */ - -/* _xmlwriter_get_valid_file_path should be made a - common function in libxml extension as code is common to a few xml extensions */ -/* {{{ _xmlwriter_get_valid_file_path */ -static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) { - xmlURI *uri; - xmlChar *escsource; - char *file_dest; - int isFileUri = 0; - - uri = xmlCreateURI(); - escsource = xmlURIEscapeStr((xmlChar *)source, (xmlChar *) ":"); - xmlParseURIReference(uri, (char *)escsource); - xmlFree(escsource); - - if (uri->scheme != NULL) { - /* absolute file uris - libxml only supports localhost or empty host */ - if (strncasecmp(source, "file:///",8) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 8; -#else - source += 7; -#endif - } else if (strncasecmp(source, "file://localhost/",17) == 0) { - isFileUri = 1; -#ifdef PHP_WIN32 - source += 17; -#else - source += 16; -#endif - } - } - - file_dest = source; - - if ((uri->scheme == NULL || isFileUri)) { - if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) { - xmlFreeURI(uri); - return NULL; - } - file_dest = resolved_path; - } - - xmlFreeURI(uri); - - return file_dest; -} -/* }}} */ - -#ifndef ZEND_ENGINE_2 -/* Channel libxml file io layer through the PHP streams subsystem. - * This allows use of ftps:// and https:// urls */ - -/* {{{ php_xmlwriter_streams_IO_open_write_wrapper */ -static void *php_xmlwriter_streams_IO_open_write_wrapper(const char *filename TSRMLS_DC) -{ - php_stream_wrapper *wrapper = NULL; - void *ret_val = NULL; - - ret_val = php_stream_open_wrapper_ex((char *)filename, "wb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, NULL); - return ret_val; -} -/* }}} */ - -/* {{{ php_xmlwriter_streams_IO_write */ -static int php_xmlwriter_streams_IO_write(void *context, const char *buffer, int len) -{ - TSRMLS_FETCH(); - return php_stream_write((php_stream*)context, buffer, len); -} -/* }}} */ - -/* {{{ php_xmlwriter_streams_IO_close */ -static int php_xmlwriter_streams_IO_close(void *context) -{ - TSRMLS_FETCH(); - return php_stream_close((php_stream*)context); -} -/* }}} */ -#endif - -/* {{{ xmlwriter_module_entry - */ -zend_module_entry xmlwriter_module_entry = { - STANDARD_MODULE_HEADER, - "xmlwriter", - xmlwriter_functions, - PHP_MINIT(xmlwriter), - PHP_MSHUTDOWN(xmlwriter), - NULL, - NULL, - PHP_MINFO(xmlwriter), - "0.1", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_XMLWRITER -ZEND_GET_MODULE(xmlwriter) -#endif - -/* {{{ xmlwriter_objects_clone -static void xmlwriter_objects_clone(void *object, void **object_clone TSRMLS_DC) -{ - TODO -} -}}} */ - -/* {{{ xmlwriter_dtor */ -static void xmlwriter_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { - xmlwriter_object *intern; - - intern = (xmlwriter_object *) rsrc->ptr; - xmlwriter_free_resource_ptr(intern TSRMLS_CC); -} -/* }}} */ - -static void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_one_char_t internal_function, char *err_string) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name; - int name_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &name, &name_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - if (err_string != NULL) { - XMLW_NAME_CHK(err_string); - } - - ptr = intern->ptr; - - if (ptr) { - retval = internal_function(ptr, (xmlChar *) name); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} - -static void php_xmlwriter_end(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_int_t internal_function) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - int retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - XMLWRITER_FROM_OBJECT(intern, this); - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = internal_function(ptr); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} - -#if LIBXML_VERSION >= 20605 -/* {{{ proto bool xmlwriter_set_indent(resource xmlwriter, bool indent) -Toggle indentation on/off - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_set_indent) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - int retval; - zend_bool indent; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &indent) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &pind, &indent) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - - ptr = intern->ptr; - if (ptr) { - retval = xmlTextWriterSetIndent(ptr, indent); - if (retval == 0) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_set_indent_string(resource xmlwriter, string indentString) -Set string used for indenting - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_set_indent_string) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterSetIndentString, NULL); -} -/* }}} */ - -#endif - -/* {{{ proto bool xmlwriter_start_attribute(resource xmlwriter, string name) -Create start attribute - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_attribute) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartAttribute, "Invalid Attribute Name"); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_attribute(resource xmlwriter) -End attribute - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_attribute) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndAttribute); -} -/* }}} */ - -#if LIBXML_VERSION > 20617 -/* {{{ proto bool xmlwriter_start_attribute_ns(resource xmlwriter, string prefix, string name, string uri) -Create start namespaced attribute - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_attribute_ns) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *prefix, *uri; - int name_len, prefix_len, uri_len, retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss!", - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss!", &pind, - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartAttributeNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ -#endif - -/* {{{ proto bool xmlwriter_write_attribute(resource xmlwriter, string name, string content) -Write full attribute - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_attribute) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteAttribute(ptr, (xmlChar *)name, (xmlChar *)content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -#if LIBXML_VERSION > 20617 -/* {{{ proto bool xmlwriter_write_attribute_ns(resource xmlwriter, string prefix, string name, string uri, string content) -Write full namespaced attribute - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_attribute_ns) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *prefix, *uri, *content; - int name_len, prefix_len, uri_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss!s", - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss!s", &pind, - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteAttributeNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri, (xmlChar *)content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ -#endif - -/* {{{ proto bool xmlwriter_start_element(resource xmlwriter, string name) -Create start element tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_element) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartElement, "Invalid Element Name"); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_element_ns(resource xmlwriter, string prefix, string name, string uri) -Create start namespaced element tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_element_ns) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *prefix, *uri; - int name_len, prefix_len, uri_len, retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss!", - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss!", &pind, - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartElementNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri); - if (retval != -1) { - RETURN_TRUE; - } - - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_element(resource xmlwriter) -End current element - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_element) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndElement); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_full_end_element(resource xmlwriter) -End current element - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_full_end_element) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterFullEndElement); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_element(resource xmlwriter, string name[, string content]) -Write full element tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_element) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content = NULL; - int name_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - if (!content) { - retval = xmlTextWriterStartElement(ptr, (xmlChar *)name); - if (retval == -1) { - RETURN_FALSE; - } - xmlTextWriterEndElement(ptr); - if (retval == -1) { - RETURN_FALSE; - } - } else { - retval = xmlTextWriterWriteElement(ptr, (xmlChar *)name, (xmlChar *)content); - } - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_element_ns(resource xmlwriter, string prefix, string name, string uri[, string content]) -Write full namesapced element tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_element_ns) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *prefix, *uri, *content = NULL; - int name_len, prefix_len, uri_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss!|s!", - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss!|s!", &pind, - &prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - if (!content) { - retval = xmlTextWriterStartElementNS(ptr,(xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri); - if (retval == -1) { - RETURN_FALSE; - } - retval = xmlTextWriterEndElement(ptr); - if (retval == -1) { - RETURN_FALSE; - } - } else { - retval = xmlTextWriterWriteElementNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri, (xmlChar *)content); - } - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_pi(resource xmlwriter, string target) -Create start PI tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_pi) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartPI, "Invalid PI Target"); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_pi(resource xmlwriter) -End current PI - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_pi) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndPI); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_pi(resource xmlwriter, string target, string content) -Write full PI tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_pi) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid PI Target"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWritePI(ptr, (xmlChar *)name, (xmlChar *)content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_cdata(resource xmlwriter) -Create start CDATA tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_cdata) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - int retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartCDATA(ptr); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_cdata(resource xmlwriter) -End current CDATA - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_cdata) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndCDATA); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_cdata(resource xmlwriter, string content) -Write full CDATA tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_cdata) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterWriteCDATA, NULL); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_raw(resource xmlwriter, string content) -Write text - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_raw) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterWriteRaw, NULL); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_text(resource xmlwriter, string content) -Write text - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_text) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterWriteString, NULL); -} -/* }}} */ - -#if LIBXML_VERSION >= 20607 -/* {{{ proto bool xmlwriter_start_comment(resource xmlwriter) -Create start comment - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_comment) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - int retval; -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartComment(ptr); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_comment(resource xmlwriter) -Create end comment - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_comment) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndComment); -} -/* }}} */ -#endif /* LIBXML_VERSION >= 20607 */ - - -/* {{{ proto bool xmlwriter_write_comment(resource xmlwriter, string content) -Write full comment tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_comment) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterWriteComment, NULL); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_document(resource xmlwriter, string version, string encoding, string standalone) -Create document tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_document) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *version = NULL, *enc = NULL, *alone = NULL; - int version_len, enc_len, alone_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!", &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!s!s!", &pind, &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartDocument(ptr, version, enc, alone); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_document(resource xmlwriter) -End current document - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_document) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDocument); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_dtd(resource xmlwriter, string name, string pubid, string sysid) -Create start DTD tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_dtd) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *pubid = NULL, *sysid = NULL; - int name_len, pubid_len, sysid_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) { - return; - } - - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartDTD(ptr, (xmlChar *)name, (xmlChar *)pubid, (xmlChar *)sysid); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_dtd(resource xmlwriter) -End current DTD - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_dtd) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDTD); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_dtd(resource xmlwriter, string name, string pubid, string sysid, string subset) -Write full DTD tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_dtd) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *pubid = NULL, *sysid = NULL, *subset = NULL; - int name_len, pubid_len, sysid_len, subset_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) { - return; - } - - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteDTD(ptr, (xmlChar *)name, (xmlChar *)pubid, (xmlChar *)sysid, (xmlChar *)subset); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_dtd_element(resource xmlwriter, string name) -Create start DTD element - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_dtd_element) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDElement, "Invalid Element Name"); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_dtd_element(resource xmlwriter) -End current DTD element - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_dtd_element) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDTDElement); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_dtd_element(resource xmlwriter, string name, string content) -Write full DTD element tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_dtd_element) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteDTDElement(ptr, (xmlChar *)name, (xmlChar *)content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -#if LIBXML_VERSION > 20608 -/* {{{ proto bool xmlwriter_start_dtd_attlist(resource xmlwriter, string name) -Create start DTD AttList - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_dtd_attlist) -{ - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDAttlist, "Invalid Element Name"); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_dtd_attlist(resource xmlwriter) -End current DTD AttList - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_dtd_attlist) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDTDAttlist); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_dtd_attlist(resource xmlwriter, string name, string content) -Write full DTD AttList tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_dtd_attlist) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind, - &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteDTDAttlist(ptr, (xmlChar *)name, (xmlChar *)content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_start_dtd_entity(resource xmlwriter, string name, bool isparam) -Create start DTD Entity - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_start_dtd_entity) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name; - int name_len, retval; - zend_bool isparm; - - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sb", &name, &name_len, &isparm) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsb", &pind, &name, &name_len, &isparm) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Attribute Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterStartDTDEntity(ptr, isparm, (xmlChar *)name); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool xmlwriter_end_dtd_entity(resource xmlwriter) -End current DTD Entity - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_end_dtd_entity) -{ - php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDTDEntity); -} -/* }}} */ - -/* {{{ proto bool xmlwriter_write_dtd_entity(resource xmlwriter, string name, string content [, int pe [, string pubid [, string sysid [, string ndataid]]]]) -Write full DTD Entity tag - returns FALSE on error */ -static PHP_FUNCTION(xmlwriter_write_dtd_entity) -{ - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *name, *content; - int name_len, content_len, retval; - /* Optional parameters */ - char *pubid = NULL, *sysid = NULL, *ndataid = NULL; - zend_bool pe = 0; - int pubid_len, sysid_len, ndataid_len; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bsss", - &name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len, - &sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|bsss", &pind, - &name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len, - &sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - - XMLW_NAME_CHK("Invalid Element Name"); - - ptr = intern->ptr; - - if (ptr) { - retval = xmlTextWriterWriteDTDEntity(ptr, pe, (xmlChar *)name, (xmlChar *)pubid, (xmlChar *)sysid, (xmlChar *)ndataid, (xmlChar *)content); - if (retval != -1) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ -#endif - -/* {{{ proto resource xmlwriter_open_uri(resource xmlwriter, string source) -Create new xmlwriter using source uri for output */ -static PHP_FUNCTION(xmlwriter_open_uri) -{ - char *valid_file = NULL; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - char *source; - char resolved_path[MAXPATHLEN + 1]; - int source_len; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - ze_xmlwriter_object *ze_obj = NULL; -#endif - -#ifndef ZEND_ENGINE_2 - xmlOutputBufferPtr out_buffer; - void *ioctx; -#endif - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) { - return; - } - -#ifdef ZEND_ENGINE_2 - if (this) { - /* We do not use XMLWRITER_FROM_OBJECT, xmlwriter init function here */ - ze_obj = (ze_xmlwriter_object*) zend_object_store_get_object(this TSRMLS_CC); - } -#endif - - if (source_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source"); - RETURN_FALSE; - } - - valid_file = _xmlwriter_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); - if (!valid_file) { - RETURN_FALSE; - } - -#ifndef ZEND_ENGINE_2 - ioctx = php_xmlwriter_streams_IO_open_write_wrapper(valid_file TSRMLS_CC); - if (ioctx == NULL) { - RETURN_FALSE; - } - - out_buffer = xmlOutputBufferCreateIO(php_xmlwriter_streams_IO_write, - php_xmlwriter_streams_IO_close, ioctx, NULL); - - if (out_buffer == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create output buffer"); - RETURN_FALSE; - } - ptr = xmlNewTextWriter(out_buffer); -#else - ptr = xmlNewTextWriterFilename(valid_file, 0); -#endif - - if (!ptr) { - RETURN_FALSE; - } - - intern = emalloc(sizeof(xmlwriter_object)); - intern->ptr = ptr; - intern->output = NULL; -#ifndef ZEND_ENGINE_2 - intern->uri_output = out_buffer; -#else - if (this) { - if (ze_obj->xmlwriter_ptr) { - xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr TSRMLS_CC); - } - ze_obj->xmlwriter_ptr = intern; - RETURN_TRUE; - } else -#endif - { - ZEND_REGISTER_RESOURCE(return_value,intern,le_xmlwriter); - } -} -/* }}} */ - -/* {{{ proto resource xmlwriter_open_memory() -Create new xmlwriter using memory for string output */ -static PHP_FUNCTION(xmlwriter_open_memory) -{ - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - xmlBufferPtr buffer; - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - ze_xmlwriter_object *ze_obj = NULL; -#endif - -#ifdef ZEND_ENGINE_2 - if (this) { - /* We do not use XMLWRITER_FROM_OBJECT, xmlwriter init function here */ - ze_obj = (ze_xmlwriter_object*) zend_object_store_get_object(this TSRMLS_CC); - } -#endif - - buffer = xmlBufferCreate(); - - if (buffer == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create output buffer"); - RETURN_FALSE; - } - - ptr = xmlNewTextWriterMemory(buffer, 0); - if (! ptr) { - xmlBufferFree(buffer); - RETURN_FALSE; - } - - intern = emalloc(sizeof(xmlwriter_object)); - intern->ptr = ptr; - intern->output = buffer; -#ifndef ZEND_ENGINE_2 - intern->uri_output = NULL; -#else - if (this) { - if (ze_obj->xmlwriter_ptr) { - xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr TSRMLS_CC); - } - ze_obj->xmlwriter_ptr = intern; - RETURN_TRUE; - } else -#endif - { - ZEND_REGISTER_RESOURCE(return_value,intern,le_xmlwriter); - } - -} -/* }}} */ - -/* {{{ php_xmlwriter_flush */ -static void php_xmlwriter_flush(INTERNAL_FUNCTION_PARAMETERS, int force_string) { - zval *pind; - xmlwriter_object *intern; - xmlTextWriterPtr ptr; - xmlBufferPtr buffer; - zend_bool empty = 1; - int output_bytes; - - -#ifdef ZEND_ENGINE_2 - zval *this = getThis(); - - if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &empty) == FAILURE) { - return; - } - XMLWRITER_FROM_OBJECT(intern, this); - } else -#endif - { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &pind, &empty) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, &pind, -1, "XMLWriter", le_xmlwriter); - } - ptr = intern->ptr; - - if (ptr) { - buffer = intern->output; - if (force_string == 1 && buffer == NULL) { - RETURN_EMPTY_STRING(); - } - output_bytes = xmlTextWriterFlush(ptr); - if (buffer) { - RETVAL_STRING((char *) buffer->content, 1); - if (empty) { - xmlBufferEmpty(buffer); - } - } else { - RETVAL_LONG(output_bytes); - } - return; - } - - RETURN_EMPTY_STRING(); -} -/* }}} */ - -/* {{{ proto string xmlwriter_output_memory(resource xmlwriter [,bool flush]) -Output current buffer as string */ -static PHP_FUNCTION(xmlwriter_output_memory) -{ - php_xmlwriter_flush(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto mixed xmlwriter_flush(resource xmlwriter [,bool empty]) -Output current buffer */ -static PHP_FUNCTION(xmlwriter_flush) -{ - php_xmlwriter_flush(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -static PHP_MINIT_FUNCTION(xmlwriter) -{ -#ifdef ZEND_ENGINE_2 - zend_class_entry ce; -#endif - - le_xmlwriter = zend_register_list_destructors_ex(xmlwriter_dtor, NULL, "xmlwriter", module_number); - -#ifdef ZEND_ENGINE_2 - memcpy(&xmlwriter_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - xmlwriter_object_handlers.clone_obj = NULL; - INIT_CLASS_ENTRY(ce, "XMLWriter", xmlwriter_class_functions); - ce.create_object = xmlwriter_object_new; - xmlwriter_class_entry_ce = zend_register_internal_class(&ce TSRMLS_CC); -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -static PHP_MSHUTDOWN_FUNCTION(xmlwriter) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -static PHP_MINFO_FUNCTION(xmlwriter) -{ - php_info_print_table_start(); - { - php_info_print_table_row(2, "XMLWriter", "enabled"); - } - php_info_print_table_end(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xmlwriter/php_xmlwriter.h b/ext/xmlwriter/php_xmlwriter.h deleted file mode 100644 index 29f39a720752c..0000000000000 --- a/ext/xmlwriter/php_xmlwriter.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Rob Richards | - | Pierre-A. Joye | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XMLWRITER_H -#define PHP_XMLWRITER_H - -extern zend_module_entry xmlwriter_module_entry; -#define phpext_xmlwriter_ptr &xmlwriter_module_entry - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include -#include -#include - -/* Resource struct, not the object :) */ -typedef struct _xmlwriter_object { - xmlTextWriterPtr ptr; - xmlBufferPtr output; -#ifndef ZEND_ENGINE_2 - xmlOutputBufferPtr uri_output; -#endif -} xmlwriter_object; - - -/* Extends zend object */ -typedef struct _ze_xmlwriter_object { - zend_object zo; - xmlwriter_object *xmlwriter_ptr; -} ze_xmlwriter_object; - -#endif /* PHP_XMLWRITER_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xmlwriter/tests/001.phpt b/ext/xmlwriter/tests/001.phpt deleted file mode 100644 index a9349d2d16c65..0000000000000 --- a/ext/xmlwriter/tests/001.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, file buffer, flush ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/002.phpt b/ext/xmlwriter/tests/002.phpt deleted file mode 100644 index f2537a47ff7dd..0000000000000 --- a/ext/xmlwriter/tests/002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, membuffer, flush ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/003.phpt b/ext/xmlwriter/tests/003.phpt deleted file mode 100644 index 5415797864e70..0000000000000 --- a/ext/xmlwriter/tests/003.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, membuffer, flush, attribute ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- - -Test text for tag1 -===DONE=== diff --git a/ext/xmlwriter/tests/004.phpt b/ext/xmlwriter/tests/004.phpt deleted file mode 100644 index 2d3e8587256a3..0000000000000 --- a/ext/xmlwriter/tests/004.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, file buffer, flush ---SKIPIF-- - ---FILE-- - - -'); -unset($xw); -unlink('001.xml'); -if ($md5_out != $md5_res) { - echo "failed: $md5_res != $md5_out\n"; -} else { - echo "ok.\n"; -} -?> -===DONE=== ---EXPECT-- -ok. -===DONE=== diff --git a/ext/xmlwriter/tests/005.phpt b/ext/xmlwriter/tests/005.phpt deleted file mode 100644 index ab933c6f564b9..0000000000000 --- a/ext/xmlwriter/tests/005.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, comments ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/006.phpt b/ext/xmlwriter/tests/006.phpt deleted file mode 100644 index 48eb299418f85..0000000000000 --- a/ext/xmlwriter/tests/006.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, startDTD/writeElementNS ---SKIPIF-- - ---FILE-- - ---EXPECT-- -dummy content diff --git a/ext/xmlwriter/tests/007.phpt b/ext/xmlwriter/tests/007.phpt deleted file mode 100644 index 47965c73c41ce..0000000000000 --- a/ext/xmlwriter/tests/007.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, Elements & Attributes ---SKIPIF-- - ---FILE-- -\"'&"); -xmlwriter_end_attribute($xw); -xmlwriter_write_element($xw, 'chars', "special characters: <>\"'&"); -xmlwriter_end_element($xw); -xmlwriter_end_document($xw); -// Force to write and empty the buffer -$output = xmlwriter_flush($xw, true); -print $output; -?> ---EXPECT-- - - - - special characters: <>"'& - - diff --git a/ext/xmlwriter/tests/008.phpt b/ext/xmlwriter/tests/008.phpt deleted file mode 100644 index 88768b1130764..0000000000000 --- a/ext/xmlwriter/tests/008.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer DTD Element & Attlist ---SKIPIF-- - ---FILE-- - ---EXPECT-- - - - - - - - diff --git a/ext/xmlwriter/tests/009.phpt b/ext/xmlwriter/tests/009.phpt deleted file mode 100644 index 002916ff10aa0..0000000000000 --- a/ext/xmlwriter/tests/009.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -XMLWriter: PI, Comment, CDATA ---SKIPIF-- - ---FILE-- -&"'); -xmlwriter_end_cdata($xw); -xmlwriter_end_element($xw); -xmlwriter_end_element($xw); -xmlwriter_end_element($xw); -xmlwriter_end_document($xw); -// Force to write and empty the buffer -$output = xmlwriter_flush($xw, true); -print $output; -?> ---EXPECTF-- - - - - - %w - &"]]> - - diff --git a/ext/xmlwriter/tests/010.phpt b/ext/xmlwriter/tests/010.phpt deleted file mode 100644 index 9f066a7c3e190..0000000000000 --- a/ext/xmlwriter/tests/010.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -xmlwriter_start/end_attribute() ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) -bool(true) -bool(true) - -Warning: xmlwriter_start_attribute(): Invalid Attribute Name in %s on line %d -bool(false) -bool(false) - -Warning: xmlwriter_start_attribute(): Invalid Attribute Name in %s on line %d -bool(false) -bool(false) -bool(true) -string(14) "" -Done diff --git a/ext/xmlwriter/tests/OO_001.phpt b/ext/xmlwriter/tests/OO_001.phpt deleted file mode 100644 index be448b9c65bb3..0000000000000 --- a/ext/xmlwriter/tests/OO_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, file buffer, flush ---SKIPIF-- - ---FILE-- -openUri($doc_dest); -$xw->startDocument('1.0', 'UTF-8', 'standalonearg'); -$xw->startElement("tag1"); -$xw->endDocument(); - -// Force to write and empty the buffer -$output_bytes = $xw->flush(true); -echo file_get_contents($doc_dest); -unset($xw); -unlink('001.xml'); -?> -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/OO_002.phpt b/ext/xmlwriter/tests/OO_002.phpt deleted file mode 100644 index ec605f50a4ab9..0000000000000 --- a/ext/xmlwriter/tests/OO_002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, membuffer, flush ---SKIPIF-- - ---FILE-- -openMemory(); -$xw->startDocument('1.0', 'UTF-8', 'standalone'); -$xw->startElement("tag1"); -$xw->endDocument(); - -// Force to write and empty the buffer -echo $xw->flush(true); -?> -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/OO_003.phpt b/ext/xmlwriter/tests/OO_003.phpt deleted file mode 100644 index 7fb47910f0f92..0000000000000 --- a/ext/xmlwriter/tests/OO_003.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, membuffer, flush, text, attribute ---SKIPIF-- - ---FILE-- -openMemory(); -$xw->startDocument('1.0', 'UTF-8'); -$xw->startElement("tag1"); - -$res = $xw->startAttribute('attr1'); -$xw->text("attr1_value"); -$xw->endAttribute(); - -$res = $xw->startAttribute('attr2'); -$xw->text("attr2_value"); -$xw->endAttribute(); - -$xw->text("Test text for tag1"); -$res = $xw->startElement('tag2'); -if ($res < 1) { - echo "StartElement context validation failed\n"; - exit(); -} -$xw->endDocument(); - -// Force to write and empty the buffer -echo $xw->flush(true); -?> -===DONE=== ---EXPECT-- - -Test text for tag1 -===DONE=== diff --git a/ext/xmlwriter/tests/OO_004.phpt b/ext/xmlwriter/tests/OO_004.phpt deleted file mode 100644 index 08b423ccef29d..0000000000000 --- a/ext/xmlwriter/tests/OO_004.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, file buffer, flush ---SKIPIF-- - ---FILE-- -openUri($doc_dest); -$xw->startDocument('1.0', 'UTF-8'); -$xw->startElement("tag1"); - -$xw->startPi("PHP"); -$xw->text('echo $a;'); -$xw->endPi(); -$xw->endDocument(); - -// Force to write and empty the buffer -$xw->flush(true); -$md5_out = md5_file($doc_dest); -$md5_res = md5(' - -'); -unset($xw); -unlink('001.xml'); -if ($md5_out != $md5_res) { - echo "failed: $md5_res != $md5_out\n"; -} else { - echo "ok.\n"; -} -?> -===DONE=== ---EXPECT-- -ok. -===DONE=== diff --git a/ext/xmlwriter/tests/OO_005.phpt b/ext/xmlwriter/tests/OO_005.phpt deleted file mode 100644 index 2c6d2f43339ec..0000000000000 --- a/ext/xmlwriter/tests/OO_005.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, comments ---SKIPIF-- - ---FILE-- -openUri($doc_dest); -$xw->startDocument('1.0', 'UTF-8'); -$xw->startElement("tag1"); -$xw->startComment(); -$xw->text('comment'); -$xw->endComment(); -$xw->writeComment("comment #2"); -$xw->endDocument(); - -// Force to write and empty the buffer -$output_bytes = $xw->flush(true); -echo file_get_contents($doc_dest); -unset($xw); -unlink('001.xml'); -?> -===DONE=== ---EXPECT-- - - -===DONE=== diff --git a/ext/xmlwriter/tests/OO_006.phpt b/ext/xmlwriter/tests/OO_006.phpt deleted file mode 100644 index 465a725debffc..0000000000000 --- a/ext/xmlwriter/tests/OO_006.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, startDTD/writeElementNS ---SKIPIF-- - ---FILE-- -openUri($doc_dest); -$xw->startDtd('foo', NULL, 'urn:bar'); -$xw->endDtd(); -$xw->startElement('foo'); -$xw->writeElementNS('foo', 'bar', 'urn:foo', 'dummy content'); -$xw->endElement(); - -// Force to write and empty the buffer -$output_bytes = $xw->flush(true); -echo file_get_contents($doc_dest); -unset($xw); -unlink('001.xml'); -?> ---EXPECT-- -dummy content diff --git a/ext/xmlwriter/tests/OO_007.phpt b/ext/xmlwriter/tests/OO_007.phpt deleted file mode 100644 index 257a5cd90cd97..0000000000000 --- a/ext/xmlwriter/tests/OO_007.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer, Elements & Attributes ---SKIPIF-- - ---FILE-- -openMemory(); -$xw->setIndent(TRUE); -$xw->setIndentString(' '); -$xw->startDocument('1.0', "UTF-8"); -$xw->startElement('root'); -$xw->startElementNS('ns1', 'child1', 'urn:ns1'); -$xw->startAttributeNS('ns1', 'att1', 'urn:ns1'); -$xw->text('a&b'); -$xw->endAttribute(); -$xw->writeAttribute('att2', "double\" single'"); -$xw->startAttributeNS('ns1', 'att2', 'urn:ns1'); -$xw->text("<>\"'&"); -$xw->endAttribute(); -$xw->writeElement('chars', "special characters: <>\"'&"); -$xw->endElement(); -$xw->endDocument(); -// Force to write and empty the buffer -$output = $xw->flush(true); -print $output; -?> ---EXPECT-- - - - - special characters: <>"'& - - diff --git a/ext/xmlwriter/tests/OO_008.phpt b/ext/xmlwriter/tests/OO_008.phpt deleted file mode 100644 index fe127ced2fc05..0000000000000 --- a/ext/xmlwriter/tests/OO_008.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -XMLWriter: libxml2 XML Writer DTD Element & Attlist ---SKIPIF-- - ---FILE-- -openMemory(); -$xw->setIndent(TRUE); -$xw->startDocument(NULL, "UTF-8"); -$xw->writeDtdElement('sxe', '(elem1+, elem11, elem22*)'); -$xw->writeDtdAttlist('sxe', 'id CDATA #implied'); -$xw->startDtdElement('elem1'); -$xw->text('elem2*'); -$xw->endDtdElement(); -$xw->startDtdAttlist('elem1'); -$xw->text("attr1 CDATA #required\n"); -$xw->text('attr2 CDATA #implied'); -$xw->endDtdAttlist(); -$xw->endDocument(); -// Force to write and empty the buffer -$output = $xw->flush(true); -print $output; -?> ---EXPECT-- - - - - - diff --git a/ext/xmlwriter/tests/OO_009.phpt b/ext/xmlwriter/tests/OO_009.phpt deleted file mode 100644 index c874f3e4ef834..0000000000000 --- a/ext/xmlwriter/tests/OO_009.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -XMLWriter: PI, Comment, CDATA ---SKIPIF-- - ---FILE-- -openMemory(); -$xw->setIndent(TRUE); -$xw->startDocument("1.0", "UTF-8"); -$xw->startElement('root'); -$xw->writeAttribute('id', 'elem1'); -$xw->startElement('elem1'); -$xw->writeAttribute('attr1', 'first'); -$xw->writeComment('start PI'); -$xw->startElement('pi'); -$xw->writePi('php', 'echo "hello world"; '); -$xw->endElement(); -$xw->startElement('cdata'); -$xw->startCdata(); -$xw->text('<>&"'); -$xw->endCdata(); -$xw->endElement(); -$xw->endElement(); -$xw->endElement(); -$xw->endDocument(); -// Force to write and empty the buffer -$output = $xw->flush(true); -print $output; -?> ---EXPECTF-- - - - - - %w - &"]]> - - diff --git a/ext/xmlwriter/tests/bug39504.phpt b/ext/xmlwriter/tests/bug39504.phpt deleted file mode 100644 index af97f81ed5918..0000000000000 --- a/ext/xmlwriter/tests/bug39504.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not enity) ---SKIPIF-- - ---FILE-- -openMemory(); -$xw->startDocument(NULL, "UTF-8"); -$xw->startDtd("root"); -$xw->writeDtdEntity("c", NULL, 0, "-//W3C//TEXT copyright//EN", "http://www.w3.org/xmlspec/copyright.xml"); -$xw->endDtd(); -$xw->startElement("root"); -$xw->endDocument(); -print $xw->flush(true); - -?> ---EXPECTF-- - -]> - - -]> diff --git a/ext/xmlwriter/tests/bug41287.phpt b/ext/xmlwriter/tests/bug41287.phpt deleted file mode 100644 index 0612b21f15c54..0000000000000 --- a/ext/xmlwriter/tests/bug41287.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #41287 (Namespace functions don't allow xmlns defintion to be optional) ---SKIPIF-- - ---FILE-- -openMemory(); -$xw->setIndent(true); -$xw->startDocument(); -$xw->startElementNS('test', 'test', 'urn:x-test:'); -$xw->writeElementNS('test', 'foo', null, ''); -$xw->writeElementNS(null, 'bar', 'urn:x-test:', ''); -$xw->writeElementNS(null, 'bar', '', ''); -$xw->endElement(); -$xw->endDocument(); -print $xw->flush(true); -?> ---EXPECTF-- - - - - - - - - - - - - - diff --git a/ext/xmlwriter/tests/bug41326.phpt b/ext/xmlwriter/tests/bug41326.phpt deleted file mode 100644 index 9c154bfd39e9c..0000000000000 --- a/ext/xmlwriter/tests/bug41326.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #41287 (Writing empty tags with Xmlwriter::WriteElement[ns]) ---SKIPIF-- - ---FILE-- -openMemory(); -$xml->setIndent(true); -$xml->startDocument(); -$xml->startElement('test'); -$xml->writeElement('foo', null); -$xml->writeElement('foo2', ""); -$xml->writeElement('foo3'); -$xml->startElement('bar'); -$xml->endElement('bar'); -$xml->endElement(); -$xml->endElement(); -print $xml->flush(true); - -print "\n"; - -$xw = new XMLWriter(); -$xw->openMemory(); -$xw->setIndent(true); -$xw->startDocument(); -$xw->startElementNS('test', 'test', 'urn:x-test:'); -$xw->writeElementNS('test', 'foo', null, ''); -$xw->writeElementNS(null, 'bar', 'urn:x-test:', ''); -$xw->writeElementNS(null, 'bar', 'urn:x-test:', NULL); -$xw->writeElementNS(null, 'bar', 'urn:x-test:'); -$xw->writeElementNS(null, 'bar', '', ''); -$xw->endElement(); -$xw->endDocument(); -print $xw->flush(true); -?> ---EXPECTF-- -Warning: Wrong parameter count for XMLWriter::endElement() in %s on line %d - - - - - - - - - - - - - - - - diff --git a/ext/xmlwriter/xmlwriter.dsp b/ext/xmlwriter/xmlwriter.dsp deleted file mode 100644 index e5eca77be5236..0000000000000 --- a/ext/xmlwriter/xmlwriter.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlwriter" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=xmlwriter - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "xmlwriter.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "xmlwriter.mak" CFG="xmlwriter - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "xmlwriter - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "xmlwriter - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "xmlwriter - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_XMLWRITER=1 /D "LIBXML_STATIC" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlwriter.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" -# ADD LINK32 wsock32.lib php4ts.lib libxml2_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xmlwriter.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release" -# SUBTRACT LINK32 /debug - -!ELSEIF "$(CFG)" == "xmlwriter - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "xmlwriter___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "xmlwriter___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_STATIC" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 wsock32.lib php4ts_debug.lib libxml2_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlwriter.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" - -!ENDIF - -# Begin Target - -# Name "xmlwriter - Win32 Release_TS" -# Name "xmlwriter - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_xmlwriter.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_xmlwriter.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/xsl/CREDITS b/ext/xsl/CREDITS deleted file mode 100644 index 2f33c8874c0d9..0000000000000 --- a/ext/xsl/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -XSL -Christian Stocker, Rob Richards diff --git a/ext/xsl/config.m4 b/ext/xsl/config.m4 deleted file mode 100644 index a2b16d24f05cc..0000000000000 --- a/ext/xsl/config.m4 +++ /dev/null @@ -1,67 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(xsl, for XSL support, -[ --with-xsl[=DIR] Include XSL support. DIR is the libxslt base - install directory (libxslt >= 1.1.0 required)]) - -if test "$PHP_XSL" != "no"; then - - if test "$PHP_LIBXML" = "no"; then - AC_MSG_ERROR([XSL extension requires LIBXML extension, add --enable-libxml]) - fi - - if test "$PHP_DOM" = "no"; then - AC_MSG_ERROR([XSL extension requires DOM extension, add --enable-dom]) - fi - - for i in $PHP_XSL /usr/local /usr; do - if test -x "$i/bin/xslt-config"; then - XSLT_CONFIG=$i/bin/xslt-config - break - fi - done - - if test -z "$XSLT_CONFIG"; then - AC_MSG_ERROR([xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution]) - else - libxslt_full_version=`$XSLT_CONFIG --version` - ac_IFS=$IFS - IFS="." - set $libxslt_full_version - IFS=$ac_IFS - LIBXSLT_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` - if test "$LIBXSLT_VERSION" -ge "1001000"; then - XSL_LIBS=`$XSLT_CONFIG --libs` - XSL_INCS=`$XSLT_CONFIG --cflags` - PHP_EVAL_LIBLINE($XSL_LIBS, XSL_SHARED_LIBADD) - PHP_EVAL_INCLINE($XSL_INCS) - - AC_MSG_CHECKING([for EXSLT support]) - for i in $PHP_XSL /usr/local /usr; do - if test -r "$i/include/libexslt/exslt.h"; then - PHP_XSL_EXSL_DIR=$i - break - fi - done - if test -z "$PHP_XSL_EXSL_DIR"; then - AC_MSG_RESULT(not found) - else - AC_MSG_RESULT(found) - PHP_ADD_LIBRARY_WITH_PATH(exslt, $PHP_XSL_EXSL_DIR/$PHP_LIBDIR, XSL_SHARED_LIBADD) - PHP_ADD_INCLUDE($PHP_XSL_EXSL_DIR/include) - AC_DEFINE(HAVE_XSL_EXSLT,1,[ ]) - fi - else - AC_MSG_ERROR([libxslt version 1.1.0 or greater required.]) - fi - - - fi - - AC_DEFINE(HAVE_XSL,1,[ ]) - PHP_NEW_EXTENSION(xsl, php_xsl.c xsltprocessor.c, $ext_shared) - PHP_SUBST(XSL_SHARED_LIBADD) - PHP_ADD_EXTENSION_DEP(xsl, libxml) -fi diff --git a/ext/xsl/config.w32 b/ext/xsl/config.w32 deleted file mode 100644 index 37da4bd630d19..0000000000000 --- a/ext/xsl/config.w32 +++ /dev/null @@ -1,47 +0,0 @@ -// $Id$ -// vim: ft=javascript - -ARG_WITH("xsl", "xsl support", "no"); - -if (PHP_XSL != "no") { - if (PHP_DOM == "yes" && PHP_LIBXML == "yes") { - var ext_xsl_lib_found = false; - var ext_exslt_lib_found = false; - - if (CHECK_LIB("libxslt_a.lib", "xsl", PHP_XSL)) { - ext_xsl_lib_found = true; - ADD_FLAG("CFLAGS_XSL", "/D LIBXSLT_STATIC "); - if (CHECK_LIB("libexslt_a.lib", "xsl", PHP_XSL)) { - ADD_FLAG("CFLAGS_XSL", "/D LIBEXSLT_STATIC "); - ext_exslt_lib_found = true; - } - } else if (CHECK_LIB("libxslt.lib", "xsl", PHP_XSL)) { - ext_xsl_lib_found = true; - if (CHECK_LIB("libexslt.lib", "xsl", PHP_XSL)) { - ext_exslt_lib_found = true; - } - } - - if (ext_xsl_lib_found && CHECK_HEADER_ADD_INCLUDE("libxslt\\xslt.h", "CFLAGS_XSL")) { - if (ext_exslt_lib_found) { - if (CHECK_HEADER_ADD_INCLUDE("libexslt\\exslt.h", "CFLAGS_XSL")) { - AC_DEFINE("HAVE_XSL_EXSLT", 1, ""); - } - } - EXTENSION("xsl", "php_xsl.c xsltprocessor.c", PHP_XSL_SHARED); - AC_DEFINE("HAVE_XSL", 1, "Define if xsl extension is enabled"); - if (! PHP_XSL_SHARED) { - ADD_FLAG("CFLAGS_XSL", "/D DOM_EXPORTS /D LIBXML_STATIC"); - } else { - if (PHP_DEBUG == "yes") { - ADD_FLAG("LDFLAGS_XSL", "/nodefaultlib:msvcrt"); - } - } - ADD_EXTENSION_DEP('xsl', 'libxml'); - } else { - WARNING("xsl not enabled; libraries and headers not found"); - } - } else { - WARNING("xsl not enabled; DOM extension required"); - } -} diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c deleted file mode 100644 index 0ba745cb04935..0000000000000 --- a/ext/xsl/php_xsl.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Christian Stocker | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_xsl.h" - - -zend_class_entry *xsl_xsltprocessor_class_entry; -static zend_object_handlers xsl_object_handlers; - -/* {{{ xsl_functions[] - * - * Every user visible function must have an entry in xsl_functions[]. - */ -zend_function_entry xsl_functions[] = { - {NULL, NULL, NULL} /* Must be the last line in xsl_functions[] */ -}; -/* }}} */ - -static zend_module_dep xsl_deps[] = { - ZEND_MOD_REQUIRED("libxml") - {NULL, NULL, NULL} -}; - -/* {{{ xsl_module_entry - */ -zend_module_entry xsl_module_entry = { -#if ZEND_MODULE_API_NO >= 20050617 - STANDARD_MODULE_HEADER_EX, NULL, - xsl_deps, -#elif ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "xsl", - xsl_functions, - PHP_MINIT(xsl), - PHP_MSHUTDOWN(xsl), - PHP_RINIT(xsl), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(xsl), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(xsl), -#if ZEND_MODULE_API_NO >= 20010901 - "0.1", /* Replace with version number for your extension */ -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_XSL -ZEND_GET_MODULE(xsl) -#endif - -/* {{{ xsl_objects_free_storage */ -void xsl_objects_free_storage(void *object TSRMLS_DC) -{ - xsl_object *intern = (xsl_object *)object; - - zend_object_std_dtor(&intern->std TSRMLS_CC); - - zend_hash_destroy(intern->parameter); - FREE_HASHTABLE(intern->parameter); - - zend_hash_destroy(intern->registered_phpfunctions); - FREE_HASHTABLE(intern->registered_phpfunctions); - - if (intern->node_list) { - zend_hash_destroy(intern->node_list); - FREE_HASHTABLE(intern->node_list); - } - - if (intern->doc) { - php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC); - efree(intern->doc); - } - - if (intern->ptr) { - /* free wrapper */ - if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) { - ((xsltStylesheetPtr) intern->ptr)->_private = NULL; - } - - xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr); - intern->ptr = NULL; - } - efree(object); -} -/* }}} */ -/* {{{ xsl_objects_new */ -zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - xsl_object *intern; - zval *tmp; - - intern = emalloc(sizeof(xsl_object)); - intern->ptr = NULL; - intern->prop_handler = NULL; - intern->parameter = NULL; - intern->hasKeys = 0; - intern->registerPhpFunctions = 0; - intern->registered_phpfunctions = NULL; - intern->node_list = NULL; - intern->doc = NULL; - - zend_object_std_init(&intern->std, class_type TSRMLS_CC); - zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - ALLOC_HASHTABLE(intern->parameter); - zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0); - ALLOC_HASHTABLE(intern->registered_phpfunctions); - zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0); - retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) xsl_objects_free_storage, NULL TSRMLS_CC); - intern->handle = retval.handle; - retval.handlers = &xsl_object_handlers; - return retval; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(xsl) -{ - - zend_class_entry ce; - - memcpy(&xsl_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - xsl_object_handlers.clone_obj = NULL; - - REGISTER_XSL_CLASS(ce, "XSLTProcessor", NULL, php_xsl_xsltprocessor_class_functions, xsl_xsltprocessor_class_entry); -#if HAVE_XSL_EXSLT - exsltRegisterAll(); -#endif - - xsltRegisterExtModuleFunction ((const xmlChar *) "functionString", - (const xmlChar *) "http://php.net/xsl", - xsl_ext_function_string_php); - xsltRegisterExtModuleFunction ((const xmlChar *) "function", - (const xmlChar *) "http://php.net/xsl", - xsl_ext_function_object_php); - - REGISTER_LONG_CONSTANT("XSL_CLONE_AUTO", 0, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSL_CLONE_NEVER", -1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSL_CLONE_ALWAYS", 1, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("LIBXSLT_VERSION", LIBXSLT_VERSION, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("LIBXSLT_DOTTED_VERSION", LIBXSLT_DOTTED_VERSION, CONST_CS | CONST_PERSISTENT); - -#if HAVE_XSL_EXSLT - REGISTER_LONG_CONSTANT("LIBEXSLT_VERSION", LIBEXSLT_VERSION, CONST_CS | CONST_PERSISTENT); - REGISTER_STRING_CONSTANT("LIBEXSLT_DOTTED_VERSION", LIBEXSLT_DOTTED_VERSION, CONST_CS | CONST_PERSISTENT); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ xsl_object_get_data */ -zval *xsl_object_get_data(void *obj) -{ - zval *dom_wrapper; - dom_wrapper = ((xsltStylesheetPtr) obj)->_private; - return dom_wrapper; -} -/* }}} */ - -/* {{{ xsl_object_set_data */ -static void xsl_object_set_data(void *obj, zval *wrapper TSRMLS_DC) -{ - ((xsltStylesheetPtr) obj)->_private = wrapper; -} -/* }}} */ - -/* {{{ php_xsl_set_object */ -void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC) -{ - xsl_object *object; - - object = (xsl_object *)zend_objects_get_address(wrapper TSRMLS_CC); - object->ptr = obj; - xsl_object_set_data(obj, wrapper TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_xsl_create_object */ -zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value TSRMLS_DC) -{ - zval *wrapper; - zend_class_entry *ce; - - *found = 0; - - if (!obj) { - if(!wrapper_in) { - ALLOC_ZVAL(wrapper); - } else { - wrapper = wrapper_in; - } - ZVAL_NULL(wrapper); - return wrapper; - } - - if ((wrapper = (zval *) xsl_object_get_data((void *) obj))) { - zval_add_ref(&wrapper); - *found = 1; - return wrapper; - } - - if(!wrapper_in) { - wrapper = return_value; - } else { - wrapper = wrapper_in; - } - - - ce = xsl_xsltprocessor_class_entry; - - if(!wrapper_in) { - object_init_ex(wrapper, ce); - } - php_xsl_set_object(wrapper, (void *) obj TSRMLS_CC); - return (wrapper); -} -/* }}} */ - - - - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(xsl) -{ - xsltUnregisterExtModuleFunction ((const xmlChar *) "functionString", - (const xmlChar *) "http://php.net/xsl"); - xsltUnregisterExtModuleFunction ((const xmlChar *) "function", - (const xmlChar *) "http://php.net/xsl"); - - xsltCleanupGlobals(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(xsl) -{ - xsltSetGenericErrorFunc(NULL, php_libxml_error_handler); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(xsl) -{ - xsltSetGenericErrorFunc(NULL, NULL); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(xsl) -{ - php_info_print_table_start(); - { - char buffer[128]; - int major, minor, subminor; - - php_info_print_table_row(2, "XSL", "enabled"); - major = xsltLibxsltVersion/10000; - minor = (xsltLibxsltVersion - major * 10000) / 100; - subminor = (xsltLibxsltVersion - major * 10000 - minor * 100); - snprintf(buffer, 128, "%d.%d.%d", major, minor, subminor); - php_info_print_table_row(2, "libxslt Version", buffer); - major = xsltLibxmlVersion/10000; - minor = (xsltLibxmlVersion - major * 10000) / 100; - subminor = (xsltLibxmlVersion - major * 10000 - minor * 100); - snprintf(buffer, 128, "%d.%d.%d", major, minor, subminor); - php_info_print_table_row(2, "libxslt compiled against libxml Version", buffer); - } -#if HAVE_XSL_EXSLT - php_info_print_table_row(2, "EXSLT", "enabled"); - php_info_print_table_row(2, "libexslt Version", LIBEXSLT_DOTTED_VERSION); -#endif - php_info_print_table_end(); -} -/* }}} */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h deleted file mode 100644 index d1895cef9a590..0000000000000 --- a/ext/xsl/php_xsl.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_XSL_H -#define PHP_XSL_H - -extern zend_module_entry xsl_module_entry; -#define phpext_xsl_ptr &xsl_module_entry - -#ifdef PHP_WIN32 -#define PHP_XSL_API __declspec(dllexport) -#else -#define PHP_XSL_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include -#include -#include -#include -#if HAVE_XSL_EXSLT -#include -#include -#endif - -#include "../dom/xml_common.h" -#include "xsl_fe.h" - -#include -#include - -typedef struct _xsl_object { - zend_object std; - void *ptr; - HashTable *prop_handler; - zend_object_handle handle; - HashTable *parameter; - int hasKeys; - int registerPhpFunctions; - HashTable *registered_phpfunctions; - HashTable *node_list; - php_libxml_node_object *doc; -} xsl_object; - -void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC); -void xsl_objects_free_storage(void *object TSRMLS_DC); -zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value TSRMLS_DC); - -void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs); -void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs); - -#define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \ -INIT_CLASS_ENTRY(ce, name, funcs); \ -ce.create_object = xsl_objects_new; \ -entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC); - -#define XSL_DOMOBJ_NEW(zval, obj, ret) \ - if (NULL == (zval = php_xsl_create_object(obj, ret, zval, return_value TSRMLS_CC))) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \ - RETURN_FALSE; \ - } - - - -PHP_MINIT_FUNCTION(xsl); -PHP_MSHUTDOWN_FUNCTION(xsl); -PHP_RINIT_FUNCTION(xsl); -PHP_RSHUTDOWN_FUNCTION(xsl); -PHP_MINFO_FUNCTION(xsl); - - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(xsl) - long global_value; - char *global_string; -ZEND_END_MODULE_GLOBALS(xsl) -*/ - -/* In every utility function you add that needs to use variables - in php_xsl_globals, call TSRM_FETCH(); after declaring other - variables used by that function, or better yet, pass in TSRMLS_CC - after the last function argument and declare your utility function - with TSRMLS_DC after the last declared argument. Always refer to - the globals in your function as XSL_G(variable). You are - encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define XSL_G(v) TSRMG(xsl_globals_id, zend_xsl_globals *, v) -#else -#define XSL_G(v) (xsl_globals.v) -#endif - -#endif /* PHP_XSL_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/xsl/tests/area_list.xsl b/ext/xsl/tests/area_list.xsl deleted file mode 100644 index e0c88c6215a53..0000000000000 --- a/ext/xsl/tests/area_list.xsl +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - HERE - - diff --git a/ext/xsl/tests/area_name.xml b/ext/xsl/tests/area_name.xml deleted file mode 100644 index 76cea58511edc..0000000000000 --- a/ext/xsl/tests/area_name.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - 13 - "Ðвтово" м. - m."Avtovo" - - - - - diff --git a/ext/xsl/tests/bug26384.phpt b/ext/xsl/tests/bug26384.phpt deleted file mode 100644 index b8f80f8c3ea58..0000000000000 --- a/ext/xsl/tests/bug26384.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #26384 (domxslt->process causes segfault with xsl:key) ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/area_name.xml"); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} -$xsl = new domDocument; -$xsl->load(dirname(__FILE__)."/area_list.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} -$proc = new xsltprocessor; -if(!$proc) { - echo "Error while making xsltprocessor object\n"; - exit; -} - -$proc->importStylesheet($xsl); -print $proc->transformToXml($dom); - -//this segfaulted before -print $dom->documentElement->firstChild->nextSibling->nodeName; - ---EXPECT-- -HERE -ROW diff --git a/ext/xsl/tests/bug33853.phpt b/ext/xsl/tests/bug33853.phpt deleted file mode 100755 index bcf30f65a36ae..0000000000000 --- a/ext/xsl/tests/bug33853.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #33853 (php:function call __autoload with lowercase param) ---SKIPIF-- - ---FILE-- -loadXML(' - - - - -'); -$inputdom = new DomDocument(); -$inputdom->loadXML(' -'); - -$proc = new XsltProcessor(); -$proc->registerPhpFunctions(); -$xsl = $proc->importStylesheet($xsl); -$newdom = $proc->transformToDoc($inputdom); -?> -===DONE=== ---EXPECT-- -string(4) "TeSt" diff --git a/ext/xsl/tests/documentxpath.xsl b/ext/xsl/tests/documentxpath.xsl deleted file mode 100644 index 0e5c5c181d737..0000000000000 --- a/ext/xsl/tests/documentxpath.xsl +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/ext/xsl/tests/exslt.xml b/ext/xsl/tests/exslt.xml deleted file mode 100644 index 54913c6f5d83f..0000000000000 --- a/ext/xsl/tests/exslt.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/ext/xsl/tests/exslt.xsl b/ext/xsl/tests/exslt.xsl deleted file mode 100644 index 8f0baef6ca8fe..0000000000000 --- a/ext/xsl/tests/exslt.xsl +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - Test Date : - - year : - - leap-year : - - month-in-year : - - month-name : - - month-abbreviation : - - week-in-year : - - day-in-year : - - day-in-month : - - day-of-week-in-month : - - day-in-week : - - day-name : - - day-abbreviation : - - time : - - hour-in-day : - - minute-in-hour : - - second-in-minute : - - - diff --git a/ext/xsl/tests/prepare.inc b/ext/xsl/tests/prepare.inc deleted file mode 100644 index bd5bbee40cbc8..0000000000000 --- a/ext/xsl/tests/prepare.inc +++ /dev/null @@ -1,20 +0,0 @@ -load(dirname(__FILE__)."/xslt.xml"); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} -$xsl = new domDocument; -$xsl->load(dirname(__FILE__)."/xslt.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} -$proc = new xsltprocessor; -if(!$proc) { - echo "Error while making xsltprocessor object\n"; - exit; -} - -?> diff --git a/ext/xsl/tests/skipif.inc b/ext/xsl/tests/skipif.inc deleted file mode 100644 index 0ef73723a3b8b..0000000000000 --- a/ext/xsl/tests/skipif.inc +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ext/xsl/tests/streamsinclude.xsl b/ext/xsl/tests/streamsinclude.xsl deleted file mode 100644 index 6f8bc40ed9ac8..0000000000000 --- a/ext/xsl/tests/streamsinclude.xsl +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/ext/xsl/tests/xslt.xml b/ext/xsl/tests/xslt.xml deleted file mode 100644 index b0e9506c7bf3e..0000000000000 --- a/ext/xsl/tests/xslt.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - Title - - - - - - - - a1 - b1 - c1 - - - a2 - c2 - - - ä3 - b3 - c3 - - - - - - diff --git a/ext/xsl/tests/xslt.xsl b/ext/xsl/tests/xslt.xsl deleted file mode 100644 index 8331ccc2b56fe..0000000000000 --- a/ext/xsl/tests/xslt.xsl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
- - -
-
diff --git a/ext/xsl/tests/xslt.xsl.gz b/ext/xsl/tests/xslt.xsl.gz deleted file mode 100644 index 910bb63c8e32f..0000000000000 Binary files a/ext/xsl/tests/xslt.xsl.gz and /dev/null differ diff --git a/ext/xsl/tests/xslt001.phpt b/ext/xsl/tests/xslt001.phpt deleted file mode 100644 index 885e7c9824e56..0000000000000 --- a/ext/xsl/tests/xslt001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test 1: Transform To XML String ---SKIPIF-- - ---FILE-- -importStylesheet($xsl); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 1: Transform To XML String - -bar -a1 b1 c1
-a2 c2
-ä3 b3 c3
- diff --git a/ext/xsl/tests/xslt002.phpt b/ext/xsl/tests/xslt002.phpt deleted file mode 100644 index 6c9f0c632c844..0000000000000 --- a/ext/xsl/tests/xslt002.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test 2: Transform To HTML String ---SKIPIF-- - ---FILE-- -query("/xsl:stylesheet/xsl:output/@method"); -if ($res->length != 1) { - print "No or more than one xsl:output/@method found"; - exit; -} -$res->item(0)->value = "html"; -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 2: Transform To HTML String -bar -a1 b1 c1
-a2 c2
-ä3 b3 c3
- diff --git a/ext/xsl/tests/xslt003.phpt b/ext/xsl/tests/xslt003.phpt deleted file mode 100644 index a3c848b1b72de..0000000000000 --- a/ext/xsl/tests/xslt003.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Test 3: Using Parameters ---SKIPIF-- - ---FILE-- -importStylesheet($xsl); -$proc->setParameter( "", "foo","hello world"); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 3: Using Parameters - -hello world -a1 b1 c1
-a2 c2
-ä3 b3 c3
- diff --git a/ext/xsl/tests/xslt004.phpt b/ext/xsl/tests/xslt004.phpt deleted file mode 100644 index 6e8f47601805e..0000000000000 --- a/ext/xsl/tests/xslt004.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test 4: Checking UTF8 Output ---SKIPIF-- - ---FILE-- -query("/xsl:stylesheet/xsl:output/@encoding"); -if ($res->length != 1) { - print "No or more than one xsl:output/@encoding found"; - exit; -} -$res->item(0)->value = "utf-8"; -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 4: Checking UTF8 Output - -bar -a1 b1 c1
-a2 c2
-ä3 b3 c3
- diff --git a/ext/xsl/tests/xslt005.phpt b/ext/xsl/tests/xslt005.phpt deleted file mode 100644 index a70e6ea4f1a7d..0000000000000 --- a/ext/xsl/tests/xslt005.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Test 5: Checking Indent ---SKIPIF-- - ---FILE-- -query("/xsl:stylesheet/xsl:output/@indent"); -if ($res->length != 1) { - print "No or more than one xsl:output/@indent found"; - exit; -} -$res->item(0)->value = "yes"; -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 5: Checking Indent - - - bar -a1 b1 c1
-a2 c2
-ä3 b3 c3
- - diff --git a/ext/xsl/tests/xslt006.phpt b/ext/xsl/tests/xslt006.phpt deleted file mode 100644 index 26fada1650028..0000000000000 --- a/ext/xsl/tests/xslt006.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Test 6: Transform To Doc ---SKIPIF-- - ---FILE-- -importStylesheet($xsl); -print "\n"; -$doc = $proc->transformToDoc($dom); -print $doc->saveXML(); -print "\n"; - - ---EXPECT-- -Test 6: Transform To Doc - -bar -a1 b1 c1
-a2 c2
-ä3 b3 c3
- diff --git a/ext/xsl/tests/xslt007.phpt b/ext/xsl/tests/xslt007.phpt deleted file mode 100644 index bc6ad8477a417..0000000000000 --- a/ext/xsl/tests/xslt007.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test 7: Transform To Uri ---SKIPIF-- - ---FILE-- -importStylesheet($xsl); -print "\n"; -$doc = $proc->transformToUri($dom, "file://".dirname(__FILE__)."/out.xml"); -print file_get_contents(dirname(__FILE__)."/out.xml"); -unlink(dirname(__FILE__)."/out.xml"); -print "\n"; - - ---EXPECT-- -Test 7: Transform To Uri - -bar -a1 b1 c1
-a2 c2
-ä3 b3 c3
- diff --git a/ext/xsl/tests/xslt008.phpt b/ext/xsl/tests/xslt008.phpt deleted file mode 100644 index 0efc88e8c5e86..0000000000000 --- a/ext/xsl/tests/xslt008.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Test 8: Stream Wrapper Includes ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/streamsinclude.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} -chdir(dirname(__FILE__)); -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXML($dom); - - ---EXPECT-- -Test 8: Stream Wrapper Includes - -bar -a1 b1 c1
-a2 c2
-ä3 b3 c3
- diff --git a/ext/xsl/tests/xslt009.phpt b/ext/xsl/tests/xslt009.phpt deleted file mode 100644 index f763e84daa6e7..0000000000000 --- a/ext/xsl/tests/xslt009.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Test 9: Stream Wrapper XPath-Document() ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/documentxpath.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} - -$proc->importStylesheet($xsl); -print "\n"; -print $proc->transformToXML($dom); - - ---EXPECT-- -Test 9: Stream Wrapper XPath-Document() - -foo diff --git a/ext/xsl/tests/xslt010.phpt b/ext/xsl/tests/xslt010.phpt deleted file mode 100644 index 1ac1a493c7fb5..0000000000000 --- a/ext/xsl/tests/xslt010.phpt +++ /dev/null @@ -1,115 +0,0 @@ ---TEST-- -Test 10: EXSLT Support ---SKIPIF-- -hasExsltSupport()) die('skip EXSLT support not available'); -if (LIBXSLT_VERSION < 10117) die('skip too old libxsl'); -?> ---FILE-- -load(dirname(__FILE__)."/exslt.xsl"); - $proc = new xsltprocessor; - $xsl = $proc->importStylesheet($dom); - - $xml = new DomDocument(); - $xml->load(dirname(__FILE__)."/exslt.xml"); - - print $proc->transformToXml($xml); ---EXPECT-- -Test 10: EXSLT Support - - - Test Date : 0001-12-31Z - year : 1 - leap-year : false - month-in-year : 12 - month-name : December - month-abbreviation : Dec - week-in-year : 53 - day-in-year : 365 - day-in-month : 31 - day-of-week-in-month : 5 - day-in-week : 2 - day-name : Monday - day-abbreviation : Mon - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN - - Test Date : 3000-01-31 - year : 3000 - leap-year : false - month-in-year : 1 - month-name : January - month-abbreviation : Jan - week-in-year : 5 - day-in-year : 31 - day-in-month : 31 - day-of-week-in-month : 5 - day-in-week : 6 - day-name : Friday - day-abbreviation : Fri - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN - - Test Date : 2000-02-29 - year : 2000 - leap-year : true - month-in-year : 2 - month-name : February - month-abbreviation : Feb - week-in-year : 9 - day-in-year : 60 - day-in-month : 29 - day-of-week-in-month : 5 - day-in-week : 3 - day-name : Tuesday - day-abbreviation : Tue - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN - - Test Date : 9990001-12-31Z - year : 9990001 - leap-year : false - month-in-year : 12 - month-name : December - month-abbreviation : Dec - week-in-year : 53 - day-in-year : 365 - day-in-month : 31 - day-of-week-in-month : 5 - day-in-week : 2 - day-name : Monday - day-abbreviation : Mon - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN - - Test Date : -0004-02-29 - year : -4 - leap-year : true - month-in-year : 2 - month-name : February - month-abbreviation : Feb - week-in-year : 10 - day-in-year : 60 - day-in-month : 29 - day-of-week-in-month : 5 - day-in-week : 1 - day-name : Sunday - day-abbreviation : Sun - time : - hour-in-day : NaN - minute-in-hour : NaN - second-in-minute : NaN - diff --git a/ext/xsl/tests/xslt011.phpt b/ext/xsl/tests/xslt011.phpt deleted file mode 100644 index 5f7865279e2ff..0000000000000 --- a/ext/xsl/tests/xslt011.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test 11: php:function Support ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/xslt011.xsl"); - $proc = new xsltprocessor; - $xsl = $proc->importStylesheet($dom); - - $xml = new DomDocument(); - $xml->load(dirname(__FILE__)."/xslt011.xml"); - $proc->registerPHPFunctions(); - print $proc->transformToXml($xml); - - function foobar($id, $secondArg = "" ) { - if (is_array($id)) { - return $id[0]->value . " - " . $secondArg; - } else { - return $id . " - " . $secondArg; - } - } - function nodeSet($id = null) { - if ($id and is_array($id)) { - return $id[0]; - } else { - $dom = new domdocument; - $dom->loadXML("this is from an external DomDocument"); - return $dom->documentElement; - } - } - function nonDomNode() { - return new foo(); - } - - class aClass { - static function aStaticFunction($id) { - return $id; - } - } - ---EXPECTF-- -Test 11: php:function Support - -Warning: XSLTProcessor::transformToXml(): A PHP Object can not be converted to a XPath-string in %s on line 16 - -foobar - secondArg -foobar - -this is from an external DomDocument -from the Input Document -static - diff --git a/ext/xsl/tests/xslt011.xml b/ext/xsl/tests/xslt011.xml deleted file mode 100644 index f40500b0f5ad0..0000000000000 --- a/ext/xsl/tests/xslt011.xml +++ /dev/null @@ -1 +0,0 @@ -This is from the Input Document diff --git a/ext/xsl/tests/xslt011.xsl b/ext/xsl/tests/xslt011.xsl deleted file mode 100644 index e1960e57d3beb..0000000000000 --- a/ext/xsl/tests/xslt011.xsl +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/xsl/tests/xslt012.phpt b/ext/xsl/tests/xslt012.phpt deleted file mode 100644 index 60387af4cefef..0000000000000 --- a/ext/xsl/tests/xslt012.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test 12: Using Associative Array of Parameters ---SKIPIF-- - ---FILE-- -load(dirname(__FILE__)."/xslt.xml"); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$xsl = new domDocument; -$xsl->load(dirname(__FILE__)."/xslt012.xsl"); -if(!$xsl) { - echo "Error while parsing the document\n"; - exit; -} - -$proc = new xsltprocessor; -if(!$proc) { - echo "Error while making xsltprocessor object\n"; - exit; -} - - -$proc->importStylesheet($xsl); - -$parameters = Array( - 'foo' => 'barbar', - 'foo1' => 'test', - ); - -$proc->setParameter( "", $parameters); - -print "\n"; -print $proc->transformToXml($dom); -print "\n"; - - ---EXPECT-- -Test 12: Using Associative Array of Parameters - -barbar -test -a1 b1 c1
-a2 c2
-ä3 b3 c3
- diff --git a/ext/xsl/tests/xslt012.xsl b/ext/xsl/tests/xslt012.xsl deleted file mode 100644 index 27f413855f157..0000000000000 --- a/ext/xsl/tests/xslt012.xsl +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
diff --git a/ext/xsl/xsl.dsp b/ext/xsl/xsl.dsp deleted file mode 100644 index ff7257d16121d..0000000000000 --- a/ext/xsl/xsl.dsp +++ /dev/null @@ -1,120 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xsl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=xsl - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "xsl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "xsl.mak" CFG="xsl - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "xsl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "xsl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "xsl - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 wsock32.lib php5ts.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xsl.dll" /implib:".Release_TS/php_xsl.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "xsl - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xsl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt" - -!ENDIF - -# Begin Target - -# Name "xsl - Win32 Release_TS" -# Name "xsl - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_xsl.c -# End Source File -# Begin Source File - -SOURCE=.\xsltprocessor.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_xsl.h -# End Source File -# Begin Source File - -SOURCE=.\xsl_fe.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h deleted file mode 100644 index 058424fa449d5..0000000000000 --- a/ext/xsl/xsl_fe.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Christian Stocker | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef XSL_FE_H -#define XSL_FE_H - -extern zend_function_entry php_xsl_xsltprocessor_class_functions[]; -extern zend_class_entry *xsl_xsltprocessor_class_entry; - -PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet); -PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc); -PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri); -PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml); -PHP_FUNCTION(xsl_xsltprocessor_set_parameter); -PHP_FUNCTION(xsl_xsltprocessor_get_parameter); -PHP_FUNCTION(xsl_xsltprocessor_remove_parameter); -PHP_FUNCTION(xsl_xsltprocessor_has_exslt_support); -PHP_FUNCTION(xsl_xsltprocessor_register_php_functions); -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c deleted file mode 100644 index d43aff4d2523f..0000000000000 --- a/ext/xsl/xsltprocessor.c +++ /dev/null @@ -1,844 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Christian Stocker | - | Rob Richards | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_xsl.h" -#include "ext/libxml/php_libxml.h" - -/* {{{ arginfo */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_import_stylesheet, 0, 0, 1) - ZEND_ARG_INFO(0, doc) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_doc, 0, 0, 1) - ZEND_ARG_INFO(0, doc) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_uri, 0, 0, 2) - ZEND_ARG_INFO(0, doc) - ZEND_ARG_INFO(0, uri) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_xml, 0, 0, 1) - ZEND_ARG_INFO(0, doc) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_set_parameter, 0, 0, 2) - ZEND_ARG_INFO(0, namespace) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_get_parameter, 0, 0, 2) - ZEND_ARG_INFO(0, namespace) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_remove_parameter, 0, 0, 2) - ZEND_ARG_INFO(0, namespace) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_has_exslt_support, 0, 0, 0) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_register_php_functions, 0, 0, 0) - ZEND_ARG_INFO(0, restrict) -ZEND_END_ARG_INFO(); -/* }}} */ - -/* -* class xsl_xsltprocessor -* -* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# -* Since: -*/ - -zend_function_entry php_xsl_xsltprocessor_class_functions[] = { - PHP_FALIAS(importStylesheet, xsl_xsltprocessor_import_stylesheet, arginfo_xsl_xsltprocessor_import_stylesheet) - PHP_FALIAS(transformToDoc, xsl_xsltprocessor_transform_to_doc, arginfo_xsl_xsltprocessor_transform_to_doc) - PHP_FALIAS(transformToUri, xsl_xsltprocessor_transform_to_uri, arginfo_xsl_xsltprocessor_transform_to_uri) - PHP_FALIAS(transformToXml, xsl_xsltprocessor_transform_to_xml, arginfo_xsl_xsltprocessor_transform_to_xml) - PHP_FALIAS(setParameter, xsl_xsltprocessor_set_parameter, arginfo_xsl_xsltprocessor_set_parameter) - PHP_FALIAS(getParameter, xsl_xsltprocessor_get_parameter, arginfo_xsl_xsltprocessor_get_parameter) - PHP_FALIAS(removeParameter, xsl_xsltprocessor_remove_parameter, arginfo_xsl_xsltprocessor_remove_parameter) - PHP_FALIAS(hasExsltSupport, xsl_xsltprocessor_has_exslt_support, arginfo_xsl_xsltprocessor_has_exslt_support) - PHP_FALIAS(registerPHPFunctions, xsl_xsltprocessor_register_php_functions, arginfo_xsl_xsltprocessor_register_php_functions) - {NULL, NULL, NULL} -}; - -/* {{{ php_xsl_xslt_string_to_xpathexpr() - Translates a string to a XPath Expression */ -static char *php_xsl_xslt_string_to_xpathexpr(const char *str TSRMLS_DC) -{ - const xmlChar *string = (const xmlChar *)str; - - xmlChar *value; - int str_len; - - str_len = xmlStrlen(string) + 3; - - if (xmlStrchr(string, '"')) { - if (xmlStrchr(string, '\'')) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes)"); - return NULL; - } - value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0); - snprintf(value, str_len, "'%s'", string); - } else { - value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0); - snprintf(value, str_len, "\"%s\"", string); - } - return (char *) value; -} -/* }}} */ - -/* {{{ php_xsl_xslt_make_params() - Translates a PHP array to a libxslt parameters array */ -static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS_DC) -{ - - int parsize; - zval **value; - char *xpath_expr, *string_key = NULL; - ulong num_key; - char **params = NULL; - int i = 0; - - parsize = (2 * zend_hash_num_elements(parht) + 1) * sizeof(char *); - params = (char **)safe_emalloc((2 * zend_hash_num_elements(parht) + 1), sizeof(char *), 0); - memset((char *)params, 0, parsize); - - for (zend_hash_internal_pointer_reset(parht); - zend_hash_get_current_data(parht, (void **)&value) == SUCCESS; - zend_hash_move_forward(parht)) { - - if (zend_hash_get_current_key(parht, &string_key, &num_key, 1) != HASH_KEY_IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument or parameter array"); - efree(params); - return NULL; - } else { - if (Z_TYPE_PP(value) != IS_STRING) { - SEPARATE_ZVAL(value); - convert_to_string(*value); - } - - if (!xpath_params) { - xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC); - } else { - xpath_expr = estrndup(Z_STRVAL_PP(value), strlen(Z_STRVAL_PP(value))); - } - if (xpath_expr) { - params[i++] = string_key; - params[i++] = xpath_expr; - } - } - } - - params[i++] = NULL; - - return params; -} -/* }}} */ - -static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */ -{ - xsltTransformContextPtr tctxt; - zval **args; - zval *retval; - int result, i, ret; - int error = 0; - zend_fcall_info fci; - zval handler; - xmlXPathObjectPtr obj; - char *str; - char *callable = NULL; - xsl_object *intern; - - TSRMLS_FETCH(); - - if (! zend_is_executing(TSRMLS_C)) { - xsltGenericError(xsltGenericErrorContext, - "xsltExtFunctionTest: Function called from outside of PHP\n"); - error = 1; - } else { - tctxt = xsltXPathGetTransformContext(ctxt); - if (tctxt == NULL) { - xsltGenericError(xsltGenericErrorContext, - "xsltExtFunctionTest: failed to get the transformation context\n"); - error = 1; - } else { - intern = (xsl_object *) tctxt->_private; - if (intern == NULL) { - xsltGenericError(xsltGenericErrorContext, - "xsltExtFunctionTest: failed to get the internal object\n"); - error = 1; - } - else if (intern->registerPhpFunctions == 0) { - xsltGenericError(xsltGenericErrorContext, - "xsltExtFunctionTest: PHP Object did not register PHP functions\n"); - error = 1; - } - } - } - - if (error == 1) { - for (i = nargs - 1; i >= 0; i--) { - obj = valuePop(ctxt); - xmlXPathFreeObject(obj); - } - return; - } - - fci.param_count = nargs - 1; - if (fci.param_count > 0) { - fci.params = safe_emalloc(fci.param_count, sizeof(zval**), 0); - args = safe_emalloc(fci.param_count, sizeof(zval *), 0); - } - /* Reverse order to pop values off ctxt stack */ - for (i = nargs - 2; i >= 0; i--) { - obj = valuePop(ctxt); - MAKE_STD_ZVAL(args[i]); - switch (obj->type) { - case XPATH_STRING: - ZVAL_STRING(args[i], obj->stringval, 1); - break; - case XPATH_BOOLEAN: - ZVAL_BOOL(args[i], obj->boolval); - break; - case XPATH_NUMBER: - ZVAL_DOUBLE(args[i], obj->floatval); - break; - case XPATH_NODESET: - if (type == 1) { - str = xmlXPathCastToString(obj); - ZVAL_STRING(args[i], str, 1); - xmlFree(str); - } else if (type == 2) { - int j; - dom_object *domintern = (dom_object *)intern->doc; - array_init(args[i]); - if (obj->nodesetval && obj->nodesetval->nodeNr > 0) { - for (j = 0; j < obj->nodesetval->nodeNr; j++) { - xmlNodePtr node = obj->nodesetval->nodeTab[j]; - zval *child; - MAKE_STD_ZVAL(child); - /* not sure, if we need this... it's copied from xpath.c */ - if (node->type == XML_NAMESPACE_DECL) { - xmlNsPtr curns; - xmlNodePtr nsparent; - - nsparent = node->_private; - curns = xmlNewNs(NULL, node->name, NULL); - if (node->children) { - curns->prefix = xmlStrdup((char *) node->children); - } - if (node->children) { - node = xmlNewDocNode(node->doc, NULL, (char *) node->children, node->name); - } else { - node = xmlNewDocNode(node->doc, NULL, "xmlns", node->name); - } - node->type = XML_NAMESPACE_DECL; - node->parent = nsparent; - node->ns = curns; - } - child = php_dom_create_object(node, &ret, NULL, child, domintern TSRMLS_CC); - add_next_index_zval(args[i], child); - } - } - } - break; - default: - str = xmlXPathCastToString(obj); - ZVAL_STRING(args[i], str, 1); - xmlFree(str); - } - xmlXPathFreeObject(obj); - fci.params[i] = &args[i]; - } - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - - obj = valuePop(ctxt); - if (obj->stringval == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Handler name must be a string"); - xmlXPathFreeObject(obj); - if (fci.param_count > 0) { - for (i = 0; i < nargs - 1; i++) { - zval_ptr_dtor(&args[i]); - } - efree(args); - efree(fci.params); - } - return; - } - INIT_PZVAL(&handler); - ZVAL_STRING(&handler, obj->stringval, 1); - xmlXPathFreeObject(obj); - - fci.function_name = &handler; - fci.symbol_table = NULL; - fci.object_pp = NULL; - fci.retval_ptr_ptr = &retval; - fci.no_separation = 0; - /*fci.function_handler_cache = &function_ptr;*/ - if (!zend_make_callable(&handler, &callable TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", callable); - - } else if ( intern->registerPhpFunctions == 2 && zend_hash_exists(intern->registered_phpfunctions, callable, strlen(callable) + 1) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to call handler '%s()'.", callable); - /* Push an empty string, so that we at least have an xslt result... */ - valuePush(ctxt, xmlXPathNewString("")); - } else { - result = zend_call_function(&fci, NULL TSRMLS_CC); - if (result == FAILURE) { - if (Z_TYPE(handler) == IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(&handler)); - } - /* retval is == NULL, when an exception occured, don't report anything, because PHP itself will handle that */ - } else if (retval == NULL) { - } else { - if (retval->type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) { - xmlNode *nodep; - dom_object *obj; - if (intern->node_list == NULL) { - ALLOC_HASHTABLE(intern->node_list); - zend_hash_init(intern->node_list, 0, NULL, ZVAL_PTR_DTOR, 0); - } - zval_add_ref(&retval); - zend_hash_next_index_insert(intern->node_list, &retval, sizeof(zval *), NULL); - obj = (dom_object *)zend_object_store_get_object(retval TSRMLS_CC); - nodep = dom_object_get_node(obj); - valuePush(ctxt, xmlXPathNewNodeSet(nodep)); - } else if (retval->type == IS_BOOL) { - valuePush(ctxt, xmlXPathNewBoolean(retval->value.lval)); - } else if (retval->type == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object can not be converted to a XPath-string"); - valuePush(ctxt, xmlXPathNewString("")); - } else { - convert_to_string_ex(&retval); - valuePush(ctxt, xmlXPathNewString( Z_STRVAL_P(retval))); - } - zval_ptr_dtor(&retval); - } - } - efree(callable); - zval_dtor(&handler); - if (fci.param_count > 0) { - for (i = 0; i < nargs - 1; i++) { - zval_ptr_dtor(&args[i]); - } - efree(args); - efree(fci.params); - } -} -/* }}} */ - -void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs) /* {{{ */ -{ - xsl_ext_function_php(ctxt, nargs, 1); -} -/* }}} */ - -void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs) /* {{{ */ -{ - xsl_ext_function_php(ctxt, nargs, 2); -} -/* }}} */ - -/* {{{ proto void xsl_xsltprocessor_import_stylesheet(domdocument doc); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# -Since: -*/ -PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet) -{ - zval *id, *docp = NULL; - xmlDoc *doc = NULL, *newdoc = NULL; - xsltStylesheetPtr sheetp, oldsheetp; - xsl_object *intern; - int prevSubstValue, prevExtDtdValue, clone_docu = 0; - xmlNode *nodep = NULL; - zend_object_handlers *std_hnd; - zval *cloneDocu, *member; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oo", &id, xsl_xsltprocessor_class_entry, &docp) == FAILURE) { - RETURN_FALSE; - } - - nodep = php_libxml_import_node(docp TSRMLS_CC); - - if (nodep) { - doc = nodep->doc; - } - if (doc == NULL) { - php_error(E_WARNING, "Invalid Document"); - RETURN_FALSE; - } - - /* libxslt uses _private, so we must copy the imported - stylesheet document otherwise the node proxies will be a mess */ - newdoc = xmlCopyDoc(doc, 1); - xmlNodeSetBase((xmlNodePtr) newdoc, (xmlChar *)doc->URL); - prevSubstValue = xmlSubstituteEntitiesDefault(1); - prevExtDtdValue = xmlLoadExtDtdDefaultValue; - xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - - sheetp = xsltParseStylesheetDoc(newdoc); - xmlSubstituteEntitiesDefault(prevSubstValue); - xmlLoadExtDtdDefaultValue = prevExtDtdValue; - - if (!sheetp) { - xmlFreeDoc(newdoc); - RETURN_FALSE; - } - - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - - std_hnd = zend_get_std_object_handlers(); - MAKE_STD_ZVAL(member); - ZVAL_STRING(member, "cloneDocument", 0); - cloneDocu = std_hnd->read_property(id, member, BP_VAR_IS TSRMLS_CC); - if (Z_TYPE_P(cloneDocu) != IS_NULL) { - convert_to_long(cloneDocu); - clone_docu = Z_LVAL_P(cloneDocu); - } - efree(member); - if (clone_docu == 0) { - /* check if the stylesheet is using xsl:key, if yes, we have to clone the document _always_ before a transformation */ - nodep = xmlDocGetRootElement(sheetp->doc); - if (nodep && (nodep = nodep->children)) { - while (nodep) { - if (nodep->type == XML_ELEMENT_NODE && xmlStrEqual(nodep->name, "key") && xmlStrEqual(nodep->ns->href, XSLT_NAMESPACE)) { - intern->hasKeys = 1; - break; - } - nodep = nodep->next; - } - } - } else { - intern->hasKeys = clone_docu; - } - - if ((oldsheetp = (xsltStylesheetPtr)intern->ptr)) { - /* free wrapper */ - if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) { - ((xsltStylesheetPtr) intern->ptr)->_private = NULL; - } - xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr); - intern->ptr = NULL; - } - - php_xsl_set_object(id, sheetp TSRMLS_CC); - RETVAL_TRUE; -} -/* }}} end xsl_xsltprocessor_import_stylesheet */ - -static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC) /* {{{ */ -{ - xmlDocPtr newdocp; - xmlDocPtr doc = NULL; - xmlNodePtr node = NULL; - xsltTransformContextPtr ctxt; - php_libxml_node_object *object; - char **params = NULL; - int clone; - zval *doXInclude, *member; - zend_object_handlers *std_hnd; - - node = php_libxml_import_node(docp TSRMLS_CC); - - if (node) { - doc = node->doc; - } - if (doc == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Document"); - return NULL; - } - - if (style == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stylesheet associated to this object"); - return NULL; - } - if (intern->parameter) { - params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC); - } - - intern->doc = emalloc(sizeof(php_libxml_node_object)); - memset(intern->doc, 0, sizeof(php_libxml_node_object)); - - if (intern->hasKeys == 1) { - doc = xmlCopyDoc(doc, 1); - } else { - object = (php_libxml_node_object *)zend_object_store_get_object(docp TSRMLS_CC); - intern->doc->document = object->document; - } - - php_libxml_increment_doc_ref(intern->doc, doc TSRMLS_CC); - - ctxt = xsltNewTransformContext(style, doc); - ctxt->_private = (void *) intern; - - std_hnd = zend_get_std_object_handlers(); - - MAKE_STD_ZVAL(member); - ZVAL_STRING(member, "doXInclude", 0); - doXInclude = std_hnd->read_property(id, member, BP_VAR_IS TSRMLS_CC); - if (Z_TYPE_P(doXInclude) != IS_NULL) { - convert_to_long(doXInclude); - ctxt->xinclude = Z_LVAL_P(doXInclude); - } - efree(member); - - newdocp = xsltApplyStylesheetUser(style, doc, (const char**) params, NULL, NULL, ctxt); - - xsltFreeTransformContext(ctxt); - - if (intern->node_list != NULL) { - zend_hash_destroy(intern->node_list); - FREE_HASHTABLE(intern->node_list); - intern->node_list = NULL; - } - - php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC); - efree(intern->doc); - intern->doc = NULL; - - - if (params) { - clone = 0; - while(params[clone]) { - efree(params[clone++]); - } - efree(params); - } - - return newdocp; - -} -/* }}} */ - -/* {{{ proto domdocument xsl_xsltprocessor_transform_to_doc(domnode doc); -URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# -Since: -*/ -PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc) -{ - zval *id, *rv = NULL, *docp = NULL; - xmlDoc *newdocp; - xsltStylesheetPtr sheetp; - int ret, ret_class_len=0; - char *ret_class = NULL; - xsl_object *intern; - - id = getThis(); - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - sheetp = (xsltStylesheetPtr) intern->ptr; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|s!", &docp, &ret_class, &ret_class_len) == FAILURE) { - RETURN_FALSE; - } - - newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC); - - if (newdocp) { - if (ret_class) { - int found; - char *curclass_name; - zend_class_entry *curce, **ce; - php_libxml_node_object *interndoc; - - curce = Z_OBJCE_P(docp); - curclass_name = curce->name; - while (curce->parent != NULL) { - curce = curce->parent; - } - - found = zend_lookup_class(ret_class, ret_class_len, &ce TSRMLS_CC); - if ((found != SUCCESS) || !instanceof_function(*ce, curce TSRMLS_CC)) { - xmlFreeDoc(newdocp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Expecting class compatible with %s, '%s' given", curclass_name, ret_class); - RETURN_FALSE; - } - - object_init_ex(return_value, *ce); - - interndoc = (php_libxml_node_object *)zend_objects_get_address(return_value TSRMLS_CC); - php_libxml_increment_doc_ref(interndoc, newdocp TSRMLS_CC); - php_libxml_increment_node_ptr(interndoc, (xmlNodePtr)newdocp, (void *)interndoc TSRMLS_CC); - } else { - DOM_RET_OBJ(rv, (xmlNodePtr) newdocp, &ret, NULL); - } - } else { - RETURN_FALSE; - } - -} -/* }}} end xsl_xsltprocessor_transform_to_doc */ - -/* {{{ proto int xsl_xsltprocessor_transform_to_uri(domdocument doc, string uri); -*/ -PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri) -{ - zval *id, *docp = NULL; - xmlDoc *newdocp; - xsltStylesheetPtr sheetp; - int ret, uri_len; - char *uri; - xsl_object *intern; - - id = getThis(); - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - sheetp = (xsltStylesheetPtr) intern->ptr; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "os", &docp, &uri, &uri_len) == FAILURE) { - RETURN_FALSE; - } - - newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC); - - ret = -1; - if (newdocp) { - ret = xsltSaveResultToFilename(uri, newdocp, sheetp, 0); - xmlFreeDoc(newdocp); - } - - RETVAL_LONG(ret); -} -/* }}} end xsl_xsltprocessor_transform_to_uri */ - -/* {{{ proto string xsl_xsltprocessor_transform_to_xml(domdocument doc); -*/ -PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml) -{ - zval *id, *docp = NULL; - xmlDoc *newdocp; - xsltStylesheetPtr sheetp; - int ret; - xmlChar *doc_txt_ptr; - int doc_txt_len; - xsl_object *intern; - - id = getThis(); - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - sheetp = (xsltStylesheetPtr) intern->ptr; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) { - RETURN_FALSE; - } - - newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC); - - ret = -1; - if (newdocp) { - ret = xsltSaveResultToString(&doc_txt_ptr, &doc_txt_len, newdocp, sheetp); - if (doc_txt_ptr) { - RETVAL_STRINGL(doc_txt_ptr, doc_txt_len, 1); - xmlFree(doc_txt_ptr); - } - xmlFreeDoc(newdocp); - } - - if (ret < 0) { - RETURN_FALSE; - } -} -/* }}} end xsl_xsltprocessor_transform_to_xml */ - -/* {{{ proto bool xsl_xsltprocessor_set_parameter(string namespace, mixed name [, string value]); -*/ -PHP_FUNCTION(xsl_xsltprocessor_set_parameter) -{ - - zval *id; - zval *array_value, **entry, *new_string; - xsl_object *intern; - char *string_key, *name, *value, *namespace; - ulong idx; - int string_key_len, namespace_len, name_len, value_len; - DOM_GET_THIS(id); - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sa", &namespace, &namespace_len, &array_value) == SUCCESS) { - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value)); - - while (zend_hash_get_current_data(Z_ARRVAL_P(array_value), (void **)&entry) == SUCCESS) { - SEPARATE_ZVAL(entry); - convert_to_string_ex(entry); - - if (zend_hash_get_current_key_ex(Z_ARRVAL_P(array_value), &string_key, &string_key_len, &idx, 0, NULL) != HASH_KEY_IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter array"); - RETURN_FALSE; - } - - ALLOC_ZVAL(new_string); - ZVAL_ADDREF(*entry); - COPY_PZVAL_TO_ZVAL(*new_string, *entry); - - zend_hash_update(intern->parameter, string_key, string_key_len, &new_string, sizeof(zval*), NULL); - zend_hash_move_forward(Z_ARRVAL_P(array_value)); - } - RETURN_TRUE; - - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sss", &namespace, &namespace_len, &name, &name_len, &value, &value_len) == SUCCESS) { - - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - - MAKE_STD_ZVAL(new_string); - ZVAL_STRING(new_string, value, 1); - - zend_hash_update(intern->parameter, name, name_len + 1, &new_string, sizeof(zval*), NULL); - RETURN_TRUE; - } else { - WRONG_PARAM_COUNT; - } - -} -/* }}} end xsl_xsltprocessor_set_parameter */ - -/* {{{ proto string xsl_xsltprocessor_get_parameter(string namespace, string name); -*/ -PHP_FUNCTION(xsl_xsltprocessor_get_parameter) -{ - zval *id; - int name_len = 0, namespace_len = 0; - char *name, *namespace; - zval **value; - xsl_object *intern; - - DOM_GET_THIS(id); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &namespace, &namespace_len, &name, &name_len) == FAILURE) { - RETURN_FALSE; - } - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - if ( zend_hash_find(intern->parameter, name, name_len + 1, (void**) &value) == SUCCESS) { - convert_to_string_ex(value); - RETVAL_STRING(Z_STRVAL_PP(value),1); - } else { - RETURN_FALSE; - } -} -/* }}} end xsl_xsltprocessor_get_parameter */ - -/* {{{ proto bool xsl_xsltprocessor_remove_parameter(string namespace, string name); -*/ -PHP_FUNCTION(xsl_xsltprocessor_remove_parameter) -{ - zval *id; - int name_len = 0, namespace_len = 0; - char *name, *namespace; - xsl_object *intern; - - DOM_GET_THIS(id); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &namespace, &namespace_len, &name, &name_len) == FAILURE) { - RETURN_FALSE; - } - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - if ( zend_hash_del(intern->parameter, name, name_len + 1) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} end xsl_xsltprocessor_remove_parameter */ - -/* {{{ proto void xsl_xsltprocessor_register_php_functions([mixed $restrict]); -*/ -PHP_FUNCTION(xsl_xsltprocessor_register_php_functions) -{ - zval *id; - xsl_object *intern; - zval *array_value, **entry, *new_string; - int name_len = 0; - char *name; - - DOM_GET_THIS(id); - - - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "a", &array_value) == SUCCESS) { - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value)); - - while (zend_hash_get_current_data(Z_ARRVAL_P(array_value), (void **)&entry) == SUCCESS) { - SEPARATE_ZVAL(entry); - convert_to_string_ex(entry); - - MAKE_STD_ZVAL(new_string); - ZVAL_LONG(new_string,1); - - zend_hash_update(intern->registered_phpfunctions, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &new_string, sizeof(zval*), NULL); - zend_hash_move_forward(Z_ARRVAL_P(array_value)); - } - intern->registerPhpFunctions = 2; - RETURN_TRUE; - - } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == SUCCESS) { - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - - MAKE_STD_ZVAL(new_string); - ZVAL_LONG(new_string,1); - zend_hash_update(intern->registered_phpfunctions, name, name_len + 1, &new_string, sizeof(zval*), NULL); - intern->registerPhpFunctions = 2; - - } else { - intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); - intern->registerPhpFunctions = 1; - } - -} -/* }}} end xsl_xsltprocessor_register_php_functions(); */ - -/* {{{ proto bool xsl_xsltprocessor_has_exslt_support(); -*/ -PHP_FUNCTION(xsl_xsltprocessor_has_exslt_support) -{ -#if HAVE_XSL_EXSLT - RETURN_TRUE; -#else - RETURN_FALSE; -#endif -} -/* }}} end xsl_xsltprocessor_has_exslt_support(); */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/zip/CREDITS b/ext/zip/CREDITS deleted file mode 100644 index 6c7e42d417160..0000000000000 --- a/ext/zip/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Zip -Pierre-Alain Joye diff --git a/ext/zip/TODO b/ext/zip/TODO deleted file mode 100644 index c1baba97edb32..0000000000000 --- a/ext/zip/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- add pattern support to extract or add files -- stream to add or modify entries -- crypt support for zip (read and write) -- Iterators diff --git a/ext/zip/config.m4 b/ext/zip/config.m4 deleted file mode 100644 index ba30f7951b72c..0000000000000 --- a/ext/zip/config.m4 +++ /dev/null @@ -1,73 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(zip, for zip archive read/writesupport, -[ --enable-zip Include Zip read/write support]) - -if test -z "$PHP_ZLIB_DIR"; then -PHP_ARG_WITH(zlib-dir, for the location of libz, -[ --with-zlib-dir[=DIR] ZIP: Set the path to libz install prefix], no, no) -fi - -if test "$PHP_ZIP" != "no"; then - - if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then - if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then - PHP_ZLIB_DIR="$PHP_ZLIB_DIR" - PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib" - elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then - PHP_ZLIB_DIR="$PHP_ZLIB_DIR" - PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" - else - AC_MSG_ERROR([Can not find zlib headers under "$PHP_ZLIB_DIR"]) - fi - else - for i in /usr/local /usr; do - if test -f "$i/include/zlib/zlib.h"; then - PHP_ZLIB_DIR="$i" - PHP_ZLIB_INCDIR="$i/include/zlib" - elif test -f "$i/include/zlib.h"; then - PHP_ZLIB_DIR="$i" - PHP_ZLIB_INCDIR="$i/include" - fi - done - fi - - dnl # zlib - AC_MSG_CHECKING([for the location of zlib]) - if test "$PHP_ZLIB_DIR" = "no"; then - AC_MSG_ERROR([zip support requires ZLIB. Use --with-zlib-dir= to specify prefix where ZLIB include and library are located]) - else - AC_MSG_RESULT([$PHP_ZLIB_DIR]) - PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, ZIP_SHARED_LIBADD) - PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) - fi - - PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \ - lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c \ - lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \ - lib/zip_file_error_get.c lib/zip_free.c lib/zip_rename.c \ - lib/zip_source_free.c lib/zip_unchange_all.c lib/zip_delete.c \ - lib/zip_error_get_sys_type.c lib/zip_file_get_offset.c \ - lib/zip_get_name.c lib/zip_replace.c lib/zip_source_function.c \ - lib/zip_unchange.c lib/zip_dirent.c lib/zip_error_strerror.c \ - lib/zip_filerange_crc.c lib/zip_file_strerror.c lib/zip_get_num_files.c \ - lib/zip_get_archive_flag.c lib/zip_set_archive_flag.c \ - lib/zip_set_name.c lib/zip_source_zip.c lib/zip_unchange_data.c \ - lib/zip_entry_free.c lib/zip_error_to_str.c lib/zip_fopen.c \ - lib/zip_name_locate.c lib/zip_source_buffer.c lib/zip_stat.c \ - lib/zip_entry_new.c lib/zip_err_str.c lib/zip_fopen_index.c \ - lib/zip_get_archive_comment.c lib/zip_get_file_comment.c \ - lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c \ - lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \ - lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \ - lib/zip_error_clear.c lib/zip_file_error_clear.c" - - AC_DEFINE(HAVE_ZIP,1,[ ]) - PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared) - PHP_ADD_BUILD_DIR($ext_builddir/lib, 1) - PHP_SUBST(ZIP_SHARED_LIBADD) - - dnl so we always include the known-good working hack. -fi diff --git a/ext/zip/config.w32 b/ext/zip/config.w32 deleted file mode 100644 index 0a3dc18db883d..0000000000000 --- a/ext/zip/config.w32 +++ /dev/null @@ -1,39 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("zip", "ZIP support", "no"); - -if (PHP_ZIP != "no") { - - if (CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS_ZIP", "..\\zlib;" + php_usual_include_suspects + ";" + PHP_ZIP)) { - if (PHP_ZLIB_SHARED) { - CHECK_LIB("zlib.lib", "zip", PHP_ZIP); - } - EXTENSION('zip', 'php_zip.c zip_stream.c'); - ADD_SOURCES(configure_module_dirname + "/lib", "zip_add.c zip_error.c zip_fclose.c \ - zip_fread.c zip_open.c zip_source_filep.c \ - zip_strerror.c zip_close.c zip_error_get.c \ - zip_file_error_get.c zip_free.c zip_rename.c \ - zip_source_free.c zip_unchange_all.c zip_delete.c \ - zip_error_get_sys_type.c zip_file_get_offset.c \ - zip_get_name.c zip_replace.c zip_source_function.c \ - zip_unchange.c zip_dirent.c zip_error_strerror.c \ - zip_filerange_crc.c zip_file_strerror.c zip_get_num_files.c \ - zip_get_archive_flag.c zip_set_archive_flag.c \ - zip_set_name.c zip_source_zip.c zip_unchange_data.c \ - zip_entry_free.c zip_error_to_str.c zip_fopen.c \ - zip_name_locate.c zip_source_buffer.c zip_stat.c \ - zip_entry_new.c zip_err_str.c zip_fopen_index.c \ - zip_new.c zip_source_file.c zip_stat_index.c \ - zip_get_archive_comment.c zip_get_file_comment.c \ - zip_set_archive_comment.c zip_set_file_comment.c \ - zip_unchange_archive.c zip_memdup.c zip_stat_init.c \ - zip_add_dir.c zip_file_error_clear.c zip_error_clear.c", "zip"); - - AC_DEFINE('HAVE_ZLIB', 1); - AC_DEFINE('HAVE_ZIP', 1); - } else { - WARNING("zip not enabled; libraries and headers not found"); - } -} - diff --git a/ext/zip/examples/comment.php b/ext/zip/examples/comment.php deleted file mode 100644 index 90b37d3795c04..0000000000000 --- a/ext/zip/examples/comment.php +++ /dev/null @@ -1,6 +0,0 @@ -open('test_with_comment.zip'); -// Add "Foo Comment" as comment for the foo entry -$z->setCommentName('foo', 'Too Comment ' . time()); -$z->close(); diff --git a/ext/zip/examples/create.php b/ext/zip/examples/create.php deleted file mode 100644 index cffacee93b713..0000000000000 --- a/ext/zip/examples/create.php +++ /dev/null @@ -1,20 +0,0 @@ -open($filename, ZIPARCHIVE::CREATE)) { - exit("cannot open <$filename>\n"); -} else { - echo "file <$filename> OK\n"; -} - -$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n"); -$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string added as testfilephp2.txt.\n"); -$zip->addFile($thisdir . "/too.php","/testfromfile.php"); -echo "numfiles: " . $zip->numFiles . "\n"; -echo "status:" . $zip->status . "\n"; -$zip->close(); -unset($zip); diff --git a/ext/zip/examples/dir.php b/ext/zip/examples/dir.php deleted file mode 100644 index 00e4b40585298..0000000000000 --- a/ext/zip/examples/dir.php +++ /dev/null @@ -1,17 +0,0 @@ -open('test_with_comment.zip'); -print_r($za); -var_dump($za); -echo "numFiles: " . $za->numFiles . "\n"; -echo "status: " . $za->status . "\n"; -echo "statusSys: " . $za->statusSys . "\n"; -echo "filename: " . $za->filename . "\n"; -echo "comment: " . $za->comment . "\n"; - -for ($i=0; $i<$za->numFiles;$i++) { - echo "index: $i\n"; - print_r($za->statIndex($i)); -} -echo "numFile:" . $za->numFiles . "\n"; diff --git a/ext/zip/examples/extract.php b/ext/zip/examples/extract.php deleted file mode 100644 index 696502ba1225f..0000000000000 --- a/ext/zip/examples/extract.php +++ /dev/null @@ -1,24 +0,0 @@ -filename . "\n"; -$zip->open("test.zip"); -/* -$zip->addFile("./modules/"); -$zip->addFile("./testempty"); -*/ -echo $zip->status . "\n"; -echo $zip->statusSys . "\n"; - -echo $zip->numFiles . "\n"; -echo $zip->filename . "\n"; -var_dump($zip); -$files = array('test', 'testdir/test2'); -if (!$zip->extractTo("./testext/path/to", $files)) { - echo "error!\n"; - echo $zip->status . "\n"; - echo $zip->statusSys . "\n"; - -} - -$zip->close(); diff --git a/ext/zip/examples/extractAll.php b/ext/zip/examples/extractAll.php deleted file mode 100644 index d318a453df4f0..0000000000000 --- a/ext/zip/examples/extractAll.php +++ /dev/null @@ -1,24 +0,0 @@ -filename . "\n"; -$zip->open("test.zip"); -/* -$zip->addFile("./modules/"); -$zip->addFile("./testempty"); -*/ -echo $zip->status . "\n"; -echo $zip->statusSys . "\n"; - -echo $zip->numFiles . "\n"; -echo $zip->filename . "\n"; -var_dump($zip); -$files = array('test', 'testdir/test2'); -if (!$zip->extractTo("./testext/path/to")) { - echo "error!\n"; - echo $zip->status . "\n"; - echo $zip->statusSys . "\n"; - -} - -$zip->close(); diff --git a/ext/zip/examples/fopen.php b/ext/zip/examples/fopen.php deleted file mode 100644 index 5af37b1ab3373..0000000000000 --- a/ext/zip/examples/fopen.php +++ /dev/null @@ -1,31 +0,0 @@ -open(dirname(__FILE__) . '/test.zip'); -$fp = $z->getStream('test'); - -var_dump($fp); -if(!$fp) exit("\n"); -while (!feof($fp)) { - $contents .= fread($fp, 2); -} - -fclose($fp); -file_put_contents('t',$contents); -echo "done.\n"; - - diff --git a/ext/zip/examples/get_set_comments.php b/ext/zip/examples/get_set_comments.php deleted file mode 100644 index 5bd302e6da46a..0000000000000 --- a/ext/zip/examples/get_set_comments.php +++ /dev/null @@ -1,38 +0,0 @@ -open('t.zip'); - -print_r($z); - -for ($i=0; $i<$z->numFiles; $i++) { - echo "index: $i\n"; - print_r($z->getCommentIndex($i)); - echo "\n\n"; -} -echo "foobar/ " . $z->getCommentName('foobar/') . "\n"; - -echo "Archive comment: " . $z->getArchiveComment() . "\n"; - - -$z->setCommentIndex(1, 'new comment idx 1'); -$z->setCommentName('foobar/', 'new comment foobar/'); - -$z->setArchiveComment( 'new archive comment'); - -for ($i=0; $i<$z->numFiles; $i++) { - echo "index: $i\n"; - print_r($z->getCommentIndex($i)); - echo "\n\n"; -} - -echo $z->getCommentName('foobar/') . "\n"; - -// Get the original comment -echo $z->getCommentName('foobar/', ZIPARCHIVE::FL_UNCHANGED) . "\n"; - -echo "Archive comment: " . $z->getArchiveComment() . "\n"; -echo "Archive comment (original): " . $z->getArchiveComment(ZIPARCHIVE::FL_UNCHANGED) . "\n"; - diff --git a/ext/zip/examples/im.php b/ext/zip/examples/im.php deleted file mode 100644 index 3721434054d19..0000000000000 --- a/ext/zip/examples/im.php +++ /dev/null @@ -1,11 +0,0 @@ -open(dirname(__FILE__) . '/test_im.zip'); -$im_string = $z->getFromName("pear_item.gif"); -$im = imagecreatefromstring($im_string); -imagepng($im, 'b.png'); - diff --git a/ext/zip/examples/odt.php b/ext/zip/examples/odt.php deleted file mode 100644 index c829f123433e9..0000000000000 --- a/ext/zip/examples/odt.php +++ /dev/null @@ -1,20 +0,0 @@ -open('zip://' . dirname(__FILE__) . '/test.odt#meta.xml'); -$odt_meta = array(); -while ($reader->read()) { - if ($reader->nodeType == XMLREADER::ELEMENT) { - $elm = $reader->name; - } else { - if ($reader->nodeType == XMLREADER::END_ELEMENT && $reader->name == 'office:meta') { - break; - } - if (!trim($reader->value)) { - continue; - } - $odt_meta[$elm] = $reader->value; - } -} -print_r($odt_meta); diff --git a/ext/zip/examples/oldapi.php b/ext/zip/examples/oldapi.php deleted file mode 100644 index 2f17f43ebd0f4..0000000000000 --- a/ext/zip/examples/oldapi.php +++ /dev/null @@ -1,17 +0,0 @@ - - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#include "main/php.h" - -#ifdef PHP_WIN32 -# include "zip_win32.h" -# ifdef PHP_ZIP_EXPORTS -# define ZIP_EXTERN(rt) __declspec(dllexport)rt _stdcall -# else -# define ZIP_EXTERN(rt) rt -# endif -#elif defined(__GNUC__) && __GNUC__ >= 4 -# define ZIP_EXTERN(rt) __attribute__ ((visibility("default"))) rt -#else -# define ZIP_EXTERN(rt) rt -#endif - -BEGIN_EXTERN_C() - -#include -#include -#include - -/* flags for zip_open */ - -#define ZIP_CREATE 1 -#define ZIP_EXCL 2 -#define ZIP_CHECKCONS 4 -#define ZIP_OVERWRITE 8 - - -/* flags for zip_name_locate, zip_fopen, zip_stat, ... */ - -#define ZIP_FL_NOCASE 1 /* ignore case on name lookup */ -#define ZIP_FL_NODIR 2 /* ignore directory component */ -#define ZIP_FL_COMPRESSED 4 /* read compressed data */ -#define ZIP_FL_UNCHANGED 8 /* use original data, ignoring changes */ -#define ZIP_FL_RECOMPRESS 16 /* force recompression of data */ - -/* archive global flags flags */ - -#define ZIP_AFL_TORRENT 1 /* torrent zipped */ - -/* libzip error codes */ - -#define ZIP_ER_OK 0 /* N No error */ -#define ZIP_ER_MULTIDISK 1 /* N Multi-disk zip archives not supported */ -#define ZIP_ER_RENAME 2 /* S Renaming temporary file failed */ -#define ZIP_ER_CLOSE 3 /* S Closing zip archive failed */ -#define ZIP_ER_SEEK 4 /* S Seek error */ -#define ZIP_ER_READ 5 /* S Read error */ -#define ZIP_ER_WRITE 6 /* S Write error */ -#define ZIP_ER_CRC 7 /* N CRC error */ -#define ZIP_ER_ZIPCLOSED 8 /* N Containing zip archive was closed */ -#define ZIP_ER_NOENT 9 /* N No such file */ -#define ZIP_ER_EXISTS 10 /* N File already exists */ -#define ZIP_ER_OPEN 11 /* S Can't open file */ -#define ZIP_ER_TMPOPEN 12 /* S Failure to create temporary file */ -#define ZIP_ER_ZLIB 13 /* Z Zlib error */ -#define ZIP_ER_MEMORY 14 /* N Malloc failure */ -#define ZIP_ER_CHANGED 15 /* N Entry has been changed */ -#define ZIP_ER_COMPNOTSUPP 16 /* N Compression method not supported */ -#define ZIP_ER_EOF 17 /* N Premature EOF */ -#define ZIP_ER_INVAL 18 /* N Invalid argument */ -#define ZIP_ER_NOZIP 19 /* N Not a zip archive */ -#define ZIP_ER_INTERNAL 20 /* N Internal error */ -#define ZIP_ER_INCONS 21 /* N Zip archive inconsistent */ -#define ZIP_ER_REMOVE 22 /* S Can't remove file */ -#define ZIP_ER_DELETED 23 /* N Entry has been deleted */ - - -/* type of system error value */ - -#define ZIP_ET_NONE 0 /* sys_err unused */ -#define ZIP_ET_SYS 1 /* sys_err is errno */ -#define ZIP_ET_ZLIB 2 /* sys_err is zlib error code */ - -/* compression methods */ - -#define ZIP_CM_DEFAULT -1 /* better of deflate or store */ -#define ZIP_CM_STORE 0 /* stored (uncompressed) */ -#define ZIP_CM_SHRINK 1 /* shrunk */ -#define ZIP_CM_REDUCE_1 2 /* reduced with factor 1 */ -#define ZIP_CM_REDUCE_2 3 /* reduced with factor 2 */ -#define ZIP_CM_REDUCE_3 4 /* reduced with factor 3 */ -#define ZIP_CM_REDUCE_4 5 /* reduced with factor 4 */ -#define ZIP_CM_IMPLODE 6 /* imploded */ -/* 7 - Reserved for Tokenizing compression algorithm */ -#define ZIP_CM_DEFLATE 8 /* deflated */ -#define ZIP_CM_DEFLATE64 9 /* deflate64 */ -#define ZIP_CM_PKWARE_IMPLODE 10 /* PKWARE imploding */ -/* 11 - Reserved by PKWARE */ -#define ZIP_CM_BZIP2 12 /* compressed using BZIP2 algorithm */ -/* 13 - Reserved by PKWARE */ -#define ZIP_CM_LZMA 14 /* LZMA (EFS) */ -/* 15-17 - Reserved by PKWARE */ -#define ZIP_CM_TERSE 18 /* compressed using IBM TERSE (new) */ -#define ZIP_CM_LZ77 19 /* IBM LZ77 z Architecture (PFS) */ -#define ZIP_CM_WAVPACK 97 /* WavPack compressed data */ -#define ZIP_CM_PPMD 98 /* PPMd version I, Rev 1 */ - -/* encryption methods */ - -#define ZIP_EM_NONE 0 /* not encrypted */ -#define ZIP_EM_TRAD_PKWARE 1 /* traditional PKWARE encryption */ -#if 0 /* Strong Encryption Header not parsed yet */ -#define ZIP_EM_DES 0x6601 /* strong encryption: DES */ -#define ZIP_EM_RC2_OLD 0x6602 /* strong encryption: RC2, version < 5.2 */ -#define ZIP_EM_3DES_168 0x6603 -#define ZIP_EM_3DES_112 0x6609 -#define ZIP_EM_AES_128 0x660e -#define ZIP_EM_AES_192 0x660f -#define ZIP_EM_AES_256 0x6610 -#define ZIP_EM_RC2 0x6702 /* strong encryption: RC2, version >= 5.2 */ -#define ZIP_EM_RC4 0x6801 -#endif -#define ZIP_EM_UNKNOWN 0xffff /* unknown algorithm */ - - - -enum zip_source_cmd { - ZIP_SOURCE_OPEN, /* prepare for reading */ - ZIP_SOURCE_READ, /* read data */ - ZIP_SOURCE_CLOSE, /* reading is done */ - ZIP_SOURCE_STAT, /* get meta information */ - ZIP_SOURCE_ERROR, /* get error information */ - ZIP_SOURCE_FREE /* cleanup and free resources */ -}; - -typedef ssize_t (*zip_source_callback)(void *state, void *data, - size_t len, enum zip_source_cmd cmd); - -struct zip_stat { - const char *name; /* name of the file */ - int index; /* index within archive */ - unsigned int crc; /* crc of file data */ - time_t mtime; /* modification time */ - off_t size; /* size of file (uncompressed) */ - off_t comp_size; /* size of file (compressed) */ - unsigned short comp_method; /* compression method used */ - unsigned short encryption_method; /* encryption method used */ -}; - -struct zip; -struct zip_file; -struct zip_source; - - - -ZIP_EXTERN(int) zip_add(struct zip *, const char *, struct zip_source *); -ZIP_EXTERN(int) zip_add_dir(struct zip *, const char *); -ZIP_EXTERN(int) zip_close(struct zip *); -ZIP_EXTERN(int) zip_delete(struct zip *, int); -ZIP_EXTERN(void) zip_error_clear(struct zip *); -ZIP_EXTERN(void) zip_error_get(struct zip *, int *, int *); -ZIP_EXTERN(int) zip_error_get_sys_type(int); -ZIP_EXTERN(int) zip_error_to_str(char *, size_t, int, int); -ZIP_EXTERN(int) zip_fclose(struct zip_file *); -ZIP_EXTERN(void) zip_file_error_clear(struct zip_file *); -ZIP_EXTERN(void) zip_file_error_get(struct zip_file *, int *, int *); -ZIP_EXTERN(const char *)zip_file_strerror(struct zip_file *); -ZIP_EXTERN(struct zip_file *)zip_fopen(struct zip *, const char *, int); -ZIP_EXTERN(struct zip_file *)zip_fopen_index(struct zip *, int, int); -ZIP_EXTERN(ssize_t) zip_fread(struct zip_file *, void *, size_t); -ZIP_EXTERN(const char *)zip_get_archive_comment(struct zip *, int *, int); -ZIP_EXTERN(int) zip_get_archive_flag(struct zip *, int, int); -ZIP_EXTERN(const char *)zip_get_file_comment(struct zip *, int, int *, int); -ZIP_EXTERN(const char *)zip_get_name(struct zip *, int, int); -ZIP_EXTERN(int) zip_get_num_files(struct zip *); -ZIP_EXTERN(int) zip_name_locate(struct zip *, const char *, int); -ZIP_EXTERN(struct zip *)zip_open(const char *, int, int *); -ZIP_EXTERN(int) zip_rename(struct zip *, int, const char *); -ZIP_EXTERN(int) zip_replace(struct zip *, int, struct zip_source *); -ZIP_EXTERN(int) zip_set_archive_comment(struct zip *, const char *, int); -ZIP_EXTERN(int) zip_set_archive_flag(struct zip *, int, int); -ZIP_EXTERN(int) zip_set_file_comment(struct zip *, int, const char *, int); -ZIP_EXTERN(struct zip_source *)zip_source_buffer(struct zip *, const void *, - off_t, int); -ZIP_EXTERN(struct zip_source *)zip_source_file(struct zip *, const char *, - off_t, off_t); -ZIP_EXTERN(struct zip_source *)zip_source_filep(struct zip *, FILE *, - off_t, off_t); -ZIP_EXTERN(void) zip_source_free(struct zip_source *); -ZIP_EXTERN(struct zip_source *)zip_source_function(struct zip *, - zip_source_callback, void *); -ZIP_EXTERN(struct zip_source *)zip_source_zip(struct zip *, struct zip *, - int, int, off_t, off_t); -ZIP_EXTERN(int) zip_stat(struct zip *, const char *, int, struct zip_stat *); -ZIP_EXTERN(int) zip_stat_index(struct zip *, int, int, struct zip_stat *); -ZIP_EXTERN(void) zip_stat_init(struct zip_stat *); -ZIP_EXTERN(const char *)zip_strerror(struct zip *); -ZIP_EXTERN(int) zip_unchange(struct zip *, int); -ZIP_EXTERN(int) zip_unchange_all(struct zip *); -ZIP_EXTERN(int) zip_unchange_archive(struct zip *); - -END_EXTERN_C(); -#endif /* _HAD_ZIP_H */ diff --git a/ext/zip/lib/zip_add.c b/ext/zip/lib/zip_add.c deleted file mode 100644 index 3afb1768f71d7..0000000000000 --- a/ext/zip/lib/zip_add.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - zip_add.c -- add file via callback function - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_add(struct zip *za, const char *name, struct zip_source *source) -{ - if (name == NULL || source == NULL) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - return _zip_replace(za, -1, name, source); -} diff --git a/ext/zip/lib/zip_add_dir.c b/ext/zip/lib/zip_add_dir.c deleted file mode 100644 index 9b23425194298..0000000000000 --- a/ext/zip/lib/zip_add_dir.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - zip_add_dir.c -- add directory - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_add_dir(struct zip *za, const char *name) -{ - int len, ret; - char *s; - struct zip_source *source; - - if (name == NULL) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - s = NULL; - len = strlen(name); - - if (name[len-1] != '/') { - if ((s=(char *)malloc(len+2)) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return -1; - } - strcpy(s, name); - s[len] = '/'; - s[len+1] = '\0'; - } - - if ((source=zip_source_buffer(za, NULL, 0, 0)) == NULL) { - free(s); - return -1; - } - - ret = _zip_replace(za, -1, s ? s : name, source); - - free(s); - if (ret < 0) - zip_source_free(source); - - return ret; -} diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c deleted file mode 100644 index 9fe0fba919a2f..0000000000000 --- a/ext/zip/lib/zip_close.c +++ /dev/null @@ -1,672 +0,0 @@ -/* - zip_close.c -- close zip archive and update changes - Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include -#include -#include -#include -#include - -#include "zipint.h" - -static int add_data(struct zip *, struct zip_source *, struct zip_dirent *, - FILE *); -static int add_data_comp(zip_source_callback, void *, struct zip_stat *, - FILE *, struct zip_error *); -static int add_data_uncomp(struct zip *, zip_source_callback, void *, - struct zip_stat *, FILE *); -static void ch_set_error(struct zip_error *, zip_source_callback, void *); -static int copy_data(FILE *, off_t, FILE *, struct zip_error *); -static int write_cdir(struct zip *, struct zip_cdir *, FILE *); -static int _zip_cdir_set_comment(struct zip_cdir *, struct zip *); -static int _zip_changed(struct zip *, int *); -static char *_zip_create_temp_output(struct zip *, FILE **); -static int _zip_torrentzip_cmp(const void *, const void *); - - - -struct filelist { - int idx; - const char *name; -}; - - - -ZIP_EXTERN(int) -zip_close(struct zip *za) -{ - int survivors; - int i, j, error; - char *temp; - FILE *out; - mode_t mask; - struct zip_cdir *cd; - struct zip_dirent de; - struct filelist *filelist; - int reopen_on_error; - int new_torrentzip; - - reopen_on_error = 0; - - if (za == NULL) - return -1; - - if (!_zip_changed(za, &survivors)) { - _zip_free(za); - return 0; - } - - /* don't create zip files with no entries */ - if (survivors == 0) { - if (za->zn && za->zp) { - if (remove(za->zn) != 0) { - _zip_error_set(&za->error, ZIP_ER_REMOVE, errno); - return -1; - } - } - _zip_free(za); - return 0; - } - - if ((filelist=(struct filelist *)malloc(sizeof(filelist[0])*survivors)) - == NULL) - return -1; - - if ((cd=_zip_cdir_new(survivors, &za->error)) == NULL) { - free(filelist); - return -1; - } - - for (i=0; ientry[i]); - - /* archive comment is special for torrentzip */ - if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) { - cd->comment = _zip_memdup(TORRENT_SIG "XXXXXXXX", - TORRENT_SIG_LEN + TORRENT_CRC_LEN, - &za->error); - if (cd->comment == NULL) { - _zip_cdir_free(cd); - free(filelist); - return -1; - } - cd->comment_len = TORRENT_SIG_LEN + TORRENT_CRC_LEN; - } - else if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, ZIP_FL_UNCHANGED) == 0) { - if (_zip_cdir_set_comment(cd, za) == -1) { - _zip_cdir_free(cd); - free(filelist); - return -1; - } - } - - if ((temp=_zip_create_temp_output(za, &out)) == NULL) { - _zip_cdir_free(cd); - return -1; - } - - - /* create list of files with index into original archive */ - for (i=j=0; inentry; i++) { - if (za->entry[i].state == ZIP_ST_DELETED) - continue; - - filelist[j].idx = i; - filelist[j].name = zip_get_name(za, i, 0); - j++; - } - if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) - qsort(filelist, survivors, sizeof(filelist[0]), - _zip_torrentzip_cmp); - - new_torrentzip = (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 1 - && zip_get_archive_flag(za, ZIP_AFL_TORRENT, - ZIP_FL_UNCHANGED) == 0); - error = 0; - for (j=0; jentry+i) || new_torrentzip) { - _zip_dirent_init(&de); - - if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) - _zip_dirent_torrent_normalize(&de); - - /* use it as central directory entry */ - memcpy(cd->entry+j, &de, sizeof(cd->entry[j])); - - /* set/update file name */ - if (za->entry[i].ch_filename == NULL) { - if (za->entry[i].state == ZIP_ST_ADDED) { - de.filename = strdup("-"); - de.filename_len = 1; - cd->entry[j].filename = "-"; - } - else { - de.filename = strdup(za->cdir->entry[i].filename); - de.filename_len = strlen(de.filename); - cd->entry[j].filename = za->cdir->entry[i].filename; - cd->entry[j].filename_len = de.filename_len; - } - } - } - else { - /* copy existing directory entries */ - if (fseeko(za->zp, za->cdir->entry[i].offset, SEEK_SET) != 0) { - _zip_error_set(&za->error, ZIP_ER_SEEK, errno); - error = 1; - break; - } - if (_zip_dirent_read(&de, za->zp, NULL, 0, 1, &za->error) != 0) { - error = 1; - break; - } - if (de.bitflags & ZIP_GPBF_DATA_DESCRIPTOR) { - de.crc = za->cdir->entry[i].crc; - de.comp_size = za->cdir->entry[i].comp_size; - de.uncomp_size = za->cdir->entry[i].uncomp_size; - de.bitflags &= ~ZIP_GPBF_DATA_DESCRIPTOR; - } - memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j])); - } - - if (za->entry[i].ch_filename) { - free(de.filename); - if ((de.filename=strdup(za->entry[i].ch_filename)) == NULL) { - error = 1; - break; - } - de.filename_len = strlen(de.filename); - cd->entry[j].filename = za->entry[i].ch_filename; - cd->entry[j].filename_len = de.filename_len; - } - - if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 0 - && za->entry[i].ch_comment_len != -1) { - /* as the rest of cd entries, its malloc/free is done by za */ - cd->entry[j].comment = za->entry[i].ch_comment; - cd->entry[j].comment_len = za->entry[i].ch_comment_len; - } - - cd->entry[j].offset = ftello(out); - - if (ZIP_ENTRY_DATA_CHANGED(za->entry+i) || new_torrentzip) { - struct zip_source *zs; - - zs = NULL; - if (!ZIP_ENTRY_DATA_CHANGED(za->entry+i)) { - if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1)) - == NULL) { - error = 1; - break; - } - } - - if (add_data(za, zs ? zs : za->entry[i].source, &de, out) < 0) { - error = 1; - break; - } - cd->entry[j].last_mod = de.last_mod; - cd->entry[j].comp_method = de.comp_method; - cd->entry[j].comp_size = de.comp_size; - cd->entry[j].uncomp_size = de.uncomp_size; - cd->entry[j].crc = de.crc; - } - else { - if (_zip_dirent_write(&de, out, 1, &za->error) < 0) { - error = 1; - break; - } - /* we just read the local dirent, file is at correct position */ - if (copy_data(za->zp, cd->entry[j].comp_size, out, - &za->error) < 0) { - error = 1; - break; - } - } - - _zip_dirent_finalize(&de); - } - - if (!error) { - if (write_cdir(za, cd, out) < 0) - error = 1; - } - - /* pointers in cd entries are owned by za */ - cd->nentry = 0; - _zip_cdir_free(cd); - - if (error) { - _zip_dirent_finalize(&de); - fclose(out); - remove(temp); - free(temp); - return -1; - } - - if (fclose(out) != 0) { - _zip_error_set(&za->error, ZIP_ER_CLOSE, errno); - remove(temp); - free(temp); - return -1; - } - - if (za->zp) { - fclose(za->zp); - za->zp = NULL; - reopen_on_error = 1; - } - if (_zip_rename(temp, za->zn) != 0) { - _zip_error_set(&za->error, ZIP_ER_RENAME, errno); - remove(temp); - free(temp); - if (reopen_on_error) { - /* ignore errors, since we're already in an error case */ - za->zp = fopen(za->zn, "rb"); - } - return -1; - } - mask = umask(0); - umask(mask); - chmod(za->zn, 0666&~mask); - - _zip_free(za); - free(temp); - - return 0; -} - - - -static int -add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft) -{ - off_t offstart, offend; - zip_source_callback cb; - void *ud; - struct zip_stat st; - - cb = zs->f; - ud = zs->ud; - - if (cb(ud, &st, sizeof(st), ZIP_SOURCE_STAT) < (ssize_t)sizeof(st)) { - ch_set_error(&za->error, cb, ud); - return -1; - } - - if (cb(ud, NULL, 0, ZIP_SOURCE_OPEN) < 0) { - ch_set_error(&za->error, cb, ud); - return -1; - } - - offstart = ftello(ft); - - if (_zip_dirent_write(de, ft, 1, &za->error) < 0) - return -1; - - if (st.comp_method != ZIP_CM_STORE) { - if (add_data_comp(cb, ud, &st, ft, &za->error) < 0) - return -1; - } - else { - if (add_data_uncomp(za, cb, ud, &st, ft) < 0) - return -1; - } - - if (cb(ud, NULL, 0, ZIP_SOURCE_CLOSE) < 0) { - ch_set_error(&za->error, cb, ud); - return -1; - } - - offend = ftello(ft); - - if (fseeko(ft, offstart, SEEK_SET) < 0) { - _zip_error_set(&za->error, ZIP_ER_SEEK, errno); - return -1; - } - - - de->last_mod = st.mtime; - de->comp_method = st.comp_method; - de->crc = st.crc; - de->uncomp_size = st.size; - de->comp_size = st.comp_size; - - if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) - _zip_dirent_torrent_normalize(de); - - if (_zip_dirent_write(de, ft, 1, &za->error) < 0) - return -1; - - if (fseeko(ft, offend, SEEK_SET) < 0) { - _zip_error_set(&za->error, ZIP_ER_SEEK, errno); - return -1; - } - - return 0; -} - - - -static int -add_data_comp(zip_source_callback cb, void *ud, struct zip_stat *st,FILE *ft, - struct zip_error *error) -{ - char buf[BUFSIZE]; - ssize_t n; - - st->comp_size = 0; - while ((n=cb(ud, buf, sizeof(buf), ZIP_SOURCE_READ)) > 0) { - if (fwrite(buf, 1, n, ft) != (size_t)n) { - _zip_error_set(error, ZIP_ER_WRITE, errno); - return -1; - } - - st->comp_size += n; - } - if (n < 0) { - ch_set_error(error, cb, ud); - return -1; - } - - return 0; -} - - - -static int -add_data_uncomp(struct zip *za, zip_source_callback cb, void *ud, - struct zip_stat *st, FILE *ft) -{ - char b1[BUFSIZE], b2[BUFSIZE]; - int end, flush, ret; - ssize_t n; - size_t n2; - z_stream zstr; - int mem_level; - - st->comp_method = ZIP_CM_DEFLATE; - st->comp_size = st->size = 0; - st->crc = crc32(0, NULL, 0); - - zstr.zalloc = Z_NULL; - zstr.zfree = Z_NULL; - zstr.opaque = NULL; - zstr.avail_in = 0; - zstr.avail_out = 0; - - if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) - mem_level = TORRENT_MEM_LEVEL; - else - mem_level = MAX_MEM_LEVEL; - - /* -MAX_WBITS: undocumented feature of zlib to _not_ write a zlib header */ - deflateInit2(&zstr, Z_BEST_COMPRESSION, Z_DEFLATED, -MAX_WBITS, mem_level, - Z_DEFAULT_STRATEGY); - - zstr.next_out = (Bytef *)b2; - zstr.avail_out = sizeof(b2); - zstr.avail_in = 0; - - flush = 0; - end = 0; - while (!end) { - if (zstr.avail_in == 0 && !flush) { - if ((n=cb(ud, b1, sizeof(b1), ZIP_SOURCE_READ)) < 0) { - ch_set_error(&za->error, cb, ud); - deflateEnd(&zstr); - return -1; - } - if (n > 0) { - zstr.avail_in = n; - zstr.next_in = (Bytef *)b1; - st->size += n; - st->crc = crc32(st->crc, (Bytef *)b1, n); - } - else - flush = Z_FINISH; - } - - ret = deflate(&zstr, flush); - if (ret != Z_OK && ret != Z_STREAM_END) { - _zip_error_set(&za->error, ZIP_ER_ZLIB, ret); - return -1; - } - - if (zstr.avail_out != sizeof(b2)) { - n2 = sizeof(b2) - zstr.avail_out; - - if (fwrite(b2, 1, n2, ft) != n2) { - _zip_error_set(&za->error, ZIP_ER_WRITE, errno); - return -1; - } - - zstr.next_out = (Bytef *)b2; - zstr.avail_out = sizeof(b2); - st->comp_size += n2; - } - - if (ret == Z_STREAM_END) { - deflateEnd(&zstr); - end = 1; - } - } - - return 0; -} - - - -static void -ch_set_error(struct zip_error *error, zip_source_callback cb, void *ud) -{ - int e[2]; - - if ((cb(ud, e, sizeof(e), ZIP_SOURCE_ERROR)) < (ssize_t)sizeof(e)) { - error->zip_err = ZIP_ER_INTERNAL; - error->sys_err = 0; - } - else { - error->zip_err = e[0]; - error->sys_err = e[1]; - } -} - - - -static int -copy_data(FILE *fs, off_t len, FILE *ft, struct zip_error *error) -{ - char buf[BUFSIZE]; - int n, nn; - - if (len == 0) - return 0; - - while (len > 0) { - nn = len > sizeof(buf) ? sizeof(buf) : len; - if ((n=fread(buf, 1, nn, fs)) < 0) { - _zip_error_set(error, ZIP_ER_READ, errno); - return -1; - } - else if (n == 0) { - _zip_error_set(error, ZIP_ER_EOF, 0); - return -1; - } - - if (fwrite(buf, 1, n, ft) != (size_t)n) { - _zip_error_set(error, ZIP_ER_WRITE, errno); - return -1; - } - - len -= n; - } - - return 0; -} - - - -static int -write_cdir(struct zip *za, struct zip_cdir *cd, FILE *out) -{ - off_t offset; - uLong crc; - char buf[TORRENT_CRC_LEN+1]; - - if (_zip_cdir_write(cd, out, &za->error) < 0) - return -1; - - if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 0) - return 0; - - - /* fix up torrentzip comment */ - - offset = ftello(out); - - if (_zip_filerange_crc(out, cd->offset, cd->size, &crc, &za->error) < 0) - return -1; - - snprintf(buf, sizeof(buf), "%08lX", (long)crc); - - if (fseeko(out, offset-TORRENT_CRC_LEN, SEEK_SET) < 0) { - _zip_error_set(&za->error, ZIP_ER_SEEK, errno); - return -1; - } - - if (fwrite(buf, TORRENT_CRC_LEN, 1, out) != 1) { - _zip_error_set(&za->error, ZIP_ER_WRITE, errno); - return -1; - } - - return 0; -} - - - -static int -_zip_cdir_set_comment(struct zip_cdir *dest, struct zip *src) -{ - if (src->ch_comment_len != -1) { - dest->comment = _zip_memdup(src->ch_comment, - src->ch_comment_len, &src->error); - if (dest->comment == NULL) - return -1; - dest->comment_len = src->ch_comment_len; - } else { - if (src->cdir && src->cdir->comment) { - dest->comment = _zip_memdup(src->cdir->comment, - src->cdir->comment_len, &src->error); - if (dest->comment == NULL) - return -1; - dest->comment_len = src->cdir->comment_len; - } - } - - return 0; -} - - - -static int -_zip_changed(struct zip *za, int *survivorsp) -{ - int changed, i, survivors; - - changed = survivors = 0; - - if (za->ch_comment_len != -1 - || za->ch_flags != za->flags) - changed = 1; - - for (i=0; inentry; i++) { - if ((za->entry[i].state != ZIP_ST_UNCHANGED) - || (za->entry[i].ch_comment_len != -1)) - changed = 1; - if (za->entry[i].state != ZIP_ST_DELETED) - survivors++; - } - - *survivorsp = survivors; - - return changed; -} - - - -static char * -_zip_create_temp_output(struct zip *za, FILE **outp) -{ - char *temp; - int tfd; - FILE *tfp; - - if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - - sprintf(temp, "%s.XXXXXX", za->zn); - - if ((tfd=mkstemp(temp)) == -1) { - _zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno); - free(temp); - return NULL; - } - - if ((tfp=fdopen(tfd, "r+b")) == NULL) { - _zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno); - close(tfd); - remove(temp); - free(temp); - return NULL; - } - - *outp = tfp; - return temp; -} - - - -static int -_zip_torrentzip_cmp(const void *a, const void *b) -{ - return strcasecmp(((const struct filelist *)a)->name, - ((const struct filelist *)b)->name); -} diff --git a/ext/zip/lib/zip_delete.c b/ext/zip/lib/zip_delete.c deleted file mode 100644 index 4591ff7f86a0f..0000000000000 --- a/ext/zip/lib/zip_delete.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - zip_delete.c -- delete file from zip archive - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_delete(struct zip *za, int idx) -{ - if (idx < 0 || idx >= za->nentry) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - /* allow duplicate file names, because the file will - * be removed directly afterwards */ - if (_zip_unchange(za, idx, 1) != 0) - return -1; - - za->entry[idx].state = ZIP_ST_DELETED; - - return 0; -} - - diff --git a/ext/zip/lib/zip_dirent.c b/ext/zip/lib/zip_dirent.c deleted file mode 100644 index 1b2db34dec0c0..0000000000000 --- a/ext/zip/lib/zip_dirent.c +++ /dev/null @@ -1,585 +0,0 @@ -/* - zip_dirent.c -- read directory entry (local or central), clean dirent - Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include -#include -#include -#include -#include - -#include "zipint.h" - -static time_t _zip_d2u_time(int, int); -static char *_zip_readfpstr(FILE *, unsigned int, int, struct zip_error *); -static char *_zip_readstr(unsigned char **, int, int, struct zip_error *); -static void _zip_u2d_time(time_t, unsigned short *, unsigned short *); -static void _zip_write2(unsigned short, FILE *); -static void _zip_write4(unsigned int, FILE *); - - - -void -_zip_cdir_free(struct zip_cdir *cd) -{ - int i; - - if (!cd) - return; - - for (i=0; inentry; i++) - _zip_dirent_finalize(cd->entry+i); - free(cd->comment); - free(cd->entry); - free(cd); -} - - - -struct zip_cdir * -_zip_cdir_new(int nentry, struct zip_error *error) -{ - struct zip_cdir *cd; - - if ((cd=(struct zip_cdir *)malloc(sizeof(*cd))) == NULL) { - _zip_error_set(error, ZIP_ER_MEMORY, 0); - return NULL; - } - - if ((cd->entry=(struct zip_dirent *)malloc(sizeof(*(cd->entry))*nentry)) - == NULL) { - _zip_error_set(error, ZIP_ER_MEMORY, 0); - free(cd); - return NULL; - } - - /* entries must be initialized by caller */ - - cd->nentry = nentry; - cd->size = cd->offset = 0; - cd->comment = NULL; - cd->comment_len = 0; - - return cd; -} - - - -int -_zip_cdir_write(struct zip_cdir *cd, FILE *fp, struct zip_error *error) -{ - int i; - - cd->offset = ftello(fp); - - for (i=0; inentry; i++) { - if (_zip_dirent_write(cd->entry+i, fp, 0, error) != 0) - return -1; - } - - cd->size = ftello(fp) - cd->offset; - - /* clearerr(fp); */ - fwrite(EOCD_MAGIC, 1, 4, fp); - _zip_write4(0, fp); - _zip_write2((unsigned short)cd->nentry, fp); - _zip_write2((unsigned short)cd->nentry, fp); - _zip_write4(cd->size, fp); - _zip_write4(cd->offset, fp); - _zip_write2(cd->comment_len, fp); - fwrite(cd->comment, 1, cd->comment_len, fp); - - if (ferror(fp)) { - _zip_error_set(error, ZIP_ER_WRITE, errno); - return -1; - } - - return 0; -} - - - -void -_zip_dirent_finalize(struct zip_dirent *zde) -{ - free(zde->filename); - zde->filename = NULL; - free(zde->extrafield); - zde->extrafield = NULL; - free(zde->comment); - zde->comment = NULL; -} - - - -void -_zip_dirent_init(struct zip_dirent *de) -{ - de->version_madeby = 0; - de->version_needed = 20; /* 2.0 */ - de->bitflags = 0; - de->comp_method = 0; - de->last_mod = 0; - de->crc = 0; - de->comp_size = 0; - de->uncomp_size = 0; - de->filename = NULL; - de->filename_len = 0; - de->extrafield = NULL; - de->extrafield_len = 0; - de->comment = NULL; - de->comment_len = 0; - de->disk_number = 0; - de->int_attrib = 0; - de->ext_attrib = 0; - de->offset = 0; -} - - - -/* _zip_dirent_read(zde, fp, bufp, left, localp, error): - Fills the zip directory entry zde. - - If bufp is non-NULL, data is taken from there and bufp is advanced - by the amount of data used; no more than left bytes are used. - Otherwise data is read from fp as needed. - - If localp != 0, it reads a local header instead of a central - directory entry. - - Returns 0 if successful. On error, error is filled in and -1 is - returned. -*/ - -int -_zip_dirent_read(struct zip_dirent *zde, FILE *fp, - unsigned char **bufp, unsigned int left, int localp, - struct zip_error *error) -{ - unsigned char buf[CDENTRYSIZE]; - unsigned char *cur; - unsigned short dostime, dosdate; - unsigned int size; - - if (localp) - size = LENTRYSIZE; - else - size = CDENTRYSIZE; - - if (bufp) { - /* use data from buffer */ - cur = *bufp; - if (left < size) { - _zip_error_set(error, ZIP_ER_NOZIP, 0); - return -1; - } - } - else { - /* read entry from disk */ - if ((fread(buf, 1, size, fp)version_madeby = _zip_read2(&cur); - else - zde->version_madeby = 0; - zde->version_needed = _zip_read2(&cur); - zde->bitflags = _zip_read2(&cur); - zde->comp_method = _zip_read2(&cur); - - /* convert to time_t */ - dostime = _zip_read2(&cur); - dosdate = _zip_read2(&cur); - zde->last_mod = _zip_d2u_time(dostime, dosdate); - - zde->crc = _zip_read4(&cur); - zde->comp_size = _zip_read4(&cur); - zde->uncomp_size = _zip_read4(&cur); - - zde->filename_len = _zip_read2(&cur); - zde->extrafield_len = _zip_read2(&cur); - - if (localp) { - zde->comment_len = 0; - zde->disk_number = 0; - zde->int_attrib = 0; - zde->ext_attrib = 0; - zde->offset = 0; - } else { - zde->comment_len = _zip_read2(&cur); - zde->disk_number = _zip_read2(&cur); - zde->int_attrib = _zip_read2(&cur); - zde->ext_attrib = _zip_read4(&cur); - zde->offset = _zip_read4(&cur); - } - - zde->filename = NULL; - zde->extrafield = NULL; - zde->comment = NULL; - - if (bufp) { - if (left < CDENTRYSIZE + (zde->filename_len+zde->extrafield_len - +zde->comment_len)) { - _zip_error_set(error, ZIP_ER_NOZIP, 0); - return -1; - } - - if (zde->filename_len) { - zde->filename = _zip_readstr(&cur, zde->filename_len, 1, error); - if (!zde->filename) - return -1; - } - - if (zde->extrafield_len) { - zde->extrafield = _zip_readstr(&cur, zde->extrafield_len, 0, - error); - if (!zde->extrafield) - return -1; - } - - if (zde->comment_len) { - zde->comment = _zip_readstr(&cur, zde->comment_len, 0, error); - if (!zde->comment) - return -1; - } - } - else { - if (zde->filename_len) { - zde->filename = _zip_readfpstr(fp, zde->filename_len, 1, error); - if (!zde->filename) - return -1; - } - - if (zde->extrafield_len) { - zde->extrafield = _zip_readfpstr(fp, zde->extrafield_len, 0, - error); - if (!zde->extrafield) - return -1; - } - - if (zde->comment_len) { - zde->comment = _zip_readfpstr(fp, zde->comment_len, 0, error); - if (!zde->comment) - return -1; - } - } - - if (bufp) - *bufp = cur; - - return 0; -} - - - -/* _zip_dirent_torrent_normalize(de); - Set values suitable for torrentzip. -*/ - -void -_zip_dirent_torrent_normalize(struct zip_dirent *de) -{ - static struct tm torrenttime; - static time_t last_mod = 0; - - if (last_mod == 0) { -#ifdef HAVE_STRUCT_TM_TM_ZONE - time_t now; - struct tm *l; -#endif - - torrenttime.tm_sec = 0; - torrenttime.tm_min = 32; - torrenttime.tm_hour = 23; - torrenttime.tm_mday = 24; - torrenttime.tm_mon = 11; - torrenttime.tm_year = 96; - torrenttime.tm_wday = 0; - torrenttime.tm_yday = 0; - torrenttime.tm_isdst = 0; - -#ifdef HAVE_STRUCT_TM_TM_ZONE - time(&now); - l = localtime(&now); - torrenttime.tm_gmtoff = l->tm_gmtoff; - torrenttime.tm_zone = l->tm_zone; -#endif - - last_mod = mktime(&torrenttime); - } - - de->version_madeby = 0; - de->version_needed = 20; /* 2.0 */ - de->bitflags = 2; /* maximum compression */ - de->comp_method = ZIP_CM_DEFLATE; - de->last_mod = last_mod; - - de->disk_number = 0; - de->int_attrib = 0; - de->ext_attrib = 0; - de->offset = 0; - - free(de->extrafield); - de->extrafield = NULL; - de->extrafield_len = 0; - free(de->comment); - de->comment = NULL; - de->comment_len = 0; -} - - - -/* _zip_dirent_write(zde, fp, localp, error): - Writes zip directory entry zde to file fp. - - If localp != 0, it writes a local header instead of a central - directory entry. - - Returns 0 if successful. On error, error is filled in and -1 is - returned. -*/ - -int -_zip_dirent_write(struct zip_dirent *zde, FILE *fp, int localp, - struct zip_error *error) -{ - unsigned short dostime, dosdate; - - fwrite(localp ? LOCAL_MAGIC : CENTRAL_MAGIC, 1, 4, fp); - - if (!localp) - _zip_write2(zde->version_madeby, fp); - _zip_write2(zde->version_needed, fp); - _zip_write2(zde->bitflags, fp); - _zip_write2(zde->comp_method, fp); - - _zip_u2d_time(zde->last_mod, &dostime, &dosdate); - _zip_write2(dostime, fp); - _zip_write2(dosdate, fp); - - _zip_write4(zde->crc, fp); - _zip_write4(zde->comp_size, fp); - _zip_write4(zde->uncomp_size, fp); - - _zip_write2(zde->filename_len, fp); - _zip_write2(zde->extrafield_len, fp); - - if (!localp) { - _zip_write2(zde->comment_len, fp); - _zip_write2(zde->disk_number, fp); - _zip_write2(zde->int_attrib, fp); - _zip_write4(zde->ext_attrib, fp); - _zip_write4(zde->offset, fp); - } - - if (zde->filename_len) - fwrite(zde->filename, 1, zde->filename_len, fp); - - if (zde->extrafield_len) - fwrite(zde->extrafield, 1, zde->extrafield_len, fp); - - if (!localp) { - if (zde->comment_len) - fwrite(zde->comment, 1, zde->comment_len, fp); - } - - if (ferror(fp)) { - _zip_error_set(error, ZIP_ER_WRITE, errno); - return -1; - } - - return 0; -} - - - -static time_t -_zip_d2u_time(int dtime, int ddate) -{ - struct tm *tm; - time_t now; - - now = time(NULL); - tm = localtime(&now); - /* let mktime decide if DST is in effect */ - tm->tm_isdst = -1; - - tm->tm_year = ((ddate>>9)&127) + 1980 - 1900; - tm->tm_mon = ((ddate>>5)&15) - 1; - tm->tm_mday = ddate&31; - - tm->tm_hour = (dtime>>11)&31; - tm->tm_min = (dtime>>5)&63; - tm->tm_sec = (dtime<<1)&62; - - return mktime(tm); -} - - - -unsigned short -_zip_read2(unsigned char **a) -{ - unsigned short ret; - - ret = (*a)[0]+((*a)[1]<<8); - *a += 2; - - return ret; -} - - - -unsigned int -_zip_read4(unsigned char **a) -{ - unsigned int ret; - - ret = ((((((*a)[3]<<8)+(*a)[2])<<8)+(*a)[1])<<8)+(*a)[0]; - *a += 4; - - return ret; -} - - - -static char * -_zip_readfpstr(FILE *fp, unsigned int len, int nulp, struct zip_error *error) -{ - char *r, *o; - - r = (char *)malloc(nulp ? len+1 : len); - if (!r) { - _zip_error_set(error, ZIP_ER_MEMORY, 0); - return NULL; - } - - if (fread(r, 1, len, fp)>8)&0xff, fp); - - return; -} - - - -static void -_zip_write4(unsigned int i, FILE *fp) -{ - putc(i&0xff, fp); - putc((i>>8)&0xff, fp); - putc((i>>16)&0xff, fp); - putc((i>>24)&0xff, fp); - - return; -} - - - -static void -_zip_u2d_time(time_t time, unsigned short *dtime, unsigned short *ddate) -{ - struct tm *tm; - - tm = localtime(&time); - *ddate = ((tm->tm_year+1900-1980)<<9) + ((tm->tm_mon+1)<<5) - + tm->tm_mday; - *dtime = ((tm->tm_hour)<<11) + ((tm->tm_min)<<5) - + ((tm->tm_sec)>>1); - - return; -} diff --git a/ext/zip/lib/zip_entry_free.c b/ext/zip/lib/zip_entry_free.c deleted file mode 100644 index c50c9434bdd93..0000000000000 --- a/ext/zip/lib/zip_entry_free.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - zip_entry_free.c -- free struct zip_entry - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -void -_zip_entry_free(struct zip_entry *ze) -{ - free(ze->ch_filename); - ze->ch_filename = NULL; - free(ze->ch_comment); - ze->ch_comment = NULL; - ze->ch_comment_len = -1; - - _zip_unchange_data(ze); -} diff --git a/ext/zip/lib/zip_entry_new.c b/ext/zip/lib/zip_entry_new.c deleted file mode 100644 index 7059b1b060749..0000000000000 --- a/ext/zip/lib/zip_entry_new.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - zip_entry_new.c -- create and init struct zip_entry - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -struct zip_entry * -_zip_entry_new(struct zip *za) -{ - struct zip_entry *ze; - if (!za) { - ze = (struct zip_entry *)malloc(sizeof(struct zip_entry)); - if (!ze) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - } - else { - if (za->nentry >= za->nentry_alloc-1) { - za->nentry_alloc += 16; - za->entry = (struct zip_entry *)realloc(za->entry, - sizeof(struct zip_entry) - * za->nentry_alloc); - if (!za->entry) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - } - ze = za->entry+za->nentry; - } - - ze->state = ZIP_ST_UNCHANGED; - - ze->ch_filename = NULL; - ze->ch_comment = NULL; - ze->ch_comment_len = -1; - ze->source = NULL; - - if (za) - za->nentry++; - - return ze; -} diff --git a/ext/zip/lib/zip_err_str.c b/ext/zip/lib/zip_err_str.c deleted file mode 100644 index 3fcdf1738a863..0000000000000 --- a/ext/zip/lib/zip_err_str.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - This file was generated automatically by ./make_zip_err_str.sh - from ./zip.h; make changes there. - */ - -#include "zipint.h" - - - -const char * const _zip_err_str[] = { - "No error", - "Multi-disk zip archives not supported", - "Renaming temporary file failed", - "Closing zip archive failed", - "Seek error", - "Read error", - "Write error", - "CRC error", - "Containing zip archive was closed", - "No such file", - "File already exists", - "Can't open file", - "Failure to create temporary file", - "Zlib error", - "Malloc failure", - "Entry has been changed", - "Compression method not supported", - "Premature EOF", - "Invalid argument", - "Not a zip archive", - "Internal error", - "Zip archive inconsistent", - "Can't remove file", - "Entry has been deleted", -}; - -const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]); - -#define N ZIP_ET_NONE -#define S ZIP_ET_SYS -#define Z ZIP_ET_ZLIB - -const int _zip_err_type[] = { - N, - N, - S, - S, - S, - S, - S, - N, - N, - N, - N, - S, - S, - Z, - N, - N, - N, - N, - N, - N, - N, - N, - S, - N, -}; diff --git a/ext/zip/lib/zip_error.c b/ext/zip/lib/zip_error.c deleted file mode 100644 index aab70794566c0..0000000000000 --- a/ext/zip/lib/zip_error.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - zip_error.c -- struct zip_error helper functions - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -void -_zip_error_clear(struct zip_error *err) -{ - err->zip_err = ZIP_ER_OK; - err->sys_err = 0; -} - - - -void -_zip_error_copy(struct zip_error *dst, struct zip_error *src) -{ - dst->zip_err = src->zip_err; - dst->sys_err = src->sys_err; -} - - - -void -_zip_error_fini(struct zip_error *err) -{ - free(err->str); - err->str = NULL; -} - - - -void -_zip_error_get(struct zip_error *err, int *zep, int *sep) -{ - if (zep) - *zep = err->zip_err; - if (sep) { - if (zip_error_get_sys_type(err->zip_err) != ZIP_ET_NONE) - *sep = err->sys_err; - else - *sep = 0; - } -} - - - -void -_zip_error_init(struct zip_error *err) -{ - err->zip_err = ZIP_ER_OK; - err->sys_err = 0; - err->str = NULL; -} - - - -void -_zip_error_set(struct zip_error *err, int ze, int se) -{ - if (err) { - err->zip_err = ze; - err->sys_err = se; - } -} diff --git a/ext/zip/lib/zip_error_clear.c b/ext/zip/lib/zip_error_clear.c deleted file mode 100644 index 34e7dea48ebba..0000000000000 --- a/ext/zip/lib/zip_error_clear.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - zip_error_clear.c -- clear zip error - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(void) -zip_error_clear(struct zip *za) -{ - _zip_error_clear(&za->error); -} diff --git a/ext/zip/lib/zip_error_get.c b/ext/zip/lib/zip_error_get.c deleted file mode 100644 index c15705e32fccd..0000000000000 --- a/ext/zip/lib/zip_error_get.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - zip_error_get.c -- get zip error - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(void) -zip_error_get(struct zip *za, int *zep, int *sep) -{ - _zip_error_get(&za->error, zep, sep); -} diff --git a/ext/zip/lib/zip_error_get_sys_type.c b/ext/zip/lib/zip_error_get_sys_type.c deleted file mode 100644 index 47aa93e69b927..0000000000000 --- a/ext/zip/lib/zip_error_get_sys_type.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - zip_error_get_sys_type.c -- return type of system error code - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_error_get_sys_type(int ze) -{ - if (ze < 0 || ze >= _zip_nerr_str) - return 0; - - return _zip_err_type[ze]; -} diff --git a/ext/zip/lib/zip_error_strerror.c b/ext/zip/lib/zip_error_strerror.c deleted file mode 100644 index 3d0951cfb1f6b..0000000000000 --- a/ext/zip/lib/zip_error_strerror.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - zip_error_sterror.c -- get string representation of struct zip_error - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include -#include -#include - -#include "zipint.h" - - - -const char * -_zip_error_strerror(struct zip_error *err) -{ - const char *zs, *ss; - char buf[128], *s; - - _zip_error_fini(err); - - if (err->zip_err < 0 || err->zip_err >= _zip_nerr_str) { - sprintf(buf, "Unknown error %d", err->zip_err); - zs = NULL; - ss = buf; - } - else { - zs = _zip_err_str[err->zip_err]; - - switch (_zip_err_type[err->zip_err]) { - case ZIP_ET_SYS: - ss = strerror(err->sys_err); - break; - - case ZIP_ET_ZLIB: - ss = zError(err->sys_err); - break; - - default: - ss = NULL; - } - } - - if (ss == NULL) - return zs; - else { - if ((s=(char *)malloc(strlen(ss) - + (zs ? strlen(zs)+2 : 0) + 1)) == NULL) - return _zip_err_str[ZIP_ER_MEMORY]; - - sprintf(s, "%s%s%s", - (zs ? zs : ""), - (zs ? ": " : ""), - ss); - err->str = s; - - return s; - } -} diff --git a/ext/zip/lib/zip_error_to_str.c b/ext/zip/lib/zip_error_to_str.c deleted file mode 100644 index 4dea4d667a5ee..0000000000000 --- a/ext/zip/lib/zip_error_to_str.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - zip_error_to_str.c -- get string representation of zip error code - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include -#include -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_error_to_str(char *buf, size_t len, int ze, int se) -{ - const char *zs, *ss; - - if (ze < 0 || ze >= _zip_nerr_str) - return snprintf(buf, len, "Unknown error %d", ze); - - zs = _zip_err_str[ze]; - - switch (_zip_err_type[ze]) { - case ZIP_ET_SYS: - ss = strerror(se); - break; - - case ZIP_ET_ZLIB: - ss = zError(se); - break; - - default: - ss = NULL; - } - - return snprintf(buf, len, "%s%s%s", - zs, (ss ? ": " : ""), (ss ? ss : "")); -} diff --git a/ext/zip/lib/zip_fclose.c b/ext/zip/lib/zip_fclose.c deleted file mode 100644 index 8f062d9d090f7..0000000000000 --- a/ext/zip/lib/zip_fclose.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - zip_fclose.c -- close file in zip archive - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_fclose(struct zip_file *zf) -{ - int i, ret; - - if (zf->zstr) - inflateEnd(zf->zstr); - free(zf->buffer); - free(zf->zstr); - if (zf->za) { - for (i=0; iza->nfile; i++) { - if (zf->za->file[i] == zf) { - zf->za->file[i] = zf->za->file[zf->za->nfile-1]; - zf->za->nfile--; - break; - } - } - } - - ret = 0; - if (zf->error.zip_err) - ret = zf->error.zip_err; - else if ((zf->flags & ZIP_ZF_CRC) && (zf->flags & ZIP_ZF_EOF)) { - /* if EOF, compare CRC */ - if (zf->crc_orig != zf->crc) - ret = ZIP_ER_CRC; - } - - free(zf); - return ret; -} diff --git a/ext/zip/lib/zip_file_error_clear.c b/ext/zip/lib/zip_file_error_clear.c deleted file mode 100644 index 6c9c2a02b3f0f..0000000000000 --- a/ext/zip/lib/zip_file_error_clear.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - zip_file_error_clear.c -- clear zip file error - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(void) -zip_file_error_clear(struct zip_file *zf) -{ - _zip_error_clear(&zf->error); -} diff --git a/ext/zip/lib/zip_file_error_get.c b/ext/zip/lib/zip_file_error_get.c deleted file mode 100644 index a53fa7e003324..0000000000000 --- a/ext/zip/lib/zip_file_error_get.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - zip_file_error_get.c -- get zip file error - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(void) -zip_file_error_get(struct zip_file *zf, int *zep, int *sep) -{ - _zip_error_get(&zf->error, zep, sep); -} diff --git a/ext/zip/lib/zip_file_get_offset.c b/ext/zip/lib/zip_file_get_offset.c deleted file mode 100644 index 68f92f1fe61b7..0000000000000 --- a/ext/zip/lib/zip_file_get_offset.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - zip_file_get_offset.c -- get offset of file data in archive. - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include -#include -#include -#include -#include - -#include "zipint.h" - - - -/* _zip_file_get_offset(za, ze): - Returns the offset of the file data for entry ze. - - On error, fills in za->error and returns 0. -*/ - -unsigned int -_zip_file_get_offset(struct zip *za, int idx) -{ - struct zip_dirent de; - unsigned int offset; - - offset = za->cdir->entry[idx].offset; - - if (fseeko(za->zp, offset, SEEK_SET) != 0) { - _zip_error_set(&za->error, ZIP_ER_SEEK, errno); - return 0; - } - - if (_zip_dirent_read(&de, za->zp, NULL, 0, 1, &za->error) != 0) - return 0; - - offset += LENTRYSIZE + de.filename_len + de.extrafield_len; - - _zip_dirent_finalize(&de); - - return offset; -} diff --git a/ext/zip/lib/zip_file_strerror.c b/ext/zip/lib/zip_file_strerror.c deleted file mode 100644 index c2864f2ba1aaf..0000000000000 --- a/ext/zip/lib/zip_file_strerror.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - zip_file_sterror.c -- get string representation of zip file error - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(const char *) -zip_file_strerror(struct zip_file *zf) -{ - return _zip_error_strerror(&zf->error); -} diff --git a/ext/zip/lib/zip_filerange_crc.c b/ext/zip/lib/zip_filerange_crc.c deleted file mode 100644 index 4d1ad566929f8..0000000000000 --- a/ext/zip/lib/zip_filerange_crc.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - zip_filerange_crc.c -- compute CRC32 for a range of a file - Copyright (C) 2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include - -#include "zipint.h" - - - - -int -_zip_filerange_crc(FILE *fp, off_t start, off_t len, uLong *crcp, - struct zip_error *errp) -{ - Bytef buf[BUFSIZE]; - size_t n; - - *crcp = crc32(0L, Z_NULL, 0); - - if (fseeko(fp, start, SEEK_SET) != 0) { - _zip_error_set(errp, ZIP_ER_SEEK, errno); - return -1; - } - - while (len > 0) { - n = len > BUFSIZE ? BUFSIZE : len; - if ((n=fread(buf, 1, n, fp)) <= 0) { - _zip_error_set(errp, ZIP_ER_READ, errno); - return -1; - } - - *crcp = crc32(*crcp, buf, n); - - len-= n; - } - - return 0; -} diff --git a/ext/zip/lib/zip_fopen.c b/ext/zip/lib/zip_fopen.c deleted file mode 100644 index b4b76049f4430..0000000000000 --- a/ext/zip/lib/zip_fopen.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - zip_fopen.c -- open file in zip archive for reading - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(struct zip_file *) -zip_fopen(struct zip *za, const char *fname, int flags) -{ - int idx; - - if ((idx=zip_name_locate(za, fname, flags)) < 0) - return NULL; - - return zip_fopen_index(za, idx, flags); -} diff --git a/ext/zip/lib/zip_fopen_index.c b/ext/zip/lib/zip_fopen_index.c deleted file mode 100644 index 1e7e4198970aa..0000000000000 --- a/ext/zip/lib/zip_fopen_index.c +++ /dev/null @@ -1,216 +0,0 @@ -/* - zip_fopen_index.c -- open file in zip archive for reading by index - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include -#include - -#include "zipint.h" - -static struct zip_file *_zip_file_new(struct zip *za); - - - -ZIP_EXTERN(struct zip_file *) -zip_fopen_index(struct zip *za, int fileno, int flags) -{ - int len, ret; - int zfflags; - struct zip_file *zf; - - if ((fileno < 0) || (fileno >= za->nentry)) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - if ((flags & ZIP_FL_UNCHANGED) == 0 - && ZIP_ENTRY_DATA_CHANGED(za->entry+fileno)) { - _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); - return NULL; - } - - if (fileno >= za->cdir->nentry) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - zfflags = 0; - switch (za->cdir->entry[fileno].comp_method) { - case ZIP_CM_STORE: - zfflags |= ZIP_ZF_CRC; - break; - - case ZIP_CM_DEFLATE: - if ((flags & ZIP_FL_COMPRESSED) == 0) - zfflags |= ZIP_ZF_CRC | ZIP_ZF_DECOMP; - break; - default: - if ((flags & ZIP_FL_COMPRESSED) == 0) { - _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); - return NULL; - } - break; - } - - zf = _zip_file_new(za); - - zf->flags = zfflags; - /* zf->name = za->cdir->entry[fileno].filename; */ - zf->method = za->cdir->entry[fileno].comp_method; - zf->bytes_left = za->cdir->entry[fileno].uncomp_size; - zf->cbytes_left = za->cdir->entry[fileno].comp_size; - zf->crc_orig = za->cdir->entry[fileno].crc; - - if ((zf->fpos=_zip_file_get_offset(za, fileno)) == 0) { - zip_fclose(zf); - return NULL; - } - - if ((zf->flags & ZIP_ZF_DECOMP) == 0) - zf->bytes_left = zf->cbytes_left; - else { - if ((zf->buffer=(char *)malloc(BUFSIZE)) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - zip_fclose(zf); - return NULL; - } - - len = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf); - if (len <= 0) { - _zip_error_copy(&za->error, &zf->error); - zip_fclose(zf); - return NULL; - } - - if ((zf->zstr = (z_stream *)malloc(sizeof(z_stream))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - zip_fclose(zf); - return NULL; - } - zf->zstr->zalloc = Z_NULL; - zf->zstr->zfree = Z_NULL; - zf->zstr->opaque = NULL; - zf->zstr->next_in = (Bytef *)zf->buffer; - zf->zstr->avail_in = len; - - /* negative value to tell zlib that there is no header */ - if ((ret=inflateInit2(zf->zstr, -MAX_WBITS)) != Z_OK) { - _zip_error_set(&za->error, ZIP_ER_ZLIB, ret); - zip_fclose(zf); - return NULL; - } - } - - return zf; -} - - - -int -_zip_file_fillbuf(void *buf, size_t buflen, struct zip_file *zf) -{ - int i, j; - - if (zf->error.zip_err != ZIP_ER_OK) - return -1; - - if ((zf->flags & ZIP_ZF_EOF) || zf->cbytes_left <= 0 || buflen <= 0) - return 0; - - if (fseeko(zf->za->zp, zf->fpos, SEEK_SET) < 0) { - _zip_error_set(&zf->error, ZIP_ER_SEEK, errno); - return -1; - } - if (buflen < zf->cbytes_left) - i = buflen; - else - i = zf->cbytes_left; - - j = fread(buf, 1, i, zf->za->zp); - if (j == 0) { - _zip_error_set(&zf->error, ZIP_ER_EOF, 0); - j = -1; - } - else if (j < 0) - _zip_error_set(&zf->error, ZIP_ER_READ, errno); - else { - zf->fpos += j; - zf->cbytes_left -= j; - } - - return j; -} - - - -static struct zip_file * -_zip_file_new(struct zip *za) -{ - struct zip_file *zf, **file; - int n; - - if ((zf=(struct zip_file *)malloc(sizeof(struct zip_file))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - - if (za->nfile >= za->nfile_alloc-1) { - n = za->nfile_alloc + 10; - file = (struct zip_file **)realloc(za->file, - n*sizeof(struct zip_file *)); - if (file == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - free(zf); - return NULL; - } - za->nfile_alloc = n; - za->file = file; - } - - za->file[za->nfile++] = zf; - - zf->za = za; - _zip_error_init(&zf->error); - zf->flags = 0; - zf->crc = crc32(0L, Z_NULL, 0); - zf->crc_orig = 0; - zf->method = -1; - zf->bytes_left = zf->cbytes_left = 0; - zf->fpos = 0; - zf->buffer = NULL; - zf->zstr = NULL; - - return zf; -} diff --git a/ext/zip/lib/zip_fread.c b/ext/zip/lib/zip_fread.c deleted file mode 100644 index 1a2b0e3816e4d..0000000000000 --- a/ext/zip/lib/zip_fread.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - zip_fread.c -- read from file - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(ssize_t) -zip_fread(struct zip_file *zf, void *outbuf, size_t toread) -{ - int ret; - size_t out_before, len; - int i; - - if (!zf) - return -1; - - if (zf->error.zip_err != 0) - return -1; - - if ((zf->flags & ZIP_ZF_EOF) || (toread == 0)) - return 0; - - if (zf->bytes_left == 0) { - zf->flags |= ZIP_ZF_EOF; - if (zf->flags & ZIP_ZF_CRC) { - if (zf->crc != zf->crc_orig) { - _zip_error_set(&zf->error, ZIP_ER_CRC, 0); - return -1; - } - } - return 0; - } - - if ((zf->flags & ZIP_ZF_DECOMP) == 0) { - ret = _zip_file_fillbuf(outbuf, toread, zf); - if (ret > 0) { - if (zf->flags & ZIP_ZF_CRC) - zf->crc = crc32(zf->crc, (Bytef *)outbuf, ret); - zf->bytes_left -= ret; - } - return ret; - } - - zf->zstr->next_out = (Bytef *)outbuf; - zf->zstr->avail_out = toread; - out_before = zf->zstr->total_out; - - /* endless loop until something has been accomplished */ - for (;;) { - ret = inflate(zf->zstr, Z_SYNC_FLUSH); - - switch (ret) { - case Z_OK: - case Z_STREAM_END: - /* all ok */ - /* Z_STREAM_END probably won't happen, since we didn't - have a header */ - len = zf->zstr->total_out - out_before; - if (len >= zf->bytes_left || len >= toread) { - if (zf->flags & ZIP_ZF_CRC) - zf->crc = crc32(zf->crc, (Bytef *)outbuf, len); - zf->bytes_left -= len; - return len; - } - break; - - case Z_BUF_ERROR: - if (zf->zstr->avail_in == 0) { - i = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf); - if (i == 0) { - _zip_error_set(&zf->error, ZIP_ER_INCONS, 0); - return -1; - } - else if (i < 0) - return -1; - zf->zstr->next_in = (Bytef *)zf->buffer; - zf->zstr->avail_in = i; - continue; - } - /* fallthrough */ - case Z_NEED_DICT: - case Z_DATA_ERROR: - case Z_STREAM_ERROR: - case Z_MEM_ERROR: - _zip_error_set(&zf->error, ZIP_ER_ZLIB, ret); - return -1; - } - } -} diff --git a/ext/zip/lib/zip_free.c b/ext/zip/lib/zip_free.c deleted file mode 100644 index 76c3a9673ff53..0000000000000 --- a/ext/zip/lib/zip_free.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - zip_free.c -- free struct zip - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -/* _zip_free: - frees the space allocated to a zipfile struct, and closes the - corresponding file. */ - -void -_zip_free(struct zip *za) -{ - int i; - - if (za == NULL) - return; - - if (za->zn) - free(za->zn); - - if (za->zp) - fclose(za->zp); - - _zip_cdir_free(za->cdir); - - if (za->entry) { - for (i=0; inentry; i++) { - _zip_entry_free(za->entry+i); - } - free(za->entry); - } - - for (i=0; infile; i++) { - if (za->file[i]->error.zip_err == ZIP_ER_OK) { - _zip_error_set(&za->file[i]->error, ZIP_ER_ZIPCLOSED, 0); - za->file[i]->za = NULL; - } - } - - free(za->file); - - free(za); - - return; -} diff --git a/ext/zip/lib/zip_get_archive_comment.c b/ext/zip/lib/zip_get_archive_comment.c deleted file mode 100644 index ed1324fd5b9c0..0000000000000 --- a/ext/zip/lib/zip_get_archive_comment.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - zip_get_archive_comment.c -- get archive comment - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(const char *) -zip_get_archive_comment(struct zip *za, int *lenp, int flags) -{ - if ((flags & ZIP_FL_UNCHANGED) - || (za->ch_comment_len == -1)) { - if (za->cdir) { - if (lenp != NULL) - *lenp = za->cdir->comment_len; - return za->cdir->comment; - } - else { - if (lenp != NULL) - *lenp = -1; - return NULL; - } - } - - if (lenp != NULL) - *lenp = za->ch_comment_len; - return za->ch_comment; -} diff --git a/ext/zip/lib/zip_get_archive_flag.c b/ext/zip/lib/zip_get_archive_flag.c deleted file mode 100644 index 2d46aa39ffbb4..0000000000000 --- a/ext/zip/lib/zip_get_archive_flag.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - zip_get_archive_flag.c -- get archive global flag - Copyright (C) 2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_get_archive_flag(struct zip *za, int flag, int flags) -{ - int fl; - - fl = (flags & ZIP_FL_UNCHANGED) ? za->flags : za->ch_flags; - - return (fl & flag) ? 1 : 0; -} diff --git a/ext/zip/lib/zip_get_file_comment.c b/ext/zip/lib/zip_get_file_comment.c deleted file mode 100644 index 57dd9028bc138..0000000000000 --- a/ext/zip/lib/zip_get_file_comment.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - zip_get_file_comment.c -- get file comment - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(const char *) -zip_get_file_comment(struct zip *za, int idx, int *lenp, int flags) -{ - if (idx < 0 || idx >= za->nentry) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - if ((flags & ZIP_FL_UNCHANGED) - || (za->entry[idx].ch_comment_len == -1)) { - if (lenp != NULL) - *lenp = za->cdir->entry[idx].comment_len; - return za->cdir->entry[idx].comment; - } - - if (lenp != NULL) - *lenp = za->entry[idx].ch_comment_len; - return za->entry[idx].ch_comment; -} diff --git a/ext/zip/lib/zip_get_name.c b/ext/zip/lib/zip_get_name.c deleted file mode 100644 index b58d972058897..0000000000000 --- a/ext/zip/lib/zip_get_name.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - zip_get_name.c -- get filename for a file in zip file - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(const char *) -zip_get_name(struct zip *za, int idx, int flags) -{ - return _zip_get_name(za, idx, flags, &za->error); -} - - - -const char * -_zip_get_name(struct zip *za, int idx, int flags, struct zip_error *error) -{ - if (idx < 0 || idx >= za->nentry) { - _zip_error_set(error, ZIP_ER_INVAL, 0); - return NULL; - } - - if ((flags & ZIP_FL_UNCHANGED) == 0) { - if (za->entry[idx].state == ZIP_ST_DELETED) { - _zip_error_set(error, ZIP_ER_DELETED, 0); - return NULL; - } - if (za->entry[idx].ch_filename) - return za->entry[idx].ch_filename; - } - - if (za->cdir == NULL || idx >= za->cdir->nentry) { - _zip_error_set(error, ZIP_ER_INVAL, 0); - return NULL; - } - - return za->cdir->entry[idx].filename; -} diff --git a/ext/zip/lib/zip_get_num_files.c b/ext/zip/lib/zip_get_num_files.c deleted file mode 100644 index a442f293ec350..0000000000000 --- a/ext/zip/lib/zip_get_num_files.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - zip_get_num_files.c -- get number of files in archive - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_get_num_files(struct zip *za) -{ - if (za == NULL) - return -1; - - return za->nentry; -} diff --git a/ext/zip/lib/zip_memdup.c b/ext/zip/lib/zip_memdup.c deleted file mode 100644 index 641125ed2d1b2..0000000000000 --- a/ext/zip/lib/zip_memdup.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - zip_memdup.c -- internal zip function, "strdup" with len - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include - -#include "zipint.h" - - - -void * -_zip_memdup(const void *mem, size_t len, struct zip_error *error) -{ - void *ret; - - ret = malloc(len); - if (!ret) { - _zip_error_set(error, ZIP_ER_MEMORY, 0); - return NULL; - } - - memcpy(ret, mem, len); - - return ret; -} diff --git a/ext/zip/lib/zip_name_locate.c b/ext/zip/lib/zip_name_locate.c deleted file mode 100644 index e8b35ff936ecd..0000000000000 --- a/ext/zip/lib/zip_name_locate.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - zip_name_locate.c -- get index by name - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_name_locate(struct zip *za, const char *fname, int flags) -{ - return _zip_name_locate(za, fname, flags, &za->error); -} - - - -int -_zip_name_locate(struct zip *za, const char *fname, int flags, - struct zip_error *error) -{ - int (*cmp)(const char *, const char *); - const char *fn, *p; - int i, n; - - if (fname == NULL) { - _zip_error_set(error, ZIP_ER_INVAL, 0); - return -1; - } - - cmp = (flags & ZIP_FL_NOCASE) ? strcmpi : strcmp; - - n = (flags & ZIP_FL_UNCHANGED) ? za->cdir->nentry : za->nentry; - for (i=0; icdir->entry[i].filename; - else - fn = _zip_get_name(za, i, flags, error); - - /* newly added (partially filled) entry */ - if (fn == NULL) - continue; - - if (flags & ZIP_FL_NODIR) { - p = strrchr(fn, '/'); - if (p) - fn = p+1; - } - - if (cmp(fname, fn) == 0) - return i; - } - -/* Look for an entry should not raise an error */ -/* _zip_error_set(error, ZIP_ER_NOENT, 0);*/ - return -1; -} diff --git a/ext/zip/lib/zip_new.c b/ext/zip/lib/zip_new.c deleted file mode 100644 index 3e8ccee644bc2..0000000000000 --- a/ext/zip/lib/zip_new.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - zip_new.c -- create and init struct zip - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -/* _zip_new: - creates a new zipfile struct, and sets the contents to zero; returns - the new struct. */ - -struct zip * -_zip_new(struct zip_error *error) -{ - struct zip *za; - - za = (struct zip *)malloc(sizeof(struct zip)); - if (!za) { - _zip_error_set(error, ZIP_ER_MEMORY, 0); - return NULL; - } - - za->zn = NULL; - za->zp = NULL; - _zip_error_init(&za->error); - za->cdir = NULL; - za->ch_comment = NULL; - za->ch_comment_len = -1; - za->nentry = za->nentry_alloc = 0; - za->entry = NULL; - za->nfile = za->nfile_alloc = 0; - za->file = NULL; - za->flags = za->ch_flags = 0; - - return za; -} diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c deleted file mode 100644 index cb3e66d2ca27f..0000000000000 --- a/ext/zip/lib/zip_open.c +++ /dev/null @@ -1,558 +0,0 @@ -/* - zip_open.c -- open zip archive - Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include -#include -#include -#include -#include - -#include "zipint.h" - -static void set_error(int *, struct zip_error *, int); -static struct zip *_zip_allocate_new(const char *, int *); -static int _zip_checkcons(FILE *, struct zip_cdir *, struct zip_error *); -static void _zip_check_torrentzip(struct zip *); -static struct zip_cdir *_zip_find_central_dir(FILE *, int, int *, off_t); -static int _zip_file_exists(const char *, int, int *); -static int _zip_headercomp(struct zip_dirent *, int, - struct zip_dirent *, int); -static unsigned char *_zip_memmem(const unsigned char *, int, - const unsigned char *, int); -static struct zip_cdir *_zip_readcdir(FILE *, unsigned char *, unsigned char *, - int, int, struct zip_error *); - - - -ZIP_EXTERN(struct zip *) -zip_open(const char *fn, int flags, int *zep) -{ - FILE *fp; - struct zip *za; - struct zip_cdir *cdir; - int i; - off_t len; - - switch (_zip_file_exists(fn, flags, zep)) { - case -1: - return NULL; - case 0: - return _zip_allocate_new(fn, zep); - default: - break; - } - - if ((fp=fopen(fn, "rb")) == NULL) { - set_error(zep, NULL, ZIP_ER_OPEN); - return NULL; - } - - fseeko(fp, 0, SEEK_END); - len = ftello(fp); - - /* treat empty files as empty archives */ - if (len == 0) { - if ((za=_zip_allocate_new(fn, zep)) == NULL) - fclose(fp); - else - za->zp = fp; - return za; - } - - cdir = _zip_find_central_dir(fp, flags, zep, len); - if (cdir == NULL) { - fclose(fp); - return NULL; - } - - if ((za=_zip_allocate_new(fn, zep)) == NULL) { - _zip_cdir_free(cdir); - fclose(fp); - return NULL; - } - - za->cdir = cdir; - za->zp = fp; - - if ((za->entry=(struct zip_entry *)malloc(sizeof(*(za->entry)) - * cdir->nentry)) == NULL) { - set_error(zep, NULL, ZIP_ER_MEMORY); - _zip_free(za); - return NULL; - } - for (i=0; inentry; i++) - _zip_entry_new(za); - - _zip_check_torrentzip(za); - za->ch_flags = za->flags; - - return za; -} - - - -static void -set_error(int *zep, struct zip_error *err, int ze) -{ - int se; - - if (err) { - _zip_error_get(err, &ze, &se); - if (zip_error_get_sys_type(ze) == ZIP_ET_SYS) - errno = se; - } - - if (zep) - *zep = ze; -} - - - -/* _zip_readcdir: - tries to find a valid end-of-central-directory at the beginning of - buf, and then the corresponding central directory entries. - Returns a struct zip_cdir which contains the central directory - entries, or NULL if unsuccessful. */ - -static struct zip_cdir * -_zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen, - int flags, struct zip_error *error) -{ - struct zip_cdir *cd; - unsigned char *cdp, **bufp; - int i, comlen, nentry; - - comlen = buf + buflen - eocd - EOCDLEN; - if (comlen < 0) { - /* not enough bytes left for comment */ - _zip_error_set(error, ZIP_ER_NOZIP, 0); - return NULL; - } - - /* check for end-of-central-dir magic */ - if (memcmp(eocd, EOCD_MAGIC, 4) != 0) { - _zip_error_set(error, ZIP_ER_NOZIP, 0); - return NULL; - } - - if (memcmp(eocd+4, "\0\0\0\0", 4) != 0) { - _zip_error_set(error, ZIP_ER_MULTIDISK, 0); - return NULL; - } - - cdp = eocd + 8; - /* number of cdir-entries on this disk */ - i = _zip_read2(&cdp); - /* number of cdir-entries */ - nentry = _zip_read2(&cdp); - - if ((cd=_zip_cdir_new(nentry, error)) == NULL) - return NULL; - - cd->size = _zip_read4(&cdp); - cd->offset = _zip_read4(&cdp); - cd->comment = NULL; - cd->comment_len = _zip_read2(&cdp); - - if ((comlen < cd->comment_len) || (cd->nentry != i)) { - _zip_error_set(error, ZIP_ER_NOZIP, 0); - free(cd); - return NULL; - } - if ((flags & ZIP_CHECKCONS) && comlen != cd->comment_len) { - _zip_error_set(error, ZIP_ER_INCONS, 0); - free(cd); - return NULL; - } - - if (cd->comment_len) { - if ((cd->comment=(char *)_zip_memdup(eocd+EOCDLEN, - cd->comment_len, error)) - == NULL) { - free(cd); - return NULL; - } - } - - cdp = eocd; - if (cd->size < (unsigned int)(eocd-buf)) { - /* if buffer already read in, use it */ - cdp = eocd - cd->size; - bufp = &cdp; - } - else { - /* go to start of cdir and read it entry by entry */ - bufp = NULL; - clearerr(fp); - fseeko(fp, cd->offset, SEEK_SET); - /* possible consistency check: cd->offset = - len-(cd->size+cd->comment_len+EOCDLEN) ? */ - if (ferror(fp) || ((unsigned long)ftello(fp) != cd->offset)) { - /* seek error or offset of cdir wrong */ - if (ferror(fp)) - _zip_error_set(error, ZIP_ER_SEEK, errno); - else - _zip_error_set(error, ZIP_ER_NOZIP, 0); - free(cd); - return NULL; - } - } - - for (i=0; inentry; i++) { - if ((_zip_dirent_read(cd->entry+i, fp, bufp, eocd-cdp, 0, - error)) < 0) { - cd->nentry = i; - _zip_cdir_free(cd); - return NULL; - } - } - - return cd; -} - - - -/* _zip_checkcons: - Checks the consistency of the central directory by comparing central - directory entries with local headers and checking for plausible - file and header offsets. Returns -1 if not plausible, else the - difference between the lowest and the highest fileposition reached */ - -static int -_zip_checkcons(FILE *fp, struct zip_cdir *cd, struct zip_error *error) -{ - int i; - unsigned int min, max, j; - struct zip_dirent temp; - - if (cd->nentry) { - max = cd->entry[0].offset; - min = cd->entry[0].offset; - } - else - min = max = 0; - - for (i=0; inentry; i++) { - if (cd->entry[i].offset < min) - min = cd->entry[i].offset; - if (min > cd->offset) { - _zip_error_set(error, ZIP_ER_NOZIP, 0); - return -1; - } - - j = cd->entry[i].offset + cd->entry[i].comp_size - + cd->entry[i].filename_len + LENTRYSIZE; - if (j > max) - max = j; - if (max > cd->offset) { - _zip_error_set(error, ZIP_ER_NOZIP, 0); - return -1; - } - - if (fseeko(fp, cd->entry[i].offset, SEEK_SET) != 0) { - _zip_error_set(error, ZIP_ER_SEEK, 0); - return -1; - } - - if (_zip_dirent_read(&temp, fp, NULL, 0, 1, error) == -1) - return -1; - - if (_zip_headercomp(cd->entry+i, 0, &temp, 1) != 0) { - _zip_error_set(error, ZIP_ER_INCONS, 0); - _zip_dirent_finalize(&temp); - return -1; - } - _zip_dirent_finalize(&temp); - } - - return max - min; -} - - - -/* _zip_check_torrentzip: - check wether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */ - -static void -_zip_check_torrentzip(struct zip *za) -{ - uLong crc_got, crc_should; - char buf[8+1]; - char *end; - - if (za->zp == NULL || za->cdir == NULL) - return; - - if (za->cdir->comment_len != TORRENT_SIG_LEN+8 - || strncmp(za->cdir->comment, TORRENT_SIG, TORRENT_SIG_LEN) != 0) - return; - - memcpy(buf, za->cdir->comment+TORRENT_SIG_LEN, 8); - buf[8] = '\0'; - errno = 0; - crc_should = strtoul(buf, &end, 16); - if ((crc_should == UINT_MAX && errno != 0) || (end && *end)) - return; - - if (_zip_filerange_crc(za->zp, za->cdir->offset, za->cdir->size, - &crc_got, NULL) < 0) - return; - - if (crc_got == crc_should) - za->flags |= ZIP_AFL_TORRENT; -} - - - - -/* _zip_headercomp: - compares two headers h1 and h2; if they are local headers, set - local1p or local2p respectively to 1, else 0. Return 0 if they - are identical, -1 if not. */ - -static int -_zip_headercomp(struct zip_dirent *h1, int local1p, struct zip_dirent *h2, - int local2p) -{ - if ((h1->version_needed != h2->version_needed) -#if 0 - /* some zip-files have different values in local - and global headers for the bitflags */ - || (h1->bitflags != h2->bitflags) -#endif - || (h1->comp_method != h2->comp_method) - || (h1->last_mod != h2->last_mod) - || (h1->filename_len != h2->filename_len) - || !h1->filename || !h2->filename - || strcmp(h1->filename, h2->filename)) - return -1; - - /* check that CRC and sizes are zero if data descriptor is used */ - if ((h1->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) && local1p - && (h1->crc != 0 - || h1->comp_size != 0 - || h1->uncomp_size != 0)) - return -1; - if ((h2->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) && local2p - && (h2->crc != 0 - || h2->comp_size != 0 - || h2->uncomp_size != 0)) - return -1; - - /* check that CRC and sizes are equal if no data descriptor is used */ - if (((h1->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) == 0 || local1p == 0) - && ((h2->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) == 0 || local2p == 0)) { - if ((h1->crc != h2->crc) - || (h1->comp_size != h2->comp_size) - || (h1->uncomp_size != h2->uncomp_size)) - return -1; - } - - if ((local1p == local2p) - && ((h1->extrafield_len != h2->extrafield_len) - || (h1->extrafield_len && h2->extrafield - && memcmp(h1->extrafield, h2->extrafield, - h1->extrafield_len)))) - return -1; - - /* if either is local, nothing more to check */ - if (local1p || local2p) - return 0; - - if ((h1->version_madeby != h2->version_madeby) - || (h1->disk_number != h2->disk_number) - || (h1->int_attrib != h2->int_attrib) - || (h1->ext_attrib != h2->ext_attrib) - || (h1->offset != h2->offset) - || (h1->comment_len != h2->comment_len) - || (h1->comment_len && h2->comment - && memcmp(h1->comment, h2->comment, h1->comment_len))) - return -1; - - return 0; -} - - - -static struct zip * -_zip_allocate_new(const char *fn, int *zep) -{ - struct zip *za; - struct zip_error error; - - if ((za=_zip_new(&error)) == NULL) { - set_error(zep, &error, 0); - return NULL; - } - - za->zn = strdup(fn); - if (!za->zn) { - _zip_free(za); - set_error(zep, NULL, ZIP_ER_MEMORY); - return NULL; - } - return za; -} - - - -static int -_zip_file_exists(const char *fn, int flags, int *zep) -{ - struct stat st; - - if (fn == NULL) { - set_error(zep, NULL, ZIP_ER_INVAL); - return -1; - } - - if (stat(fn, &st) != 0) { - if (flags & ZIP_CREATE) - return 0; - else { - set_error(zep, NULL, ZIP_ER_OPEN); - return -1; - } - } - else if ((flags & ZIP_EXCL)) { - set_error(zep, NULL, ZIP_ER_EXISTS); - return -1; - } - /* ZIP_CREATE gets ignored if file exists and not ZIP_EXCL, - just like open() */ - - return 1; -} - - - -static struct zip_cdir * -_zip_find_central_dir(FILE *fp, int flags, int *zep, off_t len) -{ - struct zip_cdir *cdir, *cdirnew; - unsigned char *buf, *match; - int a, best, buflen, i; - struct zip_error zerr; - - i = fseeko(fp, -(len < CDBUFSIZE ? len : CDBUFSIZE), SEEK_END); - if (i == -1 && errno != EFBIG) { - /* seek before start of file on my machine */ - set_error(zep, NULL, ZIP_ER_SEEK); - return NULL; - } - - /* 64k is too much for stack */ - if ((buf=(unsigned char *)malloc(CDBUFSIZE)) == NULL) { - set_error(zep, NULL, ZIP_ER_MEMORY); - return NULL; - } - - clearerr(fp); - buflen = fread(buf, 1, CDBUFSIZE, fp); - - if (ferror(fp)) { - set_error(zep, NULL, ZIP_ER_READ); - free(buf); - return NULL; - } - - best = -1; - cdir = NULL; - match = buf; - _zip_error_set(&zerr, ZIP_ER_NOZIP, 0); - - while ((match=_zip_memmem(match, buflen-(match-buf)-18, - (const unsigned char *)EOCD_MAGIC, 4))!=NULL) { - /* found match -- check, if good */ - /* to avoid finding the same match all over again */ - match++; - if ((cdirnew=_zip_readcdir(fp, buf, match-1, buflen, flags, - &zerr)) == NULL) - continue; - - if (cdir) { - if (best <= 0) - best = _zip_checkcons(fp, cdir, &zerr); - a = _zip_checkcons(fp, cdirnew, &zerr); - if (best < a) { - _zip_cdir_free(cdir); - cdir = cdirnew; - best = a; - } - else - _zip_cdir_free(cdirnew); - } - else { - cdir = cdirnew; - if (flags & ZIP_CHECKCONS) - best = _zip_checkcons(fp, cdir, &zerr); - else - best = 0; - } - cdirnew = NULL; - } - - free(buf); - - if (best < 0) { - set_error(zep, &zerr, 0); - _zip_cdir_free(cdir); - return NULL; - } - - return cdir; -} - - - -static unsigned char * -_zip_memmem(const unsigned char *big, int biglen, const unsigned char *little, - int littlelen) -{ - const unsigned char *p; - - if ((biglen < littlelen) || (littlelen == 0)) - return NULL; - p = big-1; - while ((p=(const unsigned char *) - memchr(p+1, little[0], (size_t)(big-(p+1)+biglen-littlelen+1))) - != NULL) { - if (memcmp(p+1, little+1, littlelen-1)==0) - return (unsigned char *)p; - } - - return NULL; -} diff --git a/ext/zip/lib/zip_rename.c b/ext/zip/lib/zip_rename.c deleted file mode 100644 index e57e50c390870..0000000000000 --- a/ext/zip/lib/zip_rename.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - zip_rename.c -- rename file in zip archive - Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_rename(struct zip *za, int idx, const char *name) -{ - const char *old_name; - int old_is_dir, new_is_dir; - - if (idx >= za->nentry || idx < 0 || name[0] == '\0') { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - if ((old_name=zip_get_name(za, idx, 0)) == NULL) - return -1; - - new_is_dir = (name[strlen(name)-1] == '/'); - old_is_dir = (old_name[strlen(old_name)-1] == '/'); - - if (new_is_dir != old_is_dir) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - return _zip_set_name(za, idx, name); -} diff --git a/ext/zip/lib/zip_replace.c b/ext/zip/lib/zip_replace.c deleted file mode 100644 index ae69a86f632f1..0000000000000 --- a/ext/zip/lib/zip_replace.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - zip_replace.c -- replace file via callback function - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_replace(struct zip *za, int idx, struct zip_source *source) -{ - if (idx < 0 || idx >= za->nentry || source == NULL) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - if (_zip_replace(za, idx, NULL, source) == -1) - return -1; - - return 0; -} - - - - -int -_zip_replace(struct zip *za, int idx, const char *name, - struct zip_source *source) -{ - if (idx == -1) { - if (_zip_entry_new(za) == NULL) - return -1; - - idx = za->nentry - 1; - } - - _zip_unchange_data(za->entry+idx); - - if (name && _zip_set_name(za, idx, name) != 0) - return -1; - - za->entry[idx].state = ((za->cdir == NULL || idx >= za->cdir->nentry) - ? ZIP_ST_ADDED : ZIP_ST_REPLACED); - za->entry[idx].source = source; - - return idx; -} diff --git a/ext/zip/lib/zip_set_archive_comment.c b/ext/zip/lib/zip_set_archive_comment.c deleted file mode 100644 index c4bd070ddcde3..0000000000000 --- a/ext/zip/lib/zip_set_archive_comment.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - zip_set_archive_comment.c -- set archive comment - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_set_archive_comment(struct zip *za, const char *comment, int len) -{ - char *tmpcom; - - if (len < 0 || len > MAXCOMLEN - || (len > 0 && comment == NULL)) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - if (len > 0) { - if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL) - return -1; - } - else - tmpcom = NULL; - - free(za->ch_comment); - za->ch_comment = tmpcom; - za->ch_comment_len = len; - - return 0; -} diff --git a/ext/zip/lib/zip_set_archive_flag.c b/ext/zip/lib/zip_set_archive_flag.c deleted file mode 100644 index a6fdd8d2d07ff..0000000000000 --- a/ext/zip/lib/zip_set_archive_flag.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - zip_get_archive_flag.c -- set archive global flag - Copyright (C) 2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_set_archive_flag(struct zip *za, int flag, int value) -{ - if (value) - za->ch_flags |= flag; - else - za->ch_flags &= ~flag; - - return 0; -} diff --git a/ext/zip/lib/zip_set_file_comment.c b/ext/zip/lib/zip_set_file_comment.c deleted file mode 100644 index 3d5dd6b5e3e68..0000000000000 --- a/ext/zip/lib/zip_set_file_comment.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - zip_set_file_comment.c -- set comment for file in archive - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_set_file_comment(struct zip *za, int idx, const char *comment, int len) -{ - char *tmpcom; - - if (idx < 0 || idx >= za->nentry - || len < 0 || len > MAXCOMLEN - || (len > 0 && comment == NULL)) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - if (len > 0) { - if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL) - return -1; - } - else - tmpcom = NULL; - - free(za->entry[idx].ch_comment); - za->entry[idx].ch_comment = tmpcom; - za->entry[idx].ch_comment_len = len; - - return 0; -} diff --git a/ext/zip/lib/zip_set_name.c b/ext/zip/lib/zip_set_name.c deleted file mode 100644 index 5c7da3d7c51ff..0000000000000 --- a/ext/zip/lib/zip_set_name.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - zip_set_name.c -- rename helper function - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include - -#include "zipint.h" - - - -int -_zip_set_name(struct zip *za, int idx, const char *name) -{ - char *s; - int i; - - if (idx < 0 || idx >= za->nentry || name == NULL) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - if ((i=_zip_name_locate(za, name, 0, NULL)) != -1 && i != idx) { - _zip_error_set(&za->error, ZIP_ER_EXISTS, 0); - return -1; - } - - /* no effective name change */ - if (i == idx) - return 0; - - if ((s=strdup(name)) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return -1; - } - - if (za->entry[idx].state == ZIP_ST_UNCHANGED) - za->entry[idx].state = ZIP_ST_RENAMED; - - free(za->entry[idx].ch_filename); - za->entry[idx].ch_filename = s; - - return 0; -} diff --git a/ext/zip/lib/zip_source_buffer.c b/ext/zip/lib/zip_source_buffer.c deleted file mode 100644 index 867d3dfa3ed69..0000000000000 --- a/ext/zip/lib/zip_source_buffer.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - zip_source_buffer.c -- create zip data source from buffer - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include - -#include "zipint.h" - -struct read_data { - const char *buf, *data, *end; - time_t mtime; - int freep; -}; - -static ssize_t read_data(void *state, void *data, size_t len, - enum zip_source_cmd cmd); - - - -ZIP_EXTERN(struct zip_source *) -zip_source_buffer(struct zip *za, const void *data, off_t len, int freep) -{ - struct read_data *f; - struct zip_source *zs; - - if (za == NULL) - return NULL; - - if (len < 0 || (data == NULL && len > 0)) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - if ((f=(struct read_data *)malloc(sizeof(*f))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - - f->data = (const char *)data; - f->end = ((const char *)data)+len; - f->freep = freep; - f->mtime = time(NULL); - - if ((zs=zip_source_function(za, read_data, f)) == NULL) { - free(f); - return NULL; - } - - return zs; -} - - - -static ssize_t -read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd) -{ - struct read_data *z; - char *buf; - size_t n; - - z = (struct read_data *)state; - buf = (char *)data; - - switch (cmd) { - case ZIP_SOURCE_OPEN: - z->buf = z->data; - return 0; - - case ZIP_SOURCE_READ: - n = z->end - z->buf; - if (n > len) - n = len; - - if (n) { - memcpy(buf, z->buf, n); - z->buf += n; - } - - return n; - - case ZIP_SOURCE_CLOSE: - return 0; - - case ZIP_SOURCE_STAT: - { - struct zip_stat *st; - - if (len < sizeof(*st)) - return -1; - - st = (struct zip_stat *)data; - - zip_stat_init(st); - st->mtime = z->mtime; - st->size = z->end - z->data; - - return sizeof(*st); - } - - case ZIP_SOURCE_ERROR: - { - int *e; - - if (len < sizeof(int)*2) - return -1; - - e = (int *)data; - e[0] = e[1] = 0; - } - return sizeof(int)*2; - - case ZIP_SOURCE_FREE: - if (z->freep) { - free((void *)z->data); - z->data = NULL; - } - free(z); - return 0; - - default: - ; - } - - return -1; -} diff --git a/ext/zip/lib/zip_source_file.c b/ext/zip/lib/zip_source_file.c deleted file mode 100644 index a42be670e9833..0000000000000 --- a/ext/zip/lib/zip_source_file.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - zip_source_file.c -- create data source from file - Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include - -#include "zipint.h" - - - -ZIP_EXTERN(struct zip_source *) -zip_source_file(struct zip *za, const char *fname, off_t start, off_t len) -{ - if (za == NULL) - return NULL; - - if (fname == NULL || start < 0 || len < -1) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - return _zip_source_file_or_p(za, fname, NULL, start, len); -} diff --git a/ext/zip/lib/zip_source_filep.c b/ext/zip/lib/zip_source_filep.c deleted file mode 100644 index 10f9602e1e3a5..0000000000000 --- a/ext/zip/lib/zip_source_filep.c +++ /dev/null @@ -1,216 +0,0 @@ -/* - zip_source_filep.c -- create data source from FILE * - Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include -#include -#include -#include - -#include "zipint.h" - -struct read_file { - char *fname; /* name of file to copy from */ - FILE *f; /* file to copy from */ - off_t off; /* start offset of */ - off_t len; /* lengt of data to copy */ - off_t remain; /* bytes remaining to be copied */ - int e[2]; /* error codes */ -}; - -static ssize_t read_file(void *state, void *data, size_t len, - enum zip_source_cmd cmd); - - - -ZIP_EXTERN(struct zip_source *) -zip_source_filep(struct zip *za, FILE *file, off_t start, off_t len) -{ - if (za == NULL) - return NULL; - - if (file == NULL || start < 0 || len < -1) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - return _zip_source_file_or_p(za, NULL, file, start, len); -} - - - -struct zip_source * -_zip_source_file_or_p(struct zip *za, const char *fname, FILE *file, - off_t start, off_t len) -{ - struct read_file *f; - struct zip_source *zs; - - if (file == NULL && fname == NULL) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - if ((f=(struct read_file *)malloc(sizeof(struct read_file))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - - f->fname = NULL; - if (fname) { - if ((f->fname=strdup(fname)) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - free(f); - return NULL; - } - } - f->f = file; - f->off = start; - f->len = (len ? len : -1); - - if ((zs=zip_source_function(za, read_file, f)) == NULL) { - free(f); - return NULL; - } - - return zs; -} - - - -static ssize_t -read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd) -{ - struct read_file *z; - char *buf; - int i, n; - - z = (struct read_file *)state; - buf = (char *)data; - - switch (cmd) { - case ZIP_SOURCE_OPEN: - if (z->fname) { - if ((z->f=fopen(z->fname, "rb")) == NULL) { - z->e[0] = ZIP_ER_OPEN; - z->e[1] = errno; - return -1; - } - } - - if (fseeko(z->f, z->off, SEEK_SET) < 0) { - z->e[0] = ZIP_ER_SEEK; - z->e[1] = errno; - return -1; - } - z->remain = z->len; - return 0; - - case ZIP_SOURCE_READ: - if (z->remain != -1) - n = len > z->remain ? z->remain : len; - else - n = len; - - if ((i=fread(buf, 1, n, z->f)) < 0) { - z->e[0] = ZIP_ER_READ; - z->e[1] = errno; - return -1; - } - - if (z->remain != -1) - z->remain -= i; - - return i; - - case ZIP_SOURCE_CLOSE: - if (z->fname) { - fclose(z->f); - z->f = NULL; - } - return 0; - - case ZIP_SOURCE_STAT: - { - struct zip_stat *st; - struct stat fst; - int err; - - if (len < sizeof(*st)) - return -1; - - if (z->f) - err = fstat(fileno(z->f), &fst); - else - err = stat(z->fname, &fst); - - if (err != 0) { - z->e[0] = ZIP_ER_READ; /* best match */ - z->e[1] = errno; - return -1; - } - - st = (struct zip_stat *)data; - - zip_stat_init(st); - st->mtime = fst.st_mtime; - if (z->len != -1) - st->size = z->len; - else if ((fst.st_mode&S_IFMT) == S_IFREG) - st->size = fst.st_size; - - return sizeof(*st); - } - - case ZIP_SOURCE_ERROR: - if (len < sizeof(int)*2) - return -1; - - memcpy(data, z->e, sizeof(int)*2); - return sizeof(int)*2; - - case ZIP_SOURCE_FREE: - free(z->fname); - if (z->f) - fclose(z->f); - free(z); - return 0; - - default: - ; - } - - return -1; -} diff --git a/ext/zip/lib/zip_source_free.c b/ext/zip/lib/zip_source_free.c deleted file mode 100644 index 293e7f7e114cd..0000000000000 --- a/ext/zip/lib/zip_source_free.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - zip_source_free.c -- free zip data source - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(void) -zip_source_free(struct zip_source *source) -{ - if (source == NULL) - return; - - (void)source->f(source->ud, NULL, 0, ZIP_SOURCE_FREE); - - free(source); -} diff --git a/ext/zip/lib/zip_source_function.c b/ext/zip/lib/zip_source_function.c deleted file mode 100644 index fe3e82aa5ba29..0000000000000 --- a/ext/zip/lib/zip_source_function.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - zip_source_function.c -- create zip data source from callback function - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(struct zip_source *) -zip_source_function(struct zip *za, zip_source_callback zcb, void *ud) -{ - struct zip_source *zs; - - if (za == NULL) - return NULL; - - if ((zs=(struct zip_source *)malloc(sizeof(*zs))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - - zs->f = zcb; - zs->ud = ud; - - return zs; -} diff --git a/ext/zip/lib/zip_source_zip.c b/ext/zip/lib/zip_source_zip.c deleted file mode 100644 index 58119dd39f34c..0000000000000 --- a/ext/zip/lib/zip_source_zip.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - zip_source_zip.c -- create data source from zip file - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include -#include - -#include "zipint.h" - -struct read_zip { - struct zip_file *zf; - struct zip_stat st; - off_t off, len; -}; - -static ssize_t read_zip(void *st, void *data, size_t len, - enum zip_source_cmd cmd); - - - -ZIP_EXTERN(struct zip_source *) -zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags, - off_t start, off_t len) -{ - struct zip_error error; - struct zip_source *zs; - struct read_zip *p; - - /* XXX: ZIP_FL_RECOMPRESS */ - - if (za == NULL) - return NULL; - - if (srcza == NULL || start < 0 || len < -1 || srcidx < 0 || srcidx >= srcza->nentry) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; - } - - if ((flags & ZIP_FL_UNCHANGED) == 0 - && ZIP_ENTRY_DATA_CHANGED(srcza->entry+srcidx)) { - _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); - return NULL; - } - - if (len == 0) - len = -1; - - if (start == 0 && len == -1 && (flags & ZIP_FL_RECOMPRESS) == 0) - flags |= ZIP_FL_COMPRESSED; - else - flags &= ~ZIP_FL_COMPRESSED; - - if ((p=(struct read_zip *)malloc(sizeof(*p))) == NULL) { - _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); - return NULL; - } - - _zip_error_copy(&error, &srcza->error); - - if (zip_stat_index(srcza, srcidx, flags, &p->st) < 0 - || (p->zf=zip_fopen_index(srcza, srcidx, flags)) == NULL) { - free(p); - _zip_error_copy(&za->error, &srcza->error); - _zip_error_copy(&srcza->error, &error); - - return NULL; - } - p->off = start; - p->len = len; - - if ((flags & ZIP_FL_COMPRESSED) == 0) { - p->st.size = p->st.comp_size = len; - p->st.comp_method = ZIP_CM_STORE; - p->st.crc = 0; - } - - if ((zs=zip_source_function(za, read_zip, p)) == NULL) { - free(p); - return NULL; - } - - return zs; -} - - - -static ssize_t -read_zip(void *state, void *data, size_t len, enum zip_source_cmd cmd) -{ - struct read_zip *z; - char b[8192], *buf; - int i, n; - - z = (struct read_zip *)state; - buf = (char *)data; - - switch (cmd) { - case ZIP_SOURCE_OPEN: - for (n=0; noff; n+= i) { - i = (z->off-n > sizeof(b) ? sizeof(b) : z->off-n); - if ((i=zip_fread(z->zf, b, i)) < 0) { - zip_fclose(z->zf); - z->zf = NULL; - return -1; - } - } - return 0; - - case ZIP_SOURCE_READ: - if (z->len != -1) - n = len > z->len ? z->len : len; - else - n = len; - - - if ((i=zip_fread(z->zf, buf, n)) < 0) - return -1; - - if (z->len != -1) - z->len -= i; - - return i; - - case ZIP_SOURCE_CLOSE: - return 0; - - case ZIP_SOURCE_STAT: - if (len < sizeof(z->st)) - return -1; - len = sizeof(z->st); - - memcpy(data, &z->st, len); - return len; - - case ZIP_SOURCE_ERROR: - { - int *e; - - if (len < sizeof(int)*2) - return -1; - - e = (int *)data; - zip_file_error_get(z->zf, e, e+1); - } - return sizeof(int)*2; - - case ZIP_SOURCE_FREE: - zip_fclose(z->zf); - free(z); - return 0; - - default: - ; - } - - return -1; -} diff --git a/ext/zip/lib/zip_stat.c b/ext/zip/lib/zip_stat.c deleted file mode 100644 index c8a25e1d84ac3..0000000000000 --- a/ext/zip/lib/zip_stat.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - zip_stat.c -- get information about file by name - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_stat(struct zip *za, const char *fname, int flags, struct zip_stat *st) -{ - int idx; - - if ((idx=zip_name_locate(za, fname, flags)) < 0) - return -1; - - return zip_stat_index(za, idx, flags, st); -} diff --git a/ext/zip/lib/zip_stat_index.c b/ext/zip/lib/zip_stat_index.c deleted file mode 100644 index 26425206ca332..0000000000000 --- a/ext/zip/lib/zip_stat_index.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - zip_stat_index.c -- get information about file by index - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st) -{ - const char *name; - - if (index < 0 || index >= za->nentry) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - if ((name=zip_get_name(za, index, flags)) == NULL) - return -1; - - - if ((flags & ZIP_FL_UNCHANGED) == 0 - && ZIP_ENTRY_DATA_CHANGED(za->entry+index)) { - if (za->entry[index].source->f(za->entry[index].source->ud, - st, sizeof(*st), ZIP_SOURCE_STAT) < 0) { - _zip_error_set(&za->error, ZIP_ER_CHANGED, 0); - return -1; - } - } - else { - if (za->cdir == NULL || index >= za->cdir->nentry) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - st->crc = za->cdir->entry[index].crc; - st->size = za->cdir->entry[index].uncomp_size; - st->mtime = za->cdir->entry[index].last_mod; - st->comp_size = za->cdir->entry[index].comp_size; - st->comp_method = za->cdir->entry[index].comp_method; - if (za->cdir->entry[index].bitflags & ZIP_GPBF_ENCRYPTED) { - if (za->cdir->entry[index].bitflags & ZIP_GPBF_STRONG_ENCRYPTION) { - /* XXX */ - st->encryption_method = ZIP_EM_UNKNOWN; - } - else - st->encryption_method = ZIP_EM_TRAD_PKWARE; - } - else - st->encryption_method = ZIP_EM_NONE; - /* st->bitflags = za->cdir->entry[index].bitflags; */ - } - - st->index = index; - st->name = name; - - return 0; -} diff --git a/ext/zip/lib/zip_stat_init.c b/ext/zip/lib/zip_stat_init.c deleted file mode 100644 index cb451dc3bcaad..0000000000000 --- a/ext/zip/lib/zip_stat_init.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - zip_stat_init.c -- initialize struct zip_stat. - Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - - -ZIP_EXTERN(void) -zip_stat_init(struct zip_stat *st) -{ - st->name = NULL; - st->index = -1; - st->crc = 0; - st->mtime = (time_t)-1; - st->size = -1; - st->comp_size = -1; - st->comp_method = ZIP_CM_STORE; - st->encryption_method = ZIP_EM_NONE; -} diff --git a/ext/zip/lib/zip_strerror.c b/ext/zip/lib/zip_strerror.c deleted file mode 100644 index ad23bafed6c62..0000000000000 --- a/ext/zip/lib/zip_strerror.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - zip_sterror.c -- get string representation of zip error - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include "zipint.h" - - -ZIP_EXTERN(const char *) -zip_strerror(struct zip *za) -{ - return _zip_error_strerror(&za->error); -} diff --git a/ext/zip/lib/zip_unchange.c b/ext/zip/lib/zip_unchange.c deleted file mode 100644 index 7366c9cc7164e..0000000000000 --- a/ext/zip/lib/zip_unchange.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - zip_unchange.c -- undo changes to file in zip archive - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_unchange(struct zip *za, int idx) -{ - return _zip_unchange(za, idx, 0); -} - - - -int -_zip_unchange(struct zip *za, int idx, int allow_duplicates) -{ - int i; - - if (idx < 0 || idx >= za->nentry) { - _zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return -1; - } - - if (za->entry[idx].ch_filename) { - if (!allow_duplicates) { - i = _zip_name_locate(za, - _zip_get_name(za, idx, ZIP_FL_UNCHANGED, NULL), - 0, NULL); - if (i != -1 && i != idx) { - _zip_error_set(&za->error, ZIP_ER_EXISTS, 0); - return -1; - } - } - - free(za->entry[idx].ch_filename); - za->entry[idx].ch_filename = NULL; - } - - free(za->entry[idx].ch_comment); - za->entry[idx].ch_comment = NULL; - za->entry[idx].ch_comment_len = -1; - - _zip_unchange_data(za->entry+idx); - - return 0; -} diff --git a/ext/zip/lib/zip_unchange_all.c b/ext/zip/lib/zip_unchange_all.c deleted file mode 100644 index 01282f89dbbaf..0000000000000 --- a/ext/zip/lib/zip_unchange_all.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - zip_unchange.c -- undo changes to all files in zip archive - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_unchange_all(struct zip *za) -{ - int ret, i; - - ret = 0; - for (i=0; inentry; i++) - ret |= _zip_unchange(za, i, 1); - - ret |= zip_unchange_archive(za); - - return ret; -} diff --git a/ext/zip/lib/zip_unchange_archive.c b/ext/zip/lib/zip_unchange_archive.c deleted file mode 100644 index ca2b67854435a..0000000000000 --- a/ext/zip/lib/zip_unchange_archive.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - zip_unchange_archive.c -- undo global changes to ZIP archive - Copyright (C) 2006-2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - - - -ZIP_EXTERN(int) -zip_unchange_archive(struct zip *za) -{ - free(za->ch_comment); - za->ch_comment = NULL; - za->ch_comment_len = -1; - - za->ch_flags = za->flags; - - return 0; -} diff --git a/ext/zip/lib/zip_unchange_data.c b/ext/zip/lib/zip_unchange_data.c deleted file mode 100644 index 6fe89f4fb2b78..0000000000000 --- a/ext/zip/lib/zip_unchange_data.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - $NiH: zip_unchange_data.c,v 1.14 2004/11/30 23:02:47 wiz Exp $ - - zip_unchange_data.c -- undo helper function - Copyright (C) 1999, 2004 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - - -#include - -#include "zipint.h" - -void -_zip_unchange_data(struct zip_entry *ze) -{ - if (ze->source) { - (void)ze->source->f(ze->source->ud, NULL, 0, ZIP_SOURCE_FREE); - free(ze->source); - ze->source = NULL; - } - - ze->state = ze->ch_filename ? ZIP_ST_RENAMED : ZIP_ST_UNCHANGED; -} - diff --git a/ext/zip/lib/zip_win32.h b/ext/zip/lib/zip_win32.h deleted file mode 100644 index ff28d2878c4b6..0000000000000 --- a/ext/zip/lib/zip_win32.h +++ /dev/null @@ -1,31 +0,0 @@ -#define _POSIX_ -#include -#include -#include -#include -#include - -#ifndef strcasecmp -# define strcmpi _strcmpi -#endif - -#ifndef ssize_t -# define ssize_t SSIZE_T -#endif - -#ifndef mode_t -# define mode_t int -#endif - -#ifndef snprintf -# define snprintf _snprintf -#endif - -#ifndef mkstemp -# define mkstemp(t) _creat(_mktemp(t), _S_IREAD|_S_IWRITE) -#endif -/* -#ifndef fseeko -# define fseeko fseek -#endif -*/ diff --git a/ext/zip/lib/zipint.h b/ext/zip/lib/zipint.h deleted file mode 100644 index e291b8b3c3c55..0000000000000 --- a/ext/zip/lib/zipint.h +++ /dev/null @@ -1,259 +0,0 @@ -#ifndef _HAD_ZIPINT_H -#define _HAD_ZIPINT_H - -/* - zipint.h -- internal declarations. - Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include - -#include "zip.h" - -#ifdef PHP_WIN32 -#include -#include -#define _zip_rename(s, t) \ - (!MoveFileExA((s), (t), \ - MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING)) -#else -#define _zip_rename rename -#endif - -#ifndef strcasecmp -# define strcmpi strcasecmp -#endif - -#ifndef HAVE_FSEEKO -#define fseeko(s, o, w) (fseek((s), (long int)(o), (w))) -#endif -#ifndef HAVE_FTELLO -#define ftello(s) ((long)ftell((s))) -#endif - - - -#define CENTRAL_MAGIC "PK\1\2" -#define LOCAL_MAGIC "PK\3\4" -#define EOCD_MAGIC "PK\5\6" -#define DATADES_MAGIC "PK\7\8" -#define TORRENT_SIG "TORRENTZIPPED-" -#define TORRENT_SIG_LEN 14 -#define TORRENT_CRC_LEN 8 -#define TORRENT_MEM_LEVEL 8 -#define CDENTRYSIZE 46u -#define LENTRYSIZE 30 -#undef MAXCOMLEN /* defined as 19 on BSD for max command name */ -#define MAXCOMLEN 65536 -#define EOCDLEN 22 -#define CDBUFSIZE (MAXCOMLEN+EOCDLEN) -#define BUFSIZE 8192 - - - -/* state of change of a file in zip archive */ - -enum zip_state { ZIP_ST_UNCHANGED, ZIP_ST_DELETED, ZIP_ST_REPLACED, - ZIP_ST_ADDED, ZIP_ST_RENAMED }; - -/* constants for struct zip_file's member flags */ - -#define ZIP_ZF_EOF 1 /* EOF reached */ -#define ZIP_ZF_DECOMP 2 /* decompress data */ -#define ZIP_ZF_CRC 4 /* compute and compare CRC */ - -/* directory entry: general purpose bit flags */ - -#define ZIP_GPBF_ENCRYPTED 0x0001 /* is encrypted */ -#define ZIP_GPBF_DATA_DESCRIPTOR 0x0008 /* crc/size after file data */ -#define ZIP_GPBF_STRONG_ENCRYPTION 0x0040 /* uses strong encryption */ - -/* error information */ - -struct zip_error { - int zip_err; /* libzip error code (ZIP_ER_*) */ - int sys_err; /* copy of errno (E*) or zlib error code */ - char *str; /* string representation or NULL */ -}; - -/* zip archive, part of API */ - -struct zip { - char *zn; /* file name */ - FILE *zp; /* file */ - struct zip_error error; /* error information */ - - unsigned int flags; /* archive global flags */ - unsigned int ch_flags; /* changed archive global flags */ - - struct zip_cdir *cdir; /* central directory */ - char *ch_comment; /* changed archive comment */ - int ch_comment_len; /* length of changed zip archive - * comment, -1 if unchanged */ - int nentry; /* number of entries */ - int nentry_alloc; /* number of entries allocated */ - struct zip_entry *entry; /* entries */ - int nfile; /* number of opened files within archive */ - int nfile_alloc; /* number of files allocated */ - struct zip_file **file; /* opened files within archive */ -}; - -/* file in zip archive, part of API */ - -struct zip_file { - struct zip *za; /* zip archive containing this file */ - struct zip_error error; /* error information */ - int flags; /* -1: eof, >0: error */ - - int method; /* compression method */ - off_t fpos; /* position within zip file (fread/fwrite) */ - unsigned long bytes_left; /* number of bytes left to read */ - unsigned long cbytes_left; /* number of bytes of compressed data left */ - - unsigned long crc; /* CRC so far */ - unsigned long crc_orig; /* CRC recorded in archive */ - - char *buffer; - z_stream *zstr; -}; - -/* zip archive directory entry (central or local) */ - -struct zip_dirent { - unsigned short version_madeby; /* (c) version of creator */ - unsigned short version_needed; /* (cl) version needed to extract */ - unsigned short bitflags; /* (cl) general purpose bit flag */ - unsigned short comp_method; /* (cl) compression method used */ - time_t last_mod; /* (cl) time of last modification */ - unsigned int crc; /* (cl) CRC-32 of uncompressed data */ - unsigned int comp_size; /* (cl) size of commpressed data */ - unsigned int uncomp_size; /* (cl) size of uncommpressed data */ - char *filename; /* (cl) file name (NUL-terminated) */ - unsigned short filename_len; /* (cl) length of filename (w/o NUL) */ - char *extrafield; /* (cl) extra field */ - unsigned short extrafield_len; /* (cl) length of extra field */ - char *comment; /* (c) file comment */ - unsigned short comment_len; /* (c) length of file comment */ - unsigned short disk_number; /* (c) disk number start */ - unsigned short int_attrib; /* (c) internal file attributes */ - unsigned int ext_attrib; /* (c) external file attributes */ - unsigned int offset; /* (c) offset of local header */ -}; - -/* zip archive central directory */ - -struct zip_cdir { - struct zip_dirent *entry; /* directory entries */ - int nentry; /* number of entries */ - - unsigned int size; /* size of central direcotry */ - unsigned int offset; /* offset of central directory in file */ - char *comment; /* zip archive comment */ - unsigned short comment_len; /* length of zip archive comment */ -}; - - - -struct zip_source { - zip_source_callback f; - void *ud; -}; - -/* entry in zip archive directory */ - -struct zip_entry { - enum zip_state state; - struct zip_source *source; - char *ch_filename; - char *ch_comment; - int ch_comment_len; -}; - - - -extern const char * const _zip_err_str[]; -extern const int _zip_nerr_str; -extern const int _zip_err_type[]; - - - -#define ZIP_ENTRY_DATA_CHANGED(x) \ - ((x)->state == ZIP_ST_REPLACED \ - || (x)->state == ZIP_ST_ADDED) - - - -int _zip_cdir_compute_crc(struct zip *, uLong *); -void _zip_cdir_free(struct zip_cdir *); -struct zip_cdir *_zip_cdir_new(int, struct zip_error *); -int _zip_cdir_write(struct zip_cdir *, FILE *, struct zip_error *); - -void _zip_dirent_finalize(struct zip_dirent *); -void _zip_dirent_init(struct zip_dirent *); -int _zip_dirent_read(struct zip_dirent *, FILE *, - unsigned char **, unsigned int, int, struct zip_error *); -void _zip_dirent_torrent_normalize(struct zip_dirent *); -int _zip_dirent_write(struct zip_dirent *, FILE *, int, struct zip_error *); - -void _zip_entry_free(struct zip_entry *); -void _zip_entry_init(struct zip *, int); -struct zip_entry *_zip_entry_new(struct zip *); - -void _zip_error_clear(struct zip_error *); -void _zip_error_copy(struct zip_error *, struct zip_error *); -void _zip_error_fini(struct zip_error *); -void _zip_error_get(struct zip_error *, int *, int *); -void _zip_error_init(struct zip_error *); -void _zip_error_set(struct zip_error *, int, int); -const char *_zip_error_strerror(struct zip_error *); - -int _zip_file_fillbuf(void *, size_t, struct zip_file *); -unsigned int _zip_file_get_offset(struct zip *, int); - -int _zip_filerange_crc(FILE *, off_t, off_t, uLong *, struct zip_error *); - -struct zip_source *_zip_source_file_or_p(struct zip *, const char *, FILE *, - off_t, off_t); - -void _zip_free(struct zip *); -const char *_zip_get_name(struct zip *, int, int, struct zip_error *); -int _zip_local_header_read(struct zip *, int); -void *_zip_memdup(const void *, size_t, struct zip_error *); -int _zip_name_locate(struct zip *, const char *, int, struct zip_error *); -struct zip *_zip_new(struct zip_error *); -unsigned short _zip_read2(unsigned char **); -unsigned int _zip_read4(unsigned char **); -int _zip_replace(struct zip *, int, const char *, struct zip_source *); -int _zip_set_name(struct zip *, int, const char *); -int _zip_unchange(struct zip *, int, int); -void _zip_unchange_data(struct zip_entry *); - -#endif /* zipint.h */ diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c deleted file mode 100644 index c3514cd33053f..0000000000000 --- a/ext/zip/php_zip.c +++ /dev/null @@ -1,2291 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Piere-Alain Joye | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "ext/standard/php_string.h" -#include "php_zip.h" -#include "lib/zip.h" -#include "lib/zipint.h" - -/* zip_open is a macro for renaming libzip zipopen, so we need to use PHP_NAMED_FUNCTION */ -static PHP_NAMED_FUNCTION(zif_zip_open); -static PHP_NAMED_FUNCTION(zif_zip_read); -static PHP_NAMED_FUNCTION(zif_zip_close); -static PHP_NAMED_FUNCTION(zif_zip_entry_read); -static PHP_NAMED_FUNCTION(zif_zip_entry_filesize); -static PHP_NAMED_FUNCTION(zif_zip_entry_name); -static PHP_NAMED_FUNCTION(zif_zip_entry_compressedsize); -static PHP_NAMED_FUNCTION(zif_zip_entry_compressionmethod); -static PHP_NAMED_FUNCTION(zif_zip_entry_open); -static PHP_NAMED_FUNCTION(zif_zip_entry_close); - -/* {{{ Resource le */ -static int le_zip_dir; -#define le_zip_dir_name "Zip Directory" -static int le_zip_entry; -#define le_zip_entry_name "Zip Entry" -/* }}} */ - -/* {{{ PHP_ZIP_STAT_INDEX(za, index, flags, sb) */ -#define PHP_ZIP_STAT_INDEX(za, index, flags, sb) \ - if (zip_stat_index(za, index, flags, &sb) != 0) { \ - RETURN_FALSE; \ - } -/* }}} */ - -/* {{{ PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) */ -#define PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) \ - if (path_len < 1) { \ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name"); \ - RETURN_FALSE; \ - } \ - if (zip_stat(za, path, flags, &sb) != 0) { \ - RETURN_FALSE; \ - } -/* }}} */ - -/* {{{ PHP_ZIP_SET_FILE_COMMENT(za, index, comment, comment_len) */ -#define PHP_ZIP_SET_FILE_COMMENT(za, index, comment, comment_len) \ - if (comment_len == 0) { \ - /* Passing NULL remove the existing comment */ \ - if (zip_set_file_comment(intern, index, NULL, 0) < 0) { \ - RETURN_FALSE; \ - } \ - } else if (zip_set_file_comment(intern, index, comment, comment_len) < 0) { \ - RETURN_FALSE; \ - } \ - RETURN_TRUE; -/* }}} */ - -#if (PHP_MAJOR_VERSION < 6) -# define add_ascii_assoc_string add_assoc_string -# define add_ascii_assoc_long add_assoc_long -#endif - -/* Flatten a path by creating a relative path (to .) */ -static char * php_zip_make_relative_path(char *path, int path_len) /* {{{ */ -{ - char *path_begin = path; - size_t i; - - if (IS_SLASH(path[0])) { - return path + 1; - } - - if (path_len < 1 || path == NULL) { - return NULL; - } - - i = path_len; - - while (1) { - while (i > 0 && !IS_SLASH(path[i])) { - i--; - } - - if (!i) { - return path; - } - - if (i >= 2 && (path[i -1] == '.' || path[i -1] == ':')) { - /* i is the position of . or :, add 1 for / */ - path_begin = path + i + 1; - break; - } - i--; - } - - return path_begin; -} -/* }}} */ - -/* {{{ php_zip_extract_file */ -static int php_zip_extract_file(struct zip * za, char *dest, char *file, int file_len TSRMLS_DC) -{ - php_stream_statbuf ssb; - struct zip_file *zf; - struct zip_stat sb; - char b[8192]; - int n, len, ret; - php_stream *stream; - char *fullpath; - char *file_dirname_fullpath; - char file_dirname[MAXPATHLEN]; - size_t dir_len; - char *file_basename; - size_t file_basename_len; - int is_dir_only = 0; - char *path_cleaned; - size_t path_cleaned_len; - cwd_state new_state; - - new_state.cwd = (char*)malloc(1); - new_state.cwd[0] = '\0'; - new_state.cwd_length = 0; - - /* Clean/normlize the path and then transform any path (absolute or relative) - to a path relative to cwd (../../mydir/foo.txt > mydir/foo.txt) - */ - virtual_file_ex(&new_state, file, NULL, CWD_EXPAND); - path_cleaned = php_zip_make_relative_path(new_state.cwd, new_state.cwd_length); - path_cleaned_len = strlen(path_cleaned); - - if (path_cleaned_len >= MAXPATHLEN || zip_stat(za, file, 0, &sb) != 0) { - return 0; - } - - /* it is a directory only, see #40228 */ - if (path_cleaned_len > 1 && IS_SLASH(path_cleaned[path_cleaned_len - 1])) { - len = spprintf(&file_dirname_fullpath, 0, "%s/%s", dest, file); - is_dir_only = 1; - } else { - memcpy(file_dirname, path_cleaned, path_cleaned_len); - dir_len = php_dirname(file_dirname, path_cleaned_len); - - if (dir_len <= 0 || (dir_len == 1 && file_dirname[0] == '.')) { - len = spprintf(&file_dirname_fullpath, 0, "%s", dest); - } else { - len = spprintf(&file_dirname_fullpath, 0, "%s/%s", dest, file_dirname); - } - - php_basename(path_cleaned, path_cleaned_len, NULL, 0, &file_basename, (unsigned int *)&file_basename_len TSRMLS_CC); - - if (OPENBASEDIR_CHECKPATH(file_dirname_fullpath)) { - efree(file_dirname_fullpath); - efree(file_basename); - free(new_state.cwd); - return 0; - } - } - - /* let see if the path already exists */ - if (php_stream_stat_path(file_dirname_fullpath, &ssb) < 0) { - -#if defined(PHP_WIN32) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1) - char *e; - e = file_dirname_fullpath; - while (*e) { - if (*e == '/') { - *e = DEFAULT_SLASH; - } - e++; - } -#endif - - ret = php_stream_mkdir(file_dirname_fullpath, 0777, PHP_STREAM_MKDIR_RECURSIVE|REPORT_ERRORS, NULL); - if (!ret) { - efree(file_dirname_fullpath); - if (!is_dir_only) { - efree(file_basename); - free(new_state.cwd); - } - return 0; - } - } - - /* it is a standalone directory, job done */ - if (is_dir_only) { - efree(file_dirname_fullpath); - free(new_state.cwd); - return 1; - } - - len = spprintf(&fullpath, 0, "%s/%s", file_dirname_fullpath, file_basename); - if (!len) { - efree(file_dirname_fullpath); - efree(file_basename); - free(new_state.cwd); - return 0; - } else if (len > MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Full extraction path exceed MAXPATHLEN (%i)", MAXPATHLEN); - } - - /* check again the full path, not sure if it - * is required, does a file can have a different - * safemode status as its parent folder? - */ - if (OPENBASEDIR_CHECKPATH(fullpath)) { - efree(fullpath); - efree(file_dirname_fullpath); - efree(file_basename); - free(new_state.cwd); - return 0; - } - - zf = zip_fopen(za, file, 0); - if (zf == NULL) { - efree(fullpath); - efree(file_dirname_fullpath); - efree(file_basename); - free(new_state.cwd); - return 0; - } - -#if (PHP_MAJOR_VERSION < 6) - stream = php_stream_open_wrapper(fullpath, "w+b", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); -#else - stream = php_stream_open_wrapper(fullpath, "w+b", REPORT_ERRORS, NULL); -#endif - n = 0; - if (stream) { - while ((n=zip_fread(zf, b, sizeof(b))) > 0) php_stream_write(stream, b, n); - php_stream_close(stream); - } - n = zip_fclose(zf); - - efree(fullpath); - efree(file_basename); - efree(file_dirname_fullpath); - free(new_state.cwd); - - if (n<0) { - return 0; - } else { - return 1; - } -} -/* }}} */ - -static int php_zip_add_file(struct zip *za, const char *filename, int filename_len, - char *entry_name, int entry_name_len, long offset_start, long offset_len TSRMLS_DC) /* {{{ */ -{ - struct zip_source *zs; - int cur_idx; - char resolved_path[MAXPATHLEN]; - - - if (OPENBASEDIR_CHECKPATH(filename)) { - return -1; - } - - if (!expand_filepath(filename, resolved_path TSRMLS_CC)) { - return -1; - } - - zs = zip_source_file(za, resolved_path, offset_start, offset_len); - if (!zs) { - return -1; - } - - cur_idx = zip_name_locate(za, (const char *)entry_name, 0); - /* TODO: fix _zip_replace */ - if (cur_idx<0) { - /* reset the error */ - if (za->error.str) { - _zip_error_fini(&za->error); - } - _zip_error_init(&za->error); - } else { - if (zip_delete(za, cur_idx) == -1) { - zip_source_free(zs); - return -1; - } - } - - if (zip_add(za, entry_name, zs) == -1) { - return -1; - } else { - return 1; - } -} -/* }}} */ - -static int php_zip_parse_options(zval *options, long *remove_all_path, - char **remove_path, int *remove_path_len, char **add_path, int *add_path_len TSRMLS_DC) /* {{{ */ -{ - zval **option; - if (zend_hash_find(HASH_OF(options), "remove_all_path", sizeof("remove_all_path"), (void **)&option) == SUCCESS) { - long opt; - if (Z_TYPE_PP(option) != IS_LONG) { - zval tmp = **option; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - opt = Z_LVAL(tmp); - } else { - opt = Z_LVAL_PP(option); - } - *remove_all_path = opt; - } - - /* If I add more options, it would make sense to create a nice static struct and loop over it. */ - if (zend_hash_find(HASH_OF(options), "remove_path", sizeof("remove_path"), (void **)&option) == SUCCESS) { - if (Z_TYPE_PP(option) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "remove_path option expected to be a string"); - return -1; - } - - if (Z_STRLEN_PP(option) < 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string given as remove_path option"); - return -1; - } - - if (Z_STRLEN_PP(option) >= MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "remove_path string is too long (max: %i, %i given)", - MAXPATHLEN - 1, Z_STRLEN_PP(option)); - return -1; - } - *remove_path_len = Z_STRLEN_PP(option); - *remove_path = Z_STRVAL_PP(option); - } - - if (zend_hash_find(HASH_OF(options), "add_path", sizeof("add_path"), (void **)&option) == SUCCESS) { - if (Z_TYPE_PP(option) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_path option expected to be a string"); - return -1; - } - - if (Z_STRLEN_PP(option) < 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string given as the add_path option"); - return -1; - } - - if (Z_STRLEN_PP(option) >= MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_path string too long (max: %i, %i given)", - MAXPATHLEN - 1, Z_STRLEN_PP(option)); - return -1; - } - *add_path_len = Z_STRLEN_PP(option); - *add_path = Z_STRVAL_PP(option); - } - return 1; -} -/* }}} */ - -/* {{{ REGISTER_ZIP_CLASS_CONST_LONG */ -#define REGISTER_ZIP_CLASS_CONST_LONG(const_name, value) \ - zend_declare_class_constant_long(zip_class_entry, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); -/* }}} */ - -/* {{{ ZIP_FROM_OBJECT */ -#define ZIP_FROM_OBJECT(intern, object) \ - { \ - ze_zip_object *obj = (ze_zip_object*) zend_object_store_get_object(object TSRMLS_CC); \ - intern = obj->za; \ - if (!intern) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or unitialized Zip object"); \ - RETURN_FALSE; \ - } \ - } -/* }}} */ - -/* {{{ RETURN_SB(sb) */ -#define RETURN_SB(sb) \ - { \ - array_init(return_value); \ - add_ascii_assoc_string(return_value, "name", (char *)(sb)->name, 1); \ - add_ascii_assoc_long(return_value, "index", (long) (sb)->index); \ - add_ascii_assoc_long(return_value, "crc", (long) (sb)->crc); \ - add_ascii_assoc_long(return_value, "size", (long) (sb)->size); \ - add_ascii_assoc_long(return_value, "mtime", (long) (sb)->mtime); \ - add_ascii_assoc_long(return_value, "comp_size", (long) (sb)->comp_size); \ - add_ascii_assoc_long(return_value, "comp_method", (long) (sb)->comp_method); \ - } -/* }}} */ - -static int php_zip_status(struct zip *za TSRMLS_DC) /* {{{ */ -{ - int zep, syp; - - zip_error_get(za, &zep, &syp); - return zep; -} -/* }}} */ - -static int php_zip_status_sys(struct zip *za TSRMLS_DC) /* {{{ */ -{ - int zep, syp; - - zip_error_get(za, &zep, &syp); - return syp; -} -/* }}} */ - -static int php_zip_get_num_files(struct zip *za TSRMLS_DC) /* {{{ */ -{ - return zip_get_num_files(za); -} -/* }}} */ - -static char * php_zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) /* {{{ */ -{ - if (!obj) { - return NULL; - } - - if (obj->filename) { - return obj->filename; - } - return NULL; -} -/* }}} */ - -static char * php_zipobj_get_zip_comment(struct zip *za, int *len TSRMLS_DC) /* {{{ */ -{ - if (za) { - return (char *)zip_get_archive_comment(za, len, 0); - } - return NULL; -} -/* }}} */ - -/* {{{ zend_function_entry */ -static zend_function_entry zip_functions[] = { - ZEND_RAW_FENTRY("zip_open", zif_zip_open, NULL, 0) - ZEND_RAW_FENTRY("zip_close", zif_zip_close, NULL, 0) - ZEND_RAW_FENTRY("zip_read", zif_zip_read, NULL, 0) - PHP_FE(zip_entry_open, NULL) - PHP_FE(zip_entry_close, NULL) - PHP_FE(zip_entry_read, NULL) - PHP_FE(zip_entry_filesize, NULL) - PHP_FE(zip_entry_name, NULL) - PHP_FE(zip_entry_compressedsize, NULL) - PHP_FE(zip_entry_compressionmethod, NULL) - - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ ZE2 OO definitions */ -#ifdef PHP_ZIP_USE_OO -static zend_class_entry *zip_class_entry; -static zend_object_handlers zip_object_handlers; - -static HashTable zip_prop_handlers; - -typedef int (*zip_read_int_t)(struct zip *za TSRMLS_DC); -typedef char *(*zip_read_const_char_t)(struct zip *za, int *len TSRMLS_DC); -typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj TSRMLS_DC); - -typedef struct _zip_prop_handler { - zip_read_int_t read_int_func; - zip_read_const_char_t read_const_char_func; - zip_read_const_char_from_ze_t read_const_char_from_obj_func; - - int type; -} zip_prop_handler; -#endif -/* }}} */ - -#ifdef PHP_ZIP_USE_OO -static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype TSRMLS_DC) /* {{{ */ -{ - zip_prop_handler hnd; - - hnd.read_const_char_func = read_char_func; - hnd.read_int_func = read_int_func; - hnd.read_const_char_from_obj_func = read_char_from_obj_func; - hnd.type = rettype; - zend_hash_add(prop_handler, name, strlen(name)+1, &hnd, sizeof(zip_prop_handler), NULL); -} -/* }}} */ - -static int php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval **retval, int newzval TSRMLS_DC) /* {{{ */ -{ - const char *retchar = NULL; - int retint = 0; - int len = 0; - - if (obj && obj->za != NULL) { - if (hnd->read_const_char_func) { - retchar = hnd->read_const_char_func(obj->za, &len TSRMLS_CC); - } else { - if (hnd->read_int_func) { - retint = hnd->read_int_func(obj->za TSRMLS_CC); - if (retint == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal zip error returned"); - return FAILURE; - } - } else { - if (hnd->read_const_char_from_obj_func) { - retchar = hnd->read_const_char_from_obj_func(obj TSRMLS_CC); - } - } - } - } - - if (newzval) { - ALLOC_ZVAL(*retval); - } - - switch (hnd->type) { - case IS_STRING: - if (retchar) { - ZVAL_STRINGL(*retval, (char *) retchar, len, 1); - } else { - ZVAL_EMPTY_STRING(*retval); - } - break; - case IS_BOOL: - ZVAL_BOOL(*retval, (long)retint); - break; - case IS_LONG: - ZVAL_LONG(*retval, (long)retint); - break; - default: - ZVAL_NULL(*retval); - } - - return SUCCESS; -} -/* }}} */ - -static zval **php_zip_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) /* {{{ */ -{ - ze_zip_object *obj; - zval tmp_member; - zval **retval = NULL; - - zip_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (ze_zip_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - - - if (ret == FAILURE) { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->get_property_ptr_ptr(object, member TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} -/* }}} */ - -static zval* php_zip_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */ -{ - ze_zip_object *obj; - zval tmp_member; - zval *retval; - zip_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (ze_zip_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - - if (ret == SUCCESS) { - ret = php_zip_property_reader(obj, hnd, &retval, 1 TSRMLS_CC); - if (ret == SUCCESS) { - /* ensure we're creating a temporary variable */ - Z_SET_REFCOUNT_P(retval, 0); - } else { - retval = EG(uninitialized_zval_ptr); - } - } else { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->read_property(object, member, type TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} -/* }}} */ - -static int php_zip_has_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */ -{ - ze_zip_object *obj; - zval tmp_member; - zip_prop_handler *hnd; - zend_object_handlers *std_hnd; - int ret, retval = 0; - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - ret = FAILURE; - obj = (ze_zip_object *)zend_objects_get_address(object TSRMLS_CC); - - if (obj->prop_handler != NULL) { - ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd); - } - - if (ret == SUCCESS) { - zval *tmp; - - if (type == 2) { - retval = 1; - } else if (php_zip_property_reader(obj, hnd, &tmp, 1 TSRMLS_CC) == SUCCESS) { - Z_SET_REFCOUNT_P(tmp, 1); - Z_UNSET_ISREF_P(tmp); - if (type == 1) { - retval = zend_is_true(tmp); - } else if (type == 0) { - retval = (Z_TYPE_P(tmp) != IS_NULL); - } - zval_ptr_dtor(&tmp); - } - } else { - std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->has_property(object, member, type TSRMLS_CC); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} -/* }}} */ - -static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */ -{ - ze_zip_object *obj; - zip_prop_handler *hnd; - HashTable *props; - zval *val; - int ret; - char *key; - uint key_len; - HashPosition pos; - ulong num_key; - - obj = (ze_zip_object *)zend_objects_get_address(object TSRMLS_CC); - props = obj->zo.properties; - - if (obj->prop_handler == NULL) { - return NULL; - } - zend_hash_internal_pointer_reset_ex(obj->prop_handler, &pos); - - while (zend_hash_get_current_data_ex(obj->prop_handler, (void**)&hnd, &pos) == SUCCESS) { - zend_hash_get_current_key_ex(obj->prop_handler, &key, &key_len, &num_key, 0, &pos); - MAKE_STD_ZVAL(val); - ret = php_zip_property_reader(obj, hnd, &val, 0 TSRMLS_CC); - if (ret != SUCCESS) { - val = EG(uninitialized_zval_ptr); - } - zend_hash_update(props, key, key_len, (void *)&val, sizeof(zval *), NULL); - zend_hash_move_forward_ex(obj->prop_handler, &pos); - } - return obj->zo.properties; -} -/* }}} */ - -static void php_zip_object_free_storage(void *object TSRMLS_DC) /* {{{ */ -{ - ze_zip_object * intern = (ze_zip_object *) object; - int i; - - if (!intern) { - return; - } - if (intern->za) { - if (zip_close(intern->za) != 0) { - _zip_free(intern->za); - } - intern->za = NULL; - } - - if (intern->buffers_cnt>0) { - for (i=0; ibuffers_cnt; i++) { - efree(intern->buffers[i]); - } - efree(intern->buffers); - } - - intern->za = NULL; - zend_object_std_dtor(&intern->zo TSRMLS_CC); - - if (intern->filename) { - efree(intern->filename); - } - efree(intern); -} -/* }}} */ - -static zend_object_value php_zip_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ -{ - ze_zip_object *intern; - zval *tmp; - zend_object_value retval; - - intern = emalloc(sizeof(ze_zip_object)); - memset(&intern->zo, 0, sizeof(zend_object)); - - intern->za = NULL; - intern->buffers = NULL; - intern->filename = NULL; - intern->buffers_cnt = 0; - intern->prop_handler = &zip_prop_handlers; - -#if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2)) - zend_object_std_init(&intern->zo, class_type TSRMLS_CC); -#else - ALLOC_HASHTABLE(intern->zo.properties); - zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); - intern->zo.ce = class_type; -#endif - - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, - (void *) &tmp, sizeof(zval *)); - - retval.handle = zend_objects_store_put(intern, - NULL, - (zend_objects_free_object_storage_t) php_zip_object_free_storage, - NULL TSRMLS_CC); - - retval.handlers = (zend_object_handlers *) & zip_object_handlers; - - return retval; -} -/* }}} */ -#endif - -/* {{{ Resource dtors */ - -/* {{{ php_zip_free_dir */ -static void php_zip_free_dir(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - zip_rsrc * zip_int = (zip_rsrc *) rsrc->ptr; - - if (zip_int) { - if (zip_int->za) { - if (zip_close(zip_int->za) != 0) { - _zip_free(zip_int->za); - } - zip_int->za = NULL; - } - - efree(rsrc->ptr); - - rsrc->ptr = NULL; - } -} -/* }}} */ - -/* {{{ php_zip_free_entry */ -static void php_zip_free_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - zip_read_rsrc *zr_rsrc = (zip_read_rsrc *) rsrc->ptr; - - if (zr_rsrc) { - if (zr_rsrc->zf) { - zip_fclose(zr_rsrc->zf); - zr_rsrc->zf = NULL; - } - efree(zr_rsrc); - rsrc->ptr = NULL; - } -} -/* }}} */ - -/* }}}*/ - -/* reset macro */ - -/* {{{ function prototypes */ -static PHP_MINIT_FUNCTION(zip); -static PHP_MSHUTDOWN_FUNCTION(zip); -static PHP_MINFO_FUNCTION(zip); -/* }}} */ - -/* {{{ zip_module_entry - */ -zend_module_entry zip_module_entry = { - STANDARD_MODULE_HEADER, - "zip", - zip_functions, - PHP_MINIT(zip), - PHP_MSHUTDOWN(zip), - NULL, - NULL, - PHP_MINFO(zip), - PHP_ZIP_VERSION_STRING, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_ZIP -ZEND_GET_MODULE(zip) -#endif -/* set macro */ - -/* {{{ proto resource zip_open(string filename) -Create new zip using source uri for output */ -static PHP_NAMED_FUNCTION(zif_zip_open) -{ - char *filename; - int filename_len; - char resolved_path[MAXPATHLEN + 1]; - zip_rsrc *rsrc_int; - int err = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { - return; - } - - if (filename_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source"); - RETURN_FALSE; - } - - if (OPENBASEDIR_CHECKPATH(filename)) { - RETURN_FALSE; - } - - if(!expand_filepath(filename, resolved_path TSRMLS_CC)) { - RETURN_FALSE; - } - - rsrc_int = (zip_rsrc *)emalloc(sizeof(zip_rsrc)); - - rsrc_int->za = zip_open(resolved_path, 0, &err); - if (rsrc_int->za == NULL) { - efree(rsrc_int); - RETURN_LONG((long)err); - } - - rsrc_int->index_current = 0; - rsrc_int->num_files = zip_get_num_files(rsrc_int->za); - - ZEND_REGISTER_RESOURCE(return_value, rsrc_int, le_zip_dir); -} -/* }}} */ - -/* {{{ proto void zip_close(resource zip) - Close a Zip archive */ -static PHP_NAMED_FUNCTION(zif_zip_close) -{ - zval * zip; - zip_rsrc *z_rsrc = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(z_rsrc, zip_rsrc *, &zip, -1, le_zip_dir_name, le_zip_dir); - - /* really close the zip will break BC :-D */ - zend_list_delete(Z_LVAL_P(zip)); -} -/* }}} */ - -/* {{{ proto resource zip_read(resource zip) - Returns the next file in the archive */ -static PHP_NAMED_FUNCTION(zif_zip_read) -{ - zval *zip_dp; - zip_read_rsrc *zr_rsrc; - int ret; - zip_rsrc *rsrc_int; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_dp) == FAILURE) { - return; - } - ZEND_FETCH_RESOURCE(rsrc_int, zip_rsrc *, &zip_dp, -1, le_zip_dir_name, le_zip_dir); - - if (rsrc_int && rsrc_int->za) { - if (rsrc_int->index_current >= rsrc_int->num_files) { - RETURN_FALSE; - } - - zr_rsrc = emalloc(sizeof(zip_read_rsrc)); - - ret = zip_stat_index(rsrc_int->za, rsrc_int->index_current, 0, &zr_rsrc->sb); - - if (ret != 0) { - efree(zr_rsrc); - RETURN_FALSE; - } - - zr_rsrc->zf = zip_fopen_index(rsrc_int->za, rsrc_int->index_current, 0); - if (zr_rsrc->zf) { - rsrc_int->index_current++; - ZEND_REGISTER_RESOURCE(return_value, zr_rsrc, le_zip_entry); - } else { - efree(zr_rsrc); - RETURN_FALSE; - } - - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool zip_entry_open(resource zip_dp, resource zip_entry [, string mode]) - Open a Zip File, pointed by the resource entry */ -/* Dummy function to follow the old API */ -static PHP_NAMED_FUNCTION(zif_zip_entry_open) -{ - zval * zip; - zval * zip_entry; - char *mode; - int mode_len; - zip_read_rsrc * zr_rsrc; - zip_rsrc *z_rsrc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|s", &zip, &zip_entry, &mode, &mode_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry); - ZEND_FETCH_RESOURCE(z_rsrc, zip_rsrc *, &zip, -1, le_zip_dir_name, le_zip_dir); - - if (zr_rsrc->zf != NULL) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto void zip_entry_close(resource zip_ent) - Close a zip entry */ -/* another dummy function to fit in the old api*/ -static PHP_NAMED_FUNCTION(zif_zip_entry_close) -{ - zval * zip_entry; - zip_read_rsrc * zr_rsrc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_entry) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry); - /* we got a zip_entry resource, be happy */ - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed zip_entry_read(resource zip_entry [, int len]) - Read from an open directory entry */ -static PHP_NAMED_FUNCTION(zif_zip_entry_read) -{ - zval * zip_entry; - long len = 0; - zip_read_rsrc * zr_rsrc; - char *buffer; - int n = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zip_entry, &len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry); - - if (len <= 0) { - len = 1024; - } - - if (zr_rsrc->zf) { - buffer = safe_emalloc(len, 1, 1); - n = zip_fread(zr_rsrc->zf, buffer, len); - if (n > 0) { - buffer[n] = 0; - RETURN_STRINGL(buffer, n, 0); - } else { - efree(buffer); - RETURN_EMPTY_STRING() - } - } else { - RETURN_FALSE; - } -} -/* }}} */ - -static void php_zip_entry_get_info(INTERNAL_FUNCTION_PARAMETERS, int opt) /* {{{ */ -{ - zval * zip_entry; - zip_read_rsrc * zr_rsrc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_entry) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry); - - if (!zr_rsrc->zf) { - RETURN_FALSE; - } - - switch (opt) { - case 0: - RETURN_STRING((char *)zr_rsrc->sb.name, 1); - break; - case 1: - RETURN_LONG((long) (zr_rsrc->sb.comp_size)); - break; - case 2: - RETURN_LONG((long) (zr_rsrc->sb.size)); - break; - case 3: - switch (zr_rsrc->sb.comp_method) { - case 0: - RETURN_STRING("stored", 1); - break; - case 1: - RETURN_STRING("shrunk", 1); - break; - case 2: - case 3: - case 4: - case 5: - RETURN_STRING("reduced", 1); - break; - case 6: - RETURN_STRING("imploded", 1); - break; - case 7: - RETURN_STRING("tokenized", 1); - break; - case 8: - RETURN_STRING("deflated", 1); - break; - case 9: - RETURN_STRING("deflatedX", 1); - break; - case 10: - RETURN_STRING("implodedX", 1); - break; - default: - RETURN_FALSE; - } - RETURN_LONG((long) (zr_rsrc->sb.comp_method)); - break; - } - -} -/* }}} */ - -/* {{{ proto string zip_entry_name(resource zip_entry) - Return the name given a ZZip entry */ -static PHP_NAMED_FUNCTION(zif_zip_entry_name) -{ - php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int zip_entry_compressedsize(resource zip_entry) - Return the compressed size of a ZZip entry */ -static PHP_NAMED_FUNCTION(zif_zip_entry_compressedsize) -{ - php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int zip_entry_filesize(resource zip_entry) - Return the actual filesize of a ZZip entry */ -static PHP_NAMED_FUNCTION(zif_zip_entry_filesize) -{ - php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2); -} -/* }}} */ - -/* {{{ proto string zip_entry_compressionmethod(resource zip_entry) - Return a string containing the compression method used on a particular entry */ -static PHP_NAMED_FUNCTION(zif_zip_entry_compressionmethod) -{ - php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); -} -/* }}} */ - -#ifdef PHP_ZIP_USE_OO -/* {{{ proto mixed ZipArchive::open(string source [, int flags]) -Create new zip using source uri for output, return TRUE on success or the error code */ -static ZIPARCHIVE_METHOD(open) -{ - struct zip *intern; - char *filename; - int filename_len; - int err = 0; - long flags = 0; - char resolved_path[MAXPATHLEN]; - - zval *this = getThis(); - ze_zip_object *ze_obj = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) { - return; - } - - if (this) { - /* We do not use ZIP_FROM_OBJECT, zip init function here */ - ze_obj = (ze_zip_object*) zend_object_store_get_object(this TSRMLS_CC); - } - - if (filename_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source"); - RETURN_FALSE; - } - - if (OPENBASEDIR_CHECKPATH(filename)) { - RETURN_FALSE; - } - - if (!expand_filepath(filename, resolved_path TSRMLS_CC)) { - RETURN_FALSE; - } - - if (ze_obj->za) { - /* we already have an opened zip, free it */ - if (zip_close(ze_obj->za) != 0) { - _zip_free(ze_obj->za); - } - ze_obj->za = NULL; - } - if (ze_obj->filename) { - efree(ze_obj->filename); - ze_obj->filename = NULL; - } - - intern = zip_open(resolved_path, flags, &err); - if (!intern || err) { - RETURN_LONG((long)err); - } - ze_obj->filename = estrdup(resolved_path); - ze_obj->filename_len = filename_len; - ze_obj->za = intern; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ZipArchive::close() -close the zip archive */ -static ZIPARCHIVE_METHOD(close) -{ - struct zip *intern; - zval *this = getThis(); - ze_zip_object *ze_obj; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - ze_obj = (ze_zip_object*) zend_object_store_get_object(this TSRMLS_CC); - - if (zip_close(intern)) { - RETURN_FALSE; - } - - efree(ze_obj->filename); - ze_obj->filename = NULL; - ze_obj->filename_len = 0; - ze_obj->za = NULL; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string ZipArchive::getStatusString() - * Returns the status error message, system and/or zip messages */ -static ZIPARCHIVE_METHOD(getStatusString) -{ - struct zip *intern; - zval *this = getThis(); - int zep, syp, len; - char error_string[128]; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - zip_error_get(intern, &zep, &syp); - - len = zip_error_to_str(error_string, 128, zep, syp); - RETVAL_STRINGL(error_string, len, 1); -} -/* }}} */ - -/* {{{ proto bool ZipArchive::createEmptyDir(string dirname) -Returns the index of the entry named filename in the archive */ -static ZIPARCHIVE_METHOD(addEmptyDir) -{ - struct zip *intern; - zval *this = getThis(); - char *dirname; - int dirname_len; - int idx; - struct zip_stat sb; - char *s; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", - &dirname, &dirname_len) == FAILURE) { - return; - } - - if (dirname_len<1) { - RETURN_FALSE; - } - - if (dirname[dirname_len-1] != '/') { - s=(char *)emalloc(dirname_len+2); - strcpy(s, dirname); - s[dirname_len] = '/'; - s[dirname_len+1] = '\0'; - } else { - s = dirname; - } - - idx = zip_stat(intern, s, 0, &sb); - if (idx >= 0) { - RETVAL_FALSE; - } else { - if (zip_add_dir(intern, (const char *)s) == -1) { - RETVAL_FALSE; - } - RETVAL_TRUE; - } - - if (s != dirname) { - efree(s); - } -} -/* }}} */ - -/* {{{ proto bool ZipArchive::addFile(string filepath[, string entryname[, int start [, int length]]]) -Add a file in a Zip archive using its path and the name to use. */ -static ZIPARCHIVE_METHOD(addFile) -{ - struct zip *intern; - zval *this = getThis(); - char *filename; - int filename_len; - char *entry_name = NULL; - int entry_name_len = 0; - long offset_start = 0, offset_len = 0; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sll", - &filename, &filename_len, &entry_name, &entry_name_len, &offset_start, &offset_len) == FAILURE) { - return; - } - - if (filename_len == 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as filename"); - RETURN_FALSE; - } - - if (entry_name_len == 0) { - entry_name = filename; - entry_name_len = filename_len; - } - - if (php_zip_add_file(intern, filename, filename_len, - entry_name, entry_name_len, 0, 0 TSRMLS_CC) < 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool ZipArchive::addFromString(string name, string content) -Add a file using content and the entry name */ -static ZIPARCHIVE_METHOD(addFromString) -{ - struct zip *intern; - zval *this = getThis(); - char *buffer, *name; - int buffer_len, name_len; - ze_zip_object *ze_obj; - struct zip_source *zs; - int pos = 0; - int cur_idx; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &buffer, &buffer_len) == FAILURE) { - return; - } - - ze_obj = (ze_zip_object*) zend_object_store_get_object(this TSRMLS_CC); - if (ze_obj->buffers_cnt) { - ze_obj->buffers = (char **)erealloc(ze_obj->buffers, sizeof(char *) * (ze_obj->buffers_cnt+1)); - pos = ze_obj->buffers_cnt++; - } else { - ze_obj->buffers = (char **)emalloc(sizeof(char *)); - ze_obj->buffers_cnt++; - pos = 0; - } - ze_obj->buffers[pos] = (char *)emalloc(buffer_len + 1); - memcpy(ze_obj->buffers[pos], buffer, buffer_len + 1); - - zs = zip_source_buffer(intern, ze_obj->buffers[pos], buffer_len, 0); - - if (zs == NULL) { - RETURN_FALSE; - } - - cur_idx = zip_name_locate(intern, (const char *)name, 0); - /* TODO: fix _zip_replace */ - if (cur_idx >= 0) { - if (zip_delete(intern, cur_idx) == -1) { - RETURN_FALSE; - } - } - - if (zip_add(intern, name, zs) == -1) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto array ZipArchive::statName(string filename[, int flags]) -Returns the information about a the zip entry filename */ -static ZIPARCHIVE_METHOD(statName) -{ - struct zip *intern; - zval *this = getThis(); - char *name; - int name_len; - long flags = 0; - struct zip_stat sb; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", - &name, &name_len, &flags) == FAILURE) { - return; - } - - PHP_ZIP_STAT_PATH(intern, name, name_len, flags, sb); - - RETURN_SB(&sb); -} -/* }}} */ - -/* {{{ proto resource ZipArchive::statIndex(int index[, int flags]) -Returns the zip entry informations using its index */ -static ZIPARCHIVE_METHOD(statIndex) -{ - struct zip *intern; - zval *this = getThis(); - long index, flags = 0; - - struct zip_stat sb; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", - &index, &flags) == FAILURE) { - return; - } - - if (zip_stat_index(intern, index, flags, &sb) != 0) { - RETURN_FALSE; - } - RETURN_SB(&sb); -} -/* }}} */ - -/* {{{ proto int ZipArchive::locateName(string filename[, int flags]) -Returns the index of the entry named filename in the archive */ -static ZIPARCHIVE_METHOD(locateName) -{ - struct zip *intern; - zval *this = getThis(); - char *name; - int name_len; - long flags = 0; - long idx = -1; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", - &name, &name_len, &flags) == FAILURE) { - return; - } - if (name_len<1) { - RETURN_FALSE; - } - - idx = (long)zip_name_locate(intern, (const char *)name, flags); - - if (idx >= 0) { - RETURN_LONG(idx); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string ZipArchive::getNameIndex(int index [, int flags]) -Returns the name of the file at position index */ -static ZIPARCHIVE_METHOD(getNameIndex) -{ - struct zip *intern; - zval *this = getThis(); - const char *name; - long flags = 0, index = 0; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", - &index, &flags) == FAILURE) { - return; - } - - name = zip_get_name(intern, (int) index, flags); - - if (name) { - RETVAL_STRING((char *)name, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool ZipArchive::setArchiveComment(string name, string comment) -Set or remove (NULL/'') the comment of the archive */ -static ZIPARCHIVE_METHOD(setArchiveComment) -{ - struct zip *intern; - zval *this = getThis(); - int comment_len; - char * comment; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &comment, &comment_len) == FAILURE) { - return; - } - if (zip_set_archive_comment(intern, (const char *)comment, (int)comment_len)) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto string ZipArchive::getArchiveComment() -Returns the comment of an entry using its index */ -static ZIPARCHIVE_METHOD(getArchiveComment) -{ - struct zip *intern; - zval *this = getThis(); - long flags = 0; - const char * comment; - int comment_len = 0; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) { - return; - } - - comment = zip_get_archive_comment(intern, &comment_len, (int)flags); - RETURN_STRINGL((char *)comment, (long)comment_len, 1); -} -/* }}} */ - -/* {{{ proto bool ZipArchive::setCommentName(string name, string comment) -Set or remove (NULL/'') the comment of an entry using its Name */ -static ZIPARCHIVE_METHOD(setCommentName) -{ - struct zip *intern; - zval *this = getThis(); - int comment_len, name_len; - char * comment, *name; - int idx; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &name, &name_len, &comment, &comment_len) == FAILURE) { - return; - } - - if (name_len < 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name"); - } - - idx = zip_name_locate(intern, name, 0); - if (idx < 0) { - RETURN_FALSE; - } - PHP_ZIP_SET_FILE_COMMENT(intern, idx, comment, comment_len); -} -/* }}} */ - -/* {{{ proto bool ZipArchive::setCommentIndex(int index, string comment) -Set or remove (NULL/'') the comment of an entry using its index */ -static ZIPARCHIVE_METHOD(setCommentIndex) -{ - struct zip *intern; - zval *this = getThis(); - long index; - int comment_len; - char * comment; - struct zip_stat sb; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", - &index, &comment, &comment_len) == FAILURE) { - return; - } - - PHP_ZIP_STAT_INDEX(intern, index, 0, sb); - PHP_ZIP_SET_FILE_COMMENT(intern, index, comment, comment_len); -} -/* }}} */ - -/* {{{ proto string ZipArchive::getCommentName(string name) -Returns the comment of an entry using its name */ -static ZIPARCHIVE_METHOD(getCommentName) -{ - struct zip *intern; - zval *this = getThis(); - int name_len, idx; - long flags = 0; - int comment_len = 0; - const char * comment; - char *name; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", - &name, &name_len, &flags) == FAILURE) { - return; - } - if (name_len < 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name"); - RETURN_FALSE; - } - - idx = zip_name_locate(intern, name, 0); - if (idx < 0) { - RETURN_FALSE; - } - - comment = zip_get_file_comment(intern, idx, &comment_len, (int)flags); - RETURN_STRINGL((char *)comment, (long)comment_len, 1); -} -/* }}} */ - -/* {{{ proto string ZipArchive::getCommentIndex(int index) -Returns the comment of an entry using its index */ -static ZIPARCHIVE_METHOD(getCommentIndex) -{ - struct zip *intern; - zval *this = getThis(); - long index, flags = 0; - const char * comment; - int comment_len = 0; - struct zip_stat sb; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", - &index, &flags) == FAILURE) { - return; - } - - PHP_ZIP_STAT_INDEX(intern, index, 0, sb); - comment = zip_get_file_comment(intern, index, &comment_len, (int)flags); - RETURN_STRINGL((char *)comment, (long)comment_len, 1); -} -/* }}} */ - -/* {{{ proto bool ZipArchive::deleteIndex(int index) -Delete a file using its index */ -static ZIPARCHIVE_METHOD(deleteIndex) -{ - struct zip *intern; - zval *this = getThis(); - long index; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { - return; - } - - if (index < 0) { - RETURN_FALSE; - } - - if (zip_delete(intern, index) < 0) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ZipArchive::deleteName(string name) -Delete a file using its index */ -static ZIPARCHIVE_METHOD(deleteName) -{ - struct zip *intern; - zval *this = getThis(); - int name_len; - char *name; - struct zip_stat sb; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - if (name_len < 1) { - RETURN_FALSE; - } - - PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb); - if (zip_delete(intern, sb.index)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ZipArchive::renameIndex(int index, string new_name) -Rename an entry selected by its index to new_name */ -static ZIPARCHIVE_METHOD(renameIndex) -{ - struct zip *intern; - zval *this = getThis(); - - char *new_name; - int new_name_len; - long index; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &index, &new_name, &new_name_len) == FAILURE) { - return; - } - - if (index < 0) { - RETURN_FALSE; - } - - if (new_name_len < 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name"); - RETURN_FALSE; - } - if (zip_rename(intern, index, (const char *)new_name) != 0) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ZipArchive::renameName(string name, string new_name) -Rename an entry selected by its name to new_name */ -static ZIPARCHIVE_METHOD(renameName) -{ - struct zip *intern; - zval *this = getThis(); - struct zip_stat sb; - char *name, *new_name; - int name_len, new_name_len; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &new_name, &new_name_len) == FAILURE) { - return; - } - - if (new_name_len < 1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name"); - RETURN_FALSE; - } - - PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb); - - if (zip_rename(intern, sb.index, (const char *)new_name)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ZipArchive::unchangeIndex(int index) -Changes to the file at position index are reverted */ -static ZIPARCHIVE_METHOD(unchangeIndex) -{ - struct zip *intern; - zval *this = getThis(); - long index; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { - return; - } - - if (index < 0) { - RETURN_FALSE; - } - - if (zip_unchange(intern, index) != 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool ZipArchive::unchangeName(string name) -Changes to the file named 'name' are reverted */ -static ZIPARCHIVE_METHOD(unchangeName) -{ - struct zip *intern; - zval *this = getThis(); - struct zip_stat sb; - char *name; - int name_len; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - if (name_len < 1) { - RETURN_FALSE; - } - - PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb); - - if (zip_unchange(intern, sb.index) != 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool ZipArchive::unchangeAll() -All changes to files and global information in archive are reverted */ -static ZIPARCHIVE_METHOD(unchangeAll) -{ - struct zip *intern; - zval *this = getThis(); - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zip_unchange_all(intern) != 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool ZipArchive::unchangeAll() -Revert all global changes to the archive archive. For now, this only reverts archive comment changes. */ -static ZIPARCHIVE_METHOD(unchangeArchive) -{ - struct zip *intern; - zval *this = getThis(); - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zip_unchange_archive(intern) != 0) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool ZipArchive::extractTo(string pathto[, mixed files]) -Extract one or more file from a zip archive */ -/* TODO: - * - allow index or array of indeces - * - replace path - * - patterns - */ -static ZIPARCHIVE_METHOD(extractTo) -{ - struct zip *intern; - - zval *this = getThis(); - zval *zval_files = NULL; - zval **zval_file = NULL; - php_stream_statbuf ssb; - char *pathto; - int pathto_len; - int ret, i; - - int nelems; - - if (!this) { - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &pathto, &pathto_len, &zval_files) == FAILURE) { - return; - } - - if (pathto_len < 1) { - RETURN_FALSE; - } - - if (php_stream_stat_path(pathto, &ssb) < 0) { - ret = php_stream_mkdir(pathto, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL); - if (!ret) { - RETURN_FALSE; - } - } - - ZIP_FROM_OBJECT(intern, this); - if (zval_files && (Z_TYPE_P(zval_files) != IS_NULL)) { - switch (Z_TYPE_P(zval_files)) { - case IS_STRING: - if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_files), Z_STRLEN_P(zval_files) TSRMLS_CC)) { - RETURN_FALSE; - } - break; - case IS_ARRAY: - nelems = zend_hash_num_elements(Z_ARRVAL_P(zval_files)); - if (nelems == 0 ) { - RETURN_FALSE; - } - for (i = 0; i < nelems; i++) { - if (zend_hash_index_find(Z_ARRVAL_P(zval_files), i, (void **) &zval_file) == SUCCESS) { - switch (Z_TYPE_PP(zval_file)) { - case IS_LONG: - break; - case IS_STRING: - if (!php_zip_extract_file(intern, pathto, Z_STRVAL_PP(zval_file), Z_STRLEN_PP(zval_file) TSRMLS_CC)) { - RETURN_FALSE; - } - break; - } - } - } - break; - case IS_LONG: - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or array of strings"); - break; - } - } else { - /* Extract all files */ - int filecount = zip_get_num_files(intern); - - if (filecount == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal archive"); - RETURN_FALSE; - } - - for (i = 0; i < filecount; i++) { - char *file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED); - if (!php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) { - RETURN_FALSE; - } - } - } - RETURN_TRUE; -} -/* }}} */ - -static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ -{ - struct zip *intern; - zval *this = getThis(); - - struct zip_stat sb; - struct zip_file *zf; - - char *filename; - int filename_len; - long index = -1; - long flags = 0; - long len = 0; - - char *buffer; - int n = 0; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (type == 1) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &len, &flags) == FAILURE) { - return; - } - PHP_ZIP_STAT_PATH(intern, filename, filename_len, flags, sb); - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ll", &index, &len, &flags) == FAILURE) { - return; - } - PHP_ZIP_STAT_INDEX(intern, index, 0, sb); - } - - if (sb.size < 1) { - RETURN_EMPTY_STRING(); - } - - if (len < 1) { - len = sb.size; - } - if (index >= 0) { - zf = zip_fopen_index(intern, index, flags); - } else { - zf = zip_fopen(intern, filename, flags); - } - - if (zf == NULL) { - RETURN_FALSE; - } - - buffer = safe_emalloc(len, 1, 2); - n = zip_fread(zf, buffer, len); - if (n < 1) { - efree(buffer); - RETURN_EMPTY_STRING(); - } - - zip_fclose(zf); - buffer[n] = 0; - RETURN_STRINGL(buffer, n, 0); -} -/* }}} */ - -/* {{{ proto string ZipArchive::getFromName(string entryname[, int len [, int flags]]) -get the contents of an entry using its name */ -static ZIPARCHIVE_METHOD(getFromName) -{ - php_zip_get_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto string ZipArchive::getFromIndex(string entryname[, int len [, int flags]]) -get the contents of an entry using its index */ -static ZIPARCHIVE_METHOD(getFromIndex) -{ - php_zip_get_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto resource ZipArchive::getStream(string entryname) -get a stream for an entry using its name */ -static ZIPARCHIVE_METHOD(getStream) -{ - struct zip *intern; - zval *this = getThis(); - struct zip_stat sb; - char *filename; - int filename_len; - char *mode = "rb"; - php_stream *stream; - ze_zip_object *obj; - - if (!this) { - RETURN_FALSE; - } - - ZIP_FROM_OBJECT(intern, this); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { - return; - } - - if (zip_stat(intern, filename, 0, &sb) != 0) { - RETURN_FALSE; - } - - obj = (ze_zip_object*) zend_object_store_get_object(this TSRMLS_CC); - - stream = php_stream_zip_open(obj->filename, filename, mode STREAMS_CC TSRMLS_CC); - if (stream) { - php_stream_to_zval(stream, return_value); - } -} -/* }}} */ - -/* {{{ ze_zip_object_class_functions */ -static zend_function_entry zip_class_functions[] = { - ZIPARCHIVE_ME(open, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(close, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getStatusString, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(addEmptyDir, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(addFromString, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(addFile, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(renameIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(renameName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(setArchiveComment, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getArchiveComment, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(setCommentIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(setCommentName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getCommentIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getCommentName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(deleteIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(deleteName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(statName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(statIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(locateName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getNameIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(unchangeArchive, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(unchangeAll, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(unchangeIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(unchangeName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(extractTo, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getFromName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getFromIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getStream, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; -/* }}} */ -#endif - -/* {{{ PHP_MINIT_FUNCTION */ -static PHP_MINIT_FUNCTION(zip) -{ - zend_class_entry ce; - - memcpy(&zip_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - zip_object_handlers.clone_obj = NULL; - zip_object_handlers.get_property_ptr_ptr = php_zip_get_property_ptr_ptr; - - zip_object_handlers.get_properties = php_zip_get_properties; - zip_object_handlers.read_property = php_zip_read_property; - zip_object_handlers.has_property = php_zip_has_property; - - INIT_CLASS_ENTRY(ce, "ZipArchive", zip_class_functions); - ce.create_object = php_zip_object_new; - zip_class_entry = zend_register_internal_class(&ce TSRMLS_CC); - - zend_hash_init(&zip_prop_handlers, 0, NULL, NULL, 1); - php_zip_register_prop_handler(&zip_prop_handlers, "status", php_zip_status, NULL, NULL, IS_LONG TSRMLS_CC); - php_zip_register_prop_handler(&zip_prop_handlers, "statusSys", php_zip_status_sys, NULL, NULL, IS_LONG TSRMLS_CC); - php_zip_register_prop_handler(&zip_prop_handlers, "numFiles", php_zip_get_num_files, NULL, NULL, IS_LONG TSRMLS_CC); - php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, php_zipobj_get_filename, IS_STRING TSRMLS_CC); - php_zip_register_prop_handler(&zip_prop_handlers, "comment", NULL, php_zipobj_get_zip_comment, NULL, IS_STRING TSRMLS_CC); - - REGISTER_ZIP_CLASS_CONST_LONG("CREATE", ZIP_CREATE); - REGISTER_ZIP_CLASS_CONST_LONG("EXCL", ZIP_EXCL); - REGISTER_ZIP_CLASS_CONST_LONG("CHECKCONS", ZIP_CHECKCONS); - REGISTER_ZIP_CLASS_CONST_LONG("OVERWRITE", ZIP_OVERWRITE); - - REGISTER_ZIP_CLASS_CONST_LONG("FL_NOCASE", ZIP_FL_NOCASE); - REGISTER_ZIP_CLASS_CONST_LONG("FL_NODIR", ZIP_FL_NODIR); - REGISTER_ZIP_CLASS_CONST_LONG("FL_COMPRESSED", ZIP_FL_COMPRESSED); - REGISTER_ZIP_CLASS_CONST_LONG("FL_UNCHANGED", ZIP_FL_UNCHANGED); - REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFAULT", ZIP_CM_DEFAULT); - REGISTER_ZIP_CLASS_CONST_LONG("CM_STORE", ZIP_CM_STORE); - REGISTER_ZIP_CLASS_CONST_LONG("CM_SHRINK", ZIP_CM_SHRINK); - REGISTER_ZIP_CLASS_CONST_LONG("CM_REDUCE_1", ZIP_CM_REDUCE_1); - REGISTER_ZIP_CLASS_CONST_LONG("CM_REDUCE_2", ZIP_CM_REDUCE_2); - REGISTER_ZIP_CLASS_CONST_LONG("CM_REDUCE_3", ZIP_CM_REDUCE_3); - REGISTER_ZIP_CLASS_CONST_LONG("CM_REDUCE_4", ZIP_CM_REDUCE_4); - REGISTER_ZIP_CLASS_CONST_LONG("CM_IMPLODE", ZIP_CM_IMPLODE); - REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE", ZIP_CM_DEFLATE); - REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE64", ZIP_CM_DEFLATE64); - REGISTER_ZIP_CLASS_CONST_LONG("CM_PKWARE_IMPLODE", ZIP_CM_PKWARE_IMPLODE); - - /* Error code */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_OK", ZIP_ER_OK); /* N No error */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_MULTIDISK", ZIP_ER_MULTIDISK); /* N Multi-disk zip archives not supported */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_RENAME", ZIP_ER_RENAME); /* S Renaming temporary file failed */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_CLOSE", ZIP_ER_CLOSE); /* S Closing zip archive failed */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_SEEK", ZIP_ER_SEEK); /* S Seek error */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_READ", ZIP_ER_READ); /* S Read error */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_WRITE", ZIP_ER_WRITE); /* S Write error */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_CRC", ZIP_ER_CRC); /* N CRC error */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_ZIPCLOSED", ZIP_ER_ZIPCLOSED); /* N Containing zip archive was closed */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_NOENT", ZIP_ER_NOENT); /* N No such file */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_EXISTS", ZIP_ER_EXISTS); /* N File already exists */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_OPEN", ZIP_ER_OPEN); /* S Can't open file */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_TMPOPEN", ZIP_ER_TMPOPEN); /* S Failure to create temporary file */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_ZLIB", ZIP_ER_ZLIB); /* Z Zlib error */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_MEMORY", ZIP_ER_MEMORY); /* N Malloc failure */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_CHANGED", ZIP_ER_CHANGED); /* N Entry has been changed */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_COMPNOTSUPP", ZIP_ER_COMPNOTSUPP);/* N Compression method not supported */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_EOF", ZIP_ER_EOF); /* N Premature EOF */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_INVAL", ZIP_ER_INVAL); /* N Invalid argument */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_NOZIP", ZIP_ER_NOZIP); /* N Not a zip archive */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_INTERNAL", ZIP_ER_INTERNAL); /* N Internal error */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_INCONS", ZIP_ER_INCONS); /* N Zip archive inconsistent */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_REMOVE", ZIP_ER_REMOVE); /* S Can't remove file */ - REGISTER_ZIP_CLASS_CONST_LONG("ER_DELETED", ZIP_ER_DELETED); /* N Entry has been deleted */ - - php_register_url_stream_wrapper("zip", &php_stream_zip_wrapper TSRMLS_CC); - - le_zip_dir = zend_register_list_destructors_ex(php_zip_free_dir, NULL, le_zip_dir_name, module_number); - le_zip_entry = zend_register_list_destructors_ex(php_zip_free_entry, NULL, le_zip_entry_name, module_number); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -static PHP_MSHUTDOWN_FUNCTION(zip) -{ - zend_hash_destroy(&zip_prop_handlers); - php_unregister_url_stream_wrapper("zip" TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -static PHP_MINFO_FUNCTION(zip) -{ - php_info_print_table_start(); - - php_info_print_table_row(2, "Zip", "enabled"); - php_info_print_table_row(2, "Extension Version","$Id$"); - php_info_print_table_row(2, "Zip version", PHP_ZIP_VERSION_STRING); - php_info_print_table_row(2, "Libzip version", "0.9.0"); - - php_info_print_table_end(); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h deleted file mode 100644 index 8f6bac0e2df1a..0000000000000 --- a/ext/zip/php_zip.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Pierre-Alain Joye | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_ZIP_H -#define PHP_ZIP_H - -extern zend_module_entry zip_module_entry; -#define phpext_zip_ptr &zip_module_entry - -#ifdef ZTS -#include "TSRM.h" -#endif - -#include "lib/zip.h" - -#define PHP_ZIP_VERSION_STRING "1.8.11" - -#if ((PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6) -# define PHP_ZIP_USE_OO 1 -#endif - -#ifndef Z_SET_REFCOUNT_P -# if PHP_MAJOR_VERSION < 6 && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3) -# define Z_SET_REFCOUNT_P(pz, rc) pz->refcount = rc -# define Z_UNSET_ISREF_P(pz) pz->is_ref = 0 -# endif -#endif - -/* {{{ OPENBASEDIR_CHECKPATH(filename) */ -#if (PHP_MAJOR_VERSION < 6) -#define OPENBASEDIR_CHECKPATH(filename) \ - (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC) -#else -#define OPENBASEDIR_CHECKPATH(filename) \ - php_check_open_basedir(filename TSRMLS_CC) -#endif -/* }}} */ - -typedef struct _ze_zip_rsrc { - struct zip *za; - int index_current; - int num_files; -} zip_rsrc; - -typedef zip_rsrc * zip_rsrc_ptr; - -typedef struct _ze_zip_read_rsrc { - struct zip_file *zf; - struct zip_stat sb; -} zip_read_rsrc; - -#ifdef PHP_ZIP_USE_OO -#define ZIPARCHIVE_ME(name, arg_info, flags) ZEND_FENTRY(name, c_ziparchive_ ##name, arg_info, flags) -#define ZIPARCHIVE_METHOD(name) ZEND_NAMED_FUNCTION(c_ziparchive_##name) - -/* Extends zend object */ -typedef struct _ze_zip_object { - zend_object zo; - struct zip *za; - int buffers_cnt; - char **buffers; - HashTable *prop_handler; - char *filename; - int filename_len; -} ze_zip_object; - -php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -php_stream *php_stream_zip_open(char *filename, char *path, char *mode STREAMS_DC TSRMLS_DC); - -extern php_stream_wrapper php_stream_zip_wrapper; -#endif - -#endif /* PHP_ZIP_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/zip/tests/001.phpt b/ext/zip/tests/001.phpt deleted file mode 100644 index 37dccc055e08c..0000000000000 --- a/ext/zip/tests/001.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Check for zip presence ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -zip extension is available diff --git a/ext/zip/tests/binarynull.zip b/ext/zip/tests/binarynull.zip deleted file mode 100644 index 9da004efed082..0000000000000 Binary files a/ext/zip/tests/binarynull.zip and /dev/null differ diff --git a/ext/zip/tests/bug11216.phpt b/ext/zip/tests/bug11216.phpt deleted file mode 100644 index 607217ad7233a..0000000000000 --- a/ext/zip/tests/bug11216.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #11216 (::addEmptyDir() crashes when the directory already exists) ---SKIPIF-- - ---FILE-- -open('__test.zip', ZIPARCHIVE::CREATE); -var_dump($archive->addEmptyDir('test')); -print_r($archive); -var_dump($archive->addEmptyDir('test')); -$archive->close(); -unlink('__test.zip'); -?> ---EXPECT-- -bool(true) -ZipArchive Object -( - [status] => 0 - [statusSys] => 0 - [numFiles] => 1 - [filename] => - [comment] => -) -bool(false) diff --git a/ext/zip/tests/bug14962.phpt b/ext/zip/tests/bug14962.phpt deleted file mode 100644 index 0006fd4b68303..0000000000000 --- a/ext/zip/tests/bug14962.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #14962 (::extractTo second argument is not really optional) ---SKIPIF-- - ---FILE-- -open($dir . '/__14962.zip', ZIPARCHIVE::CREATE); -$za->addFromString($file, '1234'); -$za->close(); - -if (!is_file($dir . "/__14962.zip")) { - die('failed to create the archive'); -} -$za = new ZipArchive; -$za->open($dir . '/__14962.zip'); -$za->extractTo($dir, NULL); -$za->close(); - -if (is_file($fullpath)) { - unlink($fullpath); - echo "Ok"; -} -unlink($dir . '/' . '__14962.zip'); -?> ---EXPECT-- -Ok diff --git a/ext/zip/tests/bug38943.inc b/ext/zip/tests/bug38943.inc deleted file mode 100644 index a6f45e8294eff..0000000000000 --- a/ext/zip/tests/bug38943.inc +++ /dev/null @@ -1,16 +0,0 @@ -testarray[] = 1; - var_dump($this->testarray); - } -} - -$z = new myZip; -$z->testp = "foobar"; -var_dump($z); - diff --git a/ext/zip/tests/bug38943.phpt b/ext/zip/tests/bug38943.phpt deleted file mode 100644 index 02985848dc2e3..0000000000000 --- a/ext/zip/tests/bug38943.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -#38943, properties in extended class cannot be set (< 5.3) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(1) { - [0]=> - int(1) -} -object(myZip)#1 (%d) { - ["test:private"]=> - int(0) - ["testp"]=> - string(6) "foobar" - ["testarray:private"]=> - array(1) { - [0]=> - int(1) - } - ["status"]=> - int(0) - ["statusSys"]=> - int(0) - ["numFiles"]=> - int(0) - ["filename"]=> - string(0) "" - ["comment"]=> - string(0) "" -} diff --git a/ext/zip/tests/bug38943_2.phpt b/ext/zip/tests/bug38943_2.phpt deleted file mode 100644 index 8672d9d329138..0000000000000 --- a/ext/zip/tests/bug38943_2.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -#38943, properties in extended class cannot be set (5.3) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(1) { - [0]=> - int(1) -} -object(myZip)#1 (%d) { - ["test":"myZip":private]=> - int(0) - ["testp"]=> - string(6) "foobar" - ["testarray":"myZip":private]=> - array(1) { - [0]=> - int(1) - } - ["status"]=> - int(0) - ["statusSys"]=> - int(0) - ["numFiles"]=> - int(0) - ["filename"]=> - string(0) "" - ["comment"]=> - string(0) "" -} diff --git a/ext/zip/tests/bug38944.phpt b/ext/zip/tests/bug38944.phpt deleted file mode 100644 index ee12fad2b39ec..0000000000000 --- a/ext/zip/tests/bug38944.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #38944 (newly created ZipArchive segfaults when accessing comment property) ---SKIPIF-- - ---FILE-- -open($arc_name, ZIPARCHIVE::CREATE);; - -var_dump($foo->status); -var_dump($foo->statusSys); -var_dump($foo->numFiles); -var_dump($foo->filename); -var_dump($foo->comment); - -var_dump($foo); - -echo "Done\n"; -?> ---EXPECTF-- -int(0) -int(0) -int(0) -string(0) "" -string(0) "" -object(ZipArchive)#%d (5) { - ["status"]=> - int(0) - ["statusSys"]=> - int(0) - ["numFiles"]=> - int(0) - ["filename"]=> - string(0) "" - ["comment"]=> - string(0) "" -} -Done diff --git a/ext/zip/tests/bug40228.phpt b/ext/zip/tests/bug40228.phpt deleted file mode 100644 index fec29636396d4..0000000000000 --- a/ext/zip/tests/bug40228.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #40228 (extractTo does not create recursive empty path) ---SKIPIF-- - ---FILE-- -open($arc_name, ZIPARCHIVE::CREATE);; -$zip->extractTo($dest); -if (is_dir($dest . '/test/empty')) { - echo "Ok\n"; - rmdir($dest . '/test/empty'); - rmdir($dest . '/test'); -} else { - echo "Failed.\n"; -} -echo "Done\n"; -?> ---EXPECT-- -Ok -Done diff --git a/ext/zip/tests/bug40228.zip b/ext/zip/tests/bug40228.zip deleted file mode 100644 index bbcd9515f88dc..0000000000000 Binary files a/ext/zip/tests/bug40228.zip and /dev/null differ diff --git a/ext/zip/tests/bug7214.phpt b/ext/zip/tests/bug7214.phpt deleted file mode 100644 index f791b7940dda7..0000000000000 --- a/ext/zip/tests/bug7214.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #7214 (zip_entry_read() binary safe) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Ok diff --git a/ext/zip/tests/bug7658.odt b/ext/zip/tests/bug7658.odt deleted file mode 100644 index 527e09fefcefc..0000000000000 Binary files a/ext/zip/tests/bug7658.odt and /dev/null differ diff --git a/ext/zip/tests/bug7658.phpt b/ext/zip/tests/bug7658.phpt deleted file mode 100644 index 56fd00fbab41b..0000000000000 --- a/ext/zip/tests/bug7658.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Bug #7658 (modify archive with general bit flag 3 set) ---SKIPIF-- - ---FILE-- -open($file)) { - echo 'failed'; -} - - -$zip->deleteName('content.xml'); -$zip->addFile($dirname . "bug7658.xml","content.xml"); -$zip->close(); -echo "\n"; -$zip->open($file); - -for($i=0; $i < $zip->numFiles; $i++) { - $sb = $zip->statIndex($i); - $found[] = $sb['name']; -} -$ar = array_diff($found, $expect); - -var_dump($ar); -unset($zip); -unlink($file); -?> ---EXPECTF-- -array(0) { -} diff --git a/ext/zip/tests/bug7658.xml b/ext/zip/tests/bug7658.xml deleted file mode 100644 index 98076f1984de8..0000000000000 --- a/ext/zip/tests/bug7658.xml +++ /dev/null @@ -1,2 +0,0 @@ - -Other text Silvio Berlusconi, le ricordo che ha in prestito i seguenti libriTitoloInventarioCodice Da Vinci112345678Lo Zen e il tiro con l'arco1020304Lo Zen e l'arte della manutenzione della motocicletta1020305101 Storie Zen1020306Antani di Blinda come fosse di Cappotto4112345peraltro, sottolineiamo la perentorietà della restituzione anche dei vieppiù interessanti testi:TitoloAutoreInventarioAngeli e DemoniDan Brown12131415La versione di BarneyMordecai Richler2010322Manuale PHPVarii32413543La prematurata supercazzola negli anni a venireUgo Tognazzi31213243La sbiriguda in vicesindacoUgo Tognazzi1324354654Gentili saluti, la sua biblioteca diff --git a/ext/zip/tests/bug8009.phpt b/ext/zip/tests/bug8009.phpt deleted file mode 100644 index 5dd363d2da0ba..0000000000000 --- a/ext/zip/tests/bug8009.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #8009 (cannot add again same entry to an archive) ---SKIPIF-- - ---FILE-- -open($filename)) { - exit("cannot open $filename\n"); -} -$zip->addFromString("2.txt", "=)"); -$zip->close(); -unlink($filename); -echo "status: " . $zip->status . "\n"; -echo "\n"; - ---EXPECT-- -status: 0 diff --git a/ext/zip/tests/bug8009.zip b/ext/zip/tests/bug8009.zip deleted file mode 100644 index 45bedcbe8891c..0000000000000 Binary files a/ext/zip/tests/bug8009.zip and /dev/null differ diff --git a/ext/zip/tests/bug8700.phpt b/ext/zip/tests/bug8700.phpt deleted file mode 100644 index c394cf0bec188..0000000000000 --- a/ext/zip/tests/bug8700.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #8700 (getFromIndex(0) fails) ---SKIPIF-- - ---FILE-- -open($filename) === FALSE) { - exit("cannot open $filename\n"); -} -$contents_from_idx = $zip->getFromIndex(0); -$contents_from_name = $zip->getFromName('1.txt'); -if ($contents_from_idx != $contents_from_name) { - echo "failed:"; - var_dump($content_from_idx, $content_from_name); -} - -$zip->close(); -echo "status: " . $zip->status . "\n"; -echo "\n"; - ---EXPECT-- -status: 0 diff --git a/ext/zip/tests/oo_addemptydir.phpt b/ext/zip/tests/oo_addemptydir.phpt deleted file mode 100644 index cb57b5b2122ad..0000000000000 --- a/ext/zip/tests/oo_addemptydir.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -ziparchive::addEmptyDir ---SKIPIF-- - ---FILE-- -open($file)) { - exit('failed'); -} - -$zip->addEmptyDir('emptydir'); -if ($zip->status == ZIPARCHIVE::ER_OK) { - dump_entries_name($zip); - $zip->close(); -} else { - echo "failed\n"; -} -@unlink($file); -?> ---EXPECTF-- -0 bar -1 foobar/ -2 foobar/baz -3 entry1.txt -4 emptydir/ diff --git a/ext/zip/tests/oo_addfile.phpt b/ext/zip/tests/oo_addfile.phpt deleted file mode 100644 index ab79780999715..0000000000000 --- a/ext/zip/tests/oo_addfile.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -ziparchive::addFile() function ---SKIPIF-- - ---FILE-- -open($file)) { - exit('failed'); -} -if (!$zip->addFile($dirname . 'utils.inc', 'test.php')) { - echo "failed\n"; -} -if ($zip->status == ZIPARCHIVE::ER_OK) { - dump_entries_name($zip); - $zip->close(); -} else { - echo "failed\n"; -} -@unlink($file); -?> ---EXPECTF-- -0 bar -1 foobar/ -2 foobar/baz -3 entry1.txt -4 test.php diff --git a/ext/zip/tests/oo_close.phpt b/ext/zip/tests/oo_close.phpt deleted file mode 100644 index ea67dcddfc2b5..0000000000000 --- a/ext/zip/tests/oo_close.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -zip::close() function ---SKIPIF-- - ---FILE-- -open($dirname . 'test.zip')) { - exit('failed'); -} - -if ($zip->status == ZIPARCHIVE::ER_OK) { - $zip->close(); - echo "ok\n"; -} else { - echo "failed\n"; -} -?> ---EXPECTF-- -ok diff --git a/ext/zip/tests/oo_delete.phpt b/ext/zip/tests/oo_delete.phpt deleted file mode 100644 index 9eac8217348cd..0000000000000 --- a/ext/zip/tests/oo_delete.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -Delete entries ---SKIPIF-- - ---FILE-- -open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} -$zip->addFromString('entry1.txt', 'entry #1'); -$zip->addFromString('entry2.txt', 'entry #2'); -$zip->addFromString('dir/entry2.txt', 'entry #2'); - -if ($zip->status == ZIPARCHIVE::ER_OK) { - $zip->close(); - echo "ok\n"; -} else { - var_dump($zip); - echo "failed\n"; -} - -if (!$zip->open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} - -if ($zip->deleteIndex(0)) { - echo "ok\n"; -} - -if ($zip->deleteName('entry2.txt')) { - echo "ok\n"; -} else { - echo "failed 3\n"; -} - -if ($zip->deleteName('dir/entry2.txt')) { - echo "ok\n"; -} else { - echo "failed 3\n"; -} - -if (!$zip->deleteIndex(123)) { - echo "ok\n"; -} else { - print_r($zip); - echo "failed\n"; -} - - -$sb = $zip->statIndex(0); -var_dump($sb); -$sb = $zip->statIndex(1); -var_dump($sb); -$sb = $zip->statIndex(2); -var_dump($sb); -$zip->close(); -unset($zip); - -if (file_exists($file)) { - unlink($file); -} -?> ---EXPECTF-- -ok -ok -ok -ok -ok -bool(false) -bool(false) -bool(false) diff --git a/ext/zip/tests/oo_ext_zip.phpt b/ext/zip/tests/oo_ext_zip.phpt deleted file mode 100644 index 739a671e0b858..0000000000000 --- a/ext/zip/tests/oo_ext_zip.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Extending Zip class and array property ---SKIPIF-- - ---FILE-- -testarray[] = 1; - var_dump($this->testarray); - } -} - -$z = new myZip; -?> ---EXPECTF-- -array(1) { - [0]=> - int(1) -} diff --git a/ext/zip/tests/oo_extract.phpt b/ext/zip/tests/oo_extract.phpt deleted file mode 100644 index 7ca39eeab84ec..0000000000000 --- a/ext/zip/tests/oo_extract.phpt +++ /dev/null @@ -1,95 +0,0 @@ ---TEST-- -extractTo ---SKIPIF-- - ---FILE-- -open($file) !== TRUE) { - echo "open failed.\n"; - exit('failed'); -} - -$zip->extractTo($dirname . '__oo_extract_tmp'); -if (!is_dir($dirname . '__oo_extract_tmp')) { - echo "failed. mkdir\n"; -} - -if (!is_dir($dirname .'__oo_extract_tmp/foobar')) { - echo "failed. mkdir foobar\n"; -} - -if (!file_exists($dirname . '__oo_extract_tmp/foobar/baz')) { - echo "failed. extract foobar/baz\n"; -} else { - echo file_get_contents($dirname . '__oo_extract_tmp/foobar/baz') . "\n"; -} - -if (!file_exists($dirname . '__oo_extract_tmp/bar')) { - echo "failed. bar file\n"; -} else { - echo file_get_contents($dirname . '__oo_extract_tmp/bar') . "\n"; -} - -if (!file_exists($dirname . '__oo_extract_tmp/foo')) { - echo "failed. foo file\n"; -} else { - echo file_get_contents($dirname . '__oo_extract_tmp/foo') . "\n"; -} - - -/* extract one file */ -$zip->extractTo($dirname . '__oo_extract_tmp', 'bar'); -if (!file_exists($dirname . '__oo_extract_tmp/bar')) { - echo "failed. extract bar file\n"; -} else { - echo file_get_contents($dirname . '__oo_extract_tmp/bar') . "\n"; -} - -/* extract two files */ -$zip->extractTo($dirname . '__oo_extract_tmp', array('bar','foo')); -if (!file_exists($dirname . '__oo_extract_tmp/bar')) { - echo "failed. extract bar file\n"; -} else { - echo file_get_contents($dirname . '__oo_extract_tmp/bar') . "\n"; -} -if (!file_exists($dirname . '__oo_extract_tmp/foo')) { - echo "failed. extract foo file\n"; -} else { - echo file_get_contents($dirname . '__oo_extract_tmp/foo') . "\n"; -} - -rmdir_rf($dirname . '__oo_extract_tmp'); -?> ---EXPECTF-- -blabla laber rababer sülz - -bar - -foo - - -bar - -bar - -foo ---UEXPECTF-- -blabla laber rababer sülz - -bar - -foo - - -bar - -bar - -foo diff --git a/ext/zip/tests/oo_getcomment.phpt b/ext/zip/tests/oo_getcomment.phpt deleted file mode 100644 index d05385c7dffce..0000000000000 --- a/ext/zip/tests/oo_getcomment.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -getComment ---SKIPIF-- - ---FILE-- -open($file)) { - exit('failed'); -} -echo $zip->getArchiveComment() . "\n"; - -$idx = $zip->locateName('foo'); -echo $zip->getCommentName('foo') . "\n"; -echo $zip->getCommentIndex($idx); - -echo $zip->getCommentName('') . "\n"; -echo $zip->getCommentName() . "\n"; - -$zip->close(); - -?> ---EXPECTF-- -Zip archive comment -foo comment -foo comment -Notice: ZipArchive::getCommentName(): Empty string as entry name in %s on line %d - - -Warning: ZipArchive::getCommentName() expects at least 1 parameter, 0 given in %s on line %d diff --git a/ext/zip/tests/oo_getnameindex.phpt b/ext/zip/tests/oo_getnameindex.phpt deleted file mode 100644 index cd4c9dbe30bff..0000000000000 --- a/ext/zip/tests/oo_getnameindex.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -getNameIndex ---SKIPIF-- - ---FILE-- -open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} - -$zip->addFromString('entry1.txt', 'entry #1'); -$zip->addFromString('entry2.txt', 'entry #2'); -$zip->addFromString('dir/entry2d.txt', 'entry #2'); - -if (!$zip->status == ZIPARCHIVE::ER_OK) { - echo "failed to write zip\n"; -} -$zip->close(); - -if (!$zip->open($file)) { - exit('failed'); -} - - -var_dump($zip->getNameIndex(0)); -var_dump($zip->getNameIndex(1)); -var_dump($zip->getNameIndex(2)); -var_dump($zip->getNameIndex(3)); - -$zip->close(); - -?> ---EXPECTF-- -string(10) "entry1.txt" -string(10) "entry2.txt" -string(15) "dir/entry2d.txt" -bool(false) diff --git a/ext/zip/tests/oo_namelocate.phpt b/ext/zip/tests/oo_namelocate.phpt deleted file mode 100644 index bbe7ec55d939b..0000000000000 --- a/ext/zip/tests/oo_namelocate.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Locate entries by name ---SKIPIF-- - ---FILE-- -open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} - -$zip->addFromString('entry1.txt', 'entry #1'); -$zip->addFromString('entry2.txt', 'entry #2'); -$zip->addFromString('dir/entry2d.txt', 'entry #2'); - -if (!$zip->status == ZIPARCHIVE::ER_OK) { - echo "failed to write zip\n"; -} -$zip->close(); - -if (!$zip->open($file)) { - exit('failed'); -} - - -var_dump($zip->locateName('entry1.txt')); -var_dump($zip->locateName('eNtry2.txt')); -var_dump($zip->locateName('eNtry2.txt', ZIPARCHIVE::FL_NOCASE)); -var_dump($zip->locateName('enTRy2d.txt', ZIPARCHIVE::FL_NOCASE|ZIPARCHIVE::FL_NODIR)); -$zip->close(); - -?> ---EXPECTF-- -int(0) -bool(false) -int(1) -int(2) diff --git a/ext/zip/tests/oo_open.phpt b/ext/zip/tests/oo_open.phpt deleted file mode 100644 index 0760db34c44cf..0000000000000 --- a/ext/zip/tests/oo_open.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -zip::open() function ---SKIPIF-- - ---FILE-- -open($dirname . 'nofile'); -if ($r !== TRUE) { - echo "ER_OPEN: ok\n"; -} else { - echo "ER_OPEN: FAILED\n"; -} - -$r = $zip->open($dirname . 'nofile', ZIPARCHIVE::CREATE); -if (!$r) { - echo "create: failed\n"; -} else { - echo "create: ok\n"; -} -@unlink($dirname . 'nofile'); - -$zip = new ZipArchive; -$zip->open(''); - -if (!$zip->open($dirname . 'test.zip')) { - exit("failed 1\n"); -} - -if ($zip->status == ZIPARCHIVE::ER_OK) { - echo "OK\n"; -} else { - echo "failed\n"; -} -?> ---EXPECTF-- -ER_OPEN: ok -create: ok - -Warning: ZipArchive::open(): Empty string as source in %s on line %d -OK diff --git a/ext/zip/tests/oo_properties.phpt b/ext/zip/tests/oo_properties.phpt deleted file mode 100644 index 7078f454cfc28..0000000000000 --- a/ext/zip/tests/oo_properties.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -ziparchive::properties isset()/empty() checks ---SKIPIF-- - ---FILE-- -open($file)) { - exit('failed'); -} - -printf("zip->status (%d):\n\tempty(): %d\n\tisset(): %d\n", $zip->status, empty($zip->status), isset($zip->status)); -printf("zip->numFiles (%d):\n\tempty(): %d\n\tisset(): %d\n", $zip->numFiles, empty($zip->numFiles), isset($zip->numFiles)); -printf("zip->bogus (%d):\n\tempty(): %d\n\tisset(): %d\n", $zip->bogus, empty($zip->bogus), isset($zip->bogus)); - - -$zip->addEmptyDir('emptydir'); - -printf("zip->status (%d):\n\tempty(): %d\n\tisset(): %d\n", $zip->status, empty($zip->status), isset($zip->status)); -printf("zip->numFiles (%d):\n\tempty(): %d\n\tisset(): %d\n", $zip->numFiles, empty($zip->numFiles), isset($zip->numFiles)); -printf("zip->filename (%d):\n\tempty(): %d\n\tisset(): %d\n", strlen($zip->filename), empty($zip->filename), isset($zip->filename)); -printf("zip->comment (%d):\n\tempty(): %d\n\tisset(): %d\n", strlen($zip->comment), empty($zip->comment), isset($zip->comment)); - -unset($zip); //close the file before unlinking -@unlink($file); -?> ---EXPECTF-- -zip->status (0): - empty(): 1 - isset(): 1 -zip->numFiles (4): - empty(): 0 - isset(): 1 - -Notice: Undefined property: ZipArchive::$bogus in %s on line %d -zip->bogus (0): - empty(): 1 - isset(): 0 -zip->status (0): - empty(): 1 - isset(): 1 -zip->numFiles (5): - empty(): 0 - isset(): 1 -zip->filename (0): - empty(): 1 - isset(): 1 -zip->comment (19): - empty(): 0 - isset(): 1 - diff --git a/ext/zip/tests/oo_rename.phpt b/ext/zip/tests/oo_rename.phpt deleted file mode 100644 index 98489ae2565c7..0000000000000 --- a/ext/zip/tests/oo_rename.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -Rename entries ---SKIPIF-- - ---FILE-- -open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} - -$zip->addFromString('entry1.txt', 'entry #1'); -$zip->addFromString('entry2.txt', 'entry #2'); -$zip->addFromString('dir/entry2.txt', 'entry #2'); - -if (!$zip->status == ZIPARCHIVE::ER_OK) { - var_dump($zip); - echo "failed\n"; -} - -$zip->close(); - -if (!$zip->open($file)) { - exit('failed'); -} - -dump_entries_name($zip); -echo "\n"; - -if (!$zip->renameIndex(0, 'ren_entry1.txt')) { - echo "failed index 0\n"; -} - -if (!$zip->renameName('dir/entry2.txt', 'dir3/ren_entry2.txt')) { - echo "failed name dir/entry2.txt\n"; -} -dump_entries_name($zip); -$zip->close(); - -@unlink($file); -?> ---EXPECTF-- -0 entry1.txt -1 entry2.txt -2 dir/entry2.txt - -0 ren_entry1.txt -1 entry2.txt -2 dir3/ren_entry2.txt diff --git a/ext/zip/tests/oo_setcomment.phpt b/ext/zip/tests/oo_setcomment.phpt deleted file mode 100644 index 89d6e8ef6b1a8..0000000000000 --- a/ext/zip/tests/oo_setcomment.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -setComment ---SKIPIF-- - ---FILE-- -open($file, ZIPARCHIVE::CREATE)) { - exit('failed'); -} - -$zip->addFromString('entry1.txt', 'entry #1'); -$zip->addFromString('entry2.txt', 'entry #2'); -$zip->addFromString('dir/entry2d.txt', 'entry #2'); -$zip->addFromString('entry4.txt', 'entry #1'); -$zip->addFromString('entry5.txt', 'entry #2'); - - -var_dump($zip->setCommentName('entry1.txt', 'entry1.txt')); -var_dump($zip->setCommentName('entry2.txt', 'entry2.txt')); -var_dump($zip->setCommentName('dir/entry2d.txt', 'dir/entry2d.txt')); -var_dump($zip->setArchiveComment('archive')); - -var_dump($zip->setCommentIndex(3, 'entry4.txt')); -var_dump($zip->setCommentIndex(4, 'entry5.txt')); -var_dump($zip->setArchiveComment('archive')); - -if (!$zip->status == ZIPARCHIVE::ER_OK) { - echo "failed to write zip\n"; -} -$zip->close(); - -if (!$zip->open($file)) { - @unlink($file); - exit('failed'); -} - -var_dump($zip->getCommentIndex(0)); -var_dump($zip->getCommentIndex(1)); -var_dump($zip->getCommentIndex(2)); -var_dump($zip->getCommentIndex(3)); -var_dump($zip->getCommentIndex(4)); -var_dump($zip->getArchiveComment()); - -$zip->close(); -@unlink($file); - -?> ---EXPECTF-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -string(10) "entry1.txt" -string(10) "entry2.txt" -string(15) "dir/entry2d.txt" -string(10) "entry4.txt" -string(10) "entry5.txt" -string(7) "archive" diff --git a/ext/zip/tests/oo_stream.phpt b/ext/zip/tests/oo_stream.phpt deleted file mode 100644 index 126e78f6f7f53..0000000000000 --- a/ext/zip/tests/oo_stream.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -getStream ---SKIPIF-- - ---FILE-- -open($file)) { - exit('failed'); -} -$fp = $zip->getStream('foo'); - -var_dump($fp); -if(!$fp) exit("\n"); -$contents = ''; -while (!feof($fp)) { - $contents .= fread($fp, 255); -} - -fclose($fp); -$zip->close(); -var_dump($contents); - - -$fp = fopen('zip://' . dirname(__FILE__) . '/test_with_comment.zip#foo', 'rb'); -if (!$fp) { - exit("cannot open\n"); -} -$contents = ''; -while (!feof($fp)) { - $contents .= fread($fp, 2); -} -var_dump($contents); -fclose($fp); - -?> ---EXPECTF-- -resource(%d) of type (stream) -string(5) "foo - -" -string(5) "foo - -" diff --git a/ext/zip/tests/test.zip b/ext/zip/tests/test.zip deleted file mode 100644 index 35bd5eecdf696..0000000000000 Binary files a/ext/zip/tests/test.zip and /dev/null differ diff --git a/ext/zip/tests/test_procedural.zip b/ext/zip/tests/test_procedural.zip deleted file mode 100644 index 6b986948031d9..0000000000000 Binary files a/ext/zip/tests/test_procedural.zip and /dev/null differ diff --git a/ext/zip/tests/test_with_comment.zip b/ext/zip/tests/test_with_comment.zip deleted file mode 100644 index d68f76157a359..0000000000000 Binary files a/ext/zip/tests/test_with_comment.zip and /dev/null differ diff --git a/ext/zip/tests/utils.inc b/ext/zip/tests/utils.inc deleted file mode 100644 index 02e37f6d544fa..0000000000000 --- a/ext/zip/tests/utils.inc +++ /dev/null @@ -1,24 +0,0 @@ -numFiles; $i++) { - $sb = $z->statIndex($i); - echo $i . ' ' . $sb['name'] . "\n"; - } -} -/* recursively remove a directoryy */ -function rmdir_rf($dir) { - if ($handle = opendir($dir)) { - while (false !== ($item = readdir($handle))) { - if ($item != "." && $item != "..") { - if (is_dir($dir . '/' . $item)) { - rmdir_rf($dir . '/' . $item); - } else { - unlink($dir . '/' . $item); - } - } - } - closedir($handle); - rmdir($dir); - } -} diff --git a/ext/zip/tests/zip_close.phpt b/ext/zip/tests/zip_close.phpt deleted file mode 100644 index 7f9d09ae368de..0000000000000 --- a/ext/zip/tests/zip_close.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -zip_close() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -OK diff --git a/ext/zip/tests/zip_entry_compressedsize.phpt b/ext/zip/tests/zip_entry_compressedsize.phpt deleted file mode 100644 index fefa6e59770f1..0000000000000 --- a/ext/zip/tests/zip_entry_compressedsize.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -zip_entry_compressedsize() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -5 -4 -0 -24 diff --git a/ext/zip/tests/zip_entry_compressionmethod.phpt b/ext/zip/tests/zip_entry_compressionmethod.phpt deleted file mode 100644 index cabdbb797f807..0000000000000 --- a/ext/zip/tests/zip_entry_compressionmethod.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -zip_entry_compressionmethod() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -stored -stored -stored -deflated - diff --git a/ext/zip/tests/zip_entry_filesize.phpt b/ext/zip/tests/zip_entry_filesize.phpt deleted file mode 100644 index b8d8820b642af..0000000000000 --- a/ext/zip/tests/zip_entry_filesize.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -zip_entry_filesize() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -5 -4 -0 -27 diff --git a/ext/zip/tests/zip_entry_name.phpt b/ext/zip/tests/zip_entry_name.phpt deleted file mode 100644 index 1916e25dac8b1..0000000000000 --- a/ext/zip/tests/zip_entry_name.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -zip_entry_name() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -foo -bar -foobar/ -foobar/baz diff --git a/ext/zip/tests/zip_entry_open.phpt b/ext/zip/tests/zip_entry_open.phpt deleted file mode 100644 index c32fe57407e21..0000000000000 --- a/ext/zip/tests/zip_entry_open.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -zip_entry_open() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -OK diff --git a/ext/zip/tests/zip_entry_read.phpt b/ext/zip/tests/zip_entry_read.phpt deleted file mode 100644 index d876f03fb51ca..0000000000000 --- a/ext/zip/tests/zip_entry_read.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -zip_entry_read() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -foo diff --git a/ext/zip/tests/zip_open.phpt b/ext/zip/tests/zip_open.phpt deleted file mode 100644 index 91474bc6fd265..0000000000000 --- a/ext/zip/tests/zip_open.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -zip_open() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -OK diff --git a/ext/zip/tests/zip_read.phpt b/ext/zip/tests/zip_read.phpt deleted file mode 100644 index 5cadb2d1efeeb..0000000000000 --- a/ext/zip/tests/zip_read.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -zip_read() function ---SKIPIF-- - ---FILE-- - ---EXPECT-- -4 entries diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c deleted file mode 100644 index 1f305509ea26b..0000000000000 --- a/ext/zip/zip_stream.c +++ /dev/null @@ -1,251 +0,0 @@ -/* $Id$ */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif -#include "php.h" -#if HAVE_ZIP -#ifdef ZEND_ENGINE_2 - -#include "lib/zip.h" - -#include "php_streams.h" -#include "ext/standard/file.h" -#include "ext/standard/php_string.h" -#include "fopen_wrappers.h" -#include "php_zip.h" - -#include "ext/standard/url.h" - -struct php_zip_stream_data_t { - struct zip *za; - struct zip_file *zf; - size_t cursor; - php_stream *stream; -}; - -#define STREAM_DATA_FROM_STREAM() \ - struct php_zip_stream_data_t *self = (struct php_zip_stream_data_t *) stream->abstract; - - -/* {{{ php_zip_ops_read */ -static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - int n = 0; - STREAM_DATA_FROM_STREAM(); - - if (self->za && self->zf) { - n = (size_t)zip_fread(self->zf, buf, (int)count); - - if (n == 0) { - stream->eof = 1; - } else { - self->cursor += n; - } - } - return n<1 ? 0 : n; -} -/* }}} */ - -/* {{{ php_zip_ops_write */ -static size_t php_zip_ops_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - if (!stream) { - return 0; - } - - return count; -} -/* }}} */ - -/* {{{ php_zip_ops_close */ -static int php_zip_ops_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - STREAM_DATA_FROM_STREAM(); - if (close_handle) { - if (self->za) { - zip_close(self->za); - self->za = NULL; - } - if (self->zf) { - zip_fclose(self->zf); - self->zf = NULL; - } - } - efree(self); - stream->abstract = NULL; - return EOF; -} -/* }}} */ - -/* {{{ php_zip_ops_flush */ -static int php_zip_ops_flush(php_stream *stream TSRMLS_DC) -{ - if (!stream) { - return 0; - } - - return 0; -} -/* }}} */ - -php_stream_ops php_stream_zipio_ops = { - php_zip_ops_write, php_zip_ops_read, - php_zip_ops_close, php_zip_ops_flush, - "zip", - NULL, /* seek */ - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -/* {{{ php_stream_zip_open */ -php_stream *php_stream_zip_open(char *filename, char *path, char *mode STREAMS_DC TSRMLS_DC) -{ - struct zip_file *zf = NULL; - int err = 0; - - php_stream *stream = NULL; - struct php_zip_stream_data_t *self; - struct zip *stream_za; - - if (strncmp(mode,"r", strlen("r")) != 0) { - return NULL; - } - - if (filename) { - if (OPENBASEDIR_CHECKPATH(filename)) { - return NULL; - } - - /* duplicate to make the stream za independent (esp. for MSHUTDOWN) */ - stream_za = zip_open(filename, ZIP_CREATE, &err); - if (!stream_za) { - return NULL; - } - - zf = zip_fopen(stream_za, path, 0); - if (zf) { - self = emalloc(sizeof(*self)); - - self->za = stream_za; - self->zf = zf; - self->stream = NULL; - self->cursor = 0; - stream = php_stream_alloc(&php_stream_zipio_ops, self, NULL, mode); - } else { - zip_close(stream_za); - } - } - - if (!stream) { - return NULL; - } else { - return stream; - } - -} -/* }}} */ - -/* {{{ php_stream_zip_opener */ -php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, - char *path, - char *mode, - int options, - char **opened_path, - php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - int path_len; - - char *file_basename; - size_t file_basename_len; - char file_dirname[MAXPATHLEN]; - - struct zip *za; - struct zip_file *zf = NULL; - char *fragment; - int fragment_len; - int err; - - php_stream *stream = NULL; - struct php_zip_stream_data_t *self; - - fragment = strchr(path, '#'); - if (!fragment) { - return NULL; - } - - if (strncasecmp("zip://", path, 6) == 0) { - path += 6; - } - - fragment_len = strlen(fragment); - - if (fragment_len < 1) { - return NULL; - } - path_len = strlen(path); - if (path_len >= MAXPATHLEN || mode[0] != 'r') { - return NULL; - } - - memcpy(file_dirname, path, path_len - fragment_len); - file_dirname[path_len - fragment_len] = '\0'; - - php_basename(path, path_len - fragment_len, NULL, 0, &file_basename, &file_basename_len TSRMLS_CC); - fragment++; - - if (OPENBASEDIR_CHECKPATH(file_dirname)) { - efree(file_basename); - return NULL; - } - - za = zip_open(file_dirname, ZIP_CREATE, &err); - if (za) { - zf = zip_fopen(za, fragment, 0); - if (zf) { - self = emalloc(sizeof(*self)); - - self->za = za; - self->zf = zf; - self->stream = NULL; - self->cursor = 0; - stream = php_stream_alloc(&php_stream_zipio_ops, self, NULL, mode); - - if (opened_path) { - *opened_path = estrdup(path); - } - } else { - zip_close(za); - } - } - - efree(file_basename); - - if (!stream) { - return NULL; - } else { - return stream; - } -} -/* }}} */ - -static php_stream_wrapper_ops zip_stream_wops = { - php_stream_zip_opener, - NULL, /* close */ - NULL, /* fstat */ - NULL, /* stat */ - NULL, /* opendir */ - "zip wrapper", - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -php_stream_wrapper php_stream_zip_wrapper = { - &zip_stream_wops, - NULL, - 0 /* is_url */ -}; -#endif /* ZEND_ENGINE_2 */ -#endif /* HAVE_ZIP */ diff --git a/ext/zlib/CREDITS b/ext/zlib/CREDITS deleted file mode 100644 index c0a47dd2932d1..0000000000000 --- a/ext/zlib/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Zlib -Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32 deleted file mode 100644 index 3639276c8c1f2..0000000000000 --- a/ext/zlib/config.w32 +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("zlib", "ZLIB support", "yes"); - -if (PHP_ZLIB == "yes") { - EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS"); - AC_DEFINE("HAVE_ZLIB", 1, "ZLIB support"); - CHECK_LIB("zlib.lib", "zlib", PHP_ZLIB); - CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects); - if (!PHP_ZLIB_SHARED) { - ADD_DEF_FILE("ext\\zlib\\php_zlib.def"); - } - -} - - diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4 deleted file mode 100644 index 62e05fbd02da8..0000000000000 --- a/ext/zlib/config0.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(zlib,for ZLIB support, -[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)]) - -PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined, -[ --with-zlib-dir= Define the location of zlib install directory], no, no) - -if test "$PHP_ZLIB" != "no" || test "$PHP_ZLIB_DIR" != "no"; then - PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared) - PHP_SUBST(ZLIB_SHARED_LIBADD) - - if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then - if test -f $PHP_ZLIB/include/zlib/zlib.h; then - ZLIB_DIR=$PHP_ZLIB - ZLIB_INCDIR=$ZLIB_DIR/include/zlib - elif test -f $PHP_ZLIB/include/zlib.h; then - ZLIB_DIR=$PHP_ZLIB - ZLIB_INCDIR=$ZLIB_DIR/include - fi - else - for i in /usr/local /usr $PHP_ZLIB_DIR; do - if test -f $i/include/zlib/zlib.h; then - ZLIB_DIR=$i - ZLIB_INCDIR=$i/include/zlib - elif test -f $i/include/zlib.h; then - ZLIB_DIR=$i - ZLIB_INCDIR=$i/include - fi - done - fi - - if test -z "$ZLIB_DIR"; then - AC_MSG_ERROR(Cannot find libz) - fi - - case $ZLIB_DIR in - /usr) ac_extra= ;; - *) ac_extra=-L$ZLIB_DIR/$PHP_LIBDIR ;; - esac - - PHP_CHECK_LIBRARY(z, gzgets, [ - AC_DEFINE(HAVE_ZLIB,1,[ ]) - ],[ - AC_MSG_ERROR(ZLIB extension requires zlib >= 1.0.9) - ],[ - $ac_extra - ]) - - PHP_ADD_LIBPATH($ZLIB_DIR/$PHP_LIBDIR, ZLIB_SHARED_LIBADD) - - PHP_ZLIB_DIR=$ZLIB_DIR - PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD) - PHP_ADD_INCLUDE($ZLIB_INCDIR) - -fi diff --git a/ext/zlib/package.xml b/ext/zlib/package.xml deleted file mode 100644 index 4be42e09366c3..0000000000000 --- a/ext/zlib/package.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - zlib - zlib compression management - - - sr - Stefan Roehrich - sr@linux.de - lead - - - rasmus - Rasmus Lerdorf - rasmus@php.net - developer - - - zeev - Zeev Suraski - zeev@php.net - developer - - - ??? - Jade Nicoletti - ???@php.net - developer - - - -This module enables you to transparently read and write -gzip (.gz) compressed files, through versions of most of -the filesystem functions which work with gzip-compressed -files (and uncompressed files, too, but not with sockets). - - PHP - - beta - 5.0.0rc1 - 2004-03-19 - -package.xml added to support installation using pear installer - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/zlib/php_zlib.def b/ext/zlib/php_zlib.def deleted file mode 100644 index a47cbc10caead..0000000000000 --- a/ext/zlib/php_zlib.def +++ /dev/null @@ -1,60 +0,0 @@ -LIBRARY -; zlib data compression library - -EXPORTS -; basic functions - zlibVersion - deflate - deflateEnd - inflate - inflateEnd -; advanced functions - deflateSetDictionary - deflateCopy - deflateReset - deflateParams - deflateBound - deflatePrime - inflateSetDictionary - inflateSync - inflateCopy - inflateReset - inflateBack - inflateBackEnd - zlibCompileFlags -; utility functions - compress - compress2 - compressBound - uncompress - gzopen - gzdopen - gzsetparams - gzread - gzwrite - gzprintf - gzputs - gzgets - gzputc - gzgetc - gzungetc - gzflush - gzseek - gzrewind - gztell - gzeof - gzclose - gzerror - gzclearerr -; checksum functions - adler32 - crc32 -; various hacks, don't look :) - deflateInit_ - deflateInit2_ - inflateInit_ - inflateInit2_ - inflateBackInit_ - inflateSyncPoint - get_crc_table - zError diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h deleted file mode 100644 index dc2cfb0699f1c..0000000000000 --- a/ext/zlib/php_zlib.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Stefan Röhrich | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_ZLIB_H -#define PHP_ZLIB_H - -#include - -ZEND_BEGIN_MODULE_GLOBALS(zlib) - /* variables for transparent gzip encoding */ - int compression_coding; - z_stream stream; - uLong crc; - int ob_gzhandler_status; - long output_compression; - long output_compression_level; - char *output_handler; -ZEND_END_MODULE_GLOBALS(zlib) - -extern php_stream_filter_factory php_zlib_filter_factory; -extern zend_module_entry php_zlib_module_entry; -#define zlib_module_ptr &php_zlib_module_entry - -int php_ob_gzhandler_check(TSRMLS_D); - -php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -extern php_stream_wrapper php_stream_gzip_wrapper; - -#ifdef ZTS -#define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v) -#else -#define ZLIBG(v) (zlib_globals.v) -#endif - -#define phpext_zlib_ptr zlib_module_ptr - -#define CODING_GZIP 1 -#define CODING_DEFLATE 2 - -#endif /* PHP_ZLIB_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/zlib/tests/001.phpt b/ext/zlib/tests/001.phpt deleted file mode 100644 index 4850a65a5a03b..0000000000000 --- a/ext/zlib/tests/001.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -gzdeflate()/gzinflate() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -100 36864 -Strings are equal -100 36864 -Strings are equal -5 15 -Strings are equal \ No newline at end of file diff --git a/ext/zlib/tests/002.phpt b/ext/zlib/tests/002.phpt deleted file mode 100644 index 9844a1b93d82b..0000000000000 --- a/ext/zlib/tests/002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -gzcompress()/gzuncompress() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -106 36864 -Strings are equal -106 36864 -Strings are equal diff --git a/ext/zlib/tests/003.phpt b/ext/zlib/tests/003.phpt deleted file mode 100644 index 2732d4cea651d..0000000000000 --- a/ext/zlib/tests/003.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -gzencode()/base64_encode() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -118 36864 -Strings are equal diff --git a/ext/zlib/tests/004.phpt b/ext/zlib/tests/004.phpt deleted file mode 100644 index a758b8c7b3f3b..0000000000000 --- a/ext/zlib/tests/004.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -gzfile() with various invalid params ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzfile(nonexistent_file_gzfile): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d -NULL -array(6) { - [0]=> - string(36) "When you're taught through feelings -" - [1]=> - string(26) "Destiny flying high above -" - [2]=> - string(38) "all I know is that you can realize it -" - [3]=> - string(18) "Destiny who cares -" - [4]=> - string(19) "as it turns around -" - [5]=> - string(39) "and I know that it descends down on me -" -} -array(6) { - [0]=> - string(36) "When you're taught through feelings -" - [1]=> - string(26) "Destiny flying high above -" - [2]=> - string(38) "all I know is that you can realize it -" - [3]=> - string(18) "Destiny who cares -" - [4]=> - string(19) "as it turns around -" - [5]=> - string(39) "and I know that it descends down on me -" -} -array(6) { - [0]=> - string(37) "When you\'re taught through feelings -" - [1]=> - string(26) "Destiny flying high above -" - [2]=> - string(38) "all I know is that you can realize it -" - [3]=> - string(18) "Destiny who cares -" - [4]=> - string(19) "as it turns around -" - [5]=> - string(39) "and I know that it descends down on me -" -} -Done diff --git a/ext/zlib/tests/004.txt.gz b/ext/zlib/tests/004.txt.gz deleted file mode 100644 index 07805db755807..0000000000000 Binary files a/ext/zlib/tests/004.txt.gz and /dev/null differ diff --git a/ext/zlib/tests/005.phpt b/ext/zlib/tests/005.phpt deleted file mode 100644 index 84fc3b5f10f65..0000000000000 --- a/ext/zlib/tests/005.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -gzcompress()/gzuncompress() and invalid params ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Warning: gzcompress() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzcompress(): compression level (1000) must be within -1..9 in %s on line %d -bool(false) -string(%d) "%a" -string(%d) "%a" -string(%d) "%a" -string(%d) "%a" -string(%d) "%a" - -Warning: gzuncompress() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzuncompress(): %s error in %s on line %d -bool(false) - -Warning: gzuncompress(): length (-1) must be greater or equal zero in %s on line %d -bool(false) - -Warning: gzuncompress(): %s error in %s on line %d -bool(false) - -Warning: gzuncompress(): %s error in %s on line %d -bool(false) -string(94) "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony" -string(94) "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony" - -Warning: gzuncompress(): %s error in %s on line %d -bool(false) -Done diff --git a/ext/zlib/tests/006.phpt b/ext/zlib/tests/006.phpt deleted file mode 100644 index 6a4e0f4e6799d..0000000000000 --- a/ext/zlib/tests/006.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -gzdeflate()/gzinflate() and invalid params ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: gzdeflate() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzdeflate(): compression level (1000) must be within -1..9 in %s on line %d -bool(false) -string(%d) "%a" -string(%d) "%a" -string(%d) "%a" -string(%d) "%a" -string(%d) "%a" - -Warning: gzinflate() expects at least 1 parameter, 0 given in %s on line %d -NULL -bool(false) - -Warning: gzinflate(): data error in %s on line %d -bool(false) - -Warning: gzinflate(): length (-1) must be greater or equal zero in %s on line %d -bool(false) - -Warning: gzinflate(): data error in %s on line %d -bool(false) - -Warning: gzinflate(): data error in %s on line %d -bool(false) -string(94) "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony" -string(94) "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony" - -Warning: gzinflate(): data error in %s on line %d -bool(false) -Done diff --git a/ext/zlib/tests/007.phpt b/ext/zlib/tests/007.phpt deleted file mode 100644 index ec37b99de696a..0000000000000 --- a/ext/zlib/tests/007.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -gzencode() and invalid params ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: gzencode() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzencode() expects at most 3 parameters, 4 given in %s on line %d -NULL - -Warning: gzencode(): compression level(-10) must be within -1..9 in %s on line %d -bool(false) - -Warning: gzencode(): compression level(100) must be within -1..9 in %s on line %d -bool(false) - -Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d -bool(false) -string(%d) "%s" -string(%d) "%s" - -Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d -bool(false) -string(%d) "%s" -string(%d) "%s" -Done diff --git a/ext/zlib/tests/bug.tar b/ext/zlib/tests/bug.tar deleted file mode 100644 index 77fd77832fa26..0000000000000 Binary files a/ext/zlib/tests/bug.tar and /dev/null differ diff --git a/ext/zlib/tests/bug_34821.phpt b/ext/zlib/tests/bug_34821.phpt deleted file mode 100644 index b378ec4097c90..0000000000000 --- a/ext/zlib/tests/bug_34821.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Bug #34821 (zlib encoders fail on widely varying binary data) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) diff --git a/ext/zlib/tests/bug_40189.phpt b/ext/zlib/tests/bug_40189.phpt deleted file mode 100644 index 07e5191a9c995..0000000000000 --- a/ext/zlib/tests/bug_40189.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #40189 (endless loop in zlib.inflate stream filter) ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECT-- -string(40) "AwCFRi98wqppK23l2/7kIY8AlyEdAgAAAEdCTUI=" -int(0) -string(0) "" diff --git a/ext/zlib/tests/bug_40189_2.phpt b/ext/zlib/tests/bug_40189_2.phpt deleted file mode 100644 index 13a19dbd95e0a..0000000000000 --- a/ext/zlib/tests/bug_40189_2.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #40189 (test for truncated deflate, also part of erroneous fix for #40189) ---SKIPIF-- - ---FILE-- - 15+16)); -$b = fread($a, 4716032); -var_dump(strlen($b)); -// when broken, this outputs "int(686904)" -?> ---EXPECT-- -int(1676116) \ No newline at end of file diff --git a/ext/zlib/tests/compress_zlib_wrapper.phpt b/ext/zlib/tests/compress_zlib_wrapper.phpt deleted file mode 100644 index 4bf6c08317fee..0000000000000 --- a/ext/zlib/tests/compress_zlib_wrapper.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -compress.zlib:// wrapper ---SKIPIF-- - ---FILE-- - ---EXPECT-- -ok diff --git a/ext/zlib/tests/gzfilegzreadfile.phpt b/ext/zlib/tests/gzfilegzreadfile.phpt deleted file mode 100644 index 2d6843ddd4eda..0000000000000 --- a/ext/zlib/tests/gzfilegzreadfile.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -gzfile(), gzreadfile() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(560) -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah - -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah diff --git a/ext/zlib/tests/gzreadgzwrite.phpt b/ext/zlib/tests/gzreadgzwrite.phpt deleted file mode 100644 index 6d6729a72f682..0000000000000 --- a/ext/zlib/tests/gzreadgzwrite.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -gzopen(), gzread(), gzwrite() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(36864) -int(36864) -Strings are equal diff --git a/ext/zlib/tests/gzreadgzwriteplain.phpt b/ext/zlib/tests/gzreadgzwriteplain.phpt deleted file mode 100644 index 7bb567d889ee3..0000000000000 --- a/ext/zlib/tests/gzreadgzwriteplain.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -gzopen(), gzread(), gzwrite() for non-compressed data ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(36864) -int(36864) -Strings are equal -int(18432) -Strings are equal diff --git a/ext/zlib/tests/zlib_filter_deflate.phpt b/ext/zlib/tests/zlib_filter_deflate.phpt deleted file mode 100644 index 1811779f04f64..0000000000000 --- a/ext/zlib/tests/zlib_filter_deflate.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -zlib.deflate (with convert.base64-encode) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -HctBDoAgDETRq8zOjfEeHKOGATG0TRpC4u1Vdn/xX4IoxkVMxgP1zA4vkJVhULk9UGkM6TvSNolmxUNlNLePVQ45O3eINf0fsQxtCxwv diff --git a/ext/zlib/tests/zlib_filter_inflate.phpt b/ext/zlib/tests/zlib_filter_inflate.phpt deleted file mode 100644 index 026f192a6ecdb..0000000000000 --- a/ext/zlib/tests/zlib_filter_inflate.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -zlib.inflate (with convert.base64-decode) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -I am the very model of a modern major general, I've information vegetable, animal, and mineral. diff --git a/ext/zlib/tests/zlib_filter_inflate2.phpt b/ext/zlib/tests/zlib_filter_inflate2.phpt deleted file mode 100644 index 4332d8e5e662e..0000000000000 --- a/ext/zlib/tests/zlib_filter_inflate2.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -zlib.inflate of gzip-encoded stream ---SKIPIF-- - ---FILE-- - 15+16)); -echo "2\n"; -echo fread($fp, 2000); -fclose($fp); -// auto-detect -$fp = fopen(dirname(__FILE__) . '/test.txt.gz', 'r'); -stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ, array('window' => 15+32)); -echo "3\n"; -echo fread($fp, 2000); -fclose($fp); - -?> ---CLEAN-- - ---EXPECT-- -1 -2 -This is quite the thing ain't it -3 -This is quite the thing ain't it \ No newline at end of file diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c deleted file mode 100644 index 63b756f770091..0000000000000 --- a/ext/zlib/zlib.c +++ /dev/null @@ -1,1034 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Stefan Röhrich | - | Zeev Suraski | - | Jade Nicoletti | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "SAPI.h" -#include "php_ini.h" - -#include -#include -#include -#include -#include -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#else -#include -/* #include */ -#endif -#include "ext/standard/head.h" -#include "safe_mode.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/info.h" -#include "php_zlib.h" -#include "fopen_wrappers.h" -#if HAVE_PWD_H -#ifdef PHP_WIN32 -#include "win32/pwd.h" -#else -#include -#endif -#endif -#if defined(HAVE_UNISTD_H) && defined(PHP_WIN32) -#undef HAVE_UNISTD_H -#endif - -#ifdef COMPILE_DL_ZLIB -#ifndef PUTS -#define PUTS(a) php_printf("%s",a) -#endif -#ifndef PUTC -#define PUTC(a) PUTS(a) -#endif -#ifndef PHPWRITE -#define PHPWRITE(a,n) php_write((a),(n) TSRMLS_CC) -#endif -#endif - -/* Win32 needs some more memory */ -#ifdef PHP_WIN32 -#define PHP_ZLIB_MODIFIER 100 -#else -#define PHP_ZLIB_MODIFIER 1000 -#endif - -#define OS_CODE 0x03 /* FIXME */ -#define GZIP_HEADER_LENGTH 10 -#define GZIP_FOOTER_LENGTH 8 - -/* True globals, no need for thread safety */ -static const int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - -static int php_enable_output_compression(int buffer_size TSRMLS_DC); - -static PHP_MINIT_FUNCTION(zlib); -static PHP_MSHUTDOWN_FUNCTION(zlib); -static PHP_RINIT_FUNCTION(zlib); -static PHP_MINFO_FUNCTION(zlib); -static PHP_FUNCTION(gzopen); -static PHP_FUNCTION(readgzfile); -static PHP_FUNCTION(gzfile); -static PHP_FUNCTION(gzcompress); -static PHP_FUNCTION(gzuncompress); -static PHP_FUNCTION(gzdeflate); -static PHP_FUNCTION(gzinflate); -static PHP_FUNCTION(gzencode); -static PHP_FUNCTION(ob_gzhandler); -static PHP_FUNCTION(zlib_get_coding_type); - -/* {{{ php_zlib_functions[] - */ -static zend_function_entry php_zlib_functions[] = { - PHP_FE(readgzfile, NULL) - PHP_FALIAS(gzrewind, rewind, NULL) - PHP_FALIAS(gzclose, fclose, NULL) - PHP_FALIAS(gzeof, feof, NULL) - PHP_FALIAS(gzgetc, fgetc, NULL) - PHP_FALIAS(gzgets, fgets, NULL) - PHP_FALIAS(gzgetss, fgetss, NULL) - PHP_FALIAS(gzread, fread, NULL) - PHP_FE(gzopen, NULL) - PHP_FALIAS(gzpassthru, fpassthru, NULL) - PHP_FALIAS(gzseek, fseek, NULL) - PHP_FALIAS(gztell, ftell, NULL) - PHP_FALIAS(gzwrite, fwrite, NULL) - PHP_FALIAS(gzputs, fwrite, NULL) - PHP_FE(gzfile, NULL) - PHP_FE(gzcompress, NULL) - PHP_FE(gzuncompress, NULL) - PHP_FE(gzdeflate, NULL) - PHP_FE(gzinflate, NULL) - PHP_FE(gzencode, NULL) - PHP_FE(ob_gzhandler, NULL) - PHP_FE(zlib_get_coding_type, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(zlib) - -/* {{{ php_zlib_module_entry - */ -zend_module_entry php_zlib_module_entry = { - STANDARD_MODULE_HEADER, - "zlib", - php_zlib_functions, - PHP_MINIT(zlib), - PHP_MSHUTDOWN(zlib), - PHP_RINIT(zlib), - NULL, - PHP_MINFO(zlib), - "1.1", - PHP_MODULE_GLOBALS(zlib), - NULL, - NULL, - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; -/* }}} */ - -#ifdef COMPILE_DL_ZLIB -ZEND_GET_MODULE(php_zlib) -#endif - -/* {{{ Memory management wrappers */ - -static voidpf php_zlib_alloc(voidpf opaque, uInt items, uInt size) -{ - return (voidpf)safe_emalloc(items, size, 0); -} - -static void php_zlib_free(voidpf opaque, voidpf address) -{ - efree((void*)address); -} -/* }}} */ - -/* {{{ OnUpdate_zlib_output_compression */ -static PHP_INI_MH(OnUpdate_zlib_output_compression) -{ - char *ini_value; - - if (new_value == NULL) { - return FAILURE; - } - - if (!strncasecmp(new_value, "off", sizeof("off"))) { - new_value = "0"; - new_value_length = sizeof("0"); - } else if (!strncasecmp(new_value, "on", sizeof("on"))) { - new_value = "1"; - new_value_length = sizeof("1"); - } - - ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0); - if (ini_value != NULL && strlen(ini_value) != 0 && zend_atoi(new_value, new_value_length) != 0) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!"); - return FAILURE; - } - - if (stage == PHP_INI_STAGE_RUNTIME && SG(headers_sent) && !SG(request_info).no_headers) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent"); - return FAILURE; - } - - OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ OnUpdate_zlib_output_compression_level */ -static PHP_INI_MH(OnUpdate_zlib_output_compression_level) -{ - OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ OnUpdate_zlib_output_handler */ -static PHP_INI_MH(OnUpdate_zlib_output_handler) -{ - if (stage == PHP_INI_STAGE_RUNTIME && SG(headers_sent) && !SG(request_info).no_headers) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_handler - headers already sent"); - return FAILURE; - } - - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - - -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals) - STD_PHP_INI_ENTRY("zlib.output_compression_level", "-1", PHP_INI_ALL, OnUpdate_zlib_output_compression_level, output_compression_level, zend_zlib_globals, zlib_globals) - STD_PHP_INI_ENTRY("zlib.output_handler", "", PHP_INI_ALL, OnUpdate_zlib_output_handler, output_handler, zend_zlib_globals, zlib_globals) -PHP_INI_END() - -/* {{{ PHP_MINIT_FUNCTION - */ -static PHP_MINIT_FUNCTION(zlib) -{ - php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper TSRMLS_CC); - php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory TSRMLS_CC); - - REGISTER_LONG_CONSTANT("FORCE_GZIP", CODING_GZIP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FORCE_DEFLATE", CODING_DEFLATE, CONST_CS | CONST_PERSISTENT); - - REGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -static PHP_RINIT_FUNCTION(zlib) -{ - uint chunk_size = ZLIBG(output_compression); - - ZLIBG(ob_gzhandler_status) = 0; - ZLIBG(compression_coding) = 0; - if (chunk_size) { - if (chunk_size == 1) { - chunk_size = 4096; /* use the default size */ - ZLIBG(output_compression) = chunk_size; - } - php_enable_output_compression(chunk_size TSRMLS_CC); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -static PHP_MSHUTDOWN_FUNCTION(zlib) -{ - php_unregister_url_stream_wrapper("zlib" TSRMLS_CC); - php_stream_filter_unregister_factory("zlib.*" TSRMLS_CC); - - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -static PHP_MINFO_FUNCTION(zlib) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "ZLib Support", "enabled"); - php_info_print_table_row(2, "Stream Wrapper support", "compress.zlib://"); - php_info_print_table_row(2, "Stream Filter support", "zlib.inflate, zlib.deflate"); - php_info_print_table_row(2, "Compiled Version", ZLIB_VERSION); - php_info_print_table_row(2, "Linked Version", (char *) zlibVersion()); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* {{{ proto array gzfile(string filename [, int use_include_path]) - Read und uncompress entire .gz-file into an array */ -static PHP_FUNCTION(gzfile) -{ - char *filename; - int filename_len; - long flags = 0; - char *slashed, buf[8192]; - register int i = 0; - int use_include_path = 0; - php_stream *stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) { - return; - } - - use_include_path = flags ? USE_PATH : 0; - - /* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */ - stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC); - if (stream == NULL) { - /* Error reporting is already done by stream code */ - RETURN_FALSE; - } - - /* Initialize return array */ - array_init(return_value); - - /* Now loop through the file and do the magic quotes thing if needed */ - memset(buf,0,sizeof(buf)); - - while (php_stream_gets(stream, buf, sizeof(buf) - 1) != NULL) { - if (PG(magic_quotes_runtime)) { - int len; - - slashed = php_addslashes(buf, 0, &len, 0 TSRMLS_CC); /* 0 = don't free source string */ - add_index_stringl(return_value, i++, slashed, len, 0); - } else { - add_index_string(return_value, i++, buf, 1); - } - } - php_stream_close(stream); -} -/* }}} */ - -/* {{{ proto resource gzopen(string filename, string mode [, int use_include_path]) - Open a .gz-file and return a .gz-file pointer */ -static PHP_FUNCTION(gzopen) -{ - char *filename, *mode; - int filename_len, mode_len; - long flags = 0; - php_stream *stream; - int use_include_path = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename, &filename_len, &mode, &mode_len, &flags) == FAILURE) { - return; - } - - use_include_path = flags ? USE_PATH : 0; - - stream = php_stream_gzopen(NULL, filename, mode, use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC); - - if (!stream) { - RETURN_FALSE; - } - php_stream_to_zval(stream, return_value); -} -/* }}} */ - -/* - * Read a file and write the ouput to stdout - */ -/* {{{ proto int readgzfile(string filename [, int use_include_path]) - Output a .gz-file */ -static PHP_FUNCTION(readgzfile) -{ - char *filename; - int filename_len; - long flags = 0; - php_stream *stream; - int size; - int use_include_path = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) { - return; - } - - use_include_path = flags ? USE_PATH : 0; - - stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | ENFORCE_SAFE_MODE, NULL, NULL STREAMS_CC TSRMLS_CC); - if (!stream) { - RETURN_FALSE; - } - size = php_stream_passthru(stream); - php_stream_close(stream); - RETURN_LONG(size); -} -/* }}} */ - -/* {{{ proto string gzcompress(string data [, int level]) - Gzip-compress a string */ -static PHP_FUNCTION(gzcompress) -{ - int data_len, status; - long level = Z_DEFAULT_COMPRESSION; - unsigned long l2; - char *data, *s2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &level) == FAILURE) { - return; - } - - if ((level < -1) || (level > 9)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%ld) must be within -1..9", level); - RETURN_FALSE; - } - - l2 = data_len + (data_len / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */ - s2 = (char *) emalloc(l2); - if (!s2) { - RETURN_FALSE; - } - - if (level >= 0) { - status = compress2(s2, &l2, data, data_len, level); - } else { - status = compress(s2, &l2, data, data_len); - } - - if (status == Z_OK) { - s2 = erealloc(s2, l2 + 1); - s2[l2] = '\0'; - RETURN_STRINGL(s2, l2, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string gzuncompress(string data [, int length]) - Unzip a gzip-compressed string */ -static PHP_FUNCTION(gzuncompress) -{ - int data_len, status; - unsigned int factor=1, maxfactor=16; - long limit = 0; - unsigned long plength=0, length; - char *data, *s1=NULL, *s2=NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &limit) == FAILURE) { - return; - } - - if (limit < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%ld) must be greater or equal zero", limit); - RETURN_FALSE; - } - plength = limit; - - /* - zlib::uncompress() wants to know the output data length - if none was given as a parameter - we try from input length * 2 up to input length * 2^15 - doubling it whenever it wasn't big enough - that should be eneugh for all real life cases - */ - do { - length = plength ? plength : (unsigned long)data_len * (1 << factor++); - s2 = (char *) erealloc(s1, length); - status = uncompress(s2, &length, data, data_len); - s1 = s2; - } while ((status == Z_BUF_ERROR) && (!plength) && (factor < maxfactor)); - - if (status == Z_OK) { - s2 = erealloc(s2, length + 1); /* space for \0 */ - s2[ length ] = '\0'; - RETURN_STRINGL(s2, length, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string gzdeflate(string data [, int level]) - Gzip-compress a string */ -static PHP_FUNCTION(gzdeflate) -{ - int data_len,status; - long level = Z_DEFAULT_COMPRESSION; - z_stream stream; - char *data, *s2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &level) == FAILURE) { - return; - } - - if ((level < -1) || (level > 9)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%ld) must be within -1..9", level); - RETURN_FALSE; - } - - stream.data_type = Z_ASCII; - stream.zalloc = php_zlib_alloc; - stream.zfree = php_zlib_free; - stream.opaque = (voidpf) Z_NULL; - - stream.next_in = (Bytef *) data; - stream.avail_in = data_len; - - stream.avail_out = stream.avail_in + (stream.avail_in / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */ - - s2 = (char *) emalloc(stream.avail_out); - if (!s2) { - RETURN_FALSE; - } - - stream.next_out = s2; - - /* init with -MAX_WBITS disables the zlib internal headers */ - status = deflateInit2(&stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, 0); - if (status == Z_OK) { - status = deflate(&stream, Z_FINISH); - if (status != Z_STREAM_END) { - deflateEnd(&stream); - if (status == Z_OK) { - status = Z_BUF_ERROR; - } - } else { - status = deflateEnd(&stream); - } - } - - if (status == Z_OK) { - s2 = erealloc(s2,stream.total_out + 1); /* resize to buffer to the "right" size */ - s2[ stream.total_out ] = '\0'; - RETURN_STRINGL(s2, stream.total_out, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string gzinflate(string data [, int length]) - Unzip a gzip-compressed string */ -static PHP_FUNCTION(gzinflate) -{ - int data_len, status; - unsigned int factor=1, maxfactor=16; - long limit = 0; - unsigned long plength=0, length; - char *data, *s1=NULL, *s2=NULL; - z_stream stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &limit) == FAILURE) { - return; - } - - if (!data_len) { - RETURN_FALSE; - } - - if (limit < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%ld) must be greater or equal zero", limit); - RETURN_FALSE; - } - plength = limit; - - /* - stream.avail_out wants to know the output data length - if none was given as a parameter - we try from input length * 2 up to input length * 2^15 - doubling it whenever it wasn't big enough - that should be enaugh for all real life cases - */ - - stream.zalloc = php_zlib_alloc; - stream.zfree = php_zlib_free; - - do { - length = plength ? plength : (unsigned long)data_len * (1 << factor++); - s2 = (char *) erealloc(s1, length); - - if (!s2 && s1) { - efree(s1); - RETURN_FALSE; - } - - stream.next_in = (Bytef *) data; - stream.avail_in = (uInt) data_len + 1; /* there is room for \0 */ - - stream.next_out = s2; - stream.avail_out = (uInt) length; - - /* init with -MAX_WBITS disables the zlib internal headers */ - status = inflateInit2(&stream, -MAX_WBITS); - if (status == Z_OK) { - status = inflate(&stream, Z_FINISH); - if (status != Z_STREAM_END) { - inflateEnd(&stream); - if (status == Z_OK) { - status = Z_BUF_ERROR; - } - } else { - status = inflateEnd(&stream); - } - } - s1 = s2; - - } while ((status == Z_BUF_ERROR) && (!plength) && (factor < maxfactor)); - - if (status == Z_OK) { - s2 = erealloc(s2, stream.total_out + 1); /* room for \0 */ - s2[ stream.total_out ] = '\0'; - RETURN_STRINGL(s2, stream.total_out, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string zlib_get_coding_type(void) - Returns the coding type used for output compression */ -static PHP_FUNCTION(zlib_get_coding_type) -{ - switch (ZLIBG(compression_coding)) { - case CODING_GZIP: - RETURN_STRINGL("gzip", sizeof("gzip") - 1, 1); - - case CODING_DEFLATE: - RETURN_STRINGL("deflate", sizeof("deflate") - 1, 1); - } - - RETURN_FALSE; -} - -/* {{{ php_do_deflate - */ -static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buffer_len, zend_bool do_start, zend_bool do_end TSRMLS_DC) -{ - Bytef *buffer; - uInt prev_outlen, outlen; - int err; - int start_offset = ((do_start && ZLIBG(compression_coding) == CODING_GZIP) ? 10 : 0); - int end_offset = (do_end ? 8 : 0); - - outlen = (uint) (str_length + (str_length / PHP_ZLIB_MODIFIER) + 12 + 1); /* leave some room for a trailing \0 */ - if ((outlen + start_offset + end_offset) > *p_buffer_len) { - buffer = (Bytef *) emalloc(outlen + start_offset + end_offset); - } else { - buffer = *p_buffer; - } - - ZLIBG(stream).next_out = buffer + start_offset; - ZLIBG(stream).avail_out = outlen; - - err = deflate(&ZLIBG(stream), Z_SYNC_FLUSH); - while (err == Z_OK && !ZLIBG(stream).avail_out) { - prev_outlen = outlen; - outlen *= 3; - if ((outlen + start_offset + end_offset) > *p_buffer_len) { - buffer = erealloc(buffer, outlen + start_offset + end_offset); - } - - ZLIBG(stream).next_out = buffer + start_offset + prev_outlen; - ZLIBG(stream).avail_out = prev_outlen * 2; - - err = deflate(&ZLIBG(stream), Z_SYNC_FLUSH); - } - - if (do_end) { - err = deflate(&ZLIBG(stream), Z_FINISH); - buffer[outlen + start_offset - ZLIBG(stream).avail_out] = '\0'; - } - - *p_buffer = buffer; - *p_buffer_len = outlen - ZLIBG(stream).avail_out; - - return err; -} -/* }}} */ - -/* {{{ php_deflate_string - */ -static int php_deflate_string(const char *str, uint str_length, char **newstr, uint *new_length, zend_bool do_start, zend_bool do_end TSRMLS_DC) -{ - int err; - - if (do_start) { - ZLIBG(stream).zalloc = php_zlib_alloc; - ZLIBG(stream).zfree = php_zlib_free; - ZLIBG(stream).opaque = Z_NULL; - - switch (ZLIBG(compression_coding)) { - case CODING_GZIP: - /* windowBits is passed < 0 to suppress zlib header & trailer */ - if (deflateInit2(&ZLIBG(stream), ZLIBG(output_compression_level), Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) { - /* TODO: print out error */ - return FAILURE; - } - - ZLIBG(crc) = crc32(0L, Z_NULL, 0); - break; - - case CODING_DEFLATE: - if (deflateInit(&ZLIBG(stream), ZLIBG(output_compression_level)) != Z_OK) { - /* TODO: print out error */ - return FAILURE; - } - break; - } - } - - ZLIBG(stream).next_in = (Bytef *) str; - ZLIBG(stream).avail_in = (uInt) str_length; - - if (ZLIBG(compression_coding) == CODING_GZIP) { - ZLIBG(crc) = crc32(ZLIBG(crc), (const Bytef *) str, str_length); - } - - err = php_do_deflate(str_length, (Bytef **) newstr, new_length, do_start, do_end TSRMLS_CC); - /* TODO: error handling (err may be Z_STREAM_ERROR, Z_BUF_ERROR, ?) */ - - if (do_start && ZLIBG(compression_coding) == CODING_GZIP) { - /* Write a very simple .gz header: */ - (*newstr)[0] = gz_magic[0]; - (*newstr)[1] = gz_magic[1]; - (*newstr)[2] = Z_DEFLATED; - (*newstr)[3] = (*newstr)[4] = (*newstr)[5] = (*newstr)[6] = (*newstr)[7] = (*newstr)[8] = 0; - (*newstr)[9] = OS_CODE; - *new_length += 10; - } - if (do_end) { - if (ZLIBG(compression_coding) == CODING_GZIP) { - char *trailer = (*newstr) + (*new_length); - - /* write crc & stream.total_in in LSB order */ - trailer[0] = (char) ZLIBG(crc) & 0xFF; - trailer[1] = (char) (ZLIBG(crc) >> 8) & 0xFF; - trailer[2] = (char) (ZLIBG(crc) >> 16) & 0xFF; - trailer[3] = (char) (ZLIBG(crc) >> 24) & 0xFF; - trailer[4] = (char) ZLIBG(stream).total_in & 0xFF; - trailer[5] = (char) (ZLIBG(stream).total_in >> 8) & 0xFF; - trailer[6] = (char) (ZLIBG(stream).total_in >> 16) & 0xFF; - trailer[7] = (char) (ZLIBG(stream).total_in >> 24) & 0xFF; - trailer[8] = '\0'; - *new_length += 8; - } - deflateEnd(&ZLIBG(stream)); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ proto string gzencode(string data [, int level [, int encoding_mode]]) - GZ encode a string */ -static PHP_FUNCTION(gzencode) -{ - char *data, *s2; - int data_len; - long level = Z_DEFAULT_COMPRESSION, coding = CODING_GZIP; - int status; - z_stream stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &data, &data_len, &level, &coding) == FAILURE) { - return; - } - - if ((level < -1) || (level > 9)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level(%ld) must be within -1..9", level); - RETURN_FALSE; - } - - if ((coding != CODING_GZIP) && (coding != CODING_DEFLATE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "encoding mode must be FORCE_GZIP or FORCE_DEFLATE"); - RETURN_FALSE; - } - - stream.zalloc = php_zlib_alloc; - stream.zfree = php_zlib_free; - stream.opaque = Z_NULL; - - stream.next_in = (Bytef *) data; - stream.avail_in = data_len; - - stream.avail_out = stream.avail_in + (stream.avail_in / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */ - s2 = (char *) emalloc(stream.avail_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0)); - - /* add gzip file header */ - s2[0] = gz_magic[0]; - s2[1] = gz_magic[1]; - s2[2] = Z_DEFLATED; - s2[3] = s2[4] = s2[5] = s2[6] = s2[7] = s2[8] = 0; /* time set to 0 */ - s2[9] = OS_CODE; - - stream.next_out = &(s2[GZIP_HEADER_LENGTH]); - - switch (coding) { - case CODING_GZIP: - /* windowBits is passed < 0 to suppress zlib header & trailer */ - if ((status = deflateInit2(&stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY)) != Z_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } - - break; - case CODING_DEFLATE: - if ((status = deflateInit(&stream, level)) != Z_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } - break; - } - - status = deflate(&stream, Z_FINISH); - if (status != Z_STREAM_END) { - deflateEnd(&stream); - if (status == Z_OK) { - status = Z_BUF_ERROR; - } - } else { - status = deflateEnd(&stream); - } - - if (status == Z_OK) { - /* resize to buffer to the "right" size */ - s2 = erealloc(s2, stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0) + 1); - - if (coding == CODING_GZIP) { - char *trailer = s2 + (stream.total_out + GZIP_HEADER_LENGTH); - uLong crc = crc32(0L, Z_NULL, 0); - - crc = crc32(crc, (const Bytef *) data, data_len); - - /* write crc & stream.total_in in LSB order */ - trailer[0] = (char) crc & 0xFF; - trailer[1] = (char) (crc >> 8) & 0xFF; - trailer[2] = (char) (crc >> 16) & 0xFF; - trailer[3] = (char) (crc >> 24) & 0xFF; - trailer[4] = (char) stream.total_in & 0xFF; - trailer[5] = (char) (stream.total_in >> 8) & 0xFF; - trailer[6] = (char) (stream.total_in >> 16) & 0xFF; - trailer[7] = (char) (stream.total_in >> 24) & 0xFF; - trailer[8] = '\0'; - } else { - s2[stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0)] = '\0'; - } - RETURN_STRINGL(s2, stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0), 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_ob_gzhandler_check - */ -int php_ob_gzhandler_check(TSRMLS_D) -{ - /* check for wrong usages */ - if (OG(ob_nesting_level > 0)) { - if (php_ob_handler_used("ob_gzhandler" TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used twice"); - return FAILURE; - } - if (php_ob_handler_used("mb_output_handler" TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used after 'mb_output_handler'"); - return FAILURE; - } - if (php_ob_handler_used("URL-Rewriter" TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used after 'URL-Rewriter'"); - return FAILURE; - } - if (php_ob_init_conflict("ob_gzhandler", "zlib output compression" TSRMLS_CC)) { - return FAILURE; - } - } - - return SUCCESS; -} - -/* }}} */ - -/* {{{ proto string ob_gzhandler(string str, int mode) - Encode str based on accept-encoding setting - designed to be called from ob_start() */ -static PHP_FUNCTION(ob_gzhandler) -{ - char *string; - int string_len; - long mode; - zval **a_encoding; - zend_bool return_original = 0; - zend_bool do_start, do_end; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &string, &string_len, &mode) == FAILURE) { - return; - } - - if(ZLIBG(ob_gzhandler_status) == -1) - RETURN_FALSE; - - zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - - if (!PG(http_globals)[TRACK_VARS_SERVER] - || zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void **) &a_encoding) == FAILURE - ) { - ZLIBG(ob_gzhandler_status) = -1; - RETURN_FALSE; - } - - convert_to_string_ex(a_encoding); - if (php_memnstr(Z_STRVAL_PP(a_encoding), "gzip", 4, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_GZIP; - } else if (php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_DEFLATE; - } else { - ZLIBG(ob_gzhandler_status) = -1; - RETURN_FALSE; - } - - do_start = ((mode & PHP_OUTPUT_HANDLER_START) ? 1 : 0); - do_end = ((mode & PHP_OUTPUT_HANDLER_END) ? 1 : 0); - Z_STRVAL_P(return_value) = NULL; - Z_STRLEN_P(return_value) = 0; - - if (php_deflate_string(string, string_len, &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), do_start, do_end TSRMLS_CC) == SUCCESS) { - Z_TYPE_P(return_value) = IS_STRING; - if (do_start) { - switch (ZLIBG(compression_coding)) { - case CODING_GZIP: - if (sapi_add_header("Content-Encoding: gzip", sizeof("Content-Encoding: gzip") - 1, 1) == FAILURE) { - return_original = 1; - } - if (sapi_add_header_ex("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1, 0 TSRMLS_CC)==FAILURE) { - return_original = 1; - } - break; - case CODING_DEFLATE: - if (sapi_add_header("Content-Encoding: deflate", sizeof("Content-Encoding: deflate") - 1, 1) == FAILURE) { - return_original = 1; - } - if (sapi_add_header_ex("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1, 0 TSRMLS_CC)==FAILURE) { - return_original = 1; - } - break; - default: - return_original = 1; - break; - } - } - - if (return_original) { - zval_dtor(return_value); - } - - } else { - return_original = 1; - } - - if (return_original) { - /* return the original string */ - RETURN_STRINGL(string, string_len, 1); - } -} -/* }}} */ - -/* {{{ php_gzip_output_handler - */ -static void php_gzip_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) -{ - zend_bool do_start, do_end; - - if (!ZLIBG(output_compression)) { - *handled_output = NULL; - } else { - do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0); - do_end = (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0); - if (php_deflate_string(output, output_len, handled_output, handled_output_len, do_start, do_end TSRMLS_CC) != SUCCESS) { - zend_error(E_ERROR, "Compression failed"); - } - } -} -/* }}} */ - -/* {{{ php_enable_output_compression - */ -static int php_enable_output_compression(int buffer_size TSRMLS_DC) -{ - zval **a_encoding; - - zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - - if (!PG(http_globals)[TRACK_VARS_SERVER] - || zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void **) &a_encoding) == FAILURE - ) { - return FAILURE; - } - - convert_to_string_ex(a_encoding); - - if (php_memnstr(Z_STRVAL_PP(a_encoding), "gzip", 4, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_GZIP; - } else if (php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_DEFLATE; - } else { - return FAILURE; - } - - php_ob_set_internal_handler(php_gzip_output_handler, (uint)buffer_size, "zlib output compression", 0 TSRMLS_CC); - - if (ZLIBG(output_handler) && strlen(ZLIBG(output_handler))) { - php_start_ob_buffer_named(ZLIBG(output_handler), 0, 1 TSRMLS_CC); - } - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/zlib/zlib.dsp b/ext/zlib/zlib.dsp deleted file mode 100644 index 8986bc6f05949..0000000000000 --- a/ext/zlib/zlib.dsp +++ /dev/null @@ -1,121 +0,0 @@ -# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=zlib - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "zlib - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "zlib - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "zlib - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_zlib.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\zlib\Release" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "zlib - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_zlib.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\zlib\Debug" - -!ENDIF - -# Begin Target - -# Name "zlib - Win32 Release_TS" -# Name "zlib - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\zlib.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_filter.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_zlib.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c deleted file mode 100644 index 8d804989c5795..0000000000000 --- a/ext/zlib/zlib_filter.c +++ /dev/null @@ -1,450 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Sara Golemon (pollita@php.net) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_zlib.h" - -/* {{{ data structure */ - -/* Passed as opaque in malloc callbacks */ -typedef struct _php_zlib_filter_data { - int persistent; - z_stream strm; - char *inbuf; - size_t inbuf_len; - char *outbuf; - size_t outbuf_len; - zend_bool finished; -} php_zlib_filter_data; - -/* }}} */ - -/* {{{ Memory management wrappers */ - -static voidpf php_zlib_alloc(voidpf opaque, uInt items, uInt size) -{ - return (voidpf)safe_pemalloc(items, size, 0, ((php_zlib_filter_data*)opaque)->persistent); -} - -static void php_zlib_free(voidpf opaque, voidpf address) -{ - pefree((void*)address, ((php_zlib_filter_data*)opaque)->persistent); -} -/* }}} */ - -/* {{{ zlib.inflate filter implementation */ - -static php_stream_filter_status_t php_zlib_inflate_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_zlib_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0, original_out, original_in; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - z_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_zlib_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - original_in = data->strm.total_in; - original_out = data->strm.total_out; - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); - while (bin < bucket->buflen) { - - if (data->finished) { - consumed += bucket->buflen; - break; - } - - desired = bucket->buflen - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf + bin, desired); - data->strm.avail_in = desired; - - status = inflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FINISH : Z_SYNC_FLUSH); - if (status == Z_STREAM_END) { - inflateEnd(&(data->strm)); - data->finished = '\1'; - } else if (status != Z_OK) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - consumed += desired; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } else if (status == Z_STREAM_END && data->strm.avail_out >= data->outbuf_len) { - /* no more data to decompress, and nothing was spat out */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_PASS_ON; - } - - } - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (!data->finished && flags & PSFS_FLAG_FLUSH_CLOSE) { - /* Spit it out! */ - status = Z_OK; - while (status == Z_OK) { - status = inflate(&(data->strm), Z_FINISH); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - - return exit_status; -} - -static void php_zlib_inflate_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_zlib_filter_data *data = thisfilter->abstract; - if (!data->finished) { - inflateEnd(&(data->strm)); - } - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_zlib_inflate_ops = { - php_zlib_inflate_filter, - php_zlib_inflate_dtor, - "zlib.inflate" -}; -/* }}} */ - -/* {{{ zlib.inflate filter implementation */ - -static php_stream_filter_status_t php_zlib_deflate_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_zlib_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0, original_out, original_in; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - z_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_zlib_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - original_in = data->strm.total_in; - original_out = data->strm.total_out; - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); - - while (bin < bucket->buflen) { - desired = bucket->buflen - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf + bin, desired); - data->strm.avail_in = desired; - - status = deflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FULL_FLUSH : (flags & PSFS_FLAG_FLUSH_INC ? Z_SYNC_FLUSH : Z_NO_FLUSH)); - if (status != Z_OK) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - consumed += desired; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - /* Spit it out! */ - status = Z_OK; - while (status == Z_OK) { - status = deflate(&(data->strm), Z_FINISH); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - return exit_status; -} - -static void php_zlib_deflate_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_zlib_filter_data *data = thisfilter->abstract; - deflateEnd(&(data->strm)); - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_zlib_deflate_ops = { - php_zlib_deflate_filter, - php_zlib_deflate_dtor, - "zlib.deflate" -}; - -/* }}} */ - -/* {{{ zlib.* common factory */ - -static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) -{ - php_stream_filter_ops *fops = NULL; - php_zlib_filter_data *data; - int status; - - /* Create this filter */ - data = pecalloc(1, sizeof(php_zlib_filter_data), persistent); - if (!data) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes.", sizeof(php_zlib_filter_data)); - return NULL; - } - - /* Circular reference */ - data->strm.opaque = (voidpf) data; - - data->strm.zalloc = (alloc_func) php_zlib_alloc; - data->strm.zfree = (free_func) php_zlib_free; - data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048; - data->strm.next_in = data->inbuf = (Bytef *) pemalloc(data->inbuf_len, persistent); - if (!data->inbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes.", data->inbuf_len); - pefree(data, persistent); - return NULL; - } - data->strm.avail_in = 0; - data->strm.next_out = data->outbuf = (Bytef *) pemalloc(data->outbuf_len, persistent); - if (!data->outbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes.", data->outbuf_len); - pefree(data->inbuf, persistent); - pefree(data, persistent); - return NULL; - } - - data->strm.data_type = Z_ASCII; - - if (strcasecmp(filtername, "zlib.inflate") == 0) { - int windowBits = -MAX_WBITS; - - if (filterparams) { - zval **tmpzval; - - if ((Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) && - zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void **) &tmpzval) == SUCCESS) { - zval tmp; - - /* log-2 base of history window (9 - 15) */ - tmp = **tmpzval; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > MAX_WBITS + 32) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL(tmp)); - } else { - windowBits = Z_LVAL(tmp); - } - } - } - - /* RFC 1951 Inflate */ - data->finished = '\0'; - status = inflateInit2(&(data->strm), windowBits); - fops = &php_zlib_inflate_ops; - } else if (strcasecmp(filtername, "zlib.deflate") == 0) { - /* RFC 1951 Deflate */ - int level = Z_DEFAULT_COMPRESSION; - int windowBits = -MAX_WBITS; - int memLevel = MAX_MEM_LEVEL; - - - if (filterparams) { - zval **tmpzval; - - /* filterparams can either be a scalar value to indicate compression level (shortcut method) - Or can be a hash containing one or more of 'window', 'memory', and/or 'level' members. */ - - switch (Z_TYPE_P(filterparams)) { - case IS_ARRAY: - case IS_OBJECT: - if (zend_hash_find(HASH_OF(filterparams), "memory", sizeof("memory"), (void**) &tmpzval) == SUCCESS) { - zval tmp; - - tmp = **tmpzval; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - - /* Memory Level (1 - 9) */ - if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > MAX_MEM_LEVEL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", Z_LVAL(tmp)); - } else { - memLevel = Z_LVAL(tmp); - } - } - - if (zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void**) &tmpzval) == SUCCESS) { - zval tmp; - - tmp = **tmpzval; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - - /* log-2 base of history window (9 - 15) */ - if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > MAX_WBITS + 16) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL(tmp)); - } else { - windowBits = Z_LVAL(tmp); - } - } - - if (zend_hash_find(HASH_OF(filterparams), "level", sizeof("level"), (void**) &tmpzval) == SUCCESS) { - /* Psuedo pass through to catch level validating code */ - goto factory_setlevel; - } - break; - case IS_STRING: - case IS_DOUBLE: - case IS_LONG: - { - zval tmp; - - tmp = *filterparams; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); -factory_setlevel: - /* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */ - if (Z_LVAL(tmp) < -1 || Z_LVAL(tmp) > 9) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid compression level specified. (%ld)", Z_LVAL(tmp)); - } else { - level = Z_LVAL(tmp); - } - } - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filter parameter, ignored."); - } - } - status = deflateInit2(&(data->strm), level, Z_DEFLATED, windowBits, memLevel, 0); - fops = &php_zlib_deflate_ops; - } else { - status = Z_DATA_ERROR; - } - - if (status != Z_OK) { - /* Unspecified (probably strm) error, let stream-filter error do its own whining */ - pefree(data->strm.next_in, persistent); - pefree(data->strm.next_out, persistent); - pefree(data, persistent); - return NULL; - } - - return php_stream_filter_alloc(fops, data, persistent); -} - -php_stream_filter_factory php_zlib_filter_factory = { - php_zlib_filter_create -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c deleted file mode 100644 index e449318ae42ce..0000000000000 --- a/ext/zlib/zlib_fopen_wrapper.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong , based on work by: | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define _GNU_SOURCE - -#include "php.h" -#include "php_zlib.h" -#include "fopen_wrappers.h" - -struct php_gz_stream_data_t { - gzFile gz_file; - php_stream *stream; -}; - -static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - int read; - - read = gzread(self->gz_file, buf, count); - - if (gzeof(self->gz_file)) { - stream->eof = 1; - } - - return (read < 0) ? 0 : read; -} - -static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - int wrote; - - wrote = gzwrite(self->gz_file, (char *) buf, count); - - return (wrote < 0) ? 0 : wrote; -} - -static int php_gziop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - - assert(self != NULL); - - *newoffs = gzseek(self->gz_file, offset, whence); - - return (*newoffs < 0) ? -1 : 0; -} - -static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - int ret = EOF; - - if (close_handle) { - if (self->gz_file) { - ret = gzclose(self->gz_file); - self->gz_file = NULL; - } - if (self->stream) { - php_stream_close(self->stream); - self->stream = NULL; - } - } - efree(self); - - return ret; -} - -static int php_gziop_flush(php_stream *stream TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - - return gzflush(self->gz_file, Z_SYNC_FLUSH); -} - -static php_stream_ops php_stream_gzio_ops = { - php_gziop_write, php_gziop_read, - php_gziop_close, php_gziop_flush, - "ZLIB", - php_gziop_seek, - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = {0}; - php_stream *stream = NULL, *innerstream = NULL; - - /* sanity check the stream: it can be either read-only or write-only */ - if (strchr(mode, '+')) { - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open a zlib stream for reading and writing at the same time!"); - } - return NULL; - } - - self = emalloc(sizeof(*self)); - - if (strncasecmp("compress.zlib://", path, 16) == 0) { - path += 16; - } else if (strncasecmp("zlib:", path, 5) == 0) { - path += 5; - } - - innerstream = php_stream_open_wrapper(path, mode, STREAM_MUST_SEEK | options | STREAM_WILL_CAST, opened_path); - - if (innerstream) { - int fd; - - if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) { - self->gz_file = gzdopen(dup(fd), mode); - self->stream = innerstream; - if (self->gz_file) { - stream = php_stream_alloc_rel(&php_stream_gzio_ops, self, 0, mode); - if (stream) { - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - return stream; - } - gzclose(self->gz_file); - } - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzopen failed"); - } - } else if (innerstream) { - php_stream_close(innerstream); - } - } - - if (stream) { - php_stream_close(stream); - } - - if (self) { - efree(self); - } - - return NULL; -} - -static php_stream_wrapper_ops gzip_stream_wops = { - php_stream_gzopen, - NULL, /* close */ - NULL, /* stat */ - NULL, /* stat_url */ - NULL, /* opendir */ - "ZLIB", - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -php_stream_wrapper php_stream_gzip_wrapper = { - &gzip_stream_wops, - NULL, - 0, /* is_url */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/zlib/zlib_win32_howto.txt b/ext/zlib/zlib_win32_howto.txt deleted file mode 100644 index a4e01a4845e42..0000000000000 --- a/ext/zlib/zlib_win32_howto.txt +++ /dev/null @@ -1,16 +0,0 @@ -Rules for building ZLIB ------------------------ - -The zlib project requires the folowing files: - -php_build\zlib\include\zlib.h -php_build\zlib\include\zconf.h -php_build\zlib\lib\zlibstat.lib - -php_build is a directory at the same level as php5. - -Start Visual Studio, load php_modules.dsw, select the ZLIB projects, and build -it. - - - \ No newline at end of file diff --git a/main/SAPI.c b/main/SAPI.c deleted file mode 100644 index a5699252b1f4d..0000000000000 --- a/main/SAPI.c +++ /dev/null @@ -1,1012 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Original design: Shane Caraveo | - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include - -#include "php.h" -#include "SAPI.h" -#include "php_variables.h" -#include "php_ini.h" -#include "ext/standard/php_string.h" -#include "ext/standard/pageinfo.h" -#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) -#include "ext/pcre/php_pcre.h" -#endif -#if HAVE_ZLIB -#include "ext/zlib/php_zlib.h" -#endif -#ifdef ZTS -#include "TSRM.h" -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#include "rfc1867.h" - -#ifdef PHP_WIN32 -#define STRCASECMP stricmp -#else -#define STRCASECMP strcasecmp -#endif - -#include "php_content_types.h" - -#ifdef ZTS -SAPI_API int sapi_globals_id; -#else -sapi_globals_struct sapi_globals; -#endif - -static void sapi_globals_ctor(sapi_globals_struct *sapi_globals TSRMLS_DC) -{ - memset(sapi_globals, 0, sizeof(*sapi_globals)); - zend_hash_init_ex(&sapi_globals->known_post_content_types, 5, NULL, NULL, 1, 0); - php_setup_sapi_content_types(TSRMLS_C); -} - -static void sapi_globals_dtor(sapi_globals_struct *sapi_globals TSRMLS_DC) -{ - zend_hash_destroy(&sapi_globals->known_post_content_types); -} - -/* True globals (no need for thread safety) */ -SAPI_API sapi_module_struct sapi_module; - - -SAPI_API void sapi_startup(sapi_module_struct *sf) -{ - sf->ini_entries = NULL; - sapi_module = *sf; - -#ifdef ZTS - ts_allocate_id(&sapi_globals_id, sizeof(sapi_globals_struct), (ts_allocate_ctor) sapi_globals_ctor, (ts_allocate_dtor) sapi_globals_dtor); -#else - sapi_globals_ctor(&sapi_globals); -#endif - - virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */ - -#ifdef PHP_WIN32 - tsrm_win32_startup(); -#endif - - reentrancy_startup(); -} - -SAPI_API void sapi_shutdown(void) -{ -#ifdef ZTS - ts_free_id(sapi_globals_id); -#else - sapi_globals_dtor(&sapi_globals); -#endif - - reentrancy_shutdown(); - - virtual_cwd_shutdown(); - -#ifdef PHP_WIN32 - tsrm_win32_shutdown(); -#endif -} - - -SAPI_API void sapi_free_header(sapi_header_struct *sapi_header) -{ - efree(sapi_header->header); -} - - -SAPI_API void sapi_handle_post(void *arg TSRMLS_DC) -{ - if (SG(request_info).post_entry && SG(request_info).content_type_dup) { - SG(request_info).post_entry->post_handler(SG(request_info).content_type_dup, arg TSRMLS_CC); - if (SG(request_info).post_data) { - efree(SG(request_info).post_data); - SG(request_info).post_data = NULL; - } - efree(SG(request_info).content_type_dup); - SG(request_info).content_type_dup = NULL; - } -} - -static void sapi_read_post_data(TSRMLS_D) -{ - sapi_post_entry *post_entry; - uint content_type_length = strlen(SG(request_info).content_type); - char *content_type = estrndup(SG(request_info).content_type, content_type_length); - char *p; - char oldchar=0; - void (*post_reader_func)(TSRMLS_D) = NULL; - - - /* dedicated implementation for increased performance: - * - Make the content type lowercase - * - Trim descriptive data, stay with the content-type only - */ - for (p=content_type; ppost_reader; - } else { - /* fallback */ - SG(request_info).post_entry = NULL; - if (!sapi_module.default_post_reader) { - /* no default reader ? */ - SG(request_info).content_type_dup = NULL; - sapi_module.sapi_error(E_WARNING, "Unsupported content type: '%s'", content_type); - return; - } - } - if (oldchar) { - *(p-1) = oldchar; - } - - SG(request_info).content_type_dup = content_type; - - if(post_reader_func) { - post_reader_func(TSRMLS_C); - } - - if(sapi_module.default_post_reader) { - sapi_module.default_post_reader(TSRMLS_C); - } -} - - -SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data) -{ - int read_bytes; - int allocated_bytes=SAPI_POST_BLOCK_SIZE+1; - - if (SG(request_info).content_length > SG(post_max_size)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", - SG(request_info).content_length, SG(post_max_size)); - return; - } - SG(request_info).post_data = emalloc(allocated_bytes); - - for (;;) { - read_bytes = sapi_module.read_post(SG(request_info).post_data+SG(read_post_bytes), SAPI_POST_BLOCK_SIZE TSRMLS_CC); - if (read_bytes<=0) { - break; - } - SG(read_post_bytes) += read_bytes; - if (SG(read_post_bytes) > SG(post_max_size)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match Content-Length, and exceeds %ld bytes", SG(post_max_size)); - break; - } - if (read_bytes < SAPI_POST_BLOCK_SIZE) { - break; - } - if (SG(read_post_bytes)+SAPI_POST_BLOCK_SIZE >= allocated_bytes) { - allocated_bytes = SG(read_post_bytes)+SAPI_POST_BLOCK_SIZE+1; - SG(request_info).post_data = erealloc(SG(request_info).post_data, allocated_bytes); - } - } - SG(request_info).post_data[SG(read_post_bytes)] = 0; /* terminating NULL */ - SG(request_info).post_data_length = SG(read_post_bytes); -} - - -SAPI_API char *sapi_get_default_content_type(TSRMLS_D) -{ - char *mimetype, *charset, *content_type; - - mimetype = SG(default_mimetype) ? SG(default_mimetype) : SAPI_DEFAULT_MIMETYPE; - charset = SG(default_charset) ? SG(default_charset) : SAPI_DEFAULT_CHARSET; - - if (strncasecmp(mimetype, "text/", 5) == 0 && *charset) { - int len = strlen(mimetype) + sizeof("; charset=") + strlen(charset); /* sizeof() includes \0 */ - content_type = emalloc(len); - snprintf(content_type, len, "%s; charset=%s", mimetype, charset); - } else { - content_type = estrdup(mimetype); - } - return content_type; -} - - -SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header TSRMLS_DC) -{ - char *default_content_type = sapi_get_default_content_type(TSRMLS_C); - int default_content_type_len = strlen(default_content_type); - - default_header->header_len = (sizeof("Content-type: ")-1) + default_content_type_len; - default_header->header = emalloc(default_header->header_len+1); - memcpy(default_header->header, "Content-type: ", sizeof("Content-type: ")); - memcpy(default_header->header+sizeof("Content-type: ")-1, default_content_type, default_content_type_len); - default_header->header[default_header->header_len] = 0; - efree(default_content_type); -} - -/* - * Add charset on content-type header if the MIME type starts with - * "text/", the default_charset directive is not empty and - * there is not already a charset option in there. - * - * If "mimetype" is non-NULL, it should point to a pointer allocated - * with emalloc(). If a charset is added, the string will be - * re-allocated and the new length is returned. If mimetype is - * unchanged, 0 is returned. - * - */ -SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC) -{ - char *charset, *newtype; - size_t newlen; - charset = SG(default_charset) ? SG(default_charset) : SAPI_DEFAULT_CHARSET; - - if (*mimetype != NULL) { - if (*charset && strncmp(*mimetype, "text/", 5) == 0 && strstr(*mimetype, "charset=") == NULL) { - newlen = len + (sizeof(";charset=")-1) + strlen(charset); - newtype = emalloc(newlen + 1); - PHP_STRLCPY(newtype, *mimetype, newlen + 1, len); - strlcat(newtype, ";charset=", newlen + 1); - strlcat(newtype, charset, newlen + 1); - efree(*mimetype); - *mimetype = newtype; - return newlen; - } - } - return 0; -} - -SAPI_API void sapi_activate_headers_only(TSRMLS_D) -{ - if (SG(request_info).headers_read == 1) - return; - SG(request_info).headers_read = 1; - zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct), - (void (*)(void *)) sapi_free_header, 0); - SG(sapi_headers).send_default_content_type = 1; - - /* SG(sapi_headers).http_response_code = 200; */ - SG(sapi_headers).http_status_line = NULL; - SG(sapi_headers).mimetype = NULL; - SG(read_post_bytes) = 0; - SG(request_info).post_data = NULL; - SG(request_info).raw_post_data = NULL; - SG(request_info).current_user = NULL; - SG(request_info).current_user_length = 0; - SG(request_info).no_headers = 0; - SG(request_info).post_entry = NULL; - SG(global_request_time) = 0; - - /* - * It's possible to override this general case in the activate() callback, - * if necessary. - */ - if (SG(request_info).request_method && !strcmp(SG(request_info).request_method, "HEAD")) { - SG(request_info).headers_only = 1; - } else { - SG(request_info).headers_only = 0; - } - if (SG(server_context)) { - SG(request_info).cookie_data = sapi_module.read_cookies(TSRMLS_C); - if (sapi_module.activate) { - sapi_module.activate(TSRMLS_C); - } - } -} - -/* - * Called from php_request_startup() for every request. - */ - -SAPI_API void sapi_activate(TSRMLS_D) -{ - zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct), (void (*)(void *)) sapi_free_header, 0); - SG(sapi_headers).send_default_content_type = 1; - - /* - SG(sapi_headers).http_response_code = 200; - */ - SG(sapi_headers).http_status_line = NULL; - SG(sapi_headers).mimetype = NULL; - SG(headers_sent) = 0; - SG(read_post_bytes) = 0; - SG(request_info).post_data = NULL; - SG(request_info).raw_post_data = NULL; - SG(request_info).current_user = NULL; - SG(request_info).current_user_length = 0; - SG(request_info).no_headers = 0; - SG(request_info).post_entry = NULL; - SG(request_info).proto_num = 1000; /* Default to HTTP 1.0 */ - SG(global_request_time) = 0; - - /* It's possible to override this general case in the activate() callback, if - * necessary. - */ - if (SG(request_info).request_method && !strcmp(SG(request_info).request_method, "HEAD")) { - SG(request_info).headers_only = 1; - } else { - SG(request_info).headers_only = 0; - } - SG(rfc1867_uploaded_files) = NULL; - - /* handle request mehtod */ - if (SG(server_context)) { - if ( SG(request_info).request_method) { - if(!strcmp(SG(request_info).request_method, "POST") - && (SG(request_info).content_type)) { - /* HTTP POST -> may contain form data to be read into variables - depending on content type given - */ - sapi_read_post_data(TSRMLS_C); - } else { - /* any other method with content payload will fill - $HTTP_RAW_POST_DATA if enabled by always_populate_raw_post_data - it is up to the webserver to decide whether to allow a method or not - */ - SG(request_info).content_type_dup = NULL; - if(sapi_module.default_post_reader) { - sapi_module.default_post_reader(TSRMLS_C); - } - } - } else { - SG(request_info).content_type_dup = NULL; - } - - /* Cookies */ - SG(request_info).cookie_data = sapi_module.read_cookies(TSRMLS_C); - if (sapi_module.activate) { - sapi_module.activate(TSRMLS_C); - } - } -} - - -static void sapi_send_headers_free(TSRMLS_D) -{ - if (SG(sapi_headers).http_status_line) { - efree(SG(sapi_headers).http_status_line); - SG(sapi_headers).http_status_line = NULL; - } -} - -SAPI_API void sapi_deactivate(TSRMLS_D) -{ - zend_llist_destroy(&SG(sapi_headers).headers); - if (SG(request_info).post_data) { - efree(SG(request_info).post_data); - } else if (SG(server_context)) { - if(sapi_module.read_post) { - /* make sure we've consumed all request input data */ - char dummy[SAPI_POST_BLOCK_SIZE]; - int read_bytes; - - while((read_bytes = sapi_module.read_post(dummy, sizeof(dummy)-1 TSRMLS_CC)) > 0) { - SG(read_post_bytes) += read_bytes; - } - } - } - if (SG(request_info).raw_post_data) { - efree(SG(request_info).raw_post_data); - } - if (SG(request_info).auth_user) { - efree(SG(request_info).auth_user); - } - if (SG(request_info).auth_password) { - efree(SG(request_info).auth_password); - } - if (SG(request_info).auth_digest) { - efree(SG(request_info).auth_digest); - } - if (SG(request_info).content_type_dup) { - efree(SG(request_info).content_type_dup); - } - if (SG(request_info).current_user) { - efree(SG(request_info).current_user); - } - if (sapi_module.deactivate) { - sapi_module.deactivate(TSRMLS_C); - } - if (SG(rfc1867_uploaded_files)) { - destroy_uploaded_files_hash(TSRMLS_C); - } - if (SG(sapi_headers).mimetype) { - efree(SG(sapi_headers).mimetype); - SG(sapi_headers).mimetype = NULL; - } - sapi_send_headers_free(TSRMLS_C); - SG(sapi_started) = 0; - SG(headers_sent) = 0; - SG(request_info).headers_read = 0; - SG(global_request_time) = 0; -} - - -SAPI_API void sapi_initialize_empty_request(TSRMLS_D) -{ - SG(server_context) = NULL; - SG(request_info).request_method = NULL; - SG(request_info).auth_digest = SG(request_info).auth_user = SG(request_info).auth_password = NULL; - SG(request_info).content_type_dup = NULL; -} - - -static int sapi_extract_response_code(const char *header_line) -{ - int code = 200; - const char *ptr; - - for (ptr = header_line; *ptr; ptr++) { - if (*ptr == ' ' && *(ptr + 1) != ' ') { - code = atoi(ptr + 1); - break; - } - } - - return code; -} - - -static void sapi_update_response_code(int ncode TSRMLS_DC) -{ - /* if the status code did not change, we do not want - to change the status line, and no need to change the code */ - if (SG(sapi_headers).http_response_code == ncode) { - return; - } - - if (SG(sapi_headers).http_status_line) { - efree(SG(sapi_headers).http_status_line); - SG(sapi_headers).http_status_line = NULL; - } - SG(sapi_headers).http_response_code = ncode; -} - -static int sapi_find_matching_header(void *element1, void *element2) -{ - return strncasecmp(((sapi_header_struct*)element1)->header, (char*)element2, strlen((char*)element2)) == 0; -} - -SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC) -{ - sapi_header_line ctr = {0}; - int r; - - ctr.line = header_line; - ctr.line_len = header_line_len; - - r = sapi_header_op(replace ? SAPI_HEADER_REPLACE : SAPI_HEADER_ADD, - &ctr TSRMLS_CC); - - if (!duplicate) - efree(header_line); - - return r; -} - -SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) -{ - int retval; - sapi_header_struct sapi_header; - char *colon_offset; - long myuid = 0L; - char *header_line; - uint header_line_len; - zend_bool replace; - int http_response_code; - - if (SG(headers_sent) && !SG(request_info).no_headers) { - char *output_start_filename = php_get_output_start_filename(TSRMLS_C); - int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); - - if (output_start_filename) { - sapi_module.sapi_error(E_WARNING, "Cannot modify header information - headers already sent by (output started at %s:%d)", - output_start_filename, output_start_lineno); - } else { - sapi_module.sapi_error(E_WARNING, "Cannot modify header information - headers already sent"); - } - return FAILURE; - } - - switch (op) { - case SAPI_HEADER_SET_STATUS: - sapi_update_response_code((int)(zend_intptr_t) arg TSRMLS_CC); - return SUCCESS; - - case SAPI_HEADER_REPLACE: - case SAPI_HEADER_ADD: { - sapi_header_line *p = arg; - - if (!p->line || !p->line_len) { - return FAILURE; - } - header_line = p->line; - header_line_len = p->line_len; - http_response_code = p->response_code; - replace = (op == SAPI_HEADER_REPLACE); - break; - } - - default: - return FAILURE; - } - - header_line = estrndup(header_line, header_line_len); - - /* cut of trailing spaces, linefeeds and carriage-returns */ - while(header_line_len && isspace(header_line[header_line_len-1])) - header_line[--header_line_len]='\0'; - - /* new line safety check */ - { - char *s = header_line, *e = header_line + header_line_len, *p; - while (s < e && (p = memchr(s, '\n', (e - s)))) { - if (*(p + 1) == ' ' || *(p + 1) == '\t') { - s = p + 1; - continue; - } - efree(header_line); - sapi_module.sapi_error(E_WARNING, "Header may not contain more than a single header, new line detected."); - return FAILURE; - } - } - - sapi_header.header = header_line; - sapi_header.header_len = header_line_len; - sapi_header.replace = replace; - - /* Check the header for a few cases that we have special support for in SAPI */ - if (header_line_len>=5 - && !strncasecmp(header_line, "HTTP/", 5)) { - /* filter out the response code */ - sapi_update_response_code(sapi_extract_response_code(header_line) TSRMLS_CC); - /* sapi_update_response_code doesn't free the status line if the code didn't change */ - if (SG(sapi_headers).http_status_line) { - efree(SG(sapi_headers).http_status_line); - } - SG(sapi_headers).http_status_line = header_line; - return SUCCESS; - } else { - colon_offset = strchr(header_line, ':'); - if (colon_offset) { - *colon_offset = 0; - if (!STRCASECMP(header_line, "Content-Type")) { - char *ptr = colon_offset+1, *mimetype = NULL, *newheader; - size_t len = header_line_len - (ptr - header_line), newlen; - while (*ptr == ' ') { - ptr++; - len--; - } -#if HAVE_ZLIB - if(!strncmp(ptr, "image/", sizeof("image/")-1)) { - zend_alter_ini_entry("zlib.output_compression", sizeof("zlib.output_compression"), "0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - } -#endif - mimetype = estrdup(ptr); - newlen = sapi_apply_default_charset(&mimetype, len TSRMLS_CC); - if (!SG(sapi_headers).mimetype){ - SG(sapi_headers).mimetype = estrdup(mimetype); - } - - if (newlen != 0) { - newlen += sizeof("Content-type: "); - newheader = emalloc(newlen); - PHP_STRLCPY(newheader, "Content-type: ", newlen, sizeof("Content-type: ")-1); - strlcat(newheader, mimetype, newlen); - sapi_header.header = newheader; - sapi_header.header_len = newlen - 1; - efree(header_line); - } - efree(mimetype); - SG(sapi_headers).send_default_content_type = 0; - } else if (!STRCASECMP(header_line, "Location")) { - if ((SG(sapi_headers).http_response_code < 300 || - SG(sapi_headers).http_response_code > 307) && - SG(sapi_headers).http_response_code != 201) { - /* Return a Found Redirect if one is not already specified */ - if (http_response_code) { /* user specified redirect code */ - sapi_update_response_code(http_response_code TSRMLS_CC); - } else if (SG(request_info).proto_num > 1000 && - SG(request_info).request_method && - strcmp(SG(request_info).request_method, "HEAD") && - strcmp(SG(request_info).request_method, "GET")) { - sapi_update_response_code(303 TSRMLS_CC); - } else { - sapi_update_response_code(302 TSRMLS_CC); - } - } - } else if (!STRCASECMP(header_line, "WWW-Authenticate")) { /* HTTP Authentication */ - - sapi_update_response_code(401 TSRMLS_CC); /* authentication-required */ - - if(PG(safe_mode)) -#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) - { - zval *repl_temp; - char *ptr = colon_offset+1, *result, *newheader; - int ptr_len=0, result_len = 0, newlen = 0; - - /* skip white space */ - while (isspace(*ptr)) { - ptr++; - } - - myuid = php_getuid(); - - ptr_len = strlen(ptr); - MAKE_STD_ZVAL(repl_temp); - Z_TYPE_P(repl_temp) = IS_STRING; - Z_STRLEN_P(repl_temp) = spprintf(&Z_STRVAL_P(repl_temp), 0, "realm=\"\\1-%ld\"", myuid); - /* Modify quoted realm value */ - result = php_pcre_replace("/realm=\"(.*?)\"/i", 16, - ptr, ptr_len, - repl_temp, - 0, &result_len, -1, NULL TSRMLS_CC); - if(result_len==ptr_len) { - efree(result); - efree(Z_STRVAL_P(repl_temp)); - Z_STRLEN_P(repl_temp) = spprintf(&Z_STRVAL_P(repl_temp), 0, "realm=\\1-%ld\\2", myuid); - /* modify unquoted realm value */ - result = php_pcre_replace("/realm=([^\\s]+)(.*)/i", 21, - ptr, ptr_len, - repl_temp, - 0, &result_len, -1, NULL TSRMLS_CC); - if(result_len==ptr_len) { - char *lower_temp = estrdup(ptr); - char conv_temp[32]; - int conv_len; - - php_strtolower(lower_temp,strlen(lower_temp)); - /* If there is no realm string at all, append one */ - if(!strstr(lower_temp,"realm")) { - efree(result); - conv_len = slprintf(conv_temp, sizeof(conv_temp), " realm=\"%ld\"",myuid); - result = emalloc(ptr_len+conv_len+1); - result_len = ptr_len+conv_len; - memcpy(result, ptr, ptr_len); - memcpy(result+ptr_len, conv_temp, conv_len); - *(result+ptr_len+conv_len) = '\0'; - } - efree(lower_temp); - } - } - newlen = spprintf(&newheader, 0, "WWW-Authenticate: %s", result); - efree(header_line); - sapi_header.header = newheader; - sapi_header.header_len = newlen; - efree(result); - efree(Z_STRVAL_P(repl_temp)); - efree(repl_temp); - } -#else - { - myuid = php_getuid(); - efree(header_line); - sapi_header.header_len = spprintf(&sapi_header.header, 0, "WWW-Authenticate: Basic realm=\"%ld\"", myuid); - } -#endif - } - if (sapi_header.header==header_line) { - *colon_offset = ':'; - } - } - } - if (http_response_code) { - sapi_update_response_code(http_response_code TSRMLS_CC); - } - if (sapi_module.header_handler) { - retval = sapi_module.header_handler(&sapi_header, &SG(sapi_headers) TSRMLS_CC); - } else { - retval = SAPI_HEADER_ADD; - } - if (retval & SAPI_HEADER_DELETE_ALL) { - zend_llist_clean(&SG(sapi_headers).headers); - } - if (retval & SAPI_HEADER_ADD) { - /* in replace mode first remove the header if it already exists in the headers llist */ - if (replace) { - colon_offset = strchr(sapi_header.header, ':'); - if (colon_offset) { - char sav; - colon_offset++; - sav = *colon_offset; - *colon_offset = 0; - zend_llist_del_element(&SG(sapi_headers).headers, sapi_header.header, (int(*)(void*, void*))sapi_find_matching_header); - *colon_offset = sav; - } - } - - zend_llist_add_element(&SG(sapi_headers).headers, (void *) &sapi_header); - } - return SUCCESS; -} - - -SAPI_API int sapi_send_headers(TSRMLS_D) -{ - int retval; - int ret = FAILURE; - - if (SG(headers_sent) || SG(request_info).no_headers) { - return SUCCESS; - } - -#if HAVE_ZLIB - /* Add output compression headers at this late stage in order to make - it possible to switch it off inside the script. */ - - if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) { - zval nm_zlib_get_coding_type; - zval *uf_result = NULL; - - ZVAL_STRINGL(&nm_zlib_get_coding_type, "zlib_get_coding_type", sizeof("zlib_get_coding_type") - 1, 0); - - if (call_user_function_ex(CG(function_table), NULL, &nm_zlib_get_coding_type, &uf_result, 0, NULL, 1, NULL TSRMLS_CC) != FAILURE && uf_result != NULL && Z_TYPE_P(uf_result) == IS_STRING) { - char buf[128]; - int len; - - assert(Z_STRVAL_P(uf_result) != NULL); - - len = slprintf(buf, sizeof(buf), "Content-Encoding: %s", Z_STRVAL_P(uf_result)); - if (len <= 0 || sapi_add_header(buf, len, 1) == FAILURE) { - return FAILURE; - } - if (sapi_add_header_ex("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1, 0 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - } - if (uf_result != NULL) { - zval_ptr_dtor(&uf_result); - } - } -#endif - - /* Success-oriented. We set headers_sent to 1 here to avoid an infinite loop - * in case of an error situation. - */ - if (SG(sapi_headers).send_default_content_type && sapi_module.send_headers) { - sapi_header_struct default_header; - sapi_get_default_content_type_header(&default_header TSRMLS_CC); - sapi_add_header_ex(default_header.header, default_header.header_len, 0, 0 TSRMLS_CC); - } - - SG(headers_sent) = 1; - - if (sapi_module.send_headers) { - retval = sapi_module.send_headers(&SG(sapi_headers) TSRMLS_CC); - } else { - retval = SAPI_HEADER_DO_SEND; - } - - switch (retval) { - case SAPI_HEADER_SENT_SUCCESSFULLY: - ret = SUCCESS; - break; - case SAPI_HEADER_DO_SEND: { - sapi_header_struct http_status_line; - char buf[255]; - - if (SG(sapi_headers).http_status_line) { - http_status_line.header = SG(sapi_headers).http_status_line; - http_status_line.header_len = strlen(SG(sapi_headers).http_status_line); - } else { - http_status_line.header = buf; - http_status_line.header_len = slprintf(buf, sizeof(buf), "HTTP/1.0 %d X", SG(sapi_headers).http_response_code); - } - sapi_module.send_header(&http_status_line, SG(server_context) TSRMLS_CC); - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) sapi_module.send_header, SG(server_context) TSRMLS_CC); - if(SG(sapi_headers).send_default_content_type) { - sapi_header_struct default_header; - - sapi_get_default_content_type_header(&default_header TSRMLS_CC); - sapi_module.send_header(&default_header, SG(server_context) TSRMLS_CC); - sapi_free_header(&default_header); - } - sapi_module.send_header(NULL, SG(server_context) TSRMLS_CC); - ret = SUCCESS; - break; - case SAPI_HEADER_SEND_FAILED: - SG(headers_sent) = 0; - ret = FAILURE; - break; - } - - sapi_send_headers_free(TSRMLS_C); - - return ret; -} - - -SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entries TSRMLS_DC) -{ - sapi_post_entry *p=post_entries; - - while (p->content_type) { - if (sapi_register_post_entry(p TSRMLS_CC) == FAILURE) { - return FAILURE; - } - p++; - } - return SUCCESS; -} - - -SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC) -{ - if (SG(sapi_started) && EG(in_execution)) { - return FAILURE; - } - return zend_hash_add(&SG(known_post_content_types), - post_entry->content_type, post_entry->content_type_len+1, - (void *) post_entry, sizeof(sapi_post_entry), NULL); -} - -SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC) -{ - if (SG(sapi_started) && EG(in_execution)) { - return; - } - zend_hash_del(&SG(known_post_content_types), post_entry->content_type, - post_entry->content_type_len+1); -} - - -SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D)) -{ - TSRMLS_FETCH(); - if (SG(sapi_started) && EG(in_execution)) { - return FAILURE; - } - sapi_module.default_post_reader = default_post_reader; - return SUCCESS; -} - - -SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC)) -{ - TSRMLS_FETCH(); - if (SG(sapi_started) && EG(in_execution)) { - return FAILURE; - } - sapi_module.treat_data = treat_data; - return SUCCESS; -} - -SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)) -{ - TSRMLS_FETCH(); - if (SG(sapi_started) && EG(in_execution)) { - return FAILURE; - } - sapi_module.input_filter = input_filter; - return SUCCESS; -} - -SAPI_API int sapi_flush(TSRMLS_D) -{ - if (sapi_module.flush) { - sapi_module.flush(SG(server_context)); - return SUCCESS; - } else { - return FAILURE; - } -} - -SAPI_API struct stat *sapi_get_stat(TSRMLS_D) -{ - if (sapi_module.get_stat) { - return sapi_module.get_stat(TSRMLS_C); - } else { - if (!SG(request_info).path_translated || (VCWD_STAT(SG(request_info).path_translated, &SG(global_stat)) == -1)) { - return NULL; - } - return &SG(global_stat); - } -} - -SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC) -{ - if (sapi_module.getenv) { - char *value, *tmp = sapi_module.getenv(name, name_len TSRMLS_CC); - if (tmp) { - value = estrdup(tmp); - } else { - return NULL; - } - sapi_module.input_filter(PARSE_ENV, name, &value, strlen(value), NULL TSRMLS_CC); - return value; - } - return NULL; -} - -SAPI_API int sapi_get_fd(int *fd TSRMLS_DC) -{ - if (sapi_module.get_fd) { - return sapi_module.get_fd(fd TSRMLS_CC); - } else { - return FAILURE; - } -} - -SAPI_API int sapi_force_http_10(TSRMLS_D) -{ - if (sapi_module.force_http_10) { - return sapi_module.force_http_10(TSRMLS_C); - } else { - return FAILURE; - } -} - - -SAPI_API int sapi_get_target_uid(uid_t *obj TSRMLS_DC) -{ - if (sapi_module.get_target_uid) { - return sapi_module.get_target_uid(obj TSRMLS_CC); - } else { - return FAILURE; - } -} - -SAPI_API int sapi_get_target_gid(gid_t *obj TSRMLS_DC) -{ - if (sapi_module.get_target_gid) { - return sapi_module.get_target_gid(obj TSRMLS_CC); - } else { - return FAILURE; - } -} - -SAPI_API time_t sapi_get_request_time(TSRMLS_D) -{ - if(SG(global_request_time)) return SG(global_request_time); - - if (sapi_module.get_request_time && SG(server_context)) { - SG(global_request_time) = sapi_module.get_request_time(TSRMLS_C); - } else { - SG(global_request_time) = time(0); - } - return SG(global_request_time); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/SAPI.h b/main/SAPI.h deleted file mode 100644 index e3d7279785b7a..0000000000000 --- a/main/SAPI.h +++ /dev/null @@ -1,308 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef SAPI_H -#define SAPI_H - -#include "zend.h" -#include "zend_llist.h" -#include "zend_operators.h" -#ifdef PHP_WIN32 -#include "win95nt.h" -#endif -#include - -#define SAPI_OPTION_NO_CHDIR 1 - -#define SAPI_POST_BLOCK_SIZE 4000 - -#ifdef PHP_WIN32 -# ifdef SAPI_EXPORTS -# define SAPI_API __declspec(dllexport) -# else -# define SAPI_API __declspec(dllimport) -# endif -#else -#define SAPI_API -#endif - -#undef shutdown - -typedef struct { - char *header; - uint header_len; - zend_bool replace; -} sapi_header_struct; - - -typedef struct { - zend_llist headers; - int http_response_code; - unsigned char send_default_content_type; - char *mimetype; - char *http_status_line; -} sapi_headers_struct; - - -typedef struct _sapi_post_entry sapi_post_entry; -typedef struct _sapi_module_struct sapi_module_struct; - -BEGIN_EXTERN_C() -extern SAPI_API sapi_module_struct sapi_module; /* true global */ -END_EXTERN_C() - -/* Some values in this structure needs to be filled in before - * calling sapi_activate(). We WILL change the `char *' entries, - * so make sure that you allocate a separate buffer for them - * and that you free them after sapi_deactivate(). - */ - -typedef struct { - const char *request_method; - char *query_string; - char *post_data, *raw_post_data; - char *cookie_data; - long content_length; - uint post_data_length, raw_post_data_length; - - char *path_translated; - char *request_uri; - - const char *content_type; - - zend_bool headers_only; - zend_bool no_headers; - zend_bool headers_read; - - sapi_post_entry *post_entry; - - char *content_type_dup; - - /* for HTTP authentication */ - char *auth_user; - char *auth_password; - char *auth_digest; - - /* this is necessary for the CGI SAPI module */ - char *argv0; - - /* this is necessary for Safe Mode */ - char *current_user; - int current_user_length; - - /* this is necessary for CLI module */ - int argc; - char **argv; - int proto_num; -} sapi_request_info; - - -typedef struct _sapi_globals_struct { - void *server_context; - sapi_request_info request_info; - sapi_headers_struct sapi_headers; - int read_post_bytes; - unsigned char headers_sent; - struct stat global_stat; - char *default_mimetype; - char *default_charset; - HashTable *rfc1867_uploaded_files; - long post_max_size; - int options; - zend_bool sapi_started; - time_t global_request_time; - HashTable known_post_content_types; -} sapi_globals_struct; - - -BEGIN_EXTERN_C() -#ifdef ZTS -# define SG(v) TSRMG(sapi_globals_id, sapi_globals_struct *, v) -SAPI_API extern int sapi_globals_id; -#else -# define SG(v) (sapi_globals.v) -extern SAPI_API sapi_globals_struct sapi_globals; -#endif - -SAPI_API void sapi_startup(sapi_module_struct *sf); -SAPI_API void sapi_shutdown(void); -SAPI_API void sapi_activate(TSRMLS_D); -SAPI_API void sapi_deactivate(TSRMLS_D); -SAPI_API void sapi_initialize_empty_request(TSRMLS_D); -END_EXTERN_C() - -/* - * This is the preferred and maintained API for - * operating on HTTP headers. - */ - -/* - * Always specify a sapi_header_line this way: - * - * sapi_header_line ctr = {0}; - */ - -typedef struct { - char *line; /* If you allocated this, you need to free it yourself */ - uint line_len; - long response_code; /* long due to zend_parse_parameters compatibility */ -} sapi_header_line; - -typedef enum { /* Parameter: */ - SAPI_HEADER_REPLACE, /* sapi_header_line* */ - SAPI_HEADER_ADD, /* sapi_header_line* */ - SAPI_HEADER_SET_STATUS /* int */ -} sapi_header_op_enum; - -BEGIN_EXTERN_C() -SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC); - -/* Deprecated functions. Use sapi_header_op instead. */ -SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC); -#define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1 TSRMLS_CC) - - -SAPI_API int sapi_send_headers(TSRMLS_D); -SAPI_API void sapi_free_header(sapi_header_struct *sapi_header); -SAPI_API void sapi_handle_post(void *arg TSRMLS_DC); - -SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entry TSRMLS_DC); -SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC); -SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC); -SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D)); -SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC)); -SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)); - -SAPI_API int sapi_flush(TSRMLS_D); -SAPI_API struct stat *sapi_get_stat(TSRMLS_D); -SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC); - -SAPI_API char *sapi_get_default_content_type(TSRMLS_D); -SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header TSRMLS_DC); -SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC); -SAPI_API void sapi_activate_headers_only(TSRMLS_D); - -SAPI_API int sapi_get_fd(int *fd TSRMLS_DC); -SAPI_API int sapi_force_http_10(TSRMLS_D); - -SAPI_API int sapi_get_target_uid(uid_t * TSRMLS_DC); -SAPI_API int sapi_get_target_gid(gid_t * TSRMLS_DC); -SAPI_API time_t sapi_get_request_time(TSRMLS_D); -END_EXTERN_C() - -struct _sapi_module_struct { - char *name; - char *pretty_name; - - int (*startup)(struct _sapi_module_struct *sapi_module); - int (*shutdown)(struct _sapi_module_struct *sapi_module); - - int (*activate)(TSRMLS_D); - int (*deactivate)(TSRMLS_D); - - int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC); - void (*flush)(void *server_context); - struct stat *(*get_stat)(TSRMLS_D); - char *(*getenv)(char *name, size_t name_len TSRMLS_DC); - - void (*sapi_error)(int type, const char *error_msg, ...); - - int (*header_handler)(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC); - int (*send_headers)(sapi_headers_struct *sapi_headers TSRMLS_DC); - void (*send_header)(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC); - - int (*read_post)(char *buffer, uint count_bytes TSRMLS_DC); - char *(*read_cookies)(TSRMLS_D); - - void (*register_server_variables)(zval *track_vars_array TSRMLS_DC); - void (*log_message)(char *message); - time_t (*get_request_time)(TSRMLS_D); - - char *php_ini_path_override; - - void (*block_interruptions)(void); - void (*unblock_interruptions)(void); - - void (*default_post_reader)(TSRMLS_D); - void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC); - char *executable_location; - - int php_ini_ignore; - - int (*get_fd)(int *fd TSRMLS_DC); - - int (*force_http_10)(TSRMLS_D); - - int (*get_target_uid)(uid_t * TSRMLS_DC); - int (*get_target_gid)(gid_t * TSRMLS_DC); - - unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC); - - void (*ini_defaults)(HashTable *configuration_hash); - int phpinfo_as_text; - - char *ini_entries; -}; - - -struct _sapi_post_entry { - char *content_type; - uint content_type_len; - void (*post_reader)(TSRMLS_D); - void (*post_handler)(char *content_type_dup, void *arg TSRMLS_DC); -}; - -/* header_handler() constants */ -#define SAPI_HEADER_ADD (1<<0) -#define SAPI_HEADER_DELETE_ALL (1<<1) -#define SAPI_HEADER_SEND_NOW (1<<2) - - -#define SAPI_HEADER_SENT_SUCCESSFULLY 1 -#define SAPI_HEADER_DO_SEND 2 -#define SAPI_HEADER_SEND_FAILED 3 - -#define SAPI_DEFAULT_MIMETYPE "text/html" -#define SAPI_DEFAULT_CHARSET "" -#define SAPI_PHP_VERSION_HEADER "X-Powered-By: PHP/" PHP_VERSION - -#define SAPI_POST_READER_FUNC(post_reader) void post_reader(TSRMLS_D) -#define SAPI_POST_HANDLER_FUNC(post_handler) void post_handler(char *content_type_dup, void *arg TSRMLS_DC) - -#define SAPI_TREAT_DATA_FUNC(treat_data) void treat_data(int arg, char *str, zval* destArray TSRMLS_DC) -#define SAPI_INPUT_FILTER_FUNC(input_filter) unsigned int input_filter(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC) - -BEGIN_EXTERN_C() -SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data); -SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader); -SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data); -SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter); -END_EXTERN_C() - -#define STANDARD_SAPI_MODULE_PROPERTIES - -#endif /* SAPI_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/alloca.c b/main/alloca.c deleted file mode 100644 index 401649cee091c..0000000000000 --- a/main/alloca.c +++ /dev/null @@ -1,501 +0,0 @@ -/* alloca.c -- allocate automatically reclaimed memory - (Mostly) portable public-domain implementation -- D A Gwyn - - This implementation of the PWB library alloca function, - which is used to allocate space off the run-time stack so - that it is automatically reclaimed upon procedure exit, - was inspired by discussions with J. Q. Johnson of Cornell. - J.Otto Tennant contributed the Cray support. - - There are some preprocessor constants that can - be defined when compiling for your specific system, for - improved efficiency; however, the defaults should be okay. - - The general concept of this implementation is to keep - track of all alloca-allocated blocks, and reclaim any - that are found to be deeper in the stack than the current - invocation. This heuristic does not reclaim storage as - soon as it becomes invalid, but it will do so eventually. - - As a special case, alloca(0) reclaims storage without - allocating any. It is a good idea to use alloca(0) in - your main control loop, etc. to force garbage collection. */ - -/* $Id$ */ - -#include - -#if !HAVE_ALLOCA - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef emacs -#include "blockinput.h" -#endif - -/* If compiling with GCC 2, this file's not needed. */ -#if !defined (__GNUC__) || __GNUC__ < 2 - -/* If someone has defined alloca as a macro, - there must be some other way alloca is supposed to work. */ -#ifndef alloca - -#ifdef emacs -#ifdef static -/* actually, only want this if static is defined as "" - -- this is for usg, in which emacs must undefine static - in order to make unexec workable - */ -#ifndef STACK_DIRECTION -you -lose --- must know STACK_DIRECTION at compile-time -#endif /* STACK_DIRECTION undefined */ -#endif /* static */ -#endif /* emacs */ - -/* If your stack is a linked list of frames, you have to - provide an "address metric" ADDRESS_FUNCTION macro. */ - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) -long i00afunc (); -#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) -#else -#define ADDRESS_FUNCTION(arg) &(arg) -#endif - -#if __STDC__ -typedef void *pointer; -#else -typedef char *pointer; -#endif - -#ifndef NULL -#define NULL 0 -#endif - -/* Define STACK_DIRECTION if you know the direction of stack - growth for your system; otherwise it will be automatically - deduced at run-time. - - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ - -#ifndef STACK_DIRECTION -#define STACK_DIRECTION 0 /* Direction unknown. */ -#endif - -#if STACK_DIRECTION != 0 - -#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ - -#else /* STACK_DIRECTION == 0; need run-time code. */ - -static int stack_dir; /* 1 or -1 once known. */ -#define STACK_DIR stack_dir - -static void -find_stack_direction () -{ - static char *addr = NULL; /* Address of first `dummy', once known. */ - auto char dummy; /* To get stack address. */ - - if (addr == NULL) - { /* Initial entry. */ - addr = ADDRESS_FUNCTION (dummy); - - find_stack_direction (); /* Recurse once. */ - } - else - { - /* Second entry. */ - if (ADDRESS_FUNCTION (dummy) > addr) - stack_dir = 1; /* Stack grew upward. */ - else - stack_dir = -1; /* Stack grew downward. */ - } -} - -#endif /* STACK_DIRECTION == 0 */ - -/* An "alloca header" is used to: - (a) chain together all alloca'ed blocks; - (b) keep track of stack depth. - - It is very important that sizeof(header) agree with malloc - alignment chunk size. The following default should work okay. */ - -#ifndef ALIGN_SIZE -#define ALIGN_SIZE sizeof(double) -#endif - -typedef union hdr -{ - char align[ALIGN_SIZE]; /* To force sizeof(header). */ - struct - { - union hdr *next; /* For chaining headers. */ - char *deep; /* For stack depth measure. */ - } h; -} header; - -static header *last_alloca_header = NULL; /* -> last alloca header. */ - -/* Return a pointer to at least SIZE bytes of storage, - which will be automatically reclaimed upon exit from - the procedure that called alloca. Originally, this space - was supposed to be taken from the current stack frame of the - caller, but that method cannot be made to work for some - implementations of C, for example under Gould's UTX/32. */ - -pointer -alloca (size) - size_t size; -{ - auto char probe; /* Probes stack depth: */ - register char *depth = ADDRESS_FUNCTION (probe); - -#if STACK_DIRECTION == 0 - if (STACK_DIR == 0) /* Unknown growth direction. */ - find_stack_direction (); -#endif - - /* Reclaim garbage, defined as all alloca'd storage that - was allocated from deeper in the stack than currently. */ - - { - register header *hp; /* Traverses linked list. */ - -#ifdef emacs - BLOCK_INPUT; -#endif - - for (hp = last_alloca_header; hp != NULL;) - if ((STACK_DIR > 0 && hp->h.deep > depth) - || (STACK_DIR < 0 && hp->h.deep < depth)) - { - register header *np = hp->h.next; - - free ((pointer) hp); /* Collect garbage. */ - - hp = np; /* -> next header. */ - } - else - break; /* Rest are not deeper. */ - - last_alloca_header = hp; /* -> last valid storage. */ - -#ifdef emacs - UNBLOCK_INPUT; -#endif - } - - if (size == 0) - return NULL; /* No allocation required. */ - - /* Allocate combined header + user data storage. */ - - { - register pointer new = malloc (sizeof (header) + size); - /* Address of header. */ - - if (new == 0) - abort(); - - ((header *) new)->h.next = last_alloca_header; - ((header *) new)->h.deep = depth; - - last_alloca_header = (header *) new; - - /* User storage begins just after header. */ - - return (pointer) ((char *) new + sizeof (header)); - } -} - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) - -#ifdef DEBUG_I00AFUNC -#include -#endif - -#ifndef CRAY_STACK -#define CRAY_STACK -#ifndef CRAY2 -/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ -struct stack_control_header - { - long shgrow:32; /* Number of times stack has grown. */ - long shaseg:32; /* Size of increments to stack. */ - long shhwm:32; /* High water mark of stack. */ - long shsize:32; /* Current size of stack (all segments). */ - }; - -/* The stack segment linkage control information occurs at - the high-address end of a stack segment. (The stack - grows from low addresses to high addresses.) The initial - part of the stack segment linkage control information is - 0200 (octal) words. This provides for register storage - for the routine which overflows the stack. */ - -struct stack_segment_linkage - { - long ss[0200]; /* 0200 overflow words. */ - long sssize:32; /* Number of words in this segment. */ - long ssbase:32; /* Offset to stack base. */ - long:32; - long sspseg:32; /* Offset to linkage control of previous - segment of stack. */ - long:32; - long sstcpt:32; /* Pointer to task common address block. */ - long sscsnm; /* Private control structure number for - microtasking. */ - long ssusr1; /* Reserved for user. */ - long ssusr2; /* Reserved for user. */ - long sstpid; /* Process ID for pid based multi-tasking. */ - long ssgvup; /* Pointer to multitasking thread giveup. */ - long sscray[7]; /* Reserved for Cray Research. */ - long ssa0; - long ssa1; - long ssa2; - long ssa3; - long ssa4; - long ssa5; - long ssa6; - long ssa7; - long sss0; - long sss1; - long sss2; - long sss3; - long sss4; - long sss5; - long sss6; - long sss7; - }; - -#else /* CRAY2 */ -/* The following structure defines the vector of words - returned by the STKSTAT library routine. */ -struct stk_stat - { - long now; /* Current total stack size. */ - long maxc; /* Amount of contiguous space which would - be required to satisfy the maximum - stack demand to date. */ - long high_water; /* Stack high-water mark. */ - long overflows; /* Number of stack overflow ($STKOFEN) calls. */ - long hits; /* Number of internal buffer hits. */ - long extends; /* Number of block extensions. */ - long stko_mallocs; /* Block allocations by $STKOFEN. */ - long underflows; /* Number of stack underflow calls ($STKRETN). */ - long stko_free; /* Number of deallocations by $STKRETN. */ - long stkm_free; /* Number of deallocations by $STKMRET. */ - long segments; /* Current number of stack segments. */ - long maxs; /* Maximum number of stack segments so far. */ - long pad_size; /* Stack pad size. */ - long current_address; /* Current stack segment address. */ - long current_size; /* Current stack segment size. This - number is actually corrupted by STKSTAT to - include the fifteen word trailer area. */ - long initial_address; /* Address of initial segment. */ - long initial_size; /* Size of initial segment. */ - }; - -/* The following structure describes the data structure which trails - any stack segment. I think that the description in 'asdef' is - out of date. I only describe the parts that I am sure about. */ - -struct stk_trailer - { - long this_address; /* Address of this block. */ - long this_size; /* Size of this block (does not include - this trailer). */ - long unknown2; - long unknown3; - long link; /* Address of trailer block of previous - segment. */ - long unknown5; - long unknown6; - long unknown7; - long unknown8; - long unknown9; - long unknown10; - long unknown11; - long unknown12; - long unknown13; - long unknown14; - }; - -#endif /* CRAY2 */ -#endif /* not CRAY_STACK */ - -#ifdef CRAY2 -/* Determine a "stack measure" for an arbitrary ADDRESS. - I doubt that "lint" will like this much. */ - -static long -i00afunc (long *address) -{ - struct stk_stat status; - struct stk_trailer *trailer; - long *block, size; - long result = 0; - - /* We want to iterate through all of the segments. The first - step is to get the stack status structure. We could do this - more quickly and more directly, perhaps, by referencing the - $LM00 common block, but I know that this works. */ - - STKSTAT (&status); - - /* Set up the iteration. */ - - trailer = (struct stk_trailer *) (status.current_address - + status.current_size - - 15); - - /* There must be at least one stack segment. Therefore it is - a fatal error if "trailer" is null. */ - - if (trailer == 0) - abort (); - - /* Discard segments that do not contain our argument address. */ - - while (trailer != 0) - { - block = (long *) trailer->this_address; - size = trailer->this_size; - if (block == 0 || size == 0) - abort (); - trailer = (struct stk_trailer *) trailer->link; - if ((block <= address) && (address < (block + size))) - break; - } - - /* Set the result to the offset in this segment and add the sizes - of all predecessor segments. */ - - result = address - block; - - if (trailer == 0) - { - return result; - } - - do - { - if (trailer->this_size <= 0) - abort (); - result += trailer->this_size; - trailer = (struct stk_trailer *) trailer->link; - } - while (trailer != 0); - - /* We are done. Note that if you present a bogus address (one - not in any segment), you will get a different number back, formed - from subtracting the address of the first block. This is probably - not what you want. */ - - return (result); -} - -#else /* not CRAY2 */ -/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. - Determine the number of the cell within the stack, - given the address of the cell. The purpose of this - routine is to linearize, in some sense, stack addresses - for alloca. */ - -static long -i00afunc (long address) -{ - long stkl = 0; - - long size, pseg, this_segment, stack; - long result = 0; - - struct stack_segment_linkage *ssptr; - - /* Register B67 contains the address of the end of the - current stack segment. If you (as a subprogram) store - your registers on the stack and find that you are past - the contents of B67, you have overflowed the segment. - - B67 also points to the stack segment linkage control - area, which is what we are really interested in. */ - - stkl = CRAY_STACKSEG_END (); - ssptr = (struct stack_segment_linkage *) stkl; - - /* If one subtracts 'size' from the end of the segment, - one has the address of the first word of the segment. - - If this is not the first segment, 'pseg' will be - nonzero. */ - - pseg = ssptr->sspseg; - size = ssptr->sssize; - - this_segment = stkl - size; - - /* It is possible that calling this routine itself caused - a stack overflow. Discard stack segments which do not - contain the target address. */ - - while (!(this_segment <= address && address <= stkl)) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); -#endif - if (pseg == 0) - break; - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - this_segment = stkl - size; - } - - result = address - this_segment; - - /* If you subtract pseg from the current end of the stack, - you get the address of the previous stack segment's end. - This seems a little convoluted to me, but I'll bet you save - a cycle somewhere. */ - - while (pseg != 0) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o\n", pseg, size); -#endif - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - result += size; - } - return (result); -} - -#endif /* not CRAY2 */ -#endif /* CRAY */ - -#endif /* no alloca */ -#endif /* not GCC version 2 */ -#endif /* HAVE_ALLOCA */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/build-defs.h.in b/main/build-defs.h.in deleted file mode 100644 index 9aa923d0403ae..0000000000000 --- a/main/build-defs.h.in +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- C -*- - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Stig Sæther Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define CONFIGURE_COMMAND "@CONFIGURE_COMMAND@" -#define PHP_ADA_INCLUDE "" -#define PHP_ADA_LFLAGS "" -#define PHP_ADA_LIBS "" -#define PHP_APACHE_INCLUDE "" -#define PHP_APACHE_TARGET "" -#define PHP_FHTTPD_INCLUDE "" -#define PHP_FHTTPD_LIB "" -#define PHP_FHTTPD_TARGET "" -#define PHP_CFLAGS "@CFLAGS@" -#define PHP_DBASE_LIB "" -#define PHP_BUILD_DEBUG "@DEBUG_CFLAGS@" -#define PHP_GDBM_INCLUDE "" -#define PHP_IBASE_INCLUDE "" -#define PHP_IBASE_LFLAGS "" -#define PHP_IBASE_LIBS "" -#define PHP_IFX_INCLUDE "" -#define PHP_IFX_LFLAGS "" -#define PHP_IFX_LIBS "" -#define PHP_INSTALL_IT "@INSTALL_IT@" -#define PHP_IODBC_INCLUDE "" -#define PHP_IODBC_LFLAGS "" -#define PHP_IODBC_LIBS "" -#define PHP_MSQL_INCLUDE "" -#define PHP_MSQL_LFLAGS "" -#define PHP_MSQL_LIBS "" -#define PHP_MYSQL_INCLUDE "@MYSQL_INCLUDE@" -#define PHP_MYSQL_LIBS "@MYSQL_LIBS@" -#define PHP_MYSQL_TYPE "@MYSQL_MODULE_TYPE@" -#define PHP_ODBC_INCLUDE "@ODBC_INCLUDE@" -#define PHP_ODBC_LFLAGS "@ODBC_LFLAGS@" -#define PHP_ODBC_LIBS "@ODBC_LIBS@" -#define PHP_ODBC_TYPE "@ODBC_TYPE@" -#define PHP_OCI8_SHARED_LIBADD "@OCI8_SHARED_LIBADD@" -#define PHP_OCI8_DIR "@OCI8_DIR@" -#define PHP_OCI8_VERSION "@OCI8_VERSION@" -#define PHP_ORACLE_SHARED_LIBADD "@ORACLE_SHARED_LIBADD@" -#define PHP_ORACLE_DIR "@ORACLE_DIR@" -#define PHP_ORACLE_VERSION "@ORACLE_VERSION@" -#define PHP_PGSQL_INCLUDE "" -#define PHP_PGSQL_LFLAGS "" -#define PHP_PGSQL_LIBS "" -#define PHP_PROG_SENDMAIL "@PROG_SENDMAIL@" -#define PHP_SOLID_INCLUDE "" -#define PHP_SOLID_LIBS "" -#define PHP_EMPRESS_INCLUDE "" -#define PHP_EMPRESS_LIBS "" -#define PHP_SYBASE_INCLUDE "" -#define PHP_SYBASE_LFLAGS "" -#define PHP_SYBASE_LIBS "" -#define PHP_DBM_TYPE "" -#define PHP_DBM_LIB "" -#define PHP_LDAP_LFLAGS "" -#define PHP_LDAP_INCLUDE "" -#define PHP_LDAP_LIBS "" -#define PHP_BIRDSTEP_INCLUDE "" -#define PHP_BIRDSTEP_LIBS "" -#define PEAR_INSTALLDIR "@EXPANDED_PEAR_INSTALLDIR@" -#define PHP_INCLUDE_PATH "@INCLUDE_PATH@" -#define PHP_EXTENSION_DIR "@EXPANDED_EXTENSION_DIR@" -#define PHP_PREFIX "@prefix@" -#define PHP_BINDIR "@EXPANDED_BINDIR@" -#define PHP_LIBDIR "@EXPANDED_LIBDIR@" -#define PHP_DATADIR "@EXPANDED_DATADIR@" -#define PHP_SYSCONFDIR "@EXPANDED_SYSCONFDIR@" -#define PHP_LOCALSTATEDIR "@EXPANDED_LOCALSTATEDIR@" -#define PHP_CONFIG_FILE_PATH "@EXPANDED_PHP_CONFIG_FILE_PATH@" -#define PHP_CONFIG_FILE_SCAN_DIR "@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@" -#define PHP_SHLIB_SUFFIX "@SHLIB_DL_SUFFIX_NAME@" diff --git a/main/config.w32.h b/main/config.w32.h deleted file mode 100644 index a86b9cffb6b0a..0000000000000 --- a/main/config.w32.h +++ /dev/null @@ -1,248 +0,0 @@ -/* - Build Configuration for Win32. - This has only been tested with MS VisualC++ 6 (and later). - - $Id$ -*/ - -/* Default PHP / PEAR directories */ -#define CONFIGURATION_FILE_PATH "php.ini" -#define PEAR_INSTALLDIR "c:\\php5\\pear" -#define PHP_BINDIR "c:\\php5" -#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):"" -#define PHP_CONFIG_FILE_SCAN_DIR "" -#define PHP_DATADIR "c:\\php5" -#define PHP_EXTENSION_DIR "c:\\php5" -#define PHP_INCLUDE_PATH ".;c:\\php5\\pear" -#define PHP_LIBDIR "c:\\php5" -#define PHP_LOCALSTATEDIR "c:\\php5" -#define PHP_PREFIX "c:\\php5" -#define PHP_SYSCONFDIR "c:\\php5" - -/* Enable / Disable BCMATH extension (default: enabled) */ -#define HAVE_BCMATH 1 - -/* Enable / Disable crypt() function (default: enabled) */ -#define HAVE_CRYPT 1 -#define PHP_STD_DES_CRYPT 1 -#define PHP_EXT_DES_CRYPT 0 -#define PHP_MD5_CRYPT 1 -#define PHP_BLOWFISH_CRYPT 0 - -/* Enable / Disable CALENDAR extension (default: enabled) */ -#define HAVE_CALENDAR 1 - -/* Enable / Disable CTYPE extension (default: enabled) */ -#define HAVE_CTYPE 1 - -/* Enable / Disable FTP extension (default: enabled) */ -#define HAVE_FTP 1 - -/* Enable / Disable MBSTRING extension (default: disabled) */ -/* #define HAVE_MBSTRING 0 */ -/* #define HAVE_MBREGEX 0 */ -/* #define HAVE_MBSTR_CN 0 */ -/* #define HAVE_MBSTR_JA 0 */ -/* #define HAVE_MBSTR_KR 0 */ -/* #define HAVE_MBSTR_RU 0 */ -/* #define HAVE_MBSTR_TW 0 */ - -/* If you have the .Net SDK in your include path, define this - * to compile .Net support into your COM extension. */ -#define HAVE_MSCOREE_H 0 - -/* Enable / Disable ODBC extension (default: enabled) */ -#define HAVE_UODBC 1 - -/* Enable / Disable PCRE extension (default: enabled) */ -#define HAVE_BUNDLED_PCRE 1 -#define HAVE_PCRE 1 - -/* Enable / Disable SESSION extension (default: enabled) */ -#define HAVE_PHP_SESSION 1 - -/* Enable / Disable TOKENIZER extension (default: enabled) */ -#define HAVE_TOKENIZER 1 - -/* Enable / Disable WDDX extension (default: enabled) */ -#define HAVE_WDDX 1 - -/* Enable / Disable XML extensions (default: enabled) */ -#define HAVE_LIBXML 1 -#define HAVE_DOM 1 -#define HAVE_SIMPLEXML 1 -#define HAVE_XML 1 -#define HAVE_XMLREADER 1 -#define HAVE_XMLWRITER 1 -#define HAVE_LIBXML_PARSER_H 1 - -/* Enable / Disable ZLIB extension (default: enabled) */ -#define HAVE_ZLIB 1 -#define HAVE_ZLIB_H 1 - -/* Enable / Disable SQLite extension (default: enabled) */ -#define HAVE_SQLITE 1 - -/* PHP Runtime Configuration */ -#define FORCE_CGI_REDIRECT 1 -#define PHP_URL_FOPEN 1 -#define PHP_SAFE_MODE 0 -#define MAGIC_QUOTES 0 -#define USE_CONFIG_FILE 1 -#define DEFAULT_SHORT_OPEN_TAG "1" -#define ENABLE_PATHINFO_CHECK 1 - -/* Platform-Specific Configuration. Should not be changed. */ -#define PHP_SIGCHILD 0 -#define HAVE_LIBBIND 1 -#define HAVE_GETSERVBYNAME 1 -#define HAVE_GETSERVBYPORT 1 -#define HAVE_GETPROTOBYNAME 1 -#define HAVE_GETPROTOBYNUMBER 1 -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 -#define HAVE_ERRMSG_H 0 -#undef HAVE_ADABAS -#undef HAVE_SOLID -#undef HAVE_LINK -#undef HAVE_SYMLINK - -/* its in win32/time.c */ -#define HAVE_USLEEP 1 - -#define HAVE_GETCWD 1 -#define HAVE_POSIX_READDIR_R 1 -#define NEED_ISBLANK 1 -#define DISCARD_PATH 0 -#undef HAVE_SETITIMER -#undef HAVE_IODBC -#define HAVE_LIBDL 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_PUTENV 1 -#define HAVE_LIMITS_H 1 -#define HAVE_TZSET 1 -#define HAVE_TZNAME 1 -#undef HAVE_FLOCK -#define HAVE_ALLOCA 1 -#undef HAVE_SYS_TIME_H -#define HAVE_SIGNAL_H 1 -#undef HAVE_ST_BLKSIZE -#undef HAVE_ST_BLOCKS -#define HAVE_ST_RDEV 1 -#define HAVE_UTIME_NULL 1 -#define HAVE_VPRINTF 1 -#define STDC_HEADERS 1 -#define REGEX 1 -#define HSREGEX 1 -#define HAVE_GCVT 1 -#define HAVE_GETLOGIN 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_PUTENV 1 -#define HAVE_REGCOMP 1 -#define HAVE_SETLOCALE 1 -#define HAVE_LOCALECONV 1 -#define HAVE_LOCALE_H 1 -#ifndef HAVE_LIBBIND -#define HAVE_SETVBUF 1 -#endif -#define HAVE_SHUTDOWN 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRDUP 1 -#define HAVE_STRERROR 1 -#define HAVE_STRSTR 1 -#define HAVE_TEMPNAM 1 -#define HAVE_UTIME 1 -#undef HAVE_DIRENT_H -#define HAVE_ASSERT_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_GRP_H 0 -#undef HAVE_PWD_H -#define HAVE_STRING_H 1 -#undef HAVE_SYS_FILE_H -#undef HAVE_SYS_SOCKET_H -#undef HAVE_SYS_WAIT_H -#define HAVE_SYSLOG_H 1 -#undef HAVE_UNISTD_H -#define HAVE_LIBDL 1 -#define HAVE_LIBM 1 -#define HAVE_CUSERID 0 -#undef HAVE_RINT -#define HAVE_STRFTIME 1 -/* int and long are stll 32bit in 64bit compiles */ -#define SIZEOF_INT 4 -#define SIZEOF_LONG 4 -/* MSVC.6/NET don't allow 'long long' or know 'intmax_t' */ -#define SIZEOF_LONG_LONG_INT 0 -#define SIZEOF_LONG_LONG 8 /* defined as __int64 */ -#define SIZEOF_INTMAX_T 0 -#define ssize_t SSIZE_T -#ifdef _WIN64 -# define SIZEOF_SIZE_T 8 -# define SIZEOF_PTRDIFF_T 8 -#else -# define SIZEOF_SIZE_T 4 -# define SIZEOF_PTRDIFF_T 4 -#endif -#define HAVE_GLOB -#define PHP_SHLIB_SUFFIX "dll" -#define HAVE_SQLDATASOURCES -#define POSIX_MALLOC_THRESHOLD 10 - -/* - * defining HAVE_SOCKLEN_T prevents PHP from building with the latest platform SDK... - * #define HAVE_SOCKLEN_T - */ - -/* Win32 supports strcoll */ -#define HAVE_STRCOLL 1 - -/* Win32 support proc_open */ -#define PHP_CAN_SUPPORT_PROC_OPEN 1 - -#define HAVE_MBLEN - -#undef HAVE_ATOF_ACCEPTS_NAN -#undef HAVE_ATOF_ACCEPTS_INF -#define HAVE_HUGE_VAL_NAN 1 - -/* vs.net 2005 has a 64-bit time_t. This will likely break - * 3rdParty libs that were built with older compilers; switch - * back to 32-bit */ -#define _USE_32BIT_TIME_T 1 -#define HAVE_STDLIB_H 1 -/* have the arpa\nameser.h header file */ -#define HAVE_ARPA_NAMESER_H 1 - -/* undefined */ -#define PHP_FASTCGI 1 - -/* Have COM_DOTNET support */ -#define HAVE_COM_DOTNET 1 - -/* Have date/time support */ -#define HAVE_DATE 1 - -/* GD support */ -#define HAVE_LIBGD 1 -/* undefined */ -#define HAVE_HASH_EXT 1 - -/* Define if iconv extension is enabled */ -#define HAVE_ICONV 1 - -/* Define if libiconv is available */ -#define HAVE_LIBICONV 1 - -/* Which iconv implementation to use */ -#define PHP_ICONV_IMPL "\"libiconv\"" - -/* Whether iconv supports errno or not */ -#define ICONV_SUPPORTS_ERRNO 1 - -/* SPL support */ -#define HAVE_SPL 1 diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c deleted file mode 100644 index 16c532fb06a62..0000000000000 --- a/main/fopen_wrappers.c +++ /dev/null @@ -1,681 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* {{{ includes - */ -#include "php.h" -#include "php_globals.h" -#include "SAPI.h" - -#include -#include -#include -#include -#include -#include - -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#else -#include -#endif - -#include "safe_mode.h" -#include "ext/standard/head.h" -#include "ext/standard/php_standard.h" -#include "zend_compile.h" -#include "php_network.h" - -#if HAVE_PWD_H -#include -#endif - -#include -#if HAVE_SYS_SOCKET_H -#include -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif - -#ifdef PHP_WIN32 -#include -#elif defined(NETWARE) && defined(USE_WINSOCK) -#include -#else -#include -#include -#if HAVE_ARPA_INET_H -#include -#endif -#endif - -#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) -#undef AF_UNIX -#endif - -#if defined(AF_UNIX) -#include -#endif -/* }}} */ - -/* {{{ php_check_specific_open_basedir - When open_basedir is not NULL, check if the given filename is located in - open_basedir. Returns -1 if error or not in the open_basedir, else 0. - When open_basedir is NULL, always return 0. -*/ -PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC) -{ - char resolved_name[MAXPATHLEN]; - char resolved_basedir[MAXPATHLEN]; - char local_open_basedir[MAXPATHLEN]; - char path_tmp[MAXPATHLEN]; - char *path_file; - int resolved_basedir_len; - int resolved_name_len; - int path_len; - int nesting_level = 0; - - /* Special case basedir==".": Use script-directory */ - if (strcmp(basedir, ".") || !VCWD_GETCWD(local_open_basedir, MAXPATHLEN)) { - /* Else use the unmodified path */ - strlcpy(local_open_basedir, basedir, sizeof(local_open_basedir)); - } - - path_len = strlen(path); - if (path_len > (MAXPATHLEN - 1)) { - /* empty and too long paths are invalid */ - return -1; - } - - /* normalize and expand path */ - if (expand_filepath(path, resolved_name TSRMLS_CC) == NULL) { - return -1; - } - - path_len = strlen(resolved_name); - memcpy(path_tmp, resolved_name, path_len + 1); /* safe */ - - while (VCWD_REALPATH(path_tmp, resolved_name) == NULL) { -#ifdef HAVE_SYMLINK - if (nesting_level == 0) { - int ret; - char buf[MAXPATHLEN]; - - ret = readlink(path_tmp, buf, MAXPATHLEN - 1); - if (ret < 0) { - /* not a broken symlink, move along.. */ - } else { - /* put the real path into the path buffer */ - memcpy(path_tmp, buf, ret); - path_tmp[ret] = '\0'; - } - } -#endif - -#if defined(PHP_WIN32) || defined(NETWARE) - path_file = strrchr(path_tmp, DEFAULT_SLASH); - if (!path_file) { - path_file = strrchr(path_tmp, '/'); - } -#else - path_file = strrchr(path_tmp, DEFAULT_SLASH); -#endif - if (!path_file) { - /* none of the path components exist. definitely not in open_basedir.. */ - return -1; - } else { - path_len = path_file - path_tmp + 1; -#if defined(PHP_WIN32) || defined(NETWARE) - if (path_len > 1 && path_tmp[path_len - 2] == ':') { - if (path_len != 3) { - return -1; - } - /* this is c:\ */ - path_tmp[path_len] = '\0'; - } else { - path_tmp[path_len - 1] = '\0'; - } -#else - path_tmp[path_len - 1] = '\0'; -#endif - } - nesting_level++; - } - - /* Resolve open_basedir to resolved_basedir */ - if (expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) != NULL) { - /* Handler for basedirs that end with a / */ - resolved_basedir_len = strlen(resolved_basedir); - if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) { - if (resolved_basedir[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) { - resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR; - resolved_basedir[++resolved_basedir_len] = '\0'; - } - } - - resolved_name_len = strlen(resolved_name); - if (path_tmp[path_len - 1] == PHP_DIR_SEPARATOR) { - if (resolved_name[resolved_name_len - 1] != PHP_DIR_SEPARATOR) { - resolved_name[resolved_name_len] = PHP_DIR_SEPARATOR; - resolved_name[++resolved_name_len] = '\0'; - } - } - - /* Check the path */ -#if defined(PHP_WIN32) || defined(NETWARE) - if (strncasecmp(resolved_basedir, resolved_name, resolved_basedir_len) == 0) { -#else - if (strncmp(resolved_basedir, resolved_name, resolved_basedir_len) == 0) { -#endif - /* File is in the right directory */ - return 0; - } else { - /* /openbasedir/ and /openbasedir are the same directory */ - if (resolved_basedir_len == (resolved_name_len + 1) && resolved_basedir[resolved_basedir_len - 1] == PHP_DIR_SEPARATOR) { -#if defined(PHP_WIN32) || defined(NETWARE) - if (strncasecmp(resolved_basedir, resolved_name, resolved_name_len) == 0) { -#else - if (strncmp(resolved_basedir, resolved_name, resolved_name_len) == 0) { -#endif - return 0; - } - } - return -1; - } - } else { - /* Unable to resolve the real path, return -1 */ - return -1; - } -} -/* }}} */ - -PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC) -{ - return php_check_open_basedir_ex(path, 1 TSRMLS_CC); -} - -/* {{{ php_check_open_basedir - */ -PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC) -{ - /* Only check when open_basedir is available */ - if (PG(open_basedir) && *PG(open_basedir)) { - char *pathbuf; - char *ptr; - char *end; - - pathbuf = estrdup(PG(open_basedir)); - - ptr = pathbuf; - - while (ptr && *ptr) { - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); - if (end != NULL) { - *end = '\0'; - end++; - } - - if (php_check_specific_open_basedir(ptr, path TSRMLS_CC) == 0) { - efree(pathbuf); - return 0; - } - - ptr = end; - } - if (warn) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s)", path, PG(open_basedir)); - } - efree(pathbuf); - errno = EPERM; /* we deny permission to open it */ - return -1; - } - - /* Nothing to check... */ - return 0; -} -/* }}} */ - -/* {{{ php_check_safe_mode_include_dir - */ -PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC) -{ - if (PG(safe_mode)) { - if (PG(safe_mode_include_dir) && *PG(safe_mode_include_dir)) { - char *pathbuf; - char *ptr; - char *end; - char resolved_name[MAXPATHLEN]; - - /* Resolve the real path into resolved_name */ - if (expand_filepath(path, resolved_name TSRMLS_CC) == NULL) { - return -1; - } - pathbuf = estrdup(PG(safe_mode_include_dir)); - ptr = pathbuf; - - while (ptr && *ptr) { - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); - if (end != NULL) { - *end = '\0'; - end++; - } - - /* Check the path */ -#ifdef PHP_WIN32 - if (strncasecmp(ptr, resolved_name, strlen(ptr)) == 0) -#else - if (strncmp(ptr, resolved_name, strlen(ptr)) == 0) -#endif - { - /* File is in the right directory */ - efree(pathbuf); - return 0; - } - - ptr = end; - } - efree(pathbuf); - } - return -1; - } - - /* Nothing to check... */ - return 0; -} -/* }}} */ - -/* {{{ php_fopen_and_set_opened_path - */ -static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, char **opened_path TSRMLS_DC) -{ - FILE *fp; - - if (php_check_open_basedir((char *)path TSRMLS_CC)) { - return NULL; - } - fp = VCWD_FOPEN(path, mode); - if (fp && opened_path) { - *opened_path = expand_filepath(path, NULL TSRMLS_CC); - } - return fp; -} -/* }}} */ - -/* {{{ php_fopen_primary_script - */ -PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC) -{ - FILE *fp; -#ifndef PHP_WIN32 - struct stat st; -#endif - char *path_info, *filename; - int length; - - filename = SG(request_info).path_translated; - path_info = SG(request_info).request_uri; -#if HAVE_PWD_H - if (PG(user_dir) && *PG(user_dir) && path_info && '/' == path_info[0] && '~' == path_info[1]) { - char *s = strchr(path_info + 2, '/'); - - filename = NULL; /* discard the original filename, it must not be used */ - if (s) { /* if there is no path name after the file, do not bother */ - char user[32]; /* to try open the directory */ - struct passwd *pw; -#if defined(ZTS) && defined(HAVE_GETPWNAM_R) && defined(_SC_GETPW_R_SIZE_MAX) - struct passwd pwstruc; - long pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX); - char *pwbuf; - - if (pwbuflen < 1) { - return FAILURE; - } - - pwbuf = emalloc(pwbuflen); -#endif - length = s - (path_info + 2); - if (length > (int)sizeof(user) - 1) { - length = sizeof(user) - 1; - } - memcpy(user, path_info + 2, length); - user[length] = '\0'; -#if defined(ZTS) && defined(HAVE_GETPWNAM_R) && defined(_SC_GETPW_R_SIZE_MAX) - if (getpwnam_r(user, &pwstruc, pwbuf, pwbuflen, &pw)) { - efree(pwbuf); - return FAILURE; - } -#else - pw = getpwnam(user); -#endif - if (pw && pw->pw_dir) { - spprintf(&filename, 0, "%s%c%s%c%s", pw->pw_dir, PHP_DIR_SEPARATOR, PG(user_dir), PHP_DIR_SEPARATOR, s + 1); /* Safe */ - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = filename; - } -#if defined(ZTS) && defined(HAVE_GETPWNAM_R) && defined(_SC_GETPW_R_SIZE_MAX) - efree(pwbuf); -#endif - } - } else -#endif - if (PG(doc_root) && path_info) { - length = strlen(PG(doc_root)); - if (IS_ABSOLUTE_PATH(PG(doc_root), length)) { - filename = emalloc(length + strlen(path_info) + 2); - if (filename) { - memcpy(filename, PG(doc_root), length); - if (!IS_SLASH(filename[length - 1])) { /* length is never 0 */ - filename[length++] = PHP_DIR_SEPARATOR; - } - if (IS_SLASH(path_info[0])) { - length--; - } - strcpy(filename + length, path_info); - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = filename; - } - } - } /* if doc_root && path_info */ - - if (!filename) { - /* we have to free SG(request_info).path_translated here because - * php_destroy_request_info assumes that it will get - * freed when the include_names hash is emptied, but - * we're not adding it in this case */ - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = NULL; - return FAILURE; - } - fp = VCWD_FOPEN(filename, "rb"); - -#ifndef PHP_WIN32 - /* refuse to open anything that is not a regular file */ - if (fp && (0 > fstat(fileno(fp), &st) || !S_ISREG(st.st_mode))) { - fclose(fp); - fp = NULL; - } -#endif - - if (!fp) { - STR_FREE(SG(request_info).path_translated); /* for same reason as above */ - SG(request_info).path_translated = NULL; - return FAILURE; - } - - file_handle->opened_path = expand_filepath(filename, NULL TSRMLS_CC); - - if (!(SG(options) & SAPI_OPTION_NO_CHDIR)) { - VCWD_CHDIR_FILE(filename); - } - SG(request_info).path_translated = filename; - - file_handle->filename = SG(request_info).path_translated; - file_handle->free_filename = 0; - file_handle->handle.fp = fp; - file_handle->type = ZEND_HANDLE_FP; - - return SUCCESS; -} -/* }}} */ - -/* {{{ php_fopen_with_path - * Tries to open a file with a PATH-style list of directories. - * If the filename starts with "." or "/", the path is ignored. - */ -PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC) -{ - char *pathbuf, *ptr, *end; - char *exec_fname; - char trypath[MAXPATHLEN]; - struct stat sb; - FILE *fp; - int path_length; - int filename_length; - int exec_fname_length; - - if (opened_path) { - *opened_path = NULL; - } - - if (!filename) { - return NULL; - } - - filename_length = strlen(filename); - - /* Relative path open */ - if (*filename == '.') { - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); - } - - /* - * files in safe_mode_include_dir (or subdir) are excluded from - * safe mode GID/UID checks - */ - - /* Absolute path open */ - if (IS_ABSOLUTE_PATH(filename, filename_length)) { - if (php_check_safe_mode_include_dir(filename TSRMLS_CC) == 0) { - /* filename is in safe_mode_include_dir (or subdir) */ - return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); - } - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); - } - - if (!path || (path && !*path)) { - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); - } - - /* check in provided path */ - /* append the calling scripts' current working directory - * as a fall back case - */ - if (zend_is_executing(TSRMLS_C)) { - exec_fname = zend_get_executed_filename(TSRMLS_C); - exec_fname_length = strlen(exec_fname); - path_length = strlen(path); - - while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length])); - if ((exec_fname && exec_fname[0] == '[') || exec_fname_length <= 0) { - /* [no active file] or no path */ - pathbuf = estrdup(path); - } else { - pathbuf = (char *) emalloc(exec_fname_length + path_length + 1 + 1); - memcpy(pathbuf, path, path_length); - pathbuf[path_length] = DEFAULT_DIR_SEPARATOR; - memcpy(pathbuf + path_length + 1, exec_fname, exec_fname_length); - pathbuf[path_length + exec_fname_length + 1] = '\0'; - } - } else { - pathbuf = estrdup(path); - } - - ptr = pathbuf; - - while (ptr && *ptr) { - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); - if (end != NULL) { - *end = '\0'; - end++; - } - snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename); - if (PG(safe_mode)) { - if (VCWD_STAT(trypath, &sb) == 0) { - /* file exists ... check permission */ - if (php_check_safe_mode_include_dir(trypath TSRMLS_CC) == 0 || - php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM) - ) { - /* UID ok, or trypath is in safe_mode_include_dir */ - fp = php_fopen_and_set_opened_path(trypath, mode, opened_path TSRMLS_CC); - } else { - fp = NULL; - } - efree(pathbuf); - return fp; - } - } - fp = php_fopen_and_set_opened_path(trypath, mode, opened_path TSRMLS_CC); - if (fp) { - efree(pathbuf); - return fp; - } - ptr = end; - } /* end provided path */ - - efree(pathbuf); - return NULL; -} -/* }}} */ - -/* {{{ php_strip_url_passwd - */ -PHPAPI char *php_strip_url_passwd(char *url) -{ - register char *p, *url_start; - - if (url == NULL) { - return ""; - } - - p = url; - - while (*p) { - if (*p == ':' && *(p + 1) == '/' && *(p + 2) == '/') { - /* found protocol */ - url_start = p = p + 3; - - while (*p) { - if (*p == '@') { - int i; - - for (i = 0; i < 3 && url_start < p; i++, url_start++) { - *url_start = '.'; - } - for (; *p; p++) { - *url_start++ = *p; - } - *url_start=0; - break; - } - p++; - } - return url; - } - p++; - } - return url; -} -/* }}} */ - -/* {{{ expand_filepath - */ -PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC) -{ - return expand_filepath_ex(filepath, real_path, NULL, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ expand_filepath_ex - */ -PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len TSRMLS_DC) -{ - cwd_state new_state; - char cwd[MAXPATHLEN]; - int copy_len; - - if (!filepath[0]) { - return NULL; - } else if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { - cwd[0] = '\0'; - } else { - const char *iam = SG(request_info).path_translated; - const char *result; - if (relative_to) { - if (relative_to_len > MAXPATHLEN-1U) { - return NULL; - } - result = relative_to; - memcpy(cwd, relative_to, relative_to_len+1U); - } else { - result = VCWD_GETCWD(cwd, MAXPATHLEN); - } - - if (!result && (iam != filepath)) { - int fdtest = -1; - - fdtest = VCWD_OPEN(filepath, O_RDONLY); - if (fdtest != -1) { - /* return a relative file path if for any reason - * we cannot cannot getcwd() and the requested, - * relatively referenced file is accessible */ - copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath); - real_path = estrndup(filepath, copy_len); - close(fdtest); - return real_path; - } else { - cwd[0] = '\0'; - } - } else if (!result) { - cwd[0] = '\0'; - } - } - - new_state.cwd = strdup(cwd); - new_state.cwd_length = strlen(cwd); - - if (virtual_file_ex(&new_state, filepath, NULL, CWD_FILEPATH)) { - free(new_state.cwd); - return NULL; - } - - if (real_path) { - copy_len = new_state.cwd_length > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : new_state.cwd_length; - memcpy(real_path, new_state.cwd, copy_len); - real_path[copy_len] = '\0'; - } else { - real_path = estrndup(new_state.cwd, new_state.cwd_length); - } - free(new_state.cwd); - - return real_path; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h deleted file mode 100644 index 3de446e7ca572..0000000000000 --- a/main/fopen_wrappers.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef FOPEN_WRAPPERS_H -#define FOPEN_WRAPPERS_H - -BEGIN_EXTERN_C() -#include "php_globals.h" - -PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC); -PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC); -PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len TSRMLS_DC); - -PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC); -PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC); -PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC); - -PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC); - -PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC); - -PHPAPI char *php_strip_url_passwd(char *path); -END_EXTERN_C() - -#endif -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in deleted file mode 100644 index 9e6d1a1d5eaf4..0000000000000 --- a/main/internal_functions.c.in +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- C -*- - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_main.h" -#include "zend_modules.h" -#include "zend_compile.h" -#include -#include -#include - -@EXT_INCLUDE_CODE@ - -static zend_module_entry *php_builtin_extensions[] = { -@EXT_MODULE_PTRS@ -}; - -#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *)) - - -int php_register_internal_extensions(TSRMLS_D) -{ - return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/internal_functions_nw.c b/main/internal_functions_nw.c deleted file mode 100644 index 4bf1fb20decd9..0000000000000 --- a/main/internal_functions_nw.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Andi Gutmans | - | Zeev Suraski | - | Modified for NetWare: Novell, Inc. | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* {{{ includes - */ -#include "php.h" -#include "php_main.h" -#include "zend_modules.h" -#include "zend_compile.h" -#include -#include -#include - -#include "ext/bcmath/php_bcmath.h" -#include "ext/gd/php_gd.h" -#include "ext/standard/dl.h" -#include "ext/standard/file.h" -#include "ext/standard/fsock.h" -#include "ext/standard/head.h" -#include "ext/standard/pack.h" -#include "ext/standard/php_browscap.h" -/*#include "ext/standard/php_crypt.h"*/ -#include "ext/standard/php_dir.h" -#include "ext/standard/php_filestat.h" -#include "ext/standard/php_mail.h" -/*#include "ext/standard/php_ext_syslog.h"*/ -#include "ext/standard/php_standard.h" -#include "ext/standard/php_lcg.h" -#include "ext/standard/php_array.h" -#include "ext/standard/php_assert.h" -#include "ext/calendar/php_calendar.h" -/*#include "ext/com/php_COM.h" -#include "ext/com/php_VARIANT.h"*/ -#include "ext/ftp/php_ftp.h" -#include "ext/standard/reg.h" -#include "ext/pcre/php_pcre.h" -/*#include "ext/odbc/php_odbc.h"*/ /* Commented out for now */ -#include "ext/session/php_session.h" -/*#include "ext/xml/php_xml.h" -#include "ext/wddx/php_wddx.h" -#include "ext/mysql/php_mysql.h"*/ /* Commented out for now */ -/* }}} */ - -/* {{{ php_builtin_extensions[] - */ -static zend_module_entry *php_builtin_extensions[] = { - phpext_standard_ptr, -#if HAVE_BCMATH - phpext_bcmath_ptr, -#endif - phpext_calendar_ptr, -/* COM_module_ptr,*/ - phpext_ftp_ptr, -#if defined(MBSTR_ENC_TRANS) - phpext_mbstring_ptr, -#endif -/* phpext_mysql_ptr,*/ /* Commented out for now */ -/* phpext_odbc_ptr, */ /* Commented out for now */ - phpext_pcre_ptr, - phpext_session_ptr, -/* phpext_xml_ptr, - phpext_wddx_ptr */ /* Commented out for now */ -}; -/* }}} */ - -#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *)) - - -int php_register_internal_extensions(TSRMLS_D) -{ - return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC); -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/internal_functions_win32.c b/main/internal_functions_win32.c deleted file mode 100644 index 0f7aaf7c75ee1..0000000000000 --- a/main/internal_functions_win32.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* {{{ includes - */ -#include "php.h" -#include "php_main.h" -#include "zend_modules.h" -#include "zend_compile.h" -#include -#include -#include - -#ifndef ZEND_ENGINE_2 -#error HEAD does not work with ZendEngine1 anymore -#endif - -#include "ext/standard/dl.h" -#include "ext/standard/file.h" -#include "ext/standard/fsock.h" -#include "ext/standard/head.h" -#include "ext/standard/pack.h" -#include "ext/standard/php_browscap.h" -#include "ext/standard/php_crypt.h" -#include "ext/standard/php_dir.h" -#include "ext/standard/php_filestat.h" -#include "ext/standard/php_mail.h" -#include "ext/standard/php_ext_syslog.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/php_lcg.h" -#include "ext/standard/php_array.h" -#include "ext/standard/php_assert.h" -#include "ext/reflection/php_reflection.h" -#if HAVE_BCMATH -#include "ext/bcmath/php_bcmath.h" -#endif -#if HAVE_CALENDAR -#include "ext/calendar/php_calendar.h" -#endif -#if HAVE_CTYPE -#include "ext/ctype/php_ctype.h" -#endif -#if HAVE_DATE -#include "ext/date/php_date.h" -#endif -#if HAVE_FTP -#include "ext/ftp/php_ftp.h" -#endif -#if HAVE_ICONV -#include "ext/iconv/php_iconv.h" -#endif -#include "ext/standard/reg.h" -#if HAVE_PCRE || HAVE_BUNDLED_PCRE -#include "ext/pcre/php_pcre.h" -#endif -#if HAVE_UODBC -#include "ext/odbc/php_odbc.h" -#endif -#if HAVE_PHP_SESSION -#include "ext/session/php_session.h" -#endif -#if HAVE_MBSTRING -#include "ext/mbstring/mbstring.h" -#endif -#if HAVE_TOKENIZER -#include "ext/tokenizer/php_tokenizer.h" -#endif -#if HAVE_ZLIB -#include "ext/zlib/php_zlib.h" -#endif -#if HAVE_LIBXML -#include "ext/libxml/php_libxml.h" -#if HAVE_DOM -#include "ext/dom/php_dom.h" -#endif -#if HAVE_SIMPLEXML -#include "ext/simplexml/php_simplexml.h" -#endif -#endif -#if HAVE_XML -#include "ext/xml/php_xml.h" -#endif -#if HAVE_XML && HAVE_WDDX -#include "ext/wddx/php_wddx.h" -#endif -#ifdef HAVE_SQLITE -#include "ext/sqlite/php_sqlite.h" -#endif -#include "ext/com_dotnet/php_com_dotnet.h" -#ifdef HAVE_SPL -#include "ext/spl/php_spl.h" -#endif -#if HAVE_XML && HAVE_XMLREADER -#include "ext/xmlreader/php_xmlreader.h" -#endif -#if HAVE_XML && HAVE_XMLWRITER -#include "ext/xmlwriter/php_xmlwriter.h" -#endif -/* }}} */ - -/* {{{ php_builtin_extensions[] - */ -static zend_module_entry *php_builtin_extensions[] = { - phpext_standard_ptr -#if HAVE_BCMATH - ,phpext_bcmath_ptr -#endif -#if HAVE_CALENDAR - ,phpext_calendar_ptr -#endif - ,phpext_com_dotnet_ptr -#if HAVE_CTYPE - ,phpext_ctype_ptr -#endif -#if HAVE_DATE - ,phpext_date_ptr -#endif -#if HAVE_FTP - ,phpext_ftp_ptr -#endif -#if HAVE_HASH - ,phpext_hash_ptr -#endif -#if HAVE_ICONV - ,phpext_iconv_ptr -#endif -#if HAVE_MBSTRING - ,phpext_mbstring_ptr -#endif -#if HAVE_UODBC - ,phpext_odbc_ptr -#endif -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - ,phpext_pcre_ptr -#endif - ,phpext_reflection_ptr -#if HAVE_PHP_SESSION - ,phpext_session_ptr -#endif -#if HAVE_TOKENIZER - ,phpext_tokenizer_ptr -#endif -#if HAVE_ZLIB - ,phpext_zlib_ptr -#endif -#if HAVE_LIBXML - ,phpext_libxml_ptr -#if HAVE_DOM - ,phpext_dom_ptr -#endif -#if HAVE_SIMPLEXML - ,phpext_simplexml_ptr -#endif -#endif -#if HAVE_XML - ,phpext_xml_ptr -#endif -#if HAVE_XML && HAVE_WDDX - ,phpext_wddx_ptr -#endif -#if HAVE_SQLITE - ,phpext_sqlite_ptr -#endif -#if HAVE_SPL - ,phpext_spl_ptr -#endif -#if HAVE_XML && HAVE_XMLREADER - ,phpext_xmlreader_ptr -#endif -#if HAVE_XML && HAVE_XMLWRITER - ,phpext_xmlwriter_ptr -#endif -}; -/* }}} */ - -#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *)) - -int php_register_internal_extensions(TSRMLS_D) -{ - return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/logos.h b/main/logos.h deleted file mode 100644 index e234557cb638b..0000000000000 --- a/main/logos.h +++ /dev/null @@ -1,876 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define CONTEXT_TYPE_IMAGE_GIF "Content-Type: image/gif" - -static const unsigned char zend_logo[] = { - 71, 73, 70, 56, 57, 97, 113, 0, 72, 0, - 213, 0, 0, 13, 13, 14, 1, 3, 6, 2, - 5, 9, 46, 68, 94, 21, 29, 39, 5, 15, - 26, 4, 10, 17, 29, 43, 58, 0, 1, 2, - 9, 25, 42, 38, 105, 171, 24, 67, 109, 13, - 36, 59, 10, 27, 45, 9, 25, 41, 35, 96, - 157, 32, 87, 142, 29, 79, 130, 26, 70, 114, - 20, 54, 87, 29, 77, 124, 10, 26, 42, 34, - 88, 141, 10, 24, 38, 11, 26, 41, 1, 2, - 3, 55, 80, 105, 45, 63, 81, 49, 53, 57, - 5, 15, 24, 9, 26, 42, 30, 85, 138, 33, - 92, 149, 26, 73, 117, 10, 28, 45, 32, 89, - 142, 30, 84, 134, 26, 72, 115, 15, 42, 67, - 23, 62, 99, 12, 32, 51, 7, 21, 33, 9, - 26, 41, 8, 23, 35, 7, 25, 37, 51, 58, - 63, 2, 4, 5, 25, 26, 26, 49, 50, 50, - 255, 102, 0, 255, 255, 255, 204, 204, 204, 199, - 199, 199, 191, 191, 191, 171, 171, 171, 146, 146, - 146, 115, 115, 115, 85, 85, 85, 60, 60, 60, - 55, 55, 55, 38, 38, 38, 7, 7, 7, 3, - 3, 3, 0, 0, 0, 44, 0, 0, 0, 0, - 113, 0, 72, 0, 0, 6, 255, 192, 153, 112, - 72, 44, 26, 143, 200, 164, 114, 121, 252, 49, - 159, 208, 168, 148, 248, 171, 58, 167, 210, 171, - 208, 170, 197, 122, 191, 70, 109, 23, 140, 236, - 138, 201, 232, 239, 121, 102, 221, 186, 217, 219, - 171, 83, 46, 110, 15, 207, 235, 180, 190, 124, - 135, 187, 229, 127, 127, 128, 112, 121, 108, 118, - 132, 123, 137, 77, 118, 120, 136, 115, 109, 117, - 85, 126, 147, 147, 128, 99, 138, 137, 99, 107, - 146, 146, 148, 133, 159, 125, 136, 152, 163, 151, - 135, 121, 144, 84, 157, 92, 169, 157, 111, 163, - 175, 176, 83, 151, 177, 180, 181, 161, 182, 184, - 185, 186, 187, 188, 189, 67, 54, 56, 58, 56, - 53, 190, 197, 88, 55, 57, 60, 63, 2, 43, - 2, 56, 198, 208, 74, 192, 58, 0, 63, 5, - 12, 11, 35, 35, 12, 47, 209, 222, 67, 53, - 201, 203, 34, 19, 20, 218, 231, 37, 63, 54, - 223, 222, 60, 2, 216, 231, 241, 231, 206, 76, - 193, 55, 236, 176, 63, 39, 242, 252, 35, 40, - 58, 75, 114, 8, 40, 240, 227, 25, 62, 76, - 60, 24, 244, 147, 55, 161, 202, 11, 24, 57, - 134, 17, 201, 241, 99, 130, 191, 130, 7, 21, - 225, 48, 176, 48, 30, 137, 5, 11, 38, 48, - 88, 81, 5, 198, 51, 138, 22, 181, 53, 52, - 152, 49, 141, 141, 31, 230, 58, 46, 60, 129, - 194, 74, 202, 115, 43, 91, 234, 1, 112, 83, - 102, 63, 255, 18, 38, 122, 226, 252, 145, 67, - 39, 153, 26, 47, 68, 248, 92, 186, 176, 97, - 81, 163, 88, 108, 188, 48, 80, 130, 169, 85, - 134, 68, 161, 74, 177, 1, 160, 0, 137, 171, - 96, 135, 62, 213, 186, 132, 171, 215, 176, 104, - 71, 52, 188, 71, 54, 9, 210, 179, 105, 195, - 166, 99, 219, 214, 198, 58, 34, 48, 12, 124, - 213, 38, 163, 175, 223, 191, 50, 22, 132, 216, - 139, 182, 132, 0, 30, 196, 250, 218, 37, 70, - 198, 198, 141, 199, 144, 31, 223, 253, 114, 163, - 10, 0, 97, 192, 126, 100, 59, 7, 24, 176, - 10, 20, 229, 210, 146, 48, 128, 88, 72, 223, - 28, 57, 38, 111, 197, 17, 163, 181, 235, 215, - 58, 116, 68, 100, 60, 5, 134, 136, 18, 19, - 80, 24, 168, 162, 48, 94, 95, 21, 6, 82, - 168, 80, 209, 215, 128, 1, 20, 39, 8, 95, - 37, 81, 160, 180, 105, 25, 177, 233, 62, 1, - 246, 186, 186, 245, 24, 209, 177, 84, 140, 71, - 97, 130, 114, 109, 33, 76, 48, 152, 176, 192, - 111, 135, 20, 222, 211, 54, 167, 61, 163, 111, - 246, 39, 55, 174, 203, 175, 254, 30, 74, 229, - 152, 62, 73, 132, 24, 60, 162, 47, 131, 14, - 12, 132, 224, 155, 95, 130, 145, 208, 89, 129, - 40, 116, 211, 25, 12, 58, 72, 135, 68, 124, - 214, 197, 38, 161, 14, 243, 73, 200, 222, 18, - 27, 161, 213, 215, 4, 159, 37, 199, 255, 25, - 96, 12, 116, 230, 223, 9, 11, 252, 32, 226, - 11, 13, 74, 35, 223, 132, 19, 174, 24, 27, - 75, 76, 192, 128, 66, 88, 126, 161, 160, 66, - 122, 124, 201, 112, 2, 3, 195, 125, 54, 65, - 95, 29, 4, 87, 227, 9, 126, 233, 192, 3, - 12, 125, 161, 232, 160, 93, 207, 184, 200, 98, - 139, 17, 74, 24, 197, 118, 96, 249, 7, 160, - 128, 31, 242, 72, 30, 72, 33, 244, 149, 2, - 122, 229, 201, 0, 224, 105, 60, 52, 216, 23, - 131, 14, 226, 96, 194, 1, 78, 74, 152, 195, - 13, 196, 208, 192, 90, 148, 177, 217, 7, 83, - 149, 50, 112, 136, 220, 94, 34, 22, 216, 159, - 12, 195, 101, 227, 37, 113, 50, 192, 0, 3, - 156, 238, 165, 72, 196, 11, 21, 178, 184, 228, - 117, 19, 66, 145, 225, 85, 53, 222, 72, 152, - 136, 42, 152, 32, 224, 111, 42, 8, 10, 40, - 161, 101, 222, 96, 67, 95, 61, 40, 58, 3, - 13, 55, 24, 112, 221, 101, 19, 226, 64, 131, - 17, 54, 64, 42, 229, 19, 50, 226, 249, 95, - 128, 127, 238, 23, 166, 113, 194, 105, 250, 103, - 160, 191, 18, 90, 232, 13, 59, 0, 249, 130, - 168, 56, 160, 198, 195, 10, 214, 161, 144, 1, - 131, 245, 21, 1, 33, 125, 177, 141, 181, 4, - 149, 76, 137, 232, 23, 3, 38, 132, 9, 216, - 9, 93, 126, 234, 105, 160, 34, 94, 208, 129, - 14, 7, 152, 112, 255, 2, 4, 40, 84, 80, - 157, 8, 30, 176, 154, 195, 133, 68, 200, 250, - 34, 124, 119, 102, 171, 109, 113, 157, 142, 16, - 238, 111, 160, 113, 58, 110, 167, 38, 252, 213, - 192, 193, 12, 72, 32, 193, 3, 15, 128, 192, - 128, 7, 175, 121, 32, 66, 7, 101, 230, 240, - 42, 18, 53, 216, 171, 131, 106, 73, 224, 32, - 0, 88, 221, 217, 216, 227, 200, 190, 234, 39, - 210, 112, 12, 36, 23, 158, 175, 254, 154, 160, - 105, 9, 5, 236, 88, 129, 7, 41, 83, 240, - 65, 195, 32, 56, 236, 128, 107, 14, 36, 208, - 64, 10, 24, 41, 161, 177, 181, 74, 84, 182, - 194, 4, 85, 45, 181, 239, 134, 11, 236, 165, - 31, 151, 95, 233, 199, 223, 8, 82, 27, 40, - 3, 9, 39, 144, 56, 24, 4, 92, 119, 61, - 129, 3, 96, 135, 221, 128, 8, 12, 0, 64, - 239, 47, 26, 59, 88, 52, 53, 227, 132, 182, - 208, 210, 128, 178, 76, 163, 12, 46, 135, 208, - 245, 221, 92, 3, 21, 54, 216, 9, 152, 208, - 48, 64, 72, 12, 237, 197, 52, 0, 152, 208, - 209, 111, 193, 141, 204, 239, 102, 104, 45, 96, - 128, 9, 20, 224, 45, 249, 215, 97, 51, 240, - 1, 8, 10, 152, 80, 20, 14, 56, 208, 213, - 38, 199, 181, 245, 214, 207, 111, 96, 130, 4, - 146, 72, 114, 135, 69, 194, 10, 38, 64, 0, - 130, 228, 120, 71, 240, 181, 8, 145, 67, 240, - 255, 128, 2, 44, 164, 0, 26, 2, 66, 180, - 9, 163, 23, 56, 20, 112, 184, 184, 242, 232, - 119, 224, 212, 127, 18, 56, 152, 95, 14, 252, - 8, 88, 129, 120, 255, 37, 216, 205, 17, 68, - 160, 192, 3, 24, 212, 64, 131, 198, 58, 92, - 12, 70, 101, 223, 125, 8, 172, 60, 218, 166, - 252, 149, 136, 41, 251, 21, 64, 249, 201, 117, - 221, 89, 202, 151, 131, 112, 251, 9, 211, 194, - 54, 161, 218, 88, 212, 128, 237, 128, 207, 35, - 15, 164, 144, 125, 65, 78, 141, 206, 3, 164, - 0, 245, 69, 0, 34, 248, 95, 10, 134, 68, - 2, 8, 244, 101, 71, 97, 3, 77, 237, 70, - 240, 0, 18, 248, 110, 15, 58, 80, 10, 63, - 48, 37, 55, 47, 129, 169, 128, 86, 10, 152, - 12, 132, 19, 166, 2, 36, 112, 132, 31, 20, - 83, 128, 28, 40, 3, 6, 52, 207, 116, 91, - 227, 218, 3, 218, 68, 52, 50, 224, 32, 95, - 228, 147, 1, 175, 134, 211, 65, 226, 13, 138, - 116, 222, 249, 77, 1, 10, 38, 3, 7, 52, - 160, 47, 96, 91, 0, 11, 83, 224, 128, 62, - 197, 176, 107, 32, 224, 222, 217, 192, 240, 130, - 25, 109, 16, 133, 91, 242, 159, 15, 63, 37, - 176, 63, 25, 64, 0, 68, 108, 128, 7, 144, - 232, 0, 37, 146, 81, 68, 14, 208, 20, 20, - 163, 72, 167, 216, 128, 14, 85, 201, 66, 205, - 155, 110, 224, 61, 37, 220, 255, 16, 63, 226, - 235, 215, 135, 194, 5, 44, 78, 249, 5, 61, - 86, 251, 65, 5, 36, 208, 23, 15, 52, 177, - 136, 101, 100, 97, 18, 195, 197, 171, 52, 218, - 205, 117, 51, 108, 163, 169, 132, 16, 171, 54, - 118, 174, 142, 69, 48, 75, 248, 224, 22, 162, - 45, 146, 171, 51, 8, 160, 221, 25, 17, 105, - 70, 82, 90, 237, 91, 131, 137, 164, 37, 137, - 80, 73, 238, 221, 11, 86, 93, 9, 95, 242, - 180, 101, 128, 46, 10, 236, 148, 126, 177, 6, - 5, 70, 153, 68, 69, 38, 18, 2, 255, 42, - 34, 104, 34, 160, 74, 106, 9, 99, 8, 245, - 51, 230, 147, 126, 55, 131, 26, 196, 178, 35, - 225, 25, 153, 52, 131, 82, 55, 240, 84, 19, - 107, 60, 234, 11, 0, 12, 16, 1, 16, 148, - 160, 110, 43, 123, 100, 56, 243, 22, 2, 145, - 128, 45, 101, 16, 152, 15, 118, 44, 54, 131, - 100, 218, 239, 73, 111, 58, 66, 13, 120, 0, - 151, 133, 60, 205, 116, 248, 20, 12, 5, 246, - 227, 52, 126, 106, 195, 120, 50, 56, 146, 1, - 46, 247, 1, 126, 86, 141, 156, 79, 132, 192, - 61, 67, 240, 1, 117, 182, 6, 85, 141, 90, - 38, 232, 134, 176, 17, 89, 198, 165, 35, 134, - 17, 70, 14, 92, 32, 63, 134, 141, 224, 117, - 176, 11, 105, 215, 44, 232, 208, 136, 178, 72, - 34, 118, 212, 203, 69, 173, 226, 148, 26, 216, - 133, 7, 255, 39, 80, 192, 4, 102, 42, 191, - 17, 136, 52, 164, 37, 109, 211, 253, 48, 137, - 49, 122, 90, 116, 165, 255, 100, 64, 86, 40, - 74, 128, 22, 0, 224, 6, 48, 152, 128, 2, - 64, 122, 211, 187, 229, 84, 153, 142, 226, 169, - 18, 230, 41, 128, 164, 1, 149, 31, 37, 98, - 166, 93, 134, 192, 129, 133, 49, 181, 169, 36, - 125, 234, 147, 36, 68, 71, 47, 80, 213, 170, - 252, 32, 79, 92, 232, 177, 4, 14, 80, 32, - 103, 77, 229, 218, 83, 177, 51, 214, 6, 73, - 53, 10, 103, 237, 71, 67, 126, 96, 0, 164, - 133, 69, 4, 128, 147, 134, 15, 72, 240, 85, - 174, 229, 236, 176, 175, 203, 105, 93, 223, 116, - 215, 41, 228, 53, 30, 43, 177, 65, 14, 94, - 80, 133, 21, 160, 64, 93, 75, 153, 0, 0, - 158, 224, 130, 19, 60, 224, 110, 57, 99, 216, - 237, 74, 0, 130, 8, 120, 192, 3, 99, 243, - 192, 97, 234, 58, 161, 120, 42, 226, 177, 106, - 9, 26, 37, 57, 167, 131, 23, 8, 207, 39, - 20, 248, 1, 254, 136, 80, 3, 20, 44, 21, - 180, 32, 32, 79, 4, 80, 16, 128, 11, 64, - 64, 4, 34, 80, 65, 7, 94, 80, 38, 214, - 202, 102, 183, 105, 168, 1, 12, 170, 26, 219, - 26, 34, 19, 135, 29, 41, 128, 117, 137, 128, - 3, 9, 252, 214, 176, 15, 24, 64, 15, 56, - 247, 12, 24, 168, 75, 4, 6, 0, 135, 192, - 14, 156, 139, 82, 90, 8, 164, 38, 219, 29, - 2, 79, 150, 194, 0, 24, 44, 97, 7, 22, - 184, 29, 195, 58, 106, 223, 58, 230, 160, 156, - 68, 89, 108, 89, 115, 145, 3, 147, 48, 33, - 131, 50, 89, 0, 3, 4, 16, 95, 33, 220, - 224, 5, 26, 64, 193, 91, 111, 167, 57, 35, - 132, 35, 53, 148, 116, 12, 100, 166, 248, 13, - 143, 241, 163, 59, 34, 16, 192, 15, 120, 208, - 222, 36, 208, 192, 49, 63, 216, 192, 9, 36, - 192, 128, 137, 114, 152, 44, 47, 217, 140, 130, - 9, 114, 25, 28, 76, 148, 9, 162, 2, 128, - 141, 219, 50, 5, 122, 134, 120, 196, 174, 141, - 46, 143, 167, 96, 131, 23, 221, 120, 200, 72, - 214, 74, 16, 0, 0, 59 }; - -static const unsigned char php_logo[] = { - 71, 73, 70, 56, 57, 97, 120, 0, 67, 0, - 230, 106, 0, 127, 130, 184, 57, 55, 71, 40, - 37, 42, 204, 205, 226, 161, 164, 203, 211, 213, - 231, 178, 180, 212, 67, 66, 88, 131, 134, 185, - 130, 131, 179, 82, 82, 114, 144, 146, 194, 194, - 196, 222, 170, 172, 208, 76, 75, 99, 91, 92, - 131, 221, 222, 236, 59, 56, 60, 110, 113, 165, - 106, 109, 157, 97, 99, 141, 117, 121, 177, 123, - 126, 181, 229, 230, 240, 153, 156, 198, 140, 141, - 193, 185, 186, 217, 107, 107, 146, 78, 78, 107, - 113, 116, 169, 122, 122, 163, 136, 139, 189, 114, - 116, 163, 116, 115, 152, 142, 144, 193, 90, 91, - 126, 226, 227, 239, 123, 125, 173, 164, 165, 208, - 109, 112, 162, 114, 118, 172, 149, 150, 200, 187, - 189, 217, 116, 120, 174, 133, 136, 187, 146, 149, - 195, 216, 217, 234, 146, 146, 196, 100, 102, 146, - 107, 110, 159, 165, 168, 206, 148, 150, 197, 46, - 43, 47, 83, 81, 104, 179, 180, 215, 108, 106, - 140, 92, 91, 118, 138, 141, 191, 102, 104, 150, - 104, 106, 154, 156, 159, 200, 49, 46, 57, 174, - 176, 211, 156, 156, 205, 85, 86, 120, 158, 161, - 202, 150, 153, 197, 129, 130, 175, 103, 105, 151, - 63, 61, 80, 188, 190, 218, 94, 96, 137, 152, - 153, 200, 140, 142, 191, 137, 138, 186, 87, 88, - 124, 182, 183, 215, 213, 215, 232, 34, 30, 32, - 108, 111, 158, 206, 208, 228, 191, 192, 220, 119, - 123, 180, 118, 120, 167, 95, 94, 125, 153, 153, - 204, 110, 111, 152, 115, 119, 174, 34, 30, 31, - 255, 255, 255, 144, 142, 143, 89, 86, 87, 199, - 198, 199, 238, 238, 245, 213, 212, 213, 246, 246, - 250, 130, 128, 129, 172, 170, 171, 116, 114, 115, - 241, 240, 241, 158, 156, 157, 227, 226, 227, 75, - 72, 73, 185, 184, 185, 103, 100, 101, 137, 137, - 182, 0, 255, 0, 71, 70, 95, 223, 224, 237, - 155, 156, 204, 105, 107, 156, 111, 115, 167, 140, - 140, 186, 184, 185, 217, 184, 186, 215, 154, 155, - 204, 167, 170, 207, 219, 220, 235, 154, 156, 201, - 102, 100, 132, 104, 103, 137, 167, 168, 210, 110, - 112, 160, 139, 139, 185, 198, 199, 224, 199, 201, - 225, 105, 108, 156, 151, 152, 203, 33, 249, 4, - 1, 0, 0, 106, 0, 44, 0, 0, 0, 0, - 120, 0, 67, 0, 0, 7, 255, 128, 106, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 150, 109, 63, 109, 115, 152, 158, 159, 160, - 63, 121, 121, 54, 62, 26, 113, 76, 26, 26, - 76, 6, 62, 62, 13, 50, 4, 65, 60, 24, - 66, 45, 11, 73, 34, 57, 31, 25, 57, 34, - 47, 41, 160, 194, 161, 13, 26, 12, 125, 77, - 5, 80, 80, 3, 125, 124, 12, 81, 81, 42, - 114, 172, 175, 116, 177, 179, 66, 51, 45, 186, - 31, 8, 0, 22, 22, 21, 87, 40, 37, 22, - 9, 25, 193, 195, 235, 140, 38, 113, 124, 46, - 108, 108, 16, 16, 117, 46, 201, 3, 212, 50, - 179, 34, 31, 254, 44, 0, 17, 8, 4, 64, - 176, 224, 55, 130, 225, 164, 172, 64, 241, 70, - 194, 9, 63, 59, 158, 76, 25, 146, 132, 157, - 69, 53, 65, 108, 12, 96, 67, 226, 130, 71, - 18, 36, 242, 53, 16, 178, 64, 138, 201, 147, - 40, 83, 170, 92, 121, 114, 92, 7, 9, 19, - 118, 232, 128, 65, 225, 8, 5, 43, 67, 68, - 92, 196, 20, 132, 9, 20, 142, 30, 47, 184, - 48, 66, 167, 5, 203, 163, 72, 147, 162, 188, - 242, 38, 6, 140, 35, 71, 30, 140, 88, 114, - 196, 131, 206, 157, 144, 126, 104, 116, 1, 129, - 35, 4, 35, 4, 88, 40, 29, 75, 54, 233, - 149, 19, 58, 30, 44, 1, 162, 64, 193, 136, - 41, 51, 255, 176, 46, 50, 161, 161, 64, 19, - 23, 117, 10, 24, 72, 82, 182, 175, 95, 164, - 29, 96, 44, 81, 192, 129, 131, 3, 60, 9, - 228, 26, 202, 19, 101, 0, 148, 2, 3, 124, - 228, 248, 187, 114, 1, 134, 203, 152, 49, 124, - 160, 156, 244, 13, 5, 5, 14, 214, 172, 81, - 224, 65, 177, 154, 60, 70, 248, 244, 25, 192, - 100, 6, 231, 149, 31, 178, 112, 153, 77, 155, - 75, 151, 215, 74, 221, 44, 89, 115, 224, 128, - 131, 16, 59, 221, 69, 97, 192, 160, 1, 2, - 220, 43, 49, 112, 193, 194, 188, 185, 153, 219, - 200, 147, 118, 216, 93, 164, 200, 154, 210, 195, - 126, 248, 144, 99, 68, 5, 15, 11, 209, 87, - 170, 32, 211, 188, 185, 152, 2, 225, 149, 94, - 121, 112, 32, 64, 0, 14, 112, 64, 153, 48, - 192, 68, 14, 1, 0, 233, 87, 22, 16, 83, - 158, 57, 25, 21, 249, 41, 245, 134, 2, 238, - 245, 112, 7, 38, 115, 208, 225, 131, 1, 50, - 28, 23, 160, 74, 93, 152, 209, 31, 22, 92, - 16, 240, 160, 82, 49, 172, 209, 67, 15, 7, - 236, 81, 201, 15, 50, 52, 208, 64, 73, 23, - 166, 4, 64, 22, 19, 98, 145, 197, 102, 37, - 38, 245, 64, 0, 27, 2, 39, 73, 27, 4, - 236, 227, 96, 139, 39, 41, 55, 161, 25, 95, - 224, 168, 148, 31, 69, 208, 64, 3, 21, 145, - 216, 17, 4, 1, 51, 128, 135, 212, 255, 7, - 153, 53, 217, 36, 139, 71, 169, 16, 198, 132, - 98, 92, 208, 36, 137, 44, 49, 233, 228, 150, - 248, 141, 133, 130, 3, 52, 8, 80, 195, 35, - 72, 96, 16, 4, 148, 71, 125, 240, 69, 22, - 108, 182, 233, 230, 155, 89, 116, 81, 64, 3, - 93, 162, 84, 0, 24, 19, 146, 1, 103, 155, - 23, 12, 96, 225, 73, 11, 236, 41, 40, 155, - 93, 12, 208, 128, 82, 64, 8, 32, 128, 3, - 141, 204, 32, 4, 6, 98, 41, 69, 192, 114, - 41, 86, 106, 6, 24, 92, 124, 1, 32, 74, - 93, 108, 81, 105, 138, 52, 108, 161, 69, 25, - 93, 144, 104, 192, 148, 159, 78, 184, 5, 24, - 94, 116, 113, 40, 82, 35, 8, 224, 4, 163, - 138, 108, 35, 196, 141, 73, 141, 151, 234, 167, - 91, 120, 1, 65, 151, 39, 238, 250, 41, 24, - 99, 96, 32, 197, 0, 120, 10, 171, 106, 25, - 3, 36, 53, 130, 19, 78, 224, 144, 72, 10, - 34, 180, 128, 102, 82, 16, 240, 167, 108, 138, - 97, 64, 96, 18, 6, 94, 108, 155, 34, 26, - 183, 93, 224, 169, 184, 229, 209, 224, 69, 179, - 72, 173, 1, 45, 118, 133, 252, 225, 203, 100, - 101, 125, 33, 33, 186, 253, 121, 1, 160, 148, - 248, 230, 219, 0, 138, 253, 54, 71, 67, 25, - 127, 30, 21, 128, 19, 2, 44, 96, 72, 63, - 244, 146, 21, 91, 192, 229, 109, 209, 227, 157, - 16, 51, 167, 197, 255, 5, 225, 86, 140, 133, - 24, 208, 29, 213, 129, 172, 99, 18, 146, 2, - 2, 31, 212, 57, 214, 164, 59, 194, 57, 198, - 25, 218, 78, 232, 5, 1, 157, 78, 200, 197, - 155, 99, 112, 129, 70, 138, 90, 100, 129, 106, - 196, 112, 150, 113, 198, 185, 19, 150, 129, 37, - 75, 10, 64, 155, 6, 33, 222, 224, 58, 150, - 174, 253, 137, 225, 45, 74, 11, 52, 208, 5, - 121, 19, 106, 193, 0, 192, 253, 173, 136, 18, - 6, 13, 124, 17, 65, 213, 89, 104, 81, 53, - 187, 128, 26, 240, 69, 178, 253, 133, 97, 128, - 82, 52, 204, 58, 200, 31, 0, 32, 160, 100, - 89, 217, 230, 185, 169, 137, 89, 124, 221, 116, - 22, 25, 151, 199, 227, 74, 16, 0, 221, 92, - 206, 130, 51, 119, 198, 218, 42, 125, 48, 6, - 206, 119, 31, 181, 4, 180, 10, 171, 33, 130, - 5, 38, 147, 101, 175, 204, 5, 167, 20, 184, - 170, 58, 83, 249, 116, 74, 49, 247, 119, 70, - 22, 52, 4, 109, 236, 74, 161, 151, 167, 69, - 227, 44, 117, 0, 237, 13, 130, 176, 144, 80, - 95, 15, 79, 56, 198, 181, 39, 109, 222, 31, - 26, 89, 160, 221, 220, 127, 42, 5, 27, 116, - 25, 19, 210, 144, 197, 81, 169, 15, 206, 58, - 75, 69, 184, 173, 70, 56, 115, 147, 133, 114, - 127, 17, 244, 200, 210, 229, 253, 17, 142, 185, - 74, 224, 22, 159, 197, 25, 170, 94, 112, 20, - 255, 214, 229, 1, 175, 20, 7, 78, 244, 32, - 72, 5, 148, 49, 93, 30, 26, 159, 167, 84, - 123, 218, 228, 55, 119, 187, 74, 252, 246, 183, - 69, 216, 99, 179, 132, 1, 241, 219, 83, 10, - 5, 160, 37, 136, 21, 80, 166, 110, 217, 91, - 158, 73, 12, 0, 190, 160, 245, 173, 57, 213, - 211, 143, 239, 152, 3, 134, 44, 20, 14, 11, - 135, 99, 9, 3, 168, 214, 159, 251, 9, 144, - 128, 41, 184, 2, 251, 252, 130, 189, 242, 84, - 136, 37, 201, 99, 78, 4, 58, 183, 187, 248, - 157, 36, 133, 88, 8, 3, 233, 76, 183, 18, - 0, 120, 109, 66, 228, 34, 203, 0, 157, 32, - 8, 20, 24, 176, 47, 194, 235, 32, 238, 142, - 69, 169, 236, 245, 174, 106, 203, 11, 98, 121, - 188, 0, 192, 116, 29, 79, 63, 28, 44, 79, - 24, 20, 184, 146, 29, 10, 162, 3, 40, 24, - 33, 89, 116, 68, 189, 39, 162, 228, 3, 5, - 240, 66, 233, 250, 67, 131, 49, 124, 225, 130, - 39, 76, 73, 247, 38, 244, 189, 240, 113, 15, - 2, 98, 156, 80, 245, 42, 119, 20, 43, 170, - 97, 33, 90, 92, 90, 20, 153, 67, 46, 21, - 248, 81, 5, 16, 232, 194, 24, 180, 48, 70, - 209, 13, 160, 126, 204, 241, 32, 74, 242, 199, - 51, 177, 101, 175, 11, 127, 4, 100, 23, 202, - 224, 72, 153, 81, 113, 37, 232, 83, 223, 243, - 58, 112, 133, 190, 236, 71, 255, 85, 90, 8, - 101, 40, 197, 112, 175, 20, 137, 225, 11, 4, - 120, 160, 10, 189, 104, 167, 9, 98, 161, 130, - 23, 20, 149, 40, 181, 64, 202, 97, 137, 175, - 44, 205, 163, 213, 7, 222, 208, 129, 190, 68, - 72, 99, 104, 248, 194, 2, 78, 133, 67, 23, - 154, 196, 92, 19, 146, 97, 33, 3, 118, 202, - 161, 73, 231, 117, 130, 72, 129, 4, 222, 240, - 67, 165, 40, 177, 95, 205, 60, 150, 43, 173, - 182, 18, 68, 98, 129, 137, 26, 3, 131, 48, - 251, 242, 56, 39, 68, 238, 121, 18, 232, 229, - 88, 214, 216, 47, 26, 156, 97, 156, 82, 64, - 102, 127, 184, 240, 170, 173, 169, 146, 57, 109, - 12, 88, 4, 206, 112, 1, 103, 178, 205, 121, - 130, 120, 193, 9, 36, 208, 73, 165, 48, 82, - 92, 102, 32, 195, 24, 6, 80, 167, 25, 118, - 208, 159, 196, 212, 31, 255, 240, 101, 6, 25, - 50, 128, 142, 73, 41, 154, 19, 142, 70, 136, - 33, 156, 224, 13, 99, 161, 152, 254, 102, 57, - 75, 50, 112, 97, 12, 133, 66, 83, 160, 72, - 26, 74, 86, 158, 68, 5, 92, 96, 233, 232, - 46, 40, 6, 150, 134, 210, 164, 40, 101, 192, - 16, 165, 3, 50, 67, 164, 224, 4, 39, 80, - 39, 82, 96, 200, 133, 11, 208, 131, 30, 5, - 248, 35, 1, 252, 105, 18, 64, 30, 245, 168, - 153, 3, 212, 0, 158, 74, 143, 67, 46, 147, - 57, 94, 255, 48, 234, 81, 147, 234, 71, 2, - 236, 116, 44, 7, 75, 216, 33, 146, 16, 131, - 19, 160, 0, 41, 215, 76, 36, 83, 125, 36, - 133, 5, 52, 177, 60, 89, 192, 40, 114, 220, - 229, 4, 120, 25, 34, 1, 101, 45, 104, 114, - 238, 185, 66, 182, 178, 164, 1, 13, 140, 88, - 199, 242, 83, 78, 105, 41, 162, 4, 121, 101, - 201, 65, 249, 104, 76, 191, 74, 129, 1, 149, - 108, 14, 24, 208, 19, 160, 114, 210, 106, 17, - 136, 53, 171, 4, 171, 198, 0, 199, 170, 68, - 119, 82, 188, 36, 101, 52, 122, 89, 70, 148, - 96, 2, 49, 232, 64, 30, 165, 64, 212, 122, - 122, 214, 36, 121, 115, 217, 233, 162, 211, 129, - 3, 64, 171, 180, 141, 72, 0, 106, 37, 160, - 197, 180, 98, 97, 12, 107, 245, 209, 2, 22, - 199, 70, 185, 250, 133, 8, 61, 128, 150, 97, - 35, 161, 132, 39, 76, 64, 179, 82, 248, 223, - 22, 166, 75, 93, 222, 189, 214, 158, 212, 165, - 46, 24, 6, 251, 26, 5, 200, 74, 0, 50, - 154, 196, 11, 64, 224, 135, 24, 240, 22, 0, - 5, 160, 42, 61, 16, 119, 93, 41, 160, 87, - 189, 16, 112, 45, 101, 136, 112, 48, 39, 68, - 128, 163, 150, 72, 128, 27, 80, 251, 134, 213, - 182, 215, 175, 39, 176, 173, 114, 65, 241, 130, - 41, 248, 1, 181, 170, 253, 175, 95, 81, 192, - 1, 89, 57, 161, 8, 248, 5, 133, 255, 18, - 244, 224, 134, 3, 247, 87, 193, 37, 58, 193, - 26, 28, 220, 131, 240, 178, 131, 5, 20, 62, - 176, 4, 206, 138, 225, 240, 28, 225, 0, 138, - 18, 64, 15, 96, 167, 24, 22, 128, 96, 7, - 110, 112, 67, 12, 168, 89, 98, 202, 248, 129, - 3, 1, 8, 147, 0, 2, 192, 98, 211, 8, - 34, 9, 37, 32, 194, 14, 96, 60, 1, 26, - 215, 56, 41, 19, 32, 80, 15, 132, 36, 38, - 187, 250, 120, 16, 41, 72, 128, 30, 116, 64, - 4, 33, 187, 33, 168, 254, 197, 240, 27, 142, - 128, 227, 13, 45, 185, 8, 120, 120, 193, 147, - 23, 241, 2, 41, 235, 224, 204, 103, 222, 193, - 71, 73, 124, 221, 29, 28, 65, 1, 237, 129, - 209, 134, 14, 112, 3, 15, 141, 249, 17, 47, - 64, 192, 20, 136, 0, 131, 62, 251, 153, 8, - 126, 248, 168, 80, 243, 51, 1, 34, 60, 0, - 52, 213, 113, 143, 162, 113, 16, 2, 59, 223, - 153, 18, 34, 24, 194, 158, 41, 64, 233, 74, - 83, 250, 8, 125, 174, 112, 160, 223, 192, 105, - 78, 75, 224, 211, 159, 6, 42, 80, 137, 112, - 105, 182, 136, 166, 55, 7, 168, 78, 17, 2, - 112, 0, 28, 108, 32, 49, 143, 22, 70, 10, - 62, 80, 2, 16, 88, 1, 42, 80, 121, 128, - 174, 119, 61, 149, 37, 172, 5, 8, 108, 105, - 11, 97, 10, 99, 152, 208, 156, 186, 55, 69, - 80, 0, 21, 110, 56, 48, 4, 49, 199, 90, - 49, 41, 80, 2, 2, 60, 224, 129, 13, 108, - 32, 45, 190, 6, 118, 176, 219, 66, 108, 195, - 112, 128, 10, 35, 24, 129, 21, 172, 80, 130, - 102, 63, 251, 220, 139, 16, 65, 26, 16, 112, - 21, 116, 187, 251, 221, 240, 142, 119, 188, 3, - 1, 0, 59, 0 }; - -static const unsigned char php_egg_logo[] = { - 71, 73, 70, 56, 57, 97, 120, 0, 67, 0, - 247, 0, 0, 0, 255, 0, 107, 114, 178, 0, - 0, 0, 31, 31, 31, 255, 255, 255, 106, 113, - 176, 63, 63, 63, 127, 127, 127, 106, 112, 174, - 191, 191, 191, 105, 111, 171, 223, 223, 223, 239, - 239, 239, 144, 149, 197, 106, 111, 173, 245, 246, - 250, 105, 110, 170, 218, 219, 235, 47, 47, 47, - 162, 166, 206, 35, 36, 40, 153, 158, 202, 95, - 95, 95, 175, 175, 175, 88, 93, 141, 159, 159, - 159, 116, 122, 182, 125, 131, 187, 143, 143, 143, - 38, 38, 41, 104, 108, 167, 171, 175, 211, 105, - 109, 168, 102, 102, 153, 104, 108, 165, 45, 46, - 58, 181, 184, 216, 111, 111, 111, 134, 140, 192, - 102, 108, 168, 79, 79, 79, 199, 202, 226, 40, - 41, 49, 92, 98, 150, 53, 53, 63, 236, 237, - 245, 130, 130, 171, 122, 122, 160, 104, 107, 163, - 50, 51, 67, 45, 45, 52, 207, 207, 207, 69, - 72, 104, 15, 15, 15, 61, 61, 74, 227, 228, - 240, 59, 62, 86, 103, 106, 162, 107, 107, 139, - 73, 77, 113, 102, 103, 156, 54, 56, 76, 97, - 103, 159, 137, 137, 182, 35, 35, 38, 190, 193, - 221, 145, 145, 193, 103, 105, 159, 78, 82, 122, - 76, 76, 95, 147, 148, 200, 92, 92, 117, 105, - 105, 156, 103, 105, 160, 150, 150, 202, 64, 67, - 95, 114, 114, 149, 108, 108, 159, 143, 143, 194, - 84, 84, 106, 140, 140, 191, 102, 104, 157, 48, - 48, 61, 27, 29, 42, 114, 114, 165, 83, 88, - 132, 153, 153, 204, 121, 126, 186, 127, 127, 178, - 208, 210, 230, 149, 149, 200, 146, 146, 197, 141, - 143, 197, 55, 55, 67, 144, 145, 199, 133, 133, - 184, 124, 124, 175, 110, 115, 171, 130, 133, 191, - 88, 91, 137, 86, 92, 144, 154, 156, 172, 87, - 92, 139, 85, 86, 125, 118, 123, 184, 121, 122, - 172, 124, 128, 187, 82, 86, 130, 39, 39, 46, - 99, 99, 128, 69, 69, 85, 97, 101, 153, 75, - 75, 107, 115, 121, 182, 135, 138, 194, 101, 107, - 165, 82, 84, 101, 102, 102, 140, 53, 57, 89, - 69, 71, 101, 137, 137, 188, 109, 116, 179, 130, - 130, 182, 57, 57, 76, 93, 99, 155, 117, 117, - 168, 62, 63, 86, 84, 84, 122, 79, 79, 114, - 112, 117, 177, 58, 58, 71, 127, 131, 189, 106, - 106, 150, 76, 76, 101, 134, 135, 187, 20, 20, - 31, 66, 71, 111, 125, 129, 182, 172, 173, 180, - 86, 88, 131, 229, 230, 234, 108, 112, 171, 100, - 105, 161, 161, 165, 203, 53, 53, 70, 95, 97, - 146, 58, 60, 81, 217, 219, 234, 195, 196, 208, - 82, 85, 125, 112, 118, 181, 82, 82, 106, 114, - 117, 175, 154, 157, 195, 134, 134, 179, 111, 111, - 162, 6, 7, 11, 110, 111, 146, 93, 93, 138, - 77, 79, 116, 115, 119, 179, 103, 108, 161, 60, - 64, 100, 98, 98, 145, 40, 40, 47, 51, 51, - 63, 69, 69, 95, 73, 78, 122, 197, 198, 202, - 54, 54, 58, 13, 14, 22, 108, 114, 174, 149, - 152, 184, 101, 108, 167, 88, 88, 130, 106, 108, - 162, 86, 91, 141, 84, 84, 116, 86, 86, 90, - 129, 131, 186, 132, 135, 181, 160, 163, 183, 211, - 212, 224, 91, 91, 123, 109, 109, 117, 104, 104, - 135, 86, 86, 115, 90, 92, 108, 81, 83, 122, - 103, 106, 130, 70, 70, 99, 121, 126, 170, 139, - 139, 186, 73, 74, 94, 109, 109, 148, 139, 140, - 189, 135, 138, 162, 176, 179, 199, 115, 115, 115, - 106, 106, 144, 59, 63, 98, 67, 69, 96, 241, - 241, 241, 102, 105, 149, 120, 120, 162, 68, 68, - 90, 89, 89, 115, 51, 52, 79, 113, 113, 152, - 33, 35, 55, 189, 190, 215, 79, 79, 104, 213, - 214, 218, 94, 95, 142, 163, 164, 176, 86, 89, - 133, 112, 112, 156, 80, 81, 118, 63, 65, 90, - 102, 103, 124, 126, 129, 157, 72, 72, 98, 150, - 150, 154, 72, 74, 100, 112, 112, 151, 138, 139, - 192, 122, 125, 180, 49, 50, 64, 78, 78, 110, - 119, 119, 157, 125, 126, 174, 77, 81, 119, 125, - 126, 180, 56, 56, 72, 118, 120, 173, 46, 49, - 77, 92, 96, 132, 188, 189, 197, 65, 65, 81, - 165, 168, 200, 49, 51, 66, 143, 147, 194, 80, - 82, 111, 192, 195, 215, 235, 235, 242, 105, 111, - 170, 74, 77, 107, 183, 186, 210, 109, 111, 165, - 117, 120, 152, 65, 66, 90, 182, 182, 186, 104, - 104, 137, 123, 127, 163, 170, 171, 187, 110, 113, - 163, 33, 249, 4, 1, 0, 0, 0, 0, 44, - 0, 0, 0, 0, 120, 0, 67, 0, 0, 8, - 255, 0, 1, 8, 28, 72, 176, 160, 193, 131, - 8, 19, 42, 92, 200, 176, 161, 195, 135, 16, - 35, 74, 156, 72, 177, 162, 197, 139, 24, 51, - 106, 220, 200, 209, 162, 145, 43, 104, 188, 116, - 28, 73, 210, 160, 23, 145, 8, 141, 24, 84, - 50, 40, 128, 75, 17, 122, 228, 112, 65, 200, - 69, 140, 146, 146, 56, 83, 170, 9, 144, 6, - 192, 11, 38, 69, 190, 209, 88, 82, 196, 134, - 141, 1, 44, 6, 40, 29, 64, 65, 30, 19, - 29, 71, 138, 250, 137, 129, 163, 202, 157, 107, - 99, 48, 96, 128, 246, 67, 200, 139, 23, 66, - 62, 186, 212, 224, 36, 103, 206, 31, 58, 92, - 56, 75, 214, 35, 198, 210, 183, 112, 153, 142, - 88, 58, 231, 207, 11, 67, 113, 86, 172, 56, - 65, 68, 91, 219, 185, 61, 226, 142, 160, 65, - 163, 199, 167, 81, 102, 71, 2, 69, 26, 119, - 169, 10, 28, 59, 180, 210, 216, 17, 137, 138, - 152, 60, 1, 180, 250, 72, 194, 3, 148, 75, - 151, 5, 16, 124, 254, 188, 98, 7, 156, 127, - 24, 118, 196, 24, 209, 67, 138, 10, 32, 54, - 92, 0, 224, 162, 50, 241, 68, 175, 79, 58, - 188, 165, 16, 99, 201, 142, 49, 145, 68, 143, - 254, 12, 1, 134, 112, 151, 30, 120, 136, 24, - 206, 252, 115, 1, 15, 10, 70, 43, 200, 17, - 125, 133, 190, 14, 29, 112, 84, 194, 99, 251, - 161, 144, 35, 50, 88, 232, 255, 30, 32, 136, - 70, 21, 31, 159, 65, 68, 111, 94, 64, 196, - 122, 151, 8, 134, 228, 56, 222, 124, 180, 3, - 8, 163, 219, 131, 24, 45, 26, 3, 133, 1, - 108, 0, 211, 29, 67, 58, 188, 213, 193, 17, - 226, 96, 246, 25, 2, 248, 213, 167, 64, 131, - 38, 144, 16, 128, 7, 73, 68, 247, 203, 61, - 100, 212, 7, 154, 2, 5, 72, 231, 65, 135, - 205, 33, 176, 199, 0, 50, 44, 51, 224, 65, - 46, 28, 17, 204, 82, 29, 20, 1, 134, 37, - 195, 21, 0, 34, 115, 5, 56, 0, 98, 5, - 4, 16, 176, 205, 51, 235, 76, 33, 64, 2, - 11, 112, 163, 161, 141, 252, 121, 64, 223, 112, - 34, 240, 160, 128, 15, 49, 168, 224, 206, 15, - 39, 10, 132, 214, 120, 20, 220, 81, 135, 17, - 104, 104, 200, 222, 140, 1, 68, 144, 163, 4, - 40, 24, 80, 2, 7, 12, 92, 96, 71, 125, - 92, 6, 160, 128, 3, 67, 14, 225, 193, 104, - 107, 12, 208, 129, 14, 39, 230, 166, 20, 5, - 75, 180, 194, 67, 35, 90, 246, 233, 146, 3, - 4, 160, 34, 64, 6, 18, 28, 48, 64, 13, - 7, 28, 128, 136, 159, 8, 176, 137, 38, 12, - 57, 164, 169, 192, 24, 50, 12, 96, 195, 11, - 98, 92, 129, 210, 72, 66, 60, 241, 22, 14, - 39, 40, 32, 66, 154, 126, 50, 7, 65, 38, - 4, 36, 32, 192, 170, 172, 94, 96, 64, 134, - 26, 202, 255, 72, 234, 103, 211, 57, 202, 220, - 42, 216, 28, 161, 212, 8, 24, 4, 242, 197, - 108, 55, 105, 228, 66, 82, 187, 98, 160, 230, - 145, 165, 14, 135, 64, 116, 94, 30, 192, 42, - 171, 51, 164, 146, 44, 123, 48, 52, 88, 159, - 8, 81, 160, 225, 131, 106, 20, 0, 81, 138, - 61, 43, 88, 178, 5, 70, 46, 216, 57, 0, - 17, 206, 185, 52, 65, 5, 13, 76, 240, 129, - 75, 13, 108, 80, 170, 140, 1, 108, 240, 229, - 179, 171, 18, 48, 197, 180, 46, 201, 27, 64, - 60, 31, 126, 166, 193, 6, 241, 194, 151, 196, - 126, 11, 230, 64, 68, 96, 3, 224, 64, 142, - 38, 22, 233, 48, 94, 195, 39, 12, 23, 68, - 142, 24, 63, 144, 241, 3, 17, 100, 65, 194, - 186, 239, 54, 215, 64, 170, 248, 10, 32, 193, - 12, 103, 38, 107, 130, 151, 26, 19, 112, 67, - 203, 45, 231, 248, 64, 11, 244, 68, 160, 193, - 103, 30, 32, 28, 128, 15, 107, 248, 81, 41, - 11, 109, 12, 163, 6, 26, 181, 49, 36, 68, - 17, 75, 45, 81, 49, 115, 24, 99, 60, 131, - 53, 138, 36, 144, 128, 151, 77, 19, 208, 194, - 4, 19, 220, 252, 153, 151, 18, 148, 92, 194, - 12, 167, 36, 187, 65, 204, 78, 75, 157, 192, - 62, 101, 164, 173, 8, 3, 26, 183, 240, 64, - 10, 180, 164, 25, 5, 18, 122, 180, 161, 27, - 5, 59, 4, 16, 70, 89, 11, 13, 255, 187, - 20, 186, 245, 229, 24, 230, 0, 37, 11, 112, - 200, 20, 116, 224, 114, 0, 153, 24, 167, 208, - 64, 0, 56, 102, 80, 248, 0, 12, 80, 18, - 1, 49, 249, 188, 67, 66, 10, 17, 180, 144, - 227, 13, 89, 76, 0, 57, 1, 12, 36, 144, - 193, 1, 6, 212, 80, 248, 179, 6, 44, 128, - 113, 11, 143, 127, 38, 2, 22, 86, 200, 81, - 15, 13, 74, 173, 17, 69, 31, 125, 143, 183, - 3, 224, 34, 19, 176, 192, 234, 171, 215, 144, - 193, 2, 174, 63, 80, 193, 4, 4, 200, 178, - 186, 1, 82, 51, 48, 67, 244, 57, 74, 125, - 64, 2, 86, 147, 64, 128, 179, 196, 175, 110, - 193, 1, 12, 48, 208, 130, 115, 81, 224, 19, - 199, 103, 59, 12, 160, 130, 35, 220, 37, 36, - 68, 165, 20, 24, 171, 37, 243, 220, 119, 63, - 57, 10, 4, 4, 113, 177, 5, 246, 219, 127, - 64, 142, 11, 80, 93, 255, 188, 71, 0, 151, - 64, 32, 10, 58, 251, 12, 96, 54, 161, 16, - 55, 168, 111, 105, 90, 202, 130, 170, 6, 184, - 186, 11, 20, 227, 3, 4, 48, 0, 5, 137, - 231, 58, 13, 110, 176, 100, 23, 56, 0, 44, - 146, 48, 170, 230, 156, 64, 5, 3, 0, 68, - 66, 152, 160, 148, 188, 245, 201, 94, 245, 251, - 224, 170, 36, 80, 2, 1, 148, 129, 0, 116, - 144, 33, 190, 106, 224, 58, 29, 226, 235, 0, - 22, 56, 4, 178, 255, 136, 195, 11, 10, 140, - 32, 33, 149, 194, 65, 169, 82, 176, 189, 146, - 89, 32, 71, 28, 176, 31, 13, 19, 69, 128, - 93, 248, 144, 85, 6, 200, 209, 234, 74, 144, - 168, 68, 89, 64, 2, 252, 43, 220, 12, 4, - 176, 40, 230, 32, 0, 58, 39, 8, 204, 49, - 14, 210, 137, 7, 150, 170, 2, 15, 136, 161, - 0, 6, 208, 180, 4, 132, 201, 2, 9, 224, - 64, 6, 8, 199, 42, 227, 93, 0, 135, 221, - 59, 64, 6, 164, 70, 168, 194, 145, 169, 112, - 25, 168, 26, 198, 22, 144, 0, 62, 178, 202, - 2, 6, 80, 133, 169, 172, 181, 130, 1, 72, - 161, 32, 74, 80, 131, 91, 98, 0, 154, 62, - 153, 32, 142, 37, 91, 64, 4, 194, 64, 53, - 140, 205, 131, 17, 12, 112, 164, 0, 178, 168, - 175, 213, 161, 192, 117, 110, 187, 1, 1, 46, - 80, 50, 202, 209, 50, 148, 4, 200, 68, 5, - 150, 87, 129, 15, 76, 128, 21, 11, 136, 226, - 179, 6, 160, 42, 62, 56, 135, 67, 206, 201, - 193, 0, 186, 64, 16, 35, 196, 161, 10, 74, - 89, 129, 3, 134, 56, 28, 38, 170, 50, 95, - 65, 8, 128, 6, 76, 128, 181, 130, 137, 130, - 3, 194, 100, 85, 15, 87, 103, 181, 10, 184, - 4, 71, 97, 124, 22, 7, 8, 208, 181, 80, - 222, 160, 57, 124, 64, 193, 45, 159, 149, 1, - 3, 172, 225, 79, 244, 81, 64, 8, 66, 208, - 255, 133, 1, 64, 73, 32, 87, 8, 64, 96, - 128, 0, 130, 89, 13, 7, 71, 99, 220, 33, - 1, 98, 215, 28, 78, 44, 64, 149, 210, 91, - 157, 4, 8, 16, 178, 0, 92, 236, 154, 2, - 32, 29, 57, 179, 201, 28, 100, 160, 32, 156, - 172, 170, 167, 29, 232, 21, 163, 38, 64, 193, - 5, 3, 160, 147, 64, 90, 178, 201, 100, 121, - 169, 134, 248, 202, 162, 9, 234, 195, 135, 31, - 61, 11, 127, 146, 43, 92, 9, 22, 250, 153, - 27, 48, 160, 112, 36, 171, 37, 1, 180, 198, - 31, 81, 212, 96, 158, 226, 148, 0, 172, 154, - 19, 130, 45, 164, 161, 20, 69, 32, 136, 58, - 148, 178, 4, 246, 12, 199, 94, 236, 44, 89, - 13, 120, 122, 213, 6, 244, 194, 0, 72, 237, - 96, 5, 9, 48, 83, 151, 4, 149, 117, 194, - 43, 92, 22, 253, 37, 176, 10, 212, 194, 2, - 72, 21, 128, 5, 102, 16, 141, 250, 196, 103, - 8, 129, 56, 129, 250, 248, 6, 0, 77, 40, - 165, 10, 195, 153, 38, 115, 48, 56, 188, 146, - 101, 81, 66, 7, 157, 101, 9, 60, 40, 0, - 252, 77, 176, 112, 12, 40, 224, 103, 64, 25, - 83, 45, 150, 108, 162, 12, 29, 139, 240, 12, - 208, 206, 86, 149, 96, 169, 163, 241, 0, 2, - 93, 162, 215, 1, 80, 97, 32, 47, 80, 138, - 25, 62, 115, 159, 52, 117, 72, 150, 32, 197, - 34, 1, 204, 57, 154, 13, 255, 120, 41, 174, - 255, 235, 172, 66, 37, 235, 146, 7, 164, 83, - 182, 4, 80, 235, 108, 135, 35, 203, 194, 226, - 139, 1, 251, 82, 22, 9, 103, 84, 0, 165, - 212, 1, 181, 74, 169, 134, 140, 220, 147, 31, - 71, 105, 224, 94, 134, 165, 104, 53, 9, 224, - 141, 146, 97, 143, 120, 89, 140, 192, 104, 50, - 232, 53, 203, 86, 150, 182, 218, 212, 94, 59, - 10, 247, 63, 118, 12, 199, 3, 243, 25, 13, - 4, 66, 160, 20, 38, 64, 119, 0, 80, 248, - 2, 12, 152, 171, 128, 227, 140, 236, 167, 133, - 123, 98, 10, 76, 240, 1, 13, 84, 64, 150, - 182, 224, 4, 190, 240, 23, 220, 45, 18, 64, - 188, 240, 106, 48, 190, 254, 104, 220, 103, 253, - 239, 3, 38, 104, 64, 3, 60, 247, 0, 31, - 225, 139, 114, 148, 200, 15, 117, 237, 51, 132, - 38, 116, 129, 5, 4, 73, 237, 0, 172, 32, - 6, 249, 38, 48, 0, 218, 203, 169, 119, 101, - 214, 52, 70, 232, 118, 85, 137, 148, 240, 140, - 57, 26, 128, 145, 1, 117, 150, 144, 205, 145, - 231, 114, 196, 0, 198, 222, 148, 1, 161, 160, - 149, 181, 98, 244, 5, 22, 216, 128, 32, 186, - 90, 113, 64, 213, 100, 28, 230, 104, 79, 142, - 143, 44, 93, 6, 46, 144, 72, 6, 220, 120, - 85, 216, 211, 49, 190, 114, 84, 81, 31, 87, - 182, 137, 184, 4, 18, 7, 92, 247, 91, 122, - 166, 0, 255, 52, 68, 178, 171, 47, 6, 240, - 4, 40, 15, 192, 13, 86, 80, 66, 24, 96, - 240, 166, 230, 104, 175, 205, 196, 147, 128, 0, - 241, 181, 211, 28, 97, 116, 149, 57, 42, 107, - 0, 152, 87, 178, 117, 146, 183, 150, 95, 22, - 174, 232, 72, 234, 32, 30, 176, 97, 0, 71, - 32, 72, 27, 148, 226, 2, 43, 204, 194, 160, - 48, 126, 244, 21, 89, 41, 56, 246, 90, 109, - 52, 102, 126, 150, 235, 196, 172, 67, 215, 17, - 245, 81, 33, 128, 131, 82, 84, 42, 16, 21, - 243, 99, 202, 26, 194, 145, 145, 101, 72, 185, - 252, 229, 8, 203, 63, 34, 0, 98, 63, 35, - 102, 58, 158, 213, 135, 59, 125, 179, 150, 20, - 192, 131, 16, 128, 33, 23, 36, 42, 200, 15, - 148, 2, 60, 13, 141, 108, 215, 3, 52, 192, - 245, 8, 240, 128, 172, 253, 250, 199, 108, 53, - 235, 153, 129, 77, 193, 137, 62, 32, 220, 102, - 228, 1, 18, 78, 90, 41, 55, 96, 82, 41, - 52, 232, 100, 125, 236, 133, 109, 11, 112, 160, - 139, 248, 30, 228, 235, 10, 108, 86, 2, 0, - 58, 139, 239, 28, 141, 9, 26, 60, 0, 49, - 133, 25, 5, 37, 67, 193, 1, 34, 221, 199, - 255, 221, 224, 213, 14, 130, 130, 21, 142, 50, - 0, 217, 16, 36, 20, 74, 193, 1, 2, 168, - 169, 174, 172, 170, 83, 145, 85, 123, 155, 162, - 251, 205, 129, 107, 174, 179, 162, 17, 255, 6, - 185, 199, 89, 85, 104, 225, 113, 96, 112, 171, - 50, 128, 5, 50, 16, 89, 101, 251, 9, 2, - 77, 120, 129, 110, 80, 92, 144, 60, 40, 133, - 20, 160, 118, 137, 151, 74, 150, 163, 126, 132, - 97, 166, 19, 120, 68, 34, 208, 61, 156, 166, - 205, 224, 229, 6, 104, 29, 111, 71, 67, 130, - 8, 164, 128, 4, 13, 208, 192, 134, 1, 252, - 172, 200, 222, 192, 31, 212, 80, 57, 183, 179, - 86, 42, 16, 132, 160, 9, 72, 43, 130, 16, - 12, 194, 5, 72, 68, 179, 79, 17, 120, 236, - 170, 182, 202, 85, 6, 5, 221, 37, 4, 214, - 192, 7, 200, 38, 236, 100, 61, 64, 238, 249, - 226, 170, 134, 179, 16, 129, 32, 124, 128, 4, - 31, 168, 0, 196, 53, 4, 131, 16, 108, 2, - 28, 74, 249, 167, 65, 152, 145, 241, 252, 28, - 105, 18, 128, 103, 165, 9, 10, 160, 30, 126, - 225, 253, 6, 17, 32, 48, 122, 251, 52, 50, - 152, 62, 43, 71, 139, 247, 188, 75, 134, 224, - 108, 38, 36, 229, 201, 9, 241, 212, 185, 2, - 80, 35, 46, 41, 0, 6, 152, 175, 108, 11, - 64, 208, 103, 213, 251, 62, 0, 214, 36, 122, - 22, 126, 207, 28, 71, 196, 130, 88, 44, 88, - 123, 66, 92, 80, 169, 1, 220, 97, 14, 252, - 201, 1, 126, 254, 94, 89, 105, 216, 138, 248, - 252, 178, 151, 140, 79, 111, 115, 236, 175, 96, - 46, 74, 177, 129, 255, 242, 21, 242, 131, 241, - 196, 96, 7, 39, 40, 0, 12, 246, 171, 77, - 32, 163, 85, 116, 67, 194, 126, 125, 152, 136, - 237, 140, 14, 219, 247, 39, 160, 1, 5, 254, - 35, 167, 54, 60, 228, 12, 252, 199, 20, 158, - 176, 28, 17, 102, 122, 49, 71, 0, 76, 247, - 39, 215, 39, 127, 163, 17, 1, 92, 119, 83, - 4, 0, 127, 190, 167, 127, 75, 193, 2, 76, - 32, 121, 12, 225, 5, 59, 3, 126, 74, 161, - 2, 61, 96, 44, 21, 144, 74, 171, 50, 0, - 112, 21, 89, 35, 7, 31, 16, 192, 37, 148, - 38, 127, 204, 179, 0, 23, 176, 0, 211, 115, - 58, 216, 147, 128, 125, 178, 2, 40, 180, 20, - 50, 64, 107, 16, 161, 6, 10, 240, 6, 128, - 32, 5, 112, 161, 2, 15, 48, 3, 139, 51, - 3, 220, 22, 1, 133, 23, 35, 157, 231, 28, - 113, 22, 34, 170, 215, 46, 136, 87, 1, 143, - 192, 57, 17, 32, 129, 201, 98, 131, 75, 1, - 4, 133, 208, 9, 22, 65, 5, 72, 128, 5, - 90, 240, 2, 196, 162, 20, 198, 160, 12, 4, - 16, 58, 52, 232, 1, 189, 231, 18, 107, 162, - 33, 141, 130, 125, 10, 240, 30, 158, 151, 127, - 55, 8, 4, 166, 96, 14, 35, 225, 2, 151, - 64, 10, 111, 49, 24, 85, 96, 6, 24, 176, - 2, 180, 82, 101, 74, 230, 134, 200, 244, 123, - 8, 32, 2, 11, 56, 45, 62, 0, 126, 64, - 255, 0, 8, 96, 160, 5, 56, 145, 6, 127, - 80, 8, 19, 3, 23, 49, 240, 9, 139, 160, - 21, 198, 114, 70, 139, 8, 26, 75, 104, 87, - 28, 215, 30, 107, 56, 47, 13, 178, 2, 252, - 183, 7, 132, 48, 46, 182, 225, 2, 20, 215, - 24, 187, 225, 7, 130, 216, 28, 188, 167, 37, - 111, 168, 33, 32, 144, 4, 159, 168, 37, 32, - 192, 3, 67, 112, 2, 56, 192, 127, 205, 0, - 5, 81, 2, 0, 104, 81, 4, 93, 32, 5, - 50, 176, 7, 240, 0, 139, 31, 40, 29, 57, - 176, 139, 180, 215, 134, 14, 50, 4, 4, 56, - 45, 10, 192, 122, 174, 0, 9, 252, 151, 14, - 194, 80, 140, 5, 177, 5, 84, 208, 7, 80, - 32, 7, 1, 240, 6, 103, 144, 13, 56, 192, - 129, 3, 48, 2, 68, 48, 7, 124, 166, 37, - 16, 240, 98, 249, 145, 3, 81, 112, 125, 43, - 48, 6, 39, 128, 30, 39, 96, 6, 128, 40, - 63, 5, 144, 3, 163, 0, 7, 151, 166, 20, - 82, 64, 8, 146, 8, 142, 9, 129, 5, 33, - 128, 4, 232, 64, 90, 68, 192, 129, 64, 32, - 9, 26, 114, 123, 28, 39, 2, 33, 144, 4, - 46, 65, 4, 85, 16, 140, 76, 225, 22, 176, - 40, 3, 64, 240, 22, 130, 112, 9, 124, 165, - 144, 9, 193, 138, 225, 160, 51, 139, 80, 144, - 187, 178, 4, 242, 227, 3, 8, 80, 45, 204, - 33, 63, 16, 208, 108, 103, 190, 48, 14, 20, - 160, 2, 32, 9, 139, 62, 249, 4, 24, 136, - 146, 14, 97, 8, 129, 0, 1, 67, 192, 3, - 5, 128, 59, 65, 200, 20, 75, 176, 4, 52, - 192, 142, 112, 1, 4, 205, 23, 132, 43, 80, - 9, 158, 16, 2, 124, 114, 142, 103, 240, 7, - 221, 160, 3, 58, 192, 4, 47, 32, 148, 21, - 225, 4, 72, 128, 4, 152, 224, 18, 62, 32, - 9, 1, 232, 147, 62, 217, 1, 70, 49, 13, - 186, 80, 14, 137, 160, 0, 73, 112, 118, 95, - 160, 4, 152, 144, 3, 13, 137, 5, 98, 201, - 17, 70, 0, 10, 55, 25, 2, 8, 224, 3, - 231, 32, 5, 82, 208, 5, 50, 208, 1, 196, - 2, 4, 130, 96, 3, 71, 224, 6, 183, 80, - 7, 47, 96, 113, 7, 1, 6, 84, 0, 134, - 2, 225, 4, 125, 144, 6, 9, 217, 151, 27, - 225, 4, 77, 208, 4, 119, 249, 10, 13, 169, - 7, 4, 129, 5, 84, 208, 62, 158, 185, 154, - 8, 177, 5, 80, 208, 153, 172, 25, 155, 178, - 57, 155, 180, 41, 148, 1, 1, 0, 59, 0 }; diff --git a/main/main.c b/main/main.c deleted file mode 100644 index fd9506d3fc39b..0000000000000 --- a/main/main.c +++ /dev/null @@ -1,2173 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Andi Gutmans | - | Rasmus Lerdorf | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* {{{ includes - */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include -#include -#ifdef PHP_WIN32 -#include "win32/time.h" -#include "win32/signal.h" -#include "win32/php_win32_globals.h" -#include -#elif defined(NETWARE) -#include -#ifdef USE_WINSOCK -#include -#endif -#endif -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_SETLOCALE -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/php_string.h" -#include "php_variables.h" -#include "ext/standard/credits.h" -#ifdef PHP_WIN32 -#include -#include "win32/php_registry.h" -#include "ext/standard/flock_compat.h" -#endif -#include "php_syslog.h" -#include "Zend/zend_exceptions.h" - -#if PHP_SIGCHILD -#include -#include -#endif - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" -#include "zend_extensions.h" -#include "zend_ini.h" - -#include "php_content_types.h" -#include "php_ticks.h" -#include "php_logos.h" -#include "php_streams.h" -#include "php_open_temporary_file.h" - -#include "SAPI.h" -#include "rfc1867.h" -/* }}} */ - -#ifndef ZTS -php_core_globals core_globals; -#else -PHPAPI int core_globals_id; -#endif - -#define SAFE_FILENAME(f) ((f)?(f):"-") - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnSetPrecision) -{ - int i = atoi(new_value); - if (i >= 0) { - EG(precision) = i; - return SUCCESS; - } else { - return FAILURE; - } -} -/* }}} */ - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnChangeMemoryLimit) -{ - if (new_value) { - PG(memory_limit) = zend_atoi(new_value, new_value_length); - } else { - PG(memory_limit) = 1<<30; /* effectively, no limit */ - } - return zend_set_memory_limit(PG(memory_limit)); -} -/* }}} */ - - -/* {{{ php_disable_functions - */ -static void php_disable_functions(TSRMLS_D) -{ - char *s = NULL, *e; - - if (!*(INI_STR("disable_functions"))) { - return; - } - - e = PG(disable_functions) = strdup(INI_STR("disable_functions")); - - while (*e) { - switch (*e) { - case ' ': - case ',': - if (s) { - *e = '\0'; - zend_disable_function(s, e-s TSRMLS_CC); - s = NULL; - } - break; - default: - if (!s) { - s = e; - } - break; - } - e++; - } - if (s) { - zend_disable_function(s, e-s TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ php_disable_classes - */ -static void php_disable_classes(TSRMLS_D) -{ - char *s = NULL, *e; - - if (!*(INI_STR("disable_classes"))) { - return; - } - - e = PG(disable_classes) = strdup(INI_STR("disable_classes")); - - while (*e) { - switch (*e) { - case ' ': - case ',': - if (s) { - *e = '\0'; - zend_disable_class(s, e-s TSRMLS_CC); - s = NULL; - } - break; - default: - if (!s) { - s = e; - } - break; - } - e++; - } - if (s) { - zend_disable_class(s, e-s TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnUpdateTimeout) -{ - EG(timeout_seconds) = atoi(new_value); - if (stage==PHP_INI_STAGE_STARTUP) { - /* Don't set a timeout on startup, only per-request */ - return SUCCESS; - } - zend_unset_timeout(TSRMLS_C); - zend_set_timeout(EG(timeout_seconds)); - return SUCCESS; -} -/* }}} */ - -/* {{{ php_get_display_errors_mode() helper function - */ -static int php_get_display_errors_mode(char *value, int value_length) -{ - int mode; - - if (!value) { - return PHP_DISPLAY_ERRORS_STDOUT; - } - - if (value_length == 2 && !strcasecmp("on", value)) { - mode = PHP_DISPLAY_ERRORS_STDOUT; - } else if (value_length == 3 && !strcasecmp("yes", value)) { - mode = PHP_DISPLAY_ERRORS_STDOUT; - } else if (value_length == 4 && !strcasecmp("true", value)) { - mode = PHP_DISPLAY_ERRORS_STDOUT; - } else if (value_length == 6 && !strcasecmp(value, "stderr")) { - mode = PHP_DISPLAY_ERRORS_STDERR; - } else if (value_length == 6 && !strcasecmp(value, "stdout")) { - mode = PHP_DISPLAY_ERRORS_STDOUT; - } else { - mode = atoi(value); - if (mode && mode != PHP_DISPLAY_ERRORS_STDOUT && mode != PHP_DISPLAY_ERRORS_STDERR) { - mode = PHP_DISPLAY_ERRORS_STDOUT; - } - } - - return mode; -} -/* }}} */ - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnUpdateDisplayErrors) -{ - PG(display_errors) = (zend_bool) php_get_display_errors_mode(new_value, new_value_length); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_INI_DISP - */ -static PHP_INI_DISP(display_errors_mode) -{ - int mode, tmp_value_length, cgi_or_cli; - char *tmp_value; - TSRMLS_FETCH(); - - if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL ); - tmp_value_length = ini_entry->orig_value_length; - } else if (ini_entry->value) { - tmp_value = ini_entry->value; - tmp_value_length = ini_entry->value_length; - } else { - tmp_value = NULL; - tmp_value_length = 0; - } - - mode = php_get_display_errors_mode(tmp_value, tmp_value_length); - - /* Display 'On' for other SAPIs instead of STDOUT or STDERR */ - cgi_or_cli = (!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi")); - - switch (mode) { - case PHP_DISPLAY_ERRORS_STDERR: - if (cgi_or_cli ) { - PUTS("STDERR"); - } else { - PUTS("On"); - } - break; - - case PHP_DISPLAY_ERRORS_STDOUT: - if (cgi_or_cli ) { - PUTS("STDOUT"); - } else { - PUTS("On"); - } - break; - - default: - PUTS("Off"); - break; - } -} -/* }}} */ - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnUpdateErrorLog) -{ - /* Only do the safemode/open_basedir check at runtime */ - if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && - strcmp(new_value, "syslog")) { - if (PG(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return FAILURE; - } - - if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) { - return FAILURE; - } - - } - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_INI_MH - */ -static PHP_INI_MH(OnChangeMailForceExtra) -{ - /* Don't allow changing it in htaccess */ - if (stage == PHP_INI_STAGE_HTACCESS) { - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - - -/* Need to convert to strings and make use of: - * PHP_SAFE_MODE - * - * Need to be read from the environment (?): - * PHP_AUTO_PREPEND_FILE - * PHP_AUTO_APPEND_FILE - * PHP_DOCUMENT_ROOT - * PHP_USER_DIR - * PHP_INCLUDE_PATH - */ - -#ifndef PHP_SAFE_MODE_EXEC_DIR -# define PHP_SAFE_MODE_EXEC_DIR "" -#endif - - /* Windows and Netware use the internal mail */ -#if defined(PHP_WIN32) || defined(NETWARE) -# define DEFAULT_SENDMAIL_PATH NULL -#elif defined(PHP_PROG_SENDMAIL) -# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL " -t -i " -#else -# define DEFAULT_SENDMAIL_PATH "/usr/sbin/sendmail -t -i" -#endif - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() - PHP_INI_ENTRY_EX("define_syslog_variables", "0", PHP_INI_ALL, NULL, php_ini_boolean_displayer_cb) - PHP_INI_ENTRY_EX("highlight.bg", HL_BG_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.comment", HL_COMMENT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.default", HL_DEFAULT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.html", HL_HTML_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.keyword", HL_KEYWORD_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - PHP_INI_ENTRY_EX("highlight.string", HL_STRING_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb) - - STD_PHP_INI_BOOLEAN("allow_call_time_pass_reference", "1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, allow_call_time_pass_reference, zend_compiler_globals, compiler_globals) - STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, asp_tags, zend_compiler_globals, compiler_globals) - STD_PHP_INI_ENTRY_EX("display_errors", "1", PHP_INI_ALL, OnUpdateDisplayErrors, display_errors, php_core_globals, core_globals, display_errors_mode) - STD_PHP_INI_BOOLEAN("display_startup_errors", "0", PHP_INI_ALL, OnUpdateBool, display_startup_errors, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateBool, enable_dl, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("expose_php", "1", PHP_INI_SYSTEM, OnUpdateBool, expose_php, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("docref_root", "", PHP_INI_ALL, OnUpdateString, docref_root, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("docref_ext", "", PHP_INI_ALL, OnUpdateString, docref_ext, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("html_errors", "1", PHP_INI_ALL, OnUpdateBool, html_errors, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("xmlrpc_errors", "0", PHP_INI_SYSTEM, OnUpdateBool, xmlrpc_errors, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("xmlrpc_error_number", "0", PHP_INI_ALL, OnUpdateLong, xmlrpc_error_number, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("max_input_time", "-1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, max_input_time, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("ignore_user_abort", "0", PHP_INI_ALL, OnUpdateBool, ignore_user_abort, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("implicit_flush", "0", PHP_INI_ALL, OnUpdateBool, implicit_flush, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("log_errors_max_len", "1024", PHP_INI_ALL, OnUpdateLong, log_errors_max_len, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("ignore_repeated_errors", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_errors, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("ignore_repeated_source", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_source, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("report_memleaks", "1", PHP_INI_ALL, OnUpdateBool, report_memleaks, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("report_zend_debug", "1", PHP_INI_ALL, OnUpdateBool, report_zend_debug, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("magic_quotes_gpc", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, magic_quotes_gpc, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("magic_quotes_runtime", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_runtime, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("magic_quotes_sybase", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_sybase, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateLong, output_buffering, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("output_handler", NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("register_argc_argv", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("register_globals", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_globals, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("register_long_arrays", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_long_arrays, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("auto_globals_jit", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, auto_globals_jit, php_core_globals, core_globals) -#if PHP_SAFE_MODE - STD_PHP_INI_BOOLEAN("safe_mode", "1", PHP_INI_SYSTEM, OnUpdateBool, safe_mode, php_core_globals, core_globals) -#else - STD_PHP_INI_BOOLEAN("safe_mode", "0", PHP_INI_SYSTEM, OnUpdateBool, safe_mode, php_core_globals, core_globals) -#endif - STD_PHP_INI_ENTRY("safe_mode_include_dir", NULL, PHP_INI_SYSTEM, OnUpdateString, safe_mode_include_dir, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("safe_mode_gid", "0", PHP_INI_SYSTEM, OnUpdateBool, safe_mode_gid, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("short_open_tag", DEFAULT_SHORT_OPEN_TAG, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals) - STD_PHP_INI_BOOLEAN("sql.safe_mode", "0", PHP_INI_SYSTEM, OnUpdateBool, sql_safe_mode, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("track_errors", "0", PHP_INI_ALL, OnUpdateBool, track_errors, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("y2k_compliance", "1", PHP_INI_ALL, OnUpdateBool, y2k_compliance, php_core_globals, core_globals) - - STD_PHP_INI_ENTRY("unserialize_callback_func", NULL, PHP_INI_ALL, OnUpdateString, unserialize_callback_func, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("serialize_precision", "100", PHP_INI_ALL, OnUpdateLongGEZero, serialize_precision, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("arg_separator.output", "&", PHP_INI_ALL, OnUpdateStringUnempty, arg_separator.output, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("arg_separator.input", "&", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateStringUnempty, arg_separator.input, php_core_globals, core_globals) - - STD_PHP_INI_ENTRY("auto_append_file", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, auto_append_file, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("auto_prepend_file", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, auto_prepend_file, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("doc_root", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, doc_root, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("default_charset", SAPI_DEFAULT_CHARSET, PHP_INI_ALL, OnUpdateString, default_charset, sapi_globals_struct,sapi_globals) - STD_PHP_INI_ENTRY("default_mimetype", SAPI_DEFAULT_MIMETYPE, PHP_INI_ALL, OnUpdateString, default_mimetype, sapi_globals_struct,sapi_globals) - STD_PHP_INI_ENTRY("error_log", NULL, PHP_INI_ALL, OnUpdateErrorLog, error_log, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("extension_dir", PHP_EXTENSION_DIR, PHP_INI_SYSTEM, OnUpdateStringUnempty, extension_dir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("include_path", PHP_INCLUDE_PATH, PHP_INI_ALL, OnUpdateStringUnempty, include_path, php_core_globals, core_globals) - PHP_INI_ENTRY("max_execution_time", "30", PHP_INI_ALL, OnUpdateTimeout) - STD_PHP_INI_ENTRY("open_basedir", NULL, PHP_INI_SYSTEM, OnUpdateString, open_basedir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("safe_mode_exec_dir", PHP_SAFE_MODE_EXEC_DIR, PHP_INI_SYSTEM, OnUpdateString, safe_mode_exec_dir, php_core_globals, core_globals) - - STD_PHP_INI_BOOLEAN("file_uploads", "1", PHP_INI_SYSTEM, OnUpdateBool, file_uploads, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("upload_max_filesize", "2M", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, upload_max_filesize, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("post_max_size", "8M", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, post_max_size, sapi_globals_struct,sapi_globals) - STD_PHP_INI_ENTRY("upload_tmp_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, upload_tmp_dir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("max_input_nesting_level", "64", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLongGEZero, max_input_nesting_level, php_core_globals, core_globals) - - STD_PHP_INI_ENTRY("user_dir", NULL, PHP_INI_SYSTEM, OnUpdateString, user_dir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("variables_order", "EGPCS", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateStringUnempty, variables_order, php_core_globals, core_globals) - - STD_PHP_INI_ENTRY("error_append_string", NULL, PHP_INI_ALL, OnUpdateString, error_append_string, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("error_prepend_string", NULL, PHP_INI_ALL, OnUpdateString, error_prepend_string, php_core_globals, core_globals) - - PHP_INI_ENTRY("SMTP", "localhost",PHP_INI_ALL, NULL) - PHP_INI_ENTRY("smtp_port", "25", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("browscap", NULL, PHP_INI_SYSTEM, NULL) - PHP_INI_ENTRY("memory_limit", "128M", PHP_INI_ALL, OnChangeMemoryLimit) - PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision) - PHP_INI_ENTRY("sendmail_from", NULL, PHP_INI_ALL, NULL) - PHP_INI_ENTRY("sendmail_path", DEFAULT_SENDMAIL_PATH, PHP_INI_SYSTEM, NULL) - PHP_INI_ENTRY("mail.force_extra_parameters",NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnChangeMailForceExtra) - PHP_INI_ENTRY("disable_functions", "", PHP_INI_SYSTEM, NULL) - PHP_INI_ENTRY("disable_classes", "", PHP_INI_SYSTEM, NULL) - - STD_PHP_INI_BOOLEAN("allow_url_fopen", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_url_fopen, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("allow_url_include", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_url_include, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("always_populate_raw_post_data", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals) - - STD_PHP_INI_ENTRY("realpath_cache_size", "16K", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_size_limit, virtual_cwd_globals, cwd_globals) - STD_PHP_INI_ENTRY("realpath_cache_ttl", "120", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_ttl, virtual_cwd_globals, cwd_globals) -PHP_INI_END() -/* }}} */ - -/* True globals (no need for thread safety */ -/* But don't make them a single int bitfield */ -static int module_initialized = 0; -static int module_startup = 1; -static int module_shutdown = 0; - -/* {{{ php_log_err - */ -PHPAPI void php_log_err(char *log_message TSRMLS_DC) -{ - int fd = -1; - char error_time_str[128]; - struct tm tmbuf; - time_t error_time; - - /* Try to use the specified logging location. */ - if (PG(error_log) != NULL) { -#ifdef HAVE_SYSLOG_H - if (!strcmp(PG(error_log), "syslog")) { - php_syslog(LOG_NOTICE, "%.500s", log_message); - return; - } -#endif - fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644); - if (fd != -1) { - char *tmp; - int len; - time(&error_time); - strftime(error_time_str, sizeof(error_time_str), "%d-%b-%Y %H:%M:%S", php_localtime_r(&error_time, &tmbuf)); - len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL); -#ifdef PHP_WIN32 - php_flock(fd, 2); -#endif - write(fd, tmp, len); - efree(tmp); - close(fd); - return; - } - } - - /* Otherwise fall back to the default logging location, if we have one */ - - if (sapi_module.log_message) { - sapi_module.log_message(log_message); - } -} -/* }}} */ - -/* {{{ php_write - wrapper for modules to use PHPWRITE */ -PHPAPI int php_write(void *buf, uint size TSRMLS_DC) -{ - return PHPWRITE(buf, size); -} -/* }}} */ - -/* {{{ php_printf - */ -PHPAPI int php_printf(const char *format, ...) -{ - va_list args; - int ret; - char *buffer; - int size; - TSRMLS_FETCH(); - - va_start(args, format); - size = vspprintf(&buffer, 0, format, args); - ret = PHPWRITE(buffer, size); - efree(buffer); - va_end(args); - - return ret; -} -/* }}} */ - -/* {{{ php_verror helpers */ - -/* {{{ php_during_module_startup */ -static int php_during_module_startup(void) -{ - return module_startup; -} -/* }}} */ - -/* {{{ php_during_module_shutdown */ -static int php_during_module_shutdown(void) -{ - return module_shutdown; -} -/* }}} */ - -/* }}} */ - -/* {{{ php_verror */ -/* php_verror is called from php_error_docref functions. - * Its purpose is to unify error messages and automatically generate clickable - * html error messages if correcponding ini setting (html_errors) is activated. - * See: CODING_STANDARDS for details. - */ -PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) -{ - char *buffer = NULL, *docref_buf = NULL, *target = NULL; - char *docref_target = "", *docref_root = ""; - char *p; - int buffer_len = 0; - char *space = ""; - char *class_name = ""; - char *function; - int origin_len; - char *origin; - char *message; - int is_function = 0; - - /* get error text into buffer and escape for html if necessary */ - buffer_len = vspprintf(&buffer, 0, format, args); - if (PG(html_errors)) { - int len; - char *replace = php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC); - efree(buffer); - buffer = replace; - buffer_len = len; - } - - /* which function caused the problem if any at all */ - if (php_during_module_startup()) { - function = "PHP Startup"; - } else if (php_during_module_shutdown()) { - function = "PHP Shutdown"; - } else if (EG(current_execute_data) && - EG(current_execute_data)->opline && - EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL - ) { - switch (EG(current_execute_data)->opline->op2.u.constant.value.lval) { - case ZEND_EVAL: - function = "eval"; - is_function = 1; - break; - case ZEND_INCLUDE: - function = "include"; - is_function = 1; - break; - case ZEND_INCLUDE_ONCE: - function = "include_once"; - is_function = 1; - break; - case ZEND_REQUIRE: - function = "require"; - is_function = 1; - break; - case ZEND_REQUIRE_ONCE: - function = "require_once"; - is_function = 1; - break; - default: - function = "Unknown"; - } - } else { - function = get_active_function_name(TSRMLS_C); - if (!function || !strlen(function)) { - function = "Unknown"; - } else { - is_function = 1; - class_name = get_active_class_name(&space TSRMLS_CC); - } - } - - /* if we still have memory then format the origin */ - if (is_function) { - origin_len = spprintf(&origin, 0, "%s%s%s(%s)", class_name, space, function, params); - } else { - origin_len = spprintf(&origin, 0, "%s", function); - } - - if (PG(html_errors)) { - int len; - char *replace = php_escape_html_entities(origin, origin_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC); - efree(origin); - origin = replace; - } - - /* origin and buffer available, so lets come up with the error message */ - if (docref && docref[0] == '#') { - docref_target = strchr(docref, '#'); - docref = NULL; - } - - /* no docref given but function is known (the default) */ - if (!docref && is_function) { - int doclen; - if (space[0] == '\0') { - doclen = spprintf(&docref_buf, 0, "function.%s", function); - } else { - doclen = spprintf(&docref_buf, 0, "%s.%s", class_name, function); - } - while((p = strchr(docref_buf, '_')) != NULL) { - *p = '-'; - } - docref = php_strtolower(docref_buf, doclen); - } - - /* we have a docref for a function AND - * - we show erroes in html mode OR - * - the user wants to see the links anyway - */ - if (docref && is_function && (PG(html_errors) || strlen(PG(docref_root)))) { - if (strncmp(docref, "http://", 7)) { - /* We don't have 'http://' so we use docref_root */ - - char *ref; /* temp copy for duplicated docref */ - - docref_root = PG(docref_root); - - ref = estrdup(docref); - if (docref_buf) { - efree(docref_buf); - } - docref_buf = ref; - /* strip of the target if any */ - p = strrchr(ref, '#'); - if (p) { - target = estrdup(p); - if (target) { - docref_target = target; - *p = '\0'; - } - } - /* add the extension if it is set in ini */ - if (PG(docref_ext) && strlen(PG(docref_ext))) { - spprintf(&docref_buf, 0, "%s%s", ref, PG(docref_ext)); - efree(ref); - } - docref = docref_buf; - } - /* display html formatted or only show the additional links */ - if (PG(html_errors)) { - spprintf(&message, 0, "%s [%s]: %s", origin, docref_root, docref, docref_target, docref, buffer); - } else { - spprintf(&message, 0, "%s [%s%s%s]: %s", origin, docref_root, docref, docref_target, buffer); - } - if (target) { - efree(target); - } - } else { - spprintf(&message, 0, "%s: %s", origin, buffer); - } - efree(origin); - if (docref_buf) { - efree(docref_buf); - } - - if (PG(track_errors) && module_initialized && EG(active_symbol_table) && - (!EG(user_error_handler) || !(EG(user_error_handler_error_reporting) & type))) { - zval *tmp; - ALLOC_INIT_ZVAL(tmp); - ZVAL_STRINGL(tmp, buffer, buffer_len, 1); - zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) &tmp, sizeof(zval *), NULL); - } - efree(buffer); - - php_error(type, "%s", message); - efree(message); -} -/* }}} */ - -/* {{{ php_error_docref0 */ -/* See: CODING_STANDARDS for details. */ -PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...) -{ - va_list args; - - va_start(args, format); - php_verror(docref, "", type, format, args TSRMLS_CC); - va_end(args); -} -/* }}} */ - -/* {{{ php_error_docref1 */ -/* See: CODING_STANDARDS for details. */ -PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...) -{ - va_list args; - - va_start(args, format); - php_verror(docref, param1, type, format, args TSRMLS_CC); - va_end(args); -} -/* }}} */ - -/* {{{ php_error_docref2 */ -/* See: CODING_STANDARDS for details. */ -PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...) -{ - char *params; - va_list args; - - spprintf(¶ms, 0, "%s,%s", param1, param2); - va_start(args, format); - php_verror(docref, params ? params : "...", type, format, args TSRMLS_CC); - va_end(args); - if (params) { - efree(params); - } -} -/* }}} */ - -/* {{{ php_html_puts */ -PHPAPI void php_html_puts(const char *str, uint size TSRMLS_DC) -{ - zend_html_puts(str, size TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_suppress_errors */ -PHPAPI void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class TSRMLS_DC) -{ - PG(error_handling) = error_handling; - PG(exception_class) = exception_class; - if (PG(last_error_message)) { - free(PG(last_error_message)); - PG(last_error_message) = NULL; - } - if (PG(last_error_file)) { - free(PG(last_error_file)); - PG(last_error_file) = NULL; - } - PG(last_error_lineno) = 0; -} -/* }}} */ - -/* {{{ php_error_cb - extended error handling function */ -static void php_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) -{ - char *buffer; - int buffer_len, display; - TSRMLS_FETCH(); - - buffer_len = vspprintf(&buffer, PG(log_errors_max_len), format, args); - - /* check for repeated errors to be ignored */ - if (PG(ignore_repeated_errors) && PG(last_error_message)) { - /* no check for PG(last_error_file) is needed since it cannot - * be NULL if PG(last_error_message) is not NULL */ - if (strcmp(PG(last_error_message), buffer) - || (!PG(ignore_repeated_source) - && ((PG(last_error_lineno) != (int)error_lineno) - || strcmp(PG(last_error_file), error_filename)))) { - display = 1; - } else { - display = 0; - } - } else { - display = 1; - } - - /* store the error if it has changed */ - if (display) { - if (PG(last_error_message)) { - free(PG(last_error_message)); - } - if (PG(last_error_file)) { - free(PG(last_error_file)); - } - PG(last_error_type) = type; - PG(last_error_message) = strdup(buffer); - PG(last_error_file) = strdup(error_filename); - PG(last_error_lineno) = error_lineno; - } - - /* according to error handling mode, suppress error, throw exception or show it */ - if (PG(error_handling) != EH_NORMAL) { - switch (type) { - case E_ERROR: - case E_CORE_ERROR: - case E_COMPILE_ERROR: - case E_USER_ERROR: - case E_PARSE: - /* fatal errors are real errors and cannot be made exceptions */ - break; - case E_STRICT: - /* for the sake of BC to old damaged code */ - break; - case E_NOTICE: - case E_USER_NOTICE: - /* notices are no errors and are not treated as such like E_WARNINGS */ - break; - default: - /* throw an exception if we are in EH_THROW mode - * but DO NOT overwrite a pending exception - */ - if (PG(error_handling) == EH_THROW && !EG(exception)) { - zend_throw_error_exception(PG(exception_class), buffer, 0, type TSRMLS_CC); - } - efree(buffer); - return; - } - } - - /* display/log the error if necessary */ - if (display && (EG(error_reporting) & type || (type & E_CORE)) - && (PG(log_errors) || PG(display_errors) || (!module_initialized))) { - char *error_type_str; - - switch (type) { - case E_ERROR: - case E_CORE_ERROR: - case E_COMPILE_ERROR: - case E_USER_ERROR: - error_type_str = "Fatal error"; - break; - case E_RECOVERABLE_ERROR: - error_type_str = "Catchable fatal error"; - break; - case E_WARNING: - case E_CORE_WARNING: - case E_COMPILE_WARNING: - case E_USER_WARNING: - error_type_str = "Warning"; - break; - case E_PARSE: - error_type_str = "Parse error"; - break; - case E_NOTICE: - case E_USER_NOTICE: - error_type_str = "Notice"; - break; - case E_STRICT: - error_type_str = "Strict Standards"; - break; - default: - error_type_str = "Unknown error"; - break; - } - - if (!module_initialized || PG(log_errors)) { - char *log_buffer; -#ifdef PHP_WIN32 - if ((type == E_CORE_ERROR || type == E_CORE_WARNING) && PG(display_startup_errors)) { - MessageBox(NULL, buffer, error_type_str, MB_OK|ZEND_SERVICE_MB_STYLE); - } -#endif - spprintf(&log_buffer, 0, "PHP %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno); - php_log_err(log_buffer TSRMLS_CC); - efree(log_buffer); - } - if (PG(display_errors) - && ((module_initialized && !PG(during_request_startup)) - || (PG(display_startup_errors) - && (OG(php_body_write)==php_default_output_func || OG(php_body_write)==php_ub_body_write_no_header || OG(php_body_write)==php_ub_body_write) - ) - ) - ) { - - if (PG(xmlrpc_errors)) { - php_printf("faultCode%ldfaultString%s:%s in %s on line %d", PG(xmlrpc_error_number), error_type_str, buffer, error_filename, error_lineno); - } else { - char *prepend_string = INI_STR("error_prepend_string"); - char *append_string = INI_STR("error_append_string"); - - if (PG(html_errors)) { - if (type == E_ERROR) { - int len; - char *buf = php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC); - php_printf("%s
\n%s: %s in %s on line %d
\n%s", STR_PRINT(prepend_string), error_type_str, buf, error_filename, error_lineno, STR_PRINT(append_string)); - efree(buf); - } else { - php_printf("%s
\n%s: %s in %s on line %d
\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); - } - } else { - /* Write CLI/CGI errors to stderr if display_errors = "stderr" */ - if ((!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi")) && - PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR - ) { - fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno); - } else { - php_printf("%s\n%s: %s in %s on line %d\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); - } - } - } - } -#if ZEND_DEBUG - if (PG(report_zend_debug)) { - zend_bool trigger_break; - - switch (type) { - case E_ERROR: - case E_CORE_ERROR: - case E_COMPILE_ERROR: - case E_USER_ERROR: - trigger_break=1; - break; - default: - trigger_break=0; - break; - } - zend_output_debug_string(trigger_break, "%s(%d) : %s - %s", error_filename, error_lineno, error_type_str, buffer); - } -#endif - } - - /* Bail out if we can't recover */ - switch (type) { - case E_CORE_ERROR: - if(!module_initialized) { - /* bad error in module startup - no way we can live with this */ - exit(-2); - } - /* no break - intentionally */ - case E_ERROR: - case E_RECOVERABLE_ERROR: - case E_PARSE: - case E_COMPILE_ERROR: - case E_USER_ERROR: - EG(exit_status) = 255; - if (module_initialized) { - if (!PG(display_errors) && - !SG(headers_sent) && - SG(sapi_headers).http_response_code == 200 - ) { - sapi_header_line ctr = {0}; - - ctr.line = "HTTP/1.0 500 Internal Server Error"; - ctr.line_len = strlen(ctr.line); - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); - } - /* the parser would return 1 (failure), we can bail out nicely */ - if (type != E_PARSE) { - /* restore memory limit */ - zend_set_memory_limit(PG(memory_limit)); - efree(buffer); - zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC); - zend_bailout(); - return; - } - } - break; - } - - /* Log if necessary */ - if (!display) { - efree(buffer); - return; - } - - if (PG(track_errors) && module_initialized && EG(active_symbol_table)) { - zval *tmp; - ALLOC_INIT_ZVAL(tmp); - ZVAL_STRINGL(tmp, buffer, buffer_len, 1); - zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) & tmp, sizeof(zval *), NULL); - } - - efree(buffer); -} -/* }}} */ - -/* {{{ proto bool set_time_limit(int seconds) - Sets the maximum time a script can run */ -PHP_FUNCTION(set_time_limit) -{ - zval **new_timeout; - - if (PG(safe_mode)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot set time limit in safe mode"); - RETURN_FALSE; - } - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &new_timeout) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(new_timeout); - if (zend_alter_ini_entry("max_execution_time", sizeof("max_execution_time"), Z_STRVAL_PP(new_timeout), Z_STRLEN_PP(new_timeout), PHP_INI_USER, PHP_INI_STAGE_RUNTIME) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_fopen_wrapper_for_zend - */ -static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path) -{ - TSRMLS_FETCH(); - - return php_stream_open_wrapper_as_file((char *)filename, "rb", ENFORCE_SAFE_MODE|USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, opened_path); -} -/* }}} */ - -static void stream_closer_for_zend(void *handle TSRMLS_DC) /* {{{ */ -{ - php_stream_close((php_stream*)handle); -} -/* }}} */ - -static long stream_fteller_for_zend(void *handle TSRMLS_DC) /* {{{ */ -{ - return (long)php_stream_tell((php_stream*)handle); -} -/* }}} */ - -static int php_stream_open_for_zend(const char *filename, zend_file_handle *handle TSRMLS_DC) /* {{{ */ -{ - return php_stream_open_for_zend_ex(filename, handle, ENFORCE_SAFE_MODE|USE_PATH|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC); -} -/* }}} */ - -PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *handle, int mode TSRMLS_DC) /* {{{ */ -{ - php_stream *stream; - - stream = php_stream_open_wrapper((char *)filename, "rb", mode, &handle->opened_path); - - if (stream) { - handle->type = ZEND_HANDLE_STREAM; - handle->filename = (char*)filename; - handle->free_filename = 0; - handle->handle.stream.handle = stream; - handle->handle.stream.reader = (zend_stream_reader_t)_php_stream_read; - handle->handle.stream.closer = stream_closer_for_zend; - handle->handle.stream.fteller = stream_fteller_for_zend; - handle->handle.stream.interactive = 0; - /* suppress warning if this stream is not explicitly closed */ - php_stream_auto_cleanup(stream); - - return SUCCESS; - } - return FAILURE; -} -/* }}} */ - -/* {{{ php_get_configuration_directive_for_zend - */ -static int php_get_configuration_directive_for_zend(char *name, uint name_length, zval *contents) -{ - zval *retval = cfg_get_entry(name, name_length); - - if (retval) { - *contents = *retval; - return SUCCESS; - } else { - return FAILURE; - } -} -/* }}} */ - -/* {{{ php_message_handler_for_zend - */ -static void php_message_handler_for_zend(long message, void *data) -{ - TSRMLS_FETCH(); - - switch (message) { - case ZMSG_FAILED_INCLUDE_FOPEN: - php_error_docref("function.include" TSRMLS_CC, E_WARNING, "Failed opening '%s' for inclusion (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); - break; - case ZMSG_FAILED_REQUIRE_FOPEN: - php_error_docref("function.require" TSRMLS_CC, E_COMPILE_ERROR, "Failed opening required '%s' (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); - break; - case ZMSG_FAILED_HIGHLIGHT_FOPEN: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed opening '%s' for highlighting", php_strip_url_passwd((char *) data)); - break; - case ZMSG_MEMORY_LEAK_DETECTED: - case ZMSG_MEMORY_LEAK_REPEATED: -#if ZEND_DEBUG - if (EG(error_reporting) & E_WARNING) { - char memory_leak_buf[1024]; - - if (message==ZMSG_MEMORY_LEAK_DETECTED) { - zend_leak_info *t = (zend_leak_info *) data; - - snprintf(memory_leak_buf, 512, "%s(%d) : Freeing 0x%.8lX (%zu bytes), script=%s\n", t->filename, t->lineno, (zend_uintptr_t)t->addr, t->size, SAFE_FILENAME(SG(request_info).path_translated)); - if (t->orig_filename) { - char relay_buf[512]; - - snprintf(relay_buf, 512, "%s(%d) : Actual location (location was relayed)\n", t->orig_filename, t->orig_lineno); - strlcat(memory_leak_buf, relay_buf, sizeof(memory_leak_buf)); - } - } else { - unsigned long leak_count = (zend_uintptr_t) data; - - snprintf(memory_leak_buf, 512, "Last leak repeated %ld time%s\n", leak_count, (leak_count>1?"s":"")); - } -# if defined(PHP_WIN32) - OutputDebugString(memory_leak_buf); -# else - fprintf(stderr, "%s", memory_leak_buf); -# endif - } -#endif - break; - case ZMSG_MEMORY_LEAKS_GRAND_TOTAL: -#if ZEND_DEBUG - if (EG(error_reporting) & E_WARNING) { - char memory_leak_buf[512]; - - snprintf(memory_leak_buf, 512, "=== Total %d memory leaks detected ===\n", *((zend_uint *) data)); -# if defined(PHP_WIN32) - OutputDebugString(memory_leak_buf); -# else - fprintf(stderr, "%s", memory_leak_buf); -# endif - } -#endif - break; - case ZMSG_LOG_SCRIPT_NAME: { - struct tm *ta, tmbuf; - time_t curtime; - char *datetime_str, asctimebuf[52]; - char memory_leak_buf[4096]; - - time(&curtime); - ta = php_localtime_r(&curtime, &tmbuf); - datetime_str = php_asctime_r(ta, asctimebuf); - if (datetime_str) { - datetime_str[strlen(datetime_str)-1]=0; /* get rid of the trailing newline */ - snprintf(memory_leak_buf, sizeof(memory_leak_buf), "[%s] Script: '%s'\n", datetime_str, SAFE_FILENAME(SG(request_info).path_translated)); - } else { - snprintf(memory_leak_buf, sizeof(memory_leak_buf), "[null] Script: '%s'\n", SAFE_FILENAME(SG(request_info).path_translated)); - } -# if defined(PHP_WIN32) - OutputDebugString(memory_leak_buf); -# else - fprintf(stderr, "%s", memory_leak_buf); -# endif - } - break; - } -} -/* }}} */ - - -void php_on_timeout(int seconds TSRMLS_DC) -{ - PG(connection_status) |= PHP_CONNECTION_TIMEOUT; - zend_set_timeout(EG(timeout_seconds)); -} - -#if PHP_SIGCHILD -/* {{{ sigchld_handler - */ -static void sigchld_handler(int apar) -{ - while (waitpid(-1, NULL, WNOHANG) > 0); - signal(SIGCHLD, sigchld_handler); -} -/* }}} */ -#endif - -/* {{{ php_start_sapi() - */ -static int php_start_sapi(TSRMLS_D) -{ - int retval = SUCCESS; - - if(!SG(sapi_started)) { - zend_try { - PG(during_request_startup) = 1; - - /* initialize global variables */ - PG(modules_activated) = 0; - PG(header_is_being_sent) = 0; - PG(connection_status) = PHP_CONNECTION_NORMAL; - - zend_activate(TSRMLS_C); - zend_set_timeout(EG(timeout_seconds)); - zend_activate_modules(TSRMLS_C); - PG(modules_activated)=1; - } zend_catch { - retval = FAILURE; - } zend_end_try(); - - SG(sapi_started) = 1; - } - return retval; -} - -/* }}} */ - -/* {{{ php_request_startup - */ -#ifndef APACHE_HOOKS -int php_request_startup(TSRMLS_D) -{ - int retval = SUCCESS; - -#ifdef PHP_WIN32 - PG(com_initialized) = 0; -#endif - -#if PHP_SIGCHILD - signal(SIGCHLD, sigchld_handler); -#endif - - zend_try { - PG(during_request_startup) = 1; - - php_output_activate(TSRMLS_C); - - /* initialize global variables */ - PG(modules_activated) = 0; - PG(header_is_being_sent) = 0; - PG(connection_status) = PHP_CONNECTION_NORMAL; - PG(in_user_include) = 0; - - zend_activate(TSRMLS_C); - sapi_activate(TSRMLS_C); - - if (PG(max_input_time) == -1) { - zend_set_timeout(EG(timeout_seconds)); - } else { - zend_set_timeout(PG(max_input_time)); - } - - /* Disable realpath cache if safe_mode or open_basedir are set */ - if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { - CWDG(realpath_cache_size_limit) = 0; - } - - if (PG(expose_php)) { - sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); - } - - if (PG(output_handler) && PG(output_handler)[0]) { - php_start_ob_buffer_named(PG(output_handler), 0, 1 TSRMLS_CC); - } else if (PG(output_buffering)) { - if (PG(output_buffering)>1) { - php_start_ob_buffer(NULL, PG(output_buffering), 1 TSRMLS_CC); - } else { - php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC); - } - } else if (PG(implicit_flush)) { - php_start_implicit_flush(TSRMLS_C); - } - - /* We turn this off in php_execute_script() */ - /* PG(during_request_startup) = 0; */ - - php_hash_environment(TSRMLS_C); - zend_activate_modules(TSRMLS_C); - PG(modules_activated)=1; - } zend_catch { - retval = FAILURE; - } zend_end_try(); - - SG(sapi_started) = 1; - - return retval; -} -# else -int php_request_startup(TSRMLS_D) -{ - int retval = SUCCESS; - -#if PHP_SIGCHILD - signal(SIGCHLD, sigchld_handler); -#endif - - if (php_start_sapi() == FAILURE) { - return FAILURE; - } - - php_output_activate(TSRMLS_C); - sapi_activate(TSRMLS_C); - php_hash_environment(TSRMLS_C); - - zend_try { - PG(during_request_startup) = 1; - php_output_activate(TSRMLS_C); - if (PG(expose_php)) { - sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); - } - } zend_catch { - retval = FAILURE; - } zend_end_try(); - - return retval; -} -# endif -/* }}} */ - -/* {{{ php_request_startup_for_hook - */ -int php_request_startup_for_hook(TSRMLS_D) -{ - int retval = SUCCESS; - -#if PHP_SIGCHLD - signal(SIGCHLD, sigchld_handler); -#endif - - if (php_start_sapi(TSRMLS_C) == FAILURE) { - return FAILURE; - } - - php_output_activate(TSRMLS_C); - sapi_activate_headers_only(TSRMLS_C); - php_hash_environment(TSRMLS_C); - - return retval; -} -/* }}} */ - -/* {{{ php_request_shutdown_for_exec - */ -void php_request_shutdown_for_exec(void *dummy) -{ - TSRMLS_FETCH(); - - /* used to close fd's in the 3..255 range here, but it's problematic - */ - shutdown_memory_manager(1, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_request_shutdown_for_hook - */ -void php_request_shutdown_for_hook(void *dummy) -{ - TSRMLS_FETCH(); - - if (PG(modules_activated)) zend_try { - php_call_shutdown_functions(TSRMLS_C); - } zend_end_try(); - - if (PG(modules_activated)) { - zend_deactivate_modules(TSRMLS_C); - php_free_shutdown_functions(TSRMLS_C); - } - - zend_try { - int i; - - for (i = 0; i < NUM_TRACK_VARS; i++) { - if (PG(http_globals)[i]) { - zval_ptr_dtor(&PG(http_globals)[i]); - } - } - } zend_end_try(); - - zend_deactivate(TSRMLS_C); - - zend_try { - sapi_deactivate(TSRMLS_C); - } zend_end_try(); - - zend_try { - php_shutdown_stream_hashes(TSRMLS_C); - } zend_end_try(); - - zend_try { - shutdown_memory_manager(CG(unclean_shutdown), 0 TSRMLS_CC); - } zend_end_try(); - - zend_try { - zend_unset_timeout(TSRMLS_C); - } zend_end_try(); -} - -/* }}} */ - -/* {{{ php_request_shutdown - */ -void php_request_shutdown(void *dummy) -{ - zend_bool report_memleaks; - TSRMLS_FETCH(); - - report_memleaks = PG(report_memleaks); - - /* EG(opline_ptr) points into nirvana and therefore cannot be safely accessed - * inside zend_executor callback functions. - */ - EG(opline_ptr) = NULL; - EG(active_op_array) = NULL; - - php_deactivate_ticks(TSRMLS_C); - - /* 1. Call all possible shutdown functions registered with register_shutdown_function() */ - if (PG(modules_activated)) zend_try { - php_call_shutdown_functions(TSRMLS_C); - } zend_end_try(); - - /* 2. Call all possible __destruct() functions */ - zend_try { - zend_call_destructors(TSRMLS_C); - } zend_end_try(); - - /* 3. Flush all output buffers */ - zend_try { - php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC); - } zend_end_try(); - - /* 4. Send the set HTTP headers (note: This must be done AFTER php_end_ob_buffers() !!) */ - zend_try { - sapi_send_headers(TSRMLS_C); - } zend_end_try(); - - /* 5. Call all extensions RSHUTDOWN functions */ - if (PG(modules_activated)) { - zend_deactivate_modules(TSRMLS_C); - php_free_shutdown_functions(TSRMLS_C); - } - - /* 6. Destroy super-globals */ - zend_try { - int i; - - for (i=0; ilast_error_message) { - free(core_globals->last_error_message); - } - if (core_globals->last_error_file) { - free(core_globals->last_error_file); - } - if (core_globals->disable_functions) { - free(core_globals->disable_functions); - } - if (core_globals->disable_classes) { - free(core_globals->disable_classes); - } -} -/* }}} */ - -/* {{{ php_register_extensions - */ -int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC) -{ - zend_module_entry **end = ptr + count; - - while (ptr < end) { - if (*ptr) { - if (zend_register_internal_module(*ptr TSRMLS_CC)==NULL) { - return FAILURE; - } - } - ptr++; - } - return SUCCESS; -} -/* }}} */ - -#if defined(PHP_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1400) -static _invalid_parameter_handler old_invalid_parameter_handler; - -void dummy_invalid_parameter_handler( - const wchar_t *expression, - const wchar_t *function, - const wchar_t *file, - unsigned int line, - uintptr_t pEwserved) -{ - static int called = 0; - char buf[1024]; - int len; - - if (!called) { - called = 1; - if (function) { - if (file) { - len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws' (%ws:%d)", function, file, line); - } else { - len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws'", function); - } - } else { - len = _snprintf(buf, sizeof(buf)-1, "Invalid CRT parameters detected"); - } - zend_error(E_WARNING, "%s", buf); - called = 0; - } -} -#endif - -/* {{{ php_module_startup - */ -int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules) -{ - zend_utility_functions zuf; - zend_utility_values zuv; - int module_number=0; /* for REGISTER_INI_ENTRIES() */ - char *php_os; -#ifdef ZTS - zend_executor_globals *executor_globals; - void ***tsrm_ls; - - php_core_globals *core_globals; -#endif -#if defined(PHP_WIN32) || (defined(NETWARE) && defined(USE_WINSOCK)) - WORD wVersionRequested = MAKEWORD(2, 0); - WSADATA wsaData; -#endif -#ifdef PHP_WIN32 - { - DWORD dwVersion = GetVersion(); - - /* Get build numbers for Windows NT or Win95 */ - if (dwVersion < 0x80000000){ - php_os="WINNT"; - } else { - php_os="WIN32"; - } - } -#if defined(_MSC_VER) && (_MSC_VER >= 1400) - old_invalid_parameter_handler = - _set_invalid_parameter_handler(dummy_invalid_parameter_handler); - if (old_invalid_parameter_handler != NULL) { - _set_invalid_parameter_handler(old_invalid_parameter_handler); - } -#endif -#else - php_os=PHP_OS; -#endif - -#ifdef ZTS - tsrm_ls = ts_resource(0); -#endif - - module_shutdown = 0; - module_startup = 1; - sapi_initialize_empty_request(TSRMLS_C); - sapi_activate(TSRMLS_C); - - if (module_initialized) { - return SUCCESS; - } - - sapi_module = *sf; - - php_output_startup(); - - zuf.error_function = php_error_cb; - zuf.printf_function = php_printf; - zuf.write_function = php_body_write_wrapper; - zuf.fopen_function = php_fopen_wrapper_for_zend; - zuf.message_handler = php_message_handler_for_zend; - zuf.block_interruptions = sapi_module.block_interruptions; - zuf.unblock_interruptions = sapi_module.unblock_interruptions; - zuf.get_configuration_directive = php_get_configuration_directive_for_zend; - zuf.ticks_function = php_run_ticks; - zuf.on_timeout = php_on_timeout; - zuf.stream_open_function = php_stream_open_for_zend; - zuf.vspprintf_function = vspprintf; - zuf.getenv_function = sapi_getenv; - zend_startup(&zuf, NULL, 1); - -#ifdef ZTS - executor_globals = ts_resource(executor_globals_id); - ts_allocate_id(&core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, (ts_allocate_dtor) core_globals_dtor); - core_globals = ts_resource(core_globals_id); -#ifdef PHP_WIN32 - ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, (ts_allocate_dtor) php_win32_core_globals_dtor); -#endif -#endif - EG(bailout) = NULL; - EG(error_reporting) = E_ALL & ~E_NOTICE; - - PG(header_is_being_sent) = 0; - SG(request_info).headers_only = 0; - SG(request_info).argv0 = NULL; - SG(request_info).argc=0; - SG(request_info).argv=(char **)NULL; - PG(connection_status) = PHP_CONNECTION_NORMAL; - PG(during_request_startup) = 0; - PG(last_error_message) = NULL; - PG(last_error_file) = NULL; - PG(last_error_lineno) = 0; - PG(error_handling) = EH_NORMAL; - PG(disable_functions) = NULL; - PG(disable_classes) = NULL; - -#if HAVE_SETLOCALE - setlocale(LC_CTYPE, ""); - zend_update_current_locale(); -#endif - -#if HAVE_TZSET - tzset(); -#endif - -#if defined(PHP_WIN32) || (defined(NETWARE) && defined(USE_WINSOCK)) - /* start up winsock services */ - if (WSAStartup(wVersionRequested, &wsaData) != 0) { - php_printf("\nwinsock.dll unusable. %d\n", WSAGetLastError()); - return FAILURE; - } -#endif - - le_index_ptr = zend_register_list_destructors_ex(NULL, NULL, "index pointer", 0); - - /* this will read in php.ini, set up the configuration parameters, - load zend extensions and register php function extensions - to be loaded later */ - if (php_init_config(TSRMLS_C) == FAILURE) { - return FAILURE; - } - - /* Register PHP core ini entries */ - REGISTER_INI_ENTRIES(); - - /* Register Zend ini entries */ - zend_register_standard_ini_entries(TSRMLS_C); - - /* Disable realpath cache if safe_mode or open_basedir are set */ - if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { - CWDG(realpath_cache_size_limit) = 0; - } - - /* initialize stream wrappers registry - * (this uses configuration parameters from php.ini) - */ - if (php_init_stream_wrappers(module_number TSRMLS_CC) == FAILURE) { - php_printf("PHP: Unable to initialize stream url wrappers.\n"); - return FAILURE; - } - - /* initialize registry for images to be used in phpinfo() - (this uses configuration parameters from php.ini) - */ - if (php_init_info_logos() == FAILURE) { - php_printf("PHP: Unable to initialize info phpinfo logos.\n"); - return FAILURE; - } - - zuv.html_errors = 1; - zuv.import_use_extension = ".php"; - php_startup_auto_globals(TSRMLS_C); - zend_set_utility_values(&zuv); - php_startup_sapi_content_types(TSRMLS_C); - - /* Register constants */ - REGISTER_MAIN_STRINGL_CONSTANT("PHP_VERSION", PHP_VERSION, sizeof(PHP_VERSION)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("PHP_MAJOR_VERSION", PHP_MAJOR_VERSION, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("PHP_MINOR_VERSION", PHP_MINOR_VERSION, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("PHP_RELEASE_VERSION", PHP_RELEASE_VERSION, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_EXTRA_VERSION", PHP_EXTRA_VERSION, sizeof(PHP_EXTRA_VERSION) - 1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("PHP_VERSION_ID", PHP_VERSION_ID, CONST_PERSISTENT | CONST_CS); -#ifdef ZTS - REGISTER_MAIN_LONG_CONSTANT("PHP_ZTS", 1, CONST_PERSISTENT | CONST_CS); -#else - REGISTER_MAIN_LONG_CONSTANT("PHP_ZTS", 0, CONST_PERSISTENT | CONST_CS); -#endif - REGISTER_MAIN_LONG_CONSTANT("PHP_DEBUG", PHP_DEBUG, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_OS", php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_SAPI", sapi_module.name, strlen(sapi_module.name), CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("DEFAULT_INCLUDE_PATH", PHP_INCLUDE_PATH, sizeof(PHP_INCLUDE_PATH)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PEAR_INSTALL_DIR", PEAR_INSTALLDIR, sizeof(PEAR_INSTALLDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PEAR_EXTENSION_DIR", PHP_EXTENSION_DIR, sizeof(PHP_EXTENSION_DIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_EXTENSION_DIR", PHP_EXTENSION_DIR, sizeof(PHP_EXTENSION_DIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_PREFIX", PHP_PREFIX, sizeof(PHP_PREFIX)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_BINDIR", PHP_BINDIR, sizeof(PHP_BINDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_LIBDIR", PHP_LIBDIR, sizeof(PHP_LIBDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_DATADIR", PHP_DATADIR, sizeof(PHP_DATADIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_SYSCONFDIR", PHP_SYSCONFDIR, sizeof(PHP_SYSCONFDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_LOCALSTATEDIR", PHP_LOCALSTATEDIR, sizeof(PHP_LOCALSTATEDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_PATH", PHP_CONFIG_FILE_PATH, strlen(PHP_CONFIG_FILE_PATH), CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_SHLIB_SUFFIX", PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("PHP_INT_MAX", LONG_MAX, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("PHP_INT_SIZE", sizeof(long), CONST_PERSISTENT | CONST_CS); - php_output_register_constants(TSRMLS_C); - php_rfc1867_register_constants(TSRMLS_C); - - if (php_startup_ticks(TSRMLS_C) == FAILURE) { - php_printf("Unable to start PHP ticks\n"); - return FAILURE; - } - - /* Register internal Zend classes */ - zend_register_default_classes(TSRMLS_C); - - /* startup extensions staticly compiled in */ - if (php_register_internal_extensions(TSRMLS_C) == FAILURE) { - php_printf("Unable to start builtin modules\n"); - return FAILURE; - } - - /* start additional PHP extensions */ - php_register_extensions(&additional_modules, num_additional_modules TSRMLS_CC); - - /* load and startup extensions compiled as shared objects (aka DLLs) - as requested by php.ini entries - theese are loaded after initialization of internal extensions - as extensions *might* rely on things from ext/standard - which is always an internal extension and to be initialized - ahead of all other internals - */ - php_ini_register_extensions(TSRMLS_C); - zend_startup_modules(TSRMLS_C); - - /* disable certain classes and functions as requested by php.ini */ - php_disable_functions(TSRMLS_C); - php_disable_classes(TSRMLS_C); - - /* start Zend extensions */ - zend_startup_extensions(); - -#ifdef ZTS - zend_post_startup(TSRMLS_C); -#endif - - module_initialized = 1; - sapi_deactivate(TSRMLS_C); - module_startup = 0; - - shutdown_memory_manager(1, 0 TSRMLS_CC); - - /* we're done */ - return SUCCESS; -} -/* }}} */ - -void php_module_shutdown_for_exec(void) -{ - /* used to close fd's in the range 3.255 here, but it's problematic */ -} - -/* {{{ php_module_shutdown_wrapper - */ -int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals) -{ - TSRMLS_FETCH(); - php_module_shutdown(TSRMLS_C); - return SUCCESS; -} -/* }}} */ - -/* {{{ php_module_shutdown - */ -void php_module_shutdown(TSRMLS_D) -{ - int module_number=0; /* for UNREGISTER_INI_ENTRIES() */ - - module_shutdown = 1; - - if (!module_initialized) { - return; - } - -#ifdef ZTS - ts_free_worker_threads(); -#endif - -#if defined(PHP_WIN32) || (defined(NETWARE) && defined(USE_WINSOCK)) - /*close winsock */ - WSACleanup(); -#endif - - php_shutdown_ticks(TSRMLS_C); - sapi_flush(TSRMLS_C); - - zend_shutdown(TSRMLS_C); - - /* Destroys filter & transport registries too */ - php_shutdown_stream_wrappers(module_number TSRMLS_CC); - - php_shutdown_info_logos(); - UNREGISTER_INI_ENTRIES(); - - /* close down the ini config */ - php_shutdown_config(); - -#ifndef ZTS - zend_ini_shutdown(TSRMLS_C); - shutdown_memory_manager(CG(unclean_shutdown), 1 TSRMLS_CC); - core_globals_dtor(&core_globals TSRMLS_CC); -#else - zend_ini_global_shutdown(TSRMLS_C); - ts_free_id(core_globals_id); -#endif - - php_shutdown_temporary_directory(); - - module_initialized = 0; - -#if defined(PHP_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1400) - if (old_invalid_parameter_handler == NULL) { - _set_invalid_parameter_handler(old_invalid_parameter_handler); - } -#endif -} -/* }}} */ - -/* {{{ php_execute_script - */ -PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC) -{ - zend_file_handle *prepend_file_p, *append_file_p; - zend_file_handle prepend_file = {0}, append_file = {0}; -#if HAVE_BROKEN_GETCWD - int old_cwd_fd = -1; -#else - char *old_cwd; -#endif - int retval = 0; - - EG(exit_status) = 0; - if (php_handle_special_queries(TSRMLS_C)) { - zend_file_handle_dtor(primary_file); - return 0; - } -#ifndef HAVE_BROKEN_GETCWD -# define OLD_CWD_SIZE 4096 - old_cwd = do_alloca(OLD_CWD_SIZE); - old_cwd[0] = '\0'; -#endif - - zend_try { - char realfile[MAXPATHLEN]; - -#ifdef PHP_WIN32 - UpdateIniFromRegistry(primary_file->filename TSRMLS_CC); -#endif - - PG(during_request_startup) = 0; - - if ((primary_file->type == ZEND_HANDLE_FILENAME || primary_file->type == ZEND_HANDLE_STREAM) && primary_file->filename) { -#if HAVE_BROKEN_GETCWD - /* this looks nasty to me */ - old_cwd_fd = open(".", 0); -#else - VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1); -#endif - VCWD_CHDIR_FILE(primary_file->filename); - } - - /* Only lookup the real file path and add it to the included_files list if already opened - * otherwise it will get opened and added to the included_files list in zend_execute_scripts - */ - if (primary_file->filename && - primary_file->opened_path == NULL && - primary_file->type != ZEND_HANDLE_FILENAME - ) { - int realfile_len; - int dummy = 1; - - if (expand_filepath(primary_file->filename, realfile TSRMLS_CC)) { - realfile_len = strlen(realfile); - zend_hash_add(&EG(included_files), realfile, realfile_len+1, (void *)&dummy, sizeof(int), NULL); - primary_file->opened_path = estrndup(realfile, realfile_len); - } - } - - if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) { - prepend_file.filename = PG(auto_prepend_file); - prepend_file.opened_path = NULL; - prepend_file.free_filename = 0; - prepend_file.type = ZEND_HANDLE_FILENAME; - prepend_file_p = &prepend_file; - } else { - prepend_file_p = NULL; - } - - if (PG(auto_append_file) && PG(auto_append_file)[0]) { - append_file.filename = PG(auto_append_file); - append_file.opened_path = NULL; - append_file.free_filename = 0; - append_file.type = ZEND_HANDLE_FILENAME; - append_file_p = &append_file; - } else { - append_file_p = NULL; - } - if (PG(max_input_time) != -1) { -#ifdef PHP_WIN32 - zend_unset_timeout(TSRMLS_C); -#endif - zend_set_timeout(INI_INT("max_execution_time")); - } - retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS); - - } zend_end_try(); - -#if HAVE_BROKEN_GETCWD - if (old_cwd_fd != -1) { - fchdir(old_cwd_fd); - close(old_cwd_fd); - } -#else - if (old_cwd[0] != '\0') { - VCWD_CHDIR(old_cwd); - } - free_alloca(old_cwd); -#endif - return retval; -} -/* }}} */ - -/* {{{ php_execute_simple_script - */ -PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret TSRMLS_DC) -{ - char *old_cwd; - - EG(exit_status) = 0; -#define OLD_CWD_SIZE 4096 - old_cwd = do_alloca(OLD_CWD_SIZE); - old_cwd[0] = '\0'; - - zend_try { -#ifdef PHP_WIN32 - UpdateIniFromRegistry(primary_file->filename TSRMLS_CC); -#endif - - PG(during_request_startup) = 0; - - if (primary_file->type == ZEND_HANDLE_FILENAME && primary_file->filename) { - VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1); - VCWD_CHDIR_FILE(primary_file->filename); - } - zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, ret, 1, primary_file); - } zend_end_try(); - - if (old_cwd[0] != '\0') { - VCWD_CHDIR(old_cwd); - } - - free_alloca(old_cwd); - return EG(exit_status); -} -/* }}} */ - -/* {{{ php_handle_aborted_connection - */ -PHPAPI void php_handle_aborted_connection(void) -{ - TSRMLS_FETCH(); - - PG(connection_status) = PHP_CONNECTION_ABORTED; - php_output_set_status(0 TSRMLS_CC); - - if (!PG(ignore_user_abort)) { - zend_bailout(); - } -} -/* }}} */ - -/* {{{ php_handle_auth_data - */ -PHPAPI int php_handle_auth_data(const char *auth TSRMLS_DC) -{ - int ret = -1; - - if (auth && auth[0] != '\0' && strncmp(auth, "Basic ", 6) == 0) { - char *pass; - char *user; - - user = php_base64_decode(auth + 6, strlen(auth) - 6, NULL); - if (user) { - pass = strchr(user, ':'); - if (pass) { - *pass++ = '\0'; - SG(request_info).auth_user = user; - SG(request_info).auth_password = estrdup(pass); - ret = 0; - } else { - efree(user); - } - } - } - - if (ret == -1) { - SG(request_info).auth_user = SG(request_info).auth_password = NULL; - } else { - SG(request_info).auth_digest = NULL; - } - - if (ret == -1 && auth && auth[0] != '\0' && strncmp(auth, "Digest ", 7) == 0) { - SG(request_info).auth_digest = estrdup(auth + 7); - ret = 0; - } - - if (ret == -1) { - SG(request_info).auth_digest = NULL; - } - - return ret; -} -/* }}} */ - -/* {{{ php_lint_script - */ -PHPAPI int php_lint_script(zend_file_handle *file TSRMLS_DC) -{ - zend_op_array *op_array; - int retval = FAILURE; - - zend_try { - op_array = zend_compile_file(file, ZEND_INCLUDE TSRMLS_CC); - zend_destroy_file_handle(file TSRMLS_CC); - - if (op_array) { - destroy_op_array(op_array TSRMLS_CC); - efree(op_array); - retval = SUCCESS; - } - } zend_end_try(); - - return retval; -} -/* }}} */ - -#ifdef PHP_WIN32 -/* {{{ dummy_indent - just so that this symbol gets exported... */ -PHPAPI void dummy_indent(void) -{ - zend_indent(); -} -/* }}} */ -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/mergesort.c b/main/mergesort.c deleted file mode 100644 index 8ddd8644df627..0000000000000 --- a/main/mergesort.c +++ /dev/null @@ -1,358 +0,0 @@ -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Peter McIlroy. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* $Id$ */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94"; -#endif /* LIBC_SCCS and not lint */ - -/* - * Hybrid exponential search/linear search merge sort with hybrid - * natural/pairwise first pass. Requires about .3% more comparisons - * for random data than LSMS with pairwise first pass alone. - * It works for objects as small as two bytes. - */ - -#define NATURAL -#define THRESHOLD 16 /* Best choice for natural merge cut-off. */ - -/* #define NATURAL to get hybrid natural merge. - * (The default is pairwise merging.) - */ - -#include - -#include -#include -#include - -#include "php.h" - -#ifdef PHP_WIN32 -#include /* Includes definition for u_char */ -#endif - -static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC); -static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC); - -#define ISIZE sizeof(int) -#define PSIZE sizeof(u_char *) -#define ICOPY_LIST(src, dst, last) \ - do \ - *(int*)dst = *(int*)src, src += ISIZE, dst += ISIZE; \ - while(src < last) -#define ICOPY_ELT(src, dst, i) \ - do \ - *(int*) dst = *(int*) src, src += ISIZE, dst += ISIZE; \ - while (i -= ISIZE) - -#define CCOPY_LIST(src, dst, last) \ - do \ - *dst++ = *src++; \ - while (src < last) -#define CCOPY_ELT(src, dst, i) \ - do \ - *dst++ = *src++; \ - while (i -= 1) - -/* - * Find the next possible pointer head. (Trickery for forcing an array - * to do double duty as a linked list when objects do not align with word - * boundaries. - */ -/* Assumption: PSIZE is a power of 2. */ -#define EVAL(p) (u_char **) \ - ((u_char *)0 + \ - (((u_char *)p + PSIZE - 1 - (u_char *) 0) & ~(PSIZE - 1))) - -/* {{{ php_mergesort - * Arguments are as for qsort. - */ -int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC) -{ - register unsigned int i; - register int sense; - int big, iflag; - register u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2; - u_char *list2, *list1, *p2, *p, *last, **p1; - - if (size < PSIZE / 2) { /* Pointers must fit into 2 * size. */ - errno = EINVAL; - return (-1); - } - - if (nmemb == 0) - return (0); - - /* - * XXX - * Stupid subtraction for the Cray. - */ - iflag = 0; - if (!(size % ISIZE) && !(((char *)base - (char *)0) % ISIZE)) - iflag = 1; - - if ((list2 = malloc(nmemb * size + PSIZE)) == NULL) - return (-1); - - list1 = base; - setup(list1, list2, nmemb, size, cmp TSRMLS_CC); - last = list2 + nmemb * size; - i = big = 0; - while (*EVAL(list2) != last) { - l2 = list1; - p1 = EVAL(list1); - for (tp2 = p2 = list2; p2 != last; p1 = EVAL(l2)) { - p2 = *EVAL(p2); - f1 = l2; - f2 = l1 = list1 + (p2 - list2); - if (p2 != last) - p2 = *EVAL(p2); - l2 = list1 + (p2 - list2); - while (f1 < l1 && f2 < l2) { - if ((*cmp)(f1, f2 TSRMLS_CC) <= 0) { - q = f2; - b = f1, t = l1; - sense = -1; - } else { - q = f1; - b = f2, t = l2; - sense = 0; - } - if (!big) { /* here i = 0 */ - while ((b += size) < t && cmp(q, b TSRMLS_CC) >sense) - if (++i == 6) { - big = 1; - goto EXPONENTIAL; - } - } else { -EXPONENTIAL: for (i = size; ; i <<= 1) - if ((p = (b + i)) >= t) { - if ((p = t - size) > b && - (*cmp)(q, p TSRMLS_CC) <= sense) - t = p; - else - b = p; - break; - } else if ((*cmp)(q, p TSRMLS_CC) <= sense) { - t = p; - if (i == size) - big = 0; - goto FASTCASE; - } else - b = p; - while (t > b+size) { - i = (((t - b) / size) >> 1) * size; - if ((*cmp)(q, p = b + i TSRMLS_CC) <= sense) - t = p; - else - b = p; - } - goto COPY; -FASTCASE: while (i > size) - if ((*cmp)(q, - p = b + (i >>= 1) TSRMLS_CC) <= sense) - t = p; - else - b = p; -COPY: b = t; - } - i = size; - if (q == f1) { - if (iflag) { - ICOPY_LIST(f2, tp2, b); - ICOPY_ELT(f1, tp2, i); - } else { - CCOPY_LIST(f2, tp2, b); - CCOPY_ELT(f1, tp2, i); - } - } else { - if (iflag) { - ICOPY_LIST(f1, tp2, b); - ICOPY_ELT(f2, tp2, i); - } else { - CCOPY_LIST(f1, tp2, b); - CCOPY_ELT(f2, tp2, i); - } - } - } - if (f2 < l2) { - if (iflag) - ICOPY_LIST(f2, tp2, l2); - else - CCOPY_LIST(f2, tp2, l2); - } else if (f1 < l1) { - if (iflag) - ICOPY_LIST(f1, tp2, l1); - else - CCOPY_LIST(f1, tp2, l1); - } - *p1 = l2; - } - tp2 = list1; /* swap list1, list2 */ - list1 = list2; - list2 = tp2; - last = list2 + nmemb*size; - } - if (base == list2) { - memmove(list2, list1, nmemb*size); - list2 = list1; - } - free(list2); - return (0); -} -/* }}} */ - -#define swap(a, b) { \ - s = b; \ - i = size; \ - do { \ - tmp = *a; *a++ = *s; *s++ = tmp; \ - } while (--i); \ - a -= size; \ - } -#define reverse(bot, top) { \ - s = top; \ - do { \ - i = size; \ - do { \ - tmp = *bot; *bot++ = *s; *s++ = tmp; \ - } while (--i); \ - s -= size2; \ - } while(bot < s); \ -} - -/* {{{ setup - * Optional hybrid natural/pairwise first pass. Eats up list1 in runs of - * increasing order, list2 in a corresponding linked list. Checks for runs - * when THRESHOLD/2 pairs compare with same sense. (Only used when NATURAL - * is defined. Otherwise simple pairwise merging is used.) - */ -static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC) -{ - int i, length, size2, tmp, sense; - u_char *f1, *f2, *s, *l2, *last, *p2; - - size2 = size*2; - if (n <= 5) { - insertionsort(list1, n, size, cmp TSRMLS_CC); - *EVAL(list2) = (u_char*) list2 + n*size; - return; - } - /* - * Avoid running pointers out of bounds; limit n to evens - * for simplicity. - */ - i = 4 + (n & 1); - insertionsort(list1 + (n - i) * size, i, size, cmp TSRMLS_CC); - last = list1 + size * (n - i); - *EVAL(list2 + (last - list1)) = list2 + n * size; - -#ifdef NATURAL - p2 = list2; - f1 = list1; - sense = (cmp(f1, f1 + size TSRMLS_CC) > 0); - for (; f1 < last; sense = !sense) { - length = 2; - /* Find pairs with same sense. */ - for (f2 = f1 + size2; f2 < last; f2 += size2) { - if ((cmp(f2, f2+ size TSRMLS_CC) > 0) != sense) - break; - length += 2; - } - if (length < THRESHOLD) { /* Pairwise merge */ - do { - p2 = *EVAL(p2) = f1 + size2 - list1 + list2; - if (sense > 0) - swap (f1, f1 + size); - } while ((f1 += size2) < f2); - } else { /* Natural merge */ - l2 = f2; - for (f2 = f1 + size2; f2 < l2; f2 += size2) { - if ((cmp(f2-size, f2 TSRMLS_CC) > 0) != sense) { - p2 = *EVAL(p2) = f2 - list1 + list2; - if (sense > 0) - reverse(f1, f2-size); - f1 = f2; - } - } - if (sense > 0) - reverse (f1, f2-size); - f1 = f2; - if (f2 < last || cmp(f2 - size, f2 TSRMLS_CC) > 0) - p2 = *EVAL(p2) = f2 - list1 + list2; - else - p2 = *EVAL(p2) = list2 + n*size; - } - } -#else /* pairwise merge only. */ - for (f1 = list1, p2 = list2; f1 < last; f1 += size2) { - p2 = *EVAL(p2) = p2 + size2; - if (cmp (f1, f1 + size TSRMLS_CC) > 0) - swap(f1, f1 + size); - } -#endif /* NATURAL */ -} -/* }}} */ - -/* {{{ insertionsort - * This is to avoid out-of-bounds addresses in sorting the - * last 4 elements. - */ -static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC) -{ - u_char *ai, *s, *t, *u, tmp; - int i; - - for (ai = a+size; --n >= 1; ai += size) - for (t = ai; t > a; t -= size) { - u = t - size; - if (cmp(u, t TSRMLS_CC) <= 0) - break; - swap(u, t); - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/main/network.c b/main/network.c deleted file mode 100644 index 85dc6ad8eace6..0000000000000 --- a/main/network.c +++ /dev/null @@ -1,1175 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Stig Venaas | - | Streams work by Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/*#define DEBUG_MAIN_NETWORK 1*/ - -#include "php.h" - -#include - -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#elif defined(NETWARE) -#include -#include -#else -#include -#endif - -#include -#if HAVE_SYS_SOCKET_H -#include -#endif - -#ifndef _FCNTL_H -#include -#endif - -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#if HAVE_SYS_POLL_H -#include -#endif - -#if defined(NETWARE) -#ifdef USE_WINSOCK -#include -#else -#include -#include -#include -#include -#include -#endif -#elif !defined(PHP_WIN32) -#include -#include -#if HAVE_ARPA_INET_H -#include -#endif -#endif - -#ifndef HAVE_INET_ATON -int inet_aton(const char *, struct in_addr *); -#endif - -#include "php_network.h" - -#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) -#undef AF_UNIX -#endif - -#if defined(AF_UNIX) -#include -#endif - -#include "ext/standard/file.h" - -#ifdef PHP_WIN32 -# include "win32/time.h" -# define SOCK_ERR INVALID_SOCKET -# define SOCK_CONN_ERR SOCKET_ERROR -# define PHP_TIMEOUT_ERROR_VALUE WSAETIMEDOUT -#else -# define SOCK_ERR -1 -# define SOCK_CONN_ERR -1 -# define PHP_TIMEOUT_ERROR_VALUE ETIMEDOUT -#endif - -#if HAVE_GETADDRINFO -#ifdef HAVE_GAI_STRERROR -# define PHP_GAI_STRERROR(x) (gai_strerror(x)) -#else -# define PHP_GAI_STRERROR(x) (php_gai_strerror(x)) -/* {{{ php_gai_strerror - */ -static const char *php_gai_strerror(int code) -{ - static struct { - int code; - const char *msg; - } values[] = { -# ifdef EAI_ADDRFAMILY - {EAI_ADDRFAMILY, "Address family for hostname not supported"}, -# endif - {EAI_AGAIN, "Temporary failure in name resolution"}, - {EAI_BADFLAGS, "Bad value for ai_flags"}, - {EAI_FAIL, "Non-recoverable failure in name resolution"}, - {EAI_FAMILY, "ai_family not supported"}, - {EAI_MEMORY, "Memory allocation failure"}, -# ifdef EAI_NODATA - {EAI_NODATA, "No address associated with hostname"}, -# endif - {EAI_NONAME, "Name or service not known"}, - {EAI_SERVICE, "Servname not supported for ai_socktype"}, - {EAI_SOCKTYPE, "ai_socktype not supported"}, - {EAI_SYSTEM, "System error"}, - {0, NULL} - }; - int i; - - for (i = 0; values[i].msg != NULL; i++) { - if (values[i].code == code) { - return (char *)values[i].msg; - } - } - - return "Unknown error"; -} -/* }}} */ -#endif -#endif - -/* {{{ php_network_freeaddresses - */ -static void php_network_freeaddresses(struct sockaddr **sal) -{ - struct sockaddr **sap; - - if (sal == NULL) - return; - for (sap = sal; *sap != NULL; sap++) - efree(*sap); - efree(sal); -} -/* }}} */ - -/* {{{ php_network_getaddresses - * Returns number of addresses, 0 for none/error - */ -static int php_network_getaddresses(const char *host, int socktype, struct sockaddr ***sal, char **error_string TSRMLS_DC) -{ - struct sockaddr **sap; - int n; -#if HAVE_GETADDRINFO -# if HAVE_IPV6 - static int ipv6_borked = -1; /* the way this is used *is* thread safe */ -# endif - struct addrinfo hints, *res, *sai; -#else - struct hostent *host_info; - struct in_addr in; -#endif - - if (host == NULL) { - return 0; - } -#if HAVE_GETADDRINFO - memset(&hints, '\0', sizeof(hints)); - - hints.ai_family = AF_INET; /* default to regular inet (see below) */ - hints.ai_socktype = socktype; - -# if HAVE_IPV6 - /* probe for a working IPv6 stack; even if detected as having v6 at compile - * time, at runtime some stacks are slow to resolve or have other issues - * if they are not correctly configured. - * static variable use is safe here since simple store or fetch operations - * are atomic and because the actual probe process is not in danger of - * collisions or race conditions. */ - if (ipv6_borked == -1) { - int s; - - s = socket(PF_INET6, SOCK_DGRAM, 0); - if (s == SOCK_ERR) { - ipv6_borked = 1; - } else { - ipv6_borked = 0; - closesocket(s); - } - } - hints.ai_family = ipv6_borked ? AF_INET : AF_UNSPEC; -# endif - - if ((n = getaddrinfo(host, NULL, &hints, &res))) { - if (error_string) { - spprintf(error_string, 0, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n)); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", *error_string); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n)); - } - return 0; - } else if (res == NULL) { - if (error_string) { - spprintf(error_string, 0, "php_network_getaddresses: getaddrinfo failed (null result pointer) errno=%d", errno); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", *error_string); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed (null result pointer)"); - } - return 0; - } - - sai = res; - for (n = 1; (sai = sai->ai_next) != NULL; n++) - ; - - *sal = safe_emalloc((n + 1), sizeof(*sal), 0); - sai = res; - sap = *sal; - - do { - *sap = emalloc(sai->ai_addrlen); - memcpy(*sap, sai->ai_addr, sai->ai_addrlen); - sap++; - } while ((sai = sai->ai_next) != NULL); - - freeaddrinfo(res); -#else - if (!inet_aton(host, &in)) { - /* XXX NOT THREAD SAFE (is safe under win32) */ - host_info = gethostbyname(host); - if (host_info == NULL) { - if (error_string) { - spprintf(error_string, 0, "php_network_getaddresses: gethostbyname failed. errno=%d", errno); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", *error_string); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: gethostbyname failed"); - } - return 0; - } - in = *((struct in_addr *) host_info->h_addr); - } - - *sal = safe_emalloc(2, sizeof(*sal), 0); - sap = *sal; - *sap = emalloc(sizeof(struct sockaddr_in)); - (*sap)->sa_family = AF_INET; - ((struct sockaddr_in *)*sap)->sin_addr = in; - sap++; - n = 1; -#endif - - *sap = NULL; - return n; -} -/* }}} */ - -#ifndef O_NONBLOCK -#define O_NONBLOCK O_NDELAY -#endif - -#if !defined(__BEOS__) -# define HAVE_NON_BLOCKING_CONNECT 1 -# ifdef PHP_WIN32 -typedef u_long php_non_blocking_flags_t; -# define SET_SOCKET_BLOCKING_MODE(sock, save) \ - save = TRUE; ioctlsocket(sock, FIONBIO, &save) -# define RESTORE_SOCKET_BLOCKING_MODE(sock, save) \ - ioctlsocket(sock, FIONBIO, &save) -# else -typedef int php_non_blocking_flags_t; -# define SET_SOCKET_BLOCKING_MODE(sock, save) \ - save = fcntl(sock, F_GETFL, 0); \ - fcntl(sock, F_SETFL, save | O_NONBLOCK) -# define RESTORE_SOCKET_BLOCKING_MODE(sock, save) \ - fcntl(sock, F_SETFL, save) -# endif -#endif - -/* Connect to a socket using an interruptible connect with optional timeout. - * Optionally, the connect can be made asynchronously, which will implicitly - * enable non-blocking mode on the socket. - * */ -/* {{{ php_network_connect_socket */ -PHPAPI int php_network_connect_socket(php_socket_t sockfd, - const struct sockaddr *addr, - socklen_t addrlen, - int asynchronous, - struct timeval *timeout, - char **error_string, - int *error_code) -{ -#if HAVE_NON_BLOCKING_CONNECT - php_non_blocking_flags_t orig_flags; - int n; - int error = 0; - socklen_t len; - int ret = 0; - - SET_SOCKET_BLOCKING_MODE(sockfd, orig_flags); - - if ((n = connect(sockfd, addr, addrlen)) < 0) { - error = php_socket_errno(); - - if (error_code) { - *error_code = error; - } - - if (error != EINPROGRESS) { - if (error_string) { - *error_string = php_socket_strerror(error, NULL, 0); - } - - return -1; - } - if (asynchronous && error == EINPROGRESS) { - /* this is fine by us */ - return 0; - } - } - - if (n == 0) { - goto ok; - } - - if ((n = php_pollfd_for(sockfd, PHP_POLLREADABLE|POLLOUT, timeout)) == 0) { - error = PHP_TIMEOUT_ERROR_VALUE; - } - - if (n > 0) { - len = sizeof(error); - /* - BSD-derived systems set errno correctly - Solaris returns -1 from getsockopt in case of error - */ - if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (char*)&error, &len) < 0) { - ret = -1; - } - } else { - /* whoops: sockfd has disappeared */ - ret = -1; - } - -ok: - if (!asynchronous) { - /* back to blocking mode */ - RESTORE_SOCKET_BLOCKING_MODE(sockfd, orig_flags); - } - - if (error_code) { - *error_code = error; - } - - if (error && error_string) { - *error_string = php_socket_strerror(error, NULL, 0); - ret = -1; - } - return ret; -#else - if (asynchronous) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Asynchronous connect() not supported on this platform"); - } - return connect(sockfd, addr, addrlen); -#endif -} -/* }}} */ - -/* {{{ sub_times */ -static inline void sub_times(struct timeval a, struct timeval b, struct timeval *result) -{ - result->tv_usec = a.tv_usec - b.tv_usec; - if (result->tv_usec < 0L) { - a.tv_sec--; - result->tv_usec += 1000000L; - } - result->tv_sec = a.tv_sec - b.tv_sec; - if (result->tv_sec < 0L) { - result->tv_sec++; - result->tv_usec -= 1000000L; - } -} -/* }}} */ - -/* Bind to a local IP address. - * Returns the bound socket, or -1 on failure. - * */ -/* {{{ php_network_bind_socket_to_local_addr */ -php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned port, - int socktype, char **error_string, int *error_code - TSRMLS_DC) -{ - int num_addrs, n, err = 0; - php_socket_t sock; - struct sockaddr **sal, **psal, *sa; - socklen_t socklen; - - num_addrs = php_network_getaddresses(host, socktype, &psal, error_string TSRMLS_CC); - - if (num_addrs == 0) { - /* could not resolve address(es) */ - return -1; - } - - for (sal = psal; *sal != NULL; sal++) { - sa = *sal; - - /* create a socket for this address */ - sock = socket(sa->sa_family, socktype, 0); - - if (sock == SOCK_ERR) { - continue; - } - - switch (sa->sa_family) { -#if HAVE_GETADDRINFO && HAVE_IPV6 - case AF_INET6: - ((struct sockaddr_in6 *)sa)->sin6_family = sa->sa_family; - ((struct sockaddr_in6 *)sa)->sin6_port = htons(port); - socklen = sizeof(struct sockaddr_in6); - break; -#endif - case AF_INET: - ((struct sockaddr_in *)sa)->sin_family = sa->sa_family; - ((struct sockaddr_in *)sa)->sin_port = htons(port); - socklen = sizeof(struct sockaddr_in); - break; - default: - /* Unknown family */ - socklen = 0; - sa = NULL; - } - - if (sa) { - /* attempt to bind */ - -#ifdef SO_REUSEADDR - { - int val = 1; - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&val, sizeof(val)); - } -#endif - - n = bind(sock, sa, socklen); - - if (n != SOCK_CONN_ERR) { - goto bound; - } - - err = php_socket_errno(); - } - - closesocket(sock); - } - sock = -1; - - if (error_code) { - *error_code = err; - } - if (error_string) { - *error_string = php_socket_strerror(err, NULL, 0); - } - -bound: - - php_network_freeaddresses(psal); - - return sock; - -} -/* }}} */ - -PHPAPI int php_network_parse_network_address_with_port(const char *addr, long addrlen, struct sockaddr *sa, socklen_t *sl TSRMLS_DC) -{ - char *colon; - char *tmp; - int ret = FAILURE; - short port; - struct sockaddr_in *in4 = (struct sockaddr_in*)sa; - struct sockaddr **psal; - int n; - char *errstr = NULL; -#if HAVE_IPV6 - struct sockaddr_in6 *in6 = (struct sockaddr_in6*)sa; -#endif - - if (*addr == '[') { - colon = memchr(addr + 1, ']', addrlen-1); - if (!colon || colon[1] != ':') { - return FAILURE; - } - port = atoi(colon + 2); - addr++; - } else { - colon = memchr(addr, ':', addrlen); - if (!colon) { - return FAILURE; - } - port = atoi(colon + 1); - } - - tmp = estrndup(addr, colon - addr); - - /* first, try interpreting the address as a numeric address */ - -#if HAVE_IPV6 && HAVE_INET_PTON - if (inet_pton(AF_INET6, tmp, &in6->sin6_addr) > 0) { - in6->sin6_port = htons(port); - in6->sin6_family = AF_INET6; - *sl = sizeof(struct sockaddr_in6); - ret = SUCCESS; - goto out; - } -#endif - if (inet_aton(tmp, &in4->sin_addr) > 0) { - in4->sin_port = htons(port); - in4->sin_family = AF_INET; - *sl = sizeof(struct sockaddr_in); - ret = SUCCESS; - goto out; - } - - /* looks like we'll need to resolve it */ - n = php_network_getaddresses(tmp, SOCK_DGRAM, &psal, &errstr TSRMLS_CC); - - if (n == 0) { - if (errstr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to resolve `%s': %s", tmp, errstr); - STR_FREE(errstr); - } - goto out; - } - - /* copy the details from the first item */ - switch ((*psal)->sa_family) { -#if HAVE_GETADDRINFO && HAVE_IPV6 - case AF_INET6: - *in6 = **(struct sockaddr_in6**)psal; - in6->sin6_port = htons(port); - *sl = sizeof(struct sockaddr_in6); - ret = SUCCESS; - break; -#endif - case AF_INET: - *in4 = **(struct sockaddr_in**)psal; - in4->sin_port = htons(port); - *sl = sizeof(struct sockaddr_in); - ret = SUCCESS; - break; - } - - php_network_freeaddresses(psal); - -out: - STR_FREE(tmp); - return ret; -} - - -PHPAPI void php_network_populate_name_from_sockaddr( - /* input address */ - struct sockaddr *sa, socklen_t sl, - /* output readable address */ - char **textaddr, long *textaddrlen, - /* output address */ - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC) -{ - if (addr) { - *addr = emalloc(sl); - memcpy(*addr, sa, sl); - *addrlen = sl; - } - - if (textaddr) { -#if HAVE_IPV6 && HAVE_INET_NTOP - char abuf[256]; -#endif - char *buf = NULL; - - switch (sa->sa_family) { - case AF_INET: - /* generally not thread safe, but it *is* thread safe under win32 */ - buf = inet_ntoa(((struct sockaddr_in*)sa)->sin_addr); - if (buf) { - *textaddrlen = spprintf(textaddr, 0, "%s:%d", - buf, ntohs(((struct sockaddr_in*)sa)->sin_port)); - } - - break; - -#if HAVE_IPV6 && HAVE_INET_NTOP - case AF_INET6: - buf = (char*)inet_ntop(sa->sa_family, &((struct sockaddr_in6*)sa)->sin6_addr, (char *)&abuf, sizeof(abuf)); - if (buf) { - *textaddrlen = spprintf(textaddr, 0, "%s:%d", - buf, ntohs(((struct sockaddr_in6*)sa)->sin6_port)); - } - - break; -#endif -#ifdef AF_UNIX - case AF_UNIX: - { - struct sockaddr_un *ua = (struct sockaddr_un*)sa; - - if (ua->sun_path[0] == '\0') { - /* abstract name */ - int len = strlen(ua->sun_path + 1) + 1; - *textaddrlen = len; - *textaddr = emalloc(len + 1); - memcpy(*textaddr, ua->sun_path, len); - (*textaddr)[len] = '\0'; - } else { - *textaddrlen = strlen(ua->sun_path); - *textaddr = estrndup(ua->sun_path, *textaddrlen); - } - } - break; -#endif - - } - - } -} - -PHPAPI int php_network_get_peer_name(php_socket_t sock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC) -{ - php_sockaddr_storage sa; - socklen_t sl = sizeof(sa); - memset(&sa, 0, sizeof(sa)); - - if (getpeername(sock, (struct sockaddr*)&sa, &sl) == 0) { - php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, - textaddr, textaddrlen, - addr, addrlen - TSRMLS_CC); - return 0; - } - return -1; -} - -PHPAPI int php_network_get_sock_name(php_socket_t sock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC) -{ - php_sockaddr_storage sa; - socklen_t sl = sizeof(sa); - memset(&sa, 0, sizeof(sa)); - - if (getsockname(sock, (struct sockaddr*)&sa, &sl) == 0) { - php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, - textaddr, textaddrlen, - addr, addrlen - TSRMLS_CC); - return 0; - } - return -1; - -} - - -/* Accept a client connection from a server socket, - * using an optional timeout. - * Returns the peer address in addr/addrlen (it will emalloc - * these, so be sure to efree the result). - * If you specify textaddr/textaddrlen, a text-printable - * version of the address will be emalloc'd and returned. - * */ - -/* {{{ php_network_accept_incoming */ -PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen, - struct timeval *timeout, - char **error_string, - int *error_code - TSRMLS_DC) -{ - php_socket_t clisock = -1; - int error = 0, n; - php_sockaddr_storage sa; - socklen_t sl; - - n = php_pollfd_for(srvsock, PHP_POLLREADABLE, timeout); - - if (n == 0) { - error = PHP_TIMEOUT_ERROR_VALUE; - } else if (n == -1) { - error = php_socket_errno(); - } else { - sl = sizeof(sa); - - clisock = accept(srvsock, (struct sockaddr*)&sa, &sl); - - if (clisock >= 0) { - php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, - textaddr, textaddrlen, - addr, addrlen - TSRMLS_CC); - } else { - error = php_socket_errno(); - } - } - - if (error_code) { - *error_code = error; - } - if (error_string) { - *error_string = php_socket_strerror(error, NULL, 0); - } - - return clisock; -} -/* }}} */ - - - -/* Connect to a remote host using an interruptible connect with optional timeout. - * Optionally, the connect can be made asynchronously, which will implicitly - * enable non-blocking mode on the socket. - * Returns the connected (or connecting) socket, or -1 on failure. - * */ - -/* {{{ php_network_connect_socket_to_host */ -php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short port, - int socktype, int asynchronous, struct timeval *timeout, char **error_string, - int *error_code, char *bindto, unsigned short bindport - TSRMLS_DC) -{ - int num_addrs, n, fatal = 0; - php_socket_t sock; - struct sockaddr **sal, **psal, *sa; - struct timeval working_timeout; - socklen_t socklen; -#if HAVE_GETTIMEOFDAY - struct timeval limit_time, time_now; -#endif - - num_addrs = php_network_getaddresses(host, socktype, &psal, error_string TSRMLS_CC); - - if (num_addrs == 0) { - /* could not resolve address(es) */ - return -1; - } - - if (timeout) { - memcpy(&working_timeout, timeout, sizeof(working_timeout)); -#if HAVE_GETTIMEOFDAY - gettimeofday(&limit_time, NULL); - limit_time.tv_sec += working_timeout.tv_sec; - limit_time.tv_usec += working_timeout.tv_usec; - if (limit_time.tv_usec >= 1000000) { - limit_time.tv_usec -= 1000000; - limit_time.tv_sec++; - } -#endif - } - - for (sal = psal; !fatal && *sal != NULL; sal++) { - sa = *sal; - - /* create a socket for this address */ - sock = socket(sa->sa_family, socktype, 0); - - if (sock == SOCK_ERR) { - continue; - } - - switch (sa->sa_family) { -#if HAVE_GETADDRINFO && HAVE_IPV6 - case AF_INET6: - ((struct sockaddr_in6 *)sa)->sin6_family = sa->sa_family; - ((struct sockaddr_in6 *)sa)->sin6_port = htons(port); - socklen = sizeof(struct sockaddr_in6); - break; -#endif - case AF_INET: - ((struct sockaddr_in *)sa)->sin_family = sa->sa_family; - ((struct sockaddr_in *)sa)->sin_port = htons(port); - socklen = sizeof(struct sockaddr_in); - break; - default: - /* Unknown family */ - socklen = 0; - sa = NULL; - } - - if (sa) { - /* make a connection attempt */ - - if (bindto) { - struct sockaddr *local_address = NULL; - int local_address_len = 0; - - if (sa->sa_family == AF_INET) { - struct sockaddr_in *in4 = emalloc(sizeof(struct sockaddr_in)); - - local_address = (struct sockaddr*)in4; - local_address_len = sizeof(struct sockaddr_in); - - in4->sin_family = sa->sa_family; - in4->sin_port = htons(bindport); - if (!inet_aton(bindto, &in4->sin_addr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid IP Address: %s", bindto); - goto skip_bind; - } - memset(&(in4->sin_zero), 0, sizeof(in4->sin_zero)); - } -#if HAVE_IPV6 && HAVE_INET_PTON - else { /* IPV6 */ - struct sockaddr_in6 *in6 = emalloc(sizeof(struct sockaddr_in6)); - - local_address = (struct sockaddr*)in6; - local_address_len = sizeof(struct sockaddr_in6); - - in6->sin6_family = sa->sa_family; - in6->sin6_port = htons(bindport); - if (inet_pton(AF_INET6, bindto, &in6->sin6_addr) < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid IP Address: %s", bindto); - goto skip_bind; - } - } -#endif - if (!local_address || bind(sock, local_address, local_address_len)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to bind to '%s:%d', system said: %s", bindto, bindport, strerror(errno)); - } -skip_bind: - if (local_address) { - efree(local_address); - } - } - /* free error string recieved during previous iteration (if any) */ - if (error_string && *error_string) { - efree(*error_string); - *error_string = NULL; - } - - n = php_network_connect_socket(sock, sa, socklen, asynchronous, - timeout ? &working_timeout : NULL, - error_string, error_code); - - if (n != SOCK_CONN_ERR) { - goto connected; - } - - /* adjust timeout for next attempt */ -#if HAVE_GETTIMEOFDAY - if (timeout) { - gettimeofday(&time_now, NULL); - - if (timercmp(&time_now, &limit_time, >=)) { - /* time limit expired; don't attempt any further connections */ - fatal = 1; - } else { - /* work out remaining time */ - sub_times(limit_time, time_now, &working_timeout); - } - } -#else - if (error_code && *error_code == PHP_TIMEOUT_ERROR_VALUE) { - /* Don't even bother trying to connect to the next alternative; - * we have no way to determine how long we have already taken - * and it is quite likely that the next attempt will fail too. */ - fatal = 1; - } else { - /* re-use the same initial timeout. - * Not the best thing, but in practice it should be good-enough */ - if (timeout) { - memcpy(&working_timeout, timeout, sizeof(working_timeout)); - } - } -#endif - } - - closesocket(sock); - } - sock = -1; - -connected: - - php_network_freeaddresses(psal); - - return sock; -} -/* }}} */ - -/* {{{ php_any_addr - * Fills the any (wildcard) address into php_sockaddr_storage - */ -PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short port) -{ - memset(addr, 0, sizeof(php_sockaddr_storage)); - switch (family) { -#if HAVE_IPV6 - case AF_INET6: { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) addr; - sin6->sin6_family = AF_INET6; - sin6->sin6_port = htons(port); - sin6->sin6_addr = in6addr_any; - break; - } -#endif - case AF_INET: { - struct sockaddr_in *sin = (struct sockaddr_in *) addr; - sin->sin_family = AF_INET; - sin->sin_port = htons(port); - sin->sin_addr.s_addr = htonl(INADDR_ANY); - break; - } - } -} -/* }}} */ - -/* {{{ php_sockaddr_size - * Returns the size of struct sockaddr_xx for the family - */ -PHPAPI int php_sockaddr_size(php_sockaddr_storage *addr) -{ - switch (((struct sockaddr *)addr)->sa_family) { - case AF_INET: - return sizeof(struct sockaddr_in); -#if HAVE_IPV6 - case AF_INET6: - return sizeof(struct sockaddr_in6); -#endif -#ifdef AF_UNIX - case AF_UNIX: - return sizeof(struct sockaddr_un); -#endif - default: - return 0; - } -} -/* }}} */ - -/* Given a socket error code, if buf == NULL: - * emallocs storage for the error message and returns - * else - * sprintf message into provided buffer and returns buf - */ -/* {{{ php_socket_strerror */ -PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize) -{ -#ifndef PHP_WIN32 - char *errstr; - - errstr = strerror(err); - if (buf == NULL) { - buf = estrdup(errstr); - } else { - strncpy(buf, errstr, bufsize); - } - return buf; -#else - char *sysbuf; - int free_it = 1; - - if (!FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - err, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&sysbuf, - 0, - NULL)) { - free_it = 0; - sysbuf = "Unknown Error"; - } - - if (buf == NULL) { - buf = estrdup(sysbuf); - } else { - strncpy(buf, sysbuf, bufsize); - } - - if (free_it) { - LocalFree(sysbuf); - } - - return buf; -#endif -} -/* }}} */ - -/* deprecated */ -PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC TSRMLS_DC) -{ - php_stream *stream; - php_netstream_data_t *sock; - - sock = pemalloc(sizeof(php_netstream_data_t), persistent_id ? 1 : 0); - memset(sock, 0, sizeof(php_netstream_data_t)); - - sock->is_blocked = 1; - sock->timeout.tv_sec = FG(default_socket_timeout); - sock->timeout.tv_usec = 0; - sock->socket = socket; - - stream = php_stream_alloc_rel(&php_stream_generic_socket_ops, sock, persistent_id, "r+"); - - if (stream == NULL) { - pefree(sock, persistent_id ? 1 : 0); - } else { - stream->flags |= PHP_STREAM_FLAG_AVOID_BLOCKING; - } - - return stream; -} - -PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short port, - int socktype, struct timeval *timeout, const char *persistent_id STREAMS_DC TSRMLS_DC) -{ - char *res; - long reslen; - php_stream *stream; - - reslen = spprintf(&res, 0, "tcp://%s:%d", host, port); - - stream = php_stream_xport_create(res, reslen, ENFORCE_SAFE_MODE | REPORT_ERRORS, - STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, persistent_id, timeout, NULL, NULL, NULL); - - efree(res); - - return stream; -} - -PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC) -{ - int ret = SUCCESS; - int flags; - int myflag = 0; - -#ifdef PHP_WIN32 - /* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */ - flags = !block; - if (ioctlsocket(socketd, FIONBIO, &flags) == SOCKET_ERROR) { - char *error_string; - - error_string = php_socket_strerror(WSAGetLastError(), NULL, 0); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", error_string); - efree(error_string); - ret = FAILURE; - } -#else - flags = fcntl(socketd, F_GETFL); -#ifdef O_NONBLOCK - myflag = O_NONBLOCK; /* POSIX version */ -#elif defined(O_NDELAY) - myflag = O_NDELAY; /* old non-POSIX version */ -#endif - if (!block) { - flags |= myflag; - } else { - flags &= ~myflag; - } - fcntl(socketd, F_SETFL, flags); -#endif - return ret; -} - -PHPAPI void _php_emit_fd_setsize_warning(int max_fd) -{ - TSRMLS_FETCH(); - -#ifdef PHP_WIN32 - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "PHP needs to be recompiled with a larger value of FD_SETSIZE.\n" - "If this binary is from an official www.php.net package, file a bug report\n" - "at http://bugs.php.net, including the following information:\n" - "FD_SETSIZE=%d, but you are using %d.\n" - " --enable-fd-setsize=%d is recommended, but you may want to set it\n" - "to match to maximum number of sockets each script will work with at\n" - "one time, in order to avoid seeing this error again at a later date.", - FD_SETSIZE, max_fd, (max_fd + 128) & ~127); -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "You MUST recompile PHP with a larger value of FD_SETSIZE.\n" - "It is set to %d, but you have descriptors numbered at least as high as %d.\n" - " --enable-fd-setsize=%d is recommended, but you may want to set it\n" - "to equal the maximum number of open files supported by your system,\n" - "in order to avoid seeing this error again at a later date.", - FD_SETSIZE, max_fd, (max_fd + 1024) & ~1023); -#endif -} - -#if defined(PHP_USE_POLL_2_EMULATION) - -/* emulate poll(2) using select(2), safely. */ - -PHPAPI int php_poll2(php_pollfd *ufds, unsigned int nfds, int timeout) -{ - fd_set rset, wset, eset; - php_socket_t max_fd = SOCK_ERR; - unsigned int i, n; - struct timeval tv; - - /* check the highest numbered descriptor */ - for (i = 0; i < nfds; i++) { - if (ufds[i].fd > max_fd) - max_fd = ufds[i].fd; - } - - PHP_SAFE_MAX_FD(max_fd, nfds + 1); - - FD_ZERO(&rset); - FD_ZERO(&wset); - FD_ZERO(&eset); - - for (i = 0; i < nfds; i++) { - if (ufds[i].events & PHP_POLLREADABLE) { - PHP_SAFE_FD_SET(ufds[i].fd, &rset); - } - if (ufds[i].events & POLLOUT) { - PHP_SAFE_FD_SET(ufds[i].fd, &wset); - } - if (ufds[i].events & POLLPRI) { - PHP_SAFE_FD_SET(ufds[i].fd, &eset); - } - } - - if (timeout >= 0) { - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout - (tv.tv_sec * 1000)) * 1000; - } - n = select(max_fd + 1, &rset, &wset, &eset, timeout >= 0 ? &tv : NULL); - - if (n >= 0) { - for (i = 0; i < nfds; i++) { - ufds[i].revents = 0; - - if (PHP_SAFE_FD_ISSET(ufds[i].fd, &rset)) { - /* could be POLLERR or POLLHUP but can't tell without probing */ - ufds[i].revents |= POLLIN; - } - if (PHP_SAFE_FD_ISSET(ufds[i].fd, &wset)) { - ufds[i].revents |= POLLOUT; - } - if (PHP_SAFE_FD_ISSET(ufds[i].fd, &eset)) { - ufds[i].revents |= POLLPRI; - } - } - } - return n; -} - -#endif - - -/* - * Local variables: - * tab-width: 8 - * c-basic-offset: 8 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/output.c b/main/output.c deleted file mode 100644 index 0b86131939317..0000000000000 --- a/main/output.c +++ /dev/null @@ -1,1086 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Zeev Suraski | - | Thies C. Arntzen | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/head.h" -#include "ext/standard/basic_functions.h" -#include "ext/standard/url_scanner_ex.h" -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) -#include "ext/zlib/php_zlib.h" -#endif -#include "SAPI.h" - -#define OB_DEFAULT_HANDLER_NAME "default output handler" - -/* output functions */ -static int php_b_body_write(const char *str, uint str_length TSRMLS_DC); - -static int php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC); -static void php_ob_append(const char *text, uint text_length TSRMLS_DC); -#if 0 -static void php_ob_prepend(const char *text, uint text_length); -#endif - -#ifdef ZTS -int output_globals_id; -#else -php_output_globals output_globals; -#endif - -/* {{{ php_default_output_func */ -PHPAPI int php_default_output_func(const char *str, uint str_len TSRMLS_DC) -{ - fwrite(str, 1, str_len, stderr); - return str_len; -} -/* }}} */ - -/* {{{ php_output_init_globals */ -static void php_output_init_globals(php_output_globals *output_globals_p TSRMLS_DC) -{ - OG(php_body_write) = php_default_output_func; - OG(php_header_write) = php_default_output_func; - OG(implicit_flush) = 0; - OG(output_start_filename) = NULL; - OG(output_start_lineno) = 0; -} -/* }}} */ - - -/* {{{ php_output_startup - Start output layer */ -PHPAPI void php_output_startup(void) -{ -#ifdef ZTS - ts_allocate_id(&output_globals_id, sizeof(php_output_globals), (ts_allocate_ctor) php_output_init_globals, NULL); -#else - php_output_init_globals(&output_globals TSRMLS_CC); -#endif -} -/* }}} */ - - -/* {{{ php_output_activate - Initilize output global for activation */ -PHPAPI void php_output_activate(TSRMLS_D) -{ - OG(php_body_write) = php_ub_body_write; - OG(php_header_write) = sapi_module.ub_write; - OG(ob_nesting_level) = 0; - OG(ob_lock) = 0; - OG(disable_output) = 0; - OG(output_start_filename) = NULL; - OG(output_start_lineno) = 0; -} -/* }}} */ - - -/* {{{ php_output_set_status - Toggle output status. Do NOT use in application code, only in SAPIs where appropriate. */ -PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC) -{ - OG(disable_output) = !status; -} -/* }}} */ - -/* {{{ php_output_register_constants */ -void php_output_register_constants(TSRMLS_D) -{ - REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_CONT, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_END", PHP_OUTPUT_HANDLER_END, CONST_CS | CONST_PERSISTENT); -} -/* }}} */ - - -/* {{{ php_body_write - * Write body part */ -PHPAPI int php_body_write(const char *str, uint str_length TSRMLS_DC) -{ - return OG(php_body_write)(str, str_length TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_header_write - * Write HTTP header */ -PHPAPI int php_header_write(const char *str, uint str_length TSRMLS_DC) -{ - if (OG(disable_output)) { - return 0; - } else { - return OG(php_header_write)(str, str_length TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ php_start_ob_buffer - * Start output buffering */ -PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC) -{ - uint initial_size, block_size; - - if (OG(ob_lock)) { - if (SG(headers_sent) && !SG(request_info).headers_only) { - OG(php_body_write) = php_ub_body_write_no_header; - } else { - OG(php_body_write) = php_ub_body_write; - } - OG(ob_nesting_level) = 0; - php_error_docref("ref.outcontrol" TSRMLS_CC, E_ERROR, "Cannot use output buffering in output buffering display handlers"); - return FAILURE; - } - if (chunk_size > 0) { - if (chunk_size==1) { - chunk_size = 4096; - } - initial_size = (chunk_size*3/2); - block_size = chunk_size/2; - } else { - initial_size = 40*1024; - block_size = 10*1024; - } - return php_ob_init(initial_size, block_size, output_handler, chunk_size, erase TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_start_ob_buffer_named - * Start output buffering */ -PHPAPI int php_start_ob_buffer_named(const char *output_handler_name, uint chunk_size, zend_bool erase TSRMLS_DC) -{ - zval *output_handler; - int result; - - ALLOC_INIT_ZVAL(output_handler); - Z_STRLEN_P(output_handler) = strlen(output_handler_name); /* this can be optimized */ - Z_STRVAL_P(output_handler) = estrndup(output_handler_name, Z_STRLEN_P(output_handler)); - Z_TYPE_P(output_handler) = IS_STRING; - result = php_start_ob_buffer(output_handler, chunk_size, erase TSRMLS_CC); - zval_dtor(output_handler); - FREE_ZVAL(output_handler); - return result; -} -/* }}} */ - -/* {{{ php_end_ob_buffer - * End output buffering (one level) */ -PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC) -{ - char *final_buffer=NULL; - unsigned int final_buffer_length=0; - zval *alternate_buffer=NULL; - char *to_be_destroyed_buffer, *to_be_destroyed_handler_name; - char *to_be_destroyed_handled_output[2] = { 0, 0 }; - int status; - php_ob_buffer *prev_ob_buffer_p=NULL; - php_ob_buffer orig_ob_buffer; - - if (OG(ob_nesting_level)==0) { - return; - } - status = 0; - if (!OG(active_ob_buffer).status & PHP_OUTPUT_HANDLER_START) { - /* our first call */ - status |= PHP_OUTPUT_HANDLER_START; - } - if (just_flush) { - status |= PHP_OUTPUT_HANDLER_CONT; - } else { - status |= PHP_OUTPUT_HANDLER_END; - } - -#if 0 - { - FILE *fp; - fp = fopen("/tmp/ob_log", "a"); - fprintf(fp, "NestLevel: %d ObStatus: %d HandlerName: %s\n", OG(ob_nesting_level), status, OG(active_ob_buffer).handler_name); - fclose(fp); - } -#endif - - if (OG(active_ob_buffer).internal_output_handler) { - final_buffer = OG(active_ob_buffer).internal_output_handler_buffer; - final_buffer_length = OG(active_ob_buffer).internal_output_handler_buffer_size; - OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status TSRMLS_CC); - } else if (OG(active_ob_buffer).output_handler) { - zval **params[2]; - zval *orig_buffer; - zval *z_status; - - ALLOC_INIT_ZVAL(orig_buffer); - ZVAL_STRINGL(orig_buffer, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 1); - orig_buffer->refcount=2; /* don't let call_user_function() destroy our buffer */ - orig_buffer->is_ref=1; - - ALLOC_INIT_ZVAL(z_status); - ZVAL_LONG(z_status, status); - - params[0] = &orig_buffer; - params[1] = &z_status; - OG(ob_lock) = 1; - - if (call_user_function_ex(CG(function_table), NULL, OG(active_ob_buffer).output_handler, &alternate_buffer, 2, params, 1, NULL TSRMLS_CC)==SUCCESS) { - if (alternate_buffer && !(Z_TYPE_P(alternate_buffer)==IS_BOOL && Z_BVAL_P(alternate_buffer)==0)) { - convert_to_string_ex(&alternate_buffer); - final_buffer = Z_STRVAL_P(alternate_buffer); - final_buffer_length = Z_STRLEN_P(alternate_buffer); - } - } - OG(ob_lock) = 0; - if (!just_flush) { - zval_ptr_dtor(&OG(active_ob_buffer).output_handler); - } - orig_buffer->refcount -=2; - if (orig_buffer->refcount <= 0) { /* free the zval */ - zval_dtor(orig_buffer); - FREE_ZVAL(orig_buffer); - } - zval_ptr_dtor(&z_status); - } - - if (!final_buffer) { - final_buffer = OG(active_ob_buffer).buffer; - final_buffer_length = OG(active_ob_buffer).text_length; - } - - if (OG(ob_nesting_level)==1) { /* end buffering */ - if (SG(headers_sent) && !SG(request_info).headers_only) { - OG(php_body_write) = php_ub_body_write_no_header; - } else { - OG(php_body_write) = php_ub_body_write; - } - } - - to_be_destroyed_buffer = OG(active_ob_buffer).buffer; - to_be_destroyed_handler_name = OG(active_ob_buffer).handler_name; - if (OG(active_ob_buffer).internal_output_handler - && (final_buffer != OG(active_ob_buffer).internal_output_handler_buffer) - && (final_buffer != OG(active_ob_buffer).buffer)) { - to_be_destroyed_handled_output[0] = final_buffer; - } - - if (!just_flush) { - if (OG(active_ob_buffer).internal_output_handler) { - to_be_destroyed_handled_output[1] = OG(active_ob_buffer).internal_output_handler_buffer; - } - } - if (OG(ob_nesting_level)>1) { /* restore previous buffer */ - zend_stack_top(&OG(ob_buffers), (void **) &prev_ob_buffer_p); - orig_ob_buffer = OG(active_ob_buffer); - OG(active_ob_buffer) = *prev_ob_buffer_p; - zend_stack_del_top(&OG(ob_buffers)); - if (!just_flush && OG(ob_nesting_level)==2) { /* destroy the stack */ - zend_stack_destroy(&OG(ob_buffers)); - } - } - OG(ob_nesting_level)--; - - if (send_buffer) { - if (just_flush) { /* if flush is called prior to proper end, ensure presence of NUL */ - final_buffer[final_buffer_length] = '\0'; - } - OG(php_body_write)(final_buffer, final_buffer_length TSRMLS_CC); - } - - if (just_flush) { /* we restored the previous ob, return to the current */ - if (prev_ob_buffer_p) { - zend_stack_push(&OG(ob_buffers), &OG(active_ob_buffer), sizeof(php_ob_buffer)); - OG(active_ob_buffer) = orig_ob_buffer; - } - OG(ob_nesting_level)++; - } - - if (alternate_buffer) { - zval_ptr_dtor(&alternate_buffer); - } - - if (status & PHP_OUTPUT_HANDLER_END) { - efree(to_be_destroyed_handler_name); - } - if (!just_flush) { - efree(to_be_destroyed_buffer); - } else { - OG(active_ob_buffer).text_length = 0; - OG(active_ob_buffer).status |= PHP_OUTPUT_HANDLER_START; - OG(php_body_write) = php_b_body_write; - } - if (to_be_destroyed_handled_output[0]) { - efree(to_be_destroyed_handled_output[0]); - } - if (to_be_destroyed_handled_output[1]) { - efree(to_be_destroyed_handled_output[1]); - } -} -/* }}} */ - -/* {{{ php_end_ob_buffers - * End output buffering (all buffers) */ -PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC) -{ - while (OG(ob_nesting_level)!=0) { - php_end_ob_buffer(send_buffer, 0 TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ php_start_implicit_flush - */ -PHPAPI void php_start_implicit_flush(TSRMLS_D) -{ - OG(implicit_flush)=1; -} -/* }}} */ - -/* {{{ php_end_implicit_flush - */ -PHPAPI void php_end_implicit_flush(TSRMLS_D) -{ - OG(implicit_flush)=0; -} -/* }}} */ - -/* {{{ php_ob_set_internal_handler - */ -PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size, char *handler_name, zend_bool erase TSRMLS_DC) -{ - if (OG(ob_nesting_level)==0 || OG(active_ob_buffer).internal_output_handler || strcmp(OG(active_ob_buffer).handler_name, OB_DEFAULT_HANDLER_NAME)) { - php_start_ob_buffer(NULL, buffer_size, erase TSRMLS_CC); - } - - OG(active_ob_buffer).internal_output_handler = internal_output_handler; - OG(active_ob_buffer).internal_output_handler_buffer = (char *) emalloc(buffer_size); - OG(active_ob_buffer).internal_output_handler_buffer_size = buffer_size; - if (OG(active_ob_buffer).handler_name) { - efree(OG(active_ob_buffer).handler_name); - } - OG(active_ob_buffer).handler_name = estrdup(handler_name); - OG(active_ob_buffer).erase = erase; -} -/* }}} */ - -/* - * Output buffering - implementation - */ - -/* {{{ php_ob_allocate - */ -static inline void php_ob_allocate(uint text_length TSRMLS_DC) -{ - uint new_len = OG(active_ob_buffer).text_length + text_length; - - if (OG(active_ob_buffer).size < new_len) { - uint buf_size = OG(active_ob_buffer).size; - while (buf_size <= new_len) { - buf_size += OG(active_ob_buffer).block_size; - } - - OG(active_ob_buffer).buffer = (char *) erealloc(OG(active_ob_buffer).buffer, buf_size+1); - OG(active_ob_buffer).size = buf_size; - } - OG(active_ob_buffer).text_length = new_len; -} -/* }}} */ - -/* {{{ php_ob_init_conflict - * Returns 1 if handler_set is already used and generates error message - */ -PHPAPI int php_ob_init_conflict(char *handler_new, char *handler_set TSRMLS_DC) -{ - if (php_ob_handler_used(handler_set TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler '%s' conflicts with '%s'", handler_new, handler_set); - return 1; - } - return 0; -} -/* }}} */ - -/* {{{ php_ob_init_named - */ -static int php_ob_init_named(uint initial_size, uint block_size, char *handler_name, zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC) -{ - php_ob_buffer tmp_buf; - - if (output_handler && !zend_is_callable(output_handler, 0, NULL)) { - return FAILURE; - } - - tmp_buf.block_size = block_size; - tmp_buf.size = initial_size; - tmp_buf.buffer = (char *) emalloc(initial_size+1); - tmp_buf.text_length = 0; - tmp_buf.output_handler = output_handler; - tmp_buf.chunk_size = chunk_size; - tmp_buf.status = 0; - tmp_buf.internal_output_handler = NULL; - tmp_buf.internal_output_handler_buffer = NULL; - tmp_buf.internal_output_handler_buffer_size = 0; - tmp_buf.handler_name = estrdup(handler_name&&handler_name[0]?handler_name:OB_DEFAULT_HANDLER_NAME); - tmp_buf.erase = erase; - - if (OG(ob_nesting_level)>0) { -#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) - if (!strncmp(handler_name, "ob_gzhandler", sizeof("ob_gzhandler")) && php_ob_gzhandler_check(TSRMLS_C)) { - return FAILURE; - } -#endif - if (OG(ob_nesting_level)==1) { /* initialize stack */ - zend_stack_init(&OG(ob_buffers)); - } - zend_stack_push(&OG(ob_buffers), &OG(active_ob_buffer), sizeof(php_ob_buffer)); - } - OG(ob_nesting_level)++; - OG(active_ob_buffer) = tmp_buf; - OG(php_body_write) = php_b_body_write; - return SUCCESS; -} -/* }}} */ - -/* {{{ php_ob_handler_from_string - * Create zval output handler from string - */ -static zval* php_ob_handler_from_string(const char *handler_name, int len TSRMLS_DC) -{ - zval *output_handler; - - ALLOC_INIT_ZVAL(output_handler); - Z_STRLEN_P(output_handler) = len; - Z_STRVAL_P(output_handler) = estrndup(handler_name, len); - Z_TYPE_P(output_handler) = IS_STRING; - return output_handler; -} -/* }}} */ - -/* {{{ php_ob_init - */ -static int php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC) -{ - int result = FAILURE, handler_len, len; - char *handler_name, *next_handler_name; - HashPosition pos; - zval **tmp; - zval *handler_zval; - - if (output_handler && output_handler->type == IS_STRING) { - handler_name = Z_STRVAL_P(output_handler); - handler_len = Z_STRLEN_P(output_handler); - - result = SUCCESS; - if (handler_len && handler_name[0] != '\0') { - while ((next_handler_name=strchr(handler_name, ',')) != NULL) { - len = next_handler_name-handler_name; - next_handler_name = estrndup(handler_name, len); - handler_zval = php_ob_handler_from_string(next_handler_name, len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, next_handler_name, handler_zval, chunk_size, erase TSRMLS_CC); - if (result != SUCCESS) { - zval_dtor(handler_zval); - FREE_ZVAL(handler_zval); - } - handler_name += len+1; - handler_len -= len+1; - efree(next_handler_name); - } - } - if (result == SUCCESS) { - handler_zval = php_ob_handler_from_string(handler_name, handler_len TSRMLS_CC); - result = php_ob_init_named(initial_size, block_size, handler_name, handler_zval, chunk_size, erase TSRMLS_CC); - if (result != SUCCESS) { - zval_dtor(handler_zval); - FREE_ZVAL(handler_zval); - } - } - } else if (output_handler && output_handler->type == IS_ARRAY) { - /* do we have array(object,method) */ - if (zend_is_callable(output_handler, 0, &handler_name)) { - SEPARATE_ZVAL(&output_handler); - output_handler->refcount++; - result = php_ob_init_named(initial_size, block_size, handler_name, output_handler, chunk_size, erase TSRMLS_CC); - efree(handler_name); - } else { - efree(handler_name); - /* init all array elements recursively */ - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(output_handler), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(output_handler), (void **)&tmp, &pos) == SUCCESS) { - result = php_ob_init(initial_size, block_size, *tmp, chunk_size, erase TSRMLS_CC); - if (result == FAILURE) { - break; - } - zend_hash_move_forward_ex(Z_ARRVAL_P(output_handler), &pos); - } - } - } else if (output_handler && output_handler->type == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "No method name given: use ob_start(array($object,'method')) to specify instance $object and the name of a method of class %s to use as output handler", Z_OBJCE_P(output_handler)->name); - result = FAILURE; - } else { - result = php_ob_init_named(initial_size, block_size, OB_DEFAULT_HANDLER_NAME, NULL, chunk_size, erase TSRMLS_CC); - } - return result; -} -/* }}} */ - -/* {{{ php_ob_list_each - */ -static int php_ob_list_each(php_ob_buffer *ob_buffer, zval *ob_handler_array) -{ - add_next_index_string(ob_handler_array, ob_buffer->handler_name, 1); - return 0; -} -/* }}} */ - -/* {{{ proto false|array ob_list_handlers() - * List all output_buffers in an array - */ -PHP_FUNCTION(ob_list_handlers) -{ - if (ZEND_NUM_ARGS()!=0) { - ZEND_WRONG_PARAM_COUNT(); - RETURN_FALSE; - } - - array_init(return_value); - if (OG(ob_nesting_level)) { - if (OG(ob_nesting_level)>1) { - zend_stack_apply_with_argument(&OG(ob_buffers), ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_ob_list_each, return_value); - } - php_ob_list_each(&OG(active_ob_buffer), return_value); - } -} -/* }}} */ - -/* {{{ php_ob_used_each - * Sets handler_name to NULL is found - */ -static int php_ob_handler_used_each(php_ob_buffer *ob_buffer, char **handler_name) -{ - if (!strcmp(ob_buffer->handler_name, *handler_name)) { - *handler_name = NULL; - return 1; - } - return 0; -} -/* }}} */ - -/* {{{ php_ob_used - * returns 1 if given handler_name is used as output_handler - */ -PHPAPI int php_ob_handler_used(char *handler_name TSRMLS_DC) -{ - char *tmp = handler_name; - - if (OG(ob_nesting_level)) { - if (!strcmp(OG(active_ob_buffer).handler_name, handler_name)) { - return 1; - } - if (OG(ob_nesting_level)>1) { - zend_stack_apply_with_argument(&OG(ob_buffers), ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_ob_handler_used_each, &tmp); - } - } - return tmp ? 0 : 1; -} -/* }}} */ - -/* {{{ php_ob_append - */ -static inline void php_ob_append(const char *text, uint text_length TSRMLS_DC) -{ - char *target; - int original_ob_text_length; - - original_ob_text_length=OG(active_ob_buffer).text_length; - - php_ob_allocate(text_length TSRMLS_CC); - target = OG(active_ob_buffer).buffer+original_ob_text_length; - memcpy(target, text, text_length); - target[text_length]=0; - - /* If implicit_flush is On or chunked buffering, send contents to next buffer and return. */ - if (OG(active_ob_buffer).chunk_size - && OG(active_ob_buffer).text_length >= OG(active_ob_buffer).chunk_size) { - - php_end_ob_buffer(1, 1 TSRMLS_CC); - return; - } -} -/* }}} */ - -#if 0 -static inline void php_ob_prepend(const char *text, uint text_length) -{ - char *p, *start; - TSRMLS_FETCH(); - - php_ob_allocate(text_length TSRMLS_CC); - - /* php_ob_allocate() may change OG(ob_buffer), so we can't initialize p&start earlier */ - p = OG(ob_buffer)+OG(ob_text_length); - start = OG(ob_buffer); - - while (--p>=start) { - p[text_length] = *p; - } - memcpy(OG(ob_buffer), text, text_length); - OG(ob_buffer)[OG(active_ob_buffer).text_length]=0; -} -#endif - - -/* {{{ php_ob_get_buffer - * Return the current output buffer */ -PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC) -{ - if (OG(ob_nesting_level)==0) { - return FAILURE; - } - ZVAL_STRINGL(p, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 1); - return SUCCESS; -} -/* }}} */ - -/* {{{ php_ob_get_length - * Return the size of the current output buffer */ -PHPAPI int php_ob_get_length(zval *p TSRMLS_DC) -{ - if (OG(ob_nesting_level) == 0) { - return FAILURE; - } - ZVAL_LONG(p, OG(active_ob_buffer).text_length); - return SUCCESS; -} -/* }}} */ - -/* - * Wrapper functions - implementation - */ - - -/* buffered output function */ -static int php_b_body_write(const char *str, uint str_length TSRMLS_DC) -{ - php_ob_append(str, str_length TSRMLS_CC); - return str_length; -} - -/* {{{ php_ub_body_write_no_header - */ -PHPAPI int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC) -{ - int result; - - if (OG(disable_output)) { - return 0; - } - - result = OG(php_header_write)(str, str_length TSRMLS_CC); - - if (OG(implicit_flush)) { - sapi_flush(TSRMLS_C); - } - - return result; -} -/* }}} */ - -/* {{{ php_ub_body_write - */ -PHPAPI int php_ub_body_write(const char *str, uint str_length TSRMLS_DC) -{ - int result = 0; - - if (SG(request_info).headers_only) { - if(SG(headers_sent)) { - return 0; - } - php_header(TSRMLS_C); - zend_bailout(); - } - if (php_header(TSRMLS_C)) { - if (zend_is_compiling(TSRMLS_C)) { - OG(output_start_filename) = zend_get_compiled_filename(TSRMLS_C); - OG(output_start_lineno) = zend_get_compiled_lineno(TSRMLS_C); - } else if (zend_is_executing(TSRMLS_C)) { - OG(output_start_filename) = zend_get_executed_filename(TSRMLS_C); - OG(output_start_lineno) = zend_get_executed_lineno(TSRMLS_C); - } - - OG(php_body_write) = php_ub_body_write_no_header; - result = php_ub_body_write_no_header(str, str_length TSRMLS_CC); - } - - return result; -} -/* }}} */ - -/* - * HEAD support - */ - -/* {{{ proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) - Turn on Output Buffering (specifying an optional output handler). */ -PHP_FUNCTION(ob_start) -{ - zval *output_handler=NULL; - long chunk_size=0; - zend_bool erase=1; - int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc TSRMLS_CC, "|zlb", &output_handler, &chunk_size, &erase) == FAILURE) { - RETURN_FALSE; - } - - if (chunk_size < 0) - chunk_size = 0; - - if (php_start_ob_buffer(output_handler, chunk_size, erase TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ob_flush(void) - Flush (send) contents of the output buffer. The last buffer content is sent to next buffer */ -PHP_FUNCTION(ob_flush) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to flush buffer. No buffer to flush."); - RETURN_FALSE; - } - - php_end_ob_buffer(1, 1 TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool ob_clean(void) - Clean (delete) the current output buffer */ -PHP_FUNCTION(ob_clean) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete."); - RETURN_FALSE; - } - - if (!OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - - php_end_ob_buffer(0, 1 TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ob_end_flush(void) - Flush (send) the output buffer, and delete current output buffer */ -PHP_FUNCTION(ob_end_flush) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete and flush buffer. No buffer to delete or flush."); - RETURN_FALSE; - } - if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - - php_end_ob_buffer(1, 0 TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ob_end_clean(void) - Clean the output buffer, and delete current output buffer */ -PHP_FUNCTION(ob_end_clean) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete."); - RETURN_FALSE; - } - if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - - php_end_ob_buffer(0, 0 TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ob_get_flush(void) - Get current buffer contents, flush (send) the output buffer, and delete current output buffer */ -PHP_FUNCTION(ob_get_flush) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - /* get contents */ - if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } - /* error checks */ - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete and flush buffer. No buffer to delete or flush."); - RETURN_FALSE; - } - if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - /* flush */ - php_end_ob_buffer(1, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto bool ob_get_clean(void) - Get current buffer contents and delete current output buffer */ -PHP_FUNCTION(ob_get_clean) -{ - if (ZEND_NUM_ARGS() != 0) - ZEND_WRONG_PARAM_COUNT(); - - /* get contents */ - if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } - /* error checks */ - if (!OG(ob_nesting_level)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete."); - RETURN_FALSE; - } - if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name); - RETURN_FALSE; - } - /* delete buffer */ - php_end_ob_buffer(0, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto string ob_get_contents(void) - Return the contents of the output buffer */ -PHP_FUNCTION(ob_get_contents) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int ob_get_level(void) - Return the nesting level of the output buffer */ -PHP_FUNCTION(ob_get_level) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - RETURN_LONG (OG(ob_nesting_level)); -} -/* }}} */ - -/* {{{ proto int ob_get_length(void) - Return the length of the output buffer */ -PHP_FUNCTION(ob_get_length) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (php_ob_get_length(return_value TSRMLS_CC)==FAILURE) { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ int php_ob_buffer_status(php_ob_buffer *ob_buffer, zval *result) */ -static int php_ob_buffer_status(php_ob_buffer *ob_buffer, zval *result) -{ - zval *elem; - - MAKE_STD_ZVAL(elem); - array_init(elem); - - add_assoc_long(elem, "chunk_size", ob_buffer->chunk_size); - if (!ob_buffer->chunk_size) { - add_assoc_long(elem, "size", ob_buffer->size); - add_assoc_long(elem, "block_size", ob_buffer->block_size); - } - if (ob_buffer->internal_output_handler) { - add_assoc_long(elem, "type", PHP_OUTPUT_HANDLER_INTERNAL); - add_assoc_long(elem, "buffer_size", ob_buffer->internal_output_handler_buffer_size); - } - else { - add_assoc_long(elem, "type", PHP_OUTPUT_HANDLER_USER); - } - add_assoc_long(elem, "status", ob_buffer->status); - add_assoc_string(elem, "name", ob_buffer->handler_name, 1); - add_assoc_bool(elem, "del", ob_buffer->erase); - add_next_index_zval(result, elem); - - return SUCCESS; -} -/* }}} */ - - -/* {{{ proto false|array ob_get_status([bool full_status]) - Return the status of the active or all output buffers */ -PHP_FUNCTION(ob_get_status) -{ - int argc = ZEND_NUM_ARGS(); - zend_bool full_status = 0; - - if (zend_parse_parameters(argc TSRMLS_CC, "|b", &full_status) == FAILURE ) - RETURN_FALSE; - - array_init(return_value); - - if (full_status) { - if (OG(ob_nesting_level)>1) { - zend_stack_apply_with_argument(&OG(ob_buffers), ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *elem, void *))php_ob_buffer_status, return_value); - } - if (OG(ob_nesting_level)>0 && php_ob_buffer_status(&OG(active_ob_buffer), return_value)==FAILURE) { - RETURN_FALSE; - } - } else if (OG(ob_nesting_level)>0) { - add_assoc_long(return_value, "level", OG(ob_nesting_level)); - if (OG(active_ob_buffer).internal_output_handler) { - add_assoc_long(return_value, "type", PHP_OUTPUT_HANDLER_INTERNAL); - } else { - add_assoc_long(return_value, "type", PHP_OUTPUT_HANDLER_USER); - } - add_assoc_long(return_value, "status", OG(active_ob_buffer).status); - add_assoc_string(return_value, "name", OG(active_ob_buffer).handler_name, 1); - add_assoc_bool(return_value, "del", OG(active_ob_buffer).erase); - } -} -/* }}} */ - - -/* {{{ proto void ob_implicit_flush([int flag]) - Turn implicit flush on/off and is equivalent to calling flush() after every output call */ -PHP_FUNCTION(ob_implicit_flush) -{ - zval **zv_flag; - int flag; - - switch(ZEND_NUM_ARGS()) { - case 0: - flag = 1; - break; - case 1: - if (zend_get_parameters_ex(1, &zv_flag)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(zv_flag); - flag = Z_LVAL_PP(zv_flag); - break; - default: - ZEND_WRONG_PARAM_COUNT(); - break; - } - if (flag) { - php_start_implicit_flush(TSRMLS_C); - } else { - php_end_implicit_flush(TSRMLS_C); - } -} -/* }}} */ - - -/* {{{ char *php_get_output_start_filename(TSRMLS_D) - Return filename start output something */ -PHPAPI char *php_get_output_start_filename(TSRMLS_D) -{ - return OG(output_start_filename); -} -/* }}} */ - - -/* {{{ char *php_get_output_start_lineno(TSRMLS_D) - Return line number start output something */ -PHPAPI int php_get_output_start_lineno(TSRMLS_D) -{ - return OG(output_start_lineno); -} -/* }}} */ - - -/* {{{ proto bool output_reset_rewrite_vars(void) - Reset(clear) URL rewriter values */ -PHP_FUNCTION(output_reset_rewrite_vars) -{ - if (php_url_scanner_reset_vars(TSRMLS_C) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool output_add_rewrite_var(string name, string value) - Add URL rewriter values */ -PHP_FUNCTION(output_add_rewrite_var) -{ - char *name, *value; - int name_len, value_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &value, &value_len) == FAILURE) { - RETURN_FALSE; - } - - if (php_url_scanner_add_var(name, name_len, value, value_len, 1 TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php.h b/main/php.h deleted file mode 100644 index 747ec736bf390..0000000000000 --- a/main/php.h +++ /dev/null @@ -1,460 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_H -#define PHP_H - -#ifdef HAVE_DMALLOC -#include -#endif - -#define PHP_API_VERSION 20041225 -#define PHP_HAVE_STREAMS -#define YYDEBUG 0 - -#include "php_version.h" -#include "zend.h" -#include "zend_qsort.h" -#include "php_compat.h" - -#include "zend_API.h" - -#undef sprintf -#define sprintf php_sprintf - -/* PHP's DEBUG value must match Zend's ZEND_DEBUG value */ -#undef PHP_DEBUG -#define PHP_DEBUG ZEND_DEBUG - -#ifdef PHP_WIN32 -#include "tsrm_win32.h" -#include "win95nt.h" -# ifdef PHP_EXPORTS -# define PHPAPI __declspec(dllexport) -# else -# define PHPAPI __declspec(dllimport) -# endif -#define PHP_DIR_SEPARATOR '\\' -#define PHP_EOL "\r\n" -#else -#define PHPAPI -#define THREAD_LS -#define PHP_DIR_SEPARATOR '/' -#if defined(__MacOSX__) -#define PHP_EOL "\r" -#else -#define PHP_EOL "\n" -#endif -#endif - -#ifdef NETWARE -/* For php_get_uname() function */ -#define PHP_UNAME "NetWare" -#define PHP_OS PHP_UNAME -#endif - -#include "php_regex.h" - -#if HAVE_ASSERT_H -#if PHP_DEBUG -#undef NDEBUG -#else -#ifndef NDEBUG -#define NDEBUG -#endif -#endif -#include -#else /* HAVE_ASSERT_H */ -#define assert(expr) ((void) (0)) -#endif /* HAVE_ASSERT_H */ - -#define APACHE 0 - -#if HAVE_UNIX_H -#include -#endif - -#if HAVE_ALLOCA_H -#include -#endif - -#if HAVE_BUILD_DEFS_H -#include -#endif - -/* - * This is a fast version of strlcpy which should be used, if you - * know the size of the destination buffer and if you know - * the length of the source string. - * - * size is the allocated number of bytes of dst - * src_size is the number of bytes excluding the NUL of src - */ - -#define PHP_STRLCPY(dst, src, size, src_size) \ - { \ - size_t php_str_len; \ - \ - if (src_size >= size) \ - php_str_len = size - 1; \ - else \ - php_str_len = src_size; \ - memcpy(dst, src, php_str_len); \ - dst[php_str_len] = '\0'; \ - } - -#ifndef HAVE_STRLCPY -BEGIN_EXTERN_C() -PHPAPI size_t php_strlcpy(char *dst, const char *src, size_t siz); -END_EXTERN_C() -#undef strlcpy -#define strlcpy php_strlcpy -#endif - -#ifndef HAVE_STRLCAT -BEGIN_EXTERN_C() -PHPAPI size_t php_strlcat(char *dst, const char *src, size_t siz); -END_EXTERN_C() -#undef strlcat -#define strlcat php_strlcat -#endif - -#ifndef HAVE_STRTOK_R -BEGIN_EXTERN_C() -char *strtok_r(char *s, const char *delim, char **last); -END_EXTERN_C() -#endif - -#ifndef HAVE_SOCKLEN_T -typedef unsigned int socklen_t; -#endif - -#define CREATE_MUTEX(a, b) -#define SET_MUTEX(a) -#define FREE_MUTEX(a) - -/* - * Then the ODBC support can use both iodbc and Solid, - * uncomment this. - * #define HAVE_ODBC (HAVE_IODBC|HAVE_SOLID) - */ - -#include -#include -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_STDARG_H -#include -#else -# if HAVE_SYS_VARARGS_H -# include -# endif -#endif - - -#include "zend_hash.h" -#include "php3_compat.h" -#include "zend_alloc.h" -#include "zend_stack.h" - -#if STDC_HEADERS -# include -#else -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy((s), (d), (n)) -# endif -# ifndef HAVE_MEMMOVE -# define memmove(d, s, n) bcopy ((s), (d), (n)) -# endif -#endif - -#include "safe_mode.h" - -#ifndef HAVE_STRERROR -char *strerror(int); -#endif - -#if (REGEX == 1 || REGEX == 0) && !defined(NO_REGEX_EXTRA_H) -#include "regex/regex_extra.h" -#endif - -#if HAVE_PWD_H -# ifdef PHP_WIN32 -#include "win32/param.h" -# else -#include -#include -# endif -#endif - -#if HAVE_LIMITS_H -#include -#endif - -#ifndef LONG_MAX -#define LONG_MAX 2147483647L -#endif - -#ifndef LONG_MIN -#define LONG_MIN (- LONG_MAX - 1) -#endif - -#ifndef INT_MAX -#define INT_MAX 2147483647 -#endif - -#ifndef INT_MIN -#define INT_MIN (- INT_MAX - 1) -#endif - -#define PHP_GCC_VERSION ZEND_GCC_VERSION -#define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC -#define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT - -BEGIN_EXTERN_C() -#include "snprintf.h" -END_EXTERN_C() -#include "spprintf.h" - -#define EXEC_INPUT_BUF 4096 - -#define PHP_MIME_TYPE "application/x-httpd-php" - -/* macros */ -#define STR_PRINT(str) ((str)?(str):"") - -#ifndef MAXPATHLEN -# ifdef PATH_MAX -# define MAXPATHLEN PATH_MAX -# elif defined(MAX_PATH) -# define MAXPATHLEN MAX_PATH -# else -# define MAXPATHLEN 256 /* Should be safe for any weird systems that do not define it */ -# endif -#endif - - -/* global variables */ -#if !defined(PHP_WIN32) -#define PHP_SLEEP_NON_VOID -#define php_sleep sleep -extern char **environ; -#endif /* !defined(PHP_WIN32) */ - -#ifdef PHP_PWRITE_64 -ssize_t pwrite(int, void *, size_t, off64_t); -#endif - -#ifdef PHP_PREAD_64 -ssize_t pread(int, void *, size_t, off64_t); -#endif - -BEGIN_EXTERN_C() -void phperror(char *error); -PHPAPI int php_write(void *buf, uint size TSRMLS_DC); -PHPAPI int php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, - 2); -PHPAPI void php_log_err(char *log_message TSRMLS_DC); -int Debug(char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2); -int cfgparse(void); -END_EXTERN_C() - -#define php_error zend_error - -typedef enum { - EH_NORMAL = 0, - EH_SUPPRESS, - EH_THROW -} error_handling_t; - -BEGIN_EXTERN_C() -PHPAPI void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class TSRMLS_DC); -#define php_std_error_handling() php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC) - -PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) PHP_ATTRIBUTE_FORMAT(printf, 4, 0); - -#ifdef ZTS -#define PHP_ATTR_FMT_OFFSET 1 -#else -#define PHP_ATTR_FMT_OFFSET 0 -#endif - -/* PHPAPI void php_error(int type, const char *format, ...); */ -PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...) - PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 3, PHP_ATTR_FMT_OFFSET + 4); -PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...) - PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 4, PHP_ATTR_FMT_OFFSET + 5); -PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...) - PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 5, PHP_ATTR_FMT_OFFSET + 6); -END_EXTERN_C() - -#define php_error_docref php_error_docref0 - -#define zenderror phperror -#define zendlex phplex - -#define phpparse zendparse -#define phprestart zendrestart -#define phpin zendin - -#define php_memnstr zend_memnstr - -/* functions */ -BEGIN_EXTERN_C() -int php_register_internal_extensions(TSRMLS_D); - -int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC); - -PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userdata); - -PHPAPI void php_com_initialize(TSRMLS_D); -END_EXTERN_C() - -/* PHP-named Zend macro wrappers */ -#define PHP_FN ZEND_FN -#define PHP_MN ZEND_MN -#define PHP_NAMED_FUNCTION ZEND_NAMED_FUNCTION -#define PHP_FUNCTION ZEND_FUNCTION -#define PHP_METHOD ZEND_METHOD - -#define PHP_RAW_NAMED_FE ZEND_RAW_NAMED_FE -#define PHP_NAMED_FE ZEND_NAMED_FE -#define PHP_FE ZEND_FE -#define PHP_DEP_FE ZEND_DEP_FE -#define PHP_FALIAS ZEND_FALIAS -#define PHP_DEP_FALIAS ZEND_DEP_FALIAS -#define PHP_ME ZEND_ME -#define PHP_MALIAS ZEND_MALIAS -#define PHP_ABSTRACT_ME ZEND_ABSTRACT_ME -#define PHP_ME_MAPPING ZEND_ME_MAPPING - -#define PHP_MODULE_STARTUP_N ZEND_MODULE_STARTUP_N -#define PHP_MODULE_SHUTDOWN_N ZEND_MODULE_SHUTDOWN_N -#define PHP_MODULE_ACTIVATE_N ZEND_MODULE_ACTIVATE_N -#define PHP_MODULE_DEACTIVATE_N ZEND_MODULE_DEACTIVATE_N -#define PHP_MODULE_INFO_N ZEND_MODULE_INFO_N - -#define PHP_MODULE_STARTUP_D ZEND_MODULE_STARTUP_D -#define PHP_MODULE_SHUTDOWN_D ZEND_MODULE_SHUTDOWN_D -#define PHP_MODULE_ACTIVATE_D ZEND_MODULE_ACTIVATE_D -#define PHP_MODULE_DEACTIVATE_D ZEND_MODULE_DEACTIVATE_D -#define PHP_MODULE_INFO_D ZEND_MODULE_INFO_D - -/* Compatibility macros */ -#define PHP_MINIT ZEND_MODULE_STARTUP_N -#define PHP_MSHUTDOWN ZEND_MODULE_SHUTDOWN_N -#define PHP_RINIT ZEND_MODULE_ACTIVATE_N -#define PHP_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N -#define PHP_MINFO ZEND_MODULE_INFO_N -#define PHP_GINIT ZEND_GINIT -#define PHP_GSHUTDOWN ZEND_GSHUTDOWN - -#define PHP_MINIT_FUNCTION ZEND_MODULE_STARTUP_D -#define PHP_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D -#define PHP_RINIT_FUNCTION ZEND_MODULE_ACTIVATE_D -#define PHP_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D -#define PHP_MINFO_FUNCTION ZEND_MODULE_INFO_D -#define PHP_GINIT_FUNCTION ZEND_GINIT_FUNCTION -#define PHP_GSHUTDOWN_FUNCTION ZEND_GSHUTDOWN_FUNCTION - -#define PHP_MODULE_GLOBALS ZEND_MODULE_GLOBALS - - -/* Output support */ -#include "main/php_output.h" -#define PHPWRITE(str, str_len) php_body_write((str), (str_len) TSRMLS_CC) -#define PUTS(str) do { \ - const char *__str = (str); \ - php_body_write(__str, strlen(__str) TSRMLS_CC); \ -} while (0) - -#define PUTC(c) (php_body_write(&(c), 1 TSRMLS_CC), (c)) -#define PHPWRITE_H(str, str_len) php_header_write((str), (str_len) TSRMLS_CC) -#define PUTS_H(str) do { \ - const char *__str = (str); \ - php_header_write(__str, strlen(__str) TSRMLS_CC); \ -} while (0) - -#define PUTC_H(c) (php_header_write(&(c), 1 TSRMLS_CC), (c)) - -#include "php_streams.h" -#include "php_memory_streams.h" -#include "fopen_wrappers.h" - - -/* Virtual current working directory support */ -#include "tsrm_virtual_cwd.h" - -#include "zend_constants.h" - -/* connection status states */ -#define PHP_CONNECTION_NORMAL 0 -#define PHP_CONNECTION_ABORTED 1 -#define PHP_CONNECTION_TIMEOUT 2 - -#include "php_reentrancy.h" - -/* Finding offsets of elements within structures. - * Taken from the Apache code, which in turn, was taken from X code... - */ - -#ifndef XtOffset -#if defined(CRAY) || (defined(__arm) && !(defined(LINUX) || defined(__riscos__))) -#ifdef __STDC__ -#define XtOffset(p_type, field) _Offsetof(p_type, field) -#else -#ifdef CRAY2 -#define XtOffset(p_type, field) \ - (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) - -#else /* !CRAY2 */ - -#define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field)) - -#endif /* !CRAY2 */ -#endif /* __STDC__ */ -#else /* ! (CRAY || __arm) */ - -#define XtOffset(p_type, field) \ - ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) - -#endif /* !CRAY */ -#endif /* ! XtOffset */ - -#ifndef XtOffsetOf -#ifdef offsetof -#define XtOffsetOf(s_type, field) offsetof(s_type, field) -#else -#define XtOffsetOf(s_type, field) XtOffset(s_type*, field) -#endif -#endif /* !XtOffsetOf */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php3_compat.h b/main/php3_compat.h deleted file mode 100644 index 29b6fb98bb3e7..0000000000000 --- a/main/php3_compat.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP3_COMPAT_H -#define PHP3_COMPAT_H - -typedef zval pval; - -#define pval_copy_constructor zval_copy_ctor -#define pval_destructor zval_dtor - -#define _php3_hash_init zend_hash_init -#define _php3_hash_destroy zend_hash_destroy - -#define _php3_hash_clean zend_hash_clean - -#define _php3_hash_add_or_update zend_hash_add_or_update -#define _php3_hash_add zend_hash_add -#define _php3_hash_update zend_hash_update - -#define _php3_hash_quick_add_or_update zend_hash_quick_add_or_update -#define _php3_hash_quick_add zend_hash_quick_add -#define _php3_hash_quick_update zend_hash_quick_update - -#define _php3_hash_index_update_or_next_insert zend_hash_index_update_or_next_insert -#define _php3_hash_index_update zend_hash_index_update -#define _php3_hash_next_index_insert zend_hash_next_index_insert - -#define _php3_hash_pointer_update zend_hash_pointer_update - -#define _php3_hash_pointer_index_update_or_next_insert zend_hash_pointer_index_update_or_next_insert -#define _php3_hash_pointer_index_update zend_hash_pointer_index_update -#define _php3_hash_next_index_pointer_update zend_hash_next_index_pointer_update -#define _php3_hash_next_index_pointer_insert zend_hash_next_index_pointer_insert - -#define _php3_hash_del_key_or_index zend_hash_del_key_or_index -#define _php3_hash_del zend_hash_del -#define _php3_hash_index_del zend_hash_index_del - -#define _php3_hash_find zend_hash_find -#define _php3_hash_quick_find zend_hash_quick_find -#define _php3_hash_index_find zend_hash_index_find - -#define _php3_hash_exists zend_hash_exists -#define _php3_hash_index_exists zend_hash_index_exists -#define _php3_hash_is_pointer zend_hash_is_pointer -#define _php3_hash_index_is_pointer zend_hash_index_is_pointer -#define _php3_hash_next_free_element zend_hash_next_free_element - -#define _php3_hash_move_forward zend_hash_move_forward -#define _php3_hash_move_backwards zend_hash_move_backwards -#define _php3_hash_get_current_key zend_hash_get_current_key -#define _php3_hash_get_current_data zend_hash_get_current_data -#define _php3_hash_internal_pointer_reset zend_hash_internal_pointer_reset -#define _php3_hash_internal_pointer_end zend_hash_internal_pointer_end - -#define _php3_hash_copy zend_hash_copy -#define _php3_hash_merge zend_hash_merge -#define _php3_hash_sort zend_hash_sort -#define _php3_hash_minmax zend_hash_minmax - -#define _php3_hash_num_elements zend_hash_num_elements - -#define _php3_hash_apply zend_hash_apply -#define _php3_hash_apply_with_argument zend_hash_apply_with_argument - - -#define php3_error php_error - -#define php3_printf php_printf -#define _php3_sprintf php_sprintf - - - -#define php3_module_entry zend_module_entry - -#define php3_strndup zend_strndup -#define php3_str_tolower zend_str_tolower -#define php3_binary_strcmp zend_binary_strcmp - - -#define php3_list_insert zend_list_insert -#define php3_list_find zend_list_find -#define php3_list_delete zend_list_delete - -#define php3_plist_insert zend_plist_insert -#define php3_plist_find zend_plist_find -#define php3_plist_delete zend_plist_delete - -#define zend_print_pval zend_print_zval -#define zend_print_pval_r zend_print_zval_r - - -#define function_entry zend_function_entry - -#define _php3_addslashes php_addslashes -#define _php3_stripslashes php_stripslashes -#define php3_dl php_dl - -#define getParameters zend_get_parameters -#define getParametersArray zend_get_parameters_array - -#define list_entry zend_rsrc_list_entry - -#endif /* PHP3_COMPAT_H */ diff --git a/main/php_compat.h b/main/php_compat.h deleted file mode 100644 index 65f7572f62d5f..0000000000000 --- a/main/php_compat.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_COMPAT_H -#define PHP_COMPAT_H - -#ifdef PHP_WIN32 -#include "config.w32.h" -#else -#include -#endif - -#if defined(HAVE_BUNDLED_PCRE) || !defined(PHP_VERSION) -#define pcre_compile php_pcre_compile -#define pcre_compile2 php_pcre_compile2 -#define pcre_copy_substring php_pcre_copy_substring -#define pcre_exec php_pcre_exec -#define pcre_get_substring php_pcre_get_substring -#define pcre_get_substring_list php_pcre_get_substring_list -#define pcre_info php_pcre_info -#define pcre_maketables php_pcre_maketables -#define pcre_study php_pcre_study -#define pcre_version php_pcre_version -#define pcre_fullinfo php_pcre_fullinfo -#define pcre_free php_pcre_free -#define pcre_malloc php_pcre_malloc -#define pcre_config php_pcre_config -#define pcre_copy_named_substring php_pcre_copy_named_substring -#define pcre_free_substring php_pcre_free_substring -#define pcre_free_substring_list php_pcre_free_substring_list -#define pcre_get_named_substring php_pcre_get_named_substring -#define pcre_get_stringnumber php_pcre_get_stringnumber -#define pcre_refcount php_pcre_refcount -#define _pcre_ord2utf8 php__pcre_ord2utf8 -#define _pcre_try_flipped php__pcre_try_flipped -#define _pcre_valid_utf8 php__pcre_valid_utf8 -#define _pcre_xclass php__pcre_xclass -#define pcre_callout php_pcre_callout -#define _pcre_OP_lengths php__pcre_OP_lengths -#define _pcre_utt_names php__pcre_utt_names -#define _pcre_default_tables php__pcre_default_tables -#define pcre_get_stringtable_entries php_pcre_get_stringtable_entries -#define _pcre_is_newline php__pcre_is_newline -#define pcre_stack_free php_pcre_stack_free -#define pcre_stack_malloc php_pcre_stack_malloc -#define _pcre_utf8_table1 php__pcre_utf8_table1 -#define _pcre_utf8_table1_size php__pcre_utf8_table1_size -#define _pcre_utf8_table2 php__pcre_utf8_table2 -#define _pcre_utf8_table3 php__pcre_utf8_table3 -#define _pcre_utf8_table4 php__pcre_utf8_table4 -#define _pcre_utt php__pcre_utt -#define _pcre_utt_size php__pcre_utt_size -#define _pcre_was_newline php__pcre_was_newline -#define _pcre_ucd_records php__pcre_ucd_records -#define _pcre_ucd_stage1 php__pcre_ucd_stage1 -#define _pcre_ucd_stage2 php__pcre_ucd_stage2 -#define _pcre_ucp_gentype php__pcre_ucp_gentype -#endif - -#define lookup php_lookup -#define hashTableInit php_hashTableInit -#define hashTableDestroy php_hashTableDestroy -#define hashTableIterInit php_hashTableIterInit -#define hashTableIterNext php_hashTableIterNext - -#if defined(HAVE_LIBXML) && (defined(HAVE_XML) || defined(HAVE_XMLRPC)) && !defined(HAVE_LIBEXPAT) -#define XML_DefaultCurrent php_XML_DefaultCurrent -#define XML_ErrorString php_XML_ErrorString -#define XML_ExpatVersion php_XML_ExpatVersion -#define XML_ExpatVersionInfo php_XML_ExpatVersionInfo -#define XML_ExternalEntityParserCreate php_XML_ExternalEntityParserCreate -#define XML_GetBase php_XML_GetBase -#define XML_GetBuffer php_XML_GetBuffer -#define XML_GetCurrentByteCount php_XML_GetCurrentByteCount -#define XML_GetCurrentByteIndex php_XML_GetCurrentByteIndex -#define XML_GetCurrentColumnNumber php_XML_GetCurrentColumnNumber -#define XML_GetCurrentLineNumber php_XML_GetCurrentLineNumber -#define XML_GetErrorCode php_XML_GetErrorCode -#define XML_GetIdAttributeIndex php_XML_GetIdAttributeIndex -#define XML_GetInputContext php_XML_GetInputContext -#define XML_GetSpecifiedAttributeCount php_XML_GetSpecifiedAttributeCount -#define XmlGetUtf16InternalEncodingNS php_XmlGetUtf16InternalEncodingNS -#define XmlGetUtf16InternalEncoding php_XmlGetUtf16InternalEncoding -#define XmlGetUtf8InternalEncodingNS php_XmlGetUtf8InternalEncodingNS -#define XmlGetUtf8InternalEncoding php_XmlGetUtf8InternalEncoding -#define XmlInitEncoding php_XmlInitEncoding -#define XmlInitEncodingNS php_XmlInitEncodingNS -#define XmlInitUnknownEncoding php_XmlInitUnknownEncoding -#define XmlInitUnknownEncodingNS php_XmlInitUnknownEncodingNS -#define XML_ParseBuffer php_XML_ParseBuffer -#define XML_Parse php_XML_Parse -#define XML_ParserCreate_MM php_XML_ParserCreate_MM -#define XML_ParserCreateNS php_XML_ParserCreateNS -#define XML_ParserCreate php_XML_ParserCreate -#define XML_ParserFree php_XML_ParserFree -#define XmlParseXmlDecl php_XmlParseXmlDecl -#define XmlParseXmlDeclNS php_XmlParseXmlDeclNS -#define XmlPrologStateInitExternalEntity php_XmlPrologStateInitExternalEntity -#define XmlPrologStateInit php_XmlPrologStateInit -#define XML_SetAttlistDeclHandler php_XML_SetAttlistDeclHandler -#define XML_SetBase php_XML_SetBase -#define XML_SetCdataSectionHandler php_XML_SetCdataSectionHandler -#define XML_SetCharacterDataHandler php_XML_SetCharacterDataHandler -#define XML_SetCommentHandler php_XML_SetCommentHandler -#define XML_SetDefaultHandlerExpand php_XML_SetDefaultHandlerExpand -#define XML_SetDefaultHandler php_XML_SetDefaultHandler -#define XML_SetDoctypeDeclHandler php_XML_SetDoctypeDeclHandler -#define XML_SetElementDeclHandler php_XML_SetElementDeclHandler -#define XML_SetElementHandler php_XML_SetElementHandler -#define XML_SetEncoding php_XML_SetEncoding -#define XML_SetEndCdataSectionHandler php_XML_SetEndCdataSectionHandler -#define XML_SetEndDoctypeDeclHandler php_XML_SetEndDoctypeDeclHandler -#define XML_SetEndElementHandler php_XML_SetEndElementHandler -#define XML_SetEndNamespaceDeclHandler php_XML_SetEndNamespaceDeclHandler -#define XML_SetEntityDeclHandler php_XML_SetEntityDeclHandler -#define XML_SetExternalEntityRefHandlerArg php_XML_SetExternalEntityRefHandlerArg -#define XML_SetExternalEntityRefHandler php_XML_SetExternalEntityRefHandler -#define XML_SetNamespaceDeclHandler php_XML_SetNamespaceDeclHandler -#define XML_SetNotationDeclHandler php_XML_SetNotationDeclHandler -#define XML_SetNotStandaloneHandler php_XML_SetNotStandaloneHandler -#define XML_SetParamEntityParsing php_XML_SetParamEntityParsing -#define XML_SetProcessingInstructionHandler php_XML_SetProcessingInstructionHandler -#define XML_SetReturnNSTriplet php_XML_SetReturnNSTriplet -#define XML_SetStartCdataSectionHandler php_XML_SetStartCdataSectionHandler -#define XML_SetStartDoctypeDeclHandler php_XML_SetStartDoctypeDeclHandler -#define XML_SetStartElementHandler php_XML_SetStartElementHandler -#define XML_SetStartNamespaceDeclHandler php_XML_SetStartNamespaceDeclHandler -#define XML_SetUnknownEncodingHandler php_XML_SetUnknownEncodingHandler -#define XML_SetUnparsedEntityDeclHandler php_XML_SetUnparsedEntityDeclHandler -#define XML_SetUserData php_XML_SetUserData -#define XML_SetXmlDeclHandler php_XML_SetXmlDeclHandler -#define XmlSizeOfUnknownEncoding php_XmlSizeOfUnknownEncoding -#define XML_UseParserAsHandlerArg php_XML_UseParserAsHandlerArg -#define XmlUtf16Encode php_XmlUtf16Encode -#define XmlUtf8Encode php_XmlUtf8Encode -#define XML_FreeContentModel php_XML_FreeContentModel -#define XML_MemMalloc php_XML_MemMalloc -#define XML_MemRealloc php_XML_MemRealloc -#define XML_MemFree php_XML_MemFree -#define XML_UseForeignDTD php_XML_UseForeignDTD -#define XML_GetFeatureList php_XML_GetFeatureList -#define XML_ParserReset php_XML_ParserReset - -#ifdef HAVE_GD_BUNDLED -#define any2eucjp php_gd_any2eucjp -#define createwbmp php_gd_createwbmp -#define empty_output_buffer php_gd_empty_output_buffer -#define fill_input_buffer php_gd_fill_input_buffer -#define freewbmp php_gd_freewbmp -#define gdAlphaBlend php_gd_gdAlphaBlend -#define gdCompareInt php_gd_gdCompareInt -#define gdCosT php_gd_gdCosT -#define gdCtxPrintf php_gd_gdCtxPrintf -#define gdDPExtractData php_gd_gdDPExtractData -#define gdFontGetGiant php_gd_gdFontGetGiant -#define gdFontGetLarge php_gd_gdFontGetLarge -#define gdFontGetMediumBold php_gd_gdFontGetMediumBold -#define gdFontGetSmall php_gd_gdFontGetSmall -#define gdFontGetTiny php_gd_gdFontGetTiny -#define gdFontGiant php_gd_gdFontGiant -#define gdFontGiantData php_gd_gdFontGiantData -#define gdFontGiantRep php_gd_gdFontGiantRep -#define gdFontLarge php_gd_gdFontLarge -#define gdFontLargeData php_gd_gdFontLargeData -#define gdFontLargeRep php_gd_gdFontLargeRep -#define gdFontMediumBold php_gd_gdFontMediumBold -#define gdFontMediumBoldData php_gd_gdFontMediumBoldData -#define gdFontMediumBoldRep php_gd_gdFontMediumBoldRep -#define gdFontSmall php_gd_gdFontSmall -#define gdFontSmallData php_gd_gdFontSmallData -#define gdFontSmallRep php_gd_gdFontSmallRep -#define gdFontTiny php_gd_gdFontTiny -#define gdFontTinyData php_gd_gdFontTinyData -#define gdFontTinyRep php_gd_gdFontTinyRep -#define gdGetBuf php_gd_gdGetBuf -#define gdGetByte php_gd_gdGetByte -#define gdGetC php_gd_gdGetC -#define _gdGetColors php_gd__gdGetColors -#define gd_getin php_gd_gd_getin -#define gdGetInt php_gd_gdGetInt -#define gdGetWord php_gd_gdGetWord -#define gdImageAABlend php_gd_gdImageAABlend -#define gdImageAALine php_gd_gdImageAALine -#define gdImageAlphaBlending php_gd_gdImageAlphaBlending -#define gdImageAntialias php_gd_gdImageAntialias -#define gdImageArc php_gd_gdImageArc -#define gdImageBrightness php_gd_gdImageBrightness -#define gdImageChar php_gd_gdImageChar -#define gdImageCharUp php_gd_gdImageCharUp -#define gdImageColor php_gd_gdImageColor -#define gdImageColorAllocate php_gd_gdImageColorAllocate -#define gdImageColorAllocateAlpha php_gd_gdImageColorAllocateAlpha -#define gdImageColorClosest php_gd_gdImageColorClosest -#define gdImageColorClosestAlpha php_gd_gdImageColorClosestAlpha -#define gdImageColorClosestHWB php_gd_gdImageColorClosestHWB -#define gdImageColorDeallocate php_gd_gdImageColorDeallocate -#define gdImageColorExact php_gd_gdImageColorExact -#define gdImageColorExactAlpha php_gd_gdImageColorExactAlpha -#define gdImageColorMatch php_gd_gdImageColorMatch -#define gdImageColorResolve php_gd_gdImageColorResolve -#define gdImageColorResolveAlpha php_gd_gdImageColorResolveAlpha -#define gdImageColorTransparent php_gd_gdImageColorTransparent -#define gdImageCompare php_gd_gdImageCompare -#define gdImageContrast php_gd_gdImageContrast -#define gdImageConvolution php_gd_gdImageConvolution -#define gdImageCopy php_gd_gdImageCopy -#define gdImageCopyMerge php_gd_gdImageCopyMerge -#define gdImageCopyMergeGray php_gd_gdImageCopyMergeGray -#define gdImageCopyResampled php_gd_gdImageCopyResampled -#define gdImageCopyResized php_gd_gdImageCopyResized -#define gdImageCreate php_gd_gdImageCreate -#define gdImageCreateFromGd php_gd_gdImageCreateFromGd -#define gdImageCreateFromGd2 php_gd_gdImageCreateFromGd2 -#define gdImageCreateFromGd2Ctx php_gd_gdImageCreateFromGd2Ctx -#define gdImageCreateFromGd2Part php_gd_gdImageCreateFromGd2Part -#define gdImageCreateFromGd2PartCtx php_gd_gdImageCreateFromGd2PartCtx -#define gdImageCreateFromGd2PartPtr php_gd_gdImageCreateFromGd2PartPtr -#define gdImageCreateFromGd2Ptr php_gd_gdImageCreateFromGd2Ptr -#define gdImageCreateFromGdCtx php_gd_gdImageCreateFromGdCtx -#define gdImageCreateFromGdPtr php_gd_gdImageCreateFromGdPtr -#define gdImageCreateFromGif php_gd_gdImageCreateFromGif -#define gdImageCreateFromGifCtx php_gd_gdImageCreateFromGifCtx -#define gdImageCreateFromGifSource php_gd_gdImageCreateFromGifSource -#define gdImageCreateFromJpeg php_gd_gdImageCreateFromJpeg -#define gdImageCreateFromJpegCtx php_gd_gdImageCreateFromJpegCtx -#define gdImageCreateFromJpegPtr php_gd_gdImageCreateFromJpegPtr -#define gdImageCreateFromPng php_gd_gdImageCreateFromPng -#define gdImageCreateFromPngCtx php_gd_gdImageCreateFromPngCtx -#define gdImageCreateFromPngPtr php_gd_gdImageCreateFromPngPtr -#define gdImageCreateFromPngSource php_gd_gdImageCreateFromPngSource -#define gdImageCreateFromWBMP php_gd_gdImageCreateFromWBMP -#define gdImageCreateFromWBMPCtx php_gd_gdImageCreateFromWBMPCtx -#define gdImageCreateFromWBMPPtr php_gd_gdImageCreateFromWBMPPtr -#define gdImageCreateFromXbm php_gd_gdImageCreateFromXbm -#define gdImageCreatePaletteFromTrueColor php_gd_gdImageCreatePaletteFromTrueColor -#define gdImageCreateTrueColor php_gd_gdImageCreateTrueColor -#define gdImageDashedLine php_gd_gdImageDashedLine -#define gdImageDestroy php_gd_gdImageDestroy -#define gdImageEdgeDetectQuick php_gd_gdImageEdgeDetectQuick -#define gdImageEllipse php_gd_gdImageEllipse -#define gdImageEmboss php_gd_gdImageEmboss -#define gdImageFill php_gd_gdImageFill -#define gdImageFilledArc php_gd_gdImageFilledArc -#define gdImageFilledEllipse php_gd_gdImageFilledEllipse -#define gdImageFilledPolygon php_gd_gdImageFilledPolygon -#define gdImageFilledRectangle php_gd_gdImageFilledRectangle -#define _gdImageFillTiled php_gd__gdImageFillTiled -#define gdImageFillToBorder php_gd_gdImageFillToBorder -#define gdImageGaussianBlur php_gd_gdImageGaussianBlur -#define gdImageGd php_gd_gdImageGd -#define gdImageGd2 php_gd_gdImageGd2 -#define gdImageGd2Ptr php_gd_gdImageGd2Ptr -#define gdImageGdPtr php_gd_gdImageGdPtr -#define gdImageGetClip php_gd_gdImageGetClip -#define gdImageGetPixel php_gd_gdImageGetPixel -#define gdImageGetTrueColorPixel php_gd_gdImageGetTrueColorPixel -#define gdImageGif php_gd_gdImageGif -#define gdImageGifCtx php_gd_gdImageGifCtx -#define gdImageGifPtr php_gd_gdImageGifPtr -#define gdImageGrayScale php_gd_gdImageGrayScale -#define gdImageInterlace php_gd_gdImageInterlace -#define gdImageJpeg php_gd_gdImageJpeg -#define gdImageJpegCtx php_gd_gdImageJpegCtx -#define gdImageJpegPtr php_gd_gdImageJpegPtr -#define gdImageLine php_gd_gdImageLine -#define gdImageMeanRemoval php_gd_gdImageMeanRemoval -#define gdImageNegate php_gd_gdImageNegate -#define gdImagePaletteCopy php_gd_gdImagePaletteCopy -#define gdImagePng php_gd_gdImagePng -#define gdImagePngCtx php_gd_gdImagePngCtx -#define gdImagePngCtxEx php_gd_gdImagePngCtxEx -#define gdImagePngEx php_gd_gdImagePngEx -#define gdImagePngPtr php_gd_gdImagePngPtr -#define gdImagePngPtrEx php_gd_gdImagePngPtrEx -#define gdImagePngToSink php_gd_gdImagePngToSink -#define gdImagePolygon php_gd_gdImagePolygon -#define gdImageRectangle php_gd_gdImageRectangle -#define gdImageRotate php_gd_gdImageRotate -#define gdImageRotate180 php_gd_gdImageRotate180 -#define gdImageRotate270 php_gd_gdImageRotate270 -#define gdImageRotate45 php_gd_gdImageRotate45 -#define gdImageRotate90 php_gd_gdImageRotate90 -#define gdImageSaveAlpha php_gd_gdImageSaveAlpha -#define gdImageSelectiveBlur php_gd_gdImageSelectiveBlur -#define gdImageSetAntiAliased php_gd_gdImageSetAntiAliased -#define gdImageSetAntiAliasedDontBlend php_gd_gdImageSetAntiAliasedDontBlend -#define gdImageSetBrush php_gd_gdImageSetBrush -#define gdImageSetClip php_gd_gdImageSetClip -#define gdImageSetPixel php_gd_gdImageSetPixel -#define gdImageSetStyle php_gd_gdImageSetStyle -#define gdImageSetThickness php_gd_gdImageSetThickness -#define gdImageSetTile php_gd_gdImageSetTile -#define gdImageSkewX php_gd_gdImageSkewX -#define gdImageSkewY php_gd_gdImageSkewY -#define gdImageSmooth php_gd_gdImageSmooth -#define gdImageString php_gd_gdImageString -#define gdImageString16 php_gd_gdImageString16 -#define gdImageStringFT php_gd_gdImageStringFT -#define gdImageStringFTEx php_gd_gdImageStringFTEx -#define gdImageStringTTF php_gd_gdImageStringTTF -#define gdImageStringUp php_gd_gdImageStringUp -#define gdImageStringUp16 php_gd_gdImageStringUp16 -#define gdImageTrueColorToPalette php_gd_gdImageTrueColorToPalette -#define gdImageWBMP php_gd_gdImageWBMP -#define gdImageWBMPCtx php_gd_gdImageWBMPCtx -#define gdImageWBMPPtr php_gd_gdImageWBMPPtr -#define gdImageXbmCtx php_gd_gdImageXbmCtx -#define gdNewDynamicCtx php_gd_gdNewDynamicCtx -#define gdNewDynamicCtxEx php_gd_gdNewDynamicCtxEx -#define gdNewFileCtx php_gd_gdNewFileCtx -#define gdNewSSCtx php_gd_gdNewSSCtx -#define gdPutBuf php_gd_gdPutBuf -#define gdPutC php_gd_gdPutC -#define _gdPutColors php_gd__gdPutColors -#define gdPutInt php_gd_gdPutInt -#define gd_putout php_gd_gd_putout -#define gdPutWord php_gd_gdPutWord -#define gdSeek php_gd_gdSeek -#define gdSinT php_gd_gdSinT -#define gd_strtok_r php_gd_gd_strtok_r -#define gdTell php_gd_gdTell -#define getmbi php_gd_getmbi -#define init_destination php_gd_init_destination -#define init_source php_gd_init_source -#define jpeg_gdIOCtx_dest php_gd_jpeg_gdIOCtx_dest -#define jpeg_gdIOCtx_src php_gd_jpeg_gdIOCtx_src -#define lsqrt php_gd_lsqrt -#define printwbmp php_gd_printwbmp -#define Putchar php_gd_Putchar -#define putmbi php_gd_putmbi -#define Putword php_gd_Putword -#define readwbmp php_gd_readwbmp -#define skipheader php_gd_skipheader -#define skip_input_data php_gd_skip_input_data -#define term_destination php_gd_term_destination -#define term_source php_gd_term_source -#define writewbmp php_gd_writewbmp -#define ZeroDataBlock php_gd_ZeroDataBlock -#define gdCacheCreate php_gd_gdCacheCreate -#define gdCacheDelete php_gd_gdCacheDelete -#define gdCacheGet php_gd_gdCacheGet -#define gdFontCacheSetup php_gd_gdFontCacheSetup -#define gdFontCacheShutdown php_gd_gdFontCacheShutdown -#define gdFreeFontCache php_gd_gdFreeFontCache -#endif /* HAVE_GD_BUNDLED */ - -/* Define to specify how much context to retain around the current parse - point. */ -#define XML_CONTEXT_BYTES 1024 - -/* Define to make parameter entity parsing functionality available. */ -#define XML_DTD 1 - -/* Define to make XML Namespaces functionality available. */ -#define XML_NS 1 -#endif - -#ifdef PHP_EXPORTS -#define PCRE_STATIC -#endif - -#endif diff --git a/main/php_content_types.c b/main/php_content_types.c deleted file mode 100644 index a1daebafd93bf..0000000000000 --- a/main/php_content_types.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "SAPI.h" -#include "rfc1867.h" - -#include "php_content_types.h" - -/* {{{ php_post_entries[] - */ -static sapi_post_entry php_post_entries[] = { - { DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_std_post_handler }, - { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler }, - { NULL, 0, NULL, NULL } -}; -/* }}} */ - -/* {{{ SAPI_POST_READER_FUNC - */ -SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader) -{ - char *data; - int length; - - /* $HTTP_RAW_POST_DATA registration */ - if (!strcmp(SG(request_info).request_method, "POST")) { - if (NULL == SG(request_info).post_entry) { - /* no post handler registered, so we just swallow the data */ - sapi_read_standard_form_data(TSRMLS_C); - } - - /* For unknown content types we create HTTP_RAW_POST_DATA even if always_populate_raw_post_data off, - * this is in-effecient, but we need to keep doing it for BC reasons (for now) */ - if ((PG(always_populate_raw_post_data) || NULL == SG(request_info).post_entry) && SG(request_info).post_data) { - length = SG(request_info).post_data_length; - data = estrndup(SG(request_info).post_data, length); - SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, length); - } - } - - /* for php://input stream: - some post handlers modify the content of request_info.post_data - so for now we need a copy for the php://input stream - in the long run post handlers should be changed to not touch - request_info.post_data for memory preservation reasons - */ - if (SG(request_info).post_data) { - SG(request_info).raw_post_data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length); - SG(request_info).raw_post_data_length = SG(request_info).post_data_length; - } -} -/* }}} */ - -/* {{{ php_startup_sapi_content_types - */ -int php_startup_sapi_content_types(TSRMLS_D) -{ - sapi_register_default_post_reader(php_default_post_reader); - sapi_register_treat_data(php_default_treat_data); - sapi_register_input_filter(php_default_input_filter); - return SUCCESS; -} -/* }}} */ - -/* {{{ php_setup_sapi_content_types - */ -int php_setup_sapi_content_types(TSRMLS_D) -{ - sapi_register_post_entries(php_post_entries TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_content_types.h b/main/php_content_types.h deleted file mode 100644 index db3ce3cfc15f4..0000000000000 --- a/main/php_content_types.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_CONTENT_TYPES_H -#define PHP_CONTENT_TYPES_H - -#define DEFAULT_POST_CONTENT_TYPE "application/x-www-form-urlencoded" - -SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader); -SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler); -int php_startup_sapi_content_types(TSRMLS_D); -int php_setup_sapi_content_types(TSRMLS_D); - -#endif /* PHP_CONTENT_TYPES_H */ diff --git a/main/php_globals.h b/main/php_globals.h deleted file mode 100644 index 78558f847a86f..0000000000000 --- a/main/php_globals.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_GLOBALS_H -#define PHP_GLOBALS_H - -#include "zend_globals.h" - -typedef struct _php_core_globals php_core_globals; - -#ifdef ZTS -# define PG(v) TSRMG(core_globals_id, php_core_globals *, v) -extern PHPAPI int core_globals_id; -#else -# define PG(v) (core_globals.v) -extern ZEND_API struct _php_core_globals core_globals; -#endif - -/* Error display modes */ -#define PHP_DISPLAY_ERRORS_STDOUT 1 -#define PHP_DISPLAY_ERRORS_STDERR 2 - -/* Track vars */ -#define TRACK_VARS_POST 0 -#define TRACK_VARS_GET 1 -#define TRACK_VARS_COOKIE 2 -#define TRACK_VARS_SERVER 3 -#define TRACK_VARS_ENV 4 -#define TRACK_VARS_FILES 5 -#define TRACK_VARS_REQUEST 6 - -struct _php_tick_function_entry; - -typedef struct _arg_separators { - char *output; - char *input; -} arg_separators; - -struct _php_core_globals { - zend_bool magic_quotes_gpc; - zend_bool magic_quotes_runtime; - zend_bool magic_quotes_sybase; - - zend_bool safe_mode; - - zend_bool allow_call_time_pass_reference; - zend_bool implicit_flush; - - long output_buffering; - - char *safe_mode_include_dir; - zend_bool safe_mode_gid; - zend_bool sql_safe_mode; - zend_bool enable_dl; - - char *output_handler; - - char *unserialize_callback_func; - long serialize_precision; - - char *safe_mode_exec_dir; - - long memory_limit; - long max_input_time; - - zend_bool track_errors; - zend_bool display_errors; - zend_bool display_startup_errors; - zend_bool log_errors; - long log_errors_max_len; - zend_bool ignore_repeated_errors; - zend_bool ignore_repeated_source; - zend_bool report_memleaks; - char *error_log; - - char *doc_root; - char *user_dir; - char *include_path; - char *open_basedir; - char *extension_dir; - - char *upload_tmp_dir; - long upload_max_filesize; - - char *error_append_string; - char *error_prepend_string; - - char *auto_prepend_file; - char *auto_append_file; - - arg_separators arg_separator; - - char *variables_order; - - HashTable rfc1867_protected_variables; - - short connection_status; - short ignore_user_abort; - - unsigned char header_is_being_sent; - - zend_llist tick_functions; - - zval *http_globals[6]; - - zend_bool expose_php; - - zend_bool register_globals; - zend_bool register_long_arrays; - zend_bool register_argc_argv; - zend_bool auto_globals_jit; - - zend_bool y2k_compliance; - - char *docref_root; - char *docref_ext; - - zend_bool html_errors; - zend_bool xmlrpc_errors; - - long xmlrpc_error_number; - - zend_bool activated_auto_globals[8]; - - zend_bool modules_activated; - zend_bool file_uploads; - zend_bool during_request_startup; - zend_bool allow_url_fopen; - zend_bool always_populate_raw_post_data; - zend_bool report_zend_debug; - - int last_error_type; - char *last_error_message; - char *last_error_file; - int last_error_lineno; - error_handling_t error_handling; - zend_class_entry *exception_class; - - char *disable_functions; - char *disable_classes; - zend_bool allow_url_include; -#ifdef PHP_WIN32 - zend_bool com_initialized; -#endif - long max_input_nesting_level; - zend_bool in_user_include; -}; - - -#endif /* PHP_GLOBALS_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/php_ini.c b/main/php_ini.c deleted file mode 100644 index 8b51884d79b95..0000000000000 --- a/main/php_ini.c +++ /dev/null @@ -1,697 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/info.h" -#include "zend_ini.h" -#include "php_ini.h" -#include "ext/standard/dl.h" -#include "zend_extensions.h" -#include "zend_highlight.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_scandir.h" -#ifdef PHP_WIN32 -#include "win32/php_registry.h" -#endif - -#if HAVE_SCANDIR && HAVE_ALPHASORT && HAVE_DIRENT_H -#include -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif - -typedef struct _php_extension_lists { - zend_llist engine; - zend_llist functions; -} php_extension_lists; - - -/* True globals */ -static HashTable configuration_hash; -PHPAPI char *php_ini_opened_path=NULL; -static php_extension_lists extension_lists; -PHPAPI char *php_ini_scanned_path=NULL; -PHPAPI char *php_ini_scanned_files=NULL; - -/* {{{ php_ini_displayer_cb - */ -static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type) -{ - if (ini_entry->displayer) { - ini_entry->displayer(ini_entry, type); - } else { - char *display_string; - uint display_string_length, esc_html=0; - TSRMLS_FETCH(); - - if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - if (ini_entry->orig_value && ini_entry->orig_value[0]) { - display_string = ini_entry->orig_value; - display_string_length = ini_entry->orig_value_length; - esc_html = !sapi_module.phpinfo_as_text; - } else { - if (!sapi_module.phpinfo_as_text) { - display_string = "no value"; - display_string_length = sizeof("no value") - 1; - } else { - display_string = "no value"; - display_string_length = sizeof("no value") - 1; - } - } - } else if (ini_entry->value && ini_entry->value[0]) { - display_string = ini_entry->value; - display_string_length = ini_entry->value_length; - esc_html = !sapi_module.phpinfo_as_text; - } else { - if (!sapi_module.phpinfo_as_text) { - display_string = "no value"; - display_string_length = sizeof("no value") - 1; - } else { - display_string = "no value"; - display_string_length = sizeof("no value") - 1; - } - } - - if (esc_html) { - php_html_puts(display_string, display_string_length TSRMLS_CC); - } else { - PHPWRITE(display_string, display_string_length); - } - } -} -/* }}} */ - -/* {{{ php_ini_displayer - */ -static int php_ini_displayer(zend_ini_entry *ini_entry, int module_number TSRMLS_DC) -{ - if (ini_entry->module_number != module_number) { - return 0; - } - if (!sapi_module.phpinfo_as_text) { - PUTS(""); - PUTS(""); - PHPWRITE(ini_entry->name, ini_entry->name_length - 1); - PUTS(""); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE); - PUTS(""); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG); - PUTS("\n"); - } else { - PHPWRITE(ini_entry->name, ini_entry->name_length - 1); - PUTS(" => "); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE); - PUTS(" => "); - php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG); - PUTS("\n"); - } - return 0; -} -/* }}} */ - -/* {{{ display_ini_entries - */ -PHPAPI void display_ini_entries(zend_module_entry *module) -{ - int module_number; - TSRMLS_FETCH(); - - if (module) { - module_number = module->module_number; - } else { - module_number = 0; - } - php_info_print_table_start(); - php_info_print_table_header(3, "Directive", "Local Value", "Master Value"); - zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (zend_intptr_t) module_number TSRMLS_CC); - php_info_print_table_end(); -} -/* }}} */ - -/* php.ini support */ - -#ifdef ZTS -# if (ZEND_DEBUG) -# define ZEND_EXTENSION_TOKEN "zend_extension_debug_ts" -# else -# define ZEND_EXTENSION_TOKEN "zend_extension_ts" -# endif -#else -# if (ZEND_DEBUG) -# define ZEND_EXTENSION_TOKEN "zend_extension_debug" -# else -# define ZEND_EXTENSION_TOKEN "zend_extension" -# endif -#endif - -/* {{{ php_config_ini_parser_cb - */ -static void php_config_ini_parser_cb(zval *arg1, zval *arg2, int callback_type, void *arg) -{ - switch (callback_type) { - case ZEND_INI_PARSER_ENTRY: { - zval *entry; - - if (!arg2) { - break; - } - if (!strcasecmp(Z_STRVAL_P(arg1), "extension")) { /* load function module */ - zval copy; - - copy = *arg2; - zval_copy_ctor(©); - copy.refcount = 0; - zend_llist_add_element(&extension_lists.functions, ©); - } else if (!strcasecmp(Z_STRVAL_P(arg1), ZEND_EXTENSION_TOKEN)) { /* load Zend extension */ - char *extension_name = estrndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)); - - zend_llist_add_element(&extension_lists.engine, &extension_name); - } else { - zend_hash_update(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, arg2, sizeof(zval), (void **) &entry); - Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry)); - } - } - break; - - case ZEND_INI_PARSER_POP_ENTRY: { - zval *hash; - zval **find_hash; - zval *element; - - if (!arg2) { - /* bare string - nothing to do */ - break; - } - - if (zend_hash_find(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, (void **) &find_hash) == FAILURE) { - ALLOC_ZVAL(hash); - array_init(hash); - - zend_hash_update(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, &hash, sizeof(zval *), NULL); - } else { - hash = *find_hash; - } - - ALLOC_ZVAL(element); - *element = *arg2; - zval_copy_ctor(element); - INIT_PZVAL(element); - add_next_index_zval(hash, element); - } - break; - - case ZEND_INI_PARSER_SECTION: - break; - } -} -/* }}} */ - -/* {{{ php_load_function_extension_cb - */ -static void php_load_function_extension_cb(void *arg TSRMLS_DC) -{ - zval *extension = (zval *) arg; - zval zval; - - php_dl(extension, MODULE_PERSISTENT, &zval, 0 TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_load_zend_extension_cb - */ -static void php_load_zend_extension_cb(void *arg TSRMLS_DC) -{ - zend_load_extension(*((char **) arg)); -} -/* }}} */ - -/* {{{ pvalue_config_destructor - */ -static void pvalue_config_destructor(zval *pvalue) -{ - if (Z_TYPE_P(pvalue) == IS_STRING) { - free(Z_STRVAL_P(pvalue)); - } -} -/* }}} */ - -/* {{{ php_init_config - */ -int php_init_config(TSRMLS_D) -{ - char *php_ini_file_name = NULL; - char *php_ini_search_path = NULL; - int php_ini_scanned_path_len; - int safe_mode_state; - char *open_basedir; - int free_ini_search_path = 0; - zend_file_handle fh; - struct stat sb; - char ini_file[MAXPATHLEN]; - char *p; - zend_llist scanned_ini_list; - int l, total_l=0; - zend_llist_element *element; - - if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1) == FAILURE) { - return FAILURE; - } - - if (sapi_module.ini_defaults) { - sapi_module.ini_defaults(&configuration_hash); - } - - zend_llist_init(&extension_lists.engine, sizeof(char *), (llist_dtor_func_t) free_estring, 1); - zend_llist_init(&extension_lists.functions, sizeof(zval), (llist_dtor_func_t) ZVAL_DESTRUCTOR, 1); - zend_llist_init(&scanned_ini_list, sizeof(char *), (llist_dtor_func_t) free_estring, 1); - - safe_mode_state = PG(safe_mode); - open_basedir = PG(open_basedir); - - if (sapi_module.php_ini_path_override) { - php_ini_file_name = sapi_module.php_ini_path_override; - php_ini_search_path = sapi_module.php_ini_path_override; - free_ini_search_path = 0; - } else if (!sapi_module.php_ini_ignore) { - int search_path_size; - char *default_location; - char *env_location; - char *binary_location; - static const char paths_separator[] = { ZEND_PATHS_SEPARATOR, 0 }; -#ifdef PHP_WIN32 - char *reg_location; -#endif - - env_location = getenv("PHPRC"); - if (!env_location) { - env_location = ""; - } - - /* - * Prepare search path - */ - - search_path_size = MAXPATHLEN * 4 + strlen(env_location) + 3 + 1; - php_ini_search_path = (char *) emalloc(search_path_size); - free_ini_search_path = 1; - php_ini_search_path[0] = 0; - - /* Add environment location */ - if (env_location[0]) { - if (*php_ini_search_path) { - strlcat(php_ini_search_path, paths_separator, search_path_size); - } - strlcat(php_ini_search_path, env_location, search_path_size); - php_ini_file_name = env_location; - } - -#ifdef PHP_WIN32 - /* Add registry location */ - reg_location = GetIniPathFromRegistry(); - if (reg_location != NULL) { - if (*php_ini_search_path) { - strlcat(php_ini_search_path, paths_separator, search_path_size); - } - strlcat(php_ini_search_path, reg_location, search_path_size); - efree(reg_location); - } -#endif - - /* Add cwd (not with CLI) */ - if (strcmp(sapi_module.name, "cli") != 0) { - if (*php_ini_search_path) { - strlcat(php_ini_search_path, paths_separator, search_path_size); - } - strlcat(php_ini_search_path, ".", search_path_size); - } - - /* Add binary directory */ -#ifdef PHP_WIN32 - binary_location = (char *) emalloc(MAXPATHLEN); - if (GetModuleFileName(0, binary_location, MAXPATHLEN) == 0) { - efree(binary_location); - binary_location = NULL; - } -#else - if (sapi_module.executable_location) { - binary_location = (char *)emalloc(MAXPATHLEN); - if (!strchr(sapi_module.executable_location, '/')) { - char *envpath, *path; - int found = 0; - - if ((envpath = getenv("PATH")) != NULL) { - char *search_dir, search_path[MAXPATHLEN]; - char *last; - - path = estrdup(envpath); - search_dir = php_strtok_r(path, ":", &last); - - while (search_dir) { - snprintf(search_path, MAXPATHLEN, "%s/%s", search_dir, sapi_module.executable_location); - if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK)) { - found = 1; - break; - } - search_dir = php_strtok_r(NULL, ":", &last); - } - efree(path); - } - if (!found) { - efree(binary_location); - binary_location = NULL; - } - } else if (!VCWD_REALPATH(sapi_module.executable_location, binary_location) || VCWD_ACCESS(binary_location, X_OK)) { - efree(binary_location); - binary_location = NULL; - } - } else { - binary_location = NULL; - } -#endif - if (binary_location) { - char *separator_location = strrchr(binary_location, DEFAULT_SLASH); - - if (separator_location && separator_location != binary_location) { - *(separator_location) = 0; - } - if (*php_ini_search_path) { - strlcat(php_ini_search_path, paths_separator, search_path_size); - } - strlcat(php_ini_search_path, binary_location, search_path_size); - efree(binary_location); - } - - /* Add default location */ -#ifdef PHP_WIN32 - default_location = (char *) emalloc(MAXPATHLEN + 1); - - if (0 < GetWindowsDirectory(default_location, MAXPATHLEN)) { - if (*php_ini_search_path) { - strlcat(php_ini_search_path, paths_separator, search_path_size); - } - strlcat(php_ini_search_path, default_location, search_path_size); - } - efree(default_location); - - { - /* For people running under terminal services, GetWindowsDirectory will - * return their personal Windows directory, so lets add the system - * windows directory too */ - typedef UINT (WINAPI *get_system_windows_directory_func)(char *buffer, UINT size); - static get_system_windows_directory_func get_system_windows_directory = NULL; - HMODULE kern; - - if (get_system_windows_directory == NULL) { - kern = LoadLibrary("kernel32.dll"); - if (kern) { - get_system_windows_directory = (get_system_windows_directory_func)GetProcAddress(kern, "GetSystemWindowsDirectoryA"); - } - } - if (get_system_windows_directory != NULL) { - default_location = (char *) emalloc(MAXPATHLEN + 1); - if (0 < get_system_windows_directory(default_location, MAXPATHLEN)) { - if (*php_ini_search_path) { - strlcat(php_ini_search_path, paths_separator, search_path_size); - } - strlcat(php_ini_search_path, default_location, search_path_size); - } - efree(default_location); - } - } -#else - default_location = PHP_CONFIG_FILE_PATH; - if (*php_ini_search_path) { - strlcat(php_ini_search_path, paths_separator, search_path_size); - } - strlcat(php_ini_search_path, default_location, search_path_size); -#endif - } - - PG(safe_mode) = 0; - PG(open_basedir) = NULL; - - /* - * Find and open actual ini file - */ - - memset(&fh, 0, sizeof(fh)); - - /* If SAPI does not want to ignore all ini files OR an overriding file/path is given. - * This allows disabling scanning for ini files in the PHP_CONFIG_FILE_SCAN_DIR but still - * load an optional ini file. */ - if (!sapi_module.php_ini_ignore || sapi_module.php_ini_path_override) { - - /* Check if php_ini_file_name is a file and can be opened */ - if (php_ini_file_name && php_ini_file_name[0]) { - struct stat statbuf; - - if (!VCWD_STAT(php_ini_file_name, &statbuf)) { - if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) { - fh.handle.fp = VCWD_FOPEN(php_ini_file_name, "r"); - if (fh.handle.fp) { - fh.filename = php_ini_opened_path = expand_filepath(php_ini_file_name, NULL TSRMLS_CC); - } - } - } - } - - /* Otherwise search for php-%sapi-module-name%.ini file in search path */ - if (!fh.handle.fp) { - const char *fmt = "php-%s.ini"; - char *ini_fname; - spprintf(&ini_fname, 0, fmt, sapi_module.name); - fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); - efree(ini_fname); - if (fh.handle.fp) { - fh.filename = php_ini_opened_path; - } - } - - /* If still no ini file found, search for php.ini file in search path */ - if (!fh.handle.fp) { - fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); - if (fh.handle.fp) { - fh.filename = php_ini_opened_path; - } - } - } - - if (free_ini_search_path) { - efree(php_ini_search_path); - } - - PG(safe_mode) = safe_mode_state; - PG(open_basedir) = open_basedir; - - if (fh.handle.fp) { - fh.type = ZEND_HANDLE_FP; - - zend_parse_ini_file(&fh, 1, php_config_ini_parser_cb, &extension_lists); - - { - zval tmp; - - Z_STRLEN(tmp) = strlen(fh.filename); - Z_STRVAL(tmp) = zend_strndup(fh.filename, Z_STRLEN(tmp)); - Z_TYPE(tmp) = IS_STRING; - zend_hash_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path"), (void *) &tmp, sizeof(zval), NULL); - if (php_ini_opened_path) { - efree(php_ini_opened_path); - } - php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); - } - } - - /* Check for PHP_INI_SCAN_DIR environment variable to override/set config file scan directory */ - php_ini_scanned_path = getenv("PHP_INI_SCAN_DIR"); - if (!php_ini_scanned_path) { - /* Or fall back using possible --with-config-file-scan-dir setting (defaults to empty string!) */ - php_ini_scanned_path = PHP_CONFIG_FILE_SCAN_DIR; - } - php_ini_scanned_path_len = strlen(php_ini_scanned_path); - - /* Scan and parse any .ini files found in scan path if path not empty. */ - if (!sapi_module.php_ini_ignore && php_ini_scanned_path_len) { - struct dirent **namelist; - int ndir, i; - - if ((ndir = php_scandir(php_ini_scanned_path, &namelist, 0, php_alphasort)) > 0) { - for (i = 0; i < ndir; i++) { - /* check for a .ini extension */ - if (!(p = strrchr(namelist[i]->d_name, '.')) || (p && strcmp(p, ".ini"))) { - free(namelist[i]); - continue; - } - if (IS_SLASH(php_ini_scanned_path[php_ini_scanned_path_len - 1])) { - snprintf(ini_file, MAXPATHLEN, "%s%s", php_ini_scanned_path, namelist[i]->d_name); - } else { - snprintf(ini_file, MAXPATHLEN, "%s%c%s", php_ini_scanned_path, DEFAULT_SLASH, namelist[i]->d_name); - } - if (VCWD_STAT(ini_file, &sb) == 0) { - if (S_ISREG(sb.st_mode)) { - if ((fh.handle.fp = VCWD_FOPEN(ini_file, "r"))) { - fh.filename = ini_file; - fh.type = ZEND_HANDLE_FP; - zend_parse_ini_file(&fh, 1, php_config_ini_parser_cb, &extension_lists); - /* Here, add it to the list of ini files read */ - l = strlen(ini_file); - total_l += l + 2; - p = estrndup(ini_file, l); - zend_llist_add_element(&scanned_ini_list, &p); - } - } - } - free(namelist[i]); - } - free(namelist); - - /* - * Don't need an extra byte for the \0 in this malloc as the last - * element will not get a trailing , which gives us the byte for the \0 - */ - if (total_l) { - php_ini_scanned_files = (char *) malloc(total_l); - *php_ini_scanned_files = '\0'; - for (element = scanned_ini_list.head; element; element = element->next) { - strlcat(php_ini_scanned_files, *(char **)element->data, total_l); - strlcat(php_ini_scanned_files, element->next ? ",\n" : "\n", total_l); - } - } - zend_llist_destroy(&scanned_ini_list); - } - } else { - /* Make sure an empty php_ini_scanned_path ends up as NULL */ - php_ini_scanned_path = NULL; - } - - if (sapi_module.ini_entries) { - zend_parse_ini_string(sapi_module.ini_entries, 1, php_config_ini_parser_cb, &extension_lists); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ php_shutdown_config - */ -int php_shutdown_config(void) -{ - zend_hash_destroy(&configuration_hash); - if (php_ini_opened_path) { - free(php_ini_opened_path); - php_ini_opened_path = NULL; - } - if (php_ini_scanned_files) { - free(php_ini_scanned_files); - php_ini_scanned_files = NULL; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ php_ini_register_extensions - */ -void php_ini_register_extensions(TSRMLS_D) -{ - zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb TSRMLS_CC); - zend_llist_apply(&extension_lists.functions, php_load_function_extension_cb TSRMLS_CC); - - zend_llist_destroy(&extension_lists.engine); - zend_llist_destroy(&extension_lists.functions); -} -/* }}} */ - -/* {{{ cfg_get_entry - */ -PHPAPI zval *cfg_get_entry(char *name, uint name_length) -{ - zval *tmp; - - if (zend_hash_find(&configuration_hash, name, name_length, (void **) &tmp) == SUCCESS) { - return tmp; - } else { - return NULL; - } -} -/* }}} */ - -/* {{{ cfg_get_long - */ -PHPAPI int cfg_get_long(char *varname, long *result) -{ - zval *tmp, var; - - if (zend_hash_find(&configuration_hash, varname, strlen(varname) + 1, (void **) &tmp) == FAILURE) { - *result = 0; - return FAILURE; - } - var = *tmp; - zval_copy_ctor(&var); - convert_to_long(&var); - *result = Z_LVAL(var); - return SUCCESS; -} -/* }}} */ - -/* {{{ cfg_get_double - */ -PHPAPI int cfg_get_double(char *varname, double *result) -{ - zval *tmp, var; - - if (zend_hash_find(&configuration_hash, varname, strlen(varname) + 1, (void **) &tmp) == FAILURE) { - *result = (double) 0; - return FAILURE; - } - var = *tmp; - zval_copy_ctor(&var); - convert_to_double(&var); - *result = Z_DVAL(var); - return SUCCESS; -} -/* }}} */ - -/* {{{ cfg_get_string - */ -PHPAPI int cfg_get_string(char *varname, char **result) -{ - zval *tmp; - - if (zend_hash_find(&configuration_hash, varname, strlen(varname)+1, (void **) &tmp) == FAILURE) { - *result = NULL; - return FAILURE; - } - *result = Z_STRVAL_P(tmp); - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_ini.h b/main/php_ini.h deleted file mode 100644 index e2cb5ce813203..0000000000000 --- a/main/php_ini.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_INI_H -#define PHP_INI_H - -#include "zend_ini.h" - -BEGIN_EXTERN_C() -int php_init_config(TSRMLS_D); -int php_shutdown_config(void); -void php_ini_register_extensions(TSRMLS_D); -PHPAPI zval *cfg_get_entry(char *name, uint name_length); -PHPAPI int cfg_get_long(char *varname, long *result); -PHPAPI int cfg_get_double(char *varname, double *result); -PHPAPI int cfg_get_string(char *varname, char **result); -END_EXTERN_C() - -#define PHP_INI_USER ZEND_INI_USER -#define PHP_INI_PERDIR ZEND_INI_PERDIR -#define PHP_INI_SYSTEM ZEND_INI_SYSTEM - -#define PHP_INI_ALL ZEND_INI_ALL - -#define php_ini_entry zend_ini_entry - -#define PHP_INI_MH ZEND_INI_MH -#define PHP_INI_DISP ZEND_INI_DISP - -#define PHP_INI_BEGIN ZEND_INI_BEGIN -#define PHP_INI_END ZEND_INI_END - -#define PHP_INI_ENTRY3_EX ZEND_INI_ENTRY3_EX -#define PHP_INI_ENTRY3 ZEND_INI_ENTRY3 -#define PHP_INI_ENTRY2_EX ZEND_INI_ENTRY2_EX -#define PHP_INI_ENTRY2 ZEND_INI_ENTRY2 -#define PHP_INI_ENTRY1_EX ZEND_INI_ENTRY1_EX -#define PHP_INI_ENTRY1 ZEND_INI_ENTRY1 -#define PHP_INI_ENTRY_EX ZEND_INI_ENTRY_EX -#define PHP_INI_ENTRY ZEND_INI_ENTRY - -#define STD_PHP_INI_ENTRY STD_ZEND_INI_ENTRY -#define STD_PHP_INI_ENTRY_EX STD_ZEND_INI_ENTRY_EX -#define STD_PHP_INI_BOOLEAN STD_ZEND_INI_BOOLEAN - -#define PHP_INI_DISPLAY_ORIG ZEND_INI_DISPLAY_ORIG -#define PHP_INI_DISPLAY_ACTIVE ZEND_INI_DISPLAY_ACTIVE - -#define PHP_INI_STAGE_STARTUP ZEND_INI_STAGE_STARTUP -#define PHP_INI_STAGE_SHUTDOWN ZEND_INI_STAGE_SHUTDOWN -#define PHP_INI_STAGE_ACTIVATE ZEND_INI_STAGE_ACTIVATE -#define PHP_INI_STAGE_DEACTIVATE ZEND_INI_STAGE_DEACTIVATE -#define PHP_INI_STAGE_RUNTIME ZEND_INI_STAGE_RUNTIME -#define PHP_INI_STAGE_HTACCESS ZEND_INI_STAGE_HTACCESS - -#define php_ini_boolean_displayer_cb zend_ini_boolean_displayer_cb -#define php_ini_color_displayer_cb zend_ini_color_displayer_cb - -#define php_alter_ini_entry zend_alter_ini_entry - -#define php_ini_long zend_ini_long -#define php_ini_double zend_ini_double -#define php_ini_string zend_ini_string - -#endif /* PHP_INI_H */ diff --git a/main/php_logos.c b/main/php_logos.c deleted file mode 100644 index cc691c360199c..0000000000000 --- a/main/php_logos.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "logos.h" -#include "php_logos.h" -#include "ext/standard/info.h" -#include "SAPI.h" - -typedef struct _php_info_logo { - const char *mimetype; - int mimelen; - const unsigned char *data; - int size; -} php_info_logo; - -static HashTable phpinfo_logo_hash; - -PHPAPI int php_register_info_logo(char *logo_string, const char *mimetype, const unsigned char *data, int size) -{ - php_info_logo info_logo; - - info_logo.mimetype = mimetype; - info_logo.mimelen = strlen(mimetype); - info_logo.data = data; - info_logo.size = size; - - return zend_hash_add(&phpinfo_logo_hash, logo_string, strlen(logo_string), &info_logo, sizeof(php_info_logo), NULL); -} - -PHPAPI int php_unregister_info_logo(char *logo_string) -{ - return zend_hash_del(&phpinfo_logo_hash, logo_string, strlen(logo_string)); -} - -int php_init_info_logos(void) -{ - if(zend_hash_init(&phpinfo_logo_hash, 0, NULL, NULL, 1)==FAILURE) - return FAILURE; - - php_register_info_logo(PHP_LOGO_GUID , "image/gif", php_logo , sizeof(php_logo)); - php_register_info_logo(PHP_EGG_LOGO_GUID, "image/gif", php_egg_logo, sizeof(php_egg_logo)); - php_register_info_logo(ZEND_LOGO_GUID , "image/gif", zend_logo , sizeof(zend_logo)); - - return SUCCESS; -} - -int php_shutdown_info_logos(void) -{ - zend_hash_destroy(&phpinfo_logo_hash); - return SUCCESS; -} - -#define CONTENT_TYPE_HEADER "Content-Type: " -int php_info_logos(const char *logo_string TSRMLS_DC) -{ - php_info_logo *logo_image; - char *content_header; - int len; - - if(FAILURE==zend_hash_find(&phpinfo_logo_hash, (char *) logo_string, strlen(logo_string), (void **)&logo_image)) - return 0; - - len = sizeof(CONTENT_TYPE_HEADER) - 1 + logo_image->mimelen; - content_header = emalloc(len + 1); - memcpy(content_header, CONTENT_TYPE_HEADER, sizeof(CONTENT_TYPE_HEADER) - 1); - memcpy(content_header + sizeof(CONTENT_TYPE_HEADER) - 1 , logo_image->mimetype, logo_image->mimelen); - content_header[len] = '\0'; - sapi_add_header(content_header, len, 0); - - PHPWRITE(logo_image->data, logo_image->size); - return 1; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_logos.h b/main/php_logos.h deleted file mode 100644 index ec4db54306119..0000000000000 --- a/main/php_logos.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#ifndef _PHP_LOGOS_H -#define _PHP_LOGOS_H - -BEGIN_EXTERN_C() -PHPAPI int php_register_info_logo(char *logo_string, const char *mimetype, const unsigned char *data, int size); -PHPAPI int php_unregister_info_logo(char *logo_string); -END_EXTERN_C() - -int php_init_info_logos(void); -int php_shutdown_info_logos(void); -int php_info_logos(const char *logo_string TSRMLS_DC); - -#endif /* _PHP_LOGOS_H */ diff --git a/main/php_main.h b/main/php_main.h deleted file mode 100644 index dcd5f8679f405..0000000000000 --- a/main/php_main.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_MAIN_H -#define PHP_MAIN_H - -#include "zend_globals.h" -#include "php_globals.h" -#include "SAPI.h" - -BEGIN_EXTERN_C() -PHPAPI int php_request_startup(TSRMLS_D); -PHPAPI void php_request_shutdown(void *dummy); -PHPAPI void php_request_shutdown_for_exec(void *dummy); -PHPAPI int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules); -PHPAPI void php_module_shutdown(TSRMLS_D); -PHPAPI void php_module_shutdown_for_exec(void); -PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals); -PHPAPI int php_request_startup_for_hook(TSRMLS_D); - -PHPAPI int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC); - -PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC); -PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret TSRMLS_DC); -PHPAPI int php_handle_special_queries(TSRMLS_D); -PHPAPI int php_lint_script(zend_file_handle *file TSRMLS_DC); - -PHPAPI void php_handle_aborted_connection(void); -PHPAPI int php_handle_auth_data(const char *auth TSRMLS_DC); - -PHPAPI void php_html_puts(const char *str, uint siz TSRMLS_DC); -PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *handle, int mode TSRMLS_DC); - -extern void php_call_shutdown_functions(TSRMLS_D); -extern void php_free_shutdown_functions(TSRMLS_D); - -/* environment module */ -extern int php_init_environ(void); -extern int php_shutdown_environ(void); -END_EXTERN_C() - -#endif diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h deleted file mode 100644 index ea5f8ba24f8f3..0000000000000 --- a/main/php_memory_streams.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_MEMORY_STREAM_H -#define PHP_MEMORY_STREAM_H - -#include "php_streams.h" - -#define PHP_STREAM_MAX_MEM 2 * 1024 * 1024 - -#define TEMP_STREAM_DEFAULT 0 -#define TEMP_STREAM_READONLY 1 -#define TEMP_STREAM_TAKE_BUFFER 2 - -#define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC TSRMLS_CC) -#define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_memory_open(mode, buf, length) _php_stream_memory_open((mode), (buf), (length) STREAMS_CC TSRMLS_CC) -#define php_stream_memory_get_buffer(stream, length) _php_stream_memory_get_buffer((stream), (length) STREAMS_CC TSRMLS_CC) - -#define php_stream_temp_new() php_stream_temp_create(TEMP_STREAM_DEFAULT, PHP_STREAM_MAX_MEM) -#define php_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_CC TSRMLS_CC) -#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC TSRMLS_CC) - -BEGIN_EXTERN_C() -PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC); -PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC); -PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC); - -PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC); -PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC); -END_EXTERN_C() - -extern PHPAPI php_stream_ops php_stream_memory_ops; -extern PHPAPI php_stream_ops php_stream_temp_ops; -extern PHPAPI php_stream_ops php_stream_rfc2397_ops; -extern PHPAPI php_stream_wrapper php_stream_rfc2397_wrapper; - -#define PHP_STREAM_IS_MEMORY &php_stream_memory_ops -#define PHP_STREAM_IS_TEMP &php_stream_temp_ops - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_network.h b/main/php_network.h deleted file mode 100644 index ea20fce253688..0000000000000 --- a/main/php_network.h +++ /dev/null @@ -1,317 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Stig Venaas | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef _PHP_NETWORK_H -#define _PHP_NETWORK_H - -#ifdef PHP_WIN32 -# ifndef WINNT -# define WINNT 1 -# endif -# undef FD_SETSIZE -# include "arpa/inet.h" - /* Apache folks decided that strtoul was evil and redefined - * it to something that breaks the windows headers */ -# undef strtoul -/* defines socklen_t and some IPV6 stuff */ -# include -# if HAVE_WSPIAPI_H - /* getaddrinfo */ -# include -# endif -#else -# undef closesocket -# define closesocket close -#endif - -#ifndef HAVE_SHUTDOWN -#undef shutdown -#define shutdown(s,n) /* nothing */ -#endif - -#ifdef PHP_WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEWOULDBLOCK -# define fsync _commit -# define ftruncate(a, b) chsize(a, b) -#endif /* defined(PHP_WIN32) */ - -#ifdef PHP_WIN32 -#define php_socket_errno() WSAGetLastError() -#else -#define php_socket_errno() errno -#endif - -/* like strerror, but caller must efree the returned string, - * unless buf is not NULL. - * Also works sensibly for win32 */ -BEGIN_EXTERN_C() -PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize); -END_EXTERN_C() - -#ifdef HAVE_NETINET_IN_H -# include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -/* These are here, rather than with the win32 counterparts above, - * since defines them. */ -#ifndef SHUT_RD -# define SHUT_RD 0 -# define SHUT_WR 1 -# define SHUT_RDWR 2 -#endif - -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef PHP_WIN32 -typedef SOCKET php_socket_t; -#else -typedef int php_socket_t; -#endif - -#ifdef PHP_WIN32 -# define SOCK_ERR INVALID_SOCKET -# define SOCK_CONN_ERR SOCKET_ERROR -# define SOCK_RECV_ERR SOCKET_ERROR -#else -# define SOCK_ERR -1 -# define SOCK_CONN_ERR -1 -# define SOCK_RECV_ERR -1 -#endif - -/* uncomment this to debug poll(2) emulation on systems that have poll(2) */ -/* #define PHP_USE_POLL_2_EMULATION 1 */ - -#if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL) -# include -typedef struct pollfd php_pollfd; -#else -typedef struct _php_pollfd { - php_socket_t fd; - short events; - short revents; -} php_pollfd; - -PHPAPI int php_poll2(php_pollfd *ufds, unsigned int nfds, int timeout); - -# define POLLIN 0x0001 /* There is data to read */ -# define POLLPRI 0x0002 /* There is urgent data to read */ -# define POLLOUT 0x0004 /* Writing now will not block */ -# define POLLERR 0x0008 /* Error condition */ -# define POLLHUP 0x0010 /* Hung up */ -# define POLLNVAL 0x0020 /* Invalid request: fd not open */ - -# ifndef PHP_USE_POLL_2_EMULATION -# define PHP_USE_POLL_2_EMULATION 1 -# endif -#endif - -#define PHP_POLLREADABLE (POLLIN|POLLERR|POLLHUP) - -#ifndef PHP_USE_POLL_2_EMULATION -# define php_poll2(ufds, nfds, timeout) poll(ufds, nfds, timeout) -#endif - -/* timeval-to-timeout (for poll(2)) */ -static inline int php_tvtoto(struct timeval *timeouttv) -{ - if (timeouttv) { - return (timeouttv->tv_sec * 1000) + (timeouttv->tv_usec / 1000); - } - return -1; -} - -/* hybrid select(2)/poll(2) for a single descriptor. - * timeouttv follows same rules as select(2), but is reduced to millisecond accuracy. - * Returns 0 on timeout, -1 on error, or the event mask (ala poll(2)). - */ -static inline int php_pollfd_for(php_socket_t fd, int events, struct timeval *timeouttv) -{ - php_pollfd p; - int n; - - p.fd = fd; - p.events = events; - p.revents = 0; - - n = php_poll2(&p, 1, php_tvtoto(timeouttv)); - - if (n > 0) { - return p.revents; - } - - return n; -} - -static inline int php_pollfd_for_ms(php_socket_t fd, int events, int timeout) -{ - php_pollfd p; - int n; - - p.fd = fd; - p.events = events; - p.revents = 0; - - n = php_poll2(&p, 1, timeout); - - if (n > 0) { - return p.revents; - } - - return n; -} - -/* emit warning and suggestion for unsafe select(2) usage */ -PHPAPI void _php_emit_fd_setsize_warning(int max_fd); - -#ifdef PHP_WIN32 -/* it is safe to FD_SET too many fd's under win32; the macro will simply ignore - * descriptors that go beyond the default FD_SETSIZE */ -# define PHP_SAFE_FD_SET(fd, set) FD_SET(fd, set) -# define PHP_SAFE_FD_ISSET(fd, set) FD_ISSET(fd, set) -# define PHP_SAFE_MAX_FD(m, n) do { if (n + 1 >= FD_SETSIZE) { _php_emit_fd_setsize_warning(n); }} while(0) -#else -# define PHP_SAFE_FD_SET(fd, set) do { if (fd < FD_SETSIZE) FD_SET(fd, set); } while(0) -# define PHP_SAFE_FD_ISSET(fd, set) ((fd < FD_SETSIZE) && FD_ISSET(fd, set)) -# define PHP_SAFE_MAX_FD(m, n) do { if (m >= FD_SETSIZE) { _php_emit_fd_setsize_warning(m); m = FD_SETSIZE - 1; }} while(0) -#endif - - -#define PHP_SOCK_CHUNK_SIZE 8192 - -#ifdef HAVE_SOCKADDR_STORAGE -typedef struct sockaddr_storage php_sockaddr_storage; -#else -typedef struct { -#ifdef HAVE_SOCKADDR_SA_LEN - unsigned char ss_len; - unsigned char ss_family; -#else - unsigned short ss_family; -#endif - char info[126]; -} php_sockaddr_storage; -#endif - -BEGIN_EXTERN_C() -PHPAPI php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short port, - int socktype, int asynchronous, struct timeval *timeout, char **error_string, - int *error_code, char *bindto, unsigned short bindport - TSRMLS_DC); - -PHPAPI int php_network_connect_socket(php_socket_t sockfd, - const struct sockaddr *addr, - socklen_t addrlen, - int asynchronous, - struct timeval *timeout, - char **error_string, - int *error_code); - -#define php_connect_nonb(sock, addr, addrlen, timeout) \ - php_network_connect_socket((sock), (addr), (addrlen), 0, (timeout), NULL, NULL) - -PHPAPI php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned port, - int socktype, char **error_string, int *error_code - TSRMLS_DC); - -PHPAPI php_socket_t php_network_accept_incoming(php_socket_t srvsock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen, - struct timeval *timeout, - char **error_string, - int *error_code - TSRMLS_DC); - -PHPAPI int php_network_get_sock_name(php_socket_t sock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC); - -PHPAPI int php_network_get_peer_name(php_socket_t sock, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC); - -PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short port); -PHPAPI int php_sockaddr_size(php_sockaddr_storage *addr); -END_EXTERN_C() - -struct _php_netstream_data_t { - php_socket_t socket; - char is_blocked; - struct timeval timeout; - char timeout_event; - size_t ownsize; -}; -typedef struct _php_netstream_data_t php_netstream_data_t; -PHPAPI extern php_stream_ops php_stream_socket_ops; -extern php_stream_ops php_stream_generic_socket_ops; -#define PHP_STREAM_IS_SOCKET (&php_stream_socket_ops) - -BEGIN_EXTERN_C() -PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC TSRMLS_DC ); -/* open a connection to a host using php_hostconnect and return a stream */ -PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short port, - int socktype, struct timeval *timeout, const char *persistent_id STREAMS_DC TSRMLS_DC); -PHPAPI void php_network_populate_name_from_sockaddr( - /* input address */ - struct sockaddr *sa, socklen_t sl, - /* output readable address */ - char **textaddr, long *textaddrlen, - /* output address */ - struct sockaddr **addr, - socklen_t *addrlen - TSRMLS_DC); - -PHPAPI int php_network_parse_network_address_with_port(const char *addr, - long addrlen, struct sockaddr *sa, socklen_t *sl TSRMLS_DC); -END_EXTERN_C() - -#define php_stream_sock_open_from_socket(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_CC TSRMLS_CC) -#define php_stream_sock_open_host(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_CC TSRMLS_CC) - -/* {{{ memory debug */ -#define php_stream_sock_open_from_socket_rel(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_sock_open_host_rel(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_sock_open_unix_rel(path, pathlen, persistent, timeval) _php_stream_sock_open_unix((path), (pathlen), (persistent), (timeval) STREAMS_REL_CC TSRMLS_CC) - -/* }}} */ - -#endif /* _PHP_NETWORK_H */ - -/* - * Local variables: - * tab-width: 8 - * c-basic-offset: 8 - * End: - */ diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c deleted file mode 100644 index 559bf70a61bb0..0000000000000 --- a/main/php_open_temporary_file.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#include -#include -#include -#include - -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#include "win32/winutil.h" -#elif defined(NETWARE) -#ifdef USE_WINSOCK -#include -#else -#include -#endif -#include -#else -#include -#include -#include -#include -#if HAVE_ARPA_INET_H -#include -#endif -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_SYS_FILE_H -#include -#endif - -#if !defined(P_tmpdir) -#define P_tmpdir "" -#endif - -/* {{{ php_do_open_temporary_file */ - -/* Loosely based on a tempnam() implementation by UCLA */ - -/* - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -static int php_do_open_temporary_file(const char *path, const char *pfx, char **opened_path_p TSRMLS_DC) -{ - char *trailing_slash; - char *opened_path; - char cwd[MAXPATHLEN]; - cwd_state new_state; - int fd = -1; -#ifndef HAVE_MKSTEMP - int open_flags = O_CREAT | O_TRUNC | O_RDWR -#ifdef PHP_WIN32 - | _O_BINARY -#endif - ; -#endif - - if (!path || !path[0]) { - return -1; - } - - if (!VCWD_GETCWD(cwd, MAXPATHLEN)) { - cwd[0] = '\0'; - } - - new_state.cwd = strdup(cwd); - new_state.cwd_length = strlen(cwd); - - if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) { - free(new_state.cwd); - return -1; - } - - if (IS_SLASH(new_state.cwd[new_state.cwd_length - 1])) { - trailing_slash = ""; - } else { - trailing_slash = "/"; - } - - if (spprintf(&opened_path, 0, "%s%s%sXXXXXX", new_state.cwd, trailing_slash, pfx) >= MAXPATHLEN) { - efree(opened_path); - free(new_state.cwd); - return -1; - } - -#ifdef PHP_WIN32 - if (GetTempFileName(new_state.cwd, pfx, 0, opened_path)) { - /* Some versions of windows set the temp file to be read-only, - * which means that opening it will fail... */ - VCWD_CHMOD(opened_path, 0600); - fd = VCWD_OPEN_MODE(opened_path, open_flags, 0600); - } -#elif defined(HAVE_MKSTEMP) - fd = mkstemp(opened_path); -#else - if (mktemp(opened_path)) { - fd = VCWD_OPEN(opened_path, open_flags); - } -#endif - if (fd == -1 || !opened_path_p) { - efree(opened_path); - } else { - *opened_path_p = opened_path; - } - free(new_state.cwd); - return fd; -} -/* }}} */ - -/* Cache the chosen temporary directory. */ -static char* temporary_directory; - -PHPAPI void php_shutdown_temporary_directory(void) -{ - if (temporary_directory) { - free(temporary_directory); - temporary_directory = NULL; - } -} - -/* - * Determine where to place temporary files. - */ -PHPAPI const char* php_get_temporary_directory(void) -{ - /* Did we determine the temporary directory already? */ - if (temporary_directory) { - return temporary_directory; - } - -#ifdef PHP_WIN32 - /* We can't count on the environment variables TEMP or TMP, - * and so must make the Win32 API call to get the default - * directory for temporary files. Note this call checks - * the environment values TMP and TEMP (in order) first. - */ - { - char sTemp[MAX_PATH]; - DWORD n = GetTempPath(sizeof(sTemp),sTemp); - assert(0 < n); /* should *never* fail! */ - temporary_directory = strdup(sTemp); - return temporary_directory; - } -#else - /* On Unix use the (usual) TMPDIR environment variable. */ - { - char* s = getenv("TMPDIR"); - if (s) { - temporary_directory = strdup(s); - return temporary_directory; - } - } -#ifdef P_tmpdir - /* Use the standard default temporary directory. */ - if (P_tmpdir) { - temporary_directory = strdup(P_tmpdir); - return temporary_directory; - } -#endif - /* Shouldn't ever(!) end up here ... last ditch default. */ - temporary_directory = strdup("/tmp"); - return temporary_directory; -#endif -} - -/* {{{ php_open_temporary_file - * - * Unlike tempnam(), the supplied dir argument takes precedence - * over the TMPDIR environment variable - * This function should do its best to return a file pointer to a newly created - * unique file, on every platform. - */ -PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p, zend_bool open_basedir_check TSRMLS_DC) -{ - int fd; - const char *temp_dir; - - if (!pfx) { - pfx = "tmp."; - } - if (opened_path_p) { - *opened_path_p = NULL; - } - - if (!dir || *dir == '\0') { -def_tmp: - temp_dir = php_get_temporary_directory(); - - if (temp_dir && *temp_dir != '\0' && (!open_basedir_check || !php_check_open_basedir(temp_dir TSRMLS_CC))) { - return php_do_open_temporary_file(temp_dir, pfx, opened_path_p TSRMLS_CC); - } else { - return -1; - } - } - - /* Try the directory given as parameter. */ - fd = php_do_open_temporary_file(dir, pfx, opened_path_p TSRMLS_CC); - if (fd == -1) { - /* Use default temporary directory. */ - goto def_tmp; - } - return fd; -} - -PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC) -{ - return php_open_temporary_fd_ex(dir, pfx, opened_path_p, 0 TSRMLS_CC); -} - -PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC) -{ - FILE *fp; - int fd = php_open_temporary_fd(dir, pfx, opened_path_p TSRMLS_CC); - - if (fd == -1) { - return NULL; - } - - fp = fdopen(fd, "r+b"); - if (fp == NULL) { - close(fd); - } - - return fp; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_open_temporary_file.h b/main/php_open_temporary_file.h deleted file mode 100644 index 547ac499d515d..0000000000000 --- a/main/php_open_temporary_file.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_OPEN_TEMPORARY_FILE_H -#define PHP_OPEN_TEMPORARY_FILE_H - -BEGIN_EXTERN_C() -PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); -PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p, zend_bool open_basedir_check TSRMLS_DC); -PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); -PHPAPI const char *php_get_temporary_directory(void); -PHPAPI void php_shutdown_temporary_directory(void); -END_EXTERN_C() - -#endif /* PHP_OPEN_TEMPORARY_FILE_H */ diff --git a/main/php_output.h b/main/php_output.h deleted file mode 100644 index 15b36d98abd1b..0000000000000 --- a/main/php_output.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_OUTPUT_H -#define PHP_OUTPUT_H - -typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC); - -BEGIN_EXTERN_C() -PHPAPI void php_output_startup(void); -PHPAPI void php_output_activate(TSRMLS_D); -PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC); -PHPAPI void php_output_register_constants(TSRMLS_D); -PHPAPI int php_default_output_func(const char *str, uint str_len TSRMLS_DC); -PHPAPI int php_ub_body_write(const char *str, uint str_length TSRMLS_DC); -PHPAPI int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC); -PHPAPI int php_body_write(const char *str, uint str_length TSRMLS_DC); -PHPAPI int php_header_write(const char *str, uint str_length TSRMLS_DC); -PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC); -PHPAPI int php_start_ob_buffer_named(const char *output_handler_name, uint chunk_size, zend_bool erase TSRMLS_DC); -PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC); -PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC); -PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC); -PHPAPI int php_ob_get_length(zval *p TSRMLS_DC); -PHPAPI void php_start_implicit_flush(TSRMLS_D); -PHPAPI void php_end_implicit_flush(TSRMLS_D); -PHPAPI char *php_get_output_start_filename(TSRMLS_D); -PHPAPI int php_get_output_start_lineno(TSRMLS_D); -PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size, char *handler_name, zend_bool erase TSRMLS_DC); -PHPAPI int php_ob_handler_used(char *handler_name TSRMLS_DC); -PHPAPI int php_ob_init_conflict(char *handler_new, char *handler_set TSRMLS_DC); -PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC); -PHPAPI int php_ob_get_length(zval *p TSRMLS_DC); -END_EXTERN_C() - -PHP_FUNCTION(ob_start); -PHP_FUNCTION(ob_flush); -PHP_FUNCTION(ob_clean); -PHP_FUNCTION(ob_end_flush); -PHP_FUNCTION(ob_end_clean); -PHP_FUNCTION(ob_get_flush); -PHP_FUNCTION(ob_get_clean); -PHP_FUNCTION(ob_get_contents); -PHP_FUNCTION(ob_get_length); -PHP_FUNCTION(ob_get_level); -PHP_FUNCTION(ob_get_status); -PHP_FUNCTION(ob_implicit_flush); -PHP_FUNCTION(ob_list_handlers); - -typedef struct _php_ob_buffer { - char *buffer; - uint size; - uint text_length; - int block_size; - uint chunk_size; - int status; - zval *output_handler; - php_output_handler_func_t internal_output_handler; - char *internal_output_handler_buffer; - uint internal_output_handler_buffer_size; - char *handler_name; - zend_bool erase; -} php_ob_buffer; - -typedef struct _php_output_globals { - int (*php_body_write)(const char *str, uint str_length TSRMLS_DC); /* string output */ - int (*php_header_write)(const char *str, uint str_length TSRMLS_DC); /* unbuffer string output */ - php_ob_buffer active_ob_buffer; - unsigned char implicit_flush; - char *output_start_filename; - int output_start_lineno; - zend_stack ob_buffers; - int ob_nesting_level; - zend_bool ob_lock; - zend_bool disable_output; -} php_output_globals; - -#ifdef ZTS -#define OG(v) TSRMG(output_globals_id, php_output_globals *, v) -ZEND_API extern int output_globals_id; -#else -#define OG(v) (output_globals.v) -ZEND_API extern php_output_globals output_globals; -#endif - -#define PHP_OUTPUT_HANDLER_START (1<<0) -#define PHP_OUTPUT_HANDLER_CONT (1<<1) -#define PHP_OUTPUT_HANDLER_END (1<<2) - -#define PHP_OUTPUT_HANDLER_INTERNAL 0 -#define PHP_OUTPUT_HANDLER_USER 1 - -PHP_FUNCTION(output_add_rewrite_var); -PHP_FUNCTION(output_reset_rewrite_vars); - - -#endif /* PHP_OUTPUT_H */ diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h deleted file mode 100644 index 4022f78cbdfa3..0000000000000 --- a/main/php_reentrancy.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_REENTRANCY_H -#define PHP_REENTRANCY_H - -#include "php.h" - -#include -#ifdef HAVE_DIRENT_H -#include -#endif -#include - -/* currently, PHP does not check for these functions, but assumes - that they are available on all systems. */ - -#define HAVE_LOCALTIME 1 -#define HAVE_GMTIME 1 -#define HAVE_ASCTIME 1 -#define HAVE_CTIME 1 - -#if defined(PHP_IRIX_TIME_R) -#undef HAVE_ASCTIME_R -#undef HAVE_CTIME_R -#endif - -#if defined(PHP_HPUX_TIME_R) -#undef HAVE_LOCALTIME_R -#undef HAVE_ASCTIME_R -#undef HAVE_CTIME_R -#undef HAVE_GMTIME_R -#endif - -BEGIN_EXTERN_C() - -#if defined(HAVE_POSIX_READDIR_R) -#define php_readdir_r readdir_r -#else -PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry, - struct dirent **result); -#endif - -#if !defined(HAVE_LOCALTIME_R) && defined(HAVE_LOCALTIME) -#define PHP_NEED_REENTRANCY 1 -PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm); -#else -#define php_localtime_r localtime_r -#ifdef MISSING_LOCALTIME_R_DECL -struct tm *localtime_r(const time_t *const timep, struct tm *p_tm); -#endif -#endif - - -#if !defined(HAVE_CTIME_R) && defined(HAVE_CTIME) -#define PHP_NEED_REENTRANCY 1 -PHPAPI char *php_ctime_r(const time_t *clock, char *buf); -#else -#define php_ctime_r ctime_r -#ifdef MISSING_CTIME_R_DECL -char *ctime_r(const time_t *clock, char *buf); -#endif -#endif - - -#if !defined(HAVE_ASCTIME_R) && defined(HAVE_ASCTIME) -#define PHP_NEED_REENTRANCY 1 -PHPAPI char *php_asctime_r(const struct tm *tm, char *buf); -#else -#define php_asctime_r asctime_r -#ifdef MISSING_ASCTIME_R_DECL -char *asctime_r(const struct tm *tm, char *buf); -#endif -#endif - - -#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME) || defined(__BEOS__) -#define PHP_NEED_REENTRANCY 1 -PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm); -#else -#define php_gmtime_r gmtime_r -#ifdef MISSING_GMTIME_R_DECL -struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm); -#endif -#endif - -#if !defined(HAVE_STRTOK_R) -PHPAPI char *php_strtok_r(char *s, const char *delim, char **last); -#else -#define php_strtok_r strtok_r -#ifdef MISSING_STRTOK_R_DECL -char *strtok_r(char *s, const char *delim, char **last); -#endif -#endif - -#if !defined(HAVE_RAND_R) -PHPAPI int php_rand_r(unsigned int *seed); -#else -#define php_rand_r rand_r -#endif - -END_EXTERN_C() - -#if !defined(ZTS) -#undef PHP_NEED_REENTRANCY -#endif - -#if defined(PHP_NEED_REENTRANCY) -void reentrancy_startup(void); -void reentrancy_shutdown(void); -#else -#define reentrancy_startup() -#define reentrancy_shutdown() -#endif - -#endif diff --git a/main/php_regex.h b/main/php_regex.h deleted file mode 100644 index 6ebd8f5e6056e..0000000000000 --- a/main/php_regex.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_REGEX_H -#define PHP_REGEX_H - -/* - * REGEX means: - * 0.. system regex - * 1.. bundled regex - */ - -#if REGEX -/* get aliases */ -#include "regex/regex_extra.h" -#include "regex/regex.h" - -/* get rid of aliases */ -#define PHP_NO_ALIASES -#include "regex/regex_extra.h" -#undef PHP_NO_ALIASES - -#undef _PCREPOSIX_H -#define _PCREPOSIX_H 1 - -#ifndef _REGEX_H -#define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */ -#endif -#ifndef _REGEX_H_ -#define _REGEX_H_ 1 -#endif -#ifndef _RX_H -#define _RX_H 1 /* Try defining these for Linux to */ -#endif -#ifndef __REGEXP_LIBRARY_H__ -#define __REGEXP_LIBRARY_H__ 1 /* avoid Apache including regex.h */ -#endif -#ifndef _H_REGEX -#define _H_REGEX 1 /* This one is for AIX */ -#endif -#elif REGEX == 0 -#include -#ifndef _REGEX_H_ -#define _REGEX_H_ 1 -#endif -#endif - -#endif /* PHP_REGEX_H */ diff --git a/main/php_scandir.c b/main/php_scandir.c deleted file mode 100644 index 8dd218d1569aa..0000000000000 --- a/main/php_scandir.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Shane Caraveo | - | Ilia Alshanetsky | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_scandir.h" - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_DIRENT_H -#include -#endif - -#ifndef HAVE_SCANDIR - -#ifdef PHP_WIN32 -#include "win32/param.h" -#include "win32/readdir.h" -#endif - -#include -#ifndef NETWARE -#include -#endif - -#endif /* HAVE_SCANDIR */ - -#ifndef HAVE_ALPHASORT - -#ifdef HAVE_STRING_H -#include -#endif - -PHPAPI int php_alphasort(const struct dirent **a, const struct dirent **b) -{ - return strcoll((*a)->d_name,(*b)->d_name); -} -#endif /* HAVE_ALPHASORT */ - -#ifndef HAVE_SCANDIR -PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*selector) (const struct dirent *entry), int (*compare) (const struct dirent **a, const struct dirent **b)) -{ - DIR *dirp = NULL; - struct dirent **vector = NULL; - int vector_size = 0; - int nfiles = 0; - char entry[sizeof(struct dirent)+MAXPATHLEN]; - struct dirent *dp = (struct dirent *)&entry; - - if (namelist == NULL) { - return -1; - } - - if (!(dirp = opendir(dirname))) { - return -1; - } - - while (!php_readdir_r(dirp, (struct dirent *)entry, &dp) && dp) { - int dsize = 0; - struct dirent *newdp = NULL; - - if (selector && (*selector)(dp) == 0) { - continue; - } - - if (nfiles == vector_size) { - struct dirent **newv; - if (vector_size == 0) { - vector_size = 10; - } else { - vector_size *= 2; - } - - newv = (struct dirent **) realloc (vector, vector_size * sizeof (struct dirent *)); - if (!newv) { - return -1; - } - vector = newv; - } - - dsize = sizeof (struct dirent) + ((strlen(dp->d_name) + 1) * sizeof(char)); - newdp = (struct dirent *) malloc(dsize); - - if (newdp == NULL) { - goto fail; - } - - vector[nfiles++] = (struct dirent *) memcpy(newdp, dp, dsize); - } - - closedir(dirp); - - *namelist = vector; - - if (compare) { - qsort (*namelist, nfiles, sizeof(struct dirent *), compare); - } - - return nfiles; - -fail: - while (nfiles-- > 0) { - free(vector[nfiles]); - } - free(vector); - return -1; -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_scandir.h b/main/php_scandir.h deleted file mode 100644 index c3b6f0a7c1d63..0000000000000 --- a/main/php_scandir.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Shane Caraveo | - | Ilia Alshanetsky | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SCANDIR_H -#define PHP_SCANDIR_H - -#include - -#ifdef HAVE_SYS_DIR_H -#include -#endif - -#ifdef PHP_WIN32 -#include "config.w32.h" -#include "win32/readdir.h" -#else -#include -#endif - -#ifdef HAVE_DIRENT_H -#include -#endif - -#ifdef HAVE_SCANDIR -#define php_scandir scandir -#else -PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*selector) (const struct dirent *entry), int (*compare) (const struct dirent **a, const struct dirent **b)); -#endif - -#ifdef HAVE_ALPHASORT -#define php_alphasort alphasort -#else -PHPAPI int php_alphasort(const struct dirent **a, const struct dirent **b); -#endif - -#endif /* PHP_SCANDIR_H */ diff --git a/main/php_sprintf.c b/main/php_sprintf.c deleted file mode 100644 index 29814504d69c2..0000000000000 --- a/main/php_sprintf.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Jaakko Hyvätti | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include -#include "php.h" -#ifdef PHP_WIN32 -#include "config.w32.h" -#else -#include -#endif - -PHPAPI int -php_sprintf (char*s, const char* format, ...) -{ - va_list args; - int ret; - - va_start (args, format); - s[0] = '\0'; - ret = vsprintf (s, format, args); - va_end (args); - if (!ret) - return -1; - return strlen (s); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_streams.h b/main/php_streams.h deleted file mode 100755 index 26e94f5ef6262..0000000000000 --- a/main/php_streams.h +++ /dev/null @@ -1,570 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong (wez@thebrainroom.com) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_STREAMS_H -#define PHP_STREAMS_H - -#ifdef HAVE_SYS_TIME_H -#include -#endif -#include -#include - -BEGIN_EXTERN_C() -PHPAPI int php_file_le_stream(void); -PHPAPI int php_file_le_pstream(void); -PHPAPI int php_file_le_stream_filter(void); -END_EXTERN_C() - -/* {{{ Streams memory debugging stuff */ - -#if ZEND_DEBUG -/* these have more of a dependency on the definitions of the zend macros than - * I would prefer, but doing it this way saves loads of idefs :-/ */ -# define STREAMS_D int __php_stream_call_depth ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC -# define STREAMS_C 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC -# define STREAMS_REL_C __php_stream_call_depth + 1 ZEND_FILE_LINE_CC, \ - __php_stream_call_depth ? __zend_orig_filename : __zend_filename, \ - __php_stream_call_depth ? __zend_orig_lineno : __zend_lineno - -# define STREAMS_DC , STREAMS_D -# define STREAMS_CC , STREAMS_C -# define STREAMS_REL_CC , STREAMS_REL_C - -#else -# define STREAMS_D -# define STREAMS_C -# define STREAMS_REL_C -# define STREAMS_DC -# define STREAMS_CC -# define STREAMS_REL_CC -#endif - -/* these functions relay the file/line number information. They are depth aware, so they will pass - * the ultimate ancestor, which is useful, because there can be several layers of calls */ -#define php_stream_alloc_rel(ops, thisptr, persistent, mode) _php_stream_alloc((ops), (thisptr), (persistent), (mode) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_copy_to_mem_rel(src, buf, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_rel(filename, mode, opened, options) _php_stream_fopen((filename), (mode), (opened), (options) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_with_path_rel(filename, mode, path, opened, options) _php_stream_fopen_with_path((filename), (mode), (path), (opened), (options) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_from_fd_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_fopen_from_file_rel(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_from_pipe_rel(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_tmpfile_rel() _php_stream_fopen_tmpfile(0 STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_fopen_temporary_file_rel(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_open_wrapper_rel(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_REL_CC TSRMLS_CC) -#define php_stream_open_wrapper_ex_rel(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_REL_CC TSRMLS_CC) - -#define php_stream_make_seekable_rel(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_REL_CC TSRMLS_CC) - -/* }}} */ - -/* The contents of the php_stream_ops and php_stream should only be accessed - * using the functions/macros in this header. - * If you need to get at something that doesn't have an API, - * drop me a line and we can sort out a way to do - * it properly. - * - * The only exceptions to this rule are that stream implementations can use - * the php_stream->abstract pointer to hold their context, and streams - * opened via stream_open_wrappers can use the zval ptr in - * php_stream->wrapperdata to hold meta data for php scripts to - * retrieve using file_get_wrapper_data(). */ - -typedef struct _php_stream php_stream; -typedef struct _php_stream_wrapper php_stream_wrapper; -typedef struct _php_stream_context php_stream_context; -typedef struct _php_stream_filter php_stream_filter; - -#include "streams/php_stream_context.h" -#include "streams/php_stream_filter_api.h" - -typedef struct _php_stream_statbuf { - struct stat sb; /* regular info */ - /* extended info to go here some day: content-type etc. etc. */ -} php_stream_statbuf; - -typedef struct _php_stream_dirent { - char d_name[MAXPATHLEN]; -} php_stream_dirent; - -/* operations on streams that are file-handles */ -typedef struct _php_stream_ops { - /* stdio like functions - these are mandatory! */ - size_t (*write)(php_stream *stream, const char *buf, size_t count TSRMLS_DC); - size_t (*read)(php_stream *stream, char *buf, size_t count TSRMLS_DC); - int (*close)(php_stream *stream, int close_handle TSRMLS_DC); - int (*flush)(php_stream *stream TSRMLS_DC); - - const char *label; /* label for this ops structure */ - - /* these are optional */ - int (*seek)(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC); - int (*cast)(php_stream *stream, int castas, void **ret TSRMLS_DC); - int (*stat)(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); - int (*set_option)(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); -} php_stream_ops; - -typedef struct _php_stream_wrapper_ops { - /* open/create a wrapped stream */ - php_stream *(*stream_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); - /* close/destroy a wrapped stream */ - int (*stream_closer)(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC); - /* stat a wrapped stream */ - int (*stream_stat)(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); - /* stat a URL */ - int (*url_stat)(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); - /* open a "directory" stream */ - php_stream *(*dir_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); - - const char *label; - - /* delete a file */ - int (*unlink)(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); - - /* rename a file */ - int (*rename)(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC); - - /* Create/Remove directory */ - int (*stream_mkdir)(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC); - int (*stream_rmdir)(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); -} php_stream_wrapper_ops; - -struct _php_stream_wrapper { - php_stream_wrapper_ops *wops; /* operations the wrapper can perform */ - void *abstract; /* context for the wrapper */ - int is_url; /* so that PG(allow_url_fopen) can be respected */ - - /* support for wrappers to return (multiple) error messages to the stream opener */ - int err_count; - char **err_stack; -}; - -#define PHP_STREAM_FLAG_NO_SEEK 1 -#define PHP_STREAM_FLAG_NO_BUFFER 2 - -#define PHP_STREAM_FLAG_EOL_UNIX 0 /* also includes DOS */ -#define PHP_STREAM_FLAG_DETECT_EOL 4 -#define PHP_STREAM_FLAG_EOL_MAC 8 - -/* set this when the stream might represent "interactive" data. - * When set, the read buffer will avoid certain operations that - * might otherwise cause the read to block for much longer than - * is strictly required. */ -#define PHP_STREAM_FLAG_AVOID_BLOCKING 16 - -#define PHP_STREAM_FLAG_NO_CLOSE 32 - -#define PHP_STREAM_FLAG_IS_DIR 64 - -#define PHP_STREAM_FLAG_NO_FCLOSE 128 - -struct _php_stream { - php_stream_ops *ops; - void *abstract; /* convenience pointer for abstraction */ - - php_stream_filter_chain readfilters, writefilters; - - php_stream_wrapper *wrapper; /* which wrapper was used to open the stream */ - void *wrapperthis; /* convenience pointer for a instance of a wrapper */ - zval *wrapperdata; /* fgetwrapperdata retrieves this */ - - int fgetss_state; /* for fgetss to handle multiline tags */ - int is_persistent; - char mode[16]; /* "rwb" etc. ala stdio */ - int rsrc_id; /* used for auto-cleanup */ - int in_free; /* to prevent recursion during free */ - /* so we know how to clean it up correctly. This should be set to - * PHP_STREAM_FCLOSE_XXX as appropriate */ - int fclose_stdiocast; - FILE *stdiocast; /* cache this, otherwise we might leak! */ -#if ZEND_DEBUG - int __exposed; /* non-zero if exposed as a zval somewhere */ -#endif - char *orig_path; - - php_stream_context *context; - int flags; /* PHP_STREAM_FLAG_XXX */ - - /* buffer */ - off_t position; /* of underlying stream */ - unsigned char *readbuf; - size_t readbuflen; - off_t readpos; - off_t writepos; - - /* how much data to read when filling buffer */ - size_t chunk_size; - - int eof; - -}; /* php_stream */ -/* state definitions when closing down; these are private to streams.c */ -#define PHP_STREAM_FCLOSE_NONE 0 -#define PHP_STREAM_FCLOSE_FDOPEN 1 -#define PHP_STREAM_FCLOSE_FOPENCOOKIE 2 - -/* allocate a new stream for a particular ops */ -BEGIN_EXTERN_C() -PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, - const char *persistent_id, const char *mode STREAMS_DC TSRMLS_DC); -END_EXTERN_C() -#define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC TSRMLS_CC) - - -#define php_stream_get_resource_id(stream) (stream)->rsrc_id -#if ZEND_DEBUG -/* use this to tell the stream that it is OK if we don't explicitly close it */ -# define php_stream_auto_cleanup(stream) { (stream)->__exposed++; } -/* use this to assign the stream to a zval and tell the stream that is - * has been exported to the engine; it will expect to be closed automatically - * when the resources are auto-destructed */ -# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->rsrc_id); (stream)->__exposed++; } -#else -# define php_stream_auto_cleanup(stream) /* nothing */ -# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->rsrc_id); } -#endif - -#define php_stream_from_zval(xstr, ppzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (ppzval), -1, "stream", php_file_le_stream(), php_file_le_pstream()) -#define php_stream_from_zval_no_verify(xstr, ppzval) (xstr) = (php_stream*)zend_fetch_resource((ppzval) TSRMLS_CC, -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream()) - -BEGIN_EXTERN_C() -PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream TSRMLS_DC); -#define PHP_STREAM_PERSISTENT_SUCCESS 0 /* id exists */ -#define PHP_STREAM_PERSISTENT_FAILURE 1 /* id exists but is not a stream! */ -#define PHP_STREAM_PERSISTENT_NOT_EXIST 2 /* id does not exist */ - -#define PHP_STREAM_FREE_CALL_DTOR 1 /* call ops->close */ -#define PHP_STREAM_FREE_RELEASE_STREAM 2 /* pefree(stream) */ -#define PHP_STREAM_FREE_PRESERVE_HANDLE 4 /* tell ops->close to not close it's underlying handle */ -#define PHP_STREAM_FREE_RSRC_DTOR 8 /* called from the resource list dtor */ -#define PHP_STREAM_FREE_PERSISTENT 16 /* manually freeing a persistent connection */ -#define PHP_STREAM_FREE_CLOSE (PHP_STREAM_FREE_CALL_DTOR | PHP_STREAM_FREE_RELEASE_STREAM) -#define PHP_STREAM_FREE_CLOSE_CASTED (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PRESERVE_HANDLE) -#define PHP_STREAM_FREE_CLOSE_PERSISTENT (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PERSISTENT) - -PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC); -#define php_stream_free(stream, close_options) _php_stream_free((stream), (close_options) TSRMLS_CC) -#define php_stream_close(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE TSRMLS_CC) -#define php_stream_pclose(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE_PERSISTENT TSRMLS_CC) - -PHPAPI int _php_stream_seek(php_stream *stream, off_t offset, int whence TSRMLS_DC); -#define php_stream_rewind(stream) _php_stream_seek((stream), 0L, SEEK_SET TSRMLS_CC) -#define php_stream_seek(stream, offset, whence) _php_stream_seek((stream), (offset), (whence) TSRMLS_CC) - -PHPAPI off_t _php_stream_tell(php_stream *stream TSRMLS_DC); -#define php_stream_tell(stream) _php_stream_tell((stream) TSRMLS_CC) - -PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC); -#define php_stream_read(stream, buf, count) _php_stream_read((stream), (buf), (count) TSRMLS_CC) - -PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC); -#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC) -#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC) - -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...); -/* php_stream_printf macro & function require TSRMLS_CC */ -#define php_stream_printf _php_stream_printf - -PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC); -#define php_stream_eof(stream) _php_stream_eof((stream) TSRMLS_CC) - -PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC); -#define php_stream_getc(stream) _php_stream_getc((stream) TSRMLS_CC) - -PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC); -#define php_stream_putc(stream, c) _php_stream_putc((stream), (c) TSRMLS_CC) - -PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC); -#define php_stream_flush(stream) _php_stream_flush((stream), 0 TSRMLS_CC) - -PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len TSRMLS_DC); -#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL TSRMLS_CC) - -#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen) TSRMLS_CC) -PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, char *delim, size_t delim_len TSRMLS_DC); - -/* CAREFUL! this is equivalent to puts NOT fputs! */ -PHPAPI int _php_stream_puts(php_stream *stream, char *buf TSRMLS_DC); -#define php_stream_puts(stream, buf) _php_stream_puts((stream), (buf) TSRMLS_CC) - -PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); -#define php_stream_stat(stream, ssb) _php_stream_stat((stream), (ssb) TSRMLS_CC) - -PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); -#define php_stream_stat_path(path, ssb) _php_stream_stat_path((path), 0, (ssb), NULL TSRMLS_CC) -#define php_stream_stat_path_ex(path, flags, ssb, context) _php_stream_stat_path((path), (flags), (ssb), (context) TSRMLS_CC) - -PHPAPI int _php_stream_mkdir(char *path, int mode, int options, php_stream_context *context TSRMLS_DC); -#define php_stream_mkdir(path, mode, options, context) _php_stream_mkdir(path, mode, options, context TSRMLS_CC) - -PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *context TSRMLS_DC); -#define php_stream_rmdir(path, options, context) _php_stream_rmdir(path, options, context TSRMLS_CC) - -PHPAPI php_stream *_php_stream_opendir(char *path, int options, php_stream_context *context STREAMS_DC TSRMLS_DC); -#define php_stream_opendir(path, options, context) _php_stream_opendir((path), (options), (context) STREAMS_CC TSRMLS_CC) -PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC); -#define php_stream_readdir(dirstream, dirent) _php_stream_readdir((dirstream), (dirent) TSRMLS_CC) -#define php_stream_closedir(dirstream) php_stream_close((dirstream)) -#define php_stream_rewinddir(dirstream) php_stream_rewind((dirstream)) - -PHPAPI int php_stream_dirent_alphasort(const char **a, const char **b); -PHPAPI int php_stream_dirent_alphasortr(const char **a, const char **b); - -PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_stream_context *context, - int (*compare) (const char **a, const char **b) TSRMLS_DC); -#define php_stream_scandir(dirname, namelist, context, compare) _php_stream_scandir((dirname), (namelist), 0, (context), (compare) TSRMLS_CC) - -PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); -#define php_stream_set_option(stream, option, value, ptrvalue) _php_stream_set_option((stream), (option), (value), (ptrvalue) TSRMLS_CC) - -#define php_stream_set_chunk_size(stream, size) _php_stream_set_option((stream), PHP_STREAM_OPTION_SET_CHUNK_SIZE, (size), NULL TSRMLS_CC) - -END_EXTERN_C() - - -/* Flags for mkdir method in wrapper ops */ -#define PHP_STREAM_MKDIR_RECURSIVE 1 -/* define REPORT ERRORS 8 (below) */ - -/* Flags for rmdir method in wrapper ops */ -/* define REPORT_ERRORS 8 (below) */ - -/* Flags for url_stat method in wrapper ops */ -#define PHP_STREAM_URL_STAT_LINK 1 -#define PHP_STREAM_URL_STAT_QUIET 2 - -/* change the blocking mode of stream: value == 1 => blocking, value == 0 => non-blocking. */ -#define PHP_STREAM_OPTION_BLOCKING 1 - -/* change the buffering mode of stream. value is a PHP_STREAM_BUFFER_XXXX value, ptrparam is a ptr to a size_t holding - * the required buffer size */ -#define PHP_STREAM_OPTION_READ_BUFFER 2 -#define PHP_STREAM_OPTION_WRITE_BUFFER 3 - -#define PHP_STREAM_BUFFER_NONE 0 /* unbuffered */ -#define PHP_STREAM_BUFFER_LINE 1 /* line buffered */ -#define PHP_STREAM_BUFFER_FULL 2 /* fully buffered */ - -/* set the timeout duration for reads on the stream. ptrparam is a pointer to a struct timeval * */ -#define PHP_STREAM_OPTION_READ_TIMEOUT 4 -#define PHP_STREAM_OPTION_SET_CHUNK_SIZE 5 - -/* set or release lock on a stream */ -#define PHP_STREAM_OPTION_LOCKING 6 - -/* whether or not locking is supported */ -#define PHP_STREAM_LOCK_SUPPORTED 1 - -#define php_stream_supports_lock(stream) _php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, 0, (void *) PHP_STREAM_LOCK_SUPPORTED TSRMLS_CC) == 0 ? 1 : 0 -#define php_stream_lock(stream, mode) _php_stream_set_option((stream), PHP_STREAM_OPTION_LOCKING, (mode), (void *) NULL TSRMLS_CC) - -/* option code used by the php_stream_xport_XXX api */ -#define PHP_STREAM_OPTION_XPORT_API 7 /* see php_stream_transport.h */ -#define PHP_STREAM_OPTION_CRYPTO_API 8 /* see php_stream_transport.h */ -#define PHP_STREAM_OPTION_MMAP_API 9 /* see php_stream_mmap.h */ -#define PHP_STREAM_OPTION_TRUNCATE_API 10 - -#define PHP_STREAM_TRUNCATE_SUPPORTED 0 -#define PHP_STREAM_TRUNCATE_SET_SIZE 1 /* ptrparam is a pointer to a size_t */ - -#define php_stream_truncate_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SUPPORTED, NULL TSRMLS_CC) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0) - -BEGIN_EXTERN_C() -PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize TSRMLS_DC); -#define php_stream_truncate_set_size(stream, size) _php_stream_truncate_set_size((stream), (size) TSRMLS_CC) -END_EXTERN_C() - -#define PHP_STREAM_OPTION_META_DATA_API 11 /* ptrparam is a zval* to which to add meta data information */ -#define php_stream_populate_meta_data(stream, zv) (_php_stream_set_option((stream), PHP_STREAM_OPTION_META_DATA_API, 0, zv TSRMLS_CC) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0) - -/* Check if the stream is still "live"; for sockets/pipes this means the socket - * is still connected; for files, this does not really have meaning */ -#define PHP_STREAM_OPTION_CHECK_LIVENESS 12 /* no parameters */ - -#define PHP_STREAM_OPTION_RETURN_OK 0 /* option set OK */ -#define PHP_STREAM_OPTION_RETURN_ERR -1 /* problem setting option */ -#define PHP_STREAM_OPTION_RETURN_NOTIMPL -2 /* underlying stream does not implement; streams can handle it instead */ - -/* copy up to maxlen bytes from src to dest. If maxlen is PHP_STREAM_COPY_ALL, copy until eof(src). - * Uses mmap if the src is a plain file and at offset 0 */ -#define PHP_STREAM_COPY_ALL ((size_t)-1) - -BEGIN_EXTERN_C() -PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC); -#define php_stream_copy_to_stream(src, dest, maxlen) _php_stream_copy_to_stream((src), (dest), (maxlen) STREAMS_CC TSRMLS_CC) - - -/* read all data from stream and put into a buffer. Caller must free buffer when done. - * The copy will use mmap if available. */ -PHPAPI size_t _php_stream_copy_to_mem(php_stream *src, char **buf, size_t maxlen, - int persistent STREAMS_DC TSRMLS_DC); -#define php_stream_copy_to_mem(src, buf, maxlen, persistent) _php_stream_copy_to_mem((src), (buf), (maxlen), (persistent) STREAMS_CC TSRMLS_CC) - -/* output all data from a stream */ -PHPAPI size_t _php_stream_passthru(php_stream * src STREAMS_DC TSRMLS_DC); -#define php_stream_passthru(stream) _php_stream_passthru((stream) STREAMS_CC TSRMLS_CC) -END_EXTERN_C() - -#include "streams/php_stream_transport.h" -#include "streams/php_stream_plain_wrapper.h" -#include "streams/php_stream_userspace.h" -#include "streams/php_stream_mmap.h" - -/* coerce the stream into some other form */ -/* cast as a stdio FILE * */ -#define PHP_STREAM_AS_STDIO 0 -/* cast as a POSIX fd or socketd */ -#define PHP_STREAM_AS_FD 1 -/* cast as a socketd */ -#define PHP_STREAM_AS_SOCKETD 2 -/* cast as fd/socket for select purposes */ -#define PHP_STREAM_AS_FD_FOR_SELECT 3 - -/* try really, really hard to make sure the cast happens (avoid using this flag if possible) */ -#define PHP_STREAM_CAST_TRY_HARD 0x80000000 -#define PHP_STREAM_CAST_RELEASE 0x40000000 /* stream becomes invalid on success */ -#define PHP_STREAM_CAST_INTERNAL 0x20000000 /* stream cast for internal use */ -#define PHP_STREAM_CAST_MASK (PHP_STREAM_CAST_TRY_HARD | PHP_STREAM_CAST_RELEASE | PHP_STREAM_CAST_INTERNAL) -BEGIN_EXTERN_C() -PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC); -END_EXTERN_C() -/* use this to check if a stream can be cast into another form */ -#define php_stream_can_cast(stream, as) _php_stream_cast((stream), (as), NULL, 0 TSRMLS_CC) -#define php_stream_cast(stream, as, ret, show_err) _php_stream_cast((stream), (as), (ret), (show_err) TSRMLS_CC) - -/* use this to check if a stream is of a particular type: - * PHPAPI int php_stream_is(php_stream *stream, php_stream_ops *ops); */ -#define php_stream_is(stream, anops) ((stream)->ops == anops) -#define PHP_STREAM_IS_STDIO &php_stream_stdio_ops - -#define php_stream_is_persistent(stream) (stream)->is_persistent - -/* Wrappers support */ - -#define IGNORE_PATH 0 -#define USE_PATH 1 -#define IGNORE_URL 2 -#define ENFORCE_SAFE_MODE 4 -#define REPORT_ERRORS 8 -/* If you don't need to write to the stream, but really need to - * be able to seek, use this flag in your options. */ -#define STREAM_MUST_SEEK 16 -/* If you are going to end up casting the stream into a FILE* or - * a socket, pass this flag and the streams/wrappers will not use - * buffering mechanisms while reading the headers, so that HTTP - * wrapped streams will work consistently. - * If you omit this flag, streams will use buffering and should end - * up working more optimally. - * */ -#define STREAM_WILL_CAST 32 - -/* this flag applies to php_stream_locate_url_wrapper */ -#define STREAM_LOCATE_WRAPPERS_ONLY 64 - -/* this flag is only used by include/require functions */ -#define STREAM_OPEN_FOR_INCLUDE 128 - -/* this flag tells streams to ONLY open urls */ -#define STREAM_USE_URL 256 - -/* this flag is used when only the headers from HTTP request are to be fetched */ -#define STREAM_ONLY_GET_HEADERS 512 - -/* don't apply open_basedir checks */ -#define STREAM_DISABLE_OPEN_BASEDIR 1024 - -/* get (or create) a persistent version of the stream */ -#define STREAM_OPEN_PERSISTENT 2048 - -/* don't check allow_url_fopen and allow_url_include */ -#define STREAM_DISABLE_URL_PROTECTION 0x00002000 - -/* Antique - no longer has meaning */ -#define IGNORE_URL_WIN 0 - -int php_init_stream_wrappers(int module_number TSRMLS_DC); -int php_shutdown_stream_wrappers(int module_number TSRMLS_DC); -void php_shutdown_stream_hashes(TSRMLS_D); -PHP_RSHUTDOWN_FUNCTION(streams); - -BEGIN_EXTERN_C() -PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); -PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC); -PHPAPI int php_register_url_stream_wrapper_volatile(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); -PHPAPI int php_unregister_url_stream_wrapper_volatile(char *protocol TSRMLS_DC); -PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char **path_for_open, int options TSRMLS_DC); -PHPAPI char *php_stream_locate_eol(php_stream *stream, char *buf, size_t buf_len TSRMLS_DC); - -#define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC TSRMLS_CC) -#define php_stream_open_wrapper_ex(path, mode, options, opened, context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_CC TSRMLS_CC) - -#define php_stream_get_from_zval(stream, zstream, mode, options, opened, context) \ - if (Z_TYPE_PP((zstream)) == IS_RESOURCE) { \ - php_stream_from_zval((stream), (zstream)); \ - } else (stream) = Z_TYPE_PP((zstream)) == IS_STRING ? \ - php_stream_open_wrapper_ex(Z_STRVAL_PP((zstream)), (mode), (options), (opened), (context)) : NULL - -/* pushes an error message onto the stack for a wrapper instance */ -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...); - - -#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */ -#define PHP_STREAM_RELEASED 1 /* newstream should be used; origstream is no longer valid */ -#define PHP_STREAM_FAILED 2 /* an error occurred while attempting conversion */ -#define PHP_STREAM_CRITICAL 3 /* an error occurred; origstream is in an unknown state; you should close origstream */ -#define PHP_STREAM_NO_PREFERENCE 0 -#define PHP_STREAM_PREFER_STDIO 1 -#define PHP_STREAM_FORCE_CONVERSION 2 -/* DO NOT call this on streams that are referenced by resources! */ -PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC TSRMLS_DC); -#define php_stream_make_seekable(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_CC TSRMLS_CC) - -/* Give other modules access to the url_stream_wrappers_hash and stream_filters_hash */ -PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(TSRMLS_D); -#define php_stream_get_url_stream_wrappers_hash() _php_stream_get_url_stream_wrappers_hash(TSRMLS_C) -PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void); -PHPAPI HashTable *_php_get_stream_filters_hash(TSRMLS_D); -#define php_get_stream_filters_hash() _php_get_stream_filters_hash(TSRMLS_C) -PHPAPI HashTable *php_get_stream_filters_hash_global(void); -END_EXTERN_C() -#endif - -/* Definitions for user streams */ -#define PHP_STREAM_IS_URL 1 - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_syslog.h b/main/php_syslog.h deleted file mode 100644 index afd1d71181718..0000000000000 --- a/main/php_syslog.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_SYSLOG_H -#define PHP_SYSLOG_H - -#ifdef PHP_WIN32 -#include "win32/syslog.h" -#else -#include -#ifdef HAVE_SYSLOG_H -#include -#endif -#endif - -/* - * The SCO OpenServer 5 Development System (not the UDK) - * defines syslog to std_syslog. - */ - -#ifdef syslog - -#ifdef HAVE_STD_SYSLOG -#define php_syslog std_syslog -#endif - -#undef syslog - -#endif - -#ifndef php_syslog -#define php_syslog syslog -#endif - -#endif diff --git a/main/php_ticks.c b/main/php_ticks.c deleted file mode 100644 index ffc1dabf5941c..0000000000000 --- a/main/php_ticks.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Stig Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_ticks.h" - -int php_startup_ticks(TSRMLS_D) -{ - zend_llist_init(&PG(tick_functions), sizeof(void(*)(int)), NULL, 1); - return SUCCESS; -} - -void php_deactivate_ticks(TSRMLS_D) -{ - zend_llist_clean(&PG(tick_functions)); -} - -void php_shutdown_ticks(TSRMLS_D) -{ - zend_llist_destroy(&PG(tick_functions)); -} - -static int php_compare_tick_functions(void *elem1, void *elem2) -{ - void(*func1)(int); - void(*func2)(int); - memcpy(&func1, elem1, sizeof(void(*)(int))); - memcpy(&func2, elem2, sizeof(void(*)(int))); - return (func1 == func2); -} - -PHPAPI void php_add_tick_function(void (*func)(int)) -{ - TSRMLS_FETCH(); - - zend_llist_add_element(&PG(tick_functions), (void *)&func); -} - -PHPAPI void php_remove_tick_function(void (*func)(int)) -{ - TSRMLS_FETCH(); - - zend_llist_del_element(&PG(tick_functions), (void *)func, - (int(*)(void*, void*))php_compare_tick_functions); -} - -static void php_tick_iterator(void *data, void *arg TSRMLS_DC) -{ - void (*func)(int); - - memcpy(&func, data, sizeof(void(*)(int))); - func(*((int *)arg)); -} - -void php_run_ticks(int count) -{ - TSRMLS_FETCH(); - - zend_llist_apply_with_argument(&PG(tick_functions), (llist_apply_with_arg_func_t) php_tick_iterator, &count TSRMLS_CC); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_ticks.h b/main/php_ticks.h deleted file mode 100644 index 9dc930746f4ce..0000000000000 --- a/main/php_ticks.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Stig Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_TICKS_H -#define PHP_TICKS_H - -int php_startup_ticks(TSRMLS_D); -void php_deactivate_ticks(TSRMLS_D); -void php_shutdown_ticks(TSRMLS_D); -void php_run_ticks(int count); - -BEGIN_EXTERN_C() -PHPAPI void php_add_tick_function(void (*func)(int)); -PHPAPI void php_remove_tick_function(void (*func)(int)); -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/php_variables.c b/main/php_variables.c deleted file mode 100644 index 3a1c170651b0a..0000000000000 --- a/main/php_variables.c +++ /dev/null @@ -1,892 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include "php.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/credits.h" -#include "php_variables.h" -#include "php_globals.h" -#include "php_content_types.h" -#include "SAPI.h" -#include "php_logos.h" -#include "zend_globals.h" - -/* for systems that need to override reading of environment variables */ -void _php_import_environment_variables(zval *array_ptr TSRMLS_DC); -PHPAPI void (*php_import_environment_variables)(zval *array_ptr TSRMLS_DC) = _php_import_environment_variables; - -PHPAPI void php_register_variable(char *var, char *strval, zval *track_vars_array TSRMLS_DC) -{ - php_register_variable_safe(var, strval, strlen(strval), track_vars_array TSRMLS_CC); -} - -/* binary-safe version */ -PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zval *track_vars_array TSRMLS_DC) -{ - zval new_entry; - assert(strval != NULL); - - /* Prepare value */ - Z_STRLEN(new_entry) = str_len; - if (PG(magic_quotes_gpc)) { - Z_STRVAL(new_entry) = php_addslashes(strval, Z_STRLEN(new_entry), &Z_STRLEN(new_entry), 0 TSRMLS_CC); - } else { - Z_STRVAL(new_entry) = estrndup(strval, Z_STRLEN(new_entry)); - } - Z_TYPE(new_entry) = IS_STRING; - - php_register_variable_ex(var, &new_entry, track_vars_array TSRMLS_CC); -} - -PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars_array TSRMLS_DC) -{ - char *p = NULL; - char *ip; /* index pointer */ - char *index, *escaped_index = NULL; - char *var, *var_orig; - int var_len, index_len; - zval *gpc_element, **gpc_element_p; - zend_bool is_array = 0; - HashTable *symtable1 = NULL; - - assert(var_name != NULL); - - if (track_vars_array) { - symtable1 = Z_ARRVAL_P(track_vars_array); - } else if (PG(register_globals)) { - symtable1 = EG(active_symbol_table); - } - if (!symtable1) { - /* Nothing to do */ - zval_dtor(val); - return; - } - - /* - * Prepare variable name - */ - - var_orig = estrdup(var_name); - var = var_orig; - /* ignore leading spaces in the variable name */ - while (*var && *var==' ') { - var++; - } - - /* ensure that we don't have spaces or dots in the variable name (not binary safe) */ - for (p = var; *p; p++) { - if (*p == ' ' || *p == '.') { - *p='_'; - } else if (*p == '[') { - is_array = 1; - ip = p; - *p = 0; - break; - } - } - var_len = p - var; - - if (var_len==0) { /* empty variable name, or variable name with a space in it */ - zval_dtor(val); - efree(var_orig); - return; - } - - /* GLOBALS hijack attempt, reject parameter */ - if (symtable1 == EG(active_symbol_table) && - var_len == sizeof("GLOBALS")-1 && - !memcmp(var, "GLOBALS", sizeof("GLOBALS")-1)) { - zval_dtor(val); - efree(var_orig); - return; - } - - index = var; - index_len = var_len; - - if (is_array) { - int nest_level = 0; - while (1) { - char *index_s; - int new_idx_len = 0; - - if(++nest_level > PG(max_input_nesting_level)) { - HashTable *ht; - /* too many levels of nesting */ - - if (track_vars_array) { - ht = Z_ARRVAL_P(track_vars_array); - } else if (PG(register_globals)) { - ht = EG(active_symbol_table); - } - - zend_hash_del(ht, var, var_len + 1); - zval_dtor(val); - - /* do not output the error message to the screen, - this helps us to to avoid "information disclosure" */ - if (!PG(display_errors)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variable nesting level exceeded %ld. To increase the limit change max_input_nesting_level in php.ini.", PG(max_input_nesting_level)); - } - efree(var_orig); - return; - } - - ip++; - index_s = ip; - if (isspace(*ip)) { - ip++; - } - if (*ip==']') { - index_s = NULL; - } else { - ip = strchr(ip, ']'); - if (!ip) { - /* PHP variables cannot contain '[' in their names, so we replace the character with a '_' */ - *(index_s - 1) = '_'; - - index_len = 0; - if (index) { - index_len = strlen(index); - } - goto plain_var; - return; - } - *ip = 0; - new_idx_len = strlen(index_s); - } - - if (!index) { - MAKE_STD_ZVAL(gpc_element); - array_init(gpc_element); - zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } else { - if (PG(magic_quotes_gpc)) { - escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - } else { - escaped_index = index; - } - if (zend_symtable_find(symtable1, escaped_index, index_len + 1, (void **) &gpc_element_p) == FAILURE - || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) { - MAKE_STD_ZVAL(gpc_element); - array_init(gpc_element); - zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } - if (index != escaped_index) { - efree(escaped_index); - } - } - symtable1 = Z_ARRVAL_PP(gpc_element_p); - /* ip pointed to the '[' character, now obtain the key */ - index = index_s; - index_len = new_idx_len; - - ip++; - if (*ip == '[') { - is_array = 1; - *ip = 0; - } else { - goto plain_var; - } - } - } else { -plain_var: - MAKE_STD_ZVAL(gpc_element); - gpc_element->value = val->value; - Z_TYPE_P(gpc_element) = Z_TYPE_P(val); - if (!index) { - zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } else { - if (PG(magic_quotes_gpc)) { - escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); - } else { - escaped_index = index; - } - /* - * According to rfc2965, more specific paths are listed above the less specific ones. - * If we encounter a duplicate cookie name, we should skip it, since it is not possible - * to have the same (plain text) cookie name for the same path and we should not overwrite - * more specific cookies with the less specific ones. - */ - if (PG(http_globals)[TRACK_VARS_COOKIE] && - symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) && - zend_symtable_exists(symtable1, escaped_index, index_len + 1)) { - zval_ptr_dtor(&gpc_element); - } else { - zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); - } - if (escaped_index != index) { - efree(escaped_index); - } - } - } - efree(var_orig); -} - -SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler) -{ - char *var, *val, *e, *s, *p; - zval *array_ptr = (zval *) arg; - - if (SG(request_info).post_data == NULL) { - return; - } - - s = SG(request_info).post_data; - e = s + SG(request_info).post_data_length; - - while (s < e && (p = memchr(s, '&', (e - s)))) { -last_value: - if ((val = memchr(s, '=', (p - s)))) { /* have a value */ - unsigned int val_len, new_val_len; - - var = s; - - php_url_decode(var, (val - s)); - val++; - val_len = php_url_decode(val, (p - val)); - val = estrndup(val, val_len); - if (sapi_module.input_filter(PARSE_POST, var, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); - } - efree(val); - } - s = p + 1; - } - if (s < e) { - p = e; - goto last_value; - } -} - -SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter) -{ - /* TODO: check .ini setting here and apply user-defined input filter */ - if(new_val_len) *new_val_len = val_len; - return 1; -} - -SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data) -{ - char *res = NULL, *var, *val, *separator = NULL; - const char *c_var; - zval *array_ptr; - int free_buffer = 0; - char *strtok_buf = NULL; - - switch (arg) { - case PARSE_POST: - case PARSE_GET: - case PARSE_COOKIE: - ALLOC_ZVAL(array_ptr); - array_init(array_ptr); - INIT_PZVAL(array_ptr); - switch (arg) { - case PARSE_POST: - if (PG(http_globals)[TRACK_VARS_POST]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_POST]); - } - PG(http_globals)[TRACK_VARS_POST] = array_ptr; - break; - case PARSE_GET: - if (PG(http_globals)[TRACK_VARS_GET]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_GET]); - } - PG(http_globals)[TRACK_VARS_GET] = array_ptr; - break; - case PARSE_COOKIE: - if (PG(http_globals)[TRACK_VARS_COOKIE]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_COOKIE]); - } - PG(http_globals)[TRACK_VARS_COOKIE] = array_ptr; - break; - } - break; - default: - array_ptr = destArray; - break; - } - - if (arg == PARSE_POST) { - sapi_handle_post(array_ptr TSRMLS_CC); - return; - } - - if (arg == PARSE_GET) { /* GET data */ - c_var = SG(request_info).query_string; - if (c_var && *c_var) { - res = (char *) estrdup(c_var); - free_buffer = 1; - } else { - free_buffer = 0; - } - } else if (arg == PARSE_COOKIE) { /* Cookie data */ - c_var = SG(request_info).cookie_data; - if (c_var && *c_var) { - res = (char *) estrdup(c_var); - free_buffer = 1; - } else { - free_buffer = 0; - } - } else if (arg == PARSE_STRING) { /* String data */ - res = str; - free_buffer = 1; - } - - if (!res) { - return; - } - - switch (arg) { - case PARSE_GET: - case PARSE_STRING: - separator = (char *) estrdup(PG(arg_separator).input); - break; - case PARSE_COOKIE: - separator = ";\0"; - break; - } - - var = php_strtok_r(res, separator, &strtok_buf); - - while (var) { - val = strchr(var, '='); - - if (arg == PARSE_COOKIE) { - /* Remove leading spaces from cookie names, needed for multi-cookie header where ; can be followed by a space */ - while (isspace(*var)) { - var++; - } - if (var == val || *var == '\0') { - goto next_cookie; - } - } - - if (val) { /* have a value */ - int val_len; - unsigned int new_val_len; - - *val++ = '\0'; - php_url_decode(var, strlen(var)); - val_len = php_url_decode(val, strlen(val)); - val = estrndup(val, val_len); - if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); - } - efree(val); - } else { - int val_len; - unsigned int new_val_len; - - php_url_decode(var, strlen(var)); - val_len = 0; - val = estrndup("", val_len); - if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); - } - efree(val); - } -next_cookie: - var = php_strtok_r(NULL, separator, &strtok_buf); - } - - if (arg != PARSE_COOKIE) { - efree(separator); - } - - if (free_buffer) { - efree(res); - } -} - -void _php_import_environment_variables(zval *array_ptr TSRMLS_DC) -{ - char buf[128]; - char **env, *p, *t = buf; - size_t alloc_size = sizeof(buf); - unsigned long nlen; /* ptrdiff_t is not portable */ - - /* turn off magic_quotes while importing environment variables */ - int magic_quotes_gpc = PG(magic_quotes_gpc); - PG(magic_quotes_gpc) = 0; - - for (env = environ; env != NULL && *env != NULL; env++) { - p = strchr(*env, '='); - if (!p) { /* malformed entry? */ - continue; - } - nlen = p - *env; - if (nlen >= alloc_size) { - alloc_size = nlen + 64; - t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size)); - } - memcpy(t, *env, nlen); - t[nlen] = '\0'; - php_register_variable(t, p + 1, array_ptr TSRMLS_CC); - } - if (t != buf && t != NULL) { - efree(t); - } - PG(magic_quotes_gpc) = magic_quotes_gpc; -} - -zend_bool php_std_auto_global_callback(char *name, uint name_len TSRMLS_DC) -{ - zend_printf("%s\n", name); - return 0; /* don't rearm */ -} - -/* {{{ php_build_argv - */ -static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC) -{ - zval *arr, *argc, *tmp; - int count = 0; - char *ss, *space; - - if (!(PG(register_globals) || SG(request_info).argc || track_vars_array)) { - return; - } - - ALLOC_INIT_ZVAL(arr); - array_init(arr); - - /* Prepare argv */ - if (SG(request_info).argc) { /* are we in cli sapi? */ - int i; - for (i = 0; i < SG(request_info).argc; i++) { - ALLOC_ZVAL(tmp); - Z_TYPE_P(tmp) = IS_STRING; - Z_STRLEN_P(tmp) = strlen(SG(request_info).argv[i]); - Z_STRVAL_P(tmp) = estrndup(SG(request_info).argv[i], Z_STRLEN_P(tmp)); - INIT_PZVAL(tmp); - if (zend_hash_next_index_insert(Z_ARRVAL_P(arr), &tmp, sizeof(zval *), NULL) == FAILURE) { - if (Z_TYPE_P(tmp) == IS_STRING) { - efree(Z_STRVAL_P(tmp)); - } - } - } - } else if (s && *s) { - ss = s; - while (ss) { - space = strchr(ss, '+'); - if (space) { - *space = '\0'; - } - /* auto-type */ - ALLOC_ZVAL(tmp); - Z_TYPE_P(tmp) = IS_STRING; - Z_STRLEN_P(tmp) = strlen(ss); - Z_STRVAL_P(tmp) = estrndup(ss, Z_STRLEN_P(tmp)); - INIT_PZVAL(tmp); - count++; - if (zend_hash_next_index_insert(Z_ARRVAL_P(arr), &tmp, sizeof(zval *), NULL) == FAILURE) { - if (Z_TYPE_P(tmp) == IS_STRING) { - efree(Z_STRVAL_P(tmp)); - } - } - if (space) { - *space = '+'; - ss = space + 1; - } else { - ss = space; - } - } - } - - /* prepare argc */ - ALLOC_INIT_ZVAL(argc); - if (SG(request_info).argc) { - Z_LVAL_P(argc) = SG(request_info).argc; - } else { - Z_LVAL_P(argc) = count; - } - Z_TYPE_P(argc) = IS_LONG; - - if (PG(register_globals) || SG(request_info).argc) { - arr->refcount++; - argc->refcount++; - zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); - zend_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL); - } - if (track_vars_array) { - arr->refcount++; - argc->refcount++; - zend_hash_update(Z_ARRVAL_P(track_vars_array), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); - zend_hash_update(Z_ARRVAL_P(track_vars_array), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL); - } - zval_ptr_dtor(&arr); - zval_ptr_dtor(&argc); -} -/* }}} */ - -/* {{{ php_handle_special_queries - */ -PHPAPI int php_handle_special_queries(TSRMLS_D) -{ - if (PG(expose_php) && SG(request_info).query_string && SG(request_info).query_string[0] == '=') { - if (php_info_logos(SG(request_info).query_string + 1 TSRMLS_CC)) { - return 1; - } else if (!strcmp(SG(request_info).query_string + 1, PHP_CREDITS_GUID)) { - php_print_credits(PHP_CREDITS_ALL TSRMLS_CC); - return 1; - } - } - return 0; -} -/* }}} */ - -/* {{{ php_register_server_variables - */ -static inline void php_register_server_variables(TSRMLS_D) -{ - zval *array_ptr = NULL; - /* turn off magic_quotes while importing server variables */ - int magic_quotes_gpc = PG(magic_quotes_gpc); - - ALLOC_ZVAL(array_ptr); - array_init(array_ptr); - INIT_PZVAL(array_ptr); - if (PG(http_globals)[TRACK_VARS_SERVER]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]); - } - PG(http_globals)[TRACK_VARS_SERVER] = array_ptr; - PG(magic_quotes_gpc) = 0; - - /* Server variables */ - if (sapi_module.register_server_variables) { - sapi_module.register_server_variables(array_ptr TSRMLS_CC); - } - - /* PHP Authentication support */ - if (SG(request_info).auth_user) { - php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, array_ptr TSRMLS_CC); - } - if (SG(request_info).auth_password) { - php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, array_ptr TSRMLS_CC); - } - if (SG(request_info).auth_digest) { - php_register_variable("PHP_AUTH_DIGEST", SG(request_info).auth_digest, array_ptr TSRMLS_CC); - } - /* store request init time */ - { - zval new_entry; - Z_TYPE(new_entry) = IS_LONG; - Z_LVAL(new_entry) = sapi_get_request_time(TSRMLS_C); - php_register_variable_ex("REQUEST_TIME", &new_entry, array_ptr TSRMLS_CC); - } - - PG(magic_quotes_gpc) = magic_quotes_gpc; -} -/* }}} */ - -/* {{{ php_autoglobal_merge - */ -static void php_autoglobal_merge(HashTable *dest, HashTable *src TSRMLS_DC) -{ - zval **src_entry, **dest_entry; - char *string_key; - uint string_key_len; - ulong num_key; - HashPosition pos; - int key_type; - int globals_check = (PG(register_globals) && (dest == (&EG(symbol_table)))); - - zend_hash_internal_pointer_reset_ex(src, &pos); - while (zend_hash_get_current_data_ex(src, (void **)&src_entry, &pos) == SUCCESS) { - key_type = zend_hash_get_current_key_ex(src, &string_key, &string_key_len, &num_key, 0, &pos); - if (Z_TYPE_PP(src_entry) != IS_ARRAY - || (key_type == HASH_KEY_IS_STRING && zend_hash_find(dest, string_key, string_key_len, (void **) &dest_entry) != SUCCESS) - || (key_type == HASH_KEY_IS_LONG && zend_hash_index_find(dest, num_key, (void **)&dest_entry) != SUCCESS) - || Z_TYPE_PP(dest_entry) != IS_ARRAY - ) { - (*src_entry)->refcount++; - if (key_type == HASH_KEY_IS_STRING) { - /* if register_globals is on and working with main symbol table, prevent overwriting of GLOBALS */ - if (!globals_check || string_key_len != sizeof("GLOBALS") || memcmp(string_key, "GLOBALS", sizeof("GLOBALS") - 1)) { - zend_hash_update(dest, string_key, string_key_len, src_entry, sizeof(zval *), NULL); - } else { - (*src_entry)->refcount--; - } - } else { - zend_hash_index_update(dest, num_key, src_entry, sizeof(zval *), NULL); - } - } else { - SEPARATE_ZVAL(dest_entry); - php_autoglobal_merge(Z_ARRVAL_PP(dest_entry), Z_ARRVAL_PP(src_entry) TSRMLS_CC); - } - zend_hash_move_forward_ex(src, &pos); - } -} -/* }}} */ - -static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC); -static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC); -static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRMLS_DC); - -/* {{{ php_hash_environment - */ -int php_hash_environment(TSRMLS_D) -{ - char *p; - unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0}; - zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays)); - struct auto_global_record { - char *name; - uint name_len; - char *long_name; - uint long_name_len; - zend_bool jit_initialization; - } auto_global_records[] = { - { "_POST", sizeof("_POST"), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), 0 }, - { "_GET", sizeof("_GET"), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), 0 }, - { "_COOKIE", sizeof("_COOKIE"), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), 0 }, - { "_SERVER", sizeof("_SERVER"), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), 1 }, - { "_ENV", sizeof("_ENV"), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), 1 }, - { "_FILES", sizeof("_FILES"), "HTTP_POST_FILES", sizeof("HTTP_POST_FILES"), 0 }, - }; - size_t num_track_vars = sizeof(auto_global_records)/sizeof(struct auto_global_record); - size_t i; - - /* jit_initialization = 0; */ - for (i=0; irefcount++; - zend_hash_update(&EG(symbol_table), auto_global_records[i].name, auto_global_records[i].name_len, &PG(http_globals)[i], sizeof(zval *), NULL); - if (PG(register_long_arrays)) { - zend_hash_update(&EG(symbol_table), auto_global_records[i].long_name, auto_global_records[i].long_name_len, &PG(http_globals)[i], sizeof(zval *), NULL); - PG(http_globals)[i]->refcount++; - } - } - - /* Create _REQUEST */ - if (!jit_initialization) { - zend_auto_global_disable_jit("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC); - php_auto_globals_create_request("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC); - } - - return SUCCESS; -} -/* }}} */ - -static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC) -{ - if (PG(variables_order) && (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s'))) { - php_register_server_variables(TSRMLS_C); - - if (PG(register_argc_argv)) { - if (SG(request_info).argc) { - zval **argc, **argv; - - if (zend_hash_find(&EG(symbol_table), "argc", sizeof("argc"), (void**)&argc) == SUCCESS && - zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void**)&argv) == SUCCESS) { - (*argc)->refcount++; - (*argv)->refcount++; - zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), argv, sizeof(zval *), NULL); - zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "argc", sizeof("argc"), argc, sizeof(zval *), NULL); - } - } else { - php_build_argv(SG(request_info).query_string, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC); - } - } - - } else { - zval *server_vars=NULL; - ALLOC_ZVAL(server_vars); - array_init(server_vars); - INIT_PZVAL(server_vars); - if (PG(http_globals)[TRACK_VARS_SERVER]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]); - } - PG(http_globals)[TRACK_VARS_SERVER] = server_vars; - } - - zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); - PG(http_globals)[TRACK_VARS_SERVER]->refcount++; - - if (PG(register_long_arrays)) { - zend_hash_update(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); - PG(http_globals)[TRACK_VARS_SERVER]->refcount++; - } - - return 0; /* don't rearm */ -} - -static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC) -{ - zval *env_vars = NULL; - ALLOC_ZVAL(env_vars); - array_init(env_vars); - INIT_PZVAL(env_vars); - if (PG(http_globals)[TRACK_VARS_ENV]) { - zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_ENV]); - } - PG(http_globals)[TRACK_VARS_ENV] = env_vars; - - if (PG(variables_order) && (strchr(PG(variables_order),'E') || strchr(PG(variables_order),'e'))) { - php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC); - } - - zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); - PG(http_globals)[TRACK_VARS_ENV]->refcount++; - - if (PG(register_long_arrays)) { - zend_hash_update(&EG(symbol_table), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); - PG(http_globals)[TRACK_VARS_ENV]->refcount++; - } - - return 0; /* don't rearm */ -} - -static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRMLS_DC) -{ - zval *form_variables; - unsigned char _gpc_flags[3] = {0, 0, 0}; - char *p; - - ALLOC_ZVAL(form_variables); - array_init(form_variables); - INIT_PZVAL(form_variables); - - for (p = PG(variables_order); p && *p; p++) { - switch (*p) { - case 'g': - case 'G': - if (!_gpc_flags[0]) { - php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC); - _gpc_flags[0] = 1; - } - break; - case 'p': - case 'P': - if (!_gpc_flags[1]) { - php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC); - _gpc_flags[1] = 1; - } - break; - case 'c': - case 'C': - if (!_gpc_flags[2]) { - php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC); - _gpc_flags[2] = 1; - } - break; - } - } - - zend_hash_update(&EG(symbol_table), "_REQUEST", sizeof("_REQUEST"), &form_variables, sizeof(zval *), NULL); - return 0; -} - -void php_startup_auto_globals(TSRMLS_D) -{ - zend_register_auto_global("_GET", sizeof("_GET")-1, NULL TSRMLS_CC); - zend_register_auto_global("_POST", sizeof("_POST")-1, NULL TSRMLS_CC); - zend_register_auto_global("_COOKIE", sizeof("_COOKIE")-1, NULL TSRMLS_CC); - zend_register_auto_global("_SERVER", sizeof("_SERVER")-1, php_auto_globals_create_server TSRMLS_CC); - zend_register_auto_global("_ENV", sizeof("_ENV")-1, php_auto_globals_create_env TSRMLS_CC); - zend_register_auto_global("_REQUEST", sizeof("_REQUEST")-1, php_auto_globals_create_request TSRMLS_CC); - zend_register_auto_global("_FILES", sizeof("_FILES")-1, NULL TSRMLS_CC); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/php_variables.h b/main/php_variables.h deleted file mode 100644 index 5043f6049c579..0000000000000 --- a/main/php_variables.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_VARIABLES_H -#define PHP_VARIABLES_H - -#include "php.h" -#include "SAPI.h" - -#define PARSE_POST 0 -#define PARSE_GET 1 -#define PARSE_COOKIE 2 -#define PARSE_STRING 3 -#define PARSE_ENV 4 -#define PARSE_SERVER 5 -#define PARSE_SESSION 6 - -BEGIN_EXTERN_C() -void php_startup_auto_globals(TSRMLS_D); -extern PHPAPI void (*php_import_environment_variables)(zval *array_ptr TSRMLS_DC); -PHPAPI void php_register_variable(char *var, char *val, zval *track_vars_array TSRMLS_DC); -/* binary-safe version */ -PHPAPI void php_register_variable_safe(char *var, char *val, int val_len, zval *track_vars_array TSRMLS_DC); -PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_array TSRMLS_DC); - -int php_hash_environment(TSRMLS_D); -END_EXTERN_C() - -#define NUM_TRACK_VARS 6 - -#endif /* PHP_VARIABLES_H */ diff --git a/main/php_version.h b/main/php_version.h deleted file mode 100644 index 91fb29af94b08..0000000000000 --- a/main/php_version.h +++ /dev/null @@ -1,8 +0,0 @@ -/* automatically generated by configure */ -/* edit configure.in to change version number */ -#define PHP_MAJOR_VERSION 5 -#define PHP_MINOR_VERSION 2 -#define PHP_RELEASE_VERSION 9 -#define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "5.2.9-dev" -#define PHP_VERSION_ID 50209 diff --git a/main/reentrancy.c b/main/reentrancy.c deleted file mode 100644 index 8cfab5af06769..0000000000000 --- a/main/reentrancy.c +++ /dev/null @@ -1,450 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include -#include -#ifdef HAVE_DIRENT_H -#include -#endif - -#include "php_reentrancy.h" -#include "ext/standard/php_rand.h" /* for PHP_RAND_MAX */ - -enum { - LOCALTIME_R, - CTIME_R, - ASCTIME_R, - GMTIME_R, - READDIR_R, - NUMBER_OF_LOCKS -}; - -#if defined(PHP_NEED_REENTRANCY) - -#include - -static MUTEX_T reentrant_locks[NUMBER_OF_LOCKS]; - -#define local_lock(x) tsrm_mutex_lock(reentrant_locks[x]) -#define local_unlock(x) tsrm_mutex_unlock(reentrant_locks[x]) - -#else - -#define local_lock(x) -#define local_unlock(x) - -#endif - -#if defined(PHP_IRIX_TIME_R) - -#define HAVE_CTIME_R 1 -#define HAVE_ASCTIME_R 1 - -PHPAPI char *php_ctime_r(const time_t *clock, char *buf) -{ - if (ctime_r(clock, buf, 26) == buf) - return (buf); - return (NULL); -} - -PHPAPI char *php_asctime_r(const struct tm *tm, char *buf) -{ - if (asctime_r(tm, buf, 26) == buf) - return (buf); - return (NULL); -} - -#endif - -#if defined(PHP_HPUX_TIME_R) - -#define HAVE_LOCALTIME_R 1 -#define HAVE_CTIME_R 1 -#define HAVE_ASCTIME_R 1 -#define HAVE_GMTIME_R 1 - -PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm) -{ - if (localtime_r(timep, p_tm) == 0) - return (p_tm); - return (NULL); -} - -PHPAPI char *php_ctime_r(const time_t *clock, char *buf) -{ - if (ctime_r(clock, buf, 26) != -1) - return (buf); - return (NULL); -} - -PHPAPI char *php_asctime_r(const struct tm *tm, char *buf) -{ - if (asctime_r(tm, buf, 26) != -1) - return (buf); - return (NULL); -} - -PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm) -{ - if (gmtime_r(timep, p_tm) == 0) - return (p_tm); - return (NULL); -} - -#endif - -#if defined(__BEOS__) - -PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm) -{ - /* Modified according to LibC definition */ - if (((struct tm*)gmtime_r(timep, p_tm)) == p_tm) - return (p_tm); - return (NULL); -} - -#endif /* BEOS */ - -#if !defined(HAVE_POSIX_READDIR_R) - -PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry, - struct dirent **result) -{ -#if defined(HAVE_OLD_READDIR_R) - int ret = 0; - - /* We cannot rely on the return value of readdir_r - as it differs between various platforms - (HPUX returns 0 on success whereas Solaris returns non-zero) - */ - entry->d_name[0] = '\0'; - readdir_r(dirp, entry); - - if (entry->d_name[0] == '\0') { - *result = NULL; - ret = errno; - } else { - *result = entry; - } - return ret; -#else - struct dirent *ptr; - int ret = 0; - - local_lock(READDIR_R); - - errno = 0; - - ptr = readdir(dirp); - - if (!ptr && errno != 0) - ret = errno; - - if (ptr) - memcpy(entry, ptr, sizeof(*ptr)); - - *result = ptr; - - local_unlock(READDIR_R); - - return ret; -#endif -} - -#endif - -#if !defined(HAVE_LOCALTIME_R) && defined(HAVE_LOCALTIME) - -PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm) -{ - struct tm *tmp; - - local_lock(LOCALTIME_R); - - tmp = localtime(timep); - if (tmp) { - memcpy(p_tm, tmp, sizeof(struct tm)); - tmp = p_tm; - } - - local_unlock(LOCALTIME_R); - - return tmp; -} - -#endif - -#if !defined(HAVE_CTIME_R) && defined(HAVE_CTIME) - -PHPAPI char *php_ctime_r(const time_t *clock, char *buf) -{ - char *tmp; - - local_lock(CTIME_R); - - tmp = ctime(clock); - strcpy(buf, tmp); - - local_unlock(CTIME_R); - - return buf; -} - -#endif - -#if !defined(HAVE_ASCTIME_R) && defined(HAVE_ASCTIME) - -PHPAPI char *php_asctime_r(const struct tm *tm, char *buf) -{ - char *tmp; - - local_lock(ASCTIME_R); - - tmp = asctime(tm); - strcpy(buf, tmp); - - local_unlock(ASCTIME_R); - - return buf; -} - -#endif - -#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME) - -PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm) -{ - struct tm *tmp; - - local_lock(GMTIME_R); - - tmp = gmtime(timep); - if (tmp) { - memcpy(p_tm, tmp, sizeof(struct tm)); - tmp = p_tm; - } - - local_unlock(GMTIME_R); - - return tmp; -} - -#endif - -#if defined(PHP_NEED_REENTRANCY) - -void reentrancy_startup(void) -{ - int i; - - for (i = 0; i < NUMBER_OF_LOCKS; i++) { - reentrant_locks[i] = tsrm_mutex_alloc(); - } -} - -void reentrancy_shutdown(void) -{ - int i; - - for (i = 0; i < NUMBER_OF_LOCKS; i++) { - tsrm_mutex_free(reentrant_locks[i]); - } -} - -#endif - -#ifndef HAVE_RAND_R - -/*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Posix rand_r function added May 1999 by Wes Peters . - */ - -#include -#include - -static int -do_rand(unsigned long *ctx) -{ - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)PHP_RAND_MAX + 1)); -} - - -PHPAPI int -php_rand_r(unsigned int *ctx) -{ - u_long val = (u_long) *ctx; - *ctx = do_rand(&val); - return (int) *ctx; -} - -#endif - - -#ifndef HAVE_STRTOK_R - -/* - * Copyright (c) 1998 Softweyr LLC. All rights reserved. - * - * strtok_r, from Berkeley strtok - * Oct 13, 1998 by Wes Peters - * - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notices, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notices, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * - * This product includes software developed by Softweyr LLC, the - * University of California, Berkeley, and its contributors. - * - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY SOFTWEYR LLC, THE REGENTS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTWEYR LLC, THE - * REGENTS, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include - -PHPAPI char * -php_strtok_r(char *s, const char *delim, char **last) -{ - char *spanp; - int c, sc; - char *tok; - - if (s == NULL && (s = *last) == NULL) - { - return NULL; - } - - /* - * Skip (span) leading delimiters (s += strspn(s, delim), sort of). - */ -cont: - c = *s++; - for (spanp = (char *)delim; (sc = *spanp++) != 0; ) - { - if (c == sc) - { - goto cont; - } - } - - if (c == 0) /* no non-delimiter characters */ - { - *last = NULL; - return NULL; - } - tok = s - 1; - - /* - * Scan token (scan for delimiters: s += strcspn(s, delim), sort of). - * Note that delim must have one NUL; we stop if we see that, too. - */ - for (;;) - { - c = *s++; - spanp = (char *)delim; - do - { - if ((sc = *spanp++) == c) - { - if (c == 0) - { - s = NULL; - } - else - { - char *w = s - 1; - *w = '\0'; - } - *last = s; - return tok; - } - } - while (sc != 0); - } - /* NOTREACHED */ -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/rfc1867.c b/main/rfc1867.c deleted file mode 100644 index 83ed170a7b199..0000000000000 --- a/main/rfc1867.c +++ /dev/null @@ -1,1367 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Jani Taskinen | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/). - * - */ - -#include -#include "php.h" -#include "php_open_temporary_file.h" -#include "zend_globals.h" -#include "php_globals.h" -#include "php_variables.h" -#include "rfc1867.h" - -#define DEBUG_FILE_UPLOAD ZEND_DEBUG - -PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC) = NULL; - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) -#include "ext/mbstring/mbstring.h" - -static void safe_php_register_variable(char *var, char *strval, int val_len, zval *track_vars_array, zend_bool override_protection TSRMLS_DC); - -#define SAFE_RETURN { \ - php_mb_flush_gpc_variables(num_vars, val_list, len_list, array_ptr TSRMLS_CC); \ - if (lbuf) efree(lbuf); \ - if (abuf) efree(abuf); \ - if (array_index) efree(array_index); \ - zend_hash_destroy(&PG(rfc1867_protected_variables)); \ - zend_llist_destroy(&header); \ - if (mbuff->boundary_next) efree(mbuff->boundary_next); \ - if (mbuff->boundary) efree(mbuff->boundary); \ - if (mbuff->buffer) efree(mbuff->buffer); \ - if (mbuff) efree(mbuff); \ - return; } - -void php_mb_flush_gpc_variables(int num_vars, char **val_list, int *len_list, zval *array_ptr TSRMLS_DC) -{ - int i; - if (php_mb_encoding_translation(TSRMLS_C)) { - if (num_vars > 0 && - php_mb_gpc_encoding_detector(val_list, len_list, num_vars, NULL TSRMLS_CC) == SUCCESS) { - php_mb_gpc_encoding_converter(val_list, len_list, num_vars, NULL, NULL TSRMLS_CC); - } - for (i=0; i=*num_vars_max){ - php_mb_gpc_realloc_buffer(pval_list, plen_list, num_vars_max, - 16 TSRMLS_CC); - /* in case realloc relocated the buffer */ - val_list = *pval_list; - len_list = *plen_list; - } - - val_list[*num_vars] = (char *)estrdup(param); - len_list[*num_vars] = strlen(param); - (*num_vars)++; - val_list[*num_vars] = (char *)estrdup(value); - len_list[*num_vars] = strlen(value); - (*num_vars)++; -} - -#else - -#define SAFE_RETURN { \ - if (lbuf) efree(lbuf); \ - if (abuf) efree(abuf); \ - if (array_index) efree(array_index); \ - zend_hash_destroy(&PG(rfc1867_protected_variables)); \ - zend_llist_destroy(&header); \ - if (mbuff->boundary_next) efree(mbuff->boundary_next); \ - if (mbuff->boundary) efree(mbuff->boundary); \ - if (mbuff->buffer) efree(mbuff->buffer); \ - if (mbuff) efree(mbuff); \ - return; } -#endif - -/* The longest property name we use in an uploaded file array */ -#define MAX_SIZE_OF_INDEX sizeof("[tmp_name]") - -/* The longest anonymous name */ -#define MAX_SIZE_ANONNAME 33 - -/* Errors */ -#define UPLOAD_ERROR_OK 0 /* File upload succesful */ -#define UPLOAD_ERROR_A 1 /* Uploaded file exceeded upload_max_filesize */ -#define UPLOAD_ERROR_B 2 /* Uploaded file exceeded MAX_FILE_SIZE */ -#define UPLOAD_ERROR_C 3 /* Partially uploaded */ -#define UPLOAD_ERROR_D 4 /* No file uploaded */ -#define UPLOAD_ERROR_E 6 /* Missing /tmp or similar directory */ -#define UPLOAD_ERROR_F 7 /* Failed to write file to disk */ -#define UPLOAD_ERROR_X 8 /* File upload stopped by extension */ - -void php_rfc1867_register_constants(TSRMLS_D) -{ - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_OK", UPLOAD_ERROR_OK, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_INI_SIZE", UPLOAD_ERROR_A, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_FORM_SIZE", UPLOAD_ERROR_B, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_PARTIAL", UPLOAD_ERROR_C, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_NO_FILE", UPLOAD_ERROR_D, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_NO_TMP_DIR", UPLOAD_ERROR_E, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_CANT_WRITE", UPLOAD_ERROR_F, CONST_CS | CONST_PERSISTENT); - REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_EXTENSION", UPLOAD_ERROR_X, CONST_CS | CONST_PERSISTENT); -} - -static void normalize_protected_variable(char *varname TSRMLS_DC) -{ - char *s=varname, *index=NULL, *indexend=NULL, *p; - - /* overjump leading space */ - while (*s == ' ') { - s++; - } - - /* and remove it */ - if (s != varname) { - memmove(varname, s, strlen(s)+1); - } - - for (p=varname; *p && *p != '['; p++) { - switch(*p) { - case ' ': - case '.': - *p='_'; - break; - } - } - - /* find index */ - index = strchr(varname, '['); - if (index) { - index++; - s=index; - } else { - return; - } - - /* done? */ - while (index) { - - while (*index == ' ' || *index == '\r' || *index == '\n' || *index=='\t') { - index++; - } - indexend = strchr(index, ']'); - indexend = indexend ? indexend + 1 : index + strlen(index); - - if (s != index) { - memmove(s, index, strlen(index)+1); - s += indexend-index; - } else { - s = indexend; - } - - if (*s == '[') { - s++; - index = s; - } else { - index = NULL; - } - } - *s++='\0'; -} - - -static void add_protected_variable(char *varname TSRMLS_DC) -{ - int dummy=1; - - normalize_protected_variable(varname TSRMLS_CC); - zend_hash_add(&PG(rfc1867_protected_variables), varname, strlen(varname)+1, &dummy, sizeof(int), NULL); -} - - -static zend_bool is_protected_variable(char *varname TSRMLS_DC) -{ - normalize_protected_variable(varname TSRMLS_CC); - return zend_hash_exists(&PG(rfc1867_protected_variables), varname, strlen(varname)+1); -} - - -static void safe_php_register_variable(char *var, char *strval, int val_len, zval *track_vars_array, zend_bool override_protection TSRMLS_DC) -{ - if (override_protection || !is_protected_variable(var TSRMLS_CC)) { - php_register_variable_safe(var, strval, val_len, track_vars_array TSRMLS_CC); - } -} - - -static void safe_php_register_variable_ex(char *var, zval *val, zval *track_vars_array, zend_bool override_protection TSRMLS_DC) -{ - if (override_protection || !is_protected_variable(var TSRMLS_CC)) { - php_register_variable_ex(var, val, track_vars_array TSRMLS_CC); - } -} - - -static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) -{ - int register_globals = PG(register_globals); - - PG(register_globals) = 0; - safe_php_register_variable(strvar, val, strlen(val), http_post_files, override_protection TSRMLS_CC); - PG(register_globals) = register_globals; -} - - -static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) -{ - int register_globals = PG(register_globals); - - PG(register_globals) = 0; - safe_php_register_variable_ex(var, val, http_post_files, override_protection TSRMLS_CC); - PG(register_globals) = register_globals; -} - - -static int unlink_filename(char **filename TSRMLS_DC) -{ - VCWD_UNLINK(*filename); - return 0; -} - - -void destroy_uploaded_files_hash(TSRMLS_D) -{ - zend_hash_apply(SG(rfc1867_uploaded_files), (apply_func_t) unlink_filename TSRMLS_CC); - zend_hash_destroy(SG(rfc1867_uploaded_files)); - FREE_HASHTABLE(SG(rfc1867_uploaded_files)); -} - - -/* - * Following code is based on apache_multipart_buffer.c from libapreq-0.33 package. - * - */ - -#define FILLUNIT (1024 * 5) - -typedef struct { - - /* read buffer */ - char *buffer; - char *buf_begin; - int bufsize; - int bytes_in_buffer; - - /* boundary info */ - char *boundary; - char *boundary_next; - int boundary_next_len; - -} multipart_buffer; - - -typedef struct { - char *key; - char *value; -} mime_header_entry; - - -/* - fill up the buffer with client data. - returns number of bytes added to buffer. -*/ -static int fill_buffer(multipart_buffer *self TSRMLS_DC) -{ - int bytes_to_read, total_read = 0, actual_read = 0; - - /* shift the existing data if necessary */ - if (self->bytes_in_buffer > 0 && self->buf_begin != self->buffer) { - memmove(self->buffer, self->buf_begin, self->bytes_in_buffer); - } - - self->buf_begin = self->buffer; - - /* calculate the free space in the buffer */ - bytes_to_read = self->bufsize - self->bytes_in_buffer; - - /* read the required number of bytes */ - while (bytes_to_read > 0) { - - char *buf = self->buffer + self->bytes_in_buffer; - - actual_read = sapi_module.read_post(buf, bytes_to_read TSRMLS_CC); - - /* update the buffer length */ - if (actual_read > 0) { - self->bytes_in_buffer += actual_read; - SG(read_post_bytes) += actual_read; - total_read += actual_read; - bytes_to_read -= actual_read; - } else { - break; - } - } - - return total_read; -} - - -/* eof if we are out of bytes, or if we hit the final boundary */ -static int multipart_buffer_eof(multipart_buffer *self TSRMLS_DC) -{ - if ( (self->bytes_in_buffer == 0 && fill_buffer(self TSRMLS_CC) < 1) ) { - return 1; - } else { - return 0; - } -} - - -/* create new multipart_buffer structure */ -static multipart_buffer *multipart_buffer_new(char *boundary, int boundary_len) -{ - multipart_buffer *self = (multipart_buffer *) ecalloc(1, sizeof(multipart_buffer)); - - int minsize = boundary_len + 6; - if (minsize < FILLUNIT) minsize = FILLUNIT; - - self->buffer = (char *) ecalloc(1, minsize + 1); - self->bufsize = minsize; - - spprintf(&self->boundary, 0, "--%s", boundary); - - self->boundary_next_len = spprintf(&self->boundary_next, 0, "\n--%s", boundary); - - self->buf_begin = self->buffer; - self->bytes_in_buffer = 0; - - return self; -} - - -/* - gets the next CRLF terminated line from the input buffer. - if it doesn't find a CRLF, and the buffer isn't completely full, returns - NULL; otherwise, returns the beginning of the null-terminated line, - minus the CRLF. - - note that we really just look for LF terminated lines. this works - around a bug in internet explorer for the macintosh which sends mime - boundaries that are only LF terminated when you use an image submit - button in a multipart/form-data form. - */ -static char *next_line(multipart_buffer *self) -{ - /* look for LF in the data */ - char* line = self->buf_begin; - char* ptr = memchr(self->buf_begin, '\n', self->bytes_in_buffer); - - if (ptr) { /* LF found */ - - /* terminate the string, remove CRLF */ - if ((ptr - line) > 0 && *(ptr-1) == '\r') { - *(ptr-1) = 0; - } else { - *ptr = 0; - } - - /* bump the pointer */ - self->buf_begin = ptr + 1; - self->bytes_in_buffer -= (self->buf_begin - line); - - } else { /* no LF found */ - - /* buffer isn't completely full, fail */ - if (self->bytes_in_buffer < self->bufsize) { - return NULL; - } - /* return entire buffer as a partial line */ - line[self->bufsize] = 0; - self->buf_begin = ptr; - self->bytes_in_buffer = 0; - } - - return line; -} - - -/* returns the next CRLF terminated line from the client */ -static char *get_line(multipart_buffer *self TSRMLS_DC) -{ - char* ptr = next_line(self); - - if (!ptr) { - fill_buffer(self TSRMLS_CC); - ptr = next_line(self); - } - - return ptr; -} - - -/* Free header entry */ -static void php_free_hdr_entry(mime_header_entry *h) -{ - if (h->key) { - efree(h->key); - } - if (h->value) { - efree(h->value); - } -} - - -/* finds a boundary */ -static int find_boundary(multipart_buffer *self, char *boundary TSRMLS_DC) -{ - char *line; - - /* loop thru lines */ - while( (line = get_line(self TSRMLS_CC)) ) - { - /* finished if we found the boundary */ - if (!strcmp(line, boundary)) { - return 1; - } - } - - /* didn't find the boundary */ - return 0; -} - - -/* parse headers */ -static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC) -{ - char *line; - mime_header_entry prev_entry, entry; - int prev_len, cur_len; - - /* didn't find boundary, abort */ - if (!find_boundary(self, self->boundary TSRMLS_CC)) { - return 0; - } - - /* get lines of text, or CRLF_CRLF */ - - while( (line = get_line(self TSRMLS_CC)) && strlen(line) > 0 ) - { - /* add header to table */ - - char *key = line; - char *value = NULL; - - /* space in the beginning means same header */ - if (!isspace(line[0])) { - value = strchr(line, ':'); - } - - if (value) { - *value = 0; - do { value++; } while(isspace(*value)); - - entry.value = estrdup(value); - entry.key = estrdup(key); - - } else if (zend_llist_count(header)) { /* If no ':' on the line, add to previous line */ - - prev_len = strlen(prev_entry.value); - cur_len = strlen(line); - - entry.value = emalloc(prev_len + cur_len + 1); - memcpy(entry.value, prev_entry.value, prev_len); - memcpy(entry.value + prev_len, line, cur_len); - entry.value[cur_len + prev_len] = '\0'; - - entry.key = estrdup(prev_entry.key); - - zend_llist_remove_tail(header); - } else { - continue; - } - - zend_llist_add_element(header, &entry); - prev_entry = entry; - } - - return 1; -} - - -static char *php_mime_get_hdr_value(zend_llist header, char *key) -{ - mime_header_entry *entry; - - if (key == NULL) { - return NULL; - } - - entry = zend_llist_get_first(&header); - while (entry) { - if (!strcasecmp(entry->key, key)) { - return entry->value; - } - entry = zend_llist_get_next(&header); - } - - return NULL; -} - - -static char *php_ap_getword(char **line, char stop) -{ - char *pos = *line, quote; - char *res; - - while (*pos && *pos != stop) { - - if ((quote = *pos) == '"' || quote == '\'') { - ++pos; - while (*pos && *pos != quote) { - if (*pos == '\\' && pos[1] && pos[1] == quote) { - pos += 2; - } else { - ++pos; - } - } - if (*pos) { - ++pos; - } - } else ++pos; - - } - if (*pos == '\0') { - res = estrdup(*line); - *line += strlen(*line); - return res; - } - - res = estrndup(*line, pos - *line); - - while (*pos == stop) { - ++pos; - } - - *line = pos; - return res; -} - - -static char *substring_conf(char *start, int len, char quote TSRMLS_DC) -{ - char *result = emalloc(len + 2); - char *resp = result; - int i; - - for (i = 0; i < len; ++i) { - if (start[i] == '\\' && (start[i + 1] == '\\' || (quote && start[i + 1] == quote))) { - *resp++ = start[++i]; - } else { -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - size_t j = php_mb_gpc_mbchar_bytes(start+i TSRMLS_CC); - while (j-- > 0 && i < len) { - *resp++ = start[i++]; - } - --i; - } else { - *resp++ = start[i]; - } -#else - *resp++ = start[i]; -#endif - } - } - - *resp++ = '\0'; - return result; -} - - -static char *php_ap_getword_conf(char **line TSRMLS_DC) -{ - char *str = *line, *strend, *res, quote; - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - int len=strlen(str); - php_mb_gpc_encoding_detector(&str, &len, 1, NULL TSRMLS_CC); - } -#endif - - while (*str && isspace(*str)) { - ++str; - } - - if (!*str) { - *line = str; - return estrdup(""); - } - - if ((quote = *str) == '"' || quote == '\'') { - strend = str + 1; -look_for_quote: - while (*strend && *strend != quote) { - if (*strend == '\\' && strend[1] && strend[1] == quote) { - strend += 2; - } else { - ++strend; - } - } - if (*strend && *strend == quote) { - char p = *(strend + 1); - if (p != '\r' && p != '\n' && p != '\0') { - strend++; - goto look_for_quote; - } - } - - res = substring_conf(str + 1, strend - str - 1, quote TSRMLS_CC); - - if (*strend == quote) { - ++strend; - } - - } else { - - strend = str; - while (*strend && !isspace(*strend)) { - ++strend; - } - res = substring_conf(str, strend - str, 0 TSRMLS_CC); - } - - while (*strend && isspace(*strend)) { - ++strend; - } - - *line = strend; - return res; -} - - -/* - search for a string in a fixed-length byte string. - if partial is true, partial matches are allowed at the end of the buffer. - returns NULL if not found, or a pointer to the start of the first match. -*/ -static void *php_ap_memstr(char *haystack, int haystacklen, char *needle, int needlen, int partial) -{ - int len = haystacklen; - char *ptr = haystack; - - /* iterate through first character matches */ - while( (ptr = memchr(ptr, needle[0], len)) ) { - - /* calculate length after match */ - len = haystacklen - (ptr - (char *)haystack); - - /* done if matches up to capacity of buffer */ - if (memcmp(needle, ptr, needlen < len ? needlen : len) == 0 && (partial || len >= needlen)) { - break; - } - - /* next character */ - ptr++; len--; - } - - return ptr; -} - - -/* read until a boundary condition */ -static int multipart_buffer_read(multipart_buffer *self, char *buf, int bytes, int *end TSRMLS_DC) -{ - int len, max; - char *bound; - - /* fill buffer if needed */ - if (bytes > self->bytes_in_buffer) { - fill_buffer(self TSRMLS_CC); - } - - /* look for a potential boundary match, only read data up to that point */ - if ((bound = php_ap_memstr(self->buf_begin, self->bytes_in_buffer, self->boundary_next, self->boundary_next_len, 1))) { - max = bound - self->buf_begin; - if (end && php_ap_memstr(self->buf_begin, self->bytes_in_buffer, self->boundary_next, self->boundary_next_len, 0)) { - *end = 1; - } - } else { - max = self->bytes_in_buffer; - } - - /* maximum number of bytes we are reading */ - len = max < bytes-1 ? max : bytes-1; - - /* if we read any data... */ - if (len > 0) { - - /* copy the data */ - memcpy(buf, self->buf_begin, len); - buf[len] = 0; - - if (bound && len > 0 && buf[len-1] == '\r') { - buf[--len] = 0; - } - - /* update the buffer */ - self->bytes_in_buffer -= len; - self->buf_begin += len; - } - - return len; -} - - -/* - XXX: this is horrible memory-usage-wise, but we only expect - to do this on small pieces of form data. -*/ -static char *multipart_buffer_read_body(multipart_buffer *self, unsigned int *len TSRMLS_DC) -{ - char buf[FILLUNIT], *out=NULL; - int total_bytes=0, read_bytes=0; - - while((read_bytes = multipart_buffer_read(self, buf, sizeof(buf), NULL TSRMLS_CC))) { - out = erealloc(out, total_bytes + read_bytes + 1); - memcpy(out + total_bytes, buf, read_bytes); - total_bytes += read_bytes; - } - - if (out) out[total_bytes] = '\0'; - *len = total_bytes; - - return out; -} - - -/* - * The combined READER/HANDLER - * - */ - -SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) -{ - char *boundary, *s=NULL, *boundary_end = NULL, *start_arr=NULL, *array_index=NULL; - char *temp_filename=NULL, *lbuf=NULL, *abuf=NULL; - int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0; - int max_file_size=0, skip_upload=0, anonindex=0, is_anonymous; - zval *http_post_files=NULL; HashTable *uploaded_files=NULL; -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - int str_len = 0, num_vars = 0, num_vars_max = 2*10, *len_list = NULL; - char **val_list = NULL; -#endif - multipart_buffer *mbuff; - zval *array_ptr = (zval *) arg; - int fd=-1; - zend_llist header; - void *event_extra_data = NULL; - int llen = 0; - - if (SG(request_info).content_length > SG(post_max_size)) { - sapi_module.sapi_error(E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", SG(request_info).content_length, SG(post_max_size)); - return; - } - - /* Get the boundary */ - boundary = strstr(content_type_dup, "boundary"); - if (!boundary || !(boundary=strchr(boundary, '='))) { - sapi_module.sapi_error(E_WARNING, "Missing boundary in multipart/form-data POST data"); - return; - } - - boundary++; - boundary_len = strlen(boundary); - - if (boundary[0] == '"') { - boundary++; - boundary_end = strchr(boundary, '"'); - if (!boundary_end) { - sapi_module.sapi_error(E_WARNING, "Invalid boundary in multipart/form-data POST data"); - return; - } - } else { - /* search for the end of the boundary */ - boundary_end = strchr(boundary, ','); - } - if (boundary_end) { - boundary_end[0] = '\0'; - boundary_len = boundary_end-boundary; - } - - /* Initialize the buffer */ - if (!(mbuff = multipart_buffer_new(boundary, boundary_len))) { - sapi_module.sapi_error(E_WARNING, "Unable to initialize the input buffer"); - return; - } - - /* Initialize $_FILES[] */ - zend_hash_init(&PG(rfc1867_protected_variables), 5, NULL, NULL, 0); - - ALLOC_HASHTABLE(uploaded_files); - zend_hash_init(uploaded_files, 5, NULL, (dtor_func_t) free_estring, 0); - SG(rfc1867_uploaded_files) = uploaded_files; - - ALLOC_ZVAL(http_post_files); - array_init(http_post_files); - INIT_PZVAL(http_post_files); - PG(http_globals)[TRACK_VARS_FILES] = http_post_files; - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - val_list = (char **)ecalloc(num_vars_max+2, sizeof(char *)); - len_list = (int *)ecalloc(num_vars_max+2, sizeof(int)); - } -#endif - zend_llist_init(&header, sizeof(mime_header_entry), (llist_dtor_func_t) php_free_hdr_entry, 0); - - if (php_rfc1867_callback != NULL) { - multipart_event_start event_start; - - event_start.content_length = SG(request_info).content_length; - if (php_rfc1867_callback(MULTIPART_EVENT_START, &event_start, &event_extra_data TSRMLS_CC) == FAILURE) { - goto fileupload_done; - } - } - - while (!multipart_buffer_eof(mbuff TSRMLS_CC)) - { - char buff[FILLUNIT]; - char *cd=NULL,*param=NULL,*filename=NULL, *tmp=NULL; - size_t blen=0, wlen=0; - off_t offset; - - zend_llist_clean(&header); - - if (!multipart_buffer_headers(mbuff, &header TSRMLS_CC)) { - goto fileupload_done; - } - - if ((cd = php_mime_get_hdr_value(header, "Content-Disposition"))) { - char *pair=NULL; - int end=0; - - while (isspace(*cd)) { - ++cd; - } - - while (*cd && (pair = php_ap_getword(&cd, ';'))) - { - char *key=NULL, *word = pair; - - while (isspace(*cd)) { - ++cd; - } - - if (strchr(pair, '=')) { - key = php_ap_getword(&pair, '='); - - if (!strcasecmp(key, "name")) { - if (param) { - efree(param); - } - param = php_ap_getword_conf(&pair TSRMLS_CC); - } else if (!strcasecmp(key, "filename")) { - if (filename) { - efree(filename); - } - filename = php_ap_getword_conf(&pair TSRMLS_CC); - } - } - if (key) { - efree(key); - } - efree(word); - } - - /* Normal form variable, safe to read all data into memory */ - if (!filename && param) { - unsigned int value_len; - char *value = multipart_buffer_read_body(mbuff, &value_len TSRMLS_CC); - unsigned int new_val_len; /* Dummy variable */ - - if (!value) { - value = estrdup(""); - } - - if (sapi_module.input_filter(PARSE_POST, param, &value, value_len, &new_val_len TSRMLS_CC)) { - if (php_rfc1867_callback != NULL) { - multipart_event_formdata event_formdata; - size_t newlength = new_val_len; - - event_formdata.post_bytes_processed = SG(read_post_bytes); - event_formdata.name = param; - event_formdata.value = &value; - event_formdata.length = new_val_len; - event_formdata.newlength = &newlength; - if (php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data TSRMLS_CC) == FAILURE) { - efree(param); - efree(value); - continue; - } - new_val_len = newlength; - } - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - php_mb_gpc_stack_variable(param, value, &val_list, &len_list, - &num_vars, &num_vars_max TSRMLS_CC); - } else { - safe_php_register_variable(param, value, new_val_len, array_ptr, 0 TSRMLS_CC); - } -#else - safe_php_register_variable(param, value, new_val_len, array_ptr, 0 TSRMLS_CC); -#endif - } else if (php_rfc1867_callback != NULL) { - multipart_event_formdata event_formdata; - - event_formdata.post_bytes_processed = SG(read_post_bytes); - event_formdata.name = param; - event_formdata.value = &value; - event_formdata.length = value_len; - event_formdata.newlength = NULL; - php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data TSRMLS_CC); - } - - if (!strcasecmp(param, "MAX_FILE_SIZE")) { - max_file_size = atol(value); - } - - efree(param); - efree(value); - continue; - } - - /* If file_uploads=off, skip the file part */ - if (!PG(file_uploads)) { - skip_upload = 1; - } - - /* Return with an error if the posted data is garbled */ - if (!param && !filename) { - sapi_module.sapi_error(E_WARNING, "File Upload Mime headers garbled"); - goto fileupload_done; - } - - if (!param) { - is_anonymous = 1; - param = emalloc(MAX_SIZE_ANONNAME); - snprintf(param, MAX_SIZE_ANONNAME, "%u", anonindex++); - } else { - is_anonymous = 0; - } - - /* New Rule: never repair potential malicious user input */ - if (!skip_upload) { - char *tmp = param; - long c = 0; - - while (*tmp) { - if (*tmp == '[') { - c++; - } else if (*tmp == ']') { - c--; - if (tmp[1] && tmp[1] != '[') { - skip_upload = 1; - break; - } - } - if (c < 0) { - skip_upload = 1; - break; - } - tmp++; - } - } - - total_bytes = cancel_upload = 0; - - if (!skip_upload) { - /* Handle file */ - fd = php_open_temporary_fd_ex(PG(upload_tmp_dir), "php", &temp_filename, 1 TSRMLS_CC); - if (fd==-1) { - sapi_module.sapi_error(E_WARNING, "File upload error - unable to create a temporary file"); - cancel_upload = UPLOAD_ERROR_E; - } - } - - if (!skip_upload && php_rfc1867_callback != NULL) { - multipart_event_file_start event_file_start; - - event_file_start.post_bytes_processed = SG(read_post_bytes); - event_file_start.name = param; - event_file_start.filename = &filename; - if (php_rfc1867_callback(MULTIPART_EVENT_FILE_START, &event_file_start, &event_extra_data TSRMLS_CC) == FAILURE) { - if (temp_filename) { - if (cancel_upload != UPLOAD_ERROR_E) { /* file creation failed */ - close(fd); - unlink(temp_filename); - } - efree(temp_filename); - } - temp_filename=""; - efree(param); - efree(filename); - continue; - } - } - - - if (skip_upload) { - efree(param); - efree(filename); - continue; - } - - if(strlen(filename) == 0) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "No file uploaded"); -#endif - cancel_upload = UPLOAD_ERROR_D; - } - - offset = 0; - end = 0; - while (!cancel_upload && (blen = multipart_buffer_read(mbuff, buff, sizeof(buff), &end TSRMLS_CC))) - { - if (php_rfc1867_callback != NULL) { - multipart_event_file_data event_file_data; - - event_file_data.post_bytes_processed = SG(read_post_bytes); - event_file_data.offset = offset; - event_file_data.data = buff; - event_file_data.length = blen; - event_file_data.newlength = &blen; - if (php_rfc1867_callback(MULTIPART_EVENT_FILE_DATA, &event_file_data, &event_extra_data TSRMLS_CC) == FAILURE) { - cancel_upload = UPLOAD_ERROR_X; - continue; - } - } - - - if (PG(upload_max_filesize) > 0 && (total_bytes+blen) > PG(upload_max_filesize)) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename); -#endif - cancel_upload = UPLOAD_ERROR_A; - } else if (max_file_size && ((total_bytes+blen) > max_file_size)) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename); -#endif - cancel_upload = UPLOAD_ERROR_B; - } else if (blen > 0) { - - wlen = write(fd, buff, blen); - - if (wlen == -1) { - /* write failed */ -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "write() failed - %s", strerror(errno)); -#endif - cancel_upload = UPLOAD_ERROR_F; - } else if (wlen < blen) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "Only %d bytes were written, expected to write %d", wlen, blen); -#endif - cancel_upload = UPLOAD_ERROR_F; - } else { - total_bytes += wlen; - } - - offset += wlen; - } - } - if (fd!=-1) { /* may not be initialized if file could not be created */ - close(fd); - } - if (!cancel_upload && !end) { -#if DEBUG_FILE_UPLOAD - sapi_module.sapi_error(E_NOTICE, "Missing mime boundary at the end of the data for file %s", strlen(filename) > 0 ? filename : ""); -#endif - cancel_upload = UPLOAD_ERROR_C; - } -#if DEBUG_FILE_UPLOAD - if(strlen(filename) > 0 && total_bytes == 0 && !cancel_upload) { - sapi_module.sapi_error(E_WARNING, "Uploaded file size 0 - file [%s=%s] not saved", param, filename); - cancel_upload = 5; - } -#endif - - if (php_rfc1867_callback != NULL) { - multipart_event_file_end event_file_end; - - event_file_end.post_bytes_processed = SG(read_post_bytes); - event_file_end.temp_filename = temp_filename; - event_file_end.cancel_upload = cancel_upload; - if (php_rfc1867_callback(MULTIPART_EVENT_FILE_END, &event_file_end, &event_extra_data TSRMLS_CC) == FAILURE) { - cancel_upload = UPLOAD_ERROR_X; - } - } - - if (cancel_upload) { - if (temp_filename) { - if (cancel_upload != UPLOAD_ERROR_E) { /* file creation failed */ - unlink(temp_filename); - } - efree(temp_filename); - } - temp_filename=""; - } else { - zend_hash_add(SG(rfc1867_uploaded_files), temp_filename, strlen(temp_filename) + 1, &temp_filename, sizeof(char *), NULL); - } - - /* is_arr_upload is true when name of file upload field - * ends in [.*] - * start_arr is set to point to 1st [ - */ - is_arr_upload = (start_arr = strchr(param,'[')) && (param[strlen(param)-1] == ']'); - - if (is_arr_upload) { - array_len = strlen(start_arr); - if (array_index) { - efree(array_index); - } - array_index = estrndup(start_arr+1, array_len-2); - } - - /* Add $foo_name */ - if (llen < strlen(param) + MAX_SIZE_OF_INDEX + 1) { - llen = strlen(param); - lbuf = (char *) safe_erealloc(lbuf, llen, 1, MAX_SIZE_OF_INDEX + 1); - llen += MAX_SIZE_OF_INDEX + 1; - } - - if (is_arr_upload) { - if (abuf) efree(abuf); - abuf = estrndup(param, strlen(param)-array_len); - snprintf(lbuf, llen, "%s_name[%s]", abuf, array_index); - } else { - snprintf(lbuf, llen, "%s_name", param); - } - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) - if (php_mb_encoding_translation(TSRMLS_C)) { - if (num_vars>=num_vars_max){ - php_mb_gpc_realloc_buffer(&val_list, &len_list, &num_vars_max, - 1 TSRMLS_CC); - } - val_list[num_vars] = filename; - len_list[num_vars] = strlen(filename); - num_vars++; - if(php_mb_gpc_encoding_detector(val_list, len_list, num_vars, NULL TSRMLS_CC) == SUCCESS) { - str_len = strlen(filename); - php_mb_gpc_encoding_converter(&filename, &str_len, 1, NULL, NULL TSRMLS_CC); - } - s = php_mb_strrchr(filename, '\\' TSRMLS_CC); - if ((tmp = php_mb_strrchr(filename, '/' TSRMLS_CC)) > s) { - s = tmp; - } - num_vars--; - goto filedone; - } -#endif - /* The \ check should technically be needed for win32 systems only where - * it is a valid path separator. However, IE in all it's wisdom always sends - * the full path of the file on the user's filesystem, which means that unless - * the user does basename() they get a bogus file name. Until IE's user base drops - * to nill or problem is fixed this code must remain enabled for all systems. - */ - s = strrchr(filename, '\\'); - if ((tmp = strrchr(filename, '/')) > s) { - s = tmp; - } -#ifdef PHP_WIN32 - if (PG(magic_quotes_gpc)) { - s = s ? s : filename; - tmp = strrchr(s, '\''); - s = tmp > s ? tmp : s; - tmp = strrchr(s, '"'); - s = tmp > s ? tmp : s; - } -#endif - -#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) -filedone: -#endif - - if (!is_anonymous) { - if (s && s > filename) { - safe_php_register_variable(lbuf, s+1, strlen(s+1), NULL, 0 TSRMLS_CC); - } else { - safe_php_register_variable(lbuf, filename, strlen(filename), NULL, 0 TSRMLS_CC); - } - } - - /* Add $foo[name] */ - if (is_arr_upload) { - snprintf(lbuf, llen, "%s[name][%s]", abuf, array_index); - } else { - snprintf(lbuf, llen, "%s[name]", param); - } - if (s && s > filename) { - register_http_post_files_variable(lbuf, s+1, http_post_files, 0 TSRMLS_CC); - } else { - register_http_post_files_variable(lbuf, filename, http_post_files, 0 TSRMLS_CC); - } - efree(filename); - s = NULL; - - /* Possible Content-Type: */ - if (cancel_upload || !(cd = php_mime_get_hdr_value(header, "Content-Type"))) { - cd = ""; - } else { - /* fix for Opera 6.01 */ - s = strchr(cd, ';'); - if (s != NULL) { - *s = '\0'; - } - } - - /* Add $foo_type */ - if (is_arr_upload) { - snprintf(lbuf, llen, "%s_type[%s]", abuf, array_index); - } else { - snprintf(lbuf, llen, "%s_type", param); - } - if (!is_anonymous) { - safe_php_register_variable(lbuf, cd, strlen(cd), NULL, 0 TSRMLS_CC); - } - - /* Add $foo[type] */ - if (is_arr_upload) { - snprintf(lbuf, llen, "%s[type][%s]", abuf, array_index); - } else { - snprintf(lbuf, llen, "%s[type]", param); - } - register_http_post_files_variable(lbuf, cd, http_post_files, 0 TSRMLS_CC); - - /* Restore Content-Type Header */ - if (s != NULL) { - *s = ';'; - } - s = ""; - - { - /* store temp_filename as-is (without magic_quotes_gpc-ing it, in case upload_tmp_dir - * contains escapeable characters. escape only the variable name.) */ - zval zfilename; - - /* Initialize variables */ - add_protected_variable(param TSRMLS_CC); - - /* if param is of form xxx[.*] this will cut it to xxx */ - if (!is_anonymous) { - ZVAL_STRING(&zfilename, temp_filename, 1); - safe_php_register_variable_ex(param, &zfilename, NULL, 1 TSRMLS_CC); - } - - /* Add $foo[tmp_name] */ - if (is_arr_upload) { - snprintf(lbuf, llen, "%s[tmp_name][%s]", abuf, array_index); - } else { - snprintf(lbuf, llen, "%s[tmp_name]", param); - } - add_protected_variable(lbuf TSRMLS_CC); - ZVAL_STRING(&zfilename, temp_filename, 1); - register_http_post_files_variable_ex(lbuf, &zfilename, http_post_files, 1 TSRMLS_CC); - } - - { - zval file_size, error_type; - - error_type.value.lval = cancel_upload; - error_type.type = IS_LONG; - - /* Add $foo[error] */ - if (cancel_upload) { - file_size.value.lval = 0; - file_size.type = IS_LONG; - } else { - file_size.value.lval = total_bytes; - file_size.type = IS_LONG; - } - - if (is_arr_upload) { - snprintf(lbuf, llen, "%s[error][%s]", abuf, array_index); - } else { - snprintf(lbuf, llen, "%s[error]", param); - } - register_http_post_files_variable_ex(lbuf, &error_type, http_post_files, 0 TSRMLS_CC); - - /* Add $foo_size */ - if (is_arr_upload) { - snprintf(lbuf, llen, "%s_size[%s]", abuf, array_index); - } else { - snprintf(lbuf, llen, "%s_size", param); - } - if (!is_anonymous) { - safe_php_register_variable_ex(lbuf, &file_size, NULL, 0 TSRMLS_CC); - } - - /* Add $foo[size] */ - if (is_arr_upload) { - snprintf(lbuf, llen, "%s[size][%s]", abuf, array_index); - } else { - snprintf(lbuf, llen, "%s[size]", param); - } - register_http_post_files_variable_ex(lbuf, &file_size, http_post_files, 0 TSRMLS_CC); - } - efree(param); - } - } -fileupload_done: - if (php_rfc1867_callback != NULL) { - multipart_event_end event_end; - - event_end.post_bytes_processed = SG(read_post_bytes); - php_rfc1867_callback(MULTIPART_EVENT_END, &event_end, &event_extra_data TSRMLS_CC); - } - - SAFE_RETURN; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/rfc1867.h b/main/rfc1867.h deleted file mode 100644 index 0f1471c51542a..0000000000000 --- a/main/rfc1867.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef RFC1867_H -#define RFC1867_H - -#include "SAPI.h" - -#define MULTIPART_CONTENT_TYPE "multipart/form-data" -#define MULTIPART_EVENT_START 0 -#define MULTIPART_EVENT_FORMDATA 1 -#define MULTIPART_EVENT_FILE_START 2 -#define MULTIPART_EVENT_FILE_DATA 3 -#define MULTIPART_EVENT_FILE_END 4 -#define MULTIPART_EVENT_END 5 - -typedef struct _multipart_event_start { - size_t content_length; -} multipart_event_start; - -typedef struct _multipart_event_formdata { - size_t post_bytes_processed; - char *name; - char **value; - size_t length; - size_t *newlength; -} multipart_event_formdata; - -typedef struct _multipart_event_file_start { - size_t post_bytes_processed; - char *name; - char **filename; -} multipart_event_file_start; - -typedef struct _multipart_event_file_data { - size_t post_bytes_processed; - off_t offset; - char *data; - size_t length; - size_t *newlength; -} multipart_event_file_data; - -typedef struct _multipart_event_file_end { - size_t post_bytes_processed; - char *temp_filename; - int cancel_upload; -} multipart_event_file_end; - -typedef struct _multipart_event_end { - size_t post_bytes_processed; -} multipart_event_end; - -SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler); - -void destroy_uploaded_files_hash(TSRMLS_D); -void php_rfc1867_register_constants(TSRMLS_D); -extern PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC); - -#endif /* RFC1867_H */ diff --git a/main/safe_mode.c b/main/safe_mode.c deleted file mode 100644 index 50c246be4ef68..0000000000000 --- a/main/safe_mode.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Rasmus Lerdorf | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif -#include -#include "ext/standard/pageinfo.h" -#include "safe_mode.h" -#include "SAPI.h" -#include "php_globals.h" - -/* - * php_checkuid - * - * This function has six modes: - * - * 0 - return invalid (0) if file does not exist - * 1 - return valid (1) if file does not exist - * 2 - if file does not exist, check directory - * 3 - only check directory (needed for mkdir) - * 4 - check mode and param - * 5 - only check file - */ - -PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags) -{ - struct stat sb; - int ret, nofile=0; - long uid=0L, gid=0L, duid=0L, dgid=0L; - char path[MAXPATHLEN]; - char *s, filenamecopy[MAXPATHLEN]; - TSRMLS_FETCH(); - - path[0] = '\0'; - - if (!filename) { - return 0; /* path must be provided */ - } - - if (strlcpy(filenamecopy, filename, MAXPATHLEN)>=MAXPATHLEN) { - return 0; - } - filename=(char *)&filenamecopy; - - if (fopen_mode) { - if (fopen_mode[0] == 'r') { - mode = CHECKUID_DISALLOW_FILE_NOT_EXISTS; - } else { - mode = CHECKUID_CHECK_FILE_AND_DIR; - } - } - - /* First we see if the file is owned by the same user... - * If that fails, passthrough and check directory... - */ - if (mode != CHECKUID_ALLOW_ONLY_DIR) { -#if HAVE_BROKEN_GETCWD - char ftest[MAXPATHLEN]; - - strcpy(ftest, filename); - if (VCWD_GETCWD(ftest, sizeof(ftest)) == NULL) { - strcpy(path, filename); - } else -#endif - expand_filepath(filename, path TSRMLS_CC); - - ret = VCWD_STAT(path, &sb); - if (ret < 0) { - if (mode == CHECKUID_DISALLOW_FILE_NOT_EXISTS) { - if ((flags & CHECKUID_NO_ERRORS) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to access %s", filename); - } - return 0; - } else if (mode == CHECKUID_ALLOW_FILE_NOT_EXISTS) { - if ((flags & CHECKUID_NO_ERRORS) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to access %s", filename); - } - return 1; - } - nofile = 1; - } else { - uid = sb.st_uid; - gid = sb.st_gid; - if (uid == php_getuid()) { - return 1; - } else if (PG(safe_mode_gid) && gid == php_getgid()) { - return 1; - } - } - - /* Trim off filename */ - if ((s = strrchr(path, DEFAULT_SLASH))) { - if (*(s + 1) == '\0' && s != path) { /* make sure that the / is not the last character */ - *s = '\0'; - s = strrchr(path, DEFAULT_SLASH); - } - if (s) { - if (s == path) { - path[1] = '\0'; - } else { - *s = '\0'; - } - } - } - } else { /* CHECKUID_ALLOW_ONLY_DIR */ - s = strrchr(filename, DEFAULT_SLASH); - - if (s == filename) { - /* root dir */ - path[0] = DEFAULT_SLASH; - path[1] = '\0'; - } else if (s && *(s + 1) != '\0') { /* make sure that the / is not the last character */ - *s = '\0'; - VCWD_REALPATH(filename, path); - *s = DEFAULT_SLASH; - } else { - /* Under Solaris, getcwd() can fail if there are no - * read permissions on a component of the path, even - * though it has the required x permissions */ - path[0] = '.'; - path[1] = '\0'; - VCWD_GETCWD(path, sizeof(path)); - } - } /* end CHECKUID_ALLOW_ONLY_DIR */ - - if (mode != CHECKUID_ALLOW_ONLY_FILE) { - /* check directory */ - ret = VCWD_STAT(path, &sb); - if (ret < 0) { - if ((flags & CHECKUID_NO_ERRORS) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to access %s", filename); - } - return 0; - } - duid = sb.st_uid; - dgid = sb.st_gid; - if (duid == php_getuid()) { - return 1; - } else if (PG(safe_mode_gid) && dgid == php_getgid()) { - return 1; - } else { - if (SG(rfc1867_uploaded_files)) { - if (zend_hash_exists(SG(rfc1867_uploaded_files), (char *) filename, strlen(filename)+1)) { - return 1; - } - } - } - } - - if (mode == CHECKUID_ALLOW_ONLY_DIR) { - uid = duid; - gid = dgid; - if (s) { - *s = 0; - } - } - - if (nofile) { - uid = duid; - gid = dgid; - filename = path; - } - - if ((flags & CHECKUID_NO_ERRORS) == 0) { - if (PG(safe_mode_gid)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The script whose uid/gid is %ld/%ld is not allowed to access %s owned by uid/gid %ld/%ld", php_getuid(), php_getgid(), filename, uid, gid); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The script whose uid is %ld is not allowed to access %s owned by uid %ld", php_getuid(), filename, uid); - } - } - - return 0; -} - -PHPAPI int php_checkuid(const char *filename, const char *fopen_mode, int mode) -{ -#ifdef NETWARE -/* NetWare don't have uid*/ - return 1; -#else - return php_checkuid_ex(filename, fopen_mode, mode, 0); -#endif -} - -PHPAPI char *php_get_current_user(void) -{ - struct stat *pstat; - TSRMLS_FETCH(); - - if (SG(request_info).current_user) { - return SG(request_info).current_user; - } - - /* FIXME: I need to have this somehow handled if - USE_SAPI is defined, because cgi will also be - interfaced in USE_SAPI */ - - pstat = sapi_get_stat(TSRMLS_C); - - if (!pstat) { - return ""; - } else { -#ifdef PHP_WIN32 - char name[256]; - DWORD len = sizeof(name)-1; - - if (!GetUserName(name, &len)) { - return ""; - } - name[len] = '\0'; - SG(request_info).current_user_length = len; - SG(request_info).current_user = estrndup(name, len); - return SG(request_info).current_user; -#else - struct passwd *pwd; -#if defined(ZTS) && defined(HAVE_GETPWUID_R) && defined(_SC_GETPW_R_SIZE_MAX) - struct passwd _pw; - struct passwd *retpwptr = NULL; - int pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX); - char *pwbuf; - - if (pwbuflen < 1) { - return ""; - } - pwbuf = emalloc(pwbuflen); - if (getpwuid_r(pstat->st_uid, &_pw, pwbuf, pwbuflen, &retpwptr) != 0) { - efree(pwbuf); - return ""; - } - pwd = &_pw; -#else - if ((pwd=getpwuid(pstat->st_uid))==NULL) { - return ""; - } -#endif - SG(request_info).current_user_length = strlen(pwd->pw_name); - SG(request_info).current_user = estrndup(pwd->pw_name, SG(request_info).current_user_length); -#if defined(ZTS) && defined(HAVE_GETPWUID_R) && defined(_SC_GETPW_R_SIZE_MAX) - efree(pwbuf); -#endif - return SG(request_info).current_user; -#endif - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/safe_mode.h b/main/safe_mode.h deleted file mode 100644 index f2e0c0af3f58d..0000000000000 --- a/main/safe_mode.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef SAFE_MODE_H -#define SAFE_MODE_H - -/* mode's for php_checkuid() */ -#define CHECKUID_DISALLOW_FILE_NOT_EXISTS 0 -#define CHECKUID_ALLOW_FILE_NOT_EXISTS 1 -#define CHECKUID_CHECK_FILE_AND_DIR 2 -#define CHECKUID_ALLOW_ONLY_DIR 3 -#define CHECKUID_CHECK_MODE_PARAM 4 -#define CHECKUID_ALLOW_ONLY_FILE 5 - -/* flags for php_checkuid_ex() */ -#define CHECKUID_NO_ERRORS 0x01 - -BEGIN_EXTERN_C() -PHPAPI int php_checkuid(const char *filename, const char *fopen_mode, int mode); -PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags); -PHPAPI char *php_get_current_user(void); -END_EXTERN_C() - -#endif diff --git a/main/snprintf.c b/main/snprintf.c deleted file mode 100644 index 976724126612a..0000000000000 --- a/main/snprintf.c +++ /dev/null @@ -1,1261 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#include "php.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_INTTYPES_H -#include -#endif - -#ifdef HAVE_LOCALE_H -#include -#define LCONV_DECIMAL_POINT (*lconv->decimal_point) -#else -#define LCONV_DECIMAL_POINT '.' -#endif - -/* - * Copyright (c) 2002, 2006 Todd C. Miller - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Sponsored in part by the Defense Advanced Research Projects - * Agency (DARPA) and Air Force Research Laboratory, Air Force - * Materiel Command, USAF, under agreement number F39502-99-1-0512. - */ - -static char * __cvt(double value, int ndigit, int *decpt, int *sign, int fmode, int pad) /* {{{ */ -{ - register char *s = NULL; - char *p, *rve, c; - size_t siz; - - if (ndigit < 0) { - siz = -ndigit + 1; - } else { - siz = ndigit + 1; - } - - /* __dtoa() doesn't allocate space for 0 so we do it by hand */ - if (value == 0.0) { - *decpt = 1 - fmode; /* 1 for 'e', 0 for 'f' */ - *sign = 0; - if ((rve = s = (char *)malloc(ndigit?siz:2)) == NULL) { - return(NULL); - } - *rve++ = '0'; - *rve = '\0'; - if (!ndigit) { - return(s); - } - } else { - p = zend_dtoa(value, fmode + 2, ndigit, decpt, sign, &rve); - if (*decpt == 9999) { - /* Infinity or Nan, convert to inf or nan like printf */ - *decpt = 0; - c = *p; - zend_freedtoa(p); - return(c == 'I' ? "INF" : "NAN"); - } - /* Make a local copy and adjust rve to be in terms of s */ - if (pad && fmode) { - siz += *decpt; - } - if ((s = (char *)malloc(siz+1)) == NULL) { - zend_freedtoa(p); - return(NULL); - } - (void) strlcpy(s, p, siz); - rve = s + (rve - p); - zend_freedtoa(p); - } - - /* Add trailing zeros */ - if (pad) { - siz -= rve - s; - while (--siz) { - *rve++ = '0'; - } - *rve = '\0'; - } - - return(s); -} -/* }}} */ - -static inline char *php_ecvt(double value, int ndigit, int *decpt, int *sign) /* {{{ */ -{ - return(__cvt(value, ndigit, decpt, sign, 0, 1)); -} -/* }}} */ - -static inline char *php_fcvt(double value, int ndigit, int *decpt, int *sign) /* {{{ */ -{ - return(__cvt(value, ndigit, decpt, sign, 1, 1)); -} -/* }}} */ - -PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf) /* {{{ */ -{ - char *digits, *dst, *src; - int i, decpt, sign; - - digits = zend_dtoa(value, 2, ndigit, &decpt, &sign, NULL); - if (decpt == 9999) { - /* - * Infinity or NaN, convert to inf or nan with sign. - * We assume the buffer is at least ndigit long. - */ - snprintf(buf, ndigit + 1, "%s%s", (sign && *digits == 'I') ? "-" : "", *digits == 'I' ? "INF" : "NAN"); - zend_freedtoa(digits); - return (buf); - } - - dst = buf; - if (sign) { - *dst++ = '-'; - } - - if ((decpt >= 0 && decpt > ndigit) || decpt < -3) { /* use E-style */ - /* exponential format (e.g. 1.2345e+13) */ - if (--decpt < 0) { - sign = 1; - decpt = -decpt; - } else { - sign = 0; - } - src = digits; - *dst++ = *src++; - *dst++ = dec_point; - if (*src == '\0') { - *dst++ = '0'; - } else { - do { - *dst++ = *src++; - } while (*src != '\0'); - } - *dst++ = exponent; - if (sign) { - *dst++ = '-'; - } else { - *dst++ = '+'; - } - if (decpt < 10) { - *dst++ = '0' + decpt; - *dst = '\0'; - } else { - /* XXX - optimize */ - for (sign = decpt, i = 0; (sign /= 10) != 0; i++) - continue; - dst[i + 1] = '\0'; - while (decpt != 0) { - dst[i--] = '0' + decpt % 10; - decpt /= 10; - } - } - } else if (decpt < 0) { - /* standard format 0. */ - *dst++ = '0'; /* zero before decimal point */ - *dst++ = dec_point; - do { - *dst++ = '0'; - } while (++decpt < 0); - src = digits; - while (*src != '\0') { - *dst++ = *src++; - } - *dst = '\0'; - } else { - /* standard format */ - for (i = 0, src = digits; i < decpt; i++) { - if (*src != '\0') { - *dst++ = *src++; - } else { - *dst++ = '0'; - } - } - if (*src != '\0') { - if (src == digits) { - *dst++ = '0'; /* zero before decimal point */ - } - *dst++ = dec_point; - for (i = decpt; digits[i] != '\0'; i++) { - *dst++ = digits[i]; - } - } - *dst = '\0'; - } - zend_freedtoa(digits); - return (buf); -} -/* }}} */ - -/* {{{ Apache license */ -/* ==================================================================== - * Copyright (c) 1995-1998 The Apache Group. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Group" must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 5. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Group and was originally based - * on public domain software written at the National Center for - * Supercomputing Applications, University of Illinois, Urbana-Champaign. - * For more information on the Apache Group and the Apache HTTP server - * project, please see . - * - * This code is based on, and used with the permission of, the - * SIO stdio-replacement strx_* functions by Panos Tsirigotis - * for xinetd. - */ -/* }}} */ - -#define FALSE 0 -#define TRUE 1 -#define NUL '\0' -#define INT_NULL ((int *)0) - -#define S_NULL "(null)" -#define S_NULL_LEN 6 - -#define FLOAT_DIGITS 6 -#define EXPONENT_LENGTH 10 - - -/* - * Convert num to its decimal format. - * Return value: - * - a pointer to a string containing the number (no sign) - * - len contains the length of the string - * - is_negative is set to TRUE or FALSE depending on the sign - * of the number (always set to FALSE if is_unsigned is TRUE) - * - * The caller provides a buffer for the string: that is the buf_end argument - * which is a pointer to the END of the buffer + 1 (i.e. if the buffer - * is declared as buf[ 100 ], buf_end should be &buf[ 100 ]) - */ -/* char * ap_php_conv_10() {{{ */ -char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned, - register bool_int * is_negative, char *buf_end, register int *len) -{ - register char *p = buf_end; - register u_wide_int magnitude; - - if (is_unsigned) { - magnitude = (u_wide_int) num; - *is_negative = FALSE; - } else { - *is_negative = (num < 0); - - /* - * On a 2's complement machine, negating the most negative integer - * results in a number that cannot be represented as a signed integer. - * Here is what we do to obtain the number's magnitude: - * a. add 1 to the number - * b. negate it (becomes positive) - * c. convert it to unsigned - * d. add 1 - */ - if (*is_negative) { - wide_int t = num + 1; - magnitude = ((u_wide_int) - t) + 1; - } else { - magnitude = (u_wide_int) num; - } - } - - /* - * We use a do-while loop so that we write at least 1 digit - */ - do { - register u_wide_int new_magnitude = magnitude / 10; - - *--p = (char)(magnitude - new_magnitude * 10 + '0'); - magnitude = new_magnitude; - } - while (magnitude); - - *len = buf_end - p; - return (p); -} -/* }}} */ - -/* If you change this value then also change bug24640.phpt. - * Also NDIG must be reasonable smaller than NUM_BUF_SIZE. - */ -#define NDIG 320 - - -/* - * Convert a floating point number to a string formats 'f', 'e' or 'E'. - * The result is placed in buf, and len denotes the length of the string - * The sign is returned in the is_negative argument (and is not placed - * in buf). - */ -/* PHPAPI char * php_conv_fp() {{{ */ -PHPAPI char * php_conv_fp(register char format, register double num, - boolean_e add_dp, int precision, char dec_point, bool_int * is_negative, char *buf, int *len) -{ - register char *s = buf; - register char *p, *p_orig; - int decimal_point; - - if (precision >= NDIG - 1) { - precision = NDIG - 2; - } - - if (format == 'F') { - p_orig = p = php_fcvt(num, precision, &decimal_point, is_negative); - } else { /* either e or E format */ - p_orig = p = php_ecvt(num, precision + 1, &decimal_point, is_negative); - } - - /* - * Check for Infinity and NaN - */ - if (isalpha((int)*p)) { - *len = strlen(p); - memcpy(buf, p, *len + 1); - *is_negative = FALSE; - free(p_orig); - return (buf); - } - if (format == 'F') { - if (decimal_point <= 0) { - if (num != 0 || precision > 0) { - *s++ = '0'; - if (precision > 0) { - *s++ = dec_point; - while (decimal_point++ < 0) { - *s++ = '0'; - } - } else if (add_dp) { - *s++ = dec_point; - } - } - } else { - int addz = decimal_point >= NDIG ? decimal_point - NDIG + 1 : 0; - decimal_point -= addz; - while (decimal_point-- > 0) { - *s++ = *p++; - } - while (addz-- > 0) { - *s++ = '0'; - } - if (precision > 0 || add_dp) { - *s++ = dec_point; - } - } - } else { - *s++ = *p++; - if (precision > 0 || add_dp) { - *s++ = '.'; - } - } - - /* - * copy the rest of p, the NUL is NOT copied - */ - while (*p) { - *s++ = *p++; - } - - if (format != 'F') { - char temp[EXPONENT_LENGTH]; /* for exponent conversion */ - int t_len; - bool_int exponent_is_negative; - - *s++ = format; /* either e or E */ - decimal_point--; - if (decimal_point != 0) { - p = ap_php_conv_10((wide_int) decimal_point, FALSE, &exponent_is_negative, &temp[EXPONENT_LENGTH], &t_len); - *s++ = exponent_is_negative ? '-' : '+'; - - /* - * Make sure the exponent has at least 2 digits - */ - while (t_len--) { - *s++ = *p++; - } - } else { - *s++ = '+'; - *s++ = '0'; - } - } - *len = s - buf; - free(p_orig); - return (buf); -} -/* }}} */ - -/* - * Convert num to a base X number where X is a power of 2. nbits determines X. - * For example, if nbits is 3, we do base 8 conversion - * Return value: - * a pointer to a string containing the number - * - * The caller provides a buffer for the string: that is the buf_end argument - * which is a pointer to the END of the buffer + 1 (i.e. if the buffer - * is declared as buf[ 100 ], buf_end should be &buf[ 100 ]) - */ -char * ap_php_conv_p2(register u_wide_int num, register int nbits, char format, char *buf_end, register int *len) /* {{{ */ -{ - register int mask = (1 << nbits) - 1; - register char *p = buf_end; - static char low_digits[] = "0123456789abcdef"; - static char upper_digits[] = "0123456789ABCDEF"; - register char *digits = (format == 'X') ? upper_digits : low_digits; - - do { - *--p = digits[num & mask]; - num >>= nbits; - } - while (num); - - *len = buf_end - p; - return (p); -} -/* }}} */ - -/* - * NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions - * - * XXX: this is a magic number; do not decrease it - */ -#define NUM_BUF_SIZE 512 - - -/* - * Descriptor for buffer area - */ -struct buf_area { - char *buf_end; - char *nextb; /* pointer to next byte to read/write */ -}; - -typedef struct buf_area buffy; - -/* - * The INS_CHAR macro inserts a character in the buffer and writes - * the buffer back to disk if necessary - * It uses the char pointers sp and bep: - * sp points to the next available character in the buffer - * bep points to the end-of-buffer+1 - * While using this macro, note that the nextb pointer is NOT updated. - * - * NOTE: Evaluation of the c argument should not have any side-effects - */ -#define INS_CHAR(c, sp, bep, cc) \ - { \ - if (sp < bep) \ - { \ - *sp++ = c; \ - } \ - cc++; \ - } - -#define NUM( c ) ( c - '0' ) - -#define STR_TO_DEC( str, num ) \ - num = NUM( *str++ ) ; \ - while ( isdigit((int)*str ) ) \ - { \ - num *= 10 ; \ - num += NUM( *str++ ) ; \ - } - -/* - * This macro does zero padding so that the precision - * requirement is satisfied. The padding is done by - * adding '0's to the left of the string that is going - * to be printed. - */ -#define FIX_PRECISION( adjust, precision, s, s_len ) \ - if ( adjust ) \ - while ( s_len < precision ) \ - { \ - *--s = '0' ; \ - s_len++ ; \ - } - -/* - * Macro that does padding. The padding is done by printing - * the character ch. - */ -#define PAD( width, len, ch ) do \ - { \ - INS_CHAR( ch, sp, bep, cc ) ; \ - width-- ; \ - } \ - while ( width > len ) - -/* - * Prefix the character ch to the string str - * Increase length - * Set the has_prefix flag - */ -#define PREFIX( str, length, ch ) *--str = ch ; length++ ; has_prefix = YES - - -/* - * Do format conversion placing the output in buffer - */ -static int format_converter(register buffy * odp, const char *fmt, va_list ap) /* {{{ */ -{ - register char *sp; - register char *bep; - register int cc = 0; - register int i; - - register char *s = NULL; - char *q; - int s_len; - - register int min_width = 0; - int precision = 0; - enum { - LEFT, RIGHT - } adjust; - char pad_char; - char prefix_char; - - double fp_num; - wide_int i_num = (wide_int) 0; - u_wide_int ui_num; - - char num_buf[NUM_BUF_SIZE]; - char char_buf[2]; /* for printing %% and % */ - -#ifdef HAVE_LOCALE_H - struct lconv *lconv = NULL; -#endif - - /* - * Flag variables - */ - length_modifier_e modifier; - boolean_e alternate_form; - boolean_e print_sign; - boolean_e print_blank; - boolean_e adjust_precision; - boolean_e adjust_width; - bool_int is_negative; - - sp = odp->nextb; - bep = odp->buf_end; - - while (*fmt) { - if (*fmt != '%') { - INS_CHAR(*fmt, sp, bep, cc); - } else { - /* - * Default variable settings - */ - adjust = RIGHT; - alternate_form = print_sign = print_blank = NO; - pad_char = ' '; - prefix_char = NUL; - - fmt++; - - /* - * Try to avoid checking for flags, width or precision - */ - if (isascii((int)*fmt) && !islower((int)*fmt)) { - /* - * Recognize flags: -, #, BLANK, + - */ - for (;; fmt++) { - if (*fmt == '-') - adjust = LEFT; - else if (*fmt == '+') - print_sign = YES; - else if (*fmt == '#') - alternate_form = YES; - else if (*fmt == ' ') - print_blank = YES; - else if (*fmt == '0') - pad_char = '0'; - else - break; - } - - /* - * Check if a width was specified - */ - if (isdigit((int)*fmt)) { - STR_TO_DEC(fmt, min_width); - adjust_width = YES; - } else if (*fmt == '*') { - min_width = va_arg(ap, int); - fmt++; - adjust_width = YES; - if (min_width < 0) { - adjust = LEFT; - min_width = -min_width; - } - } else - adjust_width = NO; - - /* - * Check if a precision was specified - * - * XXX: an unreasonable amount of precision may be specified - * resulting in overflow of num_buf. Currently we - * ignore this possibility. - */ - if (*fmt == '.') { - adjust_precision = YES; - fmt++; - if (isdigit((int)*fmt)) { - STR_TO_DEC(fmt, precision); - } else if (*fmt == '*') { - precision = va_arg(ap, int); - fmt++; - if (precision < 0) - precision = 0; - } else - precision = 0; - } else - adjust_precision = NO; - } else - adjust_precision = adjust_width = NO; - - /* - * Modifier check - */ - switch (*fmt) { - case 'L': - fmt++; - modifier = LM_LONG_DOUBLE; - break; - case 'I': - fmt++; -#if SIZEOF_LONG_LONG - if (*fmt == '6' && *(fmt+1) == '4') { - fmt += 2; - modifier = LM_LONG_LONG; - } else -#endif - if (*fmt == '3' && *(fmt+1) == '2') { - fmt += 2; - modifier = LM_LONG; - } else { -#ifdef _WIN64 - modifier = LM_LONG_LONG; -#else - modifier = LM_LONG; -#endif - } - break; - case 'l': - fmt++; -#if SIZEOF_LONG_LONG - if (*fmt == 'l') { - fmt++; - modifier = LM_LONG_LONG; - } else -#endif - modifier = LM_LONG; - break; - case 'z': - fmt++; - modifier = LM_SIZE_T; - break; - case 'j': - fmt++; -#if SIZEOF_INTMAX_T - modifier = LM_INTMAX_T; -#else - modifier = LM_SIZE_T; -#endif - break; - case 't': - fmt++; -#if SIZEOF_PTRDIFF_T - modifier = LM_PTRDIFF_T; -#else - modifier = LM_SIZE_T; -#endif - break; - case 'h': - fmt++; - if (*fmt == 'h') { - fmt++; - } - /* these are promoted to int, so no break */ - default: - modifier = LM_STD; - break; - } - - /* - * Argument extraction and printing. - * First we determine the argument type. - * Then, we convert the argument to a string. - * On exit from the switch, s points to the string that - * must be printed, s_len has the length of the string - * The precision requirements, if any, are reflected in s_len. - * - * NOTE: pad_char may be set to '0' because of the 0 flag. - * It is reset to ' ' by non-numeric formats - */ - switch (*fmt) { - case 'u': - switch(modifier) { - default: - i_num = (wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - i_num = (wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - i_num = (wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - i_num = (wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - i_num = (wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - i_num = (wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - /* - * The rest also applies to other integer formats, so fall - * into that case. - */ - case 'd': - case 'i': - /* - * Get the arg if we haven't already. - */ - if ((*fmt) != 'u') { - switch(modifier) { - default: - i_num = (wide_int) va_arg(ap, int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - i_num = (wide_int) va_arg(ap, long int); - break; - case LM_SIZE_T: -#if SIZEOF_SSIZE_T - i_num = (wide_int) va_arg(ap, ssize_t); -#else - i_num = (wide_int) va_arg(ap, size_t); -#endif - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - i_num = (wide_int) va_arg(ap, wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - i_num = (wide_int) va_arg(ap, intmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - i_num = (wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - } - s = ap_php_conv_10(i_num, (*fmt) == 'u', &is_negative, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - - if (*fmt != 'u') { - if (is_negative) { - prefix_char = '-'; - } else if (print_sign) { - prefix_char = '+'; - } else if (print_blank) { - prefix_char = ' '; - } - } - break; - - - case 'o': - switch(modifier) { - default: - ui_num = (u_wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - ui_num = (u_wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - ui_num = (u_wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - ui_num = (u_wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - ui_num = (u_wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - s = ap_php_conv_p2(ui_num, 3, *fmt, &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && *s != '0') { - *--s = '0'; - s_len++; - } - break; - - - case 'x': - case 'X': - switch(modifier) { - default: - ui_num = (u_wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - ui_num = (u_wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - ui_num = (u_wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - ui_num = (u_wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - ui_num = (u_wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - s = ap_php_conv_p2(ui_num, 4, *fmt, &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && i_num != 0) { - *--s = *fmt; /* 'x' or 'X' */ - *--s = '0'; - s_len += 2; - } - break; - - - case 's': - case 'v': - s = va_arg(ap, char *); - if (s != NULL) { - s_len = strlen(s); - if (adjust_precision && precision < s_len) { - s_len = precision; - } - } else { - s = S_NULL; - s_len = S_NULL_LEN; - } - pad_char = ' '; - break; - - - case 'f': - case 'F': - case 'e': - case 'E': - switch(modifier) { - case LM_LONG_DOUBLE: - fp_num = (double) va_arg(ap, long double); - break; - case LM_STD: - fp_num = va_arg(ap, double); - break; - default: - goto fmt_error; - } - - if (zend_isnan(fp_num)) { - s = "NAN"; - s_len = 3; - } else if (zend_isinf(fp_num)) { - s = "INF"; - s_len = 3; - } else { -#ifdef HAVE_LOCALE_H - if (!lconv) { - lconv = localeconv(); - } -#endif - s = php_conv_fp((*fmt == 'f')?'F':*fmt, fp_num, alternate_form, - (adjust_precision == NO) ? FLOAT_DIGITS : precision, - (*fmt == 'f')?LCONV_DECIMAL_POINT:'.', - &is_negative, &num_buf[1], &s_len); - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - } - break; - - - case 'g': - case 'k': - case 'G': - case 'H': - switch(modifier) { - case LM_LONG_DOUBLE: - fp_num = (double) va_arg(ap, long double); - break; - case LM_STD: - fp_num = va_arg(ap, double); - break; - default: - goto fmt_error; - } - - if (zend_isnan(fp_num)) { - s = "NAN"; - s_len = 3; - break; - } else if (zend_isinf(fp_num)) { - if (fp_num > 0) { - s = "INF"; - s_len = 3; - } else { - s = "-INF"; - s_len = 4; - } - break; - } - - if (adjust_precision == NO) { - precision = FLOAT_DIGITS; - } else if (precision == 0) { - precision = 1; - } - /* - * * We use &num_buf[ 1 ], so that we have room for the sign - */ -#ifdef HAVE_LOCALE_H - if (!lconv) { - lconv = localeconv(); - } -#endif - s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]); - if (*s == '-') { - prefix_char = *s++; - } else if (print_sign) { - prefix_char = '+'; - } else if (print_blank) { - prefix_char = ' '; - } - - s_len = strlen(s); - - if (alternate_form && (q = strchr(s, '.')) == NULL) { - s[s_len++] = '.'; - } - break; - - - case 'c': - char_buf[0] = (char) (va_arg(ap, int)); - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case '%': - char_buf[0] = '%'; - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case 'n': - *(va_arg(ap, int *)) = cc; - goto skip_output; - - /* - * Always extract the argument as a "char *" pointer. We - * should be using "void *" but there are still machines - * that don't understand it. - * If the pointer size is equal to the size of an unsigned - * integer we convert the pointer to a hex number, otherwise - * we print "%p" to indicate that we don't handle "%p". - */ - case 'p': - if (sizeof(char *) <= sizeof(u_wide_int)) { - ui_num = (u_wide_int)((size_t) va_arg(ap, char *)); - s = ap_php_conv_p2(ui_num, 4, 'x', - &num_buf[NUM_BUF_SIZE], &s_len); - if (ui_num != 0) { - *--s = 'x'; - *--s = '0'; - s_len += 2; - } - } else { - s = "%p"; - s_len = 2; - } - pad_char = ' '; - break; - - - case NUL: - /* - * The last character of the format string was %. - * We ignore it. - */ - continue; - - -fmt_error: - php_error(E_ERROR, "Illegal length modifier specified '%c' in s[np]printf call", *fmt); - /* - * The default case is for unrecognized %'s. - * We print % to help the user identify what - * option is not understood. - * This is also useful in case the user wants to pass - * the output of format_converter to another function - * that understands some other % (like syslog). - * Note that we can't point s inside fmt because the - * unknown could be preceded by width etc. - */ - default: - char_buf[0] = '%'; - char_buf[1] = *fmt; - s = char_buf; - s_len = 2; - pad_char = ' '; - break; - } - - if (prefix_char != NUL) { - *--s = prefix_char; - s_len++; - } - if (adjust_width && adjust == RIGHT && min_width > s_len) { - if (pad_char == '0' && prefix_char != NUL) { - INS_CHAR(*s, sp, bep, cc) - s++; - s_len--; - min_width--; - } - PAD(min_width, s_len, pad_char); - } - /* - * Print the string s. - */ - for (i = s_len; i != 0; i--) { - INS_CHAR(*s, sp, bep, cc); - s++; - } - - if (adjust_width && adjust == LEFT && min_width > s_len) - PAD(min_width, s_len, pad_char); - } -skip_output: - fmt++; - } - odp->nextb = sp; - return (cc); -} -/* }}} */ - -/* - * This is the general purpose conversion function. - */ -static void strx_printv(int *ccp, char *buf, size_t len, const char *format, va_list ap) /* {{{ */ -{ - buffy od; - int cc; - - /* - * First initialize the descriptor - * Notice that if no length is given, we initialize buf_end to the - * highest possible address. - */ - if (len == 0) { - od.buf_end = (char *) ~0; - od.nextb = (char *) ~0; - } else { - od.buf_end = &buf[len-1]; - od.nextb = buf; - } - - /* - * Do the conversion - */ - cc = format_converter(&od, format, ap); - if (len != 0 && od.nextb <= od.buf_end) { - *(od.nextb) = '\0'; - } - if (ccp) { - *ccp = cc; - } -} -/* }}} */ - -PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */ -{ - int cc; - va_list ap; - - va_start(ap, format); - strx_printv(&cc, buf, len, format, ap); - va_end(ap); - if (cc >= len) { - cc = len -1; - buf[cc] = '\0'; - } - return cc; -} -/* }}} */ - -PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */ -{ - int cc; - - strx_printv(&cc, buf, len, format, ap); - if (cc >= len) { - cc = len -1; - buf[cc] = '\0'; - } - return cc; -} -/* }}} */ - -PHPAPI int ap_php_snprintf(char *buf, size_t len, const char *format,...) /* {{{ */ -{ - int cc; - va_list ap; - - va_start(ap, format); - strx_printv(&cc, buf, len, format, ap); - va_end(ap); - return (cc); -} -/* }}} */ - -PHPAPI int ap_php_vsnprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */ -{ - int cc; - - strx_printv(&cc, buf, len, format, ap); - return (cc); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/snprintf.h b/main/snprintf.h deleted file mode 100644 index b3ea02ee82fab..0000000000000 --- a/main/snprintf.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Stig Sæther Bakken | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - -Comparing: sprintf, snprintf, slprintf, spprintf - -sprintf offers the ability to make a lot of failures since it does not know - the size of the buffer it uses. Therefore usage of sprintf often - results in possible entries for buffer overrun attacks. So please - use this version only if you are sure the call is safe. sprintf - allways terminstes the buffer it writes to. - -snprintf knows the buffers size and will not write behind it. But you will - have to use either a static buffer or allocate a dynamic buffer - before beeing able to call the function. In other words you must - be sure that you really know the maximum size of the buffer required. - A bad thing is having a big maximum while in most cases you would - only need a small buffer. If the size of the resulting string is - longer or equal to the buffer size than the buffer is not terminated. - The function also returns the number of chars not including the - terminating \0 that were needed to fully comply to the print request. - -slprintf same as snprintf with the difference that it actually returns the - length printed not including the terminating \0. - -spprintf is the dynamical version of snprintf. It allocates the buffer in size - as needed and allows a maximum setting as snprintf (turn this feature - off by setting max_len to 0). spprintf is a little bit slower than - snprintf and offers possible memory leakes if you miss freeing the - buffer allocated by the function. Therfore this function should be - used where either no maximum is known or the maximum is much bigger - than normal size required. spprintf allways terminates the buffer. - -Example: - - #define MAX 1024 | #define MAX 1024 | #define MAX 1024 - char buffer[MAX] | char buffer[MAX] | char *buffer; - | | - | | // No need to initialize buffer: - | | // spprintf ignores value of buffer - sprintf(buffer, "test"); | snprintf(buffer, MAX, "test"); | spprintf(&buffer, MAX, "text"); - | | if (!buffer) - | | return OUT_OF_MEMORY - // sprintf allways terminates | // manual termination of | // spprintf allays terminates buffer - // buffer | // buffer *IS* required | - | buffer[MAX-1] = 0; | - action_with_buffer(buffer); | action_with_buffer(buffer); | action_with_buffer(buffer); - | | efree(buffer); -*/ - -#ifndef SNPRINTF_H -#define SNPRINTF_H - -typedef int bool_int; - -typedef enum { - NO = 0, YES = 1 -} boolean_e; - - -BEGIN_EXTERN_C() -PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...); -PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap); -PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...); -PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap); -PHPAPI int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); -PHPAPI char * php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf); -PHPAPI char * php_conv_fp(register char format, register double num, - boolean_e add_dp, int precision, char dec_point, bool_int * is_negative, char *buf, int *len); - -END_EXTERN_C() - -#ifdef slprintf -#undef slprintf -#endif -#define slprintf ap_php_slprintf - -#ifdef vslprintf -#undef vslprintf -#endif -#define vslprintf ap_php_vslprintf - -#ifdef snprintf -#undef snprintf -#endif -#define snprintf ap_php_snprintf - -#ifdef vsnprintf -#undef vsnprintf -#endif -#define vsnprintf ap_php_vsnprintf - -#ifdef sprintf -#undef sprintf -#endif -#define sprintf php_sprintf - -typedef enum { - LM_STD = 0, -#if SIZEOF_INTMAX_T - LM_INTMAX_T, -#endif -#if SIZEOF_PTRDIFF_T - LM_PTRDIFF_T, -#endif -#if SIZEOF_LONG_LONG - LM_LONG_LONG, -#endif - LM_SIZE_T, - LM_LONG, - LM_LONG_DOUBLE -} length_modifier_e; - -#ifdef PHP_WIN32 -# define WIDE_INT __int64 -#elif SIZEOF_LONG_LONG_INT -# define WIDE_INT long long int -#elif SIZEOF_LONG_LONG -# define WIDE_INT long long -#else -# define WIDE_INT long -#endif -typedef WIDE_INT wide_int; -typedef unsigned WIDE_INT u_wide_int; - -extern char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned, - register bool_int * is_negative, char *buf_end, register int *len); - -extern char * ap_php_conv_p2(register u_wide_int num, register int nbits, - char format, char *buf_end, register int *len); - -#endif /* SNPRINTF_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/spprintf.c b/main/spprintf.c deleted file mode 100644 index 24a214734c039..0000000000000 --- a/main/spprintf.c +++ /dev/null @@ -1,801 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This is the spprintf implementation. - * It has emerged from apache snprintf. See original header: - */ - -/* ==================================================================== - * Copyright (c) 1995-1998 The Apache Group. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * 4. The names "Apache Server" and "Apache Group" must not be used to - * endorse or promote products derived from this software without - * prior written permission. - * - * 5. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the Apache Group - * for use in the Apache HTTP server project (http://www.apache.org/)." - * - * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Group and was originally based - * on public domain software written at the National Center for - * Supercomputing Applications, University of Illinois, Urbana-Champaign. - * For more information on the Apache Group and the Apache HTTP server - * project, please see . - * - * This code is based on, and used with the permission of, the - * SIO stdio-replacement strx_* functions by Panos Tsirigotis - * for xinetd. - */ -#include "php.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef HAVE_INTTYPES_H -#include -#endif - -#ifdef HAVE_LOCALE_H -#include -#define LCONV_DECIMAL_POINT (*lconv->decimal_point) -#else -#define LCONV_DECIMAL_POINT '.' -#endif - -#include "snprintf.h" - -#define FALSE 0 -#define TRUE 1 -#define NUL '\0' -#define INT_NULL ((int *)0) - -#define S_NULL "(null)" -#define S_NULL_LEN 6 - -#define FLOAT_DIGITS 6 -#define EXPONENT_LENGTH 10 - -#include "ext/standard/php_smart_str.h" - -/* {{{ macros */ - -/* - * NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions - * - * XXX: this is a magic number; do not decrease it - */ -#define NUM_BUF_SIZE 512 - -/* - * The INS_CHAR macro inserts a character in the buffer. - * - * NOTE: Evaluation of the ch argument should not have any side-effects - */ -#define INS_CHAR_NR(xbuf, ch) do { \ - smart_str_appendc(xbuf, ch); \ -} while (0) - -#define INS_STRING(xbuf, s, slen) do { \ - smart_str_appendl(xbuf, s, slen); \ -} while (0) - -#define INS_CHAR(xbuf, ch) \ - INS_CHAR_NR(xbuf, ch) - -/* - * Macro that does padding. The padding is done by printing - * the character ch. - */ -#define PAD(xbuf, count, ch) do { \ - if ((count) > 0) { \ - size_t newlen; \ - smart_str_alloc(xbuf, (count), 0); \ - memset(xbuf->c + xbuf->len, ch, (count)); \ - xbuf->len += (count); \ - } \ -} while (0) - -#define NUM(c) (c - '0') - -#define STR_TO_DEC(str, num) do { \ - num = NUM(*str++); \ - while (isdigit((int)*str)) { \ - num *= 10; \ - num += NUM(*str++); \ - if (num >= INT_MAX / 10) { \ - while (isdigit((int)*str++)); \ - break; \ - } \ - } \ -} while (0) - -/* - * This macro does zero padding so that the precision - * requirement is satisfied. The padding is done by - * adding '0's to the left of the string that is going - * to be printed. - */ -#define FIX_PRECISION(adjust, precision, s, s_len) do { \ - if (adjust) \ - while (s_len < precision) { \ - *--s = '0'; \ - s_len++; \ - } \ -} while (0) - -/* }}} */ - -/* - * Do format conversion placing the output in buffer - */ -static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap) /* {{{ */ -{ - register char *s = NULL; - char *q; - int s_len; - - register int min_width = 0; - int precision = 0; - enum { - LEFT, RIGHT - } adjust; - char pad_char; - char prefix_char; - - double fp_num; - wide_int i_num = (wide_int) 0; - u_wide_int ui_num; - - char num_buf[NUM_BUF_SIZE]; - char char_buf[2]; /* for printing %% and % */ - -#ifdef HAVE_LOCALE_H - struct lconv *lconv = NULL; -#endif - - /* - * Flag variables - */ - length_modifier_e modifier; - boolean_e alternate_form; - boolean_e print_sign; - boolean_e print_blank; - boolean_e adjust_precision; - boolean_e adjust_width; - bool_int is_negative; - - while (*fmt) { - if (*fmt != '%') { - INS_CHAR(xbuf, *fmt); - } else { - /* - * Default variable settings - */ - adjust = RIGHT; - alternate_form = print_sign = print_blank = NO; - pad_char = ' '; - prefix_char = NUL; - - fmt++; - - /* - * Try to avoid checking for flags, width or precision - */ - if (isascii((int)*fmt) && !islower((int)*fmt)) { - /* - * Recognize flags: -, #, BLANK, + - */ - for (;; fmt++) { - if (*fmt == '-') - adjust = LEFT; - else if (*fmt == '+') - print_sign = YES; - else if (*fmt == '#') - alternate_form = YES; - else if (*fmt == ' ') - print_blank = YES; - else if (*fmt == '0') - pad_char = '0'; - else - break; - } - - /* - * Check if a width was specified - */ - if (isdigit((int)*fmt)) { - STR_TO_DEC(fmt, min_width); - adjust_width = YES; - } else if (*fmt == '*') { - min_width = va_arg(ap, int); - fmt++; - adjust_width = YES; - if (min_width < 0) { - adjust = LEFT; - min_width = -min_width; - } - } else - adjust_width = NO; - - /* - * Check if a precision was specified - * - * XXX: an unreasonable amount of precision may be specified - * resulting in overflow of num_buf. Currently we - * ignore this possibility. - */ - if (*fmt == '.') { - adjust_precision = YES; - fmt++; - if (isdigit((int)*fmt)) { - STR_TO_DEC(fmt, precision); - } else if (*fmt == '*') { - precision = va_arg(ap, int); - fmt++; - if (precision < 0) - precision = 0; - } else - precision = 0; - } else - adjust_precision = NO; - } else - adjust_precision = adjust_width = NO; - - /* - * Modifier check - */ - switch (*fmt) { - case 'L': - fmt++; - modifier = LM_LONG_DOUBLE; - break; - case 'I': - fmt++; -#if SIZEOF_LONG_LONG - if (*fmt == '6' && *(fmt+1) == '4') { - fmt += 2; - modifier = LM_LONG_LONG; - } else -#endif - if (*fmt == '3' && *(fmt+1) == '2') { - fmt += 2; - modifier = LM_LONG; - } else { -#ifdef _WIN64 - modifier = LM_LONG_LONG; -#else - modifier = LM_LONG; -#endif - } - break; - case 'l': - fmt++; -#if SIZEOF_LONG_LONG - if (*fmt == 'l') { - fmt++; - modifier = LM_LONG_LONG; - } else -#endif - modifier = LM_LONG; - break; - case 'z': - fmt++; - modifier = LM_SIZE_T; - break; - case 'j': - fmt++; -#if SIZEOF_INTMAX_T - modifier = LM_INTMAX_T; -#else - modifier = LM_SIZE_T; -#endif - break; - case 't': - fmt++; -#if SIZEOF_PTRDIFF_T - modifier = LM_PTRDIFF_T; -#else - modifier = LM_SIZE_T; -#endif - break; - case 'h': - fmt++; - if (*fmt == 'h') { - fmt++; - } - /* these are promoted to int, so no break */ - default: - modifier = LM_STD; - break; - } - - /* - * Argument extraction and printing. - * First we determine the argument type. - * Then, we convert the argument to a string. - * On exit from the switch, s points to the string that - * must be printed, s_len has the length of the string - * The precision requirements, if any, are reflected in s_len. - * - * NOTE: pad_char may be set to '0' because of the 0 flag. - * It is reset to ' ' by non-numeric formats - */ - switch (*fmt) { - case 'u': - switch(modifier) { - default: - i_num = (wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - i_num = (wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - i_num = (wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - i_num = (wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - i_num = (wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - i_num = (wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - /* - * The rest also applies to other integer formats, so fall - * into that case. - */ - case 'd': - case 'i': - /* - * Get the arg if we haven't already. - */ - if ((*fmt) != 'u') { - switch(modifier) { - default: - i_num = (wide_int) va_arg(ap, int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - i_num = (wide_int) va_arg(ap, long int); - break; - case LM_SIZE_T: -#if SIZEOF_SSIZE_T - i_num = (wide_int) va_arg(ap, ssize_t); -#else - i_num = (wide_int) va_arg(ap, size_t); -#endif - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - i_num = (wide_int) va_arg(ap, wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - i_num = (wide_int) va_arg(ap, intmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - i_num = (wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - } - s = ap_php_conv_10(i_num, (*fmt) == 'u', &is_negative, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - - if (*fmt != 'u') { - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - } - break; - - - case 'o': - switch(modifier) { - default: - ui_num = (u_wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - ui_num = (u_wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - ui_num = (u_wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - ui_num = (u_wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - ui_num = (u_wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - s = ap_php_conv_p2(ui_num, 3, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && *s != '0') { - *--s = '0'; - s_len++; - } - break; - - - case 'x': - case 'X': - switch(modifier) { - default: - ui_num = (u_wide_int) va_arg(ap, unsigned int); - break; - case LM_LONG_DOUBLE: - goto fmt_error; - case LM_LONG: - ui_num = (u_wide_int) va_arg(ap, unsigned long int); - break; - case LM_SIZE_T: - ui_num = (u_wide_int) va_arg(ap, size_t); - break; -#if SIZEOF_LONG_LONG - case LM_LONG_LONG: - ui_num = (u_wide_int) va_arg(ap, u_wide_int); - break; -#endif -#if SIZEOF_INTMAX_T - case LM_INTMAX_T: - ui_num = (u_wide_int) va_arg(ap, uintmax_t); - break; -#endif -#if SIZEOF_PTRDIFF_T - case LM_PTRDIFF_T: - ui_num = (u_wide_int) va_arg(ap, ptrdiff_t); - break; -#endif - } - s = ap_php_conv_p2(ui_num, 4, *fmt, - &num_buf[NUM_BUF_SIZE], &s_len); - FIX_PRECISION(adjust_precision, precision, s, s_len); - if (alternate_form && i_num != 0) { - *--s = *fmt; /* 'x' or 'X' */ - *--s = '0'; - s_len += 2; - } - break; - - - case 's': - case 'v': - s = va_arg(ap, char *); - if (s != NULL) { - s_len = strlen(s); - if (adjust_precision && precision < s_len) - s_len = precision; - } else { - s = S_NULL; - s_len = S_NULL_LEN; - } - pad_char = ' '; - break; - - - case 'f': - case 'F': - case 'e': - case 'E': - switch(modifier) { - case LM_LONG_DOUBLE: - fp_num = (double) va_arg(ap, long double); - break; - case LM_STD: - fp_num = va_arg(ap, double); - break; - default: - goto fmt_error; - } - - if (zend_isnan(fp_num)) { - s = "nan"; - s_len = 3; - } else if (zend_isinf(fp_num)) { - s = "inf"; - s_len = 3; - } else { -#ifdef HAVE_LOCALE_H - if (!lconv) { - lconv = localeconv(); - } -#endif - s = php_conv_fp((*fmt == 'f')?'F':*fmt, fp_num, alternate_form, - (adjust_precision == NO) ? FLOAT_DIGITS : precision, - (*fmt == 'f')?LCONV_DECIMAL_POINT:'.', - &is_negative, &num_buf[1], &s_len); - if (is_negative) - prefix_char = '-'; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - } - break; - - - case 'g': - case 'k': - case 'G': - case 'H': - switch(modifier) { - case LM_LONG_DOUBLE: - fp_num = (double) va_arg(ap, long double); - break; - case LM_STD: - fp_num = va_arg(ap, double); - break; - default: - goto fmt_error; - } - - if (zend_isnan(fp_num)) { - s = "NAN"; - s_len = 3; - break; - } else if (zend_isinf(fp_num)) { - if (fp_num > 0) { - s = "INF"; - s_len = 3; - } else { - s = "-INF"; - s_len = 4; - } - break; - } - - if (adjust_precision == NO) - precision = FLOAT_DIGITS; - else if (precision == 0) - precision = 1; - /* - * * We use &num_buf[ 1 ], so that we have room for the sign - */ -#ifdef HAVE_LOCALE_H - if (!lconv) { - lconv = localeconv(); - } -#endif - s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]); - if (*s == '-') - prefix_char = *s++; - else if (print_sign) - prefix_char = '+'; - else if (print_blank) - prefix_char = ' '; - - s_len = strlen(s); - - if (alternate_form && (q = strchr(s, '.')) == NULL) - s[s_len++] = '.'; - break; - - - case 'c': - char_buf[0] = (char) (va_arg(ap, int)); - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case '%': - char_buf[0] = '%'; - s = &char_buf[0]; - s_len = 1; - pad_char = ' '; - break; - - - case 'n': - *(va_arg(ap, int *)) = xbuf->len; - goto skip_output; - - /* - * Always extract the argument as a "char *" pointer. We - * should be using "void *" but there are still machines - * that don't understand it. - * If the pointer size is equal to the size of an unsigned - * integer we convert the pointer to a hex number, otherwise - * we print "%p" to indicate that we don't handle "%p". - */ - case 'p': - if (sizeof(char *) <= sizeof(u_wide_int)) { - ui_num = (u_wide_int)((size_t) va_arg(ap, char *)); - s = ap_php_conv_p2(ui_num, 4, 'x', - &num_buf[NUM_BUF_SIZE], &s_len); - if (ui_num != 0) { - *--s = 'x'; - *--s = '0'; - s_len += 2; - } - } else { - s = "%p"; - s_len = 2; - } - pad_char = ' '; - break; - - - case NUL: - /* - * The last character of the format string was %. - * We ignore it. - */ - continue; - - -fmt_error: - php_error(E_ERROR, "Illegal length modifier specified '%c' in s[np]printf call", *fmt); - /* - * The default case is for unrecognized %'s. - * We print % to help the user identify what - * option is not understood. - * This is also useful in case the user wants to pass - * the output of format_converter to another function - * that understands some other % (like syslog). - * Note that we can't point s inside fmt because the - * unknown could be preceded by width etc. - */ - default: - char_buf[0] = '%'; - char_buf[1] = *fmt; - s = char_buf; - s_len = 2; - pad_char = ' '; - break; - } - - if (prefix_char != NUL) { - *--s = prefix_char; - s_len++; - } - if (adjust_width && adjust == RIGHT && min_width > s_len) { - if (pad_char == '0' && prefix_char != NUL) { - INS_CHAR(xbuf, *s); - s++; - s_len--; - min_width--; - } - PAD(xbuf, min_width - s_len, pad_char); - } - /* - * Print the string s. - */ - INS_STRING(xbuf, s, s_len); - - if (adjust_width && adjust == LEFT && min_width > s_len) - PAD(xbuf, min_width - s_len, pad_char); - } -skip_output: - fmt++; - } - return; -} -/* }}} */ - -/* - * This is the general purpose conversion function. - */ -PHPAPI int vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap) /* {{{ */ -{ - smart_str xbuf = {0}; - - xbuf_format_converter(&xbuf, format, ap); - - if (max_len && xbuf.len > max_len) { - xbuf.len = max_len; - } - smart_str_0(&xbuf); - - *pbuf = xbuf.c; - - return xbuf.len; -} -/* }}} */ - -PHPAPI int spprintf(char **pbuf, size_t max_len, const char *format, ...) /* {{{ */ -{ - int cc; - va_list ap; - - va_start(ap, format); - cc = vspprintf(pbuf, max_len, format, ap); - va_end(ap); - return (cc); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/spprintf.h b/main/spprintf.h deleted file mode 100644 index b3a0481a8dd08..0000000000000 --- a/main/spprintf.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - -The pbuf parameter of all spprintf version receives a pointer to the allocated -buffer. This buffer must be freed manually after usage using efree() function. -The buffer will allways be terminated by a zero character. When pbuf is NULL -the function can be used to calculate the required size of the buffer but for -that purpose snprintf is faster. When both pbuf and the return value are 0 -than you are out of memory. - -There is also snprintf: See difference explained in snprintf.h - -*/ - -#ifndef SPPRINTF_H -#define SPPRINTF_H - -#include "snprintf.h" - -BEGIN_EXTERN_C() -PHPAPI int spprintf( char **pbuf, size_t max_len, const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); - -PHPAPI int vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap) PHP_ATTRIBUTE_FORMAT(printf, 3, 0); -END_EXTERN_C() - -#endif /* SNPRINTF_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/main/streams/cast.c b/main/streams/cast.c deleted file mode 100644 index 55e3ed1030272..0000000000000 --- a/main/streams/cast.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define _GNU_SOURCE -#include "php.h" -#include "php_globals.h" -#include "php_network.h" -#include "php_open_temporary_file.h" -#include "ext/standard/file.h" -#include -#include - -#include "php_streams_int.h" - -/* Under BSD, emulate fopencookie using funopen */ -#if HAVE_FUNOPEN -typedef struct { - int (*reader)(void *, char *, int); - int (*writer)(void *, const char *, int); - fpos_t (*seeker)(void *, fpos_t, int); - int (*closer)(void *); -} COOKIE_IO_FUNCTIONS_T; - -FILE *fopencookie(void *cookie, const char *mode, COOKIE_IO_FUNCTIONS_T *funcs) -{ - return funopen(cookie, funcs->reader, funcs->writer, funcs->seeker, funcs->closer); -} -# define HAVE_FOPENCOOKIE 1 -# define PHP_STREAM_COOKIE_FUNCTIONS &stream_cookie_functions -#elif HAVE_FOPENCOOKIE -# define PHP_STREAM_COOKIE_FUNCTIONS stream_cookie_functions -#endif - -/* {{{ STDIO with fopencookie */ -#if HAVE_FUNOPEN -/* use our fopencookie emulation */ -static int stream_cookie_reader(void *cookie, char *buffer, int size) -{ - int ret; - TSRMLS_FETCH(); - ret = php_stream_read((php_stream*)cookie, buffer, size); - return ret; -} - -static int stream_cookie_writer(void *cookie, const char *buffer, int size) -{ - TSRMLS_FETCH(); - return php_stream_write((php_stream *)cookie, (char *)buffer, size); -} - -static fpos_t stream_cookie_seeker(void *cookie, off_t position, int whence) -{ - TSRMLS_FETCH(); - return (fpos_t)php_stream_seek((php_stream *)cookie, position, whence); -} - -static int stream_cookie_closer(void *cookie) -{ - php_stream *stream = (php_stream*)cookie; - TSRMLS_FETCH(); - - /* prevent recursion */ - stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; - return php_stream_close(stream); -} - -#elif HAVE_FOPENCOOKIE -static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size) -{ - ssize_t ret; - TSRMLS_FETCH(); - ret = php_stream_read(((php_stream *)cookie), buffer, size); - return ret; -} - -static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t size) -{ - TSRMLS_FETCH(); - return php_stream_write(((php_stream *)cookie), (char *)buffer, size); -} - -#ifdef COOKIE_SEEKER_USES_OFF64_T -static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence) -{ - TSRMLS_FETCH(); - - *position = php_stream_seek((php_stream *)cookie, (off_t)*position, whence); - - if (*position == -1) - return -1; - return 0; -} -#else -static int stream_cookie_seeker(void *cookie, off_t position, int whence) -{ - TSRMLS_FETCH(); - return php_stream_seek((php_stream *)cookie, position, whence); -} -#endif - -static int stream_cookie_closer(void *cookie) -{ - php_stream *stream = (php_stream*)cookie; - TSRMLS_FETCH(); - - /* prevent recursion */ - stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; - return php_stream_close(stream); -} -#endif /* elif HAVE_FOPENCOOKIE */ - -#if HAVE_FOPENCOOKIE -static COOKIE_IO_FUNCTIONS_T stream_cookie_functions = -{ - stream_cookie_reader, stream_cookie_writer, - stream_cookie_seeker, stream_cookie_closer -}; -#else -/* TODO: use socketpair() to emulate fopencookie, as suggested by Hartmut ? */ -#endif -/* }}} */ - -/* {{{ php_stream_cast */ -PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC) -{ - int flags = castas & PHP_STREAM_CAST_MASK; - castas &= ~PHP_STREAM_CAST_MASK; - - /* synchronize our buffer (if possible) */ - if (ret && castas != PHP_STREAM_AS_FD_FOR_SELECT) { - php_stream_flush(stream); - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { - off_t dummy; - - stream->ops->seek(stream, stream->position, SEEK_SET, &dummy TSRMLS_CC); - stream->readpos = stream->writepos = 0; - } - } - - /* filtered streams can only be cast as stdio, and only when fopencookie is present */ - - if (castas == PHP_STREAM_AS_STDIO) { - if (stream->stdiocast) { - if (ret) { - *(FILE**)ret = stream->stdiocast; - } - goto exit_success; - } - - /* if the stream is a stdio stream let's give it a chance to respond - * first, to avoid doubling up the layers of stdio with an fopencookie */ - if (php_stream_is(stream, PHP_STREAM_IS_STDIO) && - stream->ops->cast && - !php_stream_is_filtered(stream) && - stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS) - { - goto exit_success; - } - -#if HAVE_FOPENCOOKIE - /* if just checking, say yes we can be a FILE*, but don't actually create it yet */ - if (ret == NULL) - goto exit_success; - - *(FILE**)ret = fopencookie(stream, stream->mode, PHP_STREAM_COOKIE_FUNCTIONS); - - if (*ret != NULL) { - off_t pos; - - stream->fclose_stdiocast = PHP_STREAM_FCLOSE_FOPENCOOKIE; - - /* If the stream position is not at the start, we need to force - * the stdio layer to believe it's real location. */ - pos = php_stream_tell(stream); - if (pos > 0) - fseek(*ret, pos, SEEK_SET); - - goto exit_success; - } - - /* must be either: - a) programmer error - b) no memory - -> lets bail - */ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "fopencookie failed"); - return FAILURE; -#endif - - if (!php_stream_is_filtered(stream) && stream->ops->cast && stream->ops->cast(stream, castas, NULL TSRMLS_CC) == SUCCESS) { - if (FAILURE == stream->ops->cast(stream, castas, ret TSRMLS_CC)) { - return FAILURE; - } - goto exit_success; - } else if (flags & PHP_STREAM_CAST_TRY_HARD) { - php_stream *newstream; - - newstream = php_stream_fopen_tmpfile(); - if (newstream) { - size_t copied = php_stream_copy_to_stream(stream, newstream, PHP_STREAM_COPY_ALL); - - if (copied == 0) { - php_stream_close(newstream); - } else { - int retcode = php_stream_cast(newstream, castas | flags, ret, show_err); - - if (retcode == SUCCESS) - rewind(*(FILE**)ret); - - /* do some specialized cleanup */ - if ((flags & PHP_STREAM_CAST_RELEASE)) { - php_stream_free(stream, PHP_STREAM_FREE_CLOSE_CASTED); - } - - return retcode; - } - } - } - } - - if (php_stream_is_filtered(stream)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot cast a filtered stream on this system"); - return FAILURE; - } else if (stream->ops->cast && stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS) { - goto exit_success; - } - - if (show_err) { - /* these names depend on the values of the PHP_STREAM_AS_XXX defines in php_streams.h */ - static const char *cast_names[4] = { - "STDIO FILE*", "File Descriptor", "Socket Descriptor", "select()able descriptor" - }; - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot represent a stream of type %s as a %s", - stream->ops->label, - cast_names[castas] - ); - } - - return FAILURE; - -exit_success: - - if ((stream->writepos - stream->readpos) > 0 && - stream->fclose_stdiocast != PHP_STREAM_FCLOSE_FOPENCOOKIE && - (flags & PHP_STREAM_CAST_INTERNAL) == 0) { - /* the data we have buffered will be lost to the third party library that - * will be accessing the stream. Emit a warning so that the end-user will - * know that they should try something else */ - - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "%ld bytes of buffered data lost during stream conversion!", - (long)(stream->writepos - stream->readpos)); - } - - if (castas == PHP_STREAM_AS_STDIO && ret) - stream->stdiocast = *(FILE**)ret; - - if (flags & PHP_STREAM_CAST_RELEASE) { - php_stream_free(stream, PHP_STREAM_FREE_CLOSE_CASTED); - } - - return SUCCESS; - -} -/* }}} */ - -/* {{{ php_stream_open_wrapper_as_file */ -PHPAPI FILE * _php_stream_open_wrapper_as_file(char *path, char *mode, int options, char **opened_path STREAMS_DC TSRMLS_DC) -{ - FILE *fp = NULL; - php_stream *stream = NULL; - - stream = php_stream_open_wrapper_rel(path, mode, options|STREAM_WILL_CAST, opened_path); - - if (stream == NULL) - return NULL; - - if (php_stream_cast(stream, PHP_STREAM_AS_STDIO|PHP_STREAM_CAST_TRY_HARD|PHP_STREAM_CAST_RELEASE, - (void**)&fp, REPORT_ERRORS) == FAILURE) - { - php_stream_close(stream); - if (opened_path && *opened_path) - efree(*opened_path); - return NULL; - } - return fp; -} -/* }}} */ - -/* {{{ php_stream_make_seekable */ -PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstream, int flags STREAMS_DC TSRMLS_DC) -{ - assert(newstream != NULL); - - *newstream = NULL; - - if (((flags & PHP_STREAM_FORCE_CONVERSION) == 0) && origstream->ops->seek != NULL) { - *newstream = origstream; - return PHP_STREAM_UNCHANGED; - } - - /* Use a tmpfile and copy the old streams contents into it */ - - if (flags & PHP_STREAM_PREFER_STDIO) - *newstream = php_stream_fopen_tmpfile(); - else - *newstream = php_stream_temp_new(); - - if (*newstream == NULL) - return PHP_STREAM_FAILED; - - if (php_stream_copy_to_stream(origstream, *newstream, PHP_STREAM_COPY_ALL) == 0) { - php_stream_close(*newstream); - *newstream = NULL; - return PHP_STREAM_CRITICAL; - } - - php_stream_close(origstream); - php_stream_seek(*newstream, 0, SEEK_SET); - - return PHP_STREAM_RELEASED; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/filter.c b/main/streams/filter.c deleted file mode 100644 index ae3605ccdbb7d..0000000000000 --- a/main/streams/filter.c +++ /dev/null @@ -1,524 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_network.h" -#include "php_open_temporary_file.h" -#include "ext/standard/file.h" -#include -#include - -#include "php_streams_int.h" - -/* Global filter hash, copied to FG(stream_filters) on registration of volatile filter */ -static HashTable stream_filters_hash; - -/* Should only be used during core initialization */ -PHPAPI HashTable *php_get_stream_filters_hash_global(void) -{ - return &stream_filters_hash; -} - -/* Normal hash selection/retrieval call */ -PHPAPI HashTable *_php_get_stream_filters_hash(TSRMLS_D) -{ - return (FG(stream_filters) ? FG(stream_filters) : &stream_filters_hash); -} - -/* API for registering GLOBAL filters */ -PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC) -{ - return zend_hash_add(&stream_filters_hash, (char*)filterpattern, strlen(filterpattern) + 1, factory, sizeof(*factory), NULL); -} - -PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern TSRMLS_DC) -{ - return zend_hash_del(&stream_filters_hash, (char*)filterpattern, strlen(filterpattern) + 1); -} - -/* API for registering VOLATILE wrappers */ -PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC) -{ - if (!FG(stream_filters)) { - php_stream_filter_factory tmpfactory; - - ALLOC_HASHTABLE(FG(stream_filters)); - zend_hash_init(FG(stream_filters), zend_hash_num_elements(&stream_filters_hash), NULL, NULL, 1); - zend_hash_copy(FG(stream_filters), &stream_filters_hash, NULL, &tmpfactory, sizeof(php_stream_filter_factory)); - } - - return zend_hash_add(FG(stream_filters), (char*)filterpattern, strlen(filterpattern) + 1, factory, sizeof(*factory), NULL); -} - -/* Buckets */ - -PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent TSRMLS_DC) -{ - int is_persistent = php_stream_is_persistent(stream); - php_stream_bucket *bucket; - - bucket = (php_stream_bucket*)pemalloc(sizeof(php_stream_bucket), is_persistent); - - if (bucket == NULL) { - return NULL; - } - - bucket->next = bucket->prev = NULL; - - if (is_persistent && !buf_persistent) { - /* all data in a persistent bucket must also be persistent */ - bucket->buf = pemalloc(buflen, 1); - - if (bucket->buf == NULL) { - pefree(bucket, 1); - return NULL; - } - - memcpy(bucket->buf, buf, buflen); - bucket->buflen = buflen; - bucket->own_buf = 1; - } else { - bucket->buf = buf; - bucket->buflen = buflen; - bucket->own_buf = own_buf; - } - bucket->is_persistent = is_persistent; - bucket->refcount = 1; - bucket->brigade = NULL; - - return bucket; -} - -/* Given a bucket, returns a version of that bucket with a writeable buffer. - * If the original bucket has a refcount of 1 and owns its buffer, then it - * is returned unchanged. - * Otherwise, a copy of the buffer is made. - * In both cases, the original bucket is unlinked from its brigade. - * If a copy is made, the original bucket is delref'd. - * */ -PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket TSRMLS_DC) -{ - php_stream_bucket *retval; - - php_stream_bucket_unlink(bucket TSRMLS_CC); - - if (bucket->refcount == 1 && bucket->own_buf) { - return bucket; - } - - retval = (php_stream_bucket*)pemalloc(sizeof(php_stream_bucket), bucket->is_persistent); - memcpy(retval, bucket, sizeof(*retval)); - - retval->buf = pemalloc(retval->buflen, retval->is_persistent); - memcpy(retval->buf, bucket->buf, retval->buflen); - - retval->refcount = 1; - retval->own_buf = 1; - - php_stream_bucket_delref(bucket TSRMLS_CC); - - return retval; -} - -PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length TSRMLS_DC) -{ - *left = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent); - *right = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent); - - if (*left == NULL || *right == NULL) { - goto exit_fail; - } - - (*left)->buf = pemalloc(length, in->is_persistent); - (*left)->buflen = length; - memcpy((*left)->buf, in->buf, length); - (*left)->refcount = 1; - (*left)->own_buf = 1; - (*left)->is_persistent = in->is_persistent; - - (*right)->buflen = in->buflen - length; - (*right)->buf = pemalloc((*right)->buflen, in->is_persistent); - memcpy((*right)->buf, in->buf + length, (*right)->buflen); - (*right)->refcount = 1; - (*right)->own_buf = 1; - (*right)->is_persistent = in->is_persistent; - - return SUCCESS; - -exit_fail: - if (*right) { - if ((*right)->buf) { - pefree((*right)->buf, in->is_persistent); - } - pefree(*right, in->is_persistent); - } - if (*left) { - if ((*left)->buf) { - pefree((*left)->buf, in->is_persistent); - } - pefree(*left, in->is_persistent); - } - return FAILURE; -} - -PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC) -{ - if (--bucket->refcount == 0) { - if (bucket->own_buf) { - pefree(bucket->buf, bucket->is_persistent); - } - pefree(bucket, bucket->is_persistent); - } -} - -PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC) -{ - bucket->next = brigade->head; - bucket->prev = NULL; - - if (brigade->head) { - brigade->head->prev = bucket; - } else { - brigade->tail = bucket; - } - brigade->head = bucket; - bucket->brigade = brigade; -} - -PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC) -{ - if (brigade->tail == bucket) { - return; - } - - bucket->prev = brigade->tail; - bucket->next = NULL; - - if (brigade->tail) { - brigade->tail->next = bucket; - } else { - brigade->head = bucket; - } - brigade->tail = bucket; - bucket->brigade = brigade; -} - -PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC) -{ - if (bucket->prev) { - bucket->prev->next = bucket->next; - } else if (bucket->brigade) { - bucket->brigade->head = bucket->next; - } - if (bucket->next) { - bucket->next->prev = bucket->prev; - } else if (bucket->brigade) { - bucket->brigade->tail = bucket->prev; - } - bucket->brigade = NULL; - bucket->next = bucket->prev = NULL; -} - - - - - - - - -/* We allow very simple pattern matching for filter factories: - * if "convert.charset.utf-8/sjis" is requested, we search first for an exact - * match. If that fails, we try "convert.charset.*", then "convert.*" - * This means that we don't need to clog up the hashtable with a zillion - * charsets (for example) but still be able to provide them all as filters */ -PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) -{ - HashTable *filter_hash = (FG(stream_filters) ? FG(stream_filters) : &stream_filters_hash); - php_stream_filter_factory *factory = NULL; - php_stream_filter *filter = NULL; - int n; - char *period; - - n = strlen(filtername); - - if (SUCCESS == zend_hash_find(filter_hash, (char*)filtername, n + 1, (void**)&factory)) { - filter = factory->create_filter(filtername, filterparams, persistent TSRMLS_CC); - } else if ((period = strrchr(filtername, '.'))) { - /* try a wildcard */ - char *wildname; - - wildname = emalloc(n+3); - memcpy(wildname, filtername, n+1); - period = wildname + (period - filtername); - while (period && !filter) { - *period = '\0'; - strcat(wildname, ".*"); - if (SUCCESS == zend_hash_find(filter_hash, wildname, strlen(wildname) + 1, (void**)&factory)) { - filter = factory->create_filter(filtername, filterparams, persistent TSRMLS_CC); - } - - *period = '\0'; - period = strrchr(wildname, '.'); - } - efree(wildname); - } - - if (filter == NULL) { - /* TODO: these need correct docrefs */ - if (factory == NULL) - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to locate filter \"%s\"", filtername); - else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create or locate filter \"%s\"", filtername); - } - - return filter; -} - -PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC TSRMLS_DC) -{ - php_stream_filter *filter; - - filter = (php_stream_filter*) pemalloc_rel_orig(sizeof(php_stream_filter), persistent); - memset(filter, 0, sizeof(php_stream_filter)); - - filter->fops = fops; - filter->abstract = abstract; - filter->is_persistent = persistent; - - return filter; -} - -PHPAPI void php_stream_filter_free(php_stream_filter *filter TSRMLS_DC) -{ - if (filter->fops->dtor) - filter->fops->dtor(filter TSRMLS_CC); - pefree(filter, filter->is_persistent); -} - -PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC) -{ - filter->next = chain->head; - filter->prev = NULL; - - if (chain->head) { - chain->head->prev = filter; - } else { - chain->tail = filter; - } - chain->head = filter; - filter->chain = chain; -} - -PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC) -{ - php_stream *stream = chain->stream; - - filter->prev = chain->tail; - filter->next = NULL; - if (chain->tail) { - chain->tail->next = filter; - } else { - chain->head = filter; - } - chain->tail = filter; - filter->chain = chain; - - if (&(stream->readfilters) == chain && (stream->writepos - stream->readpos) > 0) { - /* Let's going ahead and wind anything in the buffer through this filter */ - php_stream_bucket_brigade brig_in = { NULL, NULL }, brig_out = { NULL, NULL }; - php_stream_bucket_brigade *brig_inp = &brig_in, *brig_outp = &brig_out; - php_stream_filter_status_t status; - php_stream_bucket *bucket; - size_t consumed = 0; - - bucket = php_stream_bucket_new(stream, stream->readbuf + stream->readpos, stream->writepos - stream->readpos, 0, 0 TSRMLS_CC); - php_stream_bucket_append(brig_inp, bucket TSRMLS_CC); - status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL TSRMLS_CC); - - if (stream->readpos + consumed > (uint)stream->writepos || consumed < 0) { - /* No behaving filter should cause this. */ - status = PSFS_ERR_FATAL; - } - - switch (status) { - case PSFS_ERR_FATAL: - /* If this first cycle simply fails then there's something wrong with the filter. - Pull the filter off the chain and leave the read buffer alone. */ - if (chain->head == filter) { - chain->head = NULL; - chain->tail = NULL; - } else { - filter->prev->next = NULL; - chain->tail = filter->prev; - } - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter failed to process pre-buffered data. Not adding to filterchain."); - break; - case PSFS_FEED_ME: - /* We don't actually need data yet, - leave this filter in a feed me state until data is needed. - Reset stream's internal read buffer since the filter is "holding" it. */ - stream->readpos = 0; - stream->writepos = 0; - break; - case PSFS_PASS_ON: - /* If any data is consumed, we cannot rely upon the existing read buffer, - as the filtered data must replace the existing data, so invalidate the cache */ - /* note that changes here should be reflected in - main/streams/streams.c::php_stream_fill_read_buffer */ - stream->writepos = 0; - stream->readpos = 0; - - while (brig_outp->head) { - bucket = brig_outp->head; - /* Grow buffer to hold this bucket if need be. - TODO: See warning in main/stream/streams.c::php_stream_fill_read_buffer */ - if (stream->readbuflen - stream->writepos < bucket->buflen) { - stream->readbuflen += bucket->buflen; - stream->readbuf = perealloc(stream->readbuf, stream->readbuflen, stream->is_persistent); - } - memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen); - stream->writepos += bucket->buflen; - - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - break; - } - } - -} - -PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS_DC) -{ - php_stream_bucket_brigade brig_a = { NULL, NULL }, brig_b = { NULL, NULL }, *inp = &brig_a, *outp = &brig_b, *brig_temp; - php_stream_bucket *bucket; - php_stream_filter_chain *chain; - php_stream_filter *current; - php_stream *stream; - size_t flushed_size = 0; - long flags = (finish ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC); - - if (!filter->chain || !filter->chain->stream) { - /* Filter is not attached to a chain, or chain is somehow not part of a stream */ - return FAILURE; - } - - chain = filter->chain; - stream = chain->stream; - - for(current = filter; current; current = current->next) { - php_stream_filter_status_t status; - - status = filter->fops->filter(stream, filter, inp, outp, NULL, flags TSRMLS_CC); - if (status == PSFS_FEED_ME) { - /* We've flushed the data far enough */ - return SUCCESS; - } - if (status == PSFS_ERR_FATAL) { - return FAILURE; - } - /* Otherwise we have data available to PASS_ON - Swap the brigades and continue */ - brig_temp = inp; - inp = outp; - outp = brig_temp; - outp->head = NULL; - outp->tail = NULL; - - flags = PSFS_FLAG_NORMAL; - } - - /* Last filter returned data via PSFS_PASS_ON - Do something with it */ - - for(bucket = inp->head; bucket; bucket = bucket->next) { - flushed_size += bucket->buflen; - } - - if (flushed_size == 0) { - /* Unlikely, but possible */ - return SUCCESS; - } - - if (chain == &(stream->readfilters)) { - /* Dump any newly flushed data to the read buffer */ - if (stream->readpos > 0) { - /* Back the buffer up */ - memcpy(stream->readbuf, stream->readbuf + stream->readpos, stream->writepos - stream->readpos); - stream->readpos = 0; - stream->writepos -= stream->readpos; - } - if (flushed_size > (stream->readbuflen - stream->writepos)) { - /* Grow the buffer */ - stream->readbuf = perealloc(stream->readbuf, stream->writepos + flushed_size + stream->chunk_size, stream->is_persistent); - } - while ((bucket = inp->head)) { - memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen); - stream->writepos += bucket->buflen; - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - } else if (chain == &(stream->writefilters)) { - /* Send flushed data to the stream */ - while ((bucket = inp->head)) { - stream->ops->write(stream, bucket->buf, bucket->buflen TSRMLS_CC); - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - } - - return SUCCESS; -} - -PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor TSRMLS_DC) -{ - if (filter->prev) { - filter->prev->next = filter->next; - } else { - filter->chain->head = filter->next; - } - if (filter->next) { - filter->next->prev = filter->prev; - } else { - filter->chain->tail = filter->prev; - } - - if (filter->rsrc_id > 0) { - zend_list_delete(filter->rsrc_id); - } - - if (call_dtor) { - php_stream_filter_free(filter TSRMLS_CC); - return NULL; - } - return filter; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/memory.c b/main/streams/memory.c deleted file mode 100644 index 442c6b08b8dd6..0000000000000 --- a/main/streams/memory.c +++ /dev/null @@ -1,761 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define _GNU_SOURCE -#include "php.h" - -PHPAPI int php_url_decode(char *str, int len); -PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, int *ret_length); - -/* Memory streams use a dynamic memory buffer to emulate a stream. - * You can use php_stream_memory_open to create a readonly stream - * from an existing memory buffer. - */ - -/* Temp streams are streams that uses memory streams as long their - * size is less than a given memory amount. When a write operation - * exceeds that limit the content is written to a temporary file. - */ - -/* {{{ ------- MEMORY stream implementation -------*/ - -typedef struct { - char *data; - size_t fpos; - size_t fsize; - size_t smax; - int mode; - php_stream **owner_ptr; -} php_stream_memory_data; - - -/* {{{ */ -static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; - assert(ms != NULL); - - if (ms->mode & TEMP_STREAM_READONLY) { - return 0; - } - if (ms->fpos + count > ms->fsize) { - char *tmp; - - if (!ms->data) { - tmp = emalloc(ms->fpos + count); - } else { - tmp = erealloc(ms->data, ms->fpos + count); - } - if (!tmp) { - count = ms->fsize - ms->fpos + 1; - } else { - ms->data = tmp; - ms->fsize = ms->fpos + count; - } - } - if (!ms->data) - count = 0; - if (count) { - assert(buf!= NULL); - memcpy(ms->data+ms->fpos, (char*)buf, count); - ms->fpos += count; - } - return count; -} -/* }}} */ - - -/* {{{ */ -static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; - assert(ms != NULL); - - if (ms->fpos + count >= ms->fsize) { - count = ms->fsize - ms->fpos; - stream->eof = 1; - } - if (count) { - assert(ms->data!= NULL); - assert(buf!= NULL); - memcpy(buf, ms->data+ms->fpos, count); - ms->fpos += count; - } - return count; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_memory_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; - assert(ms != NULL); - - if (ms->data && close_handle && ms->mode != TEMP_STREAM_READONLY) { - efree(ms->data); - } - if (ms->owner_ptr) { - *ms->owner_ptr = NULL; - } - efree(ms); - return 0; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_memory_flush(php_stream *stream TSRMLS_DC) -{ - /* nothing to do here */ - return 0; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; - assert(ms != NULL); - - switch(whence) { - case SEEK_CUR: - if (offset < 0) { - if (ms->fpos < (size_t)(-offset)) { - ms->fpos = 0; - *newoffs = -1; - return -1; - } else { - ms->fpos = ms->fpos + offset; - *newoffs = ms->fpos; - stream->eof = 0; - return 0; - } - } else { - if (ms->fpos + (size_t)(offset) > ms->fsize) { - ms->fpos = ms->fsize; - *newoffs = -1; - return -1; - } else { - ms->fpos = ms->fpos + offset; - *newoffs = ms->fpos; - stream->eof = 0; - return 0; - } - } - case SEEK_SET: - if (ms->fsize < (size_t)(offset)) { - ms->fpos = ms->fsize; - *newoffs = -1; - return -1; - } else { - ms->fpos = offset; - *newoffs = ms->fpos; - stream->eof = 0; - return 0; - } - case SEEK_END: - if (offset > 0) { - ms->fpos = ms->fsize; - *newoffs = -1; - return -1; - } else if (ms->fsize < (size_t)(-offset)) { - ms->fpos = 0; - *newoffs = -1; - return -1; - } else { - ms->fpos = ms->fsize + offset; - *newoffs = ms->fpos; - stream->eof = 0; - return 0; - } - default: - *newoffs = ms->fpos; - return -1; - } -} -/* }}} */ - -/* {{{ */ -static int php_stream_memory_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - return FAILURE; -} -/* }}} */ - -static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */ -{ - time_t timestamp = 0; - php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; - assert(ms != NULL); - - memset(ssb, 0, sizeof(php_stream_statbuf)); - /* read-only across the board */ - - ssb->sb.st_mode = ms->mode & TEMP_STREAM_READONLY ? 0444 : 0666; - - ssb->sb.st_size = ms->fsize; - ssb->sb.st_mode |= S_IFREG; /* regular file */ - -#ifdef NETWARE - ssb->sb.st_mtime.tv_sec = timestamp; - ssb->sb.st_atime.tv_sec = timestamp; - ssb->sb.st_ctime.tv_sec = timestamp; -#else - ssb->sb.st_mtime = timestamp; - ssb->sb.st_atime = timestamp; - ssb->sb.st_ctime = timestamp; -#endif - - ssb->sb.st_nlink = 1; - ssb->sb.st_rdev = -1; - /* this is only for APC, so use /dev/null device - no chance of conflict there! */ - ssb->sb.st_dev = 0xC; - /* generate unique inode number for alias/filename, so no phars will conflict */ - ssb->sb.st_ino = 0; - -#ifndef PHP_WIN32 - ssb->sb.st_blksize = -1; -#endif - -#if !defined(PHP_WIN32) && !defined(__BEOS__) - ssb->sb.st_blocks = -1; -#endif - - return 0; -} -/* }}} */ - -static int php_stream_memory_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */ -{ - php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; - size_t newsize; - - switch(option) { - case PHP_STREAM_OPTION_TRUNCATE_API: - switch (value) { - case PHP_STREAM_TRUNCATE_SUPPORTED: - return PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_TRUNCATE_SET_SIZE: - if (ms->mode & TEMP_STREAM_READONLY) { - return PHP_STREAM_OPTION_RETURN_ERR; - } - newsize = *(size_t*)ptrparam; - if (newsize <= ms->fsize) { - if (newsize < ms->fpos) { - ms->fpos = newsize; - } - } else { - ms->data = erealloc(ms->data, newsize); - memset(ms->data+ms->fsize, 0, newsize - ms->fsize); - ms->fsize = newsize; - } - ms->fsize = newsize; - return PHP_STREAM_OPTION_RETURN_OK; - } - default: - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - } -} -/* }}} */ - -PHPAPI php_stream_ops php_stream_memory_ops = { - php_stream_memory_write, php_stream_memory_read, - php_stream_memory_close, php_stream_memory_flush, - "MEMORY", - php_stream_memory_seek, - php_stream_memory_cast, - php_stream_memory_stat, - php_stream_memory_set_option -}; - - -/* {{{ */ -PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC) -{ - php_stream_memory_data *self; - php_stream *stream; - - self = emalloc(sizeof(*self)); - self->data = NULL; - self->fpos = 0; - self->fsize = 0; - self->smax = ~0u; - self->mode = mode; - self->owner_ptr = NULL; - - stream = php_stream_alloc_rel(&php_stream_memory_ops, self, 0, mode & TEMP_STREAM_READONLY ? "rb" : "w+b"); - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - return stream; -} -/* }}} */ - - -/* {{{ */ -PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC) -{ - php_stream *stream; - php_stream_memory_data *ms; - - if ((stream = php_stream_memory_create_rel(mode)) != NULL) { - ms = (php_stream_memory_data*)stream->abstract; - - if (mode == TEMP_STREAM_READONLY || mode == TEMP_STREAM_TAKE_BUFFER) { - /* use the buffer directly */ - ms->data = buf; - ms->fsize = length; - } else { - if (length) { - assert(buf != NULL); - php_stream_write(stream, buf, length); - } - } - } - return stream; -} -/* }}} */ - - -/* {{{ */ -PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC) -{ - php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; - - assert(ms != NULL); - assert(length != 0); - - *length = ms->fsize; - return ms->data; -} -/* }}} */ - -/* }}} */ - -/* {{{ ------- TEMP stream implementation -------*/ - -typedef struct { - php_stream *innerstream; - size_t smax; - int mode; - zval* meta; -} php_stream_temp_data; - - -/* {{{ */ -static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; - assert(ts != NULL); - - if (!ts->innerstream) { - return -1; - } - if (php_stream_is(ts->innerstream, PHP_STREAM_IS_MEMORY)) { - size_t memsize; - char *membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize); - - if (memsize + count >= ts->smax) { - php_stream *file = php_stream_fopen_tmpfile(); - php_stream_write(file, membuf, memsize); - php_stream_close(ts->innerstream); - ts->innerstream = file; - } - } - return php_stream_write(ts->innerstream, buf, count); -} -/* }}} */ - - -/* {{{ */ -static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; - size_t got; - - assert(ts != NULL); - - if (!ts->innerstream) { - return -1; - } - - got = php_stream_read(ts->innerstream, buf, count); - - stream->eof = ts->innerstream->eof; - - return got; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_temp_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; - int ret; - - assert(ts != NULL); - - if (ts->innerstream) { - ret = php_stream_free(ts->innerstream, PHP_STREAM_FREE_CLOSE | (close_handle ? 0 : PHP_STREAM_FREE_PRESERVE_HANDLE)); - } else { - ret = 0; - } - - if (ts->meta) { - zval_ptr_dtor(&ts->meta); - } - - efree(ts); - - return ret; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_temp_flush(php_stream *stream TSRMLS_DC) -{ - php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; - assert(ts != NULL); - - return ts->innerstream ? php_stream_flush(ts->innerstream) : -1; -} -/* }}} */ - - -/* {{{ */ -static int php_stream_temp_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; - int ret; - - assert(ts != NULL); - - if (!ts->innerstream) { - *newoffs = -1; - return -1; - } - ret = php_stream_seek(ts->innerstream, offset, whence); - *newoffs = php_stream_tell(ts->innerstream); - stream->eof = ts->innerstream->eof; - - return ret; -} -/* }}} */ - -/* {{{ */ -static int php_stream_temp_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; - php_stream *file; - size_t memsize; - char *membuf; - off_t pos; - - assert(ts != NULL); - - if (!ts->innerstream) { - return FAILURE; - } - if (php_stream_is(ts->innerstream, PHP_STREAM_IS_STDIO)) { - return php_stream_cast(ts->innerstream, castas, ret, 0); - } - - /* we are still using a memory based backing. If they are if we can be - * a FILE*, say yes because we can perform the conversion. - * If they actually want to perform the conversion, we need to switch - * the memory stream to a tmpfile stream */ - - if (ret == NULL && castas == PHP_STREAM_AS_STDIO) { - return SUCCESS; - } - - /* say "no" to other stream forms */ - if (ret == NULL) { - return FAILURE; - } - - /* perform the conversion and then pass the request on to the innerstream */ - membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize); - file = php_stream_fopen_tmpfile(); - php_stream_write(file, membuf, memsize); - pos = php_stream_tell(ts->innerstream); - - php_stream_close(ts->innerstream); - ts->innerstream = file; - php_stream_seek(ts->innerstream, pos, SEEK_SET); - - return php_stream_cast(ts->innerstream, castas, ret, 1); -} -/* }}} */ - -static int php_stream_temp_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */ -{ - php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; - - if (!ts || !ts->innerstream) { - return -1; - } - return php_stream_stat(ts->innerstream, ssb); -} -/* }}} */ - -static int php_stream_temp_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */ -{ - php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; - - switch(option) { - case PHP_STREAM_OPTION_META_DATA_API: - if (ts->meta) { - zend_hash_copy(Z_ARRVAL_P((zval*)ptrparam), Z_ARRVAL_P(ts->meta), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*)); - } - return PHP_STREAM_OPTION_RETURN_OK; - default: - if (ts->innerstream) { - return php_stream_set_option(ts->innerstream, option, value, ptrparam); - } - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - } -} -/* }}} */ - -PHPAPI php_stream_ops php_stream_temp_ops = { - php_stream_temp_write, php_stream_temp_read, - php_stream_temp_close, php_stream_temp_flush, - "TEMP", - php_stream_temp_seek, - php_stream_temp_cast, - php_stream_temp_stat, - php_stream_temp_set_option -}; - -/* }}} */ - -/* {{{ _php_stream_temp_create */ -PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC) -{ - php_stream_temp_data *self; - php_stream *stream; - - self = ecalloc(1, sizeof(*self)); - self->smax = max_memory_usage; - self->mode = mode; - self->meta = NULL; - stream = php_stream_alloc_rel(&php_stream_temp_ops, self, 0, mode & TEMP_STREAM_READONLY ? "rb" : "w+b"); - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - self->innerstream = php_stream_memory_create_rel(mode); - ((php_stream_memory_data*)self->innerstream->abstract)->owner_ptr = &self->innerstream; - - return stream; -} -/* }}} */ - - -/* {{{ _php_stream_temp_open */ -PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC) -{ - php_stream *stream; - php_stream_temp_data *ts; - off_t newoffs; - - if ((stream = php_stream_temp_create_rel(mode, max_memory_usage)) != NULL) { - if (length) { - assert(buf != NULL); - php_stream_temp_write(stream, buf, length TSRMLS_CC); - php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC); - } - ts = (php_stream_temp_data*)stream->abstract; - assert(ts != NULL); - ts->mode = mode; - } - return stream; -} -/* }}} */ - -PHPAPI php_stream_ops php_stream_rfc2397_ops = { - php_stream_temp_write, php_stream_temp_read, - php_stream_temp_close, php_stream_temp_flush, - "RFC2397", - php_stream_temp_seek, - php_stream_temp_cast, - php_stream_temp_stat, - php_stream_temp_set_option -}; - -static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ -{ - php_stream *stream; - php_stream_temp_data *ts; - char *comma, *semi, *sep, *key; - size_t mlen, dlen, plen, vlen; - off_t newoffs; - zval *meta = NULL; - int base64 = 0, ilen; - - if (memcmp(path, "data:", 5)) { - return NULL; - } - - path += 5; - dlen = strlen(path); - - if (dlen >= 2 && path[0] == '/' && path[1] == '/') { - dlen -= 2; - path += 2; - } - - if ((comma = memchr(path, ',', dlen)) == NULL) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: no comma in URL"); - return NULL; - } - - if (comma != path) { - /* meta info */ - mlen = comma - path; - dlen -= mlen; - semi = memchr(path, ';', mlen); - sep = memchr(path, '/', mlen); - - if (!semi && !sep) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal media type"); - return NULL; - } - - MAKE_STD_ZVAL(meta); - array_init(meta); - if (!semi) { /* there is only a mime type */ - add_assoc_stringl(meta, "mediatype", path, mlen, 1); - mlen = 0; - } else if (sep && sep < semi) { /* there is a mime type */ - plen = semi - path; - add_assoc_stringl(meta, "mediatype", path, plen, 1); - mlen -= plen; - path += plen; - } else if (semi != path || mlen != sizeof(";base64")-1 || memcmp(path, ";base64", sizeof(";base64")-1)) { /* must be error since parameters are only allowed after mediatype */ - zval_ptr_dtor(&meta); - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal media type"); - return NULL; - } - /* get parameters and potentially ';base64' */ - while(semi && (semi == path)) { - path++; - mlen--; - sep = memchr(path, '=', mlen); - semi = memchr(path, ';', mlen); - if (!sep || (semi && semi < sep)) { /* must be ';base64' or failure */ - if (mlen != sizeof("base64")-1 || memcmp(path, "base64", sizeof("base64")-1)) { - /* must be error since parameters are only allowed after mediatype and we have no '=' sign */ - zval_ptr_dtor(&meta); - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal parameter"); - return NULL; - } - base64 = 1; - mlen -= sizeof("base64") - 1; - path += sizeof("base64") - 1; - break; - } - /* found parameter ... the heart of cs ppl lies in +1/-1 or was it +2 this time? */ - plen = sep - path; - vlen = (semi ? semi - sep : mlen - plen) - 1 /* '=' */; - key = estrndup(path, plen); - add_assoc_stringl_ex(meta, key, plen + 1, sep + 1, vlen, 1); - efree(key); - plen += vlen + 1; - mlen -= plen; - path += plen; - } - if (mlen) { - zval_ptr_dtor(&meta); - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal URL"); - return NULL; - } - } else { - MAKE_STD_ZVAL(meta); - array_init(meta); - } - add_assoc_bool(meta, "base64", base64); - - /* skip ',' */ - comma++; - dlen--; - - if (base64) { - comma = (char*)php_base64_decode((const unsigned char *)comma, dlen, &ilen); - if (!comma) { - zval_ptr_dtor(&meta); - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: unable to decode"); - return NULL; - } - } else { - comma = estrndup(comma, dlen); - ilen = dlen = php_url_decode(comma, dlen); - } - - if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) { - /* store data */ - php_stream_temp_write(stream, comma, ilen TSRMLS_CC); - php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC); - /* set special stream stuff (enforce exact mode) */ - vlen = strlen(mode); - if (vlen >= sizeof(stream->mode)) { - vlen = sizeof(stream->mode) - 1; - } - memcpy(stream->mode, mode, vlen); - stream->mode[vlen] = '\0'; - stream->ops = &php_stream_rfc2397_ops; - ts = (php_stream_temp_data*)stream->abstract; - assert(ts != NULL); - ts->mode = mode && mode[0] == 'r' && mode[1] != '+' ? TEMP_STREAM_READONLY : 0; - ts->meta = meta; - } - efree(comma); - - return stream; -} - -PHPAPI php_stream_wrapper_ops php_stream_rfc2397_wops = { - php_stream_url_wrap_rfc2397, - NULL, /* close */ - NULL, /* fstat */ - NULL, /* stat */ - NULL, /* opendir */ - "RFC2397", - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -PHPAPI php_stream_wrapper php_stream_rfc2397_wrapper = { - &php_stream_rfc2397_wops, - NULL, - 1, /* is_url */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/mmap.c b/main/streams/mmap.c deleted file mode 100644 index 2dae36f97748e..0000000000000 --- a/main/streams/mmap.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* Memory Mapping interface for streams */ -#include "php.h" -#include "php_streams_int.h" - -PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len TSRMLS_DC) -{ - php_stream_mmap_range range; - - range.offset = offset; - range.length = length; - range.mode = mode; - range.mapped = NULL; - - /* For now, we impose an arbitrary 2MB limit to avoid - * runaway swapping when large files are passed thru. */ - if (length > 2 * 1024 * 1024) { - return NULL; - } - - if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_MAP_RANGE, &range)) { - if (mapped_len) { - *mapped_len = range.length; - } - return range.mapped; - } - return NULL; -} - -PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC) -{ - return php_stream_set_option(stream, PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_UNMAP, NULL) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h deleted file mode 100644 index c7d3f9d492da9..0000000000000 --- a/main/streams/php_stream_context.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* Stream context and status notification related definitions */ - -/* callback for status notifications */ -typedef void (*php_stream_notification_func)(php_stream_context *context, - int notifycode, int severity, - char *xmsg, int xcode, - size_t bytes_sofar, size_t bytes_max, - void * ptr TSRMLS_DC); - -#define PHP_STREAM_NOTIFIER_PROGRESS 1 - -/* Attempt to fetch context from the zval passed, - If no context was passed, use the default context - The the default context has not yet been created, do it now. */ -#define php_stream_context_from_zval(zcontext, nocontext) ( \ - (zcontext) ? zend_fetch_resource(&(zcontext) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context()) : \ - (nocontext) ? NULL : \ - FG(default_context) ? FG(default_context) : \ - (FG(default_context) = php_stream_context_alloc()) ) - -#define php_stream_context_to_zval(context, zval) { ZVAL_RESOURCE(zval, (context)->rsrc_id); zend_list_addref((context)->rsrc_id); } - -typedef struct _php_stream_notifier php_stream_notifier; - -struct _php_stream_notifier { - php_stream_notification_func func; - void (*dtor)(php_stream_notifier *notifier); - void *ptr; - int mask; - size_t progress, progress_max; /* position for progress notification */ -}; - -struct _php_stream_context { - php_stream_notifier *notifier; - zval *options; /* hash keyed by wrapper family or specific wrapper */ - zval *links; /* hash keyed by hostent for connection pooling */ - int rsrc_id; /* used for auto-cleanup */ -}; - -BEGIN_EXTERN_C() -PHPAPI void php_stream_context_free(php_stream_context *context); -PHPAPI php_stream_context *php_stream_context_alloc(void); -PHPAPI int php_stream_context_get_option(php_stream_context *context, - const char *wrappername, const char *optionname, zval ***optionvalue); -PHPAPI int php_stream_context_set_option(php_stream_context *context, - const char *wrappername, const char *optionname, zval *optionvalue); - -PHPAPI int php_stream_context_get_link(php_stream_context *context, - const char *hostent, php_stream **stream); -PHPAPI int php_stream_context_set_link(php_stream_context *context, - const char *hostent, php_stream *stream); -PHPAPI int php_stream_context_del_link(php_stream_context *context, - php_stream *stream); - -PHPAPI php_stream_notifier *php_stream_notification_alloc(void); -PHPAPI void php_stream_notification_free(php_stream_notifier *notifier); -END_EXTERN_C() - -/* not all notification codes are implemented */ -#define PHP_STREAM_NOTIFY_RESOLVE 1 -#define PHP_STREAM_NOTIFY_CONNECT 2 -#define PHP_STREAM_NOTIFY_AUTH_REQUIRED 3 -#define PHP_STREAM_NOTIFY_MIME_TYPE_IS 4 -#define PHP_STREAM_NOTIFY_FILE_SIZE_IS 5 -#define PHP_STREAM_NOTIFY_REDIRECTED 6 -#define PHP_STREAM_NOTIFY_PROGRESS 7 -#define PHP_STREAM_NOTIFY_COMPLETED 8 -#define PHP_STREAM_NOTIFY_FAILURE 9 -#define PHP_STREAM_NOTIFY_AUTH_RESULT 10 - -#define PHP_STREAM_NOTIFY_SEVERITY_INFO 0 -#define PHP_STREAM_NOTIFY_SEVERITY_WARN 1 -#define PHP_STREAM_NOTIFY_SEVERITY_ERR 2 - -BEGIN_EXTERN_C() -PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, - char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC); -PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context); -END_EXTERN_C() - -#define php_stream_notify_info(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) { \ - php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_INFO, \ - (xmsg), (xcode), 0, 0, NULL TSRMLS_CC); } } while (0) - -#define php_stream_notify_progress(context, bsofar, bmax) do { if ((context) && (context)->notifier) { \ - php_stream_notification_notify((context), PHP_STREAM_NOTIFY_PROGRESS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \ - NULL, 0, (bsofar), (bmax), NULL TSRMLS_CC); } } while(0) - -#define php_stream_notify_progress_init(context, sofar, bmax) do { if ((context) && (context)->notifier) { \ - (context)->notifier->progress = (sofar); \ - (context)->notifier->progress_max = (bmax); \ - (context)->notifier->mask |= PHP_STREAM_NOTIFIER_PROGRESS; \ - php_stream_notify_progress((context), (sofar), (bmax)); } } while (0) - -#define php_stream_notify_progress_increment(context, dsofar, dmax) do { if ((context) && (context)->notifier && (context)->notifier->mask & PHP_STREAM_NOTIFIER_PROGRESS) { \ - (context)->notifier->progress += (dsofar); \ - (context)->notifier->progress_max += (dmax); \ - php_stream_notify_progress((context), (context)->notifier->progress, (context)->notifier->progress_max); } } while (0) - -#define php_stream_notify_file_size(context, file_size, xmsg, xcode) do { if ((context) && (context)->notifier) { \ - php_stream_notification_notify((context), PHP_STREAM_NOTIFY_FILE_SIZE_IS, PHP_STREAM_NOTIFY_SEVERITY_INFO, \ - (xmsg), (xcode), 0, (file_size), NULL TSRMLS_CC); } } while(0) - -#define php_stream_notify_error(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) {\ - php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_ERR, \ - (xmsg), (xcode), 0, 0, NULL TSRMLS_CC); } } while(0) - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h deleted file mode 100644 index 91993a62afe4f..0000000000000 --- a/main/streams/php_stream_filter_api.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - | With suggestions from: | - | Moriyoshi Koizumi | - | Sara Golemon | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* The filter API works on the principle of "Bucket-Brigades". This is - * partially inspired by the Apache 2 method of doing things, although - * it is intentially a light-weight implementation. - * - * Each stream can have a chain of filters for reading and another for writing. - * - * When data is written to the stream, is is placed into a bucket and placed at - * the start of the input brigade. - * - * The first filter in the chain is invoked on the brigade and (depending on - * it's return value), the next filter is invoked and so on. - * */ - -#define PHP_STREAM_FILTER_READ 0x0001 -#define PHP_STREAM_FILTER_WRITE 0x0002 -#define PHP_STREAM_FILTER_ALL (PHP_STREAM_FILTER_READ | PHP_STREAM_FILTER_WRITE) - -typedef struct _php_stream_bucket php_stream_bucket; -typedef struct _php_stream_bucket_brigade php_stream_bucket_brigade; - -struct _php_stream_bucket { - php_stream_bucket *next, *prev; - php_stream_bucket_brigade *brigade; - - char *buf; - size_t buflen; - /* if non-zero, buf should be pefreed when the bucket is destroyed */ - int own_buf; - int is_persistent; - - /* destroy this struct when refcount falls to zero */ - int refcount; -}; - -struct _php_stream_bucket_brigade { - php_stream_bucket *head, *tail; -}; - -typedef enum { - PSFS_ERR_FATAL, /* error in data stream */ - PSFS_FEED_ME, /* filter needs more data; stop processing chain until more is available */ - PSFS_PASS_ON /* filter generated output buckets; pass them on to next in chain */ -} php_stream_filter_status_t; - -/* Buckets API. */ -BEGIN_EXTERN_C() -PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent TSRMLS_DC); -PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length TSRMLS_DC); -PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC); -#define php_stream_bucket_addref(bucket) (bucket)->refcount++ -PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC); -PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC); -PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC); -PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket TSRMLS_DC); -END_EXTERN_C() - -#define PSFS_FLAG_NORMAL 0 /* regular read/write */ -#define PSFS_FLAG_FLUSH_INC 1 /* an incremental flush */ -#define PSFS_FLAG_FLUSH_CLOSE 2 /* final flush prior to closing */ - -typedef struct _php_stream_filter_ops { - - php_stream_filter_status_t (*filter)( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC); - - void (*dtor)(php_stream_filter *thisfilter TSRMLS_DC); - - const char *label; - -} php_stream_filter_ops; - -typedef struct _php_stream_filter_chain { - php_stream_filter *head, *tail; - - /* Owning stream */ - php_stream *stream; -} php_stream_filter_chain; - -struct _php_stream_filter { - php_stream_filter_ops *fops; - void *abstract; /* for use by filter implementation */ - php_stream_filter *next; - php_stream_filter *prev; - int is_persistent; - - /* link into stream and chain */ - php_stream_filter_chain *chain; - - /* buffered buckets */ - php_stream_bucket_brigade buffer; - - /* filters are auto_registered when they're applied */ - int rsrc_id; -}; - -/* stack filter onto a stream */ -BEGIN_EXTERN_C() -PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC); -PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter TSRMLS_DC); -PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish TSRMLS_DC); -PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor TSRMLS_DC); -PHPAPI void php_stream_filter_free(php_stream_filter *filter TSRMLS_DC); -PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC TSRMLS_DC); -END_EXTERN_C() -#define php_stream_filter_alloc(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_CC TSRMLS_CC) -#define php_stream_filter_alloc_rel(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_filter_prepend(chain, filter) _php_stream_filter_prepend((chain), (filter) TSRMLS_CC) -#define php_stream_filter_append(chain, filter) _php_stream_filter_append((chain), (filter) TSRMLS_CC) -#define php_stream_filter_flush(filter, finish) _php_stream_filter_flush((filter), (finish) TSRMLS_CC) - -#define php_stream_is_filtered(stream) ((stream)->readfilters.head || (stream)->writefilters.head) - -typedef struct _php_stream_filter_factory { - php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, int persistent TSRMLS_DC); -} php_stream_filter_factory; - -BEGIN_EXTERN_C() -PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC); -PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern TSRMLS_DC); -PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC); -PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC); -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h deleted file mode 100644 index d5098c9ed0a42..0000000000000 --- a/main/streams/php_stream_mmap.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* Memory Mapping interface for streams. - * The intention is to provide a uniform interface over the most common - * operations that are used within PHP itself, rather than a complete - * API for all memory mapping needs. - * - * ATM, we support only mmap(), but win32 memory mapping support will - * follow soon. - * */ - -typedef enum { - /* Does the stream support mmap ? */ - PHP_STREAM_MMAP_SUPPORTED, - /* Request a range and offset to be mapped; - * while mapped, you MUST NOT use any read/write functions - * on the stream (win9x compatibility) */ - PHP_STREAM_MMAP_MAP_RANGE, - /* Unmap the last range that was mapped for the stream */ - PHP_STREAM_MMAP_UNMAP -} php_stream_mmap_operation_t; - -typedef enum { - PHP_STREAM_MAP_MODE_READONLY, - PHP_STREAM_MAP_MODE_READWRITE, - PHP_STREAM_MAP_MODE_SHARED_READONLY, - PHP_STREAM_MAP_MODE_SHARED_READWRITE -} php_stream_mmap_access_t; - -typedef struct { - /* requested offset and length. - * If length is 0, the whole file is mapped */ - size_t offset; - size_t length; - - php_stream_mmap_access_t mode; - - /* returned mapped address */ - char *mapped; - -} php_stream_mmap_range; - -#define php_stream_mmap_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_SUPPORTED, NULL TSRMLS_CC) == 0 ? 1 : 0) - -/* Returns 1 if the stream in its current state can be memory mapped, - * 0 otherwise */ -#define php_stream_mmap_possible(stream) (!php_stream_is_filtered((stream)) && php_stream_mmap_supported((stream))) - -BEGIN_EXTERN_C() -PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len TSRMLS_DC); -#define php_stream_mmap_range(stream, offset, length, mode, mapped_len) _php_stream_mmap_range((stream), (offset), (length), (mode), (mapped_len) TSRMLS_CC) - -/* un-maps the last mapped range */ -PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC); -#define php_stream_mmap_unmap(stream) _php_stream_mmap_unmap((stream) TSRMLS_CC) -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h deleted file mode 100644 index 031acc48b0474..0000000000000 --- a/main/streams/php_stream_plain_wrapper.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* definitions for the plain files wrapper */ - -/* operations for a plain file; use the php_stream_fopen_XXX funcs below */ -PHPAPI extern php_stream_ops php_stream_stdio_ops; -PHPAPI extern php_stream_wrapper php_plain_files_wrapper; - -BEGIN_EXTERN_C() - -/* like fopen, but returns a stream */ -PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC); -#define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened) STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_from_file(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_from_fd(fd, mode, persistent_id) _php_stream_fopen_from_fd((fd), (mode), (persistent_id) STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_from_pipe(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_tmpfile() _php_stream_fopen_tmpfile(0 STREAMS_CC TSRMLS_CC) - -PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path STREAMS_DC TSRMLS_DC); -#define php_stream_fopen_temporary_file(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_CC TSRMLS_CC) - -/* This is a utility API for extensions that are opening a stream, converting it - * to a FILE* and then closing it again. Be warned that fileno() on the result - * will most likely fail on systems with fopencookie. */ -PHPAPI FILE * _php_stream_open_wrapper_as_file(char * path, char * mode, int options, char **opened_path STREAMS_DC TSRMLS_DC); -#define php_stream_open_wrapper_as_file(path, mode, options, opened_path) _php_stream_open_wrapper_as_file((path), (mode), (options), (opened_path) STREAMS_CC TSRMLS_CC) - -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h deleted file mode 100644 index 90c0f5a3bf974..0000000000000 --- a/main/streams/php_stream_transport.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#if HAVE_SYS_SOCKET_H -# include -#endif - -typedef php_stream *(php_stream_transport_factory_func)(const char *proto, long protolen, - char *resourcename, long resourcenamelen, - const char *persistent_id, int options, int flags, - struct timeval *timeout, - php_stream_context *context STREAMS_DC TSRMLS_DC); -typedef php_stream_transport_factory_func *php_stream_transport_factory; - -BEGIN_EXTERN_C() -PHPAPI int php_stream_xport_register(char *protocol, php_stream_transport_factory factory TSRMLS_DC); -PHPAPI int php_stream_xport_unregister(char *protocol TSRMLS_DC); - -#define STREAM_XPORT_CLIENT 0 -#define STREAM_XPORT_SERVER 1 - -#define STREAM_XPORT_CONNECT 2 -#define STREAM_XPORT_BIND 4 -#define STREAM_XPORT_LISTEN 8 -#define STREAM_XPORT_CONNECT_ASYNC 16 - -/* Open a client or server socket connection */ -PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int options, - int flags, const char *persistent_id, - struct timeval *timeout, - php_stream_context *context, - char **error_string, - int *error_code - STREAMS_DC TSRMLS_DC); - -#define php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode) \ - _php_stream_xport_create(name, namelen, options, flags, persistent_id, timeout, context, estr, ecode STREAMS_CC TSRMLS_CC) - -/* Bind the stream to a local address */ -PHPAPI int php_stream_xport_bind(php_stream *stream, - const char *name, long namelen, - char **error_text - TSRMLS_DC); - -/* Connect to a remote address */ -PHPAPI int php_stream_xport_connect(php_stream *stream, - const char *name, long namelen, - int asynchronous, - struct timeval *timeout, - char **error_text, - int *error_code - TSRMLS_DC); - -/* Prepare to listen */ -PHPAPI int php_stream_xport_listen(php_stream *stream, - int backlog, - char **error_text - TSRMLS_DC); - -/* Get the next client and their address as a string, or the underlying address - * structure. You must efree either of these if you request them */ -PHPAPI int php_stream_xport_accept(php_stream *stream, php_stream **client, - char **textaddr, int *textaddrlen, - void **addr, socklen_t *addrlen, - struct timeval *timeout, - char **error_text - TSRMLS_DC); - -/* Get the name of either the socket or it's peer */ -PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer, - char **textaddr, int *textaddrlen, - void **addr, socklen_t *addrlen - TSRMLS_DC); - -enum php_stream_xport_send_recv_flags { - STREAM_OOB = 1, - STREAM_PEEK = 2 -}; - -/* Similar to recv() system call; read data from the stream, optionally - * peeking, optionally retrieving OOB data */ -PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t buflen, - long flags, void **addr, socklen_t *addrlen, - char **textaddr, int *textaddrlen TSRMLS_DC); - -/* Similar to send() system call; send data to the stream, optionally - * sending it as OOB data */ -PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen, - long flags, void *addr, socklen_t addrlen TSRMLS_DC); - -typedef enum { - STREAM_SHUT_RD, - STREAM_SHUT_WR, - STREAM_SHUT_RDWR -} stream_shutdown_t; - -/* Similar to shutdown() system call; shut down part of a full-duplex - * connection */ -PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how TSRMLS_DC); -END_EXTERN_C() - - -/* Structure definition for the set_option interface that the above functions wrap */ - -typedef struct _php_stream_xport_param { - enum { - STREAM_XPORT_OP_BIND, STREAM_XPORT_OP_CONNECT, - STREAM_XPORT_OP_LISTEN, STREAM_XPORT_OP_ACCEPT, - STREAM_XPORT_OP_CONNECT_ASYNC, - STREAM_XPORT_OP_GET_NAME, - STREAM_XPORT_OP_GET_PEER_NAME, - STREAM_XPORT_OP_RECV, - STREAM_XPORT_OP_SEND, - STREAM_XPORT_OP_SHUTDOWN - } op; - unsigned int want_addr:1; - unsigned int want_textaddr:1; - unsigned int want_errortext:1; - unsigned int how:2; - - struct { - char *name; - long namelen; - int backlog; - struct timeval *timeout; - struct sockaddr *addr; - socklen_t addrlen; - char *buf; - size_t buflen; - long flags; - } inputs; - struct { - php_stream *client; - int returncode; - struct sockaddr *addr; - socklen_t addrlen; - char *textaddr; - long textaddrlen; - - char *error_text; - int error_code; - } outputs; -} php_stream_xport_param; - - -/* These functions provide crypto support on the underlying transport */ -typedef enum { - STREAM_CRYPTO_METHOD_SSLv2_CLIENT, - STREAM_CRYPTO_METHOD_SSLv3_CLIENT, - STREAM_CRYPTO_METHOD_SSLv23_CLIENT, - STREAM_CRYPTO_METHOD_TLS_CLIENT, - STREAM_CRYPTO_METHOD_SSLv2_SERVER, - STREAM_CRYPTO_METHOD_SSLv3_SERVER, - STREAM_CRYPTO_METHOD_SSLv23_SERVER, - STREAM_CRYPTO_METHOD_TLS_SERVER -} php_stream_xport_crypt_method_t; - -BEGIN_EXTERN_C() -PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC); -PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC); -END_EXTERN_C() - -typedef struct _php_stream_xport_crypto_param { - enum { - STREAM_XPORT_CRYPTO_OP_SETUP, - STREAM_XPORT_CRYPTO_OP_ENABLE - } op; - struct { - int activate; - php_stream_xport_crypt_method_t method; - php_stream *session; - } inputs; - struct { - int returncode; - } outputs; -} php_stream_xport_crypto_param; - -BEGIN_EXTERN_C() -PHPAPI HashTable *php_stream_xport_get_hash(void); -PHPAPI php_stream_transport_factory_func php_stream_generic_socket_factory; -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/php_stream_userspace.h b/main/streams/php_stream_userspace.h deleted file mode 100644 index a5d368430140a..0000000000000 --- a/main/streams/php_stream_userspace.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -/* for user-space streams */ -PHPAPI extern php_stream_ops php_stream_userspace_ops; -PHPAPI extern php_stream_ops php_stream_userspace_dir_ops; -#define PHP_STREAM_IS_USERSPACE &php_stream_userspace_ops -#define PHP_STREAM_IS_USERSPACE_DIR &php_stream_userspace_dir_ops - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h deleted file mode 100644 index 5f96014c5a0fd..0000000000000 --- a/main/streams/php_streams_int.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#if ZEND_DEBUG - -#define emalloc_rel_orig(size) \ - ( __php_stream_call_depth == 0 \ - ? _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \ - : _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ) - -#define erealloc_rel_orig(ptr, size) \ - ( __php_stream_call_depth == 0 \ - ? _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_RELAY_CC) \ - : _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC) ) - -#define pemalloc_rel_orig(size, persistent) ((persistent) ? malloc((size)) : emalloc_rel_orig((size))) -#define perealloc_rel_orig(ptr, size, persistent) ((persistent) ? realloc((ptr), (size)) : erealloc_rel_orig((ptr), (size))) -#else -# define pemalloc_rel_orig(size, persistent) pemalloc((size), (persistent)) -# define perealloc_rel_orig(ptr, size, persistent) perealloc((ptr), (size), (persistent)) -# define emalloc_rel_orig(size) emalloc((size)) -#endif - -#define STREAM_DEBUG 0 -#define STREAM_WRAPPER_PLAIN_FILES ((php_stream_wrapper*)-1) - -#ifndef MAP_FAILED -#define MAP_FAILED ((void *) -1) -#endif - -#define CHUNK_SIZE 8192 - -#ifdef PHP_WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) -#endif - -void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper TSRMLS_DC); -void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption TSRMLS_DC); - diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c deleted file mode 100644 index fa2eeff8103c9..0000000000000 --- a/main/streams/plain_wrapper.c +++ /dev/null @@ -1,1429 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Wez Furlong | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_network.h" -#include "php_open_temporary_file.h" -#include "ext/standard/file.h" -#include "ext/standard/flock_compat.h" -#include "ext/standard/php_filestat.h" -#include -#include -#if HAVE_SYS_WAIT_H -#include -#endif -#if HAVE_SYS_FILE_H -#include -#endif -#ifdef HAVE_SYS_MMAN_H -#include -#endif -#include "SAPI.h" - -#include "php_streams_int.h" - -#define php_stream_fopen_from_fd_int(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_CC TSRMLS_CC) -#define php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id) _php_stream_fopen_from_fd_int((fd), (mode), (persistent_id) STREAMS_REL_CC TSRMLS_CC) -#define php_stream_fopen_from_file_int(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_CC TSRMLS_CC) -#define php_stream_fopen_from_file_int_rel(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_REL_CC TSRMLS_CC) - -/* parse standard "fopen" modes into open() flags */ -PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags) -{ - int flags; - - switch (mode[0]) { - case 'r': - flags = 0; - break; - case 'w': - flags = O_TRUNC|O_CREAT; - break; - case 'a': - flags = O_CREAT|O_APPEND; - break; - case 'x': - flags = O_CREAT|O_EXCL; - break; - case 'c': - flags = O_CREAT; - break; - default: - /* unknown mode */ - return FAILURE; - } - - if (strchr(mode, '+')) { - flags |= O_RDWR; - } else if (flags) { - flags |= O_WRONLY; - } else { - flags |= O_RDONLY; - } - -#if defined(_O_TEXT) && defined(O_BINARY) - if (strchr(mode, 't')) { - flags |= _O_TEXT; - } else { - flags |= O_BINARY; - } -#endif - - *open_flags = flags; - return SUCCESS; -} - - -/* {{{ ------- STDIO stream implementation -------*/ - -typedef struct { - FILE *file; - int fd; /* underlying file descriptor */ - unsigned is_process_pipe:1; /* use pclose instead of fclose */ - unsigned is_pipe:1; /* don't try and seek */ - unsigned cached_fstat:1; /* sb is valid */ - unsigned _reserved:29; - - int lock_flag; /* stores the lock state */ - char *temp_file_name; /* if non-null, this is the path to a temporary file that - * is to be deleted when the stream is closed */ -#if HAVE_FLUSHIO - char last_op; -#endif - -#if HAVE_MMAP - char *last_mapped_addr; - size_t last_mapped_len; -#endif -#ifdef PHP_WIN32 - char *last_mapped_addr; - HANDLE file_mapping; -#endif - - struct stat sb; -} php_stdio_stream_data; -#define PHP_STDIOP_GET_FD(anfd, data) anfd = (data)->file ? fileno((data)->file) : (data)->fd - -static int do_fstat(php_stdio_stream_data *d, int force) -{ - if (!d->cached_fstat || force) { - int fd; - int r; - - PHP_STDIOP_GET_FD(fd, d); - r = fstat(fd, &d->sb); - d->cached_fstat = r == 0; - - return r; - } - return 0; -} - -static php_stream *_php_stream_fopen_from_fd_int(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC) -{ - php_stdio_stream_data *self; - - self = pemalloc_rel_orig(sizeof(*self), persistent_id); - memset(self, 0, sizeof(*self)); - self->file = NULL; - self->is_pipe = 0; - self->lock_flag = LOCK_UN; - self->is_process_pipe = 0; - self->temp_file_name = NULL; - self->fd = fd; - - return php_stream_alloc_rel(&php_stream_stdio_ops, self, persistent_id, mode); -} - -static php_stream *_php_stream_fopen_from_file_int(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) -{ - php_stdio_stream_data *self; - - self = emalloc_rel_orig(sizeof(*self)); - memset(self, 0, sizeof(*self)); - self->file = file; - self->is_pipe = 0; - self->lock_flag = LOCK_UN; - self->is_process_pipe = 0; - self->temp_file_name = NULL; - self->fd = fileno(file); - - return php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode); -} - -PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path STREAMS_DC TSRMLS_DC) -{ - int fd = php_open_temporary_fd(dir, pfx, opened_path TSRMLS_CC); - - if (fd != -1) { - php_stream *stream = php_stream_fopen_from_fd_int_rel(fd, "r+b", NULL); - if (stream) { - return stream; - } - close(fd); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to allocate stream"); - - return NULL; - } - return NULL; -} - -PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC) -{ - char *opened_path = NULL; - int fd = php_open_temporary_fd(NULL, "php", &opened_path TSRMLS_CC); - - if (fd != -1) { - php_stream *stream = php_stream_fopen_from_fd_int_rel(fd, "r+b", NULL); - if (stream) { - php_stdio_stream_data *self = (php_stdio_stream_data*)stream->abstract; - stream->wrapper = &php_plain_files_wrapper; - stream->orig_path = estrdup(opened_path); - - self->temp_file_name = opened_path; - self->lock_flag = LOCK_UN; - - return stream; - } - close(fd); - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to allocate stream"); - - return NULL; - } - return NULL; -} - -PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id); - - if (stream) { - php_stdio_stream_data *self = (php_stdio_stream_data*)stream->abstract; - -#ifdef S_ISFIFO - /* detect if this is a pipe */ - if (self->fd >= 0) { - self->is_pipe = (do_fstat(self, 0) == 0 && S_ISFIFO(self->sb.st_mode)) ? 1 : 0; - } -#elif defined(PHP_WIN32) - { - zend_uintptr_t handle = _get_osfhandle(self->fd); - - if (handle != (zend_uintptr_t)INVALID_HANDLE_VALUE) { - self->is_pipe = GetFileType((HANDLE)handle) == FILE_TYPE_PIPE; - } - } -#endif - - if (self->is_pipe) { - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - } else { - stream->position = lseek(self->fd, 0, SEEK_CUR); -#ifdef ESPIPE - if (stream->position == (off_t)-1 && errno == ESPIPE) { - stream->position = 0; - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - self->is_pipe = 1; - } -#endif - } - } - - return stream; -} - -PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = php_stream_fopen_from_file_int_rel(file, mode); - - if (stream) { - php_stdio_stream_data *self = (php_stdio_stream_data*)stream->abstract; - -#ifdef S_ISFIFO - /* detect if this is a pipe */ - if (self->fd >= 0) { - self->is_pipe = (do_fstat(self, 0) == 0 && S_ISFIFO(self->sb.st_mode)) ? 1 : 0; - } -#elif defined(PHP_WIN32) - { - zend_uintptr_t handle = _get_osfhandle(self->fd); - - if (handle != (zend_uintptr_t)INVALID_HANDLE_VALUE) { - self->is_pipe = GetFileType((HANDLE)handle) == FILE_TYPE_PIPE; - } - } -#endif - - if (self->is_pipe) { - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - } else { - stream->position = ftell(file); - } - } - - return stream; -} - -PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC) -{ - php_stdio_stream_data *self; - php_stream *stream; - - self = emalloc_rel_orig(sizeof(*self)); - memset(self, 0, sizeof(*self)); - self->file = file; - self->is_pipe = 1; - self->lock_flag = LOCK_UN; - self->is_process_pipe = 1; - self->fd = fileno(file); - self->temp_file_name = NULL; - - stream = php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode); - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - return stream; -} - -static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - - assert(data != NULL); - - if (data->fd >= 0) { - int bytes_written = write(data->fd, buf, count); - if (bytes_written < 0) return 0; - return (size_t) bytes_written; - } else { - -#if HAVE_FLUSHIO - if (!data->is_pipe && data->last_op == 'r') { - fseek(data->file, 0, SEEK_CUR); - } - data->last_op = 'w'; -#endif - - return fwrite(buf, 1, count, data->file); - } -} - -static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - size_t ret; - - assert(data != NULL); - - if (data->fd >= 0) { - ret = read(data->fd, buf, count); - - if (ret == (size_t)-1 && errno == EINTR) { - /* Read was interrupted, retry once, - If read still fails, giveup with feof==0 - so script can retry if desired */ - ret = read(data->fd, buf, count); - } - - stream->eof = (ret == 0 || (ret == (size_t)-1 && errno != EWOULDBLOCK && errno != EINTR && errno != EBADF)); - - } else { -#if HAVE_FLUSHIO - if (!data->is_pipe && data->last_op == 'w') - fseek(data->file, 0, SEEK_CUR); - data->last_op = 'r'; -#endif - - ret = fread(buf, 1, count, data->file); - - stream->eof = feof(data->file); - } - return ret; -} - -static int php_stdiop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - int ret; - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - - assert(data != NULL); - -#if HAVE_MMAP - if (data->last_mapped_addr) { - munmap(data->last_mapped_addr, data->last_mapped_len); - data->last_mapped_addr = NULL; - } -#elif defined(PHP_WIN32) - if (data->last_mapped_addr) { - UnmapViewOfFile(data->last_mapped_addr); - data->last_mapped_addr = NULL; - } - if (data->file_mapping) { - CloseHandle(data->file_mapping); - data->file_mapping = NULL; - } -#endif - - if (close_handle) { - if (data->lock_flag != LOCK_UN) { - php_stream_lock(stream, LOCK_UN); - } - if (data->file) { - if (data->is_process_pipe) { - errno = 0; - ret = pclose(data->file); - -#if HAVE_SYS_WAIT_H - if (WIFEXITED(ret)) { - ret = WEXITSTATUS(ret); - } -#endif - } else { - ret = fclose(data->file); - data->file = NULL; - } - } else if (data->fd != -1) { - ret = close(data->fd); - data->fd = -1; - } else { - return 0; /* everything should be closed already -> success */ - } - if (data->temp_file_name) { - unlink(data->temp_file_name); - /* temporary streams are never persistent */ - efree(data->temp_file_name); - data->temp_file_name = NULL; - } - } else { - ret = 0; - data->file = NULL; - data->fd = -1; - } - - pefree(data, stream->is_persistent); - - return ret; -} - -static int php_stdiop_flush(php_stream *stream TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - - assert(data != NULL); - - /* - * stdio buffers data in user land. By calling fflush(3), this - * data is send to the kernel using write(2). fsync'ing is - * something completely different. - */ - if (data->file) { - return fflush(data->file); - } - return 0; -} - -static int php_stdiop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; - int ret; - - assert(data != NULL); - - if (data->is_pipe) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot seek on a pipe"); - return -1; - } - - if (data->fd >= 0) { - off_t result; - - result = lseek(data->fd, offset, whence); - if (result == (off_t)-1) - return -1; - - *newoffset = result; - return 0; - - } else { - ret = fseek(data->file, offset, whence); - *newoffset = ftell(data->file); - return ret; - } -} - -static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - int fd; - php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract; - - assert(data != NULL); - - /* as soon as someone touches the stdio layer, buffering may ensue, - * so we need to stop using the fd directly in that case */ - - switch (castas) { - case PHP_STREAM_AS_STDIO: - if (ret) { - - if (data->file == NULL) { - /* we were opened as a plain file descriptor, so we - * need fdopen now */ - data->file = fdopen(data->fd, stream->mode); - if (data->file == NULL) { - return FAILURE; - } - } - - *(FILE**)ret = data->file; - data->fd = -1; - } - return SUCCESS; - - case PHP_STREAM_AS_FD_FOR_SELECT: - PHP_STDIOP_GET_FD(fd, data); - if (fd < 0) { - return FAILURE; - } - if (ret) { - *(int*)ret = fd; - } - return SUCCESS; - - case PHP_STREAM_AS_FD: - PHP_STDIOP_GET_FD(fd, data); - - if (fd < 0) { - return FAILURE; - } - if (data->file) { - fflush(data->file); - } - if (ret) { - *(int*)ret = fd; - } - return SUCCESS; - default: - return FAILURE; - } -} - -static int php_stdiop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - int ret; - php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract; - - assert(data != NULL); - - ret = do_fstat(data, 1); - memcpy(&ssb->sb, &data->sb, sizeof(ssb->sb)); - return ret; -} - -static int php_stdiop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) -{ - php_stdio_stream_data *data = (php_stdio_stream_data*) stream->abstract; - size_t size; - int fd; -#ifdef O_NONBLOCK - /* FIXME: make this work for win32 */ - int flags; - int oldval; -#endif - - PHP_STDIOP_GET_FD(fd, data); - - switch(option) { - case PHP_STREAM_OPTION_BLOCKING: - if (fd == -1) - return -1; -#ifdef O_NONBLOCK - flags = fcntl(fd, F_GETFL, 0); - oldval = (flags & O_NONBLOCK) ? 0 : 1; - if (value) - flags &= ~O_NONBLOCK; - else - flags |= O_NONBLOCK; - - if (-1 == fcntl(fd, F_SETFL, flags)) - return -1; - return oldval; -#else - return -1; /* not yet implemented */ -#endif - - case PHP_STREAM_OPTION_WRITE_BUFFER: - - if (data->file == NULL) { - return -1; - } - - if (ptrparam) - size = *(size_t *)ptrparam; - else - size = BUFSIZ; - - switch(value) { - case PHP_STREAM_BUFFER_NONE: - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - return setvbuf(data->file, NULL, _IONBF, 0); - - case PHP_STREAM_BUFFER_LINE: - stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER; - return setvbuf(data->file, NULL, _IOLBF, size); - - case PHP_STREAM_BUFFER_FULL: - stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER; - return setvbuf(data->file, NULL, _IOFBF, size); - - default: - return -1; - } - break; - - case PHP_STREAM_OPTION_LOCKING: - if (fd == -1) { - return -1; - } - - if ((zend_uintptr_t) ptrparam == PHP_STREAM_LOCK_SUPPORTED) { - return 0; - } - - if (!flock(fd, value)) { - data->lock_flag = value; - return 0; - } else { - return -1; - } - break; - - case PHP_STREAM_OPTION_MMAP_API: -#if HAVE_MMAP - { - php_stream_mmap_range *range = (php_stream_mmap_range*)ptrparam; - int prot, flags; - - switch (value) { - case PHP_STREAM_MMAP_SUPPORTED: - return fd == -1 ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_MMAP_MAP_RANGE: - do_fstat(data, 1); - if (range->length == 0 && range->offset > 0 && range->offset < data->sb.st_size) { - range->length = data->sb.st_size - range->offset; - } - if (range->length == 0 || range->length > data->sb.st_size) { - range->length = data->sb.st_size; - } - if (range->offset >= data->sb.st_size) { - range->offset = data->sb.st_size; - range->length = 0; - } - switch (range->mode) { - case PHP_STREAM_MAP_MODE_READONLY: - prot = PROT_READ; - flags = MAP_PRIVATE; - break; - case PHP_STREAM_MAP_MODE_READWRITE: - prot = PROT_READ | PROT_WRITE; - flags = MAP_PRIVATE; - break; - case PHP_STREAM_MAP_MODE_SHARED_READONLY: - prot = PROT_READ; - flags = MAP_SHARED; - break; - case PHP_STREAM_MAP_MODE_SHARED_READWRITE: - prot = PROT_READ | PROT_WRITE; - flags = MAP_SHARED; - break; - default: - return PHP_STREAM_OPTION_RETURN_ERR; - } - range->mapped = (char*)mmap(NULL, range->length, prot, flags, fd, range->offset); - if (range->mapped == (char*)MAP_FAILED) { - range->mapped = NULL; - return PHP_STREAM_OPTION_RETURN_ERR; - } - /* remember the mapping */ - data->last_mapped_addr = range->mapped; - data->last_mapped_len = range->length; - return PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_MMAP_UNMAP: - if (data->last_mapped_addr) { - munmap(data->last_mapped_addr, data->last_mapped_len); - data->last_mapped_addr = NULL; - - return PHP_STREAM_OPTION_RETURN_OK; - } - return PHP_STREAM_OPTION_RETURN_ERR; - } - } -#elif defined(PHP_WIN32) - { - php_stream_mmap_range *range = (php_stream_mmap_range*)ptrparam; - HANDLE hfile = (HANDLE)_get_osfhandle(fd); - DWORD prot, acc, loffs = 0, delta = 0; - - switch (value) { - case PHP_STREAM_MMAP_SUPPORTED: - return hfile == INVALID_HANDLE_VALUE ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_MMAP_MAP_RANGE: - switch (range->mode) { - case PHP_STREAM_MAP_MODE_READONLY: - prot = PAGE_READONLY; - acc = FILE_MAP_READ; - break; - case PHP_STREAM_MAP_MODE_READWRITE: - prot = PAGE_READWRITE; - acc = FILE_MAP_READ | FILE_MAP_WRITE; - break; - case PHP_STREAM_MAP_MODE_SHARED_READONLY: - prot = PAGE_READONLY; - acc = FILE_MAP_READ; - /* TODO: we should assign a name for the mapping */ - break; - case PHP_STREAM_MAP_MODE_SHARED_READWRITE: - prot = PAGE_READWRITE; - acc = FILE_MAP_READ | FILE_MAP_WRITE; - /* TODO: we should assign a name for the mapping */ - break; - } - - /* create a mapping capable of viewing the whole file (this costs no real resources) */ - data->file_mapping = CreateFileMapping(hfile, NULL, prot, 0, 0, NULL); - - if (data->file_mapping == NULL) { - return PHP_STREAM_OPTION_RETURN_ERR; - } - - size = GetFileSize(hfile, NULL); - if (range->length == 0 && range->offset > 0 && range->offset < size) { - range->length = size - range->offset; - } - if (range->length == 0 || range->length > size) { - range->length = size; - } - if (range->offset >= size) { - range->offset = size; - range->length = 0; - } - - /* figure out how big a chunk to map to be able to view the part that we need */ - if (range->offset != 0) { - SYSTEM_INFO info; - DWORD gran; - - GetSystemInfo(&info); - gran = info.dwAllocationGranularity; - loffs = (range->offset / gran) * gran; - delta = range->offset - loffs; - } - - data->last_mapped_addr = MapViewOfFile(data->file_mapping, acc, 0, loffs, range->length + delta); - - if (data->last_mapped_addr) { - /* give them back the address of the start offset they requested */ - range->mapped = data->last_mapped_addr + delta; - return PHP_STREAM_OPTION_RETURN_OK; - } - - CloseHandle(data->file_mapping); - data->file_mapping = NULL; - - return PHP_STREAM_OPTION_RETURN_ERR; - - case PHP_STREAM_MMAP_UNMAP: - if (data->last_mapped_addr) { - UnmapViewOfFile(data->last_mapped_addr); - data->last_mapped_addr = NULL; - CloseHandle(data->file_mapping); - data->file_mapping = NULL; - return PHP_STREAM_OPTION_RETURN_OK; - } - return PHP_STREAM_OPTION_RETURN_ERR; - - default: - return PHP_STREAM_OPTION_RETURN_ERR; - } - } - -#endif - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - - case PHP_STREAM_OPTION_TRUNCATE_API: - switch (value) { - case PHP_STREAM_TRUNCATE_SUPPORTED: - return fd == -1 ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_TRUNCATE_SET_SIZE: { - ptrdiff_t new_size = *(ptrdiff_t*)ptrparam; - if (new_size < 0) { - return PHP_STREAM_OPTION_RETURN_ERR; - } - return ftruncate(fd, new_size) == 0 ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR; - } - } - - default: - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - } -} - -PHPAPI php_stream_ops php_stream_stdio_ops = { - php_stdiop_write, php_stdiop_read, - php_stdiop_close, php_stdiop_flush, - "STDIO", - php_stdiop_seek, - php_stdiop_cast, - php_stdiop_stat, - php_stdiop_set_option -}; -/* }}} */ - -/* {{{ plain files opendir/readdir implementation */ -static size_t php_plain_files_dirstream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - DIR *dir = (DIR*)stream->abstract; - /* avoid libc5 readdir problems */ - char entry[sizeof(struct dirent)+MAXPATHLEN]; - struct dirent *result = (struct dirent *)&entry; - php_stream_dirent *ent = (php_stream_dirent*)buf; - - /* avoid problems if someone mis-uses the stream */ - if (count != sizeof(php_stream_dirent)) - return 0; - - if (php_readdir_r(dir, (struct dirent *)entry, &result) == 0 && result) { - PHP_STRLCPY(ent->d_name, result->d_name, sizeof(ent->d_name), strlen(result->d_name)); - return sizeof(php_stream_dirent); - } - return 0; -} - -static int php_plain_files_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - return closedir((DIR *)stream->abstract); -} - -static int php_plain_files_dirstream_rewind(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - rewinddir((DIR *)stream->abstract); - return 0; -} - -static php_stream_ops php_plain_files_dirstream_ops = { - NULL, php_plain_files_dirstream_read, - php_plain_files_dirstream_close, NULL, - "dir", - php_plain_files_dirstream_rewind, - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, char *path, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - DIR *dir = NULL; - php_stream *stream = NULL; - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { - return NULL; - } - - if (PG(safe_mode) &&(!php_checkuid(path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return NULL; - } - - dir = VCWD_OPENDIR(path); - -#ifdef PHP_WIN32 - if (dir && dir->finished) { - closedir(dir); - dir = NULL; - } -#endif - if (dir) { - stream = php_stream_alloc(&php_plain_files_dirstream_ops, dir, 0, mode); - if (stream == NULL) - closedir(dir); - } - - return stream; -} -/* }}} */ - -/* {{{ php_stream_fopen */ -PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC) -{ - char *realpath = NULL; - int open_flags; - int fd; - php_stream *ret; - int persistent = options & STREAM_OPEN_PERSISTENT; - char *persistent_id = NULL; - - if (FAILURE == php_stream_parse_fopen_modes(mode, &open_flags)) { - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "`%s' is not a valid mode for fopen", mode); - } - return NULL; - } - - if ((realpath = expand_filepath(filename, NULL TSRMLS_CC)) == NULL) { - return NULL; - } - - if (persistent) { - spprintf(&persistent_id, 0, "streams_stdio_%d_%s", open_flags, realpath); - switch (php_stream_from_persistent_id(persistent_id, &ret TSRMLS_CC)) { - case PHP_STREAM_PERSISTENT_SUCCESS: - if (opened_path) { - *opened_path = realpath; - realpath = NULL; - } - /* fall through */ - - case PHP_STREAM_PERSISTENT_FAILURE: - if (realpath) { - efree(realpath); - } - efree(persistent_id);; - return ret; - } - } - - fd = open(realpath, open_flags, 0666); - - if (fd != -1) { - - if (options & STREAM_OPEN_FOR_INCLUDE) { - ret = php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id); - } else { - ret = php_stream_fopen_from_fd_rel(fd, mode, persistent_id); - } - - if (ret) { - if (opened_path) { - *opened_path = realpath; - realpath = NULL; - } - if (realpath) { - efree(realpath); - } - if (persistent_id) { - efree(persistent_id); - } - - /* WIN32 always set ISREG flag */ -#ifndef PHP_WIN32 - /* sanity checks for include/require. - * We check these after opening the stream, so that we save - * on fstat() syscalls */ - if (options & STREAM_OPEN_FOR_INCLUDE) { - php_stdio_stream_data *self = (php_stdio_stream_data*)ret->abstract; - int r; - - r = do_fstat(self, 0); - if ((r == 0 && !S_ISREG(self->sb.st_mode))) { - if (opened_path) { - efree(*opened_path); - *opened_path = NULL; - } - php_stream_close(ret); - return NULL; - } - } -#endif - - return ret; - } - close(fd); - } - efree(realpath); - if (persistent_id) { - efree(persistent_id); - } - return NULL; -} -/* }}} */ - - -static php_stream *php_plain_files_stream_opener(php_stream_wrapper *wrapper, char *path, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - if ((options & USE_PATH) && PG(include_path) != NULL) { - return php_stream_fopen_with_path_rel(path, mode, PG(include_path), opened_path, options); - } - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { - return NULL; - } - - if ((options & ENFORCE_SAFE_MODE) && PG(safe_mode) && (!php_checkuid(path, mode, CHECKUID_CHECK_MODE_PARAM))) - return NULL; - - return php_stream_fopen_rel(path, mode, opened_path, options); -} - -static int php_plain_files_url_stater(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) -{ - - if (strncmp(url, "file://", sizeof("file://") - 1) == 0) { - url += sizeof("file://") - 1; - } - - if (PG(safe_mode) &&(!php_checkuid_ex(url, NULL, CHECKUID_CHECK_FILE_AND_DIR, (flags & PHP_STREAM_URL_STAT_QUIET) ? CHECKUID_NO_ERRORS : 0))) { - return -1; - } - - if (php_check_open_basedir_ex(url, (flags & PHP_STREAM_URL_STAT_QUIET) ? 0 : 1 TSRMLS_CC)) { - return -1; - } - -#ifdef HAVE_SYMLINK - if (flags & PHP_STREAM_URL_STAT_LINK) { - return VCWD_LSTAT(url, &ssb->sb); - } else -#endif - return VCWD_STAT(url, &ssb->sb); -} - -static int php_plain_files_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) -{ - char *p; - int ret; - - if ((p = strstr(url, "://")) != NULL) { - url = p + 3; - } - - if (options & ENFORCE_SAFE_MODE) { - if (PG(safe_mode) && !php_checkuid(url, NULL, CHECKUID_CHECK_FILE_AND_DIR)) { - return 0; - } - - if (php_check_open_basedir(url TSRMLS_CC)) { - return 0; - } - } - - ret = VCWD_UNLINK(url); - if (ret == -1) { - if (options & REPORT_ERRORS) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(errno)); - } - return 0; - } - - /* Clear stat cache */ - php_clear_stat_cache(TSRMLS_C); - - return 1; -} - -static int php_plain_files_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC) -{ - char *p; - int ret; - - if (!url_from || !url_to) { - return 0; - } - - if ((p = strstr(url_from, "://")) != NULL) { - url_from = p + 3; - } - - if ((p = strstr(url_to, "://")) != NULL) { - url_to = p + 3; - } - - if (PG(safe_mode) && (!php_checkuid(url_from, NULL, CHECKUID_CHECK_FILE_AND_DIR) || - !php_checkuid(url_to, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return 0; - } - - if (php_check_open_basedir(url_from TSRMLS_CC) || php_check_open_basedir(url_to TSRMLS_CC)) { - return 0; - } - - ret = VCWD_RENAME(url_from, url_to); - - if (ret == -1) { -#ifdef EXDEV - if (errno == EXDEV) { - struct stat sb; - if (php_copy_file(url_from, url_to TSRMLS_CC) == SUCCESS) { - if (VCWD_STAT(url_from, &sb) == 0) { -#if !defined(TSRM_WIN32) && !defined(NETWARE) - if (VCWD_CHMOD(url_to, sb.st_mode)) { - if (errno == EPERM) { - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - VCWD_UNLINK(url_from); - return 1; - } - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - return 0; - } - if (VCWD_CHOWN(url_to, sb.st_uid, sb.st_gid)) { - if (errno == EPERM) { - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - VCWD_UNLINK(url_from); - return 1; - } - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - return 0; - } -#endif - VCWD_UNLINK(url_from); - return 1; - } - } - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - return 0; - } -#endif - php_error_docref2(NULL TSRMLS_CC, url_from, url_to, E_WARNING, "%s", strerror(errno)); - return 0; - } - - /* Clear stat cache */ - php_clear_stat_cache(TSRMLS_C); - - return 1; -} - -static int php_plain_files_mkdir(php_stream_wrapper *wrapper, char *dir, int mode, int options, php_stream_context *context TSRMLS_DC) -{ - int ret, recursive = options & PHP_STREAM_MKDIR_RECURSIVE; - char *p; - - if ((p = strstr(dir, "://")) != NULL) { - dir = p + 3; - } - - if (!recursive) { - ret = php_mkdir(dir, mode TSRMLS_CC); - } else { - /* we look for directory separator from the end of string, thus hopefuly reducing our work load */ - char *e, *buf; - struct stat sb; - int dir_len = strlen(dir); - int offset = 0; - - buf = estrndup(dir, dir_len); - -#ifdef PHP_WIN32 - e = buf; - while (*e) { - if (*e == '/') { - *e = DEFAULT_SLASH; - } - e++; - } -#else - e = buf + dir_len; -#endif - - if ((p = memchr(buf, DEFAULT_SLASH, dir_len))) { - offset = p - buf + 1; - } - - if (p && dir_len == 1) { - /* buf == "DEFAULT_SLASH" */ - } - else { - /* find a top level directory we need to create */ - while ( (p = strrchr(buf + offset, DEFAULT_SLASH)) || (offset != 1 && (p = strrchr(buf, DEFAULT_SLASH))) ) { - int n = 0; - - *p = '\0'; - while (p > buf && *(p-1) == DEFAULT_SLASH) { - ++n; - --p; - *p = '\0'; - } - if (VCWD_STAT(buf, &sb) == 0) { - while (1) { - *p = DEFAULT_SLASH; - if (!n) break; - --n; - ++p; - } - break; - } - } - } - - if (p == buf) { - ret = php_mkdir(dir, mode TSRMLS_CC); - } else if (!(ret = php_mkdir(buf, mode TSRMLS_CC))) { - if (!p) { - p = buf; - } - /* create any needed directories if the creation of the 1st directory worked */ - while (++p != e) { - if (*p == '\0') { - *p = DEFAULT_SLASH; - if ((*(p+1) != '\0') && - (ret = VCWD_MKDIR(buf, (mode_t)mode)) < 0) { - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); - } - break; - } - } - } - } - efree(buf); - } - if (ret < 0) { - /* Failure */ - return 0; - } else { - /* Success */ - return 1; - } -} - -static int php_plain_files_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) -{ - if (PG(safe_mode) &&(!php_checkuid(url, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return 0; - } - - if (php_check_open_basedir(url TSRMLS_CC)) { - return 0; - } - - if (VCWD_RMDIR(url) < 0) { - php_error_docref1(NULL TSRMLS_CC, url, E_WARNING, "%s", strerror(errno)); - return 0; - } - - /* Clear stat cache */ - php_clear_stat_cache(TSRMLS_C); - - return 1; -} - -static php_stream_wrapper_ops php_plain_files_wrapper_ops = { - php_plain_files_stream_opener, - NULL, - NULL, - php_plain_files_url_stater, - php_plain_files_dir_opener, - "plainfile", - php_plain_files_unlink, - php_plain_files_rename, - php_plain_files_mkdir, - php_plain_files_rmdir -}; - -php_stream_wrapper php_plain_files_wrapper = { - &php_plain_files_wrapper_ops, - NULL, - 0 -}; - -/* {{{ php_stream_fopen_with_path */ -PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC) -{ - /* code ripped off from fopen_wrappers.c */ - char *pathbuf, *ptr, *end; - char *exec_fname; - char trypath[MAXPATHLEN]; - struct stat sb; - php_stream *stream; - int path_length; - int filename_length; - int exec_fname_length; - - if (opened_path) { - *opened_path = NULL; - } - - if(!filename) { - return NULL; - } - - filename_length = strlen(filename); - - /* Relative path open */ - if (*filename == '.' && (IS_SLASH(filename[1]) || filename[1] == '.')) { - /* further checks, we could have ....... filenames */ - ptr = filename + 1; - if (*ptr == '.') { - while (*(++ptr) == '.'); - if (!IS_SLASH(*ptr)) { /* not a relative path after all */ - goto not_relative_path; - } - } - - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename TSRMLS_CC)) { - return NULL; - } - - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - return php_stream_fopen_rel(filename, mode, opened_path, options); - } - - /* - * files in safe_mode_include_dir (or subdir) are excluded from - * safe mode GID/UID checks - */ - -not_relative_path: - - /* Absolute path open */ - if (IS_ABSOLUTE_PATH(filename, filename_length)) { - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(filename TSRMLS_CC)) { - return NULL; - } - - if ((php_check_safe_mode_include_dir(filename TSRMLS_CC)) == 0) - /* filename is in safe_mode_include_dir (or subdir) */ - return php_stream_fopen_rel(filename, mode, opened_path, options); - - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) - return NULL; - - return php_stream_fopen_rel(filename, mode, opened_path, options); - } - -#ifdef PHP_WIN32 - if (IS_SLASH(filename[0])) { - size_t cwd_len; - char *cwd; - cwd = virtual_getcwd_ex(&cwd_len TSRMLS_CC); - /* getcwd() will return always return [DRIVE_LETTER]:/) on windows. */ - *(cwd+3) = '\0'; - - snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename); - - free(cwd); - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(trypath TSRMLS_CC)) { - return NULL; - } - if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC)) == 0) { - return php_stream_fopen_rel(trypath, mode, opened_path, options); - } - if (PG(safe_mode) && (!php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - - return php_stream_fopen_rel(trypath, mode, opened_path, options); - } -#endif - - if (!path || (path && !*path)) { - if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { - return NULL; - } - return php_stream_fopen_rel(filename, mode, opened_path, options); - } - - /* check in provided path */ - /* append the calling scripts' current working directory - * as a fall back case - */ - if (zend_is_executing(TSRMLS_C)) { - exec_fname = zend_get_executed_filename(TSRMLS_C); - exec_fname_length = strlen(exec_fname); - path_length = strlen(path); - - while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length])); - if ((exec_fname && exec_fname[0] == '[') - || exec_fname_length<=0) { - /* [no active file] or no path */ - pathbuf = estrdup(path); - } else { - pathbuf = (char *) emalloc(exec_fname_length + path_length +1 +1); - memcpy(pathbuf, path, path_length); - pathbuf[path_length] = DEFAULT_DIR_SEPARATOR; - memcpy(pathbuf+path_length+1, exec_fname, exec_fname_length); - pathbuf[path_length + exec_fname_length +1] = '\0'; - } - } else { - pathbuf = estrdup(path); - } - - ptr = pathbuf; - - while (ptr && *ptr) { - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); - if (end != NULL) { - *end = '\0'; - end++; - } - if (*ptr == '\0') { - goto stream_skip; - } - snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename); - - if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir_ex(trypath, 0 TSRMLS_CC)) { - goto stream_skip; - } - - if (PG(safe_mode)) { - if (VCWD_STAT(trypath, &sb) == 0) { - /* file exists ... check permission */ - if ((php_check_safe_mode_include_dir(trypath TSRMLS_CC) == 0) || - php_checkuid_ex(trypath, mode, CHECKUID_CHECK_MODE_PARAM, CHECKUID_NO_ERRORS)) { - /* UID ok, or trypath is in safe_mode_include_dir */ - stream = php_stream_fopen_rel(trypath, mode, opened_path, options); - goto stream_done; - } - } - goto stream_skip; - } - stream = php_stream_fopen_rel(trypath, mode, opened_path, options); - if (stream) { -stream_done: - efree(pathbuf); - return stream; - } -stream_skip: - ptr = end; - } /* end provided path */ - - efree(pathbuf); - return NULL; - -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/streams.c b/main/streams/streams.c deleted file mode 100755 index 01f6f6e1c40a1..0000000000000 --- a/main/streams/streams.c +++ /dev/null @@ -1,2085 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Wez Furlong | - | Borrowed code from: | - | Rasmus Lerdorf | - | Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define _GNU_SOURCE -#include "php.h" -#include "php_globals.h" -#include "php_network.h" -#include "php_open_temporary_file.h" -#include "ext/standard/file.h" -#include "ext/standard/basic_functions.h" /* for BG(mmap_file) (not strictly required) */ -#include "ext/standard/php_string.h" /* for php_memnstr, used by php_stream_get_record() */ -#include -#include -#include "php_streams_int.h" - -/* {{{ resource and registration code */ -/* Global wrapper hash, copied to FG(stream_wrappers) on registration of volatile wrapper */ -static HashTable url_stream_wrappers_hash; -static int le_stream = FAILURE; /* true global */ -static int le_pstream = FAILURE; /* true global */ -static int le_stream_filter = FAILURE; /* true global */ - -PHPAPI int php_file_le_stream(void) -{ - return le_stream; -} - -PHPAPI int php_file_le_pstream(void) -{ - return le_pstream; -} - -PHPAPI int php_file_le_stream_filter(void) -{ - return le_stream_filter; -} - -PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(TSRMLS_D) -{ - return (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash); -} - -PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void) -{ - return &url_stream_wrappers_hash; -} - -static int _php_stream_release_context(zend_rsrc_list_entry *le, void *pContext TSRMLS_DC) -{ - if (le->ptr == pContext) { - return --le->refcount == 0; - } - return 0; -} - -static int forget_persistent_resource_id_numbers(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_stream *stream; - - if (Z_TYPE_P(rsrc) != le_pstream) { - return 0; - } - - stream = (php_stream*)rsrc->ptr; - -#if STREAM_DEBUG -fprintf(stderr, "forget_persistent: %s:%p\n", stream->ops->label, stream); -#endif - - stream->rsrc_id = FAILURE; - - if (stream->context) { - zend_hash_apply_with_argument(&EG(regular_list), - (apply_func_arg_t) _php_stream_release_context, - stream->context TSRMLS_CC); - stream->context = NULL; - } - - return 0; -} - -PHP_RSHUTDOWN_FUNCTION(streams) -{ - zend_hash_apply(&EG(persistent_list), (apply_func_t)forget_persistent_resource_id_numbers TSRMLS_CC); - return SUCCESS; -} - -PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_find(&EG(persistent_list), (char*)persistent_id, strlen(persistent_id)+1, (void*) &le) == SUCCESS) { - if (Z_TYPE_P(le) == le_pstream) { - if (stream) { - *stream = (php_stream*)le->ptr; - le->refcount++; - (*stream)->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, *stream, le_pstream); - } - return PHP_STREAM_PERSISTENT_SUCCESS; - } - return PHP_STREAM_PERSISTENT_FAILURE; - } - return PHP_STREAM_PERSISTENT_NOT_EXIST; -} - -/* }}} */ - -/* {{{ wrapper error reporting */ -void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption TSRMLS_DC) -{ - char *tmp = estrdup(path); - char *msg; - int free_msg = 0; - - if (wrapper) { - if (wrapper->err_count > 0) { - int i; - size_t l; - int brlen; - char *br; - - if (PG(html_errors)) { - brlen = 7; - br = "
\n"; - } else { - brlen = 1; - br = "\n"; - } - - for (i = 0, l = 0; i < wrapper->err_count; i++) { - l += strlen(wrapper->err_stack[i]); - if (i < wrapper->err_count - 1) { - l += brlen; - } - } - msg = emalloc(l + 1); - msg[0] = '\0'; - for (i = 0; i < wrapper->err_count; i++) { - strcat(msg, wrapper->err_stack[i]); - if (i < wrapper->err_count - 1) { - strcat(msg, br); - } - } - - free_msg = 1; - } else { - if (wrapper == &php_plain_files_wrapper) { - msg = strerror(errno); - } else { - msg = "operation failed"; - } - } - } else { - msg = "no suitable wrapper could be found"; - } - - php_strip_url_passwd(tmp); - php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "%s: %s", caption, msg); - efree(tmp); - if (free_msg) { - efree(msg); - } -} - -void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper TSRMLS_DC) -{ - if (wrapper) { - /* tidy up the error stack */ - int i; - - for (i = 0; i < wrapper->err_count; i++) { - efree(wrapper->err_stack[i]); - } - if (wrapper->err_stack) { - efree(wrapper->err_stack); - } - wrapper->err_stack = NULL; - wrapper->err_count = 0; - } -} - -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) -{ - va_list args; - char *buffer = NULL; - - va_start(args, fmt); - vspprintf(&buffer, 0, fmt, args); - va_end(args); - - if (options & REPORT_ERRORS || wrapper == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", buffer); - efree(buffer); - } else { - /* append to stack */ - wrapper->err_stack = erealloc(wrapper->err_stack, (wrapper->err_count + 1) * sizeof(char *)); - if (wrapper->err_stack) { - wrapper->err_stack[wrapper->err_count++] = buffer; - } - } -} - - -/* }}} */ - -/* allocate a new stream for a particular ops */ -PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC TSRMLS_DC) /* {{{ */ -{ - php_stream *ret; - - ret = (php_stream*) pemalloc_rel_orig(sizeof(php_stream), persistent_id ? 1 : 0); - - memset(ret, 0, sizeof(php_stream)); - - ret->readfilters.stream = ret; - ret->writefilters.stream = ret; - -#if STREAM_DEBUG -fprintf(stderr, "stream_alloc: %s:%p persistent=%s\n", ops->label, ret, persistent_id); -#endif - - ret->ops = ops; - ret->abstract = abstract; - ret->is_persistent = persistent_id ? 1 : 0; - ret->chunk_size = FG(def_chunk_size); - - if (FG(auto_detect_line_endings)) { - ret->flags |= PHP_STREAM_FLAG_DETECT_EOL; - } - - if (persistent_id) { - zend_rsrc_list_entry le; - - Z_TYPE(le) = le_pstream; - le.ptr = ret; - le.refcount = 0; - - if (FAILURE == zend_hash_update(&EG(persistent_list), (char *)persistent_id, - strlen(persistent_id) + 1, - (void *)&le, sizeof(le), NULL)) { - - pefree(ret, 1); - return NULL; - } - } - - ret->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, ret, persistent_id ? le_pstream : le_stream); - strlcpy(ret->mode, mode, sizeof(ret->mode)); - - return ret; -} -/* }}} */ - -static int _php_stream_free_persistent(zend_rsrc_list_entry *le, void *pStream TSRMLS_DC) -{ - return le->ptr == pStream; -} - -PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /* {{{ */ -{ - int ret = 1; - int remove_rsrc = 1; - int preserve_handle = close_options & PHP_STREAM_FREE_PRESERVE_HANDLE ? 1 : 0; - int release_cast = 1; - - if (stream->flags & PHP_STREAM_FLAG_NO_CLOSE) { - preserve_handle = 1; - } - -#if STREAM_DEBUG -fprintf(stderr, "stream_free: %s:%p[%s] in_free=%d opts=%08x\n", stream->ops->label, stream, stream->orig_path, stream->in_free, close_options); -#endif - - /* recursion protection */ - if (stream->in_free) { - return 1; - } - - stream->in_free++; - - /* if we are releasing the stream only (and preserving the underlying handle), - * we need to do things a little differently. - * We are only ever called like this when the stream is cast to a FILE* - * for include (or other similar) purposes. - * */ - if (preserve_handle) { - if (stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { - /* If the stream was fopencookied, we must NOT touch anything - * here, as the cookied stream relies on it all. - * Instead, mark the stream as OK to auto-clean */ - php_stream_auto_cleanup(stream); - stream->in_free--; - return 0; - } - /* otherwise, make sure that we don't close the FILE* from a cast */ - release_cast = 0; - } - -#if STREAM_DEBUG -fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remove_rsrc=%d\n", - stream->ops->label, stream, stream->orig_path, preserve_handle, release_cast, remove_rsrc); -#endif - - /* make sure everything is saved */ - _php_stream_flush(stream, 1 TSRMLS_CC); - - /* If not called from the resource dtor, remove the stream from the resource list. */ - if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) == 0 && remove_rsrc) { - zend_list_delete(stream->rsrc_id); - } - - /* Remove stream from any context link list */ - if (stream->context && stream->context->links) { - php_stream_context_del_link(stream->context, stream); - } - - if (close_options & PHP_STREAM_FREE_CALL_DTOR) { - if (release_cast && stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { - /* calling fclose on an fopencookied stream will ultimately - call this very same function. If we were called via fclose, - the cookie_closer unsets the fclose_stdiocast flags, so - we can be sure that we only reach here when PHP code calls - php_stream_free. - Lets let the cookie code clean it all up. - */ - stream->in_free = 0; - return fclose(stream->stdiocast); - } - - ret = stream->ops->close(stream, preserve_handle ? 0 : 1 TSRMLS_CC); - stream->abstract = NULL; - - /* tidy up any FILE* that might have been fdopened */ - if (release_cast && stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FDOPEN && stream->stdiocast) { - fclose(stream->stdiocast); - stream->stdiocast = NULL; - stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; - } - } - - if (close_options & PHP_STREAM_FREE_RELEASE_STREAM) { - while (stream->readfilters.head) { - php_stream_filter_remove(stream->readfilters.head, 1 TSRMLS_CC); - } - while (stream->writefilters.head) { - php_stream_filter_remove(stream->writefilters.head, 1 TSRMLS_CC); - } - - if (stream->wrapper && stream->wrapper->wops && stream->wrapper->wops->stream_closer) { - stream->wrapper->wops->stream_closer(stream->wrapper, stream TSRMLS_CC); - stream->wrapper = NULL; - } - - if (stream->wrapperdata) { - zval_ptr_dtor(&stream->wrapperdata); - stream->wrapperdata = NULL; - } - - if (stream->readbuf) { - pefree(stream->readbuf, stream->is_persistent); - stream->readbuf = NULL; - } - - if (stream->is_persistent && (close_options & PHP_STREAM_FREE_PERSISTENT)) { - /* we don't work with *stream but need its value for comparison */ - zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _php_stream_free_persistent, stream TSRMLS_CC); - } -#if ZEND_DEBUG - if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) && (stream->__exposed == 0) && (EG(error_reporting) & E_WARNING)) { - /* it leaked: Lets deliberately NOT pefree it so that the memory manager shows it - * as leaked; it will log a warning, but lets help it out and display what kind - * of stream it was. */ - char *leakinfo; - spprintf(&leakinfo, 0, __FILE__ "(%d) : Stream of type '%s' %p (path:%s) was not closed\n", __LINE__, stream->ops->label, stream, stream->orig_path); - - if (stream->orig_path) { - pefree(stream->orig_path, stream->is_persistent); - stream->orig_path = NULL; - } - -# if defined(PHP_WIN32) - OutputDebugString(leakinfo); -# else - fprintf(stderr, "%s", leakinfo); -# endif - efree(leakinfo); - } else { - if (stream->orig_path) { - pefree(stream->orig_path, stream->is_persistent); - stream->orig_path = NULL; - } - - pefree(stream, stream->is_persistent); - } -#else - if (stream->orig_path) { - pefree(stream->orig_path, stream->is_persistent); - stream->orig_path = NULL; - } - - pefree(stream, stream->is_persistent); -#endif - } - - return ret; -} -/* }}} */ - -/* {{{ generic stream operations */ - -static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC) -{ - /* allocate/fill the buffer */ - - if (stream->readfilters.head) { - char *chunk_buf; - int err_flag = 0; - php_stream_bucket_brigade brig_in = { NULL, NULL }, brig_out = { NULL, NULL }; - php_stream_bucket_brigade *brig_inp = &brig_in, *brig_outp = &brig_out, *brig_swap; - - /* Invalidate the existing cache, otherwise reads can fail, see note in - main/streams/filter.c::_php_stream_filter_append */ - stream->writepos = stream->readpos = 0; - - /* allocate a buffer for reading chunks */ - chunk_buf = emalloc(stream->chunk_size); - - while (!stream->eof && !err_flag && (stream->writepos - stream->readpos < (off_t)size)) { - size_t justread = 0; - int flags; - php_stream_bucket *bucket; - php_stream_filter_status_t status = PSFS_ERR_FATAL; - php_stream_filter *filter; - - /* read a chunk into a bucket */ - justread = stream->ops->read(stream, chunk_buf, stream->chunk_size TSRMLS_CC); - if (justread && justread != (size_t)-1) { - bucket = php_stream_bucket_new(stream, chunk_buf, justread, 0, 0 TSRMLS_CC); - - /* after this call, bucket is owned by the brigade */ - php_stream_bucket_append(brig_inp, bucket TSRMLS_CC); - - flags = PSFS_FLAG_NORMAL; - } else { - flags = stream->eof ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC; - } - - /* wind the handle... */ - for (filter = stream->readfilters.head; filter; filter = filter->next) { - status = filter->fops->filter(stream, filter, brig_inp, brig_outp, NULL, flags TSRMLS_CC); - - if (status != PSFS_PASS_ON) { - break; - } - - /* brig_out becomes brig_in. - * brig_in will always be empty here, as the filter MUST attach any un-consumed buckets - * to its own brigade */ - brig_swap = brig_inp; - brig_inp = brig_outp; - brig_outp = brig_swap; - memset(brig_outp, 0, sizeof(*brig_outp)); - } - - switch (status) { - case PSFS_PASS_ON: - /* we get here when the last filter in the chain has data to pass on. - * in this situation, we are passing the brig_in brigade into the - * stream read buffer */ - while (brig_inp->head) { - bucket = brig_inp->head; - /* grow buffer to hold this bucket - * TODO: this can fail for persistent streams */ - if (stream->readbuflen - stream->writepos < bucket->buflen) { - stream->readbuflen += bucket->buflen; - stream->readbuf = perealloc(stream->readbuf, stream->readbuflen, - stream->is_persistent); - } - memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen); - stream->writepos += bucket->buflen; - - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - break; - - case PSFS_FEED_ME: - /* when a filter needs feeding, there is no brig_out to deal with. - * we simply continue the loop; if the caller needs more data, - * we will read again, otherwise out job is done here */ - if (justread == 0) { - /* there is no data */ - err_flag = 1; - break; - } - continue; - - case PSFS_ERR_FATAL: - /* some fatal error. Theoretically, the stream is borked, so all - * further reads should fail. */ - err_flag = 1; - break; - } - - if (justread == 0 || justread == (size_t)-1) { - break; - } - } - - efree(chunk_buf); - - } else { - /* reduce buffer memory consumption if possible, to avoid a realloc */ - if (stream->readbuf && stream->readbuflen - stream->writepos < stream->chunk_size) { - memmove(stream->readbuf, stream->readbuf + stream->readpos, stream->readbuflen - stream->readpos); - stream->writepos -= stream->readpos; - stream->readpos = 0; - } - /* is there enough data in the buffer ? */ - while (stream->writepos - stream->readpos < (off_t)size) { - size_t justread = 0; - size_t toread; - - /* grow the buffer if required - * TODO: this can fail for persistent streams */ - if (stream->readbuflen - stream->writepos < stream->chunk_size) { - stream->readbuflen += stream->chunk_size; - stream->readbuf = perealloc(stream->readbuf, stream->readbuflen, - stream->is_persistent); - } - - toread = stream->readbuflen - stream->writepos; - justread = stream->ops->read(stream, stream->readbuf + stream->writepos, - toread - TSRMLS_CC); - - if (justread != (size_t)-1) { - stream->writepos += justread; - } - if (stream->eof || justread != toread) { - break; - } - } - } -} - -PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS_DC) -{ - size_t toread = 0, didread = 0; - - while (size > 0) { - - /* take from the read buffer first. - * It is possible that a buffered stream was switched to non-buffered, so we - * drain the remainder of the buffer before using the "raw" read mode for - * the excess */ - if (stream->writepos > stream->readpos) { - - toread = stream->writepos - stream->readpos; - if (toread > size) { - toread = size; - } - - memcpy(buf, stream->readbuf + stream->readpos, toread); - stream->readpos += toread; - size -= toread; - buf += toread; - didread += toread; - } - - /* ignore eof here; the underlying state might have changed */ - if (size == 0) { - break; - } - - if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size == 1)) { - toread = stream->ops->read(stream, buf, size TSRMLS_CC); - } else { - php_stream_fill_read_buffer(stream, size TSRMLS_CC); - - toread = stream->writepos - stream->readpos; - if (toread > size) { - toread = size; - } - - if (toread > 0) { - memcpy(buf, stream->readbuf + stream->readpos, toread); - stream->readpos += toread; - } - } - if (toread > 0) { - didread += toread; - buf += toread; - size -= toread; - } else { - /* EOF, or temporary end of data (for non-blocking mode). */ - break; - } - - /* just break anyway, to avoid greedy read */ - if (stream->wrapper != &php_plain_files_wrapper) { - break; - } - } - - if (didread > 0) { - stream->position += didread; - } - - return didread; -} - -PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC) -{ - /* if there is data in the buffer, it's not EOF */ - if (stream->writepos - stream->readpos > 0) { - return 0; - } - - /* use the configured timeout when checking eof */ - if (!stream->eof && PHP_STREAM_OPTION_RETURN_ERR == - php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS, - 0, NULL)) { - stream->eof = 1; - } - - return stream->eof; -} - -PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC) -{ - unsigned char buf = c; - - if (php_stream_write(stream, &buf, 1) > 0) { - return 1; - } - return EOF; -} - -PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC) -{ - char buf; - - if (php_stream_read(stream, &buf, 1) > 0) { - return buf & 0xff; - } - return EOF; -} - -PHPAPI int _php_stream_puts(php_stream *stream, char *buf TSRMLS_DC) -{ - int len; - char newline[2] = "\n"; /* is this OK for Win? */ - len = strlen(buf); - - if (len > 0 && php_stream_write(stream, buf, len) && php_stream_write(stream, newline, 1)) { - return 1; - } - return 0; -} - -PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - memset(ssb, 0, sizeof(*ssb)); - - /* if the stream was wrapped, allow the wrapper to stat it */ - if (stream->wrapper && stream->wrapper->wops->stream_stat != NULL) { - return stream->wrapper->wops->stream_stat(stream->wrapper, stream, ssb TSRMLS_CC); - } - - /* if the stream doesn't directly support stat-ing, return with failure. - * We could try and emulate this by casting to a FD and fstat-ing it, - * but since the fd might not represent the actual underlying content - * this would give bogus results. */ - if (stream->ops->stat == NULL) { - return -1; - } - - return (stream->ops->stat)(stream, ssb TSRMLS_CC); -} - -PHPAPI char *php_stream_locate_eol(php_stream *stream, char *buf, size_t buf_len TSRMLS_DC) -{ - size_t avail; - char *cr, *lf, *eol = NULL; - char *readptr; - - if (!buf) { - readptr = stream->readbuf + stream->readpos; - avail = stream->writepos - stream->readpos; - } else { - readptr = buf; - avail = buf_len; - } - - /* Look for EOL */ - if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL) { - cr = memchr(readptr, '\r', avail); - lf = memchr(readptr, '\n', avail); - - if (cr && lf != cr + 1 && !(lf && lf < cr)) { - /* mac */ - stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; - stream->flags |= PHP_STREAM_FLAG_EOL_MAC; - eol = cr; - } else if ((cr && lf && cr == lf - 1) || (lf)) { - /* dos or unix endings */ - stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; - eol = lf; - } - } else if (stream->flags & PHP_STREAM_FLAG_EOL_MAC) { - eol = memchr(readptr, '\r', avail); - } else { - /* unix (and dos) line endings */ - eol = memchr(readptr, '\n', avail); - } - - return eol; -} - -/* If buf == NULL, the buffer will be allocated automatically and will be of an - * appropriate length to hold the line, regardless of the line length, memory - * permitting */ -PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, - size_t *returned_len TSRMLS_DC) -{ - size_t avail = 0; - size_t current_buf_size = 0; - size_t total_copied = 0; - int grow_mode = 0; - char *bufstart = buf; - - if (buf == NULL) { - grow_mode = 1; - } else if (maxlen == 0) { - return NULL; - } - - /* - * If the underlying stream operations block when no new data is readable, - * we need to take extra precautions. - * - * If there is buffered data available, we check for a EOL. If it exists, - * we pass the data immediately back to the caller. This saves a call - * to the read implementation and will not block where blocking - * is not necessary at all. - * - * If the stream buffer contains more data than the caller requested, - * we can also avoid that costly step and simply return that data. - */ - - for (;;) { - avail = stream->writepos - stream->readpos; - - if (avail > 0) { - size_t cpysz = 0; - char *readptr; - char *eol; - int done = 0; - - readptr = stream->readbuf + stream->readpos; - eol = php_stream_locate_eol(stream, NULL, 0 TSRMLS_CC); - - if (eol) { - cpysz = eol - readptr + 1; - done = 1; - } else { - cpysz = avail; - } - - if (grow_mode) { - /* allow room for a NUL. If this realloc is really a realloc - * (ie: second time around), we get an extra byte. In most - * cases, with the default chunk size of 8K, we will only - * incur that overhead once. When people have lines longer - * than 8K, we waste 1 byte per additional 8K or so. - * That seems acceptable to me, to avoid making this code - * hard to follow */ - bufstart = erealloc(bufstart, current_buf_size + cpysz + 1); - current_buf_size += cpysz + 1; - buf = bufstart + total_copied; - } else { - if (cpysz >= maxlen - 1) { - cpysz = maxlen - 1; - done = 1; - } - } - - memcpy(buf, readptr, cpysz); - - stream->position += cpysz; - stream->readpos += cpysz; - buf += cpysz; - maxlen -= cpysz; - total_copied += cpysz; - - if (done) { - break; - } - } else if (stream->eof) { - break; - } else { - /* XXX: Should be fine to always read chunk_size */ - size_t toread; - - if (grow_mode) { - toread = stream->chunk_size; - } else { - toread = maxlen - 1; - if (toread > stream->chunk_size) { - toread = stream->chunk_size; - } - } - - php_stream_fill_read_buffer(stream, toread TSRMLS_CC); - - if (stream->writepos - stream->readpos == 0) { - break; - } - } - } - - if (total_copied == 0) { - if (grow_mode) { - assert(bufstart == NULL); - } - return NULL; - } - - buf[0] = '\0'; - if (returned_len) { - *returned_len = total_copied; - } - - return bufstart; -} - -PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, char *delim, size_t delim_len TSRMLS_DC) -{ - char *e, *buf; - size_t toread; - int skip = 0; - - php_stream_fill_read_buffer(stream, maxlen TSRMLS_CC); - - if (delim_len == 0 || !delim) { - toread = maxlen; - } else { - size_t seek_len; - - seek_len = stream->writepos - stream->readpos; - if (seek_len > maxlen) { - seek_len = maxlen; - } - - if (delim_len == 1) { - e = memchr(stream->readbuf + stream->readpos, *delim, seek_len); - } else { - e = php_memnstr(stream->readbuf + stream->readpos, delim, delim_len, (stream->readbuf + stream->readpos + seek_len)); - } - - if (!e) { - if (seek_len < maxlen && !stream->eof) { - return NULL; - } - toread = maxlen; - } else { - toread = e - (char *) stream->readbuf - stream->readpos; - skip = 1; - } - } - - if (toread > maxlen && maxlen > 0) { - toread = maxlen; - } - - buf = emalloc(toread + 1); - *returned_len = php_stream_read(stream, buf, toread); - - if (*returned_len >= 0) { - if (skip) { - stream->readpos += delim_len; - stream->position += delim_len; - } - buf[*returned_len] = '\0'; - return buf; - } else { - efree(buf); - return NULL; - } -} - -/* Writes a buffer directly to a stream, using multiple of the chunk size */ -static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - size_t didwrite = 0, towrite, justwrote; - - /* if we have a seekable stream we need to ensure that data is written at the - * current stream->position. This means invalidating the read buffer and then - * performing a low-level seek */ - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && stream->readpos != stream->writepos) { - stream->readpos = stream->writepos = 0; - - stream->ops->seek(stream, stream->position, SEEK_SET, &stream->position TSRMLS_CC); - } - - - while (count > 0) { - towrite = count; - if (towrite > stream->chunk_size) - towrite = stream->chunk_size; - - justwrote = stream->ops->write(stream, buf, towrite TSRMLS_CC); - - /* convert justwrote to an integer, since normally it is unsigned */ - if ((int)justwrote > 0) { - buf += justwrote; - count -= justwrote; - didwrite += justwrote; - - /* Only screw with the buffer if we can seek, otherwise we lose data - * buffered from fifos and sockets */ - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { - stream->position += justwrote; - } - } else { - break; - } - } - return didwrite; - -} - -/* push some data through the write filter chain. - * buf may be NULL, if flags are set to indicate a flush. - * This may trigger a real write to the stream. - * Returns the number of bytes consumed from buf by the first filter in the chain. - * */ -static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, size_t count, int flags TSRMLS_DC) -{ - size_t consumed = 0; - php_stream_bucket *bucket; - php_stream_bucket_brigade brig_in = { NULL, NULL }, brig_out = { NULL, NULL }; - php_stream_bucket_brigade *brig_inp = &brig_in, *brig_outp = &brig_out, *brig_swap; - php_stream_filter_status_t status = PSFS_ERR_FATAL; - php_stream_filter *filter; - - if (buf) { - bucket = php_stream_bucket_new(stream, (char *)buf, count, 0, 0 TSRMLS_CC); - php_stream_bucket_append(&brig_in, bucket TSRMLS_CC); - } - - for (filter = stream->writefilters.head; filter; filter = filter->next) { - /* for our return value, we are interested in the number of bytes consumed from - * the first filter in the chain */ - status = filter->fops->filter(stream, filter, brig_inp, brig_outp, - filter == stream->writefilters.head ? &consumed : NULL, flags TSRMLS_CC); - - if (status != PSFS_PASS_ON) { - break; - } - /* brig_out becomes brig_in. - * brig_in will always be empty here, as the filter MUST attach any un-consumed buckets - * to its own brigade */ - brig_swap = brig_inp; - brig_inp = brig_outp; - brig_outp = brig_swap; - memset(brig_outp, 0, sizeof(*brig_outp)); - } - - switch (status) { - case PSFS_PASS_ON: - /* filter chain generated some output; push it through to the - * underlying stream */ - while (brig_inp->head) { - bucket = brig_inp->head; - _php_stream_write_buffer(stream, bucket->buf, bucket->buflen TSRMLS_CC); - /* Potential error situation - eg: no space on device. Perhaps we should keep this brigade - * hanging around and try to write it later. - * At the moment, we just drop it on the floor - * */ - - php_stream_bucket_unlink(bucket TSRMLS_CC); - php_stream_bucket_delref(bucket TSRMLS_CC); - } - break; - case PSFS_FEED_ME: - /* need more data before we can push data through to the stream */ - break; - - case PSFS_ERR_FATAL: - /* some fatal error. Theoretically, the stream is borked, so all - * further writes should fail. */ - break; - } - - return consumed; -} - -PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC) -{ - int ret = 0; - - if (stream->writefilters.head) { - _php_stream_write_filtered(stream, NULL, 0, closing ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC TSRMLS_CC); - } - - if (stream->ops->flush) { - ret = stream->ops->flush(stream TSRMLS_CC); - } - - return ret; -} - -PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - if (buf == NULL || count == 0 || stream->ops->write == NULL) { - return 0; - } - - if (stream->writefilters.head) { - return _php_stream_write_filtered(stream, buf, count, PSFS_FLAG_NORMAL TSRMLS_CC); - } else { - return _php_stream_write_buffer(stream, buf, count TSRMLS_CC); - } -} - -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) -{ - size_t count; - char *buf; - va_list ap; - - va_start(ap, fmt); - count = vspprintf(&buf, 0, fmt, ap); - va_end(ap); - - if (!buf) { - return 0; /* error condition */ - } - - count = php_stream_write(stream, buf, count); - efree(buf); - - return count; -} - -PHPAPI off_t _php_stream_tell(php_stream *stream TSRMLS_DC) -{ - return stream->position; -} - -PHPAPI int _php_stream_seek(php_stream *stream, off_t offset, int whence TSRMLS_DC) -{ - /* handle the case where we are in the buffer */ - if ((stream->flags & PHP_STREAM_FLAG_NO_BUFFER) == 0) { - switch(whence) { - case SEEK_CUR: - if (offset > 0 && offset < stream->writepos - stream->readpos) { - stream->readpos += offset; - stream->position += offset; - stream->eof = 0; - return 0; - } - break; - case SEEK_SET: - if (offset > stream->position && - offset < stream->position + stream->writepos - stream->readpos) { - stream->readpos += offset - stream->position; - stream->position = offset; - stream->eof = 0; - return 0; - } - break; - } - } - - - if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { - int ret; - - if (stream->writefilters.head) { - _php_stream_flush(stream, 0 TSRMLS_CC); - } - - switch(whence) { - case SEEK_CUR: - offset = stream->position + offset; - whence = SEEK_SET; - break; - } - ret = stream->ops->seek(stream, offset, whence, &stream->position TSRMLS_CC); - - if (((stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) || ret == 0) { - if (ret == 0) { - stream->eof = 0; - } - - /* invalidate the buffer contents */ - stream->readpos = stream->writepos = 0; - - return ret; - } - /* else the stream has decided that it can't support seeking after all; - * fall through to attempt emulation */ - } - - /* emulate forward moving seeks with reads */ - if (whence == SEEK_CUR && offset > 0) { - char tmp[1024]; - while(offset >= sizeof(tmp)) { - if (php_stream_read(stream, tmp, sizeof(tmp)) == 0) { - return -1; - } - offset -= sizeof(tmp); - } - if (offset && (php_stream_read(stream, tmp, offset) == 0)) { - return -1; - } - stream->eof = 0; - return 0; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream does not support seeking"); - - return -1; -} - -PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) -{ - int ret = PHP_STREAM_OPTION_RETURN_NOTIMPL; - - if (stream->ops->set_option) { - ret = stream->ops->set_option(stream, option, value, ptrparam TSRMLS_CC); - } - - if (ret == PHP_STREAM_OPTION_RETURN_NOTIMPL) { - switch(option) { - case PHP_STREAM_OPTION_SET_CHUNK_SIZE: - ret = stream->chunk_size; - stream->chunk_size = value; - return ret; - - case PHP_STREAM_OPTION_READ_BUFFER: - /* try to match the buffer mode as best we can */ - if (value == PHP_STREAM_BUFFER_NONE) { - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - } else { - stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER; - } - ret = PHP_STREAM_OPTION_RETURN_OK; - break; - - default: - ; - } - } - - return ret; -} - -PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize TSRMLS_DC) -{ - return php_stream_set_option(stream, PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SET_SIZE, &newsize); -} - -PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC TSRMLS_DC) -{ - size_t bcount = 0; - char buf[8192]; - int b; - - if (php_stream_mmap_possible(stream)) { - char *p; - size_t mapped; - - p = php_stream_mmap_range(stream, php_stream_tell(stream), PHP_STREAM_COPY_ALL, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped); - - if (p) { - PHPWRITE(p, mapped); - - php_stream_mmap_unmap(stream); - - return mapped; - } - } - - while ((b = php_stream_read(stream, buf, sizeof(buf))) > 0) { - PHPWRITE(buf, b); - bcount += b; - } - - return bcount; -} - - -PHPAPI size_t _php_stream_copy_to_mem(php_stream *src, char **buf, size_t maxlen, int persistent STREAMS_DC TSRMLS_DC) -{ - size_t ret = 0; - char *ptr; - size_t len = 0, max_len; - int step = CHUNK_SIZE; - int min_room = CHUNK_SIZE / 4; - php_stream_statbuf ssbuf; - - if (maxlen == 0) { - return 0; - } - - if (maxlen == PHP_STREAM_COPY_ALL) { - maxlen = 0; - } - - if (maxlen > 0) { - ptr = *buf = pemalloc_rel_orig(maxlen + 1, persistent); - while ((len < maxlen) && !php_stream_eof(src)) { - ret = php_stream_read(src, ptr, maxlen - len); - len += ret; - ptr += ret; - } - *ptr = '\0'; - return len; - } - - /* avoid many reallocs by allocating a good sized chunk to begin with, if - * we can. Note that the stream may be filtered, in which case the stat - * result may be inaccurate, as the filter may inflate or deflate the - * number of bytes that we can read. In order to avoid an upsize followed - * by a downsize of the buffer, overestimate by the step size (which is - * 2K). */ - if (php_stream_stat(src, &ssbuf) == 0 && ssbuf.sb.st_size > 0) { - max_len = ssbuf.sb.st_size + step; - } else { - max_len = step; - } - - ptr = *buf = pemalloc_rel_orig(max_len, persistent); - - while((ret = php_stream_read(src, ptr, max_len - len))) { - len += ret; - if (len + min_room >= max_len) { - *buf = perealloc_rel_orig(*buf, max_len + step, persistent); - max_len += step; - ptr = *buf + len; - } else { - ptr += ret; - } - } - if (len) { - *buf = perealloc_rel_orig(*buf, len + 1, persistent); - (*buf)[len] = '\0'; - } else { - pefree(*buf, persistent); - *buf = NULL; - } - return len; -} - -PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC) -{ - char buf[CHUNK_SIZE]; - size_t readchunk; - size_t haveread = 0; - size_t didread; - php_stream_statbuf ssbuf; - - if (maxlen == 0) { - return 0; - } - - if (maxlen == PHP_STREAM_COPY_ALL) { - maxlen = 0; - } - - if (php_stream_stat(src, &ssbuf) == 0) { - /* in the event that the source file is 0 bytes, return 1 to indicate success - * because opening the file to write had already created a copy */ - if (ssbuf.sb.st_size == 0 -#ifdef S_ISFIFO - && !S_ISFIFO(ssbuf.sb.st_mode) -#endif -#ifdef S_ISCHR - && !S_ISCHR(ssbuf.sb.st_mode) -#endif - ) { - return 1; - } - } - - if (php_stream_mmap_possible(src)) { - char *p; - size_t mapped; - - p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped); - - if (p) { - mapped = php_stream_write(dest, p, mapped); - - php_stream_mmap_unmap(src); - - return mapped; - } - } - - while(1) { - readchunk = sizeof(buf); - - if (maxlen && (maxlen - haveread) < readchunk) - readchunk = maxlen - haveread; - - didread = php_stream_read(src, buf, readchunk); - - if (didread) { - /* extra paranoid */ - size_t didwrite, towrite; - char *writeptr; - - towrite = didread; - writeptr = buf; - haveread += didread; - - while(towrite) { - didwrite = php_stream_write(dest, writeptr, towrite); - if (didwrite == 0) { - return 0; /* error */ - } - - towrite -= didwrite; - writeptr += didwrite; - } - } else { - return haveread; - } - - if (maxlen - haveread == 0) { - break; - } - } - return haveread; - -} -/* }}} */ - -/* {{{ wrapper init and registration */ - -static void stream_resource_regular_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_stream *stream = (php_stream*)rsrc->ptr; - /* set the return value for pclose */ - FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR); -} - -static void stream_resource_persistent_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_stream *stream = (php_stream*)rsrc->ptr; - FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR); -} - -void php_shutdown_stream_hashes(TSRMLS_D) -{ - if (FG(stream_wrappers)) { - zend_hash_destroy(FG(stream_wrappers)); - efree(FG(stream_wrappers)); - FG(stream_wrappers) = NULL; - } - - if (FG(stream_filters)) { - zend_hash_destroy(FG(stream_filters)); - efree(FG(stream_filters)); - FG(stream_filters) = NULL; - } -} - -int php_init_stream_wrappers(int module_number TSRMLS_DC) -{ - le_stream = zend_register_list_destructors_ex(stream_resource_regular_dtor, NULL, "stream", module_number); - le_pstream = zend_register_list_destructors_ex(NULL, stream_resource_persistent_dtor, "persistent stream", module_number); - - /* Filters are cleaned up by the streams they're attached to */ - le_stream_filter = zend_register_list_destructors_ex(NULL, NULL, "stream filter", module_number); - - return ( - zend_hash_init(&url_stream_wrappers_hash, 0, NULL, NULL, 1) == SUCCESS - && - zend_hash_init(php_get_stream_filters_hash_global(), 0, NULL, NULL, 1) == SUCCESS - && - zend_hash_init(php_stream_xport_get_hash(), 0, NULL, NULL, 1) == SUCCESS - && - php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS - && - php_stream_xport_register("udp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS -#if defined(AF_UNIX) && !(defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE)) - && - php_stream_xport_register("unix", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS - && - php_stream_xport_register("udg", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS -#endif - ) ? SUCCESS : FAILURE; -} - -int php_shutdown_stream_wrappers(int module_number TSRMLS_DC) -{ - zend_hash_destroy(&url_stream_wrappers_hash); - zend_hash_destroy(php_get_stream_filters_hash_global()); - zend_hash_destroy(php_stream_xport_get_hash()); - return SUCCESS; -} - -/* Validate protocol scheme names during registration - * Must conform to /^[a-zA-Z0-9+.-]+$/ - */ -static inline int php_stream_wrapper_scheme_validate(char *protocol, int protocol_len) -{ - int i; - - for(i = 0; i < protocol_len; i++) { - if (!isalnum((int)protocol[i]) && - protocol[i] != '+' && - protocol[i] != '-' && - protocol[i] != '.') { - return FAILURE; - } - } - - return SUCCESS; -} - -/* API for registering GLOBAL wrappers */ -PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) -{ - int protocol_len = strlen(protocol); - - if (php_stream_wrapper_scheme_validate(protocol, protocol_len) == FAILURE) { - return FAILURE; - } - - return zend_hash_add(&url_stream_wrappers_hash, protocol, protocol_len + 1, &wrapper, sizeof(wrapper), NULL); -} - -PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC) -{ - return zend_hash_del(&url_stream_wrappers_hash, protocol, strlen(protocol) + 1); -} - -static void clone_wrapper_hash(TSRMLS_D) -{ - php_stream_wrapper *tmp; - - ALLOC_HASHTABLE(FG(stream_wrappers)); - zend_hash_init(FG(stream_wrappers), zend_hash_num_elements(&url_stream_wrappers_hash), NULL, NULL, 1); - zend_hash_copy(FG(stream_wrappers), &url_stream_wrappers_hash, NULL, &tmp, sizeof(tmp)); -} - -/* API for registering VOLATILE wrappers */ -PHPAPI int php_register_url_stream_wrapper_volatile(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC) -{ - int protocol_len = strlen(protocol); - - if (php_stream_wrapper_scheme_validate(protocol, protocol_len) == FAILURE) { - return FAILURE; - } - - if (!FG(stream_wrappers)) { - clone_wrapper_hash(TSRMLS_C); - } - - return zend_hash_add(FG(stream_wrappers), protocol, protocol_len + 1, &wrapper, sizeof(wrapper), NULL); -} - -PHPAPI int php_unregister_url_stream_wrapper_volatile(char *protocol TSRMLS_DC) -{ - if (!FG(stream_wrappers)) { - clone_wrapper_hash(TSRMLS_C); - } - - return zend_hash_del(FG(stream_wrappers), protocol, strlen(protocol) + 1); -} -/* }}} */ - -/* {{{ php_stream_locate_url_wrapper */ -PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char **path_for_open, int options TSRMLS_DC) -{ - HashTable *wrapper_hash = (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash); - php_stream_wrapper **wrapperpp = NULL; - const char *p, *protocol = NULL; - int n = 0; - - if (path_for_open) { - *path_for_open = (char*)path; - } - - if (options & IGNORE_URL) { - return (options & STREAM_LOCATE_WRAPPERS_ONLY) ? NULL : &php_plain_files_wrapper; - } - - for (p = path; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) { - n++; - } - - if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || (n == 4 && !memcmp("data:", path, 5)))) { - protocol = path; - } else if (n == 5 && strncasecmp(path, "zlib:", 5) == 0) { - /* BC with older php scripts and zlib wrapper */ - protocol = "compress.zlib"; - n = 13; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead."); - } - - if (protocol) { - char *tmp = estrndup(protocol, n); - if (FAILURE == zend_hash_find(wrapper_hash, (char*)tmp, n + 1, (void**)&wrapperpp)) { - php_strtolower(tmp, n); - if (FAILURE == zend_hash_find(wrapper_hash, (char*)tmp, n + 1, (void**)&wrapperpp)) { - char wrapper_name[32]; - - if (n >= sizeof(wrapper_name)) { - n = sizeof(wrapper_name) - 1; - } - PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n); - - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?", wrapper_name); - - wrapperpp = NULL; - protocol = NULL; - } - } - efree(tmp); - } - /* TODO: curl based streams probably support file:// properly */ - if (!protocol || !strncasecmp(protocol, "file", n)) { - if (protocol) { - int localhost = 0; - - if (!strncasecmp(path, "file://localhost/", 17)) { - localhost = 1; - } - -#ifdef PHP_WIN32 - if (localhost == 0 && path[n+3] != '\0' && path[n+3] != '/' && path[n+4] != ':') { -#else - if (localhost == 0 && path[n+3] != '\0' && path[n+3] != '/') { -#endif - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "remote host file access not supported, %s", path); - } - return NULL; - } - - if (path_for_open) { - /* skip past protocol and :/, but handle windows correctly */ - *path_for_open = (char*)path + n + 1; - if (localhost == 1) { - (*path_for_open) += 11; - } - while (*(++*path_for_open)=='/'); -#ifdef PHP_WIN32 - if (*(*path_for_open + 1) != ':') -#endif - (*path_for_open)--; - } - } - - if (options & STREAM_LOCATE_WRAPPERS_ONLY) { - return NULL; - } - - if (FG(stream_wrappers)) { - /* The file:// wrapper may have been disabled/overridden */ - - if (wrapperpp) { - /* It was found so go ahead and provide it */ - return *wrapperpp; - } - - /* Check again, the original check might have not known the protocol name */ - if (zend_hash_find(wrapper_hash, "file", sizeof("file"), (void**)&wrapperpp) == SUCCESS) { - return *wrapperpp; - } - - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Plainfiles wrapper disabled"); - } - return NULL; - } - - /* fall back on regular file access */ - return &php_plain_files_wrapper; - } - - if (wrapperpp && (*wrapperpp)->is_url && - (options & STREAM_DISABLE_URL_PROTECTION) == 0 && - (!PG(allow_url_fopen) || - (((options & STREAM_OPEN_FOR_INCLUDE) || - PG(in_user_include)) && !PG(allow_url_include)))) { - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration"); - } - return NULL; - } - - return *wrapperpp; -} -/* }}} */ - -/* {{{ _php_stream_mkdir - */ -PHPAPI int _php_stream_mkdir(char *path, int mode, int options, php_stream_context *context TSRMLS_DC) -{ - php_stream_wrapper *wrapper = NULL; - - wrapper = php_stream_locate_url_wrapper(path, NULL, ENFORCE_SAFE_MODE TSRMLS_CC); - if (!wrapper || !wrapper->wops || !wrapper->wops->stream_mkdir) { - return 0; - } - - return wrapper->wops->stream_mkdir(wrapper, path, mode, options, context TSRMLS_CC); -} -/* }}} */ - -/* {{{ _php_stream_rmdir - */ -PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *context TSRMLS_DC) -{ - php_stream_wrapper *wrapper = NULL; - - wrapper = php_stream_locate_url_wrapper(path, NULL, ENFORCE_SAFE_MODE TSRMLS_CC); - if (!wrapper || !wrapper->wops || !wrapper->wops->stream_rmdir) { - return 0; - } - - return wrapper->wops->stream_rmdir(wrapper, path, options, context TSRMLS_CC); -} -/* }}} */ - -/* {{{ _php_stream_stat_path */ -PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) -{ - php_stream_wrapper *wrapper = NULL; - char *path_to_open = path; - int ret; - - /* Try to hit the cache first */ - if (flags & PHP_STREAM_URL_STAT_LINK) { - if (BG(CurrentLStatFile) && strcmp(path, BG(CurrentLStatFile)) == 0) { - memcpy(ssb, &BG(lssb), sizeof(php_stream_statbuf)); - return 0; - } - } else { - if (BG(CurrentStatFile) && strcmp(path, BG(CurrentStatFile)) == 0) { - memcpy(ssb, &BG(ssb), sizeof(php_stream_statbuf)); - return 0; - } - } - - wrapper = php_stream_locate_url_wrapper(path, &path_to_open, ENFORCE_SAFE_MODE TSRMLS_CC); - if (wrapper && wrapper->wops->url_stat) { - ret = wrapper->wops->url_stat(wrapper, path_to_open, flags, ssb, context TSRMLS_CC); - if (ret == 0) { - /* Drop into cache */ - if (flags & PHP_STREAM_URL_STAT_LINK) { - if (BG(CurrentLStatFile)) { - efree(BG(CurrentLStatFile)); - } - BG(CurrentLStatFile) = estrdup(path); - memcpy(&BG(lssb), ssb, sizeof(php_stream_statbuf)); - } else { - if (BG(CurrentStatFile)) { - efree(BG(CurrentStatFile)); - } - BG(CurrentStatFile) = estrdup(path); - memcpy(&BG(ssb), ssb, sizeof(php_stream_statbuf)); - } - } - return ret; - } - return -1; -} -/* }}} */ - -/* {{{ php_stream_opendir */ -PHPAPI php_stream *_php_stream_opendir(char *path, int options, - php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = NULL; - php_stream_wrapper *wrapper = NULL; - char *path_to_open; - - if (!path || !*path) { - return NULL; - } - - path_to_open = path; - - wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options TSRMLS_CC); - - if (wrapper && wrapper->wops->dir_opener) { - stream = wrapper->wops->dir_opener(wrapper, - path_to_open, "r", options ^ REPORT_ERRORS, NULL, - context STREAMS_REL_CC TSRMLS_CC); - - if (stream) { - stream->wrapper = wrapper; - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER | PHP_STREAM_FLAG_IS_DIR; - } - } else if (wrapper) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, "not implemented"); - } - if (stream == NULL && (options & REPORT_ERRORS)) { - php_stream_display_wrapper_errors(wrapper, path, "failed to open dir" TSRMLS_CC); - } - php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC); - - return stream; -} -/* }}} */ - -/* {{{ _php_stream_readdir */ -PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC) -{ - - if (sizeof(php_stream_dirent) == php_stream_read(dirstream, (char*)ent, sizeof(php_stream_dirent))) { - return ent; - } - - return NULL; -} -/* }}} */ - -/* {{{ php_stream_open_wrapper_ex */ -PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = NULL; - php_stream_wrapper *wrapper = NULL; - char *path_to_open; - int persistent = options & STREAM_OPEN_PERSISTENT; - char *copy_of_path = NULL; - - - if (opened_path) { - *opened_path = NULL; - } - - if (!path || !*path) { - return NULL; - } - - path_to_open = path; - - wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options TSRMLS_CC); - if (options & STREAM_USE_URL && (!wrapper || !wrapper->is_url)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function may only be used against URLs."); - return NULL; - } - - if (wrapper) { - if (!wrapper->wops->stream_opener) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, - "wrapper does not support stream open"); - } else { - stream = wrapper->wops->stream_opener(wrapper, - path_to_open, mode, options ^ REPORT_ERRORS, - opened_path, context STREAMS_REL_CC TSRMLS_CC); - } - - /* if the caller asked for a persistent stream but the wrapper did not - * return one, force an error here */ - if (stream && (options & STREAM_OPEN_PERSISTENT) && !stream->is_persistent) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, - "wrapper does not support persistent streams"); - php_stream_close(stream); - stream = NULL; - } - - if (stream) { - stream->wrapper = wrapper; - } - } - - if (stream) { - if (stream->orig_path) { - pefree(stream->orig_path, persistent); - } - copy_of_path = pestrdup(path, persistent); - stream->orig_path = copy_of_path; - } - - if (stream != NULL && (options & STREAM_MUST_SEEK)) { - php_stream *newstream; - - switch(php_stream_make_seekable_rel(stream, &newstream, - (options & STREAM_WILL_CAST) - ? PHP_STREAM_PREFER_STDIO : PHP_STREAM_NO_PREFERENCE)) { - case PHP_STREAM_UNCHANGED: - return stream; - case PHP_STREAM_RELEASED: - if (newstream->orig_path) { - pefree(newstream->orig_path, persistent); - } - newstream->orig_path = pestrdup(path, persistent); - return newstream; - default: - php_stream_close(stream); - stream = NULL; - if (options & REPORT_ERRORS) { - char *tmp = estrdup(path); - php_strip_url_passwd(tmp); - php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "could not make seekable - %s", - tmp); - efree(tmp); - - options ^= REPORT_ERRORS; - } - } - } - - if (stream && stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && strchr(mode, 'a') && stream->position == 0) { - off_t newpos = 0; - - /* if opened for append, we need to revise our idea of the initial file position */ - if (0 == stream->ops->seek(stream, 0, SEEK_CUR, &newpos TSRMLS_CC)) { - stream->position = newpos; - } - } - - if (stream == NULL && (options & REPORT_ERRORS)) { - php_stream_display_wrapper_errors(wrapper, path, "failed to open stream" TSRMLS_CC); - if (opened_path && *opened_path) { - efree(*opened_path); - *opened_path = NULL; - } - } - php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC); -#if ZEND_DEBUG - if (stream == NULL && copy_of_path != NULL) { - pefree(copy_of_path, persistent); - } -#endif - return stream; -} -/* }}} */ - -/* {{{ context API */ -PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context) -{ - php_stream_context *oldcontext = stream->context; - stream->context = context; - return oldcontext; -} - -PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, - char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC) -{ - if (context && context->notifier) - context->notifier->func(context, notifycode, severity, xmsg, xcode, bytes_sofar, bytes_max, ptr TSRMLS_CC); -} - -PHPAPI void php_stream_context_free(php_stream_context *context) -{ - if (context->options) { - zval_ptr_dtor(&context->options); - context->options = NULL; - } - if (context->notifier) { - php_stream_notification_free(context->notifier); - context->notifier = NULL; - } - if (context->links) { - zval_ptr_dtor(&context->links); - context->links = NULL; - } - efree(context); -} - -PHPAPI php_stream_context *php_stream_context_alloc(void) -{ - php_stream_context *context; - - context = ecalloc(1, sizeof(php_stream_context)); - context->notifier = NULL; - MAKE_STD_ZVAL(context->options); - array_init(context->options); - - context->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context()); - return context; -} - -PHPAPI php_stream_notifier *php_stream_notification_alloc(void) -{ - return ecalloc(1, sizeof(php_stream_notifier)); -} - -PHPAPI void php_stream_notification_free(php_stream_notifier *notifier) -{ - if (notifier->dtor) { - notifier->dtor(notifier); - } - efree(notifier); -} - -PHPAPI int php_stream_context_get_option(php_stream_context *context, - const char *wrappername, const char *optionname, zval ***optionvalue) -{ - zval **wrapperhash; - - if (FAILURE == zend_hash_find(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&wrapperhash)) { - return FAILURE; - } - return zend_hash_find(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)optionvalue); -} - -PHPAPI int php_stream_context_set_option(php_stream_context *context, - const char *wrappername, const char *optionname, zval *optionvalue) -{ - zval **wrapperhash; - zval *category, *copied_val; - - ALLOC_INIT_ZVAL(copied_val); - *copied_val = *optionvalue; - zval_copy_ctor(copied_val); - INIT_PZVAL(copied_val); - - if (FAILURE == zend_hash_find(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&wrapperhash)) { - MAKE_STD_ZVAL(category); - array_init(category); - if (FAILURE == zend_hash_update(Z_ARRVAL_P(context->options), (char*)wrappername, strlen(wrappername)+1, (void**)&category, sizeof(zval *), NULL)) { - return FAILURE; - } - - wrapperhash = &category; - } - return zend_hash_update(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)&copied_val, sizeof(zval *), NULL); -} - -PHPAPI int php_stream_context_get_link(php_stream_context *context, - const char *hostent, php_stream **stream) -{ - php_stream **pstream; - - if (!stream || !hostent || !context || !(context->links)) { - return FAILURE; - } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1, (void**)&pstream)) { - *stream = *pstream; - return SUCCESS; - } - return FAILURE; -} - -PHPAPI int php_stream_context_set_link(php_stream_context *context, - const char *hostent, php_stream *stream) -{ - if (!context) { - return FAILURE; - } - if (!context->links) { - ALLOC_INIT_ZVAL(context->links); - array_init(context->links); - } - if (!stream) { - /* Delete any entry for */ - return zend_hash_del(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1); - } - return zend_hash_update(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1, (void**)&stream, sizeof(php_stream *), NULL); -} - -PHPAPI int php_stream_context_del_link(php_stream_context *context, - php_stream *stream) -{ - php_stream **pstream; - char *hostent; - int ret = SUCCESS; - - if (!context || !context->links || !stream) { - return FAILURE; - } - - for(zend_hash_internal_pointer_reset(Z_ARRVAL_P(context->links)); - SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(context->links), (void**)&pstream); - zend_hash_move_forward(Z_ARRVAL_P(context->links))) { - if (*pstream == stream) { - if (SUCCESS == zend_hash_get_current_key(Z_ARRVAL_P(context->links), &hostent, NULL, 0)) { - if (FAILURE == zend_hash_del(Z_ARRVAL_P(context->links), (char*)hostent, strlen(hostent)+1)) { - ret = FAILURE; - } - } else { - ret = FAILURE; - } - } - } - - return ret; -} -/* }}} */ - -/* {{{ php_stream_dirent_alphasort - */ -PHPAPI int php_stream_dirent_alphasort(const char **a, const char **b) -{ - return strcoll(*a, *b); -} -/* }}} */ - -/* {{{ php_stream_dirent_alphasortr - */ -PHPAPI int php_stream_dirent_alphasortr(const char **a, const char **b) -{ - return strcoll(*b, *a); -} -/* }}} */ - -/* {{{ php_stream_scandir - */ -PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_stream_context *context, - int (*compare) (const char **a, const char **b) TSRMLS_DC) -{ - php_stream *stream; - php_stream_dirent sdp; - char **vector = NULL; - int vector_size = 0; - int nfiles = 0; - - if (!namelist) { - return FAILURE; - } - - stream = php_stream_opendir(dirname, ENFORCE_SAFE_MODE | REPORT_ERRORS, context); - if (!stream) { - return FAILURE; - } - - while (php_stream_readdir(stream, &sdp)) { - if (nfiles == vector_size) { - if (vector_size == 0) { - vector_size = 10; - } else { - vector_size *= 2; - } - vector = (char **) erealloc(vector, vector_size * sizeof(char *)); - } - - vector[nfiles] = estrdup(sdp.d_name); - - nfiles++; - } - php_stream_closedir(stream); - - *namelist = vector; - - if (compare) { - qsort(*namelist, nfiles, sizeof(char *), (int(*)(const void *, const void *))compare); - } - return nfiles; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/transports.c b/main/streams/transports.c deleted file mode 100644 index 56b326e7c7f35..0000000000000 --- a/main/streams/transports.c +++ /dev/null @@ -1,519 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_streams_int.h" -#include "ext/standard/file.h" - -static HashTable xport_hash; - -PHPAPI HashTable *php_stream_xport_get_hash(void) -{ - return &xport_hash; -} - -PHPAPI int php_stream_xport_register(char *protocol, php_stream_transport_factory factory TSRMLS_DC) -{ - return zend_hash_update(&xport_hash, protocol, strlen(protocol) + 1, &factory, sizeof(factory), NULL); -} - -PHPAPI int php_stream_xport_unregister(char *protocol TSRMLS_DC) -{ - return zend_hash_del(&xport_hash, protocol, strlen(protocol) + 1); -} - -#define ERR_REPORT(out_err, fmt, arg) \ - if (out_err) { spprintf(out_err, 0, fmt, arg); } \ - else { php_error_docref(NULL TSRMLS_CC, E_WARNING, fmt, arg); } - -#define ERR_RETURN(out_err, local_err, fmt) \ - if (out_err) { *out_err = local_err; } \ - else { php_error_docref(NULL TSRMLS_CC, E_WARNING, fmt, local_err ? local_err : "Unspecified error"); \ - if (local_err) { efree(local_err); local_err = NULL; } \ - } - -PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int options, - int flags, const char *persistent_id, - struct timeval *timeout, - php_stream_context *context, - char **error_string, - int *error_code - STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = NULL; - php_stream_transport_factory *factory = NULL; - const char *p, *protocol = NULL; - int n = 0, failed = 0; - char *error_text = NULL; - struct timeval default_timeout = { 0, 0 }; - - default_timeout.tv_sec = FG(default_socket_timeout); - - if (timeout == NULL) { - timeout = &default_timeout; - } - - /* check for a cached persistent socket */ - if (persistent_id) { - switch(php_stream_from_persistent_id(persistent_id, &stream TSRMLS_CC)) { - case PHP_STREAM_PERSISTENT_SUCCESS: - /* use a 0 second timeout when checking if the socket - * has already died */ - if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS, 0, NULL)) { - return stream; - } - /* dead - kill it */ - php_stream_pclose(stream); - stream = NULL; - - /* fall through */ - - case PHP_STREAM_PERSISTENT_FAILURE: - default: - /* failed; get a new one */ - ; - } - } - - for (p = name; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) { - n++; - } - - if ((*p == ':') && (n > 1) && !strncmp("://", p, 3)) { - protocol = name; - name = p + 3; - namelen -= n + 3; - } else { - protocol = "tcp"; - n = 3; - } - - if (protocol) { - char *tmp = estrndup(protocol, n); - if (FAILURE == zend_hash_find(&xport_hash, (char*)tmp, n + 1, (void**)&factory)) { - char wrapper_name[32]; - - if (n >= sizeof(wrapper_name)) - n = sizeof(wrapper_name) - 1; - PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n); - - ERR_REPORT(error_string, "Unable to find the socket transport \"%s\" - did you forget to enable it when you configured PHP?", - wrapper_name); - - efree(tmp); - return NULL; - } - efree(tmp); - } - - if (factory == NULL) { - /* should never happen */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find a factory !?"); - return NULL; - } - - stream = (*factory)(protocol, n, - (char*)name, namelen, persistent_id, options, flags, timeout, - context STREAMS_REL_CC TSRMLS_CC); - - if (stream) { - stream->context = context; - - if ((flags & STREAM_XPORT_SERVER) == 0) { - /* client */ - - if (flags & (STREAM_XPORT_CONNECT|STREAM_XPORT_CONNECT_ASYNC)) { - if (-1 == php_stream_xport_connect(stream, name, namelen, - flags & STREAM_XPORT_CONNECT_ASYNC ? 1 : 0, - timeout, &error_text, error_code TSRMLS_CC)) { - - ERR_RETURN(error_string, error_text, "connect() failed: %s"); - - failed = 1; - } - } - - } else { - /* server */ - if (flags & STREAM_XPORT_BIND) { - if (0 != php_stream_xport_bind(stream, name, namelen, &error_text TSRMLS_CC)) { - ERR_RETURN(error_string, error_text, "bind() failed: %s"); - failed = 1; - } else if (flags & STREAM_XPORT_LISTEN) { - if (0 != php_stream_xport_listen(stream, 5, &error_text TSRMLS_CC)) { - ERR_RETURN(error_string, error_text, "listen() failed: %s"); - failed = 1; - } - } - } - } - } - - if (failed) { - /* failure means that they don't get a stream to play with */ - if (persistent_id) { - php_stream_pclose(stream); - } else { - php_stream_close(stream); - } - stream = NULL; - } - - return stream; -} - -/* Bind the stream to a local address */ -PHPAPI int php_stream_xport_bind(php_stream *stream, - const char *name, long namelen, - char **error_text - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = STREAM_XPORT_OP_BIND; - param.inputs.name = (char*)name; - param.inputs.namelen = namelen; - param.want_errortext = error_text ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (error_text) { - *error_text = param.outputs.error_text; - } - - return param.outputs.returncode; - } - - return ret; -} - -/* Connect to a remote address */ -PHPAPI int php_stream_xport_connect(php_stream *stream, - const char *name, long namelen, - int asynchronous, - struct timeval *timeout, - char **error_text, - int *error_code - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = asynchronous ? STREAM_XPORT_OP_CONNECT_ASYNC: STREAM_XPORT_OP_CONNECT; - param.inputs.name = (char*)name; - param.inputs.namelen = namelen; - param.inputs.timeout = timeout; - - param.want_errortext = error_text ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (error_text) { - *error_text = param.outputs.error_text; - } - if (error_code) { - *error_code = param.outputs.error_code; - } - return param.outputs.returncode; - } - - return ret; - -} - -/* Prepare to listen */ -PHPAPI int php_stream_xport_listen(php_stream *stream, int backlog, char **error_text TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = STREAM_XPORT_OP_LISTEN; - param.inputs.backlog = backlog; - param.want_errortext = error_text ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (error_text) { - *error_text = param.outputs.error_text; - } - - return param.outputs.returncode; - } - - return ret; -} - -/* Get the next client and their address (as a string) */ -PHPAPI int php_stream_xport_accept(php_stream *stream, php_stream **client, - char **textaddr, int *textaddrlen, - void **addr, socklen_t *addrlen, - struct timeval *timeout, - char **error_text - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - - param.op = STREAM_XPORT_OP_ACCEPT; - param.inputs.timeout = timeout; - param.want_addr = addr ? 1 : 0; - param.want_textaddr = textaddr ? 1 : 0; - param.want_errortext = error_text ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - *client = param.outputs.client; - if (addr) { - *addr = param.outputs.addr; - *addrlen = param.outputs.addrlen; - } - if (textaddr) { - *textaddr = param.outputs.textaddr; - *textaddrlen = param.outputs.textaddrlen; - } - if (error_text) { - *error_text = param.outputs.error_text; - } - - return param.outputs.returncode; - } - return ret; -} - -PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer, - char **textaddr, int *textaddrlen, - void **addr, socklen_t *addrlen - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - - param.op = want_peer ? STREAM_XPORT_OP_GET_PEER_NAME : STREAM_XPORT_OP_GET_NAME; - param.want_addr = addr ? 1 : 0; - param.want_textaddr = textaddr ? 1 : 0; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (addr) { - *addr = param.outputs.addr; - *addrlen = param.outputs.addrlen; - } - if (textaddr) { - *textaddr = param.outputs.textaddr; - *textaddrlen = param.outputs.textaddrlen; - } - - return param.outputs.returncode; - } - return ret; -} - -PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC) -{ - php_stream_xport_crypto_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = STREAM_XPORT_CRYPTO_OP_SETUP; - param.inputs.method = crypto_method; - param.inputs.session = session_stream; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_CRYPTO_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - return param.outputs.returncode; - } - - php_error_docref("streams.crypto" TSRMLS_CC, E_WARNING, "this stream does not support SSL/crypto"); - - return ret; -} - -PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC) -{ - php_stream_xport_crypto_param param; - int ret; - - memset(¶m, 0, sizeof(param)); - param.op = STREAM_XPORT_CRYPTO_OP_ENABLE; - param.inputs.activate = activate; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_CRYPTO_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - return param.outputs.returncode; - } - - php_error_docref("streams.crypto" TSRMLS_CC, E_WARNING, "this stream does not support SSL/crypto"); - - return ret; -} - -/* Similar to recv() system call; read data from the stream, optionally - * peeking, optionally retrieving OOB data */ -PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t buflen, - long flags, void **addr, socklen_t *addrlen, char **textaddr, int *textaddrlen - TSRMLS_DC) -{ - php_stream_xport_param param; - int ret = 0; - int recvd_len = 0; -#if 0 - int oob; - - if (flags == 0 && addr == NULL) { - return php_stream_read(stream, buf, buflen); - } - - if (stream->readfilters.head) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot peek or fetch OOB data from a filtered stream"); - return -1; - } - - oob = (flags & STREAM_OOB) == STREAM_OOB; - - if (!oob && addr == NULL) { - /* must be peeking at regular data; copy content from the buffer - * first, then adjust the pointer/len before handing off to the - * stream */ - recvd_len = stream->writepos - stream->readpos; - if (recvd_len > buflen) { - recvd_len = buflen; - } - if (recvd_len) { - memcpy(buf, stream->readbuf, recvd_len); - buf += recvd_len; - buflen -= recvd_len; - } - /* if we filled their buffer, return */ - if (buflen == 0) { - return recvd_len; - } - } -#endif - - /* otherwise, we are going to bypass the buffer */ - - memset(¶m, 0, sizeof(param)); - - param.op = STREAM_XPORT_OP_RECV; - param.want_addr = addr ? 1 : 0; - param.want_textaddr = textaddr ? 1 : 0; - param.inputs.buf = buf; - param.inputs.buflen = buflen; - param.inputs.flags = flags; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - if (addr) { - *addr = param.outputs.addr; - *addrlen = param.outputs.addrlen; - } - if (textaddr) { - *textaddr = param.outputs.textaddr; - *textaddrlen = param.outputs.textaddrlen; - } - return recvd_len + param.outputs.returncode; - } - return recvd_len ? recvd_len : -1; -} - -/* Similar to send() system call; send data to the stream, optionally - * sending it as OOB data */ -PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen, - long flags, void *addr, socklen_t addrlen TSRMLS_DC) -{ - php_stream_xport_param param; - int ret = 0; - int oob; - -#if 0 - if (flags == 0 && addr == NULL) { - return php_stream_write(stream, buf, buflen); - } -#endif - - oob = (flags & STREAM_OOB) == STREAM_OOB; - - if ((oob || addr) && stream->writefilters.head) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write OOB data, or data to a targeted address on a filtered stream"); - return -1; - } - - memset(¶m, 0, sizeof(param)); - - param.op = STREAM_XPORT_OP_SEND; - param.want_addr = addr ? 1 : 0; - param.inputs.buf = (char*)buf; - param.inputs.buflen = buflen; - param.inputs.flags = flags; - param.inputs.addr = addr; - param.inputs.addrlen = addrlen; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - return param.outputs.returncode; - } - return -1; -} - -/* Similar to shutdown() system call; shut down part of a full-duplex - * connection */ -PHPAPI int php_stream_xport_shutdown(php_stream *stream, stream_shutdown_t how TSRMLS_DC) -{ - php_stream_xport_param param; - int ret = 0; - - memset(¶m, 0, sizeof(param)); - - param.op = STREAM_XPORT_OP_SHUTDOWN; - param.how = how; - - ret = php_stream_set_option(stream, PHP_STREAM_OPTION_XPORT_API, 0, ¶m); - - if (ret == PHP_STREAM_OPTION_RETURN_OK) { - return param.outputs.returncode; - } - return -1; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/streams/userspace.c b/main/streams/userspace.c deleted file mode 100644 index 1cc064cb71670..0000000000000 --- a/main/streams/userspace.c +++ /dev/null @@ -1,1404 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Wez Furlong | - | Sara Golemon | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/file.h" -#include "ext/standard/flock_compat.h" -#ifdef HAVE_SYS_FILE_H -#include -#endif - -static int le_protocols; - -struct php_user_stream_wrapper { - char * protoname; - char * classname; - zend_class_entry *ce; - php_stream_wrapper wrapper; -}; - -static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -static int user_wrapper_stat_url(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC); -static int user_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_mkdir(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC); -static int user_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); -static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); - -static php_stream_wrapper_ops user_stream_wops = { - user_wrapper_opener, - NULL, /* close - the streams themselves know how */ - NULL, /* stat - the streams themselves know how */ - user_wrapper_stat_url, - user_wrapper_opendir, - "user-space", - user_wrapper_unlink, - user_wrapper_rename, - user_wrapper_mkdir, - user_wrapper_rmdir -}; - - -static void stream_wrapper_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - struct php_user_stream_wrapper * uwrap = (struct php_user_stream_wrapper*)rsrc->ptr; - - efree(uwrap->protoname); - efree(uwrap->classname); - efree(uwrap); -} - - -PHP_MINIT_FUNCTION(user_streams) -{ - le_protocols = zend_register_list_destructors_ex(stream_wrapper_dtor, NULL, "stream factory", 0); - if (le_protocols == FAILURE) - return FAILURE; - - REGISTER_LONG_CONSTANT("STREAM_USE_PATH", USE_PATH, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_IGNORE_URL", IGNORE_URL, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_ENFORCE_SAFE_MODE", ENFORCE_SAFE_MODE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_REPORT_ERRORS", REPORT_ERRORS, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_MUST_SEEK", STREAM_MUST_SEEK, CONST_CS|CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("STREAM_URL_STAT_LINK", PHP_STREAM_URL_STAT_LINK, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_URL_STAT_QUIET", PHP_STREAM_URL_STAT_QUIET, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("STREAM_MKDIR_RECURSIVE", PHP_STREAM_MKDIR_RECURSIVE, CONST_CS|CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("STREAM_IS_URL", PHP_STREAM_IS_URL, CONST_CS|CONST_PERSISTENT); - return SUCCESS; -} - -struct _php_userstream_data { - struct php_user_stream_wrapper * wrapper; - zval * object; -}; -typedef struct _php_userstream_data php_userstream_data_t; - -/* names of methods */ -#define USERSTREAM_OPEN "stream_open" -#define USERSTREAM_CLOSE "stream_close" -#define USERSTREAM_READ "stream_read" -#define USERSTREAM_WRITE "stream_write" -#define USERSTREAM_FLUSH "stream_flush" -#define USERSTREAM_SEEK "stream_seek" -#define USERSTREAM_TELL "stream_tell" -#define USERSTREAM_EOF "stream_eof" -#define USERSTREAM_STAT "stream_stat" -#define USERSTREAM_STATURL "url_stat" -#define USERSTREAM_UNLINK "unlink" -#define USERSTREAM_RENAME "rename" -#define USERSTREAM_MKDIR "mkdir" -#define USERSTREAM_RMDIR "rmdir" -#define USERSTREAM_DIR_OPEN "dir_opendir" -#define USERSTREAM_DIR_READ "dir_readdir" -#define USERSTREAM_DIR_REWIND "dir_rewinddir" -#define USERSTREAM_DIR_CLOSE "dir_closedir" -#define USERSTREAM_LOCK "stream_lock" - -/* {{{ class should have methods like these: - - function stream_open($path, $mode, $options, &$opened_path) - { - return true/false; - } - - function stream_read($count) - { - return false on error; - else return string; - } - - function stream_write($data) - { - return false on error; - else return count written; - } - - function stream_close() - { - } - - function stream_flush() - { - return true/false; - } - - function stream_seek($offset, $whence) - { - return true/false; - } - - function stream_tell() - { - return (int)$position; - } - - function stream_eof() - { - return true/false; - } - - function stream_stat() - { - return array( just like that returned by fstat() ); - } - - function url_stat(string $url, int $flags) - { - return array( just like that returned by stat() ); - } - - function unlink(string $url) - { - return true / false; - } - - function rename(string $from, string $to) - { - return true / false; - } - - function mkdir($dir, $mode, $options) - { - return true / false; - } - - function rmdir($dir, $options) - { - return true / false; - } - - function dir_opendir(string $url, int $options) - { - return true / false; - } - - function dir_readdir() - { - return string next filename in dir ; - } - - function dir_closedir() - { - release dir related resources; - } - - function dir_rewinddir() - { - reset to start of dir list; - } - - }}} **/ - -static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - php_userstream_data_t *us; - zval *zfilename, *zmode, *zopened, *zoptions, *zretval = NULL, *zfuncname; - zval **args[4]; - int call_result; - php_stream *stream = NULL; - zval *zcontext = NULL; - zend_bool old_in_user_include; - - /* Try to catch bad usage without preventing flexibility */ - if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); - return NULL; - } - FG(user_stream_current_filename) = filename; - - /* if the user stream was registered as local and we are in include context, - we add allow_url_include restrictions to allow_url_fopen ones */ - /* we need only is_url == 0 here since if is_url == 1 and remote wrappers - were restricted we wouldn't get here */ - old_in_user_include = PG(in_user_include); - if(uwrap->wrapper.is_url == 0 && - (options & STREAM_OPEN_FOR_INCLUDE) && - !PG(allow_url_include)) { - PG(in_user_include) = 1; - } - - us = emalloc(sizeof(*us)); - us->wrapper = uwrap; - - /* create an instance of our class */ - ALLOC_ZVAL(us->object); - object_init_ex(us->object, uwrap->ce); - ZVAL_REFCOUNT(us->object) = 1; - PZVAL_IS_REF(us->object) = 1; - - if (uwrap->ce->constructor) { - zend_fcall_info fci; - zend_fcall_info_cache fcc; - zval *retval_ptr; - - fci.size = sizeof(fci); - fci.function_table = &uwrap->ce->function_table; - fci.function_name = NULL; - fci.symbol_table = NULL; - fci.object_pp = &us->object; - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 0; - fci.params = NULL; - fci.no_separation = 1; - - fcc.initialized = 1; - fcc.function_handler = uwrap->ce->constructor; - fcc.calling_scope = EG(scope); - fcc.object_pp = &us->object; - - if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute %s::%s()", uwrap->ce->name, uwrap->ce->constructor->common.function_name); - zval_dtor(us->object); - FREE_ZVAL(us->object); - efree(us); - FG(user_stream_current_filename) = NULL; - PG(in_user_include) = old_in_user_include; - return NULL; - } else { - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - } - } - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(us->object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(us->object, "context"); - } - - /* call it's stream_open method - set up params first */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, filename, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zmode); - ZVAL_STRING(zmode, mode, 1); - args[1] = &zmode; - - MAKE_STD_ZVAL(zoptions); - ZVAL_LONG(zoptions, options); - args[2] = &zoptions; - - MAKE_STD_ZVAL(zopened); - ZVAL_REFCOUNT(zopened) = 1; - PZVAL_IS_REF(zopened) = 1; - ZVAL_NULL(zopened); - args[3] = &zopened; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_OPEN, 1); - - call_result = call_user_function_ex(NULL, - &us->object, - zfuncname, - &zretval, - 4, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval != NULL && zval_is_true(zretval)) { - /* the stream is now open! */ - stream = php_stream_alloc_rel(&php_stream_userspace_ops, us, 0, mode); - - /* if the opened path is set, copy it out */ - if (Z_TYPE_P(zopened) == IS_STRING && opened_path) { - *opened_path = estrndup(Z_STRVAL_P(zopened), Z_STRLEN_P(zopened)); - } - - /* set wrapper data to be a reference to our object */ - stream->wrapperdata = us->object; - zval_add_ref(&stream->wrapperdata); - } else { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "\"%s::" USERSTREAM_OPEN "\" call failed", - us->wrapper->classname); - } - - /* destroy everything else */ - if (stream == NULL) { - zval_ptr_dtor(&us->object); - efree(us); - } - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zopened); - zval_ptr_dtor(&zoptions); - zval_ptr_dtor(&zmode); - zval_ptr_dtor(&zfilename); - - FG(user_stream_current_filename) = NULL; - - PG(in_user_include) = old_in_user_include; - return stream; -} - -static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, char *filename, char *mode, - int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - php_userstream_data_t *us; - zval *zfilename, *zoptions, *zretval = NULL, *zfuncname, *zcontext; - zval **args[2]; - int call_result; - php_stream *stream = NULL; - - /* Try to catch bad usage without preventing flexibility */ - if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "infinite recursion prevented"); - return NULL; - } - FG(user_stream_current_filename) = filename; - - us = emalloc(sizeof(*us)); - us->wrapper = uwrap; - - /* create an instance of our class */ - ALLOC_ZVAL(us->object); - object_init_ex(us->object, uwrap->ce); - ZVAL_REFCOUNT(us->object) = 1; - PZVAL_IS_REF(us->object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(us->object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(us->object, "context"); - } - - /* call it's dir_open method - set up params first */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, filename, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zoptions); - ZVAL_LONG(zoptions, options); - args[1] = &zoptions; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_DIR_OPEN, 1); - - call_result = call_user_function_ex(NULL, - &us->object, - zfuncname, - &zretval, - 2, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval != NULL && zval_is_true(zretval)) { - /* the stream is now open! */ - stream = php_stream_alloc_rel(&php_stream_userspace_dir_ops, us, 0, mode); - - /* set wrapper data to be a reference to our object */ - stream->wrapperdata = us->object; - zval_add_ref(&stream->wrapperdata); - } else { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "\"%s::" USERSTREAM_DIR_OPEN "\" call failed", - us->wrapper->classname); - } - - /* destroy everything else */ - if (stream == NULL) { - zval_ptr_dtor(&us->object); - efree(us); - } - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zoptions); - zval_ptr_dtor(&zfilename); - - FG(user_stream_current_filename) = NULL; - - return stream; -} - - -/* {{{ proto bool stream_wrapper_register(string protocol, string classname[, integer flags]) - Registers a custom URL protocol handler class */ -PHP_FUNCTION(stream_wrapper_register) -{ - char *protocol, *classname; - int protocol_len, classname_len; - struct php_user_stream_wrapper * uwrap; - int rsrc_id; - long flags = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &protocol, &protocol_len, &classname, &classname_len, &flags) == FAILURE) { - RETURN_FALSE; - } - - uwrap = (struct php_user_stream_wrapper *)ecalloc(1, sizeof(*uwrap)); - uwrap->protoname = estrndup(protocol, protocol_len); - uwrap->classname = estrndup(classname, classname_len); - uwrap->wrapper.wops = &user_stream_wops; - uwrap->wrapper.abstract = uwrap; - uwrap->wrapper.is_url = ((flags & PHP_STREAM_IS_URL) != 0); - - rsrc_id = ZEND_REGISTER_RESOURCE(NULL, uwrap, le_protocols); - - if (zend_lookup_class(uwrap->classname, classname_len, (zend_class_entry***)&uwrap->ce TSRMLS_CC) == SUCCESS) { - uwrap->ce = *(zend_class_entry**)uwrap->ce; - if (php_register_url_stream_wrapper_volatile(protocol, &uwrap->wrapper TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } else { - /* We failed. But why? */ - if (zend_hash_exists(php_stream_get_url_stream_wrappers_hash(), protocol, protocol_len + 1)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol %s:// is already defined.", protocol); - } else { - /* Hash doesn't exist so it must have been an invalid protocol scheme */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid protocol scheme specified. Unable to register wrapper class %s to %s://", classname, protocol); - } - } - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "class '%s' is undefined", classname); - } - - zend_list_delete(rsrc_id); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool stream_wrapper_unregister(string protocol) - Unregister a wrapper for the life of the current request. */ -PHP_FUNCTION(stream_wrapper_unregister) -{ - char *protocol; - int protocol_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &protocol, &protocol_len) == FAILURE) { - RETURN_FALSE; - } - - if (php_unregister_url_stream_wrapper_volatile(protocol TSRMLS_CC) == FAILURE) { - /* We failed */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to unregister protocol %s://", protocol); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool stream_wrapper_restore(string protocol) - Restore the original protocol handler, overriding if necessary */ -PHP_FUNCTION(stream_wrapper_restore) -{ - char *protocol; - int protocol_len; - php_stream_wrapper **wrapperpp = NULL, *wrapper; - HashTable *global_wrapper_hash; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &protocol, &protocol_len) == FAILURE) { - RETURN_FALSE; - } - - global_wrapper_hash = php_stream_get_url_stream_wrappers_hash_global(); - if (php_stream_get_url_stream_wrappers_hash() == global_wrapper_hash) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s:// was never changed, nothing to restore", protocol); - RETURN_TRUE; - } - - if ((zend_hash_find(global_wrapper_hash, protocol, protocol_len + 1, (void**)&wrapperpp) == FAILURE) || !wrapperpp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s:// never existed, nothing to restore", protocol); - RETURN_FALSE; - } - - /* next line might delete the pointer that wrapperpp points at, so deref it now */ - wrapper = *wrapperpp; - - /* A failure here could be okay given that the protocol might have been merely unregistered */ - php_unregister_url_stream_wrapper_volatile(protocol TSRMLS_CC); - - if (php_register_url_stream_wrapper_volatile(protocol, wrapper TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to restore original %s:// wrapper", protocol); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - zval **args[1]; - zval *zbufptr; - size_t didwrite = 0; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_WRITE, sizeof(USERSTREAM_WRITE)-1, 0); - - MAKE_STD_ZVAL(zbufptr); - ZVAL_STRINGL(zbufptr, (char*)buf, count, 1);; - args[0] = &zbufptr; - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 1, args, - 0, NULL TSRMLS_CC); - zval_ptr_dtor(&zbufptr); - - didwrite = 0; - if (call_result == SUCCESS && retval != NULL) { - convert_to_long(retval); - didwrite = Z_LVAL_P(retval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " is not implemented!", - us->wrapper->classname); - } - - /* don't allow strange buffer overruns due to bogus return */ - if (didwrite > count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote %ld bytes more data than requested (%ld written, %ld max)", - us->wrapper->classname, - (long)(didwrite - count), (long)didwrite, (long)count); - didwrite = count; - } - - if (retval) - zval_ptr_dtor(&retval); - - return didwrite; -} - -static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - zval **args[1]; - int call_result; - size_t didread = 0; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - zval *zcount; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_READ, sizeof(USERSTREAM_READ)-1, 0); - - MAKE_STD_ZVAL(zcount); - ZVAL_LONG(zcount, count); - args[0] = &zcount; - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 1, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL) { - convert_to_string(retval); - didread = Z_STRLEN_P(retval); - if (didread > count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " - read %ld bytes more data than requested (%ld read, %ld max) - excess data will be lost", - us->wrapper->classname, (long)(didread - count), (long)didread, (long)count); - didread = count; - } - if (didread > 0) - memcpy(buf, Z_STRVAL_P(retval), didread); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " is not implemented!", - us->wrapper->classname); - } - zval_ptr_dtor(&zcount); - - if (retval) { - zval_ptr_dtor(&retval); - retval = NULL; - } - - /* since the user stream has no way of setting the eof flag directly, we need to ask it if we hit eof */ - - ZVAL_STRINGL(&func_name, USERSTREAM_EOF, sizeof(USERSTREAM_EOF)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && zval_is_true(retval)) { - stream->eof = 1; - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "%s::" USERSTREAM_EOF " is not implemented! Assuming EOF", - us->wrapper->classname); - - stream->eof = 1; - } - - if (retval) { - zval_ptr_dtor(&retval); - retval = NULL; - } - - return didread; -} - -static int php_userstreamop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_CLOSE, sizeof(USERSTREAM_CLOSE)-1, 0); - - call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (retval) - zval_ptr_dtor(&retval); - - zval_ptr_dtor(&us->object); - - efree(us); - - return 0; -} - -static int php_userstreamop_flush(php_stream *stream TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_FLUSH, sizeof(USERSTREAM_FLUSH)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && zval_is_true(retval)) - call_result = 0; - else - call_result = -1; - - if (retval) - zval_ptr_dtor(&retval); - - return call_result; -} - -static int php_userstreamop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result, ret; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - zval **args[2]; - zval *zoffs, *zwhence; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_SEEK, sizeof(USERSTREAM_SEEK)-1, 0); - - MAKE_STD_ZVAL(zoffs); - ZVAL_LONG(zoffs, offset); - args[0] = &zoffs; - - MAKE_STD_ZVAL(zwhence); - ZVAL_LONG(zwhence, whence); - args[1] = &zwhence; - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 2, args, - 0, NULL TSRMLS_CC); - - zval_ptr_dtor(&zoffs); - zval_ptr_dtor(&zwhence); - - if (call_result == FAILURE) { - /* stream_seek is not implemented, so disable seeks for this stream */ - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; - /* there should be no retval to clean up */ - - if (retval) - zval_ptr_dtor(&retval); - - return -1; - } else if (call_result == SUCCESS && retval != NULL && zval_is_true(retval)) { - ret = 0; - } else { - ret = -1; - } - - if (retval) { - zval_ptr_dtor(&retval); - retval = NULL; - } - - if (ret) { - return ret; - } - - /* now determine where we are */ - ZVAL_STRINGL(&func_name, USERSTREAM_TELL, sizeof(USERSTREAM_TELL)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) == IS_LONG) { - *newoffs = Z_LVAL_P(retval); - ret = 0; - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_TELL " is not implemented!", us->wrapper->classname); - ret = -1; - } else { - ret = -1; - } - - if (retval) { - zval_ptr_dtor(&retval); - } - return ret; -} - -/* parse the return value from one of the stat functions and store the - * relevant fields into the statbuf provided */ -static int statbuf_from_array(zval *array, php_stream_statbuf *ssb TSRMLS_DC) -{ - zval **elem; - -#define STAT_PROP_ENTRY_EX(name, name2) \ - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(array), #name, sizeof(#name), (void**)&elem)) { \ - convert_to_long(*elem); \ - ssb->sb.st_##name2 = Z_LVAL_PP(elem); \ - } - -#define STAT_PROP_ENTRY(name) STAT_PROP_ENTRY_EX(name,name) - - STAT_PROP_ENTRY(dev); - STAT_PROP_ENTRY(ino); - STAT_PROP_ENTRY(mode); - STAT_PROP_ENTRY(nlink); - STAT_PROP_ENTRY(uid); - STAT_PROP_ENTRY(gid); -#if HAVE_ST_RDEV - STAT_PROP_ENTRY(rdev); -#endif - STAT_PROP_ENTRY(size); -#ifdef NETWARE - STAT_PROP_ENTRY_EX(atime, atime.tv_sec); - STAT_PROP_ENTRY_EX(mtime, mtime.tv_sec); - STAT_PROP_ENTRY_EX(ctime, ctime.tv_sec); -#else - STAT_PROP_ENTRY(atime); - STAT_PROP_ENTRY(mtime); - STAT_PROP_ENTRY(ctime); -#endif -#ifdef HAVE_ST_BLKSIZE - STAT_PROP_ENTRY(blksize); -#endif -#ifdef HAVE_ST_BLOCKS - STAT_PROP_ENTRY(blocks); -#endif - -#undef STAT_PROP_ENTRY -#undef STAT_PROP_ENTRY_EX - return SUCCESS; -} - -static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - int ret = -1; - - ZVAL_STRINGL(&func_name, USERSTREAM_STAT, sizeof(USERSTREAM_STAT)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) == IS_ARRAY) { - if (SUCCESS == statbuf_from_array(retval, ssb TSRMLS_CC)) - ret = 0; - } else { - if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_STAT " is not implemented!", - us->wrapper->classname); - } - } - - if (retval) - zval_ptr_dtor(&retval); - - return ret; -} - - -static int php_userstreamop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) { - zval func_name; - zval *retval = NULL; - int call_result; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - int ret = -1; - zval *zvalue = NULL; - zval **args[1]; - - switch (option) { - case PHP_STREAM_OPTION_CHECK_LIVENESS: - ZVAL_STRINGL(&func_name, USERSTREAM_EOF, sizeof(USERSTREAM_EOF)-1, 0); - call_result = call_user_function_ex(NULL, &us->object, &func_name, &retval, 0, NULL, 0, NULL TSRMLS_CC); - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) == IS_BOOL) { - ret = zval_is_true(retval) ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; - } else { - ret = PHP_STREAM_OPTION_RETURN_ERR; - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "%s::" USERSTREAM_EOF " is not implemented! Assuming EOF", - us->wrapper->classname); - } - break; - - case PHP_STREAM_OPTION_LOCKING: - MAKE_STD_ZVAL(zvalue); - ZVAL_LONG(zvalue, 0); - - if (value & LOCK_NB) { - Z_LVAL_P(zvalue) |= PHP_LOCK_NB; - } - switch(value & ~LOCK_NB) { - case LOCK_SH: - Z_LVAL_P(zvalue) |= PHP_LOCK_SH; - break; - case LOCK_EX: - Z_LVAL_P(zvalue) |= PHP_LOCK_EX; - break; - case LOCK_UN: - Z_LVAL_P(zvalue) |= PHP_LOCK_UN; - break; - } - - args[0] = &zvalue; - - /* TODO wouldblock */ - ZVAL_STRINGL(&func_name, USERSTREAM_LOCK, sizeof(USERSTREAM_LOCK)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 1, args, 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) == IS_BOOL) { - ret = !Z_LVAL_P(retval); - } else if (call_result == FAILURE) { - if (value == 0) { - /* lock support test (TODO: more check) */ - ret = 0; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_LOCK " is not implemented!", - us->wrapper->classname); - } - } - - break; - } - - /* clean up */ - if (retval) { - zval_ptr_dtor(&retval); - } - - - if (zvalue) { - zval_ptr_dtor(&zvalue); - } - - return ret; -} - - -static int user_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zfilename, *zfuncname, *zretval, *zcontext; - zval **args[1]; - int call_result; - zval *object; - int ret = 0; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the unlink method */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, url, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_UNLINK, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 1, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval && Z_TYPE_P(zretval) == IS_BOOL) { - ret = Z_LVAL_P(zretval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_UNLINK " is not implemented!", uwrap->classname); - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zfilename); - - return ret; -} - -static int user_wrapper_rename(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zold_name, *znew_name, *zfuncname, *zretval, *zcontext; - zval **args[2]; - int call_result; - zval *object; - int ret = 0; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the rename method */ - MAKE_STD_ZVAL(zold_name); - ZVAL_STRING(zold_name, url_from, 1); - args[0] = &zold_name; - - MAKE_STD_ZVAL(znew_name); - ZVAL_STRING(znew_name, url_to, 1); - args[1] = &znew_name; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_RENAME, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 2, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval && Z_TYPE_P(zretval) == IS_BOOL) { - ret = Z_LVAL_P(zretval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_RENAME " is not implemented!", uwrap->classname); - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zold_name); - zval_ptr_dtor(&znew_name); - - return ret; -} - -static int user_wrapper_mkdir(php_stream_wrapper *wrapper, char *url, int mode, int options, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zfilename, *zmode, *zoptions, *zfuncname, *zretval, *zcontext; - zval **args[3]; - int call_result; - zval *object; - int ret = 0; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the unlink method */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, url, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zmode); - ZVAL_LONG(zmode, mode); - args[1] = &zmode; - - MAKE_STD_ZVAL(zoptions); - ZVAL_LONG(zoptions, options); - args[2] = &zoptions; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_MKDIR, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 3, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval && Z_TYPE_P(zretval) == IS_BOOL) { - ret = Z_LVAL_P(zretval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_MKDIR " is not implemented!", uwrap->classname); - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) { - zval_ptr_dtor(&zretval); - } - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zfilename); - zval_ptr_dtor(&zmode); - zval_ptr_dtor(&zoptions); - - return ret; -} - -static int user_wrapper_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zfilename, *zoptions, *zfuncname, *zretval, *zcontext; - zval **args[3]; - int call_result; - zval *object; - int ret = 0; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the unlink method */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, url, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zoptions); - ZVAL_LONG(zoptions, options); - args[1] = &zoptions; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_RMDIR, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 2, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval && Z_TYPE_P(zretval) == IS_BOOL) { - ret = Z_LVAL_P(zretval); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_RMDIR " is not implemented!", uwrap->classname); - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) { - zval_ptr_dtor(&zretval); - } - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zfilename); - zval_ptr_dtor(&zoptions); - - return ret; -} - -static int user_wrapper_stat_url(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) -{ - struct php_user_stream_wrapper *uwrap = (struct php_user_stream_wrapper*)wrapper->abstract; - zval *zfilename, *zfuncname, *zretval, *zflags, *zcontext; - zval **args[2]; - int call_result; - zval *object; - int ret = -1; - - /* create an instance of our class */ - ALLOC_ZVAL(object); - object_init_ex(object, uwrap->ce); - ZVAL_REFCOUNT(object) = 1; - PZVAL_IS_REF(object) = 1; - - if (context) { - MAKE_STD_ZVAL(zcontext); - php_stream_context_to_zval(context, zcontext); - add_property_zval(object, "context", zcontext); - /* The object property should be the only reference, - 'get rid' of our local reference. */ - zval_ptr_dtor(&zcontext); - } else { - add_property_null(object, "context"); - } - - /* call the stat_url method */ - - /* call it's stream_open method - set up params first */ - MAKE_STD_ZVAL(zfilename); - ZVAL_STRING(zfilename, url, 1); - args[0] = &zfilename; - - MAKE_STD_ZVAL(zflags); - ZVAL_LONG(zflags, flags); - args[1] = &zflags; - - MAKE_STD_ZVAL(zfuncname); - ZVAL_STRING(zfuncname, USERSTREAM_STATURL, 1); - - call_result = call_user_function_ex(NULL, - &object, - zfuncname, - &zretval, - 2, args, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && zretval != NULL && Z_TYPE_P(zretval) == IS_ARRAY) { - /* We got the info we needed */ - if (SUCCESS == statbuf_from_array(zretval, ssb TSRMLS_CC)) - ret = 0; - } else { - if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_STATURL " is not implemented!", - uwrap->classname); - } - } - - /* clean up */ - zval_ptr_dtor(&object); - if (zretval) - zval_ptr_dtor(&zretval); - - zval_ptr_dtor(&zfuncname); - zval_ptr_dtor(&zfilename); - zval_ptr_dtor(&zflags); - - return ret; - -} - -static size_t php_userstreamop_readdir(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - int call_result; - size_t didread = 0; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - php_stream_dirent *ent = (php_stream_dirent*)buf; - - /* avoid problems if someone mis-uses the stream */ - if (count != sizeof(php_stream_dirent)) - return 0; - - ZVAL_STRINGL(&func_name, USERSTREAM_DIR_READ, sizeof(USERSTREAM_DIR_READ)-1, 0); - - call_result = call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, - 0, NULL TSRMLS_CC); - - if (call_result == SUCCESS && retval != NULL && Z_TYPE_P(retval) != IS_BOOL) { - convert_to_string(retval); - PHP_STRLCPY(ent->d_name, Z_STRVAL_P(retval), sizeof(ent->d_name), Z_STRLEN_P(retval)); - - didread = sizeof(php_stream_dirent); - } else if (call_result == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_DIR_READ " is not implemented!", - us->wrapper->classname); - } - - if (retval) - zval_ptr_dtor(&retval); - - return didread; -} - -static int php_userstreamop_closedir(php_stream *stream, int close_handle TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - - assert(us != NULL); - - ZVAL_STRINGL(&func_name, USERSTREAM_DIR_CLOSE, sizeof(USERSTREAM_DIR_CLOSE)-1, 0); - - call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (retval) - zval_ptr_dtor(&retval); - - zval_ptr_dtor(&us->object); - - efree(us); - - return 0; -} - -static int php_userstreamop_rewinddir(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - zval func_name; - zval *retval = NULL; - php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract; - - ZVAL_STRINGL(&func_name, USERSTREAM_DIR_REWIND, sizeof(USERSTREAM_DIR_REWIND)-1, 0); - - call_user_function_ex(NULL, - &us->object, - &func_name, - &retval, - 0, NULL, 0, NULL TSRMLS_CC); - - if (retval) - zval_ptr_dtor(&retval); - - return 0; - -} - -php_stream_ops php_stream_userspace_ops = { - php_userstreamop_write, php_userstreamop_read, - php_userstreamop_close, php_userstreamop_flush, - "user-space", - php_userstreamop_seek, - NULL, /* cast */ - php_userstreamop_stat, - php_userstreamop_set_option, -}; - -php_stream_ops php_stream_userspace_dir_ops = { - NULL, /* write */ - php_userstreamop_readdir, - php_userstreamop_closedir, - NULL, /* flush */ - "user-space-dir", - php_userstreamop_rewinddir, - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - - diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c deleted file mode 100644 index 5e074a0ca0b57..0000000000000 --- a/main/streams/xp_socket.c +++ /dev/null @@ -1,821 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "ext/standard/file.h" -#include "streams/php_streams_int.h" -#include "php_network.h" - -#if defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE) -# undef AF_UNIX -#endif - -#if defined(AF_UNIX) -#include -#endif - -#ifndef MSG_DONTWAIT -# define MSG_DONTWAIT 0 -#endif - -#ifndef MSG_PEEK -# define MSG_PEEK 0 -#endif - -php_stream_ops php_stream_generic_socket_ops; -PHPAPI php_stream_ops php_stream_socket_ops; -php_stream_ops php_stream_udp_socket_ops; -#ifdef AF_UNIX -php_stream_ops php_stream_unix_socket_ops; -php_stream_ops php_stream_unixdg_socket_ops; -#endif - - -static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC); - -/* {{{ Generic socket stream operations */ -static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - int didwrite; - struct timeval *ptimeout; - - if (sock->socket == -1) { - return 0; - } - - if (sock->timeout.tv_sec == -1) - ptimeout = NULL; - else - ptimeout = &sock->timeout; - -retry: - didwrite = send(sock->socket, buf, count, (sock->is_blocked && ptimeout) ? MSG_DONTWAIT : 0); - - if (didwrite <= 0) { - long err = php_socket_errno(); - char *estr; - - if (sock->is_blocked && err == EWOULDBLOCK) { - int retval; - - sock->timeout_event = 0; - - do { - retval = php_pollfd_for(sock->socket, POLLOUT, ptimeout); - - if (retval == 0) { - sock->timeout_event = 1; - break; - } - - if (retval > 0) { - /* writable now; retry */ - goto retry; - } - - err = php_socket_errno(); - } while (err == EINTR); - } - estr = php_socket_strerror(err, NULL, 0); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of %ld bytes failed with errno=%ld %s", - (long)count, err, estr); - efree(estr); - } - - if (didwrite > 0) { - php_stream_notify_progress_increment(stream->context, didwrite, 0); - } - - if (didwrite < 0) { - didwrite = 0; - } - - return didwrite; -} - -static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock TSRMLS_DC) -{ - int retval; - struct timeval *ptimeout; - - if (sock->socket == -1) { - return; - } - - sock->timeout_event = 0; - - if (sock->timeout.tv_sec == -1) - ptimeout = NULL; - else - ptimeout = &sock->timeout; - - while(1) { - retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout); - - if (retval == 0) - sock->timeout_event = 1; - - if (retval >= 0) - break; - - if (php_socket_errno() != EINTR) - break; - } -} - -static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - int nr_bytes = 0; - - if (sock->socket == -1) { - return 0; - } - - if (sock->is_blocked) { - php_sock_stream_wait_for_data(stream, sock TSRMLS_CC); - if (sock->timeout_event) - return 0; - } - - nr_bytes = recv(sock->socket, buf, count, (sock->is_blocked && sock->timeout.tv_sec != -1) ? MSG_DONTWAIT : 0); - - stream->eof = (nr_bytes == 0 || (nr_bytes == -1 && php_socket_errno() != EWOULDBLOCK)); - - if (nr_bytes > 0) { - php_stream_notify_progress_increment(stream->context, nr_bytes, 0); - } - - if (nr_bytes < 0) { - nr_bytes = 0; - } - - return nr_bytes; -} - - -static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; -#ifdef PHP_WIN32 - int n; -#endif - - if (close_handle) { - - if (sock->socket != SOCK_ERR) { -#ifdef PHP_WIN32 - /* prevent more data from coming in */ - shutdown(sock->socket, SHUT_RD); - - /* try to make sure that the OS sends all data before we close the connection. - * Essentially, we are waiting for the socket to become writeable, which means - * that all pending data has been sent. - * We use a small timeout which should encourage the OS to send the data, - * but at the same time avoid hanging indefintely. - * */ - do { - n = php_pollfd_for_ms(sock->socket, POLLOUT, 500); - } while (n == -1 && php_socket_errno() == EINTR); -#endif - closesocket(sock->socket); - sock->socket = SOCK_ERR; - } - - } - - pefree(sock, php_stream_is_persistent(stream)); - - return 0; -} - -static int php_sockop_flush(php_stream *stream TSRMLS_DC) -{ -#if 0 - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - return fsync(sock->socket); -#endif - return 0; -} - -static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - return fstat(sock->socket, &ssb->sb); -} - -static inline int sock_sendto(php_netstream_data_t *sock, char *buf, size_t buflen, int flags, - struct sockaddr *addr, socklen_t addrlen - TSRMLS_DC) -{ - if (addr) { - return sendto(sock->socket, buf, buflen, flags, addr, addrlen); - } - return send(sock->socket, buf, buflen, flags); -} - -static inline int sock_recvfrom(php_netstream_data_t *sock, char *buf, size_t buflen, int flags, - char **textaddr, long *textaddrlen, - struct sockaddr **addr, socklen_t *addrlen - TSRMLS_DC) -{ - php_sockaddr_storage sa; - socklen_t sl = sizeof(sa); - int ret; - int want_addr = textaddr || addr; - - if (want_addr) { - ret = recvfrom(sock->socket, buf, buflen, flags, (struct sockaddr*)&sa, &sl); - php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl, - textaddr, textaddrlen, addr, addrlen TSRMLS_CC); - } else { - ret = recv(sock->socket, buf, buflen, flags); - } - - return ret; -} - -static int php_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) -{ - int oldmode, flags; - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - php_stream_xport_param *xparam; - - switch(option) { - case PHP_STREAM_OPTION_CHECK_LIVENESS: - { - struct timeval tv; - char buf; - int alive = 1; - - if (value == -1) { - if (sock->timeout.tv_sec == -1) { - tv.tv_sec = FG(default_socket_timeout); - tv.tv_usec = 0; - } else { - tv = sock->timeout; - } - } else { - tv.tv_sec = value; - tv.tv_usec = 0; - } - - if (sock->socket == -1) { - alive = 0; - } else if (php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) { - if (0 == recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EAGAIN) { - alive = 0; - } - } - return alive ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR; - } - - case PHP_STREAM_OPTION_BLOCKING: - oldmode = sock->is_blocked; - if (SUCCESS == php_set_sock_blocking(sock->socket, value TSRMLS_CC)) { - sock->is_blocked = value; - return oldmode; - } - return PHP_STREAM_OPTION_RETURN_ERR; - - case PHP_STREAM_OPTION_READ_TIMEOUT: - sock->timeout = *(struct timeval*)ptrparam; - sock->timeout_event = 0; - return PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_OPTION_META_DATA_API: - add_assoc_bool((zval *)ptrparam, "timed_out", sock->timeout_event); - add_assoc_bool((zval *)ptrparam, "blocked", sock->is_blocked); - add_assoc_bool((zval *)ptrparam, "eof", stream->eof); - return PHP_STREAM_OPTION_RETURN_OK; - - case PHP_STREAM_OPTION_XPORT_API: - xparam = (php_stream_xport_param *)ptrparam; - - switch (xparam->op) { - case STREAM_XPORT_OP_LISTEN: - xparam->outputs.returncode = listen(sock->socket, 5); - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_GET_NAME: - xparam->outputs.returncode = php_network_get_sock_name(sock->socket, - xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, - xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, - xparam->want_addr ? &xparam->outputs.addr : NULL, - xparam->want_addr ? &xparam->outputs.addrlen : NULL - TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_GET_PEER_NAME: - xparam->outputs.returncode = php_network_get_peer_name(sock->socket, - xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, - xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, - xparam->want_addr ? &xparam->outputs.addr : NULL, - xparam->want_addr ? &xparam->outputs.addrlen : NULL - TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_SEND: - flags = 0; - if ((xparam->inputs.flags & STREAM_OOB) == STREAM_OOB) { - flags |= MSG_OOB; - } - xparam->outputs.returncode = sock_sendto(sock, - xparam->inputs.buf, xparam->inputs.buflen, - flags, - xparam->inputs.addr, - xparam->inputs.addrlen TSRMLS_CC); - if (xparam->outputs.returncode == -1) { - char *err = php_socket_strerror(php_socket_errno(), NULL, 0); - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "%s\n", err); - efree(err); - } - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_RECV: - flags = 0; - if ((xparam->inputs.flags & STREAM_OOB) == STREAM_OOB) { - flags |= MSG_OOB; - } - if ((xparam->inputs.flags & STREAM_PEEK) == STREAM_PEEK) { - flags |= MSG_PEEK; - } - xparam->outputs.returncode = sock_recvfrom(sock, - xparam->inputs.buf, xparam->inputs.buflen, - flags, - xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, - xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, - xparam->want_addr ? &xparam->outputs.addr : NULL, - xparam->want_addr ? &xparam->outputs.addrlen : NULL - TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - -#ifdef HAVE_SHUTDOWN -# ifndef SHUT_RD -# define SHUT_RD 0 -# endif -# ifndef SHUT_WR -# define SHUT_WR 1 -# endif -# ifndef SHUT_RDWR -# define SHUT_RDWR 2 -# endif - case STREAM_XPORT_OP_SHUTDOWN: { - static const int shutdown_how[] = {SHUT_RD, SHUT_WR, SHUT_RDWR}; - - xparam->outputs.returncode = shutdown(sock->socket, shutdown_how[xparam->how]); - return PHP_STREAM_OPTION_RETURN_OK; - } -#endif - - default: - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - } - - default: - return PHP_STREAM_OPTION_RETURN_NOTIMPL; - } -} - -static int php_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - - switch(castas) { - case PHP_STREAM_AS_STDIO: - if (ret) { - *(FILE**)ret = fdopen(sock->socket, stream->mode); - if (*ret) - return SUCCESS; - return FAILURE; - } - return SUCCESS; - case PHP_STREAM_AS_FD_FOR_SELECT: - case PHP_STREAM_AS_FD: - case PHP_STREAM_AS_SOCKETD: - if (ret) - *(int*)ret = sock->socket; - return SUCCESS; - default: - return FAILURE; - } -} -/* }}} */ - -/* These may look identical, but we need them this way so that - * we can determine which type of socket we are dealing with - * by inspecting stream->ops. - * A "useful" side-effect is that the user's scripts can then - * make similar decisions using stream_get_meta_data. - * */ -php_stream_ops php_stream_generic_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "generic_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_sockop_set_option, -}; - - -php_stream_ops php_stream_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "tcp_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_tcp_sockop_set_option, -}; - -php_stream_ops php_stream_udp_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "udp_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_tcp_sockop_set_option, -}; - -#ifdef AF_UNIX -php_stream_ops php_stream_unix_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "unix_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_tcp_sockop_set_option, -}; -php_stream_ops php_stream_unixdg_socket_ops = { - php_sockop_write, php_sockop_read, - php_sockop_close, php_sockop_flush, - "udg_socket", - NULL, /* seek */ - php_sockop_cast, - php_sockop_stat, - php_tcp_sockop_set_option, -}; -#endif - - -/* network socket operations */ - -#ifdef AF_UNIX -static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr TSRMLS_DC) -{ - memset(unix_addr, 0, sizeof(*unix_addr)); - unix_addr->sun_family = AF_UNIX; - - /* we need to be binary safe on systems that support an abstract - * namespace */ - if (xparam->inputs.namelen >= sizeof(unix_addr->sun_path)) { - /* On linux, when the path begins with a NUL byte we are - * referring to an abstract namespace. In theory we should - * allow an extra byte below, since we don't need the NULL. - * BUT, to get into this branch of code, the name is too long, - * so we don't care. */ - xparam->inputs.namelen = sizeof(unix_addr->sun_path) - 1; - } - - memcpy(unix_addr->sun_path, xparam->inputs.name, xparam->inputs.namelen); - - return 1; -} -#endif - -static inline char *parse_ip_address_ex(const char *str, int str_len, int *portno, int get_err, char **err TSRMLS_DC) -{ - char *colon; - char *host = NULL; - -#ifdef HAVE_IPV6 - char *p; - - if (*(str) == '[' && str_len > 1) { - /* IPV6 notation to specify raw address with port (i.e. [fe80::1]:80) */ - p = memchr(str + 1, ']', str_len - 2); - if (!p || *(p + 1) != ':') { - if (get_err) { - spprintf(err, 0, "Failed to parse IPv6 address \"%s\"", str); - } - return NULL; - } - *portno = atoi(p + 2); - return estrndup(str + 1, p - str - 1); - } -#endif - if (str_len) { - colon = memchr(str, ':', str_len - 1); - } else { - colon = NULL; - } - if (colon) { - *portno = atoi(colon + 1); - host = estrndup(str, colon - str); - } else { - if (get_err) { - spprintf(err, 0, "Failed to parse address \"%s\"", str); - } - return NULL; - } - - return host; -} - -static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno TSRMLS_DC) -{ - return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); -} - -static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *sock, - php_stream_xport_param *xparam TSRMLS_DC) -{ - char *host = NULL; - int portno, err; - -#ifdef AF_UNIX - if (stream->ops == &php_stream_unix_socket_ops || stream->ops == &php_stream_unixdg_socket_ops) { - struct sockaddr_un unix_addr; - - sock->socket = socket(PF_UNIX, stream->ops == &php_stream_unix_socket_ops ? SOCK_STREAM : SOCK_DGRAM, 0); - - if (sock->socket == SOCK_ERR) { - if (xparam->want_errortext) { - spprintf(&xparam->outputs.error_text, 0, "Failed to create unix%s socket %s", - stream->ops == &php_stream_unix_socket_ops ? "" : "datagram", - strerror(errno)); - } - return -1; - } - - parse_unix_address(xparam, &unix_addr TSRMLS_CC); - - return bind(sock->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr)); - } -#endif - - host = parse_ip_address(xparam, &portno TSRMLS_CC); - - if (host == NULL) { - return -1; - } - - sock->socket = php_network_bind_socket_to_local_addr(host, portno, - stream->ops == &php_stream_udp_socket_ops ? SOCK_DGRAM : SOCK_STREAM, - xparam->want_errortext ? &xparam->outputs.error_text : NULL, - &err - TSRMLS_CC); - - if (host) { - efree(host); - } - - return sock->socket == -1 ? -1 : 0; -} - -static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_t *sock, - php_stream_xport_param *xparam TSRMLS_DC) -{ - char *host = NULL, *bindto = NULL; - int portno, bindport = 0; - int err = 0; - int ret; - zval **tmpzval = NULL; - -#ifdef AF_UNIX - if (stream->ops == &php_stream_unix_socket_ops || stream->ops == &php_stream_unixdg_socket_ops) { - struct sockaddr_un unix_addr; - - sock->socket = socket(PF_UNIX, stream->ops == &php_stream_unix_socket_ops ? SOCK_STREAM : SOCK_DGRAM, 0); - - if (sock->socket == SOCK_ERR) { - if (xparam->want_errortext) { - spprintf(&xparam->outputs.error_text, 0, "Failed to create unix socket"); - } - return -1; - } - - parse_unix_address(xparam, &unix_addr TSRMLS_CC); - - ret = php_network_connect_socket(sock->socket, - (const struct sockaddr *)&unix_addr, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen, - xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC, xparam->inputs.timeout, - xparam->want_errortext ? &xparam->outputs.error_text : NULL, - &err); - - xparam->outputs.error_code = err; - - goto out; - } -#endif - - host = parse_ip_address(xparam, &portno TSRMLS_CC); - - if (host == NULL) { - return -1; - } - - if (stream->context && php_stream_context_get_option(stream->context, "socket", "bindto", &tmpzval) == SUCCESS) { - if (Z_TYPE_PP(tmpzval) != IS_STRING) { - if (xparam->want_errortext) { - spprintf(&xparam->outputs.error_text, 0, "local_addr context option is not a string."); - } - efree(host); - return -1; - } - bindto = parse_ip_address_ex(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); - } - - /* Note: the test here for php_stream_udp_socket_ops is important, because we - * want the default to be TCP sockets so that the openssl extension can - * re-use this code. */ - - sock->socket = php_network_connect_socket_to_host(host, portno, - stream->ops == &php_stream_udp_socket_ops ? SOCK_DGRAM : SOCK_STREAM, - xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC, - xparam->inputs.timeout, - xparam->want_errortext ? &xparam->outputs.error_text : NULL, - &err, - bindto, - bindport - TSRMLS_CC); - - ret = sock->socket == -1 ? -1 : 0; - xparam->outputs.error_code = err; - - if (host) { - efree(host); - } - if (bindto) { - efree(bindto); - } - -#ifdef AF_UNIX -out: -#endif - - if (ret >= 0 && xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC && err == EINPROGRESS) { - /* indicates pending connection */ - return 1; - } - - return ret; -} - -static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t *sock, - php_stream_xport_param *xparam STREAMS_DC TSRMLS_DC) -{ - int clisock; - - xparam->outputs.client = NULL; - - clisock = php_network_accept_incoming(sock->socket, - xparam->want_textaddr ? &xparam->outputs.textaddr : NULL, - xparam->want_textaddr ? &xparam->outputs.textaddrlen : NULL, - xparam->want_addr ? &xparam->outputs.addr : NULL, - xparam->want_addr ? &xparam->outputs.addrlen : NULL, - xparam->inputs.timeout, - xparam->want_errortext ? &xparam->outputs.error_text : NULL, - &xparam->outputs.error_code - TSRMLS_CC); - - if (clisock >= 0) { - php_netstream_data_t *clisockdata; - - clisockdata = emalloc(sizeof(*clisockdata)); - - if (clisockdata == NULL) { - close(clisock); - /* technically a fatal error */ - } else { - memcpy(clisockdata, sock, sizeof(*clisockdata)); - clisockdata->socket = clisock; - - xparam->outputs.client = php_stream_alloc_rel(stream->ops, clisockdata, NULL, "r+"); - if (xparam->outputs.client) { - /* TODO: addref ? */ - xparam->outputs.client->context = stream->context; - } - } - } - - return xparam->outputs.client == NULL ? -1 : 0; -} - -static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) -{ - php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; - php_stream_xport_param *xparam; - - switch(option) { - case PHP_STREAM_OPTION_XPORT_API: - xparam = (php_stream_xport_param *)ptrparam; - - switch(xparam->op) { - case STREAM_XPORT_OP_CONNECT: - case STREAM_XPORT_OP_CONNECT_ASYNC: - xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - case STREAM_XPORT_OP_BIND: - xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - - - case STREAM_XPORT_OP_ACCEPT: - xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC TSRMLS_CC); - return PHP_STREAM_OPTION_RETURN_OK; - default: - /* fall through */ - ; - } - } - return php_sockop_set_option(stream, option, value, ptrparam TSRMLS_CC); -} - - -PHPAPI php_stream *php_stream_generic_socket_factory(const char *proto, long protolen, - char *resourcename, long resourcenamelen, - const char *persistent_id, int options, int flags, - struct timeval *timeout, - php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - php_stream *stream = NULL; - php_netstream_data_t *sock; - php_stream_ops *ops; - - /* which type of socket ? */ - if (strncmp(proto, "tcp", protolen) == 0) { - ops = &php_stream_socket_ops; - } else if (strncmp(proto, "udp", protolen) == 0) { - ops = &php_stream_udp_socket_ops; - } -#ifdef AF_UNIX - else if (strncmp(proto, "unix", protolen) == 0) { - ops = &php_stream_unix_socket_ops; - } else if (strncmp(proto, "udg", protolen) == 0) { - ops = &php_stream_unixdg_socket_ops; - } -#endif - else { - /* should never happen */ - return NULL; - } - - sock = pemalloc(sizeof(php_netstream_data_t), persistent_id ? 1 : 0); - memset(sock, 0, sizeof(php_netstream_data_t)); - - sock->is_blocked = 1; - sock->timeout.tv_sec = FG(default_socket_timeout); - sock->timeout.tv_usec = 0; - - /* we don't know the socket until we have determined if we are binding or - * connecting */ - sock->socket = -1; - - stream = php_stream_alloc_rel(ops, sock, persistent_id, "r+"); - - if (stream == NULL) { - pefree(sock, persistent_id ? 1 : 0); - return NULL; - } - - if (flags == 0) { - return stream; - } - - return stream; -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/main/strlcat.c b/main/strlcat.c deleted file mode 100644 index 97e68bc0d10c0..0000000000000 --- a/main/strlcat.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifndef HAVE_STRLCAT - -/* $OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $ */ - -/* - * Copyright (c) 1998 Todd C. Miller - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include - -/* - * Appends src to string dst of size siz (unlike strncat, siz is the - * full size of dst, not space left). At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ -PHPAPI size_t php_strlcat(dst, src, siz) - char *dst; - const char *src; - size_t siz; -{ - register char *d = dst; - register const char *s = src; - register size_t n = siz; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (*d != '\0' && n-- != 0) - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} - -#endif /* !HAVE_STRLCAT */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/strlcpy.c b/main/strlcpy.c deleted file mode 100644 index f26efc1e2304b..0000000000000 --- a/main/strlcpy.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifndef HAVE_STRLCPY - -/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */ - -/* - * Copyright (c) 1998 Todd C. Miller - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include - -/* - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ -PHPAPI size_t php_strlcpy(dst, src, siz) - char *dst; - const char *src; - size_t siz; -{ - register char *d = dst; - register const char *s = src; - register size_t n = siz; - - /* Copy as many bytes as will fit */ - if (n != 0 && --n != 0) { - do { - if ((*d++ = *s++) == 0) - break; - } while (--n != 0); - } - - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) - ; - } - - return(s - src - 1); /* count does not include NUL */ -} - -#endif /* !HAVE_STRLCPY */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/main/win95nt.h b/main/win95nt.h deleted file mode 100644 index bbb91a28b41c2..0000000000000 --- a/main/win95nt.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* Defines and types for Windows 95/NT */ -#define HAVE_DECLARED_TIMEZONE -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include -#include -#include -#include -typedef int uid_t; -typedef int gid_t; -typedef char * caddr_t; -#define lstat(x, y) stat(x, y) -#define _IFIFO 0010000 /* fifo */ -#define _IFBLK 0060000 /* block special */ -#define _IFLNK 0120000 /* symbolic link */ -#define S_IFIFO _IFIFO -#define S_IFBLK _IFBLK -#define S_IFLNK _IFLNK -#ifndef S_ISREG -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif -#define chdir(path) _chdir(path) -#define mkdir(a, b) _mkdir(a) -#define rmdir(a) _rmdir(a) -#define getpid _getpid -#define php_sleep(t) Sleep(t*1000) -#ifndef getcwd -# define getcwd(a, b) _getcwd(a, b) -#endif -#define off_t _off_t -typedef unsigned int uint; -typedef unsigned long ulong; -#if !NSAPI -typedef long pid_t; -#endif - -/* missing in vc5 math.h */ -#define M_PI 3.14159265358979323846 -#define M_TWOPI (M_PI * 2.0) -#define M_PI_2 1.57079632679489661923 -#ifndef M_PI_4 -#define M_PI_4 0.78539816339744830962 -#endif - -#if !defined(PHP_DEBUG) -#ifdef inline -#undef inline -#endif -#define inline __inline -#endif - -/* General Windows stuff */ -#define WINDOWS 1 - -/* Prevent use of VC5 OpenFile function */ -#define NOOPENFILE - -/* sendmail is built-in */ -#ifdef PHP_PROG_SENDMAIL -#undef PHP_PROG_SENDMAIL -#define PHP_PROG_SENDMAIL "Built in mailer" -#endif diff --git a/netware/sendmail_nw.h b/netware/sendmail_nw.h deleted file mode 100644 index b88f8e12a1377..0000000000000 --- a/netware/sendmail_nw.h +++ /dev/null @@ -1,19 +0,0 @@ - -#define closesocket close -#define LPCSTR char * -#define LPSTR char* -#define FAR -#ifdef USE_WINSOCK -#include -#else -#include /* For struct sockaddr, 'PF_INET' and 'AF_INET' */ -#include /* For struct sockaddr_in */ -#include /* For struct hostent */ -#endif /* USE_WINSOCK */ - -typedef int SOCKET; /* Borrowed from winsock\novsock2.h */ -typedef struct sockaddr_in SOCKADDR_IN; -typedef struct sockaddr * LPSOCKADDR; -typedef struct hostent * LPHOSTENT; - -#define INVALID_SOCKET (SOCKET)(~0) /* Borrowed from winsock\novsock2.h */ diff --git a/netware/start.c b/netware/start.c deleted file mode 100644 index 020375148b1b5..0000000000000 --- a/netware/start.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Novell, Inc. | - +----------------------------------------------------------------------+ - */ - - -#include -#include -#include - -void *gLibHandle = (void *) NULL; -rtag_t gAllocTag = (rtag_t) NULL; -NXMutex_t *gLibLock = (NXMutex_t *) NULL; -int gLibId = 0; - - -int DisposeLibraryData( void *data) -{ - return 0; -} - - -int _NonAppStart -( - void *NLMHandle, - void *errorScreen, - const char *cmdLine, - const char *loadDirPath, - size_t uninitializedDataLength, - void *NLMFileHandle, - int (*readRoutineP)( int conn, void *fileHandle, size_t offset, - size_t nbytes, size_t *bytesRead, void *buffer ), - size_t customDataOffset, - size_t customDataSize, - int messageCount, - const char **messages -) -{ - NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); - -#pragma unused(cmdLine) -#pragma unused(loadDirPath) -#pragma unused(uninitializedDataLength) -#pragma unused(NLMFileHandle) -#pragma unused(readRoutineP) -#pragma unused(customDataOffset) -#pragma unused(customDataSize) -#pragma unused(messageCount) -#pragma unused(messages) - -/* Here we process our command line, post errors (to the error screen), - * perform initializations and anything else we need to do before being able - * to accept calls into us. If we succeed, we return non-zero and the NetWare - * Loader will leave us up, otherwise we fail to load and get dumped. - */ -/** - gAllocTag = AllocateResourceTag(NLMHandle, - " memory allocations", AllocSignature); - if (!gAllocTag) { - OutputToScreen(errorScreen, "Unable to allocate resource tag for " - "library memory allocations.\n"); - return -1; - } -**/ - gLibId = register_library(DisposeLibraryData); - if (gLibId == -1) { - OutputToScreen(errorScreen, "Unable to register library with kernel.\n"); - return -1; - } - - gLibHandle = NLMHandle; - - gLibLock = NXMutexAlloc(0, 0, &liblock); - if (!gLibLock) { - OutputToScreen(errorScreen, "Unable to allocate library data lock.\n"); - return -1; - } - - return 0; -} - - -void _NonAppStop( void ) -{ -/* Here we clean up any resources we allocated. Resource tags is a big part - * of what we created, but NetWare doesn't ask us to free those. - */ - (void) unregister_library(gLibId); - NXMutexFree(gLibLock); -} - - -int _NonAppCheckUnload( void ) -{ -/* This function cannot be the first in the file for if the file is linked - * first, then the check-unload function's offset will be nlmname.nlm+0 - * which is how to tell that there isn't one. When the check function is - * first in the linked objects, it is ambiguous. For this reason, we will - * put it inside this file after the stop function. - * - * Here we check to see if it's alright to ourselves to be unloaded. If not, - * we return a non-zero value. Right now, there isn't any reason not to allow - * it. - */ - return 0; -} diff --git a/pear/Makefile.frag b/pear/Makefile.frag deleted file mode 100644 index 4a5456263d8b2..0000000000000 --- a/pear/Makefile.frag +++ /dev/null @@ -1,35 +0,0 @@ -# -*- makefile -*- - -peardir=$(PEAR_INSTALLDIR) - -# Skip all php.ini files altogether -PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0 -dopen_basedir= -derror_reporting=E_ALL -dmemory_limit=-1 -ddetect_unicode=0 -WGET = `which wget 2>/dev/null` -FETCH = `which fetch 2>/dev/null` - -install-pear-installer: $(SAPI_CLI_PATH) - @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" - -install-pear: - @echo "Installing PEAR environment: $(INSTALL_ROOT)$(peardir)/" - @if test ! -f $(builddir)/install-pear-nozlib.phar; then \ - if test -f $(srcdir)/install-pear-nozlib.phar; then \ - cp $(srcdir)/install-pear-nozlib.phar $(builddir)/install-pear-nozlib.phar; \ - else \ - if test ! -z "$(WGET)" && test -x "$(WGET)"; then \ - "$(WGET)" http://pear.php.net/install-pear-nozlib.phar -nd -P $(builddir)/; \ - elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \ - "$(FETCH)" -o $(builddir)/ http://pear.php.net/install-pear-nozlib.phar; \ - else \ - echo ""; \ - echo "No download utilities found. Don't know how to download PEAR archive."; \ - echo ""; \ - fi \ - fi \ - fi - @if test -f $(builddir)/install-pear-nozlib.phar && $(mkinstalldirs) $(INSTALL_ROOT)$(peardir); then \ - $(MAKE) -s install-pear-installer; \ - else \ - cat $(srcdir)/install-pear.txt; \ - fi - diff --git a/pear/install-pear.txt b/pear/install-pear.txt deleted file mode 100644 index 10a607291b06f..0000000000000 --- a/pear/install-pear.txt +++ /dev/null @@ -1,12 +0,0 @@ -+----------------------------------------------------------------------+ -| The installation process is incomplete. The following resources were | -| not installed: | -| | -| PEAR: PHP Extension and Application Repository | -| | -| To install these components, | -| download http://pear.php.net/install-pear.phar to php-src/pear/ | -| become the superuser and execute: | -| | -| # make install-su | -+----------------------------------------------------------------------+ diff --git a/regex/COPYRIGHT b/regex/COPYRIGHT deleted file mode 100644 index d43362fbfc9a7..0000000000000 --- a/regex/COPYRIGHT +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. -This software is not subject to any license of the American Telephone -and Telegraph Company or of the Regents of the University of California. - -Permission is granted to anyone to use this software for any purpose on -any computer system, and to alter it and redistribute it, subject -to the following restrictions: - -1. The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - -2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - -3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - -4. This notice may not be removed or altered. diff --git a/regex/README b/regex/README deleted file mode 100644 index cea9b67b6665d..0000000000000 --- a/regex/README +++ /dev/null @@ -1,32 +0,0 @@ -alpha3.4 release. -Thu Mar 17 23:17:18 EST 1994 -henry@zoo.toronto.edu - -See WHATSNEW for change listing. - -installation notes: --------- -Read the comments at the beginning of Makefile before running. - -Utils.h contains some things that just might have to be modified on -some systems, as well as a nested include (ugh) of . - -The "fake" directory contains quick-and-dirty fakes for some header -files and routines that old systems may not have. Note also that --DUSEBCOPY will make utils.h substitute bcopy() for memmove(). - -After that, "make r" will build regcomp.o, regexec.o, regfree.o, -and regerror.o (the actual routines), bundle them together into a test -program, and run regression tests on them. No output is good output. - -"make lib" builds just the .o files for the actual routines (when -you're happy with testing and have adjusted CFLAGS for production), -and puts them together into libregex.a. You can pick up either the -library or *.o ("make lib" makes sure there are no other .o files left -around to confuse things). - -Main.c, debug.c, split.c are used for regression testing but are not part -of the RE routines themselves. - -Regex.h goes in /usr/include. All other .h files are internal only. --------- diff --git a/regex/WHATSNEW b/regex/WHATSNEW deleted file mode 100644 index 6e82e1dae0cd2..0000000000000 --- a/regex/WHATSNEW +++ /dev/null @@ -1,92 +0,0 @@ -New in alpha3.4: The complex bug alluded to below has been fixed (in a -slightly kludgey temporary way that may hurt efficiency a bit; this is -another "get it out the door for 4.4" release). The tests at the end of -the tests file have accordingly been uncommented. The primary sign of -the bug was that something like a?b matching ab matched b rather than ab. -(The bug was essentially specific to this exact situation, else it would -have shown up earlier.) - -New in alpha3.3: The definition of word boundaries has been altered -slightly, to more closely match the usual programming notion that "_" -is an alphabetic. Stuff used for pre-ANSI systems is now in a subdir, -and the makefile no longer alludes to it in mysterious ways. The -makefile has generally been cleaned up some. Fixes have been made -(again!) so that the regression test will run without -DREDEBUG, at -the cost of weaker checking. A workaround for a bug in some folks' - has been added. And some more things have been added to -tests, including a couple right at the end which are commented out -because the code currently flunks them (complex bug; fix coming). -Plus the usual minor cleanup. - -New in alpha3.2: Assorted bits of cleanup and portability improvement -(the development base is now a BSDI system using GCC instead of an ancient -Sun system, and the newer compiler exposed some glitches). Fix for a -serious bug that affected REs using many [] (including REG_ICASE REs -because of the way they are implemented), *sometimes*, depending on -memory-allocation patterns. The header-file prototypes no longer name -the parameters, avoiding possible name conflicts. The possibility that -some clot has defined CHAR_MIN as (say) `-128' instead of `(-128)' is -now handled gracefully. "uchar" is no longer used as an internal type -name (too many people have the same idea). Still the same old lousy -performance, alas. - -New in alpha3.1: Basically nothing, this release is just a bookkeeping -convenience. Stay tuned. - -New in alpha3.0: Performance is no better, alas, but some fixes have been -made and some functionality has been added. (This is basically the "get -it out the door in time for 4.4" release.) One bug fix: regfree() didn't -free the main internal structure (how embarrassing). It is now possible -to put NULs in either the RE or the target string, using (resp.) a new -REG_PEND flag and the old REG_STARTEND flag. The REG_NOSPEC flag to -regcomp() makes all characters ordinary, so you can match a literal -string easily (this will become more useful when performance improves!). -There are now primitives to match beginnings and ends of words, although -the syntax is disgusting and so is the implementation. The REG_ATOI -debugging interface has changed a bit. And there has been considerable -internal cleanup of various kinds. - -New in alpha2.3: Split change list out of README, and moved flags notes -into Makefile. Macro-ized the name of regex(7) in regex(3), since it has -to change for 4.4BSD. Cleanup work in engine.c, and some new regression -tests to catch tricky cases thereof. - -New in alpha2.2: Out-of-date manpages updated. Regerror() acquires two -small extensions -- REG_ITOA and REG_ATOI -- which avoid debugging kludges -in my own test program and might be useful to others for similar purposes. -The regression test will now compile (and run) without REDEBUG. The -BRE \$ bug is fixed. Most uses of "uchar" are gone; it's all chars now. -Char/uchar parameters are now written int/unsigned, to avoid possible -portability problems with unpromoted parameters. Some unsigned casts have -been introduced to minimize portability problems with shifting into sign -bits. - -New in alpha2.1: Lots of little stuff, cleanup and fixes. The one big -thing is that regex.h is now generated, using mkh, rather than being -supplied in the distribution; due to circularities in dependencies, -you have to build regex.h explicitly by "make h". The two known bugs -have been fixed (and the regression test now checks for them), as has a -problem with assertions not being suppressed in the absence of REDEBUG. -No performance work yet. - -New in alpha2: Backslash-anything is an ordinary character, not an -error (except, of course, for the handful of backslashed metacharacters -in BREs), which should reduce script breakage. The regression test -checks *where* null strings are supposed to match, and has generally -been tightened up somewhat. Small bug fixes in parameter passing (not -harmful, but technically errors) and some other areas. Debugging -invoked by defining REDEBUG rather than not defining NDEBUG. - -New in alpha+3: full prototyping for internal routines, using a little -helper program, mkh, which extracts prototypes given in stylized comments. -More minor cleanup. Buglet fix: it's CHAR_BIT, not CHAR_BITS. Simple -pre-screening of input when a literal string is known to be part of the -RE; this does wonders for performance. - -New in alpha+2: minor bits of cleanup. Notably, the number "32" for the -word width isn't hardwired into regexec.c any more, the public header -file prototypes the functions if __STDC__ is defined, and some small typos -in the manpages have been fixed. - -New in alpha+1: improvements to the manual pages, and an important -extension, the REG_STARTEND option to regexec(). diff --git a/regex/cclass.h b/regex/cclass.h deleted file mode 100644 index df41694b0403b..0000000000000 --- a/regex/cclass.h +++ /dev/null @@ -1,30 +0,0 @@ -/* character-class table */ -static struct cclass { - unsigned char *name; - unsigned char *chars; - unsigned char *multis; -} cclasses[] = { - {"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ""}, - {"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - ""}, - {"blank", " \t", ""}, - {"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ -\25\26\27\30\31\32\33\34\35\36\37\177", ""}, - {"digit", "0123456789", ""}, - {"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"lower", "abcdefghijklmnopqrstuvwxyz", - ""}, - {"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", - ""}, - {"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"space", "\t\n\v\f\r ", ""}, - {"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - ""}, - {"xdigit", "0123456789ABCDEFabcdef", - ""}, - {NULL, 0, ""} -}; diff --git a/regex/cname.h b/regex/cname.h deleted file mode 100644 index 670b273882817..0000000000000 --- a/regex/cname.h +++ /dev/null @@ -1,102 +0,0 @@ -/* character-name table */ -static struct cname { - char *name; - char code; -} cnames[] = { - {"NUL", '\0'}, - {"SOH", '\001'}, - {"STX", '\002'}, - {"ETX", '\003'}, - {"EOT", '\004'}, - {"ENQ", '\005'}, - {"ACK", '\006'}, - {"BEL", '\007'}, - {"alert", '\007'}, - {"BS", '\010'}, - {"backspace", '\b'}, - {"HT", '\011'}, - {"tab", '\t'}, - {"LF", '\012'}, - {"newline", '\n'}, - {"VT", '\013'}, - {"vertical-tab", '\v'}, - {"FF", '\014'}, - {"form-feed", '\f'}, - {"CR", '\015'}, - {"carriage-return", '\r'}, - {"SO", '\016'}, - {"SI", '\017'}, - {"DLE", '\020'}, - {"DC1", '\021'}, - {"DC2", '\022'}, - {"DC3", '\023'}, - {"DC4", '\024'}, - {"NAK", '\025'}, - {"SYN", '\026'}, - {"ETB", '\027'}, - {"CAN", '\030'}, - {"EM", '\031'}, - {"SUB", '\032'}, - {"ESC", '\033'}, - {"IS4", '\034'}, - {"FS", '\034'}, - {"IS3", '\035'}, - {"GS", '\035'}, - {"IS2", '\036'}, - {"RS", '\036'}, - {"IS1", '\037'}, - {"US", '\037'}, - {"space", ' '}, - {"exclamation-mark", '!'}, - {"quotation-mark", '"'}, - {"number-sign", '#'}, - {"dollar-sign", '$'}, - {"percent-sign", '%'}, - {"ampersand", '&'}, - {"apostrophe", '\''}, - {"left-parenthesis", '('}, - {"right-parenthesis", ')'}, - {"asterisk", '*'}, - {"plus-sign", '+'}, - {"comma", ','}, - {"hyphen", '-'}, - {"hyphen-minus", '-'}, - {"period", '.'}, - {"full-stop", '.'}, - {"slash", '/'}, - {"solidus", '/'}, - {"zero", '0'}, - {"one", '1'}, - {"two", '2'}, - {"three", '3'}, - {"four", '4'}, - {"five", '5'}, - {"six", '6'}, - {"seven", '7'}, - {"eight", '8'}, - {"nine", '9'}, - {"colon", ':'}, - {"semicolon", ';'}, - {"less-than-sign", '<'}, - {"equals-sign", '='}, - {"greater-than-sign", '>'}, - {"question-mark", '?'}, - {"commercial-at", '@'}, - {"left-square-bracket", '['}, - {"backslash", '\\'}, - {"reverse-solidus", '\\'}, - {"right-square-bracket", ']'}, - {"circumflex", '^'}, - {"circumflex-accent", '^'}, - {"underscore", '_'}, - {"low-line", '_'}, - {"grave-accent", '`'}, - {"left-brace", '{'}, - {"left-curly-bracket", '{'}, - {"vertical-line", '|'}, - {"right-brace", '}'}, - {"right-curly-bracket", '}'}, - {"tilde", '~'}, - {"DEL", '\177'}, - {NULL, 0}, -}; diff --git a/regex/debug.c b/regex/debug.c deleted file mode 100644 index 3db93ef293ae0..0000000000000 --- a/regex/debug.c +++ /dev/null @@ -1,242 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" -#include "debug.ih" - -/* - - regprint - print a regexp for debugging - == void regprint(regex_t *r, FILE *d); - */ -void -regprint(r, d) -regex_t *r; -FILE *d; -{ - register struct re_guts *g = r->re_g; - register int i; - register int c; - register int last; - int nincat[NC]; - - fprintf(d, "%ld states, %d categories", (long)g->nstates, - g->ncategories); - fprintf(d, ", first %ld last %ld", (long)g->firststate, - (long)g->laststate); - if (g->iflags&USEBOL) - fprintf(d, ", USEBOL"); - if (g->iflags&USEEOL) - fprintf(d, ", USEEOL"); - if (g->iflags&BAD) - fprintf(d, ", BAD"); - if (g->nsub > 0) - fprintf(d, ", nsub=%ld", (long)g->nsub); - if (g->must != NULL) - fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen, - g->must); - if (g->backrefs) - fprintf(d, ", backrefs"); - if (g->nplus > 0) - fprintf(d, ", nplus %ld", (long)g->nplus); - fprintf(d, "\n"); - s_print(g, d); - for (i = 0; i < g->ncategories; i++) { - nincat[i] = 0; - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - nincat[i]++; - } - fprintf(d, "cc0#%d", nincat[0]); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] == 1) { - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - break; - fprintf(d, ", %d=%s", i, regchar(c)); - } - fprintf(d, "\n"); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] != 1) { - fprintf(d, "cc%d\t", i); - last = -1; - for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */ - if (c <= CHAR_MAX && g->categories[c] == i) { - if (last < 0) { - fprintf(d, "%s", regchar(c)); - last = c; - } - } else { - if (last >= 0) { - if (last != c-1) - fprintf(d, "-%s", - regchar(c-1)); - last = -1; - } - } - fprintf(d, "\n"); - } -} - -/* - - s_print - print the strip for debugging - == static void s_print(register struct re_guts *g, FILE *d); - */ -static void -s_print(g, d) -register struct re_guts *g; -FILE *d; -{ - register sop *s; - register cset *cs; - register int i; - register int done = 0; - register sop opnd; - register int col = 0; - register int last; - register sopno offset = 2; -# define GAP() { if (offset % 5 == 0) { \ - if (col > 40) { \ - fprintf(d, "\n\t"); \ - col = 0; \ - } else { \ - fprintf(d, " "); \ - col++; \ - } \ - } else \ - col++; \ - offset++; \ - } - - if (OP(g->strip[0]) != OEND) - fprintf(d, "missing initial OEND!\n"); - for (s = &g->strip[1]; !done; s++) { - opnd = OPND(*s); - switch (OP(*s)) { - case OEND: - fprintf(d, "\n"); - done = 1; - break; - case OCHAR: - if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL) - fprintf(d, "\\%c", (unsigned char)opnd); - else - fprintf(d, "%s", regchar((unsigned char)opnd)); - break; - case OBOL: - fprintf(d, "^"); - break; - case OEOL: - fprintf(d, "$"); - break; - case OBOW: - fprintf(d, "\\{"); - break; - case OEOW: - fprintf(d, "\\}"); - break; - case OANY: - fprintf(d, "."); - break; - case OANYOF: - fprintf(d, "[(%ld)", (long)opnd); - cs = &g->sets[opnd]; - last = -1; - for (i = 0; i < g->csetsize+1; i++) /* +1 flushes */ - if (CHIN(cs, i) && i < g->csetsize) { - if (last < 0) { - fprintf(d, "%s", regchar(i)); - last = i; - } - } else { - if (last >= 0) { - if (last != i-1) - fprintf(d, "-%s", - regchar(i-1)); - last = -1; - } - } - fprintf(d, "]"); - break; - case OBACK_: - fprintf(d, "(\\<%ld>", (long)opnd); - break; - case O_BACK: - fprintf(d, "<%ld>\\)", (long)opnd); - break; - case OPLUS_: - fprintf(d, "(+"); - if (OP(*(s+opnd)) != O_PLUS) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_PLUS: - if (OP(*(s-opnd)) != OPLUS_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "+)"); - break; - case OQUEST_: - fprintf(d, "(?"); - if (OP(*(s+opnd)) != O_QUEST) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_QUEST: - if (OP(*(s-opnd)) != OQUEST_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "?)"); - break; - case OLPAREN: - fprintf(d, "((<%ld>", (long)opnd); - break; - case ORPAREN: - fprintf(d, "<%ld>))", (long)opnd); - break; - case OCH_: - fprintf(d, "<"); - if (OP(*(s+opnd)) != OOR2) - fprintf(d, "<%ld>", (long)opnd); - break; - case OOR1: - if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "|"); - break; - case OOR2: - fprintf(d, "|"); - if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_CH: - if (OP(*(s-opnd)) != OOR1) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, ">"); - break; - default: - fprintf(d, "!%ld(%ld)!", OP(*s), opnd); - break; - } - if (!done) - GAP(); - } -} - -/* - - regchar - make a character printable - == static char *regchar(int ch); - */ -static unsigned char * /* -> representation */ -regchar(ch) -int ch; -{ - static unsigned char buf[10]; - - if (isprint(ch) || ch == ' ') - sprintf(buf, "%c", ch); - else - sprintf(buf, "\\%o", ch); - return(buf); -} diff --git a/regex/debug.ih b/regex/debug.ih deleted file mode 100644 index 5f40ff7917876..0000000000000 --- a/regex/debug.ih +++ /dev/null @@ -1,14 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === debug.c === */ -void regprint(regex_t *r, FILE *d); -static void s_print(register struct re_guts *g, FILE *d); -static char *regchar(int ch); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/engine.c b/regex/engine.c deleted file mode 100644 index 0682267f61801..0000000000000 --- a/regex/engine.c +++ /dev/null @@ -1,1019 +0,0 @@ -/* - * The matching engine and friends. This file is #included by regexec.c - * after suitable #defines of a variety of macros used herein, so that - * different state representations can be used without duplicating masses - * of code. - */ - -#ifdef SNAMES -#define matcher smatcher -#define fast sfast -#define slow sslow -#define dissect sdissect -#define backref sbackref -#define step sstep -#define print sprint -#define at sat -#define match smat -#endif -#ifdef LNAMES -#define matcher lmatcher -#define fast lfast -#define slow lslow -#define dissect ldissect -#define backref lbackref -#define step lstep -#define print lprint -#define at lat -#define match lmat -#endif - -/* another structure passed up and down to avoid zillions of parameters */ -struct match { - struct re_guts *g; - int eflags; - regmatch_t *pmatch; /* [nsub+1] (0 element unused) */ - unsigned char *offp; /* offsets work from here */ - unsigned char *beginp; /* start of string -- virtual NUL precedes */ - unsigned char *endp; /* end of string -- virtual NUL here */ - unsigned char *coldp; /* can be no match starting before here */ - unsigned char **lastpos; /* [nplus+1] */ - STATEVARS; - states st; /* current states */ - states fresh; /* states for a fresh start */ - states tmp; /* temporary */ - states empty; /* empty set of states */ -}; - -#include "engine.ih" - -#ifdef REDEBUG -#define SP(t, s, c) print(m, t, s, c, stdout) -#define AT(t, p1, p2, s1, s2) at(m, t, p1, p2, s1, s2) -#define NOTE(str) { if (m->eflags®_TRACE) printf("=%s\n", (str)); } -#else -#define SP(t, s, c) /* nothing */ -#define AT(t, p1, p2, s1, s2) /* nothing */ -#define NOTE(s) /* nothing */ -#endif - -/* - - matcher - the actual matching engine - == static int matcher(register struct re_guts *g, char *string, \ - == size_t nmatch, regmatch_t pmatch[], int eflags); - */ -static int /* 0 success, REG_NOMATCH failure */ -matcher(g, string, nmatch, pmatch, eflags) -register struct re_guts *g; -unsigned char *string; -size_t nmatch; -regmatch_t pmatch[]; -int eflags; -{ - register unsigned char *endp; - register size_t i; - struct match mv; - register struct match *m = &mv; - register unsigned char *dp; - const register sopno gf = g->firststate+1; /* +1 for OEND */ - const register sopno gl = g->laststate; - unsigned char *start; - unsigned char *stop; - - /* simplify the situation where possible */ - if (g->cflags®_NOSUB) - nmatch = 0; - if (eflags®_STARTEND) { - start = string + pmatch[0].rm_so; - stop = string + pmatch[0].rm_eo; - } else { - start = string; - stop = start + strlen(start); - } - if (stop < start) - return(REG_INVARG); - - /* prescreening; this does wonders for this rather slow code */ - if (g->must != NULL) { - for (dp = start; dp < stop; dp++) - if (*dp == g->must[0] && stop - dp >= g->mlen && - memcmp(dp, g->must, (size_t)g->mlen) == 0) - break; - if (dp == stop) /* we didn't find g->must */ - return(REG_NOMATCH); - } - - /* match struct setup */ - m->g = g; - m->eflags = eflags; - m->pmatch = NULL; - m->lastpos = NULL; - m->offp = string; - m->beginp = start; - m->endp = stop; - STATESETUP(m, 4); - SETUP(m->st); - SETUP(m->fresh); - SETUP(m->tmp); - SETUP(m->empty); - CLEAR(m->empty); - - /* this loop does only one repetition except for backrefs */ - for (;;) { - endp = fast(m, start, stop, gf, gl); - if (endp == NULL) { /* a miss */ - STATETEARDOWN(m); - return(REG_NOMATCH); - } - if (nmatch == 0 && !g->backrefs) - break; /* no further info needed */ - - /* where? */ - assert(m->coldp != NULL); - for (;;) { - NOTE("finding start"); - endp = slow(m, m->coldp, stop, gf, gl); - if (endp != NULL) - break; - assert(m->coldp < m->endp); - m->coldp++; - } - if (nmatch == 1 && !g->backrefs) - break; /* no further info needed */ - - /* oh my, he wants the subexpressions... */ - if (m->pmatch == NULL) - m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) * - sizeof(regmatch_t)); - if (m->pmatch == NULL) { - STATETEARDOWN(m); - return(REG_ESPACE); - } - for (i = 1; i <= m->g->nsub; i++) - m->pmatch[i].rm_so = m->pmatch[i].rm_eo = -1; - if (!g->backrefs && !(m->eflags®_BACKR)) { - NOTE("dissecting"); - dp = dissect(m, m->coldp, endp, gf, gl); - } else { - if (g->nplus > 0 && m->lastpos == NULL) - m->lastpos = (unsigned char **)malloc((g->nplus+1) * - sizeof(unsigned char *)); - if (g->nplus > 0 && m->lastpos == NULL) { - free((char *)m->pmatch); - STATETEARDOWN(m); - return(REG_ESPACE); - } - NOTE("backref dissect"); - dp = backref(m, m->coldp, endp, gf, gl, (sopno)0); - } - if (dp != NULL) - break; - - /* uh-oh... we couldn't find a subexpression-level match */ - assert(g->backrefs); /* must be back references doing it */ - assert(g->nplus == 0 || m->lastpos != NULL); - for (;;) { - if (dp != NULL || endp <= m->coldp) - break; /* defeat */ - NOTE("backoff"); - endp = slow(m, m->coldp, endp-1, gf, gl); - if (endp == NULL) - break; /* defeat */ - /* try it on a shorter possibility */ -#ifndef NDEBUG - for (i = 1; i <= m->g->nsub; i++) { - assert(m->pmatch[i].rm_so == -1); - assert(m->pmatch[i].rm_eo == -1); - } -#endif - NOTE("backoff dissect"); - dp = backref(m, m->coldp, endp, gf, gl, (sopno)0); - } - assert(dp == NULL || dp == endp); - if (dp != NULL) /* found a shorter one */ - break; - - /* despite initial appearances, there is no match here */ - NOTE("false alarm"); - start = m->coldp + 1; /* recycle starting later */ - assert(start <= stop); - } - - /* fill in the details if requested */ - if (nmatch > 0) { - pmatch[0].rm_so = m->coldp - m->offp; - pmatch[0].rm_eo = endp - m->offp; - } - if (nmatch > 1) { - assert(m->pmatch != NULL); - for (i = 1; i < nmatch; i++) - if (i <= m->g->nsub) - pmatch[i] = m->pmatch[i]; - else { - pmatch[i].rm_so = -1; - pmatch[i].rm_eo = -1; - } - } - - if (m->pmatch != NULL) - free((char *)m->pmatch); - if (m->lastpos != NULL) - free((char *)m->lastpos); - STATETEARDOWN(m); - return(0); -} - -/* - - dissect - figure out what matched what, no back references - == static unsigned char *dissect(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst); - */ -static unsigned char * /* == stop (success) always */ -dissect(m, start, stop, startst, stopst) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - register int i; - register sopno ss; /* start sop of current subRE */ - register sopno es; /* end sop of current subRE */ - register unsigned char *sp; /* start of string matched by it */ - register unsigned char *stp; /* string matched by it cannot pass here */ - register unsigned char *rest; /* start of rest of string */ - register unsigned char *tail; /* string unmatched by rest of RE */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register unsigned char *ssp; /* start of string matched by subsubRE */ - register unsigned char *sep; /* end of string matched by subsubRE */ - register unsigned char *oldssp; /* previous ssp */ - register unsigned char *dp; - - AT("diss", start, stop, startst, stopst); - sp = start; - for (ss = startst; ss < stopst; ss = es) { - /* identify end of subRE */ - es = ss; - switch (OP(m->g->strip[es])) { - case OPLUS_: - case OQUEST_: - es += OPND(m->g->strip[es]); - break; - case OCH_: - while (OP(m->g->strip[es]) != O_CH) - es += OPND(m->g->strip[es]); - break; - } - es++; - - /* figure out what it matched */ - switch (OP(m->g->strip[ss])) { - case OEND: - assert(PHP_REGEX_NOPE); - break; - case OCHAR: - sp++; - break; - case OBOL: - case OEOL: - case OBOW: - case OEOW: - break; - case OANY: - case OANYOF: - sp++; - break; - case OBACK_: - case O_BACK: - assert(PHP_REGEX_NOPE); - break; - /* cases where length of match is hard to find */ - case OQUEST_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = es - 1; - /* did innards match? */ - if (slow(m, sp, rest, ssub, esub) != NULL) { - dp = dissect(m, sp, rest, ssub, esub); - assert(dp == rest); - } else /* no */ - assert(sp == rest); - sp = rest; - break; - case OPLUS_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = es - 1; - ssp = sp; - oldssp = ssp; - for (;;) { /* find last match of innards */ - sep = slow(m, ssp, rest, ssub, esub); - if (sep == NULL || sep == ssp) - break; /* failed or matched null */ - oldssp = ssp; /* on to next try */ - ssp = sep; - } - if (sep == NULL) { - /* last successful match */ - sep = ssp; - ssp = oldssp; - } - assert(sep == rest); /* must exhaust substring */ - assert(slow(m, ssp, sep, ssub, esub) == rest); - dp = dissect(m, ssp, sep, ssub, esub); - assert(dp == sep); - sp = rest; - break; - case OCH_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = ss + OPND(m->g->strip[ss]) - 1; - assert(OP(m->g->strip[esub]) == OOR1); - for (;;) { /* find first matching branch */ - if (slow(m, sp, rest, ssub, esub) == rest) - break; /* it matched all of it */ - /* that one missed, try next one */ - assert(OP(m->g->strip[esub]) == OOR1); - esub++; - assert(OP(m->g->strip[esub]) == OOR2); - ssub = esub + 1; - esub += OPND(m->g->strip[esub]); - if (OP(m->g->strip[esub]) == OOR2) - esub--; - else - assert(OP(m->g->strip[esub]) == O_CH); - } - dp = dissect(m, sp, rest, ssub, esub); - assert(dp == rest); - sp = rest; - break; - case O_PLUS: - case O_QUEST: - case OOR1: - case OOR2: - case O_CH: - assert(PHP_REGEX_NOPE); - break; - case OLPAREN: - i = OPND(m->g->strip[ss]); - assert(0 < i && i <= m->g->nsub); - m->pmatch[i].rm_so = sp - m->offp; - break; - case ORPAREN: - i = OPND(m->g->strip[ss]); - assert(0 < i && i <= m->g->nsub); - m->pmatch[i].rm_eo = sp - m->offp; - break; - default: /* uh oh */ - assert(PHP_REGEX_NOPE); - break; - } - } - - assert(sp == stop); - return(sp); -} - -/* - - backref - figure out what matched what, figuring in back references - == static unsigned char *backref(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst, sopno lev); - */ -static unsigned char * /* == stop (success) or NULL (failure) */ -backref(m, start, stop, startst, stopst, lev) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -sopno lev; /* PLUS nesting level */ -{ - register int i; - register sopno ss; /* start sop of current subRE */ - register unsigned char *sp; /* start of string matched by it */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register unsigned char *ssp; /* start of string matched by subsubRE */ - register unsigned char *dp; - register size_t len; - register int hard; - register sop s; - register regoff_t offsave; - register cset *cs; - - AT("back", start, stop, startst, stopst); - sp = start; - - /* get as far as we can with easy stuff */ - hard = 0; - for (ss = startst; !hard && ss < stopst; ss++) - switch (OP(s = m->g->strip[ss])) { - case OCHAR: - if (sp == stop || *sp++ != (unsigned char)OPND(s)) - return(NULL); - break; - case OANY: - if (sp == stop) - return(NULL); - sp++; - break; - case OANYOF: - cs = &m->g->sets[OPND(s)]; - if (sp == stop || !CHIN(cs, *sp++)) - return(NULL); - break; - case OBOL: - if ( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) ) - { /* yes */ } - else - return(NULL); - break; - case OEOL: - if ( (sp == m->endp && !(m->eflags®_NOTEOL)) || - (sp < m->endp && *sp == '\n' && - (m->g->cflags®_NEWLINE)) ) - { /* yes */ } - else - return(NULL); - break; - case OBOW: - if (( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp > m->beginp && - !ISWORD(*(sp-1))) ) && - (sp < m->endp && ISWORD(*sp)) ) - { /* yes */ } - else - return(NULL); - break; - case OEOW: - if (( (sp == m->endp && !(m->eflags®_NOTEOL)) || - (sp < m->endp && *sp == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp < m->endp && !ISWORD(*sp)) ) && - (sp > m->beginp && ISWORD(*(sp-1))) ) - { /* yes */ } - else - return(NULL); - break; - case O_QUEST: - break; - case OOR1: /* matches null but needs to skip */ - ss++; - s = m->g->strip[ss]; - do { - assert(OP(s) == OOR2); - ss += OPND(s); - } while (OP(s = m->g->strip[ss]) != O_CH); - /* note that the ss++ gets us past the O_CH */ - break; - default: /* have to make a choice */ - hard = 1; - break; - } - if (!hard) { /* that was it! */ - if (sp != stop) - return(NULL); - return(sp); - } - ss--; /* adjust for the for's final increment */ - - /* the hard stuff */ - AT("hard", sp, stop, ss, stopst); - s = m->g->strip[ss]; - switch (OP(s)) { - case OBACK_: /* the vilest depths */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - if (m->pmatch[i].rm_eo == -1) - return(NULL); - assert(m->pmatch[i].rm_so != -1); - len = m->pmatch[i].rm_eo - m->pmatch[i].rm_so; - assert(stop - m->beginp >= len); - if (sp > stop - len) - return(NULL); /* not enough left to match */ - ssp = m->offp + m->pmatch[i].rm_so; - if (memcmp(sp, ssp, len) != 0) - return(NULL); - while (m->g->strip[ss] != SOP(O_BACK, i)) - ss++; - return(backref(m, sp+len, stop, ss+1, stopst, lev)); - break; - case OQUEST_: /* to null or not */ - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); /* not */ - return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev)); - break; - case OPLUS_: - assert(m->lastpos != NULL); - assert(lev+1 <= m->g->nplus); - m->lastpos[lev+1] = sp; - return(backref(m, sp, stop, ss+1, stopst, lev+1)); - break; - case O_PLUS: - if (sp == m->lastpos[lev]) /* last pass matched null */ - return(backref(m, sp, stop, ss+1, stopst, lev-1)); - /* try another pass */ - m->lastpos[lev] = sp; - dp = backref(m, sp, stop, ss-OPND(s)+1, stopst, lev); - if (dp == NULL) - return(backref(m, sp, stop, ss+1, stopst, lev-1)); - else - return(dp); - break; - case OCH_: /* find the right one, if any */ - ssub = ss + 1; - esub = ss + OPND(s) - 1; - assert(OP(m->g->strip[esub]) == OOR1); - for (;;) { /* find first matching branch */ - dp = backref(m, sp, stop, ssub, esub, lev); - if (dp != NULL) - return(dp); - /* that one missed, try next one */ - if (OP(m->g->strip[esub]) == O_CH) - return(NULL); /* there is none */ - esub++; - assert(OP(m->g->strip[esub]) == OOR2); - ssub = esub + 1; - esub += OPND(m->g->strip[esub]); - if (OP(m->g->strip[esub]) == OOR2) - esub--; - else - assert(OP(m->g->strip[esub]) == O_CH); - } - break; - case OLPAREN: /* must undo assignment if rest fails */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - offsave = m->pmatch[i].rm_so; - m->pmatch[i].rm_so = sp - m->offp; - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); - m->pmatch[i].rm_so = offsave; - return(NULL); - break; - case ORPAREN: /* must undo assignment if rest fails */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - offsave = m->pmatch[i].rm_eo; - m->pmatch[i].rm_eo = sp - m->offp; - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); - m->pmatch[i].rm_eo = offsave; - return(NULL); - break; - default: /* uh oh */ - assert(PHP_REGEX_NOPE); - break; - } - - /* "can't happen" */ - assert(PHP_REGEX_NOPE); - /* NOTREACHED */ - return((unsigned char *)NULL); /* dummy */ -} - -/* - - fast - step through the string at top speed - == static unsigned char *fast(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst); - */ -static unsigned char * /* where tentative match ended, or NULL */ -fast(m, start, stop, startst, stopst) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - register states st = m->st; - register states fresh = m->fresh; - register states tmp = m->tmp; - register unsigned char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register unsigned char *coldp; /* last p after which no match was underway */ - - CLEAR(st); - SET1(st, startst); - st = step(m->g, startst, stopst, st, NOTHING, st); - ASSIGN(fresh, st); - SP("start", st, *p); - coldp = NULL; - for (;;) { - /* next character */ - lastc = c; - c = (p == m->endp) ? OUT : *p; - if (EQ(st, fresh)) - coldp = p; - - /* is there an EOL and/or BOL between lastc and c? */ - flagch = '\0'; - i = 0; - if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || - (lastc == OUT && !(m->eflags®_NOTBOL)) ) { - flagch = BOL; - i = m->g->nbol; - } - if ( (c == '\n' && m->g->cflags®_NEWLINE) || - (c == OUT && !(m->eflags®_NOTEOL)) ) { - flagch = (flagch == BOL) ? BOLEOL : EOL; - i += m->g->neol; - } - if (i != 0) { - for (; i > 0; i--) - st = step(m->g, startst, stopst, st, flagch, st); - SP("boleol", st, c); - } - - /* how about a word boundary? */ - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && - (c != OUT && ISWORD(c)) ) { - flagch = BOW; - } - if ( (lastc != OUT && ISWORD(lastc)) && - (flagch == EOL || (c != OUT && !ISWORD(c))) ) { - flagch = EOW; - } - if (flagch == BOW || flagch == EOW) { - st = step(m->g, startst, stopst, st, flagch, st); - SP("boweow", st, c); - } - - /* are we done? */ - if (ISSET(st, stopst) || p == stop) - break; /* NOTE BREAK OUT */ - - /* no, we must deal with this character */ - ASSIGN(tmp, st); - ASSIGN(st, fresh); - assert(c != OUT); - st = step(m->g, startst, stopst, tmp, c, st); - SP("aft", st, c); - assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); - p++; - } - - assert(coldp != NULL); - m->coldp = coldp; - if (ISSET(st, stopst)) - return(p+1); - else - return(NULL); -} - -/* - - slow - step through the string more deliberately - == static unsigned char *slow(register struct match *m, unsigned char *start, \ - == unsigned char *stop, sopno startst, sopno stopst); - */ -static unsigned char * /* where it ended */ -slow(m, start, stop, startst, stopst) -register struct match *m; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - register states st = m->st; - register states empty = m->empty; - register states tmp = m->tmp; - register unsigned char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register unsigned char *matchp; /* last p at which a match ended */ - - AT("slow", start, stop, startst, stopst); - CLEAR(st); - SET1(st, startst); - SP("sstart", st, *p); - st = step(m->g, startst, stopst, st, NOTHING, st); - matchp = NULL; - for (;;) { - /* next character */ - lastc = c; - c = (p == m->endp) ? OUT : *p; - - /* is there an EOL and/or BOL between lastc and c? */ - flagch = '\0'; - i = 0; - if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || - (lastc == OUT && !(m->eflags®_NOTBOL)) ) { - flagch = BOL; - i = m->g->nbol; - } - if ( (c == '\n' && m->g->cflags®_NEWLINE) || - (c == OUT && !(m->eflags®_NOTEOL)) ) { - flagch = (flagch == BOL) ? BOLEOL : EOL; - i += m->g->neol; - } - if (i != 0) { - for (; i > 0; i--) - st = step(m->g, startst, stopst, st, flagch, st); - SP("sboleol", st, c); - } - - /* how about a word boundary? */ - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && - (c != OUT && ISWORD(c)) ) { - flagch = BOW; - } - if ( (lastc != OUT && ISWORD(lastc)) && - (flagch == EOL || (c != OUT && !ISWORD(c))) ) { - flagch = EOW; - } - if (flagch == BOW || flagch == EOW) { - st = step(m->g, startst, stopst, st, flagch, st); - SP("sboweow", st, c); - } - - /* are we done? */ - if (ISSET(st, stopst)) - matchp = p; - if (EQ(st, empty) || p == stop) - break; /* NOTE BREAK OUT */ - - /* no, we must deal with this character */ - ASSIGN(tmp, st); - ASSIGN(st, empty); - assert(c != OUT); - st = step(m->g, startst, stopst, tmp, c, st); - SP("saft", st, c); - assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); - p++; - } - - return(matchp); -} - - -/* - - step - map set of states reachable before char to set reachable after - == static states step(register struct re_guts *g, sopno start, sopno stop, \ - == register states bef, int ch, register states aft); - == #define BOL (OUT+1) - == #define EOL (BOL+1) - == #define BOLEOL (BOL+2) - == #define NOTHING (BOL+3) - == #define BOW (BOL+4) - == #define EOW (BOL+5) - == #define CODEMAX (BOL+5) // highest code used - == #define NONCHAR(c) ((c) > UCHAR_MAX) - == #define NNONCHAR (CODEMAX-UCHAR_MAX) - */ -static states -step(g, start, stop, bef, ch, aft) -register struct re_guts *g; -sopno start; /* start state within strip */ -sopno stop; /* state after stop state within strip */ -register states bef; /* states reachable before */ -int ch; /* character or NONCHAR code */ -register states aft; /* states already known reachable after */ -{ - register cset *cs; - register sop s; - register sopno pc; - register onestate here; /* note, macros know this name */ - register sopno look; - register long i; - - for (pc = start, INIT(here, pc); pc != stop; pc++, INC(here)) { - s = g->strip[pc]; - switch (OP(s)) { - case OEND: - assert(pc == stop-1); - break; - case OCHAR: - /* only characters can match */ - assert(!NONCHAR(ch) || ch != (unsigned char)OPND(s)); - if (ch == (unsigned char)OPND(s)) - FWD(aft, bef, 1); - break; - case OBOL: - if (ch == BOL || ch == BOLEOL) - FWD(aft, bef, 1); - break; - case OEOL: - if (ch == EOL || ch == BOLEOL) - FWD(aft, bef, 1); - break; - case OBOW: - if (ch == BOW) - FWD(aft, bef, 1); - break; - case OEOW: - if (ch == EOW) - FWD(aft, bef, 1); - break; - case OANY: - if (!NONCHAR(ch)) - FWD(aft, bef, 1); - break; - case OANYOF: - cs = &g->sets[OPND(s)]; - if (!NONCHAR(ch) && CHIN(cs, ch)) - FWD(aft, bef, 1); - break; - case OBACK_: /* ignored here */ - case O_BACK: - FWD(aft, aft, 1); - break; - case OPLUS_: /* forward, this is just an empty */ - FWD(aft, aft, 1); - break; - case O_PLUS: /* both forward and back */ - FWD(aft, aft, 1); - i = ISSETBACK(aft, OPND(s)); - BACK(aft, aft, OPND(s)); - if (!i && ISSETBACK(aft, OPND(s))) { - /* oho, must reconsider loop body */ - pc -= OPND(s) + 1; - INIT(here, pc); - } - break; - case OQUEST_: /* two branches, both forward */ - FWD(aft, aft, 1); - FWD(aft, aft, OPND(s)); - break; - case O_QUEST: /* just an empty */ - FWD(aft, aft, 1); - break; - case OLPAREN: /* not significant here */ - case ORPAREN: - FWD(aft, aft, 1); - break; - case OCH_: /* mark the first two branches */ - FWD(aft, aft, 1); - assert(OP(g->strip[pc+OPND(s)]) == OOR2); - FWD(aft, aft, OPND(s)); - break; - case OOR1: /* done a branch, find the O_CH */ - if (ISSTATEIN(aft, here)) { - for (look = 1; - OP(s = g->strip[pc+look]) != O_CH; - look += OPND(s)) - assert(OP(s) == OOR2); - FWD(aft, aft, look); - } - break; - case OOR2: /* propagate OCH_'s marking */ - FWD(aft, aft, 1); - if (OP(g->strip[pc+OPND(s)]) != O_CH) { - assert(OP(g->strip[pc+OPND(s)]) == OOR2); - FWD(aft, aft, OPND(s)); - } - break; - case O_CH: /* just empty */ - FWD(aft, aft, 1); - break; - default: /* ooooops... */ - assert(PHP_REGEX_NOPE); - break; - } - } - - return(aft); -} - -#ifdef REDEBUG -/* - - print - print a set of states - == #ifdef REDEBUG - == static void print(struct match *m, unsigned char *caption, states st, \ - == int ch, FILE *d); - == #endif - */ -static void -print(m, caption, st, ch, d) -struct match *m; -unsigned char *caption; -states st; -int ch; -FILE *d; -{ - register struct re_guts *g = m->g; - register int i; - register int first = 1; - - if (!(m->eflags®_TRACE)) - return; - - fprintf(d, "%s", caption); - if (ch != '\0') - fprintf(d, " %s", pchar(ch)); - for (i = 0; i < g->nstates; i++) - if (ISSET(st, i)) { - fprintf(d, "%s%d", (first) ? "\t" : ", ", i); - first = 0; - } - fprintf(d, "\n"); -} - -/* - - at - print current situation - == #ifdef REDEBUG - == static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, \ - == sopno startst, sopno stopst); - == #endif - */ -static void -at(m, title, start, stop, startst, stopst) -struct match *m; -unsigned char *title; -unsigned char *start; -unsigned char *stop; -sopno startst; -sopno stopst; -{ - if (!(m->eflags®_TRACE)) - return; - - printf("%s %s-", title, pchar(*start)); - printf("%s ", pchar(*stop)); - printf("%ld-%ld\n", (long)startst, (long)stopst); -} - -#ifndef PCHARDONE -#define PCHARDONE /* never again */ -/* - - pchar - make a character printable - == #ifdef REDEBUG - == static unsigned char *pchar(int ch); - == #endif - * - * Is this identical to regchar() over in debug.c? Well, yes. But a - * duplicate here avoids having a debugging-capable regexec.o tied to - * a matching debug.o, and this is convenient. It all disappears in - * the non-debug compilation anyway, so it doesn't matter much. - */ -static unsigned char * /* -> representation */ -pchar(ch) -int ch; -{ - static unsigned char pbuf[10]; - - if (isprint(ch) || ch == ' ') - sprintf(pbuf, "%c", ch); - else - sprintf(pbuf, "\\%o", ch); - return(pbuf); -} -#endif -#endif - -#undef matcher -#undef fast -#undef slow -#undef dissect -#undef backref -#undef step -#undef print -#undef at -#undef match diff --git a/regex/engine.ih b/regex/engine.ih deleted file mode 100644 index 9a301838bcd90..0000000000000 --- a/regex/engine.ih +++ /dev/null @@ -1,35 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === engine.c === */ -static int matcher(register struct re_guts *g, unsigned char *string, size_t nmatch, regmatch_t pmatch[], int eflags); -static unsigned char *dissect(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -static unsigned char *backref(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst, sopno lev); -static unsigned char *fast(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -static unsigned char *slow(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft); -#define BOL (OUT+1) -#define EOL (BOL+1) -#define BOLEOL (BOL+2) -#define NOTHING (BOL+3) -#define BOW (BOL+4) -#define EOW (BOL+5) -#define CODEMAX (BOL+5) /* highest code used */ -#define NONCHAR(c) ((c) > UCHAR_MAX) -#define NNONCHAR (CODEMAX-UCHAR_MAX) -#ifdef REDEBUG -static void print(struct match *m, unsigned char *caption, states st, int ch, FILE *d); -#endif -#ifdef REDEBUG -static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst); -#endif -#ifdef REDEBUG -static unsigned char *pchar(int ch); -#endif - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/main.c b/regex/main.c deleted file mode 100644 index 657338a2c1998..0000000000000 --- a/regex/main.c +++ /dev/null @@ -1,510 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "main.ih" - -char *progname; -int debug = 0; -int line = 0; -int status = 0; - -int copts = REG_EXTENDED; -int eopts = 0; -regoff_t startoff = 0; -regoff_t endoff = 0; - - -extern int split(); -extern void regprint(); - -/* - - main - do the simple case, hand off to regress() for regression - */ -int main(argc, argv) -int argc; -char *argv[]; -{ - regex_t re; -# define NS 10 - regmatch_t subs[NS]; - char erbuf[100]; - int err; - size_t len; - int c; - int errflg = 0; - register int i; - extern int optind; - extern char *optarg; - - progname = argv[0]; - - while ((c = getopt(argc, argv, "c:e:S:E:x")) != EOF) - switch (c) { - case 'c': /* compile options */ - copts = options('c', optarg); - break; - case 'e': /* execute options */ - eopts = options('e', optarg); - break; - case 'S': /* start offset */ - startoff = (regoff_t)atoi(optarg); - break; - case 'E': /* end offset */ - endoff = (regoff_t)atoi(optarg); - break; - case 'x': /* Debugging. */ - debug++; - break; - case '?': - default: - errflg++; - break; - } - if (errflg) { - fprintf(stderr, "usage: %s ", progname); - fprintf(stderr, "[-c copt][-C][-d] [re]\n"); - exit(2); - } - - if (optind >= argc) { - regress(stdin); - exit(status); - } - - err = regcomp(&re, argv[optind++], copts); - if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); - exit(status); - } - regprint(&re, stdout); - - if (optind >= argc) { - regfree(&re); - exit(status); - } - - if (eopts®_STARTEND) { - subs[0].rm_so = startoff; - subs[0].rm_eo = strlen(argv[optind]) - endoff; - } - err = regexec(&re, argv[optind], (size_t)NS, subs, eopts); - if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); - exit(status); - } - if (!(copts®_NOSUB)) { - len = (int)(subs[0].rm_eo - subs[0].rm_so); - if (subs[0].rm_so != -1) { - if (len != 0) - printf("match `%.*s'\n", (int)len, - argv[optind] + subs[0].rm_so); - else - printf("match `'@%.1s\n", - argv[optind] + subs[0].rm_so); - } - for (i = 1; i < NS; i++) - if (subs[i].rm_so != -1) - printf("(%d) `%.*s'\n", i, - (int)(subs[i].rm_eo - subs[i].rm_so), - argv[optind] + subs[i].rm_so); - } - exit(status); -} - -/* - - regress - main loop of regression test - == void regress(FILE *in); - */ -void -regress(in) -FILE *in; -{ - char inbuf[1000]; -# define MAXF 10 - char *f[MAXF]; - int nf; - int i; - char erbuf[100]; - size_t ne; - char *badpat = "invalid regular expression"; -# define SHORT 10 - char *bpname = "REG_BADPAT"; - regex_t re; - - while (fgets(inbuf, sizeof(inbuf), in) != NULL) { - line++; - if (inbuf[0] == '#' || inbuf[0] == '\n') - continue; /* NOTE CONTINUE */ - inbuf[strlen(inbuf)-1] = '\0'; /* get rid of stupid \n */ - if (debug) - fprintf(stdout, "%d:\n", line); - nf = split(inbuf, f, MAXF, "\t\t"); - if (nf < 3) { - fprintf(stderr, "bad input, line %d\n", line); - exit(1); - } - for (i = 0; i < nf; i++) - if (strcmp(f[i], "\"\"") == 0) - f[i] = ""; - if (nf <= 3) - f[3] = NULL; - if (nf <= 4) - f[4] = NULL; - try(f[0], f[1], f[2], f[3], f[4], options('c', f[1])); - if (opt('&', f[1])) /* try with either type of RE */ - try(f[0], f[1], f[2], f[3], f[4], - options('c', f[1]) &~ REG_EXTENDED); - } - - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) { - fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n", - erbuf, badpat); - status = 1; - } - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT); - if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || - ne != strlen(badpat)+1) { - fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", - erbuf, SHORT-1, badpat); - status = 1; - } - ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { - fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", - erbuf, bpname); - status = 1; - } - re.re_endp = bpname; - ne = regerror(REG_ATOI, &re, erbuf, sizeof(erbuf)); - if (atoi(erbuf) != (int)REG_BADPAT) { - fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", - erbuf, (long)REG_BADPAT); - status = 1; - } else if (ne != strlen(erbuf)+1) { - fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n", - erbuf, (long)REG_BADPAT); - status = 1; - } -} - -/* - - try - try it, and report on problems - == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); - */ -void -try(f0, f1, f2, f3, f4, opts) -char *f0; -char *f1; -char *f2; -char *f3; -char *f4; -int opts; /* may not match f1 */ -{ - regex_t re; -# define NSUBS 10 - regmatch_t subs[NSUBS]; -# define NSHOULD 15 - char *should[NSHOULD]; - int nshould; - char erbuf[100]; - int err; - int len; - char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; - register int i; - char *grump; - char f0copy[1000]; - char f2copy[1000]; - - strcpy(f0copy, f0); - re.re_endp = (opts®_PEND) ? f0copy + strlen(f0copy) : NULL; - fixstr(f0copy); - err = regcomp(&re, f0copy, opts); - if (err != 0 && (!opt('C', f1) || err != efind(f2))) { - /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); - status = 1; - } else if (err == 0 && opt('C', f1)) { - /* unexpected success */ - fprintf(stderr, "%d: %s should have given REG_%s\n", - line, type, f2); - status = 1; - err = 1; /* so we won't try regexec */ - } - - if (err != 0) { - regfree(&re); - return; - } - - strcpy(f2copy, f2); - fixstr(f2copy); - - if (options('e', f1)®_STARTEND) { - if (strchr(f2, '(') == NULL || strchr(f2, ')') == NULL) - fprintf(stderr, "%d: bad STARTEND syntax\n", line); - subs[0].rm_so = strchr(f2, '(') - f2 + 1; - subs[0].rm_eo = strchr(f2, ')') - f2; - } - err = regexec(&re, f2copy, NSUBS, subs, options('e', f1)); - - if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { - /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); - status = 1; - } else if (err != 0) { - /* nothing more to check */ - } else if (f3 == NULL) { - /* unexpected success */ - fprintf(stderr, "%d: %s exec should have failed\n", - line, type); - status = 1; - err = 1; /* just on principle */ - } else if (opts®_NOSUB) { - /* nothing more to check */ - } else if ((grump = check(f2, subs[0], f3)) != NULL) { - fprintf(stderr, "%d: %s %s\n", line, type, grump); - status = 1; - err = 1; - } - - if (err != 0 || f4 == NULL) { - regfree(&re); - return; - } - - for (i = 1; i < NSHOULD; i++) - should[i] = NULL; - nshould = split(f4, should+1, NSHOULD-1, ","); - if (nshould == 0) { - nshould = 1; - should[1] = ""; - } - for (i = 1; i < NSUBS; i++) { - grump = check(f2, subs[i], should[i]); - if (grump != NULL) { - fprintf(stderr, "%d: %s $%d %s\n", line, - type, i, grump); - status = 1; - err = 1; - } - } - - regfree(&re); -} - -/* - - options - pick options out of a regression-test string - == int options(int type, char *s); - */ -int -options(type, s) -int type; /* 'c' compile, 'e' exec */ -char *s; -{ - register char *p; - register int o = (type == 'c') ? copts : eopts; - register char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; - - for (p = s; *p != '\0'; p++) - if (strchr(legal, *p) != NULL) - switch (*p) { - case 'b': - o &= ~REG_EXTENDED; - break; - case 'i': - o |= REG_ICASE; - break; - case 's': - o |= REG_NOSUB; - break; - case 'n': - o |= REG_NEWLINE; - break; - case 'm': - o &= ~REG_EXTENDED; - o |= REG_NOSPEC; - break; - case 'p': - o |= REG_PEND; - break; - case '^': - o |= REG_NOTBOL; - break; - case '$': - o |= REG_NOTEOL; - break; - case '#': - o |= REG_STARTEND; - break; - case 't': /* trace */ - o |= REG_TRACE; - break; - case 'l': /* force long representation */ - o |= REG_LARGE; - break; - case 'r': /* force backref use */ - o |= REG_BACKR; - break; - } - return(o); -} - -/* - - opt - is a particular option in a regression string? - == int opt(int c, char *s); - */ -int /* predicate */ -opt(c, s) -int c; -char *s; -{ - return(strchr(s, c) != NULL); -} - -/* - - fixstr - transform magic characters in strings - == void fixstr(register char *p); - */ -void -fixstr(p) -register char *p; -{ - if (p == NULL) - return; - - for (; *p != '\0'; p++) - if (*p == 'N') - *p = '\n'; - else if (*p == 'T') - *p = '\t'; - else if (*p == 'S') - *p = ' '; - else if (*p == 'Z') - *p = '\0'; -} - -/* - - check - check a substring match - == char *check(char *str, regmatch_t sub, char *should); - */ -char * /* NULL or complaint */ -check(str, sub, should) -char *str; -regmatch_t sub; -char *should; -{ - register int len; - register int shlen; - register char *p; - static char grump[500]; - register char *at = NULL; - - if (should != NULL && strcmp(should, "-") == 0) - should = NULL; - if (should != NULL && should[0] == '@') { - at = should + 1; - should = ""; - } - - /* check rm_so and rm_eo for consistency */ - if (sub.rm_so > sub.rm_eo || (sub.rm_so == -1 && sub.rm_eo != -1) || - (sub.rm_so != -1 && sub.rm_eo == -1) || - (sub.rm_so != -1 && sub.rm_so < 0) || - (sub.rm_eo != -1 && sub.rm_eo < 0) ) { - sprintf(grump, "start %ld end %ld", (long)sub.rm_so, - (long)sub.rm_eo); - return(grump); - } - - /* check for no match */ - if (sub.rm_so == -1 && should == NULL) - return(NULL); - if (sub.rm_so == -1) - return("did not match"); - - /* check for in range */ - if (sub.rm_eo > strlen(str)) { - sprintf(grump, "start %ld end %ld, past end of string", - (long)sub.rm_so, (long)sub.rm_eo); - return(grump); - } - - len = (int)(sub.rm_eo - sub.rm_so); - shlen = (int)strlen(should); - p = str + sub.rm_so; - - /* check for not supposed to match */ - if (should == NULL) { - sprintf(grump, "matched `%.*s'", len, p); - return(grump); - } - - /* check for wrong match */ - if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) { - sprintf(grump, "matched `%.*s' instead", len, p); - return(grump); - } - if (shlen > 0) - return(NULL); - - /* check null match in right place */ - if (at == NULL) - return(NULL); - shlen = strlen(at); - if (shlen == 0) - shlen = 1; /* force check for end-of-string */ - if (strncmp(p, at, shlen) != 0) { - sprintf(grump, "matched null at `%.20s'", p); - return(grump); - } - return(NULL); -} - -/* - - eprint - convert error number to name - == static char *eprint(int err); - */ -static char * -eprint(err) -int err; -{ - static char epbuf[100]; - size_t len; - - len = regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf)); - assert(len <= sizeof(epbuf)); - return(epbuf); -} - -/* - - efind - convert error name to number - == static int efind(char *name); - */ -static int -efind(name) -char *name; -{ - static char efbuf[100]; - regex_t re; - - sprintf(efbuf, "REG_%s", name); - assert(strlen(efbuf) < sizeof(efbuf)); - re.re_endp = efbuf; - (void) regerror(REG_ATOI, &re, efbuf, sizeof(efbuf)); - return(atoi(efbuf)); -} diff --git a/regex/main.ih b/regex/main.ih deleted file mode 100644 index 5a0118ac44167..0000000000000 --- a/regex/main.ih +++ /dev/null @@ -1,19 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === main.c === */ -void regress(FILE *in); -void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); -int options(int type, char *s); -int opt(int c, char *s); -void fixstr(register char *p); -char *check(char *str, regmatch_t sub, char *should); -static char *eprint(int err); -static int efind(char *name); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/mkh b/regex/mkh deleted file mode 100644 index 252b246c7bd25..0000000000000 --- a/regex/mkh +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -# mkh - pull headers out of C source -PATH=/bin:/usr/bin ; export PATH - -# egrep pattern to pick out marked lines -egrep='^ =([ ]|$)' - -# Sed program to process marked lines into lines for the header file. -# The markers have already been removed. Two things are done here: removal -# of backslashed newlines, and some fudging of comments. The first is done -# because -o needs to have prototypes on one line to strip them down. -# Getting comments into the output is tricky; we turn C++-style // comments -# into /* */ comments, after altering any existing */'s to avoid trouble. -peel=' /\\$/N - /\\\n[ ]*/s///g - /\/\//s;\*/;* /;g - /\/\//s;//\(.*\);/*\1 */;' - -for a -do - case "$a" in - -o) # old (pre-function-prototype) compiler - # add code to comment out argument lists - peel="$peel - "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1(/*\2*/);' - shift - ;; - -b) # funny Berkeley __P macro - peel="$peel - "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1 __P((\2));' - shift - ;; - -s) # compiler doesn't like `static foo();' - # add code to get rid of the `static' - peel="$peel - "'/^static[ ][^\/]*[a-zA-Z0-9_)](.*)/s;static.;;' - shift - ;; - -p) # private declarations - egrep='^ ==([ ]|$)' - shift - ;; - -i) # wrap in #ifndef, argument is name - ifndef="$2" - shift ; shift - ;; - *) break - ;; - esac -done - -if test " $ifndef" != " " -then - echo "#ifndef $ifndef" - echo "#define $ifndef /* never again */" -fi -echo "/* ========= begin header generated by $0 ========= */" -echo '#ifdef __cplusplus' -echo 'extern "C" {' -echo '#endif' -for f -do - echo - echo "/* === $f === */" - egrep "$egrep" $f | sed 's/^ ==*[ ]//;s/^ ==*$//' | sed "$peel" - echo -done -echo '#ifdef __cplusplus' -echo '}' -echo '#endif' -echo "/* ========= end header generated by $0 ========= */" -if test " $ifndef" != " " -then - echo "#endif" -fi -exit 0 diff --git a/regex/regcomp.c b/regex/regcomp.c deleted file mode 100644 index d72cc829403be..0000000000000 --- a/regex/regcomp.c +++ /dev/null @@ -1,1613 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define POSIX_MISTAKE - -#include "utils.h" -#include "regex.h" -#include "regex2.h" - -#include "cclass.h" -#include "cname.h" - -/* - * parse structure, passed up and down to avoid global variables and - * other clumsinesses - */ -struct parse { - unsigned char *next; /* next character in RE */ - unsigned char *end; /* end of string (-> NUL normally) */ - int error; /* has an error been seen? */ - sop *strip; /* malloced strip */ - sopno ssize; /* malloced strip size (allocated) */ - sopno slen; /* malloced strip length (used) */ - int ncsalloc; /* number of csets allocated */ - struct re_guts *g; -# define NPAREN 10 /* we need to remember () 1-9 for back refs */ - sopno pbegin[NPAREN]; /* -> ( ([0] unused) */ - sopno pend[NPAREN]; /* -> ) ([0] unused) */ -}; - -#include "regcomp.ih" - -static unsigned char nuls[10]; /* place to point scanner in event of error */ - -/* - * macros for use with parse structure - * BEWARE: these know that the parse structure is named `p' !!! - */ -#define PEEK() (*p->next) -#define PEEK2() (*(p->next+1)) -#define MORE() (p->next < p->end) -#define MORE2() (p->next+1 < p->end) -#define SEE(c) (MORE() && PEEK() == (c)) -#define SEETWO(a, b) (MORE() && MORE2() && PEEK() == (a) && PEEK2() == (b)) -#define EAT(c) ((SEE(c)) ? (NEXT(), 1) : 0) -#define EATTWO(a, b) ((SEETWO(a, b)) ? (NEXT2(), 1) : 0) -#define NEXT() (p->next++) -#define NEXT2() (p->next += 2) -#define NEXTn(n) (p->next += (n)) -#define GETNEXT() (*p->next++) -#define SETERROR(e) seterr(p, (e)) -#define REQUIRE(co, e) (void) ((co) || SETERROR(e)) -#define MUSTSEE(c, e) (REQUIRE(MORE() && PEEK() == (c), e)) -#define MUSTEAT(c, e) (REQUIRE(MORE() && GETNEXT() == (c), e)) -#define MUSTNOTSEE(c, e) (REQUIRE(!MORE() || PEEK() != (c), e)) -#define EMIT(op, sopnd) doemit(p, (sop)(op), (size_t)(sopnd)) -#define INSERT(op, pos) doinsert(p, (sop)(op), HERE()-(pos)+1, pos) -#define AHEAD(pos) dofwd(p, pos, HERE()-(pos)) -#define ASTERN(sop, pos) EMIT(sop, HERE()-pos) -#define HERE() (p->slen) -#define THERE() (p->slen - 1) -#define THERETHERE() (p->slen - 2) -#define DROP(n) (p->slen -= (n)) - -#ifndef NDEBUG -static int never = 0; /* for use in asserts; shuts lint up */ -#else -#define never 0 /* some s have bugs too */ -#endif - -/* - - regcomp - interface for parser and compilation - = API_EXPORT(int) regcomp(regex_t *, const char *, int); - = #define REG_BASIC 0000 - = #define REG_EXTENDED 0001 - = #define REG_ICASE 0002 - = #define REG_NOSUB 0004 - = #define REG_NEWLINE 0010 - = #define REG_NOSPEC 0020 - = #define REG_PEND 0040 - = #define REG_DUMP 0200 - */ -API_EXPORT(int) /* 0 success, otherwise REG_something */ -regcomp(preg, pattern, cflags) -regex_t *preg; -const char *pattern; -int cflags; -{ - struct parse pa; - register struct re_guts *g; - register struct parse *p = &pa; - register int i; - register size_t len; -#ifdef REDEBUG -# define GOODFLAGS(f) (f) -#else -# define GOODFLAGS(f) ((f)&~REG_DUMP) -#endif - - cflags = GOODFLAGS(cflags); - if ((cflags®_EXTENDED) && (cflags®_NOSPEC)) - return(REG_INVARG); - - if (cflags®_PEND) { - if (preg->re_endp < pattern) - return(REG_INVARG); - len = preg->re_endp - pattern; - } else - len = strlen((char *)pattern); - - /* do the mallocs early so failure handling is easy */ - g = (struct re_guts *)malloc(sizeof(struct re_guts) + - (NC-1)*sizeof(cat_t)); - if (g == NULL) - return(REG_ESPACE); - p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ - p->strip = (sop *)malloc(p->ssize * sizeof(sop)); - p->slen = 0; - if (p->strip == NULL) { - free((char *)g); - return(REG_ESPACE); - } - - /* set things up */ - p->g = g; - p->next = (unsigned char *)pattern; /* convenience; we do not modify it */ - p->end = p->next + len; - p->error = 0; - p->ncsalloc = 0; - for (i = 0; i < NPAREN; i++) { - p->pbegin[i] = 0; - p->pend[i] = 0; - } - g->csetsize = NC; - g->sets = NULL; - g->setbits = NULL; - g->ncsets = 0; - g->cflags = cflags; - g->iflags = 0; - g->nbol = 0; - g->neol = 0; - g->must = NULL; - g->mlen = 0; - g->nsub = 0; - g->ncategories = 1; /* category 0 is "everything else" */ - g->categories = &g->catspace[0]; - (void) memset((char *)g->catspace, 0, NC*sizeof(cat_t)); - g->backrefs = 0; - - /* do it */ - EMIT(OEND, 0); - g->firststate = THERE(); - if (cflags®_EXTENDED) - p_ere(p, OUT); - else if (cflags®_NOSPEC) - p_str(p); - else - p_bre(p, OUT, OUT); - EMIT(OEND, 0); - g->laststate = THERE(); - - /* tidy up loose ends and fill things in */ - categorize(p, g); - stripsnug(p, g); - findmust(p, g); - g->nplus = pluscount(p, g); - g->magic = MAGIC2; - preg->re_nsub = g->nsub; - preg->re_g = g; - preg->re_magic = MAGIC1; -#ifndef REDEBUG - /* not debugging, so can't rely on the assert() in regexec() */ - if (g->iflags&BAD) - SETERROR(REG_ASSERT); -#endif - - /* win or lose, we're done */ - if (p->error != 0) /* lose */ - regfree(preg); - return(p->error); -} - -/* - - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(register struct parse *p, int stop); - */ -static void -p_ere(p, stop) -register struct parse *p; -int stop; /* character this ERE should end at */ -{ - register unsigned char c; - register sopno prevback = 0; - register sopno prevfwd = 0; - register sopno conc; - register int first = 1; /* is this the first alternative? */ - - for (;;) { - /* do a bunch of concatenated expressions */ - conc = HERE(); - while (MORE() && (c = PEEK()) != '|' && c != stop) - p_ere_exp(p); - (void) REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */ - - if (!EAT('|')) - break; /* NOTE BREAK OUT */ - - if (first) { - INSERT(OCH_, conc); /* offset is wrong */ - prevfwd = conc; - prevback = conc; - first = 0; - } - ASTERN(OOR1, prevback); - prevback = THERE(); - AHEAD(prevfwd); /* fix previous offset */ - prevfwd = HERE(); - EMIT(OOR2, 0); /* offset is very wrong */ - } - - if (!first) { /* tail-end fixups */ - AHEAD(prevfwd); - ASTERN(O_CH, prevback); - } - - assert(!MORE() || SEE(stop)); -} - -/* - - p_ere_exp - parse one subERE, an atom possibly followed by a repetition op - == static void p_ere_exp(register struct parse *p); - */ -static void -p_ere_exp(p) -register struct parse *p; -{ - register unsigned char c; - register sopno pos; - register int count; - register int count2; - register sopno subno; - int wascaret = 0; - - assert(MORE()); /* caller should have ensured this */ - c = GETNEXT(); - - pos = HERE(); - switch (c) { - case '(': - REQUIRE(MORE(), REG_EPAREN); - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - if (!SEE(')')) - p_ere(p, ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); - } - EMIT(ORPAREN, subno); - MUSTEAT(')', REG_EPAREN); - break; -#ifndef POSIX_MISTAKE - case ')': /* happens only if no current unmatched ( */ - /* - * You may ask, why the ifndef? Because I didn't notice - * this until slightly too late for 1003.2, and none of the - * other 1003.2 regular-expression reviewers noticed it at - * all. So an unmatched ) is legal POSIX, at least until - * we can get it fixed. - */ - SETERROR(REG_EPAREN); - break; -#endif - case '^': - EMIT(OBOL, 0); - p->g->iflags |= USEBOL; - p->g->nbol++; - wascaret = 1; - break; - case '$': - EMIT(OEOL, 0); - p->g->iflags |= USEEOL; - p->g->neol++; - break; - case '|': - SETERROR(REG_EMPTY); - break; - case '*': - case '+': - case '?': - SETERROR(REG_BADRPT); - break; - case '.': - if (p->g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case '\\': - REQUIRE(MORE(), REG_EESCAPE); - c = GETNEXT(); - ordinary(p, c); - break; - case '{': /* okay as ordinary except if digit follows */ - REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT); - /* FALLTHROUGH */ - default: - ordinary(p, c); - break; - } - - if (!MORE()) - return; - c = PEEK(); - /* we call { a repetition if followed by a digit */ - if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) )) - return; /* no repetition, we're done */ - NEXT(); - - REQUIRE(!wascaret, REG_BADRPT); - switch (c) { - case '*': /* implemented as +? */ - /* this case does not require the (y|) trick, noKLUDGE */ - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - INSERT(OQUEST_, pos); - ASTERN(O_QUEST, pos); - break; - case '+': - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - break; - case '?': - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, pos); /* offset slightly wrong */ - ASTERN(OOR1, pos); /* this one's right */ - AHEAD(pos); /* fix the OCH_ */ - EMIT(OOR2, 0); /* offset very wrong... */ - AHEAD(THERE()); /* ...so fix it */ - ASTERN(O_CH, THERETHERE()); - break; - case '{': - count = p_count(p); - if (EAT(',')) { - if (isdigit(PEEK())) { - count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); - } else /* single number with comma */ - count2 = INFINITY; - } else /* just a single number */ - count2 = count; - repeat(p, pos, count, count2); - if (!EAT('}')) { /* error heuristics */ - while (MORE() && PEEK() != '}') - NEXT(); - REQUIRE(MORE(), REG_EBRACE); - SETERROR(REG_BADBR); - } - break; - } - - if (!MORE()) - return; - c = PEEK(); - if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) ) ) - return; - SETERROR(REG_BADRPT); -} - -/* - - p_str - string (no metacharacters) "parser" - == static void p_str(register struct parse *p); - */ -static void -p_str(p) -register struct parse *p; -{ - REQUIRE(MORE(), REG_EMPTY); - while (MORE()) - ordinary(p, GETNEXT()); -} - -/* - - p_bre - BRE parser top level, anchoring and concatenation - == static void p_bre(register struct parse *p, register int end1, \ - == register int end2); - * Giving end1 as OUT essentially eliminates the end1/end2 check. - * - * This implementation is a bit of a kludge, in that a trailing $ is first - * taken as an ordinary character and then revised to be an anchor. The - * only undesirable side effect is that '$' gets included as a character - * category in such cases. This is fairly harmless; not worth fixing. - * The amount of lookahead needed to avoid this kludge is excessive. - */ -static void -p_bre(p, end1, end2) -register struct parse *p; -register int end1; /* first terminating character */ -register int end2; /* second terminating character */ -{ - register sopno start = HERE(); - register int first = 1; /* first subexpression? */ - register int wasdollar = 0; - - if (EAT('^')) { - EMIT(OBOL, 0); - p->g->iflags |= USEBOL; - p->g->nbol++; - } - while (MORE() && !SEETWO(end1, end2)) { - wasdollar = p_simp_re(p, first); - first = 0; - } - if (wasdollar) { /* oops, that was a trailing anchor */ - DROP(1); - EMIT(OEOL, 0); - p->g->iflags |= USEEOL; - p->g->neol++; - } - - REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */ -} - -/* - - p_simp_re - parse a simple RE, an atom possibly followed by a repetition - == static int p_simp_re(register struct parse *p, int starordinary); - */ -static int /* was the simple RE an unbackslashed $? */ -p_simp_re(p, starordinary) -register struct parse *p; -int starordinary; /* is a leading * an ordinary character? */ -{ - register int c; - register int count; - register int count2; - register sopno pos; - register int i; - register sopno subno; -# define BACKSL (1<g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case BACKSL|'{': - SETERROR(REG_BADRPT); - break; - case BACKSL|'(': - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - /* the MORE here is an error heuristic */ - if (MORE() && !SEETWO('\\', ')')) - p_bre(p, '\\', ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); - } - EMIT(ORPAREN, subno); - REQUIRE(EATTWO('\\', ')'), REG_EPAREN); - break; - case BACKSL|')': /* should not get here -- must be user */ - case BACKSL|'}': - SETERROR(REG_EPAREN); - break; - case BACKSL|'1': - case BACKSL|'2': - case BACKSL|'3': - case BACKSL|'4': - case BACKSL|'5': - case BACKSL|'6': - case BACKSL|'7': - case BACKSL|'8': - case BACKSL|'9': - i = (c&~BACKSL) - '0'; - assert(i < NPAREN); - if (p->pend[i] != 0) { - assert(i <= p->g->nsub); - EMIT(OBACK_, i); - assert(p->pbegin[i] != 0); - assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); - assert(OP(p->strip[p->pend[i]]) == ORPAREN); - (void) dupl(p, p->pbegin[i]+1, p->pend[i]); - EMIT(O_BACK, i); - } else - SETERROR(REG_ESUBREG); - p->g->backrefs = 1; - break; - case '*': - REQUIRE(starordinary, REG_BADRPT); - /* FALLTHROUGH */ - default: - ordinary(p, (unsigned char)c); /* takes off BACKSL, if any */ - break; - } - - if (EAT('*')) { /* implemented as +? */ - /* this case does not require the (y|) trick, noKLUDGE */ - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - INSERT(OQUEST_, pos); - ASTERN(O_QUEST, pos); - } else if (EATTWO('\\', '{')) { - count = p_count(p); - if (EAT(',')) { - if (MORE() && isdigit(PEEK())) { - count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); - } else /* single number with comma */ - count2 = INFINITY; - } else /* just a single number */ - count2 = count; - repeat(p, pos, count, count2); - if (!EATTWO('\\', '}')) { /* error heuristics */ - while (MORE() && !SEETWO('\\', '}')) - NEXT(); - REQUIRE(MORE(), REG_EBRACE); - SETERROR(REG_BADBR); - } - } else if (c == (unsigned char)'$') /* $ (but not \$) ends it */ - return(1); - - return(0); -} - -/* - - p_count - parse a repetition count - == static int p_count(register struct parse *p); - */ -static int /* the value */ -p_count(p) -register struct parse *p; -{ - register int count = 0; - register int ndigits = 0; - - while (MORE() && isdigit(PEEK()) && count <= DUPMAX) { - count = count*10 + (GETNEXT() - '0'); - ndigits++; - } - - REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR); - return(count); -} - -/* - - p_bracket - parse a bracketed character list - == static void p_bracket(register struct parse *p); - * - * Note a significant property of this code: if the allocset() did SETERROR, - * no set operations are done. - */ -static void -p_bracket(p) -register struct parse *p; -{ - register cset *cs = allocset(p); - register int invert = 0; - - /* Dept of Truly Sickening Special-Case Kludges */ - if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) { - EMIT(OBOW, 0); - NEXTn(6); - return; - } - if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]", 6) == 0) { - EMIT(OEOW, 0); - NEXTn(6); - return; - } - - if (EAT('^')) - invert++; /* make note to invert set at end */ - if (EAT(']')) - CHadd(cs, ']'); - else if (EAT('-')) - CHadd(cs, '-'); - while (MORE() && PEEK() != ']' && !SEETWO('-', ']')) - p_b_term(p, cs); - if (EAT('-')) - CHadd(cs, '-'); - MUSTEAT(']', REG_EBRACK); - - if (p->error != 0) /* don't mess things up further */ - return; - - if (p->g->cflags®_ICASE) { - register int i; - register int ci; - - for (i = p->g->csetsize - 1; i >= 0; i--) - if (CHIN(cs, i) && isalpha(i)) { - ci = othercase(i); - if (ci != i) - CHadd(cs, ci); - } - if (cs->multis != NULL) - mccase(p, cs); - } - if (invert) { - register int i; - - for (i = p->g->csetsize - 1; i >= 0; i--) - if (CHIN(cs, i)) - CHsub(cs, i); - else - CHadd(cs, i); - if (p->g->cflags®_NEWLINE) - CHsub(cs, '\n'); - if (cs->multis != NULL) - mcinvert(p, cs); - } - - assert(cs->multis == NULL); /* xxx */ - - if (nch(p, cs) == 1) { /* optimize singleton sets */ - ordinary(p, firstch(p, cs)); - freeset(p, cs); - } else - EMIT(OANYOF, freezeset(p, cs)); -} - -/* - - p_b_term - parse one term of a bracketed character list - == static void p_b_term(register struct parse *p, register cset *cs); - */ -static void -p_b_term(p, cs) -register struct parse *p; -register cset *cs; -{ - register unsigned char c; - register unsigned char start, finish; - register int i; - - /* classify what we've got */ - switch ((MORE()) ? PEEK() : '\0') { - case '[': - c = (MORE2()) ? PEEK2() : '\0'; - break; - case '-': - SETERROR(REG_ERANGE); - return; /* NOTE RETURN */ - break; - default: - c = '\0'; - break; - } - - switch (c) { - case ':': /* character class */ - NEXT2(); - REQUIRE(MORE(), REG_EBRACK); - c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECTYPE); - p_b_cclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO(':', ']'), REG_ECTYPE); - break; - case '=': /* equivalence class */ - NEXT2(); - REQUIRE(MORE(), REG_EBRACK); - c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECOLLATE); - p_b_eclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO('=', ']'), REG_ECOLLATE); - break; - default: /* symbol, ordinary character, or range */ -/* xxx revision needed for multichar stuff */ - start = p_b_symbol(p); - if (SEE('-') && MORE2() && PEEK2() != ']') { - /* range */ - NEXT(); - if (EAT('-')) - finish = '-'; - else - finish = p_b_symbol(p); - } else - finish = start; -/* xxx what about signed chars here... */ - REQUIRE(start <= finish, REG_ERANGE); - for (i = start; i <= finish; i++) - CHadd(cs, i); - break; - } -} - -/* - - p_b_cclass - parse a character-class name and deal with it - == static void p_b_cclass(register struct parse *p, register cset *cs); - */ -static void -p_b_cclass(p, cs) -register struct parse *p; -register cset *cs; -{ - register unsigned char *sp = p->next; - register struct cclass *cp; - register size_t len; - register unsigned char *u; - register unsigned char c; - - while (MORE() && isalpha(PEEK())) - NEXT(); - len = p->next - sp; - for (cp = cclasses; cp->name != NULL; cp++) - if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') - break; - if (cp->name == NULL) { - /* oops, didn't find it */ - SETERROR(REG_ECTYPE); - return; - } - - u = cp->chars; - while ((c = *u++) != '\0') - CHadd(cs, c); - for (u = cp->multis; *u != '\0'; u += strlen(u) + 1) - MCadd(p, cs, u); -} - -/* - - p_b_eclass - parse an equivalence-class name and deal with it - == static void p_b_eclass(register struct parse *p, register cset *cs); - * - * This implementation is incomplete. xxx - */ -static void -p_b_eclass(p, cs) -register struct parse *p; -register cset *cs; -{ - register unsigned char c; - - c = p_b_coll_elem(p, '='); - CHadd(cs, c); -} - -/* - - p_b_symbol - parse a character or [..]ed multicharacter collating symbol - == static char p_b_symbol(register struct parse *p); - */ -static unsigned char /* value of symbol */ -p_b_symbol(p) -register struct parse *p; -{ - register unsigned char value; - - REQUIRE(MORE(), REG_EBRACK); - if (!EATTWO('[', '.')) - return(GETNEXT()); - - /* collating symbol */ - value = p_b_coll_elem(p, '.'); - REQUIRE(EATTWO('.', ']'), REG_ECOLLATE); - return(value); -} - -/* - - p_b_coll_elem - parse a collating-element name and look it up - == static char p_b_coll_elem(register struct parse *p, int endc); - */ -static unsigned char /* value of collating element */ -p_b_coll_elem(p, endc) -register struct parse *p; -int endc; /* name ended by endc,']' */ -{ - register unsigned char *sp = p->next; - register struct cname *cp; - register int len; - - while (MORE() && !SEETWO(endc, ']')) - NEXT(); - if (!MORE()) { - SETERROR(REG_EBRACK); - return(0); - } - len = p->next - sp; - for (cp = cnames; cp->name != NULL; cp++) - if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') - return(cp->code); /* known name */ - if (len == 1) - return(*sp); /* single character */ - SETERROR(REG_ECOLLATE); /* neither */ - return(0); -} - -/* - - othercase - return the case counterpart of an alphabetic - == static char othercase(int ch); - */ -static unsigned char /* if no counterpart, return ch */ -othercase(ch) -int ch; -{ - assert(isalpha(ch)); - if (isupper(ch)) - return(tolower(ch)); - else if (islower(ch)) - return(toupper(ch)); - else /* peculiar, but could happen */ - return(ch); -} - -/* - - bothcases - emit a dualcase version of a two-case character - == static void bothcases(register struct parse *p, int ch); - * - * Boy, is this implementation ever a kludge... - */ -static void -bothcases(p, ch) -register struct parse *p; -int ch; -{ - register unsigned char *oldnext = p->next; - register unsigned char *oldend = p->end; - unsigned char bracket[3]; - - assert(othercase(ch) != ch); /* p_bracket() would recurse */ - p->next = bracket; - p->end = bracket+2; - bracket[0] = ch; - bracket[1] = ']'; - bracket[2] = '\0'; - p_bracket(p); - assert(p->next == bracket+2); - p->next = oldnext; - p->end = oldend; -} - -/* - - ordinary - emit an ordinary character - == static void ordinary(register struct parse *p, register int ch); - */ -static void -ordinary(p, ch) -register struct parse *p; -register int ch; -{ - register cat_t *cap = p->g->categories; - - if ((p->g->cflags®_ICASE) && isalpha(ch) && othercase(ch) != ch) - bothcases(p, ch); - else { - EMIT(OCHAR, (unsigned char)ch); - if (cap[ch] == 0) - cap[ch] = p->g->ncategories++; - } -} - -/* - - nonnewline - emit REG_NEWLINE version of OANY - == static void nonnewline(register struct parse *p); - * - * Boy, is this implementation ever a kludge... - */ -static void -nonnewline(p) -register struct parse *p; -{ - register unsigned char *oldnext = p->next; - register unsigned char *oldend = p->end; - unsigned char bracket[4]; - - p->next = bracket; - p->end = bracket+3; - bracket[0] = '^'; - bracket[1] = '\n'; - bracket[2] = ']'; - bracket[3] = '\0'; - p_bracket(p); - assert(p->next == bracket+3); - p->next = oldnext; - p->end = oldend; -} - -/* - - repeat - generate code for a bounded repetition, recursively if needed - == static void repeat(register struct parse *p, sopno start, int from, int to); - */ -static void -repeat(p, start, from, to) -register struct parse *p; -sopno start; /* operand from here to end of strip */ -int from; /* repeated from this number */ -int to; /* to this number of times (maybe INFINITY) */ -{ - register sopno finish = HERE(); -# define N 2 -# define INF 3 -# define REP(f, t) ((f)*8 + (t)) -# define MAP(n) (((n) <= 1) ? (n) : ((n) == INFINITY) ? INF : N) - register sopno copy; - - if (p->error != 0) /* head off possible runaway recursion */ - return; - - assert(from <= to); - - switch (REP(MAP(from), MAP(to))) { - case REP(0, 0): /* must be user doing this */ - DROP(finish-start); /* drop the operand */ - break; - case REP(0, 1): /* as x{1,1}? */ - case REP(0, N): /* as x{1,n}? */ - case REP(0, INF): /* as x{1,}? */ - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, start); /* offset is wrong... */ - repeat(p, start+1, 1, to); - ASTERN(OOR1, start); - AHEAD(start); /* ... fix it */ - EMIT(OOR2, 0); - AHEAD(THERE()); - ASTERN(O_CH, THERETHERE()); - break; - case REP(1, 1): /* trivial case */ - /* done */ - break; - case REP(1, N): /* as x?x{1,n-1} */ - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, start); - ASTERN(OOR1, start); - AHEAD(start); - EMIT(OOR2, 0); /* offset very wrong... */ - AHEAD(THERE()); /* ...so fix it */ - ASTERN(O_CH, THERETHERE()); - copy = dupl(p, start+1, finish+1); - assert(copy == finish+4); - repeat(p, copy, 1, to-1); - break; - case REP(1, INF): /* as x+ */ - INSERT(OPLUS_, start); - ASTERN(O_PLUS, start); - break; - case REP(N, N): /* as xx{m-1,n-1} */ - copy = dupl(p, start, finish); - repeat(p, copy, from-1, to-1); - break; - case REP(N, INF): /* as xx{n-1,INF} */ - copy = dupl(p, start, finish); - repeat(p, copy, from-1, to); - break; - default: /* "can't happen" */ - SETERROR(REG_ASSERT); /* just in case */ - break; - } -} - -/* - - seterr - set an error condition - == static int seterr(register struct parse *p, int e); - */ -static int /* useless but makes type checking happy */ -seterr(p, e) -register struct parse *p; -int e; -{ - if (p->error == 0) /* keep earliest error condition */ - p->error = e; - p->next = nuls; /* try to bring things to a halt */ - p->end = nuls; - return(0); /* make the return value well-defined */ -} - -/* - - allocset - allocate a set of characters for [] - == static cset *allocset(register struct parse *p); - */ -static cset * -allocset(p) -register struct parse *p; -{ - register int no = p->g->ncsets++; - register size_t nc; - register size_t nbytes; - register cset *cs; - register size_t css = (size_t)p->g->csetsize; - register int i; - - if (no >= p->ncsalloc) { /* need another column of space */ - p->ncsalloc += CHAR_BIT; - nc = p->ncsalloc; - assert(nc % CHAR_BIT == 0); - nbytes = nc / CHAR_BIT * css; - if (p->g->sets == NULL) - p->g->sets = (cset *)malloc(nc * sizeof(cset)); - else - p->g->sets = (cset *)realloc((unsigned char *)p->g->sets, - nc * sizeof(cset)); - if (p->g->setbits == NULL) - p->g->setbits = (uch *)malloc(nbytes); - else { - p->g->setbits = (uch *)realloc((unsigned char *)p->g->setbits, - nbytes); - /* xxx this isn't right if setbits is now NULL */ - for (i = 0; i < no; i++) - p->g->sets[i].ptr = p->g->setbits + css*(i/CHAR_BIT); - } - if (p->g->sets != NULL && p->g->setbits != NULL) - (void) memset((unsigned char *)p->g->setbits + (nbytes - css), - 0, css); - else { - no = 0; - SETERROR(REG_ESPACE); - /* caller's responsibility not to do set ops */ - } - } - - assert(p->g->sets != NULL); /* xxx */ - cs = &p->g->sets[no]; - cs->ptr = p->g->setbits + css*((no)/CHAR_BIT); - cs->mask = 1 << ((no) % CHAR_BIT); - cs->hash = 0; - cs->smultis = 0; - cs->multis = NULL; - - return(cs); -} - -/* - - freeset - free a now-unused set - == static void freeset(register struct parse *p, register cset *cs); - */ -static void -freeset(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register cset *top = &p->g->sets[p->g->ncsets]; - register size_t css = (size_t)p->g->csetsize; - - for (i = 0; i < css; i++) - CHsub(cs, i); - if (cs == top-1) /* recover only the easy case */ - p->g->ncsets--; -} - -/* - - freezeset - final processing on a set of characters - == static int freezeset(register struct parse *p, register cset *cs); - * - * The main task here is merging identical sets. This is usually a waste - * of time (although the hash code minimizes the overhead), but can win - * big if REG_ICASE is being used. REG_ICASE, by the way, is why the hash - * is done using addition rather than xor -- all ASCII [aA] sets xor to - * the same value! - */ -static int /* set number */ -freezeset(p, cs) -register struct parse *p; -register cset *cs; -{ - register uch h = cs->hash; - register size_t i; - register cset *top = &p->g->sets[p->g->ncsets]; - register cset *cs2; - register size_t css = (size_t)p->g->csetsize; - - /* look for an earlier one which is the same */ - for (cs2 = &p->g->sets[0]; cs2 < top; cs2++) - if (cs2->hash == h && cs2 != cs) { - /* maybe */ - for (i = 0; i < css; i++) - if (!!CHIN(cs2, i) != !!CHIN(cs, i)) - break; /* no */ - if (i == css) - break; /* yes */ - } - - if (cs2 < top) { /* found one */ - freeset(p, cs); - cs = cs2; - } - - return((int)(cs - p->g->sets)); -} - -/* - - firstch - return first character in a set (which must have at least one) - == static int firstch(register struct parse *p, register cset *cs); - */ -static int /* character; there is no "none" value */ -firstch(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register size_t css = (size_t)p->g->csetsize; - - for (i = 0; i < css; i++) - if (CHIN(cs, i)) - return((unsigned char)i); - assert(never); - return(0); /* arbitrary */ -} - -/* - - nch - number of characters in a set - == static int nch(register struct parse *p, register cset *cs); - */ -static int -nch(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register size_t css = (size_t)p->g->csetsize; - register int n = 0; - - for (i = 0; i < css; i++) - if (CHIN(cs, i)) - n++; - return(n); -} - -/* - - mcadd - add a collating element to a cset - == static void mcadd(register struct parse *p, register cset *cs, \ - == register char *cp); - */ -static void -mcadd(p, cs, cp) -register struct parse *p; -register cset *cs; -register unsigned char *cp; -{ - register size_t oldend = cs->smultis; - - cs->smultis += strlen(cp) + 1; - if (cs->multis == NULL) - cs->multis = malloc(cs->smultis); - else - cs->multis = realloc(cs->multis, cs->smultis); - if (cs->multis == NULL) { - SETERROR(REG_ESPACE); - return; - } - - (void) strcpy(cs->multis + oldend - 1, cp); - cs->multis[cs->smultis - 1] = '\0'; -} - -#if 0 -/* - - mcsub - subtract a collating element from a cset - == static void mcsub(register cset *cs, register unsigned char *cp); - */ -static void -mcsub(cs, cp) -register unsigned cset *cs; -register unsigned char *cp; -{ - register unsigned char *fp = mcfind(cs, cp); - register size_t len = strlen(fp); - - assert(fp != NULL); - (void) memmove(fp, fp + len + 1, - cs->smultis - (fp + len + 1 - cs->multis)); - cs->smultis -= len; - - if (cs->smultis == 0) { - free(cs->multis); - cs->multis = NULL; - return; - } - - cs->multis = realloc(cs->multis, cs->smultis); - assert(cs->multis != NULL); -} - -/* - - mcin - is a collating element in a cset? - == static int mcin(register cset *cs, register unsigned char *cp); - */ -static int -mcin(cs, cp) -register cset *cs; -register unsigned char *cp; -{ - return(mcfind(cs, cp) != NULL); -} - - -/* - - mcfind - find a collating element in a cset - == static unsigned char *mcfind(register cset *cs, register unsigned char *cp); - */ -static unsigned char * -mcfind(cs, cp) -register cset *cs; -register unsigned char *cp; -{ - register unsigned char *p; - - if (cs->multis == NULL) - return(NULL); - for (p = cs->multis; *p != '\0'; p += strlen(p) + 1) - if (strcmp(cp, p) == 0) - return(p); - return(NULL); -} -#endif - -/* - - mcinvert - invert the list of collating elements in a cset - == static void mcinvert(register struct parse *p, register cset *cs); - * - * This would have to know the set of possibilities. Implementation - * is deferred. - */ -static void -mcinvert(p, cs) -register struct parse *p; -register cset *cs; -{ - assert(cs->multis == NULL); /* xxx */ -} - -/* - - mccase - add case counterparts of the list of collating elements in a cset - == static void mccase(register struct parse *p, register cset *cs); - * - * This would have to know the set of possibilities. Implementation - * is deferred. - */ -static void -mccase(p, cs) -register struct parse *p; -register cset *cs; -{ - assert(cs->multis == NULL); /* xxx */ -} - -/* - - isinsets - is this character in any sets? - == static int isinsets(register struct re_guts *g, int c); - */ -static int /* predicate */ -isinsets(g, c) -register struct re_guts *g; -int c; -{ - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc = (unsigned char)c; - - for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) - if (col[uc] != 0) - return(1); - return(0); -} - -/* - - samesets - are these two characters in exactly the same sets? - == static int samesets(register struct re_guts *g, int c1, int c2); - */ -static int /* predicate */ -samesets(g, c1, c2) -register struct re_guts *g; -int c1; -int c2; -{ - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc1 = (unsigned char)c1; - register unsigned uc2 = (unsigned char)c2; - - for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) - if (col[uc1] != col[uc2]) - return(0); - return(1); -} - -/* - - categorize - sort out character categories - == static void categorize(struct parse *p, register struct re_guts *g); - */ -static void -categorize(p, g) -struct parse *p; -register struct re_guts *g; -{ - register cat_t *cats = g->categories; - register int c; - register int c2; - register cat_t cat; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - for (c = 0; c <= UCHAR_MAX; c++) - if (cats[c] == 0 && isinsets(g, c)) { - cat = g->ncategories++; - cats[c] = cat; - for (c2 = c+1; c2 <= UCHAR_MAX; c2++) - if (cats[c2] == 0 && samesets(g, c, c2)) - cats[c2] = cat; - } -} - -/* - - dupl - emit a duplicate of a bunch of sops - == static sopno dupl(register struct parse *p, sopno start, sopno finish); - */ -static sopno /* start of duplicate */ -dupl(p, start, finish) -register struct parse *p; -sopno start; /* from here */ -sopno finish; /* to this less one */ -{ - register sopno ret = HERE(); - register sopno len = finish - start; - - assert(finish >= start); - if (len == 0) - return(ret); - enlarge(p, p->ssize + len); /* this many unexpected additions */ - assert(p->ssize >= p->slen + len); - (void) memcpy((char *)(p->strip + p->slen), - (char *)(p->strip + start), (size_t)len*sizeof(sop)); - p->slen += len; - return(ret); -} - -/* - - doemit - emit a strip operator - == static void doemit(register struct parse *p, sop op, size_t opnd); - * - * It might seem better to implement this as a macro with a function as - * hard-case backup, but it's just too big and messy unless there are - * some changes to the data structures. Maybe later. - */ -static void -doemit(p, op, opnd) -register struct parse *p; -sop op; -size_t opnd; -{ - /* avoid making error situations worse */ - if (p->error != 0) - return; - - /* deal with oversize operands ("can't happen", more or less) */ - assert(opnd < 1<slen >= p->ssize) - enlarge(p, (p->ssize+1) / 2 * 3); /* +50% */ - assert(p->slen < p->ssize); - - /* finally, it's all reduced to the easy case */ - p->strip[p->slen++] = SOP(op, opnd); -} - -/* - - doinsert - insert a sop into the strip - == static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); - */ -static void -doinsert(p, op, opnd, pos) -register struct parse *p; -sop op; -size_t opnd; -sopno pos; -{ - register sopno sn; - register sop s; - register int i; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - sn = HERE(); - EMIT(op, opnd); /* do checks, ensure space */ - assert(HERE() == sn+1); - s = p->strip[sn]; - - /* adjust paren pointers */ - assert(pos > 0); - for (i = 1; i < NPAREN; i++) { - if (p->pbegin[i] >= pos) { - p->pbegin[i]++; - } - if (p->pend[i] >= pos) { - p->pend[i]++; - } - } - - memmove((char *)&p->strip[pos+1], (char *)&p->strip[pos], - (HERE()-pos-1)*sizeof(sop)); - p->strip[pos] = s; -} - -/* - - dofwd - complete a forward reference - == static void dofwd(register struct parse *p, sopno pos, sop value); - */ -static void -dofwd(p, pos, value) -register struct parse *p; -register sopno pos; -sop value; -{ - /* avoid making error situations worse */ - if (p->error != 0) - return; - - assert(value < 1<strip[pos] = OP(p->strip[pos]) | value; -} - -/* - - enlarge - enlarge the strip - == static void enlarge(register struct parse *p, sopno size); - */ -static void -enlarge(p, size) -register struct parse *p; -register sopno size; -{ - register sop *sp; - - if (p->ssize >= size) - return; - - sp = (sop *)realloc(p->strip, size*sizeof(sop)); - if (sp == NULL) { - SETERROR(REG_ESPACE); - return; - } - p->strip = sp; - p->ssize = size; -} - -/* - - stripsnug - compact the strip - == static void stripsnug(register struct parse *p, register struct re_guts *g); - */ -static void -stripsnug(p, g) -register struct parse *p; -register struct re_guts *g; -{ - g->nstates = p->slen; - g->strip = (sop *)realloc((unsigned char *)p->strip, p->slen * sizeof(sop)); - if (g->strip == NULL) { - SETERROR(REG_ESPACE); - g->strip = p->strip; - } -} - -/* - - findmust - fill in must and mlen with longest mandatory literal string - == static void findmust(register struct parse *p, register struct re_guts *g); - * - * This algorithm could do fancy things like analyzing the operands of | - * for common subsequences. Someday. This code is simple and finds most - * of the interesting cases. - * - * Note that must and mlen got initialized during setup. - */ -static void -findmust(p, g) -struct parse *p; -register struct re_guts *g; -{ - register sop *scan; - sop *start = NULL; - register sop *newstart = NULL; - register sopno newlen; - register sop s; - register unsigned char *cp; - register sopno i; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - /* find the longest OCHAR sequence in strip */ - newlen = 0; - scan = g->strip + 1; - do { - s = *scan++; - switch (OP(s)) { - case OCHAR: /* sequence member */ - if (newlen == 0) /* new sequence */ - newstart = scan - 1; - newlen++; - break; - case OPLUS_: /* things that don't break one */ - case OLPAREN: - case ORPAREN: - break; - case OQUEST_: /* things that must be skipped */ - case OCH_: - scan--; - do { - scan += OPND(s); - s = *scan; - /* assert() interferes w debug printouts */ - if (OP(s) != O_QUEST && OP(s) != O_CH && - OP(s) != OOR2) { - g->iflags |= BAD; - return; - } - } while (OP(s) != O_QUEST && OP(s) != O_CH); - /* fallthrough */ - default: /* things that break a sequence */ - if (newlen > g->mlen) { /* ends one */ - start = newstart; - g->mlen = newlen; - } - newlen = 0; - break; - } - } while (OP(s) != OEND); - - if (g->mlen == 0) /* there isn't one */ - return; - - if (!start) { - g->mlen = 0; - return; - } - - /* turn it into a character string */ - g->must = malloc((size_t)g->mlen + 1); - if (g->must == NULL) { /* argh; just forget it */ - g->mlen = 0; - return; - } - cp = g->must; - scan = start; - for (i = g->mlen; i > 0; i--) { - while (OP(s = *scan++) != OCHAR) - continue; - assert(cp < g->must + g->mlen); - *cp++ = (unsigned char)OPND(s); - } - assert(cp == g->must + g->mlen); - *cp++ = '\0'; /* just on general principles */ -} - -/* - - pluscount - count + nesting - == static sopno pluscount(register struct parse *p, register struct re_guts *g); - */ -static sopno /* nesting depth */ -pluscount(p, g) -struct parse *p; -register struct re_guts *g; -{ - register sop *scan; - register sop s; - register sopno plusnest = 0; - register sopno maxnest = 0; - - if (p->error != 0) - return(0); /* there may not be an OEND */ - - scan = g->strip + 1; - do { - s = *scan++; - switch (OP(s)) { - case OPLUS_: - plusnest++; - break; - case O_PLUS: - if (plusnest > maxnest) - maxnest = plusnest; - plusnest--; - break; - } - } while (OP(s) != OEND); - if (plusnest != 0) - g->iflags |= BAD; - return(maxnest); -} diff --git a/regex/regcomp.ih b/regex/regcomp.ih deleted file mode 100644 index c93d32e51d32e..0000000000000 --- a/regex/regcomp.ih +++ /dev/null @@ -1,53 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regcomp.c === */ -static void p_ere(register struct parse *p, int stop); -static void p_ere_exp(register struct parse *p); -static void p_str(register struct parse *p); -static void p_bre(register struct parse *p, register int end1, register int end2); -static int p_simp_re(register struct parse *p, int starordinary); -static int p_count(register struct parse *p); -static void p_bracket(register struct parse *p); -static void p_b_term(register struct parse *p, register cset *cs); -static void p_b_cclass(register struct parse *p, register cset *cs); -static void p_b_eclass(register struct parse *p, register cset *cs); -static unsigned char p_b_symbol(register struct parse *p); -static unsigned char p_b_coll_elem(register struct parse *p, int endc); -static unsigned char othercase(int ch); -static void bothcases(register struct parse *p, int ch); -static void ordinary(register struct parse *p, register int ch); -static void nonnewline(register struct parse *p); -static void repeat(register struct parse *p, sopno start, int from, int to); -static int seterr(register struct parse *p, int e); -static cset *allocset(register struct parse *p); -static void freeset(register struct parse *p, register cset *cs); -static int freezeset(register struct parse *p, register cset *cs); -static int firstch(register struct parse *p, register cset *cs); -static int nch(register struct parse *p, register cset *cs); -static void mcadd(register struct parse *p, register cset *cs, register unsigned char *cp); -#if 0 -static void mcsub(register cset *cs, register unsigned char *cp); -static int mcin(register cset *cs, register unsigned char *cp); -static unsigned char *mcfind(register cset *cs, register unsigned char *cp); -#endif -static void mcinvert(register struct parse *p, register cset *cs); -static void mccase(register struct parse *p, register cset *cs); -static int isinsets(register struct re_guts *g, int c); -static int samesets(register struct re_guts *g, int c1, int c2); -static void categorize(struct parse *p, register struct re_guts *g); -static sopno dupl(register struct parse *p, sopno start, sopno finish); -static void doemit(register struct parse *p, sop op, size_t opnd); -static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); -static void dofwd(register struct parse *p, sopno pos, sop value); -static void enlarge(register struct parse *p, sopno size); -static void stripsnug(register struct parse *p, register struct re_guts *g); -static void findmust(register struct parse *p, register struct re_guts *g); -static sopno pluscount(register struct parse *p, register struct re_guts *g); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/regerror.c b/regex/regerror.c deleted file mode 100644 index c4b119494840d..0000000000000 --- a/regex/regerror.c +++ /dev/null @@ -1,126 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "regex.h" -#include "utils.h" -#include "regerror.ih" - -/* - = #define REG_OKAY 0 - = #define REG_NOMATCH 1 - = #define REG_BADPAT 2 - = #define REG_ECOLLATE 3 - = #define REG_ECTYPE 4 - = #define REG_EESCAPE 5 - = #define REG_ESUBREG 6 - = #define REG_EBRACK 7 - = #define REG_EPAREN 8 - = #define REG_EBRACE 9 - = #define REG_BADBR 10 - = #define REG_ERANGE 11 - = #define REG_ESPACE 12 - = #define REG_BADRPT 13 - = #define REG_EMPTY 14 - = #define REG_ASSERT 15 - = #define REG_INVARG 16 - = #define REG_ATOI 255 // convert name to number (!) - = #define REG_ITOA 0400 // convert number to name (!) - */ -static struct rerr { - int code; - char *name; - char *explain; -} rerrs[] = { - {REG_OKAY, "REG_OKAY", "no errors detected"}, - {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"}, - {REG_BADPAT, "REG_BADPAT", "invalid regular expression"}, - {REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"}, - {REG_ECTYPE, "REG_ECTYPE", "invalid character class"}, - {REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"}, - {REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"}, - {REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"}, - {REG_EPAREN, "REG_EPAREN", "parentheses not balanced"}, - {REG_EBRACE, "REG_EBRACE", "braces not balanced"}, - {REG_BADBR, "REG_BADBR", "invalid repetition count(s)"}, - {REG_ERANGE, "REG_ERANGE", "invalid character range"}, - {REG_ESPACE, "REG_ESPACE", "out of memory"}, - {REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"}, - {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"}, - {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"}, - {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"}, - {-1, "", "*** unknown regexp error code ***"}, -}; - -/* - - regerror - the interface to error numbers - = API_EXPORT(size_t) regerror(int, const regex_t *, char *, size_t); - */ -/* ARGSUSED */ -API_EXPORT(size_t) -regerror( -int errcode, -const regex_t *preg, -char *errbuf, -size_t errbuf_size) -{ - register struct rerr *r; - register size_t len; - register int target = errcode &~ REG_ITOA; - register char *s; - char convbuf[50]; - - if (errcode == REG_ATOI) - s = regatoi(preg, convbuf); - else { - for (r = rerrs; r->code >= 0; r++) - if (r->code == target) - break; - - if (errcode®_ITOA) { - if (r->code >= 0) - (void) strcpy(convbuf, r->name); - else - sprintf(convbuf, "REG_0x%x", target); - assert(strlen(convbuf) < sizeof(convbuf)); - s = convbuf; - } else - s = r->explain; - } - - len = strlen(s) + 1; - if (errbuf_size > 0) { - if (errbuf_size > len) - (void) strcpy(errbuf, s); - else { - (void) strncpy(errbuf, s, errbuf_size-1); - errbuf[errbuf_size-1] = '\0'; - } - } - - return(len); -} - -/* - - regatoi - internal routine to implement REG_ATOI - == static char *regatoi(const regex_t *preg, char *localbuf); - */ -static char * -regatoi(preg, localbuf) -const regex_t *preg; -char *localbuf; -{ - register struct rerr *r; - - for (r = rerrs; r->code >= 0; r++) - if (strcmp(r->name, preg->re_endp) == 0) - break; - if (r->code < 0) - return("0"); - - sprintf(localbuf, "%d", r->code); - return(localbuf); -} diff --git a/regex/regerror.ih b/regex/regerror.ih deleted file mode 100644 index 2cb668c24f07e..0000000000000 --- a/regex/regerror.ih +++ /dev/null @@ -1,12 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regerror.c === */ -static char *regatoi(const regex_t *preg, char *localbuf); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/regex/regex.3 b/regex/regex.3 deleted file mode 100644 index 100c8a7f71c72..0000000000000 --- a/regex/regex.3 +++ /dev/null @@ -1,502 +0,0 @@ -.TH REGEX 3 "17 May 1993" -.BY "Henry Spencer" -.de ZR -.\" one other place knows this name: the SEE ALSO section -.IR regex (7) \\$1 -.. -.SH NAME -regcomp, regexec, regerror, regfree \- regular-expression library -.SH SYNOPSIS -.ft B -.\".na -#include -.br -#include -.HP 10 -int regcomp(regex_t\ *preg, const\ char\ *pattern, int\ cflags); -.HP -int\ regexec(const\ regex_t\ *preg, const\ char\ *string, -size_t\ nmatch, regmatch_t\ pmatch[], int\ eflags); -.HP -size_t\ regerror(int\ errcode, const\ regex_t\ *preg, -char\ *errbuf, size_t\ errbuf_size); -.HP -void\ regfree(regex_t\ *preg); -.\".ad -.ft -.SH DESCRIPTION -These routines implement POSIX 1003.2 regular expressions (``RE''s); -see -.ZR . -.I Regcomp -compiles an RE written as a string into an internal form, -.I regexec -matches that internal form against a string and reports results, -.I regerror -transforms error codes from either into human-readable messages, -and -.I regfree -frees any dynamically-allocated storage used by the internal form -of an RE. -.PP -The header -.I -declares two structure types, -.I regex_t -and -.IR regmatch_t , -the former for compiled internal forms and the latter for match reporting. -It also declares the four functions, -a type -.IR regoff_t , -and a number of constants with names starting with ``REG_''. -.PP -.I Regcomp -compiles the regular expression contained in the -.I pattern -string, -subject to the flags in -.IR cflags , -and places the results in the -.I regex_t -structure pointed to by -.IR preg . -.I Cflags -is the bitwise OR of zero or more of the following flags: -.IP REG_EXTENDED \w'REG_EXTENDED'u+2n -Compile modern (``extended'') REs, -rather than the obsolete (``basic'') REs that -are the default. -.IP REG_BASIC -This is a synonym for 0, -provided as a counterpart to REG_EXTENDED to improve readability. -.IP REG_NOSPEC -Compile with recognition of all special characters turned off. -All characters are thus considered ordinary, -so the ``RE'' is a literal string. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -REG_EXTENDED and REG_NOSPEC may not be used -in the same call to -.IR regcomp . -.IP REG_ICASE -Compile for matching that ignores upper/lower case distinctions. -See -.ZR . -.IP REG_NOSUB -Compile for matching that need only report success or failure, -not what was matched. -.IP REG_NEWLINE -Compile for newline-sensitive matching. -By default, newline is a completely ordinary character with no special -meaning in either REs or strings. -With this flag, -`[^' bracket expressions and `.' never match newline, -a `^' anchor matches the null string after any newline in the string -in addition to its normal function, -and the `$' anchor matches the null string before any newline in the -string in addition to its normal function. -.IP REG_PEND -The regular expression ends, -not at the first NUL, -but just before the character pointed to by the -.I re_endp -member of the structure pointed to by -.IR preg . -The -.I re_endp -member is of type -.IR const\ char\ * . -This flag permits inclusion of NULs in the RE; -they are considered ordinary characters. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -.PP -When successful, -.I regcomp -returns 0 and fills in the structure pointed to by -.IR preg . -One member of that structure -(other than -.IR re_endp ) -is publicized: -.IR re_nsub , -of type -.IR size_t , -contains the number of parenthesized subexpressions within the RE -(except that the value of this member is undefined if the -REG_NOSUB flag was used). -If -.I regcomp -fails, it returns a non-zero error code; -see DIAGNOSTICS. -.PP -.I Regexec -matches the compiled RE pointed to by -.I preg -against the -.IR string , -subject to the flags in -.IR eflags , -and reports results using -.IR nmatch , -.IR pmatch , -and the returned value. -The RE must have been compiled by a previous invocation of -.IR regcomp . -The compiled form is not altered during execution of -.IR regexec , -so a single compiled RE can be used simultaneously by multiple threads. -.PP -By default, -the NUL-terminated string pointed to by -.I string -is considered to be the text of an entire line, minus any terminating -newline. -The -.I eflags -argument is the bitwise OR of zero or more of the following flags: -.IP REG_NOTBOL \w'REG_STARTEND'u+2n -The first character of -the string -is not the beginning of a line, so the `^' anchor should not match before it. -This does not affect the behavior of newlines under REG_NEWLINE. -.IP REG_NOTEOL -The NUL terminating -the string -does not end a line, so the `$' anchor should not match before it. -This does not affect the behavior of newlines under REG_NEWLINE. -.IP REG_STARTEND -The string is considered to start at -\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_so\fR -and to have a terminating NUL located at -\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_eo\fR -(there need not actually be a NUL at that location), -regardless of the value of -.IR nmatch . -See below for the definition of -.IR pmatch -and -.IR nmatch . -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -Note that a non-zero \fIrm_so\fR does not imply REG_NOTBOL; -REG_STARTEND affects only the location of the string, -not how it is matched. -.PP -See -.ZR -for a discussion of what is matched in situations where an RE or a -portion thereof could match any of several substrings of -.IR string . -.PP -Normally, -.I regexec -returns 0 for success and the non-zero code REG_NOMATCH for failure. -Other non-zero error codes may be returned in exceptional situations; -see DIAGNOSTICS. -.PP -If REG_NOSUB was specified in the compilation of the RE, -or if -.I nmatch -is 0, -.I regexec -ignores the -.I pmatch -argument (but see below for the case where REG_STARTEND is specified). -Otherwise, -.I pmatch -points to an array of -.I nmatch -structures of type -.IR regmatch_t . -Such a structure has at least the members -.I rm_so -and -.IR rm_eo , -both of type -.I regoff_t -(a signed arithmetic type at least as large as an -.I off_t -and a -.IR ssize_t ), -containing respectively the offset of the first character of a substring -and the offset of the first character after the end of the substring. -Offsets are measured from the beginning of the -.I string -argument given to -.IR regexec . -An empty substring is denoted by equal offsets, -both indicating the character following the empty substring. -.PP -The 0th member of the -.I pmatch -array is filled in to indicate what substring of -.I string -was matched by the entire RE. -Remaining members report what substring was matched by parenthesized -subexpressions within the RE; -member -.I i -reports subexpression -.IR i , -with subexpressions counted (starting at 1) by the order of their opening -parentheses in the RE, left to right. -Unused entries in the array\(emcorresponding either to subexpressions that -did not participate in the match at all, or to subexpressions that do not -exist in the RE (that is, \fIi\fR\ > \fIpreg\fR\->\fIre_nsub\fR)\(emhave both -.I rm_so -and -.I rm_eo -set to \-1. -If a subexpression participated in the match several times, -the reported substring is the last one it matched. -(Note, as an example in particular, that when the RE `(b*)+' matches `bbb', -the parenthesized subexpression matches each of the three `b's and then -an infinite number of empty strings following the last `b', -so the reported substring is one of the empties.) -.PP -If REG_STARTEND is specified, -.I pmatch -must point to at least one -.I regmatch_t -(even if -.I nmatch -is 0 or REG_NOSUB was specified), -to hold the input offsets for REG_STARTEND. -Use for output is still entirely controlled by -.IR nmatch ; -if -.I nmatch -is 0 or REG_NOSUB was specified, -the value of -.IR pmatch [0] -will not be changed by a successful -.IR regexec . -.PP -.I Regerror -maps a non-zero -.I errcode -from either -.I regcomp -or -.I regexec -to a human-readable, printable message. -If -.I preg -is non-NULL, -the error code should have arisen from use of -the -.I regex_t -pointed to by -.IR preg , -and if the error code came from -.IR regcomp , -it should have been the result from the most recent -.I regcomp -using that -.IR regex_t . -.RI ( Regerror -may be able to supply a more detailed message using information -from the -.IR regex_t .) -.I Regerror -places the NUL-terminated message into the buffer pointed to by -.IR errbuf , -limiting the length (including the NUL) to at most -.I errbuf_size -bytes. -If the whole message won't fit, -as much of it as will fit before the terminating NUL is supplied. -In any case, -the returned value is the size of buffer needed to hold the whole -message (including terminating NUL). -If -.I errbuf_size -is 0, -.I errbuf -is ignored but the return value is still correct. -.PP -If the -.I errcode -given to -.I regerror -is first ORed with REG_ITOA, -the ``message'' that results is the printable name of the error code, -e.g. ``REG_NOMATCH'', -rather than an explanation thereof. -If -.I errcode -is REG_ATOI, -then -.I preg -shall be non-NULL and the -.I re_endp -member of the structure it points to -must point to the printable name of an error code; -in this case, the result in -.I errbuf -is the decimal digits of -the numeric value of the error code -(0 if the name is not recognized). -REG_ITOA and REG_ATOI are intended primarily as debugging facilities; -they are extensions, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -Be warned also that they are considered experimental and changes are possible. -.PP -.I Regfree -frees any dynamically-allocated storage associated with the compiled RE -pointed to by -.IR preg . -The remaining -.I regex_t -is no longer a valid compiled RE -and the effect of supplying it to -.I regexec -or -.I regerror -is undefined. -.PP -None of these functions references global variables except for tables -of constants; -all are safe for use from multiple threads if the arguments are safe. -.SH IMPLEMENTATION CHOICES -There are a number of decisions that 1003.2 leaves up to the implementor, -either by explicitly saying ``undefined'' or by virtue of them being -forbidden by the RE grammar. -This implementation treats them as follows. -.PP -See -.ZR -for a discussion of the definition of case-independent matching. -.PP -There is no particular limit on the length of REs, -except insofar as memory is limited. -Memory usage is approximately linear in RE size, and largely insensitive -to RE complexity, except for bounded repetitions. -See BUGS for one short RE using them -that will run almost any system out of memory. -.PP -A backslashed character other than one specifically given a magic meaning -by 1003.2 (such magic meanings occur only in obsolete [``basic''] REs) -is taken as an ordinary character. -.PP -Any unmatched [ is a REG_EBRACK error. -.PP -Equivalence classes cannot begin or end bracket-expression ranges. -The endpoint of one range cannot begin another. -.PP -RE_DUP_MAX, the limit on repetition counts in bounded repetitions, is 255. -.PP -A repetition operator (?, *, +, or bounds) cannot follow another -repetition operator. -A repetition operator cannot begin an expression or subexpression -or follow `^' or `|'. -.PP -`|' cannot appear first or last in a (sub)expression or after another `|', -i.e. an operand of `|' cannot be an empty subexpression. -An empty parenthesized subexpression, `()', is legal and matches an -empty (sub)string. -An empty string is not a legal RE. -.PP -A `{' followed by a digit is considered the beginning of bounds for a -bounded repetition, which must then follow the syntax for bounds. -A `{' \fInot\fR followed by a digit is considered an ordinary character. -.PP -`^' and `$' beginning and ending subexpressions in obsolete (``basic'') -REs are anchors, not ordinary characters. -.SH SEE ALSO -grep(1), regex(7) -.PP -POSIX 1003.2, sections 2.8 (Regular Expression Notation) -and -B.5 (C Binding for Regular Expression Matching). -.SH DIAGNOSTICS -Non-zero error codes from -.I regcomp -and -.I regexec -include the following: -.PP -.nf -.ta \w'REG_ECOLLATE'u+3n -REG_NOMATCH regexec() failed to match -REG_BADPAT invalid regular expression -REG_ECOLLATE invalid collating element -REG_ECTYPE invalid character class -REG_EESCAPE \e applied to unescapable character -REG_ESUBREG invalid backreference number -REG_EBRACK brackets [ ] not balanced -REG_EPAREN parentheses ( ) not balanced -REG_EBRACE braces { } not balanced -REG_BADBR invalid repetition count(s) in { } -REG_ERANGE invalid character range in [ ] -REG_ESPACE ran out of memory -REG_BADRPT ?, *, or + operand invalid -REG_EMPTY empty (sub)expression -REG_ASSERT ``can't happen''\(emyou found a bug -REG_INVARG invalid argument, e.g. negative-length string -.fi -.SH HISTORY -Written by Henry Spencer at University of Toronto, -henry@zoo.toronto.edu. -.SH BUGS -This is an alpha release with known defects. -Please report problems. -.PP -There is one known functionality bug. -The implementation of internationalization is incomplete: -the locale is always assumed to be the default one of 1003.2, -and only the collating elements etc. of that locale are available. -.PP -The back-reference code is subtle and doubts linger about its correctness -in complex cases. -.PP -.I Regexec -performance is poor. -This will improve with later releases. -.I Nmatch -exceeding 0 is expensive; -.I nmatch -exceeding 1 is worse. -.I Regexec -is largely insensitive to RE complexity \fIexcept\fR that back -references are massively expensive. -RE length does matter; in particular, there is a strong speed bonus -for keeping RE length under about 30 characters, -with most special characters counting roughly double. -.PP -.I Regcomp -implements bounded repetitions by macro expansion, -which is costly in time and space if counts are large -or bounded repetitions are nested. -An RE like, say, -`((((a{1,100}){1,100}){1,100}){1,100}){1,100}' -will (eventually) run almost any existing machine out of swap space. -.PP -There are suspected problems with response to obscure error conditions. -Notably, -certain kinds of internal overflow, -produced only by truly enormous REs or by multiply nested bounded repetitions, -are probably not handled well. -.PP -Due to a mistake in 1003.2, things like `a)b' are legal REs because `)' is -a special character only in the presence of a previous unmatched `('. -This can't be fixed until the spec is fixed. -.PP -The standard's definition of back references is vague. -For example, does -`a\e(\e(b\e)*\e2\e)*d' match `abbbd'? -Until the standard is clarified, -behavior in such cases should not be relied on. -.PP -The implementation of word-boundary matching is a bit of a kludge, -and bugs may lurk in combinations of word-boundary matching and anchoring. diff --git a/regex/regex.7 b/regex/regex.7 deleted file mode 100644 index d89012bda1dcd..0000000000000 --- a/regex/regex.7 +++ /dev/null @@ -1,233 +0,0 @@ -.TH REGEX 7 "7 Feb 1994" -.BY "Henry Spencer" -.SH NAME -regex \- POSIX 1003.2 regular expressions -.SH DESCRIPTION -Regular expressions (``RE''s), -as defined in POSIX 1003.2, come in two forms: -modern REs (roughly those of -.IR egrep ; -1003.2 calls these ``extended'' REs) -and obsolete REs (roughly those of -.IR ed ; -1003.2 ``basic'' REs). -Obsolete REs mostly exist for backward compatibility in some old programs; -they will be discussed at the end. -1003.2 leaves some aspects of RE syntax and semantics open; -`\(dg' marks decisions on these aspects that -may not be fully portable to other 1003.2 implementations. -.PP -A (modern) RE is one\(dg or more non-empty\(dg \fIbranches\fR, -separated by `|'. -It matches anything that matches one of the branches. -.PP -A branch is one\(dg or more \fIpieces\fR, concatenated. -It matches a match for the first, followed by a match for the second, etc. -.PP -A piece is an \fIatom\fR possibly followed -by a single\(dg `*', `+', `?', or \fIbound\fR. -An atom followed by `*' matches a sequence of 0 or more matches of the atom. -An atom followed by `+' matches a sequence of 1 or more matches of the atom. -An atom followed by `?' matches a sequence of 0 or 1 matches of the atom. -.PP -A \fIbound\fR is `{' followed by an unsigned decimal integer, -possibly followed by `,' -possibly followed by another unsigned decimal integer, -always followed by `}'. -The integers must lie between 0 and RE_DUP_MAX (255\(dg) inclusive, -and if there are two of them, the first may not exceed the second. -An atom followed by a bound containing one integer \fIi\fR -and no comma matches -a sequence of exactly \fIi\fR matches of the atom. -An atom followed by a bound -containing one integer \fIi\fR and a comma matches -a sequence of \fIi\fR or more matches of the atom. -An atom followed by a bound -containing two integers \fIi\fR and \fIj\fR matches -a sequence of \fIi\fR through \fIj\fR (inclusive) matches of the atom. -.PP -An atom is a regular expression enclosed in `()' (matching a match for the -regular expression), -an empty set of `()' (matching the null string)\(dg, -a \fIbracket expression\fR (see below), `.' -(matching any single character), `^' (matching the null string at the -beginning of a line), `$' (matching the null string at the -end of a line), a `\e' followed by one of the characters -`^.[$()|*+?{\e' -(matching that character taken as an ordinary character), -a `\e' followed by any other character\(dg -(matching that character taken as an ordinary character, -as if the `\e' had not been present\(dg), -or a single character with no other significance (matching that character). -A `{' followed by a character other than a digit is an ordinary -character, not the beginning of a bound\(dg. -It is illegal to end an RE with `\e'. -.PP -A \fIbracket expression\fR is a list of characters enclosed in `[]'. -It normally matches any single character from the list (but see below). -If the list begins with `^', -it matches any single character -(but see below) \fInot\fR from the rest of the list. -If two characters in the list are separated by `\-', this is shorthand -for the full \fIrange\fR of characters between those two (inclusive) in the -collating sequence, -e.g. `[0-9]' in ASCII matches any decimal digit. -It is illegal\(dg for two ranges to share an -endpoint, e.g. `a-c-e'. -Ranges are very collating-sequence-dependent, -and portable programs should avoid relying on them. -.PP -To include a literal `]' in the list, make it the first character -(following a possible `^'). -To include a literal `\-', make it the first or last character, -or the second endpoint of a range. -To use a literal `\-' as the first endpoint of a range, -enclose it in `[.' and `.]' to make it a collating element (see below). -With the exception of these and some combinations using `[' (see next -paragraphs), all other special characters, including `\e', lose their -special significance within a bracket expression. -.PP -Within a bracket expression, a collating element (a character, -a multi-character sequence that collates as if it were a single character, -or a collating-sequence name for either) -enclosed in `[.' and `.]' stands for the -sequence of characters of that collating element. -The sequence is a single element of the bracket expression's list. -A bracket expression containing a multi-character collating element -can thus match more than one character, -e.g. if the collating sequence includes a `ch' collating element, -then the RE `[[.ch.]]*c' matches the first five characters -of `chchcc'. -.PP -Within a bracket expression, a collating element enclosed in `[=' and -`=]' is an equivalence class, standing for the sequences of characters -of all collating elements equivalent to that one, including itself. -(If there are no other equivalent collating elements, -the treatment is as if the enclosing delimiters were `[.' and `.]'.) -For example, if o and \o'o^' are the members of an equivalence class, -then `[[=o=]]', `[[=\o'o^'=]]', and `[o\o'o^']' are all synonymous. -An equivalence class may not\(dg be an endpoint -of a range. -.PP -Within a bracket expression, the name of a \fIcharacter class\fR enclosed -in `[:' and `:]' stands for the list of all characters belonging to that -class. -Standard character class names are: -.PP -.RS -.nf -.ta 3c 6c 9c -alnum digit punct -alpha graph space -blank lower upper -cntrl print xdigit -.fi -.RE -.PP -These stand for the character classes defined in -.IR ctype (3). -A locale may provide others. -A character class may not be used as an endpoint of a range. -.PP -There are two special cases\(dg of bracket expressions: -the bracket expressions `[[:<:]]' and `[[:>:]]' match the null string at -the beginning and end of a word respectively. -A word is defined as a sequence of -word characters -which is neither preceded nor followed by -word characters. -A word character is an -.I alnum -character (as defined by -.IR ctype (3)) -or an underscore. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -.PP -In the event that an RE could match more than one substring of a given -string, -the RE matches the one starting earliest in the string. -If the RE could match more than one substring starting at that point, -it matches the longest. -Subexpressions also match the longest possible substrings, subject to -the constraint that the whole match be as long as possible, -with subexpressions starting earlier in the RE taking priority over -ones starting later. -Note that higher-level subexpressions thus take priority over -their lower-level component subexpressions. -.PP -Match lengths are measured in characters, not collating elements. -A null string is considered longer than no match at all. -For example, -`bb*' matches the three middle characters of `abbbc', -`(wee|week)(knights|nights)' matches all ten characters of `weeknights', -when `(.*).*' is matched against `abc' the parenthesized subexpression -matches all three characters, and -when `(a*)*' is matched against `bc' both the whole RE and the parenthesized -subexpression match the null string. -.PP -If case-independent matching is specified, -the effect is much as if all case distinctions had vanished from the -alphabet. -When an alphabetic that exists in multiple cases appears as an -ordinary character outside a bracket expression, it is effectively -transformed into a bracket expression containing both cases, -e.g. `x' becomes `[xX]'. -When it appears inside a bracket expression, all case counterparts -of it are added to the bracket expression, so that (e.g.) `[x]' -becomes `[xX]' and `[^x]' becomes `[^xX]'. -.PP -No particular limit is imposed on the length of REs\(dg. -Programs intended to be portable should not employ REs longer -than 256 bytes, -as an implementation can refuse to accept such REs and remain -POSIX-compliant. -.PP -Obsolete (``basic'') regular expressions differ in several respects. -`|', `+', and `?' are ordinary characters and there is no equivalent -for their functionality. -The delimiters for bounds are `\e{' and `\e}', -with `{' and `}' by themselves ordinary characters. -The parentheses for nested subexpressions are `\e(' and `\e)', -with `(' and `)' by themselves ordinary characters. -`^' is an ordinary character except at the beginning of the -RE or\(dg the beginning of a parenthesized subexpression, -`$' is an ordinary character except at the end of the -RE or\(dg the end of a parenthesized subexpression, -and `*' is an ordinary character if it appears at the beginning of the -RE or the beginning of a parenthesized subexpression -(after a possible leading `^'). -Finally, there is one new type of atom, a \fIback reference\fR: -`\e' followed by a non-zero decimal digit \fId\fR -matches the same sequence of characters -matched by the \fId\fRth parenthesized subexpression -(numbering subexpressions by the positions of their opening parentheses, -left to right), -so that (e.g.) `\e([bc]\e)\e1' matches `bb' or `cc' but not `bc'. -.SH SEE ALSO -regex(3) -.PP -POSIX 1003.2, section 2.8 (Regular Expression Notation). -.SH BUGS -Having two kinds of REs is a botch. -.PP -The current 1003.2 spec says that `)' is an ordinary character in -the absence of an unmatched `('; -this was an unintentional result of a wording error, -and change is likely. -Avoid relying on it. -.PP -Back references are a dreadful botch, -posing major problems for efficient implementations. -They are also somewhat vaguely defined -(does -`a\e(\e(b\e)*\e2\e)*d' match `abbbd'?). -Avoid using them. -.PP -1003.2's specification of case-independent matching is vague. -The ``one case implies all cases'' definition given above -is current consensus among implementors as to the right interpretation. -.PP -The syntax for word boundaries is incredibly ugly. diff --git a/regex/regex.dsp b/regex/regex.dsp deleted file mode 100644 index e8f1ad42995e4..0000000000000 --- a/regex/regex.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="regex" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=regex - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "regex.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "regex - Win32 Release" -# Name "regex - Win32 Debug" -# Begin Source File - -SOURCE=.\regcomp.c -# End Source File -# Begin Source File - -SOURCE=.\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\regfree.c -# End Source File -# End Target -# End Project diff --git a/regex/regex.dsw b/regex/regex.dsw deleted file mode 100644 index 7b7df8126c4b5..0000000000000 --- a/regex/regex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "regex"=.\regex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/regex/regex.h b/regex/regex.h deleted file mode 100644 index b39c5e178c6b7..0000000000000 --- a/regex/regex.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef _HSREGEX_H_ -#define _HSREGEX_H_ -#ifndef _HSREGEX_H -#define _HSREGEX_H /* never again */ -/* ========= begin header generated by ././mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regex2.h === */ -#ifdef WIN32 -#define API_EXPORT(type) __declspec(dllexport) type __stdcall -#else -#define API_EXPORT(type) type -#endif - -typedef off_t regoff_t; -typedef struct { - int re_magic; - size_t re_nsub; /* number of parenthesized subexpressions */ - const char *re_endp; /* end pointer for REG_PEND */ - struct re_guts *re_g; /* none of your business :-) */ -} regex_t; -typedef struct { - regoff_t rm_so; /* start of match */ - regoff_t rm_eo; /* end of match */ -} regmatch_t; - - -/* === regcomp.c === */ -API_EXPORT(int) regcomp(regex_t *, const char *, int); -#define REG_BASIC 0000 -#define REG_EXTENDED 0001 -#define REG_ICASE 0002 -#define REG_NOSUB 0004 -#define REG_NEWLINE 0010 -#define REG_NOSPEC 0020 -#define REG_PEND 0040 -#define REG_DUMP 0200 - - -/* === regerror.c === */ -#define REG_OKAY 0 -#define REG_NOMATCH 1 -#define REG_BADPAT 2 -#define REG_ECOLLATE 3 -#define REG_ECTYPE 4 -#define REG_EESCAPE 5 -#define REG_ESUBREG 6 -#define REG_EBRACK 7 -#define REG_EPAREN 8 -#define REG_EBRACE 9 -#define REG_BADBR 10 -#define REG_ERANGE 11 -#define REG_ESPACE 12 -#define REG_BADRPT 13 -#define REG_EMPTY 14 -#define REG_ASSERT 15 -#define REG_INVARG 16 -#define REG_ATOI 255 /* convert name to number (!) */ -#define REG_ITOA 0400 /* convert number to name (!) */ -API_EXPORT(size_t) regerror(int, const regex_t *, char *, size_t); - - -/* === regexec.c === */ -API_EXPORT(int) regexec(const regex_t *, const char *, size_t, regmatch_t [], int); -#define REG_NOTBOL 00001 -#define REG_NOTEOL 00002 -#define REG_STARTEND 00004 -#define REG_TRACE 00400 /* tracing of execution */ -#define REG_LARGE 01000 /* force large representation */ -#define REG_BACKR 02000 /* force use of backref code */ - - -/* === regfree.c === */ -API_EXPORT(void) regfree(regex_t *); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ././mkh ========= */ -#endif -#endif diff --git a/regex/regex.mak b/regex/regex.mak deleted file mode 100644 index b87ded340b396..0000000000000 --- a/regex/regex.mak +++ /dev/null @@ -1,304 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on regex.dsp -!IF "$(CFG)" == "" -CFG=regex - Win32 Release -!MESSAGE No configuration specified. Defaulting to regex - Win32 Release. -!ENDIF - -!IF "$(CFG)" != "regex - Win32 Release" && "$(CFG)" != "regex - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\.\Release -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\regex.lib" - -!ELSE - -ALL : "$(OUTDIR)\regex.lib" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\regcomp.obj" - -@erase "$(INTDIR)\regerror.obj" - -@erase "$(INTDIR)\regexec.obj" - -@erase "$(INTDIR)\regfree.obj" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\regex.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\ - /Fp"$(INTDIR)\regex.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=.\Release/ -CPP_SBRS=. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\regex.bsc" -BSC32_SBRS= \ - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\regex.lib" -LIB32_OBJS= \ - "$(INTDIR)\regcomp.obj" \ - "$(INTDIR)\regerror.obj" \ - "$(INTDIR)\regexec.obj" \ - "$(INTDIR)\regfree.obj" - -"$(OUTDIR)\regex.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\.\Debug -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\regex.lib" "$(OUTDIR)\regex.bsc" - -!ELSE - -ALL : "$(OUTDIR)\regex.lib" "$(OUTDIR)\regex.bsc" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\regcomp.obj" - -@erase "$(INTDIR)\regcomp.sbr" - -@erase "$(INTDIR)\regerror.obj" - -@erase "$(INTDIR)\regerror.sbr" - -@erase "$(INTDIR)\regexec.obj" - -@erase "$(INTDIR)\regexec.sbr" - -@erase "$(INTDIR)\regfree.obj" - -@erase "$(INTDIR)\regfree.sbr" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\regex.bsc" - -@erase "$(OUTDIR)\regex.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /W3 /GX /Z7 /Od /I "." /D "WIN32" /D "_DEBUG" /D\ - "_WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\regex.pch" /YX /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=.\Debug/ -CPP_SBRS=.\Debug/ -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\regex.bsc" -BSC32_SBRS= \ - "$(INTDIR)\regcomp.sbr" \ - "$(INTDIR)\regerror.sbr" \ - "$(INTDIR)\regexec.sbr" \ - "$(INTDIR)\regfree.sbr" - -"$(OUTDIR)\regex.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\regex.lib" -LIB32_OBJS= \ - "$(INTDIR)\regcomp.obj" \ - "$(INTDIR)\regerror.obj" \ - "$(INTDIR)\regexec.obj" \ - "$(INTDIR)\regfree.obj" - -"$(OUTDIR)\regex.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(CFG)" == "regex - Win32 Release" || "$(CFG)" == "regex - Win32 Debug" -SOURCE=.\regcomp.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGCO=\ - ".\cclass.h"\ - ".\cname.h"\ - ".\regcomp.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regcomp.obj" : $(SOURCE) $(DEP_CPP_REGCO) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGCO=\ - ".\cclass.h"\ - ".\cname.h"\ - ".\regcomp.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regcomp.obj" "$(INTDIR)\regcomp.sbr" : $(SOURCE) $(DEP_CPP_REGCO)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regerror.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGER=\ - ".\regerror.ih"\ - ".\regex.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regerror.obj" : $(SOURCE) $(DEP_CPP_REGER) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGER=\ - ".\regerror.ih"\ - ".\regex.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regerror.obj" "$(INTDIR)\regerror.sbr" : $(SOURCE) $(DEP_CPP_REGER)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regexec.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGEX=\ - ".\engine.c"\ - ".\engine.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regexec.obj" : $(SOURCE) $(DEP_CPP_REGEX) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGEX=\ - ".\engine.c"\ - ".\engine.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regexec.obj" "$(INTDIR)\regexec.sbr" : $(SOURCE) $(DEP_CPP_REGEX)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regfree.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGFR=\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regfree.obj" : $(SOURCE) $(DEP_CPP_REGFR) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGFR=\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regfree.obj" "$(INTDIR)\regfree.sbr" : $(SOURCE) $(DEP_CPP_REGFR)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\engine.c - -!ENDIF - diff --git a/regex/regex2.h b/regex/regex2.h deleted file mode 100644 index 4996f96ecd354..0000000000000 --- a/regex/regex2.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * First, the stuff that ends up in the outside-world include file - = #ifdef WIN32 - = #define API_EXPORT(type) __declspec(dllexport) type __stdcall - = #else - = #define API_EXPORT(type) type - = #endif - = - = typedef off_t regoff_t; - = typedef struct { - = int re_magic; - = size_t re_nsub; // number of parenthesized subexpressions - = const unsigned char *re_endp; // end pointer for REG_PEND - = struct re_guts *re_g; // none of your business :-) - = } regex_t; - = typedef struct { - = regoff_t rm_so; // start of match - = regoff_t rm_eo; // end of match - = } regmatch_t; - */ -/* - * internals of regex_t - */ -#define MAGIC1 ((('r'^0200)<<8) | 'e') - -/* - * The internal representation is a *strip*, a sequence of - * operators ending with an endmarker. (Some terminology etc. is a - * historical relic of earlier versions which used multiple strips.) - * Certain oddities in the representation are there to permit running - * the machinery backwards; in particular, any deviation from sequential - * flow must be marked at both its source and its destination. Some - * fine points: - * - * - OPLUS_ and O_PLUS are *inside* the loop they create. - * - OQUEST_ and O_QUEST are *outside* the bypass they create. - * - OCH_ and O_CH are *outside* the multi-way branch they create, while - * OOR1 and OOR2 are respectively the end and the beginning of one of - * the branches. Note that there is an implicit OOR2 following OCH_ - * and an implicit OOR1 preceding O_CH. - * - * In state representations, an operator's bit is on to signify a state - * immediately *preceding* "execution" of that operator. - */ -typedef long sop; /* strip operator */ -typedef long sopno; -#define OPRMASK 0x7c000000 -#define OPDMASK 0x03ffffff -#define OPSHIFT (26) -#define OP(n) ((n)&OPRMASK) -#define OPND(n) ((n)&OPDMASK) -#define SOP(op, opnd) ((op)|(opnd)) -/* operators meaning operand */ -/* (back, fwd are offsets) */ -#define OEND (1< uch [csetsize] */ - uch mask; /* bit within array */ - uch hash; /* hash code */ - size_t smultis; - unsigned char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */ -} cset; -/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */ -#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c)) -#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (c)) -#define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask) -#define MCadd(p, cs, cp) mcadd(p, cs, cp) /* regcomp() internal fns */ -#define MCsub(p, cs, cp) mcsub(p, cs, cp) -#define MCin(p, cs, cp) mcin(p, cs, cp) - -/* stuff for character categories */ -typedef unsigned char cat_t; - -/* - * main compiled-expression structure - */ -struct re_guts { - int magic; -# define MAGIC2 ((('R'^0200)<<8)|'E') - sop *strip; /* malloced area for strip */ - int csetsize; /* number of bits in a cset vector */ - int ncsets; /* number of csets in use */ - cset *sets; /* -> cset [ncsets] */ - uch *setbits; /* -> uch[csetsize][ncsets/CHAR_BIT] */ - int cflags; /* copy of regcomp() cflags argument */ - sopno nstates; /* = number of sops */ - sopno firststate; /* the initial OEND (normally 0) */ - sopno laststate; /* the final OEND */ - int iflags; /* internal flags */ -# define USEBOL 01 /* used ^ */ -# define USEEOL 02 /* used $ */ -# define BAD 04 /* something wrong */ - int nbol; /* number of ^ used */ - int neol; /* number of $ used */ - int ncategories; /* how many character categories */ - cat_t *categories; /* ->catspace[-UCHAR_MIN] */ - unsigned char *must; /* match must contain this string */ - int mlen; /* length of must */ - size_t nsub; /* copy of re_nsub */ - int backrefs; /* does it use back references? */ - sopno nplus; /* how deep does it nest +s? */ - /* catspace must be last */ - cat_t catspace[1]; /* actually [NC] */ -}; - -/* misc utilities */ -#define OUT (UCHAR_MAX+1) /* a non-character value */ -#define ISWORD(c) (isalnum(c) || (c) == '_') diff --git a/regex/regex_extra.h b/regex/regex_extra.h deleted file mode 100644 index d668f7613f8d4..0000000000000 --- a/regex/regex_extra.h +++ /dev/null @@ -1,23 +0,0 @@ -/* do not frame this - we must be able to include this file multiple times */ - -#undef regexec -#undef regerror -#undef regfree -#undef regcomp - -#if (defined(REGEX) && REGEX == 1) || (!defined(REGEX)) - -#ifndef PHP_WIN32 - -#ifndef PHP_NO_ALIASES - -#define regexec php_regexec -#define regerror php_regerror -#define regfree php_regfree -#define regcomp php_regcomp - -#endif - -#endif - -#endif diff --git a/regex/regexec.c b/regex/regexec.c deleted file mode 100644 index c1fdfe0e03f87..0000000000000 --- a/regex/regexec.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * the outer shell of regexec() - * - * This file includes engine.c *twice*, after muchos fiddling with the - * macros that code uses. This lets the same code operate on two different - * representations for state sets. - */ -#include -#include -#include -#include -#include -#include - -#include "regex.h" -#include "utils.h" -#include "regex2.h" - -#define PHP_REGEX_NOPE 0; /* for use in asserts; shuts lint up */ - -/* macros for manipulating states, small version */ -#define states unsigned -#define states1 unsigned /* for later use in regexec() decision */ -#define CLEAR(v) ((v) = 0) -#define SET0(v, n) ((v) &= ~((unsigned)1 << (n))) -#define SET1(v, n) ((v) |= (unsigned)1 << (n)) -#define ISSET(v, n) ((v) & ((unsigned)1 << (n))) -#define ASSIGN(d, s) ((d) = (s)) -#define EQ(a, b) ((a) == (b)) -#define STATEVARS int dummy /* dummy version */ -#define STATESETUP(m, n) /* nothing */ -#define STATETEARDOWN(m) /* nothing */ -#define SETUP(v) ((v) = 0) -#define onestate unsigned -#define INIT(o, n) ((o) = (unsigned)1 << (n)) -#define INC(o) ((o) <<= 1) -#define ISSTATEIN(v, o) ((v) & (o)) -/* some abbreviations; note that some of these know variable names! */ -/* do "if I'm here, I can also be there" etc without branches */ -#define FWD(dst, src, n) ((dst) |= ((unsigned)(src)&(here)) << (n)) -#define BACK(dst, src, n) ((dst) |= ((unsigned)(src)&(here)) >> (n)) -#define ISSETBACK(v, n) ((v) & ((unsigned)here >> (n))) -/* function names */ -#define SNAMES /* engine.c looks after details */ - -#include "engine.c" - -/* now undo things */ -#undef states -#undef CLEAR -#undef SET0 -#undef SET1 -#undef ISSET -#undef ASSIGN -#undef EQ -#undef STATEVARS -#undef STATESETUP -#undef STATETEARDOWN -#undef SETUP -#undef onestate -#undef INIT -#undef INC -#undef ISSTATEIN -#undef FWD -#undef BACK -#undef ISSETBACK -#undef SNAMES - -/* macros for manipulating states, large version */ -#define states unsigned char * -#define CLEAR(v) memset(v, 0, m->g->nstates) -#define SET0(v, n) ((v)[n] = 0) -#define SET1(v, n) ((v)[n] = 1) -#define ISSET(v, n) ((v)[n]) -#define ASSIGN(d, s) memcpy(d, s, m->g->nstates) -#define EQ(a, b) (memcmp(a, b, m->g->nstates) == 0) -#define STATEVARS int vn; unsigned char *space -#define STATESETUP(m, nv) { (m)->space = malloc((nv)*(m)->g->nstates); \ - if ((m)->space == NULL) return(REG_ESPACE); \ - (m)->vn = 0; } -#define STATETEARDOWN(m) { free((m)->space); } -#define SETUP(v) ((v) = &m->space[m->vn++ * m->g->nstates]) -#define onestate int -#define INIT(o, n) ((o) = (n)) -#define INC(o) ((o)++) -#define ISSTATEIN(v, o) ((v)[o]) -/* some abbreviations; note that some of these know variable names! */ -/* do "if I'm here, I can also be there" etc without branches */ -#define FWD(dst, src, n) ((dst)[here+(n)] |= (src)[here]) -#define BACK(dst, src, n) ((dst)[here-(n)] |= (src)[here]) -#define ISSETBACK(v, n) ((v)[here - (n)]) -/* function names */ -#define LNAMES /* flag */ - -#include "engine.c" - -/* - - regexec - interface for matching - = API_EXPORT(int) regexec(const regex_t *, const char *, size_t, \ - = regmatch_t [], int); - = #define REG_NOTBOL 00001 - = #define REG_NOTEOL 00002 - = #define REG_STARTEND 00004 - = #define REG_TRACE 00400 // tracing of execution - = #define REG_LARGE 01000 // force large representation - = #define REG_BACKR 02000 // force use of backref code - * - * We put this here so we can exploit knowledge of the state representation - * when choosing which matcher to call. Also, by this point the matchers - * have been prototyped. - */ -API_EXPORT(int) /* 0 success, REG_NOMATCH failure */ -regexec(preg, string, nmatch, pmatch, eflags) -const regex_t *preg; -const char *string; -size_t nmatch; -regmatch_t pmatch[]; -int eflags; -{ - register struct re_guts *g = preg->re_g; -#ifdef REDEBUG -# define GOODFLAGS(f) (f) -#else -# define GOODFLAGS(f) ((f)&(REG_NOTBOL|REG_NOTEOL|REG_STARTEND)) -#endif - - if (preg->re_magic != MAGIC1 || g->magic != MAGIC2) - return(REG_BADPAT); - assert(!(g->iflags&BAD)); - if (g->iflags&BAD) /* backstop for no-debug case */ - return(REG_BADPAT); - eflags = GOODFLAGS(eflags); - - if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags®_LARGE)) - return(smatcher(g, (unsigned char *)string, nmatch, pmatch, eflags)); - else - return(lmatcher(g, (unsigned char *)string, nmatch, pmatch, eflags)); -} diff --git a/regex/regfree.c b/regex/regfree.c deleted file mode 100644 index a1de3d4128dfa..0000000000000 --- a/regex/regfree.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include - -#include "regex.h" -#include "utils.h" -#include "regex2.h" - -/* - - regfree - free everything - = API_EXPORT(void) regfree(regex_t *); - */ -API_EXPORT(void) -regfree(preg) -regex_t *preg; -{ - register struct re_guts *g; - - if (preg->re_magic != MAGIC1) /* oops */ - return; /* nice to complain, but hard */ - - g = preg->re_g; - if (g == NULL || g->magic != MAGIC2) /* oops again */ - return; - preg->re_magic = 0; /* mark it invalid */ - g->magic = 0; /* mark it invalid */ - - if (g->strip != NULL) - free((char *)g->strip); - if (g->sets != NULL) - free((char *)g->sets); - if (g->setbits != NULL) - free((char *)g->setbits); - if (g->must != NULL) - free(g->must); - free((char *)g); -} diff --git a/regex/split.c b/regex/split.c deleted file mode 100644 index 188bdb775b9ff..0000000000000 --- a/regex/split.c +++ /dev/null @@ -1,316 +0,0 @@ -#include -#include - -/* - - split - divide a string into fields, like awk split() - = int split(char *string, char *fields[], int nfields, char *sep); - */ -int /* number of fields, including overflow */ -split(string, fields, nfields, sep) -char *string; -char *fields[]; /* list is not NULL-terminated */ -int nfields; /* number of entries available in fields[] */ -char *sep; /* "" white, "c" single char, "ab" [ab]+ */ -{ - register char *p = string; - register char c; /* latest character */ - register char sepc = sep[0]; - register char sepc2; - register int fn; - register char **fp = fields; - register char *sepp; - register int trimtrail; - - /* white space */ - if (sepc == '\0') { - while ((c = *p++) == ' ' || c == '\t') - continue; - p--; - trimtrail = 1; - sep = " \t"; /* note, code below knows this is 2 long */ - sepc = ' '; - } else - trimtrail = 0; - sepc2 = sep[1]; /* now we can safely pick this up */ - - /* catch empties */ - if (*p == '\0') - return(0); - - /* single separator */ - if (sepc2 == '\0') { - fn = nfields; - for (;;) { - *fp++ = p; - fn--; - if (fn == 0) - break; - while ((c = *p++) != sepc) - if (c == '\0') - return(nfields - fn); - *(p-1) = '\0'; - } - /* we have overflowed the fields vector -- just count them */ - fn = nfields; - for (;;) { - while ((c = *p++) != sepc) - if (c == '\0') - return(fn); - fn++; - } - /* not reached */ - } - - /* two separators */ - if (sep[2] == '\0') { - fn = nfields; - for (;;) { - *fp++ = p; - fn--; - while ((c = *p++) != sepc && c != sepc2) - if (c == '\0') { - if (trimtrail && **(fp-1) == '\0') - fn++; - return(nfields - fn); - } - if (fn == 0) - break; - *(p-1) = '\0'; - while ((c = *p++) == sepc || c == sepc2) - continue; - p--; - } - /* we have overflowed the fields vector -- just count them */ - fn = nfields; - while (c != '\0') { - while ((c = *p++) == sepc || c == sepc2) - continue; - p--; - fn++; - while ((c = *p++) != '\0' && c != sepc && c != sepc2) - continue; - } - /* might have to trim trailing white space */ - if (trimtrail) { - p--; - while ((c = *--p) == sepc || c == sepc2) - continue; - p++; - if (*p != '\0') { - if (fn == nfields+1) - *p = '\0'; - fn--; - } - } - return(fn); - } - - /* n separators */ - fn = 0; - for (;;) { - if (fn < nfields) - *fp++ = p; - fn++; - for (;;) { - c = *p++; - if (c == '\0') - return(fn); - sepp = sep; - while ((sepc = *sepp++) != '\0' && sepc != c) - continue; - if (sepc != '\0') /* it was a separator */ - break; - } - if (fn < nfields) - *(p-1) = '\0'; - for (;;) { - c = *p++; - sepp = sep; - while ((sepc = *sepp++) != '\0' && sepc != c) - continue; - if (sepc == '\0') /* it wasn't a separator */ - break; - } - p--; - } - - /* not reached */ -} - -#ifdef TEST_SPLIT - - -/* - * test program - * pgm runs regression - * pgm sep splits stdin lines by sep - * pgm str sep splits str by sep - * pgm str sep n splits str by sep n times - */ -int -main(argc, argv) -int argc; -char *argv[]; -{ - char buf[512]; - register int n; -# define MNF 10 - char *fields[MNF]; - - if (argc > 4) - for (n = atoi(argv[3]); n > 0; n--) { - (void) strcpy(buf, argv[1]); - } - else if (argc > 3) - for (n = atoi(argv[3]); n > 0; n--) { - (void) strcpy(buf, argv[1]); - (void) split(buf, fields, MNF, argv[2]); - } - else if (argc > 2) - dosplit(argv[1], argv[2]); - else if (argc > 1) - while (fgets(buf, sizeof(buf), stdin) != NULL) { - buf[strlen(buf)-1] = '\0'; /* stomp newline */ - dosplit(buf, argv[1]); - } - else - regress(); - - exit(0); -} - -dosplit(string, seps) -char *string; -char *seps; -{ -# define NF 5 - char *fields[NF]; - register int nf; - - nf = split(string, fields, NF, seps); - print(nf, NF, fields); -} - -print(nf, nfp, fields) -int nf; -int nfp; -char *fields[]; -{ - register int fn; - register int bound; - - bound = (nf > nfp) ? nfp : nf; - printf("%d:\t", nf); - for (fn = 0; fn < bound; fn++) - printf("\"%s\"%s", fields[fn], (fn+1 < nf) ? ", " : "\n"); -} - -#define RNF 5 /* some table entries know this */ -struct { - char *str; - char *seps; - int nf; - char *fi[RNF]; -} tests[] = { - "", " ", 0, { "" }, - " ", " ", 2, { "", "" }, - "x", " ", 1, { "x" }, - "xy", " ", 1, { "xy" }, - "x y", " ", 2, { "x", "y" }, - "abc def g ", " ", 5, { "abc", "def", "", "g", "" }, - " a bcd", " ", 4, { "", "", "a", "bcd" }, - "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, - - "", " _", 0, { "" }, - " ", " _", 2, { "", "" }, - "x", " _", 1, { "x" }, - "x y", " _", 2, { "x", "y" }, - "ab _ cd", " _", 2, { "ab", "cd" }, - " a_b c ", " _", 5, { "", "a", "b", "c", "" }, - "a b c_d e f", " _", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " _", 6, { "", "a", "b", "c", "d " }, - - "", " _~", 0, { "" }, - " ", " _~", 2, { "", "" }, - "x", " _~", 1, { "x" }, - "x y", " _~", 2, { "x", "y" }, - "ab _~ cd", " _~", 2, { "ab", "cd" }, - " a_b c~", " _~", 5, { "", "a", "b", "c", "" }, - "a b_c d~e f", " _~", 6, { "a", "b", "c", "d", "e f" }, - "~a b c d ", " _~", 6, { "", "a", "b", "c", "d " }, - - "", " _~-", 0, { "" }, - " ", " _~-", 2, { "", "" }, - "x", " _~-", 1, { "x" }, - "x y", " _~-", 2, { "x", "y" }, - "ab _~- cd", " _~-", 2, { "ab", "cd" }, - " a_b c~", " _~-", 5, { "", "a", "b", "c", "" }, - "a b_c-d~e f", " _~-", 6, { "a", "b", "c", "d", "e f" }, - "~a-b c d ", " _~-", 6, { "", "a", "b", "c", "d " }, - - "", " ", 0, { "" }, - " ", " ", 2, { "", "" }, - "x", " ", 1, { "x" }, - "xy", " ", 1, { "xy" }, - "x y", " ", 2, { "x", "y" }, - "abc def g ", " ", 4, { "abc", "def", "g", "" }, - " a bcd", " ", 3, { "", "a", "bcd" }, - "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, - - "", "", 0, { "" }, - " ", "", 0, { "" }, - "x", "", 1, { "x" }, - "xy", "", 1, { "xy" }, - "x y", "", 2, { "x", "y" }, - "abc def g ", "", 3, { "abc", "def", "g" }, - "\t a bcd", "", 2, { "a", "bcd" }, - " a \tb\t c ", "", 3, { "a", "b", "c" }, - "a b c d e ", "", 5, { "a", "b", "c", "d", "e" }, - "a b\tc d e f", "", 6, { "a", "b", "c", "d", "e f" }, - " a b c d e f ", "", 6, { "a", "b", "c", "d", "e f " }, - - NULL, NULL, 0, { NULL }, -}; - -regress() -{ - char buf[512]; - register int n; - char *fields[RNF+1]; - register int nf; - register int i; - register int printit; - register char *f; - - for (n = 0; tests[n].str != NULL; n++) { - (void) strcpy(buf, tests[n].str); - fields[RNF] = NULL; - nf = split(buf, fields, RNF, tests[n].seps); - printit = 0; - if (nf != tests[n].nf) { - printf("split `%s' by `%s' gave %d fields, not %d\n", - tests[n].str, tests[n].seps, nf, tests[n].nf); - printit = 1; - } else if (fields[RNF] != NULL) { - printf("split() went beyond array end\n"); - printit = 1; - } else { - for (i = 0; i < nf && i < RNF; i++) { - f = fields[i]; - if (f == NULL) - f = "(NULL)"; - if (strcmp(f, tests[n].fi[i]) != 0) { - printf("split `%s' by `%s', field %d is `%s', not `%s'\n", - tests[n].str, tests[n].seps, - i, fields[i], tests[n].fi[i]); - printit = 1; - } - } - } - if (printit) - print(nf, RNF, fields); - } -} -#endif diff --git a/regex/tests b/regex/tests deleted file mode 100644 index c05846177f594..0000000000000 --- a/regex/tests +++ /dev/null @@ -1,475 +0,0 @@ -# regular expression test set -# Lines are at least three fields, separated by one or more tabs. "" stands -# for an empty field. First field is an RE. Second field is flags. If -# C flag given, regcomp() is expected to fail, and the third field is the -# error name (minus the leading REG_). -# -# Otherwise it is expected to succeed, and the third field is the string to -# try matching it against. If there is no fourth field, the match is -# expected to fail. If there is a fourth field, it is the substring that -# the RE is expected to match. If there is a fifth field, it is a comma- -# separated list of what the subexpressions should match, with - indicating -# no match for that one. In both the fourth and fifth fields, a (sub)field -# starting with @ indicates that the (sub)expression is expected to match -# a null string followed by the stuff after the @; this provides a way to -# test where null strings match. The character `N' in REs and strings -# is newline, `S' is space, `T' is tab, `Z' is NUL. -# -# The full list of flags: -# - placeholder, does nothing -# b RE is a BRE, not an ERE -# & try it as both an ERE and a BRE -# C regcomp() error expected, third field is error name -# i REG_ICASE -# m ("mundane") REG_NOSPEC -# s REG_NOSUB (not really testable) -# n REG_NEWLINE -# ^ REG_NOTBOL -# $ REG_NOTEOL -# # REG_STARTEND (see below) -# p REG_PEND -# -# For REG_STARTEND, the start/end offsets are those of the substring -# enclosed in (). - -# basics -a & a a -abc & abc abc -abc|de - abc abc -a|b|c - abc a - -# parentheses and perversions thereof -a(b)c - abc abc -a\(b\)c b abc abc -a( C EPAREN -a( b a( a( -a\( - a( a( -a\( bC EPAREN -a\(b bC EPAREN -a(b C EPAREN -a(b b a(b a(b -# gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly) -a) - a) a) -) - ) ) -# end gagging (in a just world, those *should* give EPAREN) -a) b a) a) -a\) bC EPAREN -\) bC EPAREN -a()b - ab ab -a\(\)b b ab ab - -# anchoring and REG_NEWLINE -^abc$ & abc abc -a^b - a^b -a^b b a^b a^b -a$b - a$b -a$b b a$b a$b -^ & abc @abc -$ & abc @ -^$ & "" @ -$^ - "" @ -\($\)\(^\) b "" @ -# stop retching, those are legitimate (although disgusting) -^^ - "" @ -$$ - "" @ -b$ & abNc -b$ &n abNc b -^b$ & aNbNc -^b$ &n aNbNc b -^$ &n aNNb @Nb -^$ n abc -^$ n abcN @ -$^ n aNNb @Nb -\($\)\(^\) bn aNNb @Nb -^^ n^ aNNb @Nb -$$ n aNNb @NN -^a ^ a -a$ $ a -^a ^n aNb -^b ^n aNb b -a$ $n bNa -b$ $n bNa b -a*(^b$)c* - b b -a*\(^b$\)c* b b b - -# certain syntax errors and non-errors -| C EMPTY -| b | | -* C BADRPT -* b * * -+ C BADRPT -? C BADRPT -"" &C EMPTY -() - abc @abc -\(\) b abc @abc -a||b C EMPTY -|ab C EMPTY -ab| C EMPTY -(|a)b C EMPTY -(a|)b C EMPTY -(*a) C BADRPT -(+a) C BADRPT -(?a) C BADRPT -({1}a) C BADRPT -\(\{1\}a\) bC BADRPT -(a|*b) C BADRPT -(a|+b) C BADRPT -(a|?b) C BADRPT -(a|{1}b) C BADRPT -^* C BADRPT -^* b * * -^+ C BADRPT -^? C BADRPT -^{1} C BADRPT -^\{1\} bC BADRPT - -# metacharacters, backslashes -a.c & abc abc -a[bc]d & abd abd -a\*c & a*c a*c -a\\b & a\b a\b -a\\\*b & a\*b a\*b -a\bc & abc abc -a\ &C EESCAPE -a\\bc & a\bc a\bc -\{ bC BADRPT -a\[b & a[b a[b -a[b &C EBRACK -# trailing $ is a peculiar special case for the BRE code -a$ & a a -a$ & a$ -a\$ & a -a\$ & a$ a$ -a\\$ & a -a\\$ & a$ -a\\$ & a\$ -a\\$ & a\ a\ - -# back references, ugh -a\(b\)\2c bC ESUBREG -a\(b\1\)c bC ESUBREG -a\(b*\)c\1d b abbcbbd abbcbbd bb -a\(b*\)c\1d b abbcbd -a\(b*\)c\1d b abbcbbbd -^\(.\)\1 b abc -a\([bc]\)\1d b abcdabbd abbd b -a\(\([bc]\)\2\)*d b abbccd abbccd -a\(\([bc]\)\2\)*d b abbcbd -# actually, this next one probably ought to fail, but the spec is unclear -a\(\(b\)*\2\)*d b abbbd abbbd -# here is a case that no NFA implementation does right -\(ab*\)[ab]*\1 b ababaaa ababaaa a -# check out normal matching in the presence of back refs -\(a\)\1bcd b aabcd aabcd -\(a\)\1bc*d b aabcd aabcd -\(a\)\1bc*d b aabd aabd -\(a\)\1bc*d b aabcccd aabcccd -\(a\)\1bc*[ce]d b aabcccd aabcccd -^\(a\)\1b\(c\)*cd$ b aabcccd aabcccd - -# ordinary repetitions -ab*c & abc abc -ab+c - abc abc -ab?c - abc abc -a\(*\)b b a*b a*b -a\(**\)b b ab ab -a\(***\)b bC BADRPT -*a b *a *a -**a b a a -***a bC BADRPT - -# the dreaded bounded repetitions -{ & { { -{abc & {abc {abc -{1 C BADRPT -{1} C BADRPT -a{b & a{b a{b -a{1}b - ab ab -a\{1\}b b ab ab -a{1,}b - ab ab -a\{1,\}b b ab ab -a{1,2}b - aab aab -a\{1,2\}b b aab aab -a{1 C EBRACE -a\{1 bC EBRACE -a{1a C EBRACE -a\{1a bC EBRACE -a{1a} C BADBR -a\{1a\} bC BADBR -a{,2} - a{,2} a{,2} -a\{,2\} bC BADBR -a{,} - a{,} a{,} -a\{,\} bC BADBR -a{1,x} C BADBR -a\{1,x\} bC BADBR -a{1,x C EBRACE -a\{1,x bC EBRACE -a{300} C BADBR -a\{300\} bC BADBR -a{1,0} C BADBR -a\{1,0\} bC BADBR -ab{0,0}c - abcac ac -ab\{0,0\}c b abcac ac -ab{0,1}c - abcac abc -ab\{0,1\}c b abcac abc -ab{0,3}c - abbcac abbc -ab\{0,3\}c b abbcac abbc -ab{1,1}c - acabc abc -ab\{1,1\}c b acabc abc -ab{1,3}c - acabc abc -ab\{1,3\}c b acabc abc -ab{2,2}c - abcabbc abbc -ab\{2,2\}c b abcabbc abbc -ab{2,4}c - abcabbc abbc -ab\{2,4\}c b abcabbc abbc -((a{1,10}){1,10}){1,10} - a a a,a - -# multiple repetitions -a** &C BADRPT -a++ C BADRPT -a?? C BADRPT -a*+ C BADRPT -a*? C BADRPT -a+* C BADRPT -a+? C BADRPT -a?* C BADRPT -a?+ C BADRPT -a{1}{1} C BADRPT -a*{1} C BADRPT -a+{1} C BADRPT -a?{1} C BADRPT -a{1}* C BADRPT -a{1}+ C BADRPT -a{1}? C BADRPT -a*{b} - a{b} a{b} -a\{1\}\{1\} bC BADRPT -a*\{1\} bC BADRPT -a\{1\}* bC BADRPT - -# brackets, and numerous perversions thereof -a[b]c & abc abc -a[ab]c & abc abc -a[^ab]c & adc adc -a[]b]c & a]c a]c -a[[b]c & a[c a[c -a[-b]c & a-c a-c -a[^]b]c & adc adc -a[^-b]c & adc adc -a[b-]c & a-c a-c -a[b &C EBRACK -a[] &C EBRACK -a[1-3]c & a2c a2c -a[3-1]c &C ERANGE -a[1-3-5]c &C ERANGE -a[[.-.]--]c & a-c a-c -a[1- &C ERANGE -a[[. &C EBRACK -a[[.x &C EBRACK -a[[.x. &C EBRACK -a[[.x.] &C EBRACK -a[[.x.]] & ax ax -a[[.x,.]] &C ECOLLATE -a[[.one.]]b & a1b a1b -a[[.notdef.]]b &C ECOLLATE -a[[.].]]b & a]b a]b -a[[:alpha:]]c & abc abc -a[[:notdef:]]c &C ECTYPE -a[[: &C EBRACK -a[[:alpha &C EBRACK -a[[:alpha:] &C EBRACK -a[[:alpha,:] &C ECTYPE -a[[:]:]]b &C ECTYPE -a[[:-:]]b &C ECTYPE -a[[:alph:]] &C ECTYPE -a[[:alphabet:]] &C ECTYPE -[[:alnum:]]+ - -%@a0X- a0X -[[:alpha:]]+ - -%@aX0- aX -[[:blank:]]+ - aSSTb SST -[[:cntrl:]]+ - aNTb NT -[[:digit:]]+ - a019b 019 -[[:graph:]]+ - Sa%bS a%b -[[:lower:]]+ - AabC ab -[[:print:]]+ - NaSbN aSb -[[:punct:]]+ - S%-&T %-& -[[:space:]]+ - aSNTb SNT -[[:upper:]]+ - aBCd BC -[[:xdigit:]]+ - p0f3Cq 0f3C -a[[=b=]]c & abc abc -a[[= &C EBRACK -a[[=b &C EBRACK -a[[=b= &C EBRACK -a[[=b=] &C EBRACK -a[[=b,=]] &C ECOLLATE -a[[=one=]]b & a1b a1b - -# complexities -a(((b)))c - abc abc -a(b|(c))d - abd abd -a(b*|c)d - abbd abbd -# just gotta have one DFA-buster, of course -a[ab]{20} - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab -# and an inline expansion in case somebody gets tricky -a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab] - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab -# and in case somebody just slips in an NFA... -a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night) - aaaaabaaaabaaaabaaaabweeknights aaaaabaaaabaaaabaaaabweeknights -# fish for anomalies as the number of states passes 32 -12345678901234567890123456789 - a12345678901234567890123456789b 12345678901234567890123456789 -123456789012345678901234567890 - a123456789012345678901234567890b 123456789012345678901234567890 -1234567890123456789012345678901 - a1234567890123456789012345678901b 1234567890123456789012345678901 -12345678901234567890123456789012 - a12345678901234567890123456789012b 12345678901234567890123456789012 -123456789012345678901234567890123 - a123456789012345678901234567890123b 123456789012345678901234567890123 -# and one really big one, beyond any plausible word width -1234567890123456789012345678901234567890123456789012345678901234567890 - a1234567890123456789012345678901234567890123456789012345678901234567890b 1234567890123456789012345678901234567890123456789012345678901234567890 -# fish for problems as brackets go past 8 -[ab][cd][ef][gh][ij][kl][mn] - xacegikmoq acegikm -[ab][cd][ef][gh][ij][kl][mn][op] - xacegikmoq acegikmo -[ab][cd][ef][gh][ij][kl][mn][op][qr] - xacegikmoqy acegikmoq -[ab][cd][ef][gh][ij][kl][mn][op][q] - xacegikmoqy acegikmoq - -# subtleties of matching -abc & xabcy abc -a\(b\)?c\1d b acd -aBc i Abc Abc -a[Bc]*d i abBCcd abBCcd -0[[:upper:]]1 &i 0a1 0a1 -0[[:lower:]]1 &i 0A1 0A1 -a[^b]c &i abc -a[^b]c &i aBc -a[^b]c &i adc adc -[a]b[c] - abc abc -[a]b[a] - aba aba -[abc]b[abc] - abc abc -[abc]b[abd] - abd abd -a(b?c)+d - accd accd -(wee|week)(knights|night) - weeknights weeknights -(we|wee|week|frob)(knights|night|day) - weeknights weeknights -a[bc]d - xyzaaabcaababdacd abd -a[ab]c - aaabc abc -abc s abc abc -a* & b @b - -# Let's have some fun -- try to match a C comment. -# first the obvious, which looks okay at first glance... -/\*.*\*/ - /*x*/ /*x*/ -# but... -/\*.*\*/ - /*x*/y/*z*/ /*x*/y/*z*/ -# okay, we must not match */ inside; try to do that... -/\*([^*]|\*[^/])*\*/ - /*x*/ /*x*/ -/\*([^*]|\*[^/])*\*/ - /*x*/y/*z*/ /*x*/ -# but... -/\*([^*]|\*[^/])*\*/ - /*x**/y/*z*/ /*x**/y/*z*/ -# and a still fancier version, which does it right (I think)... -/\*([^*]|\*+[^*/])*\*+/ - /*x*/ /*x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x*/y/*z*/ /*x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x**/y/*z*/ /*x**/ -/\*([^*]|\*+[^*/])*\*+/ - /*x****/y/*z*/ /*x****/ -/\*([^*]|\*+[^*/])*\*+/ - /*x**x*/y/*z*/ /*x**x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x***x/y/*z*/ /*x***x/y/*z*/ - -# subexpressions -a(b)(c)d - abcd abcd b,c -a(((b)))c - abc abc b,b,b -a(b|(c))d - abd abd b,- -a(b*|c|e)d - abbd abbd bb -a(b*|c|e)d - acd acd c -a(b*|c|e)d - ad ad @d -a(b?)c - abc abc b -a(b?)c - ac ac @c -a(b+)c - abc abc b -a(b+)c - abbbc abbbc bbb -a(b*)c - ac ac @c -(a|ab)(bc([de]+)f|cde) - abcdef abcdef a,bcdef,de -# the regression tester only asks for 9 subexpressions -a(b)(c)(d)(e)(f)(g)(h)(i)(j)k - abcdefghijk abcdefghijk b,c,d,e,f,g,h,i,j -a(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)l - abcdefghijkl abcdefghijkl b,c,d,e,f,g,h,i,j,k -a([bc]?)c - abc abc b -a([bc]?)c - ac ac @c -a([bc]+)c - abc abc b -a([bc]+)c - abcc abcc bc -a([bc]+)bc - abcbc abcbc bc -a(bb+|b)b - abb abb b -a(bbb+|bb+|b)b - abb abb b -a(bbb+|bb+|b)b - abbb abbb bb -a(bbb+|bb+|b)bb - abbb abbb b -(.*).* - abcdef abcdef abcdef -(a*)* - bc @b @b - -# do we get the right subexpression when it is used more than once? -a(b|c)*d - ad ad - -a(b|c)*d - abcd abcd c -a(b|c)+d - abd abd b -a(b|c)+d - abcd abcd c -a(b|c?)+d - ad ad @d -a(b|c?)+d - abcd abcd @d -a(b|c){0,0}d - ad ad - -a(b|c){0,1}d - ad ad - -a(b|c){0,1}d - abd abd b -a(b|c){0,2}d - ad ad - -a(b|c){0,2}d - abcd abcd c -a(b|c){0,}d - ad ad - -a(b|c){0,}d - abcd abcd c -a(b|c){1,1}d - abd abd b -a(b|c){1,1}d - acd acd c -a(b|c){1,2}d - abd abd b -a(b|c){1,2}d - abcd abcd c -a(b|c){1,}d - abd abd b -a(b|c){1,}d - abcd abcd c -a(b|c){2,2}d - acbd acbd b -a(b|c){2,2}d - abcd abcd c -a(b|c){2,4}d - abcd abcd c -a(b|c){2,4}d - abcbd abcbd b -a(b|c){2,4}d - abcbcd abcbcd c -a(b|c){2,}d - abcd abcd c -a(b|c){2,}d - abcbd abcbd b -a(b+|((c)*))+d - abd abd @d,@d,- -a(b+|((c)*))+d - abcd abcd @d,@d,- - -# check out the STARTEND option -[abc] &# a(b)c b -[abc] &# a(d)c -[abc] &# a(bc)d b -[abc] &# a(dc)d c -. &# a()c -b.*c &# b(bc)c bc -b.* &# b(bc)c bc -.*c &# b(bc)c bc - -# plain strings, with the NOSPEC flag -abc m abc abc -abc m xabcy abc -abc m xyz -a*b m aba*b a*b -a*b m ab -"" mC EMPTY - -# cases involving NULs -aZb & a a -aZb &p a -aZb &p# (aZb) aZb -aZ*b &p# (ab) ab -a.b &# (aZb) aZb -a.* &# (aZb)c aZb - -# word boundaries (ick) -[[:<:]]a & a a -[[:<:]]a & ba -[[:<:]]a & -a a -a[[:>:]] & a a -a[[:>:]] & ab -a[[:>:]] & a- a -[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc abc -[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc-q abc -[[:<:]]a.c[[:>:]] & axc-dayc-dazce-abc axc -[[:<:]]b.c[[:>:]] & a_bxc-byc_d-bzc-q bzc -[[:<:]].x..[[:>:]] & y_xa_-_xb_y-_xc_-axdc _xc_ -[[:<:]]a_b[[:>:]] & x_a_b - -# past problems, and suspected problems -(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A]) - A1 A1 -abcdefghijklmnop i abcdefghijklmnop abcdefghijklmnop -abcdefghijklmnopqrstuv i abcdefghijklmnopqrstuv abcdefghijklmnopqrstuv -(ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN]) - CC11 CC11 -CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a - CC11 CC11 -Char \([a-z0-9_]*\)\[.* b Char xyz[k Char xyz[k xyz -a?b - ab ab --\{0,1\}[0-9]*$ b -5 -5 diff --git a/regex/utils.h b/regex/utils.h deleted file mode 100644 index cd4a96025f24a..0000000000000 --- a/regex/utils.h +++ /dev/null @@ -1,25 +0,0 @@ -/* utility definitions */ - -#include "regex_extra.h" - -#ifdef _POSIX2_RE_DUP_MAX -#define DUPMAX _POSIX2_RE_DUP_MAX -#else -#define DUPMAX 255 -#endif -#define INFINITY (DUPMAX + 1) -#define NC (CHAR_MAX - CHAR_MIN + 1) -typedef unsigned char uch; - -/* switch off assertions (if not already off) if no REDEBUG */ -#ifndef REDEBUG -#ifndef NDEBUG -#define NDEBUG /* no assertions please */ -#endif -#endif -#include - -/* for old systems with bcopy() but no memmove() */ -#ifdef USEBCOPY -#define memmove(d, s, c) bcopy(s, d, c) -#endif diff --git a/sapi/aolserver/CREDITS b/sapi/aolserver/CREDITS deleted file mode 100644 index 8f9a4af950350..0000000000000 --- a/sapi/aolserver/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -AOLserver -Sascha Schumann diff --git a/sapi/aolserver/README b/sapi/aolserver/README deleted file mode 100644 index 80c186ea5dfda..0000000000000 --- a/sapi/aolserver/README +++ /dev/null @@ -1,69 +0,0 @@ -AOLserver README ($Id$) - -To compile PHP 4.0 as a module for AOLserver, you need: - -- installed AOLserver 3.1 or later - (see the note below for AOLserver 3.0) - -NOTE: You should not use this module in production. PHP is not 100% stable - yet in threaded mode. To increase reliability enable the Global Lock - by removing #define NO_GLOBAL_LOCK in main/main.c. Also don't use - php_value as it will lead to races in a sub-system (use an ini file - instead). - - -1.) Configuring AOLserver - -Read doc/install.txt in the source distribution - -It usually boils down to changing the INST/PREFIX variable in -include/Makefile.global and running make all install. - -2.) Configuring PHP - -$ ./configure \ - --with-aolserver=/path/to/installed/aolserver \ - - -NOTE: If you are still using AOLserver 3.0, you need to retain the - AOLserver source code and pass another option to PHP: - - --with-aolserver-src=/path/to/source/distribution - -3.) Compiling and Installing PHP - -$ make install - -4.) Changing nsd.tcl - -a) New section - -Add a new section to pass options to PHP (required): - -ns_section "ns/server/${servername}/module/php" - -You can use the following commands in this section: - -The 'map' command will cause AOLserver to pass all requests to *.php to -the PHP module (can be specified multiple times). Example: - -ns_param map *.php - -The 'php_value "name val"' command assigns the configuration option name -the value val (can be used multiple times). Example: - -ns_param php_value "session.auto_start 1" - -b) Enabling PHP - -Then enable the PHP module: - -ns_section "ns/server/${servername}/modules" -... -ns_param php ${bindir}/libphp5.so - - -============================================================================= -This has been tested with AOLserver release 3.0. - -AOLserver support has been written by Sascha Schumann . diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c deleted file mode 100644 index b9969e848d00b..0000000000000 --- a/sapi/aolserver/aolserver.c +++ /dev/null @@ -1,619 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* - * TODO: - * - write documentation - * - CGI/1.1 conformance - */ - -/* $Id$ */ - -/* conflict between PHP and AOLserver headers */ -#define Debug php_Debug -#include "php.h" -#undef Debug - -#ifdef HAVE_AOLSERVER - -#ifndef ZTS -#error AOLserver module is only useable in thread-safe mode -#endif - -#include "ext/standard/info.h" -#define SECTION(name) PUTS("

" name "

\n") - -#define NS_BUF_SIZE 511 - -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_variables.h" - -#include "ns.h" - -#include "php_version.h" - -/* This symbol is used by AOLserver to tell the API version we expect */ - -int Ns_ModuleVersion = 1; - -#define NSG(v) TSRMG(ns_globals_id, ns_globals_struct *, v) - -/* php_ns_context is per-server (thus only once at all) */ - -typedef struct { - sapi_module_struct *sapi_module; - char *ns_server; - char *ns_module; -} php_ns_context; - -/* ns_globals_struct is per-thread */ - -typedef struct { - Ns_Conn *conn; - size_t data_avail; -} ns_globals_struct; - -/* TSRM id */ - -static int ns_globals_id; - -/* global context */ - -static php_ns_context *global_context; - -static void php_ns_config(php_ns_context *ctx, char global); - -/* - * php_ns_sapi_ub_write() writes data to the client connection. - */ - -static int -php_ns_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int n; - uint sent = 0; - - while (str_length > 0) { - n = Ns_ConnWrite(NSG(conn), (void *) str, str_length); - - if (n == -1) - php_handle_aborted_connection(); - - str += n; - sent += n; - str_length -= n; - } - - return sent; -} - -/* - * php_ns_sapi_header_handler() sets a HTTP reply header to be - * sent to the client. - */ - -static int -php_ns_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content; - char *p; - - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - - if (p) { - *p = '\0'; - do { - header_content++; - } while (*header_content == ' '); - - if (!strcasecmp(header_name, "Content-type")) { - Ns_ConnSetTypeHeader(NSG(conn), header_content); - } else { - Ns_ConnSetHeaders(NSG(conn), header_name, header_content); - } - - *p = ':'; - } - - sapi_free_header(sapi_header); - - return 0; -} - -/* - * php_ns_sapi_send_headers() flushes the headers to the client. - * Called before real content is sent by PHP. - */ - -static int -php_ns_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - if(SG(sapi_headers).send_default_content_type) { - Ns_ConnSetRequiredHeaders(NSG(conn), "text/html", 0); - } - - Ns_ConnFlushHeaders(NSG(conn), SG(sapi_headers).http_response_code); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -/* - * php_ns_sapi_read_post() reads a specified number of bytes from - * the client. Used for POST/PUT requests. - */ - -static int -php_ns_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - uint max_read; - uint total_read = 0; - - max_read = MIN(NSG(data_avail), count_bytes); - - total_read = Ns_ConnRead(NSG(conn), buf, max_read); - - if(total_read == NS_ERROR) { - total_read = -1; - } else { - NSG(data_avail) -= total_read; - } - - return total_read; -} - -/* - * php_ns_sapi_read_cookies() returns the Cookie header from - * the HTTP request header - */ - -static char *php_ns_sapi_read_cookies(TSRMLS_D) -{ - int i; - char *http_cookie = NULL; - - i = Ns_SetIFind(NSG(conn->headers), "cookie"); - if(i != -1) { - http_cookie = Ns_SetValue(NSG(conn->headers), i); - } - - return http_cookie; -} - -static void php_info_aolserver(ZEND_MODULE_INFO_FUNC_ARGS) -{ - char buf[512]; - int uptime = Ns_InfoUptime(); - int i; - - php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id$"); - php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); - php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); - php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); - php_info_print_table_row(2, "Installation path", Ns_InfoHomePath()); - php_info_print_table_row(2, "Hostname of server", Ns_InfoHostname()); - php_info_print_table_row(2, "Source code label", Ns_InfoLabel()); - php_info_print_table_row(2, "Server platform", Ns_InfoPlatform()); - snprintf(buf, 511, "%s/%s", Ns_InfoServerName(), Ns_InfoServerVersion()); - php_info_print_table_row(2, "Server version", buf); - snprintf(buf, 511, "%d day(s), %02d:%02d:%02d", - uptime / 86400, - (uptime / 3600) % 24, - (uptime / 60) % 60, - uptime % 60); - php_info_print_table_row(2, "Server uptime", buf); - php_info_print_table_end(); - - SECTION("HTTP Headers Information"); - php_info_print_table_start(); - php_info_print_table_colspan_header(2, "HTTP Request Headers"); - php_info_print_table_row(2, "HTTP Request", NSG(conn)->request->line); - for (i = 0; i < Ns_SetSize(NSG(conn)->headers); i++) { - php_info_print_table_row(2, Ns_SetKey(NSG(conn)->headers, i), Ns_SetValue(NSG(conn)->headers, i)); - } - - php_info_print_table_colspan_header(2, "HTTP Response Headers"); - for (i = 0; i < Ns_SetSize(NSG(conn)->outputheaders); i++) { - php_info_print_table_row(2, Ns_SetKey(NSG(conn)->outputheaders, i), Ns_SetValue(NSG(conn)->outputheaders, i)); - } - php_info_print_table_end(); -} - -PHP_FUNCTION(getallheaders); - -static zend_function_entry aolserver_functions[] = { - PHP_FE(getallheaders, NULL) - {NULL, NULL, NULL} -}; - -static zend_module_entry php_aolserver_module = { - STANDARD_MODULE_HEADER, - "AOLserver", - aolserver_functions, - NULL, - NULL, - NULL, - NULL, - php_info_aolserver, - NULL, - STANDARD_MODULE_PROPERTIES -}; - -PHP_FUNCTION(getallheaders) -{ - int i; - - array_init(return_value); - - for (i = 0; i < Ns_SetSize(NSG(conn->headers)); i++) { - char *key = Ns_SetKey(NSG(conn->headers), i); - char *value = Ns_SetValue(NSG(conn->headers), i); - - add_assoc_string(return_value, key, value, 1); - } -} - -static int -php_ns_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_aolserver_module, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - - -/* - * php_ns_sapi_register_variables() populates the php script environment - * with a number of variables. HTTP_* variables are created for - * the HTTP header data, so that a script can access these. - */ - -#define ADD_STRINGX(name, buf) \ - php_register_variable(name, buf, track_vars_array TSRMLS_CC) - -#define ADD_STRING(name) \ - ADD_STRINGX(name, buf) - -static void -php_ns_sapi_register_variables(zval *track_vars_array TSRMLS_DC) -{ - int i; - char buf[NS_BUF_SIZE + 1]; - char *tmp; - - for(i = 0; i < Ns_SetSize(NSG(conn->headers)); i++) { - char *key = Ns_SetKey(NSG(conn->headers), i); - char *value = Ns_SetValue(NSG(conn->headers), i); - char *p; - char c; - - snprintf(buf, NS_BUF_SIZE, "HTTP_%s", key); - - for(p = buf + 5; (c = *p); p++) { - c = toupper(c); - if(c < 'A' || c > 'Z') { - c = '_'; - } - *p = c; - } - - ADD_STRINGX(buf, value); - } - - snprintf(buf, NS_BUF_SIZE, "%s/%s", Ns_InfoServerName(), Ns_InfoServerVersion()); - ADD_STRING("SERVER_SOFTWARE"); - snprintf(buf, NS_BUF_SIZE, "HTTP/%1.1f", NSG(conn)->request->version); - ADD_STRING("SERVER_PROTOCOL"); - - ADD_STRINGX("REQUEST_METHOD", NSG(conn)->request->method); - - if(NSG(conn)->request->query) - ADD_STRINGX("QUERY_STRING", NSG(conn)->request->query); - - ADD_STRINGX("SERVER_BUILDDATE", Ns_InfoBuildDate()); - - ADD_STRINGX("REMOTE_ADDR", Ns_ConnPeer(NSG(conn))); - - snprintf(buf, NS_BUF_SIZE, "%d", Ns_ConnPeerPort(NSG(conn))); - ADD_STRING("REMOTE_PORT"); - - snprintf(buf, NS_BUF_SIZE, "%d", Ns_ConnPort(NSG(conn))); - ADD_STRING("SERVER_PORT"); - - tmp = Ns_ConnHost(NSG(conn)); - if (tmp) - ADD_STRINGX("SERVER_NAME", tmp); - - ADD_STRINGX("PATH_TRANSLATED", SG(request_info).path_translated); - ADD_STRINGX("REQUEST_URI", SG(request_info).request_uri); - ADD_STRINGX("PHP_SELF", SG(request_info).request_uri); - - ADD_STRINGX("GATEWAY_INTERFACE", "CGI/1.1"); - - snprintf(buf, NS_BUF_SIZE, "%d", Ns_InfoBootTime()); - ADD_STRING("SERVER_BOOTTIME"); -} - - - -/* this structure is static (as in "it does not change") */ - -static sapi_module_struct aolserver_sapi_module = { - "aolserver", - "AOLserver", - - php_ns_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - php_ns_sapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - php_ns_sapi_header_handler, /* header handler */ - php_ns_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - php_ns_sapi_read_post, /* read POST data */ - php_ns_sapi_read_cookies, /* read Cookies */ - - php_ns_sapi_register_variables, - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -/* - * php_ns_module_main() is called by the per-request handler and - * "executes" the script - */ - -static int -php_ns_module_main(TSRMLS_D) -{ - zend_file_handle file_handle; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_ns_config(global_context, 0); - if (php_request_startup(TSRMLS_C) == FAILURE) { - return NS_ERROR; - } - - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - - return NS_OK; -} - -/* - * php_ns_request_ctor() initializes the per-request data structure - * and fills it with data provided by the web server - */ - -static void -php_ns_request_ctor(TSRMLS_D) -{ - char *server; - Ns_DString ds; - char *root; - int index; - char *tmp; - - server = Ns_ConnServer(NSG(conn)); - -#define safe_strdup(x) ((x)?strdup((x)):NULL) - SG(request_info).query_string = safe_strdup(NSG(conn->request->query)); - - Ns_DStringInit(&ds); - Ns_UrlToFile(&ds, server, NSG(conn->request->url)); - - /* path_translated is the absolute path to the file */ - SG(request_info).path_translated = safe_strdup(Ns_DStringValue(&ds)); - Ns_DStringFree(&ds); - root = Ns_PageRoot(server); - SG(request_info).request_uri = strdup(SG(request_info).path_translated + strlen(root)); - SG(request_info).request_method = NSG(conn)->request->method; - if(NSG(conn)->request->version > 1.0) SG(request_info).proto_num = 1001; - else SG(request_info).proto_num = 1000; - SG(request_info).content_length = Ns_ConnContentLength(NSG(conn)); - index = Ns_SetIFind(NSG(conn)->headers, "content-type"); - SG(request_info).content_type = index == -1 ? NULL : - Ns_SetValue(NSG(conn)->headers, index); - SG(sapi_headers).http_response_code = 200; - - tmp = Ns_ConnAuthUser(NSG(conn)); - if (tmp) - tmp = estrdup(tmp); - SG(request_info).auth_user = tmp; - - tmp = Ns_ConnAuthPasswd(NSG(conn)); - if (tmp) - tmp = estrdup(tmp); - SG(request_info).auth_password = tmp; - - NSG(data_avail) = SG(request_info).content_length; -} - -/* - * php_ns_request_dtor() destroys all data associated with - * the per-request structure - */ - -static void -php_ns_request_dtor(TSRMLS_D) -{ - free(SG(request_info).path_translated); - if (SG(request_info).query_string) - free(SG(request_info).query_string); - free(SG(request_info).request_uri); -} - -/* - * The php_ns_request_handler() is called per request and handles - * everything for one request. - */ - -static int -php_ns_request_handler(void *context, Ns_Conn *conn) -{ - int status = NS_OK; - TSRMLS_FETCH(); - - NSG(conn) = conn; - - SG(server_context) = global_context; - - php_ns_request_ctor(TSRMLS_C); - - status = php_ns_module_main(TSRMLS_C); - - php_ns_request_dtor(TSRMLS_C); - - return status; -} - -/* - * php_ns_config() fetches the configuration data. - * - * It understands the "map" and "php_value" command. - */ - -static void -php_ns_config(php_ns_context *ctx, char global) -{ - int i; - char *path; - Ns_Set *set; - - path = Ns_ConfigGetPath(ctx->ns_server, ctx->ns_module, NULL); - set = Ns_ConfigGetSection(path); - - for (i = 0; set && i < Ns_SetSize(set); i++) { - char *key = Ns_SetKey(set, i); - char *value = Ns_SetValue(set, i); - - if (global && !strcasecmp(key, "map")) { - Ns_Log(Notice, "Registering PHP for \"%s\"", value); - Ns_RegisterRequest(ctx->ns_server, "GET", value, php_ns_request_handler, NULL, ctx, 0); - Ns_RegisterRequest(ctx->ns_server, "POST", value, php_ns_request_handler, NULL, ctx, 0); - Ns_RegisterRequest(ctx->ns_server, "HEAD", value, php_ns_request_handler, NULL, ctx, 0); - - /* - * Deactivated for now. The ini system will cause random crashes when - * accessed from here (since there are no locks to protect the global - * known_directives) - */ - - } else if (!global && !strcasecmp(key, "php_value")) { - Ns_Log(Notice, "php_value has been deactivated temporarily. Please use a php.ini file to pass directives to PHP. Thanks."); -#if 0 - char *val; - - val = strchr(value, ' '); - if (val) { - char *new_key; - - new_key = estrndup(value, val - value); - - do { - val++; - } while(*val == ' '); - - Ns_Log(Debug, "PHP configuration option '%s=%s'", new_key, val); - zend_alter_ini_entry(new_key, strlen(new_key) + 1, val, - strlen(val) + 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - - efree(new_key); - } -#endif - } - - } -} - -/* - * php_ns_server_shutdown() performs the last steps before the - * server exits. Shutdowns basic services and frees memory - */ - -static void -php_ns_server_shutdown(void *context) -{ - php_ns_context *ctx = (php_ns_context *) context; - - ctx->sapi_module->shutdown(ctx->sapi_module); - sapi_shutdown(); - tsrm_shutdown(); - - free(ctx->ns_module); - free(ctx->ns_server); - free(ctx); -} - -/* - * Ns_ModuleInit() is called by AOLserver once at startup - * - * This functions allocates basic structures and initializes - * basic services. - */ - -int Ns_ModuleInit(char *server, char *module) -{ - php_ns_context *ctx; - - tsrm_startup(1, 1, 0, NULL); - sapi_startup(&aolserver_sapi_module); - sapi_module.startup(&aolserver_sapi_module); - - /* TSRM is used to allocate a per-thread structure */ - ts_allocate_id(&ns_globals_id, sizeof(ns_globals_struct), NULL, NULL); - - /* the context contains data valid for all threads */ - ctx = malloc(sizeof *ctx); - ctx->sapi_module = &aolserver_sapi_module; - ctx->ns_server = strdup(server); - ctx->ns_module = strdup(module); - - /* read the configuration */ - php_ns_config(ctx, 1); - - global_context = ctx; - - /* register shutdown handler */ - Ns_RegisterServerShutdown(server, php_ns_server_shutdown, ctx); - - return NS_OK; -} - -#endif diff --git a/sapi/aolserver/config.m4 b/sapi/aolserver/config.m4 deleted file mode 100644 index a193bfd0586ec..0000000000000 --- a/sapi/aolserver/config.m4 +++ /dev/null @@ -1,31 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(aolserver,, -[ --with-aolserver=DIR Specify path to the installed AOLserver], no, no) - -AC_MSG_CHECKING([for AOLserver support]) - -if test "$PHP_AOLSERVER" != "no"; then - if test -d "$PHP_AOLSERVER/include"; then - PHP_AOLSERVER_SRC=$PHP_AOLSERVER - fi - if test -z "$PHP_AOLSERVER_SRC" || test ! -d $PHP_AOLSERVER_SRC/include; then - AC_MSG_ERROR(Please specify the path to the source distribution of AOLserver using --with-aolserver-src=DIR) - fi - if test ! -d $PHP_AOLSERVER/bin ; then - AC_MSG_ERROR(Please specify the path to the root of AOLserver using --with-aolserver=DIR) - fi - PHP_BUILD_THREAD_SAFE - PHP_ADD_INCLUDE($PHP_AOLSERVER_SRC/include) - AC_DEFINE(HAVE_AOLSERVER,1,[Whether you have AOLserver]) - PHP_SELECT_SAPI(aolserver, shared, aolserver.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_AOLSERVER/bin/" -fi - -AC_MSG_RESULT([$PHP_AOLSERVER]) - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/aolserver/config.w32 b/sapi/aolserver/config.w32 deleted file mode 100644 index 75b4361efc551..0000000000000 --- a/sapi/aolserver/config.w32 +++ /dev/null @@ -1,16 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_WITH('aolserver', 'Build AOLserver support', 'no'); - -if (PHP_AOLSERVER != "no") { - if (PHP_ZTS == "no") { - WARNING("AOLSERVER module requires an --enable-zts build of PHP"); - } else { - if (CHECK_HEADER_ADD_INCLUDE("ns.h", "CFLAGS_AOLSERVER", PHP_AOLSERVER) && CHECK_LIB("nsd.lib", "aolserver", PHP_AOLSERVER)) { - SAPI('aolserver', 'aolserver.c', 'php' + PHP_VERSION + 'aolserver.so', '/D XP_WIN32 '); - } else { - WARNING("sapi/aolserver not enabled: Could not find libraries/headers"); - } - } -} diff --git a/sapi/aolserver/php.sym b/sapi/aolserver/php.sym deleted file mode 100644 index b401ffd2b3ff5..0000000000000 --- a/sapi/aolserver/php.sym +++ /dev/null @@ -1,2 +0,0 @@ -Ns_ModuleVersion -Ns_ModuleInit diff --git a/sapi/aolserver/php5aolserver.dsp b/sapi/aolserver/php5aolserver.dsp deleted file mode 100644 index dd6ad71c533a7..0000000000000 --- a/sapi/aolserver/php5aolserver.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5aolserver" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5aolserver - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5aolserver.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5aolserver.mak" CFG="php5aolserver - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5aolserver - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5aolserver - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5aolserver - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5aolserver - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5AOLSERVER_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "NDEBUG" /D "PHP5AOLSERVER_EXPORTS" /D "PHP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /D "HAVE_AOLSERVER" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 nsd.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /out:"../../Release_TS/php5aolserver.so" /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" - -!ELSEIF "$(CFG)" == "php5aolserver - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_inline" -# PROP BASE Intermediate_Dir "Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5AOLSERVER_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "PHPAOLSERVER_EXPORTS" /D "PHP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /D "HAVE_AOLSERVER" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 nsd.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /out:"../../Release_TS_inline/php5aolserver.so" /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5aolserver - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5AOLSERVER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PHP5AOLSERVER_EXPORTS" /D "PHP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /D "HAVE_AOLSERVER" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 nsd.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /debug /machine:I386 /out:"..\..\Debug_TS/php5aolserver.so" /pdbtype:sept /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "php5aolserver - Win32 Release_TS" -# Name "php5aolserver - Win32 Release_TS_inline" -# Name "php5aolserver - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\aolserver.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/sapi/apache/CREDITS b/sapi/apache/CREDITS deleted file mode 100644 index 991deb56335c7..0000000000000 --- a/sapi/apache/CREDITS +++ /dev/null @@ -1,3 +0,0 @@ -Apache 1.3 -Rasmus Lerdorf, Zeev Suraski, Stig Bakken, David Sklar - diff --git a/sapi/apache/apMakefile.libdir b/sapi/apache/apMakefile.libdir deleted file mode 100644 index 7b5254013a3b6..0000000000000 --- a/sapi/apache/apMakefile.libdir +++ /dev/null @@ -1,4 +0,0 @@ -This is a place-holder which indicates to Configure that it shouldn't -provide the default targets when building the Makefile in this directory. -Instead it'll just prepend all the important variable definitions, and -copy the Makefile.tmpl onto the end. diff --git a/sapi/apache/apMakefile.tmpl b/sapi/apache/apMakefile.tmpl deleted file mode 100644 index 5f77d9c9c9d47..0000000000000 --- a/sapi/apache/apMakefile.tmpl +++ /dev/null @@ -1,77 +0,0 @@ -## -## Apache 1.3 Makefile template for PHP 5.0 Module -## [src/modules/php5/Makefile.tmpl] -## - -# the parametrized target -LIB=libphp5.$(LIBEXT) - -# objects for building the static library -OBJS=mod_php5.o -OBJS_LIB=libmodphp5.a - -# objects for building the shared object library -SHLIB_OBJS=mod_php5.so-o -SHLIB_OBJS_LIB=libmodphp5.a - -# the general targets -all: lib -lib: $(LIB) - -# build the static library by merging the object files -libphp5.a: $(OBJS) $(OBJS_LIB) - cp $(OBJS_LIB) $@ - ar r $@ $(OBJS) - $(RANLIB) $@ - -# ugly hack to support older Apache-1.3 betas that don't set $LIBEXT -libphp5.: $(OBJS) $(OBJS_LIB) - cp $(OBJS_LIB) $@ - ar r $@ $(OBJS) - $(RANLIB) $@ - cp libphp5. libphp5.a - -# build the shared object library by linking the object files -libphp5.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) - rm -f $@ - $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) $(PHP_LIBS) - -# 1. extension .o for shared objects cannot be used here because -# first these files aren't still shared objects and second we -# have to use a different name to trigger the different -# implicit Make rule -# 2. extension -so.o (as used elsewhere) cannot be used because -# the suffix feature of Make really wants just .x, so we use -# extension .so-o -.SUFFIXES: .o .so-o -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< -.c.so-o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< && mv $*.o $*.so-o - -# cleanup -clean: - -rm -f $(OBJS) $(SHLIB_OBJS) $(LIB) - -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after -# using it. -depend: - cp Makefile.tmpl Makefile.tmpl.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.tmpl \ - && rm Makefile.new - -#Dependencies - -$(OBJS): Makefile - -# DO NOT REMOVE -mod_php5.o: mod_php5.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \ - $(INCDIR)/buff.h \ - $(INCDIR)/http_config.h \ - $(INCDIR)/http_core.h $(INCDIR)/http_main.h \ - $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \ - $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php5.h diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4 deleted file mode 100644 index af83e9bcfa2bd..0000000000000 --- a/sapi/apache/config.m4 +++ /dev/null @@ -1,273 +0,0 @@ -dnl -dnl $Id$ -dnl -AC_DEFUN([PHP_APACHE_FD_CHECK], [ -AC_CACHE_CHECK([for member fd in BUFF *],ac_cv_php_fd_in_buff,[ - save=$CPPFLAGS - if test -n "$APXS_INCLUDEDIR"; then - CPPFLAGS="$CPPFLAGS -I$APXS_INCLUDEDIR" - else - CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE" - fi - AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ - ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) - CPPFLAGS=$save -]) -if test "$ac_cv_php_fd_in_buff" = "yes"; then - AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD,1,[ ]) -fi -]) - -dnl Apache 1.x shared module -PHP_ARG_WITH(apxs,, -[ --with-apxs[=FILE] Build shared Apache 1.x module. FILE is the optional - pathname to the Apache apxs tool [apxs]], no, no) - -AC_MSG_CHECKING([for Apache 1.x module support via DSO through APXS]) - -if test "$PHP_APXS" != "no"; then - if test "$PHP_APXS" = "yes"; then - APXS=apxs - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0" && test -x /usr/sbin/apxs; then #SUSE 6.x - APXS=/usr/sbin/apxs - fi - else - PHP_EXPAND_PATH($PHP_APXS, APXS) - fi - - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0"; then - AC_MSG_RESULT() - AC_MSG_RESULT() - AC_MSG_RESULT([Sorry, I was not able to successfully run APXS. Possible reasons:]) - AC_MSG_RESULT() - AC_MSG_RESULT([1. Perl is not installed;]) - AC_MSG_RESULT([2. Apache was not compiled with DSO support (--enable-module=so);]) - AC_MSG_RESULT([3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs]) - AC_MSG_RESULT([The output of $APXS follows]) - $APXS -q CFLAGS - AC_MSG_ERROR([Aborting]) - fi - - APXS_LDFLAGS="@SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@" - APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` - APXS_CFLAGS=`$APXS -q CFLAGS` - APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` - APACHE_INCLUDE=-I$APXS_INCLUDEDIR - - # Test that we're trying to configure with apache 1.x - PHP_AP_EXTRACT_VERSION($APXS_HTTPD) - if test "$APACHE_VERSION" -ge 2000000; then - AC_MSG_ERROR([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropiate switch --with-apxs2]) - fi - - for flag in $APXS_CFLAGS; do - case $flag in - -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";; - esac - done - - case $host_alias in - *aix*) - APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR` - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - PHP_AIX_LDFLAGS="-Wl,-brtl" - build_type=shared - ;; - *darwin*) - MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD" - PHP_SUBST(MH_BUNDLE_FLAGS) - SAPI_SHARED=libs/libphp5.so - build_type=bundle - ;; - *) - build_type=shared - ;; - esac - - PHP_SELECT_SAPI(apache, $build_type, sapi_apache.c mod_php5.c php_apache.c, $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR) - - # Test whether apxs support -S option - $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1 - - if test "$?" != "0"; then - APACHE_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option - else - APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` - if test -z `$APXS -q SYSCONFDIR`; then - APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5 $SAPI_SHARED" - else - APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` - APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5 $SAPI_SHARED" - fi - fi - - if test -z "`$APXS -q LD_SHLIB`" || test "`$APXS -q LIBEXECDIR`" = "modules"; then - PHP_APXS_BROKEN=yes - fi - STRONGHOLD= - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - AC_DEFINE(HAVE_APACHE,1,[ ]) - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi - -dnl Apache 1.x static module -PHP_ARG_WITH(apache,, -[ --with-apache[=DIR] Build Apache 1.x module. DIR is the top-level Apache - build directory [/usr/local/apache]], no, no) - -AC_MSG_CHECKING([for Apache 1.x module support]) - -if test "$PHP_SAPI" != "apache" && test "$PHP_APACHE" != "no"; then - - if test "$PHP_APACHE" = "yes"; then - # Apache's default directory - PHP_APACHE=/usr/local/apache - fi - - APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php5.* sapi/apache/libphp5.module" - - AC_DEFINE(HAVE_APACHE,1,[ ]) - APACHE_MODULE=yes - PHP_EXPAND_PATH($PHP_APACHE, PHP_APACHE) - # For Apache 1.2.x - if test -f $PHP_APACHE/src/httpd.h; then - APACHE_INCLUDE=-I$PHP_APACHE/src - APACHE_TARGET=$PHP_APACHE/src - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET" - PHP_LIBS="-L. -lphp3" - AC_MSG_RESULT([yes - Apache 1.2.x]) - STRONGHOLD= - if test -f $PHP_APACHE/src/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - # For Apache 2.0.x - elif test -f $PHP_APACHE/include/httpd.h && test -f $PHP_APACHE/srclib/apr/include/apr_general.h ; then - AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) - # For Apache 1.3.x - elif test -f $PHP_APACHE/src/main/httpd.h; then - APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$PHP_APACHE/src/main -I$PHP_APACHE/src/os/unix -I$PHP_APACHE/src/ap" - APACHE_TARGET=$PHP_APACHE/src/modules/php5 - if test ! -d $APACHE_TARGET; then - mkdir $APACHE_TARGET - fi - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - AC_MSG_RESULT([yes - Apache 1.3.x]) - STRONGHOLD= - if test -f $PHP_APACHE/src/include/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H, 1, [ ]) - fi - if test -f $PHP_APACHE/src/include/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H, 1, [ ]) - if test ! -f $PHP_APACHE/src/include/ap_config_auto.h; then - AC_MSG_ERROR([Please run Apache\'s configure or src/Configure program once and try again]) - fi - elif test -f $PHP_APACHE/src/include/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H, 1, [ ]) - fi - # Also for Apache 1.3.x - elif test -f $PHP_APACHE/src/include/httpd.h; then - APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$PHP_APACHE/src/include -I$PHP_APACHE/src/os/unix" - APACHE_TARGET=$PHP_APACHE/src/modules/php5 - if test ! -d $APACHE_TARGET; then - mkdir $APACHE_TARGET - fi - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - AC_MSG_RESULT([yes - Apache 1.3.x]) - STRONGHOLD= - if test -f $PHP_APACHE/src/include/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H, 1, [ ]) - fi - if test -f $PHP_APACHE/src/include/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H, 1, [ ]) - if test ! -f $PHP_APACHE/src/include/ap_config_auto.h; then - AC_MSG_ERROR([Please run Apache\'s configure or src/Configure program once and try again]) - fi - elif test -f $PHP_APACHE/src/include/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H, 1, [ ]) - fi - # For StrongHold 2.2 - elif test -f $PHP_APACHE/apache/httpd.h; then - APACHE_INCLUDE="-I$PHP_APACHE/apache -I$PHP_APACHE/ssl/include" - APACHE_TARGET=$PHP_APACHE/apache - PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET" - STRONGHOLD=-DSTRONGHOLD=1 - AC_MSG_RESULT([yes - StrongHold]) - if test -f $PHP_APACHE/apache/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H, 1, [ ]) - fi - if test -f $PHP_APACHE/src/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H, 1, [ ]) - if test ! -f $PHP_APACHE/src/include/ap_config_auto.h; then - AC_MSG_ERROR([Please run Apache\'s configure or src/Configure program once and try again]) - fi - elif test -f $PHP_APACHE/src/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H, 1, [ ]) - fi - else - AC_MSG_RESULT(no) - AC_MSG_ERROR([Invalid Apache directory - unable to find httpd.h under $PHP_APACHE]) - fi -else - AC_MSG_RESULT(no) -fi - -# compatibility -if test -z "$enable_mod_charset" && test "$with_mod_charset"; then - enable_mod_charset=$with_mod_charset -fi - -PHP_ARG_ENABLE(mod-charset, whether to enable Apache charset compatibility option, -[ --enable-mod-charset APACHE: Enable transfer tables for mod_charset (Rus Apache)], no, no) - -if test "$PHP_MOD_CHARSET" = "yes"; then - AC_DEFINE(USE_TRANSFER_TABLES, 1, [ ]) -fi - -dnl Build as static module -if test "$APACHE_MODULE" = "yes"; then - PHP_TARGET_RDYNAMIC - $php_shtool mkdir -p sapi/apache - PHP_OUTPUT(sapi/apache/libphp5.module) -fi - -dnl General -if test -n "$APACHE_INSTALL"; then - if test "x$APXS" != "x" -a "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then - APXS_EXP=-bE:sapi/apache/mod_php5.exp - fi - - PHP_APACHE_FD_CHECK - INSTALL_IT=$APACHE_INSTALL - - PHP_SUBST(APXS_EXP) - PHP_SUBST(APACHE_INCLUDE) - PHP_SUBST(APACHE_TARGET) - PHP_SUBST(APXS) - PHP_SUBST(APXS_LDFLAGS) - PHP_SUBST(APACHE_INSTALL) - PHP_SUBST(STRONGHOLD) -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/apache/config.w32 b/sapi/apache/config.w32 deleted file mode 100644 index 83ceb1a4dbfd9..0000000000000 --- a/sapi/apache/config.w32 +++ /dev/null @@ -1,24 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('apache', 'Build Apache 1.3.x version of PHP', 'no'); - -ARG_WITH('apache-includes', 'Where to find Apache 1.3 headers', null); -ARG_WITH('apache-libs', 'Where to find Apache 1.3 libraries', null); - -if (PHP_APACHE != "no") { - if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE", php_usual_include_suspects + - ";" + PROGRAM_FILES + "\\Apache Group\\Apache\\include" + - ";..\\php_build\\apache\\src\\include") && - CHECK_LIB("ApacheCore.lib", "apache", php_usual_lib_suspects + - ';' + PROGRAM_FILES + '\\Apache Group\\Apache\\libexec' + - ';..\\php_build\\apache\\src\\corer')) { - // We need to play tricks to get our readdir.h used by apache - // headers - SAPI('apache', 'mod_php5.c sapi_apache.c php_apache.c', - 'php' + PHP_VERSION + 'apache.dll', - '/D APACHEPHP5_EXPORTS /D APACHE_READDIR_H /I win32'); - } else { - WARNING("Could not find apache libraries/headers"); - } -} diff --git a/sapi/apache/libphp5.module.in b/sapi/apache/libphp5.module.in deleted file mode 100644 index 00d9c49f401bc..0000000000000 --- a/sapi/apache/libphp5.module.in +++ /dev/null @@ -1,11 +0,0 @@ -Name: php5_module -ConfigStart - RULE_WANTHSREGEX=no - RULE_HIDE=yes - PHP_LIBS="@NATIVE_RPATHS@ @PHP_LDFLAGS@ @PHP_LIBS@ @EXTRA_LDFLAGS@ @EXTRA_LIBS@ $LIBS" - PHP_CFLAGS="$CFLAGS @OPENSSL_INCDIR_OPT@ -I@php_abs_top_builddir@/main -I@php_abs_top_builddir@/Zend -I@php_abs_top_builddir@/TSRM -I@php_abs_top_srcdir@ -I@php_abs_top_srcdir@/sapi/apache -I@php_abs_top_srcdir@/main -I@php_abs_top_srcdir@/Zend -I@php_abs_top_srcdir@/TSRM" - my_outfile="Makefile.config" - echo "PHP_CFLAGS=$PHP_CFLAGS" >>$my_outfile - echo "PHP_LIBS=$PHP_LIBS" >>$my_outfile - LIBS=$PHP_LIBS -ConfigEnd diff --git a/sapi/apache/libpre.c b/sapi/apache/libpre.c deleted file mode 100644 index fe88b42a34757..0000000000000 --- a/sapi/apache/libpre.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef NETWARE - -/* ------------------------------------------------------------------ - * These functions are to be called when the shared NLM starts and - * stops. By using these functions instead of defining a main() - * and calling ExitThread(TSR_THREAD, 0), the load time of the - * shared NLM is faster and memory size reduced. - * - * You may also want to override these in your own Apache module - * to do any cleanup other than the mechanism Apache modules provide. - * ------------------------------------------------------------------ - */ - - -#ifdef __GNUC__ -#include /* memset */ -extern char _edata, _end ; /* end of DATA (start of BSS), end of BSS */ -#endif - -int _lib_start() -{ -/* printf("Inside _lib_start\n");*/ -#ifdef __GNUC__ - memset (&_edata, 0, &_end - &_edata); -#endif - return 0; -} - -int _lib_stop() -{ -/* printf("Inside _lib_stop\n");*/ - return 0; -} - -#endif /* NETWARE */ diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c deleted file mode 100644 index 4e7c448f6d8c6..0000000000000 --- a/sapi/apache/mod_php5.c +++ /dev/null @@ -1,1026 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | (with helpful hints from Dean Gaudet | - | PHP 4.0 patches by Zeev Suraski | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" -#include "http_conf_globals.h" - -#ifdef NETWARE -#define SIGPIPE SIGINT -#endif - -#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) -#include "ext/mbstring/mbstring.h" -#endif /* defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) */ - -#undef shutdown - -/* {{{ Prototypes - */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC); -static void php_save_umask(void); -static void php_restore_umask(void); -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC); -static char *sapi_apache_read_cookies(TSRMLS_D); -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC); -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC); -static int send_php(request_rec *r, int display_source_mode, char *filename); -static int send_parsed_php(request_rec * r); -static int send_parsed_php_source(request_rec * r); -static int php_xbithack_handler(request_rec * r); -static void php_init_handler(server_rec *s, pool *p); -/* }}} */ - -#if MODULE_MAGIC_NUMBER >= 19970728 -static void php_child_exit_handler(server_rec *s, pool *p); -#endif - -#if MODULE_MAGIC_NUMBER > 19961007 -#define CONST_PREFIX const -#else -#define CONST_PREFIX -#endif -static CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); -static CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_admin_value_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); -static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2); - -/* ### these should be defined in mod_php5.h or somewhere else */ -#define USE_PATH 1 -#define IGNORE_URL 2 -#define MAX_STATUS_LENGTH sizeof("xxxx LONGEST POSSIBLE STATUS DESCRIPTION") - -module MODULE_VAR_EXPORT php5_module; - -int saved_umask; -static unsigned char apache_php_initialized; - -typedef struct _php_per_dir_entry { - char *key; - char *value; - uint key_length; - uint value_length; - int type; - char htaccess; -} php_per_dir_entry; - -/* some systems are missing these from their header files */ - -/* {{{ php_save_umask - */ -static void php_save_umask(void) -{ - saved_umask = umask(077); - umask(saved_umask); -} -/* }}} */ - -/* {{{ sapi_apache_ub_write - */ -static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int ret=0; - - if (SG(server_context)) { - ret = rwrite(str, str_length, (request_rec *) SG(server_context)); - } - if (ret != str_length) { - php_handle_aborted_connection(); - } - return ret; -} -/* }}} */ - -/* {{{ sapi_apache_flush - */ -static void sapi_apache_flush(void *server_context) -{ - if (server_context) { -#if MODULE_MAGIC_NUMBER > 19970110 - rflush((request_rec *) server_context); -#else - bflush((request_rec *) server_context->connection->client); -#endif - } -} -/* }}} */ - -/* {{{ sapi_apache_read_post - */ -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - int total_read_bytes=0, read_bytes; - request_rec *r = (request_rec *) SG(server_context); - void (*handler)(int); - - /* - * This handles the situation where the browser sends a Expect: 100-continue header - * and needs to recieve confirmation from the server on whether or not it can send - * the rest of the request. RFC 2616 - * - */ - if (!SG(read_post_bytes) && !ap_should_client_block(r)) { - return total_read_bytes; - } - - handler = signal(SIGPIPE, SIG_IGN); - while (total_read_bytessubprocess_env, "HTTP_COOKIE"); -} -/* }}} */ - -/* {{{ sapi_apache_header_handler - */ -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - request_rec *r = (request_rec *) SG(server_context); - if(!r) { - efree(sapi_header->header); - return 0; - } - - header_name = sapi_header->header; - - header_content = p = strchr(header_name, ':'); - if (!p) { - efree(sapi_header->header); - return 0; - } - - *p = 0; - do { - header_content++; - } while (*header_content==' '); - - if (!strcasecmp(header_name, "Content-Type")) { - r->content_type = pstrdup(r->pool, header_content); - } else if (!strcasecmp(header_name, "Set-Cookie")) { - table_add(r->headers_out, header_name, header_content); - } else if (sapi_header->replace) { - table_set(r->headers_out, header_name, header_content); - } else { - table_add(r->headers_out, header_name, header_content); - } - - *p = ':'; /* a well behaved header handler shouldn't change its original arguments */ - - return SAPI_HEADER_ADD; -} -/* }}} */ - -/* {{{ sapi_apache_send_headers - */ -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - request_rec *r = SG(server_context); - const char *sline = SG(sapi_headers).http_status_line; - int sline_len; - - if(r == NULL) { /* server_context is not here anymore */ - return SAPI_HEADER_SEND_FAILED; - } - - r->status = SG(sapi_headers).http_response_code; - - /* httpd requires that r->status_line is set to the first digit of - * the status-code: */ - if (sline && ((sline_len = strlen(sline)) > 12) && strncmp(sline, "HTTP/1.", 7) == 0 && sline[8] == ' ' && sline[12] == ' ') { - if ((sline_len - 9) > MAX_STATUS_LENGTH) { - r->status_line = ap_pstrndup(r->pool, sline + 9, MAX_STATUS_LENGTH); - } else { - r->status_line = ap_pstrndup(r->pool, sline + 9, sline_len - 9); - } - } - - if(r->status==304) { - send_error_response(r,0); - } else { - send_http_header(r); - } - return SAPI_HEADER_SENT_SUCCESSFULLY; -} -/* }}} */ - -/* {{{ sapi_apache_register_server_variables - */ -static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC) -{ - register int i; - array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env); - table_entry *elts = (table_entry *) arr->elts; - zval **path_translated; - HashTable *symbol_table; - int new_val_len; - - for (i = 0; i < arr->nelts; i++) { - char *val; - int val_len; - - if (elts[i].val) { - val = elts[i].val; - } else { - val = ""; - } - val_len = strlen(val); - if (sapi_module.input_filter(PARSE_SERVER, elts[i].key, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(elts[i].key, val, new_val_len, track_vars_array TSRMLS_CC); - } - } - - /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */ - if (track_vars_array) { - symbol_table = track_vars_array->value.ht; - } else if (PG(register_globals)) { - /* should never happen nowadays */ - symbol_table = EG(active_symbol_table); - } else { - symbol_table = NULL; - } - if (symbol_table - && !zend_hash_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")) - && zend_hash_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated)==SUCCESS) { - php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC); - } - - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &((request_rec *) SG(server_context))->uri, strlen(((request_rec *) SG(server_context))->uri), &new_val_len TSRMLS_CC)) { - php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ php_apache_startup - */ -static int php_apache_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &apache_module_entry, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} -/* }}} */ - -/* {{{ php_apache_log_message - */ -static void php_apache_log_message(char *message) -{ - TSRMLS_FETCH(); - - if (SG(server_context)) { -#if MODULE_MAGIC_NUMBER >= 19970831 - aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, ((request_rec *) SG(server_context))->server, "%s", message); -#else - log_error(message, ((request_rec *) SG(server_context))->server); -#endif - } else { - fprintf(stderr, "%s\n", message); - } -} -/* }}} */ - -/* {{{ php_apache_request_shutdown - */ -static void php_apache_request_shutdown(void *dummy) -{ - TSRMLS_FETCH(); - - php_output_set_status(0 TSRMLS_CC); - if (AP(in_request)) { - AP(in_request) = 0; - php_request_shutdown(dummy); - } - SG(server_context) = NULL; - /* - * The server context (request) is NOT invalid by the time - * run_cleanups() is called - */ -} -/* }}} */ - -/* {{{ php_apache_sapi_activate - */ -static int php_apache_sapi_activate(TSRMLS_D) -{ - request_rec *r = (request_rec *) SG(server_context); - - /* - * For the Apache module version, this bit of code registers a cleanup - * function that gets triggered when our request pool is destroyed. - * We need this because at any point in our code we can be interrupted - * and that may happen before we have had time to free our memory. - * The php_request_shutdown function needs to free all outstanding allocated - * memory. - */ - block_alarms(); - register_cleanup(r->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec); - AP(in_request)=1; - unblock_alarms(); - - /* Override the default headers_only value - sometimes "GET" requests should actually only - * send headers. - */ - SG(request_info).headers_only = r->header_only; - return SUCCESS; -} -/* }}} */ - -/* {{{ php_apache_get_stat - */ -static struct stat *php_apache_get_stat(TSRMLS_D) -{ - return &((request_rec *) SG(server_context))->finfo; -} -/* }}} */ - -/* {{{ php_apache_getenv - */ -static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC) -{ - if (SG(server_context) == NULL) { - return NULL; - } - - return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name); -} -/* }}} */ - -/* {{{ sapi_apache_get_fd - */ -static int sapi_apache_get_fd(int *nfd TSRMLS_DC) -{ -#if PHP_APACHE_HAVE_CLIENT_FD - request_rec *r = SG(server_context); - int fd; - - fd = r->connection->client->fd; - - if (fd >= 0) { - if (nfd) *nfd = fd; - return SUCCESS; - } -#endif - return FAILURE; -} -/* }}} */ - -/* {{{ sapi_apache_force_http_10 - */ -static int sapi_apache_force_http_10(TSRMLS_D) -{ - request_rec *r = SG(server_context); - - r->proto_num = HTTP_VERSION(1,0); - - return SUCCESS; -} -/* }}} */ - -/* {{{ sapi_apache_get_target_uid - */ -static int sapi_apache_get_target_uid(uid_t *obj TSRMLS_DC) -{ - *obj = ap_user_id; - return SUCCESS; -} -/* }}} */ - -/* {{{ sapi_apache_get_target_gid - */ -static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC) -{ - *obj = ap_group_id; - return SUCCESS; -} -/* }}} */ - -/* {{{ php_apache_get_request_time - */ -static time_t php_apache_get_request_time(TSRMLS_D) -{ - return ((request_rec *)SG(server_context))->request_time; -} -/* }}} */ - -/* {{{ sapi_module_struct apache_sapi_module - */ -static sapi_module_struct apache_sapi_module = { - "apache", /* name */ - "Apache", /* pretty name */ - - php_apache_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - php_apache_sapi_activate, /* activate */ - NULL, /* deactivate */ - - sapi_apache_ub_write, /* unbuffered write */ - sapi_apache_flush, /* flush */ - php_apache_get_stat, /* get uid */ - php_apache_getenv, /* getenv */ - - php_error, /* error handler */ - - sapi_apache_header_handler, /* header handler */ - sapi_apache_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_apache_read_post, /* read POST data */ - sapi_apache_read_cookies, /* read Cookies */ - - sapi_apache_register_server_variables, /* register server variables */ - php_apache_log_message, /* Log message */ - php_apache_get_request_time, /* Get request time */ - - NULL, /* php.ini path override */ - -#ifdef PHP_WIN32 - NULL, - NULL, -#else - block_alarms, /* Block interruptions */ - unblock_alarms, /* Unblock interruptions */ -#endif - - NULL, /* default post reader */ - NULL, /* treat data */ - NULL, /* exe location */ - 0, /* ini ignore */ - sapi_apache_get_fd, - sapi_apache_force_http_10, - sapi_apache_get_target_uid, - sapi_apache_get_target_gid -}; -/* }}} */ - -/* {{{ php_restore_umask - */ -static void php_restore_umask(void) -{ - umask(saved_umask); -} -/* }}} */ - -/* {{{ init_request_info - */ -static void init_request_info(TSRMLS_D) -{ - request_rec *r = ((request_rec *) SG(server_context)); - char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); - const char *authorization=NULL; - char *tmp, *tmp_user; - - SG(request_info).query_string = r->args; - SG(request_info).path_translated = r->filename; - SG(request_info).request_uri = r->uri; - SG(request_info).request_method = (char *)r->method; - SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE"); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - SG(sapi_headers).http_response_code = r->status; - SG(request_info).proto_num = r->proto_num; - - if (r->headers_in) { - authorization = table_get(r->headers_in, "Authorization"); - } - - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - SG(request_info).auth_digest = NULL; - - if (authorization && (!PG(safe_mode) || (PG(safe_mode) && !auth_type(r)))) { - char *p = getword(r->pool, &authorization, ' '); - if (!strcasecmp(p, "Basic")) { - tmp = uudecode(r->pool, authorization); - tmp_user = getword_nulls_nc(r->pool, &tmp, ':'); - if (tmp_user) { - r->connection->user = pstrdup(r->connection->pool, tmp_user); - r->connection->ap_auth_type = "Basic"; - SG(request_info).auth_user = estrdup(tmp_user); - } - if (tmp) { - SG(request_info).auth_password = estrdup(tmp); - } - } else if (!strcasecmp(p, "Digest")) { - r->connection->ap_auth_type = "Digest"; - SG(request_info).auth_digest = estrdup(authorization); - } - } -} -/* }}} */ - -/* {{{ php_apache_alter_ini_entries - */ -static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC) -{ - zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, per_dir_entry->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE); - return 0; -} -/* }}} */ - -/* {{{ php_apache_get_default_mimetype - */ -static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) -{ - - char *mimetype; - if (SG(default_mimetype) || SG(default_charset)) { - /* Assume output will be of the default MIME type. Individual - scripts may change this later. */ - char *tmpmimetype; - tmpmimetype = sapi_get_default_content_type(TSRMLS_C); - mimetype = pstrdup(r->pool, tmpmimetype); - efree(tmpmimetype); - } else { - mimetype = SAPI_DEFAULT_MIMETYPE "; charset=" SAPI_DEFAULT_CHARSET; - } - return mimetype; -} -/* }}} */ - -/* {{{ send_php - */ -static int send_php(request_rec *r, int display_source_mode, char *filename) -{ - int retval; - HashTable *per_dir_conf; - TSRMLS_FETCH(); - - if (AP(in_request)) { - zend_file_handle fh; - - fh.filename = r->filename; - fh.opened_path = NULL; - fh.free_filename = 0; - fh.type = ZEND_HANDLE_FILENAME; - -#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) - php_mb_set_zend_encoding(TSRMLS_C); -#endif /* defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) */ - - zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh); - return OK; - } - - SG(server_context) = r; - - zend_first_try { - - /* Make sure file exists */ - if (filename == NULL && r->finfo.st_mode == 0) { - return DECLINED; - } - - per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); - if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - } - - /* If PHP parser engine has been turned off with an "engine off" - * directive, then decline to handle this request - */ - if (!AP(engine)) { - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return DECLINED; - } - if (filename == NULL) { - filename = r->filename; - } - - /* Apache 1.2 has a more complex mechanism for reading POST data */ -#if MODULE_MAGIC_NUMBER > 19961007 - if ((retval = setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return retval; - } -#endif - - if (AP(last_modified)) { -#if MODULE_MAGIC_NUMBER < 19970912 - if ((retval = set_last_modified(r, r->finfo.st_mtime))) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return retval; - } -#else - update_mtime (r, r->finfo.st_mtime); - set_last_modified(r); - set_etag(r); -#endif - } - /* Assume output will be of the default MIME type. Individual - scripts may change this later in the request. */ - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); - - /* Init timeout */ - hard_timeout("send", r); - - php_save_umask(); - add_common_vars(r); - add_cgi_vars(r); - - init_request_info(TSRMLS_C); - apache_php_module_main(r, display_source_mode TSRMLS_CC); - - /* Done, restore umask, turn off timeout, close file and return */ - php_restore_umask(); - kill_timeout(r); - } zend_end_try(); - - return OK; -} -/* }}} */ - -/* {{{ send_parsed_php - */ -static int send_parsed_php(request_rec * r) -{ - int result = send_php(r, 0, NULL); - TSRMLS_FETCH(); - - ap_table_setn(r->notes, "mod_php_memory_usage", - ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC))); - - return result; -} -/* }}} */ - -/* {{{ send_parsed_php_source - */ -static int send_parsed_php_source(request_rec * r) -{ - return send_php(r, 1, NULL); -} -/* }}} */ - -/* {{{ destroy_per_dir_entry - */ -static void destroy_per_dir_entry(php_per_dir_entry *per_dir_entry) -{ - free(per_dir_entry->key); - free(per_dir_entry->value); -} -/* }}} */ - -/* {{{ copy_per_dir_entry - */ -static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry) -{ - php_per_dir_entry tmp = *per_dir_entry; - - per_dir_entry->key = (char *) malloc(tmp.key_length+1); - memcpy(per_dir_entry->key, tmp.key, tmp.key_length); - per_dir_entry->key[per_dir_entry->key_length] = 0; - - per_dir_entry->value = (char *) malloc(tmp.value_length+1); - memcpy(per_dir_entry->value, tmp.value, tmp.value_length); - per_dir_entry->value[per_dir_entry->value_length] = 0; -} -/* }}} */ - -/* {{{ should_overwrite_per_dir_entry - */ -static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_dir_entry *new_per_dir_entry, zend_hash_key *hash_key, void *pData) -{ - php_per_dir_entry *orig_per_dir_entry; - - if (zend_hash_find(target_ht, hash_key->arKey, hash_key->nKeyLength, (void **) &orig_per_dir_entry)==FAILURE) { - return 1; /* does not exist in dest, copy from source */ - } - - if (orig_per_dir_entry->type==PHP_INI_SYSTEM - && new_per_dir_entry->type!=PHP_INI_SYSTEM) { - return 0; - } else { - return 1; - } -} -/* }}} */ - -/* {{{ php_destroy_per_dir_info - */ -static void php_destroy_per_dir_info(HashTable *per_dir_info) -{ - zend_hash_destroy(per_dir_info); - free(per_dir_info); -} -/* }}} */ - -/* {{{ php_create_dir - */ -static void *php_create_dir(pool *p, char *dummy) -{ - HashTable *per_dir_info; - - per_dir_info = (HashTable *) malloc(sizeof(HashTable)); - zend_hash_init_ex(per_dir_info, 5, NULL, (void (*)(void *)) destroy_per_dir_entry, 1, 0); - register_cleanup(p, (void *) per_dir_info, (void (*)(void *)) php_destroy_per_dir_info, (void (*)(void *)) zend_hash_destroy); - - return per_dir_info; -} -/* }}} */ - -/* {{{ php_merge_dir - */ -static void *php_merge_dir(pool *p, void *basev, void *addv) -{ - /* This function *must* not modify addv or basev */ - HashTable *new; - - /* need a copy of addv to merge */ - new = php_create_dir(p, "php_merge_dir"); - zend_hash_copy(new, (HashTable *) basev, (copy_ctor_func_t) copy_per_dir_entry, NULL, sizeof(php_per_dir_entry)); - - zend_hash_merge_ex(new, (HashTable *) addv, (copy_ctor_func_t) copy_per_dir_entry, sizeof(php_per_dir_entry), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL); - return new; -} -/* }}} */ - -/* {{{ php_apache_value_handler_ex - */ -static CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) -{ - php_per_dir_entry per_dir_entry; - - if (!apache_php_initialized) { - apache_php_initialized = 1; -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache_sapi_module); - php_apache_startup(&apache_sapi_module); - } - per_dir_entry.type = mode; - per_dir_entry.htaccess = ((cmd->override & (RSRC_CONF|ACCESS_CONF)) == 0); - - if (strcasecmp(arg2, "none") == 0) { - arg2 = ""; - } - - per_dir_entry.key_length = strlen(arg1); - per_dir_entry.value_length = strlen(arg2); - - per_dir_entry.key = (char *) malloc(per_dir_entry.key_length+1); - memcpy(per_dir_entry.key, arg1, per_dir_entry.key_length); - per_dir_entry.key[per_dir_entry.key_length] = 0; - - per_dir_entry.value = (char *) malloc(per_dir_entry.value_length+1); - memcpy(per_dir_entry.value, arg2, per_dir_entry.value_length); - per_dir_entry.value[per_dir_entry.value_length] = 0; - - zend_hash_update(conf, per_dir_entry.key, per_dir_entry.key_length, &per_dir_entry, sizeof(php_per_dir_entry), NULL); - return NULL; -} -/* }}} */ - -/* {{{ php_apache_value_handler - */ -static CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) -{ - return php_apache_value_handler_ex(cmd, conf, arg1, arg2, PHP_INI_PERDIR); -} -/* }}} */ - -/* {{{ php_apache_admin_value_handler - */ -static CONST_PREFIX char *php_apache_admin_value_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) -{ - return php_apache_value_handler_ex(cmd, conf, arg1, arg2, PHP_INI_SYSTEM); -} -/* }}} */ - -/* {{{ php_apache_flag_handler_ex - */ -static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) -{ - char bool_val[2]; - - if (!strcasecmp(arg2, "On") || (arg2[0] == '1' && arg2[1] == '\0')) { - bool_val[0] = '1'; - } else { - bool_val[0] = '0'; - } - bool_val[1] = 0; - - return php_apache_value_handler_ex(cmd, conf, arg1, bool_val, mode); -} -/* }}} */ - -/* {{{ php_apache_flag_handler - */ -static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) -{ - return php_apache_flag_handler_ex(cmd, conf, arg1, arg2, PHP_INI_PERDIR); -} -/* }}} */ - -/* {{{ php_apache_admin_flag_handler - */ -static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2) -{ - return php_apache_flag_handler_ex(cmd, conf, arg1, arg2, PHP_INI_SYSTEM); -} -/* }}} */ - -/* {{{ php_apache_phpini_set - */ -static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf, char *arg) -{ - if (apache_sapi_module.php_ini_path_override) { - return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; - } - apache_sapi_module.php_ini_path_override = ap_server_root_relative(cmd->pool, arg); - return NULL; -} -/* }}} */ - -/* {{{ int php_xbithack_handler(request_rec * r) - */ -static int php_xbithack_handler(request_rec * r) -{ - HashTable *per_dir_conf; - TSRMLS_FETCH(); - - if (!(r->finfo.st_mode & S_IXUSR)) { - return DECLINED; - } - per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); - if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - } - if(!AP(xbithack)) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return DECLINED; - } - return send_parsed_php(r); -} -/* }}} */ - -/* {{{ apache_php_module_shutdown_wrapper - */ -static void apache_php_module_shutdown_wrapper(void) -{ - apache_php_initialized = 0; - apache_sapi_module.shutdown(&apache_sapi_module); - -#if MODULE_MAGIC_NUMBER >= 19970728 - /* This function is only called on server exit if the apache API - * child_exit handler exists, so shutdown globally - */ - sapi_shutdown(); -#endif - -#ifdef ZTS - tsrm_shutdown(); -#endif -} -/* }}} */ - -#if MODULE_MAGIC_NUMBER >= 19970728 -/* {{{ php_child_exit_handler - */ -static void php_child_exit_handler(server_rec *s, pool *p) -{ -/* apache_php_initialized = 0; */ - apache_sapi_module.shutdown(&apache_sapi_module); - -#ifdef ZTS - tsrm_shutdown(); -#endif -} -/* }}} */ -#endif - -/* {{{ void php_init_handler(server_rec *s, pool *p) - */ -static void php_init_handler(server_rec *s, pool *p) -{ - register_cleanup(p, NULL, (void (*)(void *))apache_php_module_shutdown_wrapper, (void (*)(void *))php_module_shutdown_for_exec); - if (!apache_php_initialized) { - apache_php_initialized = 1; -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache_sapi_module); - php_apache_startup(&apache_sapi_module); - } -#if MODULE_MAGIC_NUMBER >= 19980527 - { - TSRMLS_FETCH(); - if (PG(expose_php)) { - ap_add_version_component("PHP/" PHP_VERSION); - } - } -#endif -} -/* }}} */ - -/* {{{ handler_rec php_handlers[] - */ -handler_rec php_handlers[] = -{ - {"application/x-httpd-php", send_parsed_php}, - {"application/x-httpd-php-source", send_parsed_php_source}, - {"text/html", php_xbithack_handler}, - {NULL} -}; -/* }}} */ - -/* {{{ command_rec php_commands[] - */ -command_rec php_commands[] = -{ - {"php_value", php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"}, - {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, - {"php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"}, - {"php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"}, - {"PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, TAKE1, "Directory containing the php.ini file"}, - {NULL} -}; -/* }}} */ - -/* {{{ odule MODULE_VAR_EXPORT php5_module - */ -module MODULE_VAR_EXPORT php5_module = -{ - STANDARD_MODULE_STUFF, - php_init_handler, /* initializer */ - php_create_dir, /* per-directory config creator */ - php_merge_dir, /* dir merger */ - NULL, /* per-server config creator */ - NULL, /* merge server config */ - php_commands, /* command table */ - php_handlers, /* handlers */ - NULL, /* filename translation */ - NULL, /* check_user_id */ - NULL, /* check auth */ - NULL, /* check access */ - NULL, /* type_checker */ - NULL, /* fixups */ - NULL /* logger */ -#if MODULE_MAGIC_NUMBER >= 19970103 - , NULL /* header parser */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970719 - , NULL /* child_init */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970728 - , php_child_exit_handler /* child_exit */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970902 - , NULL /* post read-request */ -#endif -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache/mod_php5.exp b/sapi/apache/mod_php5.exp deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache/mod_php5.exp +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache/mod_php5.h b/sapi/apache/mod_php5.h deleted file mode 100644 index 1daa476c7e935..0000000000000 --- a/sapi/apache/mod_php5.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Rasmus Lerdorf | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef MOD_PHP5_H -#define MOD_PHP5_H - -#if !defined(WIN32) && !defined(WINNT) -#ifndef MODULE_VAR_EXPORT -#define MODULE_VAR_EXPORT -#endif -#endif - -typedef struct { - long engine; - long last_modified; - long xbithack; - long terminate_child; - zend_bool in_request; -} php_apache_info_struct; - -extern zend_module_entry apache_module_entry; - -#ifdef ZTS -extern int php_apache_info_id; -#define AP(v) TSRMG(php_apache_info_id, php_apache_info_struct *, v) -#else -extern php_apache_info_struct php_apache_info; -#define AP(v) (php_apache_info.v) -#endif - -#endif /* MOD_PHP5_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/sapi/apache/php.sym b/sapi/apache/php.sym deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache/php.sym +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache/php5apache.dsp b/sapi/apache/php5apache.dsp deleted file mode 100644 index fbdb7612b8691..0000000000000 --- a/sapi/apache/php5apache.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5apache" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5apache - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5apache.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5apache.mak" CFG="php5apache - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5apache - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5apache - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\includes" /I "..\..\main" /I "..\..\TSRM" /I "..\..\regex" /I "C:\Program Files\Apache Group\Apache\include" /D ZEND_DEBUG=0 /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\release" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" /libpath:"C:\Program Files\Apache Group\Apache\libexec" - -!ELSEIF "$(CFG)" == "php5apache - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\includes" /I "..\..\main" /I "..\..\TSRM" /I "..\..\regex" /I "C:\Program Files\Apache Group\Apache\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /incremental:yes /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php_build\release" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" /libpath:"C:\Program Files\Apache Group\Apache\libexec" - -!ELSEIF "$(CFG)" == "php5apache - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_inline" -# PROP BASE Intermediate_Dir "Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\includes" /I "..\..\main" /I "..\..\TSRM" /I "..\..\regex" /I "C:\Program Files\Apache Group\Apache\include" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\release" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" /libpath:"C:\Program Files\Apache Group\Apache\libexec" - -!ENDIF - -# Begin Target - -# Name "php5apache - Win32 Release_TS" -# Name "php5apache - Win32 Debug_TS" -# Name "php5apache - Win32 Release_TS_inline" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\mod_php5.c -# End Source File -# Begin Source File - -SOURCE=.\php_apache.c -# End Source File -# Begin Source File - -SOURCE=.\sapi_apache.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\mod_php5.h -# End Source File -# Begin Source File - -SOURCE=.\php_apache_http.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c deleted file mode 100644 index 78ea925f7920c..0000000000000 --- a/sapi/apache/php_apache.c +++ /dev/null @@ -1,568 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Stig Sæther Bakken | - | David Sklar | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -#if defined(PHP_WIN32) || defined(NETWARE) -#include "zend.h" -#include "ap_compat.h" -#endif - -#ifdef ZTS -int php_apache_info_id; -#else -php_apache_info_struct php_apache_info; -#endif - -#define SECTION(name) PUTS("

" name "

\n") - -#ifndef PHP_WIN32 -extern module *top_module; -extern module **ap_loaded_modules; -#else -extern __declspec(dllimport) module *top_module; -extern __declspec(dllimport) module **ap_loaded_modules; -#endif - -PHP_FUNCTION(virtual); -PHP_FUNCTION(apache_request_headers); -PHP_FUNCTION(apache_response_headers); -PHP_FUNCTION(apachelog); -PHP_FUNCTION(apache_note); -PHP_FUNCTION(apache_lookup_uri); -PHP_FUNCTION(apache_child_terminate); -PHP_FUNCTION(apache_setenv); -PHP_FUNCTION(apache_get_version); -PHP_FUNCTION(apache_get_modules); -PHP_FUNCTION(apache_reset_timeout); - -PHP_MINFO_FUNCTION(apache); - -zend_function_entry apache_functions[] = { - PHP_FE(virtual, NULL) - PHP_FE(apache_request_headers, NULL) - PHP_FE(apache_note, NULL) - PHP_FE(apache_lookup_uri, NULL) - PHP_FE(apache_child_terminate, NULL) - PHP_FE(apache_setenv, NULL) - PHP_FE(apache_response_headers, NULL) - PHP_FE(apache_get_version, NULL) - PHP_FE(apache_get_modules, NULL) - PHP_FE(apache_reset_timeout, NULL) - PHP_FALIAS(getallheaders, apache_request_headers, NULL) - {NULL, NULL, NULL} -}; - - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateLong, xbithack, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateLong, engine, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateLong, last_modified, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("child_terminate", "0", PHP_INI_ALL, OnUpdateLong, terminate_child, php_apache_info_struct, php_apache_info) -PHP_INI_END() - - - -static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC) -{ - apache_globals->in_request = 0; -} - - -static PHP_MINIT_FUNCTION(apache) -{ -#ifdef ZTS - ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL); -#else - php_apache_globals_ctor(&php_apache_info TSRMLS_CC); -#endif - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - - -static PHP_MSHUTDOWN_FUNCTION(apache) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -zend_module_entry apache_module_entry = { - STANDARD_MODULE_HEADER, - "apache", - apache_functions, - PHP_MINIT(apache), - PHP_MSHUTDOWN(apache), - NULL, - NULL, - PHP_MINFO(apache), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -/* {{{ proto bool apache_child_terminate(void) - Terminate apache process after this request */ -PHP_FUNCTION(apache_child_terminate) -{ -#ifndef MULTITHREAD - if (AP(terminate_child)) { - ap_child_terminate( ((request_rec *)SG(server_context)) ); - RETURN_TRUE; - } else { /* tell them to get lost! */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is disabled"); - RETURN_FALSE; - } -#else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not supported in this build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto string apache_note(string note_name [, string note_value]) - Get and set Apache request notes */ -PHP_FUNCTION(apache_note) -{ - zval **arg_name, **arg_val; - char *note_val; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, &arg_name, &arg_val) ==FAILURE ) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg_name); - note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val); - - if (arg_count == 2) { - convert_to_string_ex(arg_val); - table_set(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val, (*arg_val)->value.str.val); - } - - if (note_val) { - RETURN_STRING(note_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(apache) -{ - char *apv = (char *) ap_get_server_version(); - module *modp = NULL; - char output_buf[128]; -#if !defined(WIN32) && !defined(WINNT) - char name[64]; - char modulenames[1024]; - char *p; -#endif - server_rec *serv; - extern char server_root[MAX_STRING_LEN]; - extern uid_t user_id; - extern char *user_name; - extern gid_t group_id; - extern int max_requests_per_child; - - serv = ((request_rec *) SG(server_context))->server; - - - php_info_print_table_start(); - -#ifdef PHP_WIN32 - php_info_print_table_row(1, "Apache for Windows 95/NT"); - php_info_print_table_end(); - php_info_print_table_start(); -#elif defined(NETWARE) - php_info_print_table_row(1, "Apache for NetWare"); - php_info_print_table_end(); - php_info_print_table_start(); -#else - php_info_print_table_row(2, "APACHE_INCLUDE", PHP_APACHE_INCLUDE); - php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET); -#endif - - if (apv && *apv) { - php_info_print_table_row(2, "Apache Version", apv); - } - -#ifdef APACHE_RELEASE - snprintf(output_buf, sizeof(output_buf), "%d", APACHE_RELEASE); - php_info_print_table_row(2, "Apache Release", output_buf); -#endif - snprintf(output_buf, sizeof(output_buf), "%d", MODULE_MAGIC_NUMBER); - php_info_print_table_row(2, "Apache API Version", output_buf); - snprintf(output_buf, sizeof(output_buf), "%s:%u", serv->server_hostname, serv->port); - php_info_print_table_row(2, "Hostname:Port", output_buf); -#if !defined(WIN32) && !defined(WINNT) - snprintf(output_buf, sizeof(output_buf), "%s(%d)/%d", user_name, (int)user_id, (int)group_id); - php_info_print_table_row(2, "User/Group", output_buf); - snprintf(output_buf, sizeof(output_buf), "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests_per_child, serv->keep_alive ? "on":"off", serv->keep_alive_max); - php_info_print_table_row(2, "Max Requests", output_buf); -#endif - snprintf(output_buf, sizeof(output_buf), "Connection: %d - Keep-Alive: %d", serv->timeout, serv->keep_alive_timeout); - php_info_print_table_row(2, "Timeouts", output_buf); -#if !defined(WIN32) && !defined(WINNT) -/* - This block seems to be working on NetWare; But it seems to be showing - all modules instead of just the loaded ones -*/ - php_info_print_table_row(2, "Server Root", server_root); - - strcpy(modulenames, ""); - for(modp = top_module; modp; modp = modp->next) { - strlcpy(name, modp->name, sizeof(name)); - if ((p = strrchr(name, '.'))) { - *p='\0'; /* Cut off ugly .c extensions on module names */ - } - strlcat(modulenames, name, sizeof(modulenames)); - if (modp->next) { - strlcat(modulenames, ", ", sizeof(modulenames)); - } - } - php_info_print_table_row(2, "Loaded Modules", modulenames); -#endif - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - - { - register int i; - array_header *arr; - table_entry *elts; - request_rec *r; - - r = ((request_rec *) SG(server_context)); - arr = table_elts(r->subprocess_env); - elts = (table_entry *)arr->elts; - - SECTION("Apache Environment"); - php_info_print_table_start(); - php_info_print_table_header(2, "Variable", "Value"); - for (i=0; i < arr->nelts; i++) { - php_info_print_table_row(2, elts[i].key, elts[i].val); - } - php_info_print_table_end(); - } - - { - array_header *env_arr; - table_entry *env; - int i; - request_rec *r; - - r = ((request_rec *) SG(server_context)); - SECTION("HTTP Headers Information"); - php_info_print_table_start(); - php_info_print_table_colspan_header(2, "HTTP Request Headers"); - php_info_print_table_row(2, "HTTP Request", r->the_request); - env_arr = table_elts(r->headers_in); - env = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (env[i].key && (!PG(safe_mode) || (PG(safe_mode) && strncasecmp(env[i].key, "authorization", 13)))) { - php_info_print_table_row(2, env[i].key, env[i].val); - } - } - php_info_print_table_colspan_header(2, "HTTP Response Headers"); - env_arr = table_elts(r->headers_out); - env = (table_entry *)env_arr->elts; - for(i = 0; i < env_arr->nelts; ++i) { - if (env[i].key) { - php_info_print_table_row(2, env[i].key, env[i].val); - } - } - php_info_print_table_end(); - } -} -/* }}} */ - -/* {{{ proto bool virtual(string filename) - Perform an Apache sub-request */ -/* This function is equivalent to - * in mod_include. It does an Apache sub-request. It is useful - * for including CGI scripts or .shtml files, or anything else - * that you'd parse through Apache (for .phtml files, you'd probably - * want to use . This only works when PHP is compiled - * as an Apache module, since it uses the Apache API for doing - * sub requests. - */ -PHP_FUNCTION(virtual) -{ - zval **filename; - request_rec *rr = NULL; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } - - if (rr->status != 200) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } - - php_end_ob_buffers(1 TSRMLS_CC); - php_header(TSRMLS_C); - - if (run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } else { - if (rr) destroy_sub_req (rr); - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto array getallheaders(void) - Alias for apache_request_headers() */ -/* }}} */ -/* {{{ proto array apache_request_headers(void) - Fetch all HTTP request headers */ -PHP_FUNCTION(apache_request_headers) -{ - array_header *env_arr; - table_entry *tenv; - int i; - - array_init(return_value); - env_arr = table_elts(((request_rec *) SG(server_context))->headers_in); - tenv = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (!tenv[i].key || - (PG(safe_mode) && - !strncasecmp(tenv[i].key, "authorization", 13))) { - continue; - } - if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) { - RETURN_FALSE; - } - } -} -/* }}} */ - -/* {{{ proto array apache_response_headers(void) - Fetch all HTTP response headers */ -PHP_FUNCTION(apache_response_headers) -{ - array_header *env_arr; - table_entry *tenv; - int i; - - array_init(return_value); - env_arr = table_elts(((request_rec *) SG(server_context))->headers_out); - tenv = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (!tenv[i].key) continue; - if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) { - RETURN_FALSE; - } - } -} -/* }}} */ - -/* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top]) - Set an Apache subprocess_env variable */ -PHP_FUNCTION(apache_setenv) -{ - int var_len, val_len; - zend_bool top=0; - char *var = NULL, *val = NULL; - request_rec *r = (request_rec *) SG(server_context); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) { - RETURN_FALSE; - } - - while(top) { - if(r->prev) r = r->prev; - else break; - } - - ap_table_setn(r->subprocess_env, ap_pstrndup(r->pool, var, var_len), ap_pstrndup(r->pool, val, val_len)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto object apache_lookup_uri(string URI) - Perform a partial request of the given URI to obtain information about it */ -PHP_FUNCTION(apache_lookup_uri) -{ - zval **filename; - request_rec *rr=NULL; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if(!(rr = sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed '%s'", (*filename)->value.str.val); - RETURN_FALSE; - } - object_init(return_value); - add_property_long(return_value,"status", rr->status); - if (rr->the_request) { - add_property_string(return_value,"the_request", rr->the_request, 1); - } - if (rr->status_line) { - add_property_string(return_value,"status_line", (char *)rr->status_line, 1); - } - if (rr->method) { - add_property_string(return_value,"method", (char *)rr->method, 1); - } - if (rr->content_type) { - add_property_string(return_value,"content_type", (char *)rr->content_type, 1); - } - if (rr->handler) { - add_property_string(return_value,"handler", (char *)rr->handler, 1); - } - if (rr->uri) { - add_property_string(return_value,"uri", rr->uri, 1); - } - if (rr->filename) { - add_property_string(return_value,"filename", rr->filename, 1); - } - if (rr->path_info) { - add_property_string(return_value,"path_info", rr->path_info, 1); - } - if (rr->args) { - add_property_string(return_value,"args", rr->args, 1); - } - if (rr->boundary) { - add_property_string(return_value,"boundary", rr->boundary, 1); - } - add_property_long(return_value,"no_cache", rr->no_cache); - add_property_long(return_value,"no_local_copy", rr->no_local_copy); - add_property_long(return_value,"allowed", rr->allowed); - add_property_long(return_value,"sent_bodyct", rr->sent_bodyct); - add_property_long(return_value,"bytes_sent", rr->bytes_sent); - add_property_long(return_value,"byterange", rr->byterange); - add_property_long(return_value,"clength", rr->clength); - -#if MODULE_MAGIC_NUMBER >= 19980324 - if (rr->unparsed_uri) { - add_property_string(return_value,"unparsed_uri", rr->unparsed_uri, 1); - } - if(rr->mtime) { - add_property_long(return_value,"mtime", rr->mtime); - } -#endif - if(rr->request_time) { - add_property_long(return_value,"request_time", rr->request_time); - } - - destroy_sub_req(rr); -} -/* }}} */ - - -#if 0 -This function is most likely a bad idea. Just playing with it for now. - -PHP_FUNCTION(apache_exec_uri) -{ - zval **filename; - request_rec *rr=NULL; - TSRMLS_FETCH(); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed", (*filename)->value.str.val); - RETURN_FALSE; - } - RETVAL_LONG(ap_run_sub_req(rr)); - ap_destroy_sub_req(rr); -} -#endif - -/* {{{ proto string apache_get_version(void) - Fetch Apache version */ -PHP_FUNCTION(apache_get_version) -{ - char *apv = (char *) ap_get_server_version(); - - if (apv && *apv) { - RETURN_STRING(apv, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array apache_get_modules(void) - Get a list of loaded Apache modules */ -PHP_FUNCTION(apache_get_modules) -{ - int n; - char *p; - - array_init(return_value); - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - add_next_index_stringl(return_value, s, (p - s), 1); - } else { - add_next_index_string(return_value, s, 1); - } - } -} -/* }}} */ - -/* {{{ proto bool apache_reset_timeout(void) - Reset the Apache write timer */ -PHP_FUNCTION(apache_reset_timeout) -{ - if (PG(safe_mode)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot reset the Apache timeout in safe mode"); - RETURN_FALSE; - } - - ap_reset_timeout((request_rec *)SG(server_context)); - RETURN_TRUE; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache/php_apache_http.h b/sapi/apache/php_apache_http.h deleted file mode 100644 index 9d79c6d57a6e8..0000000000000 --- a/sapi/apache/php_apache_http.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Stig Sæther Bakken | - | David Sklar | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define NO_REGEX_EXTRA_H - -#ifdef WIN32 -#include -#endif - -#ifdef NETWARE -#include -#endif - -#include "zend.h" -#include "php_regex.h" -#include "php_compat.h" - -#ifdef HAVE_OPENSSL_EXT -/* zlib typedefs free_func which causes problems if the SSL includes happen - * after zlib.h is included */ -# include -#endif - -#ifdef regex_t -#undef regex_t -#endif - -#include "httpd.h" -#include "http_config.h" - -#if MODULE_MAGIC_NUMBER > 19980712 -# include "ap_compat.h" -#else -# if MODULE_MAGIC_NUMBER > 19980324 -# include "compat.h" -# endif -#endif - -#include "http_core.h" -#include "http_main.h" -#include "http_protocol.h" -#include "http_request.h" -#include "http_log.h" -#include "util_script.h" - -#include "php_variables.h" -#include "php_main.h" -#include "php_ini.h" -#include "ext/standard/php_standard.h" - -#include "mod_php5.h" diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c deleted file mode 100644 index 3406e47ca5506..0000000000000 --- a/sapi/apache/sapi_apache.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | (with helpful hints from Dean Gaudet | - | PHP 4.0 patches by: | - | Zeev Suraski | - | Stig Bakken | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -/* {{{ apache_php_module_main - */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) -{ - int retval = OK; - zend_file_handle file_handle; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return FAILURE; - } - /* sending a file handle to another dll is not working - so let zend open it. */ - - if (display_source_mode) { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - php_get_highlight_struct(&syntax_highlighter_ini); - if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC) != SUCCESS) { - retval = NOT_FOUND; - } - } else { - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.handle.fd = 0; - file_handle.filename = SG(request_info).path_translated; - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - - (void) php_execute_script(&file_handle TSRMLS_CC); - } - - AP(in_request) = 0; - - zend_try { - php_request_shutdown(NULL); - } zend_end_try(); - - return retval; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2filter/CREDITS b/sapi/apache2filter/CREDITS deleted file mode 100644 index c298a9bf6a8a2..0000000000000 --- a/sapi/apache2filter/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Apache 2.0 Filter -Sascha Schumann, Aaron Bannert diff --git a/sapi/apache2filter/EXPERIMENTAL b/sapi/apache2filter/EXPERIMENTAL deleted file mode 100644 index 293159a693dec..0000000000000 --- a/sapi/apache2filter/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this module is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/sapi/apache2filter/README b/sapi/apache2filter/README deleted file mode 100644 index 3054e208d3466..0000000000000 --- a/sapi/apache2filter/README +++ /dev/null @@ -1,71 +0,0 @@ -WHAT IS THIS? - - This module exploits the layered I/O support in Apache 2.0. - -HOW DOES IT WORK? - - In Apache 2.0, you have handlers which generate content (like - reading a script from disk). The content goes then through - a chain of filters. PHP can be such a filter, so that it processes - your script and hands the output to the next filter (which will - usually cause a write to the network). - -DOES IT WORK? - - It is experimental as interfaces in Apache 2.0 might change in the - future. - -HOW TO INSTALL - - This SAPI module is known to work with Apache 2.0.40. - - $ cd apache-2.x - $ cd src - $ ./configure --enable-so - $ make install - - For testing purposes, you might want to use --with-mpm=prefork. - (Albeit PHP also works with threaded MPMs.) - - Configure PHP 4: - - $ cd php-4.x - $ ./configure --with-apxs2=/path/to/apache-2.0/bin/apxs - $ make install - - At the end of conf/httpd.conf, add: - - AddType application/x-httpd-php .php - - If you would like to enable source code highlighting functionality add: - - AddType application/x-httpd-php-source .phps - - That's it. Now start bin/httpd. - -HOW TO CONFIGURE - - The Apache 2.0 PHP module supports a new configuration directive that - allows an admin to override the php.ini search path. For example, - place your php.ini file in Apache's ServerRoot/conf directory and - add this to your httpd.conf file: - - PHPINIDir "conf" - -DEBUGGING APACHE AND PHP - - To debug Apache, we recommened: - - 1. Use the Prefork MPM (Apache 1.3-like process model) by - configuring Apache with '--with-mpm=prefork'. - 2. Start httpd using -DONE_PROCESS (e.g. (gdb) r -DONE_PROCESS). - - If you want to debug a part of the PHP startup procedure, set a - breakpoint on 'load_module'. Step through it until apr_dso_load() is - done. Then you can set a breakpoint on any PHP-related symbol. - -TODO - - PHP functions like apache_sub_req (see php_functions.c) - Protocol handlers - Passing script data to engine without temporary file diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c deleted file mode 100644 index c629dbf48edb2..0000000000000 --- a/sapi/apache2filter/apache_config.c +++ /dev/null @@ -1,218 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_ini.h" -#include "php_apache.h" - -#include "apr_strings.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" - -#ifdef PHP_AP_DEBUG -#define phpapdebug(a) fprintf a -#else -#define phpapdebug(a) -#endif - -typedef struct { - HashTable config; -} php_conf_rec; - -typedef struct { - char *value; - size_t value_len; - char status; - char htaccess; -} php_dir_entry; - -static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, const char *value, int status) -{ - php_conf_rec *d = dummy; - php_dir_entry e; - - phpapdebug((stderr, "Getting %s=%s for %p (%d)\n", name, value, dummy, zend_hash_num_elements(&d->config))); - - if (!strncasecmp(value, "none", sizeof("none"))) { - value = ""; - } - - e.value = apr_pstrdup(cmd->pool, value); - e.value_len = strlen(value); - e.status = status; - e.htaccess = ((cmd->override & (RSRC_CONF|ACCESS_CONF)) == 0); - - zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, sizeof(e), NULL); - return NULL; -} - -static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_value_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); -} - -static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_value_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); -} - -static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, const char *arg2, int status) -{ - char bool_val[2]; - - if (!strcasecmp(arg2, "On") || (arg2[0] == '1' && arg2[1] == '\0')) { - bool_val[0] = '1'; - } else { - bool_val[0] = '0'; - } - bool_val[1] = 0; - - return real_value_hnd(cmd, dummy, arg1, bool_val, status); -} - -static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_flag_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); -} - -static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_flag_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); -} - -static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg) -{ - if (apache2_php_ini_path_override) { - return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; - } - apache2_php_ini_path_override = ap_server_root_relative(cmd->pool, arg); - return NULL; -} - - -void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf) -{ - php_conf_rec *d = base_conf, *e = new_conf, *n = NULL; - php_dir_entry *pe; - php_dir_entry *data; - char *str; - uint str_len; - ulong num_index; - - n = create_php_config(p, "merge_php_config"); - zend_hash_copy(&n->config, &e->config, NULL, NULL, sizeof(php_dir_entry)); - - phpapdebug((stderr, "Merge dir (%p)+(%p)=(%p)\n", base_conf, new_conf, n)); - for (zend_hash_internal_pointer_reset(&d->config); - zend_hash_get_current_key_ex(&d->config, &str, &str_len, - &num_index, 0, NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(&d->config)) { - pe = NULL; - zend_hash_get_current_data(&d->config, (void **) &data); - if (zend_hash_find(&n->config, str, str_len, (void **) &pe) == SUCCESS) { - if (pe->status >= data->status) continue; - } - zend_hash_update(&n->config, str, str_len, data, sizeof(*data), NULL); - phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1)); - } - - return n; -} - -char *get_php_config(void *conf, char *name, size_t name_len) -{ - php_conf_rec *d = conf; - php_dir_entry *pe; - - if (zend_hash_find(&d->config, name, name_len, (void **) &pe) == SUCCESS) { - return pe->value; - } - - return ""; -} - -void apply_config(void *dummy) -{ - php_conf_rec *d = dummy; - char *str; - uint str_len; - php_dir_entry *data; - - for (zend_hash_internal_pointer_reset(&d->config); - zend_hash_get_current_key_ex(&d->config, &str, &str_len, NULL, 0, - NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(&d->config)) { - zend_hash_get_current_data(&d->config, (void **) &data); - phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value)); - if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) { - phpapdebug((stderr, "..FAILED\n")); - } - } -} - -const command_rec php_dir_cmds[] = -{ - AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS, "PHP Value Modifier"), - AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, "PHP Flag Modifier"), - AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"), - AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"), - AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, "Directory containing the php.ini file"), - {NULL} -}; - -static apr_status_t destroy_php_config(void *data) -{ - php_conf_rec *d = data; - - phpapdebug((stderr, "Destroying config %p\n", data)); - zend_hash_destroy(&d->config); - - return APR_SUCCESS; -} - -void *create_php_config(apr_pool_t *p, char *dummy) -{ - php_conf_rec *newx = (php_conf_rec *) apr_pcalloc(p, sizeof(*newx)); - - phpapdebug((stderr, "Creating new config (%p) for %s\n", newx, dummy)); - zend_hash_init(&newx->config, 0, NULL, NULL, 1); - apr_pool_cleanup_register(p, newx, destroy_php_config, apr_pool_cleanup_null); - return (void *) newx; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4 deleted file mode 100644 index 148799ca617f7..0000000000000 --- a/sapi/apache2filter/config.m4 +++ /dev/null @@ -1,132 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(apxs2filter,, -[ --with-apxs2filter[=FILE] - EXPERIMENTAL: Build shared Apache 2.0 Filter module. FILE is the optional - pathname to the Apache apxs tool [apxs]], no, no) - -AC_MSG_CHECKING([for Apache 2.0 filter-module support via DSO through APXS]) - -if test "$PHP_APXS2FILTER" != "no"; then - if test "$PHP_APXS2FILTER" = "yes"; then - APXS=apxs - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0" && test -x /usr/sbin/apxs; then - APXS=/usr/sbin/apxs - fi - else - PHP_EXPAND_PATH($PHP_APXS2FILTER, APXS) - fi - - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0"; then - AC_MSG_RESULT() - AC_MSG_RESULT() - AC_MSG_RESULT([Sorry, I cannot run apxs. Possible reasons follow:]) - AC_MSG_RESULT() - AC_MSG_RESULT([1. Perl is not installed]) - AC_MSG_RESULT([2. apxs was not found. Try to pass the path using --with-apxs2filter=/path/to/apxs]) - AC_MSG_RESULT([3. Apache was not built using --enable-so (the apxs usage page is displayed)]) - AC_MSG_RESULT() - AC_MSG_RESULT([The output of $APXS follows:]) - $APXS -q CFLAGS - AC_MSG_ERROR([Aborting]) - fi - - APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` - APXS_BINDIR=`$APXS -q BINDIR` - APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` - APXS_CFLAGS=`$APXS -q CFLAGS` - APXS_MPM=`$APXS -q MPM_NAME` - APU_BINDIR=`$APXS -q APU_BINDIR` - APR_BINDIR=`$APXS -q APR_BINDIR` - - # Pick up ap[ru]-N-config if using httpd >=2.1 - APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null || - echo $APR_BINDIR/apr-config` - APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null || - echo $APU_BINDIR/apu-config` - - APR_CFLAGS="`$APR_CONFIG --cppflags --includes`" - APU_CFLAGS="`$APU_CONFIG --includes`" - - for flag in $APXS_CFLAGS; do - case $flag in - -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";; - esac - done - - APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS" - - # Test that we're trying to configure with apache 2.x - PHP_AP_EXTRACT_VERSION($APXS_HTTPD) - if test "$APACHE_VERSION" -le 2000000; then - AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropiate switch --with-apxs (without the 2)]) - elif test "$APACHE_VERSION" -lt 2000040; then - AC_MSG_ERROR([Please note that Apache version >= 2.0.40 is required]) - fi - - APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` - if test -z `$APXS -q SYSCONFDIR`; then - INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5" - else - APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` - INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5" - fi - - case $host_alias in - *aix*) - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - PHP_SELECT_SAPI(apache2filter, shared, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - *darwin*) - dnl When using bundles on Darwin, we must resolve all symbols. However, - dnl the linker does not recursively look at the bundle loader and - dnl pull in its dependencies. Therefore, we must pull in the APR - dnl and APR-util libraries. - if test -x "$APR_CONFIG"; then - MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`" - fi - if test -x "$APU_CONFIG"; then - MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS" - fi - MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS" - PHP_SUBST(MH_BUNDLE_FLAGS) - PHP_SELECT_SAPI(apache2filter, bundle, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - SAPI_SHARED=libs/libphp5.so - INSTALL_IT="$INSTALL_IT $SAPI_SHARED" - ;; - *beos*) - if test -f _APP_; then `rm _APP_`; fi - `ln -s $APXS_BINDIR/httpd _APP_` - EXTRA_LIBS="$EXTRA_LIBS _APP_" - PHP_SELECT_SAPI(apache2filter, shared, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - *) - PHP_SELECT_SAPI(apache2filter, shared, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - esac - - if test "$APXS_MPM" != "prefork"; then - PHP_BUILD_THREAD_SAFE - fi - AC_MSG_RESULT(yes) - PHP_SUBST(APXS) -else - AC_MSG_RESULT(no) -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/apache2filter/config.w32 b/sapi/apache2filter/config.w32 deleted file mode 100755 index 9b26f9ef3f057..0000000000000 --- a/sapi/apache2filter/config.w32 +++ /dev/null @@ -1,35 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('apache2filter', 'Build Apache 2.x filter', 'no'); - -if (PHP_APACHE2FILTER != "no") { - if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2FILTER", PHP_PHP_BUILD + "\\include\\apache2") && - CHECK_LIB("libhttpd.lib", "apache2filter", PHP_PHP_BUILD + "\\lib\\apache2") && - CHECK_LIB("libapr.lib", "apache2filter", PHP_PHP_BUILD + "\\lib\\apache2") && - CHECK_LIB("libaprutil.lib", "apache2filter", PHP_PHP_BUILD + "\\lib\\apache2") - ) { - SAPI('apache2filter', 'sapi_apache2.c apache_config.c php_functions.c', - 'php' + PHP_VERSION + 'apache2_filter.dll', - '/D PHP_APACHE2_EXPORTS /I win32'); - } else { - WARNING("Could not find apache2 filter libraries/headers"); - } -} - -ARG_ENABLE('apache2-2filter', 'Build Apache 2.2.x filter', 'no'); - -if (PHP_APACHE2_2FILTER != "no") { - if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_2FILTER", PHP_PHP_BUILD + "\\include\\apache2_2") && - CHECK_LIB("libhttpd.lib", "apache2_2filter", PHP_PHP_BUILD + "\\lib\\apache2_2") && - CHECK_LIB("libapr-1.lib", "apache2_2filter", PHP_PHP_BUILD + "\\lib\\apache2_2") && - CHECK_LIB("libaprutil-1.lib", "apache2_2filter", PHP_PHP_BUILD + "\\lib\\apache2_2") - ) { - SAPI('apache2_2filter', 'sapi_apache2.c apache_config.c php_functions.c', - 'php' + PHP_VERSION + 'apache2_2_filter.dll', - '/D PHP_APACHE2_EXPORTS /I win32', - 'sapi\\apache2_2filter'); - } else { - WARNING("Could not find apache2.2 filter libraries/headers"); - } -} diff --git a/sapi/apache2filter/php.sym b/sapi/apache2filter/php.sym deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache2filter/php.sym +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h deleted file mode 100644 index 78050a7de5730..0000000000000 --- a/sapi/apache2filter/php_apache.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_APACHE_H -#define PHP_APACHE_H - -#include "httpd.h" -#include "http_config.h" -#include "http_core.h" - -/* Declare this so we can get to it from outside the sapi_apache2.c file */ -extern module AP_MODULE_DECLARE_DATA php5_module; - -/* A way to specify the location of the php.ini dir in an apache directive */ -extern char *apache2_php_ini_path_override; - -/* The server_context used by PHP */ -typedef struct php_struct { - int state; - request_rec *r; - ap_filter_t *f; /* downstream output filters after the PHP filter. */ - /* Length of post_data buffer */ - int post_len; - /* Index for reading from buffer */ - int post_idx; - /* stat structure of the current file */ - struct stat finfo; - /* Buffer for request body filter */ - char *post_data; - /* Whether or not we've processed PHP in the output filters yet. */ - int request_processed; -} php_struct; - -typedef struct _php_apr_bucket_brigade { - unsigned int total_len; - apr_bucket_brigade *bb; -} php_apr_bucket_brigade; - -void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf); -void *create_php_config(apr_pool_t *p, char *dummy); -char *get_php_config(void *conf, char *name, size_t name_len); -void apply_config(void *); -extern const command_rec php_dir_cmds[]; - -static size_t php_apache_read_stream(void *, char *, size_t TSRMLS_DC); -static void php_apache_close_stream(void * TSRMLS_DC); -static long php_apache_fteller_stream(void * TSRMLS_DC); - -#define APR_ARRAY_FOREACH_OPEN(arr, key, val) \ -{ \ - apr_table_entry_t *elts; \ - int i; \ - elts = (apr_table_entry_t *) arr->elts; \ - for (i = 0; i < arr->nelts; i++) { \ - key = elts[i].key; \ - val = elts[i].val; - -#define APR_ARRAY_FOREACH_CLOSE() }} - -#endif /* PHP_APACHE_H */ diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c deleted file mode 100644 index 5557c64a48818..0000000000000 --- a/sapi/apache2filter/php_functions.c +++ /dev/null @@ -1,396 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "ext/standard/php_smart_str.h" -#include "ext/standard/info.h" -#include "SAPI.h" - -#define CORE_PRIVATE -#include "apr_strings.h" -#include "apr_time.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" - -#include "php_apache.h" - -static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) -{ - php_struct *ctx; - - if (!filename) { - return NULL; - } - - ctx = SG(server_context); - return ap_sub_req_lookup_uri(filename, ctx->f->r, ctx->f->next); -} - -/* {{{ proto bool virtual(string uri) - Perform an apache sub-request */ -PHP_FUNCTION(virtual) -{ - zval **filename; - request_rec *rr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(filename); - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - if (rr->status == HTTP_OK) { - if (ap_run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; - } - ap_destroy_sub_req(rr); - RETURN_TRUE; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; -} -/* }}} */ - -#define ADD_LONG(name) \ - add_property_long(return_value, #name, rr->name) -#define ADD_TIME(name) \ - add_property_long(return_value, #name, apr_time_sec(rr->name)); -#define ADD_STRING(name) \ - if (rr->name) add_property_string(return_value, #name, (char *) rr->name, 1) - -PHP_FUNCTION(apache_lookup_uri) -{ - request_rec *rr; - zval **filename; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(filename); - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - if (rr->status == HTTP_OK) { - object_init(return_value); - - ADD_LONG(status); - ADD_STRING(the_request); - ADD_STRING(status_line); - ADD_STRING(method); - ADD_TIME(mtime); - ADD_LONG(clength); -#if MODULE_MAGIC_NUMBER < 20020506 - ADD_STRING(boundary); -#endif - ADD_STRING(range); - ADD_LONG(chunked); - ADD_STRING(content_type); - ADD_STRING(handler); - ADD_LONG(no_cache); - ADD_LONG(no_local_copy); - ADD_STRING(unparsed_uri); - ADD_STRING(uri); - ADD_STRING(filename); - ADD_STRING(path_info); - ADD_STRING(args); - ADD_LONG(allowed); - ADD_LONG(sent_bodyct); - ADD_LONG(bytes_sent); - ADD_LONG(mtime); - ADD_TIME(request_time); - - ap_destroy_sub_req(rr); - return; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; -} - -/* {{{ proto array getallheaders(void) - Fetch all HTTP request headers */ -PHP_FUNCTION(apache_request_headers) -{ - php_struct *ctx; - const apr_array_header_t *arr; - char *key, *val; - - array_init(return_value); - - ctx = SG(server_context); - arr = apr_table_elts(ctx->f->r->headers_in); - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - add_assoc_string(return_value, key, val, 1); - APR_ARRAY_FOREACH_CLOSE() -} -/* }}} */ - -/* {{{ proto array apache_response_headers(void) - Fetch all HTTP response headers */ -PHP_FUNCTION(apache_response_headers) -{ - php_struct *ctx; - const apr_array_header_t *arr; - char *key, *val; - - array_init(return_value); - - ctx = SG(server_context); - arr = apr_table_elts(ctx->f->r->headers_out); - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - add_assoc_string(return_value, key, val, 1); - APR_ARRAY_FOREACH_CLOSE() -} -/* }}} */ - -/* {{{ proto string apache_note(string note_name [, string note_value]) - Get and set Apache request notes */ -PHP_FUNCTION(apache_note) -{ - php_struct *ctx; - zval **note_name, **note_val; - char *old_note_val=NULL; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, ¬e_name, ¬e_val) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - convert_to_string_ex(note_name); - - old_note_val = (char *) apr_table_get(ctx->r->notes, Z_STRVAL_PP(note_name)); - - if (arg_count == 2) { - convert_to_string_ex(note_val); - apr_table_set(ctx->r->notes, Z_STRVAL_PP(note_name), Z_STRVAL_PP(note_val)); - } - - if (old_note_val) { - RETURN_STRING(old_note_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top]) - Set an Apache subprocess_env variable */ -PHP_FUNCTION(apache_setenv) -{ - php_struct *ctx; - zval **variable=NULL, **string_val=NULL, **walk_to_top=NULL; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>3 || - zend_get_parameters_ex(arg_count, &variable, &string_val, &walk_to_top) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - if (arg_count == 3 && Z_STRVAL_PP(walk_to_top)) { - while(ctx->f->r->prev) { - ctx->f->r = ctx->f->r->prev; - } - } - - convert_to_string_ex(variable); - convert_to_string_ex(string_val); - - apr_table_set(ctx->r->subprocess_env, Z_STRVAL_PP(variable), Z_STRVAL_PP(string_val)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool apache_getenv(string variable [, bool walk_to_top]) - Get an Apache subprocess_env variable */ -PHP_FUNCTION(apache_getenv) -{ - php_struct *ctx; - zval **variable=NULL, **walk_to_top=NULL; - int arg_count = ZEND_NUM_ARGS(); - char *env_val=NULL; - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, &variable, &walk_to_top) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - if (arg_count == 2 && Z_STRVAL_PP(walk_to_top)) { - while(ctx->f->r->prev) { - ctx->f->r = ctx->f->r->prev; - } - } - - convert_to_string_ex(variable); - - env_val = (char*) apr_table_get(ctx->r->subprocess_env, Z_STRVAL_PP(variable)); - if (env_val != NULL) { - RETURN_STRING(env_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -static char *php_apache_get_version() -{ -#if MODULE_MAGIC_NUMBER_MAJOR >= 20060905 - return (char *) ap_get_server_banner(); -#else - return (char *) ap_get_server_version(); -#endif -} - -/* {{{ proto string apache_get_version(void) - Fetch Apache version */ -PHP_FUNCTION(apache_get_version) -{ - char *apv = php_apache_get_version(); - - if (apv && *apv) { - RETURN_STRING(apv, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array apache_get_modules(void) - Get a list of loaded Apache modules */ -PHP_FUNCTION(apache_get_modules) -{ - int n; - char *p; - - array_init(return_value); - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - add_next_index_stringl(return_value, s, (p - s), 1); - } else { - add_next_index_string(return_value, s, 1); - } - } -} -/* }}} */ - -PHP_MINFO_FUNCTION(apache) -{ - char *apv = php_apache_get_version(); - smart_str tmp1 = {0}; - int n; - char *p; - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - smart_str_appendl(&tmp1, s, (p - s)); - } else { - smart_str_appends(&tmp1, s); - } - smart_str_appendc(&tmp1, ' '); - } - if ((tmp1.len - 1) >= 0) { - tmp1.c[tmp1.len - 1] = '\0'; - } - - php_info_print_table_start(); - if (apv && *apv) { - php_info_print_table_row(2, "Apache Version", apv); - } - php_info_print_table_row(2, "Loaded Modules", tmp1.c); - smart_str_free(&tmp1); - php_info_print_table_end(); -} - -static zend_function_entry apache_functions[] = { - PHP_FE(apache_lookup_uri, NULL) - PHP_FE(virtual, NULL) - PHP_FE(apache_request_headers, NULL) - PHP_FE(apache_response_headers, NULL) - PHP_FE(apache_setenv, NULL) - PHP_FE(apache_getenv, NULL) - PHP_FE(apache_note, NULL) - PHP_FE(apache_get_version, NULL) - PHP_FE(apache_get_modules, NULL) - PHP_FALIAS(getallheaders, apache_request_headers, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry php_apache_module = { - STANDARD_MODULE_HEADER, - "apache2filter", - apache_functions, - NULL, - NULL, - NULL, - NULL, - PHP_MINFO(apache), - NULL, - STANDARD_MODULE_PROPERTIES -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c deleted file mode 100644 index 715ec4a22141c..0000000000000 --- a/sapi/apache2filter/sapi_apache2.c +++ /dev/null @@ -1,749 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Sascha Schumann | - | Parts based on Apache 1.3 SAPI module by | - | Rasmus Lerdorf and Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_main.h" -#include "php_ini.h" -#include "php_variables.h" -#include "SAPI.h" - -#include "ext/standard/php_smart_str.h" -#ifndef NETWARE -#include "ext/standard/php_standard.h" -#else -#include "ext/standard/basic_functions.h" -#endif - -#include "apr_strings.h" -#include "ap_config.h" -#include "apr_buckets.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" -#include "ap_mpm.h" - -#include "php_apache.h" - -/* UnixWare and Netware define shutdown to _shutdown, which causes problems later - * on when using a structure member named shutdown. Since this source - * file does not use the system call shutdown, it is safe to #undef it. - */ -#undef shutdown - -/* A way to specify the location of the php.ini dir in an apache directive */ -char *apache2_php_ini_path_override = NULL; - -static int -php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - apr_bucket *b; - apr_bucket_brigade *bb; - apr_bucket_alloc_t *ba; - ap_filter_t *f; /* remaining output filters */ - php_struct *ctx; - - ctx = SG(server_context); - f = ctx->f; - - if (str_length == 0) return 0; - - ba = f->c->bucket_alloc; - bb = apr_brigade_create(ctx->r->pool, ba); - - b = apr_bucket_transient_create(str, str_length, ba); - APR_BRIGADE_INSERT_TAIL(bb, b); - - if (ap_pass_brigade(f->next, bb) != APR_SUCCESS || ctx->r->connection->aborted) { - php_handle_aborted_connection(); - } - - return str_length; /* we always consume all the data passed to us. */ -} - -static int -php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - php_struct *ctx; - ap_filter_t *f; - char *val, *ptr; - - ctx = SG(server_context); - f = ctx->r->output_filters; - - val = strchr(sapi_header->header, ':'); - - if (!val) { - sapi_free_header(sapi_header); - return 0; - } - ptr = val; - - *val = '\0'; - - do { - val++; - } while (*val == ' '); - - if (!strcasecmp(sapi_header->header, "content-type")) - ctx->r->content_type = apr_pstrdup(ctx->r->pool, val); - else if (sapi_header->replace) - apr_table_set(ctx->r->headers_out, sapi_header->header, val); - else - apr_table_add(ctx->r->headers_out, sapi_header->header, val); - - *ptr = ':'; - return SAPI_HEADER_ADD; -} - -static int -php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - - ctx->r->status = SG(sapi_headers).http_response_code; - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int -php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - int n; - int to_read; - php_struct *ctx = SG(server_context); - - to_read = ctx->post_len - ctx->post_idx; - n = MIN(to_read, count_bytes); - - if (n > 0) { - memcpy(buf, ctx->post_data + ctx->post_idx, n); - ctx->post_idx += n; - } else { - if (ctx->post_data) free(ctx->post_data); - ctx->post_data = NULL; - } - - return n; -} - -static struct stat* -php_apache_sapi_get_stat(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - - ctx->finfo.st_uid = ctx->r->finfo.user; - ctx->finfo.st_gid = ctx->r->finfo.group; - ctx->finfo.st_dev = ctx->r->finfo.device; - ctx->finfo.st_ino = ctx->r->finfo.inode; -#ifdef NETWARE - ctx->finfo.st_atime.tv_sec = apr_time_sec(ctx->r->finfo.atime); - ctx->finfo.st_mtime.tv_sec = apr_time_sec(ctx->r->finfo.mtime); - ctx->finfo.st_ctime.tv_sec = apr_time_sec(ctx->r->finfo.ctime); -#else - ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime); - ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime); - ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime); -#endif - - ctx->finfo.st_size = ctx->r->finfo.size; - ctx->finfo.st_nlink = ctx->r->finfo.nlink; - - return &ctx->finfo; -} - -static char * -php_apache_sapi_read_cookies(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - const char *http_cookie; - - http_cookie = apr_table_get(ctx->r->headers_in, "cookie"); - - /* The SAPI interface should use 'const char *' */ - return (char *) http_cookie; -} - -static char * -php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const char *env_var; - - env_var = apr_table_get(ctx->r->subprocess_env, name); - - return (char *) env_var; -} - -static void -php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); - char *key, *val; - int new_val_len; - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) { - val = ""; - } - if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len TSRMLS_CC)) { - php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC); - } - APR_ARRAY_FOREACH_CLOSE() - - php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array TSRMLS_CC); - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC); - } -} - -static void -php_apache_sapi_flush(void *server_context) -{ - php_struct *ctx; - apr_bucket_brigade *bb; - apr_bucket_alloc_t *ba; - apr_bucket *b; - ap_filter_t *f; /* output filters */ - TSRMLS_FETCH(); - - ctx = server_context; - - /* If we haven't registered a server_context yet, - * then don't bother flushing. */ - if (!server_context) - return; - - sapi_send_headers(TSRMLS_C); - - ctx->r->status = SG(sapi_headers).http_response_code; - SG(headers_sent) = 1; - - f = ctx->f; - - /* Send a flush bucket down the filter chain. The current default - * handler seems to act on the first flush bucket, but ignores - * all further flush buckets. - */ - - ba = ctx->r->connection->bucket_alloc; - bb = apr_brigade_create(ctx->r->pool, ba); - b = apr_bucket_flush_create(ba); - APR_BRIGADE_INSERT_TAIL(bb, b); - if (ap_pass_brigade(f->next, bb) != APR_SUCCESS || ctx->r->connection->aborted) { - php_handle_aborted_connection(); - } -} - -static void php_apache_sapi_log_message(char *msg) -{ - php_struct *ctx; - TSRMLS_FETCH(); - - ctx = SG(server_context); - - if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */ - ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg); - } - else { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctx->r->server, "%s", msg); - } -} - -static int -php_apache_disable_caching(ap_filter_t *f) -{ - /* Identify PHP scripts as non-cacheable, thus preventing - * Apache from sending a 304 status when the browser sends - * If-Modified-Since header. - */ - f->r->no_local_copy = 1; - - return OK; -} - -static time_t php_apache_sapi_get_request_time(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - return apr_time_sec(ctx->r->request_time); -} - -extern zend_module_entry php_apache_module; - -static int php_apache2_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_apache_module, 1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - -static sapi_module_struct apache2_sapi_module = { - "apache2filter", - "Apache 2.0 Filter", - - php_apache2_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - php_apache_sapi_ub_write, /* unbuffered write */ - php_apache_sapi_flush, /* flush */ - php_apache_sapi_get_stat, /* get uid */ - php_apache_sapi_getenv, /* getenv */ - - php_error, /* error handler */ - - php_apache_sapi_header_handler, /* header handler */ - php_apache_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - php_apache_sapi_read_post, /* read POST data */ - php_apache_sapi_read_cookies, /* read Cookies */ - - php_apache_sapi_register_variables, - php_apache_sapi_log_message, /* Log message */ - php_apache_sapi_get_request_time, /* Get Request Time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, - ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) -{ - php_struct *ctx; - long old_index; - apr_bucket *b; - const char *str; - apr_size_t n; - apr_status_t rv; - TSRMLS_FETCH(); - - if (f->r->proxyreq) { - return ap_get_brigade(f->next, bb, mode, block, readbytes); - } - - ctx = SG(server_context); - if (ctx == NULL) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, - "php failed to get server context"); - return HTTP_INTERNAL_SERVER_ERROR; - } - - if ((rv = ap_get_brigade(f->next, bb, mode, block, readbytes)) != APR_SUCCESS) { - return rv; - } - - for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) { - apr_bucket_read(b, &str, &n, APR_NONBLOCK_READ); - if (n > 0) { - old_index = ctx->post_len; - ctx->post_len += n; - ctx->post_data = realloc(ctx->post_data, ctx->post_len + 1); - memcpy(ctx->post_data + old_index, str, n); - } - } - return APR_SUCCESS; -} - -static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC) -{ - char *content_type; - char *content_length; - const char *auth; - - PG(during_request_startup) = 0; - SG(sapi_headers).http_response_code = !f->r->status ? HTTP_OK : f->r->status; - SG(request_info).content_type = apr_table_get(f->r->headers_in, "Content-Type"); -#undef safe_strdup -#define safe_strdup(x) ((x)?strdup((x)):NULL) - SG(request_info).query_string = safe_strdup(f->r->args); - SG(request_info).request_method = f->r->method; - SG(request_info).proto_num = f->r->proto_num; - SG(request_info).request_uri = safe_strdup(f->r->uri); - SG(request_info).path_translated = safe_strdup(f->r->filename); - f->r->no_local_copy = 1; - content_type = sapi_get_default_content_type(TSRMLS_C); - f->r->content_type = apr_pstrdup(f->r->pool, content_type); - SG(request_info).post_data = ctx->post_data; - SG(request_info).post_data_length = ctx->post_len; - - efree(content_type); - - content_length = (char *) apr_table_get(f->r->headers_in, "Content-Length"); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - - apr_table_unset(f->r->headers_out, "Content-Length"); - apr_table_unset(f->r->headers_out, "Last-Modified"); - apr_table_unset(f->r->headers_out, "Expires"); - apr_table_unset(f->r->headers_out, "ETag"); - if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(f->r))) { - auth = apr_table_get(f->r->headers_in, "Authorization"); - php_handle_auth_data(auth TSRMLS_CC); - if (SG(request_info).auth_user == NULL && f->r->user) { - SG(request_info).auth_user = estrdup(f->r->user); - } - ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); - } else { - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - } - php_request_startup(TSRMLS_C); -} - -static void php_apache_request_dtor(ap_filter_t *f TSRMLS_DC) -{ - php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)f->ctx; - - php_request_shutdown(NULL); - - if (SG(request_info).query_string) { - free(SG(request_info).query_string); - } - if (SG(request_info).request_uri) { - free(SG(request_info).request_uri); - } - if (SG(request_info).path_translated) { - free(SG(request_info).path_translated); - } - - apr_brigade_destroy(pbb->bb); -} - -static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) -{ - php_struct *ctx; - void *conf = ap_get_module_config(f->r->per_dir_config, &php5_module); - char *p = get_php_config(conf, "engine", sizeof("engine")); - zend_file_handle zfd; - php_apr_bucket_brigade *pbb; - apr_bucket *b; - TSRMLS_FETCH(); - - if (f->r->proxyreq) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return ap_pass_brigade(f->next, bb); - } - - /* handle situations where user turns the engine off */ - if (*p == '0') { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return ap_pass_brigade(f->next, bb); - } - - if(f->ctx) { - pbb = (php_apr_bucket_brigade *)f->ctx; - } else { - pbb = f->ctx = apr_palloc(f->r->pool, sizeof(*pbb)); - pbb->bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc); - pbb->total_len = 0; - } - - if(ap_save_brigade(NULL, &pbb->bb, &bb, f->r->pool) != APR_SUCCESS) { - // Bad - } - - apr_brigade_cleanup(bb); - - // Check to see if the last bucket in this brigade, it not - // we have to wait until then. - if(!APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(pbb->bb))) { - return 0; - } - - /* Setup the CGI variables if this is the main request.. */ - if (f->r->main == NULL || - /* .. or if the sub-request envinronment differs from the main-request. */ - f->r->subprocess_env != f->r->main->subprocess_env - ) { - /* setup standard CGI variables */ - ap_add_common_vars(f->r); - ap_add_cgi_vars(f->r); - } - - ctx = SG(server_context); - if (ctx == NULL) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, - "php failed to get server context"); - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return HTTP_INTERNAL_SERVER_ERROR; - } - - ctx->f = f->next; /* save whatever filters are after us in the chain. */ - - if (ctx->request_processed) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return ap_pass_brigade(f->next, bb); - } - - apply_config(conf); - php_apache_request_ctor(f, ctx TSRMLS_CC); - - // It'd be nice if we could highlight based of a zend_file_handle here.... - // ...but we can't. - - zfd.type = ZEND_HANDLE_STREAM; - - zfd.handle.stream.handle = pbb; - zfd.handle.stream.reader = php_apache_read_stream; - zfd.handle.stream.closer = php_apache_close_stream; - zfd.handle.stream.fteller = php_apache_fteller_stream; - zfd.handle.stream.interactive = 0; - - zfd.filename = f->r->filename; - zfd.opened_path = NULL; - zfd.free_filename = 0; - - php_execute_script(&zfd TSRMLS_CC); - - apr_table_set(ctx->r->notes, "mod_php_memory_usage", - apr_psprintf(ctx->r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC))); - - php_apache_request_dtor(f TSRMLS_CC); - - if (!f->r->main) { - ctx->request_processed = 1; - } - - b = apr_bucket_eos_create(f->c->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(pbb->bb, b); - - /* Pass whatever is left on the brigade. */ - return ap_pass_brigade(f->next, pbb->bb); -} - -static apr_status_t -php_apache_server_shutdown(void *tmp) -{ - apache2_sapi_module.shutdown(&apache2_sapi_module); - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - return APR_SUCCESS; -} - -static void php_apache_add_version(apr_pool_t *p) -{ - TSRMLS_FETCH(); - if (PG(expose_php)) { - ap_add_version_component(p, "PHP/" PHP_VERSION); - } -} - -static int php_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) -{ -#ifndef ZTS - int threaded_mpm; - - ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded_mpm); - if(threaded_mpm) { - ap_log_error(APLOG_MARK, APLOG_CRIT, 0, 0, "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP."); - return DONE; - } -#endif - /* When this is NULL, apache won't override the hard-coded default - * php.ini path setting. */ - apache2_php_ini_path_override = NULL; - return OK; -} - -static int -php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, - apr_pool_t *ptemp, server_rec *s) -{ - void *data = NULL; - const char *userdata_key = "apache2filter_post_config"; - - /* Apache will load, unload and then reload a DSO module. This - * prevents us from starting PHP until the second load. */ - apr_pool_userdata_get(&data, userdata_key, s->process->pool); - if (data == NULL) { - /* We must use set() here and *not* setn(), otherwise the - * static string pointed to by userdata_key will be mapped - * to a different location when the DSO is reloaded and the - * pointers won't match, causing get() to return NULL when - * we expected it to return non-NULL. */ - apr_pool_userdata_set((const void *)1, userdata_key, - apr_pool_cleanup_null, s->process->pool); - return OK; - } - - /* Set up our overridden path. */ - if (apache2_php_ini_path_override) { - apache2_sapi_module.php_ini_path_override = apache2_php_ini_path_override; - } -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache2_sapi_module); - apache2_sapi_module.startup(&apache2_sapi_module); - apr_pool_cleanup_register(pconf, NULL, php_apache_server_shutdown, apr_pool_cleanup_null); - php_apache_add_version(pconf); - - return OK; -} - -static void php_add_filter(request_rec *r, ap_filter_t *f) -{ - int output = (f == r->output_filters); - - /* for those who still have Set*Filter PHP configured */ - while (f) { - if (strcmp(f->frec->name, "PHP") == 0) { - ap_log_error(APLOG_MARK, APLOG_WARNING, - 0, r->server, - "\"Set%sFilter PHP\" already configured for %s", - output ? "Output" : "Input", r->uri); - return; - } - f = f->next; - } - - if (output) { - ap_add_output_filter("PHP", NULL, r, r->connection); - } else { - ap_add_input_filter("PHP", NULL, r, r->connection); - } -} - -static void php_insert_filter(request_rec *r) -{ - int content_type_len = strlen("application/x-httpd-php"); - - if (r->content_type && !strncmp(r->content_type, "application/x-httpd-php", content_type_len-1)) { - if (r->content_type[content_type_len] == '\0' || !strncmp(r->content_type+content_type_len, "-source", sizeof("-source"))) { - php_add_filter(r, r->output_filters); - php_add_filter(r, r->input_filters); - } - } -} - -static apr_status_t php_server_context_cleanup(void *data_) -{ - void **data = data_; - *data = NULL; - return APR_SUCCESS; -} - -static int php_post_read_request(request_rec *r) -{ - php_struct *ctx; - TSRMLS_FETCH(); - - /* Initialize filter context */ - SG(server_context) = ctx = apr_pcalloc(r->pool, sizeof(*ctx)); - - /* register a cleanup so we clear out the SG(server_context) - * after each request. Note: We pass in the pointer to the - * server_context in case this is handled by a different thread. */ - apr_pool_cleanup_register(r->pool, (void *)&SG(server_context), - php_server_context_cleanup, - apr_pool_cleanup_null); - - /* Save the entire request, so we can get the input or output - * filters if we need them. */ - ctx->r = r; - - return OK; -} - -static void php_register_hook(apr_pool_t *p) -{ - ap_hook_pre_config(php_pre_config, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_insert_filter(php_insert_filter, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_post_read_request(php_post_read_request, NULL, NULL, APR_HOOK_MIDDLE); - ap_register_output_filter("PHP", php_output_filter, php_apache_disable_caching, AP_FTYPE_RESOURCE); - ap_register_input_filter("PHP", php_input_filter, php_apache_disable_caching, AP_FTYPE_RESOURCE); -} - -static size_t php_apache_read_stream(void *handle, char *buf, size_t wantlen TSRMLS_DC) -{ - php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)handle; - apr_bucket_brigade *rbb; - apr_size_t readlen; - apr_bucket *b = NULL; - - rbb = pbb->bb; - - if((apr_brigade_partition(pbb->bb, wantlen, &b) == APR_SUCCESS) && b){ - pbb->bb = apr_brigade_split(rbb, b); - } - - readlen = wantlen; - apr_brigade_flatten(rbb, buf, &readlen); - apr_brigade_cleanup(rbb); - pbb->total_len += readlen; - - return readlen; -} - -static void php_apache_close_stream(void *handle TSRMLS_DC) -{ - return; -} - -static long php_apache_fteller_stream(void *handle TSRMLS_DC) -{ - php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)handle; - return pbb->total_len; -} - -AP_MODULE_DECLARE_DATA module php5_module = { - STANDARD20_MODULE_STUFF, - create_php_config, /* create per-directory config structure */ - merge_php_config, /* merge per-directory config structures */ - NULL, /* create per-server config structure */ - NULL, /* merge per-server config structures */ - php_dir_cmds, /* command apr_table_t */ - php_register_hook /* register hooks */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2handler/CREDITS b/sapi/apache2handler/CREDITS deleted file mode 100644 index 4a7848053c4a7..0000000000000 --- a/sapi/apache2handler/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Apache 2.0 Handler -Ian Holsman, Justin Erenkrantz (based on Apache 2.0 Filter code) diff --git a/sapi/apache2handler/README b/sapi/apache2handler/README deleted file mode 100644 index 5cbd1b95ddcd0..0000000000000 --- a/sapi/apache2handler/README +++ /dev/null @@ -1,76 +0,0 @@ -WHAT IS THIS? - - This module exploits the layered I/O support in Apache 2.0. - -HOW DOES IT WORK? - - In Apache 2.0, you have handlers which generate content (like - reading a script from disk). The content goes then through - a chain of filters. PHP can be such a filter, so that it processes - your script and hands the output to the next filter (which will - usually cause a write to the network). - -DOES IT WORK? - - Currently the issues with the module are: - * Thread safety of external PHP modules - * The lack of re-entrancy of PHP. due to this I have disabled the 'virtual' - function, and tried to stop any method where a php script can run another php - script while it is being run. - - -HOW TO INSTALL - - This SAPI module is known to work with Apache 2.0.44. - - $ cd apache-2.x - $ cd src - $ ./configure --enable-so - $ make install - - For testing purposes, you might want to use --with-mpm=prefork. - (Albeit PHP also works with threaded MPMs. See Thread Safety note above) - - Configure PHP 4: - - $ cd php-4.x - $ ./configure --with-apxs2=/path/to/apache-2.0/bin/apxs - $ make install - - At the end of conf/httpd.conf, add: - - AddType application/x-httpd-php .php - - If you would like to enable source code highlighting functionality add: - - AddType application/x-httpd-php-source .phps - - That's it. Now start bin/httpd. - -HOW TO CONFIGURE - - The Apache 2.0 PHP module supports a new configuration directive that - allows an admin to override the php.ini search path. For example, - place your php.ini file in Apache's ServerRoot/conf directory and - add this to your httpd.conf file: - - PHPINIDir "conf" - -DEBUGGING APACHE AND PHP - - To debug Apache, we recommened: - - 1. Use the Prefork MPM (Apache 1.3-like process model) by - configuring Apache with '--with-mpm=prefork'. - 2. Start httpd using -DONE_PROCESS (e.g. (gdb) r -DONE_PROCESS). - - If you want to debug a part of the PHP startup procedure, set a - breakpoint on 'load_module'. Step through it until apr_dso_load() is - done. Then you can set a breakpoint on any PHP-related symbol. - -TODO - - PHP functions like apache_sub_req (see php_functions.c) - Source Code Highlighting - Protocol handlers - diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c deleted file mode 100644 index b53a0c984d425..0000000000000 --- a/sapi/apache2handler/apache_config.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_ini.h" -#include "php_apache.h" - -#include "apr_strings.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" - -#ifdef PHP_AP_DEBUG -#define phpapdebug(a) fprintf a -#else -#define phpapdebug(a) -#endif - -typedef struct { - HashTable config; -} php_conf_rec; - -typedef struct { - char *value; - size_t value_len; - char status; - char htaccess; -} php_dir_entry; - -static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, const char *value, int status) -{ - php_conf_rec *d = dummy; - php_dir_entry e; - - phpapdebug((stderr, "Getting %s=%s for %p (%d)\n", name, value, dummy, zend_hash_num_elements(&d->config))); - - if (!strncasecmp(value, "none", sizeof("none"))) { - value = ""; - } - - e.value = apr_pstrdup(cmd->pool, value); - e.value_len = strlen(value); - e.status = status; - e.htaccess = ((cmd->override & (RSRC_CONF|ACCESS_CONF)) == 0); - - zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, sizeof(e), NULL); - return NULL; -} - -static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_value_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); -} - -static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_value_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); -} - -static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, const char *arg2, int status) -{ - char bool_val[2]; - - if (!strcasecmp(arg2, "On") || (arg2[0] == '1' && arg2[1] == '\0')) { - bool_val[0] = '1'; - } else { - bool_val[0] = '0'; - } - bool_val[1] = 0; - - return real_value_hnd(cmd, dummy, arg1, bool_val, status); -} - -static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_flag_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); -} - -static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) -{ - return real_flag_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); -} - -static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg) -{ - if (apache2_php_ini_path_override) { - return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; - } - apache2_php_ini_path_override = ap_server_root_relative(cmd->pool, arg); - return NULL; -} - -static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_dir_entry *new_per_dir_entry, zend_hash_key *hash_key, void *pData) -{ - php_dir_entry *orig_per_dir_entry; - - if (zend_hash_find(target_ht, hash_key->arKey, hash_key->nKeyLength, (void **) &orig_per_dir_entry)==FAILURE) { - return 1; /* does not exist in dest, copy from source */ - } - - if (new_per_dir_entry->status >= orig_per_dir_entry->status) { - /* use new entry */ - phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", hash_key->arKey, new_per_dir_entry->status, orig_per_dir_entry->status)); - return 1; - } else { - return 0; - } -} - - -void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf) -{ - php_conf_rec *d = base_conf, *e = new_conf, *n = NULL; - php_dir_entry *pe; - php_dir_entry *data; - char *str; - uint str_len; - ulong num_index; - - n = create_php_config(p, "merge_php_config"); - /* copy old config */ - zend_hash_copy(&n->config, &d->config, NULL, NULL, sizeof(php_dir_entry)); - /* merge new config */ - phpapdebug((stderr, "Merge dir (%p)+(%p)=(%p)\n", base_conf, new_conf, n)); - zend_hash_merge_ex(&n->config, &e->config, NULL, sizeof(php_dir_entry), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL); -#if STAS_0 - for (zend_hash_internal_pointer_reset(&d->config); - zend_hash_get_current_key_ex(&d->config, &str, &str_len, - &num_index, 0, NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(&d->config)) { - pe = NULL; - zend_hash_get_current_data(&d->config, (void **) &data); - if (zend_hash_find(&n->config, str, str_len, (void **) &pe) == SUCCESS) { - if (pe->status >= data->status) continue; - } - phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1)); - zend_hash_update(&n->config, str, str_len, data, sizeof(*data), NULL); - } -#endif - return n; -} - -char *get_php_config(void *conf, char *name, size_t name_len) -{ - php_conf_rec *d = conf; - php_dir_entry *pe; - - if (zend_hash_find(&d->config, name, name_len, (void **) &pe) == SUCCESS) { - return pe->value; - } - - return ""; -} - -void apply_config(void *dummy) -{ - php_conf_rec *d = dummy; - char *str; - uint str_len; - php_dir_entry *data; - - for (zend_hash_internal_pointer_reset(&d->config); - zend_hash_get_current_key_ex(&d->config, &str, &str_len, NULL, 0, - NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(&d->config)) { - zend_hash_get_current_data(&d->config, (void **) &data); - phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value)); - if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) { - phpapdebug((stderr, "..FAILED\n")); - } - } -} - -const command_rec php_dir_cmds[] = -{ - AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS, "PHP Value Modifier"), - AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, "PHP Flag Modifier"), - AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"), - AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"), - AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, "Directory containing the php.ini file"), - {NULL} -}; - -static apr_status_t destroy_php_config(void *data) -{ - php_conf_rec *d = data; - - phpapdebug((stderr, "Destroying config %p\n", data)); - zend_hash_destroy(&d->config); - - return APR_SUCCESS; -} - -void *create_php_config(apr_pool_t *p, char *dummy) -{ - php_conf_rec *newx = (php_conf_rec *) apr_pcalloc(p, sizeof(*newx)); - - phpapdebug((stderr, "Creating new config (%p) for %s\n", newx, dummy)); - zend_hash_init(&newx->config, 0, NULL, NULL, 1); - apr_pool_cleanup_register(p, newx, destroy_php_config, apr_pool_cleanup_null); - return (void *) newx; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4 deleted file mode 100644 index 8bc677b4cc756..0000000000000 --- a/sapi/apache2handler/config.m4 +++ /dev/null @@ -1,131 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(apxs2,, -[ --with-apxs2[=FILE] Build shared Apache 2.0 Handler module. FILE is the optional - pathname to the Apache apxs tool [apxs]], no, no) - -AC_MSG_CHECKING([for Apache 2.0 handler-module support via DSO through APXS]) - -if test "$PHP_APXS2" != "no"; then - if test "$PHP_APXS2" = "yes"; then - APXS=apxs - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0" && test -x /usr/sbin/apxs; then - APXS=/usr/sbin/apxs - fi - else - PHP_EXPAND_PATH($PHP_APXS2, APXS) - fi - - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0"; then - AC_MSG_RESULT() - AC_MSG_RESULT() - AC_MSG_RESULT([Sorry, I cannot run apxs. Possible reasons follow:]) - AC_MSG_RESULT() - AC_MSG_RESULT([1. Perl is not installed]) - AC_MSG_RESULT([2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs]) - AC_MSG_RESULT([3. Apache was not built using --enable-so (the apxs usage page is displayed)]) - AC_MSG_RESULT() - AC_MSG_RESULT([The output of $APXS follows:]) - $APXS -q CFLAGS - AC_MSG_ERROR([Aborting]) - fi - - APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` - APXS_BINDIR=`$APXS -q BINDIR` - APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` - APXS_CFLAGS=`$APXS -q CFLAGS` - APXS_MPM=`$APXS -q MPM_NAME` - APU_BINDIR=`$APXS -q APU_BINDIR` - APR_BINDIR=`$APXS -q APR_BINDIR` - - # Pick up ap[ru]-N-config if using httpd >=2.1 - APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null || - echo $APR_BINDIR/apr-config` - APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null || - echo $APU_BINDIR/apu-config` - - APR_CFLAGS="`$APR_CONFIG --cppflags --includes`" - APU_CFLAGS="`$APU_CONFIG --includes`" - - for flag in $APXS_CFLAGS; do - case $flag in - -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";; - esac - done - - APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS" - - # Test that we're trying to configure with apache 2.x - PHP_AP_EXTRACT_VERSION($APXS_HTTPD) - if test "$APACHE_VERSION" -le 2000000; then - AC_MSG_ERROR([You have enabled Apache 2 support while your server is Apache 1.3. Please use the appropiate switch --with-apxs (without the 2)]) - elif test "$APACHE_VERSION" -lt 2000044; then - AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required]) - fi - - APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` - if test -z `$APXS -q SYSCONFDIR`; then - INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5" - else - APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` - INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5" - fi - - case $host_alias in - *aix*) - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - *darwin*) - dnl When using bundles on Darwin, we must resolve all symbols. However, - dnl the linker does not recursively look at the bundle loader and - dnl pull in its dependencies. Therefore, we must pull in the APR - dnl and APR-util libraries. - if test -x "$APR_CONFIG"; then - MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`" - fi - if test -x "$APU_CONFIG"; then - MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS" - fi - MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS" - PHP_SUBST(MH_BUNDLE_FLAGS) - PHP_SELECT_SAPI(apache2handler, bundle, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - SAPI_SHARED=libs/libphp5.so - INSTALL_IT="$INSTALL_IT $SAPI_SHARED" - ;; - *beos*) - if test -f _APP_; then `rm _APP_`; fi - `ln -s $APXS_BINDIR/httpd _APP_` - EXTRA_LIBS="$EXTRA_LIBS _APP_" - PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - *) - PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) - INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" - ;; - esac - - if test "$APXS_MPM" != "prefork"; then - PHP_BUILD_THREAD_SAFE - fi - AC_MSG_RESULT(yes) - PHP_SUBST(APXS) -else - AC_MSG_RESULT(no) -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/apache2handler/config.w32 b/sapi/apache2handler/config.w32 deleted file mode 100644 index b9a27a196d0dd..0000000000000 --- a/sapi/apache2handler/config.w32 +++ /dev/null @@ -1,35 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('apache2handler', 'Build Apache 2.x handler', 'no'); - -if (PHP_APACHE2HANDLER != "no") { - if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2HANDLER", PHP_PHP_BUILD + "\\include\\apache2") && - CHECK_LIB("libhttpd.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") && - CHECK_LIB("libapr.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") && - CHECK_LIB("libaprutil.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") - ) { - SAPI('apache2handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c', - 'php' + PHP_VERSION + 'apache2.dll', - '/D PHP_APACHE2_EXPORTS /I win32'); - } else { - WARNING("Could not find apache2 libraries/headers"); - } -} - -ARG_ENABLE('apache2-2handler', 'Build Apache 2.2.x handler', 'no'); - -if (PHP_APACHE2_2HANDLER != "no") { - if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_2HANDLER", PHP_PHP_BUILD + "\\include\\apache2_2") && - CHECK_LIB("libhttpd.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") && - CHECK_LIB("libapr-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") && - CHECK_LIB("libaprutil-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") - ) { - SAPI('apache2_2handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c', - 'php' + PHP_VERSION + 'apache2_2.dll', - '/D PHP_APACHE2_EXPORTS /I win32', - 'sapi\\apache2_2handler'); - } else { - WARNING("Could not find apache2.2 libraries/headers"); - } -} diff --git a/sapi/apache2handler/mod_php5.c b/sapi/apache2handler/mod_php5.c deleted file mode 100644 index 39b19eec64684..0000000000000 --- a/sapi/apache2handler/mod_php5.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Sascha Schumann | - | Parts based on Apache 1.3 SAPI module by | - | Rasmus Lerdorf and Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_apache.h" - -AP_MODULE_DECLARE_DATA module php5_module = { - STANDARD20_MODULE_STUFF, - create_php_config, /* create per-directory config structure */ - merge_php_config, /* merge per-directory config structures */ - NULL, /* create per-server config structure */ - NULL, /* merge per-server config structures */ - php_dir_cmds, /* command apr_table_t */ - php_ap2_register_hook /* register hooks */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2handler/php.sym b/sapi/apache2handler/php.sym deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache2handler/php.sym +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache2handler/php5apache2.dsp b/sapi/apache2handler/php5apache2.dsp deleted file mode 100644 index 40cd58cb928d7..0000000000000 --- a/sapi/apache2handler/php5apache2.dsp +++ /dev/null @@ -1,146 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5apache2" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5apache2 - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5apache2.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5apache2.mak" CFG="php5apache2 - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5apache2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache2 - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5apache2 - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_APACHE2_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libhttpd.lib libapr.lib libaprutil.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" - -!ELSEIF "$(CFG)" == "php5apache2 - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_inline" -# PROP BASE Intermediate_Dir "Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_APACHE2_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib libhttpd.lib libapr.lib libaprutil.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS_inline/php5apache2.dll" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5apache2 - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_APACHE2_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib libhttpd.lib libapr.lib libaprutil.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "php5apache2 - Win32 Release_TS" -# Name "php5apache2 - Win32 Release_TS_inline" -# Name "php5apache2 - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\apache_config.c -# End Source File -# Begin Source File - -SOURCE=.\mod_php5.c -# End Source File -# Begin Source File - -SOURCE=.\php_functions.c -# End Source File -# Begin Source File - -SOURCE=.\sapi_apache2.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_apache.h -# End Source File -# End Group -# End Target -# End Project diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h deleted file mode 100644 index 3d41439170950..0000000000000 --- a/sapi/apache2handler/php_apache.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_APACHE_H -#define PHP_APACHE_H - -#include "httpd.h" -#include "http_config.h" -#include "http_core.h" - -/* Declare this so we can get to it from outside the sapi_apache2.c file */ -extern module AP_MODULE_DECLARE_DATA php5_module; - -/* A way to specify the location of the php.ini dir in an apache directive */ -extern char *apache2_php_ini_path_override; - -/* The server_context used by PHP */ -typedef struct php_struct { - int state; - request_rec *r; - apr_bucket_brigade *brigade; - /* stat structure of the current file */ -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc finfo; -#else - struct stat finfo; -#endif - /* Whether or not we've processed PHP in the output filters yet. */ - int request_processed; - /* final content type */ - char *content_type; -} php_struct; - -void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf); -void *create_php_config(apr_pool_t *p, char *dummy); -char *get_php_config(void *conf, char *name, size_t name_len); -void apply_config(void *); -extern const command_rec php_dir_cmds[]; -void php_ap2_register_hook(apr_pool_t *p); - -#define APR_ARRAY_FOREACH_OPEN(arr, key, val) \ -{ \ - apr_table_entry_t *elts; \ - int i; \ - elts = (apr_table_entry_t *) arr->elts; \ - for (i = 0; i < arr->nelts; i++) { \ - key = elts[i].key; \ - val = elts[i].val; - -#define APR_ARRAY_FOREACH_CLOSE() }} - -typedef struct { - long engine; - long xbithack; - long last_modified; -} php_apache2_info_struct; - -extern zend_module_entry apache2_module_entry; - -#ifdef ZTS -extern int php_apache2_info_id; -#define AP2(v) TSRMG(php_apache2_info_id, php_apache2_info_struct *, v) -#else -extern php_apache2_info_struct php_apache2_info; -#define AP2(v) (php_apache2_info.v) -#endif - - -#endif /* PHP_APACHE_H */ diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c deleted file mode 100644 index b0074b71433bd..0000000000000 --- a/sapi/apache2handler/php_functions.c +++ /dev/null @@ -1,536 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "ext/standard/php_smart_str.h" -#include "ext/standard/info.h" -#include "ext/standard/head.h" -#include "php_ini.h" -#include "SAPI.h" - -#define CORE_PRIVATE -#include "apr_strings.h" -#include "apr_time.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" -#include "ap_mpm.h" -#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE) -#include "unixd.h" -#endif - -#include "php_apache.h" - -#ifdef ZTS -int php_apache2_info_id; -#else -php_apache2_info_struct php_apache2_info; -#endif - -#define SECTION(name) PUTS("

" name "

\n") - -static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - - if (!filename || !ctx || !ctx->r) { - return NULL; - } - - return ap_sub_req_lookup_uri(filename, ctx->r, ctx->r->output_filters); -} - -/* {{{ proto bool virtual(string uri) - Perform an apache sub-request */ -PHP_FUNCTION(virtual) -{ - zval **filename; - request_rec *rr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(filename); - - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - if (rr->status != HTTP_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; - } - - /* Flush everything. */ - php_end_ob_buffers(1 TSRMLS_CC); - php_header(TSRMLS_C); - - /* Ensure that the ap_r* layer for the main request is flushed, to - * work around http://issues.apache.org/bugzilla/show_bug.cgi?id=17629 */ - ap_rflush(rr->main); - - if (ap_run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; - } - ap_destroy_sub_req(rr); - RETURN_TRUE; -} -/* }}} */ - -#define ADD_LONG(name) \ - add_property_long(return_value, #name, rr->name) -#define ADD_TIME(name) \ - add_property_long(return_value, #name, apr_time_sec(rr->name)); -#define ADD_STRING(name) \ - if (rr->name) add_property_string(return_value, #name, (char *) rr->name, 1) - -PHP_FUNCTION(apache_lookup_uri) -{ - request_rec *rr; - zval **filename; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(filename); - - if (!(rr = php_apache_lookup_uri(Z_STRVAL_PP(filename) TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - if (rr->status == HTTP_OK) { - object_init(return_value); - - ADD_LONG(status); - ADD_STRING(the_request); - ADD_STRING(status_line); - ADD_STRING(method); - ADD_TIME(mtime); - ADD_LONG(clength); -#if MODULE_MAGIC_NUMBER < 20020506 - ADD_STRING(boundary); -#endif - ADD_STRING(range); - ADD_LONG(chunked); - ADD_STRING(content_type); - ADD_STRING(handler); - ADD_LONG(no_cache); - ADD_LONG(no_local_copy); - ADD_STRING(unparsed_uri); - ADD_STRING(uri); - ADD_STRING(filename); - ADD_STRING(path_info); - ADD_STRING(args); - ADD_LONG(allowed); - ADD_LONG(sent_bodyct); - ADD_LONG(bytes_sent); - ADD_LONG(mtime); - ADD_TIME(request_time); - - ap_destroy_sub_req(rr); - return; - } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", Z_STRVAL_PP(filename)); - ap_destroy_sub_req(rr); - RETURN_FALSE; -} - -/* {{{ proto array getallheaders(void) - Fetch all HTTP request headers */ -PHP_FUNCTION(apache_request_headers) -{ - php_struct *ctx; - const apr_array_header_t *arr; - char *key, *val; - - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - - ctx = SG(server_context); - arr = apr_table_elts(ctx->r->headers_in); - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - add_assoc_string(return_value, key, val, 1); - APR_ARRAY_FOREACH_CLOSE() -} -/* }}} */ - -/* {{{ proto array apache_response_headers(void) - Fetch all HTTP response headers */ -PHP_FUNCTION(apache_response_headers) -{ - php_struct *ctx; - const apr_array_header_t *arr; - char *key, *val; - - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - - ctx = SG(server_context); - arr = apr_table_elts(ctx->r->headers_out); - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) val = ""; - add_assoc_string(return_value, key, val, 1); - APR_ARRAY_FOREACH_CLOSE() -} -/* }}} */ - -/* {{{ proto string apache_note(string note_name [, string note_value]) - Get and set Apache request notes */ -PHP_FUNCTION(apache_note) -{ - php_struct *ctx; - zval **note_name, **note_val; - char *old_note_val=NULL; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, ¬e_name, ¬e_val) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - convert_to_string_ex(note_name); - - old_note_val = (char *) apr_table_get(ctx->r->notes, Z_STRVAL_PP(note_name)); - - if (arg_count == 2) { - convert_to_string_ex(note_val); - apr_table_set(ctx->r->notes, Z_STRVAL_PP(note_name), Z_STRVAL_PP(note_val)); - } - - if (old_note_val) { - RETURN_STRING(old_note_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top]) - Set an Apache subprocess_env variable */ -/* - * XXX this doesn't look right. shouldn't it be the parent ?*/ -PHP_FUNCTION(apache_setenv) -{ - php_struct *ctx; - zval **variable=NULL, **string_val=NULL, **walk_to_top=NULL; - int arg_count = ZEND_NUM_ARGS(); - request_rec *r; - - if (arg_count < 2 || arg_count > 3 || - zend_get_parameters_ex(arg_count, &variable, &string_val, &walk_to_top) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - r = ctx->r; - if (arg_count == 3) { - convert_to_boolean_ex(walk_to_top); - if (Z_LVAL_PP(walk_to_top)) { - while(r->prev) { - r = r->prev; - } - } - } - - convert_to_string_ex(variable); - convert_to_string_ex(string_val); - - apr_table_set(r->subprocess_env, Z_STRVAL_PP(variable), Z_STRVAL_PP(string_val)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool apache_getenv(string variable [, bool walk_to_top]) - Get an Apache subprocess_env variable */ -/* - * XXX: shouldn't this be the parent not the 'prev' - */ -PHP_FUNCTION(apache_getenv) -{ - php_struct *ctx; - zval **variable=NULL, **walk_to_top=NULL; - int arg_count = ZEND_NUM_ARGS(); - char *env_val=NULL; - request_rec *r; - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, &variable, &walk_to_top) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ctx = SG(server_context); - - r = ctx->r; - if (arg_count == 2) { - convert_to_boolean_ex(walk_to_top); - if (Z_LVAL_PP(walk_to_top)) { - while(r->prev) { - r = r->prev; - } - } - } - - convert_to_string_ex(variable); - - env_val = (char*) apr_table_get(r->subprocess_env, Z_STRVAL_PP(variable)); - if (env_val != NULL) { - RETURN_STRING(env_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -static char *php_apache_get_version() -{ -#if MODULE_MAGIC_NUMBER_MAJOR >= 20060905 - return (char *) ap_get_server_banner(); -#else - return (char *) ap_get_server_version(); -#endif -} - -/* {{{ proto string apache_get_version(void) - Fetch Apache version */ -PHP_FUNCTION(apache_get_version) -{ - char *apv = php_apache_get_version(); - - if (apv && *apv) { - RETURN_STRING(apv, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array apache_get_modules(void) - Get a list of loaded Apache modules */ -PHP_FUNCTION(apache_get_modules) -{ - int n; - char *p; - - array_init(return_value); - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - add_next_index_stringl(return_value, s, (p - s), 1); - } else { - add_next_index_string(return_value, s, 1); - } - } -} -/* }}} */ - -PHP_MINFO_FUNCTION(apache) -{ - char *apv = php_apache_get_version(); - smart_str tmp1 = {0}; - char tmp[1024]; - int n, max_requests; - char *p; - server_rec *serv = ((php_struct *) SG(server_context))->r->server; -#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE) - AP_DECLARE_DATA extern unixd_config_rec unixd_config; -#endif - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - smart_str_appendl(&tmp1, s, (p - s)); - } else { - smart_str_appends(&tmp1, s); - } - smart_str_appendc(&tmp1, ' '); - } - if ((tmp1.len - 1) >= 0) { - tmp1.c[tmp1.len - 1] = '\0'; - } - - php_info_print_table_start(); - if (apv && *apv) { - php_info_print_table_row(2, "Apache Version", apv); - } - snprintf(tmp, sizeof(tmp), "%d", MODULE_MAGIC_NUMBER); - php_info_print_table_row(2, "Apache API Version", tmp); - - if (serv->server_admin && *(serv->server_admin)) { - php_info_print_table_row(2, "Server Administrator", serv->server_admin); - } - - snprintf(tmp, sizeof(tmp), "%s:%u", serv->server_hostname, serv->port); - php_info_print_table_row(2, "Hostname:Port", tmp); - -#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE) - snprintf(tmp, sizeof(tmp), "%s(%d)/%d", unixd_config.user_name, unixd_config.user_id, unixd_config.group_id); - php_info_print_table_row(2, "User/Group", tmp); -#endif - - ap_mpm_query(AP_MPMQ_MAX_REQUESTS_DAEMON, &max_requests); - snprintf(tmp, sizeof(tmp), "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests, (serv->keep_alive ? "on":"off"), serv->keep_alive_max); - php_info_print_table_row(2, "Max Requests", tmp); - - apr_snprintf(tmp, sizeof tmp, - "Connection: %" APR_TIME_T_FMT " - Keep-Alive: %" APR_TIME_T_FMT, - apr_time_sec(serv->timeout), apr_time_sec(serv->keep_alive_timeout)); - php_info_print_table_row(2, "Timeouts", tmp); - - php_info_print_table_row(2, "Virtual Server", (serv->is_virtual ? "Yes" : "No")); - php_info_print_table_row(2, "Server Root", ap_server_root); - php_info_print_table_row(2, "Loaded Modules", tmp1.c); - - smart_str_free(&tmp1); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - - { - const apr_array_header_t *arr = apr_table_elts(((php_struct *) SG(server_context))->r->subprocess_env); - char *key, *val; - - SECTION("Apache Environment"); - php_info_print_table_start(); - php_info_print_table_header(2, "Variable", "Value"); - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) { - val = ""; - } - php_info_print_table_row(2, key, val); - APR_ARRAY_FOREACH_CLOSE() - - php_info_print_table_end(); - - SECTION("HTTP Headers Information"); - php_info_print_table_start(); - php_info_print_table_colspan_header(2, "HTTP Request Headers"); - php_info_print_table_row(2, "HTTP Request", ((php_struct *) SG(server_context))->r->the_request); - - arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_in); - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) { - val = ""; - } - php_info_print_table_row(2, key, val); - APR_ARRAY_FOREACH_CLOSE() - - php_info_print_table_colspan_header(2, "HTTP Response Headers"); - arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_out); - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) { - val = ""; - } - php_info_print_table_row(2, key, val); - APR_ARRAY_FOREACH_CLOSE() - - php_info_print_table_end(); - } -} - -static zend_function_entry apache_functions[] = { - PHP_FE(apache_lookup_uri, NULL) - PHP_FE(virtual, NULL) - PHP_FE(apache_request_headers, NULL) - PHP_FE(apache_response_headers, NULL) - PHP_FE(apache_setenv, NULL) - PHP_FE(apache_getenv, NULL) - PHP_FE(apache_note, NULL) - PHP_FE(apache_get_version, NULL) - PHP_FE(apache_get_modules, NULL) - PHP_FALIAS(getallheaders, apache_request_headers, NULL) - {NULL, NULL, NULL} -}; - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateLong, xbithack, php_apache2_info_struct, php_apache2_info) - STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateLong, engine, php_apache2_info_struct, php_apache2_info) - STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateLong, last_modified, php_apache2_info_struct, php_apache2_info) -PHP_INI_END() - -static PHP_MINIT_FUNCTION(apache) -{ -#ifdef ZTS - ts_allocate_id(&php_apache2_info_id, sizeof(php_apache2_info_struct), (ts_allocate_ctor) NULL, NULL); -#endif - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - -static PHP_MSHUTDOWN_FUNCTION(apache) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -zend_module_entry php_apache_module = { - STANDARD_MODULE_HEADER, - "apache2handler", - apache_functions, - PHP_MINIT(apache), - PHP_MSHUTDOWN(apache), - NULL, - NULL, - PHP_MINFO(apache), - NULL, - STANDARD_MODULE_PROPERTIES -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c deleted file mode 100644 index 2b58775b6c608..0000000000000 --- a/sapi/apache2handler/sapi_apache2.c +++ /dev/null @@ -1,683 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Sascha Schumann | - | Parts based on Apache 1.3 SAPI module by | - | Rasmus Lerdorf and Zeev Suraski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_main.h" -#include "php_ini.h" -#include "php_variables.h" -#include "SAPI.h" - -#include - -#include "ext/standard/php_smart_str.h" -#ifndef NETWARE -#include "ext/standard/php_standard.h" -#else -#include "ext/standard/basic_functions.h" -#endif - -#include "apr_strings.h" -#include "ap_config.h" -#include "util_filter.h" -#include "httpd.h" -#include "http_config.h" -#include "http_request.h" -#include "http_core.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "http_core.h" -#include "ap_mpm.h" - -#include "php_apache.h" - -/* UnixWare and Netware define shutdown to _shutdown, which causes problems later - * on when using a structure member named shutdown. Since this source - * file does not use the system call shutdown, it is safe to #undef it.K - */ -#undef shutdown - -#define PHP_MAGIC_TYPE "application/x-httpd-php" -#define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php-source" -#define PHP_SCRIPT "php5-script" - -/* A way to specify the location of the php.ini dir in an apache directive */ -char *apache2_php_ini_path_override = NULL; - -static int -php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - request_rec *r; - php_struct *ctx; - - ctx = SG(server_context); - r = ctx->r; - - if (ap_rwrite(str, str_length, r) < 0) { - php_handle_aborted_connection(); - } - - return str_length; /* we always consume all the data passed to us. */ -} - -static int -php_apache_sapi_header_handler(sapi_header_struct *sapi_header,sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - php_struct *ctx; - char *val, *ptr; - - ctx = SG(server_context); - - val = strchr(sapi_header->header, ':'); - - if (!val) { - sapi_free_header(sapi_header); - return 0; - } - ptr = val; - - *val = '\0'; - - do { - val++; - } while (*val == ' '); - - if (!strcasecmp(sapi_header->header, "content-type")) { - if (ctx->content_type) { - efree(ctx->content_type); - } - ctx->content_type = estrdup(val); - } else if (sapi_header->replace) { - apr_table_set(ctx->r->headers_out, sapi_header->header, val); - } else { - apr_table_add(ctx->r->headers_out, sapi_header->header, val); - } - *ptr = ':'; - - return SAPI_HEADER_ADD; -} - -static int -php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const char *sline = SG(sapi_headers).http_status_line; - - ctx->r->status = SG(sapi_headers).http_response_code; - - /* httpd requires that r->status_line is set to the first digit of - * the status-code: */ - if (sline && strlen(sline) > 12 && strncmp(sline, "HTTP/1.", 7) == 0 && sline[8] == ' ') { - ctx->r->status_line = apr_pstrdup(ctx->r->pool, sline + 9); - ctx->r->proto_num = 1000 + (sline[7]-'0'); - if ((sline[7]-'0') == 0) { - apr_table_set(ctx->r->subprocess_env, "force-response-1.0", "true"); - } - } - - /* call ap_set_content_type only once, else each time we call it, - configured output filters for that content type will be added */ - if (!ctx->content_type) { - ctx->content_type = sapi_get_default_content_type(TSRMLS_C); - } - ap_set_content_type(ctx->r, apr_pstrdup(ctx->r->pool, ctx->content_type)); - efree(ctx->content_type); - ctx->content_type = NULL; - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int -php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - apr_size_t len, tlen=0; - php_struct *ctx = SG(server_context); - request_rec *r; - apr_bucket_brigade *brigade; - - r = ctx->r; - brigade = ctx->brigade; - len = count_bytes; - - /* - * This loop is needed because ap_get_brigade() can return us partial data - * which would cause premature termination of request read. Therefor we - * need to make sure that if data is available we fill the buffer completely. - */ - - while (ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len) == APR_SUCCESS) { - apr_brigade_flatten(brigade, buf, &len); - apr_brigade_cleanup(brigade); - tlen += len; - if (tlen == count_bytes || !len) { - break; - } - buf += len; - len = count_bytes - tlen; - } - - return tlen; -} - -static struct stat* -php_apache_sapi_get_stat(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - - ctx->finfo.st_uid = ctx->r->finfo.user; - ctx->finfo.st_gid = ctx->r->finfo.group; - ctx->finfo.st_dev = ctx->r->finfo.device; - ctx->finfo.st_ino = ctx->r->finfo.inode; -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - ctx->finfo.st_atime.tv_sec = apr_time_sec(ctx->r->finfo.atime); - ctx->finfo.st_mtime.tv_sec = apr_time_sec(ctx->r->finfo.mtime); - ctx->finfo.st_ctime.tv_sec = apr_time_sec(ctx->r->finfo.ctime); -#else - ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime); - ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime); - ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime); -#endif - - ctx->finfo.st_size = ctx->r->finfo.size; - ctx->finfo.st_nlink = ctx->r->finfo.nlink; - - return &ctx->finfo; -} - -static char * -php_apache_sapi_read_cookies(TSRMLS_D) -{ - php_struct *ctx = SG(server_context); - const char *http_cookie; - - http_cookie = apr_table_get(ctx->r->headers_in, "cookie"); - - /* The SAPI interface should use 'const char *' */ - return (char *) http_cookie; -} - -static char * -php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const char *env_var; - - env_var = apr_table_get(ctx->r->subprocess_env, name); - - return (char *) env_var; -} - -static void -php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) -{ - php_struct *ctx = SG(server_context); - const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); - char *key, *val; - int new_val_len; - - APR_ARRAY_FOREACH_OPEN(arr, key, val) - if (!val) { - val = ""; - } - if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len TSRMLS_CC)) { - php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC); - } - APR_ARRAY_FOREACH_CLOSE() - - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC); - } -} - -static void -php_apache_sapi_flush(void *server_context) -{ - php_struct *ctx; - request_rec *r; - TSRMLS_FETCH(); - - ctx = server_context; - - /* If we haven't registered a server_context yet, - * then don't bother flushing. */ - if (!server_context) { - return; - } - - r = ctx->r; - - sapi_send_headers(TSRMLS_C); - - r->status = SG(sapi_headers).http_response_code; - SG(headers_sent) = 1; - - if (ap_rflush(r) < 0 || r->connection->aborted) { - php_handle_aborted_connection(); - } -} - -static void php_apache_sapi_log_message(char *msg) -{ - php_struct *ctx; - TSRMLS_FETCH(); - - ctx = SG(server_context); - - if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */ - ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg); - } else { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, "%s", msg); - } -} - -static void php_apache_sapi_log_message_ex(char *msg, request_rec *r) -{ - if (r) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, msg, r->filename); - } else { - php_apache_sapi_log_message(msg); - } -} - -static time_t php_apache_sapi_get_request_time(TSRMLS_D) { - php_struct *ctx = SG(server_context); - return apr_time_sec(ctx->r->request_time); -} - -extern zend_module_entry php_apache_module; - -static int php_apache2_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_apache_module, 1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - -static sapi_module_struct apache2_sapi_module = { - "apache2handler", - "Apache 2.0 Handler", - - php_apache2_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - php_apache_sapi_ub_write, /* unbuffered write */ - php_apache_sapi_flush, /* flush */ - php_apache_sapi_get_stat, /* get uid */ - php_apache_sapi_getenv, /* getenv */ - - php_error, /* error handler */ - - php_apache_sapi_header_handler, /* header handler */ - php_apache_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - php_apache_sapi_read_post, /* read POST data */ - php_apache_sapi_read_cookies, /* read Cookies */ - - php_apache_sapi_register_variables, - php_apache_sapi_log_message, /* Log message */ - php_apache_sapi_get_request_time, /* Request Time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static apr_status_t php_apache_server_shutdown(void *tmp) -{ - apache2_sapi_module.shutdown(&apache2_sapi_module); - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - return APR_SUCCESS; -} - -static apr_status_t php_apache_child_shutdown(void *tmp) -{ - apache2_sapi_module.shutdown(&apache2_sapi_module); -#if defined(ZTS) && !defined(PHP_WIN32) - tsrm_shutdown(); -#endif - return APR_SUCCESS; -} - -static void php_apache_add_version(apr_pool_t *p) -{ - TSRMLS_FETCH(); - if (PG(expose_php)) { - ap_add_version_component(p, "PHP/" PHP_VERSION); - } -} - -static int php_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) -{ -#ifndef ZTS - int threaded_mpm; - - ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded_mpm); - if(threaded_mpm) { - ap_log_error(APLOG_MARK, APLOG_CRIT, 0, 0, "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP."); - return DONE; - } -#endif - /* When this is NULL, apache won't override the hard-coded default - * php.ini path setting. */ - apache2_php_ini_path_override = NULL; - return OK; -} - -static int -php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) -{ - void *data = NULL; - const char *userdata_key = "apache2hook_post_config"; - - /* Apache will load, unload and then reload a DSO module. This - * prevents us from starting PHP until the second load. */ - apr_pool_userdata_get(&data, userdata_key, s->process->pool); - if (data == NULL) { - /* We must use set() here and *not* setn(), otherwise the - * static string pointed to by userdata_key will be mapped - * to a different location when the DSO is reloaded and the - * pointers won't match, causing get() to return NULL when - * we expected it to return non-NULL. */ - apr_pool_userdata_set((const void *)1, userdata_key, apr_pool_cleanup_null, s->process->pool); - return OK; - } - - /* Set up our overridden path. */ - if (apache2_php_ini_path_override) { - apache2_sapi_module.php_ini_path_override = apache2_php_ini_path_override; - } -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache2_sapi_module); - apache2_sapi_module.startup(&apache2_sapi_module); - apr_pool_cleanup_register(pconf, NULL, php_apache_server_shutdown, apr_pool_cleanup_null); - php_apache_add_version(pconf); - - return OK; -} - -static apr_status_t php_server_context_cleanup(void *data_) -{ - void **data = data_; - *data = NULL; - return APR_SUCCESS; -} - -static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC) -{ - char *content_length; - const char *auth; - - SG(sapi_headers).http_response_code = !r->status ? HTTP_OK : r->status; - SG(request_info).content_type = apr_table_get(r->headers_in, "Content-Type"); - SG(request_info).query_string = apr_pstrdup(r->pool, r->args); - SG(request_info).request_method = r->method; - SG(request_info).proto_num = r->proto_num; - SG(request_info).request_uri = apr_pstrdup(r->pool, r->uri); - SG(request_info).path_translated = apr_pstrdup(r->pool, r->filename); - r->no_local_copy = 1; - - content_length = (char *) apr_table_get(r->headers_in, "Content-Length"); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - - apr_table_unset(r->headers_out, "Content-Length"); - apr_table_unset(r->headers_out, "Last-Modified"); - apr_table_unset(r->headers_out, "Expires"); - apr_table_unset(r->headers_out, "ETag"); - if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(r))) { - auth = apr_table_get(r->headers_in, "Authorization"); - php_handle_auth_data(auth TSRMLS_CC); - if (SG(request_info).auth_user == NULL && r->user) { - SG(request_info).auth_user = estrdup(r->user); - } - ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); - } else { - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - } - return php_request_startup(TSRMLS_C); -} - -static void php_apache_request_dtor(request_rec *r TSRMLS_DC) -{ - php_request_shutdown(NULL); -} - -static void php_apache_ini_dtor(request_rec *r, request_rec *p TSRMLS_DC) -{ - if (strcmp(r->protocol, "INCLUDED")) { - zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try(); - } else { -typedef struct { - HashTable config; -} php_conf_rec; - char *str; - uint str_len; - php_conf_rec *c = ap_get_module_config(r->per_dir_config, &php5_module); - - for (zend_hash_internal_pointer_reset(&c->config); - zend_hash_get_current_key_ex(&c->config, &str, &str_len, NULL, 0, NULL) == HASH_KEY_IS_STRING; - zend_hash_move_forward(&c->config) - ) { - zend_restore_ini_entry(str, str_len, ZEND_INI_STAGE_SHUTDOWN); - } - } - if (p) { - ((php_struct *)SG(server_context))->r = p; - } else { - apr_pool_cleanup_run(r->pool, (void *)&SG(server_context), php_server_context_cleanup); - } -} - -static int php_handler(request_rec *r) -{ - php_struct * volatile ctx; - void *conf; - apr_bucket_brigade * volatile brigade; - apr_bucket *bucket; - apr_status_t rv; - request_rec * volatile parent_req = NULL; - TSRMLS_FETCH(); - -#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC); - - conf = ap_get_module_config(r->per_dir_config, &php5_module); - - /* apply_config() needs r in some cases, so allocate server_context early */ - ctx = SG(server_context); - if (ctx == NULL || (ctx && ctx->request_processed && !strcmp(r->protocol, "INCLUDED"))) { -normal: - ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx)); - /* register a cleanup so we clear out the SG(server_context) - * after each request. Note: We pass in the pointer to the - * server_context in case this is handled by a different thread. - */ - apr_pool_cleanup_register(r->pool, (void *)&SG(server_context), php_server_context_cleanup, apr_pool_cleanup_null); - ctx->r = r; - ctx = NULL; /* May look weird to null it here, but it is to catch the right case in the first_try later on */ - } else { - parent_req = ctx->r; - ctx->r = r; - } - apply_config(conf); - - if (strcmp(r->handler, PHP_MAGIC_TYPE) && strcmp(r->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(r->handler, PHP_SCRIPT)) { - /* Check for xbithack in this case. */ - if (!AP2(xbithack) || strcmp(r->handler, "text/html") || !(r->finfo.protection & APR_UEXECUTE)) { - PHPAP_INI_OFF; - return DECLINED; - } - } - - /* Give a 404 if PATH_INFO is used but is explicitly disabled in - * the configuration; default behaviour is to accept. */ - if (r->used_path_info == AP_REQ_REJECT_PATH_INFO - && r->path_info && r->path_info[0]) { - PHPAP_INI_OFF; - return HTTP_NOT_FOUND; - } - - /* handle situations where user turns the engine off */ - if (!AP2(engine)) { - PHPAP_INI_OFF; - return DECLINED; - } - - if (r->finfo.filetype == 0) { - php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r); - PHPAP_INI_OFF; - return HTTP_NOT_FOUND; - } - if (r->finfo.filetype == APR_DIR) { - php_apache_sapi_log_message_ex("attempt to invoke directory '%s' as script", r); - PHPAP_INI_OFF; - return HTTP_FORBIDDEN; - } - - /* Setup the CGI variables if this is the main request */ - if (r->main == NULL || - /* .. or if the sub-request environment differs from the main-request. */ - r->subprocess_env != r->main->subprocess_env - ) { - /* setup standard CGI variables */ - ap_add_common_vars(r); - ap_add_cgi_vars(r); - } - -zend_first_try { - - if (ctx == NULL) { - brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc); - ctx = SG(server_context); - ctx->brigade = brigade; - - if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) { - zend_bailout(); - } - } else { - if (!parent_req) { - parent_req = ctx->r; - } - if (parent_req && parent_req->handler && - strcmp(parent_req->handler, PHP_MAGIC_TYPE) && - strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && - strcmp(parent_req->handler, PHP_SCRIPT)) { - if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) { - zend_bailout(); - } - } - - /* - * check if comming due to ErrorDocument - * We make a special exception of 413 (Invalid POST request) as the invalidity of the request occurs - * during processing of the request by PHP during POST processing. Therefor we need to re-use the exiting - * PHP instance to handle the request rather then creating a new one. - */ - if (parent_req && parent_req->status != HTTP_OK && parent_req->status != 413 && strcmp(r->protocol, "INCLUDED")) { - parent_req = NULL; - goto normal; - } - ctx->r = r; - brigade = ctx->brigade; - } - - if (AP2(last_modified)) { - ap_update_mtime(r, r->finfo.mtime); - ap_set_last_modified(r); - } - - /* Determine if we need to parse the file or show the source */ - if (strncmp(r->handler, PHP_SOURCE_MAGIC_TYPE, sizeof(PHP_SOURCE_MAGIC_TYPE) - 1) == 0) { - zend_syntax_highlighter_ini syntax_highlighter_ini; - php_get_highlight_struct(&syntax_highlighter_ini); - highlight_file((char *)r->filename, &syntax_highlighter_ini TSRMLS_CC); - } else { - zend_file_handle zfd; - - zfd.type = ZEND_HANDLE_FILENAME; - zfd.filename = (char *) r->filename; - zfd.free_filename = 0; - zfd.opened_path = NULL; - - if (!parent_req) { - php_execute_script(&zfd TSRMLS_CC); - } else { - zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &zfd); - } - - apr_table_set(r->notes, "mod_php_memory_usage", - apr_psprintf(ctx->r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC))); - } - -} zend_end_try(); - - if (!parent_req) { - php_apache_request_dtor(r TSRMLS_CC); - ctx->request_processed = 1; - bucket = apr_bucket_eos_create(r->connection->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(brigade, bucket); - - rv = ap_pass_brigade(r->output_filters, brigade); - if (rv != APR_SUCCESS || r->connection->aborted) { -zend_first_try { - php_handle_aborted_connection(); -} zend_end_try(); - } - apr_brigade_cleanup(brigade); - } else { - ctx->r = parent_req; - } - - return OK; -} - -static void php_apache_child_init(apr_pool_t *pchild, server_rec *s) -{ - apr_pool_cleanup_register(pchild, NULL, php_apache_child_shutdown, apr_pool_cleanup_null); -} - -void php_ap2_register_hook(apr_pool_t *p) -{ - ap_hook_pre_config(php_pre_config, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_handler(php_handler, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_child_init(php_apache_child_init, NULL, NULL, APR_HOOK_MIDDLE); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache_hooks/CREDITS b/sapi/apache_hooks/CREDITS deleted file mode 100644 index 86ac27d0b7332..0000000000000 --- a/sapi/apache_hooks/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Apache 1.3 (apache_hooks) -Rasmus Lerdorf, Zeev Suraski, Stig Bakken, David Sklar, George Schlossnagle, Lukas Schroeder diff --git a/sapi/apache_hooks/README b/sapi/apache_hooks/README deleted file mode 100644 index 9a5a3e2b64423..0000000000000 --- a/sapi/apache_hooks/README +++ /dev/null @@ -1,206 +0,0 @@ -This is very beta documentation. Clearly better stuff can and will follow. - -INTRO: - -apache_hooks is a full super-set enhancement of the apache 1.3 sapi that allows for -php code to be run on the apache request object at every stage of the apache -request. It supports all of the apache 1.3 sapi commands and configurations, and -additionally supports the following httpd.conf directives: - - -HTTPD.CONF DIRECTIEVS: - -phpRequire /path/to/file = requires a file at the beginning of an -initial apache request - -phpUriHandler /path/to/file = registers a hook that will run the -specified file at the uri translation stage of the apache request -phpUriHandler Class::Method = registers a hook to run Class::Method at -the uri translation stage of the apache request - -phpPostReadHandler /path/to/file = hook for post-read phase -phpPostReadHandlerMethod Class::Method - -phpHeaderHandler = hook for header parsing phase -phpHeaderHandlerMethod - -phpAuthHandler = hook for authentication phase -phpAuthHandlerMethod - -phpAccessHandler = hook for access control phase -phpAccessHandlerMethod - -phpTypeHandler = hook for Type Checking phase -phpTypeHandlerMethod - -phpFixupHandler = hook for 'fixup' phase -phpFixupHandlerMethod - -phpLoggerHandler = hook for logging phase -phpLoggerHandlerMethod - -AddHandler php-script = set's up a special type handler -phpResponseHandler /path/to/file = sets file to be called to handle -response phase -phpResponseHandlerMethod Class::Method - - -All handlers may be stacked, i.e. you can list multiple handler directives -in a single scope and they will be run in order. - - -EXAMPLES: - -So, to set up a 'hello world' location handler (so that any request to -/hello/* returns hello world) you can: - -phpRequire /tmp/setup.php - -AddHandler php-script -phpResponseHandlerMethod Hello::World - - -with -#/tmp/setup.php -send_http_header(); - echo "Hello World"; - } -} -?> - -$request is the apache request. It is instantiated at all stages -automatically. The methods of that class are: - -getallheaders -args -boundary -content_encoding -content_type -filename -handler -hostname -method -path_info -protocol -status_line -the_request -unparsed_uri -uri -allowed -bytes_sent -chunked -content_length -header_only -method_number -mtime -no_cache -no_local_copy -proto_num -proxyreq -read_body -remaining -request_time -status -headers_in -headers_out -err_headers_out -auth_name -auth_type -basic_auth_pw -discard_request_body -is_initial_req -meets_conditions -remote_host -satisfies -server_port -set_etag -set_last_modified -some_auth_required -update_mtime -send_http_header -basic_http_header -send_header_field -send_http_trace -send_http_options -send_error_response -set_content_length -set_keepalive -rputs -log_error -lookup_uri -lookup_file -method_uri -run -internal_redirect - - -These all wrap the ap_* apache EXPORT_API functions using the same -semantics (and are also the same as the Apache::Request methods in -mod_perl if you are familiar with that) - -So, a uri handler to redirect all non-local traffic to /404.php (an -error page) would be - -phpUriHandler /tmp/uri.php - -#/tmp/uri.php -uri('/404.php'); - } - return OK; -?> - -It's important to note that since this is called from the uri -translations phase, this validation is performed for every request to -the server, not just for php pages. - -Also, scope is shared between all the hooks. So in the above, we could -merge the two and do something like: - -#/tmp/uri.php - - -and then: - -#/tmp/setup.php -send_http_header(); - echo "Hello $whoami"; - } -} -?> - -These variables are also in the same scope as a script if your script is -being handled by the standard application/x-httpd-php handler. - -This allows you to make decisions and pass data between your handlers -and scripts at all stages. - -The above are clearly trite examples, but hopefully give you a starting -point. - -One note: all handlers can be validly re-entered 'in sub-requests'. -For this reason you should not define functions/classes here without -anti-redefinition guards (I would just recommend putting them in an -include and using include_one). This is not true for phpRequire, which -is only entered once, at the main request, and so it is safe to make -function/class declarations there (in fact that's what it's for). - -Hope that helps! diff --git a/sapi/apache_hooks/apMakefile.libdir b/sapi/apache_hooks/apMakefile.libdir deleted file mode 100644 index 7b5254013a3b6..0000000000000 --- a/sapi/apache_hooks/apMakefile.libdir +++ /dev/null @@ -1,4 +0,0 @@ -This is a place-holder which indicates to Configure that it shouldn't -provide the default targets when building the Makefile in this directory. -Instead it'll just prepend all the important variable definitions, and -copy the Makefile.tmpl onto the end. diff --git a/sapi/apache_hooks/apMakefile.tmpl b/sapi/apache_hooks/apMakefile.tmpl deleted file mode 100644 index 4054e8e119533..0000000000000 --- a/sapi/apache_hooks/apMakefile.tmpl +++ /dev/null @@ -1,77 +0,0 @@ -## -## Apache 1.3 Makefile template for PHP 4.0 Module -## [src/modules/php5/Makefile.tmpl] -## - -# the parametrized target -LIB=libphp5.$(LIBEXT) - -# objects for building the static library -OBJS=mod_php5.o -OBJS_LIB=libmodphp5.a - -# objects for building the shared object library -SHLIB_OBJS=mod_php5.so-o -SHLIB_OBJS_LIB=libmodphp5.a - -# the general targets -all: lib -lib: $(LIB) - -# build the static library by merging the object files -libphp5.a: $(OBJS) $(OBJS_LIB) - cp $(OBJS_LIB) $@ - ar r $@ $(OBJS) - $(RANLIB) $@ - -# ugly hack to support older Apache-1.3 betas that don't set $LIBEXT -libphp5.: $(OBJS) $(OBJS_LIB) - cp $(OBJS_LIB) $@ - ar r $@ $(OBJS) - $(RANLIB) $@ - cp libphp5. libphp5.a - -# build the shared object library by linking the object files -libphp5.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) - rm -f $@ - $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) $(PHP_LIBS) - -# 1. extension .o for shared objects cannot be used here because -# first these files aren't still shared objects and second we -# have to use a different name to trigger the different -# implicit Make rule -# 2. extension -so.o (as used elsewhere) cannot be used because -# the suffix feature of Make really wants just .x, so we use -# extension .so-o -.SUFFIXES: .o .so-o -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< -.c.so-o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< && mv $*.o $*.so-o - -# cleanup -clean: - -rm -f $(OBJS) $(SHLIB_OBJS) $(LIB) - -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after -# using it. -depend: - cp Makefile.tmpl Makefile.tmpl.bak \ - && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \ - && gcc -MM $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) *.c >> Makefile.new \ - && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ - > Makefile.tmpl \ - && rm Makefile.new - -#Dependencies - -$(OBJS): Makefile - -# DO NOT REMOVE -mod_php5.o: mod_php5.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \ - $(INCDIR)/buff.h \ - $(INCDIR)/http_config.h \ - $(INCDIR)/http_core.h $(INCDIR)/http_main.h \ - $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \ - $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php5.h diff --git a/sapi/apache_hooks/config.m4 b/sapi/apache_hooks/config.m4 deleted file mode 100644 index 4213b7c6a6013..0000000000000 --- a/sapi/apache_hooks/config.m4 +++ /dev/null @@ -1,275 +0,0 @@ -dnl -dnl $Id$ -dnl -AC_DEFUN([PHP_APACHE_FD_CHECK], [ -AC_CACHE_CHECK([for member fd in BUFF *],ac_cv_php_fd_in_buff,[ - save=$CPPFLAGS - if test -n "$APXS_INCLUDEDIR"; then - CPPFLAGS="$CPPFLAGS -I$APXS_INCLUDEDIR" - else - CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE" - fi - AC_TRY_COMPILE([#include ],[conn_rec *c; int fd = c->client->fd;],[ - ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no]) - CPPFLAGS=$save -]) -if test "$ac_cv_php_fd_in_buff" = "yes"; then - AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD,1,[ ]) -fi -]) - -dnl Apache 1.x shared module -PHP_ARG_WITH(apache-hooks,, -[ --with-apache-hooks[=FILE] - EXPERIMENTAL: Build shared Apache 1.x module. FILE is the optional - pathname to the Apache apxs tool [apxs]], no, no) - -AC_MSG_CHECKING([for Apache 1.x (hooks) module support via DSO through APXS]) - -if test "$PHP_APACHE_HOOKS" != "no"; then - if test "$PHP_APACHE_HOOKS" = "yes"; then - APXS=apxs - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0" && test -x /usr/sbin/apxs; then #SUSE 6.x - APXS=/usr/sbin/apxs - fi - else - PHP_EXPAND_PATH($PHP_APACHE_HOOKS, APXS) - fi - - $APXS -q CFLAGS >/dev/null 2>&1 - if test "$?" != "0"; then - AC_MSG_RESULT() - AC_MSG_RESULT() - AC_MSG_RESULT([Sorry, I was not able to successfully run APXS. Possible reasons:]) - AC_MSG_RESULT() - AC_MSG_RESULT([1. Perl is not installed;]) - AC_MSG_RESULT([2. Apache was not compiled with DSO support (--enable-module=so);]) - AC_MSG_RESULT([3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs]) - AC_MSG_RESULT([The output of $APXS follows]) - $APXS -q CFLAGS - AC_MSG_ERROR([Aborting]) - fi - - APXS_LDFLAGS="@SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@" - APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` - APXS_CFLAGS=`$APXS -q CFLAGS` - APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` - APACHE_INCLUDE=-I$APXS_INCLUDEDIR - - # Test that we're trying to configure with apache 1.x - PHP_AP_EXTRACT_VERSION($APXS_HTTPD) - if test "$APACHE_VERSION" -ge 2000000; then - AC_MSG_ERROR([You have enabled Apache 1.3 support while your server is Apache 2. Please use the appropiate switch --with-apxs2]) - fi - - for flag in $APXS_CFLAGS; do - case $flag in - -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";; - esac - done - - case $host_alias in - *aix*) - APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR` - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - PHP_AIX_LDFLAGS="-Wl,-brtl" - build_type=shared - ;; - *darwin*) - MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD" - PHP_SUBST(MH_BUNDLE_FLAGS) - SAPI_SHARED=libs/libphp5.so - build_type=bundle - ;; - *) - build_type=shared - ;; - esac - - PHP_SELECT_SAPI(apache_hooks, $build_type, sapi_apache.c mod_php5.c php_apache.c, $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR) - - # Test whether apxs support -S option - $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1 - - if test "$?" != "0"; then - APACHE_HOOKS_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option - else - APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR` - if test -z `$APXS -q SYSCONFDIR`; then - APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -i -n php5 $SAPI_SHARED" - else - APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR` - APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \ - \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \ - $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \ - -S SYSCONFDIR='$APXS_SYSCONFDIR' \ - -i -a -n php5 $SAPI_SHARED" - fi - fi - - if test -z "`$APXS -q LD_SHLIB`" || test "`$APXS -q LIBEXECDIR`" = "modules"; then - PHP_APXS_BROKEN=yes - fi - STRONGHOLD= - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) - AC_DEFINE(HAVE_APACHE_HOOKS,1,[ ]) - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi - -dnl Apache 1.x static module -PHP_ARG_WITH(apache-hooks-static,, -[ --with-apache-hooks-static[=DIR] - EXPERIMENTAL: Build Apache 1.x module. DIR is the top-level Apache - build directory [/usr/local/apache]], no, no) - -AC_MSG_CHECKING(for Apache 1.x (hooks) module support) - -if test "$PHP_SAPI" != "apache" && test "$PHP_SAPI" != "apache_hooks" && test "$PHP_APACHE_HOOKS_STATIC" != "no"; then - - if test "$PHP_APACHE_HOOKS_STATIC" = "yes"; then - # Apache's default directory - PHP_APACHE_HOOKS_STATIC=/usr/local/apache - fi - - APACHE_HOOKS_INSTALL_FILES="\$(srcdir)/sapi/apache_hooks/mod_php5.* sapi/apache_hooks/libphp5.module" - - AC_DEFINE(HAVE_APACHE,1,[ ]) - APACHE_HOOKS_MODULE=yes - PHP_EXPAND_PATH($PHP_APACHE_HOOKS_STATIC, PHP_APACHE_HOOKS_STATIC) - # For Apache 1.2.x - if test -f $PHP_APACHE_HOOKS_STATIC/src/httpd.h; then - APACHE_INCLUDE=-I$PHP_APACHE_HOOKS_STATIC/src - APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/src - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET" - PHP_LIBS="-L. -lphp3" - AC_MSG_RESULT([yes - Apache 1.2.x]) - STRONGHOLD= - if test -f $PHP_APACHE_HOOKS_STATIC/src/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) - fi - # For Apache 2.0.x - elif test -f $PHP_APACHE_HOOKS_STATIC/include/httpd.h && test -f $PHP_APACHE_HOOKS_STATIC/srclib/apr/include/apr_general.h ; then - AC_MSG_ERROR([Use --with-apxs2 with Apache 2.x!]) - # For Apache 1.3.x - elif test -f $PHP_APACHE_HOOKS_STATIC/src/main/httpd.h; then - APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$PHP_APACHE_HOOKS_STATIC/src/main -I$PHP_APACHE_HOOKS_STATIC/src/os/unix -I$PHP_APACHE_HOOKS_STATIC/src/ap" - APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/src/modules/php5 - if test ! -d $APACHE_TARGET; then - mkdir $APACHE_TARGET - fi - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - AC_MSG_RESULT([yes - Apache 1.3.x]) - STRONGHOLD= - if test -f $PHP_APACHE_HOOKS_STATIC/src/include/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H, 1, [ ]) - fi - if test -f $PHP_APACHE_HOOKS_STATIC/src/include/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H, 1, [ ]) - if test ! -f $PHP_APACHE_HOOKS_STATIC/src/include/ap_config_auto.h; then - AC_MSG_ERROR([Please run Apache\'s configure or src/Configure program once and try again]) - fi - elif test -f $PHP_APACHE_HOOKS_STATIC/src/include/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H, 1, [ ]) - fi - # Also for Apache 1.3.x - elif test -f $PHP_APACHE_HOOKS_STATIC/src/include/httpd.h; then - APACHE_HAS_REGEX=1 - APACHE_INCLUDE="-I$PHP_APACHE_HOOKS_STATIC/src/include -I$PHP_APACHE_HOOKS_STATIC/src/os/unix" - APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/src/modules/php5 - if test ! -d $APACHE_TARGET; then - mkdir $APACHE_TARGET - fi - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache_hooks/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache_hooks/apMakefile.libdir $APACHE_TARGET/Makefile.libdir" - AC_MSG_RESULT([yes - Apache 1.3.x]) - STRONGHOLD= - if test -f $PHP_APACHE_HOOKS_STATIC/src/include/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H, 1, [ ]) - fi - if test -f $PHP_APACHE_HOOKS_STATIC/src/include/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H, 1, [ ]) - if test ! -f $PHP_APACHE_HOOKS_STATIC/src/include/ap_config_auto.h; then - AC_MSG_ERROR([Please run Apache\'s configure or src/Configure program once and try again]) - fi - elif test -f $PHP_APACHE_HOOKS_STATIC/src/include/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H, 1, [ ]) - fi - # For StrongHold 2.2 - elif test -f $PHP_APACHE_HOOKS_STATIC/apache/httpd.h; then - APACHE_INCLUDE="-I$PHP_APACHE_HOOKS_STATIC/apache -I$PHP_APACHE_HOOKS_STATIC/ssl/include" - APACHE_TARGET=$PHP_APACHE_HOOKS_STATIC/apache - PHP_SELECT_SAPI(apache_hooks, static, sapi_apache.c mod_php5.c php_apache.c, $APACHE_INCLUDE) - PHP_LIBS="-Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5" - APACHE_HOOKS_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp5.a; cp $APACHE_HOOKS_INSTALL_FILES $APACHE_TARGET" - STRONGHOLD=-DSTRONGHOLD=1 - AC_MSG_RESULT([yes - StrongHold]) - if test -f $PHP_APACHE_HOOKS_STATIC/apache/ap_config.h; then - AC_DEFINE(HAVE_AP_CONFIG_H, 1, [ ]) - fi - if test -f $PHP_APACHE_HOOKS_STATIC/src/ap_compat.h; then - AC_DEFINE(HAVE_AP_COMPAT_H, 1, [ ]) - if test ! -f $PHP_APACHE_HOOKS_STATIC/src/include/ap_config_auto.h; then - AC_MSG_ERROR([Please run Apache\'s configure or src/Configure program once and try again]) - fi - elif test -f $PHP_APACHE_HOOKS_STATIC/src/compat.h; then - AC_DEFINE(HAVE_OLD_COMPAT_H, 1, [ ]) - fi - else - AC_MSG_RESULT(no) - AC_MSG_ERROR([Invalid Apache directory - unable to find httpd.h under $PHP_APACHE_HOOKS_STATIC]) - fi -else - AC_MSG_RESULT(no) -fi - -# compatibility -if test -z "$enable_mod_charset" && test "$with_mod_charset"; then - enable_mod_charset=$with_mod_charset -fi - -PHP_ARG_ENABLE(mod-charset, whether to enable Apache charset compatibility option, -[ --enable-mod-charset APACHE (hooks): Enable transfer tables for mod_charset (Rus Apache)], no, no) - -if test "$PHP_MOD_CHARSET" = "yes"; then - AC_DEFINE(USE_TRANSFER_TABLES, 1, [ ]) -fi - -dnl Build as static module -if test "$APACHE_HOOKS_MODULE" = "yes"; then - PHP_TARGET_RDYNAMIC - $php_shtool mkdir -p sapi/apache_hooks - PHP_OUTPUT(sapi/apache_hooks/libphp5.module) -fi - -dnl General -if test -n "$APACHE_HOOKS_INSTALL"; then - if test "x$APXS" != "x" -a "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then - APXS_EXP=-bE:sapi/apache_hooks/mod_php5.exp - fi - - PHP_APACHE_FD_CHECK - INSTALL_IT=$APACHE_HOOKS_INSTALL - - PHP_SUBST(APXS_EXP) - PHP_SUBST(APACHE_INCLUDE) - PHP_SUBST(APACHE_TARGET) - PHP_SUBST(APXS) - PHP_SUBST(APXS_LDFLAGS) - PHP_SUBST(APACHE_HOOKS_INSTALL) - PHP_SUBST(STRONGHOLD) -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/apache_hooks/config.w32 b/sapi/apache_hooks/config.w32 deleted file mode 100644 index 9a4d12508c0b7..0000000000000 --- a/sapi/apache_hooks/config.w32 +++ /dev/null @@ -1,21 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_WITH('apache-hooks', 'Build Apache 1.3.x (hooks) version of PHP', 'no'); - -if (PHP_APACHE_HOOKS != "no") { - if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE_HOOKS", php_usual_include_suspects + - ";" + PROGRAM_FILES + "\\Apache Group\\Apache\\include" + - ";..\\php_build\\apache\\src\\include") && - CHECK_LIB("ApacheCore.lib", "apache_hooks", php_usual_lib_suspects + - ';' + PROGRAM_FILES + '\\Apache Group\\Apache\\libexec' + - ';..\\php_build\\apache\\src\\corer')) { - // We need to play tricks to get our readdir.h used by apache - // headers - SAPI('apache_hooks', 'mod_php5.c sapi_apache.c php_apache.c', - 'php' + PHP_VERSION + 'apache_hooks.dll', - '/D APACHEPHP5_EXPORTS /D APACHE_READDIR_H /I win32'); - } else { - WARNING("Could not find apache libraries/headers"); - } -} diff --git a/sapi/apache_hooks/libphp5.module.in b/sapi/apache_hooks/libphp5.module.in deleted file mode 100644 index 848818189701e..0000000000000 --- a/sapi/apache_hooks/libphp5.module.in +++ /dev/null @@ -1,11 +0,0 @@ -Name: php5_module -ConfigStart - RULE_WANTHSREGEX=no - RULE_HIDE=yes - PHP_LIBS="@NATIVE_RPATHS@ @PHP_LDFLAGS@ @PHP_LIBS@ @EXTRA_LIBS@ $LIBS" - PHP_CFLAGS="$CFLAGS @OPENSSL_INCDIR_OPT@ -I@php_abs_top_builddir@/main -I@php_abs_top_builddir@/Zend -I@php_abs_top_builddir@/TSRM -I@php_abs_top_srcdir@ -I@php_abs_top_srcdir@/sapi/apache -I@php_abs_top_srcdir@/main -I@php_abs_top_srcdir@/Zend -I@php_abs_top_srcdir@/TSRM" - my_outfile="Makefile.config" - echo "PHP_CFLAGS=$PHP_CFLAGS" >>$my_outfile - echo "PHP_LIBS=$PHP_LIBS" >>$my_outfile - LIBS=$PHP_LIBS -ConfigEnd diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c deleted file mode 100644 index 7e73c9902d3dc..0000000000000 --- a/sapi/apache_hooks/mod_php5.c +++ /dev/null @@ -1,1486 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 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/3_01.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: Rasmus Lerdorf | - | (with helpful hints from Dean Gaudet | - | PHP 4.0 patches by Zeev Suraski | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -#ifdef NETWARE -#define SIGPIPE SIGINT -#endif - -#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) -#include "ext/mbstring/mbstring.h" -#endif /* defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) */ - -#undef shutdown - -/* {{{ Prototypes - */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC); -static void php_save_umask(void); -static void php_restore_umask(void); -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC); -static char *sapi_apache_read_cookies(TSRMLS_D); -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC); -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC); -static int send_php(request_rec *r, int display_source_mode, char *filename); -static int send_parsed_php(request_rec * r); -static int send_parsed_php_source(request_rec * r); -static int php_xbithack_handler(request_rec * r); -static void php_init_handler(server_rec *s, pool *p); -/* }}} */ - -#if MODULE_MAGIC_NUMBER >= 19970728 -static void php_child_exit_handler(server_rec *s, pool *p); -#endif - -#if MODULE_MAGIC_NUMBER > 19961007 -#define CONST_PREFIX const -#else -#define CONST_PREFIX -#endif - - -typedef struct _sapi_stack { - int top, max, persistent; - void **elements; -} sapi_stack; - -typedef struct _php_per_dir_config { - HashTable *ini_settings; - sapi_stack headers_handlers; - sapi_stack auth_handlers; - sapi_stack access_handlers; - sapi_stack type_handlers; - sapi_stack fixup_handlers; - sapi_stack logger_handlers; - sapi_stack post_read_handlers; - sapi_stack response_handlers; -} php_per_dir_config; - -typedef struct _php_per_server_config { - sapi_stack uri_handlers; - sapi_stack requires; -} php_per_server_config; - - -static CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); -static CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_admin_value_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2); -static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode); -static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2); - -/* ### these should be defined in mod_php5.h or somewhere else */ -#define USE_PATH 1 -#define IGNORE_URL 2 - -module MODULE_VAR_EXPORT php5_module; - -int saved_umask; -/* static int setup_env = 0; */ -static unsigned char apache_php_initialized; - -typedef struct _php_per_dir_entry { - char *key; - char *value; - uint key_length; - uint value_length; - int type; -} php_per_dir_entry; - -/* some systems are missing these from their header files */ - -/* {{{ zend stack utility functions - */ - -/* This code is ripped part and parcel from zend_stack.[ch]. Assuming that the - patch supporting zend_stack_init_ex is applied, all but the bottom two - module-specific iterators will be removed - */ - -int sapi_stack_init_ex(sapi_stack *stack, int persistent) -{ - stack->top = 0; - stack->persistent = persistent; - stack->elements = (void **) pemalloc(sizeof(void **) * STACK_BLOCK_SIZE, persistent); - if (!stack->elements) { - return FAILURE; - } else { - stack->max = STACK_BLOCK_SIZE; - return SUCCESS; - } -} -int sapi_stack_push(sapi_stack *stack, void *element) -{ - if (stack->top >= stack->max) { /* we need to allocate more memory */ - stack->elements = (void **) perealloc(stack->elements, - (sizeof(void **) * (stack->max += STACK_BLOCK_SIZE)), stack->persistent); - if (!stack->elements) { - return FAILURE; - } - } - stack->elements[stack->top] = (void *) element; - return stack->top++; -} -void* sapi_stack_pop(sapi_stack *stack) { - if(stack->top == 0) { - return NULL; - } - else { - return stack->elements[--stack->top]; - } -} - -int sapi_stack_destroy(sapi_stack *stack) -{ - return SUCCESS; -} - -int sapi_stack_apply_with_argument_all(sapi_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg) -{ - int i, retval; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - retval = apply_function(stack->elements[i], arg); - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - retval = apply_function(stack->elements[i], arg); - } - break; - } - return retval; -} - - -int sapi_stack_apply_with_argument_stop_if_equals(sapi_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg, int stopval) -{ - int i; - int ret = DECLINED; - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if ((ret = apply_function(stack->elements[i], arg)) == stopval) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if ((ret = apply_function(stack->elements[i], arg)) == stopval) { - break; - } - } - break; - } - return ret; -} - -int sapi_stack_apply_with_argument_stop_if_http_error(sapi_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg) -{ - int i; - int ret = DECLINED; - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if ((ret = apply_function(stack->elements[i], arg)) > 0) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if ((ret = apply_function(stack->elements[i], arg)) > 0) { - break; - } - } - break; - } - return ret; -} - -void php_handler_stack_destroy(sapi_stack *stack) -{ - php_handler *ph; - while((ph = (php_handler *)sapi_stack_pop(stack)) != NULL) { - free(ph->name); - free(ph); - } -} -/* }}} */ - -/* {{{ php_save_umask - */ -static void php_save_umask(void) -{ - saved_umask = umask(077); - umask(saved_umask); -} -/* }}} */ - -/* {{{ sapi_apache_ub_write - */ -static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int ret=0; - - if (SG(server_context)) { - ret = rwrite(str, str_length, (request_rec *) SG(server_context)); - } - if (ret != str_length) { - php_handle_aborted_connection(); - } - return ret; -} -/* }}} */ - -/* {{{ sapi_apache_flush - */ -static void sapi_apache_flush(void *server_context) -{ - if (server_context) { -#if MODULE_MAGIC_NUMBER > 19970110 - rflush((request_rec *) server_context); -#else - bflush((request_rec *) server_context->connection->client); -#endif - } -} -/* }}} */ - -/* {{{ sapi_apache_read_post - */ -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - uint total_read_bytes=0, read_bytes; - request_rec *r = (request_rec *) SG(server_context); - void (*handler)(int); - - /* - * This handles the situation where the browser sends a Expect: 100-continue header - * and needs to recieve confirmation from the server on whether or not it can send - * the rest of the request. RFC 2616 - * - */ - if (!SG(read_post_bytes) && !ap_should_client_block(r)) { - return total_read_bytes; - } - - handler = signal(SIGPIPE, SIG_IGN); - while (total_read_bytessubprocess_env, "HTTP_COOKIE"); -} -/* }}} */ - -/* {{{ sapi_apache_header_handler - */ -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - request_rec *r = (request_rec *) SG(server_context); - - header_name = sapi_header->header; - - header_content = p = strchr(header_name, ':'); - if (!p) { - efree(sapi_header->header); - return 0; - } - - *p = 0; - do { - header_content++; - } while (*header_content==' '); - - if (!strcasecmp(header_name, "Content-Type")) { - r->content_type = pstrdup(r->pool, header_content); - } else if (!strcasecmp(header_name, "Set-Cookie")) { - table_add(r->headers_out, header_name, header_content); - } else { - table_set(r->headers_out, header_name, header_content); - } - - *p = ':'; /* a well behaved header handler shouldn't change its original arguments */ - - return SAPI_HEADER_ADD; -} -/* }}} */ - -/* {{{ sapi_apache_send_headers - */ -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - if(SG(server_context) == NULL) { /* server_context is not here anymore */ - return SAPI_HEADER_SEND_FAILED; - } - - ((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code; - /* check that we haven't sent headers already, we use our own - * headers_sent since we may send headers at anytime - */ - if(!AP(headers_sent)) { - send_http_header((request_rec *) SG(server_context)); - AP(headers_sent) = 1; - } - return SAPI_HEADER_SENT_SUCCESSFULLY; -} -/* }}} */ - -/* {{{ sapi_apache_register_server_variables - */ -static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC) -{ - register int i; - array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env); - table_entry *elts = (table_entry *) arr->elts; - zval **path_translated; - HashTable *symbol_table; - - for (i = 0; i < arr->nelts; i++) { - char *val; - - if (elts[i].val) { - val = elts[i].val; - } else { - val = ""; - } - php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC); - } - - /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */ - if (track_vars_array) { - symbol_table = track_vars_array->value.ht; - } else if (PG(register_globals)) { - /* should never happen nowadays */ - symbol_table = EG(active_symbol_table); - } else { - symbol_table = NULL; - } - if (symbol_table - && !zend_hash_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")) - && zend_hash_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated)==SUCCESS) { - php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC); - } - - php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_apache_startup - */ -static int php_apache_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &apache_module_entry, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} -/* }}} */ - -/* {{{ php_apache_log_message - */ -static void php_apache_log_message(char *message) -{ - TSRMLS_FETCH(); - - if (SG(server_context)) { -#if MODULE_MAGIC_NUMBER >= 19970831 - aplog_error(NULL, 0, APLOG_ERR | APLOG_NOERRNO, ((request_rec *) SG(server_context))->server, "%s", message); -#else - log_error(message, ((request_rec *) SG(server_context))->server); -#endif - } else { - fprintf(stderr, "%s", message); - fprintf(stderr, "\n"); - } -} -/* }}} */ - -/* {{{ php_apache_request_shutdown - */ -static void php_apache_request_shutdown(void *dummy) -{ - TSRMLS_FETCH(); - AP(current_hook) = AP_CLEANUP; - php_output_set_status(0 TSRMLS_CC); - SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */ - if(SG(sapi_started)) { - php_request_shutdown(dummy); - SG(sapi_started) = 0; - } - AP(in_request) = 0; - if(AP(setup_env)) { - AP(setup_env) = 0; - } - AP(current_hook) = AP_WAITING_FOR_REQUEST; - AP(headers_sent) = 0; -} -/* }}} */ - -/* {{{ php_apache_sapi_activate - */ -static int php_apache_sapi_activate(TSRMLS_D) -{ - request_rec *r = (request_rec *) SG(server_context); - - /* - * For the Apache module version, this bit of code registers a cleanup - * function that gets triggered when our request pool is destroyed. - * We need this because at any point in our code we can be interrupted - * and that may happen before we have had time to free our memory. - * The php_request_shutdown function needs to free all outstanding allocated - * memory. - */ - block_alarms(); - register_cleanup(r->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec); - AP(in_request)=1; - unblock_alarms(); - - /* Override the default headers_only value - sometimes "GET" requests should actually only - * send headers. - */ - SG(request_info).headers_only = r->header_only; - return SUCCESS; -} -/* }}} */ - -/* {{{ php_apache_get_stat - */ -static struct stat *php_apache_get_stat(TSRMLS_D) -{ - return &((request_rec *) SG(server_context))->finfo; -} -/* }}} */ - -/* {{{ php_apache_getenv - */ -static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC) -{ - return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name); -} -/* }}} */ - -/* {{{ sapi_module_struct apache_sapi_module - */ -static sapi_module_struct apache_sapi_module = { - "apache", /* name */ - "Apache", /* pretty name */ - - php_apache_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - php_apache_sapi_activate, /* activate */ - NULL, /* deactivate */ - - sapi_apache_ub_write, /* unbuffered write */ - sapi_apache_flush, /* flush */ - php_apache_get_stat, /* get uid */ - php_apache_getenv, /* getenv */ - - php_error, /* error handler */ - - sapi_apache_header_handler, /* header handler */ - sapi_apache_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_apache_read_post, /* read POST data */ - sapi_apache_read_cookies, /* read Cookies */ - - sapi_apache_register_server_variables, /* register server variables */ - php_apache_log_message, /* Log message */ - NULL, /* Get request time */ - - NULL, /* php.ini path override */ - -#ifdef PHP_WIN32 - NULL, - NULL, -#else - block_alarms, /* Block interruptions */ - unblock_alarms, /* Unblock interruptions */ -#endif - - NULL, /* default post reader */ - NULL, /* treat data */ - NULL, /* exe location */ - 0, /* ini ignore */ - NULL - -}; -/* }}} */ - -/* {{{ php_restore_umask - */ -static void php_restore_umask(void) -{ - umask(saved_umask); -} -/* }}} */ - -/* {{{ init_request_info - */ -static void init_request_info(TSRMLS_D) -{ - request_rec *r = ((request_rec *) SG(server_context)); - char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); - const char *authorization=NULL; - char *tmp, *tmp_user; - - SG(request_info).query_string = r->args; - SG(request_info).path_translated = r->filename; - SG(request_info).request_uri = r->uri; - SG(request_info).request_method = (char *)r->method; - SG(request_info).proto_num = r->proto_num; - SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE"); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - SG(sapi_headers).http_response_code = r->status; - - if (r->headers_in) { - authorization = table_get(r->headers_in, "Authorization"); - } - - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - - if (authorization && !auth_type(r)) { - if (!strcasecmp(getword(r->pool, &authorization, ' '), "Basic")) { - tmp = uudecode(r->pool, authorization); - tmp_user = getword_nulls_nc(r->pool, &tmp, ':'); - if (tmp_user) { - r->connection->user = pstrdup(r->connection->pool, tmp_user); - r->connection->ap_auth_type = "Basic"; - SG(request_info).auth_user = estrdup(tmp_user); - } - if (tmp) { - SG(request_info).auth_password = estrdup(tmp); - } - } else if (!strcasecmp(getword(r->pool, &authorization, ' '), "Digest")) { - r->connection->ap_auth_type = "Digest"; - SG(request_info).auth_digest = estrdup(authorization); - } - } -} -/* }}} */ - -/* {{{ php_apache_alter_ini_entries - */ -static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC) -{ - zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE); - return 0; -} -/* }}} */ - -/* {{{ php_apache_get_default_mimetype - */ -static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) -{ - - char *mimetype; - if (SG(default_mimetype) || SG(default_charset)) { - /* Assume output will be of the default MIME type. Individual - scripts may change this later. */ - char *tmpmimetype; - tmpmimetype = sapi_get_default_content_type(TSRMLS_C); - mimetype = pstrdup(r->pool, tmpmimetype); - efree(tmpmimetype); - } else { - mimetype = SAPI_DEFAULT_MIMETYPE "; charset=" SAPI_DEFAULT_CHARSET; - } - return mimetype; -} -/* }}} */ - -/* {{{ send_php - */ -static int send_php(request_rec *r, int display_source_mode, char *filename) -{ - int retval; - php_per_dir_config *per_dir_conf; - TSRMLS_FETCH(); - if (AP(in_request)) { - zend_file_handle fh; - - fh.filename = r->filename; - fh.opened_path = NULL; - fh.free_filename = 0; - fh.type = ZEND_HANDLE_FILENAME; - -#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) - php_mbstring_set_zend_encoding(TSRMLS_C); -#endif /* defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) */ - - zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh); - return OK; - } - - zend_first_try { - - /* Make sure file exists */ - if (filename == NULL && r->finfo.st_mode == 0) { - return DECLINED; - } - - per_dir_conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - } - - /* If PHP parser engine has been turned off with an "engine off" - * directive, then decline to handle this request - */ - if (!AP(engine)) { - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); - r->allowed |= (1 << METHODS) - 1; - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return DECLINED; - } - if (filename == NULL) { - filename = r->filename; - } - - /* Apache 1.2 has a more complex mechanism for reading POST data */ -#if MODULE_MAGIC_NUMBER > 19961007 - if ((retval = setup_client_block(r, REQUEST_CHUNKED_ERROR))) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return retval; - } -#endif - - if (AP(last_modified)) { -#if MODULE_MAGIC_NUMBER < 19970912 - if ((retval = set_last_modified(r, r->finfo.st_mtime))) { - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return retval; - } -#else - update_mtime (r, r->finfo.st_mtime); - set_last_modified(r); - set_etag(r); -#endif - } - /* Assume output will be of the default MIME type. Individual - scripts may change this later in the request. */ - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); - - /* Init timeout */ - hard_timeout("send", r); - - SG(server_context) = r; - - php_save_umask(); - if(!AP(setup_env)) { - AP(setup_env) = 1; - add_common_vars(r); - add_cgi_vars(r); - } - init_request_info(TSRMLS_C); - apache_php_module_main(r, display_source_mode TSRMLS_CC); - - /* Done, restore umask, turn off timeout, close file and return */ - php_restore_umask(); - kill_timeout(r); - } zend_end_try(); - - return OK; -} -/* }}} */ - -/* {{{ send_parsed_php - */ -static int send_parsed_php(request_rec * r) -{ - int result = send_php(r, 0, NULL); - TSRMLS_FETCH(); - - ap_table_setn(r->notes, "mod_php_memory_usage", - ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC))); - - return result; -} -/* }}} */ - -/* {{{ send_parsed_php_source - */ -static int send_parsed_php_source(request_rec * r) -{ - return send_php(r, 1, NULL); -} -/* }}} */ - - -/* {{{ destroy_per_dir_entry - */ -static void destroy_per_dir_entry(php_per_dir_entry *per_dir_entry) -{ - free(per_dir_entry->key); - free(per_dir_entry->value); -} -/* }}} */ - -/* {{{ copy_per_dir_entry - */ -static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry) -{ - php_per_dir_entry tmp = *per_dir_entry; - - per_dir_entry->key = (char *) malloc(tmp.key_length+1); - memcpy(per_dir_entry->key, tmp.key, tmp.key_length); - per_dir_entry->key[per_dir_entry->key_length] = 0; - - per_dir_entry->value = (char *) malloc(tmp.value_length+1); - memcpy(per_dir_entry->value, tmp.value, tmp.value_length); - per_dir_entry->value[per_dir_entry->value_length] = 0; -} -/* }}} */ - -/* {{{ should_overwrite_per_dir_entry; - - */ -static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_dir_entry *orig_per_dir_entry, zend_hash_key *hash_key, void *pData) -{ - php_per_dir_entry *new_per_dir_entry; - - if (zend_hash_find(target_ht, hash_key->arKey, hash_key->nKeyLength, (void **) &new_per_dir_entry)==FAILURE) { - return 1; /* does not exist in dest, copy from source */ - } - - if (new_per_dir_entry->type==PHP_INI_SYSTEM - && orig_per_dir_entry->type!=PHP_INI_SYSTEM) { - return 1; - } else { - return 0; - } -} -/* }}} */ -/* {{{ php_destroy_per_server_info - */ -static void php_destroy_per_server_info(php_per_server_config *conf) -{ - php_handler_stack_destroy(&conf->requires); - php_handler_stack_destroy(&conf->uri_handlers); -} -/* }}} */ - -/* {{{ php_destroy_per_dir_info - */ -static void php_destroy_per_dir_info(php_per_dir_config *conf) -{ - zend_hash_destroy(conf->ini_settings); - php_handler_stack_destroy(&conf->response_handlers); - php_handler_stack_destroy(&conf->auth_handlers); - php_handler_stack_destroy(&conf->access_handlers); - php_handler_stack_destroy(&conf->type_handlers); - php_handler_stack_destroy(&conf->fixup_handlers); - php_handler_stack_destroy(&conf->logger_handlers); - php_handler_stack_destroy(&conf->post_read_handlers); - php_handler_stack_destroy(&conf->headers_handlers); - free(conf->ini_settings); -} -/* }}} */ - -/* {{{ php_create_server - */ -static void *php_create_server(pool *p, char *dummy) -{ - php_per_server_config *conf; - conf = (php_per_server_config *) malloc(sizeof(php_per_server_config)); - register_cleanup(p, (void *) conf, (void (*)(void *)) php_destroy_per_server_info, (void (*)(void *)) php_destroy_per_server_info); - - sapi_stack_init_ex(&conf->requires, 1); - sapi_stack_init_ex(&conf->uri_handlers, 1); - return conf; -} - -/* }}} */ - - -/* {{{ php_create_dir - */ -static void *php_create_dir(pool *p, char *dummy) -{ - php_per_dir_config *conf; - conf = (php_per_dir_config *) malloc(sizeof(php_per_dir_config)); - conf->ini_settings = (HashTable *) malloc(sizeof(HashTable)); - zend_hash_init_ex(conf->ini_settings, 5, NULL, (void (*)(void *)) destroy_per_dir_entry, 1, 0); - sapi_stack_init_ex(&conf->response_handlers, 1); - sapi_stack_init_ex(&conf->headers_handlers, 1); - sapi_stack_init_ex(&conf->auth_handlers, 1); - sapi_stack_init_ex(&conf->access_handlers, 1); - sapi_stack_init_ex(&conf->type_handlers, 1); - sapi_stack_init_ex(&conf->fixup_handlers, 1); - sapi_stack_init_ex(&conf->logger_handlers, 1); - sapi_stack_init_ex(&conf->post_read_handlers, 1); - register_cleanup(p, (void *) conf, (void (*)(void *)) php_destroy_per_dir_info, (void (*)(void *)) php_destroy_per_dir_info); - - return conf; -} - -/* }}} */ - -/* {{{ php_merge_dir - */ -static void *php_merge_dir(pool *p, void *basev, void *addv) -{ - php_per_dir_config *a = (php_per_dir_config *) addv; - php_per_dir_config *b = (php_per_dir_config *) basev; - /* This function *must* return addv, and not modify basev */ - zend_hash_merge_ex((HashTable *) a->ini_settings, (HashTable *) b->ini_settings, (copy_ctor_func_t) copy_per_dir_entry, sizeof(php_per_dir_entry), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL); - a->headers_handlers = (a->headers_handlers.top)?a->headers_handlers:b->headers_handlers; - a->auth_handlers = (a->auth_handlers.top)?a->auth_handlers:b->auth_handlers; - a->access_handlers = (a->access_handlers.top)?a->access_handlers:b->access_handlers; - a->type_handlers = (a->type_handlers.top)?a->type_handlers:b->type_handlers; - a->fixup_handlers = (a->fixup_handlers.top)?a->fixup_handlers:b->fixup_handlers; - a->logger_handlers = (a->logger_handlers.top)?a->logger_handlers:b->logger_handlers; - a->post_read_handlers = (a->post_read_handlers.top)?a->post_read_handlers:b->post_read_handlers; - a->response_handlers = (a->response_handlers.top)?a->response_handlers:b->response_handlers; - return a; -} -/* }}} */ - -/* {{{ php_apache_value_handler_ex - */ -static CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) -{ - php_per_dir_entry per_dir_entry; - - if (!apache_php_initialized) { - apache_php_initialized = 1; -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache_sapi_module); - php_apache_startup(&apache_sapi_module); - } - per_dir_entry.type = mode; - - if (strcasecmp(arg2, "none") == 0) { - arg2 = ""; - } - - per_dir_entry.key_length = strlen(arg1); - per_dir_entry.value_length = strlen(arg2); - - per_dir_entry.key = (char *) malloc(per_dir_entry.key_length+1); - memcpy(per_dir_entry.key, arg1, per_dir_entry.key_length); - per_dir_entry.key[per_dir_entry.key_length] = 0; - - per_dir_entry.value = (char *) malloc(per_dir_entry.value_length+1); - memcpy(per_dir_entry.value, arg2, per_dir_entry.value_length); - per_dir_entry.value[per_dir_entry.value_length] = 0; - - zend_hash_update(conf, per_dir_entry.key, per_dir_entry.key_length, &per_dir_entry, sizeof(php_per_dir_entry), NULL); - return NULL; -} -/* }}} */ - -static CONST_PREFIX char *php_set_server_handler(server_rec *s, char *arg1, long handler_stage, long handler_type) -{ - php_per_server_config *conf; - php_handler *handler; - handler = (php_handler *) malloc(sizeof(php_handler)); - handler->type = handler_type; - handler->stage = handler_stage; - handler->name = strdup(arg1); - conf = get_module_config(s->module_config, &php5_module); - switch(handler_stage) { - case AP_URI_TRANS: - sapi_stack_push(&conf->uri_handlers, handler); - break; - default: - sapi_stack_push(&conf->requires, handler); - break; - } - return NULL; -} - -static CONST_PREFIX char *php_set_dir_handler(php_per_dir_config *conf, char *arg1, long handler_stage, long handler_type) -{ - php_handler *handler; - handler = (php_handler *) malloc(sizeof(php_handler)); - handler->type = handler_type; - handler->stage = handler_stage; - handler->name = strdup(arg1); - switch(handler_stage) { - case AP_POST_READ: - sapi_stack_push(&conf->post_read_handlers, handler); - break; - case AP_HEADER_PARSE: - sapi_stack_push(&conf->headers_handlers, handler); - break; - case AP_ACCESS_CONTROL: - sapi_stack_push(&conf->access_handlers, handler); - break; - case AP_AUTHENTICATION: - sapi_stack_push(&conf->auth_handlers, handler); - break; - case AP_AUTHORIZATION: - break; - case AP_TYPE_CHECKING: - sapi_stack_push(&conf->type_handlers, handler); - break; - case AP_FIXUP: - sapi_stack_push(&conf->fixup_handlers, handler); - break; - case AP_RESPONSE: - sapi_stack_push(&conf->response_handlers, handler); - break; - case AP_LOGGING: - sapi_stack_push(&conf->logger_handlers, handler); - break; - default: - break; - } - return NULL; -} - -/* {{{ php_set_uri_handler - */ -static CONST_PREFIX char *php_set_uri_handler(cmd_parms *cmd, void *dummy, char *arg1) -{ - return php_set_server_handler(cmd->server, arg1, AP_URI_TRANS, AP_HANDLER_TYPE_FILE); -} -/* }}} */ - -/* {{{ php_set_uri_handler_code */ -static CONST_PREFIX char *php_set_uri_handler_code(cmd_parms *cmd, void *dummy, char *arg1) -{ - return php_set_server_handler(cmd->server, arg1, AP_URI_TRANS, AP_HANDLER_TYPE_METHOD); -} -/* }}} */ - -/* {{{ php_set_header_handler - */ -static CONST_PREFIX char *php_set_header_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_HEADER_PARSE, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_header_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_HEADER_PARSE, AP_HANDLER_TYPE_METHOD); -} -/* }}} */ - -/* {{{ php_set_auth_handler - */ -static CONST_PREFIX char *php_set_auth_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_AUTHENTICATION, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_auth_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_AUTHENTICATION, AP_HANDLER_TYPE_METHOD); -} - -/* }}} */ - -/* {{{ php_set_access_handler - */ -static CONST_PREFIX char *php_set_access_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_ACCESS_CONTROL, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_access_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_ACCESS_CONTROL, AP_HANDLER_TYPE_METHOD); -} - -/* }}} */ - -/* {{{ php_set_type_handler - */ -static CONST_PREFIX char *php_set_type_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_TYPE_CHECKING, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_type_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_TYPE_CHECKING, AP_HANDLER_TYPE_METHOD); -} - -/* }}} */ - -/* {{{ php_set_fixup_handler - */ -static CONST_PREFIX char *php_set_fixup_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_FIXUP, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_fixup_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_FIXUP, AP_HANDLER_TYPE_METHOD); -} -/* }}} */ - -/* {{{ php_set_logger_handler - */ -static CONST_PREFIX char *php_set_logger_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_LOGGING, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_logger_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_LOGGING, AP_HANDLER_TYPE_METHOD); -} - -/* }}} */ - -/* {{{ php_set_post_read_handler - */ -static CONST_PREFIX char *php_set_post_read_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_POST_READ, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_post_read_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_POST_READ, AP_HANDLER_TYPE_METHOD); -} - - -/* }}} */ - -/* {{{ php_set_require - */ - -static CONST_PREFIX char *php_set_require(cmd_parms *cmd, void *dummy, char *arg1) -{ - return php_set_server_handler(cmd->server, arg1, 0, AP_HANDLER_TYPE_FILE); -} -/* }}} */ - -/* {{{ php_set_response_handler - */ -static CONST_PREFIX char *php_set_response_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_RESPONSE, AP_HANDLER_TYPE_FILE); -} -static CONST_PREFIX char *php_set_response_handler_code(cmd_parms *cmd, php_per_dir_config *conf, char *arg1) -{ - return php_set_dir_handler(conf, arg1, AP_RESPONSE, AP_HANDLER_TYPE_METHOD); -} -/* }}} */ - -/* {{{ php_apache_value_handler - */ -static CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2) -{ - return php_apache_value_handler_ex(cmd, conf->ini_settings, arg1, arg2, PHP_INI_PERDIR); -} -/* }}} */ - -/* {{{ php_apache_admin_value_handler - */ -static CONST_PREFIX char *php_apache_admin_value_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2) -{ - return php_apache_value_handler_ex(cmd, conf->ini_settings, arg1, arg2, PHP_INI_SYSTEM); -} -/* }}} */ - -/* {{{ php_apache_flag_handler_ex - */ -static CONST_PREFIX char *php_apache_flag_handler_ex(cmd_parms *cmd, HashTable *conf, char *arg1, char *arg2, int mode) -{ - char bool_val[2]; - - if (!strcasecmp(arg2, "On")) { - bool_val[0] = '1'; - } else { - bool_val[0] = '0'; - } - bool_val[1] = 0; - - return php_apache_value_handler_ex(cmd, conf, arg1, bool_val, mode); -} -/* }}} */ - -/* {{{ php_apache_flag_handler - */ -static CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2) -{ - return php_apache_flag_handler_ex(cmd, conf->ini_settings, arg1, arg2, PHP_INI_PERDIR); -} -/* }}} */ - -/* {{{ php_apache_admin_flag_handler - */ -static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, php_per_dir_config *conf, char *arg1, char *arg2) -{ - return php_apache_flag_handler_ex(cmd, conf->ini_settings, arg1, arg2, PHP_INI_SYSTEM); -} -/* }}} */ - -/* {{{ php_apache_phpini_set - */ -static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf, char *arg) -{ - if (apache_sapi_module.php_ini_path_override) { - return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; - } - apache_sapi_module.php_ini_path_override = ap_server_root_relative(cmd->pool, arg); - return NULL; -} -/* }}} */ - -/* {{{ int php_xbithack_handler(request_rec * r) - */ -static int php_xbithack_handler(request_rec * r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - - if (!(r->finfo.st_mode & S_IXUSR)) { - r->allowed |= (1 << METHODS) - 1; - return DECLINED; - } - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - if (conf) { - zend_hash_apply((HashTable *) conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - } - if(!AP(xbithack)) { - r->allowed |= (1 << METHODS) - 1; - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); - return DECLINED; - } - return send_parsed_php(r); -} -/* }}} */ - -/* {{{ apache_php_module_shutdown_wrapper - */ -static void apache_php_module_shutdown_wrapper(void) -{ - apache_php_initialized = 0; - apache_sapi_module.shutdown(&apache_sapi_module); - -#if MODULE_MAGIC_NUMBER >= 19970728 - /* This function is only called on server exit if the apache API - * child_exit handler exists, so shutdown globally - */ - sapi_shutdown(); -#endif - -#ifdef ZTS - tsrm_shutdown(); -#endif -} -/* }}} */ - -#if MODULE_MAGIC_NUMBER >= 19970728 -/* {{{ php_child_exit_handler - */ -static void php_child_exit_handler(server_rec *s, pool *p) -{ -/* apache_php_initialized = 0; */ - apache_sapi_module.shutdown(&apache_sapi_module); - -#ifdef ZTS - tsrm_shutdown(); -#endif -} -/* }}} */ -#endif - -/* {{{ void php_init_handler(server_rec *s, pool *p) - */ -static void php_init_handler(server_rec *s, pool *p) -{ - register_cleanup(p, NULL, (void (*)(void *))apache_php_module_shutdown_wrapper, (void (*)(void *))php_module_shutdown_for_exec); - if (!apache_php_initialized) { - apache_php_initialized = 1; -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#endif - sapi_startup(&apache_sapi_module); - php_apache_startup(&apache_sapi_module); - } -#if MODULE_MAGIC_NUMBER >= 19980527 - { - TSRMLS_FETCH(); - if (PG(expose_php)) { - ap_add_version_component("PHP/" PHP_VERSION); - } - } -#endif -} -/* }}} */ - -static int php_run_hook(php_handler *handler, request_rec *r) -{ - zval *ret = NULL; - php_per_dir_config *conf; - - TSRMLS_FETCH(); - - if(!AP(apache_config_loaded)) { - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - if (conf) - zend_hash_apply((HashTable *)conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); - AP(apache_config_loaded) = 1; - } - if (!handler->name) { - return DECLINED; - } - php_save_umask(); - if (!AP(setup_env)) { - AP(setup_env) = 1; - add_common_vars(r); - add_cgi_vars(r); - } - SG(server_context) = r; - init_request_info(TSRMLS_C); - apache_php_module_hook(r, handler, &ret TSRMLS_CC); - php_restore_umask(); - kill_timeout(r); - if (ret) { - convert_to_long(ret); - return Z_LVAL_P(ret); - } - return HTTP_INTERNAL_SERVER_ERROR; -} - - -static int php_uri_translation(request_rec *r) -{ - php_per_server_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_URI_TRANS; - conf = (php_per_server_config *) get_module_config(r->server->module_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_equals(&conf->uri_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r, OK); -} - -static int php_header_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_HEADER_PARSE; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_http_error(&conf->headers_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r); -} - -static int php_auth_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_AUTHENTICATION; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_equals(&conf->auth_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r, OK); -} - -static int php_access_hook(request_rec *r) -{ - php_per_dir_config *conf; - int status = DECLINED; - TSRMLS_FETCH(); - AP(current_hook) = AP_ACCESS_CONTROL; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - status = sapi_stack_apply_with_argument_stop_if_http_error(&conf->access_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r); - return status; - -} - -static int php_type_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_TYPE_CHECKING; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_equals(&conf->type_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, - r, OK); -} - -static int php_fixup_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_FIXUP; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_http_error(&conf->fixup_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, - r); -} - -static int php_logger_hook(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_LOGGING; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_http_error(&conf->logger_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, - r); -} - -static int php_post_read_hook(request_rec *r) -{ - php_per_dir_config *conf; - php_per_server_config *svr; - TSRMLS_FETCH(); - AP(current_hook) = AP_POST_READ; - svr = get_module_config(r->server->module_config, &php5_module); - if(ap_is_initial_req(r)) { - sapi_stack_apply_with_argument_all(&svr->requires, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); - } - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_stop_if_http_error(&conf->post_read_handlers, - ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *element, void *)) php_run_hook, r); -} - -static int php_response_handler(request_rec *r) -{ - php_per_dir_config *conf; - TSRMLS_FETCH(); - AP(current_hook) = AP_RESPONSE; - conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); - return sapi_stack_apply_with_argument_all(&conf->response_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); -} - -/* {{{ handler_rec php_handlers[] - */ -handler_rec php_handlers[] = -{ - {"application/x-httpd-php", send_parsed_php}, - {"application/x-httpd-php-source", send_parsed_php_source}, - {"text/html", php_xbithack_handler}, - {"php-script", php_response_handler}, - {NULL} -}; -/* }}} */ - -/* {{{ command_rec php_commands[] - */ -command_rec php_commands[] = -{ - {"php_value", php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"}, - {"phpUriHandler", php_set_uri_handler, NULL, RSRC_CONF, TAKE1, "PHP Value Modifier"}, - {"phpUriHandlerMethod", php_set_uri_handler_code, NULL, RSRC_CONF, TAKE1, "PHP Value Modifier"}, -#if MODULE_MAGIC_NUMBER >= 19970103 - {"phpHeaderHandler", php_set_header_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpHeaderHandlerMethod", php_set_header_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, -#endif - {"phpAuthHandler", php_set_auth_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpAuthHandlerMethod", php_set_auth_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpAccessHandler", php_set_access_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpAccessHandlerMethod", php_set_access_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpTypeHandler", php_set_type_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpTypeHandlerMethod", php_set_type_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpFixupHandler", php_set_fixup_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpFixupHandlerMethod", php_set_fixup_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpLoggerHandler", php_set_logger_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpLoggerHandlerMethod", php_set_logger_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, -#if MODULE_MAGIC_NUMBER >= 19970902 - {"phpPostReadHandler", php_set_post_read_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpPostReadHandlerMethod", php_set_post_read_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpRequire", php_set_require, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpResponseHandler", php_set_response_handler, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, - {"phpResponseHandlerMethod", php_set_response_handler_code, NULL, OR_OPTIONS, TAKE1, "PHP Value Modifier"}, -#endif - {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, - {"php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"}, - {"php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"}, - {"PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, TAKE1, "Directory containing the php.ini file"}, - {NULL} -}; -/* }}} */ - -/* {{{ module MODULE_VAR_EXPORT php5_module - */ -module MODULE_VAR_EXPORT php5_module = -{ - STANDARD_MODULE_STUFF, - php_init_handler, /* initializer */ - php_create_dir, /* per-directory config creator */ - php_merge_dir, /* dir merger */ - php_create_server, /* per-server config creator */ - NULL, /* merge server config */ - php_commands, /* command table */ - php_handlers, /* handlers */ - php_uri_translation, /* filename translation */ - NULL, /* check_user_id */ - php_auth_hook, /* check auth */ - php_access_hook, /* check access */ - php_type_hook, /* type_checker */ - php_fixup_hook, /* fixups */ - php_logger_hook /* logger */ -#if MODULE_MAGIC_NUMBER >= 19970103 - , php_header_hook /* header parser */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970719 - , NULL /* child_init */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970728 - , php_child_exit_handler /* child_exit */ -#endif -#if MODULE_MAGIC_NUMBER >= 19970902 - , php_post_read_hook /* post read-request */ -#endif -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache_hooks/mod_php5.exp b/sapi/apache_hooks/mod_php5.exp deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache_hooks/mod_php5.exp +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache_hooks/mod_php5.h b/sapi/apache_hooks/mod_php5.h deleted file mode 100644 index 0d61bf89822a3..0000000000000 --- a/sapi/apache_hooks/mod_php5.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Rasmus Lerdorf | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef MOD_PHP5_H -#define MOD_PHP5_H - -#if !defined(WIN32) && !defined(WINNT) -#ifndef MODULE_VAR_EXPORT -#define MODULE_VAR_EXPORT -#endif -#endif - -typedef struct { - long engine; - long last_modified; - long xbithack; - long terminate_child; - long setup_env; - long current_hook; - zend_bool in_request; - zend_bool apache_config_loaded; - zend_bool headers_sent; -} php_apache_info_struct; - -typedef struct _php_handler { - long type; - long stage; - char *name; -} php_handler; - -#define AP_HANDLER_TYPE_FILE 0 -#define AP_HANDLER_TYPE_METHOD 1 - -extern zend_module_entry apache_module_entry; - -#ifdef ZTS -extern int php_apache_info_id; -#define AP(v) TSRMG(php_apache_info_id, php_apache_info_struct *, v) -#else -extern php_apache_info_struct php_apache_info; -#define AP(v) (php_apache_info.v) -#endif - -/* defines for the various stages of the apache request */ -#define AP_WAITING_FOR_REQUEST 0 -#define AP_POST_READ 1 -#define AP_URI_TRANS 2 -#define AP_HEADER_PARSE 3 -#define AP_ACCESS_CONTROL 4 -#define AP_AUTHENTICATION 5 -#define AP_AUTHORIZATION 6 -#define AP_TYPE_CHECKING 7 -#define AP_FIXUP 8 -#define AP_RESPONSE 9 -#define AP_LOGGING 10 -#define AP_CLEANUP 11 - -#endif /* MOD_PHP5_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/sapi/apache_hooks/php.sym b/sapi/apache_hooks/php.sym deleted file mode 100644 index 9ad0f0a0adbc0..0000000000000 --- a/sapi/apache_hooks/php.sym +++ /dev/null @@ -1 +0,0 @@ -php5_module diff --git a/sapi/apache_hooks/php5apache_hooks.dsp b/sapi/apache_hooks/php5apache_hooks.dsp deleted file mode 100755 index cc60f4b3b1bf9..0000000000000 --- a/sapi/apache_hooks/php5apache_hooks.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5apache_hooks" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5apache_hooks - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5apache_hooks.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5apache_hooks.mak" CFG="php5apache_hooks - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5apache_hooks - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache_hooks - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5apache_hooks - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5apache_hooks - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\..\regex" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\apache\src\include" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\apache\src\corer" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" - -!ELSEIF "$(CFG)" == "php5apache_hooks - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\..\regex" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\apache\src\include" /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts_debug.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x60000000" /version:4.0 /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php5apache_hooks.dll" /pdbtype:sept /libpath:"..\..\..\php_build\apache\src\cored" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" - -!ELSEIF "$(CFG)" == "php5apache_hooks - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_inline" -# PROP BASE Intermediate_Dir "Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\..\regex" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\apache\src\include" /I "..\..\main" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "APACHEPHP5_EXPORTS" /D "WIN32" /D "_MBCS" /D "APACHE_READDIR_H" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"\apache\src\corer" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" - -!ENDIF - -# Begin Target - -# Name "php5apache_hooks - Win32 Release_TS" -# Name "php5apache_hooks - Win32 Debug_TS" -# Name "php5apache_hooks - Win32 Release_TS_inline" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\mod_php5.c -# End Source File -# Begin Source File - -SOURCE=.\php_apache.c -# End Source File -# Begin Source File - -SOURCE=.\sapi_apache.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\mod_php5.h -# End Source File -# Begin Source File - -SOURCE=.\php_apache_http.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c deleted file mode 100644 index 0d5fc8454dd05..0000000000000 --- a/sapi/apache_hooks/php_apache.c +++ /dev/null @@ -1,1955 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Stig Sæther Bakken | - | David Sklar | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -#if defined(PHP_WIN32) || defined(NETWARE) -#include "zend.h" -#include "ap_compat.h" -#else -#include -#endif - -#ifdef ZTS -int php_apache_info_id; -#else -php_apache_info_struct php_apache_info; -#endif - -#define SECTION(name) PUTS("

" name "

\n") - -#undef offsetof -#define offsetof(s_type,field) ((size_t)&(((s_type*)0)->field)) - -extern module *top_module; -extern module **ap_loaded_modules; -static int le_apachereq; -static zend_class_entry *apacherequest_class_entry; - -static void apache_table_to_zval(table *, int safe_mode, zval *return_value); - -PHP_FUNCTION(virtual); -PHP_FUNCTION(apache_request_headers); -PHP_FUNCTION(apache_response_headers); -PHP_FUNCTION(apachelog); -PHP_FUNCTION(apache_note); -PHP_FUNCTION(apache_lookup_uri); -PHP_FUNCTION(apache_child_terminate); -PHP_FUNCTION(apache_setenv); -PHP_FUNCTION(apache_get_version); -PHP_FUNCTION(apache_get_modules); - -PHP_MINFO_FUNCTION(apache); - - -zend_function_entry apache_functions[] = { - PHP_FE(virtual, NULL) - PHP_FE(apache_request_headers, NULL) - PHP_FE(apache_note, NULL) - PHP_FE(apache_lookup_uri, NULL) - PHP_FE(apache_child_terminate, NULL) - PHP_FE(apache_setenv, NULL) - PHP_FE(apache_response_headers, NULL) - PHP_FE(apache_get_version, NULL) - PHP_FE(apache_get_modules, NULL) - PHP_FALIAS(getallheaders, apache_request_headers, NULL) - {NULL, NULL, NULL} -}; - -/* {{{ php_apache ini entries - */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateLong, xbithack, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateLong, engine, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateLong, last_modified, php_apache_info_struct, php_apache_info) - STD_PHP_INI_ENTRY("child_terminate", "0", PHP_INI_ALL, OnUpdateLong, terminate_child, php_apache_info_struct, php_apache_info) -PHP_INI_END() -/* }}} */ - -static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC) -{ - apache_globals->in_request = 0; -} - - -#define APREQ_GET_THIS(ZVAL) if (NULL == (ZVAL = getThis())) { \ - php_error(E_WARNING, "%s(): underlying ApacheRequest object missing", \ - get_active_function_name(TSRMLS_C)); \ - RETURN_FALSE; \ - } -#define APREQ_GET_REQUEST(ZVAL, R) APREQ_GET_THIS(ZVAL); \ - R = get_apache_request(ZVAL TSRMLS_CC) - -static void php_apache_request_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - zval *z = (zval *)rsrc->ptr; -/* fprintf(stderr, "%s() %p\n", __FUNCTION__, z); */ - zval_ptr_dtor(&z); -} - -static request_rec *get_apache_request(zval *z TSRMLS_DC) -{ - request_rec *r; - zval **addr; - - if (NULL == z) { - php_error(E_WARNING, "get_apache_request() invalid wrapper passed"); - return NULL; - } - - if (Z_TYPE_P(z) != IS_OBJECT) { - php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); - return NULL; - } - - if (zend_hash_index_find(Z_OBJPROP_P(z), 0, (void **)&addr) == FAILURE) { - php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); - return NULL; - } - - r = (request_rec *)Z_LVAL_PP(addr); - if (!r) { - php_error(E_WARNING, "%s(): request_rec invalid", get_active_function_name(TSRMLS_C)); - return NULL; - } - - return r; -} - -/* {{{ php_apache_request_new(request_rec *r) - * create a new zval-instance for ApacheRequest that wraps request_rec - */ -zval *php_apache_request_new(request_rec *r) -{ - zval *req; - zval *addr; - - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(addr); - Z_TYPE_P(addr) = IS_LONG; - Z_LVAL_P(addr) = (int) r; - - MAKE_STD_ZVAL(req); - object_init_ex(req, apacherequest_class_entry); - zend_hash_index_update(Z_OBJPROP_P(req), 0, &addr, sizeof(zval *), NULL); - - return req; -} -/* }}} */ - -/* {{{ apache_request_read_string_slot() - */ -static void apache_request_read_string_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *id; - request_rec *r; - char *s; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - s = *(char **)((char*)r + offset); - - if (s) - RETURN_STRING(s, 1); - - RETURN_EMPTY_STRING(); -} -/* }}} */ - - -/* {{{ apache_request_string_slot() - */ -static void apache_request_string_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *id, **new_value; - request_rec *r; - char *old_value; - char **target; - - APREQ_GET_REQUEST(id, r); - - target = (char **)((char*)r + offset); - old_value = *target; - - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &new_value) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(new_value); - *target = ap_pstrdup(r->pool, Z_STRVAL_PP(new_value)); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - if (old_value) - RETURN_STRING(old_value, 1); - - RETURN_EMPTY_STRING(); -} -/* }}} */ - -/* {{{ apache_request_read_int_slot() - */ -static void apache_request_read_int_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *id; - request_rec *r; - long l; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - l = *(long *)((char*)r + offset); - - RETURN_LONG(l); -} -/* }}} */ - -/* {{{ apache_request_int_slot() - */ -static void apache_request_int_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *id, **new_value; - request_rec *r; - long old_value; - long *target; - - APREQ_GET_REQUEST(id, r); - - target = (long *)((char*)r + offset); - old_value = *target; - - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &new_value) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(new_value); - *target = Z_LVAL_PP(new_value); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - RETURN_LONG(old_value); -} -/* }}} */ - - -/* {{{ access string slots of request rec - */ - -/* {{{ proto string ApacheRequest::filename([string new_filename]) - */ -PHP_FUNCTION(apache_request_filename) -{ - apache_request_string_slot(offsetof(request_rec, filename), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::uri([string new_uri]) - */ -PHP_FUNCTION(apache_request_uri) -{ - apache_request_string_slot(offsetof(request_rec, uri), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::unparsed_uri([string new_unparsed_uri]) - */ -PHP_FUNCTION(apache_request_unparsed_uri) -{ - apache_request_string_slot(offsetof(request_rec, unparsed_uri), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::path_info([string new_path_info]) - */ -PHP_FUNCTION(apache_request_path_info) -{ - apache_request_string_slot(offsetof(request_rec, path_info), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::args([string new_args]) - */ -PHP_FUNCTION(apache_request_args) -{ - apache_request_string_slot(offsetof(request_rec, args), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::boundary() - */ -PHP_FUNCTION(apache_request_boundary) -{ - apache_request_read_string_slot(offsetof(request_rec, boundary), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - - -/* {{{ proto string ApacheRequest::content_type([string new_type]) - */ -PHP_FUNCTION(apache_request_content_type) -{ - apache_request_string_slot(offsetof(request_rec, content_type), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::content_encoding([string new_encoding]) - */ -PHP_FUNCTION(apache_request_content_encoding) -{ - apache_request_string_slot(offsetof(request_rec, content_encoding), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::handler([string new_handler]) - */ -PHP_FUNCTION(apache_request_handler) -{ - apache_request_string_slot(offsetof(request_rec, handler), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::the_request() - */ -PHP_FUNCTION(apache_request_the_request) -{ - apache_request_read_string_slot(offsetof(request_rec, the_request), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::protocol() - */ -PHP_FUNCTION(apache_request_protocol) -{ - apache_request_read_string_slot(offsetof(request_rec, protocol), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::hostname() - */ -PHP_FUNCTION(apache_request_hostname) -{ - apache_request_read_string_slot(offsetof(request_rec, hostname), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::status_line([string new_status_line]) - */ -PHP_FUNCTION(apache_request_status_line) -{ - apache_request_string_slot(offsetof(request_rec, status_line), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto string ApacheRequest::method() - */ -PHP_FUNCTION(apache_request_method) -{ - apache_request_read_string_slot(offsetof(request_rec, method), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* }}} access string slots of request rec */ - -/* {{{ access int slots of request_rec - */ - -/* {{{ proto int ApacheRequest::proto_num() - */ -PHP_FUNCTION(apache_request_proto_num) -{ - apache_request_read_int_slot(offsetof(request_rec, proto_num), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::assbackwards() - */ -PHP_FUNCTION(apache_request_assbackwards) -{ - apache_request_read_int_slot(offsetof(request_rec, assbackwards), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - - -/* {{{ proto int ApacheRequest::proxyreq([int new_proxyreq]) - */ -PHP_FUNCTION(apache_request_proxyreq) -{ - apache_request_int_slot(offsetof(request_rec, proxyreq), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::chunked() - */ -PHP_FUNCTION(apache_request_chunked) -{ - apache_request_read_int_slot(offsetof(request_rec, chunked), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - - -/* {{{ proto int ApacheRequest::header_only() - */ -PHP_FUNCTION(apache_request_header_only) -{ - apache_request_read_int_slot(offsetof(request_rec, header_only), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::request_time() - */ -PHP_FUNCTION(apache_request_request_time) -{ - apache_request_read_int_slot(offsetof(request_rec, request_time), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::status([int new_status]) - */ -PHP_FUNCTION(apache_request_status) -{ - apache_request_int_slot(offsetof(request_rec, status), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::method_number([int method_number]) - */ -PHP_FUNCTION(apache_request_method_number) -{ - apache_request_read_int_slot(offsetof(request_rec, method_number), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::allowed([int allowed]) - */ -PHP_FUNCTION(apache_request_allowed) -{ - apache_request_int_slot(offsetof(request_rec, allowed), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::bytes_sent() - */ -PHP_FUNCTION(apache_request_bytes_sent) -{ - apache_request_read_int_slot(offsetof(request_rec, bytes_sent), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::mtime() - */ -PHP_FUNCTION(apache_request_mtime) -{ - apache_request_read_int_slot(offsetof(request_rec, mtime), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::content_length([int new_content_length]) - */ -PHP_FUNCTION(apache_request_content_length) -{ - zval *id, **zlen; - request_rec *r; - - if (ZEND_NUM_ARGS() == 0) { - apache_request_read_int_slot(offsetof(request_rec, clength), INTERNAL_FUNCTION_PARAM_PASSTHRU); - } - else if (ZEND_NUM_ARGS() > 1) { - WRONG_PARAM_COUNT; - } - else { - if (zend_get_parameters_ex(1, &zlen) == FAILURE) { - RETURN_FALSE; - } - - APREQ_GET_REQUEST(id, r); - - convert_to_long_ex(zlen); - (void)ap_set_content_length(r, Z_LVAL_PP(zlen)); - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto int ApacheRequest::remaining() - */ -PHP_FUNCTION(apache_request_remaining) -{ - apache_request_read_int_slot(offsetof(request_rec, remaining), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::no_cache() - */ -PHP_FUNCTION(apache_request_no_cache) -{ - apache_request_int_slot(offsetof(request_rec, no_cache), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::no_local_copy() - */ -PHP_FUNCTION(apache_request_no_local_copy) -{ - apache_request_int_slot(offsetof(request_rec, no_local_copy), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - -/* {{{ proto int ApacheRequest::read_body() - */ -PHP_FUNCTION(apache_request_read_body) -{ - apache_request_int_slot(offsetof(request_rec, read_body), INTERNAL_FUNCTION_PARAM_PASSTHRU); -} -/* }}} */ - - -/* }}} access int slots of request_rec */ - - -/* {{{ proto array apache_request_headers_in() - * fetch all incoming request headers - */ -PHP_FUNCTION(apache_request_headers_in) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - apache_table_to_zval(r->headers_in, 0, return_value); -} -/* }}} */ - - -/* {{{ add_header_to_table -*/ -static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS) -{ - zval *first = NULL; - zval *second = NULL; - zval **entry, **value; - char *string_key; - uint string_key_len; - ulong num_key; - - zend_bool replace = 0; - HashPosition pos; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zb", &first, &second, &replace) == FAILURE) - RETURN_FALSE; - - if (Z_TYPE_P(first) == IS_ARRAY) { - switch(ZEND_NUM_ARGS()) { - case 1: - case 3: - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(first), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(first), (void **)&entry, &pos) == SUCCESS) { - switch(zend_hash_get_current_key_ex(Z_ARRVAL_P(first), &string_key, &string_key_len, &num_key, 0, &pos)) { - case HASH_KEY_IS_STRING: - if (zend_hash_find(Z_ARRVAL_P(first), string_key, string_key_len, (void **)&value) == FAILURE) { - zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos); - continue; - } - if (!value) { - zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos); - continue; - } - - convert_to_string_ex(value); - if (replace) - ap_table_set(t, string_key, Z_STRVAL_PP(value)); - else - ap_table_merge(t, string_key, Z_STRVAL_PP(value)); - - break; - case HASH_KEY_IS_LONG: - default: - php_error(E_WARNING, "%s(): Can only add STRING keys to headers!", get_active_function_name(TSRMLS_C)); - break; - } - - zend_hash_move_forward_ex(Z_ARRVAL_P(first), &pos); - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - } - else if (Z_TYPE_P(first) == IS_STRING) { - switch(ZEND_NUM_ARGS()) { - case 2: - case 3: - convert_to_string_ex(&second); - if (replace) - ap_table_set(t, Z_STRVAL_P(first), Z_STRVAL_P(second)); - else - ap_table_merge(t, Z_STRVAL_P(first), Z_STRVAL_P(second)); - break; - default: - WRONG_PARAM_COUNT; - break; - } - } - else { - RETURN_FALSE; - } -} - -/* }}} */ - - -/* {{{ proto array apache_request_headers_out([{string name|array list} [, string value [, bool replace = false]]]) - * fetch all outgoing request headers - */ -PHP_FUNCTION(apache_request_headers_out) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - if (ZEND_NUM_ARGS() > 0) - add_header_to_table(r->headers_out, INTERNAL_FUNCTION_PARAM_PASSTHRU); - - apache_table_to_zval(r->headers_out, 0, return_value); -} -/* }}} */ - - -/* {{{ proto array apache_request_err_headers_out([{string name|array list} [, string value [, bool replace = false]]]) - * fetch all headers that go out in case of an error or a subrequest - */ -PHP_FUNCTION(apache_request_err_headers_out) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - if (ZEND_NUM_ARGS() > 0) - add_header_to_table(r->err_headers_out, INTERNAL_FUNCTION_PARAM_PASSTHRU); - - apache_table_to_zval(r->err_headers_out, 0, return_value); -} -/* }}} */ - - -/* {{{ proxy functions for the ap_* functions family - */ - -/* {{{ proto int apache_request_server_port() - */ -PHP_FUNCTION(apache_request_server_port) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_get_server_port(r)); -} -/* }}} */ - -/* {{{ proto int apache_request_remote_host([int type]) - */ -PHP_FUNCTION(apache_request_remote_host) -{ - zval *id, **ztype; - request_rec *r; - char *res; - int type = REMOTE_NAME; - - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &ztype) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(ztype); - type = Z_LVAL_PP(ztype); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - - APREQ_GET_REQUEST(id, r); - - res = (char *)ap_get_remote_host(r->connection, r->per_dir_config, type); - if (res) - RETURN_STRING(res, 1); - - RETURN_EMPTY_STRING(); -} -/* }}} */ - -/* {{{ proto long apache_request_update_mtime([int dependency_mtime]) - */ -PHP_FUNCTION(apache_request_update_mtime) -{ - zval *id, **zmtime; - request_rec *r; - int mtime = 0; - - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &zmtime) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(zmtime); - mtime = Z_LVAL_PP(zmtime); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_update_mtime(r, mtime)); -} -/* }}} */ - - -/* {{{ proto void apache_request_set_etag() - */ -PHP_FUNCTION(apache_request_set_etag) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - ap_set_etag(r); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void apache_request_set_last_modified() - */ -PHP_FUNCTION(apache_request_set_last_modified) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - ap_set_last_modified(r); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto long apache_request_meets_conditions() - */ -PHP_FUNCTION(apache_request_meets_conditions) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_meets_conditions(r)); -} -/* }}} */ - -/* {{{ proto long apache_request_discard_request_body() - */ -PHP_FUNCTION(apache_request_discard_request_body) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_discard_request_body(r)); -} -/* }}} */ - -/* {{{ proto long apache_request_satisfies() - */ -PHP_FUNCTION(apache_request_satisfies) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_LONG(ap_satisfies(r)); -} -/* }}} */ - - -/* {{{ proto bool apache_request_is_initial_req() - */ -PHP_FUNCTION(apache_request_is_initial_req) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_BOOL(ap_is_initial_req(r)); -} -/* }}} */ - -/* {{{ proto bool apache_request_some_auth_required() - */ -PHP_FUNCTION(apache_request_some_auth_required) -{ - zval *id; - request_rec *r; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - RETURN_BOOL(ap_some_auth_required(r)); -} -/* }}} */ - -/* {{{ proto string apache_request_auth_type() - */ -PHP_FUNCTION(apache_request_auth_type) -{ - zval *id; - request_rec *r; - char *t; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - t = (char *)ap_auth_type(r); - if (!t) - RETURN_NULL(); - - RETURN_STRING(t, 1); -} -/* }}} */ - -/* {{{ proto string apache_request_auth_name() - */ -PHP_FUNCTION(apache_request_auth_name) -{ - zval *id; - request_rec *r; - char *t; - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - APREQ_GET_REQUEST(id, r); - - t = (char *)ap_auth_name(r); - if (!t) - RETURN_NULL(); - - RETURN_STRING(t, 1); -} -/* }}} */ - -/* {{{ proto apache_request_basic_auth_pw() - */ -PHP_FUNCTION(apache_request_basic_auth_pw) -{ - zval *id, *zpw; - request_rec *r; - const char *pw; - long status; - - if (ZEND_NUM_ARGS() != 1) { - WRONG_PARAM_COUNT; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zpw) == FAILURE) { - RETURN_NULL(); - } - - if (!PZVAL_IS_REF(zpw)) { - zend_error(E_WARNING, "Parameter wasn't passed by reference"); - RETURN_NULL(); - } - - - APREQ_GET_REQUEST(id, r); - - pw = NULL; - status = ap_get_basic_auth_pw(r, &pw); - if (status == OK && pw) { - ZVAL_STRING(zpw, (char *)pw, 1); - } - else - ZVAL_NULL(zpw); - RETURN_LONG(status); -} -/* }}} */ - - -/* http_protocol.h */ - -PHP_FUNCTION(apache_request_send_http_header) -{ - zval *id; - request_rec *r; - char *type = NULL; - int typelen; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &typelen) == FAILURE) - return; - APREQ_GET_REQUEST(id, r); - if(type) { - r->content_type = pstrdup(r->pool, type); - } - ap_send_http_header(r); - SG(headers_sent) = 1; - AP(headers_sent) = 1; - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_basic_http_header) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - ap_basic_http_header((request_rec *)SG(server_context)); - SG(headers_sent) = 1; - AP(headers_sent) = 1; - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_send_http_trace) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - ap_send_http_trace((request_rec *)SG(server_context)); - SG(headers_sent) = 1; - AP(headers_sent) = 1; - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_send_http_options) -{ - zval *id; - request_rec *r; - - APREQ_GET_REQUEST(id, r); - - ap_send_http_options((request_rec *)SG(server_context)); - SG(headers_sent) = 1; - AP(headers_sent) = 1; - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_send_error_response) -{ - zval **recursive; - zval *id; - request_rec *r; - int rec; - - switch(ZEND_NUM_ARGS()) { - case 0: - rec = 0; - break; - case 1: - if(zend_get_parameters_ex(1, &recursive) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(recursive); - rec = Z_LVAL_PP(recursive); - break; - default: - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - ap_send_error_response(r, rec); - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_set_content_length) -{ - zval **length; - zval *id; - request_rec *r; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &length) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - - convert_to_long_ex(length); - ap_set_content_length(r, Z_LVAL_PP(length)); - RETURN_TRUE; -} - -PHP_FUNCTION(apache_request_set_keepalive) -{ - zval *id; - request_rec *r; - APREQ_GET_REQUEST(id, r); - ap_set_keepalive(r); - RETURN_TRUE; -} - -/* This stuff should use streams or however this is implemented now - -PHP_FUNCTION(apache_request_send_fd) -{ -} - -PHP_FUNCTION(apache_request_send_fd_length) -{ -} -*/ - -/* These are for overriding default output behaviour */ -PHP_FUNCTION(apache_request_rputs) -{ - zval **buffer; - zval *id; - request_rec *r; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &buffer) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(buffer); - ap_rwrite(Z_STRVAL_PP(buffer), Z_STRLEN_PP(buffer), (request_rec*)SG(server_context)); -} - -/* This stuff would be useful for custom POST handlers, - which should be supported. Probably by not using - sapi_activate at all inside a phpResponseHandler - and instead using a builtin composed of the below - calls as a apache_read_request_body() and allow - people to custom craft their own. - -PHP_FUNCTION(apache_request_setup_client_block) -{ -} - -PHP_FUNCTION(apache_request_should_client_block) -{ -} - -PHP_FUNCTION(apache_request_get_client_block) -{ -} - -PHP_FUNCTION(apache_request_discard_request_body) -{ -} -*/ - -/* http_log.h */ - -/* {{{ proto boolean apache_request_log_error(string message, [long facility]) - */ -PHP_FUNCTION(apache_request_log_error) -{ - zval *id; - zval **z_errstr, **z_facility; - request_rec *r; - int facility = APLOG_ERR; - - switch(ZEND_NUM_ARGS()) { - case 1: - if(zend_get_parameters_ex(1, &z_errstr) == FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if(zend_get_parameters_ex(1, &z_errstr, &z_facility) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(z_facility); - facility = Z_LVAL_PP(z_facility); - break; - default: - WRONG_PARAM_COUNT; - break; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(z_errstr); - ap_log_error(APLOG_MARK, facility, r->server, "%s", Z_STRVAL_PP(z_errstr)); - RETURN_TRUE; -} -/* }}} */ -/* http_main.h */ - -/* {{{ proto object apache_request_sub_req_lookup_uri(string uri) - Returns sub-request for the specified uri. You would - need to run it yourself with run() -*/ -PHP_FUNCTION(apache_request_sub_req_lookup_uri) -{ - zval *id; - zval **file; - request_rec *r, *sub_r; - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(file); - sub_r = ap_sub_req_lookup_uri(Z_STRVAL_PP(file), r); - if(!sub_r) { - RETURN_FALSE; - } - return_value = php_apache_request_new(sub_r); -} -/* }}} */ - -/* {{{ proto object apache_request_sub_req_lookup_file(string file) - Returns sub-request for the specified file. You would - need to run it yourself with run(). -*/ -PHP_FUNCTION(apache_request_sub_req_lookup_file) -{ - zval *id; - zval **file; - request_rec *r, *sub_r; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(file); - sub_r = ap_sub_req_lookup_file(Z_STRVAL_PP(file), r); - if(!sub_r) { - RETURN_FALSE; - } - return_value = php_apache_request_new(sub_r); -} -/* }}} */ - -/* {{{ proto object apache_request_sub_req_method_uri(string method, string uri) - Returns sub-request for the specified file. You would - need to run it yourself with run(). -*/ -PHP_FUNCTION(apache_request_sub_req_method_uri) -{ - zval *id; - zval **file, **method; - request_rec *r, *sub_r; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &method, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(method); - convert_to_string_ex(file); - sub_r = ap_sub_req_method_uri(Z_STRVAL_PP(method),Z_STRVAL_PP(file), r); - if(!sub_r) { - RETURN_FALSE; - } - return_value = php_apache_request_new(sub_r); -} -/* }}} */ - -/* {{{ proto long apache_request_run() - This is a wrapper for ap_sub_run_req and ap_destory_sub_req. It takes - sub_request, runs it, destroys it, and returns it's status. -*/ -PHP_FUNCTION(apache_request_run) -{ - zval *id; - request_rec *r; - int status; - - APREQ_GET_REQUEST(id, r); - if(!r || ap_is_initial_req(r)) - RETURN_FALSE; - status = ap_run_sub_req(r); - ap_destroy_sub_req(r); - RETURN_LONG(status); -} -/* }}} */ - -PHP_FUNCTION(apache_request_internal_redirect) -{ - zval *id; - zval **new_uri; - request_rec *r; - - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &new_uri) == FAILURE) { - WRONG_PARAM_COUNT; - } - APREQ_GET_REQUEST(id, r); - convert_to_string_ex(new_uri); - ap_internal_redirect(Z_STRVAL_PP(new_uri), r); -} - -PHP_FUNCTION(apache_request_send_header_field) -{ - zval **fieldname; - zval **fieldval; - zval *id; - request_rec *r; - - if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fieldname, &fieldval) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(fieldname); - convert_to_string_ex(fieldval); - APREQ_GET_REQUEST(id, r); - - ap_send_header_field(r, Z_STRVAL_PP(fieldname), Z_STRVAL_PP(fieldval)); - SG(headers_sent) = 1; - AP(headers_sent) = 1; -} - - - -/* }}} */ - -/* {{{ php_apache_request_class_functions - */ -static zend_function_entry php_apache_request_class_functions[] = { - /* string slots */ - PHP_FALIAS(args, apache_request_args, NULL) - PHP_FALIAS(boundary, apache_request_boundary, NULL) - PHP_FALIAS(content_encoding, apache_request_content_encoding, NULL) - PHP_FALIAS(content_type, apache_request_content_type, NULL) - PHP_FALIAS(filename, apache_request_filename, NULL) - PHP_FALIAS(handler, apache_request_handler, NULL) - PHP_FALIAS(hostname, apache_request_hostname, NULL) - PHP_FALIAS(method, apache_request_method, NULL) - PHP_FALIAS(path_info, apache_request_path_info, NULL) - PHP_FALIAS(protocol, apache_request_protocol, NULL) - PHP_FALIAS(status_line, apache_request_status_line, NULL) - PHP_FALIAS(the_request, apache_request_the_request, NULL) - PHP_FALIAS(unparsed_uri, apache_request_unparsed_uri, NULL) - PHP_FALIAS(uri, apache_request_uri, NULL) - - /* int slots */ - PHP_FALIAS(allowed, apache_request_allowed, NULL) - PHP_FALIAS(bytes_sent, apache_request_bytes_sent, NULL) - PHP_FALIAS(chunked, apache_request_chunked, NULL) - PHP_FALIAS(content_length, apache_request_content_length, NULL) - PHP_FALIAS(header_only, apache_request_header_only, NULL) - PHP_FALIAS(method_number, apache_request_method_number, NULL) - PHP_FALIAS(mtime, apache_request_mtime, NULL) - PHP_FALIAS(no_cache, apache_request_no_cache, NULL) - PHP_FALIAS(no_local_copy, apache_request_no_local_copy, NULL) - PHP_FALIAS(proto_num, apache_request_proto_num, NULL) - PHP_FALIAS(proxyreq, apache_request_proxyreq, NULL) - PHP_FALIAS(read_body, apache_request_read_body, NULL) - PHP_FALIAS(remaining, apache_request_remaining, NULL) - PHP_FALIAS(request_time, apache_request_request_time, NULL) - PHP_FALIAS(status, apache_request_status, NULL) - - /* tables & arrays */ - PHP_FALIAS(headers_in, apache_request_headers_in, NULL) - PHP_FALIAS(headers_out, apache_request_headers_out, NULL) - PHP_FALIAS(err_headers_out, apache_request_err_headers_out, NULL) - - - /* proxy functions for the ap_* functions family */ -#undef auth_name -#undef auth_type -#undef discard_request_body -#undef is_initial_req -#undef meets_conditions -#undef satisfies -#undef set_etag -#undef set_last_modified -#undef some_auth_required -#undef update_mtime -#undef send_http_header -#undef send_header_field -#undef basic_http_header -#undef send_http_trace -#undef send_http_options -#undef send_error_response -#undef set_content_length -#undef set_keepalive -#undef rputs -#undef log_error -#undef lookup_uri -#undef lookup_file -#undef method_uri -#undef run -#undef internal_redirect - PHP_FALIAS(auth_name, apache_request_auth_name, NULL) - PHP_FALIAS(auth_type, apache_request_auth_type, NULL) - PHP_FALIAS(basic_auth_pw, apache_request_basic_auth_pw, NULL) - PHP_FALIAS(discard_request_body, apache_request_discard_request_body, NULL) - PHP_FALIAS(is_initial_req, apache_request_is_initial_req, NULL) - PHP_FALIAS(meets_conditions, apache_request_meets_conditions, NULL) - PHP_FALIAS(remote_host, apache_request_remote_host, NULL) - PHP_FALIAS(satisfies, apache_request_satisfies, NULL) - PHP_FALIAS(server_port, apache_request_server_port, NULL) - PHP_FALIAS(set_etag, apache_request_set_etag, NULL) - PHP_FALIAS(set_last_modified, apache_request_set_last_modified, NULL) - PHP_FALIAS(some_auth_required, apache_request_some_auth_required, NULL) - PHP_FALIAS(update_mtime, apache_request_update_mtime, NULL) - PHP_FALIAS(send_http_header, apache_request_send_http_header, NULL) - PHP_FALIAS(basic_http_header, apache_request_basic_http_header, NULL) - PHP_FALIAS(send_header_field, apache_request_send_header_field, NULL) - PHP_FALIAS(send_http_trace, apache_request_send_http_trace, NULL) - PHP_FALIAS(send_http_options, apache_request_send_http_trace, NULL) - PHP_FALIAS(send_error_response, apache_request_send_error_response, NULL) - PHP_FALIAS(set_content_length, apache_request_set_content_length, NULL) - PHP_FALIAS(set_keepalive, apache_request_set_keepalive, NULL) - PHP_FALIAS(rputs, apache_request_rputs, NULL) - PHP_FALIAS(log_error, apache_request_log_error, NULL) - PHP_FALIAS(lookup_uri, apache_request_sub_req_lookup_uri, NULL) - PHP_FALIAS(lookup_file, apache_request_sub_req_lookup_file, NULL) - PHP_FALIAS(method_uri, apache_request_sub_req_method_uri, NULL) - PHP_FALIAS(run, apache_request_run, NULL) - PHP_FALIAS(internal_redirect, apache_request_internal_redirect, NULL) - { NULL, NULL, NULL } -}; -/* }}} */ - - -static PHP_MINIT_FUNCTION(apache) -{ - zend_class_entry ce; - -#ifdef ZTS - ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL); -#else - php_apache_globals_ctor(&php_apache_info TSRMLS_CC); -#endif - REGISTER_INI_ENTRIES(); - - - le_apachereq = zend_register_list_destructors_ex(php_apache_request_free, NULL, "ApacheRequest", module_number); - INIT_OVERLOADED_CLASS_ENTRY(ce, "ApacheRequest", php_apache_request_class_functions, NULL, NULL, NULL); - apacherequest_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - - REGISTER_LONG_CONSTANT("OK", OK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DECLINED", DECLINED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FORBIDDEN", FORBIDDEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("AUTH_REQUIRED", AUTH_REQUIRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DONE", DONE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SERVER_ERROR", SERVER_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REDIRECT", REDIRECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("BAD_REQUEST", BAD_REQUEST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("NOT_FOUND", NOT_FOUND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_CONTINUE", HTTP_CONTINUE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_SWITCHING_PROTOCOLS", HTTP_SWITCHING_PROTOCOLS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PROCESSING", HTTP_PROCESSING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_OK", HTTP_OK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_CREATED", HTTP_CREATED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_ACCEPTED", HTTP_ACCEPTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NON_AUTHORITATIVE", HTTP_NON_AUTHORITATIVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NO_CONTENT", HTTP_NO_CONTENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_RESET_CONTENT", HTTP_RESET_CONTENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PARTIAL_CONTENT", HTTP_PARTIAL_CONTENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_MULTI_STATUS", HTTP_MULTI_STATUS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_MULTIPLE_CHOICES", HTTP_MULTIPLE_CHOICES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_MOVED_PERMANENTLY", HTTP_MOVED_PERMANENTLY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_MOVED_TEMPORARILY", HTTP_MOVED_TEMPORARILY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_SEE_OTHER", HTTP_SEE_OTHER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_MODIFIED", HTTP_NOT_MODIFIED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_USE_PROXY", HTTP_USE_PROXY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_TEMPORARY_REDIRECT", HTTP_TEMPORARY_REDIRECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_BAD_REQUEST", HTTP_BAD_REQUEST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_UNAUTHORIZED", HTTP_UNAUTHORIZED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PAYMENT_REQUIRED", HTTP_PAYMENT_REQUIRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_FORBIDDEN", HTTP_FORBIDDEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_FOUND", HTTP_NOT_FOUND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_METHOD_NOT_ALLOWED", HTTP_METHOD_NOT_ALLOWED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_ACCEPTABLE", HTTP_NOT_ACCEPTABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PROXY_AUTHENTICATION_REQUIRED", HTTP_PROXY_AUTHENTICATION_REQUIRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_REQUEST_TIME_OUT", HTTP_REQUEST_TIME_OUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_CONFLICT", HTTP_CONFLICT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_GONE", HTTP_GONE, CONST_CS | CONST_PERSISTENT);REGISTER_LONG_CONSTANT("HTTP_LENGTH_REQUIRED", HTTP_LENGTH_REQUIRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_PRECONDITION_FAILED", HTTP_PRECONDITION_FAILED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_REQUEST_ENTITY_TOO_LARGE", HTTP_REQUEST_ENTITY_TOO_LARGE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_REQUEST_URI_TOO_LARGE", HTTP_REQUEST_URI_TOO_LARGE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_UNSUPPORTED_MEDIA_TYPE", HTTP_UNSUPPORTED_MEDIA_TYPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_RANGE_NOT_SATISFIABLE", HTTP_RANGE_NOT_SATISFIABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_EXPECTATION_FAILED", HTTP_EXPECTATION_FAILED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_UNPROCESSABLE_ENTITY", HTTP_UNPROCESSABLE_ENTITY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_LOCKED", HTTP_LOCKED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_FAILED_DEPENDENCY", HTTP_FAILED_DEPENDENCY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_INTERNAL_SERVER_ERROR", HTTP_INTERNAL_SERVER_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_IMPLEMENTED", HTTP_NOT_IMPLEMENTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_BAD_GATEWAY", HTTP_BAD_GATEWAY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_SERVICE_UNAVAILABLE", HTTP_SERVICE_UNAVAILABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_GATEWAY_TIME_OUT", HTTP_GATEWAY_TIME_OUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_VERSION_NOT_SUPPORTED", HTTP_VERSION_NOT_SUPPORTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_VARIANT_ALSO_VARIES", HTTP_VARIANT_ALSO_VARIES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_INSUFFICIENT_STORAGE", HTTP_INSUFFICIENT_STORAGE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HTTP_NOT_EXTENDED", HTTP_NOT_EXTENDED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_EMERG", APLOG_EMERG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_ALERT", APLOG_ALERT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_CRIT", APLOG_CRIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_ERR", APLOG_ERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_WARNING", APLOG_WARNING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_NOTICE", APLOG_NOTICE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_INFO", APLOG_INFO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APLOG_DEBUG", APLOG_DEBUG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_GET", M_GET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_PUT", M_PUT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_POST", M_POST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_DELETE", M_DELETE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_CONNECT", M_CONNECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_OPTIONS", M_OPTIONS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_TRACE", M_TRACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_PATCH", M_PATCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_PROPFIND", M_PROPFIND, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_PROPPATCH", M_PROPPATCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_MKCOL", M_MKCOL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_COPY", M_COPY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_MOVE", M_MOVE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_LOCK", M_LOCK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_UNLOCK", M_UNLOCK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("M_INVALID", M_INVALID, CONST_CS | CONST_PERSISTENT); - - /* Possible values for request_rec.read_body (set by handling module): - * REQUEST_NO_BODY Send 413 error if message has any body - * REQUEST_CHUNKED_ERROR Send 411 error if body without Content-Length - * REQUEST_CHUNKED_DECHUNK If chunked, remove the chunks for me. - * REQUEST_CHUNKED_PASS Pass the chunks to me without removal. - */ - REGISTER_LONG_CONSTANT("REQUEST_NO_BODY", REQUEST_NO_BODY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REQUEST_CHUNKED_ERROR", REQUEST_CHUNKED_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REQUEST_CHUNKED_DECHUNK", REQUEST_CHUNKED_DECHUNK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REQUEST_CHUNKED_PASS", REQUEST_CHUNKED_PASS, CONST_CS | CONST_PERSISTENT); - - /* resolve types for remote_host() */ - REGISTER_LONG_CONSTANT("REMOTE_HOST", REMOTE_HOST, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REMOTE_NAME", REMOTE_NAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REMOTE_NOLOOKUP", REMOTE_NOLOOKUP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("REMOTE_DOUBLE_REV", REMOTE_DOUBLE_REV, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} - - -static PHP_MSHUTDOWN_FUNCTION(apache) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -zend_module_entry apache_module_entry = { - STANDARD_MODULE_HEADER, - "apache", - apache_functions, - PHP_MINIT(apache), - PHP_MSHUTDOWN(apache), - NULL, - NULL, - PHP_MINFO(apache), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -/* {{{ proto bool apache_child_terminate(void) - Terminate apache process after this request */ -PHP_FUNCTION(apache_child_terminate) -{ -#ifndef MULTITHREAD - if (AP(terminate_child)) { - ap_child_terminate( ((request_rec *)SG(server_context)) ); - RETURN_TRUE; - } else { /* tell them to get lost! */ - php_error(E_WARNING, "apache.child_terminate is disabled"); - RETURN_FALSE; - } -#else - php_error(E_WARNING, "apache_child_terminate() is not supported in this build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto string apache_note(string note_name [, string note_value]) - Get and set Apache request notes */ -PHP_FUNCTION(apache_note) -{ - zval **arg_name, **arg_val; - char *note_val; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count<1 || arg_count>2 || - zend_get_parameters_ex(arg_count, &arg_name, &arg_val) ==FAILURE ) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg_name); - note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val); - - if (arg_count == 2) { - convert_to_string_ex(arg_val); - table_set(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val, (*arg_val)->value.str.val); - } - - if (note_val) { - RETURN_STRING(note_val, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(apache) -{ - module *modp = NULL; - char output_buf[128]; -#if !defined(WIN32) && !defined(WINNT) - char name[64]; - char modulenames[1024]; - char *p; -#endif - server_rec *serv; - extern char server_root[MAX_STRING_LEN]; - extern uid_t user_id; - extern char *user_name; - extern gid_t group_id; - extern int max_requests_per_child; - - serv = ((request_rec *) SG(server_context))->server; - - - php_info_print_table_start(); - -#ifdef PHP_WIN32 - php_info_print_table_row(1, "Apache for Windows 95/NT"); - php_info_print_table_end(); - php_info_print_table_start(); -#elif defined(NETWARE) - php_info_print_table_row(1, "Apache for NetWare"); - php_info_print_table_end(); - php_info_print_table_start(); -#else - php_info_print_table_row(2, "APACHE_INCLUDE", PHP_APACHE_INCLUDE); - php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET); -#endif - - php_info_print_table_row(2, "Apache Version", SERVER_VERSION); - -#ifdef APACHE_RELEASE - snprintf(output_buf, sizeof(output_buf), "%d", APACHE_RELEASE); - php_info_print_table_row(2, "Apache Release", output_buf); -#endif - snprintf(output_buf, sizeof(output_buf), "%d", MODULE_MAGIC_NUMBER); - php_info_print_table_row(2, "Apache API Version", output_buf); - snprintf(output_buf, sizeof(output_buf), "%s:%u", serv->server_hostname, serv->port); - php_info_print_table_row(2, "Hostname:Port", output_buf); -#if !defined(WIN32) && !defined(WINNT) - snprintf(output_buf, sizeof(output_buf), "%s(%d)/%d", user_name, (int)user_id, (int)group_id); - php_info_print_table_row(2, "User/Group", output_buf); - snprintf(output_buf, sizeof(output_buf), "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests_per_child, serv->keep_alive ? "on":"off", serv->keep_alive_max); - php_info_print_table_row(2, "Max Requests", output_buf); -#endif - snprintf(output_buf, sizeof(output_buf), "Connection: %d - Keep-Alive: %d", serv->timeout, serv->keep_alive_timeout); - php_info_print_table_row(2, "Timeouts", output_buf); -#if !defined(WIN32) && !defined(WINNT) -/* - This block seems to be working on NetWare; But it seems to be showing - all modules instead of just the loaded ones -*/ - php_info_print_table_row(2, "Server Root", server_root); - - strcpy(modulenames, ""); - for(modp = top_module; modp; modp = modp->next) { - strlcpy(name, modp->name, sizeof(name)); - if ((p = strrchr(name, '.'))) { - *p='\0'; /* Cut off ugly .c extensions on module names */ - } - strlcat(modulenames, name, sizeof(modulenames)); - if (modp->next) { - strlcat(modulenames, ", ", sizeof(modulenames)); - } - } - php_info_print_table_row(2, "Loaded Modules", modulenames); -#endif - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); - - { - register int i; - array_header *arr; - table_entry *elts; - request_rec *r; - - r = ((request_rec *) SG(server_context)); - arr = table_elts(r->subprocess_env); - elts = (table_entry *)arr->elts; - - SECTION("Apache Environment"); - php_info_print_table_start(); - php_info_print_table_header(2, "Variable", "Value"); - for (i=0; i < arr->nelts; i++) { - php_info_print_table_row(2, elts[i].key, elts[i].val); - } - php_info_print_table_end(); - } - - { - array_header *env_arr; - table_entry *env; - int i; - request_rec *r; - - r = ((request_rec *) SG(server_context)); - SECTION("HTTP Headers Information"); - php_info_print_table_start(); - php_info_print_table_colspan_header(2, "HTTP Request Headers"); - php_info_print_table_row(2, "HTTP Request", r->the_request); - env_arr = table_elts(r->headers_in); - env = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (env[i].key && (!PG(safe_mode) || (PG(safe_mode) && strncasecmp(env[i].key, "authorization", 13)))) { - php_info_print_table_row(2, env[i].key, env[i].val); - } - } - php_info_print_table_colspan_header(2, "HTTP Response Headers"); - env_arr = table_elts(r->headers_out); - env = (table_entry *)env_arr->elts; - for(i = 0; i < env_arr->nelts; ++i) { - if (env[i].key) { - php_info_print_table_row(2, env[i].key, env[i].val); - } - } - php_info_print_table_end(); - } -} -/* }}} */ - -/* {{{ proto bool virtual(string filename) - Perform an Apache sub-request */ -/* This function is equivalent to - * in mod_include. It does an Apache sub-request. It is useful - * for including CGI scripts or .shtml files, or anything else - * that you'd parse through Apache (for .phtml files, you'd probably - * want to use . This only works when PHP is compiled - * as an Apache module, since it uses the Apache API for doing - * sub requests. - */ -PHP_FUNCTION(virtual) -{ - zval **filename; - request_rec *rr = NULL; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error(E_WARNING, "Unable to include '%s' - URI lookup failed", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } - - if (rr->status != 200) { - php_error(E_WARNING, "Unable to include '%s' - error finding URI", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } - - php_end_ob_buffers(1 TSRMLS_CC); - php_header(TSRMLS_C); - - if (run_sub_req(rr)) { - php_error(E_WARNING, "Unable to include '%s' - request execution failed", (*filename)->value.str.val); - if (rr) destroy_sub_req (rr); - RETURN_FALSE; - } else { - if (rr) destroy_sub_req (rr); - RETURN_TRUE; - } -} -/* }}} */ - - -/* {{{ apache_table_to_zval(table *, int safe_mode, zval *return_value) - Fetch all HTTP request headers */ -static void apache_table_to_zval(table *t, int safe_mode, zval *return_value) -{ - array_header *env_arr; - table_entry *tenv; - int i; - - array_init(return_value); - env_arr = table_elts(t); - tenv = (table_entry *)env_arr->elts; - for (i = 0; i < env_arr->nelts; ++i) { - if (!tenv[i].key || - (safe_mode && !strncasecmp(tenv[i].key, "authorization", 13))) { - continue; - } - if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) { - RETURN_FALSE; - } - } - -} -/* }}} */ - - -/* {{{ proto array getallheaders(void) -*/ -/* Alias for apache_request_headers() */ -/* }}} */ - -/* {{{ proto array apache_request_headers(void) - Fetch all HTTP request headers */ -PHP_FUNCTION(apache_request_headers) -{ - apache_table_to_zval(((request_rec *)SG(server_context))->headers_in, PG(safe_mode), return_value); -} -/* }}} */ - -/* {{{ proto array apache_response_headers(void) - Fetch all HTTP response headers */ -PHP_FUNCTION(apache_response_headers) -{ - apache_table_to_zval(((request_rec *) SG(server_context))->headers_out, 0, return_value); -} -/* }}} */ - -/* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top]) - Set an Apache subprocess_env variable */ -PHP_FUNCTION(apache_setenv) -{ - int var_len, val_len; - zend_bool top=0; - char *var = NULL, *val = NULL; - request_rec *r = (request_rec *) SG(server_context); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) { - RETURN_FALSE; - } - - while(top) { - if(r->prev) r = r->prev; - else break; - } - - ap_table_setn(r->subprocess_env, ap_pstrndup(r->pool, var, var_len), ap_pstrndup(r->pool, val, val_len)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto object apache_lookup_uri(string URI) - Perform a partial request of the given URI to obtain information about it */ -PHP_FUNCTION(apache_lookup_uri) -{ - zval **filename; - request_rec *rr=NULL; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if(!(rr = sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val); - RETURN_FALSE; - } - object_init(return_value); - add_property_long(return_value,"status", rr->status); - if (rr->the_request) { - add_property_string(return_value,"the_request", rr->the_request, 1); - } - if (rr->status_line) { - add_property_string(return_value,"status_line", (char *)rr->status_line, 1); - } - if (rr->method) { - add_property_string(return_value,"method", (char *)rr->method, 1); - } - if (rr->content_type) { - add_property_string(return_value,"content_type", (char *)rr->content_type, 1); - } - if (rr->handler) { - add_property_string(return_value,"handler", (char *)rr->handler, 1); - } - if (rr->uri) { - add_property_string(return_value,"uri", rr->uri, 1); - } - if (rr->filename) { - add_property_string(return_value,"filename", rr->filename, 1); - } - if (rr->path_info) { - add_property_string(return_value,"path_info", rr->path_info, 1); - } - if (rr->args) { - add_property_string(return_value,"args", rr->args, 1); - } - if (rr->boundary) { - add_property_string(return_value,"boundary", rr->boundary, 1); - } - add_property_long(return_value,"no_cache", rr->no_cache); - add_property_long(return_value,"no_local_copy", rr->no_local_copy); - add_property_long(return_value,"allowed", rr->allowed); - add_property_long(return_value,"sent_bodyct", rr->sent_bodyct); - add_property_long(return_value,"bytes_sent", rr->bytes_sent); - add_property_long(return_value,"byterange", rr->byterange); - add_property_long(return_value,"clength", rr->clength); - -#if MODULE_MAGIC_NUMBER >= 19980324 - if (rr->unparsed_uri) { - add_property_string(return_value,"unparsed_uri", rr->unparsed_uri, 1); - } - if(rr->mtime) { - add_property_long(return_value,"mtime", rr->mtime); - } -#endif - if(rr->request_time) { - add_property_long(return_value,"request_time", rr->request_time); - } - - destroy_sub_req(rr); -} -/* }}} */ - - -#if 0 -This function is most likely a bad idea. Just playing with it for now. - -PHP_FUNCTION(apache_exec_uri) -{ - zval **filename; - request_rec *rr=NULL; - TSRMLS_FETCH(); - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(filename); - - if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) { - php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val); - RETURN_FALSE; - } - RETVAL_LONG(ap_run_sub_req(rr)); - ap_destroy_sub_req(rr); -} -#endif - -/* {{{ proto string apache_get_version(void) - Fetch Apache version */ -PHP_FUNCTION(apache_get_version) -{ - char *apv = (char *) ap_get_server_version(); - - if (apv && *apv) { - RETURN_STRING(apv, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array apache_get_modules(void) - Get a list of loaded Apache modules */ -PHP_FUNCTION(apache_get_modules) -{ - int n; - char *p; - - array_init(return_value); - - for (n = 0; ap_loaded_modules[n]; ++n) { - char *s = (char *) ap_loaded_modules[n]->name; - if ((p = strchr(s, '.'))) { - add_next_index_stringl(return_value, s, (p - s), 1); - } else { - add_next_index_string(return_value, s, 1); - } - } -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/apache_hooks/php_apache_http.h b/sapi/apache_hooks/php_apache_http.h deleted file mode 100644 index 2a030482f67ba..0000000000000 --- a/sapi/apache_hooks/php_apache_http.h +++ /dev/null @@ -1,44 +0,0 @@ -#define NO_REGEX_EXTRA_H - -#ifdef WIN32 -#include -#include -#endif - -#ifdef NETWARE -#include -#endif - -#include "zend.h" -#include "zend_stack.h" -#include "php_regex.h" - -#include "httpd.h" -#include "http_config.h" - -#if MODULE_MAGIC_NUMBER > 19980712 -# include "ap_compat.h" -#else -# if MODULE_MAGIC_NUMBER > 19980324 -# include "compat.h" -# endif -#endif - -#include "http_core.h" -#include "http_main.h" -#include "http_protocol.h" -#include "http_request.h" -#include "http_log.h" -#include "util_script.h" - -#include "php_variables.h" -#include "php_main.h" -#include "php_ini.h" -#include "ext/standard/php_standard.h" - -#include "mod_php5.h" - - -zval *php_apache_request_new(request_rec *r); - -int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC); diff --git a/sapi/apache_hooks/sapi_apache.c b/sapi/apache_hooks/sapi_apache.c deleted file mode 100644 index 0dfdb7ad2b861..0000000000000 --- a/sapi/apache_hooks/sapi_apache.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | (with helpful hints from Dean Gaudet | - | PHP 4.0 patches by: | - | Zeev Suraski | - | Stig Bakken | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php_apache_http.h" - -/* {{{ apache_php_module_main - */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) -{ - zend_file_handle file_handle; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return FAILURE; - } - /* sending a file handle to another dll is not working - so let zend open it. */ - - if (display_source_mode) { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - php_get_highlight_struct(&syntax_highlighter_ini); - if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC)){ - return OK; - } else { - return NOT_FOUND; - } - } else { - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.handle.fd = 0; - file_handle.filename = SG(request_info).path_translated; - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - (void) php_execute_script(&file_handle TSRMLS_CC); - } - AP(in_request) = 0; - - return (OK); -} -/* }}} */ - -/* {{{ apache_php_module_hook - */ -int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC) -{ - zend_file_handle file_handle; - zval *req; - char *tmp; - -#if PHP_SIGCHILD - signal(SIGCHLD, sigchld_handler); -#endif - if(AP(current_hook) == AP_RESPONSE) { - if (php_request_startup_for_hook(TSRMLS_C) == FAILURE) - return FAILURE; - } - else { - if (php_request_startup_for_hook(TSRMLS_C) == FAILURE) - return FAILURE; - } - - req = php_apache_request_new(r); - if(PG(register_globals)) { - php_register_variable_ex("request", req, NULL TSRMLS_CC); - } - else { - php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC); - } - switch(handler->type) { - case AP_HANDLER_TYPE_FILE: - php_register_variable("PHP_SELF_HOOK", handler->name, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC); - memset(&file_handle, 0, sizeof(file_handle)); - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = handler->name; - (void) php_execute_simple_script(&file_handle, ret TSRMLS_CC); - break; - case AP_HANDLER_TYPE_METHOD: - if( (tmp = strstr(handler->name, "::")) != NULL && *(tmp+2) != '\0' ) { - zval *class; - zval *method; - *tmp = '\0'; - ALLOC_ZVAL(class); - ZVAL_STRING(class, handler->name, 1); - ALLOC_ZVAL(method); - ZVAL_STRING(method, tmp +2, 1); - *tmp = ':'; - call_user_function_ex(EG(function_table), &class, method, ret, 0, NULL, 0, NULL TSRMLS_CC); - zval_dtor(class); - zval_dtor(method); - } - else { - php_error(E_ERROR, "Unable to call %s - not a Class::Method\n", handler->name); - /* not a class::method */ - } - break; - default: - /* not a valid type */ - assert(0); - break; - } - zval_dtor(req); - AP(in_request) = 0; - - return OK; -} - -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/caudium/CREDITS b/sapi/caudium/CREDITS deleted file mode 100644 index 45789dbdfed33..0000000000000 --- a/sapi/caudium/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Caudium / Roxen -David Hedbor diff --git a/sapi/caudium/README b/sapi/caudium/README deleted file mode 100644 index 86ef65655d42e..0000000000000 --- a/sapi/caudium/README +++ /dev/null @@ -1,16 +0,0 @@ -Embedded Caudium PHP support. It seems to work but isn't tested -much. Due to a design choice it requires _Pike_ threads and a -thread-safe PHP. It doesn't however require _Caudium_ to run in -threaded mode. Due to the design, utilization of multiple processors -should be pretty good. - -It requires a new Pike 7.0 and Caudium. It will not work with -Roxen. Also, with the help of the VIRTUAL_DIR code in PHP, PHP -execution should be very similar to that of mod_php or the cgi -script. - -If you have any questions, please contact me, David Hedbor -(neotron@php.net or neotron@caudium.net). For more information on -Caudium, see http://caudium.net/ and http://caudium.org/. - - diff --git a/sapi/caudium/TODO b/sapi/caudium/TODO deleted file mode 100644 index b8217c5934927..0000000000000 --- a/sapi/caudium/TODO +++ /dev/null @@ -1,30 +0,0 @@ -TODO: - -- per-virtual-server configuration -- configurable limit of number of concurrent PHP executions -- fix setting of auth info. - -FIXED: -+ => fixed -- => not fixed and no fix planned -? => Maybe fixed, maybe not. - -+ Allow multiple headers - This is now fixed. -+ fix backtraces - Uses th_farm, thus problem is fixed -+ exit in PHP exits Caudium - Name conflict with do_exit in Pike and PHP. Reported to both teams. -+ POST newline added? - Was a Caudium bug. -+ use th_farm - Yeppers. Works great. -- change cwd in single threaded mode - There will be no single threaded mode support. The Caudium module - will requite PHP ZTS and Pike threads to run. Single threaded PHP - is rather uninteresting anyway. -? Recursive mutex lock problem: - Dunno if this is fixed. Major rewrite so it would have to be - retested. - - diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c deleted file mode 100644 index 197448a43365f..0000000000000 --- a/sapi/caudium/caudium.c +++ /dev/null @@ -1,792 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: David Hedbor | - | Based on aolserver SAPI by Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#ifdef HAVE_CAUDIUM - -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "ext/standard/info.h" - -#include "php_version.h" - -/* Pike Include Files - * - * conflicts with pike avoided by only using long names. Requires a new - * Pike 0.7 since it was implemented for this interface only. - * - */ -#define NO_PIKE_SHORTHAND - -/* Ok, we are now using Pike level threads to handle PHP5 since - * the nice th_farm threads aren't working on Linux with glibc 2.2 - * (why this is I don't know). - */ -#define USE_PIKE_LEVEL_THREADS - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if (PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION == 1 && PIKE_BUILD_VERSION >= 12) || PIKE_MAJOR_VERSION > 7 || (PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION > 1) -# include "pike_error.h" -#else -# include "error.h" -# ifndef Pike_error -# define Pike_error error -# endif -#endif - -/* Pike 7.x and newer */ -#define MY_MAPPING_LOOP(md, COUNT, KEY) \ - for(COUNT=0;COUNT < md->data->hashsize; COUNT++ ) \ - for(KEY=md->data->hash[COUNT];KEY;KEY=KEY->next) - -#ifndef ZTS -/* Need thread safety */ -#error You need to compile PHP with threads. -#endif - -#ifndef PIKE_THREADS -#error The PHP5 module requires that your Pike has thread support. -#endif - -#undef HIDE_GLOBAL_VARIABLES -#undef REVEAL_GLOBAL_VARIABLES -#define HIDE_GLOBAL_VARIABLES() -#define REVEAL_GLOBAL_VARIABLES() - -/* php_caudium_request is per-request object storage */ - -typedef struct -{ - struct mapping *request_data; - struct object *my_fd_obj; - struct svalue done_cb; - struct pike_string *filename; - int my_fd; - int written; - TSRMLS_D; -} php_caudium_request; - - -void pike_module_init(void); -void pike_module_exit(void); -static void free_struct(TSRMLS_D); -void f_php_caudium_request_handler(INT32 args); - -/* Defines to get to the data supplied when the script is started. */ - -/* Per thread storage area id... */ -static int caudium_globals_id; - -#define GET_THIS() php_caudium_request *_request = ts_resource(caudium_globals_id) -#define THIS _request -#define PTHIS ((php_caudium_request *)(Pike_fp->current_storage)) -/* File descriptor integer. Used to write directly to the FD without - * passing Pike - */ -#define MY_FD (THIS->my_fd) - -/* FD object. Really a PHPScript object from Pike which implements a couple - * of functions to handle headers, writing and buffering. - */ -#define MY_FD_OBJ ((struct object *)(THIS->my_fd_obj)) - -/* Mapping with data supplied from the calling Caudium module. Contains - * a mapping with headers, an FD object etc. - */ -#define REQUEST_DATA ((struct mapping *)(THIS->request_data)) - -extern int fd_from_object(struct object *o); -static unsigned char caudium_php_initialized; - -#ifndef mt_lock_interpreter -#define mt_lock_interpreter() mt_lock(&interpreter_lock); -#define mt_unlock_interpreter() mt_unlock(&interpreter_lock); -#endif - - -/* This allows calling of pike functions from the PHP callbacks, - * which requires the Pike interpreter to be locked. - */ -#define THREAD_SAFE_RUN(COMMAND, what) do {\ - struct thread_state *state;\ - if((state = thread_state_for_id(th_self()))!=NULL) {\ - if(!state->swapped) {\ - COMMAND;\ - } else {\ - mt_lock_interpreter();\ - SWAP_IN_THREAD(state);\ - COMMAND;\ - SWAP_OUT_THREAD(state);\ - mt_unlock_interpreter();\ - }\ - }\ -} while(0) - - - -/* Low level header lookup. Basically looks for the named header in the mapping - * headers in the supplied options mapping. - */ - -INLINE static struct svalue *lookup_header(char *headername) -{ - struct svalue *headers, *value; - struct pike_string *sind; - GET_THIS(); - sind = make_shared_string("env"); - headers = low_mapping_string_lookup(REQUEST_DATA, sind); - free_string(sind); - if(!headers || headers->type != PIKE_T_MAPPING) return NULL; - sind = make_shared_string(headername); - value = low_mapping_string_lookup(headers->u.mapping, sind); - free_string(sind); - if(!value) return NULL; - return value; -} - -/* Lookup a header in the mapping and return the value as a string, or - * return the default if it's missing - */ -INLINE static char *lookup_string_header(char *headername, char *default_value) -{ - struct svalue *head = NULL; - THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup"); - if(!head || head->type != PIKE_T_STRING) - return default_value; - return head->u.string->str; -} - -/* Lookup a header in the mapping and return the value as if it's an integer - * and otherwise return the default. - */ -INLINE static int lookup_integer_header(char *headername, int default_value) -{ - struct svalue *head = NULL; - THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup"); - if(!head || head->type != PIKE_T_INT) - return default_value; - return head->u.integer; -} - -/* - * php_caudium_low_ub_write() writes data to the client connection. Might be - * rewritten to do more direct IO to save CPU and the need to lock the - * interpreter for better threading. - */ - -INLINE static int -php_caudium_low_ub_write(const char *str, uint str_length TSRMLS_DC) { - int sent_bytes = 0; - struct pike_string *to_write = NULL; - GET_THIS(); - if(!MY_FD_OBJ->prog) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return -1; - } - to_write = make_shared_binary_string(str, str_length); - push_string(to_write); - safe_apply(MY_FD_OBJ, "write", 1); - if(Pike_sp[-1].type == PIKE_T_INT) - sent_bytes = Pike_sp[-1].u.integer; - pop_stack(); - if(sent_bytes != str_length) { - /* This means the connection is closed. Dead. Gone. *sniff* */ - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - } - return sent_bytes; -} - -/* - * php_caudium_sapi_ub_write() calls php_caudium_low_ub_write in a Pike thread - * safe manner or writes directly to the output FD if RXML post-parsing is - * disabled. - */ - -static int -php_caudium_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - GET_THIS(); - int sent_bytes = 0, fd = MY_FD; - if(fd) - { - for(sent_bytes=0;sent_bytes < str_length;) - { - int written; - written = fd_write(fd, str + sent_bytes, str_length - sent_bytes); - if(written < 0) - { - switch(errno) - { - default: - /* This means the connection is closed. Dead. Gone. *sniff* */ - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - THIS->written += sent_bytes; - return sent_bytes; - case EINTR: - case EWOULDBLOCK: - continue; - } - } else { - sent_bytes += written; - } - } - THIS->written += sent_bytes; - } else { - THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length TSRMLS_CC), - "write"); - } - return sent_bytes; -} - -/* php_caudium_set_header() sets a header in the header mapping. Called in a - * thread safe manner from php_caudium_sapi_header_handler. - */ -INLINE static void -php_caudium_set_header(char *header_name, char *value, char *p) -{ - struct svalue hsval; - struct pike_string *hval, *ind, *hind; - struct mapping *headermap; - struct svalue *s_headermap, *soldval; - int vallen; - GET_THIS(); - /* hval = make_shared_string(value); */ - ind = make_shared_string(" _headers"); - hind = make_shared_binary_string(header_name, - (int)(p - header_name)); - - s_headermap = low_mapping_string_lookup(REQUEST_DATA, ind); - if(!s_headermap || s_headermap->type != PIKE_T_MAPPING) - { - struct svalue mappie; - mappie.type = PIKE_T_MAPPING; - headermap = allocate_mapping(1); - mappie.u.mapping = headermap; - mapping_string_insert(REQUEST_DATA, ind, &mappie); - free_mapping(headermap); - hval = make_shared_string(value); - } else { - headermap = s_headermap->u.mapping; - soldval = low_mapping_string_lookup(headermap, hind); - vallen = strlen(value); - if(soldval != NULL && - soldval->type == PIKE_T_STRING && - soldval->u.string->size_shift == 0) { - /* Existing, valid header. Prepend.*/ - hval = begin_shared_string(soldval->u.string->len + 1 + vallen); - MEMCPY(hval->str, soldval->u.string->str, soldval->u.string->len); - STR0(hval)[soldval->u.string->len] = '\0'; - MEMCPY(hval->str+soldval->u.string->len+1, value, vallen); - hval = end_shared_string(hval); - } else { - hval = make_shared_string(value); - } - } - hsval.type = PIKE_T_STRING; - hsval.u.string = hval; - - mapping_string_insert(headermap, hind, &hsval); - - free_string(hval); - free_string(ind); - free_string(hind); -} - -/* - * php_caudium_sapi_header_handler() sets a HTTP reply header to be - * sent to the client. - */ -static int -php_caudium_sapi_header_handler(sapi_header_struct *sapi_header, - sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - - if(p) { - do { - header_content++; - } while(*header_content == ' '); - THREAD_SAFE_RUN(php_caudium_set_header(header_name, header_content, p), "header handler"); - } - sapi_free_header(sapi_header); - return 0; -} - -/* - * php_caudium_sapi_send_headers() flushes the headers to the client. - * Called before real content is sent by PHP. - */ - -INLINE static int -php_caudium_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - struct pike_string *ind; - struct svalue *s_headermap; - GET_THIS(); - if(!MY_FD_OBJ->prog) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return SAPI_HEADER_SEND_FAILED; - } - ind = make_shared_string(" _headers"); - s_headermap = low_mapping_string_lookup(REQUEST_DATA, ind); - free_string(ind); - - push_int(SG(sapi_headers).http_response_code); - if(s_headermap && s_headermap->type == PIKE_T_MAPPING) - ref_push_mapping(s_headermap->u.mapping); - else - push_int(0); - safe_apply(MY_FD_OBJ, "send_headers", 2); - pop_stack(); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int -php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - int res = 0; - THREAD_SAFE_RUN(res = php_caudium_low_send_headers(sapi_headers TSRMLS_CC), "send headers"); - return res; -} - -/* - * php_caudium_sapi_read_post() reads a specified number of bytes from - * the client. Used for POST/PUT requests. - */ - -INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes) -{ - uint total_read = 0; - GET_THIS(); - TSRMLS_FETCH(); - - if(!MY_FD_OBJ->prog) - { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return -1; - } - push_int(count_bytes); - safe_apply(MY_FD_OBJ, "read_post", 1); - if(Pike_sp[-1].type == PIKE_T_STRING) { - MEMCPY(buf, Pike_sp[-1].u.string->str, - (total_read = Pike_sp[-1].u.string->len)); - buf[total_read] = '\0'; - } else - total_read = 0; - pop_stack(); - return total_read; -} - -static int -php_caudium_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - uint total_read = 0; - THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes), "read post"); - return total_read; -} - -/* - * php_caudium_sapi_read_cookies() returns the Cookie header from - * the HTTP request header - */ - -static char * -php_caudium_sapi_read_cookies(TSRMLS_D) -{ - char *cookies; - cookies = lookup_string_header("HTTP_COOKIE", NULL); - return cookies; -} - -static void php_info_caudium(ZEND_MODULE_INFO_FUNC_ARGS) -{ - /* char buf[512]; */ - php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id$"); - /* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); - php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); - php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); - php_info_print_table_row(2, "Installation path", Ns_InfoHomePath()); - php_info_print_table_row(2, "Hostname of server", Ns_InfoHostname()); - php_info_print_table_row(2, "Source code label", Ns_InfoLabel()); - php_info_print_table_row(2, "Server platform", Ns_InfoPlatform()); - snprintf(buf, 511, "%s/%s", Ns_InfoServerName(), Ns_InfoServerVersion()); - php_info_print_table_row(2, "Server version", buf); - snprintf(buf, 511, "%d day(s), %02d:%02d:%02d", - uptime / 86400, - (uptime / 3600) % 24, - (uptime / 60) % 60, - uptime % 60); - php_info_print_table_row(2, "Server uptime", buf); - */ - php_info_print_table_end(); -} - -static zend_module_entry php_caudium_module = { - STANDARD_MODULE_HEADER, - "Caudium", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_caudium, - NULL, - STANDARD_MODULE_PROPERTIES -}; - - -INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC) -{ - int i; - struct keypair *k; - struct svalue *headers; - struct pike_string *sind; - struct svalue *ind; - struct svalue *val; - GET_THIS(); - php_register_variable("PHP_SELF", SG(request_info).request_uri, - track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", - track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_METHOD", - (char *) SG(request_info).request_method, - track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", SG(request_info).request_uri, - track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, - track_vars_array TSRMLS_CC); - - sind = make_shared_string("env"); - headers = low_mapping_string_lookup(REQUEST_DATA, sind); - free_string(sind); - if(headers && headers->type == PIKE_T_MAPPING) { - MY_MAPPING_LOOP(headers->u.mapping, i, k) { - ind = &k->ind; - val = &k->val; - if(ind && ind->type == PIKE_T_STRING && - val && val->type == PIKE_T_STRING) { - php_register_variable(ind->u.string->str, val->u.string->str, - track_vars_array TSRMLS_CC ); - } - } - } -} - -static void sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC) -{ - THREAD_SAFE_RUN(low_sapi_caudium_register_variables(track_vars_array TSRMLS_CC), "register_variables"); -} - - -static int php_caudium_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_caudium_module, 1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -/* this structure is static (as in "it does not change") */ -static sapi_module_struct caudium_sapi_module = { - "caudium", - "Caudium", - php_caudium_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - NULL, /* activate */ - NULL, /* deactivate */ - php_caudium_sapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - php_error, /* error handler */ - php_caudium_sapi_header_handler, /* header handler */ - php_caudium_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - php_caudium_sapi_read_post, /* read POST data */ - php_caudium_sapi_read_cookies, /* read cookies */ - sapi_caudium_register_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -/* - * php_caudium_module_main() is called by the per-request handler and - * "executes" the script - */ - -static void php_caudium_module_main(php_caudium_request *ureq) -{ - int res; - zend_file_handle file_handle; -#ifndef USE_PIKE_LEVEL_THREADS - struct thread_state *state; - extern struct program *thread_id_prog; -#endif - TSRMLS_FETCH(); - GET_THIS(); - THIS->filename = ureq->filename; - THIS->done_cb = ureq->done_cb; - THIS->my_fd_obj = ureq->my_fd_obj; - THIS->my_fd = ureq->my_fd; - THIS->request_data = ureq->request_data; - free(ureq); - -#ifndef USE_PIKE_LEVEL_THREADS - mt_lock_interpreter(); - init_interpreter(); -#if PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION < 1 - thread_id = low_clone(thread_id_prog); - state = OBJ2THREAD(thread_id); - Pike_stack_top=((char *)&state)+ (thread_stack_size-16384) * STACK_DIRECTION; - recoveries = NULL; - call_c_initializers(thread_id); - OBJ2THREAD(thread_id)->id=th_self(); - num_threads++; - thread_table_insert(thread_id); - state->status=THREAD_RUNNING; -#else - Pike_interpreter.thread_id = low_clone(thread_id_prog); - state = OBJ2THREAD(Pike_interpreter.thread_id); - Pike_interpreter.stack_top=((char *)&state)+ (thread_stack_size-16384) * STACK_DIRECTION; - Pike_interpreter.recoveries = NULL; - call_c_initializers(Pike_interpreter.thread_id); - state->id=th_self(); - /* SWAP_OUT_THREAD(OBJ2THREAD(Pike_interpreter.thread_id)); */ - num_threads++; - thread_table_insert(Pike_interpreter.thread_id); - state->status=THREAD_RUNNING; -#endif - state->swapped = 0; -#endif - SG(request_info).query_string = lookup_string_header("QUERY_STRING", 0); - SG(server_context) = (void *)1; /* avoid server_context == NULL */ - - /* path_translated is apparently the absolute path to the file, not - the translated PATH_INFO - */ - SG(request_info).path_translated = - lookup_string_header("SCRIPT_FILENAME", NULL); - SG(request_info).request_uri = lookup_string_header("DOCUMENT_URI", NULL); - if(!SG(request_info).request_uri) - SG(request_info).request_uri = lookup_string_header("SCRIPT_NAME", NULL); - SG(request_info).request_method = lookup_string_header("REQUEST_METHOD", "GET"); - SG(request_info).content_length = lookup_integer_header("HTTP_CONTENT_LENGTH", 0); - SG(request_info).content_type = lookup_string_header("HTTP_CONTENT_TYPE", NULL); - SG(sapi_headers).http_response_code = 200; - if (!strcmp(SG(request_info).request_method, "HEAD")) { - SG(request_info).headers_only = 1; - } else { - SG(request_info).headers_only = 0; - } - - /* Let PHP5 handle the deconding of the AUTH */ - php_handle_auth_data(lookup_string_header("HTTP_AUTHORIZATION", NULL), TSRMLS_C); - /* Swap out this thread and release the interpreter lock to allow - * Pike threads to run. We wait since the above would otherwise require - * a lot of unlock/lock. - */ -#ifndef USE_PIKE_LEVEL_THREADS - SWAP_OUT_THREAD(state); - mt_unlock_interpreter(); -#else - THREADS_ALLOW(); -#endif - -#ifdef VIRTUAL_DIR - /* Change virtual directory, if the feature is enabled, which is - * (almost) a requirement for PHP in Caudium. Might want to fail if it - * isn't. Not a problem though, since it's on by default when using ZTS - * which we require. - */ - VCWD_CHDIR_FILE(THIS->filename->str); -#endif - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = THIS->filename->str; - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - - THIS->written = 0; - res = php_request_startup(TSRMLS_C); - - if(res == FAILURE) { - THREAD_SAFE_RUN({ - apply_svalue(&THIS->done_cb, 0); - pop_stack(); - free_struct(TSRMLS_C); - }, "Negative run response"); - } else { - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - THREAD_SAFE_RUN({ - push_int(THIS->written); - apply_svalue(&THIS->done_cb, 1); - pop_stack(); - free_struct(TSRMLS_C); - }, "positive run response"); - } - -#ifndef USE_PIKE_LEVEL_THREADS - mt_lock_interpreter(); - SWAP_IN_THREAD(state); -#if PIKE_MAJOR_VERSION == 7 && PIKE_MINOR_VERSION < 1 - state->status=THREAD_EXITED; - co_signal(& state->status_change); - thread_table_delete(thread_id); - free_object(thread_id); - thread_id=NULL; -#else - state->status=THREAD_EXITED; - co_signal(& state->status_change); - thread_table_delete(Pike_interpreter.thread_id); - free_object(Pike_interpreter.thread_id); - Pike_interpreter.thread_id=NULL; -#endif - cleanup_interpret(); - num_threads--; - mt_unlock_interpreter(); -#else - THREADS_DISALLOW(); -#endif -} - -/* - * The php_caudium_request_handler() is called per request and handles - * everything for one request. - */ - -void f_php_caudium_request_handler(INT32 args) -{ - struct object *my_fd_obj; - struct mapping *request_data; - struct svalue *done_callback; - struct pike_string *script; - struct svalue *raw_fd; - struct pike_string *ind; - php_caudium_request *_request; - THIS = malloc(sizeof(php_caudium_request)); - if(THIS == NULL) - Pike_error("Out of memory."); - - get_all_args("PHP5.Interpreter->run", args, "%S%m%O%*", &script, - &request_data, &my_fd_obj, &done_callback); - if(done_callback->type != PIKE_T_FUNCTION) - Pike_error("PHP5.Interpreter->run: Bad argument 4, expected function.\n"); - add_ref(request_data); - add_ref(my_fd_obj); - add_ref(script); - - THIS->request_data = request_data; - THIS->my_fd_obj = my_fd_obj; - THIS->filename = script; - assign_svalue_no_free(&THIS->done_cb, done_callback); - - ind = make_shared_binary_string("my_fd", 5); - raw_fd = low_mapping_string_lookup(THIS->request_data, ind); - if(raw_fd && raw_fd->type == PIKE_T_OBJECT) - { - int fd = fd_from_object(raw_fd->u.object); - if(fd == -1) - THIS->my_fd = 0; /* Don't send directly to this FD... */ - else - THIS->my_fd = fd; - } else - THIS->my_fd = 0; -#ifdef USE_PIKE_LEVEL_THREADS - php_caudium_module_main(THIS); -#else - th_farm((void (*)(void *))php_caudium_module_main, THIS); -#endif - pop_n_elems(args); -} - -static void free_struct(TSRMLS_D) -{ - GET_THIS(); - if(THIS->request_data) free_mapping(THIS->request_data); - if(THIS->my_fd_obj) free_object(THIS->my_fd_obj); - free_svalue(&THIS->done_cb); - if(THIS->filename) free_string(THIS->filename); - MEMSET(THIS, 0, sizeof(php_caudium_request)); -} - - -/* - * pike_module_init() is called by Pike once at startup - * - * This functions allocates basic structures - */ - -void pike_module_init( void ) -{ - if (!caudium_php_initialized) { - caudium_php_initialized = 1; - tsrm_startup(1, 1, 0, NULL); - ts_allocate_id(&caudium_globals_id, sizeof(php_caudium_request), NULL, NULL); - sapi_startup(&caudium_sapi_module); - sapi_module.startup(&caudium_sapi_module); - } - start_new_program(); /* Text */ - pike_add_function("run", f_php_caudium_request_handler, - "function(string, mapping, object, function:void)", 0); - end_class("Interpreter", 0); -} - -/* - * pike_module_exit() performs the last steps before the - * server exists. Shutdowns basic services and frees memory - */ - -void pike_module_exit(void) -{ - caudium_php_initialized = 0; - sapi_module.shutdown(&caudium_sapi_module); - tsrm_shutdown(); -} -#endif diff --git a/sapi/caudium/config.m4 b/sapi/caudium/config.m4 deleted file mode 100644 index 8aba33e23d203..0000000000000 --- a/sapi/caudium/config.m4 +++ /dev/null @@ -1,98 +0,0 @@ -dnl -dnl $Id$ -dnl - -RESULT=no -PHP_ARG_WITH(caudium,, -[ --with-caudium[=DIR] Build PHP as a Pike module for use with Caudium. - DIR is the Caudium server dir [/usr/local/caudium/server]], no, no) - -AC_MSG_CHECKING([for Caudium support]) - -if test "$PHP_CAUDIUM" != "no"; then - if test "$prefix" = "NONE"; then CPREF=/usr/local/; fi - if test ! -d $PHP_CAUDIUM ; then - if test "$prefix" = "NONE"; then - PHP_CAUDIUM=/usr/local/caudium/server/ - else - PHP_CAUDIUM=$prefix/caudium/server/ - fi - fi - if test -f $PHP_CAUDIUM/bin/caudium; then - PIKE=$PHP_CAUDIUM/bin/caudium - elif test -f $PHP_CAUDIUM/bin/pike; then - PIKE=$PHP_CAUDIUM/bin/pike - else - AC_MSG_ERROR([Could not find a pike in $PHP_CAUDIUM/bin/]) - fi - if $PIKE -e 'float v; int rel;sscanf(version(), "Pike v%f release %d", v, rel);v += rel/10000.0; if(v < 7.0268) exit(1); exit(0);'; then - PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'` - PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,' ` - if test -z "$PIKE_INCLUDE_DIR" || test -z "$PIKE_MODULE_DIR"; then - AC_MSG_ERROR(Failed to figure out Pike module and include directories) - fi - AC_MSG_RESULT(yes) - PIKE=`echo $PIKE | pike -e 'int tries=100; - string orig,pike=Stdio.File("stdin")->read()-"\n"; - orig=pike; - if(search(orig, "/")) - orig = combine_path(getcwd(), orig); - while(!catch(pike=readlink(pike)) && tries--) - ; - write(combine_path(dirname(orig), pike)); '` - PHP_ADD_INCLUDE($PIKE_INCLUDE_DIR) - if test "$prefix" != "NONE"; then - PIKE_C_INCLUDE=$prefix/include/`basename $PIKE` - else - PIKE_C_INCLUDE=/usr/local/include/`basename $PIKE` - fi - AC_MSG_CHECKING([for C includes in $PIKE_C_INCLUDE]) - if test -f $PIKE_C_INCLUDE/version.h; then - PIKE_TEST_VER=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'` - ###### VERSION MATCH CHECK ####### - PMAJOR="^#define PIKE_MAJOR_VERSION" - PMINOR="^#define PIKE_MINOR_VERSION" - PBUILD="^#define PIKE_BUILD_VERSION" - - PIKE_CMAJOR_VERSION=0 - PIKE_CMINOR_VERSION=0 - PIKE_CBUILD_VERSION=0 - - PIKE_CMAJOR_VERSION=`grep "$PMAJOR" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/'` - if test -z "$PIKE_CMAJOR_VERSION"; then - if test -n "`grep f_version $PIKE_C_INCLUDE/version.h`"; then - PIKE_CMAJOR_VERSION=6 - fi - else - PIKE_CMINOR_VERSION=`grep "$PMINOR" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/'` - PIKE_CBUILD_VERSION=`grep "$PBUILD" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/'` - fi - - if test "$PIKE_TEST_VER" = "${PIKE_CMAJOR_VERSION}.${PIKE_CMINOR_VERSION}.${PIKE_CBUILD_VERSION}"; then - PHP_ADD_INCLUDE($PIKE_C_INCLUDE) - PIKE_INCLUDE_DIR="$PIKE_INCLUDE_DIR, $PIKE_C_INCLUDE" - AC_MSG_RESULT(found) - else - AC_MSG_RESULT(version mismatch) - fi - else - AC_MSG_RESULT(not found) - fi - else - AC_MSG_ERROR([Caudium PHP5 requires Pike 7.0 or newer]) - fi - PIKE_VERSION=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'` - AC_DEFINE(HAVE_CAUDIUM,1,[Whether to compile with Caudium support]) - PHP_SELECT_SAPI(caudium, shared, caudium.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PHP_CAUDIUM/lib/$PIKE_VERSION/PHP5.so" - RESULT=" *** Pike binary used: $PIKE - *** Pike include dir(s) used: $PIKE_INCLUDE_DIR - *** Pike version: $PIKE_VERSION" - dnl Always use threads since thread-free support really blows. - PHP_BUILD_THREAD_SAFE -fi -AC_MSG_RESULT($RESULT) - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/cgi/CREDITS b/sapi/cgi/CREDITS deleted file mode 100644 index 1a2ec4901fe7b..0000000000000 --- a/sapi/cgi/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -CGI / FastCGI -Rasmus Lerdorf, Stig Bakken, Shane Caraveo, Dmitry Stogov diff --git a/sapi/cgi/Makefile.frag b/sapi/cgi/Makefile.frag deleted file mode 100644 index 57a3b2937c091..0000000000000 --- a/sapi/cgi/Makefile.frag +++ /dev/null @@ -1,2 +0,0 @@ -$(SAPI_CGI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) - $(BUILD_CGI) diff --git a/sapi/cgi/README.FastCGI b/sapi/cgi/README.FastCGI deleted file mode 100644 index 3dda295d84334..0000000000000 --- a/sapi/cgi/README.FastCGI +++ /dev/null @@ -1,151 +0,0 @@ -Credits: -Ben Mansell, Stephen Landamore, Daniel Silverstone, Shane Caraveo - -Building PHP ------------- - -You must add '--enable-fastcgi' to the configure command on Linux or -OSX based systems to get fastcgi support in the php-cgi binary. You -also must not use '--enable-discard-path'. - -Running the FastCGI PHP module ------------------------------- - -There are two ways to run the resulting 'php' binary after the fastcgi -version has been built: - -1) Configure your web server to run the PHP binary itself. - -This is the simplest method, obviously you will have to configure your -web server appropriately. Some web servers may also not support this method, -or may not be as efficient. - -2) Run PHP separately from the web server. - -In this setup, PHP is started as a separate process entirely from the web -server. It will listen on a socket for new FastCGI requests, and deliver -PHP pages as appropriate. This is the recommended way of running PHP-FastCGI. -To run this way, you must start the PHP binary running by giving it an IP -and a port number to listen to on the command line, e.g.: - - ./php -b 127.0.0.1:8002 - -The above line is the recommended way of running FastCGI. You usually -want the FastCGI server to provide services to the localhost, not -everyone on the Internet. - -If your web server sits on a remote host, you can make FastCGI listen -on all interfaces: - - ./php -b :8002 - ./php -b "*:8002" - -Note that hostnames are not supported. - -You must also configure your web server to connect to the appropriate port -in order to talk to the PHP FastCGI process. - -The advantage of running PHP in this way is that it entirely separates the -web server and PHP process, so that one cannot disrupt the other. It also -allows PHP to be on an entirely separate machine from the web server if need -be, you could even have several web servers utilising the same running PHP -process if required! - - -Using FastCGI PHP with Apache -============================= - -First of all, you may well ask 'Why?'. After all, Apache already has mod_php. -However, there are advantages to running PHP with FastCGI. Separating the -PHP code from the web server removes 'bloat' from the main server, and should -improve the performance of non-PHP requests. Secondly, having one permanent -PHP process as opposed to one per apache process means that shared resources -like persistent database connections are used more efficiently. - -First of all, make sure that the FastCGI module is enabled. You should have -a line in your config like: - - LoadModule fastcgi_module /usr/lib/apache/2.0/mod_fastcgi.so - -Don't load mod_php, by the way. Make sure it is commented out! - - #LoadModule php5_module /usr/lib/apache/2.0/libphp5.so - -Now, we'll create a fcgi-bin directory, just like you would do with normal -CGI scripts. You'll need to create a directory somewhere to store your -FastCGI binaries. We'll use /space/fcgi-bin/ for this example. Remember to -copy the FastCGI-PHP binary in there. (named 'php-cgi') This sets up -php to run under mod_fastcgi as a dynamic server. - - ScriptAlias /fcgi-bin/ /space/fcgi-bin/ - - Options ExecCGI - SetHandler fastcgi-script - - -To setup a specific static configuration for php, you have to use -the FastCgiServer configuration for mod_fastcgi. For this, do not -use the above configuration, but rather the following. -(see mod_fastcgi docs for more configuration information): - - Alias /fcgi-bin/ /space/fcgi-bin/ - FastCgiServer /path/to/php-cgi -processes 5 - -For either of the above configurations, we need to tell Apache to -use the FastCGI binary /fcgi-bin/php to deliver PHP pages. -All that is needed is: - - AddType application/x-httpd-fastphp .php - Action application/x-httpd-fastphp /fcgi-bin/php-cgi - -Now, if you restart Apache, php pages should now be delivered! - -Using FastCGI PHP with IIS or iPlanet -===================================== - -FastCGI server plugins are available at www.caraveo.com/fastcgi/ -Documentation on these are sparse. iPlanet is not very tested, -and no makefile exists yet for unix based iPlanet servers. - - -Security --------- - -Be sure to run the php binary as an appropriate userid. Also, firewall out -the port that PHP is listening on. In addition, you can set the environment -variable FCGI_WEB_SERVER_ADDRS to control who can connect to the FastCGI. -Set it to a comma separated list of IP addresses, e.g.: - -export FCGI_WEB_SERVER_ADDRS=199.170.183.28,199.170.183.71 - - -Tuning ------- - -There are a few tuning parameters that can be tweaked to control the -performance of FastCGI PHP. The following are environment variables that can -be set before running the PHP binary: - -PHP_FCGI_CHILDREN (default value: 0) - -This controls how many child processes the PHP process spawns. When the -fastcgi starts, it creates a number of child processes which handle one -page request at a time. Value 0 means that PHP willnot start additional -processes and main process will handle FastCGI requests by itself. Note that -this process may die (because of PHP_FCGI_MAX_REQUESTS) and it willnot -respawned automatic. Values 1 and above force PHP start additioanl processes -those will handle requests. The main process will restart children in case of -their death. So by default, you will be able to handle 1 concurrent PHP page -requests. Further requests will be queued. Increasing this number will allow -for better concurrency, especially if you have pages that take a significant -time to create, or supply a lot of data (e.g. downloading huge files via PHP). -On the other hand, having more processes running will use more RAM, and letting -too many PHP pages be generated concurrently will mean that each request will -be slow. - -PHP_FCGI_MAX_REQUESTS (default value: 500) - -This controls how many requests each child process will handle before -exitting. When one process exits, another will be created. This tuning is -necessary because several PHP functions are known to have memory leaks. If the -PHP processes were left around forever, they would be become very inefficient. diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c deleted file mode 100644 index 2d828acb72d9e..0000000000000 --- a/sapi/cgi/cgi_main.c +++ /dev/null @@ -1,2161 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Rasmus Lerdorf | - | Stig Bakken | - | Zeev Suraski | - | FastCGI: Ben Mansell | - | Shane Caraveo | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_variables.h" -#include "zend_modules.h" - -#include "SAPI.h" - -#include -#include "php.h" -#ifdef PHP_WIN32 -#include "win32/time.h" -#include "win32/signal.h" -#include -#endif -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_SETLOCALE -#include -#endif -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_SYS_WAIT_H -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" -#ifdef PHP_WIN32 -#include -#include -#include "win32/php_registry.h" -#endif - -#ifdef __riscos__ -#include -int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS; -#endif - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" - -#include "php_getopt.h" - -#if PHP_FASTCGI -#include "fastcgi.h" - -#ifndef PHP_WIN32 -/* XXX this will need to change later when threaded fastcgi is - implemented. shane */ -struct sigaction act, old_term, old_quit, old_int; -#endif - -static void (*php_php_import_environment_variables)(zval *array_ptr TSRMLS_DC); - -#ifndef PHP_WIN32 -/* these globals used for forking children on unix systems */ -/** - * Number of child processes that will get created to service requests - */ -static int children = 0; - -/** - * Set to non-zero if we are the parent process - */ -static int parent = 1; - -/* Did parent received exit signals SIG_TERM/SIG_INT/SIG_QUIT */ -static int exit_signal = 0; - -/* Is Parent waiting for children to exit */ -static int parent_waiting = 0; - -/** - * Process group - */ -static pid_t pgroup; -#endif - -#endif - -#define PHP_MODE_STANDARD 1 -#define PHP_MODE_HIGHLIGHT 2 -#define PHP_MODE_INDENT 3 -#define PHP_MODE_LINT 4 -#define PHP_MODE_STRIP 5 - -static char *php_optarg = NULL; -static int php_optind = 1; -static zend_module_entry cgi_module_entry; - -static const opt_struct OPTIONS[] = { - {'a', 0, "interactive"}, - {'b', 1, "bindpath"}, - {'C', 0, "no-chdir"}, - {'c', 1, "php-ini"}, - {'d', 1, "define"}, - {'e', 0, "profile-info"}, - {'f', 1, "file"}, - {'h', 0, "help"}, - {'i', 0, "info"}, - {'l', 0, "syntax-check"}, - {'m', 0, "modules"}, - {'n', 0, "no-php-ini"}, - {'q', 0, "no-header"}, - {'s', 0, "syntax-highlight"}, - {'s', 0, "syntax-highlighting"}, - {'w', 0, "strip"}, - {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ - {'v', 0, "version"}, - {'z', 1, "zend-extension"}, -#if PHP_FASTCGI - {'T', 1, "timing"}, -#endif - {'-', 0, NULL} /* end of args */ -}; - -typedef struct _php_cgi_globals_struct { - zend_bool rfc2616_headers; - zend_bool nph; - zend_bool check_shebang_line; -#if ENABLE_PATHINFO_CHECK - zend_bool fix_pathinfo; -#endif -#if FORCE_CGI_REDIRECT - zend_bool force_redirect; - char *redirect_status_env; -#endif -#if PHP_FASTCGI - zend_bool fcgi_logging; -# ifdef PHP_WIN32 - zend_bool impersonate; -# endif -#endif -} php_cgi_globals_struct; - -#ifdef ZTS -static int php_cgi_globals_id; -#define CGIG(v) TSRMG(php_cgi_globals_id, php_cgi_globals_struct *, v) -#else -static php_cgi_globals_struct php_cgi_globals; -#define CGIG(v) (php_cgi_globals.v) -#endif - -#ifdef PHP_WIN32 -#define TRANSLATE_SLASHES(path) \ - { \ - char *tmp = path; \ - while (*tmp) { \ - if (*tmp == '\\') *tmp = '/'; \ - tmp++; \ - } \ - } -#else -#define TRANSLATE_SLASHES(path) -#endif - -static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC) -{ - php_printf("%s\n", module->name); - return 0; -} - -static int module_name_cmp(const void *a, const void *b TSRMLS_DC) -{ - Bucket *f = *((Bucket **) a); - Bucket *s = *((Bucket **) b); - - return strcasecmp(((zend_module_entry *)f->pData)->name, - ((zend_module_entry *)s->pData)->name); -} - -static void print_modules(TSRMLS_D) -{ - HashTable sorted_registry; - zend_module_entry tmp; - - zend_hash_init(&sorted_registry, 50, NULL, NULL, 1); - zend_hash_copy(&sorted_registry, &module_registry, NULL, &tmp, sizeof(zend_module_entry)); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply_with_argument(&sorted_registry, (apply_func_arg_t) print_module_info, NULL TSRMLS_CC); - zend_hash_destroy(&sorted_registry); -} - -static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) -{ - php_printf("%s\n", ext->name); - return 0; -} - -static int extension_name_cmp(const zend_llist_element **f, - const zend_llist_element **s TSRMLS_DC) -{ - return strcmp(((zend_extension *)(*f)->data)->name, - ((zend_extension *)(*s)->data)->name); -} - -static void print_extensions(TSRMLS_D) -{ - zend_llist sorted_exts; - - zend_llist_copy(&sorted_exts, &zend_extensions); - sorted_exts.dtor = NULL; - zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC); - zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC); - zend_llist_destroy(&sorted_exts); -} - -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif - -static inline size_t sapi_cgibin_single_write(const char *str, uint str_length TSRMLS_DC) -{ -#ifdef PHP_WRITE_STDOUT - long ret; -#else - size_t ret; -#endif - -#if PHP_FASTCGI - if (fcgi_is_fastcgi()) { - fcgi_request *request = (fcgi_request*) SG(server_context); - long ret = fcgi_write(request, FCGI_STDOUT, str, str_length); - if (ret <= 0) { - return 0; - } - return ret; - } -#endif -#ifdef PHP_WRITE_STDOUT - ret = write(STDOUT_FILENO, str, str_length); - if (ret <= 0) return 0; - return ret; -#else - ret = fwrite(str, 1, MIN(str_length, 16384), stdout); - return ret; -#endif -} - -static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - const char *ptr = str; - uint remaining = str_length; - size_t ret; - - while (remaining > 0) { - ret = sapi_cgibin_single_write(ptr, remaining TSRMLS_CC); - if (!ret) { - php_handle_aborted_connection(); - return str_length - remaining; - } - ptr += ret; - remaining -= ret; - } - - return str_length; -} - - -static void sapi_cgibin_flush(void *server_context) -{ -#if PHP_FASTCGI - if (fcgi_is_fastcgi()) { - fcgi_request *request = (fcgi_request*) server_context; - if ( -#ifndef PHP_WIN32 - !parent && -#endif - request && !fcgi_flush(request, 0)) { - php_handle_aborted_connection(); - } - return; - } -#endif - if (fflush(stdout) == EOF) { - php_handle_aborted_connection(); - } -} - -#define SAPI_CGI_MAX_HEADER_LENGTH 1024 - -typedef struct _http_error { - int code; - const char* msg; -} http_error; - -static const http_error http_error_codes[] = { - {100, "Continue"}, - {101, "Switching Protocols"}, - {200, "OK"}, - {201, "Created"}, - {202, "Accepted"}, - {203, "Non-Authoritative Information"}, - {204, "No Content"}, - {205, "Reset Content"}, - {206, "Partial Content"}, - {300, "Multiple Choices"}, - {301, "Moved Permanently"}, - {302, "Moved Temporarily"}, - {303, "See Other"}, - {304, "Not Modified"}, - {305, "Use Proxy"}, - {400, "Bad Request"}, - {401, "Unauthorized"}, - {402, "Payment Required"}, - {403, "Forbidden"}, - {404, "Not Found"}, - {405, "Method Not Allowed"}, - {406, "Not Acceptable"}, - {407, "Proxy Authentication Required"}, - {408, "Request Time-out"}, - {409, "Conflict"}, - {410, "Gone"}, - {411, "Length Required"}, - {412, "Precondition Failed"}, - {413, "Request Entity Too Large"}, - {414, "Request-URI Too Large"}, - {415, "Unsupported Media Type"}, - {500, "Internal Server Error"}, - {501, "Not Implemented"}, - {502, "Bad Gateway"}, - {503, "Service Unavailable"}, - {504, "Gateway Time-out"}, - {505, "HTTP Version not supported"}, - {0, NULL} -}; - -static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char buf[SAPI_CGI_MAX_HEADER_LENGTH]; - sapi_header_struct *h; - zend_llist_position pos; - zend_bool ignore_status = 0; - int response_status = SG(sapi_headers).http_response_code; - - if (SG(request_info).no_headers == 1) { - return SAPI_HEADER_SENT_SUCCESSFULLY; - } - - if (CGIG(nph) || SG(sapi_headers).http_response_code != 200) - { - int len; - zend_bool has_status = 0; - - if (CGIG(rfc2616_headers) && SG(sapi_headers).http_status_line) { - char *s; - len = slprintf(buf, SAPI_CGI_MAX_HEADER_LENGTH, "%s\r\n", SG(sapi_headers).http_status_line); - if ((s = strchr(SG(sapi_headers).http_status_line, ' '))) { - response_status = atoi((s + 1)); - } - - if (len > SAPI_CGI_MAX_HEADER_LENGTH) { - len = SAPI_CGI_MAX_HEADER_LENGTH; - } - - } else { - char *s; - - if (SG(sapi_headers).http_status_line && - (s = strchr(SG(sapi_headers).http_status_line, ' ')) != 0 && - (s - SG(sapi_headers).http_status_line) >= 5 && - strncasecmp(SG(sapi_headers).http_status_line, "HTTP/", 5) == 0) { - len = slprintf(buf, sizeof(buf), "Status:%s\r\n", s); - response_status = atoi((s + 1)); - } else { - h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); - while (h) { - if (h->header_len > sizeof("Status:")-1 && - strncasecmp(h->header, "Status:", sizeof("Status:")-1) == 0) { - has_status = 1; - break; - } - h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); - } - if (!has_status) { - http_error *err = (http_error*)http_error_codes; - - while (err->code != 0) { - if (err->code == SG(sapi_headers).http_response_code) { - break; - } - err++; - } - if (err->msg) { - len = slprintf(buf, sizeof(buf), "Status: %d %s\r\n", SG(sapi_headers).http_response_code, err->msg); - } else { - len = slprintf(buf, sizeof(buf), "Status: %d\r\n", SG(sapi_headers).http_response_code); - } - } - } - } - if (!has_status) { - PHPWRITE_H(buf, len); - ignore_status = 1; - } - } - - h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); - while (h) { - /* prevent CRLFCRLF */ - if (h->header_len) { - if (h->header_len > sizeof("Status:")-1 && - strncasecmp(h->header, "Status:", sizeof("Status:")-1) == 0) { - if (!ignore_status) { - ignore_status = 1; - PHPWRITE_H(h->header, h->header_len); - PHPWRITE_H("\r\n", 2); - } - } else if (response_status == 304 && h->header_len > sizeof("Content-Type:")-1 && - strncasecmp(h->header, "Content-Type:", sizeof("Content-Type:")-1) == 0) { - h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); - continue; - } else { - PHPWRITE_H(h->header, h->header_len); - PHPWRITE_H("\r\n", 2); - } - } - h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); - } - PHPWRITE_H("\r\n", 2); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - - -static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - int read_bytes=0, tmp_read_bytes; - - count_bytes = MIN(count_bytes, (uint) SG(request_info).content_length - SG(read_post_bytes)); - while (read_bytes < count_bytes) { -#if PHP_FASTCGI - if (fcgi_is_fastcgi()) { - fcgi_request *request = (fcgi_request*) SG(server_context); - tmp_read_bytes = fcgi_read(request, buffer + read_bytes, count_bytes - read_bytes); - } else { - tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes); - } -#else - tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes); -#endif - - if (tmp_read_bytes <= 0) { - break; - } - read_bytes += tmp_read_bytes; - } - return read_bytes; -} - -static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC) -{ -#if PHP_FASTCGI - /* when php is started by mod_fastcgi, no regular environment - is provided to PHP. It is always sent to PHP at the start - of a request. So we have to do our own lookup to get env - vars. This could probably be faster somehow. */ - if (fcgi_is_fastcgi()) { - fcgi_request *request = (fcgi_request*) SG(server_context); - return fcgi_getenv(request, name, name_len); - } -#endif - /* if cgi, or fastcgi and not found in fcgi env - check the regular environment */ - return getenv(name); -} - -static char *_sapi_cgibin_putenv(char *name, char *value TSRMLS_DC) -{ - int name_len; -#if !HAVE_SETENV || !HAVE_UNSETENV - int len; - char *buf; -#endif - - if (!name) { - return NULL; - } - name_len = strlen(name); - -#if PHP_FASTCGI - /* when php is started by mod_fastcgi, no regular environment - is provided to PHP. It is always sent to PHP at the start - of a request. So we have to do our own lookup to get env - vars. This could probably be faster somehow. */ - if (fcgi_is_fastcgi()) { - fcgi_request *request = (fcgi_request*) SG(server_context); - return fcgi_putenv(request, name, name_len, value); - } -#endif -#if HAVE_SETENV - if (value) { - setenv(name, value, 1); - } -#endif -#if HAVE_UNSETENV - if (!value) { - unsetenv(name); - } -#endif - -#if !HAVE_SETENV || !HAVE_UNSETENV - /* if cgi, or fastcgi and not found in fcgi env - check the regular environment - this leaks, but it's only cgi anyway, we'll fix - it for 5.0 - */ - len = name_len + (value ? strlen(value) : 0) + sizeof("=") + 2; - buf = (char *) malloc(len); - if (buf == NULL) { - return getenv(name); - } -#endif -#if !HAVE_SETENV - if (value) { - len = slprintf(buf, len - 1, "%s=%s", name, value); - putenv(buf); - } -#endif -#if !HAVE_UNSETENV - if (!value) { - len = slprintf(buf, len - 1, "%s=", name); - putenv(buf); - } -#endif - return getenv(name); -} - -static char *sapi_cgi_read_cookies(TSRMLS_D) -{ - return sapi_cgibin_getenv((char *) "HTTP_COOKIE", sizeof("HTTP_COOKIE")-1 TSRMLS_CC); -} - -#if PHP_FASTCGI -void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) -{ - if (PG(http_globals)[TRACK_VARS_ENV] && - array_ptr != PG(http_globals)[TRACK_VARS_ENV] && - Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && - zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0) { - zval_dtor(array_ptr); - *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; - INIT_PZVAL(array_ptr); - zval_copy_ctor(array_ptr); - return; - } else if (PG(http_globals)[TRACK_VARS_SERVER] && - array_ptr != PG(http_globals)[TRACK_VARS_SERVER] && - Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && - zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0) { - zval_dtor(array_ptr); - *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; - INIT_PZVAL(array_ptr); - zval_copy_ctor(array_ptr); - return; - } - - /* call php's original import as a catch-all */ - php_php_import_environment_variables(array_ptr TSRMLS_CC); - - if (fcgi_is_fastcgi()) { - fcgi_request *request = (fcgi_request*) SG(server_context); - HashPosition pos; - int magic_quotes_gpc = PG(magic_quotes_gpc); - char *var, **val; - uint var_len; - ulong idx; - int filter_arg = (array_ptr == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER; - - /* turn off magic_quotes while importing environment variables */ - PG(magic_quotes_gpc) = 0; - for (zend_hash_internal_pointer_reset_ex(&request->env, &pos); - zend_hash_get_current_key_ex(&request->env, &var, &var_len, &idx, 0, &pos) == HASH_KEY_IS_STRING && - zend_hash_get_current_data_ex(&request->env, (void **) &val, &pos) == SUCCESS; - zend_hash_move_forward_ex(&request->env, &pos)) { - unsigned int new_val_len; - if (sapi_module.input_filter(filter_arg, var, val, strlen(*val), &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, *val, new_val_len, array_ptr TSRMLS_CC); - } - } - PG(magic_quotes_gpc) = magic_quotes_gpc; - } -} -#endif - -static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) -{ - unsigned int php_self_len; - char *php_self; - - /* In CGI mode, we consider the environment to be a part of the server - * variables - */ - php_import_environment_variables(track_vars_array TSRMLS_CC); - -#if ENABLE_PATHINFO_CHECK - if (CGIG(fix_pathinfo)) { - char *script_name = SG(request_info).request_uri; - unsigned int script_name_len = script_name ? strlen(script_name) : 0; - char *path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO")-1 TSRMLS_CC); - unsigned int path_info_len = path_info ? strlen(path_info) : 0; - - php_self_len = script_name_len + path_info_len; - php_self = emalloc(php_self_len + 1); - if (script_name) { - memcpy(php_self, script_name, script_name_len + 1); - } - if (path_info) { - memcpy(php_self + script_name_len, path_info, path_info_len + 1); - } - - /* Build the special-case PHP_SELF variable for the CGI version */ - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC); - } - efree(php_self); - return; - } -#endif - - php_self = SG(request_info).request_uri ? SG(request_info).request_uri : ""; - php_self_len = strlen(php_self); - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC); - } -} - -static void sapi_cgi_log_message(char *message) -{ -#if PHP_FASTCGI - TSRMLS_FETCH(); - - if (fcgi_is_fastcgi() && CGIG(fcgi_logging)) { - fcgi_request *request; - - request = (fcgi_request*) SG(server_context); - if (request) { - int len = strlen(message); - char *buf = malloc(len+2); - - memcpy(buf, message, len); - memcpy(buf + len, "\n", sizeof("\n")); - fcgi_write(request, FCGI_STDERR, buf, len+1); - free(buf); - } else { - fprintf(stderr, "%s\n", message); - } - /* ignore return code */ - } else -#endif /* PHP_FASTCGI */ - fprintf(stderr, "%s\n", message); -} - -static int sapi_cgi_deactivate(TSRMLS_D) -{ - /* flush only when SAPI was started. The reasons are: - 1. SAPI Deactivate is called from two places: module init and request shutdown - 2. When the first call occurs and the request is not set up, flush fails on - FastCGI. - */ - if (SG(sapi_started)) { - sapi_cgibin_flush(SG(server_context)); - } - return SUCCESS; -} - -static int php_cgi_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &cgi_module_entry, 1) == FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -/* {{{ sapi_module_struct cgi_sapi_module - */ -static sapi_module_struct cgi_sapi_module = { -#if PHP_FASTCGI - "cgi-fcgi", /* name */ - "CGI/FastCGI", /* pretty name */ -#else - "cgi", /* name */ - "CGI", /* pretty name */ -#endif - - php_cgi_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - sapi_cgi_deactivate, /* deactivate */ - - sapi_cgibin_ub_write, /* unbuffered write */ - sapi_cgibin_flush, /* flush */ - NULL, /* get uid */ - sapi_cgibin_getenv, /* getenv */ - - php_error, /* error handler */ - - NULL, /* header handler */ - sapi_cgi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_cgi_read_post, /* read POST data */ - sapi_cgi_read_cookies, /* read Cookies */ - - sapi_cgi_register_variables, /* register server variables */ - sapi_cgi_log_message, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ php_cgi_usage - */ -static void php_cgi_usage(char *argv0) -{ - char *prog; - - prog = strrchr(argv0, '/'); - if (prog) { - prog++; - } else { - prog = "php"; - } - - php_printf("Usage: %s [-q] [-h] [-s] [-v] [-i] [-f ]\n" - " %s [args...]\n" - " -a Run interactively\n" -#if PHP_FASTCGI - " -b | Bind Path for external FASTCGI Server mode\n" -#endif - " -C Do not chdir to the script's directory\n" - " -c | Look for php.ini file in this directory\n" - " -n No php.ini file will be used\n" - " -d foo[=bar] Define INI entry foo with value 'bar'\n" - " -e Generate extended information for debugger/profiler\n" - " -f Parse . Implies `-q'\n" - " -h This help\n" - " -i PHP information\n" - " -l Syntax check only (lint)\n" - " -m Show compiled in modules\n" - " -q Quiet-mode. Suppress HTTP Header output.\n" - " -s Display colour syntax highlighted source.\n" - " -v Version number\n" - " -w Display source with stripped comments and whitespace.\n" - " -z Load Zend extension .\n" -#if PHP_FASTCGI - " -T Measure execution time of script repeated times.\n" -#endif - , - prog, prog); -} -/* }}} */ - -/* {{{ is_valid_path - * - * some server configurations allow '..' to slip through in the - * translated path. We'll just refuse to handle such a path. - */ -static int is_valid_path(const char *path) -{ - const char *p; - - if (!path) { - return 0; - } - p = strstr(path, ".."); - if (p) { - if ((p == path || IS_SLASH(*(p-1))) && - (*(p+2) == 0 || IS_SLASH(*(p+2)))) { - return 0; - } - while (1) { - p = strstr(p+1, ".."); - if (!p) { - break; - } - if (IS_SLASH(*(p-1)) && - (*(p+2) == 0 || IS_SLASH(*(p+2)))) { - return 0; - } - } - } - return 1; -} -/* }}} */ - -/* {{{ init_request_info - - initializes request_info structure - - specificly in this section we handle proper translations - for: - - PATH_INFO - derived from the portion of the URI path following - the script name but preceding any query data - may be empty - - PATH_TRANSLATED - derived by taking any path-info component of the - request URI and performing any virtual-to-physical - translation appropriate to map it onto the server's - document repository structure - - empty if PATH_INFO is empty - - The env var PATH_TRANSLATED **IS DIFFERENT** than the - request_info.path_translated variable, the latter should - match SCRIPT_FILENAME instead. - - SCRIPT_NAME - set to a URL path that could identify the CGI script - rather than the interpreter. PHP_SELF is set to this. - - REQUEST_URI - uri section following the domain:port part of a URI - - SCRIPT_FILENAME - The virtual-to-physical translation of SCRIPT_NAME (as per - PATH_TRANSLATED) - - These settings are documented at - http://cgi-spec.golux.com/ - - - Based on the following URL request: - - http://localhost/info.php/test?a=b - - should produce, which btw is the same as if - we were running under mod_cgi on apache (ie. not - using ScriptAlias directives): - - PATH_INFO=/test - PATH_TRANSLATED=/docroot/test - SCRIPT_NAME=/info.php - REQUEST_URI=/info.php/test?a=b - SCRIPT_FILENAME=/docroot/info.php - QUERY_STRING=a=b - - but what we get is (cgi/mod_fastcgi under apache): - - PATH_INFO=/info.php/test - PATH_TRANSLATED=/docroot/info.php/test - SCRIPT_NAME=/php/php-cgi (from the Action setting I suppose) - REQUEST_URI=/info.php/test?a=b - SCRIPT_FILENAME=/path/to/php/bin/php-cgi (Action setting translated) - QUERY_STRING=a=b - - Comments in the code below refer to using the above URL in a request - - */ -static void init_request_info(TSRMLS_D) -{ - char *env_script_filename = sapi_cgibin_getenv("SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME")-1 TSRMLS_CC); - char *env_path_translated = sapi_cgibin_getenv("PATH_TRANSLATED", sizeof("PATH_TRANSLATED")-1 TSRMLS_CC); - char *script_path_translated = env_script_filename; - -#if !DISCARD_PATH - /* some broken servers do not have script_filename or argv0 - an example, IIS configured in some ways. then they do more - broken stuff and set path_translated to the cgi script location */ - if (!script_path_translated && env_path_translated) { - script_path_translated = env_path_translated; - } -#endif - - /* initialize the defaults */ - SG(request_info).path_translated = NULL; - SG(request_info).request_method = NULL; - SG(request_info).proto_num = 1000; - SG(request_info).query_string = NULL; - SG(request_info).request_uri = NULL; - SG(request_info).content_type = NULL; - SG(request_info).content_length = 0; - SG(sapi_headers).http_response_code = 200; - - /* script_path_translated being set is a good indication that - we are running in a cgi environment, since it is always - null otherwise. otherwise, the filename - of the script will be retreived later via argc/argv */ - if (script_path_translated) { - const char *auth; - char *content_length = sapi_cgibin_getenv("CONTENT_LENGTH", sizeof("CONTENT_LENGTH")-1 TSRMLS_CC); - char *content_type = sapi_cgibin_getenv("CONTENT_TYPE", sizeof("CONTENT_TYPE")-1 TSRMLS_CC); - char *env_path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO")-1 TSRMLS_CC); - char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1 TSRMLS_CC); -#if ENABLE_PATHINFO_CHECK - struct stat st; - char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL", sizeof("REDIRECT_URL")-1 TSRMLS_CC); - char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC); - int script_path_translated_len; - - /* Hack for buggy IIS that sets incorrect PATH_INFO */ - char *env_server_software = sapi_cgibin_getenv("SERVER_SOFTWARE", sizeof("SERVER_SOFTWARE")-1 TSRMLS_CC); - if (env_server_software && - env_script_name && - env_path_info && - strncmp(env_server_software, "Microsoft-IIS", sizeof("Microsoft-IIS")-1) == 0 && - strncmp(env_path_info, env_script_name, strlen(env_script_name)) == 0) { - env_path_info = _sapi_cgibin_putenv("ORIG_PATH_INFO", env_path_info TSRMLS_CC); - env_path_info += strlen(env_script_name); - if (*env_path_info == 0) { - env_path_info = NULL; - } - env_path_info = _sapi_cgibin_putenv("PATH_INFO", env_path_info TSRMLS_CC); - } - - if (CGIG(fix_pathinfo)) { - char *real_path = NULL; - char *orig_path_translated = env_path_translated; - char *orig_path_info = env_path_info; - char *orig_script_name = env_script_name; - char *orig_script_filename = env_script_filename; - - if (!env_document_root && PG(doc_root)) { - env_document_root = _sapi_cgibin_putenv("DOCUMENT_ROOT", PG(doc_root) TSRMLS_CC); - /* fix docroot */ - TRANSLATE_SLASHES(env_document_root); - } - - if (env_path_translated != NULL && env_redirect_url != NULL) { - /* - pretty much apache specific. If we have a redirect_url - then our script_filename and script_name point to the - php executable - */ - script_path_translated = env_path_translated; - /* we correct SCRIPT_NAME now in case we don't have PATH_INFO */ - env_script_name = env_redirect_url; - } - -#ifdef __riscos__ - /* Convert path to unix format*/ - __riscosify_control |= __RISCOSIFY_DONT_CHECK_DIR; - script_path_translated = __unixify(script_path_translated, 0, NULL, 1, 0); -#endif - - /* - * if the file doesn't exist, try to extract PATH_INFO out - * of it by stat'ing back through the '/' - * this fixes url's like /info.php/test - */ - if (script_path_translated && - (script_path_translated_len = strlen(script_path_translated)) > 0 && - (script_path_translated[script_path_translated_len-1] == '/' || -#ifdef PHP_WIN32 - script_path_translated[script_path_translated_len-1] == '\\' || -#endif - (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL)) { - char *pt = estrndup(script_path_translated, script_path_translated_len); - int len = script_path_translated_len; - char *ptr; - - while ((ptr = strrchr(pt, '/')) || (ptr = strrchr(pt, '\\'))) { - *ptr = 0; - if (stat(pt, &st) == 0 && S_ISREG(st.st_mode)) { - /* - * okay, we found the base script! - * work out how many chars we had to strip off; - * then we can modify PATH_INFO - * accordingly - * - * we now have the makings of - * PATH_INFO=/test - * SCRIPT_FILENAME=/docroot/info.php - * - * we now need to figure out what docroot is. - * if DOCUMENT_ROOT is set, this is easy, otherwise, - * we have to play the game of hide and seek to figure - * out what SCRIPT_NAME should be - */ - int slen = len - strlen(pt); - int pilen = env_path_info ? strlen(env_path_info) : 0; - char *path_info = env_path_info ? env_path_info + pilen - slen : NULL; - - if (orig_path_info != path_info) { - if (orig_path_info) { - char old; - - _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC); - old = path_info[0]; - path_info[0] = 0; - if (!orig_script_name || - strcmp(orig_script_name, env_path_info) != 0) { - if (orig_script_name) { - _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); - } - SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_path_info TSRMLS_CC); - } else { - SG(request_info).request_uri = orig_script_name; - } - path_info[0] = old; - } - env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC); - } - if (!orig_script_filename || - strcmp(orig_script_filename, pt) != 0) { - if (orig_script_filename) { - _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename TSRMLS_CC); - } - script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", pt TSRMLS_CC); - } - TRANSLATE_SLASHES(pt); - - /* figure out docroot - SCRIPT_FILENAME minus SCRIPT_NAME - */ - - if (env_document_root) { - int l = strlen(env_document_root); - int path_translated_len = 0; - char *path_translated = NULL; - - if (l && env_document_root[l - 1] == '/') { - --l; - } - - /* we have docroot, so we should have: - * DOCUMENT_ROOT=/docroot - * SCRIPT_FILENAME=/docroot/info.php - */ - - /* PATH_TRANSLATED = DOCUMENT_ROOT + PATH_INFO */ - path_translated_len = l + (env_path_info ? strlen(env_path_info) : 0); - path_translated = (char *) emalloc(path_translated_len + 1); - memcpy(path_translated, env_document_root, l); - if (env_path_info) { - memcpy(path_translated + l, env_path_info, (path_translated_len - l)); - } - path_translated[path_translated_len] = '\0'; - if (orig_path_translated) { - _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC); - } - env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated TSRMLS_CC); - efree(path_translated); - } else if (env_script_name && - strstr(pt, env_script_name) - ) { - /* PATH_TRANSLATED = PATH_TRANSLATED - SCRIPT_NAME + PATH_INFO */ - int ptlen = strlen(pt) - strlen(env_script_name); - int path_translated_len = ptlen + (env_path_info ? strlen(env_path_info) : 0); - char *path_translated = NULL; - - path_translated = (char *) emalloc(path_translated_len + 1); - memcpy(path_translated, pt, ptlen); - if (env_path_info) { - memcpy(path_translated + ptlen, env_path_info, path_translated_len - ptlen); - } - path_translated[path_translated_len] = '\0'; - if (orig_path_translated) { - _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC); - } - env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated TSRMLS_CC); - efree(path_translated); - } - break; - } - } - if (!ptr) { - /* - * if we stripped out all the '/' and still didn't find - * a valid path... we will fail, badly. of course we would - * have failed anyway... we output 'no input file' now. - */ - if (orig_script_filename) { - _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename TSRMLS_CC); - } - script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", NULL TSRMLS_CC); - SG(sapi_headers).http_response_code = 404; - } - if (!SG(request_info).request_uri) { - if (!orig_script_name || - strcmp(orig_script_name, env_script_name) != 0) { - if (orig_script_name) { - _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); - } - SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC); - } else { - SG(request_info).request_uri = orig_script_name; - } - } - if (pt) { - efree(pt); - } - if (is_valid_path(script_path_translated)) { - SG(request_info).path_translated = estrdup(script_path_translated); - } - } else { - /* make sure path_info/translated are empty */ - if (!orig_script_filename || - (script_path_translated != orig_script_filename && - strcmp(script_path_translated, orig_script_filename) != 0)) { - if (orig_script_filename) { - _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename TSRMLS_CC); - } - script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated TSRMLS_CC); - } - if (env_redirect_url) { - if (orig_path_info) { - _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC); - _sapi_cgibin_putenv("PATH_INFO", NULL TSRMLS_CC); - } - if (orig_path_translated) { - _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC); - _sapi_cgibin_putenv("PATH_TRANSLATED", NULL TSRMLS_CC); - } - } - if (env_script_name != orig_script_name) { - if (orig_script_name) { - _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); - } - SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC); - } else { - SG(request_info).request_uri = env_script_name; - } - if (is_valid_path(script_path_translated)) { - SG(request_info).path_translated = estrdup(script_path_translated); - } - free(real_path); - } - } else { -#endif - /* pre 4.3 behaviour, shouldn't be used but provides BC */ - if (env_path_info) { - SG(request_info).request_uri = env_path_info; - } else { - SG(request_info).request_uri = env_script_name; - } -#if !DISCARD_PATH - if (env_path_translated) { - script_path_translated = env_path_translated; - } -#endif - if (is_valid_path(script_path_translated)) { - SG(request_info).path_translated = estrdup(script_path_translated); - } -#if ENABLE_PATHINFO_CHECK - } -#endif - SG(request_info).request_method = sapi_cgibin_getenv("REQUEST_METHOD", sizeof("REQUEST_METHOD")-1 TSRMLS_CC); - /* FIXME - Work out proto_num here */ - SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING")-1 TSRMLS_CC); - SG(request_info).content_type = (content_type ? content_type : "" ); - SG(request_info).content_length = (content_length ? atoi(content_length) : 0); - - /* The CGI RFC allows servers to pass on unvalidated Authorization data */ - auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION")-1 TSRMLS_CC); - php_handle_auth_data(auth TSRMLS_CC); - } -} -/* }}} */ - -#if PHP_FASTCGI && !defined(PHP_WIN32) -/** - * Clean up child processes upon exit - */ -void fastcgi_cleanup(int signal) -{ -#ifdef DEBUG_FASTCGI - fprintf(stderr, "FastCGI shutdown, pid %d\n", getpid()); -#endif - - sigaction(SIGTERM, &old_term, 0); - - /* Kill all the processes in our process group */ - kill(-pgroup, SIGTERM); - - if (parent && parent_waiting) { - exit_signal = 1; - } else { - exit(0); - } -} -#endif - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("cgi.rfc2616_headers", "0", PHP_INI_ALL, OnUpdateBool, rfc2616_headers, php_cgi_globals_struct, php_cgi_globals) - STD_PHP_INI_ENTRY("cgi.nph", "0", PHP_INI_ALL, OnUpdateBool, nph, php_cgi_globals_struct, php_cgi_globals) - STD_PHP_INI_ENTRY("cgi.check_shebang_line", "1", PHP_INI_SYSTEM, OnUpdateBool, check_shebang_line, php_cgi_globals_struct, php_cgi_globals) -#if FORCE_CGI_REDIRECT - STD_PHP_INI_ENTRY("cgi.force_redirect", "1", PHP_INI_SYSTEM, OnUpdateBool, force_redirect, php_cgi_globals_struct, php_cgi_globals) - STD_PHP_INI_ENTRY("cgi.redirect_status_env", NULL, PHP_INI_SYSTEM, OnUpdateString, redirect_status_env, php_cgi_globals_struct, php_cgi_globals) -#endif -#if ENABLE_PATHINFO_CHECK - STD_PHP_INI_ENTRY("cgi.fix_pathinfo", "1", PHP_INI_SYSTEM, OnUpdateBool, fix_pathinfo, php_cgi_globals_struct, php_cgi_globals) -#endif -#if PHP_FASTCGI - STD_PHP_INI_ENTRY("fastcgi.logging", "1", PHP_INI_SYSTEM, OnUpdateBool, fcgi_logging, php_cgi_globals_struct, php_cgi_globals) -# ifdef PHP_WIN32 - STD_PHP_INI_ENTRY("fastcgi.impersonate", "0", PHP_INI_SYSTEM, OnUpdateBool, impersonate, php_cgi_globals_struct, php_cgi_globals) -# endif -#endif -PHP_INI_END() - -/* {{{ php_cgi_globals_ctor - */ -static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_DC) -{ - php_cgi_globals->rfc2616_headers = 0; - php_cgi_globals->nph = 0; - php_cgi_globals->check_shebang_line = 1; -#if FORCE_CGI_REDIRECT - php_cgi_globals->force_redirect = 1; - php_cgi_globals->redirect_status_env = NULL; -#endif -#if ENABLE_PATHINFO_CHECK - php_cgi_globals->fix_pathinfo = 1; -#endif -#if PHP_FASTCGI - php_cgi_globals->fcgi_logging = 1; -# ifdef PHP_WIN32 - php_cgi_globals->impersonate = 0; -# endif -#endif -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -static PHP_MINIT_FUNCTION(cgi) -{ -#ifdef ZTS - ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL); -#else - php_cgi_globals_ctor(&php_cgi_globals TSRMLS_CC); -#endif - REGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -static PHP_MSHUTDOWN_FUNCTION(cgi) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -static PHP_MINFO_FUNCTION(cgi) -{ - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -static zend_module_entry cgi_module_entry = { - STANDARD_MODULE_HEADER, -#if PHP_FASTCGI - "cgi-fcgi", -#else - "cgi", -#endif - NULL, - PHP_MINIT(cgi), - PHP_MSHUTDOWN(cgi), - NULL, - NULL, - PHP_MINFO(cgi), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -/* {{{ main - */ -int main(int argc, char *argv[]) -{ - int free_query_string = 0; - int exit_status = SUCCESS; - int cgi = 0, c, i, len; - zend_file_handle file_handle; - int retval = FAILURE; - char *s; -/* temporary locals */ - int behavior = PHP_MODE_STANDARD; - int no_headers = 0; - int orig_optind = php_optind; - char *orig_optarg = php_optarg; - char *script_file = NULL; - int ini_entries_len = 0; - -/* end of temporary locals */ -#ifdef ZTS - void ***tsrm_ls; -#endif - -#if PHP_FASTCGI - int max_requests = 500; - int requests = 0; - int fastcgi = fcgi_is_fastcgi(); - char *bindpath = NULL; - int fcgi_fd = 0; - fcgi_request request; - int repeats = 1; - int benchmark = 0; -#if HAVE_GETTIMEOFDAY - struct timeval start, end; -#else - time_t start, end; -#endif -#ifndef PHP_WIN32 - int status = 0; -#endif -#endif /* PHP_FASTCGI */ - -#if 0 && defined(PHP_DEBUG) - /* IIS is always making things more difficult. This allows - us to stop PHP and attach a debugger before much gets started */ - { - char szMessage [256]; - wsprintf (szMessage, "Please attach a debugger to the process 0x%X [%d] (%s) and click OK", - GetCurrentProcessId(), GetCurrentProcessId(), argv[0]); - MessageBox(NULL, szMessage, "CGI Debug Time!", MB_OK|MB_SERVICE_NOTIFICATION); - } -#endif - -#ifdef HAVE_SIGNAL_H -#if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so - that sockets created via fsockopen() - don't kill PHP if the remote site - closes it. in apache|apxs mode apache - does that for us! thies@thieso.net - 20000419 */ -#endif -#endif - -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); - tsrm_ls = ts_resource(0); -#endif - - sapi_startup(&cgi_sapi_module); - cgi_sapi_module.php_ini_path_override = NULL; - -#ifdef PHP_WIN32 - _fmode = _O_BINARY; /* sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ -#endif - -#if PHP_FASTCGI - if (!fastcgi) { -#endif - /* Make sure we detect we are a cgi - a bit redundancy here, - but the default case is that we have to check only the first one. */ - if (getenv("SERVER_SOFTWARE") || - getenv("SERVER_NAME") || - getenv("GATEWAY_INTERFACE") || - getenv("REQUEST_METHOD") - ) { - cgi = 1; - } -#if PHP_FASTCGI - } -#endif - - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) { - switch (c) { - case 'c': - if (cgi_sapi_module.php_ini_path_override) { - free(cgi_sapi_module.php_ini_path_override); - } - cgi_sapi_module.php_ini_path_override = strdup(php_optarg); - break; - case 'n': - cgi_sapi_module.php_ini_ignore = 1; - break; - case 'd': { - /* define ini entries on command line */ - int len = strlen(php_optarg); - char *val; - - if ((val = strchr(php_optarg, '='))) { - val++; - if (!isalnum(*val) && *val != '"' && *val != '\'' && *val != '\0') { - cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("\"\"\n\0")); - memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, (val - php_optarg)); - ini_entries_len += (val - php_optarg); - memcpy(cgi_sapi_module.ini_entries + ini_entries_len, "\"", 1); - ini_entries_len++; - memcpy(cgi_sapi_module.ini_entries + ini_entries_len, val, len - (val - php_optarg)); - ini_entries_len += len - (val - php_optarg); - memcpy(cgi_sapi_module.ini_entries + ini_entries_len, "\"\n\0", sizeof("\"\n\0")); - ini_entries_len += sizeof("\n\0\"") - 2; - } else { - cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("\n\0")); - memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, len); - memcpy(cgi_sapi_module.ini_entries + ini_entries_len + len, "\n\0", sizeof("\n\0")); - ini_entries_len += len + sizeof("\n\0") - 2; - } - } else { - cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("=1\n\0")); - memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, len); - memcpy(cgi_sapi_module.ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0")); - ini_entries_len += len + sizeof("=1\n\0") - 2; - } - break; - } -#if PHP_FASTCGI - /* if we're started on command line, check to see if - we are being started as an 'external' fastcgi - server by accepting a bindpath parameter. */ - case 'b': - if (!fastcgi) { - bindpath = strdup(php_optarg); - } - break; -#endif - case 's': /* generate highlighted HTML from source */ - behavior = PHP_MODE_HIGHLIGHT; - break; - - } - - } - php_optind = orig_optind; - php_optarg = orig_optarg; - -#ifdef ZTS - SG(request_info).path_translated = NULL; -#endif - - cgi_sapi_module.executable_location = argv[0]; - - /* startup after we get the above ini override se we get things right */ - if (cgi_sapi_module.startup(&cgi_sapi_module) == FAILURE) { -#ifdef ZTS - tsrm_shutdown(); -#endif - return FAILURE; - } - -#if FORCE_CGI_REDIRECT - /* check force_cgi after startup, so we have proper output */ - if (cgi && CGIG(force_redirect)) { - /* Apache will generate REDIRECT_STATUS, - * Netscape and redirect.so will generate HTTP_REDIRECT_STATUS. - * redirect.so and installation instructions available from - * http://www.koehntopp.de/php. - * -- kk@netuse.de - */ - if (!getenv("REDIRECT_STATUS") - && !getenv ("HTTP_REDIRECT_STATUS") - /* this is to allow a different env var to be configured - in case some server does something different than above */ - && (!CGIG(redirect_status_env) || !getenv(CGIG(redirect_status_env))) - ) { - SG(sapi_headers).http_response_code = 400; - PUTS("Security Alert! The PHP CGI cannot be accessed directly.\n\n\ -

This PHP CGI binary was compiled with force-cgi-redirect enabled. This\n\ -means that a page will only be served up if the REDIRECT_STATUS CGI variable is\n\ -set, e.g. via an Apache Action directive.

\n\ -

For more information as to why this behaviour exists, see the \ -manual page for CGI security.

\n\ -

For more information about changing this behaviour or re-enabling this webserver,\n\ -consult the installation file that came with this distribution, or visit \n\ -the manual page.

\n"); - -#if defined(ZTS) && !defined(PHP_DEBUG) - /* XXX we're crashing here in msvc6 debug builds at - php_message_handler_for_zend:839 because - SG(request_info).path_translated is an invalid pointer. - It still happens even though I set it to null, so something - weird is going on. - */ - tsrm_shutdown(); -#endif - return FAILURE; - } - } -#endif /* FORCE_CGI_REDIRECT */ - -#if PHP_FASTCGI - if (bindpath) { - fcgi_fd = fcgi_listen(bindpath, 128); - if (fcgi_fd < 0) { - fprintf(stderr, "Couldn't create FastCGI listen socket on port %s\n", bindpath); -#ifdef ZTS - tsrm_shutdown(); -#endif - return FAILURE; - } - fastcgi = fcgi_is_fastcgi(); - } - - if (fastcgi) { - /* How many times to run PHP scripts before dying */ - if (getenv("PHP_FCGI_MAX_REQUESTS")) { - max_requests = atoi(getenv("PHP_FCGI_MAX_REQUESTS")); - if (max_requests < 0) { - fprintf(stderr, "PHP_FCGI_MAX_REQUESTS is not valid\n"); - return FAILURE; - } - } - - /* make php call us to get _ENV vars */ - php_php_import_environment_variables = php_import_environment_variables; - php_import_environment_variables = cgi_php_import_environment_variables; - - /* library is already initialized, now init our request */ - fcgi_init_request(&request, fcgi_fd); - -#ifndef PHP_WIN32 - /* Pre-fork, if required */ - if (getenv("PHP_FCGI_CHILDREN")) { - char * children_str = getenv("PHP_FCGI_CHILDREN"); - children = atoi(children_str); - if (children < 0) { - fprintf(stderr, "PHP_FCGI_CHILDREN is not valid\n"); - return FAILURE; - } - fcgi_set_mgmt_var("FCGI_MAX_CONNS", sizeof("FCGI_MAX_CONNS")-1, children_str, strlen(children_str)); - /* This is the number of concurrent requests, equals FCGI_MAX_CONNS */ - fcgi_set_mgmt_var("FCGI_MAX_REQS", sizeof("FCGI_MAX_REQS")-1, children_str, strlen(children_str)); - } else { - fcgi_set_mgmt_var("FCGI_MAX_CONNS", sizeof("FCGI_MAX_CONNS")-1, "1", sizeof("1")-1); - fcgi_set_mgmt_var("FCGI_MAX_REQS", sizeof("FCGI_MAX_REQS")-1, "1", sizeof("1")-1); - } - - if (children) { - int running = 0; - pid_t pid; - - /* Create a process group for ourself & children */ - setsid(); - pgroup = getpgrp(); -#ifdef DEBUG_FASTCGI - fprintf(stderr, "Process group %d\n", pgroup); -#endif - - /* Set up handler to kill children upon exit */ - act.sa_flags = 0; - act.sa_handler = fastcgi_cleanup; - if (sigaction(SIGTERM, &act, &old_term) || - sigaction(SIGINT, &act, &old_int) || - sigaction(SIGQUIT, &act, &old_quit)) { - perror("Can't set signals"); - exit(1); - } - - if (fcgi_in_shutdown()) { - goto parent_out; - } - - while (parent) { - do { -#ifdef DEBUG_FASTCGI - fprintf(stderr, "Forking, %d running\n", running); -#endif - pid = fork(); - switch (pid) { - case 0: - /* One of the children. - * Make sure we don't go round the - * fork loop any more - */ - parent = 0; - - /* don't catch our signals */ - sigaction(SIGTERM, &old_term, 0); - sigaction(SIGQUIT, &old_quit, 0); - sigaction(SIGINT, &old_int, 0); - break; - case -1: - perror("php (pre-forking)"); - exit(1); - break; - default: - /* Fine */ - running++; - break; - } - } while (parent && (running < children)); - - if (parent) { -#ifdef DEBUG_FASTCGI - fprintf(stderr, "Wait for kids, pid %d\n", getpid()); -#endif - parent_waiting = 1; - while (1) { - if (wait(&status) >= 0) { - running--; - break; - } else if (exit_signal) { - break; - } - } - if (exit_signal) { -#if 0 - while (running > 0) { - while (wait(&status) < 0) { - } - running--; - } -#endif - goto parent_out; - } - } - } - } else { - parent = 0; - } - -#endif /* WIN32 */ - } -#endif /* FASTCGI */ - - zend_first_try { - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1)) != -1) { - switch (c) { -#if PHP_FASTCGI - case 'T': - benchmark = 1; - repeats = atoi(php_optarg); -#ifdef HAVE_GETTIMEOFDAY - gettimeofday(&start, NULL); -#else - time(&start); -#endif - break; -#endif - case 'h': - case '?': -#if PHP_FASTCGI - fcgi_shutdown(); -#endif - no_headers = 1; - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_cgi_usage(argv[0]); - php_end_ob_buffers(1 TSRMLS_CC); - exit_status = 0; - goto out; - } - } - php_optind = orig_optind; - php_optarg = orig_optarg; - -#if PHP_FASTCGI - /* start of FAST CGI loop */ - /* Initialise FastCGI request structure */ -#ifdef PHP_WIN32 - /* attempt to set security impersonation for fastcgi - will only happen on NT based OS, others will ignore it. */ - if (fastcgi && CGIG(impersonate)) { - fcgi_impersonate(); - } -#endif - while (!fastcgi || fcgi_accept_request(&request) >= 0) { -#endif - -#if PHP_FASTCGI - SG(server_context) = (void *) &request; -#else - SG(server_context) = (void *) 1; /* avoid server_context==NULL checks */ -#endif - init_request_info(TSRMLS_C); - CG(interactive) = 0; - - if (!cgi -#if PHP_FASTCGI - && !fastcgi -#endif - ) { - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) { - switch (c) { - - case 'a': /* interactive mode */ - printf("Interactive mode enabled\n\n"); - CG(interactive) = 1; - break; - - case 'C': /* don't chdir to the script directory */ - SG(options) |= SAPI_OPTION_NO_CHDIR; - break; - - case 'e': /* enable extended info output */ - CG(extended_info) = 1; - break; - - case 'f': /* parse file */ - if (script_file) { - efree(script_file); - } - script_file = estrdup(php_optarg); - no_headers = 1; - break; - - case 'i': /* php info & quit */ - if (script_file) { - efree(script_file); - } - if (php_request_startup(TSRMLS_C) == FAILURE) { - SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - if (no_headers) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - } - php_print_info(0xFFFFFFFF TSRMLS_CC); - php_request_shutdown((void *) 0); - exit_status = 0; - goto out; - - case 'l': /* syntax check mode */ - no_headers = 1; - behavior = PHP_MODE_LINT; - break; - - case 'm': /* list compiled in modules */ - if (script_file) { - efree(script_file); - } - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_printf("[PHP Modules]\n"); - print_modules(TSRMLS_C); - php_printf("\n[Zend Modules]\n"); - print_extensions(TSRMLS_C); - php_printf("\n"); - php_end_ob_buffers(1 TSRMLS_CC); - exit_status = 0; - goto out; - -#if 0 /* not yet operational, see also below ... */ - case '': /* generate indented source mode*/ - behavior=PHP_MODE_INDENT; - break; -#endif - - case 'q': /* do not generate HTTP headers */ - no_headers = 1; - break; - - case 'v': /* show php version & quit */ - if (script_file) { - efree(script_file); - } - no_headers = 1; - if (php_request_startup(TSRMLS_C) == FAILURE) { - SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - if (no_headers) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - } -#if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2008 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -#else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2008 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -#endif - php_request_shutdown((void *) 0); - exit_status = 0; - goto out; - - case 'w': - behavior = PHP_MODE_STRIP; - break; - - case 'z': /* load extension file */ - zend_load_extension(php_optarg); - break; - - default: - break; - } - } - - if (script_file) { - /* override path_translated if -f on command line */ - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = script_file; - /* before registering argv to module exchange the *new* argv[0] */ - /* we can achieve this without allocating more memory */ - SG(request_info).argc = argc - (php_optind - 1); - SG(request_info).argv = &argv[php_optind - 1]; - SG(request_info).argv[0] = script_file; - } else if (argc > php_optind) { - /* file is on command line, but not in -f opt */ - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = estrdup(argv[php_optind]); - /* arguments after the file are considered script args */ - SG(request_info).argc = argc - php_optind; - SG(request_info).argv = &argv[php_optind]; - } - - if (no_headers) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - } - - /* all remaining arguments are part of the query string - this section of code concatenates all remaining arguments - into a single string, seperating args with a & - this allows command lines like: - - test.php v1=test v2=hello+world! - test.php "v1=test&v2=hello world!" - test.php v1=test "v2=hello world!" - */ - if (!SG(request_info).query_string && argc > php_optind) { - int slen = strlen(PG(arg_separator).input); - len = 0; - for (i = php_optind; i < argc; i++) { - if (i < (argc - 1)) { - len += strlen(argv[i]) + slen; - } else { - len += strlen(argv[i]); - } - } - - len += 2; - s = malloc(len); - *s = '\0'; /* we are pretending it came from the environment */ - for (i = php_optind; i < argc; i++) { - strlcat(s, argv[i], len); - if (i < (argc - 1)) { - strlcat(s, PG(arg_separator).input, len); - } - } - SG(request_info).query_string = s; - free_query_string = 1; - } - } /* end !cgi && !fastcgi */ - - /* - we never take stdin if we're (f)cgi, always - rely on the web server giving us the info - we need in the environment. - */ - if (SG(request_info).path_translated || cgi -#if PHP_FASTCGI - || fastcgi -#endif - ) - { - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.handle.fp = NULL; - } else { - file_handle.filename = "-"; - file_handle.type = ZEND_HANDLE_FP; - file_handle.handle.fp = stdin; - } - - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - - /* request startup only after we've done all we can to - get path_translated */ - if (php_request_startup(TSRMLS_C) == FAILURE) { -#if PHP_FASTCGI - if (fastcgi) { - fcgi_finish_request(&request); - } -#endif - SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - if (no_headers) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - } - - /* - at this point path_translated will be set if: - 1. we are running from shell and got filename was there - 2. we are running as cgi or fastcgi - */ - retval = FAILURE; - if (cgi || SG(request_info).path_translated) { - if (!php_check_open_basedir(SG(request_info).path_translated TSRMLS_CC)) { - retval = php_fopen_primary_script(&file_handle TSRMLS_CC); - } - } - /* - if we are unable to open path_translated and we are not - running from shell (so fp == NULL), then fail. - */ - if (retval == FAILURE && file_handle.handle.fp == NULL) { - if (errno == EACCES) { - SG(sapi_headers).http_response_code = 403; - PUTS("Access denied.\n"); - } else { - SG(sapi_headers).http_response_code = 404; - PUTS("No input file specified.\n"); - } -#if PHP_FASTCGI - /* we want to serve more requests if this is fastcgi - so cleanup and continue, request shutdown is - handled later */ - if (fastcgi) { - goto fastcgi_request_done; - } -#endif - - STR_FREE(SG(request_info).path_translated); - - if (free_query_string && SG(request_info).query_string) { - free(SG(request_info).query_string); - SG(request_info).query_string = NULL; - } - - php_request_shutdown((void *) 0); - SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - return FAILURE; - } - - if (CGIG(check_shebang_line) && file_handle.handle.fp && (file_handle.handle.fp != stdin)) { - /* #!php support */ - c = fgetc(file_handle.handle.fp); - if (c == '#') { - while (c != '\n' && c != '\r' && c != EOF) { - c = fgetc(file_handle.handle.fp); /* skip to end of line */ - } - /* handle situations where line is terminated by \r\n */ - if (c == '\r') { - if (fgetc(file_handle.handle.fp) != '\n') { - long pos = ftell(file_handle.handle.fp); - fseek(file_handle.handle.fp, pos - 1, SEEK_SET); - } - } - CG(start_lineno) = 2; - } else { - rewind(file_handle.handle.fp); - } - } - - switch (behavior) { - case PHP_MODE_STANDARD: - php_execute_script(&file_handle TSRMLS_CC); - break; - case PHP_MODE_LINT: - PG(during_request_startup) = 0; - exit_status = php_lint_script(&file_handle TSRMLS_CC); - if (exit_status == SUCCESS) { - zend_printf("No syntax errors detected in %s\n", file_handle.filename); - } else { - zend_printf("Errors parsing %s\n", file_handle.filename); - } - break; - case PHP_MODE_STRIP: - if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) { - zend_strip(TSRMLS_C); - fclose(file_handle.handle.fp); - php_end_ob_buffers(1 TSRMLS_CC); - } - return SUCCESS; - break; - case PHP_MODE_HIGHLIGHT: - { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) { - php_get_highlight_struct(&syntax_highlighter_ini); - zend_highlight(&syntax_highlighter_ini TSRMLS_CC); -#if PHP_FASTCGI - if (fastcgi) { - goto fastcgi_request_done; - } -#endif - fclose(file_handle.handle.fp); - php_end_ob_buffers(1 TSRMLS_CC); - } - return SUCCESS; - } - break; -#if 0 - /* Zeev might want to do something with this one day */ - case PHP_MODE_INDENT: - open_file_for_scanning(&file_handle TSRMLS_CC); - zend_indent(); - fclose(file_handle.handle.fp); - return SUCCESS; - break; -#endif - } - -#if PHP_FASTCGI -fastcgi_request_done: -#endif - { - char *path_translated; - - /* Go through this trouble so that the memory manager doesn't warn - * about SG(request_info).path_translated leaking - */ - if (SG(request_info).path_translated) { - path_translated = strdup(SG(request_info).path_translated); - STR_FREE(SG(request_info).path_translated); - SG(request_info).path_translated = path_translated; - } - - php_request_shutdown((void *) 0); - if (exit_status == 0) { - exit_status = EG(exit_status); - } - - if (SG(request_info).path_translated) { - free(SG(request_info).path_translated); - SG(request_info).path_translated = NULL; - } - if (free_query_string && SG(request_info).query_string) { - free(SG(request_info).query_string); - SG(request_info).query_string = NULL; - } - - } - -#if PHP_FASTCGI - if (!fastcgi) { - if (benchmark) { - repeats--; - if (repeats > 0) { - script_file = NULL; - php_optind = orig_optind; - php_optarg = orig_optarg; - continue; - } - } - break; - } - - /* only fastcgi will get here */ - requests++; - if (max_requests && (requests == max_requests)) { - fcgi_finish_request(&request); - if (bindpath) { - free(bindpath); - } - if (max_requests != 1) { - /* no need to return exit_status of the last request */ - exit_status = 0; - } - break; - } - /* end of fastcgi loop */ - } - fcgi_shutdown(); -#endif - - if (cgi_sapi_module.php_ini_path_override) { - free(cgi_sapi_module.php_ini_path_override); - } - if (cgi_sapi_module.ini_entries) { - free(cgi_sapi_module.ini_entries); - } - } zend_catch { - exit_status = 255; - } zend_end_try(); - -out: -#if PHP_FASTCGI - if (benchmark) { - int sec; -#ifdef HAVE_GETTIMEOFDAY - int usec; - - gettimeofday(&end, NULL); - sec = (int)(end.tv_sec - start.tv_sec); - if (end.tv_usec >= start.tv_usec) { - usec = (int)(end.tv_usec - start.tv_usec); - } else { - sec -= 1; - usec = (int)(end.tv_usec + 1000000 - start.tv_usec); - } - fprintf(stderr, "\nElapsed time: %d.%06d sec\n", sec, usec); -#else - time(&end); - sec = (int)(end - start); - fprintf(stderr, "\nElapsed time: %d sec\n", sec); -#endif - } -#endif - -#ifndef PHP_WIN32 -parent_out: -#endif - - SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); - sapi_shutdown(); - -#ifdef ZTS - /*tsrm_shutdown();*/ -#endif - -#if defined(PHP_WIN32) && ZEND_DEBUG && 0 - _CrtDumpMemoryLeaks(); -#endif - - return exit_status; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/cgi/config.w32 b/sapi/cgi/config.w32 deleted file mode 100644 index 663e182888de3..0000000000000 --- a/sapi/cgi/config.w32 +++ /dev/null @@ -1,26 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('cgi', 'Build CGI version of PHP', 'yes'); -ARG_ENABLE('fastcgi', 'Build FastCGI support into CGI binary', 'yes'); -ARG_ENABLE('path-info-check', - 'If this is disabled, paths such as /info.php/test?a=b will fail to work', 'yes'); - -ARG_ENABLE("force-cgi-redirect", "Enable the security check for internal \ -server redirects. You should use this if you are running the CGI \ -version with Apache.", "yes"); - -AC_DEFINE("FORCE_CGI_REDIRECT", PHP_FORCE_CGI_REDIRECT == "yes" ? 1 : 0, "CGI redirect mode"); -AC_DEFINE("ENABLE_PATHINFO_CHECK", PHP_PATH_INFO_CHECK == "yes" ? 1 : 0, "Pathinfo check"); - -if (PHP_CGI == "yes") { - AC_DEFINE('PHP_FASTCGI', PHP_FASTCGI == "yes" ? 1 : 0); - ADD_FLAG("LDFLAGS_CGI", "/stack:8388608"); - - if (PHP_FASTCGI == "yes") { - SAPI('cgi', 'cgi_main.c getopt.c fastcgi.c', 'php-cgi.exe'); - ADD_FLAG('LIBS_CGI', 'ws2_32.lib kernel32.lib advapi32.lib'); - } else { - SAPI('cgi', 'cgi_main.c getopt.c', 'php-cgi.exe'); - } -} diff --git a/sapi/cgi/config9.m4 b/sapi/cgi/config9.m4 deleted file mode 100644 index 855a8348ff9dc..0000000000000 --- a/sapi/cgi/config9.m4 +++ /dev/null @@ -1,112 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(cgi,, -[ --disable-cgi Disable building CGI version of PHP], yes, no) - -PHP_ARG_ENABLE(fastcgi,, -[ --enable-fastcgi CGI: Enable FastCGI support in the CGI binary], no, no) - -PHP_ARG_ENABLE(force-cgi-redirect,, -[ --enable-force-cgi-redirect - CGI: Enable security check for internal server - redirects. Use this if you run the PHP CGI with Apache], no, no) - -PHP_ARG_ENABLE(discard-path,, -[ --enable-discard-path CGI: When this is enabled the PHP CGI binary can - safely be placed outside of the web tree and people - will not be able to circumvent .htaccess security], no, no) - -PHP_ARG_ENABLE(path-info-check,, -[ --disable-path-info-check CGI: If this is disabled, paths such as - /info.php/test?a=b will fail to work], yes, no) - -dnl -dnl CGI setup -dnl -if test "$PHP_SAPI" = "default"; then - AC_MSG_CHECKING(whether to build CGI binary) - if test "$PHP_CGI" != "no"; then - AC_MSG_RESULT(yes) - PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cgi/Makefile.frag) - - dnl Set filename - case $host_alias in - *cygwin* ) - SAPI_CGI_PATH=sapi/cgi/php-cgi.exe - ;; - * ) - SAPI_CGI_PATH=sapi/cgi/php-cgi - ;; - esac - PHP_SUBST(SAPI_CGI_PATH) - - dnl --enable-fastcgi - AC_MSG_CHECKING(whether to enable fastcgi support) - if test "$PHP_FASTCGI" = "yes"; then - PHP_ENABLE_FASTCGI=1 - PHP_FCGI_FILES="fastcgi.c" - else - PHP_ENABLE_FASTCGI=0 - PHP_FCGI_FILES= - fi - AC_DEFINE_UNQUOTED(PHP_FASTCGI, $PHP_ENABLE_FASTCGI, [ ]) - AC_MSG_RESULT($PHP_FASTCGI) - - dnl --enable-force-cgi-redirect - AC_MSG_CHECKING(whether to force Apache CGI redirect) - if test "$PHP_FORCE_CGI_REDIRECT" = "yes"; then - CGI_REDIRECT=1 - else - CGI_REDIRECT=0 - fi - AC_DEFINE_UNQUOTED(FORCE_CGI_REDIRECT, $CGI_REDIRECT, [ ]) - AC_MSG_RESULT($PHP_FORCE_CGI_REDIRECT) - - dnl --enable-discard-path - AC_MSG_CHECKING(whether to discard path_info + path_translated) - if test "$PHP_DISCARD_PATH" = "yes"; then - DISCARD_PATH=1 - else - DISCARD_PATH=0 - fi - AC_DEFINE_UNQUOTED(DISCARD_PATH, $DISCARD_PATH, [ ]) - AC_MSG_RESULT($PHP_DISCARD_PATH) - - dnl --enable-path-info-check - AC_MSG_CHECKING(whether to enable path info checking) - if test "$PHP_PATH_INFO_CHECK" = "yes"; then - ENABLE_PATHINFO_CHECK=1 - else - ENABLE_PATHINFO_CHECK=0 - fi - AC_DEFINE_UNQUOTED(ENABLE_PATHINFO_CHECK, $ENABLE_PATHINFO_CHECK, [ ]) - AC_MSG_RESULT($PHP_PATH_INFO_CHECK) - - dnl Set install target and select SAPI - INSTALL_IT="@echo \"Installing PHP CGI binary: \$(INSTALL_ROOT)\$(bindir)/\"; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php-cgi\$(program_suffix)\$(EXEEXT)" - PHP_SELECT_SAPI(cgi, program, $PHP_FCGI_FILES cgi_main.c getopt.c,, '$(SAPI_CGI_PATH)') - - case $host_alias in - *aix*) - BUILD_CGI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" - ;; - *darwin*) - BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" - ;; - *) - BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" - ;; - esac - - PHP_SUBST(BUILD_CGI) - - elif test "$PHP_CLI" != "no"; then - AC_MSG_RESULT(no) - OVERALL_TARGET= - PHP_SAPI=cli - else - AC_MSG_ERROR([No SAPIs selected.]) - fi -fi diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c deleted file mode 100644 index a08da8dc9ff78..0000000000000 --- a/sapi/cgi/fastcgi.c +++ /dev/null @@ -1,1280 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "fastcgi.h" - -#include -#include -#include -#include -#include - -#ifdef _WIN32 - -#include - - typedef unsigned int in_addr_t; - - struct sockaddr_un { - short sun_family; - char sun_path[MAXPATHLEN]; - }; - - static HANDLE fcgi_accept_mutex = INVALID_HANDLE_VALUE; - static int is_impersonate = 0; - -#define FCGI_LOCK(fd) \ - if (fcgi_accept_mutex != INVALID_HANDLE_VALUE) { \ - DWORD ret; \ - while ((ret = WaitForSingleObject(fcgi_accept_mutex, 1000)) == WAIT_TIMEOUT) { \ - if (in_shutdown) return -1; \ - } \ - if (ret == WAIT_FAILED) { \ - fprintf(stderr, "WaitForSingleObject() failed\n"); \ - return -1; \ - } \ - } - -#define FCGI_UNLOCK(fd) \ - if (fcgi_accept_mutex != INVALID_HANDLE_VALUE) { \ - ReleaseMutex(fcgi_accept_mutex); \ - } - -#else - -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include - -# define closesocket(s) close(s) - -# if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL) -# include -# endif -# if defined(HAVE_SYS_SELECT_H) -# include -# endif - -#ifndef INADDR_NONE -#define INADDR_NONE ((unsigned long) -1) -#endif - -# ifndef HAVE_SOCKLEN_T - typedef unsigned int socklen_t; -# endif - -# ifdef USE_LOCKING -# define FCGI_LOCK(fd) \ - do { \ - struct flock lock; \ - lock.l_type = F_WRLCK; \ - lock.l_start = 0; \ - lock.l_whence = SEEK_SET; \ - lock.l_len = 0; \ - if (fcntl(fd, F_SETLKW, &lock) != -1) { \ - break; \ - } else if (errno != EINTR || in_shutdown) { \ - return -1; \ - } \ - } while (1) - -# define FCGI_UNLOCK(fd) \ - do { \ - int orig_errno = errno; \ - while (1) { \ - struct flock lock; \ - lock.l_type = F_UNLCK; \ - lock.l_start = 0; \ - lock.l_whence = SEEK_SET; \ - lock.l_len = 0; \ - if (fcntl(fd, F_SETLK, &lock) != -1) { \ - break; \ - } else if (errno != EINTR) { \ - return -1; \ - } \ - } \ - errno = orig_errno; \ - } while (0) -# else -# define FCGI_LOCK(fd) -# define FCGI_UNLOCK(fd) -# endif - -#endif - -typedef union _sa_t { - struct sockaddr sa; - struct sockaddr_un sa_unix; - struct sockaddr_in sa_inet; -} sa_t; - -static HashTable fcgi_mgmt_vars; - -static int is_initialized = 0; -static int is_fastcgi = 0; -static int in_shutdown = 0; -static in_addr_t *allowed_clients = NULL; - -#ifdef _WIN32 - -static DWORD WINAPI fcgi_shutdown_thread(LPVOID arg) -{ - HANDLE shutdown_event = (HANDLE) arg; - WaitForSingleObject(shutdown_event, INFINITE); - in_shutdown = 1; - return 0; -} - -#else - -static void fcgi_signal_handler(int signo) -{ - if (signo == SIGUSR1 || signo == SIGTERM) { - in_shutdown = 1; - } -} - -static void fcgi_setup_signals(void) -{ - struct sigaction new_sa, old_sa; - - sigemptyset(&new_sa.sa_mask); - new_sa.sa_flags = 0; - new_sa.sa_handler = fcgi_signal_handler; - sigaction(SIGUSR1, &new_sa, NULL); - sigaction(SIGTERM, &new_sa, NULL); - sigaction(SIGPIPE, NULL, &old_sa); - if (old_sa.sa_handler == SIG_DFL) { - sigaction(SIGPIPE, &new_sa, NULL); - } -} -#endif - -int fcgi_in_shutdown(void) -{ - return in_shutdown; -} - -int fcgi_init(void) -{ - if (!is_initialized) { -#ifndef _WIN32 - sa_t sa; - socklen_t len = sizeof(sa); -#endif - zend_hash_init(&fcgi_mgmt_vars, 0, NULL, fcgi_free_mgmt_var_cb, 1); - fcgi_set_mgmt_var("FCGI_MPXS_CONNS", sizeof("FCGI_MPXS_CONNS")-1, "0", sizeof("0")-1); - - is_initialized = 1; -#ifdef _WIN32 -# if 0 - /* TODO: Support for TCP sockets */ - WSADATA wsaData; - - if (WSAStartup(MAKEWORD(2,0), &wsaData)) { - fprintf(stderr, "Error starting Windows Sockets. Error: %d", WSAGetLastError()); - return 0; - } -# endif - if ((GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE) && - (GetStdHandle(STD_ERROR_HANDLE) == INVALID_HANDLE_VALUE) && - (GetStdHandle(STD_INPUT_HANDLE) != INVALID_HANDLE_VALUE)) { - char *str; - DWORD pipe_mode = PIPE_READMODE_BYTE | PIPE_WAIT; - HANDLE pipe = GetStdHandle(STD_INPUT_HANDLE); - - SetNamedPipeHandleState(pipe, &pipe_mode, NULL, NULL); - - str = getenv("_FCGI_SHUTDOWN_EVENT_"); - if (str != NULL) { - HANDLE shutdown_event = (HANDLE) atoi(str); - if (!CreateThread(NULL, 0, fcgi_shutdown_thread, - shutdown_event, 0, NULL)) { - return -1; - } - } - str = getenv("_FCGI_MUTEX_"); - if (str != NULL) { - fcgi_accept_mutex = (HANDLE) atoi(str); - } - return is_fastcgi = 1; - } else { - return is_fastcgi = 0; - } -#else - errno = 0; - if (getpeername(0, (struct sockaddr *)&sa, &len) != 0 && errno == ENOTCONN) { - fcgi_setup_signals(); - return is_fastcgi = 1; - } else { - return is_fastcgi = 0; - } -#endif - } - return is_fastcgi; -} - - -int fcgi_is_fastcgi(void) -{ - if (!is_initialized) { - return fcgi_init(); - } else { - return is_fastcgi; - } -} - -void fcgi_shutdown(void) -{ - if (is_initialized) { - zend_hash_destroy(&fcgi_mgmt_vars); - } - is_fastcgi = 0; -} - -#ifdef _WIN32 -/* Do some black magic with the NT security API. - * We prepare a DACL (Discretionary Access Control List) so that - * we, the creator, are allowed all access, while "Everyone Else" - * is only allowed to read and write to the pipe. - * This avoids security issues on shared hosts where a luser messes - * with the lower-level pipe settings and screws up the FastCGI service. - */ -static PACL prepare_named_pipe_acl(PSECURITY_DESCRIPTOR sd, LPSECURITY_ATTRIBUTES sa) -{ - DWORD req_acl_size; - char everyone_buf[32], owner_buf[32]; - PSID sid_everyone, sid_owner; - SID_IDENTIFIER_AUTHORITY - siaWorld = SECURITY_WORLD_SID_AUTHORITY, - siaCreator = SECURITY_CREATOR_SID_AUTHORITY; - PACL acl; - - sid_everyone = (PSID)&everyone_buf; - sid_owner = (PSID)&owner_buf; - - req_acl_size = sizeof(ACL) + - (2 * ((sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) + GetSidLengthRequired(1))); - - acl = malloc(req_acl_size); - - if (acl == NULL) { - return NULL; - } - - if (!InitializeSid(sid_everyone, &siaWorld, 1)) { - goto out_fail; - } - *GetSidSubAuthority(sid_everyone, 0) = SECURITY_WORLD_RID; - - if (!InitializeSid(sid_owner, &siaCreator, 1)) { - goto out_fail; - } - *GetSidSubAuthority(sid_owner, 0) = SECURITY_CREATOR_OWNER_RID; - - if (!InitializeAcl(acl, req_acl_size, ACL_REVISION)) { - goto out_fail; - } - - if (!AddAccessAllowedAce(acl, ACL_REVISION, FILE_GENERIC_READ | FILE_GENERIC_WRITE, sid_everyone)) { - goto out_fail; - } - - if (!AddAccessAllowedAce(acl, ACL_REVISION, FILE_ALL_ACCESS, sid_owner)) { - goto out_fail; - } - - if (!InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION)) { - goto out_fail; - } - - if (!SetSecurityDescriptorDacl(sd, TRUE, acl, FALSE)) { - goto out_fail; - } - - sa->lpSecurityDescriptor = sd; - - return acl; - -out_fail: - free(acl); - return NULL; -} -#endif - -static int is_port_number(const char *bindpath) -{ - while (*bindpath) { - if (*bindpath < '0' || *bindpath > '9') { - return 0; - } - bindpath++; - } - return 1; -} - -int fcgi_listen(const char *path, int backlog) -{ - char *s; - int tcp = 0; - char host[MAXPATHLEN]; - short port = 0; - int listen_socket; - sa_t sa; - socklen_t sock_len; -#ifdef SO_REUSEADDR -# ifdef _WIN32 - BOOL reuse = 1; -# else - int reuse = 1; -# endif -#endif - - if ((s = strchr(path, ':'))) { - port = atoi(s+1); - if (port != 0 && (s-path) < MAXPATHLEN) { - strncpy(host, path, s-path); - host[s-path] = '\0'; - tcp = 1; - } - } else if (is_port_number(path)) { - port = atoi(path); - if (port != 0) { - host[0] = '\0'; - tcp = 1; - } - } - - /* Prepare socket address */ - if (tcp) { - memset(&sa.sa_inet, 0, sizeof(sa.sa_inet)); - sa.sa_inet.sin_family = AF_INET; - sa.sa_inet.sin_port = htons(port); - sock_len = sizeof(sa.sa_inet); - - if (!*host || !strncmp(host, "*", sizeof("*")-1)) { - sa.sa_inet.sin_addr.s_addr = htonl(INADDR_ANY); - } else { - sa.sa_inet.sin_addr.s_addr = inet_addr(host); - if (sa.sa_inet.sin_addr.s_addr == INADDR_NONE) { - struct hostent *hep; - - hep = gethostbyname(host); - if (!hep || hep->h_addrtype != AF_INET || !hep->h_addr_list[0]) { - fprintf(stderr, "Cannot resolve host name '%s'!\n", host); - return -1; - } else if (hep->h_addr_list[1]) { - fprintf(stderr, "Host '%s' has multiple addresses. You must choose one explicitly!\n", host); - return -1; - } - sa.sa_inet.sin_addr.s_addr = ((struct in_addr*)hep->h_addr_list[0])->s_addr; - } - } - } else { -#ifdef _WIN32 - SECURITY_DESCRIPTOR sd; - SECURITY_ATTRIBUTES sa; - PACL acl; - HANDLE namedPipe; - - memset(&sa, 0, sizeof(sa)); - sa.nLength = sizeof(sa); - sa.bInheritHandle = FALSE; - acl = prepare_named_pipe_acl(&sd, &sa); - - namedPipe = CreateNamedPipe(path, - PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, - PIPE_TYPE_BYTE | PIPE_WAIT | PIPE_READMODE_BYTE, - PIPE_UNLIMITED_INSTANCES, - 8192, 8192, 0, &sa); - if (namedPipe == INVALID_HANDLE_VALUE) { - return -1; - } - listen_socket = _open_osfhandle((long)namedPipe, 0); - if (!is_initialized) { - fcgi_init(); - } - is_fastcgi = 1; - return listen_socket; - -#else - int path_len = strlen(path); - - if (path_len >= sizeof(sa.sa_unix.sun_path)) { - fprintf(stderr, "Listening socket's path name is too long.\n"); - return -1; - } - - memset(&sa.sa_unix, 0, sizeof(sa.sa_unix)); - sa.sa_unix.sun_family = AF_UNIX; - memcpy(sa.sa_unix.sun_path, path, path_len + 1); - sock_len = (size_t)(((struct sockaddr_un *)0)->sun_path) + path_len; -#ifdef HAVE_SOCKADDR_UN_SUN_LEN - sa.sa_unix.sun_len = sock_len; -#endif - unlink(path); -#endif - } - - /* Create, bind socket and start listen on it */ - if ((listen_socket = socket(sa.sa.sa_family, SOCK_STREAM, 0)) < 0 || -#ifdef SO_REUSEADDR - setsockopt(listen_socket, SOL_SOCKET, SO_REUSEADDR, (char*)&reuse, sizeof(reuse)) < 0 || -#endif - bind(listen_socket, (struct sockaddr *) &sa, sock_len) < 0 || - listen(listen_socket, backlog) < 0) { - - fprintf(stderr, "Cannot bind/listen socket - [%d] %s.\n",errno, strerror(errno)); - return -1; - } - - if (!tcp) { - chmod(path, 0777); - } else { - char *ip = getenv("FCGI_WEB_SERVER_ADDRS"); - char *cur, *end; - int n; - - if (ip) { - ip = strdup(ip); - cur = ip; - n = 0; - while (*cur) { - if (*cur == ',') n++; - cur++; - } - allowed_clients = malloc(sizeof(in_addr_t) * (n+2)); - n = 0; - cur = ip; - while (cur) { - end = strchr(cur, ','); - if (end) { - *end = 0; - end++; - } - allowed_clients[n] = inet_addr(cur); - if (allowed_clients[n] == INADDR_NONE) { - fprintf(stderr, "Wrong IP address '%s' in FCGI_WEB_SERVER_ADDRS\n", cur); - } - n++; - cur = end; - } - allowed_clients[n] = INADDR_NONE; - free(ip); - } - } - - if (!is_initialized) { - fcgi_init(); - } - is_fastcgi = 1; - -#ifdef _WIN32 - if (tcp) { - listen_socket = _open_osfhandle((long)listen_socket, 0); - } -#else - fcgi_setup_signals(); -#endif - return listen_socket; -} - -void fcgi_init_request(fcgi_request *req, int listen_socket) -{ - memset(req, 0, sizeof(fcgi_request)); - req->listen_socket = listen_socket; - req->fd = -1; - req->id = -1; - - req->in_len = 0; - req->in_pad = 0; - - req->out_hdr = NULL; - req->out_pos = req->out_buf; - -#ifdef _WIN32 - req->tcp = !GetNamedPipeInfo((HANDLE)_get_osfhandle(req->listen_socket), NULL, NULL, NULL, NULL); -#endif -} - -static inline ssize_t safe_write(fcgi_request *req, const void *buf, size_t count) -{ - int ret; - size_t n = 0; - - do { - errno = 0; -#ifdef _WIN32 - if (!req->tcp) { - ret = write(req->fd, ((char*)buf)+n, count-n); - } else { - ret = send(req->fd, ((char*)buf)+n, count-n, 0); - if (ret <= 0) { - errno = WSAGetLastError(); - } - } -#else - ret = write(req->fd, ((char*)buf)+n, count-n); -#endif - if (ret > 0) { - n += ret; - } else if (ret <= 0 && errno != 0 && errno != EINTR) { - return ret; - } - } while (n != count); - return n; -} - -static inline ssize_t safe_read(fcgi_request *req, const void *buf, size_t count) -{ - int ret; - size_t n = 0; - - do { - errno = 0; -#ifdef _WIN32 - if (!req->tcp) { - ret = read(req->fd, ((char*)buf)+n, count-n); - } else { - ret = recv(req->fd, ((char*)buf)+n, count-n, 0); - if (ret <= 0) { - errno = WSAGetLastError(); - } - } -#else - ret = read(req->fd, ((char*)buf)+n, count-n); -#endif - if (ret > 0) { - n += ret; - } else if (ret == 0 && errno == 0) { - return n; - } else if (ret <= 0 && errno != 0 && errno != EINTR) { - return ret; - } - } while (n != count); - return n; -} - -static inline int fcgi_make_header(fcgi_header *hdr, fcgi_request_type type, int req_id, int len) -{ - int pad = ((len + 7) & ~7) - len; - - hdr->contentLengthB0 = (unsigned char)(len & 0xff); - hdr->contentLengthB1 = (unsigned char)((len >> 8) & 0xff); - hdr->paddingLength = (unsigned char)pad; - hdr->requestIdB0 = (unsigned char)(req_id & 0xff); - hdr->requestIdB1 = (unsigned char)((req_id >> 8) & 0xff); - hdr->reserved = 0; - hdr->type = type; - hdr->version = FCGI_VERSION_1; - if (pad) { - memset(((unsigned char*)hdr) + sizeof(fcgi_header) + len, 0, pad); - } - return pad; -} - -static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end) -{ - char buf[128]; - char *tmp = buf; - int buf_size = sizeof(buf); - int name_len, val_len; - char *s; - int ret = 1; - - while (p < end) { - name_len = *p++; - if (name_len >= 128) { - name_len = ((name_len & 0x7f) << 24); - name_len |= (*p++ << 16); - name_len |= (*p++ << 8); - name_len |= *p++; - } - val_len = *p++; - if (val_len >= 128) { - val_len = ((val_len & 0x7f) << 24); - val_len |= (*p++ << 16); - val_len |= (*p++ << 8); - val_len |= *p++; - } - if (name_len + val_len < 0 || - name_len + val_len > end - p) { - /* Malformated request */ - ret = 0; - break; - } - if (name_len+1 >= buf_size) { - buf_size = name_len + 64; - tmp = (tmp == buf ? emalloc(buf_size): erealloc(tmp, buf_size)); - } - memcpy(tmp, p, name_len); - tmp[name_len] = 0; - s = zend_strndup((char*)p + name_len, val_len); - zend_hash_update(&req->env, tmp, name_len+1, &s, sizeof(char*), NULL); - p += name_len + val_len; - } - if (tmp != buf && tmp != NULL) { - efree(tmp); - } - return ret; -} - -static void fcgi_free_var(char **s) -{ - free(*s); -} - -static int fcgi_read_request(fcgi_request *req) -{ - fcgi_header hdr; - int len, padding; - unsigned char buf[FCGI_MAX_LENGTH+8]; - - req->keep = 0; - req->in_len = 0; - req->out_hdr = NULL; - req->out_pos = req->out_buf; - zend_hash_init(&req->env, 0, NULL, (void (*)(void *)) fcgi_free_var, 1); - - if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || - hdr.version < FCGI_VERSION_1) { - return 0; - } - - len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; - padding = hdr.paddingLength; - - while (hdr.type == FCGI_STDIN && len == 0) { - if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || - hdr.version < FCGI_VERSION_1) { - return 0; - } - - len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; - padding = hdr.paddingLength; - } - - if (len + padding > FCGI_MAX_LENGTH) { - return 0; - } - - req->id = (hdr.requestIdB1 << 8) + hdr.requestIdB0; - - if (hdr.type == FCGI_BEGIN_REQUEST && len == sizeof(fcgi_begin_request)) { - char *val; - - if (safe_read(req, buf, len+padding) != len+padding) { - return 0; - } - - req->keep = (((fcgi_begin_request*)buf)->flags & FCGI_KEEP_CONN); - switch ((((fcgi_begin_request*)buf)->roleB1 << 8) + ((fcgi_begin_request*)buf)->roleB0) { - case FCGI_RESPONDER: - val = strdup("RESPONDER"); - zend_hash_update(&req->env, "FCGI_ROLE", sizeof("FCGI_ROLE"), &val, sizeof(char*), NULL); - break; - case FCGI_AUTHORIZER: - val = strdup("AUTHORIZER"); - zend_hash_update(&req->env, "FCGI_ROLE", sizeof("FCGI_ROLE"), &val, sizeof(char*), NULL); - break; - case FCGI_FILTER: - val = strdup("FILTER"); - zend_hash_update(&req->env, "FCGI_ROLE", sizeof("FCGI_ROLE"), &val, sizeof(char*), NULL); - break; - default: - return 0; - } - - if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || - hdr.version < FCGI_VERSION_1) { - return 0; - } - - len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; - padding = hdr.paddingLength; - - while (hdr.type == FCGI_PARAMS && len > 0) { - if (len + padding > FCGI_MAX_LENGTH) { - return 0; - } - - if (safe_read(req, buf, len+padding) != len+padding) { - req->keep = 0; - return 0; - } - - if (!fcgi_get_params(req, buf, buf+len)) { - req->keep = 0; - return 0; - } - - if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || - hdr.version < FCGI_VERSION_1) { - req->keep = 0; - return 0; - } - len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; - padding = hdr.paddingLength; - } - } else if (hdr.type == FCGI_GET_VALUES) { - unsigned char *p = buf + sizeof(fcgi_header); - HashPosition pos; - char * str_index; - uint str_length; - ulong num_index; - int key_type; - zval ** value; - - if (safe_read(req, buf, len+padding) != len+padding) { - req->keep = 0; - return 0; - } - - if (!fcgi_get_params(req, buf, buf+len)) { - req->keep = 0; - return 0; - } - - zend_hash_internal_pointer_reset_ex(&req->env, &pos); - while ((key_type = zend_hash_get_current_key_ex(&req->env, &str_index, &str_length, &num_index, 0, &pos)) != HASH_KEY_NON_EXISTANT) { - int zlen; - zend_hash_move_forward_ex(&req->env, &pos); - if (key_type != HASH_KEY_IS_STRING) { - continue; - } - if (zend_hash_find(&fcgi_mgmt_vars, str_index, str_length, (void**) &value) != SUCCESS) { - continue; - } - --str_length; - zlen = Z_STRLEN_PP(value); - if ((p + 4 + 4 + str_length + zlen) >= (buf + sizeof(buf))) { - break; - } - if (str_length < 0x80) { - *p++ = str_length; - } else { - *p++ = ((str_length >> 24) & 0xff) | 0x80; - *p++ = (str_length >> 16) & 0xff; - *p++ = (str_length >> 8) & 0xff; - *p++ = str_length & 0xff; - } - if (zlen < 0x80) { - *p++ = zlen; - } else { - *p++ = ((zlen >> 24) & 0xff) | 0x80; - *p++ = (zlen >> 16) & 0xff; - *p++ = (zlen >> 8) & 0xff; - *p++ = zlen & 0xff; - } - memcpy(p, str_index, str_length); - p += str_length; - memcpy(p, Z_STRVAL_PP(value), zlen); - p += zlen; - } - len = p - buf - sizeof(fcgi_header); - len += fcgi_make_header((fcgi_header*)buf, FCGI_GET_VALUES_RESULT, 0, len); - if (safe_write(req, buf, sizeof(fcgi_header)+len) != (int)sizeof(fcgi_header)+len) { - req->keep = 0; - return 0; - } - return 0; - } else { - return 0; - } - - return 1; -} - -int fcgi_read(fcgi_request *req, char *str, int len) -{ - int ret, n, rest; - fcgi_header hdr; - unsigned char buf[255]; - - n = 0; - rest = len; - while (rest > 0) { - if (req->in_len == 0) { - if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || - hdr.version < FCGI_VERSION_1 || - hdr.type != FCGI_STDIN) { - req->keep = 0; - return 0; - } - req->in_len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; - req->in_pad = hdr.paddingLength; - if (req->in_len == 0) { - return n; - } - } - - if (req->in_len >= rest) { - ret = safe_read(req, str, rest); - } else { - ret = safe_read(req, str, req->in_len); - } - if (ret < 0) { - req->keep = 0; - return ret; - } else if (ret > 0) { - req->in_len -= ret; - rest -= ret; - n += ret; - str += ret; - if (req->in_len == 0) { - if (req->in_pad) { - if (safe_read(req, buf, req->in_pad) != req->in_pad) { - req->keep = 0; - return ret; - } - } - } else { - return n; - } - } else { - return n; - } - } - return n; -} - -static inline void fcgi_close(fcgi_request *req, int force, int destroy) -{ - if (destroy) { - zend_hash_destroy(&req->env); - } - -#ifdef _WIN32 - if (is_impersonate && !req->tcp) { - RevertToSelf(); - } -#endif - - if ((force || !req->keep) && req->fd >= 0) { -#ifdef _WIN32 - if (!req->tcp) { - HANDLE pipe = (HANDLE)_get_osfhandle(req->fd); - - if (!force) { - FlushFileBuffers(pipe); - } - DisconnectNamedPipe(pipe); - } else { - if (!force) { - char buf[8]; - - shutdown(req->fd, 1); - while (recv(req->fd, buf, sizeof(buf), 0) > 0) {} - } - closesocket(req->fd); - } -#else - if (!force) { - char buf[8]; - - shutdown(req->fd, 1); - while (recv(req->fd, buf, sizeof(buf), 0) > 0) {} - } - close(req->fd); -#endif - req->fd = -1; - } -} - -int fcgi_accept_request(fcgi_request *req) -{ -#ifdef _WIN32 - HANDLE pipe; - OVERLAPPED ov; -#endif - fcgi_finish_request(req); - - while (1) { - if (req->fd < 0) { - while (1) { - if (in_shutdown) { - return -1; - } -#ifdef _WIN32 - if (!req->tcp) { - pipe = (HANDLE)_get_osfhandle(req->listen_socket); - FCGI_LOCK(req->listen_socket); - ov.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - if (!ConnectNamedPipe(pipe, &ov)) { - errno = GetLastError(); - if (errno == ERROR_IO_PENDING) { - while (WaitForSingleObject(ov.hEvent, 1000) == WAIT_TIMEOUT) { - if (in_shutdown) { - CloseHandle(ov.hEvent); - FCGI_UNLOCK(req->listen_socket); - return -1; - } - } - } else if (errno != ERROR_PIPE_CONNECTED) { - } - } - CloseHandle(ov.hEvent); - req->fd = req->listen_socket; - FCGI_UNLOCK(req->listen_socket); - } else { - SOCKET listen_socket = (SOCKET)_get_osfhandle(req->listen_socket); -#else - { - int listen_socket = req->listen_socket; -#endif - sa_t sa; - socklen_t len = sizeof(sa); - - FCGI_LOCK(req->listen_socket); - req->fd = accept(listen_socket, (struct sockaddr *)&sa, &len); - FCGI_UNLOCK(req->listen_socket); - if (req->fd >= 0 && allowed_clients) { - int n = 0; - int allowed = 0; - - while (allowed_clients[n] != INADDR_NONE) { - if (allowed_clients[n] == sa.sa_inet.sin_addr.s_addr) { - allowed = 1; - break; - } - n++; - } - if (!allowed) { - fprintf(stderr, "Connection from disallowed IP address '%s' is dropped.\n", inet_ntoa(sa.sa_inet.sin_addr)); - closesocket(req->fd); - req->fd = -1; - continue; - } - } - } - -#ifdef _WIN32 - if (req->fd < 0 && (in_shutdown || errno != EINTR)) { -#else - if (req->fd < 0 && (in_shutdown || (errno != EINTR && errno != ECONNABORTED))) { -#endif - return -1; - } - -#ifdef _WIN32 - break; -#else - if (req->fd >= 0) { -#if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL) - struct pollfd fds; - int ret; - - fds.fd = req->fd; - fds.events = POLLIN; - fds.revents = 0; - do { - errno = 0; - ret = poll(&fds, 1, 5000); - } while (ret < 0 && errno == EINTR); - if (ret > 0 && (fds.revents & POLLIN)) { - break; - } - fcgi_close(req, 1, 0); -#else - if (req->fd < FD_SETSIZE) { - struct timeval tv = {5,0}; - fd_set set; - int ret; - - FD_ZERO(&set); - FD_SET(req->fd, &set); - do { - errno = 0; - ret = select(req->fd + 1, &set, NULL, NULL, &tv) >= 0; - } while (ret < 0 && errno == EINTR); - if (ret > 0 && FD_ISSET(req->fd, &set)) { - break; - } - fcgi_close(req, 1, 0); - } else { - fprintf(stderr, "Too many open file descriptors. FD_SETSIZE limit exceeded."); - fcgi_close(req, 1, 0); - } -#endif - } -#endif - } - } else if (in_shutdown) { - return -1; - } - if (fcgi_read_request(req)) { -#ifdef _WIN32 - if (is_impersonate && !req->tcp) { - pipe = (HANDLE)_get_osfhandle(req->fd); - if (!ImpersonateNamedPipeClient(pipe)) { - fcgi_close(req, 1, 1); - continue; - } - } -#endif - return req->fd; - } else { - fcgi_close(req, 1, 1); - } - } -} - -static inline fcgi_header* open_packet(fcgi_request *req, fcgi_request_type type) -{ - req->out_hdr = (fcgi_header*) req->out_pos; - req->out_hdr->type = type; - req->out_pos += sizeof(fcgi_header); - return req->out_hdr; -} - -static inline void close_packet(fcgi_request *req) -{ - if (req->out_hdr) { - int len = req->out_pos - ((unsigned char*)req->out_hdr + sizeof(fcgi_header)); - - req->out_pos += fcgi_make_header(req->out_hdr, (fcgi_request_type)req->out_hdr->type, req->id, len); - req->out_hdr = NULL; - } -} - -int fcgi_flush(fcgi_request *req, int close) -{ - int len; - - close_packet(req); - - len = req->out_pos - req->out_buf; - - if (close) { - fcgi_end_request_rec *rec = (fcgi_end_request_rec*)(req->out_pos); - - fcgi_make_header(&rec->hdr, FCGI_END_REQUEST, req->id, sizeof(fcgi_end_request)); - rec->body.appStatusB3 = 0; - rec->body.appStatusB2 = 0; - rec->body.appStatusB1 = 0; - rec->body.appStatusB0 = 0; - rec->body.protocolStatus = FCGI_REQUEST_COMPLETE; - len += sizeof(fcgi_end_request_rec); - } - - if (safe_write(req, req->out_buf, len) != len) { - req->keep = 0; - return 0; - } - - req->out_pos = req->out_buf; - return 1; -} - -int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int len) -{ - int limit, rest; - - if (len <= 0) { - return 0; - } - - if (req->out_hdr && req->out_hdr->type != type) { - close_packet(req); - } -#if 0 - /* Unoptimized, but clear version */ - rest = len; - while (rest > 0) { - limit = sizeof(req->out_buf) - (req->out_pos - req->out_buf); - - if (!req->out_hdr) { - if (limit < sizeof(fcgi_header)) { - if (!fcgi_flush(req, 0)) { - return -1; - } - } - open_packet(req, type); - } - limit = sizeof(req->out_buf) - (req->out_pos - req->out_buf); - if (rest < limit) { - memcpy(req->out_pos, str, rest); - req->out_pos += rest; - return len; - } else { - memcpy(req->out_pos, str, limit); - req->out_pos += limit; - rest -= limit; - str += limit; - if (!fcgi_flush(req, 0)) { - return -1; - } - } - } -#else - /* Optimized version */ - limit = sizeof(req->out_buf) - (req->out_pos - req->out_buf); - if (!req->out_hdr) { - limit -= sizeof(fcgi_header); - if (limit < 0) limit = 0; - } - - if (len < limit) { - if (!req->out_hdr) { - open_packet(req, type); - } - memcpy(req->out_pos, str, len); - req->out_pos += len; - } else if (len - limit < sizeof(req->out_buf) - sizeof(fcgi_header)) { - if (!req->out_hdr) { - open_packet(req, type); - } - if (limit > 0) { - memcpy(req->out_pos, str, limit); - req->out_pos += limit; - } - if (!fcgi_flush(req, 0)) { - return -1; - } - if (len > limit) { - open_packet(req, type); - memcpy(req->out_pos, str + limit, len - limit); - req->out_pos += len - limit; - } - } else { - int pos = 0; - int pad; - - close_packet(req); - while ((len - pos) > 0xffff) { - open_packet(req, type); - fcgi_make_header(req->out_hdr, type, req->id, 0xfff8); - req->out_hdr = NULL; - if (!fcgi_flush(req, 0)) { - return -1; - } - if (safe_write(req, str + pos, 0xfff8) != 0xfff8) { - req->keep = 0; - return -1; - } - pos += 0xfff8; - } - - pad = (((len - pos) + 7) & ~7) - (len - pos); - rest = pad ? 8 - pad : 0; - - open_packet(req, type); - fcgi_make_header(req->out_hdr, type, req->id, (len - pos) - rest); - req->out_hdr = NULL; - if (!fcgi_flush(req, 0)) { - return -1; - } - if (safe_write(req, str + pos, (len - pos) - rest) != (len - pos) - rest) { - req->keep = 0; - return -1; - } - if (pad) { - open_packet(req, type); - memcpy(req->out_pos, str + len - rest, rest); - req->out_pos += rest; - } - } -#endif - return len; -} - -int fcgi_finish_request(fcgi_request *req) -{ - if (req->fd >= 0) { - fcgi_flush(req, 1); - fcgi_close(req, 0, 1); - } - return 1; -} - -char* fcgi_getenv(fcgi_request *req, const char* var, int var_len) -{ - char **val; - - if (!req) return NULL; - - if (zend_hash_find(&req->env, (char*)var, var_len+1, (void**)&val) == SUCCESS) { - return *val; - } - return NULL; -} - -char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val) -{ - if (var && req) { - if (val == NULL) { - zend_hash_del(&req->env, var, var_len+1); - } else { - char **ret; - - val = strdup(val); - if (zend_hash_update(&req->env, var, var_len+1, &val, sizeof(char*), (void**)&ret) == SUCCESS) { - return *ret; - } - } - } - return NULL; -} - -#ifdef _WIN32 -void fcgi_impersonate(void) -{ - char *os_name; - - os_name = getenv("OS"); - if (os_name && stricmp(os_name, "Windows_NT") == 0) { - is_impersonate = 1; - } -} -#endif - -void fcgi_set_mgmt_var(char * name, size_t name_len, const char * value, size_t value_len) -{ - zval * zvalue; - zvalue = pemalloc(sizeof(*zvalue), 1); - Z_TYPE_P(zvalue) = IS_STRING; - Z_STRVAL_P(zvalue) = pestrndup(value, value_len, 1); - Z_STRLEN_P(zvalue) = value_len; - zend_hash_add(&fcgi_mgmt_vars, name, name_len + 1, &zvalue, sizeof(zvalue), NULL); -} - -void fcgi_free_mgmt_var_cb(void * ptr) -{ - zval ** var = (zval **)ptr; - pefree(Z_STRVAL_PP(var), 1); - pefree(*var, 1); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/cgi/fastcgi.h b/sapi/cgi/fastcgi.h deleted file mode 100644 index bc77e1860c7d5..0000000000000 --- a/sapi/cgi/fastcgi.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* FastCGI protocol */ - -#define FCGI_VERSION_1 1 - -#define FCGI_MAX_LENGTH 0xffff - -#define FCGI_KEEP_CONN 1 - -typedef enum _fcgi_role { - FCGI_RESPONDER = 1, - FCGI_AUTHORIZER = 2, - FCGI_FILTER = 3 -} fcgi_role; - -typedef enum _fcgi_request_type { - FCGI_BEGIN_REQUEST = 1, /* [in] */ - FCGI_ABORT_REQUEST = 2, /* [in] (not supported) */ - FCGI_END_REQUEST = 3, /* [out] */ - FCGI_PARAMS = 4, /* [in] environment variables */ - FCGI_STDIN = 5, /* [in] post data */ - FCGI_STDOUT = 6, /* [out] response */ - FCGI_STDERR = 7, /* [out] errors */ - FCGI_DATA = 8, /* [in] filter data (not supported) */ - FCGI_GET_VALUES = 9, /* [in] */ - FCGI_GET_VALUES_RESULT = 10 /* [out] */ -} fcgi_request_type; - -typedef enum _fcgi_protocol_status { - FCGI_REQUEST_COMPLETE = 0, - FCGI_CANT_MPX_CONN = 1, - FCGI_OVERLOADED = 2, - FCGI_UNKNOWN_ROLE = 3 -} dcgi_protocol_status; - -typedef struct _fcgi_header { - unsigned char version; - unsigned char type; - unsigned char requestIdB1; - unsigned char requestIdB0; - unsigned char contentLengthB1; - unsigned char contentLengthB0; - unsigned char paddingLength; - unsigned char reserved; -} fcgi_header; - -typedef struct _fcgi_begin_request { - unsigned char roleB1; - unsigned char roleB0; - unsigned char flags; - unsigned char reserved[5]; -} fcgi_begin_request; - -typedef struct _fcgi_begin_request_rec { - fcgi_header hdr; - fcgi_begin_request body; -} fcgi_begin_request_rec; - -typedef struct _fcgi_end_request { - unsigned char appStatusB3; - unsigned char appStatusB2; - unsigned char appStatusB1; - unsigned char appStatusB0; - unsigned char protocolStatus; - unsigned char reserved[3]; -} fcgi_end_request; - -typedef struct _fcgi_end_request_rec { - fcgi_header hdr; - fcgi_end_request body; -} fcgi_end_request_rec; - -/* FastCGI client API */ - -typedef struct _fcgi_request { - int listen_socket; -#ifdef _WIN32 - int tcp; -#endif - int fd; - int id; - int keep; - - int in_len; - int in_pad; - - fcgi_header *out_hdr; - unsigned char *out_pos; - unsigned char out_buf[1024*8]; - unsigned char reserved[sizeof(fcgi_end_request_rec)]; - - HashTable env; -} fcgi_request; - -int fcgi_init(void); -void fcgi_shutdown(void); -int fcgi_is_fastcgi(void); -int fcgi_in_shutdown(void); -int fcgi_listen(const char *path, int backlog); -void fcgi_init_request(fcgi_request *req, int listen_socket); -int fcgi_accept_request(fcgi_request *req); -int fcgi_finish_request(fcgi_request *req); - -char* fcgi_getenv(fcgi_request *req, const char* var, int var_len); -char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val); - -int fcgi_read(fcgi_request *req, char *str, int len); - -int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int len); -int fcgi_flush(fcgi_request *req, int close); - -#ifdef PHP_WIN32 -void fcgi_impersonate(void); -#endif - -void fcgi_set_mgmt_var(char * name, size_t name_len, const char * value, size_t value_len); -void fcgi_free_mgmt_var_cb(void * ptr); - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/cgi/getopt.c b/sapi/cgi/getopt.c deleted file mode 100644 index 008e3b4c930c4..0000000000000 --- a/sapi/cgi/getopt.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include -#include -#include "php_getopt.h" -#define OPTERRCOLON (1) -#define OPTERRNF (2) -#define OPTERRARG (3) - - -static int php_opt_error(int argc, char * const *argv, int oint, int optchr, int err, int show_err) -{ - if (show_err) - { - fprintf(stderr, "Error in argument %d, char %d: ", oint, optchr+1); - switch(err) - { - case OPTERRCOLON: - fprintf(stderr, ": in flags\n"); - break; - case OPTERRNF: - fprintf(stderr, "option not found %c\n", argv[oint][optchr]); - break; - case OPTERRARG: - fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]); - break; - default: - fprintf(stderr, "unknown\n"); - break; - } - } - return('?'); -} - -int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err) -{ - static int optchr = 0; - static int dash = 0; /* have already seen the - */ - int arg_start = 2; - - int opts_idx = -1; - - if (*optind >= argc) { - return(EOF); - } - if (!dash) { - if ((argv[*optind][0] != '-')) { - return(EOF); - } else { - if (!argv[*optind][1]) - { - /* - * use to specify stdin. Need to let pgm process this and - * the following args - */ - return(EOF); - } - } - } - if ((argv[*optind][0] == '-') && (argv[*optind][1] == '-')) { - /* '--' indicates end of args if not followed by a known long option name */ - if (argv[*optind][2] == '\0') { - (*optind)++; - return(EOF); - } - - while (1) { - opts_idx++; - if (opts[opts_idx].opt_char == '-') { - (*optind)++; - return(php_opt_error(argc, argv, *optind-1, optchr, OPTERRARG, show_err)); - } else if (opts[opts_idx].opt_name && !strcmp(&argv[*optind][2], opts[opts_idx].opt_name)) { - break; - } - } - optchr = 0; - dash = 0; - arg_start = 2 + strlen(opts[opts_idx].opt_name); - } else { - if (!dash) { - dash = 1; - optchr = 1; - } - /* Check if the guy tries to do a -: kind of flag */ - if (argv[*optind][optchr] == ':') { - dash = 0; - (*optind)++; - return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); - } - arg_start = 1 + optchr; - } - if (opts_idx < 0) { - while (1) { - opts_idx++; - if (opts[opts_idx].opt_char == '-') { - int errind = *optind; - int errchr = optchr; - - if (!argv[*optind][optchr+1]) { - dash = 0; - (*optind)++; - } else { - optchr++; - arg_start++; - } - return(php_opt_error(argc, argv, errind, errchr, OPTERRNF, show_err)); - } else if (argv[*optind][optchr] == opts[opts_idx].opt_char) { - break; - } - } - } - if (opts[opts_idx].need_param) { - /* Check for cases where the value of the argument - is in the form - or in the form - */ - dash = 0; - if(!argv[*optind][arg_start]) { - (*optind)++; - if (*optind == argc) { - return(php_opt_error(argc, argv, *optind-1, optchr, OPTERRARG, show_err)); - } - *optarg = argv[(*optind)++]; - } else { - *optarg = &argv[*optind][arg_start]; - (*optind)++; - } - return opts[opts_idx].opt_char; - } else { - /* multiple options specified as one (exclude long opts) */ - if (arg_start >= 2 && !((argv[*optind][0] == '-') && (argv[*optind][1] == '-'))) { - if (!argv[*optind][optchr+1]) - { - dash = 0; - (*optind)++; - } else { - optchr++; - } - } else { - (*optind)++; - } - return opts[opts_idx].opt_char; - } - assert(0); - return(0); /* never reached */ -} diff --git a/sapi/cgi/php.sym b/sapi/cgi/php.sym deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/sapi/cgi/php_getopt.h b/sapi/cgi/php_getopt.h deleted file mode 100644 index 3fc1ed0b92152..0000000000000 --- a/sapi/cgi/php_getopt.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifdef NETWARE -/* -As NetWare LibC has optind and optarg macros defined in unistd.h our local variables were getting mistakenly preprocessed so undeffing optind and optarg -*/ -#undef optarg -#undef optind -#endif -/* Define structure for one recognized option (both single char and long name). - * If short_open is '-' this is the last option. - */ -typedef struct _opt_struct { - const char opt_char; - const int need_param; - const char * opt_name; -} opt_struct; - -int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err); diff --git a/sapi/cgi/tests/001.phpt b/sapi/cgi/tests/001.phpt deleted file mode 100644 index 74c694f7c08d9..0000000000000 --- a/sapi/cgi/tests/001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -version string ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(%d) "PHP %s (cgi%s (built: %s -Copyright (c) 1997-20%s The PHP Group -Zend Engine v%s, Copyright (c) 1998-20%s Zend Technologies -" -Done diff --git a/sapi/cgi/tests/002.phpt b/sapi/cgi/tests/002.phpt deleted file mode 100644 index 66e2424f2858f..0000000000000 --- a/sapi/cgi/tests/002.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -defining INI options with -d ---SKIPIF-- - ---FILE-- -'); - -var_dump(`$php -n -d max_execution_time=111 $file`); -var_dump(`$php -n -d max_execution_time=500 $file`); -var_dump(`$php -n -d max_execution_time=500 -d max_execution_time=555 $file`); - -file_put_contents($file, ''); - -var_dump(`$php -n -d upload_tmp_dir=/test/path -d max_execution_time=555 $file`); - -unlink($file); - -echo "Done\n"; -?> ---EXPECTF-- -string(%d) "X-Powered-By: PHP/%s -Content-type: text/html - -string(3) "111" -" -string(%d) "X-Powered-By: PHP/%s -Content-type: text/html - -string(3) "500" -" -string(%d) "X-Powered-By: PHP/%s -Content-type: text/html - -string(3) "555" -" -string(%d) "X-Powered-By: PHP/%s -Content-type: text/html - -string(3) "555" -string(10) "/test/path" -" -Done diff --git a/sapi/cgi/tests/003.phpt b/sapi/cgi/tests/003.phpt deleted file mode 100644 index ea418d104ca50..0000000000000 --- a/sapi/cgi/tests/003.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -strip comments and whitespace with -w ---SKIPIF-- - ---FILE-- - -'; - -file_put_contents($filename, $code); - -var_dump(`$php -n -w "$filename"`); -var_dump(`$php -n -w "wrong"`); -var_dump(`echo "" | $php -n -w`); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -string(%d) "X-Powered-By: PHP/%s -Content-type: text/html - - - -" -string(%d) "Status: 404 Not Found -X-Powered-By: PHP/%s -Content-type: text/html - -No input file specified. -" -string(%d) "X-Powered-By: PHP/%s -Content-type: text/html - - -" -Done diff --git a/sapi/cgi/tests/004.phpt b/sapi/cgi/tests/004.phpt deleted file mode 100644 index c841b68e04f63..0000000000000 --- a/sapi/cgi/tests/004.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -execute a file with -f ---SKIPIF-- - ---FILE-- - -'; - -file_put_contents($filename, $code); - -var_dump(`$php -n -f "$filename" 2>/dev/null`); -var_dump(`$php -n -f "wrong"`); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -string(%d) " -
-Fatal error: Cannot access private property test::$pri in %s004.test.php on line 8
-" -string(25) "No input file specified. -" -Done diff --git a/sapi/cgi/tests/005.phpt b/sapi/cgi/tests/005.phpt deleted file mode 100644 index 34a28f9c5e8e7..0000000000000 --- a/sapi/cgi/tests/005.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -using invalid combinations of cmdline options ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(51) "No input file specified. -Interactive mode enabled - -" -string(51) "No input file specified. -Interactive mode enabled - -" -Done diff --git a/sapi/cgi/tests/006.phpt b/sapi/cgi/tests/006.phpt deleted file mode 100644 index 107ddc7747f44..0000000000000 --- a/sapi/cgi/tests/006.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -syntax check ---SKIPIF-- - ---FILE-- - -'; - -file_put_contents($filename, $code); - -var_dump(`"$php" -n -l "$filename"`); -var_dump(`"$php" -n -l some.unknown`); - -$code = ' - -'; - -file_put_contents($filename, $code); - -var_dump(`"$php" -n -l "$filename" 2>/dev/null`); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -string(%d) "No syntax errors detected in %s006.test.php -" -string(%d) "No input file specified. -" -string(%d) "
-Parse error: %s expecting %s{%s in %s006.test.php on line 5
-Errors parsing %s006.test.php -" -Done diff --git a/sapi/cgi/tests/007.phpt b/sapi/cgi/tests/007.phpt deleted file mode 100644 index 92bf0f6aa3349..0000000000000 --- a/sapi/cgi/tests/007.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -invalid arguments and error messages ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(25) "No input file specified. -" -string(31) "No syntax errors detected in - -" -Done diff --git a/sapi/cgi/tests/008.phpt b/sapi/cgi/tests/008.phpt deleted file mode 100644 index 40140e87925e4..0000000000000 --- a/sapi/cgi/tests/008.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -syntax highlighting ---SKIPIF-- - ---FILE-- - -'; - -file_put_contents($filename, $code); - -var_dump(`"$php" -n -s "$filename"`); -var_dump(`"$php" -n -s "unknown"`); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -string(%d) "X-Powered-By: PHP/%s -Content-type: text/html - - -
<?php
$test 
"var"//var
/* test class */
class test {
    private 
$var = array();

    public static function 
foo(Test $arg) {
        echo 
"hello";
        
var_dump($this);
    }
}

$o = new test;
?>
-
-
" -string(%d) "Status: 404 Not Found -X-Powered-By: PHP/%s -Content-type: text/html - -No input file specified. -" -Done diff --git a/sapi/cgi/tests/009.phpt b/sapi/cgi/tests/009.phpt deleted file mode 100644 index 1c429ac1985cc..0000000000000 --- a/sapi/cgi/tests/009.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -path info request without exported PATH_INFO ---SKIPIF-- - ---FILE-- -'); - -echo (`$php -n $f`); - -echo "Done\n"; - -@unlink($f); -?> ---EXPECTF-- -X-Powered-By: PHP/%s -Content-type: text/html - -string(%d) "%s/x" -Done diff --git a/sapi/cgi/tests/010.phpt b/sapi/cgi/tests/010.phpt deleted file mode 100644 index e633ad28baf5f..0000000000000 --- a/sapi/cgi/tests/010.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Bug #45860 (header() function fails to correctly replace all Status lines) ---SKIPIF-- - ---FILE-- -'); - -echo (`$php -n $f`); - -file_put_contents($f, ''); - -echo (`$php -n $f`); - -file_put_contents($f, ''); - -echo (`$php -n $f`); - -echo "Done\n"; - -@unlink($f); -?> ---EXPECTF-- -Status: 403 Forbidden -X-Powered-By: PHP/%s -Content-type: text/html - -Status: 403 Forbidden -X-Powered-By: PHP/%s -Content-type: text/html - -X-Powered-By: PHP/%s -Status: 403 Also Forbidden -Content-type: text/html - -Done diff --git a/sapi/cgi/tests/include.inc b/sapi/cgi/tests/include.inc deleted file mode 100644 index 2d8ed8a2e397e..0000000000000 --- a/sapi/cgi/tests/include.inc +++ /dev/null @@ -1,57 +0,0 @@ - diff --git a/sapi/cgi/tests/skipif.inc b/sapi/cgi/tests/skipif.inc deleted file mode 100644 index 9da8b7934d827..0000000000000 --- a/sapi/cgi/tests/skipif.inc +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/sapi/cli/CREDITS b/sapi/cli/CREDITS deleted file mode 100644 index 5f3b0fbe39631..0000000000000 --- a/sapi/cli/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -CLI -Edin Kadribasic, Marcus Boerger, Johannes Schlueter diff --git a/sapi/cli/Makefile.frag b/sapi/cli/Makefile.frag deleted file mode 100644 index 6903ca1fc0c7d..0000000000000 --- a/sapi/cli/Makefile.frag +++ /dev/null @@ -1,11 +0,0 @@ -cli: $(SAPI_CLI_PATH) - -$(SAPI_CLI_PATH): $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS) - $(BUILD_CLI) - -install-cli: $(SAPI_CLI_PATH) - @echo "Installing PHP CLI binary: $(INSTALL_ROOT)$(bindir)/" - @$(INSTALL_CLI) - @echo "Installing PHP CLI man page: $(INSTALL_ROOT)$(mandir)/man1/" - @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 - @$(INSTALL_DATA) $(builddir)/php.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)php$(program_suffix).1 diff --git a/sapi/cli/README b/sapi/cli/README deleted file mode 100644 index 9e519e9bd011e..0000000000000 --- a/sapi/cli/README +++ /dev/null @@ -1,20 +0,0 @@ -The CLI (command line interface) SAPI has been introduced -with a goal of making PHP better at supporting the creation of -stand alone applications. - -It is based on CGI SAPI with all CGI specific things removed. - -The main differences between the two: - -* CLI is started up in quiet mode by default. - (-q switch kept for compatibility) -* It does not change the working directory to that of the script. - (-C switch kept for compatibility) -* Plain text error message -* $argc and $argv registered irrespective of register_globals - and register_argc_argv php.ini settings. -* implicit_flush always on -* -r option which allows execution of PHP code directly from - the command line (e.g. php -r 'echo md5("test");' ) -* Other more sophisticated command line switches (see: man php) -* max_execution_time is set to unlimited, overriding php.ini setting. diff --git a/sapi/cli/TODO b/sapi/cli/TODO deleted file mode 100644 index 22e6689001f09..0000000000000 --- a/sapi/cli/TODO +++ /dev/null @@ -1,2 +0,0 @@ -TODO: - diff --git a/sapi/cli/cli_win32.c b/sapi/cli/cli_win32.c deleted file mode 100644 index 4407fd088f688..0000000000000 --- a/sapi/cli/cli_win32.c +++ /dev/null @@ -1,2 +0,0 @@ -#define PHP_CLI_WIN32_NO_CONSOLE 1 -#include "php_cli.c" diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4 deleted file mode 100644 index 1a6fdbf645df2..0000000000000 --- a/sapi/cli/config.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(cli,, -[ --disable-cli Disable building CLI version of PHP - (this forces --without-pear)], yes, no) - -AC_MSG_CHECKING(for CLI build) -if test "$PHP_CLI" != "no"; then - PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cli/Makefile.frag,$abs_srcdir/sapi/cli,sapi/cli) - SAPI_CLI_PATH=sapi/cli/php - PHP_SUBST(SAPI_CLI_PATH) - - case $host_alias in - *aix*) - if test "$php_build_target" = "shared"; then - BUILD_CLI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" - else - BUILD_CLI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" - fi - ;; - *darwin*) - BUILD_CLI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" - ;; - *netware*) - BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -Lnetware -lphp5lib -o \$(SAPI_CLI_PATH)" - ;; - *) - BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)" - ;; - esac - INSTALL_CLI="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(bindir); \$(INSTALL) -m 0755 \$(SAPI_CLI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)\$(EXEEXT)" - - PHP_SUBST(BUILD_CLI) - PHP_SUBST(INSTALL_CLI) - PHP_OUTPUT(sapi/cli/php.1) -fi -AC_MSG_RESULT($PHP_CLI) diff --git a/sapi/cli/config.w32 b/sapi/cli/config.w32 deleted file mode 100644 index 98ca1d0cc3719..0000000000000 --- a/sapi/cli/config.w32 +++ /dev/null @@ -1,20 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('cli', 'Build CLI version of PHP', 'yes'); -ARG_ENABLE('crt-debug', 'Extra CRT debugging', 'no'); -ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no'); - -if (PHP_CLI == "yes") { - SAPI('cli', 'getopt.c php_cli.c php_cli_readline.c', 'php.exe'); - if (PHP_CRT_DEBUG == "yes") { - ADD_FLAG("CFLAGS_CLI", "/D PHP_WIN32_DEBUG_HEAP"); - } - ADD_FLAG("LDFLAGS_CLI", "/stack:8388608"); -} - -if (PHP_CLI_WIN32 == "yes") { - SAPI('cli_win32', 'getopt.c cli_win32.c php_cli_readline.c', 'php-win.exe'); - ADD_FLAG("LDFLAGS_CLI_WIN32", "/stack:8388608"); -} - diff --git a/sapi/cli/getopt.c b/sapi/cli/getopt.c deleted file mode 100644 index e36588eb23401..0000000000000 --- a/sapi/cli/getopt.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include -#include -#include "php_getopt.h" -#define OPTERRCOLON (1) -#define OPTERRNF (2) -#define OPTERRARG (3) - - -static int php_opt_error(int argc, char * const *argv, int oint, int optchr, int err, int show_err) /* {{{ */ -{ - if (show_err) - { - fprintf(stderr, "Error in argument %d, char %d: ", oint, optchr+1); - switch(err) - { - case OPTERRCOLON: - fprintf(stderr, ": in flags\n"); - break; - case OPTERRNF: - fprintf(stderr, "option not found %c\n", argv[oint][optchr]); - break; - case OPTERRARG: - fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]); - break; - default: - fprintf(stderr, "unknown\n"); - break; - } - } - return('?'); -} -/* }}} */ - -int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err) /* {{{ */ -{ - static int optchr = 0; - static int dash = 0; /* have already seen the - */ - int arg_start = 2; - - int opts_idx = -1; - - if (*optind >= argc) { - return(EOF); - } - if (!dash) { - if ((argv[*optind][0] != '-')) { - return(EOF); - } else { - if (!argv[*optind][1]) - { - /* - * use to specify stdin. Need to let pgm process this and - * the following args - */ - return(EOF); - } - } - } - if ((argv[*optind][0] == '-') && (argv[*optind][1] == '-')) { - /* '--' indicates end of args if not followed by a known long option name */ - if (argv[*optind][2] == '\0') { - (*optind)++; - return(EOF); - } - - while (1) { - opts_idx++; - if (opts[opts_idx].opt_char == '-') { - (*optind)++; - return(php_opt_error(argc, argv, *optind-1, optchr, OPTERRARG, show_err)); - } else if (opts[opts_idx].opt_name && !strcmp(&argv[*optind][2], opts[opts_idx].opt_name)) { - break; - } - } - optchr = 0; - dash = 0; - arg_start = 2 + strlen(opts[opts_idx].opt_name); - } else { - if (!dash) { - dash = 1; - optchr = 1; - } - /* Check if the guy tries to do a -: kind of flag */ - if (argv[*optind][optchr] == ':') { - dash = 0; - (*optind)++; - return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); - } - arg_start = 1 + optchr; - } - if (opts_idx < 0) { - while (1) { - opts_idx++; - if (opts[opts_idx].opt_char == '-') { - int errind = *optind; - int errchr = optchr; - - if (!argv[*optind][optchr+1]) { - dash = 0; - (*optind)++; - } else { - optchr++; - arg_start++; - } - return(php_opt_error(argc, argv, errind, errchr, OPTERRNF, show_err)); - } else if (argv[*optind][optchr] == opts[opts_idx].opt_char) { - break; - } - } - } - if (opts[opts_idx].need_param) { - /* Check for cases where the value of the argument - is in the form - or in the form - */ - dash = 0; - if(!argv[*optind][arg_start]) { - (*optind)++; - if (*optind == argc) { - return(php_opt_error(argc, argv, *optind-1, optchr, OPTERRARG, show_err)); - } - *optarg = argv[(*optind)++]; - } else { - *optarg = &argv[*optind][arg_start]; - (*optind)++; - } - return opts[opts_idx].opt_char; - } else { - /* multiple options specified as one (exclude long opts) */ - if (arg_start >= 2 && !((argv[*optind][0] == '-') && (argv[*optind][1] == '-'))) { - if (!argv[*optind][optchr+1]) - { - dash = 0; - (*optind)++; - } else { - optchr++; - } - } else { - (*optind)++; - } - return opts[opts_idx].opt_char; - } - assert(0); - return(0); /* never reached */ -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in deleted file mode 100644 index 9e78fef116362..0000000000000 --- a/sapi/cli/php.1.in +++ /dev/null @@ -1,416 +0,0 @@ -.TH PHP 1 "2008" "The PHP Group" "Scripting Language" -.SH NAME -.TP 15 -php \- PHP Command Line Interface 'CLI' -.SH SYNOPSIS -.B php -[options] [ -.B \-f\fP ] -.IR file -[[\-\-] -.IR args.\|.\|. ] -.LP -.B php -[options] -.B \-r -.IR code -[[\-\-] -.IR args.\|.\|. ] -.LP -.B php -[options] [\-B -.IR code ] -.B \-R -.IR code -[\-E -.IR code ] -[[\-\-] -.IR args.\|.\|. ] -.LP -.B php -[options] [\-B -.IR code ] -.B \-F -.IR file -[\-E -.IR code ] -[[\-\-] -.IR args.\|.\|. ] -.LP -.B php -[options] \-\- [ -.IR args.\|.\|. ] -.LP -\fBphp \fP[options] \fB\-a\fP -.LP -.SH DESCRIPTION -\fBPHP\fP is a widely\-used general\-purpose scripting language that is especially suited for -Web development and can be embedded into HTML. This is the command line interface -that enables you to do the following: -.P -You can parse and execute files by using parameter \-f followed by the name of the -.IR file -to be executed. -.LP -Using parameter \-r you can directly execute PHP -.IR code -simply as you would do inside a -.B \.php -file when using the -.B eval() -function. -.LP -It is also possible to process the standard input line by line using either -the parameter \-R or \-F. In this mode each separate input line causes the -.IR code -specified by \-R or the -.IR file -specified by \-F to be executed. -You can access the input line by \fB$argn\fP. While processing the input lines -.B $argi -contains the number of the actual line being processed. Further more -the paramters \-B and \-E can be used to execute -.IR code -(see \-r) before and -after all input lines have been processed respectively. Notice that the -input is read from -.B STDIN -and therefore reading from -.B STDIN -explicitly changes the next input line or skips input lines. -.LP -If none of \-r \-f \-B \-R \-F or \-E is present but a single parameter is given -then this parameter is taken as the filename to parse and execute (same as -with \-f). If no parameter is present then the standard input is read and -executed. -.SH OPTIONS -.TP 15 -.PD 0 -.B \-\-interactive -.TP -.PD 1 -.B \-a -Run PHP interactively. This lets you enter snippets of PHP code that directly -get executed. When readline support is enabled you can edit the lines and also -have history support. -.TP -.PD 0 -.B \-\-php\-ini \fIpath\fP|\fIfile\fP -.TP -.PD 1 -.B \-c \fIpath\fP|\fIfile\fP -Look for -.B php.ini -file in the directory -.IR path -or use the specified -.IR file -.TP -.PD 0 -.B \-\-no\-php\-ini -.TP -.PD 1 -.B \-n -No -.B php.ini -file will be used -.TP -.PD 0 -.B \-\-define \fIfoo\fP[=\fIbar\fP] -.TP -.PD 1 -.B \-d \fIfoo\fP[=\fIbar\fP] -Define INI entry -.IR foo -with value -.IR bar -.TP -.B \-e -Generate extended information for debugger/profiler -.TP -.PD 0 -.B \-\-file \fIfile\fP -.TP -.PD 1 -.B \-f \fIfile\fP -Parse and execute -.IR file -.TP -.PD 0 -.B \-\-global \fIname\fP -.TP -.PD 1 -.B \-g \fIname\fP -Make variable -.IR name -global in script. -.TP -.PD 0 -.B \-\-help -.TP -.PD 1 -.B \-h -This help -.TP -.PD 0 -.B \-\-hide\-args -.TP -.PD 1 -.B \-H -Hide script name (\fIfile\fP) and parameters (\fIargs\.\.\.\fP) from external -tools. For example you may want to use this when a php script is started as -a daemon and the command line contains sensitive data such as passwords. -.TP -.PD 0 -.B \-\-info -.TP -.PD 1 -.B \-i -PHP information and configuration -.TP -.PD 0 -.B \-\-syntax\-check -.TP -.PD 1 -.B \-l -Syntax check only (lint) -.TP -.PD 0 -.B \-\-modules -.TP -.PD 1 -.B \-m -Show compiled in modules -.TP -.PD 0 -.B \-\-run \fIcode\fP -.TP -.PD 1 -.B \-r \fIcode\fP -Run PHP -.IR code -without using script tags -.B '' -.TP -.PD 0 -.B \-\-process\-begin \fIcode\fP -.TP -.PD 1 -.B \-B \fIcode\fP -Run PHP -.IR code -before processing input lines -.TP -.PD 0 -.B \-\-process\-code \fIcode\fP -.TP -.PD 1 -.B \-R \fIcode\fP -Run PHP -.IR code -for every input line -.TP -.PD 0 -.B \-\-process\-file \fIfile\fP -.TP -.PD 1 -.B \-F \fIfile\fP -Parse and execute -.IR file -for every input line -.TP -.PD 0 -.B \-\-process\-end \fIcode\fP -.TP -.PD 1 -.B \-E \fIcode\fP -Run PHP -.IR code -after processing all input lines -.TP -.PD 0 -.B \-\-syntax\-highlight -.TP -.PD 1 -.B \-s -Display colour syntax highlighted source -.TP -.PD 0 -.B \-\-version -.TP -.PD 1 -.B \-v -Version number -.TP -.PD 0 -.B \-\-stripped -.TP -.PD 1 -.B \-w -Display source with stripped comments and whitespace -.TP -.PD 0 -.B \-\-zend\-extension \fIfile\fP -.TP -.PD 1 -.B \-z \fIfile\fP -Load Zend extension -.IR file -.TP -.IR args.\|.\|. -Arguments passed to script. Use -.B '\-\-' -.IR args -when first argument starts with -.B '\-' -or script is read from stdin -.TP -.PD 0 -.B \-\-rfunction -.IR name -.TP -.PD 1 -.B \-\-rf -.IR name -Shows information about function -.B name -.TP -.PD 0 -.B \-\-rclass -.IR name -.TP -.PD 1 -.B \-\-rc -.IR name -Shows information about class -.B name -.TP -.PD 0 -.B \-\-rextension -.IR name -.TP -.PD 1 -.B \-\-re -.IR name -Shows information about extension -.B name -.TP -.PD 0 -.B \-\-rextinfo -.IR name -.TP -.PD 1 -.B \-\-ri -.IR name -Shows configuration for extension -.B name -.SH FILES -.TP 15 -.B php\-cli.ini -The configuration file for the CLI version of PHP. -.TP -.B php.ini -The standard configuration file will only be used when -.B php\-cli.ini -cannot be found. -.SH EXAMPLES -.TP 5 -\fIphp -r 'echo "Hello World\\n";'\fP -This command simply writes the text "Hello World" to standard out. -.TP -\fIphp \-r 'print_r(gd_info());'\fP -This shows the configuration of your gd extension. You can use this -to easily check which image formats you can use. If you have any -dynamic modules you may want to use the same ini file that php uses -when executed from your webserver. There are more extensions which -have such a function. For dba use: -.RS -\fIphp \-r 'print_r(dba_handlers(1));'\fP -.RE -.TP -\fIphp \-R 'echo strip_tags($argn)."\\n";'\fP -This PHP command strips off the HTML tags line by line and outputs the -result. To see how it works you can first look at the following PHP command -\'\fIphp \-d html_errors=1 \-i\fP\' which uses PHP to output HTML formatted -configuration information. If you then combine those two -\'\fIphp \.\.\.|php \.\.\.\fP\' you'll see what happens. -.TP -\fIphp \-E 'echo "Lines: $argi\\n";'\fP -Using this PHP command you can count the lines being input. -.TP -\fIphp \-R '@$l+=count(file($argn));' \-E 'echo "Lines:$l\\n";'\fP -In this example PHP expects each input line beeing a file. It counts all lines -of the files specified by each input line and shows the summarized result. -You may combine this with tools like find and change the php scriptlet. -.TP -\fIphp \-R 'echo "$argn\\n"; fgets(STDIN);'\fP -Since you have access to STDIN from within \-B \-R \-F and \-E you can skip -certain input lines with your code. But note that in such cases $argi only -counts the lines being processed by php itself. Having read this you will -guess what the above program does: skipping every second input line. -.SH TIPS -You can use a shebang line to automatically invoke php -from scripts. Only the CLI version of PHP will ignore -such a first line as shown below: -.P -.PD 0 -.RS -#!/bin/php -.P - -.RE -.PD 1 -.P -.SH SEE ALSO -For a more or less complete description of PHP look here: -.PD 0 -.P -.B http://www.php.net/manual/ -.PD 1 -.P -A nice introduction to PHP by Stig Bakken can be found here: -.PD 0 -.P -.B http://www.zend.com/zend/art/intro.php -.PD 1 -.SH BUGS -You can view the list of known bugs or report any new bug you -found at: -.PD 0 -.P -.B http://bugs.php.net -.PD 1 -.SH AUTHORS -The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski. -.P -Additional work for the CLI sapi was done by Edin Kadribasic, Marcus Boerger and Johannes Schlueter. -.P -A List of active developers can be found here: -.PD 0 -.P -.B http://www.php.net/credits.php -.PD 1 -.P -And last but not least PHP was developed with the help of a huge amount of -contributors all around the world. -.SH VERSION INFORMATION -This manpage describes \fBphp\fP, version @PHP_VERSION@. -.SH COPYRIGHT -Copyright \(co 1997\-2008 The PHP Group -.LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B http://www.php.net/license/3_01.txt -.PD 1 -.P -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 -.B license@php.net -so we can mail you a copy immediately. diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c deleted file mode 100644 index 3d7de7d08c601..0000000000000 --- a/sapi/cli/php_cli.c +++ /dev/null @@ -1,1352 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Edin Kadribasic | - | Marcus Boerger | - | Johannes Schlueter | - | Parts based on CGI SAPI Module by | - | Rasmus Lerdorf, Stig Bakken and Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_variables.h" -#include "zend_hash.h" -#include "zend_modules.h" -#include "zend_interfaces.h" - -#ifdef HAVE_REFLECTION -#include "ext/reflection/php_reflection.h" -#endif - -#include "SAPI.h" - -#include -#include "php.h" -#ifdef PHP_WIN32 -#include "win32/time.h" -#include "win32/signal.h" -#include -#endif -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_SETLOCALE -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" -#ifdef PHP_WIN32 -#include -#include -#include "win32/php_registry.h" -#endif - -#if HAVE_SIGNAL_H -#include -#endif - -#ifdef __riscos__ -#include -#endif - -#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) -#include -#if !HAVE_LIBEDIT -#include -#endif -#include "php_cli_readline.h" -#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */ - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" -#include "zend_exceptions.h" - -#include "php_getopt.h" - -PHPAPI extern char *php_ini_opened_path; -PHPAPI extern char *php_ini_scanned_files; - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -#define PHP_MODE_STANDARD 1 -#define PHP_MODE_HIGHLIGHT 2 -#define PHP_MODE_INDENT 3 -#define PHP_MODE_LINT 4 -#define PHP_MODE_STRIP 5 -#define PHP_MODE_CLI_DIRECT 6 -#define PHP_MODE_PROCESS_STDIN 7 -#define PHP_MODE_REFLECTION_FUNCTION 8 -#define PHP_MODE_REFLECTION_CLASS 9 -#define PHP_MODE_REFLECTION_EXTENSION 10 -#define PHP_MODE_REFLECTION_EXT_INFO 11 -#define PHP_MODE_SHOW_INI_CONFIG 12 - -#define HARDCODED_INI \ - "html_errors=0\n" \ - "register_argc_argv=1\n" \ - "implicit_flush=1\n" \ - "output_buffering=0\n" \ - "max_execution_time=0\n" \ - "max_input_time=-1\n" - -static char *php_optarg = NULL; -static int php_optind = 1; -#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) -static char php_last_char = '\0'; -#endif - -static const opt_struct OPTIONS[] = { - {'a', 0, "interactive"}, - {'B', 1, "process-begin"}, - {'C', 0, "no-chdir"}, /* for compatibility with CGI (do not chdir to script directory) */ - {'c', 1, "php-ini"}, - {'d', 1, "define"}, - {'E', 1, "process-end"}, - {'e', 0, "profile-info"}, - {'F', 1, "process-file"}, - {'f', 1, "file"}, - {'h', 0, "help"}, - {'i', 0, "info"}, - {'l', 0, "syntax-check"}, - {'m', 0, "modules"}, - {'n', 0, "no-php-ini"}, - {'q', 0, "no-header"}, /* for compatibility with CGI (do not generate HTTP headers) */ - {'R', 1, "process-code"}, - {'H', 0, "hide-args"}, - {'r', 1, "run"}, - {'s', 0, "syntax-highlight"}, - {'s', 0, "syntax-highlighting"}, - {'w', 0, "strip"}, - {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ - {'v', 0, "version"}, - {'z', 1, "zend-extension"}, -#ifdef HAVE_REFLECTION - {10, 1, "rf"}, - {10, 1, "rfunction"}, - {11, 1, "rc"}, - {11, 1, "rclass"}, - {12, 1, "re"}, - {12, 1, "rextension"}, -#endif - {13, 1, "ri"}, - {13, 1, "rextinfo"}, - {14, 0, "ini"}, - {'-', 0, NULL} /* end of args */ -}; - -static int print_module_info(zend_module_entry *module TSRMLS_DC) /* {{{ */ -{ - php_printf("%s\n", module->name); - return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ - -static int module_name_cmp(const void *a, const void *b TSRMLS_DC) /* {{{ */ -{ - Bucket *f = *((Bucket **) a); - Bucket *s = *((Bucket **) b); - - return strcasecmp(((zend_module_entry *)f->pData)->name, - ((zend_module_entry *)s->pData)->name); -} -/* }}} */ - -static void print_modules(TSRMLS_D) /* {{{ */ -{ - HashTable sorted_registry; - zend_module_entry tmp; - - zend_hash_init(&sorted_registry, 50, NULL, NULL, 1); - zend_hash_copy(&sorted_registry, &module_registry, NULL, &tmp, sizeof(zend_module_entry)); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply(&sorted_registry, (apply_func_t) print_module_info TSRMLS_CC); - zend_hash_destroy(&sorted_registry); -} -/* }}} */ - -static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) /* {{{ */ -{ - php_printf("%s\n", ext->name); - return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ - -static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC) /* {{{ */ -{ - return strcmp(((zend_extension *)(*f)->data)->name, - ((zend_extension *)(*s)->data)->name); -} -/* }}} */ - -static void print_extensions(TSRMLS_D) /* {{{ */ -{ - zend_llist sorted_exts; - - zend_llist_copy(&sorted_exts, &zend_extensions); - sorted_exts.dtor = NULL; - zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC); - zend_llist_apply(&sorted_exts, (llist_apply_func_t) print_extension_info TSRMLS_CC); - zend_llist_destroy(&sorted_exts); -} -/* }}} */ - -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif - -static inline size_t sapi_cli_single_write(const char *str, uint str_length) /* {{{ */ -{ -#ifdef PHP_WRITE_STDOUT - long ret; - - ret = write(STDOUT_FILENO, str, str_length); - if (ret <= 0) { - return 0; - } - return ret; -#else - size_t ret; - - ret = fwrite(str, 1, MIN(str_length, 16384), stdout); - return ret; -#endif -} -/* }}} */ - -static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ -{ - const char *ptr = str; - uint remaining = str_length; - size_t ret; - -#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) - if (!str_length) { - return 0; - } - php_last_char = str[str_length-1]; -#endif - - while (remaining > 0) - { - ret = sapi_cli_single_write(ptr, remaining); - if (!ret) { -#ifndef PHP_CLI_WIN32_NO_CONSOLE - php_handle_aborted_connection(); -#endif - break; - } - ptr += ret; - remaining -= ret; - } - - return str_length; -} -/* }}} */ - -static void sapi_cli_flush(void *server_context) /* {{{ */ -{ - /* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR streams - * are/could be closed before fflush() is called. - */ - if (fflush(stdout)==EOF && errno!=EBADF) { -#ifndef PHP_CLI_WIN32_NO_CONSOLE - php_handle_aborted_connection(); -#endif - } -} -/* }}} */ - -static char *php_self = ""; -static char *script_filename = ""; - -static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ -{ - /* In CGI mode, we consider the environment to be a part of the server - * variables - */ - php_import_environment_variables(track_vars_array TSRMLS_CC); - - /* Build the special-case PHP_SELF variable for the CLI version */ - php_register_variable("PHP_SELF", php_self, track_vars_array TSRMLS_CC); - php_register_variable("SCRIPT_NAME", php_self, track_vars_array TSRMLS_CC); - /* filenames are empty for stdin */ - php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array TSRMLS_CC); - /* just make it available */ - php_register_variable("DOCUMENT_ROOT", "", track_vars_array TSRMLS_CC); -} -/* }}} */ - -static void sapi_cli_log_message(char *message) /* {{{ */ -{ - fprintf(stderr, "%s\n", message); -} -/* }}} */ - -static int sapi_cli_deactivate(TSRMLS_D) /* {{{ */ -{ - fflush(stdout); - if(SG(request_info).argv0) { - free(SG(request_info).argv0); - SG(request_info).argv0 = NULL; - } - return SUCCESS; -} -/* }}} */ - -static char* sapi_cli_read_cookies(TSRMLS_D) /* {{{ */ -{ - return NULL; -} -/* }}} */ - -static int sapi_cli_header_handler(sapi_header_struct *h, sapi_headers_struct *s TSRMLS_DC) /* {{{ */ -{ - /* free allocated header line */ - efree(h->header); - /* avoid pushing headers into SAPI headers list */ - return 0; -} -/* }}} */ - -static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */ -{ - /* We do nothing here, this function is needed to prevent that the fallback - * header handling is called. */ - return SAPI_HEADER_SENT_SUCCESSFULLY; -} -/* }}} */ - -static void sapi_cli_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) /* {{{ */ -{ -} -/* }}} */ - -static int php_cli_startup(sapi_module_struct *sapi_module) /* {{{ */ -{ - if (php_module_startup(sapi_module, NULL, 0)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ sapi_cli_ini_defaults */ - -/* overwriteable ini defaults must be set in sapi_cli_ini_defaults() */ -#define INI_DEFAULT(name,value)\ - ZVAL_STRING(tmp, value, 0);\ - zend_hash_update(configuration_hash, name, sizeof(name), tmp, sizeof(zval), (void**)&entry);\ - Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry)) - -static void sapi_cli_ini_defaults(HashTable *configuration_hash) -{ - zval *tmp, *entry; - - MAKE_STD_ZVAL(tmp); - - INI_DEFAULT("report_zend_debug", "0"); - INI_DEFAULT("display_errors", "1"); - - FREE_ZVAL(tmp); -} -/* }}} */ - -/* {{{ sapi_module_struct cli_sapi_module - */ -static sapi_module_struct cli_sapi_module = { - "cli", /* name */ - "Command Line Interface", /* pretty name */ - - php_cli_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - sapi_cli_deactivate, /* deactivate */ - - sapi_cli_ub_write, /* unbuffered write */ - sapi_cli_flush, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - sapi_cli_header_handler, /* header handler */ - sapi_cli_send_headers, /* send headers handler */ - sapi_cli_send_header, /* send header handler */ - - NULL, /* read POST data */ - sapi_cli_read_cookies, /* read Cookies */ - - sapi_cli_register_variables, /* register server variables */ - sapi_cli_log_message, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ php_cli_usage - */ -static void php_cli_usage(char *argv0) -{ - char *prog; - - prog = strrchr(argv0, '/'); - if (prog) { - prog++; - } else { - prog = "php"; - } - - php_printf( "Usage: %s [options] [-f] [--] [args...]\n" - " %s [options] -r [--] [args...]\n" - " %s [options] [-B ] -R [-E ] [--] [args...]\n" - " %s [options] [-B ] -F [-E ] [--] [args...]\n" - " %s [options] -- [args...]\n" - " %s [options] -a\n" - "\n" -#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) - " -a Run as interactive shell\n" -#else - " -a Run interactively\n" -#endif - " -c | Look for php.ini file in this directory\n" - " -n No php.ini file will be used\n" - " -d foo[=bar] Define INI entry foo with value 'bar'\n" - " -e Generate extended information for debugger/profiler\n" - " -f Parse and execute .\n" - " -h This help\n" - " -i PHP information\n" - " -l Syntax check only (lint)\n" - " -m Show compiled in modules\n" - " -r Run PHP without using script tags \n" - " -B Run PHP before processing input lines\n" - " -R Run PHP for every input line\n" - " -F Parse and execute for every input line\n" - " -E Run PHP after processing all input lines\n" - " -H Hide any passed arguments from external tools.\n" - " -s Display colour syntax highlighted source.\n" - " -v Version number\n" - " -w Display source with stripped comments and whitespace.\n" - " -z Load Zend extension .\n" - "\n" - " args... Arguments passed to script. Use -- args when first argument\n" - " starts with - or script is read from stdin\n" - "\n" - " --ini Show configuration file names\n" - "\n" -#if (HAVE_REFLECTION) - " --rf Show information about function .\n" - " --rc Show information about class .\n" - " --re Show information about extension .\n" -#endif - " --ri Show configuration for extension .\n" - "\n" - , prog, prog, prog, prog, prog, prog); -} -/* }}} */ - -static php_stream *s_in_process = NULL; - -static void cli_register_file_handles(TSRMLS_D) /* {{{ */ -{ - zval *zin, *zout, *zerr; - php_stream *s_in, *s_out, *s_err; - php_stream_context *sc_in=NULL, *sc_out=NULL, *sc_err=NULL; - zend_constant ic, oc, ec; - - MAKE_STD_ZVAL(zin); - MAKE_STD_ZVAL(zout); - MAKE_STD_ZVAL(zerr); - - s_in = php_stream_open_wrapper_ex("php://stdin", "rb", 0, NULL, sc_in); - s_out = php_stream_open_wrapper_ex("php://stdout", "wb", 0, NULL, sc_out); - s_err = php_stream_open_wrapper_ex("php://stderr", "wb", 0, NULL, sc_err); - - if (s_in==NULL || s_out==NULL || s_err==NULL) { - FREE_ZVAL(zin); - FREE_ZVAL(zout); - FREE_ZVAL(zerr); - if (s_in) php_stream_close(s_in); - if (s_out) php_stream_close(s_out); - if (s_err) php_stream_close(s_err); - return; - } - -#if PHP_DEBUG - /* do not close stdout and stderr */ - s_out->flags |= PHP_STREAM_FLAG_NO_CLOSE; - s_err->flags |= PHP_STREAM_FLAG_NO_CLOSE; -#endif - - s_in_process = s_in; - - php_stream_to_zval(s_in, zin); - php_stream_to_zval(s_out, zout); - php_stream_to_zval(s_err, zerr); - - ic.value = *zin; - ic.flags = CONST_CS; - ic.name = zend_strndup(ZEND_STRL("STDIN")); - ic.name_len = sizeof("STDIN"); - ic.module_number = 0; - zend_register_constant(&ic TSRMLS_CC); - - oc.value = *zout; - oc.flags = CONST_CS; - oc.name = zend_strndup(ZEND_STRL("STDOUT")); - oc.name_len = sizeof("STDOUT"); - oc.module_number = 0; - zend_register_constant(&oc TSRMLS_CC); - - ec.value = *zerr; - ec.flags = CONST_CS; - ec.name = zend_strndup(ZEND_STRL("STDERR")); - ec.name_len = sizeof("STDERR"); - ec.module_number = 0; - zend_register_constant(&ec TSRMLS_CC); - - FREE_ZVAL(zin); - FREE_ZVAL(zout); - FREE_ZVAL(zerr); -} -/* }}} */ - -static const char *param_mode_conflict = "Either execute direct code, process stdin or use a file.\n"; - -/* {{{ cli_seek_file_begin - */ -static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, int *lineno TSRMLS_DC) -{ - int c; - - *lineno = 1; - - if (!(file_handle->handle.fp = VCWD_FOPEN(script_file, "rb"))) { - php_printf("Could not open input file: %s\n", script_file); - return FAILURE; - } - file_handle->filename = script_file; - /* #!php support */ - c = fgetc(file_handle->handle.fp); - if (c == '#') { - while (c != '\n' && c != '\r' && c != EOF) { - c = fgetc(file_handle->handle.fp); /* skip to end of line */ - } - /* handle situations where line is terminated by \r\n */ - if (c == '\r') { - if (fgetc(file_handle->handle.fp) != '\n') { - long pos = ftell(file_handle->handle.fp); - fseek(file_handle->handle.fp, pos - 1, SEEK_SET); - } - } - *lineno = 2; - } else { - rewind(file_handle->handle.fp); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ main - */ -#ifdef PHP_CLI_WIN32_NO_CONSOLE -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) -#else -int main(int argc, char *argv[]) -#endif -{ - volatile int exit_status = SUCCESS; - int c; - zend_file_handle file_handle; -/* temporary locals */ - int behavior=PHP_MODE_STANDARD; - char *reflection_what = NULL; - int orig_optind=php_optind; - char *orig_optarg=php_optarg; - char *arg_free=NULL, **arg_excp=&arg_free; - char *script_file=NULL; - int interactive=0; - volatile int module_started = 0; - volatile int request_started = 0; - int lineno = 0; - char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL; - const char *param_error=NULL; - int hide_argv = 0; -/* end of temporary locals */ -#ifdef ZTS - void ***tsrm_ls; -#endif -#ifdef PHP_CLI_WIN32_NO_CONSOLE - int argc = __argc; - char **argv = __argv; -#endif - int ini_entries_len = 0; - -#if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP) - { - int tmp_flag; - - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); - - tmp_flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); - tmp_flag |= _CRTDBG_DELAY_FREE_MEM_DF; - tmp_flag |= _CRTDBG_LEAK_CHECK_DF; - - _CrtSetDbgFlag(tmp_flag); - } -#endif - -#ifdef HAVE_SIGNAL_H -#if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so - that sockets created via fsockopen() - don't kill PHP if the remote site - closes it. in apache|apxs mode apache - does that for us! thies@thieso.net - 20000419 */ -#endif -#endif - - -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); - tsrm_ls = ts_resource(0); -#endif - - cli_sapi_module.ini_defaults = sapi_cli_ini_defaults; - cli_sapi_module.php_ini_path_override = NULL; - cli_sapi_module.phpinfo_as_text = 1; - sapi_startup(&cli_sapi_module); - -#ifdef PHP_WIN32 - _fmode = _O_BINARY; /*sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ -#endif - - ini_entries_len = strlen(HARDCODED_INI); - cli_sapi_module.ini_entries = malloc(ini_entries_len+2); - memcpy(cli_sapi_module.ini_entries, HARDCODED_INI, ini_entries_len+1); - cli_sapi_module.ini_entries[ini_entries_len+1] = 0; - - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) { - switch (c) { - case 'c': - if (cli_sapi_module.php_ini_path_override) { - free(cli_sapi_module.php_ini_path_override); - } - cli_sapi_module.php_ini_path_override = strdup(php_optarg); - break; - case 'n': - cli_sapi_module.php_ini_ignore = 1; - break; - case 'd': { - /* define ini entries on command line */ - int len = strlen(php_optarg); - char *val; - - if ((val = strchr(php_optarg, '='))) { - val++; - if (!isalnum(*val) && *val != '"' && *val != '\'' && *val != '\0') { - cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("\"\"\n\0")); - memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, (val - php_optarg)); - ini_entries_len += (val - php_optarg); - memcpy(cli_sapi_module.ini_entries + ini_entries_len, "\"", 1); - ini_entries_len++; - memcpy(cli_sapi_module.ini_entries + ini_entries_len, val, len - (val - php_optarg)); - ini_entries_len += len - (val - php_optarg); - memcpy(cli_sapi_module.ini_entries + ini_entries_len, "\"\n\0", sizeof("\"\n\0")); - ini_entries_len += sizeof("\n\0\"") - 2; - } else { - cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("\n\0")); - memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, len); - memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "\n\0", sizeof("\n\0")); - ini_entries_len += len + sizeof("\n\0") - 2; - } - } else { - cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("=1\n\0")); - memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, len); - memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0")); - ini_entries_len += len + sizeof("=1\n\0") - 2; - } - break; - } - } - } - php_optind = orig_optind; - php_optarg = orig_optarg; - - cli_sapi_module.executable_location = argv[0]; - - /* startup after we get the above ini override se we get things right */ - if (cli_sapi_module.startup(&cli_sapi_module)==FAILURE) { - /* there is no way to see if we must call zend_ini_deactivate() - * since we cannot check if EG(ini_directives) has been initialised - * because the executor's constructor does not set initialize it. - * Apart from that there seems no need for zend_ini_deactivate() yet. - * So we goto out_err.*/ - exit_status = 1; - goto out_err; - } - module_started = 1; - - zend_first_try { - CG(in_compilation) = 0; /* not initialized but needed for several options */ - EG(uninitialized_zval_ptr) = NULL; - - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) { - switch (c) { - - case 'h': /* help & quit */ - case '?': - if (php_request_startup(TSRMLS_C)==FAILURE) { - goto err; - } - request_started = 1; - php_cli_usage(argv[0]); - php_end_ob_buffers(1 TSRMLS_CC); - exit_status=0; - goto out; - - case 'i': /* php info & quit */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - goto err; - } - request_started = 1; - php_print_info(0xFFFFFFFF TSRMLS_CC); - php_end_ob_buffers(1 TSRMLS_CC); - exit_status=0; - goto out; - - case 'm': /* list compiled in modules */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - goto err; - } - request_started = 1; - php_printf("[PHP Modules]\n"); - print_modules(TSRMLS_C); - php_printf("\n[Zend Modules]\n"); - print_extensions(TSRMLS_C); - php_printf("\n"); - php_end_ob_buffers(1 TSRMLS_CC); - exit_status=0; - goto out; - - case 'v': /* show php version & quit */ - if (php_request_startup(TSRMLS_C) == FAILURE) { - goto err; - } - - request_started = 1; - php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2008 The PHP Group\n%s", - PHP_VERSION, sapi_module.name, __DATE__, __TIME__, -#if ZEND_DEBUG && defined(HAVE_GCOV) - "(DEBUG GCOV)", -#elif ZEND_DEBUG - "(DEBUG)", -#elif defined(HAVE_GCOV) - "(GCOV)", -#else - "", -#endif - get_zend_version() - ); - php_end_ob_buffers(1 TSRMLS_CC); - exit_status=0; - goto out; - - default: - break; - } - } - - /* Set some CLI defaults */ - SG(options) |= SAPI_OPTION_NO_CHDIR; - - php_optind = orig_optind; - php_optarg = orig_optarg; - while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) { - switch (c) { - - case 'a': /* interactive mode */ - if (!interactive) { - if (behavior != PHP_MODE_STANDARD) { - param_error = param_mode_conflict; - break; - } - - interactive=1; - } - break; - - case 'C': /* don't chdir to the script directory */ - /* This is default so NOP */ - break; - - case 'e': /* enable extended info output */ - CG(extended_info) = 1; - break; - - case 'F': - if (behavior == PHP_MODE_PROCESS_STDIN) { - if (exec_run || script_file) { - param_error = "You can use -R or -F only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_PROCESS_STDIN; - script_file = php_optarg; - break; - - case 'f': /* parse file */ - if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { - param_error = param_mode_conflict; - break; - } else if (script_file) { - param_error = "You can use -f only once.\n"; - break; - } - script_file = php_optarg; - break; - - case 'l': /* syntax check mode */ - if (behavior != PHP_MODE_STANDARD) { - break; - } - behavior=PHP_MODE_LINT; - break; - -#if 0 /* not yet operational, see also below ... */ - case '': /* generate indented source mode*/ - if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { - param_error = "Source indenting only works for files.\n"; - break; - } - behavior=PHP_MODE_INDENT; - break; -#endif - - case 'q': /* do not generate HTTP headers */ - /* This is default so NOP */ - break; - - case 'r': /* run code from command line */ - if (behavior == PHP_MODE_CLI_DIRECT) { - if (exec_direct || script_file) { - param_error = "You can use -r only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD || interactive) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_CLI_DIRECT; - exec_direct=php_optarg; - break; - - case 'R': - if (behavior == PHP_MODE_PROCESS_STDIN) { - if (exec_run || script_file) { - param_error = "You can use -R or -F only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_PROCESS_STDIN; - exec_run=php_optarg; - break; - - case 'B': - if (behavior == PHP_MODE_PROCESS_STDIN) { - if (exec_begin) { - param_error = "You can use -B only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD || interactive) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_PROCESS_STDIN; - exec_begin=php_optarg; - break; - - case 'E': - if (behavior == PHP_MODE_PROCESS_STDIN) { - if (exec_end) { - param_error = "You can use -E only once.\n"; - break; - } - } else if (behavior != PHP_MODE_STANDARD || interactive) { - param_error = param_mode_conflict; - break; - } - behavior=PHP_MODE_PROCESS_STDIN; - exec_end=php_optarg; - break; - - case 's': /* generate highlighted HTML from source */ - if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { - param_error = "Source highlighting only works for files.\n"; - break; - } - behavior=PHP_MODE_HIGHLIGHT; - break; - - case 'w': - if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { - param_error = "Source stripping only works for files.\n"; - break; - } - behavior=PHP_MODE_STRIP; - break; - - case 'z': /* load extension file */ - zend_load_extension(php_optarg); - break; - case 'H': - hide_argv = 1; - break; - -#ifdef HAVE_REFLECTION - case 10: - behavior=PHP_MODE_REFLECTION_FUNCTION; - reflection_what = php_optarg; - break; - case 11: - behavior=PHP_MODE_REFLECTION_CLASS; - reflection_what = php_optarg; - break; - case 12: - behavior=PHP_MODE_REFLECTION_EXTENSION; - reflection_what = php_optarg; - break; -#endif - case 13: - behavior=PHP_MODE_REFLECTION_EXT_INFO; - reflection_what = php_optarg; - break; - case 14: - behavior = PHP_MODE_SHOW_INI_CONFIG; - break; - default: - break; - } - } - - if (param_error) { - PUTS(param_error); - exit_status=1; - goto err; - } - - if (interactive) { -#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) - printf("Interactive shell\n\n"); -#else - printf("Interactive mode enabled\n\n"); -#endif - fflush(stdout); - } - - CG(interactive) = interactive; - - /* only set script_file if not set already and not in direct mode and not at end of parameter list */ - if (argc > php_optind - && !script_file - && behavior!=PHP_MODE_CLI_DIRECT - && behavior!=PHP_MODE_PROCESS_STDIN - && strcmp(argv[php_optind-1],"--")) - { - script_file=argv[php_optind]; - php_optind++; - } - if (script_file) { - if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { - goto err; - } - script_filename = script_file; - } else { - /* We could handle PHP_MODE_PROCESS_STDIN in a different manner */ - /* here but this would make things only more complicated. And it */ - /* is consitent with the way -R works where the stdin file handle*/ - /* is also accessible. */ - file_handle.filename = "-"; - file_handle.handle.fp = stdin; - } - file_handle.type = ZEND_HANDLE_FP; - file_handle.opened_path = NULL; - file_handle.free_filename = 0; - php_self = file_handle.filename; - - /* before registering argv to module exchange the *new* argv[0] */ - /* we can achieve this without allocating more memory */ - SG(request_info).argc=argc-php_optind+1; - arg_excp = argv+php_optind-1; - arg_free = argv[php_optind-1]; - SG(request_info).path_translated = file_handle.filename; - argv[php_optind-1] = file_handle.filename; - SG(request_info).argv=argv+php_optind-1; - - if (php_request_startup(TSRMLS_C)==FAILURE) { - *arg_excp = arg_free; - fclose(file_handle.handle.fp); - PUTS("Could not startup.\n"); - goto err; - } - request_started = 1; - CG(start_lineno) = lineno; - *arg_excp = arg_free; /* reconstuct argv */ - - if (hide_argv) { - int i; - for (i = 1; i < argc; i++) { - memset(argv[i], 0, strlen(argv[i])); - } - } - - zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - - PG(during_request_startup) = 0; - switch (behavior) { - case PHP_MODE_STANDARD: - if (strcmp(file_handle.filename, "-")) { - cli_register_file_handles(TSRMLS_C); - } - -#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) - if (interactive) { - char *line; - size_t size = 4096, pos = 0, len; - char *code = emalloc(size); - char *prompt = "php > "; - char *history_file; - - if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) { - zend_file_handle *prepend_file_p; - zend_file_handle prepend_file = {0}; - - prepend_file.filename = PG(auto_prepend_file); - prepend_file.opened_path = NULL; - prepend_file.free_filename = 0; - prepend_file.type = ZEND_HANDLE_FILENAME; - prepend_file_p = &prepend_file; - - zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, prepend_file_p); - } - - history_file = tilde_expand("~/.php_history"); - rl_attempted_completion_function = cli_code_completion; - rl_special_prefixes = "$"; - read_history(history_file); - - EG(exit_status) = 0; - while ((line = readline(prompt)) != NULL) { - if (strcmp(line, "exit") == 0 || strcmp(line, "quit") == 0) { - free(line); - break; - } - - if (!pos && !*line) { - free(line); - continue; - } - - len = strlen(line); - if (pos + len + 2 > size) { - size = pos + len + 2; - code = erealloc(code, size); - } - memcpy(&code[pos], line, len); - pos += len; - code[pos] = '\n'; - code[++pos] = '\0'; - - if (*line) { - add_history(line); - } - - free(line); - - if (!cli_is_valid_code(code, pos, &prompt TSRMLS_CC)) { - continue; - } - - zend_eval_string(code, NULL, "php shell code" TSRMLS_CC); - pos = 0; - - if (php_last_char != '\0' && php_last_char != '\n') { - sapi_cli_single_write("\n", 1); - } - - if (EG(exception)) { - zend_exception_error(EG(exception) TSRMLS_CC); - } - - php_last_char = '\0'; - } - write_history(history_file); - free(history_file); - efree(code); - exit_status = EG(exit_status); - break; - } -#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */ - php_execute_script(&file_handle TSRMLS_CC); - exit_status = EG(exit_status); - break; - case PHP_MODE_LINT: - exit_status = php_lint_script(&file_handle TSRMLS_CC); - if (exit_status==SUCCESS) { - zend_printf("No syntax errors detected in %s\n", file_handle.filename); - } else { - zend_printf("Errors parsing %s\n", file_handle.filename); - } - break; - case PHP_MODE_STRIP: - if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { - zend_strip(TSRMLS_C); - } - goto out; - break; - case PHP_MODE_HIGHLIGHT: - { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { - php_get_highlight_struct(&syntax_highlighter_ini); - zend_highlight(&syntax_highlighter_ini TSRMLS_CC); - } - goto out; - } - break; -#if 0 - /* Zeev might want to do something with this one day */ - case PHP_MODE_INDENT: - open_file_for_scanning(&file_handle TSRMLS_CC); - zend_indent(); - fclose(file_handle.handle.fp); - goto out; - break; -#endif - case PHP_MODE_CLI_DIRECT: - cli_register_file_handles(TSRMLS_C); - if (zend_eval_string_ex(exec_direct, NULL, "Command line code", 1 TSRMLS_CC) == FAILURE) { - exit_status=254; - } - break; - - case PHP_MODE_PROCESS_STDIN: - { - char *input; - size_t len, index = 0; - zval *argn, *argi; - - cli_register_file_handles(TSRMLS_C); - - if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1 TSRMLS_CC) == FAILURE) { - exit_status=254; - } - ALLOC_ZVAL(argi); - Z_TYPE_P(argi) = IS_LONG; - Z_LVAL_P(argi) = index; - INIT_PZVAL(argi); - zend_hash_update(&EG(symbol_table), "argi", sizeof("argi"), &argi, sizeof(zval *), NULL); - while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { - len = strlen(input); - while (len-- && (input[len]=='\n' || input[len]=='\r')) { - input[len] = '\0'; - } - ALLOC_ZVAL(argn); - Z_TYPE_P(argn) = IS_STRING; - Z_STRLEN_P(argn) = ++len; - Z_STRVAL_P(argn) = estrndup(input, len); - INIT_PZVAL(argn); - zend_hash_update(&EG(symbol_table), "argn", sizeof("argn"), &argn, sizeof(zval *), NULL); - Z_LVAL_P(argi) = ++index; - if (exec_run) { - if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { - exit_status=254; - } - } else { - if (script_file) { - if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { - exit_status = 1; - } else { - CG(start_lineno) = lineno; - php_execute_script(&file_handle TSRMLS_CC); - exit_status = EG(exit_status); - } - } - } - efree(input); - } - if (exec_end && zend_eval_string_ex(exec_end, NULL, "Command line end code", 1 TSRMLS_CC) == FAILURE) { - exit_status=254; - } - - break; - } -#ifdef HAVE_REFLECTION - case PHP_MODE_REFLECTION_FUNCTION: - case PHP_MODE_REFLECTION_CLASS: - case PHP_MODE_REFLECTION_EXTENSION: - { - zend_class_entry *pce = NULL; - zval *arg, *ref; - zend_execute_data execute_data; - - switch (behavior) { - default: - break; - case PHP_MODE_REFLECTION_FUNCTION: - if (strstr(reflection_what, "::")) { - pce = reflection_method_ptr; - } else { - pce = reflection_function_ptr; - } - break; - case PHP_MODE_REFLECTION_CLASS: - pce = reflection_class_ptr; - break; - case PHP_MODE_REFLECTION_EXTENSION: - pce = reflection_extension_ptr; - break; - } - - MAKE_STD_ZVAL(arg); - ZVAL_STRING(arg, reflection_what, 1); - ALLOC_ZVAL(ref); - object_init_ex(ref, pce); - INIT_PZVAL(ref); - - memset(&execute_data, 0, sizeof(zend_execute_data)); - EG(current_execute_data) = &execute_data; - EX(function_state).function = pce->constructor; - zend_call_method_with_1_params(&ref, pce, &pce->constructor, "__construct", NULL, arg); - - if (EG(exception)) { - zval *msg = zend_read_property(zend_exception_get_default(TSRMLS_C), EG(exception), "message", sizeof("message")-1, 0 TSRMLS_CC); - zend_printf("Exception: %s\n", Z_STRVAL_P(msg)); - zval_ptr_dtor(&EG(exception)); - EG(exception) = NULL; - } else { - zend_call_method_with_1_params(NULL, reflection_ptr, NULL, "export", NULL, ref); - } - zval_ptr_dtor(&ref); - zval_ptr_dtor(&arg); - - break; - } -#endif /* reflection */ - case PHP_MODE_REFLECTION_EXT_INFO: - { - int len = strlen(reflection_what); - char *lcname = zend_str_tolower_dup(reflection_what, len); - zend_module_entry *module; - - if (zend_hash_find(&module_registry, lcname, len+1, (void**)&module) == FAILURE) { - if (!strcmp(reflection_what, "main")) { - display_ini_entries(NULL); - } else { - zend_printf("Extension '%s' not present.\n", reflection_what); - exit_status = 1; - } - } else { - php_info_print_module(module TSRMLS_CC); - } - - efree(lcname); - break; - } - case PHP_MODE_SHOW_INI_CONFIG: - { - zend_printf("Configuration File (php.ini) Path: %s\n", PHP_CONFIG_FILE_PATH); - zend_printf("Loaded Configuration File: %s\n", php_ini_opened_path ? php_ini_opened_path : "(none)"); - zend_printf("Scan for additional .ini files in: %s\n", *PHP_CONFIG_FILE_SCAN_DIR ? PHP_CONFIG_FILE_SCAN_DIR : "(none)"); - zend_printf("Additional .ini files parsed: %s\n", php_ini_scanned_files ? php_ini_scanned_files : "(none)"); - break; - } - } - - } zend_end_try(); - -out: - if (request_started) { - php_request_shutdown((void *) 0); - } - if (exit_status == 0) { - exit_status = EG(exit_status); - } -out_err: - if (cli_sapi_module.php_ini_path_override) { - free(cli_sapi_module.php_ini_path_override); - } - if (cli_sapi_module.ini_entries) { - free(cli_sapi_module.ini_entries); - } - - if (module_started) { - php_module_shutdown(TSRMLS_C); - } - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - - exit(exit_status); - -err: - sapi_deactivate(TSRMLS_C); - zend_ini_deactivate(TSRMLS_C); - exit_status = 1; - goto out_err; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/cli/php_cli_readline.c b/sapi/cli/php_cli_readline.c deleted file mode 100644 index f2fdf4fbf366f..0000000000000 --- a/sapi/cli/php_cli_readline.c +++ /dev/null @@ -1,446 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - | Johannes Schlueter | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) - -#ifndef HAVE_RL_COMPLETION_MATCHES -#define rl_completion_matches completion_matches -#endif - -#include "php_globals.h" -#include "php_variables.h" -#include "zend_hash.h" -#include "zend_modules.h" - -#include "SAPI.h" - -#if HAVE_SETLOCALE -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" - -#ifdef __riscos__ -#include -#endif - -#include -#if !HAVE_LIBEDIT -#include -#endif - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" - -typedef enum { - body, - sstring, - dstring, - sstring_esc, - dstring_esc, - comment_line, - comment_block, - heredoc_start, - heredoc, - outside, -} php_code_type; - -int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC) /* {{{ */ -{ - int valid_end = 1, last_valid_end; - int brackets_count = 0; - int brace_count = 0; - int i; - php_code_type code_type = body; - char *heredoc_tag; - int heredoc_len; - - for (i = 0; i < len; ++i) { - switch(code_type) { - default: - switch(code[i]) { - case '{': - brackets_count++; - valid_end = 0; - break; - case '}': - if (brackets_count > 0) { - brackets_count--; - } - valid_end = brackets_count ? 0 : 1; - break; - case '(': - brace_count++; - valid_end = 0; - break; - case ')': - if (brace_count > 0) { - brace_count--; - } - valid_end = 0; - break; - case ';': - valid_end = brace_count == 0 && brackets_count == 0; - break; - case ' ': - case '\r': - case '\n': - case '\t': - break; - case '\'': - code_type = sstring; - break; - case '"': - code_type = dstring; - break; - case '#': - code_type = comment_line; - break; - case '/': - if (code[i+1] == '/') { - i++; - code_type = comment_line; - break; - } - if (code[i+1] == '*') { - last_valid_end = valid_end; - valid_end = 0; - code_type = comment_block; - i++; - break; - } - valid_end = 0; - break; - case '%': - if (!CG(asp_tags)) { - valid_end = 0; - break; - } - /* no break */ - case '?': - if (code[i+1] == '>') { - i++; - code_type = outside; - break; - } - valid_end = 0; - break; - case '<': - valid_end = 0; - if (i + 2 < len && code[i+1] == '<' && code[i+2] == '<') { - i += 2; - code_type = heredoc_start; - heredoc_len = 0; - } - break; - default: - valid_end = 0; - break; - } - break; - case sstring: - if (code[i] == '\\') { - code_type = sstring_esc; - } else { - if (code[i] == '\'') { - code_type = body; - } - } - break; - case sstring_esc: - code_type = sstring; - break; - case dstring: - if (code[i] == '\\') { - code_type = dstring_esc; - } else { - if (code[i] == '"') { - code_type = body; - } - } - break; - case dstring_esc: - code_type = dstring; - break; - case comment_line: - if (code[i] == '\n') { - code_type = body; - } - break; - case comment_block: - if (code[i-1] == '*' && code[i] == '/') { - code_type = body; - valid_end = last_valid_end; - } - break; - case heredoc_start: - switch(code[i]) { - case ' ': - case '\t': - break; - case '\r': - case '\n': - code_type = heredoc; - break; - default: - if (!heredoc_len) { - heredoc_tag = code+i; - } - heredoc_len++; - break; - } - break; - case heredoc: - if (code[i - (heredoc_len + 1)] == '\n' && !strncmp(code + i - heredoc_len, heredoc_tag, heredoc_len) && code[i] == '\n') { - code_type = body; - } else if (code[i - (heredoc_len + 2)] == '\n' && !strncmp(code + i - heredoc_len - 1, heredoc_tag, heredoc_len) && code[i-1] == ';' && code[i] == '\n') { - code_type = body; - valid_end = 1; - } - break; - case outside: - if ((CG(short_tags) && !strncmp(code+i-1, " 3 && !strncmp(code+i-4, " "; - } - break; - case sstring: - case sstring_esc: - *prompt = "php ' "; - break; - case dstring: - case dstring_esc: - *prompt = "php \" "; - break; - case comment_block: - *prompt = "/* > "; - break; - case heredoc: - *prompt = "<<< > "; - break; - case outside: - *prompt = " > "; - break; - } - - if (!valid_end || brackets_count) { - return 0; - } else { - return 1; - } -} -/* }}} */ - -static char *cli_completion_generator_ht(const char *text, int textlen, int *state, HashTable *ht, void **pData TSRMLS_DC) /* {{{ */ -{ - char *name; - ulong number; - - if (!(*state % 2)) { - zend_hash_internal_pointer_reset(ht); - (*state)++; - } - while(zend_hash_has_more_elements(ht) == SUCCESS) { - zend_hash_get_current_key(ht, &name, &number, 0); - if (!textlen || !strncmp(name, text, textlen)) { - if (pData) { - zend_hash_get_current_data(ht, pData); - } - zend_hash_move_forward(ht); - return name; - } - if (zend_hash_move_forward(ht) == FAILURE) { - break; - } - } - (*state)++; - return NULL; -} /* }}} */ - -static char *cli_completion_generator_var(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */ -{ - char *retval, *tmp; - - tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, EG(active_symbol_table), NULL TSRMLS_CC); - if (retval) { - retval = malloc(strlen(tmp) + 2); - retval[0] = '$'; - strcpy(&retval[1], tmp); - rl_completion_append_character = '\0'; - } - return retval; -} /* }}} */ - -static char *cli_completion_generator_func(const char *text, int textlen, int *state, HashTable *ht TSRMLS_DC) /* {{{ */ -{ - zend_function *func; - char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&func TSRMLS_CC); - if (retval) { - rl_completion_append_character = '('; - retval = strdup(func->common.function_name); - } - - return retval; -} /* }}} */ - -static char *cli_completion_generator_class(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */ -{ - zend_class_entry **pce; - char *retval = cli_completion_generator_ht(text, textlen, state, EG(class_table), (void**)&pce TSRMLS_CC); - if (retval) { - rl_completion_append_character = '\0'; - retval = strdup((*pce)->name); - } - - return retval; -} /* }}} */ - -static char *cli_completion_generator_define(const char *text, int textlen, int *state, HashTable *ht TSRMLS_DC) /* {{{ */ -{ - zend_class_entry **pce; - char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&pce TSRMLS_CC); - if (retval) { - rl_completion_append_character = '\0'; - retval = strdup(retval); - } - - return retval; -} /* }}} */ - -static int cli_completion_state; - -static char *cli_completion_generator(const char *text, int index) /* {{{ */ -{ -/* -TODO: -- constants -- maybe array keys -- language constructs and other things outside a hashtable (echo, try, function, class, ...) -- object/class members - -- future: respect scope ("php > function foo() { $[tab]" should only expand to local variables...) -*/ - char *retval; - int textlen = strlen(text); - TSRMLS_FETCH(); - - if (!index) { - cli_completion_state = 0; - } - if (text[0] == '$') { - retval = cli_completion_generator_var(text, textlen, &cli_completion_state TSRMLS_CC); - } else { - char *lc_text, *class_name, *class_name_end; - int class_name_len; - zend_class_entry **pce = NULL; - - class_name_end = strstr(text, "::"); - if (class_name_end) { - class_name_len = class_name_end - text; - class_name = zend_str_tolower_dup(text, class_name_len); - class_name[class_name_len] = '\0'; /* not done automatically */ - if (zend_lookup_class(class_name, class_name_len, &pce TSRMLS_CC)==FAILURE) { - efree(class_name); - return NULL; - } - lc_text = zend_str_tolower_dup(class_name_end + 2, textlen - 2 - class_name_len); - textlen -= (class_name_len + 2); - } else { - lc_text = zend_str_tolower_dup(text, textlen); - } - - switch (cli_completion_state) { - case 0: - case 1: - retval = cli_completion_generator_func(lc_text, textlen, &cli_completion_state, pce ? &(*pce)->function_table : EG(function_table) TSRMLS_CC); - if (retval) { - break; - } - case 2: - case 3: - retval = cli_completion_generator_define(text, textlen, &cli_completion_state, pce ? &(*pce)->constants_table : EG(zend_constants) TSRMLS_CC); - if (retval || pce) { - break; - } - case 4: - case 5: - retval = cli_completion_generator_class(lc_text, textlen, &cli_completion_state TSRMLS_CC); - break; - default: - break; - } - efree(lc_text); - if (class_name_end) { - efree(class_name); - } - if (pce && retval) { - int len = class_name_len + 2 + strlen(retval) + 1; - char *tmp = malloc(len); - - snprintf(tmp, len, "%s::%s", (*pce)->name, retval); - free(retval); - retval = tmp; - } - } - - return retval; -} /* }}} */ - -char **cli_code_completion(const char *text, int start, int end) /* {{{ */ -{ - return rl_completion_matches(text, cli_completion_generator); -} -/* }}} */ - -#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/cli/php_cli_readline.h b/sapi/cli/php_cli_readline.h deleted file mode 100644 index 5c11257588f11..0000000000000 --- a/sapi/cli/php_cli_readline.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC); - -char **cli_code_completion(const char *text, int start, int end); diff --git a/sapi/cli/php_getopt.h b/sapi/cli/php_getopt.h deleted file mode 100644 index 3fc1ed0b92152..0000000000000 --- a/sapi/cli/php_getopt.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" - -#ifdef NETWARE -/* -As NetWare LibC has optind and optarg macros defined in unistd.h our local variables were getting mistakenly preprocessed so undeffing optind and optarg -*/ -#undef optarg -#undef optind -#endif -/* Define structure for one recognized option (both single char and long name). - * If short_open is '-' this is the last option. - */ -typedef struct _opt_struct { - const char opt_char; - const int need_param; - const char * opt_name; -} opt_struct; - -int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err); diff --git a/sapi/cli/tests/001.phpt b/sapi/cli/tests/001.phpt deleted file mode 100644 index 6fbd608a6fbf4..0000000000000 --- a/sapi/cli/tests/001.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -version string ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(%d) "PHP %s (cli) (built: %s)%s -Copyright (c) 1997-20%d The PHP Group -Zend Engine v%s, Copyright (c) 1998-20%d Zend Technologies -" -Done diff --git a/sapi/cli/tests/002-win32.phpt b/sapi/cli/tests/002-win32.phpt deleted file mode 100644 index ca0e66ddcd22c..0000000000000 --- a/sapi/cli/tests/002-win32.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -running code with -r ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(18) "string(5) "hello" -" -Done diff --git a/sapi/cli/tests/002.phpt b/sapi/cli/tests/002.phpt deleted file mode 100644 index be2b6331b31ce..0000000000000 --- a/sapi/cli/tests/002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -running code with -r ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(18) "string(5) "hello" -" -Done diff --git a/sapi/cli/tests/003-2.phpt b/sapi/cli/tests/003-2.phpt deleted file mode 100755 index 2ed9b07db4c4b..0000000000000 --- a/sapi/cli/tests/003-2.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -defining INI options with -d (as 2nd arg) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -string(16) "string(3) "111" -" -string(16) "string(3) "500" -" -===DONE=== diff --git a/sapi/cli/tests/003.phpt b/sapi/cli/tests/003.phpt deleted file mode 100644 index d62360e1f6fa3..0000000000000 --- a/sapi/cli/tests/003.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -defining INI options with -d ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(16) "string(3) "111" -" -string(16) "string(3) "500" -" -string(16) "string(3) "555" -" -string(40) "string(3) "555" -string(10) "/test/path" -" -Done diff --git a/sapi/cli/tests/004.phpt b/sapi/cli/tests/004.phpt deleted file mode 100644 index a1a01355d2e8a..0000000000000 --- a/sapi/cli/tests/004.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -show information about function ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(45) "Exception: Function unknown() does not exist -" -string(42) "Exception: Function echo() does not exist -" -string(119) "Function [ function phpinfo ] { - - - Parameters [1] { - Parameter #0 [ $what ] - } -} - -" -Done diff --git a/sapi/cli/tests/005.phpt b/sapi/cli/tests/005.phpt deleted file mode 100644 index 0b38bba765048..0000000000000 --- a/sapi/cli/tests/005.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -show information about class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(40) "Exception: Class unknown does not exist -" -string(178) "Class [ class stdClass ] { - - - Constants [0] { - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [0] { - } - - - Methods [0] { - } -} - -" -string(1141) "Class [ class Exception ] { - - - Constants [0] { - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [6] { - Property [ protected $message ] - Property [ private $string ] - Property [ protected $code ] - Property [ protected $file ] - Property [ protected $line ] - Property [ private $trace ] - } - - - Methods [9] { - Method [ final private method __clone ] { - } - - Method [ public method __construct ] { - - - Parameters [2] { - Parameter #0 [ $message ] - Parameter #1 [ $code ] - } - } - - Method [ final public method getMessage ] { - } - - Method [ final public method getCode ] { - } - - Method [ final public method getFile ] { - } - - Method [ final public method getLine ] { - } - - Method [ final public method getTrace ] { - } - - Method [ final public method getTraceAsString ] { - } - - Method [ public method __toString ] { - } - } -} - -" -Done diff --git a/sapi/cli/tests/006.phpt b/sapi/cli/tests/006.phpt deleted file mode 100644 index c553a83696573..0000000000000 --- a/sapi/cli/tests/006.phpt +++ /dev/null @@ -1,330 +0,0 @@ ---TEST-- -show information about extension ---SKIPIF-- - ---INI-- -date.timezone= ---FILE-- - ---EXPECTF-- -string(44) "Exception: Extension unknown does not exist -" -string(37) "Exception: Extension does not exist -" -string(%d) "Extension [ extension #%d date version %s ] { - - - Dependencies { - Dependency [ session (Optional) ] - } - - - INI { - Entry [ date.timezone ] - Current = '' - } - Entry [ date.default_latitude ] - Current = '%s' - } - Entry [ date.default_longitude ] - Current = '%s' - } - Entry [ date.sunset_zenith ] - Current = '%s' - } - Entry [ date.sunrise_zenith ] - Current = '%s' - } - } - - - Constants [14] { - Constant [ string DATE_ATOM ] { Y-m-d\TH:i:sP } - Constant [ string DATE_COOKIE ] { l, d-M-y H:i:s T } - Constant [ string DATE_ISO8601 ] { Y-m-d\TH:i:sO } - Constant [ string DATE_RFC822 ] { D, d M y H:i:s O } - Constant [ string DATE_RFC850 ] { l, d-M-y H:i:s T } - Constant [ string DATE_RFC1036 ] { D, d M y H:i:s O } - Constant [ string DATE_RFC1123 ] { D, d M Y H:i:s O } - Constant [ string DATE_RFC2822 ] { D, d M Y H:i:s O } - Constant [ string DATE_RFC3339 ] { Y-m-d\TH:i:sP } - Constant [ string DATE_RSS ] { D, d M Y H:i:s O } - Constant [ string DATE_W3C ] { Y-m-d\TH:i:sP } - Constant [ integer SUNFUNCS_RET_TIMESTAMP ] { 0 } - Constant [ integer SUNFUNCS_RET_STRING ] { 1 } - Constant [ integer SUNFUNCS_RET_DOUBLE ] { 2 } - } - - - Functions { - Function [ function strtotime ] { - - - Parameters [2] { - Parameter #0 [ $time ] - Parameter #1 [ $now ] - } - } - Function [ function date ] { - - - Parameters [2] { - Parameter #0 [ $format ] - Parameter #1 [ $timestamp ] - } - } - Function [ function idate ] { - - - Parameters [2] { - Parameter #0 [ $format ] - Parameter #1 [ $timestamp ] - } - } - Function [ function gmdate ] { - - - Parameters [2] { - Parameter #0 [ $format ] - Parameter #1 [ $timestamp ] - } - } - Function [ function mktime ] { - - - Parameters [6] { - Parameter #0 [ $hour ] - Parameter #1 [ $min ] - Parameter #2 [ $sec ] - Parameter #3 [ $mon ] - Parameter #4 [ $day ] - Parameter #5 [ $year ] - } - } - Function [ function gmmktime ] { - - - Parameters [6] { - Parameter #0 [ $hour ] - Parameter #1 [ $min ] - Parameter #2 [ $sec ] - Parameter #3 [ $mon ] - Parameter #4 [ $day ] - Parameter #5 [ $year ] - } - } - Function [ function checkdate ] { - - - Parameters [3] { - Parameter #0 [ $month ] - Parameter #1 [ $day ] - Parameter #2 [ $year ] - } - } - Function [ function strftime ] { - - - Parameters [2] { - Parameter #0 [ $format ] - Parameter #1 [ $timestamp ] - } - } - Function [ function gmstrftime ] { - - - Parameters [2] { - Parameter #0 [ $format ] - Parameter #1 [ $timestamp ] - } - } - Function [ function time ] { - - - Parameters [0] { - } - } - Function [ function localtime ] { - - - Parameters [2] { - Parameter #0 [ $timestamp ] - Parameter #1 [ $associative_array ] - } - } - Function [ function getdate ] { - - - Parameters [1] { - Parameter #0 [ $timestamp ] - } - } - Function [ function date_create ] { - } - Function [ function date_parse ] { - } - Function [ function date_format ] { - } - Function [ function date_modify ] { - } - Function [ function date_timezone_get ] { - } - Function [ function date_timezone_set ] { - } - Function [ function date_offset_get ] { - } - Function [ function date_time_set ] { - } - Function [ function date_date_set ] { - } - Function [ function date_isodate_set ] { - } - Function [ function timezone_open ] { - } - Function [ function timezone_name_get ] { - } - Function [ function timezone_name_from_abbr ] { - } - Function [ function timezone_offset_get ] { - } - Function [ function timezone_transitions_get ] { - } - Function [ function timezone_identifiers_list ] { - } - Function [ function timezone_abbreviations_list ] { - } - Function [ function date_default_timezone_set ] { - - - Parameters [1] { - Parameter #0 [ $timezone_identifier ] - } - } - Function [ function date_default_timezone_get ] { - - - Parameters [0] { - } - } - Function [ function date_sunrise ] { - - - Parameters [6] { - Parameter #0 [ $time ] - Parameter #1 [ $format ] - Parameter #2 [ $latitude ] - Parameter #3 [ $longitude ] - Parameter #4 [ $zenith ] - Parameter #5 [ $gmt_offset ] - } - } - Function [ function date_sunset ] { - - - Parameters [6] { - Parameter #0 [ $time ] - Parameter #1 [ $format ] - Parameter #2 [ $latitude ] - Parameter #3 [ $longitude ] - Parameter #4 [ $zenith ] - Parameter #5 [ $gmt_offset ] - } - } - Function [ function date_sun_info ] { - - - Parameters [3] { - Parameter #0 [ $time ] - Parameter #1 [ $latitude ] - Parameter #2 [ $longitude ] - } - } - } - - - Classes [2] { - Class [ class DateTime ] { - - - Constants [11] { - Constant [ string ATOM ] { Y-m-d\TH:i:sP } - Constant [ string COOKIE ] { l, d-M-y H:i:s T } - Constant [ string ISO8601 ] { Y-m-d\TH:i:sO } - Constant [ string RFC822 ] { D, d M y H:i:s O } - Constant [ string RFC850 ] { l, d-M-y H:i:s T } - Constant [ string RFC1036 ] { D, d M y H:i:s O } - Constant [ string RFC1123 ] { D, d M Y H:i:s O } - Constant [ string RFC2822 ] { D, d M Y H:i:s O } - Constant [ string RFC3339 ] { Y-m-d\TH:i:sP } - Constant [ string RSS ] { D, d M Y H:i:s O } - Constant [ string W3C ] { Y-m-d\TH:i:sP } - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [0] { - } - - - Methods [9] { - Method [ public method __construct ] { - } - - Method [ public method format ] { - } - - Method [ public method modify ] { - } - - Method [ public method getTimezone ] { - } - - Method [ public method setTimezone ] { - } - - Method [ public method getOffset ] { - } - - Method [ public method setTime ] { - } - - Method [ public method setDate ] { - } - - Method [ public method setISODate ] { - } - } - } - - Class [ class DateTimeZone ] { - - - Constants [0] { - } - - - Static properties [0] { - } - - - Static methods [2] { - Method [ static public method listAbbreviations ] { - } - - Method [ static public method listIdentifiers ] { - } - } - - - Properties [0] { - } - - - Methods [4] { - Method [ public method __construct ] { - } - - Method [ public method getName ] { - } - - Method [ public method getOffset ] { - } - - Method [ public method getTransitions ] { - } - } - } - } -} - -" -Done diff --git a/sapi/cli/tests/007.phpt b/sapi/cli/tests/007.phpt deleted file mode 100644 index 12fddee01df72..0000000000000 --- a/sapi/cli/tests/007.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -strip comments and whitespace with -w ---SKIPIF-- - ---FILE-- - -'; - -file_put_contents($filename, $code); - -var_dump(`$php -n -w "$filename"`); -var_dump(`$php -n -w "wrong"`); -var_dump(`echo "" | $php -n -w`); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -string(81) " - -" -Could not open input file: wrong -NULL -string(43) " -" -Done diff --git a/sapi/cli/tests/008.phpt b/sapi/cli/tests/008.phpt deleted file mode 100644 index a833043096d45..0000000000000 --- a/sapi/cli/tests/008.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -execute a file with -f ---SKIPIF-- - ---FILE-- - -'; - -file_put_contents($filename, $code); - -var_dump(`$php -n -f "$filename"`); -var_dump(`$php -n -f "wrong"`); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -string(%d) " - -Fatal error: Cannot access private property test::$pri in %s on line %d -" -Could not open input file: wrong -NULL -Done diff --git a/sapi/cli/tests/009.phpt b/sapi/cli/tests/009.phpt deleted file mode 100644 index a881a0730e946..0000000000000 --- a/sapi/cli/tests/009.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -using invalid combinations of cmdline options ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Either execute direct code, process stdin or use a file. -NULL -Either execute direct code, process stdin or use a file. -NULL -Done diff --git a/sapi/cli/tests/010-2.phpt b/sapi/cli/tests/010-2.phpt deleted file mode 100644 index bd33d2cc94331..0000000000000 --- a/sapi/cli/tests/010-2.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -executing a code with -R ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(21) "int(1) -int(1) -int(1) -" -Done diff --git a/sapi/cli/tests/010.phpt b/sapi/cli/tests/010.phpt deleted file mode 100644 index e465e37973fce..0000000000000 --- a/sapi/cli/tests/010.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -executing a file with -F ---SKIPIF-- - ---FILE-- - -'; - -file_put_contents($filename, $code); - -$txt = ' -test -hello -'; - -file_put_contents($filename_txt, $txt); - -var_dump(`cat "$filename_txt" | "$php" -n -F "$filename"`); - -@unlink($filename); -@unlink($filename_txt); - -echo "Done\n"; -?> ---EXPECTF-- -string(39) " -string(10) "test -hello" - -string(0) "" -" -Done diff --git a/sapi/cli/tests/011.phpt b/sapi/cli/tests/011.phpt deleted file mode 100644 index ef49666d3abda..0000000000000 --- a/sapi/cli/tests/011.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -syntax check ---SKIPIF-- - ---FILE-- - -'; - -file_put_contents($filename, $code); - -var_dump(`"$php" -n -l $filename`); -var_dump(`"$php" -n -l some.unknown`); - -$code = ' - -'; - -file_put_contents($filename, $code); - -var_dump(`"$php" -n -l $filename`); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -string(%d) "No syntax errors detected in %s011.test.php -" -Could not open input file: some.unknown -NULL -string(%d) " -Parse error: %s expecting %s{%s in %s on line %d -Errors parsing %s011.test.php -" -Done diff --git a/sapi/cli/tests/012.phpt b/sapi/cli/tests/012.phpt deleted file mode 100644 index 137e0bd781d1e..0000000000000 --- a/sapi/cli/tests/012.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -invalid arguments and error messages ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -You can use -R or -F only once. -NULL -You can use -R or -F only once. -NULL -You can use -R or -F only once. -NULL -You can use -R or -F only once. -NULL -You can use -f only once. -NULL -You can use -B only once. -NULL -You can use -E only once. -NULL -You can use -r only once. -NULL -Done diff --git a/sapi/cli/tests/013.phpt b/sapi/cli/tests/013.phpt deleted file mode 100644 index 99bfe5e7bb07f..0000000000000 --- a/sapi/cli/tests/013.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -running PHP code before and after processing input lines with -B and -E ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(18) "string(5) "start" -" -string(16) "string(3) "end" -" -string(34) "string(5) "start" -string(3) "end" -" -Done diff --git a/sapi/cli/tests/014.phpt b/sapi/cli/tests/014.phpt deleted file mode 100644 index b20478a03d9a5..0000000000000 --- a/sapi/cli/tests/014.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -syntax highlighting ---SKIPIF-- - ---FILE-- - -'; - -file_put_contents($filename, $code); - -var_dump(`"$php" -n -s $filename`); -var_dump(`"$php" -n -s unknown`); - -@unlink($filename); - -echo "Done\n"; -?> ---EXPECTF-- -string(1478) " -
<?php
$test 
"var"//var
/* test class */
class test {
    private 
$var = array();

    public static function 
foo(Test $arg) {
        echo 
"hello";
        
var_dump($this);
    }
}

$o = new test;
?>
-
-
" -Could not open input file: unknown -NULL -Done diff --git a/sapi/cli/tests/015.phpt b/sapi/cli/tests/015.phpt deleted file mode 100644 index ab5918b4d23c5..0000000000000 --- a/sapi/cli/tests/015.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -CLI long options ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -PHP %d.%d.%d%s(cli) (built: %s)%s -Array -( - [0] => - - [1] => foo - [2] => bar - [3] => baz -) - -PHP %d.%d.%d%s(cli) (built: %s)%s -Usage: %s [options] [-f] [--] [args...] -Done diff --git a/sapi/cli/tests/021.phpt b/sapi/cli/tests/021.phpt deleted file mode 100644 index b127b896929e9..0000000000000 --- a/sapi/cli/tests/021.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -CLI shell shebang ---SKIPIF-- - ---FILE-- -\n". - "adeus\n"; - -file_put_contents($filename, $script); -chmod($filename, 0777); - -echo `$filename`; - -echo "\nDone\n"; -?> ---CLEAN-- - ---EXPECTF-- -ola -2 -adeus - -Done diff --git a/sapi/cli/tests/022.inc b/sapi/cli/tests/022.inc deleted file mode 100644 index b77512fcf32df..0000000000000 --- a/sapi/cli/tests/022.inc +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/sapi/cli/tests/022.phpt b/sapi/cli/tests/022.phpt deleted file mode 100644 index eabb8bdf8d328..0000000000000 --- a/sapi/cli/tests/022.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -STDIN/OUT/ERR stream type ---SKIPIF-- - ---FILE-- - $socket, - 1 => STDOUT, - 2 => STDERR, -); -$pipes = array(); -$proc = proc_open("$php -n " . escapeshellarg($test_file), $desc, $pipes); -var_dump($proc); -if (!$proc) { - exit(1); -} - -$client_socket = stream_socket_client('unix://' . $socket_file); -var_dump($client_socket); -echo stream_get_contents($client_socket); -fclose($client_socket); - -proc_terminate($proc); -proc_close($proc); -unlink($socket_file); -?> ---EXPECTF-- -resource(%d) of type (stream) -resource(%d) of type (process) -resource(%d) of type (stream) -resource(%d) of type (stream) -resource(%d) of type (stream) diff --git a/sapi/cli/tests/bug44564.phpt b/sapi/cli/tests/bug44564.phpt deleted file mode 100644 index 7dca62a7e8e9f..0000000000000 --- a/sapi/cli/tests/bug44564.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #44564 (escapeshellarg removes UTF-8 multi-byte characters) ---SKIPIF-- - ---FILE-- -')); -var_dump(escapeshellarg('f~|;*Þ?')); -var_dump(escapeshellcmd('?€®đæ?')); -var_dump(escapeshellarg('aŊł€')); - -?> ---EXPECT-- -string(13) "f\{o\}\<€\>" -string(10) "'f~|;*Þ?'" -string(13) "\?€®đæ\?" -string(10) "'aŊł€'" diff --git a/sapi/cli/tests/skipif.inc b/sapi/cli/tests/skipif.inc deleted file mode 100644 index 79e6c91004c57..0000000000000 --- a/sapi/cli/tests/skipif.inc +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/sapi/continuity/CREDITS b/sapi/continuity/CREDITS deleted file mode 100644 index 35335e926682f..0000000000000 --- a/sapi/continuity/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Continuity -Alex Leigh (based on nsapi code) diff --git a/sapi/continuity/capi.c b/sapi/continuity/capi.c deleted file mode 100644 index d10ccd0f996cc..0000000000000 --- a/sapi/continuity/capi.c +++ /dev/null @@ -1,508 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Alex Leigh | - +----------------------------------------------------------------------+ -*/ - -/* For more information on Continuity: http://www.ashpool.com/ */ - -/* - * This code is based on the PHP5 SAPI module for NSAPI by Jayakumar - * Muthukumarasamy - */ - -/* PHP includes */ -#define CONTINUITY 1 -#define CAPI_DEBUG - -/* Define for CDP specific extensions */ -#undef CONTINUITY_CDPEXT - -#include "php.h" -#include "php_variables.h" -#include "ext/standard/info.h" -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_version.h" -#include "TSRM.h" -#include "ext/standard/php_standard.h" - -/* - * CAPI includes - */ -#include -#include - -#define NSLS_D struct capi_request_context *request_context -#define NSLS_DC , NSLS_D -#define NSLS_C request_context -#define NSLS_CC , NSLS_C -#define NSG(v) (request_context->v) - -/* - * ZTS needs to be defined for CAPI to work - */ -#if !defined(ZTS) -#error "CAPI module needs ZTS to be defined" -#endif - -/* - * Structure to encapsulate the CAPI request in SAPI - */ -typedef struct capi_request_context { - httpTtrans *t; - int read_post_bytes; -} capi_request_context; - -/**************/ - -PHP_MINIT_FUNCTION(continuity); -PHP_MSHUTDOWN_FUNCTION(continuity); -PHP_RINIT_FUNCTION(continuity); -PHP_RSHUTDOWN_FUNCTION(continuity); -PHP_MINFO_FUNCTION(continuity); - -PHP_FUNCTION(continuity_virtual); -PHP_FUNCTION(continuity_request_headers); -PHP_FUNCTION(continuity_response_headers); - -zend_function_entry continuity_functions[] = { - {NULL, NULL, NULL} -}; - -zend_module_entry continuity_module_entry = { - STANDARD_MODULE_HEADER, - "continuity", - continuity_functions, - PHP_MINIT(continuity), - PHP_MSHUTDOWN(continuity), - NULL, - NULL, - PHP_MINFO(continuity), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -PHP_MINIT_FUNCTION(continuity) -{ - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(continuity) -{ - return SUCCESS; -} - -PHP_MINFO_FUNCTION(continuity) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Continuity Module Revision", "$Revision$"); - php_info_print_table_row(2, "Server Version", conFget_build()); -#ifdef CONTINUITY_CDPEXT - php_info_print_table_row(2,"CDP Extensions", "enabled"); -#else - php_info_print_table_row(2,"CDP Extensions", "disabled"); -#endif - php_info_print_table_end(); - -/* DISPLAY_INI_ENTRIES(); */ -} - -/**************/ - -/* - * sapi_capi_ub_write: Write len bytes to the connection output. - */ -static int sapi_capi_ub_write(const char *str, unsigned int str_length TSRMLS_DC) -{ - int retval; - capi_request_context *rc; - - rc = (capi_request_context *) SG(server_context); - retval = httpFwrite(rc->t, (char *) str, str_length); - if (retval == -1 || retval == 0) - php_handle_aborted_connection(); - return retval; -} - -/* - * sapi_capi_header_handler: Add/update response headers with those provided - * by the PHP engine. - */ -static int sapi_capi_header_handler(sapi_header_struct * sapi_header, sapi_headers_struct * sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - capi_request_context *rc = (capi_request_context *) SG(server_context); - - lstFset_delete_key(rc->t->res_hdrs, "Content-Type"); - - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - if (p == NULL) { - return 0; - } - *p = 0; - do { - header_content++; - } while (*header_content == ' '); - - lstFset_add(rc->t->res_hdrs, header_name, header_content); - - *p = ':'; /* restore '*p' */ - - efree(sapi_header->header); - - return 0; /* don't use the default SAPI mechanism, CAPI - * duplicates this functionality */ -} - -/* - * sapi_capi_send_headers: Transmit the headers to the client. This has the - * effect of starting the response under Continuity. - */ -static int sapi_capi_send_headers(sapi_headers_struct * sapi_headers TSRMLS_DC) -{ - int retval; - capi_request_context *rc = (capi_request_context *) SG(server_context); - - /* - * We could probably just do this in the header_handler. But, I don't know - * what the implication of doing it there is. - */ - - if (SG(sapi_headers).send_default_content_type) { - /* lstFset_delete_key(rc->t->res_hdrs, "Content-Type"); */ - lstFset_update(rc->t->res_hdrs, "Content-Type", "text/html"); - } - httpFset_status(rc->t, SG(sapi_headers).http_response_code, NULL); - httpFstart_response(rc->t); - - return SAPI_HEADER_SENT_SUCCESSFULLY; - -} - -static int sapi_capi_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - unsigned int max_read, total_read = 0; - capi_request_context *rc = (capi_request_context *) SG(server_context); - - if (rc->read_post_bytes == -1) { - max_read = MIN(count_bytes, SG(request_info).content_length); - } else { - if (rc->read_post_bytes == 0) - return 0; - max_read = MIN(count_bytes, (SG(request_info).content_length - rc->read_post_bytes)); - } - - total_read = httpFread(rc->t, buffer, max_read); - - if (total_read < 0) - total_read = -1; - else - rc->read_post_bytes = total_read; - - return total_read; -} - -/* - * sapi_capi_read_cookies: Return cookie information into PHP. - */ -static char *sapi_capi_read_cookies(TSRMLS_D) -{ - char *cookie_string; - capi_request_context *rc = (capi_request_context *) SG(server_context); - - cookie_string = lstFset_get(rc->t->req_hdrs, "cookie"); - return cookie_string; -} - -static void sapi_capi_register_server_variables(zval * track_vars_array TSRMLS_DC) -{ - capi_request_context *rc = (capi_request_context *) SG(server_context); - size_t i; - char *value; - char buf[128]; - - /* PHP_SELF and REQUEST_URI */ - value = lstFset_get(rc->t->vars, "uri"); - if (value != NULL) { - php_register_variable("PHP_SELF", value, track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", value, track_vars_array TSRMLS_CC); - } - - /* COUNTRY CODE */ - value = lstFset_get(rc->t->vars, "ccode"); - if(value!=NULL) - php_register_variable("COUNTRY_CODE", value, track_vars_array TSRMLS_CC); - - /* argv */ - value = lstFset_get(rc->t->vars, "query"); - if (value != NULL) - php_register_variable("argv", value, track_vars_array TSRMLS_CC); - - /* GATEWAY_INTERFACE */ - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - - /* SERVER_NAME and HTTP_HOST */ - value = lstFset_get(rc->t->req_hdrs, "host"); - if (value != NULL) { - php_register_variable("HTTP_HOST", value, track_vars_array TSRMLS_CC); - /* TODO: This should probably scrub the port value if one is present. */ - php_register_variable("SERVER_NAME", value, track_vars_array TSRMLS_CC); - } - /* SERVER_SOFTWARE */ - value = lstFset_get(rc->t->res_hdrs, "Server"); - if (value != NULL) - php_register_variable("SERVER_SOFTWARE", value, track_vars_array TSRMLS_CC); - - /* SERVER_PROTOCOL */ - value = lstFset_get(rc->t->vars, "protocol"); - if (value != NULL) - php_register_variable("SERVER_PROTOCOL", value, track_vars_array TSRMLS_CC); - - /* REQUEST_METHOD */ - value = lstFset_get(rc->t->vars, "method"); - if (value != NULL) - php_register_variable("REQUEST_METHOD", value, track_vars_array TSRMLS_CC); - - /* QUERY_STRING */ - value = lstFset_get(rc->t->vars, "query"); - if (value != NULL) - php_register_variable("QUERY_STRING", value, track_vars_array TSRMLS_CC); - - /* DOCUMENT_ROOT */ - value = lstFset_get(rc->t->vars, "docroot"); - if (value != NULL) - php_register_variable("DOCUMENT_ROOT", value, track_vars_array TSRMLS_CC); - - /* HTTP_ACCEPT */ - value = lstFset_get(rc->t->req_hdrs, "accept"); - if (value != NULL) - php_register_variable("HTTP_ACCEPT", value, track_vars_array TSRMLS_CC); - - /* HTTP_ACCEPT_CHARSET */ - value = lstFset_get(rc->t->req_hdrs, "accept-charset"); - if (value != NULL) - php_register_variable("HTTP_ACCEPT_CHARSET", value, track_vars_array TSRMLS_CC); - - /* HTTP_ACCEPT_ENCODING */ - value = lstFset_get(rc->t->req_hdrs, "accept-encoding"); - if (value != NULL) - php_register_variable("HTTP_ACCEPT_ENCODING", value, track_vars_array TSRMLS_CC); - - /* HTTP_ACCEPT_LANGUAGE */ - value = lstFset_get(rc->t->req_hdrs, "accept-language"); - if (value != NULL) - php_register_variable("HTTP_ACCEPT_LANGUAGE", value, track_vars_array TSRMLS_CC); - - /* HTTP_CONNECTION */ - value = lstFset_get(rc->t->req_hdrs, "connection"); - if (value != NULL) - php_register_variable("HTTP_CONNECTION", value, track_vars_array TSRMLS_CC); - - /* HTTP_REFERER */ - value = lstFset_get(rc->t->req_hdrs, "referer"); - if (value != NULL) - php_register_variable("HTTP_REFERER", value, track_vars_array TSRMLS_CC); - - /* HTTP_USER_AGENT */ - value = lstFset_get(rc->t->req_hdrs, "user-agent"); - if (value != NULL) - php_register_variable("HTTP_USER_AGENT", value, track_vars_array TSRMLS_CC); - - /* REMOTE_ADDR */ - utlFip_to_str(rc->t->cli_ipv4_addr, buf, sizeof(buf)); - php_register_variable("REMOTE_ADDR", buf, track_vars_array TSRMLS_CC); - - /* REMOTE_PORT */ - - /* SCRIPT_FILENAME and PATH_TRANSLATED */ - value = lstFset_get(rc->t->vars, "path"); - if (value != NULL) { - php_register_variable("SCRIPT_FILENAME", value, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", value, track_vars_array TSRMLS_CC); - } - /* SERVER_ADMIN */ - /* Not applicable */ - - /* SERVER_PORT */ - -} - -static void capi_log_message(char *message) -{ - TSRMLS_FETCH(); - capi_request_context *rc = (capi_request_context *) SG(server_context); - logFmsg(0, "mod/php: %s", message); -} - -static int php_capi_startup(sapi_module_struct *sapi_module); - -sapi_module_struct capi_sapi_module = { - "Continuity", /* name */ - "Continuity Server Enterprise Edition", /* pretty name */ - - php_capi_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_capi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - sapi_capi_header_handler, /* header handler */ - sapi_capi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_capi_read_post, /* read POST data */ - sapi_capi_read_cookies, /* read Cookies */ - - sapi_capi_register_server_variables, /* register server variables */ - capi_log_message, /* Log message */ - NULL, /* Get request time */ - - NULL, /* Block interruptions */ - NULL, /* Unblock interruptions */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static int php_capi_startup(sapi_module_struct *sapi_module) { - if(php_module_startup(sapi_module,&continuity_module_entry,1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -static char * - capi_strdup(char *str) -{ - if (str != NULL) - return strFcopy(str); - return NULL; -} - -static void capi_free(void *addr) -{ - if (addr != NULL) - free(addr); -} - -static void capi_request_ctor(NSLS_D TSRMLS_DC) -{ - char *query_string = lstFset_get(NSG(t->vars), "query"); - char *uri = lstFset_get(NSG(t->vars), "uri"); - char *path_info = lstFset_get(NSG(t->vars), "path-info"); - char *path_translated = lstFset_get(NSG(t->vars), "path"); - char *request_method = lstFset_get(NSG(t->vars), "method"); - char *content_type = lstFset_get(NSG(t->req_hdrs), "content-type"); - char *content_length = lstFset_get(NSG(t->req_hdrs), "content-length"); - - SG(request_info).query_string = capi_strdup(query_string); - SG(request_info).request_uri = capi_strdup(uri); - SG(request_info).request_method = capi_strdup(request_method); - SG(request_info).path_translated = capi_strdup(path_translated); - SG(request_info).content_type = capi_strdup(content_type); - SG(request_info).content_length = (content_length == NULL) ? 0 : strtoul(content_length, 0, 0); - SG(sapi_headers).http_response_code = 200; -} - -static void capi_request_dtor(NSLS_D TSRMLS_DC) -{ - capi_free(SG(request_info).query_string); - capi_free(SG(request_info).request_uri); - capi_free(SG(request_info).request_method); - capi_free(SG(request_info).path_translated); - capi_free(SG(request_info).content_type); -} - -int capi_module_main(NSLS_D TSRMLS_DC) -{ - zend_file_handle file_handle; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return FAILURE; - } - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - - return SUCCESS; -} - -int phpFinit(lstTset * opt) -{ - php_core_globals *core_globals; - - tsrm_startup(128, 1, 0, NULL); - core_globals = ts_resource(core_globals_id); - - logFmsg(0, "mod/php: PHP Interface v3 (module)"); - logFmsg(0, "mod/php: Copyright (c) 1999-2005 The PHP Group. All rights reserved."); - - sapi_startup(&capi_sapi_module); - capi_sapi_module.startup(&capi_sapi_module); - - return STATUS_PROCEED; -} - -int phpFservice(httpTtrans * t, lstTset * opts) -{ - int retval; - capi_request_context *request_context; - - TSRMLS_FETCH(); - - request_context = (capi_request_context *) malloc(sizeof(capi_request_context)); - request_context->t = t; - request_context->read_post_bytes = -1; - - SG(server_context) = request_context; - - capi_request_ctor(NSLS_C TSRMLS_CC); - retval = capi_module_main(NSLS_C TSRMLS_CC); - capi_request_dtor(NSLS_C TSRMLS_CC); - - free(request_context); - - /* - * This call is ostensibly provided to free the memory from PHP/TSRM when - * the thread terminated, but, it leaks a structure in some hash list - * according to the developers. Not calling this will leak the entire - * interpreter, around 100k, but calling it and then terminating the - * thread will leak the struct (around a k). The only answer with the - * current TSRM implementation is to reuse the threads that allocate TSRM - * resources. - */ - /* ts_free_thread(); */ - - if (retval == SUCCESS) { - return STATUS_EXIT; - } else { - return STATUS_ERROR; - } -} diff --git a/sapi/continuity/config.m4 b/sapi/continuity/config.m4 deleted file mode 100644 index 8d2741921ae4a..0000000000000 --- a/sapi/continuity/config.m4 +++ /dev/null @@ -1,28 +0,0 @@ -dnl ## $Id$ -*- sh -*- - -PHP_ARG_WITH(continuity, for Continuity support, -[ --with-continuity=DIR Build PHP as Continuity Server module. - DIR is path to the installed Continuity Server root], no, no) - -if test "$PHP_CONTINUITY" != "no"; then - if test ! -d $PHP_CONTINUITY; then - AC_MSG_ERROR([Please specify the path to the root of your Continuity server using --with-continuity=DIR]) - fi - AC_MSG_CHECKING([for Continuity include files]) - if test -d $PHP_CONTINUITY/include ; then - CAPI_INCLUDE=$PHP_CONTINUITY/include - AC_MSG_RESULT([Continuity Binary Distribution]) - else - AC_MSG_ERROR([Cannot find your CAPI include files in either DIR/src or DIR/include]) - fi - - PHP_SELECT_SAPI(continuity, shared, capi.c) - PHP_ADD_INCLUDE($CAPI_INCLUDE) - PHP_BUILD_THREAD_SAFE - AC_DEFINE(HAVE_CONTINUITY, 1, [Whether you have a Continuity Server]) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_CONTINUITY/lib/" -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/embed/CREDITS b/sapi/embed/CREDITS deleted file mode 100644 index a5227b4ea9ce3..0000000000000 --- a/sapi/embed/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Embed -Edin Kadribasic diff --git a/sapi/embed/EXPERIMENTAL b/sapi/embed/EXPERIMENTAL deleted file mode 100644 index 293159a693dec..0000000000000 --- a/sapi/embed/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this module is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/sapi/embed/config.m4 b/sapi/embed/config.m4 deleted file mode 100644 index 3a61b458f03ab..0000000000000 --- a/sapi/embed/config.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(embed,, -[ --enable-embed[=TYPE] EXPERIMENTAL: Enable building of embedded SAPI library - TYPE is either 'shared' or 'static'. [TYPE=shared]], no, no) - -AC_MSG_CHECKING([for embedded SAPI library support]) - -if test "$PHP_EMBED" != "no"; then - case "$PHP_EMBED" in - yes|shared) - PHP_EMBED_TYPE=shared - INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib" - ;; - static) - PHP_EMBED_TYPE=static - INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(prefix)/lib" - ;; - *) - PHP_EMBED_TYPE=no - ;; - esac - if test "$PHP_EMBED_TYPE" != "no"; then - PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c) - PHP_INSTALL_HEADERS([sapi/embed/php_embed.h]) - fi - AC_MSG_RESULT([$PHP_EMBED_TYPE]) -else - AC_MSG_RESULT(no) -fi - diff --git a/sapi/embed/config.w32 b/sapi/embed/config.w32 deleted file mode 100644 index 8ea0781ed3c72..0000000000000 --- a/sapi/embed/config.w32 +++ /dev/null @@ -1,8 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('embed', 'Embedded SAPI library', 'no'); - -if (PHP_EMBED != "no") { - SAPI('embed', 'php_embed.c', 'php' + PHP_VERSION + 'embed.lib'); -} diff --git a/sapi/embed/php5embed.dsp b/sapi/embed/php5embed.dsp deleted file mode 100644 index 8564b11797783..0000000000000 --- a/sapi/embed/php5embed.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5embed" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=php5embed - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5embed.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5embed.mak" CFG="php5embed - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5embed - Win32 Debug_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "php5embed - Win32 Release_TS" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5embed - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /YX /FD /GZ /c -# ADD BASE RSC /l 0x406 /d "_DEBUG" -# ADD RSC /l 0x406 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\Debug_TS\php5embed.lib" - -!ELSEIF "$(CFG)" == "php5embed - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\Release_TS\php5embed.lib" - -!ENDIF - -# Begin Target - -# Name "php5embed - Win32 Debug_TS" -# Name "php5embed - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=php_embed.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=php_embed.h -# End Source File -# End Group -# End Target -# End Project diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c deleted file mode 100644 index ec9b012253772..0000000000000 --- a/sapi/embed/php_embed.c +++ /dev/null @@ -1,226 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Edin Kadribasic | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#include "php_embed.h" - -#ifdef PHP_WIN32 -#include -#include -#endif - -const char HARDCODED_INI[] = - "html_errors=0\n" - "register_argc_argv=1\n" - "implicit_flush=1\n" - "output_buffering=0\n" - "max_execution_time=0\n" - "max_input_time=-1\n\0"; - -static char* php_embed_read_cookies(TSRMLS_D) -{ - return NULL; -} - -static int php_embed_deactivate(TSRMLS_D) -{ - fflush(stdout); - return SUCCESS; -} - -static inline size_t php_embed_single_write(const char *str, uint str_length) -{ -#ifdef PHP_WRITE_STDOUT - long ret; - - ret = write(STDOUT_FILENO, str, str_length); - if (ret <= 0) return 0; - return ret; -#else - size_t ret; - - ret = fwrite(str, 1, MIN(str_length, 16384), stdout); - return ret; -#endif -} - - -static int php_embed_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - const char *ptr = str; - uint remaining = str_length; - size_t ret; - - while (remaining > 0) { - ret = php_embed_single_write(ptr, remaining); - if (!ret) { - php_handle_aborted_connection(); - } - ptr += ret; - remaining -= ret; - } - - return str_length; -} - -static void php_embed_flush(void *server_context) -{ - if (fflush(stdout)==EOF) { - php_handle_aborted_connection(); - } -} - -static void php_embed_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) -{ -} - -static void php_embed_log_message(char *message) -{ - fprintf (stderr, "%s\n", message); -} - -static void php_embed_register_variables(zval *track_vars_array TSRMLS_DC) -{ - php_import_environment_variables(track_vars_array TSRMLS_CC); -} - -static int php_embed_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, NULL, 0)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - -sapi_module_struct php_embed_module = { - "embed", /* name */ - "PHP Embedded Library", /* pretty name */ - - php_embed_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - php_embed_deactivate, /* deactivate */ - - php_embed_ub_write, /* unbuffered write */ - php_embed_flush, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - NULL, /* header handler */ - NULL, /* send headers handler */ - php_embed_send_header, /* send header handler */ - - NULL, /* read POST data */ - php_embed_read_cookies, /* read Cookies */ - - php_embed_register_variables, /* register server variables */ - php_embed_log_message, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; -/* }}} */ - -int php_embed_init(int argc, char **argv PTSRMLS_DC) -{ - zend_llist global_vars; -#ifdef ZTS - void ***tsrm_ls = NULL; -#endif - -#ifdef HAVE_SIGNAL_H -#if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so - that sockets created via fsockopen() - don't kill PHP if the remote site - closes it. in apache|apxs mode apache - does that for us! thies@thieso.net - 20000419 */ -#endif -#endif - -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); - tsrm_ls = ts_resource(0); - *ptsrm_ls = tsrm_ls; -#endif - - sapi_startup(&php_embed_module); - -#ifdef PHP_WIN32 - _fmode = _O_BINARY; /*sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ -#endif - - php_embed_module.ini_entries = malloc(sizeof(HARDCODED_INI)); - memcpy(php_embed_module.ini_entries, HARDCODED_INI, sizeof(HARDCODED_INI)); - - if (argv) { - php_embed_module.executable_location = argv[0]; - } - - if (php_embed_module.startup(&php_embed_module)==FAILURE) { - return FAILURE; - } - - zend_llist_init(&global_vars, sizeof(char *), NULL, 0); - - /* Set some Embedded PHP defaults */ - SG(options) |= SAPI_OPTION_NO_CHDIR; - SG(request_info).argc=argc; - SG(request_info).argv=argv; - - if (php_request_startup(TSRMLS_C)==FAILURE) { - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - php_register_variable("PHP_SELF", "-", NULL TSRMLS_CC); - - return SUCCESS; -} - -void php_embed_shutdown(TSRMLS_D) -{ - php_request_shutdown((void *) 0); - php_module_shutdown(TSRMLS_C); - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - if (php_embed_module.ini_entries) { - free(php_embed_module.ini_entries); - php_embed_module.ini_entries = NULL; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/embed/php_embed.h b/sapi/embed/php_embed.h deleted file mode 100644 index aa5633908d1cd..0000000000000 --- a/sapi/embed/php_embed.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Edin Kadribasic | - +----------------------------------------------------------------------+ -*/ -/* $Id$ */ - -#ifndef _PHP_EMBED_H_ -#define _PHP_EMBED_H_ - -#include
-#include
-#include
-#include
-#include
-#include - -#ifdef ZTS -#define PTSRMLS_D void ****ptsrm_ls -#define PTSRMLS_DC , PTSRMLS_D -#define PTSRMLS_C &tsrm_ls -#define PTSRMLS_CC , PTSRMLS_C - -#define PHP_EMBED_START_BLOCK(x,y) { \ - void ***tsrm_ls; \ - php_embed_init(x, y PTSRMLS_CC); \ - zend_first_try { - -#else -#define PTSRMLS_D -#define PTSRMLS_DC -#define PTSRMLS_C -#define PTSRMLS_CC - -#define PHP_EMBED_START_BLOCK(x,y) { \ - php_embed_init(x, y); \ - zend_first_try { - -#endif - -#define PHP_EMBED_END_BLOCK() \ - } zend_catch { \ - /* int exit_status = EG(exit_status); */ \ - } zend_end_try(); \ - php_embed_shutdown(TSRMLS_C); \ -} - -BEGIN_EXTERN_C() -int php_embed_init(int argc, char **argv PTSRMLS_DC); -void php_embed_shutdown(TSRMLS_D); -extern sapi_module_struct php_embed_module; -END_EXTERN_C() - - -#endif /* _PHP_EMBED_H_ */ diff --git a/sapi/isapi/CREDITS b/sapi/isapi/CREDITS deleted file mode 100644 index 11c6fdc73c599..0000000000000 --- a/sapi/isapi/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ISAPI -Andi Gutmans, Zeev Suraski diff --git a/sapi/isapi/config.m4 b/sapi/isapi/config.m4 deleted file mode 100644 index 7c7dcf0c21064..0000000000000 --- a/sapi/isapi/config.m4 +++ /dev/null @@ -1,24 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(isapi, for Zeus ISAPI support, -[ --with-isapi[=DIR] Build PHP as an ISAPI module for use with Zeus], no, no) - -if test "$PHP_ISAPI" != "no"; then - if test "$PHP_ISAPI" = "yes"; then - ZEUSPATH=/usr/local/zeus # the default - else - ZEUSPATH=$PHP_ISAPI - fi - test -f "$ZEUSPATH/web/include/httpext.h" || AC_MSG_ERROR(Unable to find httpext.h in $ZEUSPATH/web/include) - PHP_BUILD_THREAD_SAFE - AC_DEFINE(WITH_ZEUS, 1, [ ]) - PHP_ADD_INCLUDE($ZEUSPATH/web/include) - PHP_SELECT_SAPI(isapi, shared, php5isapi.c) - INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$ZEUSPATH/web/bin/" -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/isapi/config.w32 b/sapi/isapi/config.w32 deleted file mode 100644 index 13d0e016eb76c..0000000000000 --- a/sapi/isapi/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('isapi', 'Build ISAPI version of PHP', 'no'); - -if (PHP_ISAPI == "yes") { - if (PHP_ZTS == "no") { - ERROR("ISAPI module requires an --enable-zts build of PHP"); - } - - SAPI('isapi', 'php5isapi.c', 'php' + PHP_VERSION + 'isapi.dll', '/D PHP5ISAPI_EXPORTS'); - ADD_FLAG('LDFLAGS_ISAPI', '/DEF:sapi\\isapi\\php5isapi.def'); -} diff --git a/sapi/isapi/php.sym b/sapi/isapi/php.sym deleted file mode 100644 index 34b50b851cad0..0000000000000 --- a/sapi/isapi/php.sym +++ /dev/null @@ -1,5 +0,0 @@ -GetFilterVersion -HttpFilterProc -GetExtensionVersion -HttpExtensionProc -ZSLMain diff --git a/sapi/isapi/php5isapi.c b/sapi/isapi/php5isapi.c deleted file mode 100644 index 1f5325f7e9160..0000000000000 --- a/sapi/isapi/php5isapi.c +++ /dev/null @@ -1,972 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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: Zeev Suraski | - | Ben Mansell (Zeus Support) | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include "php.h" -#include -#include -#include -#include "php_main.h" -#include "SAPI.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "php_variables.h" -#include "php_ini.h" - -#ifdef PHP_WIN32 -# include -#else -# define __try -# define __except(val) -# define __declspec(foo) -#endif - - -#ifdef WITH_ZEUS -# include "httpext.h" -# include -# define GetLastError() errno -#endif - -#ifdef PHP_WIN32 -#define PHP_ENABLE_SEH -#endif - -/* -uncomment the following lines to turn off -exception trapping when running under a debugger - -#ifdef _DEBUG -#undef PHP_ENABLE_SEH -#endif -*/ - -#define MAX_STATUS_LENGTH sizeof("xxxx LONGEST POSSIBLE STATUS DESCRIPTION") -#define ISAPI_SERVER_VAR_BUF_SIZE 1024 -#define ISAPI_POST_DATA_BUF 1024 - -static zend_bool bFilterLoaded=0; -static zend_bool bTerminateThreadsOnError=0; - -static char *isapi_special_server_variable_names[] = { - "ALL_HTTP", - "HTTPS", -#ifndef WITH_ZEUS - "SCRIPT_NAME", -#endif - NULL -}; - -#define NUM_SPECIAL_VARS (sizeof(isapi_special_server_variable_names)/sizeof(char *)) -#define SPECIAL_VAR_ALL_HTTP 0 -#define SPECIAL_VAR_HTTPS 1 -#define SPECIAL_VAR_PHP_SELF 2 - -static char *isapi_server_variable_names[] = { - "AUTH_PASSWORD", - "AUTH_TYPE", - "AUTH_USER", - "CONTENT_LENGTH", - "CONTENT_TYPE", - "PATH_TRANSLATED", - "QUERY_STRING", - "REMOTE_ADDR", - "REMOTE_HOST", - "REMOTE_USER", - "REQUEST_METHOD", - "SERVER_NAME", - "SERVER_PORT", - "SERVER_PROTOCOL", - "SERVER_SOFTWARE", -#ifndef WITH_ZEUS - "APPL_MD_PATH", - "APPL_PHYSICAL_PATH", - "INSTANCE_ID", - "INSTANCE_META_PATH", - "LOGON_USER", - "REQUEST_URI", - "URL", -#else - "DOCUMENT_ROOT", -#endif - NULL -}; - - -static char *isapi_secure_server_variable_names[] = { - "CERT_COOKIE", - "CERT_FLAGS", - "CERT_ISSUER", - "CERT_KEYSIZE", - "CERT_SECRETKEYSIZE", - "CERT_SERIALNUMBER", - "CERT_SERVER_ISSUER", - "CERT_SERVER_SUBJECT", - "CERT_SUBJECT", - "HTTPS_KEYSIZE", - "HTTPS_SECRETKEYSIZE", - "HTTPS_SERVER_ISSUER", - "HTTPS_SERVER_SUBJECT", - "SERVER_PORT_SECURE", -#ifdef WITH_ZEUS - "SSL_CLIENT_CN", - "SSL_CLIENT_EMAIL", - "SSL_CLIENT_OU", - "SSL_CLIENT_O", - "SSL_CLIENT_L", - "SSL_CLIENT_ST", - "SSL_CLIENT_C", - "SSL_CLIENT_I_CN", - "SSL_CLIENT_I_EMAIL", - "SSL_CLIENT_I_OU", - "SSL_CLIENT_I_O", - "SSL_CLIENT_I_L", - "SSL_CLIENT_I_ST", - "SSL_CLIENT_I_C", -#endif - NULL -}; - - -static void php_info_isapi(ZEND_MODULE_INFO_FUNC_ARGS) -{ - char **p; - char variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len; - char **all_variables[] = { - isapi_server_variable_names, - isapi_special_server_variable_names, - isapi_secure_server_variable_names, - NULL - }; - char ***server_variable_names; - LPEXTENSION_CONTROL_BLOCK lpECB; - - lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - - php_info_print_table_start(); - php_info_print_table_header(2, "Server Variable", "Value"); - server_variable_names = all_variables; - while (*server_variable_names) { - p = *server_variable_names; - while (*p) { - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if (lpECB->GetServerVariable(lpECB->ConnID, *p, variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, *p, variable_buf); - } else if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - char *tmp_variable_buf; - - tmp_variable_buf = (char *) emalloc(variable_len); - if (lpECB->GetServerVariable(lpECB->ConnID, *p, tmp_variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, *p, tmp_variable_buf); - } - efree(tmp_variable_buf); - } - p++; - } - server_variable_names++; - } - php_info_print_table_end(); -} - - -static zend_module_entry php_isapi_module = { - STANDARD_MODULE_HEADER, - "ISAPI", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_isapi, - NULL, - STANDARD_MODULE_PROPERTIES -}; - - -static int sapi_isapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - DWORD num_bytes = str_length; - LPEXTENSION_CONTROL_BLOCK ecb; - - ecb = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - if (ecb->WriteClient(ecb->ConnID, (char *) str, &num_bytes, HSE_IO_SYNC) == FALSE) { - php_handle_aborted_connection(); - } - return num_bytes; -} - - -static int sapi_isapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - return SAPI_HEADER_ADD; -} - - - -static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC) -{ - *total_length += sapi_header->header_len+2; -} - - -static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC) -{ - memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len); - *combined_headers_ptr += sapi_header->header_len; - **combined_headers_ptr = '\r'; - (*combined_headers_ptr)++; - **combined_headers_ptr = '\n'; - (*combined_headers_ptr)++; -} - - -static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - uint total_length = 2; /* account for the trailing \r\n */ - char *combined_headers, *combined_headers_ptr; - LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - HSE_SEND_HEADER_EX_INFO header_info; - sapi_header_struct default_content_type; - char *status_buf = NULL; - - /* Obtain headers length */ - if (SG(sapi_headers).send_default_content_type) { - sapi_get_default_content_type_header(&default_content_type TSRMLS_CC); - accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC); - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC); - - /* Generate headers */ - combined_headers = (char *) emalloc(total_length+1); - combined_headers_ptr = combined_headers; - if (SG(sapi_headers).send_default_content_type) { - concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC); - sapi_free_header(&default_content_type); /* we no longer need it */ - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC); - *combined_headers_ptr++ = '\r'; - *combined_headers_ptr++ = '\n'; - *combined_headers_ptr = 0; - - switch (SG(sapi_headers).http_response_code) { - case 200: - header_info.pszStatus = "200 OK"; - break; - case 302: - header_info.pszStatus = "302 Moved Temporarily"; - break; - case 401: - header_info.pszStatus = "401 Authorization Required"; - break; - default: { - const char *sline = SG(sapi_headers).http_status_line; - int sline_len; - - /* httpd requires that r->status_line is set to the first digit of - * the status-code: */ - if (sline && ((sline_len = strlen(sline)) > 12) && strncmp(sline, "HTTP/1.", 7) == 0 && sline[8] == ' ') { - if ((sline_len - 9) > MAX_STATUS_LENGTH) { - status_buf = estrndup(sline + 9, MAX_STATUS_LENGTH); - } else { - status_buf = estrndup(sline + 9, sline_len - 9); - } - } else { - status_buf = emalloc(MAX_STATUS_LENGTH + 1); - snprintf(status_buf, MAX_STATUS_LENGTH, "%d Undescribed", SG(sapi_headers).http_response_code); - } - header_info.pszStatus = status_buf; - break; - } - } - header_info.cchStatus = strlen(header_info.pszStatus); - header_info.pszHeader = combined_headers; - header_info.cchHeader = total_length; - header_info.fKeepConn = FALSE; - lpECB->dwHttpStatusCode = SG(sapi_headers).http_response_code; - - lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); - - efree(combined_headers); - if (status_buf) { - efree(status_buf); - } - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - - -static int php_isapi_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_isapi_module, 1)==FAILURE) { - return FAILURE; - } else { - bTerminateThreadsOnError = (zend_bool) INI_INT("isapi.terminate_threads_on_error"); - return SUCCESS; - } -} - - -static int sapi_isapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - DWORD read_from_buf=0; - DWORD read_from_input=0; - DWORD total_read=0; - - if ((DWORD) SG(read_post_bytes) < lpECB->cbAvailable) { - read_from_buf = MIN(lpECB->cbAvailable-SG(read_post_bytes), count_bytes); - memcpy(buffer, lpECB->lpbData+SG(read_post_bytes), read_from_buf); - total_read += read_from_buf; - } - if (read_from_bufcbTotalBytes) { - DWORD cbRead=0, cbSize; - - read_from_input = MIN(count_bytes-read_from_buf, lpECB->cbTotalBytes-SG(read_post_bytes)-read_from_buf); - while (cbRead < read_from_input) { - cbSize = read_from_input - cbRead; - if (!lpECB->ReadClient(lpECB->ConnID, buffer+read_from_buf+cbRead, &cbSize) || cbSize==0) { - break; - } - cbRead += cbSize; - } - total_read += cbRead; - } - return total_read; -} - - -static char *sapi_isapi_read_cookies(TSRMLS_D) -{ - LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - char variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - - if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_COOKIE", variable_buf, &variable_len)) { - return estrndup(variable_buf, variable_len); - } else if (GetLastError()==ERROR_INSUFFICIENT_BUFFER) { - char *tmp_variable_buf = (char *) emalloc(variable_len+1); - - if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_COOKIE", tmp_variable_buf, &variable_len)) { - tmp_variable_buf[variable_len] = 0; - return tmp_variable_buf; - } else { - efree(tmp_variable_buf); - } - } - return STR_EMPTY_ALLOC(); -} - - -#ifdef WITH_ZEUS - -static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC) -{ - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - char static_cons_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - /* - * We need to construct the /C=.../ST=... - * DN's for SSL_CLIENT_DN and SSL_CLIENT_I_DN - */ - strcpy( static_cons_buf, "/C=" ); - if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_C", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { - strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE); - } - strlcat( static_cons_buf, "/ST=", ISAPI_SERVER_VAR_BUF_SIZE); - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { - strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE ); - } - php_register_variable( "SSL_CLIENT_DN", static_cons_buf, track_vars_array TSRMLS_CC ); - - strcpy( static_cons_buf, "/C=" ); - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_I_C", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { - strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE ); - } - strlcat( static_cons_buf, "/ST=", ISAPI_SERVER_VAR_BUF_SIZE); - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_I_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { - strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE ); - } - php_register_variable( "SSL_CLIENT_I_DN", static_cons_buf, track_vars_array TSRMLS_CC ); -} - -static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC) -{ - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - DWORD scriptname_len = ISAPI_SERVER_VAR_BUF_SIZE; - DWORD pathinfo_len = 0; - char *strtok_buf = NULL; - - /* Get SCRIPT_NAME, we use this to work out which bit of the URL - * belongs in PHP's version of PATH_INFO - */ - lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_NAME", static_variable_buf, &scriptname_len); - - /* Adjust Zeus' version of PATH_INFO, set PHP_SELF, - * and generate REQUEST_URI - */ - if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_INFO", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - - /* PHP_SELF is just PATH_INFO */ - php_register_variable( "PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC ); - - /* Chop off filename to get just the 'real' PATH_INFO' */ - pathinfo_len = variable_len - scriptname_len; - php_register_variable( "PATH_INFO", static_variable_buf + scriptname_len - 1, track_vars_array TSRMLS_CC ); - /* append query string to give url... extra byte for '?' */ - if ( strlen(lpECB->lpszQueryString) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE ) { - /* append query string only if it is present... */ - if ( strlen(lpECB->lpszQueryString) ) { - static_variable_buf[ variable_len - 1 ] = '?'; - strcpy( static_variable_buf + variable_len, lpECB->lpszQueryString ); - } - php_register_variable( "URL", static_variable_buf, track_vars_array TSRMLS_CC ); - php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array TSRMLS_CC ); - } - } - - /* Get and adjust PATH_TRANSLATED to what PHP wants */ - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_TRANSLATED", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - static_variable_buf[ variable_len - pathinfo_len - 1 ] = '\0'; - php_register_variable( "PATH_TRANSLATED", static_variable_buf, track_vars_array TSRMLS_CC ); - } - - /* Bring in the AUTHENTICATION stuff as needed */ - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_USER", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "PHP_AUTH_USER", static_variable_buf, track_vars_array TSRMLS_CC ); - } - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_PASSWORD", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "PHP_AUTH_PW", static_variable_buf, track_vars_array TSRMLS_CC ); - } - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_TYPE", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "AUTH_TYPE", static_variable_buf, track_vars_array TSRMLS_CC ); - } - - /* And now, for the SSL variables (if applicable) */ - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "CERT_COOKIE", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - sapi_isapi_register_zeus_ssl_variables( lpECB, track_vars_array TSRMLS_CC ); - } - /* Copy some of the variables we need to meet Apache specs */ - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "SERVER_SOFTWARE", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "SERVER_SIGNATURE", static_variable_buf, track_vars_array TSRMLS_CC ); - } -} -#else - -static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC) -{ - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - char path_info_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - DWORD scriptname_len = ISAPI_SERVER_VAR_BUF_SIZE; - DWORD pathinfo_len = 0; - HSE_URL_MAPEX_INFO humi; - - /* Get SCRIPT_NAME, we use this to work out which bit of the URL - * belongs in PHP's version of PATH_INFO. SCRIPT_NAME also becomes PHP_SELF. - */ - lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_NAME", static_variable_buf, &scriptname_len); - php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array TSRMLS_CC); - - /* Adjust IIS' version of PATH_INFO, set PHP_SELF, - * and generate REQUEST_URI - * Get and adjust PATH_TRANSLATED to what PHP wants - */ - if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_INFO", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - - /* Chop off filename to get just the 'real' PATH_INFO' */ - php_register_variable( "ORIG_PATH_INFO", static_variable_buf, track_vars_array TSRMLS_CC ); - pathinfo_len = variable_len - scriptname_len; - strncpy(path_info_buf, static_variable_buf + scriptname_len - 1, sizeof(path_info_buf)-1); - php_register_variable( "PATH_INFO", path_info_buf, track_vars_array TSRMLS_CC ); - /* append query string to give url... extra byte for '?' */ - if ( strlen(lpECB->lpszQueryString) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE ) { - /* append query string only if it is present... */ - if ( strlen(lpECB->lpszQueryString) ) { - static_variable_buf[ variable_len - 1 ] = '?'; - strcpy( static_variable_buf + variable_len, lpECB->lpszQueryString ); - } - php_register_variable( "URL", static_variable_buf, track_vars_array TSRMLS_CC ); - php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array TSRMLS_CC ); - } - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_TRANSLATED", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "ORIG_PATH_TRANSLATED", static_variable_buf, track_vars_array TSRMLS_CC ); - } - if (lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_MAP_URL_TO_PATH_EX, path_info_buf, &pathinfo_len, (LPDWORD) &humi)) { - /* Remove trailing \ */ - if (humi.lpszPath[variable_len-2] == '\\') { - humi.lpszPath[variable_len-2] = 0; - } - php_register_variable("PATH_TRANSLATED", humi.lpszPath, track_vars_array TSRMLS_CC); - } - } - - static_variable_buf[0] = '/'; - static_variable_buf[1] = 0; - variable_len = 2; - if (lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_MAP_URL_TO_PATH_EX, static_variable_buf, &variable_len, (LPDWORD) &humi)) { - /* Remove trailing \ */ - if (humi.lpszPath[variable_len-2] == '\\') { - humi.lpszPath[variable_len-2] = 0; - } - php_register_variable("DOCUMENT_ROOT", humi.lpszPath, track_vars_array TSRMLS_CC); - } - - if (!SG(request_info).auth_user || !SG(request_info).auth_password || - !SG(request_info).auth_user[0] || !SG(request_info).auth_password[0]) { - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_AUTHORIZATION", static_variable_buf, &variable_len) - && static_variable_buf[0]) { - php_handle_auth_data(static_variable_buf TSRMLS_CC); - } - } - - if (SG(request_info).auth_user) { - php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, track_vars_array TSRMLS_CC ); - } - if (SG(request_info).auth_password) { - php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, track_vars_array TSRMLS_CC ); - } -} -#endif - -static void sapi_isapi_register_server_variables2(char **server_variables, LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array, char **recorded_values TSRMLS_DC) -{ - char **p=server_variables; - DWORD variable_len; - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; - char *variable_buf; - - while (*p) { - variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - if (lpECB->GetServerVariable(lpECB->ConnID, *p, static_variable_buf, &variable_len) - && static_variable_buf[0]) { - php_register_variable(*p, static_variable_buf, track_vars_array TSRMLS_CC); - if (recorded_values) { - recorded_values[p-server_variables] = estrndup(static_variable_buf, variable_len); - } - } else if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - variable_buf = (char *) emalloc(variable_len+1); - if (lpECB->GetServerVariable(lpECB->ConnID, *p, variable_buf, &variable_len) - && variable_buf[0]) { - php_register_variable(*p, variable_buf, track_vars_array TSRMLS_CC); - } - if (recorded_values) { - recorded_values[p-server_variables] = variable_buf; - } else { - efree(variable_buf); - } - } else { /* for compatibility with Apache SAPIs */ - php_register_variable(*p, "", track_vars_array TSRMLS_CC); - } - p++; - } -} - - -static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_DC) -{ - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - char *variable; - char *strtok_buf = NULL; - char *isapi_special_server_variables[NUM_SPECIAL_VARS]; - LPEXTENSION_CONTROL_BLOCK lpECB; - - lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - - /* Register the special ISAPI variables */ - memset(isapi_special_server_variables, 0, sizeof(isapi_special_server_variables)); - sapi_isapi_register_server_variables2(isapi_special_server_variable_names, lpECB, track_vars_array, isapi_special_server_variables TSRMLS_CC); - if (SG(request_info).cookie_data) { - php_register_variable("HTTP_COOKIE", SG(request_info).cookie_data, track_vars_array TSRMLS_CC); - } - - /* Register the standard ISAPI variables */ - sapi_isapi_register_server_variables2(isapi_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC); - - if (isapi_special_server_variables[SPECIAL_VAR_HTTPS] - && (atoi(isapi_special_server_variables[SPECIAL_VAR_HTTPS]) - || !strcasecmp(isapi_special_server_variables[SPECIAL_VAR_HTTPS], "on")) - ) { - /* Register SSL ISAPI variables */ - sapi_isapi_register_server_variables2(isapi_secure_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC); - } - - if (isapi_special_server_variables[SPECIAL_VAR_HTTPS]) { - efree(isapi_special_server_variables[SPECIAL_VAR_HTTPS]); - } - - -#ifdef WITH_ZEUS - sapi_isapi_register_zeus_variables(lpECB, track_vars_array TSRMLS_CC); -#else - sapi_isapi_register_iis_variables(lpECB, track_vars_array TSRMLS_CC); -#endif - - /* PHP_SELF support */ - if (isapi_special_server_variables[SPECIAL_VAR_PHP_SELF]) { - php_register_variable("PHP_SELF", isapi_special_server_variables[SPECIAL_VAR_PHP_SELF], track_vars_array TSRMLS_CC); - efree(isapi_special_server_variables[SPECIAL_VAR_PHP_SELF]); - } - - if (isapi_special_server_variables[SPECIAL_VAR_ALL_HTTP]) { - /* Register the internal bits of ALL_HTTP */ - variable = php_strtok_r(isapi_special_server_variables[SPECIAL_VAR_ALL_HTTP], "\r\n", &strtok_buf); - while (variable) { - char *colon = strchr(variable, ':'); - - if (colon) { - char *value = colon+1; - - while (*value==' ') { - value++; - } - *colon = 0; - php_register_variable(variable, value, track_vars_array TSRMLS_CC); - *colon = ':'; - } - variable = php_strtok_r(NULL, "\r\n", &strtok_buf); - } - efree(isapi_special_server_variables[SPECIAL_VAR_ALL_HTTP]); - } -} - - -static sapi_module_struct isapi_sapi_module = { - "isapi", /* name */ - "ISAPI", /* pretty name */ - - php_isapi_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_isapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - sapi_isapi_header_handler, /* header handler */ - sapi_isapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_isapi_read_post, /* read POST data */ - sapi_isapi_read_cookies, /* read Cookies */ - - sapi_isapi_register_server_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - - -BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pFilterVersion) -{ - bFilterLoaded = 1; - pFilterVersion->dwFilterVersion = HTTP_FILTER_REVISION; - strcpy(pFilterVersion->lpszFilterDesc, isapi_sapi_module.pretty_name); - pFilterVersion->dwFlags= (SF_NOTIFY_AUTHENTICATION | SF_NOTIFY_PREPROC_HEADERS); - return TRUE; -} - - -DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificationType, LPVOID pvNotification) -{ - TSRMLS_FETCH(); - - switch (notificationType) { - case SF_NOTIFY_PREPROC_HEADERS: - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - SG(request_info).auth_digest = NULL; - break; - case SF_NOTIFY_AUTHENTICATION: { - char *auth_user = ((HTTP_FILTER_AUTHENT *) pvNotification)->pszUser; - char *auth_password = ((HTTP_FILTER_AUTHENT *) pvNotification)->pszPassword; - - if (auth_user && auth_user[0]) { - SG(request_info).auth_user = estrdup(auth_user); - } - if (auth_password && auth_password[0]) { - SG(request_info).auth_password = estrdup(auth_password); - } - return SF_STATUS_REQ_HANDLED_NOTIFICATION; - } - break; - } - return SF_STATUS_REQ_NEXT_NOTIFICATION; -} - - -static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB TSRMLS_DC) -{ - DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; - char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; -#ifndef WITH_ZEUS - HSE_URL_MAPEX_INFO humi; -#endif - - SG(request_info).request_method = lpECB->lpszMethod; - SG(request_info).query_string = lpECB->lpszQueryString; - SG(request_info).request_uri = lpECB->lpszPathInfo; - SG(request_info).content_type = lpECB->lpszContentType; - SG(request_info).content_length = lpECB->cbTotalBytes; - SG(sapi_headers).http_response_code = 200; /* I think dwHttpStatusCode is invalid at this stage -RL */ - if (!bFilterLoaded) { /* we don't have valid ISAPI Filter information */ - SG(request_info).auth_user = SG(request_info).auth_password = SG(request_info).auth_digest = NULL; - } - -#ifdef WITH_ZEUS - /* PATH_TRANSLATED can contain extra PATH_INFO stuff after the - * file being loaded, so we must use SCRIPT_FILENAME instead - */ - if(lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_FILENAME", static_variable_buf, &variable_len)) { - SG(request_info).path_translated = estrdup(static_variable_buf); - } else -#else - /* happily, IIS gives us SCRIPT_NAME which is correct (without PATH_INFO stuff) - so we can just map that to the physical path and we have our filename */ - - lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_NAME", static_variable_buf, &variable_len); - if (lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_MAP_URL_TO_PATH_EX, static_variable_buf, &variable_len, (LPDWORD) &humi)) { - SG(request_info).path_translated = estrdup(humi.lpszPath); - } else -#endif - /* if mapping fails, default to what the server tells us */ - SG(request_info).path_translated = estrdup(lpECB->lpszPathTranslated); - - /* some server configurations allow '..' to slip through in the - translated path. We'll just refuse to handle such a path. */ - if (strstr(SG(request_info).path_translated,"..")) { - SG(sapi_headers).http_response_code = 404; - efree(SG(request_info).path_translated); - SG(request_info).path_translated = NULL; - } -} - - -static void php_isapi_report_exception(char *message, int message_len TSRMLS_DC) -{ - if (!SG(headers_sent)) { - HSE_SEND_HEADER_EX_INFO header_info; - LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); - - header_info.pszStatus = "500 Internal Server Error"; - header_info.cchStatus = strlen(header_info.pszStatus); - header_info.pszHeader = "Content-Type: text/html\r\n\r\n"; - header_info.cchHeader = strlen(header_info.pszHeader); - - lpECB->dwHttpStatusCode = 500; - lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); - SG(headers_sent)=1; - } - sapi_isapi_ub_write(message, message_len TSRMLS_CC); -} - - -BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer) -{ - pVer->dwExtensionVersion = HSE_VERSION; -#ifdef WITH_ZEUS - strncpy( pVer->lpszExtensionDesc, isapi_sapi_module.name, HSE_MAX_EXT_DLL_NAME_LEN); -#else - lstrcpyn(pVer->lpszExtensionDesc, isapi_sapi_module.name, HSE_MAX_EXT_DLL_NAME_LEN); -#endif - return TRUE; -} - - -static void my_endthread() -{ -#ifdef PHP_WIN32 - if (bTerminateThreadsOnError) { - _endthread(); - } -#endif -} - -#ifdef PHP_WIN32 -/* ep is accessible only in the context of the __except expression, - * so we have to call this function to obtain it. - */ -BOOL exceptionhandler(LPEXCEPTION_POINTERS *e, LPEXCEPTION_POINTERS ep) -{ - *e=ep; - return TRUE; -} -#endif - -DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) -{ - zend_file_handle file_handle; - zend_bool stack_overflown=0; - int retval = FAILURE; -#ifdef PHP_ENABLE_SEH - LPEXCEPTION_POINTERS e; -#endif - TSRMLS_FETCH(); - - zend_first_try { -#ifdef PHP_ENABLE_SEH - __try { -#endif - init_request_info(lpECB TSRMLS_CC); - SG(server_context) = lpECB; - - php_request_startup(TSRMLS_C); - - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.opened_path = NULL; - - /* open the script here so we can 404 if it fails */ - if (file_handle.filename) - retval = php_fopen_primary_script(&file_handle TSRMLS_CC); - - if (!file_handle.filename || retval == FAILURE) { - SG(sapi_headers).http_response_code = 404; - PUTS("No input file specified.\n"); - } else { - php_execute_script(&file_handle TSRMLS_CC); - } - - if (SG(request_info).cookie_data) { - efree(SG(request_info).cookie_data); - } - if (SG(request_info).path_translated) - efree(SG(request_info).path_translated); -#ifdef PHP_ENABLE_SEH - } __except(exceptionhandler(&e, GetExceptionInformation())) { - char buf[1024]; - if (_exception_code()==EXCEPTION_STACK_OVERFLOW) { - LPBYTE lpPage; - static SYSTEM_INFO si; - static MEMORY_BASIC_INFORMATION mi; - static DWORD dwOldProtect; - - GetSystemInfo(&si); - - /* Get page ESP is pointing to */ - _asm mov lpPage, esp; - - /* Get stack allocation base */ - VirtualQuery(lpPage, &mi, sizeof(mi)); - - /* Go to the page below the current page */ - lpPage = (LPBYTE) (mi.BaseAddress) - si.dwPageSize; - - /* Free pages below current page */ - if (!VirtualFree(mi.AllocationBase, (LPBYTE)lpPage - (LPBYTE) mi.AllocationBase, MEM_DECOMMIT)) { - _endthread(); - } - - /* Restore the guard page */ - if (!VirtualProtect(lpPage, si.dwPageSize, PAGE_GUARD | PAGE_READWRITE, &dwOldProtect)) { - _endthread(); - } - - CG(unclean_shutdown)=1; - _snprintf(buf, sizeof(buf)-1,"PHP has encountered a Stack overflow"); - php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); - } else if (_exception_code()==EXCEPTION_ACCESS_VIOLATION) { - _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Access Violation at %p", e->ExceptionRecord->ExceptionAddress); - php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); - my_endthread(); - } else { - _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p", e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress); - php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); - my_endthread(); - } - } -#endif -#ifdef PHP_ENABLE_SEH - __try { - php_request_shutdown(NULL); - } __except(EXCEPTION_EXECUTE_HANDLER) { - my_endthread(); - } -#else - php_request_shutdown(NULL); -#endif - } zend_catch { - zend_try { - php_request_shutdown(NULL); - } zend_end_try(); - return HSE_STATUS_ERROR; - } zend_end_try(); - - return HSE_STATUS_SUCCESS; -} - - - -__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - switch (fdwReason) { - case DLL_PROCESS_ATTACH: -#ifdef WITH_ZEUS - tsrm_startup(128, 1, TSRM_ERROR_LEVEL_CORE, "TSRM.log"); -#else - tsrm_startup(128, 1, TSRM_ERROR_LEVEL_CORE, "C:\\TSRM.log"); -#endif - sapi_startup(&isapi_sapi_module); - if (isapi_sapi_module.startup) { - isapi_sapi_module.startup(&sapi_module); - } - break; - case DLL_THREAD_ATTACH: - break; - case DLL_THREAD_DETACH: - ts_free_thread(); - break; - case DLL_PROCESS_DETACH: - if (isapi_sapi_module.shutdown) { - isapi_sapi_module.shutdown(&sapi_module); - } - sapi_shutdown(); - tsrm_shutdown(); - break; - } - return TRUE; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/sapi/isapi/php5isapi.def b/sapi/isapi/php5isapi.def deleted file mode 100644 index 596023ef55489..0000000000000 --- a/sapi/isapi/php5isapi.def +++ /dev/null @@ -1,5 +0,0 @@ -EXPORTS -HttpFilterProc -GetFilterVersion -HttpExtensionProc -GetExtensionVersion diff --git a/sapi/isapi/php5isapi.dsp b/sapi/isapi/php5isapi.dsp deleted file mode 100644 index 3dbab11effe33..0000000000000 --- a/sapi/isapi/php5isapi.dsp +++ /dev/null @@ -1,165 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5isapi" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5isapi - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5isapi.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5isapi.mak" CFG="php5isapi - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5isapi - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5isapi - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5isapi - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5isapi - Win32 Release_TSDbg" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5isapi - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "_DEBUG" /D "COMPILE_LIBZEND" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ELSEIF "$(CFG)" == "php5isapi - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\Release_TS" - -!ELSEIF "$(CFG)" == "php5isapi - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5isapi___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5isapi___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /machine:I386 /libpath:"..\..\Release_TS" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5isapi - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5isapi___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "php5isapi___Win32_Release_TSDbg" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5ISAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /machine:I386 /libpath:"..\..\Release_TS" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /version:4.0 /dll /debug /machine:I386 /libpath:"..\..\Release_TSDbg" - -!ENDIF - -# Begin Target - -# Name "php5isapi - Win32 Debug_TS" -# Name "php5isapi - Win32 Release_TS" -# Name "php5isapi - Win32 Release_TS_inline" -# Name "php5isapi - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php5isapi.c -# End Source File -# Begin Source File - -SOURCE=.\php5isapi.def -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# End Target -# End Project diff --git a/sapi/isapi/stresstest/getopt.c b/sapi/isapi/stresstest/getopt.c deleted file mode 100644 index 57faa0f890c17..0000000000000 --- a/sapi/isapi/stresstest/getopt.c +++ /dev/null @@ -1,175 +0,0 @@ -/* Borrowed from Apache NT Port */ - -#include -#include -#include -#include -#include "getopt.h" -#define OPTERRCOLON (1) -#define OPTERRNF (2) -#define OPTERRARG (3) - - -char *ap_optarg; -int ap_optind = 1; -static int ap_opterr = 1; -static int ap_optopt; - -static int -ap_optiserr(int argc, char * const *argv, int oint, const char *optstr, - int optchr, int err) -{ - if (ap_opterr) - { - fprintf(stderr, "Error in argument %d, char %d: ", oint, optchr+1); - switch(err) - { - case OPTERRCOLON: - fprintf(stderr, ": in flags\n"); - break; - case OPTERRNF: - fprintf(stderr, "option not found %c\n", argv[oint][optchr]); - break; - case OPTERRARG: - fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]); - break; - default: - fprintf(stderr, "unknown\n"); - break; - } - } - ap_optopt = argv[oint][optchr]; - return('?'); -} - -int ap_getopt(int argc, char* const *argv, const char *optstr) -{ - static int optchr = 0; - static int dash = 0; /* have already seen the - */ - - char *cp; - - if (ap_optind >= argc) - return(EOF); - if (!dash && (argv[ap_optind][0] != '-')) - return(EOF); - if (!dash && (argv[ap_optind][0] == '-') && !argv[ap_optind][1]) - { - /* - * use to specify stdin. Need to let pgm process this and - * the following args - */ - return(EOF); - } - if ((argv[ap_optind][0] == '-') && (argv[ap_optind][1] == '-')) - { - /* -- indicates end of args */ - ap_optind++; - return(EOF); - } - if (!dash) - { - assert((argv[ap_optind][0] == '-') && argv[ap_optind][1]); - dash = 1; - optchr = 1; - } - - /* Check if the guy tries to do a -: kind of flag */ - assert(dash); - if (argv[ap_optind][optchr] == ':') - { - dash = 0; - ap_optind++; - return(ap_optiserr(argc, argv, ap_optind-1, optstr, optchr, OPTERRCOLON)); - } - if (!(cp = strchr(optstr, argv[ap_optind][optchr]))) - { - int errind = ap_optind; - int errchr = optchr; - - if (!argv[ap_optind][optchr+1]) - { - dash = 0; - ap_optind++; - } - else - optchr++; - return(ap_optiserr(argc, argv, errind, optstr, errchr, OPTERRNF)); - } - if (cp[1] == ':') - { - /* Check for cases where the value of the argument - is in the form - or in the form - */ - dash = 0; - if(!argv[ap_optind][2]) { - ap_optind++; - if (ap_optind == argc) - return(ap_optiserr(argc, argv, ap_optind-1, optstr, optchr, OPTERRARG)); - ap_optarg = argv[ap_optind++]; - } - else - { - ap_optarg = &argv[ap_optind][2]; - ap_optind++; - } - return(*cp); - } - else - { - if (!argv[ap_optind][optchr+1]) - { - dash = 0; - ap_optind++; - } - else - optchr++; - return(*cp); - } - assert(0); - return(0); -} - -#ifdef TESTGETOPT -int - main (int argc, char **argv) - { - int c; - extern char *ap_optarg; - extern int ap_optind; - int aflg = 0; - int bflg = 0; - int errflg = 0; - char *ofile = NULL; - - while ((c = ap_getopt(argc, argv, "abo:")) != EOF) - switch (c) { - case 'a': - if (bflg) - errflg++; - else - aflg++; - break; - case 'b': - if (aflg) - errflg++; - else - bflg++; - break; - case 'o': - ofile = ap_optarg; - (void)printf("ofile = %s\n", ofile); - break; - case '?': - errflg++; - } - if (errflg) { - (void)fprintf(stderr, - "usage: cmd [-a|-b] [-o ] files...\n"); - exit (2); - } - for ( ; ap_optind < argc; ap_optind++) - (void)printf("%s\n", argv[ap_optind]); - return 0; - } - -#endif /* TESTGETOPT */ diff --git a/sapi/isapi/stresstest/getopt.h b/sapi/isapi/stresstest/getopt.h deleted file mode 100644 index a3e278e3a60d8..0000000000000 --- a/sapi/isapi/stresstest/getopt.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Borrowed from Apache NT Port */ -#ifdef __cplusplus -extern "C" { -#endif -extern char *ap_optarg; -extern int ap_optind; - -int ap_getopt(int argc, char* const *argv, const char *optstr); - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/sapi/isapi/stresstest/notes.txt b/sapi/isapi/stresstest/notes.txt deleted file mode 100644 index f58ab3c0e9ba7..0000000000000 --- a/sapi/isapi/stresstest/notes.txt +++ /dev/null @@ -1,56 +0,0 @@ -This stress test program is for debugging threading issues with the ISAPI -module. - -2 ways to use it: - -1: test any php script file on multiple threads -2: run the php test scripts bundled with the source code - - - -GLOBAL SETTINGS -=============== - -If you need to set special environement variables, in addition to your -regular environment, create a file that contains them, one setting per line: - -MY_ENV_VAR=XXXXXXXX - -This can be used to simulate ISAPI environment variables if need be. - -By default, stress test uses 10 threads. To change this, change the define -NUM_THREADS in stresstest.cpp. - - - -1: Test any php script file on multiple threads -=============================================== - -Create a file that contains a list of php script files, one per line. If -you need to provide input, place the GET data, or Query String, after the -filename. File contents would look like: - -e:\inetpub\pages\index.php -e:\inetpub\pages\info.php -e:\inetpub\pages\test.php a=1&b=2 - -Run: stresstest L files.txt - - - -2: Run the php test scripts bundled with the source code -======================================================== - -supply the path to the parent of the "tests" directory (expect a couple -long pauses for a couple of the larger tests) - -Run: stresstest T c:\php5-source - - - -TODO: - -* Make more options configurable: number of threads, iterations, etc. -* Improve stdout output to make it more useful -* Implement support for SKIPIF -* Improve speed of CompareFile function (too slow on big files). diff --git a/sapi/isapi/stresstest/stresstest.cpp b/sapi/isapi/stresstest/stresstest.cpp deleted file mode 100644 index 97824e6be8c85..0000000000000 --- a/sapi/isapi/stresstest/stresstest.cpp +++ /dev/null @@ -1,936 +0,0 @@ -/* - * ======================================================================= * - * File: stress .c * - * stress tester for isapi dll's * - * based on cgiwrap * - * ======================================================================= * - * -*/ -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include -#include -#include -#include -#include "getopt.h" - -// These are things that go out in the Response Header -// -#define HTTP_VER "HTTP/1.0" -#define SERVER_VERSION "Http-Srv-Beta2/1.0" - -// -// Simple wrappers for the heap APIS -// -#define xmalloc(s) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (s)) -#define xfree(s) HeapFree(GetProcessHeap(), 0, (s)) - -// -// The mandatory exports from the ISAPI DLL -// -DWORD numThreads = 1; -DWORD iterations = 1; - -HANDLE StartNow; -// quick and dirty environment -typedef CMapStringToString TEnvironment; -TEnvironment IsapiEnvironment; - -typedef struct _TResults { - LONG ok; - LONG bad; -} TResults; - -CStringArray IsapiFileList; // list of filenames -CStringArray TestNames; // --TEST-- -CStringArray IsapiGetData; // --GET-- -CStringArray IsapiPostData; // --POST-- -CStringArray IsapiMatchData; // --EXPECT-- -CArray Results; - -typedef struct _TIsapiContext { - HANDLE in; - HANDLE out; - DWORD tid; - TEnvironment env; - HANDLE waitEvent; -} TIsapiContext; - -// -// Prototypes of the functions this sample implements -// -extern "C" { -HINSTANCE hDll; -typedef BOOL (WINAPI *VersionProc)(HSE_VERSION_INFO *) ; -typedef DWORD (WINAPI *HttpExtProc)(EXTENSION_CONTROL_BLOCK *); -typedef BOOL (WINAPI *TerminateProc) (DWORD); -BOOL WINAPI FillExtensionControlBlock(EXTENSION_CONTROL_BLOCK *, TIsapiContext *) ; -BOOL WINAPI GetServerVariable(HCONN, LPSTR, LPVOID, LPDWORD ); -BOOL WINAPI ReadClient(HCONN, LPVOID, LPDWORD); -BOOL WINAPI WriteClient(HCONN, LPVOID, LPDWORD, DWORD); -BOOL WINAPI ServerSupportFunction(HCONN, DWORD, LPVOID, LPDWORD, LPDWORD); -VersionProc IsapiGetExtensionVersion; -HttpExtProc IsapiHttpExtensionProc; -TerminateProc TerminateExtensionProc; -HSE_VERSION_INFO version_info; -} - -char * MakeDateStr(VOID); -char * GetEnv(char *); - - - - -DWORD CALLBACK IsapiThread(void *); -int stress_main(const char *filename, - const char *arg, - const char *postfile, - const char *matchdata); - - - -BOOL bUseTestFiles = FALSE; -char temppath[MAX_PATH]; - -void stripcrlf(char *line) -{ - DWORD l = strlen(line)-1; - if (line[l]==10 || line[l]==13) line[l]=0; - l = strlen(line)-1; - if (line[l]==10 || line[l]==13) line[l]=0; -} - -#define COMPARE_BUF_SIZE 1024 - -BOOL CompareFiles(const char*f1, const char*f2) -{ - FILE *fp1, *fp2; - bool retval; - char buf1[COMPARE_BUF_SIZE], buf2[COMPARE_BUF_SIZE]; - int length1, length2; - - if ((fp1=fopen(f1, "r"))==NULL) { - return FALSE; - } - - if ((fp2=fopen(f2, "r"))==NULL) { - fclose(fp1); - return FALSE; - } - - retval = TRUE; // success oriented - while (true) { - length1 = fread(buf1, 1, sizeof(buf1), fp1); - length2 = fread(buf2, 1, sizeof(buf2), fp2); - - // check for end of file - if (feof(fp1)) { - if (!feof(fp2)) { - retval = FALSE; - } - break; - } else if (feof(fp2)) { - if (!feof(fp1)) { - retval = FALSE; - } - break; - } - - // compare data - if (length1!=length2 - || memcmp(buf1, buf2, length1)!=0) { - retval = FALSE; - break; - } - } - fclose(fp1); - fclose(fp2); - - return retval; -} - - -BOOL CompareStringWithFile(const char *filename, const char *str, unsigned int str_length) -{ - FILE *fp; - bool retval; - char buf[COMPARE_BUF_SIZE]; - unsigned int offset=0, readbytes; - fprintf(stderr, "test %s\n",filename); - if ((fp=fopen(filename, "rb"))==NULL) { - fprintf(stderr, "Error opening %s\n",filename); - return FALSE; - } - - retval = TRUE; // success oriented - while (true) { - readbytes = fread(buf, 1, sizeof(buf), fp); - - // check for end of file - - if (offset+readbytes > str_length - || memcmp(buf, str+offset, readbytes)!=NULL) { - fprintf(stderr, "File missmatch %s\n",filename); - retval = FALSE; - break; - } - if (feof(fp)) { - if (!retval) fprintf(stderr, "File zero length %s\n",filename); - break; - } - } - fclose(fp); - - return retval; -} - - -BOOL ReadGlobalEnvironment(const char *environment) -{ - if (environment) { - FILE *fp = fopen(environment, "r"); - DWORD i=0; - if (fp) { - char line[2048]; - while (fgets(line, sizeof(line)-1, fp)) { - // file.php arg1 arg2 etc. - char *p = strchr(line, '='); - if (p) { - *p=0; - IsapiEnvironment[line]=p+1; - } - } - fclose(fp); - return IsapiEnvironment.GetCount() > 0; - } - } - return FALSE; -} - -BOOL ReadFileList(const char *filelist) -{ - FILE *fp = fopen(filelist, "r"); - if (!fp) { - printf("Unable to open %s\r\n", filelist); - } - char line[2048]; - int i=0; - while (fgets(line, sizeof(line)-1, fp)) { - // file.php arg1 arg2 etc. - stripcrlf(line); - if (strlen(line)>3) { - char *p = strchr(line, ' '); - if (p) { - *p = 0; - // get file - - IsapiFileList.Add(line); - IsapiGetData.Add(p+1); - } else { - // just a filename is all - IsapiFileList.Add(line); - IsapiGetData.Add(""); - } - } - - // future use - IsapiPostData.Add(""); - IsapiMatchData.Add(""); - TestNames.Add(""); - - i++; - } - Results.SetSize(TestNames.GetSize()); - - fclose(fp); - return IsapiFileList.GetSize() > 0; -} - -void DoThreads() { - - if (IsapiFileList.GetSize() == 0) { - printf("No Files to test\n"); - return; - } - - printf("Starting Threads...\n"); - // loop creating threads - DWORD tid; - HANDLE *threads = new HANDLE[numThreads]; - DWORD i; - for (i=0; i< numThreads; i++) { - threads[i]=CreateThread(NULL, 0, IsapiThread, NULL, CREATE_SUSPENDED, &tid); - } - for (i=0; i< numThreads; i++) { - if (threads[i]) ResumeThread(threads[i]); - } - // wait for threads to finish - WaitForMultipleObjects(numThreads, threads, TRUE, INFINITE); - for (i=0; i< numThreads; i++) { - CloseHandle(threads[i]); - } - delete [] threads; -} - -void DoFileList(const char *filelist, const char *environment) -{ - // read config files - - if (!ReadFileList(filelist)) { - printf("No Files to test!\r\n"); - return; - } - - ReadGlobalEnvironment(environment); - - DoThreads(); -} - - -/** - * ParseTestFile - * parse a single phpt file and add it to the arrays - */ -BOOL ParseTestFile(const char *path, const char *fn) -{ - // parse the test file - char filename[MAX_PATH]; - _snprintf(filename, sizeof(filename)-1, "%s\\%s", path, fn); - char line[1024]; - memset(line, 0, sizeof(line)); - CString cTest, cSkipIf, cPost, cGet, cFile, cExpect; - printf("Reading %s\r\n", filename); - - enum state {none, test, skipif, post, get, file, expect} parsestate = none; - - FILE *fp = fopen(filename, "rb"); - char *tn = _tempnam(temppath,"pht."); - char *en = _tempnam(temppath,"exp."); - FILE *ft = fopen(tn, "wb+"); - FILE *fe = fopen(en, "wb+"); - if (fp && ft && fe) { - while (fgets(line, sizeof(line)-1, fp)) { - if (line[0]=='-') { - if (_strnicmp(line, "--TEST--", 8)==0) { - parsestate = test; - continue; - } else if (_strnicmp(line, "--SKIPIF--", 10)==0) { - parsestate = skipif; - continue; - } else if (_strnicmp(line, "--POST--", 8)==0) { - parsestate = post; - continue; - } else if (_strnicmp(line, "--GET--", 7)==0) { - parsestate = get; - continue; - } else if (_strnicmp(line, "--FILE--", 8)==0) { - parsestate = file; - continue; - } else if (_strnicmp(line, "--EXPECT--", 10)==0) { - parsestate = expect; - continue; - } - } - switch (parsestate) { - case test: - stripcrlf(line); - cTest = line; - break; - case skipif: - cSkipIf += line; - break; - case post: - cPost += line; - break; - case get: - cGet += line; - break; - case file: - fputs(line, ft); - break; - case expect: - fputs(line, fe); - break; - } - } - - fclose(fp); - fclose(ft); - fclose(fe); - - if (!cTest.IsEmpty()) { - IsapiFileList.Add(tn); - TestNames.Add(cTest); - IsapiGetData.Add(cGet); - IsapiPostData.Add(cPost); - IsapiMatchData.Add(en); - free(tn); - free(en); - return TRUE; - } - } - free(tn); - free(en); - return FALSE; -} - - -/** - * GetTestFiles - * Recurse through the path and subdirectories, parse each phpt file - */ -BOOL GetTestFiles(const char *path) -{ - // find all files .phpt under testpath\tests - char FindPath[MAX_PATH]; - WIN32_FIND_DATA fd; - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - - _snprintf(FindPath, sizeof(FindPath)-1, "%s\\*.*", path); - HANDLE fh = FindFirstFile(FindPath, &fd); - if (fh != INVALID_HANDLE_VALUE) { - do { - if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && - !strchr(fd.cFileName, '.')) { - // subdirectory, recurse into it - char NewFindPath[MAX_PATH]; - _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s", path, fd.cFileName); - GetTestFiles(NewFindPath); - } else if (strstr(fd.cFileName, ".phpt")) { - // got test file, parse it now - if (ParseTestFile(path, fd.cFileName)) { - printf("Test File Added: %s\\%s\r\n", path, fd.cFileName); - } - } - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - } while (FindNextFile(fh, &fd) != 0); - FindClose(fh); - } - return IsapiFileList.GetSize() > 0; -} - -void DeleteTempFiles(const char *mask) -{ - char FindPath[MAX_PATH]; - WIN32_FIND_DATA fd; - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - - _snprintf(FindPath, sizeof(FindPath)-1, "%s\\%s", temppath, mask); - HANDLE fh = FindFirstFile(FindPath, &fd); - if (fh != INVALID_HANDLE_VALUE) { - do { - char NewFindPath[MAX_PATH]; - _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s", temppath, fd.cFileName); - DeleteFile(NewFindPath); - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); - } while (FindNextFile(fh, &fd) != 0); - FindClose(fh); - } -} - -void DoTestFiles(const char *filelist, const char *environment) -{ - if (!GetTestFiles(filelist)) { - printf("No Files to test!\r\n"); - return; - } - - Results.SetSize(IsapiFileList.GetSize()); - - ReadGlobalEnvironment(environment); - - DoThreads(); - - printf("\r\nRESULTS:\r\n"); - // show results: - DWORD r = Results.GetSize(); - for (DWORD i=0; i< r; i++) { - TResults result = Results.GetAt(i); - printf("%s\r\nOK: %d FAILED: %d\r\n", TestNames.GetAt(i), result.ok, result.bad); - } - - // delete temp files - printf("Deleting Temp Files\r\n"); - DeleteTempFiles("exp.*"); - DeleteTempFiles("pht.*"); - printf("Done\r\n"); -} - -#define OPTSTRING "m:f:d:h:t:i:" -static void _usage(char *argv0) -{ - char *prog; - - prog = strrchr(argv0, '/'); - if (prog) { - prog++; - } else { - prog = "stresstest"; - } - - printf("Usage: %s -m -d|-l [-t ] [-i ]\n" - " -m path to isapi dll\n" - " -d php directory (to run php test files).\n" - " -f file containing list of files to run\n" - " -t number of threads to use (default=1)\n" - " -i number of iterations per thread (default=1)\n" - " -h This help\n", prog); -} -int main(int argc, char* argv[]) -{ - LPVOID lpMsgBuf; - char *filelist=NULL, *environment=NULL, *module=NULL; - int c = NULL; - while ((c=ap_getopt(argc, argv, OPTSTRING))!=-1) { - switch (c) { - case 'd': - bUseTestFiles = TRUE; - filelist = strdup(ap_optarg); - break; - case 'f': - bUseTestFiles = FALSE; - filelist = strdup(ap_optarg); - break; - case 'e': - environment = strdup(ap_optarg); - break; - case 't': - numThreads = atoi(ap_optarg); - break; - case 'i': - iterations = atoi(ap_optarg); - break; - case 'm': - module = strdup(ap_optarg); - break; - case 'h': - _usage(argv[0]); - exit(0); - break; - } - } - if (!module || !filelist) { - _usage(argv[0]); - exit(0); - } - - GetTempPath(sizeof(temppath), temppath); - hDll = LoadLibrary(module); // Load our DLL - - if (!hDll) { - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - fprintf(stderr,"Error: Dll 'php5isapi.dll' not found -%d\n%s\n", GetLastError(), lpMsgBuf); - free (module); - free(filelist); - LocalFree( lpMsgBuf ); - return -1; - } - - // - // Find the exported functions - - IsapiGetExtensionVersion = (VersionProc)GetProcAddress(hDll,"GetExtensionVersion"); - if (!IsapiGetExtensionVersion) { - fprintf(stderr,"Can't Get Extension Version %d\n", GetLastError()); - free (module); - free(filelist); - return -1; - } - IsapiHttpExtensionProc = (HttpExtProc)GetProcAddress(hDll,"HttpExtensionProc"); - if (!IsapiHttpExtensionProc) { - fprintf(stderr,"Can't Get Extension proc %d\n", GetLastError()); - free (module); - free(filelist); - return -1; - } - TerminateExtensionProc = (TerminateProc) GetProcAddress(hDll, - "TerminateExtension"); - - // This should really check if the version information matches what we - // expect. - // - if (!IsapiGetExtensionVersion(&version_info) ) { - fprintf(stderr,"Fatal: GetExtensionVersion failed\n"); - free (module); - free(filelist); - return -1; - } - - if (bUseTestFiles) { - char TestPath[MAX_PATH]; - if (filelist != NULL) - _snprintf(TestPath, sizeof(TestPath)-1, "%s\\tests", filelist); - else strcpy(TestPath, "tests"); - DoTestFiles(TestPath, environment); - } else { - DoFileList(filelist, environment); - } - - // cleanup - if (TerminateExtensionProc) TerminateExtensionProc(0); - - // We should really free memory (e.g., from GetEnv), but we'll be dead - // soon enough - - FreeLibrary(hDll); - free (module); - free(filelist); - return 0; -} - - -DWORD CALLBACK IsapiThread(void *p) -{ - DWORD filecount = IsapiFileList.GetSize(); - - for (DWORD j=0; jenv.Lookup(lpszVariableName, value)) { - rc = value.GetLength(); - strncpy((char *)lpBuffer, value, *lpdwSize-1); - } else - rc = GetEnvironmentVariable(lpszVariableName, (char *)lpBuffer, *lpdwSize) ; - - if (!rc) { // return of 0 indicates the variable was not found - SetLastError(ERROR_NO_DATA); - return FALSE; - } - - if (rc > *lpdwSize) { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } - - *lpdwSize =rc + 1 ; // GetEnvironmentVariable does not count the NULL - - return TRUE; - -} -// -// Again, we don't have an HCONN, so we simply wrap ReadClient() to -// ReadFile on stdin. The semantics of the two functions are the same -// -BOOL WINAPI ReadClient(HCONN hConn, LPVOID lpBuffer, LPDWORD lpdwSize) { - TIsapiContext *c = (TIsapiContext *)hConn; - if (!c) return FALSE; - - if (c->in != INVALID_HANDLE_VALUE) - return ReadFile(c->in, lpBuffer, (*lpdwSize), lpdwSize, NULL); - - return FALSE; -} -// -// ditto for WriteClient() -// -BOOL WINAPI WriteClient(HCONN hConn, LPVOID lpBuffer, LPDWORD lpdwSize, - DWORD dwReserved) { - TIsapiContext *c = (TIsapiContext *)hConn; - if (!c) return FALSE; - - if (c->out != INVALID_HANDLE_VALUE) - return WriteFile(c->out, lpBuffer, *lpdwSize, lpdwSize, NULL); - return FALSE; -} -// -// This is a special callback function used by the DLL for certain extra -// functionality. Look at the API help for details. -// -BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest, - LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType){ - - TIsapiContext *c = (TIsapiContext *)hConn; - char *lpszRespBuf; - char * temp = NULL; - DWORD dwBytes; - BOOL bRet = TRUE; - - switch(dwHSERequest) { - case (HSE_REQ_SEND_RESPONSE_HEADER) : - lpszRespBuf = (char *)xmalloc(*lpdwSize);//+ 80);//accomodate our header - if (!lpszRespBuf) - return FALSE; - wsprintf(lpszRespBuf,"%s", - //HTTP_VER, - - /* Default response is 200 Ok */ - - //lpvBuffer?lpvBuffer:"200 Ok", - - /* Create a string for the time. */ - //temp=MakeDateStr(), - - //SERVER_VERSION, - - /* If this exists, it is a pointer to a data buffer to - be sent. */ - lpdwDataType?(char *)lpdwDataType:NULL); - - if (temp) xfree(temp); - - dwBytes = strlen(lpszRespBuf); - bRet = WriteClient(0, lpszRespBuf, &dwBytes, 0); - xfree(lpszRespBuf); - - break; - // - // A real server would do cleanup here - case (HSE_REQ_DONE_WITH_SESSION): - SetEvent(c->waitEvent); - //ExitThread(0); - break; - - // - // This sends a redirect (temporary) to the client. - // The header construction is similar to RESPONSE_HEADER above. - // - case (HSE_REQ_SEND_URL_REDIRECT_RESP): - lpszRespBuf = (char *)xmalloc(*lpdwSize +80) ; - if (!lpszRespBuf) - return FALSE; - wsprintf(lpszRespBuf,"%s %s %s\r\n", - HTTP_VER, - "302 Moved Temporarily", - (lpdwSize > 0)?lpvBuffer:0); - xfree(temp); - dwBytes = strlen(lpszRespBuf); - bRet = WriteClient(0, lpszRespBuf, &dwBytes, 0); - xfree(lpszRespBuf); - break; - default: - return FALSE; - break; - } - return bRet; - -} -// -// Makes a string of the date and time from GetSystemTime(). -// This is in UTC, as required by the HTTP spec.` -// -char * MakeDateStr(void){ - SYSTEMTIME systime; - char *szDate= (char *)xmalloc(64); - - char * DaysofWeek[] = {"Sun","Mon","Tue","Wed","Thurs","Fri","Sat"}; - char * Months[] = {"NULL","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug", - "Sep","Oct","Nov","Dec"}; - - GetSystemTime(&systime); - - wsprintf(szDate,"%s, %d %s %d %d:%d.%d", DaysofWeek[systime.wDayOfWeek], - systime.wDay, - Months[systime.wMonth], - systime.wYear, - systime.wHour, systime.wMinute, - systime.wSecond ); - - return szDate; -} -// -// Fill the ECB up -// -BOOL WINAPI FillExtensionControlBlock(EXTENSION_CONTROL_BLOCK *ECB, TIsapiContext *context) { - - char * temp; - ECB->cbSize = sizeof(EXTENSION_CONTROL_BLOCK); - ECB->dwVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR); - ECB->ConnID = (void *)context; - // - // Pointers to the functions the DLL will call. - // - ECB->GetServerVariable = GetServerVariable; - ECB->ReadClient = ReadClient; - ECB->WriteClient = WriteClient; - ECB->ServerSupportFunction = ServerSupportFunction; - - // - // Fill in the standard CGI environment variables - // - ECB->lpszMethod = GetEnv("REQUEST_METHOD"); - if (!ECB->lpszMethod) ECB->lpszMethod = "GET"; - - ECB->lpszQueryString = GetEnv("QUERY_STRING"); - ECB->lpszPathInfo = GetEnv("PATH_INFO"); - ECB->lpszPathTranslated = GetEnv("PATH_TRANSLATED"); - ECB->cbTotalBytes=( (temp=GetEnv("CONTENT_LENGTH")) ? (atoi(temp)): 0); - ECB->cbAvailable = 0; - ECB->lpbData = (unsigned char *)""; - ECB->lpszContentType = GetEnv("CONTENT_TYPE"); - return TRUE; - -} - -// -// Works like _getenv(), but uses win32 functions instead. -// -char *GetEnv(LPSTR lpszEnvVar) -{ - - char *var, dummy; - DWORD dwLen; - - if (!lpszEnvVar) - return ""; - - dwLen =GetEnvironmentVariable(lpszEnvVar, &dummy, 1); - - if (dwLen == 0) - return ""; - - var = (char *)xmalloc(dwLen); - if (!var) - return ""; - (void)GetEnvironmentVariable(lpszEnvVar, var, dwLen); - - return var; -} diff --git a/sapi/isapi/stresstest/stresstest.dsp b/sapi/isapi/stresstest/stresstest.dsp deleted file mode 100644 index fb82303e3d92b..0000000000000 --- a/sapi/isapi/stresstest/stresstest.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="stresstest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=stresstest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "stresstest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "stresstest.mak" CFG="stresstest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "stresstest - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "stresstest - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "stresstest - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 2 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "stresstest - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 2 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "c:\php-fcgi" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "stresstest - Win32 Release" -# Name "stresstest - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\getopt.h -# End Source File -# Begin Source File - -SOURCE=.\stresstest.cpp -# End Source File -# End Group -# Begin Source File - -SOURCE=.\notes.txt -# End Source File -# End Target -# End Project diff --git a/sapi/milter/CREDITS b/sapi/milter/CREDITS deleted file mode 100644 index cd00d6774b2f5..0000000000000 --- a/sapi/milter/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Sendmail Milter -Harald Radi diff --git a/sapi/milter/EXPERIMENTAL b/sapi/milter/EXPERIMENTAL deleted file mode 100644 index 293159a693dec..0000000000000 --- a/sapi/milter/EXPERIMENTAL +++ /dev/null @@ -1,5 +0,0 @@ -this module is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! diff --git a/sapi/milter/Makefile.frag b/sapi/milter/Makefile.frag deleted file mode 100644 index 8dbdf7a8fd089..0000000000000 --- a/sapi/milter/Makefile.frag +++ /dev/null @@ -1,2 +0,0 @@ -$(SAPI_MILTER_PATH): $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) - $(BUILD_MILTER) diff --git a/sapi/milter/TODO b/sapi/milter/TODO deleted file mode 100644 index 4a427ea131a71..0000000000000 --- a/sapi/milter/TODO +++ /dev/null @@ -1,5 +0,0 @@ -threaded version still leaks mem, don't know why -extensions aren't loaded -stdout to syslog -testing -documentation \ No newline at end of file diff --git a/sapi/milter/config.m4 b/sapi/milter/config.m4 deleted file mode 100644 index e31455185735b..0000000000000 --- a/sapi/milter/config.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(milter, for Milter support, -[ --with-milter[=DIR] Build PHP as Milter application], no, no) - -if test "$PHP_MILTER" != "no"; then - if test "$PHP_MILTER" = "yes"; then - if test -f /usr/lib/libmilter.a ; then - MILTERPATH=/usr/lib - else - if test -f /usr/lib/libmilter/libmilter.a ; then - MILTERPATH=/usr/lib/libmilter - else - AC_MSG_ERROR([Unable to find libmilter.a]) - fi - fi - else - MILTERPATH=$PHP_MILTER - fi - - SAPI_MILTER_PATH=sapi/milter/php-milter - PHP_BUILD_THREAD_SAFE - PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/milter/Makefile.frag) - PHP_SELECT_SAPI(milter, program, php_milter.c getopt.c,,'$(SAPI_MILTER_PATH)') - PHP_ADD_LIBRARY_WITH_PATH(milter, $MILTERPATH,) - BUILD_MILTER="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_MILTER_PATH)" - INSTALL_IT="\$(INSTALL) -m 0755 \$(SAPI_MILTER_PATH) \$(bindir)/php-milter" - PHP_SUBST(SAPI_MILTER_PATH) - PHP_SUBST(BUILD_MILTER) -fi diff --git a/sapi/milter/getopt.c b/sapi/milter/getopt.c deleted file mode 100644 index f5874d577e7fe..0000000000000 --- a/sapi/milter/getopt.c +++ /dev/null @@ -1,173 +0,0 @@ -/* Borrowed from Apache NT Port */ - -#include -#include -#include -#include -#include "php_getopt.h" -#define OPTERRCOLON (1) -#define OPTERRNF (2) -#define OPTERRARG (3) - - -char *ap_php_optarg; -int ap_php_optind = 1; -static int ap_php_opterr = 1; - -static int -ap_php_optiserr(int argc, char * const *argv, int oint, const char *optstr, - int optchr, int err) -{ - if (ap_php_opterr) - { - fprintf(stderr, "Error in argument %d, char %d: ", oint, optchr+1); - switch(err) - { - case OPTERRCOLON: - fprintf(stderr, ": in flags\n"); - break; - case OPTERRNF: - fprintf(stderr, "option not found %c\n", argv[oint][optchr]); - break; - case OPTERRARG: - fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]); - break; - default: - fprintf(stderr, "unknown\n"); - break; - } - } - return('?'); -} - -int ap_php_getopt(int argc, char* const *argv, const char *optstr) -{ - static int optchr = 0; - static int dash = 0; /* have already seen the - */ - - char *cp; - - if (ap_php_optind >= argc) - return(EOF); - if (!dash && (argv[ap_php_optind][0] != '-')) - return(EOF); - if (!dash && (argv[ap_php_optind][0] == '-') && !argv[ap_php_optind][1]) - { - /* - * use to specify stdin. Need to let pgm process this and - * the following args - */ - return(EOF); - } - if ((argv[ap_php_optind][0] == '-') && (argv[ap_php_optind][1] == '-')) - { - /* -- indicates end of args */ - ap_php_optind++; - return(EOF); - } - if (!dash) - { - assert((argv[ap_php_optind][0] == '-') && argv[ap_php_optind][1]); - dash = 1; - optchr = 1; - } - - /* Check if the guy tries to do a -: kind of flag */ - assert(dash); - if (argv[ap_php_optind][optchr] == ':') - { - dash = 0; - ap_php_optind++; - return(ap_php_optiserr(argc, argv, ap_php_optind-1, optstr, optchr, OPTERRCOLON)); - } - if (!(cp = strchr(optstr, argv[ap_php_optind][optchr]))) - { - int errind = ap_php_optind; - int errchr = optchr; - - if (!argv[ap_php_optind][optchr+1]) - { - dash = 0; - ap_php_optind++; - } - else - optchr++; - return(ap_php_optiserr(argc, argv, errind, optstr, errchr, OPTERRNF)); - } - if (cp[1] == ':') - { - /* Check for cases where the value of the argument - is in the form - or in the form - */ - dash = 0; - if(!argv[ap_php_optind][2]) { - ap_php_optind++; - if (ap_php_optind == argc) - return(ap_php_optiserr(argc, argv, ap_php_optind-1, optstr, optchr, OPTERRARG)); - ap_php_optarg = argv[ap_php_optind++]; - } - else - { - ap_php_optarg = &argv[ap_php_optind][2]; - ap_php_optind++; - } - return(*cp); - } - else - { - if (!argv[ap_php_optind][optchr+1]) - { - dash = 0; - ap_php_optind++; - } - else - optchr++; - return(*cp); - } - assert(0); - return(0); /* never reached */ -} - -#ifdef TESTGETOPT -int - main (int argc, char **argv) - { - int c; - extern char *ap_php_optarg; - extern int ap_php_optind; - int aflg = 0; - int bflg = 0; - int errflg = 0; - char *ofile = NULL; - - while ((c = ap_php_getopt(argc, argv, "abo:")) != EOF) - switch (c) { - case 'a': - if (bflg) - errflg++; - else - aflg++; - break; - case 'b': - if (aflg) - errflg++; - else - bflg++; - break; - case 'o': - ofile = ap_php_optarg; - (void)printf("ofile = %s\n", ofile); - break; - case '?': - errflg++; - } - if (errflg) { - (void)fprintf(stderr, - "usage: cmd [-a|-b] [-o ] files...\n"); - exit (2); - } - for ( ; ap_php_optind < argc; ap_php_optind++) - (void)printf("%s\n", argv[ap_php_optind]); - return 0; - } - -#endif /* TESTGETOPT */ diff --git a/sapi/milter/milter.php b/sapi/milter/milter.php deleted file mode 100644 index 0878f2a4d9558..0000000000000 --- a/sapi/milter/milter.php +++ /dev/null @@ -1,132 +0,0 @@ - $arg) { - milter_log("\targs[$ix] = $arg"); - } -} - -/** - * is called once per recipient, hence one or more times per message, - * immediately after milter_envfrom - */ -function milter_envrcpt($args) -{ - milter_log("milter_envrcpt(args[])"); - foreach ($args as $ix => $arg) { - milter_log("\targs[$ix] = $arg"); - } -} - -/** - * is called zero or more times between milter_envrcpt and milter_eoh, - * once per message header - */ -function milter_header($header, $value) -{ - milter_log("milter_header('$header', '$value')"); -} - -/** - * is called once after all headers have been sent and processed. - */ -function milter_eoh() -{ - milter_log("milter_eoh()"); -} - -/** - * is called zero or more times between milter_eoh and milter_eom. - */ -function milter_body($bodypart) -{ - milter_log("milter_body('$bodypart')"); -} - -/** - * is called once after all calls to milter_body for a given message. - * most of the api functions, that alter the message can only be called - * within this callback. - */ -function milter_eom() -{ - milter_log("milter_eom()"); - /* add PHP header to the message */ - smfi_addheader("X-PHP", phpversion()); -} - -/** - * may be called at any time during message processing - * (i.e. between some message-oriented routine and milter_eom). - */ -function milter_abort() -{ - milter_log("milter_abort()"); -} - -/** - * is always called once at the end of each connection. - */ -function milter_close() -{ - milter_log("milter_close()"); -} -?> diff --git a/sapi/milter/php_getopt.h b/sapi/milter/php_getopt.h deleted file mode 100644 index 40da432b596da..0000000000000 --- a/sapi/milter/php_getopt.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Borrowed from Apache NT Port */ -#include "php.h" - -extern char *ap_php_optarg; -extern int ap_php_optind; - -int ap_php_getopt(int argc, char* const *argv, const char *optstr); diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c deleted file mode 100644 index 567fc8f27a560..0000000000000 --- a/sapi/milter/php_milter.c +++ /dev/null @@ -1,1159 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Harald Radi | - | Parts based on CGI SAPI Module by | - | Rasmus Lerdorf, Stig Bakken and Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_globals.h" -#include "php_variables.h" -#include "zend_modules.h" - -#ifndef ZTS -#error SRM sapi module is only useable in thread-safe mode -#endif - -#include "SAPI.h" - -#include -#include "php.h" -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_SETLOCALE -#include -#endif -#include "zend.h" -#include "zend_extensions.h" -#include "php_ini.h" -#include "php_globals.h" -#include "php_main.h" -#include "fopen_wrappers.h" -#include "ext/standard/php_standard.h" - -#ifdef __riscos__ -#include -#endif - -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_highlight.h" -#include "zend_indent.h" - -#include "libmilter/mfapi.h" - -#include "php_getopt.h" - -#define OPTSTRING "ac:d:Def:hnp:vVz:?" -#define MG(v) TSRMG(milter_globals_id, zend_milter_globals *, v) - -#define IS_NONE "%s(): This function must not be called outside of a milter callback function's scope" -#define NOT_EOM "%s(): This function can only be used inside the milter_eom callback's scope" -#define NOT_INIT "%s(): This function can only be used inside the milter_init callback's scope" - -#define MLFI_NONE 0 -#define MLFI_CONNECT 1 -#define MLFI_HELO 2 -#define MLFI_ENVFROM 3 -#define MLFI_ENVRCPT 4 -#define MLFI_HEADER 5 -#define MLFI_EOH 6 -#define MLFI_BODY 7 -#define MLFI_EOM 8 -#define MLFI_ABORT 9 -#define MLFI_CLOSE 10 -#define MLFI_INIT 11 - -/* {{{ globals - */ -extern char *ap_php_optarg; -extern int ap_php_optind; - -static int flag_debug=0; -static char *filename; - -/* per thread */ -ZEND_BEGIN_MODULE_GLOBALS(milter) - SMFICTX *ctx; - int state; - int initialized; -ZEND_END_MODULE_GLOBALS(milter) - -ZEND_DECLARE_MODULE_GLOBALS(milter) -/* }}} */ - -/* this method is called only once when the milter starts */ -/* {{{ Init Milter -*/ -static int mlfi_init() -{ - int ret = 0; - zend_file_handle file_handle; - zval function_name, retval; - int status; - TSRMLS_FETCH(); - - /* request startup */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - php_request_shutdown((void *) 0); - - return -1; - } - - /* disable headers */ - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - - if (!(file_handle.handle.fp = VCWD_FOPEN(filename, "rb"))) { - php_printf("Could not open input file: %s\n", filename); - return SMFIS_TEMPFAIL; - } - - file_handle.type = ZEND_HANDLE_FP; - file_handle.filename = filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_execute_script(&file_handle TSRMLS_CC); - - /* call userland */ - INIT_ZVAL(function_name); - - ZVAL_STRING(&function_name, "milter_init", 0); - - /* set the milter context for possible use in API functions */ - MG(state) = MLFI_INIT; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - MG(initialized) = 1; - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - ret = Z_LVAL(retval); - } - - php_request_shutdown((void *) 0); - - return ret; -} -/* }}} */ - -/* {{{ Milter callback functions - */ - -/* connection info filter, is called whenever sendmail connects to the milter */ -/* {{{ mlfi_connect() -*/ -static sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) -{ - zend_file_handle file_handle; - zval function_name, retval, *param[1]; - int status; - TSRMLS_FETCH(); - - /* request startup */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - php_request_shutdown((void *) 0); - - return SMFIS_TEMPFAIL; - } - - /* disable headers */ - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - - if (!(file_handle.handle.fp = VCWD_FOPEN(filename, "rb"))) { - php_printf("Could not open input file: %s\n", filename); - return SMFIS_TEMPFAIL; - } - - file_handle.type = ZEND_HANDLE_FP; - file_handle.filename = filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_execute_script(&file_handle TSRMLS_CC); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_connect", 0); - ZVAL_STRING(param[0], hostname, 1); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_CONNECT; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - zval_ptr_dtor(param); - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* SMTP HELO command filter */ -/* {{{ mlfi_helo() -*/ -static sfsistat mlfi_helo(SMFICTX *ctx, char *helohost) -{ - zval function_name, retval, *param[1]; - int status; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_helo", 0); - ZVAL_STRING(param[0], helohost, 1); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_HELO; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - zval_ptr_dtor(param); - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* envelope sender filter */ -/* {{{ mlfi_envform() -*/ -static sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv) -{ - zval function_name, retval, *param[1]; - int status; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_envfrom", 0); - array_init(param[0]); - - while (*argv) { - add_next_index_string(param[0], *argv, 1); - argv++; - } - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_ENVFROM; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - zval_ptr_dtor(param); - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* envelope recipient filter */ -/* {{{ mlfi_envrcpt() -*/ -static sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv) -{ - zval function_name, retval, *param[1]; - int status; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_envrcpt", 0); - array_init(param[0]); - - while (*argv) { - add_next_index_string(param[0], *argv, 1); - argv++; - } - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_ENVRCPT; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - - zval_ptr_dtor(param); - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* header filter */ -/* {{{ mlfi_header() -*/ -static sfsistat mlfi_header(SMFICTX *ctx, char *headerf, char *headerv) -{ - zval function_name, retval, *param[2]; - int status; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - ALLOC_ZVAL(param[1]); - INIT_PZVAL(param[0]); - INIT_PZVAL(param[1]); - - ZVAL_STRING(&function_name, "milter_header", 0); - ZVAL_STRING(param[0], headerf, 1); - ZVAL_STRING(param[1], headerv, 1); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_HEADER; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 2, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - - zval_ptr_dtor(¶m[0]); - zval_ptr_dtor(¶m[1]); - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* end of header */ -/* {{{ mlfi_eoh() -*/ -static sfsistat mlfi_eoh(SMFICTX *ctx) -{ - zval function_name, retval; - int status; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - ZVAL_STRING(&function_name, "milter_eoh", 0); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_EOH; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* body block */ -/* {{{ mlfi_body() -*/ -static sfsistat mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t len) -{ - zval function_name, retval, *param[1]; - int status; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - - ALLOC_ZVAL(param[0]); - INIT_PZVAL(param[0]); - - ZVAL_STRING(&function_name, "milter_body", 0); - ZVAL_STRINGL(param[0], (char*)bodyp, len, 1); /*alex*/ - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_BODY; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); - - MG(state) = MLFI_NONE; - - zval_ptr_dtor(param); - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* end of message */ -/* {{{ mlfi_eom() -*/ -static sfsistat mlfi_eom(SMFICTX *ctx) -{ - zval function_name, retval; - int status; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - ZVAL_STRING(&function_name, "milter_eom", 0); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_EOM; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* message aborted */ -/* {{{ mlfi_abort() -*/ -static sfsistat mlfi_abort(SMFICTX *ctx) -{ - zval function_name, retval; - int status; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - ZVAL_STRING(&function_name, "milter_abort", 0); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_ABORT; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - return Z_LVAL(retval); - } - - return SMFIS_CONTINUE; -} -/* }}} */ - -/* connection cleanup */ -/* {{{ mlfi_close() -*/ -static sfsistat mlfi_close(SMFICTX *ctx) -{ - int ret = SMFIS_CONTINUE; - zval function_name, retval; - int status; - TSRMLS_FETCH(); - - /* call userland */ - INIT_ZVAL(function_name); - ZVAL_STRING(&function_name, "milter_close", 0); - - /* set the milter context for possible use in API functions */ - MG(ctx) = ctx; - MG(state) = MLFI_CLOSE; - - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); - - MG(state) = MLFI_NONE; - - if (status == SUCCESS && Z_TYPE(retval) == IS_LONG) { - ret = Z_LVAL(retval); - } - - php_request_shutdown((void *) 0); - - return ret; -} -/* }}} */ -/* }}} */ - -/* {{{ Milter entry struct - */ -struct smfiDesc smfilter = { - "php-milter", /* filter name */ - SMFI_VERSION, /* version code -- leave untouched */ - 0, /* flags */ - mlfi_connect, /* info filter callback */ - mlfi_helo, /* HELO filter callback */ - mlfi_envfrom, /* envelope filter callback */ - mlfi_envrcpt, /* envelope recipient filter callback */ - mlfi_header, /* header filter callback */ - mlfi_eoh, /* end of header callback */ - mlfi_body, /* body filter callback */ - mlfi_eom, /* end of message callback */ - mlfi_abort, /* message aborted callback */ - mlfi_close, /* connection cleanup callback */ -}; -/* }}} */ - -/* {{{ PHP Milter API - */ - -/* {{{ proto void smfi_setflags(long flags) - Sets the flags describing the actions the filter may take. */ -PHP_FUNCTION(smfi_setflags) -{ - long flags; - - /* valid only in the init callback */ - if (MG(state) != MLFI_INIT) { - php_error(E_WARNING, NOT_INIT, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "l", &flags) == SUCCESS) { - flags = flags & (SMFIF_ADDHDRS|SMFIF_CHGHDRS|SMFIF_CHGBODY|SMFIF_ADDRCPT|SMFIF_DELRCPT); - smfilter.xxfi_flags = flags; - } -} -/* }}} */ - -/* {{{ proto void smfi_settimeout(long timeout) - Sets the number of seconds libmilter will wait for an MTA connection before timing out a socket. */ -PHP_FUNCTION(smfi_settimeout) -{ - long timeout; - - /* valid only in the init callback */ - if (MG(state) != MLFI_INIT) { - php_error(E_WARNING, NOT_INIT, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "l", &timeout) == SUCCESS) { - smfi_settimeout(timeout); - } -} -/* }}} */ - -/* {{{ proto string smfi_getsymval(string macro) - Returns the value of the given macro or NULL if the macro is not defined. */ -PHP_FUNCTION(smfi_getsymval) -{ - char *symname, *ret; - int len; - - /* valid in any callback */ - if (MG(state) == MLFI_NONE) { - php_error(E_WARNING, IS_NONE, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &symname, &len) == SUCCESS) { - if ((ret = smfi_getsymval(MG(ctx), symname)) != NULL) { - RETURN_STRING(ret, 1); - } - } - - RETURN_NULL(); -} -/* }}} */ - -/* {{{ proto bool smfi_setreply(string rcode, string xcode, string message) - Directly set the SMTP error reply code for this connection. - This code will be used on subsequent error replies resulting from actions taken by this filter. */ -PHP_FUNCTION(smfi_setreply) -{ - char *rcode, *xcode, *message; - int len; - - /* valid in any callback */ - if (MG(state) == MLFI_NONE) { - php_error(E_WARNING, IS_NONE, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(3 TSRMLS_CC, "sss", &rcode, &len, &xcode, &len, &message, &len) == SUCCESS) { - if (smfi_setreply(MG(ctx), rcode, xcode, message) == MI_SUCCESS) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool smfi_addheader(string headerf, string headerv) - Adds a header to the current message. */ -PHP_FUNCTION(smfi_addheader) -{ - char *f, *v; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(2 TSRMLS_CC, "ss", &f, &len, &v, &len) == SUCCESS) { - if (smfi_addheader(MG(ctx), f, v) == MI_SUCCESS) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool smfi_chgheader(string headerf, string headerv) - Changes a header's value for the current message. */ -PHP_FUNCTION(smfi_chgheader) -{ - char *f, *v; - long idx; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(3 TSRMLS_CC, "sls", &f, &len, &idx, &v, &len) == SUCCESS) { - if (smfi_chgheader(MG(ctx), f, idx, v) == MI_SUCCESS) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool smfi_addrcpt(string rcpt) - Add a recipient to the message envelope. */ -PHP_FUNCTION(smfi_addrcpt) -{ - char *rcpt; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &rcpt, &len) == SUCCESS) { - if (smfi_addrcpt(MG(ctx), rcpt) == MI_SUCCESS) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool smfi_delrcpt(string rcpt) - Removes the named recipient from the current message's envelope. */ -PHP_FUNCTION(smfi_delrcpt) -{ - char *rcpt; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &rcpt, &len) == SUCCESS) { - if (smfi_delrcpt(MG(ctx), rcpt) == MI_SUCCESS) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool smfi_replacebody(string body) - Replaces the body of the current message. If called more than once, - subsequent calls result in data being appended to the new body. */ -PHP_FUNCTION(smfi_replacebody) -{ - char *body; - int len; - - /* valid only in milter_eom */ - if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &body, &len) == SUCCESS) { - if (smfi_replacebody(MG(ctx), (u_char*)body, len) == MI_SUCCESS) { - RETURN_TRUE; - } - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(milter) -{ - REGISTER_LONG_CONSTANT("SMFIS_CONTINUE", SMFIS_CONTINUE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIS_REJECT", SMFIS_REJECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIS_DISCARD", SMFIS_DISCARD, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIS_ACCEPT", SMFIS_ACCEPT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIS_TEMPFAIL", SMFIS_TEMPFAIL, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("SMFIF_ADDHDRS", SMFIF_ADDHDRS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIF_CHGHDRS", SMFIF_CHGHDRS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIF_CHGBODY", SMFIF_CHGBODY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIF_ADDRCPT", SMFIF_ADDRCPT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SMFIF_DELRCPT", SMFIF_DELRCPT, CONST_CS | CONST_PERSISTENT); - - ZEND_INIT_MODULE_GLOBALS(milter, NULL, NULL); - - MG(state) = MLFI_NONE; - MG(initialized) = 0; - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(milter) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "Milter support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ -/* }}} */ - -/* {{{ milter_functions[] -*/ -static zend_function_entry milter_functions[] = { - PHP_FE(smfi_setflags, NULL) - PHP_FE(smfi_settimeout, NULL) - PHP_FE(smfi_getsymval, NULL) - PHP_FE(smfi_setreply, NULL) - PHP_FE(smfi_addheader, NULL) - PHP_FE(smfi_chgheader, NULL) - PHP_FE(smfi_addrcpt, NULL) - PHP_FE(smfi_delrcpt, NULL) - PHP_FE(smfi_replacebody, NULL) - { NULL, NULL, NULL } -}; -/* }}} */ - -/* {{{ Zend module entry -*/ -static zend_module_entry php_milter_module = { - STANDARD_MODULE_HEADER, - "Milter", - milter_functions, - PHP_MINIT(milter), - NULL, - NULL, - NULL, - PHP_MINFO(milter), - "0.1.0", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ Milter SAPI -*/ -static int sapi_milter_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - return str_length; -} - -static void sapi_milter_flush(void *server_context) -{ -} - -static void sapi_milter_register_variables(zval *track_vars_array TSRMLS_DC) -{ - php_register_variable ("SERVER_SOFTWARE", "Sendmail Milter", track_vars_array TSRMLS_CC); -} - -static int sapi_milter_post_read(char *buf, uint count_bytes TSRMLS_DC) -{ - return 0; -} - -static char* sapi_milter_read_cookies(TSRMLS_D) -{ - return NULL; -} - -static int sapi_milter_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int php_milter_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_milter_module, 1) == FAILURE) { - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ sapi_module_struct milter_sapi_module -*/ -static sapi_module_struct milter_sapi_module = { - "milter", /* name */ - "Sendmail Milter SAPI", /* pretty name */ - - php_milter_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_milter_ub_write, /* unbuffered write */ - sapi_milter_flush, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - NULL, /* header handler */ - sapi_milter_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_milter_post_read, /* read POST data */ - sapi_milter_read_cookies, /* read Cookies */ - - sapi_milter_register_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - NULL, /* Block interruptions */ - NULL, /* Unblock interruptions */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; -/* }}} */ - -/**** -* ripped from cli, has to be cleaned up ! -*/ - -/* {{{ php_milter_usage -*/ -static void php_milter_usage(char *argv0) -{ - char *prog; - - prog = strrchr(argv0, '/'); - if (prog) { - prog++; - } else { - prog = "php-milter"; - } - - printf( "Usage: %s [options] [-f] [args...]\n" - " %s [options] -r [args...]\n" - " %s [options] [-- args...]\n" - " -a Run interactively\n" - " -c | Look for php.ini file in this directory\n" - " -n No php.ini file will be used\n" - " -d foo[=bar] Define INI entry foo with value 'bar'\n" - " -D run as daemon\n" - " -e Generate extended information for debugger/profiler\n" - " -f Parse .\n" - " -h This help\n" - " -p path to create socket\n" - " -v Version number\n" - " -V set debug level to n (1 or 2).\n" - " -z Load Zend extension .\n" - " args... Arguments passed to script. Use -- args when first argument \n" - " starts with - or script is read from stdin\n" - , prog, prog, prog); -} -/* }}} */ - -static void define_command_line_ini_entry(char *arg) /* {{{ */ -{ - char *name, *value; - - name = arg; - value = strchr(arg, '='); - if (value) { - *value = 0; - value++; - } else { - value = "1"; - } - zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); -} -/* }}} */ - -/* {{{ main -*/ -int main(int argc, char *argv[]) -{ - char *sock = NULL; - int dofork = 0; - - int exit_status = SUCCESS; - int c; -/* temporary locals */ - int orig_optind=ap_php_optind; - char *orig_optarg=ap_php_optarg; - int interactive=0; - char *param_error=NULL; -/* end of temporary locals */ - - void ***tsrm_ls; - -#ifdef HAVE_SIGNAL_H -#if defined(SIGPIPE) && defined(SIG_IGN) - signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so - that sockets created via fsockopen() - don't kill PHP if the remote site - closes it. in apache|apxs mode apache - does that for us! thies@thieso.net - 20000419 */ -#endif -#endif - - - tsrm_startup(1, 1, 0, NULL); - sapi_startup(&milter_sapi_module); - - while ((c=ap_php_getopt(argc, argv, OPTSTRING))!=-1) { - switch (c) { - case 'c': - milter_sapi_module.php_ini_path_override = strdup(ap_php_optarg); - break; - case 'n': - milter_sapi_module.php_ini_ignore = 1; - break; - } - } - ap_php_optind = orig_optind; - ap_php_optarg = orig_optarg; - - milter_sapi_module.executable_location = argv[0]; - - tsrm_ls = ts_resource(0); - - sapi_module.startup(&milter_sapi_module); - - zend_first_try { - while ((c=ap_php_getopt(argc, argv, OPTSTRING))!=-1) { - switch (c) { - case '?': - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_milter_usage(argv[0]); - php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - break; - } - } - ap_php_optind = orig_optind; - ap_php_optarg = orig_optarg; - - /* Set some CLI defaults */ - SG(options) |= SAPI_OPTION_NO_CHDIR; - zend_alter_ini_entry("html_errors", 12, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - zend_alter_ini_entry("max_execution_time", 19, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - - zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */ - - while ((c = ap_php_getopt(argc, argv, OPTSTRING)) != -1) { - switch (c) { - - case 'a': /* interactive mode */ - printf("Interactive mode enabled\n\n"); - interactive=1; - break; - - case 'C': /* don't chdir to the script directory */ - /* This is default so NOP */ - break; - case 'd': /* define ini entries on command line */ - define_command_line_ini_entry(ap_php_optarg); - break; - - case 'D': /* daemon */ - dofork = 1; - break; - - case 'e': /* enable extended info output */ - CG(extended_info) = 1; - break; - - case 'f': /* parse file */ - filename = ap_php_optarg; - break; - - case 'h': /* help & quit */ - case '?': - php_output_startup(); - php_output_activate(TSRMLS_C); - SG(headers_sent) = 1; - php_milter_usage(argv[0]); - php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - break; - - case 'p': /* socket */ - sock = strdup(ap_php_optarg); - break; - - case 'v': /* show php version & quit */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - zend_ini_deactivate(TSRMLS_C); - php_module_shutdown(TSRMLS_C); - sapi_shutdown(); - tsrm_shutdown(); - - exit(1); - } - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2008 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); - php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - break; - - case 'V': /* verbose */ - flag_debug = atoi(ap_php_optarg); - break; - - case 'z': /* load extension file */ - zend_load_extension(ap_php_optarg); - break; - - default: - break; - } - } - - if (param_error) { - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - PUTS(param_error); - exit(1); - } - - CG(interactive) = interactive; - - /* only set script_file if not set already and not in direct mode and not at end of parameter list */ - if (argc > ap_php_optind && !filename) { - filename=argv[ap_php_optind]; - ap_php_optind++; - } - - /* check if file exists, exit else */ - - if (dofork) { - switch(fork()) { - case -1: /* Uh-oh, we have a problem forking. */ - fprintf(stderr, "Uh-oh, couldn't fork!\n"); - exit(errno); - break; - case 0: /* Child */ - break; - default: /* Parent */ - exit(0); - } - } - - if (sock) { - struct stat junk; - if (stat(sock,&junk) == 0) unlink(sock); - } - - openlog("php-milter", LOG_PID, LOG_MAIL); - - if ((exit_status = mlfi_init())) { - syslog(1, "mlfi_init failed."); - closelog(); - goto err; - } - - smfi_setconn(sock); - if (smfi_register(smfilter) == MI_FAILURE) { - syslog(1, "smfi_register failed."); - fprintf(stderr, "smfi_register failed\n"); - closelog(); - goto err; - } else { - exit_status = smfi_main(); - } - - closelog(); - - if (milter_sapi_module.php_ini_path_override) { - free(milter_sapi_module.php_ini_path_override); - } - - } zend_catch { - exit_status = EG(exit_status); - } zend_end_try(); - -err: - php_module_shutdown(TSRMLS_C); - sapi_shutdown(); - tsrm_shutdown(); - - exit(exit_status); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/milter/php_milter.h b/sapi/milter/php_milter.h deleted file mode 100644 index 72d7ac51eeb50..0000000000000 --- a/sapi/milter/php_milter.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef PHP_MILTER_H -#define PHP_MILTER_H - -#include "libmilter/mfapi.h" - -#define MLFI_NONE 0 -#define MLFI_CONNECT 1 -#define MLFI_HELO 2 -#define MLFI_ENVFROM 3 -#define MLFI_ENVRCPT 4 -#define MLFI_HEADER 5 -#define MLFI_EOH 6 -#define MLFI_BODY 7 -#define MLFI_EOM 8 -#define MLFI_ABORT 9 -#define MLFI_CLOSE 10 -#define MLFI_INIT 11 - -#define MG(v) TSRMG(milter_globals_id, zend_milter_globals *, v) - -typedef struct { - pthread_t thread; - MUTEX_T receiver; - MUTEX_T sender; - SMFICTX *ctx; - sfsistat retval; - int message; - void **args; -} worker_thread; - -#endif diff --git a/sapi/nsapi/CREDITS b/sapi/nsapi/CREDITS deleted file mode 100644 index 2a0591986201f..0000000000000 --- a/sapi/nsapi/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -NSAPI -Jayakumar Muthukumarasamy, Uwe Schindler diff --git a/sapi/nsapi/config.m4 b/sapi/nsapi/config.m4 deleted file mode 100644 index 8923f53227460..0000000000000 --- a/sapi/nsapi/config.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(nsapi, for NSAPI support, -[ --with-nsapi=DIR Build PHP as NSAPI module for Netscape/iPlanet/Sun Webserver], no, no) - -if test "$PHP_NSAPI" != "no"; then - if test ! -d $PHP_NSAPI/bin ; then - AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/Sun Webserver using --with-nsapi=DIR) - fi - AC_MSG_CHECKING([for NSAPI include files]) - if test -d $PHP_NSAPI/include ; then - NSAPI_INC_DIR="$PHP_NSAPI/include" - AC_MSG_RESULT([Netscape 3.x / Sun 7.x style]) - AC_CHECK_HEADERS([$NSAPI_INC_DIR/nsapi.h]) - NSAPI_INCLUDE="-I$NSAPI_INC_DIR" - fi - if test -d $PHP_NSAPI/plugins/include ; then - NSAPI_INC_DIR="$PHP_NSAPI/plugins/include" - AC_MSG_RESULT([iPlanet 4.x / Sun 6.x style]) - AC_CHECK_HEADERS([$NSAPI_INC_DIR/nsapi.h]) - NSAPI_INCLUDE="$NSAPI_INCLUDE -I$NSAPI_INC_DIR" - fi - if test -z "$NSAPI_INCLUDE"; then - AC_MSG_ERROR([Please check you have nsapi.h in either $PHP_NSAPI/include or $PHP_NSAPI/plugins/include]) - fi - - PHP_EVAL_INCLINE($NSAPI_INCLUDE) - PHP_BUILD_THREAD_SAFE - AC_DEFINE(HAVE_NSAPI, 1, [Whether you have a Netscape/iPlanet/Sun Webserver]) - PHP_SELECT_SAPI(nsapi, shared, nsapi.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_NSAPI/bin/" -fi - - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/nsapi/config.w32 b/sapi/nsapi/config.w32 deleted file mode 100644 index 3522eb7d5684a..0000000000000 --- a/sapi/nsapi/config.w32 +++ /dev/null @@ -1,19 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_ENABLE('nsapi', 'Build NSAPI for Netscape/iPlanet/SunONE webservers', 'no'); - -ARG_WITH('nsapi-includes', 'Where to find NSAPI headers', null); -ARG_WITH('nsapi-libs', 'Where to find NSAPI libraries', null); - -if (PHP_NSAPI != "no") { - if (PHP_ZTS == "no") { - WARNING("NSAPI module requires an --enable-zts build of PHP"); - } else if (CHECK_HEADER_ADD_INCLUDE("nsapi.h", "CFLAGS_NSAPI", - PHP_NSAPI + ';' + PHP_NSAPI_INCLUDES) && - CHECK_LIB("ns-httpd*.lib", "nsapi", PHP_NSAPI + ";" + PHP_NSAPI_LIBS)) { - SAPI('nsapi', 'nsapi.c', 'php' + PHP_VERSION + 'nsapi.dll', '/D XP_WIN32 '); - } else { - WARNING("Could not find NSAPI headers/libraries"); - } -} diff --git a/sapi/nsapi/nsapi-readme.txt b/sapi/nsapi/nsapi-readme.txt deleted file mode 100644 index 54980bf0e0d8e..0000000000000 --- a/sapi/nsapi/nsapi-readme.txt +++ /dev/null @@ -1,154 +0,0 @@ -Configuration of your Netscape/iPlanet/Sun Webserver for PHP5 ------------------------------------------------------------------ - -These instructions are targetted at Netscape Enterprise Web Server and -SUN/Netscape Alliance iPlanet Web Server and the new Sun Java System Webserver. -On other web servers your milage may vary. - -Firstly you may need to add some paths to the LD_LIBRARY_PATH -environment for Netscape to find all the shared libs. This is best done -in the start script for your Netscape server. Windows users can -probably skip this step. The start script is located in: - - /https-servername/start - - -Netscape/iPlanet/Sun config files are located in: - - /https-servername/config - - -Add the following line to mime.types (you can do that by the administration server): - - type=magnus-internal/x-httpd-php exts=php - - -Place the following two lines after mime.types init in -/https-servername/config/obj.conf (for servers < 6) or -for iPlanet/Sun Webserver 6.0 and above however at the end of the -/https-servername/config/magnus.conf file: - - Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" shlib="/path/to/phplibrary" - Init fn=php5_init errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"] - -The "shlib" will vary depending on your OS: - - Unix: "/bin/libphp5.so". - Windows: "c:/path/to/php5/php5nsapi.dll" - - -In obj.conf (for virtual server classes [Sun 6.0+] in their vserver.obj.conf): - - - . - . - . - # NOTE this next line should happen after all 'ObjectType' and before - # all 'AddLog' lines - # You can modify some entries in php.ini request specific by adding it to the Service - # directive, e.g. doc_root="/path" - # For boolean ini-keys please use 0/1 as value, NOT "On","Off",... (this will not work - # correctly), e.g. zlib.output_compression=1 instead of zlib.output_compression="On" - - Service fn="php5_execute" type="magnus-internal/x-httpd-php" [inikey=value ...] - . - . - . - - -This is only needed if you want to configure a directory that only consists of -PHP scripts (same like a cgi-bin directory): - - - ObjectType fn="force-type" type="magnus-internal/x-httpd-php" - Service fn="php5_execute" [inikey=value ...] - - -After that you can configure a directory in the Administration server and assign it -the style "x-httpd-php". All files in it will get executed as PHP. This is nice to -hide PHP usage by renaming files to .html - -Note: The stacksize that PHP uses depends on the configuration of the webserver. If you get -crashes with very large PHP scripts, it is recommended to raise it with the Admin Server -(in the section "MAGNUS EDITOR"). - - -Authentication configuration ----------------------------- - -PHP authentication cannot be used with any other authentication. ALL -AUTHENTICATION IS PASSED TO YOUR PHP SCRIPT. To configure PHP -Authentication for the entire server, add the following line: - - - AuthTrans fn=php5_auth_trans - . - . - . - . - - - -To use PHP Authentication on a single directory, add the following: - - - AuthTrans fn=php5_auth_trans - - - -Special use for error pages or self-made directory listings ------------------------------------------------------------ - -You can use PHP to generate the error pages for "404 Not Found" -or similar. Add the following line to the object in obj.conf for -every error page you want to overwrite: - - Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...] - -where XXX ist the HTTP error code. Please delete any other Error -directives which could interfere with yours. -If you want to place a page for all errors that could exist, leave -the "code" parameter out. Your script can get the HTTP status code -with $_SERVER['ERROR_TYPE']. - -Another posibility is to generate self-made directory listings. -Just generate a PHP script which displays a directory listing and -replace the corresponding default Service line for -type="magnus-internal/directory" in obj.conf with the following: - - Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...] - -For both error and directory listing pages the original URI and -translated URI are in the variables $_SERVER['PATH_INFO'] and -$_SERVER['PATH_TRANSLATED']. - - -Note about nsapi_virtual() and subrequests ------------------------------------------- - -The NSAPI module now supports the nsapi_virtual() function (alias: virtual()) -to make subrequests on the webserver and insert the result in the webpage. -The problem is, that this function uses some undocumented features from -the NSAPI library. - -Under Unix this is not a problem, because the module automatically looks -for the needed functions and uses them if available. If not, nsapi_virtual() -is disabled. - -Under Windows limitations in the DLL handling need the use of a automatic -detection of the most recent ns-httpdXX.dll file. This is tested for servers -till version 6.1. If a newer version of the Sun server is used, the detection -fails and nsapi_virtual() is disabled. - -If this is the case, try the following: -Add the following parameter to php5_init in magnus.conf: - - Init fn=php5_init ... server_lib="ns-httpdXX.dll" - -where XX is the correct DLL version number. To get it, look in the server-root -for the correct DLL name. The DLL with the biggest filesize is the right one. - -But be warned: SUPPORT FOR nsapi_virtual() IS EXPERIMENTAL !!! - - -$Id$ diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c deleted file mode 100644 index f2f72b9072aea..0000000000000 --- a/sapi/nsapi/nsapi.c +++ /dev/null @@ -1,1054 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Jayakumar Muthukumarasamy | - | Uwe Schindler | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - * PHP includes - */ -#define NSAPI 1 - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_variables.h" -#include "ext/standard/info.h" -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_version.h" -#include "TSRM.h" -#include "ext/standard/php_standard.h" -#include -#include - -#ifndef RTLD_DEFAULT -#define RTLD_DEFAULT NULL -#endif - -/* - * If neither XP_UNIX not XP_WIN32 is defined use PHP_WIN32 - */ -#if !defined(XP_UNIX) && !defined(XP_WIN32) -#ifdef PHP_WIN32 -#define XP_WIN32 -#else -#define XP_UNIX -#endif -#endif - -/* - * NSAPI includes - */ -#include "nsapi.h" - -#define NSLS_D struct nsapi_request_context *request_context -#define NSLS_DC , NSLS_D -#define NSLS_C request_context -#define NSLS_CC , NSLS_C -#define NSG(v) (request_context->v) - -/* - * ZTS needs to be defined for NSAPI to work - */ -#if !defined(ZTS) -#error "NSAPI module needs ZTS to be defined" -#endif - -/* - * Structure to encapsulate the NSAPI request in SAPI - */ -typedef struct nsapi_request_context { - pblock *pb; - Session *sn; - Request *rq; - int read_post_bytes; - char *path_info; - int fixed_script; /* 0 if script is from URI, 1 if script is from "script" parameter */ - short http_error; /* 0 in normal mode; for errors the HTTP error code */ -} nsapi_request_context; - -/* - * Mappings between NSAPI names and environment variables. This - * mapping was obtained from the sample programs at the iplanet - * website. - */ -typedef struct nsapi_equiv { - const char *env_var; - const char *nsapi_eq; -} nsapi_equiv; - -static nsapi_equiv nsapi_reqpb[] = { - { "QUERY_STRING", "query" }, - { "REQUEST_LINE", "clf-request" }, - { "REQUEST_METHOD", "method" }, - { "PHP_SELF", "uri" }, - { "SERVER_PROTOCOL", "protocol" } -}; -static size_t nsapi_reqpb_size = sizeof(nsapi_reqpb)/sizeof(nsapi_reqpb[0]); - -static nsapi_equiv nsapi_vars[] = { - { "AUTH_TYPE", "auth-type" }, - { "CLIENT_CERT", "auth-cert" }, - { "REMOTE_USER", "auth-user" } -}; -static size_t nsapi_vars_size = sizeof(nsapi_vars)/sizeof(nsapi_vars[0]); - -static nsapi_equiv nsapi_client[] = { - { "HTTPS_KEYSIZE", "keysize" }, - { "HTTPS_SECRETSIZE", "secret-keysize" }, - { "REMOTE_ADDR", "ip" }, - { "REMOTE_HOST", "ip" } -}; -static size_t nsapi_client_size = sizeof(nsapi_client)/sizeof(nsapi_client[0]); - -/* this parameters to "Service"/"Error" are NSAPI ones which should not be php.ini keys and are excluded */ -static char *nsapi_exclude_from_ini_entries[] = { "fn", "type", "method", "directive", "code", "reason", "script", "bucket", NULL }; - -static char *nsapi_strdup(char *str) -{ - if (str != NULL) { - return STRDUP(str); - } - return NULL; -} - -static void nsapi_free(void *addr) -{ - if (addr != NULL) { - FREE(addr); - } -} - - -/*******************/ -/* PHP module part */ -/*******************/ - -PHP_MINIT_FUNCTION(nsapi); -PHP_MSHUTDOWN_FUNCTION(nsapi); -PHP_RINIT_FUNCTION(nsapi); -PHP_RSHUTDOWN_FUNCTION(nsapi); -PHP_MINFO_FUNCTION(nsapi); - -PHP_FUNCTION(nsapi_virtual); -PHP_FUNCTION(nsapi_request_headers); -PHP_FUNCTION(nsapi_response_headers); - -ZEND_BEGIN_MODULE_GLOBALS(nsapi) - long read_timeout; -ZEND_END_MODULE_GLOBALS(nsapi) - -ZEND_DECLARE_MODULE_GLOBALS(nsapi) - -#define NSAPI_G(v) TSRMG(nsapi_globals_id, zend_nsapi_globals *, v) - -/* {{{ nsapi_functions[] - * - * Every user visible function must have an entry in nsapi_functions[]. - */ -zend_function_entry nsapi_functions[] = { - PHP_FE(nsapi_virtual, NULL) /* Make subrequest */ - PHP_FALIAS(virtual, nsapi_virtual, NULL) /* compatibility */ - PHP_FE(nsapi_request_headers, NULL) /* get request headers */ - PHP_FALIAS(getallheaders, nsapi_request_headers, NULL) /* compatibility */ - PHP_FALIAS(apache_request_headers, nsapi_request_headers, NULL) /* compatibility */ - PHP_FE(nsapi_response_headers, NULL) /* get response headers */ - PHP_FALIAS(apache_response_headers, nsapi_response_headers, NULL) /* compatibility */ - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ nsapi_module_entry - */ -zend_module_entry nsapi_module_entry = { - STANDARD_MODULE_HEADER, - "nsapi", - nsapi_functions, - PHP_MINIT(nsapi), - PHP_MSHUTDOWN(nsapi), - NULL, - NULL, - PHP_MINFO(nsapi), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("nsapi.read_timeout", "60", PHP_INI_ALL, OnUpdateLong, read_timeout, zend_nsapi_globals, nsapi_globals) -PHP_INI_END() -/* }}} */ - -/* newer servers hide this functions from the programmer so redefine the functions dynamically - thanks to Chris Elving from Sun for the function declarations */ -typedef int (*nsapi_servact_prototype)(Session *sn, Request *rq); -nsapi_servact_prototype nsapi_servact_uri2path = NULL; -nsapi_servact_prototype nsapi_servact_pathchecks = NULL; -nsapi_servact_prototype nsapi_servact_fileinfo = NULL; -nsapi_servact_prototype nsapi_servact_service = NULL; - -#ifdef PHP_WIN32 -/* The following dll-names for nsapi are in use at this time. The undocumented - * servact_* functions are always in the newest one, older ones are supported by - * the server only by wrapping the function table nothing else. So choose - * the newest one found in process space for dynamic linking */ -static char *nsapi_dlls[] = { "ns-httpd40.dll", "ns-httpd36.dll", "ns-httpd35.dll", "ns-httpd30.dll", NULL }; -/* if user specifies an other dll name by server_lib parameter - * it is placed in the following variable and only this DLL is - * checked for the servact_* functions */ -char *nsapi_dll = NULL; -#endif - -/* {{{ php_nsapi_init_dynamic_symbols - */ -static void php_nsapi_init_dynamic_symbols(void) -{ -#if defined(servact_uri2path) && defined(servact_pathchecks) && defined(servact_fileinfo) && defined(servact_service) - /* use functions from nsapi.h if available */ - nsapi_servact_uri2path = &servact_uri2path; - nsapi_servact_pathchecks = &servact_pathchecks; - nsapi_servact_fileinfo = &servact_fileinfo; - nsapi_servact_service = &servact_service; -#else - /* find address of internal NSAPI functions */ -#ifdef PHP_WIN32 - register int i; - DL_HANDLE module = NULL; - if (nsapi_dll) { - /* try user specified server_lib */ - module = GetModuleHandle(nsapi_dll); - if (!module) { - log_error(LOG_WARN, "php5_init", NULL, NULL, "Cannot find DLL specified by server_lib parameter: %s", nsapi_dll); - } - } else { - /* find a LOADED dll module from nsapi_dlls */ - for (i=0; nsapi_dlls[i]; i++) { - if (module = GetModuleHandle(nsapi_dlls[i])) { - break; - } - } - } - if (!module) return; -#else - DL_HANDLE module = RTLD_DEFAULT; -#endif - nsapi_servact_uri2path = (nsapi_servact_prototype)DL_FETCH_SYMBOL(module, "INTservact_uri2path"); - nsapi_servact_pathchecks = (nsapi_servact_prototype)DL_FETCH_SYMBOL(module, "INTservact_pathchecks"); - nsapi_servact_fileinfo = (nsapi_servact_prototype)DL_FETCH_SYMBOL(module, "INTservact_fileinfo"); - nsapi_servact_service = (nsapi_servact_prototype)DL_FETCH_SYMBOL(module, "INTservact_service"); - if (!(nsapi_servact_uri2path && nsapi_servact_pathchecks && nsapi_servact_fileinfo && nsapi_servact_service)) { - /* not found - could be cause they are undocumented */ - nsapi_servact_uri2path = NULL; - nsapi_servact_pathchecks = NULL; - nsapi_servact_fileinfo = NULL; - nsapi_servact_service = NULL; - } -#endif -} -/* }}} */ - -/* {{{ php_nsapi_init_globals - */ -static void php_nsapi_init_globals(zend_nsapi_globals *nsapi_globals) -{ - nsapi_globals->read_timeout = 60; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(nsapi) -{ - php_nsapi_init_dynamic_symbols(); - ZEND_INIT_MODULE_GLOBALS(nsapi, php_nsapi_init_globals, NULL); - REGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(nsapi) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(nsapi) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "NSAPI Module Revision", "$Revision$"); - php_info_print_table_row(2, "Server Software", system_version()); - php_info_print_table_row(2, "Sub-requests with nsapi_virtual()", - (nsapi_servact_service)?((zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0))?"not supported with zlib.output_compression":"enabled"):"not supported on this platform" ); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* {{{ proto bool nsapi_virtual(string uri) - Perform an NSAPI sub-request */ -/* This function is equivalent to - * in SSI. It does an NSAPI sub-request. It is useful - * for including CGI scripts or .shtml files, or anything else - * that you'd parse through webserver. - */ -PHP_FUNCTION(nsapi_virtual) -{ - int uri_len,rv; - char *uri,*value; - Request *rq; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &uri, &uri_len) == FAILURE) { - return; - } - - if (!nsapi_servact_service) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Sub-requests not supported on this platform", uri); - RETURN_FALSE; - } else if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Sub-requests do not work with zlib.output_compression", uri); - RETURN_FALSE; - } else { - php_end_ob_buffers(1 TSRMLS_CC); - php_header(TSRMLS_C); - - /* do the sub-request */ - /* thanks to Chris Elving from Sun for this code sniplet */ - if ((rq = request_restart_internal(uri, NULL)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Internal request creation failed", uri); - RETURN_FALSE; - } - - /* insert host of current request to get page from same vhost */ - param_free(pblock_remove("host", rq->headers)); - if (value = pblock_findval("host", rc->rq->headers)) { - pblock_nvinsert("host", value, rq->headers); - } - - /* go through the normal request stages as given in obj.conf, - but leave out the logging/error section */ - do { - rv = (*nsapi_servact_uri2path)(rc->sn, rq); - if (rv != REQ_PROCEED) { - continue; - } - - rv = (*nsapi_servact_pathchecks)(rc->sn, rq); - if (rv != REQ_PROCEED) { - continue; - } - - rv = (*nsapi_servact_fileinfo)(rc->sn, rq); - if (rv != REQ_PROCEED) { - continue; - } - - rv = (*nsapi_servact_service)(rc->sn, rq); - } while (rv == REQ_RESTART); - - if (rq->status_num != 200) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - HTTP status code %d during subrequest", uri, rq->status_num); - request_free(rq); - RETURN_FALSE; - } - - request_free(rq); - - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto array nsapi_request_headers(void) - Get all headers from the request */ -PHP_FUNCTION(nsapi_request_headers) -{ - register int i; - struct pb_entry *entry; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - - for (i=0; i < rc->rq->headers->hsize; i++) { - entry=rc->rq->headers->ht[i]; - while (entry) { - if (!PG(safe_mode) || strncasecmp(entry->param->name, "authorization", 13)) { - add_assoc_string(return_value, entry->param->name, entry->param->value, 1); - } - entry=entry->next; - } - } -} -/* }}} */ - -/* {{{ proto array nsapi_response_headers(void) - Get all headers from the response */ -PHP_FUNCTION(nsapi_response_headers) -{ - register int i; - struct pb_entry *entry; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - - for (i=0; i < rc->rq->srvhdrs->hsize; i++) { - entry=rc->rq->srvhdrs->ht[i]; - while (entry) { - add_assoc_string(return_value, entry->param->name, entry->param->value, 1); - entry=entry->next; - } - } -} -/* }}} */ - - -/*************/ -/* SAPI part */ -/*************/ - -static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_DC) -{ - int retval; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - if (!SG(headers_sent)) { - sapi_send_headers(TSRMLS_C); - } - - retval = net_write(rc->sn->csd, (char *)str, str_length); - if (retval == IO_ERROR /* -1 */ || retval == IO_EOF /* 0 */) { - php_handle_aborted_connection(); - } - return retval; -} - -/* modified version of apache2 */ -static void sapi_nsapi_flush(void *server_context) -{ - nsapi_request_context *rc = (nsapi_request_context *)server_context; - TSRMLS_FETCH(); - - if (!SG(headers_sent)) { - sapi_send_headers(TSRMLS_C); - } - - /* flushing is only supported in iPlanet servers from version 6.1 on, make it conditional */ -#if NSAPI_VERSION >= 302 - if (net_flush(rc->sn->csd) < 0) { - php_handle_aborted_connection(); - } -#endif -} - -static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - if (p == NULL) { - efree(sapi_header->header); - return 0; - } - - *p = 0; - do { - header_content++; - } while (*header_content == ' '); - - if (!strcasecmp(header_name, "Content-Type")) { - param_free(pblock_remove("content-type", rc->rq->srvhdrs)); - pblock_nvinsert("content-type", header_content, rc->rq->srvhdrs); - } else { - /* to lower case because NSAPI reformats the headers and wants lowercase */ - for (p=header_name; *p; p++) { - *p=tolower(*p); - } - if (sapi_header->replace) param_free(pblock_remove(header_name, rc->rq->srvhdrs)); - pblock_nvinsert(header_name, header_content, rc->rq->srvhdrs); - } - - sapi_free_header(sapi_header); - - return 0; /* don't use the default SAPI mechanism, NSAPI duplicates this functionality */ -} - -static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - int retval; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - if (SG(sapi_headers).send_default_content_type) { - char *hd; - param_free(pblock_remove("content-type", rc->rq->srvhdrs)); - hd = sapi_get_default_content_type(TSRMLS_C); - pblock_nvinsert("content-type", hd, rc->rq->srvhdrs); - efree(hd); - } - - protocol_status(rc->sn, rc->rq, SG(sapi_headers).http_response_code, NULL); - retval = protocol_start_response(rc->sn, rc->rq); - - if (retval == REQ_PROCEED || retval == REQ_NOACTION) { - return SAPI_HEADER_SENT_SUCCESSFULLY; - } else { - return SAPI_HEADER_SEND_FAILED; - } -} - -static int sapi_nsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - char *read_ptr = buffer, *content_length_str = NULL; - uint bytes_read = 0; - int length, content_length = 0; - netbuf *nbuf = rc->sn->inbuf; - - /* - * Yesss! - */ - count_bytes = MIN(count_bytes, SG(request_info).content_length-rc->read_post_bytes); - content_length = SG(request_info).content_length; - - if (content_length <= 0) { - return 0; - } - - /* - * Gobble any pending data in the netbuf. - */ - length = nbuf->cursize - nbuf->pos; - length = MIN(count_bytes, length); - if (length > 0) { - memcpy(read_ptr, nbuf->inbuf + nbuf->pos, length); - bytes_read += length; - read_ptr += length; - content_length -= length; - nbuf->pos += length; - } - - /* - * Read the remaining from the socket. - */ - while (content_length > 0 && bytes_read < count_bytes) { - int bytes_to_read = count_bytes - bytes_read; - - if (content_length < bytes_to_read) { - bytes_to_read = content_length; - } - - length = net_read(rc->sn->csd, read_ptr, bytes_to_read, NSAPI_G(read_timeout)); - - if (length == IO_ERROR || length == IO_EOF) { - break; - } - - bytes_read += length; - read_ptr += length; - content_length -= length; - } - - if ( bytes_read > 0 ) { - rc->read_post_bytes += bytes_read; - } - return bytes_read; -} - -static char *sapi_nsapi_read_cookies(TSRMLS_D) -{ - char *cookie_string; - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - cookie_string = pblock_findval("cookie", rc->rq->headers); - return cookie_string; -} - -static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_DC) -{ - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - register size_t i; - int pos; - char *value,*p; - char buf[32]; - struct pb_entry *entry; - - for (i = 0; i < nsapi_reqpb_size; i++) { - value = pblock_findval(nsapi_reqpb[i].nsapi_eq, rc->rq->reqpb); - if (value) { - php_register_variable((char *)nsapi_reqpb[i].env_var, value, track_vars_array TSRMLS_CC); - } - } - - for (i=0; i < rc->rq->headers->hsize; i++) { - entry=rc->rq->headers->ht[i]; - while (entry) { - if (!PG(safe_mode) || strncasecmp(entry->param->name, "authorization", 13)) { - if (strcasecmp(entry->param->name, "content-length")==0 || strcasecmp(entry->param->name, "content-type")==0) { - value=estrdup(entry->param->name); - pos = 0; - } else { - spprintf(&value, 0, "HTTP_%s", entry->param->name); - pos = 5; - } - if (value) { - for(p = value + pos; *p; p++) { - *p = toupper(*p); - if (*p < 'A' || *p > 'Z') { - *p = '_'; - } - } - php_register_variable(value, entry->param->value, track_vars_array TSRMLS_CC); - efree(value); - } - } - entry=entry->next; - } - } - - for (i = 0; i < nsapi_vars_size; i++) { - value = pblock_findval(nsapi_vars[i].nsapi_eq, rc->rq->vars); - if (value) { - php_register_variable((char *)nsapi_vars[i].env_var, value, track_vars_array TSRMLS_CC); - } - } - - for (i = 0; i < nsapi_client_size; i++) { - value = pblock_findval(nsapi_client[i].nsapi_eq, rc->sn->client); - if (value) { - php_register_variable((char *)nsapi_client[i].env_var, value, track_vars_array TSRMLS_CC); - } - } - - if (value = session_dns(rc->sn)) { - php_register_variable("REMOTE_HOST", value, track_vars_array TSRMLS_CC); - nsapi_free(value); - } - - slprintf(buf, sizeof(buf), "%d", conf_getglobals()->Vport); - php_register_variable("SERVER_PORT", buf, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_NAME", conf_getglobals()->Vserver_hostname, track_vars_array TSRMLS_CC); - - value = http_uri2url_dynamic("", "", rc->sn, rc->rq); - php_register_variable("SERVER_URL", value, track_vars_array TSRMLS_CC); - nsapi_free(value); - - php_register_variable("SERVER_SOFTWARE", system_version(), track_vars_array TSRMLS_CC); - php_register_variable("HTTPS", (security_active ? "ON" : "OFF"), track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - - /* DOCUMENT_ROOT */ - if (value = request_translate_uri("/", rc->sn)) { - value[strlen(value) - 1] = '\0'; - php_register_variable("DOCUMENT_ROOT", value, track_vars_array TSRMLS_CC); - nsapi_free(value); - } - - /* PATH_INFO / PATH_TRANSLATED */ - if (rc->path_info) { - if (value = request_translate_uri(rc->path_info, rc->sn)) { - php_register_variable("PATH_TRANSLATED", value, track_vars_array TSRMLS_CC); - nsapi_free(value); - } - php_register_variable("PATH_INFO", rc->path_info, track_vars_array TSRMLS_CC); - } - - /* Create full Request-URI & Script-Name */ - if (SG(request_info).request_uri) { - if (SG(request_info).query_string) { - spprintf(&value, 0, "%s?%s", SG(request_info).request_uri, SG(request_info).query_string); - if (value) { - php_register_variable("REQUEST_URI", value, track_vars_array TSRMLS_CC); - efree(value); - } - } else { - php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - } - - if (value = nsapi_strdup(SG(request_info).request_uri)) { - if (rc->path_info) { - pos = strlen(SG(request_info).request_uri) - strlen(rc->path_info); - if (pos>=0) { - value[pos] = '\0'; - } else { - value[0]='\0'; - } - } - php_register_variable("SCRIPT_NAME", value, track_vars_array TSRMLS_CC); - nsapi_free(value); - } - } - php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array TSRMLS_CC); - - /* special variables in error mode */ - if (rc->http_error) { - slprintf(buf, sizeof(buf), "%d", rc->http_error); - php_register_variable("ERROR_TYPE", buf, track_vars_array TSRMLS_CC); - } -} - -static void nsapi_log_message(char *message) -{ - TSRMLS_FETCH(); - nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - - if (rc) { - log_error(LOG_INFORM, pblock_findval("fn", rc->pb), rc->sn, rc->rq, "%s", message); - } else { - log_error(LOG_INFORM, "php5", NULL, NULL, "%s", message); - } -} - -static time_t sapi_nsapi_get_request_time(TSRMLS_D) -{ - return REQ_TIME( ((nsapi_request_context *)SG(server_context))->rq ); -} - -static int php_nsapi_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &nsapi_module_entry, 1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - -static struct stat* sapi_nsapi_get_stat(TSRMLS_D) -{ - return request_stat_path( - SG(request_info).path_translated, - ((nsapi_request_context *)SG(server_context))->rq - ); -} - -static sapi_module_struct nsapi_sapi_module = { - "nsapi", /* name */ - "NSAPI", /* pretty name */ - - php_nsapi_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_nsapi_ub_write, /* unbuffered write */ - sapi_nsapi_flush, /* flush */ - sapi_nsapi_get_stat, /* get uid/stat */ - NULL, /* getenv */ - - php_error, /* error handler */ - - sapi_nsapi_header_handler, /* header handler */ - sapi_nsapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - sapi_nsapi_read_post, /* read POST data */ - sapi_nsapi_read_cookies, /* read Cookies */ - - sapi_nsapi_register_server_variables, /* register server variables */ - nsapi_log_message, /* Log message */ - sapi_nsapi_get_request_time, /* Get request time */ - - NULL, /* Block interruptions */ - NULL, /* Unblock interruptions */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static void nsapi_php_ini_entries(NSLS_D TSRMLS_DC) -{ - struct pb_entry *entry; - register int i,j,ok; - - for (i=0; i < NSG(pb)->hsize; i++) { - entry=NSG(pb)->ht[i]; - while (entry) { - /* exclude standard entries given to "Service" which should not go into ini entries */ - ok=1; - for (j=0; nsapi_exclude_from_ini_entries[j]; j++) { - ok&=(strcasecmp(entry->param->name, nsapi_exclude_from_ini_entries[j])!=0); - } - - if (ok) { - /* change the ini entry */ - if (zend_alter_ini_entry(entry->param->name, strlen(entry->param->name)+1, - entry->param->value, strlen(entry->param->value), - PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE)==FAILURE) { - log_error(LOG_WARN, pblock_findval("fn", NSG(pb)), NSG(sn), NSG(rq), "Cannot change php.ini key \"%s\" to \"%s\"", entry->param->name, entry->param->value); - } - } - entry=entry->next; - } - } -} - -void NSAPI_PUBLIC php5_close(void *vparam) -{ - if (nsapi_sapi_module.shutdown) { - nsapi_sapi_module.shutdown(&nsapi_sapi_module); - } - - if (nsapi_sapi_module.php_ini_path_override) { - free(nsapi_sapi_module.php_ini_path_override); - } - -#ifdef PHP_WIN32 - if (nsapi_dll) { - free(nsapi_dll); - nsapi_dll = NULL; - } -#endif - - tsrm_shutdown(); - - log_error(LOG_INFORM, "php5_close", NULL, NULL, "Shutdown PHP Module"); -} - -/********************************************************* -/ init SAF -/ -/ Init fn="php5_init" [php_ini="/path/to/php.ini"] [server_lib="ns-httpdXX.dll"] -/ Initialize the NSAPI module in magnus.conf -/ -/ php_ini: gives path to php.ini file -/ server_lib: (only Win32) gives name of DLL (without path) to look for -/ servact_* functions -/ -/*********************************************************/ -int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) -{ - php_core_globals *core_globals; - char *strval; - int threads=128; /* default for server */ - - /* fetch max threads from NSAPI and initialize TSRM with it */ - threads=conf_getglobals()->Vpool_maxthreads; - if (threads<1) { - threads=128; /* default for server */ - } - tsrm_startup(threads, 1, 0, NULL); - - core_globals = ts_resource(core_globals_id); - - /* look if php_ini parameter is given to php5_init */ - if (strval = pblock_findval("php_ini", pb)) { - nsapi_sapi_module.php_ini_path_override = strdup(strval); - } - -#ifdef PHP_WIN32 - /* look if server_lib parameter is given to php5_init - * (this disables the automatic search for the newest ns-httpdXX.dll) */ - if (strval = pblock_findval("server_lib", pb)) { - nsapi_dll = strdup(strval); - } -#endif - - /* start SAPI */ - sapi_startup(&nsapi_sapi_module); - nsapi_sapi_module.startup(&nsapi_sapi_module); - - daemon_atrestart(&php5_close, NULL); - - log_error(LOG_INFORM, pblock_findval("fn", pb), sn, rq, "Initialized PHP Module (%d threads expected)", threads); - return REQ_PROCEED; -} - -/********************************************************* -/ normal use in Service directive: -/ -/ Service fn="php5_execute" type=... method=... [inikey=inivalue inikey=inivalue...] -/ -/ use in Service for a directory to supply a php-made directory listing instead of server default: -/ -/ Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] -/ -/ use in Error SAF to display php script as error page: -/ -/ Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] -/ Error fn="php5_execute" reason="Reason" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] -/ -/*********************************************************/ -int NSAPI_PUBLIC php5_execute(pblock *pb, Session *sn, Request *rq) -{ - int retval; - nsapi_request_context *request_context; - zend_file_handle file_handle = {0}; - struct stat *fst; - - char *path_info; - char *query_string = pblock_findval("query", rq->reqpb); - char *uri = pblock_findval("uri", rq->reqpb); - char *request_method = pblock_findval("method", rq->reqpb); - char *content_type = pblock_findval("content-type", rq->headers); - char *content_length = pblock_findval("content-length", rq->headers); - char *directive = pblock_findval("Directive", pb); - int error_directive = (directive && !strcasecmp(directive, "error")); - int fixed_script = 1; - - /* try to use script parameter -> Error or Service for directory listing */ - char *path_translated = pblock_findval("script", pb); - - TSRMLS_FETCH(); - - /* if script parameter is missing: normal use as Service SAF */ - if (!path_translated) { - path_translated = pblock_findval("path", rq->vars); - path_info = pblock_findval("path-info", rq->vars); - fixed_script = 0; - if (error_directive) { - /* go to next error directive if script parameter is missing */ - log_error(LOG_WARN, pblock_findval("fn", pb), sn, rq, "Missing 'script' parameter"); - return REQ_NOACTION; - } - } else { - /* in error the path_info is the uri to the requested page */ - path_info = pblock_findval("uri", rq->reqpb); - } - - /* check if this uri was included in an other PHP script with nsapi_virtual() - by looking for a request context in the current thread */ - if (SG(server_context)) { - /* send 500 internal server error */ - log_error(LOG_WARN, pblock_findval("fn", pb), sn, rq, "Cannot make nesting PHP requests with nsapi_virtual()"); - if (error_directive) { - return REQ_NOACTION; - } else { - protocol_status(sn, rq, 500, NULL); - return REQ_ABORTED; - } - } - - request_context = (nsapi_request_context *)MALLOC(sizeof(nsapi_request_context)); - request_context->pb = pb; - request_context->sn = sn; - request_context->rq = rq; - request_context->read_post_bytes = 0; - request_context->fixed_script = fixed_script; - request_context->http_error = (error_directive) ? rq->status_num : 0; - request_context->path_info = nsapi_strdup(path_info); - - SG(server_context) = request_context; - SG(request_info).query_string = nsapi_strdup(query_string); - SG(request_info).request_uri = nsapi_strdup(uri); - SG(request_info).request_method = nsapi_strdup(request_method); - SG(request_info).path_translated = nsapi_strdup(path_translated); - SG(request_info).content_type = nsapi_strdup(content_type); - SG(request_info).content_length = (content_length == NULL) ? 0 : strtoul(content_length, 0, 0); - SG(sapi_headers).http_response_code = (error_directive) ? rq->status_num : 200; - - nsapi_php_ini_entries(NSLS_C TSRMLS_CC); - - if (!PG(safe_mode)) php_handle_auth_data(pblock_findval("authorization", rq->headers) TSRMLS_CC); - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - fst = request_stat_path(SG(request_info).path_translated, rq); - if (fst && S_ISREG(fst->st_mode)) { - if (php_request_startup(TSRMLS_C) == SUCCESS) { - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - retval=REQ_PROCEED; - } else { - /* send 500 internal server error */ - log_error(LOG_WARN, pblock_findval("fn", pb), sn, rq, "Cannot prepare PHP engine!"); - if (error_directive) { - retval=REQ_NOACTION; - } else { - protocol_status(sn, rq, 500, NULL); - retval=REQ_ABORTED; - } - } - } else { - /* send 404 because file not found */ - log_error(LOG_WARN, pblock_findval("fn", pb), sn, rq, "Cannot execute PHP script: %s (File not found)", SG(request_info).path_translated); - if (error_directive) { - retval=REQ_NOACTION; - } else { - protocol_status(sn, rq, 404, NULL); - retval=REQ_ABORTED; - } - } - - nsapi_free(request_context->path_info); - nsapi_free(SG(request_info).query_string); - nsapi_free(SG(request_info).request_uri); - nsapi_free((void*)(SG(request_info).request_method)); - nsapi_free(SG(request_info).path_translated); - nsapi_free((void*)(SG(request_info).content_type)); - - FREE(request_context); - SG(server_context) = NULL; - - return retval; -} - -/********************************************************* -/ authentication -/ -/ we have to make a 'fake' authenticator for netscape so it -/ will pass authentication through to php, and allow us to -/ check authentication with our scripts. -/ -/ php5_auth_trans -/ main function called from netscape server to authenticate -/ a line in obj.conf: -/ funcs=php5_auth_trans shlib="path/to/this/phpnsapi.dll" -/ and: -/ -/ AuthTrans fn="php5_auth_trans" -/*********************************************************/ -int NSAPI_PUBLIC php5_auth_trans(pblock * pb, Session * sn, Request * rq) -{ - /* This is a DO NOTHING function that allows authentication - * information - * to be passed through to PHP scripts. - */ - return REQ_PROCEED; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/nsapi/php5nsapi.dsp b/sapi/nsapi/php5nsapi.dsp deleted file mode 100644 index 6cd0079b43a10..0000000000000 --- a/sapi/nsapi/php5nsapi.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5nsapi" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5nsapi - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5nsapi.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5nsapi.mak" CFG="php5nsapi - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5nsapi - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5nsapi - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5nsapi - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5nsapi - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5nsapi___Win32_Release_TS" -# PROP BASE Intermediate_Dir "php5nsapi___Win32_Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "NDEBUG" /D "XP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 ns-httpd30.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\Zend\Release_TS" - -!ELSEIF "$(CFG)" == "php5nsapi - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5nsapi___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5nsapi___Win32_Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "NDEBUG" /D "XP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 ns-httpd30.lib php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /machine:I386 /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\TSRM\Release_TS_inline" /libpath:"..\..\Zend\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5nsapi - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "php5nsapi___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "php5nsapi___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\..\php_build\nsapi30\include\\" /I "..\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\..\bindlib_w32" /I "..\..\main" /I "..\..\tsrm" /D "_Debug_TS" /D ZEND_DEBUG=1 /D "_DEBUG" /D "XP_WIN32" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_USRDLL" /D "php5nsapi_EXPORTS" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ns-httpd30.lib php5ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x62000000" /version:4.0 /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php_build\nsapi30\lib\\" /libpath:"..\..\Debug_TS" /libpath:"..\..\TSRM\Debug_TS" /libpath:"..\..\Zend\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "php5nsapi - Win32 Release_TS" -# Name "php5nsapi - Win32 Release_TS_inline" -# Name "php5nsapi - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\nsapi.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/sapi/phttpd/CREDITS b/sapi/phttpd/CREDITS deleted file mode 100644 index 134cc54825cdb..0000000000000 --- a/sapi/phttpd/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -phttpd -Thies C. Arntzen diff --git a/sapi/phttpd/README b/sapi/phttpd/README deleted file mode 100644 index cdb6f7c381da7..0000000000000 --- a/sapi/phttpd/README +++ /dev/null @@ -1,5 +0,0 @@ -phttpd sapi module. - -THIS IS BY NO MEANS COMPLETE NOR USABLE RIGHT NOW! - -thies@thieso.net 03.01.2000 diff --git a/sapi/phttpd/config.m4 b/sapi/phttpd/config.m4 deleted file mode 100644 index 91339a5278050..0000000000000 --- a/sapi/phttpd/config.m4 +++ /dev/null @@ -1,21 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(phttpd, for PHTTPD support, -[ --with-phttpd=DIR Build PHP as phttpd module], no, no) - -if test "$PHP_PHTTPD" != "no"; then - if test ! -d $PHP_PHTTPD ; then - AC_MSG_ERROR([You did not specify a directory]) - fi - PHP_BUILD_THREAD_SAFE - PHP_ADD_INCLUDE($PHP_PHTTPD/include) - AC_DEFINE(HAVE_PHTTPD, 1, [Whether you have phttpd]) - PHP_SELECT_SAPI(phttpd, shared, phttpd.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_PHTTPD/modules/" -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/phttpd/php.sym b/sapi/phttpd/php.sym deleted file mode 100644 index f10b883a9930c..0000000000000 --- a/sapi/phttpd/php.sym +++ /dev/null @@ -1,4 +0,0 @@ -pm_init -pm_exit -pm_request - diff --git a/sapi/phttpd/php_phttpd.h b/sapi/phttpd/php_phttpd.h deleted file mode 100644 index 04eb9bc20a1ad..0000000000000 --- a/sapi/phttpd/php_phttpd.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Thies C. Arntzen | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_PHTTPD_H -#define PHP_PHTTPD_H - -#include - -#endif diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c deleted file mode 100644 index ed4b3fd57f6b5..0000000000000 --- a/sapi/phttpd/phttpd.c +++ /dev/null @@ -1,306 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Thies C. Arntzen | - | Based on aolserver SAPI by Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -#include "php.h" -#include "SAPI.h" -#include "php_main.h" - -#ifdef HAVE_PHTTPD - -#include "ext/standard/info.h" - -#ifndef ZTS -#error PHTTPD module is only useable in thread-safe mode -#endif - -#include "php_phttpd.h" - -typedef struct { - struct connectioninfo *cip; - struct stat sb; -} phttpd_globals_struct; - -static int ph_globals_id; - -#define PHG(v) TSRMG(ph_globals_id, phttpd_globals_struct *, v) - -static int -php_phttpd_startup(sapi_module_struct *sapi_module) -{ - fprintf(stderr,"***php_phttpd_startup\n"); - - if (php_module_startup(sapi_module, NULL, 0)) { - return FAILURE; - } else { - return SUCCESS; - } -} - -static int -php_phttpd_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int sent_bytes; - - sent_bytes = fd_write(PHG(cip)->fd, str, str_length); - - if (sent_bytes == -1) { - php_handle_aborted_connection(); - } - - return sent_bytes; -} - -static int -php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content; - char *p; - TSRMLS_FETCH(); - - http_sendheaders(PHG(cip)->fd, PHG(cip), SG(sapi_headers).http_response_code, NULL); - - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - - if (p) { - *p = '\0'; - do { - header_content++; - } while (*header_content == ' '); - - fd_printf(PHG(cip)->fd,"%s: %s\n", header_name, header_content); - - *p = ':'; - } - - sapi_free_header(sapi_header); - - return 0; -} - -static int -php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - TSRMLS_FETCH(); - - if (SG(sapi_headers).send_default_content_type) { - fd_printf(PHG(cip)->fd,"Content-Type: text/html\n"); - } - - fd_putc('\n', PHG(cip)->fd); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static char * -php_phttpd_sapi_read_cookies(TSRMLS_D) -{ - -/* - int i; - char *http_cookie = NULL; - NTSRMLS_FETCH(); - - i = Ns_SetIFind(NSG(conn->headers), "cookie"); - if(i != -1) { - http_cookie = Ns_SetValue(NSG(conn->headers), i); - } - - return http_cookie; -*/ - fprintf(stderr,"***php_phttpd_sapi_read_cookies\n"); - - return 0; -} - -static int -php_phttpd_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ -/* - uint max_read; - uint total_read = 0; - NTSRMLS_FETCH(); - - max_read = MIN(NSG(data_avail), count_bytes); - - total_read = Ns_ConnRead(NSG(conn), buf, max_read); - - if(total_read == NS_ERROR) { - total_read = -1; - } else { - NSG(data_avail) -= total_read; - } - - return total_read; -*/ - fprintf(stderr,"***php_phttpd_sapi_read_post\n"); - return 0; -} - -static sapi_module_struct phttpd_sapi_module = { - "phttpd", - "PHTTPD", - - php_phttpd_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - php_phttpd_sapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - php_phttpd_sapi_header_handler, /* header handler */ - php_phttpd_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - - php_phttpd_sapi_read_post, /* read POST data */ - php_phttpd_sapi_read_cookies, /* read Cookies */ - - NULL, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static void -php_phttpd_request_ctor(TSRMLS_D TSRMLS_DC) -{ - memset(&SG(request_info), 0, sizeof(sapi_globals_struct)); /* pfusch! */ - - SG(request_info).query_string = PHG(cip)->hip->request; - SG(request_info).request_method = PHG(cip)->hip->method; - SG(request_info).path_translated = malloc(MAXPATHLEN); - SG(sapi_headers).http_response_code = 200; - if (url_expand(PHG(cip)->hip->url, SG(request_info).path_translated, MAXPATHLEN, &PHG(sb), NULL, NULL) == NULL) { - /* handle error */ - } - -#if 0 - char *server; - Ns_DString ds; - char *root; - int index; - char *tmp; - - server = Ns_ConnServer(NSG(conn)); - - Ns_DStringInit(&ds); - Ns_UrlToFile(&ds, server, NSG(conn->request->url)); - - /* path_translated is the absolute path to the file */ - SG(request_info).path_translated = strdup(Ns_DStringValue(&ds)); - Ns_DStringFree(&ds); - root = Ns_PageRoot(server); - SG(request_info).request_uri = SG(request_info).path_translated + strlen(root); - SG(request_info).content_length = Ns_ConnContentLength(NSG(conn)); - index = Ns_SetIFind(NSG(conn)->headers, "content-type"); - SG(request_info).content_type = index == -1 ? NULL : - Ns_SetValue(NSG(conn)->headers, index); - - tmp = Ns_ConnAuthUser(NSG(conn)); - if(tmp) { - tmp = estrdup(tmp); - } - SG(request_info).auth_user = tmp; - - tmp = Ns_ConnAuthPasswd(NSG(conn)); - if(tmp) { - tmp = estrdup(tmp); - } - SG(request_info).auth_password = tmp; - - NSG(data_avail) = SG(request_info).content_length; -#endif -} - -static void -php_phttpd_request_dtor(TSRMLS_D TSRMLS_DC) -{ - free(SG(request_info).path_translated); -} - - -int php_doit(TSRMLS_D TSRMLS_DC) -{ - struct stat sb; - zend_file_handle file_handle; - struct httpinfo *hip = PHG(cip)->hip; - TSRMLS_FETCH(); - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return -1; - } - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - -/* - php_phttpd_hash_environment(TSRMLS_C); -*/ - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - - return SG(sapi_headers).http_response_code; -} - -int pm_init(const char **argv) -{ - tsrm_startup(1, 1, 0, NULL); - sapi_startup(&phttpd_sapi_module); - phttpd_sapi_module.startup(&phttpd_sapi_module); - - ts_allocate_id(&ph_globals_id, sizeof(phttpd_globals_struct), NULL, NULL); - - return 0; -} - -void pm_exit(void) -{ - fprintf(stderr,"***pm_exit\n"); -} - -int pm_request(struct connectioninfo *cip) -{ - struct httpinfo *hip = cip->hip; - int status; - TSRMLS_FETCH(); - - if (strcasecmp(hip->method, "GET") == 0 || - strcasecmp(hip->method, "HEAD") == 0 || - strcasecmp(hip->method, "POST") == 0) { - PHG(cip) = cip; - - php_phttpd_request_ctor(TSRMLS_C); - status = php_doit(TSRMLS_C); - php_phttpd_request_dtor(TSRMLS_C); - - return status; - } else { - return -2; - } -} - -#endif diff --git a/sapi/pi3web/CREDITS b/sapi/pi3web/CREDITS deleted file mode 100644 index c4541f89da76b..0000000000000 --- a/sapi/pi3web/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -pi3web -Holger Zimmermann diff --git a/sapi/pi3web/README b/sapi/pi3web/README deleted file mode 100644 index e3e523e94047d..0000000000000 --- a/sapi/pi3web/README +++ /dev/null @@ -1,50 +0,0 @@ -PHP5 Module -========== -This module requires PHP5 as thread safe shared library. Have a look -into the INSTALL file which accompanies that distribution. - -If you distribute this software bundled with the PHP software in source -or binary form, then you must adhere to the PHP copyright conditions - -the terms are reasonable. - -You should have checked out and built the PHP5 source package from the -PHP CVS tree into the Pi3Web source directory called 'PHP5' first. Then -build PHP5 as Pi3Web module and after that build the Pi3Web PHP5 wrapper: - -1. Checkout PHP5 -================ -cvs -d :pserver:cvsread@cvs.php.net:/repository login -The required password is phpfi - -cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co php5 - -You must also checkout the TSRM and the ZEND module from the ZEND cvs tree -into the PHP5 root directory - -cvs -d :pserver:cvsread@cvs.zend.com:/repository login -The required password is zend - -cvs -z3 -d :pserver:cvsread@cvs.zend.com:/repository co Zend TSRM - -2. Build PHP5 -============= -2.1 POSIX ---------- -cd ./php5 -./buildconf -./configure --with-pi3web -make - -2.2 Win32 ---------- -other required downloads from the php website - - bison 1.25 - - bindlib32 - - number4.tar.gz -nmake php5dllts.mak - -3. Build Pi3Web PHP5 wrapper -============================ -Run make in the Pi3Web /Source/PHP5 directory. - -For further information refer to http://www.php.net/version4/ diff --git a/sapi/pi3web/config.m4 b/sapi/pi3web/config.m4 deleted file mode 100644 index 7859481508bb0..0000000000000 --- a/sapi/pi3web/config.m4 +++ /dev/null @@ -1,27 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(pi3web, for Pi3Web support, -[ --with-pi3web[=DIR] Build PHP as Pi3Web module], no, no) - -if test "$PHP_PI3WEB" != "no"; then - if test "$PHP_PI3WEB" = "yes"; then - PI3PATH=../.. # the default - else - PI3PATH=$PHP_PI3WEB - fi - test -f "$PI3PATH/PiAPI/PiAPI.h" || AC_MSG_ERROR([Unable to find PiAPI.h in $PI3PATH/PiAPI]) - PHP_BUILD_THREAD_SAFE - AC_DEFINE(WITH_PI3WEB, 1, [whether you want Pi3Web support]) - PHP_ADD_INCLUDE($PI3PATH/PiAPI) - PHP_ADD_INCLUDE($PI3PATH/Pi2API) - PHP_ADD_INCLUDE($PI3PATH/Pi3API) - PHP_ADD_INCLUDE($PI3PATH/PHP5) - PHP_SELECT_SAPI(pi3web, shared, pi3web_sapi.c) - INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PI3PATH/bin/" -fi - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/pi3web/config.w32 b/sapi/pi3web/config.w32 deleted file mode 100644 index a5393e621ba22..0000000000000 --- a/sapi/pi3web/config.w32 +++ /dev/null @@ -1,16 +0,0 @@ -// vim:ft=javascript -// $Id$ - -ARG_WITH('pi3web', 'Pi3Web', 'no'); - -if (PHP_PI3WEB != "no") { - if (CHECK_HEADER_ADD_INCLUDE('PiAPI.h', 'CFLAGS_PI3WEB', PHP_PHP_BUILD + "\\Pi3Web\\include;" + PHP_PI3WEB) && - CHECK_LIB('piapi.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB) && - CHECK_LIB('pi2api.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB) && - CHECK_LIB('pi3api.lib', 'pi3web', PHP_PHP_BUILD + "\\Pi3Web\\lib;" + PHP_PI3WEB)) { - SAPI('pi3web', 'pi3web_sapi.c', 'php' + PHP_VERSION + 'pi3web.dll', '/D PHP5PI3WEB_EXPORTS'); - AC_DEFINE('WITH_PI3WEB', 1); - } else { - WARNING('Pi3Web not enabled; headers/libraries not found'); - } -} diff --git a/sapi/pi3web/php.sym b/sapi/pi3web/php.sym deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/sapi/pi3web/php5pi3web.dsp b/sapi/pi3web/php5pi3web.dsp deleted file mode 100644 index bb5a2488022a5..0000000000000 --- a/sapi/pi3web/php5pi3web.dsp +++ /dev/null @@ -1,136 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5pi3web" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5pi3web - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5pi3web.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5pi3web.mak" CFG="php5pi3web - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5pi3web - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5pi3web - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5pi3web - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5pi3web - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5pi3web_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /I "..\..\..\..\PIAPI" /I "..\..\..\..\PI2API" /I "..\..\..\..\PI3API" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP5PI3WEB_EXPORTS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php5ts_debug.lib kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\..\PIAPI" /libpath:"..\..\..\..\PI2API" /libpath:"..\..\..\..\PI3API" - -!ELSEIF "$(CFG)" == "php5pi3web - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "php5pi3web_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /I "..\..\..\..\PIAPI" /I "..\..\..\..\PI2API" /I "..\..\..\..\PI3API" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP5PI3WEB_EXPORTS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\..\..\PIAPI" /libpath:"..\..\..\..\PI2API" /libpath:"..\..\..\..\PI3API" - -!ELSEIF "$(CFG)" == "php5pi3web - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5pi3web___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5pi3web___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\ext\mysql\libmysql" /I "..\..\..\PiAPI" /I "..\..\..\Pi2API" /I "..\..\..\Pi3API" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "...\..\include" /I "..\..\win32" /I "..\..\Zend" /I "..\.." /I "..\..\main" /I "..\..\TSRM" /I "..\..\..\..\PIAPI" /I "..\..\..\..\PI2API" /I "..\..\..\..\PI3API" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "PHP5PI3WEB_EXPORTS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib libmysql.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\ext\mysql\libmysql\Release_TS" /libpath:"Release_TS" /libpath:"..\..\..\PiAPI" /libpath:"..\..\..\Pi2API" /libpath:"..\..\..\Pi3API" -# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib PiAPI.lib Pi2API.lib Pi3API.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /libpath:"..\..\Release_TS_inline" /libpath:"..\..\..\..\PIAPI" /libpath:"..\..\..\..\PI2API" /libpath:"..\..\..\..\PI3API" - -!ENDIF - -# Begin Target - -# Name "php5pi3web - Win32 Debug_TS" -# Name "php5pi3web - Win32 Release_TS" -# Name "php5pi3web - Win32 Release_TS_inline" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=.\pi3web_sapi.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=.\pi3web_sapi.h -# End Source File -# End Group -# End Target -# End Project diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c deleted file mode 100644 index 6365f5ee07713..0000000000000 --- a/sapi/pi3web/pi3web_sapi.c +++ /dev/null @@ -1,438 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Pi3Web version 2.0 | - +----------------------------------------------------------------------+ - | This file is committed by the Pi3 development group. | - | (pi3web.sourceforge.net) | - | | - | Author: Holger Zimmermann (zimpel@users.sourceforge.net) | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS - -#include "php.h" -#include "php_main.h" -#include "php_variables.h" -#include "SAPI.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "zend_highlight.h" -#include "zend_indent.h" -#include "zend_alloc.h" -#include "ext/standard/basic_functions.h" -#include "TSRM/TSRM.h" -#include "PiAPI.h" -#include "Pi3API.h" - -#include "pi3web_sapi.h" - -#define PI3WEB_SERVER_VAR_BUF_SIZE 1024 - -int IWasLoaded=0; - - -static void php_info_pi3web(ZEND_MODULE_INFO_FUNC_ARGS) -{ - char variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE]; - DWORD variable_len; - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - PIDB *pDB = (PIDB *)lpCB->GetVariableNames(lpCB->ConnID); - PIDBIterator *pIter = PIDB_getIterator( pDB, PIDBTYPE_STRING, 0, 0 ); - - PUTS("\n"); - PUTS("\n"); - php_info_print_table_header(2, "Information Field", "Value"); - php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id$"); - php_info_print_table_row(2, "Server Name Stamp", HTTPCore_getServerStamp()); - snprintf(variable_buf, 511, "%d", HTTPCore_debugEnabled()); - php_info_print_table_row(2, "Debug Enabled", variable_buf); - PIPlatform_getCurrentDirectory( variable_buf, PI3WEB_SERVER_VAR_BUF_SIZE); - php_info_print_table_row(2, "Current Path", variable_buf); - if (lpCB->GetServerVariable(lpCB->ConnID, "SERVER_NAME", variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, "Main Virtual Hostname", variable_buf); - }; - snprintf(variable_buf, 511, "%d", PIPlatform_getProcessId()); - php_info_print_table_row(2, "Server PID", variable_buf); - php_info_print_table_row(2, "Server Platform", PIPlatform_getDescription()); - - PUTS("
Pi3Web Server Information

"); - - PUTS("\n"); - PUTS("\n"); - php_info_print_table_row(2, "HTTP Request Line", lpCB->lpszReq); - PUTS("\n"); - php_info_print_table_header(2, "Server Variable", "Value"); - - /* --- loop over all registered server variables --- */ - for(; pIter && PIDBIterator_atValidElement( pIter ); PIDBIterator_next( pIter ) ) - { - PCHAR pKey; - PIDBIterator_current( pIter, &pKey ); - if ( !pKey ) { /* sanity */ continue; }; - - variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - if (lpCB->GetServerVariable(lpCB->ConnID, pKey, variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, pKey, variable_buf); - } else if (PIPlatform_getLastError() == PIAPI_EINVAL) { - char *tmp_variable_buf; - - tmp_variable_buf = (char *) emalloc(variable_len); - if (lpCB->GetServerVariable(lpCB->ConnID, pKey, tmp_variable_buf, &variable_len) - && variable_buf[0]) { - php_info_print_table_row(2, pKey, tmp_variable_buf); - } - efree(tmp_variable_buf); - } - } - - PUTS("
HTTP Request Information
HTTP Headers
"); -} - - -static zend_module_entry php_pi3web_module = { - STANDARD_MODULE_HEADER, - "PI3WEB", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_pi3web, - NULL, - STANDARD_MODULE_PROPERTIES -}; - - -static int zend_pi3web_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - DWORD num_bytes = str_length; - LPCONTROL_BLOCK cb; - - cb = (LPCONTROL_BLOCK) SG(server_context); - - if ( !IWasLoaded ) return 0; - cb->WriteClient(cb->ConnID, (char *) str, &num_bytes, 0 ); - - if (num_bytes != str_length) - php_handle_aborted_connection(); - return num_bytes; -} - - -static int sapi_pi3web_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - return SAPI_HEADER_ADD; -} - - -static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC) -{ - *total_length += sapi_header->header_len+2; -} - - -static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC) -{ - memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len); - *combined_headers_ptr += sapi_header->header_len; - **combined_headers_ptr = '\r'; - (*combined_headers_ptr)++; - **combined_headers_ptr = '\n'; - (*combined_headers_ptr)++; -} - - -static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - uint total_length = 2; /* account for the trailing \r\n */ - char *combined_headers, *combined_headers_ptr; - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - sapi_header_struct default_content_type; - - if ( !IWasLoaded ) return SAPI_HEADER_SENT_SUCCESSFULLY; - - - if (SG(sapi_headers).send_default_content_type) { - sapi_get_default_content_type_header(&default_content_type TSRMLS_CC); - accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC); - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC); - - /* Generate headers */ - combined_headers = (char *) emalloc(total_length+1); - combined_headers_ptr = combined_headers; - if (SG(sapi_headers).send_default_content_type) { - concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC); - sapi_free_header(&default_content_type); /* we no longer need it */ - } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC); - *combined_headers_ptr++ = '\r'; - *combined_headers_ptr++ = '\n'; - *combined_headers_ptr = 0; - - lpCB->dwHttpStatusCode = SG(sapi_headers).http_response_code; - lpCB->SendHeaderFunction(lpCB->ConnID, &total_length, (LPDWORD) combined_headers); - - efree(combined_headers); - if (SG(sapi_headers).http_status_line) { - efree(SG(sapi_headers).http_status_line); - SG(sapi_headers).http_status_line = 0; - } - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - - -static int php_pi3web_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, &php_pi3web_module, 1)==FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - - -static int sapi_pi3web_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - DWORD read_from_buf=0; - DWORD read_from_input=0; - DWORD total_read=0; - - if ((DWORD)SG(read_post_bytes) < lpCB->cbAvailable) { - read_from_buf = MIN(lpCB->cbAvailable-SG(read_post_bytes), count_bytes); - memcpy(buffer, lpCB->lpbData+SG(read_post_bytes), read_from_buf); - total_read += read_from_buf; - } - if (read_from_bufcbTotalBytes) { - DWORD cbRead=0, cbSize; - - read_from_input = MIN(count_bytes-read_from_buf, lpCB->cbTotalBytes-SG(read_post_bytes)-read_from_buf); - while (cbRead < read_from_input) { - cbSize = read_from_input - cbRead; - if (!lpCB->ReadClient(lpCB->ConnID, buffer+read_from_buf+cbRead, &cbSize) || cbSize==0) { - break; - } - cbRead += cbSize; - } - total_read += cbRead; - } - - /* removed after re-testing POST with Pi3Web 2.0.2 */ - /* SG(read_post_bytes) += total_read; */ - return total_read; -} - - -static char *sapi_pi3web_read_cookies(TSRMLS_D) -{ - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - char variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE]; - DWORD variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - - if (lpCB->GetServerVariable(lpCB->ConnID, "HTTP_COOKIE", variable_buf, &variable_len)) { - return estrndup(variable_buf, variable_len); - } else if (PIPlatform_getLastError()==PIAPI_EINVAL) { - char *tmp_variable_buf = (char *) emalloc(variable_len+1); - - if (lpCB->GetServerVariable(lpCB->ConnID, "HTTP_COOKIE", tmp_variable_buf, &variable_len)) { - tmp_variable_buf[variable_len] = 0; - return tmp_variable_buf; - } else { - efree(tmp_variable_buf); - } - } - return NULL; -} - -static void init_request_info(LPCONTROL_BLOCK lpCB TSRMLS_DC) -{ - SG(server_context) = lpCB; - SG(request_info).request_method = lpCB->lpszMethod; - SG(request_info).query_string = lpCB->lpszQueryString; - SG(request_info).path_translated = lpCB->lpszPathTranslated; - SG(request_info).request_uri = lpCB->lpszUri; - SG(request_info).content_type = lpCB->lpszContentType; - SG(request_info).content_length = lpCB->cbTotalBytes; - SG(request_info).auth_user = (lpCB->lpszUser) ? (char *)estrdup((const char *)(lpCB->lpszUser)) : 0; - SG(request_info).auth_password = (lpCB->lpszPassword) ? (char *)estrdup((const char *)(lpCB->lpszPassword)) : 0; - SG(sapi_headers).http_response_code = 200; -} - -static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC) -{ - char static_variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE]; - char *variable_buf; - DWORD variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); - PIDB *pDB = (PIDB *)lpCB->GetVariableNames(lpCB->ConnID); - PIDBIterator *pIter = PIDB_getIterator( pDB, PIDBTYPE_STRING, 0, 0 ); - - /* --- loop over all registered server variables --- */ - for(; pIter && PIDBIterator_atValidElement( pIter ); PIDBIterator_next( pIter ) ) - { - PCHAR pKey; - PIDBIterator_current( pIter, &pKey ); - if ( !pKey ) { /* sanity */ continue; }; - - variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - if (lpCB->GetServerVariable(lpCB->ConnID, pKey, static_variable_buf, &variable_len) - && (variable_len > 1)) { - php_register_variable(pKey, static_variable_buf, track_vars_array TSRMLS_CC); - } else if (PIPlatform_getLastError()==PIAPI_EINVAL) { - variable_buf = (char *) emalloc(variable_len); - if (lpCB->GetServerVariable(lpCB->ConnID, pKey, variable_buf, &variable_len)) { - php_register_variable(pKey, variable_buf, track_vars_array TSRMLS_CC); - } - efree(variable_buf); - } - - } - - - /* PHP_SELF support */ - variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; - if (lpCB->GetServerVariable(lpCB->ConnID, "SCRIPT_NAME", static_variable_buf, &variable_len) - && (variable_len > 1)) { - php_register_variable("PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC); - } -} - -static sapi_module_struct pi3web_sapi_module = { - "pi3web", /* name */ - "PI3WEB", /* pretty name */ - - php_pi3web_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - NULL, /* activate */ - NULL, /* deactivate */ - zend_pi3web_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - php_error, /* error handler */ - sapi_pi3web_header_handler, /* header handler */ - sapi_pi3web_send_headers, /* send headers handler */ - NULL, /* send header handler */ - sapi_pi3web_read_post, /* read POST data */ - sapi_pi3web_read_cookies, /* read Cookies */ - sapi_pi3web_register_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB) -{ - zend_file_handle file_handle = {0}; - int iRet = PIAPI_COMPLETED; - TSRMLS_FETCH(); - - zend_first_try { - file_handle.filename = lpCB->lpszFileName; - file_handle.free_filename = 0; - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.opened_path = NULL; - - init_request_info(lpCB TSRMLS_CC); - php_request_startup(TSRMLS_C); - - switch ( lpCB->dwBehavior ) { - case PHP_MODE_STANDARD: - iRet = ( php_execute_script( &file_handle TSRMLS_CC ) ) ? - PIAPI_COMPLETED : PIAPI_ERROR; - break; - case PHP_MODE_HIGHLIGHT: { - zend_syntax_highlighter_ini syntax_highlighter_ini; - if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) - { - php_get_highlight_struct( &syntax_highlighter_ini ); - zend_highlight( &syntax_highlighter_ini TSRMLS_CC ); - } - else - { - iRet = PIAPI_ERROR; - }; - }; - break; - case PHP_MODE_INDENT: { - sapi_header_line ctr = {0}; - - ctr.line = "Content-Type: text/plain"; - ctr.line_len = strlen(ctr.line); - - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); - } - if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) - { - zend_indent(); - } - else - { - iRet = PIAPI_ERROR; - }; - break; - case PHP_MODE_LINT: - iRet = (php_lint_script(&file_handle TSRMLS_CC) == SUCCESS) ? - PIAPI_COMPLETED : PIAPI_ERROR; - break; - default: - iRet = PIAPI_ERROR;; - } - - if (SG(request_info).cookie_data) { - efree(SG(request_info).cookie_data); - }; - - php_request_shutdown(NULL); - } zend_catch { - iRet = PIAPI_ERROR; - } zend_end_try(); - return iRet; -} - -MODULE_API BOOL PHP5_startup() { - tsrm_startup(1, 1, 0, NULL); - sapi_startup(&pi3web_sapi_module); - if (pi3web_sapi_module.startup) { - pi3web_sapi_module.startup(&pi3web_sapi_module); - }; - IWasLoaded = 1; - return IWasLoaded; -}; - -MODULE_API BOOL PHP5_shutdown() { - if (pi3web_sapi_module.shutdown) { - pi3web_sapi_module.shutdown(&pi3web_sapi_module); - }; - sapi_shutdown(); - tsrm_shutdown(); - IWasLoaded = 0; - return !IWasLoaded; -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/sapi/pi3web/pi3web_sapi.h b/sapi/pi3web/pi3web_sapi.h deleted file mode 100644 index 9300241d44920..0000000000000 --- a/sapi/pi3web/pi3web_sapi.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef _PI3WEB_SAPI_H_ -#define _PI3WEB_SAPI_H_ - -#ifdef PHP_WIN32 -# include -# ifdef PHP5PI3WEB_EXPORTS -# define MODULE_API __declspec(dllexport) -# else -# define MODULE_API __declspec(dllimport) -# endif -#else -# define far -# define MODULE_API - - typedef int BOOL; - typedef void far *LPVOID; - typedef unsigned long DWORD; - typedef DWORD far *LPDWORD; - typedef char CHAR; - typedef CHAR *LPSTR; - typedef unsigned char BYTE; - typedef BYTE far *LPBYTE; -#endif - - typedef LPVOID HCONN; - -#ifdef __cplusplus -extern "C" { -#endif - -#define PHP_MODE_STANDARD 1 -#define PHP_MODE_HIGHLIGHT 2 -#define PHP_MODE_INDENT 3 -#define PHP_MODE_LINT 4 - -// -// passed to the procedure on a new request -// -typedef struct _CONTROL_BLOCK { - DWORD cbSize; // size of this struct. - HCONN ConnID; // Context number not to be modified! - DWORD dwHttpStatusCode; // HTTP Status code - CHAR lpszLogData[80]; // null terminated log info - - LPSTR lpszMethod; // REQUEST_METHOD - LPSTR lpszQueryString; // QUERY_STRING - LPSTR lpszPathInfo; // PATH_INFO - LPSTR lpszPathTranslated; // PATH_TRANSLATED - LPSTR lpszFileName; // FileName to PHP3 physical file - LPSTR lpszUri; // The request URI - LPSTR lpszReq; // The whole HTTP request line - LPSTR lpszUser; // The authenticated user - LPSTR lpszPassword; // The authenticated password - - DWORD cbTotalBytes; // Total bytes indicated from client - DWORD cbAvailable; // Available number of bytes - LPBYTE lpbData; // pointer to cbAvailable bytes - - LPSTR lpszContentType; // Content type of client data - DWORD dwBehavior; // PHP behavior (standard, highlight, intend - - - LPVOID (* GetVariableNames) (HCONN hConn); - - BOOL (* GetServerVariable) ( HCONN hConn, - LPSTR lpszVariableName, - LPVOID lpvBuffer, - LPDWORD lpdwSize ); - - BOOL (* WriteClient) ( HCONN hConn, - LPVOID lpvBuffer, - LPDWORD lpdwBytes, - DWORD dwReserved ); - - BOOL (* ReadClient) ( HCONN hConn, - LPVOID lpvBuffer, - LPDWORD lpdwSize ); - - BOOL (* SendHeaderFunction)( HCONN hConn, - LPDWORD lpdwSize, - LPDWORD lpdwDataType ); - -} CONTROL_BLOCK, *LPCONTROL_BLOCK; - -MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB); -MODULE_API BOOL PHP5_startup(); -MODULE_API BOOL PHP5_shutdown(); - -// the following type declaration is for the server side -typedef DWORD ( * PFN_WRAPPERFUNC )( CONTROL_BLOCK *pCB ); - - - -#ifdef __cplusplus -} -#endif - -#endif // end definition _PI3WEB_SAPI_H_ diff --git a/sapi/roxen/README b/sapi/roxen/README deleted file mode 100644 index d834a0000e75d..0000000000000 --- a/sapi/roxen/README +++ /dev/null @@ -1,18 +0,0 @@ -Roxen PHP support. Early version. Don't expect to be able to get it to -work. Requires Pike 0.7.79 and Roxen 1.4. Anything less won't work. - -The module is now thread safe, in a couple of different modes. First -mode, the default, uses a process global PHP lock in the Roxen -module. This means that all PHP-requests are serialized (ie only one -script is executed at any one time). The second option is using ZTS -(Zend Thread Safe mode). Unless --enable-roxen-zts is specified, this -won't be used. - -This solution now works fine and is recommended. Multiple PHP5 -requests will be run in parallell. The maximum number of parallell -PHP5-execution is limited to the number of handle threads Roxen is -started with. - -Support for this module is lacking. Please contact Roxen Internet -Software for support and help. See http://www.roxen.com/company/contact/ -for contact information. diff --git a/sapi/roxen/TODO b/sapi/roxen/TODO deleted file mode 100644 index 248f36f52e708..0000000000000 --- a/sapi/roxen/TODO +++ /dev/null @@ -1,33 +0,0 @@ -BUGS: - -- fix backtraces -- exit in PHP exits Roxen -- POST newline added? -- Rewriting header handling so that more than one header with the same - name can be set (most importantly, cookies). -- Recursive mutex lock problem: - - And another error (when trying to include a class) - - Recursive mutex locks! - /Usr/local/pike/7.0.54/lib/modules/PHP5.so.Interpreter: - run("/home/www/www.tx.pl/news/test.php",mapping[3],modules/scripting/php5.pike.PHPScript(),modules/scripting/php5.pike.PHPScript.done) - modules/scripting/php5.pike:169: run() - base_server/roxen.pike:569: handler_thread(3). - - And after this every access to any php script (on other virtual sites - also) ends (of course there is no proper output) with this error: - - Php4.Interpreter->run: Tried to run a PHP-script from a PHP - callback!/usr/local/pike/7.0.54/lib/modules/PHP5.so.Interpreter: - run("/home/www/biall.com.pl/index.php3",mapping[2],modules/scripting/php5.pike.PHPScript(),modules/scripting/php5.pike.PHPScript.done) - modules/scripting/php5.pike:169: run() - base_server/roxen.pike:569: handler_thread(3). - - -ADDITIONS: - -- use th_farm -- change cwd in single threaded mode -- per-virtual-server configuration - diff --git a/sapi/roxen/config.m4 b/sapi/roxen/config.m4 deleted file mode 100644 index 9b0bb90c35242..0000000000000 --- a/sapi/roxen/config.m4 +++ /dev/null @@ -1,55 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(roxen,, -[ --with-roxen=DIR Build PHP as a Pike module. DIR is the base Roxen - directory, normally /usr/local/roxen/server], no, no) - -PHP_ARG_ENABLE(roxen-zts, whether Roxen module is build using ZTS, -[ --enable-roxen-zts ROXEN: Build the Roxen module using Zend Thread Safety], no, no) - -RESULT= -AC_MSG_CHECKING([for Roxen/Pike support]) -if test "$PHP_ROXEN" != "no"; then - if test ! -d $PHP_ROXEN ; then - AC_MSG_ERROR([You did not specify a directory]) - fi - if test -f $PHP_ROXEN/bin/roxen; then - PIKE=$PHP_ROXEN/bin/roxen - elif test -f $PHP_ROXEN/bin/pike; then - PIKE=$PHP_ROXEN/bin/pike - else - AC_MSG_ERROR([Could not find a pike in $PHP_ROXEN/bin/]) - fi - - if $PIKE -e 'float v; catch(v = __VERSION__ + (__BUILD__/10000.0)); if(v < 0.7079) exit(1); exit(0);'; then - PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'` - PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,'` - if test -z "$PIKE_INCLUDE_DIR" || test -z "$PIKE_MODULE_DIR"; then - AC_MSG_ERROR([Failed to figure out Pike module and include directories]) - fi - else - AC_MSG_ERROR([Roxen/PHP requires Pike 0.7.79 or newer]) - fi - - PHP_ADD_INCLUDE($PIKE_INCLUDE_DIR) - AC_DEFINE(HAVE_ROXEN, 1, [Whether you use Roxen]) - PHP_SELECT_SAPI(roxen, shared, roxen.c) - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PIKE_MODULE_DIR/PHP5.so" - RESULT="yes - Pike binary used: $PIKE - Pike include dir: $PIKE_INCLUDE_DIR - Pike module directory: $PIKE_MODULE_DIR" - PIKE_INCLUDE_DIR=" -I$PIKE_INCLUDE_DIR " - - if test "$PHP_ROXEN_ZTS" != "no"; then - PHP_BUILD_THREAD_SAFE - AC_DEFINE(ROXEN_USE_ZTS, 1, [Whether to use Roxen in ZTS mode]) - fi -fi -AC_MSG_RESULT([$RESULT]) - -dnl ## Local Variables: -dnl ## tab-width: 4 -dnl ## End: diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c deleted file mode 100644 index 13155d49f4645..0000000000000 --- a/sapi/roxen/roxen.c +++ /dev/null @@ -1,726 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: David Hedbor | - | Based on aolserver SAPI by Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" -#ifdef HAVE_ROXEN - -#include "php_ini.h" -#include "php_globals.h" -#include "SAPI.h" -#include "php_main.h" -#include "ext/standard/info.h" - -#include "php_version.h" - -#ifndef ZTS -/* Only valid if thread safety is enabled. */ -#undef ROXEN_USE_ZTS -#endif - - -/* Pike Include Files - * - * conflicts with pike avoided by only using long names. Requires a new - * Pike 0.7 since it was implemented for this interface only. - * - */ -#define NO_PIKE_SHORTHAND - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#undef HIDE_GLOBAL_VARIABLES -#undef REVEAL_GLOBAL_VARIABLES -#define HIDE_GLOBAL_VARIABLES() -#define REVEAL_GLOBAL_VARIABLES() - -/* php_roxen_request is per-request object storage */ - -typedef struct -{ - struct mapping *request_data; - struct object *my_fd_obj; - int my_fd; - char *filename; -} php_roxen_request; - - -/* Defines to get to the data supplied when the script is started. */ - -#ifdef ROXEN_USE_ZTS - -/* ZTS does work now, but it seems like it's faster using the "serialization" - * method I previously used. Thus it's not used unless ROXEN_USE_ZTS is defined. - */ - -/* Per thread storage area id... */ -static int roxen_globals_id; - -# define GET_THIS() php_roxen_request *_request = ts_resource(roxen_globals_id) -# define THIS _request -#else -static php_roxen_request *current_request = NULL; - -# define GET_THIS() current_request = ((php_roxen_request *)Pike_fp->current_storage) -# define THIS current_request -#endif - -/* File descriptor integer. Used to write directly to the FD without - * passing Pike - */ -#define MY_FD (THIS->my_fd) - -/* FD object. Really a PHPScript object from Pike which implements a couple - * of functions to handle headers, writing and buffering. - */ -#define MY_FD_OBJ ((struct object *)(THIS->my_fd_obj)) - -/* Mapping with data supplied from the calling Roxen module. Contains - * a mapping with headers, an FD object etc. - */ -#define REQUEST_DATA ((struct mapping *)(THIS->request_data)) - - -#if defined(_REENTRANT) && !defined(ROXEN_USE_ZTS) -/* Lock used to serialize the PHP execution. If ROXEN_USE_ZTS is defined, we - * are using the PHP thread safe mechanism instead. - */ -static PIKE_MUTEX_T roxen_php_execution_lock; -# define PHP_INIT_LOCK() mt_init(&roxen_php_execution_lock) -# define PHP_LOCK(X) THREADS_ALLOW();mt_lock(&roxen_php_execution_lock);THREADS_DISALLOW() -# define PHP_UNLOCK(X) mt_unlock(&roxen_php_execution_lock); -# define PHP_DESTROY() mt_destroy(&roxen_php_execution_lock) -#else /* !_REENTRANT */ -# define PHP_INIT_LOCK() -# define PHP_LOCK(X) -# define PHP_UNLOCK(X) -# define PHP_DESTROY() -#endif /* _REENTRANT */ - -extern int fd_from_object(struct object *o); -static unsigned char roxen_php_initialized; - -/* This allows calling of pike functions from the PHP callbacks, - * which requires the Pike interpreter to be locked. - */ -#define THREAD_SAFE_RUN(COMMAND, what) do {\ - struct thread_state *state;\ - if((state = thread_state_for_id(th_self()))!=NULL) {\ - if(!state->swapped) {\ - COMMAND;\ - } else {\ - mt_lock(&interpreter_lock);\ - SWAP_IN_THREAD(state);\ - COMMAND;\ - SWAP_OUT_THREAD(state);\ - mt_unlock(&interpreter_lock);\ - }\ - }\ -} while(0) - -struct program *php_program; - - -/* To avoid executing a PHP script from a PHP callback, which would - * create a deadlock, a global thread id is used. If the thread calling the - * php-script is the same as the current thread, it fails. - */ -static int current_thread = -1; - - -/* Low level header lookup. Basically looks for the named header in the mapping - * headers in the supplied options mapping. - */ - -static INLINE struct svalue *lookup_header(char *headername) -{ - struct svalue *headers, *value; - struct pike_string *sind; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - sind = make_shared_string("env"); - headers = low_mapping_string_lookup(REQUEST_DATA, sind); - free_string(sind); - if(!headers || headers->type != PIKE_T_MAPPING) return NULL; - sind = make_shared_string(headername); - value = low_mapping_string_lookup(headers->u.mapping, sind); - free_string(sind); - if(!value) return NULL; - return value; -} - -/* Lookup a header in the mapping and return the value as a string, or - * return the default if it's missing - */ -INLINE static char *lookup_string_header(char *headername, char *default_value) -{ - struct svalue *head = NULL; - THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup"); - if(!head || head->type != PIKE_T_STRING) - return default_value; - return head->u.string->str; -} - -/* Lookup a header in the mapping and return the value as if it's an integer - * and otherwise return the default. - */ -INLINE static int lookup_integer_header(char *headername, int default_value) -{ - struct svalue *head = NULL; - THREAD_SAFE_RUN(head = lookup_header(headername), "header lookup"); - if(!head || head->type != PIKE_T_INT) - return default_value; - return head->u.integer; -} - -/* - * php_roxen_low_ub_write() writes data to the client connection. Might be - * rewritten to do more direct IO to save CPU and the need to lock the * - * interpreter for better threading. - */ - -static int -php_roxen_low_ub_write(const char *str, uint str_length TSRMLS_DC) { - int sent_bytes = 0; - struct pike_string *to_write = NULL; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - - if(!MY_FD_OBJ->prog) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return -1; - } - to_write = make_shared_binary_string(str, str_length); - push_string(to_write); - safe_apply(MY_FD_OBJ, "write", 1); - if(Pike_sp[-1].type == PIKE_T_INT) - sent_bytes = Pike_sp[-1].u.integer; - pop_stack(); - if(sent_bytes != str_length) { - /* This means the connection is closed. Dead. Gone. *sniff* */ - php_handle_aborted_connection(); - } - return sent_bytes; -} - -/* - * php_roxen_sapi_ub_write() calls php_roxen_low_ub_write in a Pike thread - * safe manner. - */ - -static int -php_roxen_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) -{ -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - - int sent_bytes = 0, fd = MY_FD; - if(fd) - { - for(sent_bytes=0;sent_bytes < str_length;) - { - int written; - written = fd_write(fd, str + sent_bytes, str_length - sent_bytes); - if(written < 0) - { - switch(errno) - { - default: - /* This means the connection is closed. Dead. Gone. *sniff* */ - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return sent_bytes; - case EINTR: - case EWOULDBLOCK: - continue; - } - - } else { - sent_bytes += written; - } - } - } else { - THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length TSRMLS_CC), - "write"); - } - return sent_bytes; -} - -/* php_roxen_set_header() sets a header in the header mapping. Called in a - * thread safe manner from php_roxen_sapi_header_handler. - */ -static void php_roxen_set_header(char *header_name, char *value, char *p) -{ - struct svalue hsval; - struct pike_string *hval, *ind, *hind; - struct mapping *headermap; - struct svalue *s_headermap; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - hval = make_shared_string(value); - ind = make_shared_string(" _headers"); - hind = make_shared_binary_string(header_name, - (int)(p - header_name)); - - s_headermap = low_mapping_string_lookup(REQUEST_DATA, ind); - if(!s_headermap) - { - struct svalue mappie; - mappie.type = PIKE_T_MAPPING; - headermap = allocate_mapping(1); - mappie.u.mapping = headermap; - mapping_string_insert(REQUEST_DATA, ind, &mappie); - free_mapping(headermap); - } else - headermap = s_headermap->u.mapping; - - hsval.type = PIKE_T_STRING; - hsval.u.string = hval; - mapping_string_insert(headermap, hind, &hsval); - - free_string(hval); - free_string(ind); - free_string(hind); -} - -/* - * php_roxen_sapi_header_handler() sets a HTTP reply header to be - * sent to the client. - */ -static int -php_roxen_sapi_header_handler(sapi_header_struct *sapi_header, - sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char *header_name, *header_content, *p; - header_name = sapi_header->header; - header_content = p = strchr(header_name, ':'); - - if(p) { - do { - header_content++; - } while(*header_content == ' '); - THREAD_SAFE_RUN(php_roxen_set_header(header_name, header_content, p), "header handler"); - } - sapi_free_header(sapi_header); - return 0; -} - -/* - * php_roxen_sapi_send_headers() flushes the headers to the client. - * Called before real content is sent by PHP. - */ - -static int -php_roxen_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - struct pike_string *ind; - struct svalue *s_headermap; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - - if(!MY_FD_OBJ->prog) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return SAPI_HEADER_SEND_FAILED; - } - ind = make_shared_string(" _headers"); - s_headermap = low_mapping_string_lookup(REQUEST_DATA, ind); - free_string(ind); - - push_int(SG(sapi_headers).http_response_code); - if(s_headermap && s_headermap->type == PIKE_T_MAPPING) - ref_push_mapping(s_headermap->u.mapping); - else - push_int(0); - safe_apply(MY_FD_OBJ, "send_headers", 2); - pop_stack(); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int -php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - int res = 0; - THREAD_SAFE_RUN(res = php_roxen_low_send_headers(sapi_headers TSRMLS_CC), "send headers"); - return res; -} - -/* - * php_roxen_sapi_read_post() reads a specified number of bytes from - * the client. Used for POST/PUT requests. - */ - -INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes) -{ - uint total_read = 0; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - TSRMLS_FETCH(); - - if(!MY_FD_OBJ->prog) - { - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); - return -1; - } - push_int(count_bytes); - safe_apply(MY_FD_OBJ, "read_post", 1); - if(Pike_sp[-1].type == PIKE_T_STRING) { - MEMCPY(buf, Pike_sp[-1].u.string->str, - (total_read = Pike_sp[-1].u.string->len)); - buf[total_read] = '\0'; - } else - total_read = 0; - pop_stack(); - return total_read; -} - -static int -php_roxen_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) -{ - uint total_read = 0; - THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes), "read post"); - return total_read; -} - -/* - * php_roxen_sapi_read_cookies() returns the Cookie header from - * the HTTP request header - */ - -static char * -php_roxen_sapi_read_cookies(TSRMLS_D) -{ - char *cookies; - cookies = lookup_string_header("HTTP_COOKIE", NULL); - return cookies; -} - -static void php_info_roxen(ZEND_MODULE_INFO_FUNC_ARGS) -{ - /* char buf[512]; */ - php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id$"); - /* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); - php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); - php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); - php_info_print_table_row(2, "Installation path", Ns_InfoHomePath()); - php_info_print_table_row(2, "Hostname of server", Ns_InfoHostname()); - php_info_print_table_row(2, "Source code label", Ns_InfoLabel()); - php_info_print_table_row(2, "Server platform", Ns_InfoPlatform()); - snprintf(buf, 511, "%s/%s", Ns_InfoServerName(), Ns_InfoServerVersion()); - php_info_print_table_row(2, "Server version", buf); - snprintf(buf, 511, "%d day(s), %02d:%02d:%02d", - uptime / 86400, - (uptime / 3600) % 24, - (uptime / 60) % 60, - uptime % 60); - php_info_print_table_row(2, "Server uptime", buf); - */ - php_info_print_table_end(); -} - -static zend_module_entry php_roxen_module = { - STANDARD_MODULE_HEADER, - "Roxen", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_roxen, - NULL, - STANDARD_MODULE_PROPERTIES -}; - -static int php_roxen_startup(sapi_module_struct *sapi_module) -{ - if(php_module_startup(sapi_module, &php_roxen_module, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - -/* this structure is static (as in "it does not change") */ - -static sapi_module_struct roxen_sapi_module = { - "roxen", - "Roxen", - php_roxen_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - NULL, /* activate */ - NULL, /* deactivate */ - php_roxen_sapi_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - php_error, /* error handler */ - php_roxen_sapi_header_handler, /* header handler */ - php_roxen_sapi_send_headers, /* send headers handler */ - NULL, /* send header handler */ - php_roxen_sapi_read_post, /* read POST data */ - php_roxen_sapi_read_cookies, /* read Cookies */ - NULL, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -/* - * php_roxen_hash_environment() populates the php script environment - * with a number of variables. HTTP_* variables are created for - * the HTTP header data, so that a script can access these. - */ -#define ADD_STRING(name) \ - MAKE_STD_ZVAL(zvalue); \ - zvalue->type = IS_STRING; \ - zvalue->value.str.len = strlen(buf); \ - zvalue->value.str.val = estrndup(buf, zvalue->value.str.len); \ - zend_hash_update(&EG(symbol_table), name, sizeof(name), \ - &zvalue, sizeof(zval *), NULL) - -static void -php_roxen_hash_environment(TSRMLS_D) -{ - int i; - char buf[512]; - zval *zvalue; - struct svalue *headers; - struct pike_string *sind; - struct array *indices; - struct svalue *ind, *val; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - sind = make_shared_string("env"); - headers = low_mapping_string_lookup(REQUEST_DATA, sind); - free_string(sind); - if(headers && headers->type == PIKE_T_MAPPING) { - indices = mapping_indices(headers->u.mapping); - for(i = 0; i < indices->size; i++) { - ind = &indices->item[i]; - val = low_mapping_lookup(headers->u.mapping, ind); - if(ind && ind->type == PIKE_T_STRING && - val && val->type == PIKE_T_STRING) { - int buf_len; - buf_len = MIN(511, ind->u.string->len); - strncpy(buf, ind->u.string->str, buf_len); - buf[buf_len] = '\0'; /* Terminate correctly */ - MAKE_STD_ZVAL(zvalue); - zvalue->type = IS_STRING; - zvalue->value.str.len = val->u.string->len; - zvalue->value.str.val = estrndup(val->u.string->str, zvalue->value.str.len); - - zend_hash_update(&EG(symbol_table), buf, buf_len + 1, &zvalue, sizeof(zval *), NULL); - } - } - free_array(indices); - } - - /* - MAKE_STD_ZVAL(zvalue); - zvalue->type = IS_LONG; - zvalue->value.lval = Ns_InfoBootTime(); - zend_hash_update(&EG(symbol_table), "SERVER_BOOTTIME", sizeof("SERVER_BOOTTIME"), &zvalue, sizeof(zval *), NULL); - */ -} - -/* - * php_roxen_module_main() is called by the per-request handler and - * "executes" the script - */ - -static int php_roxen_module_main(TSRMLS_D) -{ - int res, len; - char *dir; - zend_file_handle file_handle; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = THIS->filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - THREADS_ALLOW(); - res = php_request_startup(TSRMLS_C); - THREADS_DISALLOW(); - if(res == FAILURE) { - return 0; - } - php_roxen_hash_environment(TSRMLS_C); - THREADS_ALLOW(); - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); - THREADS_DISALLOW(); - return 1; -} - -/* - * The php_roxen_request_handler() is called per request and handles - * everything for one request. - */ - -void f_php_roxen_request_handler(INT32 args) -{ - struct object *my_fd_obj; - struct mapping *request_data; - struct svalue *done_callback, *raw_fd; - struct pike_string *script, *ind; - int status = 1; -#ifdef ROXEN_USE_ZTS - GET_THIS(); -#endif - TSRMLS_FETCH(); - - if(current_thread == th_self()) - php_error(E_WARNING, "PHP5.Interpreter->run: Tried to run a PHP-script from a PHP " - "callback!"); - get_all_args("PHP5.Interpreter->run", args, "%S%m%O%*", &script, - &request_data, &my_fd_obj, &done_callback); - if(done_callback->type != PIKE_T_FUNCTION) - php_error(E_WARNING, "PHP5.Interpreter->run: Bad argument 4, expected function.\n"); - PHP_LOCK(THIS); /* Need to lock here or reusing the same object might cause - * problems in changing stuff in that object */ -#ifndef ROXEN_USE_ZTS - GET_THIS(); -#endif - THIS->request_data = request_data; - THIS->my_fd_obj = my_fd_obj; - THIS->filename = script->str; - current_thread = th_self(); - SG(request_info).query_string = lookup_string_header("QUERY_STRING", 0); - SG(server_context) = (void *)1; /* avoid server_context == NULL */ - - /* path_translated is apparently the absolute path to the file, not - the translated PATH_INFO - */ - SG(request_info).path_translated = - lookup_string_header("SCRIPT_FILENAME", NULL); - SG(request_info).request_uri = lookup_string_header("DOCUMENT_URI", NULL); - if(!SG(request_info).request_uri) - SG(request_info).request_uri = lookup_string_header("SCRIPT_NAME", NULL); - SG(request_info).request_method = lookup_string_header("REQUEST_METHOD", "GET"); - SG(request_info).content_length = lookup_integer_header("HTTP_CONTENT_LENGTH", 0); - SG(request_info).content_type = lookup_string_header("HTTP_CONTENT_TYPE", NULL); - SG(sapi_headers).http_response_code = 200; - - /* FIXME: Check for auth stuff needs to be fixed... */ - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - - ind = make_shared_binary_string("my_fd", 5); - raw_fd = low_mapping_string_lookup(THIS->request_data, ind); - if(raw_fd && raw_fd->type == PIKE_T_OBJECT) - { - int fd = fd_from_object(raw_fd->u.object); - if(fd == -1) - php_error(E_WARNING, "PHP5.Interpreter->run: my_fd object not open or not an FD.\n"); - THIS->my_fd = fd; - } else - THIS->my_fd = 0; - - status = php_roxen_module_main(TSRMLS_C); - current_thread = -1; - - apply_svalue(done_callback, 0); - pop_stack(); - pop_n_elems(args); - push_int(status); - PHP_UNLOCK(THIS); -} - - -/* Clear the object global struct */ -static void clear_struct(struct object *o) -{ - MEMSET(Pike_fp->current_storage, 0, sizeof(php_roxen_request)); -} - - -/* - * pike_module_init() is called by Pike once at startup - * - * This functions allocates basic structures - */ - -void pike_module_init( void ) -{ - if (!roxen_php_initialized) { -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); -#ifdef ROXEN_USE_ZTS - ts_allocate_id(&roxen_globals_id, sizeof(php_roxen_request), NULL, NULL); -#endif -#endif - sapi_startup(&roxen_sapi_module); - /*php_roxen_startup(&roxen_sapi_module); removed - should be called from SAPI activation*/ - roxen_php_initialized = 1; - PHP_INIT_LOCK(); - } - start_new_program(); /* Text */ - ADD_STORAGE(php_roxen_request); - set_init_callback(clear_struct); - pike_add_function("run", f_php_roxen_request_handler, - "function(string, mapping, object, function:int)", 0); - add_program_constant("Interpreter", (php_program = end_program()), 0); -} - -/* - * pike_module_exit() performs the last steps before the - * server exists. Shutdowns basic services and frees memory - */ - -void pike_module_exit(void) -{ - roxen_php_initialized = 0; - roxen_sapi_module.shutdown(&roxen_sapi_module); - if(php_program) free_program(php_program); -#ifdef ZTS - tsrm_shutdown(); -#endif - PHP_DESTROY(); -} -#endif diff --git a/sapi/tests/test001.phpt b/sapi/tests/test001.phpt deleted file mode 100644 index a964393fd9178..0000000000000 --- a/sapi/tests/test001.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -IIS style CGI missing SCRIPT_FILENAME ---DESCRIPTION-- -This would be similar to what IIS produces for a simple query. ---ENV-- -return << ---EXPECT-- -HELLO \ No newline at end of file diff --git a/sapi/tests/test002.phpt b/sapi/tests/test002.phpt deleted file mode 100644 index 42ade3d96b5fc..0000000000000 --- a/sapi/tests/test002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Apache style CGI ---DESCRIPTION-- -Apache likes to set SCRIPT_FILENAME to the php executable -if you use ScriptAlias configurations, and the proper -path is in PATH_TRANSLATED. SCRIPT_NAME in this is faked, -but that is ok, Apache sets SCRIPT_NAME to the ScriptAlias -of the executable. ---ENV-- -return <<conf['TEST_PHP_EXECUTABLE'] -END; ---FILE-- - ---EXPECT-- -HELLO \ No newline at end of file diff --git a/sapi/tests/test003.phpt b/sapi/tests/test003.phpt deleted file mode 100644 index 522d78db4173c..0000000000000 --- a/sapi/tests/test003.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -IIS style CGI missing SCRIPT_FILENAME, has PATH_INFO ---DESCRIPTION-- -This would be similar to what IIS produces for a simple query -that also has PATH_INFO. ---REQUEST-- -return << ---EXPECT-- -/path/info \ No newline at end of file diff --git a/sapi/tests/test004.phpt b/sapi/tests/test004.phpt deleted file mode 100644 index dad0dd0eec0c7..0000000000000 --- a/sapi/tests/test004.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Apache style CGI with PATH_INFO ---DESCRIPTION-- -Apache likes to set SCRIPT_FILENAME to the php executable -if you use ScriptAlias configurations, and the proper -path is in PATH_TRANSLATED. SCRIPT_NAME in this is faked, -but that is ok, Apache sets SCRIPT_NAME to the ScriptAlias -of the executable. ---REQUEST-- -return <<conf['TEST_PHP_EXECUTABLE'] -END; ---FILE-- - ---EXPECT-- -/path/info \ No newline at end of file diff --git a/sapi/tests/test005.phpt b/sapi/tests/test005.phpt deleted file mode 100644 index 7415b66a0a78f..0000000000000 --- a/sapi/tests/test005.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -QUERY_STRING Security Bug ---DESCRIPTION-- -This bug was present in PHP 4.3.0 only. -A failure should print HELLO. ---REQUEST-- -return << ---EXPECTHEADERS-- -Status: 404 ---EXPECT-- -No input file specified. \ No newline at end of file diff --git a/sapi/tests/test006.phpt b/sapi/tests/test006.phpt deleted file mode 100644 index 45e37811ef71e..0000000000000 --- a/sapi/tests/test006.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -Multipart Form POST Data ---HEADERS-- -return << ------------------------------240723202011929-- - ---FILE-- - ---EXPECTF-- -Array -( - [entry] => entry box - [password] => password box - [radio1] => test 1 - [checkbox1] => test 1 - [choices] => Choice 2 -) -Array -( - [file] => Array - ( - [name] => info.php - [type] => application/octet-stream - [tmp_name] => %s - [error] => 0 - [size] => 21 - ) - -) diff --git a/sapi/tests/test007.phpt b/sapi/tests/test007.phpt deleted file mode 100644 index 8c50e4b80fe1a..0000000000000 --- a/sapi/tests/test007.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Multipart Form POST Data, incorrect content length ---HEADERS-- -return << ------------------------------240723202011929-- - ---FILE-- - ---EXPECT-- diff --git a/sapi/thttpd/CREDITS b/sapi/thttpd/CREDITS deleted file mode 100644 index 8f02f36f4fb5a..0000000000000 --- a/sapi/thttpd/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -thttpd -Sascha Schumann diff --git a/sapi/thttpd/README b/sapi/thttpd/README deleted file mode 100644 index 1e80a01956eeb..0000000000000 --- a/sapi/thttpd/README +++ /dev/null @@ -1,85 +0,0 @@ -README FOR THTTPD MODULE (by Sascha Schumann) -($Date$) - - This is a SAPI module for PHP 4.x supporting thttpd, the tiny, - turbo, throttling HTTP server by Jef Poskanzer. - - NOTE: All HTTP requests will be serialized. That means, one long running - script will block all other requests. Choose another web server, - if you want to execute arbitrarily long running scripts. - - The module contains a patch against version 2.21b of thttpd. The patch - fixes a number of bugs and adds some functionality: - - - HTTP/1.1 Persistent Connection/Pipeline Support - - PHP Scripting (**.php by default) - - Highlighting PHP Scripts (**.phps by default) - - Fast Accept Loop (unique to PHP) - - Periodic Connection Expiring (unique to PHP) - - Log to stdout (logfile=-) - - Fixes the Host: header vulnerability (affects vhosts only) - - Asynchronous request body handling (e.g. for POSTs) - - Accept filter for Linux - - Fix for non-blocking sending of thttpd-generated responses - - You can configure the filename extensions by creating a config file for - thttpd and setting these entries: - - phppat=PATTERN - phpspat=PATTERN - - The PATTERN has the same format as defined here: - - http://acme.com/software/thttpd/options.html#CGI_PATTERN - - "**.php" means: match any file ending in .php in any directory. - Setting the pattern from the command line is not supported. - - NOTE: This version supports *only* thttpd 2.21b, no prior or later - version. - - This is a functional and stable module (it runs a large application - like IMP 2.2.0 without any problems). Its original intention was to - demonstrate the ability of PHP to work in every web server environment. - -REQUIRED DOWNLOADS - - 1. thttpd 2.21b (2.20 or +2.22beta will _not_ work) - - Full Distribution: - http://www.acme.com/software/thttpd/thttpd-2.21b.tar.gz - - 2. PHP 4.x - - Download: - http://www.php.net/ - - Snapshots from CVS: - http://snaps.php.net/ - - -BUILD INSTRUCTIONS - - 1. Extract software packages - - $ gunzip -c thttpd-2.xx.tar.gz | tar xf - - $ gunzip -c php-*.tar.gz | tar xf - - - 2. Prepare PHP - - $ cd php-* - $ ./configure \ - --with-thttpd=../thttpd-2.xx \ - - $ make install - $ cd .. - - You can see the list of valid PHP options by executing - - $ ./configure --help - - 3. Configure, compile, install thttpd - - Now follow the thttpd instructions. The Makefile template of - thttpd was changed to automatically use the components - required by PHP. diff --git a/sapi/thttpd/config.m4 b/sapi/thttpd/config.m4 deleted file mode 100644 index 371edaee8455b..0000000000000 --- a/sapi/thttpd/config.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(thttpd,, -[ --with-thttpd=SRCDIR Build PHP as thttpd module], no, no) - -AC_MSG_CHECKING([for thttpd]) - -if test "$PHP_THTTPD" != "no"; then - if test ! -d $PHP_THTTPD; then - AC_MSG_RESULT(thttpd directory does not exist ($PHP_THTTPD)) - fi - - PHP_EXPAND_PATH($PHP_THTTPD, THTTPD) - - if grep thttpd.2.21b $PHP_THTTPD/version.h >/dev/null; then - patch="test -f $THTTPD/php_patched || \ - (cd $THTTPD && patch -p1 < $abs_srcdir/sapi/thttpd/thttpd_patch && touch php_patched)" - - elif grep Premium $PHP_THTTPD/version.h >/dev/null; then - patch= - else - AC_MSG_ERROR([This version only supports thttpd-2.21b and Premium thttpd]) - fi - PHP_TARGET_RDYNAMIC - INSTALL_IT="\ - echo 'PHP_LIBS = -L. -lphp5 \$(PHP_LIBS) \$(EXTRA_LIBS)' > $THTTPD/php_makefile; \ - echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $THTTPD/php_makefile; \ - echo 'PHP_CFLAGS = \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(CPPFLAGS) \$(EXTRA_CFLAGS)' >> $THTTPD/php_makefile; \ - rm -f $THTTPD/php_thttpd.c $THTTPD/php_thttpd.h $THTTPD/libphp5.a; \ - \$(LN_S) $abs_srcdir/sapi/thttpd/thttpd.c $THTTPD/php_thttpd.c; \ - \$(LN_S) $abs_srcdir/sapi/thttpd/php_thttpd.h $abs_builddir/$SAPI_STATIC $THTTPD/;\ - $patch" - PHP_THTTPD="yes, using $THTTPD" - PHP_ADD_INCLUDE($THTTPD) - PHP_SELECT_SAPI(thttpd, static) -fi -AC_MSG_RESULT($PHP_THTTPD) diff --git a/sapi/thttpd/php.sym b/sapi/thttpd/php.sym deleted file mode 100644 index 2214d3964dc12..0000000000000 --- a/sapi/thttpd/php.sym +++ /dev/null @@ -1,3 +0,0 @@ -thttpd_php_request -thttpd_php_init -thttpd_php_shutdown diff --git a/sapi/thttpd/php_thttpd.h b/sapi/thttpd/php_thttpd.h deleted file mode 100644 index ea7cc3686acef..0000000000000 --- a/sapi/thttpd/php_thttpd.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_THTTPD_H -#define PHP_THTTPD_H - -#include -#include -#include - -void thttpd_php_shutdown(void); -void thttpd_php_init(void); -off_t thttpd_php_request(httpd_conn *hc, int show_source); - -void thttpd_register_on_close(void (*)(int)); -void thttpd_closed_conn(int fd); -int thttpd_get_fd(void); -void thttpd_set_dont_close(void); - -#endif diff --git a/sapi/thttpd/stub.c b/sapi/thttpd/stub.c deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c deleted file mode 100644 index faa8f4f43fea1..0000000000000 --- a/sapi/thttpd/thttpd.c +++ /dev/null @@ -1,771 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_thttpd.h" -#include "php_variables.h" -#include "version.h" -#include "php_ini.h" -#include "zend_highlight.h" - -#include "ext/standard/php_smart_str.h" - -#include -#include -#include -#include -#include - -#ifdef HAVE_GETNAMEINFO -#include -#include -#endif - -typedef struct { - httpd_conn *hc; - void (*on_close)(int); - - size_t unconsumed_length; - smart_str sbuf; - int seen_cl; - int seen_cn; -} php_thttpd_globals; - -#define PHP_SYS_CALL(x) do { x } while (n == -1 && errno == EINTR) - -#ifdef PREMIUM_THTTPD -# define do_keep_alive persistent -#endif - -#ifdef ZTS -static int thttpd_globals_id; -#define TG(v) TSRMG(thttpd_globals_id, php_thttpd_globals *, v) -#else -static php_thttpd_globals thttpd_globals; -#define TG(v) (thttpd_globals.v) -#endif - -static int sapi_thttpd_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int n; - uint sent = 0; - - if (TG(sbuf).c != 0) { - smart_str_appendl_ex(&TG(sbuf), str, str_length, 1); - return str_length; - } - - while (str_length > 0) { - PHP_SYS_CALL(n = send(TG(hc)->conn_fd, str, str_length, 0);); - - if (n == -1) { - if (errno == EAGAIN) { - smart_str_appendl_ex(&TG(sbuf), str, str_length, 1); - - return sent + str_length; - } else - php_handle_aborted_connection(); - } - - TG(hc)->bytes_sent += n; - str += n; - sent += n; - str_length -= n; - } - - return sent; -} - -#define COMBINE_HEADERS 64 - -#if defined(IOV_MAX) -# if IOV_MAX - 64 <= 0 -# define SERIALIZE_HEADERS -# endif -#endif - -static int do_writev(struct iovec *vec, int nvec, int len TSRMLS_DC) -{ - int n; - - assert(nvec <= IOV_MAX); - - if (TG(sbuf).c == 0) { - PHP_SYS_CALL(n = writev(TG(hc)->conn_fd, vec, nvec);); - - if (n == -1) { - if (errno == EAGAIN) { - n = 0; - } else { - php_handle_aborted_connection(); - } - } - - - TG(hc)->bytes_sent += n; - } else { - n = 0; - } - - if (n < len) { - int i; - - /* merge all unwritten data into sbuf */ - for (i = 0; i < nvec; vec++, i++) { - /* has this vector been written completely? */ - if (n >= vec->iov_len) { - /* yes, proceed */ - n -= vec->iov_len; - continue; - } - - if (n > 0) { - /* adjust vector */ - vec->iov_base = (char *) vec->iov_base + n; - vec->iov_len -= n; - n = 0; - } - - smart_str_appendl_ex(&TG(sbuf), vec->iov_base, vec->iov_len, 1); - } - } - - return 0; -} - -#ifdef SERIALIZE_HEADERS -# define ADD_VEC(str,l) smart_str_appendl(&vec_str, (str), (l)) -# define VEC_BASE() smart_str vec_str = {0} -# define VEC_FREE() smart_str_free(&vec_str) -#else -# define ADD_VEC(str,l) vec[n].iov_base=str;len += (vec[n].iov_len=l); n++ -# define VEC_BASE() struct iovec vec[COMBINE_HEADERS] -# define VEC_FREE() do {} while (0) -#endif - -#define ADD_VEC_S(str) ADD_VEC((str), sizeof(str)-1) - -#define CL_TOKEN "Content-length: " -#define CN_TOKEN "Connection: " -#define KA_DO "Connection: keep-alive\r\n" -#define KA_NO "Connection: close\r\n" -#define DEF_CT "Content-Type: text/html\r\n" - -static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -{ - char buf[1024], *p; - VEC_BASE(); - int n = 0; - zend_llist_position pos; - sapi_header_struct *h; - size_t len = 0; - - if (!SG(sapi_headers).http_status_line) { - ADD_VEC_S("HTTP/1.1 "); - p = smart_str_print_long(buf+sizeof(buf)-1, - SG(sapi_headers).http_response_code); - ADD_VEC(p, strlen(p)); - ADD_VEC_S(" HTTP\r\n"); - } else { - ADD_VEC(SG(sapi_headers).http_status_line, - strlen(SG(sapi_headers).http_status_line)); - ADD_VEC("\r\n", 2); - } - TG(hc)->status = SG(sapi_headers).http_response_code; - - if (SG(sapi_headers).send_default_content_type) { - ADD_VEC(DEF_CT, strlen(DEF_CT)); - } - - h = zend_llist_get_first_ex(&sapi_headers->headers, &pos); - while (h) { - - switch (h->header[0]) { - case 'c': case 'C': - if (!TG(seen_cl) && strncasecmp(h->header, CL_TOKEN, sizeof(CL_TOKEN)-1) == 0) { - TG(seen_cl) = 1; - } else if (!TG(seen_cn) && strncasecmp(h->header, CN_TOKEN, sizeof(CN_TOKEN)-1) == 0) { - TG(seen_cn) = 1; - } - } - - ADD_VEC(h->header, h->header_len); -#ifndef SERIALIZE_HEADERS - if (n >= COMBINE_HEADERS - 1) { - len = do_writev(vec, n, len TSRMLS_CC); - n = 0; - } -#endif - ADD_VEC("\r\n", 2); - - h = zend_llist_get_next_ex(&sapi_headers->headers, &pos); - } - - if (TG(seen_cl) && !TG(seen_cn) && TG(hc)->do_keep_alive) { - ADD_VEC(KA_DO, sizeof(KA_DO)-1); - } else { - TG(hc)->do_keep_alive = 0; - ADD_VEC(KA_NO, sizeof(KA_NO)-1); - } - - ADD_VEC("\r\n", 2); - -#ifdef SERIALIZE_HEADERS - sapi_thttpd_ub_write(vec_str.c, vec_str.len TSRMLS_CC); -#else - do_writev(vec, n, len TSRMLS_CC); -#endif - - VEC_FREE(); - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -/* to understand this, read cgi_interpose_input() in libhttpd.c */ -#define SIZEOF_UNCONSUMED_BYTES() (TG(hc)->read_idx - TG(hc)->checked_idx) -#define CONSUME_BYTES(n) do { TG(hc)->checked_idx += (n); } while (0) - - -static int sapi_thttpd_read_post(char *buffer, uint count_bytes TSRMLS_DC) -{ - size_t read_bytes = 0; - - if (TG(unconsumed_length) > 0) { - read_bytes = MIN(TG(unconsumed_length), count_bytes); - memcpy(buffer, TG(hc)->read_buf + TG(hc)->checked_idx, read_bytes); - TG(unconsumed_length) -= read_bytes; - CONSUME_BYTES(read_bytes); - } - - return read_bytes; -} - -static char *sapi_thttpd_read_cookies(TSRMLS_D) -{ - return TG(hc)->cookie; -} - -#define BUF_SIZE 512 -#define ADD_STRING_EX(name,buf) \ - php_register_variable(name, buf, track_vars_array TSRMLS_CC) -#define ADD_STRING(name) ADD_STRING_EX((name), buf) - -static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC) -{ - char buf[BUF_SIZE + 1]; - char *p; - - php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC); - - if (TG(hc)->one_one) { - php_register_variable("SERVER_PROTOCOL", "HTTP/1.1", track_vars_array TSRMLS_CC); - } else { - php_register_variable("SERVER_PROTOCOL", "HTTP/1.0", track_vars_array TSRMLS_CC); - } - - p = httpd_ntoa(&TG(hc)->client_addr); - - ADD_STRING_EX("REMOTE_ADDR", p); - ADD_STRING_EX("REMOTE_HOST", p); - - ADD_STRING_EX("SERVER_PORT", - smart_str_print_long(buf + sizeof(buf) - 1, - TG(hc)->hs->port)); - - buf[0] = '/'; - memcpy(buf + 1, TG(hc)->pathinfo, strlen(TG(hc)->pathinfo) + 1); - ADD_STRING("PATH_INFO"); - - buf[0] = '/'; - memcpy(buf + 1, TG(hc)->origfilename, strlen(TG(hc)->origfilename) + 1); - ADD_STRING("SCRIPT_NAME"); - -#define CONDADD(name, field) \ - if (TG(hc)->field[0]) { \ - php_register_variable(#name, TG(hc)->field, track_vars_array TSRMLS_CC); \ - } - - CONDADD(QUERY_STRING, query); - CONDADD(HTTP_HOST, hdrhost); - CONDADD(HTTP_REFERER, referer); - CONDADD(HTTP_USER_AGENT, useragent); - CONDADD(HTTP_ACCEPT, accept); - CONDADD(HTTP_ACCEPT_LANGUAGE, acceptl); - CONDADD(HTTP_ACCEPT_ENCODING, accepte); - CONDADD(HTTP_COOKIE, cookie); - CONDADD(CONTENT_TYPE, contenttype); - CONDADD(REMOTE_USER, remoteuser); - CONDADD(SERVER_PROTOCOL, protocol); - - if (TG(hc)->contentlength != -1) { - ADD_STRING_EX("CONTENT_LENGTH", - smart_str_print_long(buf + sizeof(buf) - 1, - TG(hc)->contentlength)); - } - - if (TG(hc)->authorization[0]) - php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC); -} - -static PHP_MINIT_FUNCTION(thttpd) -{ - return SUCCESS; -} - -static zend_module_entry php_thttpd_module = { - STANDARD_MODULE_HEADER, - "thttpd", - NULL, - PHP_MINIT(thttpd), - NULL, - NULL, - NULL, - NULL, /* info */ - NULL, - STANDARD_MODULE_PROPERTIES -}; - -static int php_thttpd_startup(sapi_module_struct *sapi_module) -{ -#if PHP_API_VERSION >= 20020918 - if (php_module_startup(sapi_module, &php_thttpd_module, 1) == FAILURE) { -#else - if (php_module_startup(sapi_module) == FAILURE - || zend_startup_module(&php_thttpd_module) == FAILURE) { -#endif - return FAILURE; - } - return SUCCESS; -} - -static int sapi_thttpd_get_fd(int *nfd TSRMLS_DC) -{ - if (nfd) *nfd = TG(hc)->conn_fd; - return SUCCESS; -} - -static sapi_module_struct thttpd_sapi_module = { - "thttpd", - "thttpd", - - php_thttpd_startup, - php_module_shutdown_wrapper, - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_thttpd_ub_write, - NULL, - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, - - NULL, - sapi_thttpd_send_headers, - NULL, - sapi_thttpd_read_post, - sapi_thttpd_read_cookies, - - sapi_thttpd_register_variables, - NULL, /* Log message */ - NULL, /* Get request time */ - - NULL, /* php.ini path override */ - NULL, /* Block interruptions */ - NULL, /* Unblock interruptions */ - - NULL, - NULL, - NULL, - 0, - sapi_thttpd_get_fd -}; - -static void thttpd_module_main(int show_source TSRMLS_DC) -{ - zend_file_handle file_handle; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return; - } - - if (show_source) { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - php_get_highlight_struct(&syntax_highlighter_ini); - highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC); - } else { - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - php_execute_script(&file_handle TSRMLS_CC); - } - - php_request_shutdown(NULL); -} - -static void thttpd_request_ctor(TSRMLS_D) -{ - smart_str s = {0}; - - TG(seen_cl) = 0; - TG(seen_cn) = 0; - TG(sbuf).c = 0; - SG(request_info).query_string = TG(hc)->query?strdup(TG(hc)->query):NULL; - - smart_str_appends_ex(&s, TG(hc)->hs->cwd, 1); - smart_str_appends_ex(&s, TG(hc)->expnfilename, 1); - smart_str_0(&s); - SG(request_info).path_translated = s.c; - - s.c = NULL; - smart_str_appendc_ex(&s, '/', 1); - smart_str_appends_ex(&s, TG(hc)->origfilename, 1); - smart_str_0(&s); - SG(request_info).request_uri = s.c; - SG(request_info).request_method = httpd_method_str(TG(hc)->method); - if (TG(hc)->one_one) SG(request_info).proto_num = 1001; - else SG(request_info).proto_num = 1000; - SG(sapi_headers).http_response_code = 200; - if (TG(hc)->contenttype) - SG(request_info).content_type = strdup(TG(hc)->contenttype); - SG(request_info).content_length = TG(hc)->contentlength == -1 ? 0 - : TG(hc)->contentlength; - - TG(unconsumed_length) = SG(request_info).content_length; - - php_handle_auth_data(TG(hc)->authorization TSRMLS_CC); -} - -static void thttpd_request_dtor(TSRMLS_D) -{ - smart_str_free_ex(&TG(sbuf), 1); - if (SG(request_info).query_string) - free(SG(request_info).query_string); - free(SG(request_info).request_uri); - free(SG(request_info).path_translated); - if (SG(request_info).content_type) - free(SG(request_info).content_type); -} - -#ifdef ZTS - -#ifdef TSRM_ST -#define thread_create_simple_detached(n) st_thread_create(n, NULL, 0, 0) -#define thread_usleep(n) st_usleep(n) -#define thread_exit() st_thread_exit(NULL) -/* No preemption, simple operations are safe */ -#define thread_atomic_inc(n) (++n) -#define thread_atomic_dec(n) (--n) -#else -#error No thread primitives available -#endif - -/* We might want to replace this with a STAILQ */ -typedef struct qreq { - httpd_conn *hc; - struct qreq *next; -} qreq_t; - -static MUTEX_T qr_lock; -static qreq_t *queued_requests; -static qreq_t *last_qr; -static int nr_free_threads; -static int nr_threads; -static int max_threads = 50; - -#define HANDLE_STRINGS() { \ - HANDLE_STR(encodedurl); \ - HANDLE_STR(decodedurl); \ - HANDLE_STR(origfilename); \ - HANDLE_STR(expnfilename); \ - HANDLE_STR(pathinfo); \ - HANDLE_STR(query); \ - HANDLE_STR(referer); \ - HANDLE_STR(useragent); \ - HANDLE_STR(accept); \ - HANDLE_STR(accepte); \ - HANDLE_STR(acceptl); \ - HANDLE_STR(cookie); \ - HANDLE_STR(contenttype); \ - HANDLE_STR(authorization); \ - HANDLE_STR(remoteuser); \ - } - -static httpd_conn *duplicate_conn(httpd_conn *hc, httpd_conn *nhc) -{ - memcpy(nhc, hc, sizeof(*nhc)); - -#define HANDLE_STR(m) nhc->m = nhc->m ? strdup(nhc->m) : NULL - HANDLE_STRINGS(); -#undef HANDLE_STR - - return nhc; -} - -static void destroy_conn(httpd_conn *hc) -{ -#define HANDLE_STR(m) if (hc->m) free(hc->m) - HANDLE_STRINGS(); -#undef HANDLE_STR -} - -static httpd_conn *dequeue_request(void) -{ - httpd_conn *ret = NULL; - qreq_t *m; - - tsrm_mutex_lock(qr_lock); - if (queued_requests) { - m = queued_requests; - ret = m->hc; - if (!(queued_requests = m->next)) - last_qr = NULL; - free(m); - } - tsrm_mutex_unlock(qr_lock); - - return ret; -} - -static void *worker_thread(void *); - -static void queue_request(httpd_conn *hc) -{ - qreq_t *m; - httpd_conn *nhc; - - /* Mark as long-running request */ - hc->file_address = (char *) 1; - - /* - * We cannot synchronously revoke accesses to hc in the worker - * thread, so we need to pass a copy of hc to the worker thread. - */ - nhc = malloc(sizeof *nhc); - duplicate_conn(hc, nhc); - - /* Allocate request queue container */ - m = malloc(sizeof *m); - m->hc = nhc; - m->next = NULL; - - tsrm_mutex_lock(qr_lock); - /* Create new threads when reaching a certain threshhold */ - if (nr_threads < max_threads && nr_free_threads < 2) { - nr_threads++; /* protected by qr_lock */ - - thread_atomic_inc(nr_free_threads); - thread_create_simple_detached(worker_thread); - } - /* Insert container into request queue */ - if (queued_requests) - last_qr->next = m; - else - queued_requests = m; - last_qr = m; - tsrm_mutex_unlock(qr_lock); -} - -static off_t thttpd_real_php_request(httpd_conn *hc, int TSRMLS_DC); - -static void *worker_thread(void *dummy) -{ - int do_work = 50; - httpd_conn *hc; - - while (do_work) { - hc = dequeue_request(); - - if (!hc) { -/* do_work--; */ - thread_usleep(500000); - continue; - } -/* do_work = 50; */ - - thread_atomic_dec(nr_free_threads); - - thttpd_real_php_request(hc, 0 TSRMLS_CC); - shutdown(hc->conn_fd, 0); - destroy_conn(hc); - free(hc); - - thread_atomic_inc(nr_free_threads); - } - thread_atomic_dec(nr_free_threads); - thread_atomic_dec(nr_threads); - thread_exit(); -} - -static void remove_dead_conn(int fd) -{ - qreq_t *m, *prev = NULL; - - tsrm_mutex_lock(qr_lock); - m = queued_requests; - while (m) { - if (m->hc->conn_fd == fd) { - if (prev) - if (!(prev->next = m->next)) - last_qr = prev; - else - if (!(queued_requests = m->next)) - last_qr = NULL; - destroy_conn(m->hc); - free(m->hc); - free(m); - break; - } - prev = m; - m = m->next; - } - tsrm_mutex_unlock(qr_lock); -} - -#endif - -static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC) -{ - TG(hc) = hc; - hc->bytes_sent = 0; - - if (hc->contentlength != -1) { - hc->should_linger = 1; - hc->do_keep_alive = 0; - } - - if (hc->contentlength != -1 - && SIZEOF_UNCONSUMED_BYTES() < hc->contentlength) { - hc->read_body_into_mem = 1; - return 0; - } - - thttpd_request_ctor(TSRMLS_C); - - thttpd_module_main(show_source TSRMLS_CC); - - /* disable kl, if no content-length was seen or Connection: was set */ - if (TG(seen_cl) == 0 || TG(seen_cn) == 1) { - TG(hc)->do_keep_alive = 0; - } - - if (TG(sbuf).c != 0) { - if (TG(hc)->response) - free(TG(hc)->response); - - TG(hc)->response = TG(sbuf).c; - TG(hc)->responselen = TG(sbuf).len; - TG(hc)->maxresponse = TG(sbuf).a; - - TG(sbuf).c = 0; - TG(sbuf).len = 0; - TG(sbuf).a = 0; - } - - thttpd_request_dtor(TSRMLS_C); - - return 0; -} - -off_t thttpd_php_request(httpd_conn *hc, int show_source) -{ -#ifdef ZTS - queue_request(hc); -#else - TSRMLS_FETCH(); - return thttpd_real_php_request(hc, show_source TSRMLS_CC); -#endif -} - -void thttpd_register_on_close(void (*arg)(int)) -{ - TSRMLS_FETCH(); - TG(on_close) = arg; -} - -void thttpd_closed_conn(int fd) -{ - TSRMLS_FETCH(); - if (TG(on_close)) TG(on_close)(fd); -} - -int thttpd_get_fd(void) -{ - TSRMLS_FETCH(); - return TG(hc)->conn_fd; -} - -void thttpd_set_dont_close(void) -{ - TSRMLS_FETCH(); -#ifndef PREMIUM_THTTPD - TG(hc)->file_address = (char *) 1; -#endif -} - - -void thttpd_php_init(void) -{ - char *ini; - -#ifdef ZTS - tsrm_startup(1, 1, 0, NULL); - ts_allocate_id(&thttpd_globals_id, sizeof(php_thttpd_globals), NULL, NULL); - qr_lock = tsrm_mutex_alloc(); - thttpd_register_on_close(remove_dead_conn); -#endif - - if ((ini = getenv("PHP_INI_PATH"))) { - thttpd_sapi_module.php_ini_path_override = ini; - } - - sapi_startup(&thttpd_sapi_module); - thttpd_sapi_module.startup(&thttpd_sapi_module); - - { - TSRMLS_FETCH(); - - SG(server_context) = (void *) 1; - } -} - -void thttpd_php_shutdown(void) -{ - TSRMLS_FETCH(); - - if (SG(server_context) != NULL) { - thttpd_sapi_module.shutdown(&thttpd_sapi_module); - sapi_shutdown(); -#ifdef ZTS - tsrm_shutdown(); -#endif - } -} diff --git a/sapi/thttpd/thttpd_patch b/sapi/thttpd/thttpd_patch deleted file mode 100644 index 33de9214891a8..0000000000000 --- a/sapi/thttpd/thttpd_patch +++ /dev/null @@ -1,2377 +0,0 @@ -diff -ur thttpd-2.21b/Makefile.in thttpd-2.21b-cool/Makefile.in ---- thttpd-2.21b/Makefile.in Thu Mar 29 20:36:21 2001 -+++ thttpd-2.21b-cool/Makefile.in Sat Sep 20 14:43:20 2003 -@@ -46,13 +46,15 @@ - - # You shouldn't need to edit anything below here. - -+include php_makefile -+ - CC = @CC@ - CCOPT = @V_CCOPT@ - DEFS = @DEFS@ --INCLS = -I. -+INCLS = -I. $(PHP_CFLAGS) - CFLAGS = $(CCOPT) $(DEFS) $(INCLS) --LDFLAGS = @LDFLAGS@ --LIBS = @LIBS@ -+LDFLAGS = @LDFLAGS@ $(PHP_LDFLAGS) -+LIBS = @LIBS@ $(PHP_LIBS) - NETLIBS = @V_NETLIBS@ - INSTALL = @INSTALL@ - -@@ -62,7 +64,7 @@ - @rm -f $@ - $(CC) $(CFLAGS) -c $*.c - --SRC = thttpd.c libhttpd.c fdwatch.c mmc.c timers.c match.c tdate_parse.c syslog.c -+SRC = thttpd.c libhttpd.c fdwatch.c mmc.c timers.c match.c tdate_parse.c syslog.c php_thttpd.c - - OBJ = $(SRC:.c=.o) @LIBOBJS@ - -@@ -77,7 +79,7 @@ - all: this subdirs - this: $(ALL) - --thttpd: $(OBJ) -+thttpd: $(OBJ) libphp5.a - @rm -f $@ - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(NETLIBS) - -diff -ur thttpd-2.21b/config.h thttpd-2.21b-cool/config.h ---- thttpd-2.21b/config.h Mon Apr 9 23:57:36 2001 -+++ thttpd-2.21b-cool/config.h Sat Sep 20 14:43:20 2003 -@@ -82,6 +82,11 @@ - */ - #define IDLE_READ_TIMELIMIT 60 - -+/* CONFIGURE: How many seconds to allow for reading the subsequent requests -+** on a keep-alive connection. Should be simiar to LINGER_TIME -+*/ -+#define IDLE_KEEPALIVE_TIMELIMIT 2 -+ - /* CONFIGURE: How many seconds before an idle connection gets closed. - */ - #define IDLE_SEND_TIMELIMIT 300 -@@ -316,7 +321,7 @@ - /* CONFIGURE: A list of index filenames to check. The files are searched - ** for in this order. - */ --#define INDEX_NAMES "index.html", "index.htm", "Default.htm", "index.cgi" -+#define INDEX_NAMES "index.php", "index.html", "index.htm", "Default.htm", "index.cgi" - - /* CONFIGURE: If this is defined then thttpd will automatically generate - ** index pages for directories that don't have an explicit index file. -diff -ur thttpd-2.21b/configure thttpd-2.21b-cool/configure ---- thttpd-2.21b/configure Sat Apr 21 02:07:14 2001 -+++ thttpd-2.21b-cool/configure Sat Sep 20 14:43:20 2003 -@@ -1021,7 +1021,7 @@ - fi - echo "$ac_t""$CPP" 1>&6 - --for ac_hdr in fcntl.h grp.h memory.h paths.h poll.h sys/poll.h sys/event.h osreldate.h -+for ac_hdr in fcntl.h grp.h memory.h paths.h poll.h sys/poll.h sys/event.h osreldate.h netinet/tcp.h - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` - echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -diff -ur thttpd-2.21b/configure.in thttpd-2.21b-cool/configure.in ---- thttpd-2.21b/configure.in Sat Apr 21 02:06:23 2001 -+++ thttpd-2.21b-cool/configure.in Sat Sep 20 14:43:20 2003 -@@ -64,7 +64,7 @@ - AC_MSG_RESULT(no) - fi - --AC_CHECK_HEADERS(fcntl.h grp.h memory.h paths.h poll.h sys/poll.h sys/event.h osreldate.h) -+AC_CHECK_HEADERS(fcntl.h grp.h memory.h paths.h poll.h sys/poll.h sys/event.h osreldate.h netinet/tcp.h) - AC_HEADER_TIME - AC_HEADER_DIRENT - -diff -ur thttpd-2.21b/fdwatch.c thttpd-2.21b-cool/fdwatch.c ---- thttpd-2.21b/fdwatch.c Fri Apr 13 07:36:08 2001 -+++ thttpd-2.21b-cool/fdwatch.c Sat Sep 20 14:43:20 2003 -@@ -419,6 +419,7 @@ - if ( pollfds == (struct pollfd*) 0 || poll_fdidx == (int*) 0 || - poll_rfdidx == (int*) 0 ) - return -1; -+ memset(pollfds, 0, sizeof(struct pollfd) * nfiles); - return 0; - } - -@@ -460,7 +461,7 @@ - - ridx = 0; - for ( i = 0; i < npollfds; ++i ) -- if ( pollfds[i].revents & ( POLLIN | POLLOUT ) ) -+ if ( pollfds[i].revents & ( POLLIN | POLLOUT | POLLERR | POLLHUP | POLLNVAL ) ) - poll_rfdidx[ridx++] = pollfds[i].fd; - - return r; -@@ -472,8 +473,8 @@ - { - switch ( fd_rw[fd] ) - { -- case FDW_READ: return pollfds[poll_fdidx[fd]].revents & POLLIN; -- case FDW_WRITE: return pollfds[poll_fdidx[fd]].revents & POLLOUT; -+ case FDW_READ: return pollfds[poll_fdidx[fd]].revents & ( POLLIN | POLLERR | POLLHUP | POLLNVAL ); -+ case FDW_WRITE: return pollfds[poll_fdidx[fd]].revents & ( POLLOUT | POLLERR | POLLHUP | POLLNVAL ); - default: return 0; - } - } -diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c ---- thttpd-2.21b/libhttpd.c Tue Apr 24 00:42:40 2001 -+++ thttpd-2.21b-cool/libhttpd.c Sat Sep 20 14:43:29 2003 -@@ -56,6 +56,10 @@ - #include - #include - -+#ifdef HAVE_NETINET_TCP_H -+#include -+#endif -+ - #ifdef HAVE_OSRELDATE_H - #include - #endif /* HAVE_OSRELDATE_H */ -@@ -85,6 +89,12 @@ - #include "match.h" - #include "tdate_parse.h" - -+#include "php_thttpd.h" -+ -+#ifdef __CYGWIN__ -+# define timezone _timezone -+#endif -+ - #ifndef STDIN_FILENO - #define STDIN_FILENO 0 - #endif -@@ -111,7 +121,7 @@ - static int initialize_listen_socket( httpd_sockaddr* saP ); - static void unlisten( httpd_server* hs ); - static void add_response( httpd_conn* hc, char* str ); --static void send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod ); -+static void send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod, const char *, size_t ); - static void send_response( httpd_conn* hc, int status, char* title, char* extraheads, char* form, char* arg ); - static void send_response_tail( httpd_conn* hc ); - static void defang( char* str, char* dfstr, int dfsize ); -@@ -242,6 +252,10 @@ - free( (void*) hs->cwd ); - if ( hs->cgi_pattern != (char*) 0 ) - free( (void*) hs->cgi_pattern ); -+ if ( hs->php_pattern != (char*) 0 ) -+ free( (void*) hs->php_pattern ); -+ if ( hs->phps_pattern != (char*) 0 ) -+ free( (void*) hs->phps_pattern ); - if ( hs->charset != (char*) 0 ) - free( (void*) hs->charset ); - if ( hs->url_pattern != (char*) 0 ) -@@ -249,6 +263,7 @@ - if ( hs->local_pattern != (char*) 0 ) - free( (void*) hs->local_pattern ); - free( (void*) hs ); -+ thttpd_php_shutdown(); - } - - -@@ -257,7 +272,8 @@ - char* hostname, httpd_sockaddr* sa4P, httpd_sockaddr* sa6P, int port, - char* cgi_pattern, char* charset, char* cwd, int no_log, FILE* logfp, - int no_symlink, int vhost, int global_passwd, char* url_pattern, -- char* local_pattern, int no_empty_referers ) -+ char* local_pattern, int no_empty_referers, char* php_pattern, -+ char* phps_pattern ) - { - httpd_server* hs; - static char ghnbuf[256]; -@@ -312,6 +328,8 @@ - } - - hs->port = port; -+ hs->php_pattern = strdup(php_pattern); -+ hs->phps_pattern = strdup(phps_pattern); - if ( cgi_pattern == (char*) 0 ) - hs->cgi_pattern = (char*) 0; - else -@@ -329,7 +347,7 @@ - while ( ( cp = strstr( hs->cgi_pattern, "|/" ) ) != (char*) 0 ) - (void) strcpy( cp + 1, cp + 2 ); - } -- hs->charset = strdup( charset ); -+ hs->charset = strdup( charset ); - hs->cwd = strdup( cwd ); - if ( hs->cwd == (char*) 0 ) - { -@@ -385,6 +403,8 @@ - return (httpd_server*) 0; - } - -+ thttpd_php_init(); -+ - /* Done initializing. */ - if ( hs->binding_hostname == (char*) 0 ) - syslog( LOG_INFO, "%.80s starting on port %d", SERVER_SOFTWARE, hs->port ); -@@ -418,6 +438,11 @@ - } - (void) fcntl( listen_fd, F_SETFD, 1 ); - -+#if defined(TCP_DEFER_ACCEPT) && defined(SOL_TCP) -+ on = 30; /* give clients 30s to send first data packet */ -+ setsockopt(listen_fd, SOL_TCP, TCP_DEFER_ACCEPT, &on, sizeof(on)); -+#endif -+ - /* Allow reuse of local addresses. */ - on = 1; - if ( setsockopt( -@@ -582,6 +607,9 @@ - /* And send it, if necessary. */ - if ( hc->responselen > 0 ) - { -+/* -+printf("**RESPONSE [%d]** len = %d\n%*.*s\n", hc->conn_fd, hc->responselen, hc->responselen, hc->responselen, hc->response); -+*/ - (void) write( hc->conn_fd, hc->response, hc->responselen ); - hc->responselen = 0; - } -@@ -619,18 +647,22 @@ - } - } - -+extern time_t httpd_time_now; -+extern char httpd_now_buf[]; -+ -+#define SMART_STR_USE_REALLOC -+ -+#include "ext/standard/php_smart_str.h" - - static void --send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod ) -+send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod, const char *last_modified, size_t last_modified_len) - { -- time_t now; - const char* rfc1123fmt = "%a, %d %b %Y %H:%M:%S GMT"; -- char nowbuf[100]; - char modbuf[100]; -- char fixed_type[500]; -- char buf[1000]; - int partial_content; -- -+ smart_str s = {0}; -+ int type_len; -+ - hc->status = status; - hc->bytes_to_send = length; - if ( hc->mime_flag ) -@@ -649,41 +681,89 @@ - else - partial_content = 0; - -- now = time( (time_t*) 0 ); - if ( mod == (time_t) 0 ) -- mod = now; -- (void) strftime( nowbuf, sizeof(nowbuf), rfc1123fmt, gmtime( &now ) ); -- (void) strftime( modbuf, sizeof(modbuf), rfc1123fmt, gmtime( &mod ) ); -- (void) my_snprintf( -- fixed_type, sizeof(fixed_type), type, hc->hs->charset ); -- (void) my_snprintf( buf, sizeof(buf), -- "%.20s %d %s\r\nServer: %s\r\nContent-Type: %s\r\nDate: %s\r\nLast-Modified: %s\r\nAccept-Ranges: bytes\r\nConnection: close\r\n", -- hc->protocol, status, title, EXPOSED_SERVER_SOFTWARE, fixed_type, -- nowbuf, modbuf ); -- add_response( hc, buf ); -+ mod = httpd_time_now; -+ -+ if (last_modified == 0) { -+ (void) strftime( modbuf, sizeof(modbuf), rfc1123fmt, gmtime( &mod ) ); -+ last_modified = modbuf; -+ last_modified_len = strlen(modbuf); -+ } -+ -+ type_len = strlen(type); -+ -+ if (hc->response) { -+ s.c = hc->response; -+ s.len = 0; -+ s.a = hc->maxresponse; -+ hc->response = 0; -+ hc->maxresponse = 0; -+ } -+ -+ smart_str_appends(&s, "HTTP/1.1 "); -+ smart_str_append_long(&s, status); -+ smart_str_appends(&s, " HTTP\r\nServer: " EXPOSED_SERVER_SOFTWARE "\r\n" -+ "Content-Type: "); -+ -+ if (type[type_len-2] == '%' && type[type_len-1] == 's') { -+ smart_str_appendl(&s, type, type_len - 2); -+ smart_str_appends(&s, hc->hs->charset); -+ } else { -+ smart_str_appendl(&s, type, type_len); -+ } -+ -+ -+ smart_str_appends(&s, "\r\nDate: "); -+ smart_str_appends(&s, httpd_now_buf); -+ smart_str_appends(&s, "\r\nLast-Modified: "); -+ smart_str_appendl(&s, last_modified, last_modified_len); -+ smart_str_appends(&s, "\r\nAccept-Ranges: bytes\r\n"); -+ - if ( encodings[0] != '\0' ) - { -- (void) my_snprintf( buf, sizeof(buf), -- "Content-Encoding: %s\r\n", encodings ); -- add_response( hc, buf ); -+ smart_str_appends(&s, "Content-Encoding: "); -+ smart_str_appends(&s, encodings); -+ smart_str_appends(&s, "\r\n"); - } - if ( partial_content ) - { -- (void) my_snprintf( buf, sizeof(buf), -- "Content-Range: bytes %ld-%ld/%d\r\nContent-Length: %ld\r\n", -- (long) hc->init_byte_loc, (long) hc->end_byte_loc, length, -- (long) ( hc->end_byte_loc - hc->init_byte_loc + 1 ) ); -- add_response( hc, buf ); -+ -+ smart_str_appends(&s, "Content-Range: bytes "); -+ smart_str_append_long(&s, hc->init_byte_loc); -+ smart_str_appendc(&s, '-'); -+ smart_str_append_long(&s, hc->end_byte_loc); -+ smart_str_appendc(&s, '/'); -+ smart_str_append_long(&s, length); -+ smart_str_appends(&s, "\r\nContent-Length: "); -+ smart_str_append_long(&s, hc->end_byte_loc - hc->init_byte_loc + 1); -+ smart_str_appends(&s, "\r\n"); -+ - } - else if ( length >= 0 ) - { -- (void) my_snprintf( buf, sizeof(buf), -- "Content-Length: %d\r\n", length ); -- add_response( hc, buf ); -+ smart_str_appends(&s, "Content-Length: "); -+ smart_str_append_long(&s, length); -+ smart_str_appends(&s, "\r\n"); - } -+ else { -+ hc->do_keep_alive = 0; -+ } - if ( extraheads[0] != '\0' ) -- add_response( hc, extraheads ); -- add_response( hc, "\r\n" ); -+ smart_str_appends(&s, extraheads); -+ if (hc->do_keep_alive) { -+ smart_str_appends(&s, "Connection: keep-alive\r\n\r\n" ); -+ } else { -+ smart_str_appends(&s, "Connection: close\r\n\r\n" ); -+ } -+ smart_str_0(&s); -+ -+ if (hc->response) { -+ free(hc->response); -+ } -+ hc->response = s.c; -+ hc->maxresponse = s.a; -+ hc->responselen = s.len; -+ - } - } - -@@ -725,7 +805,7 @@ - { - char defanged_arg[1000], buf[2000]; - -- send_mime( hc, status, title, "", extraheads, "text/html", -1, 0 ); -+ send_mime( hc, status, title, "", extraheads, "text/html", -1, 0, 0, 0 ); - (void) my_snprintf( buf, sizeof(buf), - "%d %s\n

%d %s

\n", - status, title, status, title ); -@@ -764,7 +844,7 @@ - char* cp2; - - for ( cp1 = str, cp2 = dfstr; -- *cp1 != '\0' && cp2 - dfstr < dfsize - 1; -+ *cp1 != '\0' && cp2 - dfstr < dfsize - 5; - ++cp1, ++cp2 ) - { - switch ( *cp1 ) -@@ -834,7 +914,7 @@ - fp = fopen( filename, "r" ); - if ( fp == (FILE*) 0 ) - return 0; -- send_mime( hc, status, title, "", extraheads, "text/html", -1, 0 ); -+ send_mime( hc, status, title, "", extraheads, "text/html", -1, 0, 0, 0 ); - for (;;) - { - r = fread( buf, 1, sizeof(buf) - 1, fp ); -@@ -1336,6 +1416,9 @@ - if ( hc->tildemapped ) - return 1; - -+ if ( hc->hostname[0] == '.' || strchr( hc->hostname, '/' ) != (char*) 0 ) -+ return 0; -+ - /* Figure out the host directory. */ - #ifdef VHOST_DIRLEVELS - httpd_realloc_str( -@@ -1436,7 +1519,7 @@ - restlen = strlen( path ); - httpd_realloc_str( &rest, &maxrest, restlen ); - (void) strcpy( rest, path ); -- if ( rest[restlen - 1] == '/' ) -+ if ( restlen > 0 && rest[restlen - 1] == '/' ) - rest[--restlen] = '\0'; /* trim trailing slash */ - if ( ! tildemapped ) - /* Remove any leading slashes. */ -@@ -1603,6 +1686,70 @@ - - - int -+httpd_request_reset(httpd_conn* hc, int preserve_read_buf ) -+{ -+ if (!preserve_read_buf) { -+ hc->read_idx = 0; -+ hc->checked_idx = 0; -+ } -+ -+ if (hc->read_buf_is_mmap) { -+ hc->read_buf_is_mmap = 0; -+ munmap(hc->read_buf, hc->read_size); -+ hc->read_buf = NULL; -+ hc->read_size = 0; -+ httpd_realloc_str( &hc->read_buf, &hc->read_size, 500 ); -+ } -+ hc->checked_state = CHST_FIRSTWORD; -+ hc->method = METHOD_UNKNOWN; -+ hc->status = 0; -+ hc->bytes_to_send = 0; -+ hc->bytes_sent = 0; -+ hc->encodedurl = ""; -+ hc->decodedurl[0] = '\0'; -+ hc->protocol = "UNKNOWN"; -+ hc->origfilename[0] = '\0'; -+ hc->expnfilename[0] = '\0'; -+ hc->encodings[0] = '\0'; -+ hc->pathinfo[0] = '\0'; -+ hc->query[0] = '\0'; -+ hc->referer = ""; -+ hc->useragent = ""; -+ hc->accept[0] = '\0'; -+ hc->accepte[0] = '\0'; -+ hc->acceptl = ""; -+ hc->cookie = ""; -+ hc->contenttype = ""; -+ hc->reqhost[0] = '\0'; -+ hc->hdrhost = ""; -+ hc->hostdir[0] = '\0'; -+ hc->authorization = ""; -+ hc->remoteuser[0] = '\0'; -+ hc->response[0] = '\0'; -+#ifdef TILDE_MAP_2 -+ hc->altdir[0] = '\0'; -+#endif /* TILDE_MAP_2 */ -+ hc->responselen = 0; -+ hc->if_modified_since = (time_t) -1; -+ hc->range_if = (time_t) -1; -+ hc->contentlength = -1; -+ hc->type = ""; -+ hc->hostname = (char*) 0; -+ hc->mime_flag = 1; -+ hc->one_one = 0; -+ hc->got_range = 0; -+ hc->tildemapped = 0; -+ hc->init_byte_loc = 0; -+ hc->end_byte_loc = -1; -+ hc->keep_alive = 0; -+ hc->do_keep_alive = 0; -+ hc->should_linger = 0; -+ hc->file_address = (char*) 0; -+ hc->read_body_into_mem = 0; -+ return GC_OK; -+} -+ -+int - httpd_get_conn( httpd_server* hs, int listen_fd, httpd_conn* hc ) - { - httpd_sockaddr sa; -@@ -1612,6 +1759,7 @@ - { - hc->read_size = 0; - httpd_realloc_str( &hc->read_buf, &hc->read_size, 500 ); -+ hc->read_buf_is_mmap = 0; - hc->maxdecodedurl = - hc->maxorigfilename = hc->maxexpnfilename = hc->maxencodings = - hc->maxpathinfo = hc->maxquery = hc->maxaccept = -@@ -1631,12 +1779,19 @@ - httpd_realloc_str( &hc->reqhost, &hc->maxreqhost, 0 ); - httpd_realloc_str( &hc->hostdir, &hc->maxhostdir, 0 ); - httpd_realloc_str( &hc->remoteuser, &hc->maxremoteuser, 0 ); -- httpd_realloc_str( &hc->response, &hc->maxresponse, 0 ); -+ httpd_realloc_str( &hc->response, &hc->maxresponse, 350 ); - #ifdef TILDE_MAP_2 - httpd_realloc_str( &hc->altdir, &hc->maxaltdir, 0 ); - #endif /* TILDE_MAP_2 */ - hc->initialized = 1; - } -+ if (hc->read_buf_is_mmap) { -+ hc->read_buf_is_mmap = 0; -+ munmap(hc->read_buf, hc->read_size); -+ hc->read_buf = NULL; -+ hc->read_size = 0; -+ httpd_realloc_str( &hc->read_buf, &hc->read_size, 500 ); -+ } - - /* Accept the new connection. */ - sz = sizeof(sa); -@@ -1657,53 +1812,12 @@ - hc->hs = hs; - memset( &hc->client_addr, 0, sizeof(hc->client_addr) ); - memcpy( &hc->client_addr, &sa, sockaddr_len( &sa ) ); -- hc->read_idx = 0; -- hc->checked_idx = 0; -- hc->checked_state = CHST_FIRSTWORD; -- hc->method = METHOD_UNKNOWN; -- hc->status = 0; -- hc->bytes_to_send = 0; -- hc->bytes_sent = 0; -- hc->encodedurl = ""; -- hc->decodedurl[0] = '\0'; -- hc->protocol = "UNKNOWN"; -- hc->origfilename[0] = '\0'; -- hc->expnfilename[0] = '\0'; -- hc->encodings[0] = '\0'; -- hc->pathinfo[0] = '\0'; -- hc->query[0] = '\0'; -- hc->referer = ""; -- hc->useragent = ""; -- hc->accept[0] = '\0'; -- hc->accepte[0] = '\0'; -- hc->acceptl = ""; -- hc->cookie = ""; -- hc->contenttype = ""; -- hc->reqhost[0] = '\0'; -- hc->hdrhost = ""; -- hc->hostdir[0] = '\0'; -- hc->authorization = ""; -- hc->remoteuser[0] = '\0'; -- hc->response[0] = '\0'; --#ifdef TILDE_MAP_2 -- hc->altdir[0] = '\0'; --#endif /* TILDE_MAP_2 */ -- hc->responselen = 0; -- hc->if_modified_since = (time_t) -1; -- hc->range_if = (time_t) -1; -- hc->contentlength = -1; -- hc->type = ""; -- hc->hostname = (char*) 0; -- hc->mime_flag = 1; -- hc->one_one = 0; -- hc->got_range = 0; -- hc->tildemapped = 0; -- hc->init_byte_loc = 0; -- hc->end_byte_loc = -1; -- hc->keep_alive = 0; -- hc->should_linger = 0; -- hc->file_address = (char*) 0; -- return GC_OK; -+ -+/* -+printf("doing httpd_get_con(%d)\n", hc->conn_fd); -+*/ -+ -+ return httpd_request_reset(hc, 0); - } - - -@@ -1720,6 +1834,9 @@ - { - char c; - -+/* -+printf("**REQUEST [%d]**\n%*.*s\n", hc->conn_fd, hc->read_idx, hc->read_idx, hc->read_buf); -+*/ - for ( ; hc->checked_idx < hc->read_idx; ++hc->checked_idx ) - { - c = hc->read_buf[hc->checked_idx]; -@@ -1912,8 +2029,11 @@ - eol = strpbrk( protocol, " \t\n\r" ); - if ( eol != (char*) 0 ) - *eol = '\0'; -- if ( strcasecmp( protocol, "HTTP/1.0" ) != 0 ) -+ if ( strcasecmp( protocol, "HTTP/1.0" ) != 0 ) { - hc->one_one = 1; -+ hc->keep_alive = 1; -+ hc->do_keep_alive = 1; -+ } - } - } - /* Check for HTTP/1.1 absolute URL. */ -@@ -2129,6 +2249,7 @@ - cp = &buf[11]; - cp += strspn( cp, " \t" ); - if ( strcasecmp( cp, "keep-alive" ) == 0 ) -+ hc->do_keep_alive = 1; - hc->keep_alive = 1; - } - #ifdef LOG_UNKNOWN_HEADERS -@@ -2168,6 +2289,9 @@ - } - } - -+/* -+printf("one_one = %d keep_alive = %d\n", hc->one_one, hc->keep_alive); -+*/ - if ( hc->one_one ) - { - /* Check that HTTP/1.1 requests specify a host, as required. */ -@@ -2177,14 +2301,14 @@ - return -1; - } - -- /* If the client wants to do keep-alives, it might also be doing -- ** pipelining. There's no way for us to tell. Since we don't -- ** implement keep-alives yet, if we close such a connection there -- ** might be unread pipelined requests waiting. So, we have to -- ** do a lingering close. -+ /* -+ ** Disable keep alive support for bad browsers, -+ ** list taken from Apache 1.3.19 - */ -- if ( hc->keep_alive ) -- hc->should_linger = 1; -+ if ( hc->do_keep_alive && -+ ( strstr(hc->useragent, "Mozilla/2") != NULL || -+ strstr(hc->useragent, "MSIE 4.0b2;") != NULL)) -+ hc->do_keep_alive = 0; - } - - /* Ok, the request has been parsed. Now we resolve stuff that -@@ -2349,15 +2473,24 @@ - - - void --httpd_close_conn( httpd_conn* hc, struct timeval* nowP ) -- { -- make_log_entry( hc, nowP ); -+httpd_complete_request( httpd_conn* hc, struct timeval* nowP) -+{ -+ if (hc->method != METHOD_UNKNOWN) -+ make_log_entry( hc, nowP ); - -- if ( hc->file_address != (char*) 0 ) -+ if ( hc->file_address == (char*) 1 ) -+ { -+ thttpd_closed_conn(hc->conn_fd); -+ } else if ( hc->file_address != (char*) 0 ) - { - mmc_unmap( hc->file_address, &(hc->sb), nowP ); - hc->file_address = (char*) 0; - } -+ } -+ -+void -+httpd_close_conn( httpd_conn* hc, struct timeval* nowP ) -+{ - if ( hc->conn_fd >= 0 ) - { - (void) close( hc->conn_fd ); -@@ -2370,7 +2503,12 @@ - { - if ( hc->initialized ) - { -- free( (void*) hc->read_buf ); -+ -+ if ( hc->read_buf_is_mmap ) { -+ munmap( hc->read_buf, hc->read_size ); -+ } else { -+ free( (void*) hc->read_buf ); -+ } - free( (void*) hc->decodedurl ); - free( (void*) hc->origfilename ); - free( (void*) hc->expnfilename ); -@@ -2556,7 +2694,7 @@ - return -1; - } - -- send_mime( hc, 200, ok200title, "", "", "text/html", -1, hc->sb.st_mtime ); -+ send_mime( hc, 200, ok200title, "", "", "text/html", -1, hc->sb.st_mtime, 0, 0 ); - if ( hc->method == METHOD_HEAD ) - closedir( dirp ); - else if ( hc->method == METHOD_GET ) -@@ -3026,11 +3164,9 @@ - post_post_garbage_hack( httpd_conn* hc ) - { - char buf[2]; -- int r; - -- r = recv( hc->conn_fd, buf, sizeof(buf), MSG_PEEK ); -- if ( r > 0 ) -- (void) read( hc->conn_fd, buf, r ); -+ fcntl(hc->conn_fd, F_SETFL, O_NONBLOCK); -+ (void) read( hc->conn_fd, buf, 2 ); - } - - -@@ -3313,6 +3449,11 @@ - int r; - ClientData client_data; - -+ /* -+ ** We are not going to leave the socket open after a CGI... too hard -+ */ -+ hc->do_keep_alive = 0; -+ - if ( hc->method == METHOD_GET || hc->method == METHOD_POST ) - { - httpd_clear_ndelay( hc->conn_fd ); -@@ -3369,6 +3510,7 @@ - int expnlen, indxlen; - char* cp; - char* pi; -+ int nocache = 0; - - expnlen = strlen( hc->expnfilename ); - -@@ -3561,6 +3703,16 @@ - match( hc->hs->cgi_pattern, hc->expnfilename ) ) - return cgi( hc ); - -+ if ( hc->hs->php_pattern != (char*) 0 && -+ match( hc->hs->php_pattern, hc->expnfilename)) { -+ return thttpd_php_request( hc, 0 ); -+ } -+ -+ if ( hc->hs->phps_pattern != (char*) 0 && -+ match( hc->hs->phps_pattern, hc->expnfilename)) { -+ return thttpd_php_request( hc, 1 ); -+ } -+ - /* It's not CGI. If it's executable or there's pathinfo, someone's - ** trying to either serve or run a non-CGI file as CGI. Either case - ** is prohibited. -@@ -3594,32 +3746,46 @@ - hc->end_byte_loc = hc->sb.st_size - 1; - - figure_mime( hc ); -+ if ( strncmp(hc->decodedurl, "/nocache/", sizeof("/nocache/") - 1 ) == 0 ) -+ nocache = 1; - - if ( hc->method == METHOD_HEAD ) - { - send_mime( - hc, 200, ok200title, hc->encodings, "", hc->type, hc->sb.st_size, -- hc->sb.st_mtime ); -+ hc->sb.st_mtime, 0, 0 ); - } -- else if ( hc->if_modified_since != (time_t) -1 && -+ else if ( !nocache && hc->if_modified_since != (time_t) -1 && - hc->if_modified_since >= hc->sb.st_mtime ) - { -- hc->method = METHOD_HEAD; - send_mime( -- hc, 304, err304title, hc->encodings, "", hc->type, hc->sb.st_size, -- hc->sb.st_mtime ); -+ hc, 304, err304title, hc->encodings, "", hc->type, -1, -+ hc->sb.st_mtime, 0, 0 ); - } - else - { -- hc->file_address = mmc_map( hc->expnfilename, &(hc->sb), nowP ); -+ char *extraheads = ""; -+ char *lm; -+ size_t lml; -+ -+ if ( nocache ) -+ { -+ extraheads = "Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n" -+ "Cache-Control: no-store, no-cache, must-revalidate, " -+ "post-check=0, pre-check=0\r\n" -+ "Pragma: no-cache\r\n"; -+ } -+ -+ hc->file_address = mmc_map( hc->expnfilename, &(hc->sb), nowP, nocache, &lm, &lml ); - if ( hc->file_address == (char*) 0 ) - { - httpd_send_err( hc, 500, err500title, "", err500form, hc->encodedurl ); - return -1; - } -+ - send_mime( -- hc, 200, ok200title, hc->encodings, "", hc->type, hc->sb.st_size, -- hc->sb.st_mtime ); -+ hc, 200, ok200title, hc->encodings, extraheads, hc->type, hc->sb.st_size, -+ hc->sb.st_mtime, lm, lml ); - } - - return 0; -@@ -3638,6 +3804,9 @@ - return r; - } - -+#define smart_str_append_const(a,b) smart_str_appendl(a,b,sizeof(b)-1) -+ -+static smart_str bentries; - - static void - make_log_entry( httpd_conn* hc, struct timeval* nowP ) -@@ -3648,88 +3817,62 @@ - - if ( hc->hs->no_log ) - return; -- -- /* This is straight CERN Combined Log Format - the only tweak -- ** being that if we're using syslog() we leave out the date, because -- ** syslogd puts it in. The included syslogtocern script turns the -- ** results into true CERN format. -- */ -- - /* Format remote user. */ - if ( hc->remoteuser[0] != '\0' ) -- ru = hc->remoteuser; -+ ru = hc->remoteuser; - else -- ru = "-"; -+ ru = "-"; - /* If we're vhosting, prepend the hostname to the url. This is - ** a little weird, perhaps writing separate log files for - ** each vhost would make more sense. - */ -- if ( hc->hs->vhost && ! hc->tildemapped ) -- (void) my_snprintf( url, sizeof(url), -- "/%.100s%.200s", -- hc->hostname == (char*) 0 ? hc->hs->server_hostname : hc->hostname, -- hc->encodedurl ); -- else -- (void) my_snprintf( url, sizeof(url), -- "%.200s", hc->encodedurl ); -- /* Format the bytes. */ -- if ( (long) hc->bytes_sent >= 0 ) -- (void) my_snprintf( bytes, sizeof(bytes), -- "%ld", (long) hc->bytes_sent ); -- else -- (void) strcpy( bytes, "-" ); - - /* Logfile or syslog? */ - if ( hc->hs->logfp != (FILE*) 0 ) -- { -- time_t now; -- struct tm* t; -- const char* cernfmt_nozone = "%d/%b/%Y:%H:%M:%S"; -- char date_nozone[100]; -- int zone; -- char sign; -- char date[100]; -- -- /* Get the current time, if necessary. */ -- if ( nowP != (struct timeval*) 0 ) -- now = nowP->tv_sec; -- else -- now = time( (time_t*) 0 ); -- /* Format the time, forcing a numeric timezone (some log analyzers -- ** are stoooopid about this). -- */ -- t = localtime( &now ); -- (void) strftime( date_nozone, sizeof(date_nozone), cernfmt_nozone, t ); --#ifdef HAVE_TM_GMTOFF -- zone = t->tm_gmtoff / 60L; --#else -- zone = -timezone / 60L; -- /* Probably have to add something about daylight time here. */ --#endif -- if ( zone >= 0 ) -- sign = '+'; -- else -- { -- sign = '-'; -- zone = -zone; -- } -- zone = ( zone / 60 ) * 100 + zone % 60; -- (void) my_snprintf( date, sizeof(date), -- "%s %c%04d", date_nozone, sign, zone ); -- /* And write the log entry. */ -- (void) fprintf( hc->hs->logfp, -- "%.80s - %.80s [%s] \"%.80s %.300s %.80s\" %d %s \"%.200s\" \"%.80s\"\n", -- httpd_ntoa( &hc->client_addr ), ru, date, -- httpd_method_str( hc->method ), url, hc->protocol, -- hc->status, bytes, hc->referer, hc->useragent ); -- (void) fflush( hc->hs->logfp ); /* don't need to flush every time */ -- } -- else -- syslog( LOG_INFO, -- "%.80s - %.80s \"%.80s %.200s %.80s\" %d %s \"%.200s\" \"%.80s\"", -- httpd_ntoa( &hc->client_addr ), ru, -- httpd_method_str( hc->method ), url, hc->protocol, -- hc->status, bytes, hc->referer, hc->useragent ); -+ { -+ /* XXXXXXX */ -+ -+ smart_str_appends(&bentries, httpd_ntoa(&hc->client_addr)); -+ smart_str_append_const(&bentries, " - "); -+ smart_str_appends(&bentries, ru); -+ smart_str_append_const(&bentries, " ["); -+ smart_str_appendl(&bentries, hc->hs->log_date, hc->hs->log_date_len); -+ smart_str_append_const(&bentries, "] \""); -+ smart_str_appends(&bentries, httpd_method_str(hc->method)); -+ smart_str_appendc(&bentries, ' '); -+ -+ if (hc->hs->vhost && ! hc->tildemapped) { -+ smart_str_appendc(&bentries, '/'); -+ if (hc->hostname) -+ smart_str_appends(&bentries, hc->hostname); -+ else -+ smart_str_appends(&bentries, hc->hs->server_hostname); -+ } -+ smart_str_appends(&bentries, hc->encodedurl); -+ -+ smart_str_appendc(&bentries, ' '); -+ smart_str_appends(&bentries, hc->protocol); -+ smart_str_append_const(&bentries, "\" "); -+ smart_str_append_long(&bentries, hc->status); -+ if (hc->bytes_sent >= 0) { -+ smart_str_appendc(&bentries, ' '); -+ smart_str_append_long(&bentries, hc->bytes_sent); -+ smart_str_append_const(&bentries, " \""); -+ } else { -+ smart_str_append_const(&bentries, " - \""); -+ } -+ smart_str_appends(&bentries, hc->referer); -+ smart_str_append_const(&bentries, "\" \""); -+ smart_str_appends(&bentries, hc->useragent); -+ smart_str_append_const(&bentries, "\"\n"); -+ -+ if (bentries.len > 16384) { -+ int fd = fileno(hc->hs->logfp); -+ write(fd, bentries.c, bentries.len); -+ bentries.len = 0; -+ } -+ } -+ - } - - -@@ -3840,7 +3983,24 @@ - { - #ifdef HAVE_GETNAMEINFO - static char str[200]; -+ static smart_str httpd_ntoa_buf; -+ -+ if (saP->sa_in.sin_family == AF_INET) { -+ unsigned long n = ntohl(saP->sa_in.sin_addr.s_addr); - -+ httpd_ntoa_buf.len = 0; -+ smart_str_append_long(&httpd_ntoa_buf, (n >> 24)); -+ smart_str_appendc(&httpd_ntoa_buf, '.'); -+ smart_str_append_long(&httpd_ntoa_buf, (n >> 16) & 255); -+ smart_str_appendc(&httpd_ntoa_buf, '.'); -+ smart_str_append_long(&httpd_ntoa_buf, (n >> 8) & 255); -+ smart_str_appendc(&httpd_ntoa_buf, '.'); -+ smart_str_append_long(&httpd_ntoa_buf, (n >> 0) & 255); -+ smart_str_0(&httpd_ntoa_buf); -+ -+ return httpd_ntoa_buf.c; -+ } -+ - if ( getnameinfo( &saP->sa, sockaddr_len( saP ), str, sizeof(str), 0, 0, NI_NUMERICHOST ) != 0 ) - { - str[0] = '?'; -diff -ur thttpd-2.21b/libhttpd.h thttpd-2.21b-cool/libhttpd.h ---- thttpd-2.21b/libhttpd.h Tue Apr 24 00:36:50 2001 -+++ thttpd-2.21b-cool/libhttpd.h Sat Sep 20 14:43:20 2003 -@@ -69,6 +69,8 @@ - char* server_hostname; - int port; - char* cgi_pattern; -+ char* php_pattern; -+ char* phps_pattern; - char* charset; - char* cwd; - int listen4_fd, listen6_fd; -@@ -80,6 +82,8 @@ - char* url_pattern; - char* local_pattern; - int no_empty_referers; -+ size_t log_date_len; -+ char log_date[100]; - } httpd_server; - - /* A connection. */ -@@ -88,6 +92,7 @@ - httpd_server* hs; - httpd_sockaddr client_addr; - char* read_buf; -+ char read_buf_is_mmap; - int read_size, read_idx, checked_idx; - int checked_state; - int method; -@@ -132,11 +137,12 @@ - int got_range; - int tildemapped; /* this connection got tilde-mapped */ - off_t init_byte_loc, end_byte_loc; -- int keep_alive; -+ int keep_alive, do_keep_alive; - int should_linger; - struct stat sb; - int conn_fd; - char* file_address; -+ char read_body_into_mem; - } httpd_conn; - - /* Methods. */ -@@ -168,7 +174,8 @@ - char* hostname, httpd_sockaddr* sa4P, httpd_sockaddr* sa6P, int port, - char* cgi_pattern, char* charset, char* cwd, int no_log, FILE* logfp, - int no_symlink, int vhost, int global_passwd, char* url_pattern, -- char* local_pattern, int no_empty_referers ); -+ char* local_pattern, int no_empty_referers, char* php_pattern, -+ char* phps_pattern ); - - /* Change the log file. */ - extern void httpd_set_logfp( httpd_server* hs, FILE* logfp ); -@@ -229,6 +236,8 @@ - ** If you don't have a current timeval handy just pass in 0. - */ - extern void httpd_close_conn( httpd_conn* hc, struct timeval* nowP ); -+void httpd_complete_request( httpd_conn* hc, struct timeval* nowP); -+int httpd_request_reset(httpd_conn* hc,int ); - - /* Call this to de-initialize a connection struct and *really* free the - ** mallocced strings. -diff -ur thttpd-2.21b/mime_encodings.txt thttpd-2.21b-cool/mime_encodings.txt ---- thttpd-2.21b/mime_encodings.txt Wed May 10 03:22:28 2000 -+++ thttpd-2.21b-cool/mime_encodings.txt Sat Sep 20 14:43:20 2003 -@@ -3,6 +3,6 @@ - # A list of file extensions followed by the corresponding MIME encoding. - # Extensions not found in the table proceed to the mime_types table. - --Z x-compress --gz x-gzip -+Z compress -+gz gzip - uu x-uuencode -diff -ur thttpd-2.21b/mime_types.txt thttpd-2.21b-cool/mime_types.txt ---- thttpd-2.21b/mime_types.txt Sat Apr 14 04:53:30 2001 -+++ thttpd-2.21b-cool/mime_types.txt Sat Sep 20 14:43:20 2003 -@@ -1,135 +1,138 @@ --# mime_types.txt --# --# A list of file extensions followed by the corresponding MIME type. --# Extensions not found in the table are returned as text/plain. -- --html text/html; charset=%s --htm text/html; charset=%s --txt text/plain; charset=%s --rtx text/richtext --etx text/x-setext --tsv text/tab-separated-values --css text/css --xml text/xml --dtd text/xml -- --gif image/gif --jpg image/jpeg --jpeg image/jpeg --jpe image/jpeg --jfif image/jpeg --tif image/tiff --tiff image/tiff --pbm image/x-portable-bitmap --pgm image/x-portable-graymap --ppm image/x-portable-pixmap --pnm image/x-portable-anymap --xbm image/x-xbitmap --xpm image/x-xpixmap --xwd image/x-xwindowdump --ief image/ief --png image/png -- --au audio/basic --snd audio/basic --aif audio/x-aiff --aiff audio/x-aiff --aifc audio/x-aiff --ra audio/x-pn-realaudio --ram audio/x-pn-realaudio --rm audio/x-pn-realaudio --rpm audio/x-pn-realaudio-plugin --wav audio/wav --mid audio/midi --midi audio/midi --kar audio/midi --mpga audio/mpeg --mp2 audio/mpeg --mp3 audio/mpeg -- --mpeg video/mpeg --mpg video/mpeg --mpe video/mpeg --qt video/quicktime --mov video/quicktime --avi video/x-msvideo --movie video/x-sgi-movie --mv video/x-sgi-movie --vx video/x-rad-screenplay -- --a application/octet-stream -+ez application/andrew-inset -+hqx application/mac-binhex40 -+cpt application/mac-compactpro -+doc application/msword - bin application/octet-stream -+dms application/octet-stream -+lha application/octet-stream -+lzh application/octet-stream - exe application/octet-stream --dump application/octet-stream --o application/octet-stream --class application/java --js application/x-javascript -+class application/octet-stream -+so application/octet-stream -+dll application/octet-stream -+oda application/oda -+pdf application/pdf - ai application/postscript - eps application/postscript - ps application/postscript --dir application/x-director -+smi application/smil -+smil application/smil -+mif application/vnd.mif -+xls application/vnd.ms-excel -+ppt application/vnd.ms-powerpoint -+wbxml application/vnd.wap.wbxml -+wmlc application/vnd.wap.wmlc -+wmlsc application/vnd.wap.wmlscriptc -+bcpio application/x-bcpio -+vcd application/x-cdlink -+pgn application/x-chess-pgn -+cpio application/x-cpio -+csh application/x-csh - dcr application/x-director -+dir application/x-director - dxr application/x-director --fgd application/x-director --aam application/x-authorware-map --aas application/x-authorware-seg --aab application/x-authorware-bin --fh4 image/x-freehand --fh7 image/x-freehand --fh5 image/x-freehand --fhc image/x-freehand --fh image/x-freehand --spl application/futuresplash --swf application/x-shockwave-flash - dvi application/x-dvi -+spl application/x-futuresplash - gtar application/x-gtar - hdf application/x-hdf --hqx application/mac-binhex40 --iv application/x-inventor -+js application/x-javascript -+skp application/x-koan -+skd application/x-koan -+skt application/x-koan -+skm application/x-koan - latex application/x-latex --man application/x-troff-man --me application/x-troff-me --mif application/x-mif --ms application/x-troff-ms --oda application/oda --pdf application/pdf --rtf application/rtf --bcpio application/x-bcpio --cpio application/x-cpio --sv4cpio application/x-sv4cpio --sv4crc application/x-sv4crc --sh application/x-shar -+nc application/x-netcdf -+cdf application/x-netcdf -+sh application/x-sh - shar application/x-shar -+swf application/x-shockwave-flash - sit application/x-stuffit -+sv4cpio application/x-sv4cpio -+sv4crc application/x-sv4crc - tar application/x-tar -+tcl application/x-tcl - tex application/x-tex --texi application/x-texinfo - texinfo application/x-texinfo -+texi application/x-texinfo -+t application/x-troff - tr application/x-troff - roff application/x-troff - man application/x-troff-man - me application/x-troff-me - ms application/x-troff-ms --zip application/x-zip-compressed --tsp application/dsptype --wsrc application/x-wais-source - ustar application/x-ustar --cdf application/x-netcdf --nc application/x-netcdf --doc application/msword --ppt application/powerpoint -- --crt application/x-x509-ca-cert --crl application/x-pkcs7-crl -- -+src application/x-wais-source -+xhtml application/xhtml+xml -+xht application/xhtml+xml -+zip application/zip -+au audio/basic -+snd audio/basic -+mid audio/midi -+midi audio/midi -+kar audio/midi -+mpga audio/mpeg -+mp2 audio/mpeg -+mp3 audio/mpeg -+aif audio/x-aiff -+aiff audio/x-aiff -+aifc audio/x-aiff -+m3u audio/x-mpegurl -+ram audio/x-pn-realaudio -+rm audio/x-pn-realaudio -+rpm audio/x-pn-realaudio-plugin -+ra audio/x-realaudio -+wav audio/x-wav -+pdb chemical/x-pdb -+xyz chemical/x-xyz -+bmp image/bmp -+gif image/gif -+ief image/ief -+jpeg image/jpeg -+jpg image/jpeg -+jpe image/jpeg -+png image/png -+tiff image/tiff -+tif image/tiff -+djvu image/vnd.djvu -+djv image/vnd.djvu -+wbmp image/vnd.wap.wbmp -+ras image/x-cmu-raster -+pnm image/x-portable-anymap -+pbm image/x-portable-bitmap -+pgm image/x-portable-graymap -+ppm image/x-portable-pixmap -+rgb image/x-rgb -+xbm image/x-xbitmap -+xpm image/x-xpixmap -+xwd image/x-xwindowdump -+igs model/iges -+iges model/iges -+msh model/mesh -+mesh model/mesh -+silo model/mesh - wrl model/vrml - vrml model/vrml --mime message/rfc822 -- --pac application/x-ns-proxy-autoconfig -- -+css text/css -+html text/html; charset=%s -+htm text/html; charset=%s -+asc text/plain; charset=%s -+txt text/plain; charset=%s -+rtx text/richtext -+rtf text/rtf -+sgml text/sgml -+sgm text/sgml -+tsv text/tab-separated-values - wml text/vnd.wap.wml --wmlc application/vnd.wap.wmlc - wmls text/vnd.wap.wmlscript --wmlsc application/vnd.wap.wmlscriptc --wbmp image/vnd.wap.wbmp -+etx text/x-setext -+xml text/xml -+xsl text/xml -+mpeg video/mpeg -+mpg video/mpeg -+mpe video/mpeg -+qt video/quicktime -+mov video/quicktime -+mxu video/vnd.mpegurl -+avi video/x-msvideo -+movie video/x-sgi-movie -+ice x-conference/x-cooltalk -diff -ur thttpd-2.21b/mmc.c thttpd-2.21b-cool/mmc.c ---- thttpd-2.21b/mmc.c Fri Apr 13 23:02:15 2001 -+++ thttpd-2.21b-cool/mmc.c Sat Sep 20 14:43:20 2003 -@@ -70,6 +70,9 @@ - unsigned int hash; - int hash_idx; - struct MapStruct* next; -+ char nocache; -+ size_t last_modified_len; -+ char last_modified[100]; - } Map; - - -@@ -93,12 +96,13 @@ - - - void* --mmc_map( char* filename, struct stat* sbP, struct timeval* nowP ) -+mmc_map( char* filename, struct stat* sbP, struct timeval* nowP, int nocache, char **last_modified, size_t *last_modified_len ) - { - time_t now; - struct stat sb; - Map* m; - int fd; -+ const char* rfc1123fmt = "%a, %d %b %Y %H:%M:%S GMT"; - - /* Stat the file, if necessary. */ - if ( sbP != (struct stat*) 0 ) -@@ -130,7 +134,7 @@ - /* Yep. Just return the existing map */ - ++m->refcount; - m->reftime = now; -- return m->addr; -+ goto done; - } - - /* Open the file. */ -@@ -167,12 +171,13 @@ - m->ctime = sb.st_ctime; - m->refcount = 1; - m->reftime = now; -+ m->nocache = (char) nocache; - - /* Avoid doing anything for zero-length files; some systems don't like - ** to mmap them, other systems dislike mallocing zero bytes. - */ - if ( m->size == 0 ) -- m->addr = (void*) 1; /* arbitrary non-NULL address */ -+ m->addr = (void*) 5; /* arbitrary non-NULL address */ - else - { - #ifdef HAVE_MMAP -@@ -223,6 +228,13 @@ - maps = m; - ++map_count; - -+ strftime( m->last_modified, sizeof(m->last_modified), rfc1123fmt, gmtime( &sb.st_mtime ) ); -+ m->last_modified_len = strlen(m->last_modified); -+ -+done: -+ *last_modified = m->last_modified; -+ *last_modified_len = m->last_modified_len; -+ - /* And return the address. */ - return m->addr; - } -@@ -231,27 +243,32 @@ - void - mmc_unmap( void* addr, struct stat* sbP, struct timeval* nowP ) - { -- Map* m = (Map*) 0; -+ Map* m = (Map*) 0, **mm = &maps; - - /* Find the Map entry for this address. First try a hash. */ - if ( sbP != (struct stat*) 0 ) - { - m = find_hash( sbP->st_ino, sbP->st_dev, sbP->st_size, sbP->st_ctime ); -- if ( m != (Map*) 0 && m->addr != addr ) -+ if ( m != (Map*) 0 && ( m->addr != addr || m->nocache == 1 ) ) - m = (Map*) 0; - } - /* If that didn't work, try a full search. */ - if ( m == (Map*) 0 ) -- for ( m = maps; m != (Map*) 0; m = m->next ) -+ for ( m = maps; m != (Map*) 0; m = m->next ) { - if ( m->addr == addr ) - break; -+ mm = &m->next; -+ } - if ( m == (Map*) 0 ) - syslog( LOG_ERR, "mmc_unmap failed to find entry!" ); - else if ( m->refcount <= 0 ) - syslog( LOG_ERR, "mmc_unmap found zero or negative refcount!" ); - else - { -- --m->refcount; -+ if ( --m->refcount == 0 && m->nocache == 1 ) { -+ really_unmap( mm ); -+ return; -+ } - if ( nowP != (struct timeval*) 0 ) - m->reftime = nowP->tv_sec; - else -diff -ur thttpd-2.21b/mmc.h thttpd-2.21b-cool/mmc.h ---- thttpd-2.21b/mmc.h Fri Apr 13 07:36:54 2001 -+++ thttpd-2.21b-cool/mmc.h Sat Sep 20 14:43:20 2003 -@@ -31,8 +31,9 @@ - /* Returns an mmap()ed area for the given file, or (void*) 0 on errors. - ** If you have a stat buffer on the file, pass it in, otherwise pass 0. - ** Same for the current time. -+** Set nocache to 1, if this entry is supposed to be removed quickly. - */ --extern void* mmc_map( char* filename, struct stat* sbP, struct timeval* nowP ); -+extern void* mmc_map( char* filename, struct stat* sbP, struct timeval* nowP, int nocache, char **last_modified, size_t *last_modified_len ); - - /* Done with an mmap()ed area that was returned by mmc_map(). - ** If you have a stat buffer on the file, pass it in, otherwise pass 0. -diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c ---- thttpd-2.21b/thttpd.c Tue Apr 24 00:41:57 2001 -+++ thttpd-2.21b-cool/thttpd.c Sat Sep 20 14:43:20 2003 -@@ -53,6 +53,10 @@ - #endif - #include - -+#include -+ -+#include -+ - #include "fdwatch.h" - #include "libhttpd.h" - #include "mmc.h" -@@ -66,6 +70,8 @@ - static char* dir; - static int do_chroot, no_log, no_symlink, do_vhost, do_global_passwd; - static char* cgi_pattern; -+static char* php_pattern; -+static char* phps_pattern; - static char* url_pattern; - static int no_empty_referers; - static char* local_pattern; -@@ -95,10 +101,10 @@ - httpd_conn* hc; - int tnums[MAXTHROTTLENUMS]; /* throttle indexes */ - int numtnums; -+ int keep_alive; - long limit; - time_t started_at; -- Timer* idle_read_timer; -- Timer* idle_send_timer; -+ time_t last_io; - Timer* wakeup_timer; - Timer* linger_timer; - long wouldblock_delay; -@@ -106,17 +112,22 @@ - off_t bytes_sent; - off_t bytes_to_send; - } connecttab; --static connecttab* connects; -+static connecttab* connects, **free_connects; -+static int next_free_connect; - static int numconnects, maxconnects; - static int httpd_conn_count; - - /* The connection states. */ --#define CNST_FREE 0 --#define CNST_READING 1 --#define CNST_SENDING 2 --#define CNST_PAUSING 3 --#define CNST_LINGERING 4 -- -+enum { -+ CNST_FREE = 0, -+ CNST_READING, -+ CNST_SENDING, -+ CNST_PAUSING, -+ CNST_LINGERING, -+ CNST_SENDING_RESP, -+ CNST_READING_BODY, -+ CNST_TOTAL_NR -+}; - - static httpd_server* hs = (httpd_server*) 0; - int terminate = 0; -@@ -140,23 +151,32 @@ - static int handle_newconnect( struct timeval* tvP, int listen_fd ); - static void handle_read( connecttab* c, struct timeval* tvP ); - static void handle_send( connecttab* c, struct timeval* tvP ); -+static void handle_send_resp( connecttab* c, struct timeval* tvP ); -+static void handle_read_body( connecttab* c, struct timeval* tvP ); - static void handle_linger( connecttab* c, struct timeval* tvP ); - static int check_throttles( connecttab* c ); -+static void timeout_conns( ClientData client_data, struct timeval* nowP ); - static void clear_throttles( connecttab* c, struct timeval* tvP ); - static void update_throttles( ClientData client_data, struct timeval* nowP ); --static void clear_connection( connecttab* c, struct timeval* tvP ); -+static void clear_connection( connecttab* c, struct timeval* tvP, int ); - static void really_clear_connection( connecttab* c, struct timeval* tvP ); --static void idle_read_connection( ClientData client_data, struct timeval* nowP ); --static void idle_send_connection( ClientData client_data, struct timeval* nowP ); - static void wakeup_connection( ClientData client_data, struct timeval* nowP ); - static void linger_clear_connection( ClientData client_data, struct timeval* nowP ); - static void occasional( ClientData client_data, struct timeval* nowP ); -+static void periodic_jobs( ClientData client_data, struct timeval* nowP ); - #ifdef STATS_TIME - static void show_stats( ClientData client_data, struct timeval* nowP ); - #endif /* STATS_TIME */ - static void logstats( struct timeval* nowP ); - static void thttpd_logstats( long secs ); -+static void boot_request(connecttab *c, struct timeval *tvP); -+ -+typedef void (*handler_func)(connecttab*, struct timeval *); -+ -+handler_func handler_array[CNST_TOTAL_NR] = -+{NULL, handle_read, handle_send, NULL, handle_linger, handle_send_resp, handle_read_body}; - -+#define RUN_HANDLER(type, c) if (handler_array[type]) handler_array[type](c, &tv) - - static void - handle_term( int sig ) -@@ -177,7 +197,7 @@ - return; - - /* Re-open the log file. */ -- if ( logfile != (char*) 0 ) -+ if ( logfile != (char*) 0 && strcmp(logfile, "-") != 0) - { - logfp = fopen( logfile, "a" ); - if ( logfp == (FILE*) 0 ) -@@ -198,6 +218,8 @@ - } - - -+time_t httpd_time_now; -+ - static void - handle_usr2( int sig ) - { -@@ -217,7 +239,6 @@ - int num_ready; - int cnum, ridx; - connecttab* c; -- httpd_conn* hc; - httpd_sockaddr sa4; - httpd_sockaddr sa6; - int gotv4, gotv6; -@@ -270,7 +291,9 @@ - no_log = 1; - logfp = (FILE*) 0; - } -- else -+ else if (strcmp(logfile, "-") == 0) { -+ logfp = stdout; -+ } else - { - logfp = fopen( logfile, "a" ); - if ( logfp == (FILE*) 0 ) -@@ -420,7 +443,8 @@ - hostname, - gotv4 ? &sa4 : (httpd_sockaddr*) 0, gotv6 ? &sa6 : (httpd_sockaddr*) 0, - port, cgi_pattern, charset, cwd, no_log, logfp, no_symlink, do_vhost, -- do_global_passwd, url_pattern, local_pattern, no_empty_referers ); -+ do_global_passwd, url_pattern, local_pattern, no_empty_referers, -+ php_pattern, phps_pattern); - if ( hs == (httpd_server*) 0 ) - exit( 1 ); - -@@ -430,6 +454,12 @@ - syslog( LOG_CRIT, "tmr_create(occasional) failed" ); - exit( 1 ); - } -+ -+ if (tmr_create(0, timeout_conns, JunkClientData, 30 * 1000, 1) == 0) { -+ syslog(LOG_CRIT, "tmr_create(timeout_conns) failed"); -+ exit(1); -+ } -+ - if ( numthrottles > 0 ) - { - /* Set up the throttles timer. */ -@@ -439,6 +469,12 @@ - exit( 1 ); - } - } -+ -+ if (tmr_create(0, periodic_jobs, JunkClientData, 2000, 1) == 0) { -+ syslog(LOG_CRIT, "tmr_create failed"); -+ exit(1); -+ } -+ - #ifdef STATS_TIME - /* Set up the stats timer. */ - if ( tmr_create( (struct timeval*) 0, show_stats, JunkClientData, STATS_TIME * 1000L, 1 ) == (Timer*) 0 ) -@@ -454,12 +490,14 @@ - /* If we're root, try to become someone else. */ - if ( getuid() == 0 ) - { -+#ifndef __CYGWIN__ - /* Set aux groups to null. */ - if ( setgroups( 0, (const gid_t*) 0 ) < 0 ) - { - syslog( LOG_CRIT, "setgroups - %m" ); - exit( 1 ); - } -+#endif - /* Set primary group. */ - if ( setgid( gid ) < 0 ) - { -@@ -495,13 +533,17 @@ - } - maxconnects -= SPARE_FDS; - connects = NEW( connecttab, maxconnects ); -+ free_connects = malloc(sizeof(connecttab *) * maxconnects); -+ next_free_connect = maxconnects; - if ( connects == (connecttab*) 0 ) - { - syslog( LOG_CRIT, "out of memory allocating a connecttab" ); - exit( 1 ); - } -+ - for ( cnum = 0; cnum < maxconnects; ++cnum ) - { -+ free_connects[cnum] = &connects[maxconnects - cnum - 1]; - connects[cnum].conn_state = CNST_FREE; - connects[cnum].hc = (httpd_conn*) 0; - } -@@ -518,6 +560,9 @@ - - /* Main loop. */ - (void) gettimeofday( &tv, (struct timezone*) 0 ); -+ httpd_time_now = tv.tv_sec; -+ periodic_jobs(JunkClientData, &tv); -+ - while ( ( ! terminate ) || numconnects > 0 ) - { - /* Do the fd watch. */ -@@ -530,6 +575,7 @@ - exit( 1 ); - } - (void) gettimeofday( &tv, (struct timezone*) 0 ); -+ httpd_time_now = tv.tv_sec; - if ( num_ready == 0 ) - { - /* No fd's are ready - run the timers. */ -@@ -565,16 +611,10 @@ - c = (connecttab*) fdwatch_get_client_data( ridx ); - if ( c == (connecttab*) 0 ) - continue; -- hc = c->hc; -- if ( c->conn_state == CNST_READING && -- fdwatch_check_fd( hc->conn_fd ) ) -- handle_read( c, &tv ); -- else if ( c->conn_state == CNST_SENDING && -- fdwatch_check_fd( hc->conn_fd ) ) -- handle_send( c, &tv ); -- else if ( c->conn_state == CNST_LINGERING && -- fdwatch_check_fd( hc->conn_fd ) ) -- handle_linger( c, &tv ); -+#if DO_UNNECESSARY_CHECK_FD -+ fdwatch_check_fd(c->hc->conn_fd); -+#endif -+ RUN_HANDLER(c->conn_state, c); - } - tmr_run( &tv ); - -@@ -627,6 +667,8 @@ - #else /* CGI_PATTERN */ - cgi_pattern = (char*) 0; - #endif /* CGI_PATTERN */ -+ php_pattern = "**.php"; -+ phps_pattern = "**.phps"; - url_pattern = (char*) 0; - no_empty_referers = 0; - local_pattern = (char*) 0; -@@ -833,6 +875,16 @@ - value_required( name, value ); - cgi_pattern = e_strdup( value ); - } -+ else if ( strcasecmp( name, "phppat" ) == 0 ) -+ { -+ value_required( name, value ); -+ php_pattern = e_strdup( value ); -+ } -+ else if ( strcasecmp( name, "phpspat" ) == 0 ) -+ { -+ value_required( name, value ); -+ phps_pattern = e_strdup( value ); -+ } - else if ( strcasecmp( name, "urlpat" ) == 0 ) - { - value_required( name, value ); -@@ -1196,8 +1248,10 @@ - logstats( &tv ); - for ( cnum = 0; cnum < maxconnects; ++cnum ) - { -- if ( connects[cnum].conn_state != CNST_FREE ) -+ if ( connects[cnum].conn_state != CNST_FREE ) { -+ httpd_complete_request( connects[cnum].hc, &tv ); - httpd_close_conn( connects[cnum].hc, &tv ); -+ } - if ( connects[cnum].hc != (httpd_conn*) 0 ) - { - httpd_destroy_conn( connects[cnum].hc ); -@@ -1214,6 +1268,7 @@ - } - mmc_destroy(); - tmr_destroy(); -+ free( (void*) free_connects ); - free( (void*) connects ); - if ( throttles != (throttletab*) 0 ) - free( (void*) throttles ); -@@ -1234,7 +1289,7 @@ - for (;;) - { - /* Is there room in the connection table? */ -- if ( numconnects >= maxconnects ) -+ if ( numconnects >= maxconnects || next_free_connect == 0 ) - { - /* Out of connection slots. Run the timers, then the - ** existing connections, and maybe we'll free up a slot -@@ -1245,10 +1300,10 @@ - return 0; - } - /* Find a free connection entry. */ -- for ( cnum = 0; cnum < maxconnects; ++cnum ) -- if ( connects[cnum].conn_state == CNST_FREE ) -- break; -- c = &connects[cnum]; -+ -+ c = free_connects[--next_free_connect]; -+ free_connects[next_free_connect] = NULL; -+ - /* Make the httpd_conn if necessary. */ - if ( c->hc == (httpd_conn*) 0 ) - { -@@ -1267,24 +1322,18 @@ - { - case GC_FAIL: - case GC_NO_MORE: -+ free_connects[next_free_connect++] = c; - return 1; - } - c->conn_state = CNST_READING; - ++numconnects; - client_data.p = c; -- c->idle_read_timer = tmr_create( -- tvP, idle_read_connection, client_data, IDLE_READ_TIMELIMIT * 1000L, -- 0 ); -- if ( c->idle_read_timer == (Timer*) 0 ) -- { -- syslog( LOG_CRIT, "tmr_create(idle_read_connection) failed" ); -- exit( 1 ); -- } -- c->idle_send_timer = (Timer*) 0; - c->wakeup_timer = (Timer*) 0; - c->linger_timer = (Timer*) 0; - c->bytes_sent = 0; - c->numtnums = 0; -+ c->keep_alive = 0; -+ c->last_io = httpd_time_now; - - /* Set the connection file descriptor to no-delay mode. */ - httpd_set_ndelay( c->hc->conn_fd ); -@@ -1298,11 +1347,100 @@ - } - - -+#define FIXUP(x) if (hc->x >= oldptr && hc->x < pe) hc->x += d -+ -+static void -+realign_hc(httpd_conn *hc, char *oldptr) -+{ -+ int d = hc->read_buf - oldptr; -+ char *pe = oldptr + hc->checked_idx; -+ -+ FIXUP(encodedurl); -+ FIXUP(protocol); -+ FIXUP(referer); -+ FIXUP(useragent); -+ FIXUP(acceptl); -+ FIXUP(cookie); -+ FIXUP(contenttype); -+ FIXUP(hdrhost); -+ FIXUP(authorization); -+} -+ -+#undef FIXUP -+ -+static void -+setup_read_body(connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn *hc = c->hc; -+ int already, missing; -+ char *oldptr = hc->read_buf; -+ -+ c->conn_state = CNST_READING_BODY; -+ -+ hc->read_body_into_mem = 0; -+ -+ already = hc->read_idx - hc->checked_idx; -+ missing = hc->contentlength - already; -+ -+ if (missing > 16384) { -+ char filename[] = "/tmp/thttpd.upload.XXXXXX"; -+ int tmp = mkstemp(filename); -+ -+ if (tmp >= 0) { -+ void *p; -+ size_t sz = hc->contentlength + hc->checked_idx + 10; -+ -+ unlink(filename); -+ -+ ftruncate(tmp, sz); -+ p = mmap(NULL, sz, -+ PROT_READ|PROT_WRITE, MAP_PRIVATE, tmp, 0); -+ -+ if (p != MAP_FAILED) { -+ memcpy(p, hc->read_buf, hc->read_idx); -+ free(hc->read_buf); -+ hc->read_size = sz; -+ hc->read_buf = p; -+ hc->read_buf_is_mmap = 1; -+ } -+ close(tmp); -+ } -+ -+ if (!hc->read_buf_is_mmap) { -+ clear_connection( c, tvP, 0 ); -+ return; -+ } -+ } else if (missing > 0) { -+ httpd_realloc_str(&hc->read_buf, &hc->read_size, hc->checked_idx + hc->contentlength + 10); -+ } -+ if (oldptr != hc->read_buf) realign_hc(hc, oldptr); -+ -+ fdwatch_del_fd( hc->conn_fd ); -+ fdwatch_add_fd( hc->conn_fd, c, FDW_READ ); -+} -+ -+static void -+setup_sending(connecttab *c, int state, struct timeval *tvP) -+{ -+ httpd_conn *hc = c->hc; -+ ClientData client_data; -+ -+ c->conn_state = state; -+ c->started_at = tvP->tv_sec; -+ c->wouldblock_delay = 0; -+ client_data.p = c; -+ -+ fdwatch_del_fd( hc->conn_fd ); -+ fdwatch_add_fd( hc->conn_fd, c, FDW_WRITE ); -+} -+ -+static void handle_request( connecttab *c, struct timeval *tvP); -+ -+ - static void - handle_read( connecttab* c, struct timeval* tvP ) - { - int sz; -- ClientData client_data; - httpd_conn* hc = c->hc; - - /* Is there room in our buffer to read more bytes? */ -@@ -1311,7 +1449,7 @@ - if ( hc->read_size > 5000 ) - { - httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - httpd_realloc_str( -@@ -1327,14 +1465,53 @@ - ** EWOULDBLOCK; however, this apparently can happen if a packet gets - ** garbled. - */ -- if ( sz == 0 || ( sz < 0 && ( errno != EWOULDBLOCK ) ) ) -- { -- httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); -- clear_connection( c, tvP ); -+ if ( sz == 0 ) { -+ if (! c->keep_alive) { -+ httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); -+ } -+ clear_connection( c, tvP, 0 ); -+ return; -+ } else if ( sz < 0 ) { -+ if (errno != EWOULDBLOCK) { -+ clear_connection( c, tvP, 0 ); -+ } - return; -+ } -+ -+ /* If this is a persistent PHP connection, we must not receive -+ ** any further requests on this connection. Some broken HTTP/1.1 -+ ** implementations (e.g. Mozilla 1.0.1) are known to do -+ ** pipelining on a connection, although a prior response included -+ ** Connection: close -+ */ -+ if (c->hc->file_address == (char *) 1) { -+ return; -+ } -+ -+ c->last_io = httpd_time_now; -+ if (sz > 0) hc->read_idx += sz; -+ -+ /* -+ ** if we start getting new data on this socket, "promote" it -+ ** to read timeout -+ */ -+ if ( hc->keep_alive ) { -+ ClientData client_data; -+ -+ -+ client_data.p = c; -+ -+ hc->keep_alive = 0; -+ } -+ handle_request(c, tvP); - } -- hc->read_idx += sz; - -+ -+static void -+handle_request( connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn* hc = c->hc; -+ - /* Do we have a complete request yet? */ - switch ( httpd_got_request( hc ) ) - { -@@ -1342,14 +1519,14 @@ - return; - case GR_BAD_REQUEST: - httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - - /* Yes. Try parsing and resolving it. */ - if ( httpd_parse_request( hc ) < 0 ) - { -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - -@@ -1358,18 +1535,28 @@ - { - httpd_send_err( - hc, 503, httpd_err503title, "", httpd_err503form, hc->encodedurl ); -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } -+ boot_request(c, tvP); -+} - -+static void boot_request(connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn *hc = c->hc; - /* Start the connection going. */ - if ( httpd_start_request( hc, tvP ) < 0 ) - { - /* Something went wrong. Close down the connection. */ -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - -+ if ( hc->read_body_into_mem ) { -+ setup_read_body( c, tvP ); -+ return; -+ } -+ - /* Fill in bytes_to_send. */ - if ( hc->got_range ) - { -@@ -1384,37 +1571,25 @@ - { - /* No file address means someone else is handling it. */ - c->bytes_sent = hc->bytes_sent; -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 1 ); - return; - } -+ if (hc->file_address == (char *) 1) { -+ c->last_io = (time_t) LONG_MAX; -+ c->wouldblock_delay = 0; -+ return; -+ } - if ( c->bytes_sent >= c->bytes_to_send ) - { - /* There's nothing to send. */ -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 1 ); - return; - } - - /* Cool, we have a valid connection and a file to send to it. */ -- c->conn_state = CNST_SENDING; -- c->started_at = tvP->tv_sec; -- c->wouldblock_delay = 0; -- client_data.p = c; -- tmr_cancel( c->idle_read_timer ); -- c->idle_read_timer = (Timer*) 0; -- c->idle_send_timer = tmr_create( -- tvP, idle_send_connection, client_data, IDLE_SEND_TIMELIMIT * 1000L, -- 0 ); -- if ( c->idle_send_timer == (Timer*) 0 ) -- { -- syslog( LOG_CRIT, "tmr_create(idle_send_connection) failed" ); -- exit( 1 ); -- } -- -- fdwatch_del_fd( hc->conn_fd ); -- fdwatch_add_fd( hc->conn_fd, c, FDW_WRITE ); -+ setup_sending(c, CNST_SENDING, tvP); - } - -- - static void - handle_send( connecttab* c, struct timeval* tvP ) - { -@@ -1443,6 +1618,9 @@ - iv[1].iov_base = &(hc->file_address[c->bytes_sent]); - iv[1].iov_len = MIN( c->bytes_to_send - c->bytes_sent, c->limit ); - sz = writev( hc->conn_fd, iv, 2 ); -+/* -+printf("**RESPONSE2 [%d]** len = %d\n%*.*s\n", hc->conn_fd, hc->responselen, hc->responselen, hc->responselen, hc->response); -+*/ - } - - if ( sz == 0 || -@@ -1486,12 +1664,12 @@ - */ - if ( errno != EPIPE && errno != EINVAL && errno != ECONNRESET ) - syslog( LOG_ERR, "write - %m sending %.80s", hc->encodedurl ); -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 0 ); - return; - } - - /* Ok, we wrote something. */ -- tmr_reset( tvP, c->idle_send_timer ); -+ c->last_io = httpd_time_now; - /* Was this a headers + file writev()? */ - if ( hc->responselen > 0 ) - { -@@ -1500,7 +1678,7 @@ - { - /* Yes; move the unwritten part to the front of the buffer. */ - int newlen = hc->responselen - sz; -- (void) memcpy( hc->response, &(hc->response[sz]), newlen ); -+ (void) memmove( hc->response, &(hc->response[sz]), newlen ); - hc->responselen = newlen; - sz = 0; - } -@@ -1519,7 +1697,7 @@ - if ( c->bytes_sent >= c->bytes_to_send ) - { - /* This conection is finished! */ -- clear_connection( c, tvP ); -+ clear_connection( c, tvP, 1 ); - return; - } - -@@ -1560,6 +1738,9 @@ - char buf[1024]; - int r; - -+/* -+printf("*LINGER read\n"); -+*/ - /* In lingering-close mode we just read and ignore bytes. An error - ** or EOF ends things, otherwise we go until a timeout. - */ -@@ -1569,6 +1750,63 @@ - } - - -+static void -+handle_read_body(connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn *hc = c->hc; -+ int n; -+ -+ n = read(hc->conn_fd, hc->read_buf + hc->read_idx, -+ hc->contentlength - (hc->read_idx - hc->checked_idx)); -+ -+ if (n <= 0) { -+ if (errno == EAGAIN) -+ return; -+ clear_connection(c, tvP, 0); -+ return; -+ } -+ -+ c->last_io = httpd_time_now; -+ -+ hc->read_idx += n; -+ -+ if (hc->contentlength == hc->read_idx - hc->checked_idx) { -+ boot_request(c, tvP); -+ return; -+ } -+} -+ -+static void -+handle_send_resp(connecttab *c, struct timeval *tvP) -+{ -+ httpd_conn* hc = c->hc; -+ int n = send(hc->conn_fd, hc->response, hc->responselen, 0); -+ int dokeep = 1; -+ -+ if (n < 0) { -+ if (errno == EAGAIN) -+ return; -+ -+ dokeep = 0; -+ goto clear; -+ } -+ -+ c->last_io = httpd_time_now; -+ -+ if (n == hc->responselen) { -+clear: -+ hc->response = realloc(hc->response, hc->maxresponse + 1); -+ hc->responselen = 0; -+ -+ clear_connection(c, tvP, dokeep); -+ return; -+ } -+ -+ hc->responselen -= n; -+ -+ memmove(hc->response, hc->response + n, hc->responselen); -+} -+ - static int - check_throttles( connecttab* c ) - { -@@ -1635,23 +1873,18 @@ - - - static void --clear_connection( connecttab* c, struct timeval* tvP ) -+clear_connection( connecttab* c, struct timeval* tvP, int doKeep ) - { - ClientData client_data; -+ int linger; - - /* If we haven't actually sent the buffered response yet, do so now. */ -- httpd_write_response( c->hc ); -+ if (c->hc->responselen && c->conn_state != CNST_SENDING_RESP) { -+ setup_sending(c, CNST_SENDING_RESP, tvP); - -- if ( c->idle_read_timer != (Timer*) 0 ) -- { -- tmr_cancel( c->idle_read_timer ); -- c->idle_read_timer = 0; -- } -- if ( c->idle_send_timer != (Timer*) 0 ) -- { -- tmr_cancel( c->idle_send_timer ); -- c->idle_send_timer = 0; -+ return; - } -+ - if ( c->wakeup_timer != (Timer*) 0 ) - { - tmr_cancel( c->wakeup_timer ); -@@ -1669,13 +1902,36 @@ - ** circumstances that make a lingering close necessary. If the flag - ** isn't set we do the real close now. - */ -- if ( c->hc->should_linger ) -+ -+ if ( c->hc->do_keep_alive && doKeep) - { -- c->conn_state = CNST_LINGERING; -+ httpd_conn *hc = c->hc; -+ c->conn_state = CNST_READING; -+ -+ client_data.p = c; -+ c->bytes_sent = 0; -+ c->numtnums = 0; -+ c->keep_alive = 1; -+ -+ httpd_complete_request( c->hc, tvP ); -+ - fdwatch_del_fd( c->hc->conn_fd ); - fdwatch_add_fd( c->hc->conn_fd, c, FDW_READ ); -+ -+ httpd_request_reset( c->hc, 1 ); -+ -+ hc->read_idx -= hc->checked_idx; -+ memmove(hc->read_buf, hc->read_buf + hc->checked_idx, hc->read_idx); -+ hc->checked_idx = 0; -+ - /* Make sure we are still in no-delay mode. */ - httpd_set_ndelay( c->hc->conn_fd ); -+ handle_request(c, tvP); -+ } -+ else if ( c->hc->should_linger ) -+ { -+ c->conn_state = CNST_LINGERING; -+ - client_data.p = c; - c->linger_timer = tmr_create( - tvP, linger_clear_connection, client_data, LINGER_TIME * 1000L, 0 ); -@@ -1684,9 +1940,19 @@ - syslog( LOG_CRIT, "tmr_create(linger_clear_connection) failed" ); - exit( 1 ); - } -+ -+ httpd_complete_request( c->hc, tvP ); -+ -+ fdwatch_del_fd( c->hc->conn_fd ); -+ fdwatch_add_fd( c->hc->conn_fd, c, FDW_READ ); -+ /* Make sure we are still in no-delay mode. */ -+ httpd_set_ndelay( c->hc->conn_fd ); - } -- else -+ else -+ { -+ httpd_complete_request( c->hc, tvP ); - really_clear_connection( c, tvP ); -+ } - } - - -@@ -1702,45 +1968,12 @@ - tmr_cancel( c->linger_timer ); - c->linger_timer = 0; - } -+ free_connects[next_free_connect++] = c; - c->conn_state = CNST_FREE; - --numconnects; - } - - --static void --idle_read_connection( ClientData client_data, struct timeval* nowP ) -- { -- connecttab* c; -- -- c = (connecttab*) client_data.p; -- c->idle_read_timer = (Timer*) 0; -- if ( c->conn_state != CNST_FREE ) -- { -- syslog( LOG_INFO, -- "%.80s connection timed out reading", -- httpd_ntoa( &c->hc->client_addr ) ); -- httpd_send_err( c->hc, 408, httpd_err408title, "", httpd_err408form, "" ); -- clear_connection( c, nowP ); -- } -- } -- -- --static void --idle_send_connection( ClientData client_data, struct timeval* nowP ) -- { -- connecttab* c; -- -- c = (connecttab*) client_data.p; -- c->idle_send_timer = (Timer*) 0; -- if ( c->conn_state != CNST_FREE ) -- { -- syslog( LOG_INFO, -- "%.80s connection timed out sending", -- httpd_ntoa( &c->hc->client_addr ) ); -- clear_connection( c, nowP ); -- } -- } -- - - static void - wakeup_connection( ClientData client_data, struct timeval* nowP ) -@@ -1783,6 +2016,43 @@ - } - #endif /* STATS_TIME */ - -+char httpd_now_buf[100]; -+ -+ -+ -+static void -+periodic_jobs( ClientData client_data, struct timeval* nowP ) -+{ -+ const char* rfc1123fmt = "%a, %d %b %Y %H:%M:%S GMT"; -+ struct tm *t; -+ char date_nozone[100]; -+ const char* cernfmt_nozone = "%d/%b/%Y:%H:%M:%S"; -+ char data[100]; -+ int zone; -+ char sign; -+ -+ strftime( httpd_now_buf, sizeof(httpd_now_buf), rfc1123fmt, gmtime( &nowP->tv_sec ) ); -+ -+ t = localtime(&nowP->tv_sec); -+ strftime( date_nozone, sizeof(date_nozone), cernfmt_nozone, t ); -+#ifdef HAVE_TM_GMTOFF -+ zone = t->tm_gmtoff / 60L; -+#else -+ zone = -timezone / 60L; -+ /* Probably have to add something about daylight time here. */ -+#endif -+ if ( zone >= 0 ) -+ sign = '+'; -+ else -+ { -+ sign = '-'; -+ zone = -zone; -+ } -+ zone = ( zone / 60 ) * 100 + zone % 60; -+ hs->log_date_len = sprintf( hs->log_date, "%s %c%04d", date_nozone, sign, -+ zone ); -+} -+ - - /* Generate debugging statistics syslog messages for all packages. */ - static void -@@ -1826,3 +2096,42 @@ - stats_connections = stats_bytes = 0L; - stats_simultaneous = 0; - } -+ -+static void -+timeout_conns(ClientData client_data, struct timeval *nowP) -+{ -+ connecttab *c = connects, *ce = c + maxconnects; -+ time_t now = nowP->tv_sec; -+ int r = 0, w = 0; -+ int checked = 0; -+ -+ while (c < ce) { -+ switch (c->conn_state) { -+ case CNST_SENDING: -+ case CNST_SENDING_RESP: -+ checked++; -+ if ((now - c->last_io) > IDLE_SEND_TIMELIMIT) { -+ clear_connection( c, nowP, 0 ); -+ w++; -+ } -+ break; -+ case CNST_READING: -+ case CNST_READING_BODY: -+ checked++; -+ if ((now - c->last_io) > IDLE_READ_TIMELIMIT) { -+ clear_connection( c, nowP, 0 ); -+ r++; -+ } -+ break; -+ case CNST_FREE: break; -+ default: checked++; break; -+ } -+ c++; -+ if (checked >= numconnects) break; -+ } -+ -+ if (r > 0 || w > 0) { -+ syslog(LOG_INFO, "Expired %d/%d connections in read/write state", r, w); -+ } -+} -+ -diff -ur thttpd-2.21b/version.h thttpd-2.21b-cool/version.h ---- thttpd-2.21b/version.h Tue Apr 24 04:05:23 2001 -+++ thttpd-2.21b-cool/version.h Sat Sep 20 14:43:20 2003 -@@ -3,7 +3,7 @@ - #ifndef _VERSION_H_ - #define _VERSION_H_ - --#define SERVER_SOFTWARE "thttpd/2.21b 23apr2001" -+#define SERVER_SOFTWARE "thttpd/2.21b PHP/20030920" - #define SERVER_ADDRESS "http://www.acme.com/software/thttpd/" - - #endif /* _VERSION_H_ */ diff --git a/sapi/tux/CREDITS b/sapi/tux/CREDITS deleted file mode 100644 index 3b7aa70c01bbe..0000000000000 --- a/sapi/tux/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -tux -Sascha Schumann diff --git a/sapi/tux/README b/sapi/tux/README deleted file mode 100644 index 92c021123ff02..0000000000000 --- a/sapi/tux/README +++ /dev/null @@ -1,86 +0,0 @@ -README FOR THE TUX MODULE (by Sascha Schumann) -($Date$) - - This is a SAPI module for the TUX web-server by Ingo Molnar. - - The special thing about TUX is that it is integrated into the Linux - kernel and thus provides high-speed serving of static files. - - The web-server provides a user-space API which allows arbitrary - plug-ins to be made available. - - All requests to the PHP userspace module are currently serialized. - - This module is of alpha quality. Due to incomplete APIs, HTTP - authentication and handling of POST requests has not been - implemented yet. - - SECURITY NOTE: PHP will happily run everything under the - web-root through the parser; so be careful what you put - there. - - Note that requests are served in a chroot'ed environment. - The initialization of PHP does not take place in the chroot'ed - environment, so that e.g. /usr/local/lib/php.ini is treated - as usual. - -REQUIRED DOWNLOADS - - 1. TUX - - http://people.redhat.com/~mingo/TUX-patches/QuickStart-TUX.txt - - 2. PHP 4.0.x - - Download: - http://www.php.net/ - - Snapshots from CVS: - http://snaps.php.net/ - - -BUILD INSTRUCTIONS - - 1. Install TUX as outlined in the QuickStart text. - Create /tux-modules where modules will reside. - - 2. Prepare PHP - - $ cd php-* - $ ./configure \ - --with-tux=/tux-modules \ - - # make install - - You can see the list of valid PHP options by executing - - $ ./configure --help - - 3. Touch a file in your web-root 'php5.tux'. This will - cause requests to '/php5.tux' to be redirected to the - userspace module php5.tux. - - 4. Start TUX with something like - - # tux -d -t 8 -r /www -m /tux-modules php5.tux - - (daemon mode, eight threads, web-root /www, modules in - /tux-modules, load php5.tux) - - BEFORE running this command, the kernel side of TUX has to - be properly setup. - - 5. Try to access - - http://yourserver/php5.tux?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 - - It should display the PHP credits page. - - To access a script /foo/bar.php, use - - http://yourserver/php5.tux?/foo/bar.php - - Parameters can be appended: - - http://yourserver/php5.tux?/foo/bar.php&var=value - diff --git a/sapi/tux/config.m4 b/sapi/tux/config.m4 deleted file mode 100644 index 06788be7576d4..0000000000000 --- a/sapi/tux/config.m4 +++ /dev/null @@ -1,16 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(tux,, -[ --with-tux=MODULEDIR Build PHP as a TUX module (Linux only)], no, no) - -AC_MSG_CHECKING([for TUX]) -if test "$PHP_TUX" != "no"; then - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PHP_TUX/php5.tux.so" - AC_CHECK_HEADERS(tuxmodule.h,[:],[AC_MSG_ERROR([Cannot find tuxmodule.h])]) - PHP_SELECT_SAPI(tux, shared, php_tux.c) - AC_MSG_RESULT([$PHP_TUX]) -else - AC_MSG_RESULT(no) -fi diff --git a/sapi/tux/php.sym b/sapi/tux/php.sym deleted file mode 100644 index b968c5f5a2bc8..0000000000000 --- a/sapi/tux/php.sym +++ /dev/null @@ -1,2 +0,0 @@ -TUXAPI_handle_events -TUXAPI_init diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c deleted file mode 100644 index 65a7cde0544bf..0000000000000 --- a/sapi/tux/php_tux.c +++ /dev/null @@ -1,456 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -#include "php.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_variables.h" - -#include "ext/standard/php_smart_str.h" - -#include "tuxmodule.h" - -#include - -#if 0 -#include -#endif - -void tux_closed_conn(int fd); - -enum { - PHP_TUX_BACKGROUND_CONN = 1 -}; - -typedef struct { - user_req_t *req; - void (*on_close)(int); - int tux_action; - struct iovec *header_vec; - int number_vec; -} php_tux_globals; - -static php_tux_globals tux_globals; - -#define TG(v) (tux_globals.v) - -static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC) -{ - int n; - int m; - const char *estr; - - /* combine headers and body */ - if (TG(number_vec)) { - struct iovec *vec = TG(header_vec); - - n = TG(number_vec); - vec[n].iov_base = (void *) str; - vec[n++].iov_len = str_length; - - /* XXX: this might need more complete error handling */ - if ((m = writev(TG(req)->sock, vec, n)) == -1 && errno == EPIPE) - php_handle_aborted_connection(); - - if (m > 0) - TG(req)->bytes_sent += str_length; - - TG(number_vec) = 0; - return str_length; - } - - estr = str + str_length; - - while (str < estr) { - n = send(TG(req)->sock, str, estr - str, 0); - - if (n == -1 && errno == EPIPE) - php_handle_aborted_connection(); - if (n == -1 && errno == EAGAIN) - continue; - if (n <= 0) - return n; - - str += n; - } - - n = str_length - (estr - str); - - TG(req)->bytes_sent += n; - - return n; -} - -static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers) -{ - char buf[1024]; - struct iovec *vec; - int n; - int max_headers; - zend_llist_position pos; - sapi_header_struct *h; - size_t len; - char *status_line; - int locate_cl; - TSRMLS_FETCH(); - - max_headers = 30; - n = 1; - - vec = malloc(sizeof(struct iovec) * max_headers); - status_line = malloc(30); - - /* safe sprintf use */ - len = slprintf(status_line, 30, "HTTP/1.1 %d NA\r\n", SG(sapi_headers).http_response_code); - - vec[0].iov_base = status_line; - vec[0].iov_len = len; - - TG(req)->http_status = SG(sapi_headers).http_response_code; - - if (TG(tux_action) == TUX_ACTION_FINISH_CLOSE_REQ && TG(req)->http_version == HTTP_1_1) - locate_cl = 1; - else - locate_cl = 0; - - h = zend_llist_get_first_ex(&sapi_headers->headers, &pos); - while (h) { - if (locate_cl - && strncasecmp(h->header, "Content-length:", sizeof("Content-length:")-1) == 0) { - TG(tux_action) = TUX_ACTION_FINISH_REQ; - locate_cl = 0; - } - - vec[n].iov_base = h->header; - vec[n++].iov_len = h->header_len; - if (n >= max_headers - 3) { - max_headers *= 2; - vec = realloc(vec, sizeof(struct iovec) * max_headers); - } - vec[n].iov_base = "\r\n"; - vec[n++].iov_len = 2; - - h = zend_llist_get_next_ex(&sapi_headers->headers, &pos); - } - - vec[n].iov_base = "\r\n"; - vec[n++].iov_len = 2; - - TG(number_vec) = n; - TG(header_vec) = vec; - - - return SAPI_HEADER_SENT_SUCCESSFULLY; -} - -static int sapi_tux_read_post(char *buffer, uint count_bytes) -{ -#if 0 - int amount = 0; - TSRMLS_FETCH(); - - TG(req)->objectlen = count_bytes; - TG(req)->object_addr = buffer; - if (tux(TUX_ACTION_READ_POST_DATA, TG(req))) - return 0; - - TG(read_post_data) = 1; - - return TG(req)->objectlen; -#else - return 0; -#endif -} - -static char *sapi_tux_read_cookies(void) -{ - TSRMLS_FETCH(); - - return TG(req)->cookies; -} - -#define BUF_SIZE 512 -#define ADD_STRING(name) \ - php_register_variable(name, buf, track_vars_array TSRMLS_CC) - -static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC) -{ - char buf[BUF_SIZE + 1]; - char *p; - sapi_header_line ctr = {0}; - - ctr.line = buf; - ctr.line_len = slprintf(buf, sizeof(buf), "Server: %s", TUXAPI_version); - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); - - php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC); - php_register_variable("DOCUMENT_ROOT", TUXAPI_docroot, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_NAME", TUXAPI_servername, track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC); - - p = inet_ntoa(TG(req)->client_host); - /* string representation of IPs are never larger than 512 bytes */ - if (p) { - memcpy(buf, p, strlen(p) + 1); - ADD_STRING("REMOTE_ADDR"); - ADD_STRING("REMOTE_HOST"); - } - - snprintf(buf, sizeof(buf), "%d", CGI_SERVER_PORT(TG(req))); - ADD_STRING("SERVER_PORT"); - -#if 0 - snprintf(buf, BUF_SIZE, "/%s", TG(hc)->pathinfo); - ADD_STRING("PATH_INFO"); - - snprintf(buf, BUF_SIZE, "/%s", TG(hc)->origfilename); - ADD_STRING("SCRIPT_NAME"); -#endif - -#define CONDADD(name, field) \ - if (TG(req)->field[0]) { \ - php_register_variable(#name, TG(req)->field, track_vars_array TSRMLS_CC); \ - } - - CONDADD(HTTP_REFERER, referer); - CONDADD(HTTP_USER_AGENT, user_agent); - CONDADD(HTTP_ACCEPT, accept); - CONDADD(HTTP_ACCEPT_ENCODING, accept_encoding); - CONDADD(HTTP_ACCEPT_LANGUAGE, accept_language); - CONDADD(HTTP_COOKIE, cookies); - CONDADD(CONTENT_TYPE, content_type); - -#if 0 - if (TG(hc)->contentlength != -1) { - snprintf(buf, sizeof(buf), "%ld", (long) TG(hc)->contentlength); - ADD_STRING("CONTENT_LENGTH"); - } -#endif - -#if 0 - if (TG(hc)->authorization[0]) - php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC); -#endif -} - - -static int php_tux_startup(sapi_module_struct *sapi_module) -{ - if (php_module_startup(sapi_module, NULL, 0)==FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - -static sapi_module_struct tux_sapi_module = { - "tux", - "tux", - - php_tux_startup, - php_module_shutdown_wrapper, - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_tux_ub_write, - NULL, - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, - - NULL, - sapi_tux_send_headers, - NULL, - sapi_tux_read_post, - sapi_tux_read_cookies, - - sapi_tux_register_variables, - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -static void tux_module_main(TSRMLS_D) -{ - zend_file_handle file_handle; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return; - } - - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); -} - -static void tux_request_ctor(TSRMLS_D) -{ - char buf[1024]; - int offset; - size_t filename_len; - size_t cwd_len; - smart_str s = {0}; - char *p; - - TG(number_vec) = 0; - TG(header_vec) = NULL; - SG(request_info).query_string = strdup(TG(req)->query); - - smart_str_appends_ex(&s, "/", 1); - smart_str_appends_ex(&s, TG(req)->query, 1); - smart_str_0(&s); - p = strchr(s.c, '&'); - if (p) - *p = '\0'; - SG(request_info).path_translated = s.c; - - s.c = NULL; - smart_str_appendc_ex(&s, '/', 1); - smart_str_appends_ex(&s, TG(req)->objectname, 1); - smart_str_0(&s); - SG(request_info).request_uri = s.c; - SG(request_info).request_method = CGI_REQUEST_METHOD(TG(req)); - if(TG(req)->http_version == HTTP_1_1) SG(request_info).proto_num = 1001; - else SG(request_info).proto_num = 1000; - SG(sapi_headers).http_response_code = 200; - SG(request_info).content_type = TG(req)->content_type; - SG(request_info).content_length = 0; /* TG(req)->contentlength; */ - -#if 0 - php_handle_auth_data(TG(hc)->authorization TSRMLS_CC); -#endif -} - -static void tux_request_dtor(TSRMLS_D) -{ - if (TG(header_vec)) { - /* free status_line */ - free(TG(header_vec)[0].iov_base); - free(TG(header_vec)); - } - if (SG(request_info).query_string) - free(SG(request_info).query_string); - free(SG(request_info).request_uri); - free(SG(request_info).path_translated); -} - -#if 0 -static void *separate_thread(void *bla) -{ - int fd; - int i = 0; - - fd = (int) bla; - - while (i++ < 5) { - send(fd, "test
\n", 9, 0); - sleep(1); - } - - tux(TUX_ACTION_CONTINUE_REQ, (user_req_t *) fd); - /* We HAVE to trigger some event on the fd. Otherwise - fast_thread won't wake up, so that the eventloop - won't be entered -> TUX hangs */ - shutdown(fd, 2); - pthread_exit(NULL); -} -#endif - -int TUXAPI_handle_events(user_req_t *req) -{ - TSRMLS_FETCH(); - - if (req->event == PHP_TUX_BACKGROUND_CONN) { - tux_closed_conn(req->sock); - return tux(TUX_ACTION_FINISH_CLOSE_REQ, req); - } - - TG(req) = req; - TG(tux_action) = TUX_ACTION_FINISH_CLOSE_REQ; - - tux_request_ctor(TSRMLS_C); - - tux_module_main(TSRMLS_C); - - tux_request_dtor(TSRMLS_C); - - return tux(TG(tux_action), req); -} - -void tux_register_on_close(void (*arg)(int)) -{ - TG(on_close) = arg; -} - -void tux_closed_conn(int fd) -{ - TSRMLS_FETCH(); - - if (TG(on_close)) TG(on_close)(fd); -} - -int tux_get_fd(void) -{ - TSRMLS_FETCH(); - - return TG(req)->sock; -} - -void tux_set_dont_close(void) -{ - TSRMLS_FETCH(); - - TG(req)->event = PHP_TUX_BACKGROUND_CONN; - tux(TUX_ACTION_POSTPONE_REQ, TG(req)); - TG(tux_action) = TUX_ACTION_EVENTLOOP; -} - -void TUXAPI_init(void) -{ - sapi_startup(&tux_sapi_module); - tux_sapi_module.startup(&tux_sapi_module); - SG(server_context) = (void *) 1; -} - -void doesnotmatter_fini(void) -{ - if (SG(server_context) != NULL) { - tux_sapi_module.shutdown(&tux_sapi_module); - sapi_shutdown(); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/sapi/webjames/CREDITS b/sapi/webjames/CREDITS deleted file mode 100644 index 73a7983e9250a..0000000000000 --- a/sapi/webjames/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -WebJames -Alex Waugh diff --git a/sapi/webjames/README b/sapi/webjames/README deleted file mode 100644 index 746a7762fb258..0000000000000 --- a/sapi/webjames/README +++ /dev/null @@ -1,28 +0,0 @@ -README for WebJames SAPI module -by Alex Waugh - -This is a SAPI module for the WebJames HTTP server, which runs on the -RISC OS operating system. - - -DOWNLOADS - -A recent (February 2002 or later) version of the GCCSDK cross compiler -http://www.hard-mofo.dsvr.net/ - -WebJames 0.35 or later -http://www.webjames.alexwaugh.com/ - - -BUILDING - -$ cd php5 -$ ./configure \ - --host=arm-riscos-aof \ - --with-webjames=../webjames/src \ - --with-config-file-path=/Choices: \ - other PHP options -$ make install -$ cd ../webjames -$ ./configure --enable-php -$ make diff --git a/sapi/webjames/config.m4 b/sapi/webjames/config.m4 deleted file mode 100644 index 78c8a1936d97a..0000000000000 --- a/sapi/webjames/config.m4 +++ /dev/null @@ -1,21 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(webjames,, -[ --with-webjames=SRCDIR Build PHP as a WebJames module (RISC OS only)], no, no) - -AC_MSG_CHECKING([for webjames]) - -if test "$PHP_WEBJAMES" != "no"; then - PHP_EXPAND_PATH($PHP_WEBJAMES, PHP_WEBJAMES) - INSTALL_IT="\ - echo 'PHP_LIBS = -l$abs_srcdir/$SAPI_STATIC \$(PHP_LIBS) \$(EXTRA_LIBS)' > $PHP_WEBJAMES/build/php; \ - echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $PHP_WEBJAMES/build/php; \ - echo 'PHP_CFLAGS = -DPHP \$(COMMON_FLAGS) \$(EXTRA_CFLAGS) -I$abs_srcdir/sapi/webjames' >> $PHP_WEBJAMES/build/php;" - PHP_ADD_INCLUDE($PHP_WEBJAMES) - PHP_SELECT_SAPI(webjames, static, webjames.c) - AC_MSG_RESULT([yes, using $PHP_WEBJAMES]) -else - AC_MSG_RESULT(no) -fi diff --git a/sapi/webjames/php_webjames.h b/sapi/webjames/php_webjames.h deleted file mode 100644 index e54caea704658..0000000000000 --- a/sapi/webjames/php_webjames.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Alex Waugh | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_WEBJAMES_H -#define PHP_WEBJAMES_H - -#include "webjames.h" - -void webjames_php_shutdown(void); -int webjames_php_init(void); -void webjames_php_request(struct connection *conn); - -#endif diff --git a/sapi/webjames/webjames.c b/sapi/webjames/webjames.c deleted file mode 100644 index f166eddfb8baa..0000000000000 --- a/sapi/webjames/webjames.c +++ /dev/null @@ -1,329 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Alex Waugh | - +----------------------------------------------------------------------+ -*/ - - -#include "php.h" -#include "SAPI.h" -#include "php_main.h" -#include "php_variables.h" - -#define WEBJAMES_PHP_ONLY -#include "php_webjames.h" - -#include - -#define WEBJAMES_SAPI_VERSION "1.0.2" - -typedef struct { - struct connection *conn; /*structure holding all the details of the current request*/ - int bodyread; /*amount of POST body read*/ - closefn oldclose; /*function to call to close the connection*/ -} php_webjames_globals; - -static php_webjames_globals webjames_globals; - -#define WG(v) (webjames_globals.v) - -static int sapi_webjames_ub_write(const char *str, uint str_length TSRMLS_DC) -/*unbuffered write - send data straight out to socket*/ -{ - int totalbytes = 0; - - do { - int bytes; - bytes = webjames_writebuffer(WG(conn),str,str_length); - if (bytes<0) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - if (!PG(ignore_user_abort)) { - zend_bailout(); - } - return bytes; - } - str += bytes; - str_length -= bytes; - totalbytes += bytes; - } while (str_length); - return totalbytes; -} - -static void sapi_webjames_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) -/*send an HTTP header*/ -{ - char *header = sapi_header->header; - int len = sapi_header->header_len; - if (WG(conn)->flags.outputheaders) { - while (sapi_header && len > 0) { - int bytes; - bytes = webjames_writebuffer(WG(conn), header, len); - if (bytes<0) { - PG(connection_status) = PHP_CONNECTION_ABORTED; - if (!PG(ignore_user_abort)) { - zend_bailout(); - } - return; - } - header += bytes; - len -= bytes; - } - webjames_writestring(WG(conn), "\r\n"); - } -} - -static int sapi_webjames_read_post(char *buffer, uint count_bytes TSRMLS_DC) -/*read some of the post data*/ -{ - if (WG(conn)->body==NULL) return 0; - if (count_bytes+WG(bodyread)>WG(conn)->bodysize) count_bytes=WG(conn)->bodysize-WG(bodyread); - memcpy(buffer, WG(conn)->body+WG(bodyread), count_bytes); - WG(bodyread)+=count_bytes; - return count_bytes; -} - -static char *sapi_webjames_read_cookies(TSRMLS_D) -{ - return WG(conn)->cookie; -} - -#define BUF_SIZE 512 -#define ADD_STRING(name,string)\ - php_register_variable(name, string, track_vars_array TSRMLS_CC) - -#define ADD_NUM(name,field) {\ - snprintf(buf, BUF_SIZE, "%d", WG(conn)->field);\ - php_register_variable(name, buf, track_vars_array TSRMLS_CC);\ -} - -#define ADD_FIELD(name, field) \ - if (WG(conn)->field) { \ - php_register_variable(name, WG(conn)->field, track_vars_array TSRMLS_CC); \ - } - -static void sapi_webjames_register_variables(zval *track_vars_array TSRMLS_DC) -{ - char buf[BUF_SIZE + 1]; - char *docroot; - - buf[BUF_SIZE] = '\0'; - - ADD_STRING("SERVER_SOFTWARE", configuration.server); - ADD_STRING("SERVER_NAME", configuration.serverip); - ADD_FIELD("SERVER_PROTOCOL", protocol); - ADD_NUM("SERVER_PORT", port); - ADD_STRING("SERVER_ADMIN",configuration.webmaster); - ADD_STRING("GATEWAY_INTERFACE", "CGI/1.1"); - - docroot = __unixify(WG(conn)->homedir,0,NULL,1024,0); - if (docroot) ADD_STRING("DOCUMENT_ROOT", docroot); - - ADD_FIELD("REQUEST_METHOD", methodstr); - ADD_FIELD("REQUEST_URI", requesturi); - ADD_STRING("PATH_TRANSLATED", SG(request_info).path_translated); - ADD_FIELD("SCRIPT_NAME", uri); - ADD_FIELD("PHP_SELF", uri); - ADD_FIELD("QUERY_STRING", args); - - - snprintf(buf, BUF_SIZE, "%d.%d.%d.%d", WG(conn)->ipaddr[0], WG(conn)->ipaddr[1], WG(conn)->ipaddr[2], WG(conn)->ipaddr[3]); - ADD_STRING("REMOTE_ADDR", buf); - if (WG(conn)->dnsstatus == DNS_OK) ADD_FIELD("REMOTE_HOST", host); - - if ((WG(conn)->method == METHOD_POST) || (WG(conn)->method == METHOD_PUT)) { - ADD_NUM("CONTENT_LENGTH", bodysize); - ADD_FIELD("CONTENT_TYPE", type); - } - - if ((WG(conn)->method == METHOD_PUT) || (WG(conn)->method == METHOD_DELETE)) ADD_FIELD("ENTITY_PATH", requesturi); - - if (WG(conn)->pwd) { - ADD_STRING("AUTH_TYPE", "basic"); - ADD_FIELD("REMOTE_USER", authorization); - } - - ADD_FIELD("HTTP_COOKIE", cookie); - ADD_FIELD("HTTP_USER_AGENT", useragent); - ADD_FIELD("HTTP_REFERER", referer); - ADD_FIELD("HTTP_ACCEPT", accept); - ADD_FIELD("HTTP_ACCEPT_LANGUAGE", acceptlanguage); - ADD_FIELD("HTTP_ACCEPT_CHARSET", acceptcharset); - ADD_FIELD("HTTP_ACCEPT_ENCODING", acceptencoding); -} - -static void webjames_module_main(TSRMLS_D) -{ - zend_file_handle file_handle; - FILE *fp=NULL; - char *path; - - /* Convert filename to Unix format*/ - __riscosify_control|=__RISCOSIFY_STRICT_UNIX_SPECS; - path = __unixify(WG(conn)->filename,0,NULL,1024,0); - if (path) SG(request_info).path_translated = estrdup(path); - - SG(request_info).query_string = WG(conn)->args; - SG(request_info).request_uri = WG(conn)->requesturi; - SG(request_info).request_method = WG(conn)->methodstr; - if (WG(conn)->method==METHOD_HEAD) { - SG(request_info).headers_only = 1; - } else { - SG(request_info).headers_only = 0; - } - SG(sapi_headers).http_response_code = 200; - SG(request_info).content_type = WG(conn)->type; - SG(request_info).content_length = WG(conn)->bodysize; - - SG(request_info).auth_user = NULL; - SG(request_info).auth_password = NULL; - if (WG(conn)->authorization) { - char *colon=strchr(WG(conn)->authorization,':'); - if (colon) { - SG(request_info).auth_user = emalloc(colon-WG(conn)->authorization+1); - if (SG(request_info).auth_user) { - memcpy(SG(request_info).auth_user,WG(conn)->authorization,colon-WG(conn)->authorization); - SG(request_info).auth_user[colon-WG(conn)->authorization]='\0'; - SG(request_info).auth_password = estrdup(colon+1); - } - } - } - - /*ensure that syslog calls get logged separately from WebJames' main log */ - openlog("PHP",0,0); - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = SG(request_info).path_translated; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - - if (php_request_startup(TSRMLS_C) == FAILURE) { - return; - } - - php_execute_script(&file_handle TSRMLS_CC); - php_request_shutdown(NULL); -} - -static void webjames_php_close(struct connection *conn, int force) -/*called by webjames if it wants to close the connection*/ -{ - TSRMLS_FETCH(); - - php_request_shutdown(NULL); - WG(oldclose)(conn,force); -} - -void webjames_php_request(struct connection *conn) -/*called by WebJames to start handler*/ -{ - TSRMLS_FETCH(); - - WG(conn) = conn; - WG(bodyread) = 0; - WG(oldclose) = conn->close; - conn->close=webjames_php_close; - - webjames_module_main(TSRMLS_C); - - WG(oldclose)(WG(conn), 0); -} - -static void php_info_webjames(ZEND_MODULE_INFO_FUNC_ARGS) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", WEBJAMES_SAPI_VERSION); - php_info_print_table_row(2, "WebJames version", WEBJAMES_VERSION " (" WEBJAMES_DATE ")"); - php_info_print_table_end(); -} - -static zend_module_entry php_webjames_module = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "WebJames", - NULL, - NULL, - NULL, - NULL, - NULL, - php_info_webjames, -#if ZEND_MODULE_API_NO >= 20010901 - WEBJAMES_SAPI_VERSION, -#endif - STANDARD_MODULE_PROPERTIES -}; - - -static int php_webjames_startup(sapi_module_struct *sapi_module) -{ - if(php_module_startup(sapi_module, &php_webjames_module, 1) == FAILURE) { - return FAILURE; - } else { - return SUCCESS; - } -} - -static sapi_module_struct sapi_module = { - "webjames", /* name */ - "WebJames", /* pretty name */ - - php_webjames_startup, /* startup */ - php_module_shutdown_wrapper, /* shutdown */ - - NULL, /* activate */ - NULL, /* deactivate */ - - sapi_webjames_ub_write, /* unbuffered write */ - NULL, /* flush */ - NULL, /* get uid */ - NULL, /* getenv */ - - php_error, /* error handler */ - - NULL, /* header handler */ - NULL, /* send headers handler */ - sapi_webjames_send_header, /* send header handler */ - sapi_webjames_read_post, /* read POST data */ - sapi_webjames_read_cookies, /* read Cookies */ - - sapi_webjames_register_variables, /* register server variables */ - NULL, /* Log message */ - NULL, /* Get request time */ - - STANDARD_SAPI_MODULE_PROPERTIES -}; - -int webjames_php_init(void) -/*called when WebJames initialises*/ -{ - TSRMLS_FETCH(); - if (strcmp(configuration.webjames_h_revision,WEBJAMES_H_REVISION)!=0) { - /*This file was compiled against a different revision of - webjames.h than webjames was, which could be bad news*/ - webjames_writelog(0,"PHP module is compiled for WebJames (%s) and was linked with a different version (%s)",WEBJAMES_H_REVISION,configuration.webjames_h_revision); - return 0; /*failed to initialise*/ - } - sapi_startup(&sapi_module); - sapi_module.startup(&sapi_module); - SG(server_context) = (void *) 1; - return 1; /*initialised correctly*/ -} - -void webjames_php_shutdown(void) -/*called when WebJames is about to quit*/ -{ - sapi_module.shutdown(&sapi_module); - sapi_shutdown(); -} diff --git a/scripts/Makefile.frag b/scripts/Makefile.frag deleted file mode 100644 index 632cbb00d7b0c..0000000000000 --- a/scripts/Makefile.frag +++ /dev/null @@ -1,51 +0,0 @@ - -# -# Build environment install -# - -phpincludedir = $(includedir)/php -phpbuilddir = $(libdir)/build - -BUILD_FILES = \ - scripts/phpize.m4 \ - build/mkdep.awk \ - build/scan_makefile_in.awk \ - build/libtool.m4 \ - Makefile.global \ - acinclude.m4 \ - ltmain.sh \ - run-tests.php - -BUILD_FILES_EXEC = \ - build/shtool \ - config.guess \ - config.sub - -bin_SCRIPTS = phpize php-config -man_PAGES = phpize php-config - -install-build: - @echo "Installing build environment: $(INSTALL_ROOT)$(phpbuilddir)/" - @$(mkinstalldirs) $(INSTALL_ROOT)$(phpbuilddir) $(INSTALL_ROOT)$(bindir) && \ - (cd $(top_srcdir) && \ - $(INSTALL) $(BUILD_FILES_EXEC) $(INSTALL_ROOT)$(phpbuilddir) && \ - $(INSTALL_DATA) $(BUILD_FILES) $(INSTALL_ROOT)$(phpbuilddir)) - -install-programs: $(builddir)/phpize $(builddir)/php-config - @echo "Installing helper programs: $(INSTALL_ROOT)$(bindir)/" - @for prog in $(bin_SCRIPTS); do \ - echo " program: $(program_prefix)$${prog}$(program_suffix)"; \ - $(INSTALL) -m 755 $(builddir)/$${prog} $(INSTALL_ROOT)$(bindir)/$(program_prefix)$${prog}$(program_suffix); \ - done - @echo "Installing man pages: $(INSTALL_ROOT)$(mandir)/man1/" - @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 - @for page in $(man_PAGES); do \ - echo " page: $(program_prefix)$${page}$(program_suffix).1"; \ - $(INSTALL_DATA) $(builddir)/man1/$${page}.1 $(INSTALL_ROOT)$(mandir)/man1/$(program_prefix)$${page}$(program_suffix).1; \ - done - -$(builddir)/phpize: $(srcdir)/phpize.in $(top_builddir)/config.status - (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status) - -$(builddir)/php-config: $(srcdir)/php-config.in $(top_builddir)/config.status - (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status) diff --git a/scripts/apache/apconf-conv.sh b/scripts/apache/apconf-conv.sh deleted file mode 100755 index 6126bdc27d9d6..0000000000000 --- a/scripts/apache/apconf-conv.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "Usage: $0 /somewhere/httpd.conf" - exit 1 -fi - -if [ ! -w $1 ]; then - echo "You cannot write to $1" - exit 1 -fi - -TMPFILE=tmpfile.$$ - -awk -f conffix.awk <$1 >$TMPFILE - -if [ "$?" != 0 ]; then - exit 1 -fi - -mv -f $1 $1.orig -mv -f $TMPFILE $1 -exit 0 - diff --git a/scripts/apache/aphtaccess-conv.sh b/scripts/apache/aphtaccess-conv.sh deleted file mode 100755 index 1af59d28436d8..0000000000000 --- a/scripts/apache/aphtaccess-conv.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "Usage: $0 /somewhere/.htaccess" - exit 1 -fi - -if [ ! -w $1 ]; then - echo "You cannot write to $1" - exit 1 -fi - -TMPFILE=tmpfile.$$ - -awk -f htaccessfix.awk <$1 >$TMPFILE - -if [ "$?" != 0 ]; then - exit 1 -fi - -mv -f $1 $1.orig -mv -f $TMPFILE $1 -exit 0 - diff --git a/scripts/apache/conffix.awk b/scripts/apache/conffix.awk deleted file mode 100644 index 88be6fade70d4..0000000000000 --- a/scripts/apache/conffix.awk +++ /dev/null @@ -1,23 +0,0 @@ -# $Id$ - -/^[ \t]*php3_*/ { - phpcommand=substr($1,6) - phpvalue=tolower($2) - print "" - print $0 - print "" - print "" - if (phpvalue=="on") { - print "php_admin_flag " phpcommand " on" - } else if (phpvalue=="off") { - print "php_admin_flag " phpcommand " off" - } else { - print "php_admin_value " phpcommand " " substr($0,index($0,$1)+length($1)+1) - } - print "" -} - -! /^[ \t]*php3_*/ { - print $0 -} - diff --git a/scripts/apache/htaccessfix.awk b/scripts/apache/htaccessfix.awk deleted file mode 100644 index 3c784cd335903..0000000000000 --- a/scripts/apache/htaccessfix.awk +++ /dev/null @@ -1,23 +0,0 @@ -# $Id$ - -/^[ \t]*php3_*/ { - phpcommand=substr($1,6) - phpvalue=tolower($2) - print "" - print $0 - print "" - print "" - if (phpvalue=="on") { - print "php_flag " phpcommand " on" - } else if (phpvalue=="off") { - print "php_flag " phpcommand " off" - } else { - print "php_value " phpcommand " " substr($0,index($0,$1)+length($1)+1) - } - print "" -} - -! /^[ \t]*php3_*/ { - print $0 -} - diff --git a/scripts/dev/check_parameters.php b/scripts/dev/check_parameters.php deleted file mode 100644 index c9f5169eecfbc..0000000000000 --- a/scripts/dev/check_parameters.php +++ /dev/null @@ -1,373 +0,0 @@ - | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -define('REPORT_LEVEL', 2); // 0 reports less false-positives. up to level 5. -define('VERSION', '5.2'); // minimum is 5.2 -define('PHPDIR', realpath(dirname(__FILE__) . '/../..')); - - -// be sure you have enough memory and stack for PHP. pcre will push the limits! -ini_set('pcre.backtrack_limit', 10000000); - - -// ------------------------ end of config ---------------------------- - - -$API_params = array( - 'a' => array('zval**'), // array as zval* - 'b' => array('zend_bool*'), // boolean - 'C' => array('zend_class_entry**'), // class - 'd' => array('double*'), // double - 'f' => array('zend_fcall_info*', 'zend_fcall_info_cache*'), // function - 'h' => array('HashTable**'), // array as an HashTable* - 'l' => array('long*'), // long - 'o' => array('zval**'), //object - 'O' => array('zval**', 'zend_class_entry*'), // object of given type - 'r' => array('zval**'), // resource - 's' => array('char**', 'int*'), // string - 'z' => array('zval**'), // zval* - 'Z' => array('zval***') // zval** -); - -// specific to PHP >= 6 -if (version_compare(VERSION, '6', 'ge')) { - $API_params['S'] = $API_params['s']; // binary string - $API_params['t'] = array('zstr*', 'int*', 'zend_uchar*'); // text - $API_params['T'] = $API_params['t']; - $API_params['u'] = array('UChar**', 'int*'); // unicode - $API_params['U'] = $API_params['u']; -} - - -/** reports an error, according to its level */ -function error($str, $level = 0) -{ - global $current_file, $current_function, $line; - - if ($level <= REPORT_LEVEL) { - if (strpos($current_file,PHPDIR) === 0) { - $filename = substr($current_file, strlen(PHPDIR)+1); - } else { - $filename = $current_file; - } - echo $filename , " [$line] $current_function : $str\n"; - } -} - - -/** this updates the global var $line (for error reporting) */ -function update_lineno($offset) -{ - global $lines_offset, $line; - - $left = 0; - $right = $count = count($lines_offset)-1; - - // a nice binary search :) - do { - $mid = intval(($left + $right)/2); - $val = $lines_offset[$mid]; - - if ($val < $offset) { - if (++$mid > $count || $lines_offset[$mid] > $offset) { - $line = $mid; - return; - } else { - $left = $mid; - } - } else if ($val > $offset) { - if ($lines_offset[--$mid] < $offset) { - $line = $mid+1; - return; - } else { - $right = $mid; - } - } else { - $line = $mid+1; - return; - } - } while (true); -} - - -/** parses the sources and fetches its vars name, type and if they are initialized or not */ -function get_vars($txt) -{ - $ret = array(); - preg_match_all('/((?:(?:unsigned|struct)\s+)?\w+)(?:\s*(\*+)\s+|\s+(\**))(\w+(?:\[\s*\w*\s*\])?)\s*(?:(=)[^,;]+)?((?:\s*,\s*\**\s*\w+(?:\[\s*\w*\s*\])?\s*(?:=[^,;]+)?)*)\s*;/S', $txt, $m, PREG_SET_ORDER); - - foreach ($m as $x) { - // the first parameter is special - if (!in_array($x[1], array('else', 'endif', 'return'))) // hack to skip reserved words - $ret[$x[4]] = array($x[1] . $x[2] . $x[3], $x[5]); - - // are there more vars? - if ($x[6]) { - preg_match_all('/(\**)\s*(\w+(?:\[\s*\w*\s*\])?)\s*(=?)/S', $x[6], $y, PREG_SET_ORDER); - foreach ($y as $z) { - $ret[$z[2]] = array($x[1] . $z[1], $z[3]); - } - } - } - -// if ($GLOBALS['current_function'] == 'for_debugging') { print_r($m);print_r($ret); } - return $ret; -} - - -/** run diagnostic checks against one var. */ -function check_param($db, $idx, $exp, $optional) -{ - global $error_few_vars_given; - - if ($idx >= count($db)) { - if (!$error_few_vars_given) { - error("too few variables passed to function"); - $error_few_vars_given = true; - } - return; - } elseif ($db[$idx][0] === '**dummy**') { - return; - } - - if ($db[$idx][1] != $exp) { - error("{$db[$idx][0]}: expected '$exp' but got '{$db[$idx][1]}' [".($idx+1).']'); - } - - if ($optional && !$db[$idx][2]) { - error("optional var not initialized: {$db[$idx][0]} [".($idx+1).']', 1); - - } elseif (!$optional && $db[$idx][2]) { - error("not optional var is initialized: {$db[$idx][0]} [".($idx+1).']', 2); - } -} - - -/** fetch params passed to zend_parse_params*() */ -function get_params($vars, $str) -{ - $ret = array(); - preg_match_all('/(?:\([^)]+\))?(&?)([\w>.()-]+(?:\[\w+\])?)\s*,?((?:\)*\s*=)?)/S', $str, $m, PREG_SET_ORDER); - - foreach ($m as $x) { - $name = $x[2]; - - // little hack for last parameter - if (strpos($name, '(') === false) { - $name = rtrim($name, ')'); - } - - if (empty($vars[$name][0])) { - error("variable not found: '$name'", 3); - $ret[][] = '**dummy**'; - - } else { - $ret[] = array($name, $vars[$name][0] . ($x[1] ? '*' : ''), $vars[$name][1]); - } - - // the end (yes, this is a little hack :P) - if ($x[3]) { - break; - } - } - -// if ($GLOBALS['current_function'] == 'for_debugging') { var_dump($m); var_dump($ret); } - return $ret; -} - - -/** run tests on a function. the code is passed in $txt */ -function check_function($name, $txt, $offset) -{ - global $API_params; - - if (preg_match_all('/zend_parse_parameters(?:_ex\s*\([^,]+,[^,]+|\s*\([^,]+),\s*"([^"]*)"\s*,\s*([^{;]*)/S', $txt, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { - - $GLOBALS['current_function'] = $name; - - foreach ($matches as $m) { - $GLOBALS['error_few_vars_given'] = false; - update_lineno($offset + $m[2][1]); - - $vars = get_vars(substr($txt, 0, $m[0][1])); // limit var search to current location - $params = get_params($vars, $m[2][0]); - $optional = $varargs = false; - $last_last_char = $last_char = ''; - $j = -1; - $len = strlen($m[1][0]); - - for ($i = 0; $i < $len; ++$i) { - switch($char = $m[1][0][$i]) { - // separator for optional parameters - case '|': - if ($optional) { - error("more than one optional separator at char #$i"); - } else { - $optional = true; - if ($i == $len-1) { - error("unnecessary optional separator"); - } - } - break; - - // separate_zval_if_not_ref - case '/': - if (!in_array($last_char, array('r', 'z'))) { - error("the '/' specifier cannot be applied to '$last_char'"); - } - break; - - // nullable arguments - case '!': - if (!in_array($last_char, array('a', 'C', 'f', 'h', 'o', 'O', 'r', 's', 't', 'z', 'Z'))) { - error("the '!' specifier cannot be applied to '$last_char'"); - } - break; - - case '&': - if (version_compare(VERSION, '6', 'ge')) { - if ($last_char == 's' || ($last_last_char == 's' && $last_char == '!')) { - check_param($params, ++$j, 'UConverter*', $optional); - - } else { - error("the '&' specifier cannot be applied to '$last_char'"); - } - } else { - error("unknown char ('&') at column $i"); - } - break; - - case '+': - case '*': - if (version_compare(VERSION, '6', 'ge')) { - if ($varargs) { - error("A varargs specifier can only be used once. repeated char at column $i"); - } else { - check_param($params, ++$j, 'zval****', $optional); - check_param($params, ++$j, 'int*', $optional); - $varargs = true; - } - } else { - error("unknown char ('$char') at column $i"); - } - break; - - default: - if (isset($API_params[$char])) { - foreach($API_params[$char] as $exp) { - check_param($params, ++$j, $exp, $optional); - } - } else { - error("unknown char ('$char') at column $i"); - } - } - - $last_last_char = $last_char; - $last_char = $char; - } - } - } -} - - -/** the main recursion function. splits files in functions and calls the other functions */ -function recurse($path) -{ - foreach (scandir($path) as $file) { - if ($file == '.' || $file == '..' || $file == 'CVS') continue; - - $file = "$path/$file"; - if (is_dir($file)) { - recurse($file); - continue; - } - - // parse only .c and .cpp files - if (substr_compare($file, '.c', -2) && substr_compare($file, '.cpp', -4)) continue; - - $txt = file_get_contents($file); - // remove comments (but preserve the number of lines) - $txt = preg_replace(array('@//.*@S', '@/\*.*\*/@SsUe'), array('', 'preg_replace("/[^\r\n]+/S", "", \'$0\')'), $txt); - - - $split = preg_split('/PHP_(?:NAMED_)?(?:FUNCTION|METHOD)\s*\((\w+(?:,\s*\w+)?)\)/S', $txt, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE); - - if (count($split) < 2) continue; // no functions defined on this file - array_shift($split); // the first part isn't relevant - - - // generate the line offsets array - $j = 0; - $lines = preg_split("/(\r\n?|\n)/S", $txt, -1, PREG_SPLIT_DELIM_CAPTURE); - $lines_offset = array(); - - for ($i = 0; $i < count($lines); ++$i) { - $j += strlen($lines[$i]) + strlen(@$lines[++$i]); - $lines_offset[] = $j; - } - - $GLOBALS['lines_offset'] = $lines_offset; - $GLOBALS['current_file'] = $file; - - - for ($i = 0; $i < count($split); $i+=2) { - // if the /* }}} */ comment is found use it to reduce false positives - // TODO: check the other indexes - list($f) = preg_split('@/\*\s*}}}\s*\*/@S', $split[$i+1][0]); - check_function(preg_replace('/\s*,\s*/S', '::', $split[$i][0]), $f, $split[$i][1]); - } - } -} - -$dirs = array(); - -if (isset($argc) && $argc > 1) { - if ($argv[1] == '-h' || $argv[1] == '-help' || $argv[1] == '--help') { - echo << $tmpfile - cp $tmpfile $file -done - -rm -f $tmpfile - -exit 0 diff --git a/scripts/dev/conv_z_macros b/scripts/dev/conv_z_macros deleted file mode 100755 index ea45bc2ef98ba..0000000000000 --- a/scripts/dev/conv_z_macros +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/sh -# -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2007 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 3.01 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | http://www.php.net/license/3_01.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. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ - -for i in $@; do - echo -n "Processing $i... " - sed \ - -e 's/(\*\([^()]\+\))->type/Z_TYPE_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->type/Z_TYPE_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.type/Z_TYPE(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.dval/Z_DVAL_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.dval/Z_DVAL_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.dval/Z_DVAL(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.lval/Z_LVAL_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.lval/Z_LVAL_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.lval/Z_LVAL(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.ht/Z_ARRVAL_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.ht/Z_ARRVAL_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.ht/Z_ARRVAL(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.str\.val/Z_STRVAL_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.str\.val/Z_STRVAL_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.str\.val/Z_STRVAL(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.str\.len/Z_STRLEN_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.str\.len/Z_STRLEN_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.str\.len/Z_STRLEN(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.obj\.properties/Z_OBJPROP_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.obj\.properties/Z_OBJPROP_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.obj\.properties/Z_OBJPROP(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.obj\.ce/Z_OBJCE_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.obj\.ce/Z_OBJCE_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.obj\.ce/Z_OBJCE(\1)/g' \ - -e 's/(\*\([^()]\+\))->value\.obj/Z_OBJ_PP(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)->value\.obj/Z_OBJ_P(\1)/g' \ - -e 's/\([a-z_][]a-z_0-9\[]*\)\.value\.obj/Z_OBJ(\1)/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)->Z_\([A-Z_]\+\)(/Z_\2(\1->/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)->Z_\([A-Z_]\+\)(/Z_\2(\1->/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)->Z_\([A-Z_]\+\)(/Z_\2(\1->/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\.Z_\([A-Z_]\+\)(/Z_\2(\1./g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\.Z_\([A-Z_]\+\)(/Z_\2(\1./g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\.Z_\([A-Z_]\+\)(/Z_\2(\1./g' \ - < $i > tmp && cp tmp $i - echo "DONE" -done - -rm -f tmp diff --git a/scripts/dev/credits b/scripts/dev/credits deleted file mode 100755 index f99c0316aa1cb..0000000000000 --- a/scripts/dev/credits +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -awkprog=' -BEGIN { FS = "\n|\r\n|\r"; RS = "" } -{ print "CREDIT_LINE(\""$1"\", \""$2"\");" }' - -for what in ext sapi -do - file=ext/standard/credits_$what.h - cat >$file <> $file -done diff --git a/scripts/dev/extern_c.php b/scripts/dev/extern_c.php deleted file mode 100644 index 72c7edcd3288c..0000000000000 --- a/scripts/dev/extern_c.php +++ /dev/null @@ -1,45 +0,0 @@ - $line) { - if (ereg("^[[:space:]]*BEGIN_EXTERN_C", $line)) { -# echo "$file:".($nr+1)." $line"; - $flag = true; - } else if (ereg("^[[:space:]]*END_EXTERN_C", $line)) { -# echo "$file:".($nr+1)." $line"; - $flag = false; - } else if ( (ereg("^[[:space:]]*PHPAPI[[:space:]]*", $line)) - ||(ereg("^[[:space:]]*ZEND_API[[:space:]]*", $line))) { - if (strstr($line,"(")) { - if (!$flag) echo "$file:".($nr+1)." $line"; - } - } - } -} - -array_shift($_SERVER["argv"]); - -if (count($_SERVER["argv"])) { - foreach ($_SERVER["argv"] as $dir) { - scan_dir($dir); - } -} else { - scan_dir("."); -} -?> \ No newline at end of file diff --git a/scripts/dev/find_tested.php b/scripts/dev/find_tested.php deleted file mode 100644 index f95c46251c594..0000000000000 --- a/scripts/dev/find_tested.php +++ /dev/null @@ -1,222 +0,0 @@ - 3) { - die($usage); -} - -$extension_test_path = $argv[1]; - -if ($num_params == 3) { - $extension_name = $argv[2]; - - // check extension exists - $extensions = get_loaded_extensions(); - if (!in_array($extension_name, $extensions)) { - echo "Error: extension $extension_name is not loaded. Loaded extensions:\n"; - foreach($extensions as $extension) { - echo "$extension\n"; - } - die(); - } -} else { - $extension_name = false; -} - - -$method_info = populate_method_info(); - -if ($extension_name != false) { - // get only the methods from the extension we are querying - $extension_method_info = array(); - foreach($method_info as $method_record) { - if (strcasecmp($extension_name, $method_record[EXTENSION_NAME]) == 0) { - $extension_method_info[] = $method_record; - } - } -} else { - $extension_method_info = $method_info; -} - -get_phpt_files($extension_test_path, $count, $phpt_files); - -$extension_method_info = mark_methods_as_tested($extension_method_info, $phpt_files); - - -foreach($extension_method_info as $record) { - echo $record[EXTENSION_NAME] . ","; - echo $record[CLASS_NAME] . ","; - echo $record[METHOD_NAME] . ","; - echo $record[IS_TESTED] . ","; - echo $record[TESTS] . "\n"; -} - -/** - * Marks the "tested" status of methods in $method_info according - * to whether they are tested in $phpt_files - */ -function mark_methods_as_tested($method_info, $phpt_files) { - - foreach($phpt_files as $phpt_file) { - $tested_functions = extract_tests($phpt_file); - - foreach($tested_functions as $tested_function) { - - // go through method info array marking this funtion as tested - foreach($method_info as &$current_method_record) { - if (strcasecmp($tested_function, $current_method_record[METHOD_NAME]) == 0) { - // matched the method name - if ($current_method_record[IS_DUPLICATE] == true) { - // we cannot be sure which class this method corresponds to, - // so mark method as needing to be verified - $current_method_record[IS_TESTED] = "verify"; - } else { - $current_method_record[IS_TESTED] = "yes"; - } - $current_method_record[TESTS] .= $phpt_file . "; "; - } - } - } - } - return $method_info; -} - -/** - * returns an array containing a record for each defined method. - */ -function populate_method_info() { - - $method_info = array(); - - // get functions - $all_functions = get_defined_functions(); - $internal_functions = $all_functions["internal"]; - - foreach ($internal_functions as $function) { - // populate new method record - $function_record = array(); - $function_record[CLASS_NAME] = "Function"; - $function_record[METHOD_NAME] = $function; - $function_record[IS_TESTED] = "no"; - $function_record[TESTS] = ""; - $function_record[IS_DUPLICATE] = false; - - // record the extension that the function belongs to - $reflectionFunction = new ReflectionFunction($function); - $extension = $reflectionFunction->getExtension(); - if ($extension != null) { - $function_record[EXTENSION_NAME] = $extension->getName(); - } else { - $function_record[EXTENSION_NAME] = ""; - } - // insert new method record into info array - $method_info[] = $function_record; - } - - // get methods - $all_classes = get_declared_classes(); - foreach ($all_classes as $class) { - $reflectionClass = new ReflectionClass($class); - $methods = $reflectionClass->getMethods(); - foreach ($methods as $method) { - // populate new method record - $new_method_record = array(); - $new_method_record[CLASS_NAME] = $reflectionClass->getName(); - $new_method_record[METHOD_NAME] = $method->getName(); - $new_method_record[IS_TESTED] = "no"; - $new_method_record[TESTS] = ""; - - $extension = $reflectionClass->getExtension(); - if ($extension != null) { - $new_method_record[EXTENSION_NAME] = $extension->getName(); - } else { - $new_method_record[EXTENSION_NAME] = ""; - } - - // check for duplicate method names - $new_method_record[IS_DUPLICATE] = false; - foreach ($method_info as &$current_record) { - if (strcmp($current_record[METHOD_NAME], $new_method_record[METHOD_NAME]) == 0) { - $new_method_record[IS_DUPLICATE] = true; - $current_record[IS_DUPLICATE] = true; - } - } - // insert new method record into info array - $method_info[] = $new_method_record; - } - } - - return $method_info; -} - -function get_phpt_files($dir, &$phpt_file_count, &$all_phpt) -{ - $thisdir = dir($dir.'/'); //include the trailing slash - while(($file = $thisdir->read()) !== false) { - if ($file != '.' && $file != '..') { - $path = $thisdir->path.$file; - if(is_dir($path) == true) { - get_phpt_files($path , $phpt_file_count , $all_phpt); - } else { - if (preg_match("/\w+\.phpt$/", $file)) { - $all_phpt[$phpt_file_count] = $path; - $phpt_file_count++; - } - } - } - } -} - -function extract_tests($file) { - $code = file_get_contents($file); - - if (!preg_match('/--FILE--\s*(.*)\s*--(EXPECTF|EXPECTREGEX|EXPECT)?--/is', $code, $r)) { -// print "Unable to get code in ".$file."\n"; - return array(); - } - - $tokens = token_get_all($r[1]); - $functions = array_filter($tokens, 'filter_functions'); - $functions = array_map( 'map_token_value',$functions); - $functions = array_unique($functions); - - return $functions; -} - -function filter_functions($x) { - return $x[0] == 307; -} - -function map_token_value($x) { - return $x[1]; -} - - -?> - diff --git a/scripts/dev/phpextdist b/scripts/dev/phpextdist deleted file mode 100755 index 97df70020dfc1..0000000000000 --- a/scripts/dev/phpextdist +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/sh -if test $# -lt 2; then - echo "usage: phpextdist "; - exit 1 -fi - -phpize=`php-config --prefix`/bin/phpize -distname="$1-$2" - -if test ! -f Makefile.in || test ! -f config.m4; then - echo "Did not find required files in current directory" - exit 1 -fi - -rm -rf modules *.lo *.o *.la config.status config.cache \ -config.log libtool php_config.h config_vars.mk Makefile - -myname=`basename \`pwd\`` -cd .. -cp -rp $myname $distname -cd $distname -$phpize -cd .. -tar cf $distname.tar $distname -rm -rf $distname $distname.tar.* -gzip --best $distname.tar -mv $distname.tar.gz $myname diff --git a/scripts/dev/search_underscores.php b/scripts/dev/search_underscores.php deleted file mode 100755 index 445228b8c5ebf..0000000000000 --- a/scripts/dev/search_underscores.php +++ /dev/null @@ -1,97 +0,0 @@ -#! /usr/local/bin/php -n - | - +----------------------------------------------------------------------+ - */ - -/* This script lists extension-, class- and method names that contain any - underscores. It omits magic names (e.g. anything that starts with two - underscores but no more). - */ - -$cnt_modules = 0; -$cnt_classes = 0; -$cnt_methods = 0; -$err = 0; - -$classes = array_merge(get_declared_classes(), get_declared_interfaces()); - -$extensions = array(); - -foreach(get_loaded_extensions() as $ext) { - $cnt_modules++; - if (strpos($ext, "_") !== false) { - $err++; - $extensions[$ext] = array(); - } -} - -$cnt_classes = count($classes); - -foreach($classes as $c) { - if (strpos($c, "_") !== false) { - $err++; - $ref = new ReflectionClass($c); - if (!($ext = $ref->getExtensionName())) {; - $ext = $ref->isInternal() ? "" : ""; - } - if (!array_key_exists($ext, $extensions)) { - $extensions[$ext] = array(); - } - $extensions[$ext][$c] = array(); - foreach(get_class_methods($c) as $method) { - $cnt_methods++; - if (strpos(substr($method, substr($method, 0, 2) != "__" ? 0 : 2), "_") !== false) { - $err++; - $extensions[$ext][$c][] = $method; - } - } - } - else - { - $cnt_methods += count(get_class_methods($c)); - } -} - -$cnt = $cnt_modules + $cnt_classes + $cnt_methods; - -printf("\n"); -printf("Modules: %5d\n", $cnt_modules); -printf("Classes: %5d\n", $cnt_classes); -printf("Methods: %5d\n", $cnt_methods); -printf("\n"); -printf("Names: %5d\n", $cnt); -printf("Errors: %5d (%.1f%%)\n", $err, round($err * 100 / $cnt, 1)); -printf("\n"); - -ksort($extensions); -foreach($extensions as $ext => &$classes) { - echo "Extension: $ext\n"; - ksort($classes); - foreach($classes as $classname => &$methods) { - echo " Class: $classname\n"; - ksort($methods); - foreach($methods as $method) { - echo " Method: $method\n"; - } - } -} - -printf("\n"); - -?> \ No newline at end of file diff --git a/scripts/man1/php-config.1.in b/scripts/man1/php-config.1.in deleted file mode 100644 index b900079025f2d..0000000000000 --- a/scripts/man1/php-config.1.in +++ /dev/null @@ -1,78 +0,0 @@ -.TH php\-config 1 "2006" "The PHP Group" "Scripting Language" -.SH NAME -.TP 15 -php\-config \- get information about PHP configuration and compile options -.SH SYNOPSIS -.B php\-config -[options] -.LP -.SH DESCRIPTION -.B php\-config -is a simple shell script for obtaining information about installed PHP configuration. -.SH OPTIONS -.TP 15 -.PD 0 -.B \-\-prefix -Directory prefix where PHP is installed, e.g. /usr/local -.TP -.PD 0 -.B \-\-includes -List of \-I options with all include files -.TP -.PD 0 -.B \-\-ldflags -LD Flags which PHP was compiled with -.TP -.PD 0 -.B \-\-libs -Extra libraries which PHP was compiled with -.TP -.PD 0 -.B \-\-extension-dir -Directory where extensions are searched by default -.TP -.PD 0 -.B \-\-include-dir -Directory prefix where header files are installed by default -.TP -.PD 0 -.B \-\-php-binary -Full path to php CLI or CGI binary -.TP -.PD 0 -.B \-\-php-sapis -Show all SAPI modules available -.TP -.PD 0 -.B \-\-configure-options -Configure options to recreate configuration of current PHP installation -.TP -.PD 0 -.B \-\-version -PHP version -.TP -.PD 0 -.B \-\-vernum -PHP version as integer -.TP -.PD 1 -.P -.SH SEE ALSO -.BR php (1) -.SH VERSION INFORMATION -This manpage describes \fBphp\fP, version @PHP_VERSION@. -.SH COPYRIGHT -Copyright \(co 1997\-2006 The PHP Group -.LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B http://www.php.net/license/3_01.txt -.PD 1 -.P -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 -.B license@php.net -so we can mail you a copy immediately. diff --git a/scripts/man1/phpize.1.in b/scripts/man1/phpize.1.in deleted file mode 100644 index 2762304c800fb..0000000000000 --- a/scripts/man1/phpize.1.in +++ /dev/null @@ -1,49 +0,0 @@ -.TH phpize 1 "2006" "The PHP Group" "Scripting Language" -.SH NAME -.TP 15 -phpize - prepare a PHP extension for compiling -.SH SYNOPSIS -.B phpize -[options] -.LP -.SH DESCRIPTION -.B phpize -is a shell script to prepare PHP extension for compiling. -.SH OPTIONS -.TP 15 -.PD 0 -.B \-\-clean -Remove all created files -.TP -.PD 0 -.B \-\-help -Prints usage information -.TP -.PD 0 -.B \-\-version -.TP -.PD 1 -.B \-v -Prints API version information -.TP -.PD 1 -.P -.SH SEE ALSO -.BR php (1) -.SH VERSION INFORMATION -This manpage describes \fBphp\fP, version @PHP_VERSION@. -.SH COPYRIGHT -Copyright \(co 1997\-2006 The PHP Group -.LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B http://www.php.net/license/3_01.txt -.PD 1 -.P -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 -.B license@php.net -so we can mail you a copy immediately. diff --git a/scripts/php-config.in b/scripts/php-config.in deleted file mode 100644 index f7d0bcd354d66..0000000000000 --- a/scripts/php-config.in +++ /dev/null @@ -1,85 +0,0 @@ -#! /bin/sh - -SED="@SED@" -prefix="@prefix@" -exec_prefix="@exec_prefix@" -version="@PHP_VERSION@" -vernum="@PHP_VERSION_ID@" -include_dir="@includedir@/php" -includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib" -ldflags="@PHP_LDFLAGS@" -libs="@EXTRA_LIBS@" -extension_dir='@EXTENSION_DIR@' -program_prefix="@program_prefix@" -program_suffix="@program_suffix@" -exe_extension="@EXEEXT@" -php_cli_binary=NONE -php_cgi_binary=NONE -configure_options="@CONFIGURE_OPTIONS@" -php_sapis="@PHP_INSTALLED_SAPIS@" - -# Set php_cli_binary and php_cgi_binary if available -for sapi in $php_sapis; do - case $sapi in - cli) - php_cli_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}" - ;; - cgi) - php_cgi_binary="@bindir@/${program_prefix}php-cgi${program_suffix}${exe_extension}" - ;; - esac -done - -# Determine which (if any) php binary is available -if test "$php_cli_binary" != "NONE"; then - php_binary="$php_cli_binary" -else - php_binary="$php_cgi_binary" -fi - -# Remove quotes -configure_options=`echo $configure_options | $SED -e "s#'##g"` - -case "$1" in ---prefix) - echo $prefix;; ---includes) - echo $includes;; ---ldflags) - echo $ldflags;; ---libs) - echo $libs;; ---extension-dir) - echo $extension_dir;; ---include-dir) - echo $include_dir;; ---php-binary) - echo $php_binary;; ---php-sapis) - echo $php_sapis;; ---configure-options) - echo $configure_options;; ---version) - echo $version;; ---vernum) - echo $vernum;; -*) - cat << EOF -Usage: $0 [OPTION] -Options: - --prefix [$prefix] - --includes [$includes] - --ldflags [$ldflags] - --libs [$libs] - --extension-dir [$extension_dir] - --include-dir [$include_dir] - --php-binary [$php_binary] - --php-sapis [$php_sapis] - --configure-options [$configure_options] - --version [$version] - --vernum [$vernum] -EOF - exit 1;; -esac - -exit 0 diff --git a/scripts/phpize.in b/scripts/phpize.in deleted file mode 100644 index 35f7dc72721f3..0000000000000 --- a/scripts/phpize.in +++ /dev/null @@ -1,190 +0,0 @@ -#!/bin/sh - -# Variable declaration -prefix='@prefix@' -exec_prefix="`eval echo @exec_prefix@`" -phpdir="`eval echo @libdir@`/build" -includedir="`eval echo @includedir@`/php" -builddir="`pwd`" -SED="@SED@" - -FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4" -FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php" -CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ include/ modules/ install-sh \ - mkinstalldirs missing config.nice config.sub config.guess configure configure.in \ - aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache autom4te.cache/ \ - config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h \ - run-tests*.php tests/*.diff tests/*.exp tests/*.log tests/*.out tests/*.php" - -# function declaration -phpize_usage() -{ - echo "Usage: $0 [--clean|--help|--version|-v]" -} - -phpize_no_configm4() -{ - if test $@ -eq 1; then - clean=" --clean" - fi - - echo "Cannot find config.m4. " - echo "Make sure that you run '$0$clean' in the top level source directory of the module" - echo -} - -phpize_clean() -{ - echo "Cleaning.." - for i in $CLEAN_FILES; do - if test -f "$i"; then - rm -f $i - elif test -d "$i"; then - rm -rf $i - fi - done -} - -phpize_check_configm4() -{ - if test ! -r config.m4; then - phpize_no_configm4 $@ - exit 1 - fi - -} - -phpize_get_api_numbers() -{ - # extracting API NOs: - PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|$SED 's/#define PHP_API_VERSION//'` - ZEND_MODULE_API_NO=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO//'` - ZEND_EXTENSION_API_NO=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|$SED 's/#define ZEND_EXTENSION_API_NO//'` -} - -phpize_print_api_numbers() -{ - phpize_get_api_numbers - echo "Configuring for:" - echo "PHP Api Version: "$PHP_API_VERSION - echo "Zend Module Api No: "$ZEND_MODULE_API_NO - echo "Zend Extension Api No: "$ZEND_EXTENSION_API_NO -} - -phpize_check_build_files() -{ - if test ! -d "$phpdir"; then - cat < aclocal.m4) -} - -phpize_replace_prefix() -{ - $SED \ - -e "s#@prefix@#$prefix#" \ - < "$phpdir/phpize.m4" > configure.in -} - -phpize_autotools() -{ - $PHP_AUTOCONF || exit 1 - $PHP_AUTOHEADER || exit 1 -} - -# Main script - -case "$1" in - # Cleanup - --clean) - phpize_check_configm4 1 - phpize_clean - exit 0 - ;; - - # Usage - --help) - phpize_usage - exit 0 - ;; - - # Version - --version|-v) - phpize_print_api_numbers - exit 0 - ;; - - # Default - *) - phpize_check_configm4 0 - - phpize_check_build_files - - phpize_print_api_numbers - - phpize_copy_files - - phpize_replace_prefix - - touch install-sh mkinstalldirs missing - - phpize_check_shtool - - phpize_check_autotools - - phpize_autotools - ;; -esac - -exit 0 diff --git a/scripts/phpize.m4 b/scripts/phpize.m4 deleted file mode 100644 index ba668c8893489..0000000000000 --- a/scripts/phpize.m4 +++ /dev/null @@ -1,197 +0,0 @@ -dnl This file becomes configure.in for self-contained extensions. - -divert(1) - -AC_PREREQ(2.13) -AC_INIT(config.m4) - -PHP_CONFIG_NICE(config.nice) - -dnl -AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl -AC_DEFUN([PHP_EXT_DIR],[""])dnl -AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl -AC_DEFUN([PHP_ALWAYS_SHARED],[ - ext_output="yes, shared" - ext_shared=yes - test "[$]$1" = "no" && $1=yes -])dnl -dnl -abs_srcdir=`(cd $srcdir && pwd)` -abs_builddir=`pwd` - -AC_PROG_CC -PHP_DETECT_ICC -AC_PROG_CC_C_O - -dnl Support systems with system libraries in e.g. /usr/lib64 -PHP_ARG_WITH(libdir, for system library directory, -[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib], lib, no) - -PHP_RUNPATH_SWITCH -PHP_SHLIB_SUFFIX_NAMES - -dnl Find php-config script -PHP_ARG_WITH(php-config,, -[ --with-php-config=PATH Path to php-config [php-config]], php-config, no) - -dnl For BC -PHP_CONFIG=$PHP_PHP_CONFIG -prefix=`$PHP_CONFIG --prefix 2>/dev/null` -phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null` -INCLUDES=`$PHP_CONFIG --includes 2>/dev/null` -EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null` -PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null` - -if test -z "$prefix"; then - AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH]) -fi - -php_shtool=$srcdir/build/shtool -PHP_INIT_BUILD_SYSTEM - -AC_MSG_CHECKING([for PHP prefix]) -AC_MSG_RESULT([$prefix]) -AC_MSG_CHECKING([for PHP includes]) -AC_MSG_RESULT([$INCLUDES]) -AC_MSG_CHECKING([for PHP extension directory]) -AC_MSG_RESULT([$EXTENSION_DIR]) -AC_MSG_CHECKING([for PHP installed headers prefix]) -AC_MSG_RESULT([$phpincludedir]) - -dnl Checks for PHP_DEBUG / ZEND_DEBUG / ZTS -AC_MSG_CHECKING([if debug is enabled]) -old_CPPFLAGS=$CPPFLAGS -CPPFLAGS="-I$phpincludedir" -AC_EGREP_CPP(php_debug_is_enabled,[ -#include
-#if ZEND_DEBUG -php_debug_is_enabled -#endif -],[ - PHP_DEBUG=yes -],[ - PHP_DEBUG=no -]) -AC_MSG_RESULT([$PHP_DEBUG]) - -AC_MSG_CHECKING([if zts is enabled]) -old_CPPFLAGS=$CPPFLAGS -CPPFLAGS="-I$phpincludedir" -AC_EGREP_CPP(php_zts_is_enabled,[ -#include
-#if ZTS -php_zts_is_enabled -#endif -],[ - PHP_THREAD_SAFETY=yes -],[ - PHP_THREAD_SAFETY=no -]) -CPPFLAGS=$old_CPPFLAGS -AC_MSG_RESULT([$PHP_DEBUG]) - -dnl Support for building and testing Zend extensions -if test "$PHP_DEBUG" = "yes" && test "$PHP_THREAD_SAFETY" = "yes; then - ZEND_EXT_TYPE="zend_extension_debug_ts" -elif test "$PHP_DEBUG" = "yes"; then - ZEND_EXT_TYPE="zend_extension_debug" -elif test "$PHP_THREAD_SAFETY" = "yes; then - ZEND_EXT_TYPE="zend_extension_ts" -else - ZEND_EXT_TYPE="zend_extension" -fi -PHP_SUBST(ZEND_EXT_TYPE) - -dnl Discard optimization flags when debugging is enabled -if test "$PHP_DEBUG" = "yes"; then - PHP_DEBUG=1 - ZEND_DEBUG=yes - changequote({,}) - CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'` - CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'` - changequote([,]) - dnl add -O0 only if GCC or ICC is used - if test "$GCC" = "yes" || test "$ICC" = "yes"; then - CFLAGS="$CFLAGS -O0" - CXXFLAGS="$CXXFLAGS -O0" - fi -else - PHP_DEBUG=0 - ZEND_DEBUG=no -fi - -dnl Always shared -PHP_BUILD_SHARED - -dnl Required programs -PHP_PROG_RE2C -PHP_PROG_AWK - -sinclude(config.m4) - -enable_static=no -enable_shared=yes - -dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX). -dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler. -AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [ - undefine([AC_PROG_CXX]) - AC_DEFUN([AC_PROG_CXX], []) - undefine([AC_PROG_CXXCPP]) - AC_DEFUN([AC_PROG_CXXCPP], [php_prog_cxxcpp=disabled]) -]) -AC_PROG_LIBTOOL - -all_targets='$(PHP_MODULES) $(PHP_ZEND_EX)' -install_targets="install-modules install-headers" -phplibdir="`pwd`/modules" -CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H" -CFLAGS_CLEAN='$(CFLAGS)' -CXXFLAGS_CLEAN='$(CXXFLAGS)' - -test "$prefix" = "NONE" && prefix="/usr/local" -test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' - -PHP_SUBST(PHP_MODULES) -PHP_SUBST(PHP_ZEND_EX) - -PHP_SUBST(all_targets) -PHP_SUBST(install_targets) - -PHP_SUBST(prefix) -PHP_SUBST(exec_prefix) -PHP_SUBST(libdir) -PHP_SUBST(prefix) -PHP_SUBST(phplibdir) -PHP_SUBST(phpincludedir) - -PHP_SUBST(CC) -PHP_SUBST(CFLAGS) -PHP_SUBST(CFLAGS_CLEAN) -PHP_SUBST(CPP) -PHP_SUBST(CPPFLAGS) -PHP_SUBST(CXX) -PHP_SUBST(CXXFLAGS) -PHP_SUBST(CXXFLAGS_CLEAN) -PHP_SUBST(EXTENSION_DIR) -PHP_SUBST(PHP_EXECUTABLE) -PHP_SUBST(EXTRA_LDFLAGS) -PHP_SUBST(EXTRA_LIBS) -PHP_SUBST(INCLUDES) -PHP_SUBST(LFLAGS) -PHP_SUBST(LDFLAGS) -PHP_SUBST(SHARED_LIBTOOL) -PHP_SUBST(LIBTOOL) -PHP_SUBST(SHELL) -PHP_SUBST(INSTALL_HEADERS) - -PHP_GEN_BUILD_DIRS -PHP_GEN_GLOBAL_MAKEFILE - -test -d modules || $php_shtool mkdir modules -touch .deps - -AC_CONFIG_HEADER(config.h) - -AC_OUTPUT() diff --git a/tests/basic/001.phpt b/tests/basic/001.phpt deleted file mode 100644 index d0cc1ca082a8a..0000000000000 --- a/tests/basic/001.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Trivial "Hello World" test ---FILE-- - ---EXPECT-- -Hello World diff --git a/tests/basic/002.phpt b/tests/basic/002.phpt deleted file mode 100644 index e9330c8bf946f..0000000000000 --- a/tests/basic/002.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Simple POST Method test ---SKIPIF-- - ---POST-- -a=Hello+World ---FILE-- - ---EXPECT-- -Hello World diff --git a/tests/basic/003.phpt b/tests/basic/003.phpt deleted file mode 100644 index ae6603f448a61..0000000000000 --- a/tests/basic/003.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -GET and POST Method combined ---SKIPIF-- - ---POST-- -a=Hello+World ---GET-- -b=Hello+Again+World&c=Hi+Mom ---FILE-- - ---EXPECT-- -post-a=(Hello World) get-b=(Hello Again World) get-c=(Hi Mom) diff --git a/tests/basic/004.phpt b/tests/basic/004.phpt deleted file mode 100644 index 86bf431860e3e..0000000000000 --- a/tests/basic/004.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Two variables in POST data ---SKIPIF-- - ---POST-- -a=Hello+World&b=Hello+Again+World ---FILE-- - ---EXPECT-- -Hello World Hello Again World diff --git a/tests/basic/005.phpt b/tests/basic/005.phpt deleted file mode 100644 index aa1d199825588..0000000000000 --- a/tests/basic/005.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Three variables in POST data ---SKIPIF-- - ---POST-- -a=Hello+World&b=Hello+Again+World&c=1 ---FILE-- - ---EXPECT-- -Hello World Hello Again World 1 diff --git a/tests/basic/006.phpt b/tests/basic/006.phpt deleted file mode 100644 index c614cd9619793..0000000000000 --- a/tests/basic/006.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Add 3 variables together and print result ---FILE-- - ---EXPECT-- -6 diff --git a/tests/basic/007.phpt b/tests/basic/007.phpt deleted file mode 100644 index dc808b73b67ff..0000000000000 --- a/tests/basic/007.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Multiply 3 variables and print result ---FILE-- - ---EXPECT-- -64 diff --git a/tests/basic/008.phpt b/tests/basic/008.phpt deleted file mode 100644 index 511aef0df4307..0000000000000 --- a/tests/basic/008.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Divide 3 variables and print result ---FILE-- - ---EXPECT-- -3 diff --git a/tests/basic/009.phpt b/tests/basic/009.phpt deleted file mode 100644 index fefe529af1e85..0000000000000 --- a/tests/basic/009.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Subtract 3 variables and print result ---FILE-- - ---EXPECT-- -10 diff --git a/tests/basic/010.phpt b/tests/basic/010.phpt deleted file mode 100644 index 9cdfece9e1c8e..0000000000000 --- a/tests/basic/010.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Testing | and & operators ---FILE-- - ---EXPECT-- -8 diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt deleted file mode 100644 index 34eed7915a0b0..0000000000000 --- a/tests/basic/011.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Testing $argc and $argv handling (GET) ---SKIPIF-- - ---INI-- -register_argc_argv=1 ---GET-- -ab+cd+ef+123+test ---FILE-- - ---EXPECT-- -0: ab -1: cd -2: ef -3: 123 -4: test diff --git a/tests/basic/012.phpt b/tests/basic/012.phpt deleted file mode 100644 index 32978532862e9..0000000000000 --- a/tests/basic/012.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Testing $argc and $argv handling (cli) ---SKIPIF-- - ---INI-- -register_argc_argv=1 -variables_order=GPS ---ARGS-- -ab cd ef 123 test ---FILE-- - ---EXPECT-- -0: ab -1: cd -2: ef -3: 123 -4: test diff --git a/tests/basic/013.phpt b/tests/basic/013.phpt deleted file mode 100644 index a4155dcf64b87..0000000000000 --- a/tests/basic/013.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -POST Method test and arrays ---SKIPIF-- - ---POST-- -a[]=1 ---FILE-- - ---EXPECT-- -array(1) { - [0]=> - string(1) "1" -} diff --git a/tests/basic/014.phpt b/tests/basic/014.phpt deleted file mode 100644 index 9b7e59f987db4..0000000000000 --- a/tests/basic/014.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -POST Method test and arrays - 2 ---SKIPIF-- - ---POST-- -a[]=1&a[]=1 ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - string(1) "1" - [1]=> - string(1) "1" -} diff --git a/tests/basic/015.phpt b/tests/basic/015.phpt deleted file mode 100644 index b297265bbc7f7..0000000000000 --- a/tests/basic/015.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -POST Method test and arrays - 3 ---SKIPIF-- - ---POST-- -a[]=1&a[0]=5 ---FILE-- - ---EXPECT-- -array(1) { - [0]=> - string(1) "5" -} diff --git a/tests/basic/016.phpt b/tests/basic/016.phpt deleted file mode 100644 index 2772531689ded..0000000000000 --- a/tests/basic/016.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -POST Method test and arrays - 4 ---SKIPIF-- - ---POST-- -a[a]=1&a[b]=3 ---FILE-- - ---EXPECT-- -array(2) { - ["a"]=> - string(1) "1" - ["b"]=> - string(1) "3" -} diff --git a/tests/basic/017.phpt b/tests/basic/017.phpt deleted file mode 100644 index 69424caa6c0a5..0000000000000 --- a/tests/basic/017.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -POST Method test and arrays - 5 ---SKIPIF-- - ---POST-- -a[]=1&a[a]=1&a[b]=3 ---FILE-- - ---EXPECT-- -array(3) { - [0]=> - string(1) "1" - ["a"]=> - string(1) "1" - ["b"]=> - string(1) "3" -} diff --git a/tests/basic/018.phpt b/tests/basic/018.phpt deleted file mode 100644 index 5cae5e8a673ab..0000000000000 --- a/tests/basic/018.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -POST Method test and arrays - 6 ---SKIPIF-- - ---POST-- -a[][]=1&a[][]=3&b[a][b][c]=1&b[a][b][d]=1 ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - array(1) { - [0]=> - string(1) "1" - } - [1]=> - array(1) { - [0]=> - string(1) "3" - } -} -array(1) { - ["a"]=> - array(1) { - ["b"]=> - array(2) { - ["c"]=> - string(1) "1" - ["d"]=> - string(1) "1" - } - } -} diff --git a/tests/basic/019.phpt b/tests/basic/019.phpt deleted file mode 100644 index 467d4e6bf2271..0000000000000 --- a/tests/basic/019.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -POST Method test and arrays - 7 ---SKIPIF-- - ---POST-- -a[]=1&a[]]=3&a[[]=4 ---FILE-- - ---EXPECT-- -array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "3" - ["["]=> - string(1) "4" -} diff --git a/tests/basic/020.phpt b/tests/basic/020.phpt deleted file mode 100644 index 0d4704e7f96e0..0000000000000 --- a/tests/basic/020.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -POST Method test and arrays - 8 ---SKIPIF-- - ---POST-- -a[a[]]=1&a[b[]]=3 ---FILE-- - ---EXPECT-- -array(2) { - ["a["]=> - string(1) "1" - ["b["]=> - string(1) "3" -} diff --git a/tests/basic/021.phpt b/tests/basic/021.phpt deleted file mode 100644 index 3010a1b625661..0000000000000 --- a/tests/basic/021.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Bug #37276 (problems witch $_POST array) ---INI-- -file_upload=1 ---SKIPIF-- - ---POST_RAW-- -Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="submitter" - -testname ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="pics"; filename="bug37276.txt" -Content-Type: text/plain - -bug37276 - ------------------------------20896060251896012921717172737-- ---FILE-- - ---EXPECTF-- -array(1) { - ["pics"]=> - array(5) { - ["name"]=> - string(12) "bug37276.txt" - ["type"]=> - string(10) "text/plain" - ["tmp_name"]=> - string(%d) "%s" - ["error"]=> - int(0) - ["size"]=> - int(9) - } -} -array(1) { - ["submitter"]=> - string(8) "testname" -} diff --git a/tests/basic/022.phpt b/tests/basic/022.phpt deleted file mode 100644 index 61718f21665c3..0000000000000 --- a/tests/basic/022.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Cookies test#1 ---COOKIE-- -cookie1=val1 ; cookie2=val2%20; cookie3=val 3.; cookie 4= value 4 %3B; cookie1=bogus; %20cookie1=ignore;+cookie1=ignore;cookie1;cookie 5=%20 value; cookie%206=þæö;cookie+7=;$cookie.8;cookie-9=1;;;- & % $cookie 10=10 ---FILE-- - ---EXPECT-- -array(10) { - ["cookie1"]=> - string(6) "val1 " - ["cookie2"]=> - string(5) "val2 " - ["cookie3"]=> - string(6) "val 3." - ["cookie_4"]=> - string(10) " value 4 ;" - ["cookie__5"]=> - string(7) " value" - ["cookie_6"]=> - string(3) "þæö" - ["cookie_7"]=> - string(0) "" - ["$cookie_8"]=> - string(0) "" - ["cookie-9"]=> - string(1) "1" - ["-_&_%_$cookie_10"]=> - string(2) "10" -} diff --git a/tests/basic/023.phpt b/tests/basic/023.phpt deleted file mode 100644 index 4eb698fa05b70..0000000000000 --- a/tests/basic/023.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Cookies test#2 ---INI-- -magic_quotes_gpc=0 ---COOKIE-- -c o o k i e=value; c o o k i e= v a l u e ;;c%20o+o k+i%20e=v;name="value","value",UEhQIQ==;UEhQIQ==foo ---FILE-- - ---EXPECT-- -array(3) { - ["c_o_o_k_i_e"]=> - string(5) "value" - ["name"]=> - string(24) ""value","value",UEhQIQ==" - ["UEhQIQ"]=> - string(4) "=foo" -} diff --git a/tests/basic/024.phpt b/tests/basic/024.phpt deleted file mode 100644 index c3336c7ce8fa2..0000000000000 --- a/tests/basic/024.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test HTTP_RAW_POST_DATA creation ---INI-- -magic_quotes_gpc=0 -always_populate_raw_post_data=1 ---SKIPIF-- - ---POST-- -a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3 ---FILE-- - ---EXPECT-- -array(3) { - ["a"]=> - string(3) "ABC" - ["y"]=> - string(3) "XYZ" - ["c"]=> - array(3) { - [0]=> - string(1) "1" - [1]=> - string(1) "2" - ["a"]=> - string(1) "3" - } -} -string(30) "a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3" diff --git a/tests/basic/025.phpt b/tests/basic/025.phpt deleted file mode 100644 index fea9468b41687..0000000000000 --- a/tests/basic/025.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Test HTTP_RAW_POST_DATA with excessive post length ---INI-- -magic_quotes_gpc=0 -always_populate_raw_post_data=1 -post_max_size=1K ---SKIPIF-- - ---POST-- -a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ---FILE-- - ---EXPECTF-- -Warning: Unknown: POST Content-Length of 2050 bytes exceeds the limit of 1024 bytes in Unknown on line 0 - -Warning: Cannot modify header information - headers already sent in Unknown on line 0 - -Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d -array(0) { -} -NULL diff --git a/tests/basic/026.phpt b/tests/basic/026.phpt deleted file mode 100644 index ec93ae5d4c263..0000000000000 --- a/tests/basic/026.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Registration of HTTP_RAW_POST_DATA due to unknown content-type ---INI-- -magic_quotes_gpc=0 -always_populate_raw_post_data=0 ---SKIPIF-- - ---POST_RAW-- -Content-Type: unknown/type -a=1&b=ZYX ---FILE-- - ---EXPECT-- -array(0) { -} -string(9) "a=1&b=ZYX" diff --git a/tests/basic/027.phpt b/tests/basic/027.phpt deleted file mode 100644 index 248507b298b6a..0000000000000 --- a/tests/basic/027.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Handling of max_input_nesting_level being reached ---INI-- -magic_quotes_gpc=0 -always_populate_raw_post_data=0 -display_errors=0 -max_input_nesting_level=10 -track_errors=1 -log_errors=0 ---SKIPIF-- - ---POST-- -a=1&b=ZYX&c[][][][][][][][][][][][][][][][][][][][][][]=123&d=123&e[][]][]=3 ---FILE-- - ---EXPECT-- -array(4) { - ["a"]=> - string(1) "1" - ["b"]=> - string(3) "ZYX" - ["d"]=> - string(3) "123" - ["e"]=> - array(1) { - [0]=> - array(1) { - [0]=> - string(1) "3" - } - } -} -string(115) "Unknown: Input variable nesting level exceeded 10. To increase the limit change max_input_nesting_level in php.ini." diff --git a/tests/basic/bug20539.phpt b/tests/basic/bug20539.phpt deleted file mode 100644 index 813e129c435bc..0000000000000 --- a/tests/basic/bug20539.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #20539 (PHP CLI Segmentation Fault) ---SKIPIF-- - ---INI-- -session.auto_start=1 -session.save_handler=files -session.save_path=./tests/basic/ ---FILE-- - ---EXPECT-- -good :) diff --git a/tests/basic/bug29971.phpt b/tests/basic/bug29971.phpt deleted file mode 100755 index d4b654bdb1c48..0000000000000 --- a/tests/basic/bug29971.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #29971 (variables_order behaviour) ---INI-- -variables_order=GPC ---FILE-- - ---EXPECT-- -array(0) { -} -array(0) { -} -string(3) "GPC" diff --git a/tests/basic/bug46313-win.phpt b/tests/basic/bug46313-win.phpt deleted file mode 100644 index 276efe196f72c..0000000000000 --- a/tests/basic/bug46313-win.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Bug #46313 (Magic quotes broke $_FILES) ---SKIPIF-- - ---INI-- -magic_quotes_gpc=1 -file_uploads=1 -register_globals=1 ---POST_RAW-- -Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="o1'file"; filename="o1'file.png" -Content-Type: text/plain-file1 - -1 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="o2'file"; filename="o2'file2.txt" -Content-Type: text/plain-file2 - -2 ------------------------------20896060251896012921717172737-- ---FILE-- - ---EXPECTF-- -array(2) { - ["o1\'file"]=> - array(5) { - ["name"]=> - string(12) "o1" - ["type"]=> - string(16) "text/plain-file1" - ["tmp_name"]=> - string(14) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } - ["o2\'file"]=> - array(5) { - ["name"]=> - string(13) "o2" - ["type"]=> - string(16) "text/plain-file2" - ["tmp_name"]=> - string(14) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } -} -string(12) "o1" -bool(true) -string(%d) "%s" -bool(true) diff --git a/tests/basic/bug46313.phpt b/tests/basic/bug46313.phpt deleted file mode 100644 index 275b267962d71..0000000000000 --- a/tests/basic/bug46313.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -Bug #46313 (Magic quotes broke $_FILES) ---SKIPIF-- - ---INI-- -magic_quotes_gpc=1 -file_uploads=1 -register_globals=1 ---POST_RAW-- -Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="o1'file"; filename="o1'file.png" -Content-Type: text/plain-file1 - -1 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="o2'file"; filename="o2'file2.txt" -Content-Type: text/plain-file2 - -2 ------------------------------20896060251896012921717172737-- ---FILE-- - ---EXPECTF-- -array(2) { - ["o1\'file"]=> - array(5) { - ["name"]=> - string(12) "o1\'file.png" - ["type"]=> - string(16) "text/plain-file1" - ["tmp_name"]=> - string(%d) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } - ["o2\'file"]=> - array(5) { - ["name"]=> - string(13) "o2\'file2.txt" - ["type"]=> - string(16) "text/plain-file2" - ["tmp_name"]=> - string(%d) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } -} -string(12) "o1\'file.png" -bool(true) -string(%d) "%s" -bool(true) diff --git a/tests/basic/bug46759.phpt b/tests/basic/bug46759.phpt deleted file mode 100644 index fdbd595546c0f..0000000000000 --- a/tests/basic/bug46759.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Testing magic_quotes_gpc ---SKIPIF-- - ---INI-- -magic_quotes_gpc=1 ---GET-- -a='&b="&c=\" ---FILE-- - $value) -{ - echo $key . ": " . $value . "\n"; -} - -?> ---EXPECT-- -a: \' -b: \" -c: \\\" diff --git a/tests/bin-info.inc b/tests/bin-info.inc deleted file mode 100644 index ad42ea897a8ab..0000000000000 --- a/tests/bin-info.inc +++ /dev/null @@ -1,21 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/__call_001.phpt b/tests/classes/__call_001.phpt deleted file mode 100644 index f9708e04f1cc7..0000000000000 --- a/tests/classes/__call_001.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -ZE2 __call() ---SKIPIF-- - ---FILE-- -x; - } -} - -$foo = new Caller(); -$a = $foo->test(1, '2', 3.4, true); -var_dump($a); - -?> ---EXPECT-- -Method test called: -array(4) { - [0]=> - int(1) - [1]=> - string(1) "2" - [2]=> - float(3.4) - [3]=> - bool(true) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} diff --git a/tests/classes/__call_002.phpt b/tests/classes/__call_002.phpt deleted file mode 100755 index 53a179f787787..0000000000000 --- a/tests/classes/__call_002.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 __call() signature check ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Method Test::__call() must take exactly 2 arguments in %s__call_002.php on line %d diff --git a/tests/classes/__call_003.phpt b/tests/classes/__call_003.phpt deleted file mode 100644 index c7aa95cb04301..0000000000000 --- a/tests/classes/__call_003.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Force pass-by-reference to __call ---FILE-- -f($a); - $c->f($b); - - var_dump($a, $b); -?> ---EXPECTF-- -array(1) { - [0]=> - string(8) "original" -} -array(1) { - [0]=> - &string(7) "changed" -} - diff --git a/tests/classes/__call_004.phpt b/tests/classes/__call_004.phpt deleted file mode 100644 index 2072112a02ff7..0000000000000 --- a/tests/classes/__call_004.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -When __call() is invoked via ::, ensure current scope's __call() is favoured over the specified class's __call(). ---FILE-- -test(); -?> ---EXPECTF-- -In B::__call(test1, array(1,a)) -object(B)#1 (0) { -} -In B::__call(test2, array(1,a)) -object(B)#1 (0) { -} -In B::__call(test3, array(1,a)) -object(B)#1 (0) { -} -In B::__call(test4, array(1,a)) -object(B)#1 (0) { -} \ No newline at end of file diff --git a/tests/classes/__call_005.phpt b/tests/classes/__call_005.phpt deleted file mode 100644 index c82a853f72683..0000000000000 --- a/tests/classes/__call_005.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -When __call() is invoked via ::, ensure private implementation of __call() in superclass is accessed without error. ---FILE-- -test(); -?> ---EXPECTF-- -In A::__call(test1, array(1,a)) -object(B)#1 (0) { -} -In A::__call(test2, array(1,a)) -object(B)#1 (0) { -} -In A::__call(test3, array(1,a)) -object(B)#1 (0) { -} -In A::__call(test4, array(1,a)) -object(B)#1 (0) { -} \ No newline at end of file diff --git a/tests/classes/__call_006.phpt b/tests/classes/__call_006.phpt deleted file mode 100644 index a65fafb8234e7..0000000000000 --- a/tests/classes/__call_006.phpt +++ /dev/null @@ -1,77 +0,0 @@ ---TEST-- -Ensure exceptions are handled properly when thrown in __call. ---FILE-- - Invoke __call via simple method call.\n"; -try { - $a->unknown(); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} - -echo "\n\n---> Invoke __call via scope resolution operator within instance.\n"; -try { - $a->test(); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} - -echo "\n\n---> Invoke __call via scope resolution operator within child instance.\n"; -$b = new B(); -try { - $b->test(); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} - -echo "\n\n---> Invoke __call via callback.\n"; -try { - call_user_func(array($b, 'unknownCallback'), 1,2,3); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} -?> -==DONE== ---EXPECTF-- ----> Invoke __call via simple method call. -object(A)#%d (0) { -} -Exception caught OK; continuing. - - ----> Invoke __call via scope resolution operator within instance. -object(A)#%d (0) { -} -Exception caught OK; continuing. - - ----> Invoke __call via scope resolution operator within child instance. -object(B)#%d (0) { -} -Exception caught OK; continuing. - - ----> Invoke __call via callback. -object(B)#%d (0) { -} -Exception caught OK; continuing. -==DONE== \ No newline at end of file diff --git a/tests/classes/__call_007.phpt b/tests/classes/__call_007.phpt deleted file mode 100644 index 12e4df1c0397d..0000000000000 --- a/tests/classes/__call_007.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -Ensure exceptions are handled properly when thrown in a statically declared __call. ---FILE-- - Invoke __call via simple method call.\n"; -try { - $a->unknown(); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} - -echo "\n\n---> Invoke __call via scope resolution operator within instance.\n"; -try { - $a->test(); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} - -echo "\n\n---> Invoke __call via scope resolution operator within child instance.\n"; -$b = new B(); -try { - $b->test(); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} - -echo "\n\n---> Invoke __call via callback.\n"; -try { - call_user_func(array($b, 'unknownCallback'), 1,2,3); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} -?> -==DONE== ---EXPECTF-- ----> Invoke __call via simple method call. -NULL -Exception caught OK; continuing. - - ----> Invoke __call via scope resolution operator within instance. -NULL -Exception caught OK; continuing. - - ----> Invoke __call via scope resolution operator within child instance. -NULL -Exception caught OK; continuing. - - ----> Invoke __call via callback. -NULL -Exception caught OK; continuing. -==DONE== \ No newline at end of file diff --git a/tests/classes/__set__get_001.phpt b/tests/classes/__set__get_001.phpt deleted file mode 100644 index beb688c2229a4..0000000000000 --- a/tests/classes/__set__get_001.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -ZE2 __set() and __get() ---SKIPIF-- - ---FILE-- - 1, 'b' => 2, 'c' => 3); - - function __get($nm) { - echo "Getting [$nm]\n"; - - if (isset($this->x[$nm])) { - $r = $this->x[$nm]; - echo "Returning: $r\n"; - return $r; - } - else { - echo "Nothing!\n"; - } - } - - function __set($nm, $val) { - echo "Setting [$nm] to $val\n"; - - if (isset($this->x[$nm])) { - $this->x[$nm] = $val; - echo "OK!\n"; - } - else { - echo "Not OK!\n"; - } - } -} - -$foo = new Setter(); - -// this doesn't go through __set()... should it? -$foo->n = 1; - -// the rest are fine... -$foo->a = 100; -$foo->a++; -$foo->z++; -var_dump($foo); - -?> ---EXPECTF-- -Setting [a] to 100 -OK! -Getting [a] -Returning: 100 -Setting [a] to 101 -OK! -Getting [z] -Nothing! -Setting [z] to 1 -Not OK! -object(setter)#%d (2) { - ["n"]=> - int(1) - ["x"]=> - array(3) { - ["a"]=> - int(101) - ["b"]=> - int(2) - ["c"]=> - int(3) - } -} diff --git a/tests/classes/__set__get_002.phpt b/tests/classes/__set__get_002.phpt deleted file mode 100755 index 71111ccdf810a..0000000000000 --- a/tests/classes/__set__get_002.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -ZE2 __get() signature check ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Method Test::__get() must take exactly 1 argument in %s__set__get_002.php on line %d diff --git a/tests/classes/__set__get_003.phpt b/tests/classes/__set__get_003.phpt deleted file mode 100755 index 390d3033627cf..0000000000000 --- a/tests/classes/__set__get_003.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -ZE2 __set() signature check ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Method Test::__set() must take exactly 2 arguments in %s__set__get_003.php on line %d diff --git a/tests/classes/__set__get_004.phpt b/tests/classes/__set__get_004.phpt deleted file mode 100755 index e3061da4f06b1..0000000000000 --- a/tests/classes/__set__get_004.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -ZE2 __set() and __get() ---SKIPIF-- - ---FILE-- -x[$name])) { - return $this->x[$name]; - } - else - { - return NULL; - } - } - - function __set($name, $val) { - $this->x[$name] = $val; - } -} - -$foo = new Test(); -$bar = new Test(); -$bar->baz = "Check"; - -$foo->bar = $bar; - -var_dump($bar->baz); -var_dump($foo->bar->baz); - -?> -===DONE=== ---EXPECTF-- -string(5) "Check" -string(5) "Check" -===DONE=== diff --git a/tests/classes/__set__get_005.phpt b/tests/classes/__set__get_005.phpt deleted file mode 100755 index 1a55334060a8c..0000000000000 --- a/tests/classes/__set__get_005.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -ZE2 __set() and __get() ---SKIPIF-- - ---FILE-- -x[$name])) { - return $this->x[$name]; - } - else - { - return NULL; - } - } - - function __set($name, $val) { - echo __METHOD__ . "\n"; - $this->x[$name] = $val; - } -} - -class AutoGen -{ - protected $x; - - function __get($name) { - echo __METHOD__ . "\n"; - if (!isset($this->x[$name])) { - $this->x[$name] = new Test(); - } - return $this->x[$name]; - } - - function __set($name, $val) { - echo __METHOD__ . "\n"; - $this->x[$name] = $val; - } -} - -$foo = new AutoGen(); -$foo->bar->baz = "Check"; - -var_dump($foo->bar); -var_dump($foo->bar->baz); - -?> -===DONE=== ---EXPECTF-- -AutoGen::__get -Test::__set -AutoGen::__get -object(Test)#%d (1) { - ["x:protected"]=> - array(1) { - ["baz"]=> - string(5) "Check" - } -} -AutoGen::__get -Test::__get -string(5) "Check" -===DONE=== diff --git a/tests/classes/__set_data_corrupt.phpt b/tests/classes/__set_data_corrupt.phpt deleted file mode 100644 index 6a52bd489be86..0000000000000 --- a/tests/classes/__set_data_corrupt.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -ZE2 Data corruption in __set ---SKIPIF-- - ---FILE-- -null); - - function bar() { - echo $this->t ='f'; - } - function __get($prop) - { - return $this->pp[$prop]; - } - function __set($prop, $val) - { - echo "__set"; - $this->pp[$prop] = ''; - } -} -$f = new foo; -$f->bar(); -?> ---EXPECT-- -__setf diff --git a/tests/classes/abstract.phpt b/tests/classes/abstract.phpt deleted file mode 100644 index fbebf4da73898..0000000000000 --- a/tests/classes/abstract.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -ZE2 An abstract method may not be called ---SKIPIF-- - ---FILE-- -show(); -$t->error(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call to function show() - -Fatal error: Cannot call abstract method fail::show() in %s on line %d diff --git a/tests/classes/abstract_by_interface_001.phpt b/tests/classes/abstract_by_interface_001.phpt deleted file mode 100755 index 7565fdf45f4aa..0000000000000 --- a/tests/classes/abstract_by_interface_001.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 An abstract method may not be called ---FILE-- - -===DONE=== ---EXPECTF-- -object(Leaf)#%d (0) { -} - -Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_001.php on line %d diff --git a/tests/classes/abstract_by_interface_002.phpt b/tests/classes/abstract_by_interface_002.phpt deleted file mode 100755 index 77c5619dfe226..0000000000000 --- a/tests/classes/abstract_by_interface_002.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 An abstract method may not be called ---FILE-- - -===DONE=== ---EXPECTF-- -object(Leaf)#%d (0) { -} - -Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_002.php on line %d diff --git a/tests/classes/abstract_class.phpt b/tests/classes/abstract_class.phpt deleted file mode 100644 index 571a9b95814fc..0000000000000 --- a/tests/classes/abstract_class.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -ZE2 An abstract class cannot be instantiated ---SKIPIF-- - ---FILE-- -show(); - -$t = new fail(); -$t->show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call to function show() - -Fatal error: Cannot instantiate abstract class fail in %s on line %d diff --git a/tests/classes/abstract_derived.phpt b/tests/classes/abstract_derived.phpt deleted file mode 100644 index 0feceac6bb283..0000000000000 --- a/tests/classes/abstract_derived.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -ZE2 A derived class with an abstract method must be abstract ---SKIPIF-- - ---FILE-- - -===DONE=== - ---EXPECTF-- - -Fatal error: Class derived contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (derived::show) in %sabstract_derived.php on line %d diff --git a/tests/classes/abstract_final.phpt b/tests/classes/abstract_final.phpt deleted file mode 100644 index 20c7ae375f6a8..0000000000000 --- a/tests/classes/abstract_final.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -ZE2 A final method cannot be abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d diff --git a/tests/classes/abstract_inherit.phpt b/tests/classes/abstract_inherit.phpt deleted file mode 100644 index 362ccb0b766d9..0000000000000 --- a/tests/classes/abstract_inherit.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -ZE2 A class that inherits an abstract method is abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot instantiate abstract class fail in %s on line %d diff --git a/tests/classes/abstract_not_declared.phpt b/tests/classes/abstract_not_declared.phpt deleted file mode 100644 index 3b81cd4980a3b..0000000000000 --- a/tests/classes/abstract_not_declared.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 An abstract class must be declared abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::show) in %s on line %d diff --git a/tests/classes/abstract_redeclare.phpt b/tests/classes/abstract_redeclare.phpt deleted file mode 100644 index 9a0a1edc3c23a..0000000000000 --- a/tests/classes/abstract_redeclare.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -ZE2 A method cannot be redeclared abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::show) in %sabstract_redeclare.php on line %d diff --git a/tests/classes/abstract_static.phpt b/tests/classes/abstract_static.phpt deleted file mode 100644 index bcebec599f05e..0000000000000 --- a/tests/classes/abstract_static.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -ZE2 A static abstract methods ---FILE-- - ---EXPECTF-- -Call to function show() - -Strict Standards: Static function fail::func() should not be abstract in %sabstract_static.php(%d) : eval()'d code on line %d - -Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::func) in %sabstract_static.php(%d) : eval()'d code on line %d diff --git a/tests/classes/abstract_user_call.phpt b/tests/classes/abstract_user_call.phpt deleted file mode 100755 index 0e1ddbe7961c7..0000000000000 --- a/tests/classes/abstract_user_call.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -ZE2 An abstrcat method cannot be called indirectly ---FILE-- -func(); - -call_user_func(array($o, 'test_base::func')); - -?> -===DONE=== ---EXPECTF-- -test::func() - -Fatal error: Cannot call abstract method test_base::func() in %s on line %d diff --git a/tests/classes/array_access_001.phpt b/tests/classes/array_access_001.phpt deleted file mode 100644 index 82f96d5239f10..0000000000000 --- a/tests/classes/array_access_001.phpt +++ /dev/null @@ -1,198 +0,0 @@ ---TEST-- -ZE2 ArrayAccess ---FILE-- -'3rd', '4th'=>4); - - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - return $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } -} - -$obj = new Object; - -var_dump($obj->a); - -echo "===EMPTY===\n"; -var_dump(empty($obj[0])); -var_dump(empty($obj[1])); -var_dump(empty($obj[2])); -var_dump(empty($obj['4th'])); -var_dump(empty($obj['5th'])); -var_dump(empty($obj[6])); - -echo "===isset===\n"; -var_dump(isset($obj[0])); -var_dump(isset($obj[1])); -var_dump(isset($obj[2])); -var_dump(isset($obj['4th'])); -var_dump(isset($obj['5th'])); -var_dump(isset($obj[6])); - -echo "===offsetGet===\n"; -var_dump($obj[0]); -var_dump($obj[1]); -var_dump($obj[2]); -var_dump($obj['4th']); -var_dump($obj['5th']); -var_dump($obj[6]); - -echo "===offsetSet===\n"; -echo "WRITE 1\n"; -$obj[1] = 'Changed 1'; -var_dump($obj[1]); -echo "WRITE 2\n"; -$obj['4th'] = 'Changed 4th'; -var_dump($obj['4th']); -echo "WRITE 3\n"; -$obj['5th'] = 'Added 5th'; -var_dump($obj['5th']); -echo "WRITE 4\n"; -$obj[6] = 'Added 6'; -var_dump($obj[6]); - -var_dump($obj[0]); -var_dump($obj[2]); - -$x = $obj[6] = 'changed 6'; -var_dump($obj[6]); -var_dump($x); - -echo "===unset===\n"; -var_dump($obj->a); -unset($obj[2]); -unset($obj['4th']); -unset($obj[7]); -unset($obj['8th']); -var_dump($obj->a); - -?> -===DONE=== ---EXPECTF-- -array(4) { - [0]=> - string(3) "1st" - [1]=> - int(1) - [2]=> - string(3) "3rd" - ["4th"]=> - int(4) -} -===EMPTY=== -object::offsetExists(0) -object::offsetGet(0) -bool(false) -object::offsetExists(1) -object::offsetGet(1) -bool(false) -object::offsetExists(2) -object::offsetGet(2) -bool(false) -object::offsetExists(4th) -object::offsetGet(4th) -bool(false) -object::offsetExists(5th) -bool(true) -object::offsetExists(6) -bool(true) -===isset=== -object::offsetExists(0) -bool(true) -object::offsetExists(1) -bool(true) -object::offsetExists(2) -bool(true) -object::offsetExists(4th) -bool(true) -object::offsetExists(5th) -bool(false) -object::offsetExists(6) -bool(false) -===offsetGet=== -object::offsetGet(0) -string(3) "1st" -object::offsetGet(1) -int(1) -object::offsetGet(2) -string(3) "3rd" -object::offsetGet(4th) -int(4) -object::offsetGet(5th) - -Notice: Undefined index: 5th in %sarray_access_001.php on line %d -NULL -object::offsetGet(6) - -Notice: Undefined offset: 6 in %sarray_access_001.php on line %d -NULL -===offsetSet=== -WRITE 1 -object::offsetSet(1,Changed 1) -object::offsetGet(1) -string(9) "Changed 1" -WRITE 2 -object::offsetSet(4th,Changed 4th) -object::offsetGet(4th) -string(11) "Changed 4th" -WRITE 3 -object::offsetSet(5th,Added 5th) -object::offsetGet(5th) -string(9) "Added 5th" -WRITE 4 -object::offsetSet(6,Added 6) -object::offsetGet(6) -string(7) "Added 6" -object::offsetGet(0) -string(3) "1st" -object::offsetGet(2) -string(3) "3rd" -object::offsetSet(6,changed 6) -object::offsetGet(6) -string(9) "changed 6" -string(9) "changed 6" -===unset=== -array(6) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - [2]=> - string(3) "3rd" - ["4th"]=> - string(11) "Changed 4th" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -object::offsetUnset(2) -object::offsetUnset(4th) -object::offsetUnset(7) -object::offsetUnset(8th) -array(4) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -===DONE=== diff --git a/tests/classes/array_access_002.phpt b/tests/classes/array_access_002.phpt deleted file mode 100644 index fd08eb39465a9..0000000000000 --- a/tests/classes/array_access_002.phpt +++ /dev/null @@ -1,198 +0,0 @@ ---TEST-- -ZE2 ArrayAccess::offsetSet without return ---FILE-- -'3rd', '4th'=>4); - - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - /*return*/ $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } -} - -$obj = new Object; - -var_dump($obj->a); - -echo "===EMPTY===\n"; -var_dump(empty($obj[0])); -var_dump(empty($obj[1])); -var_dump(empty($obj[2])); -var_dump(empty($obj['4th'])); -var_dump(empty($obj['5th'])); -var_dump(empty($obj[6])); - -echo "===isset===\n"; -var_dump(isset($obj[0])); -var_dump(isset($obj[1])); -var_dump(isset($obj[2])); -var_dump(isset($obj['4th'])); -var_dump(isset($obj['5th'])); -var_dump(isset($obj[6])); - -echo "===offsetGet===\n"; -var_dump($obj[0]); -var_dump($obj[1]); -var_dump($obj[2]); -var_dump($obj['4th']); -var_dump($obj['5th']); -var_dump($obj[6]); - -echo "===offsetSet===\n"; -echo "WRITE 1\n"; -$obj[1] = 'Changed 1'; -var_dump($obj[1]); -echo "WRITE 2\n"; -$obj['4th'] = 'Changed 4th'; -var_dump($obj['4th']); -echo "WRITE 3\n"; -$obj['5th'] = 'Added 5th'; -var_dump($obj['5th']); -echo "WRITE 4\n"; -$obj[6] = 'Added 6'; -var_dump($obj[6]); - -var_dump($obj[0]); -var_dump($obj[2]); - -$x = $obj[6] = 'changed 6'; -var_dump($obj[6]); -var_dump($x); - -echo "===unset===\n"; -var_dump($obj->a); -unset($obj[2]); -unset($obj['4th']); -unset($obj[7]); -unset($obj['8th']); -var_dump($obj->a); - -?> -===DONE=== ---EXPECTF-- -array(4) { - [0]=> - string(3) "1st" - [1]=> - int(1) - [2]=> - string(3) "3rd" - ["4th"]=> - int(4) -} -===EMPTY=== -object::offsetExists(0) -object::offsetGet(0) -bool(false) -object::offsetExists(1) -object::offsetGet(1) -bool(false) -object::offsetExists(2) -object::offsetGet(2) -bool(false) -object::offsetExists(4th) -object::offsetGet(4th) -bool(false) -object::offsetExists(5th) -bool(true) -object::offsetExists(6) -bool(true) -===isset=== -object::offsetExists(0) -bool(true) -object::offsetExists(1) -bool(true) -object::offsetExists(2) -bool(true) -object::offsetExists(4th) -bool(true) -object::offsetExists(5th) -bool(false) -object::offsetExists(6) -bool(false) -===offsetGet=== -object::offsetGet(0) -string(3) "1st" -object::offsetGet(1) -int(1) -object::offsetGet(2) -string(3) "3rd" -object::offsetGet(4th) -int(4) -object::offsetGet(5th) - -Notice: Undefined index: 5th in %sarray_access_002.php on line %d -NULL -object::offsetGet(6) - -Notice: Undefined offset: 6 in %sarray_access_002.php on line %d -NULL -===offsetSet=== -WRITE 1 -object::offsetSet(1,Changed 1) -object::offsetGet(1) -string(9) "Changed 1" -WRITE 2 -object::offsetSet(4th,Changed 4th) -object::offsetGet(4th) -string(11) "Changed 4th" -WRITE 3 -object::offsetSet(5th,Added 5th) -object::offsetGet(5th) -string(9) "Added 5th" -WRITE 4 -object::offsetSet(6,Added 6) -object::offsetGet(6) -string(7) "Added 6" -object::offsetGet(0) -string(3) "1st" -object::offsetGet(2) -string(3) "3rd" -object::offsetSet(6,changed 6) -object::offsetGet(6) -string(9) "changed 6" -string(9) "changed 6" -===unset=== -array(6) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - [2]=> - string(3) "3rd" - ["4th"]=> - string(11) "Changed 4th" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -object::offsetUnset(2) -object::offsetUnset(4th) -object::offsetUnset(7) -object::offsetUnset(8th) -array(4) { - [0]=> - string(3) "1st" - [1]=> - string(9) "Changed 1" - ["5th"]=> - string(9) "Added 5th" - [6]=> - string(9) "changed 6" -} -===DONE=== diff --git a/tests/classes/array_access_003.phpt b/tests/classes/array_access_003.phpt deleted file mode 100644 index 3e631125e7c25..0000000000000 --- a/tests/classes/array_access_003.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -ZE2 ArrayAccess::offsetGet ambiguties ---INI-- -error_reporting=4095 ---FILE-- -'3rd', '4th'=>4); - - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - switch($index) { - case 1: - $a = 'foo'; - return $a . 'Bar'; - case 2: - static $a=1; - return $a; - } - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - if ($index==3) { - $this->cnt = $newval; - } - return $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } -} - -$obj = new Object; - -var_dump($obj[1]); -var_dump($obj[2]); -$obj[2]++; -var_dump($obj[2]); - -?> -===DONE=== ---EXPECTF-- -object::offsetGet(1) -string(6) "fooBar" -object::offsetGet(2) -int(1) -object::offsetGet(2) - -Notice: Indirect modification of overloaded element of object has no effect in %sarray_access_003.php on line 39 -object::offsetGet(2) -int(1) -===DONE=== diff --git a/tests/classes/array_access_004.phpt b/tests/classes/array_access_004.phpt deleted file mode 100644 index 787496707c151..0000000000000 --- a/tests/classes/array_access_004.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -ZE2 ArrayAccess::offsetGet ambiguties ---FILE-- -'3rd', '4th'=>4); - - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - switch($index) { - case 1: - $a = 'foo'; - return $a . 'Bar'; - case 2: - static $a=1; - return $a; - } - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - if ($index==3) { - $this->cnt = $newval; - } - return $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } -} - -$obj = new Object; - -var_dump($obj[1]); -var_dump($obj[2]); -$obj[2]++; -var_dump($obj[2]); - -?> -===DONE=== ---EXPECTF-- -object::offsetGet(1) -string(6) "fooBar" -object::offsetGet(2) -int(1) -object::offsetGet(2) - -Notice: Indirect modification of overloaded element of object has no effect in %sarray_access_004.php on line 39 -object::offsetGet(2) -int(1) -===DONE=== diff --git a/tests/classes/array_access_005.phpt b/tests/classes/array_access_005.phpt deleted file mode 100755 index dcb873ff5683f..0000000000000 --- a/tests/classes/array_access_005.phpt +++ /dev/null @@ -1,77 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and sub Arrays ---FILE-- -person = array(array('name'=>'Joe')); - } - - function offsetExists($index) { - return array_key_exists($this->person, $index); - } - - function offsetGet($index) { - return $this->person[$index]; - } - - function offsetSet($index, $value) { - $this->person[$index] = $value; - } - - function offsetUnset($index) { - unset($this->person[$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Foo'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Bar'; -var_dump($people->person[0]['name']); - -echo "---ArrayOverloading---\n"; - -$people = new Peoples; - -var_dump($people[0]); -var_dump($people[0]['name']); -var_dump($people->person[0]['name'] . 'Foo'); // impossible to assign this since we don't return references here -$x = $people[0]; // creates a copy -$x['name'] .= 'Foo'; -$people[0] = $x; -var_dump($people[0]); -$people[0]['name'] = 'JoeFoo'; -var_dump($people[0]['name']); -$people[0]['name'] = 'JoeFooBar'; -var_dump($people[0]['name']); - -?> -===DONE=== ---EXPECTF-- -string(3) "Joe" -string(6) "JoeFoo" -string(9) "JoeFooBar" ----ArrayOverloading--- -array(1) { - ["name"]=> - string(3) "Joe" -} -string(3) "Joe" -string(6) "JoeFoo" -array(1) { - ["name"]=> - string(6) "JoeFoo" -} - -Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_005.php on line 46 -string(6) "JoeFoo" - -Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_005.php on line 48 -string(6) "JoeFoo" -===DONE=== diff --git a/tests/classes/array_access_006.phpt b/tests/classes/array_access_006.phpt deleted file mode 100644 index 342a7e5107062..0000000000000 --- a/tests/classes/array_access_006.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ASSIGN_OP operators (+=) ---FILE-- -realArray = array(1,2,3); - } - - function offsetExists($index) { - return array_key_exists($this->realArray, $index); - } - - function offsetGet($index) { - return $this->realArray[$index]; - } - - function offsetSet($index, $value) { - $this->realArray[$index] = $value; - } - - function offsetUnset($index) { - unset($this->realArray[$index]); - } -} - -$a = new OverloadedArray; -$a[1] += 10; -var_dump($a[1]); -echo "---Done---\n"; -?> ---EXPECT-- -int(12) ----Done--- diff --git a/tests/classes/array_access_007.phpt b/tests/classes/array_access_007.phpt deleted file mode 100755 index 42187fe5d5f8e..0000000000000 --- a/tests/classes/array_access_007.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and [] assignment ---FILE-- -realArray = array(); - } - - function offsetExists($index) { - return array_key_exists($this->realArray, $index); - } - - function offsetGet($index) { - return $this->realArray[$index]; - } - - function offsetSet($index, $value) { - if (is_null($index)) { - $this->realArray[] = $value; - } else { - $this->realArray[$index] = $value; - } - } - - function offsetUnset($index) { - unset($this->realArray[$index]); - } - - function dump() { - var_dump($this->realArray); - } -} - -$a = new OverloadedArray; -$a[] = 1; -$a[1] = 2; -$a[2] = 3; -$a[] = 4; -$a->dump(); -?> -===DONE=== ---EXPECT-- -array(4) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) -} -===DONE=== diff --git a/tests/classes/array_access_008.phpt b/tests/classes/array_access_008.phpt deleted file mode 100755 index 99798891743f0..0000000000000 --- a/tests/classes/array_access_008.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ASSIGN_OP operators (.=) ---FILE-- -person = array(array('name'=>'Foo')); - } - - function offsetExists($index) { - return array_key_exists($this->person, $index); - } - - function offsetGet($index) { - return $this->person[$index]; - } - - function offsetSet($index, $value) { - $this->person[$index] = $value; - } - - function offsetUnset($index) { - unset($this->person[$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Baz'; -var_dump($people->person[0]['name']); - -echo "===ArrayOverloading===\n"; - -$people = new Peoples; - -var_dump($people[0]['name']); -$people[0]['name'] = 'FooBar'; -var_dump($people[0]['name']); -$people[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people[0]['name']); -$people[0]['name'] .= 'Baz'; -var_dump($people[0]['name']); - -?> -===DONE=== ---EXPECTF-- -string(3) "Foo" -string(6) "FooBar" -string(9) "FooBarBaz" -===ArrayOverloading=== -string(3) "Foo" - -Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 40 -string(3) "Foo" - -Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 42 -string(3) "Foo" - -Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 44 -string(3) "Foo" -===DONE=== diff --git a/tests/classes/array_access_009.phpt b/tests/classes/array_access_009.phpt deleted file mode 100755 index b1382a639a11c..0000000000000 --- a/tests/classes/array_access_009.phpt +++ /dev/null @@ -1,190 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ArrayProxyAccess, ArrayProxy ---FILE-- -offsetExists($element)) - { - $object[$element] = array(); - } - $this->object = $object; - $this->element = $element; - } - - function offsetExists($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return array_key_exists($index, $this->object->proxyGet($this->element)); - } - - function offsetGet($index) { - echo __METHOD__ . "($this->element, $index)\n"; - $tmp = $this->object->proxyGet($this->element); - return isset($tmp[$index]) ? $tmp[$index] : NULL; - } - - function offsetSet($index, $value) { - echo __METHOD__ . "($this->element, $index, $value)\n"; - $this->object->proxySet($this->element, $index, $value); - } - - function offsetUnset($index) { - echo __METHOD__ . "($this->element, $index)\n"; - $this->object->proxyUnset($this->element, $index); - } -} - -class Peoples implements ArrayProxyAccess -{ - public $person; - - function __construct() - { - $this->person = array(array('name'=>'Foo')); - } - - function offsetExists($index) - { - return array_key_exists($index, $this->person); - } - - function offsetGet($index) - { - return new ArrayProxy($this, $index); - } - - function offsetSet($index, $value) - { - $this->person[$index] = $value; - } - - function offsetUnset($index) - { - unset($this->person[$index]); - } - - function proxyGet($element) - { - return $this->person[$element]; - } - - function proxySet($element, $index, $value) - { - $this->person[$element][$index] = $value; - } - - function proxyUnset($element, $index) - { - unset($this->person[$element][$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Baz'; -var_dump($people->person[0]['name']); - -echo "===ArrayOverloading===\n"; - -$people = new Peoples; - -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'FooBar'; -var_dump($people[0]['name']); -$people[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people[0]['name']); -$people[0]['name'] .= 'Baz'; -var_dump($people[0]['name']); -unset($people[0]['name']); -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'BlaBla'; -var_dump($people[0]['name']); - -?> -===DONE=== ---EXPECTF-- -string(3) "Foo" -string(6) "FooBar" -string(9) "FooBarBaz" -===ArrayOverloading=== -ArrayProxy::__construct(0) -object(ArrayProxy)#%d (2) { - ["object:private"]=> - object(Peoples)#%d (1) { - ["person"]=> - array(1) { - [0]=> - array(1) { - ["name"]=> - string(3) "Foo" - } - } - } - ["element:private"]=> - int(0) -} -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(3) "Foo" -ArrayProxy::__construct(0) -ArrayProxy::offsetSet(0, name, FooBar) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(6) "FooBar" -ArrayProxy::__construct(0) -ArrayProxy::offsetSet(0, name, FooBarBar) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(9) "FooBarBar" -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -ArrayProxy::offsetSet(0, name, FooBarBarBaz) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(12) "FooBarBarBaz" -ArrayProxy::__construct(0) -ArrayProxy::offsetUnset(0, name) -ArrayProxy::__construct(0) -object(ArrayProxy)#%d (2) { - ["object:private"]=> - object(Peoples)#%d (1) { - ["person"]=> - array(1) { - [0]=> - array(0) { - } - } - } - ["element:private"]=> - int(0) -} -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -NULL -ArrayProxy::__construct(0) -ArrayProxy::offsetSet(0, name, BlaBla) -ArrayProxy::__construct(0) -ArrayProxy::offsetGet(0, name) -string(6) "BlaBla" -===DONE=== diff --git a/tests/classes/array_access_010.phpt b/tests/classes/array_access_010.phpt deleted file mode 100755 index 9cb883d9857a9..0000000000000 --- a/tests/classes/array_access_010.phpt +++ /dev/null @@ -1,168 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ArrayReferenceProxy with references ---FILE-- -object = $object; - $this->element = &$element; - } - - function offsetExists($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return array_key_exists($index, $this->element); - } - - function offsetGet($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return isset($this->element[$index]) ? $this->element[$index] : NULL; - } - - function offsetSet($index, $value) { - echo __METHOD__ . "($this->element, $index, $value)\n"; - $this->element[$index] = $value; - } - - function offsetUnset($index) { - echo __METHOD__ . "($this->element, $index)\n"; - unset($this->element[$index]); - } -} - -class Peoples implements ArrayAccess -{ - public $person; - - function __construct() - { - $this->person = array(array('name'=>'Foo')); - } - - function offsetExists($index) - { - return array_key_exists($index, $this->person); - } - - function offsetGet($index) - { - return new ArrayReferenceProxy($this, $this->person[$index]); - } - - function offsetSet($index, $value) - { - $this->person[$index] = $value; - } - - function offsetUnset($index) - { - unset($this->person[$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Baz'; -var_dump($people->person[0]['name']); - -echo "===ArrayOverloading===\n"; - -$people = new Peoples; - -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'FooBar'; -var_dump($people[0]['name']); -$people[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people[0]['name']); -$people[0]['name'] .= 'Baz'; -var_dump($people[0]['name']); -unset($people[0]['name']); -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'BlaBla'; -var_dump($people[0]['name']); - -?> -===DONE=== - ---EXPECTF-- -string(3) "Foo" -string(6) "FooBar" -string(9) "FooBarBaz" -===ArrayOverloading=== -ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#%d (2) { - ["object:private"]=> - object(Peoples)#%d (1) { - ["person"]=> - array(1) { - [0]=> - &array(1) { - ["name"]=> - string(3) "Foo" - } - } - } - ["element:private"]=> - &array(1) { - ["name"]=> - string(3) "Foo" - } -} -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(3) "Foo" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetSet(Array, name, FooBar) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(6) "FooBar" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetSet(Array, name, FooBarBar) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(9) "FooBarBar" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -ArrayReferenceProxy::offsetSet(Array, name, FooBarBarBaz) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(12) "FooBarBarBaz" -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetUnset(Array, name) -ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#%d (2) { - ["object:private"]=> - object(Peoples)#%d (1) { - ["person"]=> - array(1) { - [0]=> - &array(0) { - } - } - } - ["element:private"]=> - &array(0) { - } -} -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -NULL -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetSet(Array, name, BlaBla) -ArrayReferenceProxy::__construct(Array) -ArrayReferenceProxy::offsetGet(Array, name) -string(6) "BlaBla" -===DONE=== diff --git a/tests/classes/array_access_011.phpt b/tests/classes/array_access_011.phpt deleted file mode 100755 index a6bb3d1cadf3b..0000000000000 --- a/tests/classes/array_access_011.phpt +++ /dev/null @@ -1,187 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and ArrayAccessReferenceProxy with references to main array ---FILE-- -object = $object; - $this->oarray = &$array; - $this->element = $element; - } - - function offsetExists($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return array_key_exists($index, $this->oarray[$this->element]); - } - - function offsetGet($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return isset($this->oarray[$this->element][$index]) ? $this->oarray[$this->element][$index] : NULL; - } - - function offsetSet($index, $value) { - echo __METHOD__ . "($this->element, $index, $value)\n"; - $this->oarray[$this->element][$index] = $value; - } - - function offsetUnset($index) { - echo __METHOD__ . "($this->element, $index)\n"; - unset($this->oarray[$this->element][$index]); - } -} - -class Peoples implements ArrayAccess -{ - public $person; - - function __construct() - { - $this->person = array(array('name'=>'Foo')); - } - - function offsetExists($index) - { - return array_key_exists($index, $this->person); - } - - function offsetGet($index) - { - if (is_array($this->person[$index])) - { - return new ArrayAccessReferenceProxy($this, $this->person, $index); - } - else - { - return $this->person[$index]; - } - } - - function offsetSet($index, $value) - { - $this->person[$index] = $value; - } - - function offsetUnset($index) - { - unset($this->person[$index]); - } -} - -$people = new Peoples; - -var_dump($people->person[0]['name']); -$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people->person[0]['name']); -$people->person[0]['name'] .= 'Baz'; -var_dump($people->person[0]['name']); - -echo "===ArrayOverloading===\n"; - -$people = new Peoples; - -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'FooBar'; -var_dump($people[0]['name']); -$people[0]['name'] = $people->person[0]['name'] . 'Bar'; -var_dump($people[0]['name']); -$people[0]['name'] .= 'Baz'; -var_dump($people[0]['name']); -unset($people[0]['name']); -var_dump($people[0]); -var_dump($people[0]['name']); -$people[0]['name'] = 'BlaBla'; -var_dump($people[0]['name']); - -?> -===DONE=== - ---EXPECTF-- -string(3) "Foo" -string(6) "FooBar" -string(9) "FooBarBaz" -===ArrayOverloading=== -ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#%d (3) { - ["object:private"]=> - object(Peoples)#%d (1) { - ["person"]=> - &array(1) { - [0]=> - array(1) { - ["name"]=> - string(3) "Foo" - } - } - } - ["oarray:private"]=> - &array(1) { - [0]=> - array(1) { - ["name"]=> - string(3) "Foo" - } - } - ["element:private"]=> - int(0) -} -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(3) "Foo" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetSet(0, name, FooBar) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(6) "FooBar" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBar) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(9) "FooBarBar" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBarBaz) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(12) "FooBarBarBaz" -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetUnset(0, name) -ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#%d (3) { - ["object:private"]=> - object(Peoples)#%d (1) { - ["person"]=> - &array(1) { - [0]=> - array(0) { - } - } - } - ["oarray:private"]=> - &array(1) { - [0]=> - array(0) { - } - } - ["element:private"]=> - int(0) -} -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -NULL -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetSet(0, name, BlaBla) -ArrayAccessReferenceProxy::__construct(0) -ArrayAccessReferenceProxy::offsetGet(0, name) -string(6) "BlaBla" -===DONE=== diff --git a/tests/classes/array_access_012.phpt b/tests/classes/array_access_012.phpt deleted file mode 100755 index 8f85f296eb9a4..0000000000000 --- a/tests/classes/array_access_012.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -ZE2 ArrayAccess cannot assign by reference ---FILE-- -data[$index] = $value; - } - - public function offsetGet($index) { - return $this->data[$index]; - } - - public function offsetExists($index) { - return isset($this->data[$index]); - } -} - -$data = new ArrayAccessImpl(); -$test = 'some data'; -$data['element'] = NULL; // prevent notice -$data['element'] = &$test; - -?> -===DONE=== - ---EXPECTF-- - -Notice: Indirect modification of overloaded element of ArrayAccessImpl has no effect in %sarray_access_012.php on line 24 - -Fatal error: Cannot assign by reference to overloaded object in %sarray_access_012.php on line 24 diff --git a/tests/classes/array_access_013.phpt b/tests/classes/array_access_013.phpt deleted file mode 100755 index 206d9d5403762..0000000000000 --- a/tests/classes/array_access_013.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -ZE2 ArrayAccess and exceptions ---FILE-- -getMessage() . "()\n"; -} - -try -{ - echo $t[0]; -} -catch(Exception $e) -{ - echo "Caught in " . $e->getMessage() . "()\n"; -} - -try -{ - $t[0] = 1; -} -catch(Exception $e) -{ - echo "Caught in " . $e->getMessage() . "()\n"; -} - -try -{ - unset($t[0]); -} -catch(Exception $e) -{ - echo "Caught in " . $e->getMessage() . "()\n"; -} -?> -===DONE=== ---EXPECT-- -Caught in Test::offsetExists() -Caught in Test::offsetGet() -Caught in Test::offsetSet() -Caught in Test::offsetUnset() -===DONE=== diff --git a/tests/classes/assign_op_property_001.phpt b/tests/classes/assign_op_property_001.phpt deleted file mode 100644 index 21e131cfa4ece..0000000000000 --- a/tests/classes/assign_op_property_001.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 assign_op property of overloaded object ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -$obj->a += 2; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(4) ----Done--- diff --git a/tests/classes/autoload_001.phpt b/tests/classes/autoload_001.phpt deleted file mode 100755 index 6f325f49bb5f3..0000000000000 --- a/tests/classes/autoload_001.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -ZE2 Autoload and class_exists ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -__autoload(autoload_root) -bool(true) -===DONE=== diff --git a/tests/classes/autoload_002.phpt b/tests/classes/autoload_002.phpt deleted file mode 100755 index 27dea0f9d4f82..0000000000000 --- a/tests/classes/autoload_002.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 Autoload and get_class_methods ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -__autoload(autoload_root) -array(1) { - [0]=> - string(12) "testFunction" -} -===DONE=== diff --git a/tests/classes/autoload_003.phpt b/tests/classes/autoload_003.phpt deleted file mode 100755 index 7bdb5da36af36..0000000000000 --- a/tests/classes/autoload_003.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -ZE2 Autoload and derived classes ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -__autoload(autoload_root) -__autoload(autoload_derived) -bool(true) -===DONE=== diff --git a/tests/classes/autoload_004.phpt b/tests/classes/autoload_004.phpt deleted file mode 100755 index 23aea5d086697..0000000000000 --- a/tests/classes/autoload_004.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -ZE2 Autoload and recursion ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -bool(false) -bool(false) -__autoload(autoload_root) -__autoload(autoload_derived) -bool(true) -===DONE=== diff --git a/tests/classes/autoload_005.phpt b/tests/classes/autoload_005.phpt deleted file mode 100755 index 36a4e18f0ba95..0000000000000 --- a/tests/classes/autoload_005.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -ZE2 Autoload from destructor ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -bool(false) -bool(false) -Test::__destruct -bool(false) -bool(false) -__autoload(autoload_root) -__autoload(autoload_derived) -object(autoload_derived)#%d (0) { -} -===DONE=== diff --git a/tests/classes/autoload_006.phpt b/tests/classes/autoload_006.phpt deleted file mode 100755 index 9af6fc98299dc..0000000000000 --- a/tests/classes/autoload_006.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -ZE2 Autoload from destructor ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -bool(false) -bool(false) -__autoload(autoload_interface) -__autoload(Autoload_Implements) -object(autoload_implements)#%d (0) { -} -bool(true) -bool(true) -bool(true) -===DONE=== diff --git a/tests/classes/autoload_007.phpt b/tests/classes/autoload_007.phpt deleted file mode 100644 index 5652c120cce5c..0000000000000 --- a/tests/classes/autoload_007.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Ensure instanceof does not trigger autoload. ---FILE-- - ---EXPECTF-- -bool(false) diff --git a/tests/classes/autoload_008.phpt b/tests/classes/autoload_008.phpt deleted file mode 100644 index 75a9cd052046e..0000000000000 --- a/tests/classes/autoload_008.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Ensure catch blocks for unknown exception types do not trigger autoload. ---FILE-- - ---EXPECTF-- -In Exception catch block. Autoload should not have been triggered. diff --git a/tests/classes/autoload_009.phpt b/tests/classes/autoload_009.phpt deleted file mode 100644 index 46f6055fefa09..0000000000000 --- a/tests/classes/autoload_009.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Ensure type hints for unknown types do not trigger autoload. ---FILE-- - ---EXPECTF-- - -Catchable fatal error: Argument 1 passed to f() must be an instance of UndefClass, instance of stdClass given, called in %s - - diff --git a/tests/classes/autoload_010.phpt b/tests/classes/autoload_010.phpt deleted file mode 100644 index 104f6888c8a9f..0000000000000 --- a/tests/classes/autoload_010.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Ensure implements does trigger autoload. ---FILE-- - ---EXPECTF-- -In autoload: string(6) "UndefI" - -Fatal error: Interface 'UndefI' not found in %s on line %d diff --git a/tests/classes/autoload_011.phpt b/tests/classes/autoload_011.phpt deleted file mode 100644 index 86858d5f1dd34..0000000000000 --- a/tests/classes/autoload_011.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Ensure extends does trigger autoload. ---FILE-- - ---EXPECTF-- -In autoload: string(9) "UndefBase" - -Fatal error: Class 'UndefBase' not found in %s on line %d diff --git a/tests/classes/autoload_012.phpt b/tests/classes/autoload_012.phpt deleted file mode 100644 index 1f516cb4bf06e..0000000000000 --- a/tests/classes/autoload_012.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Ensure callback methods in unknown classes trigger autoload. ---FILE-- - ---EXPECTF-- -In autoload: string(6) "UndefC" - -Warning: call_user_func(UndefC::test): First argument is expected to be a valid callback in %s on line %d - diff --git a/tests/classes/autoload_013.phpt b/tests/classes/autoload_013.phpt deleted file mode 100644 index 4309cea1763bf..0000000000000 --- a/tests/classes/autoload_013.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Ensure the ReflectionClass constructor triggers autoload. ---SKIPIF-- - ---FILE-- -getMessage(); - } -?> ---EXPECTF-- -In autoload: string(6) "UndefC" -Class UndefC does not exist diff --git a/tests/classes/autoload_014.phpt b/tests/classes/autoload_014.phpt deleted file mode 100644 index a3f04b7b57212..0000000000000 --- a/tests/classes/autoload_014.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Ensure the ReflectionMethod constructor triggers autoload. ---SKIPIF-- - ---FILE-- -getMessage(); - } -?> ---EXPECTF-- -In autoload: string(6) "UndefC" -Class UndefC does not exist diff --git a/tests/classes/autoload_015.phpt b/tests/classes/autoload_015.phpt deleted file mode 100644 index 2b14a0de056a6..0000000000000 --- a/tests/classes/autoload_015.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Ensure the ReflectionProperty constructor triggers autoload. ---SKIPIF-- - ---FILE-- -getMessage(); - } -?> ---EXPECTF-- -In autoload: string(6) "UndefC" -Class UndefC does not exist diff --git a/tests/classes/autoload_016.phpt b/tests/classes/autoload_016.phpt deleted file mode 100644 index 60263ba95a2ed..0000000000000 --- a/tests/classes/autoload_016.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Ensure ReflectionClass::getProperty() triggers autoload ---SKIPIF-- - ---FILE-- -getProperty("UndefC::p"); - } catch (ReflectionException $e) { - echo $e->getMessage(); - } -?> ---EXPECTF-- -In autoload: string(6) "undefc" -Class undefc does not exist diff --git a/tests/classes/autoload_017.phpt b/tests/classes/autoload_017.phpt deleted file mode 100644 index 26de9fd3aef2f..0000000000000 --- a/tests/classes/autoload_017.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Ensure ReflectionClass::implementsInterface triggers autoload. ---SKIPIF-- - ---FILE-- -implementsInterface("UndefI"); - } catch (ReflectionException $e) { - echo $e->getMessage(); - } -?> ---EXPECTF-- -In autoload: string(6) "UndefI" -Interface UndefI does not exist \ No newline at end of file diff --git a/tests/classes/autoload_018.phpt b/tests/classes/autoload_018.phpt deleted file mode 100644 index 59e20e2a60864..0000000000000 --- a/tests/classes/autoload_018.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Ensure __autoload() allows for recursive calls if the class name differs. ---FILE-- - 10) { - echo "-> Recursion detected - as expected.\n"; - return; - } - - class_exists('UndefinedClass' . $i); - - echo "OUT: " . __METHOD__ . "($name)\n"; - } - - var_dump(class_exists('UndefinedClass0')); -?> ---EXPECTF-- -IN: __autoload(UndefinedClass0) -IN: __autoload(UndefinedClass1) -IN: __autoload(UndefinedClass2) -IN: __autoload(UndefinedClass3) -IN: __autoload(UndefinedClass4) -IN: __autoload(UndefinedClass5) -IN: __autoload(UndefinedClass6) -IN: __autoload(UndefinedClass7) -IN: __autoload(UndefinedClass8) -IN: __autoload(UndefinedClass9) -IN: __autoload(UndefinedClass10) -IN: __autoload(UndefinedClass11) --> Recursion detected - as expected. -OUT: __autoload(UndefinedClass10) -OUT: __autoload(UndefinedClass9) -OUT: __autoload(UndefinedClass8) -OUT: __autoload(UndefinedClass7) -OUT: __autoload(UndefinedClass6) -OUT: __autoload(UndefinedClass5) -OUT: __autoload(UndefinedClass4) -OUT: __autoload(UndefinedClass3) -OUT: __autoload(UndefinedClass2) -OUT: __autoload(UndefinedClass1) -OUT: __autoload(UndefinedClass0) -bool(false) - diff --git a/tests/classes/autoload_019.phpt b/tests/classes/autoload_019.phpt deleted file mode 100644 index 783632013b505..0000000000000 --- a/tests/classes/autoload_019.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Ensure __autoload() recursion is guarded for multiple lookups of same class using difference case. ---FILE-- - ---EXPECTF-- -__autoload unDefinedClass diff --git a/tests/classes/autoload_020.phpt b/tests/classes/autoload_020.phpt deleted file mode 100644 index a88e561238f34..0000000000000 --- a/tests/classes/autoload_020.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Ensure __autoload() is triggered during unserialization. ---FILE-- - ---EXPECTF-- -in autoload: C -object(__PHP_Incomplete_Class)#%d (1) { - ["__PHP_Incomplete_Class_Name"]=> - string(1) "C" -} diff --git a/tests/classes/autoload_derived.p5c b/tests/classes/autoload_derived.p5c deleted file mode 100755 index 93a4b3579ac81..0000000000000 --- a/tests/classes/autoload_derived.p5c +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/autoload_implements.p5c b/tests/classes/autoload_implements.p5c deleted file mode 100755 index 2c3479c860787..0000000000000 --- a/tests/classes/autoload_implements.p5c +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/autoload_interface.p5c b/tests/classes/autoload_interface.p5c deleted file mode 100755 index 6908155e610e8..0000000000000 --- a/tests/classes/autoload_interface.p5c +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/autoload_root.p5c b/tests/classes/autoload_root.p5c deleted file mode 100755 index 9559d36d32e8a..0000000000000 --- a/tests/classes/autoload_root.p5c +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/bug23951.phpt b/tests/classes/bug23951.phpt deleted file mode 100644 index 2e272b87fe9ad..0000000000000 --- a/tests/classes/bug23951.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Bug #23951 (Defines not working in inherited classes) ---FILE-- -'foo1_value', FOO2=>'foo2_value'); - -} - -class B extends A { - - public $b_var = 'foo'; - -} - -$a = new A; -$b = new B; - -print_r($a); -print_r($b->a_var); -print_r($b->b_var); - -?> ---EXPECT-- -A Object -( - [a_var] => Array - ( - [1] => foo1_value - [2] => foo2_value - ) - -) -Array -( - [1] => foo1_value - [2] => foo2_value -) -foo diff --git a/tests/classes/bug24399.phpt b/tests/classes/bug24399.phpt deleted file mode 100644 index fedf8e5d245ab..0000000000000 --- a/tests/classes/bug24399.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #24399 (is_subclass_of() crashes when parent class doesn't exist) ---FILE-- - ---EXPECT-- -bool(false) diff --git a/tests/classes/bug24445.phpt b/tests/classes/bug24445.phpt deleted file mode 100644 index af08307ac464c..0000000000000 --- a/tests/classes/bug24445.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #24445 (get_parent_class() returns the current class when passed an object) ---FILE-- - ---EXPECT-- -bool(false) -bool(false) diff --git a/tests/classes/bug26737.phpt b/tests/classes/bug26737.phpt deleted file mode 100644 index e190318ffd819..0000000000000 --- a/tests/classes/bug26737.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #26737 (Protected and private variables are not saved on serialization when a user defined __sleep is used) ---FILE-- - ---EXPECTF-- -Notice: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d -string(130) "O:3:"foo":4:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";s:7:"no_such";N;}" diff --git a/tests/classes/bug27468.phpt b/tests/classes/bug27468.phpt deleted file mode 100644 index 58a7b6cb16735..0000000000000 --- a/tests/classes/bug27468.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #27468 (foreach in __destruct() causes segfault) ---FILE-- -x as $x); - } -} -new foo(); -echo 'OK'; -?> ---EXPECTF-- -Notice: Undefined property: foo::$x in %sbug27468.php on line 4 - -Warning: Invalid argument supplied for foreach() in %sbug27468.php on line 4 -OK diff --git a/tests/classes/bug27504.phpt b/tests/classes/bug27504.phpt deleted file mode 100644 index ca13990c9364d..0000000000000 --- a/tests/classes/bug27504.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #27504 (call_user_func_array allows calling of private/protected methods) ---FILE-- -bar('1'); - } - private function bar ( $param ) { - echo 'Called function foo:bar('.$param.')'."\n"; - } - } - - $foo = new foo(); - - call_user_func_array( array( $foo , 'bar' ) , array( '2' ) ); - - $foo->bar('3'); -?> ---EXPECTF-- -Called function foo:bar(%d) - -Warning: call_user_func_array(): First argument is expected to be a valid callback, 'foo::bar' was given in %sbug27504.php on line %d - -Fatal error: Call to private method foo::bar() from context '' in %s on line %d diff --git a/tests/classes/bug29446.phpt b/tests/classes/bug29446.phpt deleted file mode 100644 index 5e30e8e74b2fd..0000000000000 --- a/tests/classes/bug29446.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #29446 (ZE allows multiple declarations of the same class constant) ---FILE-- - ---EXPECTF-- -Fatal error: Cannot redefine class constant testClass::TEST_CONST in %s on line 5 \ No newline at end of file diff --git a/tests/classes/class_abstract.phpt b/tests/classes/class_abstract.phpt deleted file mode 100755 index 880f84930fd46..0000000000000 --- a/tests/classes/class_abstract.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -ZE2 An abstract class cannot be instanciated ---SKIPIF-- - ---FILE-- -show(); - -$t = new base(); -$t->show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -base - -Fatal error: Cannot instantiate abstract class base in %s on line %d diff --git a/tests/classes/class_example.phpt b/tests/classes/class_example.phpt deleted file mode 100644 index 621958b1bd23f..0000000000000 --- a/tests/classes/class_example.phpt +++ /dev/null @@ -1,85 +0,0 @@ ---TEST-- -Classes general test ---FILE-- - -first_name."\n"; - echo "Family name:\t ".$this->family_name."\n"; - echo "Address:\t ".$this->address."\n"; - echo "Phone:\t\t ".$this->phone_num."\n"; - echo "\n\n"; - } - function initialize($first_name,$family_name,$address,$phone_num) - { - $this->first_name = $first_name; - $this->family_name = $family_name; - $this->address = $address; - $this->phone_num = $phone_num; - } -}; - - -function test($u) -{ /* one can pass classes as arguments */ - $u->display(); - $t = $u; - $t->address = "New address..."; - return $t; /* and also return them as return values */ -} - -$user1 = new user; -$user2 = new user; - -$user1->initialize("Zeev","Suraski","Ben Gourion 3, Kiryat Bialik, Israel","+972-4-8713139"); -$user2->initialize("Andi","Gutmans","Haifa, Israel","+972-4-8231621"); -$user1->display(); -$user2->display(); - -$tmp = test($user2); -$tmp->display(); - -?> ---EXPECT-- -User information ----------------- - -First name: Zeev -Family name: Suraski -Address: Ben Gourion 3, Kiryat Bialik, Israel -Phone: +972-4-8713139 - - -User information ----------------- - -First name: Andi -Family name: Gutmans -Address: Haifa, Israel -Phone: +972-4-8231621 - - -User information ----------------- - -First name: Andi -Family name: Gutmans -Address: Haifa, Israel -Phone: +972-4-8231621 - - -User information ----------------- - -First name: Andi -Family name: Gutmans -Address: New address... -Phone: +972-4-8231621 diff --git a/tests/classes/class_final.phpt b/tests/classes/class_final.phpt deleted file mode 100755 index 5c73cb25563eb..0000000000000 --- a/tests/classes/class_final.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -ZE2 A final class cannot be inherited ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Class derived may not inherit from final class (base) in %s on line %d diff --git a/tests/classes/class_stdclass.phpt b/tests/classes/class_stdclass.phpt deleted file mode 100755 index 5e3422aeae91f..0000000000000 --- a/tests/classes/class_stdclass.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Instantiate stdClass ---FILE-- - ---EXPECTF-- -stdClass -Done diff --git a/tests/classes/clone_001.phpt b/tests/classes/clone_001.phpt deleted file mode 100755 index eb06c1f5206a2..0000000000000 --- a/tests/classes/clone_001.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -ZE2 object cloning, 1 ---SKIPIF-- - ---FILE-- -p2 = 'A'; -$obj->p3 = 'B'; -$copy = clone $obj; -$copy->p3 = 'C'; -echo "Object\n"; -var_dump($obj); -echo "Clown\n"; -var_dump($copy); -echo "Done\n"; -?> ---EXPECT-- -Object -object(test)#1 (3) { - ["p1"]=> - int(1) - ["p2"]=> - string(1) "A" - ["p3"]=> - string(1) "B" -} -Clown -object(test)#2 (3) { - ["p1"]=> - int(1) - ["p2"]=> - string(1) "A" - ["p3"]=> - string(1) "C" -} -Done diff --git a/tests/classes/clone_002.phpt b/tests/classes/clone_002.phpt deleted file mode 100755 index 4430a2cab4d56..0000000000000 --- a/tests/classes/clone_002.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -ZE2 object cloning, 2 ---SKIPIF-- - ---FILE-- -p2 = 'A'; -$obj->p3 = 'B'; -$copy = clone $obj; -$copy->p3 = 'C'; -echo "Object\n"; -var_dump($obj); -echo "Clown\n"; -var_dump($copy); -echo "Done\n"; -?> ---EXPECT-- -Object -object(test)#1 (3) { - ["p1"]=> - int(1) - ["p2"]=> - string(1) "A" - ["p3"]=> - string(1) "B" -} -Clown -object(test)#2 (3) { - ["p1"]=> - int(1) - ["p2"]=> - string(1) "A" - ["p3"]=> - string(1) "C" -} -Done diff --git a/tests/classes/clone_003.phpt b/tests/classes/clone_003.phpt deleted file mode 100755 index 658810825cf7b..0000000000000 --- a/tests/classes/clone_003.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -ZE2 object cloning, 3 ---SKIPIF-- - ---FILE-- -p5 = 'clone:5'; - } -} - -$obj = new test; -$obj->p4 = 'A'; -$copy = clone $obj; -echo "Object\n"; -print_r($obj); -echo "Clown\n"; -print_r($copy); -echo "Done\n"; -?> ---EXPECT-- -Object -test Object -( - [p1] => test:1 - [p3] => test:3 - [p4] => A - [p5] => test:5 - [p2] => base:2 - [p6:private] => base:6 -) -Clown -test Object -( - [p1] => test:1 - [p3] => test:3 - [p4] => A - [p5] => clone:5 - [p2] => base:2 - [p6:private] => base:6 -) -Done diff --git a/tests/classes/clone_004.phpt b/tests/classes/clone_004.phpt deleted file mode 100755 index 2059103bc5aa0..0000000000000 --- a/tests/classes/clone_004.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -ZE2 object cloning, 4 ---FILE-- -a = array(1,2); -$o1->b = array(3,4); -$o1->show(); - -echo "Clone\n"; -$o2 = clone $o1; -$o2->show(); - -echo "Modify\n"; -$o2->a = 5; -$o2->b = 6; -$o2->show(); - -echo "Done\n"; -?> ---EXPECT-- -Original -object(test)#1 (2) { - ["b"]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - ["a"]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -Clone -object(test)#2 (2) { - ["b"]=> - array(2) { - [0]=> - int(3) - [1]=> - int(4) - } - ["a"]=> - array(2) { - [0]=> - int(1) - [1]=> - int(2) - } -} -Modify -object(test)#2 (2) { - ["b"]=> - int(6) - ["a"]=> - int(5) -} -Done diff --git a/tests/classes/clone_005.phpt b/tests/classes/clone_005.phpt deleted file mode 100755 index bfe4d66d6fa5f..0000000000000 --- a/tests/classes/clone_005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -ZE2 object cloning, 5 ---FILE-- - ---EXPECTF-- -Fatal error: Cannot override final method base::__clone() in %sclone_005.php on line %d diff --git a/tests/classes/clone_006.phpt b/tests/classes/clone_006.phpt deleted file mode 100755 index de22fec151938..0000000000000 --- a/tests/classes/clone_006.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -ZE2 object cloning, 6 ---SKIPIF-- - ---INI-- -error_reporting=2047 ---FILE-- -id = self::$id++; - } - - function __clone() { - $this->address = "New York"; - $this->id = self::$id++; - } -} - -$original = new MyCloneable(); - -$original->name = "Hello"; -$original->address = "Tel-Aviv"; - -echo $original->id . "\n"; - -$clone = clone $original; - -echo $clone->id . "\n"; -echo $clone->name . "\n"; -echo $clone->address . "\n"; - -?> ---EXPECT-- -0 -1 -Hello -New York diff --git a/tests/classes/constants_basic_001.phpt b/tests/classes/constants_basic_001.phpt deleted file mode 100644 index 74b0fcdf48fb9..0000000000000 --- a/tests/classes/constants_basic_001.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -Class constant declarations ---FILE-- - ---EXPECTF-- - -Notice: Undefined variable: undef in %s on line 5 - -Attempt to access various kinds of class constants: - -Notice: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s on line %d -string(9) "UNDEFINED" -int(1) -float(1.5) -int(1) -float(1.5) -int(-1) -float(-1.5) -int(15) -string(%d) "%s" -string(1) "C" -string(1) "C" -string(0) "" -int(1234) -int(456) -NULL -string(6) "hello1" -string(6) "hello2" -string(6) "hello2" -string(6) "hello2" - -Expecting fatal error: - -Fatal error: Undefined class constant 'c19' in %s on line 53 diff --git a/tests/classes/constants_basic_002.phpt b/tests/classes/constants_basic_002.phpt deleted file mode 100644 index 0e53ca97c813e..0000000000000 --- a/tests/classes/constants_basic_002.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Basic class support - defining and reading a class constant. ---FILE-- -myConst); - - echo "\nClass constant not visible in object var_dump.\n"; - var_dump($myInstance) -?> ---EXPECTF-- - -Read class constant. -string(5) "hello" - -Fail to read class constant from instance. - -Notice: Undefined property: aclass::$myConst in %s on line 12 -NULL - -Class constant not visible in object var_dump. -object(aclass)#%d (0) { -} diff --git a/tests/classes/constants_basic_003.inc b/tests/classes/constants_basic_003.inc deleted file mode 100644 index be193e64f89a1..0000000000000 --- a/tests/classes/constants_basic_003.inc +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/tests/classes/constants_basic_003.phpt b/tests/classes/constants_basic_003.phpt deleted file mode 100644 index 052af8573e71e..0000000000000 --- a/tests/classes/constants_basic_003.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Ensure class properties and constants can be defined in terms of constants that are not known at compile time. ---FILE-- - ---EXPECTF-- -string(12) "hello from A" -string(12) "hello from C" -string(12) "hello from A" -string(12) "hello from C" diff --git a/tests/classes/constants_basic_004.phpt b/tests/classes/constants_basic_004.phpt deleted file mode 100644 index cade66844b715..0000000000000 --- a/tests/classes/constants_basic_004.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -Test properties with array default values using class constants as keys and values. ---FILE-- - B::VALUE); - public $a_x = array(B::KEY => B::VALUE); - } - - class B - { - const KEY = "key"; - const VALUE = "value"; - - // Static and instance array using class constants with self - public static $sa_b = array(self::KEY => self::VALUE); - public $a_b = array(self::KEY => self::VALUE); - } - - class C extends B - { - // Static and instance array using class constants with parent - public static $sa_c_parent = array(parent::KEY => parent::VALUE); - public $a_c_parent = array(parent::KEY => parent::VALUE); - - // Static and instance array using class constants with self (constants should be inherited) - public static $sa_c_self = array(self::KEY => self::VALUE); - public $a_c_self = array(self::KEY => self::VALUE); - - // Should also include inherited properties from B. - } - - echo "\nStatic properties:\n"; - var_dump(X::$sa_x, B::$sa_b, C::$sa_b, C::$sa_c_parent, C::$sa_c_self); - - echo "\nInstance properties:\n"; - $x = new x; - $b = new B; - $c = new C; - var_dump($x, $b, $c); -?> ---EXPECTF-- - -Static properties: -array(1) { - ["key"]=> - string(5) "value" -} -array(1) { - ["key"]=> - string(5) "value" -} -array(1) { - ["key"]=> - string(5) "value" -} -array(1) { - ["key"]=> - string(5) "value" -} -array(1) { - ["key"]=> - string(5) "value" -} - -Instance properties: -object(X)#%d (1) { - ["a_x"]=> - array(1) { - ["key"]=> - string(5) "value" - } -} -object(B)#%d (1) { - ["a_b"]=> - array(1) { - ["key"]=> - string(5) "value" - } -} -object(C)#%d (3) { - ["a_c_parent"]=> - array(1) { - ["key"]=> - string(5) "value" - } - ["a_c_self"]=> - array(1) { - ["key"]=> - string(5) "value" - } - ["a_b"]=> - array(1) { - ["key"]=> - string(5) "value" - } -} diff --git a/tests/classes/constants_basic_005.phpt b/tests/classes/constants_basic_005.phpt deleted file mode 100644 index c840f5385a772..0000000000000 --- a/tests/classes/constants_basic_005.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Test constants with default values based on other constants. ---FILE-- - ---EXPECTF-- -string(5) "hello" -string(5) "hello" - diff --git a/tests/classes/constants_basic_006.phpt b/tests/classes/constants_basic_006.phpt deleted file mode 100644 index 73cf0ef3a9cd9..0000000000000 --- a/tests/classes/constants_basic_006.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -Ensure class constants are not evaluated when a class is looked up to resolve inheritance during runtime. ---FILE-- - D::V, E::A => K); - } - - eval('class D extends C { const V = \'test\'; }'); - - class E extends D - { - const A = "hello"; - } - - define('K', "nasty"); - - var_dump(C::X, C::$a, D::X, D::$a, E::X, E::$a); -?> ---EXPECTF-- -string(5) "hello" -array(2) { - ["nasty"]=> - string(4) "test" - ["hello"]=> - string(5) "nasty" -} -string(5) "hello" -array(2) { - ["nasty"]=> - string(4) "test" - ["hello"]=> - string(5) "nasty" -} -string(5) "hello" -array(2) { - ["nasty"]=> - string(4) "test" - ["hello"]=> - string(5) "nasty" -} diff --git a/tests/classes/constants_error_001.phpt b/tests/classes/constants_error_001.phpt deleted file mode 100644 index 9bb5533d7e225..0000000000000 --- a/tests/classes/constants_error_001.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Error case: duplicate class constant definition ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot redefine class constant myclass::myConst in %s on line 5 diff --git a/tests/classes/constants_error_002.phpt b/tests/classes/constants_error_002.phpt deleted file mode 100644 index be27971b87af5..0000000000000 --- a/tests/classes/constants_error_002.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Error case: class constant as an array ---FILE-- - ---EXPECTF-- - -Fatal error: Arrays are not allowed in class constants in %s on line 4 diff --git a/tests/classes/constants_error_003.phpt b/tests/classes/constants_error_003.phpt deleted file mode 100644 index c67768c809814..0000000000000 --- a/tests/classes/constants_error_003.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Basic class support - attempting to pass a class constant by reference. ---FILE-- - ---EXPECTF-- - -Fatal error: Only variables can be passed by reference in %s on line 12 diff --git a/tests/classes/constants_error_004.phpt b/tests/classes/constants_error_004.phpt deleted file mode 100644 index 03e67258a65c4..0000000000000 --- a/tests/classes/constants_error_004.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Class constant whose initial value refereces a non-existent class ---FILE-- - ---EXPECTF-- -Fatal error: Class 'D' not found in %s on line %d diff --git a/tests/classes/constants_error_005.phpt b/tests/classes/constants_error_005.phpt deleted file mode 100644 index 1283783de7344..0000000000000 --- a/tests/classes/constants_error_005.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Error case: class constant as an encapsed containing a variable ---FILE-- - ---EXPECTF-- - -Parse error: %s in %s on line %d diff --git a/tests/classes/constants_error_006.phpt b/tests/classes/constants_error_006.phpt deleted file mode 100644 index f3f14b867bed1..0000000000000 --- a/tests/classes/constants_error_006.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Basic class support - attempting to modify a class constant by assignment ---FILE-- - ---EXPECTF-- - -Parse error: %s in %s on line %d diff --git a/tests/classes/constants_error_007.phpt b/tests/classes/constants_error_007.phpt deleted file mode 100644 index 4be8d885f5f00..0000000000000 --- a/tests/classes/constants_error_007.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Basic class support - attempting to create a reference to a class constant ---FILE-- - ---EXPECTF-- - -Parse error: %s in %s on line %d diff --git a/tests/classes/constants_scope_001.phpt b/tests/classes/constants_scope_001.phpt deleted file mode 100644 index 50066282eaa2d..0000000000000 --- a/tests/classes/constants_scope_001.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -ZE2 class constants and scope ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Notice: Use of undefined constant FATAL - assumed 'FATAL' in %sconstants_scope_001.php on line %d -FATAL = FATAL -self::FATAL = Fatal error -self::FATAL = Worst error -parent::FATAL = Fatal error diff --git a/tests/classes/ctor_dtor.phpt b/tests/classes/ctor_dtor.phpt deleted file mode 100644 index ea6813cc96d6e..0000000000000 --- a/tests/classes/ctor_dtor.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -ZE2 The new constructor/destructor is called ---SKIPIF-- - ---FILE-- -early(); -unset($t); -$t = new late(); -//unset($t); delay to end of script - -echo "Done\n"; -?> ---EXPECTF-- -early::early -early::early -early::__destruct -late::__construct -Done -late::__destruct diff --git a/tests/classes/ctor_dtor_inheritance.phpt b/tests/classes/ctor_dtor_inheritance.phpt deleted file mode 100644 index 8ae2a5dec485e..0000000000000 --- a/tests/classes/ctor_dtor_inheritance.phpt +++ /dev/null @@ -1,99 +0,0 @@ ---TEST-- -ZE2 A derived class can use the inherited constructor/destructor ---SKIPIF-- - ---FILE-- -name = 'base'; - print_r($this); - } - - function __destruct() { - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - print_r($this); - } -} - -class derived extends base { - public $other; - - function __construct() { - $this->name = 'init'; - $this->other = 'other'; - print_r($this); - parent::__construct(); - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - $this->name = 'derived'; - print_r($this); - } - - function __destruct() { - parent::__destruct(); - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - print_r($this); - } -} - -echo "Testing class base\n"; -$t = new base(); -unset($t); -echo "Testing class derived\n"; -$t = new derived(); -unset($t); - -echo "Done\n"; -?> ---EXPECTF-- -Testing class base -base::__construct -base Object -( - [name] => base -) -base::__destruct -base Object -( - [name] => base -) -Testing class derived -derived Object -( - [other] => other - [name] => init -) -base::__construct -derived Object -( - [other] => other - [name] => base -) -derived::__construct -derived Object -( - [other] => other - [name] => derived -) -base::__destruct -derived Object -( - [other] => other - [name] => derived -) -derived::__destruct -derived Object -( - [other] => other - [name] => derived -) -Done diff --git a/tests/classes/ctor_failure.phpt b/tests/classes/ctor_failure.phpt deleted file mode 100755 index b7d3b64dda6b9..0000000000000 --- a/tests/classes/ctor_failure.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 Do not call destructors if constructor fails ---FILE-- -getMessage() . ")\n"; -} - -?> -===DONE=== ---EXPECT-- -Test::__construct(Hello) -Caught Exception(Hello) -===DONE=== diff --git a/tests/classes/ctor_in_interface_01.phpt b/tests/classes/ctor_in_interface_01.phpt deleted file mode 100755 index f6f9b66eabb9d..0000000000000 --- a/tests/classes/ctor_in_interface_01.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -ZE2 A class constructor must keep the signature of an interface ---FILE-- - ---EXPECTF-- -Fatal error: Declaration of implem::__construct() must be compatible with that of constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_in_interface_02.phpt b/tests/classes/ctor_in_interface_02.phpt deleted file mode 100755 index a0dfe87788cec..0000000000000 --- a/tests/classes/ctor_in_interface_02.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A class constructor must keep the signature of all interfaces ---FILE-- - ---EXPECTF-- -Fatal error: Can't inherit abstract function constr3::__construct() (previously declared abstract in constr1) in %s on line %d diff --git a/tests/classes/ctor_in_interface_03.phpt b/tests/classes/ctor_in_interface_03.phpt deleted file mode 100755 index 953d6822fdf5c..0000000000000 --- a/tests/classes/ctor_in_interface_03.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -ZE2 A class constructor must keep the signature of base class interfaces ---FILE-- - ---EXPECTF-- -Fatal error: Declaration of derived::__construct() must be compatible with that of constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_in_interface_04.phpt b/tests/classes/ctor_in_interface_04.phpt deleted file mode 100755 index 0016244c18aae..0000000000000 --- a/tests/classes/ctor_in_interface_04.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 A class constructor must keep the signature of base class interfaces ---FILE-- - ---EXPECTF-- -Fatal error: Declaration of derived::__construct() must be compatible with that of constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_name_clash.phpt b/tests/classes/ctor_name_clash.phpt deleted file mode 100644 index 1a1d6fa511d0d..0000000000000 --- a/tests/classes/ctor_name_clash.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -ZE2 The child class can re-use the parent class name for a function member ---FILE-- -base(); -?> ---EXPECTF-- -base::base -derived::base diff --git a/tests/classes/ctor_visibility.phpt b/tests/classes/ctor_visibility.phpt deleted file mode 100755 index 8d3b1c5c501be..0000000000000 --- a/tests/classes/ctor_visibility.phpt +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -ZE2 A private constructor cannot be called ---FILE-- - -===DONE=== ---EXPECTF-- -Derived::__construct() -Test::__construct() -TestPriv::__construct() -DerivedPriv::__construct() - -Fatal error: Cannot call private TestPriv::__construct() in %sctor_visibility.php on line %d diff --git a/tests/classes/dereferencing_001.phpt b/tests/classes/dereferencing_001.phpt deleted file mode 100644 index dd2aba78e5788..0000000000000 --- a/tests/classes/dereferencing_001.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 dereferencing of objects from methods ---SKIPIF-- - ---FILE-- -name = $_name; - } - - function display() { - echo $this->name . "\n"; - } -} - -class Person { - private $name; - - function person($_name, $_address) { - $this->name = new Name($_name); - } - - function getName() { - return $this->name; - } -} - -$person = new Person("John", "New York"); -$person->getName()->display(); - -?> ---EXPECT-- -John diff --git a/tests/classes/destructor_and_echo.phpt b/tests/classes/destructor_and_echo.phpt deleted file mode 100755 index 0a253593a5e32..0000000000000 --- a/tests/classes/destructor_and_echo.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -ZE2 Destructors and echo ---FILE-- - -===DONE=== ---EXPECT-- -Test::__construct -===DONE=== -Test::__destruct diff --git a/tests/classes/destructor_and_exceptions.phpt b/tests/classes/destructor_and_exceptions.phpt deleted file mode 100755 index 8100c924656e3..0000000000000 --- a/tests/classes/destructor_and_exceptions.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -ZE2 catch exception thrown in destructor ---FILE-- -getMessage() . "\n"; -} - -class FatalException extends Exception -{ - function __construct($what) - { - echo __METHOD__ . "\n"; - $o = new FailClass; - unset($o); - echo "Done: " . __METHOD__ . "\n"; - } -} - -try -{ - throw new FatalException("Damn"); -} -catch(Exception $e) -{ - echo "Caught Exception: " . $e->getMessage() . "\n"; -} -catch(FatalException $e) -{ - echo "Caught FatalException: " . $e->getMessage() . "\n"; -} - -?> -===DONE=== ---EXPECTF-- -FailClass::__destruct -Caught: FailClass -FatalException::__construct -FailClass::__destruct -Caught Exception: FailClass -===DONE=== diff --git a/tests/classes/destructor_and_globals.phpt b/tests/classes/destructor_and_globals.phpt deleted file mode 100755 index 9caf0f1026783..0000000000000 --- a/tests/classes/destructor_and_globals.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -ZE2 accessing globals from destructor in shutdown ---FILE-- -id = $test_num++; - } - - public function Show() { - echo 'Id: '.$this->id."\n"; - } - - // try protected here - public function __destruct() { - global $test_cnt; - $test_cnt--; - } - - static public function destroy(&$obj) { - $obj = NULL; - } -} -Show(); -$obj1 = new counter; -$obj1->Show(); -Show(); -$obj2 = new counter; -$obj2->Show(); -Show(); -counter::destroy($obj1); -Show(); -// or uncomment this line and it works -//counter::destroy($obj2); -echo "Done\n"; -?> ---EXPECT-- -Count: 0 -Id: 0 -Count: 1 -Id: 1 -Count: 2 -Count: 1 -Done diff --git a/tests/classes/destructor_and_references.phpt b/tests/classes/destructor_and_references.phpt deleted file mode 100755 index 6b9b019b62228..0000000000000 --- a/tests/classes/destructor_and_references.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 Destructing and references ---FILE-- -x = &$o4; - -$r1 = &$o1; - -class once {} - -$o = new once; -echo "Done\n"; -?> ---EXPECT-- -Done diff --git a/tests/classes/destructor_inheritance.phpt b/tests/classes/destructor_inheritance.phpt deleted file mode 100755 index b9a46659b052f..0000000000000 --- a/tests/classes/destructor_inheritance.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -ZE2 The inherited destructor is called ---SKIPIF-- - ---FILE-- - ---EXPECT-- -base::__construct -base::__destruct -Done \ No newline at end of file diff --git a/tests/classes/destructor_visibility_001.phpt b/tests/classes/destructor_visibility_001.phpt deleted file mode 100755 index 7674c512f62a7..0000000000000 --- a/tests/classes/destructor_visibility_001.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -ZE2 Ensuring destructor visibility ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -Fatal error: Call to private Derived::__destruct() from context '' in %sdestructor_visibility_001.php on line %d diff --git a/tests/classes/destructor_visibility_002.phpt b/tests/classes/destructor_visibility_002.phpt deleted file mode 100755 index 2cc83334a9870..0000000000000 --- a/tests/classes/destructor_visibility_002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -ZE2 Ensuring destructor visibility ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -===DONE=== - -Warning: Call to private Derived::__destruct() from context '' during shutdown ignored in Unknown on line %d diff --git a/tests/classes/destructor_visibility_003.phpt b/tests/classes/destructor_visibility_003.phpt deleted file mode 100755 index 83e3efe22e449..0000000000000 --- a/tests/classes/destructor_visibility_003.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -ZE2 Ensuring destructor visibility ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -Derived::__destruct -===DONE=== diff --git a/tests/classes/factory_001.phpt b/tests/classes/factory_001.phpt deleted file mode 100644 index 97b69c1b4778e..0000000000000 --- a/tests/classes/factory_001.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 factory objects ---SKIPIF-- - ---FILE-- -draw(); -ShapeFactoryMethod("Square")->draw(); - -?> ---EXPECT-- -Circle -Square diff --git a/tests/classes/factory_and_singleton_001.phpt b/tests/classes/factory_and_singleton_001.phpt deleted file mode 100755 index 70fa020a49a97..0000000000000 --- a/tests/classes/factory_and_singleton_001.phpt +++ /dev/null @@ -1,101 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 1 ---SKIPIF-- - ---FILE-- -x = $x; - } - - static function destroy() { - test::$test = NULL; - } - - protected function __destruct() { - test::$cnt--; - } - - public function get() { - return $this->x; - } - - static public function getX() { - if (test::$test) { - return test::$test->x; - } else { - return NULL; - } - } - - static public function count() { - return test::$cnt; - } -} - -echo "Access static members\n"; -var_dump(test::getX()); -var_dump(test::count()); - -echo "Create x and y\n"; -$x = test::factory(1); -$y = test::factory(2); -var_dump(test::getX()); -var_dump(test::count()); -var_dump($x->get()); -var_dump($y->get()); - -echo "Destruct x\n"; -$x = NULL; -var_dump(test::getX()); -var_dump(test::count()); -var_dump($y->get()); - -echo "Destruct y\n"; -$y = NULL; -var_dump(test::getX()); -var_dump(test::count()); - -echo "Destruct static\n"; -test::destroy(); -var_dump(test::getX()); -var_dump(test::count()); - -echo "Done\n"; -?> ---EXPECT-- -Access static members -NULL -int(0) -Create x and y -int(1) -int(1) -int(1) -int(1) -Destruct x -int(1) -int(1) -int(1) -Destruct y -int(1) -int(1) -Destruct static -NULL -int(0) -Done diff --git a/tests/classes/factory_and_singleton_002.phpt b/tests/classes/factory_and_singleton_002.phpt deleted file mode 100755 index 3308a561a506e..0000000000000 --- a/tests/classes/factory_and_singleton_002.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 2 ---SKIPIF-- - ---FILE-- -x = $x; - } - - static function destroy() { - test::$test = NULL; - } - - protected function __destruct() { - test::$cnt--; - } - - public function get() { - return $this->x; - } - - static public function getX() { - if (test::$test) { - return test::$test->x; - } else { - return NULL; - } - } - - static public function count() { - return test::$cnt; - } -} - -echo "Access static members\n"; -var_dump(test::getX()); -var_dump(test::count()); - -echo "Create x and y\n"; -$x = test::factory(1); -$y = test::factory(2); -var_dump(test::getX()); -var_dump(test::count()); -var_dump($x->get()); -var_dump($y->get()); - -echo "Destruct x\n"; -$x = NULL; -var_dump(test::getX()); -var_dump(test::count()); -var_dump($y->get()); - -echo "Destruct y\n"; -$y = NULL; -var_dump(test::getX()); -var_dump(test::count()); - -//echo "Destruct static\n"; -//test::destroy(); -//var_dump(test::getX()); -//var_dump(test::count()); - -echo "Done\n"; -?> ---EXPECT-- -Access static members -NULL -int(0) -Create x and y -int(1) -int(1) -int(1) -int(1) -Destruct x -int(1) -int(1) -int(1) -Destruct y -int(1) -int(1) -Done - -Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/factory_and_singleton_003.phpt b/tests/classes/factory_and_singleton_003.phpt deleted file mode 100755 index 3d50a810a6b00..0000000000000 --- a/tests/classes/factory_and_singleton_003.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 3 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to protected test::__construct() from invalid context in %s on line %d diff --git a/tests/classes/factory_and_singleton_004.phpt b/tests/classes/factory_and_singleton_004.phpt deleted file mode 100755 index 14edcb1fc8ffc..0000000000000 --- a/tests/classes/factory_and_singleton_004.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 4 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to private test::__construct() from invalid context in %s on line %d diff --git a/tests/classes/factory_and_singleton_005.phpt b/tests/classes/factory_and_singleton_005.phpt deleted file mode 100755 index 2cd7e5cc997b7..0000000000000 --- a/tests/classes/factory_and_singleton_005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 5 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to protected test::__destruct() from context '' in %sfactory_and_singleton_005.php on line %d diff --git a/tests/classes/factory_and_singleton_006.phpt b/tests/classes/factory_and_singleton_006.phpt deleted file mode 100755 index 81cf714888b87..0000000000000 --- a/tests/classes/factory_and_singleton_006.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 6 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to private test::__destruct() from context '' in %sfactory_and_singleton_006.php on line %d - diff --git a/tests/classes/factory_and_singleton_007.phpt b/tests/classes/factory_and_singleton_007.phpt deleted file mode 100755 index 4788dbf08795d..0000000000000 --- a/tests/classes/factory_and_singleton_007.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 7 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to protected test::__clone() from context '' %sfactory_and_singleton_007.php on line %d diff --git a/tests/classes/factory_and_singleton_008.phpt b/tests/classes/factory_and_singleton_008.phpt deleted file mode 100755 index 750b9db340d1e..0000000000000 --- a/tests/classes/factory_and_singleton_008.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 8 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Call to private test::__clone() from context '' %sfactory_and_singleton_008.php on line %d diff --git a/tests/classes/factory_and_singleton_009.phpt b/tests/classes/factory_and_singleton_009.phpt deleted file mode 100755 index acf792c31639e..0000000000000 --- a/tests/classes/factory_and_singleton_009.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 9 ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -===DONE=== - -Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/factory_and_singleton_010.phpt b/tests/classes/factory_and_singleton_010.phpt deleted file mode 100755 index 0f5fb2dc74b13..0000000000000 --- a/tests/classes/factory_and_singleton_010.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -ZE2 factory and singleton, test 10 ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -===DONE=== - -Warning: Call to private test::__destruct() from context '' during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/final.phpt b/tests/classes/final.phpt deleted file mode 100644 index b4e37a36f6464..0000000000000 --- a/tests/classes/final.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 A method may be redeclared final ---SKIPIF-- - ---FILE-- -show(); - -class second extends first { - final function show() { - echo "Call to function second::show()\n"; - } -} - -$t2 = new second(); -$t2->show(); - -echo "Done\n"; -?> ---EXPECTF-- -Call to function first::show() -Call to function second::show() -Done \ No newline at end of file diff --git a/tests/classes/final_abstract.phpt b/tests/classes/final_abstract.phpt deleted file mode 100644 index 426c852cfc5b2..0000000000000 --- a/tests/classes/final_abstract.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -ZE2 A final method cannot be abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot use the final modifier on an abstract class member in %s diff --git a/tests/classes/final_ctor1.phpt b/tests/classes/final_ctor1.phpt deleted file mode 100755 index ebfa08081e0f5..0000000000000 --- a/tests/classes/final_ctor1.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -ZE2 cannot override final __construct ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot override final Base::__construct() with Extended::Extended() in %sfinal_ctor1.php on line %d diff --git a/tests/classes/final_ctor2.phpt b/tests/classes/final_ctor2.phpt deleted file mode 100755 index 905337b4081ce..0000000000000 --- a/tests/classes/final_ctor2.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -ZE2 cannot override final old style ctor ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot override final Base::Base() with Extended::__construct() in %sfinal_ctor2.php on line %d diff --git a/tests/classes/final_ctor3.phpt b/tests/classes/final_ctor3.phpt deleted file mode 100644 index d37e864e2d267..0000000000000 --- a/tests/classes/final_ctor3.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Ensure implicit final inherited old-style constructor cannot be overridden. ---FILE-- - ---EXPECTF-- -Fatal error: Cannot override final method A::B() in %s on line 9 diff --git a/tests/classes/final_redeclare.phpt b/tests/classes/final_redeclare.phpt deleted file mode 100644 index e8f2e6ff09ecb..0000000000000 --- a/tests/classes/final_redeclare.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -ZE2 A final method may not be overwritten ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Cannot override final method pass::show() in %s on line %d diff --git a/tests/classes/implicit_instantiation_001.phpt b/tests/classes/implicit_instantiation_001.phpt deleted file mode 100644 index 460cdc97f25b4..0000000000000 --- a/tests/classes/implicit_instantiation_001.phpt +++ /dev/null @@ -1,146 +0,0 @@ ---TEST-- -Implicit object instantiation when accessing properties of non-object. ---FILE-- - $value) { - echo "\n\n---( \$c->$name )---"; - echo "\n --> Attempting implicit conversion to object using increment...\n"; - $c->$name->prop++; - $c->$name = $value; // reset value in case implicit conversion was successful - - echo "\n --> Attempting implicit conversion to object using assignment...\n"; - $c->$name->prop = "Implicit instantiation!"; - $c->$name = $value; // reset value in case implicit conversion was successful - - echo "\n --> Attempting implicit conversion to object using combined assignment...\n"; - $c->$name->prop .= " Implicit instantiation!"; -} - -echo "\n\n\n --> Resulting object:"; -var_dump($c); - -?> ---EXPECTF-- - - ----( $c->boolFalse )--- - --> Attempting implicit conversion to object using increment... - -Strict Standards: Creating default object from empty value in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Strict Standards: Creating default object from empty value in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Strict Standards: Creating default object from empty value in %s on line 26 - - ----( $c->emptyString )--- - --> Attempting implicit conversion to object using increment... - -Strict Standards: Creating default object from empty value in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Strict Standards: Creating default object from empty value in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Strict Standards: Creating default object from empty value in %s on line 26 - - ----( $c->null )--- - --> Attempting implicit conversion to object using increment... - -Strict Standards: Creating default object from empty value in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Strict Standards: Creating default object from empty value in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Strict Standards: Creating default object from empty value in %s on line 26 - - ----( $c->boolTrue )--- - --> Attempting implicit conversion to object using increment... - -Warning: Attempt to %s property of non-object in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Warning: Attempt to assign property of non-object in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Warning: Attempt to assign property of non-object in %s on line 26 - - ----( $c->nonEmptyString )--- - --> Attempting implicit conversion to object using increment... - -Warning: Attempt to %s property of non-object in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Warning: Attempt to assign property of non-object in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Warning: Attempt to assign property of non-object in %s on line 26 - - ----( $c->intZero )--- - --> Attempting implicit conversion to object using increment... - -Warning: Attempt to %s property of non-object in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Warning: Attempt to assign property of non-object in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Warning: Attempt to assign property of non-object in %s on line 26 - - - - --> Resulting object:object(C)#%d (6) { - [%u|b%"boolFalse"]=> - object(stdClass)#%d (1) { - [%u|b%"prop"]=> - %unicode|string%(24) " Implicit instantiation!" - } - [%u|b%"emptyString"]=> - object(stdClass)#%d (1) { - [%u|b%"prop"]=> - %unicode|string%(24) " Implicit instantiation!" - } - [%u|b%"null"]=> - object(stdClass)#%d (1) { - [%u|b%"prop"]=> - %unicode|string%(24) " Implicit instantiation!" - } - [%u|b%"boolTrue"]=> - bool(true) - [%u|b%"nonEmptyString"]=> - %unicode|string%(5) "hello" - [%u|b%"intZero"]=> - int(0) -} \ No newline at end of file diff --git a/tests/classes/incdec_property_001.phpt b/tests/classes/incdec_property_001.phpt deleted file mode 100644 index 97a24d30b640d..0000000000000 --- a/tests/classes/incdec_property_001.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 post increment/decrement property of overloaded object ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -$obj->a++; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(3) ----Done--- diff --git a/tests/classes/incdec_property_002.phpt b/tests/classes/incdec_property_002.phpt deleted file mode 100644 index c1d7dded3b063..0000000000000 --- a/tests/classes/incdec_property_002.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 post increment/decrement property of overloaded object with assignment ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -$t1 = $obj->a++; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(3) ----Done--- diff --git a/tests/classes/incdec_property_003.phpt b/tests/classes/incdec_property_003.phpt deleted file mode 100644 index 1a923849f417f..0000000000000 --- a/tests/classes/incdec_property_003.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 pre increment/decrement property of overloaded object ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -++$obj->a; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(3) ----Done--- diff --git a/tests/classes/incdec_property_004.phpt b/tests/classes/incdec_property_004.phpt deleted file mode 100644 index 05e3b445ac130..0000000000000 --- a/tests/classes/incdec_property_004.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 pre increment/decrement property of overloaded object with assignment ---FILE-- -real_a = $value; - } - } - - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } -} - -$obj = new Test; -var_dump($obj->a); -$t1 = ++$obj->a; -var_dump($obj->a); -echo "---Done---\n"; -?> ---EXPECT-- -int(2) -int(3) ----Done--- diff --git a/tests/classes/inheritance.phpt b/tests/classes/inheritance.phpt deleted file mode 100644 index 070ad9147d7c7..0000000000000 --- a/tests/classes/inheritance.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Classes inheritance test ---FILE-- -a."\n"; - echo "b = ".$this->b."\n"; - } - function mul() { - return $this->a*$this->b; - } -}; - -class bar extends foo { - public $c; - function display() { /* alternative display function for class bar */ - echo "This is class bar\n"; - echo "a = ".$this->a."\n"; - echo "b = ".$this->b."\n"; - echo "c = ".$this->c."\n"; - } -}; - - -$foo1 = new foo; -$foo1->a = 2; -$foo1->b = 5; -$foo1->display(); -echo $foo1->mul()."\n"; - -echo "-----\n"; - -$bar1 = new bar; -$bar1->a = 4; -$bar1->b = 3; -$bar1->c = 12; -$bar1->display(); -echo $bar1->mul()."\n"; ---EXPECT-- -This is class foo -a = 2 -b = 5 -10 ------ -This is class bar -a = 4 -b = 3 -c = 12 -12 diff --git a/tests/classes/inheritance_002.phpt b/tests/classes/inheritance_002.phpt deleted file mode 100755 index cca528e29c89f..0000000000000 --- a/tests/classes/inheritance_002.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -ZE2 Constructor precedence ---SKIPIF-- - ---FILE-- - ---EXPECT-- -### PHP 4 style -string(17) "Child constructor" -string(16) "Base constructor" -### PHP 5 style -string(17) "Child constructor" -string(16) "Base constructor" -### Mixed style 1 -string(17) "Child constructor" -string(16) "Base constructor" -### Mixed style 2 -string(17) "Child constructor" -string(16) "Base constructor" diff --git a/tests/classes/inheritance_003.phpt b/tests/classes/inheritance_003.phpt deleted file mode 100755 index a22e5cce58f58..0000000000000 --- a/tests/classes/inheritance_003.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -ZE2 method inheritance without interfaces ---FILE-- - -===DONE=== ---EXPECTF-- - -Strict Standards: Declaration of B::f() should be compatible with that of A::f() in %sinheritance_003.php on line %d -===DONE=== diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt deleted file mode 100755 index 9c81970cc2d0c..0000000000000 --- a/tests/classes/inheritance_004.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -ZE2 method inheritance without interfaces ---FILE-- - -===DONE=== ---EXPECTF-- - -Strict Standards: Declaration of B::f() should be compatible with that of A::f() in %sinheritance_004.php on line %d -===DONE=== diff --git a/tests/classes/inheritance_005.phpt b/tests/classes/inheritance_005.phpt deleted file mode 100644 index b6f47b2a666f9..0000000000000 --- a/tests/classes/inheritance_005.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Check for inherited old-style constructor. ---FILE-- -B(); - - echo "\nAbout to construct new C: "; - $c = new C; - echo "About to invoke implicit C::B(): "; - $c->B(); - echo "About to invoke implicit C::C(): "; - $c->C(); -?> ---EXPECTF-- -About to construct new B: In A::A -About to invoke implicit B::B(): In A::A - -About to construct new C: In A::A -About to invoke implicit C::B(): In A::A -About to invoke implicit C::C(): In A::A - - diff --git a/tests/classes/inheritance_006.phpt b/tests/classes/inheritance_006.phpt deleted file mode 100644 index 7376ce1a84856..0000000000000 --- a/tests/classes/inheritance_006.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Private property inheritance check ---FILE-- - ---EXPECTF-- -object(C)#%d (2) { - ["c:private"]=> - NULL - ["c:private"]=> - NULL -} \ No newline at end of file diff --git a/tests/classes/inheritance_007.phpt b/tests/classes/inheritance_007.phpt deleted file mode 100644 index df6b96a55004e..0000000000000 --- a/tests/classes/inheritance_007.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Ensure inherited old-style constructor doesn't block other methods. ---FILE-- -getMethods()); - - -$b = new B(); -$b->a(); -$b->b(); - -?> ---EXPECTF-- -array(2) { - [0]=> - &object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %string|unicode%(1) "B" - [%u|b%"class"]=> - %string|unicode%(1) "B" - } - [1]=> - &object(ReflectionMethod)#%d (2) { - [%u|b%"name"]=> - %string|unicode%(1) "A" - [%u|b%"class"]=> - %string|unicode%(1) "B" - } -} -In A::A -In A::A -In A::B \ No newline at end of file diff --git a/tests/classes/interface_and_extends.phpt b/tests/classes/interface_and_extends.phpt deleted file mode 100755 index f9040ae4a9c04..0000000000000 --- a/tests/classes/interface_and_extends.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 a class cannot extend an interface ---SKIPIF-- - ---FILE-- -show(); - -?> -===DONE=== ---EXPECTF-- -Fatal error: Class Tester cannot extend from interface Test in %sinterface_and_extends.php on line %d diff --git a/tests/classes/interface_class.phpt b/tests/classes/interface_class.phpt deleted file mode 100644 index 22520de1f9c81..0000000000000 --- a/tests/classes/interface_class.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -ZE2 A class can only implement interfaces ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: derived cannot implement base - it is not an interface in %s on line %d diff --git a/tests/classes/interface_constant_inheritance_001.phpt b/tests/classes/interface_constant_inheritance_001.phpt deleted file mode 100644 index ae3e71e7abbee..0000000000000 --- a/tests/classes/interface_constant_inheritance_001.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Ensure an interface may not shadow an inherited constant. ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot inherit previously-inherited constant FOO from interface I1 in %s on line 6 \ No newline at end of file diff --git a/tests/classes/interface_constant_inheritance_002.phpt b/tests/classes/interface_constant_inheritance_002.phpt deleted file mode 100644 index d5001baa3de14..0000000000000 --- a/tests/classes/interface_constant_inheritance_002.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Ensure a class may not shadow a constant inherited from an interface. ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot inherit previously-inherited constant FOO from interface I in %s on line 6 \ No newline at end of file diff --git a/tests/classes/interface_constant_inheritance_003.phpt b/tests/classes/interface_constant_inheritance_003.phpt deleted file mode 100644 index a3ba815edf015..0000000000000 --- a/tests/classes/interface_constant_inheritance_003.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Ensure a class may not inherit two constants with the same name from two separate interfaces. ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot inherit previously-inherited constant FOO from interface I2 in %s on line 10 diff --git a/tests/classes/interface_constant_inheritance_004.phpt b/tests/classes/interface_constant_inheritance_004.phpt deleted file mode 100644 index 05b8972363205..0000000000000 --- a/tests/classes/interface_constant_inheritance_004.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Ensure a class may implement two interfaces which include the same constant due to inheritance. ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/interface_doubled.phpt b/tests/classes/interface_doubled.phpt deleted file mode 100644 index e1dd31fd4d8de..0000000000000 --- a/tests/classes/interface_doubled.phpt +++ /dev/null @@ -1,201 +0,0 @@ ---TEST-- -ZE2 An interface extends base interfaces ---SKIPIF-- - ---FILE-- -test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_b\n"; - -class class_b extends base implements if_a, if_b { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_b(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_c\n"; - -class class_c extends base implements if_c { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_c(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_d\n"; - -class class_d extends base implements if_d{ - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_d(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_e\n"; - -class class_e extends base implements if_a, if_b, if_c, if_d { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_e(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_f\n"; - -class class_f extends base implements if_e { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_f(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -echo "class_g\n"; - -class class_g extends base implements if_f { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} -} - -$t = new class_g(); -echo $t->test('if_a'); -echo $t->test('if_b'); -echo $t->test('if_c'); -echo $t->test('if_d'); -echo $t->test('if_e'); - -?> -===DONE=== ---EXPECTF-- -class_a -is_a(class_a, if_a) yes -is_a(class_a, if_b) no -is_a(class_a, if_c) no -is_a(class_a, if_d) no -is_a(class_a, if_e) no -class_b -is_a(class_b, if_a) yes -is_a(class_b, if_b) yes -is_a(class_b, if_c) no -is_a(class_b, if_d) no -is_a(class_b, if_e) no -class_c -is_a(class_c, if_a) yes -is_a(class_c, if_b) yes -is_a(class_c, if_c) yes -is_a(class_c, if_d) no -is_a(class_c, if_e) no -class_d -is_a(class_d, if_a) yes -is_a(class_d, if_b) yes -is_a(class_d, if_c) no -is_a(class_d, if_d) yes -is_a(class_d, if_e) no -class_e -is_a(class_e, if_a) yes -is_a(class_e, if_b) yes -is_a(class_e, if_c) yes -is_a(class_e, if_d) yes -is_a(class_e, if_e) no -class_f -is_a(class_f, if_a) no -is_a(class_f, if_b) no -is_a(class_f, if_c) no -is_a(class_f, if_d) no -is_a(class_f, if_e) yes -class_g -is_a(class_g, if_a) yes -is_a(class_g, if_b) yes -is_a(class_g, if_c) yes -is_a(class_g, if_d) yes -is_a(class_g, if_e) no -===DONE=== diff --git a/tests/classes/interface_implemented.phpt b/tests/classes/interface_implemented.phpt deleted file mode 100644 index e33a4da002d01..0000000000000 --- a/tests/classes/interface_implemented.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -ZE2 An interface is inherited ---SKIPIF-- - ---FILE-- -_is_a('base'); - echo $this->_is_a('derived_a'); - echo $this->_is_a('derived_b'); - echo $this->_is_a('derived_c'); - echo $this->_is_a('derived_d'); - echo $this->_is_a('if_a'); - echo $this->_is_a('if_b'); - echo "\n"; - } -} - -class derived_a extends base implements if_a { - function f_a() {} -} - -class derived_b extends base implements if_a, if_b { - function f_a() {} - function f_b() {} -} - -class derived_c extends derived_a implements if_b { - function f_b() {} -} - -class derived_d extends derived_c { -} - -$t = new base(); -$t->test(); - -$t = new derived_a(); -$t->test(); - -$t = new derived_b(); -$t->test(); - -$t = new derived_c(); -$t->test(); - -$t = new derived_d(); -$t->test(); - -?> ---EXPECTF-- -is_a(base, base) = yes -is_a(base, derived_a) = no -is_a(base, derived_b) = no -is_a(base, derived_c) = no -is_a(base, derived_d) = no -is_a(base, if_a) = no -is_a(base, if_b) = no - -is_a(derived_a, base) = yes -is_a(derived_a, derived_a) = yes -is_a(derived_a, derived_b) = no -is_a(derived_a, derived_c) = no -is_a(derived_a, derived_d) = no -is_a(derived_a, if_a) = yes -is_a(derived_a, if_b) = no - -is_a(derived_b, base) = yes -is_a(derived_b, derived_a) = no -is_a(derived_b, derived_b) = yes -is_a(derived_b, derived_c) = no -is_a(derived_b, derived_d) = no -is_a(derived_b, if_a) = yes -is_a(derived_b, if_b) = yes - -is_a(derived_c, base) = yes -is_a(derived_c, derived_a) = yes -is_a(derived_c, derived_b) = no -is_a(derived_c, derived_c) = yes -is_a(derived_c, derived_d) = no -is_a(derived_c, if_a) = yes -is_a(derived_c, if_b) = yes - -is_a(derived_d, base) = yes -is_a(derived_d, derived_a) = yes -is_a(derived_d, derived_b) = no -is_a(derived_d, derived_c) = yes -is_a(derived_d, derived_d) = yes -is_a(derived_d, if_a) = yes -is_a(derived_d, if_b) = yes diff --git a/tests/classes/interface_instantiate.phpt b/tests/classes/interface_instantiate.phpt deleted file mode 100644 index 61c4e6b95ba0a..0000000000000 --- a/tests/classes/interface_instantiate.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -ZE2 An interface cannot be instantiated ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Cannot instantiate interface if_a in %s on line %d diff --git a/tests/classes/interface_member.phpt b/tests/classes/interface_member.phpt deleted file mode 100644 index 329c0728b5415..0000000000000 --- a/tests/classes/interface_member.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -ZE2 An interface cannot have properties ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Interfaces may not include member variables in %s on line %d diff --git a/tests/classes/interface_method.phpt b/tests/classes/interface_method.phpt deleted file mode 100644 index 3570b359289bd..0000000000000 --- a/tests/classes/interface_method.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 An interface method must be abstract ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Interface function if_a::err() cannot contain body %s on line %d diff --git a/tests/classes/interface_method_final.phpt b/tests/classes/interface_method_final.phpt deleted file mode 100644 index 01e599c5b9e8f..0000000000000 --- a/tests/classes/interface_method_final.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 An interface method cannot be final ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d diff --git a/tests/classes/interface_method_private.phpt b/tests/classes/interface_method_private.phpt deleted file mode 100644 index aa46a033a6f7b..0000000000000 --- a/tests/classes/interface_method_private.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -ZE2 An interface method cannot be private ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Access type for interface method if_a::err() must be omitted in %s on line %d diff --git a/tests/classes/interface_must_be_implemented.phpt b/tests/classes/interface_must_be_implemented.phpt deleted file mode 100644 index a4d79704e1ef3..0000000000000 --- a/tests/classes/interface_must_be_implemented.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -ZE2 An interface must be implemented ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Class derived_a contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (if_a::f_a) in %s on line %d diff --git a/tests/classes/interface_optional_arg.phpt b/tests/classes/interface_optional_arg.phpt deleted file mode 100755 index 05f2fc41dfa82..0000000000000 --- a/tests/classes/interface_optional_arg.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 An interface method allows additional default arguments ---SKIPIF-- - ---FILE-- -bar(); - -?> ---EXPECT-- -foo - diff --git a/tests/classes/interface_optional_arg_002.phpt b/tests/classes/interface_optional_arg_002.phpt deleted file mode 100644 index 92980f65b44aa..0000000000000 --- a/tests/classes/interface_optional_arg_002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -default argument value in interface implementation ---SKIPIF-- - ---FILE-- -bar(); - -?> ---EXPECT-- -int(2) \ No newline at end of file diff --git a/tests/classes/interfaces_001.phpt b/tests/classes/interfaces_001.phpt deleted file mode 100644 index 41e1f6776d895..0000000000000 --- a/tests/classes/interfaces_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 interfaces ---SKIPIF-- - ---FILE-- -foo; - } -} - -$foo = new Exception_foo; -echo $foo->getMessage() . "\n"; - -?> ---EXPECT-- -foo - diff --git a/tests/classes/interfaces_002.phpt b/tests/classes/interfaces_002.phpt deleted file mode 100644 index d26b5349bf511..0000000000000 --- a/tests/classes/interfaces_002.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -ZE2 interface with an unimplemented method ---SKIPIF-- - ---FILE-- -foo; - } -} - -// this should die -- Exception class must be abstract... -$foo = new Exception_foo; -echo "Message: " . $foo->getMessage() . "\n"; - -?> -===DONE=== ---EXPECTF-- - -Fatal error: Class Exception_foo contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Throwable::getErrno) in %s on line %d diff --git a/tests/classes/interfaces_003.phpt b/tests/classes/interfaces_003.phpt deleted file mode 100755 index f9ab92bb151a1..0000000000000 --- a/tests/classes/interfaces_003.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 interface and __construct ---FILE-- - -===DONE=== ---EXPECTF-- - -Catchable fatal error: Argument 1 passed to MyTestClass::__construct() must be an instance of MyObject, none given, called in %sinterfaces_003.php on line %d diff --git a/tests/classes/iterators_001.phpt b/tests/classes/iterators_001.phpt deleted file mode 100755 index 02e36107822b2..0000000000000 --- a/tests/classes/iterators_001.phpt +++ /dev/null @@ -1,200 +0,0 @@ ---TEST-- -ZE2 iterators and foreach ---SKIPIF-- - ---FILE-- -num = 0; - $this->obj = $obj; - } - function rewind() { - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } -} - -class c implements IteratorAggregate { - - public $max = 3; - - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } -} - -echo "===Array===\n"; - -$a = array(0,1,2); -foreach($a as $v) { - echo "array:$v\n"; -} - -echo "===Manual===\n"; -$t = new c(); -for ($iter = $t->getIterator(); $iter->valid(); $iter->next()) { - echo $iter->current() . "\n"; -} - -echo "===foreach/std===\n"; -foreach($t as $v) { - echo "object:$v\n"; -} - -echo "===foreach/rec===\n"; -foreach($t as $v) { - foreach($t as $w) { - echo "double:$v:$w\n"; - } -} - -echo "===foreach/key===\n"; -foreach($t as $i => $v) { - echo "object:$i=>$v\n"; -} - -print "Done\n"; -exit(0); -?> ---EXPECT-- -===Array=== -array:0 -array:1 -array:2 -===Manual=== -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -0 -c_iter::next -c_iter::valid = true -c_iter::current -1 -c_iter::next -c_iter::valid = true -c_iter::current -2 -c_iter::next -c_iter::valid = false -===foreach/std=== -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -object:0 -c_iter::next -c_iter::valid = true -c_iter::current -object:1 -c_iter::next -c_iter::valid = true -c_iter::current -object:2 -c_iter::next -c_iter::valid = false -===foreach/rec=== -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -double:0:0 -c_iter::next -c_iter::valid = true -c_iter::current -double:0:1 -c_iter::next -c_iter::valid = true -c_iter::current -double:0:2 -c_iter::next -c_iter::valid = false -c_iter::next -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -double:1:0 -c_iter::next -c_iter::valid = true -c_iter::current -double:1:1 -c_iter::next -c_iter::valid = true -c_iter::current -double:1:2 -c_iter::next -c_iter::valid = false -c_iter::next -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -double:2:0 -c_iter::next -c_iter::valid = true -c_iter::current -double:2:1 -c_iter::next -c_iter::valid = true -c_iter::current -double:2:2 -c_iter::next -c_iter::valid = false -c_iter::next -c_iter::valid = false -===foreach/key=== -c::getIterator -c_iter::__construct -c_iter::valid = true -c_iter::current -c_iter::key -object:1st=>0 -c_iter::next -c_iter::valid = true -c_iter::current -c_iter::key -object:2nd=>1 -c_iter::next -c_iter::valid = true -c_iter::current -c_iter::key -object:3rd=>2 -c_iter::next -c_iter::valid = false -Done diff --git a/tests/classes/iterators_002.phpt b/tests/classes/iterators_002.phpt deleted file mode 100755 index 4a58be0324842..0000000000000 --- a/tests/classes/iterators_002.phpt +++ /dev/null @@ -1,113 +0,0 @@ ---TEST-- -ZE2 iterators and break ---SKIPIF-- - ---FILE-- -obj = $obj; - } - function rewind() { - echo __METHOD__ . "\n"; - $this->num = 0; - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } - function __destruct() { - echo __METHOD__ . "\n"; - } -} - -class c implements IteratorAggregate { - - public $max = 3; - - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } - function __destruct() { - echo __METHOD__ . "\n"; - } -} - -$t = new c(); - -foreach($t as $k => $v) { - foreach($t as $w) { - echo "double:$v:$w\n"; - break; - } -} - -unset($t); - -print "Done\n"; -?> ---EXPECT-- -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -c_iter::key -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:0:0 -c_iter::__destruct -c_iter::next -c_iter::valid = true -c_iter::current -c_iter::key -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:1:0 -c_iter::__destruct -c_iter::next -c_iter::valid = true -c_iter::current -c_iter::key -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:2:0 -c_iter::__destruct -c_iter::next -c_iter::valid = false -c_iter::__destruct -c::__destruct -Done diff --git a/tests/classes/iterators_003.phpt b/tests/classes/iterators_003.phpt deleted file mode 100755 index 42695db6ba23d..0000000000000 --- a/tests/classes/iterators_003.phpt +++ /dev/null @@ -1,115 +0,0 @@ ---TEST-- -ZE2 iterators and break ---SKIPIF-- - ---FILE-- -obj = $obj; - } - function rewind() { - echo __METHOD__ . "\n"; - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - return $this->num; - } -} - -class c implements IteratorAggregate { - - public $max = 4; - - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } -} - -$t = new c(); - -foreach($t as $v) { - if ($v == 0) { - echo "continue outer\n"; - continue; - } - foreach($t as $w) { - if ($w == 1) { - echo "continue inner\n"; - continue; - } - if ($w == 2) { - echo "break inner\n"; - break; - } - echo "double:$v:$w\n"; - } - if ($v == 2) { - echo "break outer\n"; - break; - } -} - -print "Done\n"; -?> ---EXPECT-- -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -continue outer -c_iter::next -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:1:0 -c_iter::next -c_iter::valid = true -c_iter::current -continue inner -c_iter::next -c_iter::valid = true -c_iter::current -break inner -c_iter::next -c_iter::valid = true -c_iter::current -c::getIterator -c_iter::__construct -c_iter::rewind -c_iter::valid = true -c_iter::current -double:2:0 -c_iter::next -c_iter::valid = true -c_iter::current -continue inner -c_iter::next -c_iter::valid = true -c_iter::current -break inner -break outer -Done diff --git a/tests/classes/iterators_004.phpt b/tests/classes/iterators_004.phpt deleted file mode 100755 index 3fe05276c3bf9..0000000000000 --- a/tests/classes/iterators_004.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -ZE2 iterators must be implemented ---SKIPIF-- - ---FILE-- -num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function valid() { - echo __METHOD__ . "\n"; - return $this->num < $this->max; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } -} - -$obj = new c2(); - -foreach($obj as $v => $w) { - echo "object:$v=>$w\n"; -} - -print "Done\n"; -?> ---EXPECTF-- -1st try -2nd try -object:max=>3 -object:num=>0 -Done diff --git a/tests/classes/iterators_005.phpt b/tests/classes/iterators_005.phpt deleted file mode 100755 index 005deb92a27b3..0000000000000 --- a/tests/classes/iterators_005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -ZE2 iterators cannot implement Traversable alone ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Class test must implement interface Traversable as part of either Iterator or IteratorAggregate in %s on line %d diff --git a/tests/classes/iterators_006.phpt b/tests/classes/iterators_006.phpt deleted file mode 100644 index 47fa69087a2cd..0000000000000 --- a/tests/classes/iterators_006.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -ZE2 iterators and array wrapping ---SKIPIF-- - ---FILE-- -array = array('foo', 'bar', 'baz'); - } - - function rewind() { - reset($this->array); - $this->next(); - } - - function valid() { - return $this->key !== NULL; - } - - function key() { - return $this->key; - } - - function current() { - return $this->current; - } - - function next() { - list($this->key, $this->current) = each($this->array); -// list($key, $current) = each($this->array); -// $this->key = $key; -// $this->current = $current; - } -} - -class a implements IteratorAggregate { - - public function getIterator() { - return new ai(); - } -} - -$array = new a(); - -foreach ($array as $property => $value) { - print "$property: $value\n"; -} - -#$array = $array->getIterator(); -#$array->rewind(); -#$array->valid(); -#var_dump($array->key()); -#var_dump($array->current()); -echo "===2nd===\n"; - -$array = new ai(); - -foreach ($array as $property => $value) { - print "$property: $value\n"; -} - -echo "===3rd===\n"; - -foreach ($array as $property => $value) { - print "$property: $value\n"; -} - -?> -===DONE=== ---EXPECT-- -0: foo -1: bar -2: baz -===2nd=== -0: foo -1: bar -2: baz -===3rd=== -0: foo -1: bar -2: baz -===DONE=== \ No newline at end of file diff --git a/tests/classes/iterators_007.phpt b/tests/classes/iterators_007.phpt deleted file mode 100755 index f2638b31dcc92..0000000000000 --- a/tests/classes/iterators_007.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -ZE2 iterators and exceptions ---FILE-- -x == 0) throw new Exception(__METHOD__); reset($this->arr); } - public function current() { if ($this->x == 1) throw new Exception(__METHOD__); return current($this->arr); } - public function key() { if ($this->x == 2) throw new Exception(__METHOD__); return key($this->arr); } - public function next() { if ($this->x == 3) throw new Exception(__METHOD__); next($this->arr); } - public function valid() { if ($this->x == 4) throw new Exception(__METHOD__); return (key($this->arr) !== NULL); } -} - -$t = new Test(); - -while($t->x < 5) -{ - try - { - foreach($t as $k => $v) - { - echo "Current\n"; - } - } - catch(Exception $e) - { - echo "Caught in " . $e->getMessage() . "()\n"; - } - $t->x++; -} -?> -===DONE=== ---EXPECT-- -Caught in Test::rewind() -Caught in Test::current() -Caught in Test::key() -Current -Caught in Test::next() -Caught in Test::valid() -===DONE=== diff --git a/tests/classes/method_call_variation_001.phpt b/tests/classes/method_call_variation_001.phpt deleted file mode 100644 index dd43cfd1cb533..0000000000000 --- a/tests/classes/method_call_variation_001.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -In $a->$b[Y](), $b[Y] represents a method name on $a. But in $a->X[Y](), $a->X[Y] represents a global function name. ---FILE-- -$functions[0](1, 2); - $c->$functions[1][2][3][4](3, 4); - - - function foo($a, $b) - { - echo "Called global foo($a, $b)\n"; - } - - $c->functions[0] = 'foo'; - $c->functions[1][2][3][4] = 'foo'; - - $c->functions[0](5, 6); - $c->functions[1][2][3][4](7, 8); -?> ---EXPECTF-- -Called C::foo(1, 2) -Called C::foo(3, 4) -Called global foo(5, 6) -Called global foo(7, 8) diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt deleted file mode 100644 index 53272fff737ee..0000000000000 --- a/tests/classes/method_override_optional_arg_001.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Method override allows optional default argument ---SKIPIF-- - ---FILE-- -foo(1); - -?> ---EXPECTF-- -Strict Standards: Declaration of C::foo() should be compatible with that of A::foo() in %s on line %d -int(1) -int(3) diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt deleted file mode 100644 index c212b8260d4ad..0000000000000 --- a/tests/classes/method_override_optional_arg_002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Omitting optional arg in method inherited from abstract class ---FILE-- -foo(); - -?> ---EXPECTF-- -Strict Standards: Declaration of B::foo() should be compatible with that of A::foo() in %s on line %d -foo diff --git a/tests/classes/new_001.phpt b/tests/classes/new_001.phpt deleted file mode 100644 index 8ef8a71e0ff32..0000000000000 --- a/tests/classes/new_001.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Confirm difference between assigning new directly and by reference. ---FILE-- -id = ++Inc::$counter; - } - } - - $f = new Inc(); - $k =& $f; - echo "\$f initially points to the first object:\n"; - var_dump($f); - - echo "Assigning new object directly to \$k affects \$f:\n"; - $k = new Inc(); - var_dump($f); - - echo "Assigning new object by ref to \$k removes it from \$f's reference set, so \$f is unchanged:\n"; - $k =& new Inc(); - var_dump($f); -?> ---EXPECTF-- -Strict Standards: Assigning the return value of new by reference is deprecated in %s on line 23 -Compile-time strict error message should precede this. -$f initially points to the first object: -object(Inc)#%d (1) { - ["id"]=> - int(1) -} -Assigning new object directly to $k affects $f: -object(Inc)#%d (1) { - ["id"]=> - int(2) -} -Assigning new object by ref to $k removes it from $f's reference set, so $f is unchanged: -object(Inc)#%d (1) { - ["id"]=> - int(2) -} diff --git a/tests/classes/object_reference_001.phpt b/tests/classes/object_reference_001.phpt deleted file mode 100644 index 74acb5de1360d..0000000000000 --- a/tests/classes/object_reference_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 object references ---SKIPIF-- - ---FILE-- -name = "I'm Foo!\n"; - } -} - -$foo = new Foo; -echo $foo->name; -$bar = $foo; -$bar->name = "I'm Bar!\n"; - -// In ZE1, we would expect "I'm Foo!" -echo $foo->name; - -?> ---EXPECT-- -I'm Foo! -I'm Bar! diff --git a/tests/classes/private_001.phpt b/tests/classes/private_001.phpt deleted file mode 100644 index 310b9c64343ba..0000000000000 --- a/tests/classes/private_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 A private method can only be called inside the class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context '' in %s on line %d diff --git a/tests/classes/private_002.phpt b/tests/classes/private_002.phpt deleted file mode 100644 index 258fd3a17d8fc..0000000000000 --- a/tests/classes/private_002.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in another class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call pass::show() -Call fail::show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_003.phpt b/tests/classes/private_003.phpt deleted file mode 100644 index 716efbc8c781f..0000000000000 --- a/tests/classes/private_003.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_003b.phpt b/tests/classes/private_003b.phpt deleted file mode 100644 index 780b2e6b4cb87..0000000000000 --- a/tests/classes/private_003b.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- -show(); - } -} - -class fail extends pass { - public function ok() { - $this->good(); - } - - public function not_ok() { - $this->show(); - } -} - -$t = new fail(); -$t->ok(); -$t->not_ok(); // calling a private function - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_004.phpt b/tests/classes/private_004.phpt deleted file mode 100644 index 027434ab87f57..0000000000000 --- a/tests/classes/private_004.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_004b.phpt b/tests/classes/private_004b.phpt deleted file mode 100644 index ea3fe610d37e7..0000000000000 --- a/tests/classes/private_004b.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- -show(); - } -} - -class fail extends pass { - function do_show() { - $this->show(); - } -} - -$t = new pass(); -$t->do_show(); - -$t2 = new fail(); -$t2->do_show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d \ No newline at end of file diff --git a/tests/classes/private_005.phpt b/tests/classes/private_005.phpt deleted file mode 100644 index 49b2bee3badba..0000000000000 --- a/tests/classes/private_005.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_005b.phpt b/tests/classes/private_005b.phpt deleted file mode 100644 index ea3fe610d37e7..0000000000000 --- a/tests/classes/private_005b.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A private method cannot be called in a derived class ---SKIPIF-- - ---FILE-- -show(); - } -} - -class fail extends pass { - function do_show() { - $this->show(); - } -} - -$t = new pass(); -$t->do_show(); - -$t2 = new fail(); -$t2->do_show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call show() - -Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d \ No newline at end of file diff --git a/tests/classes/private_006.phpt b/tests/classes/private_006.phpt deleted file mode 100644 index 0bb2b3fe4b1ed..0000000000000 --- a/tests/classes/private_006.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -ZE2 A private method can be overwritten in a second derived class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call show() -Call show() -Call show() -Done diff --git a/tests/classes/private_006b.phpt b/tests/classes/private_006b.phpt deleted file mode 100644 index 950f16a3c4d94..0000000000000 --- a/tests/classes/private_006b.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -ZE2 A private method can be overwritten in a second derived class ---SKIPIF-- - ---FILE-- -show(); - } -} - -$t1 = new first(); -$t1->do_show(); - -class second extends first { -} - -//$t2 = new second(); -//$t2->do_show(); - -class third extends second { - private function show() { - echo "Call show()\n"; - } -} - -$t3 = new third(); -$t3->do_show(); - -echo "Done\n"; -?> ---EXPECTF-- -Call show() -Call show() -Done \ No newline at end of file diff --git a/tests/classes/private_007.phpt b/tests/classes/private_007.phpt deleted file mode 100644 index 73a38c45627fb..0000000000000 --- a/tests/classes/private_007.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -ZE2 A derived class does not know about privates of ancestors ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Bar::priv() -Foo::priv() -Done diff --git a/tests/classes/private_007b.phpt b/tests/classes/private_007b.phpt deleted file mode 100644 index 02ddc25dece99..0000000000000 --- a/tests/classes/private_007b.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 A derived class does not know about privates of ancestors ---SKIPIF-- - ---FILE-- -priv(); - } - private function priv() { - echo "Bar::priv()\n"; - } -} -class Foo extends Bar { - public function priv() { - echo "Foo::priv()\n"; - } -} - -$obj = new Foo(); -$obj->pub(); -$obj->priv(); - -echo "Done\n"; -?> ---EXPECTF-- -Bar::priv() -Foo::priv() -Done diff --git a/tests/classes/private_members.phpt b/tests/classes/private_members.phpt deleted file mode 100755 index 1832ea0c437f6..0000000000000 --- a/tests/classes/private_members.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -ZE2 A private member is ---SKIPIF-- - ---FILE-- -member = 'base::member'; - $this->test(); - echo __METHOD__ . "(end)\n"; - } - - function test() - { - echo __METHOD__ . "\n"; - print_r($this); - } -} - -class derived extends base -{ - public $member = 'derived::member (default)'; - - function __construct() - { - echo __METHOD__ . "(begin)\n"; - parent::__construct(); - parent::test(); - $this->test(); - $this->member = 'derived::member'; - echo __METHOD__ . "(end)\n"; - } - - function test() - { - parent::test(); - echo __METHOD__ . "\n"; - print_r($this); - } -} - -$t = new derived; -$t->test(); -unset($t); - -echo "Done\n"; - -?> ---EXPECTF-- -derived::__construct(begin) -base::__construct(begin) -base::test -derived Object -( - [member] => derived::member (default) - [member:private] => base::member -) -derived::test -derived Object -( - [member] => derived::member (default) - [member:private] => base::member -) -base::__construct(end) -base::test -derived Object -( - [member] => derived::member (default) - [member:private] => base::member -) -base::test -derived Object -( - [member] => derived::member (default) - [member:private] => base::member -) -derived::test -derived Object -( - [member] => derived::member (default) - [member:private] => base::member -) -derived::__construct(end) -base::test -derived Object -( - [member] => derived::member - [member:private] => base::member -) -derived::test -derived Object -( - [member] => derived::member - [member:private] => base::member -) -Done diff --git a/tests/classes/private_redeclare.phpt b/tests/classes/private_redeclare.phpt deleted file mode 100755 index e3061f1136fac..0000000000000 --- a/tests/classes/private_redeclare.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -ZE2 A derived class does not know anything about inherited private methods ---FILE-- -show(); - } -} - -$t = new base(); -$t->test(); - -class derived extends base { - function show() { - echo "derived\n"; - } - function test() { - echo "test\n"; - $this->show(); - parent::test(); - parent::show(); - } -} - -$t = new derived(); -$t->test(); -?> ---EXPECTF-- -base -test -derived -base - -Fatal error: Call to private method base::show() from context 'derived' in %s on line %d diff --git a/tests/classes/property_override_privateStatic_private.phpt b/tests/classes/property_override_privateStatic_private.phpt deleted file mode 100644 index ddd2e5d1ac3f5..0000000000000 --- a/tests/classes/property_override_privateStatic_private.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited private static property as private. ---FILE-- -p . "\n"; - } - } - - - A::showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- -A::p (static) -A::p (static) -B::p diff --git a/tests/classes/property_override_privateStatic_privateStatic.phpt b/tests/classes/property_override_privateStatic_privateStatic.phpt deleted file mode 100644 index d7d645fd0ac65..0000000000000 --- a/tests/classes/property_override_privateStatic_privateStatic.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Redeclare inherited private static property as private static. ---FILE-- - ---EXPECTF-- -A::p (static) -A::p (static) -B::p (static) diff --git a/tests/classes/property_override_privateStatic_protected.phpt b/tests/classes/property_override_privateStatic_protected.phpt deleted file mode 100644 index d4732166c6150..0000000000000 --- a/tests/classes/property_override_privateStatic_protected.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited private static property as protected. ---FILE-- -p . "\n"; - } - } - - - A::showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- -A::p (static) -A::p (static) -B::p diff --git a/tests/classes/property_override_privateStatic_protectedStatic.phpt b/tests/classes/property_override_privateStatic_protectedStatic.phpt deleted file mode 100644 index 169ff9a3774cc..0000000000000 --- a/tests/classes/property_override_privateStatic_protectedStatic.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Redeclare inherited private static property as protected static. ---FILE-- - ---EXPECTF-- -A::p (static) -A::p (static) -B::p (static) diff --git a/tests/classes/property_override_privateStatic_public.phpt b/tests/classes/property_override_privateStatic_public.phpt deleted file mode 100644 index 033eb75231fbc..0000000000000 --- a/tests/classes/property_override_privateStatic_public.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited private static property as public. ---FILE-- -p . "\n"; - } - } - - - A::showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- -A::p (static) -A::p (static) -B::p diff --git a/tests/classes/property_override_privateStatic_publicStatic.phpt b/tests/classes/property_override_privateStatic_publicStatic.phpt deleted file mode 100644 index 5f2b6bf4a896e..0000000000000 --- a/tests/classes/property_override_privateStatic_publicStatic.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Redeclare inherited private static property as public static. ---FILE-- - ---EXPECTF-- -A::p (static) -A::p (static) -B::p (static) diff --git a/tests/classes/property_override_private_private.phpt b/tests/classes/property_override_private_private.phpt deleted file mode 100644 index 2b263eeb6734f..0000000000000 --- a/tests/classes/property_override_private_private.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited private property as private. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - private $p = "B::p"; - function showB() - { - echo $this->p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- -A::p -A::p -B::p diff --git a/tests/classes/property_override_private_privateStatic.phpt b/tests/classes/property_override_private_privateStatic.phpt deleted file mode 100644 index 606ed21d08753..0000000000000 --- a/tests/classes/property_override_private_privateStatic.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited private property as private static. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - private static $p = "B::p (static)"; - static function showB() - { - echo self::$p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - B::showB(); -?> ---EXPECTF-- -A::p -A::p -B::p (static) diff --git a/tests/classes/property_override_private_protected.phpt b/tests/classes/property_override_private_protected.phpt deleted file mode 100644 index b84ed6787e8d1..0000000000000 --- a/tests/classes/property_override_private_protected.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited private property as protected. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - protected $p = "B::p"; - function showB() - { - echo $this->p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- -A::p -A::p -B::p diff --git a/tests/classes/property_override_private_protectedStatic.phpt b/tests/classes/property_override_private_protectedStatic.phpt deleted file mode 100644 index 1bb303dab7943..0000000000000 --- a/tests/classes/property_override_private_protectedStatic.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited private property as protected static. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - protected static $p = "B::p (static)"; - static function showB() - { - echo self::$p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - B::showB(); -?> ---EXPECTF-- -A::p -A::p -B::p (static) diff --git a/tests/classes/property_override_private_public.phpt b/tests/classes/property_override_private_public.phpt deleted file mode 100644 index badbe91d5056d..0000000000000 --- a/tests/classes/property_override_private_public.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited private property as public. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - public $p = "B::p"; - function showB() - { - echo $this->p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- -A::p -A::p -B::p diff --git a/tests/classes/property_override_private_publicStatic.phpt b/tests/classes/property_override_private_publicStatic.phpt deleted file mode 100644 index 9fc58ece4ac5b..0000000000000 --- a/tests/classes/property_override_private_publicStatic.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited private property as public static. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - public static $p = "B::p (static)"; - static function showB() - { - echo self::$p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - B::showB(); -?> ---EXPECTF-- -A::p -A::p -B::p (static) diff --git a/tests/classes/property_override_protectedStatic_private.phpt b/tests/classes/property_override_protectedStatic_private.phpt deleted file mode 100644 index 18e9c78a132a4..0000000000000 --- a/tests/classes/property_override_protectedStatic_private.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited protected static property as private. ---FILE-- -p . "\n"; - } - } - - - A::showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 - diff --git a/tests/classes/property_override_protectedStatic_privateStatic.phpt b/tests/classes/property_override_protectedStatic_privateStatic.phpt deleted file mode 100644 index 688621077da5f..0000000000000 --- a/tests/classes/property_override_protectedStatic_privateStatic.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Redeclare inherited protected static property as private static. ---FILE-- - ---EXPECTF-- - -Fatal error: Access level to B::$p must be protected (as in class A) or weaker in %s on line 18 - diff --git a/tests/classes/property_override_protectedStatic_protected.phpt b/tests/classes/property_override_protectedStatic_protected.phpt deleted file mode 100644 index 0e5fdd301c54c..0000000000000 --- a/tests/classes/property_override_protectedStatic_protected.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited protected static property as protected. ---FILE-- -p . "\n"; - } - } - - - A::showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 - diff --git a/tests/classes/property_override_protectedStatic_protectedStatic.phpt b/tests/classes/property_override_protectedStatic_protectedStatic.phpt deleted file mode 100644 index 16f1100947522..0000000000000 --- a/tests/classes/property_override_protectedStatic_protectedStatic.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Redeclare inherited protected static property as protected static. ---FILE-- - ---EXPECTF-- -A::p (static) -A::p (static) -B::p (static) diff --git a/tests/classes/property_override_protectedStatic_public.phpt b/tests/classes/property_override_protectedStatic_public.phpt deleted file mode 100644 index 63033255901c6..0000000000000 --- a/tests/classes/property_override_protectedStatic_public.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited protected static property as public. ---FILE-- -p . "\n"; - } - } - - - A::showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 - diff --git a/tests/classes/property_override_protectedStatic_publicStatic.phpt b/tests/classes/property_override_protectedStatic_publicStatic.phpt deleted file mode 100644 index 7e1955dd99c22..0000000000000 --- a/tests/classes/property_override_protectedStatic_publicStatic.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Redeclare inherited protected static property as public static. ---FILE-- - ---EXPECTF-- - -Fatal error: Cannot change initial value of property static protected A::$p in class B in %s on line 18 diff --git a/tests/classes/property_override_protected_private.phpt b/tests/classes/property_override_protected_private.phpt deleted file mode 100644 index 93f0d23ebc3ba..0000000000000 --- a/tests/classes/property_override_protected_private.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited protected property as private. -Included for completeness (duplicates test Zend/tests/errmsg_023.phpt). ---FILE-- -p . "\n"; - } - } - - class B extends A - { - private $p = "B::p"; - function showB() - { - echo $this->p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- - -Fatal error: Access level to B::$p must be protected (as in class A) or weaker in %s on line 18 diff --git a/tests/classes/property_override_protected_privateStatic.phpt b/tests/classes/property_override_protected_privateStatic.phpt deleted file mode 100644 index fb7102cb3e096..0000000000000 --- a/tests/classes/property_override_protected_privateStatic.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited protected property as private static. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - private static $p = "B::p (static)"; - static function showB() - { - echo self::$p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - B::showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_protected_protected.phpt b/tests/classes/property_override_protected_protected.phpt deleted file mode 100644 index c4b0d438c0364..0000000000000 --- a/tests/classes/property_override_protected_protected.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited protected property as protected. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - protected $p = "B::p"; - function showB() - { - echo $this->p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- -A::p -B::p -B::p diff --git a/tests/classes/property_override_protected_protectedStatic.phpt b/tests/classes/property_override_protected_protectedStatic.phpt deleted file mode 100644 index 1ce4130265f40..0000000000000 --- a/tests/classes/property_override_protected_protectedStatic.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited protected property as protected static. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - protected static $p = "B::p (static)"; - static function showB() - { - echo self::$p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - B::showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_protected_public.phpt b/tests/classes/property_override_protected_public.phpt deleted file mode 100644 index 4702f9a0cfff5..0000000000000 --- a/tests/classes/property_override_protected_public.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited protected property as public. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - public $p = "B::p"; - function showB() - { - echo $this->p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- -A::p -B::p -B::p diff --git a/tests/classes/property_override_protected_publicStatic.phpt b/tests/classes/property_override_protected_publicStatic.phpt deleted file mode 100644 index 8efdf5f6fd4fe..0000000000000 --- a/tests/classes/property_override_protected_publicStatic.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited protected property as public static. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - public static $p = "B::p (static)"; - static function showB() - { - echo self::$p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - B::showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_publicStatic_private.phpt b/tests/classes/property_override_publicStatic_private.phpt deleted file mode 100644 index 7abe92c9ffc6c..0000000000000 --- a/tests/classes/property_override_publicStatic_private.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited public static property as private. ---FILE-- -p . "\n"; - } - } - - - A::showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 - diff --git a/tests/classes/property_override_publicStatic_privateStatic.phpt b/tests/classes/property_override_publicStatic_privateStatic.phpt deleted file mode 100644 index d41db6da38bb8..0000000000000 --- a/tests/classes/property_override_publicStatic_privateStatic.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Redeclare inherited public static property as private static. ---FILE-- - ---EXPECTF-- - -Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18 - diff --git a/tests/classes/property_override_publicStatic_protected.phpt b/tests/classes/property_override_publicStatic_protected.phpt deleted file mode 100644 index 884159f977139..0000000000000 --- a/tests/classes/property_override_publicStatic_protected.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited public static property as protected. ---FILE-- -p . "\n"; - } - } - - - A::showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 - diff --git a/tests/classes/property_override_publicStatic_protectedStatic.phpt b/tests/classes/property_override_publicStatic_protectedStatic.phpt deleted file mode 100644 index b022ef8049d96..0000000000000 --- a/tests/classes/property_override_publicStatic_protectedStatic.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Redeclare inherited public static property as protected static. ---FILE-- - ---EXPECTF-- - -Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18 - diff --git a/tests/classes/property_override_publicStatic_public.phpt b/tests/classes/property_override_publicStatic_public.phpt deleted file mode 100644 index d099da04743fc..0000000000000 --- a/tests/classes/property_override_publicStatic_public.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited public static property as public. ---FILE-- -p . "\n"; - } - } - - - A::showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 - diff --git a/tests/classes/property_override_publicStatic_publicStatic.phpt b/tests/classes/property_override_publicStatic_publicStatic.phpt deleted file mode 100644 index 9a868670407a9..0000000000000 --- a/tests/classes/property_override_publicStatic_publicStatic.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Redeclare inherited public static property as public static. ---FILE-- - ---EXPECTF-- -A::p (static) -A::p (static) -B::p (static) diff --git a/tests/classes/property_override_public_private.phpt b/tests/classes/property_override_public_private.phpt deleted file mode 100644 index c0f37ad95a111..0000000000000 --- a/tests/classes/property_override_public_private.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited public property as private. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - private $p = "B::p"; - function showB() - { - echo $this->p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- - -Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18 - diff --git a/tests/classes/property_override_public_privateStatic.phpt b/tests/classes/property_override_public_privateStatic.phpt deleted file mode 100644 index 36223fd345a5f..0000000000000 --- a/tests/classes/property_override_public_privateStatic.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited public property as private static. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - private static $p = "B::p (static)"; - static function showB() - { - echo self::$p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - B::showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_public_protected.phpt b/tests/classes/property_override_public_protected.phpt deleted file mode 100644 index 68fdf8286f2a3..0000000000000 --- a/tests/classes/property_override_public_protected.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited public property as protected. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - protected $p = "B::p"; - function showB() - { - echo $this->p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- - -Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18 - diff --git a/tests/classes/property_override_public_protectedStatic.phpt b/tests/classes/property_override_public_protectedStatic.phpt deleted file mode 100644 index 77e7ebf1f8034..0000000000000 --- a/tests/classes/property_override_public_protectedStatic.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited public property as protected static. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - protected static $p = "B::p (static)"; - static function showB() - { - echo self::$p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - B::showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_public_public.phpt b/tests/classes/property_override_public_public.phpt deleted file mode 100644 index 893fe5d048f15..0000000000000 --- a/tests/classes/property_override_public_public.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Redeclare inherited public property as public. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - public $p = "B::p"; - function showB() - { - echo $this->p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - $b->showB(); -?> ---EXPECTF-- -A::p -B::p -B::p diff --git a/tests/classes/property_override_public_publicStatic.phpt b/tests/classes/property_override_public_publicStatic.phpt deleted file mode 100644 index 725e947a0d849..0000000000000 --- a/tests/classes/property_override_public_publicStatic.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Redeclare inherited public property as public static. ---FILE-- -p . "\n"; - } - } - - class B extends A - { - public static $p = "B::p (static)"; - static function showB() - { - echo self::$p . "\n"; - } - } - - - $a = new A; - $a->showA(); - - $b = new B; - $b->showA(); - B::showB(); -?> ---EXPECTF-- - -Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_recreate_private.phpt b/tests/classes/property_recreate_private.phpt deleted file mode 100644 index a43e782028994..0000000000000 --- a/tests/classes/property_recreate_private.phpt +++ /dev/null @@ -1,81 +0,0 @@ ---TEST-- -Unsetting and recreating private properties. ---FILE-- -p); - } - function setPrivate() { - $this->p = 'changed'; - } -} - -class D extends C { - function setP() { - $this->p = 'changed in D'; - } -} - -echo "Unset and recreate a superclass's private property:\n"; -$d = new D; -$d->unsetPrivate(); -$d->setPrivate(); -var_dump($d); - -echo "\nUnset superclass's private property, and recreate it as public in subclass:\n"; -$d = new D; -$d->unsetPrivate(); -$d->setP(); -var_dump($d); - -echo "\nUnset superclass's private property, and recreate it as public at global scope:\n"; -$d = new D; -$d->unsetPrivate(); -$d->p = 'this will create a public property'; -var_dump($d); - - -echo "\n\nUnset and recreate a private property:\n"; -$c = new C; -$c->unsetPrivate(); -$c->setPrivate(); -var_dump($c); - -echo "\nUnset a private property, and attempt to recreate at global scope (expecting failure):\n"; -$c = new C; -$c->unsetPrivate(); -$c->p = 'this will fail'; -var_dump($c); -?> -==Done== ---EXPECTF-- -Unset and recreate a superclass's private property: -object(D)#%d (1) { - ["p:private"]=> - string(7) "changed" -} - -Unset superclass's private property, and recreate it as public in subclass: -object(D)#%d (1) { - ["p"]=> - string(12) "changed in D" -} - -Unset superclass's private property, and recreate it as public at global scope: -object(D)#%d (1) { - ["p"]=> - string(34) "this will create a public property" -} - - -Unset and recreate a private property: -object(C)#%d (1) { - ["p:private"]=> - string(7) "changed" -} - -Unset a private property, and attempt to recreate at global scope (expecting failure): - -Fatal error: Cannot access private property C::$p in %s on line 46 \ No newline at end of file diff --git a/tests/classes/property_recreate_protected.phpt b/tests/classes/property_recreate_protected.phpt deleted file mode 100644 index dbb24ecd046dd..0000000000000 --- a/tests/classes/property_recreate_protected.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Unsetting and recreating protected properties. ---FILE-- -p); - } - function setProtected() { - $this->p = 'changed'; - } -} - -class D extends C { - function setP() { - $this->p = 'changed in D'; - } -} - -$d = new D; -echo "Unset and recreate a protected property from property's declaring class scope:\n"; -$d->unsetProtected(); -$d->setProtected(); -var_dump($d); - -echo "\nUnset and recreate a protected property from subclass:\n"; -$d = new D; -$d->unsetProtected(); -$d->setP(); -var_dump($d); - -echo "\nUnset a protected property, and attempt to recreate it outside of scope (expected failure):\n"; -$d->unsetProtected(); -$d->p = 'this will fail'; -var_dump($d); -?> ---EXPECTF-- -Unset and recreate a protected property from property's declaring class scope: -object(D)#%d (1) { - ["p:protected"]=> - string(7) "changed" -} - -Unset and recreate a protected property from subclass: -object(D)#%d (1) { - ["p:protected"]=> - string(12) "changed in D" -} - -Unset a protected property, and attempt to recreate it outside of scope (expected failure): - -Fatal error: Cannot access protected property %s::$p in %s on line 32 \ No newline at end of file diff --git a/tests/classes/protected_001.phpt b/tests/classes/protected_001.phpt deleted file mode 100644 index 19872c6f16ca1..0000000000000 --- a/tests/classes/protected_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 A protected method can only be called inside the class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call fail() - -Fatal error: Call to protected method pass::fail() from context '' in %s on line %d diff --git a/tests/classes/protected_001b.phpt b/tests/classes/protected_001b.phpt deleted file mode 100644 index 4d24a926ea6b3..0000000000000 --- a/tests/classes/protected_001b.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 A protected method can only be called inside the class ---SKIPIF-- - ---FILE-- -fail(); - } -} - -$t = new pass(); -$t->good(); -$t->fail();// must fail because we are calling from outside of class pass - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call fail() - -Fatal error: Call to protected method pass::fail() from context '' in %s on line %d diff --git a/tests/classes/protected_002.phpt b/tests/classes/protected_002.phpt deleted file mode 100644 index f26ef9c495f89..0000000000000 --- a/tests/classes/protected_002.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -ZE2 A protected method cannot be called in another class ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Call pass::show() -Call fail::show() - -Fatal error: Call to protected method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/serialize_001.phpt b/tests/classes/serialize_001.phpt deleted file mode 100755 index 142fc50fcd2e7..0000000000000 --- a/tests/classes/serialize_001.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -ZE2 Serializable ---FILE-- -data = $data; - } - - function serialize() - { - echo __METHOD__ . "({$this->data})\n"; - return $this->data; - } - - function unserialize($serialized) - { - echo __METHOD__ . "($serialized)\n"; - $this->data = $serialized; - var_dump($this); - } -} - -$tests = array('String', NULL, 42, false); - -foreach($tests as $data) -{ - try - { - echo "==========\n"; - var_dump($data); - $ser = serialize(new Test($data)); - var_dump(unserialize($ser)); - } - catch(Exception $e) - { - echo 'Exception: ' . $e->getMessage() . "\n"; - } -} - -?> -===DONE=== - ---EXPECTF-- -========== -%unicode|string%(6) "String" -Test::__construct(String) -Test::serialize(String) -Test::unserialize(String) -object(Test)#%d (1) { - [%u|b%"data"]=> - %unicode|string%(6) "String" -} -object(Test)#%d (1) { - [%u|b%"data"]=> - %unicode|string%(6) "String" -} -========== -NULL -Test::__construct() -Test::serialize() -NULL -========== -int(42) -Test::__construct(42) -Test::serialize(42) -Exception: Test::serialize() must return a string or NULL -========== -bool(false) -Test::__construct() -Test::serialize() -Exception: Test::serialize() must return a string or NULL -===DONE=== diff --git a/tests/classes/singleton_001.phpt b/tests/classes/singleton_001.phpt deleted file mode 100644 index ee729b980cc7c..0000000000000 --- a/tests/classes/singleton_001.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -ZE2 singleton ---SKIPIF-- - ---FILE-- -counter; - echo "\n"; - } -} - - -class SingletonCounter { - private static $m_instance = NULL; - - static function Instance() { - if (self::$m_instance == NULL) { - self::$m_instance = new Counter(); - } - return self::$m_instance; - } -} - -SingletonCounter::Instance()->increment_and_print(); -SingletonCounter::Instance()->increment_and_print(); -SingletonCounter::Instance()->increment_and_print(); - -?> ---EXPECT-- -1 -2 -3 diff --git a/tests/classes/static_mix_1.phpt b/tests/classes/static_mix_1.phpt deleted file mode 100644 index ecc9c01a2820d..0000000000000 --- a/tests/classes/static_mix_1.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 You cannot overload a static method with a non static method ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Cannot make static method pass::show() non static in class fail in %s on line %d \ No newline at end of file diff --git a/tests/classes/static_mix_2.phpt b/tests/classes/static_mix_2.phpt deleted file mode 100644 index bbdaedf50ae1d..0000000000000 --- a/tests/classes/static_mix_2.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 You cannot overload a non static method with a static method ---SKIPIF-- - ---FILE-- -show(); -fail::show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Fatal error: Cannot make non static method pass::show() static in class fail in %s on line %d \ No newline at end of file diff --git a/tests/classes/static_properties_001.phpt b/tests/classes/static_properties_001.phpt deleted file mode 100755 index 1c34f68fc5530..0000000000000 --- a/tests/classes/static_properties_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 Initializing static properties to arrays ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -array(0) { -} -array(1) { - [0]=> - int(1) -} -Done diff --git a/tests/classes/static_properties_003.phpt b/tests/classes/static_properties_003.phpt deleted file mode 100644 index 2441e415787da..0000000000000 --- a/tests/classes/static_properties_003.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Attempting to access static properties using instance property syntax ---FILE-- - Access visible static prop like instance prop:\n"; -var_dump(isset($c->x)); -unset($c->x); -echo $c->x; -$c->x = 1; -$ref = 'ref'; -$c->x =& $ref; -var_dump($c->x, C::$x); - -echo "\n--> Access non-visible static prop like instance prop:\n"; -var_dump(isset($c->y)); -//unset($c->y); // Fatal error, tested in static_properties_003_error1.phpt -//echo $c->y; // Fatal error, tested in static_properties_003_error2.phpt -//$c->y = 1; // Fatal error, tested in static_properties_003_error3.phpt -//$c->y =& $ref; // Fatal error, tested in static_properties_003_error4.phpt -?> -==Done== ---EXPECTF-- ---> Access visible static prop like instance prop: -bool(false) - -Strict Standards: Accessing static property C::$x as non static in %s on line 11 - -Strict Standards: Accessing static property C::$x as non static in %s on line 12 - -Notice: Undefined property: C::$x in %s on line 12 - -Strict Standards: Accessing static property C::$x as non static in %s on line 13 - -Strict Standards: Accessing static property C::$x as non static in %s on line 15 - -Strict Standards: Accessing static property C::$x as non static in %s on line 16 -%unicode|string%(3) "ref" -%unicode|string%(5) "C::$x" - ---> Access non-visible static prop like instance prop: -bool(false) -==Done== \ No newline at end of file diff --git a/tests/classes/static_properties_003_error1.phpt b/tests/classes/static_properties_003_error1.phpt deleted file mode 100644 index 7a5e3d931ad3d..0000000000000 --- a/tests/classes/static_properties_003_error1.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Attempting to access static properties using instance property syntax ---FILE-- - Access non-visible static prop like instance prop:\n"; -unset($c->y); -?> -==Done== ---EXPECTF-- - ---> Access non-visible static prop like instance prop: - -Fatal error: Cannot access protected property C::$y in %s on line 8 diff --git a/tests/classes/static_properties_003_error2.phpt b/tests/classes/static_properties_003_error2.phpt deleted file mode 100644 index 589cc6909e094..0000000000000 --- a/tests/classes/static_properties_003_error2.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Attempting to access static properties using instance property syntax ---FILE-- - Access non-visible static prop like instance prop:\n"; -echo $c->y; -?> -==Done== ---EXPECTF-- - ---> Access non-visible static prop like instance prop: - -Fatal error: Cannot access protected property C::$y in %s on line 8 diff --git a/tests/classes/static_properties_003_error3.phpt b/tests/classes/static_properties_003_error3.phpt deleted file mode 100644 index 3e01e0e42b88d..0000000000000 --- a/tests/classes/static_properties_003_error3.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Attempting to access static properties using instance property syntax ---FILE-- - Access non-visible static prop like instance prop:\n"; -$c->y = 1; -?> -==Done== ---EXPECTF-- - ---> Access non-visible static prop like instance prop: - -Fatal error: Cannot access protected property C::$y in %s on line 8 diff --git a/tests/classes/static_properties_003_error4.phpt b/tests/classes/static_properties_003_error4.phpt deleted file mode 100644 index fd69a9ffb8f1e..0000000000000 --- a/tests/classes/static_properties_003_error4.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Attempting to access static properties using instance property syntax ---FILE-- - Access non-visible static prop like instance prop:\n"; -$c->y =& $ref; -?> -==Done== ---EXPECTF-- - ---> Access non-visible static prop like instance prop: - -Fatal error: Cannot access protected property C::$y in %s on line 8 diff --git a/tests/classes/static_properties_004.phpt b/tests/classes/static_properties_004.phpt deleted file mode 100644 index ce1d19dcc10c8..0000000000000 --- a/tests/classes/static_properties_004.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Inherited static properties can be separated from their reference set. ---FILE-- - -==Done== ---EXPECTF-- -Inherited static properties refer to the same value accross classes: -%unicode|string%(8) "original" -%unicode|string%(8) "original" -%unicode|string%(8) "original" - -Changing one changes all the others: -%unicode|string%(11) "changed.all" -%unicode|string%(11) "changed.all" -%unicode|string%(11) "changed.all" - -But because this is implemented using PHP references, the reference set can easily be split: -%unicode|string%(11) "changed.all" -%unicode|string%(11) "changed.one" -%unicode|string%(11) "changed.all" -==Done== \ No newline at end of file diff --git a/tests/classes/static_this.phpt b/tests/classes/static_this.phpt deleted file mode 100755 index 91b02871950a7..0000000000000 --- a/tests/classes/static_this.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -ZE2 $this can be an argument to a static function ---FILE-- -Test1(); - } - - static function Test1() - { - var_dump($this); - } - - static function Test2($this) - { - var_dump($this); - } -} - -$obj = new TestClass; -TestClass::Test2(new stdClass); - -?> -===DONE=== ---EXPECTF-- - -Notice: Undefined variable: this in %sstatic_this.php on line %d -NULL - -Notice: Undefined variable: this in %sstatic_this.php on line %d -NULL -object(stdClass)#%d (0) { -} -===DONE=== diff --git a/tests/classes/this.phpt b/tests/classes/this.phpt deleted file mode 100755 index 1d9c6236e41d8..0000000000000 --- a/tests/classes/this.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -ZE2 $this cannot be exchanged ---SKIPIF-- - ---FILE-- -prop; - print $other->prop; - } - - function indirect($other) - { - echo __METHOD__ . "\n"; - $this = $other; - $result = $this = $other; - print $result->prop; - print $this->prop; - } - - function retrieve(&$other) - { - echo __METHOD__ . "\n"; - $other = $this; - } -} - -$object = new Foo; -$object->prop = "Hello\n"; - -$other = new Foo; -$other->prop = "World\n"; - -$object->replace($other); -$object->indirect($other); - -print $object->prop; // still shows 'Hello' - -$object->retrieve($other); -print $other->prop; // shows 'Hello' - -?> -===DONE=== ---EXPECTF-- -Fatal error: Cannot re-assign $this in %sthis.php on line %d diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt deleted file mode 100755 index 53144ca207177..0000000000000 --- a/tests/classes/tostring_001.phpt +++ /dev/null @@ -1,130 +0,0 @@ ---TEST-- -ZE2 __toString() ---FILE-- -__toString()] = "ERROR"; -echo $ar[$o]; - -echo "====test8====\n"; -var_dump(trim($o)); -var_dump(trim((string)$o)); - -echo "====test9====\n"; -echo sprintf("%s", $o); - -echo "====test10====\n"; -$o = new test3; -var_dump($o); -echo $o; - -?> -====DONE==== ---EXPECTF-- -====test1==== -test1 Object -( -) -string(54) "Object of class test1 could not be converted to string" -string(0) "" -object(test1)#%d (0) { -} -====test2==== -test2 Object -( -) -test2::__toString() -Converted -object(test2)#%d (0) { -} -====test3==== -test2::__toString() -Converted -====test4==== -test2::__toString() -string:Converted -====test5==== -test2::__toString() -1Converted -1test2::__toString() -Converted -====test6==== -test2::__toString() -test2::__toString() -Converted -Converted -test2::__toString() -Converted -test2::__toString() -Converted -====test7==== -test2::__toString() -string(19) "Illegal offset type" -====test8==== -test2::__toString() -string(9) "Converted" -test2::__toString() -string(9) "Converted" -====test9==== -test2::__toString() -Converted -====test10==== -object(test3)#%d (0) { -} -test3::__toString() -string(53) "Method test3::__toString() must return a string value" -====DONE==== diff --git a/tests/classes/tostring_002.phpt b/tests/classes/tostring_002.phpt deleted file mode 100755 index 8a4a7af339908..0000000000000 --- a/tests/classes/tostring_002.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ZE2 __toString() in __destruct ---SKIPIF-- - ---FILE-- - -====DONE==== ---EXPECTF-- -Hello -====DONE==== -Hello diff --git a/tests/classes/tostring_003.phpt b/tests/classes/tostring_003.phpt deleted file mode 100755 index 8815bd9407ff7..0000000000000 --- a/tests/classes/tostring_003.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 __toString() in __destruct/exception ---FILE-- -getMessage()); -} - -?> -====DONE==== ---EXPECTF-- -Fatal error: Method Test::__toString() must not throw an exception in %stostring_003.php on line %d diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt deleted file mode 100644 index de0283e8e62a1..0000000000000 --- a/tests/classes/tostring_004.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Object to string conversion: error cases and behaviour variations. ---FILE-- - ---EXPECTF-- -Object with no __toString(): -Try 1: -Error: 4096 - Object of class stdClass could not be converted to string -Error: 8 - Object of class stdClass to string conversion -Object - -Try 2: -Error: 4096 - Object of class stdClass could not be converted to string - - - -Object with bad __toString(): -Try 1: -Error: 4096 - Method badToString::__toString() must return a string value - - -Try 2: -Error: 4096 - Method badToString::__toString() must return a string value - diff --git a/tests/classes/type_hinting_001.phpt b/tests/classes/type_hinting_001.phpt deleted file mode 100644 index f55dd53bf4c93..0000000000000 --- a/tests/classes/type_hinting_001.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -ZE2 class type hinting ---SKIPIF-- - ---FILE-- -a($b); -$a->b($b); - -?> ---EXPECTF-- - -Catchable fatal error: Argument 1 passed to FooBar::a() must implement interface Foo, instance of Blort given, called in %s on line 27 and defined in %s on line 12 diff --git a/tests/classes/type_hinting_002.phpt b/tests/classes/type_hinting_002.phpt deleted file mode 100755 index 7c685bfdba3e3..0000000000000 --- a/tests/classes/type_hinting_002.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -ZE2 class type hinting non existing class ---SKIPIF-- - ---FILE-- -a($o); -?> ---EXPECTF-- -Catchable fatal error: Argument 1 passed to Foo::a() must be an instance of NonExisting, instance of Foo given, called in %s on line %d and defined in %s on line %d diff --git a/tests/classes/type_hinting_003.phpt b/tests/classes/type_hinting_003.phpt deleted file mode 100755 index 431d66eabc263..0000000000000 --- a/tests/classes/type_hinting_003.phpt +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -ZE2 class type hinting with arrays ---FILE-- - ---EXPECTF-- -Test::f1() -array(1) { - [0]=> - int(42) -} -Test::f2() -NULL -Test::f2() -NULL -Test::f3() -array(0) { -} -Test::f4() -array(1) { - [0]=> - int(25) -} - -Catchable fatal error: Argument 1 passed to Test::f1() must be an array, integer given, called in %stype_hinting_003.php on line %d and defined in %stype_hinting_003.php on line %d diff --git a/tests/classes/type_hinting_004.phpt b/tests/classes/type_hinting_004.phpt deleted file mode 100644 index 9068909a82ae7..0000000000000 --- a/tests/classes/type_hinting_004.phpt +++ /dev/null @@ -1,109 +0,0 @@ ---TEST-- -Ensure type hints are enforced for functions invoked as callbacks. ---FILE-- - Type hints with callback function:\n"; - class A { } - function f1(A $a) { - echo "in f1;\n"; - } - function f2(A $a = null) { - echo "in f2;\n"; - } - call_user_func('f1', 1); - call_user_func('f1', new A); - call_user_func('f2', 1); - call_user_func('f2'); - call_user_func('f2', new A); - call_user_func('f2', null); - - - echo "\n\n---> Type hints with callback static method:\n"; - class C { - static function f1(A $a) { - if (isset($this)) { - echo "in C::f1 (instance);\n"; - } else { - echo "in C::f1 (static);\n"; - } - } - static function f2(A $a = null) { - if (isset($this)) { - echo "in C::f2 (instance);\n"; - } else { - echo "in C::f2 (static);\n"; - } - } - } - call_user_func(array('C', 'f1'), 1); - call_user_func(array('C', 'f1'), new A); - call_user_func(array('C', 'f2'), 1); - call_user_func(array('C', 'f2')); - call_user_func(array('C', 'f2'), new A); - call_user_func(array('C', 'f2'), null); - - - echo "\n\n---> Type hints with callback instance method:\n"; - class D { - function f1(A $a) { - if (isset($this)) { - echo "in C::f1 (instance);\n"; - } else { - echo "in C::f1 (static);\n"; - } - } - function f2(A $a = null) { - if (isset($this)) { - echo "in C::f2 (instance);\n"; - } else { - echo "in C::f2 (static);\n"; - } - } - } - $d = new D; - call_user_func(array($d, 'f1'), 1); - call_user_func(array($d, 'f1'), new A); - call_user_func(array($d, 'f2'), 1); - call_user_func(array($d, 'f2')); - call_user_func(array($d, 'f2'), new A); - call_user_func(array($d, 'f2'), null); - -?> ---EXPECTF-- ----> Type hints with callback function: -4096: Argument 1 passed to f1() must be an instance of A, integer given%s(10) -in f1; -in f1; -4096: Argument 1 passed to f2() must be an instance of A, integer given%s(13) -in f2; -in f2; -in f2; -in f2; - - ----> Type hints with callback static method: -4096: Argument 1 passed to C::f1() must be an instance of A, integer given%s(26) -in C::f1 (static); -in C::f1 (static); -4096: Argument 1 passed to C::f2() must be an instance of A, integer given%s(33) -in C::f2 (static); -in C::f2 (static); -in C::f2 (static); -in C::f2 (static); - - ----> Type hints with callback instance method: -4096: Argument 1 passed to D::f1() must be an instance of A, integer given%s(51) -in C::f1 (instance); -in C::f1 (instance); -4096: Argument 1 passed to D::f2() must be an instance of A, integer given%s(58) -in C::f2 (instance); -in C::f2 (instance); -in C::f2 (instance); -in C::f2 (instance); diff --git a/tests/classes/type_hinting_005a.phpt b/tests/classes/type_hinting_005a.phpt deleted file mode 100644 index d487a446113ec..0000000000000 --- a/tests/classes/type_hinting_005a.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Check type hint compatibility in overrides with array hints. ---FILE-- - -==DONE== ---EXPECTF-- -Strict Standards: Declaration of D2::f() should be compatible with that of C::f() in %s on line 8 -Compatible hint. -Class hint, should be array. -==DONE== \ No newline at end of file diff --git a/tests/classes/type_hinting_005b.phpt b/tests/classes/type_hinting_005b.phpt deleted file mode 100644 index bc0d7686b5e59..0000000000000 --- a/tests/classes/type_hinting_005b.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Check type hint compatibility in overrides with array hints. ---FILE-- - -==DONE== ---EXPECTF-- -Strict Standards: Declaration of D::f() should be compatible with that of C::f() in %s on line 5 -No hint, should be array. -==DONE== \ No newline at end of file diff --git a/tests/classes/type_hinting_005c.phpt b/tests/classes/type_hinting_005c.phpt deleted file mode 100644 index d3b72412cd84f..0000000000000 --- a/tests/classes/type_hinting_005c.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Check type hint compatibility in overrides with array hints. ---FILE-- - -==DONE== ---EXPECTF-- -Strict Standards: Declaration of D::f() should be compatible with that of C::f() in %s on line 5 -Array hint, should be class. -==DONE== \ No newline at end of file diff --git a/tests/classes/type_hinting_005d.phpt b/tests/classes/type_hinting_005d.phpt deleted file mode 100644 index 60dda0ff24a9c..0000000000000 --- a/tests/classes/type_hinting_005d.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Check type hint compatibility in overrides with array hints. ---FILE-- - -==DONE== ---EXPECTF-- -Strict Standards: Declaration of D::f() should be compatible with that of C::f() in %s on line 5 -Array hint, should be nothing. -==DONE== \ No newline at end of file diff --git a/tests/classes/visibility_000a.phpt b/tests/classes/visibility_000a.phpt deleted file mode 100644 index 2524494ff8e05..0000000000000 --- a/tests/classes/visibility_000a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f0() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_000b.phpt b/tests/classes/visibility_000b.phpt deleted file mode 100644 index 9305467323fd3..0000000000000 --- a/tests/classes/visibility_000b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f0() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_000c.phpt b/tests/classes/visibility_000c.phpt deleted file mode 100644 index 064106e979645..0000000000000 --- a/tests/classes/visibility_000c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_001a.phpt b/tests/classes/visibility_001a.phpt deleted file mode 100644 index ebd1cc34de2c2..0000000000000 --- a/tests/classes/visibility_001a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f1() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_001b.phpt b/tests/classes/visibility_001b.phpt deleted file mode 100644 index e61078ede5bae..0000000000000 --- a/tests/classes/visibility_001b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f1() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_001c.phpt b/tests/classes/visibility_001c.phpt deleted file mode 100644 index bb1075aaed12c..0000000000000 --- a/tests/classes/visibility_001c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_002a.phpt b/tests/classes/visibility_002a.phpt deleted file mode 100644 index 6c88d204d241f..0000000000000 --- a/tests/classes/visibility_002a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f2() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_002b.phpt b/tests/classes/visibility_002b.phpt deleted file mode 100644 index 71f47c395499f..0000000000000 --- a/tests/classes/visibility_002b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f2() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_002c.phpt b/tests/classes/visibility_002c.phpt deleted file mode 100644 index 5edae1d068dbf..0000000000000 --- a/tests/classes/visibility_002c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_003a.phpt b/tests/classes/visibility_003a.phpt deleted file mode 100644 index 1693386f814ad..0000000000000 --- a/tests/classes/visibility_003a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_003b.phpt b/tests/classes/visibility_003b.phpt deleted file mode 100644 index fcfdbe3c5543d..0000000000000 --- a/tests/classes/visibility_003b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Fatal error: Access level to fail::f3() must be protected (as in class same) or weaker in %s on line %d diff --git a/tests/classes/visibility_003c.phpt b/tests/classes/visibility_003c.phpt deleted file mode 100644 index d94a9c116b085..0000000000000 --- a/tests/classes/visibility_003c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_004a.phpt b/tests/classes/visibility_004a.phpt deleted file mode 100644 index 6f16a09eddb5b..0000000000000 --- a/tests/classes/visibility_004a.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_004b.phpt b/tests/classes/visibility_004b.phpt deleted file mode 100644 index 74a83185ee211..0000000000000 --- a/tests/classes/visibility_004b.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_004c.phpt b/tests/classes/visibility_004c.phpt deleted file mode 100644 index 92a770374e10b..0000000000000 --- a/tests/classes/visibility_004c.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ZE2 A redeclared method must have the same or higher visibility ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Done diff --git a/tests/classes/visibility_005.phpt b/tests/classes/visibility_005.phpt deleted file mode 100755 index 859a5f7b6c10a..0000000000000 --- a/tests/classes/visibility_005.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -ZE2 foreach and property visibility ---FILE-- -$v) { - echo "$k=>$v\n"; - } - } -} - -class derived extends base -{ -} - -$o = new base; -$o->d = 4; -echo "===base::function===\n"; -$o->f(); -echo "===base,foreach===\n"; -foreach($o as $k=>$v) { - echo "$k=>$v\n"; -} - -$o = new derived; -$o->d = 4; -echo "===derived::function===\n"; -$o->f(); -echo "===derived,foreach===\n"; -foreach($o as $k=>$v) { - echo "$k=>$v\n"; -} - -?> ---EXPECT-- -===base::function=== -a=>1 -b=>2 -c=>3 -d=>4 -===base,foreach=== -a=>1 -d=>4 -===derived::function=== -a=>1 -b=>2 -c=>3 -d=>4 -===derived,foreach=== -a=>1 -d=>4 diff --git a/tests/foo b/tests/foo deleted file mode 100644 index 125c655b0fe11..0000000000000 --- a/tests/foo +++ /dev/null @@ -1,5 +0,0 @@ -a -b -@c@ -d -e diff --git a/tests/foo2 b/tests/foo2 deleted file mode 100644 index 4cdd41e3dcffa..0000000000000 --- a/tests/foo2 +++ /dev/null @@ -1,3 +0,0 @@ -b(12,13)."\n"; diff --git a/tests/foo3 b/tests/foo3 deleted file mode 100644 index 08681b98c2d7a..0000000000000 --- a/tests/foo3 +++ /dev/null @@ -1,43 +0,0 @@ -print_string($a->hello_world())."\n"; -print $b->print_string($b->hello_world())."\n"; -$a->foo = 5; -print $a->foo; -print $a->foo(); diff --git a/tests/foo4 b/tests/foo4 deleted file mode 100644 index 29df84d0e2323..0000000000000 --- a/tests/foo4 +++ /dev/null @@ -1,41 +0,0 @@ -asd = 5; -print $b->asd; diff --git a/tests/func/001.phpt b/tests/func/001.phpt deleted file mode 100644 index d08040679b9de..0000000000000 --- a/tests/func/001.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Strlen() function test ---FILE-- - ---EXPECT-- -6 diff --git a/tests/func/002.phpt b/tests/func/002.phpt deleted file mode 100644 index cb35f920436ed..0000000000000 --- a/tests/func/002.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Static variables in functions ---FILE-- -5) continue; - echo "$k\n"; - } -} - -andi (3,10); ---EXPECT-- -hey -blah -hey -blah -Counting from 7 to 14 -7 -8 -9 -10 -11 -12 -13 -14 -hey -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -factorial(5) = 120 -factorial(6) = 720 -factorial(7) = 5040 -factorial(8) = 40320 -factorial(9) = 362880 -factorial(10) = 3628800 -and now, from a function... -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 -(it should break at 5...) -factorial(0) = 1 -factorial(1) = 1 -factorial(2) = 2 -factorial(3) = 6 -factorial(4) = 24 ------- -720 -840 -3 -4 -5 - diff --git a/tests/func/004.phpt b/tests/func/004.phpt deleted file mode 100644 index 1434297b0de55..0000000000000 --- a/tests/func/004.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -General function test ---FILE-- - ---EXPECT-- - -Before function declaration... -After function declaration... -Calling function for the first time... ----- -In function, printing the string "This works!" 10 times -0) This works! -1) This works! -2) This works! -3) This works! -4) This works! -5) This works! -6) This works! -7) This works! -8) This works! -9) This works! -Done with function... ------ -Returned from function call... -Calling the function for the second time... ----- -In function, printing the string "This like, really works and stuff..." 3 times -0) This like, really works and stuff... -1) This like, really works and stuff... -2) This like, really works and stuff... -Done with function... ------ -Returned from function call... -This is some other function, to ensure more than just one function works fine... diff --git a/tests/func/005.phpt b/tests/func/005.phpt deleted file mode 100644 index c4215feb4988e..0000000000000 --- a/tests/func/005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Testing register_shutdown_function() ---FILE-- - ---EXPECT-- -foo() will be called on shutdown... -foo - diff --git a/tests/func/005a.phpt b/tests/func/005a.phpt deleted file mode 100644 index f7843e10a329b..0000000000000 --- a/tests/func/005a.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Testing register_shutdown_function() with timeout. (Bug: #21513) ---FILE-- - ---EXPECT-- -Start -Shutdown diff --git a/tests/func/006.phpt b/tests/func/006.phpt deleted file mode 100644 index 077b6f873cb13..0000000000000 --- a/tests/func/006.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Output buffering tests ---INI-- -output_buffering=0 -output_handler= -zlib.output_compression=0 -zlib.output_handler= ---FILE-- - ---EXPECT-- -string(2) "2B" -string(2) "1A" diff --git a/tests/func/007.phpt b/tests/func/007.phpt deleted file mode 100644 index 73aae2e649283..0000000000000 --- a/tests/func/007.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -INI functions test ---FILE-- - ---EXPECT-- -ini_set_works -ini_restore_works diff --git a/tests/func/008.phpt b/tests/func/008.phpt deleted file mode 100644 index 48098e13302e7..0000000000000 --- a/tests/func/008.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Test for buffering in core functions with implicit flush off ---INI-- -implicit_flush=0 ---FILE-- - ---EXPECT-- -'foo1' - -'foo2' diff --git a/tests/func/009.phpt b/tests/func/009.phpt deleted file mode 100644 index 05b40e8e67eb7..0000000000000 --- a/tests/func/009.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Test for buffering in core functions with implicit flush on ---INI-- -implicit_flush=1 ---FILE-- - ---EXPECT-- -'foo1' - -'foo2' diff --git a/tests/lang/001.phpt b/tests/lang/001.phpt deleted file mode 100644 index 71df3184781dd..0000000000000 --- a/tests/lang/001.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Simple If condition test ---FILE-- -0) { echo "Yes"; } ?> ---EXPECT-- -Yes diff --git a/tests/lang/002.phpt b/tests/lang/002.phpt deleted file mode 100644 index ec14d01c3f74a..0000000000000 --- a/tests/lang/002.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Simple While Loop Test ---FILE-- - ---EXPECT-- -123456789 diff --git a/tests/lang/003.phpt b/tests/lang/003.phpt deleted file mode 100644 index 7049db90470fa..0000000000000 --- a/tests/lang/003.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Simple Switch Test ---FILE-- - ---EXPECT-- -good diff --git a/tests/lang/004.phpt b/tests/lang/004.phpt deleted file mode 100644 index be8ebf4155233..0000000000000 --- a/tests/lang/004.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Simple If/Else Test ---FILE-- - ---EXPECT-- -good diff --git a/tests/lang/005.phpt b/tests/lang/005.phpt deleted file mode 100644 index 404a7cbbf6d05..0000000000000 --- a/tests/lang/005.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Simple If/ElseIf/Else Test ---FILE-- - ---EXPECT-- -good diff --git a/tests/lang/006.phpt b/tests/lang/006.phpt deleted file mode 100644 index 2a2db013aba8d..0000000000000 --- a/tests/lang/006.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Nested If/ElseIf/Else Test ---FILE-- - ---EXPECT-- -good diff --git a/tests/lang/007.phpt b/tests/lang/007.phpt deleted file mode 100644 index 4576d4efa5323..0000000000000 --- a/tests/lang/007.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Function call with global and static variables ---FILE-- - ---EXPECT-- -1 5 2 2 10 5 2 5 3 2 10 5 3 5 4 2 diff --git a/tests/lang/008.phpt b/tests/lang/008.phpt deleted file mode 100644 index d335e6f13521e..0000000000000 --- a/tests/lang/008.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Testing recursive function ---FILE-- - ---EXPECT-- -1 2 3 4 5 6 7 8 9 diff --git a/tests/lang/009.phpt b/tests/lang/009.phpt deleted file mode 100644 index ea2aa9294dd22..0000000000000 --- a/tests/lang/009.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Testing function parameter passing ---FILE-- - ---EXPECT-- -3 diff --git a/tests/lang/010.phpt b/tests/lang/010.phpt deleted file mode 100644 index 603abe34d5613..0000000000000 --- a/tests/lang/010.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Testing function parameter passing with a return value ---FILE-- - ---EXPECT-- -2 diff --git a/tests/lang/011.phpt b/tests/lang/011.phpt deleted file mode 100644 index 771ef7c129a7a..0000000000000 --- a/tests/lang/011.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Testing nested functions ---FILE-- - ---EXPECT-- -4 Hello 4 diff --git a/tests/lang/012.phpt b/tests/lang/012.phpt deleted file mode 100644 index 117137a29b57b..0000000000000 --- a/tests/lang/012.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Testing stack after early function return ---FILE-- - ---EXPECT-- -HelloHello diff --git a/tests/lang/013.phpt b/tests/lang/013.phpt deleted file mode 100644 index be84cdcb8fa77..0000000000000 --- a/tests/lang/013.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Testing eval function ---FILE-- - ---EXPECT-- -Hello diff --git a/tests/lang/014.phpt b/tests/lang/014.phpt deleted file mode 100644 index f0033b2f77aff..0000000000000 --- a/tests/lang/014.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Testing eval function inside user-defined function ---FILE-- - ---EXPECT-- -Hello diff --git a/tests/lang/015.inc b/tests/lang/015.inc deleted file mode 100755 index d436a7bb140d2..0000000000000 --- a/tests/lang/015.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/tests/lang/015.phpt b/tests/lang/015.phpt deleted file mode 100644 index 952e7f19d74f1..0000000000000 --- a/tests/lang/015.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Testing include ---FILE-- - ---EXPECT-- -Hello diff --git a/tests/lang/016.inc b/tests/lang/016.inc deleted file mode 100755 index b73333f7b0200..0000000000000 --- a/tests/lang/016.inc +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/tests/lang/016.phpt b/tests/lang/016.phpt deleted file mode 100644 index dbaa908b81adc..0000000000000 --- a/tests/lang/016.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Testing user-defined function in included file ---FILE-- - ---EXPECT-- -Hello diff --git a/tests/lang/017.phpt b/tests/lang/017.phpt deleted file mode 100644 index fb909648209dc..0000000000000 --- a/tests/lang/017.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Testing user-defined function falling out of an If into another ---FILE-- - ---EXPECT-- -1 diff --git a/tests/lang/018.phpt b/tests/lang/018.phpt deleted file mode 100644 index 638b131c2d8ea..0000000000000 --- a/tests/lang/018.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -eval() test ---FILE-- - ---EXPECT-- -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 -In branch 1 -Inner default... -blah=100 diff --git a/tests/lang/021.phpt b/tests/lang/021.phpt deleted file mode 100644 index aff45b6be39a3..0000000000000 --- a/tests/lang/021.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Switch test 2 ---FILE-- - ---EXPECT-- -i=0 -In branch 0 -i=1 -In branch 1 -i=2 -In branch 2 -i=3 -In branch 3 -hi diff --git a/tests/lang/022.phpt b/tests/lang/022.phpt deleted file mode 100644 index dddc6c2955354..0000000000000 --- a/tests/lang/022.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Switch test 3 ---FILE-- - ---EXPECT-- -zero -one -2 -3 -4 -5 -6 -7 -8 -9 -zero -one -2 -3 -4 -5 -6 -7 -8 -9 -zero -one -2 -3 -4 -5 -6 -7 -8 -9 diff --git a/tests/lang/023-1.inc b/tests/lang/023-1.inc deleted file mode 100755 index 8d52e844c96cd..0000000000000 --- a/tests/lang/023-1.inc +++ /dev/null @@ -1,356 +0,0 @@ - - - - -*** Testing assignments and variable aliasing: ***
- -This should read "blah": \n"; ?> -This should read "this is nifty": \n"; ?> -*************************************************
- -*** Testing integer operators ***
- -Correct result - 8:
-Correct result - 8:
-Correct result - 2:
-Correct result - -2:
-Correct result - 15:
-Correct result - 15:
-Correct result - 2:
-Correct result - 3:
-*********************************
- -*** Testing real operators ***
- -Correct result - 8:
-Correct result - 8:
-Correct result - 2:
-Correct result - -2:
-Correct result - 15:
-Correct result - 15:
-Correct result - 2:
-Correct result - 3:
-*********************************
- -*** Testing if/elseif/else control ***
- -\n"; -} elseif ($a == "5") { - echo "This "." works
\n"; - $a = 6; - if ("andi" == ($test = "andi")) { - echo "this_still_works
\n"; - } elseif (1) { - echo "should_not_print
\n"; - } else { - echo "should_not_print
\n"; - } - if (44 == 43) { - echo "should_not_print
\n"; - } else { - echo "should_print
\n"; - } -} elseif ($a == 6) { - echo "this "."broken
\n"; - if (0) { - echo "this_should_not_print
\n"; - } else { - echo "TestingDanglingElse_This_Should_not_print
\n"; - } -} else { - echo "This "."does "." not"." work
\n"; -} -?> - - -*** Seriously nested if's test ***
-** spelling correction by kluzz ** -\n"; -if (0) { /* this code is not supposed to be executed */ - echo "hmm, this shouldn't be displayed #1
\n"; - $j++; - if (1) { - $i -+= - $j; - if (0) { - $j = ++$i; - if (1) { - $j *= $i; - echo "damn, this shouldn't be displayed
\n"; - } else { - $j /= $i; - ++$j; - echo "this shouldn't be displayed either
\n"; - } - } elseif (1) { - $i++; $j++; - echo "this isn't supposed to be displayed
\n"; - } - } elseif (0) { - $i++; - echo "this definitely shouldn't be displayed
\n"; - } else { - --$j; - echo "and this too shouldn't be displayed
\n"; - while ($j>0) { - $j--; - } - } -} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */ - $i = ++$j; - echo "hmm, this shouldn't be displayed #2
\n"; - if (1) { - $j = ++$i; - if (0) { - $j = $i*2+$j*($i++); - if (1) { - $i++; - echo "damn, this shouldn't be displayed
\n"; - } else { - $j++; - echo "this shouldn't be displayed either
\n"; - } - } else if (1) { - ++$j; - echo "this isn't supposed to be displayed
\n"; - } - } elseif (0) { - $j++; - echo "this definitely shouldn't be displayed
\n"; - } else { - $i++; - echo "and this too shouldn't be displayed
\n"; - } -} else { - $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */ - echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j
\n"; - if (1) { - $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */ - if (0) { - $j += 40; - if (1) { - $i += 50; - echo "damn, this shouldn't be displayed
\n"; - } else { - $j += 20; - echo "this shouldn't be displayed either
\n"; - } - } else if (1) { - $j *= $i; /* $j *= 2 --> $j == 4 */ - echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j
\n"; - echo "3 loop iterations should follow:
\n"; - while ($i<=$j) { - echo $i++." $j
\n"; - } - } - } elseif (0) { - echo "this definitely shouldn't be displayed
\n"; - } else { - echo "and this too shouldn't be displayed
\n"; - } - echo "**********************************
\n"; -} -?> - -*** C-style else-if's ***
-\n"; - } else if ($a++) { - echo "This shouldn't be displayed either
\n"; - } else if (--$a) { - echo "No, this neither
\n"; - } else if (++$a) { - echo "This should be displayed
\n"; - } else { - echo "This shouldn't be displayed at all
\n"; - } -?> -*************************
- -*** WHILE tests ***
-$j) { - echo "$i is greater than $j
\n"; - } else if ($i==$j) { - echo "$i equals $j
\n"; - } else { - echo "$i is smaller than $j
\n"; - } - $i++; -} -?> -*******************
- - -*** Nested WHILEs ***
-\n"; - -$i=0; -while ($i<$arr_len) { - $j=0; - while ($j<$arr_len) { - $k=0; - while ($k<$arr_len) { - echo "\${test$i$j}[$k] = ".${"test$i$j"}[$k]."
\n"; - $k++; - } - $j++; - } - $i++; -} -?> -*********************
- -*** hash test... ***
-\n"; -} -*/ -echo "commented out..."; -?> - -**************************
- -*** Hash resizing test ***
- 0) { - $a = $a . 'a'; - echo "$a
\n"; - $resize[$a] = $i; - $i--; -} -$i = 10; -$a = 'b'; -while ($i > 0) { - $a = $a . 'a'; - echo "$a
\n"; - echo $resize[$a]."
\n"; - $i--; -} -?> -**************************
- - -*** break/continue test ***
-\n"; -while ($i<5) { - if ($i>2) { - break; - } - $j=0; - echo "\$j should go from 3 to 4, and \$q should go from 3 to 4
\n"; - while ($j<5) { - if ($j<=2) { - $j++; - continue; - } - echo " \$j=$j
\n"; - for ($q=0; $q<=10; $q++) { - if ($q<3) { - continue; - } - if ($q>4) { - break; - } - echo " \$q=$q
\n"; - } - $j++; - } - $j=0; - echo "\$j should go from 0 to 2
\n"; - while ($j<5) { - if ($j>2) { - $k=0; - echo "\$k should go from 0 to 2
\n"; - while ($k<5) { - if ($k>2) { - break 2; - } - echo " \$k=$k
\n"; - $k++; - } - } - echo " \$j=$j
\n"; - $j++; - } - echo "\$i=$i
\n"; - $i++; -} -?> -***********************
- -*** Nested file include test ***
- -********************************
- -\n"; # testing some PHP style comment... -} -?> diff --git a/tests/lang/023-2.inc b/tests/lang/023-2.inc deleted file mode 100755 index 6dd1e730f1674..0000000000000 --- a/tests/lang/023-2.inc +++ /dev/null @@ -1,6 +0,0 @@ - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. - - - diff --git a/tests/lang/023.phpt b/tests/lang/023.phpt deleted file mode 100644 index 331308d01dc42..0000000000000 --- a/tests/lang/023.phpt +++ /dev/null @@ -1,256 +0,0 @@ ---TEST-- -Regression test ---INI-- -date.timezone=UTC ---FILE-- -PHP Regression Test - -0) { - $days = $time_left/(24*3600); - $time_left -= $days*24*3600; - $hours = $time_left/3600; - $time_left -= $hours*3600; - $minutes = $time_left/60; - echo "Limor Ullmann is getting married on ".($wedding_date=date("l, F dS, Y",$wedding_timestamp)).",\nwhich is $days days, $hours hours and $minutes minutes from now.\n"; - echo "Her hashed wedding date is $wedding_date.\n"; -} else { - echo "Limor Ullmann is now Limor Baruch :I\n"; -} -?> ---EXPECT-- -PHP Regression Test - - - - -*** Testing assignments and variable aliasing: ***
-This should read "blah": blah
-This should read "this is nifty": this is nifty
-*************************************************
- -*** Testing integer operators ***
-Correct result - 8: 8
-Correct result - 8: 8
-Correct result - 2: 2
-Correct result - -2: -2
-Correct result - 15: 15
-Correct result - 15: 15
-Correct result - 2: 2
-Correct result - 3: 3
-*********************************
- -*** Testing real operators ***
-Correct result - 8: 8
-Correct result - 8: 8
-Correct result - 2: 2
-Correct result - -2: -2
-Correct result - 15: 15
-Correct result - 15: 15
-Correct result - 2: 2
-Correct result - 3: 3
-*********************************
- -*** Testing if/elseif/else control ***
- -This works
-this_still_works
-should_print
- - -*** Seriously nested if's test ***
-** spelling correction by kluzz ** -Only two lines of text should follow:
-this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
-this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
-3 loop iterations should follow:
-2 4
-3 4
-4 4
-**********************************
- -*** C-style else-if's ***
-This should be displayed
-*************************
- -*** WHILE tests ***
-0 is smaller than 20
-1 is smaller than 20
-2 is smaller than 20
-3 is smaller than 20
-4 is smaller than 20
-5 is smaller than 20
-6 is smaller than 20
-7 is smaller than 20
-8 is smaller than 20
-9 is smaller than 20
-10 is smaller than 20
-11 is smaller than 20
-12 is smaller than 20
-13 is smaller than 20
-14 is smaller than 20
-15 is smaller than 20
-16 is smaller than 20
-17 is smaller than 20
-18 is smaller than 20
-19 is smaller than 20
-20 equals 20
-21 is greater than 20
-22 is greater than 20
-23 is greater than 20
-24 is greater than 20
-25 is greater than 20
-26 is greater than 20
-27 is greater than 20
-28 is greater than 20
-29 is greater than 20
-30 is greater than 20
-31 is greater than 20
-32 is greater than 20
-33 is greater than 20
-34 is greater than 20
-35 is greater than 20
-36 is greater than 20
-37 is greater than 20
-38 is greater than 20
-39 is greater than 20
-*******************
- - -*** Nested WHILEs ***
-Each array variable should be equal to the sum of its indices:
-${test00}[0] = 0
-${test00}[1] = 1
-${test00}[2] = 2
-${test01}[0] = 1
-${test01}[1] = 2
-${test01}[2] = 3
-${test02}[0] = 2
-${test02}[1] = 3
-${test02}[2] = 4
-${test10}[0] = 1
-${test10}[1] = 2
-${test10}[2] = 3
-${test11}[0] = 2
-${test11}[1] = 3
-${test11}[2] = 4
-${test12}[0] = 3
-${test12}[1] = 4
-${test12}[2] = 5
-${test20}[0] = 2
-${test20}[1] = 3
-${test20}[2] = 4
-${test21}[0] = 3
-${test21}[1] = 4
-${test21}[2] = 5
-${test22}[0] = 4
-${test22}[1] = 5
-${test22}[2] = 6
-*********************
- -*** hash test... ***
-commented out... -**************************
- -*** Hash resizing test ***
-ba
-baa
-baaa
-baaaa
-baaaaa
-baaaaaa
-baaaaaaa
-baaaaaaaa
-baaaaaaaaa
-baaaaaaaaaa
-ba
-10
-baa
-9
-baaa
-8
-baaaa
-7
-baaaaa
-6
-baaaaaa
-5
-baaaaaaa
-4
-baaaaaaaa
-3
-baaaaaaaaa
-2
-baaaaaaaaaa
-1
-**************************
- - -*** break/continue test ***
-$i should go from 0 to 2
-$j should go from 3 to 4, and $q should go from 3 to 4
- $j=3
- $q=3
- $q=4
- $j=4
- $q=3
- $q=4
-$j should go from 0 to 2
- $j=0
- $j=1
- $j=2
-$k should go from 0 to 2
- $k=0
- $k=1
- $k=2
-$i=0
-$j should go from 3 to 4, and $q should go from 3 to 4
- $j=3
- $q=3
- $q=4
- $j=4
- $q=3
- $q=4
-$j should go from 0 to 2
- $j=0
- $j=1
- $j=2
-$k should go from 0 to 2
- $k=0
- $k=1
- $k=2
-$i=1
-$j should go from 3 to 4, and $q should go from 3 to 4
- $j=3
- $q=3
- $q=4
- $j=4
- $q=3
- $q=4
-$j should go from 0 to 2
- $j=0
- $j=1
- $j=2
-$k should go from 0 to 2
- $k=0
- $k=1
- $k=2
-$i=2
-***********************
- -*** Nested file include test ***
- -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -********************************
- -Tests completed.
-Limor Ullmann is now Limor Baruch :I diff --git a/tests/lang/024.phpt b/tests/lang/024.phpt deleted file mode 100644 index 954b58fa052a0..0000000000000 --- a/tests/lang/024.phpt +++ /dev/null @@ -1,11623 +0,0 @@ ---TEST-- -Looped regression test (may take a while) ---FILE-- - - - -*** Testing assignments and variable aliasing: *** - -This should read "blah": -This should read "this is nifty": -************************************************* - -*** Testing integer operators *** - -Correct result - 8: - -Correct result - 8: - -Correct result - 2: - -Correct result - -2: - -Correct result - 15: - -Correct result - 15: - -Correct result - 2: - -Correct result - 3: - -********************************* - -*** Testing real operators *** - -Correct result - 8: - -Correct result - 8: - -Correct result - 2: - -Correct result - -2: - -Correct result - 15: - -Correct result - 15: - -Correct result - 2: - -Correct result - 3: - -********************************* - -*** Testing if/elseif/else control *** - - - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -0) { - $j--; - } - } -} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */ - $i = ++$j; - echo "hmm, this shouldn't be displayed #2\n"; - if (1) { - $j = ++$i; - if (0) { - $j = $i*2+$j*($i++); - if (1) { - $i++; - echo "damn, this shouldn't be displayed\n"; - } else { - $j++; - echo "this shouldn't be displayed either\n"; - } - } else if (1) { - ++$j; - echo "this isn't supposed to be displayed\n"; - } - } elseif (0) { - $j++; - echo "this definitely shouldn't be displayed\n"; - } else { - $i++; - echo "and this too shouldn't be displayed\n"; - } -} else { - $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */ - echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j\n"; - if (1) { - $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */ - if (0) { - $j += 40; - if (1) { - $i += 50; - echo "damn, this shouldn't be displayed\n"; - } else { - $j += 20; - echo "this shouldn't be displayed either\n"; - } - } else if (1) { - $j *= $i; /* $j *= 2 --> $j == 4 */ - echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j\n"; - echo "3 loop iterations should follow:\n"; - while ($i<=$j) { - echo $i++." $j\n"; - } - } - } elseif (0) { - echo "this definitely shouldn't be displayed\n"; - } else { - echo "and this too shouldn't be displayed\n"; - } - echo "**********************************\n"; -} -?> - -*** C-style else-if's *** - -************************* - -*** WHILE tests *** -$j) { - echo "$i is greater than $j\n"; - } else if ($i==$j) { - echo "$i equals $j\n"; - } else { - echo "$i is smaller than $j\n"; - } - $i++; -} -?> -******************* - - -*** Nested WHILEs *** - -********************* - -*** hash test... *** - - -************************** - -*** Hash resizing test *** - 0) { - $a = $a . "a"; - echo "$a\n"; - $resize[$a] = $i; - $i--; -} -$i = 10; -$a = "b"; -while ($i > 0) { - $a = $a . "a"; - echo "$a\n"; - echo $resize[$a]."\n"; - $i--; -} -?> -************************** - - -*** break/continue test *** -2) { - break; - } - $j=0; - echo "\$j should go from 3 to 4, and \$q should go from 3 to 4\n"; - while ($j<5) { - if ($j<=2) { - $j++; - continue; - } - echo " \$j=$j\n"; - for ($q=0; $q<=10; $q++) { - if ($q<3) { - continue; - } - if ($q>4) { - break; - } - echo " \$q=$q\n"; - } - $j++; - } - $j=0; - echo "\$j should go from 0 to 2\n"; - while ($j<5) { - if ($j>2) { - $k=0; - echo "\$k should go from 0 to 2\n"; - while ($k<5) { - if ($k>2) { - break 2; - } - echo " \$k=$k\n"; - $k++; - } - } - echo " \$j=$j\n"; - $j++; - } - echo "\$i=$i\n"; - $i++; -} -?> -*********************** - -*** Nested file include test *** - -******************************** - - ---EXPECT-- - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. diff --git a/tests/lang/025.phpt b/tests/lang/025.phpt deleted file mode 100644 index 382960f62812b..0000000000000 --- a/tests/lang/025.phpt +++ /dev/null @@ -1,531 +0,0 @@ ---TEST-- -Mean recursion test ---FILE-- - ---EXPECT-- - 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 4 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 3 a 3 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 4 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 2 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 4 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 3 a 3 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 4 a 4 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 5 a 5 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 6 a 6 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 7 a 7 a 8 a 9 - b 10 - b 9 a 9 - b 10 - b 8 a 8 a 9 - b 10 - b 9 a 9 - b 10 diff --git a/tests/lang/026.phpt b/tests/lang/026.phpt deleted file mode 100644 index eb2d6214de670..0000000000000 --- a/tests/lang/026.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -Testing string scanner confirmance ---FILE-- - ---EXPECT-- -" \'\n\'a\\b\ diff --git a/tests/lang/027.phpt b/tests/lang/027.phpt deleted file mode 100644 index d3eb74b22ffbc..0000000000000 --- a/tests/lang/027.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Testing do-while loop ---FILE-- -0); -?> ---EXPECT-- -321 diff --git a/tests/lang/028.phpt b/tests/lang/028.phpt deleted file mode 100644 index bd4525ee60e5c..0000000000000 --- a/tests/lang/028.phpt +++ /dev/null @@ -1,1058 +0,0 @@ ---TEST-- -Testing calling user-level functions from C ---FILE-- -myname = "Dafna"; - } - function GetMyName() { - return $this->myname; - } - function SetMyName($name) { - $this->myname = $name; - } -}; - -for ($i=0; $i<200; $i++): - print "$i\n"; - call_user_func("dafna"); - call_user_func("print_stuff","Hey there!!\n"); - print "$i\n"; -endfor; - - -$dafna = new dafna_class(); - -print $name=call_user_func(array(&$dafna,"GetMyName")); -print "\n"; - -?> ---EXPECT-- -0 -Dafna! -I'm still alive -Hey there!! -0 -1 -Dafna! -I'm still alive -Hey there!! -1 -2 -Dafna! -I'm still alive -Hey there!! -2 -3 -Dafna! -I'm still alive -Hey there!! -3 -4 -Dafna! -I'm still alive -Hey there!! -4 -5 -Dafna! -I'm still alive -Hey there!! -5 -6 -Dafna! -I'm still alive -Hey there!! -6 -7 -Dafna! -I'm still alive -Hey there!! -7 -8 -Dafna! -I'm still alive -Hey there!! -8 -9 -Dafna! -I'm still alive -Hey there!! -9 -10 -Dafna! -I'm still alive -Hey there!! -10 -11 -Dafna! -I'm still alive -Hey there!! -11 -12 -Dafna! -I'm still alive -Hey there!! -12 -13 -Dafna! -I'm still alive -Hey there!! -13 -14 -Dafna! -I'm still alive -Hey there!! -14 -15 -Dafna! -I'm still alive -Hey there!! -15 -16 -Dafna! -I'm still alive -Hey there!! -16 -17 -Dafna! -I'm still alive -Hey there!! -17 -18 -Dafna! -I'm still alive -Hey there!! -18 -19 -Dafna! -I'm still alive -Hey there!! -19 -20 -Dafna! -I'm still alive -Hey there!! -20 -21 -Dafna! -I'm still alive -Hey there!! -21 -22 -Dafna! -I'm still alive -Hey there!! -22 -23 -Dafna! -I'm still alive -Hey there!! -23 -24 -Dafna! -I'm still alive -Hey there!! -24 -25 -Dafna! -I'm still alive -Hey there!! -25 -26 -Dafna! -I'm still alive -Hey there!! -26 -27 -Dafna! -I'm still alive -Hey there!! -27 -28 -Dafna! -I'm still alive -Hey there!! -28 -29 -Dafna! -I'm still alive -Hey there!! -29 -30 -Dafna! -I'm still alive -Hey there!! -30 -31 -Dafna! -I'm still alive -Hey there!! -31 -32 -Dafna! -I'm still alive -Hey there!! -32 -33 -Dafna! -I'm still alive -Hey there!! -33 -34 -Dafna! -I'm still alive -Hey there!! -34 -35 -Dafna! -I'm still alive -Hey there!! -35 -36 -Dafna! -I'm still alive -Hey there!! -36 -37 -Dafna! -I'm still alive -Hey there!! -37 -38 -Dafna! -I'm still alive -Hey there!! -38 -39 -Dafna! -I'm still alive -Hey there!! -39 -40 -Dafna! -I'm still alive -Hey there!! -40 -41 -Dafna! -I'm still alive -Hey there!! -41 -42 -Dafna! -I'm still alive -Hey there!! -42 -43 -Dafna! -I'm still alive -Hey there!! -43 -44 -Dafna! -I'm still alive -Hey there!! -44 -45 -Dafna! -I'm still alive -Hey there!! -45 -46 -Dafna! -I'm still alive -Hey there!! -46 -47 -Dafna! -I'm still alive -Hey there!! -47 -48 -Dafna! -I'm still alive -Hey there!! -48 -49 -Dafna! -I'm still alive -Hey there!! -49 -50 -Dafna! -I'm still alive -Hey there!! -50 -51 -Dafna! -I'm still alive -Hey there!! -51 -52 -Dafna! -I'm still alive -Hey there!! -52 -53 -Dafna! -I'm still alive -Hey there!! -53 -54 -Dafna! -I'm still alive -Hey there!! -54 -55 -Dafna! -I'm still alive -Hey there!! -55 -56 -Dafna! -I'm still alive -Hey there!! -56 -57 -Dafna! -I'm still alive -Hey there!! -57 -58 -Dafna! -I'm still alive -Hey there!! -58 -59 -Dafna! -I'm still alive -Hey there!! -59 -60 -Dafna! -I'm still alive -Hey there!! -60 -61 -Dafna! -I'm still alive -Hey there!! -61 -62 -Dafna! -I'm still alive -Hey there!! -62 -63 -Dafna! -I'm still alive -Hey there!! -63 -64 -Dafna! -I'm still alive -Hey there!! -64 -65 -Dafna! -I'm still alive -Hey there!! -65 -66 -Dafna! -I'm still alive -Hey there!! -66 -67 -Dafna! -I'm still alive -Hey there!! -67 -68 -Dafna! -I'm still alive -Hey there!! -68 -69 -Dafna! -I'm still alive -Hey there!! -69 -70 -Dafna! -I'm still alive -Hey there!! -70 -71 -Dafna! -I'm still alive -Hey there!! -71 -72 -Dafna! -I'm still alive -Hey there!! -72 -73 -Dafna! -I'm still alive -Hey there!! -73 -74 -Dafna! -I'm still alive -Hey there!! -74 -75 -Dafna! -I'm still alive -Hey there!! -75 -76 -Dafna! -I'm still alive -Hey there!! -76 -77 -Dafna! -I'm still alive -Hey there!! -77 -78 -Dafna! -I'm still alive -Hey there!! -78 -79 -Dafna! -I'm still alive -Hey there!! -79 -80 -Dafna! -I'm still alive -Hey there!! -80 -81 -Dafna! -I'm still alive -Hey there!! -81 -82 -Dafna! -I'm still alive -Hey there!! -82 -83 -Dafna! -I'm still alive -Hey there!! -83 -84 -Dafna! -I'm still alive -Hey there!! -84 -85 -Dafna! -I'm still alive -Hey there!! -85 -86 -Dafna! -I'm still alive -Hey there!! -86 -87 -Dafna! -I'm still alive -Hey there!! -87 -88 -Dafna! -I'm still alive -Hey there!! -88 -89 -Dafna! -I'm still alive -Hey there!! -89 -90 -Dafna! -I'm still alive -Hey there!! -90 -91 -Dafna! -I'm still alive -Hey there!! -91 -92 -Dafna! -I'm still alive -Hey there!! -92 -93 -Dafna! -I'm still alive -Hey there!! -93 -94 -Dafna! -I'm still alive -Hey there!! -94 -95 -Dafna! -I'm still alive -Hey there!! -95 -96 -Dafna! -I'm still alive -Hey there!! -96 -97 -Dafna! -I'm still alive -Hey there!! -97 -98 -Dafna! -I'm still alive -Hey there!! -98 -99 -Dafna! -I'm still alive -Hey there!! -99 -100 -Dafna! -I'm still alive -Hey there!! -100 -101 -Dafna! -I'm still alive -Hey there!! -101 -102 -Dafna! -I'm still alive -Hey there!! -102 -103 -Dafna! -I'm still alive -Hey there!! -103 -104 -Dafna! -I'm still alive -Hey there!! -104 -105 -Dafna! -I'm still alive -Hey there!! -105 -106 -Dafna! -I'm still alive -Hey there!! -106 -107 -Dafna! -I'm still alive -Hey there!! -107 -108 -Dafna! -I'm still alive -Hey there!! -108 -109 -Dafna! -I'm still alive -Hey there!! -109 -110 -Dafna! -I'm still alive -Hey there!! -110 -111 -Dafna! -I'm still alive -Hey there!! -111 -112 -Dafna! -I'm still alive -Hey there!! -112 -113 -Dafna! -I'm still alive -Hey there!! -113 -114 -Dafna! -I'm still alive -Hey there!! -114 -115 -Dafna! -I'm still alive -Hey there!! -115 -116 -Dafna! -I'm still alive -Hey there!! -116 -117 -Dafna! -I'm still alive -Hey there!! -117 -118 -Dafna! -I'm still alive -Hey there!! -118 -119 -Dafna! -I'm still alive -Hey there!! -119 -120 -Dafna! -I'm still alive -Hey there!! -120 -121 -Dafna! -I'm still alive -Hey there!! -121 -122 -Dafna! -I'm still alive -Hey there!! -122 -123 -Dafna! -I'm still alive -Hey there!! -123 -124 -Dafna! -I'm still alive -Hey there!! -124 -125 -Dafna! -I'm still alive -Hey there!! -125 -126 -Dafna! -I'm still alive -Hey there!! -126 -127 -Dafna! -I'm still alive -Hey there!! -127 -128 -Dafna! -I'm still alive -Hey there!! -128 -129 -Dafna! -I'm still alive -Hey there!! -129 -130 -Dafna! -I'm still alive -Hey there!! -130 -131 -Dafna! -I'm still alive -Hey there!! -131 -132 -Dafna! -I'm still alive -Hey there!! -132 -133 -Dafna! -I'm still alive -Hey there!! -133 -134 -Dafna! -I'm still alive -Hey there!! -134 -135 -Dafna! -I'm still alive -Hey there!! -135 -136 -Dafna! -I'm still alive -Hey there!! -136 -137 -Dafna! -I'm still alive -Hey there!! -137 -138 -Dafna! -I'm still alive -Hey there!! -138 -139 -Dafna! -I'm still alive -Hey there!! -139 -140 -Dafna! -I'm still alive -Hey there!! -140 -141 -Dafna! -I'm still alive -Hey there!! -141 -142 -Dafna! -I'm still alive -Hey there!! -142 -143 -Dafna! -I'm still alive -Hey there!! -143 -144 -Dafna! -I'm still alive -Hey there!! -144 -145 -Dafna! -I'm still alive -Hey there!! -145 -146 -Dafna! -I'm still alive -Hey there!! -146 -147 -Dafna! -I'm still alive -Hey there!! -147 -148 -Dafna! -I'm still alive -Hey there!! -148 -149 -Dafna! -I'm still alive -Hey there!! -149 -150 -Dafna! -I'm still alive -Hey there!! -150 -151 -Dafna! -I'm still alive -Hey there!! -151 -152 -Dafna! -I'm still alive -Hey there!! -152 -153 -Dafna! -I'm still alive -Hey there!! -153 -154 -Dafna! -I'm still alive -Hey there!! -154 -155 -Dafna! -I'm still alive -Hey there!! -155 -156 -Dafna! -I'm still alive -Hey there!! -156 -157 -Dafna! -I'm still alive -Hey there!! -157 -158 -Dafna! -I'm still alive -Hey there!! -158 -159 -Dafna! -I'm still alive -Hey there!! -159 -160 -Dafna! -I'm still alive -Hey there!! -160 -161 -Dafna! -I'm still alive -Hey there!! -161 -162 -Dafna! -I'm still alive -Hey there!! -162 -163 -Dafna! -I'm still alive -Hey there!! -163 -164 -Dafna! -I'm still alive -Hey there!! -164 -165 -Dafna! -I'm still alive -Hey there!! -165 -166 -Dafna! -I'm still alive -Hey there!! -166 -167 -Dafna! -I'm still alive -Hey there!! -167 -168 -Dafna! -I'm still alive -Hey there!! -168 -169 -Dafna! -I'm still alive -Hey there!! -169 -170 -Dafna! -I'm still alive -Hey there!! -170 -171 -Dafna! -I'm still alive -Hey there!! -171 -172 -Dafna! -I'm still alive -Hey there!! -172 -173 -Dafna! -I'm still alive -Hey there!! -173 -174 -Dafna! -I'm still alive -Hey there!! -174 -175 -Dafna! -I'm still alive -Hey there!! -175 -176 -Dafna! -I'm still alive -Hey there!! -176 -177 -Dafna! -I'm still alive -Hey there!! -177 -178 -Dafna! -I'm still alive -Hey there!! -178 -179 -Dafna! -I'm still alive -Hey there!! -179 -180 -Dafna! -I'm still alive -Hey there!! -180 -181 -Dafna! -I'm still alive -Hey there!! -181 -182 -Dafna! -I'm still alive -Hey there!! -182 -183 -Dafna! -I'm still alive -Hey there!! -183 -184 -Dafna! -I'm still alive -Hey there!! -184 -185 -Dafna! -I'm still alive -Hey there!! -185 -186 -Dafna! -I'm still alive -Hey there!! -186 -187 -Dafna! -I'm still alive -Hey there!! -187 -188 -Dafna! -I'm still alive -Hey there!! -188 -189 -Dafna! -I'm still alive -Hey there!! -189 -190 -Dafna! -I'm still alive -Hey there!! -190 -191 -Dafna! -I'm still alive -Hey there!! -191 -192 -Dafna! -I'm still alive -Hey there!! -192 -193 -Dafna! -I'm still alive -Hey there!! -193 -194 -Dafna! -I'm still alive -Hey there!! -194 -195 -Dafna! -I'm still alive -Hey there!! -195 -196 -Dafna! -I'm still alive -Hey there!! -196 -197 -Dafna! -I'm still alive -Hey there!! -197 -198 -Dafna! -I'm still alive -Hey there!! -198 -199 -Dafna! -I'm still alive -Hey there!! -199 -Dafna - diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt deleted file mode 100644 index 758369bf0848e..0000000000000 --- a/tests/lang/030.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -$this in constructor test ---FILE-- -Name = $name; - $GLOBALS['List']->echoName(); - } - - function echoName() { - $GLOBALS['names'][]=$this->Name; - } -} - -function &foo2(&$foo) { - return $foo; -} - - -$bar1 =new foo('constructor'); -$bar1->Name = 'outside'; -$bar1->echoName(); -$List->echoName(); - -$bar1 =& foo2(new foo('constructor')); -$bar1->Name = 'outside'; -$bar1->echoName(); - -$List->echoName(); - -print ($names==array('constructor','outside','outside','constructor','outside','outside')) ? 'success':'failure'; -?> ---EXPECT-- -success diff --git a/tests/lang/031.phpt b/tests/lang/031.phpt deleted file mode 100644 index b2d1e631ecc58..0000000000000 --- a/tests/lang/031.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -Bug #16227 (Internal hash position bug on assignment) ---FILE-- - ---EXPECT-- -Correct - with inner loop reset. -inloop 0 for key1 -inloop 1 for key1 -inloop 0 for key2 -inloop 1 for key2 -What happens without inner loop reset. -inloop 0 for key1 -inloop 1 for key1 -What happens without inner loop reset but copy. -inloop 0 for key1 -inloop 1 for key1 -inloop 0 for key2 -inloop 1 for key2 -What happens with inner loop reset over copy. -inloop 0 for key1 -inloop 1 for key1 -inloop 0 for key2 -inloop 1 for key2 diff --git a/tests/lang/032.phpt b/tests/lang/032.phpt deleted file mode 100644 index caa4c7e4302b0..0000000000000 --- a/tests/lang/032.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Class method registration ---FILE-- - ---EXPECT-- -OK - diff --git a/tests/lang/033.phpt b/tests/lang/033.phpt deleted file mode 100644 index 724c67b225af4..0000000000000 --- a/tests/lang/033.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Alternative syntaxes test ---SKIPIF-- -=')) echo "skip removed in Zend Engine 2\n"; ?> ---FILE-- - ---EXPECT-- -If: 11 -While: 12346789 -For: 0123401234 -Switch: 1 -old_function: foo(1, 2); diff --git a/tests/lang/034.phpt b/tests/lang/034.phpt deleted file mode 100644 index e442db8ff168e..0000000000000 --- a/tests/lang/034.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #12647 (Locale settings affecting float parsing) ---INI-- -precision=14 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -3,14 diff --git a/tests/lang/035.phpt b/tests/lang/035.phpt deleted file mode 100644 index 9472999f47167..0000000000000 --- a/tests/lang/035.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -ZE2: set_exception_handler() ---SKIPIF-- - ---FILE-- -error = $_error; - } - - function getException() - { - return $this->error; - } -} - -function ThrowException() -{ - throw new MyException("'This is an exception!'"); -} - - -try { -} catch (MyException $exception) { - print "There shouldn't be an exception: " . $exception->getException(); - print "\n"; -} - -try { - ThrowException(); -} catch (MyException $exception) { - print "There was an exception: " . $exception->getException(); - print "\n"; -} -?> ---EXPECT-- -There was an exception: 'This is an exception!' diff --git a/tests/lang/036.phpt b/tests/lang/036.phpt deleted file mode 100755 index 474316e363a79..0000000000000 --- a/tests/lang/036.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Child public element should not override parent private element in parent methods ---FILE-- -id; - } -}; - -class chld extends par { - public $id = "bar"; - function displayHim() - { - parent::displayMe(); - } -}; - - -$obj = new chld(); -$obj->displayHim(); -?> ---EXPECT-- -foo diff --git a/tests/lang/037.phpt b/tests/lang/037.phpt deleted file mode 100755 index c2a1ee312f6b6..0000000000000 --- a/tests/lang/037.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -'Static' binding for private variables ---FILE-- -displayChild(); - } -}; - -class chld extends par { - private $id = "bar"; - - function displayChild() - { - print $this->id; - } -}; - - -$obj = new chld(); -$obj->displayMe(); - -?> ---EXPECT-- -bar diff --git a/tests/lang/038.phpt b/tests/lang/038.phpt deleted file mode 100755 index 195050b2fbc08..0000000000000 --- a/tests/lang/038.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Convert warnings to exceptions ---FILE-- -file = $errfile; - $this->line = $errline; - } -} - -function Error2Exception($errno, $errstr, $errfile, $errline) -{ - throw new MyException($errstr, $errno);//, $errfile, $errline); -} - -$err_msg = 'no exception'; -set_error_handler('Error2Exception'); - -try -{ - $con = fopen("/tmp/a_file_that_does_not_exist",'r'); -} -catch (Exception $e) -{ - $trace = $e->getTrace(); - var_dump($trace[0]['function']); - var_dump($trace[1]['function']); -} - -?> -===DONE=== - ---EXPECTF-- -string(15) "Error2Exception" -string(5) "fopen" -===DONE=== diff --git a/tests/lang/039.phpt b/tests/lang/039.phpt deleted file mode 100755 index aa4b5916497d6..0000000000000 --- a/tests/lang/039.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Catch Interfaces ---FILE-- -file = $errfile; - $this->line = $errline; - } -} - -function Error2Exception($errno, $errstr, $errfile, $errline) -{ - throw new MyException($errstr, $errno, $errfile, $errline); -} - -$err_msg = 'no exception'; -set_error_handler('Error2Exception'); - -try -{ - $con = fopen('/tmp/a_file_that_does_not_exist','r'); -} -catch (Catchable $e) -{ - echo "Catchable\n"; -} -catch (Exception $e) -{ - echo "Exception\n"; -} - -?> -===DONE=== ---EXPECTF-- -Catchable -===DONE=== diff --git a/tests/lang/040.phpt b/tests/lang/040.phpt deleted file mode 100755 index 6d8ece96799e8..0000000000000 --- a/tests/lang/040.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -foreach into array ---FILE-- - -===DONE=== ---EXPECT-- -0 -1 -===DONE=== diff --git a/tests/lang/bison1.phpt b/tests/lang/bison1.phpt deleted file mode 100644 index 3571576fb8347..0000000000000 --- a/tests/lang/bison1.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bison weirdness ---FILE-- - ---EXPECT-- -blah- diff --git a/tests/lang/bug17115.phpt b/tests/lang/bug17115.phpt deleted file mode 100644 index 0cb3bf44d2e6b..0000000000000 --- a/tests/lang/bug17115.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #17115 (lambda functions produce segfault with static vars) ---FILE-- - ---EXPECT-- -int(0) -int(1) -int(2) diff --git a/tests/lang/bug18872.phpt b/tests/lang/bug18872.phpt deleted file mode 100644 index 2e3dc22c5824a..0000000000000 --- a/tests/lang/bug18872.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #18872 (class constant used as default parameter) ---FILE-- - ---EXPECT-- -3 -3 diff --git a/tests/lang/bug19566.phpt b/tests/lang/bug19566.phpt deleted file mode 100644 index 45c3bc588e2d3..0000000000000 --- a/tests/lang/bug19566.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #19566 (get_declared_classes() segfaults) ---FILE-- - ---EXPECTF-- -int(%d) diff --git a/tests/lang/bug19943.phpt b/tests/lang/bug19943.phpt deleted file mode 100644 index 294a320bf7cbf..0000000000000 --- a/tests/lang/bug19943.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #19943 (memleaks) ---FILE-- - ---EXPECT-- -0 -- 0 -1 -- 1 -2 -- 2 -3 -- 3 -4 -- 4 -5 -- 5 -6 -- 6 -7 -- 7 -8 -- 8 -9 -- 9 -string(10) "0123456780" diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt deleted file mode 100644 index 86cac271fa6a9..0000000000000 --- a/tests/lang/bug20175.phpt +++ /dev/null @@ -1,169 +0,0 @@ ---TEST-- -Bug #20175 (Static vars can't store ref to new instance) ---SKIPIF-- - ---INI-- -error_reporting=4095 ---FILE-- -oop_name = 'oop:' . ++$oop_global; - } -} - -class oop_test { - static $oop_value; - - function oop_test() { - echo "oop_test()\n"; - } - - function oop_static() { - echo "oop_static()\n"; - if (!isset(self::$oop_value)) { - self::$oop_value = & new oop_class; - } - echo self::$oop_value->oop_name; - } -} - -print foo_static()."\n"; -print foo_static()."\n"; -print bar_static()."\n"; -print bar_static()."\n"; -//print wow_static()."\n"; -//print wow_static()."\n"; -echo "wow_static() -wow_global() -wow:1 -wow_static() -wow:1 -"; -$oop_tester = new oop_test; -print $oop_tester->oop_static()."\n"; -print $oop_tester->oop_static()."\n"; -$oop_tester = new oop_test; // repeated. -print $oop_tester->oop_static()."\n"; -?> ---EXPECTF-- -Strict Standards: Assigning the return value of new by reference is deprecated in %s.php on line %d -%s -foo_static() -foo_global() -foo:1 -foo_static() -foo:1 -bar_static() -bar_global() - -Strict Standards: Only variables should be assigned by reference in %sbug20175.php on line 47 -bar:1 -bar_static() -bar:1 -wow_static() -wow_global() -wow:1 -wow_static() -wow:1 -oop_test() -oop_static() -oop_class() -oop:1 -oop_static() -oop:1 -oop_test() -oop_static() -oop:1 diff --git a/tests/lang/bug21094.phpt b/tests/lang/bug21094.phpt deleted file mode 100644 index 266a1d6c8fab3..0000000000000 --- a/tests/lang/bug21094.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #21094 (set_error_handler not accepting methods) ---FILE-- - ---EXPECTF-- -[1024] errstr: test, errfile: %s, errline: %d - diff --git a/tests/lang/bug21600.phpt b/tests/lang/bug21600.phpt deleted file mode 100644 index 6ecf69a11f7f8..0000000000000 --- a/tests/lang/bug21600.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Bug #21600 (assign by reference function call changes variable contents) ---INI-- -error_reporting=4095 ---FILE-- - ---EXPECTF-- -Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 4 -array(1) { - ["foo"]=> - string(4) "test" -} - -Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 11 -array(1) { - ["foo"]=> - string(4) "test" -} diff --git a/tests/lang/bug21669.phpt b/tests/lang/bug21669.phpt deleted file mode 100644 index 643b0695ee755..0000000000000 --- a/tests/lang/bug21669.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #21669 ("$obj = new $this->var;" doesn't work) ---FILE-- -name; /* Parse error */ - return $obj; - } -} -$factory = new Factory; -$test = $factory->create(); -$test->say_hello(); -?> ---EXPECT-- -Hello world diff --git a/tests/lang/bug21820.phpt b/tests/lang/bug21820.phpt deleted file mode 100644 index 0ca233ea84113..0000000000000 --- a/tests/lang/bug21820.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #21820 ("$arr['foo']" generates bogus E_NOTICE, should be E_PARSE) ---FILE-- - 'bar'); -echo "$arr['foo']"; - -?> ---EXPECTREGEX-- -Parse error: (parse|syntax) error, .*expecting `?T_STRING'? or `?T_VARIABLE'? or `?T_NUM_STRING'? in .*bug21820.php on line .* diff --git a/tests/lang/bug21849.phpt b/tests/lang/bug21849.phpt deleted file mode 100644 index 30b311320bebf..0000000000000 --- a/tests/lang/bug21849.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #21849 (self::constant doesn't work as method's default parameter) ---FILE-- - ---EXPECT-- -fubar diff --git a/tests/lang/bug21961.phpt b/tests/lang/bug21961.phpt deleted file mode 100644 index 24581d663e8c2..0000000000000 --- a/tests/lang/bug21961.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -Bug #21961 (get_parent_class() segfault) ---SKIPIF-- - ---FILE-- -name = 'Mr. X'; - $this->bars = array(); - } - - function getdrunk($where) - { - $this->bars[] = new bar($where); - } - - function getName() - { - return $this->name; - } -} - -class bar extends man -{ - public $name; - - function bar($w) - { - $this->name = $w; - } - - function getName() - { - return $this->name; - } - - function whosdrunk() - { - $who = get_parent_class($this); - if($who == NULL) - { - return 'nobody'; - } - return eval("return ".$who.'::getName();'); - } -} - -$x = new man; -$x->getdrunk('The old Tavern'); -var_dump($x->bars[0]->whosdrunk()); -?> ---EXPECT-- -string(14) "The old Tavern" diff --git a/tests/lang/bug22231.phpt b/tests/lang/bug22231.phpt deleted file mode 100644 index b6842c7cf6a61..0000000000000 --- a/tests/lang/bug22231.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Bug #22231 (segfault when returning a global variable by reference) ---INI-- -error_reporting=4095 ---FILE-- -fubar); -unset($bar); -$bar = &foo(); -var_dump($bar->fubar); - -$foo = &foo(); -var_dump($foo); -var_dump($foo->fubar); -unset($foo); -$foo = &foo(); -var_dump($foo->fubar); -?> ---EXPECTF-- -Strict Standards: Assigning the return value of new by reference is deprecated in %s on line %d -object(foo)#%d (1) { - ["fubar"]=> - string(5) "fubar" -} -string(5) "fubar" -string(5) "fubar" -object(foo)#%d (1) { - ["fubar"]=> - string(5) "fubar" -} -string(5) "fubar" -string(5) "fubar" diff --git a/tests/lang/bug22510.phpt b/tests/lang/bug22510.phpt deleted file mode 100644 index 450bbb577d938..0000000000000 --- a/tests/lang/bug22510.phpt +++ /dev/null @@ -1,126 +0,0 @@ ---TEST-- -Bug #22510 (segfault among complex references) ---INI-- -error_reporting=4095 ---FILE-- -list; - } - - function &method1() { - print __CLASS__."::".__FUNCTION__."\n"; - return @$this->foo; - } - - function &method2() { - print __CLASS__."::".__FUNCTION__."\n"; - return $this->foo; - } - - function method3() { - print __CLASS__."::".__FUNCTION__."\n"; - return @$this->foo; - } -} - -class bar -{ - function run1() { - print __CLASS__."::".__FUNCTION__."\n"; - $this->instance = new foo(); - $this->instance->method1($this); - $this->instance->method1($this); - } - - function run2() { - print __CLASS__."::".__FUNCTION__."\n"; - $this->instance = new foo(); - $this->instance->method2($this); - $this->instance->method2($this); - } - - function run3() { - print __CLASS__."::".__FUNCTION__."\n"; - $this->instance = new foo(); - $this->instance->method3($this); - $this->instance->method3($this); - } -} - -function ouch(&$bar) { - print __FUNCTION__."\n"; - @$a = $a; - $bar->run1(); -} - -function ok1(&$bar) { - print __FUNCTION__."\n"; - $bar->run1(); -} - -function ok2(&$bar) { - print __FUNCTION__."\n"; - @$a = $a; - $bar->run2(); -} - -function ok3(&$bar) { - print __FUNCTION__."\n"; - @$a = $a; - $bar->run3(); -} - -$bar = &new bar(); -ok1($bar); -$bar->instance->finalize(); -print "done!\n"; -ok2($bar); -$bar->instance->finalize(); -print "done!\n"; -ok3($bar); -$bar->instance->finalize(); -print "done!\n"; -ouch($bar); -$bar->instance->finalize(); -print "I'm alive!\n"; -?> ---EXPECTF-- -Strict Standards: Assigning the return value of new by reference is deprecated in %s on line %d -ok1 -bar::run1 -foo::method1 - -Notice: Only variable references should be returned by reference in %s on line %d -foo::method1 - -Notice: Only variable references should be returned by reference in %s on line %d -foo::finalize -done! -ok2 -bar::run2 -foo::method2 -foo::method2 -foo::finalize -done! -ok3 -bar::run3 -foo::method3 -foo::method3 -foo::finalize -done! -ouch -bar::run1 -foo::method1 - -Notice: Only variable references should be returned by reference in %s on line %d -foo::method1 - -Notice: Only variable references should be returned by reference in %s on line %d -foo::finalize -I'm alive! diff --git a/tests/lang/bug22592.phpt b/tests/lang/bug22592.phpt deleted file mode 100644 index 270584185f91e..0000000000000 --- a/tests/lang/bug22592.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -Bug #22592 (cascading assignments to strings with curly braces broken) ---FILE-- - ---EXPECT-- -string(5) "* *-*" -string(7) "* *-* *" -string(7) "*4*-* *" -string(7) "*4*s* *" -string(8) "*4*s* *0" -string(8) "*-*-* *0" -string(8) "*-*s*s*0" -string(8) "4-4s4s*0" -string(9) "4-4s4s505" -string(9) "454s4s505" -string(1) "-" -string(1) "s" -string(1) "4" -string(1) "5" -string(1) "5" -[Illegal string offset: -1] diff --git a/tests/lang/bug22690.phpt b/tests/lang/bug22690.phpt deleted file mode 100644 index 6aed5be6e91d6..0000000000000 --- a/tests/lang/bug22690.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #22690 (ob_start() is broken with create_function() callbacks) ---FILE-- - -bar ---EXPECT-- -BAR -BAR diff --git a/tests/lang/bug23279.phpt b/tests/lang/bug23279.phpt deleted file mode 100644 index 78d7850ff4cc7..0000000000000 --- a/tests/lang/bug23279.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #23279 (exception handler stops after first function call) ---FILE-- - ---EXPECT-- -Goodbye Cruel World diff --git a/tests/lang/bug23384.phpt b/tests/lang/bug23384.phpt deleted file mode 100644 index 382bdfe90f3b0..0000000000000 --- a/tests/lang/bug23384.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #23384 (use of class constants in statics) ---INI-- -error_reporting=4095 ---FILE-- - 'ten'); - static $arr = array(Foo::HUN => 'ten'); - - print_r($arr); - print_r($arr2); - print_r($x); - } -} - -Foo::test(); -echo Foo::HUN."\n"; -?> ---EXPECTF-- -Strict Standards: Non-static method Foo::test() should not be called statically in %sbug23384.php on line %d -Array -( - [100] => ten -) -Array -( - [10] => ten -) -100100 diff --git a/tests/lang/bug23489.phpt b/tests/lang/bug23489.phpt deleted file mode 100644 index 645bb1b7df368..0000000000000 --- a/tests/lang/bug23489.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #23489 (ob_start() is broken with method callbacks) ---FILE-- - -failure ---EXPECT-- -success diff --git a/tests/lang/bug23524.phpt b/tests/lang/bug23524.phpt deleted file mode 100755 index 512c714e221d8..0000000000000 --- a/tests/lang/bug23524.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #23524 (Improper handling of constants in array indices) ---FILE-- -THE_CONST)) { - print_r($a); - } - f(); - f(); - f(); - echo "Done"; -?> ---EXPECT-- -Begin -Array -( - [123] => 123 -) -Array -( - [123] => 123 -) -Array -( - [123] => 123 -) -Done diff --git a/tests/lang/bug23584.phpt b/tests/lang/bug23584.phpt deleted file mode 100644 index 417cfb085651a..0000000000000 --- a/tests/lang/bug23584.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #23584 (error line numbers off by one when using #!php) ---FILE-- -#!php - ---EXPECTREGEX-- -Notice: Undefined variable:.*foo in .* on line 6 diff --git a/tests/lang/bug23624.phpt b/tests/lang/bug23624.phpt deleted file mode 100644 index 4ddb82e8c6885..0000000000000 --- a/tests/lang/bug23624.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #23624 (foreach leaves current array key as null) ---FILE-- - $value); - var_dump(current($arr)); -?> ---EXPECT-- -string(3) "one" -bool(false) diff --git a/tests/lang/bug23922.phpt b/tests/lang/bug23922.phpt deleted file mode 100644 index 1fc6e548ff0b4..0000000000000 --- a/tests/lang/bug23922.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #23922 (scope doesn't properly propagate into internal functions) ---FILE-- -foo == 1'); } - - function as_expr() - { assert($this->foo == 1); } - } - - $foo = new foo(); - $foo->as_expr(); - $foo->as_string(); -?> ---EXPECT-- diff --git a/tests/lang/bug24054.phpt b/tests/lang/bug24054.phpt deleted file mode 100644 index fc51c83d77bda..0000000000000 --- a/tests/lang/bug24054.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #24054 (Assignment operator *= broken) ---FILE-- - 1, 'b' => 2, 'c' => 3); - -foreach($arr as $k=>$v) { - global $$k; // comment this out and it works in PHP 5 too.. - - echo "($k => $v)\n"; - - $$k = $v; -} -?> ---EXPECT-- -(a => 1) -(b => 2) -(c => 3) diff --git a/tests/lang/bug24403.phpt b/tests/lang/bug24403.phpt deleted file mode 100644 index fe99257d3d3ae..0000000000000 --- a/tests/lang/bug24403.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #24403 (scope doesn't properly propagate into internal functions) ---FILE-- -a) ? '\'.\$p[\'\\1\'].\'' : -'\'.\$r[\'\\1\'].\'')", - "{a} b {c}"); - } -} -new a(); -?> ---EXPECT-- diff --git a/tests/lang/bug24436.phpt b/tests/lang/bug24436.phpt deleted file mode 100644 index b0cfbe093120a..0000000000000 --- a/tests/lang/bug24436.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #24436 (isset() and empty() produce errors with non-existent variables in objects) ---FILE-- -test[0][0])) { print "test1";} - if (!isset($this->test[0][0])) { print "test2";} - } -} - -$test1 = new test(); -?> ---EXPECT-- -test1test2 diff --git a/tests/lang/bug24499.phpt b/tests/lang/bug24499.phpt deleted file mode 100755 index 6ce56dbad7328..0000000000000 --- a/tests/lang/bug24499.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #24499 (bogus handling of a public property as a private one) ---FILE-- -id = "bar"; - } -} - -$id = new Id(); -@$obj->foo = "bar"; -$id->tester($obj); -print_r($obj); -?> ---EXPECT-- -stdClass Object -( - [foo] => bar - [id] => bar -) diff --git a/tests/lang/bug24573.phpt b/tests/lang/bug24573.phpt deleted file mode 100644 index e087d1fb2cba3..0000000000000 --- a/tests/lang/bug24573.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #24573 (debug_backtrace() crashes if $this is set to null) ---FILE-- -Bar(); - -echo "OK\n"; - -?> ---EXPECTF-- - -Fatal error: Cannot re-assign $this in %s on line %d \ No newline at end of file diff --git a/tests/lang/bug24640.phpt b/tests/lang/bug24640.phpt deleted file mode 100755 index 919b38e29e44a..0000000000000 --- a/tests/lang/bug24640.phpt +++ /dev/null @@ -1,129 +0,0 @@ ---TEST-- -Bug #24640 (var_export and var_dump can't output large float) ---INI-- -precision=12 ---FILE-- - -===DONE=== - ---EXPECTF-- -1.7E+300 -float(1.7E+300) -1.7E+300 -1.7E+300 ------- -1.7E-300 -float(1.7E-300) -1.7E-300 -1.7E-300 ------- -1.7E+79 -float(1.7E+79) -1.7E+79 -1.7E+79 ------- -1.7E-79 -float(1.7E-79) -1.7E-79 -1.7E-79 ------- -1.7E+80 -float(1.7E+80) -1.7E+80 -1.7E+80 ------- -1.7E-80 -float(1.7E-80) -1.7E-80 -1.7E-80 ------- -1.7E+81 -float(1.7E+81) -1.7E+81 -1.7E+81 ------- -1.7E-81 -float(1.7E-81) -1.7E-81 -1.7E-81 ------- -I%s -float(I%s) -I%s -I%s ------- -1.69998107421E-319 -float(1.69998107421E-319) -1.69998107421E-319 -1.69998107421E-319 ------- -I%s -float(I%s) -I%s -I%s ------- -1.70007988734E-320 -float(1.70007988734E-320) -1.70007988734E-320 -1.70007988734E-320 ------- -I%s -float(I%s) -I%s -I%s ------- -1.69958582169E-321 -float(1.69958582169E-321) -1.69958582169E-321 -1.69958582169E-321 ------- -I%s -float(I%s) -I%s -I%s ------- -0 -float(0) -0 -0 ------- -I%s -float(I%s) -I%s -I%s ------- -0 -float(0) -0 -0 ------- -===DONE=== diff --git a/tests/lang/bug24652.phpt b/tests/lang/bug24652.phpt deleted file mode 100755 index 3bcea0e1d295d..0000000000000 --- a/tests/lang/bug24652.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #24652 (broken array_flip()) ---FILE-- - 0); - var_dump($f); - var_dump(array_key_exists(7, $f)); - var_dump(array_key_exists('7', $f)); - - print "----------\n"; - /* This doesn't */ - $f = array_flip(array('7')); - var_dump($f); - var_dump(array_key_exists(7, $f)); - var_dump(array_key_exists('7', $f)); -?> ---EXPECT-- -array(1) { - [7]=> - int(0) -} -bool(true) -bool(true) ----------- -array(1) { - [7]=> - int(0) -} -bool(true) -bool(true) diff --git a/tests/lang/bug24658.phpt b/tests/lang/bug24658.phpt deleted file mode 100644 index 944fe44ce8f7a..0000000000000 --- a/tests/lang/bug24658.phpt +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -Bug #24658 (combo of typehint / reference causes crash) ---FILE-- - ---EXPECTF-- -object(foo)#%d (0) { -} -object(foo)#%d (0) { -} -object(foo)#%d (0) { -} -object(foo)#%d (0) { -} -===no_typehint=== -object(foo)#%d (0) { -} -int(1) -int(2) -===no_typehint_ref=== -object(foo)#%d (0) { -} -int(1) -int(2) -===typehint=== -object(foo)#%d (0) { -} - -Catchable fatal error: Argument 1 passed to typehint() must be an instance of foo, integer given in %s on line %d diff --git a/tests/lang/bug24783.phpt b/tests/lang/bug24783.phpt deleted file mode 100644 index 8c8cd6ee01077..0000000000000 --- a/tests/lang/bug24783.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #24783 ($key not binary safe in "foreach($arr as $key => $val)") ---FILE-- - "foo\0bar"); - foreach ($arr as $key => $val) { - echo strlen($key), ': '; - echo urlencode($key), ' => ', urlencode($val), "\n"; - } -?> ---EXPECT-- -7: foo%00bar => foo%00bar diff --git a/tests/lang/bug24908.phpt b/tests/lang/bug24908.phpt deleted file mode 100755 index 30056abf3cb27..0000000000000 --- a/tests/lang/bug24908.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #24908 (super-globals can not be used in __destruct()) ---INI-- -variables_order=GPS ---FILE-- - ---EXPECT-- -OK diff --git a/tests/lang/bug24926.phpt b/tests/lang/bug24926.phpt deleted file mode 100644 index 3d2cc7008baf2..0000000000000 --- a/tests/lang/bug24926.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #24926 (lambda function (create_function()) cannot be stored in a class property) ---FILE-- -functions['test'] = $function; - print($this->functions['test']()); // werkt al niet meer - - } -} - -$a = new foo (); - -?> ---EXPECT-- -FOO -FOO diff --git a/tests/lang/bug24951.phpt b/tests/lang/bug24951.phpt deleted file mode 100644 index aa48ab29368e0..0000000000000 --- a/tests/lang/bug24951.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Bug #24951 (ob_flush() destroys output handler) ---FILE-- - ---EXPECT-- -[Hello from t1 1 Hello from t1 2 ] - -[Hello from t2 1 Hello from t2 2 ] - -Hello from t3 2 ] diff --git a/tests/lang/bug25145.phpt b/tests/lang/bug25145.phpt deleted file mode 100755 index e33580ab0def9..0000000000000 --- a/tests/lang/bug25145.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #25145 (SEGV on recpt of form input with name like "123[]") ---SKIPIF-- - ---GET-- -123[]=SEGV ---FILE-- - ---EXPECT-- -array(1) { - [123]=> - array(1) { - [0]=> - string(4) "SEGV" - } -} -Done diff --git a/tests/lang/bug25547.phpt b/tests/lang/bug25547.phpt deleted file mode 100755 index cce556ceb9ae9..0000000000000 --- a/tests/lang/bug25547.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #25547 (error_handler and array index with function call) ---FILE-- - ---EXPECT-- -handler(Undefined index: foo) -Array -( - [foo] => 1 -) -Done diff --git a/tests/lang/bug25652.phpt b/tests/lang/bug25652.phpt deleted file mode 100755 index 09cfc181977b0..0000000000000 --- a/tests/lang/bug25652.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #25652 (Calling Global functions dynamically fails from Class scope) ---FILE-- -arr[0]('testvalue'); - } - } - - $a = new foo (); - $a->bar (); - -?> ---EXPECT-- -testfunc testvalue diff --git a/tests/lang/bug25922.phpt b/tests/lang/bug25922.phpt deleted file mode 100755 index bb030c9df834c..0000000000000 --- a/tests/lang/bug25922.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Bug #25922 (SEGV in error_handler when context is destroyed) ---INI-- -error_reporting=2047 ---FILE-- - ---EXPECT-- -Undefined variable: data -Undefined index here: '' diff --git a/tests/lang/bug26182.phpt b/tests/lang/bug26182.phpt deleted file mode 100644 index 7417293928a14..0000000000000 --- a/tests/lang/bug26182.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #26182 (Object properties created redundantly) ---INI-- -error_reporting=4095 ---FILE-- -x)) { - //just for demo - } - } -} - -$t = new A (); - -print_r($t); - -?> ---EXPECT-- -A Object -( -) diff --git a/tests/lang/bug26696.phpt b/tests/lang/bug26696.phpt deleted file mode 100644 index dae182d30730f..0000000000000 --- a/tests/lang/bug26696.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #26696 (string index in a switch() crashes with multiple matches) ---FILE-- - ---EXPECT-- -OK -OK diff --git a/tests/lang/bug26866.phpt b/tests/lang/bug26866.phpt deleted file mode 100644 index abb99c34fd1e0..0000000000000 --- a/tests/lang/bug26866.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #26866 (segfault when exception raised in __get) ---FILE-- -bar->get_name(); -} -catch (Exception $E) { - echo "Exception raised!\n"; -} -?> ---EXPECT-- -Exception raised! diff --git a/tests/lang/bug26869.phpt b/tests/lang/bug26869.phpt deleted file mode 100644 index 77dd2592edf95..0000000000000 --- a/tests/lang/bug26869.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #26869 (constant as the key of static array) ---FILE-- - 1); - var_dump($a); - var_dump(isset($a[A])); -?> ---EXPECT-- -array(1) { - [1]=> - int(1) -} -bool(true) diff --git a/tests/lang/bug27354.phpt b/tests/lang/bug27354.phpt deleted file mode 100644 index e10ad9c924024..0000000000000 --- a/tests/lang/bug27354.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #27354 (Modulus operator crashes PHP) ---FILE-- - ---EXPECTF-- -int(%i) -int(%i) -int(%i) -int(%i) diff --git a/tests/lang/bug27439.phpt b/tests/lang/bug27439.phpt deleted file mode 100755 index 4bcadb78fd319..0000000000000 --- a/tests/lang/bug27439.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -Bug #27439 (foreach() with $this segfaults) ---FILE-- -object = new test_props; - } - - public function getArray() { - return $this->array; - } - - public function getString() { - return $this->string; - } - - public function case1() { - foreach ($this->array as $foo) { - echo $foo; - } - } - - public function case2() { - foreach ($this->foobar as $foo); - } - - public function case3() { - foreach ($this->string as $foo); - } - - public function case4() { - foreach ($this->getArray() as $foo); - } - - public function case5() { - foreach ($this->getString() as $foo); - } - - public function case6() { - foreach ($this->object as $foo) { - echo $foo; - } - } -} -$test = new test(); -$test->case1(); -$test->case2(); -$test->case3(); -$test->case4(); -$test->case5(); -$test->case6(); -echo "\n"; -echo "===DONE==="; -?> ---EXPECTF-- -123 -Notice: Undefined property: test::$foobar in %s on line %d - -Warning: Invalid argument supplied for foreach() in %s on line %d - -Warning: Invalid argument supplied for foreach() in %s on line %d - -Warning: Invalid argument supplied for foreach() in %s on line %d -123 -===DONE=== diff --git a/tests/lang/bug27443.phpt b/tests/lang/bug27443.phpt deleted file mode 100644 index 409794331b381..0000000000000 --- a/tests/lang/bug27443.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Bug #27443 (defined() returns wrong type) ---FILE-- - ---EXPECT-- -boolean diff --git a/tests/lang/bug27535.phpt b/tests/lang/bug27535.phpt deleted file mode 100644 index a6ceae7463c4a..0000000000000 --- a/tests/lang/bug27535.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #27535 (Objects pointing to each other cause Apache to crash) ---FILE-- -storage = new Class1(); - - $this->storage->_Class2_obj = $this; - } -} - -$foo = new Class2(); - -?> -Alive! ---EXPECT-- -Alive! diff --git a/tests/lang/bug28213.phpt b/tests/lang/bug28213.phpt deleted file mode 100644 index 3677d4c6f3557..0000000000000 --- a/tests/lang/bug28213.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #28213 (crash in debug_print_backtrace in static methods) ---FILE-- - ---EXPECTREGEX-- -.*#1\s*include.* diff --git a/tests/lang/bug28800.phpt b/tests/lang/bug28800.phpt deleted file mode 100644 index f81ad7fec982a..0000000000000 --- a/tests/lang/bug28800.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #28800 (Incorrect string to number conversion for strings starting with 'inf') ---FILE-- - ---EXPECT-- -0 -0 -0 -0 -0 -0 - diff --git a/tests/lang/bug29566.phpt b/tests/lang/bug29566.phpt deleted file mode 100755 index 5f292bd759340..0000000000000 --- a/tests/lang/bug29566.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #29566 (foreach/string handling strangeness) ---FILE-- - -===DONE=== ---EXPECTF-- -Warning: Invalid argument supplied for foreach() in %sbug29566.php on line %d -===DONE=== diff --git a/tests/lang/bug29893.phpt b/tests/lang/bug29893.phpt deleted file mode 100755 index d320de0ee72d7..0000000000000 --- a/tests/lang/bug29893.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #29893 (segfault when using array as index) ---FILE-- - -===DONE=== ---EXPECTF-- -Warning: Cannot use a scalar value as an array in %sbug29893.php on line %d -===DONE=== diff --git a/tests/lang/bug29944.phpt b/tests/lang/bug29944.phpt deleted file mode 100755 index 7882936f08b8d..0000000000000 --- a/tests/lang/bug29944.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #29944 (function defined in switch crashes PHP) ---FILE-- - - -===DONE=== ---EXPECT-- -1 -===DONE=== diff --git a/tests/lang/bug30578.phpt b/tests/lang/bug30578.phpt deleted file mode 100644 index d8a8d2e54f8d3..0000000000000 --- a/tests/lang/bug30578.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #30578 (Output buffers flushed before calling __desctruct functions) ---FILE-- - ---EXPECT-- -This should be displayed first. -Buffered data: This should be displayed last. diff --git a/tests/lang/bug30638.phpt b/tests/lang/bug30638.phpt deleted file mode 100644 index 0ebe8d49dd17f..0000000000000 --- a/tests/lang/bug30638.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #30638 (localeconv returns wrong LC_NUMERIC settings) (ok to fail on MacOS X) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -decimal_point: , -thousands_sep: . diff --git a/tests/lang/bug30726.phpt b/tests/lang/bug30726.phpt deleted file mode 100644 index 79aeff7d265c6..0000000000000 --- a/tests/lang/bug30726.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Bug #30726 (-.1 like numbers are not being handled correctly) ---FILE-- - ---EXPECT-- -1 diff --git a/tests/lang/bug30862.phpt b/tests/lang/bug30862.phpt deleted file mode 100644 index 12c95d57e87b7..0000000000000 --- a/tests/lang/bug30862.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #30862 (Static array with boolean indexes) ---FILE-- -"false", true=>"true"); -} -print_r(T::$a); -?> ----------- -"false", Y=>"true"); -} -print_r(T2::$a); -?> ---EXPECT-- -Array -( - [0] => false - [1] => true -) ----------- -Array -( - [0] => false - [1] => true -) diff --git a/tests/lang/bug32828.phpt b/tests/lang/bug32828.phpt deleted file mode 100644 index ad59646f5007e..0000000000000 --- a/tests/lang/bug32828.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #32828 (Throwing exception in output_callback function with ob_start and ob_end_clean leads to segfault) ---FILE-- - ---EXPECTF-- -Fatal error: Uncaught exception 'Exception' in %s:%d -Stack trace: -#0 [internal function]: output_handler('', %d) -#1 %s(%d): ob_end_clean() -#2 {main} - thrown in %s on line %d diff --git a/tests/lang/bug32924.phpt b/tests/lang/bug32924.phpt deleted file mode 100644 index d72b0eaa2ec6f..0000000000000 --- a/tests/lang/bug32924.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #32924 (prepend does not add file to included files) ---INI-- -include_path={PWD} -auto_prepend_file=inc.inc ---FILE-- - -END ---EXPECT-- -Included! -END diff --git a/tests/lang/bug35176.phpt b/tests/lang/bug35176.phpt deleted file mode 100755 index dd56c76a68298..0000000000000 --- a/tests/lang/bug35176.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #35176 (include()/require()/*_once() produce wrong error messages about main()) ---INI-- -html_errors=1 -error_reporting=4095 ---FILE-- - ---EXPECTF-- -
-Warning: require_once(nonexisiting.php) [function.require-once.html]: failed to open stream: No such file or directory in %sbug35176.php on line 2
-
-Fatal error: require_once() [function.require.html]: Failed opening required 'nonexisiting.php' (%s) in %sbug35176.php on line 2
diff --git a/tests/lang/bug35382.phpt b/tests/lang/bug35382.phpt deleted file mode 100755 index 69190d4c955b1..0000000000000 --- a/tests/lang/bug35382.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Bug #35382 (Comment in end of file produces fatal error) ---FILEEOF-- - diff --git a/tests/lang/bug38579.phpt b/tests/lang/bug38579.phpt deleted file mode 100755 index 445296c222599..0000000000000 --- a/tests/lang/bug38579.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #38579 (include_once() may include the same file twice) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -ok diff --git a/tests/lang/bug43958.phpt b/tests/lang/bug43958.phpt deleted file mode 100644 index bc88bcda0f804..0000000000000 --- a/tests/lang/bug43958.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #43958 (class name added into the error message) ---FILE-- - ---EXPECTF-- -2 -Fatal error: Allowed memory size of %d bytes exhausted%s diff --git a/tests/lang/bug7515.phpt b/tests/lang/bug7515.phpt deleted file mode 100644 index b33ae24c89e7c..0000000000000 --- a/tests/lang/bug7515.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Bug #7515 (weird & invisible referencing of objects) ---SKIPIF-- - ---INI-- -error_reporting=2039 ---FILE-- -root=new obj(); - -ob_start(); -var_dump($o); -$x=ob_get_contents(); -ob_end_clean(); - -$o->root->method(); - -ob_start(); -var_dump($o); -$y=ob_get_contents(); -ob_end_clean(); -if ($x == $y) { - print "success"; -} else { - print "failure -x=$x -y=$y -"; -} -?> ---EXPECT-- -success diff --git a/tests/lang/catchable_error_001.phpt b/tests/lang/catchable_error_001.phpt deleted file mode 100644 index f6bbdd976deeb..0000000000000 --- a/tests/lang/catchable_error_001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Catchable fatal error [1] ---FILE-- - ---EXPECTF-- -Catchable fatal error: Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php on line 5 diff --git a/tests/lang/catchable_error_002.phpt b/tests/lang/catchable_error_002.phpt deleted file mode 100644 index c1762b2db7120..0000000000000 --- a/tests/lang/catchable_error_002.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Catchable fatal error [2] ---FILE-- - ---EXPECTF-- -array(5) { - [0]=> - int(4096) - [1]=> - string(%d) "Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d and defined" - [2]=> - string(%d) "%scatchable_error_002.php" - [3]=> - int(5) - [4]=> - array(0) { - } -} -ALIVE! diff --git a/tests/lang/each_binary_safety.phpt b/tests/lang/each_binary_safety.phpt deleted file mode 100644 index bb135345464ca..0000000000000 --- a/tests/lang/each_binary_safety.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Binary safety of each() for both keys and values ---FILE-- - "foo\0bar"); -while (list($key, $val) = each($arr)) { - echo strlen($key), ': '; - echo urlencode($key), ' => ', urlencode($val), "\n"; -} -?> ---EXPECT-- -7: foo%00bar => foo%00bar diff --git a/tests/lang/empty_variation.phpt b/tests/lang/empty_variation.phpt deleted file mode 100644 index 8e940dae52f00..0000000000000 --- a/tests/lang/empty_variation.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -empty() on array elements ---FILE-- -'0'); -var_dump(empty($a['empty'])); -var_dump(empty($a[0])); -$b='0'; -var_dump(empty($b)); -?> ---EXPECT-- -bool(true) -bool(true) -bool(true) diff --git a/tests/lang/error_2_exception_001.phpt b/tests/lang/error_2_exception_001.phpt deleted file mode 100644 index 61f45d47d578e..0000000000000 --- a/tests/lang/error_2_exception_001.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -ZE2 errors caught as exceptions ---SKIPIF-- - ---FILE-- -errno = $_errno; - $this->errmsg = $_errmsg; - } - - function getErrno() { - return $this->errno; - } - - function getErrmsg() { - return $this->errmsg; - } -} - -function ErrorsToExceptions($errno, $errmsg) { - throw new MyException($errno, $errmsg); -} - -set_error_handler("ErrorsToExceptions"); - -// make sure it isn't catching exceptions that weren't -// thrown... - -try { -} catch (MyException $exception) { - echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; -} - -try { - trigger_error("I will become an exception", E_USER_ERROR); -} catch (MyException $exception) { - echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; -} - -?> ---EXPECT-- -There was an exception: 256, 'I will become an exception' diff --git a/tests/lang/foreach_with_object_001.phpt b/tests/lang/foreach_with_object_001.phpt deleted file mode 100755 index 598b844fb732f..0000000000000 --- a/tests/lang/foreach_with_object_001.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -foreach() with foreach($o->mthd()->arr) ---FILE-- -c()->a as $value) { - print "$value\n"; -} - -?> -===DONE=== ---EXPECT-- -1 -2 -3 -4 -5 -===DONE=== diff --git a/tests/lang/foreach_with_references_001.phpt b/tests/lang/foreach_with_references_001.phpt deleted file mode 100644 index eb52bb8c10678..0000000000000 --- a/tests/lang/foreach_with_references_001.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -foreach() with references ---FILE-- - "one", 2 => "two", 3 => "three"); - -foreach($arr as $key => $val) { - $val = $key; -} - -print_r($arr); - -foreach($arr as $key => &$val) { - $val = $key; -} - -print_r($arr); - ---EXPECT-- -Array -( - [1] => one - [2] => two - [3] => three -) -Array -( - [1] => 1 - [2] => 2 - [3] => 3 -) diff --git a/tests/lang/func_get_arg.001.phpt b/tests/lang/func_get_arg.001.phpt deleted file mode 100644 index b1bbb18699881..0000000000000 --- a/tests/lang/func_get_arg.001.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -func_get_arg test ---FILE-- - ---EXPECT-- -2 \ No newline at end of file diff --git a/tests/lang/func_get_arg.002.phpt b/tests/lang/func_get_arg.002.phpt deleted file mode 100644 index 6ab4f95719a0b..0000000000000 --- a/tests/lang/func_get_arg.002.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -func_get_arg with variable number of args ---FILE-- - ---EXPECT-- -int(3) -int(3) diff --git a/tests/lang/func_get_arg.003.phpt b/tests/lang/func_get_arg.003.phpt deleted file mode 100644 index 4ef996767411f..0000000000000 --- a/tests/lang/func_get_arg.003.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -func_get_arg outside of a function declaration ---FILE-- - ---EXPECTF-- -Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d -bool(false) diff --git a/tests/lang/func_get_arg.004.phpt b/tests/lang/func_get_arg.004.phpt deleted file mode 100644 index 6931df04e693c..0000000000000 --- a/tests/lang/func_get_arg.004.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -func_get_arg on non-existent arg ---FILE-- - ---EXPECTF-- -Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d -bool(false) \ No newline at end of file diff --git a/tests/lang/func_get_arg.005.phpt b/tests/lang/func_get_arg.005.phpt deleted file mode 100644 index e1ae78e162f4a..0000000000000 --- a/tests/lang/func_get_arg.005.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -A variable, which is referenced by another variable, is passed by value. -During the call, the original variable is updated. This should not affect func_get_arg(). ---FILE-- - ---EXPECTF-- -string(10) "original.a" -string(10) "original.a" \ No newline at end of file diff --git a/tests/lang/func_get_arg_variation.phpt b/tests/lang/func_get_arg_variation.phpt deleted file mode 100644 index 4865f7560d1fa..0000000000000 --- a/tests/lang/func_get_arg_variation.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -func_get_arg test ---FILE-- - ---EXPECTF-- -2 -Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d - -Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d - diff --git a/tests/lang/func_get_args.001.phpt b/tests/lang/func_get_args.001.phpt deleted file mode 100644 index 740a0a216552e..0000000000000 --- a/tests/lang/func_get_args.001.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -func_get_args with no args ---FILE-- - ---EXPECT-- -array(0) { -} \ No newline at end of file diff --git a/tests/lang/func_get_args.002.phpt b/tests/lang/func_get_args.002.phpt deleted file mode 100644 index 0a886c2f0476f..0000000000000 --- a/tests/lang/func_get_args.002.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -func_get_args with variable number of args ---FILE-- - ---EXPECT-- -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} - diff --git a/tests/lang/func_get_args.003.phpt b/tests/lang/func_get_args.003.phpt deleted file mode 100644 index 44faf7ebf808f..0000000000000 --- a/tests/lang/func_get_args.003.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -func_get_args() outside of a function declaration ---FILE-- - ---EXPECTREGEX-- -Warning\: func_get_args\(\)\: Called from the global scope - no function context in \S* on line 3 -bool\(false\) diff --git a/tests/lang/func_get_args.004.phpt b/tests/lang/func_get_args.004.phpt deleted file mode 100644 index 84e3ebe5a21e8..0000000000000 --- a/tests/lang/func_get_args.004.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -Pass same variable by ref and by value. ---FILE-- - ---EXPECTF-- - --- Val, Ref -- -string(10) "original.a" -string(10) "original.a" -array(2) { - [0]=> - string(10) "original.a" - [1]=> - string(10) "original.a" -} -array(2) { - [0]=> - string(10) "original.a" - [1]=> - string(9) "changed.y" -} -string(9) "changed.y" - - --- Ref, Val -- -string(10) "original.b" -string(10) "original.b" -array(2) { - [0]=> - string(10) "original.b" - [1]=> - string(10) "original.b" -} -array(2) { - [0]=> - string(9) "changed.x" - [1]=> - string(10) "original.b" -} -string(9) "changed.x" \ No newline at end of file diff --git a/tests/lang/func_num_args.001.phpt b/tests/lang/func_num_args.001.phpt deleted file mode 100644 index c281557febaa6..0000000000000 --- a/tests/lang/func_num_args.001.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -func_num_args with no args ---FILE-- - ---EXPECT-- -int(0) \ No newline at end of file diff --git a/tests/lang/func_num_args.002.phpt b/tests/lang/func_num_args.002.phpt deleted file mode 100644 index bfb8f7c705ddd..0000000000000 --- a/tests/lang/func_num_args.002.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -func_num_args with variable number of args ---FILE-- - ---EXPECT-- -int(3) \ No newline at end of file diff --git a/tests/lang/func_num_args.003.phpt b/tests/lang/func_num_args.003.phpt deleted file mode 100644 index 7cf1229bced16..0000000000000 --- a/tests/lang/func_num_args.003.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -func_num_args() outside of a function declaration ---FILE-- - ---EXPECTF-- - -Warning: func_num_args(): Called from the global scope - no function context in %s on line %d -int(-1) \ No newline at end of file diff --git a/tests/lang/func_num_args.004.phpt b/tests/lang/func_num_args.004.phpt deleted file mode 100644 index 8bdc6f07f64e8..0000000000000 --- a/tests/lang/func_num_args.004.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Pass same variable by ref and by value. ---FILE-- - ---EXPECTF-- - - --- Val, Ref -- -string(10) "original.a" -string(10) "original.a" -int(2) -int(2) -string(9) "changed.y" - - --- Ref, Val -- -string(10) "original.b" -string(10) "original.b" -int(2) -int(2) -string(9) "changed.x" diff --git a/tests/lang/inc.inc b/tests/lang/inc.inc deleted file mode 100644 index 64b30afe47669..0000000000000 --- a/tests/lang/inc.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/tests/lang/inc_throw.inc b/tests/lang/inc_throw.inc deleted file mode 100644 index 1f032f7e7021c..0000000000000 --- a/tests/lang/inc_throw.inc +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/tests/lang/include_files/echo.inc b/tests/lang/include_files/echo.inc deleted file mode 100644 index 60714f6e4fb34..0000000000000 --- a/tests/lang/include_files/echo.inc +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/tests/lang/include_files/eval.inc b/tests/lang/include_files/eval.inc deleted file mode 100644 index 16da86295de32..0000000000000 --- a/tests/lang/include_files/eval.inc +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/tests/lang/include_files/function.inc b/tests/lang/include_files/function.inc deleted file mode 100644 index 528f46c56476d..0000000000000 --- a/tests/lang/include_files/function.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/tests/lang/include_variation1.phpt b/tests/lang/include_variation1.phpt deleted file mode 100644 index cf99ba9d3756a..0000000000000 --- a/tests/lang/include_variation1.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -include() a file from the current script directory ---FILE-- - ---EXPECT-- -Included! diff --git a/tests/lang/include_variation2.phpt b/tests/lang/include_variation2.phpt deleted file mode 100644 index 051ed7157c343..0000000000000 --- a/tests/lang/include_variation2.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Including a file in the current script directory from an included function ---FILE-- - ---EXPECT-- -Included! diff --git a/tests/lang/include_variation3.phpt b/tests/lang/include_variation3.phpt deleted file mode 100644 index 1fa80c5ab99bf..0000000000000 --- a/tests/lang/include_variation3.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Including a file in the current script directory from eval'd code ---FILE-- - ---EXPECT-- -Included! \ No newline at end of file diff --git a/tests/lang/passByReference_001.phpt b/tests/lang/passByReference_001.phpt deleted file mode 100644 index c73eacc594a06..0000000000000 --- a/tests/lang/passByReference_001.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -passing of function parameters by reference ---FILE-- - ---EXPECT-- -int(7) -int(15) -int(7) -int(16) -array(1) { - [0]=> - &int(1) -} -int(1) \ No newline at end of file diff --git a/tests/lang/passByReference_002.phpt b/tests/lang/passByReference_002.phpt deleted file mode 100644 index d1968a35286ca..0000000000000 --- a/tests/lang/passByReference_002.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Attempt to pass a constant by reference ---FILE-- - ---EXPECTF-- -Fatal error: Only variables can be passed by reference in %s on line 8 diff --git a/tests/lang/passByReference_003.phpt b/tests/lang/passByReference_003.phpt deleted file mode 100644 index bbbc564654d91..0000000000000 --- a/tests/lang/passByReference_003.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Implicit initialisation when passing by reference ---FILE-- - ---EXPECTF-- - -Passing undefined by value - -Notice: Undefined variable: undef1 in %s on line 13 - -Inside passbyVal call: -NULL - -After call - -Notice: Undefined variable: undef1 in %s on line 15 -NULL - -Passing undefined by reference - -Inside passbyRef call: -NULL - -After call -array(1) { - [0]=> - NULL -} diff --git a/tests/lang/passByReference_004.phpt b/tests/lang/passByReference_004.phpt deleted file mode 100644 index e8a7963d262c5..0000000000000 --- a/tests/lang/passByReference_004.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -passing the return value from a function by reference ---FILE-- - ---EXPECTF-- -Strict Standards: Only variables should be passed by reference in %s on line 13 -int(5) diff --git a/tests/lang/passByReference_005.phpt b/tests/lang/passByReference_005.phpt deleted file mode 100644 index 52ddeebd1c2b7..0000000000000 --- a/tests/lang/passByReference_005.phpt +++ /dev/null @@ -1,261 +0,0 @@ ---TEST-- -Pass uninitialised variables by reference and by value to test implicit initialisation. ---FILE-- -v($u1); -$c->r($u2); -var_dump($u1, $u2); - -unset($u1, $u2); -$c->vv($u1, $u2); -var_dump($u1, $u2); - -unset($u1, $u2); -$c->vr($u1, $u2); -var_dump($u1, $u2); - -unset($u1, $u2); -$c->rv($u1, $u2); -var_dump($u1, $u2); - -unset($u1, $u2); -$c->rr($u1, $u2); -var_dump($u1, $u2); - -?> ---EXPECTF-- - - ---- Pass by ref / pass by val: functions ---- - -Notice: Undefined variable: u1 in %s on line 72 - -Notice: Undefined variable: u1 in %s on line 74 -NULL -string(11) "Ref changed" - -Notice: Undefined variable: u1 in %s on line 77 - -Notice: Undefined variable: u2 in %s on line 77 - -Notice: Undefined variable: u1 in %s on line 78 - -Notice: Undefined variable: u2 in %s on line 78 -NULL -NULL - -Notice: Undefined variable: u1 in %s on line 81 - -Notice: Undefined variable: u1 in %s on line 82 -NULL -string(11) "Ref changed" - -Notice: Undefined variable: u2 in %s on line 85 - -Notice: Undefined variable: u2 in %s on line 86 -string(11) "Ref changed" -NULL -string(12) "Ref1 changed" -string(12) "Ref2 changed" - - - ---- Pass by ref / pass by val: static method calls ---- - -Notice: Undefined variable: u1 in %s on line 95 - -Strict Standards: Non-static method C::v() should not be called statically in %s on line 95 - -Strict Standards: Non-static method C::r() should not be called statically in %s on line 96 - -Notice: Undefined variable: u1 in %s on line 97 -NULL -string(11) "Ref changed" - -Notice: Undefined variable: u1 in %s on line 100 - -Notice: Undefined variable: u2 in %s on line 100 - -Strict Standards: Non-static method C::vv() should not be called statically in %s on line 100 - -Notice: Undefined variable: u1 in %s on line 101 - -Notice: Undefined variable: u2 in %s on line 101 -NULL -NULL - -Notice: Undefined variable: u1 in %s on line 104 - -Strict Standards: Non-static method C::vr() should not be called statically in %s on line 104 - -Notice: Undefined variable: u1 in %s on line 105 -NULL -string(11) "Ref changed" - -Notice: Undefined variable: u2 in %s on line 108 - -Strict Standards: Non-static method C::rv() should not be called statically in %s on line 108 - -Notice: Undefined variable: u2 in %s on line 109 -string(11) "Ref changed" -NULL - -Strict Standards: Non-static method C::rr() should not be called statically in %s on line 112 -string(12) "Ref1 changed" -string(12) "Ref2 changed" - - - ---- Pass by ref / pass by val: instance method calls ---- - -Notice: Undefined variable: u1 in %s on line 117 - -Notice: Undefined variable: u1 in %s on line 118 -NULL -string(11) "Ref changed" - -Notice: Undefined variable: u1 in %s on line 121 - -Notice: Undefined variable: u1 in %s on line 123 -NULL -string(11) "Ref changed" - -Notice: Undefined variable: u1 in %s on line 126 - -Notice: Undefined variable: u2 in %s on line 126 - -Notice: Undefined variable: u1 in %s on line 127 - -Notice: Undefined variable: u2 in %s on line 127 -NULL -NULL - -Notice: Undefined variable: u1 in %s on line 130 - -Notice: Undefined variable: u1 in %s on line 131 -NULL -string(11) "Ref changed" - -Notice: Undefined variable: u2 in %s on line 134 - -Notice: Undefined variable: u2 in %s on line 135 -string(11) "Ref changed" -NULL -string(12) "Ref1 changed" -string(12) "Ref2 changed" \ No newline at end of file diff --git a/tests/lang/passByReference_006.phpt b/tests/lang/passByReference_006.phpt deleted file mode 100644 index 248be88b440ff..0000000000000 --- a/tests/lang/passByReference_006.phpt +++ /dev/null @@ -1,195 +0,0 @@ ---TEST-- -Pass uninitialised objects and arrays by reference to test implicit initialisation. ---FILE-- -a, $u4->a->b, $u5->a->b->c); -var_dump($u1, $u2, $u3, $u4, $u5); - -echo "\n ---- Pass uninitialised arrays & objects by ref: static method call ---\n"; -unset($u1, $u2, $u3, $u4, $u5); -C::refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); -var_dump($u1, $u2, $u3, $u4, $u5); - -echo "\n\n---- Pass uninitialised arrays & objects by ref: constructor ---\n"; -unset($u1, $u2, $u3, $u4, $u5); -$c = new C($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); -var_dump($u1, $u2, $u3, $u4, $u5); - -echo "\n ---- Pass uninitialised arrays & objects by ref: instance method call ---\n"; -unset($u1, $u2, $u3, $u4, $u5); -$c->refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); -var_dump($u1, $u2, $u3, $u4, $u5); - -?> ---EXPECTF-- - - ---- Pass uninitialised array & object by ref: function call --- -array(1) { - [0]=> - string(12) "Ref1 changed" -} -array(1) { - [0]=> - array(1) { - [1]=> - string(12) "Ref2 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - string(12) "Ref3 changed" -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - string(12) "Ref4 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - object(stdClass)#%d (1) { - ["c"]=> - string(12) "Ref5 changed" - } - } -} - - ---- Pass uninitialised arrays & objects by ref: static method call --- - -Strict Standards: Non-static method C::refs() should not be called statically in %s on line 39 -array(1) { - [0]=> - string(12) "Ref1 changed" -} -array(1) { - [0]=> - array(1) { - [1]=> - string(12) "Ref2 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - string(12) "Ref3 changed" -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - string(12) "Ref4 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - object(stdClass)#%d (1) { - ["c"]=> - string(12) "Ref5 changed" - } - } -} - - ----- Pass uninitialised arrays & objects by ref: constructor --- -array(1) { - [0]=> - string(12) "Ref1 changed" -} -array(1) { - [0]=> - array(1) { - [1]=> - string(12) "Ref2 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - string(12) "Ref3 changed" -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - string(12) "Ref4 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - object(stdClass)#%d (1) { - ["c"]=> - string(12) "Ref5 changed" - } - } -} - - ---- Pass uninitialised arrays & objects by ref: instance method call --- -array(1) { - [0]=> - string(12) "Ref1 changed" -} -array(1) { - [0]=> - array(1) { - [1]=> - string(12) "Ref2 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - string(12) "Ref3 changed" -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - string(12) "Ref4 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - object(stdClass)#%d (1) { - ["c"]=> - string(12) "Ref5 changed" - } - } -} \ No newline at end of file diff --git a/tests/lang/passByReference_007.phpt b/tests/lang/passByReference_007.phpt deleted file mode 100644 index 558ceae27ea42..0000000000000 --- a/tests/lang/passByReference_007.phpt +++ /dev/null @@ -1,105 +0,0 @@ ---TEST-- -Pass function and method calls by reference and by value. ---FILE-- -returnVal()); -var_dump($a); - -echo "Pass a method call that returns a reference:\n"; -$a = "original"; -foo($myC->returnReference()); -var_dump($a); - -?> ---EXPECTF-- -Pass a function call that returns a value: - -Strict Standards: Only variables should be passed by reference in %s on line 44 -string(8) "original" -string(8) "original" -Pass a function call that returns a reference: -string(8) "original" -string(7) "changed" - -Pass a static method call that returns a value: - -Strict Standards: Only variables should be passed by reference in %s on line 55 -string(8) "original" -string(8) "original" -Pass a static method call that returns a reference: -string(8) "original" -string(7) "changed" - -Pass a method call that returns a value: - -Strict Standards: Only variables should be passed by reference in %s on line 67 -string(8) "original" -string(8) "original" -Pass a method call that returns a reference: -string(8) "original" -string(7) "changed" \ No newline at end of file diff --git a/tests/lang/passByReference_008.phpt b/tests/lang/passByReference_008.phpt deleted file mode 100644 index 36852170bf65b..0000000000000 --- a/tests/lang/passByReference_008.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Pass same variable by ref and by value. ---FILE-- - ---EXPECTF-- - - --- Val, Ref -- -string(10) "original.a" -string(10) "original.a" -string(9) "changed.y" - - --- Ref, Val -- -string(10) "original.b" -string(10) "original.b" -string(9) "changed.x" \ No newline at end of file diff --git a/tests/lang/passByReference_009.phpt b/tests/lang/passByReference_009.phpt deleted file mode 100644 index 1cbd87d6c4b5c..0000000000000 --- a/tests/lang/passByReference_009.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Assignement as argument ---FILE-- - ---EXPECTF-- -1012 \ No newline at end of file diff --git a/tests/lang/passByReference_010.phpt b/tests/lang/passByReference_010.phpt deleted file mode 100644 index 0393cce2d1b0a..0000000000000 --- a/tests/lang/passByReference_010.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Passing assignments by reference ---FILE-- - Pass constant assignment by reference:\n"; -f($a="a.original"); -var_dump($a); - -echo "\n\n---> Pass variable assignment by reference:\n"; -unset($a); -$a = "a.original"; -f($b = $a); -var_dump($a); - -echo "\n\n---> Pass reference assignment by reference:\n"; -unset($a, $b); -$a = "a.original"; -f($b =& $a); -var_dump($a); - -echo "\n\n---> Pass concat assignment by reference:\n"; -unset($a, $b); -$b = "b.original"; -$a = "a.original"; -f($b .= $a); -var_dump($a); - -?> ---EXPECTF-- - - ----> Pass constant assignment by reference: - -Strict Standards: Only variables should be passed by reference in %s on line 9 -string(10) "a.original" -string(10) "a.original" - - ----> Pass variable assignment by reference: - -Strict Standards: Only variables should be passed by reference in %s on line 15 -string(10) "a.original" -string(10) "a.original" - - ----> Pass reference assignment by reference: -string(10) "a.original" -string(9) "a.changed" - - ----> Pass concat assignment by reference: - -Strict Standards: Only variables should be passed by reference in %s on line 28 -string(20) "b.originala.original" -string(10) "a.original" diff --git a/tests/lang/short_tags.001.phpt b/tests/lang/short_tags.001.phpt deleted file mode 100644 index 522018e3068fa..0000000000000 --- a/tests/lang/short_tags.001.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -short_open_tag: On ---INI-- -short_open_tag=on ---FILE-- - -Finished ---EXPECT-- -Used a short tag -Finished diff --git a/tests/lang/short_tags.002.phpt b/tests/lang/short_tags.002.phpt deleted file mode 100644 index 6a3d5e09968f2..0000000000000 --- a/tests/lang/short_tags.002.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -short_open_tag: Off ---INI-- -short_open_tag=off ---FILE-- - -Finished ---EXPECT-- - -Finished diff --git a/tests/lang/short_tags.003.phpt b/tests/lang/short_tags.003.phpt deleted file mode 100644 index 8894bf502913f..0000000000000 --- a/tests/lang/short_tags.003.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -short_open_tag: On, asp_tags: On ---INI-- -short_open_tag=on -asp_tags=on ---FILE-- - - -<%= 'so should this' %> - - - - - -<%= $a%> - - - - ---EXPECT-- -this should get echoed -so should this - -This gets echoed twice -This gets echoed twice - -3 - diff --git a/tests/lang/short_tags.004.phpt b/tests/lang/short_tags.004.phpt deleted file mode 100644 index d80e7481a1832..0000000000000 --- a/tests/lang/short_tags.004.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -short_open_tag: Off, asp_tags: Off ---INI-- -short_open_tag=off -asp_tags=off ---FILE-- - - -<%= 'so should this' %> - - - - - -<%= $a%> - - - - ---EXPECTF-- - - -<%= 'so should this' %> - - - - -<%= $a%> - - - - -Notice: Undefined variable: b in %s on line %d diff --git a/tests/lang/static_basic_001.phpt b/tests/lang/static_basic_001.phpt deleted file mode 100644 index 45fc1b2abe65e..0000000000000 --- a/tests/lang/static_basic_001.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Static keyword - basic tests ---FILE-- - ---EXPECT-- - -Same variable used as static and non static. ---------- -0 -10 ---------- -0 -11 ---------- -0 -12 - -Lots of initialisations in the same statement. -------------- Call 0 -------------- -Unitialised : -Initialised to 10: 10 -Initialised to 20: 20 -Unitialised : -Initialised to 30: 30 -------------- Call 1 -------------- -Unitialised : 1 -Initialised to 10: 11 -Initialised to 20: 21 -Unitialised : 1 -Initialised to 30: 31 -------------- Call 2 -------------- -Unitialised : 2 -Initialised to 10: 12 -Initialised to 20: 22 -Unitialised : 2 -Initialised to 30: 32 - -Using static keyword at global scope - 10 -1 11 -2 12 \ No newline at end of file diff --git a/tests/lang/static_basic_002.phpt b/tests/lang/static_basic_002.phpt deleted file mode 100644 index 06e2f724ecffc..0000000000000 --- a/tests/lang/static_basic_002.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Multiple declarations of the same static variable ---FILE-- - ---EXPECT-- -int(5) -int(11) -int(14) diff --git a/tests/lang/static_variation_001.phpt b/tests/lang/static_variation_001.phpt deleted file mode 100644 index a27b9fadc7c40..0000000000000 --- a/tests/lang/static_variation_001.phpt +++ /dev/null @@ -1,112 +0,0 @@ ---TEST-- -Statics in nested functions & evals. ---FILE-- - ---EXPECTF-- -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) -} -array(3) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) -} -array(3) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) -} -array(3) { - [0]=> - int(10) - [1]=> - int(11) - [2]=> - int(12) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} \ No newline at end of file diff --git a/tests/lang/static_variation_002.phpt b/tests/lang/static_variation_002.phpt deleted file mode 100644 index b8933fd26ec6e..0000000000000 --- a/tests/lang/static_variation_002.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -Static variables in methods & nested functions & evals. ---FILE-- -f(); -cfg(); - -Class D { - static function f() { - eval('function dfg() { static $b = array(1,2,3); var_dump($b); } '); - } -} -D::f(); -dfg(); - -eval(' Class E { function f() { static $c = array(1,2,3); var_dump($c); } }'); -$e = new E; -$e->f(); - -?> ---EXPECTF-- -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -array(3) { - [0]=> - int(4) - [1]=> - int(5) - [2]=> - int(6) -} -array(3) { - [0]=> - int(7) - [1]=> - int(8) - [2]=> - int(9) -} -array(3) { - [0]=> - int(10) - [1]=> - int(11) - [2]=> - int(12) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} -array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) -} \ No newline at end of file diff --git a/tests/lang/throw_variation_001.phpt b/tests/lang/throw_variation_001.phpt deleted file mode 100644 index d942a87930970..0000000000000 --- a/tests/lang/throw_variation_001.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Catching an exception thrown from an included file ---FILE-- - ---EXPECT-- -caught exception diff --git a/tests/lang/type_hints_001.phpt b/tests/lang/type_hints_001.phpt deleted file mode 100644 index 57808d474f6a8..0000000000000 --- a/tests/lang/type_hints_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 type hinting ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, instance of Bar given, called in %s on line 16 and defined in %s on line 9 diff --git a/tests/lang/type_hints_002.phpt b/tests/lang/type_hints_002.phpt deleted file mode 100644 index b21240a7923a7..0000000000000 --- a/tests/lang/type_hints_002.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -ZE2 type hinting ---SKIPIF-- - ---FILE-- -f(new P); -$o->f(); -$o->f(NULL); -?> ---EXPECT-- -object(P)#2 (0) { -} -- -NULL -- -NULL -- - diff --git a/tests/lang/type_hints_003.phpt b/tests/lang/type_hints_003.phpt deleted file mode 100644 index 0ef3e3516bdd5..0000000000000 --- a/tests/lang/type_hints_003.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -ZE2 type hinting ---SKIPIF-- - ---FILE-- - ---EXPECTF-- - -Fatal error: Default value for parameters with a class type hint can only be NULL in %stype_hints_003.php on line 3 diff --git a/tests/odbc-display.php b/tests/odbc-display.php deleted file mode 100644 index f79a854aea8c8..0000000000000 --- a/tests/odbc-display.php +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/tests/odbc-t1.php b/tests/odbc-t1.php deleted file mode 100644 index 90cb97910f5bd..0000000000000 --- a/tests/odbc-t1.php +++ /dev/null @@ -1,38 +0,0 @@ - - -Quick & dirty ODBC test - - -

ODBC Test 1 - Connection

-"; - $conn = odbc_connect($dsn,$dbuser,$dbpwd); - if(!$conn){ -?> -

Error connecting to database! Check DSN, username and password

- -

Connection successful

-">Proceed to next test -| Change login information - -You will need permisson to create tables for the following tests! - - - - - -
Database (DSN):
User:
Password:
-
- - - - - - diff --git a/tests/odbc-t2.php b/tests/odbc-t2.php deleted file mode 100644 index a500b09e8b5b0..0000000000000 --- a/tests/odbc-t2.php +++ /dev/null @@ -1,82 +0,0 @@ - - -Quick & dirty ODBC test #2 - - -

ODBC Test 2 - Create table

- -

Error connecting to database! Check DSN, username and password

- -- OK

-Dropping table "php3_test" - -- OK

-Create table "php_test" - - - OK

-Table Info:
- - - - - - - - - - - - - -
NameTypeLength
-

-


-

-">Proceed to next test -| Change login information - - - -

- - - - -
Database (DSN):
User:
Password:
- -
- - - - diff --git a/tests/odbc-t3.php b/tests/odbc-t3.php deleted file mode 100644 index edfdc658f898d..0000000000000 --- a/tests/odbc-t3.php +++ /dev/null @@ -1,95 +0,0 @@ - - -Database test #3 - - -

ODBC Test 3 - Insert records

- -

Error connecting to database! Check DSN, username and password

- - - OK

-Clearing table "php_test" - - - OK

-Inserting into table "php_test" - - - OK

-

The table "php_test" should now contain the following values:

- - - - - - - - - - - - - - - - - - - -
ABCD
test-11001100.01php - values 1
test-21002200.02php - values 2
test-31003300.03php - values 3
test-41004400.04php - values 4
test-51005500.05php - values 5
- -

Actual contents of table "php_test":

- -

-


-

-">Proceed to next test -| Change login information - -

- - - - -
Database:
User:
Password:
- - -
- - - - diff --git a/tests/odbc-t4.php b/tests/odbc-t4.php deleted file mode 100644 index 10e8f4b2d96be..0000000000000 --- a/tests/odbc-t4.php +++ /dev/null @@ -1,91 +0,0 @@ - - -Database test #4 - - -

ODBC Test 4 - Cursors

-The following test requires your ODBC driver to support positioned updates

- -

Error connecting to database! Check DSN, username and password

- - - OK

-Updating table "php_test" -1002 for update'))){ - $cursor = odbc_cursor($result); - if(($upd = odbc_prepare($conn,"update php_test set a=?, b=? where current of $cursor"))){ - while(odbc_fetch_row($result)) { - $params[0] = odbc_result($result, 1) . "(*)"; - $params[1] = odbc_result($result, 2) + 2000; - odbc_execute($upd, $params); - } - odbc_commit($conn); - } - } - if($result && $upd){ -?> - - OK

-

The table "php_test" should now contain the following values:

- - - - - - - - - - - - - - - - - - - - - - -
ABCD
test-11001100.01php3 - values 1
test-21002200.02php - values 2
test-3(*)3003300.03php - values 3
test-4(*)3004400.04php - values 4
test-5(*)3005500.05php - values 5
- Note: If you reload this testpage,
- the three last rows will contain different
values in columns A and B
-
- -

Actual contents of table "php_test":

-"; - } -?> -


-">Proceed to next test - -

- - - - -
Database:
User:
Password:
- - -
- - - diff --git a/tests/odbc-t5.php b/tests/odbc-t5.php deleted file mode 100644 index 13af52d2226d0..0000000000000 --- a/tests/odbc-t5.php +++ /dev/null @@ -1,137 +0,0 @@ - - -Database test #5 - - -

ODBC Test 5 - Blobs

- -

Please select the images (gif) you want to put into the database

-
-Image 1:

-Image 2:

-Image 3:

-Blob database type name: -

- - - - -| -

- - - -

Error connecting to database! Check DSN, username and password

- - - OK

-Images in database"; - while(odbc_fetch_into($res, &$imgs)){ - echo "$imgs[0] : \n

"; - } - }else{ - echo "Couldn't execute query"; - } - echo "\n\n"; - exit; - } -?> -Dropping table "php_test" - - - OK

-Creating table "php_test": - - - OK

-Table Info:
- - - - - - - - - - - - - -
NameTypeLength
- -Inserting data: - - - OK

-">Display Images - -

- - - - -
Database:
User:
Password:
- - -
- - - diff --git a/tests/output/flush_basic_001.phpt b/tests/output/flush_basic_001.phpt deleted file mode 100644 index d9bb6397946fd..0000000000000 --- a/tests/output/flush_basic_001.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Test basic functionality of flush() ---FILE-- - ---EXPECT-- -NULL -Outside of any user buffers -NULL \ No newline at end of file diff --git a/tests/output/flush_error_001.phpt b/tests/output/flush_error_001.phpt deleted file mode 100644 index 720c0d503b187..0000000000000 --- a/tests/output/flush_error_001.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Test wrong number of arguments for flush() (no impact) ---FILE-- - ---EXPECTF-- -Too many arguments -NULL \ No newline at end of file diff --git a/tests/output/ob_clean_basic_001.phpt b/tests/output/ob_clean_basic_001.phpt deleted file mode 100644 index c93bea3588aa8..0000000000000 --- a/tests/output/ob_clean_basic_001.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Test ob_clean() function : basic functionality ---FILE-- - ---EXPECTF-- -*** Testing ob_clean() : basic functionality *** - --- Testing ob_clean() function with Zero arguments -- - -Notice: ob_clean(): failed to delete buffer. No buffer to delete. in %s on line 12 -bool(false) -string(61) "bool(true) -Ensure the buffer is still active after the clean." -Done \ No newline at end of file diff --git a/tests/output/ob_clean_error_001.phpt b/tests/output/ob_clean_error_001.phpt deleted file mode 100644 index 7b74ff8f1aa08..0000000000000 --- a/tests/output/ob_clean_error_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ob_clean() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing ob_clean() : error conditions *** - --- Testing ob_clean() function with one argument -- - -Warning: Wrong parameter count for ob_clean() in %s on line 13 -NULL -Done \ No newline at end of file diff --git a/tests/output/ob_end_clean_basic_001.phpt b/tests/output/ob_end_clean_basic_001.phpt deleted file mode 100644 index 0b694e36ca74a..0000000000000 --- a/tests/output/ob_end_clean_basic_001.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Test return type and value, as well as basic behaviour, for ob_end_clean() ---FILE-- - ---EXPECTF-- - -Notice: ob_end_clean(): failed to delete buffer. No buffer to delete. in %s on line 7 -bool(false) -bool(true) -bool(true) - -Notice: ob_end_clean(): failed to delete buffer. No buffer to delete. in %s on line 16 -bool(false) - diff --git a/tests/output/ob_end_clean_error_001.phpt b/tests/output/ob_end_clean_error_001.phpt deleted file mode 100644 index f7b549e7243be..0000000000000 --- a/tests/output/ob_end_clean_error_001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test wrong number of arguments for ob_end_clean() ---FILE-- - ---EXPECTF-- - -Too many arguments - -Warning: Wrong parameter count for ob_end_clean() in %s on line 10 -NULL diff --git a/tests/output/ob_end_flush_basic_001.phpt b/tests/output/ob_end_flush_basic_001.phpt deleted file mode 100644 index 7515face062eb..0000000000000 --- a/tests/output/ob_end_flush_basic_001.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test ob_end_flush() function : basic functionality ---FILE-- - ---EXPECTF-- -*** Testing ob_end_flush() : basic functionality *** - --- Testing ob_end_flush() function with Zero arguments -- - -Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush. in %s on line 12 -bool(false) -bool(true) -Hello -bool(true) - -Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush. in %s on line 21 -bool(false) -Done \ No newline at end of file diff --git a/tests/output/ob_end_flush_error_001.phpt b/tests/output/ob_end_flush_error_001.phpt deleted file mode 100644 index f9e118a102ff7..0000000000000 --- a/tests/output/ob_end_flush_error_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ob_end_flush() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing ob_end_flush() : error conditions *** - --- Testing ob_end_flush() function with one argument -- - -Warning: Wrong parameter count for ob_end_flush() in %s on line 13 -NULL -Done diff --git a/tests/output/ob_flush_basic_001.phpt b/tests/output/ob_flush_basic_001.phpt deleted file mode 100644 index 91fb6952663b4..0000000000000 --- a/tests/output/ob_flush_basic_001.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -Test ob_flush() function : basic functionality ---FILE-- - ---EXPECTF-- -*** Testing ob_flush() : basic functionality *** - --- Testing ob_flush() function with Zero arguments -- - -Notice: ob_flush(): failed to flush buffer. No buffer to flush. in %s on line 12 -bool(false) -This should get flushed. -bool(true) -Ensure the buffer is still active after the flush. -bool(true) -Done \ No newline at end of file diff --git a/tests/output/ob_flush_error_001.phpt b/tests/output/ob_flush_error_001.phpt deleted file mode 100644 index 44f51785e8d30..0000000000000 --- a/tests/output/ob_flush_error_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ob_flush() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing ob_flush() : error conditions *** - --- Testing ob_flush() function with one argument -- - -Warning: Wrong parameter count for ob_flush() in %s on line 13 -NULL -Done diff --git a/tests/output/ob_get_clean_basic_001.phpt b/tests/output/ob_get_clean_basic_001.phpt deleted file mode 100644 index 07673dfac4401..0000000000000 --- a/tests/output/ob_get_clean_basic_001.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test return type and value, as well as basic behaviour, of ob_get_clean() ---FILE-- - ---EXPECTF-- -bool(false) -string(11) "Hello World" \ No newline at end of file diff --git a/tests/output/ob_get_clean_basic_002.phpt b/tests/output/ob_get_clean_basic_002.phpt deleted file mode 100644 index a5992734c621b..0000000000000 --- a/tests/output/ob_get_clean_basic_002.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Test basic behaviour of ob_get_clean() ---FILE-- - ---EXPECT-- -string(11) "hello world" \ No newline at end of file diff --git a/tests/output/ob_get_clean_error_001.phpt b/tests/output/ob_get_clean_error_001.phpt deleted file mode 100644 index 25c775700ab9c..0000000000000 --- a/tests/output/ob_get_clean_error_001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test wrong number of arguments for ob_get_clean() ---FILE-- - ---EXPECTF-- - -Too many arguments - -Warning: Wrong parameter count for ob_get_clean() in %s on line 10 -NULL \ No newline at end of file diff --git a/tests/output/ob_get_contents_basic_001.phpt b/tests/output/ob_get_contents_basic_001.phpt deleted file mode 100644 index a99024506d08b..0000000000000 --- a/tests/output/ob_get_contents_basic_001.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -Test ob_get_contents() function : basic functionality ---CREDITS-- -Iain Lewis ---FILE-- - ---EXPECTF-- -*** Testing ob_get_contents() : basic functionality *** - --- Testing ob_get_contents() function with Zero arguments -- -bool(false) -Hello World -string(12) "Hello World -" - -check that we dont have a reference -Hello World -string(12) "Hello World -" - -check that contents disappear after a flush -Hello World -string(0) "" - -check that no contents found after an end -Hello World -bool(false) -Done \ No newline at end of file diff --git a/tests/output/ob_get_contents_error_001.phpt b/tests/output/ob_get_contents_error_001.phpt deleted file mode 100644 index 10253c37a796e..0000000000000 --- a/tests/output/ob_get_contents_error_001.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Test ob_get_contents() function : error cases ---CREDITS-- -Iain Lewis ---FILE-- - ---EXPECTF-- -*** Testing ob_get_contents() : error cases *** - -Warning: Wrong parameter count for ob_get_contents() in %s on line 11 -NULL - -Warning: Wrong parameter count for ob_get_contents() in %s on line 15 -NULL -Done diff --git a/tests/output/ob_get_length_basic_001.phpt b/tests/output/ob_get_length_basic_001.phpt deleted file mode 100644 index 98469c258324e..0000000000000 --- a/tests/output/ob_get_length_basic_001.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test return type and value, as well as basic behaviour, of ob_get_length() ---FILE-- - ---EXPECTF-- -No output buffers -bool(false) -int(0) -hello -int(13) -int(0) -int(0) -No output buffers -bool(false) \ No newline at end of file diff --git a/tests/output/ob_get_length_error_001.phpt b/tests/output/ob_get_length_error_001.phpt deleted file mode 100644 index 8b461a2c1ae06..0000000000000 --- a/tests/output/ob_get_length_error_001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test wrong number of arguments for ob_get_length() ---FILE-- - ---EXPECTF-- - -Too many arguments - -Warning: Wrong parameter count for ob_get_length() in %s on line 10 -NULL \ No newline at end of file diff --git a/tests/output/ob_get_level_basic_001.phpt b/tests/output/ob_get_level_basic_001.phpt deleted file mode 100644 index 78217e4a45feb..0000000000000 --- a/tests/output/ob_get_level_basic_001.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test ob_get_level() function : basic functionality ---FILE-- - ---EXPECTF-- -*** Testing ob_get_level() : basic functionality *** - --- Testing ob_get_level() function with Zero arguments -- -int(0) -int(1) -int(2) -int(1) -int(0) - -Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush. in %s on line 26 -int(0) -Done \ No newline at end of file diff --git a/tests/output/ob_get_level_error_001.phpt b/tests/output/ob_get_level_error_001.phpt deleted file mode 100644 index 5f3e4e7ed54dd..0000000000000 --- a/tests/output/ob_get_level_error_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test ob_get_level() function : error conditions ---FILE-- - ---EXPECTF-- -*** Testing ob_get_level() : error conditions *** - --- Testing ob_get_level() function with one argument -- - -Warning: Wrong parameter count for ob_get_level() in %s on line 13 -NULL -Done \ No newline at end of file diff --git a/tests/output/ob_implicit_flush_basic_001.phpt b/tests/output/ob_implicit_flush_basic_001.phpt deleted file mode 100644 index ab6f6a7a6e02e..0000000000000 --- a/tests/output/ob_implicit_flush_basic_001.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test ob_implicit_flush() function : check return value (always null). ---FILE-- - ---EXPECTF-- -*** Testing ob_implicit_flush() : check return value *** -NULL -NULL -NULL -Done diff --git a/tests/output/ob_implicit_flush_basic_002.phpt b/tests/output/ob_implicit_flush_basic_002.phpt deleted file mode 100644 index 6b378a7f184ae..0000000000000 --- a/tests/output/ob_implicit_flush_basic_002.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test ob_implicit_flush() function : ensure implicit flushing does not apply to user buffers. ---FILE-- - ---EXPECTF-- -*** Testing ob_implicit_flush() : ensure implicit flushing does not apply to user buffers. *** -Done \ No newline at end of file diff --git a/tests/output/ob_implicit_flush_error_001.phpt b/tests/output/ob_implicit_flush_error_001.phpt deleted file mode 100644 index d4d14c6fb72a1..0000000000000 --- a/tests/output/ob_implicit_flush_error_001.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test ob_implicit_flush() function : wrong number of arguments ---FILE-- - ---EXPECTF-- -*** Testing ob_implicit_flush() : error conditions *** - --- Testing ob_implicit_flush() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for ob_implicit_flush() in %s on line 15 -NULL -Done \ No newline at end of file diff --git a/tests/output/ob_implicit_flush_variation_001.phpt b/tests/output/ob_implicit_flush_variation_001.phpt deleted file mode 100644 index e10bd493e482a..0000000000000 --- a/tests/output/ob_implicit_flush_variation_001.phpt +++ /dev/null @@ -1,182 +0,0 @@ ---TEST-- -Test ob_implicit_flush() function : usage variation ---FILE-- - 1, 'two' => 2); - -//array of values to iterate over -$inputs = array( - - // float data - 'float 10.5' => 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - - // array data - 'empty array' => array(), - 'int indexed array' => $index_array, - 'associative array' => $assoc_array, - 'nested arrays' => array('foo', $index_array, $assoc_array), - - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - - // boolean data - 'lowercase true' => true, - 'lowercase false' =>false, - 'uppercase TRUE' =>TRUE, - 'uppercase FALSE' =>FALSE, - - // empty data - 'empty string DQ' => "", - 'empty string SQ' => '', - - // string data - 'string DQ' => "string", - 'string SQ' => 'string', - 'mixed case string' => "sTrInG", - 'heredoc' => $heredoc, - - // object data - 'instance of classWithToString' => new classWithToString(), - 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, -); - -// loop through each element of the array for flag - -foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( ob_implicit_flush($value) ); -}; - -?> ---EXPECTF-- -*** Testing ob_implicit_flush() : usage variation *** - ---float 10.5-- -NULL - ---float -10.5-- -NULL - ---float 12.3456789000e10-- -NULL - ---float -12.3456789000e10-- -NULL - ---float .5-- -NULL - ---empty array-- -NULL - ---int indexed array-- -NULL - ---associative array-- -NULL - ---nested arrays-- -NULL - ---uppercase NULL-- -NULL - ---lowercase null-- -NULL - ---lowercase true-- -NULL - ---lowercase false-- -NULL - ---uppercase TRUE-- -NULL - ---uppercase FALSE-- -NULL - ---empty string DQ-- -NULL - ---empty string SQ-- -NULL - ---string DQ-- -NULL - ---string SQ-- -NULL - ---mixed case string-- -NULL - ---heredoc-- -NULL - ---instance of classWithToString-- -Error: 8 - Object of class classWithToString could not be converted to int, %s(97) -NULL - ---instance of classWithoutToString-- -Error: 8 - Object of class classWithoutToString could not be converted to int, %s(97) -NULL - ---undefined var-- -NULL - ---unset var-- -NULL \ No newline at end of file diff --git a/tests/output/ob_start_basic_001.phpt b/tests/output/ob_start_basic_001.phpt deleted file mode 100644 index d93a7313b8522..0000000000000 --- a/tests/output/ob_start_basic_001.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Test return type and value for ob_start() ---FILE-- - ---EXPECT-- -bool(true) \ No newline at end of file diff --git a/tests/output/ob_start_basic_002.phpt b/tests/output/ob_start_basic_002.phpt deleted file mode 100644 index 92d9069f32ff9..0000000000000 --- a/tests/output/ob_start_basic_002.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -ob_start(): Check behaviour with various callback return values. ---FILE-- - Use callback '$callback':\n"; - ob_start($callback); - echo 'My output.'; - ob_end_flush(); - echo "\n\n"; -} - -?> -==DONE== ---EXPECTF-- ---> Use callback 'return_empty_string': - - ---> Use callback 'return_false': -My output. - ---> Use callback 'return_null': - - ---> Use callback 'return_string': -I stole your output. - ---> Use callback 'return_zero': -0 - -==DONE== \ No newline at end of file diff --git a/tests/output/ob_start_basic_003.phpt b/tests/output/ob_start_basic_003.phpt deleted file mode 100644 index ebd883af73bd9..0000000000000 --- a/tests/output/ob_start_basic_003.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -ob_start(): ensure even fatal error test is affected by output buffering. ---FILE-- - ---EXPECTF-- -I have stolen your output \ No newline at end of file diff --git a/tests/output/ob_start_basic_004.phpt b/tests/output/ob_start_basic_004.phpt deleted file mode 100644 index 39d3aadc49e87..0000000000000 --- a/tests/output/ob_start_basic_004.phpt +++ /dev/null @@ -1,122 +0,0 @@ ---TEST-- -ob_start() chunk_size: confirm buffer is flushed after any output call that causes its length to equal or exceed chunk_size. ---FILE-- - ---EXPECTF-- - -----( chunk_size: -1, output append size: 1 )---- -f[call:1; len:8]12345678 - -----( chunk_size: 0, output append size: 1 )---- -f[call:1; len:8]12345678 - -----( chunk_size: 1, output append size: 1 )---- -f[call:1; len:8]12345678 - -----( chunk_size: 2, output append size: 1 )---- -f[call:1; len:2]12 -f[call:2; len:2]34 -f[call:3; len:2]56 -f[call:4; len:2]78 -f[call:5; len:0] - -----( chunk_size: 3, output append size: 1 )---- -f[call:1; len:3]123 -f[call:2; len:3]456 -f[call:3; len:2]78 - -----( chunk_size: 4, output append size: 1 )---- -f[call:1; len:4]1234 -f[call:2; len:4]5678 -f[call:3; len:0] - -----( chunk_size: 5, output append size: 1 )---- -f[call:1; len:5]12345 -f[call:2; len:3]678 - -----( chunk_size: 6, output append size: 1 )---- -f[call:1; len:6]123456 -f[call:2; len:2]78 - -----( chunk_size: 7, output append size: 1 )---- -f[call:1; len:7]1234567 -f[call:2; len:1]8 - -----( chunk_size: 8, output append size: 1 )---- -f[call:1; len:8]12345678 -f[call:2; len:0] - -----( chunk_size: 9, output append size: 1 )---- -f[call:1; len:8]12345678 - -----( chunk_size: -1, output append size: 4 )---- -f[call:1; len:8]12345678 - -----( chunk_size: 0, output append size: 4 )---- -f[call:1; len:8]12345678 - -----( chunk_size: 1, output append size: 4 )---- -f[call:1; len:8]12345678 - -----( chunk_size: 2, output append size: 4 )---- -f[call:1; len:4]1234 -f[call:2; len:4]5678 -f[call:3; len:0] - -----( chunk_size: 3, output append size: 4 )---- -f[call:1; len:4]1234 -f[call:2; len:4]5678 -f[call:3; len:0] - -----( chunk_size: 4, output append size: 4 )---- -f[call:1; len:4]1234 -f[call:2; len:4]5678 -f[call:3; len:0] - -----( chunk_size: 5, output append size: 4 )---- -f[call:1; len:8]12345678 -f[call:2; len:0] - -----( chunk_size: 6, output append size: 4 )---- -f[call:1; len:8]12345678 -f[call:2; len:0] - -----( chunk_size: 7, output append size: 4 )---- -f[call:1; len:8]12345678 -f[call:2; len:0] - -----( chunk_size: 8, output append size: 4 )---- -f[call:1; len:8]12345678 -f[call:2; len:0] - -----( chunk_size: 9, output append size: 4 )---- -f[call:1; len:8]12345678 \ No newline at end of file diff --git a/tests/output/ob_start_basic_005.phpt b/tests/output/ob_start_basic_005.phpt deleted file mode 100644 index e449503083cc1..0000000000000 --- a/tests/output/ob_start_basic_005.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -ob_start(): don't allow non-static functions as static callbacks. ---FILE-- -0) { - ob_end_flush(); - } -} - -var_dump(ob_start('C::h')); -checkAndClean(); - -?> ---EXPECT-- -bool(false) -Array -( -) \ No newline at end of file diff --git a/tests/output/ob_start_basic_006.phpt b/tests/output/ob_start_basic_006.phpt deleted file mode 100644 index e24ebd61c3ddb..0000000000000 --- a/tests/output/ob_start_basic_006.phpt +++ /dev/null @@ -1,134 +0,0 @@ ---TEST-- -ob_start(): multiple buffer initialization with a single call, using arrays. ---FILE-- -id = $id; - } - - static function g($string) { - static $i=0; - $i++; - $len = strlen($string); - return "C::g[call:$i; len:$len] - $string\n"; - } - - function h($string) { - static $i=0; - $i++; - $len = strlen($string); - return "C::h[call:$i; len:$len; id:$this->id] - $string\n"; - } -} - -function checkAndClean() { - print_r(ob_list_handlers()); - while (ob_get_level()>0) { - ob_end_flush(); - } -} - -echo "\n ---> Test arrays: \n"; -var_dump(ob_start(array("f"))); -checkAndClean(); - -var_dump(ob_start(array("f", "f"))); -checkAndClean(); - -var_dump(ob_start(array("f", "C::g", "f", "C::g"))); -checkAndClean(); - -var_dump(ob_start(array("f", "non_existent", "f"))); -checkAndClean(); - -var_dump(ob_start(array("f", "non_existent", "f", "f"))); -checkAndClean(); - -$c = new c('originalID'); -var_dump(ob_start(array($c, "h"))); -checkAndClean(); - -var_dump(ob_start(array($c, "h"))); -$c->id = 'changedID'; -checkAndClean(); - -$c->id = 'changedIDagain'; -var_dump(ob_start(array('f', 'C::g', array(array($c, "g"), array($c, "h"))))); -checkAndClean(); -?> ---EXPECTF-- - - ---> Test arrays: -f[call:1; len:34] - bool(true) -Array -( - [0] => f -) - -f[call:3; len:68] - f[call:2; len:47] - bool(true) -Array -( - [0] => f - [1] => f -) - - -f[call:5; len:150] - C::g[call:2; len:125] - f[call:4; len:103] - C::g[call:1; len:79] - bool(true) -Array -( - [0] => f - [1] => C::g - [2] => f - [3] => C::g -) - - - - -f[call:6; len:35] - bool(false) -Array -( - [0] => f -) - -f[call:7; len:35] - bool(false) -Array -( - [0] => f -) - -C::h[call:1; len:37; id:originalID] - bool(true) -Array -( - [0] => C::h -) - -C::h[call:2; len:37; id:changedID] - bool(true) -Array -( - [0] => C::h -) - -f[call:8; len:175] - C::g[call:4; len:150] - C::g[call:3; len:125] - C::h[call:3; len:82; id:changedIDagain] - bool(true) -Array -( - [0] => f - [1] => C::g - [2] => C::g - [3] => C::h -) \ No newline at end of file diff --git a/tests/output/ob_start_basic_unerasable_001.phpt b/tests/output/ob_start_basic_unerasable_001.phpt deleted file mode 100644 index 8e7280eddafef..0000000000000 --- a/tests/output/ob_start_basic_unerasable_001.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -ob_start(): Ensure content of unerasable buffer can be accessed by ob_get_contents(). ---FILE-- - -==DONE== ---EXPECTF-- -[callback:1]This call will obtain the content: -string(35) "This call will obtain the content: -" -==DONE== \ No newline at end of file diff --git a/tests/output/ob_start_basic_unerasable_002.phpt b/tests/output/ob_start_basic_unerasable_002.phpt deleted file mode 100644 index 2ffcbb9dc1626..0000000000000 --- a/tests/output/ob_start_basic_unerasable_002.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -ob_start(): Ensure unerasable buffer cannot be erased by ob_clean(), ob_end_clean() or ob_end_flush(). ---FILE-- - ---EXPECTF-- -[callback:1]All of the following calls will fail to clean/remove the topmost buffer: - -Notice: ob_clean(): failed to delete buffer callback. in %s on line 11 -bool(false) - -Notice: ob_end_clean(): failed to delete buffer callback. in %s on line 12 -bool(false) - -Notice: ob_end_flush(): failed to delete buffer callback. in %s on line 13 -bool(false) -The OB nesting will still be 1 level deep: -int(1) \ No newline at end of file diff --git a/tests/output/ob_start_basic_unerasable_003.phpt b/tests/output/ob_start_basic_unerasable_003.phpt deleted file mode 100644 index d20141453377c..0000000000000 --- a/tests/output/ob_start_basic_unerasable_003.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -ob_start(): Ensure unerasable buffer cannot be accessed or erased by ob_get_clean(). ---FILE-- - ---EXPECTF-- -[callback:1]This call will fail to obtain the content, since it is also requesting a clean: - -Notice: ob_get_clean(): failed to delete buffer callback. in %s on line 11 -bool(false) \ No newline at end of file diff --git a/tests/output/ob_start_basic_unerasable_004.phpt b/tests/output/ob_start_basic_unerasable_004.phpt deleted file mode 100644 index 88fdda5b3fb1e..0000000000000 --- a/tests/output/ob_start_basic_unerasable_004.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -ob_start(): Ensure unerasable buffer cannot be accessed or flushed by ob_get_flush(). ---FILE-- - ---EXPECTF-- -[callback:1]This call will fail to flush and fail to obtain the content: - -Notice: ob_get_flush(): failed to delete buffer callback. in %s on line 11 -bool(false) \ No newline at end of file diff --git a/tests/output/ob_start_basic_unerasable_005.phpt b/tests/output/ob_start_basic_unerasable_005.phpt deleted file mode 100644 index 48d611c9c0554..0000000000000 --- a/tests/output/ob_start_basic_unerasable_005.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ob_start(): Ensure unerasable buffer cannot be flushed by ob_flush(). ---XFAIL-- -On PHP5, ob_flush() DOES clear the buffer. See bug: 46897 ---FILE-- - ---EXPECTF-- -[callback:1]Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer callback in %s on line 11 -bool(false) -string(%d) "Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer callback in %s on line 11 -bool(false) -" \ No newline at end of file diff --git a/tests/output/ob_start_error_001.phpt b/tests/output/ob_start_error_001.phpt deleted file mode 100644 index b1a52e3213495..0000000000000 --- a/tests/output/ob_start_error_001.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Test wrong number of arguments and wrong arg types for ob_start() ---FILE-- - ---EXPECTF-- - -- Too many arguments - -Warning: ob_start() expects at most 3 parameters, 4 given in %s on line 17 -bool(false) - -- Arg 1 wrong type -bool(true) - -- Arg 2 wrong type - -Warning: ob_start() expects parameter 2 to be long, string given in %s on line 23 -bool(false) - -- Arg 3 wrong type -bool(true) \ No newline at end of file diff --git a/tests/output/ob_start_error_002.phpt b/tests/output/ob_start_error_002.phpt deleted file mode 100644 index aca2ad9d2cf59..0000000000000 --- a/tests/output/ob_start_error_002.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test wrong number of arguments and wrong arg types for ob_start() ---FILE-- - ---EXPECTF-- -bool(false) -bool(false) -bool(false) -bool(false) -done \ No newline at end of file diff --git a/tests/output/ob_start_error_003.phpt b/tests/output/ob_start_error_003.phpt deleted file mode 100644 index d26e38b9da83c..0000000000000 --- a/tests/output/ob_start_error_003.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test ob_start() with object supplied but no method. ---FILE-- - ---EXPECTF-- -Fatal error: ob_start(): No method name given: use ob_start(array($object,'method')) to specify instance $object and the name of a method of class C to use as output handler in %s on line 11 \ No newline at end of file diff --git a/tests/output/ob_start_error_004.phpt b/tests/output/ob_start_error_004.phpt deleted file mode 100644 index 2742476023375..0000000000000 --- a/tests/output/ob_start_error_004.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test ob_start() with non existent callback method. ---FILE-- - ---EXPECTF-- -Fatal error: ob_start(): No method name given: use ob_start(array($object,'method')) to specify instance $object and the name of a method of class C to use as output handler in %s on line 11 \ No newline at end of file diff --git a/tests/output/ob_start_error_005.phpt b/tests/output/ob_start_error_005.phpt deleted file mode 100644 index 3e503c6354e6a..0000000000000 --- a/tests/output/ob_start_error_005.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -ob_start(): ensure buffers can't be added from within callback. ---FILE-- - ---EXPECTF-- -Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line 9 \ No newline at end of file diff --git a/tests/quicktester.inc b/tests/quicktester.inc deleted file mode 100644 index 48ed6b549fa01..0000000000000 --- a/tests/quicktester.inc +++ /dev/null @@ -1,75 +0,0 @@ -$test) -{ - // ignore empty lines - if (!$test) continue; - - // warn for trailing ; - if (substr(trim($test), -1, 1) === ';') { - echo "WARNING: trailing ';' found in test ".($n+1)."\n"; - exit; - } - - // try for operators - $operators = array('===', '~=='); - $operator = NULL; - foreach ($operators as $a_operator) { - if (strpos($test, $a_operator)!== FALSE) { - $operator = $a_operator; - list($left,$right) = explode($operator, $test); - break; - } - } - if (!$operator) { - echo "WARNING: unknown operator in '$test' (1)\n"; - exit; - } - - $left = eval("return ($left );"); - $right = eval("return ($right);"); - switch (@$operator) { - case '===': // exact match - $result = $left === $right; - break; - case '~==': // may differ after 12th significant number - if ( !is_float($left ) && !is_int($left ) - || !is_float($right) && !is_int($right)) { - $result = FALSE; - break; - } - $result = abs(($left-$right) / $left) < 1e-12; - break; - default: - echo "WARNING: unknown operator in '$test' (2)\n"; - exit; - } - - $success = $success && $result; - if (!$result) { - echo "\nAssert failed:\n"; - echo "$test\n"; - echo "Left: ";var_dump($left ); - echo "Right: ";var_dump($right); - } -} -if ($success) echo "OK"; - diff --git a/tests/recurse b/tests/recurse deleted file mode 100644 index 5b8c646f6b733..0000000000000 --- a/tests/recurse +++ /dev/null @@ -1,21 +0,0 @@ - ---EXPECT-- -string(1) "=" \ No newline at end of file diff --git a/tests/run-test/test005.phpt b/tests/run-test/test005.phpt deleted file mode 100644 index d16a66ef7a0a8..0000000000000 --- a/tests/run-test/test005.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Error message handling (without ZendOptimizer) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(1) "1" -string(4) "8191" -string(1) "0" -string(1) "1" -string(1) "0" -NULL -string(%d) "%sivision by zer%s" diff --git a/tests/run-test/test006.phpt b/tests/run-test/test006.phpt deleted file mode 100644 index 4dca66a4f717b..0000000000000 --- a/tests/run-test/test006.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Error messages are shown ---FILE-- - ---EXPECTREGEX-- -.*Division by zero.* diff --git a/tests/run-test/test007.phpt b/tests/run-test/test007.phpt deleted file mode 100644 index f5f934f72ef22..0000000000000 Binary files a/tests/run-test/test007.phpt and /dev/null differ diff --git a/tests/run-test/test008.phpt b/tests/run-test/test008.phpt deleted file mode 100644 index 41733d96f7cb4..0000000000000 --- a/tests/run-test/test008.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Error message handling (with ZendOptimizer) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -%s: %sivision by zero in %s on line %d -string(1) "1" -string(4) "8191" -string(1) "0" -string(1) "1" -string(1) "0" -string(%d) "%sivision by zer%s" -string(%d) "%sivision by zer%s" diff --git a/tests/run-test/test008a.phpt b/tests/run-test/test008a.phpt deleted file mode 100644 index a7d360dc64e7c..0000000000000 --- a/tests/run-test/test008a.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Error message handling (without ZendOptimizer) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(1) "1" -string(4) "8191" -string(1) "0" -string(1) "1" -string(1) "0" -NULL -string(%d) "%sivision by zer%s" diff --git a/tests/run-test/test009.phpt b/tests/run-test/test009.phpt deleted file mode 100644 index 650686f69017d..0000000000000 --- a/tests/run-test/test009.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -print_r(Object) ---FILE-- - ---EXPECTF-- -Foo Object -( -) diff --git a/tests/run-test/test010.phpt b/tests/run-test/test010.phpt deleted file mode 100644 index cc3ca3591ec5a..0000000000000 --- a/tests/run-test/test010.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -STDIN input ---FILE-- - ---STDIN-- -fooBar -use this to input some thing to the php script ---EXPECT-- -string(54) "fooBar -use this to input some thing to the php script -" -string(0) "" -string(0) "" diff --git a/tests/run.html b/tests/run.html deleted file mode 100644 index 281e9e57c8b7d..0000000000000 --- a/tests/run.html +++ /dev/null @@ -1,11 +0,0 @@ - - -
- -
- -
- - - diff --git a/tests/run.php b/tests/run.php deleted file mode 100644 index a6792b5af72c7..0000000000000 --- a/tests/run.php +++ /dev/null @@ -1,17 +0,0 @@ - - - -Executing:
-"); -?> -
- - - \ No newline at end of file diff --git a/tests/scan_cases b/tests/scan_cases deleted file mode 100644 index d562230fde115..0000000000000 --- a/tests/scan_cases +++ /dev/null @@ -1,28 +0,0 @@ -# Test file used by testscanf.php. Feel free to add additional cases -# sscanf test cases. formatted to be slurped and split by explode -%d|48| valid decimal (positive) -%d|-98| valid signed decimal (negative) -%d|56a| integer scan : decimal digit followed by alpha -%4d|558071|decimal integer with width specification -%i|-5489|valid signed integer (negative) -%s| the rain in spain | plain ole string matched with %s -%10s|jabberwocky| string with width specifier -%f|289.071| valid float (%f) -%f|-0.403| valid negative (%f) -%3f|76.4|Float with width specifier ending at decimal point -%3f"|789.4|Float with width specifier -%o|0321|octal with leading 0 -%o|327| valid octal digits -%o|380| octal scan with octal digit followed by non-octal -%x|fe| valid hex| -%x|0xfe| "c" style hex with leading 0x| -%x|455| hex with all single digits < f -%x|-98| hex (negative signed int) -%c|y| single char -%4c|tulips|Character with width specification (4) -%e|10e-9| signed floating point with negative exponent -%e|10e+9| signed floating point with explicit positive exponent -%e|10e9| signed floating point with positive exponent (no + sign) -# next we test multiple cases - %d %i %o %u %x %s %c %e %f %g | 19 84 0666 2000 0xface your x 31e+9 0.912 2.4 |multiple specifiers - diff --git a/tests/security/magic_quotes_gpc.phpt b/tests/security/magic_quotes_gpc.phpt deleted file mode 100644 index eb5b84242a5a0..0000000000000 --- a/tests/security/magic_quotes_gpc.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Test if magic_quotes_gpc works as expected ---INI-- -magic_quotes_gpc=1 ---GET-- -a=abc'"%00123 ---FILE-- - ---EXPECT-- -abc\'\"\0123 diff --git a/tests/security/open_basedir.inc b/tests/security/open_basedir.inc deleted file mode 100644 index 7fd0afc8bb0f1..0000000000000 --- a/tests/security/open_basedir.inc +++ /dev/null @@ -1,133 +0,0 @@ - - diff --git a/tests/security/open_basedir_chdir.phpt b/tests/security/open_basedir_chdir.phpt deleted file mode 100644 index 32ed4eb1ec9b3..0000000000000 --- a/tests/security/open_basedir_chdir.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [chdir] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: chdir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chdir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chdir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chdir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chdir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chdir(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -*** Finished testing open_basedir configuration [chdir] *** - diff --git a/tests/security/open_basedir_chmod.phpt b/tests/security/open_basedir_chmod.phpt deleted file mode 100644 index 02fdce5a1b879..0000000000000 --- a/tests/security/open_basedir_chmod.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [chmod] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: chmod(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chmod(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chmod(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chmod(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chmod(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chmod(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chmod(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: chmod(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [chmod] *** - diff --git a/tests/security/open_basedir_copy.phpt b/tests/security/open_basedir_copy.phpt deleted file mode 100644 index 9faaa82ac065c..0000000000000 --- a/tests/security/open_basedir_copy.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [copy] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: copy(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d - -Warning: copy(../bad): failed to open stream: %s in %s on line %d -bool(false) - -Warning: copy(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: copy(../bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: copy(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d - -Warning: copy(..): failed to open stream: %s in %s on line %d -bool(false) - -Warning: copy(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d - -Warning: copy(../): failed to open stream: %s in %s on line %d -bool(false) - -Warning: copy(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d - -Warning: copy(/): failed to open stream: %s in %s on line %d -bool(false) - -Warning: copy(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d - -Warning: copy(../bad/.): failed to open stream: %s in %s on line %d -bool(false) - -Warning: copy(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: copy(../bad/./bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: copy(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d - -Warning: copy(./../.): failed to open stream: %s in %s on line %d -bool(false) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [copy] *** - diff --git a/tests/security/open_basedir_copy_variation1.phpt b/tests/security/open_basedir_copy_variation1.phpt deleted file mode 100644 index de532e12cb0dc..0000000000000 --- a/tests/security/open_basedir_copy_variation1.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [copy] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: copy(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: unlink(copy.txt): No such file or directory in %s on line %d -bool(false) -*** Finished testing open_basedir configuration [copy] *** - diff --git a/tests/security/open_basedir_dir.phpt b/tests/security/open_basedir_dir.phpt deleted file mode 100644 index c6e331be1c8b9..0000000000000 --- a/tests/security/open_basedir_dir.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [dir] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: dir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d - -Warning: dir(../bad): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: dir(../bad/bad.txt): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d - -Warning: dir(..): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d - -Warning: dir(../): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d - -Warning: dir(/): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d - -Warning: dir(../bad/.): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: dir(%s/test/bad/bad.txt): failed to open dir: %s in %s on line %d -bool(false) - -Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: dir(%s/test/bad/../bad/bad.txt): failed to open dir: %s in %s on line %d -bool(false) -object(Directory)#%d (2) { - ["path"]=> - string(%d) "%s/test/ok/" - ["handle"]=> - resource(%d) of type (stream) -} -object(Directory)#%d (2) { - ["path"]=> - string(%d) "%s/test/ok" - ["handle"]=> - resource(%d) of type (stream) -} -object(Directory)#%d (2) { - ["path"]=> - string(%d) "%s/test/ok/../ok" - ["handle"]=> - resource(%d) of type (stream) -} -*** Finished testing open_basedir configuration [dir] *** - diff --git a/tests/security/open_basedir_disk_free_space.phpt b/tests/security/open_basedir_disk_free_space.phpt deleted file mode 100644 index e3e36e670a3b4..0000000000000 --- a/tests/security/open_basedir_disk_free_space.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [disk_free_space] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: disk_free_space(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: disk_free_space(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: disk_free_space(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: disk_free_space(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: disk_free_space(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: disk_free_space(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: disk_free_space(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: disk_free_space(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) -float(%s) -*** Finished testing open_basedir configuration [disk_free_space] *** diff --git a/tests/security/open_basedir_error_log.phpt b/tests/security/open_basedir_error_log.phpt deleted file mode 100644 index 581dd3f57e4e2..0000000000000 --- a/tests/security/open_basedir_error_log.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. -error_log= ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [error_log] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: ini_set(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: ini_set(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: ini_set(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) -string(0) "" -string(%d) "%s/test/ok/ok.txt" -*** Finished testing open_basedir configuration [error_log] *** - diff --git a/tests/security/open_basedir_error_log_variation.phpt b/tests/security/open_basedir_error_log_variation.phpt deleted file mode 100644 index d169a213e92a0..0000000000000 --- a/tests/security/open_basedir_error_log_variation.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [error_log] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: error_log(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: error_log(%s/test/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: error_log(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: error_log(%s/bad.txt): failed to open stream: %s in %s on line %d -bool(false) -bool(true) -*** Finished testing open_basedir configuration [error_log] *** - diff --git a/tests/security/open_basedir_file.phpt b/tests/security/open_basedir_file.phpt deleted file mode 100644 index 36daa54e009c8..0000000000000 --- a/tests/security/open_basedir_file.phpt +++ /dev/null @@ -1,88 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [file] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: file(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d - -Warning: file(../bad): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file(../bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d - -Warning: file(..): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d - -Warning: file(../): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d - -Warning: file(/): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d - -Warning: file(../bad/.): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file(%s/test/bad/../bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) -array(1) { - [0]=> - string(12) "Hello World!" -} -array(1) { - [0]=> - string(12) "Hello World!" -} -array(1) { - [0]=> - string(12) "Hello World!" -} -array(1) { - [0]=> - string(12) "Hello World!" -} -*** Finished testing open_basedir configuration [file] *** - diff --git a/tests/security/open_basedir_file_exists.phpt b/tests/security/open_basedir_file_exists.phpt deleted file mode 100644 index c249fc1165433..0000000000000 --- a/tests/security/open_basedir_file_exists.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [file_exists] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: file_exists(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: file_exists(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: file_exists(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: file_exists(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: file_exists(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: file_exists(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: file_exists(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: file_exists(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: file_exists(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [file_exists] *** - diff --git a/tests/security/open_basedir_file_get_contents.phpt b/tests/security/open_basedir_file_get_contents.phpt deleted file mode 100644 index db117e4775fd7..0000000000000 --- a/tests/security/open_basedir_file_get_contents.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [file_get_contents] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: file_get_contents(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_get_contents(../bad): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_get_contents(../bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_get_contents(..): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_get_contents(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_get_contents(../): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_get_contents(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_get_contents(/): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_get_contents(../bad/.): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_get_contents(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_get_contents(%s/test/bad/../bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) -string(12) "Hello World!" -string(12) "Hello World!" -string(12) "Hello World!" -string(12) "Hello World!" -*** Finished testing open_basedir configuration [file_get_contents] *** diff --git a/tests/security/open_basedir_file_put_contents.phpt b/tests/security/open_basedir_file_put_contents.phpt deleted file mode 100644 index 720c81dfe2c33..0000000000000 --- a/tests/security/open_basedir_file_put_contents.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [file_put_contents] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: file_put_contents(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_put_contents(../bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_put_contents(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_put_contents(.././bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_put_contents(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_put_contents(../bad/../bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_put_contents(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_put_contents(./.././bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: file_put_contents(): open_basedir restriction in effect. File%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: file_put_contents%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) -*** Finished testing open_basedir configuration [file_put_contents] *** - diff --git a/tests/security/open_basedir_fileatime.phpt b/tests/security/open_basedir_fileatime.phpt deleted file mode 100644 index 02cc94f83f2a7..0000000000000 --- a/tests/security/open_basedir_fileatime.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [fileatime] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: fileatime(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileatime(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileatime(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileatime(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileatime(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileatime(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileatime(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileatime(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileatime(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -*** Finished testing open_basedir configuration [fileatime] *** - diff --git a/tests/security/open_basedir_filectime.phpt b/tests/security/open_basedir_filectime.phpt deleted file mode 100644 index 542c8423edb5e..0000000000000 --- a/tests/security/open_basedir_filectime.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [filectime] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: filectime(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filectime(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filectime(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filectime(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filectime(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filectime(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filectime(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filectime(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filectime(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -*** Finished testing open_basedir configuration [filectime] *** - diff --git a/tests/security/open_basedir_filegroup.phpt b/tests/security/open_basedir_filegroup.phpt deleted file mode 100644 index 5f6279aa8f575..0000000000000 --- a/tests/security/open_basedir_filegroup.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [filegroup] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: filegroup(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filegroup(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filegroup(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filegroup(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filegroup(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filegroup(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filegroup(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filegroup(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filegroup(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -*** Finished testing open_basedir configuration [filegroup] *** - diff --git a/tests/security/open_basedir_fileinode.phpt b/tests/security/open_basedir_fileinode.phpt deleted file mode 100644 index 070c2c806c3f9..0000000000000 --- a/tests/security/open_basedir_fileinode.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [fileinode] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: fileinode(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileinode(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileinode(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileinode(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileinode(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileinode(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileinode(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileinode(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileinode(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -*** Finished testing open_basedir configuration [fileinode] *** - diff --git a/tests/security/open_basedir_filemtime.phpt b/tests/security/open_basedir_filemtime.phpt deleted file mode 100644 index 7213ddb5b9fdf..0000000000000 --- a/tests/security/open_basedir_filemtime.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [filemtime] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: filemtime(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filemtime(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filemtime(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filemtime(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filemtime(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filemtime(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filemtime(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filemtime(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filemtime(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -*** Finished testing open_basedir configuration [filemtime] *** - diff --git a/tests/security/open_basedir_fileowner.phpt b/tests/security/open_basedir_fileowner.phpt deleted file mode 100644 index b363b7e0e85fc..0000000000000 --- a/tests/security/open_basedir_fileowner.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [fileowner] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: fileowner(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileowner(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileowner(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileowner(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileowner(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileowner(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileowner(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileowner(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileowner(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -*** Finished testing open_basedir configuration [fileowner] *** - diff --git a/tests/security/open_basedir_fileperms.phpt b/tests/security/open_basedir_fileperms.phpt deleted file mode 100644 index a1e6511b082b9..0000000000000 --- a/tests/security/open_basedir_fileperms.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [fileperms] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: fileperms(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileperms(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileperms(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileperms(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileperms(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileperms(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileperms(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileperms(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: fileperms(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -*** Finished testing open_basedir configuration [fileperms] *** - diff --git a/tests/security/open_basedir_filesize.phpt b/tests/security/open_basedir_filesize.phpt deleted file mode 100644 index a335dfd17cf26..0000000000000 --- a/tests/security/open_basedir_filesize.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [filesize] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: filesize(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filesize(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filesize(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filesize(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filesize(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filesize(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filesize(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filesize(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filesize(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) -*** Finished testing open_basedir configuration [filesize] *** - diff --git a/tests/security/open_basedir_filetype.phpt b/tests/security/open_basedir_filetype.phpt deleted file mode 100644 index 5091db56f9a5d..0000000000000 --- a/tests/security/open_basedir_filetype.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [filetype] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: filetype(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filetype(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filetype(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filetype(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filetype(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filetype(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filetype(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filetype(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: filetype(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -string(3) "dir" -string(4) "file" -string(4) "file" -string(4) "file" -string(4) "file" -*** Finished testing open_basedir configuration [filetype] *** - diff --git a/tests/security/open_basedir_fopen.phpt b/tests/security/open_basedir_fopen.phpt deleted file mode 100644 index e90bf3e2bcba8..0000000000000 --- a/tests/security/open_basedir_fopen.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [fopen] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: fopen(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d - -Warning: fopen(../bad): failed to open stream: %s in %s on line %d -bool(false) - -Warning: fopen(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: fopen(../bad/bad.txt): failed to open stream: %s in %s on line %d -bool(false) - -Warning: fopen(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d - -Warning: fopen(..): failed to open stream: %s in %s on line %d -bool(false) - -Warning: fopen(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d - -Warning: fopen(../): failed to open stream: %s in %s on line %d -bool(false) - -Warning: fopen(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d - -Warning: fopen(/): failed to open stream: %s in %s on line %d -bool(false) - -Warning: fopen(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d - -Warning: fopen(../bad/.): failed to open stream: %s in %s on line %d -bool(false) - -Warning: fopen(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: fopen(../bad/./bad.txt): failed to open stream: %s in %s on line 12 -bool(false) - -Warning: fopen(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d - -Warning: fopen(./../.): failed to open stream: %s in %s on line %d -bool(false) -resource(%d) of type (stream) -resource(%d) of type (stream) -resource(%d) of type (stream) -resource(%d) of type (stream) -resource(%d) of type (stream) -*** Finished testing open_basedir configuration [fopen] *** - diff --git a/tests/security/open_basedir_glob-win32.phpt b/tests/security/open_basedir_glob-win32.phpt deleted file mode 100644 index 3fa19afa365b2..0000000000000 --- a/tests/security/open_basedir_glob-win32.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- - ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [glob] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -bool(false) -array(0) { -} -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -array(1) { - [0]=> - string(5) "../ok" -} -array(1) { - [0]=> - string(6) "ok.txt" -} -array(1) { - [0]=> - string(12) "../ok/ok.txt" -} -array(1) { - [0]=> - string(%d) "%s/test/ok/ok.txt" -} -array(1) { - [0]=> - string(%d) "%s/test/ok/../ok/ok.txt" -} -*** Finished testing open_basedir configuration [glob] *** - diff --git a/tests/security/open_basedir_glob.phpt b/tests/security/open_basedir_glob.phpt deleted file mode 100644 index 591cd8f4f7e2e..0000000000000 --- a/tests/security/open_basedir_glob.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- - ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [glob] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -array(1) { - [0]=> - string(5) "../ok" -} -array(1) { - [0]=> - string(6) "ok.txt" -} -array(1) { - [0]=> - string(12) "../ok/ok.txt" -} -array(1) { - [0]=> - string(%d) "%s/test/ok/ok.txt" -} -array(1) { - [0]=> - string(%d) "%s/test/ok/../ok/ok.txt" -} -*** Finished testing open_basedir configuration [glob] *** - diff --git a/tests/security/open_basedir_is_dir.phpt b/tests/security/open_basedir_is_dir.phpt deleted file mode 100644 index e4ad620d74061..0000000000000 --- a/tests/security/open_basedir_is_dir.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [is_dir] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: is_dir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_dir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_dir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_dir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_dir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_dir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_dir(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(false) -bool(false) -bool(false) -bool(false) -*** Finished testing open_basedir configuration [is_dir] *** - diff --git a/tests/security/open_basedir_is_executable.phpt b/tests/security/open_basedir_is_executable.phpt deleted file mode 100644 index 1bab860557f58..0000000000000 --- a/tests/security/open_basedir_is_executable.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [is_executable] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: is_executable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_executable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_executable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_executable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_executable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_executable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -*** Finished testing open_basedir configuration [is_executable] *** diff --git a/tests/security/open_basedir_is_file.phpt b/tests/security/open_basedir_is_file.phpt deleted file mode 100644 index 51ef0a2d1f3bb..0000000000000 --- a/tests/security/open_basedir_is_file.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [is_file] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: is_file(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_file(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_file(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_file(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_file(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_file(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_file(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_file(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [is_file] *** - diff --git a/tests/security/open_basedir_is_link.phpt b/tests/security/open_basedir_is_link.phpt deleted file mode 100644 index 5d12148d85254..0000000000000 --- a/tests/security/open_basedir_is_link.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [is_link] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: is_link(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_link(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_link(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_link(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_link(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_link(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_link(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_link(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -*** Finished testing open_basedir configuration [is_link] *** - diff --git a/tests/security/open_basedir_is_readable.phpt b/tests/security/open_basedir_is_readable.phpt deleted file mode 100644 index 951a19ac76a58..0000000000000 --- a/tests/security/open_basedir_is_readable.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [is_readable] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: is_readable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_readable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_readable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_readable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_readable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_readable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_readable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_readable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_readable(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [is_readable] *** - diff --git a/tests/security/open_basedir_is_writable.phpt b/tests/security/open_basedir_is_writable.phpt deleted file mode 100644 index 25ce1c63a4bdb..0000000000000 --- a/tests/security/open_basedir_is_writable.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [is_writable] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: is_writable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_writable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_writable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_writable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_writable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_writable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_writable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_writable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: is_writable(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [is_writable] *** - diff --git a/tests/security/open_basedir_link.phpt b/tests/security/open_basedir_link.phpt deleted file mode 100644 index a54c22f4b69e6..0000000000000 --- a/tests/security/open_basedir_link.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- - ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [link] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: link(): open_basedir restriction in effect. File(%s/test/bad/link.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: link(): open_basedir restriction in effect. File(%s/test/link.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: link(): open_basedir restriction in effect. File(%s/test/bad/link.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: link(): open_basedir restriction in effect. File(%s/test/link.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: link(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: link(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [link] *** - diff --git a/tests/security/open_basedir_linkinfo.phpt b/tests/security/open_basedir_linkinfo.phpt deleted file mode 100644 index ab12a5149d330..0000000000000 --- a/tests/security/open_basedir_linkinfo.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- - ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [linkinfo] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -int(%d) -int(%d) -int(%d) -int(%d) -int(%d) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) -int(%d) - -Warning: unlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) -*** Finished testing open_basedir configuration [linkinfo] *** - diff --git a/tests/security/open_basedir_lstat.phpt b/tests/security/open_basedir_lstat.phpt deleted file mode 100644 index 35e5a22019733..0000000000000 --- a/tests/security/open_basedir_lstat.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [lstat] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: lstat(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: lstat(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: lstat(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: lstat(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: lstat(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: lstat(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: lstat(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: lstat(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: lstat(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [lstat] *** - diff --git a/tests/security/open_basedir_mkdir.phpt b/tests/security/open_basedir_mkdir.phpt deleted file mode 100644 index 253818ccf9342..0000000000000 --- a/tests/security/open_basedir_mkdir.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- - ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [mkdir] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: mkdir(): open_basedir restriction in effect. File(../bad/blah) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: mkdir(): open_basedir restriction in effect. File(../blah) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: mkdir(): open_basedir restriction in effect. File(../bad/./blah) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: mkdir(): open_basedir restriction in effect. File(./.././blah) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [mkdir] *** diff --git a/tests/security/open_basedir_opendir.phpt b/tests/security/open_basedir_opendir.phpt deleted file mode 100644 index a935d5655f1e0..0000000000000 --- a/tests/security/open_basedir_opendir.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [opendir] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: opendir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d - -Warning: opendir(../bad): failed to open dir: %s in %s on line %d -bool(false) - -Warning: opendir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: opendir(../bad/bad.txt): failed to open dir: %s in %s on line %d -bool(false) - -Warning: opendir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d - -Warning: opendir(..): failed to open dir: %s in %s on line %d -bool(false) - -Warning: opendir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d - -Warning: opendir(../): failed to open dir: %s in %s on line %d -bool(false) - -Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d - -Warning: opendir(/): failed to open dir: %s in %s on line %d -bool(false) - -Warning: opendir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d - -Warning: opendir(../bad/.): failed to open dir: %s in %s on line %d -bool(false) - -Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: opendir(%s/test/bad/bad.txt): failed to open dir: %s in %s on line %d -bool(false) - -Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: opendir(%s/test/bad/../bad/bad.txt): failed to open dir: %s in %s on line %d -bool(false) -resource(%d) of type (stream) -resource(%d) of type (stream) -resource(%d) of type (stream) -*** Finished testing open_basedir configuration [opendir] *** - diff --git a/tests/security/open_basedir_parse_ini_file.phpt b/tests/security/open_basedir_parse_ini_file.phpt deleted file mode 100644 index e2f9046352333..0000000000000 --- a/tests/security/open_basedir_parse_ini_file.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [parse_ini_file] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: parse_ini_file(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d - -Warning: parse_ini_file(../bad): failed to open stream: Operation not permitted in %s on line %d -bool(false) - -Warning: parse_ini_file(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: parse_ini_file(../bad/bad.txt): failed to open stream: Operation not permitted in %s on line %d -bool(false) - -Warning: parse_ini_file(..): failed to open stream: Operation not permitted in %s on line %d -bool(false) - -Warning: parse_ini_file(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d - -Warning: parse_ini_file(../): failed to open stream: Operation not permitted in %s on line %d -bool(false) - -Warning: parse_ini_file(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d - -Warning: parse_ini_file(../bad/.): failed to open stream: Operation not permitted in %s on line %d -bool(false) - -Warning: parse_ini_file(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: parse_ini_file(../bad/./bad.txt): failed to open stream: Operation not permitted in %s on line %d -bool(false) - -Warning: parse_ini_file(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d - -Warning: parse_ini_file(./../.): failed to open stream: Operation not permitted in %s on line %d -bool(false) -*** Finished testing open_basedir configuration [parse_ini_file] *** - diff --git a/tests/security/open_basedir_readlink.phpt b/tests/security/open_basedir_readlink.phpt deleted file mode 100644 index cbba4307e5e5e..0000000000000 --- a/tests/security/open_basedir_readlink.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- - ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [readlink] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: readlink(): open_basedir restriction in effect. File(symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: readlink(): open_basedir restriction in effect. File(../ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: readlink(): open_basedir restriction in effect. File(../ok/./symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: readlink(): open_basedir restriction in effect. File(./symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: readlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: readlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: unlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) -*** Finished testing open_basedir configuration [readlink] *** - diff --git a/tests/security/open_basedir_realpath.phpt b/tests/security/open_basedir_realpath.phpt deleted file mode 100644 index 8cae890e99ce9..0000000000000 --- a/tests/security/open_basedir_realpath.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- - ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [realpath] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: realpath(): open_basedir restriction in effect. File(%s\) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d -bool(false) -string(%d) "%s\test\ok" -string(%d) "%s\test\ok\ok.txt" -string(%d) "%s\test\ok\ok.txt" -string(%d) "%s\test\ok\ok.txt" -string(%d) "%s\test\ok\ok.txt" -*** Finished testing open_basedir configuration [realpath] *** - diff --git a/tests/security/open_basedir_rename.phpt b/tests/security/open_basedir_rename.phpt deleted file mode 100644 index 428e7a070a76a..0000000000000 --- a/tests/security/open_basedir_rename.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [rename] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: rename(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: rename(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: rename(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: rename(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: rename(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) -*** Finished testing open_basedir configuration [rename] *** - diff --git a/tests/security/open_basedir_rmdir.phpt b/tests/security/open_basedir_rmdir.phpt deleted file mode 100644 index b4d61f8b76657..0000000000000 --- a/tests/security/open_basedir_rmdir.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [rmdir] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: rmdir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: rmdir(): open_basedir restriction in effect. File(.././bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: rmdir(): open_basedir restriction in effect. File(../bad/../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: rmdir(): open_basedir restriction in effect. File(./.././bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: rmdir(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) -*** Finished testing open_basedir configuration [rmdir] *** - diff --git a/tests/security/open_basedir_scandir.phpt b/tests/security/open_basedir_scandir.phpt deleted file mode 100644 index 77987402c617b..0000000000000 --- a/tests/security/open_basedir_scandir.phpt +++ /dev/null @@ -1,110 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [scandir] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: scandir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d - -Warning: scandir(../bad): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno 1): %s in %s on line %d -bool(false) - -Warning: scandir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: scandir(../bad/bad.txt): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno 1): %s in %s on line %d -bool(false) - -Warning: scandir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d - -Warning: scandir(..): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno 1): %s in %s on line %d -bool(false) - -Warning: scandir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line 80 - -Warning: scandir(../): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno 1): %s in %s on line %d -bool(false) - -Warning: scandir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d - -Warning: scandir(/): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno 1): %s in %s on line %d -bool(false) - -Warning: scandir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d - -Warning: scandir(../bad/.): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno 1): %s in %s on line %d -bool(false) - -Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: scandir(%s/test/bad/bad.txt): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno 1): %s in %s on line %d -bool(false) - -Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d - -Warning: scandir(%s/test/bad/../bad/bad.txt): failed to open dir: %s in %s on line %d - -Warning: scandir(): (errno 1): %s in %s on line %d -bool(false) -array(3) { - [0]=> - string(1) "." - [1]=> - string(2) ".." - [2]=> - string(6) "ok.txt" -} -array(3) { - [0]=> - string(1) "." - [1]=> - string(2) ".." - [2]=> - string(6) "ok.txt" -} -array(3) { - [0]=> - string(1) "." - [1]=> - string(2) ".." - [2]=> - string(6) "ok.txt" -} -*** Finished testing open_basedir configuration [scandir] *** - diff --git a/tests/security/open_basedir_stat.phpt b/tests/security/open_basedir_stat.phpt deleted file mode 100644 index b80b854d6c023..0000000000000 --- a/tests/security/open_basedir_stat.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [stat] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: stat(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: stat(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: stat(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: stat(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: stat(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: stat(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: stat(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: stat(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: stat(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [stat] *** - diff --git a/tests/security/open_basedir_symlink.phpt b/tests/security/open_basedir_symlink.phpt deleted file mode 100644 index 3aaa07b820e61..0000000000000 --- a/tests/security/open_basedir_symlink.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -Test open_basedir configuration ---SKIPIF-- - ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [symlink] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [symlink] *** - diff --git a/tests/security/open_basedir_tempnam.phpt b/tests/security/open_basedir_tempnam.phpt deleted file mode 100644 index 247ac88d5b0b2..0000000000000 --- a/tests/security/open_basedir_tempnam.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [tempnam] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: tempnam(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: tempnam(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: tempnam(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: tempnam(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: tempnam(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: tempnam(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -string(%d) "%s" -bool(true) -*** Finished testing open_basedir configuration [tempnam] *** - diff --git a/tests/security/open_basedir_touch.phpt b/tests/security/open_basedir_touch.phpt deleted file mode 100644 index b0a5aee61259f..0000000000000 --- a/tests/security/open_basedir_touch.phpt +++ /dev/null @@ -1,70 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [touch] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: touch(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: touch(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: touch(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: touch(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: touch(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: touch(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: touch(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: touch(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -*** Finished testing open_basedir configuration [touch] *** - diff --git a/tests/security/open_basedir_unlink.phpt b/tests/security/open_basedir_unlink.phpt deleted file mode 100644 index 75b0f3f4a94a3..0000000000000 --- a/tests/security/open_basedir_unlink.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Test open_basedir configuration ---INI-- -open_basedir=. ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing open_basedir configuration [unlink] *** -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Warning: unlink(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: unlink(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: unlink(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: unlink(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) - -Warning: unlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) -*** Finished testing open_basedir configuration [unlink] *** - diff --git a/tests/strings/001.phpt b/tests/strings/001.phpt deleted file mode 100644 index d5e2f64774459..0000000000000 --- a/tests/strings/001.phpt +++ /dev/null @@ -1,210 +0,0 @@ ---TEST-- -String functions ---FILE-- -?' - . '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_' - . '`abcdefghijklmnopqrstuvwxyz{|}~' - . "\0"; - -echo "Testing rawurlencode: "; -$encoded = rawurlencode($raw); -$correct = '%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F' - . '%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_' - . '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E' - . '%00'; -if ($encoded == $correct) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing rawurldecode: "; -$decoded = rawurldecode($correct); -if ($decoded == $raw) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing urlencode: "; -$encoded = urlencode($raw); -$correct = '+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F' - . '%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_' - . '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E' - . '%00'; -if ($encoded == $correct) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing urldecode: "; -$decoded = urldecode($correct); -if ($decoded == $raw) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing quotemeta: "; -$raw = "a.\\+*?" . chr(91) . "^" . chr(93) . "b\$c"; -$quoted = quotemeta($raw); -if ($quoted == "a\\.\\\\\\+\\*\\?\\[\\^\\]b\\\$c") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing ufirst: "; -$str = "fahrvergnuegen"; -$uc = ucfirst($str); -if ($uc == "Fahrvergnuegen") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing strtr: "; -$str = "test abcdefgh"; -$tr = strtr($str, "def", "456"); -if ($tr == "t5st abc456gh") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing addslashes: "; -$str = "\"\\'"; -$as = addslashes($str); -if ($as == "\\\"\\\\\\'") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo "Testing stripslashes: "; -$str = "\$\\'"; -$ss = stripslashes($str); -if ($ss == "\$'") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - - -echo "Testing uniqid: "; -$str = "prefix"; -$ui1 = uniqid($str); -$ui2 = uniqid($str); - -$len = strncasecmp(PHP_OS, 'CYGWIN', 6) ? 19 : 29; - -if (strlen($ui1) == strlen($ui2) && strlen($ui1) == $len && $ui1 != $ui2) { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -?> ---EXPECT-- -Testing strtok: passed -Testing strstr: passed -Testing strrchr: passed -Testing strtoupper: passed -Testing strtolower: passed -Testing substr: passed -Testing rawurlencode: passed -Testing rawurldecode: passed -Testing urlencode: passed -Testing urldecode: passed -Testing quotemeta: passed -Testing ufirst: passed -Testing strtr: passed -Testing addslashes: passed -Testing stripslashes: passed -Testing uniqid: passed diff --git a/tests/strings/002.phpt b/tests/strings/002.phpt deleted file mode 100644 index 7b95a256450b4..0000000000000 --- a/tests/strings/002.phpt +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -Formatted print functions ---FILE-- -\n", "foo"); -printf("printf test 9:<%-20s>\n", "bar"); -printf("printf test 10: 123456789012345\n"); -printf("printf test 10:<%15s>\n", "høyesterettsjustitiarius"); -printf("printf test 11: 123456789012345678901234567890\n"); -printf("printf test 11:<%30s>\n", "høyesterettsjustitiarius"); -printf("printf test 12:%5.2f\n", -12.34); -printf("printf test 13:%5d\n", -12); -printf("printf test 14:%c\n", 64); -printf("printf test 15:%b\n", 170); -printf("printf test 16:%x\n", 170); -printf("printf test 17:%X\n", 170); -printf("printf test 18:%16b\n", 170); -printf("printf test 19:%16x\n", 170); -printf("printf test 20:%16X\n", 170); -printf("printf test 21:%016b\n", 170); -printf("printf test 22:%016x\n", 170); -printf("printf test 23:%016X\n", 170); -printf("printf test 24:%.5s\n", "abcdefghij"); -printf("printf test 25:%-2s\n", "gazonk"); -printf("printf test 26:%2\$d %1\$d\n", 1, 2); -printf("printf test 27:%3\$d %d %d\n", 1, 2, 3); -printf("printf test 28:%2\$02d %1\$2d\n", 1, 2); -printf("printf test 29:%2\$-2d %1\$2d\n", 1, 2); -print("printf test 30:"); printf("%0\$s", 1); print("x\n"); -vprintf("vprintf test 1:%2\$-2d %1\$2d\n", array(1, 2)); - - -?> ---EXPECT-- -fprintf test 1:abcde -int(20) -printf test 1:simple string -printf test 2:42 -printf test 3:3.333333 -printf test 4:3.3333333333 -printf test 5:2.50 -printf test 6:2.50000000 -printf test 7:0000002.50 -printf test 8:< foo> -printf test 9: -printf test 10: 123456789012345 -printf test 10: -printf test 11: 123456789012345678901234567890 -printf test 11:< høyesterettsjustitiarius> -printf test 12:-12.34 -printf test 13: -12 -printf test 14:@ -printf test 15:10101010 -printf test 16:aa -printf test 17:AA -printf test 18: 10101010 -printf test 19: aa -printf test 20: AA -printf test 21:0000000010101010 -printf test 22:00000000000000aa -printf test 23:00000000000000AA -printf test 24:abcde -printf test 25:gazonk -printf test 26:2 1 -printf test 27:3 1 2 -printf test 28:02 1 -printf test 29:2 1 -printf test 30:x -vprintf test 1:2 1 diff --git a/tests/strings/004.phpt b/tests/strings/004.phpt deleted file mode 100644 index a283fda6991ec..0000000000000 --- a/tests/strings/004.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -highlight_string() buffering ---INI-- -highlight.string=#DD0000 -highlight.comment=#FF9900 -highlight.keyword=#007700 -highlight.bg=#FFFFFF -highlight.default=#0000BB -highlight.html=#000000 ---FILE-- -
"); -$var = highlight_string("

", TRUE); -echo "\n[$var]\n"; -?> ---EXPECT-- - -<br /><?php echo "foo"?><br /> - -[ -<br /><?php echo "bar"?><br /> -] diff --git a/tests/strings/bug22592.phpt b/tests/strings/bug22592.phpt deleted file mode 100755 index 3443c328593bc..0000000000000 --- a/tests/strings/bug22592.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Bug #22592 (Cascading assignments to strings with curly braces broken) ---FILE-- - ---EXPECT-- -string(6) "abcdef" -string(6) "abcdef" -string(6) "a*c*e*" -string(6) "a*c*e*" diff --git a/tests/strings/bug26703.phpt b/tests/strings/bug26703.phpt deleted file mode 100644 index f21bcb900aee3..0000000000000 --- a/tests/strings/bug26703.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Bug #26703 (Certain characters inside strings incorrectly treated as keywords) ---INI-- -highlight.string=#DD0000 -highlight.comment=#FF9900 -highlight.keyword=#007700 -highlight.bg=#FFFFFF -highlight.default=#0000BB -highlight.html=#000000 ---FILE-- -'); -?> ---EXPECT-- - -<?php echo "foo[] $a \n"?> - - diff --git a/tests/test.pl b/tests/test.pl deleted file mode 100644 index 2502cb1298188..0000000000000 --- a/tests/test.pl +++ /dev/null @@ -1,34 +0,0 @@ -class_name; - } -}; - - -class ChildClass { - var $class_name = "ChildClass"; - - function ChildClass($value, $new_value) { - BaseClass::BaseClass($value); - print "new value is '$new_value'\n"; - } - function MyClassName($a_value) { - return BaseClass::MyClassName()." and the value is '$a_value'"; - } -}; - - -$obj = new ChildClass("Test", "Another test"); -print $obj->MyClassName("not interesting"); \ No newline at end of file diff --git a/tests/testarray b/tests/testarray deleted file mode 100644 index bee5cca546c79..0000000000000 --- a/tests/testarray +++ /dev/null @@ -1,21 +0,0 @@ -This is a small test.... -Version}\n"; -$word->Visible = 1; -$word->Documents->Add(); -$word->Selection->TypeText("This is a test..."); -$word->Quit(); -/* -$word->Documents[1]->SaveAs("Useless test.doc"); -*/ -?> \ No newline at end of file diff --git a/tests/testcpdf b/tests/testcpdf deleted file mode 100644 index a74087d18e00d..0000000000000 --- a/tests/testcpdf +++ /dev/null @@ -1,97 +0,0 @@ - diff --git a/tests/testcpdfclock b/tests/testcpdfclock deleted file mode 100644 index c885cc8e09dd7..0000000000000 --- a/tests/testcpdfclock +++ /dev/null @@ -1,87 +0,0 @@ - 0) { - cpdf_page_init($pdf, $pagecount+1, 0, 2 * ($radius + $margin), 2 * ($radius + $margin), 1.0); - - cpdf_set_page_animation($pdf, 4, 0.5, 0, 0, 0); /* wipe */ - - cpdf_translate($pdf, $radius + $margin, $radius + $margin); - cpdf_save($pdf); - cpdf_setrgbcolor($pdf, 0.0, 0.0, 1.0); - - /* minute strokes */ - cpdf_setlinewidth($pdf, 2.0); - for ($alpha = 0; $alpha < 360; $alpha += 6) - { - cpdf_rotate($pdf, 6.0); - cpdf_moveto($pdf, $radius, 0.0); - cpdf_lineto($pdf, $radius-$margin/3, 0.0); - cpdf_stroke($pdf); - } - - cpdf_restore($pdf); - cpdf_save($pdf); - - /* 5 minute strokes */ - cpdf_setlinewidth($pdf, 3.0); - for ($alpha = 0; $alpha < 360; $alpha += 30) - { - cpdf_rotate($pdf, 30.0); - cpdf_moveto($pdf, $radius, 0.0); - cpdf_lineto($pdf, $radius-$margin, 0.0); - cpdf_stroke($pdf); - } - - $ltime = getdate(); - - /* draw hour hand */ - cpdf_save($pdf); - cpdf_rotate($pdf, -(($ltime['minutes']/60.0) + $ltime['hours'] - 3.0) * 30.0); - cpdf_moveto($pdf, -$radius/10, -$radius/20); - cpdf_lineto($pdf, $radius/2, 0.0); - cpdf_lineto($pdf, -$radius/10, $radius/20); - cpdf_closepath($pdf); - cpdf_fill($pdf); - cpdf_restore($pdf); - - /* draw minute hand */ - cpdf_save($pdf); - cpdf_rotate($pdf, -(($ltime['seconds']/60.0) + $ltime['minutes'] - 15.0) * 6.0); - cpdf_moveto($pdf, -$radius/10, -$radius/20); - cpdf_lineto($pdf, $radius * 0.8, 0.0); - cpdf_lineto($pdf, -$radius/10, $radius/20); - cpdf_closepath($pdf); - cpdf_fill($pdf); - cpdf_restore($pdf); - - /* draw second hand */ - cpdf_setrgbcolor($pdf, 1.0, 0.0, 0.0); - cpdf_setlinewidth($pdf, 2); - cpdf_save($pdf); - cpdf_rotate($pdf, -(($ltime['seconds'] - 15.0) * 6.0)); - cpdf_moveto($pdf, -$radius/5, 0.0); - cpdf_lineto($pdf, $radius, 0.0); - cpdf_stroke($pdf); - cpdf_restore($pdf); - - /* draw little circle at center */ - cpdf_circle($pdf, 0, 0, $radius/30); - cpdf_fill($pdf); - - cpdf_restore($pdf); - - cpdf_finalize_page($pdf, $pagecount+1); -} - -cpdf_finalize($pdf); -cpdf_save_to_file($pdf, $pdffilename); -$pdf = cpdf_close($pdf); -?> diff --git a/tests/testdom b/tests/testdom deleted file mode 100644 index c7012e0e3c1a0..0000000000000 --- a/tests/testdom +++ /dev/null @@ -1,73 +0,0 @@ - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - "; - -echo "Test 1: accessing single nodes from php\n"; -$dom = xmldoc($xmlstr); -if(!$dom) { - echo "Error while parsing the document\n"; - exit; -} - -$children = $dom->childNodes(); -print_r($children); - -echo "--------- root\n"; -$rootnode = $dom->documentElement(); -print_r($rootnode); - -echo "--------- children of root\n"; -$children = $rootnode->childNodes(); -print_r($children); - -// The last node should be identical with the last entry in the children array -echo "--------- last\n"; -$last = $rootnode->lastChild(); -print_r($last); - -// The parent of this last node is the root again -echo "--------- parent\n"; -$parent = $last->parent(); -print_r($parent); - -// The children of this parent are the same children as one above -echo "--------- children of parent\n"; -$children = $parent->childNodes(); -print_r($children); - -echo "--------- creating a new attribute\n"; -$attr = $dom->createAttribute("src", "picture.gif"); -print_r($attr); - -$rootnode->setAttributeNode($attr); /* Not implemented */ -$attr = $rootnode->setAttribute("src", "picture.gif"); -$attr = $rootnode->getAttribute("src"); -print_r($attr); - -echo "--------- attribute of rootnode\n"; -$attrs = $rootnode->attributes(); -print_r($attrs); - -echo "--------- children of an attribute\n"; -$children = $attrs[0]->childNodes(); -print_r($children); - -?> diff --git a/tests/testfe b/tests/testfe deleted file mode 100644 index ea627606353f0..0000000000000 --- a/tests/testfe +++ /dev/null @@ -1,18 +0,0 @@ -"ge:Hier der Titel", "Author"=>"Hier der Autor")); - echo $objrec."\n"; - $objrec .= "\nTitle=en:Here the title"; - echo "Add another title and convert it back to an object array\n"; - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - - if($test_4 == "yes") { - echo "TEST 4 ----------------------------------------------\n"; - echo "Get the object array of document with id 0x".dechex($id)."\n"; - $objrec = hw_getobject($connect, $id); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - - if($test_5 == "yes") { - echo "TEST 5 ----------------------------------------------\n"; - echo "List the children of collection 0x".dechex($collid)."\n"; - $children = hw_childrenobj($connect, $collid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $c_children = count($children) - 1; - for($i=0; $i<$c_children; $i++) { - $objarr = hw_objrec2array($children[$i]); - list_attr($objarr); - } - list_attr($children[$c_children]); - } - - if($test_6 == "yes") { - echo "TEST 6 ----------------------------------------------\n"; - echo "List the parents of object 0x".dechex($id)."\n"; - $parents = hw_getparentsobj($connect, $collid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $c_parents = count($parents) - 1; - for($i=0; $i<$c_parents; $i++) { - $objarr = hw_objrec2array($parents[$i]); - list_attr($objarr); - } - list_attr($parents[$c_parents]); - } - - if($test_7 == "yes") { - echo "TEST 7 ----------------------------------------------\n"; - echo "Inserting a new text document into 0x".dechex($collid)."\n"; - $objrec = "Type=Document\nDocumentType=text\nName=HWTest\nTitle=en:Component\nMimeType=text/plain\nAuthor=".$username; - $contents = "Ein bischen Text"; - $doc = hw_new_document($objrec, $contents, strlen($contents)+1); - $objid = hw_insertdocument($connect, $collid, $doc); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $objrec = hw_getobject($connect, $objid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - - if($test_8 == "yes") { - echo "TEST 8 ----------------------------------------------\n"; - echo "Removing text document just inserted\n"; - $kk[0] = (int) $objid; - hw_mv($connect, $kk, $collid, 0); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - exit; - } - echo "If the document was really deleted you should see an error now\n"; - $objrec = hw_getobject($connect, $objid); - if(hw_error($connect)) { - echo "ERROR: ".hw_errormsg($connect)."\n"; - } else { - $objarr = hw_objrec2array($objrec); - list_attr($objarr); - } - } - - if($test_9 == "yes") { - echo "TEST 9 ----------------------------------------------\n"; - echo "Searching for objects with $query\n"; - $objrecs = hw_getobjectbyqueryobj($connect, $query, -1); - $c_objrecs = count($objrecs) - 1; - echo "$c_objrecs found\n"; - for($i=0; $i<$c_objrecs; $i++) { - $objarr = hw_objrec2array($objrecs[$i]); - list_attr($objarr); - } - list_attr($objrecs[$c_objrecs]); - } - - if($test_10 == "yes") { - $anchors = hw_getanchorsobj($connect, $id); - $countanchors = count($anchors) - 1; - echo "$countanchors Anchors of Object $id\n"; - for($i=0; $i<$countanchors; $i++) { - $arr = hw_objrec2array($anchors[$i]); - list_attr($arr); - } - } - - if($test_11 == "yes") { - $doc = hw_new_document_from_file("ObjectRecord", "hw_document.txt"); - hw_output_document($doc); - } - - if($test_12 == "yes") { - $doc = hw_new_document_from_file("ObjectRecord", "hw_document.txt"); - hw_insertanchors($doc, array("Position=0x2 0x7\nObjectID=0x3\nTAnchor=Src\nDest=0x5"), array("ObjectID=0x5\nName=DestDoc")); - hw_output_document($doc); - } - - hw_close($connect); -?> diff --git a/tests/testinclude b/tests/testinclude deleted file mode 100644 index 1e9854370d110..0000000000000 --- a/tests/testinclude +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/tests/testobj b/tests/testobj deleted file mode 100644 index 66b003ce9c651..0000000000000 --- a/tests/testobj +++ /dev/null @@ -1,29 +0,0 @@ -initialized = 1; - } -}; - -class barbara extends foobar { - -}; - -$name = "foobar"; -$foo = new $name; // or die("Unable to construct foobar\n"); -//print $foo->initialized; - -$boo = new barbara; -print get_class($foo).endl; -print get_parent_class($foo).endl; -print get_class($boo).endl; -print get_parent_class($boo).endl; -print method_exists($foo,"foobar").endl; -print method_exists($boo,"foobar").endl; -print method_exists($boo,"barbara").endl; -//$word = new COm("word.application"); -//$word->visible = true; -//sleep(5); -//$word->quit(); diff --git a/tests/testpfpro.php b/tests/testpfpro.php deleted file mode 100644 index ffb1784bdca9e..0000000000000 --- a/tests/testpfpro.php +++ /dev/null @@ -1,39 +0,0 @@ -\n\n"; - -echo "Payflow Pro library is version ".pfpro_version()."\n"; - -pfpro_init(); - -$transaction = array(USER => 'mylogin', - PWD => 'mypassword', - TRXTYPE => 'S', - TENDER => 'C', - AMT => 1.50, - ACCT => '4111111111111111', - EXPDATE => '0900' - ); - -$response = pfpro_process($transaction); - -if (!$response) { - die("Couldn't establish link to signio software.\n"); -} - -echo "Signio response code was ".$response[RESULT]; -echo ", which means: ".$response[RESPMSG]."\n"; - -echo "\nDump of the transaction request "; -print_r($transaction); - -echo "\nDump of the response "; -print_r($response); - -pfpro_cleanup(); - -?> diff --git a/tests/tests.dsp b/tests/tests.dsp deleted file mode 100644 index fc19dcfe43125..0000000000000 --- a/tests/tests.dsp +++ /dev/null @@ -1,61 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tests" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=tests - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "tests.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "tests.mak" CFG="tests - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tests - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "." -# PROP BASE Intermediate_Dir "." -# PROP BASE Cmd_Line "NMAKE /f tests.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "tests.exe" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Cmd_Line "nmake /nologo /f tests.mak" -# PROP Rebuild_Opt "/a" -# PROP Target_File "__test_run_complete__" -# PROP Bsc_Name "" -# PROP Target_Dir "" -# Begin Target - -# Name "tests - Win32 Debug" - -!IF "$(CFG)" == "tests - Win32 Debug" - -!ENDIF - -# Begin Source File - -SOURCE="..\run-tests.php" -# End Source File -# Begin Source File - -SOURCE=.\tests.mak -# End Source File -# End Target -# End Project diff --git a/tests/tests.mak b/tests/tests.mak deleted file mode 100644 index 8b4714354405b..0000000000000 --- a/tests/tests.mak +++ /dev/null @@ -1,27 +0,0 @@ -# -# Win32 Makefile to run the PHP unit tests. -# -# TEST_PHP_EXECUTABLE -# Required - must point to the PHP executable to test. -# -# TEST_PHP_ERROR_STYLE -# Optional - specifies error format to output so IDE can jump to test source and log. -# Values: MSVC (Microsoft Visual C++), Emacs -# -# TEST_PHP_DETAILED -# Optional - generates a more complete and detailed log if set. -# Values: 0 or unset - no details; 1 - detailed. -# - -all : run-tests - -BIN=Debug_TS - -# Specific test(s) to run (all if not specified). -TESTS= - -run-tests : - set TEST_PHP_EXECUTABLE=$(BIN)\php-cgi.exe - set TEST_PHP_ERROR_STYLE=MSVC - set TEST_PHP_DETAILED=0 - cd .. && $(BIN)\php-cgi.exe -c tests -f run-tests.php $(TESTS) | tee tests.log diff --git a/tests/testscanf.php b/tests/testscanf.php deleted file mode 100644 index ad530978c5298..0000000000000 --- a/tests/testscanf.php +++ /dev/null @@ -1,113 +0,0 @@ -") { - if (is_array($val)) { - for ($i = 0;$i< count($val);$i++) { - echo $val[$i] . $postfix; - } - } else { - echo $val . $postfix; - } -} - -function do_sscanf($string, $format) { - $s = "sscanf(\"" . $string . ",\"" . $format ."\")."; - echo "$s
"; - $s = str_repeat("-", strlen($s)); - echo "$s
"; - $output = sscanf($string,$format); - echo "Result : "; - print_value( $output ); - echo "$s

"; -} - - -function run_sscanf_test_cases($filename="scan_cases") -{ - - echo "


Running Test Cases from $filename

"; - $arr = file($filename); - for ($i=0;$i < count($arr);$i++) { - $line_arr = explode("|",$arr[$i]); - - $format = $line_arr[0]; - $string = $line_arr[1]; - if (count($arr) > 2) { - $comment = $line_arr[2]; - } else { - $comment = ""; - } - if ( empty($format) || empty($string) ) { - continue; - } - print("

** Case : $comment ******************************

"); - do_sscanf($string,$format); - } -} - -function simple_tests() { - echo "Testing sscanf with standard ANSI syntax (values returned by -reference)-
"; - $decimal = -1; - $string = ""; - $hex = 0; - $float = 0.0; - $octal = 0.0; - $int = -1; - - echo "


Simple Test

"; - echo "sscanf('10','%d',&\$decimal)
"; - echo "
BEFORE :
decimal = $decimal."; - $foo = sscanf("10","%d",&$decimal); - echo "
AFTER :
decimal = $decimal
"; - - - echo "


Simple Test 2

"; - echo "sscanf(\"ghost 0xface\",\"%s %x\",&\$string, &\$int)
"; - echo "
BEFORE :
string = $string, int = $int
"; - $foo = sscanf("ghost 0xface","%s %x",&$string, &$int); - echo "
AFTER :
string = $string, int = $int
"; - echo " sscan reports : "; - print_value( $foo,""); - echo " conversions
"; - - echo "


Multiple specifiers

"; - echo "sscanf(\"jabberwocky 1024 0xFF 1.024 644 10\", - \"%s %d %x %f %o %i\", - &\$string,&\$decimal,&\$hex,&\$float,&\$octal,&\$int);
"; - echo "
BEFORE :
"; - echo "Decimal = $decimal, String = $string, Hex = $hex
"; - echo "Octal = $octal , Float = $float, Int = $int
"; - $foo = sscanf( "jabberwocky 1024 0xFF 1.024 644 10", - "%s %d %x %f %o %i", - &$string,&$decimal,&$hex,&$float,&$octal,&$int); - echo "
AFTER :
"; - echo "decimal = $decimal, string = $string, hex = $hex
"; - echo "octal = $octal , float = $float, int = $int
"; - - echo " sscan reports : "; - print_value( $foo,""); - echo " conversions
"; - echo "----------------------------------------
"; -} - - - -?> - - - Test of sscanf() - - -

Testing sscanf() support in PHP


- I'm sorry but sscanf() does not exist !i
"; - } else { - simple_tests(); - run_sscanf_test_cases(); - } - ?> - - diff --git a/tests/testswf b/tests/testswf deleted file mode 100644 index e26733237d8b4..0000000000000 --- a/tests/testswf +++ /dev/null @@ -1,120 +0,0 @@ - diff --git a/win32/EngineSelect.bat b/win32/EngineSelect.bat deleted file mode 100755 index 0785bd12fcc95..0000000000000 --- a/win32/EngineSelect.bat +++ /dev/null @@ -1,5 +0,0 @@ -@if exist ..\ZendEngine2\OBJECTS2_HOWTO ( -move ..\Zend ..\ZendEngine1 -move ..\ZendEngine2 ..\Zend -echo "PLEASE RESTART VISUAL C++ TO RELOAD THE ZEND PROJECT." -exit 1 ) diff --git a/win32/EngineSelect.dsp b/win32/EngineSelect.dsp deleted file mode 100644 index 4aee213c29278..0000000000000 --- a/win32/EngineSelect.dsp +++ /dev/null @@ -1,85 +0,0 @@ -# Microsoft Developer Studio Project File - Name="EngineSelect" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=EngineSelect - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "EngineSelect.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "EngineSelect.mak" CFG="EngineSelect - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "EngineSelect - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "EngineSelect - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "EngineSelect - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f EngineSelect.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "EngineSelect.exe" -# PROP BASE Bsc_Name "EngineSelect.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "EngineSelect.bat" -# PROP Rebuild_Opt "/a" -# PROP Target_File "EngineSelect.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "EngineSelect - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f EngineSelect.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "EngineSelect.exe" -# PROP BASE Bsc_Name "EngineSelect.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "EngineSelect.bat" -# PROP Rebuild_Opt "/a" -# PROP Target_File "EngineSelect.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "EngineSelect - Win32 Release" -# Name "EngineSelect - Win32 Debug" - -!IF "$(CFG)" == "EngineSelect - Win32 Release" - -!ELSEIF "$(CFG)" == "EngineSelect - Win32 Debug" - -!ENDIF - -# End Target -# End Project diff --git a/win32/build/Makefile b/win32/build/Makefile deleted file mode 100644 index 3af9e20b6c8d7..0000000000000 --- a/win32/build/Makefile +++ /dev/null @@ -1,150 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2007 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 3.01 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | http://www.php.net/license/3_01.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. | -# +----------------------------------------------------------------------+ -# | Author: Wez Furlong | -# +----------------------------------------------------------------------+ -# -# $Id$ -# This is the makefile template for the win32 build - -CC="$(CL)" -LD="$(LINK)" -MC="$(MC)" -MT="$(MT)" - -MCFILE=$(BUILD_DIR)\wsyslog.rc - -all: generated_files $(EXT_TARGETS) $(PECL_TARGETS) $(SAPI_TARGETS) - -build_dirs: $(BUILD_DIR) $(BUILD_DIRS_SUB) - -generated_files: build_dirs Zend\zend_ini_parser.c \ - Zend\zend_language_parser.c Zend\zend_ini_scanner.c \ - Zend\zend_language_scanner.c \ - $(PHPDEF) $(MCFILE) - -$(BUILD_DIR)\$(PHPDLL).def: $(PHP_DLL_DEF_SOURCES) - type $(PHP_DLL_DEF_SOURCES) > $(BUILD_DIR)\$(PHPDLL).def - -Zend\zend_ini_parser.c Zend\zend_ini_parser.h: Zend\zend_ini_parser.y - $(BISON) --output=Zend/zend_ini_parser.c -v -d -p ini_ Zend/zend_ini_parser.y - -Zend\zend_language_parser.c Zend\zend_language_parser.h: Zend\zend_language_parser.y - $(BISON) --output=Zend/zend_language_parser.c -v -d -p zend Zend/zend_language_parser.y - -Zend\zend_ini_scanner.c: Zend\flex.skl Zend\zend_ini_scanner.l - $(FLEX) -B -i -SZend/flex.skl -Pini_ -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l - -Zend\zend_language_scanner.c: Zend\flex.skl Zend\zend_language_scanner.l - $(FLEX) -i -SZend/flex.skl -Pzend -oZend/zend_language_scanner.c Zend/zend_language_scanner.l - -PHPDLL_RES=$(BUILD_DIR)\$(PHPDLL).res - -$(MCFILE): win32\build\wsyslog.mc - $(MC) -h win32\ -r $(BUILD_DIR)\ -x $(BUILD_DIR)\ win32\build\wsyslog.mc - -# $(RC) /fo $(MCFILE) $(BUILD_DIR)\wsyslog.rc - -!if $(MT) == "" -_VC_MANIFEST_EMBED_EXE= -_VC_MANIFEST_EMBED_DLL= -!else -_VC_MANIFEST_EMBED_EXE= if exist $@.manifest $(MT) -nologo -manifest $@.manifest -outputresource:$@;1 -_VC_MANIFEST_EMBED_DLL= if exist $@.manifest $(MT) -nologo -manifest $@.manifest -outputresource:$@;2 -!endif - -$(PHPDLL_RES): win32\build\template.rc - $(RC) /fo $(PHPDLL_RES) /d FILE_DESCRIPTION="\"PHP Script Interpreter\"" \ - /d FILE_NAME="\"$(PHPDLL)\"" /d PRODUCT_NAME="\"PHP Script Interpreter\"" \ - /I$(BUILD_DIR) /d MC_INCLUDE="\"$(MCFILE)\"" \ - win32\build\template.rc - -$(BUILD_DIR)\$(PHPDLL): generated_files $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) $(MCFILE) - @$(CC) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /link /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) - -@$(_VC_MANIFEST_EMBED_DLL) - -$(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL) - -$(BUILD_DIR) $(BUILD_DIRS_SUB): - @echo Recreating build dirs - @if not exist $(BUILD_DIR) mkdir $(BUILD_DIR) - @for %D in ($(BUILD_DIRS_SUB)) do @if not exist %D @mkdir %D > NUL - -clean-sapi: - @echo Cleaning SAPI - @for %D in (_x $(EXT_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL - @for %D in (_x $(PECL_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL - @for %D in (_x $(SAPI_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL - -@del /F /Q $(BUILD_DIR)\$(PHPDLL) - -clean: clean-sapi - @echo Cleaning build dirs - @for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL - -@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip > NUL - -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING) - -clean-pecl: - @echo Cleaning PECL targets only - -rmdir /s /q $(BUILD_DIR)\pecl - -test: - <nul - @copy $(BUILD_DIR)\*.dll $(PHP_PREFIX) /y >nul - @echo Registering event source with syslog (requires admin rights) - @echo It's okay for this step to fail: - -$(PHP_PREFIX)\php.exe -n -dextension_dir=$(PHP_PREFIX) win32/build/registersyslog.php $(PHP_PREFIX)\$(PHPDLL) - - diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js deleted file mode 100644 index a1b1331bf6410..0000000000000 --- a/win32/build/buildconf.js +++ /dev/null @@ -1,263 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id: buildconf.js,v 1.13.2.2.2.1 2007-01-01 19:32:09 iliaa Exp $ */ -// This generates a configure script for win32 build - -WScript.StdOut.WriteLine("Rebuilding configure.js"); -var FSO = WScript.CreateObject("Scripting.FileSystemObject"); -var C = FSO.CreateTextFile("configure.js", true); - -var modules = ""; -var MODULES = WScript.CreateObject("Scripting.Dictionary"); -var module_dirs = new Array(); - -function file_get_contents(filename) -{ - var F = FSO.OpenTextFile(filename, 1); - var t = F.ReadAll(); - F.Close(); - return t; -} - -function Module_Item(module_name, config_path, dir_line, deps, content) -{ - this.module_name = module_name; - this.config_path = config_path; - this.dir_line = dir_line; - this.deps = deps; - this.content = content; -} - -function find_config_w32(dirname) -{ - if (!FSO.FolderExists(dirname)) { - return; - } - - var f = FSO.GetFolder(dirname); - var fc = new Enumerator(f.SubFolders); - var c, i, ok, n; - var item = null; - var re_dep_line = new RegExp("ADD_EXTENSION_DEP\\([^,]*\\s*,\\s*['\"]([^'\"]+)['\"].*\\);", "gm"); - - for (; !fc.atEnd(); fc.moveNext()) - { - ok = true; - /* check if we already picked up a module with the same dirname; - * if we have, don't include it here */ - n = FSO.GetFileName(fc.item()); - - if (n == 'CVS' || n == 'tests') - continue; - - // WScript.StdOut.WriteLine("checking " + dirname + "/" + n); - if (MODULES.Exists(n)) { - WScript.StdOut.WriteLine("Skipping " + dirname + "/" + n + " -- already have a module with that name"); - continue; - } - - - c = FSO.BuildPath(fc.item(), "config.w32"); - if (FSO.FileExists(c)) { -// WScript.StdOut.WriteLine(c); - - var dir_line = "configure_module_dirname = condense_path(FSO.GetParentFolderName('" - + c.replace(new RegExp('(["\\\\])', "g"), '\\$1') + "'));\r\n"; - var contents = file_get_contents(c); - var deps = new Array(); - - // parse out any deps from the file - var calls = contents.match(re_dep_line); - if (calls != null) { - for (i = 0; i < calls.length; i++) { - // now we need the extension name out of this thing - if (calls[i].match(re_dep_line)) { -// WScript.StdOut.WriteLine("n depends on " + RegExp.$1); - deps[deps.length] = RegExp.$1; - } - } - } - - item = new Module_Item(n, c, dir_line, deps, contents); - MODULES.Add(n, item); - } - } -} - -// Emit core modules array. This is used by a snapshot -// build to override a default "yes" value so that external -// modules don't break the build by becoming statically compiled -function emit_core_module_list() -{ - var module_names = (new VBArray(MODULES.Keys())).toArray(); - var i, mod_name, j; - var item; - var output = ""; - - C.WriteLine("core_module_list = new Array("); - - // first, look for modules with empty deps; emit those first - for (i in module_names) { - mod_name = module_names[i]; - C.WriteLine("\"" + mod_name.replace(/_/g, "-") + "\","); - } - - C.WriteLine("false // dummy"); - - C.WriteLine(");"); -} - - -function emit_module(item) -{ - return item.dir_line + item.content; -} - -function emit_dep_modules(module_names) -{ - var i, mod_name, j; - var output = ""; - var item = null; - - for (i in module_names) { - mod_name = module_names[i]; - - if (MODULES.Exists(mod_name)) { - item = MODULES.Item(mod_name); - MODULES.Remove(mod_name); - if (item.deps.length) { - output += emit_dep_modules(item.deps); - } - output += emit_module(item); - } - } - - return output; -} - -function gen_modules() -{ - var module_names = (new VBArray(MODULES.Keys())).toArray(); - var i, mod_name, j; - var item; - var output = ""; - - // first, look for modules with empty deps; emit those first - for (i in module_names) { - mod_name = module_names[i]; - item = MODULES.Item(mod_name); - if (item.deps.length == 0) { - MODULES.Remove(mod_name); - output += emit_module(item); - } - } - - // now we are left with modules that have dependencies on other modules - module_names = (new VBArray(MODULES.Keys())).toArray(); - output += emit_dep_modules(module_names); - - return output; -} - -if (FSO.FileExists("ZendEngine2\\OBJECTS2_HOWTO")) { - if (FSO.FolderExists("Zend")) { - FSO.MoveFolder("Zend", "ZendEngine1"); - } - FSO.MoveFolder("ZendEngine2", "Zend"); -} - -// Process buildconf arguments -function buildconf_process_args() -{ - args = WScript.Arguments; - - for (i = 0; i < args.length; i++) { - arg = args(i); - // If it is --foo=bar, split on the equals sign - arg = arg.split("=", 2); - argname = arg[0]; - if (arg.length > 1) { - argval = arg[1]; - } else { - argval = null; - } - - if (argname == '--add-modules-dir' && argval != null) { - WScript.StdOut.WriteLine("Adding " + argval + " to the module search path"); - module_dirs[module_dirs.length] = argval; - } - } -} - -buildconf_process_args(); - -// Write the head of the configure script -C.WriteLine("/* This file automatically generated from win32/build/confutils.js */"); -C.Write(file_get_contents("win32/build/confutils.js")); - -// Pull in code from sapi and extensions -modules = file_get_contents("win32/build/config.w32"); - -// Pick up confs from TSRM and Zend if present -find_config_w32("."); -find_config_w32("sapi"); -find_config_w32("ext"); -emit_core_module_list(); - -// If we have not specified any module dirs let's add some defaults -if (module_dirs.length == 0) { - find_config_w32("pecl"); - find_config_w32("..\\pecl"); - find_config_w32("pecl\\rpc"); - find_config_w32("..\\pecl\\rpc"); -} else { - for (i = 0; i < module_dirs.length; i++) { - find_config_w32(module_dirs[i]); - } -} - -// Now generate contents of module based on MODULES, chasing dependencies -// to ensure that dependent modules are emitted first -modules += gen_modules(); - -// Look for ARG_ENABLE or ARG_WITH calls -re = new RegExp("(ARG_(ENABLE|WITH)\([^;]+\);)", "gm"); -calls = modules.match(re); -for (i = 0; i < calls.length; i++) { - item = calls[i]; - C.WriteLine("try {"); - C.WriteLine(item); - C.WriteLine("} catch (e) {"); - C.WriteLine('\tSTDOUT.WriteLine("problem: " + e);'); - C.WriteLine("}"); -} - -C.WriteBlankLines(1); -C.WriteLine("conf_process_args();"); -C.WriteBlankLines(1); - -// Comment out the calls from their original positions -modules = modules.replace(re, "/* $1 */"); -C.Write(modules); - -C.WriteBlankLines(1); -C.Write(file_get_contents("win32/build/configure.tail")); - -WScript.StdOut.WriteLine("Now run 'cscript /nologo configure.js --help'"); - diff --git a/win32/build/config.w32 b/win32/build/config.w32 deleted file mode 100644 index 61fc14742a4f4..0000000000000 --- a/win32/build/config.w32 +++ /dev/null @@ -1,366 +0,0 @@ -// vim:ft=javascript -// $Id$ -// "Master" config file; think of it as a configure.in -// equivalent. - -ARG_WITH('cygwin', 'Path to cygwin utilities on your system', '\\cygwin'); -PATH_PROG('cl'); -CL = PATH_PROG('cl'); -if (!CL) { - ERROR("MS C++ compiler is required"); -} -// Which version of the compiler do we have ? -function probe_msvc_compiler_version(CL) -{ - // tricky escapes to get stderr redirection to work - var banner = execute('cmd /c ""' + CL + '" 2>&1"'); - if (banner.match(/(\d+)\.(\d+)\.(\d+)(\.(\d+))?/)) { - return RegExp.$1; - } - return 0; -} - -VCVERS = probe_msvc_compiler_version(CL); -STDOUT.WriteLine("Detected MS compiler version " + VCVERS); - -// 12 is VC6 -// 13 is vs.net 2003 -// 14 is vs.net 2005 - -// do we use x64 or 80x86 version of compiler? -function probe_msvc_compiler_x64(CL) -{ - // tricky escapes to get stderr redirection to work - var banner = execute('cmd /c ""' + CL + '" 2>&1"'); - if (banner.match(/x64/)) { - return 1; - } - return 0; -} - -X64 = probe_msvc_compiler_x64(CL); -if (X64) { - STDOUT.WriteLine("Detected 64-bit compiler"); -} else { - STDOUT.WriteLine("Detected 32-bit compiler"); -} - -AC_DEFINE('ARCHITECTURE', X64 ? 'x64' : 'x86', "Detected compiler architecture"); -DEFINE("PHP_ARCHITECTURE", X64 ? 'x64' : 'x86'); - -// cygwin now ships with link.exe. Avoid searching the cygwin path -// for this, as we want the MS linker, not the fileutil -PATH_PROG('link', WshShell.Environment("Process").Item("PATH")); - -PATH_PROG('nmake'); - -// we don't want to define LIB, as that will override the default library path -// that is set in that env var -PATH_PROG('lib', null, 'MAKE_LIB'); -if (!PATH_PROG('bison')) { - ERROR('bison is required') -} -if (!PATH_PROG('flex')) { - ERROR('flex is required') -} -PATH_PROG('re2c'); -PATH_PROG('zip'); -PATH_PROG('lemon'); - -// avoid picking up midnight commander from cygwin -PATH_PROG('mc', WshShell.Environment("Process").Item("PATH")); - -// Try locating manifest tool -PATH_PROG('mt', WshShell.Environment("Process").Item("PATH")); - -// stick objects somewhere outside of the source tree -ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', ''); -if (PHP_OBJECT_OUT_DIR.length) { - if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) { - ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist'); - } - PHP_OBJECT_OUT_DIR += '\\'; -} else if (X64) { - if (!FSO.FolderExists("x64")) { - FSO.CreateFolder("x64"); - } - PHP_OBJECT_OUT_DIR = 'x64\\'; -} - -ARG_ENABLE('debug', 'Compile with debugging symbols', "no"); -ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no'); -if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") { - ERROR("Use of both --enable-debug and --enable-debug-pack not allowed."); -} -ARG_ENABLE('zts', 'Thread safety', 'yes'); -// Configures the hard-coded installation dir -ARG_ENABLE('prefix', 'where PHP will be installed', ''); -if (PHP_PREFIX == '') { - PHP_PREFIX = "C:\\php" + PHP_VERSION; - if (PHP_DEBUG == "yes") - PHP_PREFIX += "\\debug"; -} -DEFINE('PHP_PREFIX', PHP_PREFIX); - -DEFINE("BASE_INCLUDES", "/I . /I main /I regex /I Zend /I TSRM /I ext "); - -// CFLAGS for building the PHP dll -DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \ -/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x400"); - -DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)'); - -// General CFLAGS for building objects -DEFINE("CFLAGS", "/nologo /FD $(BASE_INCLUDES) /D _WINDOWS \ -/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS"); - -if (VCVERS < 14) { - // Enable automatic precompiled headers - ADD_FLAG('CFLAGS', ' /YX '); - - if (PHP_DEBUG == "yes") { - // Set some debug/release specific options - ADD_FLAG('CFLAGS', ' /GZ '); - } -} - -if (VCVERS >= 14) { - // fun stuff: MS deprecated ANSI stdio and similar functions - // disable annoying warnings. In addition, time_t defaults - // to 64-bit. Ask for 32-bit. - if (X64) { - ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 '); - } else { - ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 '); - } - - if (PHP_DEBUG == "yes") { - // Set some debug/release specific options - ADD_FLAG('CFLAGS', ' /RTC1 '); - } -} - -// General link flags -DEFINE("LDFLAGS", "/nologo /version:" + - PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION); - -// General DLL link flags -DEFINE("DLL_LDFLAGS", "/dll "); - -// PHP DLL link flags -DEFINE("PHP_LDFLAGS", "$(DLL_LDFLAGS)"); - -// General libs -// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib -DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib"); - -// Set some debug/release specific options -if (PHP_DEBUG == "yes") { - ADD_FLAG("CFLAGS", "/LDd /MDd /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " + - (X64?"/Zi":"/ZI")); - ADD_FLAG("LDFLAGS", "/debug"); - // Avoid problems when linking to release libraries that use the release - // version of the libc - ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt"); -} else { - // Generate external debug files when --enable-debug-pack is specified - if (PHP_DEBUG_PACK == "yes") { - ADD_FLAG("CFLAGS", "/Zi"); - ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf"); - } - // Equivalent to Release_TSInline build -> best optimization - ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG \ -/D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0"); - // if you have VS.Net /GS hardens the binary against buffer overruns - // ADD_FLAG("CFLAGS", "/GS"); -} - -if (PHP_ZTS == "yes") { - ADD_FLAG("CFLAGS", "/D ZTS=1"); -} - -DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts"); - - -// we want msvcrt in the PHP DLL -ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt"); - -// set up the build dir and DLL name -if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") { - DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS"); - DEFINE("PHPDLL", "php5ts_debug.dll"); - DEFINE("PHPLIB", "php5ts_debug.lib"); -} else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") { - DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug"); - DEFINE("PHPDLL", "php5_debug.dll"); - DEFINE("PHPLIB", "php5_debug.lib"); -} else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") { - DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release_TS"); - DEFINE("PHPDLL", "php5ts.dll"); - DEFINE("PHPLIB", "php5ts.lib"); -} else if (PHP_DEBUG == "no" && PHP_ZTS == "no") { - DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release"); - DEFINE("PHPDLL", "php5.dll"); - DEFINE("PHPLIB", "php5.lib"); -} - -// Find the php_build dir - it contains headers and libraries -// that we need -ARG_WITH('php-build', 'Path to where you extracted http://www.php.net/extra/win32build.zip. Assumes that it is a sibling of this source dir (..\\php_build) if not specified', 'no'); - -if (PHP_PHP_BUILD == 'no') { - if (FSO.FolderExists("..\\php_build")) { - PHP_PHP_BUILD = "..\\php_build"; - } else { - if (X64) { - if (FSO.FolderExists("..\\win64build")) { - PHP_PHP_BUILD = "..\\win64build"; - } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) { - PHP_PHP_BUILD = "..\\php-win64-dev\\php_build"; - } - } else { - if (FSO.FolderExists("..\\win32build")) { - PHP_PHP_BUILD = "..\\win32build"; - } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) { - PHP_PHP_BUILD = "..\\php-win32-dev\\php_build"; - } - } - } -} - -ARG_WITH('extra-includes', 'Extra include path to use when building everything', ''); -ARG_WITH('extra-libs', 'Extra library path to use when linking everything', ''); - -var php_usual_include_suspects = PHP_PHP_BUILD+"\\include;..\\bindlib_w32"; -var php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib;..\\bindlib_w32"; - -// Poke around for some headers -function probe_basic_headers() -{ - var p; - - if (PHP_PHP_BUILD != "no") { - php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include"; - php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib"; - } - - p = CHECK_HEADER_ADD_INCLUDE("arpa\\nameser.h", "CFLAGS", php_usual_include_suspects); - - // hack to catch common location of libs - if (typeof(p) == "string") { - p = p.replace(new RegExp("include$"), "lib"); - ADD_FLAG("LDFLAGS", '/libpath:"' + p + '" '); - php_usual_lib_suspects += ";" + p; - } else if (!p) { - ERROR("We really need that arpa\\nameser.h file - it is part of the win32build package"); - } -} - -function add_extra_dirs() -{ - var path, i, f; - - if (PHP_EXTRA_INCLUDES.length) { - path = PHP_EXTRA_INCLUDES.split(';'); - for (i = 0; i < path.length; i++) { - f = FSO.GetAbsolutePathName(path[i]); - if (FSO.FolderExists(f)) { - ADD_FLAG("CFLAGS", '/I "' + f + '" '); - } - } - } - if (PHP_EXTRA_LIBS.length) { - path = PHP_EXTRA_LIBS.split(';'); - for (i = 0; i < path.length; i++) { - f = FSO.GetAbsolutePathName(path[i]); - if (FSO.FolderExists(f)) { - if (VCVERS <= 12 && f.indexOf(" ") >= 0) { - ADD_FLAG("LDFLAGS", '/libpath:"\\"' + f + '\\"" '); - } else { - ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" '); - } - } - } - } - -} - -probe_basic_headers(); -add_extra_dirs(); -CHECK_LIB("resolv.lib"); - -//DEFINE("PHP_BUILD", PHP_PHP_BUILD); - -STDOUT.WriteBlankLines(1); -STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR')); -STDOUT.WriteLine("PHP Core: " + get_define('PHPDLL') + " and " + get_define('PHPLIB')); - -ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \ - zend_ini_parser.c zend_ini_scanner.c zend_alloc.c zend_compile.c \ - zend_constants.c zend_dynamic_array.c zend_exceptions.c \ - zend_execute_API.c zend_highlight.c \ - zend_llist.c zend_opcode.c zend_operators.c zend_ptr_stack.c \ - zend_stack.c zend_variables.c zend.c zend_API.c zend_extensions.c \ - zend_hash.c zend_list.c zend_indent.c zend_builtin_functions.c \ - zend_sprintf.c zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c \ - zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \ - zend_object_handlers.c zend_objects_API.c \ - zend_default_classes.c zend_execute.c zend_strtod.c"); - -ADD_SOURCES("main", "main.c snprintf.c spprintf.c safe_mode.c fopen_wrappers.c \ - php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \ - strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \ - php_open_temporary_file.c php_logos.c output.c internal_functions.c php_sprintf.c"); - -ADD_SOURCES("main/streams", "streams.c cast.c memory.c filter.c plain_wrapper.c \ - userspace.c transports.c xp_socket.c mmap.c"); - -ADD_SOURCES("win32", "crypt_win32.c glob.c md5crypt.c readdir.c \ - registry.c select.c sendmail.c time.c wfile.c winutil.c wsyslog.c globals.c"); - -ADD_SOURCES("regex", "regcomp.c regerror.c regexec.c regfree.c"); - -STDOUT.WriteBlankLines(1); - -/* Can we build with IPv6 support? */ -ARG_ENABLE("ipv6", "Disable IPv6 support (default is turn it on if available)", "yes"); - -var main_network_has_ipv6 = 0; -if (PHP_IPV6 == "yes") { - main_network_has_ipv6 = CHECK_HEADER_ADD_INCLUDE("wspiapi.h", "CFLAGS") ? 1 : 0; -} -if (main_network_has_ipv6) { - STDOUT.WriteLine("Enabling IPv6 support"); -} -AC_DEFINE('HAVE_GETADDRINFO', main_network_has_ipv6); -AC_DEFINE('HAVE_GAI_STRERROR', main_network_has_ipv6); -AC_DEFINE('HAVE_IPV6', main_network_has_ipv6); - -/* this allows up to 256 sockets to be select()ed in a single - * call to select(), instead of the usual 64 */ -ARG_ENABLE('fd-setsize', "Set maximum number of sockets for select(2)", "256"); -ADD_FLAG("CFLAGS", "/D FD_SETSIZE=" + parseInt(PHP_FD_SETSIZE)); - -ARG_ENABLE("zend-multibyte", "Enable Zend multibyte encoding support", "no"); -if (PHP_ZEND_MULTIBYTE == "yes") { - STDOUT.WriteLine("Enabling Zend multibyte encoding support"); - AC_DEFINE('ZEND_MULTIBYTE', 1); -} - -AC_DEFINE('HAVE_USLEEP', 1); -AC_DEFINE('HAVE_STRCOLL', 1); - -/* For snapshot builders, where can we find the additional - * files that make up the snapshot template? */ -ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no"); - -if (PHP_SNAPSHOT_TEMPLATE == "no") { - /* default is as a sibling of the php_build dir */ - if (FSO.FolderExists(PHP_PHP_BUILD + "\\template")) { - PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\template"); - } else if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) { - PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template"); - } -} - -DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE); diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in deleted file mode 100644 index 442850a3e5562..0000000000000 --- a/win32/build/config.w32.h.in +++ /dev/null @@ -1,157 +0,0 @@ -/* - Build Configuration Template for Win32. - $Id$ -*/ - -/* Default PHP / PEAR directories */ -#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):"" -#define CONFIGURATION_FILE_PATH "php.ini" -#define PEAR_INSTALLDIR "@PREFIX@\\pear" -#define PHP_BINDIR "@PREFIX@" -#define PHP_DATADIR "@PREFIX@" -#define PHP_EXTENSION_DIR "@PREFIX@" -#define PHP_INCLUDE_PATH ".;@PREFIX@\\pear" -#define PHP_LIBDIR "@PREFIX@" -#define PHP_LOCALSTATEDIR "@PREFIX@" -#define PHP_PREFIX "@PREFIX@" -#define PHP_SYSCONFDIR "@PREFIX@" - -/* Enable / Disable crypt() function (default: enabled) */ -#define HAVE_CRYPT 1 -#define PHP_STD_DES_CRYPT 1 -#define PHP_EXT_DES_CRYPT 0 -#define PHP_MD5_CRYPT 1 -#define PHP_BLOWFISH_CRYPT 0 - -/* PHP Runtime Configuration */ -#define PHP_URL_FOPEN 1 -#define PHP_SAFE_MODE 0 -#define MAGIC_QUOTES 0 -#define USE_CONFIG_FILE 1 -#define DEFAULT_SHORT_OPEN_TAG "1" - -/* Platform-Specific Configuration. Should not be changed. */ -#define PHP_SIGCHILD 0 -#define HAVE_LIBBIND 1 -#define HAVE_GETSERVBYNAME 1 -#define HAVE_GETSERVBYPORT 1 -#define HAVE_GETPROTOBYNAME 1 -#define HAVE_GETPROTOBYNUMBER 1 -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 -#define HAVE_ERRMSG_H 0 -#undef HAVE_ADABAS -#undef HAVE_SOLID -#undef HAVE_LINK -#undef HAVE_SYMLINK - -/* its in win32/time.c */ -#define HAVE_USLEEP 1 - -#define HAVE_GETCWD 1 -#define HAVE_POSIX_READDIR_R 1 -#define NEED_ISBLANK 1 -#define DISCARD_PATH 0 -#undef HAVE_SETITIMER -#undef HAVE_IODBC -#define HAVE_LIBDL 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_PUTENV 1 -#define HAVE_LIMITS_H 1 -#define HAVE_TZSET 1 -#define HAVE_TZNAME 1 -#undef HAVE_FLOCK -#define HAVE_ALLOCA 1 -#undef HAVE_SYS_TIME_H -#define HAVE_SIGNAL_H 1 -#undef HAVE_ST_BLKSIZE -#undef HAVE_ST_BLOCKS -#define HAVE_ST_RDEV 1 -#define HAVE_UTIME_NULL 1 -#define HAVE_VPRINTF 1 -#define STDC_HEADERS 1 -#define REGEX 1 -#define HSREGEX 1 -#define HAVE_GCVT 1 -#define HAVE_GETLOGIN 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_PUTENV 1 -#define HAVE_REGCOMP 1 -#define HAVE_SETLOCALE 1 -#define HAVE_LOCALECONV 1 -#define HAVE_LOCALE_H 1 -#ifndef HAVE_LIBBIND -# define HAVE_SETVBUF 1 -#endif -#define HAVE_SHUTDOWN 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRDUP 1 -#define HAVE_STRERROR 1 -#define HAVE_STRSTR 1 -#define HAVE_TEMPNAM 1 -#define HAVE_UTIME 1 -#undef HAVE_DIRENT_H -#define HAVE_ASSERT_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_GRP_H 0 -#undef HAVE_PWD_H -#define HAVE_STRING_H 1 -#undef HAVE_SYS_FILE_H -#undef HAVE_SYS_SOCKET_H -#undef HAVE_SYS_WAIT_H -#define HAVE_SYSLOG_H 1 -#undef HAVE_UNISTD_H -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDARG_H 1 -#undef HAVE_ALLOCA_H -#undef HAVE_KILL -#define HAVE_GETPID 1 -#define HAVE_LIBM 1 -#define HAVE_CUSERID 0 -#undef HAVE_RINT -#define HAVE_STRFTIME 1 -#define SIZEOF_SHORT 2 -/* int and long are stll 32bit in 64bit compiles */ -#define SIZEOF_INT 4 -#define SIZEOF_LONG 4 -/* MSVC.6/NET don't allow 'long long' or know 'intmax_t' */ -#define SIZEOF_LONG_LONG_INT 0 -#define SIZEOF_LONG_LONG 8 /* defined as __int64 */ -#define SIZEOF_INTMAX_T 0 -#define ssize_t SSIZE_T -#ifdef _WIN64 -# define SIZEOF_SIZE_T 8 -# define SIZEOF_PTRDIFF_T 8 -#else -# define SIZEOF_SIZE_T 4 -# define SIZEOF_PTRDIFF_T 4 -#endif -#define HAVE_GLOB -#define PHP_SHLIB_SUFFIX "dll" -#define HAVE_SQLDATASOURCES - -/* Win32 supports strcoll */ -#define HAVE_STRCOLL 1 - -/* Win32 support proc_open */ -#define PHP_CAN_SUPPORT_PROC_OPEN 1 - -#define HAVE_MBLEN - -#undef HAVE_ATOF_ACCEPTS_NAN -#undef HAVE_ATOF_ACCEPTS_INF -#define HAVE_HUGE_VAL_NAN 1 - -/* vs.net 2005 has a 64-bit time_t. This will likely break - * 3rdParty libs that were built with older compilers; switch - * back to 32-bit */ -#ifndef _WIN64 -# define _USE_32BIT_TIME_T 1 -#endif -#define HAVE_STDLIB_H 1 - diff --git a/win32/build/configure.bat b/win32/build/configure.bat deleted file mode 100644 index 7890ead40f39f..0000000000000 --- a/win32/build/configure.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -cscript /nologo win32\build\buildconf.js %* diff --git a/win32/build/configure.tail b/win32/build/configure.tail deleted file mode 100644 index e74287d2aaaf6..0000000000000 --- a/win32/build/configure.tail +++ /dev/null @@ -1,6 +0,0 @@ -// vim:ft=javascript -// $Id$ -// tail end of configure - -generate_files(); - diff --git a/win32/build/confutils.js b/win32/build/confutils.js deleted file mode 100644 index 015a0aa0acce7..0000000000000 --- a/win32/build/confutils.js +++ /dev/null @@ -1,1573 +0,0 @@ -// Utils for configure script -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -// $Id: confutils.js,v 1.60.2.1.2.10 2008-01-17 21:17:29 cellog Exp $ - -var STDOUT = WScript.StdOut; -var STDERR = WScript.StdErr; -var WshShell = WScript.CreateObject("WScript.Shell"); -var FSO = WScript.CreateObject("Scripting.FileSystemObject"); -var MFO = null; -var SYSTEM_DRIVE = WshShell.Environment("Process").Item("SystemDrive"); -var PROGRAM_FILES = WshShell.Environment("Process").Item("ProgramFiles"); - -if (PROGRAM_FILES == null) { - PROGRAM_FILES = "C:\\Program Files"; -} - -if (!FSO.FileExists("README.CVS-RULES")) { - STDERR.WriteLine("Must be run from the root of the php source"); - WScript.Quit(10); -} - -var CWD = WshShell.CurrentDirectory; - -if (typeof(CWD) == "undefined") { - CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.CVS-RULES")); -} - -/* defaults; we pick up the precise versions from configure.in */ -var PHP_VERSION = 5; -var PHP_MINOR_VERSION = 0; -var PHP_RELEASE_VERSION = 0; -var PHP_EXTRA_VERSION = ""; -var PHP_VERSION_STRING = "5.0.0"; - -function get_version_numbers() -{ - var cin = file_get_contents("configure.in"); - - if (cin.match(new RegExp("PHP_MAJOR_VERSION=(\\d+)"))) { - PHP_VERSION = RegExp.$1; - } - if (cin.match(new RegExp("PHP_MINOR_VERSION=(\\d+)"))) { - PHP_MINOR_VERSION = RegExp.$1; - } - if (cin.match(new RegExp("PHP_RELEASE_VERSION=(\\d+)"))) { - PHP_RELEASE_VERSION = RegExp.$1; - } - PHP_VERSION_STRING = PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION; - - if (cin.match(new RegExp("PHP_EXTRA_VERSION=\"([^\"]+)\""))) { - PHP_EXTRA_VERSION = RegExp.$1; - if (PHP_EXTRA_VERSION.length) { - PHP_VERSION_STRING += PHP_EXTRA_VERSION; - } - } - DEFINE('PHP_VERSION_STRING', PHP_VERSION_STRING); -} - -configure_args = new Array(); -configure_subst = WScript.CreateObject("Scripting.Dictionary"); - -configure_hdr = WScript.CreateObject("Scripting.Dictionary"); -build_dirs = new Array(); - -extension_include_code = ""; -extension_module_ptrs = ""; - -get_version_numbers(); - -/* execute a command and return the output as a string */ -function execute(command_line) -{ - var e = WshShell.Exec(command_line); - var ret = ""; - - ret = e.StdOut.ReadAll(); - -//STDOUT.WriteLine("command " + command_line); -//STDOUT.WriteLine(ret); - - return ret; -} - -function condense_path(path) -{ - path = FSO.GetAbsolutePathName(path); - - if (path.substr(0, CWD.length).toLowerCase() - == CWD.toLowerCase() && - (path.charCodeAt(CWD.length) == 92 || path.charCodeAt(CWD.length) == 47)) { - return path.substr(CWD.length + 1); - } - - var a = CWD.split("\\"); - var b = path.split("\\"); - var i, j; - - for (i = 0; i < b.length; i++) { - if (a[i].toLowerCase() == b[i].toLowerCase()) - continue; - if (i > 0) { - /* first difference found */ - path = ""; - for (j = 0; j < a.length - i; j++) { - path += "..\\"; - } - for (j = i; j < b.length; j++) { - path += b[j]; - if (j < b.length - 1) - path += "\\"; - } - return path; - } - /* on a different drive */ - break; - } - - return path; -} - -function ConfigureArg(type, optname, helptext, defval) -{ - var opptype = type == "enable" ? "disable" : "without"; - - if (defval == "yes" || defval == "yes,shared") { - this.arg = "--" + opptype + "-" + optname; - this.imparg = "--" + type + "-" + optname; - } else { - this.arg = "--" + type + "-" + optname; - this.imparg = "--" + opptype + "-" + optname; - } - - this.optname = optname; - this.helptext = helptext; - this.defval = defval; - this.symval = optname.toUpperCase().replace(new RegExp("-", "g"), "_"); - this.seen = false; - this.argval = defval; -} - -function ARG_WITH(optname, helptext, defval) -{ - configure_args[configure_args.length] = new ConfigureArg("with", optname, helptext, defval); -} - -function ARG_ENABLE(optname, helptext, defval) -{ - configure_args[configure_args.length] = new ConfigureArg("enable", optname, helptext, defval); -} - -function analyze_arg(argval) -{ - var ret = new Array(); - var shared = false; - - if (argval == "shared") { - shared = true; - argval = "yes"; - } else if (argval == null) { - /* nothing */ - } else if (arg_match = argval.match(new RegExp("^shared,(.*)"))) { - shared = true; - argval = arg_match[1]; - } else if (arg_match = argval.match(new RegExp("^(.*),shared$"))) { - shared = true; - argval = arg_match[1]; - } - - ret[0] = shared; - ret[1] = argval; - return ret; -} - -function word_wrap_and_indent(indent, text, line_suffix, indent_char) -{ - if (text == null) { - return ""; - } - - var words = text.split(new RegExp("\\s+", "g")); - var i = 0; - var ret_text = ""; - var this_line = ""; - var t; - var space = ""; - var lines = 0; - - if (line_suffix == null) { - line_suffix = ""; - } - - if (indent_char == null) { - indent_char = " "; - } - - for (i = 0; i < indent; i++) { - space += indent_char; - } - - for (i = 0; i < words.length; i++) { - if (this_line.length) { - t = this_line + " " + words[i]; - } else { - t = words[i]; - } - - if (t.length + indent > 78) { - if (lines++) { - ret_text += space; - } - ret_text += this_line + line_suffix + "\r\n"; - this_line = ""; - } - - if (this_line.length) { - this_line += " " + words[i]; - } else { - this_line = words[i]; - } - } - - if (this_line.length) { - if (lines) - ret_text += space; - ret_text += this_line; - } - - return ret_text; -} - -function conf_process_args() -{ - var i, j; - var configure_help_mode = false; - var analyzed = false; - var nice = "cscript /nologo configure.js "; - var disable_all = false; - - args = WScript.Arguments; - for (i = 0; i < args.length; i++) { - arg = args(i); - nice += ' "' + arg + '"'; - if (arg == "--help") { - configure_help_mode = true; - break; - } - if (arg == "--disable-all") { - disable_all = true; - continue; - } - - // If it is --foo=bar, split on the equals sign - arg = arg.split("=", 2); - argname = arg[0]; - if (arg.length > 1) { - argval = arg[1]; - } else { - argval = null; - } - - // Find the arg - found = false; - for (j = 0; j < configure_args.length; j++) { - if (argname == configure_args[j].imparg || argname == configure_args[j].arg) { - found = true; - - arg = configure_args[j]; - arg.seen = true; - - analyzed = analyze_arg(argval); - shared = analyzed[0]; - argval = analyzed[1]; - - if (argname == arg.imparg) { - /* we matched the implicit, or default arg */ - if (argval == null) { - argval = arg.defval; - } - } else { - /* we matched the non-default arg */ - if (argval == null) { - argval = arg.defval == "no" ? "yes" : "no"; - } - } - - arg.argval = argval; - eval("PHP_" + arg.symval + " = argval;"); - eval("PHP_" + arg.symval + "_SHARED = shared;"); - break; - } - } - if (!found) { - STDERR.WriteLine("Unknown option " + argname + "; please try configure.js --help for a list of valid options"); - WScript.Quit(2); - } - } - - if (configure_help_mode) { - STDOUT.WriteLine(word_wrap_and_indent(0, -"Options that enable extensions and SAPI will accept \ -'yes' or 'no' as a parameter. They also accept 'shared' \ -as a synonym for 'yes' and request a shared build of that \ -module. Not all modules can be built as shared modules; \ -configure will display [shared] after the module name if \ -can be built that way. \ -" - )); - STDOUT.WriteBlankLines(1); - - // Measure width to pretty-print the output - max_width = 0; - for (i = 0; i < configure_args.length; i++) { - arg = configure_args[i]; - if (arg.arg.length > max_width) - max_width = arg.arg.length; - } - - for (i = 0; i < configure_args.length; i++) { - arg = configure_args[i]; - - n = max_width - arg.arg.length; - pad = " "; - for (j = 0; j < n; j++) { - pad += " "; - } - STDOUT.WriteLine(" " + arg.arg + pad + word_wrap_and_indent(max_width + 5, arg.helptext)); - } - WScript.Quit(1); - } - - var snapshot_build_exclusions = new Array( - 'debug', 'crt-debug', 'lzf-better-compression', - 'php-build', 'snapshot-template', - 'pcre-regex', 'fastcgi', 'force-cgi-redirect', - 'path-info-check', 'zts', 'ipv6', 'memory-limit', - 'zend-multibyte', 'fd-setsize', 'memory-manager', 't1lib' - ); - var force; - - // Now set any defaults we might have missed out earlier - for (i = 0; i < configure_args.length; i++) { - arg = configure_args[i]; - if (arg.seen) - continue; - analyzed = analyze_arg(arg.defval); - shared = analyzed[0]; - argval = analyzed[1]; - - // Don't trust a default "yes" answer for a non-core module - // in a snapshot build - if (PHP_SNAPSHOT_BUILD != "no" && argval == "yes" && !shared) { - - force = true; - for (j = 0; j < snapshot_build_exclusions.length; j++) { - if (snapshot_build_exclusions[j] == arg.optname) { - force = false; - break; - } - } - - if (force) { - /* now check if it is a core module */ - force = false; - for (j = 0; j < core_module_list.length; j++) { - if (core_module_list[j] == arg.optname) { - force = true; - break; - } - } - - if (!force) { - STDOUT.WriteLine("snapshot: forcing " + arg.arg + " shared"); - shared = true; - } - } - } - - if (PHP_SNAPSHOT_BUILD != "no" && argval == "no") { - force = true; - for (j = 0; j < snapshot_build_exclusions.length; j++) { - if (snapshot_build_exclusions[j] == arg.optname) { - force = false; - break; - } - } - if (force) { - STDOUT.WriteLine("snapshot: forcing " + arg.optname + " on"); - argval = "yes"; - shared = true; - } - } - - if (disable_all) { - force = true; - for (j = 0; j < snapshot_build_exclusions.length; j++) { - if (snapshot_build_exclusions[j] == arg.optname) { - force = false; - break; - } - } - if (force) { - argval = "no"; - shared = false; - } - } - - eval("PHP_" + arg.symval + " = argval;"); - eval("PHP_" + arg.symval + "_SHARED = shared;"); - } - - MFO = FSO.CreateTextFile("Makefile.objects", true); - - STDOUT.WriteLine("Saving configure options to config.nice.bat"); - var nicefile = FSO.CreateTextFile("config.nice.bat", true); - nicefile.WriteLine(nice + " %*"); - nicefile.Close(); - - AC_DEFINE('CONFIGURE_COMMAND', nice); -} - -function DEFINE(name, value) -{ - if (configure_subst.Exists(name)) { - configure_subst.Remove(name); - } - configure_subst.Add(name, value); -} - -// Searches a set of paths for a file; -// returns the dir in which the file was found, -// true if it was found in the default env path, -// or false if it was not found at all. -// env_name is the optional name of an env var -// specifying the default path to search -function search_paths(thing_to_find, explicit_path, env_name) -{ - var i, found = false, place = false, file, env; - - STDOUT.Write("Checking for " + thing_to_find + " ... "); - - thing_to_find = thing_to_find.replace(new RegExp("/", "g"), "\\"); - - if (explicit_path != null) { - if (typeof(explicit_path) == "string") { - explicit_path = explicit_path.split(";"); - } - - for (i = 0; i < explicit_path.length; i++) { - file = glob(explicit_path[i] + "\\" + thing_to_find); - if (file) { - found = true; - place = file[0]; - place = place.substr(0, place.length - thing_to_find.length - 1); - break; - } - } - } - - if (!found && env_name != null) { - env = WshShell.Environment("Process").Item(env_name); - env = env.split(";"); - for (i = 0; i < env.length; i++) { - file = glob(env[i] + "\\" + thing_to_find); - if (file) { - found = true; - place = true; - break; - } - } - } - - if (found && place == true) { - STDOUT.WriteLine(" "); - } else if (found) { - STDOUT.WriteLine(" " + place); - } else { - STDOUT.WriteLine(" "); - } - return place; -} - -function PATH_PROG(progname, additional_paths, symbol) -{ - var exe; - var place; - var cyg_path = PHP_CYGWIN + "\\bin;" + PHP_CYGWIN + "\\usr\\local\\bin"; - - exe = progname + ".exe"; - - if (additional_paths == null) { - additional_paths = cyg_path; - } else { - additional_paths += ";" + cyg_path; - } - - place = search_paths(exe, additional_paths, "PATH"); - - if (place == true) { - place = exe; - } else if (place != false) { - place = place + "\\" + exe; - } - - if (place) { - if (symbol == null) { - symbol = progname.toUpperCase(); - } - DEFINE(symbol, place); - } - return place; -} - -function find_pattern_in_path(pattern, path) -{ - if (path == null) { - return false; - } - - var dirs = path.split(';'); - var i; - var items; - - for (i = 0; i < dirs.length; i++) { - items = glob(dirs[i] + "\\" + pattern); - if (items) { - return condense_path(items[0]); - } - } - return false; -} - -function CHECK_LIB(libnames, target, path_to_check, common_name) -{ - STDOUT.Write("Checking for library " + libnames + " ... "); - - if (common_name == null && target != null) { - common_name = target; - } - - if (path_to_check == null) { - path_to_check = ""; - } - - // if they specified a common name for the package that contains - // the library, tag some useful defaults on to the end of the - // path to be searched - if (common_name != null) { - path_to_check += ";" + PHP_PHP_BUILD + "\\" + common_name + "*"; - path_to_check += ";" + PHP_PHP_BUILD + "\\lib\\" + common_name + "*"; - path_to_check += ";..\\" + common_name + "*"; - } - - // Determine target for build flags - if (target == null) { - target = ""; - } else { - target = "_" + target.toUpperCase(); - } - - // Expand path to include general dirs - path_to_check += ";" + php_usual_lib_suspects; - - // It is common practice to put libs under one of these dir names - var subdirs = new Array(PHP_DEBUG == "yes" ? "Debug" : (PHP_DEBUG_PACK == "yes"?"Release_Dbg":"Release"), "lib", "libs", "libexec"); - - // libnames can be ; separated list of accepted library names - libnames = libnames.split(';'); - - var i, j, k, libname; - var location = false; - var path = path_to_check.split(';'); - - for (i = 0; i < libnames.length; i++) { - libname = libnames[i]; - - for (k = 0; k < path.length; k++) { - location = glob(path[k] + "\\" + libname); - if (location) { - location = location[0]; - break; - } - for (j = 0; j < subdirs.length; j++) { - location = glob(path[k] + "\\" + subdirs[j] + "\\" + libname); - if (location) { - location = location[0]; - break; - } - } - if (location) - break; - } - - if (location) { - location = condense_path(location); - var libdir = FSO.GetParentFolderName(location); - libname = FSO.GetFileName(location); - ADD_FLAG("LDFLAGS" + target, '/libpath:"' + libdir + '" '); - ADD_FLAG("LIBS" + target, libname); - - STDOUT.WriteLine(location); - - return location; - } - - // Check in their standard lib path - location = find_pattern_in_path(libname, WshShell.Environment("Process").Item("LIB")); - - if (location) { - location = condense_path(location); - libname = FSO.GetFileName(location); - ADD_FLAG("LIBS" + target, libname); - - STDOUT.WriteLine(" " + libname); - return location; - } - - // Check in their general extra libs path - location = find_pattern_in_path(libname, PHP_EXTRA_LIBS); - if (location) { - location = condense_path(location); - libname = FSO.GetFileName(location); - ADD_FLAG("LIBS" + target, libname); - STDOUT.WriteLine(""); - return location; - } - } - - STDOUT.WriteLine(""); - - return false; -} - -function OLD_CHECK_LIB(libnames, target, path_to_check) -{ - if (target == null) { - target = ""; - } else { - target = "_" + target.toUpperCase(); - } - - if (path_to_check == null) { - path_to_check = php_usual_lib_suspects; - } else { - path_to_check += ";" + php_usual_lib_suspects; - } - var have = 0; - var p; - var i; - var libname; - - var subdir = PHP_DEBUG == "yes" ? "Debug" : (PHP_DEBUG_PACK == "yes"?"Release_Dbg":"Release"); - - libnames = libnames.split(';'); - for (i = 0; i < libnames.length; i++) { - libname = libnames[i]; - p = search_paths(libname, path_to_check, "LIB"); - - if (!p) { - p = search_paths(subdir + "\\" + libname, path_to_check, "LIB"); - if (p) { - p += "\\" + subdir; - } - } - - if (typeof(p) == "string") { - ADD_FLAG("LDFLAGS" + target, '/libpath:"' + p + '" '); - ADD_FLAG("LIBS" + target, libname); - have = 1; - } else if (p == true) { - ADD_FLAG("LIBS" + target, libname); - have = 1; - } else { - /* not found in the defaults or the explicit paths, - * so check the general extra libs; if we find - * it here, no need to add another /libpath: for it as we - * already have it covered, but we need to add the lib - * to LIBS_XXX */ - if (false != search_paths(libname, PHP_EXTRA_LIBS, null)) { - ADD_FLAG("LIBS" + target, libname); - have = 1; - } - } - - if (have) { - break; - } - } - -// AC_DEFINE("HAVE_" + header_name.toUpperCase().replace(new RegExp("/\\\\-\.", "g"), "_"), have); - - return have; - -} - -function CHECK_FUNC_IN_HEADER(header_name, func_name, path_to_check, add_to_flag) -{ - var c = false; - var sym; - - STDOUT.Write("Checking for " + func_name + " in " + header_name + " ... "); - - c = GREP_HEADER(header_name, func_name, path_to_check); - - sym = func_name.toUpperCase(); - sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_"); - - if (typeof(add_to_flag) == "undefined") { - AC_DEFINE("HAVE_" + sym, c ? 1 : 0); - } else { - ADD_FLAG(add_to_flag, "/DHAVE_" + sym + "=" + (c ? "1" : "0")); - } - - if (c) { - STDOUT.WriteLine("OK"); - return c; - } - STDOUT.WriteLine("No"); - return false; -} - -function GREP_HEADER(header_name, regex, path_to_check) -{ - var c = false; - - if (FSO.FileExists(path_to_check + "\\" + header_name)) { - c = file_get_contents(path_to_check + "\\" + header_name); - } - - if (!c) { - /* look in the include path */ - - var p = search_paths(header_name, path_to_check, "INCLUDE"); - if (typeof(p) == "string") { - c = file_get_contents(p); - } else if (p == false) { - p = search_paths(header_name, PHP_EXTRA_INCLUDES, null); - if (typeof(p) == "string") { - c = file_get_contents(p); - } - } - if (!c) { - return false; - } - } - - if (typeof(regex) == "string") { - regex = new RegExp(regex); - } - - if (c.match(regex)) { - /* caller can now use RegExp.$1 etc. to get at patterns */ - return true; - } - return false; -} - -function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env, add_dir_part, add_to_flag_only) -{ - var dir_part_to_add = ""; - - if (use_env == null) { - use_env = true; - } - - // if true, add the dir part of the header_name to the include path - if (add_dir_part == null) { - add_dir_part = false; - } else if (add_dir_part) { - var basename = FSO.GetFileName(header_name); - dir_part_to_add = "\\" + header_name.substr(0, header_name.length - basename.length - 1); - } - - if (path_to_check == null) { - path_to_check = php_usual_include_suspects; - } else { - path_to_check += ";" + php_usual_include_suspects; - } - - var p = search_paths(header_name, path_to_check, use_env ? "INCLUDE" : null); - var have = 0; - var sym; - - if (typeof(p) == "string") { - ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" '); - } else if (p == false) { - /* not found in the defaults or the explicit paths, - * so check the general extra includes; if we find - * it here, no need to add another /I for it as we - * already have it covered, unless we are adding - * the dir part.... */ - p = search_paths(header_name, PHP_EXTRA_INCLUDES, null); - if (typeof(p) == "string" && add_dir_part) { - ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" '); - } - } - have = p ? 1 : 0 - - sym = header_name.toUpperCase(); - sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_"); - - if (typeof(add_to_flag_only) == "undefined" && - flag_name.match(new RegExp("^CFLAGS_(.*)$"))) { - add_to_flag_only = true; - } - - if (typeof(add_to_flag_only) != "undefined") { - ADD_FLAG(flag_name, "/DHAVE_" + sym + "=" + have); - } else { - AC_DEFINE("HAVE_" + sym, have, "have the " + header_name + " header file"); - } - - return p; -} - -/* emits rule to generate version info for a SAPI - * or extension. Returns the name of the .res file - * that will be generated */ -function generate_version_info_resource(makefiletarget, creditspath) -{ - var resname = makefiletarget + ".res"; - var res_desc = "PHP " + makefiletarget; - var res_prod_name = res_desc; - var credits; - var thanks = ""; - var logo = ""; - - if (FSO.FileExists(creditspath + '/CREDITS')) { - credits = FSO.OpenTextFile(creditspath + '/CREDITS', 1); - res_desc = credits.ReadLine(); - try { - thanks = credits.ReadLine(); - } catch (e) { - thanks = null; - } - if (thanks == null) { - thanks = ""; - } else { - thanks = "Thanks to " + thanks; - } - credits.Close(); - } - - if (makefiletarget.match(new RegExp("\\.exe$"))) { - logo = " /D WANT_LOGO "; - } - - /** - * Use user supplied template.rc if it exists - */ - if (FSO.FileExists(creditspath + '\\template.rc')) { - MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": " + creditspath + "\\template.rc"); - MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname + logo + - ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' + makefiletarget + - '\\"" /d PRODUCT_NAME="\\"' + res_prod_name + '\\"" /d THANKS_GUYS="\\"' + - thanks + '\\"" ' + creditspath + '\\template.rc'); - return resname; - } - - MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc"); - MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname + logo + - ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' + makefiletarget + - '\\"" /d PRODUCT_NAME="\\"' + res_prod_name + '\\"" /d THANKS_GUYS="\\"' + - thanks + '\\"" win32\\build\\template.rc'); - MFO.WriteBlankLines(1); - - return resname; -} - -function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) -{ - var SAPI = sapiname.toUpperCase(); - var ldflags; - var resname; - var ld; - var manifest; - - if (typeof(obj_dir) == "undefined") { - sapiname_for_printing = configure_module_dirname; - } else { - sapiname_for_printing = configure_module_dirname + " (via " + obj_dir + ")"; - } - - STDOUT.WriteLine("Enabling SAPI " + sapiname_for_printing); - - MFO.WriteBlankLines(1); - MFO.WriteLine("# objects for SAPI " + sapiname); - MFO.WriteBlankLines(1); - - if (cflags) { - ADD_FLAG('CFLAGS_' + SAPI, cflags); - } - - ADD_SOURCES(configure_module_dirname, file_list, sapiname, obj_dir); - MFO.WriteBlankLines(1); - MFO.WriteLine("# SAPI " + sapiname); - MFO.WriteBlankLines(1); - - /* generate a .res file containing version information */ - resname = generate_version_info_resource(makefiletarget, configure_module_dirname); - - MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget); - MFO.WriteLine("\t@echo SAPI " + sapiname_for_printing + " build complete"); - MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname); - - if (makefiletarget.match(new RegExp("\\.dll$"))) { - ldflags = "/dll $(LDFLAGS)"; - manifest = "-@$(_VC_MANIFEST_EMBED_DLL)"; - } else if (makefiletarget.match(new RegExp("\\.lib$"))) { - ldflags = "$(LDFLAGS)"; - ld = "$(MAKE_LIB)"; - } else { - ldflags = "$(LDFLAGS)"; - manifest = "-@$(_VC_MANIFEST_EMBED_EXE)"; - } - - if (ld) { - MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname); - } else { - ld = "@$(CC)"; - MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")"); - } - - if (manifest) { - MFO.WriteLine("\t" + manifest); - } - - DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')'); - - if (configure_module_dirname.match("pecl")) { - ADD_FLAG("PECL_TARGETS", makefiletarget); - } else { - ADD_FLAG("SAPI_TARGETS", makefiletarget); - } - - MFO.WriteBlankLines(1); -} - -function ADD_DIST_FILE(filename) -{ - if (configure_module_dirname.match("pecl")) { - ADD_FLAG("PECL_EXTRA_DIST_FILES", filename); - } else { - ADD_FLAG("PHP_EXTRA_DIST_FILES", filename); - } -} - -function file_get_contents(filename) -{ - var f, c; - try { - f = FSO.OpenTextFile(filename, 1); - c = f.ReadAll(); - f.Close(); - return c; - } catch (e) { - STDOUT.WriteLine("Problem reading " + filename); - return false; - } -} - -// Add a dependency on another extension, so that -// the dependencies are built before extname -function ADD_EXTENSION_DEP(extname, dependson, optional) -{ - var EXT = extname.toUpperCase(); - var DEP = dependson.toUpperCase(); - var dep_present = false; - var dep_shared = false; - - try { - dep_present = eval("PHP_" + DEP); - dep_shared = eval("PHP_" + DEP + "_SHARED"); - } catch (e) { - dep_present = "no"; - dep_shared = false; - } - - if (optional) { - if (dep_present == "no") - return; - } - - var ext_shared = eval("PHP_" + EXT + "_SHARED"); - - if (dep_shared) { - if (!ext_shared) { - if (optional) { - return; - } - ERROR("static " + extname + " cannot depend on shared " + dependson); - } - ADD_FLAG("LDFLAGS_" + EXT, "/libpath:$(BUILD_DIR)"); - ADD_FLAG("LIBS_" + EXT, "php_" + dependson + ".lib"); - ADD_FLAG("DEPS_" + EXT, "$(BUILD_DIR)\\php_" + dependson + ".lib"); - } else { - if (dep_present == "no") { - if (ext_shared) { - WARNING(extname + " has a missing dependency: " + dependson); - } else { - ERROR("Cannot build " + extname + "; " + dependson + " not enabled"); - } - } - } -} - -function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) -{ - var objs = null; - var EXT = extname.toUpperCase(); - var extname_for_printing; - - if (shared == null) { - eval("shared = PHP_" + EXT + "_SHARED;"); - } - if (cflags == null) { - cflags = ""; - } - - if (typeof(obj_dir) == "undefined") { - extname_for_printing = configure_module_dirname; - } else { - extname_for_printing = configure_module_dirname + " (via " + obj_dir + ")"; - } - - if (shared) { - STDOUT.WriteLine("Enabling extension " + extname_for_printing + " [shared]"); - cflags = "/D COMPILE_DL_" + EXT + " /D " + EXT + "_EXPORTS=1 " + cflags; - ADD_FLAG("CFLAGS_PHP", "/D COMPILE_DL_" + EXT); - } else { - STDOUT.WriteLine("Enabling extension " + extname_for_printing); - } - - MFO.WriteBlankLines(1); - MFO.WriteLine("# objects for EXT " + extname); - MFO.WriteBlankLines(1); - - - ADD_SOURCES(configure_module_dirname, file_list, extname, obj_dir); - - MFO.WriteBlankLines(1); - - if (shared) { - if (dllname == null) { - dllname = "php_" + extname + ".dll"; - } - var libname = dllname.substring(0, dllname.length-4) + ".lib"; - - var resname = generate_version_info_resource(dllname, configure_module_dirname); - var ld = "@$(CC)"; - - MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname); - MFO.WriteBlankLines(1); - MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname); - MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")"); - MFO.WriteLine("\t-@$(_VC_MANIFEST_EMBED_DLL)"); - MFO.WriteBlankLines(1); - - if (configure_module_dirname.match("pecl")) { - ADD_FLAG("PECL_TARGETS", dllname); - } else { - ADD_FLAG("EXT_TARGETS", dllname); - } - MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname); - MFO.WriteLine("\t@echo EXT " + extname + " build complete"); - MFO.WriteBlankLines(1); - - DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')'); - } else { - ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)"); - ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")"); - ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")"); - ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")"); - - /* find the header that declares the module pointer, - * so we can include it in internal_functions.c */ - var ext_dir = FSO.GetFolder(configure_module_dirname); - var fc = new Enumerator(ext_dir.Files); - var re = /\.h$/; - var s, c; - for (; !fc.atEnd(); fc.moveNext()) { - s = fc.item() + ""; - if (s.match(re)) { - c = file_get_contents(s); - if (c.match("phpext_")) { - extension_include_code += '#include "' + configure_module_dirname + '/' + FSO.GetFileName(s) + '"\r\n'; - } - } - } - - extension_module_ptrs += '\tphpext_' + extname + '_ptr,\r\n'; - - DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_PHP) $(CFLAGS_' + EXT + ')'); - } - ADD_FLAG("CFLAGS_" + EXT, cflags); -} - -function ADD_SOURCES(dir, file_list, target, obj_dir) -{ - var i; - var tv; - var src, obj, sym, flags; - - if (target == null) { - target = "php"; - } - - sym = target.toUpperCase() + "_GLOBAL_OBJS"; - flags = "CFLAGS_" + target.toUpperCase() + '_OBJ'; - - if (configure_subst.Exists(sym)) { - tv = configure_subst.Item(sym); - } else { - tv = ""; - } - - file_list = file_list.split(new RegExp("\\s+")); - file_list.sort(); - - var re = new RegExp("\.[a-z0-9A-Z]+$"); - - dir = dir.replace(new RegExp("/", "g"), "\\"); - var objs_line = ""; - var srcs_line = ""; - - var sub_build = "$(BUILD_DIR)\\"; - - /* if module dir is not a child of the main source dir, - * we need to tweak it; we should have detected such a - * case in condense_path and rewritten the path to - * be relative. - * This probably breaks for non-sibling dirs, but that - * is not a problem as buildconf only checks for pecl - * as either a child or a sibling */ - if (obj_dir == null) { - var build_dir = dir.replace(new RegExp("^..\\\\"), ""); - var mangle_dir = build_dir.replace(new RegExp("[\\\\/.]", "g"), "_"); - var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase(); - } - else { - var build_dir = obj_dir.replace(new RegExp("^..\\\\"), ""); - var mangle_dir = build_dir.replace(new RegExp("[\\\\/.]", "g"), "_"); - var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase(); - } - - var dirs = build_dir.split("\\"); - var i, d = ""; - for (i = 0; i < dirs.length; i++) { - d += dirs[i]; - build_dirs[build_dirs.length] = d; - d += "\\"; - } - sub_build += d; - - - DEFINE(bd_flags_name, " /Fd" + sub_build + " /Fp" + sub_build + " /FR" + sub_build + " "); - - for (i in file_list) { - src = file_list[i]; - obj = src.replace(re, ".obj"); - tv += " " + sub_build + obj; - - if (PHP_ONE_SHOT == "yes") { - if (i > 0) { - objs_line += " " + sub_build + obj; - srcs_line += " " + dir + "\\" + src; - } else { - objs_line = sub_build + obj; - srcs_line = dir + "\\" + src; - } - } else { - MFO.WriteLine(sub_build + obj + ": " + dir + "\\" + src); - MFO.WriteLine("\t@$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " /Fo" + sub_build + obj); - } - } - - if (PHP_ONE_SHOT == "yes") { - MFO.WriteLine(objs_line + ": " + srcs_line); - MFO.WriteLine("\t$(CC) $(" + flags + ") $(CFLAGS) /Fo" + sub_build + " $(" + bd_flags_name + ") /c " + srcs_line); - } - - DEFINE(sym, tv); -} - -function generate_internal_functions() -{ - var infile, outfile; - var indata; - - STDOUT.WriteLine("Generating main/internal_functions.c"); - - infile = FSO.OpenTextFile("main/internal_functions.c.in", 1); - indata = infile.ReadAll(); - infile.Close(); - - indata = indata.replace("@EXT_INCLUDE_CODE@", extension_include_code); - indata = indata.replace("@EXT_MODULE_PTRS@", extension_module_ptrs); - - if (FSO.FileExists("main/internal_functions.c")) { - var origdata = file_get_contents("main/internal_functions.c"); - - if (origdata == indata) { - STDOUT.WriteLine("\t[content unchanged; skipping]"); - return; - } - } - - outfile = FSO.CreateTextFile("main/internal_functions.c", true); - outfile.Write(indata); - outfile.Close(); -} - -function generate_files() -{ - var i, dir, bd, last; - - STDOUT.WriteBlankLines(1); - STDOUT.WriteLine("Creating build dirs..."); - dir = get_define("BUILD_DIR"); - build_dirs.sort(); - last = null; - - if (!FSO.FolderExists(dir)) { - FSO.CreateFolder(dir); - } - - for (i = 0; i < build_dirs.length; i++) { - bd = FSO.BuildPath(dir, build_dirs[i]); - if (bd == last) { - continue; - } - last = bd; - ADD_FLAG("BUILD_DIRS_SUB", bd.replace(new RegExp('^'+dir+'\\\\'), '$(BUILD_DIR)\\')); - if (!FSO.FolderExists(bd)) { - FSO.CreateFolder(bd); - } - } - - STDOUT.WriteLine("Generating files..."); - generate_makefile(); - generate_internal_functions(); - generate_config_h(); - - - STDOUT.WriteLine("Done."); - STDOUT.WriteBlankLines(1); - if (PHP_SNAPSHOT_BUILD != "no") { - STDOUT.WriteLine("Type 'nmake snap' to build a PHP snapshot"); - } else { - STDOUT.WriteLine("Type 'nmake' to build PHP"); - } -} - -function generate_config_h() -{ - var infile, outfile; - var indata; - var prefix; - - prefix = PHP_PREFIX.replace(new RegExp("\\\\", "g"), "\\\\"); - - STDOUT.WriteLine("Generating main/config.w32.h"); - - infile = FSO.OpenTextFile("win32/build/config.w32.h.in", 1); - indata = infile.ReadAll(); - infile.Close(); - - outfile = FSO.CreateTextFile("main/config.w32.h", true); - - indata = indata.replace(new RegExp("@PREFIX@", "g"), prefix); - outfile.Write(indata); - - var keys = (new VBArray(configure_hdr.Keys())).toArray(); - var i, j; - var item; - var pieces, stuff_to_crack, chunk; - - outfile.WriteBlankLines(1); - outfile.WriteLine("/* values determined by configure.js */"); - - for (i in keys) { - item = configure_hdr.Item(keys[i]); - outfile.WriteBlankLines(1); - outfile.WriteLine("/* " + item[1] + " */"); - pieces = item[0]; - - if (typeof(pieces) == "string" && pieces.charCodeAt(0) == 34) { - /* quoted string have a maximal length of 2k under vc. - * solution is to crack them and let the compiler concat - * them implicitly */ - stuff_to_crack = pieces; - pieces = ""; - - while (stuff_to_crack.length) { - j = 65; - while (stuff_to_crack.charCodeAt(j) != 32 && j < stuff_to_crack.length) - j++; - - chunk = stuff_to_crack.substr(0, j); - pieces += chunk; - stuff_to_crack = stuff_to_crack.substr(chunk.length); - if (stuff_to_crack.length) - pieces += '" "'; - } - } - - outfile.WriteLine("#define " + keys[i] + " " + pieces); - } - - outfile.Close(); -} - -function generate_makefile() -{ - STDOUT.WriteLine("Generating Makefile"); - var MF = FSO.CreateTextFile("Makefile", true); - - MF.WriteLine("# Generated by configure.js"); - - /* spit out variable definitions */ - var keys = (new VBArray(configure_subst.Keys())).toArray(); - var i; - - for (i in keys) { - // The trailing space is needed to prevent the trailing backslash - // that is part of the build dir flags (CFLAGS_BD_XXX) from being - // seen as a line continuation character - MF.WriteLine(keys[i] + "=" + - //word_wrap_and_indent(1, configure_subst.Item(keys[i]), ' \\', '\t') + " " - configure_subst.Item(keys[i]) + " " - ); - MF.WriteBlankLines(1); - } - - MF.WriteBlankLines(1); - - var TF = FSO.OpenTextFile("win32/build/Makefile", 1); - MF.Write(TF.ReadAll()); - TF.Close(); - - MF.WriteBlankLines(2); - - MFO.Close(); - TF = FSO.OpenTextFile("Makefile.objects", 1); - MF.Write(TF.ReadAll()); - TF.Close(); - - MF.Close(); -} - -function ADD_FLAG(name, flags, target) -{ - if (target != null) { - name = target.toUpperCase() + "_" + name; - } - if (configure_subst.Exists(name)) { - var curr_flags = configure_subst.Item(name); - - if (curr_flags.indexOf(flags) >= 0) { - return; - } - - flags = curr_flags + " " + flags; - configure_subst.Remove(name); - } - configure_subst.Add(name, flags); -} - -function get_define(name) -{ - return configure_subst.Item(name); -} - -// Add a .def to the core to export symbols -function ADD_DEF_FILE(name) -{ - if (!configure_subst.Exists("PHPDEF")) { - DEFINE("PHPDEF", "$(BUILD_DIR)\\$(PHPDLL).def"); - ADD_FLAG("PHP_LDFLAGS", "/def:$(PHPDEF)"); - } - ADD_FLAG("PHP_DLL_DEF_SOURCES", name); -} - -function AC_DEFINE(name, value, comment, quote) -{ - if (quote == null) { - quote = true; - } - if (quote && typeof(value) == "string") { - value = '"' + value.replace(new RegExp('(["\\\\])', "g"), '\\$1') + '"'; - } else if (value.length == 0) { - value = '""'; - } - var item = new Array(value, comment); - if (configure_hdr.Exists(name)) { - var orig_item = configure_hdr.Item(name); - STDOUT.WriteLine("AC_DEFINE[" + name + "]=" + value + ": is already defined to " + item[0]); - } else { - configure_hdr.Add(name, item); - } -} - -function ERROR(msg) -{ - STDERR.WriteLine("ERROR: " + msg); - WScript.Quit(3); -} - -function WARNING(msg) -{ - STDERR.WriteLine("WARNING: " + msg); - STDERR.WriteBlankLines(1); -} - -function copy_and_subst(srcname, destname, subst_array) -{ - if (!FSO.FileExists(srcname)) { - srcname = configure_module_dirname + "\\" + srcname; - destname = configure_module_dirname + "\\" + destname; - } - - var content = file_get_contents(srcname); - var i; - - for (i = 0; i < subst_array.length; i+=2) { - var re = subst_array[i]; - var rep = subst_array[i+1]; - - content = content.replace(re, rep); - } - - var f = FSO.CreateTextFile(destname, true); - f.Write(content); - f.Close(); -} - -// glob using simple filename wildcards -// returns an array of matches that are found -// in the filesystem -function glob(path_pattern) -{ - var path_parts = path_pattern.replace(new RegExp("/", "g"), "\\").split("\\"); - var p; - var base = ""; - var is_pat_re = /\*/; - -//STDOUT.WriteLine("glob: " + path_pattern); - - if (FSO.FileExists(path_pattern)) { - return new Array(path_pattern); - } - - // first, build as much as possible that doesn't have a pattern - for (p = 0; p < path_parts.length; p++) { - if (path_parts[p].match(is_pat_re)) - break; - if (p) - base += "\\"; - base += path_parts[p]; - } - - return _inner_glob(base, p, path_parts); -} - -function _inner_glob(base, p, parts) -{ - var pat = parts[p]; - var full_name = base + "\\" + pat; - var re = null; - var items = null; - - if (p == parts.length) { - return false; - } - -//STDOUT.WriteLine("inner: base=" + base + " p=" + p + " pat=" + pat); - - if (FSO.FileExists(full_name)) { - if (p < parts.length - 1) { - // we didn't reach the full extent of the pattern - return false; - } - return new Array(full_name); - } - - if (FSO.FolderExists(full_name) && p == parts.length - 1) { - // we have reached the end of the pattern; no need to recurse - return new Array(full_name); - } - - // Convert the pattern into a regexp - re = new RegExp("^" + pat.replace(/\./g, '\\.').replace(/\*/g, '.*').replace(/\?/g, '.') + "$", "i"); - - items = new Array(); - - if (!FSO.FolderExists(base)) { - return false; - } - - var folder = FSO.GetFolder(base); - var fc = null; - var subitems = null; - var item_name = null; - var j; - - fc = new Enumerator(folder.SubFolders); - for (; !fc.atEnd(); fc.moveNext()) { - item_name = FSO.GetFileName(fc.item()); - - if (item_name.match(re)) { - // got a match; if we are at the end of the pattern, just add these - // things to the items array - if (p == parts.length - 1) { - items[items.length] = fc.item(); - } else { - // we should recurse and do more matches - subitems = _inner_glob(base + "\\" + item_name, p + 1, parts); - if (subitems) { - for (j = 0; j < subitems.length; j++) { - items[items.length] = subitems[j]; - } - } - } - } - } - - // if we are at the end of the pattern, we should match - // files too - if (p == parts.length - 1) { - fc = new Enumerator(folder.Files); - for (; !fc.atEnd(); fc.moveNext()) { - item_name = FSO.GetFileName(fc.item()); - if (item_name.match(re)) { - items[items.length] = fc.item(); - } - } - } - - if (items.length == 0) - return false; - - return items; -} - - -// for snapshot builders, this option will attempt to enable everything -// and you can then build everything, ignoring fatal errors within a module -// by running "nmake snap" -PHP_SNAPSHOT_BUILD = "no"; -ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and ignores build errors', 'no'); - -// one-shot build optimizes build by asking compiler to build -// several objects at once, reducing overhead of starting new -// compiler processes. -ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot builders, not so hot for edit-and-rebuild hacking', 'no'); - - diff --git a/win32/build/cvsclean.js b/win32/build/cvsclean.js deleted file mode 100644 index 34eda454c7fb3..0000000000000 --- a/win32/build/cvsclean.js +++ /dev/null @@ -1,120 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id: cvsclean.js,v 1.5.2.1.2.1 2007-01-01 19:32:09 iliaa Exp $ */ -// Cleans up files that do not belong in CVS - -var FSO = WScript.CreateObject("Scripting.FileSystemObject"); - -function find_cvsignore(dirname) -{ - if (!FSO.FolderExists(dirname)) - return; - - var f = FSO.GetFolder(dirname); - var fc = new Enumerator(f.SubFolders); - - for (; !fc.atEnd(); fc.moveNext()) { - find_cvsignore(fc.item()); - } - - if (FSO.FileExists(dirname + "\\.cvsignore")) { - kill_from_cvsignore(dirname + "\\.cvsignore"); - } -} - -/* recursive remove using cvsignore style wildcard matching; - * note that FSO.DeleteFolder and FSO.DeleteFile methods both - * accept wildcards, but that they are dangerous to use eg: - * "*.php" will match "*.phpt" */ -function rm_r(filename) -{ - if (FSO.FolderExists(filename)) { - var fc = new Enumerator(FSO.GetFolder(filename).SubFolders); - - for (; !fc.atEnd(); fc.moveNext()) { - rm_r(fc.item()); - } - - fc = new Enumerator(FSO.GetFolder(filename).Files); - - for (; !fc.atEnd(); fc.moveNext()) { - FSO.DeleteFile(fc.item(), true); - } - - FSO.DeleteFolder(filename, true); - } else if (FSO.FileExists(filename)) { - FSO.DeleteFile(filename, true); - } else { - /* we need to handle wildcards here */ - var foldername = FSO.GetParentFolderName(filename); - - if (foldername == "") - foldername = "."; - - var filename = FSO.GetFileName(filename); - - var retext = filename.replace(/\./g, '\\.'); - retext = '^' + retext.replace(/\*/g, '.*') + "$"; - var re = new RegExp(retext); - - var folder = FSO.GetFolder(foldername); - var fc = new Enumerator(folder.SubFolders); - for (; !fc.atEnd(); fc.moveNext()) { - - var item = FSO.GetFileName(fc.item()); - - if (item.match(re)) { - rm_r(fc.item()); - } - } - var fc = new Enumerator(folder.Files); - for (; !fc.atEnd(); fc.moveNext()) { - item = FSO.GetFileName(fc.item()); - - if (item.match(re)) { - FSO.DeleteFile(fc.item(), true); - } - } - } -} - -function kill_from_cvsignore(igfile) -{ - var dir = FSO.GetParentFolderName(igfile) + "\\"; - var t = FSO.OpenTextFile(igfile, 1); - var l; - - if (dir == ".\\") { - dir = ""; - } - - while (!t.atEndOfStream) { - l = t.ReadLine(); - // don't kill their config.nice file(s) - if (l.match("config\.nice.*") || - l.match("") || - l.match("*")) - continue; - rm_r(dir + l); - } - -} - -find_cvsignore("."); - diff --git a/win32/build/deplister.c b/win32/build/deplister.c deleted file mode 100644 index 7f0dd1b4e9713..0000000000000 --- a/win32/build/deplister.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This little application will list the DLL dependencies for a PE - * module to it's stdout for use by distro/installer building tools */ - -#include -#include - -BOOL CALLBACK StatusRoutine(IMAGEHLP_STATUS_REASON reason, - PSTR image_name, PSTR dll_name, - ULONG va, ULONG param) -{ - switch (reason) { - case BindImportModuleFailed: - printf("%s,NOTFOUND\n", dll_name); - return TRUE; - - case BindImportModule: - printf("%s,OK\n", dll_name); - return TRUE; - } - return TRUE; -} - -/* usage: - * deplister.exe path\to\module.exe path\to\symbols\root - * */ - -int main(int argc, char *argv[]) -{ - return BindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES, - argv[1], NULL, argv[2], StatusRoutine); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php deleted file mode 100644 index 546af8b0f23e0..0000000000000 --- a/win32/build/mkdist.php +++ /dev/null @@ -1,420 +0,0 @@ - array("pipe", "w")), - $pipes); - - $n = 0; - while (($line = fgetcsv($pipes[1]))) { - $n++; - - $dep = strtolower($line[0]); - $depbase = basename($dep); - /* ignore stuff in our build dir, but only if it is - * one of our targets */ - if (((in_array($depbase, $sapi_targets) || - in_array($depbase, $ext_targets) || in_array($depbase, $pecl_targets)) || - $depbase == $phpdll) && file_exists($GLOBALS['build_dir'] . "/$depbase")) { - continue; - } - /* ignore some well-known system dlls */ - if (in_array(basename($dep), $no_dist)) { - continue; - } - - if ($is_pecl) { - if (!in_array($dep, $pecl_dll_deps)) { - $pecl_dll_deps[] = $dep; - } - } else { - if (!in_array($dep, $extra_dll_deps)) { - $extra_dll_deps[] = $dep; - } - } - - $per_module_deps[basename($module)][] = $dep; - } - fclose($pipes[1]); - proc_close($proc); -//echo "Module $module [$n lines]\n"; -} - -function copy_file_list($source_dir, $dest_dir, $list) -{ - global $is_debug, $dist_dir; - - foreach ($list as $item) { - echo "Copying $item from $source_dir to $dest_dir\n"; - copy($source_dir . DIRECTORY_SEPARATOR . $item, $dest_dir . DIRECTORY_SEPARATOR . $item); - if ($is_debug) { - $itemdb = preg_replace("/\.(exe|dll|lib)$/i", ".pdb", $item); - if (file_exists("$source_dir/$itemdb")) { - copy("$source_dir/$itemdb", "$dist_dir/dev/$itemdb"); - } - } - if (preg_match("/\.(exe|dll)$/i", $item)) { - get_depends($source_dir . '/' . $item); - } - } -} - -function copy_text_file($source, $dest) -{ - $text = file_get_contents($source); - $text = preg_replace("/(\r\n?)|\n/", "\r\n", $text); - $fp = fopen($dest, "w"); - fwrite($fp, $text); - fclose($fp); -} - -/* very light-weight function to extract a single named file from - * a gzipped tarball. This makes assumptions about the files - * based on the PEAR info set in $packages. */ -function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ -{ - global $packages; - - $name = $pkg . '-' . $packages[$pkg]; - $tarball = $dest_dir . "/" . $name . '.tgz'; - $filename = $name . '/' . $filename; - $destfilename = $dest_dir . "/" . basename($filename); - - $fp = gzopen($tarball, 'rb'); - - $done = false; - do { - /* read the header */ - $hdr_data = gzread($fp, 512); - if (strlen($hdr_data) == 0) - break; - $checksum = 0; - for ($i = 0; $i < 148; $i++) - $checksum += ord($hdr_data{$i}); - for ($i = 148; $i < 156; $i++) - $checksum += 32; - for ($i = 156; $i < 512; $i++) - $checksum += ord($hdr_data{$i}); - - $hdr = unpack("a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor", $hdr_data); - - $hdr['checksum'] = octdec(trim($hdr['checksum'])); - - if ($hdr['checksum'] != $checksum) { - echo "Checksum for $tarball $hdr[filename] is invalid\n"; - print_r($hdr); - return; - } - - $hdr['size'] = octdec(trim($hdr['size'])); - echo "File: $hdr[filename] $hdr[size]\n"; - - if ($filename == $hdr['filename']) { - echo "Found the file we want\n"; - $dest = fopen($destfilename, 'wb'); - $x = stream_copy_to_stream($fp, $dest, $hdr['size']); - fclose($dest); - echo "Wrote $x bytes into $destfilename\n"; - break; - } - - /* skip body of the file */ - $size = 512 * ceil((int)$hdr['size'] / 512); - echo "Skipping $size bytes\n"; - gzseek($fp, gztell($fp) + $size); - - } while (!$done); - -} /* }}} */ - - -/* the core dll */ -copy("$build_dir/php.exe", "$dist_dir/php.exe"); -copy("$build_dir/$phpdll", "$dist_dir/$phpdll"); - -/* and the .lib goes into dev */ -$phplib = str_replace(".dll", ".lib", $phpdll); -copy("$build_dir/$phplib", "$dist_dir/dev/$phplib"); -/* debug builds; copy the symbols too */ -if ($is_debug) { - $phppdb = str_replace(".dll", ".pdb", $phpdll); - copy("$build_dir/$phppdb", "$dist_dir/dev/$phppdb"); -} -/* copy the sapi */ -copy_file_list($build_dir, "$dist_dir", $sapi_targets); - -/* copy the extensions */ -copy_file_list($build_dir, "$dist_dir/ext", $ext_targets); - -/* pecl sapi and extensions */ -copy_file_list($build_dir, $pecl_dir, $pecl_targets); - -/* populate reading material */ -$text_files = array( - "LICENSE" => "license.txt", - "NEWS" => "news.txt", - "php.ini-dist" => "php.ini-dist", - "php.ini-recommended" => "php.ini-recommended", - "win32/install.txt" => "install.txt", - "win32/pws-php5cgi.reg" => "pws-php5cgi.reg", - "win32/pws-php5isapi.reg" => "pws-php5isapi.reg", -); - -foreach ($text_files as $src => $dest) { - copy_text_file($src, $dist_dir . '/' . $dest); -} - -/* general other files */ -$general_files = array( - "php.gif" => "php.gif", -); - -foreach ($general_files as $src => $dest) { - copy($src, $dist_dir . '/' . $dest); -} - -/* include a snapshot identifier */ -$branch = "HEAD"; // TODO - determine this from CVS/Entries -$fp = fopen("$dist_dir/snapshot.txt", "w"); -$now = date("r"); -$version = phpversion(); -fwrite($fp, << $deps) { - if (in_array($modulename, $pecl_targets)) - continue; - - fprintf($fp, "Module: %s\r\n", $modulename); - fwrite($fp, "===========================\r\n"); - foreach ($deps as $dll) { - fprintf($fp, "\t%s\r\n", basename($dll)); - } - fwrite($fp, "\r\n"); -} -fclose($fp); - -/* Now add those dependencies */ -foreach ($extra_dll_deps as $dll) { - if (!file_exists($dll)) { - /* try template dir */ - $tdll = $snapshot_template . "/dlls/" . basename($dll); - if (!file_exists($tdll)) { - echo "WARNING: distro depends on $dll, but could not find it on your system\n"; - continue; - } - $dll = $tdll; - } - copy($dll, "$dist_dir/" . basename($dll)); -} -/* and those for pecl */ -foreach ($pecl_dll_deps as $dll) { - if (in_array($dll, $extra_dll_deps)) { - /* already in main distro */ - continue; - } - if (!file_exists($dll)) { - /* try template dir */ - $tdll = $snapshot_template . "/dlls/" . basename($dll); - if (!file_exists($tdll)) { - echo "WARNING: distro depends on $dll, but could not find it on your system\n"; - continue; - } - $dll = $tdll; - } - copy($dll, "$pecl_dir/" . basename($dll)); -} - -function copy_dir($source, $dest) -{ - if (!is_dir($dest)) { - if (!mkdir($dest)) { - return false; - } - } - - $d = opendir($source); - while (($f = readdir($d)) !== false) { - if ($f == '.' || $f == '..' || $f == 'CVS') { - continue; - } - $fs = $source . '/' . $f; - $fd = $dest . '/' . $f; - if (is_dir($fs)) { - copy_dir($fs, $fd); - } else { - copy($fs, $fd); - } - } - closedir($d); -} - -/* change this next line to true to use good-old - * hand-assembled go-pear-bundle from the snapshot template */ -$use_pear_template = true; - -if (!$use_pear_template) { - /* Let's do a PEAR-less pear setup */ - mkdir("$dist_dir/PEAR"); - mkdir("$dist_dir/PEAR/go-pear-bundle"); - - /* grab the bootstrap script */ - echo "Downloading go-pear\n"; - copy("http://go-pear.org/", "$dist_dir/PEAR/go-pear.php"); - - /* import the package list -- sets $packages variable */ - include "pear/go-pear-list.php"; - - /* download the packages into the destination */ - echo "Fetching packages\n"; - - foreach ($packages as $name => $version) { - $filename = "$name-$version.tgz"; - $destfilename = "$dist_dir/PEAR/go-pear-bundle/$filename"; - if (file_exists($destfilename)) - continue; - $url = "http://pear.php.net/get/$filename"; - echo "Downloading $name from $url\n"; - flush(); - copy($url, $destfilename); - } - - echo "Download complete. Extracting bootstrap files\n"; - - /* Now, we want PEAR.php, Getopt.php (Console_Getopt) and Tar.php (Archive_Tar) - * broken out of the tarballs */ - extract_file_from_tarball('PEAR', 'PEAR.php', "$dist_dir/PEAR/go-pear-bundle"); - extract_file_from_tarball('Archive_Tar', 'Archive/Tar.php', "$dist_dir/PEAR/go-pear-bundle"); - extract_file_from_tarball('Console_Getopt', 'Console/Getopt.php', "$dist_dir/PEAR/go-pear-bundle"); -} - -/* add extras from the template dir */ -if (file_exists($snapshot_template)) { - $items = glob("$snapshot_template/*"); - print_r($items); - - foreach ($items as $item) { - $bi = basename($item); - if (is_dir($item)) { - if ($bi == 'dlls' || $bi == 'symbols') { - continue; - } else if ($bi == 'PEAR') { - if ($use_pear_template) { - /* copy to top level */ - copy_dir($item, "$dist_dir/$bi"); - } - } else { - /* copy that dir into extras */ - copy_dir($item, "$dist_dir/extras/$bi"); - } - } else { - if ($bi == 'go-pear.bat') { - /* copy to top level */ - copy($item, "$dist_dir/$bi"); - } else { - /* copy to extras */ - copy($item, "$dist_dir/extras/$bi"); - } - } - } - - /* copy c++ runtime */ - $items = glob("$snapshot_template/dlls/*.CRT"); - - foreach ($items as $item) { - $bi = basename($item); - if (is_dir($item)) { - copy_dir($item, "$dist_dir/$bi"); - copy_dir($item, "$dist_dir/ext/$bi"); - } - } -} else { - echo "WARNING: you don't have a snapshot template\n"; - echo " your dist will not be complete\n"; -} - -?> diff --git a/win32/build/php.ico b/win32/build/php.ico deleted file mode 100644 index 43bf0027de8e8..0000000000000 Binary files a/win32/build/php.ico and /dev/null differ diff --git a/win32/build/registersyslog.php b/win32/build/registersyslog.php deleted file mode 100755 index db5f459f735f1..0000000000000 --- a/win32/build/registersyslog.php +++ /dev/null @@ -1,45 +0,0 @@ - diff --git a/win32/build/template.rc b/win32/build/template.rc deleted file mode 100644 index 9f490c0d6675d..0000000000000 --- a/win32/build/template.rc +++ /dev/null @@ -1,69 +0,0 @@ -/* This is a template RC file. - * $Id$ - * Do not edit with MSVC */ -#ifdef APSTUDIO_INVOKED -# error dont edit with MSVC -#endif - -#include "winresrc.h" -#include "main/php_version.h" - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -#ifndef THANKS_GUYS -# define THANKS_GUYS "" -#endif - -#ifdef WANT_LOGO -0 ICON win32\build\php.ico -#endif - -#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build -#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel -#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build) -#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel) - -//Version -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", THANKS_GUYS "\0" - VALUE "CompanyName", "The PHP Group\0" - VALUE "FileDescription", FILE_DESCRIPTION "\0" - VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION) - VALUE "InternalName", FILE_NAME "\0" - VALUE "LegalCopyright", "Copyright © 1997-2007 The PHP Group\0" - VALUE "LegalTrademarks", "PHP\0" - VALUE "OriginalFilename", FILE_NAME "\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", PRODUCT_NAME "\0" - VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) - VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0" - VALUE "URL", "http://www.php.net" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#ifdef MC_INCLUDE -#include MC_INCLUDE -#endif - diff --git a/win32/build/wsyslog.mc b/win32/build/wsyslog.mc deleted file mode 100755 index 01d4d3a86bfde..0000000000000 --- a/win32/build/wsyslog.mc +++ /dev/null @@ -1,28 +0,0 @@ -MessageId=1 -Severity=Success -SymbolicName=PHP_SYSLOG_SUCCESS_TYPE -Language=English -%1 %2 -. - -MessageId=2 -Severity=Informational -SymbolicName=PHP_SYSLOG_INFO_TYPE -Language=English -%1 %2 -. - -MessageId=3 -Severity=Warning -SymbolicName=PHP_SYSLOG_WARNING_TYPE -Language=English -%1 %2 -. - -MessageId=4 -Severity=Error -SymbolicName=PHP_SYSLOG_ERROR_TYPE -Language=English -%1 %2 -. - diff --git a/win32/builddef.bat b/win32/builddef.bat deleted file mode 100644 index f204812ace0e8..0000000000000 --- a/win32/builddef.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -rem Generate phpts.def file, which exports symbols from our dll that -rem are present in some of the libraries which are compiled statically -rem into PHP -rem $Id: builddef.bat,v 1.4 2003-12-08 12:56:47 rrichards Exp $ -type ..\ext\sqlite\php_sqlite.def -type ..\ext\libxml\php_libxml2.def diff --git a/win32/crypt_win32.c b/win32/crypt_win32.c deleted file mode 100644 index 1e5d2e4223c10..0000000000000 --- a/win32/crypt_win32.c +++ /dev/null @@ -1,562 +0,0 @@ -/* - * UFC-crypt: ultra fast crypt(3) implementation - * - * Copyright (C) 1991, Michael Glad, email: glad@daimi.aau.dk - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * @(#)crypt.c 2.2 10/04/91 - * - * Semiportable C version - * - */ - -#include - -#define bzero(addr, cnt) memset(addr, 0, cnt) -#define bcopy(from, to, len) memcpy(to, from, len) - -/* Permutation done once on the 56 bit - key derived from the original 8 byte ASCII key. -*/ -static unsigned long pc1[56] = - { 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, - 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, - 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, - 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4 - }; - -/* How much to rotate each 28 bit half of the pc1 permutated - 56 bit key before using pc2 to give the i' key -*/ -static unsigned long totrot[16] = - { 1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28 }; - -/* Permutation giving the key of the i' DES round */ -static unsigned long pc2[48] = - { 14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, - 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, - 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, - 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32 - }; - -/* Reference copy of the expansion table which selects - bits from the 32 bit intermediate result. -*/ -static unsigned long eref[48] = - { 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, - 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, - 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, - 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1 - }; -static unsigned long disturbed_e[48]; -static unsigned long e_inverse[64]; - -/* Permutation done on the result of sbox lookups */ -static unsigned long perm32[32] = - { 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, - 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25 - }; - -/* The sboxes */ -static unsigned long sbox[8][4][16]= - { { { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 }, - { 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8 }, - { 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0 }, - { 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 } - }, - - { { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 }, - { 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5 }, - { 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15 }, - { 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 } - }, - - { { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 }, - { 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1 }, - { 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7 }, - { 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 } - }, - - { { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 }, - { 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9 }, - { 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4 }, - { 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 } - }, - - { { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9 }, - { 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6 }, - { 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14 }, - { 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 } - }, - - { { 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11 }, - { 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8 }, - { 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6 }, - { 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 } - }, - - { { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1 }, - { 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6 }, - { 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2 }, - { 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 } - }, - - { { 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7 }, - { 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2 }, - { 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8 }, - { 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 } - } - }; - -#ifdef notdef - -/* This is the initial permutation matrix -- we have no - use for it, but it is needed if you will develop - this module into a general DES package. -*/ -static unsigned char inital_perm[64] = - { 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, - 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, - 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, - 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7 - }; - -#endif - -/* Final permutation matrix -- not used directly */ -static unsigned char final_perm[64] = - { 40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, - 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, - 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27, - 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25 - }; - -/* The 16 DES keys in BITMASK format */ -unsigned long keytab[16][2]; - -#define ascii_to_bin(c) ((c)>='a'?(c-59):(c)>='A'?((c)-53):(c)-'.') -#define bin_to_ascii(c) ((c)>=38?((c)-38+'a'):(c)>=12?((c)-12+'A'):(c)+'.') - -/* Macro to set a bit (0..23) */ -#define BITMASK(i) ( (1<<(11-(i)%12+3)) << ((i)<12?16:0) ) - -/* sb arrays: - - Workhorses of the inner loop of the DES implementation. - They do sbox lookup, shifting of this value, 32 bit - permutation and E permutation for the next round. - - Kept in 'BITMASK' format. - -*/ - -unsigned long sb0[8192],sb1[8192],sb2[8192],sb3[8192]; -static unsigned long *sb[4] = {sb0,sb1,sb2,sb3}; - -/* eperm32tab: do 32 bit permutation and E selection - - The first index is the byte number in the 32 bit value to be permuted - - second - is the value of this byte - - third - selects the two 32 bit values - - The table is used and generated internally in init_des to speed it up - -*/ -static unsigned long eperm32tab[4][256][2]; - -/* mk_keytab_table: fast way of generating keytab from ASCII key - - The first index is the byte number in the 8 byte ASCII key - - second - - - current DES round i.e. the key number - - third - distinguishes between the two 24 bit halfs of - the selected key - - fourth - selects the 7 bits actually used of each byte - - The table is kept in the format generated by the BITMASK macro - -*/ -static unsigned long mk_keytab_table[8][16][2][128]; - - -/* efp: undo an extra e selection and do final - permutation giving the DES result. - - Invoked 6 bit a time on two 48 bit values - giving two 32 bit longs. -*/ -static unsigned long efp[16][64][2]; - - -static unsigned char bytemask[8] = - { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; - - -static unsigned long longmask[32] = - { 0x80000000, 0x40000000, 0x20000000, 0x10000000, - 0x08000000, 0x04000000, 0x02000000, 0x01000000, - 0x00800000, 0x00400000, 0x00200000, 0x00100000, - 0x00080000, 0x00040000, 0x00020000, 0x00010000, - 0x00008000, 0x00004000, 0x00002000, 0x00001000, - 0x00000800, 0x00000400, 0x00000200, 0x00000100, - 0x00000080, 0x00000040, 0x00000020, 0x00000010, - 0x00000008, 0x00000004, 0x00000002, 0x00000001 - }; - -static unsigned long initialized = 0; - -/* lookup a 6 bit value in sbox */ - -#define s_lookup(i,s) sbox[(i)][(((s)>>4) & 0x2)|((s) & 0x1)][((s)>>1) & 0xf]; - -/* Generate the mk_keytab_table once in a program execution */ - -void init_des() - { unsigned long tbl_long,bit_within_long,comes_from_bit; - unsigned long bit,sg,j; - unsigned long bit_within_byte,key_byte,byte_value; - unsigned long round,mask; - - bzero((char*)mk_keytab_table,sizeof mk_keytab_table); - - for(round=0; round<16; round++) - for(bit=0; bit<48; bit++) - { tbl_long = bit / 24; - bit_within_long = bit % 24; - - /* from which bit in the key halves does it origin? */ - comes_from_bit = pc2[bit] - 1; - - /* undo the rotation done before pc2 */ - if(comes_from_bit>=28) - comes_from_bit = 28 + (comes_from_bit + totrot[round]) % 28; - else - comes_from_bit = (comes_from_bit + totrot[round]) % 28; - - /* undo the initial key half forming permutation */ - comes_from_bit = pc1[comes_from_bit] - 1; - - /* Now 'comes_from_bit' is the correct number (0..55) - of the keybit from which the bit being traced - in key 'round' comes from - */ - - key_byte = comes_from_bit / 8; - bit_within_byte = (comes_from_bit % 8)+1; - - mask = bytemask[bit_within_byte]; - - for(byte_value=0; byte_value<128; byte_value++) - if(byte_value & mask) - mk_keytab_table[key_byte][round][tbl_long][byte_value] |= - BITMASK(bit_within_long); - } - - /* Now generate the table used to do an combined - 32 bit permutation and e expansion - - We use it because we have to permute 16384 32 bit - longs into 48 bit in order to initialize sb. - - Looping 48 rounds per permutation becomes - just too slow... - - */ - - bzero((char*)eperm32tab,sizeof eperm32tab); - for(bit=0; bit<48; bit++) - { unsigned long mask1,comes_from; - - comes_from = perm32[eref[bit]-1]-1; - mask1 = bytemask[comes_from % 8]; - - for(j=256; j--;) - if(j & mask1) - eperm32tab[comes_from/8][j][bit/24] |= BITMASK(bit % 24); - } - - /* Create the sb tables: - - For each 12 bit segment of an 48 bit intermediate - result, the sb table precomputes the two 4 bit - values of the sbox lookups done with the two 6 - bit halves, shifts them to their proper place, - sends them through perm32 and finally E expands - them so that they are ready for the next - DES round. - - The value looked up is to be xored onto the - two 48 bit right halves. - */ - - for(sg=0; sg<4; sg++) - { unsigned long j1,j2; - unsigned long s1,s2; - - for(j1=0; j1<64; j1++) - { s1 = s_lookup(2*sg,j1); - for(j2=0; j2<64; j2++) - { unsigned long to_permute,inx; - - s2 = s_lookup(2*sg+1,j2); - to_permute = ((s1<<4) | s2) << (24-8*sg); - inx = ((j1<<6) | j2) << 1; - - sb[sg][inx ] = eperm32tab[0][(to_permute >> 24) & 0xff][0]; - sb[sg][inx+1] = eperm32tab[0][(to_permute >> 24) & 0xff][1]; - - sb[sg][inx ] |= eperm32tab[1][(to_permute >> 16) & 0xff][0]; - sb[sg][inx+1] |= eperm32tab[1][(to_permute >> 16) & 0xff][1]; - - sb[sg][inx ] |= eperm32tab[2][(to_permute >> 8) & 0xff][0]; - sb[sg][inx+1] |= eperm32tab[2][(to_permute >> 8) & 0xff][1]; - - sb[sg][inx ] |= eperm32tab[3][(to_permute) & 0xff][0]; - sb[sg][inx+1] |= eperm32tab[3][(to_permute) & 0xff][1]; - } - } - } - initialized++; - } - -/* Process the elements of the sb table permuting the - bits swapped in the expansion by the current salt. -*/ - -void shuffle_sb(k, saltbits) - unsigned long *k, saltbits; - { int j, x; - for(j=4096; j--;) { - x = (k[0] ^ k[1]) & saltbits; - *k++ ^= x; - *k++ ^= x; - } - } - -/* Setup the unit for a new salt - Hopefully we'll not see a new salt in each crypt call. -*/ - -static unsigned char current_salt[3]="&&"; /* invalid value */ -static unsigned long oldsaltbits = 0; - -void setup_salt(s) - char *s; - { unsigned long i,j,saltbits; - - if(!initialized) - init_des(); - - if(s[0]==current_salt[0] && s[1]==current_salt[1]) - return; - current_salt[0]=s[0]; current_salt[1]=s[1]; - - /* This is the only crypt change to DES: - entries are swapped in the expansion table - according to the bits set in the salt. - */ - - saltbits=0; - bcopy((char*)eref,(char*)disturbed_e,sizeof eref); - for(i=0; i<2; i++) - { long c=ascii_to_bin(s[i]); - if(c<0 || c>63) - c=0; - for(j=0; j<6; j++) - if((c>>j) & 0x1) - { disturbed_e[6*i+j ]=eref[6*i+j+24]; - disturbed_e[6*i+j+24]=eref[6*i+j ]; - saltbits |= BITMASK(6*i+j); - } - } - - /* Permute the sb table values - to reflect the changed e - selection table - */ - - shuffle_sb(sb0, oldsaltbits ^ saltbits); - shuffle_sb(sb1, oldsaltbits ^ saltbits); - shuffle_sb(sb2, oldsaltbits ^ saltbits); - shuffle_sb(sb3, oldsaltbits ^ saltbits); - - oldsaltbits = saltbits; - - /* Create an inverse matrix for disturbed_e telling - where to plug out bits if undoing disturbed_e - */ - - for(i=48; i--;) - { e_inverse[disturbed_e[i]-1 ] = i; - e_inverse[disturbed_e[i]-1+32] = i+48; - } - - /* create efp: the matrix used to - undo the E expansion and effect final permutation - */ - - bzero((char*)efp,sizeof efp); - for(i=0; i<64; i++) - { unsigned long o_bit,o_long; - unsigned long word_value,mask1,mask2,comes_from_f_bit,comes_from_e_bit; - unsigned long comes_from_word,bit_within_word; - - /* See where bit i belongs in the two 32 bit long's */ - o_long = i / 32; /* 0..1 */ - o_bit = i % 32; /* 0..31 */ - - /* And find a bit in the e permutated value setting this bit. - - Note: the e selection may have selected the same bit several - times. By the initialization of e_inverse, we only look - for one specific instance. - */ - comes_from_f_bit = final_perm[i]-1; /* 0..63 */ - comes_from_e_bit = e_inverse[comes_from_f_bit]; /* 0..95 */ - comes_from_word = comes_from_e_bit / 6; /* 0..15 */ - bit_within_word = comes_from_e_bit % 6; /* 0..5 */ - - mask1 = longmask[bit_within_word+26]; - mask2 = longmask[o_bit]; - - for(word_value=64; word_value--;) - if(word_value & mask1) - efp[comes_from_word][word_value][o_long] |= mask2; - - } - - } - -/* Generate the key table before running the 25 DES rounds */ - -void mk_keytab(key) - char *key; - { unsigned long i,j; - unsigned long *k,*mkt; - char t; - - bzero((char*)keytab, sizeof keytab); - mkt = &mk_keytab_table[0][0][0][0]; - - for(i=0; (t=(*key++) & 0x7f) && i<8; i++) - for(j=0,k = &keytab[0][0]; j<16; j++) - { *k++ |= mkt[t]; mkt += 128; - *k++ |= mkt[t]; mkt += 128; - } - for(; i<8; i++) - for(j=0,k = &keytab[0][0]; j<16; j++) - { *k++ |= mkt[0]; mkt += 128; - *k++ |= mkt[0]; mkt += 128; - } - } - -/* Do final permutations and convert to ASCII */ - -char *output_conversion(l1,l2,r1,r2,salt) - unsigned long l1,l2,r1,r2; - char *salt; - { static char outbuf[14]; - unsigned long i; - unsigned long s,v1,v2; - - /* Unfortunately we've done an extra E - expansion -- undo it at the same time. - */ - - v1=v2=0; l1 >>= 3; l2 >>= 3; r1 >>= 3; r2 >>= 3; - - v1 |= efp[ 3][ l1 & 0x3f][0]; v2 |= efp[ 3][ l1 & 0x3f][1]; - v1 |= efp[ 2][(l1>>=6) & 0x3f][0]; v2 |= efp[ 2][ l1 & 0x3f][1]; - v1 |= efp[ 1][(l1>>=10) & 0x3f][0]; v2 |= efp[ 1][ l1 & 0x3f][1]; - v1 |= efp[ 0][(l1>>=6) & 0x3f][0]; v2 |= efp[ 0][ l1 & 0x3f][1]; - - v1 |= efp[ 7][ l2 & 0x3f][0]; v2 |= efp[ 7][ l2 & 0x3f][1]; - v1 |= efp[ 6][(l2>>=6) & 0x3f][0]; v2 |= efp[ 6][ l2 & 0x3f][1]; - v1 |= efp[ 5][(l2>>=10) & 0x3f][0]; v2 |= efp[ 5][ l2 & 0x3f][1]; - v1 |= efp[ 4][(l2>>=6) & 0x3f][0]; v2 |= efp[ 4][ l2 & 0x3f][1]; - - v1 |= efp[11][ r1 & 0x3f][0]; v2 |= efp[11][ r1 & 0x3f][1]; - v1 |= efp[10][(r1>>=6) & 0x3f][0]; v2 |= efp[10][ r1 & 0x3f][1]; - v1 |= efp[ 9][(r1>>=10) & 0x3f][0]; v2 |= efp[ 9][ r1 & 0x3f][1]; - v1 |= efp[ 8][(r1>>=6) & 0x3f][0]; v2 |= efp[ 8][ r1 & 0x3f][1]; - - v1 |= efp[15][ r2 & 0x3f][0]; v2 |= efp[15][ r2 & 0x3f][1]; - v1 |= efp[14][(r2>>=6) & 0x3f][0]; v2 |= efp[14][ r2 & 0x3f][1]; - v1 |= efp[13][(r2>>=10) & 0x3f][0]; v2 |= efp[13][ r2 & 0x3f][1]; - v1 |= efp[12][(r2>>=6) & 0x3f][0]; v2 |= efp[12][ r2 & 0x3f][1]; - - outbuf[0] = salt[0]; - outbuf[1] = salt[1] ? salt[1] : salt[0]; - - for(i=0; i<5; i++) - outbuf[i+2] = bin_to_ascii((v1>>(26-6*i)) & 0x3f); - - s = (v2 & 0xf) << 2; /* Save the rightmost 4 bit a moment */ - v2 = (v2>>2) | ((v1 & 0x3)<<30); /* Shift two bits of v1 onto v2 */ - - for(i=5; i<10; i++) - outbuf[i+2] = bin_to_ascii((v2>>(56-6*i)) & 0x3f); - - outbuf[12] = bin_to_ascii(s); - outbuf[13] = 0; - - return outbuf; - } - -#define SBA(sb, v) (*(unsigned long*)((char*)(sb)+(v))) - -#define F(I, O1, O2, SBX, SBY) \ - s = *k++ ^ I; \ - O1 ^= SBA(SBX, (s & 0xffff)); O2 ^= SBA(SBX, ((s & 0xffff) + 4)); \ - O1 ^= SBA(SBY, (s >>= 16)); O2 ^= SBA(SBY, ((s) + 4)); - -#define G(I1, I2, O1, O2) \ - F(I1, O1, O2, sb1, sb0) F(I2, O1, O2, sb3, sb2) - -#define H G(r1, r2, l1, l2) ; G(l1, l2, r1, r2) - -char *des_crypt(key, salt) - char *key; - char *salt; - { unsigned long l1, l2, r1, r2, i, j, s, *k; - - setup_salt(salt); - mk_keytab(key); - - l1=l2=r1=r2=0; - - for(j=0; j<25; j++) { - k = &keytab[0][0]; - for(i=8; i--; ) { - H; - } - s=l1; l1=r1; r1=s; s=l2; l2=r2; r2=s; - } - - return output_conversion(l1, l2, r1, r2, salt); - } - -#include "php.h" -#include "md5crypt.h" - -PHPAPI char * -crypt (const char *pw, const char *salt) -{ - if (strlen(salt)>MD5_MAGIC_LEN && strncmp(salt, MD5_MAGIC, MD5_MAGIC_LEN)==0) { - return md5_crypt(pw, salt); - } else { - return des_crypt(pw, salt); - } -} diff --git a/win32/crypt_win32.h b/win32/crypt_win32.h deleted file mode 100644 index 26ea53a79a01c..0000000000000 --- a/win32/crypt_win32.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ - */ - -#ifndef _CRYPT_WIHN32_H_ -#define _CRYPT_WIHN32_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -PHPAPI char* crypt(const char *key, const char *salt); - -#ifdef __cplusplus -} -#endif - -#endif /* _CRYPT_WIHN32_H_ */ diff --git a/win32/flock.c b/win32/flock.c deleted file mode 100644 index e659de6597667..0000000000000 --- a/win32/flock.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Program: Unix compatibility routines - * - * Author: Mark Crispin - * Networks and Distributed Computing - * Computing & Communications - * University of Washington - * Administration Building, AG-44 - * Seattle, WA 98195 - * Internet: MRC@CAC.Washington.EDU - * - * Date: 14 September 1996 - * Last Edited: 14 August 1997 - * - * Copyright 1997 by the University of Washington - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appears in all copies and that both the - * above copyright notice and this permission notice appear in supporting - * documentation, and that the name of the University of Washington not be - * used in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. This software is made available - * "as is", and - * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, - * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN - * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT - * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - - -/* DEDICATION - - * This file is dedicated to my dog, Unix, also known as Yun-chan and - * Unix J. Terwilliker Jehosophat Aloysius Monstrosity Animal Beast. Unix - * passed away at the age of 11 1/2 on September 14, 1996, 12:18 PM PDT, after - * a two-month bout with cirrhosis of the liver. - * - * He was a dear friend, and I miss him terribly. - * - * Lift a leg, Yunie. Luv ya forever!!!! - */ - -#include "php.h" -#include -#include -#include -#include "flock.h" - -PHPAPI int flock(int fd, int op) -{ - HANDLE hdl = (HANDLE) _get_osfhandle(fd); - DWORD low = 1, high = 0; - OVERLAPPED offset = - {0, 0, 0, 0, NULL}; - if (hdl < 0) - return -1; /* error in file descriptor */ - /* bug for bug compatible with Unix */ - UnlockFileEx(hdl, 0, low, high, &offset); - switch (op & ~LOCK_NB) { /* translate to LockFileEx() op */ - case LOCK_EX: /* exclusive */ - if (LockFileEx(hdl, LOCKFILE_EXCLUSIVE_LOCK + - ((op & LOCK_NB) ? LOCKFILE_FAIL_IMMEDIATELY : 0), - 0, low, high, &offset)) - return 0; - break; - case LOCK_SH: /* shared */ - if (LockFileEx(hdl, ((op & LOCK_NB) ? LOCKFILE_FAIL_IMMEDIATELY : 0), - 0, low, high, &offset)) - return 0; - break; - case LOCK_UN: /* unlock */ - return 0; /* always succeeds */ - default: /* default */ - break; - } - errno = EINVAL; /* bad call */ - return -1; -} diff --git a/win32/flock.h b/win32/flock.h deleted file mode 100644 index d228e855dc2a9..0000000000000 --- a/win32/flock.h +++ /dev/null @@ -1,11 +0,0 @@ -#define fsync _commit -#define ftruncate chsize - -/* For flock() emulation */ - -#define LOCK_SH 1 -#define LOCK_EX 2 -#define LOCK_NB 4 -#define LOCK_UN 8 - -PHPAPI int flock(int fd, int op); diff --git a/win32/glob.c b/win32/glob.c deleted file mode 100644 index b369362c1914f..0000000000000 --- a/win32/glob.c +++ /dev/null @@ -1,926 +0,0 @@ -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Guido van Rossum. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* $Id$ */ - -/* - * glob(3) -- a superset of the one defined in POSIX 1003.2. - * - * The [!...] convention to negate a range is supported (SysV, Posix, ksh). - * - * Optional extra services, controlled by flags not defined by POSIX: - * - * GLOB_QUOTE: - * Escaping convention: \ inhibits any special meaning the following - * character might have (except \ at end of string is retained). - * GLOB_MAGCHAR: - * Set in gl_flags if pattern contained a globbing character. - * GLOB_NOMAGIC: - * Same as GLOB_NOCHECK, but it will only append pattern if it did - * not contain any magic characters. [Used in csh style globbing] - * GLOB_ALTDIRFUNC: - * Use alternately specified directory access functions. - * GLOB_TILDE: - * expand ~user/foo to the /home/dir/of/user/foo - * GLOB_BRACE: - * expand {1,2}{a,b} to 1a 1b 2a 2b - * gl_matchc: - * Number of matches in the current invocation of glob. - */ -#ifdef PHP_WIN32 -#define _POSIX_ -#include -#undef _POSIX_ -#ifndef S_ISDIR -#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR) -#endif -#ifndef S_ISLNK -#define S_ISLNK(m) (0) -#endif -#endif - -#include "php.h" -#include - -#include -#ifndef PHP_WIN32 -#include -#include -#include -#include -#endif -#include -#include "glob.h" -#include -#include -#include - -#define DOLLAR '$' -#define DOT '.' -#define EOS '\0' -#define LBRACKET '[' -#define NOT '!' -#define QUESTION '?' -#define QUOTE '\\' -#define RANGE '-' -#define RBRACKET ']' -#define SEP DEFAULT_SLASH -#define STAR '*' -#define TILDE '~' -#define UNDERSCORE '_' -#define LBRACE '{' -#define RBRACE '}' -#define SLASH '/' -#define COMMA ',' - -#ifndef DEBUG - -#define M_QUOTE 0x8000 -#define M_PROTECT 0x4000 -#define M_MASK 0xffff -#define M_ASCII 0x00ff - -typedef u_short Char; - -#else - -#define M_QUOTE 0x80 -#define M_PROTECT 0x40 -#define M_MASK 0xff -#define M_ASCII 0x7f - -typedef char Char; - -#endif - - -#define CHAR(c) ((Char)((c)&M_ASCII)) -#define META(c) ((Char)((c)|M_QUOTE)) -#define M_ALL META('*') -#define M_END META(']') -#define M_NOT META('!') -#define M_ONE META('?') -#define M_RNG META('-') -#define M_SET META('[') -#define ismeta(c) (((c)&M_QUOTE) != 0) - -static int compare(const void *, const void *); -static int g_Ctoc(const Char *, char *, u_int); -static int g_lstat(Char *, struct stat *, glob_t *); -static DIR *g_opendir(Char *, glob_t *); -static Char *g_strchr(Char *, int); -static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *); -static int glob1(Char *, Char *, glob_t *, size_t *); -static int glob2(Char *, Char *, Char *, Char *, Char *, Char *, - glob_t *, size_t *); -static int glob3(Char *, Char *, Char *, Char *, Char *, Char *, - Char *, Char *, glob_t *, size_t *); -static int globextend(const Char *, glob_t *, size_t *); -static const Char * - globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const Char *, glob_t *); -static int globexp2(const Char *, const Char *, glob_t *, int *); -static int match(Char *, Char *, Char *); -#ifdef DEBUG -static void qprintf(const char *, Char *); -#endif - -int -glob(pattern, flags, errfunc, pglob) - const char *pattern; - int flags, (*errfunc)(const char *, int); - glob_t *pglob; -{ - const u_char *patnext; - int c; - Char *bufnext, *bufend, patbuf[MAXPATHLEN]; - -#ifdef PHP_WIN32 - /* Force skipping escape sequences on windows - * due to the ambiguity with path backslashes - */ - flags |= GLOB_NOESCAPE; -#endif - - patnext = (u_char *) pattern; - if (!(flags & GLOB_APPEND)) { - pglob->gl_pathc = 0; - pglob->gl_pathv = NULL; - if (!(flags & GLOB_DOOFFS)) - pglob->gl_offs = 0; - } - pglob->gl_flags = flags & ~GLOB_MAGCHAR; - pglob->gl_errfunc = errfunc; - pglob->gl_matchc = 0; - - bufnext = patbuf; - bufend = bufnext + MAXPATHLEN - 1; - if (flags & GLOB_NOESCAPE) - while (bufnext < bufend && (c = *patnext++) != EOS) - *bufnext++ = c; - else { - /* Protect the quoted characters. */ - while (bufnext < bufend && (c = *patnext++) != EOS) - if (c == QUOTE) { - if ((c = *patnext++) == EOS) { - c = QUOTE; - --patnext; - } - *bufnext++ = c | M_PROTECT; - } else - *bufnext++ = c; - } - *bufnext = EOS; - - if (flags & GLOB_BRACE) - return globexp1(patbuf, pglob); - else - return glob0(patbuf, pglob); -} - -/* - * Expand recursively a glob {} pattern. When there is no more expansion - * invoke the standard globbing routine to glob the rest of the magic - * characters - */ -static int -globexp1(pattern, pglob) - const Char *pattern; - glob_t *pglob; -{ - const Char* ptr = pattern; - int rv; - - /* Protect a single {}, for find(1), like csh */ - if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) - return glob0(pattern, pglob); - - while ((ptr = (const Char *) g_strchr((Char *) ptr, LBRACE)) != NULL) - if (!globexp2(ptr, pattern, pglob, &rv)) - return rv; - - return glob0(pattern, pglob); -} - - -/* - * Recursive brace globbing helper. Tries to expand a single brace. - * If it succeeds then it invokes globexp1 with the new pattern. - * If it fails then it tries to glob the rest of the pattern and returns. - */ -static int -globexp2(ptr, pattern, pglob, rv) - const Char *ptr, *pattern; - glob_t *pglob; - int *rv; -{ - int i; - Char *lm, *ls; - const Char *pe, *pm, *pl; - Char patbuf[MAXPATHLEN]; - - /* copy part up to the brace */ - for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++) - ; - *lm = EOS; - ls = lm; - - /* Find the balanced brace */ - for (i = 0, pe = ++ptr; *pe; pe++) - if (*pe == LBRACKET) { - /* Ignore everything between [] */ - for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++) - ; - if (*pe == EOS) { - /* - * We could not find a matching RBRACKET. - * Ignore and just look for RBRACE - */ - pe = pm; - } - } else if (*pe == LBRACE) - i++; - else if (*pe == RBRACE) { - if (i == 0) - break; - i--; - } - - /* Non matching braces; just glob the pattern */ - if (i != 0 || *pe == EOS) { - *rv = glob0(patbuf, pglob); - return 0; - } - - for (i = 0, pl = pm = ptr; pm <= pe; pm++) { - switch (*pm) { - case LBRACKET: - /* Ignore everything between [] */ - for (pl = pm++; *pm != RBRACKET && *pm != EOS; pm++) - ; - if (*pm == EOS) { - /* - * We could not find a matching RBRACKET. - * Ignore and just look for RBRACE - */ - pm = pl; - } - break; - - case LBRACE: - i++; - break; - - case RBRACE: - if (i) { - i--; - break; - } - /* FALLTHROUGH */ - case COMMA: - if (i && *pm == COMMA) - break; - else { - /* Append the current string */ - for (lm = ls; (pl < pm); *lm++ = *pl++) - ; - - /* - * Append the rest of the pattern after the - * closing brace - */ - for (pl = pe + 1; (*lm++ = *pl++) != EOS; ) - ; - - /* Expand the current pattern */ -#ifdef DEBUG - qprintf("globexp2:", patbuf); -#endif - *rv = globexp1(patbuf, pglob); - - /* move after the comma, to the next string */ - pl = pm + 1; - } - break; - - default: - break; - } - } - *rv = 0; - return 0; -} - - - -/* - * expand tilde from the passwd file. - */ -static const Char * -globtilde(pattern, patbuf, patbuf_len, pglob) - const Char *pattern; - Char *patbuf; - size_t patbuf_len; - glob_t *pglob; -{ -#ifndef PHP_WIN32 - struct passwd *pwd; -#endif - char *h; - const Char *p; - Char *b, *eb; - - if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE)) - return pattern; - - /* Copy up to the end of the string or / */ - eb = &patbuf[patbuf_len - 1]; - for (p = pattern + 1, h = (char *) patbuf; - h < (char *)eb && *p && *p != SLASH; *h++ = (char) *p++) - ; - - *h = EOS; - -#if 0 - if (h == (char *)eb) - return what; -#endif - - if (((char *) patbuf)[0] == EOS) { - /* - * handle a plain ~ or ~/ by expanding $HOME - * first and then trying the password file - */ - if ((h = getenv("HOME")) == NULL) { -#ifndef PHP_WIN32 - if ((pwd = getpwuid(getuid())) == NULL) - return pattern; - else - h = pwd->pw_dir; -#else - return pattern; -#endif - } - } else { - /* - * Expand a ~user - */ -#ifndef PHP_WIN32 - if ((pwd = getpwnam((char*) patbuf)) == NULL) - return pattern; - else - h = pwd->pw_dir; -#else - return pattern; -#endif - } - - /* Copy the home directory */ - for (b = patbuf; b < eb && *h; *b++ = *h++) - ; - - /* Append the rest of the pattern */ - while (b < eb && (*b++ = *p++) != EOS) - ; - *b = EOS; - - return patbuf; -} - - -/* - * The main glob() routine: compiles the pattern (optionally processing - * quotes), calls glob1() to do the real pattern matching, and finally - * sorts the list (unless unsorted operation is requested). Returns 0 - * if things went well, nonzero if errors occurred. It is not an error - * to find no matches. - */ -static int -glob0(pattern, pglob) - const Char *pattern; - glob_t *pglob; -{ - const Char *qpatnext; - int c, err, oldpathc; - Char *bufnext, patbuf[MAXPATHLEN]; - size_t limit = 0; - - qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob); - oldpathc = pglob->gl_pathc; - bufnext = patbuf; - - /* We don't need to check for buffer overflow any more. */ - while ((c = *qpatnext++) != EOS) { - switch (c) { - case LBRACKET: - c = *qpatnext; - if (c == NOT) - ++qpatnext; - if (*qpatnext == EOS || - g_strchr((Char *) qpatnext+1, RBRACKET) == NULL) { - *bufnext++ = LBRACKET; - if (c == NOT) - --qpatnext; - break; - } - *bufnext++ = M_SET; - if (c == NOT) - *bufnext++ = M_NOT; - c = *qpatnext++; - do { - *bufnext++ = CHAR(c); - if (*qpatnext == RANGE && - (c = qpatnext[1]) != RBRACKET) { - *bufnext++ = M_RNG; - *bufnext++ = CHAR(c); - qpatnext += 2; - } - } while ((c = *qpatnext++) != RBRACKET); - pglob->gl_flags |= GLOB_MAGCHAR; - *bufnext++ = M_END; - break; - case QUESTION: - pglob->gl_flags |= GLOB_MAGCHAR; - *bufnext++ = M_ONE; - break; - case STAR: - pglob->gl_flags |= GLOB_MAGCHAR; - /* collapse adjacent stars to one, - * to avoid exponential behavior - */ - if (bufnext == patbuf || bufnext[-1] != M_ALL) - *bufnext++ = M_ALL; - break; - default: - *bufnext++ = CHAR(c); - break; - } - } - *bufnext = EOS; -#ifdef DEBUG - qprintf("glob0:", patbuf); -#endif - - if ((err = glob1(patbuf, patbuf+MAXPATHLEN-1, pglob, &limit)) != 0) - return(err); - - /* - * If there was no match we are going to append the pattern - * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified - * and the pattern did not contain any magic characters - * GLOB_NOMAGIC is there just for compatibility with csh. - */ - if (pglob->gl_pathc == oldpathc) { - if ((pglob->gl_flags & GLOB_NOCHECK) || - ((pglob->gl_flags & GLOB_NOMAGIC) && - !(pglob->gl_flags & GLOB_MAGCHAR))) - return(globextend(pattern, pglob, &limit)); - else - return(GLOB_NOMATCH); - } - if (!(pglob->gl_flags & GLOB_NOSORT)) - qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, - pglob->gl_pathc - oldpathc, sizeof(char *), (const void *) compare); - return(0); -} - -static int -compare(p, q) - const void *p, *q; -{ - return(strcmp(*(char **)p, *(char **)q)); -} - -static int -glob1(pattern, pattern_last, pglob, limitp) - Char *pattern, *pattern_last; - glob_t *pglob; - size_t *limitp; -{ - Char pathbuf[MAXPATHLEN]; - - /* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */ - if (*pattern == EOS) - return(0); - return(glob2(pathbuf, pathbuf+MAXPATHLEN-1, - pathbuf, pathbuf+MAXPATHLEN-1, - pattern, pattern_last, pglob, limitp)); -} - -/* - * The functions glob2 and glob3 are mutually recursive; there is one level - * of recursion for each segment in the pattern that contains one or more - * meta characters. - */ -static int -glob2(pathbuf, pathbuf_last, pathend, pathend_last, pattern, - pattern_last, pglob, limitp) - Char *pathbuf, *pathbuf_last, *pathend, *pathend_last; - Char *pattern, *pattern_last; - glob_t *pglob; - size_t *limitp; -{ - struct stat sb; - Char *p, *q; - int anymeta; - - /* - * Loop over pattern segments until end of pattern or until - * segment with meta character found. - */ - for (anymeta = 0;;) { - if (*pattern == EOS) { /* End of pattern? */ - *pathend = EOS; - if (g_lstat(pathbuf, &sb, pglob)) - return(0); - - if (((pglob->gl_flags & GLOB_MARK) && - !IS_SLASH(pathend[-1])) && (S_ISDIR(sb.st_mode) || - (S_ISLNK(sb.st_mode) && - (g_stat(pathbuf, &sb, pglob) == 0) && - S_ISDIR(sb.st_mode)))) { - if (pathend+1 > pathend_last) - return (1); - *pathend++ = SEP; - *pathend = EOS; - } - ++pglob->gl_matchc; - return(globextend(pathbuf, pglob, limitp)); - } - - /* Find end of next segment, copy tentatively to pathend. */ - q = pathend; - p = pattern; - while (*p != EOS && !IS_SLASH(*p)) { - if (ismeta(*p)) - anymeta = 1; - if (q+1 > pathend_last) - return (1); - *q++ = *p++; - } - - if (!anymeta) { /* No expansion, do next segment. */ - pathend = q; - pattern = p; - while (IS_SLASH(*pattern)) { - if (pathend+1 > pathend_last) - return (1); - *pathend++ = *pattern++; - } - } else - /* Need expansion, recurse. */ - return(glob3(pathbuf, pathbuf_last, pathend, - pathend_last, pattern, pattern_last, - p, pattern_last, pglob, limitp)); - } - /* NOTREACHED */ -} - -static int -glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last, - restpattern, restpattern_last, pglob, limitp) - Char *pathbuf, *pathbuf_last, *pathend, *pathend_last; - Char *pattern, *pattern_last, *restpattern, *restpattern_last; - glob_t *pglob; - size_t *limitp; -{ - register struct dirent *dp; - DIR *dirp; - int err; - char buf[MAXPATHLEN]; - - /* - * The readdirfunc declaration can't be prototyped, because it is - * assigned, below, to two functions which are prototyped in glob.h - * and dirent.h as taking pointers to differently typed opaque - * structures. - */ - struct dirent *(*readdirfunc)(); - - if (pathend > pathend_last) - return (1); - *pathend = EOS; - errno = 0; - - if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { - /* TODO: don't call for ENOENT or ENOTDIR? */ - if (pglob->gl_errfunc) { - if (g_Ctoc(pathbuf, buf, sizeof(buf))) - return(GLOB_ABORTED); - if (pglob->gl_errfunc(buf, errno) || - pglob->gl_flags & GLOB_ERR) - return(GLOB_ABORTED); - } - return(0); - } - - err = 0; - - /* Search directory for matching names. */ - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - readdirfunc = pglob->gl_readdir; - else - readdirfunc = readdir; - while ((dp = (*readdirfunc)(dirp))) { - register u_char *sc; - register Char *dc; - - /* Initial DOT must be matched literally. */ - if (dp->d_name[0] == DOT && *pattern != DOT) - continue; - dc = pathend; - sc = (u_char *) dp->d_name; - while (dc < pathend_last && (*dc++ = *sc++) != EOS) - ; - if (dc >= pathend_last) { - *dc = EOS; - err = 1; - break; - } - - if (!match(pathend, pattern, restpattern)) { - *pathend = EOS; - continue; - } - err = glob2(pathbuf, pathbuf_last, --dc, pathend_last, - restpattern, restpattern_last, pglob, limitp); - if (err) - break; - } - - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - (*pglob->gl_closedir)(dirp); - else - closedir(dirp); - return(err); -} - - -/* - * Extend the gl_pathv member of a glob_t structure to accomodate a new item, - * add the new item, and update gl_pathc. - * - * This assumes the BSD realloc, which only copies the block when its size - * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic - * behavior. - * - * Return 0 if new item added, error code if memory couldn't be allocated. - * - * Invariant of the glob_t structure: - * Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and - * gl_pathv points to (gl_offs + gl_pathc + 1) items. - */ -static int -globextend(path, pglob, limitp) - const Char *path; - glob_t *pglob; - size_t *limitp; -{ - register char **pathv; - register int i; - u_int newsize, len; - char *copy; - const Char *p; - - newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); - if (pathv == NULL) { - if (pglob->gl_pathv) { - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } - return(GLOB_NOSPACE); - } - - if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { - /* first time around -- clear initial gl_offs items */ - pathv += pglob->gl_offs; - for (i = pglob->gl_offs; --i >= 0; ) - *--pathv = NULL; - } - pglob->gl_pathv = pathv; - - for (p = path; *p++;) - ; - len = (size_t)(p - path); - *limitp += len; - if ((copy = malloc(len)) != NULL) { - if (g_Ctoc(path, copy, len)) { - free(copy); - return(GLOB_NOSPACE); - } - pathv[pglob->gl_offs + pglob->gl_pathc++] = copy; - } - pathv[pglob->gl_offs + pglob->gl_pathc] = NULL; - - if ((pglob->gl_flags & GLOB_LIMIT) && - newsize + *limitp >= ARG_MAX) { - errno = 0; - return(GLOB_NOSPACE); - } - - return(copy == NULL ? GLOB_NOSPACE : 0); -} - - -/* - * pattern matching function for filenames. Each occurrence of the * - * pattern causes a recursion level. - */ -static int -match(name, pat, patend) - register Char *name, *pat, *patend; -{ - int ok, negate_range; - Char c, k; - - while (pat < patend) { - c = *pat++; - switch (c & M_MASK) { - case M_ALL: - if (pat == patend) - return(1); - do - if (match(name, pat, patend)) - return(1); - while (*name++ != EOS) - ; - return(0); - case M_ONE: - if (*name++ == EOS) - return(0); - break; - case M_SET: - ok = 0; - if ((k = *name++) == EOS) - return(0); - if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS) - ++pat; - while (((c = *pat++) & M_MASK) != M_END) - if ((*pat & M_MASK) == M_RNG) { - if (c <= k && k <= pat[1]) - ok = 1; - pat += 2; - } else if (c == k) - ok = 1; - if (ok == negate_range) - return(0); - break; - default: - if (*name++ != c) - return(0); - break; - } - } - return(*name == EOS); -} - -/* Free allocated data belonging to a glob_t structure. */ -void -globfree(pglob) - glob_t *pglob; -{ - register int i; - register char **pp; - - if (pglob->gl_pathv != NULL) { - pp = pglob->gl_pathv + pglob->gl_offs; - for (i = pglob->gl_pathc; i--; ++pp) - if (*pp) - free(*pp); - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } -} - -static DIR * -g_opendir(str, pglob) - register Char *str; - glob_t *pglob; -{ - char buf[MAXPATHLEN]; - - if (!*str) - strlcpy(buf, ".", sizeof buf); - else { - if (g_Ctoc(str, buf, sizeof(buf))) - return(NULL); - } - - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - return((*pglob->gl_opendir)(buf)); - - return(opendir(buf)); -} - -static int -g_lstat(fn, sb, pglob) - register Char *fn; - struct stat *sb; - glob_t *pglob; -{ - char buf[MAXPATHLEN]; - - if (g_Ctoc(fn, buf, sizeof(buf))) - return(-1); - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - return((*pglob->gl_lstat)(buf, sb)); - return(lstat(buf, sb)); -} - -static int -g_stat(fn, sb, pglob) - register Char *fn; - struct stat *sb; - glob_t *pglob; -{ - char buf[MAXPATHLEN]; - - if (g_Ctoc(fn, buf, sizeof(buf))) - return(-1); - if (pglob->gl_flags & GLOB_ALTDIRFUNC) - return((*pglob->gl_stat)(buf, sb)); - return(stat(buf, sb)); -} - -static Char * -g_strchr(str, ch) - Char *str; - int ch; -{ - do { - if (*str == ch) - return (str); - } while (*str++); - return (NULL); -} - -static int -g_Ctoc(str, buf, len) - register const Char *str; - char *buf; - u_int len; -{ - - while (len--) { - if ((*buf++ = (char) *str++) == EOS) - return (0); - } - return (1); -} - -#ifdef DEBUG -static void -qprintf(str, s) - const char *str; - register Char *s; -{ - register Char *p; - - (void)printf("%s:\n", str); - for (p = s; *p; p++) - (void)printf("%c", CHAR(*p)); - (void)printf("\n"); - for (p = s; *p; p++) - (void)printf("%c", *p & M_PROTECT ? '"' : ' '); - (void)printf("\n"); - for (p = s; *p; p++) - (void)printf("%c", ismeta(*p) ? '_' : ' '); - (void)printf("\n"); -} -#endif diff --git a/win32/glob.h b/win32/glob.h deleted file mode 100644 index 4e842a5cee52d..0000000000000 --- a/win32/glob.h +++ /dev/null @@ -1,101 +0,0 @@ -/* $Id$ */ -/* OpenBSD: glob.h,v 1.7 2002/02/17 19:42:21 millert Exp */ -/* NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp */ - -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Guido van Rossum. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)glob.h 8.1 (Berkeley) 6/2/93 - */ - -#ifndef _GLOB_H_ -#define _GLOB_H_ - -#include - -struct stat; -typedef struct { - int gl_pathc; /* Count of total paths so far. */ - int gl_matchc; /* Count of paths matching pattern. */ - int gl_offs; /* Reserved at beginning of gl_pathv. */ - int gl_flags; /* Copy of flags parameter to glob. */ - char **gl_pathv; /* List of paths matching pattern. */ - /* Copy of errfunc parameter to glob. */ - int (*gl_errfunc)(const char *, int); - - /* - * Alternate filesystem access methods for glob; replacement - * versions of closedir(3), readdir(3), opendir(3), stat(2) - * and lstat(2). - */ - void (*gl_closedir)(void *); - struct dirent *(*gl_readdir)(void *); - void *(*gl_opendir)(const char *); - int (*gl_lstat)(const char *, struct stat *); - int (*gl_stat)(const char *, struct stat *); -} glob_t; - -/* Flags */ -#define GLOB_APPEND 0x0001 /* Append to output from previous call. */ -#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */ -#define GLOB_ERR 0x0004 /* Return on error. */ -#define GLOB_MARK 0x0008 /* Append / to matching directories. */ -#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */ -#define GLOB_NOSORT 0x0020 /* Don't sort. */ - -#ifndef _POSIX_SOURCE -#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ -#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ -#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ -#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ -#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ -#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ -#define GLOB_NOESCAPE 0x1000 /* Disable backslash escaping. */ -#define GLOB_LIMIT 0x2000 /* Limit pattern match output to ARG_MAX */ -#endif - -/* Error values returned by glob(3) */ -#define GLOB_NOSPACE (-1) /* Malloc call failed. */ -#define GLOB_ABORTED (-2) /* Unignored error. */ -#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK not set. */ -#define GLOB_NOSYS (-4) /* Function not supported. */ -#define GLOB_ABEND GLOB_ABORTED - -__BEGIN_DECLS -int glob(const char *, int, int (*)(const char *, int), glob_t *); -void globfree(glob_t *); -__END_DECLS - -#endif /* !_GLOB_H_ */ diff --git a/win32/globals.c b/win32/globals.c deleted file mode 100755 index dc3abfc96a250..0000000000000 --- a/win32/globals.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_win32_globals.h" -#include "syslog.h" - -#ifdef ZTS -PHPAPI int php_win32_core_globals_id; -#else -php_win32_core_globals the_php_win32_core_globals; -#endif - -void php_win32_core_globals_ctor(void *vg TSRMLS_DC) -{ - php_win32_core_globals *wg = (php_win32_core_globals*)vg; - memset(wg, 0, sizeof(*wg)); -} - -void php_win32_core_globals_dtor(void *vg TSRMLS_DC) -{ - php_win32_core_globals *wg = (php_win32_core_globals*)vg; - - if (wg->registry_key) { - RegCloseKey(wg->registry_key); - wg->registry_key = NULL; - } - if (wg->registry_event) { - CloseHandle(wg->registry_event); - wg->registry_event = NULL; - } - if (wg->registry_directories) { - zend_hash_destroy(wg->registry_directories); - free(wg->registry_directories); - wg->registry_directories = NULL; - } -} - - -PHP_RSHUTDOWN_FUNCTION(win32_core_globals) -{ - php_win32_core_globals *wg = -#ifdef ZTS - ts_resource(php_win32_core_globals_id) -#else - &the_php_win32_core_globals -#endif - ; - - closelog(); - wg->starttime.tv_sec = 0; - wg->lasttime = 0; - - return SUCCESS; -} - diff --git a/win32/grp.h b/win32/grp.h deleted file mode 100644 index 2a55b8222ae4a..0000000000000 --- a/win32/grp.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -struct group { - char *gr_name; - char *gr_passwd; - int gr_gid; - char **gr_mem; -}; diff --git a/win32/install.txt b/win32/install.txt deleted file mode 100644 index 198d7f7dc6ffa..0000000000000 --- a/win32/install.txt +++ /dev/null @@ -1,2176 +0,0 @@ -Installing PHP - __________________________________________________________________ - - Table of Contents - Preface - 1. General Installation Considerations - 2. Installation on Windows systems - - Windows Installer (PHP 5.2 and later) - Windows Installer (PHP 5.1.0 and earlier) - Manual Installation Steps - ActiveScript - Microsoft IIS / PWS - Apache 1.3.x on Microsoft Windows - Apache 2.0.x on Microsoft Windows - Sun, iPlanet and Netscape servers on Microsoft Windows - OmniHTTPd Server - Sambar Server on Microsoft Windows - Xitami on Microsoft Windows - Installation of extensions on Windows - - 3. Installation of PECL extensions - - Introduction to PECL Installations - Downloading PECL extensions - PECL for Windows users - Compiling shared PECL extensions with the pecl command - Compiling shared PECL extensions with phpize - Compiling PECL extensions statically into PHP - - 4. Problems? - - Read the FAQ - Other problems - Bug reports - - 5. Runtime Configuration - - The configuration file - How to change configuration settings - - 6. Installation FAQ - __________________________________________________________________ - -Preface - - These installation instructions were generated from the HTML version of - the PHP Manual so formatting and linking have been altered. See the - online and updated version at: http://php.net/install.windows - __________________________________________________________________ - -Chapter 1. General Installation Considerations - - Before starting the installation, first you need to know what do you - want to use PHP for. There are three main fields you can use PHP, as - described in the What can PHP do? section: - - * Websites and web applications (server-side scripting) - * Command line scripting - * Desktop (GUI) applications - - For the first and most common form, you need three things: PHP itself, - a web server and a web browser. You probably already have a web - browser, and depending on your operating system setup, you may also - have a web server (e.g. Apache on Linux and MacOS X; IIS on Windows). - You may also rent webspace at a company. This way, you don't need to - set up anything on your own, only write your PHP scripts, upload it to - the server you rent, and see the results in your browser. - - In case of setting up the server and PHP on your own, you have two - choices for the method of connecting PHP to the server. For many - servers PHP has a direct module interface (also called SAPI). These - servers include Apache, Microsoft Internet Information Server, Netscape - and iPlanet servers. Many other servers have support for ISAPI, the - Microsoft module interface (OmniHTTPd for example). If PHP has no - module support for your web server, you can always use it as a CGI or - FastCGI processor. This means you set up your server to use the CGI - executable of PHP to process all PHP file requests on the server. - - If you are also interested to use PHP for command line scripting (e.g. - write scripts autogenerating some images for you offline, or processing - text files depending on some arguments you pass to them), you always - need the command line executable. For more information, read the - section about writing command line PHP applications. In this case, you - need no server and no browser. - - With PHP you can also write desktop GUI applications using the PHP-GTK - extension. This is a completely different approach than writing web - pages, as you do not output any HTML, but manage Windows and objects - within them. For more information about PHP-GTK, please visit the site - dedicated to this extension. PHP-GTK is not included in the official - PHP distribution. - - From now on, this section deals with setting up PHP for web servers on - Unix and Windows with server module interfaces and CGI executables. You - will also find information on the command line executable in the - following sections. - - PHP source code and binary distributions for Windows can be found at - http://www.php.net/downloads.php. We recommend you to choose a mirror - nearest to you for downloading the distributions. - __________________________________________________________________ - -Chapter 2. Installation on Windows systems - - This section applies to Windows 98/Me and Windows NT/2000/XP/2003. PHP - will not work on 16 bit platforms such as Windows 3.1 and sometimes we - refer to the supported Windows platforms as Win32. Windows 95 is no - longer supported as of PHP 4.3.0. - - There are two main ways to install PHP for Windows: either manually or - by using the installer. - - If you have Microsoft Visual Studio, you can also build PHP from the - original source code. - - Once you have PHP installed on your Windows system, you may also want - to load various extensions for added functionality. - - Warning - - There are several all-in-one installers over the Internet, but none of - those are endorsed by PHP.net, as we believe that the manual - installation is the best choice to have your system secure and - optimised. - __________________________________________________________________ - -Windows Installer (PHP 5.2 and later) - - The Windows PHP installer for later versions of PHP is built using MSI - technology using the Wix Toolkit (http://wix.sourceforge.net/). It will - install and configure PHP and all the built-in and PECL extensions, as - well as configure many of the popular web servers such as IIS, Apache, - and Xitami. - - First, install your selected HTTP (web) server on your system, and make - sure that it works. Then proceed with one of the following install - types. - __________________________________________________________________ - -Normal Install - - Run the MSI installer and follow the instructions provided by the - installation wizard. You will be prompted to select the Web Server you - wish to configure first, along with any configuration details needed. - - You will then be prompted to select which features and extensions you - wish to install and enable. By selecting "Will be installed on local - hard drive" in the drop-down menu for each item you can trigger whether - to install the feature or not. By selecting "Entire feature will be - installed on local hard drive", you will be able to install all - sub-features of the included feature ( for example by selecting this - options for the feature "PDO" you will install all PDO Drivers ). - - Warning - - It is not recommended to install all extensions by default, since many - other them require dependencies from outside PHP in order to function - properly. Instead, use the Installation Repair Mode that can be - triggered thru the 'Add/Remove Programs' control panel to enable or - disable extensions and features after installation. - - The installer then sets up PHP to be used in Windows and the php.ini - file, and configures certain web servers to use PHP. The installer will - currently configure IIS (CGI mode only), Apache, Xitami, and Sambar - Server; if you are using a different web server you'll need to - configure it manually. - __________________________________________________________________ - -Silent Install - - The installer also supports a silent mode, which is helpful for Systems - Administrators to deploy PHP easily. To use silent mode: - msiexec.exe /i php-VERSION-win32-install.msi /q - - You can control the install directory by passing it as a parameter to - the install. For example, to install to e:\php: - msiexec.exe /i php-VERSION-win32-install.msi /q INSTALLDIR=e:\php - - You can also use the same syntax to specify the Apache Configuration - Directory (APACHEDIR), the Sambar Server directory (SAMBARDIR), and the - Xitami Server directory (XITAMIDIR). - - You can also specify what features to install. For example, to install - the mysqli extension and the CGI executable: - msiexec.exe /i php-VERSION-win32-install.msi /q ADDLOCAL=cgi,ext_php_mysqli - - The current list of Features to install is as follows: -MainExecutable - php.exe executable -ScriptExecutable - php-win.exe executable -ext_php_* - the various extensions ( for example: ext_php_mysql for MySQL ) -apache13 - Apache 1.3 module -apache20 - Apache 2.0 module -apache22 - Apache 2,2 module -apacheCGI - Apache CGI executable -iis4ISAPI - IIS ISAPI module -iis4CGI - IIS CGI executable -NSAPI - Sun/iPlanet/Netscape server module -Xitami - Xitami CGI executable -Sambar - Sambar Server ISAPI module -CGI - php-cgi.exe executable -PEAR - PEAR installer -Manual - PHP Manual in CHM Format - - For more information on installing MSI installers from the command - line, visit - http://msdn.microsoft.com/library/en-us/msi/setup/command_line_options. - asp - __________________________________________________________________ - -Windows Installer (PHP 5.1.0 and earlier) - - The Windows PHP installer is available from the downloads page at - http://www.php.net/downloads.php. This installs the CGI version of PHP - and for IIS, PWS, and Xitami, it configures the web server as well. The - installer does not include any extra external PHP extensions - (php_*.dll) as you'll only find those in the Windows Zip Package and - PECL downloads. - - Note: While the Windows installer is an easy way to make PHP work, - it is restricted in many aspects as, for example, the automatic - setup of extensions is not supported. Use of the installer isn't the - preferred method for installing PHP. - - First, install your selected HTTP (web) server on your system, and make - sure that it works. - - Run the executable installer and follow the instructions provided by - the installation wizard. Two types of installation are supported - - standard, which provides sensible defaults for all the settings it can, - and advanced, which asks questions as it goes along. - - The installation wizard gathers enough information to set up the - php.ini file, and configure certain web servers to use PHP. One of the - web servers the PHP installer does not configure for is Apache, so - you'll need to configure it manually. - - Once the installation has completed, the installer will inform you if - you need to restart your system, restart the server, or just start - using PHP. - - Warning - - Be aware, that this setup of PHP is not secure. If you would like to - have a secure PHP setup, you'd better go on the manual way, and set - every option carefully. This automatically working setup gives you an - instantly working PHP installation, but it is not meant to be used on - online servers. - __________________________________________________________________ - -Manual Installation Steps - - This install guide will help you manually install and configure PHP - with a web server on Microsoft Windows. To get started you'll need to - download the zip binary distribution from the downloads page at - http://www.php.net/downloads.php. - - Although there are many all-in-one installation kits, and we also - distribute a PHP installer for Microsoft Windows, we recommend you take - the time to setup PHP yourself as this will provide you with a better - understanding of the system, and enables you to install PHP extensions - easily when needed. - - Upgrading from a previous PHP version: Previous editions of the - manual suggest moving various ini and DLL files into your SYSTEM - (i.e. C:\WINDOWS) folder and while this simplifies the installation - procedure it makes upgrading difficult. We advise you remove all of - these files (like php.ini and PHP related DLLs from the Windows - SYSTEM folder) before moving on with a new PHP installation. Be sure - to backup these files as you might break the entire system. The old - php.ini might be useful in setting up the new PHP as well. And as - you'll soon learn, the preferred method for installing PHP is to - keep all PHP related files in one directory and have this directory - available to your systems PATH. - - MDAC requirements: If you use Microsoft Windows 98/NT4 download the - latest version of the Microsoft Data Access Components (MDAC) for - your platform. MDAC is available at http://msdn.microsoft.com/data/. - This requirement exists because ODBC is built into the distributed - Windows binaries. - - The following steps should be completed on all installations before any - server specific instructions are performed: - - Extract the distribution file into a directory of your choice. If you - are installing PHP 4, extract to C:\, as the zip file expands to a - foldername like php-4.3.7-Win32. If you are installing PHP 5, extract - to C:\php as the zip file doesn't expand as in PHP 4. You may choose a - different location but do not have spaces in the path (like C:\Program - Files\PHP) as some web servers will crash if you do. - - The directory structure extracted from the zip is different for PHP - versions 4 and 5 and look like as follows: - - Example 2-1. PHP 4 package structure -c:\php - | - +--cli - | | - | |-php.exe -- CLI executable - ONLY for command line scripting - | - +--dlls -- support DLLs required by some extensions - | | - | |-expat.dll - | | - | |-fdftk.dll - | | - | |-... - | - +--extensions -- extension DLLs for PHP - | | - | |-php_bz2.dll - | | - | |-php_cpdf.dll - | | - | |-.. - | - +--mibs -- support files for SNMP - | - +--openssl -- support files for Openssl - | - +--pdf-related -- support files for PDF - | - +--sapi -- SAPI (server module support) DLLs - | | - | |-php4apache.dll - | | - | |-php4apache2.dll - | | - | |-.. - | - +--PEAR -- initial copy of PEAR - | - | - |-go-pear.bat -- PEAR setup script - | - |-.. - | - |-php.exe -- CGI executable - | - |-.. - | - |-php.ini-dist -- default php.ini settings - | - |-php.ini-recommended -- recommended php.ini settings - | - |-php4ts.dll -- core PHP DLL - | - |-... - - Or: - - Example 2-2. PHP 5 package structure -c:\php - | - +--dev - | | - | |-php5ts.lib - | - +--ext -- extension DLLs for PHP - | | - | |-php_bz2.dll - | | - | |-php_cpdf.dll - | | - | |-.. - | - +--extras - | | - | +--mibs -- support files for SNMP - | | - | +--openssl -- support files for Openssl - | | - | +--pdf-related -- support files for PDF - | | - | |-mime.magic - | - +--pear -- initial copy of PEAR - | - | - |-go-pear.bat -- PEAR setup script - | - |-fdftk.dll - | - |-.. - | - |-php-cgi.exe -- CGI executable - | - |-php-win.exe -- executes scripts without an opened command prompt - | - |-php.exe -- CLI executable - ONLY for command line scripting - | - |-.. - | - |-php.ini-dist -- default php.ini settings - | - |-php.ini-recommended -- recommended php.ini settings - | - |-php5activescript.dll - | - |-php5apache.dll - | - |-php5apache2.dll - | - |-.. - | - |-php5ts.dll -- core PHP DLL - | - |-... - - Notice the differences and similarities. Both PHP 4 and PHP 5 have a - CGI executable, a CLI executable, and server modules, but they are - located in different folders and/or have different names. While PHP 4 - packages have the server modules in the sapi folder, PHP 5 - distributions have no such directory and instead they're in the PHP - folder root. The supporting DLLs for the PHP 5 extensions are also not - in a seperate directory. - - Note: In PHP 4, you should move all files located in the dll and - sapi folders to the main folder (e.g. C:\php). - - Here is a list of server modules shipped with PHP 4 and PHP 5: - - * sapi/php4activescript.dll (php5activescript.dll) - ActiveScript - engine, allowing you to embed PHP in your Windows applications. - * sapi/php4apache.dll (php5apache.dll) - Apache 1.3.x module. - * sapi/php4apache2.dll (php5apache2.dll) - Apache 2.0.x module. - * sapi/php5apache2_2.dll - Apache 2.2.x module. - * sapi/php4isapi.dll (php5isapi.dll) - ISAPI Module for ISAPI - compliant web servers like IIS 4.0/PWS 4.0 or newer. - * sapi/php4nsapi.dll (php5nsapi.dll) - Sun/iPlanet/Netscape server - module. - * sapi/php4pi3web.dll (no equivalent in PHP 5) - Pi3Web server - module. - - Server modules provide significantly better performance and additional - functionality compared to the CGI binary. The CLI version is designed - to let you use PHP for command line scripting. More information about - CLI is available in the chapter about using PHP from the command line. - - Warning - - The SAPI modules have been significantly improved as of the 4.1 - release, however, in older systems you may encounter server errors or - other server modules failing, such as ASP. - - The CGI and CLI binaries, and the web server modules all require the - php4ts.dll (php5ts.dll) file to be available to them. You have to make - sure that this file can be found by your PHP installation. The search - order for this DLL is as follows: - - * The same directory from where php.exe is called, or in case you use - a SAPI module, the web server's directory (e.g. C:\Program - Files\Apache Group\Apache2\bin). - * Any directory in your Windows PATH environment variable. - - To make php4ts.dll / php5ts.dll available you have three options: copy - the file to the Windows system directory, copy the file to the web - server's directory, or add your PHP directory, C:\php to the PATH. For - better maintenance, we advise you to follow the last option, add C:\php - to the PATH, because it will be simpler to upgrade PHP in the future. - Read more about how to add your PHP directory to PATH in the - corresponding FAQ entry (and then don't forget to restart the computer - - logoff isn't enough). - - The next step is to set up a valid configuration file for PHP, php.ini. - There are two ini files distributed in the zip file, php.ini-dist and - php.ini-recommended. We advise you to use php.ini-recommended, because - we optimized the default settings in this file for performance, and - security. Read this well documented file carefully because it has - changes from php.ini-dist that will drastically affect your setup. Some - examples are display_errors being off and magic_quotes_gpc being off. - In addition to reading these, study the ini settings and set every - element manually yourself. If you would like to achieve the best - security, then this is the way for you, although PHP works fine with - these default ini files. Copy your chosen ini-file to a directory that - PHP is able to find and rename it to php.ini. PHP searches for php.ini - in the locations described in the Section called The configuration file - in Chapter 5 section. - - If you are running Apache 2, the simpler option is to use the PHPIniDir - directive (read the installation on Apache 2 page), otherwise your best - option is to set the PHPRC environment variable. This process is - explained in the following FAQ entry. - - Note: If you're using NTFS on Windows NT, 2000, XP or 2003, make - sure that the user running the web server has read permissions to - your php.ini (e.g. make it readable by Everyone). - - The following steps are optional: - - * Edit your new php.ini file. If you plan to use OmniHTTPd, do not - follow the next step. Set the doc_root to point to your web servers - document_root. For example: - -doc_root = c:\inetpub\wwwroot // for IIS/PWS - -doc_root = c:\apache\htdocs // for Apache - - * Choose the extensions you would like to load when PHP starts. See - the section about Windows extensions, about how to set up one, and - what is already built in. Note that on a new installation it is - advisable to first get PHP working and tested without any - extensions before enabling them in php.ini. - * On PWS and IIS, you can set the browscap configuration setting to - point to: c:\windows\system\inetsrv\browscap.ini on Windows 9x/Me, - c:\winnt\system32\inetsrv\browscap.ini on NT/2000, and - c:\windows\system32\inetsrv\browscap.ini on XP. For an up-to-date - browscap.ini, read the following FAQ. - - PHP is now setup on your system. The next step is to choose a web - server, and enable it to run PHP. Choose a web server from the table of - contents. - __________________________________________________________________ - -ActiveScript - - This section contains notes specific to the ActiveScript installation. - - ActiveScript is a Windows only SAPI that enables you to use PHP script - in any ActiveScript compliant host, like Windows Script Host, - ASP/ASP.NET, Windows Script Components or Microsoft Scriptlet control. - - As of PHP 5.0.1, ActiveScript has been moved to the PECL repository. - The DLL for this PECL extension may be downloaded from either the PHP - Downloads page or from http://pecl4win.php.net/ - - Note: You should read the manual installation steps first! - - After installing PHP, you should download the ActiveScript DLL - (php5activescript.dll) and place it in the main PHP folder (e.g. - C:\php). - - After having all the files needed, you must register the DLL on your - system. To achieve this, open a Command Prompt window (located in the - Start Menu). Then go to your PHP directory by typing something like cd - C:\php. To register the DLL just type regsvr32 php5activescript.dll. - - To test if ActiveScript is working, create a new file, named test.wsf - (the extension is very important) and type: - - - - - - - Save and double-click on the file. If you receive a little window - saying "Hello World!" you're done. - - Note: In PHP 4, the engine was named 'ActivePHP', so if you are - using PHP 4, you should replace 'PHPScript' with 'ActivePHP' in the - above example. - - Note: ActiveScript doesn't use the default php.ini file. Instead, it - will look only in the same directory as the .exe that caused it to - load. You should create php-activescript.ini and place it in that - folder, if you wish to load extensions, etc. - __________________________________________________________________ - -Microsoft IIS / PWS - - This section contains notes and hints specific to IIS (Microsoft - Internet Information Server). - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - __________________________________________________________________ - -General considerations for all installations of PHP with IIS or PWS - - * First, read the Manual Installation Instructions. Do not skip this - step as it provides crucial information for installing PHP on - Windows. - * CGI users must set the cgi.force_redirect PHP directive to 0 inside - php.ini. Read the faq on cgi.force_redirect for important details. - Also, CGI users may want to set the cgi.redirect_status_env - directive. When using directives, be sure these directives aren't - commented out inside php.ini. - * The PHP 4 CGI is named php.exe while in PHP 5 it's php-cgi.exe. In - PHP 5, php.exe is the CLI, and not the CGI. - * Modify the Windows PATH environment variable to include the PHP - directory. This way the PHP DLL files and PHP executables can all - remain in the PHP directory without cluttering up the Windows - system directory. For more details, see the FAQ on Setting the - PATH. - * The IIS user (usually IUSR_MACHINENAME) needs permission to read - various files and directories, such as php.ini, docroot, and the - session tmp directory. - * Be sure the extension_dir and doc_root PHP directives are - appropriately set in php.ini. These directives depend on the system - that PHP is being installed on. In PHP 4, the extension_dir is - extensions while with PHP 5 it's ext. So, an example PHP 5 - extensions_dir value is "c:\php\ext" and an example IIS doc_root - value is "c:\Inetpub\wwwroot". - * PHP extension DLL files, such as php_mysql.dll and php_curl.dll, - are found in the zip package of the PHP download (not the PHP - installer). In PHP 5, many extensions are part of PECL and can be - downloaded in the "Collection of PECL modules" package. Files such - as php_zip.dll and php_ssh2.dll. Download PHP files here. - * When defining the executable, the 'check that file exists' box may - also be checked. For a small performance penalty, the IIS (or PWS) - will check that the script file exists and sort out authentication - before firing up PHP. This means that the web server will provide - sensible 404 style error messages instead of CGI errors complaining - that PHP did not output any data. - __________________________________________________________________ - -Windows NT/200x/XP and IIS 4 or newer - - PHP may be installed as a CGI binary, or with the ISAPI module. In - either case, you need to start the Microsoft Management Console (may - appear as 'Internet Services Manager', either in your Windows NT 4.0 - Option Pack branch or the Control Panel=>Administrative Tools under - Windows 2000/XP). Then right click on your Web server node (this will - most probably appear as 'Default Web Server'), and select 'Properties'. - - If you want to use the CGI binary, do the following: - - * Under 'Home Directory', 'Virtual Directory', or 'Directory', do the - following: - * Change the Execute Permissions to 'Scripts only' - * Click on the 'Configuration' button, and choose the Application - Mappings tab. Click Add and set the Executable path to the - appropriate CGI file. An example PHP 5 value is: C:\php\php-cgi.exe - Supply .php as the extension. Leave 'Method exclusions' blank, and - check the 'Script engine' checkbox. Now, click OK a few times. - * Set up the appropriate security. (This is done in Internet Service - Manager), and if your NT Server uses NTFS file system, add execute - rights for I_USR_ to the directory that contains php.exe / - php-cgi.exe. - - To use the ISAPI module, do the following: - - * If you don't want to perform HTTP Authentication using PHP, you can - (and should) skip this step. Under ISAPI Filters, add a new ISAPI - filter. Use PHP as the filter name, and supply a path to the - php4isapi.dll / php5isapi.dll. - * Under 'Home Directory', 'Virtual Directory', or 'Directory', do the - following: - * Change the Execute Permissions to 'Scripts only' - * Click on the 'Configuration' button, and choose the Application - Mappings tab. Click Add and set the Executable path to the - appropriate ISAPI DLL. An example PHP 5 value is: - C:\php\php5isapi.dll Supply .php as the extension. Leave 'Method - exclusions' blank, and check the 'Script engine' checkbox. Now, - click OK a few times. - * Stop IIS completely (NET STOP iisadmin) - * Start IIS again (NET START w3svc) - - With IIS 6 (2003 Server), open up the IIS Manager, go to Web Service - Extensions, choose "Add a new Web service extension", enter in a name - such as PHP, choose the Add button and for the value browse to either - the ISAPI file (php4isapi.dll or php5isapi.dll) or CGI (php.exe or - php-cgi.exe) then check "Set extension status to Allowed" and click OK. - - In order to use index.php as a default content page, do the following: - From within the Documents tab, choose Add. Type in index.php and click - OK. Adjust the order by choosing Move Up or Move Down. This is similar - to setting DirectoryIndex with Apache. - - The steps above must be repeated for each extension that is to be - associated with PHP scripts. .php is the most common although .php3 may - be required for legacy applications. - - If you experience 100% CPU usage after some time, turn off the IIS - setting Cache ISAPI Application. - __________________________________________________________________ - -Windows and PWS 4 - - PWS 4 does not support ISAPI, only PHP CGI should be used. - - * Edit the enclosed pws-php4cgi.reg / pws-php5cgi.reg file (look into - the SAPI folder for PHP 4, or in the main folder for PHP 5) to - reflect the location of your php.exe / php-cgi.exe. Backslashes - should be escaped, for example: - [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\paramet - ers\Script Map] ".php"="C:\\php\\php.exe" (change to - C:\\php\\php-cgi.exe if you are using PHP 5) Now merge this - registery file into your system; you may do this by double-clicking - it. - * In the PWS Manager, right click on a given directory you want to - add PHP support to, and select Properties. Check the 'Execute' - checkbox, and confirm. - __________________________________________________________________ - -Windows and PWS/IIS 3 - - The recommended method for configuring these servers is to use the REG - file included with the distribution (pws-php4cgi.reg in the SAPI folder - for PHP 4, or pws-php5cgi.reg in the main folder for PHP 5). You may - want to edit this file and make sure the extensions and PHP install - directories match your configuration. Or you can follow the steps below - to do it manually. - - Warning - - These steps involve working directly with the Windows registry. One - error here can leave your system in an unstable state. We highly - recommend that you back up your registry first. The PHP Development - team will not be held responsible if you damage your registry. - - * Run Regedit. - * Navigate to: HKEY_LOCAL_MACHINE /System /CurrentControlSet - /Services /W3Svc /Parameters /ScriptMap. - * On the edit menu select: New->String Value. - * Type in the extension you wish to use for your php scripts. For - example .php - * Double click on the new string value and enter the path to php.exe - in the value data field. ex: C:\php\php.exe "%s" %s for PHP 4, or - C:\php\php-cgi.exe "%s" %s for PHP 5. - * Repeat these steps for each extension you wish to associate with - PHP scripts. - - The following steps do not affect the web server installation and only - apply if you want your PHP scripts to be executed when they are run - from the command line (ex. run C:\myscripts\test.php) or by double - clicking on them in a directory viewer window. You may wish to skip - these steps as you might prefer the PHP files to load into a text - editor when you double click on them. - - * Navigate to: HKEY_CLASSES_ROOT - * On the edit menu select: New->Key. - * Name the key to the extension you setup in the previous section. - ex: .php - * Highlight the new key and in the right side pane, double click the - "default value" and enter phpfile. - * Repeat the last step for each extension you set up in the previous - section. - * Now create another New->Key under HKEY_CLASSES_ROOT and name it - phpfile. - * Highlight the new key phpfile and in the right side pane, double - click the "default value" and enter PHP Script. - * Right click on the phpfile key and select New->Key, name it Shell. - * Right click on the Shell key and select New->Key, name it open. - * Right click on the open key and select New->Key, name it command. - * Highlight the new key command and in the right side pane, double - click the "default value" and enter the path to php.exe. ex: - c:\php\php.exe -q %1. (don't forget the %1). - * Exit Regedit. - * If using PWS on Windows, reboot to reload the registry. - - PWS and IIS 3 users now have a fully operational system. IIS 3 users - can use a nifty tool from Steven Genusa to configure their script maps. - __________________________________________________________________ - -Apache 1.3.x on Microsoft Windows - - This section contains notes and hints specific to Apache 1.3.x installs - of PHP on Microsoft Windows systems. There are also instructions and - notes for Apache 2 on a separate page. - - Note: Please read the manual installation steps first! - - There are two ways to set up PHP to work with Apache 1.3.x on Windows. - One is to use the CGI binary (php.exe for PHP 4 and php-cgi.exe for PHP - 5), the other is to use the Apache Module DLL. In either case you need - to edit your httpd.conf to configure Apache to work with PHP, and then - restart the server. - - It is worth noting here that now the SAPI module has been made more - stable under Windows, we recommend it's use above the CGI binary, since - it is more transparent and secure. - - Although there can be a few variations of configuring PHP under Apache, - these are simple enough to be used by the newcomer. Please consult the - Apache Documentation for further configuration directives. - - After changing the configuration file, remember to restart the server, - for example, NET STOP APACHE followed by NET START APACHE, if you run - Apache as a Windows Service, or use your regular shortcuts. - - Note: Remember that when adding path values in the Apache - configuration files on Windows, all backslashes such as - c:\directory\file.ext must be converted to forward slashes, as - c:/directory/file.ext. A trailing slash may also be necessary for - directories. - __________________________________________________________________ - -Installing as an Apache module - - You should add the following lines to your Apache httpd.conf file: - - Example 2-3. PHP as an Apache 1.3.x module - - This assumes PHP is installed to c:\php. Adjust the path if this is not - the case. - - For PHP 4: -# Add to the end of the LoadModule section -# Don't forget to copy this file from the sapi directory! -LoadModule php4_module "C:/php/php4apache.dll" - -# Add to the end of the AddModule section -AddModule mod_php4.c - - For PHP 5: -# Add to the end of the LoadModule section -LoadModule php5_module "C:/php/php5apache.dll" - -# Add to the end of the AddModule section -AddModule mod_php5.c - - For both: -# Add this line inside the conditional brace -AddType application/x-httpd-php .php - -# For syntax highlighted .phps files, also add -AddType application/x-httpd-php-source .phps - __________________________________________________________________ - -Installing as a CGI binary - - If you unzipped the PHP package to C:\php\ as described in the Manual - Installation Steps section, you need to insert these lines to your - Apache configuration file to set up the CGI binary: - - Example 2-4. PHP and Apache 1.3.x as CGI -ScriptAlias /php/ "c:/php/" -AddType application/x-httpd-php .php - -# For PHP 4 -Action application/x-httpd-php "/php/php.exe" - -# For PHP 5 -Action application/x-httpd-php "/php/php-cgi.exe" - -# specify the directory where php.ini is -SetEnv PHPRC C:/php - - Note that the second line in the list above can be found in the actual - versions of httpd.conf, but it is commented out. Remember also to - substitute the c:/php/ for your actual path to PHP. - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - - If you would like to present PHP source files syntax highlighted, there - is no such convenient option as with the module version of PHP. If you - chose to configure Apache to use PHP as a CGI binary, you will need to - use the highlight_file() function. To do this simply create a PHP - script file and add this code: . - __________________________________________________________________ - -Apache 2.0.x on Microsoft Windows - - This section contains notes and hints specific to Apache 2.0.x installs - of PHP on Microsoft Windows systems. We also have instructions and - notes for Apache 1.3.x users on a separate page. - - Note: You should read the manual installation steps first! - - Apache 2.2.x Support: Users of Apache 2.2.x may use the - documentation below except the appropriate DLL file is named - php5apache2_2.dll and it only exists as of PHP 5.2.0. See also - http://snaps.php.net/ - - Warning - - We do not recommend using a threaded MPM in production with Apache2. - Use the prefork MPM instead, or use Apache1. For information on why, - read the related FAQ entry on using Apache2 with a threaded MPM - - You are highly encouraged to take a look at the Apache Documentation to - get a basic understanding of the Apache 2.0.x Server. Also consider to - read the Windows specific notes for Apache 2.0.x before reading on - here. - - PHP and Apache 2.0.x compatibility notes: The following versions of - PHP are known to work with the most recent version of Apache 2.0.x: - - * PHP 4.3.0 or later available at http://www.php.net/downloads.php. - * the latest stable development version. Get the source code - http://snaps.php.net/php5-latest.tar.gz or download binaries for - Windows http://snaps.php.net/win32/php5-win32-latest.zip. - * a prerelease version downloadable from http://qa.php.net/. - * you have always the option to obtain PHP through anonymous CVS. - - These versions of PHP are compatible to Apache 2.0.40 and later. - - Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 works with - Apache 2.0.39, don't use any other version of Apache with PHP 4.2.3. - However, the recommended setup is to use PHP 4.3.0 or later with the - most recent version of Apache2. - - All mentioned versions of PHP will work still with Apache 1.3.x. - - Warning - - Apache 2.0.x is designed to run on Windows NT 4.0, Windows 2000 or - Windows XP. At this time, support for Windows 9x is incomplete. Apache - 2.0.x is not expected to work on those platforms at this time. - - Download the most recent version of Apache 2.0.x and a fitting PHP - version. Follow the Manual Installation Steps and come back to go on - with the integration of PHP and Apache. - - There are two ways to set up PHP to work with Apache 2.0.x on Windows. - One is to use the CGI binary the other is to use the Apache module DLL. - In either case you need to edit your httpd.conf to configure Apache to - work with PHP and then restart the server. - - Note: Remember that when adding path values in the Apache - configuration files on Windows, all backslashes such as - c:\directory\file.ext must be converted to forward slashes, as - c:/directory/file.ext. A trailing slash may also be necessary for - directories. - __________________________________________________________________ - -Installing as a CGI binary - - You need to insert these three lines to your Apache httpd.conf - configuration file to set up the CGI binary: - - Example 2-5. PHP and Apache 2.0 as CGI -ScriptAlias /php/ "c:/php/" -AddType application/x-httpd-php .php - -# For PHP 4 -Action application/x-httpd-php "/php/php.exe" - -# For PHP 5 -Action application/x-httpd-php "/php/php-cgi.exe" - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - __________________________________________________________________ - -Installing as an Apache module - - You need to insert these two lines to your Apache httpd.conf - configuration file to set up the PHP module for Apache 2.0: - - Example 2-6. PHP and Apache 2.0 as Module -# For PHP 4 do something like this: -LoadModule php4_module "c:/php/php4apache2.dll" -# Don't forget to copy the php4apache2.dll file from the sapi directory! -AddType application/x-httpd-php .php - -# For PHP 5 do something like this: -LoadModule php5_module "c:/php/php5apache2.dll" -AddType application/x-httpd-php .php - -# configure the path to php.ini -PHPIniDir "C:/php" - - Note: Remember to substitute your actual path to PHP for the c:/php/ - in the above examples. Take care to use either php4apache2.dll or - php5apache2.dll in your LoadModule directive and not php4apache.dll - or php5apache.dll as the latter ones are designed to run with Apache - 1.3.x. - - Note: If you want to use content negotiation, read related FAQ. - - Warning - - Don't mix up your installation with DLL files from different PHP - versions. You have the only choice to use the DLL's and extensions that - ship with your downloaded PHP version. - __________________________________________________________________ - -Sun, iPlanet and Netscape servers on Microsoft Windows - - This section contains notes and hints specific to Sun Java System Web - Server, Sun ONE Web Server, iPlanet and Netscape server installs of PHP - on Windows. - - From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to - generate custom directory listings and error pages. Additional - functions for Apache compatibility are also available. For support in - current web servers read the note about subrequests. - __________________________________________________________________ - -CGI setup on Sun, iPlanet and Netscape servers - - To install PHP as a CGI handler, do the following: - - * Copy php4ts.dll to your systemroot (the directory where you - installed Windows) - * Make a file association from the command line. Type the following - two lines: - -assoc .php=PHPScript -ftype PHPScript=c:\php\php.exe %1 %* - - * In the Netscape Enterprise Administration Server create a dummy - shellcgi directory and remove it just after (this step creates 5 - important lines in obj.conf and allow the web server to handle - shellcgi scripts). - * In the Netscape Enterprise Administration Server create a new mime - type (Category: type, Content-Type: magnus-internal/shellcgi, File - Suffix:php). - * Do it for each web server instance you want PHP to run - - More details about setting up PHP as a CGI executable can be found - here: http://benoit.noss.free.fr/php/install-php.html - __________________________________________________________________ - -NSAPI setup on Sun, iPlanet and Netscape servers - - To install PHP with NSAPI, do the following: - - * Copy php4ts.dll to your systemroot (the directory where you - installed Windows) - * Make a file association from the command line. Type the following - two lines: - -assoc .php=PHPScript -ftype PHPScript=c:\php\php.exe %1 %* - - * In the Netscape Enterprise Administration Server create a new mime - type (Category: type, Content-Type: magnus-internal/x-httpd-php, - File Suffix: php). - * Edit magnus.conf (for servers >= 6) or obj.conf (for servers < 6) - and add the following: You should place the lines after mime types - init. - -Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="c:/ -php/sapi/php4nsapi.dll" -Init fn="php4_init" LateInit="yes" errorString="Failed to initialise PHP!" [php_ -ini="c:/path/to/php.ini"] - - (PHP >= 4.3.3) The php_ini parameter is optional but with it you - can place your php.ini in your web server configuration directory. - * Configure the default object in obj.conf (for virtual server - classes [Sun Web Server 6.0+] in their vserver.obj.conf): In the - section, place this line necessarily after - all 'ObjectType' and before all 'AddLog' lines: - -Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value inike -y=value ...] - - (PHP >= 4.3.3) As additional parameters you can add some special - php.ini-values, for example you can set a - docroot="/path/to/docroot" specific to the context php4_execute is - called. For boolean ini-keys please use 0/1 as value, not - "On","Off",... (this will not work correctly), e.g. - zlib.output_compression=1 instead of zlib.output_compression="On" - * This is only needed if you want to configure a directory that only - consists of PHP scripts (same like a cgi-bin directory): - - -ObjectType fn="force-type" type="magnus-internal/x-httpd-php" -Service fn=php4_execute [inikey=value inikey=value ...] - - - After that you can configure a directory in the Administration - server and assign it the style x-httpd-php. All files in it will - get executed as PHP. This is nice to hide PHP usage by renaming - files to .html. - * Restart your web service and apply changes - * Do it for each web server instance you want PHP to run - - Note: More details about setting up PHP as an NSAPI filter can be - found here: http://benoit.noss.free.fr/php/install-php4.html - - Note: The stacksize that PHP uses depends on the configuration of - the web server. If you get crashes with very large PHP scripts, it - is recommended to raise it with the Admin Server (in the section - "MAGNUS EDITOR"). - __________________________________________________________________ - -CGI environment and recommended modifications in php.ini - - Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE - WS/iPlanet/Netscape is a multithreaded web server. Because of that all - requests are running in the same process space (the space of the web - server itself) and this space has only one environment. If you want to - get CGI variables like PATH_INFO, HTTP_HOST etc. it is not the correct - way to try this in the old PHP 3.x way with getenv() or a similar way - (register globals to environment, $_ENV). You would only get the - environment of the running web server without any valid CGI variables! - - Note: Why are there (invalid) CGI variables in the environment? - - Answer: This is because you started the web server process from the - admin server which runs the startup script of the web server, you - wanted to start, as a CGI script (a CGI script inside of the admin - server!). This is why the environment of the started web server has - some CGI environment variables in it. You can test this by starting - the web server not from the administration server. Use the command - line as root user and start it manually - you will see there are no - CGI-like environment variables. - - Simply change your scripts to get CGI variables in the correct way for - PHP 4.x by using the superglobal $_SERVER. If you have older scripts - which use $HTTP_HOST, etc., you should turn on register_globals in - php.ini and change the variable order too (important: remove "E" from - it, because you do not need the environment here): -variables_order = "GPCS" -register_globals = On - __________________________________________________________________ - -Special use for error pages or self-made directory listings (PHP >= 4.3.3) - - You can use PHP to generate the error pages for "404 Not Found" or - similar. Add the following line to the object in obj.conf for every - error page you want to overwrite: -Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value inik -ey=value...] - - where XXX is the HTTP error code. Please delete any other Error - directives which could interfere with yours. If you want to place a - page for all errors that could exist, leave the code parameter out. - Your script can get the HTTP status code with $_SERVER['ERROR_TYPE']. - - Another possibility is to generate self-made directory listings. Just - create a PHP script which displays a directory listing and replace the - corresponding default Service line for type="magnus-internal/directory" - in obj.conf with the following: -Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/scri -pt.php" [inikey=value inikey=value...] - - For both error and directory listing pages the original URI and - translated URI are in the variables $_SERVER['PATH_INFO'] and - $_SERVER['PATH_TRANSLATED']. - __________________________________________________________________ - -Note about nsapi_virtual() and subrequests (PHP >= 4.3.3) - - The NSAPI module now supports the nsapi_virtual() function (alias: - virtual()) to make subrequests on the web server and insert the result - in the web page. The problem is, that this function uses some - undocumented features from the NSAPI library. - - Under Unix this is not a problem, because the module automatically - looks for the needed functions and uses them if available. If not, - nsapi_virtual() is disabled. - - Under Windows limitations in the DLL handling need the use of a - automatic detection of the most recent ns-httpdXX.dll file. This is - tested for servers till version 6.1. If a newer version of the Sun - server is used, the detection fails and nsapi_virtual() is disabled. - - If this is the case, try the following: Add the following parameter to - php4_init in magnus.conf/obj.conf: - Init fn=php4_init ... server_lib="ns-httpdXX.dll" - - where XX is the correct DLL version number. To get it, look in the - server-root for the correct DLL name. The DLL with the biggest filesize - is the right one. - - You can check the status by using the phpinfo() function. - - Note: But be warned: Support for nsapi_virtual() is EXPERIMENTAL!!! - __________________________________________________________________ - -OmniHTTPd Server - - This section contains notes and hints specific to OmniHTTPd on Windows. - - Note: You should read the manual installation steps first! - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - - You need to complete the following steps to make PHP work with - OmniHTTPd. This is a CGI executable setup. SAPI is supported by - OmniHTTPd, but some tests have shown that it is not so stable to use - PHP as an ISAPI module. - - Important for CGI users: Read the faq on cgi.force_redirect for - important details. This directive needs to be set to 0. - - 1. Install OmniHTTPd server. - 2. Right click on the blue OmniHTTPd icon in the system tray and - select Properties - 3. Click on Web Server Global Settings - 4. On the 'External' tab, enter: virtual = .php | actual = - c:\php\php.exe (use php-cgi.exe if installing PHP 5), and use the - Add button. - 5. On the Mime tab, enter: virtual = wwwserver/stdcgi | actual = .php, - and use the Add button. - 6. Click OK - - Repeat steps 2 - 6 for each extension you want to associate with PHP. - - Note: Some OmniHTTPd packages come with built in PHP support. You - can choose at setup time to do a custom setup, and uncheck the PHP - component. We recommend you to use the latest PHP binaries. Some - OmniHTTPd servers come with PHP 4 beta distributions, so you should - choose not to set up the built in support, but install your own. If - the server is already on your machine, use the Replace button in - Step 4 and 5 to set the new, correct information. - __________________________________________________________________ - -Sambar Server on Microsoft Windows - - This section contains notes and hints specific to the Sambar Server for - Windows. - - Note: You should read the manual installation steps first! - - This list describes how to set up the ISAPI module to work with the - Sambar server on Windows. - - * Find the file called mappings.ini (in the config directory) in the - Sambar install directory. - * Open mappings.ini and add the following line under [ISAPI]: - - Example 2-7. ISAPI configuration of Sambar -#for PHP 4 -*.php = c:\php\php4isapi.dll - -#for PHP 5 -*.php = c:\php\php5isapi.dll - - (This line assumes that PHP was installed in c:\php.) - * Now restart the Sambar server for the changes to take effect. - - Note: If you intend to use PHP to communicate with resources which - are held on a different computer on your network, then you will need - to alter the account used by the Sambar Server Service. The default - account used for the Sambar Server Service is LocalSystem which will - not have access to remote resources. The account can be amended by - using the Services option from within the Windows Control Panel - Administation Tools. - __________________________________________________________________ - -Xitami on Microsoft Windows - - This section contains notes and hints specific to Xitami on Windows. - - Note: You should read the manual installation steps first! - - This list describes how to set up the PHP CGI binary to work with - Xitami on Windows. - - Important for CGI users: Read the faq on cgi.force_redirect for - important details. This directive needs to be set to 0. If you want - to use $_SERVER['PHP_SELF'] you have to enable the cgi.fix_pathinfo - directive. - - Warning - - By using the CGI setup, your server is open to several possible - attacks. Please read our CGI security section to learn how to defend - yourself from those attacks. - - * Make sure the web server is running, and point your browser to - xitamis admin console (usually http://127.0.0.1/admin), and click - on Configuration. - * Navigate to the Filters, and put the extension which PHP should - parse (i.e. .php) into the field File extensions (.xxx). - * In Filter command or script put the path and name of your PHP CGI - executable i.e. C:\php\php.exe for PHP 4, or C:\php\php-cgi.exe for - PHP 5. - * Press the 'Save' icon. - * Restart the server to reflect changes. - __________________________________________________________________ - -Installation of extensions on Windows - - After installing PHP and a web server on Windows, you will probably - want to install some extensions for added functionality. You can choose - which extensions you would like to load when PHP starts by modifying - your php.ini. You can also load a module dynamically in your script - using dl(). - - The DLLs for PHP extensions are prefixed with php_. - - Many extensions are built into the Windows version of PHP. This means - additional DLL files, and the extension directive, are not used to load - these extensions. The Windows PHP Extensions table lists extensions - that require, or used to require, additional PHP DLL files. Here's a - list of built in extensions: - - In PHP 4 (updated PHP 4.3.11): BCMath, Caledar, COM, Ctype, FTP, MySQL, - ODBC, Overload, PCRE, Session, Tokenizer, WDDX, XML and Zlib - - In PHP 5 (updated PHP 5.0.4), the following changes exist. Built in: - DOM, LibXML, Iconv, SimpleXML, SPL and SQLite. And the following are no - longer built in: MySQL and Overload. - - The default location PHP searches for extensions is C:\php4\extensions - in PHP 4 and C:\php5 in PHP 5. To change this setting to reflect your - setup of PHP edit your php.ini file: - - * You will need to change the extension_dir setting to point to the - directory where your extensions lives, or where you have placed - your php_*.dll files. For example: - -extension_dir = C:\php\extensions - - * Enable the extension(s) in php.ini you want to use by uncommenting - the extension=php_*.dll lines in php.ini. This is done by deleting - the leading ; from the extension you want to load. - - Example 2-8. Enable Bzip2 extension for PHP-Windows -// change the following line from ... -;extension=php_bz2.dll - -// ... to -extension=php_bz2.dll - - * Some of the extensions need extra DLLs to work. Couple of them can - be found in the distribution package, in the C:\php\dlls\ folder in - PHP 4 or in the main folder in PHP 5, but some, for example Oracle - (php_oci8.dll) require DLLs which are not bundled with the - distribution package. If you are installing PHP 4, copy the bundled - DLLs from C:\php\dlls folder to the main C:\php folder. Don't - forget to include C:\php in the system PATH (this process is - explained in a separate FAQ entry). - * Some of these DLLs are not bundled with the PHP distribution. See - each extensions documentation page for details. Also, read the - manual section titled Installation of PECL extensions for details - on PECL. An increasingly large number of PHP extensions are found - in PECL, and these extensions require a separate download. - - Note: If you are running a server module version of PHP remember to - restart your web server to reflect your changes to php.ini. - - The following table describes some of the extensions available and - required additional dlls. - - Table 2-1. PHP Extensions - Extension Description Notes - php_bz2.dll bzip2 compression functions None - php_calendar.dll Calendar conversion functions Built in since PHP 4.0.3 - php_cpdf.dll ClibPDF functions None - php_crack.dll Crack functions None - php_ctype.dll ctype family functions Built in since PHP 4.3.0 - php_curl.dll CURL, Client URL library functions Requires: libeay32.dll, - ssleay32.dll (bundled) - php_cybercash.dll Cybercash payment functions PHP <= 4.2.0 - php_db.dll DBM functions Deprecated. Use DBA instead (php_dba.dll) - php_dba.dll DBA: DataBase (dbm-style) Abstraction layer functions None - php_dbase.dll dBase functions None - php_dbx.dll dbx functions - php_domxml.dll DOM XML functions PHP <= 4.2.0 requires: libxml2.dll - (bundled) PHP >= 4.3.0 requires: iconv.dll (bundled) - php_dotnet.dll .NET functions PHP <= 4.1.1 - php_exif.dll EXIF functions php_mbstring.dll. And, php_exif.dll must be - loaded after php_mbstring.dll in php.ini. - php_fbsql.dll FrontBase functions PHP <= 4.2.0 - php_fdf.dll FDF: Forms Data Format functions. Requires: fdftk.dll - (bundled) - php_filepro.dll filePro functions Read-only access - php_ftp.dll FTP functions Built-in since PHP 4.0.3 - php_gd.dll GD library image functions Removed in PHP 4.3.2. Also note - that truecolor functions are not available in GD1, instead, use - php_gd2.dll. - php_gd2.dll GD library image functions GD2 - php_gettext.dll Gettext functions PHP <= 4.2.0 requires gnu_gettext.dll - (bundled), PHP >= 4.2.3 requires libintl-1.dll, iconv.dll (bundled). - php_hyperwave.dll HyperWave functions None - php_iconv.dll ICONV characterset conversion Requires: iconv-1.3.dll - (bundled), PHP >=4.2.1 iconv.dll - php_ifx.dll Informix functions Requires: Informix libraries - php_iisfunc.dll IIS management functions None - php_imap.dll IMAP POP3 and NNTP functions None - php_ingres.dll Ingres II functions Requires: Ingres II libraries - php_interbase.dll InterBase functions Requires: gds32.dll (bundled) - php_java.dll Java functions PHP <= 4.0.6 requires: jvm.dll (bundled) - php_ldap.dll LDAP functions PHP <= 4.2.0 requires libsasl.dll - (bundled), PHP >= 4.3.0 requires libeay32.dll, ssleay32.dll (bundled) - php_mbstring.dll Multi-Byte String functions None - php_mcrypt.dll Mcrypt Encryption functions Requires: libmcrypt.dll - php_mhash.dll Mhash functions PHP >= 4.3.0 requires: libmhash.dll - (bundled) - php_mime_magic.dll Mimetype functions Requires: magic.mime (bundled) - php_ming.dll Ming functions for Flash None - php_msql.dll mSQL functions Requires: msql.dll (bundled) - php_mssql.dll MSSQL functions Requires: ntwdblib.dll (bundled) - php_mysql.dll MySQL functions PHP >= 5.0.0, requires libmysql.dll - (bundled) - php_mysqli.dll MySQLi functions PHP >= 5.0.0, requires libmysql.dll - (libmysqli.dll in PHP <= 5.0.2) (bundled) - php_oci8.dll Oracle 8 functions Requires: Oracle 8.1+ client libraries - php_openssl.dll OpenSSL functions Requires: libeay32.dll (bundled) - php_oracle.dll Oracle functions Requires: Oracle 7 client libraries - php_overload.dll Object overloading functions Built in since PHP 4.3.0 - php_pdf.dll PDF functions None - php_pgsql.dll PostgreSQL functions None - php_printer.dll Printer functions None - php_shmop.dll Shared Memory functions None - php_snmp.dll SNMP get and walk functions NT only! - php_soap.dll SOAP functions PHP >= 5.0.0 - php_sockets.dll Socket functions None - php_sybase_ct.dll Sybase functions Requires: Sybase client libraries - php_tidy.dll Tidy functions PHP >= 5.0.0 - php_tokenizer.dll Tokenizer functions Built in since PHP 4.3.0 - php_w32api.dll W32api functions None - php_xmlrpc.dll XML-RPC functions PHP >= 4.2.1 requires: iconv.dll - (bundled) - php_xslt.dll XSLT functions PHP <= 4.2.0 requires sablot.dll, expat.dll - (bundled). PHP >= 4.2.1 requires sablot.dll, expat.dll, iconv.dll - (bundled). - php_yaz.dll YAZ functions Requires: yaz.dll (bundled) - php_zip.dll Zip File functions Read only access - php_zlib.dll ZLib compression functions Built in since PHP 4.3.0 - __________________________________________________________________ - -Chapter 3. Installation of PECL extensions - -Introduction to PECL Installations - - PECL is a repository of PHP extensions that are made available to you - via the PEAR packaging system. This section of the manual is intended - to demonstrate how to obtain and install PECL extensions. - - These instructions assume /your/phpsrcdir/ is the path to the PHP - source distribution, and that extname is the name of the PECL - extension. Adjust accordingly. These instructions also assume a - familiarity with the pear command. The information in the PEAR manual - for the pear command also applies to the pecl command. - - To be useful, a shared extension must be built, installed, and loaded. - The methods described below provide you with various instructions on - how to build and install the extensions, but they do not automatically - load them. Extensions can be loaded by adding an extension directive. - To this php.ini file, or through the use of the dl() function. - - When building PHP modules, it's important to have known-good versions - of the required tools (autoconf, automake, libtool, etc.) See the - Anonymous CVS Instructions for details on the required tools, and - required versions. - __________________________________________________________________ - -Downloading PECL extensions - - There are several options for downloading PECL extensions, such as: - - * http://pecl.php.net - The PECL web site contains information about the different - extensions that are offered by the PHP Development Team. The - information available here includes: ChangeLog, release notes, - requirements and other similar details. - * pecl download extname - PECL extensions that have releases listed on the PECL web site are - available for download and installation using the pecl command. - Specific revisions may also be specified. - * CVS - Most PECL extensions also reside in CVS. A web-based view may be - seen at http://cvs.php.net/pecl/. To download straight from CVS, - the following sequence of commands may be used. Note that phpfi is - the password for user cvsread: - -$ cvs -d:pserver:cvsread@cvs.php.net:/repository login -$ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname - - * Windows downloads - Windows users may find compiled PECL binaries by downloading the - Collection of PECL modules from the PHP Downloads page, or by - retrieving a PECL Snapshot or an extension DLL on PECL4WIN. To - compile PHP under Windows, read the appropriate chapter. - __________________________________________________________________ - -PECL for Windows users - - As with any other PHP extension DLL, installation is as simple as - copying the PECL extension DLLs into the extension_dir folder and - loading them from php.ini. For example, add the following line to your - php.ini: - - extension=php_extname.dll - - After doing this, restart the web server. - __________________________________________________________________ - -Compiling shared PECL extensions with the pecl command - - PECL makes it easy to create shared PHP extensions. Using the pecl - command, do the following: - - $ pecl install extname - - This will download the source for extname, compile, and install - extname.so into your extension_dir. extname.so may then be loaded via - php.ini - - By default, the pecl command will not install packages that are marked - with the alpha or beta state. If no stable packages are available, you - may install a beta package using the following command: - - $ pecl install extname-beta - - You may also install a specific version using this variant: - - $ pecl install extname-0.1 - __________________________________________________________________ - -Compiling shared PECL extensions with phpize - - Sometimes, using the pecl installer is not an option. This could be - because you're behind a firewall, or it could be because the extension - you want to install is not available as a PECL compatible package, such - as unreleased extensions from CVS. If you need to build such an - extension, you can use the lower-level build tools to perform the build - manually. - - The phpize command is used to prepare the build environment for a PHP - extension. In the following sample, the sources for an extension are in - a directory named extname: - -$ cd extname -$ phpize -$ ./configure -$ make -# make install - - A successful install will have created extname.so and put it into the - PHP extensions directory. You'll need to and adjust php.ini and add an - extension=extname.so line before you can use the extension. - - If the system is missing the phpize command, and precompiled packages - (like RPM's) are used, be sure to also install the appropriate devel - version of the PHP package as they often include the phpize command - along with the appropriate header files to build PHP and its - extensions. - - Execute phpize --help to display additional usage information. - __________________________________________________________________ - -Compiling PECL extensions statically into PHP - - You might find that you need to build a PECL extension statically into - your PHP binary. To do this, you'll need to place the extension source - under the php-src/ext/ directory and tell the PHP build system to - regenerate its configure script. - -$ cd /your/phpsrcdir/ext -$ pecl download extname -$ gzip -d < extname.tgz | tar -xvf - -$ mv extname-x.x.x extname - - This will result in the following directory: - - /your/phpsrcdir/ext/extname - - From here, force PHP to rebuild the configure script, and then build - PHP as normal: - -$ cd /your/phpsrcdir -$ rm configure -$ ./buildconf --force -$ ./configure --help -$ ./configure --with-extname --enable-someotherext --with-foobar -$ make -$ make install - - Note: To run the 'buildconf' script you need autoconf 2.13 and - automake 1.4+ (newer versions of autoconf may work, but are not - supported). - - Whether --enable-extname or --with-extname is used depends on the - extension. Typically an extension that does not require external - libraries uses --enable. To be sure, run the following after buildconf: - - $ ./configure --help | grep extname - __________________________________________________________________ - -Chapter 4. Problems? - -Read the FAQ - - Some problems are more common than others. The most common ones are - listed in the PHP FAQ, part of this manual. - __________________________________________________________________ - -Other problems - - If you are still stuck, someone on the PHP installation mailing list - may be able to help you. You should check out the archive first, in - case someone already answered someone else who had the same problem as - you. The archives are available from the support page on - http://www.php.net/support.php. To subscribe to the PHP installation - mailing list, send an empty mail to - php-install-subscribe@lists.php.net. The mailing list address is - php-install@lists.php.net. - - If you want to get help on the mailing list, please try to be precise - and give the necessary details about your environment (which operating - system, what PHP version, what web server, if you are running PHP as - CGI or a server module, safe mode, etc...), and preferably enough code - to make others able to reproduce and test your problem. - __________________________________________________________________ - -Bug reports - - If you think you have found a bug in PHP, please report it. The PHP - developers probably don't know about it, and unless you report it, - chances are it won't be fixed. You can report bugs using the - bug-tracking system at http://bugs.php.net/. Please do not send bug - reports in mailing list or personal letters. The bug system is also - suitable to submit feature requests. - - Read the How to report a bug document before submitting any bug - reports! - __________________________________________________________________ - -Chapter 5. Runtime Configuration - -The configuration file - - The configuration file (called php3.ini in PHP 3, and simply php.ini as - of PHP 4) is read when PHP starts up. For the server module versions of - PHP, this happens only once when the web server is started. For the CGI - and CLI version, it happens on every invocation. - - php.ini is searched in these locations (in order): - - * SAPI module specific location (PHPIniDir directive in Apache 2, -c - command line option in CGI and CLI, php_ini parameter in NSAPI, - PHP_INI_PATH environment variable in THTTPD) - * The PHPRC environment variable. Before PHP 5.2.0 this was checked - after the registry key mentioned below. - * As of PHP 5.2.0, the following registry locations are searched in - order: HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z\IniFilePath, - HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y\IniFilePath and - HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x\IniFilePath, where x, y and z - mean the PHP major, minor and release versions. - * HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry - location) - * Current working directory (except CLI) - * The web server's directory (for SAPI modules), or directory of PHP - (otherwise in Windows) - * Windows directory (C:\windows or C:\winnt) (for Windows), or - --with-config-file-path compile time option - - If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is - e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini. SAPI - name can be determined by php_sapi_name(). - - Note: The Apache web server changes the directory to root at startup - causing PHP to attempt to read php.ini from the root filesystem if - it exists. - - The php.ini directives handled by extensions are documented - respectively on the pages of the extensions themselves. The list of the - core directives is available in the appendix. Probably not all PHP - directives are documented in the manual though. For a complete list of - directives available in your PHP version, please read your well - commented php.ini file. Alternatively, you may find the the latest - php.ini from CVS helpful too. - - Example 5-1. php.ini example -; any text on a line after an unquoted semicolon (;) is ignored -[php] ; section markers (text within square brackets) are also ignored -; Boolean values can be set to either: -; true, on, yes -; or false, off, no, none -register_globals = off -track_errors = yes - -; you can enclose strings in double-quotes -include_path = ".:/usr/local/lib/php" - -; backslashes are treated the same as any other character -include_path = ".;c:\php\lib" - - Since PHP 5.1.0, it is possible to refer to existing .ini variables - from within .ini files. Example: open_basedir = ${open_basedir} - ":/new/dir". - __________________________________________________________________ - -How to change configuration settings - -Running PHP as an Apache module - - When using PHP as an Apache module, you can also change the - configuration settings using directives in Apache configuration files - (e.g. httpd.conf) and .htaccess files. You will need "AllowOverride - Options" or "AllowOverride All" privileges to do so. - - With PHP 4 and PHP 5, there are several Apache directives that allow - you to change the PHP configuration from within the Apache - configuration files. For a listing of which directives are PHP_INI_ALL, - PHP_INI_PERDIR, or PHP_INI_SYSTEM, have a look at the List of php.ini - directives appendix. - - Note: With PHP 3, there are Apache directives that correspond to - each configuration setting in the php3.ini name, except the name is - prefixed by "php3_". - - php_value name value - Sets the value of the specified directive. Can be used only with - PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a - previously set value use none as the value. - - Note: Don't use php_value to set boolean values. php_flag (see - below) should be used instead. - - php_flag name on|off - Used to set a boolean configuration directive. Can be used only - with PHP_INI_ALL and PHP_INI_PERDIR type directives. - - php_admin_value name value - Sets the value of the specified directive. This can not be used - in .htaccess files. Any directive type set with php_admin_value - can not be overridden by .htaccess or virtualhost directives. To - clear a previously set value use none as the value. - - php_admin_flag name on|off - Used to set a boolean configuration directive. This can not be - used in .htaccess files. Any directive type set with - php_admin_flag can not be overridden by .htaccess or virtualhost - directives. - - Example 5-2. Apache configuration example - - php_value include_path ".:/usr/local/lib/php" - php_admin_flag safe_mode on - - - php_value include_path ".:/usr/local/lib/php" - php_admin_flag safe_mode on - - - php3_include_path ".:/usr/local/lib/php" - php3_safe_mode on - - - Caution - - PHP constants do not exist outside of PHP. For example, in httpd.conf - you can not use PHP constants such as E_ALL or E_NOTICE to set the - error_reporting directive as they will have no meaning and will - evaluate to 0. Use the associated bitmask values instead. These - constants can be used in php.ini - __________________________________________________________________ - -Changing PHP configuration via the Windows registry - - When running PHP on Windows, the configuration values can be modified - on a per-directory basis using the Windows registry. The configuration - values are stored in the registry key HKLM\SOFTWARE\PHP\Per Directory - Values, in the sub-keys corresponding to the path names. For example, - configuration values for the directory c:\inetpub\wwwroot would be - stored in the key HKLM\SOFTWARE\PHP\Per Directory - Values\c\inetpub\wwwroot. The settings for the directory would be - active for any script running from this directory or any subdirectory - of it. The values under the key should have the name of the PHP - configuration directive and the string value. PHP constants in the - values are not parsed. However, only configuration values changeable in - PHP_INI_USER can be set this way, PHP_INI_PERDIR values can not. - __________________________________________________________________ - -Other interfaces to PHP - - Regardless of how you run PHP, you can change certain values at runtime - of your scripts through ini_set(). See the documentation on the - ini_set() page for more information. - - If you are interested in a complete list of configuration settings on - your system with their current values, you can execute the phpinfo() - function, and review the resulting page. You can also access the values - of individual configuration directives at runtime using ini_get() or - get_cfg_var(). - __________________________________________________________________ - -Chapter 6. Installation FAQ - - This section holds common questions about the way to install PHP. PHP - is available for almost any OS (except maybe for MacOS before OSX), and - almost any web server. - - To install PHP, follow the instructions in Installing PHP. - - 1. Why shouldn't I use Apache2 with a threaded MPM in a production - environment? - - 2. Unix/Windows: Where should my php.ini file be located? - 3. Unix: I installed PHP, but every time I load a document, I get the - message 'Document Contains No Data'! What's going on here? - - 4. Unix: I installed PHP using RPMS, but Apache isn't processing the - PHP pages! What's going on here? - - 5. Unix: I installed PHP 3 using RPMS, but it doesn't compile with the - database support I need! What's going on here? - - 6. Unix: I patched Apache with the FrontPage extensions patch, and - suddenly PHP stopped working. Is PHP incompatible with the - Apache FrontPage extensions? - - 7. Unix/Windows: I have installed PHP, but when I try to access a PHP - script file via my browser, I get a blank screen. - - 8. Unix/Windows: I have installed PHP, but when try to access a PHP - script file via my browser, I get a server 500 error. - - 9. Some operating systems: I have installed PHP without errors, but - when I try to start apache I get undefined symbol errors: - -[mybox:user /src/php4] root# apachectl configtest - apachectl: /usr/local/apache/bin/httpd Undefined symbols: - _compress - _uncompress - - 10. Windows: I have installed PHP, but when I to access a PHP script - file via my browser, I get the error: - -cgi error: - The specified CGI application misbehaved by not - returning a complete set of HTTP headers. - The headers it did return are: - - 11. Windows: I've followed all the instructions, but still can't get - PHP and IIS to work together! - - 12. When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get - the following error: Security Alert! PHP CGI cannot be accessed - directly.. - - 13. How do I know if my php.ini is being found and read? It seems like - it isn't as my changes aren't being implemented. - - 14. How do I add my PHP directory to the PATH on Windows? - 15. How do I make the php.ini file available to PHP on windows? - 16. Is it possible to use Apache content negotiation (MultiViews - option) with PHP? - - 17. Is PHP limited to process GET and POST request methods only? - - 1. Why shouldn't I use Apache2 with a threaded MPM in a production - environment? - - PHP is glue. It is the glue used to build cool web applications by - sticking dozens of 3rd-party libraries together and making it all - appear as one coherent entity through an intuitive and easy to learn - language interface. The flexibility and power of PHP relies on the - stability and robustness of the underlying platform. It needs a working - OS, a working web server and working 3rd-party libraries to glue - together. When any of these stop working PHP needs ways to identify the - problems and fix them quickly. When you make the underlying framework - more complex by not having completely separate execution threads, - completely separate memory segments and a strong sandbox for each - request to play in, feet of clay are introduced into PHP's system. - - If you feel you have to use a threaded MPM, look at a FastCGI - configuration where PHP is running in its own memory space. - - And finally, this warning against using a threaded MPM is not as strong - for Windows systems because most libraries on that platform tend to be - threadsafe. - - 2. Unix/Windows: Where should my php.ini file be located? - - By default on Unix it should be in /usr/local/lib which is - /lib. Most people will want to change this at - compile-time with the --with-config-file-path flag. You would, for - example, set it with something like: - --with-config-file-path=/etc - - And then you would copy php.ini-dist from the distribution to - /etc/php.ini and edit it to make any local changes you want. - --with-config-file-scan-dir=PATH - - On Windows the default path for the php.ini file is the Windows - directory. If you're using the Apache webserver, php.ini is first - searched in the Apaches install directory, e.g. c:\program files\apache - group\apache. This way you can have different php.ini files for - different versions of Apache on the same machine. - - See also the chapter about the configuration file. - - 3. Unix: I installed PHP, but every time I load a document, I get the - message 'Document Contains No Data'! What's going on here? - - This probably means that PHP is having some sort of problem and is - core-dumping. Look in your server error log to see if this is the case, - and then try to reproduce the problem with a small test case. If you - know how to use 'gdb', it is very helpful when you can provide a - backtrace with your bug report to help the developers pinpoint the - problem. If you are using PHP as an Apache module try something like: - - * Stop your httpd processes - * gdb httpd - * Stop your httpd processes - * > run -X -f /path/to/httpd.conf - * Then fetch the URL causing the problem with your browser - * > run -X -f /path/to/httpd.conf - * If you are getting a core dump, gdb should inform you of this now - * type: bt - * You should include your backtrace in your bug report. This should - be submitted to http://bugs.php.net/ - - If your script uses the regular expression functions (ereg() and - friends), you should make sure that you compiled PHP and Apache with - the same regular expression package. This should happen automatically - with PHP and Apache 1.3.x - - 4. Unix: I installed PHP using RPMS, but Apache isn't processing the - PHP pages! What's going on here? - - Assuming you installed both Apache and PHP from RPM packages, you need - to uncomment or add some or all of the following lines in your - httpd.conf file: -# Extra Modules -AddModule mod_php.c -AddModule mod_php3.c -AddModule mod_perl.c - -# Extra Modules -LoadModule php_module modules/mod_php.so -LoadModule php3_module modules/libphp3.so # for PHP 3 -LoadModule php4_module modules/libphp4.so # for PHP 4 -LoadModule perl_module modules/libperl.so - - And add: -AddType application/x-httpd-php3 .php3 # for PHP 3 -AddType application/x-httpd-php .php # for PHP 4 - - ... to the global properties, or to the properties of the VirtualDomain - you want to have PHP support added to. - - 5. Unix: I installed PHP 3 using RPMS, but it doesn't compile with the - database support I need! What's going on here? - - Due to the way PHP 3 built, it is not easy to build a complete flexible - PHP RPM. This issue is addressed in PHP 4. For PHP 3, we currently - suggest you use the mechanism described in the INSTALL.REDHAT file in - the PHP distribution. If you insist on using an RPM version of PHP 3, - read on... - - The RPM packagers are setting up the RPMS to install without database - support to simplify installations and because RPMS use /usr/ instead of - the standard /usr/local/ directory for files. You need to tell the RPM - spec file which databases to support and the location of the top-level - of your database server. - - This example will explain the process of adding support for the popular - MySQL database server, using the mod installation for Apache. - - Of course all of this information can be adjusted for any database - server that PHP supports. We will assume you installed MySQL and Apache - completely with RPMS for this example as well. - - * First remove mod_php3 : - -rpm -e mod_php3 - - * Then get the source rpm and INSTALL it, NOT --rebuild - -rpm -Uvh mod_php3-3.0.5-2.src.rpm - - * Then edit the /usr/src/redhat/SPECS/mod_php3.spec file - In the %build section add the database support you want, and the - path. - For MySQL you would add --with-mysql=/usr The %build section will - look something like this: - -./configure --prefix=/usr \ ---with-apxs=/usr/sbin/apxs \ ---with-config-file-path=/usr/lib \ ---enable-debug=no \ ---enable-safe-mode \ ---with-exec-dir=/usr/bin \ ---with-mysql=/usr \ ---with-system-regex - - * Once this modification is made then build the binary rpm as - follows: - -rpm -bb /usr/src/redhat/SPECS/mod_php3.spec - - * Then install the rpm - -rpm -ivh /usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm - - Make sure you restart Apache, and you now have PHP 3 with MySQL support - using RPM's. Note that it is probably much easier to just build from - the distribution tarball of PHP 3 and follow the instructions in - INSTALL.REDHAT found in that distribution. - - 6. Unix: I patched Apache with the FrontPage extensions patch, and - suddenly PHP stopped working. Is PHP incompatible with the Apache - FrontPage extensions? - - No, PHP works fine with the FrontPage extensions. The problem is that - the FrontPage patch modifies several Apache structures, that PHP relies - on. Recompiling PHP (using 'make clean ; make') after the FP patch is - applied would solve the problem. - - 7. Unix/Windows: I have installed PHP, but when I try to access a PHP - script file via my browser, I get a blank screen. - - Do a 'view source' in the web browser and you will probably find that - you can see the source code of your PHP script. This means that the web - server did not send the script to PHP for interpretation. Something is - wrong with the server configuration - double check the server - configuration against the PHP installation instructions. - - 8. Unix/Windows: I have installed PHP, but when try to access a PHP - script file via my browser, I get a server 500 error. - - Something went wrong when the server tried to run PHP. To get to see a - sensible error message, from the command line, change to the directory - containing the PHP executable (php.exe on Windows) and run php -i. If - PHP has any problems running, then a suitable error message will be - displayed which will give you a clue as to what needs to be done next. - If you get a screen full of HTML codes (the output of the phpinfo() - function) then PHP is working, and your problem may be related to your - server configuration which you should double check. - - 9. Some operating systems: I have installed PHP without errors, but - when I try to start apache I get undefined symbol errors: -[mybox:user /src/php4] root# apachectl configtest - apachectl: /usr/local/apache/bin/httpd Undefined symbols: - _compress - _uncompress - - This has actually nothing to do with PHP, but with the MySQL client - libraries. Some need --with-zlib, others do not. This is also covered - in the MySQL FAQ. - - 10. Windows: I have installed PHP, but when I to access a PHP script - file via my browser, I get the error: -cgi error: - The specified CGI application misbehaved by not - returning a complete set of HTTP headers. - The headers it did return are: - - This error message means that PHP failed to output anything at all. To - get to see a sensible error message, from the command line, change to - the directory containing the PHP executable (php.exe on Windows) and - run php -i. If PHP has any problems running, then a suitable error - message will be displayed which will give you a clue as to what needs - to be done next. If you get a screen full of HTML codes (the output of - the phpinfo() function) then PHP is working. - - Once PHP is working at the command line, try accessing the script via - the browser again. If it still fails then it could be one of the - following: - - * File permissions on your PHP script, php.exe, php4ts.dll, php.ini - or any PHP extensions you are trying to load are such that the - anonymous internet user ISUR_ cannot access them. - * The script file does not exist (or possibly isn't where you think - it is relative to your web root directory). Note that for IIS you - can trap this error by ticking the 'check file exists' box when - setting up the script mappings in the Internet Services Manager. If - a script file does not exist then the server will return a 404 - error instead. There is also the additional benefit that IIS will - do any authentication required for you based on the NTLanMan - permissions on your script file. - - 11. Windows: I've followed all the instructions, but still can't get - PHP and IIS to work together! - - Make sure any user who needs to run a PHP script has the rights to run - php.exe! IIS uses an anonymous user which is added at the time IIS is - installed. This user needs rights to php.exe. Also, any authenticated - user will also need rights to execute php.exe. And for IIS4 you need to - tell it that PHP is a script engine. Also, you will want to read this - faq. - - 12. When running PHP as CGI with IIS, PWS, OmniHTTPD or Xitami, I get - the following error: Security Alert! PHP CGI cannot be accessed - directly.. - - You must set the cgi.force_redirect directive to 0. It defaults to 1 so - be sure the directive isn't commented out (with a ;). Like all - directives, this is set in php.ini - - Because the default is 1, it's critical that you're 100% sure that the - correct php.ini file is being read. Read this faq for details. - - 13. How do I know if my php.ini is being found and read? It seems like - it isn't as my changes aren't being implemented. - - To be sure your php.ini is being read by PHP, make a call to phpinfo() - and near the top will be a listing called Configuration File (php.ini). - This will tell you where PHP is looking for php.ini and whether or not - it's being read. If just a directory PATH exists than it's not being - read and you should put your php.ini in that directory. If php.ini is - included within the PATH than it is being read. - - If php.ini is being read and you're running PHP as a module, then be - sure to restart your web server after making changes to php.ini - - 14. How do I add my PHP directory to the PATH on Windows? - - On Windows NT, 2000, XP and 2003: - - * Go to Control Panel and open the System icon (Start -> Settings -> - Control Panel -> System, or just Start -> Control Panel -> System - for Windows XP/2003) - * Go to the Advanced tab - * Click on the 'Environment Variables' button - * Look into the 'System Variables' pane - * Find the Path entry (you may need to scroll to find it) - * Double click on the Path entry - * Enter your PHP directory at the end, including ';' before (e.g. - ;C:\php) - * Press OK and restart your computer - - On Windows 98/Me you need to edit the autoexec.bat file: - - * Open the Notepad (Start -> Run and enter notepad) - * Open the C:\autoexec.bat file - * Locate the line with PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;..... and - add: ;C:\php to the end of the line - * Save the file and restart your computer - - Note: Be sure to reboot after following the steps above to ensure - that the PATH changes are applied. - - The PHP manual used to promote the copying of files into the Windows - system directory, this is because this directory (C:\Windows, C:\WINNT, - etc.) is by default in the systems PATH. Copying files into the Windows - system directory has long since been deprecated and may cause problems. - - 15. How do I make the php.ini file available to PHP on windows? - - There are several ways of doing this. If you are using Apache, read - their installation specific instructions (Apache 1, Apache 2), - otherwise you must set the PHPRC environment variable: - - On Windows NT, 2000, XP and 2003: - - * Go to Control Panel and open the System icon (Start -> Settings -> - Control Panel -> System, or just Start -> Control Panel -> System - for Windows XP/2003) - * Go to the Advanced tab - * Click on the 'Environment Variables' button - * Look into the 'System variables' pane - * Click on 'New' and enter 'PHPRC' as the variable name and the - directory where php.ini is located as the variable value (e.g. - C:\php) - * Press OK and restart your computer - - On Windows 98/Me you need to edit the autoexec.bat file: - - * Open the Notepad (Start -> Run and enter notepad) - * Open the C:\autoexec.bat file - * Add a new line to the end of the file: set PHPRC=C:\php (replace - C:\php with the directory where php.ini is located). Please note - that the path cannot contain spaces. For instance, if you have - installed PHP in C:\Program Files\PHP, you would enter - C:\PROGRA~1\PHP instead. - * Save the file and restart your computer - - 16. Is it possible to use Apache content negotiation (MultiViews - option) with PHP? - - If links to PHP files include extension, everything works perfect. This - FAQ is only for the case when links to PHP files don't include - extension and you want to use content negotiation to choose PHP files - from URL with no extension. In this case, replace the line AddType - application/x-httpd-php .php with: -# PHP 4 -AddHandler php-script php -AddType text/html php - -# PHP 5 -AddHandler php5-script php -AddType text/html php - - This solution doesn't work for Apache 1 as PHP module doesn't catch - php-script. - - 17. Is PHP limited to process GET and POST request methods only? - - No, it is possible to handle any request method, e.g. CONNECT. Proper - response status can be sent with header(). If only GET and POST methods - should be handled, it can be achieved with this Apache configuration: - -Deny from all - diff --git a/win32/md5crypt.c b/win32/md5crypt.c deleted file mode 100644 index 0f47a97337890..0000000000000 --- a/win32/md5crypt.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Edin Kadribasic | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- - * - * from FreeBSD: crypt.c,v 1.5 1996/10/14 08:34:02 phk Exp - * via OpenBSD: md5crypt.c,v 1.9 1997/07/23 20:58:27 kstailey Exp - * via NetBSD: md5crypt.c,v 1.4.2.1 2002/01/22 19:31:59 he Exp - * - */ - -#include "php.h" -#include "ext/standard/md5.h" -#include "md5crypt.h" - -static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ - "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - -static void to64(char *, php_uint32, int); - -static void -to64(char *s, php_uint32 v, int n) -{ - - while (--n >= 0) { - *s++ = itoa64[v & 0x3f]; - v >>= 6; - } -} - -/* - * MD5 password encryption. - */ -char * -md5_crypt(const char *pw, const char *salt) -{ - static char passwd[120], *p; - const char *sp, *ep; - unsigned char final[16]; - unsigned int i, sl, pwl; - PHP_MD5_CTX ctx, ctx1; - php_uint32 l; - int pl; - - pwl = strlen(pw); - - /* Refine the salt first */ - sp = salt; - - /* If it starts with the magic string, then skip that */ - if (strncmp(sp, MD5_MAGIC, MD5_MAGIC_LEN) == 0) - sp += MD5_MAGIC_LEN; - - /* It stops at the first '$', max 8 chars */ - for (ep = sp; *ep != '\0' && *ep != '$' && ep < (sp + 8); ep++) - continue; - - /* get the length of the true salt */ - sl = ep - sp; - - PHP_MD5Init(&ctx); - - /* The password first, since that is what is most unknown */ - PHP_MD5Update(&ctx, (const unsigned char *)pw, pwl); - - /* Then our magic string */ - PHP_MD5Update(&ctx, (const unsigned char *)MD5_MAGIC, MD5_MAGIC_LEN); - - /* Then the raw salt */ - PHP_MD5Update(&ctx, (const unsigned char *)sp, sl); - - /* Then just as many characters of the MD5(pw,salt,pw) */ - PHP_MD5Init(&ctx1); - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - PHP_MD5Update(&ctx1, (const unsigned char *)sp, sl); - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - PHP_MD5Final(final, &ctx1); - - for (pl = pwl; pl > 0; pl -= 16) - PHP_MD5Update(&ctx, final, (unsigned int)(pl > 16 ? 16 : pl)); - - /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); - - /* Then something really weird... */ - for (i = pwl; i != 0; i >>= 1) - if ((i & 1) != 0) - PHP_MD5Update(&ctx, final, 1); - else - PHP_MD5Update(&ctx, (const unsigned char *)pw, 1); - - /* Now make the output string */ - memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN); - strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1); - strcat(passwd, "$"); - - PHP_MD5Final(final, &ctx); - - /* - * And now, just to make sure things don't run too fast. On a 60 MHz - * Pentium this takes 34 msec, so you would need 30 seconds to build - * a 1000 entry dictionary... - */ - for (i = 0; i < 1000; i++) { - PHP_MD5Init(&ctx1); - - if ((i & 1) != 0) - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - else - PHP_MD5Update(&ctx1, final, 16); - - if ((i % 3) != 0) - PHP_MD5Update(&ctx1, (const unsigned char *)sp, sl); - - if ((i % 7) != 0) - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - - if ((i & 1) != 0) - PHP_MD5Update(&ctx1, final, 16); - else - PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl); - - PHP_MD5Final(final, &ctx1); - } - - p = passwd + sl + MD5_MAGIC_LEN + 1; - - l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p,l,4); p += 4; - l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p,l,4); p += 4; - l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p,l,4); p += 4; - l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p,l,4); p += 4; - l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p,l,4); p += 4; - l = final[11] ; to64(p,l,2); p += 2; - *p = '\0'; - - /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); - return (passwd); -} - diff --git a/win32/md5crypt.h b/win32/md5crypt.h deleted file mode 100644 index 4fc9428206f9e..0000000000000 --- a/win32/md5crypt.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Edin Kadribasic | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ -#ifndef _MD5CRYPT_H_ -#define _MD5CRYPT_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define MD5_MAGIC "$1$" -#define MD5_MAGIC_LEN 3 - -char *md5_crypt(const char *pw, const char *salt); - -#ifdef __cplusplus -} -#endif - -#endif /* _MD5CRYPT_H_ */ \ No newline at end of file diff --git a/win32/param.h b/win32/param.h deleted file mode 100644 index 3d0da1e8d3bc8..0000000000000 --- a/win32/param.h +++ /dev/null @@ -1,16 +0,0 @@ - -/***************************************************************************** - * * - * sys/param.c * - * * - * Freely redistributable and modifiable. Use at your own risk. * - * * - * Copyright 1994 The Downhill Project * - * * - *****************************************************************************/ -#ifndef MAXPATHLEN -#define MAXPATHLEN _MAX_PATH -#endif -#define MAXHOSTNAMELEN 64 -#define howmany(x,y) (((x)+((y)-1))/(y)) -#define roundup(x,y) ((((x)+((y)-1))/(y))*(y)) diff --git a/win32/php5.dsp b/win32/php5.dsp deleted file mode 100644 index 0b5b9a6d6b0d1..0000000000000 --- a/win32/php5.dsp +++ /dev/null @@ -1,134 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=php5 - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5.mak" CFG="php5 - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5 - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "php5 - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "php5 - Win32 Release_inline" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5 - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release" -# PROP Intermediate_Dir "..\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 php5nts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php.exe" /libpath:"..\Release" - -!ELSEIF "$(CFG)" == "php5 - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "c:\php-fcgi" -# PROP Intermediate_Dir "..\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "DEBUG" /D "_DEBUG" /D "_CONSOLE" /D "MSVC5" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5nts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"c:\php-fcgi\php.exe" /pdbtype:sept /libpath:"..\Debug" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "php5 - Win32 Release_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5___Win32_Release_inline" -# PROP BASE Intermediate_Dir "php5___Win32_Release_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_inline" -# PROP Intermediate_Dir "..\Release_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex\\" /I "..\bindlib_w32" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5nts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release\php.exe" /libpath:"Release" -# ADD LINK32 php5nts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php.exe" /libpath:"..\Release_inline" - -!ENDIF - -# Begin Target - -# Name "php5 - Win32 Release" -# Name "php5 - Win32 Debug" -# Name "php5 - Win32 Release_inline" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\sapi\cgi\cgi_main.c -# End Source File -# Begin Source File - -SOURCE=..\sapi\cgi\getopt.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# End Group -# End Target -# End Project diff --git a/win32/php5.dsw b/win32/php5.dsw deleted file mode 100644 index d6efc98ee2398..0000000000000 --- a/win32/php5.dsw +++ /dev/null @@ -1,107 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "Zend"=..\Zend\Zend.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Project: "fastcgi"=..\sapi\fastcgi\fastcgi.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dll - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency -}}} - -############################################################################### - -Project: "php5"=.\php5.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dll - End Project Dependency - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Project: "php5dll"=.\php5dll.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name Zend - End Project Dependency - Begin Project Dependency - Project_Dep_Name libmysql - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/php5dll.dsp b/win32/php5dll.dsp deleted file mode 100644 index 24e4227a04bcd..0000000000000 --- a/win32/php5dll.dsp +++ /dev/null @@ -1,1671 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5dll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5dll - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5dll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5dll.mak" CFG="php5dll - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dll - Win32 Release_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "c:\php-fcgi\" -# PROP Intermediate_Dir "..\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D "MSVC5" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib TSRM.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"c:\php-fcgi\php5nts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug" /libpath:"..\Zend\Debug" /libpath:"..\..\bindlib_w32\Debug" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release" -# PROP Intermediate_Dir "..\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLL_EXPORTS" /D "PHP_EXPORTS" /D "SAPI_EXPORTS" /D "LIBZEND_EXPORTS" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib tsrm.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php5nts.dll" /libpath:"..\Zend\Release" /libpath:"..\TSRM\Release_TS" /libpath:"..\..\bindlib_w32\Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5dll___Win32_Release_inline" -# PROP BASE Intermediate_Dir "php5dll___Win32_Release_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_inline" -# PROP Intermediate_Dir "..\Release_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex" /I "..\bindlib_w32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "MSVC5" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D ZEND_DEBUG=0 /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/php5nts.dll" /libpath:"TSRM\Release" /libpath:"Zend\Release" /libpath:"..\bindlib_w32\Release" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib tsrm.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php5nts.dll" /libpath:"..\Zend\Release_inline" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\..\bindlib_w32\Release" - -!ENDIF - -# Begin Target - -# Name "php5dll - Win32 Debug" -# Name "php5dll - Win32 Release" -# Name "php5dll - Win32 Release_inline" -# Begin Group "Core" - -# PROP Default_Filter "" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\css.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\cyr_convert.c -# End Source File -# Begin Source File - -SOURCE="..\main\fopen_wrappers.c" -# End Source File -# Begin Source File - -SOURCE=..\main\internal_functions_win32.c -# End Source File -# Begin Source File - -SOURCE=..\main\main.c -# End Source File -# Begin Source File - -SOURCE=..\main\mergesort.c -# End Source File -# Begin Source File - -SOURCE=..\main\network.c -# End Source File -# Begin Source File - -SOURCE=..\main\output.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_content_types.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_ini.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_logos.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_open_temporary_file.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_ticks.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_variables.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\proc_open.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\quot_print.c -# End Source File -# Begin Source File - -SOURCE=..\main\reentrancy.c -# End Source File -# Begin Source File - -SOURCE=..\main\rfc1867.c -# End Source File -# Begin Source File - -SOURCE=..\main\safe_mode.c -# End Source File -# Begin Source File - -SOURCE=..\main\SAPI.c -# End Source File -# Begin Source File - -SOURCE=..\main\snprintf.c -# End Source File -# Begin Source File - -SOURCE=..\main\spprintf.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams.c -# End Source File -# Begin Source File - -SOURCE=..\main\memory_streams.c -# End Source File -# Begin Source File - -SOURCE=..\main\user_streams.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\filters.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\user_filters.c -# End Source File -# Begin Source File - -SOURCE=..\main\strlcat.c -# End Source File -# Begin Source File - -SOURCE=..\main\strlcpy.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\config.w32.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\css.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\cyr_convert.h -# End Source File -# Begin Source File - -SOURCE=..\main\getopt.h -# End Source File -# Begin Source File - -SOURCE=..\main\logos.h -# End Source File -# Begin Source File - -SOURCE=..\main\main.h -# End Source File -# Begin Source File - -SOURCE=..\main\output.h -# End Source File -# Begin Source File - -SOURCE=..\main\php.h -# End Source File -# Begin Source File - -SOURCE=..\main\php3_compat.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_content_types.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_globals.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_ini.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_logos.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_open_temporary_file.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_realpath.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_ticks.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_variables.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\quot_print.h -# End Source File -# Begin Source File - -SOURCE=..\main\rfc1867.h -# End Source File -# Begin Source File - -SOURCE=..\main\safe_mode.h -# End Source File -# Begin Source File - -SOURCE=..\main\SAPI.h -# End Source File -# Begin Source File - -SOURCE=..\main\snprintf.h -# End Source File -# Begin Source File - -SOURCE=..\main\spprintf.h -# End Source File -# Begin Source File - -SOURCE=..\main\win95nt.h -# End Source File -# End Group -# End Group -# Begin Group "Function Modules" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\array.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\assert.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\base64.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\basic_functions.c -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\bcmath.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\browscap.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\crc32.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\credits.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\datetime.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dir.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dl.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dns.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\exec.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\file.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\filestat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\flock_compat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\formatted_print.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\fsock.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\ftp_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\head.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\html.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\http_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\image.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\incomplete_class.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\info.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\iptc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\lcg.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\levenshtein.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\link.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\mail.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\math.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\md5.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\metaphone.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\microtime.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_files.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_user.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pack.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pageinfo.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\php_pcre.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\rand.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\reg.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\scanf.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\session.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\soundex.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\string.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\strnatcmp.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\syslog.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\type.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uniqid.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner_ex.c -# ADD CPP /W2 -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\var.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\var_unserializer.c -# ADD CPP /W2 -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\versioning.c -# End Source File -# End Group -# Begin Group "Header Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\base64.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\basic_functions.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\datetime.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dl.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dns.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\exec.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\file.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\flock_compat.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\fsock.h -# End Source File -# Begin Source File - -SOURCE=..\functions\global.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\head.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\html.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\md5.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\mime.h -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_user.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pageinfo.h -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\php_bcmath.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_dir.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_filestat.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_fopen_wrappers.h -# End Source File -# Begin Source File - -SOURCE=..\ext\ldap\php_ldap.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_mail.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_metaphone.h -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc.h -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\php_pcre.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_string.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_syslog.h -# End Source File -# Begin Source File - -SOURCE=..\functions\phpdir.h -# End Source File -# Begin Source File - -SOURCE=..\functions\phpmath.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\reg.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\scanf.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\type.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uniqid.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner_ex.h -# End Source File -# End Group -# Begin Group "Regular Expressions" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\regex\regcomp.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regerror.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regexec.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regfree.c -# End Source File -# End Group -# Begin Group "PCRE" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 3" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\chartables.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\get.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\maketables.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\study.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# ADD CPP /D "STATIC" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files No. 3" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\internal.h -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre.h -# End Source File -# End Group -# End Group -# Begin Group "XML" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 4" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\ctype\ctype.c -# End Source File -# Begin Source File - -SOURCE=..\ext\overload\overload.c -# End Source File -# Begin Source File - -SOURCE=..\ext\tokenizer\tokenizer.c -# End Source File -# Begin Source File - -SOURCE=..\ext\wddx\wddx.c -# End Source File -# Begin Source File - -SOURCE=..\ext\xml\compat.c - -# End Source File -# Begin Source File - -SOURCE=..\ext\xml\xml.c -# End Source File -# End Group -# Begin Group "Header Files No. 4" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\xml\php_xml.h -# End Source File -# End Group -# End Group -# Begin Group "FTP" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 6" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\ftp\ftp.c -# End Source File -# Begin Source File - -SOURCE=..\ext\ftp\php_ftp.c -# End Source File -# End Group -# Begin Group "Header Files No. 6" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\ftp\ftp.h -# End Source File -# Begin Source File - -SOURCE=..\ext\ftp\php_ftp.h -# End Source File -# End Group -# End Group -# Begin Group "Calendar" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 7" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\calendar\cal_unix.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\calendar.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\dow.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\easter.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\french.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\gregor.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\jewish.c -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\julian.c -# End Source File -# End Group -# Begin Group "Header Files No. 7" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\calendar\php_calendar.h -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\sdncal.h -# End Source File -# End Group -# End Group -# Begin Group "bcmath" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 8" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\add.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\compare.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\debug.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\div.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\divmod.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\doaddsub.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\init.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\int2num.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\nearzero.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\neg.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\num2long.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\num2str.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\outofmem.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\output.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\raise.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\raisemod.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\recmul.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\rmzero.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\rt.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\sqrt.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\str2num.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\sub.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\zero.c - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files No. 8" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\bcmath.h - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\config.h - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\private.h - -!IF "$(CFG)" == "php5dll - Win32 Debug" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release" - -!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline" - -# PROP Intermediate_Dir "..\Release_inline_bcmath" - -!ENDIF - -# End Source File -# End Group -# End Group -# End Group -# Begin Group "Win32" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\com\COM.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com\conversion.c -# End Source File -# Begin Source File - -SOURCE=..\win32\readdir.c -# End Source File -# Begin Source File - -SOURCE=..\win32\registry.c -# End Source File -# Begin Source File - -SOURCE=..\win32\sendmail.c -# End Source File -# Begin Source File - -SOURCE=..\win32\time.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com\VARIANT.c -# End Source File -# Begin Source File - -SOURCE=..\win32\wfile.c -# End Source File -# Begin Source File - -SOURCE=..\ext\snmp\winsnmp.c -# End Source File -# Begin Source File - -SOURCE=..\win32\winutil.c -# End Source File -# Begin Source File - -SOURCE=..\win32\wsyslog.c -# End Source File -# End Group -# Begin Group "Header Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\com\com.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\conversion.h -# End Source File -# Begin Source File - -SOURCE=..\win32\grp.h -# End Source File -# Begin Source File - -SOURCE=..\win32\param.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\php_COM.h -# End Source File -# Begin Source File - -SOURCE=..\win32\php_registry.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\php_VARIANT.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\php_versioning.h -# End Source File -# Begin Source File - -SOURCE=..\win32\readdir.h -# End Source File -# Begin Source File - -SOURCE=..\win32\sendmail.h -# End Source File -# Begin Source File - -SOURCE=..\win32\syslog.h -# End Source File -# Begin Source File - -SOURCE=..\win32\time.h -# End Source File -# Begin Source File - -SOURCE=..\win32\unistd.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com\variant.h -# End Source File -# Begin Source File - -SOURCE=..\win32\wfile.h -# End Source File -# End Group -# End Group -# Begin Group "Text Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ChangeLog -# End Source File -# Begin Source File - -SOURCE=..\LICENSE -# End Source File -# End Group -# Begin Group "Support" - -# PROP Default_Filter "" -# End Target -# End Project diff --git a/win32/php5dllts.dsp b/win32/php5dllts.dsp deleted file mode 100644 index d9bf1882a166e..0000000000000 --- a/win32/php5dllts.dsp +++ /dev/null @@ -1,2747 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5dllts" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=php5dllts - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5dllts.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5dllts.mak" CFG="php5dllts - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5dllts - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dllts - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dllts - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "php5dllts - Win32 Release_TSDbg" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"msvcrt" /out:"..\Debug_TS\php5ts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug_TS" /libpath:"..\Zend\Debug_TS" /libpath:"..\..\bindlib_w32\Debug" /libpath:"Debug_TS" /libpath:"..\..\zlib\Debug" /libpath:"..\..\libxml\lib\Debug" /libpath:"..\ext\sqlite\Debug_TS" /libpath:"..\..\libiconv\lib" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"Release_TS" /libpath:"..\ext\sqlite\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5dllts___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5dllts___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "MSVC5" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"Release_TS/php5ts.dll" /libpath:"TSRM\Release_TS" /libpath:"Zend\Release_TS" /libpath:"..\bindlib_w32\Release" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS_inline\php5ts.dll" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\Zend\Release_TS_inline" /libpath:"Release_TS_Inline" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib" /libpath:"..\ext\sqlite\Release_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5dllts___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "php5dllts___Win32_Release_TSDbg" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"Release_TS" -# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TSDbg\php5ts.dll" /libpath:"..\TSRM\Release_TSDbg" /libpath:"..\Zend\Release_TSDbg" /libpath:"Release_TSDbg" /libpath:"..\ext\sqlite\Release_TSDbg" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib" - -!ENDIF - -# Begin Target - -# Name "php5dllts - Win32 Debug_TS" -# Name "php5dllts - Win32 Release_TS" -# Name "php5dllts - Win32 Release_TS_inline" -# Name "php5dllts - Win32 Release_TSDbg" -# Begin Group "Core" - -# PROP Default_Filter "" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\css.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\cyr_convert.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\filters.c -# End Source File -# Begin Source File - -SOURCE="..\main\fopen_wrappers.c" -# End Source File -# Begin Source File - -SOURCE=.\globals.c -# End Source File -# Begin Source File - -SOURCE=..\main\internal_functions_win32.c -# End Source File -# Begin Source File - -SOURCE=..\main\main.c -# End Source File -# Begin Source File - -SOURCE=..\main\mergesort.c -# End Source File -# Begin Source File - -SOURCE=..\main\network.c -# End Source File -# Begin Source File - -SOURCE=..\main\output.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_content_types.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_ini.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_logos.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_open_temporary_file.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_scandir.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_sprintf.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_ticks.c -# End Source File -# Begin Source File - -SOURCE=..\main\php_variables.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\proc_open.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\quot_print.c -# End Source File -# Begin Source File - -SOURCE=..\main\reentrancy.c -# End Source File -# Begin Source File - -SOURCE=..\main\rfc1867.c -# End Source File -# Begin Source File - -SOURCE=..\main\safe_mode.c -# End Source File -# Begin Source File - -SOURCE=..\main\SAPI.c -# End Source File -# Begin Source File - -SOURCE=..\main\snprintf.c -# End Source File -# Begin Source File - -SOURCE=..\main\spprintf.c -# End Source File -# Begin Source File - -SOURCE=..\main\strlcat.c -# End Source File -# Begin Source File - -SOURCE=..\main\strlcpy.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\main\config.w32.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\css.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\cyr_convert.h -# End Source File -# Begin Source File - -SOURCE="..\main\fopen_wrappers.h" -# End Source File -# Begin Source File - -SOURCE=..\main\getopt.h -# End Source File -# Begin Source File - -SOURCE=..\main\logos.h -# End Source File -# Begin Source File - -SOURCE=..\main\output.h -# End Source File -# Begin Source File - -SOURCE=..\main\php.h -# End Source File -# Begin Source File - -SOURCE=..\main\php3_compat.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_compat.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_content_types.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_globals.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_ini.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_logos.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_main.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_open_temporary_file.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_output.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_regex.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_scandir.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_streams.h -# End Source File -# Begin Source File - -SOURCE=..\main\php_variables.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\quot_print.h -# End Source File -# Begin Source File - -SOURCE=..\main\rfc1867.h -# End Source File -# Begin Source File - -SOURCE=..\main\safe_mode.h -# End Source File -# Begin Source File - -SOURCE=..\main\SAPI.h -# End Source File -# Begin Source File - -SOURCE=..\main\snprintf.h -# End Source File -# Begin Source File - -SOURCE=..\main\spprintf.h -# End Source File -# Begin Source File - -SOURCE=..\main\win95nt.h -# End Source File -# End Group -# End Group -# Begin Group "Function Modules" - -# PROP Default_Filter "" -# Begin Group "PCRE" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 3" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_chartables.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_compile.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_exec.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_fullinfo.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_get.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_globals.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_info.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_maketables.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_ord2utf8.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_study.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_tables.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_try_flipped.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_ucp_searchfuncs.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_valid_utf8.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_version.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_xclass.c -# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE" -# End Source File -# End Group -# Begin Group "Header Files No. 3" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\internal.h -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre.h -# End Source File -# End Group -# End Group -# Begin Group "DOM" - -# PROP Default_Filter "" -# Begin Group "DOM Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\dom\attr.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\cdatasection.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\characterdata.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\comment.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\document.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\documentfragment.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\documenttype.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\dom_iterators.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domconfiguration.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domerror.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domerrorhandler.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domexception.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domimplementation.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domimplementationlist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domimplementationsource.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domlocator.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\domstringlist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\element.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\entity.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\entityreference.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\namednodemap.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\namelist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\node.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\nodelist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\notation.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\php_dom.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\processinginstruction.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\string_extend.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\text.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\typeinfo.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\userdatahandler.c -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\xpath.c -# End Source File -# End Group -# Begin Group "DOM Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\dom\dom_ce.h -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\dom_fe.h -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\dom_properties.h -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\php_dom.h -# End Source File -# Begin Source File - -SOURCE=..\ext\dom\xml_common.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Group -# Begin Group "SimpleXML" - -# PROP Default_Filter "" -# Begin Group "SimpleXML Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\simplexml\simplexml.c -# End Source File -# End Group -# Begin Group "SimpleXML Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\simplexml\php_simplexml.h -# End Source File -# End Group -# Begin Group "Resource Files No. 1" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Group -# Begin Group "Regular Expressions" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\regex\regcomp.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regerror.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regexec.c -# End Source File -# Begin Source File - -SOURCE=..\regex\regfree.c -# End Source File -# End Group -# Begin Group "XML" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 4" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\xml\compat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\ctype\ctype.c -# End Source File -# Begin Source File - -SOURCE=..\ext\tokenizer\tokenizer.c -# End Source File -# Begin Source File - -SOURCE=..\ext\wddx\wddx.c -# End Source File -# Begin Source File - -SOURCE=..\ext\xml\xml.c -# End Source File -# End Group -# Begin Group "Header Files No. 4" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\wddx\php_wddx.h -# End Source File -# Begin Source File - -SOURCE=..\ext\wddx\php_wddx_api.h -# End Source File -# Begin Source File - -SOURCE=..\ext\xml\php_xml.h -# End Source File -# End Group -# End Group -# Begin Group "FTP" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 6" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\ftp\ftp.c -# End Source File -# Begin Source File - -SOURCE=..\ext\ftp\php_ftp.c -# End Source File -# End Group -# Begin Group "Header Files No. 6" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\ftp\ftp.h -# End Source File -# Begin Source File - -SOURCE=..\ext\ftp\php_ftp.h -# End Source File -# End Group -# End Group -# Begin Group "Calendar" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 7" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\calendar\cal_unix.c -# PROP Intermediate_Dir "calendar" -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\calendar.c -# PROP Intermediate_Dir "calendar" -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\dow.c -# PROP Intermediate_Dir "calendar" -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\easter.c -# PROP Intermediate_Dir "calendar" -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\french.c -# PROP Intermediate_Dir "calendar" -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\gregor.c -# PROP Intermediate_Dir "calendar" -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\jewish.c -# PROP Intermediate_Dir "calendar" -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\julian.c -# PROP Intermediate_Dir "calendar" -# End Source File -# End Group -# Begin Group "Header Files No. 7" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\calendar\php_calendar.h -# End Source File -# Begin Source File - -SOURCE=..\ext\calendar\sdncal.h -# End Source File -# End Group -# End Group -# Begin Group "SPL" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 11" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\spl\php_spl.c -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_array.c -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_directory.c -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_engine.c -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_exceptions.c -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_functions.c -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_iterators.c -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_observer.c -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_sxe.c -# End Source File -# End Group -# Begin Group "Header Files No. 12" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\spl\php_spl.h -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_array.h -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_directory.h -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_engine.h -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_exceptions.h -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_functions.h -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_iterators.h -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_observer.h -# End Source File -# Begin Source File - -SOURCE=..\ext\spl\spl_sxe.h -# End Source File -# End Group -# End Group -# Begin Group "Reflection" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 12" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\reflection\php_reflection.c -# End Source File -# End Group -# Begin Group "Header Files No. 13" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\reflection\php_reflection.h -# End Source File -# End Group -# End Group -# Begin Group "XMLReader" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 13" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\xmlreader\php_xmlreader.c -# End Source File -# End Group -# Begin Group "Header Files No. 14" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\xmlreader\php_xmlreader.h -# End Source File -# End Group -# End Group -# Begin Group "XMLwriter" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 14" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\xmlwriter\php_xmlwriter.c -# End Source File -# End Group -# Begin Group "Header Files No. 15" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\xmlwriter\php_xmlwriter.h -# End Source File -# End Group -# End Group -# Begin Group "IConv" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 15" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\iconv\iconv.c -# ADD CPP /D "PHP_ICONV_EXPORTS" -# End Source File -# End Group -# Begin Group "Header Files No. 16" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\iconv\php_iconv.h -# End Source File -# End Group -# End Group -# Begin Group "bcmath" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 8" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\add.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\compare.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\debug.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\div.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\divmod.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\doaddsub.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\init.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\int2num.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\nearzero.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\neg.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\num2long.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\num2str.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\outofmem.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\output.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\raise.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\raisemod.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\recmul.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\rmzero.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\rt.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\sqrt.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\str2num.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\sub.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\zero.c - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src" -# ADD CPP /I "..\ext\bcmath\libbcmath\src" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files No. 8" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\bcmath.h - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\config.h - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\libbcmath\src\private.h - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" -# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS" - -!ENDIF - -# End Source File -# End Group -# End Group -# Begin Group "zlib" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 10 Nr. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\zlib\zlib.c -# End Source File -# Begin Source File - -SOURCE=..\ext\zlib\zlib_filter.c -# End Source File -# Begin Source File - -SOURCE=..\ext\zlib\zlib_fopen_wrapper.c -# End Source File -# End Group -# Begin Group "Header Files No. 10 Nr. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\zlib\php_zlib.h -# End Source File -# End Group -# End Group -# Begin Group "Standard" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\array.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\assert.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\base64.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\basic_functions.c -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\bcmath.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\browscap.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\crc32.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\credits.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\crypt.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\datetime.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dir.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dl.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dns.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\exec.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\file.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\filestat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\flock_compat.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\formatted_print.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\fsock.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\ftp_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\head.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\html.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\http.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\http_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\image.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\incomplete_class.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\info.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\iptc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\lcg.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\levenshtein.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\link.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\mail.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\math.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\md5.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\metaphone.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\microtime.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_files.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_user.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pack.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pageinfo.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\php_pcre.c -# ADD CPP /D "STATIC" -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\rand.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\reg.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\scanf.c -# End Source File -# Begin Source File - -SOURCE=..\ext\session\session.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\sha1.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\soundex.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\streamsfuncs.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\string.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\strnatcmp.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\syslog.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\type.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uniqid.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner_ex.c -# ADD CPP /W2 -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uuencode.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\var.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\var_unserializer.c -# ADD CPP /W2 -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\versioning.c -# End Source File -# End Group -# Begin Group "Header Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\standard\base64.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\basic_functions.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\datetime.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dl.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\dns.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\exec.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\file.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\flock_compat.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\fsock.h -# End Source File -# Begin Source File - -SOURCE=..\functions\global.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\head.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\html.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\info.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\md5.h -# End Source File -# Begin Source File - -SOURCE=..\ext\session\mod_user.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\pageinfo.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_array.h -# End Source File -# Begin Source File - -SOURCE=..\ext\bcmath\php_bcmath.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_crypt.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_dir.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_filestat.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_fopen_wrappers.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_http.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_lcg.h -# End Source File -# Begin Source File - -SOURCE=..\ext\ldap\php_ldap.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_mail.h -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc.h -# End Source File -# Begin Source File - -SOURCE=..\ext\odbc\php_odbc_includes.h -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\php_pcre.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_rand.h -# End Source File -# Begin Source File - -SOURCE=..\ext\session\php_session.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_string.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_sunfuncs.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\php_syslog.h -# End Source File -# Begin Source File - -SOURCE=..\functions\phpdir.h -# End Source File -# Begin Source File - -SOURCE=..\functions\phpmath.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\reg.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\scanf.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\sha1.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\type.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\uniqid.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner.h -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\url_scanner_ex.h -# End Source File -# End Group -# End Group -# Begin Group "SQLite" - -# PROP Default_Filter "" -# Begin Group "Header Files No. 5" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\sqlite\php_sqlite.h -# End Source File -# End Group -# Begin Group "Source Files No. 5" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\sqlite\sess_sqlite.c -# End Source File -# Begin Source File - -SOURCE=..\ext\sqlite\sqlite.c -# End Source File -# End Group -# End Group -# Begin Group "LIBXML" - -# PROP Default_Filter "" -# Begin Group "Header Files No. 10" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\libxml\php_libxml.h -# End Source File -# End Group -# Begin Group "Source Files No. 9" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\libxml\libxml.c -# End Source File -# End Group -# End Group -# Begin Group "Date" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 10" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\date\lib\astro.c -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\dow.c -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\parse_date.c -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\parse_tz.c -# End Source File -# Begin Source File - -SOURCE=..\ext\date\php_date.c -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\timelib.c -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\timelib_config.h.win32 - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -# Begin Custom Build -InputDir=\Projects\php-5.2\ext\date\lib -InputPath=..\ext\date\lib\timelib_config.h.win32 - -"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\timelib_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -# Begin Custom Build -InputDir=\Projects\php-5.2\ext\date\lib -InputPath=..\ext\date\lib\timelib_config.h.win32 - -"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\timelib_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -# Begin Custom Build -InputDir=\Projects\php-5.2\ext\date\lib -InputPath=..\ext\date\lib\timelib_config.h.win32 - -"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\timelib_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# Begin Custom Build -InputDir=\Projects\php-5.2\ext\date\lib -InputPath=..\ext\date\lib\timelib_config.h.win32 - -"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputPath) $(InputDir)\timelib_config.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\tm2unixtime.c -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\unixtime2tm.c -# End Source File -# End Group -# Begin Group "Header Files No. 11" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\date\lib\astro.h -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\fallbackmap.h -# End Source File -# Begin Source File - -SOURCE=..\ext\date\php_date.h -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\timelib.h -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\timezonedb.h -# End Source File -# Begin Source File - -SOURCE=..\ext\date\lib\timezonemap.h -# End Source File -# End Group -# End Group -# End Group -# Begin Group "Win32" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\crypt_win32.c -# End Source File -# Begin Source File - -SOURCE=.\glob.c -# End Source File -# Begin Source File - -SOURCE=.\md5crypt.c -# End Source File -# Begin Source File - -SOURCE=..\win32\readdir.c -# End Source File -# Begin Source File - -SOURCE=..\win32\registry.c -# End Source File -# Begin Source File - -SOURCE=.\select.c -# End Source File -# Begin Source File - -SOURCE=..\win32\sendmail.c -# End Source File -# Begin Source File - -SOURCE=..\win32\time.c -# End Source File -# Begin Source File - -SOURCE=..\win32\wfile.c -# End Source File -# Begin Source File - -SOURCE=..\ext\snmp\winsnmp.c -# End Source File -# Begin Source File - -SOURCE=..\win32\winutil.c -# End Source File -# Begin Source File - -SOURCE=..\win32\wsyslog.c -# End Source File -# Begin Source File - -SOURCE=.\build\wsyslog.mc - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -# Begin Custom Build -InputDir=.\build -IntDir=.\Release_TSDbg -InputPath=.\build\wsyslog.mc - -"wsyslog.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - mc -h $(InputDir)/.. -r $(InputDir) -x $(IntDir) $(InputPath) - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\crypt_win32.h -# End Source File -# Begin Source File - -SOURCE=.\glob.h -# End Source File -# Begin Source File - -SOURCE=..\win32\grp.h -# End Source File -# Begin Source File - -SOURCE=..\win32\param.h -# End Source File -# Begin Source File - -SOURCE=..\win32\php_registry.h -# End Source File -# Begin Source File - -SOURCE=..\win32\readdir.h -# End Source File -# Begin Source File - -SOURCE=.\select.h -# End Source File -# Begin Source File - -SOURCE=..\win32\sendmail.h -# End Source File -# Begin Source File - -SOURCE=..\win32\syslog.h -# End Source File -# Begin Source File - -SOURCE=..\win32\time.h -# End Source File -# Begin Source File - -SOURCE=..\win32\unistd.h -# End Source File -# Begin Source File - -SOURCE=..\win32\wfile.h -# End Source File -# Begin Source File - -SOURCE=.\winutil.h -# End Source File -# End Group -# End Group -# Begin Group "Text Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ChangeLog -# End Source File -# Begin Source File - -SOURCE=..\LICENSE -# End Source File -# Begin Source File - -SOURCE=..\NEWS -# End Source File -# Begin Source File - -SOURCE="..\php.ini-dist" -# End Source File -# Begin Source File - -SOURCE="..\php.ini-recommended" -# End Source File -# Begin Source File - -SOURCE="..\README.CVS-RULES" -# End Source File -# Begin Source File - -SOURCE=..\TODO -# End Source File -# End Group -# Begin Group "Support" - -# PROP Default_Filter "" -# End Group -# Begin Group "Streams" - -# PROP Default_Filter "" -# Begin Group "streams headers" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\main\streams\php_stream_context.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_filter_api.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_mmap.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_plain_wrapper.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_transport.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_stream_userspace.h -# End Source File -# Begin Source File - -SOURCE=..\main\streams\php_streams_int.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\main\streams\cast.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\filter.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\memory.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\mmap.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\plain_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\streams.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\transports.c -# End Source File -# Begin Source File - -SOURCE=..\ext\standard\user_filters.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\userspace.c -# End Source File -# Begin Source File - -SOURCE=..\main\streams\xp_socket.c -# End Source File -# End Group -# Begin Group "COM and DotNet" - -# PROP Default_Filter "" -# Begin Group "Header Files No. 9" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_saproxy.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_wrapper.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\php_com_dotnet.h -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\php_com_dotnet_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_com.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_dotnet.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_extension.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_handlers.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_iterator.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_misc.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_olechar.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_persist.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_typeinfo.c -# End Source File -# Begin Source File - -SOURCE=..\ext\com_dotnet\com_variant.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\php5dllts.rc -# End Source File -# Begin Source File - -SOURCE=.\php5dllts.rc2 -# End Source File -# Begin Source File - -SOURCE=.\phpts.def - -!IF "$(CFG)" == "php5dllts - Win32 Debug_TS" - -USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def" -# Begin Custom Build - Generating $(InputPath) -InputPath=.\phpts.def - -"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - builddef.bat > phpts.def - -# End Custom Build - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS" - -USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def" -# Begin Custom Build - Generating $(InputPath) -InputPath=.\phpts.def - -"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - builddef.bat > phpts.def - -# End Custom Build - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline" - -USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def" -# Begin Custom Build - Generating $(InputPath) -InputPath=.\phpts.def - -"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - builddef.bat > phpts.def - -# End Custom Build - -!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg" - -USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def" -# Begin Custom Build - Generating $(InputPath) -InputPath=.\phpts.def - -"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - builddef.bat > phpts.def - -# End Custom Build - -!ENDIF - -# End Source File -# End Target -# End Project diff --git a/win32/php5dllts.rc b/win32/php5dllts.rc deleted file mode 100644 index 2e01037eee342..0000000000000 --- a/win32/php5dllts.rc +++ /dev/null @@ -1,126 +0,0 @@ -//Microsoft Developer Studio generated resource script. - -// - -#include "resource.h" - - - -#define APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 2 resource. - -// - -#include "winres.h" - - - -///////////////////////////////////////////////////////////////////////////// - -#undef APSTUDIO_READONLY_SYMBOLS - - - -///////////////////////////////////////////////////////////////////////////// - -// English (U.S.) resources - - - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) - -#ifdef _WIN32 - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#pragma code_page(1252) - -#endif //_WIN32 - - - -#ifdef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// TEXTINCLUDE - -// - - - -1 TEXTINCLUDE DISCARDABLE - -BEGIN - - "resource.h\0" - -END - - - -2 TEXTINCLUDE DISCARDABLE - -BEGIN - - "#include ""php5dllts.rc2""\r\n" - - "\0" - -END - - - -3 TEXTINCLUDE DISCARDABLE - -BEGIN - - "\r\n" - - "\0" - -END - - - -#endif // APSTUDIO_INVOKED - - - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - - - - - - - -#ifndef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 3 resource. - -// - -#include "php5dllts.rc2" - - - -///////////////////////////////////////////////////////////////////////////// - -#endif // not APSTUDIO_INVOKED - - - diff --git a/win32/php5dllts.rc2 b/win32/php5dllts.rc2 deleted file mode 100644 index b05f0af0dcb3f..0000000000000 --- a/win32/php5dllts.rc2 +++ /dev/null @@ -1,61 +0,0 @@ -// -// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... -#include "../main/php_version.h" - -#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build -#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel -#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build) -#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel) - -#ifndef _MAC -//Version -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "The PHP Group\0" - VALUE "FileDescription", "PHP Script Interpreter\0" - VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION) - VALUE "InternalName", "php\0" - VALUE "LegalCopyright", "Copyright © 1997-2007 The PHP Group\0" - VALUE "LegalTrademarks", "php\0" - VALUE "OriginalFilename", "php5ts.dll\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "PHP Thread Safe\0" - VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) - VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0" - VALUE "URL", "http://www.php.net" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -///////////////////////////////////////////////////////////////////////////// diff --git a/win32/php5ts.dsp b/win32/php5ts.dsp deleted file mode 100644 index 3736815127d18..0000000000000 --- a/win32/php5ts.dsp +++ /dev/null @@ -1,191 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5ts" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=php5ts - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5ts.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5ts.mak" CFG="php5ts - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5ts - Win32 Release_TS" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts - Win32 Debug_TS" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts - Win32 Release_TS_inline" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts - Win32 Release_TSDbg" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5ts - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 php5ts.lib winmm.lib ws2_32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS" - -!ELSEIF "$(CFG)" == "php5ts - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "DEBUG" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winmm.lib netapi32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"..\Debug_TS/php.exe" /pdbtype:sept /libpath:"..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "php5ts - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5ts___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"Release_TS" -# ADD LINK32 php5ts.lib winmm.lib ws2_32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS_inline\php.exe" /libpath:"..\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5ts - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5ts___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TSDbg" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS" -# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TSDbg\php.exe" /libpath:"..\Release_TSDbg" - -!ENDIF - -# Begin Target - -# Name "php5ts - Win32 Release_TS" -# Name "php5ts - Win32 Debug_TS" -# Name "php5ts - Win32 Release_TS_inline" -# Name "php5ts - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\sapi\cgi\cgi_main.c -# End Source File -# Begin Source File - -SOURCE=..\sapi\cgi\fastcgi.c -# End Source File -# Begin Source File - -SOURCE=..\sapi\cgi\getopt.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\sapi\cgi\php_getopt.h -# End Source File -# End Group -# Begin Group "libfcgi" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\sapi\cgi\libfcgi\fcgiapp.c -# End Source File -# Begin Source File - -SOURCE=..\sapi\cgi\libfcgi\os_win32.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\php5ts.rc -# End Source File -# Begin Source File - -SOURCE=.\php5ts.rc2 -# End Source File -# End Target -# End Project diff --git a/win32/php5ts.dsw b/win32/php5ts.dsw deleted file mode 100644 index 61ccd1c24bccf..0000000000000 --- a/win32/php5ts.dsw +++ /dev/null @@ -1,227 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "EngineSelect"=.\EngineSelect.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ZendTS"=..\Zend\ZendTS.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency - Begin Project Dependency - Project_Dep_Name EngineSelect - End Project Dependency -}}} - -############################################################################### - -Project: "libsqlite"=..\ext\sqlite\libsqlite\src\libsqlite.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "php5aolserver"=..\sapi\aolserver\php5aolserver.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5apache"=..\sapi\apache\php5apache.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5apache2"=..\SAPI\APACHE2HANDLER\php5apache2.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5dllts"=.\php5dllts.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name ZendTS - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency - Begin Project Dependency - Project_Dep_Name libsqlite - End Project Dependency -}}} - -############################################################################### - -Project: "php5isapi"=..\sapi\isapi\php5isapi.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5nsapi"=..\sapi\nsapi\php5nsapi.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5pi3web"=..\sapi\pi3web\php5pi3web.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5ts"=.\php5ts.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "php5ts_cli"=.\php5ts_cli.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5dllts - End Project Dependency -}}} - -############################################################################### - -Project: "testsuite"=.\testsuite.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name php5ts - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/php5ts.rc b/win32/php5ts.rc deleted file mode 100644 index d9a4aa541b1e5..0000000000000 --- a/win32/php5ts.rc +++ /dev/null @@ -1,126 +0,0 @@ -//Microsoft Developer Studio generated resource script. - -// - -#include "resource.h" - - - -#define APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 2 resource. - -// - -#include "winres.h" - - - -///////////////////////////////////////////////////////////////////////////// - -#undef APSTUDIO_READONLY_SYMBOLS - - - -///////////////////////////////////////////////////////////////////////////// - -// English (U.S.) resources - - - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) - -#ifdef _WIN32 - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#pragma code_page(1252) - -#endif //_WIN32 - - - -#ifdef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// TEXTINCLUDE - -// - - - -1 TEXTINCLUDE DISCARDABLE - -BEGIN - - "resource.h\0" - -END - - - -2 TEXTINCLUDE DISCARDABLE - -BEGIN - - "#include ""php5ts.rc2""\r\n" - - "\0" - -END - - - -3 TEXTINCLUDE DISCARDABLE - -BEGIN - - "\r\n" - - "\0" - -END - - - -#endif // APSTUDIO_INVOKED - - - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - - - - - - - -#ifndef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 3 resource. - -// - -#include "php5ts.rc2" - - - -///////////////////////////////////////////////////////////////////////////// - -#endif // not APSTUDIO_INVOKED - - - diff --git a/win32/php5ts.rc2 b/win32/php5ts.rc2 deleted file mode 100644 index 3a53a900ec3ec..0000000000000 --- a/win32/php5ts.rc2 +++ /dev/null @@ -1,61 +0,0 @@ -// -// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... -#include "../main/php_version.h" - -#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build -#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel -#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build) -#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel) - -#ifndef _MAC -//Version -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "The PHP Group\0" - VALUE "FileDescription", "PHP Script Interpreter\0" - VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION) - VALUE "InternalName", "php-cgi\0" - VALUE "LegalCopyright", "Copyright © 1997-2007 The PHP Group\0" - VALUE "LegalTrademarks", "php\0" - VALUE "OriginalFilename", "php.exe\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "PHP Thread Safe CGI\0" - VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) - VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0" - VALUE "URL", "http://www.php.net" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -///////////////////////////////////////////////////////////////////////////// diff --git a/win32/php5ts_cli.dsp b/win32/php5ts_cli.dsp deleted file mode 100644 index 37a4113ad4ec5..0000000000000 --- a/win32/php5ts_cli.dsp +++ /dev/null @@ -1,175 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php5ts_cli" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=php5ts_cli - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "php5ts_cli.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "php5ts_cli.mak" CFG="php5ts_cli - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "php5ts_cli - Win32 Release_TS" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts_cli - Win32 Debug_TS" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts_cli - Win32 Release_TS_inline" (based on "Win32 (x86) Console Application") -!MESSAGE "php5ts_cli - Win32 Release_TSDbg" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "php5ts_cli - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\cli\php.exe" /libpath:"..\Release_TS" - -!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "DEBUG" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winmm.lib netapi32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"..\Debug_TS\cli\php.exe" /pdbtype:sept /libpath:"..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5ts___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TS_inline" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"Release_TS" -# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS_inline\cli\php.exe" /libpath:"..\Release_TS_inline" - -!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "php5ts___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TSDbg" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS" -# ADD LINK32 php5ts.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TSDbg\php.exe" /libpath:"..\Release_TSDbg" - -!ENDIF - -# Begin Target - -# Name "php5ts_cli - Win32 Release_TS" -# Name "php5ts_cli - Win32 Debug_TS" -# Name "php5ts_cli - Win32 Release_TS_inline" -# Name "php5ts_cli - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=..\sapi\cli\getopt.c -# End Source File -# Begin Source File - -SOURCE=..\sapi\cli\php_cli.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\sapi\cli\php_getopt.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\php5ts_cli.rc -# End Source File -# Begin Source File - -SOURCE=.\php5ts_cli.rc2 -# End Source File -# End Target -# End Project diff --git a/win32/php5ts_cli.rc b/win32/php5ts_cli.rc deleted file mode 100644 index 0053e0c7f2b21..0000000000000 --- a/win32/php5ts_cli.rc +++ /dev/null @@ -1,126 +0,0 @@ -//Microsoft Developer Studio generated resource script. - -// - -#include "resource.h" - - - -#define APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 2 resource. - -// - -#include "winres.h" - - - -///////////////////////////////////////////////////////////////////////////// - -#undef APSTUDIO_READONLY_SYMBOLS - - - -///////////////////////////////////////////////////////////////////////////// - -// English (U.S.) resources - - - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) - -#ifdef _WIN32 - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#pragma code_page(1252) - -#endif //_WIN32 - - - -#ifdef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// TEXTINCLUDE - -// - - - -1 TEXTINCLUDE DISCARDABLE - -BEGIN - - "resource.h\0" - -END - - - -2 TEXTINCLUDE DISCARDABLE - -BEGIN - - "#include ""php5ts_cli.rc2""\r\n" - - "\0" - -END - - - -3 TEXTINCLUDE DISCARDABLE - -BEGIN - - "\r\n" - - "\0" - -END - - - -#endif // APSTUDIO_INVOKED - - - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - - - - - - - -#ifndef APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// - -// - -// Generated from the TEXTINCLUDE 3 resource. - -// - -#include "php5ts_cli.rc2" - - - -///////////////////////////////////////////////////////////////////////////// - -#endif // not APSTUDIO_INVOKED - - - diff --git a/win32/php5ts_cli.rc2 b/win32/php5ts_cli.rc2 deleted file mode 100644 index ef51813a42ab4..0000000000000 --- a/win32/php5ts_cli.rc2 +++ /dev/null @@ -1,61 +0,0 @@ -// -// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED - #error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... -#include "../main/php_version.h" - -#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build -#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel -#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build) -#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel) - -#ifndef _MAC -//Version -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "The PHP Group\0" - VALUE "FileDescription", "PHP Script Interpreter\0" - VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION) - VALUE "InternalName", "php-cli\0" - VALUE "LegalCopyright", "Copyright © 1997-2007 The PHP Group\0" - VALUE "LegalTrademarks", "php\0" - VALUE "OriginalFilename", "php.exe\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "PHP Thread Safe Command Line Interface\0" - VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) - VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0" - VALUE "URL", "http://www.php.net" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -///////////////////////////////////////////////////////////////////////////// diff --git a/win32/php_modules.dsw b/win32/php_modules.dsw deleted file mode 100644 index 81f22fa44f2fb..0000000000000 --- a/win32/php_modules.dsw +++ /dev/null @@ -1,473 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "bz2"=..\ext\bz2\bz2.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ctype"=..\ext\ctype\ctype.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "curl"=..\ext\curl\curl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "dba"=..\ext\dba\dba.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "dbase"=..\ext\dbase\dbase.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "dbx"=..\ext\dbx\dbx.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "exif"=..\ext\exif\exif.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "fbsql"=..\ext\fbsql\fbsql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "fdf"=..\ext\fdf\fdf.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "filepro"=..\ext\filepro\filepro.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "gd"=..\ext\gd\gd.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "gettext"=..\ext\gettext\gettext.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "iconv"=..\ext\iconv\iconv.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ifx"=..\ext\informix\ifx.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "imap"=..\ext\imap\imap.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ingres"=..\ext\ingres_ii\ingres.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "interbase"=..\ext\interbase\interbase.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ldap"=..\ext\ldap\ldap.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mbstring"=..\ext\mbstring\mbstring.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mcrypt"=..\ext\mcrypt\mcrypt.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mcve"=..\ext\mcve\mcve.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mhash"=..\ext\mhash\mhash.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mime_magic"=..\ext\mime_magic\mime_magic.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "ming"=..\ext\ming\ming.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "msql"=..\ext\msql\msql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mssql"=..\ext\mssql\mssql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "mysql"=..\ext\mysql\mysql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "oci8"=..\ext\oci8\oci8.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "openssl"=..\ext\openssl\openssl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "oracle"=..\ext\oracle\oracle.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "pgsql"=..\ext\pgsql\pgsql.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "shmop"=..\ext\shmop\shmop.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "snmp"=..\ext\snmp\snmp.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "sockets"=..\ext\sockets\sockets.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "sybase_ct"=..\ext\sybase_ct\sybase_ct.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "tokenizer"=..\ext\tokenizer\tokenizer.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "xmlrpc"=..\ext\xmlrpc\xmlrpc.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "xsl"=..\ext\xsl\xsl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/win32/php_registry.h b/win32/php_registry.h deleted file mode 100644 index 2b111dbb8b25c..0000000000000 --- a/win32/php_registry.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef PHP_REGISTRY_H -#define PHP_REGISTRY_H - - -void UpdateIniFromRegistry(char *path TSRMLS_DC); -char *GetIniPathFromRegistry(); - -#endif /* PHP_REGISTRY_H */ diff --git a/win32/php_win32_globals.h b/win32/php_win32_globals.h deleted file mode 100755 index df1250d9df33f..0000000000000 --- a/win32/php_win32_globals.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_WIN32_GLOBALS_H -#define PHP_WIN32_GLOBALS_H - -/* misc globals for thread-safety under win32 */ - -typedef struct _php_win32_core_globals php_win32_core_globals; - -#ifdef ZTS -# define PW32G(v) TSRMG(php_win32_core_globals_id, php_win32_core_globals*, v) -extern PHPAPI int php_win32_core_globals_id; -#else -# define PW32G(v) (the_php_win32_core_globals.v) -extern PHPAPI struct _php_win32_core_globals the_php_win32_core_globals; -#endif - -struct _php_win32_core_globals { - /* syslog */ - char *log_header; - HANDLE log_source; - - /* time */ - struct timeval starttime; - __int64 lasttime, freq; - - HKEY registry_key; - HANDLE registry_event; - HashTable *registry_directories; -}; - -void php_win32_core_globals_ctor(void *vg TSRMLS_DC); -void php_win32_core_globals_dtor(void *vg TSRMLS_DC); -PHP_RSHUTDOWN_FUNCTION(win32_core_globals); - -#endif - diff --git a/win32/pws-php5cgi.reg b/win32/pws-php5cgi.reg deleted file mode 100644 index 46edc77386496..0000000000000 --- a/win32/pws-php5cgi.reg +++ /dev/null @@ -1,6 +0,0 @@ -REGEDIT4 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] -".php"="[PUT PATH HERE]\\php.exe" - - diff --git a/win32/pws-php5isapi.reg b/win32/pws-php5isapi.reg deleted file mode 100644 index 393604d28deed..0000000000000 --- a/win32/pws-php5isapi.reg +++ /dev/null @@ -1,5 +0,0 @@ -REGEDIT4 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] -".php"="[PUT PATH HERE]\\php5isapi.dll" - diff --git a/win32/readdir.c b/win32/readdir.c deleted file mode 100644 index 67bb8ee739e80..0000000000000 --- a/win32/readdir.c +++ /dev/null @@ -1,148 +0,0 @@ -#include -#include -#include - -#include "php.h" -#include "readdir.h" - -/********************************************************************** - * Implement dirent-style opendir/readdir/rewinddir/closedir on Win32 - * - * Functions defined are opendir(), readdir(), rewinddir() and - * closedir() with the same prototypes as the normal dirent.h - * implementation. - * - * Does not implement telldir(), seekdir(), or scandir(). The dirent - * struct is compatible with Unix, except that d_ino is always 1 and - * d_off is made up as we go along. - * - * The DIR typedef is not compatible with Unix. - **********************************************************************/ - -DIR *opendir(const char *dir) -{ - DIR *dp; - char *filespec; - HANDLE handle; - int index; - - filespec = (char *)malloc(strlen(dir) + 2 + 1); - strcpy(filespec, dir); - index = strlen(filespec) - 1; - if (index >= 0 && (filespec[index] == '/' || - (filespec[index] == '\\' && (index == 0 || !IsDBCSLeadByte(filespec[index-1]))))) - filespec[index] = '\0'; - strcat(filespec, "/*"); - - dp = (DIR *) malloc(sizeof(DIR)); - dp->offset = 0; - dp->finished = 0; - - if ((handle = FindFirstFile(filespec, &(dp->fileinfo))) == INVALID_HANDLE_VALUE) { - DWORD err = GetLastError(); - if (err == ERROR_NO_MORE_FILES) { - dp->finished = 1; - } else { - free(dp); - free(filespec); - return NULL; - } - } - dp->dir = strdup(dir); - dp->handle = handle; - free(filespec); - - return dp; -} - -struct dirent *readdir(DIR *dp) -{ - if (!dp || dp->finished) - return NULL; - - if (dp->offset != 0) { - if (FindNextFile(dp->handle, &(dp->fileinfo)) == 0) { - dp->finished = 1; - return NULL; - } - } - dp->offset++; - - strlcpy(dp->dent.d_name, dp->fileinfo.cFileName, _MAX_FNAME+1); - dp->dent.d_ino = 1; - dp->dent.d_reclen = strlen(dp->dent.d_name); - dp->dent.d_off = dp->offset; - - return &(dp->dent); -} - -int readdir_r(DIR *dp, struct dirent *entry, struct dirent **result) -{ - if (!dp || dp->finished) { - *result = NULL; - return 0; - } - - if (dp->offset != 0) { - if (FindNextFile(dp->handle, &(dp->fileinfo)) == 0) { - dp->finished = 1; - *result = NULL; - return 0; - } - } - dp->offset++; - - strlcpy(dp->dent.d_name, dp->fileinfo.cFileName, _MAX_FNAME+1); - dp->dent.d_ino = 1; - dp->dent.d_reclen = strlen(dp->dent.d_name); - dp->dent.d_off = dp->offset; - - memcpy(entry, &dp->dent, sizeof(*entry)); - - *result = &dp->dent; - - return 0; -} - -int closedir(DIR *dp) -{ - if (!dp) - return 0; - FindClose(dp->handle); - if (dp->dir) - free(dp->dir); - if (dp) - free(dp); - - return 0; -} - -int rewinddir(DIR *dp) -{ - /* Re-set to the beginning */ - char *filespec; - HANDLE handle; - int index; - - FindClose(dp->handle); - - dp->offset = 0; - dp->finished = 0; - - filespec = (char *)malloc(strlen(dp->dir) + 2 + 1); - strcpy(filespec, dp->dir); - index = strlen(filespec) - 1; - if (index >= 0 && (filespec[index] == '/' || - (filespec[index] == '\\' && (index == 0 || !IsDBCSLeadByte(filespec[index-1]))))) - filespec[index] = '\0'; - strcat(filespec, "/*"); - - if ((handle = FindFirstFile(filespec, &(dp->fileinfo))) == INVALID_HANDLE_VALUE) { - dp->finished = 1; - } - - dp->handle = handle; - free(filespec); - - return 0; -} diff --git a/win32/readdir.h b/win32/readdir.h deleted file mode 100644 index f2a0191b756a8..0000000000000 --- a/win32/readdir.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef READDIR_H -#define READDIR_H - - -/* - * Structures and types used to implement opendir/readdir/closedir - * on Windows 95/NT. - */ - -#define _WIN32_WINNT 0x0400 - -#include - -#include -#include -#include -#include -#include - -#define php_readdir_r readdir_r - -/* struct dirent - same as Unix */ - -struct dirent { - long d_ino; /* inode (always 1 in WIN32) */ - off_t d_off; /* offset to this dirent */ - unsigned short d_reclen; /* length of d_name */ - char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */ -}; - - -/* typedef DIR - not the same as Unix */ -typedef struct { - HANDLE handle; /* _findfirst/_findnext handle */ - short offset; /* offset into directory */ - short finished; /* 1 if there are not more files */ - WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */ - char *dir; /* the dir we are reading */ - struct dirent dent; /* the dirent to return */ -} DIR; - -/* Function prototypes */ -DIR *opendir(const char *); -struct dirent *readdir(DIR *); -int readdir_r(DIR *, struct dirent *, struct dirent **); -int closedir(DIR *); -int rewinddir(DIR *); - -#endif /* READDIR_H */ diff --git a/win32/registry.c b/win32/registry.c deleted file mode 100644 index cdeb85f21d4e3..0000000000000 --- a/win32/registry.c +++ /dev/null @@ -1,283 +0,0 @@ -#include "php.h" -#include "php_ini.h" -#include "php_win32_globals.h" - -#define PHP_REGISTRY_KEY "SOFTWARE\\PHP" - -#define PHP_VER1(V1) #V1 -#define PHP_VER2(V1,V2) #V1"."#V2 -#define PHP_VER3(V1,V2,V3) #V1"."#V2"."#V3 - -#define PHP_REGISTRY_KEYV(VER) PHP_REGISTRY_KEY"\\"VER -#define PHP_REGISTRY_KEY1(V1) PHP_REGISTRY_KEY"\\"PHP_VER1(V1) -#define PHP_REGISTRY_KEY2(V1,V2) PHP_REGISTRY_KEY"\\"PHP_VER2(V1,V2) -#define PHP_REGISTRY_KEY3(V1,V2,V3) PHP_REGISTRY_KEY"\\"PHP_VER3(V1,V2,V3) - -static const char* registry_keys[] = { - PHP_REGISTRY_KEYV(PHP_VERSION), - PHP_REGISTRY_KEY3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION), - PHP_REGISTRY_KEY2(PHP_MAJOR_VERSION, PHP_MINOR_VERSION), - PHP_REGISTRY_KEY1(PHP_MAJOR_VERSION), - PHP_REGISTRY_KEY, - NULL -}; - -static int OpenPhpRegistryKey(char* sub_key, HKEY *hKey) -{ - const char **key_name = registry_keys; - - if (sub_key) { - int main_key_len; - int sub_key_len = strlen(sub_key); - char *reg_key; - - while (*key_name) { - LONG ret; - - main_key_len = strlen(*key_name); - reg_key = emalloc(main_key_len + sub_key_len + 1); - memcpy(reg_key, *key_name, main_key_len); - memcpy(reg_key + main_key_len, sub_key, sub_key_len + 1); - ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_key, 0, KEY_READ, hKey); - efree(reg_key); - - if (ret == ERROR_SUCCESS) { - return 1; - } - ++key_name; - } - } else { - while (*key_name) { - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, *key_name, 0, KEY_READ, hKey) == ERROR_SUCCESS) { - return 1; - } - ++key_name; - } - } - return 0; -} - -static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_len, HashTable *parent_ht) -{ - DWORD keys, values, max_key, max_name, max_value; - int ret = 0; - HashTable *ht = NULL; - - if (RegQueryInfoKey(key, NULL, NULL, NULL, &keys, &max_key, NULL, &values, &max_name, &max_value, NULL, NULL) == ERROR_SUCCESS) { - - if (values) { - DWORD i; - char *name = (char*)emalloc(max_name+1); - char *value = (char*)emalloc(max_value+1); - DWORD name_len, type, value_len; - zval *data; - - for (i = 0; i < values; i++) { - name_len = max_name+1; - value_len = max_value+1; - if (RegEnumValue(key, i, name, &name_len, NULL, &type, value, &value_len) == ERROR_SUCCESS) { - if ((type == REG_SZ) || (type == REG_EXPAND_SZ)) { - if (!ht) { - ht = (HashTable*)malloc(sizeof(HashTable)); - zend_hash_init(ht, 0, NULL, ZVAL_INTERNAL_PTR_DTOR, 1); - } - data = (zval*)malloc(sizeof(zval)); - INIT_PZVAL(data); - Z_STRVAL_P(data) = zend_strndup(value, value_len-1); - Z_STRLEN_P(data) = value_len-1; - zend_hash_update(ht, name, name_len+1, &data, sizeof(zval*), NULL); - } - } - } - if (ht) { - if (parent_ht) { - HashPosition pos; - char *index; - uint index_len; - ulong num; - zval **data; - - for (zend_hash_internal_pointer_reset_ex(parent_ht, &pos); - zend_hash_get_current_data_ex(parent_ht, (void**)&data, &pos) == SUCCESS && - zend_hash_get_current_key_ex(parent_ht, &index, &index_len, &num, 0, &pos) == HASH_KEY_IS_STRING; - zend_hash_move_forward_ex(parent_ht, &pos)) { - if (zend_hash_add(ht, index, index_len, data, sizeof(zval*), NULL) == SUCCESS) { - (*data)->refcount++; - } - } - } - zend_hash_update(directories, path, path_len+1, &ht, sizeof(HashTable*), NULL); - ret = 1; - } - - efree(name); - efree(value); - } - - if (ht == NULL) { - ht = parent_ht; - } - - if (keys) { - DWORD i; - char *name = (char*)emalloc(max_key+1); - char *new_path = (char*)emalloc(path_len+max_key+2); - DWORD name_len; - FILETIME t; - HKEY subkey; - - for (i = 0; i < keys; i++) { - name_len = max_key+1; - if (RegEnumKeyEx(key, i, name, &name_len, NULL, NULL, NULL, &t) == ERROR_SUCCESS) { - if (RegOpenKeyEx(key, name, 0, KEY_READ, &subkey) == ERROR_SUCCESS) { - if (path_len) { - memcpy(new_path, path, path_len); - new_path[path_len] = '/'; - memcpy(new_path+path_len+1, name, name_len+1); - zend_str_tolower(new_path, path_len+name_len+1); - name_len += path_len+1; - } else { - memcpy(new_path, name, name_len+1); - zend_str_tolower(new_path, name_len); - } - if (LoadDirectory(directories, subkey, new_path, name_len, ht)) { - ret = 1; - } - RegCloseKey(subkey); - } - } - } - efree(new_path); - efree(name); - } - } - return ret; -} - -static void delete_internal_hashtable(void *data) -{ - zend_hash_destroy(*(HashTable**)data); - free(*(HashTable**)data); -} - -#define RegNotifyFlags (REG_NOTIFY_CHANGE_NAME | REG_NOTIFY_CHANGE_ATTRIBUTES | REG_NOTIFY_CHANGE_LAST_SET) - -void UpdateIniFromRegistry(char *path TSRMLS_DC) -{ - char *p, *orig_path; - int path_len; - HashTable **pht; - - if (!PW32G(registry_directories)) { - PW32G(registry_directories) = (HashTable*)malloc(sizeof(HashTable)); - zend_hash_init(PW32G(registry_directories), 0, NULL, delete_internal_hashtable, 1); - if (!OpenPhpRegistryKey("\\Per Directory Values", &PW32G(registry_key))) { - PW32G(registry_key) = NULL; - return; - } - PW32G(registry_event) = CreateEvent(NULL, TRUE, FALSE, NULL); - if (PW32G(registry_event)) { - RegNotifyChangeKeyValue(PW32G(registry_key), TRUE, RegNotifyFlags, PW32G(registry_event), TRUE); - } - if (!LoadDirectory(PW32G(registry_directories), PW32G(registry_key), "", 0, NULL)) { - return; - } - } else if (PW32G(registry_event) && WaitForSingleObject(PW32G(registry_event), 0) == WAIT_OBJECT_0) { - RegNotifyChangeKeyValue(PW32G(registry_key), TRUE, RegNotifyFlags, PW32G(registry_event), TRUE); - zend_hash_clean(PW32G(registry_directories)); - if (!LoadDirectory(PW32G(registry_directories), PW32G(registry_key), "", 0, NULL)) { - return; - } - } else if (zend_hash_num_elements(PW32G(registry_directories)) == 0) { - return; - } - - orig_path = path = estrdup(path); - - /* Get rid of C:, if exists */ - p = strchr(path, ':'); - if (p) { - *p = path[0]; /* replace the colon with the drive letter */ - path = p; /* make path point to the drive letter */ - } else { - if (path[0] != '\\' && path[0] != '/') { - char tmp_buf[MAXPATHLEN], *cwd; - char drive_letter; - - /* get current working directory and prepend it to the path */ - if (!VCWD_GETCWD(tmp_buf, MAXPATHLEN)) { - efree(orig_path); - return; - } - cwd = strchr(tmp_buf, ':'); - if (!cwd) { - drive_letter = 'C'; - cwd = tmp_buf; - } else { - drive_letter = tmp_buf[0]; - cwd++; - } - while (*cwd == '\\' || *cwd == '/') { - cwd++; - } - spprintf(&path, 0, "%c\\%s\\%s", drive_letter, cwd, orig_path); - efree(orig_path); - orig_path = path; - } - } - - path_len = 0; - while (path[path_len] != 0) { - if (path[path_len] == '\\') { - path[path_len] = '/'; - } - path_len++; - } - zend_str_tolower(path, path_len); - while (path_len >= 0) { - if (zend_hash_find(PW32G(registry_directories), path, path_len+1, (void**)&pht) == SUCCESS) { - HashTable *ht = *pht; - HashPosition pos; - char *index; - uint index_len; - ulong num; - zval **data; - - for (zend_hash_internal_pointer_reset_ex(ht, &pos); - zend_hash_get_current_data_ex(ht, (void**)&data, &pos) == SUCCESS && - zend_hash_get_current_key_ex(ht, &index, &index_len, &num, 0, &pos) == HASH_KEY_IS_STRING; - zend_hash_move_forward_ex(ht, &pos)) { - zend_alter_ini_entry(index, index_len, Z_STRVAL_PP(data), Z_STRLEN_PP(data), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - } - break; - } - if (--path_len > 0) { - while (path_len > 0 && path[path_len] != '/') { - path_len--; - } - } - path[path_len] = 0; - } - - efree(orig_path); -} - -#define PHPRC_REGISTRY_NAME "IniFilePath" - -char *GetIniPathFromRegistry() -{ - char *reg_location = NULL; - HKEY hKey; - - if (OpenPhpRegistryKey(NULL, &hKey)) { - DWORD buflen = MAXPATHLEN; - reg_location = emalloc(MAXPATHLEN+1); - if(RegQueryValueEx(hKey, PHPRC_REGISTRY_NAME, 0, NULL, reg_location, &buflen) != ERROR_SUCCESS) { - efree(reg_location); - reg_location = NULL; - return reg_location; - } - RegCloseKey(hKey); - } - return reg_location; -} diff --git a/win32/resource.h b/win32/resource.h deleted file mode 100644 index 3e7e4c0ed1eec..0000000000000 --- a/win32/resource.h +++ /dev/null @@ -1,15 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by php5dllts.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/win32/select.c b/win32/select.c deleted file mode 100644 index e86cbf0b17f4f..0000000000000 --- a/win32/select.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -#include "php.h" -#include "php_network.h" - -#ifdef PHP_WIN32 - -/* $Id$ */ - -/* Win32 select() will only work with sockets, so we roll our own implementation here. - * - If you supply only sockets, this simply passes through to winsock select(). - * - If you supply file handles, there is no way to distinguish between - * ready for read/write or OOB, so any set in which the handle is found will - * be marked as ready. - * - If you supply a mixture of handles and sockets, the system will interleave - * calls between select() and WaitForMultipleObjects(). The time slicing may - * cause this function call to take up to 100 ms longer than you specified. - * - Calling this with NULL sets as a portable way to sleep with sub-second - * accuracy is not supported. - * */ -PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv) -{ - DWORD ms_total, limit; - HANDLE handles[MAXIMUM_WAIT_OBJECTS]; - int handle_slot_to_fd[MAXIMUM_WAIT_OBJECTS]; - int n_handles = 0, i; - fd_set sock_read, sock_write, sock_except; - fd_set aread, awrite, aexcept; - int sock_max_fd = -1; - struct timeval tvslice; - int retcode; - -#define SAFE_FD_ISSET(fd, set) (set != NULL && FD_ISSET(fd, set)) - - /* calculate how long we need to wait in milliseconds */ - if (tv == NULL) { - ms_total = INFINITE; - } else { - ms_total = tv->tv_sec * 1000; - ms_total += tv->tv_usec / 1000; - } - - FD_ZERO(&sock_read); - FD_ZERO(&sock_write); - FD_ZERO(&sock_except); - - /* build an array of handles for non-sockets */ - for (i = 0; i < max_fd; i++) { - if (SAFE_FD_ISSET(i, rfds) || SAFE_FD_ISSET(i, wfds) || SAFE_FD_ISSET(i, efds)) { - handles[n_handles] = (HANDLE)(zend_uintptr_t)_get_osfhandle(i); - if (handles[n_handles] == INVALID_HANDLE_VALUE) { - /* socket */ - if (SAFE_FD_ISSET(i, rfds)) { - FD_SET((uint)i, &sock_read); - } - if (SAFE_FD_ISSET(i, wfds)) { - FD_SET((uint)i, &sock_write); - } - if (SAFE_FD_ISSET(i, efds)) { - FD_SET((uint)i, &sock_except); - } - if (i > sock_max_fd) { - sock_max_fd = i; - } - } else { - handle_slot_to_fd[n_handles] = i; - n_handles++; - } - } - } - - if (n_handles == 0) { - /* plain sockets only - let winsock handle the whole thing */ - return select(max_fd, rfds, wfds, efds, tv); - } - - /* mixture of handles and sockets; lets multiplex between - * winsock and waiting on the handles */ - - FD_ZERO(&aread); - FD_ZERO(&awrite); - FD_ZERO(&aexcept); - - limit = GetTickCount() + ms_total; - do { - retcode = 0; - - if (sock_max_fd >= 0) { - /* overwrite the zero'd sets here; the select call - * will clear those that are not active */ - aread = sock_read; - awrite = sock_write; - aexcept = sock_except; - - tvslice.tv_sec = 0; - tvslice.tv_usec = 100000; - - retcode = select(sock_max_fd+1, &aread, &awrite, &aexcept, &tvslice); - } - if (n_handles > 0) { - /* check handles */ - DWORD wret; - - wret = MsgWaitForMultipleObjects(n_handles, handles, FALSE, retcode > 0 ? 0 : 100, QS_ALLEVENTS); - - if (wret == WAIT_TIMEOUT) { - /* set retcode to 0; this is the default. - * select() may have set it to something else, - * in which case we leave it alone, so this branch - * does nothing */ - ; - } else if (wret == WAIT_FAILED) { - if (retcode == 0) { - retcode = -1; - } - } else { - if (retcode < 0) { - retcode = 0; - } - for (i = 0; i < n_handles; i++) { - if (WAIT_OBJECT_0 == WaitForSingleObject(handles[i], 0)) { - if (SAFE_FD_ISSET(handle_slot_to_fd[i], rfds)) { - FD_SET((uint)handle_slot_to_fd[i], &aread); - } - if (SAFE_FD_ISSET(handle_slot_to_fd[i], wfds)) { - FD_SET((uint)handle_slot_to_fd[i], &awrite); - } - if (SAFE_FD_ISSET(handle_slot_to_fd[i], efds)) { - FD_SET((uint)handle_slot_to_fd[i], &aexcept); - } - retcode++; - } - } - } - } - } while (retcode == 0 && (ms_total == INFINITE || GetTickCount() < limit)); - - if (rfds) { - *rfds = aread; - } - if (wfds) { - *wfds = awrite; - } - if (efds) { - *efds = aexcept; - } - - return retcode; -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/win32/select.h b/win32/select.h deleted file mode 100644 index b26d1f998d1ad..0000000000000 --- a/win32/select.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv); - diff --git a/win32/sendmail.c b/win32/sendmail.c deleted file mode 100644 index 85af4d923f11a..0000000000000 --- a/win32/sendmail.c +++ /dev/null @@ -1,924 +0,0 @@ -/* - * PHP Sendmail for Windows. - * - * This file is rewriten specificly for PHPFI. Some functionality - * has been removed (MIME and file attachments). This code was - * modified from code based on code writen by Jarle Aase. - * - * This class is based on the original code by Jarle Aase, see bellow: - * wSendmail.cpp It has been striped of some functionality to match - * the requirements of phpfi. - * - * Very simple SMTP Send-mail program for sending command-line level - * emails and CGI-BIN form response for the Windows platform. - * - * The complete wSendmail package with source code can be located - * from http://www.jgaa.com - * - */ - -/* $Id$ */ - -#include "php.h" /*php specific */ -#include -#include -#ifndef NETWARE -#include -#include "time.h" -#else /* NETWARE */ -#include -#endif /* NETWARE */ -#include -#include -#ifndef NETWARE -#include -#include -#include -#endif /* NETWARE */ -#include "sendmail.h" -#include "php_ini.h" - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE -#include "ext/pcre/php_pcre.h" -#endif - -#include "ext/standard/php_string.h" -#include "ext/date/php_date.h" - -/*enum - { - DO_CONNECT = WM_USER +1 - }; - */ - -/* '*error_message' has to be passed around from php_mail() */ -#define SMTP_ERROR_RESPONSE_SPEC "SMTP server response: %s" -/* Convinient way to handle error messages from the SMTP server. - response is ecalloc()d in Ack() itself and efree()d here - because the content is in *error_message now */ -#define SMTP_ERROR_RESPONSE(response) { \ - if (response && error_message) { \ - if (NULL != (*error_message = ecalloc(1, sizeof(SMTP_ERROR_RESPONSE_SPEC) + strlen(response)))) { \ - snprintf(*error_message, sizeof(SMTP_ERROR_RESPONSE_SPEC) + strlen(response), SMTP_ERROR_RESPONSE_SPEC, response); \ - } \ - efree(response); \ - } \ - } -#define SMTP_SKIP_SPACE(str) { while (isspace(*str)) { str++; } } - - -#ifndef THREAD_SAFE -char Buffer[MAIL_BUFFER_SIZE]; - -/* socket related data */ -SOCKET sc; -#ifndef NETWARE -WSADATA Data; -struct hostent *adr; -int WinsockStarted; -/* values set by the constructor */ -char *AppName; -#endif /* NETWARE */ -SOCKADDR_IN sock_in; -char MailHost[HOST_NAME_LEN]; -char LocalHost[HOST_NAME_LEN]; -#endif -char seps[] = " ,\t\n"; -#ifndef NETWARE -char *php_mailer = "PHP 5 WIN32"; -#else -char *php_mailer = "PHP 5 NetWare"; -#endif /* NETWARE */ - -/* Error messages */ -static char *ErrorMessages[] = -{ - {"Success"}, /* 0 */ - {"Bad arguments from form"}, /* 1 */ - {"Unable to open temporary mailfile for read"}, - {"Failed to Start Sockets"}, - {"Failed to Resolve Host"}, - {"Failed to obtain socket handle"}, /* 5 */ - {"Failed to connect to mailserver, verify your \"SMTP\" setting in php.ini"}, - {"Failed to Send"}, - {"Failed to Receive"}, - {"Server Error"}, - {"Failed to resolve the host IP name"}, /* 10 */ - {"Out of memory"}, - {"Unknown error"}, - {"Bad Message Contents"}, - {"Bad Message Subject"}, - {"Bad Message destination"}, /* 15 */ - {"Bad Message Return Path"}, - {"Bad Mail Host"}, - {"Bad Message File"}, - {"\"sendmail_from\" not set in php.ini or custom \"From:\" header missing"}, - {"Mailserver rejected our \"sendmail_from\" setting"}, /* 20 */ - {"Error while trimming mail header with PCRE, please file a bug report at http://bugs.php.net/"} /* 21 */ -}; - -/* This pattern converts all single occurences of \n (Unix) - * withour a leading \r to \r\n and all occurences of \r (Mac) - * without a trailing \n to \r\n - * Thx to Nibbler from ircnet/#linuxger - */ -#define PHP_WIN32_MAIL_UNIFY_PATTERN "/(\r\n?)|\n/" -#define PHP_WIN32_MAIL_UNIFY_REPLACE "\r\n" - -/* This pattern removes \r\n from the start of the string, - * \r\n from the end of the string and also makes sure every line - * is only wrapped with a single \r\n (thus reduces multiple - * occurences of \r\n between lines to a single \r\n) */ -#define PHP_WIN32_MAIL_RMVDBL_PATTERN "/^\r\n|(\r\n)+$/m" -#define PHP_WIN32_MAIL_RMVDBL_REPLACE "" - -/* This pattern escapes \n. inside the message body. It prevents - * premature end of message if \n.\n or \r\n.\r\n is encountered - * and ensures that \n. sequences are properly displayed in the - * message body. */ -#define PHP_WIN32_MAIL_DOT_PATTERN "\n." -#define PHP_WIN32_MAIL_DOT_REPLACE "\n.." - -/* This function is meant to unify the headers passed to to mail() - * This means, use PCRE to transform single occurences of \n or \r in \r\n - * As a second step we also eleminate all \r\n occurences which are: - * 1) At the start of the header - * 2) At the end of the header - * 3) Two or more occurences in the header are removed so only one is left - * - * Returns NULL on error, or the new char* buffer on success. - * You have to take care and efree() the buffer on your own. - */ -static char *php_win32_mail_trim_header(char *header TSRMLS_DC) -{ - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - - char *result, *result2; - int result_len; - zval *replace; - - if (!header) { - return NULL; - } - - MAKE_STD_ZVAL(replace); - ZVAL_STRING(replace, PHP_WIN32_MAIL_UNIFY_REPLACE, 0); - - result = php_pcre_replace(PHP_WIN32_MAIL_UNIFY_PATTERN, sizeof(PHP_WIN32_MAIL_UNIFY_PATTERN)-1, - header, strlen(header), - replace, - 0, - &result_len, - -1, - NULL TSRMLS_CC); - if (NULL == result) { - FREE_ZVAL(replace); - return NULL; - } - - ZVAL_STRING(replace, PHP_WIN32_MAIL_RMVDBL_REPLACE, 0); - - result2 = php_pcre_replace(PHP_WIN32_MAIL_RMVDBL_PATTERN, sizeof(PHP_WIN32_MAIL_RMVDBL_PATTERN)-1, - result, result_len, - replace, - 0, - &result_len, - -1, - NULL TSRMLS_CC); - efree(result); - FREE_ZVAL(replace); - return result2; -#else - /* In case we don't have PCRE support (for whatever reason...) simply do nothing and return the unmodified header */ - return estrdup(header); -#endif -} - -/********************************************************************* -// Name: TSendMail -// Input: 1) host: Name of the mail host where the SMTP server resides -// max accepted length of name = 256 -// 2) appname: Name of the application to use in the X-mailer -// field of the message. if NULL is given the application -// name is used as given by the GetCommandLine() function -// max accespted length of name = 100 -// Output: 1) error: Returns the error code if something went wrong or -// SUCCESS otherwise. -// -// See SendText() for additional args! -//********************************************************************/ -PHPAPI int TSendMail(char *host, int *error, char **error_message, - char *headers, char *Subject, char *mailTo, char *data, - char *mailCc, char *mailBcc, char *mailRPath TSRMLS_DC) -{ - int ret; - char *RPath = NULL; - char *headers_lc = NULL; /* headers_lc is only created if we've a header at all */ - char *pos1 = NULL, *pos2 = NULL; - -#ifndef NETWARE - WinsockStarted = FALSE; -#endif - - if (host == NULL) { - *error = BAD_MAIL_HOST; - return FAILURE; - } else if (strlen(host) >= HOST_NAME_LEN) { - *error = BAD_MAIL_HOST; - return FAILURE; - } else { - strcpy(MailHost, host); - } - - if (headers) { - char *pos = NULL; - size_t i; - - /* Use PCRE to trim the header into the right format */ - if (NULL == (headers = php_win32_mail_trim_header(headers TSRMLS_CC))) { - *error = W32_SM_PCRE_ERROR; - return FAILURE; - } - - /* Create a lowercased header for all the searches so we're finally case - * insensitive when searching for a pattern. */ - if (NULL == (headers_lc = estrdup(headers))) { - efree(headers); - *error = OUT_OF_MEMORY; - return FAILURE; - } - for (i = 0; i < strlen(headers_lc); i++) { - headers_lc[i] = tolower(headers_lc[i]); - } - } - - /* Fall back to sendmail_from php.ini setting */ - if (mailRPath && *mailRPath) { - RPath = estrdup(mailRPath); - } else if (INI_STR("sendmail_from")) { - RPath = estrdup(INI_STR("sendmail_from")); - } else if ( headers_lc && - (pos1 = strstr(headers_lc, "from:")) && - ((pos1 == headers_lc) || (*(pos1-1) == '\n')) - ) { - /* Real offset is memaddress from the original headers + difference of - * string found in the lowercase headrs + 5 characters to jump over - * the from: */ - pos1 = headers + (pos1 - headers_lc) + 5; - if (NULL == (pos2 = strstr(pos1, "\r\n"))) { - RPath = estrndup(pos1, strlen(pos1)); - } else { - RPath = estrndup(pos1, pos2 - pos1); - } - } else { - if (headers) { - efree(headers); - efree(headers_lc); - } - *error = W32_SM_SENDMAIL_FROM_NOT_SET; - return FAILURE; - } - - /* attempt to connect with mail host */ - *error = MailConnect(); - if (*error != 0) { - if (RPath) { - efree(RPath); - } - if (headers) { - efree(headers); - efree(headers_lc); - } - /* 128 is safe here, the specifier in snprintf isn't longer than that */ - if (NULL == (*error_message = ecalloc(1, HOST_NAME_LEN + 128))) { - return FAILURE; - } - snprintf(*error_message, HOST_NAME_LEN + 128, - "Failed to connect to mailserver at \"%s\" port %d, verify your \"SMTP\" " - "and \"smtp_port\" setting in php.ini or use ini_set()", - MailHost, !INI_INT("smtp_port") ? 25 : INI_INT("smtp_port")); - return FAILURE; - } else { - ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers, headers_lc, error_message TSRMLS_CC); - TSMClose(); - if (RPath) { - efree(RPath); - } - if (headers) { - efree(headers); - efree(headers_lc); - } - if (ret != SUCCESS) { - *error = ret; - return FAILURE; - } - return SUCCESS; - } -} - -//******************************************************************** -// Name: TSendMail::~TSendMail -// Input: -// Output: -// Description: DESTRUCTOR -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -PHPAPI void TSMClose() -{ - Post("QUIT\r\n"); - Ack(NULL); - /* to guarantee that the cleanup is not made twice and - compomise the rest of the application if sockets are used - elesewhere - */ - - shutdown(sc, 0); - closesocket(sc); -} - - -/********************************************************************* -// Name: char *GetSMErrorText -// Input: Error index returned by the menber functions -// Output: pointer to a string containing the error description -// Description: -// Author/Date: jcar 20/9/96 -// History: -//*******************************************************************/ -PHPAPI char *GetSMErrorText(int index) -{ - if (MIN_ERROR_INDEX <= index && index < MAX_ERROR_INDEX) { - return (ErrorMessages[index]); - - } else { - return (ErrorMessages[UNKNOWN_ERROR]); - - } -} - - -/********************************************************************* -// Name: SendText -// Input: 1) RPath: return path of the message -// Is used to fill the "Return-Path" and the -// "X-Sender" fields of the message. -// 2) Subject: Subject field of the message. If NULL is given -// the subject is set to "No Subject" -// 3) mailTo: Destination address -// 4) data: Null terminated string containing the data to be send. -// 5,6) headers of the message. Note that the second -// parameter, headers_lc, is actually a lowercased version of -// headers. The should match exactly (in terms of length), -// only differ in case -// Output: Error code or SUCCESS -// Description: -// Author/Date: jcar 20/9/96 -// History: -//*******************************************************************/ -static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, - char *headers, char *headers_lc, char **error_message TSRMLS_DC) -{ - int res; - char *p; - char *tempMailTo, *token, *pos1, *pos2; - char *server_response = NULL; - char *stripped_header = NULL; - char *data_cln; - int data_cln_len; - - /* check for NULL parameters */ - if (data == NULL) - return (BAD_MSG_CONTENTS); - if (mailTo == NULL) - return (BAD_MSG_DESTINATION); - if (RPath == NULL) - return (BAD_MSG_RPATH); - - /* simple checks for the mailto address */ - /* have ampersand ? */ - /* mfischer, 20020514: I commented this out because it really - seems bogus. Only a username for example may still be a - valid address at the destination system. - if (strchr(mailTo, '@') == NULL) - return (BAD_MSG_DESTINATION); - */ - - snprintf(Buffer, sizeof(Buffer), "HELO %s\r\n", LocalHost); - - /* in the beggining of the dialog */ - /* attempt reconnect if the first Post fail */ - if ((res = Post(Buffer)) != SUCCESS) { - MailConnect(); - if ((res = Post(Buffer)) != SUCCESS) { - return (res); - } - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - return (res); - } - - SMTP_SKIP_SPACE(RPath); - snprintf(Buffer, MAIL_BUFFER_SIZE, "MAIL FROM:<%s>\r\n", RPath); - if ((res = Post(Buffer)) != SUCCESS) { - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - return W32_SM_SENDMAIL_FROM_MALFORMED; - } - - tempMailTo = estrdup(mailTo); - /* Send mail to all rcpt's */ - token = strtok(tempMailTo, ","); - while (token != NULL) - { - SMTP_SKIP_SPACE(token); - snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - efree(tempMailTo); - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - efree(tempMailTo); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - - if (mailCc && *mailCc) { - tempMailTo = estrdup(mailCc); - /* Send mail to all rcpt's */ - token = strtok(tempMailTo, ","); - while (token != NULL) - { - SMTP_SKIP_SPACE(token); - snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - efree(tempMailTo); - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - efree(tempMailTo); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - } - /* Send mail to all Cc rcpt's */ - else if (headers && (pos1 = strstr(headers_lc, "cc:")) && ((pos1 == headers_lc) || (*(pos1-1) == '\n'))) { - /* Real offset is memaddress from the original headers + difference of - * string found in the lowercase headrs + 3 characters to jump over - * the cc: */ - pos1 = headers + (pos1 - headers_lc) + 3; - if (NULL == (pos2 = strstr(pos1, "\r\n"))) { - tempMailTo = estrndup(pos1, strlen(pos1)); - } else { - tempMailTo = estrndup(pos1, pos2 - pos1); - } - - token = strtok(tempMailTo, ","); - while (token != NULL) - { - SMTP_SKIP_SPACE(token); - snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - efree(tempMailTo); - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - efree(tempMailTo); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - } - - /* Send mail to all Bcc rcpt's - This is basically a rip of the Cc code above. - Just don't forget to remove the Bcc: from the header afterwards. */ - if (mailBcc && *mailBcc) { - tempMailTo = estrdup(mailBcc); - /* Send mail to all rcpt's */ - token = strtok(tempMailTo, ","); - while (token != NULL) - { - SMTP_SKIP_SPACE(token); - snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - efree(tempMailTo); - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - efree(tempMailTo); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - } - else if (headers) { - if (pos1 = strstr(headers_lc, "bcc:")) { - /* Real offset is memaddress from the original headers + difference of - * string found in the lowercase headrs + 4 characters to jump over - * the bcc: */ - pos1 = headers + (pos1 - headers_lc) + 4; - if (NULL == (pos2 = strstr(pos1, "\r\n"))) { - tempMailTo = estrndup(pos1, strlen(pos1)); - /* Later, when we remove the Bcc: out of the - header we know it was the last thing. */ - pos2 = pos1; - } else { - tempMailTo = estrndup(pos1, pos2 - pos1); - } - - token = strtok(tempMailTo, ","); - while (token != NULL) - { - SMTP_SKIP_SPACE(token); - snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token); - if ((res = Post(Buffer)) != SUCCESS) { - efree(tempMailTo); - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - efree(tempMailTo); - return (res); - } - token = strtok(NULL, ","); - } - efree(tempMailTo); - - /* Now that we've identified that we've a Bcc list, - remove it from the current header. */ - if (NULL == (stripped_header = ecalloc(1, strlen(headers)))) { - return OUT_OF_MEMORY; - } - /* headers = point to string start of header - pos1 = pointer IN headers where the Bcc starts - '4' = Length of the characters 'bcc:' - Because we've added +4 above for parsing the Emails - we've to substract them here. */ - memcpy(stripped_header, headers, pos1 - headers - 4); - if (pos1 != pos2) { - /* if pos1 != pos2 , pos2 points to the rest of the headers. - Since pos1 != pos2 if "\r\n" was found, we know those characters - are there and so we jump over them (else we would generate a new header - which would look like "\r\n\r\n". */ - memcpy(stripped_header + (pos1 - headers - 4), pos2 + 2, strlen(pos2) - 2); - } - } - } - - /* Simplify the code that we create a copy of stripped_header no matter if - we actually strip something or not. So we've a single efree() later. */ - if (headers && !stripped_header) { - if (NULL == (stripped_header = estrndup(headers, strlen(headers)))) { - return OUT_OF_MEMORY; - } - } - - if ((res = Post("DATA\r\n")) != SUCCESS) { - if (stripped_header) { - efree(stripped_header); - } - return (res); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - if (stripped_header) { - efree(stripped_header); - } - return (res); - } - - /* send message header */ - if (Subject == NULL) { - res = PostHeader(RPath, "No Subject", mailTo, stripped_header TSRMLS_CC); - } else { - res = PostHeader(RPath, Subject, mailTo, stripped_header TSRMLS_CC); - } - if (stripped_header) { - efree(stripped_header); - } - if (res != SUCCESS) { - return (res); - } - - /* Escape \n. sequences - * We use php_str_to_str() and not php_str_replace_in_subject(), since the latter - * uses ZVAL as it's parameters */ - data_cln = php_str_to_str(data, strlen(data), PHP_WIN32_MAIL_DOT_PATTERN, sizeof(PHP_WIN32_MAIL_DOT_PATTERN) - 1, - PHP_WIN32_MAIL_DOT_REPLACE, sizeof(PHP_WIN32_MAIL_DOT_REPLACE) - 1, &data_cln_len); - if (!data_cln) { - data_cln = estrdup(""); - data_cln_len = 1; - } - - /* send message contents in 1024 chunks */ - { - char c, *e2, *e = data_cln + data_cln_len; - p = data_cln; - - while (e - p > 1024) { - e2 = p + 1024; - c = *e2; - *e2 = '\0'; - if ((res = Post(p)) != SUCCESS) { - efree(data_cln); - return(res); - } - *e2 = c; - p = e2; - } - if ((res = Post(p)) != SUCCESS) { - efree(data_cln); - return(res); - } - } - - efree(data_cln); - - /*send termination dot */ - if ((res = Post("\r\n.\r\n")) != SUCCESS) - return (res); - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - return (res); - } - - return (SUCCESS); -} - -static int addToHeader(char **header_buffer, const char *specifier, char *string) -{ - if (NULL == (*header_buffer = erealloc(*header_buffer, strlen(*header_buffer) + strlen(specifier) + strlen(string) + 1))) { - return 0; - } - sprintf(*header_buffer + strlen(*header_buffer), specifier, string); - return 1; -} - -/********************************************************************* -// Name: PostHeader -// Input: 1) return path -// 2) Subject -// 3) destination address -// 4) headers -// Output: Error code or Success -// Description: -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC) -{ - /* Print message header according to RFC 822 */ - /* Return-path, Received, Date, From, Subject, Sender, To, cc */ - - int res; - char *header_buffer; - char *headers_lc = NULL; - size_t i; - - if (xheaders) { - if (NULL == (headers_lc = estrdup(xheaders))) { - return OUT_OF_MEMORY; - } - for (i = 0; i < strlen(headers_lc); i++) { - headers_lc[i] = tolower(headers_lc[i]); - } - } - - header_buffer = ecalloc(1, MAIL_BUFFER_SIZE); - - if (!xheaders || !strstr(headers_lc, "date:")) { - time_t tNow = time(NULL); - char *dt = php_format_date("r", 1, tNow, 1 TSRMLS_CC); - - snprintf(header_buffer, MAIL_BUFFER_SIZE, "Date: %s\r\n", dt); - efree(dt); - } - - if (!headers_lc || !strstr(headers_lc, "from:")) { - if (!addToHeader(&header_buffer, "From: %s\r\n", RPath)) { - goto PostHeader_outofmem; - } - } - if (!addToHeader(&header_buffer, "Subject: %s\r\n", Subject)) { - goto PostHeader_outofmem; - } - - /* Only add the To: field from the $to parameter if isn't in the custom headers */ - if ((headers_lc && (!strstr(headers_lc, "\r\nto:") && (strncmp(headers_lc, "to:", 3) != 0))) || !headers_lc) { - if (!addToHeader(&header_buffer, "To: %s\r\n", mailTo)) { - goto PostHeader_outofmem; - } - } - if (xheaders) { - if (!addToHeader(&header_buffer, "%s\r\n", xheaders)) { - goto PostHeader_outofmem; - } - } - - if (headers_lc) { - efree(headers_lc); - } - if ((res = Post(header_buffer)) != SUCCESS) { - efree(header_buffer); - return (res); - } - efree(header_buffer); - - if ((res = Post("\r\n")) != SUCCESS) { - return (res); - } - - return (SUCCESS); - -PostHeader_outofmem: - if (headers_lc) { - efree(headers_lc); - } - return OUT_OF_MEMORY; -} - - - -/********************************************************************* -// Name: MailConnect -// Input: None -// Output: None -// Description: Connect to the mail host and receive the welcome message. -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static int MailConnect() -{ - - int res; - short portnum; - - /* Create Socket */ - if ((sc = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) - return (FAILED_TO_OBTAIN_SOCKET_HANDLE); - - /* Get our own host name */ - if (gethostname(LocalHost, HOST_NAME_LEN)) - return (FAILED_TO_GET_HOSTNAME); - - /* Resolve the servers IP */ - /* - if (!isdigit(MailHost[0])||!gethostbyname(MailHost)) - { - return (FAILED_TO_RESOLVE_HOST); - } - */ - - portnum = (short) INI_INT("smtp_port"); - if (!portnum) { - portnum = 25; - } - - /* Connect to server */ - sock_in.sin_family = AF_INET; - sock_in.sin_port = htons(portnum); - sock_in.sin_addr.S_un.S_addr = GetAddr(MailHost); - - if (connect(sc, (LPSOCKADDR) & sock_in, sizeof(sock_in))) - return (FAILED_TO_CONNECT); - - /* receive Server welcome message */ - res = Ack(NULL); - return (res); -} - - -/********************************************************************* -// Name: Post -// Input: -// Output: -// Description: -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static int Post(LPCSTR msg) -{ - int len = strlen(msg); - int slen; - int index = 0; - - while (len > 0) { - if ((slen = send(sc, msg + index, len, 0)) < 1) - return (FAILED_TO_SEND); - len -= slen; - index += slen; - } - return (SUCCESS); -} - - - -/********************************************************************* -// Name: Ack -// Input: -// Output: -// Description: -// Get the response from the server. We only want to know if the -// last command was successful. -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static int Ack(char **server_response) -{ - static char buf[MAIL_BUFFER_SIZE]; - int rlen; - int Index = 0; - int Received = 0; - -again: - - if ((rlen = recv(sc, buf + Index, ((MAIL_BUFFER_SIZE) - 1) - Received, 0)) < 1) { - return (FAILED_TO_RECEIVE); - } - Received += rlen; - buf[Received] = 0; - /*err_msg fprintf(stderr,"Received: (%d bytes) %s", rlen, buf + Index); */ - - /* Check for newline */ - Index += rlen; - - /* SMPT RFC says \r\n is the only valid line ending, who are we to argue ;) - * The response code must contain at least 5 characters ex. 220\r\n */ - if (Received < 5 || buf[Received - 1] != '\n' || buf[Received - 2] != '\r') { - goto again; - } - - if (buf[0] > '3') { - /* If we've a valid pointer, return the SMTP server response so the error message contains more information */ - if (server_response) { - int dec = 0; - /* See if we have something like \r, \n, \r\n or \n\r at the end of the message and chop it off */ - if (Received > 2) { - if (buf[Received-1] == '\n' || buf[Received-1] == '\r') { - dec++; - if (buf[Received-2] == '\r' || buf[Received-2] == '\n') { - dec++; - } - } - - } - *server_response = estrndup(buf, Received - dec); - } - return (SMTP_SERVER_ERROR); - } - - return (SUCCESS); -} - - -/********************************************************************* -// Name: unsigned long GetAddr (LPSTR szHost) -// Input: -// Output: -// Description: Given a string, it will return an IP address. -// - first it tries to convert the string directly -// - if that fails, it tries o resolve it as a hostname -// -// WARNING: gethostbyname() is a blocking function -// Author/Date: jcar 20/9/96 -// History: -//********************************************************************/ -static unsigned long GetAddr(LPSTR szHost) -{ - LPHOSTENT lpstHost; - u_long lAddr = INADDR_ANY; - - /* check that we have a string */ - if (*szHost) { - - /* check for a dotted-IP address string */ - lAddr = inet_addr(szHost); - - /* If not an address, then try to resolve it as a hostname */ - if ((lAddr == INADDR_NONE) && (strcmp(szHost, "255.255.255.255"))) { - - lpstHost = gethostbyname(szHost); - if (lpstHost) { /* success */ - lAddr = *((u_long FAR *) (lpstHost->h_addr)); - } else { - lAddr = INADDR_ANY; /* failure */ - } - } - } - return (lAddr); -} /* end GetAddr() */ diff --git a/win32/sendmail.h b/win32/sendmail.h deleted file mode 100644 index 0ec916d6c8fc7..0000000000000 --- a/win32/sendmail.h +++ /dev/null @@ -1,50 +0,0 @@ -#if !defined(sendmail_h) /* Sentry, use file only if it's not already included. */ -#define sendmail_h -#ifndef NETWARE -#include -#endif - -#define HOST_NAME_LEN 256 -#define MAX_APPNAME_LENGHT 100 -#define MAIL_BUFFER_SIZE (1024*4) /* 4k buffer */ -/* Return values */ -#define MIN_ERROR_INDEX 0 /* Always 0 like SUCCESS */ -#define SUCCESS 0 -#define FAILED_TO_PARSE_ARGUMENTS 1 -#define FAILED_TO_OPEN_MAILFILE 2 -#define FAILED_TO_START_SOCKETS 3 -#define FAILED_TO_RESOLVE_HOST 4 -#define FAILED_TO_OBTAIN_SOCKET_HANDLE 5 -#define FAILED_TO_CONNECT 6 -#define FAILED_TO_SEND 7 -#define FAILED_TO_RECEIVE 8 -#define SMTP_SERVER_ERROR 9 -#define FAILED_TO_GET_HOSTNAME 10 -#define OUT_OF_MEMORY 11 -#define UNKNOWN_ERROR 12 -#define BAD_MSG_CONTENTS 13 -#define BAD_MSG_SUBJECT 14 -#define BAD_MSG_DESTINATION 15 -#define BAD_MSG_RPATH 16 -#define BAD_MAIL_HOST 17 -#define BAD_MSG_FILE 18 -#define W32_SM_SENDMAIL_FROM_NOT_SET 19 -#define W32_SM_SENDMAIL_FROM_MALFORMED 20 -#define W32_SM_PCRE_ERROR 21 -#define MAX_ERROR_INDEX 22 /* Always last error message + 1 */ - - -PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message, - char *RPath, char *Subject, char *mailTo, char *data, - char *mailCc, char *mailBcc, char *mailRPath TSRMLS_DC); -PHPAPI void TSMClose(void); -static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, - char *headers, char *headers_lc, char **error_message TSRMLS_DC); -PHPAPI char *GetSMErrorText(int index); - -static int MailConnect(); -static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC); -static int Post(LPCSTR msg); -static int Ack(char **server_response); -static unsigned long GetAddr(LPSTR szHost); -#endif /* sendmail_h */ diff --git a/win32/signal.h b/win32/signal.h deleted file mode 100644 index de43f98e8075b..0000000000000 --- a/win32/signal.h +++ /dev/null @@ -1,16 +0,0 @@ -/* -** Change here: if you plan to use your own version of -** the original "#include " produces an infinite reinclusion -** of this file, instead of including the standard include-file. -** Under MS Visual Studio, there are occurences in the source where -** gets included throughout the PHP sources, and this should -** include THIS file, not the standard one which does not have the -** additional signals defined below. -** One way to remove the infinite reinclusion of this file (which is located -** in ../win32), is to specify the parent directory in which the standard -** include file is located. -*/ -#include <../include/signal.h> -#define SIGALRM 13 -#define SIGVTALRM 26 /* virtual time alarm */ -#define SIGPROF 27 /* profiling time alarm */ diff --git a/win32/syslog.h b/win32/syslog.h deleted file mode 100644 index f4b850da2951c..0000000000000 --- a/win32/syslog.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef SYSLOG_H -#define SYSLOG_H -#define WIN32_LEAN_AND_MEAN -#include - -#define LOG_EMERG 1 -#define LOG_ALERT 1 -#define LOG_CRIT 1 -#define LOG_ERR 4 -#define LOG_WARNING 5 -#define LOG_NOTICE 6 -#define LOG_INFO 6 -#define LOG_DEBUG 6 - -#define LOG_PRIMASK 0x07 - -#define LOG_PRI(p) ((p) & LOG_PRIMASK) -#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) - -#define LOG_KERN (0<<3) -#define LOG_USER (1<<3) -#define LOG_MAIL (2<<3) -#define LOG_DAEMON (3<<3) -#define LOG_AUTH (4<<3) -#define LOG_SYSLOG (5<<3) -#define LOG_LPR (6<<3) -#define LOG_NEWS (7<<3) -#define LOG_UUCP (8<<3) -#define LOG_CRON (9<<3) -#define LOG_AUTHPRIV (10<<3) - -#define LOG_NFACILITIES 10 -#define LOG_FACMASK 0x03f8 -#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) - -#define LOG_MASK(pri) (1 << (pri)) -#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) - -/* - * Option flags for openlog. - * - * LOG_ODELAY no longer does anything. - * LOG_NDELAY is the inverse of what it used to be. - */ -#define LOG_PID 0x01 /* log the pid with each message */ -#define LOG_CONS 0x02 /* log on the console if errors in sending */ -#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ -#define LOG_NDELAY 0x08 /* don't delay open */ -#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ -#define LOG_PERROR 0x20 /* log to stderr as well */ - - -extern void closelog(void); -extern void openlog(const char *, int, int); -extern void syslog(int, const char *, ...); - - -#endif /* SYSLOG_H */ diff --git a/win32/syslog.reg b/win32/syslog.reg deleted file mode 100644 index 2baa88e36661f..0000000000000 --- a/win32/syslog.reg +++ /dev/null @@ -1,5 +0,0 @@ -REGEDIT4 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.1.0-dev] -"TypesSupported"=dword:00000007 -"EventMessageFile"="C:\\php5\\php5ts.dll" diff --git a/win32/testsuite.dsp b/win32/testsuite.dsp deleted file mode 100644 index 5cd65622f5d66..0000000000000 --- a/win32/testsuite.dsp +++ /dev/null @@ -1,150 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testsuite" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Generic Project" 0x010a - -CFG=testsuite - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testsuite.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testsuite.mak" CFG="testsuite - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testsuite - Win32 Release_TS_Inline" (based on "Win32 (x86) Generic Project") -!MESSAGE "testsuite - Win32 Release_TS" (based on "Win32 (x86) Generic Project") -!MESSAGE "testsuite - Win32 Release_TSDbg" (based on "Win32 (x86) Generic Project") -!MESSAGE "testsuite - Win32 Debug_TS" (based on "Win32 (x86) Generic Project") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -MTL=midl.exe - -!IF "$(CFG)" == "testsuite - Win32 Release_TS_Inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS_Inline" -# PROP BASE Intermediate_Dir "Release_TS_Inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS_Inline" -# PROP Intermediate_Dir "..\..\" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TS" -# PROP Intermediate_Dir "..\..\" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TSDbg" -# PROP BASE Intermediate_Dir "Release_TSDbg" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\Release_TSDbg" -# PROP Intermediate_Dir "..\..\" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testsuite - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\Debug_TS" -# PROP Intermediate_Dir "..\..\" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "testsuite - Win32 Release_TS_Inline" -# Name "testsuite - Win32 Release_TS" -# Name "testsuite - Win32 Release_TSDbg" -# Name "testsuite - Win32 Debug_TS" -# Begin Source File - -SOURCE=..\results.txt - -!IF "$(CFG)" == "testsuite - Win32 Release_TS_Inline" - -# PROP Intermediate_Dir "..\Release_TS_Inline" -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Running Testsuite, please wait... -IntDir=.\..\Release_TS_Inline -InputPath=..\results.txt - -"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - set TOP_BUILDDIR=Release_TS_inline - set TEST_DIR=tests - $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt - -# End Custom Build - -!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TS" - -# PROP Intermediate_Dir "..\Release_TS" -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Running Testsuite, please wait... -IntDir=.\..\Release_TS -InputPath=..\results.txt - -"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - set TOP_BUILDDIR=Release_TS - set TEST_DIR=tests - $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt - -# End Custom Build - -!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TSDbg" - -# PROP Intermediate_Dir "..\Release_TSDbg" -# PROP Ignore_Default_Tool 1 -# Begin Custom Build - Running Testsuite, please wait... -IntDir=.\..\Release_TSDbg -InputPath=..\results.txt - -"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - set TOP_BUILDDIR=Release_TSDbg - set TEST_DIR=tests - $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt - -# End Custom Build - -!ELSEIF "$(CFG)" == "testsuite - Win32 Debug_TS" - -# PROP Intermediate_Dir "..\Debug_TS" -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# End Target -# End Project diff --git a/win32/time.c b/win32/time.c deleted file mode 100644 index 693f07418536e..0000000000000 --- a/win32/time.c +++ /dev/null @@ -1,228 +0,0 @@ - -/***************************************************************************** - * * - * DH_TIME.C * - * * - * Freely redistributable and modifiable. Use at your own risk. * - * * - * Copyright 1994 The Downhill Project * - * - * Modified by Shane Caraveo for use with PHP - * - *****************************************************************************/ - -/* $Id$ */ - - /** - * - * 04-Feb-2001 - * - Added patch by "Vanhanen, Reijo" - * Improves accuracy of msec - */ - -/* Include stuff ************************************************************ */ - -/* this allows the use of the WaitableTimer functions. - * For win98 and later */ -#define _WIN32_WINNT 0x400 - -#include "time.h" -#include "unistd.h" -#include "signal.h" -#include -#include -#include -#include -#include "php_win32_globals.h" - -int getfilesystemtime(struct timeval *time_Info) -{ -FILETIME ft; -__int64 ff; - - GetSystemTimeAsFileTime(&ft); /* 100 ns blocks since 01-Jan-1641 */ - /* resolution seems to be 0.01 sec */ - ff = *(__int64*)(&ft); - time_Info->tv_sec = (int)(ff/(__int64)10000000-(__int64)11644473600); - time_Info->tv_usec = (int)(ff % 10000000)/10; - return 0; -} - - - -PHPAPI int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info) -{ - __int64 timer; - LARGE_INTEGER li; - BOOL b; - double dt; - TSRMLS_FETCH(); - - /* Get the time, if they want it */ - if (time_Info != NULL) { - if (PW32G(starttime).tv_sec == 0) { - b = QueryPerformanceFrequency(&li); - if (!b) { - PW32G(starttime).tv_sec = -1; - } - else { - PW32G(freq) = li.QuadPart; - b = QueryPerformanceCounter(&li); - if (!b) { - PW32G(starttime).tv_sec = -1; - } - else { - getfilesystemtime(&PW32G(starttime)); - timer = li.QuadPart; - dt = (double)timer/PW32G(freq); - PW32G(starttime).tv_usec -= (int)((dt-(int)dt)*1000000); - if (PW32G(starttime).tv_usec < 0) { - PW32G(starttime).tv_usec += 1000000; - --PW32G(starttime).tv_sec; - } - PW32G(starttime).tv_sec -= (int)dt; - } - } - } - if (PW32G(starttime).tv_sec > 0) { - b = QueryPerformanceCounter(&li); - if (!b) { - PW32G(starttime).tv_sec = -1; - } - else { - timer = li.QuadPart; - if (timer < PW32G(lasttime)) { - getfilesystemtime(time_Info); - dt = (double)timer/PW32G(freq); - PW32G(starttime) = *time_Info; - PW32G(starttime).tv_usec -= (int)((dt-(int)dt)*1000000); - if (PW32G(starttime).tv_usec < 0) { - PW32G(starttime).tv_usec += 1000000; - --PW32G(starttime).tv_sec; - } - PW32G(starttime).tv_sec -= (int)dt; - } - else { - PW32G(lasttime) = timer; - dt = (double)timer/PW32G(freq); - time_Info->tv_sec = PW32G(starttime).tv_sec + (int)dt; - time_Info->tv_usec = PW32G(starttime).tv_usec + (int)((dt-(int)dt)*1000000); - if (time_Info->tv_usec > 1000000) { - time_Info->tv_usec -= 1000000; - ++time_Info->tv_sec; - } - } - } - } - if (PW32G(starttime).tv_sec < 0) { - getfilesystemtime(time_Info); - } - - } - /* Get the timezone, if they want it */ - if (timezone_Info != NULL) { - _tzset(); - timezone_Info->tz_minuteswest = _timezone; - timezone_Info->tz_dsttime = _daylight; - } - /* And return */ - return 0; -} - -void usleep(unsigned int useconds) -{ - HANDLE timer; - LARGE_INTEGER due; - - due.QuadPart = -(10 * (__int64)useconds); - - timer = CreateWaitableTimer(NULL, TRUE, NULL); - SetWaitableTimer(timer, &due, 0, NULL, NULL, 0); - WaitForSingleObject(timer, INFINITE); - CloseHandle(timer); -} - -#if 0 /* looks pretty ropey in here */ -#ifdef HAVE_SETITIMER - - -#ifndef THREAD_SAFE -unsigned int proftimer, virttimer, realtimer; -extern LPMSG phpmsg; -#endif - -struct timer_msg { - int signal; - unsigned int threadid; -}; - - -LPTIMECALLBACK setitimer_timeout(UINT uTimerID, UINT info, DWORD dwUser, DWORD dw1, DWORD dw2) -{ - struct timer_msg *msg = (struct timer_msg *) info; - - if (msg) { - raise((int) msg->signal); - PostThreadMessage(msg->threadid, - WM_NOTIFY, msg->signal, 0); - free(msg); - } - return 0; -} - -PHPAPI int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue) -{ - int timeout = value->it_value.tv_sec * 1000 + value->it_value.tv_usec; - int repeat = TIME_ONESHOT; - - /*make sure the message queue is initialized */ - PeekMessage(phpmsg, NULL, WM_USER, WM_USER, PM_NOREMOVE); - if (timeout > 0) { - struct timer_msg *msg = malloc(sizeof(struct timer_msg)); - msg->threadid = GetCurrentThreadId(); - if (!ovalue) { - repeat = TIME_PERIODIC; - } - switch (which) { - case ITIMER_REAL: - msg->signal = SIGALRM; - realtimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat); - break; - case ITIMER_VIRT: - msg->signal = SIGVTALRM; - virttimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat); - break; - case ITIMER_PROF: - msg->signal = SIGPROF; - proftimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat); - break; - default: - errno = EINVAL; - return -1; - break; - } - } else { - switch (which) { - case ITIMER_REAL: - timeKillEvent(realtimer); - break; - case ITIMER_VIRT: - timeKillEvent(virttimer); - break; - case ITIMER_PROF: - timeKillEvent(proftimer); - break; - default: - errno = EINVAL; - return -1; - break; - } - } - - - return 0; -} - -#endif -#endif - diff --git a/win32/time.h b/win32/time.h deleted file mode 100644 index 5c52e7837e166..0000000000000 --- a/win32/time.h +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * * - * sys/time.h * - * * - * Freely redistributable and modifiable. Use at your own risk. * - * * - * Copyright 1994 The Downhill Project * - * - * Modified by Shane Caraveo for PHP - * - *****************************************************************************/ -#ifndef TIME_H -#define TIME_H - -/* Include stuff ************************************************************ */ -#include -#include "php.h" - -/* Struct stuff ************************************************************* */ -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - - -struct itimerval { - struct timeval it_interval; /* next value */ - struct timeval it_value; /* current value */ -}; - -#define ITIMER_REAL 0 /*generates sigalrm */ -#define ITIMER_VIRTUAL 1 /*generates sigvtalrm */ -#define ITIMER_VIRT 1 /*generates sigvtalrm */ -#define ITIMER_PROF 2 /*generates sigprof */ - -/* Prototype stuff ********************************************************** */ -PHPAPI extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info); - -/* setitimer operates at 100 millisecond resolution */ -PHPAPI extern int setitimer(int which, const struct itimerval *value, - struct itimerval *ovalue); - -#endif diff --git a/win32/unistd.h b/win32/unistd.h deleted file mode 100644 index 96e0aedc13475..0000000000000 --- a/win32/unistd.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _PHP_WIN32_UNISTD_H -#define _PHP_WIN32_UNISTD_H -void usleep(unsigned int useconds); -#endif diff --git a/win32/wfile.c b/win32/wfile.c deleted file mode 100644 index 1407d6a32b26c..0000000000000 --- a/win32/wfile.c +++ /dev/null @@ -1,17 +0,0 @@ - -/* Function borrowed from the Downhill Project */ -#include "wfile.h" -#include "direct.h" - -int readlink(char *file_Name, char *buf_Mem, int buf_Size) -{ - /* See if the file exists */ - if (access(file_Name, X_OK) == -1) { - errno = ENOENT; - } else { - errno = EINVAL; - } - - /* Either way, it's not a link */ - return -1; -} diff --git a/win32/wfile.h b/win32/wfile.h deleted file mode 100644 index 2e79406478c75..0000000000000 --- a/win32/wfile.h +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include - -#define access _access -#define X_OK 0 -#ifndef ENOENT -#define ENOENT 136 -#endif -#ifndef EINVAL -#define EINVAL 131 -#endif - -int readlink(char *, char *, int); -int checkroot(char *path); diff --git a/win32/winutil.c b/win32/winutil.c deleted file mode 100644 index 16fda86e5f3f2..0000000000000 --- a/win32/winutil.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -PHPAPI char *php_win_err(int error) -{ - char *buf = NULL; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, 0, NULL - ); - - return (buf ? (char *) buf : ""); -} diff --git a/win32/winutil.h b/win32/winutil.h deleted file mode 100644 index d20218278ee19..0000000000000 --- a/win32/winutil.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.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. | - +----------------------------------------------------------------------+ - | Author: | - +----------------------------------------------------------------------+ - */ - -PHPAPI char *php_win_err(int error); - -#define php_win_err() php_win_err(GetLastError()) diff --git a/win32/wsyslog.c b/win32/wsyslog.c deleted file mode 100644 index 4266079e13496..0000000000000 --- a/win32/wsyslog.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * This file modified from sources for imap4 for use - * in PHP 3 - */ -/* - * Program: Unix compatibility routines - * - * Author: Mark Crispin - * Networks and Distributed Computing - * Computing & Communications - * University of Washington - * Administration Building, AG-44 - * Seattle, WA 98195 - * Internet: MRC@CAC.Washington.EDU - * - * Date: 14 September 1996 - * Last Edited: 22 October 1996 - * - * Copyright 1996 by the University of Washington - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appears in all copies and that both the - * above copyright notice and this permission notice appear in supporting - * documentation, and that the name of the University of Washington not be - * used in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. This software is made available - * "as is", and - * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, - * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN - * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT - * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION - * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - - -/* DEDICATION - - * This file is dedicated to my dog, Unix, also known as Yun-chan and - * Unix J. Terwilliker Jehosophat Aloysius Monstrosity Animal Beast. Unix - * passed away at the age of 11 1/2 on September 14, 1996, 12:18 PM PDT, after - * a two-month bout with cirrhosis of the liver. - * - * He was a dear friend, and I miss him terribly. - * - * Lift a leg, Yunie. Luv ya forever!!!! - */ - -#include "php.h" /*php specific */ -#include "syslog.h" -#include -#include -#include - -#include "php_win32_globals.h" -#include "wsyslog.h" - -void closelog(void) -{ - TSRMLS_FETCH(); - if (PW32G(log_source)) { - DeregisterEventSource(PW32G(log_source)); - PW32G(log_source) = NULL; - } - if (PW32G(log_header)) { - STR_FREE(PW32G(log_header)); - PW32G(log_header) = NULL; - } -} - -/* Emulator for BSD syslog() routine - * Accepts: priority - * message - * parameters - */ - -void syslog(int priority, const char *message, ...) -{ - va_list args; - LPTSTR strs[2]; - unsigned short etype; - char *tmp = NULL; - DWORD evid; - TSRMLS_FETCH(); - - /* default event source */ - if (!PW32G(log_source)) - openlog("php", LOG_PID, LOG_SYSLOG); - - switch (priority) { /* translate UNIX type into NT type */ - case LOG_ALERT: - etype = EVENTLOG_ERROR_TYPE; - evid = PHP_SYSLOG_ERROR_TYPE; - break; - case LOG_INFO: - etype = EVENTLOG_INFORMATION_TYPE; - evid = PHP_SYSLOG_INFO_TYPE; - break; - default: - etype = EVENTLOG_WARNING_TYPE; - evid = PHP_SYSLOG_WARNING_TYPE; - } - va_start(args, message); /* initialize vararg mechanism */ - vspprintf(&tmp, 0, message, args); /* build message */ - strs[0] = PW32G(log_header); /* write header */ - strs[1] = tmp; /* then the message */ - /* report the event */ - ReportEvent(PW32G(log_source), etype, (unsigned short) priority, evid, NULL, 2, 0, strs, NULL); - va_end(args); - efree(tmp); -} - - -/* Emulator for BSD openlog() routine - * Accepts: identity - * options - * facility - */ - -void openlog(const char *ident, int logopt, int facility) -{ - TSRMLS_FETCH(); - - if (PW32G(log_source)) { - closelog(); - } - - STR_FREE(PW32G(log_header)); - - PW32G(log_source) = RegisterEventSource(NULL, "PHP-" PHP_VERSION); - spprintf(&PW32G(log_header), 0, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid()); -}